Files
Lloyd a48b29837a feat: pre-restart config validation and site identification
- Add pre-restart config preflight to RestartModal with pass/warning/fail result panel and "Restart Anyway" confirmation for warnings
- Add Site Identification (site_name) config field shown as browser title and login page caption
- Add GET /api/validate_config and GET /api/site_info backend endpoints
- Sync document.title with site_name via system store watchEffect
- Fix authRegression.test.ts TS2367 type narrowing error
- add new radio hardware and radio settings tabs
2026-05-22 14:44:15 +01:00

3790 lines
4.4 MiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{t as e}from"./chunk-DECur_0Z.js";var t=e(((e,t)=>{(function(e,n){typeof t==`object`&&t.exports?t.exports=n():e.moduleName=n()})(typeof self<`u`?self:e,()=>{var e=(()=>{var e=Object.create,t=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,d=(e,t)=>{for(var n in t||={})c.call(t,n)&&u(e,n,t[n]);if(o)for(var n of o(t))l.call(t,n)&&u(e,n,t[n]);return e},f=(e,t)=>n(e,i(t)),p=(e,t)=>{var n={};for(var r in e)c.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&o)for(var r of o(e))t.indexOf(r)<0&&l.call(e,r)&&(n[r]=e[r]);return n},m=(e,t)=>()=>(e&&(t=e(e=0)),t),h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),g=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})},_=(e,n,i,o)=>{if(n&&typeof n==`object`||typeof n==`function`)for(let s of a(n))!c.call(e,s)&&s!==i&&t(e,s,{get:()=>n[s],enumerable:!(o=r(n,s))||o.enumerable});return e},v=(n,r,i)=>(i=n==null?{}:e(s(n)),_(r||!n||!n.__esModule?t(i,`default`,{value:n,enumerable:!0}):i,n)),y=e=>_(t({},`__esModule`,{value:!0}),e),b=h(e=>{e.version=`3.5.0`}),x=h((e,t)=>{(function(e,n,r){n[e]=n[e]||r(),t!==void 0&&t.exports&&(t.exports=n[e])})(`Promise`,typeof window<`u`?window:e,function(){var e,t,n,r=Object.prototype.toString,i=typeof setImmediate<`u`?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},`x`,{}),e=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:r!==!1})}}catch{e=function(e,t,n){return e[t]=n,e}}n=function(){var e,n,r;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,a){r=new i(t,a),n?n.next=r:e=r,n=r,r=void 0},drain:function(){var r=e;for(e=n=t=void 0;r;)r.fn.call(r.self),r=r.next}}}();function a(e,r){n.add(e,r),t||=i(n.drain)}function o(e){var t,n=typeof e;return e!=null&&(n==`object`||n==`function`)&&(t=e.then),typeof t==`function`?t:!1}function s(){for(var e=0;e<this.chain.length;e++)c(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function c(e,t,n){var r,i;try{t===!1?n.reject(e.msg):(r=t===!0?e.msg:t.call(void 0,e.msg),r===n.promise?n.reject(TypeError(`Promise-chain cycle`)):(i=o(r))?i.call(r,n.resolve,n.reject):n.resolve(r))}catch(e){n.reject(e)}}function l(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=o(e))?a(function(){var r=new f(n);try{t.call(e,function(){l.apply(r,arguments)},function(){u.apply(r,arguments)})}catch(e){u.call(r,e)}}):(n.msg=e,n.state=1,n.chain.length>0&&a(s,n))}catch(e){u.call(new f(n),e)}}}function u(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function d(e,t,n,r){for(var i=0;i<t.length;i++)(function(i){e.resolve(t[i]).then(function(e){n(i,e)},r)})(i)}function f(e){this.def=e,this.triggered=!1}function p(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function m(e){if(typeof e!=`function`)throw TypeError(`Not a function`);if(this.__NPO__!==0)throw TypeError(`Not a promise`);this.__NPO__=1;var t=new p(this);this.then=function(e,n){var r={success:typeof e==`function`?e:!0,failure:typeof n==`function`?n:!1};return r.promise=new this.constructor(function(e,t){if(typeof e!=`function`||typeof t!=`function`)throw TypeError(`Not a function`);r.resolve=e,r.reject=t}),t.chain.push(r),t.state!==0&&a(s,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){l.call(t,e)},function(e){u.call(t,e)})}catch(e){u.call(t,e)}}var h=e({},`constructor`,m,!1);return m.prototype=h,e(h,`__NPO__`,0,!1),e(m,`resolve`,function(e){var t=this;return e&&typeof e==`object`&&e.__NPO__===1?e:new t(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);t(e)})}),e(m,`reject`,function(e){return new this(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);n(e)})}),e(m,`all`,function(e){var t=this;return r.call(e)==`[object Array]`?e.length===0?t.resolve([]):new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);var i=e.length,a=Array(i),o=0;d(t,e,function(e,t){a[e]=t,++o===i&&n(a)},r)}):t.reject(TypeError(`Not an array`))}),e(m,`race`,function(e){var t=this;return r.call(e)==`[object Array]`?new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);d(t,e,function(e,t){n(t)},r)}):t.reject(TypeError(`Not an array`))}),m})}),S=h((e,t)=>{(function(){var e={version:`3.8.2`},n=[].slice,r=function(e){return n.call(e)},i=self.document;function a(e){return e&&(e.ownerDocument||e.document||e).documentElement}function o(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(i)try{r(i.documentElement.childNodes)[0].nodeType}catch{r=function(e){for(var t=e.length,n=Array(t);t--;)n[t]=e[t];return n}}if(Date.now||(Date.now=function(){return+new Date}),i)try{i.createElement(`DIV`).style.setProperty(`opacity`,0,``)}catch{var s=this.Element.prototype,c=s.setAttribute,l=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,d=u.setProperty;s.setAttribute=function(e,t){c.call(this,e,t+``)},s.setAttributeNS=function(e,t,n){l.call(this,e,t,n+``)},u.setProperty=function(e,t,n){d.call(this,e,t+``,n)}}e.ascending=f;function f(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}e.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},e.min=function(e,t){var n=-1,r=e.length,i,a;if(arguments.length===1){for(;++n<r;)if((a=e[n])!=null&&a>=a){i=a;break}for(;++n<r;)(a=e[n])!=null&&i>a&&(i=a)}else{for(;++n<r;)if((a=t.call(e,e[n],n))!=null&&a>=a){i=a;break}for(;++n<r;)(a=t.call(e,e[n],n))!=null&&i>a&&(i=a)}return i},e.max=function(e,t){var n=-1,r=e.length,i,a;if(arguments.length===1){for(;++n<r;)if((a=e[n])!=null&&a>=a){i=a;break}for(;++n<r;)(a=e[n])!=null&&a>i&&(i=a)}else{for(;++n<r;)if((a=t.call(e,e[n],n))!=null&&a>=a){i=a;break}for(;++n<r;)(a=t.call(e,e[n],n))!=null&&a>i&&(i=a)}return i},e.extent=function(e,t){var n=-1,r=e.length,i,a,o;if(arguments.length===1){for(;++n<r;)if((a=e[n])!=null&&a>=a){i=o=a;break}for(;++n<r;)(a=e[n])!=null&&(i>a&&(i=a),o<a&&(o=a))}else{for(;++n<r;)if((a=t.call(e,e[n],n))!=null&&a>=a){i=o=a;break}for(;++n<r;)(a=t.call(e,e[n],n))!=null&&(i>a&&(i=a),o<a&&(o=a))}return[i,o]};function p(e){return e===null?NaN:+e}function m(e){return!isNaN(e)}e.sum=function(e,t){var n=0,r=e.length,i,a=-1;if(arguments.length===1)for(;++a<r;)m(i=+e[a])&&(n+=i);else for(;++a<r;)m(i=+t.call(e,e[a],a))&&(n+=i);return n},e.mean=function(e,t){var n=0,r=e.length,i,a=-1,o=r;if(arguments.length===1)for(;++a<r;)m(i=p(e[a]))?n+=i:--o;else for(;++a<r;)m(i=p(t.call(e,e[a],a)))?n+=i:--o;if(o)return n/o},e.quantile=function(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],a=n-r;return a?i+a*(e[r]-i):i},e.median=function(t,n){var r=[],i=t.length,a,o=-1;if(arguments.length===1)for(;++o<i;)m(a=p(t[o]))&&r.push(a);else for(;++o<i;)m(a=p(n.call(t,t[o],o)))&&r.push(a);if(r.length)return e.quantile(r.sort(f),.5)},e.variance=function(e,t){var n=e.length,r=0,i,a,o=0,s=-1,c=0;if(arguments.length===1)for(;++s<n;)m(i=p(e[s]))&&(a=i-r,r+=a/++c,o+=a*(i-r));else for(;++s<n;)m(i=p(t.call(e,e[s],s)))&&(a=i-r,r+=a/++c,o+=a*(i-r));if(c>1)return o/(c-1)},e.deviation=function(){var t=e.variance.apply(this,arguments);return t&&Math.sqrt(t)};function h(e){return{left:function(t,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r<i;){var a=r+i>>>1;e(t[a],n)<0?r=a+1:i=a}return r},right:function(t,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r<i;){var a=r+i>>>1;e(t[a],n)>0?i=a:r=a+1}return r}}}var g=h(f);e.bisectLeft=g.left,e.bisect=e.bisectRight=g.right,e.bisector=function(e){return h(e.length===1?function(t,n){return f(e(t),n)}:e)},e.shuffle=function(e,t,n){(r=arguments.length)<3&&(n=e.length,r<2&&(t=0));for(var r=n-t,i,a;r;)a=Math.random()*r--|0,i=e[r+t],e[r+t]=e[a+t],e[a+t]=i;return e},e.permute=function(e,t){for(var n=t.length,r=Array(n);n--;)r[n]=e[t[n]];return r},e.pairs=function(e){for(var t=0,n=e.length-1,r=e[0],i=Array(n<0?0:n);t<n;)i[t]=[r,r=e[++t]];return i},e.transpose=function(t){if(!(o=t.length))return[];for(var n=-1,r=e.min(t,_),i=Array(r);++n<r;)for(var a=-1,o,s=i[n]=Array(o);++a<o;)s[a]=t[a][n];return i};function _(e){return e.length}e.zip=function(){return e.transpose(arguments)},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t},e.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},e.entries=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t},e.merge=function(e){for(var t=e.length,n,r=-1,i=0,a,o;++r<t;)i+=e[r].length;for(a=Array(i);--t>=0;)for(o=e[t],n=o.length;--n>=0;)a[--i]=o[n];return a};var v=Math.abs;e.range=function(e,t,n){if(arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0)),(t-e)/n===1/0)throw Error(`infinite range`);var r=[],i=y(v(n)),a=-1,o;if(e*=i,t*=i,n*=i,n<0)for(;(o=e+n*++a)>t;)r.push(o/i);else for(;(o=e+n*++a)<t;)r.push(o/i);return r};function y(e){for(var t=1;e*t%1;)t*=10;return t}function b(e,t){for(var n in t)Object.defineProperty(e.prototype,n,{value:t[n],enumerable:!1})}e.map=function(e,t){var n=new x;if(e instanceof x)e.forEach(function(e,t){n.set(e,t)});else if(Array.isArray(e)){var r=-1,i=e.length,a;if(arguments.length===1)for(;++r<i;)n.set(r,e[r]);else for(;++r<i;)n.set(t.call(e,a=e[r],r),a)}else for(var o in e)n.set(o,e[o]);return n};function x(){this._=Object.create(null)}var S=`__proto__`,C=`\0`;b(x,{has:E,get:function(e){return this._[w(e)]},set:function(e,t){return this._[w(e)]=t},remove:D,keys:O,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:T(t),value:this._[t]});return e},size:k,empty:A,forEach:function(e){for(var t in this._)e.call(this,T(t),this._[t])}});function w(e){return(e+=``)===S||e[0]===C?C+e:e}function T(e){return(e+=``)[0]===C?e.slice(1):e}function E(e){return w(e)in this._}function D(e){return(e=w(e))in this._&&delete this._[e]}function O(){var e=[];for(var t in this._)e.push(T(t));return e}function k(){var e=0;for(var t in this._)++e;return e}function A(){for(var e in this._)return!1;return!0}e.nest=function(){var t={},n=[],r=[],i,a;function o(e,r,s){if(s>=n.length)return a?a.call(t,r):i?r.sort(i):r;for(var c=-1,l=r.length,u=n[s++],d,f,p,m=new x,h;++c<l;)(h=m.get(d=u(f=r[c])))?h.push(f):m.set(d,[f]);return e?(f=e(),p=function(t,n){f.set(t,o(e,n,s))}):(f={},p=function(t,n){f[t]=o(e,n,s)}),m.forEach(p),f}function s(e,t){if(t>=n.length)return e;var i=[],a=r[t++];return e.forEach(function(e,n){i.push({key:e,values:s(n,t)})}),a?i.sort(function(e,t){return a(e.key,t.key)}):i}return t.map=function(e,t){return o(t,e,0)},t.entries=function(t){return s(o(e.map,t,0),0)},t.key=function(e){return n.push(e),t},t.sortKeys=function(e){return r[n.length-1]=e,t},t.sortValues=function(e){return i=e,t},t.rollup=function(e){return a=e,t},t},e.set=function(e){var t=new j;if(e)for(var n=0,r=e.length;n<r;++n)t.add(e[n]);return t};function j(){this._=Object.create(null)}b(j,{has:E,add:function(e){return this._[w(e+=``)]=!0,e},remove:D,values:O,size:k,empty:A,forEach:function(e){for(var t in this._)e.call(this,T(t))}}),e.behavior={};function M(e){return e}e.rebind=function(e,t){for(var n=1,r=arguments.length,i;++n<r;)e[i=arguments[n]]=N(e,t,t[i]);return e};function N(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}function P(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var n=0,r=F.length;n<r;++n){var i=F[n]+t;if(i in e)return i}}var F=[`webkit`,`ms`,`moz`,`Moz`,`o`,`O`];function I(){}e.dispatch=function(){for(var e=new L,t=-1,n=arguments.length;++t<n;)e[arguments[t]]=R(e);return e};function L(){}L.prototype.on=function(e,t){var n=e.indexOf(`.`),r=``;if(n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),e)return arguments.length<2?this[e].on(r):this[e].on(r,t);if(arguments.length===2){if(t==null)for(e in this)this.hasOwnProperty(e)&&this[e].on(r,null);return this}};function R(e){var t=[],n=new x;function r(){for(var n=t,r=-1,i=n.length,a;++r<i;)(a=n[r].on)&&a.apply(this,arguments);return e}return r.on=function(r,i){var a=n.get(r),o;return arguments.length<2?a&&a.on:(a&&(a.on=null,t=t.slice(0,o=t.indexOf(a)).concat(t.slice(o+1)),n.remove(r)),i&&t.push(n.set(r,{on:i})),e)},r}e.event=null;function z(){e.event.preventDefault()}function B(){for(var t=e.event,n;n=t.sourceEvent;)t=n;return t}function V(t){for(var n=new L,r=0,i=arguments.length;++r<i;)n[arguments[r]]=R(n);return n.of=function(r,i){return function(a){try{var o=a.sourceEvent=e.event;a.target=t,e.event=a,n[a.type].apply(r,i)}finally{e.event=o}}},n}e.requote=function(e){return e.replace(H,`\\$&`)};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]};function W(e){return U(e,J),e}var G=function(e,t){return t.querySelector(e)},K=function(e,t){return t.querySelectorAll(e)},q=function(e,t){var n=e.matches||e[P(e,`matchesSelector`)];return q=function(e,t){return n.call(e,t)},q(e,t)};typeof Sizzle==`function`&&(G=function(e,t){return Sizzle(e,t)[0]||null},K=Sizzle,q=Sizzle.matchesSelector),e.selection=function(){return e.select(i.documentElement)};var J=e.selection.prototype=[];J.select=function(e){var t=[],n,r,i,a;e=Y(e);for(var o=-1,s=this.length;++o<s;){t.push(n=[]),n.parentNode=(i=this[o]).parentNode;for(var c=-1,l=i.length;++c<l;)(a=i[c])?(n.push(r=e.call(a,a.__data__,c,o)),r&&`__data__`in a&&(r.__data__=a.__data__)):n.push(null)}return W(t)};function Y(e){return typeof e==`function`?e:function(){return G(e,this)}}J.selectAll=function(e){var t=[],n,i;e=X(e);for(var a=-1,o=this.length;++a<o;)for(var s=this[a],c=-1,l=s.length;++c<l;)(i=s[c])&&(t.push(n=r(e.call(i,i.__data__,c,a))),n.parentNode=i);return W(t)};function X(e){return typeof e==`function`?e:function(){return K(e,this)}}var Z=`http://www.w3.org/1999/xhtml`,Q={svg:`http://www.w3.org/2000/svg`,xhtml:Z,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};e.ns={prefix:Q,qualify:function(e){var t=e.indexOf(`:`),n=e;return t>=0&&(n=e.slice(0,t))!==`xmlns`&&(e=e.slice(t+1)),Q.hasOwnProperty(n)?{space:Q[n],local:e}:e}},J.attr=function(t,n){if(arguments.length<2){if(typeof t==`string`){var r=this.node();return t=e.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(n in t)this.each(ee(n,t[n]));return this}return this.each(ee(t,n))};function ee(t,n){t=e.ns.qualify(t);function r(){this.removeAttribute(t)}function i(){this.removeAttributeNS(t.space,t.local)}function a(){this.setAttribute(t,n)}function o(){this.setAttributeNS(t.space,t.local,n)}function s(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}function c(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}return n==null?t.local?i:r:typeof n==`function`?t.local?c:s:t.local?o:a}function te(e){return e.trim().replace(/\s+/g,` `)}J.classed=function(e,t){if(arguments.length<2){if(typeof e==`string`){var n=this.node(),r=(e=re(e)).length,i=-1;if(t=n.classList){for(;++i<r;)if(!t.contains(e[i]))return!1}else for(t=n.getAttribute(`class`);++i<r;)if(!ne(e[i]).test(t))return!1;return!0}for(t in e)this.each(ie(t,e[t]));return this}return this.each(ie(e,t))};function ne(t){return RegExp(`(?:^|\\s+)`+e.requote(t)+`(?:\\s+|$)`,`g`)}function re(e){return(e+``).trim().split(/^|\s+/)}function ie(e,t){e=re(e).map(ae);var n=e.length;function r(){for(var r=-1;++r<n;)e[r](this,t)}function i(){for(var r=-1,i=t.apply(this,arguments);++r<n;)e[r](this,i)}return typeof t==`function`?i:r}function ae(e){var t=ne(e);return function(n,r){if(i=n.classList)return r?i.add(e):i.remove(e);var i=n.getAttribute(`class`)||``;r?(t.lastIndex=0,t.test(i)||n.setAttribute(`class`,te(i+` `+e))):n.setAttribute(`class`,te(i.replace(t,` `)))}}J.style=function(e,t,n){var r=arguments.length;if(r<3){if(typeof e!=`string`){for(n in r<2&&(t=``),e)this.each(oe(n,e[n],t));return this}if(r<2){var i=this.node();return o(i).getComputedStyle(i,null).getPropertyValue(e)}n=``}return this.each(oe(e,t,n))};function oe(e,t,n){function r(){this.style.removeProperty(e)}function i(){this.style.setProperty(e,t,n)}function a(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}return t==null?r:typeof t==`function`?a:i}J.property=function(e,t){if(arguments.length<2){if(typeof e==`string`)return this.node()[e];for(t in e)this.each(se(t,e[t]));return this}return this.each(se(e,t))};function se(e,t){function n(){delete this[e]}function r(){this[e]=t}function i(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}return t==null?n:typeof t==`function`?i:r}J.text=function(e){return arguments.length?this.each(typeof e==`function`?function(){this.textContent=e.apply(this,arguments)??``}:e==null?function(){this.textContent=``}:function(){this.textContent=e}):this.node().textContent},J.html=function(e){return arguments.length?this.each(typeof e==`function`?function(){this.innerHTML=e.apply(this,arguments)??``}:e==null?function(){this.innerHTML=``}:function(){this.innerHTML=e}):this.node().innerHTML},J.append=function(e){return e=ce(e),this.select(function(){return this.appendChild(e.apply(this,arguments))})};function ce(t){function n(){var e=this.ownerDocument,n=this.namespaceURI;return n===Z&&e.documentElement.namespaceURI===Z?e.createElement(t):e.createElementNS(n,t)}function r(){return this.ownerDocument.createElementNS(t.space,t.local)}return typeof t==`function`?t:(t=e.ns.qualify(t)).local?r:n}J.insert=function(e,t){return e=ce(e),t=Y(t),this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})},J.remove=function(){return this.each(le)};function le(){var e=this.parentNode;e&&e.removeChild(this)}J.data=function(e,t){var n=-1,r=this.length,i,a;if(!arguments.length){for(e=Array(r=(i=this[0]).length);++n<r;)(a=i[n])&&(e[n]=a.__data__);return e}function o(e,n){var r,i=e.length,a=n.length,o=Math.min(i,a),u=Array(a),d=Array(a),f=Array(i),p,m;if(t){var h=new x,g=Array(i),_;for(r=-1;++r<i;)(p=e[r])&&(h.has(_=t.call(p,p.__data__,r))?f[r]=p:h.set(_,p),g[r]=_);for(r=-1;++r<a;)(p=h.get(_=t.call(n,m=n[r],r)))?p!==!0&&(u[r]=p,p.__data__=m):d[r]=ue(m),h.set(_,!0);for(r=-1;++r<i;)r in g&&h.get(g[r])!==!0&&(f[r]=e[r])}else{for(r=-1;++r<o;)p=e[r],m=n[r],p?(p.__data__=m,u[r]=p):d[r]=ue(m);for(;r<a;++r)d[r]=ue(n[r]);for(;r<i;++r)f[r]=e[r]}d.update=u,d.parentNode=u.parentNode=f.parentNode=e.parentNode,s.push(d),c.push(u),l.push(f)}var s=me([]),c=W([]),l=W([]);if(typeof e==`function`)for(;++n<r;)o(i=this[n],e.call(i,i.parentNode.__data__,n));else for(;++n<r;)o(i=this[n],e);return c.enter=function(){return s},c.exit=function(){return l},c};function ue(e){return{__data__:e}}J.datum=function(e){return arguments.length?this.property(`__data__`,e):this.property(`__data__`)},J.filter=function(e){var t=[],n,r,i;typeof e!=`function`&&(e=de(e));for(var a=0,o=this.length;a<o;a++){t.push(n=[]),n.parentNode=(r=this[a]).parentNode;for(var s=0,c=r.length;s<c;s++)(i=r[s])&&e.call(i,i.__data__,s,a)&&n.push(i)}return W(t)};function de(e){return function(){return q(this,e)}}J.order=function(){for(var e=-1,t=this.length;++e<t;)for(var n=this[e],r=n.length-1,i=n[r],a;--r>=0;)(a=n[r])&&(i&&i!==a.nextSibling&&i.parentNode.insertBefore(a,i),i=a);return this},J.sort=function(e){e=fe.apply(this,arguments);for(var t=-1,n=this.length;++t<n;)this[t].sort(e);return this.order()};function fe(e){return arguments.length||(e=f),function(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}}J.each=function(e){return pe(this,function(t,n,r){e.call(t,t.__data__,n,r)})};function pe(e,t){for(var n=0,r=e.length;n<r;n++)for(var i=e[n],a=0,o=i.length,s;a<o;a++)(s=i[a])&&t(s,a,n);return e}J.call=function(e){var t=r(arguments);return e.apply(t[0]=this,t),this},J.empty=function(){return!this.node()},J.node=function(){for(var e=0,t=this.length;e<t;e++)for(var n=this[e],r=0,i=n.length;r<i;r++){var a=n[r];if(a)return a}return null},J.size=function(){var e=0;return pe(this,function(){++e}),e};function me(e){return U(e,he),e}var he=[];e.selection.enter=me,e.selection.enter.prototype=he,he.append=J.append,he.empty=J.empty,he.node=J.node,he.call=J.call,he.size=J.size,he.select=function(e){for(var t=[],n,r,i,a,o,s=-1,c=this.length;++s<c;){i=(a=this[s]).update,t.push(n=[]),n.parentNode=a.parentNode;for(var l=-1,u=a.length;++l<u;)(o=a[l])?(n.push(i[l]=r=e.call(a.parentNode,o.__data__,l,s)),r.__data__=o.__data__):n.push(null)}return W(t)},he.insert=function(e,t){return arguments.length<2&&(t=ge(this)),J.insert.call(this,e,t)};function ge(e){var t,n;return function(r,i,a){var o=e[a].update,s=o.length,c;for(a!=n&&(n=a,t=0),i>=t&&(t=i+1);!(c=o[t])&&++t<s;);return c}}e.select=function(e){var t;return typeof e==`string`?(t=[G(e,i)],t.parentNode=i.documentElement):(t=[e],t.parentNode=a(e)),W([t])},e.selectAll=function(e){var t;return typeof e==`string`?(t=r(K(e,i)),t.parentNode=i.documentElement):(t=r(e),t.parentNode=null),W([t])},J.on=function(e,t,n){var r=arguments.length;if(r<3){if(typeof e!=`string`){for(n in r<2&&(t=!1),e)this.each(_e(n,e[n],t));return this}if(r<2)return(r=this.node()[`__on`+e])&&r._;n=!1}return this.each(_e(e,t,n))};function _e(t,n,i){var a=`__on`+t,o=t.indexOf(`.`),s=ye;o>0&&(t=t.slice(0,o));var c=ve.get(t);c&&(t=c,s=be);function l(){var e=this[a];e&&(this.removeEventListener(t,e,e.$),delete this[a])}function u(){var e=s(n,r(arguments));l.call(this),this.addEventListener(t,this[a]=e,e.$=i),e._=n}function d(){var n=RegExp(`^__on([^.]+)`+e.requote(t)+`$`),r;for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}return o?n?u:l:n?I:d}var ve=e.map({mouseenter:`mouseover`,mouseleave:`mouseout`});i&&ve.forEach(function(e){`on`+e in i&&ve.remove(e)});function ye(t,n){return function(r){var i=e.event;e.event=r,n[0]=this.__data__;try{t.apply(this,n)}finally{e.event=i}}}function be(e,t){var n=ye(e,t);return function(e){var t=this,r=e.relatedTarget;(!r||r!==t&&!(r.compareDocumentPosition(t)&8))&&n.call(t,e)}}var xe,Se=0;function Ce(t){var n=`.dragsuppress-`+ ++Se,r=`click`+n,i=e.select(o(t)).on(`touchmove`+n,z).on(`dragstart`+n,z).on(`selectstart`+n,z);if(xe??=`onselectstart`in t?!1:P(t.style,`userSelect`),xe){var s=a(t).style,c=s[xe];s[xe]=`none`}return function(e){if(i.on(n,null),xe&&(s[xe]=c),e){var t=function(){i.on(r,null)};i.on(r,function(){z(),t()},!0),setTimeout(t,0)}}}e.mouse=function(e){return Te(e,B())};var we=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Te(t,n){n.changedTouches&&(n=n.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(we<0){var a=o(t);if(a.scrollX||a.scrollY){r=e.select(`body`).append(`svg`).style({position:`absolute`,top:0,left:0,margin:0,padding:0,border:`none`},`important`);var s=r[0][0].getScreenCTM();we=!(s.f||s.e),r.remove()}}return we?(i.x=n.pageX,i.y=n.pageY):(i.x=n.clientX,i.y=n.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var c=t.getBoundingClientRect();return[n.clientX-c.left-t.clientLeft,n.clientY-c.top-t.clientTop]}e.touch=function(e,t,n){if(arguments.length<3&&(n=t,t=B().changedTouches),t){for(var r=0,i=t.length,a;r<i;++r)if((a=t[r]).identifier===n)return Te(e,a)}},e.behavior.drag=function(){var t=V(a,`drag`,`dragstart`,`dragend`),n=null,r=s(I,e.mouse,o,`mousemove`,`mouseup`),i=s(Ee,e.touch,M,`touchmove`,`touchend`);function a(){this.on(`mousedown.drag`,r).on(`touchstart.drag`,i)}function s(r,i,a,o,s){return function(){var c=this,l=e.event.target.correspondingElement||e.event.target,u=c.parentNode,d=t.of(c,arguments),f=0,p=r(),m=`.drag`+(p==null?``:`-`+p),h,g=e.select(a(l)).on(o+m,y).on(s+m,b),_=Ce(l),v=i(u,p);n?(h=n.apply(c,arguments),h=[h.x-v[0],h.y-v[1]]):h=[0,0],d({type:`dragstart`});function y(){var e=i(u,p),t,n;e&&(t=e[0]-v[0],n=e[1]-v[1],f|=t|n,v=e,d({type:`drag`,x:e[0]+h[0],y:e[1]+h[1],dx:t,dy:n}))}function b(){i(u,p)&&(g.on(o+m,null).on(s+m,null),_(f),d({type:`dragend`}))}}}return a.origin=function(e){return arguments.length?(n=e,a):n},e.rebind(a,t,`on`)};function Ee(){return e.event.changedTouches[0].identifier}e.touches=function(e,t){return arguments.length<2&&(t=B().touches),t?r(t).map(function(t){var n=Te(e,t);return n.identifier=t.identifier,n}):[]};var De=1e-6,Oe=De*De,ke=Math.PI,Ae=2*ke,je=Ae-De,Me=ke/2,Ne=ke/180,Pe=180/ke;function Fe(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function Ie(e){return e>1?Me:e<-1?-Me:Math.asin(e)}function Le(e){return((e=Math.exp(e))-1/e)/2}function Re(e){return((e=Math.exp(e))+1/e)/2}function ze(e){return((e=Math.exp(2*e))-1)/(e+1)}var Be=Math.SQRT2,Ve=2,He=4;e.interpolateZoom=function(e,t){var n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],s=t[2],c=a-n,l=o-r,u=c*c+l*l,d,f;if(u<Oe)f=Math.log(s/i)/Be,d=function(e){return[n+e*c,r+e*l,i*Math.exp(Be*e*f)]};else{var p=Math.sqrt(u),m=(s*s-i*i+He*u)/(2*i*Ve*p),h=(s*s-i*i-He*u)/(2*s*Ve*p),g=Math.log(Math.sqrt(m*m+1)-m);f=(Math.log(Math.sqrt(h*h+1)-h)-g)/Be,d=function(e){var t=e*f,a=Re(g),o=i/(Ve*p)*(a*ze(Be*t+g)-Le(g));return[n+o*c,r+o*l,i*a/Re(Be*t+g)]}}return d.duration=f*1e3,d},e.behavior.zoom=function(){var t={x:0,y:0,k:1},n,r,a,s=[960,500],c=Ue,l=250,u=0,d=`mousedown.zoom`,f=`mousemove.zoom`,p=`mouseup.zoom`,m,h=`touchstart.zoom`,g,_=V(S,`zoomstart`,`zoom`,`zoomend`),v,y,b,x;Ge||=`onwheel`in i?(We=function(){return-e.event.deltaY*(e.event.deltaMode?120:1)},`wheel`):`onmousewheel`in i?(We=function(){return e.event.wheelDelta},`mousewheel`):(We=function(){return-e.event.detail},`MozMousePixelScroll`);function S(e){e.on(d,M).on(Ge+`.zoom`,P).on(`dblclick.zoom`,F).on(h,N)}S.event=function(n){n.each(function(){var n=_.of(this,arguments),i=t;Va?e.select(this).transition().each(`start.zoom`,function(){t=this.__chart__||{x:0,y:0,k:1},k(n)}).tween(`zoom:zoom`,function(){var a=s[0],o=s[1],c=r?r[0]:a/2,l=r?r[1]:o/2,u=e.interpolateZoom([(c-t.x)/t.k,(l-t.y)/t.k,a/t.k],[(c-i.x)/i.k,(l-i.y)/i.k,a/i.k]);return function(e){var r=u(e),i=a/r[2];this.__chart__=t={x:c-r[0]*i,y:l-r[1]*i,k:i},A(n)}}).each(`interrupt.zoom`,function(){j(n)}).each(`end.zoom`,function(){j(n)}):(this.__chart__=t,k(n),A(n),j(n))})},S.translate=function(e){return arguments.length?(t={x:+e[0],y:+e[1],k:t.k},O(),S):[t.x,t.y]},S.scale=function(e){return arguments.length?(t={x:t.x,y:t.y,k:null},T(+e),O(),S):t.k},S.scaleExtent=function(e){return arguments.length?(c=e==null?Ue:[+e[0],+e[1]],S):c},S.center=function(e){return arguments.length?(a=e&&[+e[0],+e[1]],S):a},S.size=function(e){return arguments.length?(s=e&&[+e[0],+e[1]],S):s},S.duration=function(e){return arguments.length?(l=+e,S):l},S.x=function(e){return arguments.length?(y=e,v=e.copy(),t={x:0,y:0,k:1},S):y},S.y=function(e){return arguments.length?(x=e,b=e.copy(),t={x:0,y:0,k:1},S):x};function C(e){return[(e[0]-t.x)/t.k,(e[1]-t.y)/t.k]}function w(e){return[e[0]*t.k+t.x,e[1]*t.k+t.y]}function T(e){t.k=Math.max(c[0],Math.min(c[1],e))}function E(e,n){n=w(n),t.x+=e[0]-n[0],t.y+=e[1]-n[1]}function D(n,i,a,o){n.__chart__={x:t.x,y:t.y,k:t.k},T(2**o),E(r=i,a),n=e.select(n),l>0&&(n=n.transition().duration(l)),n.call(S.event)}function O(){y&&y.domain(v.range().map(function(e){return(e-t.x)/t.k}).map(v.invert)),x&&x.domain(b.range().map(function(e){return(e-t.y)/t.k}).map(b.invert))}function k(e){u++||e({type:`zoomstart`})}function A(e){O(),e({type:`zoom`,scale:t.k,translate:[t.x,t.y]})}function j(e){--u||(e({type:`zoomend`}),r=null)}function M(){var t=this,n=_.of(t,arguments),r=0,i=e.select(o(t)).on(f,c).on(p,l),a=C(e.mouse(t)),s=Ce(t);Ia.call(t),k(n);function c(){r=1,E(e.mouse(t),a),A(n)}function l(){i.on(f,null).on(p,null),s(r),j(n)}}function N(){var n=this,r=_.of(n,arguments),i={},a=0,o,s=`.zoom-`+e.event.changedTouches[0].identifier,c=`touchmove`+s,l=`touchend`+s,u=[],f=e.select(n),p=Ce(n);v(),k(r),f.on(d,null).on(h,v);function m(){var r=e.touches(n);return o=t.k,r.forEach(function(e){e.identifier in i&&(i[e.identifier]=C(e))}),r}function v(){var r=e.event.target;e.select(r).on(c,y).on(l,b),u.push(r);for(var o=e.event.changedTouches,s=0,d=o.length;s<d;++s)i[o[s].identifier]=null;var f=m(),p=Date.now();if(f.length===1){if(p-g<500){var h=f[0];D(n,h,i[h.identifier],Math.floor(Math.log(t.k)/Math.LN2)+1),z()}g=p}else if(f.length>1){var h=f[0],_=f[1],v=h[0]-_[0],x=h[1]-_[1];a=v*v+x*x}}function y(){var t=e.touches(n),s,c,l,u;Ia.call(n);for(var d=0,f=t.length;d<f;++d,u=null)if(l=t[d],u=i[l.identifier]){if(c)break;s=l,c=u}if(u){var p=(p=l[0]-s[0])*p+(p=l[1]-s[1])*p,m=a&&Math.sqrt(p/a);s=[(s[0]+l[0])/2,(s[1]+l[1])/2],c=[(c[0]+u[0])/2,(c[1]+u[1])/2],T(m*o)}g=null,E(s,c),A(r)}function b(){if(e.event.touches.length){for(var t=e.event.changedTouches,n=0,a=t.length;n<a;++n)delete i[t[n].identifier];for(var o in i)return void m()}e.selectAll(u).on(s,null),f.on(d,M).on(h,N),p(),j(r)}}function P(){var i=_.of(this,arguments);m?clearTimeout(m):(Ia.call(this),n=C(r=a||e.mouse(this)),k(i)),m=setTimeout(function(){m=null,j(i)},50),z(),T(2**(We()*.002)*t.k),E(r,n),A(i)}function F(){var n=e.mouse(this),r=Math.log(t.k)/Math.LN2;D(this,n,C(n),e.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return e.rebind(S,_,`on`)};var Ue=[0,1/0],We,Ge;e.color=Ke;function Ke(){}Ke.prototype.toString=function(){return this.rgb()+``},e.hsl=qe;function qe(e,t,n){return this instanceof qe?(this.h=+e,this.s=+t,void(this.l=+n)):arguments.length<2?e instanceof qe?new qe(e.h,e.s,e.l):mt(``+e,ht,qe):new qe(e,t,n)}var Je=qe.prototype=new Ke;Je.brighter=function(e){return e=.7**(arguments.length?e:1),new qe(this.h,this.s,this.l/e)},Je.darker=function(e){return e=.7**(arguments.length?e:1),new qe(this.h,this.s,e*this.l)},Je.rgb=function(){return Ye(this.h,this.s,this.l)};function Ye(e,t,n){var r,i;e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=n<0?0:n>1?1:n,i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;function a(e){return e>360?e-=360:e<0&&(e+=360),e<60?r+(i-r)*e/60:e<180?i:e<240?r+(i-r)*(240-e)/60:r}function o(e){return Math.round(a(e)*255)}return new ut(o(e+120),o(e),o(e-120))}e.hcl=Xe;function Xe(t,n,r){return this instanceof Xe?(this.h=+t,this.c=+n,void(this.l=+r)):arguments.length<2?t instanceof Xe?new Xe(t.h,t.c,t.l):t instanceof $e?ot(t.l,t.a,t.b):ot((t=gt((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Xe(t,n,r)}var Ze=Xe.prototype=new Ke;Ze.brighter=function(e){return new Xe(this.h,this.c,Math.min(100,this.l+et*(arguments.length?e:1)))},Ze.darker=function(e){return new Xe(this.h,this.c,Math.max(0,this.l-et*(arguments.length?e:1)))},Ze.rgb=function(){return Qe(this.h,this.c,this.l).rgb()};function Qe(e,t,n){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new $e(n,Math.cos(e*=Ne)*t,Math.sin(e)*t)}e.lab=$e;function $e(e,t,n){return this instanceof $e?(this.l=+e,this.a=+t,void(this.b=+n)):arguments.length<2?e instanceof $e?new $e(e.l,e.a,e.b):e instanceof Xe?Qe(e.h,e.c,e.l):gt((e=ut(e)).r,e.g,e.b):new $e(e,t,n)}var et=18,tt=.95047,nt=1,rt=1.08883,it=$e.prototype=new Ke;it.brighter=function(e){return new $e(Math.min(100,this.l+et*(arguments.length?e:1)),this.a,this.b)},it.darker=function(e){return new $e(Math.max(0,this.l-et*(arguments.length?e:1)),this.a,this.b)},it.rgb=function(){return at(this.l,this.a,this.b)};function at(e,t,n){var r=(e+16)/116,i=r+t/500,a=r-n/200;return i=st(i)*tt,r=st(r)*nt,a=st(a)*rt,new ut(lt(3.2404542*i-1.5371385*r-.4985314*a),lt(-.969266*i+1.8760108*r+.041556*a),lt(.0556434*i-.2040259*r+1.0572252*a))}function ot(e,t,n){return e>0?new Xe(Math.atan2(n,t)*Pe,Math.sqrt(t*t+n*n),e):new Xe(NaN,NaN,e)}function st(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function ct(e){return e>.008856?e**(1/3):7.787037*e+4/29}function lt(e){return Math.round(255*(e<=.00304?12.92*e:1.055*e**(1/2.4)-.055))}e.rgb=ut;function ut(e,t,n){return this instanceof ut?(this.r=~~e,this.g=~~t,void(this.b=~~n)):arguments.length<2?e instanceof ut?new ut(e.r,e.g,e.b):mt(``+e,ut,Ye):new ut(e,t,n)}function $(e){return new ut(e>>16,e>>8&255,e&255)}function dt(e){return $(e)+``}var ft=ut.prototype=new Ke;ft.brighter=function(e){e=.7**(arguments.length?e:1);var t=this.r,n=this.g,r=this.b,i=30;return!t&&!n&&!r?new ut(i,i,i):(t&&t<i&&(t=i),n&&n<i&&(n=i),r&&r<i&&(r=i),new ut(Math.min(255,t/e),Math.min(255,n/e),Math.min(255,r/e)))},ft.darker=function(e){return e=.7**(arguments.length?e:1),new ut(e*this.r,e*this.g,e*this.b)},ft.hsl=function(){return ht(this.r,this.g,this.b)},ft.toString=function(){return`#`+pt(this.r)+pt(this.g)+pt(this.b)};function pt(e){return e<16?`0`+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function mt(e,t,n){var r=0,i=0,a=0,o,s,c;if(o=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()),o)switch(s=o[2].split(`,`),o[1]){case`hsl`:return n(parseFloat(s[0]),parseFloat(s[1])/100,parseFloat(s[2])/100);case`rgb`:return t(vt(s[0]),vt(s[1]),vt(s[2]))}return(c=yt.get(e))?t(c.r,c.g,c.b):(e!=null&&e.charAt(0)===`#`&&!isNaN(c=parseInt(e.slice(1),16))&&(e.length===4?(r=(c&3840)>>4,r=r>>4|r,i=c&240,i=i>>4|i,a=c&15,a=a<<4|a):e.length===7&&(r=(c&16711680)>>16,i=(c&65280)>>8,a=c&255)),t(r,i,a))}function ht(e,t,n){var r=Math.min(e/=255,t/=255,n/=255),i=Math.max(e,t,n),a=i-r,o,s,c=(i+r)/2;return a?(s=c<.5?a/(i+r):a/(2-i-r),o=e==i?(t-n)/a+(t<n?6:0):t==i?(n-e)/a+2:(e-t)/a+4,o*=60):(o=NaN,s=c>0&&c<1?0:o),new qe(o,s,c)}function gt(e,t,n){e=_t(e),t=_t(t),n=_t(n);var r=ct((.4124564*e+.3575761*t+.1804375*n)/tt),i=ct((.2126729*e+.7151522*t+.072175*n)/nt),a=ct((.0193339*e+.119192*t+.9503041*n)/rt);return $e(116*i-16,500*(r-i),200*(i-a))}function _t(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function vt(e){var t=parseFloat(e);return e.charAt(e.length-1)===`%`?Math.round(t*2.55):t}var yt=e.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});yt.forEach(function(e,t){yt.set(e,$(t))});function bt(e){return typeof e==`function`?e:function(){return e}}e.functor=bt,e.xhr=xt(M);function xt(e){return function(t,n,r){return arguments.length===2&&typeof n==`function`&&(r=n,n=null),St(t,n,e,r)}}function St(t,n,i,a){var o={},s=e.dispatch(`beforesend`,`progress`,`load`,`error`),c={},l=new XMLHttpRequest,u=null;self.XDomainRequest&&!(`withCredentials`in l)&&/^(http(s)?:)?\/\//.test(t)&&(l=new XDomainRequest),`onload`in l?l.onload=l.onerror=d:l.onreadystatechange=function(){l.readyState>3&&d()};function d(){var e=l.status,t;if(!e&&wt(l)||e>=200&&e<300||e===304){try{t=i.call(o,l)}catch(e){s.error.call(o,e);return}s.load.call(o,t)}else s.error.call(o,l)}return l.onprogress=function(t){var n=e.event;e.event=t;try{s.progress.call(o,l)}finally{e.event=n}},o.header=function(e,t){return e=(e+``).toLowerCase(),arguments.length<2?c[e]:(t==null?delete c[e]:c[e]=t+``,o)},o.mimeType=function(e){return arguments.length?(n=e==null?null:e+``,o):n},o.responseType=function(e){return arguments.length?(u=e,o):u},o.response=function(e){return i=e,o},[`get`,`post`].forEach(function(e){o[e]=function(){return o.send.apply(o,[e].concat(r(arguments)))}}),o.send=function(e,r,i){if(arguments.length===2&&typeof r==`function`&&(i=r,r=null),l.open(e,t,!0),n!=null&&!(`accept`in c)&&(c.accept=n+`,*/*`),l.setRequestHeader)for(var a in c)l.setRequestHeader(a,c[a]);return n!=null&&l.overrideMimeType&&l.overrideMimeType(n),u!=null&&(l.responseType=u),i!=null&&o.on(`error`,i).on(`load`,function(e){i(null,e)}),s.beforesend.call(o,l),l.send(r??null),o},o.abort=function(){return l.abort(),o},e.rebind(o,s,`on`),a==null?o:o.get(Ct(a))}function Ct(e){return e.length===1?function(t,n){e(t==null?n:null)}:e}function wt(e){var t=e.responseType;return t&&t!==`text`?e.response:e.responseText}e.dsv=function(e,t){var n=RegExp(`["`+e+`
]`),r=e.charCodeAt(0);function i(e,n,r){arguments.length<3&&(r=n,n=null);var i=St(e,t,n==null?a:o(n),r);return i.row=function(e){return arguments.length?i.response((n=e)==null?a:o(e)):n},i}function a(e){return i.parse(e.responseText)}function o(e){return function(t){return i.parse(t.responseText,e)}}i.parse=function(e,t){var n;return i.parseRows(e,function(e,r){if(n)return n(e,r-1);var i=function(t){for(var n={},r=e.length,i=0;i<r;++i)n[e[i]]=t[i];return n};n=t?function(e,n){return t(i(e),n)}:i})},i.parseRows=function(e,t){var n={},i={},a=[],o=e.length,s=0,c=0,l,u;function d(){if(s>=o)return i;if(u)return u=!1,n;var t=s;if(e.charCodeAt(t)===34){for(var a=t;a++<o;)if(e.charCodeAt(a)===34){if(e.charCodeAt(a+1)!==34)break;++a}s=a+2;var c=e.charCodeAt(a+1);return c===13?(u=!0,e.charCodeAt(a+2)===10&&++s):c===10&&(u=!0),e.slice(t+1,a).replace(/""/g,`"`)}for(;s<o;){var c=e.charCodeAt(s++),l=1;if(c===10)u=!0;else if(c===13)u=!0,e.charCodeAt(s)===10&&(++s,++l);else if(c!==r)continue;return e.slice(t,s-l)}return e.slice(t)}for(;(l=d())!==i;){for(var f=[];l!==n&&l!==i;)f.push(l),l=d();t&&(f=t(f,c++))==null||a.push(f)}return a},i.format=function(t){if(Array.isArray(t[0]))return i.formatRows(t);var n=new j,r=[];return t.forEach(function(e){for(var t in e)n.has(t)||r.push(n.add(t))}),[r.map(c).join(e)].concat(t.map(function(t){return r.map(function(e){return c(t[e])}).join(e)})).join(`
`)},i.formatRows=function(e){return e.map(s).join(`
`)};function s(t){return t.map(c).join(e)}function c(e){return n.test(e)?`"`+e.replace(/\"/g,`""`)+`"`:e}return i},e.csv=e.dsv(`,`,`text/csv`),e.tsv=e.dsv(` `,`text/tab-separated-values`);var Tt,Et,Dt,Ot,kt=this[P(this,`requestAnimationFrame`)]||function(e){setTimeout(e,17)};e.timer=function(){At.apply(this,arguments)};function At(e,t,n){var r=arguments.length;r<2&&(t=0),r<3&&(n=Date.now());var i={c:e,t:n+t,n:null};return Et?Et.n=i:Tt=i,Et=i,Dt||(Ot=clearTimeout(Ot),Dt=1,kt(jt)),i}function jt(){var e=Mt(),t=Nt()-e;t>24?(isFinite(t)&&(clearTimeout(Ot),Ot=setTimeout(jt,t)),Dt=0):(Dt=1,kt(jt))}e.timer.flush=function(){Mt(),Nt()};function Mt(){for(var e=Date.now(),t=Tt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function Nt(){for(var e,t=Tt,n=1/0;t;)t.c?(t.t<n&&(n=t.t),t=(e=t).n):t=e?e.n=t.n:Tt=t.n;return Et=e,n}e.round=function(e,t){return t?Math.round(e*(t=10**t))/t:Math.round(e)},e.geom={};function Pt(e){return e[0]}function Ft(e){return e[1]}e.geom.hull=function(e){var t=Pt,n=Ft;if(arguments.length)return r(e);function r(e){if(e.length<3)return[];var r=bt(t),i=bt(n),a,o=e.length,s=[],c=[];for(a=0;a<o;a++)s.push([+r.call(this,e[a],a),+i.call(this,e[a],a),a]);for(s.sort(Lt),a=0;a<o;a++)c.push([s[a][0],-s[a][1]]);var l=It(s),u=It(c),d=u[0]===l[0],f=u[u.length-1]===l[l.length-1],p=[];for(a=l.length-1;a>=0;--a)p.push(e[s[l[a]][2]]);for(a=+d;a<u.length-f;++a)p.push(e[s[u[a]][2]]);return p}return r.x=function(e){return arguments.length?(t=e,r):t},r.y=function(e){return arguments.length?(n=e,r):n},r};function It(e){for(var t=e.length,n=[0,1],r=2,i=2;i<t;i++){for(;r>1&&Fe(e[n[r-2]],e[n[r-1]],e[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function Lt(e,t){return e[0]-t[0]||e[1]-t[1]}e.geom.polygon=function(e){return U(e,Rt),e};var Rt=e.geom.polygon.prototype=[];Rt.area=function(){for(var e=-1,t=this.length,n,r=this[t-1],i=0;++e<t;)n=r,r=this[e],i+=n[1]*r[0]-n[0]*r[1];return i*.5},Rt.centroid=function(e){var t=-1,n=this.length,r=0,i=0,a,o=this[n-1],s;for(arguments.length||(e=-1/(6*this.area()));++t<n;)a=o,o=this[t],s=a[0]*o[1]-o[0]*a[1],r+=(a[0]+o[0])*s,i+=(a[1]+o[1])*s;return[r*e,i*e]},Rt.clip=function(e){for(var t,n=Vt(e),r=-1,i=this.length-Vt(this),a,o,s=this[i-1],c,l,u;++r<i;){for(t=e.slice(),e.length=0,c=this[r],l=t[(o=t.length-n)-1],a=-1;++a<o;)u=t[a],zt(u,s,c)?(zt(l,s,c)||e.push(Bt(l,u,s,c)),e.push(u)):zt(l,s,c)&&e.push(Bt(l,u,s,c)),l=u;n&&e.push(e[0]),s=c}return e};function zt(e,t,n){return(n[0]-t[0])*(e[1]-t[1])<(n[1]-t[1])*(e[0]-t[0])}function Bt(e,t,n,r){var i=e[0],a=n[0],o=t[0]-i,s=r[0]-a,c=e[1],l=n[1],u=t[1]-c,d=r[1]-l,f=(s*(c-l)-d*(i-a))/(d*o-s*u);return[i+f*o,c+f*u]}function Vt(e){var t=e[0],n=e[e.length-1];return!(t[0]-n[0]||t[1]-n[1])}var Ht,Ut,Wt,Gt=[],Kt,qt,Jt=[];function Yt(){vn(this),this.edge=this.site=this.circle=null}function Xt(e){var t=Gt.pop()||new Yt;return t.site=e,t}function Zt(e){cn(e),Wt.remove(e),Gt.push(e),vn(e)}function Qt(e){var t=e.circle,n=t.x,r=t.cy,i={x:n,y:r},a=e.P,o=e.N,s=[e];Zt(e);for(var c=a;c.circle&&v(n-c.circle.x)<De&&v(r-c.circle.cy)<De;)a=c.P,s.unshift(c),Zt(c),c=a;s.unshift(c),cn(c);for(var l=o;l.circle&&v(n-l.circle.x)<De&&v(r-l.circle.cy)<De;)o=l.N,s.push(l),Zt(l),l=o;s.push(l),cn(l);var u=s.length,d;for(d=1;d<u;++d)l=s[d],c=s[d-1],hn(l.edge,c.site,l.site,i);c=s[0],l=s[u-1],l.edge=pn(c.site,l.site,null,i),sn(c),sn(l)}function $t(e){for(var t=e.x,n=e.y,r,i,a,o,s=Wt._;s;)if(a=en(s,n)-t,a>De)s=s.L;else if(o=t-tn(s,n),o>De){if(!s.R){r=s;break}s=s.R}else{a>-De?(r=s.P,i=s):o>-De?(r=s,i=s.N):r=i=s;break}var c=Xt(e);if(Wt.insert(r,c),!(!r&&!i)){if(r===i){cn(r),i=Xt(r.site),Wt.insert(c,i),c.edge=i.edge=pn(r.site,c.site),sn(r),sn(i);return}if(!i){c.edge=pn(r.site,c.site);return}cn(r),cn(i);var l=r.site,u=l.x,d=l.y,f=e.x-u,p=e.y-d,m=i.site,h=m.x-u,g=m.y-d,_=2*(f*g-p*h),v=f*f+p*p,y=h*h+g*g,b={x:(g*v-p*y)/_+u,y:(f*y-h*v)/_+d};hn(i.edge,l,m,b),c.edge=pn(l,e,null,b),i.edge=pn(e,m,null,b),sn(r),sn(i)}}function en(e,t){var n=e.site,r=n.x,i=n.y,a=i-t;if(!a)return r;var o=e.P;if(!o)return-1/0;n=o.site;var s=n.x,c=n.y,l=c-t;if(!l)return s;var u=s-r,d=1/a-1/l,f=u/l;return d?(-f+Math.sqrt(f*f-2*d*(u*u/(-2*l)-c+l/2+i-a/2)))/d+r:(r+s)/2}function tn(e,t){var n=e.N;if(n)return en(n,t);var r=e.site;return r.y===t?r.x:1/0}function nn(e){this.site=e,this.edges=[]}nn.prototype.prepare=function(){for(var e=this.edges,t=e.length,n;t--;)n=e[t].edge,(!n.b||!n.a)&&e.splice(t,1);return e.sort(an),e.length};function rn(e){for(var t=e[0][0],n=e[1][0],r=e[0][1],i=e[1][1],a,o,s,c,l=Ut,u=l.length,d,f,p,m,h,g;u--;)if(d=l[u],!(!d||!d.prepare()))for(p=d.edges,m=p.length,f=0;f<m;)g=p[f].end(),s=g.x,c=g.y,h=p[++f%m].start(),a=h.x,o=h.y,(v(s-a)>De||v(c-o)>De)&&(p.splice(f,0,new gn(mn(d.site,g,v(s-t)<De&&i-c>De?{x:t,y:v(a-t)<De?o:i}:v(c-i)<De&&n-s>De?{x:v(o-i)<De?a:n,y:i}:v(s-n)<De&&c-r>De?{x:n,y:v(a-n)<De?o:r}:v(c-r)<De&&s-t>De?{x:v(o-r)<De?a:t,y:r}:null),d.site,null)),++m)}function an(e,t){return t.angle-e.angle}function on(){vn(this),this.x=this.y=this.arc=this.site=this.cy=null}function sn(e){var t=e.P,n=e.N;if(!(!t||!n)){var r=t.site,i=e.site,a=n.site;if(r!==a){var o=i.x,s=i.y,c=r.x-o,l=r.y-s,u=a.x-o,d=a.y-s,f=2*(c*d-l*u);if(!(f>=-Oe)){var p=c*c+l*l,m=u*u+d*d,h=(d*p-l*m)/f,g=(c*m-u*p)/f,d=g+s,_=Jt.pop()||new on;_.arc=e,_.site=i,_.x=h+o,_.y=d+Math.sqrt(h*h+g*g),_.cy=d,e.circle=_;for(var v=null,y=qt._;y;)if(_.y<y.y||_.y===y.y&&_.x<=y.x)if(y.L)y=y.L;else{v=y.P;break}else if(y.R)y=y.R;else{v=y;break}qt.insert(v,_),v||(Kt=_)}}}}function cn(e){var t=e.circle;t&&(t.P||(Kt=t.N),qt.remove(t),Jt.push(t),vn(t),e.circle=null)}function ln(e,t,n,r){return function(i){var a=i.a,o=i.b,s=a.x,c=a.y,l=o.x,u=o.y,d=0,f=1,p=l-s,m=u-c,h;if(h=e-s,!(!p&&h>0)){if(h/=p,p<0){if(h<d)return;h<f&&(f=h)}else if(p>0){if(h>f)return;h>d&&(d=h)}if(h=n-s,!(!p&&h<0)){if(h/=p,p<0){if(h>f)return;h>d&&(d=h)}else if(p>0){if(h<d)return;h<f&&(f=h)}if(h=t-c,!(!m&&h>0)){if(h/=m,m<0){if(h<d)return;h<f&&(f=h)}else if(m>0){if(h>f)return;h>d&&(d=h)}if(h=r-c,!(!m&&h<0)){if(h/=m,m<0){if(h>f)return;h>d&&(d=h)}else if(m>0){if(h<d)return;h<f&&(f=h)}return d>0&&(i.a={x:s+d*p,y:c+d*m}),f<1&&(i.b={x:s+f*p,y:c+f*m}),i}}}}}}function un(e){for(var t=Ht,n=ln(e[0][0],e[0][1],e[1][0],e[1][1]),r=t.length,i;r--;)i=t[r],(!dn(i,e)||!n(i)||v(i.a.x-i.b.x)<De&&v(i.a.y-i.b.y)<De)&&(i.a=i.b=null,t.splice(r,1))}function dn(e,t){var n=e.b;if(n)return!0;var r=e.a,i=t[0][0],a=t[1][0],o=t[0][1],s=t[1][1],c=e.l,l=e.r,u=c.x,d=c.y,f=l.x,p=l.y,m=(u+f)/2,h=(d+p)/2,g,_;if(p===d){if(m<i||m>=a)return;if(u>f){if(!r)r={x:m,y:o};else if(r.y>=s)return;n={x:m,y:s}}else{if(!r)r={x:m,y:s};else if(r.y<o)return;n={x:m,y:o}}}else if(g=(u-f)/(p-d),_=h-g*m,g<-1||g>1)if(u>f){if(!r)r={x:(o-_)/g,y:o};else if(r.y>=s)return;n={x:(s-_)/g,y:s}}else{if(!r)r={x:(s-_)/g,y:s};else if(r.y<o)return;n={x:(o-_)/g,y:o}}else if(d<p){if(!r)r={x:i,y:g*i+_};else if(r.x>=a)return;n={x:a,y:g*a+_}}else{if(!r)r={x:a,y:g*a+_};else if(r.x<i)return;n={x:i,y:g*i+_}}return e.a=r,e.b=n,!0}function fn(e,t){this.l=e,this.r=t,this.a=this.b=null}function pn(e,t,n,r){var i=new fn(e,t);return Ht.push(i),n&&hn(i,e,t,n),r&&hn(i,t,e,r),Ut[e.i].edges.push(new gn(i,e,t)),Ut[t.i].edges.push(new gn(i,t,e)),i}function mn(e,t,n){var r=new fn(e,null);return r.a=t,r.b=n,Ht.push(r),r}function hn(e,t,n,r){!e.a&&!e.b?(e.a=r,e.l=t,e.r=n):e.l===n?e.b=r:e.a=r}function gn(e,t,n){var r=e.a,i=e.b;this.edge=e,this.site=t,this.angle=n?Math.atan2(n.y-t.y,n.x-t.x):e.l===t?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}gn.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 _n(){this._=null}function vn(e){e.U=e.C=e.L=e.R=e.P=e.N=null}_n.prototype={insert:function(e,t){var n,r,i;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=xn(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);for(t.L=t.R=null,t.U=n,t.C=!0,e=t;n&&n.C;)r=n.U,n===r.L?(i=r.R,i&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.R&&(yn(this,n),e=n,n=e.U),n.C=!1,r.C=!0,bn(this,r))):(i=r.L,i&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.L&&(bn(this,n),e=n,n=e.U),n.C=!1,r.C=!0,yn(this,r))),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t=e.U,n,r=e.L,i=e.R,a,o;if(a=r?i?xn(i):r:i,t?t.L===e?t.L=a:t.R=a:this._=a,r&&i?(o=a.C,a.C=e.C,a.L=r,r.U=a,a===i?(a.U=t,t=a,e=a.R):(t=a.U,a.U=e.U,e=a.R,t.L=e,a.R=i,i.U=a)):(o=e.C,e=a),e&&(e.U=t),!o){if(e&&e.C){e.C=!1;return}do{if(e===this._)break;if(e===t.L){if(n=t.R,n.C&&(n.C=!1,t.C=!0,yn(this,t),n=t.R),n.L&&n.L.C||n.R&&n.R.C){(!n.R||!n.R.C)&&(n.L.C=!1,n.C=!0,bn(this,n),n=t.R),n.C=t.C,t.C=n.R.C=!1,yn(this,t),e=this._;break}}else if(n=t.L,n.C&&(n.C=!1,t.C=!0,bn(this,t),n=t.L),n.L&&n.L.C||n.R&&n.R.C){(!n.L||!n.L.C)&&(n.R.C=!1,n.C=!0,yn(this,n),n=t.L),n.C=t.C,t.C=n.L.C=!1,bn(this,t),e=this._;break}n.C=!0,e=t,t=t.U}while(!e.C);e&&(e.C=!1)}}};function yn(e,t){var n=t,r=t.R,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function bn(e,t){var n=t,r=t.L,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function xn(e){for(;e.L;)e=e.L;return e}function Sn(e,t){var n=e.sort(Cn).pop(),r,i,a;for(Ht=[],Ut=Array(e.length),Wt=new _n,qt=new _n;;)if(a=Kt,n&&(!a||n.y<a.y||n.y===a.y&&n.x<a.x))(n.x!==r||n.y!==i)&&(Ut[n.i]=new nn(n),$t(n),r=n.x,i=n.y),n=e.pop();else if(a)Qt(a.arc);else break;t&&(un(t),rn(t));var o={cells:Ut,edges:Ht};return Wt=qt=Ht=Ut=null,o}function Cn(e,t){return t.y-e.y||t.x-e.x}e.geom.voronoi=function(e){var t=Pt,n=Ft,r=t,i=n,a=wn;if(e)return o(e);function o(e){var t=Array(e.length),n=a[0][0],r=a[0][1],i=a[1][0],o=a[1][1];return Sn(s(e),a).cells.forEach(function(a,s){var c=a.edges,l=a.site,u=t[s]=c.length?c.map(function(e){var t=e.start();return[t.x,t.y]}):l.x>=n&&l.x<=i&&l.y>=r&&l.y<=o?[[n,o],[i,o],[i,r],[n,r]]:[];u.point=e[s]}),t}function s(e){return e.map(function(e,t){return{x:Math.round(r(e,t)/De)*De,y:Math.round(i(e,t)/De)*De,i:t}})}return o.links=function(e){return Sn(s(e)).edges.filter(function(e){return e.l&&e.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},o.triangles=function(e){var t=[];return Sn(s(e)).cells.forEach(function(n,r){for(var i=n.site,a=n.edges.sort(an),o=-1,s=a.length,c,l=a[s-1].edge,u=l.l===i?l.r:l.l;++o<s;)c=u,l=a[o].edge,u=l.l===i?l.r:l.l,r<c.i&&r<u.i&&Tn(i,c,u)<0&&t.push([e[r],e[c.i],e[u.i]])}),t},o.x=function(e){return arguments.length?(r=bt(t=e),o):t},o.y=function(e){return arguments.length?(i=bt(n=e),o):n},o.clipExtent=function(e){return arguments.length?(a=e??wn,o):a===wn?null:a},o.size=function(e){return arguments.length?o.clipExtent(e&&[[0,0],e]):a===wn?null:a&&a[1]},o};var wn=[[-1e6,-1e6],[1e6,1e6]];function Tn(e,t,n){return(e.x-n.x)*(t.y-e.y)-(e.x-t.x)*(n.y-e.y)}e.geom.delaunay=function(t){return e.geom.voronoi().triangles(t)},e.geom.quadtree=function(e,t,n,r,i){var a=Pt,o=Ft,s;if(s=arguments.length)return a=En,o=Dn,s===3&&(i=n,r=t,n=t=0),c(e);function c(e){var c,l=bt(a),u=bt(o),d,f,p,m,h,g,_,y;if(t!=null)h=t,g=n,_=r,y=i;else if(_=y=-(h=g=1/0),d=[],f=[],m=e.length,s)for(p=0;p<m;++p)c=e[p],c.x<h&&(h=c.x),c.y<g&&(g=c.y),c.x>_&&(_=c.x),c.y>y&&(y=c.y),d.push(c.x),f.push(c.y);else for(p=0;p<m;++p){var b=+l(c=e[p],p),x=+u(c,p);b<h&&(h=b),x<g&&(g=x),b>_&&(_=b),x>y&&(y=x),d.push(b),f.push(x)}var S=_-h,C=y-g;S>C?y=g+S:_=h+C;function w(e,t,n,r,i,a,o,s){if(!(isNaN(n)||isNaN(r)))if(e.leaf){var c=e.x,l=e.y;if(c!=null)if(v(c-n)+v(l-r)<.01)T(e,t,n,r,i,a,o,s);else{var u=e.point;e.x=e.y=e.point=null,T(e,u,c,l,i,a,o,s),T(e,t,n,r,i,a,o,s)}else e.x=n,e.y=r,e.point=t}else T(e,t,n,r,i,a,o,s)}function T(e,t,n,r,i,a,o,s){var c=(i+o)*.5,l=(a+s)*.5,u=n>=c,d=r>=l,f=d<<1|u;e.leaf=!1,e=e.nodes[f]||(e.nodes[f]=On()),u?i=c:o=c,d?a=l:s=l,w(e,t,n,r,i,a,o,s)}var E=On();if(E.add=function(e){w(E,e,+l(e,++p),+u(e,p),h,g,_,y)},E.visit=function(e){kn(e,E,h,g,_,y)},E.find=function(e){return An(E,e[0],e[1],h,g,_,y)},p=-1,t==null){for(;++p<m;)w(E,e[p],d[p],f[p],h,g,_,y);--p}else e.forEach(E.add);return d=f=e=c=null,E}return c.x=function(e){return arguments.length?(a=e,c):a},c.y=function(e){return arguments.length?(o=e,c):o},c.extent=function(e){return arguments.length?(e==null?t=n=r=i=null:(t=+e[0][0],n=+e[0][1],r=+e[1][0],i=+e[1][1]),c):t==null?null:[[t,n],[r,i]]},c.size=function(e){return arguments.length?(e==null?t=n=r=i=null:(t=n=0,r=+e[0],i=+e[1]),c):t==null?null:[r-t,i-n]},c};function En(e){return e.x}function Dn(e){return e.y}function On(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function kn(e,t,n,r,i,a){if(!e(t,n,r,i,a)){var o=(n+i)*.5,s=(r+a)*.5,c=t.nodes;c[0]&&kn(e,c[0],n,r,o,s),c[1]&&kn(e,c[1],o,r,i,s),c[2]&&kn(e,c[2],n,s,o,a),c[3]&&kn(e,c[3],o,s,i,a)}}function An(e,t,n,r,i,a,o){var s=1/0,c;return function e(l,u,d,f,p){if(!(u>a||d>o||f<r||p<i)){if(m=l.point){var m,h=t-l.x,g=n-l.y,_=h*h+g*g;if(_<s){var v=Math.sqrt(s=_);r=t-v,i=n-v,a=t+v,o=n+v,c=m}}for(var y=l.nodes,b=(u+f)*.5,x=(d+p)*.5,S=(n>=x)<<1|t>=b,C=S+4;S<C;++S)if(l=y[S&3])switch(S&3){case 0:e(l,u,d,b,x);break;case 1:e(l,b,d,f,x);break;case 2:e(l,u,x,b,p);break;case 3:e(l,b,x,f,p);break}}}(e,r,i,a,o),c}e.interpolateRgb=jn;function jn(t,n){t=e.rgb(t),n=e.rgb(n);var r=t.r,i=t.g,a=t.b,o=n.r-r,s=n.g-i,c=n.b-a;return function(e){return`#`+pt(Math.round(r+o*e))+pt(Math.round(i+s*e))+pt(Math.round(a+c*e))}}e.interpolateObject=Mn;function Mn(e,t){var n={},r={},i;for(i in e)i in t?n[i]=Ln(e[i],t[i]):r[i]=e[i];for(i in t)i in e||(r[i]=t[i]);return function(e){for(i in n)r[i]=n[i](e);return r}}e.interpolateNumber=Nn;function Nn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}e.interpolateString=Pn;function Pn(e,t){var n=Fn.lastIndex=In.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Fn.exec(e))&&(i=In.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Nn(r,i)})),n=In.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?(t=c[0].x,function(e){return t(e)+``}):function(){return t}:(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}var Fn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,In=new RegExp(Fn.source,`g`);e.interpolate=Ln;function Ln(t,n){for(var r=e.interpolators.length,i;--r>=0&&!(i=e.interpolators[r](t,n)););return i}e.interpolators=[function(e,t){var n=typeof t;return(n===`string`?yt.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?jn:Pn:t instanceof Ke?jn:Array.isArray(t)?Rn:n===`object`&&isNaN(t)?Mn:Nn)(e,t)}],e.interpolateArray=Rn;function Rn(e,t){var n=[],r=[],i=e.length,a=t.length,o=Math.min(e.length,t.length),s;for(s=0;s<o;++s)n.push(Ln(e[s],t[s]));for(;s<i;++s)r[s]=e[s];for(;s<a;++s)r[s]=t[s];return function(e){for(s=0;s<o;++s)r[s]=n[s](e);return r}}var zn=function(){return M},Bn=e.map({linear:zn,poly:Jn,quad:function(){return Gn},cubic:function(){return Kn},sin:function(){return Yn},exp:function(){return Xn},circle:function(){return Zn},elastic:Qn,back:$n,bounce:function(){return er}}),Vn=e.map({in:M,out:Un,"in-out":Wn,"out-in":function(e){return Wn(Un(e))}});e.ease=function(e){var t=e.indexOf(`-`),r=t>=0?e.slice(0,t):e,i=t>=0?e.slice(t+1):`in`;return r=Bn.get(r)||zn,i=Vn.get(i)||M,Hn(i(r.apply(null,n.call(arguments,1))))};function Hn(e){return function(t){return t<=0?0:t>=1?1:e(t)}}function Un(e){return function(t){return 1-e(1-t)}}function Wn(e){return function(t){return .5*(t<.5?e(2*t):2-e(2-2*t))}}function Gn(e){return e*e}function Kn(e){return e*e*e}function qn(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function Jn(e){return function(t){return t**+e}}function Yn(e){return 1-Math.cos(e*Me)}function Xn(e){return 2**(10*(e-1))}function Zn(e){return 1-Math.sqrt(1-e*e)}function Qn(e,t){var n;return arguments.length<2&&(t=.45),arguments.length?n=t/Ae*Math.asin(1/e):(e=1,n=t/4),function(r){return 1+e*2**(-10*r)*Math.sin((r-n)*Ae/t)}}function $n(e){return e||=1.70158,function(t){return t*t*((e+1)*t-e)}}function er(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}e.interpolateHcl=tr;function tr(t,n){t=e.hcl(t),n=e.hcl(n);var r=t.h,i=t.c,a=t.l,o=n.h-r,s=n.c-i,c=n.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?n.c:i),isNaN(o)?(o=0,r=isNaN(r)?n.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return Qe(r+o*e,i+s*e,a+c*e)+``}}e.interpolateHsl=nr;function nr(t,n){t=e.hsl(t),n=e.hsl(n);var r=t.h,i=t.s,a=t.l,o=n.h-r,s=n.s-i,c=n.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?n.s:i),isNaN(o)?(o=0,r=isNaN(r)?n.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return Ye(r+o*e,i+s*e,a+c*e)+``}}e.interpolateLab=rr;function rr(t,n){t=e.lab(t),n=e.lab(n);var r=t.l,i=t.a,a=t.b,o=n.l-r,s=n.a-i,c=n.b-a;return function(e){return at(r+o*e,i+s*e,a+c*e)+``}}e.interpolateRound=ir;function ir(e,t){return t-=e,function(n){return Math.round(e+t*n)}}e.transform=function(t){var n=i.createElementNS(e.ns.prefix.svg,`g`);return(e.transform=function(e){if(e!=null){n.setAttribute(`transform`,e);var t=n.transform.baseVal.consolidate()}return new ar(t?t.matrix:lr)})(t)};function ar(e){var t=[e.a,e.b],n=[e.c,e.d],r=sr(t),i=or(t,n),a=sr(cr(n,t,-i))||0;t[0]*n[1]<n[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-n[0],n[1]))*Pe,this.translate=[e.e,e.f],this.scale=[r,a],this.skew=a?Math.atan2(i,a)*Pe:0}ar.prototype.toString=function(){return`translate(`+this.translate+`)rotate(`+this.rotate+`)skewX(`+this.skew+`)scale(`+this.scale+`)`};function or(e,t){return e[0]*t[0]+e[1]*t[1]}function sr(e){var t=Math.sqrt(or(e,e));return t&&(e[0]/=t,e[1]/=t),t}function cr(e,t,n){return e[0]+=n*t[0],e[1]+=n*t[1],e}var lr={a:1,b:0,c:0,d:1,e:0,f:0};e.interpolateTransform=hr;function ur(e){return e.length?e.pop()+`,`:``}function dr(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push(`translate(`,null,`,`,null,`)`);r.push({i:i-4,x:Nn(e[0],t[0])},{i:i-2,x:Nn(e[1],t[1])})}else (t[0]||t[1])&&n.push(`translate(`+t+`)`)}function fr(e,t,n,r){e===t?t&&n.push(ur(n)+`rotate(`+t+`)`):(e-t>180?t+=360:t-e>180&&(e+=360),r.push({i:n.push(ur(n)+`rotate(`,null,`)`)-2,x:Nn(e,t)}))}function pr(e,t,n,r){e===t?t&&n.push(ur(n)+`skewX(`+t+`)`):r.push({i:n.push(ur(n)+`skewX(`,null,`)`)-2,x:Nn(e,t)})}function mr(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push(ur(n)+`scale(`,null,`,`,null,`)`);r.push({i:i-4,x:Nn(e[0],t[0])},{i:i-2,x:Nn(e[1],t[1])})}else (t[0]!==1||t[1]!==1)&&n.push(ur(n)+`scale(`+t+`)`)}function hr(t,n){var r=[],i=[];return t=e.transform(t),n=e.transform(n),dr(t.translate,n.translate,r,i),fr(t.rotate,n.rotate,r,i),pr(t.skew,n.skew,r,i),mr(t.scale,n.scale,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}function gr(e,t){return t=(t-=e=+e)||1/t,function(n){return(n-e)/t}}function _r(e,t){return t=(t-=e=+e)||1/t,function(n){return Math.max(0,Math.min(1,(n-e)/t))}}e.layout={},e.layout.bundle=function(){return function(e){for(var t=[],n=-1,r=e.length;++n<r;)t.push(vr(e[n]));return t}};function vr(e){for(var t=e.source,n=e.target,r=br(t,n),i=[t];t!==r;)t=t.parent,i.push(t);for(var a=i.length;n!==r;)i.splice(a,0,n),n=n.parent;return i}function yr(e){for(var t=[],n=e.parent;n!=null;)t.push(e),e=n,n=n.parent;return t.push(e),t}function br(e,t){if(e===t)return e;for(var n=yr(e),r=yr(t),i=n.pop(),a=r.pop(),o=null;i===a;)o=i,i=n.pop(),a=r.pop();return o}e.layout.chord=function(){var t={},n,r,i,a,o=0,s,c,l;function u(){var t={},u=[],f=e.range(a),p=[],m,h,g,_,v;for(n=[],r=[],m=0,_=-1;++_<a;){for(h=0,v=-1;++v<a;)h+=i[_][v];u.push(h),p.push(e.range(a)),m+=h}for(s&&f.sort(function(e,t){return s(u[e],u[t])}),c&&p.forEach(function(e,t){e.sort(function(e,n){return c(i[t][e],i[t][n])})}),m=(Ae-o*a)/m,h=0,_=-1;++_<a;){for(g=h,v=-1;++v<a;){var y=f[_],b=p[y][v],x=i[y][b],S=h,C=h+=x*m;t[y+`-`+b]={index:y,subindex:b,startAngle:S,endAngle:C,value:x}}r[y]={index:y,startAngle:g,endAngle:h,value:u[y]},h+=o}for(_=-1;++_<a;)for(v=_-1;++v<a;){var w=t[_+`-`+v],T=t[v+`-`+_];(w.value||T.value)&&n.push(w.value<T.value?{source:T,target:w}:{source:w,target:T})}l&&d()}function d(){n.sort(function(e,t){return l((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)})}return t.matrix=function(e){return arguments.length?(a=(i=e)&&i.length,n=r=null,t):i},t.padding=function(e){return arguments.length?(o=e,n=r=null,t):o},t.sortGroups=function(e){return arguments.length?(s=e,n=r=null,t):s},t.sortSubgroups=function(e){return arguments.length?(c=e,n=null,t):c},t.sortChords=function(e){return arguments.length?(l=e,n&&d(),t):l},t.chords=function(){return n||u(),n},t.groups=function(){return r||u(),r},t},e.layout.force=function(){var t={},n=e.dispatch(`start`,`tick`,`end`),r,i=[1,1],a,o,s=.9,c=Er,l=Dr,u=-30,d=Or,f=.1,p=.64,m=[],h=[],g,_,v;function y(e){return function(t,n,r,i){if(t.point!==e){var a=t.cx-e.x,o=t.cy-e.y,s=i-n,c=a*a+o*o;if(s*s/p<c){if(c<d){var l=t.charge/c;e.px-=a*l,e.py-=o*l}return!0}if(t.point&&c&&c<d){var l=t.pointCharge/c;e.px-=a*l,e.py-=o*l}}return!t.charge}}t.tick=function(){if((o*=.99)<.005)return r=null,n.end({type:`end`,alpha:o=0}),!0;var t=m.length,a=h.length,c,l,d,p,b,x,S,C,w;for(l=0;l<a;++l)d=h[l],p=d.source,b=d.target,C=b.x-p.x,w=b.y-p.y,(x=C*C+w*w)&&(x=o*_[l]*((x=Math.sqrt(x))-g[l])/x,C*=x,w*=x,b.x-=C*(S=p.weight+b.weight?p.weight/(p.weight+b.weight):.5),b.y-=w*S,p.x+=C*(S=1-S),p.y+=w*S);if((S=o*f)&&(C=i[0]/2,w=i[1]/2,l=-1,S))for(;++l<t;)d=m[l],d.x+=(C-d.x)*S,d.y+=(w-d.y)*S;if(u)for(Tr(c=e.geom.quadtree(m),o,v),l=-1;++l<t;)(d=m[l]).fixed||c.visit(y(d));for(l=-1;++l<t;)d=m[l],d.fixed?(d.x=d.px,d.y=d.py):(d.x-=(d.px-(d.px=d.x))*s,d.y-=(d.py-(d.py=d.y))*s);n.tick({type:`tick`,alpha:o})},t.nodes=function(e){return arguments.length?(m=e,t):m},t.links=function(e){return arguments.length?(h=e,t):h},t.size=function(e){return arguments.length?(i=e,t):i},t.linkDistance=function(e){return arguments.length?(c=typeof e==`function`?e:+e,t):c},t.distance=t.linkDistance,t.linkStrength=function(e){return arguments.length?(l=typeof e==`function`?e:+e,t):l},t.friction=function(e){return arguments.length?(s=+e,t):s},t.charge=function(e){return arguments.length?(u=typeof e==`function`?e:+e,t):u},t.chargeDistance=function(e){return arguments.length?(d=e*e,t):Math.sqrt(d)},t.gravity=function(e){return arguments.length?(f=+e,t):f},t.theta=function(e){return arguments.length?(p=e*e,t):Math.sqrt(p)},t.alpha=function(e){return arguments.length?(e=+e,o?e>0?o=e:(r.c=null,r.t=NaN,r=null,n.end({type:`end`,alpha:o=0})):e>0&&(n.start({type:`start`,alpha:o=e}),r=At(t.tick)),t):o},t.start=function(){var e,n=m.length,r=h.length,a=i[0],o=i[1],s,d;for(e=0;e<n;++e)(d=m[e]).index=e,d.weight=0;for(e=0;e<r;++e)d=h[e],typeof d.source==`number`&&(d.source=m[d.source]),typeof d.target==`number`&&(d.target=m[d.target]),++d.source.weight,++d.target.weight;for(e=0;e<n;++e)d=m[e],isNaN(d.x)&&(d.x=f(`x`,a)),isNaN(d.y)&&(d.y=f(`y`,o)),isNaN(d.px)&&(d.px=d.x),isNaN(d.py)&&(d.py=d.y);if(g=[],typeof c==`function`)for(e=0;e<r;++e)g[e]=+c.call(this,h[e],e);else for(e=0;e<r;++e)g[e]=c;if(_=[],typeof l==`function`)for(e=0;e<r;++e)_[e]=+l.call(this,h[e],e);else for(e=0;e<r;++e)_[e]=l;if(v=[],typeof u==`function`)for(e=0;e<n;++e)v[e]=+u.call(this,m[e],e);else for(e=0;e<n;++e)v[e]=u;function f(t,i){if(!s){for(s=Array(n),c=0;c<n;++c)s[c]=[];for(c=0;c<r;++c){var a=h[c];s[a.source.index].push(a.target),s[a.target.index].push(a.source)}}for(var o=s[e],c=-1,l=o.length,u;++c<l;)if(!isNaN(u=o[c][t]))return u;return Math.random()*i}return t.resume()},t.resume=function(){return t.alpha(.1)},t.stop=function(){return t.alpha(0)},t.drag=function(){if(a||=e.behavior.drag().origin(M).on(`dragstart.force`,xr).on(`drag.force`,b).on(`dragend.force`,Sr),!arguments.length)return a;this.on(`mouseover.force`,Cr).on(`mouseout.force`,wr).call(a)};function b(n){n.px=e.event.x,n.py=e.event.y,t.resume()}return e.rebind(t,n,`on`)};function xr(e){e.fixed|=2}function Sr(e){e.fixed&=-7}function Cr(e){e.fixed|=4,e.px=e.x,e.py=e.y}function wr(e){e.fixed&=-5}function Tr(e,t,n){var r=0,i=0;if(e.charge=0,!e.leaf)for(var a=e.nodes,o=a.length,s=-1,c;++s<o;)c=a[s],c!=null&&(Tr(c,t,n),e.charge+=c.charge,r+=c.charge*c.cx,i+=c.charge*c.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var l=t*n[e.point.index];e.charge+=e.pointCharge=l,r+=l*e.point.x,i+=l*e.point.y}e.cx=r/e.charge,e.cy=i/e.charge}var Er=20,Dr=1,Or=1/0;e.layout.hierarchy=function(){var e=Pr,t=Mr,n=Nr;function r(i){var a=[i],o=[],s;for(i.depth=0;(s=a.pop())!=null;)if(o.push(s),(l=t.call(r,s,s.depth))&&(c=l.length)){for(var c,l,u;--c>=0;)a.push(u=l[c]),u.parent=s,u.depth=s.depth+1;n&&(s.value=0),s.children=l}else n&&(s.value=+n.call(r,s,s.depth)||0),delete s.children;return jr(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),o}return r.sort=function(t){return arguments.length?(e=t,r):e},r.children=function(e){return arguments.length?(t=e,r):t},r.value=function(e){return arguments.length?(n=e,r):n},r.revalue=function(e){return n&&(Ar(e,function(e){e.children&&(e.value=0)}),jr(e,function(e){var t;e.children||(e.value=+n.call(r,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)})),e},r};function kr(t,n){return e.rebind(t,n,`sort`,`children`,`value`),t.nodes=t,t.links=Fr,t}function Ar(e,t){for(var n=[e];(e=n.pop())!=null;)if(t(e),(i=e.children)&&(r=i.length))for(var r,i;--r>=0;)n.push(i[r])}function jr(e,t){for(var n=[e],r=[];(e=n.pop())!=null;)if(r.push(e),(o=e.children)&&(a=o.length))for(var i=-1,a,o;++i<a;)n.push(o[i]);for(;(e=r.pop())!=null;)t(e)}function Mr(e){return e.children}function Nr(e){return e.value}function Pr(e,t){return t.value-e.value}function Fr(t){return e.merge(t.map(function(e){return(e.children||[]).map(function(t){return{source:e,target:t}})}))}e.layout.partition=function(){var t=e.layout.hierarchy(),n=[1,1];function r(e,t,n,i){var a=e.children;if(e.x=t,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(s=a.length)){var o=-1,s,c,l;for(n=e.value?n/e.value:0;++o<s;)r(c=a[o],t,l=c.value*n,i),t+=l}}function i(e){var t=e.children,n=0;if(t&&(a=t.length))for(var r=-1,a;++r<a;)n=Math.max(n,i(t[r]));return 1+n}function a(e,a){var o=t.call(this,e,a);return r(o[0],0,n[0],n[1]/i(o[0])),o}return a.size=function(e){return arguments.length?(n=e,a):n},kr(a,t)},e.layout.pie=function(){var t=Number,n=Ir,r=0,i=Ae,a=0;function o(s){var c=s.length,l=s.map(function(e,n){return+t.call(o,e,n)}),u=+(typeof r==`function`?r.apply(this,arguments):r),d=(typeof i==`function`?i.apply(this,arguments):i)-u,f=Math.min(Math.abs(d)/c,+(typeof a==`function`?a.apply(this,arguments):a)),p=f*(d<0?-1:1),m=e.sum(l),h=m?(d-c*p)/m:0,g=e.range(c),_=[],v;return n!=null&&g.sort(n===Ir?function(e,t){return l[t]-l[e]}:function(e,t){return n(s[e],s[t])}),g.forEach(function(e){_[e]={data:s[e],value:v=l[e],startAngle:u,endAngle:u+=v*h+p,padAngle:f}}),_}return o.value=function(e){return arguments.length?(t=e,o):t},o.sort=function(e){return arguments.length?(n=e,o):n},o.startAngle=function(e){return arguments.length?(r=e,o):r},o.endAngle=function(e){return arguments.length?(i=e,o):i},o.padAngle=function(e){return arguments.length?(a=e,o):a},o};var Ir={};e.layout.stack=function(){var t=M,n=Hr,r=Ur,i=zr,a=Lr,o=Rr;function s(c,l){if(!(h=c.length))return c;var u=c.map(function(e,n){return t.call(s,e,n)}),d=u.map(function(e){return e.map(function(e,t){return[a.call(s,e,t),o.call(s,e,t)]})}),f=n.call(s,d,l);u=e.permute(u,f),d=e.permute(d,f);var p=r.call(s,d,l),m=u[0].length,h,g,_,v;for(_=0;_<m;++_)for(i.call(s,u[0][_],v=p[_],d[0][_][1]),g=1;g<h;++g)i.call(s,u[g][_],v+=d[g-1][_][1],d[g][_][1]);return c}return s.values=function(e){return arguments.length?(t=e,s):t},s.order=function(e){return arguments.length?(n=typeof e==`function`?e:Br.get(e)||Hr,s):n},s.offset=function(e){return arguments.length?(r=typeof e==`function`?e:Vr.get(e)||Ur,s):r},s.x=function(e){return arguments.length?(a=e,s):a},s.y=function(e){return arguments.length?(o=e,s):o},s.out=function(e){return arguments.length?(i=e,s):i},s};function Lr(e){return e.x}function Rr(e){return e.y}function zr(e,t,n){e.y0=t,e.y=n}var Br=e.map({"inside-out":function(t){var n=t.length,r,i,a=t.map(Wr),o=t.map(Gr),s=e.range(n).sort(function(e,t){return a[e]-a[t]}),c=0,l=0,u=[],d=[];for(r=0;r<n;++r)i=s[r],c<l?(c+=o[i],u.push(i)):(l+=o[i],d.push(i));return d.reverse().concat(u)},reverse:function(t){return e.range(t.length).reverse()},default:Hr}),Vr=e.map({silhouette:function(e){var t=e.length,n=e[0].length,r=[],i=0,a,o,s,c=[];for(o=0;o<n;++o){for(a=0,s=0;a<t;a++)s+=e[a][o][1];s>i&&(i=s),r.push(s)}for(o=0;o<n;++o)c[o]=(i-r[o])/2;return c},wiggle:function(e){var t=e.length,n=e[0],r=n.length,i,a,o,s,c,l,u,d,f,p=[];for(p[0]=d=f=0,a=1;a<r;++a){for(i=0,s=0;i<t;++i)s+=e[i][a][1];for(i=0,c=0,u=n[a][0]-n[a-1][0];i<t;++i){for(o=0,l=(e[i][a][1]-e[i][a-1][1])/(2*u);o<i;++o)l+=(e[o][a][1]-e[o][a-1][1])/u;c+=l*e[i][a][1]}p[a]=d-=s?c/s*u:0,d<f&&(f=d)}for(a=0;a<r;++a)p[a]-=f;return p},expand:function(e){var t=e.length,n=e[0].length,r=1/t,i,a,o,s=[];for(a=0;a<n;++a){for(i=0,o=0;i<t;i++)o+=e[i][a][1];if(o)for(i=0;i<t;i++)e[i][a][1]/=o;else for(i=0;i<t;i++)e[i][a][1]=r}for(a=0;a<n;++a)s[a]=0;return s},zero:Ur});function Hr(t){return e.range(t.length)}function Ur(e){for(var t=-1,n=e[0].length,r=[];++t<n;)r[t]=0;return r}function Wr(e){for(var t=1,n=0,r=e[0][1],i,a=e.length;t<a;++t)(i=e[t][1])>r&&(n=t,r=i);return n}function Gr(e){return e.reduce(Kr,0)}function Kr(e,t){return e+t[1]}e.layout.histogram=function(){var t=!0,n=Number,r=Yr,i=qr;function a(a,o){for(var s=[],c=a.map(n,this),l=r.call(this,c,o),u=i.call(this,l,c,o),d,o=-1,f=c.length,p=u.length-1,m=t?1:1/f,h;++o<p;)d=s[o]=[],d.dx=u[o+1]-(d.x=u[o]),d.y=0;if(p>0)for(o=-1;++o<f;)h=c[o],h>=l[0]&&h<=l[1]&&(d=s[e.bisect(u,h,1,p)-1],d.y+=m,d.push(a[o]));return s}return a.value=function(e){return arguments.length?(n=e,a):n},a.range=function(e){return arguments.length?(r=bt(e),a):r},a.bins=function(e){return arguments.length?(i=typeof e==`number`?function(t){return Jr(t,e)}:bt(e),a):i},a.frequency=function(e){return arguments.length?(t=!!e,a):t},a};function qr(e,t){return Jr(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Jr(e,t){for(var n=-1,r=+e[0],i=(e[1]-r)/t,a=[];++n<=t;)a[n]=i*n+r;return a}function Yr(t){return[e.min(t),e.max(t)]}e.layout.pack=function(){var t=e.layout.hierarchy().sort(Xr),n=0,r=[1,1],i;function a(e,a){var o=t.call(this,e,a),s=o[0],c=r[0],l=r[1],u=i==null?Math.sqrt:typeof i==`function`?i:function(){return i};if(s.x=s.y=0,jr(s,function(e){e.r=+u(e.value)}),jr(s,ei),n){var d=n*(i?1:Math.max(2*s.r/c,2*s.r/l))/2;jr(s,function(e){e.r+=d}),jr(s,ei),jr(s,function(e){e.r-=d})}return ri(s,c/2,l/2,i?1:1/Math.max(2*s.r/c,2*s.r/l)),o}return a.size=function(e){return arguments.length?(r=e,a):r},a.radius=function(e){return arguments.length?(i=e==null||typeof e==`function`?e:+e,a):i},a.padding=function(e){return arguments.length?(n=+e,a):n},kr(a,t)};function Xr(e,t){return e.value-t.value}function Zr(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function Qr(e,t){e._pack_next=t,t._pack_prev=e}function $r(e,t){var n=t.x-e.x,r=t.y-e.y,i=e.r+t.r;return .999*i*i>n*n+r*r}function ei(e){if(!(t=e.children)||!(f=t.length))return;var t,n=1/0,r=-1/0,i=1/0,a=-1/0,o,s,c,l,u,d,f;function p(e){n=Math.min(e.x-e.r,n),r=Math.max(e.x+e.r,r),i=Math.min(e.y-e.r,i),a=Math.max(e.y+e.r,a)}if(t.forEach(ti),o=t[0],o.x=-o.r,o.y=0,p(o),f>1&&(s=t[1],s.x=s.r,s.y=0,p(s),f>2))for(c=t[2],ii(o,s,c),p(c),Zr(o,c),o._pack_prev=c,Zr(c,s),s=o._pack_next,l=3;l<f;l++){ii(o,s,c=t[l]);var m=0,h=1,g=1;for(u=s._pack_next;u!==s;u=u._pack_next,h++)if($r(u,c)){m=1;break}if(m==1)for(d=o._pack_prev;d!==u._pack_prev&&!$r(d,c);d=d._pack_prev,g++);m?(h<g||h==g&&s.r<o.r?Qr(o,s=u):Qr(o=d,s),l--):(Zr(o,c),s=c,p(c))}var _=(n+r)/2,v=(i+a)/2,y=0;for(l=0;l<f;l++)c=t[l],c.x-=_,c.y-=v,y=Math.max(y,c.r+Math.sqrt(c.x*c.x+c.y*c.y));e.r=y,t.forEach(ni)}function ti(e){e._pack_next=e._pack_prev=e}function ni(e){delete e._pack_next,delete e._pack_prev}function ri(e,t,n,r){var i=e.children;if(e.x=t+=r*e.x,e.y=n+=r*e.y,e.r*=r,i)for(var a=-1,o=i.length;++a<o;)ri(i[a],t,n,r)}function ii(e,t,n){var r=e.r+n.r,i=t.x-e.x,a=t.y-e.y;if(r&&(i||a)){var o=t.r+n.r,s=i*i+a*a;o*=o,r*=r;var c=.5+(r-o)/(2*s),l=Math.sqrt(Math.max(0,2*o*(r+s)-(r-=s)*r-o*o))/(2*s);n.x=e.x+c*i+l*a,n.y=e.y+c*a-l*i}else n.x=e.x+r,n.y=e.y}e.layout.tree=function(){var t=e.layout.hierarchy().sort(null).value(null),n=ai,r=[1,1],i=null;function a(e,a){var l=t.call(this,e,a),d=l[0],f=o(d);if(jr(f,s),f.parent.m=-f.z,Ar(f,c),i)Ar(d,u);else{var p=d,m=d,h=d;Ar(d,function(e){e.x<p.x&&(p=e),e.x>m.x&&(m=e),e.depth>h.depth&&(h=e)});var g=n(p,m)/2-p.x,_=r[0]/(m.x+n(m,p)/2+g),v=r[1]/(h.depth||1);Ar(d,function(e){e.x=(e.x+g)*_,e.y=e.depth*v})}return l}function o(e){for(var t={A:null,children:[e]},n=[t],r;(r=n.pop())!=null;)for(var i=r.children,a,o=0,s=i.length;o<s;++o)n.push((i[o]=a={_:i[o],parent:r,children:(a=i[o].children)&&a.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=a);return t.children[0]}function s(e){var t=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(t.length){li(e);var a=(t[0].z+t[t.length-1].z)/2;i?(e.z=i.z+n(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+n(e._,i._));e.parent.A=l(e,i,e.parent.A||r[0])}function c(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e,t,r){if(t){for(var i=e,a=e,o=t,s=i.parent.children[0],c=i.m,l=a.m,u=o.m,d=s.m,f;o=si(o),i=oi(i),o&&i;)s=oi(s),a=si(a),a.a=e,f=o.z+u-i.z-c+n(o._,i._),f>0&&(ci(ui(o,e,r),e,f),c+=f,l+=f),u+=o.m,c+=i.m,d+=s.m,l+=a.m;o&&!si(a)&&(a.t=o,a.m+=u-l),i&&!oi(s)&&(s.t=i,s.m+=c-d,r=e)}return r}function u(e){e.x*=r[0],e.y=e.depth*r[1]}return a.separation=function(e){return arguments.length?(n=e,a):n},a.size=function(e){return arguments.length?(i=(r=e)==null?u:null,a):i?null:r},a.nodeSize=function(e){return arguments.length?(i=(r=e)==null?null:u,a):i?r:null},kr(a,t)};function ai(e,t){return e.parent==t.parent?1:2}function oi(e){var t=e.children;return t.length?t[0]:e.t}function si(e){var t=e.children,n;return(n=t.length)?t[n-1]:e.t}function ci(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function li(e){for(var t=0,n=0,r=e.children,i=r.length,a;--i>=0;)a=r[i],a.z+=t,a.m+=t,t+=a.s+(n+=a.c)}function ui(e,t,n){return e.a.parent===t.parent?e.a:n}e.layout.cluster=function(){var t=e.layout.hierarchy().sort(null).value(null),n=ai,r=[1,1],i=!1;function a(e,a){var o=t.call(this,e,a),s=o[0],c,l=0;jr(s,function(e){var t=e.children;t&&t.length?(e.x=fi(t),e.y=di(t)):(e.x=c?l+=n(e,c):0,e.y=0,c=e)});var u=pi(s),d=mi(s),f=u.x-n(u,d)/2,p=d.x+n(d,u)/2;return jr(s,i?function(e){e.x=(e.x-s.x)*r[0],e.y=(s.y-e.y)*r[1]}:function(e){e.x=(e.x-f)/(p-f)*r[0],e.y=(1-(s.y?e.y/s.y:1))*r[1]}),o}return a.separation=function(e){return arguments.length?(n=e,a):n},a.size=function(e){return arguments.length?(i=(r=e)==null,a):i?null:r},a.nodeSize=function(e){return arguments.length?(i=(r=e)!=null,a):i?r:null},kr(a,t)};function di(t){return 1+e.max(t,function(e){return e.y})}function fi(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}function pi(e){var t=e.children;return t&&t.length?pi(t[0]):e}function mi(e){var t=e.children,n;return t&&(n=t.length)?mi(t[n-1]):e}e.layout.treemap=function(){var t=e.layout.hierarchy(),n=Math.round,r=[1,1],i=null,a=hi,o=!1,s,c=`squarify`,l=.5*(1+Math.sqrt(5));function u(e,t){for(var n=-1,r=e.length,i,a;++n<r;)a=(i=e[n]).value*(t<0?0:t),i.area=isNaN(a)||a<=0?0:a}function d(e){var t=e.children;if(t&&t.length){var n=a(e),r=[],i=t.slice(),o,s=1/0,l,f=c===`slice`?n.dx:c===`dice`?n.dy:c===`slice-dice`?e.depth&1?n.dy:n.dx:Math.min(n.dx,n.dy),h;for(u(i,n.dx*n.dy/e.value),r.area=0;(h=i.length)>0;)r.push(o=i[h-1]),r.area+=o.area,c!==`squarify`||(l=p(r,f))<=s?(i.pop(),s=l):(r.area-=r.pop().area,m(r,f,n,!1),f=Math.min(n.dx,n.dy),r.length=r.area=0,s=1/0);r.length&&=(m(r,f,n,!0),r.area=0),t.forEach(d)}}function f(e){var t=e.children;if(t&&t.length){var n=a(e),r=t.slice(),i,o=[];for(u(r,n.dx*n.dy/e.value),o.area=0;i=r.pop();)o.push(i),o.area+=i.area,i.z!=null&&(m(o,i.z?n.dx:n.dy,n,!r.length),o.length=o.area=0);t.forEach(f)}}function p(e,t){for(var n=e.area,r,i=0,a=1/0,o=-1,s=e.length;++o<s;)(r=e[o].area)&&(r<a&&(a=r),r>i&&(i=r));return n*=n,t*=t,n?Math.max(t*i*l/n,n/(t*a*l)):1/0}function m(e,t,r,i){var a=-1,o=e.length,s=r.x,c=r.y,l=t?n(e.area/t):0,u;if(t==r.dx){for((i||l>r.dy)&&(l=r.dy);++a<o;)u=e[a],u.x=s,u.y=c,u.dy=l,s+=u.dx=Math.min(r.x+r.dx-s,l?n(u.area/l):0);u.z=!0,u.dx+=r.x+r.dx-s,r.y+=l,r.dy-=l}else{for((i||l>r.dx)&&(l=r.dx);++a<o;)u=e[a],u.x=s,u.y=c,u.dx=l,c+=u.dy=Math.min(r.y+r.dy-c,l?n(u.area/l):0);u.z=!1,u.dy+=r.y+r.dy-c,r.x+=l,r.dx-=l}}function h(e){var n=s||t(e),i=n[0];return i.x=i.y=0,i.value?(i.dx=r[0],i.dy=r[1]):i.dx=i.dy=0,s&&t.revalue(i),u([i],i.dx*i.dy/i.value),(s?f:d)(i),o&&(s=n),n}return h.size=function(e){return arguments.length?(r=e,h):r},h.padding=function(e){if(!arguments.length)return i;function t(t){var n=e.call(h,t,t.depth);return n==null?hi(t):gi(t,typeof n==`number`?[n,n,n,n]:n)}function n(t){return gi(t,e)}var r;return a=(i=e)==null?hi:(r=typeof e)==`function`?t:(r===`number`&&(e=[e,e,e,e]),n),h},h.round=function(e){return arguments.length?(n=e?Math.round:Number,h):n!=Number},h.sticky=function(e){return arguments.length?(o=e,s=null,h):o},h.ratio=function(e){return arguments.length?(l=e,h):l},h.mode=function(e){return arguments.length?(c=e+``,h):c},kr(h,t)};function hi(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function gi(e,t){var n=e.x+t[3],r=e.y+t[0],i=e.dx-t[1]-t[3],a=e.dy-t[0]-t[2];return i<0&&(n+=i/2,i=0),a<0&&(r+=a/2,a=0),{x:n,y:r,dx:i,dy:a}}e.random={normal:function(e,t){var n=arguments.length;return n<2&&(t=1),n<1&&(e=0),function(){var n,r,i;do n=Math.random()*2-1,r=Math.random()*2-1,i=n*n+r*r;while(!i||i>1);return e+t*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=e.random.normal.apply(e,arguments);return function(){return Math.exp(t())}},bates:function(t){var n=e.random.irwinHall(t);return function(){return n()/t}},irwinHall:function(e){return function(){for(var t=0,n=0;n<e;n++)t+=Math.random();return t}}},e.scale={};function _i(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function vi(e){return e.rangeExtent?e.rangeExtent():_i(e.range())}function yi(e,t,n,r){var i=n(e[0],e[1]),a=r(t[0],t[1]);return function(e){return a(i(e))}}function bi(e,t){var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function xi(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:Si}var Si={floor:M,ceil:M};function Ci(t,n,r,i){var a=[],o=[],s=0,c=Math.min(t.length,n.length)-1;for(t[c]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++s<=c;)a.push(r(t[s-1],t[s])),o.push(i(n[s-1],n[s]));return function(n){var r=e.bisect(t,n,1,c)-1;return o[r](a[r](n))}}e.scale.linear=function(){return wi([0,1],[0,1],Ln,!1)};function wi(e,t,n,r){var i,a;function o(){var o=Math.min(e.length,t.length)>2?Ci:yi,c=r?_r:gr;return i=o(e,t,c,n),a=o(t,e,c,Ln),s}function s(e){return i(e)}return s.invert=function(e){return a(e)},s.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},s.range=function(e){return arguments.length?(t=e,o()):t},s.rangeRound=function(e){return s.range(e).interpolate(ir)},s.clamp=function(e){return arguments.length?(r=e,o()):r},s.interpolate=function(e){return arguments.length?(n=e,o()):n},s.ticks=function(t){return Oi(e,t)},s.tickFormat=function(t,n){return d3_scale_linearTickFormat(e,t,n)},s.nice=function(t){return Ei(e,t),o()},s.copy=function(){return wi(e,t,n,r)},o()}function Ti(t,n){return e.rebind(t,n,`range`,`rangeRound`,`interpolate`,`clamp`)}function Ei(e,t){return bi(e,xi(Di(e,t)[2])),bi(e,xi(Di(e,t)[2])),e}function Di(e,t){t??=10;var n=_i(e),r=n[1]-n[0],i=10**Math.floor(Math.log(r/t)/Math.LN10),a=t/r*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+i*.5,n[2]=i,n}function Oi(t,n){return e.range.apply(e,Di(t,n))}e.scale.log=function(){return ki(e.scale.linear().domain([0,1]),10,!0,[1,10])};function ki(e,t,n,r){function i(e){return(n?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function a(e){return n?t**+e:-(t**+-e)}function o(t){return e(i(t))}return o.invert=function(t){return a(e.invert(t))},o.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((r=t.map(Number)).map(i)),o):r},o.base=function(n){return arguments.length?(t=+n,e.domain(r.map(i)),o):t},o.nice=function(){var t=bi(r.map(i),n?Math:Ai);return e.domain(t),r=t.map(a),o},o.ticks=function(){var e=_i(r),o=[],s=e[0],c=e[1],l=Math.floor(i(s)),u=Math.ceil(i(c)),d=t%1?2:t;if(isFinite(u-l)){if(n){for(;l<u;l++)for(var f=1;f<d;f++)o.push(a(l)*f);o.push(a(l))}else for(o.push(a(l));l++<u;)for(var f=d-1;f>0;f--)o.push(a(l)*f);for(l=0;o[l]<s;l++);for(u=o.length;o[u-1]>c;u--);o=o.slice(l,u)}return o},o.copy=function(){return ki(e.copy(),t,n,r)},Ti(o,e)}var Ai={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};e.scale.pow=function(){return ji(e.scale.linear(),1,[0,1])};function ji(e,t,n){var r=Mi(t),i=Mi(1/t);function a(t){return e(r(t))}return a.invert=function(t){return i(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(r)),a):n},a.ticks=function(e){return Oi(n,e)},a.tickFormat=function(e,t){return d3_scale_linearTickFormat(n,e,t)},a.nice=function(e){return a.domain(Ei(n,e))},a.exponent=function(o){return arguments.length?(r=Mi(t=o),i=Mi(1/t),e.domain(n.map(r)),a):t},a.copy=function(){return ji(e.copy(),t,n)},Ti(a,e)}function Mi(e){return function(t){return t<0?-((-t)**+e):t**+e}}e.scale.sqrt=function(){return e.scale.pow().exponent(.5)},e.scale.ordinal=function(){return Ni([],{t:`range`,a:[[]]})};function Ni(t,n){var r,i,a;function o(e){return i[((r.get(e)||(n.t===`range`?r.set(e,t.push(e)):NaN))-1)%i.length]}function s(n,r){return e.range(t.length).map(function(e){return n+r*e})}return o.domain=function(e){if(!arguments.length)return t;t=[],r=new x;for(var i=-1,a=e.length,s;++i<a;)r.has(s=e[i])||r.set(s,t.push(s));return o[n.t].apply(o,n.a)},o.range=function(e){return arguments.length?(i=e,a=0,n={t:`range`,a:arguments},o):i},o.rangePoints=function(e,r){arguments.length<2&&(r=0);var c=e[0],l=e[1],u=t.length<2?(c=(c+l)/2,0):(l-c)/(t.length-1+r);return i=s(c+u*r/2,u),a=0,n={t:`rangePoints`,a:arguments},o},o.rangeRoundPoints=function(e,r){arguments.length<2&&(r=0);var c=e[0],l=e[1],u=t.length<2?(c=l=Math.round((c+l)/2),0):(l-c)/(t.length-1+r)|0;return i=s(c+Math.round(u*r/2+(l-c-(t.length-1+r)*u)/2),u),a=0,n={t:`rangeRoundPoints`,a:arguments},o},o.rangeBands=function(e,r,c){arguments.length<2&&(r=0),arguments.length<3&&(c=r);var l=e[1]<e[0],u=e[l-0],d=(e[1-l]-u)/(t.length-r+2*c);return i=s(u+d*c,d),l&&i.reverse(),a=d*(1-r),n={t:`rangeBands`,a:arguments},o},o.rangeRoundBands=function(e,r,c){arguments.length<2&&(r=0),arguments.length<3&&(c=r);var l=e[1]<e[0],u=e[l-0],d=e[1-l],f=Math.floor((d-u)/(t.length-r+2*c));return i=s(u+Math.round((d-u-(t.length-r)*f)/2),f),l&&i.reverse(),a=Math.round(f*(1-r)),n={t:`rangeRoundBands`,a:arguments},o},o.rangeBand=function(){return a},o.rangeExtent=function(){return _i(n.a[0])},o.copy=function(){return Ni(t,n)},o.domain(t)}e.scale.category10=function(){return e.scale.ordinal().range(Pi)},e.scale.category20=function(){return e.scale.ordinal().range(Fi)},e.scale.category20b=function(){return e.scale.ordinal().range(Ii)},e.scale.category20c=function(){return e.scale.ordinal().range(Li)};var Pi=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(dt),Fi=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(dt),Ii=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(dt),Li=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(dt);e.scale.quantile=function(){return Ri([],[])};function Ri(t,n){var r;function i(){var i=0,o=n.length;for(r=[];++i<o;)r[i-1]=e.quantile(t,i/o);return a}function a(t){if(!isNaN(t=+t))return n[e.bisect(r,t)]}return a.domain=function(e){return arguments.length?(t=e.map(p).filter(m).sort(f),i()):t},a.range=function(e){return arguments.length?(n=e,i()):n},a.quantiles=function(){return r},a.invertExtent=function(e){return e=n.indexOf(e),e<0?[NaN,NaN]:[e>0?r[e-1]:t[0],e<r.length?r[e]:t[t.length-1]]},a.copy=function(){return Ri(t,n)},i()}e.scale.quantize=function(){return zi(0,1,[0,1])};function zi(e,t,n){var r,i;function a(t){return n[Math.max(0,Math.min(i,Math.floor(r*(t-e))))]}function o(){return r=n.length/(t-e),i=n.length-1,a}return a.domain=function(n){return arguments.length?(e=+n[0],t=+n[n.length-1],o()):[e,t]},a.range=function(e){return arguments.length?(n=e,o()):n},a.invertExtent=function(t){return t=n.indexOf(t),t=t<0?NaN:t/r+e,[t,t+1/r]},a.copy=function(){return zi(e,t,n)},o()}e.scale.threshold=function(){return Bi([.5],[0,1])};function Bi(t,n){function r(r){if(r<=r)return n[e.bisect(t,r)]}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(e){return arguments.length?(n=e,r):n},r.invertExtent=function(e){return e=n.indexOf(e),[t[e-1],t[e]]},r.copy=function(){return Bi(t,n)},r}e.scale.identity=function(){return Vi([0,1])};function Vi(e){function t(e){return+e}return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=n.map(t),t):e},t.ticks=function(t){return Oi(e,t)},t.tickFormat=function(t,n){return d3_scale_linearTickFormat(e,t,n)},t.copy=function(){return Vi(e)},t}e.svg={};function Hi(){return 0}e.svg.arc=function(){var e=Wi,t=Gi,n=Hi,r=Ui,i=Ki,a=qi,o=Ji;function s(){var s=Math.max(0,+e.apply(this,arguments)),l=Math.max(0,+t.apply(this,arguments)),u=i.apply(this,arguments)-Me,d=a.apply(this,arguments)-Me,f=Math.abs(d-u),p=u>d?0:1;if(l<s&&(m=l,l=s,s=m),f>=je)return c(l,p)+(s?c(s,1-p):``)+`Z`;var m,h,g,_,v=0,y=0,b,x,S,C,w,T,E,D,O=[];if((_=(+o.apply(this,arguments)||0)/2)&&(g=r===Ui?Math.sqrt(s*s+l*l):+r.apply(this,arguments),p||(y*=-1),l&&(y=Ie(g/l*Math.sin(_))),s&&(v=Ie(g/s*Math.sin(_)))),l){b=l*Math.cos(u+y),x=l*Math.sin(u+y),S=l*Math.cos(d-y),C=l*Math.sin(d-y);var k=Math.abs(d-u-2*y)<=ke?0:1;if(y&&Yi(b,x,S,C)===p^k){var A=(u+d)/2;b=l*Math.cos(A),x=l*Math.sin(A),S=C=null}}else b=x=0;if(s){w=s*Math.cos(d-v),T=s*Math.sin(d-v),E=s*Math.cos(u+v),D=s*Math.sin(u+v);var j=Math.abs(u-d+2*v)<=ke?0:1;if(v&&Yi(w,T,E,D)===1-p^j){var M=(u+d)/2;w=s*Math.cos(M),T=s*Math.sin(M),E=D=null}}else w=T=0;if(f>De&&(m=Math.min(Math.abs(l-s)/2,+n.apply(this,arguments)))>.001){h=s<l^p?0:1;var N=m,P=m;if(f<ke){var F=E==null?[w,T]:S==null?[b,x]:Bt([b,x],[E,D],[S,C],[w,T]),I=b-F[0],L=x-F[1],R=S-F[0],z=C-F[1],B=1/Math.sin(Math.acos((I*R+L*z)/(Math.sqrt(I*I+L*L)*Math.sqrt(R*R+z*z)))/2),V=Math.sqrt(F[0]*F[0]+F[1]*F[1]);P=Math.min(m,(s-V)/(B-1)),N=Math.min(m,(l-V)/(B+1))}if(S!=null){var H=Xi(E==null?[w,T]:[E,D],[b,x],l,N,p),U=Xi([S,C],[w,T],l,N,p);m===N?O.push(`M`,H[0],`A`,N,`,`,N,` 0 0,`,h,` `,H[1],`A`,l,`,`,l,` 0 `,1-p^Yi(H[1][0],H[1][1],U[1][0],U[1][1]),`,`,p,` `,U[1],`A`,N,`,`,N,` 0 0,`,h,` `,U[0]):O.push(`M`,H[0],`A`,N,`,`,N,` 0 1,`,h,` `,U[0])}else O.push(`M`,b,`,`,x);if(E!=null){var W=Xi([b,x],[E,D],s,-P,p),G=Xi([w,T],S==null?[b,x]:[S,C],s,-P,p);m===P?O.push(`L`,G[0],`A`,P,`,`,P,` 0 0,`,h,` `,G[1],`A`,s,`,`,s,` 0 `,p^Yi(G[1][0],G[1][1],W[1][0],W[1][1]),`,`,1-p,` `,W[1],`A`,P,`,`,P,` 0 0,`,h,` `,W[0]):O.push(`L`,G[0],`A`,P,`,`,P,` 0 0,`,h,` `,W[0])}else O.push(`L`,w,`,`,T)}else O.push(`M`,b,`,`,x),S!=null&&O.push(`A`,l,`,`,l,` 0 `,k,`,`,p,` `,S,`,`,C),O.push(`L`,w,`,`,T),E!=null&&O.push(`A`,s,`,`,s,` 0 `,j,`,`,1-p,` `,E,`,`,D);return O.push(`Z`),O.join(``)}function c(e,t){return`M0,`+e+`A`+e+`,`+e+` 0 1,`+t+` 0,`+-e+`A`+e+`,`+e+` 0 1,`+t+` 0,`+e}return s.innerRadius=function(t){return arguments.length?(e=bt(t),s):e},s.outerRadius=function(e){return arguments.length?(t=bt(e),s):t},s.cornerRadius=function(e){return arguments.length?(n=bt(e),s):n},s.padRadius=function(e){return arguments.length?(r=e==Ui?Ui:bt(e),s):r},s.startAngle=function(e){return arguments.length?(i=bt(e),s):i},s.endAngle=function(e){return arguments.length?(a=bt(e),s):a},s.padAngle=function(e){return arguments.length?(o=bt(e),s):o},s.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Me;return[Math.cos(r)*n,Math.sin(r)*n]},s};var Ui=`auto`;function Wi(e){return e.innerRadius}function Gi(e){return e.outerRadius}function Ki(e){return e.startAngle}function qi(e){return e.endAngle}function Ji(e){return e&&e.padAngle}function Yi(e,t,n,r){return(e-n)*t-(t-r)*e>0?0:1}function Xi(e,t,n,r,i){var a=e[0]-t[0],o=e[1]-t[1],s=(i?r:-r)/Math.sqrt(a*a+o*o),c=s*o,l=-s*a,u=e[0]+c,d=e[1]+l,f=t[0]+c,p=t[1]+l,m=(u+f)/2,h=(d+p)/2,g=f-u,_=p-d,v=g*g+_*_,y=n-r,b=u*p-f*d,x=(_<0?-1:1)*Math.sqrt(Math.max(0,y*y*v-b*b)),S=(b*_-g*x)/v,C=(-b*g-_*x)/v,w=(b*_+g*x)/v,T=(-b*g+_*x)/v,E=S-m,D=C-h,O=w-m,k=T-h;return E*E+D*D>O*O+k*k&&(S=w,C=T),[[S-c,C-l],[S*n/y,C*n/y]]}function Zi(){return!0}function Qi(e){var t=Pt,n=Ft,r=Zi,i=ea,a=i.key,o=.7;function s(a){var s=[],c=[],l=-1,u=a.length,d,f=bt(t),p=bt(n);function m(){s.push(`M`,i(e(c),o))}for(;++l<u;)r.call(this,d=a[l],l)?c.push([+f.call(this,d,l),+p.call(this,d,l)]):c.length&&(m(),c=[]);return c.length&&m(),s.length?s.join(``):null}return s.x=function(e){return arguments.length?(t=e,s):t},s.y=function(e){return arguments.length?(n=e,s):n},s.defined=function(e){return arguments.length?(r=e,s):r},s.interpolate=function(e){return arguments.length?(a=typeof e==`function`?i=e:(i=$i.get(e)||ea).key,s):a},s.tension=function(e){return arguments.length?(o=e,s):o},s}e.svg.line=function(){return Qi(M)};var $i=e.map({linear:ea,"linear-closed":ta,step:na,"step-before":ra,"step-after":ia,basis:ua,"basis-open":da,"basis-closed":fa,bundle:pa,cardinal:sa,"cardinal-open":aa,"cardinal-closed":oa,monotone:Sa});$i.forEach(function(e,t){t.key=e,t.closed=/-closed$/.test(e)});function ea(e){return e.length>1?e.join(`L`):e+`Z`}function ta(e){return e.join(`L`)+`Z`}function na(e){for(var t=0,n=e.length,r=e[0],i=[r[0],`,`,r[1]];++t<n;)i.push(`H`,(r[0]+(r=e[t])[0])/2,`V`,r[1]);return n>1&&i.push(`H`,r[0]),i.join(``)}function ra(e){for(var t=0,n=e.length,r=e[0],i=[r[0],`,`,r[1]];++t<n;)i.push(`V`,(r=e[t])[1],`H`,r[0]);return i.join(``)}function ia(e){for(var t=0,n=e.length,r=e[0],i=[r[0],`,`,r[1]];++t<n;)i.push(`H`,(r=e[t])[0],`V`,r[1]);return i.join(``)}function aa(e,t){return e.length<4?ea(e):e[1]+ca(e.slice(1,-1),la(e,t))}function oa(e,t){return e.length<3?ta(e):e[0]+ca((e.push(e[0]),e),la([e[e.length-2]].concat(e,[e[1]]),t))}function sa(e,t){return e.length<3?ea(e):e[0]+ca(e,la(e,t))}function ca(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return ea(e);var n=e.length!=t.length,r=``,i=e[0],a=e[1],o=t[0],s=o,c=1;if(n&&(r+=`Q`+(a[0]-o[0]*2/3)+`,`+(a[1]-o[1]*2/3)+`,`+a[0]+`,`+a[1],i=e[1],c=2),t.length>1){s=t[1],a=e[c],c++,r+=`C`+(i[0]+o[0])+`,`+(i[1]+o[1])+`,`+(a[0]-s[0])+`,`+(a[1]-s[1])+`,`+a[0]+`,`+a[1];for(var l=2;l<t.length;l++,c++)a=e[c],s=t[l],r+=`S`+(a[0]-s[0])+`,`+(a[1]-s[1])+`,`+a[0]+`,`+a[1]}if(n){var u=e[c];r+=`Q`+(a[0]+s[0]*2/3)+`,`+(a[1]+s[1]*2/3)+`,`+u[0]+`,`+u[1]}return r}function la(e,t){for(var n=[],r=(1-t)/2,i,a=e[0],o=e[1],s=1,c=e.length;++s<c;)i=a,a=o,o=e[s],n.push([r*(o[0]-i[0]),r*(o[1]-i[1])]);return n}function ua(e){if(e.length<3)return ea(e);var t=1,n=e.length,r=e[0],i=r[0],a=r[1],o=[i,i,i,(r=e[1])[0]],s=[a,a,a,r[1]],c=[i,`,`,a,`L`,ma(_a,o),`,`,ma(_a,s)];for(e.push(e[n-1]);++t<=n;)r=e[t],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),va(c,o,s);return e.pop(),c.push(`L`,r),c.join(``)}function da(e){if(e.length<4)return ea(e);for(var t=[],n=-1,r=e.length,i,a=[0],o=[0];++n<3;)i=e[n],a.push(i[0]),o.push(i[1]);for(t.push(ma(_a,a)+`,`+ma(_a,o)),--n;++n<r;)i=e[n],a.shift(),a.push(i[0]),o.shift(),o.push(i[1]),va(t,a,o);return t.join(``)}function fa(e){for(var t,n=-1,r=e.length,i=r+4,a,o=[],s=[];++n<4;)a=e[n%r],o.push(a[0]),s.push(a[1]);for(t=[ma(_a,o),`,`,ma(_a,s)],--n;++n<i;)a=e[n%r],o.shift(),o.push(a[0]),s.shift(),s.push(a[1]),va(t,o,s);return t.join(``)}function pa(e,t){var n=e.length-1;if(n)for(var r=e[0][0],i=e[0][1],a=e[n][0]-r,o=e[n][1]-i,s=-1,c,l;++s<=n;)c=e[s],l=s/n,c[0]=t*c[0]+(1-t)*(r+l*a),c[1]=t*c[1]+(1-t)*(i+l*o);return ua(e)}function ma(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}var ha=[0,2/3,1/3,0],ga=[0,1/3,2/3,0],_a=[0,1/6,2/3,1/6];function va(e,t,n){e.push(`C`,ma(ha,t),`,`,ma(ha,n),`,`,ma(ga,t),`,`,ma(ga,n),`,`,ma(_a,t),`,`,ma(_a,n))}function ya(e,t){return(t[1]-e[1])/(t[0]-e[0])}function ba(e){for(var t=0,n=e.length-1,r=[],i=e[0],a=e[1],o=r[0]=ya(i,a);++t<n;)r[t]=(o+(o=ya(i=a,a=e[t+1])))/2;return r[t]=o,r}function xa(e){for(var t=[],n,r,i,a,o=ba(e),s=-1,c=e.length-1;++s<c;)n=ya(e[s],e[s+1]),v(n)<De?o[s]=o[s+1]=0:(r=o[s]/n,i=o[s+1]/n,a=r*r+i*i,a>9&&(a=n*3/Math.sqrt(a),o[s]=a*r,o[s+1]=a*i));for(s=-1;++s<=c;)a=(e[Math.min(c,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),t.push([a||0,o[s]*a||0]);return t}function Sa(e){return e.length<3?ea(e):e[0]+ca(e,xa(e))}e.svg.line.radial=function(){var e=Qi(Ca);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e};function Ca(e){for(var t,n=-1,r=e.length,i,a;++n<r;)t=e[n],i=t[0],a=t[1]-Me,t[0]=i*Math.cos(a),t[1]=i*Math.sin(a);return e}function wa(e){var t=Pt,n=Pt,r=0,i=Ft,a=Zi,o=ea,s=o.key,c=o,l=`L`,u=.7;function d(s){var d=[],f=[],p=[],m=-1,h=s.length,g,_=bt(t),v=bt(r),y=t===n?function(){return x}:bt(n),b=r===i?function(){return S}:bt(i),x,S;function C(){d.push(`M`,o(e(p),u),l,c(e(f.reverse()),u),`Z`)}for(;++m<h;)a.call(this,g=s[m],m)?(f.push([x=+_.call(this,g,m),S=+v.call(this,g,m)]),p.push([+y.call(this,g,m),+b.call(this,g,m)])):f.length&&(C(),f=[],p=[]);return f.length&&C(),d.length?d.join(``):null}return d.x=function(e){return arguments.length?(t=n=e,d):n},d.x0=function(e){return arguments.length?(t=e,d):t},d.x1=function(e){return arguments.length?(n=e,d):n},d.y=function(e){return arguments.length?(r=i=e,d):i},d.y0=function(e){return arguments.length?(r=e,d):r},d.y1=function(e){return arguments.length?(i=e,d):i},d.defined=function(e){return arguments.length?(a=e,d):a},d.interpolate=function(e){return arguments.length?(s=typeof e==`function`?o=e:(o=$i.get(e)||ea).key,c=o.reverse||o,l=o.closed?`M`:`L`,d):s},d.tension=function(e){return arguments.length?(u=e,d):u},d}ra.reverse=ia,ia.reverse=ra,e.svg.area=function(){return wa(M)},e.svg.area.radial=function(){var e=wa(Ca);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e};function Ta(e){return e.source}function Ea(e){return e.target}e.svg.chord=function(){var e=Ta,t=Ea,n=Da,r=Ki,i=qi;function a(n,r){var i=o(this,e,n,r),a=o(this,t,n,r);return`M`+i.p0+c(i.r,i.p1,i.a1-i.a0)+(s(i,a)?l(i.r,i.p1,i.r,i.p0):l(i.r,i.p1,a.r,a.p0)+c(a.r,a.p1,a.a1-a.a0)+l(a.r,a.p1,i.r,i.p0))+`Z`}function o(e,t,a,o){var s=t.call(e,a,o),c=n.call(e,s,o),l=r.call(e,s,o)-Me,u=i.call(e,s,o)-Me;return{r:c,a0:l,a1:u,p0:[c*Math.cos(l),c*Math.sin(l)],p1:[c*Math.cos(u),c*Math.sin(u)]}}function s(e,t){return e.a0==t.a0&&e.a1==t.a1}function c(e,t,n){return`A`+e+`,`+e+` 0 `+ +(n>ke)+`,1 `+t}function l(e,t,n,r){return`Q 0,0 `+r}return a.radius=function(e){return arguments.length?(n=bt(e),a):n},a.source=function(t){return arguments.length?(e=bt(t),a):e},a.target=function(e){return arguments.length?(t=bt(e),a):t},a.startAngle=function(e){return arguments.length?(r=bt(e),a):r},a.endAngle=function(e){return arguments.length?(i=bt(e),a):i},a};function Da(e){return e.radius}e.svg.diagonal=function(){var e=Ta,t=Ea,n=Oa;function r(r,i){var a=e.call(this,r,i),o=t.call(this,r,i),s=(a.y+o.y)/2,c=[a,{x:a.x,y:s},{x:o.x,y:s},o];return c=c.map(n),`M`+c[0]+`C`+c[1]+` `+c[2]+` `+c[3]}return r.source=function(t){return arguments.length?(e=bt(t),r):e},r.target=function(e){return arguments.length?(t=bt(e),r):t},r.projection=function(e){return arguments.length?(n=e,r):n},r};function Oa(e){return[e.x,e.y]}e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),n=Oa,r=t.projection;return t.projection=function(e){return arguments.length?r(ka(n=e)):n},t};function ka(e){return function(){var t=e.apply(this,arguments),n=t[0],r=t[1]-Me;return[n*Math.cos(r),n*Math.sin(r)]}}e.svg.symbol=function(){var e=ja,t=Aa;function n(n,r){return(Na.get(e.call(this,n,r))||Ma)(t.call(this,n,r))}return n.type=function(t){return arguments.length?(e=bt(t),n):e},n.size=function(e){return arguments.length?(t=bt(e),n):t},n};function Aa(){return 64}function ja(){return`circle`}function Ma(e){var t=Math.sqrt(e/ke);return`M0,`+t+`A`+t+`,`+t+` 0 1,1 0,`+-t+`A`+t+`,`+t+` 0 1,1 0,`+t+`Z`}var Na=e.map({circle:Ma,cross:function(e){var t=Math.sqrt(e/5)/2;return`M`+-3*t+`,`+-t+`H`+-t+`V`+-3*t+`H`+t+`V`+-t+`H`+3*t+`V`+t+`H`+t+`V`+3*t+`H`+-t+`V`+t+`H`+-3*t+`Z`},diamond:function(e){var t=Math.sqrt(e/(2*Fa)),n=t*Fa;return`M0,`+-t+`L`+n+`,0 0,`+t+` `+-n+`,0Z`},square:function(e){var t=Math.sqrt(e)/2;return`M`+-t+`,`+-t+`L`+t+`,`+-t+` `+t+`,`+t+` `+-t+`,`+t+`Z`},"triangle-down":function(e){var t=Math.sqrt(e/Pa),n=t*Pa/2;return`M0,`+n+`L`+t+`,`+-n+` `+-t+`,`+-n+`Z`},"triangle-up":function(e){var t=Math.sqrt(e/Pa),n=t*Pa/2;return`M0,`+-n+`L`+t+`,`+n+` `+-t+`,`+n+`Z`}});e.svg.symbolTypes=Na.keys();var Pa=Math.sqrt(3),Fa=Math.tan(30*Ne);J.transition=function(e){for(var t=Va||++Ba,n=Ga(e),r=[],i,a,o=Ha||{time:Date.now(),ease:qn,delay:0,duration:250},s=-1,c=this.length;++s<c;){r.push(i=[]);for(var l=this[s],u=-1,d=l.length;++u<d;)(a=l[u])&&Ka(a,u,n,t,o),i.push(a)}return Ra(r,n,t)},J.interrupt=function(e){return this.each(e==null?Ia:La(Ga(e)))};var Ia=La(Ga());function La(e){return function(){var t,n,r;(t=this[e])&&(r=t[n=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[n]:delete this[e],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Ra(e,t,n){return U(e,za),e.namespace=t,e.id=n,e}var za=[],Ba=0,Va,Ha;za.call=J.call,za.empty=J.empty,za.node=J.node,za.size=J.size,e.transition=function(t,n){return t&&t.transition?Va?t.transition(n):t:e.selection().transition(t)},e.transition.prototype=za,za.select=function(e){var t=this.id,n=this.namespace,r=[],i,a,o;e=Y(e);for(var s=-1,c=this.length;++s<c;){r.push(i=[]);for(var l=this[s],u=-1,d=l.length;++u<d;)(o=l[u])&&(a=e.call(o,o.__data__,u,s))?(`__data__`in o&&(a.__data__=o.__data__),Ka(a,u,n,t,o[n][t]),i.push(a)):i.push(null)}return Ra(r,n,t)},za.selectAll=function(e){var t=this.id,n=this.namespace,r=[],i,a,o,s,c;e=X(e);for(var l=-1,u=this.length;++l<u;)for(var d=this[l],f=-1,p=d.length;++f<p;)if(o=d[f]){c=o[n][t],a=e.call(o,o.__data__,f,l),r.push(i=[]);for(var m=-1,h=a.length;++m<h;)(s=a[m])&&Ka(s,m,n,t,c),i.push(s)}return Ra(r,n,t)},za.filter=function(e){var t=[],n,r,i;typeof e!=`function`&&(e=de(e));for(var a=0,o=this.length;a<o;a++){t.push(n=[]);for(var r=this[a],s=0,c=r.length;s<c;s++)(i=r[s])&&e.call(i,i.__data__,s,a)&&n.push(i)}return Ra(t,this.namespace,this.id)},za.tween=function(e,t){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(e):pe(this,t==null?function(t){t[r][n].tween.remove(e)}:function(i){i[r][n].tween.set(e,t)})};function Ua(e,t,n,r){var i=e.id,a=e.namespace;return pe(e,typeof n==`function`?function(e,o,s){e[a][i].tween.set(t,r(n.call(e,e.__data__,o,s)))}:(n=r(n),function(e){e[a][i].tween.set(t,n)}))}za.attr=function(t,n){if(arguments.length<2){for(n in t)this.attr(n,t[n]);return this}var r=t==`transform`?hr:Ln,i=e.ns.qualify(t);function a(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}function s(e){return e==null?a:(e+=``,function(){var t=this.getAttribute(i),n;return t!==e&&(n=r(t,e),function(e){this.setAttribute(i,n(e))})})}function c(e){return e==null?o:(e+=``,function(){var t=this.getAttributeNS(i.space,i.local),n;return t!==e&&(n=r(t,e),function(e){this.setAttributeNS(i.space,i.local,n(e))})})}return Ua(this,`attr.`+t,n,i.local?c:s)},za.attrTween=function(t,n){var r=e.ns.qualify(t);function i(e,t){var i=n.call(this,e,t,this.getAttribute(r));return i&&function(e){this.setAttribute(r,i(e))}}function a(e,t){var i=n.call(this,e,t,this.getAttributeNS(r.space,r.local));return i&&function(e){this.setAttributeNS(r.space,r.local,i(e))}}return this.tween(`attr.`+t,r.local?a:i)},za.style=function(e,t,n){var r=arguments.length;if(r<3){if(typeof e!=`string`){for(n in r<2&&(t=``),e)this.style(n,e[n],t);return this}n=``}function i(){this.style.removeProperty(e)}function a(t){return t==null?i:(t+=``,function(){var r=o(this).getComputedStyle(this,null).getPropertyValue(e),i;return r!==t&&(i=Ln(r,t),function(t){this.style.setProperty(e,i(t),n)})})}return Ua(this,`style.`+e,t,a)},za.styleTween=function(e,t,n){arguments.length<3&&(n=``);function r(r,i){var a=t.call(this,r,i,o(this).getComputedStyle(this,null).getPropertyValue(e));return a&&function(t){this.style.setProperty(e,a(t),n)}}return this.tween(`style.`+e,r)},za.text=function(e){return Ua(this,`text`,e,Wa)};function Wa(e){return e??=``,function(){this.textContent=e}}za.remove=function(){var e=this.namespace;return this.each(`end.transition`,function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)})},za.ease=function(t){var n=this.id,r=this.namespace;return arguments.length<1?this.node()[r][n].ease:(typeof t!=`function`&&(t=e.ease.apply(e,arguments)),pe(this,function(e){e[r][n].ease=t}))},za.delay=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].delay:pe(this,typeof e==`function`?function(r,i,a){r[n][t].delay=+e.call(r,r.__data__,i,a)}:(e=+e,function(r){r[n][t].delay=e}))},za.duration=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].duration:pe(this,typeof e==`function`?function(r,i,a){r[n][t].duration=Math.max(1,e.call(r,r.__data__,i,a))}:(e=Math.max(1,e),function(r){r[n][t].duration=e}))},za.each=function(t,n){var r=this.id,i=this.namespace;if(arguments.length<2){var a=Ha,o=Va;try{Va=r,pe(this,function(e,n,a){Ha=e[i][r],t.call(e,e.__data__,n,a)})}finally{Ha=a,Va=o}}else pe(this,function(a){var o=a[i][r];(o.event||=e.dispatch(`start`,`end`,`interrupt`)).on(t,n)});return this},za.transition=function(){for(var e=this.id,t=++Ba,n=this.namespace,r=[],i,a,o,s,c=0,l=this.length;c<l;c++){r.push(i=[]);for(var a=this[c],u=0,d=a.length;u<d;u++)(o=a[u])&&(s=o[n][e],Ka(o,u,n,t,{time:s.time,ease:s.ease,delay:s.delay+s.duration,duration:s.duration})),i.push(o)}return Ra(r,n,t)};function Ga(e){return e==null?`__transition__`:`__transition_`+e+`__`}function Ka(e,t,n,r,i){var a=e[n]||(e[n]={active:0,count:0}),o=a[r],s,c,l,u,d;function f(e){var t=o.delay;if(c.t=t+s,t<=e)return p(e-t);c.c=p}function p(n){var i=a.active,f=a[i];for(var p in f&&(f.timer.c=null,f.timer.t=NaN,--a.count,delete a[i],f.event&&f.event.interrupt.call(e,e.__data__,f.index)),a)if(+p<r){var h=a[p];h.timer.c=null,h.timer.t=NaN,--a.count,delete a[p]}c.c=m,At(function(){return c.c&&m(n||1)&&(c.c=null,c.t=NaN),1},0,s),a.active=r,o.event&&o.event.start.call(e,e.__data__,t),d=[],o.tween.forEach(function(n,r){(r=r.call(e,e.__data__,t))&&d.push(r)}),u=o.ease,l=o.duration}function m(i){for(var s=i/l,c=u(s),f=d.length;f>0;)d[--f].call(e,c);if(s>=1)return o.event&&o.event.end.call(e,e.__data__,t),--a.count?delete a[r]:delete e[n],1}o||(s=i.time,c=At(f,0,s),o=a[r]={tween:new x,time:s,timer:c,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++a.count)}e.svg.axis=function(){var t=e.scale.linear(),n=qa,i=6,a=6,o=3,s=[10],c=null,l;function u(r){r.each(function(){var r=e.select(this),u=this.__chart__||t,d=this.__chart__=t.copy(),f=c??(d.ticks?d.ticks.apply(d,s):d.domain()),p=l??(d.tickFormat?d.tickFormat.apply(d,s):M),m=r.selectAll(`.tick`).data(f,d),h=m.enter().insert(`g`,`.domain`).attr(`class`,`tick`).style(`opacity`,De),g=e.transition(m.exit()).style(`opacity`,De).remove(),_=e.transition(m.order()).style(`opacity`,1),v=Math.max(i,0)+o,y,b=vi(d),x=r.selectAll(`.domain`).data([0]),S=(x.enter().append(`path`).attr(`class`,`domain`),e.transition(x));h.append(`line`),h.append(`text`);var C=h.select(`line`),w=_.select(`line`),T=m.select(`text`).text(p),E=h.select(`text`),D=_.select(`text`),O=n===`top`||n===`left`?-1:1,k,A,j,N;if(n===`bottom`||n===`top`?(y=Ya,k=`x`,j=`y`,A=`x2`,N=`y2`,T.attr(`dy`,O<0?`0em`:`.71em`).style(`text-anchor`,`middle`),S.attr(`d`,`M`+b[0]+`,`+O*a+`V0H`+b[1]+`V`+O*a)):(y=Xa,k=`y`,j=`x`,A=`y2`,N=`x2`,T.attr(`dy`,`.32em`).style(`text-anchor`,O<0?`end`:`start`),S.attr(`d`,`M`+O*a+`,`+b[0]+`H0V`+b[1]+`H`+O*a)),C.attr(N,O*i),E.attr(j,O*v),w.attr(A,0).attr(N,O*i),D.attr(k,0).attr(j,O*v),d.rangeBand){var P=d,F=P.rangeBand()/2;u=d=function(e){return P(e)+F}}else u.rangeBand?u=d:g.call(y,d,u);h.call(y,u,d),_.call(y,d,d)})}return u.scale=function(e){return arguments.length?(t=e,u):t},u.orient=function(e){return arguments.length?(n=e in Ja?e+``:qa,u):n},u.ticks=function(){return arguments.length?(s=r(arguments),u):s},u.tickValues=function(e){return arguments.length?(c=e,u):c},u.tickFormat=function(e){return arguments.length?(l=e,u):l},u.tickSize=function(e){var t=arguments.length;return t?(i=+e,a=+arguments[t-1],u):i},u.innerTickSize=function(e){return arguments.length?(i=+e,u):i},u.outerTickSize=function(e){return arguments.length?(a=+e,u):a},u.tickPadding=function(e){return arguments.length?(o=+e,u):o},u.tickSubdivide=function(){return arguments.length&&u},u};var qa=`bottom`,Ja={top:1,right:1,bottom:1,left:1};function Ya(e,t,n){e.attr(`transform`,function(e){var r=t(e);return`translate(`+(isFinite(r)?r:n(e))+`,0)`})}function Xa(e,t,n){e.attr(`transform`,function(e){var r=t(e);return`translate(0,`+(isFinite(r)?r:n(e))+`)`})}e.svg.brush=function(){var t=V(f,`brushstart`,`brush`,`brushend`),n=null,r=null,i=[0,0],a=[0,0],s,c,l=!0,u=!0,d=Qa[0];function f(t){t.each(function(){var t=e.select(this).style(`pointer-events`,`all`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`).on(`mousedown.brush`,g).on(`touchstart.brush`,g),i=t.selectAll(`.background`).data([0]);i.enter().append(`rect`).attr(`class`,`background`).style(`visibility`,`hidden`).style(`cursor`,`crosshair`),t.selectAll(`.extent`).data([0]).enter().append(`rect`).attr(`class`,`extent`).style(`cursor`,`move`);var a=t.selectAll(`.resize`).data(d,M);a.exit().remove(),a.enter().append(`g`).attr(`class`,function(e){return`resize `+e}).style(`cursor`,function(e){return Za[e]}).append(`rect`).attr(`x`,function(e){return/[ew]$/.test(e)?-3:null}).attr(`y`,function(e){return/^[ns]/.test(e)?-3:null}).attr(`width`,6).attr(`height`,6).style(`visibility`,`hidden`),a.style(`display`,f.empty()?`none`:null);var o=e.transition(t),s=e.transition(i),c;n&&(c=vi(n),s.attr(`x`,c[0]).attr(`width`,c[1]-c[0]),m(o)),r&&(c=vi(r),s.attr(`y`,c[0]).attr(`height`,c[1]-c[0]),h(o)),p(o)})}f.event=function(n){n.each(function(){var n=t.of(this,arguments),r={x:i,y:a,i:s,j:c},o=this.__chart__||r;this.__chart__=r,Va?e.select(this).transition().each(`start.brush`,function(){s=o.i,c=o.j,i=o.x,a=o.y,n({type:`brushstart`})}).tween(`brush:brush`,function(){var e=Rn(i,r.x),t=Rn(a,r.y);return s=c=null,function(o){i=r.x=e(o),a=r.y=t(o),n({type:`brush`,mode:`resize`})}}).each(`end.brush`,function(){s=r.i,c=r.j,n({type:`brush`,mode:`resize`}),n({type:`brushend`})}):(n({type:`brushstart`}),n({type:`brush`,mode:`resize`}),n({type:`brushend`}))})};function p(e){e.selectAll(`.resize`).attr(`transform`,function(e){return`translate(`+i[+/e$/.test(e)]+`,`+a[+/^s/.test(e)]+`)`})}function m(e){e.select(`.extent`).attr(`x`,i[0]),e.selectAll(`.extent,.n>rect,.s>rect`).attr(`width`,i[1]-i[0])}function h(e){e.select(`.extent`).attr(`y`,a[0]),e.selectAll(`.extent,.e>rect,.w>rect`).attr(`height`,a[1]-a[0])}function g(){var d=this,g=e.select(e.event.target),_=t.of(d,arguments),v=e.select(d),y=g.datum(),b=!/^(n|s)$/.test(y)&&n,x=!/^(e|w)$/.test(y)&&r,S=g.classed(`extent`),C=Ce(d),w,T=e.mouse(d),E,D=e.select(o(d)).on(`keydown.brush`,A).on(`keyup.brush`,j);if(e.event.changedTouches?D.on(`touchmove.brush`,M).on(`touchend.brush`,P):D.on(`mousemove.brush`,M).on(`mouseup.brush`,P),v.interrupt().selectAll(`*`).interrupt(),S)T[0]=i[0]-T[0],T[1]=a[0]-T[1];else if(y){var O=+/w$/.test(y),k=+/^n/.test(y);E=[i[1-O]-T[0],a[1-k]-T[1]],T[0]=i[O],T[1]=a[k]}else e.event.altKey&&(w=T.slice());v.style(`pointer-events`,`none`).selectAll(`.resize`).style(`display`,null),e.select(`body`).style(`cursor`,g.style(`cursor`)),_({type:`brushstart`}),M();function A(){e.event.keyCode==32&&(S||=(w=null,T[0]-=i[1],T[1]-=a[1],2),z())}function j(){e.event.keyCode==32&&S==2&&(T[0]+=i[1],T[1]+=a[1],S=0,z())}function M(){var t=e.mouse(d),o=!1;E&&(t[0]+=E[0],t[1]+=E[1]),S||(e.event.altKey?(w||=[(i[0]+i[1])/2,(a[0]+a[1])/2],T[0]=i[+(t[0]<w[0])],T[1]=a[+(t[1]<w[1])]):w=null),b&&N(t,n,0)&&(m(v),o=!0),x&&N(t,r,1)&&(h(v),o=!0),o&&(p(v),_({type:`brush`,mode:S?`move`:`resize`}))}function N(e,t,n){var r=vi(t),o=r[0],d=r[1],f=T[n],p=n?a:i,m=p[1]-p[0],h,g;if(S&&(o-=f,d-=m+f),h=(n?u:l)?Math.max(o,Math.min(d,e[n])):e[n],S?g=(h+=f)+m:(w&&(f=Math.max(o,Math.min(d,2*w[n]-h))),f<h?(g=h,h=f):g=f),p[0]!=h||p[1]!=g)return n?c=null:s=null,p[0]=h,p[1]=g,!0}function P(){M(),v.style(`pointer-events`,`all`).selectAll(`.resize`).style(`display`,f.empty()?`none`:null),e.select(`body`).style(`cursor`,null),D.on(`mousemove.brush`,null).on(`mouseup.brush`,null).on(`touchmove.brush`,null).on(`touchend.brush`,null).on(`keydown.brush`,null).on(`keyup.brush`,null),C(),_({type:`brushend`})}}return f.x=function(e){return arguments.length?(n=e,d=Qa[!n<<1|!r],f):n},f.y=function(e){return arguments.length?(r=e,d=Qa[!n<<1|!r],f):r},f.clamp=function(e){return arguments.length?(n&&r?(l=!!e[0],u=!!e[1]):n?l=!!e:r&&(u=!!e),f):n&&r?[l,u]:n?l:r?u:null},f.extent=function(e){var t,o,l,u,d;return arguments.length?(n&&(t=e[0],o=e[1],r&&(t=t[0],o=o[0]),s=[t,o],n.invert&&(t=n(t),o=n(o)),o<t&&(d=t,t=o,o=d),(t!=i[0]||o!=i[1])&&(i=[t,o])),r&&(l=e[0],u=e[1],n&&(l=l[1],u=u[1]),c=[l,u],r.invert&&(l=r(l),u=r(u)),u<l&&(d=l,l=u,u=d),(l!=a[0]||u!=a[1])&&(a=[l,u])),f):(n&&(s?(t=s[0],o=s[1]):(t=i[0],o=i[1],n.invert&&(t=n.invert(t),o=n.invert(o)),o<t&&(d=t,t=o,o=d))),r&&(c?(l=c[0],u=c[1]):(l=a[0],u=a[1],r.invert&&(l=r.invert(l),u=r.invert(u)),u<l&&(d=l,l=u,u=d))),n&&r?[[t,l],[o,u]]:n?[t,o]:r&&[l,u])},f.clear=function(){return f.empty()||(i=[0,0],a=[0,0],s=c=null),f},f.empty=function(){return!!n&&i[0]==i[1]||!!r&&a[0]==a[1]},e.rebind(f,t,`on`)};var Za={n:`ns-resize`,e:`ew-resize`,s:`ns-resize`,w:`ew-resize`,nw:`nwse-resize`,ne:`nesw-resize`,se:`nwse-resize`,sw:`nesw-resize`},Qa=[[`n`,`e`,`s`,`w`,`nw`,`ne`,`se`,`sw`],[`e`,`w`],[`n`,`s`],[]];e.text=xt(function(e){return e.responseText}),e.json=function(e,t){return St(e,`application/json`,$a,t)};function $a(e){return JSON.parse(e.responseText)}e.html=function(e,t){return St(e,`text/html`,eo,t)};function eo(e){var t=i.createRange();return t.selectNode(i.body),t.createContextualFragment(e.responseText)}e.xml=xt(function(e){return e.responseXML}),typeof t==`object`&&t.exports?t.exports=e:this.d3=e}).apply(self)}),C=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):(n||=self,r(n.d3=n.d3||{}))})(e,function(e){var t=new Date,n=new Date;function r(e,i,a,o){function s(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return s.floor=function(t){return e(t=new Date(+t)),t},s.ceil=function(t){return e(t=new Date(t-1)),i(t,1),e(t),t},s.round=function(e){var t=s(e),n=s.ceil(e);return e-t<n-e?t:n},s.offset=function(e,t){return i(e=new Date(+e),t==null?1:Math.floor(t)),e},s.range=function(t,n,r){var a=[],o;if(t=s.ceil(t),r=r==null?1:Math.floor(r),!(t<n)||!(r>0))return a;do a.push(o=new Date(+t)),i(t,r),e(t);while(o<t&&t<n);return a},s.filter=function(t){return r(function(n){if(n>=n)for(;e(n),!t(n);)n.setTime(n-1)},function(e,n){if(e>=e)if(n<0)for(;++n<=0;)for(;i(e,-1),!t(e););else for(;--n>=0;)for(;i(e,1),!t(e););})},a&&(s.count=function(r,i){return t.setTime(+r),n.setTime(+i),e(t),e(n),Math.floor(a(t,n))},s.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?s.filter(o?function(t){return o(t)%e===0}:function(t){return s.count(0,t)%e===0}):s}),s}var i=r(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});i.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?r(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):i};var a=i.range,o=1e3,s=6e4,c=36e5,l=864e5,u=6048e5,d=r(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*o)},function(e,t){return(t-e)/o},function(e){return e.getUTCSeconds()}),f=d.range,p=r(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*o)},function(e,t){e.setTime(+e+t*s)},function(e,t){return(t-e)/s},function(e){return e.getMinutes()}),m=p.range,h=r(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*o-e.getMinutes()*s)},function(e,t){e.setTime(+e+t*c)},function(e,t){return(t-e)/c},function(e){return e.getHours()}),g=h.range,_=r(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*s)/l},function(e){return e.getDate()-1}),v=_.range;function y(e){return r(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t*7)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*s)/u})}var b=y(0),x=y(1),S=y(2),C=y(3),w=y(4),T=y(5),E=y(6),D=b.range,O=x.range,k=S.range,A=C.range,j=w.range,M=T.range,N=E.range,P=r(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()}),F=P.range,I=r(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});I.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:r(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})};var L=I.range,R=r(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*s)},function(e,t){return(t-e)/s},function(e){return e.getUTCMinutes()}),z=R.range,B=r(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*c)},function(e,t){return(t-e)/c},function(e){return e.getUTCHours()}),V=B.range,H=r(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/l},function(e){return e.getUTCDate()-1}),U=H.range;function W(e){return r(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t*7)},function(e,t){return(t-e)/u})}var G=W(0),K=W(1),q=W(2),J=W(3),Y=W(4),X=W(5),Z=W(6),Q=G.range,ee=K.range,te=q.range,ne=J.range,re=Y.range,ie=X.range,ae=Z.range,oe=r(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},function(e){return e.getUTCMonth()}),se=oe.range,ce=r(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});ce.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:r(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})};var le=ce.range;e.timeDay=_,e.timeDays=v,e.timeFriday=T,e.timeFridays=M,e.timeHour=h,e.timeHours=g,e.timeInterval=r,e.timeMillisecond=i,e.timeMilliseconds=a,e.timeMinute=p,e.timeMinutes=m,e.timeMonday=x,e.timeMondays=O,e.timeMonth=P,e.timeMonths=F,e.timeSaturday=E,e.timeSaturdays=N,e.timeSecond=d,e.timeSeconds=f,e.timeSunday=b,e.timeSundays=D,e.timeThursday=w,e.timeThursdays=j,e.timeTuesday=S,e.timeTuesdays=k,e.timeWednesday=C,e.timeWednesdays=A,e.timeWeek=b,e.timeWeeks=D,e.timeYear=I,e.timeYears=L,e.utcDay=H,e.utcDays=U,e.utcFriday=X,e.utcFridays=ie,e.utcHour=B,e.utcHours=V,e.utcMillisecond=i,e.utcMilliseconds=a,e.utcMinute=R,e.utcMinutes=z,e.utcMonday=K,e.utcMondays=ee,e.utcMonth=oe,e.utcMonths=se,e.utcSaturday=Z,e.utcSaturdays=ae,e.utcSecond=d,e.utcSeconds=f,e.utcSunday=G,e.utcSundays=Q,e.utcThursday=Y,e.utcThursdays=re,e.utcTuesday=q,e.utcTuesdays=te,e.utcWednesday=J,e.utcWednesdays=ne,e.utcWeek=G,e.utcWeeks=Q,e.utcYear=ce,e.utcYears=le,Object.defineProperty(e,`__esModule`,{value:!0})})}),w=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e,C()):(n||=self,r(n.d3=n.d3||{},n.d3))})(e,function(e,t){function n(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function r(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function i(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function a(e){var a=e.dateTime,s=e.date,c=e.time,l=e.periods,u=e.days,d=e.shortDays,ve=e.months,ye=e.shortMonths,be=f(l),xe=p(l),Se=f(u),Ce=p(u),we=f(d),Te=p(d),Ee=f(ve),De=p(ve),Oe=f(ye),ke=p(ye),Ae={a:We,A:Ge,b:Ke,B:qe,c:null,d:P,e:P,f:z,H:F,I,j:L,L:R,m:B,M:V,p:Je,q:Ye,Q:ge,s:_e,S:H,u:U,U:W,V:G,w:K,W:q,x:null,X:null,y:J,Y,Z:X,"%":he},je={a:Xe,A:Ze,b:Qe,B:$e,c:null,d:Z,e:Z,f:re,H:Q,I:ee,j:te,L:ne,m:ie,M:ae,p:et,q:tt,Q:ge,s:_e,S:oe,u:se,U:ce,V:le,w:ue,W:de,x:null,X:null,y:fe,Y:pe,Z:me,"%":he},Me={a:Le,A:Re,b:ze,B:Be,c:Ve,d:w,e:w,f:A,H:E,I:E,j:T,L:k,m:C,M:D,p:Ie,q:S,Q:M,s:N,S:O,u:h,U:g,V:_,w:m,W:v,x:He,X:Ue,y:b,Y:y,Z:x,"%":j};Ae.x=Ne(s,Ae),Ae.X=Ne(c,Ae),Ae.c=Ne(a,Ae),je.x=Ne(s,je),je.X=Ne(c,je),je.c=Ne(a,je);function Ne(e,t){return function(n){var r=[],i=-1,a=0,s=e.length,c,l,u;for(n instanceof Date||(n=new Date(+n));++i<s;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(l=o[c=e.charAt(++i)])==null?l=c===`e`?` `:`0`:c=e.charAt(++i),(u=t[c])&&(c=u(n,l)),r.push(c),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function Pe(e,a){return function(o){var s=i(1900,void 0,1),c=Fe(s,e,o+=``,0),l,u;if(c!=o.length)return null;if(`Q`in s)return new Date(s.Q);if(`s`in s)return new Date(s.s*1e3+(`L`in s?s.L:0));if(a&&!(`Z`in s)&&(s.Z=0),`p`in s&&(s.H=s.H%12+s.p*12),s.m===void 0&&(s.m=`q`in s?s.q:0),`V`in s){if(s.V<1||s.V>53)return null;`w`in s||(s.w=1),`Z`in s?(l=r(i(s.y,0,1)),u=l.getUTCDay(),l=u>4||u===0?t.utcMonday.ceil(l):t.utcMonday(l),l=t.utcDay.offset(l,(s.V-1)*7),s.y=l.getUTCFullYear(),s.m=l.getUTCMonth(),s.d=l.getUTCDate()+(s.w+6)%7):(l=n(i(s.y,0,1)),u=l.getDay(),l=u>4||u===0?t.timeMonday.ceil(l):t.timeMonday(l),l=t.timeDay.offset(l,(s.V-1)*7),s.y=l.getFullYear(),s.m=l.getMonth(),s.d=l.getDate()+(s.w+6)%7)}else (`W`in s||`U`in s)&&(`w`in s||(s.w=`u`in s?s.u%7:`W`in s?1:0),u=`Z`in s?r(i(s.y,0,1)).getUTCDay():n(i(s.y,0,1)).getDay(),s.m=0,s.d=`W`in s?(s.w+6)%7+s.W*7-(u+5)%7:s.w+s.U*7-(u+6)%7);return`Z`in s?(s.H+=s.Z/100|0,s.M+=s.Z%100,r(s)):n(s)}}function Fe(e,t,n,r){for(var i=0,a=t.length,s=n.length,c,l;i<a;){if(r>=s)return-1;if(c=t.charCodeAt(i++),c===37){if(c=t.charAt(i++),l=Me[c in o?t.charAt(i++):c],!l||(r=l(e,n,r))<0)return-1}else if(c!=n.charCodeAt(r++))return-1}return r}function Ie(e,t,n){var r=be.exec(t.slice(n));return r?(e.p=xe[r[0].toLowerCase()],n+r[0].length):-1}function Le(e,t,n){var r=we.exec(t.slice(n));return r?(e.w=Te[r[0].toLowerCase()],n+r[0].length):-1}function Re(e,t,n){var r=Se.exec(t.slice(n));return r?(e.w=Ce[r[0].toLowerCase()],n+r[0].length):-1}function ze(e,t,n){var r=Oe.exec(t.slice(n));return r?(e.m=ke[r[0].toLowerCase()],n+r[0].length):-1}function Be(e,t,n){var r=Ee.exec(t.slice(n));return r?(e.m=De[r[0].toLowerCase()],n+r[0].length):-1}function Ve(e,t,n){return Fe(e,a,t,n)}function He(e,t,n){return Fe(e,s,t,n)}function Ue(e,t,n){return Fe(e,c,t,n)}function We(e){return d[e.getDay()]}function Ge(e){return u[e.getDay()]}function Ke(e){return ye[e.getMonth()]}function qe(e){return ve[e.getMonth()]}function Je(e){return l[+(e.getHours()>=12)]}function Ye(e){return 1+~~(e.getMonth()/3)}function Xe(e){return d[e.getUTCDay()]}function Ze(e){return u[e.getUTCDay()]}function Qe(e){return ye[e.getUTCMonth()]}function $e(e){return ve[e.getUTCMonth()]}function et(e){return l[+(e.getUTCHours()>=12)]}function tt(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=Ne(e+=``,Ae);return t.toString=function(){return e},t},parse:function(e){var t=Pe(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=Ne(e+=``,je);return t.toString=function(){return e},t},utcParse:function(e){var t=Pe(e+=``,!0);return t.toString=function(){return e},t}}}var o={"-":``,_:` `,0:`0`},s=/^\s*\d+/,c=/^%/,l=/[\\^$*+?|[\]().{}]/g;function u(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function d(e){return e.replace(l,`\\$&`)}function f(e){return RegExp(`^(?:`+e.map(d).join(`|`)+`)`,`i`)}function p(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function m(e,t,n){var r=s.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function h(e,t,n){var r=s.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function g(e,t,n){var r=s.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function _(e,t,n){var r=s.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function v(e,t,n){var r=s.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function y(e,t,n){var r=s.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function b(e,t,n){var r=s.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function x(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function S(e,t,n){var r=s.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function C(e,t,n){var r=s.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function w(e,t,n){var r=s.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function T(e,t,n){var r=s.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function E(e,t,n){var r=s.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function D(e,t,n){var r=s.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function O(e,t,n){var r=s.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function k(e,t,n){var r=s.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function A(e,t,n){var r=s.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function j(e,t,n){var r=c.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function M(e,t,n){var r=s.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function N(e,t,n){var r=s.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function P(e,t){return u(e.getDate(),t,2)}function F(e,t){return u(e.getHours(),t,2)}function I(e,t){return u(e.getHours()%12||12,t,2)}function L(e,n){return u(1+t.timeDay.count(t.timeYear(e),e),n,3)}function R(e,t){return u(e.getMilliseconds(),t,3)}function z(e,t){return R(e,t)+`000`}function B(e,t){return u(e.getMonth()+1,t,2)}function V(e,t){return u(e.getMinutes(),t,2)}function H(e,t){return u(e.getSeconds(),t,2)}function U(e){var t=e.getDay();return t===0?7:t}function W(e,n){return u(t.timeSunday.count(t.timeYear(e)-1,e),n,2)}function G(e,n){var r=e.getDay();return e=r>=4||r===0?t.timeThursday(e):t.timeThursday.ceil(e),u(t.timeThursday.count(t.timeYear(e),e)+(t.timeYear(e).getDay()===4),n,2)}function K(e){return e.getDay()}function q(e,n){return u(t.timeMonday.count(t.timeYear(e)-1,e),n,2)}function J(e,t){return u(e.getFullYear()%100,t,2)}function Y(e,t){return u(e.getFullYear()%1e4,t,4)}function X(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+u(t/60|0,`0`,2)+u(t%60,`0`,2)}function Z(e,t){return u(e.getUTCDate(),t,2)}function Q(e,t){return u(e.getUTCHours(),t,2)}function ee(e,t){return u(e.getUTCHours()%12||12,t,2)}function te(e,n){return u(1+t.utcDay.count(t.utcYear(e),e),n,3)}function ne(e,t){return u(e.getUTCMilliseconds(),t,3)}function re(e,t){return ne(e,t)+`000`}function ie(e,t){return u(e.getUTCMonth()+1,t,2)}function ae(e,t){return u(e.getUTCMinutes(),t,2)}function oe(e,t){return u(e.getUTCSeconds(),t,2)}function se(e){var t=e.getUTCDay();return t===0?7:t}function ce(e,n){return u(t.utcSunday.count(t.utcYear(e)-1,e),n,2)}function le(e,n){var r=e.getUTCDay();return e=r>=4||r===0?t.utcThursday(e):t.utcThursday.ceil(e),u(t.utcThursday.count(t.utcYear(e),e)+(t.utcYear(e).getUTCDay()===4),n,2)}function ue(e){return e.getUTCDay()}function de(e,n){return u(t.utcMonday.count(t.utcYear(e)-1,e),n,2)}function fe(e,t){return u(e.getUTCFullYear()%100,t,2)}function pe(e,t){return u(e.getUTCFullYear()%1e4,t,4)}function me(){return`+0000`}function he(){return`%`}function ge(e){return+e}function _e(e){return Math.floor(e/1e3)}var ve;ye({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 ye(t){return ve=a(t),e.timeFormat=ve.format,e.timeParse=ve.parse,e.utcFormat=ve.utcFormat,e.utcParse=ve.utcParse,ve}var be=`%Y-%m-%dT%H:%M:%S.%LZ`;function xe(e){return e.toISOString()}var Se=Date.prototype.toISOString?xe:e.utcFormat(be);function Ce(e){var t=new Date(e);return isNaN(t)?null:t}var we=+new Date(`2000-01-01T00:00:00.000Z`)?Ce:e.utcParse(be);e.isoFormat=Se,e.isoParse=we,e.timeFormatDefaultLocale=ye,e.timeFormatLocale=a,Object.defineProperty(e,`__esModule`,{value:!0})})}),T=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):(n=typeof globalThis<`u`?globalThis:n||self,r(n.d3=n.d3||{}))})(e,function(e){function t(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function n(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function r(e){return e=n(Math.abs(e)),e?e[1]:NaN}function i(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function a(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var o=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function s(e){if(!(t=o.exec(e)))throw Error(`invalid format: `+e);var t;return new c({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}s.prototype=c.prototype;function c(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}c.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 l(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var u;function d(e,t){var r=n(e,t);if(!r)return e+``;var i=r[0],a=r[1],o=a-(u=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=i.length;return o===s?i:o>s?i+Array(o-s+1).join(`0`):o>0?i.slice(0,o)+`.`+i.slice(o):`0.`+Array(1-o).join(`0`)+n(e,Math.max(0,t+o-1))[0]}function f(e,t){var r=n(e,t);if(!r)return e+``;var i=r[0],a=r[1];return a<0?`0.`+Array(-a).join(`0`)+i:i.length>a+1?i.slice(0,a+1)+`.`+i.slice(a+1):i+Array(a-i.length+2).join(`0`)}var p={"%":function(e,t){return(e*100).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+``},d:t,e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return f(e*100,t)},r:f,s:d,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function m(e){return e}var h=Array.prototype.map,g=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function _(e){var t=e.grouping===void 0||e.thousands===void 0?m:i(h.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,o=e.currency===void 0?``:e.currency[1]+``,c=e.decimal===void 0?`.`:e.decimal+``,d=e.numerals===void 0?m:a(h.call(e.numerals,String)),f=e.percent===void 0?`%`:e.percent+``,_=e.minus===void 0?`-`:e.minus+``,v=e.nan===void 0?`NaN`:e.nan+``;function y(e){e=s(e);var r=e.fill,i=e.align,a=e.sign,m=e.symbol,h=e.zero,y=e.width,b=e.comma,x=e.precision,S=e.trim,C=e.type;C===`n`?(b=!0,C=`g`):p[C]||(x===void 0&&(x=12),S=!0,C=`g`),(h||r===`0`&&i===`=`)&&(h=!0,r=`0`,i=`=`);var w=m===`$`?n:m===`#`&&/[boxX]/.test(C)?`0`+C.toLowerCase():``,T=m===`$`?o:/[%p]/.test(C)?f:``,E=p[C],D=/[defgprs%]/.test(C);x=x===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function O(e){var n=w,o=T,s,f,p;if(C===`c`)o=E(e)+o,e=``;else{e=+e;var m=e<0||1/e<0;if(e=isNaN(e)?v:E(Math.abs(e),x),S&&(e=l(e)),m&&+e==0&&a!==`+`&&(m=!1),n=(m?a===`(`?a:_:a===`-`||a===`(`?``:a)+n,o=(C===`s`?g[8+u/3]:``)+o+(m&&a===`(`?`)`:``),D){for(s=-1,f=e.length;++s<f;)if(p=e.charCodeAt(s),48>p||p>57){o=(p===46?c+e.slice(s+1):e.slice(s))+o,e=e.slice(0,s);break}}}b&&!h&&(e=t(e,1/0));var O=n.length+e.length+o.length,k=O<y?Array(y-O+1).join(r):``;switch(b&&h&&(e=t(k+e,k.length?y-o.length:1/0),k=``),i){case`<`:e=n+e+o+k;break;case`=`:e=n+k+e+o;break;case`^`:e=k.slice(0,O=k.length>>1)+n+e+o+k.slice(O);break;default:e=k+n+e+o;break}return d(e)}return O.toString=function(){return e+``},O}function b(e,t){var n=y((e=s(e),e.type=`f`,e)),i=Math.max(-8,Math.min(8,Math.floor(r(t)/3)))*3,a=10**-i,o=g[8+i/3];return function(e){return n(a*e)+o}}return{format:y,formatPrefix:b}}var v;y({decimal:`.`,thousands:`,`,grouping:[3],currency:[`$`,``],minus:`-`});function y(t){return v=_(t),e.format=v.format,e.formatPrefix=v.formatPrefix,v}function b(e){return Math.max(0,-r(Math.abs(e)))}function x(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(r(t)/3)))*3-r(Math.abs(e)))}function S(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,r(t)-r(e))+1}e.FormatSpecifier=c,e.formatDefaultLocale=y,e.formatLocale=_,e.formatSpecifier=s,e.precisionFixed=b,e.precisionPrefix=x,e.precisionRound=S,Object.defineProperty(e,`__esModule`,{value:!0})})}),E=h((e,t)=>{t.exports=function(e){for(var t=e.length,n,r=0;r<t;r++)if(n=e.charCodeAt(r),(n<9||n>13)&&n!==32&&n!==133&&n!==160&&n!==5760&&n!==6158&&(n<8192||n>8205)&&n!==8232&&n!==8233&&n!==8239&&n!==8287&&n!==8288&&n!==12288&&n!==65279)return!1;return!0}}),D=h((e,t)=>{var n=E();t.exports=function(e){var t=typeof e;if(t===`string`){var r=e;if(e=+e,e===0&&n(r))return!1}else if(t!==`number`)return!1;return e-e<1}}),O=h((e,t)=>{t.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:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:``}}),k=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):(n=typeof globalThis<`u`?globalThis:n||self,r(n[`base64-arraybuffer`]={}))})(e,function(e){for(var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=typeof Uint8Array>`u`?[]:new Uint8Array(256),r=0;r<t.length;r++)n[t.charCodeAt(r)]=r;e.decode=function(e){var t=e.length*.75,r=e.length,i,a=0,o,s,c,l;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);var u=new ArrayBuffer(t),d=new Uint8Array(u);for(i=0;i<r;i+=4)o=n[e.charCodeAt(i)],s=n[e.charCodeAt(i+1)],c=n[e.charCodeAt(i+2)],l=n[e.charCodeAt(i+3)],d[a++]=o<<2|s>>4,d[a++]=(s&15)<<4|c>>2,d[a++]=(c&3)<<6|l&63;return u},e.encode=function(e){var n=new Uint8Array(e),r,i=n.length,a=``;for(r=0;r<i;r+=3)a+=t[n[r]>>2],a+=t[(n[r]&3)<<4|n[r+1]>>4],a+=t[(n[r+1]&15)<<2|n[r+2]>>6],a+=t[n[r+2]&63];return i%3==2?a=a.substring(0,a.length-1)+`=`:i%3==1&&(a=a.substring(0,a.length-2)+`==`),a},Object.defineProperty(e,`__esModule`,{value:!0})})}),A=h((e,t)=>{t.exports=function(e){return window&&window.process&&window.process.versions?Object.prototype.toString.call(e)===`[object Object]`:Object.prototype.toString.call(e)===`[object Object]`&&Object.getPrototypeOf(e).hasOwnProperty(`hasOwnProperty`)}}),j=h(e=>{var t=k().decode,n=A(),r=Array.isArray,i=ArrayBuffer,a=DataView;function o(e){return i.isView(e)&&!(e instanceof a)}e.isTypedArray=o;function s(e){return r(e)||o(e)}e.isArrayOrTypedArray=s;function c(e){return!s(e[0])}e.isArray1D=c,e.ensureArray=function(e,t){return r(e)||(e=[]),e.length=t,e};var l={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};l.uint8c=l.u1c,l.uint8=l.u1,l.int8=l.i1,l.uint16=l.u2,l.int16=l.i2,l.uint32=l.u4,l.int32=l.i4,l.float32=l.f4,l.float64=l.f8;function u(e){return e.constructor===ArrayBuffer}e.isArrayBuffer=u,e.decodeTypedArraySpec=function(e){var n=[],r=d(e),i=r.dtype,a=l[i];if(!a)throw Error(`Error in dtype: "`+i+`"`);var o=a.BYTES_PER_ELEMENT,s=r.bdata;u(s)||(s=t(s));var c=r.shape===void 0?[s.byteLength/o]:(``+r.shape).split(`,`);c.reverse();var f=c.length,p,m,h=+c[0],g=o*h,_=0;if(f===1)n=new a(s);else if(f===2)for(p=+c[1],m=0;m<p;m++)n[m]=new a(s,_,h),_+=g;else if(f===3){p=+c[1];for(var v=+c[2],y=0;y<v;y++)for(n[y]=[],m=0;m<p;m++)n[y][m]=new a(s,_,h),_+=g}else throw Error(`ndim: `+f+`is not supported with the shape:"`+r.shape+`"`);return n.bdata=r.bdata,n.dtype=r.dtype,n.shape=c.reverse().join(`,`),e._inputArray=n,n},e.isTypedArraySpec=function(e){return n(e)&&e.hasOwnProperty(`dtype`)&&typeof e.dtype==`string`&&e.hasOwnProperty(`bdata`)&&(typeof e.bdata==`string`||u(e.bdata))&&(e.shape===void 0||e.hasOwnProperty(`shape`)&&(typeof e.shape==`string`||typeof e.shape==`number`))};function d(e){return{bdata:e.bdata,dtype:e.dtype,shape:e.shape}}e.concat=function(){var e=[],t=!0,n=0,i,a,o,s,c,l,u,d;for(o=0;o<arguments.length;o++)s=arguments[o],l=s.length,l&&(a?e.push(s):(a=s,c=l),r(s)?i=!1:(t=!1,n?i!==s.constructor&&(i=!1):i=s.constructor),n+=l);if(!n)return[];if(!e.length)return a;if(t)return a.concat.apply(a,e);if(i){for(u=new i(n),u.set(a),o=0;o<e.length;o++)s=e[o],u.set(s,c),c+=s.length;return u}for(u=Array(n),d=0;d<a.length;d++)u[d]=a[d];for(o=0;o<e.length;o++){for(s=e[o],d=0;d<s.length;d++)u[c+d]=s[d];c+=d}return u},e.maxRowLength=function(e){return f(e,Math.max,0)},e.minRowLength=function(e){return f(e,Math.min,1/0)};function f(e,t,n){if(s(e))if(s(e[0])){for(var r=n,i=0;i<e.length;i++)r=t(r,e[i].length);return r}else return e.length;return 0}}),M=h((e,t)=>{var n=D(),r=j().isArrayOrTypedArray;t.exports=function(e,t){if(n(t))t=String(t);else if(typeof t!=`string`||t.slice(-4)===`[-1]`)throw`bad property string`;var r=t.split(`.`),a,o,c,l;for(l=0;l<r.length;l++)if(String(r[l]).slice(0,2)===`__`)throw`bad property string`;for(l=0;l<r.length;){if(a=String(r[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/),a){if(a[1])r[l]=a[1];else if(l===0)r.splice(0,1);else throw`bad property string`;for(o=a[2].slice(1,-1).split(`][`),c=0;c<o.length;c++)l++,r.splice(l,0,Number(o[c]))}l++}return typeof e==`object`?{set:s(e,r,t),get:i(e,r),astr:t,parts:r,obj:e}:d(e,t,r)};function i(e,t){return function(n){var a=e,o,s,c,l,u;for(l=0;l<t.length-1;l++){if(o=t[l],o===-1){for(s=!0,c=[],u=0;u<a.length;u++)c[u]=i(a[u],t.slice(l+1))(n),c[u]!==c[0]&&(s=!1);return s?c[0]:c}if(typeof o==`number`&&!r(a)||(a=a[o],typeof a!=`object`||!a))return}if(!(typeof a!=`object`||!a)&&(c=a[t[l]],!(!n&&c===null)))return c}}var a=/(^|\.)args\[/;function o(e,t){return e===void 0||e===null&&!t.match(a)}function s(e,t,n){return function(i){var a=e,s=``,d=[[e,s]],f=o(i,n),p,m;for(m=0;m<t.length-1;m++){if(p=t[m],typeof p==`number`&&!r(a))throw`array index but container is not an array`;if(p===-1){if(f=!l(a,t.slice(m+1),i,n),f)break;return}if(!u(a,p,t[m+1],f))break;if(a=a[p],typeof a!=`object`||!a)throw`container is not an object`;s=c(s,p),d.push([a,s])}if(f){if(m===t.length-1&&(delete a[t[m]],Array.isArray(a)&&+t[m]==a.length-1))for(;a.length&&a[a.length-1]===void 0;)a.pop()}else a[t[m]]=i}}function c(e,t){var r=t;return n(t)?r=`[`+t+`]`:e&&(r=`.`+t),e+r}function l(e,t,n,i){var a=r(n),c=!0,l=n,d=i.replace(`-1`,0),f=a?!1:o(n,d),p=t[0],m;for(m=0;m<e.length;m++)d=i.replace(`-1`,m),a&&(l=n[m%n.length],f=o(l,d)),f&&(c=!1),u(e,m,p,f)&&s(e[m],t,i.replace(`-1`,m))(l);return c}function u(e,t,n,r){if(e[t]===void 0){if(r)return!1;typeof n==`number`?e[t]=[]:e[t]={}}return!0}function d(e,t,n){return{set:function(){throw`bad container`},get:function(){},astr:t,parts:n,obj:e}}}),N=h((e,t)=>{var n=M(),r=/^\w*$/,i=0,a=1,o=2,s=3,c=4;t.exports=function(e,t,l,u){l||=`name`,u||=`value`;var d,f,p,m={};t&&t.length?(p=n(e,t),f=p.get()):f=e,t||=``;var h={};if(f)for(d=0;d<f.length;d++)h[f[d][l]]=d;var g=r.test(u),_={set:function(e,t){var r=t===null?c:i;if(!f){if(!p||r===c)return;f=[],p.set(f)}var a=h[e];if(a===void 0){if(r===c)return;r|=s,a=f.length,h[e]=a}else t!==(g?f[a][u]:n(f[a],u).get())&&(r|=o);var d=f[a]=f[a]||{};return d[l]=e,g?d[u]=t:n(d,u).set(t),t!==null&&(r&=~c),m[a]=m[a]|r,_},get:function(e){if(f){var t=h[e];if(t!==void 0)return g?f[t][u]:n(f[t],u).get()}},rename:function(e,t){var n=h[e];return n===void 0||(m[n]=m[n]|a,h[t]=n,delete h[e],f[n][l]=t),_},remove:function(e){var t=h[e];if(t===void 0)return _;var r=f[t];if(Object.keys(r).length>2)return m[t]=m[t]|o,_.set(e,null);if(g){for(d=t;d<f.length;d++)m[d]=m[d]|s;for(d=t;d<f.length;d++)h[f[d][l]]--;f.splice(t,1),delete h[e]}else n(r,u).set(null),m[t]=m[t]|o|c;return _},constructUpdate:function(){for(var e,r,i={},s=Object.keys(m),d=0;d<s.length;d++)r=s[d],e=t+`[`+r+`]`,f[r]?(m[r]&a&&(i[e+`.`+l]=f[r][l]),m[r]&o&&(g?i[e+`.`+u]=m[r]&c?null:f[r][u]:i[e+`.`+u]=m[r]&c?null:n(f[r],u).get())):i[e]=null;return i}};return _}}),P=h((e,t)=>{var n=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,r=/^[^\.\[\]]+$/;t.exports=function(e,t){for(;t;){var i=e.match(n);if(i)e=i[1];else if(e.match(r))e=``;else throw Error(`bad relativeAttr call:`+[e,t]);if(t.charAt(0)===`^`)t=t.slice(1);else break}return e&&t.charAt(0)!==`[`?e+`.`+t:e+t}}),F=h((e,t)=>{var n=D();t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}}),I=h((e,t)=>{var n=j().isArrayOrTypedArray,r=A();t.exports=function e(t,i){for(var a in i){var o=i[a],s=t[a];if(s!==o)if(a.charAt(0)===`_`||typeof o==`function`){if(a in t)continue;t[a]=o}else if(n(o)&&n(s)&&r(o[0])){if(a===`customdata`||a===`ids`)continue;for(var c=Math.min(o.length,s.length),l=0;l<c;l++)s[l]!==o[l]&&r(o[l])&&r(s[l])&&e(s[l],o[l])}else r(o)&&r(s)&&(e(s,o),Object.keys(s).length||delete t[a])}}}),L=h((e,t)=>{function n(e,t){var n=e%t;return n<0?n+t:n}function r(e,t){return Math.abs(e)>t/2?e-Math.round(e/t)*t:e}t.exports={mod:n,modHalf:r}}),R=h((e,t)=>{(function(e){var n=/^\s+/,r=/\s+$/,i=0,a=e.round,o=e.min,s=e.max,c=e.random;function l(e,t){if(e||=``,t||={},e instanceof l)return e;if(!(this instanceof l))return new l(e,t);var n=u(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=a(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=n.ok,this._tc_id=i++}l.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 e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,r,i,a,o,s;return n=t.r/255,r=t.g/255,i=t.b/255,a=n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4),o=r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4),s=i<=.03928?i/12.92:e.pow((i+.055)/1.055,2.4),.2126*a+.7152*o+.0722*s},setAlpha:function(e){return this._a=F(e),this._roundA=a(100*this._a)/100,this},toHsv:function(){var e=m(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=m(this._r,this._g,this._b),t=a(e.h*360),n=a(e.s*100),r=a(e.v*100);return this._a==1?`hsv(`+t+`, `+n+`%, `+r+`%)`:`hsva(`+t+`, `+n+`%, `+r+`%, `+this._roundA+`)`},toHsl:function(){var e=f(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=f(this._r,this._g,this._b),t=a(e.h*360),n=a(e.s*100),r=a(e.l*100);return this._a==1?`hsl(`+t+`, `+n+`%, `+r+`%)`:`hsla(`+t+`, `+n+`%, `+r+`%, `+this._roundA+`)`},toHex:function(e){return g(this._r,this._g,this._b,e)},toHexString:function(e){return`#`+this.toHex(e)},toHex8:function(e){return _(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return`#`+this.toHex8(e)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return this._a==1?`rgb(`+a(this._r)+`, `+a(this._g)+`, `+a(this._b)+`)`:`rgba(`+a(this._r)+`, `+a(this._g)+`, `+a(this._b)+`, `+this._roundA+`)`},toPercentageRgb:function(){return{r:a(I(this._r,255)*100)+`%`,g:a(I(this._g,255)*100)+`%`,b:a(I(this._b,255)*100)+`%`,a:this._a}},toPercentageRgbString:function(){return this._a==1?`rgb(`+a(I(this._r,255)*100)+`%, `+a(I(this._g,255)*100)+`%, `+a(I(this._b,255)*100)+`%)`:`rgba(`+a(I(this._r,255)*100)+`%, `+a(I(this._g,255)*100)+`%, `+a(I(this._b,255)*100)+`%, `+this._roundA+`)`},toName:function(){return this._a===0?`transparent`:this._a<1?!1:N[g(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t=`#`+v(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?`GradientType = 1, `:``;if(e){var i=l(e);n=`#`+v(i._r,i._g,i._b,i._a)}return`progid:DXImageTransform.Microsoft.gradient(`+r+`startColorstr=`+t+`,endColorstr=`+n+`)`},toString:function(e){var t=!!e;e||=this._format;var n=!1,r=this._a<1&&this._a>=0;return!t&&r&&(e===`hex`||e===`hex6`||e===`hex3`||e===`hex4`||e===`hex8`||e===`name`)?e===`name`&&this._a===0?this.toName():this.toRgbString():(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return l(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(C,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(y,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(x,arguments)},spin:function(){return this._applyModification(T,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(j,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(D,arguments)},tetrad:function(){return this._applyCombination(O,arguments)}},l.fromRatio=function(e,t){if(typeof e==`object`){var n={};for(var r in e)e.hasOwnProperty(r)&&(r===`a`?n[r]=e[r]:n[r]=H(e[r]));e=n}return l(e,t)};function u(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,a=null,c=!1,l=!1;return typeof e==`string`&&(e=q(e)),typeof e==`object`&&(K(e.r)&&K(e.g)&&K(e.b)?(t=d(e.r,e.g,e.b),c=!0,l=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):K(e.h)&&K(e.s)&&K(e.v)?(r=H(e.s),i=H(e.v),t=h(e.h,r,i),c=!0,l=`hsv`):K(e.h)&&K(e.s)&&K(e.l)&&(r=H(e.s),a=H(e.l),t=p(e.h,r,a),c=!0,l=`hsl`),e.hasOwnProperty(`a`)&&(n=e.a)),n=F(n),{ok:c,format:e.format||l,r:o(255,s(t.r,0)),g:o(255,s(t.g,0)),b:o(255,s(t.b,0)),a:n}}function d(e,t,n){return{r:I(e,255)*255,g:I(t,255)*255,b:I(n,255)*255}}function f(e,t,n){e=I(e,255),t=I(t,255),n=I(n,255);var r=s(e,t,n),i=o(e,t,n),a,c,l=(r+i)/2;if(r==i)a=c=0;else{var u=r-i;switch(c=l>.5?u/(2-r-i):u/(r+i),r){case e:a=(t-n)/u+(t<n?6:0);break;case t:a=(n-e)/u+2;break;case n:a=(e-t)/u+4;break}a/=6}return{h:a,s:c,l}}function p(e,t,n){var r,i,a;e=I(e,360),t=I(t,100),n=I(n,100);function o(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(t===0)r=i=a=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),i=o(c,s,e),a=o(c,s,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function m(e,t,n){e=I(e,255),t=I(t,255),n=I(n,255);var r=s(e,t,n),i=o(e,t,n),a,c,l=r,u=r-i;if(c=r===0?0:u/r,r==i)a=0;else{switch(r){case e:a=(t-n)/u+(t<n?6:0);break;case t:a=(n-e)/u+2;break;case n:a=(e-t)/u+4;break}a/=6}return{h:a,s:c,v:l}}function h(t,n,r){t=I(t,360)*6,n=I(n,100),r=I(r,100);var i=e.floor(t),a=t-i,o=r*(1-n),s=r*(1-a*n),c=r*(1-(1-a)*n),l=i%6,u=[r,s,o,o,c,r][l],d=[c,r,r,s,o,o][l],f=[o,o,c,r,r,s][l];return{r:u*255,g:d*255,b:f*255}}function g(e,t,n,r){var i=[V(a(e).toString(16)),V(a(t).toString(16)),V(a(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join(``)}function _(e,t,n,r,i){var o=[V(a(e).toString(16)),V(a(t).toString(16)),V(a(n).toString(16)),V(U(r))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join(``)}function v(e,t,n,r){return[V(U(r)),V(a(e).toString(16)),V(a(t).toString(16)),V(a(n).toString(16))].join(``)}l.equals=function(e,t){return!e||!t?!1:l(e).toRgbString()==l(t).toRgbString()},l.random=function(){return l.fromRatio({r:c(),g:c(),b:c()})};function y(e,t){t=t===0?0:t||10;var n=l(e).toHsl();return n.s-=t/100,n.s=L(n.s),l(n)}function b(e,t){t=t===0?0:t||10;var n=l(e).toHsl();return n.s+=t/100,n.s=L(n.s),l(n)}function x(e){return l(e).desaturate(100)}function S(e,t){t=t===0?0:t||10;var n=l(e).toHsl();return n.l+=t/100,n.l=L(n.l),l(n)}function C(e,t){t=t===0?0:t||10;var n=l(e).toRgb();return n.r=s(0,o(255,n.r-a(255*-(t/100)))),n.g=s(0,o(255,n.g-a(255*-(t/100)))),n.b=s(0,o(255,n.b-a(255*-(t/100)))),l(n)}function w(e,t){t=t===0?0:t||10;var n=l(e).toHsl();return n.l-=t/100,n.l=L(n.l),l(n)}function T(e,t){var n=l(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,l(n)}function E(e){var t=l(e).toHsl();return t.h=(t.h+180)%360,l(t)}function D(e){var t=l(e).toHsl(),n=t.h;return[l(e),l({h:(n+120)%360,s:t.s,l:t.l}),l({h:(n+240)%360,s:t.s,l:t.l})]}function O(e){var t=l(e).toHsl(),n=t.h;return[l(e),l({h:(n+90)%360,s:t.s,l:t.l}),l({h:(n+180)%360,s:t.s,l:t.l}),l({h:(n+270)%360,s:t.s,l:t.l})]}function k(e){var t=l(e).toHsl(),n=t.h;return[l(e),l({h:(n+72)%360,s:t.s,l:t.l}),l({h:(n+216)%360,s:t.s,l:t.l})]}function A(e,t,n){t||=6,n||=30;var r=l(e).toHsl(),i=360/n,a=[l(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(l(r));return a}function j(e,t){t||=6;for(var n=l(e).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(l({h:r,s:i,v:a})),a=(a+s)%1;return o}l.mix=function(e,t,n){n=n===0?0:n||50;var r=l(e).toRgb(),i=l(t).toRgb(),a=n/100;return l({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},l.readability=function(t,n){var r=l(t),i=l(n);return(e.max(r.getLuminance(),i.getLuminance())+.05)/(e.min(r.getLuminance(),i.getLuminance())+.05)},l.isReadable=function(e,t,n){var r=l.readability(e,t),i,a;switch(a=!1,i=J(n),i.level+i.size){case`AAsmall`:case`AAAlarge`:a=r>=4.5;break;case`AAlarge`:a=r>=3;break;case`AAAsmall`:a=r>=7;break}return a},l.mostReadable=function(e,t,n){var r=null,i=0,a,o,s,c;n||={},o=n.includeFallbackColors,s=n.level,c=n.size;for(var u=0;u<t.length;u++)a=l.readability(e,t[u]),a>i&&(i=a,r=l(t[u]));return l.isReadable(e,r,{level:s,size:c})||!o?r:(n.includeFallbackColors=!1,l.mostReadable(e,[`#fff`,`#000`],n))};var M=l.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`},N=l.hexNames=P(M);function P(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function F(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function I(t,n){z(t)&&(t=`100%`);var r=B(t);return t=o(n,s(0,parseFloat(t))),r&&(t=parseInt(t*n,10)/100),e.abs(t-n)<1e-6?1:t%n/parseFloat(n)}function L(e){return o(1,s(0,e))}function R(e){return parseInt(e,16)}function z(e){return typeof e==`string`&&e.indexOf(`.`)!=-1&&parseFloat(e)===1}function B(e){return typeof e==`string`&&e.indexOf(`%`)!=-1}function V(e){return e.length==1?`0`+e:``+e}function H(e){return e<=1&&(e=e*100+`%`),e}function U(t){return e.round(parseFloat(t)*255).toString(16)}function W(e){return R(e)/255}var G=function(){var e=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,t=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`,n=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`;return{CSS_UNIT:new RegExp(e),rgb:RegExp(`rgb`+t),rgba:RegExp(`rgba`+n),hsl:RegExp(`hsl`+t),hsla:RegExp(`hsla`+n),hsv:RegExp(`hsv`+t),hsva:RegExp(`hsva`+n),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 K(e){return!!G.CSS_UNIT.exec(e)}function q(e){e=e.replace(n,``).replace(r,``).toLowerCase();var t=!1;if(M[e])e=M[e],t=!0;else if(e==`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};var i;return(i=G.rgb.exec(e))?{r:i[1],g:i[2],b:i[3]}:(i=G.rgba.exec(e))?{r:i[1],g:i[2],b:i[3],a:i[4]}:(i=G.hsl.exec(e))?{h:i[1],s:i[2],l:i[3]}:(i=G.hsla.exec(e))?{h:i[1],s:i[2],l:i[3],a:i[4]}:(i=G.hsv.exec(e))?{h:i[1],s:i[2],v:i[3]}:(i=G.hsva.exec(e))?{h:i[1],s:i[2],v:i[3],a:i[4]}:(i=G.hex8.exec(e))?{r:R(i[1]),g:R(i[2]),b:R(i[3]),a:W(i[4]),format:t?`name`:`hex8`}:(i=G.hex6.exec(e))?{r:R(i[1]),g:R(i[2]),b:R(i[3]),format:t?`name`:`hex`}:(i=G.hex4.exec(e))?{r:R(i[1]+``+i[1]),g:R(i[2]+``+i[2]),b:R(i[3]+``+i[3]),a:W(i[4]+``+i[4]),format:t?`name`:`hex8`}:(i=G.hex3.exec(e))?{r:R(i[1]+``+i[1]),g:R(i[2]+``+i[2]),b:R(i[3]+``+i[3]),format:t?`name`:`hex`}:!1}function J(e){var t,n;return e||={level:`AA`,size:`small`},t=(e.level||`AA`).toUpperCase(),n=(e.size||`small`).toLowerCase(),t!==`AA`&&t!==`AAA`&&(t=`AA`),n!==`small`&&n!==`large`&&(n=`small`),{level:t,size:n}}t!==void 0&&t.exports?t.exports=l:window.tinycolor=l})(Math)}),z=h(e=>{var t=A(),n=Array.isArray;function r(e,t){var n,r;for(n=0;n<e.length;n++){if(r=e[n],typeof r==`object`&&r)return!1;r!==void 0&&(t[n]=r)}return!0}e.extendFlat=function(){return i(arguments,!1,!1,!1)},e.extendDeep=function(){return i(arguments,!0,!1,!1)},e.extendDeepAll=function(){return i(arguments,!0,!0,!1)},e.extendDeepNoArrays=function(){return i(arguments,!0,!1,!0)};function i(e,a,o,s){var c=e[0],l=e.length,u,d,f,p,m,h,g;if(l===2&&n(c)&&n(e[1])&&c.length===0){if(g=r(e[1],c),g)return c;c.splice(0,c.length)}for(var _=1;_<l;_++)for(d in u=e[_],u)f=c[d],p=u[d],s&&n(p)?c[d]=p:a&&p&&(t(p)||(m=n(p)))?(m?(m=!1,h=f&&n(f)?f:[]):h=f&&t(f)?f:{},c[d]=i([h,p],a,o,s)):(p!==void 0||o)&&(c[d]=p);return c}}),B=h((e,t)=>{t.exports=function(e){var t=e.variantValues,n=e.editType,r=e.colorEditType;r===void 0&&(r=n);var i={editType:n,valType:`integer`,min:1,max:1e3,extras:[`normal`,`bold`],dflt:`normal`};e.noNumericWeightValues&&(i.valType=`enumerated`,i.values=i.extras,i.extras=void 0,i.min=void 0,i.max=void 0);var a={family:{valType:`string`,noBlank:!0,strict:!0,editType:n},size:{valType:`number`,min:1,editType:n},color:{valType:`color`,editType:r},weight:i,style:{editType:n,valType:`enumerated`,values:[`normal`,`italic`],dflt:`normal`},variant:e.noFontVariant?void 0:{editType:n,valType:`enumerated`,values:t||[`normal`,`small-caps`,`all-small-caps`,`all-petite-caps`,`petite-caps`,`unicase`],dflt:`normal`},textcase:e.noFontTextcase?void 0:{editType:n,valType:`enumerated`,values:[`normal`,`word caps`,`upper`,`lower`],dflt:`normal`},lineposition:e.noFontLineposition?void 0:{editType:n,valType:`flaglist`,flags:[`under`,`over`,`through`],extras:[`none`],dflt:`none`},shadow:e.noFontShadow?void 0:{editType:n,valType:`string`,dflt:e.autoShadowDflt?`auto`:`none`},editType:n};return e.autoSize&&(a.size.dflt=`auto`),e.autoColor&&(a.color.dflt=`auto`),e.arrayOk&&(a.family.arrayOk=!0,a.weight.arrayOk=!0,a.style.arrayOk=!0,e.noFontVariant||(a.variant.arrayOk=!0),e.noFontTextcase||(a.textcase.arrayOk=!0),e.noFontLineposition||(a.lineposition.arrayOk=!0),e.noFontShadow||(a.shadow.arrayOk=!0),a.size.arrayOk=!0,a.color.arrayOk=!0),a}}),V=h((e,t)=>{t.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:`Arial, sans-serif`,HOVERMINTIME:50,HOVERID:`-hover`}}),H=h((e,t)=>{var n=V(),r=B(),i=r({editType:`none`});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,t.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`},hoveranywhere:{valType:`boolean`,dflt:!1,editType:`none`},clickanywhere:{valType:`boolean`,dflt:!1,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:i,grouptitlefont:r({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`}}}),U=h((e,t)=>{var n=B(),r=H().hoverlabel,i=z().extendFlat;t.exports={hoverlabel:{bgcolor:i({},r.bgcolor,{arrayOk:!0}),bordercolor:i({},r.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:`none`}),align:i({},r.align,{arrayOk:!0}),namelength:i({},r.namelength,{arrayOk:!0}),showarrow:i({},r.showarrow),editType:`none`}}}),W=h((e,t)=>{var n=B(),r=U();t.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:n({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:r.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`}}}),G=h((e,t)=>{var n=R(),r={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)`]]},i=r.RdBu;function a(e,t){if(t||=i,!e)return t;function n(){try{e=r[e]||JSON.parse(e)}catch{e=t}}return typeof e==`string`&&(n(),typeof e==`string`&&n()),o(e)?e:t}function o(e){var t=0;if(!Array.isArray(e)||e.length<2||!e[0]||!e[e.length-1]||+e[0][0]!=0||+e[e.length-1][0]!=1)return!1;for(var r=0;r<e.length;r++){var i=e[r];if(i.length!==2||+i[0]<t||!n(i[1]).isValid())return!1;t=+i[0]}return!0}function s(e){return r[e]===void 0?o(e):!0}t.exports={scales:r,defaultScale:i,get:a,isValid:s}}),K=h(e=>{e.defaults=[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],e.defaultLine=`#444`,e.lightLine=`#eee`,e.background=`#fff`,e.borderLine=`#BEC8D9`,e.lightFraction=1e3/11}),q=h((e,t)=>{var n=R(),r=D(),i=j().isTypedArray,a=t.exports={},o=K();a.defaults=o.defaults;var s=a.defaultLine=o.defaultLine;a.lightLine=o.lightLine;var c=a.background=o.background;a.tinyRGB=function(e){var t=e.toRgb();return`rgb(`+Math.round(t.r)+`, `+Math.round(t.g)+`, `+Math.round(t.b)+`)`},a.rgb=function(e){return a.tinyRGB(n(e))},a.opacity=function(e){return e?n(e).getAlpha():0},a.addOpacity=function(e,t){var r=n(e).toRgb();return`rgba(`+Math.round(r.r)+`, `+Math.round(r.g)+`, `+Math.round(r.b)+`, `+t+`)`},a.combine=function(e,t){var r=n(e).toRgb();if(r.a===1)return n(e).toRgbString();var i=n(t||c).toRgb(),a=i.a===1?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a};return n({r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a}).toRgbString()},a.interpolate=function(e,t,r){var i=n(e).toRgb(),a=n(t).toRgb();return n({r:r*i.r+(1-r)*a.r,g:r*i.g+(1-r)*a.g,b:r*i.b+(1-r)*a.b}).toRgbString()},a.contrast=function(e,t,r){var i=n(e);return i.getAlpha()!==1&&(i=n(a.combine(e,c))),(i.isDark()?t?i.lighten(t):c:r?i.darken(r):s).toString()},a.stroke=function(e,t){var r=n(t);e.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(e,t){var r=n(t);e.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(e){if(!(!e||typeof e!=`object`)){var t=Object.keys(e),n,r,o,s;for(n=0;n<t.length;n++)if(o=t[n],s=e[o],o.slice(-5)===`color`)if(Array.isArray(s))for(r=0;r<s.length;r++)s[r]=l(s[r]);else e[o]=l(s);else if(o.slice(-10)===`colorscale`&&Array.isArray(s))for(r=0;r<s.length;r++)Array.isArray(s[r])&&(s[r][1]=l(s[r][1]));else if(Array.isArray(s)){var c=s[0];if(!Array.isArray(c)&&c&&typeof c==`object`)for(r=0;r<s.length;r++)a.clean(s[r])}else s&&typeof s==`object`&&!i(s)&&a.clean(s)}};function l(e){if(r(e)||typeof e!=`string`)return e;var t=e.trim();if(t.slice(0,3)!==`rgb`)return e;var n=t.match(/^rgba?\s*\(([^()]*)\)$/);if(!n)return e;var i=n[1].trim().split(/\s*[\s,]\s*/),a=t.charAt(3)===`a`&&i.length===4;if(!a&&i.length!==3)return e;for(var o=0;o<i.length;o++){if(!i[o].length||(i[o]=Number(i[o]),!(i[o]>=0)))return e;if(o===3)i[o]>1&&(i[o]=1);else if(i[o]>=1)return e}var s=Math.round(i[0]*255)+`, `+Math.round(i[1]*255)+`, `+Math.round(i[2]*255);return a?`rgba(`+s+`, `+i[3]+`)`:`rgb(`+s+`)`}}),J=h((e,t)=>{t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}),Y=h(e=>{e.counter=function(e,t,n,r){var i=(t||``)+(n?``:`$`),a=r===!1?``:`^`;return RegExp(e===`xy`?a+`x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?`+i:a+e+`([2-9]|[1-9][0-9]+)?`+i)}}),X=h(e=>{var t=D(),n=R(),r=z().extendFlat,i=W(),a=G(),o=q(),s=J().DESELECTDIM,c=M(),l=Y().counter,u=L().modHalf,d=j().isArrayOrTypedArray,f=j().isTypedArraySpec,p=j().decodeTypedArraySpec;e.valObjectMeta={data_array:{coerceFunction:function(e,t,n){t.set(d(e)?e:f(e)?p(e):n)}},enumerated:{coerceFunction:function(e,t,n,r){r.coerceNumber&&(e=+e),r.values.indexOf(e)===-1?t.set(n):t.set(e)},validateFunction:function(e,t){t.coerceNumber&&(e=+e);for(var n=t.values,r=0;r<n.length;r++){var i=String(n[r]);if(i.charAt(0)===`/`&&i.charAt(i.length-1)===`/`){if(new RegExp(i.slice(1,-1)).test(e))return!0}else if(e===n[r])return!0}return!1}},boolean:{coerceFunction:function(e,t,n,r){let i=e=>e===!0||e===!1;i(e)||r.arrayOk&&Array.isArray(e)&&e.length>0&&e.every(i)?t.set(e):t.set(n)}},number:{coerceFunction:function(e,n,r,i){f(e)&&(e=p(e)),!t(e)||i.min!==void 0&&e<i.min||i.max!==void 0&&e>i.max?n.set(r):n.set(+e)}},integer:{coerceFunction:function(e,n,r,i){if((i.extras||[]).indexOf(e)!==-1){n.set(e);return}f(e)&&(e=p(e)),e%1||!t(e)||i.min!==void 0&&e<i.min||i.max!==void 0&&e>i.max?n.set(r):n.set(+e)}},string:{coerceFunction:function(e,t,n,r){if(typeof e!=`string`){var i=typeof e==`number`;r.strict===!0||!i?t.set(n):t.set(String(e))}else r.noBlank&&!e?t.set(n):t.set(e)}},color:{coerceFunction:function(e,t,r){f(e)&&(e=p(e)),n(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){function i(e){return n(e).isValid()}!Array.isArray(e)||!e.length?t.set(r):e.every(i)?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,n){t.set(a.get(e,n))}},angle:{coerceFunction:function(e,n,r){f(e)&&(e=p(e)),e===`auto`?n.set(`auto`):t(e)?n.set(u(+e,360)):n.set(r)}},subplotid:{coerceFunction:function(e,t,n,r){var i=r.regex||l(n);let a=e=>typeof e==`string`&&i.test(e);a(e)||r.arrayOk&&d(e)&&e.length>0&&e.every(a)?t.set(e):t.set(n)},validateFunction:function(e,t){var n=t.dflt;return e===n?!0:typeof e==`string`?!!l(n).test(e):!1}},flaglist:{coerceFunction:function(e,t,n,r){if((r.extras||[]).indexOf(e)!==-1){t.set(e);return}if(typeof e!=`string`){t.set(n);return}for(var i=e.split(`+`),a=0;a<i.length;){var o=i[a];r.flags.indexOf(o)===-1||i.indexOf(o)<a?i.splice(a,1):a++}i.length?t.set(i.join(`+`)):t.set(n)}},any:{coerceFunction:function(e,t,n){e===void 0?t.set(n):t.set(f(e)?p(e):e)}},info_array:{coerceFunction:function(t,n,r,i){function a(t,n,r){var i;return r===void 0&&(r=n.dflt),e.valObjectMeta[n.valType].coerceFunction(t,{set:function(e){i=e}},r,n),i}if(f(t)&&(t=p(t)),!d(t)){n.set(r);return}var o=i.dimensions===2||i.dimensions===`1-2`&&Array.isArray(t)&&d(t[0]),s=i.items,c=[],l=Array.isArray(s),u=l&&o&&d(s[0]),m=o&&l&&!u,h=l&&!m?s.length:t.length,g,_,v,y,b,x;if(r=Array.isArray(r)?r:[],o)for(g=0;g<h;g++)for(c[g]=[],v=d(t[g])?t[g]:[],b=m?s.length:l?s[g].length:v.length,_=0;_<b;_++)y=m?s[_]:l?s[g][_]:s,x=a(v[_],y,(r[g]||[])[_]),x!==void 0&&(c[g][_]=x);else for(g=0;g<h;g++)x=a(t[g],l?s[g]:s,r[g]),x!==void 0&&(c[g]=x);n.set(c)},validateFunction:function(e,t){if(!d(e))return!1;var n=t.items,r=Array.isArray(n),i=t.dimensions===2;if(!t.freeLength&&e.length!==n.length)return!1;for(var a=0;a<e.length;a++)if(i){if(!d(e[a])||!t.freeLength&&e[a].length!==n[a].length)return!1;for(var o=0;o<e[a].length;o++)if(!m(e[a][o],r?n[a][o]:n))return!1}else if(!m(e[a],r?n[a]:n))return!1;return!0}}},e.coerce=function(t,n,r,i,a){var o=c(r,i).get(),s=c(t,i),l=c(n,i),u=s.get(),h=n._template;if(u===void 0&&h&&(u=c(h,i).get(),h=0),a===void 0&&(a=o.dflt),o.arrayOk){if(d(u))return l.set(u),u;if(f(u))return u=p(u),l.set(u),u}var g=e.valObjectMeta[o.valType].coerceFunction;g(u,l,a,o);var _=l.get();return h&&_===a&&!m(u,o)&&(u=c(h,i).get(),g(u,l,a,o),_=l.get()),_},e.coerce2=function(t,n,r,i,a){var o=c(t,i),s=e.coerce(t,n,r,i,a);return o.get()==null?!1:s},e.coerceFont=function(e,t,n,i){i||={},n=r({},n),n=r(n,i.overrideDflt||{});var a={family:e(t+`.family`,n.family),size:e(t+`.size`,n.size),color:e(t+`.color`,n.color),weight:e(t+`.weight`,n.weight),style:e(t+`.style`,n.style)};if(i.noFontVariant||(a.variant=e(t+`.variant`,n.variant)),i.noFontLineposition||(a.lineposition=e(t+`.lineposition`,n.lineposition)),i.noFontTextcase||(a.textcase=e(t+`.textcase`,n.textcase)),!i.noFontShadow){var o=n.shadow;o===`none`&&i.autoShadowDflt&&(o=`auto`),a.shadow=e(t+`.shadow`,o)}return a},e.coercePattern=function(e,t,n,r){var i=e(t+`.shape`),a;if(i||(a=e(t+`.path`)),i||a){i&&e(t+`.solidity`),e(t+`.size`);var s=e(t+`.fillmode`)===`overlay`;if(!r){var c=e(t+`.bgcolor`,s?n:void 0);e(t+`.fgcolor`,s?o.contrast(c):n)}e(t+`.fgopacity`,s?.5:1)}},e.coerceHoverinfo=function(t,n,r){var a=n._module.attributes,o=a.hoverinfo?a:i,s=o.hoverinfo,c;if(r._dataLength===1){var l=s.dflt===`all`?s.flags.slice():s.dflt.split(`+`);l.splice(l.indexOf(`name`),1),c=l.join(`+`)}return e.coerce(t,n,o,`hoverinfo`,c)},e.coerceSelectionMarkerOpacity=function(e,t){if(e.marker){var n=e.marker.opacity;if(n!==void 0){var r,i;!d(n)&&!e.selected&&!e.unselected&&(r=n,i=s*n),t(`selected.marker.opacity`,r),t(`unselected.marker.opacity`,i)}}};function m(t,n){var r=e.valObjectMeta[n.valType];if(n.arrayOk&&d(t))return!0;if(r.validateFunction)return r.validateFunction(t,n);var i={},a=i;return r.coerceFunction(t,{set:function(e){a=e}},i,n),a!==i}e.validate=m}),Z=h((e,t)=>{var n={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},displayNotifier:{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:{}}},r={};function i(e,t){for(var n in e){var r=e[n];r.valType?t[n]=r.dflt:(t[n]||(t[n]={}),i(r,t[n]))}}i(n,r),t.exports={configAttributes:n,dfltConfig:r}}),Q=h((e,t)=>{var n=S(),r=D(),i=[];t.exports=function(e,t,a){if(a?._context?.displayNotifier===!1||i.indexOf(e)!==-1)return;i.push(e);var o=1e3;r(t)?o=t:t===`long`&&(o=3e3);var s=n.select(`body`).selectAll(`.plotly-notifier`).data([0]);s.enter().append(`div`).classed(`plotly-notifier`,!0);var c=s.selectAll(`.notifier-note`).data(i);function l(e){e.duration(700).style(`opacity`,0).each(`end`,function(e){var t=i.indexOf(e);t!==-1&&i.splice(t,1),n.select(this).remove()})}c.enter().append(`div`).classed(`notifier-note`,!0).style(`opacity`,0).each(function(e){var r=n.select(this);r.append(`button`).classed(`notifier-close`,!0).html(`&times;`).on(`click`,function(){r.transition().call(l)});for(var i=r.append(`p`),a=e.split(/<br\s*\/?>/g),s=0;s<a.length;s++)s&&i.append(`br`),i.append(`span`).text(a[s]);t===`stick`?r.transition().duration(350).style(`opacity`,1):r.transition().duration(700).style(`opacity`,1).transition().delay(o).call(l)})}}),ee=h((e,t)=>{var n=Z().dfltConfig,r=Q(),i=t.exports={};i.log=function(){var e;if(n.logging>1){var t=[`LOG:`];for(e=0;e<arguments.length;e++)t.push(arguments[e]);console.trace.apply(console,t)}if(n.notifyOnLogging>1){var i=[];for(e=0;e<arguments.length;e++)i.push(arguments[e]);r(i.join(`<br>`),`long`)}},i.warn=function(){var e;if(n.logging>0){var t=[`WARN:`];for(e=0;e<arguments.length;e++)t.push(arguments[e]);console.trace.apply(console,t)}if(n.notifyOnLogging>0){var i=[];for(e=0;e<arguments.length;e++)i.push(arguments[e]);r(i.join(`<br>`),`stick`)}},i.error=function(){var e;if(n.logging>0){var t=[`ERROR:`];for(e=0;e<arguments.length;e++)t.push(arguments[e]);console.error.apply(console,t)}if(n.notifyOnLogging>0){var i=[];for(e=0;e<arguments.length;e++)i.push(arguments[e]);r(i.join(`<br>`),`stick`)}}}),te=h((e,t)=>{t.exports=function(){}}),ne=h((e,t)=>{t.exports=function(e,t){if(t instanceof RegExp){for(var n=t.toString(),r=0;r<e.length;r++)if(e[r]instanceof RegExp&&e[r].toString()===n)return e;e.push(t)}else (t||t===0)&&e.indexOf(t)===-1&&e.push(t);return e}}),re=h((e,t)=>{t.exports=n;function n(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}),ie=h((e,t)=>{t.exports=n;function n(e){var t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}}),ae=h((e,t)=>{t.exports=n;function n(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}}),oe=h((e,t)=>{t.exports=n;function n(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}),se=h((e,t)=>{t.exports=n;function n(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}}),ce=h((e,t)=>{t.exports=n;function n(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14],_=t[15],v=n*s-r*o,y=n*c-i*o,b=n*l-a*o,x=r*c-i*s,S=r*l-a*s,C=i*l-a*c,w=u*h-d*m,T=u*g-f*m,E=u*_-p*m,D=d*g-f*h,O=d*_-p*h,k=f*_-p*g,A=v*k-y*O+b*D+x*E-S*T+C*w;return A?(A=1/A,e[0]=(s*k-c*O+l*D)*A,e[1]=(i*O-r*k-a*D)*A,e[2]=(h*C-g*S+_*x)*A,e[3]=(f*S-d*C-p*x)*A,e[4]=(c*E-o*k-l*T)*A,e[5]=(n*k-i*E+a*T)*A,e[6]=(g*b-m*C-_*y)*A,e[7]=(u*C-f*b+p*y)*A,e[8]=(o*O-s*E+l*w)*A,e[9]=(r*E-n*O-a*w)*A,e[10]=(m*S-h*b+_*v)*A,e[11]=(d*b-u*S-p*v)*A,e[12]=(s*T-o*D-c*w)*A,e[13]=(n*D-r*T+i*w)*A,e[14]=(h*y-m*x-g*v)*A,e[15]=(u*x-d*y+f*v)*A,e):null}}),le=h((e,t)=>{t.exports=n;function n(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14],_=t[15];return e[0]=s*(f*_-p*g)-d*(c*_-l*g)+h*(c*p-l*f),e[1]=-(r*(f*_-p*g)-d*(i*_-a*g)+h*(i*p-a*f)),e[2]=r*(c*_-l*g)-s*(i*_-a*g)+h*(i*l-a*c),e[3]=-(r*(c*p-l*f)-s*(i*p-a*f)+d*(i*l-a*c)),e[4]=-(o*(f*_-p*g)-u*(c*_-l*g)+m*(c*p-l*f)),e[5]=n*(f*_-p*g)-u*(i*_-a*g)+m*(i*p-a*f),e[6]=-(n*(c*_-l*g)-o*(i*_-a*g)+m*(i*l-a*c)),e[7]=n*(c*p-l*f)-o*(i*p-a*f)+u*(i*l-a*c),e[8]=o*(d*_-p*h)-u*(s*_-l*h)+m*(s*p-l*d),e[9]=-(n*(d*_-p*h)-u*(r*_-a*h)+m*(r*p-a*d)),e[10]=n*(s*_-l*h)-o*(r*_-a*h)+m*(r*l-a*s),e[11]=-(n*(s*p-l*d)-o*(r*p-a*d)+u*(r*l-a*s)),e[12]=-(o*(d*g-f*h)-u*(s*g-c*h)+m*(s*f-c*d)),e[13]=n*(d*g-f*h)-u*(r*g-i*h)+m*(r*f-i*d),e[14]=-(n*(s*g-c*h)-o*(r*g-i*h)+m*(r*c-i*s)),e[15]=n*(s*f-c*d)-o*(r*f-i*d)+u*(r*c-i*s),e}}),ue=h((e,t)=>{t.exports=n;function n(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=t*o-n*a,v=t*s-r*a,y=t*c-i*a,b=n*s-r*o,x=n*c-i*o,S=r*c-i*s,C=l*m-u*p,w=l*h-d*p,T=l*g-f*p,E=u*h-d*m,D=u*g-f*m;return _*(d*g-f*h)-v*D+y*E+b*T-x*w+S*C}}),de=h((e,t)=>{t.exports=n;function n(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=n[0],b=n[1],x=n[2],S=n[3];return e[0]=y*r+b*s+x*d+S*h,e[1]=y*i+b*c+x*f+S*g,e[2]=y*a+b*l+x*p+S*_,e[3]=y*o+b*u+x*m+S*v,y=n[4],b=n[5],x=n[6],S=n[7],e[4]=y*r+b*s+x*d+S*h,e[5]=y*i+b*c+x*f+S*g,e[6]=y*a+b*l+x*p+S*_,e[7]=y*o+b*u+x*m+S*v,y=n[8],b=n[9],x=n[10],S=n[11],e[8]=y*r+b*s+x*d+S*h,e[9]=y*i+b*c+x*f+S*g,e[10]=y*a+b*l+x*p+S*_,e[11]=y*o+b*u+x*m+S*v,y=n[12],b=n[13],x=n[14],S=n[15],e[12]=y*r+b*s+x*d+S*h,e[13]=y*i+b*c+x*f+S*g,e[14]=y*a+b*l+x*p+S*_,e[15]=y*o+b*u+x*m+S*v,e}}),fe=h((e,t)=>{t.exports=n;function n(e,t,n){var r=n[0],i=n[1],a=n[2],o,s,c,l,u,d,f,p,m,h,g,_;return t===e?(e[12]=t[0]*r+t[4]*i+t[8]*a+t[12],e[13]=t[1]*r+t[5]*i+t[9]*a+t[13],e[14]=t[2]*r+t[6]*i+t[10]*a+t[14],e[15]=t[3]*r+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],c=t[2],l=t[3],u=t[4],d=t[5],f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],e[0]=o,e[1]=s,e[2]=c,e[3]=l,e[4]=u,e[5]=d,e[6]=f,e[7]=p,e[8]=m,e[9]=h,e[10]=g,e[11]=_,e[12]=o*r+u*i+m*a+t[12],e[13]=s*r+d*i+h*a+t[13],e[14]=c*r+f*i+g*a+t[14],e[15]=l*r+p*i+_*a+t[15]),e}}),pe=h((e,t)=>{t.exports=n;function n(e,t,n){var r=n[0],i=n[1],a=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}}),me=h((e,t)=>{t.exports=n;function n(e,t,n,r){var i=r[0],a=r[1],o=r[2],s=Math.sqrt(i*i+a*a+o*o),c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j;return Math.abs(s)<1e-6?null:(s=1/s,i*=s,a*=s,o*=s,c=Math.sin(n),l=Math.cos(n),u=1-l,d=t[0],f=t[1],p=t[2],m=t[3],h=t[4],g=t[5],_=t[6],v=t[7],y=t[8],b=t[9],x=t[10],S=t[11],C=i*i*u+l,w=a*i*u+o*c,T=o*i*u-a*c,E=i*a*u-o*c,D=a*a*u+l,O=o*a*u+i*c,k=i*o*u+a*c,A=a*o*u-i*c,j=o*o*u+l,e[0]=d*C+h*w+y*T,e[1]=f*C+g*w+b*T,e[2]=p*C+_*w+x*T,e[3]=m*C+v*w+S*T,e[4]=d*E+h*D+y*O,e[5]=f*E+g*D+b*O,e[6]=p*E+_*D+x*O,e[7]=m*E+v*D+S*O,e[8]=d*k+h*A+y*j,e[9]=f*k+g*A+b*j,e[10]=p*k+_*A+x*j,e[11]=m*k+v*A+S*j,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}}),he=h((e,t)=>{t.exports=n;function n(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+l*r,e[5]=o*i+u*r,e[6]=s*i+d*r,e[7]=c*i+f*r,e[8]=l*i-a*r,e[9]=u*i-o*r,e[10]=d*i-s*r,e[11]=f*i-c*r,e}}),ge=h((e,t)=>{t.exports=n;function n(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[8],u=t[9],d=t[10],f=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-l*r,e[1]=o*i-u*r,e[2]=s*i-d*r,e[3]=c*i-f*r,e[8]=a*r+l*i,e[9]=o*r+u*i,e[10]=s*r+d*i,e[11]=c*r+f*i,e}}),_e=h((e,t)=>{t.exports=n;function n(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[4],u=t[5],d=t[6],f=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+l*r,e[1]=o*i+u*r,e[2]=s*i+d*r,e[3]=c*i+f*r,e[4]=l*i-a*r,e[5]=u*i-o*r,e[6]=d*i-s*r,e[7]=f*i-c*r,e}}),ve=h((e,t)=>{t.exports=n;function n(e,t,n){var r,i,a,o=n[0],s=n[1],c=n[2],l=Math.sqrt(o*o+s*s+c*c);return Math.abs(l)<1e-6?null:(l=1/l,o*=l,s*=l,c*=l,r=Math.sin(t),i=Math.cos(t),a=1-i,e[0]=o*o*a+i,e[1]=s*o*a+c*r,e[2]=c*o*a-s*r,e[3]=0,e[4]=o*s*a-c*r,e[5]=s*s*a+i,e[6]=c*s*a+o*r,e[7]=0,e[8]=o*c*a+s*r,e[9]=s*c*a-o*r,e[10]=c*c*a+i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}}),ye=h((e,t)=>{t.exports=n;function n(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=r+r,c=i+i,l=a+a,u=r*s,d=r*c,f=r*l,p=i*c,m=i*l,h=a*l,g=o*s,_=o*c,v=o*l;return e[0]=1-(p+h),e[1]=d+v,e[2]=f-_,e[3]=0,e[4]=d-v,e[5]=1-(u+h),e[6]=m+g,e[7]=0,e[8]=f+_,e[9]=m-g,e[10]=1-(u+p),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}}),be=h((e,t)=>{t.exports=n;function n(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}),xe=h((e,t)=>{t.exports=n;function n(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}}),Se=h((e,t)=>{t.exports=n;function n(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}),Ce=h((e,t)=>{t.exports=n;function n(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}),we=h((e,t)=>{t.exports=n;function n(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=r,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}),Te=h((e,t)=>{t.exports=n;function n(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n+n,s=r+r,c=i+i,l=n*o,u=r*o,d=r*s,f=i*o,p=i*s,m=i*c,h=a*o,g=a*s,_=a*c;return e[0]=1-d-m,e[1]=u+_,e[2]=f-g,e[3]=0,e[4]=u-_,e[5]=1-l-m,e[6]=p+h,e[7]=0,e[8]=f+g,e[9]=p-h,e[10]=1-l-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}),Ee=h((e,t)=>{t.exports=n;function n(e,t,n,r,i,a,o){var s=1/(n-t),c=1/(i-r),l=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*c,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(i+r)*c,e[10]=(o+a)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*l,e[15]=0,e}}),De=h((e,t)=>{t.exports=n;function n(e,t,n,r,i){var a=1/Math.tan(t/2),o=1/(r-i);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+r)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*r*o,e[15]=0,e}}),Oe=h((e,t)=>{t.exports=n;function n(e,t,n,r){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),c=2/(o+s),l=2/(i+a);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=l,e[6]=0,e[7]=0,e[8]=-((o-s)*c*.5),e[9]=(i-a)*l*.5,e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e}}),ke=h((e,t)=>{t.exports=n;function n(e,t,n,r,i,a,o){var s=1/(t-n),c=1/(r-i),l=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*c,e[14]=(o+a)*l,e[15]=1,e}}),Ae=h((e,t)=>{var n=oe();t.exports=r;function r(e,t,r,i){var a,o,s,c,l,u,d,f,p,m,h=t[0],g=t[1],_=t[2],v=i[0],y=i[1],b=i[2],x=r[0],S=r[1],C=r[2];return Math.abs(h-x)<1e-6&&Math.abs(g-S)<1e-6&&Math.abs(_-C)<1e-6?n(e):(d=h-x,f=g-S,p=_-C,m=1/Math.sqrt(d*d+f*f+p*p),d*=m,f*=m,p*=m,a=y*p-b*f,o=b*d-v*p,s=v*f-y*d,m=Math.sqrt(a*a+o*o+s*s),m?(m=1/m,a*=m,o*=m,s*=m):(a=0,o=0,s=0),c=f*s-p*o,l=p*a-d*s,u=d*o-f*a,m=Math.sqrt(c*c+l*l+u*u),m?(m=1/m,c*=m,l*=m,u*=m):(c=0,l=0,u=0),e[0]=a,e[1]=c,e[2]=d,e[3]=0,e[4]=o,e[5]=l,e[6]=f,e[7]=0,e[8]=s,e[9]=u,e[10]=p,e[11]=0,e[12]=-(a*h+o*g+s*_),e[13]=-(c*h+l*g+u*_),e[14]=-(d*h+f*g+p*_),e[15]=1,e)}}),je=h((e,t)=>{t.exports=n;function n(e){return`mat4(`+e[0]+`, `+e[1]+`, `+e[2]+`, `+e[3]+`, `+e[4]+`, `+e[5]+`, `+e[6]+`, `+e[7]+`, `+e[8]+`, `+e[9]+`, `+e[10]+`, `+e[11]+`, `+e[12]+`, `+e[13]+`, `+e[14]+`, `+e[15]+`)`}}),Me=h((e,t)=>{t.exports={create:re(),clone:ie(),copy:ae(),identity:oe(),transpose:se(),invert:ce(),adjoint:le(),determinant:ue(),multiply:de(),translate:fe(),scale:pe(),rotate:me(),rotateX:he(),rotateY:ge(),rotateZ:_e(),fromRotation:ve(),fromRotationTranslation:ye(),fromScaling:be(),fromTranslation:xe(),fromXRotation:Se(),fromYRotation:Ce(),fromZRotation:we(),fromQuat:Te(),frustum:Ee(),perspective:De(),perspectiveFromFieldOfView:Oe(),ortho:ke(),lookAt:Ae(),str:je()}}),Ne=h(e=>{var t=Me();e.init2dArray=function(e,t){for(var n=Array(e),r=0;r<e;r++)n[r]=Array(t);return n},e.transposeRagged=function(e){var t=0,n=e.length,r,i;for(r=0;r<n;r++)t=Math.max(t,e[r].length);var a=Array(t);for(r=0;r<t;r++)for(a[r]=Array(n),i=0;i<n;i++)a[r][i]=e[i][r];return a},e.dot=function(t,n){if(!(t.length&&n.length)||t.length!==n.length)return null;var r=t.length,i,a;if(t[0].length)for(i=Array(r),a=0;a<r;a++)i[a]=e.dot(t[a],n);else if(n[0].length){var o=e.transposeRagged(n);for(i=Array(o.length),a=0;a<o.length;a++)i[a]=e.dot(t,o[a])}else for(i=0,a=0;a<r;a++)i+=t[a]*n[a];return i},e.translationMatrix=function(e,t){return[[1,0,e],[0,1,t],[0,0,1]]},e.rotationMatrix=function(e){var t=e*Math.PI/180;return[[Math.cos(t),-Math.sin(t),0],[Math.sin(t),Math.cos(t),0],[0,0,1]]},e.rotationXYMatrix=function(t,n,r){return e.dot(e.dot(e.translationMatrix(n,r),e.rotationMatrix(t)),e.translationMatrix(-n,-r))},e.apply3DTransform=function(t){return function(){var n=arguments,r=arguments.length===1?n[0]:[n[0],n[1],n[2]||0];return e.dot(t,[r[0],r[1],r[2],1]).slice(0,3)}},e.apply2DTransform=function(t){return function(){var n=arguments;n.length===3&&(n=n[0]);var r=arguments.length===1?n[0]:[n[0],n[1]];return e.dot(t,[r[0],r[1],1]).slice(0,2)}},e.apply2DTransform2=function(t){var n=e.apply2DTransform(t);return function(e){return n(e.slice(0,2)).concat(n(e.slice(2,4)))}},e.convertCssMatrix=function(e){if(e){var t=e.length;if(t===16)return e;if(t===6)return[e[0],e[1],0,0,e[2],e[3],0,0,0,0,1,0,e[4],e[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},e.inverseTransformMatrix=function(e){var n=[];return t.invert(n,e),[[n[0],n[1],n[2],n[3]],[n[4],n[5],n[6],n[7]],[n[8],n[9],n[10],n[11]],[n[12],n[13],n[14],n[15]]]}}),Pe=h((e,t)=>{var n=S(),r=ee(),i=Ne(),a=Me();function o(e){var t;if(typeof e==`string`){if(t=document.getElementById(e),t===null)throw Error(`No DOM element with id '`+e+`' exists on the page.`);return t}else if(e==null)throw Error(`DOM element provided is null or undefined`);return e}function s(e){var t=n.select(e);return t.node()instanceof HTMLElement&&t.size()&&t.classed(`js-plotly-plot`)}function c(e){var t=e&&e.parentNode;t&&t.removeChild(e)}function l(e,t){u(`global`,e,t)}function u(e,t,n){var i=`plotly.js-style-`+e,a=document.getElementById(i);if(!(a&&a.matches(`.no-inline-styles`))){a||(a=document.createElement(`style`),a.setAttribute(`id`,i),a.appendChild(document.createTextNode(``)),document.head.appendChild(a));var o=a.sheet;o?o.insertRule?o.insertRule(t+`{`+n+`}`,0):o.addRule?o.addRule(t,n,0):r.warn(`addStyleRule failed`):r.warn(`Cannot addRelatedStyleRule, probably due to strict CSP...`)}}function d(e){var t=`plotly.js-style-`+e,n=document.getElementById(t);n&&c(n)}function f(e,t,n,r,i,a){var o=r.split(`:`),s=i.split(`:`),c=`data-btn-style-event-added`;a||=document,a.querySelectorAll(e).forEach(function(e){e.getAttribute(c)||(e.addEventListener(`mouseenter`,function(){var e=this.querySelector(n);e&&(e.style[o[0]]=o[1])}),e.addEventListener(`mouseleave`,function(){var e=this.querySelector(n);e&&(t&&this.matches(t)?e.style[o[0]]=o[1]:e.style[s[0]]=s[1])}),e.setAttribute(c,!0))})}function p(e){var t=h(e),n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return t.forEach(function(e){var t=m(e);if(t){var r=i.convertCssMatrix(t);n=a.multiply(n,n,r)}}),n}function m(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue(`-webkit-transform`)||t.getPropertyValue(`-moz-transform`)||t.getPropertyValue(`-ms-transform`)||t.getPropertyValue(`-o-transform`)||t.getPropertyValue(`transform`);return n===`none`?null:n.replace(`matrix`,``).replace(`3d`,``).slice(1,-1).split(`,`).map(function(e){return+e})}function h(e){for(var t=[];g(e);)t.push(e),e=e.parentNode,typeof ShadowRoot==`function`&&e instanceof ShadowRoot&&(e=e.host);return t}function g(e){return e&&(e instanceof Element||e instanceof HTMLElement)}function _(e,t){return e&&t&&e.top===t.top&&e.left===t.left&&e.right===t.right&&e.bottom===t.bottom}t.exports={getGraphDiv:o,isPlotDiv:s,removeElement:c,addStyleRule:l,addRelatedStyleRule:u,deleteRelatedStyleRule:d,setStyleOnHover:f,getFullTransformMatrix:p,getElementTransformMatrix:m,getElementAndAncestors:h,equalDomRects:_}}),Fe=h((e,t)=>{t.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`.split(`.`),editType:`none`},ordering:{valType:`enumerated`,values:[`layout first`,`traces first`],dflt:`layout first`,editType:`none`}}}}),Ie=h((e,t)=>{var n=z().extendFlat,r=A(),i={valType:`flaglist`,extras:[`none`],flags:[`calc`,`clearAxisTypes`,`plot`,`style`,`markerSize`,`colorbars`]},a={valType:`flaglist`,extras:[`none`],flags:[`calc`,`plot`,`legend`,`ticks`,`axrange`,`layoutstyle`,`modebar`,`camera`,`arraydraw`,`colorbars`]},o=i.flags.slice().concat([`fullReplot`]),s=a.flags.slice().concat(`layoutReplot`);t.exports={traces:i,layout:a,traceFlags:function(){return c(o)},layoutFlags:function(){return c(s)},update:function(e,t){var n=t.editType;if(n&&n!==`none`)for(var r=n.split(`+`),i=0;i<r.length;i++)e[r[i]]=!0},overrideAll:l};function c(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!1;return t}function l(e,t,i){var a=n({},e);for(var o in a){var s=a[o];r(s)&&(a[o]=u(s,t,i,o))}return i===`from-root`&&(a.editType=t),a}function u(e,t,r,i){if(e.valType){var a=n({},e);if(a.editType=t,Array.isArray(e.items)){a.items=Array(e.items.length);for(var o=0;o<e.items.length;o++)a.items[o]=u(e.items[o],t,`from-root`)}return a}else return l(e,t,i.charAt(0)===`_`?`nested`:`from-root`)}}),Le=h(e=>{e.dash={valType:`string`,values:[`solid`,`dot`,`dash`,`longdash`,`dashdot`,`longdashdot`],dflt:`solid`,editType:`style`},e.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`}}),Re=h((e,t)=>{t.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`}}),ze=h(e=>{var{DATE_FORMAT_LINK:t,FORMAT_LINK:n}=Re(),r=[`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 i({supportOther:e}={}){return[`Variables are inserted using %{variable},`,`for example "y: %{y}"`+(e?` 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}".`,n,`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}".`,t,`for details on the date formatting syntax.`,r].join(` `)}e.templateFormatStringDescription=i,e.hovertemplateAttrs=({editType:e=`none`,arrayOk:t}={},n={})=>d({valType:`string`,dflt:``,editType:e},t===!1?{}:{arrayOk:!0}),e.texttemplateAttrs=({editType:e=`calc`,arrayOk:t}={},n={})=>d({valType:`string`,dflt:``,editType:e},t===!1?{}:{arrayOk:!0}),e.shapeTexttemplateAttrs=({editType:e=`arraydraw`,newshape:t}={},n={})=>({valType:`string`,dflt:``,editType:e}),e.templatefallbackAttrs=({editType:e=`none`}={})=>({valType:`any`,dflt:`-`,editType:e})}),Be=h((e,t)=>{function n(e,t){return t?t.d2l(e):e}function r(e,t){return t?t.l2d(e):e}function i(e){return e.x0}function a(e){return e.x1}function o(e){return e.y0}function s(e){return e.y1}function c(e){return e.x0shift||0}function l(e){return e.x1shift||0}function u(e){return e.y0shift||0}function d(e){return e.y1shift||0}function f(e,t){return n(e.x1,t)+l(e)-n(e.x0,t)-c(e)}function p(e,t,r){return n(e.y1,r)+d(e)-n(e.y0,r)-u(e)}function m(e,t){return Math.abs(f(e,t))}function h(e,t,n){return Math.abs(p(e,t,n))}function g(e,t,n){return e.type===`line`?Math.sqrt(f(e,t)**2+p(e,t,n)**2):void 0}function _(e,t){return r((n(e.x1,t)+l(e)+n(e.x0,t)+c(e))/2,t)}function v(e,t,i){return r((n(e.y1,i)+d(e)+n(e.y0,i)+u(e))/2,i)}function y(e,t,n){return e.type===`line`?p(e,t,n)/f(e,t):void 0}t.exports={x0:i,x1:a,y0:o,y1:s,slope:y,dx:f,dy:p,width:m,height:h,length:g,xcenter:_,ycenter:v,simpleXVariables:[`x0`,`x1`,`y0`,`y1`,`dy`,`height`,`ycenter`],simpleYVariables:[`x0`,`x1`,`y0`,`y1`,`dx`,`width`,`xcenter`]}}),Ve=h((e,t)=>{var n=Ie().overrideAll,r=W(),i=B(),a=Le().dash,o=z().extendFlat,{shapeTexttemplateAttrs:s,templatefallbackAttrs:c}=ze(),l=Be();t.exports=n({newshape:{visible:o({},r.visible,{}),showlegend:{valType:`boolean`,dflt:!1},legend:o({},r.legend,{}),legendgroup:o({},r.legendgroup,{}),legendgrouptitle:{text:o({},r.legendgrouptitle.text,{}),font:i({})},legendrank:o({},r.legendrank,{}),legendwidth:o({},r.legendwidth,{}),line:{color:{valType:`color`},width:{valType:`number`,min:0,dflt:4},dash:o({},a,{dflt:`solid`})},fillcolor:{valType:`color`,dflt:`rgba(0,0,0,0)`},fillrule:{valType:`enumerated`,values:[`evenodd`,`nonzero`],dflt:`evenodd`},opacity:{valType:`number`,min:0,max:1,dflt:1},layer:{valType:`enumerated`,values:[`below`,`above`,`between`],dflt:`above`},drawdirection:{valType:`enumerated`,values:[`ortho`,`horizontal`,`vertical`,`diagonal`],dflt:`diagonal`},name:o({},r.name,{}),label:{text:{valType:`string`,dflt:``},texttemplate:s({newshape:!0},{keys:Object.keys(l)}),texttemplatefallback:c({editType:`arraydraw`}),font:i({}),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`)}),He=h((e,t)=>{var n=Le().dash,r=z().extendFlat;t.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:r({},n,{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`}}}),Ue=h((e,t)=>{t.exports=function(e){var t=e.editType;return{t:{valType:`number`,dflt:0,editType:t},r:{valType:`number`,dflt:0,editType:t},b:{valType:`number`,dflt:0,editType:t},l:{valType:`number`,dflt:0,editType:t},editType:t}}}),We=h((e,t)=>{var n=B(),r=Fe(),i=K(),a=Ve(),o=He(),s=Ue(),c=z().extendFlat,l=n({editType:`calc`});l.family.dflt=`"Open Sans", verdana, arial, sans-serif`,l.size.dflt=12,l.color.dflt=i.defaultLine,t.exports={font:l,title:{text:{valType:`string`,editType:`layoutstyle`},font:n({editType:`layoutstyle`}),subtitle:{text:{valType:`string`,editType:`layoutstyle`},font:n({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:c(s({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:i.background,editType:`plot`},plot_bgcolor:{valType:`color`,dflt:i.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:i.defaults,editType:`calc`},datarevision:{valType:`any`,editType:`calc`},uirevision:{valType:`any`,editType:`none`},editrevision:{valType:`any`,editType:`none`},selectionrevision:{valType:`any`,editType:`none`},template:{valType:`any`,editType:`calc`},newshape:a.newshape,activeshape:a.activeshape,newselection:o.newselection,activeselection:o.activeselection,meta:{valType:`any`,arrayOk:!0,editType:`plot`},transition:c({},r.transition,{editType:`none`})}}),Ge=h(()=>{(function(){if(!document.getElementById(`8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc`)){var e=document.createElement(`style`);e.id=`8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc`,e.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(e)}})()}),Ke=h(e=>{var t=ee(),n=te(),r=ne(),i=A(),a=Pe().addStyleRule,o=z(),s=W(),c=We(),l=o.extendFlat,u=o.extendDeepAll;e.modules={},e.allCategories={},e.allTypes=[],e.subplotsRegistry={},e.componentsRegistry={},e.layoutArrayContainers=[],e.layoutArrayRegexes=[],e.traceLayoutAttributes={},e.localeRegistry={},e.apiMethodRegistry={},e.collectableSubplotTypes=null,e.register=function(t){if(e.collectableSubplotTypes=null,t)t&&!Array.isArray(t)&&(t=[t]);else throw Error(`No argument passed to Plotly.register.`);for(var n=0;n<t.length;n++){var r=t[n];if(!r)throw Error(`Invalid module was attempted to be registered!`);switch(r.moduleType){case`trace`:d(r);break;case`transform`:m(r);break;case`component`:p(r);break;case`locale`:h(r);break;case`apiMethod`:var i=r.name;e.apiMethodRegistry[i]=r.fn;break;default:throw Error(`Invalid module was attempted to be registered!`)}}},e.getModule=function(t){var n=e.modules[y(t)];return n?n._module:!1},e.traceIs=function(n,r){if(n=y(n),n===`various`)return!1;var i=e.modules[n];return i||=(n&&t.log(`Unrecognized trace type `+n+`.`),e.modules[s.type.dflt]),!!i.categories[r]},e.getComponentMethod=function(t,r){var i=e.componentsRegistry[t];return i&&i[r]||n},e.call=function(){var t=arguments[0],n=[].slice.call(arguments,1);return e.apiMethodRegistry[t].apply(null,n)};function d(n){var r=n.name,i=n.categories,o=n.meta;if(e.modules[r]){t.log(`Type `+r+` already registered`);return}e.subplotsRegistry[n.basePlotModule.name]||f(n.basePlotModule);for(var s={},c=0;c<i.length;c++)s[i[c]]=!0,e.allCategories[i[c]]=!0;for(var u in e.modules[r]={_module:n,categories:s},o&&Object.keys(o).length&&(e.modules[r].meta=o),e.allTypes.push(r),e.componentsRegistry)_(u,r);n.layoutAttributes&&l(e.traceLayoutAttributes,n.layoutAttributes);var d=n.basePlotModule,p=d.name;if(p===`mapbox`){var m=d.constants.styleRules;for(var h in m)a(`.js-plotly-plot .plotly .mapboxgl-`+h,m[h])}p===`map`&&Ge(),(p===`geo`||p===`mapbox`||p===`map`)&&window.PlotlyGeoAssets===void 0&&(window.PlotlyGeoAssets={topojson:{}})}function f(n){var r=n.name;if(e.subplotsRegistry[r]){t.log(`Plot type `+r+` already registered.`);return}for(var i in g(n),e.subplotsRegistry[r]=n,e.componentsRegistry)v(i,n.name)}function p(t){if(typeof t.name!=`string`)throw Error(`Component module *name* must be a string.`);var n=t.name;for(var i in e.componentsRegistry[n]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&r(e.layoutArrayContainers,n),g(t)),e.modules)_(n,i);for(var a in e.subplotsRegistry)v(n,a);t.schema&&t.schema.layout&&u(c,t.schema.layout)}function m(e){if(typeof e.name!=`string`)throw Error(`Transform module *name* must be a string.`);var n=`Transform module `+e.name,r=typeof e.transform==`function`,a=typeof e.calcTransform==`function`;if(!r&&!a)throw Error(n+` is missing a *transform* or *calcTransform* method.`);r&&a&&t.log([n+` has both a *transform* and *calcTransform* methods.`,`Please note that all *transform* methods are executed`,`before all *calcTransform* methods.`].join(` `)),i(e.attributes)||t.log(n+` registered without an *attributes* object.`),typeof e.supplyDefaults!=`function`&&t.log(n+` registered without a *supplyDefaults* method.`)}function h(t){var n=t.name,r=n.split(`-`)[0],i=t.dictionary,a=t.format,o=i&&Object.keys(i).length,s=a&&Object.keys(a).length,c=e.localeRegistry,l=c[n];if(l||(c[n]=l={}),r!==n){var u=c[r];u||(c[r]=u={}),o&&u.dictionary===l.dictionary&&(u.dictionary=i),s&&u.format===l.format&&(u.format=a)}o&&(l.dictionary=i),s&&(l.format=a)}function g(t){if(t.layoutAttributes){var n=t.layoutAttributes._arrayAttrRegexps;if(n)for(var i=0;i<n.length;i++)r(e.layoutArrayRegexes,n[i])}}function _(t,n){var r=e.componentsRegistry[t].schema;if(!(!r||!r.traces)){var i=r.traces[n];i&&u(e.modules[n]._module.attributes,i)}}function v(t,n){var r=e.componentsRegistry[t].schema;if(!(!r||!r.subplots)){var i=e.subplotsRegistry[n],a=i.layoutAttributes,o=i.attr===`subplot`?i.name:i.attr;Array.isArray(o)&&(o=o[0]);var s=r.subplots[o];a&&s&&u(a,s)}}function y(e){return typeof e==`object`&&(e=e.type),e}}),qe=h(e=>{var t=w().timeFormat,n=D(),r=ee(),i=L().mod,a=O(),o=a.BADNUM,s=a.ONEDAY,c=a.ONEHOUR,l=a.ONEMIN,u=a.ONESEC,d=a.EPOCHJD,f=Ke(),p=w().utcFormat,m=/^\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,h=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,g=new Date().getFullYear()-70;function _(e){return e&&f.componentsRegistry.calendars&&typeof e==`string`&&e!==`gregorian`}e.dateTick0=function(t,n){var r=v(t,!!n);if(n<2)return r;var i=e.dateTime2ms(r,t);return i+=s*(n-1),e.ms2DateTime(i,0,t)};function v(e,t){return _(e)?t?f.getComponentMethod(`calendars`,`CANONICAL_SUNDAY`)[e]:f.getComponentMethod(`calendars`,`CANONICAL_TICK`)[e]:t?`2000-01-02`:`2000-01-01`}e.dfltRange=function(e){return _(e)?f.getComponentMethod(`calendars`,`DFLTRANGE`)[e]:[`2000-01-01`,`2001-01-01`]},e.isJSDate=function(e){return typeof e==`object`&&!!e&&typeof e.getTime==`function`};var y,b;e.dateTime2ms=function(t,n){if(e.isJSDate(t)){var r=t.getTimezoneOffset()*l,a=(t.getUTCMinutes()-t.getMinutes())*l+(t.getUTCSeconds()-t.getSeconds())*u+(t.getUTCMilliseconds()-t.getMilliseconds());if(a){var p=3*l;r=r-p/2+i(a-r+p/2,p)}return t=Number(t)-r,t>=y&&t<=b?t:o}if(typeof t!=`string`&&typeof t!=`number`)return o;t=String(t);var v=_(n),x=t.charAt(0);v&&(x===`G`||x===`g`)&&(t=t.slice(1),n=``);var S=v&&n.slice(0,7)===`chinese`,C=t.match(S?h:m);if(!C)return o;var w=C[1],T=C[3]||`1`,E=Number(C[5]||1),D=Number(C[7]||0),O=Number(C[9]||0),k=Number(C[11]||0);if(v){if(w.length===2)return o;w=Number(w);var A;try{var j=f.getComponentMethod(`calendars`,`getCal`)(n);if(S){var M=T.charAt(T.length-1)===`i`;T=parseInt(T,10),A=j.newDate(w,j.toMonthIndex(w,T,M),E)}else A=j.newDate(w,Number(T),E)}catch{return o}return A?(A.toJD()-d)*s+D*c+O*l+k*u:o}w=w.length===2?(Number(w)+2e3-g)%100+g:Number(w),--T;var N=new Date(Date.UTC(2e3,T,E,D,O));return N.setUTCFullYear(w),N.getUTCMonth()!==T||N.getUTCDate()!==E?o:N.getTime()+k*u},y=e.MIN_MS=e.dateTime2ms(`-9999`),b=e.MAX_MS=e.dateTime2ms(`9999-12-31 23:59:59.9999`),e.isDateTime=function(t,n){return e.dateTime2ms(t,n)!==o};function x(e,t){return String(e+10**t).slice(1)}var S=90*s,C=3*c,T=5*l;e.ms2DateTime=function(e,t,n){if(typeof e!=`number`||!(e>=y&&e<=b))return o;t||=0;var r=Math.floor(i(e+.05,1)*10),a=Math.round(e-r/10),m,h,g,v,x,w;if(_(n)){var D=Math.floor(a/s)+d,O=Math.floor(i(e,s));try{m=f.getComponentMethod(`calendars`,`getCal`)(n).fromJD(D).formatDate(`yyyy-mm-dd`)}catch{m=p(`G%Y-%m-%d`)(new Date(a))}if(m.charAt(0)===`-`)for(;m.length<11;)m=`-0`+m.slice(1);else for(;m.length<10;)m=`0`+m;h=t<S?Math.floor(O/c):0,g=t<S?Math.floor(O%c/l):0,v=t<C?Math.floor(O%l/u):0,x=t<T?O%u*10+r:0}else w=new Date(a),m=p(`%Y-%m-%d`)(w),h=t<S?w.getUTCHours():0,g=t<S?w.getUTCMinutes():0,v=t<C?w.getUTCSeconds():0,x=t<T?w.getUTCMilliseconds()*10+r:0;return E(m,h,g,v,x)},e.ms2DateTimeLocal=function(e){if(!(e>=y+s&&e<=b-s))return o;var n=Math.floor(i(e+.05,1)*10),r=new Date(Math.round(e-n/10));return E(t(`%Y-%m-%d`)(r),r.getHours(),r.getMinutes(),r.getSeconds(),r.getUTCMilliseconds()*10+n)};function E(e,t,n,r,i){if((t||n||r||i)&&(e+=` `+x(t,2)+`:`+x(n,2),(r||i)&&(e+=`:`+x(r,2),i))){for(var a=4;i%10==0;)--a,i/=10;e+=`.`+x(i,a)}return e}e.cleanDate=function(t,n,i){if(t===o)return n;if(e.isJSDate(t)||typeof t==`number`&&isFinite(t)){if(_(i))return r.error(`JS Dates and milliseconds are incompatible with world calendars`,t),n;if(t=e.ms2DateTimeLocal(+t),!t&&n!==void 0)return n}else if(!e.isDateTime(t,i))return r.error(`unrecognized date`,t),n;return t};var k=/%\d?f/g,A=/%h/g,j={1:`1`,2:`1`,3:`2`,4:`2`};function M(e,t,n,r){e=e.replace(k,function(e){var n=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(n).slice(2).replace(/0+$/,``)||`0`});var i=new Date(Math.floor(t+.05));if(e=e.replace(A,function(){return j[n(`%q`)(i)]}),_(r))try{e=f.getComponentMethod(`calendars`,`worldCalFmt`)(e,t,r)}catch{return`Invalid`}return n(e)(i)}var N=[59,59.9,59.99,59.999,59.9999];function P(e,t){var r=i(e+.05,s),a=x(Math.floor(r/c),2)+`:`+x(i(Math.floor(r/l),60),2);if(t!==`M`){n(t)||(t=0);var o=(100+Math.min(i(e/u,60),N[t])).toFixed(t).slice(1);t>0&&(o=o.replace(/0+$/,``).replace(/[\.]$/,``)),a+=`:`+o}return a}e.formatDate=function(e,t,n,r,i,a){if(i=_(i)&&i,!t)if(n===`y`)t=a.year;else if(n===`m`)t=a.month;else if(n===`d`)t=a.dayMonth+`
`+a.year;else return P(e,n)+`
`+M(a.dayMonthYear,e,r,i);return M(t,e,r,i)};var F=3*s;e.incrementMonth=function(e,t,n){n=_(n)&&n;var a=i(e,s);if(e=Math.round(e-a),n)try{var o=Math.round(e/s)+d,c=f.getComponentMethod(`calendars`,`getCal`)(n),l=c.fromJD(o);return t%12?c.add(l,t,`m`):c.add(l,t/12,`y`),(l.toJD()-d)*s+a}catch{r.error(`invalid ms `+e+` in calendar `+n)}var u=new Date(e+F);return u.setUTCMonth(u.getUTCMonth()+t)+a-F},e.findExactDates=function(e,t){for(var r=0,i=0,a=0,o=0,c,l,u=_(t)&&f.getComponentMethod(`calendars`,`getCal`)(t),p=0;p<e.length;p++){if(l=e[p],!n(l)){o++;continue}if(!(l%s))if(u)try{c=u.fromJD(l/s+d),c.day()===1?c.month()===1?r++:i++:a++}catch{}else c=new Date(l),c.getUTCDate()===1?c.getUTCMonth()===0?r++:i++:a++}i+=r,a+=i;var m=e.length-o;return{exactYears:r/m,exactMonths:i/m,exactDays:a/m}}}),Je=h((e,t)=>{t.exports=function(e){return e}}),Ye=h(e=>{var t=D(),n=ee(),r=Je(),i=O().BADNUM,a=1e-9;e.findBin=function(e,r,i){if(t(r.start))return i?Math.ceil((e-r.start)/r.size-a)-1:Math.floor((e-r.start)/r.size+a);var u=0,d=r.length,f=0,p=d>1?(r[d-1]-r[0])/(d-1):1,m,h;for(h=p>=0?i?o:s:i?l:c,e+=p*a*(i?-1:1)*(p>=0?1:-1);u<d&&f++<100;)m=Math.floor((u+d)/2),h(r[m],e)?u=m+1:d=m;return f>90&&n.log(`Long binary search...`),u-1};function o(e,t){return e<t}function s(e,t){return e<=t}function c(e,t){return e>t}function l(e,t){return e>=t}e.sorterAsc=function(e,t){return e-t},e.sorterDes=function(e,t){return t-e},e.distinctVals=function(t){var n=t.slice();n.sort(e.sorterAsc);var r;for(r=n.length-1;r>-1&&n[r]===i;r--);for(var a=n[r]-n[0]||1,o=a/(r||1)/1e4,s=[],c,l=0;l<=r;l++){var u=n[l],d=u-c;c===void 0?(s.push(u),c=u):d>o&&(a=Math.min(a,d),s.push(u),c=u)}return{vals:s,minDiff:a}},e.roundUp=function(e,t,n){for(var r=0,i=t.length-1,a,o=0,s=n?0:1,c=n?1:0,l=n?Math.ceil:Math.floor;r<i&&o++<100;)a=l((r+i)/2),t[a]<=e?r=a+s:i=a-c;return t[r]},e.sort=function(e,t){for(var n=0,r=0,i=1;i<e.length;i++){var a=t(e[i],e[i-1]);if(a<0?n=1:a>0&&(r=1),n&&r)return e.sort(t)}return r?e:e.reverse()},e.findIndexOfMin=function(e,t){t||=r;for(var n=1/0,i,a=0;a<e.length;a++){var o=t(e[a]);o<n&&(n=o,i=a)}return i}}),Xe=h((e,t)=>{t.exports=function(e){return Object.keys(e).sort()}}),Ze=h(e=>{var t=D(),n=j().isArrayOrTypedArray;e.aggNums=function(r,i,a,o){var s,c;if((!o||o>a.length)&&(o=a.length),t(i)||(i=!1),n(a[0])){for(c=Array(o),s=0;s<o;s++)c[s]=e.aggNums(r,i,a[s]);a=c}for(s=0;s<o;s++)t(i)?t(a[s])&&(i=r(+i,+a[s])):i=a[s];return i},e.len=function(t){return e.aggNums(function(e){return e+1},0,t)},e.mean=function(t,n){return n||=e.len(t),e.aggNums(function(e,t){return e+t},0,t)/n},e.geometricMean=function(t,n){return n||=e.len(t),e.aggNums(function(e,t){return e*t},1,t)**(1/n)},e.midRange=function(t){if(!(t===void 0||t.length===0))return(e.aggNums(Math.max,null,t)+e.aggNums(Math.min,null,t))/2},e.variance=function(n,r,i){return r||=e.len(n),t(i)||(i=e.mean(n,r)),e.aggNums(function(e,t){return e+(t-i)**2},0,n)/r},e.stdev=function(t,n,r){return Math.sqrt(e.variance(t,n,r))},e.median=function(t){var n=t.slice().sort();return e.interp(n,.5)},e.interp=function(e,n){if(!t(n))throw`n should be a finite number`;if(n=n*e.length-.5,n<0)return e[0];if(n>e.length-1)return e[e.length-1];var r=n%1;return r*e[Math.ceil(n)]+(1-r)*e[Math.floor(n)]}}),Qe=h((e,t)=>{var n=L(),r=n.mod,i=n.modHalf,a=Math.PI,o=2*a;function s(e){return e/180*a}function c(e){return e/a*180}function l(e){return Math.abs(e[1]-e[0])>o-1e-14}function u(e,t){return i(t-e,o)}function d(e,t){return Math.abs(u(e,t))}function f(e,t){if(l(t))return!0;var n,i;t[0]<t[1]?(n=t[0],i=t[1]):(n=t[1],i=t[0]),n=r(n,o),i=r(i,o),n>i&&(i+=o);var a=r(e,o),s=a+o;return a>=n&&a<=i||s>=n&&s<=i}function p(e,t,n,r){if(!f(t,r))return!1;var i,a;return n[0]<n[1]?(i=n[0],a=n[1]):(i=n[1],a=n[0]),e>=i&&e<=a}function m(e,t,n,r,i,s,c){i||=0,s||=0;var u=l([n,r]),d,f,p,m,h;u?(d=0,f=a,p=o):n<r?(d=n,p=r):(d=r,p=n),e<t?(m=e,h=t):(m=t,h=e);function g(e,t){return[e*Math.cos(t)+i,s-e*Math.sin(t)]}var _=Math.abs(p-d)<=a?0:1;function v(e,t,n){return`A`+[e,e]+` `+[0,_,n]+` `+g(e,t)}var y;return u?y=m===null?`M`+g(h,d)+v(h,f,0)+v(h,p,0)+`Z`:`M`+g(m,d)+v(m,f,0)+v(m,p,0)+`ZM`+g(h,d)+v(h,f,1)+v(h,p,1)+`Z`:m===null?(y=`M`+g(h,d)+v(h,p,0),c&&(y+=`L0,0Z`)):y=`M`+g(m,d)+`L`+g(h,d)+v(h,p,0)+`L`+g(m,p)+v(m,d,1)+`Z`,y}function h(e,t,n,r,i){return m(null,e,t,n,r,i,0)}function g(e,t,n,r,i){return m(null,e,t,n,r,i,1)}function _(e,t,n,r,i,a){return m(e,t,n,r,i,a,1)}t.exports={deg2rad:s,rad2deg:c,angleDelta:u,angleDist:d,isFullCircle:l,isAngleInsideSector:f,isPtInsideSector:p,pathArc:h,pathSector:g,pathAnnulus:_}}),$e=h(e=>{e.isLeftAnchor=function(e){return e.xanchor===`left`||e.xanchor===`auto`&&e.x<=1/3},e.isCenterAnchor=function(e){return e.xanchor===`center`||e.xanchor===`auto`&&e.x>1/3&&e.x<2/3},e.isRightAnchor=function(e){return e.xanchor===`right`||e.xanchor===`auto`&&e.x>=2/3},e.isTopAnchor=function(e){return e.yanchor===`top`||e.yanchor===`auto`&&e.y>=2/3},e.isMiddleAnchor=function(e){return e.yanchor===`middle`||e.yanchor===`auto`&&e.y>1/3&&e.y<2/3},e.isBottomAnchor=function(e){return e.yanchor===`bottom`||e.yanchor===`auto`&&e.y<=1/3}}),et=h(e=>{var t=L().mod;e.segmentsIntersect=n;function n(e,t,n,r,i,a,o,s){var c=n-e,l=i-e,u=o-i,d=r-t,f=a-t,p=s-a,m=c*p-u*d;if(m===0)return null;var h=(l*p-u*f)/m,g=(l*d-c*f)/m;return g<0||g>1||h<0||h>1?null:{x:e+c*h,y:t+d*h}}e.segmentDistance=function(e,t,i,a,o,s,c,l){if(n(e,t,i,a,o,s,c,l))return 0;var u=i-e,d=a-t,f=c-o,p=l-s,m=u*u+d*d,h=f*f+p*p,g=Math.min(r(u,d,m,o-e,s-t),r(u,d,m,c-e,l-t),r(f,p,h,e-o,t-s),r(f,p,h,i-o,a-s));return Math.sqrt(g)};function r(e,t,n,r,i){var a=r*e+i*t;if(a<0)return r*r+i*i;if(a>n){var o=r-e,s=i-t;return o*o+s*s}else{var c=r*t-i*e;return c*c/n}}var i,a,o;e.getTextLocation=function(e,n,r,s){if((e!==a||s!==o)&&(i={},a=e,o=s),i[r])return i[r];var c=e.getPointAtLength(t(r-s/2,n)),l=e.getPointAtLength(t(r+s/2,n)),u=Math.atan((l.y-c.y)/(l.x-c.x)),d=e.getPointAtLength(t(r,n)),f={x:(d.x*4+c.x+l.x)/6,y:(d.y*4+c.y+l.y)/6,theta:u};return i[r]=f,f},e.clearLocationCache=function(){a=null},e.getVisibleSegment=function(e,t,n){var r=t.left,i=t.right,a=t.top,o=t.bottom,s=0,c=e.getTotalLength(),l=c,u,d;function f(t){var n=e.getPointAtLength(t);t===0?u=n:t===c&&(d=n);var s=n.x<r?r-n.x:n.x>i?n.x-i:0,l=n.y<a?a-n.y:n.y>o?n.y-o:0;return Math.sqrt(s*s+l*l)}for(var p=f(s);p;){if(s+=p+n,s>l)return;p=f(s)}for(p=f(l);p;){if(l-=p+n,s>l)return;p=f(l)}return{min:s,max:l,len:l-s,total:c,isClosed:s===0&&l===c&&Math.abs(u.x-d.x)<.1&&Math.abs(u.y-d.y)<.1}},e.findPointOnPath=function(e,t,n,r){r||={};for(var i=r.pathLength||e.getTotalLength(),a=r.tolerance||.001,o=r.iterationLimit||30,s=e.getPointAtLength(0)[n]>e.getPointAtLength(i)[n]?-1:1,c=0,l=0,u=i,d,f,p;c<o;){if(d=(l+u)/2,f=e.getPointAtLength(d),p=f[n]-t,Math.abs(p)<a)return f;s*p>0?u=d:l=d,c++}return f}}),tt=h(e=>{var t={};e.throttle=function(e,r,i){var a=t[e],o=Date.now();if(!a){for(var s in t)t[s].ts<o-6e4&&delete t[s];a=t[e]={ts:0,timer:null}}n(a);function c(){i(),a.ts=Date.now(),a.onDone&&(a.onDone(),a.onDone=null)}if(o>a.ts+r){c();return}a.timer=setTimeout(function(){c(),a.timer=null},r)},e.done=function(e){var n=t[e];return!n||!n.timer?Promise.resolve():new Promise(function(e){var t=n.onDone;n.onDone=function(){t&&t(),e(),n.onDone=null}})},e.clear=function(r){if(r)n(t[r]),delete t[r];else for(var i in t)e.clear(i)};function n(e){e&&e.timer!==null&&(clearTimeout(e.timer),e.timer=null)}}),nt=h((e,t)=>{t.exports=function(e){e._responsiveChartHandler&&(window.removeEventListener(`resize`,e._responsiveChartHandler),delete e._responsiveChartHandler)}}),rt=h((e,t)=>{t.exports=a,t.exports.isMobile=a,t.exports.default=a;var n=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,i=/android|ipad|playbook|silk/i;function a(e){e||={};let t=e.ua;if(!t&&typeof navigator<`u`&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers[`user-agent`]==`string`&&(t=t.headers[`user-agent`]),typeof t!=`string`)return!1;let a=n.test(t)&&!r.test(t)||!!e.tablet&&i.test(t);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf(`Macintosh`)!==-1&&t.indexOf(`Safari`)!==-1&&(a=!0),a}}),it=h((e,t)=>{var n=D(),r=rt();t.exports=function(e){var t;if(t=e&&e.hasOwnProperty(`userAgent`)?e.userAgent:i(),typeof t!=`string`)return!0;var a=r({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!a){for(var o=t.split(` `),s=1;s<o.length;s++)if(o[s].indexOf(`Safari`)!==-1)for(var c=s-1;c>-1;c--){var l=o[c];if(l.slice(0,8)===`Version/`){var u=l.slice(8).split(`.`)[0];if(n(u)&&(u=+u),u>=13)return!0}}}return a};function i(){var e;return typeof navigator<`u`&&(e=navigator.userAgent),e&&e.headers&&typeof e.headers[`user-agent`]==`string`&&(e=e.headers[`user-agent`]),e}}),at=h((e,t)=>{var n=S();t.exports=function(e,t,r){var i=e.selectAll(`g.`+r.replace(/\s/g,`.`)).data(t,function(e){return e[0].trace.uid});i.exit().remove(),i.enter().append(`g`).attr(`class`,r),i.order();var a=e.classed(`rangeplot`)?`nodeRangePlot3`:`node3`;return i.each(function(e){e[0][a]=n.select(this)}),i}}),ot=h((e,t)=>{var n=Ke();t.exports=function(e,t){for(var r=e._context.locale,i=0;i<2;i++){for(var a=e._context.locales,o=0;o<2;o++){var s=(a[r]||{}).dictionary;if(s){var c=s[t];if(c)return c}a=n.localeRegistry}var l=r.split(`-`)[0];if(l===r)break;r=l}return t}}),st=h((e,t)=>{t.exports=function(e){for(var t={},n=[],r=0,i=0;i<e.length;i++){var a=e[i];t[a]!==1&&(t[a]=1,n[r++]=a)}return n}}),ct=h((e,t)=>{t.exports=function(e){for(var t=i(e)?r:n,a=[],o=0;o<e.length;o++){var s=e[o];t(s)&&a.push(s)}return a};function n(e){return e.visible===!0}function r(e){var t=e[0].trace;return t.visible===!0&&t._length!==0}function i(e){return Array.isArray(e)&&Array.isArray(e[0])&&e[0][0]&&e[0][0].trace}}),lt=h((e,t)=>{t.exports=function(e,t){if(!t)return e;var n=1/Math.abs(t),r=n>1?(n*e+n*t)/n:e+t,i=String(r).length;if(i>16){var a=String(t).length;if(i>=String(e).length+a){var o=parseFloat(r).toPrecision(12);o.indexOf(`e+`)===-1&&(r=+o)}}return r}}),ut=h((e,t)=>{var n=D(),r=O().BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;t.exports=function(e){return typeof e==`string`&&(e=e.replace(i,``)),n(e)?Number(e):r}}),$=h((e,t)=>{var n=S(),r=w().utcFormat,i=T().format,a=D(),o=O(),s=o.FP_SAFE,c=-s,l=o.BADNUM,u=t.exports={};u.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:e===`0.f`?`~f`:/^\d%/.test(e)?`~%`:/^\ds/.test(e)?`~s`:!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?`~`+e:e};var p={};u.warnBadFormat=function(e){var t=String(e);p[t]||(p[t]=1,u.warn(`encountered bad format: "`+t+`"`))},u.noFormat=function(e){return String(e)},u.numberFormat=function(e){var t;try{t=i(u.adjustFormat(e))}catch{return u.warnBadFormat(e),u.noFormat}return t},u.nestedProperty=M(),u.keyedContainer=N(),u.relativeAttr=P(),u.isPlainObject=A(),u.toLogRange=F(),u.relinkPrivateKeys=I();var m=j();u.isArrayBuffer=m.isArrayBuffer,u.isTypedArray=m.isTypedArray,u.isArrayOrTypedArray=m.isArrayOrTypedArray,u.isArray1D=m.isArray1D,u.ensureArray=m.ensureArray,u.concat=m.concat,u.maxRowLength=m.maxRowLength,u.minRowLength=m.minRowLength;var h=L();u.mod=h.mod,u.modHalf=h.modHalf;var g=X();u.valObjectMeta=g.valObjectMeta,u.coerce=g.coerce,u.coerce2=g.coerce2,u.coerceFont=g.coerceFont,u.coercePattern=g.coercePattern,u.coerceHoverinfo=g.coerceHoverinfo,u.coerceSelectionMarkerOpacity=g.coerceSelectionMarkerOpacity,u.validate=g.validate;var _=qe();u.dateTime2ms=_.dateTime2ms,u.isDateTime=_.isDateTime,u.ms2DateTime=_.ms2DateTime,u.ms2DateTimeLocal=_.ms2DateTimeLocal,u.cleanDate=_.cleanDate,u.isJSDate=_.isJSDate,u.formatDate=_.formatDate,u.incrementMonth=_.incrementMonth,u.dateTick0=_.dateTick0,u.dfltRange=_.dfltRange,u.findExactDates=_.findExactDates,u.MIN_MS=_.MIN_MS,u.MAX_MS=_.MAX_MS;var v=Ye();u.findBin=v.findBin,u.sorterAsc=v.sorterAsc,u.sorterDes=v.sorterDes,u.distinctVals=v.distinctVals,u.roundUp=v.roundUp,u.sort=v.sort,u.findIndexOfMin=v.findIndexOfMin,u.sortObjectKeys=Xe();var y=Ze();u.aggNums=y.aggNums,u.len=y.len,u.mean=y.mean,u.geometricMean=y.geometricMean,u.median=y.median,u.midRange=y.midRange,u.variance=y.variance,u.stdev=y.stdev,u.interp=y.interp;var b=Ne();u.init2dArray=b.init2dArray,u.transposeRagged=b.transposeRagged,u.dot=b.dot,u.translationMatrix=b.translationMatrix,u.rotationMatrix=b.rotationMatrix,u.rotationXYMatrix=b.rotationXYMatrix,u.apply3DTransform=b.apply3DTransform,u.apply2DTransform=b.apply2DTransform,u.apply2DTransform2=b.apply2DTransform2,u.convertCssMatrix=b.convertCssMatrix,u.inverseTransformMatrix=b.inverseTransformMatrix;var x=Qe();u.deg2rad=x.deg2rad,u.rad2deg=x.rad2deg,u.angleDelta=x.angleDelta,u.angleDist=x.angleDist,u.isFullCircle=x.isFullCircle,u.isAngleInsideSector=x.isAngleInsideSector,u.isPtInsideSector=x.isPtInsideSector,u.pathArc=x.pathArc,u.pathSector=x.pathSector,u.pathAnnulus=x.pathAnnulus;var C=$e();u.isLeftAnchor=C.isLeftAnchor,u.isCenterAnchor=C.isCenterAnchor,u.isRightAnchor=C.isRightAnchor,u.isTopAnchor=C.isTopAnchor,u.isMiddleAnchor=C.isMiddleAnchor,u.isBottomAnchor=C.isBottomAnchor;var E=et();u.segmentsIntersect=E.segmentsIntersect,u.segmentDistance=E.segmentDistance,u.getTextLocation=E.getTextLocation,u.clearLocationCache=E.clearLocationCache,u.getVisibleSegment=E.getVisibleSegment,u.findPointOnPath=E.findPointOnPath;var k=z();u.extendFlat=k.extendFlat,u.extendDeep=k.extendDeep,u.extendDeepAll=k.extendDeepAll,u.extendDeepNoArrays=k.extendDeepNoArrays;var R=ee();u.log=R.log,u.warn=R.warn,u.error=R.error,u.counterRegex=Y().counter;var B=tt();u.throttle=B.throttle,u.throttleDone=B.done,u.clearThrottle=B.clear;var V=Pe();u.getGraphDiv=V.getGraphDiv,u.isPlotDiv=V.isPlotDiv,u.removeElement=V.removeElement,u.addStyleRule=V.addStyleRule,u.addRelatedStyleRule=V.addRelatedStyleRule,u.deleteRelatedStyleRule=V.deleteRelatedStyleRule,u.setStyleOnHover=V.setStyleOnHover,u.getFullTransformMatrix=V.getFullTransformMatrix,u.getElementTransformMatrix=V.getElementTransformMatrix,u.getElementAndAncestors=V.getElementAndAncestors,u.equalDomRects=V.equalDomRects,u.clearResponsive=nt(),u.preserveDrawingBuffer=it(),u.makeTraceGroups=at(),u._=ot(),u.notifier=Q(),u.filterUnique=st(),u.filterVisible=ct(),u.pushUnique=ne(),u.increment=lt(),u.cleanNumber=ut(),u.ensureNumber=function(e){return a(e)?(e=Number(e),e>s||e<c?l:e):l},u.isIndex=function(e,t){return t!==void 0&&e>=t?!1:a(e)&&e>=0&&e%1==0},u.noop=te(),u.identity=Je(),u.repeat=function(e,t){for(var n=Array(t),r=0;r<t;r++)n[r]=e;return n},u.swapAttrs=function(e,t,n,r){n||=`x`,r||=`y`;for(var i=0;i<t.length;i++){var a=t[i],o=u.nestedProperty(e,a.replace(`?`,n)),s=u.nestedProperty(e,a.replace(`?`,r)),c=o.get();o.set(s.get()),s.set(c)}},u.raiseToTop=function(e){e.parentNode.appendChild(e)},u.cancelTransition=function(e){return e.transition().duration(0)},u.constrain=function(e,t,n){return t>n?Math.max(n,Math.min(t,e)):Math.max(t,Math.min(n,e))},u.bBoxIntersect=function(e,t,n){return n||=0,e.left<=t.right+n&&t.left<=e.right+n&&e.top<=t.bottom+n&&t.top<=e.bottom+n},u.simpleMap=function(e,t,n,r,i){for(var a=e.length,o=Array(a),s=0;s<a;s++)o[s]=t(e[s],n,r,i);return o},u.randstr=function e(t,n,r,i){if(r||=16,n===void 0&&(n=24),n<=0)return`0`;var a=Math.log(2**n)/Math.log(r),o=``,s,c,l;for(s=2;a===1/0;s*=2)a=Math.log(2**(n/s))/Math.log(r)*s;var d=a-Math.floor(a);for(s=0;s<Math.floor(a);s++)l=Math.floor(Math.random()*r).toString(r),o=l+o;d&&(c=r**+d,l=Math.floor(Math.random()*c).toString(r),o=l+o);var f=parseInt(o,r);return t&&t[o]||f!==1/0&&f>=2**n?i>10?(u.warn(`randstr failed uniqueness`),o):e(t,n,r,(i||0)+1):o},u.OptionControl=function(e,t){e||={},t||=`opt`;var n={};return n.optionList=[],n._newoption=function(r){r[t]=e,n[r.name]=r,n.optionList.push(r)},n[`_`+t]=e,n},u.smooth=function(e,t){if(t=Math.round(t)||0,t<2)return e;var n=e.length,r=2*n,i=2*t-1,a=Array(i),o=Array(n),s,c,l,u;for(s=0;s<i;s++)a[s]=(1-Math.cos(Math.PI*(s+1)/t))/(2*t);for(s=0;s<n;s++){for(u=0,c=0;c<i;c++)l=s+c+1-t,l<-n?l-=r*Math.round(l/r):l>=r&&(l-=r*Math.floor(l/r)),l<0?l=-1-l:l>=n&&(l=r-1-l),u+=e[l]*a[c];o[s]=u}return o},u.syncOrAsync=function(e,t,n){var r,i;function a(){return u.syncOrAsync(e,t,n)}for(;e.length;)if(i=e.splice(0,1)[0],r=i(t),r&&r.then)return r.then(a);return n&&n(t)},u.stripTrailingSlash=function(e){return e.slice(-1)===`/`?e.slice(0,-1):e},u.noneOrAll=function(e,t,n){if(e){var r=!1,i=!0,a,o;for(a=0;a<n.length;a++)o=e[n[a]],o==null?i=!1:r=!0;if(r&&!i)for(a=0;a<n.length;a++)e[n[a]]=t[n[a]]}},u.mergeArray=function(e,t,n,r){var i=typeof r==`function`;if(u.isArrayOrTypedArray(e))for(var a=Math.min(e.length,t.length),o=0;o<a;o++){var s=e[o];t[o][n]=i?r(s):s}},u.mergeArrayCastPositive=function(e,t,n){return u.mergeArray(e,t,n,function(e){var t=+e;return isFinite(t)&&t>0?t:0})},u.fillArray=function(e,t,n,r){if(r||=u.identity,u.isArrayOrTypedArray(e))for(var i=0;i<t.length;i++)t[i][n]=r(e[i])},u.castOption=function(e,t,n,r){r||=u.identity;var i=u.nestedProperty(e,n).get();return u.isArrayOrTypedArray(i)?Array.isArray(t)&&u.isArrayOrTypedArray(i[t[0]])?r(i[t[0]][t[1]]):r(i[t]):i},u.extractOption=function(e,t,n,r){if(n in e)return e[n];var i=u.nestedProperty(t,r).get();if(!Array.isArray(i))return i};function H(e){var t={};for(var n in e)for(var r=e[n],i=0;i<r.length;i++)t[r[i]]=+n;return t}u.tagSelected=function(e,t,n){var r=t.selectedpoints,i=t._indexToPoints,a;i&&(a=H(i));function o(t){return t!==void 0&&t<e.length}for(var s=0;s<r.length;s++){var c=r[s];if(u.isIndex(c)||u.isArrayOrTypedArray(c)&&u.isIndex(c[0])&&u.isIndex(c[1])){var l=a?a[c]:c,d=n?n[l]:l;o(d)&&(e[d].selected=1)}}},u.selIndices2selPoints=function(e){var t=e.selectedpoints,n=e._indexToPoints;if(n){for(var r=H(n),i=[],a=0;a<t.length;a++){var o=t[a];if(u.isIndex(o)){var s=r[o];u.isIndex(s)&&i.push(s)}}return i}else return t},u.getTargetArray=function(e,t){var n=t.target;if(typeof n==`string`&&n){var r=u.nestedProperty(e,n).get();return u.isArrayOrTypedArray(r)?r:!1}else if(u.isArrayOrTypedArray(n))return n;return!1};function U(e,t,n){var r={};typeof t!=`object`&&(t={});var i=n===`pieLike`?-1:3,a=Object.keys(e),o,s,c;for(o=0;o<a.length;o++)s=a[o],c=e[s],!(s.charAt(0)===`_`||typeof c==`function`)&&(s===`module`?r[s]=c:Array.isArray(c)?s===`colorscale`||i===-1?r[s]=c.slice():r[s]=c.slice(0,i):u.isTypedArray(c)?i===-1?r[s]=c.subarray():r[s]=c.subarray(0,i):c&&typeof c==`object`?r[s]=U(e[s],t[s],n):r[s]=c);for(a=Object.keys(t),o=0;o<a.length;o++)s=a[o],c=t[s],(typeof c!=`object`||!(s in r)||typeof r[s]!=`object`)&&(r[s]=c);return r}u.minExtend=U,u.titleCase=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},u.containsAny=function(e,t){for(var n=0;n<t.length;n++)if(e.indexOf(t[n])!==-1)return!0;return!1};var W=/Version\/[\d\.]+.*Safari/;u.isSafari=function(){return W.test(window.navigator.userAgent)};var G=/iPad|iPhone|iPod/;u.isIOS=function(){return G.test(window.navigator.userAgent)};var K=/Macintosh.+AppleWebKit.+Gecko\)$/;u.isMacWKWebView=()=>K.test(window.navigator.userAgent);var q=/Firefox\/(\d+)\.\d+/;u.getFirefoxVersion=function(){var e=q.exec(window.navigator.userAgent);if(e&&e.length===2){var t=parseInt(e[1]);if(!isNaN(t))return t}return null},u.isD3Selection=function(e){return e instanceof n.selection},u.ensureSingle=function(e,t,n,r){var i=e.select(t+(n?`.`+n:``));if(i.size())return i;var a=e.append(t);return n&&a.classed(n,!0),r&&a.call(r),a},u.ensureSingleById=function(e,t,n,r){var i=e.select(t+`#`+n);if(i.size())return i;var a=e.append(t).attr(`id`,n);return r&&a.call(r),a},u.objectFromPath=function(e,t){for(var n=e.split(`.`),r,i=r={},a=0;a<n.length;a++){var o=n[a],s=null,c=n[a].match(/(.*)\[([0-9]+)\]/);c?(o=c[1],s=c[2],r=r[o]=[],a===n.length-1?r[s]=t:r[s]={},r=r[s]):(a===n.length-1?r[o]=t:r[o]={},r=r[o])}return i};var J=/^([^\[\.]+)\.(.+)?/,Z=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function re(e){return e.slice(0,2)===`__`}u.expandObjectPaths=function(e){var t,n,r,i,a,o,s;if(typeof e==`object`&&!Array.isArray(e)){for(n in e)if(e.hasOwnProperty(n))if(t=n.match(J)){if(i=e[n],r=t[1],re(r))continue;delete e[n],e[r]=u.extendDeepNoArrays(e[r]||{},u.objectFromPath(n,u.expandObjectPaths(i))[r])}else if(t=n.match(Z)){if(i=e[n],r=t[1],re(r))continue;if(a=parseInt(t[2]),delete e[n],e[r]=e[r]||[],t[3]===`.`)s=t[4],o=e[r][a]=e[r][a]||{},u.extendDeepNoArrays(o,u.objectFromPath(s,u.expandObjectPaths(i)));else{if(re(r))continue;e[r][a]=u.expandObjectPaths(i)}}else{if(re(n))continue;e[n]=u.expandObjectPaths(e[n])}}return e},u.numSeparate=function(e,t,n){if(n||=!1,typeof t!=`string`||t.length===0)throw Error(`Separator string required for formatting!`);typeof e==`number`&&(e=String(e));var r=/(\d+)(\d{3})/,i=t.charAt(0),a=t.charAt(1),o=e.split(`.`),s=o[0],c=o.length>1?i+o[1]:``;if(a&&(o.length>1||s.length>4||n))for(;r.test(s);)s=s.replace(r,`$1`+a+`$2`);return s+c},u.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var ie=/^\w*$/;u.templateString=function(e,t){var n={};return e.replace(u.TEMPLATE_STRING_REGEX,function(e,r){var i;return ie.test(r)?i=t[r]:(n[r]=n[r]||u.nestedProperty(t,r).get,i=n[r](!0)),i===void 0?``:i})};var ae={max:10,count:0,name:`hovertemplate`};u.hovertemplateString=e=>de(f(d({},e),{opts:ae}));var oe={max:10,count:0,name:`texttemplate`};u.texttemplateString=e=>de(f(d({},e),{opts:oe}));var se=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function ce(e){var t=e.match(se);return t?{key:t[1],op:t[2],number:Number(t[3])}:{key:e,op:null,number:null}}var le={max:10,count:0,name:`texttemplate`,parseMultDiv:!0};u.texttemplateStringForShapes=e=>de(f(d({},e),{opts:le}));var ue=/^[:|\|]/;function de({data:e=[],locale:t,fallback:n,labels:i={},opts:a,template:o}){return o.replace(u.TEMPLATE_STRING_REGEX,(o,s,c)=>{let l=[`xother`,`yother`].includes(s),d=[`_xother`,`_yother`].includes(s),f=[`_xother_`,`_yother_`].includes(s),p=[`xother_`,`yother_`].includes(s),m=l||d||p||f;(d||f)&&(s=s.substring(1)),(p||f)&&(s=s.substring(0,s.length-1));let h=null,g=null;if(a.parseMultDiv){var _=ce(s);s=_.key,h=_.op,g=_.number}let v;if(m){if(i[s]===void 0)return``;v=i[s]}else for(let t of e)if(t){if(t.hasOwnProperty(s)){v=t[s];break}if(ie.test(s)||(v=u.nestedProperty(t,s).get(!0)),v!==void 0)break}if(v===void 0){let{count:e,max:t,name:r}=a,i=n===!1?o:n;return e<t&&u.warn([`Variable '${s}' in ${r} could not be found!`,`Please verify that the template is correct.`,`Using value: '${i}'.`].join(` `)),e===t&&u.warn(`Too many '${r}' warnings - additional warnings will be suppressed.`),a.count++,i}if(h===`*`&&(v*=g),h===`/`&&(v/=g),c){var y;if(c[0]===`:`&&(y=t?t.numberFormat:u.numberFormat,v!==``&&(v=y(c.replace(ue,``))(v))),c[0]===`|`){y=t?t.timeFormat:r;var b=u.dateTime2ms(v);v=u.formatDate(b,c.replace(ue,``),!1,y)}}else{var x=s+`Label`;i.hasOwnProperty(x)&&(v=i[x])}return m&&(v=`(`+v+`)`,(d||f)&&(v=` `+v),(p||f)&&(v+=` `)),v})}var fe=48,pe=57;u.subplotSort=function(e,t){for(var n=Math.min(e.length,t.length)+1,r=0,i=0,a=0;a<n;a++){var o=e.charCodeAt(a)||0,s=t.charCodeAt(a)||0,c=o>=fe&&o<=pe,l=s>=fe&&s<=pe;if(c&&(r=10*r+o-fe),l&&(i=10*i+s-fe),!c||!l){if(r!==i)return r-i;if(o!==s)return o-s}}return i-r};var me=2e9;u.seedPseudoRandom=function(){me=2e9},u.pseudoRandom=function(){var e=me;return me=(69069*me+1)%4294967296,Math.abs(me-e)<429496729?u.pseudoRandom():me/4294967296},u.fillText=function(e,t,n){var r=Array.isArray(n)?function(e){n.push(e)}:function(e){n.text=e},i=u.extractOption(e,t,`htx`,`hovertext`);if(u.isValidTextValue(i))return r(i);var a=u.extractOption(e,t,`tx`,`text`);if(u.isValidTextValue(a))return r(a)},u.isValidTextValue=function(e){return e||e===0},u.formatPercent=function(e,t){t||=0;for(var n=(Math.round(100*e*10**t)*.1**t).toFixed(t)+`%`,r=0;r<t;r++)n.indexOf(`.`)!==-1&&(n=n.replace(`0%`,`%`),n=n.replace(`.%`,`%`));return n},u.isHidden=function(e){var t=window.getComputedStyle(e).display;return!t||t===`none`},u.strTranslate=function(e,t){return e||t?`translate(`+e+`,`+t+`)`:``},u.strRotate=function(e){return e?`rotate(`+e+`)`:``},u.strScale=function(e){return e===1?``:`scale(`+e+`)`},u.getTextTransform=function(e){var t=e.noCenter,n=e.textX,r=e.textY,i=e.targetX,a=e.targetY,o=e.anchorX||0,s=e.anchorY||0,c=e.rotate,l=e.scale;return l?l>1&&(l=1):l=0,u.strTranslate(i-l*(n+o),a-l*(r+s))+u.strScale(l)+(c?`rotate(`+c+(t?``:` `+n+` `+r)+`)`:``)},u.setTransormAndDisplay=function(e,t){e.attr(`transform`,u.getTextTransform(t)),e.style(`display`,t.scale?null:`none`)},u.ensureUniformFontSize=function(e,t){var n=u.extendFlat({},t);return n.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),n},u.join2=function(e,t,n){var r=e.length;return r>1?e.slice(0,-1).join(t)+n+e[r-1]:e.join(t)},u.bigFont=function(e){return Math.round(1.2*e)};var he=u.getFirefoxVersion(),ge=he!==null&&he<86;u.getPositionFromD3Event=function(){return ge?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}}),dt=h(()=>{var e=$(),t={"X,X div":`direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;border: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(r in t)n=r.replace(/^,/,` ,`).replace(/X/g,`.js-plotly-plot .plotly`).replace(/Y/g,`.plotly-notifier`),e.addStyleRule(n,t[r]);var n,r}),ft=h((e,t)=>{t.exports=!0}),pt=h((e,t)=>{var n=ft();t.exports=typeof window.matchMedia==`function`?!window.matchMedia(`(hover: none)`).matches:n}),mt=h((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,`defaultMaxListeners`,{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.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},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){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 p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}}),ht=h((e,t)=>{var n=mt().EventEmitter;t.exports={init:function(e){if(e._ev instanceof n)return e;var t=new n,r=new n;return e._ev=t,e._internalEv=r,e.on=t.on.bind(t),e.once=t.once.bind(t),e.removeListener=t.removeListener.bind(t),e.removeAllListeners=t.removeAllListeners.bind(t),e._internalOn=r.on.bind(r),e._internalOnce=r.once.bind(r),e._removeInternalListener=r.removeListener.bind(r),e._removeAllInternalListeners=r.removeAllListeners.bind(r),e.emit=function(e,n){t.emit(e,n),r.emit(e,n)},typeof e.addEventListener==`function`&&e.addEventListener(`wheel`,()=>{},{passive:!0}),e},triggerHandler:function(e,t,n){var r,i=e._ev;if(!i)return;var a=i._events[t];if(!a)return;function o(e){if(e.listener){if(i.removeListener(t,e.listener),!e.fired)return e.fired=!0,e.listener.apply(i,[n])}else return e.apply(i,[n])}a=Array.isArray(a)?a:[a];var s;for(s=0;s<a.length-1;s++)o(a[s]);return r=o(a[s]),r},purge:function(e){return delete e._ev,delete e.on,delete e.once,delete e.removeListener,delete e.removeAllListeners,delete e.emit,delete e._ev,delete e._internalEv,delete e._internalOn,delete e._internalOnce,delete e._removeInternalListener,delete e._removeAllInternalListeners,e}}}),gt=h((e,t)=>{var n=$(),r=Z().dfltConfig;function i(e,t){for(var r=[],i,a=0;a<t.length;a++)i=t[a],i===e?r[a]=i:typeof i==`object`?r[a]=Array.isArray(i)?n.extendDeep([],i):n.extendDeepAll({},i):r[a]=i;return r}var a={};a.add=function(e,t,n,i,a){var o,s;if(e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},s=e.undoQueue.index,e.autoplay){e.undoQueue.inSequence||(e.autoplay=!1);return}!e.undoQueue.sequence||e.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},e.undoQueue.queue.splice(s,e.undoQueue.queue.length-s,o),e.undoQueue.index+=1):o=e.undoQueue.queue[s-1],e.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(t),o.undo.args.unshift(n),o.redo.calls.push(i),o.redo.args.push(a)),e.undoQueue.queue.length>r.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--)},a.startSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},a.stopSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},a.undo=function(e){var t,n;if(!(e.undoQueue===void 0||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,n=0;n<t.undo.calls.length;n++)a.plotDo(e,t.undo.calls[n],t.undo.args[n]);e.undoQueue.inSequence=!1,e.autoplay=!1}},a.redo=function(e){var t,n;if(!(e.undoQueue===void 0||isNaN(e.undoQueue.index)||e.undoQueue.index>=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,n=0;n<t.redo.calls.length;n++)a.plotDo(e,t.redo.calls[n],t.redo.args[n]);e.undoQueue.inSequence=!1,e.autoplay=!1,e.undoQueue.index++}},a.plotDo=function(e,t,n){e.autoplay=!0,n=i(e,n),t.apply(null,n)},t.exports=a}),_t=h((e,t)=>{t.exports={_isLinkedToArray:`frames_entry`,group:{valType:`string`},name:{valType:`string`},traces:{valType:`any`},baseframe:{valType:`string`},data:{valType:`any`},layout:{valType:`any`}}}),vt=h(e=>{var t=Ke(),n=$(),r=W(),i=We(),a=_t(),o=Fe(),s=Z().configAttributes,c=Ie(),l=n.extendDeepAll,u=n.isPlainObject,d=n.isArrayOrTypedArray,f=n.nestedProperty,p=n.valObjectMeta,m=`_isSubplotObj`,h=`_isLinkedToArray`,g=`_arrayAttrRegexps`,_=`_deprecated`,v=[m,h,g,_];e.IS_SUBPLOT_OBJ=m,e.IS_LINKED_TO_ARRAY=h,e.DEPRECATED=_,e.UNDERSCORE_ATTRS=v,e.get=function(){var e={};return t.allTypes.forEach(function(t){e[t]=S(t)}),{defs:{valObjects:p,metaKeys:v.concat([`description`,`role`,`editType`,`impliedEdits`]),editType:{traces:c.traces,layout:c.layout},impliedEdits:{}},traces:e,layout:C(),frames:w(),animation:T(o),config:T(s)}},e.crawl=function(t,n,r,i){var a=r||0;i||=``,Object.keys(t).forEach(function(r){var o=t[r];if(v.indexOf(r)===-1){var s=(i?i+`.`:``)+r;n(o,r,t,a,s),!e.isValObject(o)&&u(o)&&r!==`impliedEdits`&&e.crawl(o,n,a+1,s)}})},e.isValObject=function(e){return e&&e.valType!==void 0},e.findArrayAttributes=function(t){var n=[],i=[],a=[],o,s;function c(e,t,n,r){i=i.slice(0,r).concat([t]),a=a.slice(0,r).concat([e&&e._isLinkedToArray]),e&&(e.valType===`data_array`||e.arrayOk===!0)&&!(i[r-1]===`colorbar`&&(t===`ticktext`||t===`tickvals`))&&l(o,0,``)}function l(e,t,r){var o=e[i[t]],c=r+i[t];if(t===i.length-1)d(o)&&n.push(s+c);else if(a[t]){if(Array.isArray(o))for(var f=0;f<o.length;f++)u(o[f])&&l(o[f],t+1,c+`[`+f+`].`)}else u(o)&&l(o,t+1,c+`.`)}return o=t,s=``,e.crawl(r,c),t._module&&t._module.attributes&&e.crawl(t._module.attributes,c),n},e.getTraceValObject=function(e,n){var i=n[0],a=1,o,s,c=e._module;if(c||=(t.modules[e.type||r.type.dflt]||{})._module,!c)return!1;if(o=c.attributes,s=o&&o[i],!s){var l=c.basePlotModule;l&&l.attributes&&(s=l.attributes[i])}return s||=r[i],b(s,n,a)},e.getLayoutValObject=function(e,t){return b(y(e,t[0]),t,1)};function y(e,n){var r,a,o,s,c=e._basePlotModules;if(c){var l;for(r=0;r<c.length;r++){if(o=c[r],o.attrRegex&&o.attrRegex.test(n)){if(o.layoutAttrOverrides)return o.layoutAttrOverrides;!l&&o.layoutAttributes&&(l=o.layoutAttributes)}var u=o.baseLayoutAttrOverrides;if(u&&n in u)return u[n]}if(l)return l}var d=e._modules;if(d){for(r=0;r<d.length;r++)if(s=d[r].layoutAttributes,s&&n in s)return s[n]}for(a in t.componentsRegistry){if(o=t.componentsRegistry[a],o.name===`colorscale`&&n.indexOf(`coloraxis`)===0)return o.layoutAttributes[n];if(!o.schema&&n===o.name)return o.layoutAttributes}return n in i?i[n]:!1}function b(e,t,n){if(!e)return!1;if(e._isLinkedToArray){if(x(t[n]))n++;else if(n<t.length)return!1}for(;n<t.length;n++){var r=e[t[n]];if(u(r))e=r;else break;if(n===t.length-1)break;if(e._isLinkedToArray){if(n++,!x(t[n]))return!1}else if(e.valType===`info_array`){n++;var i=t[n];if(!x(i))return!1;var a=e.items;if(Array.isArray(a)){if(i>=a.length)return!1;if(e.dimensions===2){if(n++,t.length===n)return e;var o=t[n];if(!x(o))return!1;e=a[i][o]}else e=a[i]}else e=a}}return e}function x(e){return e===Math.round(e)&&e>=0}function S(n){var i=t.modules[n]._module,a=i.basePlotModule,o={};o.type=null;var s=l({},r),c=l({},i.attributes);e.crawl(c,function(e,t,n,r,i){f(s,i).set(void 0),e===void 0&&f(c,i).set(void 0)}),l(o,s),t.traceIs(n,`noOpacity`)&&delete o.opacity,t.traceIs(n,`showLegend`)||(delete o.showlegend,delete o.legendgroup),t.traceIs(n,`noHover`)&&(delete o.hoverinfo,delete o.hoverlabel),i.selectPoints||delete o.selectedpoints,l(o,c),a.attributes&&l(o,a.attributes),o.type=n;var u={meta:i.meta||{},categories:i.categories||{},animatable:!!i.animatable,type:n,attributes:T(o)};if(i.layoutAttributes){var d={};l(d,i.layoutAttributes),u.layoutAttributes=T(d)}return i.animatable||e.crawl(u,function(t){e.isValObject(t)&&`anim`in t&&delete t.anim}),u}function C(){var e={},n,r;for(n in l(e,i),t.subplotsRegistry)if(r=t.subplotsRegistry[n],r.layoutAttributes)if(Array.isArray(r.attr))for(var a=0;a<r.attr.length;a++)k(e,r,r.attr[a]);else{var o=r.attr===`subplot`?r.name:r.attr;k(e,r,o)}for(n in t.componentsRegistry){r=t.componentsRegistry[n];var s=r.schema;if(s&&(s.subplots||s.layout)){var c=s.subplots;if(c&&c.xaxis&&!c.yaxis)for(var u in c.xaxis)delete e.yaxis[u];delete e.xaxis.shift,delete e.xaxis.autoshift}else r.name===`colorscale`?l(e,r.layoutAttributes):r.layoutAttributes&&A(e,r.layoutAttributes,r.name)}return{layoutAttributes:T(e)}}function w(){var e={frames:l({},a)};return T(e),e.frames}function T(e){return E(e),D(e),O(e),e}function E(t){function n(e){return{valType:`string`,editType:`none`}}function r(t,r,i){e.isValObject(t)?(t.arrayOk===!0||t.valType===`data_array`)&&(i[r+`src`]=n(r)):u(t)&&(t.role=`object`)}e.crawl(t,r)}function D(t){function n(e,t,n){if(e){var r=e[h];r&&(delete e[h],n[t]={items:{}},n[t].items[r]=e,n[t].role=`object`)}}e.crawl(t,n)}function O(e){function t(e){for(var n in e)if(u(e[n]))t(e[n]);else if(Array.isArray(e[n]))for(var r=0;r<e[n].length;r++)t(e[n][r]);else e[n]instanceof RegExp&&(e[n]=e[n].toString())}t(e)}function k(e,t,n){var r=f(e,n),i=l({},t.layoutAttributes);i[m]=!0,r.set(i)}function A(e,t,n){var r=f(e,n);r.set(l(r.get()||{},t))}}),yt=h(e=>{var t=$(),n=W(),r=`templateitemname`,i={name:{valType:`string`,editType:`none`}};i[r]={valType:`string`,editType:`calc`},e.templatedArray=function(e,t){return t._isLinkedToArray=e,t.name=i.name,t[r]=i[r],t},e.traceTemplater=function(e){var r={},i,a;for(i in e)a=e[i],Array.isArray(a)&&a.length&&(r[i]=0);function o(o){i=t.coerce(o,{},n,`type`);var s={type:i,_template:null};if(i in r){a=e[i];var c=r[i]%a.length;r[i]++,s._template=a[c]}return s}return{newTrace:o}},e.newContainer=function(e,n,r){var i=e._template,a=i&&(i[n]||r&&i[r]);return t.isPlainObject(a)||(a=null),e[n]={_template:a}},e.arrayTemplater=function(e,t,n){var i=e._template,s=i&&i[o(t)],c=i&&i[t];(!Array.isArray(c)||!c.length)&&(c=[]);var l={};function u(e){var t={name:e.name,_input:e},i=t[r]=e[r];if(!a(i))return t._template=s,t;for(var o=0;o<c.length;o++){var u=c[o];if(u.name===i)return l[i]=1,t._template=u,t}return t[n]=e[n]||!1,t._template=!1,t}function d(){for(var e=[],t=0;t<c.length;t++){var n=c[t],i=n.name;if(a(i)&&!l[i]){var o={_template:n,name:i,_input:{_templateitemname:i}};o[r]=n[r],e.push(o),l[i]=1}}return e}return{newItem:u,defaultItems:d}};function a(e){return e&&typeof e==`string`}function o(e){var n=e.length-1;return e.charAt(n)!==`s`&&t.warn(`bad argument to arrayDefaultKey: `+e),e.slice(0,-1)+`defaults`}e.arrayDefaultKey=o,e.arrayEditor=function(e,n,i){var a=(t.nestedProperty(e,n).get()||[]).length,o=i._index,s=o>=a&&(i._input||{})._templateitemname;s&&(o=a);var c=n+`[`+o+`]`,l;function u(){l={},s&&(l[c]={},l[c][r]=s)}u();function d(e,t){l[e]=t}function f(e,n){s?t.nestedProperty(l[c],e).set(n):l[c+`.`+e]=n}function p(){var e=l;return u(),e}function m(n,r){n&&f(n,r);var i=p();for(var a in i)t.nestedProperty(e,a).set(i[a])}return{modifyBase:d,modifyItem:f,getUpdateObj:p,applyUpdate:m}}}),bt=h((e,t)=>{var n=Y().counter;t.exports={idRegex:{x:n(`x`,`( domain)?`),y:n(`y`,`( domain)?`)},attrRegex:n(`[xy]axis`),xAxisMatch:n(`xaxis`),yAxisMatch:n(`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`}}),xt=h(e=>{var t=Ke(),n=bt();e.id2name=function(e){if(!(typeof e!=`string`||!e.match(n.AX_ID_PATTERN))){var t=e.split(` `)[0].slice(1);return t===`1`&&(t=``),e.charAt(0)+`axis`+t}},e.name2id=function(e){if(e.match(n.AX_NAME_PATTERN)){var t=e.slice(5);return t===`1`&&(t=``),e.charAt(0)+t}},e.cleanId=function(e,t,r){var i=/( domain)$/.test(e);if(!(typeof e!=`string`||!e.match(n.AX_ID_PATTERN))&&!(t&&e.charAt(0)!==t)&&!(i&&!r)){var a=e.split(` `)[0].slice(1).replace(/^0+/,``);return a===`1`&&(a=``),e.charAt(0)+a+(i&&r?` domain`:``)}},e.list=function(t,n,r){var i=t._fullLayout;if(!i)return[];var a=e.listIds(t,n),o=Array(a.length),s;for(s=0;s<a.length;s++){var c=a[s];o[s]=i[c.charAt(0)+`axis`+c.slice(1)]}if(!r){var l=i._subplots.gl3d||[];for(s=0;s<l.length;s++){var u=i[l[s]];n?o.push(u[n+`axis`]):o.push(u.xaxis,u.yaxis,u.zaxis)}}return o},e.listIds=function(e,t){var n=e._fullLayout;if(!n)return[];var r=n._subplots;return t?r[t+`axis`]:r.xaxis.concat(r.yaxis)},e.getFromId=function(t,n,r){var i=t._fullLayout;return n=n===void 0||typeof n!=`string`?n:n.replace(` domain`,``),r===`x`?n=n.replace(/y[0-9]*/,``):r===`y`&&(n=n.replace(/x[0-9]*/,``)),i[e.id2name(n)]},e.getFromTrace=function(n,r,i){var a=n._fullLayout,o=null;if(t.traceIs(r,`gl3d`)){var s=r.scene;s.slice(0,5)===`scene`&&(o=a[s][i+`axis`])}else o=e.getFromId(n,r[i+`axis`]||i);return o},e.idSort=function(e,t){var n=e.charAt(0),r=t.charAt(0);return n===r?(e.slice(1)||1)-+(t.slice(1)||1):n>r?1:-1},e.ref2id=function(e){return/^[xyz]/.test(e)?e.split(` `)[0]:!1};function r(e,t){if(t&&t.length){for(var n=0;n<t.length;n++)if(t[n][e])return!0}return!1}e.isLinked=function(e,t){return r(t,e._axisMatchGroups)||r(t,e._axisConstraintGroups)}}),St=h((e,t)=>{function n(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(`.outline-controllers`).remove()}function r(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(`.select-outline`).remove(),e._fullLayout._outlining=!1}t.exports={clearOutlineControllers:n,clearOutline:r}}),Ct=h((e,t)=>{t.exports={scattermode:{valType:`enumerated`,values:[`group`,`overlay`],dflt:`overlay`,editType:`calc`},scattergap:{valType:`number`,min:0,max:1,editType:`calc`}}}),wt=h(e=>{var t=Ke();bt().SUBPLOT_PATTERN,e.getSubplotCalcData=function(e,n,r){var i=t.subplotsRegistry[n];if(!i)return[];for(var a=i.attr,o=[],s=0;s<e.length;s++){var c=e[s];c[0].trace[a]===r&&o.push(c)}return o},e.getModuleCalcData=function(e,n,r){var i=[],a=[],o;if(o=typeof n==`string`?t.getModule(n).plot:typeof n==`function`?n:n.plot,!o)return[i,e];for(var s=r,c=0;c<e.length;c++){var l=e[c],u=l[0].trace,d=u.zorder!==void 0;u.visible!==!0||u._length===0||(u._module&&u._module.plot===o&&(!d||u.zorder===s)?i.push(l):a.push(l))}return[i,a]},e.getSubplotData=function(e,n,r){if(!t.subplotsRegistry[n])return[];for(var i=t.subplotsRegistry[n].attr,a=[],o,s=0;s<e.length;s++)o=e[s],o[i]===r&&a.push(o);return a}}),Tt=h(e=>{var t=Ke(),n=$();e.manageCommandObserver=function(t,i,a,o){var s={},c=!0;i&&i._commandObserver&&(s=i._commandObserver),s.cache||={},s.lookupTable={};var l=e.hasSimpleAPICommandBindings(t,a,s.lookupTable);if(i&&i._commandObserver){if(l)return s;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,s}if(l){r(t,l,s.cache),s.check=function(){if(c){var e=r(t,l,s.cache);return e.changed&&o&&s.lookupTable[e.value]!==void 0&&(s.disable(),Promise.resolve(o({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=[`plotly_relayout`,`plotly_redraw`,`plotly_restyle`,`plotly_update`,`plotly_animatingframe`,`plotly_afterplot`],d=0;d<u.length;d++)t._internalOn(u[d],s.check);s.remove=function(){for(var e=0;e<u.length;e++)t._removeInternalListener(u[e],s.check)}}else n.log(`Unable to automatically bind plot updates to API command`),s.lookupTable={},s.remove=function(){};return s.disable=function(){c=!1},s.enable=function(){c=!0},i&&(i._commandObserver=s),s},e.hasSimpleAPICommandBindings=function(t,n,r){var i,a=n.length,o;for(i=0;i<a;i++){var s,c=n[i],l=c.method,u=c.args;if(Array.isArray(u)||(u=[]),!l)return!1;var d=e.computeAPICommandBindings(t,l,u);if(d.length!==1)return!1;if(!o)o=d[0],Array.isArray(o.traces)&&o.traces.sort();else{if(s=d[0],s.type!==o.type||s.prop!==o.prop)return!1;if(Array.isArray(o.traces))if(Array.isArray(s.traces)){s.traces.sort();for(var f=0;f<o.traces.length;f++)if(o.traces[f]!==s.traces[f])return!1}else return!1;else if(s.prop!==o.prop)return!1}s=d[0];var p=s.value;if(Array.isArray(p))if(p.length===1)p=p[0];else return!1;r&&(r[p]=i)}return o};function r(e,t,r){var i,a,o,s=!1;if(t.type===`data`)i=e._fullData[t.traces===null?0:t.traces[0]];else if(t.type===`layout`)i=e._fullLayout;else return!1;return a=n.nestedProperty(i,t.prop).get(),o=r[t.type]=r[t.type]||{},o.hasOwnProperty(t.prop)&&o[t.prop]!==a&&(s=!0),o[t.prop]=a,{changed:s,value:a}}e.executeAPICommand=function(e,r,i){if(r===`skip`)return Promise.resolve();var a=t.apiMethodRegistry[r],o=[e];Array.isArray(i)||(i=[]);for(var s=0;s<i.length;s++)o.push(i[s]);return a.apply(null,o).catch(function(e){return n.warn(`API call to Plotly.`+r+` rejected.`,e),Promise.reject(e)})},e.computeAPICommandBindings=function(e,t,n){var r;switch(Array.isArray(n)||(n=[]),t){case`restyle`:r=o(e,n);break;case`relayout`:r=a(e,n);break;case`update`:r=o(e,[n[0],n[2]]).concat(a(e,[n[1]]));break;case`animate`:r=i(e,n);break;default:r=[]}return r};function i(e,t){return Array.isArray(t[0])&&t[0].length===1&&[`string`,`number`].indexOf(typeof t[0][0])!==-1?[{type:`layout`,prop:`_currentFrame`,value:t[0][0].toString()}]:[]}function a(e,t){var r=[],i=t[0],a={};if(typeof i==`string`)a[i]=t[1];else if(n.isPlainObject(i))a=i;else return r;return s(a,function(e,t,n){r.push({type:`layout`,prop:e,value:n})},``,0),r}function o(e,t){var r,i,a,o,c=[];if(i=t[0],a=t[1],r=t[2],o={},typeof i==`string`)o[i]=a;else if(n.isPlainObject(i))o=i,r===void 0&&(r=a);else return c;return r===void 0&&(r=null),s(o,function(t,n,i){var a,o;if(Array.isArray(i)){o=i.slice();var s=Math.min(o.length,e.data.length);r&&(s=Math.min(s,r.length)),a=[];for(var l=0;l<s;l++)a[l]=r?r[l]:l}else o=i,a=r?r.slice():null;if(a===null)Array.isArray(o)&&(o=o[0]);else if(Array.isArray(a)){if(!Array.isArray(o)){var u=o;o=[];for(var d=0;d<a.length;d++)o[d]=u}o.length=Math.min(a.length,o.length)}c.push({type:`data`,prop:t,traces:a,value:o})},``,0),c}function s(e,t,r,i){Object.keys(e).forEach(function(a){var o=e[a];if(a[0]!==`_`){var c=r+(i>0?`.`:``)+a;n.isPlainObject(o)?s(o,t,c,i+1):t(c,a,o)}})}}),Et=h((e,t)=>{var n=S(),r=w().timeFormatLocale,i=T().formatLocale,a=D(),o=k(),s=Ke(),c=vt(),l=yt(),u=$(),d=q(),f=O().BADNUM,p=xt(),m=St().clearOutline,h=Ct(),g=Fe(),_=_t(),v=wt().getModuleCalcData,y=u.relinkPrivateKeys,b=u._,x=t.exports={};u.extendFlat(x,s),x.attributes=W(),x.attributes.type.values=x.allTypes,x.fontAttrs=B(),x.layoutAttributes=We();var C=Tt();x.executeAPICommand=C.executeAPICommand,x.computeAPICommandBindings=C.computeAPICommandBindings,x.manageCommandObserver=C.manageCommandObserver,x.hasSimpleAPICommandBindings=C.hasSimpleAPICommandBindings,x.redrawText=function(e){return e=u.getGraphDiv(e),new Promise(function(t){setTimeout(function(){e._fullLayout&&(s.getComponentMethod(`annotations`,`draw`)(e),s.getComponentMethod(`legend`,`draw`)(e),s.getComponentMethod(`colorbar`,`draw`)(e),t(x.previousPromises(e)))},300)})},x.resize=function(e){e=u.getGraphDiv(e);var t,n=new Promise(function(n,r){(!e||u.isHidden(e))&&r(Error(`Resize must be passed a displayed plot div element.`)),e._redrawTimer&&clearTimeout(e._redrawTimer),e._resolveResize&&(t=e._resolveResize),e._resolveResize=n,e._redrawTimer=setTimeout(function(){if(!e.layout||e.layout.width&&e.layout.height||u.isHidden(e)){n(e);return}delete e.layout.width,delete e.layout.height;var t=e.changed;e.autoplay=!0,s.call(`relayout`,e,{autosize:!0}).then(function(){e.changed=t,e._resolveResize===n&&(delete e._resolveResize,n(e))})},100)});return t&&t(n),n},x.previousPromises=function(e){if((e._promises||[]).length)return Promise.all(e._promises).then(function(){e._promises=[]})},x.addLinks=function(e){if(!(!e._context.showLink&&!e._context.showSources)){var t=e._fullLayout,r=u.ensureSingle(t._paper,`text`,`js-plot-link-container`,function(e){e.style({"font-family":`"Open Sans", Arial, sans-serif`,"font-size":`12px`,fill:d.defaultLine,"pointer-events":`all`}).each(function(){var e=n.select(this);e.append(`tspan`).classed(`js-link-to-tool`,!0),e.append(`tspan`).classed(`js-link-spacer`,!0),e.append(`tspan`).classed(`js-sourcelinks`,!0)})}),i=r.node(),a={y:t._paper.attr(`height`)-9};document.body.contains(i)&&i.getComputedTextLength()>=t.width-20?(a[`text-anchor`]=`start`,a.x=5):(a[`text-anchor`]=`end`,a.x=t._paper.attr(`width`)-7),r.attr(a);var o=r.select(`.js-link-to-tool`),s=r.select(`.js-link-spacer`),c=r.select(`.js-sourcelinks`);e._context.showSources&&e._context.showSources(e),e._context.showLink&&E(e,o),s.text(o.text()&&c.text()?` - `:``)}};function E(e,t){t.text(``);var n=t.append(`a`).attr({"xlink:xlink:href":`#`,class:`link--impt link--embedview`,"font-weight":`bold`}).text(e._context.linkText+` »`);if(e._context.sendData)n.on(`click`,function(){x.sendDataToCloud(e)});else{var r=window.location.pathname.split(`/`),i=window.location.search;n.attr({"xlink:xlink:show":`new`,"xlink:xlink:href":`/`+r[2].split(`.`)[0]+`/`+r[1]+i})}}x.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit(`plotly_beforeexport`);var r=n.select(e).append(`div`).attr(`id`,`hiddenform`).style(`display`,`none`),i=r.append(`form`).attr({action:t+`/external`,method:`post`,target:`_blank`}),a=i.append(`input`).attr({type:`text`,name:`data`});return a.node().value=x.graphJson(e,!1,`keepdata`),i.node().submit(),r.remove(),e.emit(`plotly_afterexport`),!1}};var A=[`days`,`shortDays`,`months`,`shortMonths`,`periods`,`dateTime`,`date`,`time`,`decimal`,`thousands`,`grouping`,`currency`],j=[`year`,`month`,`dayMonth`,`dayMonthYear`];x.supplyDefaults=function(e,t){var n=t&&t.skipUpdateCalc,r=e._fullLayout||{};if(r._skipDefaults){delete r._skipDefaults;return}var i=e._fullLayout={},a=e.layout||{},o=e._fullData||[],c=e._fullData=[],l=e.data||[],d=e.calcdata||[],f=e._context||{},p;e._transitionData||x.createTransitionData(e),i._dfltTitle={plot:b(e,`Click to enter Plot title`),subtitle:b(e,`Click to enter Plot subtitle`),x:b(e,`Click to enter X axis title`),y:b(e,`Click to enter Y axis title`),colorbar:b(e,`Click to enter Colorscale title`),annotation:b(e,`new text`)},i._traceWord=b(e,`trace`);var h=P(e,A);if(i._mapboxAccessToken=f.mapboxAccessToken,r._initialAutoSizeIsDone){var g=r.width,_=r.height;x.supplyLayoutGlobalDefaults(a,i,h),a.width||(i.width=g),a.height||(i.height=_),x.sanitizeMargins(i)}else{x.supplyLayoutGlobalDefaults(a,i,h);var v=!a.width||!a.height,S=i.autosize,C=f.autosizable;v&&(S||C)?x.plotAutoSize(e,a,i):v&&x.sanitizeMargins(i),!S&&v&&(a.width=i.width,a.height=i.height)}i._d3locale=F(h,i.separators),i._extraFormat=P(e,j),i._initialAutoSizeIsDone=!0,i._dataLength=l.length,i._modules=[],i._visibleModules=[],i._basePlotModules=[];var w=i._subplots=N(),T=i._splomAxes={x:{},y:{}},E=i._splomSubplots={};i._splomGridDflt={},i._scatterStackOpts={},i._firstScatter={},i._alignmentOpts={},i._colorAxes={},i._requestRangeslider={},i._traceUids=M(o,l),x.supplyDataDefaults(l,c,a,i);var D=Object.keys(T.x),O=Object.keys(T.y);if(D.length>1&&O.length>1){for(s.getComponentMethod(`grid`,`sizeDefaults`)(a,i),p=0;p<D.length;p++)u.pushUnique(w.xaxis,D[p]);for(p=0;p<O.length;p++)u.pushUnique(w.yaxis,O[p]);for(var k in E)u.pushUnique(w.cartesian,k)}if(i._has=x._hasPlotType.bind(i),o.length===c.length)for(p=0;p<c.length;p++)y(c[p],o[p]);x.supplyLayoutModuleDefaults(a,i,c,e._transitionData);var L=i._visibleModules,R=[];for(p=0;p<L.length;p++){var B=L[p].crossTraceDefaults;B&&u.pushUnique(R,B)}for(p=0;p<R.length;p++)R[p](c,i);i._hasOnlyLargeSploms=i._basePlotModules.length===1&&i._basePlotModules[0].name===`splom`&&D.length>15&&O.length>15&&i.shapes.length===0&&i.images.length===0,x.linkSubplots(c,i,o,r),x.cleanPlot(c,i,o,r);var V=!!(r._has&&r._has(`cartesian`)),H=!!(i._has&&i._has(`cartesian`)),U=V,W=H;U&&!W?r._bgLayer.remove():W&&!U&&(i._shouldCreateBgLayer=!0),r._zoomlayer&&!e._dragging&&m({_fullLayout:r}),I(c,i),y(i,r),s.getComponentMethod(`colorscale`,`crossTraceDefaults`)(c,i),i._preGUI||={},i._tracePreGUI||={};var G=i._tracePreGUI,K={},q;for(q in G)K[q]=`old`;for(p=0;p<c.length;p++)q=c[p]._fullInput.uid,K[q]||(G[q]={}),K[q]=`new`;for(q in K)K[q]===`old`&&delete G[q];z(i),s.getComponentMethod(`rangeslider`,`makeData`)(i),!n&&d.length===c.length&&x.supplyDefaultsUpdateCalc(d,c)},x.supplyDefaultsUpdateCalc=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=(e[n]||[])[0];if(i&&i.trace){var a=i.trace;if(a._hasCalcTransform){var o=a._arrayAttrs,s,c,l;for(s=0;s<o.length;s++)c=o[s],l=u.nestedProperty(a,c).get().slice(),u.nestedProperty(r,c).set(l)}i.trace=r}}};function M(e,t){var n=t.length,r=[],i,a;for(i=0;i<e.length;i++){var o=e[i]._fullInput;o!==a&&r.push(o),a=o}var s=r.length,c=Array(n),l={};function d(e,t){c[t]=e,l[e]=1}function f(e,t){if(e&&typeof e==`string`&&!l[e])return d(e,t),!0}for(i=0;i<n;i++){var p=t[i].uid;typeof p==`number`&&(p=String(p)),!f(p,i)&&(i<s&&f(r[i].uid,i)||d(u.randstr(l),i))}return c}function N(){var e=s.collectableSubplotTypes,t={},n,r;if(!e){e=[];var i=s.subplotsRegistry;for(var a in i){var o=i[a].attr;if(o&&(e.push(a),Array.isArray(o)))for(r=0;r<o.length;r++)u.pushUnique(e,o[r])}}for(n=0;n<e.length;n++)t[e[n]]=[];return t}function P(e,t){var n=e._context.locale;n||=`en-US`;var r=!1,i={};function a(e){for(var n=!0,a=0;a<t.length;a++){var o=t[a];i[o]||(e[o]?i[o]=e[o]:n=!1)}n&&(r=!0)}for(var o=0;o<2;o++){for(var c=e._context.locales,l=0;l<2;l++){var u=(c[n]||{}).format;if(u&&(a(u),r))break;c=s.localeRegistry}var d=n.split(`-`)[0];if(r||d===n)break;n=d}return r||a(s.localeRegistry.en.format),i}function F(e,t){return e.decimal=t.charAt(0),e.thousands=t.charAt(1),{numberFormat:function(t){try{t=i(e).format(u.adjustFormat(t))}catch{return u.warnBadFormat(t),u.noFormat}return t},timeFormat:r(e).utcFormat}}function I(e,t){var n,r=[];t.meta&&(n=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var i=0;i<e.length;i++){var a=e[i];a.meta?r[a.index]=a._meta={meta:a.meta}:t.meta&&(a._meta={meta:t.meta}),t.meta&&(a._meta.layout={meta:t.meta})}r.length&&(n||=t._meta={},n.data=r)}x.createTransitionData=function(e){e._transitionData||={},e._transitionData._frames||(e._transitionData._frames=[]),e._transitionData._frameHash||(e._transitionData._frameHash={}),e._transitionData._counter||(e._transitionData._counter=0),e._transitionData._interruptCallbacks||(e._transitionData._interruptCallbacks=[])},x._hasPlotType=function(e){var t,n=this._basePlotModules||[];for(t=0;t<n.length;t++)if(n[t].name===e)return!0;var r=this._modules||[];for(t=0;t<r.length;t++){var i=r[t].name;if(i===e)return!0;var a=s.modules[i];if(a&&a.categories[e])return!0}return!1},x.cleanPlot=function(e,t,n,r){var i,a,o=r._basePlotModules||[];for(i=0;i<o.length;i++){var s=o[i];s.clean&&s.clean(e,t,n,r)}var c=r._has&&r._has(`gl`),l=t._has&&t._has(`gl`);c&&!l&&r._glcontainer!==void 0&&(r._glcontainer.selectAll(`.gl-canvas`).remove(),r._glcontainer.selectAll(`.no-webgl`).remove(),r._glcanvas=null);var u=!!r._infolayer;e:for(i=0;i<n.length;i++){var d=n[i].uid;for(a=0;a<e.length;a++)if(d===e[a].uid)continue e;u&&r._infolayer.select(`.cb`+d).remove()}},x.linkSubplots=function(e,t,n,r){var i,a,o=r._plots||{},c=t._plots={},l=t._subplots,d={_fullData:e,_fullLayout:t},f=l.cartesian||[];for(i=0;i<f.length;i++){var m=f[i],h=o[m],g=p.getFromId(d,m,`x`),_=p.getFromId(d,m,`y`),v;for(h?v=c[m]=h:(v=c[m]={},v.id=m),g._counterAxes.push(_._id),_._counterAxes.push(g._id),g._subplotsWith.push(m),_._subplotsWith.push(m),v.xaxis=g,v.yaxis=_,v._hasClipOnAxisFalse=!1,a=0;a<e.length;a++){var y=e[a];if(y.xaxis===v.xaxis._id&&y.yaxis===v.yaxis._id&&y.cliponaxis===!1){v._hasClipOnAxisFalse=!0;break}}}var b=p.list(d,null,!0),x;for(i=0;i<b.length;i++){x=b[i];var S=null;x.overlaying&&(S=p.getFromId(d,x.overlaying),S&&S.overlaying&&(x.overlaying=!1,S=null)),x._mainAxis=S||x,S&&(x.domain=S.domain.slice()),x._anchorAxis=x.anchor===`free`?null:p.getFromId(d,x.anchor)}for(i=0;i<b.length;i++)if(x=b[i],x._counterAxes.sort(p.idSort),x._subplotsWith.sort(u.subplotSort),x._mainSubplot=L(x,t),x._counterAxes.length&&(x.spikemode&&x.spikemode.indexOf(`across`)!==-1||x.automargin&&x.mirror&&x.anchor!==`free`||s.getComponentMethod(`rangeslider`,`isVisible`)(x))){var C=1,w=0;for(a=0;a<x._counterAxes.length;a++){var T=p.getFromId(d,x._counterAxes[a]);C=Math.min(C,T.domain[0]),w=Math.max(w,T.domain[1])}C<w&&(x._counterDomainMin=C,x._counterDomainMax=w)}};function L(e,t){var n={_fullLayout:t},r=e._id.charAt(0)===`x`,i=e._mainAxis._anchorAxis,a=``,o=``,s=``;if(i&&(s=i._mainAxis._id,a=r?e._id+s:s+e._id),!a||!t._plots[a]){a=``;for(var c=e._counterAxes,l=0;l<c.length;l++){var u=c[l],d=r?e._id+u:u+e._id;o||=d;var f=p.getFromId(n,u);if(s&&f.overlaying===s){a=d;break}}}return a||o}x.clearExpandedTraceDefaultColors=function(e){var t,n,r;function i(e,r,i,a){n[a]=r,n.length=a+1,e.valType===`color`&&e.dflt===void 0&&t.push(n.join(`.`))}for(n=[],t=e._module._colorAttrs,t||(e._module._colorAttrs=t=[],c.crawl(e._module.attributes,i)),r=0;r<t.length;r++)u.nestedProperty(e,`_input.`+t[r]).get()||u.nestedProperty(e,t[r]).set(null)},x.supplyDataDefaults=function(e,t,n,r){var i=r._modules,a=r._visibleModules,o=r._basePlotModules,c=0,d=0,f,p,m;r._transformModules=[];function h(e){t.push(e);var n=e._module;n&&(u.pushUnique(i,n),e.visible===!0&&u.pushUnique(a,n),u.pushUnique(o,e._module.basePlotModule),c++,e._input.visible!==!1&&d++)}var g={},_=[],v=(n.template||{}).data||{},y=l.traceTemplater(v);for(f=0;f<e.length;f++)m=e[f],p=y.newTrace(m),p.uid=r._traceUids[f],x.supplyTraceDefaults(m,p,d,r,f),p.index=f,p._input=m,p._fullInput=p,h(p),s.traceIs(p,`carpetAxis`)&&(g[p.carpet]=p),s.traceIs(p,`carpetDependent`)&&_.push(f);for(f=0;f<_.length;f++)if(p=t[_[f]],p.visible){var b=g[p.carpet];if(p._carpet=b,!b||!b.visible){p.visible=!1;continue}p.xaxis=b.xaxis,p.yaxis=b.yaxis}},x.supplyAnimationDefaults=function(e){e||={};var t,n={};function r(t,r){return u.coerce(e||{},n,g,t,r)}if(r(`mode`),r(`direction`),r(`fromcurrent`),Array.isArray(e.frame))for(n.frame=[],t=0;t<e.frame.length;t++)n.frame[t]=x.supplyAnimationFrameDefaults(e.frame[t]||{});else n.frame=x.supplyAnimationFrameDefaults(e.frame||{});if(Array.isArray(e.transition))for(n.transition=[],t=0;t<e.transition.length;t++)n.transition[t]=x.supplyAnimationTransitionDefaults(e.transition[t]||{});else n.transition=x.supplyAnimationTransitionDefaults(e.transition||{});return n},x.supplyAnimationFrameDefaults=function(e){var t={};function n(n,r){return u.coerce(e||{},t,g.frame,n,r)}return n(`duration`),n(`redraw`),t},x.supplyAnimationTransitionDefaults=function(e){var t={};function n(n,r){return u.coerce(e||{},t,g.transition,n,r)}return n(`duration`),n(`easing`),t},x.supplyFrameDefaults=function(e){var t={};function n(n,r){return u.coerce(e,t,_,n,r)}return n(`group`),n(`name`),n(`traces`),n(`baseframe`),n(`data`),n(`layout`),t},x.supplyTraceDefaults=function(e,t,n,r,i){var a=r.colorway||d.defaults,o=a[n%a.length],c;function l(n,r){return u.coerce(e,t,x.attributes,n,r)}var f=l(`visible`);l(`type`),l(`name`,r._traceWord+` `+i),l(`uirevision`,r.uirevision);var p=x.getModule(t);if(t._module=p,p){var m=p.basePlotModule,h=m.attr,g=m.attributes;if(h&&g){var _=r._subplots,v=``;if(Array.isArray(h))for(c=0;c<h.length;c++){var y=h[c],b=u.coerce(e,t,g,y);_[y]&&u.pushUnique(_[y],b),v+=b}else v=u.coerce(e,t,g,h);_[m.name]&&u.pushUnique(_[m.name],v)}}if(f&&(l(`customdata`),l(`ids`),l(`meta`),s.traceIs(t,`showLegend`)?(u.coerce(e,t,p.attributes.showlegend?p.attributes:x.attributes,`showlegend`),u.coerce(e,t,p.attributes.legend?p.attributes:x.attributes,`legend`),l(`legendwidth`),l(`legendgroup`),l(`legendgrouptitle.text`),l(`legendrank`),t._dfltShowLegend=!0):t._dfltShowLegend=!1,p&&p.supplyDefaults(e,t,o,r),s.traceIs(t,`noOpacity`)||l(`opacity`),s.traceIs(t,`notLegendIsolatable`)&&(t.visible=!!t.visible),s.traceIs(t,`noHover`)||(t.hovertemplate||u.coerceHoverinfo(e,t,r),t.type!==`parcats`&&s.getComponentMethod(`fx`,`supplyDefaults`)(e,t,o,r)),p&&p.selectPoints)){var S=l(`selectedpoints`);u.isTypedArray(S)&&(t.selectedpoints=Array.from(S))}return t},x.supplyLayoutGlobalDefaults=function(e,t,n){function r(n,r){return u.coerce(e,t,x.layoutAttributes,n,r)}var i=e.template;u.isPlainObject(i)&&(t.template=i,t._template=i.layout,t._dataTemplate=i.data),r(`autotypenumbers`);var a=u.coerceFont(r,`font`),o=a.size;u.coerceFont(r,`title.font`,a,{overrideDflt:{size:Math.round(o*1.4)}}),r(`title.text`,t._dfltTitle.plot),r(`title.xref`);var c=r(`title.yref`);r(`title.pad.t`),r(`title.pad.r`),r(`title.pad.b`),r(`title.pad.l`);var l=r(`title.automargin`);r(`title.x`),r(`title.xanchor`),r(`title.y`),r(`title.yanchor`),r(`title.subtitle.text`,t._dfltTitle.subtitle),u.coerceFont(r,`title.subtitle.font`,a,{overrideDflt:{size:Math.round(t.title.font.size*.7)}}),l&&(c===`paper`&&(t.title.y!==0&&(t.title.y=1),t.title.yanchor===`auto`&&(t.title.yanchor=t.title.y===0?`top`:`bottom`)),c===`container`&&(t.title.y===`auto`&&(t.title.y=1),t.title.yanchor===`auto`&&(t.title.yanchor=t.title.y<.5?`bottom`:`top`))),r(`uniformtext.mode`)&&r(`uniformtext.minsize`),r(`autosize`,!(e.width&&e.height)),r(`width`),r(`height`),r(`minreducedwidth`),r(`minreducedheight`),r(`margin.l`),r(`margin.r`),r(`margin.t`),r(`margin.b`),r(`margin.pad`),r(`margin.autoexpand`),e.width&&e.height&&x.sanitizeMargins(t),s.getComponentMethod(`grid`,`sizeDefaults`)(e,t),r(`paper_bgcolor`),r(`separators`,n.decimal+n.thousands),r(`hidesources`),r(`colorway`),r(`datarevision`);var d=r(`uirevision`);r(`editrevision`,d),r(`selectionrevision`,d),s.getComponentMethod(`modebar`,`supplyLayoutDefaults`)(e,t),s.getComponentMethod(`shapes`,`supplyDrawNewShapeDefaults`)(e,t,r),s.getComponentMethod(`selections`,`supplyDrawNewSelectionDefaults`)(e,t,r),r(`meta`),u.isPlainObject(e.transition)&&(r(`transition.duration`),r(`transition.easing`),r(`transition.ordering`)),s.getComponentMethod(`calendars`,`handleDefaults`)(e,t,`calendar`),s.getComponentMethod(`fx`,`supplyLayoutGlobalDefaults`)(e,t,r),u.coerce(e,t,h,`scattermode`)};function R(e){return typeof e==`string`&&e.slice(-2)===`px`&&parseFloat(e)}x.plotAutoSize=function(e,t,n){var r=e._context||{},i=r.frameMargins,o,s,c=u.isPlotDiv(e);if(c&&e.emit(`plotly_autosize`),r.fillFrame)o=window.innerWidth,s=window.innerHeight,document.body.style.overflow=`hidden`;else{var l=c?window.getComputedStyle(e):{};if(o=R(l.width)||R(l.maxWidth)||n.width,s=R(l.height)||R(l.maxHeight)||n.height,a(i)&&i>0){var d=1-2*i;o=Math.round(d*o),s=Math.round(d*s)}}var f=x.layoutAttributes.width.min,p=x.layoutAttributes.height.min;o<f&&(o=f),s<p&&(s=p);var m=!t.width&&Math.abs(n.width-o)>1,h=!t.height&&Math.abs(n.height-s)>1;(h||m)&&(m&&(n.width=o),h&&(n.height=s)),e._initialAutoSize||={width:o,height:s},x.sanitizeMargins(n)},x.supplyLayoutModuleDefaults=function(e,t,n,r){var i=s.componentsRegistry,a=t._basePlotModules,o,c,l,d=s.subplotsRegistry.cartesian;for(o in i)l=i[o],l.includeBasePlot&&l.includeBasePlot(e,t);for(var f in a.length||a.push(d),t._has(`cartesian`)&&(s.getComponentMethod(`grid`,`contentDefaults`)(e,t),d.finalizeSubplots(e,t)),t._subplots)t._subplots[f].sort(u.subplotSort);for(c=0;c<a.length;c++)l=a[c],l.supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,n);var p=t._modules;for(c=0;c<p.length;c++)l=p[c],l.supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,n);var m=t._transformModules;for(c=0;c<m.length;c++)l=m[c],l.supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,n,r);for(o in i)l=i[o],l.supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,n)},x.purge=function(e){var t=e._fullLayout||{};t._glcontainer!==void 0&&(t._glcontainer.selectAll(`.gl-canvas`).remove(),t._glcontainer.remove(),t._glcanvas=null),t._modeBar&&t._modeBar.destroy(),e._transitionData&&(e._transitionData._interruptCallbacks&&(e._transitionData._interruptCallbacks.length=0),e._transitionData._animationRaf&&window.cancelAnimationFrame(e._transitionData._animationRaf)),u.clearThrottle(),u.clearResponsive(e),delete e.data,delete e.layout,delete e._fullData,delete e._fullLayout,delete e.calcdata,delete e.empty,delete e.fid,delete e.undoqueue,delete e.undonum,delete e.autoplay,delete e.changed,delete e._promises,delete e._redrawTimer,delete e._hmlumcount,delete e._hmpixcount,delete e._transitionData,delete e._transitioning,delete e._initialAutoSize,delete e._transitioningWithDuration,delete e._dragging,delete e._dragged,delete e._dragdata,delete e._hoverdata,delete e._snapshotInProgress,delete e._editing,delete e._mouseDownTime,delete e._legendMouseDownTime,e.removeAllListeners&&e.removeAllListeners()},x.style=function(e){var t=e._fullLayout._visibleModules,n=[],r;for(r=0;r<t.length;r++){var i=t[r];i.style&&u.pushUnique(n,i.style)}for(r=0;r<n.length;r++)n[r](e)},x.sanitizeMargins=function(e){if(!(!e||!e.margin)){var t=e.width,n=e.height,r=e.margin,i=t-(r.l+r.r),a=n-(r.t+r.b),o;i<0&&(o=(t-1)/(r.l+r.r),r.l=Math.floor(o*r.l),r.r=Math.floor(o*r.r)),a<0&&(o=(n-1)/(r.t+r.b),r.t=Math.floor(o*r.t),r.b=Math.floor(o*r.b))}},x.clearAutoMarginIds=function(e){e._fullLayout._pushmarginIds={}},x.allowAutoMargin=function(e,t){e._fullLayout._pushmarginIds[t]=1};function z(e){var t=e.margin;if(!e._size){var n=e._size={l:Math.round(t.l),r:Math.round(t.r),t:Math.round(t.t),b:Math.round(t.b),p:Math.round(t.pad)};n.w=Math.round(e.width)-n.l-n.r,n.h=Math.round(e.height)-n.t-n.b}e._pushmargin||={},e._pushmarginIds||={},e._reservedMargin||={}}var V=2,H=2;x.autoMargin=function(e,t,n){var r=e._fullLayout,i=r.width,a=r.height,o=r.margin,s=r.minreducedwidth,c=r.minreducedheight,l=u.constrain(i-o.l-o.r,V,s),d=u.constrain(a-o.t-o.b,H,c),f=Math.max(0,i-l),p=Math.max(0,a-d),m=r._pushmargin,h=r._pushmarginIds;if(o.autoexpand!==!1){if(!n)delete m[t],delete h[t];else{var g=n.pad;if(g===void 0&&(g=Math.min(12,o.l,o.r,o.t,o.b)),f){var _=(n.l+n.r)/f;_>1&&(n.l/=_,n.r/=_)}if(p){var v=(n.t+n.b)/p;v>1&&(n.t/=v,n.b/=v)}var y=n.xl===void 0?n.x:n.xl,b=n.xr===void 0?n.x:n.xr,S=n.yt===void 0?n.y:n.yt,C=n.yb===void 0?n.y:n.yb;m[t]={l:{val:y,size:n.l+g},r:{val:b,size:n.r+g},b:{val:C,size:n.b+g},t:{val:S,size:n.t+g}},h[t]=1}if(!r._replotting)return x.doAutoMargin(e)}};function U(e){if(`_redrawFromAutoMarginCount`in e._fullLayout)return!1;var t=p.list(e,``,!0);for(var n in t)if(t[n].autoshift||t[n].shift)return!0;return!1}x.doAutoMargin=function(e){var t=e._fullLayout,n=t.width,r=t.height;t._size||={},z(t);var i=t._size,o=t.margin,c={t:0,b:0,l:0,r:0},l=u.extendFlat({},i),d=o.l,f=o.r,p=o.t,m=o.b,h=t._pushmargin,g=t._pushmarginIds,_=t.minreducedwidth,v=t.minreducedheight;if(o.autoexpand!==!1){for(var y in h)g[y]||delete h[y];var b=e._fullLayout._reservedMargin;for(var S in b)for(var C in b[S]){var w=b[S][C];c[C]=Math.max(c[C],w)}for(var T in h.base={l:{val:0,size:d},r:{val:1,size:f},t:{val:1,size:p},b:{val:0,size:m}},c){var E=0;for(var D in h)D!==`base`&&a(h[D][T].size)&&(E=h[D][T].size>E?h[D][T].size:E);var O=Math.max(0,o[T]-E);c[T]=Math.max(0,c[T]-O)}for(var k in h){var A=h[k].l||{},j=h[k].b||{},M=A.val,N=A.size,P=j.val,F=j.size,I=n-c.r-c.l,L=r-c.t-c.b;for(var R in h){if(a(N)&&h[R].r){var B=h[R].r.val,W=h[R].r.size;if(B>M){var K=(N*B+(W-I)*M)/(B-M),q=(W*(1-M)+(N-I)*(1-B))/(B-M);K+q>d+f&&(d=K,f=q)}}if(a(F)&&h[R].t){var J=h[R].t.val,Y=h[R].t.size;if(J>P){var X=(F*J+(Y-L)*P)/(J-P),Z=(Y*(1-P)+(F-L)*(1-J))/(J-P);X+Z>m+p&&(m=X,p=Z)}}}}}var Q=u.constrain(n-o.l-o.r,V,_),ee=u.constrain(r-o.t-o.b,H,v),te=Math.max(0,n-Q),ne=Math.max(0,r-ee);if(te){var re=(d+f)/te;re>1&&(d/=re,f/=re)}if(ne){var ie=(m+p)/ne;ie>1&&(m/=ie,p/=ie)}if(i.l=Math.round(d)+c.l,i.r=Math.round(f)+c.r,i.t=Math.round(p)+c.t,i.b=Math.round(m)+c.b,i.p=Math.round(o.pad),i.w=Math.round(n)-i.l-i.r,i.h=Math.round(r)-i.t-i.b,!t._replotting&&(x.didMarginChange(l,i)||U(e))){`_redrawFromAutoMarginCount`in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var ae=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount<ae)return s.call(`_doPlot`,e);t._size=l,u.warn(`Too many auto-margin redraws.`)}G(e)};function G(e){var t=p.list(e,``,!0);[`_adjustTickLabelsOverflow`,`_hideCounterAxisInsideTickLabels`].forEach(function(e){for(var n=0;n<t.length;n++){var r=t[n][e];r&&r()}})}var K=[`l`,`r`,`t`,`b`,`p`,`w`,`h`];x.didMarginChange=function(e,t){for(var n=0;n<K.length;n++){var r=K[n],i=e[r],o=t[r];if(!a(i)||Math.abs(o-i)>1)return!0}return!1},x.graphJson=function(e,t,n,r,i,a){(i&&t&&!e._fullData||i&&!t&&!e._fullLayout)&&x.supplyDefaults(e);var s=i?e._fullData:e.data,c=i?e._fullLayout:e.layout,l=(e._transitionData||{})._frames;function d(e,t){if(typeof e==`function`)return t?`_function_`:null;if(u.isPlainObject(e)){var r={},i;return Object.keys(e).sort().forEach(function(a){if([`_`,`[`].indexOf(a.charAt(0))===-1){if(typeof e[a]==`function`){t&&(r[a]=`_function`);return}if(n===`keepdata`){if(a.slice(-3)===`src`)return}else if(n===`keepstream`){if(i=e[a+`src`],typeof i==`string`&&i.indexOf(`:`)>0&&!u.isPlainObject(e.stream))return}else if(n!==`keepall`&&(i=e[a+`src`],typeof i==`string`&&i.indexOf(`:`)>0))return;r[a]=d(e[a],t)}}),r}var a=Array.isArray(e),s=u.isTypedArray(e);if((a||s)&&e.dtype&&e.shape){var c=e.bdata;return d({dtype:e.dtype,shape:e.shape,bdata:u.isArrayBuffer(c)?o.encode(c):c},t)}return a?e.map(function(e){return d(e,t)}):s?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var f={data:(s||[]).map(function(e){var n=d(e);return t&&delete n.fit,n})};if(!t&&(f.layout=d(c),i)){var p=c._size;f.layout.computed={margin:{b:p.b,l:p.l,r:p.r,t:p.t}}}return l&&(f.frames=d(l)),a&&(f.config=d(e._context,!0)),r===`object`?f:JSON.stringify(f)},x.modifyFrames=function(e,t){var n,r,i,a=e._transitionData._frames,o=e._transitionData._frameHash;for(n=0;n<t.length;n++)switch(r=t[n],r.type){case`replace`:i=r.value;var s=(a[r.index]||{}).name,c=i.name;a[r.index]=o[c]=i,c!==s&&(delete o[s],o[c]=i);break;case`insert`:i=r.value,o[i.name]=i,a.splice(r.index,0,i);break;case`delete`:i=a[r.index],delete o[i.name],a.splice(r.index,1);break}return Promise.resolve()},x.computeFrame=function(e,t){var n=e._transitionData._frameHash,r,i,a,o;if(!t)throw Error(`computeFrame must be given a string frame name`);var s=n[t.toString()];if(!s)return!1;for(var c=[s],l=[s.name];s.baseframe&&(s=n[s.baseframe.toString()])&&l.indexOf(s.name)===-1;)c.push(s),l.push(s.name);for(var u={};s=c.pop();)if(s.layout&&(u.layout=x.extendLayout(u.layout,s.layout)),s.data){if(u.data||=[],i=s.traces,!i)for(i=[],r=0;r<s.data.length;r++)i[r]=r;for(u.traces||=[],r=0;r<s.data.length;r++)a=i[r],a!=null&&(o=u.traces.indexOf(a),o===-1&&(o=u.data.length,u.traces[o]=a),u.data[o]=x.extendTrace(u.data[o],s.data[r]))}return u},x.recomputeFrameHash=function(e){for(var t=e._transitionData._frameHash={},n=e._transitionData._frames,r=0;r<n.length;r++){var i=n[r];i&&i.name&&(t[i.name]=i)}},x.extendObjectWithContainers=function(e,t,n){var r,i,a,o,s,c,l,d,f=u.extendDeepNoArrays({},t||{}),p=u.expandObjectPaths(f),m={};if(n&&n.length)for(a=0;a<n.length;a++)r=u.nestedProperty(p,n[a]),i=r.get(),i===void 0?u.nestedProperty(m,n[a]).set(null):(r.set(null),u.nestedProperty(m,n[a]).set(i));if(e=u.extendDeepNoArrays(e||{},p),n&&n.length){for(a=0;a<n.length;a++)if(s=u.nestedProperty(m,n[a]),l=s.get(),l){for(c=u.nestedProperty(e,n[a]),d=c.get(),Array.isArray(d)||(d=[],c.set(d)),o=0;o<l.length;o++){var h=l[o];h===null?d[o]=null:d[o]=x.extendObjectWithContainers(d[o],h)}c.set(d)}}return e},x.dataArrayContainers=[`transforms`,`dimensions`],x.layoutArrayContainers=s.layoutArrayContainers,x.extendTrace=function(e,t){return x.extendObjectWithContainers(e,t,x.dataArrayContainers)},x.extendLayout=function(e,t){return x.extendObjectWithContainers(e,t,x.layoutArrayContainers)},x.transition=function(e,t,n,r,i,a){var o={redraw:i.redraw},s={},c=[];return o.prepareFn=function(){for(var i=Array.isArray(t)?t.length:0,a=r.slice(0,i),o=0;o<a.length;o++){var l=a[o],d=e._fullData[l]._module;if(d){if(d.animatable){var f=d.basePlotModule.name;s[f]||(s[f]=[]),s[f].push(l)}e.data[a[o]]=x.extendTrace(e.data[a[o]],t[o])}}var p=u.expandObjectPaths(u.extendDeepNoArrays({},n)),m=/^[xy]axis[0-9]*$/;for(var h in p)m.test(h)&&delete p[h].range;x.extendLayout(e.layout,p),delete e.calcdata,x.supplyDefaults(e),x.doCalcdata(e);var g=u.expandObjectPaths(n);if(g){var _=e._fullLayout._plots;for(var v in _){var y=_[v],b=y.xaxis,S=y.yaxis,C=b.range.slice(),w=S.range.slice(),T=null,E=null,D=null,O=null;Array.isArray(g[b._name+`.range`])?T=g[b._name+`.range`].slice():Array.isArray((g[b._name]||{}).range)&&(T=g[b._name].range.slice()),Array.isArray(g[S._name+`.range`])?E=g[S._name+`.range`].slice():Array.isArray((g[S._name]||{}).range)&&(E=g[S._name].range.slice()),C&&T&&(b.r2l(C[0])!==b.r2l(T[0])||b.r2l(C[1])!==b.r2l(T[1]))&&(D={xr0:C,xr1:T}),w&&E&&(S.r2l(w[0])!==S.r2l(E[0])||S.r2l(w[1])!==S.r2l(E[1]))&&(O={yr0:w,yr1:E}),(D||O)&&c.push(u.extendFlat({plotinfo:y},D,O))}}return Promise.resolve()},o.runFn=function(t){var r,i=e._fullLayout._basePlotModules,o=c.length,l;if(n)for(l=0;l<i.length;l++)i[l].transitionAxes&&i[l].transitionAxes(e,c,a,t);for(var d in o?(r=u.extendFlat({},a),r.duration=0,delete s.cartesian):r=a,s){var f=s[d];e._fullData[f[0]]._module.basePlotModule.plot(e,f,r,t)}},J(e,a,o)},x.transitionFromReact=function(e,t,n,r){var i=e._fullLayout,a=i.transition,o={},s=[];return o.prepareFn=function(){var e=i._plots;for(var a in o.redraw=!1,t.anim===`some`&&(o.redraw=!0),n.anim===`some`&&(o.redraw=!0),e){var c=e[a],l=c.xaxis,d=c.yaxis,f=r[l._name].range.slice(),p=r[d._name].range.slice(),m=l.range.slice(),h=d.range.slice();l.setScale(),d.setScale();var g=null,_=null;(l.r2l(f[0])!==l.r2l(m[0])||l.r2l(f[1])!==l.r2l(m[1]))&&(g={xr0:f,xr1:m}),(d.r2l(p[0])!==d.r2l(h[0])||d.r2l(p[1])!==d.r2l(h[1]))&&(_={yr0:p,yr1:h}),(g||_)&&s.push(u.extendFlat({plotinfo:c},g,_))}return Promise.resolve()},o.runFn=function(n){for(var r=e._fullData,i=e._fullLayout._basePlotModules,o,c,l,d=[],f=0;f<r.length;f++)d.push(f);function p(){if(e._fullLayout)for(var t=0;t<i.length;t++)i[t].transitionAxes&&i[t].transitionAxes(e,s,o,n)}function m(){if(e._fullLayout)for(var t=0;t<i.length;t++)i[t].plot(e,l,c,n)}s.length&&t.anim?a.ordering===`traces first`?(o=u.extendFlat({},a,{duration:0}),l=d,c=a,setTimeout(p,a.duration),m()):(o=a,l=null,c=u.extendFlat({},a,{duration:0}),setTimeout(m,o.duration),p()):s.length?(o=a,p()):t.anim&&(l=d,c=a,m())},J(e,a,o)};function J(e,t,n){var r=!1;function i(e){var t=Promise.resolve();if(!e)return t;for(;e.length;)t=t.then(e.shift());return t}function a(e){if(e)for(;e.length;)e.shift()}function o(){return e.emit(`plotly_transitioning`,[]),new Promise(function(i){e._transitioning=!0,t.duration>0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push(function(){r=!0}),n.redraw&&e._transitionData._interruptCallbacks.push(function(){return s.call(`redraw`,e)}),e._transitionData._interruptCallbacks.push(function(){e.emit(`plotly_transitioninterrupted`,[])});var a=0,o=0;function l(){return a++,function(){o++,!r&&o===a&&c(i)}}n.runFn(l),setTimeout(l())})}function c(t){if(e._transitionData)return a(e._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(n.redraw)return s.call(`redraw`,e)}).then(function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit(`plotly_transitioned`,[])}).then(t)}function l(){if(e._transitionData)return e._transitioning=!1,i(e._transitionData._interruptCallbacks)}var d=[x.previousPromises,l,n.prepareFn,x.rehover,x.reselect,o],f=u.syncOrAsync(d,e);return(!f||!f.then)&&(f=Promise.resolve()),f.then(function(){return e})}x.doCalcdata=function(e,t){var n=p.list(e),r=e._fullData,i=e._fullLayout,a,o,l,u,d=Array(r.length),m=(e.calcdata||[]).slice();for(e.calcdata=d,i._numBoxes=0,i._numViolins=0,i._violinScaleGroupStats={},e._hmpixcount=0,e._hmlumcount=0,i._piecolormap={},i._sunburstcolormap={},i._treemapcolormap={},i._iciclecolormap={},i._funnelareacolormap={},l=0;l<r.length;l++)if(Array.isArray(t)&&t.indexOf(l)===-1){d[l]=m[l];continue}for(l=0;l<r.length;l++)a=r[l],a._arrayAttrs=c.findArrayAttributes(a),a._extremes={};var h=i._subplots.polar||[];for(l=0;l<h.length;l++)n.push(i[h[l]].radialaxis,i[h[l]].angularaxis);for(var g in i._colorAxes){var _=i[g];_.cauto!==!1&&(delete _.cmin,delete _.cmax)}var v=!1;function y(t){if(a=r[t],o=a._module,a.visible===!0&&a.transforms){if(o&&o.calc){var n=o.calc(e,a);n[0]&&n[0].t&&n[0].t._scene&&delete n[0].t._scene.dirty}for(u=0;u<a.transforms.length;u++){var i=a.transforms[u];o=transformsRegistry[i.type],o&&o.calcTransform&&(a._hasCalcTransform=!0,v=!0,o.calcTransform(e,a,i))}}}function b(t,n){if(a=r[t],o=a._module,!!o.isContainer===n){var i=[];if(a.visible===!0&&a._length!==0){delete a._indexToPoints;var s=a.transforms||[];for(u=s.length-1;u>=0;u--)if(s[u].enabled){a._indexToPoints=s[u]._indexToPoints;break}o&&o.calc&&(i=o.calc(e,a))}(!Array.isArray(i)||!i[0])&&(i=[{x:f,y:f}]),i[0].t||(i[0].t={}),i[0].trace=a,d[t]=i}}for(Z(n,r,i),l=0;l<r.length;l++)b(l,!0);for(l=0;l<r.length;l++)y(l);for(v&&Z(n,r,i),l=0;l<r.length;l++)b(l,!0);for(l=0;l<r.length;l++)b(l,!1);Q(e);var x=X(n,e);if(x.length){for(i._numBoxes=0,i._numViolins=0,l=0;l<x.length;l++)b(x[l],!0);for(l=0;l<x.length;l++)b(x[l],!1);Q(e)}s.getComponentMethod(`fx`,`calc`)(e),s.getComponentMethod(`errorbars`,`calc`)(e)};var Y=/(total|sum|min|max|mean|geometric mean|median) (ascending|descending)/;function X(e,t){var n=[],r,i,a,o,c;function l(e,n,r){var i=n._id.charAt(0);if(e===`histogram2dcontour`){var a=n._counterAxes[0],o=p.getFromId(t,a),s=i===`x`||a===`x`&&o.type===`category`,c=i===`y`||a===`y`&&o.type===`category`;return function(e,t){return e===0||t===0||s&&e===r[t].length-1||c&&t===r.length-1?-1:(i===`y`?t:e)-1}}else return function(e,t){return i===`y`?t:e}}var d={min:function(e){return u.aggNums(Math.min,null,e)},max:function(e){return u.aggNums(Math.max,null,e)},sum:function(e){return u.aggNums(function(e,t){return e+t},null,e)},total:function(e){return u.aggNums(function(e,t){return e+t},null,e)},mean:function(e){return u.mean(e)},"geometric mean":function(e){return u.geometricMean(e)},median:function(e){return u.median(e)}};function f(e,t){return e[1]-t[1]}function m(e,t){return t[1]-e[1]}for(r=0;r<e.length;r++){var h=e[r];if(h.type===`category`){var g=h.categoryorder.match(Y);if(g){var _=g[1],v=g[2],y=h._id.charAt(0),b=y===`x`,x=[];for(i=0;i<h._categories.length;i++)x.push([h._categories[i],[]]);for(i=0;i<h._traceIndices.length;i++){var S=h._traceIndices[i],C=t._fullData[S];if(C.visible===!0){var w=C.type;s.traceIs(C,`histogram`)&&(delete C._xautoBinFinished,delete C._yautoBinFinished);var T=w===`splom`,E=w===`scattergl`,D=t.calcdata[S];for(a=0;a<D.length;a++){var O=D[a],k,A;if(T){var j=C._axesDim[h._id];if(!b){var M=C._diag[j][0];M&&(h=t._fullLayout[p.id2name(M)])}var N=O.trace.dimensions[j].values;for(o=0;o<N.length;o++)for(k=h._categoriesMap[N[o]],c=0;c<O.trace.dimensions.length;c++)if(c!==j){var P=O.trace.dimensions[c];x[k][1].push(P.values[o])}}else if(E){for(o=0;o<O.t.x.length;o++)b?(k=O.t.x[o],A=O.t.y[o]):(k=O.t.y[o],A=O.t.x[o]),x[k][1].push(A);O.t&&O.t._scene&&delete O.t._scene.dirty}else if(O.hasOwnProperty(`z`)){A=O.z;var F=l(C.type,h,A);for(o=0;o<A.length;o++)for(c=0;c<A[o].length;c++)k=F(c,o),k+1&&x[k][1].push(A[o][c])}else for(k=O.p,k===void 0&&(k=O[y]),A=O.s,A===void 0&&(A=O.v),A===void 0&&(A=b?O.y:O.x),Array.isArray(A)||(A=A===void 0?[]:[A]),o=0;o<A.length;o++)x[k][1].push(A[o])}}}h._categoriesValue=x;var I=[];for(i=0;i<x.length;i++)I.push([x[i][0],d[_](x[i][1])]);I.sort(v===`descending`?m:f),h._categoriesAggregatedValue=I,h._initialCategories=I.map(function(e){return e[0]}),n=n.concat(h.sortByInitialCategories())}}}return n}function Z(e,t,n){var r={};function i(e){e.clearCalc(),e.type===`multicategory`&&e.setupMultiCategory(t),r[e._id]=1}u.simpleMap(e,i);for(var a=n._axisMatchGroups||[],o=0;o<a.length;o++)for(var s in a[o])r[s]||i(n[p.id2name(s)])}function Q(e){var t=e._fullLayout,n=t._visibleModules,r={},i,a,o;for(a=0;a<n.length;a++){var s=n[a],c=s.crossTraceCalc;if(c){var l=s.basePlotModule.name;r[l]?u.pushUnique(r[l],c):r[l]=[c]}}for(o in r){var d=r[o],f=t._subplots[o];if(Array.isArray(f))for(i=0;i<f.length;i++){var p=f[i],m=o===`cartesian`?t._plots[p]:t[p];for(a=0;a<d.length;a++)d[a](e,m,p)}else for(a=0;a<d.length;a++)d[a](e)}}x.rehover=function(e){e._fullLayout._rehover&&e._fullLayout._rehover()},x.redrag=function(e){e._fullLayout._redrag&&e._fullLayout._redrag()},x.reselect=function(e){var t=e._fullLayout,n=(e.layout||{}).selections,r=t._previousSelections;t._previousSelections=n;var i=t._reselect||JSON.stringify(n)!==JSON.stringify(r);s.getComponentMethod(`selections`,`reselect`)(e,i)},x.generalUpdatePerTraceModule=function(e,t,n,r){var i=t.traceHash,a={},o;for(o=0;o<n.length;o++){var s=n[o],c=s[0].trace;c.visible&&(a[c.type]=a[c.type]||[],a[c.type].push(s))}for(var l in i)if(!a[l]){var d=i[l][0],f=d[0].trace;f.visible=!1,a[l]=[d]}for(var p in a){var m=a[p];m[0][0].trace._module.plot(e,t,u.filterVisible(m),r)}t.traceHash=a},x.plotBasePlot=function(e,t,n,r,i){var a=s.getModule(e),o=v(t.calcdata,a)[0];a.plot(t,o,r,i)},x.cleanBasePlot=function(e,t,n,r,i){var a=i._has&&i._has(e),o=n._has&&n._has(e);a&&!o&&i[`_`+e+`layer`].selectAll(`g.trace`).remove()}}),Dt=h(e=>{e.xmlns=`http://www.w3.org/2000/xmlns/`,e.svg=`http://www.w3.org/2000/svg`,e.xlink=`http://www.w3.org/1999/xlink`,e.svgAttrs={xmlns:e.svg,"xmlns:xlink":e.xlink}}),Ot=h((e,t)=>{t.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`}}}),kt=h(e=>{var t=S(),n=$(),r=n.strTranslate,i=Dt(),a=Ot().LINE_SPACING,o=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;e.convertToTspans=function(n,i,a){var s=n.text(),c=!n.attr(`data-notex`)&&i&&i._context.typesetMath&&typeof MathJax<`u`&&s.match(o),l=t.select(n.node().parentNode);if(l.empty())return;var u=n.attr(`class`)?n.attr(`class`).split(` `)[0]:`text`;u+=`-math`,l.selectAll(`svg.`+u).remove(),l.selectAll(`g.`+u+`-group`).remove(),n.style(`display`,null).attr({"data-unformatted":s,"data-math":`N`});function f(){l.empty()||(u=n.attr(`class`)+`-math`,l.select(`svg.`+u).remove()),n.text(``).style(`white-space`,`pre`),M(n.node(),s)&&n.style(`pointer-events`,`all`),e.positionText(n),a&&a.call(n)}return c?(i&&i._promises||[]).push(new Promise(function(e){n.style(`display`,`none`);var t=parseInt(n.node().style.fontSize,10),i={fontSize:t};d(c[2],i,function(i,o,c){l.selectAll(`svg.`+u).remove(),l.selectAll(`g.`+u+`-group`).remove();var d=i&&i.select(`svg`);if(!d||!d.node()){f(),e();return}var p=l.append(`g`).classed(u+`-group`,!0).attr({"pointer-events":`none`,"data-unformatted":s,"data-math":`Y`});p.node().appendChild(d.node()),o&&o.node()&&d.node().insertBefore(o.node().cloneNode(!0),d.node().firstChild);var m=c.width,h=c.height;d.attr({class:u,height:h,preserveAspectRatio:`xMinYMin meet`}).style({overflow:`visible`,"pointer-events":`none`});var g=n.node().style.fill||`black`,_=d.select(`g`);_.attr({fill:g,stroke:g});var v=_.node().getBoundingClientRect(),y=v.width,b=v.height;(y>m||b>h)&&(d.style(`overflow`,`hidden`),v=d.node().getBoundingClientRect(),y=v.width,b=v.height);var x=+n.attr(`x`),S=+n.attr(`y`),C=-(t||n.node().getBoundingClientRect().height)/4;if(u[0]===`y`)p.attr({transform:`rotate(`+[-90,x,S]+`)`+r(-y/2,C-b/2)});else if(u[0]===`l`)S=C-b/2;else if(u[0]===`a`&&u.indexOf(`atitle`)!==0)x=0,S=C;else{var w=n.attr(`text-anchor`);x-=y*(w===`middle`?.5:w===`end`?1:0),S=S+C-b/2}d.attr({x,y:S}),a&&a.call(n,p),e(p)})})):f(),n};var s=/(<|&lt;|&#60;)/g,c=/(>|&gt;|&#62;)/g;function l(e){return e.replace(s,`\\lt `).replace(c,`\\gt `)}var u=[[`$`,`$`],[`\\(`,`\\)`]];function d(e,r,i){var a=parseInt((MathJax.version||``).split(`.`)[0]);if(a!==2&&a!==3){n.warn(`No MathJax version:`,MathJax.version);return}var o,s,c,d,f=function(){return s=n.extendDeepAll({},MathJax.Hub.config),c=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:`none`,tex2jax:{inlineMath:u},displayAlign:`left`})},p=function(){s=n.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=u},m=function(){if(o=MathJax.Hub.config.menuSettings.renderer,o!==`SVG`)return MathJax.Hub.setRenderer(`SVG`)},h=function(){o=MathJax.config.startup.output,o!==`svg`&&(MathJax.config.startup.output=`svg`)},g=function(){var i=`math-output-`+n.randstr({},64);d=t.select(`body`).append(`div`).attr({id:i}).style({visibility:`hidden`,position:`absolute`,"font-size":r.fontSize+`px`}).text(l(e));var o=d.node();return a===2?MathJax.Hub.Typeset(o):MathJax.typeset([o])},_=function(){var r=d.select(a===2?`.MathJax_SVG`:`.MathJax`),o=!r.empty()&&d.select(`svg`).node();if(!o)n.log(`There was an error in the tex syntax.`,e),i();else{var s=o.getBoundingClientRect();i(r,a===2?t.select(`body`).select(`#MathJax_SVG_glyphs`):r.select(`defs`),s)}d.remove()},v=function(){if(o!==`SVG`)return MathJax.Hub.setRenderer(o)},y=function(){o!==`svg`&&(MathJax.config.startup.output=o)},b=function(){return c!==void 0&&(MathJax.Hub.processSectionDelay=c),MathJax.Hub.Config(s)},x=function(){MathJax.config=s};a===2?MathJax.Hub.Queue(f,m,g,_,v,b):a===3&&(p(),h(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){g(),_(),y(),x()}))}var f={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`},p={sub:`0.3em`,sup:`-0.6em`},m={sub:`-0.21em`,sup:`0.42em`},h=``,g=[`http:`,`https:`,`mailto:`,``,void 0,`:`],_=e.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=/<br(\s+.*)?>/i;e.BR_TAG_ALL=/<br(\s+.*)?>/gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,C=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function E(e,t){if(!e)return null;var n=e.match(t),r=n&&(n[3]||n[4]);return r&&A(r)}var D=/(^|;)\s*color:/;e.plainText=function(e,t){t||={};for(var n=t.len!==void 0&&t.len!==-1?t.len:1/0,r=t.allowedTags===void 0?[`br`]:t.allowedTags,i=`...`,a=i.length,o=e.split(v),s=[],c=``,l=0,u=0;u<o.length;u++){var d=o[u],f=d.match(y),p=f&&f[2].toLowerCase();if(p)r.indexOf(p)!==-1&&(s.push(d),c=p);else{var m=d.length;if(l+m<n)s.push(d),l+=m;else if(l<n){var h=n-l;c&&(c!==`br`||h<=a||m<=a)&&s.pop(),n>a?s.push(d.slice(0,Math.max(0,h-a))+i):s.push(d.slice(0,h));break}c=``}}return s.join(``)};var O={mu:`μ`,amp:`&`,lt:`<`,gt:`>`,nbsp:`\xA0`,times:`×`,plusmn:`±`,deg:`°`},k=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function A(e){return e.replace(k,function(e,t){var n;return n=t.charAt(0)===`#`?j(t.charAt(1)===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10)):O[t],n||e})}e.convertEntities=A;function j(e){if(!(e>1114111)){var t=String.fromCodePoint;if(t)return t(e);var n=String.fromCharCode;return e<=65535?n(e):n((e>>10)+55232,e%1024+56320)}}function M(e,r){r=r.replace(_,` `);var o=!1,s=[],c,l=-1;function u(){l++;var n=document.createElementNS(i.svg,`tspan`);t.select(n).attr({class:`line`,dy:l*a+`em`}),e.appendChild(n),c=n;var r=s;if(s=[{node:n}],r.length>1)for(var o=1;o<r.length;o++)d(r[o])}function d(e){var n=e.type,r={},a;if(n===`a`){a=`a`;var o=e.target,l=e.href,u=e.popup;l&&(r={"xlink:xlink:show":o===`_blank`||o.charAt(0)!==`_`?`new`:`replace`,target:o,"xlink:xlink:href":l},u&&(r.onclick=`window.open(this.href.baseVal,this.target.baseVal,"`+u+`");return false;`))}else a=`tspan`;e.style&&(r.style=e.style);var d=document.createElementNS(i.svg,a);if(n===`sup`||n===`sub`){g(c,h),c.appendChild(d);var f=document.createElementNS(i.svg,`tspan`);g(f,h),t.select(f).attr(`dy`,m[n]),r.dy=p[n],c.appendChild(d),c.appendChild(f)}else c.appendChild(d);t.select(d).attr(r),c=e.node=d,s.push(e)}function g(e,t){e.appendChild(document.createTextNode(t))}function S(e){if(s.length===1){n.log(`Ignoring unexpected end tag </`+e+`>.`,r);return}var t=s.pop();e!==t.type&&n.log(`Start tag <`+t.type+`> doesnt match end tag <`+e+`>. Pretending it did match.`,r),c=s[s.length-1].node}b.test(r)?u():(c=e,s=[{node:e}]);for(var O=r.split(v),k=0;k<O.length;k++){var j=O[k],M=j.match(y),P=M&&M[2].toLowerCase(),F=f[P];if(P===`br`)u();else if(F===void 0)g(c,A(j));else if(M[1])S(P);else{var I=M[4],L={type:P},R=E(I,x);if(R?(R=R.replace(D,`$1 fill:`),F&&(R+=`;`+F)):F&&(R=F),R&&(L.style=R),P===`a`){o=!0;var z=E(I,C);if(z){var B=N(z);B&&(L.href=B,L.target=E(I,w)||`_blank`,L.popup=E(I,T))}}d(L)}}return o}function N(e){var t=encodeURI(decodeURI(e)),n=document.createElement(`a`),r=document.createElement(`a`);n.href=e,r.href=t;var i=n.protocol,a=r.protocol;return g.indexOf(i)!==-1&&g.indexOf(a)!==-1?t:``}e.sanitizeHTML=function(e){e=e.replace(_,` `);for(var n=document.createElement(`p`),r=n,i=[],a=e.split(v),o=0;o<a.length;o++){var s=a[o],c=s.match(y),l=c&&c[2].toLowerCase();if(l in f)if(c[1])i.length&&(r=i.pop());else{var u=c[4],d=E(u,x),p=d?{style:d}:{};if(l===`a`){var m=E(u,C);if(m){var h=N(m);if(h){p.href=h;var g=E(u,w);g&&(p.target=g)}}}var b=document.createElement(l);r.appendChild(b),t.select(b).attr(p),r=b,i.push(b)}else r.appendChild(document.createTextNode(A(s)))}return n.innerHTML},e.lineCount=function(e){return e.selectAll(`tspan.line`).size()||1},e.positionText=function(e,n,r){return e.each(function(){var e=t.select(this);function i(t,n){return n===void 0?(n=e.attr(t),n===null&&(e.attr(t,0),n=0)):e.attr(t,n),n}var a=i(`x`,n),o=i(`y`,r);this.nodeName===`text`&&e.selectAll(`tspan.line`).attr({x:a,y:o})})};function P(e,t,r){var i=r.horizontalAlign,a=r.verticalAlign||`top`,o=e.node().getBoundingClientRect(),s=t.node().getBoundingClientRect(),c,l,u;return l=a===`bottom`?function(){return o.bottom-c.height}:a===`middle`?function(){return o.top+(o.height-c.height)/2}:function(){return o.top},u=i===`right`?function(){return o.right-c.width}:i===`center`?function(){return o.left+(o.width-c.width)/2}:function(){return o.left},function(){c=this.node().getBoundingClientRect();var e=u()-s.left,t=l()-s.top,i=r.gd||{};if(r.gd){i._fullLayout._calcInverseTransform(i);var a=n.apply3DTransform(i._fullLayout._invTransform)(e,t);e=a[0],t=a[1]}return this.style({top:t+`px`,left:e+`px`,"z-index":1e3}),this}}var F=`1px `;e.makeTextShadow=function(e){var t=F,n=F,r=F;return t+n+r+e+`, -`+t+`-`+n+r+e+`, `+t+`-`+n+r+e+`, -`+t+n+r+e},e.makeEditable=function(e,n){var r=n.gd,i=n.delegate,a=t.dispatch(`edit`,`input`,`cancel`),o=i||e;if(e.style({"pointer-events":i?`none`:`all`}),e.size()!==1)throw Error(`boo`);function s(){l(),e.style({opacity:0});var n=o.attr(`class`),r=n?`.`+n.split(` `)[0]+`-math-group`:`[class*=-math-group]`;r&&t.select(e.node().parentNode).select(r).style({opacity:0})}function c(e){var t=e.node(),n=document.createRange();n.selectNodeContents(t);var r=window.getSelection();r.removeAllRanges(),r.addRange(n),t.focus()}function l(){var i=t.select(r).select(`.svg-container`),o=i.append(`div`),s=e.node().style,l=parseFloat(s.fontSize||12),u=n.text;u===void 0&&(u=e.attr(`data-unformatted`)),o.classed(`plugin-editable editable`,!0).style({position:`absolute`,"font-family":s.fontFamily||`Arial`,"font-size":l,color:n.fill||s.fill||`black`,opacity:1,"background-color":n.background||`transparent`,outline:`#ffffff33 1px solid`,margin:[-l/8+1,0,0,-1].join(`px `)+`px`,padding:`0`,"box-sizing":`border-box`}).attr({contenteditable:!0}).text(u).call(P(e,i,n)).on(`blur`,function(){r._editing=!1,e.text(this.textContent).style({opacity:1});var n=t.select(this).attr(`class`),i=n?`.`+n.split(` `)[0]+`-math-group`:`[class*=-math-group]`;i&&t.select(e.node().parentNode).select(i).style({opacity:0});var o=this.textContent;t.select(this).transition().duration(0).remove(),t.select(document).on(`mouseup`,null),a.edit.call(e,o)}).on(`focus`,function(){var e=this;r._editing=!0,t.select(document).on(`mouseup`,function(){if(t.event.target===e)return!1;document.activeElement===o.node()&&o.node().blur()})}).on(`keyup`,function(){t.event.which===27?(r._editing=!1,e.style({opacity:1}),t.select(this).style({opacity:0}).on(`blur`,function(){return!1}).transition().remove(),a.cancel.call(e,this.textContent)):(a.input.call(e,this.textContent),t.select(this).call(P(e,i,n)))}).on(`keydown`,function(){t.event.which===13&&this.blur()}).call(c)}return n.immediate?s():o.on(`click`,s),t.rebind(e,a,`on`)}}),At=h((e,t)=>{var n=S(),r=R(),i=D(),a=$(),o=q(),s=G().isValid;function c(e,t,n){var r=t?a.nestedProperty(e,t).get()||{}:e,o=r[n||`color`];o&&o._inputArray&&(o=o._inputArray);var c=!1;if(a.isArrayOrTypedArray(o)){for(var l=0;l<o.length;l++)if(i(o[l])){c=!0;break}}return a.isPlainObject(r)&&(c||r.showscale===!0||i(r.cmin)&&i(r.cmax)||s(r.colorscale)||a.isPlainObject(r.colorbar))}var l=[`showscale`,`autocolorscale`,`colorscale`,`reversescale`,`colorbar`],u=[`min`,`max`,`mid`,`auto`];function d(e){var t=e._colorAx,n=t||e,r={},i,a,o;for(a=0;a<l.length;a++)o=l[a],r[o]=n[o];if(t)for(i=`c`,a=0;a<u.length;a++)o=u[a],r[o]=n[`c`+o];else{var s;for(a=0;a<u.length;a++){if(o=u[a],s=`c`+o,s in n){r[o]=n[s];continue}s=`z`+o,s in n&&(r[o]=n[s])}i=s.charAt(0)}return r._sync=function(e,t){var r=u.indexOf(e)===-1?e:i+e;n[r]=n[`_`+r]=t},r}function f(e){for(var t=d(e),n=t.min,r=t.max,i=t.reversescale?p(t.colorscale):t.colorscale,a=i.length,o=Array(a),s=Array(a),c=0;c<a;c++){var l=i[c];o[c]=n+l[0]*(r-n),s[c]=l[1]}return{domain:o,range:s}}function p(e){for(var t=e.length,n=Array(t),r=t-1,i=0;r>=0;r--,i++){var a=e[r];n[i]=[1-a[0],a[1]]}return n}function m(e,t){t||={};for(var a=e.domain,s=e.range,c=s.length,l=Array(c),u=0;u<c;u++){var d=r(s[u]).toRgb();l[u]=[d.r,d.g,d.b,d.a]}var f=n.scale.linear().domain(a).range(l).clamp(!0),p=t.noNumericCheck,m=t.returnArray,h;return h=p&&m?f:p?function(e){return g(f(e))}:m?function(e){return i(e)?f(e):r(e).isValid()?e:o.defaultLine}:function(e){return i(e)?g(f(e)):r(e).isValid()?e:o.defaultLine},h.domain=f.domain,h.range=function(){return s},h}function h(e,t){return m(f(e),t)}function g(e){return r({r:e[0],g:e[1],b:e[2],a:e[3]}).toRgbString()}t.exports={hasColorscale:c,extractOpts:d,extractScale:f,flipScale:p,makeColorScaleFunc:m,makeColorScaleFuncFromTrace:h}}),jt=h((e,t)=>{var n=Re(),r=n.FORMAT_LINK,i=n.DATE_FORMAT_LINK;function a(e,t){return{valType:`string`,dflt:``,editType:`none`,description:(t?o:s)(`hover text`,e)+[`By default the values are formatted using `+(t?`generic number format`:"`"+e+"axis.hoverformat`")+`.`].join(` `)}}function o(e,t){return[`Sets the `+e+` formatting rule`+(t?"for `"+t+"` ":``),`using d3 formatting mini-languages`,`which are very similar to those in Python. For numbers, see: `+r+`.`].join(` `)}function s(e,t){return o(e,t)+[` And for dates see: `+i+`.`,`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(` `)}t.exports={axisHoverFormat:a,descriptionOnlyNumbers:o,descriptionWithDates:s}}),Mt=h((e,t)=>{var n=B(),r=K(),i=Le().dash,a=z().extendFlat,o=yt().templatedArray;ze().templateFormatStringDescription;var s=jt().descriptionWithDates,c=O().ONEDAY,l=bt(),u=l.HOUR_PATTERN,d=l.WEEKDAY_PATTERN,f={valType:`enumerated`,values:[`auto`,`linear`,`array`],editType:`ticks`,impliedEdits:{tick0:void 0,dtick:void 0}},p=a({},f,{values:f.values.slice().concat([`sync`])});function m(e){return{valType:`integer`,min:0,dflt:e?5:0,editType:`ticks`}}var h={valType:`any`,editType:`ticks`,impliedEdits:{tickmode:`linear`}},g={valType:`any`,editType:`ticks`,impliedEdits:{tickmode:`linear`}},_={valType:`data_array`,editType:`ticks`},v={valType:`enumerated`,values:[`outside`,`inside`,``],editType:`ticks`};function y(e){var t={valType:`number`,min:0,editType:`ticks`};return e||(t.dflt=5),t}function b(e){var t={valType:`number`,min:0,editType:`ticks`};return e||(t.dflt=1),t}var x={valType:`color`,dflt:r.defaultLine,editType:`ticks`},S={valType:`color`,dflt:r.lightLine,editType:`ticks`};function C(e){var t={valType:`number`,min:0,editType:`ticks`};return e||(t.dflt=1),t}var w=a({},i,{editType:`ticks`}),T={valType:`boolean`,editType:`ticks`};t.exports={visible:{valType:`boolean`,editType:`plot`},color:{valType:`color`,dflt:r.defaultLine,editType:`ticks`},title:{text:{valType:`string`,editType:`ticks`},font:n({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:[l.idRegex.x.toString(),l.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:[l.idRegex.x.toString(),l.idRegex.y.toString()],editType:`calc`},rangebreaks:o(`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:[d,u,``],editType:`calc`},values:{valType:`info_array`,freeLength:!0,editType:`calc`,items:{valType:`any`,editType:`calc`}},dvalue:{valType:`number`,editType:`calc`,min:0,dflt:c},editType:`calc`}),tickmode:p,nticks:m(),tick0:h,dtick:g,ticklabelstep:{valType:`integer`,min:1,dflt:1,editType:`ticks`},tickvals:_,ticktext:{valType:`data_array`,editType:`ticks`},ticks:v,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:y(),tickwidth:b(),tickcolor:x,showticklabels:{valType:`boolean`,dflt:!0,editType:`ticks`},labelalias:{valType:`any`,dflt:!1,editType:`ticks`},automargin:{valType:`flaglist`,flags:[`height`,`width`,`left`,`right`,`top`,`bottom`],extras:[!0,!1],dflt:!1,editType:`ticks`},showspikes:{valType:`boolean`,dflt:!1,editType:`modebar`},spikecolor:{valType:`color`,dflt:null,editType:`none`},spikethickness:{valType:`number`,dflt:3,editType:`none`},spikedash:a({},i,{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:n({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:s(`tick label`)},tickformatstops:o(`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:s(`hover text`)},unifiedhovertitle:{text:{valType:`string`,dflt:``,editType:`none`},editType:`none`},showline:{valType:`boolean`,dflt:!1,editType:`ticks+layoutstyle`},linecolor:{valType:`color`,dflt:r.defaultLine,editType:`layoutstyle`},linewidth:{valType:`number`,min:0,dflt:1,editType:`ticks+layoutstyle`},showgrid:T,gridcolor:S,gridwidth:C(),griddash:w,zeroline:{valType:`boolean`,editType:`ticks`},zerolinecolor:{valType:`color`,dflt:r.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:r.defaultLine,editType:`ticks`},dividerwidth:{valType:`number`,dflt:1,editType:`ticks`},anchor:{valType:`enumerated`,values:[`free`,l.idRegex.x.toString(),l.idRegex.y.toString()],editType:`plot`},side:{valType:`enumerated`,values:[`top`,`bottom`,`left`,`right`],editType:`plot`},overlaying:{valType:`enumerated`,values:[`free`,l.idRegex.x.toString(),l.idRegex.y.toString()],editType:`plot`},minor:{tickmode:f,nticks:m(`minor`),tick0:h,dtick:g,tickvals:_,ticks:v,ticklen:y(`minor`),tickwidth:b(`minor`),tickcolor:x,gridcolor:S,gridwidth:C(`minor`),griddash:w,showgrid:T,editType:`ticks`},minorloglabels:{valType:`enumerated`,values:[`small digits`,`complete`,`none`],dflt:`small digits`,editType:`calc`},layer:{valType:`enumerated`,values:[`above traces`,`below traces`],dflt:`above traces`,editType:`plot`},domain:{valType:`info_array`,items:[{valType:`number`,min:0,max:1,editType:`plot`},{valType:`number`,min:0,max:1,editType:`plot`}],dflt:[0,1],editType:`plot`},position:{valType:`number`,min:0,max:1,dflt:0,editType:`plot`},autoshift:{valType:`boolean`,dflt:!1,editType:`plot`},shift:{valType:`number`,editType:`plot`},categoryorder:{valType:`enumerated`,values:[`trace`,`category ascending`,`category descending`,`array`,`total ascending`,`total descending`,`min ascending`,`min descending`,`max ascending`,`max descending`,`sum ascending`,`sum descending`,`mean ascending`,`mean descending`,`geometric mean ascending`,`geometric mean descending`,`median ascending`,`median descending`],dflt:`trace`,editType:`calc`},categoryarray:{valType:`data_array`,editType:`calc`},uirevision:{valType:`any`,editType:`none`},editType:`calc`}}),Nt=h((e,t)=>{var n=Mt(),r=B(),i=z().extendFlat,a=Ie().overrideAll;t.exports=a({orientation:{valType:`enumerated`,values:[`h`,`v`],dflt:`v`},thicknessmode:{valType:`enumerated`,values:[`fraction`,`pixels`],dflt:`pixels`},thickness:{valType:`number`,min:0,dflt:30},lenmode:{valType:`enumerated`,values:[`fraction`,`pixels`],dflt:`fraction`},len:{valType:`number`,min:0,dflt:1},x:{valType:`number`},xref:{valType:`enumerated`,dflt:`paper`,values:[`container`,`paper`],editType:`layoutstyle`},xanchor:{valType:`enumerated`,values:[`left`,`center`,`right`]},xpad:{valType:`number`,min:0,dflt:10},y:{valType:`number`},yref:{valType:`enumerated`,dflt:`paper`,values:[`container`,`paper`],editType:`layoutstyle`},yanchor:{valType:`enumerated`,values:[`top`,`middle`,`bottom`]},ypad:{valType:`number`,min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:`number`,min:0,dflt:0},bgcolor:{valType:`color`,dflt:`rgba(0,0,0,0)`},tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:i({},n.ticks,{dflt:``}),ticklabeloverflow:i({},n.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:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,ticklabelstep:n.ticklabelstep,showticklabels:n.showticklabels,labelalias:n.labelalias,tickfont:r({}),tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,minexponent:n.minexponent,showexponent:n.showexponent,title:{text:{valType:`string`},font:r({}),side:{valType:`enumerated`,values:[`right`,`top`,`bottom`]}}},`colorbars`,`from-root`)}),Pt=h((e,t)=>{var n=Nt(),r=Y().counter,i=Xe(),a=G().scales;i(a);function o(e){return"`"+e+"`"}t.exports=function(e,t){e||=``,t||={};var i=t.cLetter||`c`,s=`onlyIfNumerical`in t?t.onlyIfNumerical:!!e,c=`noScale`in t?t.noScale:e===`marker.line`,l=`showScaleDflt`in t?t.showScaleDflt:i===`z`,u=typeof t.colorscaleDflt==`string`?a[t.colorscaleDflt]:null,d=t.editTypeOverride||``,f=e?e+`.`:``,p,m;`colorAttr`in t?(p=t.colorAttr,m=t.colorAttr):(p={z:`z`,c:`color`}[i],m=`in `+o(f+p)),s&&``+m;var h=i+`auto`,g=i+`min`,_=i+`max`,v=i+`mid`;o(f+h);var y=o(f+g),b=o(f+_);y+``+b;var x={};x[g]=x[_]=void 0;var S={};S[h]=!1;var C={};return p===`color`&&(C.color={valType:`color`,arrayOk:!0,editType:d||`style`},t.anim&&(C.color.anim=!0)),C[h]={valType:`boolean`,dflt:!0,editType:`calc`,impliedEdits:x},C[g]={valType:`number`,dflt:null,editType:d||`plot`,impliedEdits:S},C[_]={valType:`number`,dflt:null,editType:d||`plot`,impliedEdits:S},C[v]={valType:`number`,dflt:null,editType:`calc`,impliedEdits:x},C.colorscale={valType:`colorscale`,editType:`calc`,dflt:u,impliedEdits:{autocolorscale:!1}},C.autocolorscale={valType:`boolean`,dflt:t.autoColorDflt!==!1,editType:`calc`,impliedEdits:{colorscale:void 0}},C.reversescale={valType:`boolean`,dflt:!1,editType:`plot`},c||(C.showscale={valType:`boolean`,dflt:l,editType:`calc`},C.colorbar=n),t.noColorAxis||(C.coloraxis={valType:`subplotid`,regex:r(`coloraxis`),dflt:null,editType:`calc`}),C}}),Ft=h((e,t)=>{var n=z().extendFlat,r=Pt(),i=G().scales;t.exports={editType:`calc`,colorscale:{editType:`calc`,sequential:{valType:`colorscale`,dflt:i.Reds,editType:`calc`},sequentialminus:{valType:`colorscale`,dflt:i.Blues,editType:`calc`},diverging:{valType:`colorscale`,dflt:i.RdBu,editType:`calc`}},coloraxis:n({_isSubplotObj:!0,editType:`calc`},r(``,{colorAttr:`corresponding trace color array(s)`,noColorAxis:!0,showScaleDflt:!0}))}}),It=h((e,t)=>{var n=$();t.exports=function(e){return n.isPlainObject(e.colorbar)}}),Lt=h(e=>{var t=D(),n=$(),r=O(),i=r.ONEDAY,a=r.ONEWEEK;e.dtick=function(e,n){var r=n===`log`,a=n===`date`,o=n===`category`,s=a?i:1;if(!e)return s;if(t(e))return e=Number(e),e<=0?s:o?Math.max(1,Math.round(e)):a?Math.max(.1,e):e;if(typeof e!=`string`||!(a||r))return s;var c=e.charAt(0),l=e.slice(1);return l=t(l)?Number(l):0,l<=0||!(a&&c===`M`&&l===Math.round(l)||r&&c===`L`||r&&c===`D`&&(l===1||l===2))?s:e},e.tick0=function(e,r,i,o){if(r===`date`)return n.cleanDate(e,n.dateTick0(i,o%a===0?1:0));if(!(o===`D1`||o===`D2`))return t(e)?Number(e):0}}),Rt=h((e,t)=>{var n=Lt(),r=$().isArrayOrTypedArray,i=j().isTypedArraySpec,a=j().decodeTypedArraySpec;t.exports=function(e,t,o,s,c){c||={};var l=c.isMinor,u=l?e.minor||{}:e,d=l?t.minor:t,f=l?`minor.`:``;function p(e){var t=u[e];return i(t)&&(t=a(t)),t===void 0?(d._template||{})[e]:t}var m=p(`tick0`),h=p(`dtick`),g=r(p(`tickvals`))?`array`:h?`linear`:`auto`,_=o(f+`tickmode`,g);if(_===`auto`||_===`sync`)o(f+`nticks`);else if(_===`linear`){var v=d.dtick=n.dtick(h,s);d.tick0=n.tick0(m,s,t.calendar,v)}else s!==`multicategory`&&(o(f+`tickvals`)===void 0?d.tickmode=`auto`:l||o(`ticktext`))}}),zt=h((e,t)=>{var n=$(),r=Mt();t.exports=function(e,t,i,a){var o=a.isMinor,s=o?e.minor||{}:e,c=o?t.minor:t,l=o?r.minor:r,u=o?`minor.`:``,d=n.coerce2(s,c,l,`ticklen`,o?(t.ticklen||5)*.6:void 0),f=n.coerce2(s,c,l,`tickwidth`,o?t.tickwidth||1:void 0),p=n.coerce2(s,c,l,`tickcolor`,(o?t.tickcolor:void 0)||c.color);i(u+`ticks`,!o&&a.outerTicks||d||f||p?`outside`:``)||(delete c.ticklen,delete c.tickwidth,delete c.tickcolor)}}),Bt=h((e,t)=>{t.exports=function(e){var t=[`showexponent`,`showtickprefix`,`showticksuffix`].filter(function(t){return e[t]!==void 0});if(t.every(function(n){return e[n]===e[t[0]]})||t.length===1)return e[t[0]]}}),Vt=h((e,t)=>{var n=$(),r=yt();t.exports=function(e,t,i){var a=i.name,o=i.inclusionAttr||`visible`,s=t[a],c=n.isArrayOrTypedArray(e[a])?e[a]:[],l=t[a]=[],u=r.arrayTemplater(t,a,o),d,f;for(d=0;d<c.length;d++){var p=c[d];n.isPlainObject(p)?f=u.newItem(p):(f=u.newItem({}),f[o]=!1),f._index=d,f[o]!==!1&&i.handleItemDefaults(p,f,t,i),l.push(f)}var m=u.defaultItems();for(d=0;d<m.length;d++)f=m[d],f._index=l.length,i.handleItemDefaults({},f,t,i,{}),l.push(f);if(n.isArrayOrTypedArray(s)){var h=Math.min(s.length,l.length);for(d=0;d<h;d++)n.relinkPrivateKeys(l[d],s[d])}return l}}),Ht=h((e,t)=>{var n=$(),r=q().contrast,i=Mt(),a=Bt(),o=Vt();t.exports=function(e,t,c,l,u){u||={};var d=c(`labelalias`);n.isPlainObject(d)||delete t.labelalias;var f=a(e);if(c(`showticklabels`)){u.noTicklabelshift||c(`ticklabelshift`),u.noTicklabelstandoff||c(`ticklabelstandoff`);var p=u.font||{},m=t.color,h=(t.ticklabelposition||``).indexOf(`inside`)===-1?m&&m!==i.color.dflt?m:p.color:r(u.bgColor);if(n.coerceFont(c,`tickfont`,p,{overrideDflt:{color:h}}),!u.noTicklabelstep&&l!==`multicategory`&&l!==`log`&&c(`ticklabelstep`),!u.noAng){var g=c(`tickangle`);!u.noAutotickangles&&g===`auto`&&c(`autotickangles`)}if(l!==`category`){var _=c(`tickformat`);o(e,t,{name:`tickformatstops`,inclusionAttr:`enabled`,handleItemDefaults:s}),t.tickformatstops.length||delete t.tickformatstops,!u.noExp&&!_&&l!==`date`&&(c(`showexponent`,f),c(`exponentformat`),c(`minexponent`),c(`separatethousands`))}!u.noMinorloglabels&&l===`log`&&c(`minorloglabels`)}};function s(e,t){function r(r,a){return n.coerce(e,t,i.tickformatstops,r,a)}r(`enabled`)&&(r(`dtickrange`),r(`value`))}}),Ut=h((e,t)=>{var n=Bt();t.exports=function(e,t,r,i,a){a||={};var o=a.tickSuffixDflt,s=n(e);r(`tickprefix`)&&r(`showtickprefix`,s),r(`ticksuffix`,o)&&r(`showticksuffix`,s)}}),Wt=h((e,t)=>{var n=$(),r=yt(),i=Rt(),a=zt(),o=Ht(),s=Ut(),c=Nt();t.exports=function(e,t,l){var u=r.newContainer(t,`colorbar`),d=e.colorbar||{};function f(e,t){return n.coerce(d,u,c,e,t)}var p=l.margin||{t:0,b:0,l:0,r:0},m=l.width-p.l-p.r,h=l.height-p.t-p.b,g=f(`orientation`)===`v`;f(`thickness`,f(`thicknessmode`)===`fraction`?30/(g?m:h):30),f(`len`,f(`lenmode`)===`fraction`?1:g?h:m);var _=f(`yref`),v=f(`xref`),y=_===`paper`,b=v===`paper`,x,S,C,w=`left`;g?(C=`middle`,w=b?`left`:`right`,x=b?1.02:1,S=.5):(C=y?`bottom`:`top`,w=`center`,x=.5,S=y?1.02:1),n.coerce(d,u,{x:{valType:`number`,min:b?-2:0,max:b?3:1,dflt:x}},`x`),n.coerce(d,u,{y:{valType:`number`,min:y?-2:0,max:y?3:1,dflt:S}},`y`),f(`xanchor`,w),f(`xpad`),f(`yanchor`,C),f(`ypad`),n.noneOrAll(d,u,[`x`,`y`]),f(`outlinecolor`),f(`outlinewidth`),f(`bordercolor`),f(`borderwidth`),f(`bgcolor`);var T=n.coerce(d,u,{ticklabelposition:{valType:`enumerated`,dflt:`outside`,values:g?[`outside`,`inside`,`outside top`,`inside top`,`outside bottom`,`inside bottom`]:[`outside`,`inside`,`outside left`,`inside left`,`outside right`,`inside right`]}},`ticklabelposition`);f(`ticklabeloverflow`,T.indexOf(`inside`)===-1?`hide past div`:`hide past domain`),i(d,u,f,`linear`);var E=l.font,D={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:E};T.indexOf(`inside`)!==-1&&(D.bgColor=`black`),s(d,u,f,`linear`,D),o(d,u,f,`linear`,D),a(d,u,f,`linear`,D),f(`title.text`,l._dfltTitle.colorbar);var O=u.showticklabels?u.tickfont:E,k=n.extendFlat({},E,{family:O.family,size:n.bigFont(O.size)});n.coerceFont(f,`title.font`,k),f(`title.side`,g?`top`:`right`)}}),Gt=h((e,t)=>{var n=D(),r=$(),i=It(),a=Wt(),o=G().isValid,s=Ke().traceIs;function c(e,t){var n=t.slice(0,t.length-1);return t?r.nestedProperty(e,n).get()||{}:e}t.exports=function e(t,l,u,d,f){var p=f.prefix,m=f.cLetter,h=`_module`in l,g=c(t,p),_=c(l,p),v=c(l._template||{},p)||{},y=function(){return delete t.coloraxis,delete l.coloraxis,e(t,l,u,d,f)};if(h){var b=u._colorAxes||{},x=d(p+`coloraxis`);if(x){var S=s(l,`contour`)&&r.nestedProperty(l,`contours.coloring`).get()||`heatmap`,C=b[x];C?(C[2].push(y),C[0]!==S&&(C[0]=!1,r.warn([`Ignoring coloraxis:`,x,`setting`,`as it is linked to incompatible colorscales.`].join(` `)))):b[x]=[S,l,[y]];return}}var w=g[m+`min`],T=g[m+`max`],E=n(w)&&n(T)&&w<T;d(p+m+`auto`,!E)?d(p+m+`mid`):(d(p+m+`min`),d(p+m+`max`));var D=g.colorscale,O=v.colorscale,k;if(D!==void 0&&(k=!o(D)),O!==void 0&&(k=!o(O)),d(p+`autocolorscale`,k),d(p+`colorscale`),d(p+`reversescale`),p!==`marker.line.`){var A;p&&h&&(A=i(g)),d(p+`showscale`,A)&&(p&&v&&(_._template=v),a(g,_,u))}}}),Kt=h((e,t)=>{var n=$(),r=yt(),i=Ft(),a=Gt();t.exports=function(e,t){function o(r,a){return n.coerce(e,t,i,r,a)}o(`colorscale.sequential`),o(`colorscale.sequentialminus`),o(`colorscale.diverging`);var s=t._colorAxes,c,l;function u(e,t){return n.coerce(c,l,i.coloraxis,e,t)}for(var d in s){var f=s[d];if(f[0])c=e[d]||{},l=r.newContainer(t,d,`coloraxis`),l._name=d,a(c,l,t,u,{prefix:``,cLetter:`c`});else{for(var p=0;p<f[2].length;p++)f[2][p]();delete t._colorAxes[d]}}}}),qt=h((e,t)=>{var n=$(),r=At().hasColorscale,i=At().extractOpts;t.exports=function(e,t){function a(e,t){var n=e[`_`+t];n!==void 0&&(e[t]=n)}function o(e,r){var o=r.container?n.nestedProperty(e,r.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var s=i(o),c=s.auto;(c||s.min===void 0)&&a(o,r.min),(c||s.max===void 0)&&a(o,r.max),s.autocolorscale&&a(o,`colorscale`)}}for(var s=0;s<e.length;s++){var c=e[s],l=c._module.colorbar;if(l)if(Array.isArray(l))for(var u=0;u<l.length;u++)o(c,l[u]);else o(c,l);r(c,`marker.line`)&&o(c,{container:`marker.line`,min:`cmin`,max:`cmax`})}for(var d in t._colorAxes)o(t[d],{min:`cmin`,max:`cmax`})}}),Jt=h((e,t)=>{var n=D(),r=$(),i=At().extractOpts;t.exports=function(e,t,a){var o=e._fullLayout,s=a.vals,c=a.containerStr,l=c?r.nestedProperty(t,c).get():t,u=i(l),d=u.auto!==!1,f=u.min,p=u.max,m=u.mid,h=function(){return r.aggNums(Math.min,null,s)},g=function(){return r.aggNums(Math.max,null,s)};if(f===void 0?f=h():d&&(f=l._colorAx&&n(f)?Math.min(f,h()):h()),p===void 0?p=g():d&&(p=l._colorAx&&n(p)?Math.max(p,g()):g()),d&&m!==void 0&&(p-m>m-f?f=m-(p-m):p-m<m-f&&(p=m+(m-f))),f===p&&(f-=.5,p+=.5),u._sync(`min`,f),u._sync(`max`,p),u.autocolorscale){var _=f*p<0?o.colorscale.diverging:f>=0?o.colorscale.sequential:o.colorscale.sequentialminus;u._sync(`colorscale`,_)}}}),Yt=h((e,t)=>{var n=G(),r=At();t.exports={moduleType:`component`,name:`colorscale`,attributes:Pt(),layoutAttributes:Ft(),supplyLayoutDefaults:Kt(),handleDefaults:Gt(),crossTraceDefaults:qt(),calc:Jt(),scales:n.scales,defaultScale:n.defaultScale,getScale:n.get,isValidScale:n.isValid,hasColorscale:r.hasColorscale,extractOpts:r.extractOpts,extractScale:r.extractScale,flipScale:r.flipScale,makeColorScaleFunc:r.makeColorScaleFunc,makeColorScaleFuncFromTrace:r.makeColorScaleFuncFromTrace}}),Xt=h((e,t)=>{var n=$(),r=j().isTypedArraySpec;t.exports={hasLines:function(e){return e.visible&&e.mode&&e.mode.indexOf(`lines`)!==-1},hasMarkers:function(e){return e.visible&&(e.mode&&e.mode.indexOf(`markers`)!==-1||e.type===`splom`)},hasText:function(e){return e.visible&&e.mode&&e.mode.indexOf(`text`)!==-1},isBubble:function(e){var t=e.marker;return n.isPlainObject(t)&&(n.isArrayOrTypedArray(t.size)||r(t.size))}}}),Zt=h((e,t)=>{var n=D();t.exports=function(e,t){t||=2;var r=e.marker,i=r.sizeref||1,a=r.sizemin||0,o=r.sizemode===`area`?function(e){return Math.sqrt(e/i)}:function(e){return e/i};return function(e){var r=o(e/t);return n(r)&&r>0?Math.max(r,a):0}}}),Qt=h(e=>{var t=$();e.getSubplot=function(e){return e.subplot||e.xaxis+e.yaxis||e.geo},e.isTraceInSubplots=function(t,n){if(t.type===`splom`){for(var r=t.xaxes||[],i=t.yaxes||[],a=0;a<r.length;a++)for(var o=0;o<i.length;o++)if(n.indexOf(r[a]+i[o])!==-1)return!0;return!1}return n.indexOf(e.getSubplot(t))!==-1},e.flat=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=t;return n},e.p2c=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=e[r].p2c(t);return n},e.getDistanceFunction=function(t,n,r,i){return t===`closest`?i||e.quadrature(n,r):t.charAt(0)===`x`?n:r},e.getClosest=function(e,t,n){if(n.index!==!1)n.index>=0&&n.index<e.length?n.distance=0:n.index=!1;else for(var r=1/0,i=e.length,a=0;a<i;a++)r=t(e[a]),r<=n.distance&&(n.index=a,n.distance=r);return n},e.inbox=function(e,t,n){return e*t<0||e===0?n:1/0},e.quadrature=function(e,t){return function(n){var r=e(n),i=t(n);return Math.sqrt(r*r+i*i)}},e.makeEventData=function(t,n,r){var i=`index`in t?t.index:t.pointNumber,a={data:n._input,fullData:n,curveNumber:n.index,pointNumber:i};if(n._indexToPoints){var o=n._indexToPoints[i];o.length===1?a.pointIndex=o[0]:a.pointIndices=o}else a.pointIndex=i;return n._module.eventData?a=n._module.eventData(a,t,n,r,i):(`xVal`in t?a.x=t.xVal:`x`in t&&(a.x=t.x),`yVal`in t?a.y=t.yVal:`y`in t&&(a.y=t.y),t.xa&&(a.xaxis=t.xa),t.ya&&(a.yaxis=t.ya),t.zLabelVal!==void 0&&(a.z=t.zLabelVal)),e.appendArrayPointValue(a,n,i),a},e.appendArrayPointValue=function(e,n,a){var o=n._arrayAttrs;if(o)for(var s=0;s<o.length;s++){var c=o[s],l=r(c);if(e[l]===void 0){var u=i(t.nestedProperty(n,c).get(),a);u!==void 0&&(e[l]=u)}}},e.appendArrayMultiPointValues=function(e,n,a){var o=n._arrayAttrs;if(o)for(var s=0;s<o.length;s++){var c=o[s],l=r(c);if(e[l]===void 0){for(var u=t.nestedProperty(n,c).get(),d=Array(a.length),f=0;f<a.length;f++)d[f]=i(u,a[f]);e[l]=d}}};var n={ids:`id`,locations:`location`,labels:`label`,values:`value`,"marker.colors":`color`,parents:`parent`};function r(e){return n[e]||e}function i(e,n){if(Array.isArray(n)){if(t.isArrayOrTypedArray(e)&&t.isArrayOrTypedArray(e[n[0]]))return e[n[0]][n[1]]}else return e[n]}var a={x:!0,y:!0},o={"x unified":!0,"y unified":!0};e.isUnifiedHover=function(e){return typeof e==`string`?!!o[e]:!1},e.isXYhover=function(e){return typeof e==`string`?!!a[e]:!1}}),$t=h((e,t)=>{t.exports=i;var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/gi;function i(e){var t=[];return e.replace(r,function(e,r,i){var a=r.toLowerCase();for(i=o(i),a==`m`&&i.length>2&&(t.push([r].concat(i.splice(0,2))),a=`l`,r=r==`m`?`l`:`L`);;){if(i.length==n[a])return i.unshift(r),t.push(i);if(i.length<n[a])throw Error(`malformed path data`);t.push([r].concat(i.splice(0,n[a])))}}),t}var a=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function o(e){var t=e.match(a);return t?t.map(Number):[]}}),en=h((e,t)=>{var n=$t(),r=function(e,t){return t?Math.round(e*(t=10**t))/t:Math.round(e)},i=`M0,0Z`,a=Math.sqrt(2),o=Math.sqrt(3),s=Math.PI,c=Math.cos,l=Math.sin;t.exports={circle:{n:0,f:function(e,t,n){if(u(t))return i;var a=r(e,2),o=`M`+a+`,0A`+a+`,`+a+` 0 1,1 0,-`+a+`A`+a+`,`+a+` 0 0,1 `+a+`,0Z`;return n?h(t,n,o):o}},square:{n:1,f:function(e,t,n){if(u(t))return i;var a=r(e,2);return h(t,n,`M`+a+`,`+a+`H-`+a+`V-`+a+`H`+a+`Z`)}},diamond:{n:2,f:function(e,t,n){if(u(t))return i;var a=r(e*1.3,2);return h(t,n,`M`+a+`,0L0,`+a+`L-`+a+`,0L0,-`+a+`Z`)}},cross:{n:3,f:function(e,t,n){if(u(t))return i;var a=r(e*.4,2),o=r(e*1.2,2);return h(t,n,`M`+o+`,`+a+`H`+a+`V`+o+`H-`+a+`V`+a+`H-`+o+`V-`+a+`H-`+a+`V-`+o+`H`+a+`V-`+a+`H`+o+`Z`)}},x:{n:4,f:function(e,t,n){if(u(t))return i;var o=r(e*.8/a,2),s=`l`+o+`,`+o,c=`l`+o+`,-`+o,l=`l-`+o+`,-`+o,d=`l-`+o+`,`+o;return h(t,n,`M0,`+o+s+c+l+c+l+d+l+d+s+d+s+`Z`)}},"triangle-up":{n:5,f:function(e,t,n){if(u(t))return i;var a=r(e*2/o,2),s=r(e/2,2),c=r(e,2);return h(t,n,`M-`+a+`,`+s+`H`+a+`L0,-`+c+`Z`)}},"triangle-down":{n:6,f:function(e,t,n){if(u(t))return i;var a=r(e*2/o,2),s=r(e/2,2),c=r(e,2);return h(t,n,`M-`+a+`,-`+s+`H`+a+`L0,`+c+`Z`)}},"triangle-left":{n:7,f:function(e,t,n){if(u(t))return i;var a=r(e*2/o,2),s=r(e/2,2),c=r(e,2);return h(t,n,`M`+s+`,-`+a+`V`+a+`L-`+c+`,0Z`)}},"triangle-right":{n:8,f:function(e,t,n){if(u(t))return i;var a=r(e*2/o,2),s=r(e/2,2),c=r(e,2);return h(t,n,`M-`+s+`,-`+a+`V`+a+`L`+c+`,0Z`)}},"triangle-ne":{n:9,f:function(e,t,n){if(u(t))return i;var a=r(e*.6,2),o=r(e*1.2,2);return h(t,n,`M-`+o+`,-`+a+`H`+a+`V`+o+`Z`)}},"triangle-se":{n:10,f:function(e,t,n){if(u(t))return i;var a=r(e*.6,2),o=r(e*1.2,2);return h(t,n,`M`+a+`,-`+o+`V`+a+`H-`+o+`Z`)}},"triangle-sw":{n:11,f:function(e,t,n){if(u(t))return i;var a=r(e*.6,2),o=r(e*1.2,2);return h(t,n,`M`+o+`,`+a+`H-`+a+`V-`+o+`Z`)}},"triangle-nw":{n:12,f:function(e,t,n){if(u(t))return i;var a=r(e*.6,2),o=r(e*1.2,2);return h(t,n,`M-`+a+`,`+o+`V-`+a+`H`+o+`Z`)}},pentagon:{n:13,f:function(e,t,n){if(u(t))return i;var a=r(e*.951,2),o=r(e*.588,2),s=r(-e,2),c=r(e*-.309,2),l=r(e*.809,2);return h(t,n,`M`+a+`,`+c+`L`+o+`,`+l+`H-`+o+`L-`+a+`,`+c+`L0,`+s+`Z`)}},hexagon:{n:14,f:function(e,t,n){if(u(t))return i;var a=r(e,2),s=r(e/2,2),c=r(e*o/2,2);return h(t,n,`M`+c+`,-`+s+`V`+s+`L0,`+a+`L-`+c+`,`+s+`V-`+s+`L0,-`+a+`Z`)}},hexagon2:{n:15,f:function(e,t,n){if(u(t))return i;var a=r(e,2),s=r(e/2,2),c=r(e*o/2,2);return h(t,n,`M-`+s+`,`+c+`H`+s+`L`+a+`,0L`+s+`,-`+c+`H-`+s+`L-`+a+`,0Z`)}},octagon:{n:16,f:function(e,t,n){if(u(t))return i;var a=r(e*.924,2),o=r(e*.383,2);return h(t,n,`M-`+o+`,-`+a+`H`+o+`L`+a+`,-`+o+`V`+o+`L`+o+`,`+a+`H-`+o+`L-`+a+`,`+o+`V-`+o+`Z`)}},star:{n:17,f:function(e,t,n){if(u(t))return i;var a=e*1.4,o=r(a*.225,2),s=r(a*.951,2),c=r(a*.363,2),l=r(a*.588,2),d=r(-a,2),f=r(a*-.309,2),p=r(a*.118,2),m=r(a*.809,2),g=r(a*.382,2);return h(t,n,`M`+o+`,`+f+`H`+s+`L`+c+`,`+p+`L`+l+`,`+m+`L0,`+g+`L-`+l+`,`+m+`L-`+c+`,`+p+`L-`+s+`,`+f+`H-`+o+`L0,`+d+`Z`)}},hexagram:{n:18,f:function(e,t,n){if(u(t))return i;var a=r(e*.66,2),o=r(e*.38,2),s=r(e*.76,2);return h(t,n,`M-`+s+`,0l-`+o+`,-`+a+`h`+s+`l`+o+`,-`+a+`l`+o+`,`+a+`h`+s+`l-`+o+`,`+a+`l`+o+`,`+a+`h-`+s+`l-`+o+`,`+a+`l-`+o+`,-`+a+`h-`+s+`Z`)}},"star-triangle-up":{n:19,f:function(e,t,n){if(u(t))return i;var a=r(e*o*.8,2),s=r(e*.8,2),c=r(e*1.6,2),l=r(e*4,2),d=`A `+l+`,`+l+` 0 0 1 `;return h(t,n,`M-`+a+`,`+s+d+a+`,`+s+d+`0,-`+c+d+`-`+a+`,`+s+`Z`)}},"star-triangle-down":{n:20,f:function(e,t,n){if(u(t))return i;var a=r(e*o*.8,2),s=r(e*.8,2),c=r(e*1.6,2),l=r(e*4,2),d=`A `+l+`,`+l+` 0 0 1 `;return h(t,n,`M`+a+`,-`+s+d+`-`+a+`,-`+s+d+`0,`+c+d+a+`,-`+s+`Z`)}},"star-square":{n:21,f:function(e,t,n){if(u(t))return i;var a=r(e*1.1,2),o=r(e*2,2),s=`A `+o+`,`+o+` 0 0 1 `;return h(t,n,`M-`+a+`,-`+a+s+`-`+a+`,`+a+s+a+`,`+a+s+a+`,-`+a+s+`-`+a+`,-`+a+`Z`)}},"star-diamond":{n:22,f:function(e,t,n){if(u(t))return i;var a=r(e*1.4,2),o=r(e*1.9,2),s=`A `+o+`,`+o+` 0 0 1 `;return h(t,n,`M-`+a+`,0`+s+`0,`+a+s+a+`,0`+s+`0,-`+a+s+`-`+a+`,0Z`)}},"diamond-tall":{n:23,f:function(e,t,n){if(u(t))return i;var a=r(e*.7,2),o=r(e*1.4,2);return h(t,n,`M0,`+o+`L`+a+`,0L0,-`+o+`L-`+a+`,0Z`)}},"diamond-wide":{n:24,f:function(e,t,n){if(u(t))return i;var a=r(e*1.4,2),o=r(e*.7,2);return h(t,n,`M0,`+o+`L`+a+`,0L0,-`+o+`L-`+a+`,0Z`)}},hourglass:{n:25,f:function(e,t,n){if(u(t))return i;var a=r(e,2);return h(t,n,`M`+a+`,`+a+`H-`+a+`L`+a+`,-`+a+`H-`+a+`Z`)},noDot:!0},bowtie:{n:26,f:function(e,t,n){if(u(t))return i;var a=r(e,2);return h(t,n,`M`+a+`,`+a+`V-`+a+`L-`+a+`,`+a+`V-`+a+`Z`)},noDot:!0},"circle-cross":{n:27,f:function(e,t,n){if(u(t))return i;var a=r(e,2);return h(t,n,`M0,`+a+`V-`+a+`M`+a+`,0H-`+a+`M`+a+`,0A`+a+`,`+a+` 0 1,1 0,-`+a+`A`+a+`,`+a+` 0 0,1 `+a+`,0Z`)},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e,t,n){if(u(t))return i;var o=r(e,2),s=r(e/a,2);return h(t,n,`M`+s+`,`+s+`L-`+s+`,-`+s+`M`+s+`,-`+s+`L-`+s+`,`+s+`M`+o+`,0A`+o+`,`+o+` 0 1,1 0,-`+o+`A`+o+`,`+o+` 0 0,1 `+o+`,0Z`)},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e,t,n){if(u(t))return i;var a=r(e,2);return h(t,n,`M0,`+a+`V-`+a+`M`+a+`,0H-`+a+`M`+a+`,`+a+`H-`+a+`V-`+a+`H`+a+`Z`)},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e,t,n){if(u(t))return i;var a=r(e,2);return h(t,n,`M`+a+`,`+a+`L-`+a+`,-`+a+`M`+a+`,-`+a+`L-`+a+`,`+a+`M`+a+`,`+a+`H-`+a+`V-`+a+`H`+a+`Z`)},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e,t,n){if(u(t))return i;var a=r(e*1.3,2);return h(t,n,`M`+a+`,0L0,`+a+`L-`+a+`,0L0,-`+a+`ZM0,-`+a+`V`+a+`M-`+a+`,0H`+a)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e,t,n){if(u(t))return i;var a=r(e*1.3,2),o=r(e*.65,2);return h(t,n,`M`+a+`,0L0,`+a+`L-`+a+`,0L0,-`+a+`ZM-`+o+`,-`+o+`L`+o+`,`+o+`M-`+o+`,`+o+`L`+o+`,-`+o)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e,t,n){if(u(t))return i;var a=r(e*1.4,2);return h(t,n,`M0,`+a+`V-`+a+`M`+a+`,0H-`+a)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e,t,n){if(u(t))return i;var a=r(e,2);return h(t,n,`M`+a+`,`+a+`L-`+a+`,-`+a+`M`+a+`,-`+a+`L-`+a+`,`+a)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e,t,n){if(u(t))return i;var a=r(e*1.2,2),o=r(e*.85,2);return h(t,n,`M0,`+a+`V-`+a+`M`+a+`,0H-`+a+`M`+o+`,`+o+`L-`+o+`,-`+o+`M`+o+`,-`+o+`L-`+o+`,`+o)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e,t,n){if(u(t))return i;var a=r(e/2,2),o=r(e,2);return h(t,n,`M`+a+`,`+o+`V-`+o+`M`+(a-o)+`,-`+o+`V`+o+`M`+o+`,`+a+`H-`+o+`M-`+o+`,`+(a-o)+`H`+o)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e,t,n){if(u(t))return i;var a=r(e*1.2,2),o=r(e*1.6,2),s=r(e*.8,2);return h(t,n,`M-`+a+`,`+s+`L0,0M`+a+`,`+s+`L0,0M0,-`+o+`L0,0`)},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e,t,n){if(u(t))return i;var a=r(e*1.2,2),o=r(e*1.6,2),s=r(e*.8,2);return h(t,n,`M-`+a+`,-`+s+`L0,0M`+a+`,-`+s+`L0,0M0,`+o+`L0,0`)},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e,t,n){if(u(t))return i;var a=r(e*1.2,2),o=r(e*1.6,2),s=r(e*.8,2);return h(t,n,`M`+s+`,`+a+`L0,0M`+s+`,-`+a+`L0,0M-`+o+`,0L0,0`)},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e,t,n){if(u(t))return i;var a=r(e*1.2,2),o=r(e*1.6,2),s=r(e*.8,2);return h(t,n,`M-`+s+`,`+a+`L0,0M-`+s+`,-`+a+`L0,0M`+o+`,0L0,0`)},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e,t,n){if(u(t))return i;var a=r(e*1.4,2);return h(t,n,`M`+a+`,0H-`+a)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e,t,n){if(u(t))return i;var a=r(e*1.4,2);return h(t,n,`M0,`+a+`V-`+a)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e,t,n){if(u(t))return i;var a=r(e,2);return h(t,n,`M`+a+`,-`+a+`L-`+a+`,`+a)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e,t,n){if(u(t))return i;var a=r(e,2);return h(t,n,`M`+a+`,`+a+`L-`+a+`,-`+a)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(e,t,n){if(u(t))return i;var a=r(e,2),o=r(e*2,2);return h(t,n,`M0,0L-`+a+`,`+o+`H`+a+`Z`)},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(e,t,n){if(u(t))return i;var a=r(e,2),o=r(e*2,2);return h(t,n,`M0,0L-`+a+`,-`+o+`H`+a+`Z`)},noDot:!0},"arrow-left":{n:47,f:function(e,t,n){if(u(t))return i;var a=r(e*2,2),o=r(e,2);return h(t,n,`M0,0L`+a+`,-`+o+`V`+o+`Z`)},noDot:!0},"arrow-right":{n:48,f:function(e,t,n){if(u(t))return i;var a=r(e*2,2),o=r(e,2);return h(t,n,`M0,0L-`+a+`,-`+o+`V`+o+`Z`)},noDot:!0},"arrow-bar-up":{n:49,f:function(e,t,n){if(u(t))return i;var a=r(e,2),o=r(e*2,2);return h(t,n,`M-`+a+`,0H`+a+`M0,0L-`+a+`,`+o+`H`+a+`Z`)},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e,t,n){if(u(t))return i;var a=r(e,2),o=r(e*2,2);return h(t,n,`M-`+a+`,0H`+a+`M0,0L-`+a+`,-`+o+`H`+a+`Z`)},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e,t,n){if(u(t))return i;var a=r(e*2,2),o=r(e,2);return h(t,n,`M0,-`+o+`V`+o+`M0,0L`+a+`,-`+o+`V`+o+`Z`)},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e,t,n){if(u(t))return i;var a=r(e*2,2),o=r(e,2);return h(t,n,`M0,-`+o+`V`+o+`M0,0L-`+a+`,-`+o+`V`+o+`Z`)},needLine:!0,noDot:!0},arrow:{n:53,f:function(e,t,n){if(u(t))return i;var r=s/2.5,a=2*e*c(r),o=2*e*l(r);return h(t,n,`M0,0L`+-a+`,`+o+`L`+a+`,`+o+`Z`)},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(e,t,n){if(u(t))return i;var r=s/4,a=2*e*c(r),o=2*e*l(r);return h(t,n,`M0,0L`+-a+`,`+o+`A `+2*e+`,`+2*e+` 0 0 1 `+a+`,`+o+`Z`)},backoff:.4,noDot:!0}};function u(e){return e===null}var d,f,p,m;function h(e,t,r){if((!e||e%360==0)&&!t)return r;if(p===e&&m===t&&d===r)return f;p=e,m=t,d=r;function i(e,n){var r=c(e),i=l(e),a=n[0],o=n[1]+(t||0);return[a*r-o*i,a*i+o*r]}for(var a=e/180*s,o=0,u=0,h=n(r),g=``,_=0;_<h.length;_++){var v=h[_],y=v[0],b=o,x=u;if(y===`M`||y===`L`)o=+v[1],u=+v[2];else if(y===`m`||y===`l`)o+=+v[1],u+=+v[2];else if(y===`H`)o=+v[1];else if(y===`h`)o+=+v[1];else if(y===`V`)u=+v[1];else if(y===`v`)u+=+v[1];else if(y===`A`){o=+v[1],u=+v[2];var S=i(a,[+v[6],+v[7]]);v[6]=S[0],v[7]=S[1],v[3]=+v[3]+e}(y===`H`||y===`V`)&&(y=`L`),(y===`h`||y===`v`)&&(y=`l`),(y===`m`||y===`l`)&&(o-=b,u-=x);var C=i(a,[o,u]);(y===`H`||y===`V`)&&(y=`L`),(y===`M`||y===`L`||y===`m`||y===`l`)&&(v[1]=C[0],v[2]=C[1]),v[0]=y,g+=v[0]+v.slice(1).join(`,`)}return f=g,g}}),tn=h((e,t)=>{var n=S(),r=$(),i=r.numberFormat,a=D(),o=R(),s=Ke(),c=q(),l=Yt(),u=r.strTranslate,d=kt(),f=Dt(),p=Ot().LINE_SPACING,m=J().DESELECTDIM,h=Xt(),g=Zt(),_=Qt().appendArrayPointValue,v=t.exports={};v.font=function(e,t){var n=t.variant,r=t.style,i=t.weight,a=t.color,o=t.size,s=t.family,l=t.shadow,u=t.lineposition,f=t.textcase;s&&e.style(`font-family`,s),o+1&&e.style(`font-size`,o+`px`),a&&e.call(c.fill,a),i&&e.style(`font-weight`,i),r&&e.style(`font-style`,r),n&&e.style(`font-variant`,n),f&&e.style(`text-transform`,y(x(f))),l&&e.style(`text-shadow`,l===`auto`?d.makeTextShadow(c.contrast(a)):y(l)),u&&e.style(`text-decoration-line`,y(C(u)))};function y(e){return e===`none`?void 0:e}var b={normal:`none`,lower:`lowercase`,upper:`uppercase`,"word caps":`capitalize`};function x(e){return b[e]}function C(e){return e.replace(`under`,`underline`).replace(`over`,`overline`).replace(`through`,`line-through`).split(`+`).join(` `)}v.setPosition=function(e,t,n){e.attr(`x`,t).attr(`y`,n)},v.setSize=function(e,t,n){e.attr(`width`,t).attr(`height`,n)},v.setRect=function(e,t,n,r,i){e.call(v.setPosition,t,n).call(v.setSize,r,i)},v.translatePoint=function(e,t,n,r){var i=n.c2p(e.x),o=r.c2p(e.y);if(a(i)&&a(o)&&t.node())t.node().nodeName===`text`?t.attr(`x`,i).attr(`y`,o):t.attr(`transform`,u(i,o));else return!1;return!0},v.translatePoints=function(e,t,r){e.each(function(e){var i=n.select(this);v.translatePoint(e,i,t,r)})},v.hideOutsideRangePoint=function(e,t,n,r,i,a){t.attr(`display`,n.isPtWithinRange(e,i)&&r.isPtWithinRange(e,a)?null:`none`)},v.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,i=t.yaxis;e.each(function(t){var a=t[0].trace,o=a.xcalendar,c=a.ycalendar,l=s.traceIs(a,`bar-like`)?`.bartext`:`.point,.textpoint`;e.selectAll(l).each(function(e){v.hideOutsideRangePoint(e,n.select(this),r,i,o,c)})})}},v.crispRound=function(e,t,n){return!t||!a(t)?n||0:e._context.staticPlot?t:t<1?1:Math.round(t)},v.singleLineStyle=function(e,t,n,r,i){t.style(`fill`,`none`);var a=(((e||[])[0]||{}).trace||{}).line||{},o=n||a.width||0,s=i||a.dash||``;c.stroke(t,r||a.color),v.dashLine(t,s,o)},v.lineGroupStyle=function(e,t,r,i){e.style(`fill`,`none`).each(function(e){var a=(((e||[])[0]||{}).trace||{}).line||{},o=t||a.width||0,s=i||a.dash||``;n.select(this).call(c.stroke,r||a.color).call(v.dashLine,s,o)})},v.dashLine=function(e,t,n){n=+n||0,t=v.dashStyle(t,n),e.style({"stroke-dasharray":t,"stroke-width":n+`px`})},v.dashStyle=function(e,t){t=+t||1;var n=Math.max(t,3);return e===`solid`?e=``:e===`dot`?e=n+`px,`+n+`px`:e===`dash`?e=3*n+`px,`+3*n+`px`:e===`longdash`?e=5*n+`px,`+5*n+`px`:e===`dashdot`?e=3*n+`px,`+n+`px,`+n+`px,`+n+`px`:e===`longdashdot`&&(e=5*n+`px,`+2*n+`px,`+n+`px,`+2*n+`px`),e};function w(e,t,n,r){var i=t.fillpattern,a=t.fillgradient,o=v.getPatternAttr,s=i&&(o(i.shape,0,``)||o(i.path,0,``));if(s){var l=o(i.bgcolor,0,null),u=o(i.fgcolor,0,null),d=i.fgopacity,f=o(i.size,0,8),p=o(i.solidity,0,.3),m=t.uid;v.pattern(e,`point`,n,m,s,f,p,void 0,i.fillmode,l,u,d)}else if(a&&a.type!==`none`){var h=a.type,g=`scatterfill-`+t.uid;if(r&&(g=`legendfill-`+t.uid),!r&&(a.start!==void 0||a.stop!==void 0)){var _,y;h===`horizontal`?(_={x:a.start,y:0},y={x:a.stop,y:0}):h===`vertical`&&(_={x:0,y:a.start},y={x:0,y:a.stop}),_.x=t._xA.c2p(_.x===void 0?t._extremes.x.min[0].val:_.x,!0),_.y=t._yA.c2p(_.y===void 0?t._extremes.y.min[0].val:_.y,!0),y.x=t._xA.c2p(y.x===void 0?t._extremes.x.max[0].val:y.x,!0),y.y=t._yA.c2p(y.y===void 0?t._extremes.y.max[0].val:y.y,!0),e.call(M,n,g,`linear`,a.colorscale,`fill`,_,y,!0,!1)}else h===`horizontal`&&(h+=`reversed`),e.call(v.gradient,n,g,h,a.colorscale,`fill`)}else t.fillcolor&&e.call(c.fill,t.fillcolor)}v.singleFillStyle=function(e,t){w(e,((n.select(e.node()).data()[0]||[])[0]||{}).trace||{},t,!1)},v.fillGroupStyle=function(e,t,r){e.style(`stroke-width`,0).each(function(e){var i=n.select(this);e[0].trace&&w(i,e[0].trace,t,r)})};var T=en();v.symbolNames=[],v.symbolFuncs=[],v.symbolBackOffs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(T).forEach(function(e){var t=T[e],n=t.n;v.symbolList.push(n,String(n),e,n+100,String(n+100),e+`-open`),v.symbolNames[n]=e,v.symbolFuncs[n]=t.f,v.symbolBackOffs[n]=t.backoff||0,t.needLine&&(v.symbolNeedLines[n]=!0),t.noDot?v.symbolNoDot[n]=!0:v.symbolList.push(n+200,String(n+200),e+`-dot`,n+300,String(n+300),e+`-open-dot`),t.noFill&&(v.symbolNoFill[n]=!0)});var E=v.symbolNames.length,O=`M0,0.5L0.5,0L0,-0.5L-0.5,0Z`;v.symbolNumber=function(e){if(a(e))e=+e;else if(typeof e==`string`){var t=0;e.indexOf(`-open`)>0&&(t=100,e=e.replace(`-open`,``)),e.indexOf(`-dot`)>0&&(t+=200,e=e.replace(`-dot`,``)),e=v.symbolNames.indexOf(e),e>=0&&(e+=t)}return e%100>=E||e>=400?0:Math.floor(Math.max(e,0))};function k(e,t,n,r){var i=e%100;return v.symbolFuncs[i](t,n,r)+(e>=200?O:``)}var A=i(`~f`),j={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}};v.gradient=function(e,t,n,r,i,a){var o=j[r];return M(e,t,n,o.type,i,a,o.start,o.stop,!1,o.reversed)};function M(e,t,i,a,s,l,u,d,f,p){var m=s.length,h;a===`linear`?h={node:`linearGradient`,attrs:{x1:u.x,y1:u.y,x2:d.x,y2:d.y,gradientUnits:f?`userSpaceOnUse`:`objectBoundingBox`},reversed:p}:a===`radial`&&(h={node:`radialGradient`,reversed:p});for(var g=Array(m),_=0;_<m;_++)h.reversed?g[m-1-_]=[A((1-s[_][0])*100),s[_][1]]:g[_]=[A(s[_][0]*100),s[_][1]];var v=t._fullLayout,y=`g`+v._uid+`-`+i,b=v._defs.select(`.gradients`).selectAll(`#`+y).data([a+g.join(`;`)],r.identity);b.exit().remove(),b.enter().append(h.node).each(function(){var e=n.select(this);h.attrs&&e.attr(h.attrs),e.attr(`id`,y);var t=e.selectAll(`stop`).data(g);t.exit().remove(),t.enter().append(`stop`),t.each(function(e){var t=o(e[1]);n.select(this).attr({offset:e[0]+`%`,"stop-color":c.tinyRGB(t),"stop-opacity":t.getAlpha()})})}),e.style(l,Q(y,t)).style(l+`-opacity`,null),e.classed(`gradient_filled`,!0)}v.pattern=function(e,t,i,a,s,l,u,d,f,p,m,h){var g=t===`legend`;d&&(f===`overlay`?(p=d,m=c.contrast(p)):(p=void 0,m=d));var _=i._fullLayout,v=`p`+_._uid+`-`+a,y,b,x=function(e,t,n,r,i){return r+(i-r)*(e-t)/(n-t)},S,C,w,T,E={},D=o(m),O=c.tinyRGB(D),k=h*D.getAlpha();switch(s){case`/`:y=l*Math.sqrt(2),b=l*Math.sqrt(2),S=`M-`+y/4+`,`+b/4+`l`+y/2+`,-`+b/2+`M0,`+b+`L`+y+`,0M`+y/4*3+`,`+b/4*5+`l`+y/2+`,-`+b/2,C=u*l,T=`path`,E={d:S,opacity:k,stroke:O,"stroke-width":C+`px`};break;case`\\`:y=l*Math.sqrt(2),b=l*Math.sqrt(2),S=`M`+y/4*3+`,-`+b/4+`l`+y/2+`,`+b/2+`M0,0L`+y+`,`+b+`M-`+y/4+`,`+b/4*3+`l`+y/2+`,`+b/2,C=u*l,T=`path`,E={d:S,opacity:k,stroke:O,"stroke-width":C+`px`};break;case`x`:y=l*Math.sqrt(2),b=l*Math.sqrt(2),S=`M-`+y/4+`,`+b/4+`l`+y/2+`,-`+b/2+`M0,`+b+`L`+y+`,0M`+y/4*3+`,`+b/4*5+`l`+y/2+`,-`+b/2+`M`+y/4*3+`,-`+b/4+`l`+y/2+`,`+b/2+`M0,0L`+y+`,`+b+`M-`+y/4+`,`+b/4*3+`l`+y/2+`,`+b/2,C=l-l*Math.sqrt(1-u),T=`path`,E={d:S,opacity:k,stroke:O,"stroke-width":C+`px`};break;case`|`:y=l,b=l,T=`path`,S=`M`+y/2+`,0L`+y/2+`,`+b,C=u*l,T=`path`,E={d:S,opacity:k,stroke:O,"stroke-width":C+`px`};break;case`-`:y=l,b=l,T=`path`,S=`M0,`+b/2+`L`+y+`,`+b/2,C=u*l,T=`path`,E={d:S,opacity:k,stroke:O,"stroke-width":C+`px`};break;case`+`:y=l,b=l,T=`path`,S=`M`+y/2+`,0L`+y/2+`,`+b+`M0,`+b/2+`L`+y+`,`+b/2,C=l-l*Math.sqrt(1-u),T=`path`,E={d:S,opacity:k,stroke:O,"stroke-width":C+`px`};break;case`.`:y=l,b=l,w=u<Math.PI/4?Math.sqrt(u*l*l/Math.PI):x(u,Math.PI/4,1,l/2,l/Math.sqrt(2)),T=`circle`,E={cx:y/2,cy:b/2,r:w,opacity:k,fill:O};break;default:y=l,b=l,T=`path`,E={d:s,opacity:k,fill:O};break}var A=[s||`noSh`,p||`noBg`,m||`noFg`,l,u].join(`;`),j=_._defs.select(`.patterns`).selectAll(`#`+v).data([A],r.identity);j.exit().remove(),j.enter().append(`pattern`).each(function(){var e=n.select(this);if(e.attr({id:v,width:y+`px`,height:b+`px`,patternUnits:`userSpaceOnUse`,patternTransform:g?`scale(0.8)`:``}),p){var t=o(p),r=c.tinyRGB(t),i=t.getAlpha(),a=e.selectAll(`rect`).data([0]);a.exit().remove(),a.enter().append(`rect`).attr({width:y+`px`,height:b+`px`,fill:r,"fill-opacity":i})}var s=e.selectAll(T).data([0]);s.exit().remove(),s.enter().append(T).attr(E)}),e.style(`fill`,Q(v,i)).style(`fill-opacity`,null),e.classed(`pattern_filled`,!0)},v.initGradients=function(e){var t=e._fullLayout;r.ensureSingle(t._defs,`g`,`gradients`).selectAll(`linearGradient,radialGradient`).remove(),n.select(e).selectAll(`.gradient_filled`).classed(`gradient_filled`,!1)},v.initPatterns=function(e){var t=e._fullLayout;r.ensureSingle(t._defs,`g`,`patterns`).selectAll(`pattern`).remove(),n.select(e).selectAll(`.pattern_filled`).classed(`pattern_filled`,!1)},v.getPatternAttr=function(e,t,n){return e&&r.isArrayOrTypedArray(e)?t<e.length?e[t]:n:e},v.pointStyle=function(e,t,r,i){if(e.size()){var a=v.makePointStyleFns(t);e.each(function(e){v.singlePointStyle(e,n.select(this),t,a,r,i)})}},v.singlePointStyle=function(e,t,n,i,a,o){var s=n.marker,l=s.line;if(o&&o.i>=0&&e.i===void 0&&(e.i=o.i),t.style(`opacity`,i.selectedOpacityFn?i.selectedOpacityFn(e):e.mo===void 0?s.opacity:e.mo),i.ms2mrc){var u=e.ms===`various`||s.size===`various`?3:i.ms2mrc(e.ms);e.mrc=u,i.selectedSizeFn&&(u=e.mrc=i.selectedSizeFn(e));var d=v.symbolNumber(e.mx||s.symbol)||0;e.om=d%200>=100;var f=pe(e,n),p=ne(e,n);t.attr(`d`,k(d,u,f,p))}var m=!1,h,g,_;if(e.so)_=l.outlierwidth,g=l.outliercolor,h=s.outliercolor;else{var y=(l||{}).width;_=(e.mlw+1||y+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,g=`mlc`in e?e.mlcc=i.lineScale(e.mlc):r.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,r.isArrayOrTypedArray(s.color)&&(h=c.defaultLine,m=!0),h=`mc`in e?e.mcc=i.markerScale(e.mc):s.color||s.colors||`rgba(0,0,0,0)`,i.selectedColorFn&&(h=i.selectedColorFn(e))}let b=e.mld||(l||{}).dash;if(b&&v.dashLine(t,b,_),e.om)t.call(c.stroke,h).style({"stroke-width":(_||1)+`px`,fill:`none`});else{t.style(`stroke-width`,(e.isBlank?0:_)+`px`);var x=s.gradient,S=e.mgt;S?m=!0:S=x&&x.type,r.isArrayOrTypedArray(S)&&(S=S[0],j[S]||(S=0));var C=s.pattern,w=v.getPatternAttr,T=C&&(w(C.shape,e.i,``)||w(C.path,e.i,``));if(S&&S!==`none`){var E=e.mgc;E?m=!0:E=x.color;var D=n.uid;m&&(D+=`-`+e.i),v.gradient(t,a,D,S,[[0,E],[1,h]],`fill`)}else if(T){var O=!1,A=C.fgcolor;!A&&o&&o.color&&(A=o.color,O=!0);var M=w(A,e.i,o&&o.color||null),N=w(C.bgcolor,e.i,null),P=C.fgopacity,F=w(C.size,e.i,8),I=w(C.solidity,e.i,.3);O=O||e.mcc||r.isArrayOrTypedArray(C.shape)||r.isArrayOrTypedArray(C.path)||r.isArrayOrTypedArray(C.bgcolor)||r.isArrayOrTypedArray(C.fgcolor)||r.isArrayOrTypedArray(C.size)||r.isArrayOrTypedArray(C.solidity);var L=n.uid;O&&(L+=`-`+e.i),v.pattern(t,`point`,a,L,T,F,I,e.mcc,C.fillmode,N,M,P)}else r.isArrayOrTypedArray(h)?c.fill(t,h[e.i]):c.fill(t,h);_&&c.stroke(t,g)}},v.makePointStyleFns=function(e){var t={},n=e.marker;return t.markerScale=v.tryColorscale(n,``),t.lineScale=v.tryColorscale(n,`line`),s.traceIs(e,`symbols`)&&(t.ms2mrc=h.isBubble(e)?g(e):function(){return(n.size||6)/2}),e.selectedpoints&&r.extendFlat(t,v.makeSelectedPointStyleFns(e)),t},v.makeSelectedPointStyleFns=function(e){var t={},n=e.selected||{},i=e.unselected||{},a=e.marker||{},o=n.marker||{},c=i.marker||{},l=a.opacity,u=o.opacity,d=c.opacity,f=u!==void 0,p=d!==void 0;(r.isArrayOrTypedArray(l)||f||p)&&(t.selectedOpacityFn=function(e){var t=e.mo===void 0?a.opacity:e.mo;return e.selected?f?u:t:p?d:m*t});var h=a.color,g=o.color,_=c.color;(g||_)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?g||t:_||t});var v=a.size,y=o.size,b=c.size,x=y!==void 0,S=b!==void 0;return s.traceIs(e,`symbols`)&&(x||S)&&(t.selectedSizeFn=function(e){var t=e.mrc||v/2;return e.selected?x?y/2:t:S?b/2:t}),t},v.makeSelectedTextStyleFns=function(e){var t={},n=e.selected||{},r=e.unselected||{},i=e.textfont||{},a=n.textfont||{},o=r.textfont||{},s=i.color,l=a.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?l||t:u||(l?t:c.addOpacity(t,m))},t},v.selectedPointStyle=function(e,t){if(!(!e.size()||!t.selectedpoints)){var r=v.makeSelectedPointStyleFns(t),i=t.marker||{},a=[];r.selectedOpacityFn&&a.push(function(e,t){e.style(`opacity`,r.selectedOpacityFn(t))}),r.selectedColorFn&&a.push(function(e,t){c.fill(e,r.selectedColorFn(t))}),r.selectedSizeFn&&a.push(function(e,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);e.attr(`d`,k(v.symbolNumber(a),o,pe(n,t),ne(n,t))),n.mrc2=o}),a.length&&e.each(function(e){for(var t=n.select(this),r=0;r<a.length;r++)a[r](t,e)})}},v.tryColorscale=function(e,t){var n=t?r.nestedProperty(e,t).get():e;if(n){var i=n.color;if((n.colorscale||n._colorAx)&&r.isArrayOrTypedArray(i))return l.makeColorScaleFuncFromTrace(n)}return r.identity};var N={start:1,end:-1,middle:0,bottom:1,top:-1};function P(e,t,r,i,a){var o=n.select(e.node().parentNode),s=t.indexOf(`top`)===-1?t.indexOf(`bottom`)===-1?`middle`:`bottom`:`top`,c=t.indexOf(`left`)===-1?t.indexOf(`right`)===-1?`middle`:`start`:`end`,l=i?i/.8+1:0,f=(d.lineCount(e)-1)*p+1,m=N[c]*l,h=r*.75+N[s]*l+(N[s]-1)*f*r/2;e.attr(`text-anchor`,c),a||o.attr(`transform`,u(m,h))}function F(e,t){var n=e.ts||t.textfont.size;return a(n)&&n>0?n:0}v.textPointStyle=function(e,t,i){if(e.size()){var a;t.selectedpoints&&(a=v.makeSelectedTextStyleFns(t).selectedTextColorFn);var o=t.texttemplate,s=i._fullLayout;e.each(function(e){var c=n.select(this),l=o?r.extractOption(e,t,`txt`,`texttemplate`):r.extractOption(e,t,`tx`,`text`);if(!l&&l!==0){c.remove();return}if(o){var u=t._module.formatLabels,f=u?u(e,t,s):{},p={};_(p,t,e.i),l=r.texttemplateString({data:[p,e,t._meta],fallback:t.texttemplatefallback,labels:f,locale:s._d3locale,template:l})}var m=e.tp||t.textposition,h=F(e,t),g=a?a(e):e.tc||t.textfont.color;c.call(v.font,{family:e.tf||t.textfont.family,weight:e.tw||t.textfont.weight,style:e.ty||t.textfont.style,variant:e.tv||t.textfont.variant,textcase:e.tC||t.textfont.textcase,lineposition:e.tE||t.textfont.lineposition,shadow:e.tS||t.textfont.shadow,size:h,color:g}).text(l).call(d.convertToTspans,i).call(P,m,h,e.mrc)})}},v.selectedTextStyle=function(e,t){if(!(!e.size()||!t.selectedpoints)){var r=v.makeSelectedTextStyleFns(t);e.each(function(e){var i=n.select(this),a=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=F(e,t);c.fill(i,a);var u=s.traceIs(t,`bar-like`);P(i,o,l,e.mrc2||e.mrc,u)})}};var I=.5;v.smoothopen=function(e,t){if(e.length<3)return`M`+e.join(`L`);var n=`M`+e[0],r=[],i;for(i=1;i<e.length-1;i++)r.push(U(e[i-1],e[i],e[i+1],t));for(n+=`Q`+r[0][0]+` `+e[1],i=2;i<e.length-1;i++)n+=`C`+r[i-2][1]+` `+r[i-1][0]+` `+e[i];return n+=`Q`+r[e.length-3][1]+` `+e[e.length-1],n},v.smoothclosed=function(e,t){if(e.length<3)return`M`+e.join(`L`)+`Z`;var n=`M`+e[0],r=e.length-1,i=[U(e[r],e[0],e[1],t)],a;for(a=1;a<r;a++)i.push(U(e[a-1],e[a],e[a+1],t));for(i.push(U(e[r-1],e[r],e[0],t)),a=1;a<=r;a++)n+=`C`+i[a-1][1]+` `+i[a][0]+` `+e[a];return n+=`C`+i[r][1]+` `+i[0][0]+` `+e[0]+`Z`,n};var L,z;function B(e,t,n){return n&&(e=K(e)),t?H(e[1]):V(e[0])}function V(e){var t=n.round(e,2);return L=t,t}function H(e){var t=n.round(e,2);return z=t,t}function U(e,t,n,r){var i=e[0]-t[0],a=e[1]-t[1],o=n[0]-t[0],s=n[1]-t[1],c=(i*i+a*a)**(I/2),l=(o*o+s*s)**(I/2),u=(l*l*i-c*c*o)*r,d=(l*l*a-c*c*s)*r,f=3*l*(c+l),p=3*c*(c+l);return[[V(t[0]+(f&&u/f)),H(t[1]+(f&&d/f))],[V(t[0]-(p&&u/p)),H(t[1]-(p&&d/p))]]}var W={hv:function(e,t,n){return`H`+V(t[0])+`V`+B(t,1,n)},vh:function(e,t,n){return`V`+H(t[1])+`H`+B(t,0,n)},hvh:function(e,t,n){return`H`+V((e[0]+t[0])/2)+`V`+H(t[1])+`H`+B(t,0,n)},vhv:function(e,t,n){return`V`+H((e[1]+t[1])/2)+`H`+V(t[0])+`V`+B(t,1,n)}},G=function(e,t,n){return`L`+B(t,0,n)+`,`+B(t,1,n)};v.steps=function(e){var t=W[e]||G;return function(e){for(var n=`M`+V(e[0][0])+`,`+H(e[0][1]),r=e.length,i=1;i<r;i++)n+=t(e[i-1],e[i],i===r-1);return n}};function K(e,t){var n=e.backoff,i=e.trace,a=e.d,o=e.i;if(n&&i&&i.marker&&i.marker.angle%360==0&&i.line&&i.line.shape!==`spline`){var s=r.isArrayOrTypedArray(n),c=e,l=t?t[0]:L||0,u=t?t[1]:z||0,d=c[0],f=c[1],p=d-l,m=f-u,h=Math.atan2(m,p),g=s?n[o]:n;if(g===`auto`){var _=c.i;i.type===`scatter`&&_--;var y=c.marker,b=y.symbol;r.isArrayOrTypedArray(b)&&(b=b[_]);var x=y.size;r.isArrayOrTypedArray(x)&&(x=x[_]),g=y?v.symbolBackOffs[v.symbolNumber(b)]*x:0,g+=v.getMarkerStandoff(a[_],i)||0}var S=d-g*Math.cos(h),C=f-g*Math.sin(h);(S<=d&&S>=l||S>=d&&S<=l)&&(C<=f&&C>=u||C>=f&&C<=u)&&(e=[S,C])}return e}v.applyBackoff=K,v.makeTester=function(){var e=r.ensureSingleById(n.select(`body`),`svg`,`js-plotly-tester`,function(e){e.attr(f.svgAttrs).style({position:`absolute`,left:`-10000px`,top:`-10000px`,width:`9000px`,height:`9000px`,"z-index":`1`})}),t=r.ensureSingle(e,`path`,`js-reference-point`,function(e){e.attr(`d`,`M0,0H1V1H0Z`).style({"stroke-width":0,fill:`black`})});v.tester=e,v.testref=t},v.savedBBoxes={};var Y=0,X=1e4;v.bBox=function(e,t,i){i||=Z(e);var a;if(i){if(a=v.savedBBoxes[i],a)return r.extendFlat({},a)}else if(e.childNodes.length===1){var o=e.childNodes[0];if(i=Z(o),i){var s=+o.getAttribute(`x`)||0,c=+o.getAttribute(`y`)||0,l=o.getAttribute(`transform`);if(!l){var u=v.bBox(o,!1,i);return s&&(u.left+=s,u.right+=s),c&&(u.top+=c,u.bottom+=c),u}if(i+=`~`+s+`~`+c+`~`+l,a=v.savedBBoxes[i],a)return r.extendFlat({},a)}}var f,p;t?f=e:(p=v.tester.node(),f=e.cloneNode(!0),p.appendChild(f)),n.select(f).attr(`transform`,null).call(d.positionText,0,0);var m=f.getBoundingClientRect(),h=v.testref.node().getBoundingClientRect();t||p.removeChild(f);var g={height:m.height,width:m.width,left:m.left-h.left,top:m.top-h.top,right:m.right-h.left,bottom:m.bottom-h.top};return Y>=X&&(v.savedBBoxes={},Y=0),i&&(v.savedBBoxes[i]=g),Y++,r.extendFlat({},g)};function Z(e){var t=e.getAttribute(`data-unformatted`);if(t!==null)return t+e.getAttribute(`data-math`)+e.getAttribute(`text-anchor`)+e.getAttribute(`style`)}v.setClipUrl=function(e,t,n){e.attr(`clip-path`,Q(t,n))};function Q(e,t){if(!e)return null;var n=t._context,r=n._exportedPlot?``:n._baseUrl||``;return r?`url('`+r+`#`+e+`')`:`url(#`+e+`)`}v.getTranslate=function(e){var t=(e[e.attr?`attr`:`getAttribute`](`transform`)||``).replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(e,t,n){return[t,n].join(` `)}).split(` `);return{x:+t[0]||0,y:+t[1]||0}},v.setTranslate=function(e,t,n){var r=/(\btranslate\(.*?\);?)/,i=e.attr?`attr`:`getAttribute`,a=e.attr?`attr`:`setAttribute`,o=e[i](`transform`)||``;return t||=0,n||=0,o=o.replace(r,``).trim(),o+=u(t,n),o=o.trim(),e[a](`transform`,o),o},v.getScale=function(e){var t=(e[e.attr?`attr`:`getAttribute`](`transform`)||``).replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(e,t,n){return[t,n].join(` `)}).split(` `);return{x:+t[0]||1,y:+t[1]||1}},v.setScale=function(e,t,n){var r=/(\bscale\(.*?\);?)/,i=e.attr?`attr`:`getAttribute`,a=e.attr?`attr`:`setAttribute`,o=e[i](`transform`)||``;return t||=1,n||=1,o=o.replace(r,``).trim(),o+=`scale(`+t+`,`+n+`)`,o=o.trim(),e[a](`transform`,o),o};var ee=/\s*sc.*/;v.setPointGroupScale=function(e,t,n){if(t||=1,n||=1,e){var r=t===1&&n===1?``:`scale(`+t+`,`+n+`)`;e.each(function(){var e=(this.getAttribute(`transform`)||``).replace(ee,``);e+=r,e=e.trim(),this.setAttribute(`transform`,e)})}};var te=/translate\([^)]*\)\s*$/;v.setTextPointsScale=function(e,t,r){e&&e.each(function(){var e,i=n.select(this),a=i.select(`text`);if(a.node()){var o=parseFloat(a.attr(`x`)||0),s=parseFloat(a.attr(`y`)||0),c=(i.attr(`transform`)||``).match(te);e=t===1&&r===1?[]:[u(o,s),`scale(`+t+`,`+r+`)`,u(-o,-s)],c&&e.push(c),i.attr(`transform`,e.join(``))}})};function ne(e,t){var n;return e&&(n=e.mf),n===void 0&&(n=t.marker&&t.marker.standoff||0),!t._geo&&!t._xA?-n:n}v.getMarkerStandoff=ne;var re=Math.atan2,ie=Math.cos,ae=Math.sin;function oe(e,t){var n=t[0],r=t[1];return[n*ie(e)-r*ae(e),n*ae(e)+r*ie(e)]}var se,ce,le,ue,de,fe;function pe(e,t){var n=e.ma;n===void 0&&(n=t.marker.angle,(!n||r.isArrayOrTypedArray(n))&&(n=0));var i,o,s=t.marker.angleref;if(s===`previous`||s===`north`){if(t._geo){var c=t._geo.project(e.lonlat);i=c[0],o=c[1]}else{var l=t._xA,u=t._yA;if(l&&u)i=l.c2p(e.x),o=u.c2p(e.y);else return 90}if(t._geo){var d=e.lonlat[0],f=e.lonlat[1],p=t._geo.project([d,f+1e-5]),m=t._geo.project([d+1e-5,f]),h=re(m[1]-o,m[0]-i),g=re(p[1]-o,p[0]-i),_;if(s===`north`)_=n/180*Math.PI;else if(s===`previous`){var v=d/180*Math.PI,y=f/180*Math.PI,b=se/180*Math.PI,x=ce/180*Math.PI,S=b-v;_=-re(ie(x)*ae(S),ae(x)*ie(y)-ie(x)*ae(y)*ie(S))-Math.PI,se=d,ce=f}var C=oe(h,[ie(_),0]),w=oe(g,[ae(_),0]);n=re(C[1]+w[1],C[0]+w[0])/Math.PI*180,s===`previous`&&!(fe===t.uid&&e.i===de+1)&&(n=null)}if(s===`previous`&&!t._geo)if(fe===t.uid&&e.i===de+1&&a(i)&&a(o)){var T=i-le,E=o-ue,D=t.line&&t.line.shape||``,O=D.slice(D.length-1);O===`h`&&(E=0),O===`v`&&(T=0),n+=re(E,T)/Math.PI*180+90}else n=null}return le=i,ue=o,de=e.i,fe=t.uid,n}v.getMarkerAngle=pe}),nn=h((e,t)=>{var n=S(),r=D(),i=Et(),a=Ke(),o=$(),s=o.strTranslate,c=tn(),l=q(),u=kt(),d=J(),f=Ot().OPPOSITE_SIDE,p=/ [XY][0-9]* /,m=1.6,h=1.6;function g(e,t,g){var _=e._fullLayout,v=g.propContainer,y=g.propName,b=g.placeholder,x=g.traceIndex,S=g.avoid||{},C=g.attributes,w=g.transform,T=g.containerGroup,E=1,D=v.title,O=(D&&D.text?D.text:``).trim(),k=!1,A=D&&D.font?D.font:{},j=A.family,M=A.size,N=A.color,P=A.weight,F=A.style,I=A.variant,L=A.textcase,R=A.lineposition,z=A.shadow,B=!!g.subtitlePropName,V=g.subtitlePlaceholder,H=(v.title||{}).subtitle||{text:``,font:{}},U=(H.text||``).trim(),W=!1,G=1,K=H.font,q=K.family,J=K.size,Y=K.color,X=K.weight,Z=K.style,Q=K.variant,ee=K.textcase,te=K.lineposition,ne=K.shadow,re;y===`title.text`?re=`titleText`:y.indexOf(`axis`)===-1?y.indexOf(`colorbar`)!==-1&&(re=`colorbarTitleText`):re=`axisTitleText`;var ie=e._context.edits[re];function ae(e,t){return e===void 0||t===void 0?!1:e.replace(p,` % `)===t.replace(p,` % `)}O===``?E=0:ae(O,b)&&(ie||(O=``),E=.2,k=!0),B&&(U===``?G=0:ae(U,V)&&(ie||(U=``),G=.2,W=!0)),g._meta?O=o.templateString(O,g._meta):_._meta&&(O=o.templateString(O,_._meta));var oe=O||U||ie,se;T||(T=o.ensureSingle(_._infolayer,`g`,`g-`+t),se=_._hColorbarMoveTitle);var ce=T.selectAll(`text.`+t).data(oe?[0]:[]);ce.enter().append(`text`),ce.text(O).attr(`class`,t),ce.exit().remove();var le=null,ue=t+`-subtitle`,de=U||ie;if(B&&(le=T.selectAll(`text.`+ue).data(de?[0]:[]),le.enter().append(`text`),le.text(U).attr(`class`,ue),le.exit().remove()),!oe)return T;function fe(e,t){o.syncOrAsync([pe,me],{title:e,subtitle:t})}function pe(r){var a=r.title,d=r.subtitle,f;!w&&se&&(w={}),w?(f=``,w.rotate&&(f+=`rotate(`+[w.rotate,C.x,C.y]+`)`),(w.offset||se)&&(f+=s(0,(w.offset||0)-(se||0)))):f=null,a.attr(`transform`,f);function p(e){if(e){var t=n.select(e.node().parentNode).select(`.`+ue);if(!t.empty()){var r=e.node().getBBox();if(r.height){var i=r.y+r.height+m*J;t.attr(`y`,i)}}}}if(a.style(`opacity`,E*l.opacity(N)).call(c.font,{color:l.rgb(N),size:n.round(M,2),family:j,weight:P,style:F,variant:I,textcase:L,shadow:z,lineposition:R}).attr(C).call(u.convertToTspans,e,p),d&&!d.empty()){var g=T.select(`.`+t+`-math-group`),_=a.node().getBBox(),v=g.node()?g.node().getBBox():void 0,y=v?v.y+v.height+m*J:_.y+_.height+h*J,b=o.extendFlat({},C,{y});d.attr(`transform`,f),d.style(`opacity`,G*l.opacity(Y)).call(c.font,{color:l.rgb(Y),size:n.round(J,2),family:q,weight:X,style:Z,variant:Q,textcase:ee,shadow:ne,lineposition:te}).attr(b).call(u.convertToTspans,e)}return i.previousPromises(e)}function me(t){var i=t.title,a=n.select(i.node().parentNode);if(S&&S.selection&&S.side&&O){a.attr(`transform`,null);var l=f[S.side],u=S.side===`left`||S.side===`top`?-1:1,d=r(S.pad)?S.pad:2,p=c.bBox(a.node()),m={t:0,b:0,l:0,r:0},h=e._fullLayout._reservedMargin;for(var g in h)for(var y in h[g]){var b=h[g][y];m[y]=Math.max(m[y],b)}var x={left:m.l,top:m.t,right:_.width-m.r,bottom:_.height-m.b},C=S.maxShift||u*(x[S.side]-p[S.side]),w=0;if(C<0)w=C;else{var T=S.offsetLeft||0,E=S.offsetTop||0;p.left-=T,p.right-=T,p.top-=E,p.bottom-=E,S.selection.each(function(){var e=c.bBox(this);o.bBoxIntersect(p,e,d)&&(w=Math.max(w,u*(e[S.side]-p[l])+d))}),w=Math.min(C,w),v._titleScoot=Math.abs(w)}if(w>0||C<0){var D={left:[-w,0],right:[w,0],top:[0,-w],bottom:[0,w]}[S.side];a.attr(`transform`,s(D[0],D[1]))}}}ce.call(fe,le);function he(e,t){e.text(t).on(`mouseover.opacity`,function(){n.select(this).transition().duration(d.SHOW_PLACEHOLDER).style(`opacity`,1)}).on(`mouseout.opacity`,function(){n.select(this).transition().duration(d.HIDE_PLACEHOLDER).style(`opacity`,0)})}if(ie&&(O?ce.on(`.opacity`,null):(he(ce,b),k=!0),ce.call(u.makeEditable,{gd:e}).on(`edit`,function(t){x===void 0?a.call(`_guiRelayout`,e,y,t):a.call(`_guiRestyle`,e,y,t,x)}).on(`cancel`,function(){this.text(this.attr(`data-unformatted`)).call(fe)}).on(`input`,function(e){this.text(e||` `).call(u.positionText,C.x,C.y)}),B)){if(B&&!O){var ge=ce.node().getBBox(),_e=ge.y+ge.height+h*J;le.attr(`y`,_e)}U?le.on(`.opacity`,null):(he(le,V),W=!0),le.call(u.makeEditable,{gd:e}).on(`edit`,function(t){a.call(`_guiRelayout`,e,`title.subtitle.text`,t)}).on(`cancel`,function(){this.text(this.attr(`data-unformatted`)).call(fe)}).on(`input`,function(e){this.text(e||` `).call(u.positionText,le.attr(`x`),le.attr(`y`))})}return ce.classed(`js-placeholder`,k),le&&!le.empty()&&le.classed(`js-placeholder`,W),T}t.exports={draw:g,SUBTITLE_PADDING_EM:h,SUBTITLE_PADDING_MATHJAX_EM:m}}),rn=h((e,t)=>{var n=S(),r=w().utcFormat,i=$(),a=i.numberFormat,o=D(),s=i.cleanNumber,c=i.ms2DateTime,l=i.dateTime2ms,u=i.ensureNumber,d=i.isArrayOrTypedArray,f=O(),p=f.FP_SAFE,m=f.BADNUM,h=f.LOG_CLIP,g=f.ONEWEEK,_=f.ONEDAY,v=f.ONEHOUR,y=f.ONEMIN,b=f.ONESEC,x=xt(),C=bt(),T=C.HOUR_PATTERN,E=C.WEEKDAY_PATTERN;function k(e){return 10**e}function A(e){return e!=null}t.exports=function(e,t){t||={};var f=e._id||`x`,S=f.charAt(0);function w(t,n){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&n&&e.range&&e.range.length===2){var r=e.range[0],i=e.range[1];return .5*(r+i-2*h*Math.abs(r-i))}else return m}function D(t,n,r,a){if((a||{}).msUTC&&o(t))return+t;var s=l(t,r||e.calendar);if(s===m)if(o(t)){t=+t;var c=Math.floor(i.mod(t+.05,1)*10),u=Math.round(t-c/10);s=l(new Date(u))+c/10}else return m;return s}function O(t,n,r){return c(t,n,r||e.calendar)}function j(t){return e._categories[Math.round(t)]}function M(t){if(A(t)){if(e._categoriesMap===void 0&&(e._categoriesMap={}),e._categoriesMap[t]!==void 0)return e._categoriesMap[t];e._categories.push(typeof t==`number`?String(t):t);var n=e._categories.length-1;return e._categoriesMap[t]=n,n}return m}function N(e,t){for(var n=Array(t),r=0;r<t;r++){var i=(e[0]||[])[r],a=(e[1]||[])[r];n[r]=P([i,a])}return n}function P(t){if(e._categoriesMap)return e._categoriesMap[t]}function F(e){var t=P(e);if(t!==void 0)return t;if(o(e))return+e}function I(e){return o(e)?+e:P(e)}function L(e,t,r){return n.round(r+t*e,2)}function R(e,t,n){return(e-n)/t}var z=function(t){return o(t)?L(t,e._m,e._b):m},B=function(t){return R(t,e._m,e._b)};if(e.rangebreaks){var V=S===`y`;z=function(t){if(!o(t))return m;var n=e._rangebreaks.length;if(!n)return L(t,e._m,e._b);var r=V;e.range[0]>e.range[1]&&(r=!r);for(var i=r?-1:1,a=i*t,s=0,c=0;c<n;c++){var l=i*e._rangebreaks[c].min,u=i*e._rangebreaks[c].max;if(a<l)break;if(a>u)s=c+1;else{s=a<(l+u)/2?c:c+1;break}}var d=e._B[s]||0;return isFinite(d)?L(t,e._m2,d):0},B=function(t){var n=e._rangebreaks.length;if(!n)return R(t,e._m,e._b);for(var r=0,i=0;i<n&&!(t<e._rangebreaks[i].pmin);i++)t>e._rangebreaks[i].pmax&&(r=i+1);return R(t,e._m2,e._B[r])}}e.c2l=e.type===`log`?w:u,e.l2c=e.type===`log`?k:u,e.l2p=z,e.p2l=B,e.c2p=e.type===`log`?function(e,t){return z(w(e,t))}:z,e.p2c=e.type===`log`?function(e){return k(B(e))}:B,[`linear`,`-`].indexOf(e.type)===-1?e.type===`log`?(e.d2r=e.d2l=function(e,t){return w(s(e),t)},e.r2d=e.r2c=function(e){return k(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=u,e.c2r=w,e.l2d=k,e.d2p=function(t,n){return e.l2p(e.d2r(t,n))},e.p2d=function(e){return k(B(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=B,e.cleanPos=u):e.type===`date`?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=D,e.c2d=e.c2r=e.l2d=e.l2r=O,e.d2p=e.r2p=function(t,n,r){return e.l2p(D(t,0,r))},e.p2d=e.p2r=function(e,t,n){return O(B(e),t,n)},e.cleanPos=function(t){return i.cleanDate(t,m,e.calendar)}):e.type===`category`?(e.d2c=e.d2l=M,e.r2d=e.c2d=e.l2d=j,e.d2r=e.d2l_noadd=F,e.r2c=function(t){var n=I(t);return n===void 0?e.fraction2r(.5):n},e.l2r=e.c2r=u,e.r2l=I,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return j(B(e))},e.r2p=e.d2p,e.p2r=B,e.cleanPos=function(e){return typeof e==`string`&&e!==``?e:u(e)}):e.type===`multicategory`&&(e.r2d=e.c2d=e.l2d=j,e.d2r=e.d2l_noadd=F,e.r2c=function(t){var n=F(t);return n===void 0?e.fraction2r(.5):n},e.r2c_just_indices=P,e.l2r=e.c2r=u,e.r2l=F,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return j(B(e))},e.r2p=e.d2p,e.p2r=B,e.cleanPos=function(e){return Array.isArray(e)||typeof e==`string`&&e!==``?e:u(e)},e.setupMultiCategory=function(n){var r=e._traceIndices,a,o,s=e._matchGroup;if(s&&e._categories.length===0){for(var c in s)if(c!==f){var l=t[x.id2name(c)];r=r.concat(l._traceIndices)}}var u=[[0,{}],[0,{}]],p=[];for(a=0;a<r.length;a++){var m=n[r[a]];if(S in m){var h=m[S],g=m._length||i.minRowLength(h);if(d(h[0])&&d(h[1]))for(o=0;o<g;o++){var _=h[0][o],v=h[1][o];A(_)&&A(v)&&(p.push([_,v]),_ in u[0][1]||(u[0][1][_]=u[0][0]++),v in u[1][1]||(u[1][1][v]=u[1][0]++))}}}for(p.sort(function(e,t){var n=u[0][1],r=n[e[0]]-n[t[0]];if(r)return r;var i=u[1][1];return i[e[1]]-i[t[1]]}),a=0;a<p.length;a++)M(p[a])}):(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=u,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=B,e.cleanPos=u),e.fraction2r=function(t){var n=e.r2l(e.range[0]),r=e.r2l(e.range[1]);return e.l2r(n+t*(r-n))},e.r2fraction=function(t){var n=e.r2l(e.range[0]),r=e.r2l(e.range[1]);return(e.r2l(t)-n)/(r-n)},e.limitRange=function(t){var n=e.minallowed,r=e.maxallowed;if(!(n===void 0&&r===void 0)){t||=`range`;var a=i.nestedProperty(e,t).get(),o=i.simpleMap(a,e.r2l),s=o[1]<o[0];s&&o.reverse();var c=i.simpleMap([n,r],e.r2l);if(n!==void 0&&o[0]<c[0]&&(a[s?1:0]=n),r!==void 0&&o[1]>c[1]&&(a[s?0:1]=r),a[0]===a[1]){var l=e.l2r(n),u=e.l2r(r);if(n!==void 0){var d=l+1;r!==void 0&&(d=Math.min(d,u)),a[s?1:0]=d}if(r!==void 0){var f=u+1;n!==void 0&&(f=Math.max(f,l)),a[s?0:1]=f}}}},e.cleanRange=function(t,n){e._cleanRange(t,n),e.limitRange(t)},e._cleanRange=function(t,n){n||={},t||=`range`;var r=i.nestedProperty(e,t).get(),a,s;if(s=e.type===`date`?i.dfltRange(e.calendar):S===`y`?C.DFLTRANGEY:e._name===`realaxis`?[0,1]:n.dfltRange||C.DFLTRANGEX,s=s.slice(),(e.rangemode===`tozero`||e.rangemode===`nonnegative`)&&(s[0]=0),!r||r.length!==2){i.nestedProperty(e,t).set(s);return}var c=r[0]===null,l=r[1]===null;for(e.type===`date`&&!e.autorange&&(r[0]=i.cleanDate(r[0],m,e.calendar),r[1]=i.cleanDate(r[1],m,e.calendar)),a=0;a<2;a++)if(e.type===`date`){if(!i.isDateTime(r[a],e.calendar)){e[t]=s;break}if(e.r2l(r[0])===e.r2l(r[1])){var u=i.constrain(e.r2l(r[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);r[0]=e.l2r(u-1e3),r[1]=e.l2r(u+1e3);break}}else{if(!o(r[a]))if(!(c||l)&&o(r[1-a]))r[a]=r[1-a]*(a?10:.1);else{e[t]=s;break}if(r[a]<-p?r[a]=-p:r[a]>p&&(r[a]=p),r[0]===r[1]){var d=Math.max(1,Math.abs(r[0]*1e-6));r[0]-=d,r[1]+=d}}},e.setScale=function(n){var r=t._size;e.overlaying&&(e.domain=x.getFromId({_fullLayout:t},e.overlaying).domain);var i=n&&e._r?`_r`:`range`,a=e.calendar;e.cleanRange(i);var o=e.r2l(e[i][0],a),s=e.r2l(e[i][1],a),c=S===`y`;if(c?(e._offset=r.t+(1-e.domain[1])*r.h,e._length=r.h*(e.domain[1]-e.domain[0]),e._m=e._length/(o-s),e._b=-e._m*s):(e._offset=r.l+e.domain[0]*r.w,e._length=r.w*(e.domain[1]-e.domain[0]),e._m=e._length/(s-o),e._b=-e._m*o),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks){var l,u;if(e._rangebreaks=e.locateBreaks(Math.min(o,s),Math.max(o,s)),e._rangebreaks.length){for(l=0;l<e._rangebreaks.length;l++)u=e._rangebreaks[l],e._lBreaks+=Math.abs(u.max-u.min);var d=c;o>s&&(d=!d),d&&e._rangebreaks.reverse();var f=d?-1:1;for(e._m2=f*e._length/(Math.abs(s-o)-e._lBreaks),e._B.push(-e._m2*(c?s:o)),l=0;l<e._rangebreaks.length;l++)u=e._rangebreaks[l],e._B.push(e._B[e._B.length-1]-f*e._m2*(u.max-u.min));for(l=0;l<e._rangebreaks.length;l++)u=e._rangebreaks[l],u.pmin=z(u.min),u.pmax=z(u.max)}}if(!isFinite(e._m)||!isFinite(e._b)||e._length<0)throw t._replotting=!1,Error(`Something went wrong with axis scaling`)},e.maskBreaks=function(t){var n=e.rangebreaks||[],r,a,o,c,l;n._cachedPatterns||=n.map(function(t){return t.enabled&&t.bounds?i.simpleMap(t.bounds,t.pattern?s:e.d2c):null}),n._cachedValues||=n.map(function(t){return t.enabled&&t.values?i.simpleMap(t.values,e.d2c).sort(i.sorterAsc):null});for(var u=0;u<n.length;u++){var d=n[u];if(d.enabled){if(d.bounds){var f=d.pattern;switch(r=n._cachedPatterns[u],a=r[0],o=r[1],f){case E:l=new Date(t),c=l.getUTCDay(),a>o&&(o+=7,c<a&&(c+=7));break;case T:l=new Date(t);var p=l.getUTCHours(),h=l.getUTCMinutes(),g=l.getUTCSeconds(),_=l.getUTCMilliseconds();c=p+(h/60+g/3600+_/36e5),a>o&&(o+=24,c<a&&(c+=24));break;case``:c=t;break}if(c>=a&&c<o)return m}else for(var v=n._cachedValues[u],y=0;y<v.length;y++)if(a=v[y],o=a+d.dvalue,t>=a&&t<o)return m}}return t},e.locateBreaks=function(t,n){var r,a,o,c,l=[];if(!e.rangebreaks)return l;var u=e.rangebreaks.slice().sort(function(e,t){return e.pattern===E&&t.pattern===T?-1:t.pattern===E&&e.pattern===T?1:0}),d=function(e,r){if(e=i.constrain(e,t,n),r=i.constrain(r,t,n),e!==r){for(var a=!0,o=0;o<l.length;o++){var s=l[o];e<s.max&&r>=s.min&&(e<s.min&&(s.min=e),r>s.max&&(s.max=r),a=!1)}a&&l.push({min:e,max:r})}};for(r=0;r<u.length;r++){var f=u[r];if(f.enabled)if(f.bounds){var p=t,m=n;f.pattern&&(p=Math.floor(p)),a=i.simpleMap(f.bounds,f.pattern?s:e.r2l),o=a[0],c=a[1];var h=new Date(p),x,S;switch(f.pattern){case E:S=g,x=((c<o?7:0)+(c-o))*_,p+=o*_-(h.getUTCDay()*_+h.getUTCHours()*v+h.getUTCMinutes()*y+h.getUTCSeconds()*b+h.getUTCMilliseconds());break;case T:S=_,x=((c<o?24:0)+(c-o))*v,p+=o*v-(h.getUTCHours()*v+h.getUTCMinutes()*y+h.getUTCSeconds()*b+h.getUTCMilliseconds());break;default:p=Math.min(a[0],a[1]),m=Math.max(a[0],a[1]),S=m-p,x=S}for(var C=p;C<m;C+=S)d(C,C+x)}else for(var w=i.simpleMap(f.values,e.d2c),D=0;D<w.length;D++)o=w[D],c=o+f.dvalue,d(o,c)}return l.sort(function(e,t){return e.min-t.min}),l},e.makeCalcdata=function(t,n,r){var a,o,s,c,l=e.type,u=l===`date`&&t[n+`calendar`];if(n in t){if(a=t[n],c=t._length||i.minRowLength(a),i.isTypedArray(a)&&(l===`linear`||l===`log`)){if(c===a.length)return a;if(a.subarray)return a.subarray(0,c)}if(l===`multicategory`)return N(a,c);for(o=Array(c),s=0;s<c;s++)o[s]=e.d2c(a[s],0,u,r)}else{var d=n+`0`in t?e.d2c(t[n+`0`],0,u):0,f=t[`d`+n]?Number(t[`d`+n]):1;for(a=t[{x:`y`,y:`x`}[n]],c=t._length||a.length,o=Array(c),s=0;s<c;s++)o[s]=d+s*f}if(e.rangebreaks)for(s=0;s<c;s++)o[s]=e.maskBreaks(o[s]);return o},e.isValidRange=function(t,n){return Array.isArray(t)&&t.length===2&&(n&&t[0]===null||o(e.r2l(t[0])))&&(n&&t[1]===null||o(e.r2l(t[1])))},e.getAutorangeDflt=function(t,n){var r=!e.isValidRange(t,`nullOk`);return r&&n&&n.reverseDflt?r=`reversed`:t&&(t[0]===null&&t[1]===null?r=!0:t[0]===null&&t[1]!==null?r=`min`:t[0]!==null&&t[1]===null&&(r=`max`)),r},e.isReversed=function(){var t=e.autorange;return t===`reversed`||t===`min reversed`||t===`max reversed`},e.isPtWithinRange=function(t,n){var r=e.c2l(t[S],null,n),i=e.r2l(e.range[0]),a=e.r2l(e.range[1]);return i<a?i<=r&&r<=a:a<=r&&r<=i},e._emptyCategories=function(){e._categories=[],e._categoriesMap={}},e.clearCalc=function(){var n=e._matchGroup;if(n){var r=null,i=null;for(var a in n){var o=t[x.id2name(a)];if(o._categories){r=o._categories,i=o._categoriesMap;break}}r&&i?(e._categories=r,e._categoriesMap=i):e._emptyCategories()}else e._emptyCategories();if(e._initialCategories)for(var s=0;s<e._initialCategories.length;s++)M(e._initialCategories[s])},e.sortByInitialCategories=function(){var n=[];if(e._emptyCategories(),e._initialCategories)for(var r=0;r<e._initialCategories.length;r++)M(e._initialCategories[r]);for(var i in n=n.concat(e._traceIndices),e._matchGroup)if(f!==i){var a=t[x.id2name(i)];a._categories=e._categories,a._categoriesMap=e._categoriesMap,n=n.concat(a._traceIndices)}return n};var H=t._d3locale;e.type===`date`&&(e._dateFormat=H?H.timeFormat:r,e._extraFormat=t._extraFormat),e._separators=t.separators,e._numFormat=H?H.numberFormat:a,delete e._minDtick,delete e._forceTick0}}),an=h((e,t)=>{var n=D(),r=$(),i=O().BADNUM,a=r.isArrayOrTypedArray,o=r.isDateTime,s=r.cleanNumber,c=Math.round;t.exports=function(e,t,n){var r=e,i=n.noMultiCategory;if(a(r)&&!r.length)return`-`;if(!i&&m(r))return`multicategory`;if(i&&Array.isArray(r[0])){for(var o=[],s=0;s<r.length;s++)if(a(r[s]))for(var c=0;c<r[s].length;c++)o.push(r[s][c]);r=o}if(d(r,t))return`date`;var l=n.autotypenumbers!==`strict`;return p(r,l)?`category`:u(r,l)?`linear`:`-`};function l(e,t){return t?n(e):typeof e==`number`}function u(e,t){for(var n=e.length,r=0;r<n;r++)if(l(e[r],t))return!0;return!1}function d(e,t){for(var r=e.length,i=f(r),a=0,s=0,l={},u=0;u<r;u+=i){var d=e[c(u)],p=String(d);l[p]||(l[p]=1,o(d,t)&&a++,n(d)&&s++)}return a>s*2}function f(e){return Math.max(1,(e-1)/1e3)}function p(e,t){for(var n=e.length,r=f(n),a=0,o=0,l={},u=0;u<n;u+=r){var d=e[c(u)],p=String(d);if(!l[p]){l[p]=1;var m=typeof d;m===`boolean`?o++:(t?s(d)!==i:m===`number`)?a++:m===`string`&&o++}}return o>a*2}function m(e){return a(e[0])&&a(e[1])}}),on=h((e,t)=>{var n=S(),r=D(),i=$(),a=O().FP_SAFE,o=Ke(),s=tn(),c=xt(),l=c.getFromId,u=c.isLinked;t.exports={applyAutorangeOptions:j,getAutoRange:d,makePadFn:p,doAutoRange:_,findExtremes:v,concatExtremes:g};function d(e,t){var n,r,a=[],o=e._fullLayout,s=p(o,t,0),c=p(o,t,1),l=g(e,t),u=l.min,d=l.max;if(u.length===0||d.length===0)return i.simpleMap(t.range,t.r2l);var m=u[0].val,h=d[0].val;for(n=1;n<u.length&&m===h;n++)m=Math.min(m,u[n].val);for(n=1;n<d.length&&m===h;n++)h=Math.max(h,d[n].val);var _=t.autorange,v=_===`reversed`||_===`min reversed`||_===`max reversed`;if(!v&&t.range){var y=i.simpleMap(t.range,t.r2l);v=y[1]<y[0]}t.autorange===`reversed`&&(t.autorange=!0);var b=t.rangemode,x=b===`tozero`,S=b===`nonnegative`,C=t._length,w=C/10,T=0,E,D,O,k,A,M;for(n=0;n<u.length;n++)for(E=u[n],r=0;r<d.length;r++)D=d[r],M=D.val-E.val-f(t,E.val,D.val),M>0&&(A=C-s(E)-c(D),A>w?M/A>T&&(O=E,k=D,T=M/A):M/C>T&&(O={val:E.val,nopad:1},k={val:D.val,nopad:1},T=M/C));function N(e,t){return Math.max(e,c(t))}if(m===h){var P=m-1,F=m+1;if(x)if(m===0)a=[0,1];else{var I=(m>0?d:u).reduce(N,0),L=m/(1-Math.min(.5,I/C));a=m>0?[0,L]:[L,0]}else a=S?[Math.max(0,P),Math.max(1,F)]:[P,F]}else x?(O.val>=0&&(O={val:0,nopad:1}),k.val<=0&&(k={val:0,nopad:1})):S&&(O.val-T*s(O)<0&&(O={val:0,nopad:1}),k.val<=0&&(k={val:1,nopad:1})),T=(k.val-O.val-f(t,E.val,D.val))/(C-s(O)-c(k)),a=[O.val-T*s(O),k.val+T*c(k)];return a=j(a,t),t.limitRange&&t.limitRange(),v&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function f(e,t,n){var r=0;if(e.rangebreaks)for(var i=e.locateBreaks(t,n),a=0;a<i.length;a++){var o=i[a];r+=o.max-o.min}return r}function p(e,t,n){var r=.05*t._length,a=t._anchorAxis||{};if((t.ticklabelposition||``).indexOf(`inside`)!==-1||(a.ticklabelposition||``).indexOf(`inside`)!==-1){var o=t.isReversed();if(!o){var s=i.simpleMap(t.range,t.r2l);o=s[1]<s[0]}o&&(n=!n)}var c=0;return u(e,t._id)||(c=h(e,t,n)),r=Math.max(c,r),t.constrain===`domain`&&t._inputDomain&&(r*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(e){return e.nopad?0:e.pad+(e.extrapad?r:c)}}var m=3;function h(e,t,r){var a=0,o=t._id.charAt(0)===`x`;for(var c in e._plots){var l=e._plots[c];if(!(t._id!==l.xaxis._id&&t._id!==l.yaxis._id)){var u=(o?l.yaxis:l.xaxis)||{};if((u.ticklabelposition||``).indexOf(`inside`)!==-1&&(!r&&(u.side===`left`||u.side===`bottom`)||r&&(u.side===`top`||u.side===`right`))){if(u._vals){var d=i.deg2rad(u._tickAngles[u._id+`tick`]||0),f=Math.abs(Math.cos(d)),p=Math.abs(Math.sin(d));if(!u._vals[0].bb){var h=u._id+`tick`;u._selections[h].each(function(e){var t=n.select(this);t.select(`.text-math-group`).empty()&&(e.bb=s.bBox(t.node()))})}for(var g=0;g<u._vals.length;g++){var _=u._vals[g].bb;if(_){var v=2*m+_.width,y=2*m+_.height;a=Math.max(a,o?Math.max(v*f,y*p):Math.max(y*f,v*p))}}}u.ticks===`inside`&&u.ticklabelposition===`inside`&&(a+=u.ticklen||0)}}}return a}function g(e,t,n){var r=t._id,i=e._fullData,a=e._fullLayout,o=[],s=[],c,u,d;function f(e,t){for(c=0;c<t.length;c++){var n=e[t[c]],i=(n._extremes||{})[r];if(n.visible===!0&&i){for(u=0;u<i.min.length;u++)d=i.min[u],y(o,d.val,d.pad,{extrapad:d.extrapad});for(u=0;u<i.max.length;u++)d=i.max[u],b(s,d.val,d.pad,{extrapad:d.extrapad})}}}if(f(i,t._traceIndices),f(a.annotations||[],t._annIndices||[]),f(a.shapes||[],t._shapeIndices||[]),t._matchGroup&&!n){for(var p in t._matchGroup)if(p!==t._id){var m=l(e,p),h=g(e,m,!0),_=t._length/m._length;for(u=0;u<h.min.length;u++)d=h.min[u],y(o,d.val,d.pad*_,{extrapad:d.extrapad});for(u=0;u<h.max.length;u++)d=h.max[u],b(s,d.val,d.pad*_,{extrapad:d.extrapad})}}return{min:o,max:s}}function _(e,t,n){if(t.setScale(),t.autorange){t.range=n?n.slice():d(e,t),t._r=t.range.slice(),t._rl=i.simpleMap(t._r,t.r2l);var r=t._input,a={};a[t._attr+`.range`]=t.range,a[t._attr+`.autorange`]=t.autorange,o.call(`_storeDirectGUIEdit`,e.layout,e._fullLayout._preGUI,a),r.range=t.range.slice(),r.autorange=t.autorange}var s=t._anchorAxis;if(s&&s.rangeslider){var c=s.rangeslider[t._name];c&&c.rangemode===`auto`&&(c.range=d(e,t)),s._input.rangeslider[t._name]=i.extendFlat({},c)}}function v(e,t,n){n||={},e._m||e.setScale();var i=[],o=[],s=t.length,c=n.padded||!1,l=n.tozero&&(e.type===`linear`||e.type===`-`),u=e.type===`log`,d=!1,f=n.vpadLinearized||!1,p,m,h,g,_,v,x,S,w;function T(e){if(Array.isArray(e))return d=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var E=T((e._m>0?n.ppadplus:n.ppadminus)||n.ppad||0),D=T((e._m>0?n.ppadminus:n.ppadplus)||n.ppad||0),O=T(n.vpadplus||n.vpad),k=T(n.vpadminus||n.vpad);if(!d){if(S=1/0,w=-1/0,u)for(p=0;p<s;p++)m=t[p],m<S&&m>0&&(S=m),m>w&&m<a&&(w=m);else for(p=0;p<s;p++)m=t[p],m<S&&m>-a&&(S=m),m>w&&m<a&&(w=m);t=[S,w],s=2}var A={tozero:l,extrapad:c};function j(n){h=t[n],r(h)&&(v=E(n),x=D(n),f?(g=e.c2l(h)-k(n),_=e.c2l(h)+O(n)):(S=h-k(n),w=h+O(n),u&&S<w/10&&(S=w/10),g=e.c2l(S),_=e.c2l(w)),l&&(g=Math.min(0,g),_=Math.max(0,_)),C(g)&&y(i,g,x,A),C(_)&&b(o,_,v,A))}var M=Math.min(6,s);for(p=0;p<M;p++)j(p);for(p=s-1;p>=M;p--)j(p);return{min:i,max:o,opts:n}}function y(e,t,n,r){x(e,t,n,r,w)}function b(e,t,n,r){x(e,t,n,r,T)}function x(e,t,n,r,i){for(var a=r.tozero,o=r.extrapad,s=!0,c=0;c<e.length&&s;c++){var l=e[c];if(i(l.val,t)&&l.pad>=n&&(l.extrapad||!o)){s=!1;break}else i(t,l.val)&&l.pad<=n&&(o||!l.extrapad)&&(e.splice(c,1),c--)}if(s){var u=a&&t===0;e.push({val:t,pad:u?0:n,extrapad:u?!1:o})}}function C(e){return r(e)&&Math.abs(e)<a}function w(e,t){return e<=t}function T(e,t){return e>=t}function E(e,t){var n=t.autorangeoptions;return n&&n.minallowed!==void 0&&A(t,n.minallowed,n.maxallowed)?n.minallowed:n&&n.clipmin!==void 0&&A(t,n.clipmin,n.clipmax)?Math.max(e,t.d2l(n.clipmin)):e}function k(e,t){var n=t.autorangeoptions;return n&&n.maxallowed!==void 0&&A(t,n.minallowed,n.maxallowed)?n.maxallowed:n&&n.clipmax!==void 0&&A(t,n.clipmin,n.clipmax)?Math.min(e,t.d2l(n.clipmax)):e}function A(e,t,n){return t!==void 0&&n!==void 0?(t=e.d2l(t),n=e.d2l(n),t<n):!0}function j(e,t){if(!t||!t.autorangeoptions)return e;var n=e[0],r=e[1],a=t.autorangeoptions.include;if(a!==void 0){var o=t.d2l(n),s=t.d2l(r);i.isArrayOrTypedArray(a)||(a=[a]);for(var c=0;c<a.length;c++){var l=t.d2l(a[c]);o>=l&&(o=l,n=l),s<=l&&(s=l,r=l)}}return n=E(n,t),r=k(r,t),[n,r]}}),sn=h((e,t)=>{var n=S(),r=D(),i=Et(),a=Ke(),o=$(),s=o.strTranslate,c=kt(),l=nn(),u=q(),d=tn(),f=Mt(),p=Lt();bt();var m=O(),h=m.ONEMAXYEAR,g=m.ONEAVGYEAR,_=m.ONEMINYEAR,v=m.ONEMAXQUARTER,y=m.ONEAVGQUARTER,b=m.ONEMINQUARTER,x=m.ONEMAXMONTH,C=m.ONEAVGMONTH,w=m.ONEMINMONTH,T=m.ONEWEEK,E=m.ONEDAY,k=E/2,A=m.ONEHOUR,j=m.ONEMIN,M=m.ONESEC,N=m.ONEMILLI,P=m.ONEMICROSEC,F=m.MINUS_SIGN,I=m.BADNUM,L={K:`zeroline`},R={K:`gridline`,L:`path`},z={K:`minor-gridline`,L:`path`},B={K:`tick`,L:`path`},V={K:`tick`,L:`text`},H={width:[`x`,`r`,`l`,`xl`,`xr`],height:[`y`,`t`,`b`,`yt`,`yb`],right:[`r`,`xr`],left:[`l`,`xl`],top:[`t`,`yt`],bottom:[`b`,`yb`]},U=Ot(),W=U.MID_SHIFT,G=U.CAP_SHIFT,K=U.LINE_SPACING,J=U.OPPOSITE_SIDE,Y=3,X=t.exports={};X.setConvert=rn();var Z=an(),Q=xt(),ee=Q.idSort,te=Q.isLinked;X.id2name=Q.id2name,X.name2id=Q.name2id,X.cleanId=Q.cleanId,X.list=Q.list,X.listIds=Q.listIds,X.getFromId=Q.getFromId,X.getFromTrace=Q.getFromTrace;var ne=on();X.getAutoRange=ne.getAutoRange,X.findExtremes=ne.findExtremes;var re=1e-4;function ie(e){var t=(e[1]-e[0])*re;return[e[0]-t,e[1]+t]}X.coerceRef=function(e,t,n,r,i,a){var s=r.charAt(r.length-1),c=n._fullLayout._subplots[s+`axis`],l=r+`ref`,u={};return i||=c[0]||(typeof a==`string`?a:a[0]),a||=i,c=c.concat(c.map(function(e){return e+` domain`})),u[l]={valType:`enumerated`,values:c.concat(a?typeof a==`string`?[a]:a:[]),dflt:i},o.coerce(e,t,u,l)},X.coerceRefArray=function(e,t,n,r,i,a,s){let c=r.charAt(r.length-1);var l=n._fullLayout._subplots[c+`axis`];let u=r+`ref`;var d=e[u];i||=l[0]||(typeof a==`string`?a:a[0]),l=l.concat(l.map(e=>e+` domain`)),l=l.concat(a||[]),d.length>s?(o.warn(`Array attribute `+u+` has more entries than expected, truncating to `+s),d=d.slice(0,s)):d.length<s&&(o.warn(`Array attribute `+u+` has fewer entries than expected, extending with default value`),d=d.concat(Array(s-d.length).fill(i)));for(var f=0;f<d.length;f++)d[f]=Q.cleanId(d[f],c,!0)||d[f],l.includes(d[f])||(d[f]=i);return t[u]=d,d},X.getRefType=function(e){return e===void 0?e:Array.isArray(e)?`array`:e===`paper`?`paper`:e===`pixel`?`pixel`:/( domain)$/.test(e)?`domain`:`range`},X.coercePosition=function(e,t,n,r,i,a){var s,c;if(X.getRefType(r)!==`range`)s=o.ensureNumber,c=n(i,a);else{var l=X.getFromId(t,r);a=l.fraction2r(a),c=n(i,a),s=l.cleanPos}e[i]=s(c)},X.cleanPosition=function(e,t,n){return(n===`paper`||n===`pixel`?o.ensureNumber:X.getFromId(t,n).cleanPos)(e)},X.redrawComponents=function(e,t){t||=X.listIds(e);var n=e._fullLayout;function r(r,i,o,s){for(var c=a.getComponentMethod(r,i),l={},u=0;u<t.length;u++)for(var d=n[X.id2name(t[u])],f=d[o],p=0;p<f.length;p++){var m=f[p];if(!l[m]&&(c(e,m),l[m]=1,s))return}}r(`annotations`,`drawOne`,`_annIndices`),r(`shapes`,`drawOne`,`_shapeIndices`),r(`images`,`draw`,`_imgIndices`,!0),r(`selections`,`drawOne`,`_selectionIndices`)};var ae=X.getDataConversions=function(e,t,n,r){var i,a=n===`x`||n===`y`||n===`z`?n:r;if(o.isArrayOrTypedArray(a)){if(i={type:Z(r,void 0,{autotypenumbers:e._fullLayout.autotypenumbers}),_categories:[]},X.setConvert(i),i.type===`category`)for(var s=0;s<r.length;s++)i.d2c(r[s])}else i=X.getFromTrace(e,t,a);return i?{d2c:i.d2c,c2d:i.c2d}:a===`ids`?{d2c:se,c2d:se}:{d2c:oe,c2d:oe}};function oe(e){return+e}function se(e){return String(e)}X.getDataToCoordFunc=function(e,t,n,r){return ae(e,t,n,r).d2c},X.counterLetter=function(e){var t=e.charAt(0);if(t===`x`)return`y`;if(t===`y`)return`x`},X.minDtick=function(e,t,n,r){[`log`,`category`,`multicategory`].indexOf(e.type)!==-1||!r?e._minDtick=0:e._minDtick===void 0?(e._minDtick=t,e._forceTick0=n):e._minDtick&&((e._minDtick/t+1e-6)%1<2e-6&&((n-e._forceTick0)/t%1+1.000001)%1<2e-6?(e._minDtick=t,e._forceTick0=n):((t/e._minDtick+1e-6)%1>2e-6||((n-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0))},X.saveRangeInitial=function(e,t){for(var n=X.list(e,``,!0),r=!1,i=0;i<n.length;i++){var a=n[i],o=a._rangeInitial0===void 0&&a._rangeInitial1===void 0,s=o||a.range[0]!==a._rangeInitial0||a.range[1]!==a._rangeInitial1,c=a.autorange;(o&&c!==!0||t&&s)&&(a._rangeInitial0=c===`min`||c===`max reversed`?void 0:a.range[0],a._rangeInitial1=c===`max`||c===`min reversed`?void 0:a.range[1],a._autorangeInitial=c,r=!0)}return r},X.saveShowSpikeInitial=function(e,t){for(var n=X.list(e,``,!0),r=!1,i=`on`,a=0;a<n.length;a++){var o=n[a],s=o._showSpikeInitial===void 0,c=s||o.showspikes!==o._showspikes;(s||t&&c)&&(o._showSpikeInitial=o.showspikes,r=!0),i===`on`&&!o.showspikes&&(i=`off`)}return e._fullLayout._cartesianSpikesEnabled=i,r},X.autoBin=function(e,t,n,i,a,s){var c=o.aggNums(Math.min,null,e),l=o.aggNums(Math.max,null,e);if(t.type===`category`||t.type===`multicategory`)return{start:c-.5,end:l+.5,size:Math.max(1,Math.round(s)||1),_dataSpan:l-c};a||=t.calendar;var u;if(u=t.type===`log`?{type:`linear`,range:[c,l]}:{type:t.type,range:o.simpleMap([c,l],t.c2r,0,a),calendar:a},X.setConvert(u),s&&=p.dtick(s,u.type),s)u.dtick=s,u.tick0=p.tick0(void 0,u.type,a);else{var d;if(n)d=(l-c)/n;else{var f=o.distinctVals(e),m=10**Math.floor(Math.log(f.minDiff)/Math.LN10),h=m*o.roundUp(f.minDiff/m,[.9,1.9,4.9,9.9],!0);d=Math.max(h,2*o.stdev(e)/e.length**(i?.25:.4)),r(d)||(d=1)}X.autoTicks(u,d)}var g=u.dtick,_=X.tickIncrement(X.tickFirst(u),g,`reverse`,a),v,y;if(typeof g==`number`)_=ce(_,e,u,c,l),y=1+Math.floor((l-_)/g),v=_+y*g;else for(u.dtick.charAt(0)===`M`&&(_=le(_,e,g,c,a)),v=_,y=0;v<=l;)v=X.tickIncrement(v,g,!1,a),y++;return{start:t.c2r(_,0,a),end:t.c2r(v,0,a),size:g,_dataSpan:l-c}};function ce(e,t,n,i,a){var o=0,s=0,c=0,l=0;function u(t){return(1+(t-e)*100/n.dtick)%100<2}for(var d=0;d<t.length;d++)t[d]%1==0?c++:r(t[d])||l++,u(t[d])&&o++,u(t[d]+n.dtick/2)&&s++;var f=t.length-l;if(c===f&&n.type!==`date`)n.dtick<1?e=i-.5*n.dtick:(e-=.5,e+n.dtick<i&&(e+=n.dtick));else if(s<f*.1&&(o>f*.3||u(i)||u(a))){var p=n.dtick/2;e+=e+p<i?p:-p}return e}function le(e,t,n,r,i){var a=o.findExactDates(t,i),s=.8;if(a.exactDays>s){var c=Number(n.slice(1));a.exactYears>s&&c%12==0?e=X.tickIncrement(e,`M6`,`reverse`)+E*1.5:a.exactMonths>s?e=X.tickIncrement(e,`M1`,`reverse`)+E*15.5:e-=k;var l=X.tickIncrement(e,n);if(l<=r)return l}return e}X.prepMinorTicks=function(e,t,n){if(!t.minor.dtick){delete e.dtick;var i=t.dtick&&r(t._tmin),a;if(i){var s=X.tickIncrement(t._tmin,t.dtick,!0);a=[t._tmin,s*.99+t._tmin*.01]}else{var c=o.simpleMap(t.range,t.r2l);a=[c[0],.8*c[0]+.2*c[1]]}if(e.range=o.simpleMap(a,t.l2r),e._isMinor=!0,X.prepTicks(e,n),i){var l=r(t.dtick),u=r(e.dtick),d=l?t.dtick:+t.dtick.substring(1),f=u?e.dtick:+e.dtick.substring(1);l&&u?ue(d,f)?d===2*T&&f===2*E&&(e.dtick=T):d===2*T&&f===3*E?e.dtick=T:d===T&&!(t._input.minor||{}).nticks?e.dtick=E:de(d/f,2.5)?e.dtick=d/2:e.dtick=d:String(t.dtick).charAt(0)===`M`?u?e.dtick=`M1`:ue(d,f)?d>=12&&f===2&&(e.dtick=`M3`):e.dtick=t.dtick:String(e.dtick).charAt(0)===`L`?String(t.dtick).charAt(0)===`L`?ue(d,f)||(e.dtick=de(d/f,2.5)?t.dtick/2:t.dtick):e.dtick=`D1`:e.dtick===`D2`&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}t.minor._tick0Init===void 0&&(e.tick0=t.tick0)};function ue(e,t){return Math.abs((e/t+.5)%1-.5)<.001}function de(e,t){return Math.abs(e/t-1)<.001}X.prepTicks=function(e,t){var n=o.simpleMap(e.range,e.r2l,void 0,void 0,t);if(e.tickmode===`auto`||!e.dtick){var r=e.nticks,i;r||(e.type===`category`||e.type===`multicategory`?(i=e.tickfont?o.bigFont(e.tickfont.size||12):15,r=e._length/i):(i=e._id.charAt(0)===`y`?40:80,r=o.constrain(e._length/i,4,9)+1),e._name===`radialaxis`&&(r*=2)),e.minor&&e.minor.tickmode!==`array`||e.tickmode===`array`&&(r*=100),e._roughDTick=Math.abs(n[1]-n[0])/r,X.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<e._minDtick*2&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}e.ticklabelmode===`period`&&pe(e),e.tick0||=e.type===`date`?`2000-01-01`:0,e.type===`date`&&e.dtick<.1&&(e.dtick=.1),Ee(e)};function fe(e){return+e.substring(1)}function pe(e){var t;function n(){return!(r(e.dtick)||e.dtick.charAt(0)!==`M`)}var i=n(),a=X.getTickFormat(e);if(a){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(t=A,o&&!i&&e.dtick<A&&(e.dtick=A)):/%p/.test(a)?(t=k,o&&!i&&e.dtick<k&&(e.dtick=k)):/%[Aadejuwx]/.test(a)?(t=E,o&&!i&&e.dtick<E&&(e.dtick=E)):/%[UVW]/.test(a)?(t=T,o&&!i&&e.dtick<T&&(e.dtick=T)):/%[Bbm]/.test(a)?(t=C,o&&(i?fe(e.dtick)<1:e.dtick<w)&&(e.dtick=`M1`)):/%[q]/.test(a)?(t=y,o&&(i?fe(e.dtick)<3:e.dtick<b)&&(e.dtick=`M3`)):/%[Yy]/.test(a)&&(t=g,o&&(i?fe(e.dtick)<12:e.dtick<_)&&(e.dtick=`M12`)))}i=n(),i&&e.tick0===e._dowTick0&&(e.tick0=e._rawTick0),e._definedDelta=t}function me(e,t,n){for(var r=0;r<e.length;r++){var i=e[r].value,a=r,o=r+1;r<e.length-1?(a=r,o=r+1):r>0?(a=r-1,o=r):(a=r,o=r);var s=e[a].value,c=e[o].value,l=Math.abs(c-s),u=n||l,d=0;u>=_?d=l>=_&&l<=h?l:g:n===y&&u>=b?d=l>=b&&l<=v?l:y:u>=w?d=l>=w&&l<=x?l:C:n===T&&u>=T?d=T:u>=E?d=E:n===k&&u>=k?d=k:n===A&&u>=A&&(d=A);var f;d>=l&&(d=l,f=!0);var p=i+d;if(t.rangebreaks&&d>0){for(var m=84,S=0,D=0;D<m;D++){var O=(D+.5)/m;t.maskBreaks(i*(1-O)+O*p)!==I&&S++}d*=S/m,d||(e[r].drop=!0),f&&l>T&&(d=l)}(d>0||r===0)&&(e[r].periodX=i+d/2)}}X.calcTicks=function(e,t){for(var n=e.type,i=e.calendar,a=e.ticklabelstep,s=e.ticklabelmode===`period`,c=e.range[0]>e.range[1],l=!e.ticklabelindex||o.isArrayOrTypedArray(e.ticklabelindex)?e.ticklabelindex:[e.ticklabelindex],u=o.simpleMap(e.range,e.r2l,void 0,void 0,t),d=u[1]<u[0],f=Math.min(u[0],u[1]),p=Math.max(u[0],u[1]),m=Math.max(1e3,e._length||0),h=[],g=[],_=[],v=[],y=[],b=e.minor&&(e.minor.ticks||e.minor.showgrid),x=1;x>=(b?0:1);x--){var S=!x;x?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var w=x?e:o.extendFlat({},e,e.minor);if(S?X.prepMinorTicks(w,e,t):X.prepTicks(w,t),w.tickmode===`array`){x?(_=[],h=_e(e,!S)):(v=[],g=_e(e,!S));continue}if(w.tickmode===`sync`){_=[],h=ge(e);continue}var T=ie(u),E=T[0],D=T[1],O=r(w.dtick),k=n===`log`&&!(O||w.dtick.charAt(0)===`L`),A=X.tickFirst(w,t);if(x){if(e._tmin=A,A<E!==d)break;(n===`category`||n===`multicategory`)&&(D=d?Math.max(-.5,D):Math.min(e._categories.length-.5,D))}var j=null,M=A,N;if(x){var P;O?P=e.dtick:n===`date`?typeof e.dtick==`string`&&e.dtick.charAt(0)===`M`&&(P=C*e.dtick.substring(1)):P=e._roughDTick,N=Math.round((e.r2l(M)-e.r2l(e.tick0))/P)-1}var F=w.dtick;for(w.rangebreaks&&w._tick0Init!==w.tick0&&(M=ft(M,e),d||(M=X.tickIncrement(M,F,!d,i))),x&&s&&(M=X.tickIncrement(M,F,!d,i),N--);d?M>=D:M<=D;M=X.tickIncrement(M,F,d,i)){if(x&&N++,w.rangebreaks&&!d){if(M<E)continue;if(w.maskBreaks(M)===I&&ft(M,w)>=p)break}if(_.length>m||M===j)break;j=M;var L={value:M};x?(k&&M!==(M|0)&&(L.simpleLabel=!0),a>1&&N%a&&(L.skipLabel=!0),_.push(L)):(L.minor=!0,v.push(L))}}if(!v||v.length<2?l=!1:_t((v[1].value-v[0].value)*(c?-1:1),e.tickformat)||(l=!1),!l)y=_;else{var R=_.concat(v);s&&_.length&&(R=R.slice(1)),R=R.sort(function(e,t){return e.value-t.value}).filter(function(e,t,n){return t===0||e.value!==n[t-1].value}),R.map(function(e,t){return e.minor===void 0&&!e.skipLabel?t:null}).filter(function(e){return e!==null}).forEach(function(e){l.map(function(t){var n=e+t;n>=0&&n<R.length&&o.pushUnique(y,R[n])})})}if(b&&!(e.minor.ticks===`inside`&&e.ticks===`outside`||e.minor.ticks===`outside`&&e.ticks===`inside`)){for(var z=_.map(function(e){return e.value}),B=[],V=0;V<v.length;V++){var H=v[V],U=H.value;if(z.indexOf(U)===-1){for(var W=!1,G=0;!W&&G<_.length;G++)1e7+_[G].value===1e7+U&&(W=!0);W||B.push(H)}}v=B}s&&me(y,e,e._definedDelta);var K;if(e.rangebreaks){var q=e._id.charAt(0)===`y`,J=1;e.tickmode===`auto`&&(J=e.tickfont?e.tickfont.size:12);var Y=NaN;for(K=_.length-1;K>-1;K--){if(_[K].drop){_.splice(K,1);continue}_[K].value=ft(_[K].value,e);var Z=e.c2p(_[K].value);(q?Y>Z-J:Y<Z+J)?_.splice(d?K+1:K,1):Y=Z}}dt(e)&&Math.abs(u[1]-u[0])===360&&_.pop(),e._tmax=(_[_.length-1]||{}).value,e._prevDateHead=``,e._inCalcTicks=!0;var Q,ee=function(t){t.text=``,e._prevDateHead=Q};_=_.concat(v);function te(e,t){var n=X.tickText(e,t.value,!1,t.simpleLabel),r=t.periodX;return r!==void 0&&(n.periodX=r,(r>p||r<f)&&(r>p&&(n.periodX=p),r<f&&(n.periodX=f),ee(n))),n}var ne;for(K=0;K<_.length;K++){var re=_[K].minor,ae=_[K].value;re?(ne=l&&y.indexOf(_[K])!==-1?te(e,_[K]):{x:ae},ne.minor=!0,g.push(ne)):(Q=e._prevDateHead,ne=te(e,_[K]),(_[K].skipLabel||l&&y.indexOf(_[K])===-1)&&ee(ne),h.push(ne))}return h=h.concat(g),e._inCalcTicks=!1,s&&h.length&&(h[0].noTick=!0),h};function he(e,t){return e.rangebreaks&&(t=t.filter(function(t){return e.maskBreaks(t.x)!==I})),t}function ge(e){var t=e._mainAxis,n=[];if(t._vals){for(var r=0;r<t._vals.length;r++)if(!t._vals[r].noTick){var i=t.l2p(t._vals[r].x),a=e.p2l(i),o=X.tickText(e,a);t._vals[r].minor&&(o.minor=!0,o.text=``),n.push(o)}}return n=he(e,n),n}function _e(e,t){var n=ie(o.simpleMap(e.range,e.r2l)),r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),a=e.type===`category`?e.d2l_noadd:e.d2l;e.type===`log`&&String(e.dtick).charAt(0)!==`L`&&(e.dtick=`L`+10**(Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var s=[],c=0;c<=1;c++)if(!(t!==void 0&&(t&&c||t===!1&&!c))&&!(c&&!e.minor)){var l=c?e.minor.tickvals:e.tickvals,u=c?[]:e.ticktext;if(l){o.isArrayOrTypedArray(u)||(u=[]);for(var d=0;d<l.length;d++){var f=a(l[d]);if(f>r&&f<i){var p=X.tickText(e,f,!1,String(u[d]));c&&(p.minor=!0,p.text=``),s.push(p)}}}}return s=he(e,s),s}var ve=[2,5,10],ye=[1,2,3,6,12],be=[1,2,5,10,15,30],xe=[1,2,3,7,14],Se=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],Ce=[-.301,0,.301,.699,1],we=[15,30,45,90,180];function Te(e,t,n){return t*o.roundUp(e/t,n)}X.autoTicks=function(e,t,n){var i;function a(e){return e**+Math.floor(Math.log(t)/Math.LN10)}if(e.type===`date`){e.tick0=o.dateTick0(e.calendar,0);var s=2*t;if(s>g)t/=g,i=a(10),e.dtick=`M`+12*Te(t,i,ve);else if(s>C)t/=C,e.dtick=`M`+Te(t,1,ye);else if(s>E){if(e.dtick=Te(t,E,e._hasDayOfWeekBreaks?[1,2,7,14]:xe),!n){var c=X.getTickFormat(e),l=e.ticklabelmode===`period`;l&&(e._rawTick0=e.tick0),/%[uVW]/.test(c)?e.tick0=o.dateTick0(e.calendar,2):e.tick0=o.dateTick0(e.calendar,1),l&&(e._dowTick0=e.tick0)}}else s>A?e.dtick=Te(t,A,ye):s>j?e.dtick=Te(t,j,be):s>M?e.dtick=Te(t,M,be):(i=a(10),e.dtick=Te(t,i,ve))}else if(e.type===`log`){e.tick0=0;var u=o.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(Math.abs(u[1]-u[0])<1){var d=1.5*Math.abs((u[1]-u[0])/t);t=Math.abs(10**u[1]-10**u[0])/d,i=a(10),e.dtick=`L`+Te(t,i,ve)}else e.dtick=t>.3?`D2`:`D1`}else e.type===`category`||e.type===`multicategory`?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):dt(e)?(e.tick0=0,i=1,e.dtick=Te(t,i,we)):(e.tick0=0,i=a(10),e.dtick=Te(t,i,ve));if(e.dtick===0&&(e.dtick=1),!r(e.dtick)&&typeof e.dtick!=`string`){var f=e.dtick;throw e.dtick=1,`ax.dtick error: `+String(f)}};function Ee(e){var t=e.dtick;if(e._tickexponent=0,!r(t)&&typeof t!=`string`&&(t=1),(e.type===`category`||e.type===`multicategory`)&&(e._tickround=null),e.type===`date`){var n=e.r2l(e.tick0),i=e.l2r(n).replace(/(^-|i)/g,``),a=i.length;if(String(t).charAt(0)===`M`)a>10||i.slice(5)!==`01-01`?e._tickround=`d`:e._tickround=t.slice(1)%12==0?`y`:`m`;else if(t>=E&&a<=10||t>=E*15)e._tickround=`d`;else if(t>=j&&a<=16||t>=A)e._tickround=`M`;else if(t>=M&&a<=19||t>=j)e._tickround=`S`;else{var o=e.l2r(n+t).replace(/^-/,``).length;e._tickround=Math.max(a,o)-20,e._tickround<0&&(e._tickround=4)}}else if(r(t)||t.charAt(0)===`L`){var s=e.range.map(e.r2d||Number);r(t)||(t=Number(t.slice(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var c=Math.max(Math.abs(s[0]),Math.abs(s[1])),l=Math.floor(Math.log(c)/Math.LN10+.01),u=e.minexponent===void 0?3:e.minexponent;Math.abs(l)>u&&(Le(e.exponentformat)&&e.exponentformat!==`SI extended`&&!Re(l)||Le(e.exponentformat)&&e.exponentformat===`SI extended`&&!ze(l)?e._tickexponent=3*Math.round((l-1)/3):e._tickexponent=l)}else e._tickround=null}X.tickIncrement=function(e,t,i,a){var s=i?-1:1;if(r(t))return o.increment(e,s*t);var c=t.charAt(0),l=s*Number(t.slice(1));if(c===`M`)return o.incrementMonth(e,l,a);if(c===`L`)return Math.log(10**e+l)/Math.LN10;if(c===`D`){var u=t===`D2`?Ce:Se,d=e+s*.01,f=o.roundUp(o.mod(d,1),u,i);return Math.floor(d)+Math.log(n.round(10**f,1))/Math.LN10}throw`unrecognized dtick `+String(t)},X.tickFirst=function(e,t){var i=e.r2l||Number,a=o.simpleMap(e.range,i,void 0,void 0,t),s=a[1]<a[0],c=s?Math.floor:Math.ceil,l=ie(a)[0],u=e.dtick,d=i(e.tick0);if(r(u)){var f=c((l-d)/u)*u+d;return(e.type===`category`||e.type===`multicategory`)&&(f=o.constrain(f,0,e._categories.length-1)),f}var p=u.charAt(0),m=Number(u.slice(1));if(p===`M`){for(var h=0,g=d,_,v,y;h<10;){if(_=X.tickIncrement(g,u,s,e.calendar),(_-l)*(g-l)<=0)return s?Math.min(g,_):Math.max(g,_);v=(l-(g+_)/2)/(_-g),y=p+(Math.abs(Math.round(v))||1)*m,g=X.tickIncrement(g,y,v<0?!s:s,e.calendar),h++}return o.error(`tickFirst did not converge`,e),g}else{if(p===`L`)return Math.log(c((10**l-d)/m)*m+d)/Math.LN10;if(p===`D`){var b=u===`D2`?Ce:Se,x=o.roundUp(o.mod(l,1),b,s);return Math.floor(l)+Math.log(n.round(10**x,1))/Math.LN10}else throw`unrecognized dtick `+String(u)}},X.tickText=function(e,t,n,r){var i=De(e,t),a=e.tickmode===`array`,s=n||a,c=e.type,l=c===`category`?e.d2l_noadd:e.d2l,u,d=function(t){var n=e.l2p(t);return n>=0&&n<=e._length?t:null};if(a&&o.isArrayOrTypedArray(e.ticktext)){var f=o.simpleMap(e.range,e.r2l),p=(Math.abs(f[1]-f[0])-(e._lBreaks||0))/1e4;for(u=0;u<e.ticktext.length&&!(Math.abs(t-l(e.tickvals[u]))<p);u++);if(u<e.ticktext.length)return i.text=String(e.ticktext[u]),i.xbnd=[d(i.x-.5),d(i.x+e.dtick-.5)],i}function m(r){if(r===void 0)return!0;if(n)return r===`none`;var i={first:e._tmin,last:e._tmax}[r];return r!==`all`&&t!==i}var h=n?`never`:e.exponentformat!==`none`&&m(e.showexponent)?`hide`:``;if(c===`date`?Oe(e,i,n,s):c===`log`?ke(e,i,n,s,h):c===`category`?Ae(e,i):c===`multicategory`?je(e,i,n):dt(e)?Ne(e,i,n,s,h):Me(e,i,n,s,h),r||(e.tickprefix&&!m(e.showtickprefix)&&(i.text=e.tickprefix+i.text),e.ticksuffix&&!m(e.showticksuffix)&&(i.text+=e.ticksuffix)),e.labelalias&&e.labelalias.hasOwnProperty(i.text)){var g=e.labelalias[i.text];typeof g==`string`&&(i.text=g)}return(e.tickson===`boundaries`||e.showdividers)&&(i.xbnd=[d(i.x-.5),d(i.x+e.dtick-.5)]),i},X.hoverLabelText=function(e,t,n){n&&(e=o.extendFlat({},e,{hoverformat:n}));var r=o.isArrayOrTypedArray(t)?t[0]:t,i=o.isArrayOrTypedArray(t)?t[1]:void 0;if(i!==void 0&&i!==r)return X.hoverLabelText(e,r,n)+` - `+X.hoverLabelText(e,i,n);var a=e.type===`log`&&r<=0,s=X.tickText(e,e.c2l(a?-r:r),`hover`).text;return a?r===0?`0`:F+s:s};function De(e,t,n){var r=e.tickfont||{};return{x:t,dx:0,dy:0,text:n||``,fontSize:r.size,font:r.family,fontWeight:r.weight,fontStyle:r.style,fontVariant:r.variant,fontTextcase:r.textcase,fontLineposition:r.lineposition,fontShadow:r.shadow,fontColor:r.color}}function Oe(e,t,n,i){var a=e._tickround,s=n&&e.hoverformat||X.getTickFormat(e);i=!s&&i,i&&(a=r(a)?4:{y:`m`,m:`d`,d:`M`,M:`S`,S:4}[a]);var c=o.formatDate(t.x,s,a,e._dateFormat,e.calendar,e._extraFormat),l,u=c.indexOf(`
`);if(u!==-1&&(l=c.slice(u+1),c=c.slice(0,u)),i&&(l!==void 0&&(c===`00:00:00`||c===`00:00`)?(c=l,l=``):c.length===8&&(c=c.replace(/:00$/,``))),l)if(n)a===`d`?c+=`, `+l:c=l+(c?`, `+c:``);else if(!e._inCalcTicks||e._prevDateHead!==l)e._prevDateHead=l,c+=`<br>`+l;else{var d=pt(e),f=e._trueSide||e.side;(!d&&f===`top`||d&&f===`bottom`)&&(c+=`<br> `)}t.text=c}function ke(e,t,n,i,a){var s=e.dtick,c=t.x,l=e.tickformat,u=typeof s==`string`&&s.charAt(0);if(a===`never`&&(a=``),i&&u!==`L`&&(s=`L3`,u=`L`),l||u===`L`)t.text=Ve(10**c,e,a,i);else if(r(s)||u===`D`&&(e.minorloglabels===`complete`||o.mod(c+.01,1)<.1)){e.minorloglabels===`complete`&&!(o.mod(c+.01,1)<.1)&&(t.fontSize*=.75);var d=(10**c).toExponential(0).split(`e`),f=+d[1],p=Math.abs(f),m=e.exponentformat;m===`power`||Le(m)&&m!==`SI extended`&&Re(f)||Le(m)&&m===`SI extended`&&ze(f)?(t.text=d[0],p>0&&(t.text+=`x10`),t.text===`1x10`&&(t.text=`10`),f!==0&&f!==1&&(t.text+=`<sup>`+(f>0?``:F)+p+`</sup>`),t.fontSize*=1.25):(m===`e`||m===`E`)&&p>2?t.text=d[0]+m+(f>0?`+`:F)+p:(t.text=Ve(10**c,e,``,`fakehover`),s===`D1`&&e._id.charAt(0)===`y`&&(t.dy-=t.fontSize/6))}else if(u===`D`)t.text=e.minorloglabels===`none`?``:String(Math.round(10**o.mod(c,1))),t.fontSize*=.75;else throw`unrecognized dtick `+String(s);if(e.dtick===`D1`){var h=String(t.text).charAt(0);(h===`0`||h===`1`)&&(e._id.charAt(0)===`y`?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(c<0?.5:.25)))}}function Ae(e,t){var n=e._categories[Math.round(t.x)];n===void 0&&(n=``),t.text=String(n)}function je(e,t,n){var r=Math.round(t.x),i=e._categories[r]||[],a=i[1]===void 0?``:String(i[1]),o=i[0]===void 0?``:String(i[0]);n?t.text=o+` - `+a:(t.text=a,t.text2=o)}function Me(e,t,n,r,i){i===`never`?i=``:e.showexponent===`all`&&Math.abs(t.x/e.dtick)<1e-6&&(i=`hide`),t.text=Ve(t.x,e,i,r)}function Ne(e,t,n,r,i){if(e.thetaunit===`radians`&&!n){var a=t.x/180;if(a===0)t.text=`0`;else{var s=Pe(a);if(s[1]>=100)t.text=Ve(o.deg2rad(t.x),e,i,r);else{var c=t.x<0;s[1]===1?s[0]===1?t.text=`π`:t.text=s[0]+`π`:t.text=[`<sup>`,s[0],`</sup>`,``,`<sub>`,s[1],`</sub>`,`π`].join(``),c&&(t.text=F+t.text)}}}else t.text=Ve(t.x,e,i,r)}function Pe(e){function t(e,t){return Math.abs(e-t)<=1e-6}function n(e,r){return t(r,0)?e:n(r,e%r)}function r(e){for(var n=1;!t(Math.round(e*n)/n,e);)n*=10;return n}var i=r(e),a=e*i,o=Math.abs(n(a,i));return[Math.round(a/o),Math.round(i/o)]}var Fe=[`f`,`p`,`n`,`μ`,`m`,``,`k`,`M`,`G`,`T`],Ie=[`q`,`r`,`y`,`z`,`a`,...Fe,`P`,`E`,`Z`,`Y`,`R`,`Q`],Le=e=>[`SI`,`SI extended`,`B`].includes(e);function Re(e){return e>14||e<-15}function ze(e){return e>32||e<-30}function Be(e,t){return Le(t)?!!(t===`SI extended`&&ze(e)||t!==`SI extended`&&Re(e)):!1}function Ve(e,t,n,i){var a=e<0,s=t._tickround,c=n||t.exponentformat||`B`,l=t._tickexponent,u=X.getTickFormat(t),d=t.separatethousands;if(i){var f={exponentformat:c,minexponent:t.minexponent,dtick:t.showexponent===`none`?t.dtick:r(e)&&Math.abs(e)||1,range:t.showexponent===`none`?t.range.map(t.r2d):[0,e||1]};Ee(f),s=(Number(f._tickround)||0)+4,l=f._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,F);var p=10**-s/2;if(c===`none`&&(l=0),e=Math.abs(e),e<p)e=`0`,a=!1;else{if(e+=p,l&&(e*=10**-l,s+=l),s===0)e=String(Math.floor(e));else if(s<0){e=String(Math.round(e)),e=e.slice(0,Math.max(0,e.length+s));for(var m=s;m<0;m++)e+=`0`}else{e=String(e);var h=e.indexOf(`.`)+1;h&&(e=e.slice(0,h+s).replace(/\.?0+$/,``))}e=o.numSeparate(e,t._separators,d)}if(l&&c!==`hide`){Be(l,c)&&(c=`power`);var g=l<0?F+-l:c===`power`?String(l):`+`+l;c===`e`||c===`E`?e+=c+g:c===`power`?e+=`×10<sup>`+g+`</sup>`:c===`B`&&l===9?e+=`B`:Le(c)&&(e+=c===`SI extended`?Ie[l/3+10]:Fe[l/3+5])}return a?F+e:e}X.getTickFormat=function(e){var t;function n(e){return typeof e==`string`?Number(e.replace(`M`,``))*C:e}function r(e,t){var n=[`L`,`D`];if(typeof e==typeof t){if(typeof e==`number`)return e-t;var r=n.indexOf(e.charAt(0)),i=n.indexOf(t.charAt(0));return r===i?Number(e.replace(/(L|D)/g,``))-Number(t.replace(/(L|D)/g,``)):r-i}else return typeof e==`number`?1:-1}function i(e,t,n){var r=n||function(e){return e},i=t[0],a=t[1];return(!i&&typeof i!=`number`||r(i)<=r(e))&&(!a&&typeof a!=`number`||r(a)>=r(e))}function a(e,t){var n=t[0]===null,i=t[1]===null,a=r(e,t[0])>=0,o=r(e,t[1])<=0;return(n||a)&&(i||o)}var o,s;if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case`date`:case`linear`:for(t=0;t<e.tickformatstops.length;t++)if(s=e.tickformatstops[t],s.enabled&&i(e.dtick,s.dtickrange,n)){o=s;break}break;case`log`:for(t=0;t<e.tickformatstops.length;t++)if(s=e.tickformatstops[t],s.enabled&&a(e.dtick,s.dtickrange)){o=s;break}break;default:}return o?o.value:e.tickformat},X.getSubplots=function(e,t){var n=e._fullLayout._subplots,r=n.cartesian.concat(n.gl2d||[]),i=t?X.findSubplotsWithAxis(r,t):r;return i.sort(function(e,t){var n=e.slice(1).split(`y`),r=t.slice(1).split(`y`);return n[0]===r[0]?n[1]-+r[1]:n[0]-+r[0]}),i},X.findSubplotsWithAxis=function(e,t){for(var n=RegExp(t._id.charAt(0)===`x`?`^`+t._id+`y`:t._id+`$`),r=[],i=0;i<e.length;i++){var a=e[i];n.test(a)&&r.push(a)}return r},X.makeClipPaths=function(e){var t=e._fullLayout;if(!t._hasOnlyLargeSploms){var r={_offset:0,_length:t.width,_id:``},i={_offset:0,_length:t.height,_id:``},a=X.list(e,`x`,!0),o=X.list(e,`y`,!0),s=[],c,l;for(c=0;c<a.length;c++)for(s.push({x:a[c],y:i}),l=0;l<o.length;l++)c===0&&s.push({x:r,y:o[l]}),s.push({x:a[c],y:o[l]});var u=t._clips.selectAll(`.axesclip`).data(s,function(e){return e.x._id+e.y._id});u.enter().append(`clipPath`).classed(`axesclip`,!0).attr(`id`,function(e){return`clip`+t._uid+e.x._id+e.y._id}).append(`rect`),u.exit().remove(),u.each(function(e){n.select(this).select(`rect`).attr({x:e.x._offset||0,y:e.y._offset||0,width:e.x._length||1,height:e.y._length||1})})}},X.draw=function(e,t,n){var r=e._fullLayout;t===`redraw`&&r._paper.selectAll(`g.subplot`).each(function(e){var t=e[0],n=r._plots[t];if(n){var i=n.xaxis,a=n.yaxis;n.xaxislayer.selectAll(`.`+i._id+`tick`).remove(),n.yaxislayer.selectAll(`.`+a._id+`tick`).remove(),n.xaxislayer.selectAll(`.`+i._id+`tick2`).remove(),n.yaxislayer.selectAll(`.`+a._id+`tick2`).remove(),n.xaxislayer.selectAll(`.`+i._id+`divider`).remove(),n.yaxislayer.selectAll(`.`+a._id+`divider`).remove(),n.minorGridlayer&&n.minorGridlayer.selectAll(`path`).remove(),n.gridlayer&&n.gridlayer.selectAll(`path`).remove(),n.zerolinelayer&&n.zerolinelayer.selectAll(`path`).remove(),n.zerolinelayerAbove&&n.zerolinelayerAbove.selectAll(`path`).remove(),r._infolayer.select(`.g-`+i._id+`title`).remove(),r._infolayer.select(`.g-`+a._id+`title`).remove()}});var i=!t||t===`redraw`?X.listIds(e):t,a=X.list(e).filter(function(e){return e.autoshift}).map(function(e){return e.overlaying});i.map(function(t){var n=X.getFromId(e,t);if(n.tickmode===`sync`&&n.overlaying){var r=i.findIndex(function(e){return e===n.overlaying});r>=0&&i.unshift(i.splice(r,1).shift())}});var s={false:{left:0,right:0}};return o.syncOrAsync(i.map(function(t){return function(){if(t){var r=X.getFromId(e,t);n||={},n.axShifts=s,n.overlayingShiftedAx=a;var i=X.drawOne(e,r,n);return r._shiftPusher&&ht(r,r._fullDepth||0,s,!0),r._r=r.range.slice(),r._rl=o.simpleMap(r._r,r.r2l),i}}}))},X.drawOne=function(e,t,n){n||={};var r=n.axShifts||{},s=n.overlayingShiftedAx||[],c,l,u;t.setScale();var d=e._fullLayout,f=t._id,p=f.charAt(0),m=X.counterLetter(f),h=d._plots[t._mainSubplot],g=t.zerolinelayer===`above traces`;if(!h)return;if(t._shiftPusher=t.autoshift||s.indexOf(t._id)!==-1||s.indexOf(t.overlaying)!==-1,t._shiftPusher&t.anchor===`free`){var _=t.linewidth/2||0;t.ticks===`inside`&&(_+=t.ticklen),ht(t,_,r,!0),ht(t,t.shift||0,r,!1)}(n.skipTitle!==!0||t._shift===void 0)&&(t._shift=gt(t,r));var v=h[p+`axislayer`],y=t._mainLinePosition,b=y+=t._shift,x=t._mainMirrorPosition,S=t._vals=X.calcTicks(t),C=[t.mirror,b,x].join(`_`);for(c=0;c<S.length;c++)S[c].axInfo=C;t._selections={},t._tickAngles&&(t._prevTickAngles=t._tickAngles),t._tickAngles={},t._depth=null;var w={};function T(e){var n=f+(e||`tick`);return w[n]||(w[n]=qe(t,n,b)),w[n]}if(t.visible){var E=X.makeTransTickFn(t),D=X.makeTransTickLabelFn(t),O,k,A=t.ticks===`inside`,j=t.ticks===`outside`;if(t.tickson===`boundaries`){var M=Ue(t,S);k=X.clipEnds(t,M),O=A?k:M}else k=X.clipEnds(t,S),O=A&&t.ticklabelmode!==`period`?k:S;var N=t._gridVals=k,P=Ge(t,S);if(!d._hasOnlyLargeSploms){var F=t._subplotsWith,I={};for(c=0;c<F.length;c++){l=F[c],u=d._plots[l];var L=u[m+`axis`],R=L._mainAxis._id;if(!I[R]){I[R]=1;var z=p===`x`?`M0,`+L._offset+`v`+L._length:`M`+L._offset+`,0h`+L._length;X.drawGrid(e,t,{vals:N,counterAxis:L,layer:u.gridlayer.select(`.`+f),minorLayer:u.minorGridlayer.select(`.`+f),path:z,transFn:E}),X.drawZeroLine(e,t,{counterAxis:L,layer:g?u.zerolinelayerAbove:u.zerolinelayer,path:z,transFn:E})}}}var B,V=X.getTickSigns(t),H=X.getTickSigns(t,`minor`);if(t.ticks||t.minor&&t.minor.ticks){var U=X.makeTickPath(t,b,V[2]),W=X.makeTickPath(t,b,H[2],{minor:!0}),G,q,Y,Z;if(t._anchorAxis&&t.mirror&&t.mirror!==!0?(G=X.makeTickPath(t,x,V[3]),q=X.makeTickPath(t,x,H[3],{minor:!0}),Y=U+G,Z=W+q):(G=``,q=``,Y=U,Z=W),t.showdividers&&j&&t.tickson===`boundaries`){var Q={};for(c=0;c<P.length;c++)Q[P[c].x]=1;B=function(e){return Q[e.x]?G:Y}}else B=function(e){return e.minor?Z:Y}}if(X.drawTicks(e,t,{vals:O,layer:v,path:B,transFn:E}),t.mirror===`allticks`){var ee=Object.keys(t._linepositions||{});for(c=0;c<ee.length;c++){l=ee[c],u=d._plots[l];var te=t._linepositions[l]||[],ne=te[0],re=te[1],ie=te[2],ae=X.makeTickPath(t,ne,ie?V[0]:H[0],{minor:ie})+X.makeTickPath(t,re,ie?V[1]:H[1],{minor:ie});X.drawTicks(e,t,{vals:O,layer:u[p+`axislayer`],path:ae,transFn:E})}}var oe=[];if(oe.push(function(){return X.drawLabels(e,t,{vals:S,layer:v,plotinfo:u,transFn:D,labelFns:X.makeLabelFns(t,b)})}),t.type===`multicategory`){var se={x:2,y:10}[p];oe.push(function(){var n={x:`height`,y:`width`}[p],r=T()[n]+se+(t._tickAngles[f+`tick`]?t.tickfont.size*K:0);return X.drawLabels(e,t,{vals:We(t,S),layer:v,cls:f+`tick2`,repositionOnUpdate:!0,secondary:!0,transFn:E,labelFns:X.makeLabelFns(t,b+r*V[4])})}),oe.push(function(){return t._depth=V[4]*(T(`tick2`)[t.side]-b),Ze(e,t,{vals:P,layer:v,path:X.makeTickPath(t,b,V[4],{len:t._depth}),transFn:E})})}else t.title.hasOwnProperty(`standoff`)&&oe.push(function(){t._depth=V[4]*(T()[t.side]-b)});var ce=a.getComponentMethod(`rangeslider`,`isVisible`)(t);return!n.skipTitle&&!(ce&&t.side===`bottom`)&&oe.push(function(){return $e(e,t)}),oe.push(function(){var n=t.side.charAt(0),r=J[t.side].charAt(0),o=X.getPxPosition(e,t),s=j?t.ticklen:0,c,l,u,f;(t.automargin||ce||t._shiftPusher)&&(t.type===`multicategory`?c=T(`tick2`):(c=T(),p===`x`&&n===`b`&&(t._depth=Math.max(c.width>0?c.bottom-o:0,s))));var h=0,g=0;if(t._shiftPusher&&(h=Math.max(s,c.height>0?n===`l`?o-c.left:c.right-o:0),t.title.text!==d._dfltTitle[p]&&(g=(t._titleStandoff||0)+(t._titleScoot||0),n===`l`&&(g+=Qe(t))),t._fullDepth=Math.max(h,g)),t.automargin){l={x:0,y:0,r:0,l:0,t:0,b:0};var _=[0,1],v=typeof t._shift==`number`?t._shift:0;if(p===`x`){if(n===`b`?l[n]=t._depth:(l[n]=t._depth=Math.max(c.width>0?o-c.top:0,s),_.reverse()),c.width>0){var y=c.right-(t._offset+t._length);y>0&&(l.xr=1,l.r=y);var b=t._offset-c.left;b>0&&(l.xl=0,l.l=b)}}else if(n===`l`?(t._depth=Math.max(c.height>0?o-c.left:0,s),l[n]=t._depth-v):(t._depth=Math.max(c.height>0?c.right-o:0,s),l[n]=t._depth+v,_.reverse()),c.height>0){var x=c.bottom-(t._offset+t._length);x>0&&(l.yb=0,l.b=x);var S=t._offset-c.top;S>0&&(l.yt=1,l.t=S)}l[m]=t.anchor===`free`?t.position:t._anchorAxis.domain[_[0]],t.title.text!==d._dfltTitle[p]&&(l[n]+=Qe(t)+(t.title.standoff||0)),t.mirror&&t.anchor!==`free`&&(u={x:0,y:0,r:0,l:0,t:0,b:0},u[r]=t.linewidth,t.mirror&&t.mirror!==!0&&(u[r]+=s),t.mirror===!0||t.mirror===`ticks`?u[m]=t._anchorAxis.domain[_[1]]:(t.mirror===`all`||t.mirror===`allticks`)&&(u[m]=[t._counterDomainMin,t._counterDomainMax][_[1]]))}ce&&(f=a.getComponentMethod(`rangeslider`,`autoMarginOpts`)(e,t)),typeof t.automargin==`string`&&(He(l,t.automargin),He(u,t.automargin)),i.autoMargin(e,it(t),l),i.autoMargin(e,at(t),u),i.autoMargin(e,ot(t),f)}),o.syncOrAsync(oe)}};function He(e,t){if(e){var n=Object.keys(H).reduce(function(e,n){return t.indexOf(n)!==-1&&H[n].forEach(function(t){e[t]=1}),e},{});Object.keys(e).forEach(function(t){n[t]||(t.length===1?e[t]=0:delete e[t])})}}function Ue(e,t){var n=[],r,i=function(e,t){var r=e.xbnd[t];r!==null&&n.push(o.extendFlat({},e,{x:r}))};if(t.length){for(r=0;r<t.length;r++)i(t[r],0);i(t[r-1],1)}return n}function We(e,t){for(var n=[],r={},i=0;i<t.length;i++){var a=t[i];r[a.text2]?r[a.text2].push(a.x):r[a.text2]=[a.x]}for(var s in r)n.push(De(e,o.interp(r[s],.5),s));return n}function Ge(e,t){var n=[],r,i,a=t.length&&t[t.length-1].x<t[0].x,s=function(e,t){var r=e.xbnd[t];r!==null&&n.push(o.extendFlat({},e,{x:r}))};if(e.showdividers&&t.length){for(r=0;r<t.length;r++){var c=t[r];c.text2!==i&&s(c,a?1:0),i=c.text2}s(t[r-1],a?0:1)}return n}function qe(e,t,n){var r,i,a,o;if(e._selections[t].size())r=1/0,i=-1/0,a=1/0,o=-1/0,e._selections[t].each(function(){var e=rt(this);if(e.node().style.display!==`none`){var t=d.bBox(e.node().parentNode);r=Math.min(r,t.top),i=Math.max(i,t.bottom),a=Math.min(a,t.left),o=Math.max(o,t.right)}});else{var s=X.makeLabelFns(e,n);r=i=s.yFn({dx:0,dy:0,fontSize:0}),a=o=s.xFn({dx:0,dy:0,fontSize:0})}return{top:r,bottom:i,left:a,right:o,height:i-r,width:o-a}}X.getTickSigns=function(e,t){var n=e._id.charAt(0),r={x:`top`,y:`right`}[n],i=e.side===r?1:-1,a=[-1,1,i,-i];return(t?(e.minor||{}).ticks:e.ticks)!==`inside`==(n===`x`)&&(a=a.map(function(e){return-e})),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},X.makeTransTickFn=function(e){return e._id.charAt(0)===`x`?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},X.makeTransTickLabelFn=function(e){var t=Ye(e),n=e.ticklabelshift||0,r=e.ticklabelstandoff||0,i=t[0],a=t[1],o=e.range[0]>e.range[1],c=e.ticklabelposition&&e.ticklabelposition.indexOf(`inside`)!==-1,l=!c;if(n&&(n*=o?-1:1),r){var u=e.side;r*=c&&(u===`top`||u===`left`)||l&&(u===`bottom`||u===`right`)?1:-1}return e._id.charAt(0)===`x`?function(t){return s(i+e._offset+e.l2p(Je(t))+n,a+r)}:function(t){return s(a+r,i+e._offset+e.l2p(Je(t))+n)}};function Je(e){return e.periodX===void 0?e.x:e.periodX}function Ye(e){var t=e.ticklabelposition||``,n=e.tickson||``,r=function(e){return t.indexOf(e)!==-1},i=r(`top`),a=r(`left`),o=r(`right`),s=r(`bottom`),c=r(`inside`),l=n!==`boundaries`&&(s||a||i||o);if(!l&&!c)return[0,0];var u=e.side,d=l?(e.tickwidth||0)/2:0,f=Y,p=e.tickfont?e.tickfont.size:12;return(s||i)&&(d+=p*G,f+=(e.linewidth||0)/2),(a||o)&&(d+=(e.linewidth||0)/2,f+=Y),c&&u===`top`&&(f-=p*(1-G)),(a||i)&&(d=-d),(u===`bottom`||u===`right`)&&(f=-f),[l?d:0,c?f:0]}X.makeTickPath=function(e,t,n,r){r||={};var i=r.minor;if(i&&!e.minor)return``;var a=r.len===void 0?i?e.minor.ticklen:e.ticklen:r.len,o=e._id.charAt(0),s=(e.linewidth||1)/2;return o===`x`?`M0,`+(t+s*n)+`v`+a*n:`M`+(t+s*n)+`,0h`+a*n},X.makeLabelFns=function(e,t,n){var i=e.ticklabelposition||``,a=e.tickson||``,s=function(e){return i.indexOf(e)!==-1},c=s(`top`),l=s(`left`),u=s(`right`),d=s(`bottom`),f=a!==`boundaries`&&(d||l||c||u),p=s(`inside`),m=i===`inside`&&e.ticks===`inside`||!p&&e.ticks===`outside`&&a!==`boundaries`,h=0,g=0,_=m?e.ticklen:0;if(p?_*=-1:f&&(_=0),m&&(h+=_,n)){var v=o.deg2rad(n);h=_*Math.cos(v)+1,g=_*Math.sin(v)}e.showticklabels&&(m||e.showline)&&(h+=.2*e.tickfont.size),h+=(e.linewidth||1)/2*(p?-1:1);var y={labelStandoff:h,labelShift:g},b,x,S,C,w=0,T=e.side,E=e._id.charAt(0),D=e.tickangle,O;if(E===`x`)O=!p&&T===`bottom`||p&&T===`top`,C=O?1:-1,p&&(C*=-1),b=g*C,x=t+h*C,S=O?1:-.2,Math.abs(D)===90&&(p?S+=W:S=D===-90&&T===`bottom`?G:D===90&&T===`top`?W:.5,w=W/2*(D/90)),y.xFn=function(e){return e.dx+b+w*e.fontSize},y.yFn=function(e){return e.dy+x+e.fontSize*S},y.anchorFn=function(e,t){if(f){if(l)return`end`;if(u)return`start`}return!r(t)||t===0||t===180?`middle`:t*C<0===p?`start`:`end`},y.heightFn=function(t,n,r){return n<-60||n>60?-.5*r:e.side===`top`===p?0:-r};else if(E===`y`){if(O=!p&&T===`left`||p&&T===`right`,C=O?1:-1,p&&(C*=-1),b=h,x=g*C,S=0,!p&&Math.abs(D)===90&&(S=D===-90&&T===`left`||D===90&&T===`right`?G:.5),p){var k=r(D)?+D:0;if(k!==0){var A=o.deg2rad(k);w=Math.abs(Math.sin(A))*G*C,S=0}}y.xFn=function(e){return e.dx+t-(b+e.fontSize*S)*C+w*e.fontSize},y.yFn=function(e){return e.dy+x+e.fontSize*W},y.anchorFn=function(e,t){return r(t)&&Math.abs(t)===90?`middle`:O?`end`:`start`},y.heightFn=function(t,n,r){return e.side===`right`&&(n*=-1),n<-30?-r:n<30?-.5*r:0}}return y};function Xe(e){return[e.text,e.x,e.axInfo,e.font,e.fontSize,e.fontColor].join(`_`)}X.drawTicks=function(e,t,r){r||={};var i=t._id+`tick`,a=[].concat(t.minor&&t.minor.ticks?r.vals.filter(function(e){return e.minor&&!e.noTick}):[],t.ticks?r.vals.filter(function(e){return!e.minor&&!e.noTick}):[]),o=r.layer.selectAll(`path.`+i).data(a,Xe);o.exit().remove(),o.enter().append(`path`).classed(i,1).classed(`ticks`,1).classed(`crisp`,r.crisp!==!1).each(function(e){return u.stroke(n.select(this),e.minor?t.minor.tickcolor:t.tickcolor)}).style(`stroke-width`,function(n){return d.crispRound(e,n.minor?t.minor.tickwidth:t.tickwidth,1)+`px`}).attr(`d`,r.path).style(`display`,null),mt(t,[B]),o.attr(`transform`,r.transFn)},X.drawGrid=function(e,t,r){if(r||={},t.tickmode!==`sync`){var i=t._id+`grid`,a=t.minor&&t.minor.showgrid,o=a?r.vals.filter(function(e){return e.minor}):[],s=t.showgrid?r.vals.filter(function(e){return!e.minor}):[],c=r.counterAxis;if(c&&X.shouldShowZeroLine(e,t,c))for(var l=t.tickmode===`array`,f=0;f<s.length;f++){var p=s[f].x;if(l?!p:Math.abs(p)<t.dtick/100)if(s=s.slice(0,f).concat(s.slice(f+1)),l)f--;else break}t._gw=d.crispRound(e,t.gridwidth,1);for(var m=a?d.crispRound(e,t.minor.gridwidth,1):0,h=r.layer,g=r.minorLayer,_=1;_>=0;_--){var v=_?h:g;if(v){var y=v.selectAll(`path.`+i).data(_?s:o,Xe);y.exit().remove(),y.enter().append(`path`).classed(i,1).classed(`crisp`,r.crisp!==!1),y.attr(`transform`,r.transFn).attr(`d`,r.path).each(function(e){return u.stroke(n.select(this),e.minor?t.minor.gridcolor:t.gridcolor||`#ddd`)}).style(`stroke-dasharray`,function(e){return d.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)}).style(`stroke-width`,function(e){return(e.minor?m:t._gw)+`px`}).style(`display`,null),typeof r.path==`function`&&y.attr(`d`,r.path)}}mt(t,[R,z])}},X.drawZeroLine=function(e,t,n){n||=n;var r=t._id+`zl`,i=X.shouldShowZeroLine(e,t,n.counterAxis),a=n.layer.selectAll(`path.`+r).data(i?[{x:0,id:t._id}]:[]);a.exit().remove(),a.enter().append(`path`).classed(r,1).classed(`zl`,1).classed(`crisp`,n.crisp!==!1).each(function(){n.layer.selectAll(`path`).sort(function(e,t){return ee(e.id,t.id)})}),a.attr(`transform`,n.transFn).attr(`d`,n.path).call(u.stroke,t.zerolinecolor||u.defaultLine).style(`stroke-width`,d.crispRound(e,t.zerolinewidth,t._gw||1)+`px`).style(`display`,null),mt(t,[L])},X.drawLabels=function(e,t,i){i||={};var a=e._fullLayout,l=t._id,u=t.zerolinelayer===`above traces`,f=i.cls||l+`tick`,p=i.vals.filter(function(e){return e.text}),m=i.labelFns,h=i.secondary?0:t.tickangle,g=(t._prevTickAngles||{})[f],_=i.layer.selectAll(`g.`+f).data(t.showticklabels?p:[],Xe),v=[];_.enter().append(`g`).classed(f,1).append(`text`).attr(`text-anchor`,`middle`).each(function(t){var r=n.select(this),i=e._promises.length;r.call(c.positionText,m.xFn(t),m.yFn(t)).call(d.font,{family:t.font,size:t.fontSize,color:t.fontColor,weight:t.fontWeight,style:t.fontStyle,variant:t.fontVariant,textcase:t.fontTextcase,lineposition:t.fontLineposition,shadow:t.fontShadow}).text(t.text).call(c.convertToTspans,e),e._promises[i]?v.push(e._promises.pop().then(function(){y(r,h)})):y(r,h)}),mt(t,[V]),_.exit().remove(),i.repositionOnUpdate&&_.each(function(e){n.select(this).select(`text`).call(c.positionText,m.xFn(e),m.yFn(e))});function y(e,a){e.each(function(e){var o=n.select(this),l=o.select(`.text-math-group`),u=m.anchorFn(e,a),f=i.transFn.call(o.node(),e)+(r(a)&&+a!=0?` rotate(`+a+`,`+m.xFn(e)+`,`+(m.yFn(e)-e.fontSize/2)+`)`:``),p=c.lineCount(o),h=K*e.fontSize,g=m.heightFn(e,r(a)?+a:0,(p-1)*h);if(g&&(f+=s(0,g)),l.empty()){var _=o.select(`text`);_.attr({transform:f,"text-anchor":u}),_.style(`display`,null),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var v=d.bBox(l.node()).width*{end:-.5,start:.5}[u];l.attr(`transform`,f+s(v,0))}})}t._adjustTickLabelsOverflow=function(){var r=t.ticklabeloverflow;if(!(!r||r===`allow`)){var i=r.indexOf(`hide`)!==-1,s=t._id.charAt(0)===`x`,c=0,l=s?e._fullLayout.width:e._fullLayout.height;if(r.indexOf(`domain`)!==-1){var u=o.simpleMap(t.range,t.r2l);c=t.l2p(u[0])+t._offset,l=t.l2p(u[1])+t._offset}var f=Math.min(c,l),p=Math.max(c,l),m=t.side,h=1/0,g=-1/0;for(var v in _.each(function(e){var r=n.select(this);if(r.select(`.text-math-group`).empty()){var a=d.bBox(r.node()),o=0;s?(a.right>p||a.left<f)&&(o=1):(a.bottom>p||a.top+(t.tickangle?0:e.fontSize/4)<f)&&(o=1);var c=r.select(`text`);o?i&&c.style(`display`,`none`):c.node().style.display!==`none`&&(c.style(`display`,null),h=m===`bottom`||m===`right`?Math.min(h,s?a.top:a.left):-1/0,g=m===`top`||m===`left`?Math.max(g,s?a.bottom:a.right):1/0)}}),a._plots){var y=a._plots[v];if(!(t._id!==y.xaxis._id&&t._id!==y.yaxis._id)){var b=s?y.yaxis:y.xaxis;b&&(b[`_visibleLabelMin_`+t._id]=h,b[`_visibleLabelMax_`+t._id]=g)}}}},t._hideCounterAxisInsideTickLabels=function(e){var r=t._id.charAt(0)===`x`,i=[];for(var o in a._plots){var s=a._plots[o];t._id!==s.xaxis._id&&t._id!==s.yaxis._id||i.push(r?s.yaxis:s.xaxis)}i.forEach(function(r,i){r&&pt(r)&&(e||[L,z,R,B,V]).forEach(function(e){var o=e.K===`tick`&&e.L===`text`&&t.ticklabelmode===`period`,s=a._plots[t._mainSubplot];(e.K===L.K?(u?s.zerolinelayerAbove:s.zerolinelayer).selectAll(`.`+t._id+`zl`):e.K===z.K?s.minorGridlayer.selectAll(`.`+t._id):e.K===R.K?s.gridlayer.selectAll(`.`+t._id):s[t._id.charAt(0)+`axislayer`]).each(function(){var a=n.select(this);e.L&&(a=a.selectAll(e.L)),a.each(function(a){var s=t.l2p(o?Je(a):a.x)+t._offset,c=n.select(this);s<t[`_visibleLabelMax_`+r._id]&&s>t[`_visibleLabelMin_`+r._id]?c.style(`display`,`none`):e.K===`tick`&&!i&&c.node().style.display!==`none`&&c.style(`display`,null)})})})})},y(_,g+1?g:h);function b(){return v.length&&Promise.all(v)}var x=null;function S(){if(y(_,h),p.length&&t.autotickangles&&(t.type!==`log`||String(t.dtick).charAt(0)!==`D`)){x=t.autotickangles[0];var e=0,n=[],r,a=1;_.each(function(r){e=Math.max(e,r.fontSize);var i=t.l2p(r.x),o=rt(this),s=d.bBox(o.node());a=Math.max(a,c.lineCount(o)),n.push({top:0,bottom:10,height:10,left:i-s.width/2,right:i+s.width/2+2,width:s.width+2})});var s=(t.tickson===`boundaries`||t.showdividers)&&!i.secondary,l=p.length,u=Math.abs((p[l-1].x-p[0].x)*t._m)/(l-1),f=s?u/2:u,m=s?t.ticklen:e*1.25*a,g=f/Math.sqrt(f**2+m**2),v=t.autotickangles.map(function(e){return e*Math.PI/180}),b=v.find(function(e){return Math.abs(Math.cos(e))<=g});b===void 0&&(b=v.reduce(function(e,t){return Math.abs(Math.cos(e))<Math.abs(Math.cos(t))?e:t},v[0]));var S=180/Math.PI*b;if(s){var C=2;for(t.ticks&&(C+=t.tickwidth/2),r=0;r<n.length;r++){var w=p[r].xbnd,T=n[r];if(w[0]!==null&&T.left-t.l2p(w[0])<C||w[1]!==null&&t.l2p(w[1])-T.right<C){x=S;break}}}else{var E=t.ticklabelposition||``,D=t.tickson||``,O=function(e){return E.indexOf(e)!==-1},k=O(`top`),A=O(`left`),j=O(`right`),M=O(`bottom`),N=D!==`boundaries`&&(M||A||k||j)?(t.tickwidth||0)+2*Y:0;for(r=0;r<n.length-1;r++)if(o.bBoxIntersect(n[r],n[r+1],N)){x=S;break}}x&&y(_,x)}}t._selections&&(t._selections[f]=_);var C=[b];t.automargin&&a._redrawFromAutoMarginCount&&g===90?(x=g,C.push(function(){y(_,g)})):C.push(S),t._tickAngles&&C.push(function(){t._tickAngles[f]=x===null?r(h)?h:0:x});var w=function(){var e=0,n=0;return _.each(function(r,i){var a=rt(this);if(a.select(`.text-math-group`).empty()){var o;t._vals[i]&&(o=t._vals[i].bb||d.bBox(a.node()),t._vals[i].bb=o),e=Math.max(e,o.width),n=Math.max(n,o.height)}}),{labelsMaxW:e,labelsMaxH:n}},T=t._anchorAxis;if(T&&(T.autorange||T.insiderange)&&pt(t)&&!te(a,t._id)&&(a._insideTickLabelsUpdaterange||={},T.autorange&&(a._insideTickLabelsUpdaterange[T._name+`.autorange`]=T.autorange,C.push(w)),T.insiderange)){var E=w(),D=t._id.charAt(0)===`y`?E.labelsMaxW:E.labelsMaxH;D+=2*Y,t.ticklabelposition===`inside`&&(D+=t.ticklen||0);var O=t.side===`right`||t.side===`top`?1:-1,k=O===1?1:0,A=O===1?0:1,j=[];j[A]=T.range[A];var M=T.range,N=T.r2p(M[k]),P=T.r2p(M[A]),F=a._insideTickLabelsUpdaterange[T._name+`.range`];if(F){var I=T.r2p(F[k]),H=T.r2p(F[A]),U=O*(t._id.charAt(0)===`y`?1:-1);U*N<U*I&&(N=I,j[k]=M[k]=F[k]),U*P>U*H&&(P=H,j[A]=M[A]=F[A])}var W=Math.abs(P-N);W-D>0?(W-=D,D*=1+D/W):D=0,t._id.charAt(0)!==`y`&&(D=-D),j[k]=T.p2r(T.r2p(M[k])+O*D),T.autorange===`min`||T.autorange===`max reversed`?(j[0]=null,T._rangeInitial0=void 0,T._rangeInitial1=void 0):(T.autorange===`max`||T.autorange===`min reversed`)&&(j[1]=null,T._rangeInitial0=void 0,T._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[T._name+`.range`]=j}var G=o.syncOrAsync(C);return G&&G.then&&e._promises.push(G),G};function Ze(e,t,n){var r=t._id+`divider`,i=n.vals,a=n.layer.selectAll(`path.`+r).data(i,Xe);a.exit().remove(),a.enter().insert(`path`,`:first-child`).classed(r,1).classed(`crisp`,1).call(u.stroke,t.dividercolor).style(`stroke-width`,d.crispRound(e,t.dividerwidth,1)+`px`),a.attr(`transform`,n.transFn).attr(`d`,n.path)}X.getPxPosition=function(e,t){var n=e._fullLayout._size,r=t._id.charAt(0),i=t.side,a;if(t.anchor===`free`?r===`x`?a={_offset:n.t+(1-(t.position||0))*n.h,_length:0}:r===`y`&&(a={_offset:n.l+(t.position||0)*n.w+t._shift,_length:0}):a=t._anchorAxis,i===`top`||i===`left`)return a._offset;if(i===`bottom`||i===`right`)return a._offset+a._length};function Qe(e){var t=e.title.font.size,n=(e.title.text.match(c.BR_TAG_ALL)||[]).length;return e.title.hasOwnProperty(`standoff`)?t*(G+n*K):n?t*(n+1)*K:t}function $e(e,t){var n=e._fullLayout,r=t._id,i=r.charAt(0),a=t.title.font.size,o,s=(t.title.text.match(c.BR_TAG_ALL)||[]).length;if(t.title.hasOwnProperty(`standoff`))t.side===`bottom`||t.side===`right`?o=t._depth+t.title.standoff+a*G:(t.side===`top`||t.side===`left`)&&(o=t._depth+t.title.standoff+a*(W+s*K));else{var u=pt(t);if(t.type===`multicategory`)o=t._depth;else{var f=1.5*a;u&&(f=.5*a,t.ticks===`outside`&&(f+=t.ticklen)),o=10+f+(t.linewidth?t.linewidth-1:0)}u||(i===`x`?o+=t.side===`top`?a*(t.showticklabels?1:0):a*(t.showticklabels?1.5:.5):o+=t.side===`right`?a*(t.showticklabels?1:.5):a*(t.showticklabels?.5:0))}var p=X.getPxPosition(e,t),m,h,g;i===`x`?(h=t._offset+t._length/2,g=t.side===`top`?p-o:p+o):(g=t._offset+t._length/2,h=t.side===`right`?p+o:p-o,m={rotate:`-90`,offset:0});var _;if(t.type!==`multicategory`){var v=t._selections[t._id+`tick`];if(_={selection:v,side:t.side},v&&v.node()&&v.node().parentNode){var y=d.getTranslate(v.node().parentNode);_.offsetLeft=y.x,_.offsetTop=y.y}t.title.hasOwnProperty(`standoff`)&&(_.pad=0)}return t._titleStandoff=o,l.draw(e,r+`title`,{propContainer:t,propName:t._name+`.title.text`,placeholder:n._dfltTitle[i],avoid:_,transform:m,attributes:{x:h,y:g,"text-anchor":`middle`}})}X.shouldShowZeroLine=function(e,t,n){var r=o.simpleMap(t.range,t.r2l);return r[0]*r[1]<=0&&t.zeroline&&(t.type===`linear`||t.type===`-`)&&!(t.rangebreaks&&t.maskBreaks(0)===I)&&(et(t,0)||!tt(e,t,n,r)||nt(e,t))},X.clipEnds=function(e,t){return t.filter(function(t){return et(e,t.x)})};function et(e,t){var n=e.l2p(t);return n>1&&n<e._length-1}function tt(e,t,n,r){var i=n._mainAxis;if(!i)return;var a=e._fullLayout,o=t._id.charAt(0),s=X.counterLetter(t._id),c=t._offset+(Math.abs(r[0])<Math.abs(r[1])==(o===`x`)?0:t._length);function l(e){if(!e.showline||!e.linewidth)return!1;var n=Math.max((e.linewidth+t.zerolinewidth)/2,1);function r(e){return typeof e==`number`&&Math.abs(e-c)<n}if(r(e._mainLinePosition)||r(e._mainMirrorPosition))return!0;var i=e._linepositions||{};for(var a in i)if(r(i[a][0])||r(i[a][1]))return!0}var u=a._plots[n._mainSubplot];if(!(u.mainplotinfo||u).overlays.length)return l(n,c);for(var d=X.list(e,s),f=0;f<d.length;f++){var p=d[f];if(p._mainAxis===i&&l(p,c))return!0}}function nt(e,t){for(var n=e._fullData,r=t._mainSubplot,i=t._id.charAt(0),o=0;o<n.length;o++){var s=n[o];if(s.visible===!0&&s.xaxis+s.yaxis===r&&(a.traceIs(s,`bar-like`)&&s.orientation==={x:`h`,y:`v`}[i]||s.fill&&s.fill.charAt(s.fill.length-1)===i))return!0}return!1}function rt(e){var t=n.select(e),r=t.select(`.text-math-group`);return r.empty()?t.select(`text`):r}X.allowAutoMargin=function(e){for(var t=X.list(e,``,!0),n=0;n<t.length;n++){var r=t[n];r.automargin&&(i.allowAutoMargin(e,it(r)),r.mirror&&i.allowAutoMargin(e,at(r))),a.getComponentMethod(`rangeslider`,`isVisible`)(r)&&i.allowAutoMargin(e,ot(r))}};function it(e){return e._id+`.automargin`}function at(e){return it(e)+`.mirror`}function ot(e){return e._id+`.rangeslider`}X.swap=function(e,t){for(var n=st(e,t),r=0;r<n.length;r++)lt(e,n[r].x,n[r].y)};function st(e,t){var n=[],r,i;for(r=0;r<t.length;r++){var a=[],o=e._fullData[t[r]].xaxis,s=e._fullData[t[r]].yaxis;if(!(!o||!s)){for(i=0;i<n.length;i++)(n[i].x.indexOf(o)!==-1||n[i].y.indexOf(s)!==-1)&&a.push(i);if(!a.length){n.push({x:[o],y:[s]});continue}var c=n[a[0]],l;if(a.length>1)for(i=1;i<a.length;i++)l=n[a[i]],ct(c.x,l.x),ct(c.y,l.y);ct(c.x,[o]),ct(c.y,[s])}}return n}function ct(e,t){for(var n=0;n<t.length;n++)e.indexOf(t[n])===-1&&e.push(t[n])}function lt(e,t,n){var r=[],i=[],a=e.layout,s,c;for(s=0;s<t.length;s++)r.push(X.getFromId(e,t[s]));for(s=0;s<n.length;s++)i.push(X.getFromId(e,n[s]));var l=Object.keys(f),u=[`anchor`,`domain`,`overlaying`,`position`,`side`,`tickangle`,`editType`],d=[`linear`,`log`];for(s=0;s<l.length;s++){var p=l[s],m=r[0][p],h=i[0][p],g=!0,_=!1,v=!1;if(!(p.charAt(0)===`_`||typeof m==`function`||u.indexOf(p)!==-1)){for(c=1;c<r.length&&g;c++){var y=r[c][p];p===`type`&&d.indexOf(m)!==-1&&d.indexOf(y)!==-1&&m!==y?_=!0:y!==m&&(g=!1)}for(c=1;c<i.length&&g;c++){var b=i[c][p];p===`type`&&d.indexOf(h)!==-1&&d.indexOf(b)!==-1&&h!==b?v=!0:i[c][p]!==h&&(g=!1)}g&&(_&&(a[r[0]._name].type=`linear`),v&&(a[i[0]._name].type=`linear`),ut(a,p,r,i,e._fullLayout._dfltTitle))}}for(s=0;s<e._fullLayout.annotations.length;s++){var x=e._fullLayout.annotations[s];t.indexOf(x.xref)!==-1&&n.indexOf(x.yref)!==-1&&o.swapAttrs(a.annotations[s],[`?`])}}function ut(e,t,n,r,i){var a=o.nestedProperty,s=a(e[n[0]._name],t).get(),c=a(e[r[0]._name],t).get(),l;for(t===`title`&&(s&&s.text===i.x&&(s.text=i.y),c&&c.text===i.y&&(c.text=i.x)),l=0;l<n.length;l++)a(e,n[l]._name+`.`+t).set(c);for(l=0;l<r.length;l++)a(e,r[l]._name+`.`+t).set(s)}function dt(e){return e._id===`angularaxis`}function ft(e,t){for(var n=t._rangebreaks.length,r=0;r<n;r++){var i=t._rangebreaks[r];if(e>=i.min&&e<i.max)return i.max}return e}function pt(e){return(e.ticklabelposition||``).indexOf(`inside`)!==-1}function mt(e,t){pt(e._anchorAxis||{})&&e._hideCounterAxisInsideTickLabels&&e._hideCounterAxisInsideTickLabels(t)}function ht(e,t,n,r){var i=e.anchor!==`free`&&(e.overlaying===void 0||e.overlaying===!1)?e._id:e.overlaying,a=r?e.side===`right`?t:-t:t;i in n||(n[i]={}),e.side in n[i]||(n[i][e.side]=0),n[i][e.side]+=a}function gt(e,t){return e.autoshift?t[e.overlaying][e.side]:e.shift||0}function _t(e,t){return/%f/.test(t)?e>=P:/%L/.test(t)?e>=N:/%[SX]/.test(t)?e>=M:/%M/.test(t)?e>=j:/%[HI]/.test(t)?e>=A:/%p/.test(t)?e>=k:/%[Aadejuwx]/.test(t)?e>=E:/%[UVW]/.test(t)?e>=T:/%[Bbm]/.test(t)?e>=w:/%[q]/.test(t)?e>=b:/%[Yy]/.test(t)?e>=_:!0}}),cn=h((e,t)=>{t.exports=function(e,t,n){var r,i;if(n){var a=t===`reversed`||t===`min reversed`||t===`max reversed`;r=n[a?1:0],i=n[a?0:1]}var o=e(`autorangeoptions.minallowed`,i===null?r:void 0),s=e(`autorangeoptions.maxallowed`,r===null?i:void 0);o===void 0&&e(`autorangeoptions.clipmin`),s===void 0&&e(`autorangeoptions.clipmax`),e(`autorangeoptions.include`)}}),ln=h((e,t)=>{var n=cn();t.exports=function(e,t,r,i){var a=t._template||{},o=t.type||a.type||`-`;r(`minallowed`),r(`maxallowed`);var s=r(`range`);if(!s){var c;!i.noInsiderange&&o!==`log`&&(c=r(`insiderange`),c&&(c[0]===null||c[1]===null)&&(t.insiderange=!1,c=void 0),c&&(s=r(`range`,c)))}var l=t.getAutorangeDflt(s,i),u=r(`autorange`,l),d;s&&(s[0]===null&&s[1]===null||(s[0]===null||s[1]===null)&&(u===`reversed`||u===!0)||s[0]!==null&&(u===`min`||u===`max reversed`)||s[1]!==null&&(u===`max`||u===`min reversed`))&&(s=void 0,delete t.range,t.autorange=!0,d=!0),d||(l=t.getAutorangeDflt(s,i),u=r(`autorange`,l)),u&&(n(r,u,s),(o===`linear`||o===`-`)&&r(`rangemode`)),t.cleanRange()}}),un=h((e,t)=>{var n={left:0,top:0};t.exports=r;function r(e,t,n){t=t||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var r=e.clientX||0,a=e.clientY||0,o=i(t);return n[0]=r-o.left,n[1]=a-o.top,n}function i(e){return e===window||e===document||e===document.body?n:e.getBoundingClientRect()}}),dn=h((e,t)=>{var n=ft();function r(){var e=!1;try{var t=Object.defineProperty({},`passive`,{get:function(){e=!0}});window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t)}catch{e=!1}return e}t.exports=n&&r()}),fn=h((e,t)=>{t.exports=function(e,t,n,r,i){var a=(e-n)/(r-n),o=a+t/(r-n),s=(a+o)/2;return i===`left`||i===`bottom`?a:i===`center`||i===`middle`?s:i===`right`||i===`top`?o:a<2/3-s?a:o>4/3-s?o:s}}),pn=h((e,t)=>{var n=$(),r=[[`sw-resize`,`s-resize`,`se-resize`],[`w-resize`,`move`,`e-resize`],[`nw-resize`,`n-resize`,`ne-resize`]];t.exports=function(e,t,i,a){return e=i===`left`?0:i===`center`?1:i===`right`?2:n.constrain(Math.floor(e*3),0,2),t=a===`bottom`?0:a===`middle`?1:a===`top`?2:n.constrain(Math.floor(t*3),0,2),r[t][e]}}),mn=h((e,t)=>{var n=ht(),r=tt(),i=Pe().getGraphDiv,a=V(),o=t.exports={};o.wrapped=function(e,t,n){e=i(e),e._fullLayout&&r.clear(e._fullLayout._uid+a.HOVERID),o.raw(e,t,n)},o.raw=function(e,t){var r=e._fullLayout,i=e._hoverdata;t||={},!(t.target&&!e._dragged&&n.triggerHandler(e,`plotly_beforehover`,t)===!1)&&(r._hoverlayer.selectAll(`g`).remove(),r._hoverlayer.selectAll(`line`).remove(),r._hoverlayer.selectAll(`circle`).remove(),e._hoverdata=void 0,t.target&&i&&e.emit(`plotly_unhover`,{event:t,points:i}))}}),hn=h((e,t)=>{var n=un(),r=pt(),i=dn(),a=$().removeElement,o=bt(),s=t.exports={};s.align=fn(),s.getCursor=pn();var c=mn();s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t=e.gd,n=1,c=t._context.doubleClickDelay,d=e.element,f,p,m,h,g,_,v,y;t._mouseDownTime||=0,d.style.pointerEvents=`all`,d.onmousedown=S,i?(d._ontouchstart&&d.removeEventListener(`touchstart`,d._ontouchstart),d._ontouchstart=S,d.addEventListener(`touchstart`,S,{passive:!1})):d.ontouchstart=S;function b(e,t,n){return Math.abs(e)<n&&(e=0),Math.abs(t)<n&&(t=0),[e,t]}var x=e.clampFn||b;function S(i){t._dragged=!1,t._dragging=!0;var a=u(i);f=a[0],p=a[1],v=i.target,_=i,y=i.buttons===2||i.ctrlKey,i.clientX===void 0&&i.clientY===void 0&&(i.clientX=f,i.clientY=p),m=new Date().getTime(),m-t._mouseDownTime<c?n+=1:(n=1,t._mouseDownTime=m),e.prepFn&&e.prepFn(i,f,p),r&&!y?(g=l(),g.style.cursor=window.getComputedStyle(d).cursor):r||(g=document,h=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(d).cursor),document.addEventListener(`mouseup`,w),document.addEventListener(`touchend`,w),e.dragmode!==!1&&(i.preventDefault(),document.addEventListener(`mousemove`,C),document.addEventListener(`touchmove`,C,{passive:!1}))}function C(n){n.preventDefault();var r=u(n),i=e.minDrag||o.MINDRAG,a=x(r[0]-f,r[1]-p,i),c=a[0],l=a[1];(c||l)&&(t._dragged=!0,s.unhover(t,n)),t._dragged&&e.moveFn&&!y&&(t._dragdata={element:d,dx:c,dy:l},e.moveFn(c,l))}function w(i){if(delete t._dragdata,e.dragmode!==!1&&(i.preventDefault(),document.removeEventListener(`mousemove`,C),document.removeEventListener(`touchmove`,C)),document.removeEventListener(`mouseup`,w),document.removeEventListener(`touchend`,w),r?a(g):h&&=(g.documentElement.style.cursor=h,null),!t._dragging){t._dragged=!1;return}if(t._dragging=!1,new Date().getTime()-t._mouseDownTime>c&&(n=Math.max(n-1,1)),t._dragged)e.doneFn&&e.doneFn();else{var o;_.target===v?o=_:(o={target:v,srcElement:v,toElement:v},Object.keys(_).concat(Object.keys(_.__proto__)).forEach(e=>{var t=_[e];!o[e]&&typeof t!=`function`&&(o[e]=t)})),e.clickFn&&e.clickFn(n,o),y||v.dispatchEvent(new MouseEvent(`click`,i))}t._dragging=!1,t._dragged=!1}};function l(){var e=document.createElement(`div`);e.className=`dragcover`;var t=e.style;return t.position=`fixed`,t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background=`none`,document.body.appendChild(e),e}s.coverSlip=l;function u(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}}),gn=h((e,t)=>{t.exports=function(e,t){(e.attr(`class`)||``).split(` `).forEach(function(t){t.indexOf(`cursor-`)===0&&e.classed(t,!1)}),t&&e.classed(`cursor-`+t,!0)}}),_n=h((e,t)=>{var n=gn(),r=`data-savedcursor`,i=`!!`;t.exports=function(e,t){var a=e.attr(r);if(t){if(!a){for(var o=(e.attr(`class`)||``).split(` `),s=0;s<o.length;s++){var c=o[s];c.indexOf(`cursor-`)===0&&e.attr(r,c.slice(7)).classed(c,!1)}e.attr(r)||e.attr(r,i)}n(e,t)}else a&&(e.attr(r,null),a===i?n(e):n(e,a))}}),vn=h((e,t)=>{var n=B();t.exports={_isSubplotObj:!0,visible:{valType:`boolean`,dflt:!0,editType:`legend`},bgcolor:{valType:`color`,editType:`legend`},bordercolor:{valType:`color`,dflt:K().defaultLine,editType:`legend`},maxheight:{valType:`number`,min:0,editType:`legend`},borderwidth:{valType:`number`,min:0,dflt:0,editType:`legend`},font:n({editType:`legend`}),grouptitlefont:n({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`},titleclick:{valType:`enumerated`,values:[`toggle`,`toggleothers`,!1],editType:`legend`},titledoubleclick:{valType:`enumerated`,values:[`toggle`,`toggleothers`,!1],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:n({editType:`legend`}),side:{valType:`enumerated`,values:[`top`,`left`,`top left`,`top center`,`top right`],editType:`legend`},editType:`legend`},editType:`legend`}}),yn=h(e=>{e.isGrouped=function(e){return(e.traceorder||``).indexOf(`grouped`)!==-1},e.isVertical=function(e){return e.orientation!==`h`},e.isReversed=function(e){return(e.traceorder||``).indexOf(`reversed`)!==-1},e.getId=function(e){return e._id||`legend`}}),bn=h((e,t)=>{var n=Ke(),r=$(),i=yt(),a=W(),o=vn(),s=We(),c=yn();function l(e,t,l,u,d){var f=t[e]||{},p=i.newContainer(l,e);function m(e,t){return r.coerce(f,p,o,e,t)}var h=r.coerceFont(m,`font`,l.font);if(m(`bgcolor`,l.paper_bgcolor),m(`bordercolor`),!m(`visible`))return;var g,_=function(e,t){var n=g._input,i=g;return r.coerce(n,i,a,e,t)},v=l.font||{},y=r.coerceFont(m,`grouptitlefont`,v,{overrideDflt:{size:Math.round(v.size*1.1)}}),b=0,x=!1,S=`normal`,C=(l.shapes||[]).filter(function(e){return e.showlegend});function w(e){return n.traceIs(e,`pie-like`)&&e._length!=null&&(Array.isArray(e.legend)||Array.isArray(e.showlegend))}u.filter(w).forEach(function(t){t.visible&&b++;for(var n=0;n<t._length;n++)((Array.isArray(t.legend)?t.legend[n]:t.legend)||`legend`)===e&&((Array.isArray(t.showlegend)?t.showlegend[n]:t.showlegend)||t._dfltShowLegend)&&(x=!0,b++);if(e===`legend`&&t._length>t.legend.length)for(var r=t.legend.length;r<t._length;r++)x=!0,b++});for(var T=u.concat(C).filter(function(t){return!w(g)&&e===(t.legend||`legend`)}),E=0;E<T.length;E++)if(g=T[E],g.visible){var D=g._isShape;(g.showlegend||g._dfltShowLegend&&!(g._module&&g._module.attributes&&g._module.attributes.showlegend&&g._module.attributes.showlegend.dflt===!1))&&(b++,g.showlegend&&(x=!0,(!D&&n.traceIs(g,`pie-like`)||g._input.showlegend===!0)&&b++),r.coerceFont(_,`legendgrouptitle.font`,y)),(!D&&n.traceIs(g,`bar`)&&l.barmode===`stack`||[`tonextx`,`tonexty`].indexOf(g.fill)!==-1)&&(S=c.isGrouped({traceorder:S})?`grouped+reversed`:`reversed`),g.legendgroup!==void 0&&g.legendgroup!==``&&(S=c.isReversed({traceorder:S})?`reversed+grouped`:`grouped`)}var O=r.coerce(t,l,s,`showlegend`,l.showlegend||x&&b>(e===`legend`?1:0));if(O===!1&&(l[e]=void 0),!(O===!1&&!f.uirevision)&&(m(`uirevision`,l.uirevision),O!==!1)){m(`borderwidth`);var k=m(`orientation`),A=m(`yref`),j=m(`xref`),M=k===`h`,N=A===`paper`,P=j===`paper`,F,I,L,R=`left`;if(M?(F=0,n.getComponentMethod(`rangeslider`,`isVisible`)(t.xaxis)?N?(I=1.1,L=`bottom`):(I=1,L=`top`):N?(I=-.1,L=`top`):(I=0,L=`bottom`)):(I=1,L=`auto`,P?F=1.02:(F=1,R=`right`)),r.coerce(f,p,{x:{valType:`number`,editType:`legend`,min:P?-2:0,max:P?3:1,dflt:F}},`x`),r.coerce(f,p,{y:{valType:`number`,editType:`legend`,min:N?-2:0,max:N?3:1,dflt:I}},`y`),m(`traceorder`,S),c.isGrouped(l[e])&&m(`tracegroupgap`),m(`entrywidth`),m(`entrywidthmode`),m(`indentation`),m(`itemsizing`),m(`itemwidth`),m(`itemclick`),m(`itemdoubleclick`),m(`groupclick`),m(`xanchor`,R),m(`yanchor`,L),m(`maxheight`),m(`valign`),r.noneOrAll(f,p,[`x`,`y`]),m(`title.text`)){m(`title.side`,M?`left`:`top`);var z=r.extendFlat({},h,{size:r.bigFont(h.size)});r.coerceFont(m,`title.font`,z);let e=d>1;m(`titleclick`,e?`toggle`:!1),m(`titledoubleclick`,e?`toggleothers`:!1)}}}t.exports=function(e,t,n){var i,a=n.slice(),o=t.shapes;if(o)for(i=0;i<o.length;i++){var s=o[i];if(s.showlegend){var c={_input:s._input,visible:s.visible,showlegend:s.showlegend,legend:s.legend};a.push(c)}}var u=[`legend`];for(i=0;i<a.length;i++)Array.isArray(a[i].legend)?u=u.concat(a[i].legend):r.pushUnique(u,a[i].legend);for(t._legends=[],i=0;i<u.length;i++){var d=u[i];l(d,e,t,a,u.length),t[d]&&(t[d]._id=d),t._legends.push(d)}}}),xn=h(e=>{var t=Ke(),n=$(),r=n.pushUnique,i=yn(),a=!0;e.handleItemClick=function(e,i,o,s){var c=i._fullLayout;if(i._dragged||i._editing)return;var l=e.data()[0][0];if(l.groupTitle&&l.noClick)return;var u=o.groupclick;s===`toggle`&&o.itemdoubleclick===`toggleothers`&&a&&i.data&&i._context.showTips&&(n.notifier(n._(i,`Double-click on legend to isolate one trace`),`long`,i),a=!1);var d=u===`togglegroup`,f=c.hiddenlabels?c.hiddenlabels.slice():[],p=i._fullData,m=(c.shapes||[]).filter(function(e){return e.showlegend}),h=p.concat(m),g=l.trace;g._isShape&&(g=g._fullInput);var _=g.legendgroup,v,y,b,x,S,C,w={},T=[],E=[],D=[];function O(e,t){var n=T.indexOf(e),r=w.visible;return r||=w.visible=[],T.indexOf(e)===-1&&(T.push(e),n=T.length-1),r[n]=t,n}var k=(c.shapes||[]).map(function(e){return e._input}),A=!1;function j(e,t){k[e].visible=t,A=!0}function M(e,t){if(!(l.groupTitle&&!d)){var n=e._fullInput||e,r=n._isShape,i=n.index;i===void 0&&(i=n._index);var a=n.visible===!1?!1:t;r?j(i,a):O(i,a)}}var N=g.legend,P=g._fullInput;if(!(P&&P._isShape)&&t.traceIs(g,`pie-like`)){var F=l.label,I=f.indexOf(F);if(s===`toggle`)I===-1?f.push(F):f.splice(I,1);else if(s===`toggleothers`){var L=I!==-1,R=[];for(v=0;v<i.calcdata.length;v++){var z=i.calcdata[v];for(y=0;y<z.length;y++){var B=z[y].label;N===z[0].trace.legend&&F!==B&&(f.indexOf(B)===-1&&(L=!0),r(f,B),R.push(B))}}if(!L)for(var V=0;V<R.length;V++){var H=f.indexOf(R[V]);H!==-1&&f.splice(H,1)}}t.call(`_guiRelayout`,i,`hiddenlabels`,f)}else{var U=_&&_.length,W=[],G;if(U)for(v=0;v<h.length;v++)G=h[v],G.visible&&G.legendgroup===_&&W.push(v);if(s===`toggle`){var K;switch(g.visible){case!0:K=`legendonly`;break;case!1:K=!1;break;case`legendonly`:K=!0;break}if(U)if(d)for(v=0;v<h.length;v++){var q=h[v];q.visible!==!1&&q.legendgroup===_&&M(q,K)}else M(g,K);else M(g,K)}else if(s===`toggleothers`){var J,Y,X,Z,Q,ee=!0;for(v=0;v<h.length;v++)if(Q=h[v],J=Q===g,X=Q.showlegend!==!0,!(J||X)&&(Y=U&&Q.legendgroup===_,!Y&&Q.legend===N&&Q.visible===!0&&!t.traceIs(Q,`notLegendIsolatable`))){ee=!1;break}for(v=0;v<h.length;v++)if(Q=h[v],!(Q.visible===!1||Q.legend!==N)&&!t.traceIs(Q,`notLegendIsolatable`))switch(g.visible){case`legendonly`:M(Q,!0);break;case!0:Z=ee?!0:`legendonly`,J=Q===g,X=Q.showlegend!==!0&&!Q.legendgroup,Y=J||U&&Q.legendgroup===_,M(Q,Y||X?!0:Z);break}}for(v=0;v<E.length;v++)if(b=E[v],b){var te=b.constructUpdate(),ne=Object.keys(te);for(y=0;y<ne.length;y++)x=ne[y],C=w[x]=w[x]||[],C[D[v]]=te[x]}for(S=Object.keys(w),v=0;v<S.length;v++)for(x=S[v],y=0;y<T.length;y++)w[x].hasOwnProperty(y)||(w[x][y]=void 0);A?t.call(`_guiUpdate`,i,w,{shapes:k},T):t.call(`_guiRestyle`,i,w,T)}},e.handleTitleClick=function(e,n,r){let a=e._fullLayout,o=e._fullData,s=i.getId(n),c=(a.shapes||[]).filter(function(e){return e.showlegend}),l=o.concat(c);function u(e){return(e.legend||`legend`)===s}var d,f;if(r===`toggle`)d=!l.some(function(e){return u(e)&&e.visible===!0}),f=!1;else{let e=l.some(function(e){return!u(e)&&e.visible===!0&&e.showlegend!==!1});d=!0,f=!e}let p={visible:[]},m=[],h=(a.shapes||[]).map(function(e){return e._input});for(var g=!1,_=0;_<l.length;_++){let e=l[_],t=u(e);if(!t){let t=e.showlegend!==!0&&!e.legendgroup;if(r===`toggle`||t)continue}let n=(t?d:f)?!0:`legendonly`;e.visible!==!1&&e.visible!==n&&(e._isShape?(h[e._index].visible=n,g=!0):(m.push(e.index),p.visible.push(n)))}g?t.call(`_guiUpdate`,e,p,{shapes:h},m):m.length&&t.call(`_guiRestyle`,e,p,m)}}),Sn=h((e,t)=>{t.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:`#808BA4`,scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}}),Cn=h((e,t)=>{var n=Ke(),r=yn();t.exports=function(e,t,i){var a=t._inHover,o=r.isGrouped(t),s=r.isReversed(t),c={},l=[],u=!1,d={},f=0,p=0,m,h;function g(e,n,a){if(t.visible!==!1&&!(i&&e!==t._id))if(n===``||!r.isGrouped(t)){var o=`~~i`+f;l.push(o),c[o]=[a],f++}else l.indexOf(n)===-1?(l.push(n),u=!0,c[n]=[a]):c[n].push(a)}for(m=0;m<e.length;m++){var _=e[m],v=_[0],y=v.trace,b=y.legend,x=y.legendgroup;if(!(!a&&(!y.visible||!y.showlegend)))if(n.traceIs(y,`pie-like`)){var S=Array.isArray(y.legend),C=Array.isArray(y.showlegend);for(d[x]||(d[x]={}),h=0;h<_.length;h++)if(!(C&&y.showlegend[_[h].i]===!1)){S&&(b=y.legend[_[h].i]||`legend`);var w=_[h].label;d[x][w]||(g(b,x,{label:w,color:_[h].color,i:_[h].i,trace:y,pts:_[h].pts}),d[x][w]=!0,p=Math.max(p,(w||``).length))}}else g(b,x,v),p=Math.max(p,(y.name||``).length)}if(!l.length)return[];var T=!u||!o,E=[];for(m=0;m<l.length;m++){var D=c[l[m]];T?E.push(D[0]):E.push(D)}for(T&&(E=[E]),m=0;m<E.length;m++){var O=1/0;for(h=0;h<E[m].length;h++){var k=E[m][h].trace.legendrank;O>k&&(O=k)}E[m][0]._groupMinRank=O,E[m][0]._preGroupSort=m}var A=function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort},j=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(E.forEach(function(e,t){e[0]._preGroupSort=t}),E.sort(A),m=0;m<E.length;m++){E[m].forEach(function(e,t){e._preSort=t}),E[m].sort(j);var M=E[m][0].trace,N=null;for(h=0;h<E[m].length;h++){var P=E[m][h].trace.legendgrouptitle;if(P&&P.text){N=P,a&&(P.font=t._groupTitleFont);break}}if(s&&E[m].reverse(),N){var F=!1;for(h=0;h<E[m].length;h++)if(n.traceIs(E[m][h].trace,`pie-like`)){F=!0;break}E[m].unshift({i:-1,groupTitle:N,noClick:F,trace:{showlegend:M.showlegend,legendgroup:M.legendgroup,legend:M.legend,visible:t.groupclick===`toggleitem`?!0:M.visible}})}for(h=0;h<E[m].length;h++)E[m][h]=[E[m][h]]}return t._lgroupsLength=E.length,t._maxNameLength=p,E}}),wn=h(e=>{var t=$();function n(e){return e.indexOf(`e`)===-1?e.indexOf(`.`)===-1?e:e.replace(/[.]?0+$/,``):e.replace(/[.]?0+e/,`e`)}e.formatPiePercent=function(e,r){var i=n((e*100).toPrecision(3));return t.numSeparate(i,r)+`%`},e.formatPieValue=function(e,r){var i=n(e.toPrecision(10));return t.numSeparate(i,r)},e.getFirstFilled=function(e,n){if(t.isArrayOrTypedArray(e))for(var r=0;r<n.length;r++){var i=e[n[r]];if(i||i===0||i===``)return i}},e.castOption=function(n,r){if(t.isArrayOrTypedArray(n))return e.getFirstFilled(n,r);if(n)return n},e.getRotationAngle=function(e){return(e===`auto`?0:e)*Math.PI/180}}),Tn=h((e,t)=>{var n=tn(),r=q();t.exports=function(e,t,i,a){var o=i.marker.pattern;o&&o.shape?n.pointStyle(e,i,a,t):r.fill(e,t.color)}}),En=h((e,t)=>{var n=q(),r=wn().castOption,i=Tn();t.exports=function(e,t,a,o){var s=a.marker.line,c=r(s.color,t.pts)||n.defaultLine,l=r(s.width,t.pts)||0;e.call(i,t,a,o).style(`stroke-width`,l).call(n.stroke,c)}}),Dn=h((e,t)=>{var n=S(),r=Ke(),i=$(),a=i.strTranslate,o=tn(),s=q(),c=At().extractOpts,l=Xt(),u=En(),d=wn().castOption,f=Sn(),p=12,m=5,h=2,g=10,_=5;t.exports=function(e,t,x){var S=t._fullLayout;x||=S.legend;var C=x.itemsizing===`constant`,w=x.itemwidth,T=a((w+f.itemGap*2)/2,0),E=function(e,t,n,r){var i;if(e+1)i=e;else if(t&&t.width>0)i=t.width;else return 0;return C?r:Math.min(i,n)};e.each(function(e){var t=n.select(this),r=i.ensureSingle(t,`g`,`layers`);r.style(`opacity`,e[0].trace.opacity);var o=x.indentation,s=x.valign,c=e[0].lineHeight,l=e[0].height;if(s===`middle`&&o===0||!c||!l)r.attr(`transform`,null);else{var u={top:1,bottom:-1}[s]*(.5*(c-l+3))||0,d=x.indentation;r.attr(`transform`,a(d,u))}r.selectAll(`g.legendfill`).data([e]).enter().append(`g`).classed(`legendfill`,!0),r.selectAll(`g.legendlines`).data([e]).enter().append(`g`).classed(`legendlines`,!0);var f=r.selectAll(`g.legendsymbols`).data([e]);f.enter().append(`g`).classed(`legendsymbols`,!0),f.selectAll(`g.legendpoints`).data([e]).enter().append(`g`).classed(`legendpoints`,!0)}).each(z).each(k).each(j).each(A).each(N).each(L).each(I).each(D).each(O).each(P).each(F);function D(e){var r=y(e),a=r.showFill,s=r.showLine,u=r.showGradientLine,d=r.showGradientFill,f=r.anyFill,p=r.anyLine,h=e[0],_=h.trace,b,x,S=c(_),C=S.colorscale,T=S.reversescale,D=function(e){if(e.size())if(a)o.fillGroupStyle(e,t,!0);else{var n=`legendfill-`+_.uid;o.gradient(e,t,n,v(T),C,`fill`)}},O=function(e){if(e.size()){var n=`legendline-`+_.uid;o.lineGroupStyle(e),o.gradient(e,t,n,v(T),C,`stroke`)}},k=l.hasMarkers(_)||!f?`M5,0`:p?`M5,-2`:`M5,-3`,A=n.select(this),j=A.select(`.legendfill`).selectAll(`path`).data(a||d?[e]:[]);if(j.enter().append(`path`).classed(`js-fill`,!0),j.exit().remove(),j.attr(`d`,k+`h`+w+`v6h-`+w+`z`).call(D),s||u){var M=E(void 0,_.line,g,m);x=i.minExtend(_,{line:{width:M}}),b=[i.minExtend(h,{trace:x})]}var N=A.select(`.legendlines`).selectAll(`path`).data(s||u?[b]:[]);N.enter().append(`path`).classed(`js-line`,!0),N.exit().remove(),N.attr(`d`,k+(u?`l`+w+`,0.0001`:`h`+w)).call(s?o.lineGroupStyle:O)}function O(e){var r=y(e),a=r.anyFill,s=r.anyLine,c=r.showLine,u=r.showMarker,d=e[0],f=d.trace,g=!u&&!s&&!a&&l.hasText(f),_,v;function b(e,t,n,r){var a=i.nestedProperty(f,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(C&&o&&r!==void 0&&(o=r),n){if(o<n[0])return n[0];if(o>n[1])return n[1]}return o}function x(e){return d._distinct&&d.index&&e[d.index]?e[d.index]:e[0]}if(u||g||c){var S={},w={};if(u){S.mc=b(`marker.color`,x),S.mx=b(`marker.symbol`,x),S.mo=b(`marker.opacity`,i.mean,[.2,1]),S.mlc=b(`marker.line.color`,x),S.mlw=b(`marker.line.width`,i.mean,[0,5],h),S.mld=f._isShape?`solid`:b(`marker.line.dash`,x),w.marker={sizeref:1,sizemin:1,sizemode:`diameter`};var E=b(`marker.size`,i.mean,[2,16],p);S.ms=E,w.marker.size=E}c&&(w.line={width:b(`line.width`,x,[0,10],m)}),g&&(S.tx=`Aa`,S.tp=b(`textposition`,x),S.ts=10,S.tc=b(`textfont.color`,x),S.tf=b(`textfont.family`,x),S.tw=b(`textfont.weight`,x),S.ty=b(`textfont.style`,x),S.tv=b(`textfont.variant`,x),S.tC=b(`textfont.textcase`,x),S.tE=b(`textfont.lineposition`,x),S.tS=b(`textfont.shadow`,x)),_=[i.minExtend(d,S)],v=i.minExtend(f,w),v.selectedpoints=null,v.texttemplate=null}var D=n.select(this).select(`g.legendpoints`),O=D.selectAll(`path.scatterpts`).data(u?_:[]);O.enter().insert(`path`,`:first-child`).classed(`scatterpts`,!0).attr(`transform`,T),O.exit().remove(),O.call(o.pointStyle,v,t),u&&(_[0].mrc=3);var k=D.selectAll(`g.pointtext`).data(g?_:[]);k.enter().append(`g`).classed(`pointtext`,!0).append(`text`).attr(`transform`,T),k.exit().remove(),k.selectAll(`text`).call(o.textPointStyle,v,t)}function k(e){var t=e[0].trace,r=t.type===`waterfall`;if(e[0]._distinct&&r){var i=e[0].trace[e[0].dir].marker;return e[0].mc=i.color,e[0].mlw=i.line.width,e[0].mlc=i.line.color,M(e,this,`waterfall`)}var a=[];t.visible&&r&&(a=e[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 o=n.select(this).select(`g.legendpoints`).selectAll(`path.legendwaterfall`).data(a);o.enter().append(`path`).classed(`legendwaterfall`,!0).attr(`transform`,T).style(`stroke-miterlimit`,1),o.exit().remove(),o.each(function(e){var r=n.select(this),i=t[e[0]].marker,a=E(void 0,i.line,_,h);r.attr(`d`,e[1]).style(`stroke-width`,a+`px`).call(s.fill,i.color),a&&r.call(s.stroke,i.line.color)})}function A(e){M(e,this)}function j(e){M(e,this,`funnel`)}function M(e,i,a){var l=e[0].trace,u=l.marker||{},d=u.line||{},f=u.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`,p=a?l.visible&&l.type===a:r.traceIs(l,`bar`),m=n.select(i).select(`g.legendpoints`).selectAll(`path.legend`+a).data(p?[e]:[]);m.enter().append(`path`).classed(`legend`+a,!0).attr(`d`,f).attr(`transform`,T),m.exit().remove(),m.each(function(e){var r=n.select(this),i=e[0],a=E(i.mlw,u.line,_,h);r.style(`stroke-width`,a+`px`);var f=i.mcc;if(!x._inHover&&`mc`in i){var p=c(u),m=p.mid;m===void 0&&(m=(p.max+p.min)/2),f=o.tryColorscale(u,``)(m)}var g=f||i.mc||u.color,v=u.pattern,y=o.getPatternAttr,S=v&&(y(v.shape,0,``)||y(v.path,0,``));if(S){var C=y(v.bgcolor,0,null),w=y(v.fgcolor,0,null),T=v.fgopacity,D=b(v.size,8,10),O=b(v.solidity,.5,1),k=`legend-`+l.uid;r.call(o.pattern,`legend`,t,k,S,D,O,f,v.fillmode,C,w,T)}else r.call(s.fill,g);a&&s.stroke(r,i.mlc||d.color)})}function N(e){var a=e[0].trace,c=n.select(this).select(`g.legendpoints`).selectAll(`path.legendbox`).data(a.visible&&r.traceIs(a,`box-violin`)?[e]:[]);c.enter().append(`path`).classed(`legendbox`,!0).attr(`d`,`M6,6H-6V-6H6Z`).attr(`transform`,T),c.exit().remove(),c.each(function(){var e=n.select(this);if((a.boxpoints===`all`||a.points===`all`)&&s.opacity(a.fillcolor)===0&&s.opacity((a.line||{}).color)===0){var r=i.minExtend(a,{marker:{size:C?p:i.constrain(a.marker.size,2,16),sizeref:1,sizemin:1,sizemode:`diameter`}});c.call(o.pointStyle,r,t)}else{var l=E(void 0,a.line,_,h);e.style(`stroke-width`,l+`px`).call(s.fill,a.fillcolor),l&&s.stroke(e,a.line.color)}})}function P(e){var t=e[0].trace,r=n.select(this).select(`g.legendpoints`).selectAll(`path.legendcandle`).data(t.visible&&t.type===`candlestick`?[e,e]:[]);r.enter().append(`path`).classed(`legendcandle`,!0).attr(`d`,function(e,t){return t?`M-15,0H-8M-8,6V-6H8Z`:`M15,0H8M8,-6V6H-8Z`}).attr(`transform`,T).style(`stroke-miterlimit`,1),r.exit().remove(),r.each(function(e,r){var i=n.select(this),a=t[r?`increasing`:`decreasing`],o=E(void 0,a.line,_,h);i.style(`stroke-width`,o+`px`).call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)})}function F(e){var t=e[0].trace,r=n.select(this).select(`g.legendpoints`).selectAll(`path.legendohlc`).data(t.visible&&t.type===`ohlc`?[e,e]:[]);r.enter().append(`path`).classed(`legendohlc`,!0).attr(`d`,function(e,t){return t?`M-15,0H0M-8,-6V0`:`M15,0H0M8,6V0`}).attr(`transform`,T).style(`stroke-miterlimit`,1),r.exit().remove(),r.each(function(e,r){var i=n.select(this),a=t[r?`increasing`:`decreasing`],c=E(void 0,a.line,_,h);i.style(`fill`,`none`).call(o.dashLine,a.line.dash,c),c&&s.stroke(i,a.line.color)})}function I(e){R(e,this,`pie`)}function L(e){R(e,this,`funnelarea`)}function R(e,a,o){var s=e[0],c=s.trace,l=o?c.visible&&c.type===o:r.traceIs(c,o),f=n.select(a).select(`g.legendpoints`).selectAll(`path.legend`+o).data(l?[e]:[]);if(f.enter().append(`path`).classed(`legend`+o,!0).attr(`d`,`M6,6H-6V-6H6Z`).attr(`transform`,T),f.exit().remove(),f.size()){var p=c.marker||{},m=E(d(p.line.width,s.pts),p.line,_,h),g=`pieLike`,v=i.minExtend(c,{marker:{line:{width:m}}},g);u(f,i.minExtend(s,{trace:v},g),v,t)}}function z(e){var r=e[0].trace,a,l=[];if(r.visible)switch(r.type){case`histogram2d`:case`heatmap`:l=[[`M-15,-2V4H15V-2Z`]],a=!0;break;case`choropleth`:case`choroplethmapbox`:case`choroplethmap`:l=[[`M-6,-6V6H6V-6Z`]],a=!0;break;case`densitymapbox`:case`densitymap`:l=[[`M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0`]],a=`radial`;break;case`cone`:l=[[`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`]],a=!1;break;case`streamtube`:l=[[`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`]],a=!1;break;case`surface`:l=[[`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`]],a=!0;break;case`mesh3d`:l=[[`M-6,6H0L-6,-6Z`],[`M6,6H0L6,-6Z`],[`M-6,-6H6L0,6Z`]],a=!1;break;case`volume`:l=[[`M-6,6H0L-6,-6Z`],[`M6,6H0L6,-6Z`],[`M-6,-6H6L0,6Z`]],a=!0;break;case`isosurface`:l=[[`M-6,6H0L-6,-6Z`],[`M6,6H0L6,-6Z`],[`M-6,-6 A12,24 0 0,0 6,-6 L0,6Z`]],a=!1;break}var u=n.select(this).select(`g.legendpoints`).selectAll(`path.legend3dandfriends`).data(l);u.enter().append(`path`).classed(`legend3dandfriends`,!0).attr(`transform`,T).style(`stroke-miterlimit`,1),u.exit().remove(),u.each(function(e,l){var u=n.select(this),d=c(r),f=d.colorscale,p=d.reversescale,m=function(e){if(e.size()){var n=`legendfill-`+r.uid;o.gradient(e,t,n,v(p,a===`radial`),f,`fill`)}},h;if(f){if(!a){var g=f.length;h=l===0?f[p?g-1:0][1]:l===1?f[p?0:g-1][1]:f[Math.floor((g-1)/2)][1]}}else{var _=r.vertexcolor||r.facecolor||r.color;h=i.isArrayOrTypedArray(_)?_[l]||_[0]:_}u.attr(`d`,e[0]),h?u.call(s.fill,h):u.call(m)})}};function v(e,t){return(t?`radial`:`horizontal`)+(e?``:`reversed`)}function y(e){var t=e[0].trace,n=t.contours,r=l.hasLines(t),i=l.hasMarkers(t),a=t.visible&&t.fill&&t.fill!==`none`,o=!1,s=!1;if(n){var c=n.coloring;c===`lines`?o=!0:r=c===`none`||c===`heatmap`||n.showlines,n.type===`constraint`?a=n._operation!==`=`:(c===`fill`||c===`heatmap`)&&(s=!0)}return{showMarker:i,showLine:r,showFill:a,showGradientLine:o,showGradientFill:s,anyLine:r||o,anyFill:a||s}}function b(e,t,n){return e&&i.isArrayOrTypedArray(e)?t:e>n?n:e}}),On=h((e,t)=>{var n=S(),r=$(),i=Et(),a=Ke(),o=ht(),s=hn(),c=tn(),l=q(),u=kt(),d=xn().handleItemClick,f=xn().handleTitleClick,p=Sn(),m=Ot(),h=m.LINE_SPACING,g=m.FROM_TL,_=m.FROM_BR,v=Cn(),y=Dn(),b=yn(),x=1,C=/^legend[0-9]*$/;t.exports=function(e,t){if(t)T(e,t);else{var r=e._fullLayout,i=r._legends;r._infolayer.selectAll(`[class^="legend"]`).each(function(){var e=n.select(this),t=e.attr(`class`).split(` `)[0];t.match(C)&&i.indexOf(t)===-1&&e.remove()});for(var a=0;a<i.length;a++){var o=i[a],s=e._fullLayout[o];T(e,s)}}};function w(e,t,n){if(!(t.title.side!==`top center`&&t.title.side!==`top right`)){var r=t.title.font.size*h,i=0,a=e.node(),o=c.bBox(a).width;t.title.side===`top center`?i=.5*(t._width-2*n-2*p.titlePad-o):t.title.side===`top right`&&(i=t._width-2*n-2*p.titlePad-o),u.positionText(e,n+p.titlePad+i,n+r)}}function T(e,t){var o=t||{},u=e._fullLayout,d=b.getId(o),f,m,h=o._inHover;if(h?(m=o.layer,f=`hover`):(m=u._infolayer,f=d),m){f+=u._uid,e._legendMouseDownTime||=0;var _;if(h){if(!o.entries)return;_=v(o.entries,o)}else{for(var S=(e.calcdata||[]).slice(),C=u.shapes,w=0;w<C.length;w++){var T=C[w];if(T.showlegend){var E={_isShape:!0,_fullInput:T,index:T._index,name:T.name||T.label.text||`shape `+T._index,legend:T.legend,legendgroup:T.legendgroup,legendgrouptitle:T.legendgrouptitle,legendrank:T.legendrank,legendwidth:T.legendwidth,showlegend:T.showlegend,visible:T.visible,opacity:T.opacity,mode:T.type===`line`?`lines`:`markers`,line:T.line,marker:{line:T.line,color:T.fillcolor,size:12,symbol:T.type===`rect`?`square`:T.type===`circle`?`circle`:`hexagon2`}};S.push([{trace:E}])}}_=u.showlegend&&v(S,o,u._legends.length>1)}var k=u.hiddenlabels||[];if(!h&&(!u.showlegend||!_.length))return m.selectAll(`.`+d).remove(),u._topdefs.select(`#`+f).remove(),i.autoMargin(e,d);var N=r.ensureSingle(m,`g`,d,function(e){h||e.attr(`pointer-events`,`all`)}),P=r.ensureSingleById(u._topdefs,`clipPath`,f,function(e){e.append(`rect`)}),z=r.ensureSingle(N,`rect`,`bg`,function(e){e.attr(`shape-rendering`,`crispEdges`)});z.call(l.stroke,o.bordercolor).call(l.fill,o.bgcolor).style(`stroke-width`,o.borderwidth+`px`);var B=r.ensureSingle(N,`g`,`scrollbox`),V=o.title;o._titleWidth=0,o._titleHeight=0;var H;V.text?(H=r.ensureSingle(B,`text`,d+`titletext`),H.attr(`text-anchor`,`start`).call(c.font,V.font).text(V.text),M(H,B,e,o,x),!h&&(o.titleclick||o.titledoubleclick)&&j(B,e,o,d)):(B.selectAll(`.`+d+`titletext`).remove(),B.selectAll(`.`+d+`titletoggle`).remove());var U=r.ensureSingle(N,`rect`,`scrollbar`,function(e){e.attr(p.scrollBarEnterAttrs).call(l.fill,p.scrollBarColor)}),W=B.selectAll(`g.groups`).data(_);W.enter().append(`g`).attr(`class`,`groups`),W.exit().remove();var G=W.selectAll(`g.traces`).data(r.identity);G.enter().append(`g`).attr(`class`,`traces`),G.exit().remove(),G.style(`opacity`,function(t){let n=t[0],r=n.trace;if(n.groupTitle){let t=r.legendgroup,n=(u.shapes||[]).filter(function(e){return e.showlegend});return e._fullData.concat(n).some(function(e){return e.legendgroup===t&&(e.legend||`legend`)===d&&e.visible===!0})?1:.5}return a.traceIs(r,`pie-like`)?k.indexOf(t[0].label)===-1?1:.5:r.visible===`legendonly`?.5:1}).each(function(){n.select(this).call(O,e,o)}).call(y,e,o).each(function(t){h||t[0].groupTitle&&o.groupclick===`toggleitem`||n.select(this).call(A,e,d)}),r.syncOrAsync([i.previousPromises,function(){return F(e,W,G,o,B)},function(){var t=u._size,i=o.borderwidth,l=o.xref===`paper`,_=o.yref===`paper`;if(V.text){let t=(u.shapes||[]).filter(function(e){return e.showlegend}),n=e._fullData.concat(t).some(function(e){let t=e.legend||`legend`;return(Array.isArray(t)?t.includes(d):t===d)&&e.visible===!0});H.style(`opacity`,n?1:.5)}if(!h){var v=l?t.l+t.w*o.x-g[L(o)]*o._width:u.width*o.x-g[L(o)]*o._width,y=_?t.t+t.h*(1-o.y)-g[R(o)]*o._effHeight:u.height*(1-o.y)-g[R(o)]*o._effHeight;if(I(e,d,v,y))return;if(u.margin.autoexpand){var b=v,x=y;v=l?r.constrain(v,0,u.width-o._width):b,y=_?r.constrain(y,0,u.height-o._effHeight):x,v!==b&&r.log(`Constrain `+d+`.x to make legend fit inside graph`),y!==x&&r.log(`Constrain `+d+`.y to make legend fit inside graph`)}c.setTranslate(N,v,y)}if(U.on(`.drag`,null),N.on(`wheel`,null),h||o._height<=o._maxHeight||e._context.staticPlot){var S=o._effHeight;h&&(S=o._height),z.attr({width:o._width-i,height:S-i,x:i/2,y:i/2}),c.setTranslate(B,0,0),P.select(`rect`).attr({width:o._width-2*i,height:S-2*i,x:i,y:i}),c.setClipUrl(B,f,e),c.setRect(U,0,0,0,0),delete o._scrollY}else{var C=Math.max(p.scrollBarMinHeight,o._effHeight*o._effHeight/o._height),w=o._effHeight-C-2*p.scrollBarMargin,T=o._height-o._effHeight,E=w/T,O=Math.min(o._scrollY||0,T);z.attr({width:o._width-2*i+p.scrollBarWidth+p.scrollBarMargin,height:o._effHeight-i,x:i/2,y:i/2}),P.select(`rect`).attr({width:o._width-2*i+p.scrollBarWidth+p.scrollBarMargin,height:o._effHeight-2*i,x:i,y:i+O}),c.setClipUrl(B,f,e),K(O,C,E),N.on(`wheel`,function(){O=r.constrain(o._scrollY+n.event.deltaY/T*w,0,T),K(O,C,E),O!==0&&O!==T&&n.event.preventDefault()});var k,A,j,M=function(e,t,n){var i=(n-t)/E+e;return r.constrain(i,0,T)},F=function(e,t,n){var i=(t-n)/E+e;return r.constrain(i,0,T)},W=n.behavior.drag().on(`dragstart`,function(){var e=n.event.sourceEvent;k=e.type===`touchstart`?e.changedTouches[0].clientY:e.clientY,j=O}).on(`drag`,function(){var e=n.event.sourceEvent;e.buttons===2||e.ctrlKey||(A=e.type===`touchmove`?e.changedTouches[0].clientY:e.clientY,O=M(j,k,A),K(O,C,E))});U.call(W);var G=n.behavior.drag().on(`dragstart`,function(){var e=n.event.sourceEvent;e.type===`touchstart`&&(k=e.changedTouches[0].clientY,j=O)}).on(`drag`,function(){var e=n.event.sourceEvent;e.type===`touchmove`&&(A=e.changedTouches[0].clientY,O=F(j,k,A),K(O,C,E))});B.call(G)}function K(t,n,r){o._scrollY=e._fullLayout[d]._scrollY=t,c.setTranslate(B,0,-t),c.setRect(U,o._width,p.scrollBarMargin+t*r,p.scrollBarWidth,n),P.select(`rect`).attr(`y`,i+t)}if(e._context.edits.legendPosition){var q,J,Y,X;N.classed(`cursor-move`,!0),s.init({element:N.node(),gd:e,prepFn:function(e){if(e.target!==U.node()){var t=c.getTranslate(N);Y=t.x,X=t.y}},moveFn:function(e,n){if(Y!==void 0&&X!==void 0){var r=Y+e,i=X+n;c.setTranslate(N,r,i),q=s.align(r,o._width,t.l,t.l+t.w,o.xanchor),J=s.align(i+o._height,-o._height,t.t+t.h,t.t,o.yanchor)}},doneFn:function(){if(q!==void 0&&J!==void 0){var t={};t[d+`.x`]=q,t[d+`.y`]=J,a.call(`_guiRelayout`,e,t)}},clickFn:function(t,n){var r=m.selectAll(`g.traces`).filter(function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom});r.size()>0&&D(e,o,r,t,n)}})}}],e)}}function E(e,t,n){var r=e[0],i=r.width,a=t.entrywidthmode,o=r.trace.legendwidth||t.entrywidth;return a===`fraction`?t._maxWidth*o:n+(o||i)}function D(e,t,n,r,i){var s=e._fullLayout,c=n.data()[0][0].trace,l=t.itemclick,u=t.itemdoubleclick,f={event:i,node:n.node(),curveNumber:c.index,expandedIndex:c.index,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:s};c._group&&(f.group=c._group),a.traceIs(c,`pie-like`)&&(f.label=n.datum()[0].label);var p=o.triggerHandler(e,`plotly_legendclick`,f);if(r===1){if(p===!1)return;t._clickTimeout=setTimeout(function(){e._fullLayout&&l&&d(n,e,t,l)},e._context.doubleClickDelay)}else r===2&&(t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,o.triggerHandler(e,`plotly_legenddoubleclick`,f)!==!1&&p!==!1&&u&&d(n,e,t,u))}function O(e,t,n){var i=b.getId(n),o=e.data()[0][0],s=o.trace,l=a.traceIs(s,`pie-like`),d=!n._inHover&&t._context.edits.legendText&&!l,f=n._maxNameLength,m,h;o.groupTitle?(m=o.groupTitle.text,h=o.groupTitle.font):(h=n.font,n.entries?m=o.text:(m=l?o.label:s.name,s._meta&&(m=r.templateString(m,s._meta))));var g=r.ensureSingle(e,`text`,i+`text`);g.attr(`text-anchor`,`start`).call(c.font,h).text(d?k(m,f):m);var _=n.indentation+n.itemwidth+p.itemGap*2;u.positionText(g,_,0),d?g.call(u.makeEditable,{gd:t,text:m}).call(M,e,t,n).on(`edit`,function(r){this.text(k(r,f)).call(M,e,t,n);var i=o.trace._fullInput||{},c={};return c.name=r,i._isShape?a.call(`_guiRelayout`,t,`shapes[`+s.index+`].name`,c.name):a.call(`_guiRestyle`,t,c,s.index)}):M(g,e,t,n)}function k(e,t){var n=Math.max(4,t);if(e&&e.trim().length>=n/2)return e;e||=``;for(var r=n-e.length;r>0;r--)e+=` `;return e}function A(e,t,i){var a=t._context.doubleClickDelay,o,s=1,c=r.ensureSingle(e,`rect`,i+`toggle`,function(e){t._context.staticPlot||e.style(`cursor`,`pointer`).attr(`pointer-events`,`all`),e.call(l.fill,`rgba(0,0,0,0)`)});t._context.staticPlot||(c.on(`mousedown`,function(){o=new Date().getTime(),o-t._legendMouseDownTime<a?s+=1:(s=1,t._legendMouseDownTime=o)}),c.on(`mouseup`,function(){if(!(t._dragged||t._editing)){var r=t._fullLayout[i];new Date().getTime()-t._legendMouseDownTime>a&&(s=Math.max(s-1,1)),D(t,r,e,s,n.event)}}))}function j(e,t,i,s){if(t._fullData.some(function(e){let t=e.legend||`legend`;return(Array.isArray(t)?t.includes(s):t===s)&&a.traceIs(e,`pie-like`)}))return;let c=t._context.doubleClickDelay;var u,d=1;let p=r.ensureSingle(e,`rect`,s+`titletoggle`,function(e){t._context.staticPlot||e.style(`cursor`,`pointer`).attr(`pointer-events`,`all`),e.call(l.fill,`rgba(0,0,0,0)`)});t._context.staticPlot||(p.on(`mousedown`,function(){u=new Date().getTime(),u-t._legendMouseDownTime<c?d+=1:(d=1,t._legendMouseDownTime=u)}),p.on(`mouseup`,function(){if(t._dragged||t._editing)return;new Date().getTime()-t._legendMouseDownTime>c&&(d=Math.max(d-1,1));let e={event:n.event,legendId:s,data:t.data,layout:t.layout,fullData:t._fullData,fullLayout:t._fullLayout};if(d===1&&i.titleclick){if(o.triggerHandler(t,`plotly_legendtitleclick`,e)===!1)return;i._titleClickTimeout=setTimeout(function(){t._fullLayout&&f(t,i,i.titleclick)},c)}else d===2&&(i._titleClickTimeout&&clearTimeout(i._titleClickTimeout),t._legendMouseDownTime=0,o.triggerHandler(t,`plotly_legendtitledoubleclick`,e)!==!1&&i.titledoubleclick&&f(t,i,i.titledoubleclick))}))}function M(e,t,n,r,i){r._inHover&&e.attr(`data-notex`,!0),u.convertToTspans(e,n,function(){N(t,n,r,i)})}function N(e,t,n,r){var i=e.data()[0][0],a=i&&i.trace.showlegend;if(Array.isArray(a)&&(a=a[i.i]!==!1),!n._inHover&&i&&!a){e.remove();return}var o=e.select(`g[class*=math-group]`),s=o.node(),l=b.getId(n);n||=t._fullLayout[l];var d=n.borderwidth,f=(r===x?n.title.font:i.groupTitle?i.groupTitle.font:n.font).size*h,m,g;if(s){var _=c.bBox(s);m=_.height,g=_.width,r===x?c.setTranslate(o,d,d+m*.75):c.setTranslate(o,0,m*.25)}else{var v=`.`+l+(r===x?`title`:``)+`text`,y=e.select(v),S=u.lineCount(y),C=y.node();if(m=f*S,g=C?c.bBox(C).width:0,r===x)n.title.side===`left`&&(g+=p.itemGap*2),u.positionText(y,d+p.titlePad,d+f);else{var w=p.itemGap*2+n.indentation+n.itemwidth;i.groupTitle&&(w=p.itemGap,g-=n.indentation+n.itemwidth),u.positionText(y,w,-f*((S-1)/2-.3))}}r===x?(n._titleWidth=g,n._titleHeight=m):(i.lineHeight=f,i.height=Math.max(m,16)+3,i.width=g)}function P(e){var t=0,n=0,r=e.title.side;return r&&(r.indexOf(`left`)!==-1&&(t=e._titleWidth),r.indexOf(`top`)!==-1&&(n=e._titleHeight)),[t,n]}function F(e,t,r,i,a){var o=e._fullLayout,s=b.getId(i);i||=o[s];var l=o._size,u=b.isVertical(i),d=b.isGrouped(i),f=i.entrywidthmode===`fraction`,m=i.borderwidth,h=2*m,g=p.itemGap,_=i.indentation+i.itemwidth+g*2,v=2*(m+g),y=R(i),x=i.y<0||i.y===0&&y===`top`,S=i.y>1||i.y===1&&y===`bottom`,C=i.tracegroupgap,T={};let{orientation:D,yref:O}=i,{maxheight:k}=i,A=x||S||D!==`v`||O!==`paper`;k||=A?.5:1;let j=A?o.height:l.h;i._maxHeight=Math.max(k>1?k:k*j,30);var M=0;i._width=0,i._height=0;var N=P(i);if(u)r.each(function(e){var t=e[0].height;c.setTranslate(this,m+N[0],m+N[1]+i._height+t/2+g),i._height+=t,i._width=Math.max(i._width,e[0].width)}),M=_+i._width,i._width+=g+_+h,i._height+=v,d&&(t.each(function(e,t){c.setTranslate(this,0,t*i.tracegroupgap)}),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var F=L(i),I=i.x<0||i.x===0&&F===`right`,z=i.x>1||i.x===1&&F===`left`,B=S||x,V=o.width/2;i._maxWidth=Math.max(I?B&&F===`left`?l.l+l.w:V:z?B&&F===`right`?l.r+l.w:V:l.w,2*_);var H=0,U=0;r.each(function(e){var t=E(e,i,_);H=Math.max(H,t),U+=t}),M=null;var W=0;if(d){var G=0,K=0,q=0;t.each(function(){var e=0,t=0;n.select(this).selectAll(`g.traces`).each(function(n){var r=E(n,i,_),a=n[0].height;c.setTranslate(this,N[0],N[1]+m+g+a/2+t),t+=a,e=Math.max(e,r),T[n[0].trace.legendgroup]=e});var r=e+g;K>0&&r+m+K>i._maxWidth?(W=Math.max(W,K),K=0,q+=G+C,G=t):G=Math.max(G,t),c.setTranslate(this,K,q),K+=r}),i._width=Math.max(W,K)+m,i._height=q+G+v}else{var J=r.size(),Y=U+h+(J-1)*g<i._maxWidth,X=0,Z=0,Q=0,ee=0;r.each(function(e){var t=e[0].height,n=E(e,i,_,d),r=Y?n:H;f||(r+=g),r+m+Z-g>=i._maxWidth&&(W=Math.max(W,ee),Z=0,Q+=X,i._height+=X,X=0),c.setTranslate(this,N[0]+m+Z,N[1]+m+Q+t/2+g),ee=Z+n+g,Z+=r,X=Math.max(X,t)}),Y?(i._width=Z+h,i._height=X+v):(i._width=Math.max(W,ee)+h,i._height+=X+v)}}i._width=Math.ceil(Math.max(i._width+N[0],i._titleWidth+2*(m+p.titlePad))),i._height=Math.ceil(Math.max(i._height+N[1],i._titleHeight+2*(m+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var te=e._context.edits,ne=te.legendText||te.legendPosition;r.each(function(e){var t=n.select(this).select(`.`+s+`toggle`),r=e[0].height,a=e[0].trace.legendgroup,o=E(e,i,_);d&&a!==``&&(o=T[a]);var l=ne?_:M||o;!u&&!f&&(l+=g/2),c.setRect(t,0,-r/2,l,r)});var re=a.select(`.`+s+`titletext`);re.node()&&w(re,i,m);var ie=a.select(`.`+s+`titletoggle`);if(ie.size()&&re.node()){var ae=re.attr(`x`)||0,oe=p.titlePad;c.setRect(ie,ae-oe,m,i._titleWidth+2*oe,i._titleHeight+2*oe)}}function I(e,t,n,r){var a=e._fullLayout,o=a[t],s=L(o),c=R(o),l=o.xref===`paper`,u=o.yref===`paper`;e._fullLayout._reservedMargin[t]={};var d=o.y<.5?`b`:`t`,f=o.x<.5?`l`:`r`,p={r:a.width-n,l:n+o._width,b:a.height-r,t:r+o._effHeight};if(l&&u)return i.autoMargin(e,t,{x:o.x,y:o.y,l:o._width*g[s],r:o._width*_[s],b:o._effHeight*_[c],t:o._effHeight*g[c]});l?e._fullLayout._reservedMargin[t][d]=p[d]:u||o.orientation===`v`?e._fullLayout._reservedMargin[t][f]=p[f]:e._fullLayout._reservedMargin[t][d]=p[d]}function L(e){return r.isRightAnchor(e)?`right`:r.isCenterAnchor(e)?`center`:`left`}function R(e){return r.isBottomAnchor(e)?`bottom`:r.isMiddleAnchor(e)?`middle`:`top`}}),kn=h(e=>{var t=S(),n=D(),r=R(),i=$(),a=i.pushUnique,o=i.strTranslate,s=i.strRotate,c=ht(),l=kt(),u=_n(),d=tn(),f=q(),p=hn(),m=sn(),h=bt().zindexSeparator,g=Ke(),_=Qt(),v=V(),y=bn(),b=On(),x=v.YANGLE,C=Math.PI*x/180,w=1/Math.sin(C),T=Math.cos(C),E=Math.sin(C),O=v.HOVERARROWSIZE,k=v.HOVERTEXTPAD,A={box:!0,ohlc:!0,violin:!0,candlestick:!0},j={scatter:!0,scattergl:!0,splom:!0};function M(e,t){return e.distance-t.distance}e.hover=function(e,t,n,r){e=i.getGraphDiv(e);var a=t.target;i.throttle(e._fullLayout._uid+v.HOVERID,v.HOVERMINTIME,function(){N(e,t,n,r,a)})},e.loneHover=function(e,n){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var i=n.gd,a=Q(i),o=ee(i),s=e.map(function(e){var t=e._x0||e.x0||e.x||0,r=e._x1||e.x1||e.x||0,s=e._y0||e.y0||e.y||0,c=e._y1||e.y1||e.y||0,l=e.eventData;if(l){var u=Math.min(t,r),d=Math.max(t,r),p=Math.min(s,c),m=Math.max(s,c),h=e.trace;if(g.traceIs(h,`gl3d`)){var _=i._fullLayout[h.scene]._scene.container,v=_.offsetLeft,y=_.offsetTop;u+=v,d+=v,p+=y,m+=y}l.bbox={x0:u+o,x1:d+o,y0:p+a,y1:m+a},l.xPixel=(t+r)/2,l.yPixel=(s+c)/2,n.inOut_bbox&&n.inOut_bbox.push(l.bbox)}else l=!1;return{color:e.color||f.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontVariant:e.fontVariant,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:``},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:l}}),c=!1,l=I(s,{gd:i,hovermode:`closest`,rotateLabels:c,bgColor:n.bgColor||f.background,container:t.select(n.container),outerContainer:n.outerContainer||n.container}).hoverLabels,u=5,d=0,p=0;l.sort(function(e,t){return e.y0-t.y0}).each(function(e,t){var r=e.y0-e.by/2;r-u<d?e.offset=d-r+u:e.offset=0,d=r+e.by+e.offset,t===n.anchorIndex&&(p=e.offset)}).each(function(e){e.offset-=p});var m=i._fullLayout._invScaleX,h=i._fullLayout._invScaleY;return U(l,c,m,h),r?l:l.node()};function N(e,r,o,s,l){o||=`xy`,typeof o==`string`&&(o=o.split(h)[0]);var d=Array.isArray(o)?o:[o],v,y=e._fullLayout,b=y.hoversubplots,x=y._plots||[],S=x[o],C=y._has(`cartesian`),w=r.hovermode||y.hovermode,T=(w||``).charAt(0)===`x`,E=(w||``).charAt(0)===`y`,D,O;if(C&&(T||E)&&b===`axis`){for(var k=d.length,N=0;N<k;N++)if(v=d[N],x[v]){D=m.getFromId(e,v,`x`),O=m.getFromId(e,v,`y`);var F=(T?D:O)._subplotsWith;if(F&&F.length)for(var L=0;L<F.length;L++)a(d,F[L])}}if(S&&b!==`single`){var R=S.overlays.map(function(e){return e.id});d=d.concat(R)}for(var B=d.length,V=Array(B),H=Array(B),q=!1,Y=0;Y<B;Y++)if(v=d[Y],x[v])q=!0,V[Y]=x[v].xaxis,H[Y]=x[v].yaxis;else if(y[v]&&y[v]._subplot){var te=y[v]._subplot;V[Y]=te.xaxis,H[Y]=te.yaxis}else{i.warn(`Unrecognized subplot: `+v);return}if(w&&!q&&(w=`closest`),[`x`,`y`,`closest`,`x unified`,`y unified`].indexOf(w)===-1||!e.calcdata||e.querySelector(`.zoombox`)||e._dragging)return p.unhoverRaw(e,r);var ne=y.hoverdistance;ne===-1&&(ne=1/0);var re=y.spikedistance;re===-1&&(re=1/0);var ie=[],ae=[],oe,se,ce,le,ue,de,fe,pe,me,he,ge,_e,ve,ye={hLinePoint:null,vLinePoint:null},be=!1;if(Array.isArray(r))for(w=`array`,ce=0;ce<r.length;ce++)ue=e.calcdata[r[ce].curveNumber||0],ue&&(de=ue[0].trace,ue[0].trace.hoverinfo!==`skip`&&(ae.push(ue),de.orientation===`h`&&(be=!0)));else{var xe=e.calcdata.slice();for(xe.sort(function(e,t){return(e[0].trace.zorder||0)-(t[0].trace.zorder||0)}),le=0;le<xe.length;le++)ue=xe[le],de=ue[0].trace,de.hoverinfo!==`skip`&&_.isTraceInSubplots(de,d)&&(ae.push(ue),de.orientation===`h`&&(be=!0));var Se=!l,Ce,we;if(Se)Ce=`xpx`in r?r.xpx:V[0]._length/2,we=`ypx`in r?r.ypx:H[0]._length/2;else{if(c.triggerHandler(e,`plotly_beforehover`,r)===!1)return;var Te=l.getBoundingClientRect();Ce=r.clientX-Te.left,we=r.clientY-Te.top,y._calcInverseTransform(e);var Ee=i.apply3DTransform(y._invTransform)(Ce,we);if(Ce=Ee[0],we=Ee[1],Ce<0||Ce>V[0]._length||we<0||we>H[0]._length)return p.unhoverRaw(e,r)}if(r.pointerX=Ce+V[0]._offset,r.pointerY=we+H[0]._offset,oe=`xval`in r?_.flat(d,r.xval):_.p2c(V,Ce),se=`yval`in r?_.flat(d,r.yval):_.p2c(H,we),!n(oe[0])||!n(se[0]))return i.warn(`Fx.hover failed`,r,e),p.unhoverRaw(e,r)}y.clickanywhere&&(e._hoverXVals=oe,e._hoverYVals=se,e._hoverXAxes=V,e._hoverYAxes=H);var De=1/0;function Oe(t,a){for(le=0;le<ae.length;le++)if(ue=ae[le],!(!ue||!ue[0]||!ue[0].trace)&&(de=ue[0].trace,!(de.visible!==!0||de._length===0)&&[`carpet`,`contourcarpet`].indexOf(de._module.name)===-1)){if(me=w,_.isUnifiedHover(me)&&(me=me.charAt(0)),de.type===`splom`?(pe=0,fe=d[pe]):(fe=_.getSubplot(de),pe=d.indexOf(fe)),_e={cd:ue,trace:de,xa:V[pe],ya:H[pe],maxHoverDistance:ne,maxSpikeDistance:re,index:!1,distance:Math.min(De,ne),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:f.defaultLine,name:de.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},y[fe]&&(_e.subplot=y[fe]._subplot),y._splomScenes&&y._splomScenes[de.uid]&&(_e.scene=y._splomScenes[de.uid]),me===`array`){var o=r[le];`pointNumber`in o?(_e.index=o.pointNumber,me=`closest`):(me=``,`xval`in o&&(he=o.xval,me=`x`),`yval`in o&&(ge=o.yval,me=me?`closest`:`y`))}else t!==void 0&&a!==void 0?(he=t,ge=a):(he=oe[pe],ge=se[pe]);if(ve=ie.length,ne!==0)if(de._module&&de._module.hoverPoints){var s=de._module.hoverPoints(_e,he,ge,me,{finiteRange:!0,hoverLayer:y._hoverlayer,hoversubplots:b,gd:e});if(s)for(var c,l=0;l<s.length;l++)c=s[l],n(c.x0)&&n(c.y0)&&ie.push(W(c,w))}else i.log(`Unrecognized trace type in hover:`,de);if(w===`closest`&&ie.length>ve&&(ie.splice(0,ve),De=ie[0].distance),C&&re!==0&&ie.length===0){_e.distance=re,_e.index=!1;var u=de._module.hoverPoints(_e,he,ge,`closest`,{hoverLayer:y._hoverlayer});if(u&&=u.filter(function(e){return e.spikeDistance<=re}),u&&u.length){var p,m=u.filter(function(e){return e.xa.showspikes&&e.xa.spikesnap!==`hovered data`});if(m.length){var h=m[0];n(h.x0)&&n(h.y0)&&(p=Ae(h),(!ye.vLinePoint||ye.vLinePoint.spikeDistance>p.spikeDistance)&&(ye.vLinePoint=p))}var g=u.filter(function(e){return e.ya.showspikes&&e.ya.spikesnap!==`hovered data`});if(g.length){var v=g[0];n(v.x0)&&n(v.y0)&&(p=Ae(v),(!ye.hLinePoint||ye.hLinePoint.spikeDistance>p.spikeDistance)&&(ye.hLinePoint=p))}}}}}Oe();function ke(e,t,n){for(var r=null,i=1/0,a,o=0;o<e.length;o++)D&&D._id!==e[o].xa._id||O&&O._id!==e[o].ya._id||(a=e[o].spikeDistance,n&&o===0&&(a=-1/0),a<=i&&a<=t&&(r=e[o],i=a));return r}function Ae(e){return e?{xa:e.xa,ya:e.ya,x:e.xSpike===void 0?(e.x0+e.x1)/2:e.xSpike,y:e.ySpike===void 0?(e.y0+e.y1)/2:e.ySpike,distance:e.distance,spikeDistance:e.spikeDistance,curveNumber:e.trace.index,color:e.color,pointNumber:e.index}:null}var je={fullLayout:y,container:y._hoverlayer,event:r},Me=e._spikepoints;e._spikepoints={vLinePoint:ye.vLinePoint,hLinePoint:ye.hLinePoint};var Ne=function(){var e=ie.filter(function(e){return D&&D._id===e.xa._id&&O&&O._id===e.ya._id}),t=ie.filter(function(e){return!(D&&D._id===e.xa._id&&O&&O._id===e.ya._id)});e.sort(M),t.sort(M),ie=e.concat(t),ie=X(ie,w)};Ne();var Pe=w.charAt(0),Fe=(Pe===`x`||Pe===`y`)&&ie[0]&&j[ie[0].trace.type];if(C&&re!==0&&ie.length!==0&&(ye.hLinePoint=Ae(ke(ie.filter(function(e){return e.ya.showspikes}),re,Fe)),ye.vLinePoint=Ae(ke(ie.filter(function(e){return e.xa.showspikes}),re,Fe))),ie.length===0){var Ie=p.unhoverRaw(e,r);if(C&&(ye.hLinePoint!==null||ye.vLinePoint!==null)&&J(Me)&&G(e,ye,je),y.hoveranywhere&&!s&&l){var Le=e._hoverdata;Le&&Le.length&&(e.emit(`plotly_unhover`,{event:r,points:Le}),e._hoverdata=[]),$([])}return Ie}if(C&&J(Me)&&G(e,ye,je),_.isXYhover(me)&&ie[0].length!==0&&ie[0].trace.type!==`splom`){var Re=ie[0];ie=A[Re.trace.type]?ie.filter(e=>e.trace.index===Re.trace.index):[Re];var ze=ie.length;Oe(Z(`x`,Re,y),Z(`y`,Re,y));var Be=[],Ve={},He=0,Ue=function(e){var t=A[e.trace.type]?P(e):e.trace.index;if(!Ve[t])He++,Ve[t]=He,Be.push(e);else{var n=Ve[t]-1,r=Be[n];n>0&&Math.abs(e.distance)<Math.abs(r.distance)&&(Be[n]=e)}},We;for(We=0;We<ze;We++)Ue(ie[We]);for(We=ie.length-1;We>ze-1;We--)Ue(ie[We]);ie=Be,Ne()}var Ge=e._hoverdata,Ke=[],qe=Q(e),Je=ee(e);for(let e of ie){var Ye=_.makeEventData(e,e.trace,e.cd);if(e.hovertemplate!==!1){var Xe=!1;e.cd[e.index]&&e.cd[e.index].ht&&(Xe=e.cd[e.index].ht),e.hovertemplate=Xe||e.trace.hovertemplate||!1}if(e.xa&&e.ya){var Ze=e.x0+e.xa._offset,Qe=e.x1+e.xa._offset,$e=e.y0+e.ya._offset,et=e.y1+e.ya._offset,tt=Math.min(Ze,Qe),nt=Math.max(Ze,Qe),rt=Math.min($e,et),it=Math.max($e,et);Ye.bbox={x0:tt+Je,x1:nt+Je,y0:rt+qe,y1:it+qe},Ye.xPixel=(Ze+Qe)/2,Ye.yPixel=($e+et)/2}e.eventData=[Ye],Ke.push(Ye)}e._hoverdata=Ke;var at=w===`y`&&(ae.length>1||ie.length>1)||w===`closest`&&be&&ie.length>1,ot=f.combine(y.plot_bgcolor||f.background,y.paper_bgcolor),st=I(ie,{gd:e,hovermode:w,rotateLabels:at,bgColor:ot,container:y._hoverlayer,outerContainer:y._paper.node(),commonLabelOpts:y.hoverlabel,hoverdistance:y.hoverdistance}),ct=st.hoverLabels;if(_.isUnifiedHover(w)||(z(ct,at,y,st.commonLabelBoundingBox),U(ct,at,y._invScaleX,y._invScaleY)),l&&l.tagName){var lt=g.getComponentMethod(`annotations`,`hasClickToShow`)(e,Ke);u(t.select(l),lt?`pointer`:``)}var ut=K(e,r,Ge);if(!l||s||!ut&&!y.hoveranywhere)return;Ge&&ut&&e.emit(`plotly_unhover`,{event:r,points:Ge}),$(e._hoverdata);function $(t){e.emit(`plotly_hover`,{event:r,points:t,xaxes:V,yaxes:H,xvals:oe,yvals:se})}}function P(e){return[e.trace.index,e.index,e.x0,e.y0,e.name,e.attr,e.xa?e.xa._id:``,e.ya?e.ya._id:``].join(`,`)}var F=/<extra>([\s\S]*)<\/extra>/;function I(e,n){var r=n.gd,a=r._fullLayout,c=n.hovermode,u=n.rotateLabels,p=n.bgColor,m=n.container,h=n.outerContainer,S=n.commonLabelOpts||{};if(e.length===0)return[[]];var C=n.fontFamily||v.HOVERFONT,w=n.fontSize||v.HOVERFONTSIZE,T=n.fontWeight||a.font.weight,E=n.fontStyle||a.font.style,D=n.fontVariant||a.font.variant,A=n.fontTextcase||a.font.textcase,j=n.fontLineposition||a.font.lineposition,M=n.fontShadow||a.font.shadow,N=e[0],F=N.xa,I=N.ya,R=c.charAt(0),z=R+`Label`,B=N[z];if(B===void 0&&F.type===`multicategory`)for(var V=0;V<e.length&&(B=e[V][z],B===void 0);V++);var H=te(r,h),U=H.top,W=H.width,G=H.height,K=B!==void 0&&N.distance<=n.hoverdistance&&(c===`x`||c===`y`);if(K){var q=!0,J,Y;for(J=0;J<e.length;J++)if(q&&e[J].zLabel===void 0&&(q=!1),Y=e[J].hoverinfo||e[J].trace.hoverinfo,Y){var X=Array.isArray(Y)?Y:Y.split(`+`);if(X.indexOf(`all`)===-1&&X.indexOf(c)===-1){K=!1;break}}q&&(K=!1)}var Z=m.selectAll(`g.axistext`).data(K?[0]:[]);Z.enter().append(`g`).classed(`axistext`,!0),Z.exit().remove();var Q={minX:0,maxX:0,minY:0,maxY:0};if(Z.each(function(){var e=t.select(this),n=i.ensureSingle(e,`path`,``,function(e){e.style({"stroke-width":`1px`})}),s=i.ensureSingle(e,`text`,``,function(e){e.attr(`data-notex`,1)}),u=S.bgcolor||f.defaultLine,p=S.bordercolor||f.contrast(u),m=f.contrast(u),h=S.font,g={weight:h.weight||T,style:h.style||E,variant:h.variant||D,textcase:h.textcase||A,lineposition:h.lineposition||j,shadow:h.shadow||M,family:h.family||C,size:h.size||w,color:h.color||m};n.style({fill:u,stroke:p}),s.text(B).call(d.font,g).call(l.positionText,0,0).call(l.convertToTspans,r),e.attr(`transform`,``);var _=te(r,s.node()),v,y;if(c===`x`){var b=F.side===`top`?`-`:``;s.attr(`text-anchor`,`middle`).call(l.positionText,0,F.side===`top`?U-_.bottom-O-k:U-_.top+O+k),v=F._offset+(N.x0+N.x1)/2,y=I._offset+(F.side===`top`?0:I._length);var x=_.width/2+k,P=v;v<x?P=x:v>a.width-x&&(P=a.width-x),n.attr(`d`,`M`+(v-P)+`,0L`+(v-P+O)+`,`+b+O+`H`+x+`v`+b+(k*2+_.height)+`H`+-x+`V`+b+O+`H`+(v-P-O)+`Z`),v=P,Q.minX=v-x,Q.maxX=v+x,F.side===`top`?(Q.minY=y-(k*2+_.height),Q.maxY=y-k):(Q.minY=y+k,Q.maxY=y+(k*2+_.height))}else{var L,R,z;I.side===`right`?(L=`start`,R=1,z=``,v=F._offset+F._length):(L=`end`,R=-1,z=`-`,v=F._offset),y=I._offset+(N.y0+N.y1)/2,s.attr(`text-anchor`,L),n.attr(`d`,`M0,0L`+z+O+`,`+O+`V`+(k+_.height/2)+`h`+z+(k*2+_.width)+`V-`+(k+_.height/2)+`H`+z+O+`V-`+O+`Z`),Q.minY=y-(k+_.height/2),Q.maxY=y+(k+_.height/2),I.side===`right`?(Q.minX=v+O,Q.maxX=v+O+(k*2+_.width)):(Q.minX=v-O-(k*2+_.width),Q.maxX=v-O);var V=_.height/2,H=U-_.top-V,W=`clip`+a._uid+`commonlabel`+I._id,G;if(v<_.width+2*k+O){G=`M-`+(O+k)+`-`+V+`h-`+(_.width-k)+`V`+V+`h`+(_.width-k)+`Z`;var K=_.width-v+k;l.positionText(s,K,H),L===`end`&&s.selectAll(`tspan`).each(function(){var e=t.select(this),n=d.tester.append(`text`).text(e.text()).call(d.font,g),i=te(r,n.node());Math.round(i.width)<Math.round(_.width)&&e.attr(`x`,K-i.width),n.remove()})}else l.positionText(s,R*(k+O),H),G=null;var q=a._topclips.selectAll(`#`+W).data(G?[0]:[]);q.enter().append(`clipPath`).attr(`id`,W).append(`path`),q.exit().remove(),q.select(`path`).attr(`d`,G),d.setClipUrl(s,G?W:null,r)}e.attr(`transform`,o(v,y))}),_.isUnifiedHover(c)){m.selectAll(`g.hovertext`).remove();let t=e.filter(e=>e.hoverinfo!==`none`);if(t.length===0)return[];var ee=a.hoverlabel,ne=ee.font,re=t[0],ie=((c===`x unified`?re.xa:re.ya).unifiedhovertitle||{}).text,ae={showlegend:!0,legend:{title:{text:ie?i.hovertemplateString({data:c===`x unified`?[{xa:re.xa,x:re.xVal}]:[{ya:re.ya,y:re.yVal}],fallback:re.trace.hovertemplatefallback,locale:a._d3locale,template:ie}):B,font:ne},font:ne,bgcolor:ee.bgcolor,bordercolor:ee.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:a.legend?a.legend.traceorder:void 0,orientation:`v`}},oe={font:ne};y(ae,oe,r._fullData);var se=oe.legend;se.entries=[];for(var ce=0;ce<t.length;ce++){var le=t[ce];if(le.hoverinfo!==`none`){var ue=L(le,!0,c,a,B),de=ue[0],fe=ue[1];le.name=fe,fe===``?le.text=de:le.text=fe+` : `+de;var pe=le.cd[le.index];pe&&(pe.mc&&(le.mc=pe.mc),pe.mcc&&(le.mc=pe.mcc),pe.mlc&&(le.mlc=pe.mlc),pe.mlcc&&(le.mlc=pe.mlcc),pe.mlw&&(le.mlw=pe.mlw),pe.mrc&&(le.mrc=pe.mrc),pe.dir&&(le.dir=pe.dir)),le._distinct=!0,se.entries.push([le])}}se.entries.sort(function(e,t){return e[0].trace.index-t[0].trace.index}),se.layer=m,se._inHover=!0,se._groupTitleFont=ee.grouptitlefont,b(r,se);var me=m.select(`g.legend`),he=te(r,me.node()),ge=he.width+2*k,_e=he.height+2*k,ve=t[0],ye=(ve.x0+ve.x1)/2,be=(ve.y0+ve.y1)/2,xe=!(g.traceIs(ve.trace,`bar-like`)||g.traceIs(ve.trace,`box-violin`)),Se,Ce;R===`y`?xe?(Ce=be-k,Se=be+k):(Ce=Math.min.apply(null,t.map(function(e){return Math.min(e.y0,e.y1)})),Se=Math.max.apply(null,t.map(function(e){return Math.max(e.y0,e.y1)}))):Ce=Se=i.mean(t.map(function(e){return(e.y0+e.y1)/2}))-_e/2;var we,Te;R===`x`?xe?(we=ye+k,Te=ye-k):(we=Math.max.apply(null,t.map(function(e){return Math.max(e.x0,e.x1)})),Te=Math.min.apply(null,t.map(function(e){return Math.min(e.x0,e.x1)}))):we=Te=i.mean(t.map(function(e){return(e.x0+e.x1)/2}))-ge/2;var Ee=F._offset,De=I._offset;Se+=De,we+=Ee,Te+=Ee-ge,Ce+=De-_e;var Oe,ke;return Oe=we+ge<W&&we>=0?we:Te+ge<W&&Te>=0?Te:Ee+ge<W?Ee:we-ye<ye-Te+ge?W-ge:0,Oe+=k,ke=Se+_e<G&&Se>=0?Se:Ce+_e<G&&Ce>=0?Ce:De+_e<G?De:Se-be<be-Ce+_e?G-_e:0,ke+=k,me.attr(`transform`,o(Oe-1,ke-1)),me}var Ae=m.selectAll(`g.hovertext`).data(e,function(e){return P(e)});return Ae.enter().append(`g`).classed(`hovertext`,!0).each(function(){var e=t.select(this);e.append(`rect`).call(f.fill,f.addOpacity(p,.8)),e.append(`text`).classed(`name`,!0),e.append(`path`).style(`stroke-width`,`1px`),e.append(`text`).classed(`nums`,!0).call(d.font,{weight:T,style:E,variant:D,textcase:A,lineposition:j,shadow:M,family:C,size:w})}),Ae.exit().remove(),Ae.each(function(e){var n=t.select(this).attr(`transform`,``),i=e.color;Array.isArray(i)&&(i=i[e.eventData[0].pointNumber]);var m=e.bgcolor||i,h=f.combine(f.opacity(m)?m:f.defaultLine,p),g=f.combine(f.opacity(i)?i:f.defaultLine,p),_=e.borderColor||f.contrast(h),v=L(e,K,c,a,B,n),y=v[0],b=v[1],S=n.select(`text.nums`).call(d.font,{family:e.fontFamily||C,size:e.fontSize||w,color:e.fontColor||_,weight:e.fontWeight||T,style:e.fontStyle||E,variant:e.fontVariant||D,textcase:e.fontTextcase||A,lineposition:e.fontLineposition||j,shadow:e.fontShadow||M}).text(y).attr(`data-notex`,1).call(l.positionText,0,0).call(l.convertToTspans,r),N=n.select(`text.name`),P=0,F=0;if(b&&b!==y){N.call(d.font,{family:e.fontFamily||C,size:e.fontSize||w,color:g,weight:e.fontWeight||T,style:e.fontStyle||E,variant:e.fontVariant||D,textcase:e.fontTextcase||A,lineposition:e.fontLineposition||j,shadow:e.fontShadow||M}).text(b).attr(`data-notex`,1).call(l.positionText,0,0).call(l.convertToTspans,r);var I=te(r,N.node());P=I.width+2*k,F=I.height+2*k}else N.remove(),n.select(`rect`).remove();n.select(`path`).style({fill:h,stroke:_});var R=e.xa._offset+(e.x0+e.x1)/2,z=e.ya._offset+(e.y0+e.y1)/2,V=Math.abs(e.x1-e.x0),H=Math.abs(e.y1-e.y0),q=te(r,S.node()),J=q.width/a._invScaleX,Y=q.height/a._invScaleY;e.ty0=(U-q.top)/a._invScaleY,e.bx=J+2*k,e.by=Math.max(Y+2*k,F),e.anchor=`start`,e.txwidth=J,e.tx2width=P,e.offset=0;var X=(J+O+k+P)*a._invScaleX,Z,Q;if(u)e.pos=R,Z=z+H/2+X<=G,Q=z-H/2-X>=0,(e.idealAlign===`top`||!Z)&&Q?(z-=H/2,e.anchor=`end`):Z?(z+=H/2,e.anchor=`start`):e.anchor=`middle`,e.crossPos=z;else{if(e.pos=z,Z=R+V/2+X<=W,Q=R-V/2-X>=0,(e.idealAlign===`left`||!Z)&&Q)R-=V/2,e.anchor=`end`;else if(Z)R+=V/2,e.anchor=`start`;else{e.anchor=`middle`;var ee=X/2,ne=R+ee-W,re=R-ee;ne>0&&(R-=ne),re<0&&(R+=-re)}e.crossPos=R}S.attr(`text-anchor`,e.anchor),P&&N.attr(`text-anchor`,e.anchor),n.attr(`transform`,o(R,z)+(u?s(x):``))}),{hoverLabels:Ae,commonLabelBoundingBox:Q}}function L(e,t,n,r,a,o){var s,c=``,l=``;e.nameOverride!==void 0&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=i.templateString(e.name,e.trace._meta)),c=Y(e.name,e.nameLength));var u=n.charAt(0),d=u===`x`?`y`:`x`;e.zLabel===void 0?t&&e[u+`Label`]===a?l=e[d+`Label`]||``:e.xLabel===void 0?e.yLabel!==void 0&&e.trace.type!==`scattercarpet`&&(l=e.yLabel):l=e.yLabel===void 0?e.xLabel:`(`+e.xLabel+`, `+e.yLabel+`)`:(e.xLabel!==void 0&&(l+=`x: `+e.xLabel+`<br>`),e.yLabel!==void 0&&(l+=`y: `+e.yLabel+`<br>`),e.trace.type!==`choropleth`&&e.trace.type!==`choroplethmapbox`&&e.trace.type!==`choroplethmap`&&(l+=(l?`z: `:``)+e.zLabel)),(e.text||e.text===0)&&!Array.isArray(e.text)&&(l+=(l?`<br>`:``)+e.text),e.extraText!==void 0&&(l+=(l?`<br>`:``)+e.extraText),o&&l===``&&!e.hovertemplate&&(c===``&&o.remove(),l=c),(s=e.trace?.hoverlabel)!=null&&s.split&&(e.hovertemplate=``);let{hovertemplate:f=!1}=e;if(f){let t=e.hovertemplateLabels||e;e[u+`Label`]!==a&&(t[u+`other`]=t[u+`Val`],t[u+`otherLabel`]=t[u+`Label`]),l=i.hovertemplateString({data:[e.eventData[0]||{},e.trace._meta],fallback:e.trace.hovertemplatefallback,labels:t,locale:r._d3locale,template:f}),l=l.replace(F,(t,n)=>(c=Y(n,e.nameLength),``))}return[l,c]}function z(e,t,n,r){var i=t?`xa`:`ya`,a=t?`ya`:`xa`,o=0,s=1,c=e.size(),l=Array(c),u=0,d=r.minX,f=r.maxX,p=r.minY,m=r.maxY,h=function(e){return e*n._invScaleX},g=function(e){return e*n._invScaleY};e.each(function(e){var r=e[i],o=e[a],c=r._id.charAt(0)===`x`,_=r.range;u===0&&_&&_[0]>_[1]!==c&&(s=-1);var v=0,y=c?n.width:n.height;if(n.hovermode===`x`||n.hovermode===`y`){var b=B(e,t),x=e.anchor,S=x===`end`?-1:1,C,T;if(x===`middle`)C=e.crossPos+(c?g(b.y-e.by/2):h(e.bx/2+e.tx2width/2)),T=C+(c?g(e.by):h(e.bx));else if(c)C=e.crossPos+g(O+b.y)-g(e.by/2-O),T=C+g(e.by);else{var E=h(S*O+b.x),D=E+h(S*e.bx);C=e.crossPos+Math.min(E,D),T=e.crossPos+Math.max(E,D)}c?p!==void 0&&m!==void 0&&Math.min(T,m)-Math.max(C,p)>1&&(o.side===`left`?(v=o._mainLinePosition,y=n.width):y=o._mainLinePosition):d!==void 0&&f!==void 0&&Math.min(T,f)-Math.max(C,d)>1&&(o.side===`top`?(v=o._mainLinePosition,y=n.height):y=o._mainLinePosition)}l[u++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(c?w:1)/2,pmin:v,pmax:y}]}),l.sort(function(e,t){return e[0].posref-t[0].posref||s*(t[0].traceIndex-e[0].traceIndex)});var _,v,y,b,x,S,C;function T(e){var t=e[0],n=e[e.length-1];if(v=t.pmin-t.pos-t.dp+t.size,y=n.pos+n.dp+n.size-t.pmax,v>.01){for(x=e.length-1;x>=0;x--)e[x].dp+=v;_=!1}if(!(y<.01)){if(v<-.01){for(x=e.length-1;x>=0;x--)e[x].dp-=y;_=!1}if(_){var r=0;for(b=0;b<e.length;b++)S=e[b],S.pos+S.dp+S.size>t.pmax&&r++;for(b=e.length-1;b>=0&&!(r<=0);b--)S=e[b],S.pos>t.pmax-1&&(S.del=!0,r--);for(b=0;b<e.length&&!(r<=0);b++)if(S=e[b],S.pos<t.pmin+1)for(S.del=!0,r--,y=S.size*2,x=e.length-1;x>=0;x--)e[x].dp-=y;for(b=e.length-1;b>=0&&!(r<=0);b--)S=e[b],S.pos+S.dp+S.size>t.pmax&&(S.del=!0,r--)}}}for(;!_&&o<=c;){for(o++,_=!0,b=0;b<l.length-1;){var E=l[b],D=l[b+1],k=E[E.length-1],A=D[0];if(v=k.pos+k.dp+k.size-A.pos-A.dp+A.size,v>.01){for(x=D.length-1;x>=0;x--)D[x].dp+=v;for(E.push.apply(E,D),l.splice(b+1,1),C=0,x=E.length-1;x>=0;x--)C+=E[x].dp;for(y=C/E.length,x=E.length-1;x>=0;x--)E[x].dp-=y;_=!1}else b++}l.forEach(T)}for(b=l.length-1;b>=0;b--){var j=l[b];for(x=j.length-1;x>=0;x--){var M=j[x],N=M.datum;N.offset=M.dp,N.del=M.del}}}function B(e,t){var n=0,r=e.offset;return t&&(r*=-E,n=e.offset*T),{x:n,y:r}}function H(e){var t={start:1,end:-1,middle:0}[e.anchor],n=t*(O+k),r=n+t*(e.txwidth+k);return e.anchor===`middle`&&(n-=e.tx2width/2,r+=e.txwidth/2+k),{alignShift:t,textShiftX:n,text2ShiftX:r}}function U(e,n,r,i){var a=function(e){return e*r},o=function(e){return e*i};e.each(function(e){var r=t.select(this);if(e.del)return r.remove();var i=r.select(`text.nums`),s=e.anchor,c=s===`end`?-1:1,u=H(e),f=B(e,n),p=f.x,m=f.y,h=s===`middle`,g=`hoverlabel`in e.trace?e.trace.hoverlabel.showarrow:!0,_=h?`M-`+a(e.bx/2+e.tx2width/2)+`,`+o(m-e.by/2)+`h`+a(e.bx)+`v`+o(e.by)+`h-`+a(e.bx)+`Z`:g?`M0,0L`+a(c*O+p)+`,`+o(O+m)+`v`+o(e.by/2-O)+`h`+a(c*e.bx)+`v-`+o(e.by)+`H`+a(c*O+p)+`V`+o(m-O)+`Z`:`M`+a(c*O+p)+`,`+o(m-e.by/2)+`h`+a(c*e.bx)+`v`+o(e.by)+`h`+a(-c*e.bx)+`Z`;r.select(`path`).attr(`d`,_);var v=p+u.textShiftX,y=m+e.ty0-e.by/2+k,b=e.textAlign||`auto`;b!==`auto`&&(b===`left`&&s!==`start`?(i.attr(`text-anchor`,`start`),v=h?-e.bx/2-e.tx2width/2+k:-e.bx-k):b===`right`&&s!==`end`&&(i.attr(`text-anchor`,`end`),v=h?e.bx/2-e.tx2width/2-k:e.bx+k)),i.call(l.positionText,a(v),o(y)),e.tx2width&&(r.select(`text.name`).call(l.positionText,a(u.text2ShiftX+u.alignShift*k+p),o(m+e.ty0-e.by/2+k)),r.select(`rect`).call(d.setRect,a(u.text2ShiftX+(u.alignShift-1)*e.tx2width/2+p),o(m-e.by/2-1),a(e.tx2width),o(e.by+2)))})}function W(e,t){var r=e.index,a=e.trace||{},o=e.cd[0],s=e.cd[r]||{};function c(e){return e||n(e)&&e===0}var l=Array.isArray(r)?function(e,t){var n=i.castOption(o,r,e);return c(n)?n:i.extractOption({},a,``,t)}:function(e,t){return i.extractOption(s,a,e,t)};function u(t,n,r){var i=l(n,r);c(i)&&(e[t]=i)}if(u(`hoverinfo`,`hi`,`hoverinfo`),u(`bgcolor`,`hbg`,`hoverlabel.bgcolor`),u(`borderColor`,`hbc`,`hoverlabel.bordercolor`),u(`fontFamily`,`htf`,`hoverlabel.font.family`),u(`fontSize`,`hts`,`hoverlabel.font.size`),u(`fontColor`,`htc`,`hoverlabel.font.color`),u(`fontWeight`,`htw`,`hoverlabel.font.weight`),u(`fontStyle`,`hty`,`hoverlabel.font.style`),u(`fontVariant`,`htv`,`hoverlabel.font.variant`),u(`nameLength`,`hnl`,`hoverlabel.namelength`),u(`textAlign`,`hta`,`hoverlabel.align`),e.posref=t===`y`||t===`closest`&&a.orientation===`h`?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=i.constrain(e.x0,0,e.xa._length),e.x1=i.constrain(e.x1,0,e.xa._length),e.y0=i.constrain(e.y0,0,e.ya._length),e.y1=i.constrain(e.y1,0,e.ya._length),e.xLabelVal!==void 0&&(e.xLabel=`xLabel`in e?e.xLabel:m.hoverLabelText(e.xa,e.xLabelVal,a.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),e.yLabelVal!==void 0&&(e.yLabel=`yLabel`in e?e.yLabel:m.hoverLabelText(e.ya,e.yLabelVal,a.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),e.zLabelVal!==void 0&&e.zLabel===void 0&&(e.zLabel=String(e.zLabelVal)),!isNaN(e.xerr)&&!(e.xa.type===`log`&&e.xerr<=0)){var d=m.tickText(e.xa,e.xa.c2l(e.xerr),`hover`).text;e.xerrneg===void 0?e.xLabel+=` ± `+d:e.xLabel+=` +`+d+` / -`+m.tickText(e.xa,e.xa.c2l(e.xerrneg),`hover`).text,t===`x`&&(e.distance+=1)}if(!isNaN(e.yerr)&&!(e.ya.type===`log`&&e.yerr<=0)){var f=m.tickText(e.ya,e.ya.c2l(e.yerr),`hover`).text;e.yerrneg===void 0?e.yLabel+=` ± `+f:e.yLabel+=` +`+f+` / -`+m.tickText(e.ya,e.ya.c2l(e.yerrneg),`hover`).text,t===`y`&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&p!==`all`&&(p=Array.isArray(p)?p:p.split(`+`),p.indexOf(`x`)===-1&&(e.xLabel=void 0),p.indexOf(`y`)===-1&&(e.yLabel=void 0),p.indexOf(`z`)===-1&&(e.zLabel=void 0),p.indexOf(`text`)===-1&&(e.text=void 0),p.indexOf(`name`)===-1&&(e.name=void 0)),e}function G(e,t,n){var i=n.container,a=n.fullLayout,o=a._size,s=n.event,c=!!t.hLinePoint,l=!!t.vLinePoint,u,p;if(i.selectAll(`.spikeline`).remove(),l||c){var h=f.combine(a.plot_bgcolor,a.paper_bgcolor);if(c){var g=t.hLinePoint,_,v;u=g&&g.xa,p=g&&g.ya,p.spikesnap===`cursor`?(_=s.pointerX,v=s.pointerY):(_=u._offset+g.x,v=p._offset+g.y);var y=r.readability(g.color,h)<1.5?f.contrast(h):g.color,b=p.spikemode,x=p.spikethickness,S=p.spikecolor||y,C=m.getPxPosition(e,p),w,T;if(b.indexOf(`toaxis`)!==-1||b.indexOf(`across`)!==-1){if(b.indexOf(`toaxis`)!==-1&&(w=C,T=_),b.indexOf(`across`)!==-1){var E=p._counterDomainMin,D=p._counterDomainMax;p.anchor===`free`&&(E=Math.min(E,p.position),D=Math.max(D,p.position)),w=o.l+E*o.w,T=o.l+D*o.w}i.insert(`line`,`:first-child`).attr({x1:w,x2:T,y1:v,y2:v,"stroke-width":x,stroke:S,"stroke-dasharray":d.dashStyle(p.spikedash,x)}).classed(`spikeline`,!0).classed(`crisp`,!0),i.insert(`line`,`:first-child`).attr({x1:w,x2:T,y1:v,y2:v,"stroke-width":x+2,stroke:h}).classed(`spikeline`,!0).classed(`crisp`,!0)}b.indexOf(`marker`)!==-1&&i.insert(`circle`,`:first-child`).attr({cx:C+(p.side===`right`?-x:x),cy:v,r:x,fill:S}).classed(`spikeline`,!0)}if(l){var O=t.vLinePoint,k,A;u=O&&O.xa,p=O&&O.ya,u.spikesnap===`cursor`?(k=s.pointerX,A=s.pointerY):(k=u._offset+O.x,A=p._offset+O.y);var j=r.readability(O.color,h)<1.5?f.contrast(h):O.color,M=u.spikemode,N=u.spikethickness,P=u.spikecolor||j,F=m.getPxPosition(e,u),I,L;if(M.indexOf(`toaxis`)!==-1||M.indexOf(`across`)!==-1){if(M.indexOf(`toaxis`)!==-1&&(I=F,L=A),M.indexOf(`across`)!==-1){var R=u._counterDomainMin,z=u._counterDomainMax;u.anchor===`free`&&(R=Math.min(R,u.position),z=Math.max(z,u.position)),I=o.t+(1-z)*o.h,L=o.t+(1-R)*o.h}i.insert(`line`,`:first-child`).attr({x1:k,x2:k,y1:I,y2:L,"stroke-width":N,stroke:P,"stroke-dasharray":d.dashStyle(u.spikedash,N)}).classed(`spikeline`,!0).classed(`crisp`,!0),i.insert(`line`,`:first-child`).attr({x1:k,x2:k,y1:I,y2:L,"stroke-width":N+2,stroke:h}).classed(`spikeline`,!0).classed(`crisp`,!0)}M.indexOf(`marker`)!==-1&&i.insert(`circle`,`:first-child`).attr({cx:k,cy:F-(u.side===`top`?-N:N),r:N,fill:P}).classed(`spikeline`,!0)}}}function K(e,t,n){if(!n||n.length!==e._hoverdata.length)return!0;for(var r=n.length-1;r>=0;r--){var i=n[r],a=e._hoverdata[r];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers)||i.binNumber!==a.binNumber)return!0}return!1}function J(e,t){return!t||t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint}function Y(e,t){return l.plainText(e||``,{len:t,allowedTags:[`br`,`sub`,`sup`,`b`,`i`,`em`,`s`,`u`]})}function X(e,t){for(var n=t.charAt(0),r=[],i=[],a=[],o=0;o<e.length;o++){var s=e[o];g.traceIs(s.trace,`bar-like`)||g.traceIs(s.trace,`box-violin`)?a.push(s):s.trace[n+`period`]?i.push(s):r.push(s)}return r.concat(i).concat(a)}function Z(e,t,n){var r=t[e+`a`],i=t[e+`Val`],a=t.cd[0];if(r.type===`category`||r.type===`multicategory`)i=r._categoriesMap[i];else if(r.type===`date`){var o=t.trace[e+`periodalignment`];if(o){var s=t.cd[t.index],c=s[e+`Start`];c===void 0&&(c=s[e]);var l=s[e+`End`];l===void 0&&(l=s[e]);var u=l-c;o===`end`?i+=u:o===`middle`&&(i+=u/2)}i=r.d2c(i)}return a&&a.t&&a.t.posLetter===r._id&&(n.boxmode===`group`||n.violinmode===`group`)&&(i+=a.t.dPos),i}var Q=e=>e.offsetTop+e.clientTop,ee=e=>e.offsetLeft+e.clientLeft;function te(e,t){var n=e._fullLayout,r=t.getBoundingClientRect(),a=r.left,o=r.top,s=a+r.width,c=o+r.height,l=i.apply3DTransform(n._invTransform)(a,o),u=i.apply3DTransform(n._invTransform)(s,c),d=l[0],f=l[1],p=u[0],m=u[1];return{x:d,y:f,width:p-d,height:m-f,top:Math.min(f,m),left:Math.min(d,p),right:Math.max(d,p),bottom:Math.max(f,m)}}}),An=h((e,t)=>{var n=$(),r=q(),i=Qt().isUnifiedHover;t.exports=function(e,t,a,o){o||={};var s=t.legend;function c(e){o.font[e]||(o.font[e]=s?t.legend.font[e]:t.font[e])}t&&i(t.hovermode)&&(o.font||={},c(`size`),c(`family`),c(`color`),c(`weight`),c(`style`),c(`variant`),s?(o.bgcolor||=r.combine(t.legend.bgcolor,t.paper_bgcolor),o.bordercolor||=t.legend.bordercolor):o.bgcolor||=t.paper_bgcolor),a(`hoverlabel.bgcolor`,o.bgcolor),a(`hoverlabel.bordercolor`,o.bordercolor),a(`hoverlabel.namelength`,o.namelength),a(`hoverlabel.showarrow`,o.showarrow),n.coerceFont(a,`hoverlabel.font`,o.font),a(`hoverlabel.align`,o.align)}}),jn=h((e,t)=>{var n=$(),r=An(),i=H();t.exports=function(e,t){function a(r,a){return n.coerce(e,t,i,r,a)}r(e,t,a)}}),Mn=h((e,t)=>{var n=$(),r=U(),i=An();t.exports=function(e,t,a,o){function s(i,a){return n.coerce(e,t,r,i,a)}var c=n.extendFlat({},o.hoverlabel);t.hovertemplate&&(c.namelength=-1),i(e,t,s,c)}}),Nn=h((e,t)=>{var n=$(),r=H();t.exports=function(e,t){function i(i,a){return t[i]===void 0?n.coerce(e,t,r,i,a):t[i]}return i(`clickmode`),i(`hoversubplots`),i(`hoveranywhere`),i(`clickanywhere`),i(`hovermode`)}}),Pn=h((e,t)=>{var n=$(),r=H(),i=Nn(),a=An();t.exports=function(e,t){function o(i,a){return n.coerce(e,t,r,i,a)}i(e,t)&&(o(`hoverdistance`),o(`spikedistance`)),o(`dragmode`)===`select`&&o(`selectdirection`);var s=t._has(`mapbox`),c=t._has(`map`),l=t._has(`geo`),u=t._basePlotModules.length;t.dragmode===`zoom`&&((s||c||l)&&u===1||(s||c)&&l&&u===2)&&(t.dragmode=`pan`),a(e,t,o),n.coerceFont(o,`hoverlabel.grouptitlefont`,t.hoverlabel.font)}}),Fn=h((e,t)=>{var n=$(),r=Ke();t.exports=function(e){var t=e.calcdata,a=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},a)}}for(var s=0;s<t.length;s++){var c=t[s],l=c[0].trace;if(!r.traceIs(l,`pie-like`)){var u=r.traceIs(l,`2dMap`)?i:n.fillArray;u(l.hoverinfo,c,`hi`,o(l)),l.hovertemplate&&u(l.hovertemplate,c,`ht`),l.hoverlabel&&(u(l.hoverlabel.bgcolor,c,`hbg`),u(l.hoverlabel.bordercolor,c,`hbc`),u(l.hoverlabel.font.size,c,`hts`),u(l.hoverlabel.font.color,c,`htc`),u(l.hoverlabel.font.family,c,`htf`),u(l.hoverlabel.font.weight,c,`htw`),u(l.hoverlabel.font.style,c,`hty`),u(l.hoverlabel.font.variant,c,`htv`),u(l.hoverlabel.namelength,c,`hnl`),u(l.hoverlabel.align,c,`hta`),u(l.hoverlabel.showarrow,c,`htsa`))}}};function i(e,t,r,i){i||=n.identity,Array.isArray(e)&&(t[0][r]=i(e))}}),In=h((e,t)=>{var n=Ke(),r=kn().hover;t.exports=function(e,t,i){var a=n.getComponentMethod(`annotations`,`onClick`)(e,e._hoverdata),o=e._fullLayout;i!==void 0&&r(e,t,i,!0);function s(){var n={points:e._hoverdata,event:t};n.xaxes??=e._hoverXAxes,n.yaxes??=e._hoverYAxes,n.xvals??=e._hoverXVals,n.yvals??=e._hoverYVals,e.emit(`plotly_click`,n)}(e._hoverdata||o.clickanywhere)&&t&&t.target&&(e._hoverdata||=[],a&&a.then?a.then(s):s(),t.stopImmediatePropagation&&t.stopImmediatePropagation())}}),Ln=h((e,t)=>{var n=S(),r=$(),i=hn(),a=Qt(),o=H(),s=kn();t.exports={moduleType:`component`,name:`fx`,constants:V(),schema:{layout:o},attributes:U(),layoutAttributes:o,supplyLayoutGlobalDefaults:jn(),supplyDefaults:Mn(),supplyLayoutDefaults:Pn(),calc:Fn(),getDistanceFunction:a.getDistanceFunction,getClosest:a.getClosest,inbox:a.inbox,quadrature:a.quadrature,appendArrayPointValue:a.appendArrayPointValue,castHoverOption:l,castHoverinfo:u,hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:c,click:In()};function c(e){var t=r.isD3Selection(e)?e:n.select(e);t.selectAll(`g.hovertext`).remove(),t.selectAll(`.spikeline`).remove()}function l(e,t,n){return r.castOption(e,t,`hoverlabel.`+n)}function u(e,t,n){function i(n){return r.coerceHoverinfo({hoverinfo:n},{_module:e._module},t)}return r.castOption(e,n,`hoverinfo`,i)}}),Rn=h(e=>{e.selectMode=function(e){return e===`lasso`||e===`select`},e.drawMode=function(e){return e===`drawclosedpath`||e===`drawopenpath`||e===`drawline`||e===`drawrect`||e===`drawcircle`},e.openMode=function(e){return e===`drawline`||e===`drawopenpath`},e.rectMode=function(e){return e===`select`||e===`drawline`||e===`drawrect`||e===`drawcircle`},e.freeMode=function(e){return e===`lasso`||e===`drawclosedpath`||e===`drawopenpath`},e.selectingOrDrawing=function(t){return e.freeMode(t)||e.rectMode(t)}}),zn=h((e,t)=>{t.exports=function(e){var t=e._fullLayout;t._glcanvas&&t._glcanvas.size()&&t._glcanvas.each(function(e){e.regl&&e.regl.clear({color:!0,depth:!0})})}}),Bn=h((e,t)=>{t.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(``)}}}),Vn=h((e,t)=>{var n=32;t.exports={CIRCLE_SIDES:n,i000:0,i090:n/4,i180:n/2,i270:n/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}),Hn=h((e,t)=>{var n=$().strTranslate;function r(e,t){switch(e.type){case`log`:return e.p2d(t);case`date`:return e.p2r(t,0,e.calendar);default:return e.p2r(t)}}function i(e,t){switch(e.type){case`log`:return e.d2p(t);case`date`:return e.r2p(t,0,e.calendar);default:return e.r2p(t)}}function a(e){var t=e._id.charAt(0)===`y`?1:0;return function(n){return r(e,n[t])}}function o(e){return n(e.xaxis._offset,e.yaxis._offset)}t.exports={p2r:r,r2p:i,axValue:a,getTransform:o}}),Un=h(e=>{var t=$t(),n=Vn(),r=n.CIRCLE_SIDES,i=n.SQRT2,a=Hn(),o=a.p2r,s=a.r2p,c=[0,3,4,5,6,1,2],l=[0,3,4,1,2];e.writePaths=function(e){var t=e.length;if(!t)return`M0,0Z`;for(var n=``,r=0;r<t;r++)for(var i=e[r].length,a=0;a<i;a++){var o=e[r][a][0];if(o===`Z`)n+=`Z`;else for(var s=e[r][a].length,u=0;u<s;u++){var d=u;o===`Q`||o===`S`?d=l[u]:o===`C`&&(d=c[u]),n+=e[r][a][d],u>0&&u<s-1&&(n+=`,`)}}return n},e.readPaths=function(e,n,i,a){var c=t(e),l=[],u=-1,d=function(){u++,l[u]=[]},f,p=0,m=0,h,g,_=function(){h=p,g=m};_();for(var v=0;v<c.length;v++){var y=[],b,x,S,C,w=c[v][0],T=w;switch(w){case`M`:d(),p=+c[v][1],m=+c[v][2],y.push([T,p,m]),_();break;case`Q`:case`S`:b=+c[v][1],S=+c[v][2],p=+c[v][3],m=+c[v][4],y.push([T,p,m,b,S]);break;case`C`:b=+c[v][1],S=+c[v][2],x=+c[v][3],C=+c[v][4],p=+c[v][5],m=+c[v][6],y.push([T,p,m,b,S,x,C]);break;case`T`:case`L`:p=+c[v][1],m=+c[v][2],y.push([T,p,m]);break;case`H`:T=`L`,p=+c[v][1],y.push([T,p,m]);break;case`V`:T=`L`,m=+c[v][1],y.push([T,p,m]);break;case`A`:T=`L`;var E=+c[v][1],D=+c[v][2];+c[v][4]||(E=-E,D=-D);var O=p-E,k=m;for(f=1;f<=r/2;f++){var A=2*Math.PI*f/r;y.push([T,O+E*Math.cos(A),k+D*Math.sin(A)])}break;case`Z`:(p!==h||m!==g)&&(p=h,m=g,y.push([T,p,m]));break}for(var j=(i||{}).domain,M=n._fullLayout._size,N=i&&i.xsizemode===`pixel`,P=i&&i.ysizemode===`pixel`,F=a===!1,I=0;I<y.length;I++){for(f=0;f+2<7;f+=2){var L=y[I][f+1],R=y[I][f+2];L===void 0||R===void 0||(p=L,m=R,i&&(i.xaxis&&i.xaxis.p2r?(F&&(L-=i.xaxis._offset),L=N?s(i.xaxis,i.xanchor)+L:o(i.xaxis,L)):(F&&(L-=M.l),j?L=j.x[0]+L/M.w:L/=M.w),i.yaxis&&i.yaxis.p2r?(F&&(R-=i.yaxis._offset),R=P?s(i.yaxis,i.yanchor)-R:o(i.yaxis,R)):(F&&(R-=M.t),R=j?j.y[1]-R/M.h:1-R/M.h)),y[I][f+1]=L,y[I][f+2]=R)}l[u].push(y[I].slice())}}return l};function u(e,t){return Math.abs(e-t)<=1e-6}function d(e,t){var n=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+r*r)}e.pointsOnRectangle=function(e){if(e.length!==5)return!1;for(var t=1;t<3;t++)if(!u(e[0][t]-e[1][t],e[3][t]-e[2][t])||!u(e[0][t]-e[3][t],e[1][t]-e[2][t]))return!1;return!u(e[0][1],e[1][1])&&!u(e[0][1],e[3][1])?!1:!!(d(e[0],e[1])*d(e[0],e[3]))},e.pointsOnEllipse=function(e){var t=e.length;if(t!==r+1)return!1;t=r;for(var n=0;n<t;n++){var i=(t*2-n)%t,a=(t/2+i)%t,o=(t/2+n)%t;if(!u(d(e[n],e[o]),d(e[i],e[a])))return!1}return!0},e.handleEllipse=function(t,n,a){if(!t)return[n,a];var o=e.ellipseOver({x0:n[0],y0:n[1],x1:a[0],y1:a[1]}),s=(o.x1+o.x0)/2,c=(o.y1+o.y0)/2,l=(o.x1-o.x0)/2,u=(o.y1-o.y0)/2;l||=u/=i,u||=l/=i;for(var d=[],f=0;f<r;f++){var p=f*2*Math.PI/r;d.push([s+l*Math.cos(p),c+u*Math.sin(p)])}return d},e.ellipseOver=function(e){var t=e.x0,n=e.y0,r=e.x1,a=e.y1,o=r-t,s=a-n;t-=o,n-=s;var c=(t+r)/2,l=(n+a)/2,u=i;return o*=u,s*=u,{x0:c-o,y0:l-s,x1:c+o,y1:l+s}},e.fixDatesForPaths=function(e,t,n){var r=t.type===`date`,i=n.type===`date`;if(!r&&!i)return e;for(var a=0;a<e.length;a++)for(var o=0;o<e[a].length;o++)for(var s=0;s+2<e[a][o].length;s+=2)r&&(e[a][o][s+1]=e[a][o][s+1].replace(` `,`_`)),i&&(e[a][o][s+2]=e[a][o][s+2].replace(` `,`_`));return e}}),Wn=h((e,t)=>{var n=xt(),r=Rn(),i=r.drawMode,a=r.openMode,o=Vn(),s=o.i000,c=o.i090,l=o.i180,u=o.i270,d=o.cos45,f=o.sin45,p=Hn(),m=p.p2r,h=p.r2p,g=St().clearOutline,_=Un(),v=_.readPaths,y=_.writePaths,b=_.ellipseOver,x=_.fixDatesForPaths;function S(e,t){if(e.length&&e[0][0]){var r=t.gd,a=t.isActiveShape,o=t.dragmode,s=(r.layout||{}).shapes||[];if(!i(o)&&a!==void 0){var c=r._fullLayout._activeShapeIndex;if(c<s.length)switch(r._fullLayout.shapes[c].type){case`rect`:o=`drawrect`;break;case`circle`:o=`drawcircle`;break;case`line`:o=`drawline`;break;case`path`:var l=s[c].path||``;o=l[l.length-1]===`Z`?`drawclosedpath`:`drawopenpath`;break}}var u=C(e,t,o);g(r);for(var d=t.editHelpers,f=(d||{}).modifyItem,p=[],m=0;m<s.length;m++){var h=r._fullLayout.shapes[m];if(p[m]=h._input,a!==void 0&&m===r._fullLayout._activeShapeIndex){var _=u;switch(h.type){case`line`:case`rect`:case`circle`:var v=n.getFromId(r,h.xref);h.xref.charAt(0)===`x`&&v.type.includes(`category`)?(f(`x0`,_.x0-(h.x0shift||0)),f(`x1`,_.x1-(h.x1shift||0))):(f(`x0`,_.x0),f(`x1`,_.x1));var y=n.getFromId(r,h.yref);h.yref.charAt(0)===`y`&&y.type.includes(`category`)?(f(`y0`,_.y0-(h.y0shift||0)),f(`y1`,_.y1-(h.y1shift||0))):(f(`y0`,_.y0),f(`y1`,_.y1));break;case`path`:f(`path`,_.path);break}}}return a===void 0?(p.push(u),p):d?d.getUpdateObj():{}}}function C(e,t,n){var r=e[0][0],i=t.gd,o=r.getAttribute(`d`),p=i._fullLayout.newshape,g=t.plotinfo,_=t.isActiveShape,S=g.xaxis,C=g.yaxis,w=!!g.domain||!g.xaxis,T=!!g.domain||!g.yaxis,E=a(n),D=v(o,i,g,_),O={editable:!0,visible:p.visible,name:p.name,showlegend:p.showlegend,legend:p.legend,legendwidth:p.legendwidth,legendgroup:p.legendgroup,legendgrouptitle:{text:p.legendgrouptitle.text,font:p.legendgrouptitle.font},legendrank:p.legendrank,label:p.label,xref:w?`paper`:S._id,yref:T?`paper`:C._id,layer:p.layer,opacity:p.opacity,line:{color:p.line.color,width:p.line.width,dash:p.line.dash}};E||(O.fillcolor=p.fillcolor,O.fillrule=p.fillrule);var k;if(D.length===1&&(k=D[0]),k&&k.length===5&&n===`drawrect`)O.type=`rect`,O.x0=k[0][1],O.y0=k[0][2],O.x1=k[2][1],O.y1=k[2][2];else if(k&&n===`drawline`)O.type=`line`,O.x0=k[0][1],O.y0=k[0][2],O.x1=k[1][1],O.y1=k[1][2];else if(k&&n===`drawcircle`){O.type=`circle`;var A=k[s][1],j=k[c][1],M=k[l][1],N=k[u][1],P=k[s][2],F=k[c][2],I=k[l][2],L=k[u][2],R=g.xaxis&&(g.xaxis.type===`date`||g.xaxis.type===`log`),z=g.yaxis&&(g.yaxis.type===`date`||g.yaxis.type===`log`);R&&(A=h(g.xaxis,A),j=h(g.xaxis,j),M=h(g.xaxis,M),N=h(g.xaxis,N)),z&&(P=h(g.yaxis,P),F=h(g.yaxis,F),I=h(g.yaxis,I),L=h(g.yaxis,L));var B=(j+N)/2,V=(P+I)/2,H=(N-j+M-A)/2,U=(L-F+I-P)/2,W=b({x0:B,y0:V,x1:B+H*d,y1:V+U*f});R&&(W.x0=m(g.xaxis,W.x0),W.x1=m(g.xaxis,W.x1)),z&&(W.y0=m(g.yaxis,W.y0),W.y1=m(g.yaxis,W.y1)),O.x0=W.x0,O.y0=W.y0,O.x1=W.x1,O.y1=W.y1}else O.type=`path`,S&&C&&x(D,S,C),O.path=y(D),k=null;return O}t.exports={newShapes:S,createShapeObj:C}}),Gn=h((e,t)=>{var n=Rn().selectMode,r=St().clearOutline,i=Un(),a=i.readPaths,o=i.writePaths,s=i.fixDatesForPaths;t.exports=function(e,t){if(e.length){var i=e[0][0];if(i){var c=i.getAttribute(`d`),l=t.gd,u=l._fullLayout.newselection,d=t.plotinfo,f=d.xaxis,p=d.yaxis,m=t.isActiveSelection,h=t.dragmode,g=(l.layout||{}).selections||[];if(!n(h)&&m!==void 0){var _=l._fullLayout._activeSelectionIndex;if(_<g.length)switch(l._fullLayout.selections[_].type){case`rect`:h=`select`;break;case`path`:h=`lasso`;break}}var v=a(c,l,d,m),y={xref:f._id,yref:p._id,opacity:u.opacity,line:{color:u.line.color,width:u.line.width,dash:u.line.dash}},b;v.length===1&&(b=v[0]),b&&b.length===5&&h===`select`?(y.type=`rect`,y.x0=b[0][1],y.y0=b[0][2],y.x1=b[2][1],y.y1=b[2][2]):(y.type=`path`,f&&p&&s(v,f,p),y.path=o(v),b=null),r(l);for(var x=t.editHelpers,S=(x||{}).modifyItem,C=[],w=0;w<g.length;w++){var T=l._fullLayout.selections[w];if(!T){C[w]=T;continue}if(C[w]=T._input,m!==void 0&&w===l._fullLayout._activeSelectionIndex){var E=y;switch(T.type){case`rect`:S(`x0`,E.x0),S(`x1`,E.x1),S(`y0`,E.y0),S(`y1`,E.y1);break;case`path`:S(`path`,E.path);break}}}return m===void 0?(C.push(y),C):x?x.getUpdateObj():{}}}}}),Kn=h((e,t)=>{t.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:3},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}}),qn=h(e=>{var t=Kn(),n=$(),r=sn();e.rangeToShapePosition=function(e){return e.type===`log`?e.r2d:function(e){return e}},e.shapePositionToRange=function(e){return e.type===`log`?e.d2r:function(e){return e}},e.decodeDate=function(e){return function(t){return t.replace&&(t=t.replace(`_`,` `)),e(t)}},e.encodeDate=function(e){return function(t){return e(t).replace(` `,`_`)}},e.extractPathCoords=function(e,r,i){var a=[];return e.match(t.segmentRE).forEach(function(e){var o=r[e.charAt(0)].drawn;if(o!==void 0){var s=e.slice(1).match(t.paramRE);if(!(!s||s.length<o)){var c=s[o],l=i?c:n.cleanNumber(c);a.push(l)}}}),a},e.countDefiningCoords=function(e,n,r){if(e!==`path`)return 2;if(!n)return 0;let i=n.match(t.segmentRE);if(!i)return 0;let a=r===`x`?t.paramIsX:t.paramIsY;return i.reduce((e,t)=>e+(a[t.charAt(0)].drawn===void 0?0:1),0)},e.getDataToPixel=function(t,n,r,i,o){var s=t._fullLayout._size,c;if(n)if(o===`domain`)c=function(e){return n._length*(i?1-e:e)+n._offset};else{var l=e.shapePositionToRange(n);c=function(e){var t=a(n,r);return n._offset+n.r2p(l(e,!0))+t},n.type===`date`&&(c=e.decodeDate(c))}else c=i?function(e){return s.t+s.h*(1-e)}:function(e){return s.l+s.w*e};return c},e.getPixelToData=function(t,n,r,i){var a=t._fullLayout._size,o;if(n)if(i===`domain`)o=function(e){var t=(e-n._offset)/n._length;return r?1-t:t};else{var s=e.rangeToShapePosition(n);o=function(e){return s(n.p2r(e-n._offset))}}else o=r?function(e){return 1-(e-a.t)/a.h}:function(e){return(e-a.l)/a.w};return o},e.roundPositionForSharpStrokeRendering=function(e,t){var n=Math.round(t%2)===1,r=Math.round(e);return n?r+.5:r},e.makeShapesOptionsAndPlotinfo=function(e,t){var n=e._fullLayout.shapes[t]||{},r=e._fullLayout._plots[n.xref+n.yref];return r?r._hadPlotinfo=!0:(r={},n.xref&&n.xref!==`paper`&&(r.xaxis=e._fullLayout[n.xref+`axis`]),n.yref&&n.yref!==`paper`&&(r.yaxis=e._fullLayout[n.yref+`axis`])),r.xsizemode=n.xsizemode,r.ysizemode=n.ysizemode,r.xanchor=n.xanchor,r.yanchor=n.yanchor,{options:n,plotinfo:r}},e.makeSelectionsOptionsAndPlotinfo=function(e,t){var n=e._fullLayout.selections[t]||{},r=e._fullLayout._plots[n.xref+n.yref];return r?r._hadPlotinfo=!0:(r={},n.xref&&(r.xaxis=e._fullLayout[n.xref+`axis`]),n.yref&&(r.yaxis=e._fullLayout[n.yref+`axis`])),{options:n,plotinfo:r}},e.getPathString=function(t,n){let o=n.type,s=r.getRefType(n.xref),c=r.getRefType(n.yref),l=t._fullLayout._size;var u,d,f,p,m,h,g,_,v,y,b,x;function S(t,n,r,i){var a;if(t)if(n===`domain`)a=i?function(e){return t._offset+t._length*(1-e)}:function(e){return t._offset+t._length*e};else{let n=e.shapePositionToRange(t);a=function(e){return t._offset+t.r2p(n(e,!0))},r===`path`&&t.type===`date`&&(a=e.decodeDate(a))}else a=i?function(e){return l.t+l.h*(1-e)}:function(e){return l.l+l.w*e};return a}if(s===`array`?(g=[],u=n.xref.map(function(e){return r.getFromId(t,e)}),g=n.xref.map(function(e,t){return S(u[t],r.getRefType(e),o,!1)})):(u=r.getFromId(t,n.xref),g=S(u,s,o,!1)),c===`array`?(_=[],d=n.yref.map(function(e){return r.getFromId(t,e)}),_=n.yref.map(function(e,t){return S(d[t],r.getRefType(e),o,!0)})):(d=r.getFromId(t,n.yref),_=S(d,c,o,!0)),o===`path`)return i(n,g,_);if(s===`array`)f=a(u[0],n.x0shift),p=a(u[1],n.x1shift),v=g[0](n.x0)+f,y=g[1](n.x1)+p;else if(f=a(u,n.x0shift),p=a(u,n.x1shift),n.xsizemode===`pixel`){let e=g(n.xanchor);v=e+n.x0+f,y=e+n.x1+p}else v=g(n.x0)+f,y=g(n.x1)+p;if(c===`array`)m=a(d[0],n.y0shift),h=a(d[1],n.y1shift),b=_[0](n.y0)+m,x=_[1](n.y1)+h;else if(m=a(d,n.y0shift),h=a(d,n.y1shift),n.ysizemode===`pixel`){let e=_(n.yanchor);b=e-n.y0+m,x=e-n.y1+h}else b=_(n.y0)+m,x=_(n.y1)+h;if(o===`line`)return`M`+v+`,`+b+`L`+y+`,`+x;if(o===`rect`)return`M`+v+`,`+b+`H`+y+`V`+x+`H`+v+`Z`;var C=(v+y)/2,w=(b+x)/2,T=Math.abs(C-v),E=Math.abs(w-b),D=`A`+T+`,`+E,O=C+T+`,`+w,k=C+`,`+(w-E);return`M`+O+D+` 0 1,1 `+k+D+` 0 0,1 `+O+`Z`};function i(e,r,i){let a=e.path,o=e.xsizemode,s=e.ysizemode,c=e.xanchor,l=e.yanchor,u=Array.isArray(e.xref),d=Array.isArray(e.yref);var f=0,p=0;return a.replace(t.segmentRE,function(e){var a=0,m=e.charAt(0),h=t.paramIsX[m],g=t.paramIsY[m],_=t.numParams[m];let v=h.drawn!==void 0,y=g.drawn!==void 0,b=u?r[f]:r,x=d?i[p]:i;var S=e.slice(1).replace(t.paramRE,function(e){return h[a]?e=o===`pixel`?b(c)+Number(e):b(e):g[a]&&(e=s===`pixel`?x(l)-Number(e):x(e)),a++,a>_&&(e=`X`),e});return a>_&&(S=S.replace(/[\s,]*X.*/,``),n.log(`Ignoring extra params in segment `+e)),v&&f++,y&&p++,m+S})}function a(e,t){t||=0;var n=0;return t&&e&&(e.type===`category`||e.type===`multicategory`)&&(n=(e.r2p(1)-e.r2p(0))*t),n}}),Jn=h((e,t)=>{var n=$(),r=sn(),i=kt(),a=tn(),o=Un().readPaths,s=qn(),c=s.getPathString,l=Be(),u=Ot().FROM_TL;t.exports=function(e,t,u,p){if(p.selectAll(`.shape-label`).remove(),u.label.text||u.label.texttemplate){var m;if(u.label.texttemplate){var h={};if(u.type!==`path`){var g=r.getFromId(e,u.xref),_=r.getFromId(e,u.yref);let t=Array.isArray(u.xref),n=Array.isArray(u.yref);for(var v in l){var y=typeof l[v]==`function`,b=!t||l.simpleXVariables.includes(v),x=!n||l.simpleYVariables.includes(v);if(y&&b&&x){var S=l[v](u,g,_);S!==void 0&&(h[v]=S)}}}m=n.texttemplateStringForShapes({data:[h],fallback:u.label.texttemplatefallback,locale:e._fullLayout._d3locale,template:u.label.texttemplate})}else m=u.label.text;var C={"data-index":t},w=u.label.font,T=p.append(`g`).attr(C).classed(`shape-label`,!0).append(`text`).attr({"data-notex":1}).classed(`shape-label-text`,!0).text(m),E,D,O,k;if(u.path){var A=o(c(e,u),e);E=1/0,O=1/0,D=-1/0,k=-1/0;for(var j=0;j<A.length;j++)for(var M=0;M<A[j].length;M++)for(var N=A[j][M],P=1;P<N.length;P+=2){var F=N[P],I=N[P+1];E=Math.min(E,F),D=Math.max(D,F),O=Math.min(O,I),k=Math.max(k,I)}}else{let t=Array.isArray(u.xref),n=Array.isArray(u.yref),i=r.getFromId(e,t?u.xref[0]:u.xref),a=r.getFromId(e,t?u.xref[1]:u.xref),o=r.getFromId(e,n?u.yref[0]:u.yref),c=r.getFromId(e,n?u.yref[1]:u.yref),l=r.getRefType(t?u.xref[0]:u.xref),d=r.getRefType(t?u.xref[1]:u.xref),f=r.getRefType(n?u.yref[0]:u.yref),p=r.getRefType(n?u.yref[1]:u.yref),m=function(t,n,r,i){return s.getDataToPixel(e,r,n,!1,i)(t)},h=function(t,n,r,i){return s.getDataToPixel(e,r,n,!0,i)(t)};E=m(u.x0,u.x0shift,i,l),D=m(u.x1,u.x1shift,a,d),O=h(u.y0,u.y0shift,o,f),k=h(u.y1,u.y1shift,c,p)}var L=u.label.textangle;L===`auto`&&(L=u.type===`line`?d(E,O,D,k):0),T.call(function(t){return t.call(a.font,w).attr({}),i.convertToTspans(t,e),t});var R=a.bBox(T.node()),z=f(E,O,D,k,u,L,R),B=z.textx,V=z.texty,H=z.xanchor;T.attr({"text-anchor":{left:`start`,center:`middle`,right:`end`}[H],y:V,x:B,transform:`rotate(`+L+`,`+B+`,`+V+`)`}).call(i.positionText,B,V)}};function d(e,t,n,r){var i,a;return a=Math.abs(n-e),i=n>=e?t-r:r-t,-180/Math.PI*Math.atan2(i,a)}function f(e,t,n,r,i,a,o){var s=i.label.textposition,c=i.label.textangle,l=i.label.padding,d=i.type,f=Math.PI/180*a,p=Math.sin(f),m=Math.cos(f),h=i.label.xanchor,g=i.label.yanchor,_,v,y,b;if(d===`line`){s===`start`?(_=e,v=t):s===`end`?(_=n,v=r):(_=(e+n)/2,v=(t+r)/2),h===`auto`&&(h=s===`start`?c===`auto`?n>e?`left`:n<e?`right`:`center`:n>e?`right`:n<e?`left`:`center`:s===`end`?c===`auto`?n>e?`right`:n<e?`left`:`center`:n>e?`left`:n<e?`right`:`center`:`center`);var x={left:1,center:0,right:-1},S={bottom:-1,middle:0,top:1};if(c===`auto`){var C=S[g];y=-l*p*C,b=l*m*C}else{var w=x[h],T=S[g];y=l*w,b=l*T}_+=y,v+=b}else y=l+3,s.indexOf(`right`)===-1?s.indexOf(`left`)===-1?(_=(e+n)/2,h===`auto`&&(h=`center`)):(_=Math.min(e,n)+y,h===`auto`&&(h=`left`)):(_=Math.max(e,n)-y,h===`auto`&&(h=`right`)),v=s.indexOf(`top`)===-1?s.indexOf(`bottom`)===-1?(t+r)/2:Math.max(t,r):Math.min(t,r),b=l,g===`bottom`?v-=b:g===`top`&&(v+=b);var E=u[g],D=i.label.font.size,O=o.height,k=(O*E-D)*p,A=-(O*E-D)*m;return{textx:_+k,texty:v+A,xanchor:h}}}),Yn=h((e,t)=>{var n=$().strTranslate,r=hn(),i=Rn(),a=i.drawMode,o=i.selectMode,s=Ke(),c=q(),l=Vn(),u=l.i000,d=l.i090,f=l.i180,p=l.i270,m=St().clearOutlineControllers,h=Un(),g=h.pointsOnRectangle,_=h.pointsOnEllipse,v=h.writePaths,y=Wn().newShapes,b=Wn().createShapeObj,x=Gn(),S=Jn();t.exports=function e(t,i,l,h){h||=0;var E=l.gd;function D(){e(t,i,l,h++),(_(t[0])||l.hasText)&&O({redrawing:!0})}function O(e){var t={};l.isActiveShape!==void 0&&(l.isActiveShape=!1,t=y(i,l)),l.isActiveSelection!==void 0&&(l.isActiveSelection=!1,t=x(i,l),E._fullLayout._reselect=!0),Object.keys(t).length&&s.call((e||{}).redrawing?`relayout`:`_guiRelayout`,E,t)}var k=E._fullLayout._zoomlayer,A=l.dragmode,j=a(A),M=o(A);(j||M)&&(E._fullLayout._outlining=!0),m(E),i.attr(`d`,v(t));var N,P,F,I,L;if(!h&&(l.isActiveShape||l.isActiveSelection)&&(L=C([],t),W(k.append(`g`).attr(`class`,`outline-controllers`)),X()),j&&l.hasText){var R=k.select(`.label-temp`);S(E,`label-temp`,b(i,l,l.dragmode),R)}function z(e){F=+e.srcElement.getAttribute(`data-i`),I=+e.srcElement.getAttribute(`data-j`),N[F][I].moveFn=B}function B(e,n){if(t.length){var r=L[F][I][1],i=L[F][I][2],a=t[F],o=a.length;if(g(a)){var s=e,c=n;l.isActiveSelection&&(w(a,I)[1]===a[I][1]?c=0:s=0);for(var u=0;u<o;u++)if(u!==I){var d=a[u];d[1]===a[I][1]&&(d[1]=r+s),d[2]===a[I][2]&&(d[2]=i+c)}if(a[I][1]=r+s,a[I][2]=i+c,!g(a))for(var f=0;f<o;f++)for(var p=0;p<a[f].length;p++)a[f][p]=L[F][f][p]}else a[I][1]=r+e,a[I][2]=i+n;D()}}function V(){O()}function H(){if(t.length&&t[F]&&t[F].length){for(var e=[],n=0;n<t[F].length;n++)n!==I&&e.push(t[F][n]);e.length>1&&!(e.length===2&&e[1][0]===`Z`)&&(I===0&&(e[0][0]=`M`),t[F]=e,D(),O())}}function U(e,n){if(e===2){F=+n.srcElement.getAttribute(`data-i`),I=+n.srcElement.getAttribute(`data-j`);var r=t[F];!g(r)&&!_(r)&&H()}}function W(e){N=[];for(var i=0;i<t.length;i++){var a=t[i],o=g(a),s=!o&&_(a);N[i]=[];for(var m=a.length,h=0;h<m;h++)if(a[h][0]!==`Z`&&!(s&&h!==u&&h!==d&&h!==f&&h!==p)){var v=o&&l.isActiveSelection,y;v&&(y=w(a,h));var b=a[h][1],x=a[h][2],S=e.append(v?`rect`:`circle`).attr(`data-i`,i).attr(`data-j`,h).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,"shape-rendering":`crispEdges`});if(v){var C=y[1]-b,T=y[2]-x,D=T?5:Math.max(Math.min(25,Math.abs(C)-5),5),O=C?5:Math.max(Math.min(25,Math.abs(T)-5),5);S.classed(T?`cursor-ew-resize`:`cursor-ns-resize`,!0).attr(`width`,D).attr(`height`,O).attr(`x`,b-D/2).attr(`y`,x-O/2).attr(`transform`,n(C/2,T/2))}else S.classed(`cursor-grab`,!0).attr(`r`,5).attr(`cx`,b).attr(`cy`,x);N[i][h]={element:S.node(),gd:E,prepFn:z,doneFn:V,clickFn:U},r.init(N[i][h])}}}function G(e,n){if(t.length)for(var r=0;r<t.length;r++)for(var i=0;i<t[r].length;i++)for(var a=0;a+2<t[r][i].length;a+=2)t[r][i][a+1]=L[r][i][a+1]+e,t[r][i][a+2]=L[r][i][a+2]+n}function K(e,t){G(e,t),D()}function q(e){F=+e.srcElement.getAttribute(`data-i`),F||=0,P[F].moveFn=K}function J(){O()}function Y(e){e===2&&T(E)}function X(){if(P=[],t.length){var e=0;P[e]={element:i[0][0],gd:E,prepFn:q,doneFn:J,clickFn:Y},r.init(P[e])}}};function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];e[n]=[];for(var i=0;i<r.length;i++){e[n][i]=[];for(var a=0;a<r[i].length;a++)e[n][i][a]=r[i][a]}}return e}function w(e,t){var n=e[t][1],r=e[t][2],i=e.length,a,o,s;return a=(t+1)%i,o=e[a][1],s=e[a][2],o===n&&s===r&&(a=(t+2)%i,o=e[a][1],s=e[a][2]),[a,o,s]}function T(e){if(o(e._fullLayout.dragmode)){m(e);var t=e._fullLayout._activeSelectionIndex,n=(e.layout||{}).selections||[];if(t<n.length){for(var r=[],i=0;i<n.length;i++)i!==t&&r.push(n[i]);delete e._fullLayout._activeSelectionIndex;var a=e._fullLayout.selections[t];e._fullLayout._deselect={xref:a.xref,yref:a.yref},s.call(`_guiRelayout`,e,{selections:r})}}}}),Xn=h((e,t)=>{var n=S(),r=Ke(),i=$(),a=sn(),o=Un().readPaths,s=Yn(),c=Jn(),l=St().clearOutlineControllers,u=q(),d=tn(),f=yt().arrayEditor,p=hn(),m=gn(),h=Kn(),g=qn(),_=g.getPathString;t.exports={draw:v,drawOne:x,eraseActiveShape:k,drawLabel:c};function v(e){var t=e._fullLayout;for(var n in t._shapeUpperLayer.selectAll(`path`).remove(),t._shapeLowerLayer.selectAll(`path`).remove(),t._shapeUpperLayer.selectAll(`text`).remove(),t._shapeLowerLayer.selectAll(`text`).remove(),t._plots){var r=t._plots[n].shapelayer;r&&(r.selectAll(`path`).remove(),r.selectAll(`text`).remove())}for(var i=0;i<t.shapes.length;i++)t.shapes[i].visible===!0&&x(e,i)}function y(e){return!!e._fullLayout._outlining}function b(e){return!e._context.edits.shapePosition}function x(e,t){e._fullLayout._paperdiv.selectAll(`.shapelayer [data-index="`+t+`"]`).remove();var n=g.makeShapesOptionsAndPlotinfo(e,t),r=n.options,i=n.plotinfo;if(!r._input||r.visible!==!0)return;let a=Array.isArray(r.xref)||Array.isArray(r.yref);r.layer===`above`?l(e._fullLayout._shapeUpperLayer):r.xref.includes(`paper`)||r.yref.includes(`paper`)?l(e._fullLayout._shapeLowerLayer):r.layer===`between`&&!a?l(i.shapelayerBetween):i._hadPlotinfo?l((i.mainplotinfo||i).shapelayer):l(e._fullLayout._shapeLowerLayer);function l(n){var a=_(e,r),l={"data-index":t,"fill-rule":r.fillrule,d:a},p=r.opacity,m=r.fillcolor,h=r.line.width?r.line.color:`rgba(0,0,0,0)`,g=r.line.width,v=r.line.dash;!g&&r.editable===!0&&(g=5,v=`solid`);var y=a[a.length-1]!==`Z`,x=b(e)&&r.editable&&e._fullLayout._activeShapeIndex===t;x&&(m=y?`rgba(0,0,0,0)`:e._fullLayout.activeshape.fillcolor,p=e._fullLayout.activeshape.opacity);var S=n.append(`g`).classed(`shape-group`,!0).attr({"data-index":t}),w=S.append(`path`).attr(l).style(`opacity`,p).call(u.stroke,h).call(u.fill,m).call(d.dashLine,v,g);C(S,e,r),c(e,t,r,S);var E;if((x||e._context.edits.shapePosition)&&(E=f(e.layout,`shapes`,r)),x){w.style({cursor:`move`});var O={element:w.node(),plotinfo:i,gd:e,editHelpers:E,hasText:r.label.text||r.label.texttemplate,isActiveShape:!0};s(o(a,e),w,O)}else e._context.edits.shapePosition?T(e,w,r,t,n,E):r.editable===!0&&w.style(`pointer-events`,y||u.opacity(m)*p<=.5?`stroke`:`all`);w.node().addEventListener(`click`,function(){return D(e,w)})}}function C(e,t,n){let r=n.xref,a=n.yref;if(Array.isArray(r)||Array.isArray(a)){let o=`clip`+t._fullLayout._uid+`shape`+n._index,s=w(t,r,a);i.ensureSingleById(t._fullLayout._clips,`clipPath`,o,function(e){e.append(`rect`)}).select(`rect`).attr(s),d.setClipUrl(e,o,t)}else{let n=(r+a).replace(/paper/g,``).replace(/[xyz][0-9]* *domain/g,``);d.setClipUrl(e,n?`clip`+t._fullLayout._uid+n:null,t)}}function w(e,t,n){let r=e._fullLayout._size;function i(t,n){let i=(Array.isArray(t)?t:[t]).map(t=>a.getFromId(e,t)).filter(Boolean);if(!i.length)return n?[r.t,r.t+r.h]:[r.l,r.l+r.w];let o=i.map(function(e){return e._offset}),s=i.map(function(e){return e._offset+e._length});return[Math.min(...o),Math.max(...s)]}let o=i(t,!1),s=i(n,!0);return{x:o[0],y:s[0],width:o[1]-o[0],height:s[1]-s[0]}}function T(e,t,o,s,l,u){var f=10,v=10,b=o.xsizemode===`pixel`,x=o.ysizemode===`pixel`,S=o.type===`line`,w=o.type===`path`,T=u.modifyItem,D,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H=n.select(t.node().parentNode),U=a.getFromId(e,o.xref),W=a.getRefType(o.xref),G=a.getFromId(e,o.yref),K=a.getRefType(o.yref),q=o.x0shift,J=o.x1shift,Y=o.y0shift,X=o.y1shift,Z=function(t,n){return g.getDataToPixel(e,U,n,!1,W)(t)},Q=function(t,n){return g.getDataToPixel(e,G,n,!0,K)(t)},ee=g.getPixelToData(e,U,!1,W),te=g.getPixelToData(e,G,!0,K),ne=ae(),re={element:ne.node(),gd:e,prepFn:ce,doneFn:le,clickFn:ue},ie;p.init(re),ne.node().onmousemove=se;function ae(){return S?oe():t}function oe(){var e=10,n=Math.max(o.line.width,e),r=l.append(`g`).attr(`data-index`,s).attr(`drag-helper`,!0);r.append(`path`).attr(`d`,t.attr(`d`)).style({cursor:`move`,"stroke-width":n,"stroke-opacity":`0`});var i={"fill-opacity":`0`},a=Math.max(n/2,e);return r.append(`circle`).attr({"data-line-point":`start-point`,cx:b?Z(o.xanchor)+o.x0:Z(o.x0,q),cy:x?Q(o.yanchor)-o.y0:Q(o.y0,Y),r:a}).style(i).classed(`cursor-grab`,!0),r.append(`circle`).attr({"data-line-point":`end-point`,cx:b?Z(o.xanchor)+o.x1:Z(o.x1,J),cy:x?Q(o.yanchor)-o.y1:Q(o.y1,X),r:a}).style(i).classed(`cursor-grab`,!0),r}function se(n){if(y(e)){ie=null;return}if(S)ie=n.target.tagName===`path`?`move`:n.target.attributes[`data-line-point`].value===`start-point`?`resize-over-start-point`:`resize-over-end-point`;else{var r=re.element.getBoundingClientRect(),i=r.right-r.left,a=r.bottom-r.top,o=n.clientX-r.left,s=n.clientY-r.top,c=!w&&i>f&&a>v&&!n.shiftKey?p.getCursor(o/i,1-s/a):`move`;m(t,c),ie=c.split(`-`)[0]}}function ce(n){y(e)||(b&&(j=Z(o.xanchor)),x&&(M=Q(o.yanchor)),o.type===`path`?V=o.path:(D=b?o.x0:Z(o.x0),O=x?o.y0:Q(o.y0),k=b?o.x1:Z(o.x1),A=x?o.y1:Q(o.y1)),D<k?(F=D,z=`x0`,I=k,B=`x1`):(F=k,z=`x1`,I=D,B=`x0`),!x&&O<A||x&&O>A?(N=O,L=`y0`,P=A,R=`y1`):(N=A,L=`y1`,P=O,R=`y0`),se(n),pe(l,o),he(t,o,e),re.moveFn=ie===`move`?de:fe,re.altKey=n.altKey)}function le(){y(e)||(m(t),me(l),C(t,e,o),r.call(`_guiRelayout`,e,u.getUpdateObj()))}function ue(){y(e)||me(l)}function de(n,r){if(o.type===`path`){var i=function(e){return e},a=i,u=i;b?T(`xanchor`,o.xanchor=ee(j+n)):(a=function(e){return ee(Z(e)+n)},U&&U.type===`date`&&(a=g.encodeDate(a))),x?T(`yanchor`,o.yanchor=te(M+r)):(u=function(e){return te(Q(e)+r)},G&&G.type===`date`&&(u=g.encodeDate(u))),T(`path`,o.path=E(V,a,u))}else b?T(`xanchor`,o.xanchor=ee(j+n)):(T(`x0`,o.x0=ee(D+n)),T(`x1`,o.x1=ee(k+n))),x?T(`yanchor`,o.yanchor=te(M+r)):(T(`y0`,o.y0=te(O+r)),T(`y1`,o.y1=te(A+r)));t.attr(`d`,_(e,o)),pe(l,o),c(e,s,o,H)}function fe(n,r){if(w){var i=function(e){return e},a=i,u=i;b?T(`xanchor`,o.xanchor=ee(j+n)):(a=function(e){return ee(Z(e)+n)},U&&U.type===`date`&&(a=g.encodeDate(a))),x?T(`yanchor`,o.yanchor=te(M+r)):(u=function(e){return te(Q(e)+r)},G&&G.type===`date`&&(u=g.encodeDate(u))),T(`path`,o.path=E(V,a,u))}else if(S){if(ie===`resize-over-start-point`){var d=D+n,p=x?O-r:O+r;T(`x0`,o.x0=b?d:ee(d)),T(`y0`,o.y0=x?p:te(p))}else if(ie===`resize-over-end-point`){var m=k+n,h=x?A-r:A+r;T(`x1`,o.x1=b?m:ee(m)),T(`y1`,o.y1=x?h:te(h))}}else{var y=function(e){return ie.indexOf(e)!==-1},C=y(`n`),W=y(`s`),K=y(`w`),q=y(`e`),J=C?N+r:N,Y=W?P+r:P,X=K?F+n:F,ne=q?I+n:I;x&&(C&&(J=N-r),W&&(Y=P-r)),(!x&&Y-J>v||x&&J-Y>v)&&(T(L,o[L]=x?J:te(J)),T(R,o[R]=x?Y:te(Y))),ne-X>f&&(T(z,o[z]=b?X:ee(X)),T(B,o[B]=b?ne:ee(ne)))}t.attr(`d`,_(e,o)),pe(l,o),c(e,s,o,H)}function pe(e,t){(b||x)&&n();function n(){var n=t.type!==`path`,r=e.selectAll(`.visual-cue`).data([0]),a=1;r.enter().append(`path`).attr({fill:`#fff`,"fill-rule":`evenodd`,stroke:`#000`,"stroke-width":a}).classed(`visual-cue`,!0);var o=Z(b?t.xanchor:i.midRange(n?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),s=Q(x?t.yanchor:i.midRange(n?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(o=g.roundPositionForSharpStrokeRendering(o,a),s=g.roundPositionForSharpStrokeRendering(s,a),b&&x){var c=`M`+(o-1-a)+`,`+(s-1-a)+`h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z`;r.attr(`d`,c)}else if(b){var l=`M`+(o-1-a)+`,`+(s-9-a)+`v18 h2 v-18 Z`;r.attr(`d`,l)}else{var u=`M`+(o-9-a)+`,`+(s-1-a)+`h18 v2 h-18 Z`;r.attr(`d`,u)}}}function me(e){e.selectAll(`.visual-cue`).remove()}function he(e,t,n){var r=t.xref,i=t.yref,o=a.getFromId(n,r),s=a.getFromId(n,i),c=``;r!==`paper`&&!o.autorange&&(c+=r),i!==`paper`&&!s.autorange&&(c+=i),d.setClipUrl(e,c?`clip`+n._fullLayout._uid+c:null,n)}}function E(e,t,n){return e.replace(h.segmentRE,function(e){var r=0,i=e.charAt(0),a=h.paramIsX[i],o=h.paramIsY[i],s=h.numParams[i];return i+e.slice(1).replace(h.paramRE,function(e){return r>=s||(a[r]?e=t(e):o[r]&&(e=n(e)),r++),e})})}function D(e,t){if(b(e)){var n=+t.node().getAttribute(`data-index`);if(n>=0){if(n===e._fullLayout._activeShapeIndex){O(e);return}e._fullLayout._activeShapeIndex=n,e._fullLayout._deactivateShape=O,v(e)}}}function O(e){b(e)&&e._fullLayout._activeShapeIndex>=0&&(l(e),delete e._fullLayout._activeShapeIndex,v(e))}function k(e){if(b(e)){l(e);var t=e._fullLayout._activeShapeIndex,n=(e.layout||{}).shapes||[];if(t<n.length){for(var i=[],a=0;a<n.length;a++)a!==t&&i.push(n[a]);return delete e._fullLayout._activeShapeIndex,r.call(`_guiRelayout`,e,{shapes:i})}}}}),Zn=h((e,t)=>{var n=Ke(),r=Et(),i=xt(),a=Bn(),o=Xn().eraseActiveShape,s=$(),c=s._,l=t.exports={};l.toImage={name:`toImage`,title:function(e){return((e._context.toImageButtonOptions||{}).format||`png`)===`png`?c(e,`Download plot as a PNG`):c(e,`Download plot`)},icon:a.camera,click:function(e){var t=e._context.toImageButtonOptions,r={format:t.format||`png`};s.notifier(c(e,`Taking snapshot - this may take a few seconds`),`long`,e),[`filename`,`width`,`height`,`scale`].forEach(function(e){e in t&&(r[e]=t[e])}),n.call(`downloadImage`,e,r).then(function(t){s.notifier(c(e,`Snapshot succeeded`)+` - `+t,`long`,e)}).catch(function(){s.notifier(c(e,`Sorry, there was a problem downloading your snapshot!`),`long`,e)})}},l.sendDataToCloud={name:`sendDataToCloud`,title:function(e){return c(e,`Edit in Chart Studio`)},icon:a.disk,click:function(e){r.sendDataToCloud(e)}},l.editInChartStudio={name:`editInChartStudio`,title:function(e){return c(e,`Edit in Chart Studio`)},icon:a.pencil,click:function(e){r.sendDataToCloud(e)}},l.zoom2d={name:`zoom2d`,_cat:`zoom`,title:function(e){return c(e,`Zoom`)},attr:`dragmode`,val:`zoom`,icon:a.zoombox,click:u},l.pan2d={name:`pan2d`,_cat:`pan`,title:function(e){return c(e,`Pan`)},attr:`dragmode`,val:`pan`,icon:a.pan,click:u},l.select2d={name:`select2d`,_cat:`select`,title:function(e){return c(e,`Box Select`)},attr:`dragmode`,val:`select`,icon:a.selectbox,click:u},l.lasso2d={name:`lasso2d`,_cat:`lasso`,title:function(e){return c(e,`Lasso Select`)},attr:`dragmode`,val:`lasso`,icon:a.lasso,click:u},l.drawclosedpath={name:`drawclosedpath`,title:function(e){return c(e,`Draw closed freeform`)},attr:`dragmode`,val:`drawclosedpath`,icon:a.drawclosedpath,click:u},l.drawopenpath={name:`drawopenpath`,title:function(e){return c(e,`Draw open freeform`)},attr:`dragmode`,val:`drawopenpath`,icon:a.drawopenpath,click:u},l.drawline={name:`drawline`,title:function(e){return c(e,`Draw line`)},attr:`dragmode`,val:`drawline`,icon:a.drawline,click:u},l.drawrect={name:`drawrect`,title:function(e){return c(e,`Draw rectangle`)},attr:`dragmode`,val:`drawrect`,icon:a.drawrect,click:u},l.drawcircle={name:`drawcircle`,title:function(e){return c(e,`Draw circle`)},attr:`dragmode`,val:`drawcircle`,icon:a.drawcircle,click:u},l.eraseshape={name:`eraseshape`,title:function(e){return c(e,`Erase active shape`)},icon:a.eraseshape,click:o},l.zoomIn2d={name:`zoomIn2d`,_cat:`zoomin`,title:function(e){return c(e,`Zoom in`)},attr:`zoom`,val:`in`,icon:a.zoom_plus,click:u},l.zoomOut2d={name:`zoomOut2d`,_cat:`zoomout`,title:function(e){return c(e,`Zoom out`)},attr:`zoom`,val:`out`,icon:a.zoom_minus,click:u},l.autoScale2d={name:`autoScale2d`,_cat:`autoscale`,title:function(e){return c(e,`Autoscale`)},attr:`zoom`,val:`auto`,icon:a.autoscale,click:u},l.resetScale2d={name:`resetScale2d`,_cat:`resetscale`,title:function(e){return c(e,`Reset axes`)},attr:`zoom`,val:`reset`,icon:a.home,click:u},l.hoverClosestCartesian={name:`hoverClosestCartesian`,_cat:`hoverclosest`,title:function(e){return c(e,`Show closest data on hover`)},attr:`hovermode`,val:`closest`,icon:a.tooltip_basic,gravity:`ne`,click:u},l.hoverCompareCartesian={name:`hoverCompareCartesian`,_cat:`hoverCompare`,title:function(e){return c(e,`Compare data on hover`)},attr:`hovermode`,val:function(e){return e._fullLayout._isHoriz?`y`:`x`},icon:a.tooltip_compare,gravity:`ne`,click:u};function u(e,t){var r=t.currentTarget,a=r.getAttribute(`data-attr`),o=r.getAttribute(`data-val`)||!0,s=e._fullLayout,c={},l=i.list(e,null,!0),u=s._cartesianSpikesEnabled,d,f;if(a===`zoom`){var p=o===`in`?.5:2,m=(1+p)/2,h=(1-p)/2,g,_;for(f=0;f<l.length;f++)if(d=l[f],_=d.modebardisable===`none`||d.modebardisable.indexOf(o===`auto`||o===`reset`?`autoscale`:`zoominout`)===-1,_&&!d.fixedrange)if(g=d._name,o===`auto`)c[g+`.autorange`]=!0;else if(o===`reset`)d._rangeInitial0===void 0&&d._rangeInitial1===void 0?c[g+`.autorange`]=!0:d._rangeInitial0===void 0?(c[g+`.autorange`]=d._autorangeInitial,c[g+`.range`]=[null,d._rangeInitial1]):d._rangeInitial1===void 0?(c[g+`.range`]=[d._rangeInitial0,null],c[g+`.autorange`]=d._autorangeInitial):c[g+`.range`]=[d._rangeInitial0,d._rangeInitial1],d._showSpikeInitial!==void 0&&(c[g+`.showspikes`]=d._showSpikeInitial,u===`on`&&!d._showSpikeInitial&&(u=`off`));else{var v=[d.r2l(d.range[0]),d.r2l(d.range[1])],y=[m*v[0]+h*v[1],m*v[1]+h*v[0]];c[g+`.range[0]`]=d.l2r(y[0]),c[g+`.range[1]`]=d.l2r(y[1])}}else a===`hovermode`&&(o===`x`||o===`y`)&&(o=s._isHoriz?`y`:`x`,r.setAttribute(`data-val`,o)),c[a]=o;s._cartesianSpikesEnabled=u,n.call(`_guiRelayout`,e,c)}l.zoom3d={name:`zoom3d`,_cat:`zoom`,title:function(e){return c(e,`Zoom`)},attr:`scene.dragmode`,val:`zoom`,icon:a.zoombox,click:d},l.pan3d={name:`pan3d`,_cat:`pan`,title:function(e){return c(e,`Pan`)},attr:`scene.dragmode`,val:`pan`,icon:a.pan,click:d},l.orbitRotation={name:`orbitRotation`,title:function(e){return c(e,`Orbital rotation`)},attr:`scene.dragmode`,val:`orbit`,icon:a[`3d_rotate`],click:d},l.tableRotation={name:`tableRotation`,title:function(e){return c(e,`Turntable rotation`)},attr:`scene.dragmode`,val:`turntable`,icon:a[`z-axis`],click:d};function d(e,t){for(var r=t.currentTarget,i=r.getAttribute(`data-attr`),a=r.getAttribute(`data-val`)||!0,o=e._fullLayout._subplots.gl3d||[],s={},c=i.split(`.`),l=0;l<o.length;l++)s[o[l]+`.`+c[1]]=a;s.dragmode=a===`pan`?a:`zoom`,n.call(`_guiRelayout`,e,s)}l.resetCameraDefault3d={name:`resetCameraDefault3d`,_cat:`resetCameraDefault`,title:function(e){return c(e,`Reset camera to default`)},attr:`resetDefault`,icon:a.home,click:f},l.resetCameraLastSave3d={name:`resetCameraLastSave3d`,_cat:`resetCameraLastSave`,title:function(e){return c(e,`Reset camera to last save`)},attr:`resetLastSave`,icon:a.movie,click:f};function f(e,t){for(var r=t.currentTarget.getAttribute(`data-attr`),i=r===`resetLastSave`,a=r===`resetDefault`,o=e._fullLayout,s=o._subplots.gl3d||[],c={},l=0;l<s.length;l++){var u=s[l],d=u+`.camera`,f=u+`.aspectratio`,p=u+`.aspectmode`,m=o[u]._scene,h;i?(c[d+`.up`]=m.viewInitial.up,c[d+`.eye`]=m.viewInitial.eye,c[d+`.center`]=m.viewInitial.center,h=!0):a&&(c[d+`.up`]=null,c[d+`.eye`]=null,c[d+`.center`]=null,h=!0),h&&(c[f+`.x`]=m.viewInitial.aspectratio.x,c[f+`.y`]=m.viewInitial.aspectratio.y,c[f+`.z`]=m.viewInitial.aspectratio.z,c[p]=m.viewInitial.aspectmode)}n.call(`_guiRelayout`,e,c)}l.hoverClosest3d={name:`hoverClosest3d`,_cat:`hoverclosest`,title:function(e){return c(e,`Toggle show closest data on hover`)},attr:`hovermode`,val:null,toggle:!0,icon:a.tooltip_basic,gravity:`ne`,click:m};function p(e,t){var n=t.currentTarget,r=n._previousVal,i=e._fullLayout,a=i._subplots.gl3d||[],o=[`xaxis`,`yaxis`,`zaxis`],s={},c={};if(r)c=r,n._previousVal=null;else{for(var l=0;l<a.length;l++){var u=a[l],d=i[u],f=u+`.hovermode`;s[f]=d.hovermode,c[f]=!1;for(var p=0;p<3;p++){var m=o[p],h=u+`.`+m+`.showspikes`;c[h]=!1,s[h]=d[m].showspikes}}n._previousVal=s}return c}function m(e,t){var r=p(e,t);n.call(`_guiRelayout`,e,r)}l.zoomInGeo={name:`zoomInGeo`,_cat:`zoomin`,title:function(e){return c(e,`Zoom in`)},attr:`zoom`,val:`in`,icon:a.zoom_plus,click:h},l.zoomOutGeo={name:`zoomOutGeo`,_cat:`zoomout`,title:function(e){return c(e,`Zoom out`)},attr:`zoom`,val:`out`,icon:a.zoom_minus,click:h},l.resetGeo={name:`resetGeo`,_cat:`reset`,title:function(e){return c(e,`Reset`)},attr:`reset`,val:null,icon:a.autoscale,click:h},l.hoverClosestGeo={name:`hoverClosestGeo`,_cat:`hoverclosest`,title:function(e){return c(e,`Toggle show closest data on hover`)},attr:`hovermode`,val:null,toggle:!0,icon:a.tooltip_basic,gravity:`ne`,click:_};function h(e,t){for(var r=t.currentTarget,i=r.getAttribute(`data-attr`),a=r.getAttribute(`data-val`)||!0,o=e._fullLayout,s=o._subplots.geo||[],c=0;c<s.length;c++){var l=s[c],u=o[l];if(i===`zoom`){var d=u.projection.scale,f=a===`in`?2*d:.5*d;n.call(`_guiRelayout`,e,l+`.projection.scale`,f)}}i===`reset`&&S(e,`geo`)}l.hoverClosestPie={name:`hoverClosestPie`,_cat:`hoverclosest`,title:function(e){return c(e,`Toggle show closest data on hover`)},attr:`hovermode`,val:`closest`,icon:a.tooltip_basic,gravity:`ne`,click:_};function g(e){var t=e._fullLayout;return t.hovermode?!1:t._has(`cartesian`)?t._isHoriz?`y`:`x`:`closest`}function _(e){var t=g(e);n.call(`_guiRelayout`,e,`hovermode`,t)}l.resetViewSankey={name:`resetSankeyGroup`,title:function(e){return c(e,`Reset view`)},icon:a.home,click:function(e){for(var t={"node.groups":[],"node.x":[],"node.y":[]},r=0;r<e._fullData.length;r++){var i=e._fullData[r]._viewInitial;t[`node.groups`].push(i.node.groups.slice()),t[`node.x`].push(i.node.x.slice()),t[`node.y`].push(i.node.y.slice())}n.call(`restyle`,e,t)}},l.toggleHover={name:`toggleHover`,title:function(e){return c(e,`Toggle show closest data on hover`)},attr:`hovermode`,val:null,toggle:!0,icon:a.tooltip_basic,gravity:`ne`,click:function(e,t){var r=p(e,t);r.hovermode=g(e),n.call(`_guiRelayout`,e,r)}},l.resetViews={name:`resetViews`,title:function(e){return c(e,`Reset views`)},icon:a.home,click:function(e,t){var n=t.currentTarget;n.setAttribute(`data-attr`,`zoom`),n.setAttribute(`data-val`,`reset`),u(e,t),n.setAttribute(`data-attr`,`resetLastSave`),f(e,t),S(e,`geo`),S(e,`mapbox`),S(e,`map`)}},l.toggleSpikelines={name:`toggleSpikelines`,title:function(e){return c(e,`Toggle Spike Lines`)},icon:a.spikeline,attr:`_cartesianSpikesEnabled`,val:`on`,click:function(e){var t=e._fullLayout;t._cartesianSpikesEnabled=t._cartesianSpikesEnabled===`on`?`off`:`on`,n.call(`_guiRelayout`,e,v(e))}};function v(e){for(var t=e._fullLayout._cartesianSpikesEnabled===`on`,n=i.list(e,null,!0),r={},a=0;a<n.length;a++){var o=n[a];r[o._name+`.showspikes`]=t?!0:o._showSpikeInitial}return r}l.resetViewMapbox={name:`resetViewMapbox`,_cat:`resetView`,title:function(e){return c(e,`Reset view`)},attr:`reset`,icon:a.home,click:function(e){S(e,`mapbox`)}},l.resetViewMap={name:`resetViewMap`,_cat:`resetView`,title:function(e){return c(e,`Reset view`)},attr:`reset`,icon:a.home,click:function(e){S(e,`map`)}},l.zoomInMapbox={name:`zoomInMapbox`,_cat:`zoomin`,title:function(e){return c(e,`Zoom in`)},attr:`zoom`,val:`in`,icon:a.zoom_plus,click:y},l.zoomInMap={name:`zoomInMap`,_cat:`zoomin`,title:function(e){return c(e,`Zoom in`)},attr:`zoom`,val:`in`,icon:a.zoom_plus,click:b},l.zoomOutMapbox={name:`zoomOutMapbox`,_cat:`zoomout`,title:function(e){return c(e,`Zoom out`)},attr:`zoom`,val:`out`,icon:a.zoom_minus,click:y},l.zoomOutMap={name:`zoomOutMap`,_cat:`zoomout`,title:function(e){return c(e,`Zoom out`)},attr:`zoom`,val:`out`,icon:a.zoom_minus,click:b};function y(e,t){x(e,t,`mapbox`)}function b(e,t){x(e,t,`map`)}function x(e,t,r){for(var i=t.currentTarget.getAttribute(`data-val`),a=e._fullLayout,o=a._subplots[r]||[],s=1.05,c={},l=0;l<o.length;l++){var u=o[l],d=a[u].zoom,f=i===`in`?s*d:d/s;c[u+`.zoom`]=f}n.call(`_guiRelayout`,e,c)}function S(e,t){for(var r=e._fullLayout,i=r._subplots[t]||[],a={},o=0;o<i.length;o++)for(var s=i[o],c=r[s]._subplot,l=c.viewInitial,u=Object.keys(l),d=0;d<u.length;d++){var f=u[d];a[s+`.`+f]=l[f]}n.call(`_guiRelayout`,e,a)}}),Qn=h((e,t)=>{var n=Zn(),r=Object.keys(n),i=[`drawline`,`drawopenpath`,`drawclosedpath`,`drawcircle`,`drawrect`,`eraseshape`],a=[`v1hovermode`,`hoverclosest`,`hovercompare`,`togglehover`,`togglespikelines`].concat(i),o=[],s=function(e){if(a.indexOf(e._cat||e.name)===-1){var t=e.name,n=(e._cat||e.name).toLowerCase();o.indexOf(t)===-1&&o.push(t),o.indexOf(n)===-1&&o.push(n)}};r.forEach(function(e){s(n[e])}),o.sort(),t.exports={DRAW_MODES:i,backButtons:a,foreButtons:o}}),$n=h((e,t)=>{Qn(),t.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`}}}),er=h((e,t)=>{var n=$(),r=q(),i=yt(),a=$n();t.exports=function(e,t){var o=e.modebar||{},s=i.newContainer(t,`modebar`);function c(e,t){return n.coerce(o,s,a,e,t)}c(`orientation`),c(`bgcolor`,r.addOpacity(t.paper_bgcolor,.5));var l=r.contrast(r.rgb(t.modebar.bgcolor));c(`color`,r.addOpacity(l,.3)),c(`activecolor`,r.addOpacity(l,.7)),c(`uirevision`,t.uirevision),c(`add`),c(`remove`)}}),tr=h((e,t)=>{var n=S(),r=D(),i=$(),a=Bn(),o=b().version,s=new DOMParser;function c(e){this.container=e.container,this.element=document.createElement(`div`),this.update(e.graphInfo,e.buttons),this.container.appendChild(this.element)}var l=c.prototype;l.update=function(e,t){this.graphInfo=e;var n=this.graphInfo._context,r=this.graphInfo._fullLayout,a=`modebar-`+r._uid;this.element.setAttribute(`id`,a),this.element.setAttribute(`role`,`toolbar`),this._uid=a,this.element.className=`modebar modebar--custom`,n.displayModeBar===`hover`&&(this.element.className+=` modebar--hover ease-bg`),r.modebar.orientation===`v`&&(this.element.className+=` vertical`,t=t.reverse());var o=r.modebar,s=`#`+a+` .modebar-group`;document.querySelectorAll(s).forEach(function(e){e.style.backgroundColor=o.bgcolor});var c=!this.hasButtons(t),l=this.hasLogo!==n.displaylogo,u=this.locale!==n.locale;if(this.locale=n.locale,(c||l||u)&&(this.removeAllButtons(),this.updateButtons(t),n.watermark||n.displaylogo)){var d=this.getLogo();n.watermark&&(d.className+=` watermark`),r.modebar.orientation===`v`?this.element.insertBefore(d,this.element.childNodes[0]):this.element.appendChild(d),this.hasLogo=!0}this.updateActiveButton(),i.setStyleOnHover(`#`+a+` .modebar-btn`,`.active`,`.icon path`,`fill: `+o.activecolor,`fill: `+o.color,this.element)},l.updateButtons=function(e){var t=this;this.buttons=e,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(e){var n=t.createGroup();e.forEach(function(e){var r=e.name;if(!r)throw Error(`must provide button 'name' in button config`);if(t.buttonsNames.indexOf(r)!==-1)throw Error(`button name '`+r+`' is taken`);t.buttonsNames.push(r);var i=t.createButton(e);t.buttonElements.push(i),n.appendChild(i)}),t.element.appendChild(n)})},l.createGroup=function(){var e=document.createElement(`div`);e.className=`modebar-group`;var t=this.graphInfo._fullLayout.modebar;return e.style.backgroundColor=t.bgcolor,e},l.createButton=function(e){var t=this,r=document.createElement(`button`);r.setAttribute(`type`,`button`),r.setAttribute(`rel`,`tooltip`),r.className=`modebar-btn`;var i=e.title;i===void 0?i=e.name:typeof i==`function`&&(i=i(this.graphInfo)),(i||i===0)&&(r.setAttribute(`data-title`,i),r.setAttribute(`aria-label`,i)),e.attr!==void 0&&r.setAttribute(`data-attr`,e.attr);var o=e.val;if(o!==void 0&&(typeof o==`function`&&(o=o(this.graphInfo)),r.setAttribute(`data-val`,o)),typeof e.click!=`function`)throw Error(`must provide button 'click' function in button config`);r.addEventListener(`click`,function(n){e.click(t.graphInfo,n),t.updateActiveButton(n.currentTarget)}),r.setAttribute(`data-toggle`,e.toggle||!1),e.toggle&&n.select(r).classed(`active`,!0);var s=e.icon;return typeof s==`function`?r.appendChild(s()):r.appendChild(this.createIcon(s||a.question)),r.setAttribute(`data-gravity`,e.gravity||`n`),r},l.createIcon=function(e){var t=r(e.height)?Number(e.height):e.ascent-e.descent,n=`http://www.w3.org/2000/svg`,i;if(e.path){i=document.createElementNS(n,`svg`),i.setAttribute(`viewBox`,[0,0,e.width,t].join(` `)),i.setAttribute(`class`,`icon`);var a=document.createElementNS(n,`path`);a.setAttribute(`d`,e.path),e.transform?a.setAttribute(`transform`,e.transform):e.ascent!==void 0&&a.setAttribute(`transform`,`matrix(1 0 0 -1 0 `+e.ascent+`)`),i.appendChild(a)}return e.svg&&(i=s.parseFromString(e.svg,`application/xml`).childNodes[0]),i.setAttribute(`height`,`1em`),i.setAttribute(`width`,`1em`),i},l.updateActiveButton=function(e){var t=this.graphInfo._fullLayout,r=e===void 0?null:e.getAttribute(`data-attr`);this.buttonElements.forEach(function(e){var a=e.getAttribute(`data-val`)||!0,o=e.getAttribute(`data-attr`),s=e.getAttribute(`data-toggle`)===`true`,c=n.select(e),l=function(e,n){var r=t.modebar,i=e.querySelector(`.icon path`);i&&(n||e.matches(`:hover`)?i.style.fill=r.activecolor:i.style.fill=r.color)};if(s){if(o===r){var u=!c.classed(`active`);c.classed(`active`,u),l(e,u)}}else{var d=o===null?o:i.nestedProperty(t,o).get();c.classed(`active`,d===a),l(e,d===a)}})},l.hasButtons=function(e){var t=this.buttons;if(!t||e.length!==t.length)return!1;for(var n=0;n<e.length;++n){if(e[n].length!==t[n].length)return!1;for(var r=0;r<e[n].length;r++)if(e[n][r].name!==t[n][r].name)return!1}return!0};function u(e){return e+` (v`+o+`)`}l.getLogo=function(){var e=this.createGroup(),t=document.createElement(`a`);return t.href=`https://plotly.com/`,t.target=`_blank`,t.setAttribute(`data-title`,u(i._(this.graphInfo,`Produced with Plotly.js`))),t.className=`modebar-btn plotlyjsicon modebar-btn--logo`,t.appendChild(this.createIcon(a.newplotlylogo)),e.appendChild(t),e},l.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},l.destroy=function(){i.removeElement(this.container.querySelector(`.modebar`))};function d(e,t){var r=e._fullLayout,i=new c({graphInfo:e,container:r._modebardiv.node(),buttons:t});return r._privateplot&&n.select(i.element).append(`span`).classed(`badge-private float--left`,!0).text(`PRIVATE`),i}t.exports=d}),nr=h((e,t)=>{var n=xt(),r=Xt(),i=Ke(),a=Qt().isUnifiedHover,o=tr(),s=Zn(),c=Qn().DRAW_MODES,l=$().extendDeep;t.exports=function(e){var t=e._fullLayout,n=e._context,r=t._modeBar;if(!n.displayModeBar&&!n.watermark){r&&(r.destroy(),delete t._modeBar);return}if(!Array.isArray(n.modeBarButtonsToRemove))throw Error([`*modeBarButtonsToRemove* configuration options`,`must be an array.`].join(` `));if(!Array.isArray(n.modeBarButtonsToAdd))throw Error([`*modeBarButtonsToAdd* configuration options`,`must be an array.`].join(` `));var i=n.modeBarButtons,a=Array.isArray(i)&&i.length?h(i):!n.displayModeBar&&n.watermark?[]:u(e);r?r.update(e,a):t._modeBar=o(e,a)};function u(e){var t=e._fullLayout,n=e._fullData,r=e._context;function i(e,t){if(typeof t==`string`){if(t.toLowerCase()===e.toLowerCase())return!0}else{var n=t.name,r=t._cat||t.name;if(n===e||r===e.toLowerCase())return!0}return!1}var o=t.modebar.add;typeof o==`string`&&(o=[o]);var l=t.modebar.remove;typeof l==`string`&&(l=[l]);var u=r.modeBarButtonsToAdd.concat(o.filter(function(e){for(var t=0;t<r.modeBarButtonsToRemove.length;t++)if(i(e,r.modeBarButtonsToRemove[t]))return!1;return!0})),h=r.modeBarButtonsToRemove.concat(l.filter(function(e){for(var t=0;t<r.modeBarButtonsToAdd.length;t++)if(i(e,r.modeBarButtonsToAdd[t]))return!1;return!0})),g=t._has(`cartesian`),_=t._has(`gl3d`),v=t._has(`geo`),y=t._has(`pie`),b=t._has(`funnelarea`),x=t._has(`ternary`),S=t._has(`mapbox`),C=t._has(`map`),w=t._has(`polar`),T=t._has(`smith`),E=t._has(`sankey`),D=d(t),O=a(t.hovermode),k=[];function A(e){if(e.length){for(var t=[],n=0;n<e.length;n++){for(var r=e[n],i=s[r],a=i.name.toLowerCase(),o=(i._cat||i.name).toLowerCase(),c=!1,l=0;l<h.length;l++){var u=h[l].toLowerCase();if(u===a||u===o){c=!0;break}}c||t.push(s[r])}k.push(t)}}var j=[`toImage`];r.showEditInChartStudio?j.push(`editInChartStudio`):r.showSendToCloud&&j.push(`sendDataToCloud`),A(j);var M=[],N=[],P=[],F=[];(g||y||b||x)+v+_+S+C+w+T>1?(N=[`toggleHover`],P=[`resetViews`]):v?(M=[`zoomInGeo`,`zoomOutGeo`],N=[`hoverClosestGeo`],P=[`resetGeo`]):_?(N=[`hoverClosest3d`],P=[`resetCameraDefault3d`,`resetCameraLastSave3d`]):S?(M=[`zoomInMapbox`,`zoomOutMapbox`],N=[`toggleHover`],P=[`resetViewMapbox`]):C?(M=[`zoomInMap`,`zoomOutMap`],N=[`toggleHover`],P=[`resetViewMap`]):y?N=[`hoverClosestPie`]:E?(N=[`hoverClosestCartesian`,`hoverCompareCartesian`],P=[`resetViewSankey`]):N=[`toggleHover`],g&&N.push(`toggleSpikelines`,`hoverClosestCartesian`,`hoverCompareCartesian`),(p(n)||O)&&(N=[]),g&&!D&&(M=[`zoomIn2d`,`zoomOut2d`,`autoScale2d`],P[0]!==`resetViews`&&(P=[`resetScale2d`])),_?F=[`zoom3d`,`pan3d`,`orbitRotation`,`tableRotation`]:g&&!D||x?F=[`zoom2d`,`pan2d`]:S||C||v?F=[`pan2d`]:w&&(F=[`zoom2d`]),f(n)&&F.push(`select2d`,`lasso2d`);var I=[],L=function(e){I.indexOf(e)===-1&&N.indexOf(e)!==-1&&I.push(e)};if(Array.isArray(u)){for(var R=[],z=0;z<u.length;z++){var B=u[z];typeof B==`string`?(B=B.toLowerCase(),c.indexOf(B)===-1?B===`togglespikelines`?L(`toggleSpikelines`):B===`togglehover`?L(`toggleHover`):B===`hovercompare`?L(`hoverCompareCartesian`):B===`hoverclosest`?(L(`hoverClosestCartesian`),L(`hoverClosestGeo`),L(`hoverClosest3d`),L(`hoverClosestPie`)):B===`v1hovermode`&&(L(`hoverClosestCartesian`),L(`hoverCompareCartesian`),L(`hoverClosestGeo`),L(`hoverClosest3d`),L(`hoverClosestPie`)):(t._has(`mapbox`)||t._has(`map`)||t._has(`cartesian`))&&F.push(B)):R.push(B)}u=R}return A(F),A(M.concat(P)),A(I),m(k,u)}function d(e){for(var t=n.list({_fullLayout:e},null,!0),r=0;r<t.length;r++){var i=t[r].modebardisable;if(!t[r].fixedrange&&i!==`autoscale+zoominout`&&i!==`zoominout+autoscale`)return!1}return!0}function f(e){for(var t=!1,n=0;n<e.length&&!t;n++){var a=e[n];!a._module||!a._module.selectPoints||(i.traceIs(a,`scatter-like`)?(r.hasMarkers(a)||r.hasText(a))&&(t=!0):i.traceIs(a,`box-violin`)?(a.boxpoints===`all`||a.points===`all`)&&(t=!0):t=!0)}return t}function p(e){for(var t=0;t<e.length;t++)if(!i.traceIs(e[t],`noHover`))return!1;return!0}function m(e,t){if(t.length)if(Array.isArray(t[0]))for(var n=0;n<t.length;n++)e.push(t[n]);else e.push(t);return e}function h(e){for(var t=l([],e),n=0;n<t.length;n++)for(var r=t[n],i=0;i<r.length;i++){var a=r[i];if(typeof a==`string`)if(s[a]!==void 0)t[n][i]=s[a];else throw Error([`*modeBarButtons* configuration options`,`invalid button name`].join(` `))}return t}}),rr=h((e,t)=>{t.exports={moduleType:`component`,name:`modebar`,layoutAttributes:$n(),supplyLayoutDefaults:er(),manage:nr()}}),ir=h((e,t)=>{var n=Ot().FROM_BL;t.exports=function(e,t,r){r===void 0&&(r=n[e.constraintoward||`center`]);var i=[e.r2l(e.range[0]),e.r2l(e.range[1])],a=i[0]+(i[1]-i[0])*r;e.range=e._input.range=[e.l2r(a+(i[0]-a)*t),e.l2r(a+(i[1]-a)*t)],e.setScale()}}),ar=h(e=>{var t=$(),n=on(),r=xt().id2name,i=Mt(),a=ir(),o=rn(),s=O().ALMOST_EQUAL,c=Ot().FROM_BL;e.handleDefaults=function(e,n,i){var a=i.axIds,s=i.axHasImage,c=n._axisConstraintGroups=[],u=n._axisMatchGroups=[],d,f,p,m,h,g,_,v;for(d=0;d<a.length;d++)m=r(a[d]),h=e[m],g=n[m],l(h,g,{axIds:a,layoutOut:n,hasImage:s[m]});function y(e,t){for(d=0;d<e.length;d++)for(p in f=e[d],f)n[r(p)][t]=f}for(y(u,`_matchGroup`),d=0;d<c.length;d++)for(p in f=c[d],f)if(g=n[r(p)],g.fixedrange){for(var b in f){var x=r(b);(e[x]||{}).fixedrange===!1&&t.warn(`fixedrange was specified as false for axis `+x+` but was overridden because another axis in its constraint group has fixedrange true`),n[x].fixedrange=!0}break}for(d=0;d<c.length;){for(p in f=c[d],f){g=n[r(p)],g._matchGroup&&Object.keys(g._matchGroup).length===Object.keys(f).length&&(c.splice(d,1),d--);break}d++}y(c,`_constraintGroup`);var S=[`constrain`,`range`,`autorange`,`rangemode`,`rangebreaks`,`categoryorder`,`categoryarray`],C=!1,w=!1;function T(){v=g[_],_===`rangebreaks`&&(w=g._hasDayOfWeekBreaks)}for(d=0;d<u.length;d++){f=u[d];for(var E=0;E<S.length;E++){_=S[E],v=null;var D;for(p in f)if(m=r(p),h=e[m],g=n[m],_ in g){if(!g.matches&&(D=g,_ in h)){T();break}v===null&&_ in h&&T()}if(_===`range`&&v&&h.range&&h.range.length===2&&h.range[0]!==null&&h.range[1]!==null&&(C=!0),_===`autorange`&&v===null&&C&&(v=!1),v===null&&_ in D&&(v=D[_]),v!==null)for(p in f)g=n[r(p)],g[_]=_===`range`?v.slice():v,_===`rangebreaks`&&(g._hasDayOfWeekBreaks=w,o(g,n))}}};function l(e,n,a){var o=a.axIds,s=a.layoutOut,c=a.hasImage,l=s._axisConstraintGroups,p=s._axisMatchGroups,m=n._id,h=m.charAt(0),g=((s._splomAxes||{})[h]||{})[m]||{},_=n._id,v=_.charAt(0)===`x`;n._matchGroup=null,n._constraintGroup=null;function y(r,a){return t.coerce(e,n,i,r,a)}y(`constrain`,c?`domain`:`range`),t.coerce(e,n,{constraintoward:{valType:`enumerated`,values:v?[`left`,`center`,`right`]:[`bottom`,`middle`,`top`],dflt:v?`center`:`middle`}},`constraintoward`);var b=n.type,x,S,C=[];for(x=0;x<o.length;x++)S=o[x],S!==_&&s[r(S)].type===b&&C.push(S);var w=d(l,_);if(w){var T=[];for(x=0;x<C.length;x++)S=C[x],w[S]||T.push(S);C=T}var E=C.length,D,O;E&&(e.matches||g.matches)&&(D=t.coerce(e,n,{matches:{valType:`enumerated`,values:C,dflt:C.indexOf(g.matches)===-1?void 0:g.matches}},`matches`));var k=c&&!v?n.anchor:void 0;if(E&&!D&&(e.scaleanchor||k)&&(O=t.coerce(e,n,{scaleanchor:{valType:`enumerated`,values:C.concat([!1])}},`scaleanchor`,k)),D){n._matchGroup=f(p,_,D,1);var A=s[r(D)],j=u(s,n)/u(s,A);v!==(D.charAt(0)===`x`)&&(j=(v?`x`:`y`)+j),f(l,_,D,j)}else e.matches&&o.indexOf(e.matches)!==-1&&t.warn(`ignored `+n._name+`.matches: "`+e.matches+`" to avoid an infinite loop`);if(O){var M=y(`scaleratio`);M||=n.scaleratio=1,f(l,_,O,M)}else e.scaleanchor&&o.indexOf(e.scaleanchor)!==-1&&t.warn(`ignored `+n._name+`.scaleanchor: "`+e.scaleanchor+`" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.`)}function u(e,t){var n=t.domain;return n||=e[r(t.overlaying)].domain,n[1]-n[0]}function d(e,t){for(var n=0;n<e.length;n++)if(e[n][t])return e[n];return null}function f(e,t,n,r){var i,a,o,s,c,l=d(e,t);l===null?(l={},l[t]=1,c=e.length,e.push(l)):c=e.indexOf(l);var u=Object.keys(l);for(i=0;i<e.length;i++)if(o=e[i],i!==c&&o[n]){var f=o[n];for(a=0;a<u.length;a++)s=u[a],o[s]=p(f,p(r,l[s]));e.splice(c,1);return}if(r!==1)for(a=0;a<u.length;a++){var m=u[a];l[m]=p(r,l[m])}l[n]=1}function p(e,t){var n=``,r=``,i,a;typeof e==`string`&&(n=e.match(/^[xy]*/)[0],i=n.length,e=+e.slice(i)),typeof t==`string`&&(r=t.match(/^[xy]*/)[0],a=r.length,t=+t.slice(a));var o=e*t;return!i&&!a?o:!i||!a||n.charAt(0)===r.charAt(0)?n+r+e*t:i===a?o:(i>a?n.slice(a):r.slice(i))+o}function m(e,t){for(var n=t._size,r=n.h/n.w,i={},a=Object.keys(e),o=0;o<a.length;o++){var s=a[o],c=e[s];if(typeof c==`string`){var l=c.match(/^[xy]*/)[0],u=l.length;c=+c.slice(u);for(var d=l.charAt(0)===`y`?r:1/r,f=0;f<u;f++)c*=d}i[s]=c}return i}e.enforce=function(e){var t=e._fullLayout,i=t._axisConstraintGroups||[],o,c,l,u,d,f,p,g;for(o=0;o<i.length;o++){l=m(i[o],t);var _=Object.keys(l),v=1/0,y=0,b=1/0,x={},S={},C=!1;for(c=0;c<_.length;c++)u=_[c],S[u]=d=t[r(u)],d._inputDomain?d.domain=d._inputDomain.slice():d._inputDomain=d.domain.slice(),d._inputRange||=d.range.slice(),d.setScale(),x[u]=f=Math.abs(d._m)/l[u],v=Math.min(v,f),(d.constrain===`domain`||!d._constraintShrinkable)&&(b=Math.min(b,f)),delete d._constraintShrinkable,y=Math.max(y,f),d.constrain===`domain`&&(C=!0);if(!(v>s*y&&!C)){for(c=0;c<_.length;c++)if(u=_[c],f=x[u],d=S[u],p=d.constrain,f!==b||p===`domain`)if(g=f/b,p===`range`)a(d,g);else{var w=d._inputDomain,T=(d.domain[1]-d.domain[0])/(w[1]-w[0]),E=(d.r2l(d.range[1])-d.r2l(d.range[0]))/(d.r2l(d._inputRange[1])-d.r2l(d._inputRange[0]));if(g/=T,g*E<1){d.domain=d._input.domain=w.slice(),a(d,g);continue}if(E<1&&(d.range=d._input.range=d._inputRange.slice(),g*=E),d.autorange){var D=d.r2l(d.range[0]),O=d.r2l(d.range[1]),k=(D+O)/2,A=k,j=k,M=Math.abs(O-k),N=k-M*g*1.0001,P=k+M*g*1.0001,F=n.makePadFn(t,d,0),I=n.makePadFn(t,d,1);h(d,g);var L=Math.abs(d._m),R=n.concatExtremes(e,d),z=R.min,B=R.max,V,H;for(H=0;H<z.length;H++)V=z[H].val-F(z[H])/L,V>N&&V<A&&(A=V);for(H=0;H<B.length;H++)V=B[H].val+I(B[H])/L,V<P&&V>j&&(j=V);var U=(j-A)/(2*M);g/=U,A=d.l2r(A),j=d.l2r(j),d.range=d._input.range=D<O?[A,j]:[j,A]}h(d,g)}}}},e.getAxisGroup=function(e,t){for(var n=e._axisMatchGroups,r=0;r<n.length;r++)if(n[r][t])return`g`+r;return t},e.clean=function(e,t){if(t._inputDomain){for(var n=!1,r=t._id,i=e._fullLayout._axisConstraintGroups,a=0;a<i.length;a++)if(i[a][r]){n=!0;break}(!n||t.constrain!==`domain`)&&(t._input.domain=t.domain=t._inputDomain,delete t._inputDomain)}};function h(e,t){var n=e._inputDomain,r=c[e.constraintoward],i=n[0]+(n[1]-n[0])*r;e.domain=e._input.domain=[i+(n[0]-i)/t,i+(n[1]-i)/t],e.setScale()}}),or=h(e=>{var t=S(),n=Ke(),r=Et(),i=$(),a=kt(),o=zn(),s=q(),c=tn(),l=nn(),u=rr(),d=sn(),f=Ot(),p=ar(),m=p.enforce,h=p.clean,g=on().doAutoRange,_=`start`,v=`middle`,y=`end`,b=bt().zindexSeparator;e.layoutStyles=function(e){return i.syncOrAsync([r.doAutoMargin,C],e)};function x(e,t,n){for(var r=0;r<n.length;r++){var i=n[r][0],a=n[r][1];if(!(i[0]>=e[1]||i[1]<=e[0])&&a[0]<t[1]&&a[1]>t[0])return!0}return!1}function C(n){var a=n._fullLayout,o=a._size,l=o.p,p=d.list(n,``,!0),m,h,g,_,v,y;if(a._paperdiv.style({width:n._context.responsive&&a.autosize&&!n._context._hasZeroWidth&&!n.layout.width?`100%`:a.width+`px`,height:n._context.responsive&&a.autosize&&!n._context._hasZeroHeight&&!n.layout.height?`100%`:a.height+`px`}).selectAll(`.main-svg`).call(c.setSize,a.width,a.height),n._context.setBackground(n,a.paper_bgcolor),e.drawMainTitle(n),u.manage(n),!a._has(`cartesian`))return r.previousPromises(n);function S(e,t,n){var r=e._lw/2;if(e._id.charAt(0)===`x`){if(t){if(n===`top`)return t._offset-l-r}else return o.t+o.h*(1-(e.position||0))+r%1;return t._offset+t._length+l+r}if(t){if(n===`right`)return t._offset+t._length+l+r}else return o.l+o.w*(e.position||0)+r%1;return t._offset-l-r}for(m=0;m<p.length;m++){_=p[m];var C=_._anchorAxis;_._linepositions={},_._lw=c.crispRound(n,_.linewidth,1),_._mainLinePosition=S(_,C,_.side),_._mainMirrorPosition=_.mirror&&C?S(_,C,f.OPPOSITE_SIDE[_.side]):null}var T=[],D=[],O=[],k=s.opacity(a.paper_bgcolor)===1&&s.opacity(a.plot_bgcolor)===1&&a.paper_bgcolor===a.plot_bgcolor;for(h in a._plots)if(g=a._plots[h],g.mainplot)g.bg&&g.bg.remove(),g.bg=void 0;else{var A=g.xaxis.domain,j=g.yaxis.domain,M=g.plotgroup;if(x(A,j,O)&&h.indexOf(b)===-1){var N=M.node(),P=g.bg=i.ensureSingle(M,`rect`,`bg`);N.insertBefore(P.node(),N.childNodes[0]),D.push(h)}else M.select(`rect.bg`).remove(),O.push([A,j]),k||(T.push(h),D.push(h))}var F=a._bgLayer.selectAll(`.bg`).data(T);for(F.enter().append(`rect`).classed(`bg`,!0),F.exit().remove(),F.each(function(e){a._plots[e].bg=t.select(this)}),m=0;m<D.length;m++)g=a._plots[D[m]],v=g.xaxis,y=g.yaxis,g.bg&&v._offset!==void 0&&y._offset!==void 0&&g.bg.call(c.setRect,v._offset-l,y._offset-l,v._length+2*l,y._length+2*l).call(s.fill,a.plot_bgcolor).style(`stroke-width`,0);if(!a._hasOnlyLargeSploms)for(h in a._plots){g=a._plots[h],v=g.xaxis,y=g.yaxis;var I=g.clipId=`clip`+a._uid+h+`plot`,L=i.ensureSingleById(a._clips,`clipPath`,I,function(e){e.classed(`plotclip`,!0).append(`rect`)});g.clipRect=L.select(`rect`).attr({width:v._length,height:y._length}),c.setTranslate(g.plot,v._offset,y._offset);var R,z;g._hasClipOnAxisFalse?(R=null,z=I):(R=I,z=null),c.setClipUrl(g.plot,R,n),g.layerClipId=z}var B,V,H,U,W,G,K,q,J,Y,X,Z,Q;function ee(e){return`M`+B+`,`+e+`H`+V}function te(e){return`M`+v._offset+`,`+e+`h`+v._length}function ne(e){return`M`+e+`,`+q+`V`+K}function re(e){return y._shift!==void 0&&(e+=y._shift),`M`+e+`,`+y._offset+`v`+y._length}function ie(e,t,n){if(!e.showline||h!==e._mainSubplot)return``;if(!e._anchorAxis)return n(e._mainLinePosition);var r=t(e._mainLinePosition);return e.mirror&&(r+=t(e._mainMirrorPosition)),r}for(h in a._plots){g=a._plots[h],v=g.xaxis,y=g.yaxis;var ae=`M0,0`;w(v,h)&&(W=E(v,`left`,y,p),B=v._offset-(W?l+W:0),G=E(v,`right`,y,p),V=v._offset+v._length+(G?l+G:0),H=S(v,y,`bottom`),U=S(v,y,`top`),Q=!v._anchorAxis||h!==v._mainSubplot,Q&&(v.mirror===`allticks`||v.mirror===`all`)&&(v._linepositions[h]=[H,U]),ae=ie(v,ee,te),Q&&v.showline&&(v.mirror===`all`||v.mirror===`allticks`)&&(ae+=ee(H)+ee(U)),g.xlines.style(`stroke-width`,v._lw+`px`).call(s.stroke,v.showline?v.linecolor:`rgba(0,0,0,0)`)),g.xlines.attr(`d`,ae);var oe=`M0,0`;w(y,h)&&(X=E(y,`bottom`,v,p),K=y._offset+y._length+(X?l:0),Z=E(y,`top`,v,p),q=y._offset-(Z?l:0),J=S(y,v,`left`),Y=S(y,v,`right`),Q=!y._anchorAxis||h!==y._mainSubplot,Q&&(y.mirror===`allticks`||y.mirror===`all`)&&(y._linepositions[h]=[J,Y]),oe=ie(y,ne,re),Q&&y.showline&&(y.mirror===`all`||y.mirror===`allticks`)&&(oe+=ne(J)+ne(Y)),g.ylines.style(`stroke-width`,y._lw+`px`).call(s.stroke,y.showline?y.linecolor:`rgba(0,0,0,0)`)),g.ylines.attr(`d`,oe)}return d.makeClipPaths(n),r.previousPromises(n)}function w(e,t){return(e.ticks||e.showline)&&(t===e._mainSubplot||e.mirror===`all`||e.mirror===`allticks`)}function T(e,t,n){if(!n.showline||!n._lw)return!1;if(n.mirror===`all`||n.mirror===`allticks`)return!0;var r=n._anchorAxis;if(!r)return!1;var i=f.FROM_BL[t];return n.side===t?r.domain[i]===e.domain[i]:n.mirror&&r.domain[1-i]===e.domain[1-i]}function E(e,t,n,r){if(T(e,t,n))return n._lw;for(var i=0;i<r.length;i++){var a=r[i];if(a._mainAxis===n._mainAxis&&T(e,t,a))return a._lw}return 0}e.drawMainTitle=function(e){var n=e._fullLayout.title,r=e._fullLayout,i=P(r),o=F(r),s=M(r,o),u=j(r,i);if(l.draw(e,`gtitle`,{propContainer:r,propName:`title.text`,subtitlePropName:`title.subtitle.text`,placeholder:r._dfltTitle.plot,subtitlePlaceholder:r._dfltTitle.subtitle,attributes:{x:u,y:s,"text-anchor":i,dy:o}}),n.text&&n.automargin){var d=t.select(e).selectAll(`.gtitle`),p=c.bBox(t.select(e).selectAll(`.g-gtitle`).node()).height,m=k(e,n,p);if(m>0){A(e,s,m,p),d.attr({x:u,y:s,"text-anchor":i,dy:N(n.yanchor)}).call(a.positionText,u,s);var h=(n.text.match(a.BR_TAG_ALL)||[]).length;if(h){var g=f.LINE_SPACING*h+f.MID_SHIFT;n.y===0&&(g=-g),d.selectAll(`.line`).each(function(){var e=+this.getAttribute(`dy`).slice(0,-2)-g+`em`;this.setAttribute(`dy`,e)})}var _=t.select(e).selectAll(`.gtitle-subtitle`);if(_.node()){var v=d.node().getBBox(),y=v.y+v.height+l.SUBTITLE_PADDING_EM*n.subtitle.font.size;_.attr({x:u,y,"text-anchor":i,dy:N(n.yanchor)}).call(a.positionText,u,y)}}}};function D(e,t,n,r,a){var o=t.yref===`paper`?e._fullLayout._size.h:e._fullLayout.height,s=i.isTopAnchor(t)?r:r-a,c=n===`b`?o-s:s;return i.isTopAnchor(t)&&n===`t`||i.isBottomAnchor(t)&&n===`b`?!1:c<a}function O(e,t,n,r,i){var a=0;return n===`middle`&&(a+=i/2),e===`t`?(n===`top`&&(a+=i),a+=r-t*r):(n===`bottom`&&(a+=i),a+=t*r),a}function k(e,t,n){var r=t.y,i=t.yanchor,a=r>.5?`t`:`b`,o=e._fullLayout.margin[a],s=0;return t.yref===`paper`?s=n+t.pad.t+t.pad.b:t.yref===`container`&&(s=O(a,r,i,e._fullLayout.height,n)+t.pad.t+t.pad.b),s>o?s:0}function A(e,t,n,i){var a=`title.automargin`,o=e._fullLayout.title,s=o.y>.5?`t`:`b`,c={x:o.x,y:o.y,t:0,b:0},l={};o.yref===`paper`&&D(e,o,s,t,i)?c[s]=n:o.yref===`container`&&(l[s]=n,e._fullLayout._reservedMargin[a]=l),r.allowAutoMargin(e,a),r.autoMargin(e,a,c)}function j(e,t){var n=e.title,r=e._size,i=0;switch(t===_?i=n.pad.l:t===y&&(i=-n.pad.r),n.xref){case`paper`:return r.l+r.w*n.x+i;default:return e.width*n.x+i}}function M(e,t){var n=e.title,r=e._size,i=0;if(t===`0em`||!t?i=-n.pad.b:t===f.CAP_SHIFT+`em`&&(i=n.pad.t),n.y===`auto`)return r.t/2;switch(n.yref){case`paper`:return r.t+r.h-r.h*n.y+i;default:return e.height-e.height*n.y+i}}function N(e){return e===`top`?f.CAP_SHIFT+.3+`em`:e===`bottom`?`-0.3em`:f.MID_SHIFT+`em`}function P(e){var t=e.title,n=v;return i.isRightAnchor(t)?n=y:i.isLeftAnchor(t)&&(n=_),n}function F(e){var t=e.title,n=`0em`;return i.isTopAnchor(t)?n=f.CAP_SHIFT+`em`:i.isMiddleAnchor(t)&&(n=f.MID_SHIFT+`em`),n}e.doTraceStyle=function(t){var i=t.calcdata,a=[],s;for(s=0;s<i.length;s++){var c=i[s],l=c[0]||{},u=l.trace||{},d=u._module||{},f=d.arraysToCalcdata;f&&f(c,u);var p=d.editStyle;p&&a.push({fn:p,cd0:l})}if(a.length){for(s=0;s<a.length;s++){var m=a[s];m.fn(t,m.cd0)}o(t),e.redrawReglTraces(t)}return r.style(t),n.getComponentMethod(`legend`,`draw`)(t),r.previousPromises(t)},e.doColorBars=function(e){return n.getComponentMethod(`colorbar`,`draw`)(e),r.previousPromises(e)},e.layoutReplot=function(e){var t=e.layout;return e.layout=void 0,n.call(`_doPlot`,e,``,t)},e.doLegend=function(e){return n.getComponentMethod(`legend`,`draw`)(e),r.previousPromises(e)},e.doTicksRelayout=function(t){return d.draw(t,`redraw`),t._fullLayout._hasOnlyLargeSploms&&(n.subplotsRegistry.splom.updateGrid(t),o(t),e.redrawReglTraces(t)),e.drawMainTitle(t),r.previousPromises(t)},e.doModeBar=function(e){var t=e._fullLayout;u.manage(e);for(var n=0;n<t._basePlotModules.length;n++){var i=t._basePlotModules[n].updateFx;i&&i(e)}return r.previousPromises(e)},e.doCamera=function(e){for(var t=e._fullLayout,n=t._subplots.gl3d,r=0;r<n.length;r++){var i=t[n[r]];i._scene.setViewport(i)}},e.drawData=function(t){var i=t._fullLayout;o(t);for(var a=i._basePlotModules,s=0;s<a.length;s++)a[s].plot(t);return e.redrawReglTraces(t),r.style(t),n.getComponentMethod(`selections`,`draw`)(t),n.getComponentMethod(`shapes`,`draw`)(t),n.getComponentMethod(`annotations`,`draw`)(t),n.getComponentMethod(`images`,`draw`)(t),i._replotting=!1,r.previousPromises(t)},e.redrawReglTraces=function(e){var t=e._fullLayout;if(t._has(`regl`)){var n=e._fullData,r=[],a=[],o,s;for(t._hasOnlyLargeSploms&&t._splomGrid.draw(),o=0;o<n.length;o++){var c=n[o];c.visible===!0&&c._length!==0&&(c.type===`splom`?t._splomScenes[c.uid].draw():c.type===`scattergl`?i.pushUnique(r,c.xaxis+c.yaxis):c.type===`scatterpolargl`&&i.pushUnique(a,c.subplot))}for(o=0;o<r.length;o++)s=t._plots[r[o]],s._scene&&s._scene.draw();for(o=0;o<a.length;o++)s=t[a[o]]._subplot,s._scene&&s._scene.draw()}},e.doAutoRangeAndConstraints=function(e){for(var t=d.list(e,``,!0),n,r={},i=0;i<t.length;i++)if(n=t[i],!r[n._id]){r[n._id]=1,h(e,n),g(e,n);var a=n._matchGroup;if(a)for(var o in a)g(e,d.getFromId(e,o),n.range),r[o]=1}m(e)},e.finalDraw=function(e){n.getComponentMethod(`rangeslider`,`draw`)(e),n.getComponentMethod(`rangeselector`,`draw`)(e)},e.drawMarginPushers=function(e){n.getComponentMethod(`legend`,`draw`)(e),n.getComponentMethod(`rangeselector`,`draw`)(e),n.getComponentMethod(`sliders`,`draw`)(e),n.getComponentMethod(`updatemenus`,`draw`)(e),n.getComponentMethod(`colorbar`,`draw`)(e)}}),sr=h((e,t)=>{var n=Un().readPaths,r=Yn(),i=St().clearOutlineControllers,a=q(),o=tn(),s=yt().arrayEditor,c=qn(),l=c.getPathString;t.exports={draw:u,drawOne:f,activateLastSelection:h};function u(e){var t=e._fullLayout;for(var n in i(e),t._selectionLayer.selectAll(`path`).remove(),t._plots){var r=t._plots[n].selectionLayer;r&&r.selectAll(`path`).remove()}for(var a=0;a<t.selections.length;a++)f(e,a)}function d(e){return e._context.editSelection}function f(e,t){e._fullLayout._paperdiv.selectAll(`.selectionlayer [data-index="`+t+`"]`).remove();var i=c.makeSelectionsOptionsAndPlotinfo(e,t),u=i.options,f=i.plotinfo;if(!u._input)return;h(e._fullLayout._selectionLayer);function h(i){var c=l(e,u),h={"data-index":t,"fill-rule":`evenodd`,d:c},g=u.opacity,_=`rgba(0,0,0,0)`,v=u.line.color||a.contrast(e._fullLayout.plot_bgcolor),y=u.line.width,b=u.line.dash;y||(y=5,b=`solid`);var x=d(e)&&e._fullLayout._activeSelectionIndex===t;x&&(_=e._fullLayout.activeselection.fillcolor,g=e._fullLayout.activeselection.opacity);for(var S=[],C=1;C>=0;C--){var w=i.append(`path`).attr(h).style(`opacity`,C?.1:g).call(a.stroke,v).call(a.fill,_).call(o.dashLine,C?`solid`:b,C?4+y:y);if(p(w,e,u),x){var T=s(e.layout,`selections`,u);w.style({cursor:`move`});var E={element:w.node(),plotinfo:f,gd:e,editHelpers:T,isActiveSelection:!0};r(n(c,e),w,E)}else w.style(`pointer-events`,C?`all`:`none`);S[C]=w}var D=S[0];S[1].node().addEventListener(`click`,function(){return m(e,D)})}}function p(e,t,n){var r=n.xref+n.yref;o.setClipUrl(e,`clip`+t._fullLayout._uid+r,t)}function m(e,t){if(d(e)){var n=+t.node().getAttribute(`data-index`);if(n>=0){if(n===e._fullLayout._activeSelectionIndex){g(e);return}e._fullLayout._activeSelectionIndex=n,e._fullLayout._deactivateSelection=g,u(e)}}}function h(e){if(d(e)){var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=g,u(e)}}function g(e){d(e)&&e._fullLayout._activeSelectionIndex>=0&&(i(e),delete e._fullLayout._activeSelectionIndex,u(e))}}),cr=h((e,t)=>{function n(){var e,t=0,n=!1;function r(t,n){return e.list.push({type:t,data:n?JSON.parse(JSON.stringify(n)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return r(`check`,{seg1:e,seg2:t})},segmentChop:function(e,t){return r(`div_seg`,{seg:e,pt:t}),r(`chop`,{seg:e,pt:t})},statusRemove:function(e){return r(`pop_seg`,{seg:e})},segmentUpdate:function(e){return r(`seg_update`,{seg:e})},segmentNew:function(e,t){return r(`new_seg`,{seg:e,primary:t})},segmentRemove:function(e){return r(`rem_seg`,{seg:e})},tempStatus:function(e,t,n){return r(`temp_status`,{seg:e,above:t,below:n})},rewind:function(e){return r(`rewind`,{seg:e})},status:function(e,t,n){return r(`status`,{seg:e,above:t,below:n})},vert:function(t){return t===n?e:(n=t,r(`vert`,{x:t}))},log:function(e){return typeof e!=`string`&&(e=JSON.stringify(e,!1,` `)),r(`log`,{txt:e})},reset:function(){return r(`reset`)},selected:function(e){return r(`selected`,{segs:e})},chainStart:function(e){return r(`chain_start`,{seg:e})},chainRemoveHead:function(e,t){return r(`chain_rem_head`,{index:e,pt:t})},chainRemoveTail:function(e,t){return r(`chain_rem_tail`,{index:e,pt:t})},chainNew:function(e,t){return r(`chain_new`,{pt1:e,pt2:t})},chainMatch:function(e){return r(`chain_match`,{index:e})},chainClose:function(e){return r(`chain_close`,{index:e})},chainAddHead:function(e,t){return r(`chain_add_head`,{index:e,pt:t})},chainAddTail:function(e,t){return r(`chain_add_tail`,{index:e,pt:t})},chainConnect:function(e,t){return r(`chain_con`,{index1:e,index2:t})},chainReverse:function(e){return r(`chain_rev`,{index:e})},chainJoin:function(e,t){return r(`chain_join`,{index1:e,index2:t})},done:function(){return r(`done`)}},e}t.exports=n}),lr=h((e,t)=>{function n(e){typeof e!=`number`&&(e=1e-10);var t={epsilon:function(t){return typeof t==`number`&&(e=t),e},pointAboveOrOnLine:function(t,n,r){var i=n[0],a=n[1],o=r[0],s=r[1],c=t[0],l=t[1];return(o-i)*(l-a)-(s-a)*(c-i)>=-e},pointBetween:function(t,n,r){var i=t[1]-n[1],a=r[0]-n[0],o=t[0]-n[0],s=r[1]-n[1],c=o*a+i*s;return c<e?!1:!(c-(a*a+s*s)>-e)},pointsSameX:function(t,n){return Math.abs(t[0]-n[0])<e},pointsSameY:function(t,n){return Math.abs(t[1]-n[1])<e},pointsSame:function(e,n){return t.pointsSameX(e,n)&&t.pointsSameY(e,n)},pointsCompare:function(e,n){return t.pointsSameX(e,n)?t.pointsSameY(e,n)?0:e[1]<n[1]?-1:1:e[0]<n[0]?-1:1},pointsCollinear:function(t,n,r){var i=t[0]-n[0],a=t[1]-n[1],o=n[0]-r[0],s=n[1]-r[1];return Math.abs(i*s-o*a)<e},linesIntersect:function(t,n,r,i){var a=n[0]-t[0],o=n[1]-t[1],s=i[0]-r[0],c=i[1]-r[1],l=a*c-o*s;if(Math.abs(l)<e)return!1;var u=t[0]-r[0],d=t[1]-r[1],f=(s*d-c*u)/l,p=(a*d-o*u)/l,m={alongA:0,alongB:0,pt:[t[0]+f*a,t[1]+f*o]};return f<=-e?m.alongA=-2:f<e?m.alongA=-1:f-1<=-e?m.alongA=0:f-1<e?m.alongA=1:m.alongA=2,p<=-e?m.alongB=-2:p<e?m.alongB=-1:p-1<=-e?m.alongB=0:p-1<e?m.alongB=1:m.alongB=2,m},pointInsideRegion:function(t,n){for(var r=t[0],i=t[1],a=n[n.length-1][0],o=n[n.length-1][1],s=!1,c=0;c<n.length;c++){var l=n[c][0],u=n[c][1];u-i>e!=o-i>e&&(a-l)*(i-u)/(o-u)+l-r>e&&(s=!s),a=l,o=u}return s}};return t}t.exports=n}),ur=h((e,t)=>{t.exports={create:function(){var e={root:{root:!0,next:null},exists:function(t){return!(t===null||t===e.root)},isEmpty:function(){return e.root.next===null},getHead:function(){return e.root.next},insertBefore:function(t,n){for(var r=e.root,i=e.root.next;i!==null;){if(n(i)){t.prev=i.prev,t.next=i,i.prev.next=t,i.prev=t;return}r=i,i=i.next}r.next=t,t.prev=r,t.next=null},findTransition:function(t){for(var n=e.root,r=e.root.next;r!==null&&!t(r);)n=r,r=r.next;return{before:n===e.root?null:n,after:r,insert:function(e){return e.prev=n,e.next=r,n.next=e,r!==null&&(r.prev=e),e}}}};return e},node:function(e){return e.prev=null,e.next=null,e.remove=function(){e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.prev=null,e.next=null},e}}}),dr=h((e,t)=>{var n=ur();function r(e,t,r){function i(e,t){return{id:r?r.segmentId():-1,start:e,end:t,myFill:{above:null,below:null},otherFill:null}}function a(e,t,n){return{id:r?r.segmentId():-1,start:e,end:t,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var o=n.create();function s(e,n,r,i,a,o){var s=t.pointsCompare(n,a);return s===0?t.pointsSame(r,o)?0:e===i?t.pointAboveOrOnLine(r,i?a:o,i?o:a)?1:-1:e?1:-1:s}function c(e,t){o.insertBefore(e,function(n){return s(e.isStart,e.pt,t,n.isStart,n.pt,n.other.pt)<0})}function l(e,t){var r=n.node({isStart:!0,pt:e.start,seg:e,primary:t,other:null,status:null});return c(r,e.end),r}function u(e,t,r){var i=n.node({isStart:!1,pt:t.end,seg:t,primary:r,other:e,status:null});e.other=i,c(i,e.pt)}function d(e,t){var n=l(e,t);return u(n,e,t),n}function f(e,t){r&&r.segmentChop(e.seg,t),e.other.remove(),e.seg.end=t,e.other.pt=t,c(e.other,e.pt)}function p(e,t){var n=a(t,e.seg.end,e.seg);return f(e,t),d(n,e.primary)}function m(i,a){var s=n.create();function c(e,n){var r=e.seg.start,i=e.seg.end,a=n.seg.start,o=n.seg.end;return t.pointsCollinear(r,a,o)?t.pointsCollinear(i,a,o)||t.pointAboveOrOnLine(i,a,o)?1:-1:t.pointAboveOrOnLine(r,a,o)?1:-1}function l(e){return s.findTransition(function(t){return c(e,t.ev)>0})}function u(e,n){var i=e.seg,a=n.seg,o=i.start,s=i.end,c=a.start,l=a.end;r&&r.checkIntersection(i,a);var u=t.linesIntersect(o,s,c,l);if(u===!1){if(!t.pointsCollinear(o,s,c)||t.pointsSame(o,l)||t.pointsSame(s,c))return!1;var d=t.pointsSame(o,c),f=t.pointsSame(s,l);if(d&&f)return n;var m=!d&&t.pointBetween(o,c,l),h=!f&&t.pointBetween(s,c,l);if(d)return h?p(n,s):p(e,l),n;m&&(f||(h?p(n,s):p(e,l)),p(n,o))}else u.alongA===0&&(u.alongB===-1?p(e,c):u.alongB===0?p(e,u.pt):u.alongB===1&&p(e,l)),u.alongB===0&&(u.alongA===-1?p(n,o):u.alongA===0?p(n,u.pt):u.alongA===1&&p(n,s));return!1}for(var d=[];!o.isEmpty();){var f=o.getHead();if(r&&r.vert(f.pt[0]),f.isStart){let t=function(){if(h){var e=u(f,h);if(e)return e}return g?u(f,g):!1};r&&r.segmentNew(f.seg,f.primary);var m=l(f),h=m.before?m.before.ev:null,g=m.after?m.after.ev:null;r&&r.tempStatus(f.seg,h?h.seg:!1,g?g.seg:!1);var _=t();if(_){if(e){var v=f.seg.myFill.below===null?!0:f.seg.myFill.above!==f.seg.myFill.below;v&&(_.seg.myFill.above=!_.seg.myFill.above)}else _.seg.otherFill=f.seg.myFill;r&&r.segmentUpdate(_.seg),f.other.remove(),f.remove()}if(o.getHead()!==f){r&&r.rewind(f.seg);continue}if(e){var v=f.seg.myFill.below===null?!0:f.seg.myFill.above!==f.seg.myFill.below;g?f.seg.myFill.below=g.seg.myFill.above:f.seg.myFill.below=i,v?f.seg.myFill.above=!f.seg.myFill.below:f.seg.myFill.above=f.seg.myFill.below}else if(f.seg.otherFill===null){var y=g?f.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:f.primary?a:i;f.seg.otherFill={above:y,below:y}}r&&r.status(f.seg,h?h.seg:!1,g?g.seg:!1),f.other.status=m.insert(n.node({ev:f}))}else{var b=f.status;if(b===null)throw Error(`PolyBool: Zero-length segment detected; your epsilon is probably too small or too large`);if(s.exists(b.prev)&&s.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!f.primary){var x=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=x}d.push(f.seg)}o.getHead().remove()}return r&&r.done(),d}return e?{addRegion:function(e){for(var n,r=e[e.length-1],a=0;a<e.length;a++){n=r,r=e[a];var o=t.pointsCompare(n,r);o!==0&&d(i(o<0?n:r,o<0?r:n),!0)}},calculate:function(e){return m(e,!1)}}:{calculate:function(e,t,n,r){return e.forEach(function(e){d(a(e.start,e.end,e),!0)}),n.forEach(function(e){d(a(e.start,e.end,e),!1)}),m(t,r)}}}t.exports=r}),fr=h((e,t)=>{function n(e,t,n){var r=[],i=[];return e.forEach(function(e){var a=e.start,o=e.end;if(t.pointsSame(a,o)){console.warn(`PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large`);return}n&&n.chainStart(e);var s={index:0,matches_head:!1,matches_pt1:!1},c={index:0,matches_head:!1,matches_pt1:!1},l=s;function u(e,t,n){return l.index=e,l.matches_head=t,l.matches_pt1=n,l===s?(l=c,!1):(l=null,!0)}for(var d=0;d<r.length;d++){var f=r[d],p=f[0];f[1];var m=f[f.length-1];if(f[f.length-2],t.pointsSame(p,a)){if(u(d,!0,!0))break}else if(t.pointsSame(p,o)){if(u(d,!0,!1))break}else if(t.pointsSame(m,a)){if(u(d,!1,!0))break}else if(t.pointsSame(m,o)&&u(d,!1,!1))break}if(l===s){r.push([a,o]),n&&n.chainNew(a,o);return}if(l===c){n&&n.chainMatch(s.index);var h=s.index,g=s.matches_pt1?o:a,_=s.matches_head,f=r[h],v=_?f[0]:f[f.length-1],y=_?f[1]:f[f.length-2],b=_?f[f.length-1]:f[0],x=_?f[f.length-2]:f[1];if(t.pointsCollinear(y,v,g)&&(_?(n&&n.chainRemoveHead(s.index,g),f.shift()):(n&&n.chainRemoveTail(s.index,g),f.pop()),v=y),t.pointsSame(b,g)){r.splice(h,1),t.pointsCollinear(x,b,v)&&(_?(n&&n.chainRemoveTail(s.index,v),f.pop()):(n&&n.chainRemoveHead(s.index,v),f.shift())),n&&n.chainClose(s.index),i.push(f);return}_?(n&&n.chainAddHead(s.index,g),f.unshift(g)):(n&&n.chainAddTail(s.index,g),f.push(g));return}function S(e){n&&n.chainReverse(e),r[e].reverse()}function C(e,i){var a=r[e],o=r[i],s=a[a.length-1],c=a[a.length-2],l=o[0],u=o[1];t.pointsCollinear(c,s,l)&&(n&&n.chainRemoveTail(e,s),a.pop(),s=c),t.pointsCollinear(s,l,u)&&(n&&n.chainRemoveHead(i,l),o.shift()),n&&n.chainJoin(e,i),r[e]=a.concat(o),r.splice(i,1)}var w=s.index,T=c.index;n&&n.chainConnect(w,T);var E=r[w].length<r[T].length;s.matches_head?c.matches_head?E?(S(w),C(w,T)):(S(T),C(T,w)):C(T,w):c.matches_head?C(w,T):E?(S(w),C(T,w)):(S(T),C(w,T))}),i}t.exports=n}),pr=h((e,t)=>{function n(e,t,n){var r=[];return e.forEach(function(e){var i=(e.myFill.above?8:0)+(e.myFill.below?4:0)+(e.otherFill&&e.otherFill.above?2:0)+(e.otherFill&&e.otherFill.below?1:0);t[i]!==0&&r.push({id:n?n.segmentId():-1,start:e.start,end:e.end,myFill:{above:t[i]===1,below:t[i]===2},otherFill:null})}),n&&n.selected(r),r}t.exports={union:function(e,t){return n(e,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],t)},intersect:function(e,t){return n(e,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],t)},difference:function(e,t){return n(e,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],t)},differenceRev:function(e,t){return n(e,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],t)},xor:function(e,t){return n(e,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],t)}}}),mr=h((e,t)=>{t.exports={toPolygon:function(e,t){function n(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function n(t){var n=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[n]})}for(var r=n(t[0]),i=1;i<t.length;i++)r=e.selectDifference(e.combine(r,n(t[i])));return r}if(t.type===`Polygon`)return e.polygon(n(t.coordinates));if(t.type===`MultiPolygon`){for(var r=e.segments({inverted:!1,regions:[]}),i=0;i<t.coordinates.length;i++)r=e.selectUnion(e.combine(r,n(t.coordinates[i])));return e.polygon(r)}throw Error(`PolyBool: Cannot convert GeoJSON object to PolyBool polygon`)},fromPolygon:function(e,t,n){n=e.polygon(e.segments(n));function r(e,n){return t.pointInsideRegion([(e[0][0]+e[1][0])*.5,(e[0][1]+e[1][1])*.5],n)}function i(e){return{region:e,children:[]}}var a=i(null);function o(e,t){for(var n=0;n<e.children.length;n++){var a=e.children[n];if(r(t,a.region)){o(a,t);return}}for(var s=i(t),n=0;n<e.children.length;n++){var a=e.children[n];r(a.region,t)&&(s.children.push(a),e.children.splice(n,1),n--)}e.children.push(s)}for(var s=0;s<n.regions.length;s++){var c=n.regions[s];c.length<3||o(a,c)}function l(e,t){for(var n=0,r=e[e.length-1][0],i=e[e.length-1][1],a=[],o=0;o<e.length;o++){var s=e[o][0],c=e[o][1];a.push([s,c]),n+=c*r-s*i,r=s,i=c}return n<0!==t&&a.reverse(),a.push([a[0][0],a[0][1]]),a}var u=[];function d(e){var t=[l(e.region,!1)];u.push(t);for(var n=0;n<e.children.length;n++)t.push(f(e.children[n]))}function f(e){for(var t=0;t<e.children.length;t++)d(e.children[t]);return l(e.region,!0)}for(var s=0;s<a.children.length;s++)d(a.children[s]);return u.length<=0?{type:`Polygon`,coordinates:[]}:u.length==1?{type:`Polygon`,coordinates:u[0]}:{type:`MultiPolygon`,coordinates:u}}}}),hr=h((e,t)=>{var n=cr(),r=lr(),i=dr(),a=fr(),o=pr(),s=mr(),c=!1,l=r(),u={buildLog:function(e){return e===!0?c=n():e===!1&&(c=!1),c===!1?!1:c.list},epsilon:function(e){return l.epsilon(e)},segments:function(e){var t=i(!0,l,c);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:i(!1,l,c).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:o.union(e.combined,c),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:o.intersect(e.combined,c),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:o.difference(e.combined,c),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:o.differenceRev(e.combined,c),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:o.xor(e.combined,c),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:a(e.segments,l,c),inverted:e.inverted}},polygonFromGeoJSON:function(e){return s.toPolygon(u,e)},polygonToGeoJSON:function(e){return s.fromPolygon(u,l,e)},union:function(e,t){return d(e,t,u.selectUnion)},intersect:function(e,t){return d(e,t,u.selectIntersect)},difference:function(e,t){return d(e,t,u.selectDifference)},differenceRev:function(e,t){return d(e,t,u.selectDifferenceRev)},xor:function(e,t){return d(e,t,u.selectXor)}};function d(e,t,n){var r=u.segments(e),i=u.segments(t),a=n(u.combine(r,i));return u.polygon(a)}typeof window==`object`&&(window.PolyBool=u),t.exports=u}),gr=h((e,t)=>{t.exports=function(e,t,n,r){var i=e[0],a=e[1],o=!1;n===void 0&&(n=0),r===void 0&&(r=t.length);for(var s=r-n,c=0,l=s-1;c<s;l=c++){var u=t[c+n][0],d=t[c+n][1],f=t[l+n][0],p=t[l+n][1];d>a!=p>a&&i<(f-u)*(a-d)/(p-d)+u&&(o=!o)}return o}}),_r=h((e,t)=>{var n=Ne().dot,r=O().BADNUM,i=t.exports={};i.tester=function(e){var t=e.slice(),n=t[0][0],i=n,a=t[0][1],o=a,s;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),s=1;s<t.length;s++)n=Math.min(n,t[s][0]),i=Math.max(i,t[s][0]),a=Math.min(a,t[s][1]),o=Math.max(o,t[s][1]);var c=!1,l;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]&&(c=!0,l=function(e){return e[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]&&(c=!0,l=function(e){return e[1]===t[0][1]}));function u(e,t){var s=e[0],c=e[1];return!(s===r||s<n||s>i||c===r||c<a||c>o||t&&l(e))}function d(e,s){var c=e[0],l=e[1];if(c===r||c<n||c>i||l===r||l<a||l>o)return!1;var u=t.length,d=t[0][0],f=t[0][1],p=0,m,h,g,_,v;for(m=1;m<u;m++)if(h=d,g=f,d=t[m][0],f=t[m][1],_=Math.min(h,d),!(c<_||c>Math.max(h,d)||l>Math.max(g,f)))if(l<Math.min(g,f))c!==_&&p++;else{if(v=d===h?l:g+(c-h)*(f-g)/(d-h),l===v)return!(m===1&&s);l<=v&&c!==_&&p++}return p%2==1}var f=!0,p=t[0];for(s=1;s<t.length;s++)if(p[0]!==t[s][0]||p[1]!==t[s][1]){f=!1;break}return{xmin:n,xmax:i,ymin:a,ymax:o,pts:t,contains:c?u:d,isRect:c,degenerate:f}},i.isSegmentBent=function(e,t,r,i){var a=e[t],o=[e[r][0]-a[0],e[r][1]-a[1]],s=n(o,o),c=Math.sqrt(s),l=[-o[1]/c,o[0]/c],u,d,f;for(u=t+1;u<r;u++)if(d=[e[u][0]-a[0],e[u][1]-a[1]],f=n(d,o),f<0||f>s||Math.abs(n(d,l))>i)return!0;return!1},i.filter=function(e,t){var n=[e[0]],r=0,a=0;function o(o){e.push(o);var s=n.length,c=r;n.splice(a+1);for(var l=c+1;l<e.length;l++)(l===e.length-1||i.isSegmentBent(e,c,l+1,t))&&(n.push(e[l]),n.length<s-2&&(r=l,a=n.length-1),c=l)}return e.length>1&&o(e.pop()),{addPt:o,raw:e,filtered:n}}}),vr=h((e,t)=>{t.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:`-select`}}),yr=h((e,t)=>{var n=hr(),r=gr(),i=Ke(),a=tn().dashStyle,o=q(),s=Ln(),c=Qt().makeEventData,l=Rn(),u=l.freeMode,d=l.rectMode,f=l.drawMode,p=l.openMode,m=l.selectMode,h=qn(),g=Kn(),_=Yn(),v=St().clearOutline,y=Un(),b=y.handleEllipse,x=y.readPaths,S=Wn().newShapes,C=Gn(),w=sr().activateLastSelection,T=$(),E=T.sorterAsc,D=_r(),O=tt(),k=xt().getFromId,A=zn(),j=or().redrawReglTraces,M=vr(),N=M.MINSELECT,P=D.filter,F=D.tester,I=Hn(),L=I.p2r,R=I.axValue,z=I.getTransform;function B(e){return e.subplot!==void 0}function V(e,t,n,r,c){var l=!B(r),h=u(c),g=d(c),v=p(c),y=f(c),x=m(c),S=c===`drawline`,C=c===`drawcircle`,w=S||C,E=r.gd,D=E._fullLayout,k=x&&D.newselection.mode===`immediate`&&l,A=D._zoomlayer,j=r.element.getBoundingClientRect(),I=r.plotinfo,L=z(I),R=t-j.left,V=n-j.top;D._calcInverseTransform(E);var U=T.apply3DTransform(D._invTransform)(R,V);R=U[0],V=U[1];var W=D._invScaleX,G=D._invScaleY,q=R,Y=V,X=`M`+R+`,`+V,Q=r.xaxes[0],te=r.yaxes[0],ne=Q._length,re=te._length,ie=e.altKey&&!(f(c)&&v),ae,oe,ce,ue,me,he,_e;J(e,E,r),h&&(ae=P([[R,V]],M.BENDPX));var ve=A.selectAll(`path.select-outline-`+I.id).data([1]),ye=y?D.newshape:D.newselection;y&&(r.hasText=ye.label.text||ye.label.texttemplate);var be=y&&!v?ye.fillcolor:`rgba(0,0,0,0)`,Se=ye.line.color||(l?o.contrast(E._fullLayout.plot_bgcolor):`#7f7f7f`);ve.enter().append(`path`).attr(`class`,`select-outline select-outline-`+I.id).style({opacity:y?ye.opacity/2:1,"stroke-dasharray":a(ye.line.dash,ye.line.width),"stroke-width":ye.line.width+`px`,"shape-rendering":`crispEdges`}).call(o.stroke,Se).call(o.fill,be).attr(`fill-rule`,`evenodd`).classed(`cursor-move`,!!y).attr(`transform`,L).attr(`d`,X+`Z`);var Ce=A.append(`path`).attr(`class`,`zoombox-corners`).style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr(`transform`,L).attr(`d`,`M0,0Z`);if(y&&r.hasText){var Oe=A.select(`.label-temp`);Oe.empty()&&(Oe=A.append(`g`).classed(`label-temp`,!0).classed(`select-outline`,!0).style({opacity:.8}))}var ke=D._uid+M.SELECTID,Ae=[],je=ee(E,r.xaxes,r.yaxes,r.subplot);k&&!e.shiftKey&&(r._clearSubplotSelections=function(){if(l){var e=Q._id,t=te._id;ge(E,e,t,je);for(var n=(E.layout||{}).selections||[],r=[],a=!1,o=0;o<n.length;o++){var s=D.selections[o];!s||s.xref!==e||s.yref!==t?r.push(n[o]):a=!0}a&&(E._fullLayout._noEmitSelectedAtStart=!0,i.call(`_guiRelayout`,E,{selections:r}))}});var Me=we(r);r.moveFn=function(e,t){r._clearSubplotSelections&&=(r._clearSubplotSelections(),void 0),q=Math.max(0,Math.min(ne,W*e+R)),Y=Math.max(0,Math.min(re,G*t+V));var n=Math.abs(q-R),i=Math.abs(Y-V);if(g){var a,o,s;if(x){var c=D.selectdirection;switch(a=c===`any`?i<Math.min(n*.6,N)?`h`:n<Math.min(i*.6,N)?`v`:`d`:c,a){case`h`:o=C?re/2:0,s=re;break;case`v`:o=C?ne/2:0,s=ne;break}}if(y)switch(D.newshape.drawdirection){case`vertical`:a=`h`,o=C?re/2:0,s=re;break;case`horizontal`:a=`v`,o=C?ne/2:0,s=ne;break;case`ortho`:n<i?(a=`h`,o=V,s=Y):(a=`v`,o=R,s=q);break;default:a=`d`}a===`h`?(ue=w?b(C,[q,o],[q,s]):[[R,o],[R,s],[q,s],[q,o]],ue.xmin=w?q:Math.min(R,q),ue.xmax=w?q:Math.max(R,q),ue.ymin=Math.min(o,s),ue.ymax=Math.max(o,s),Ce.attr(`d`,`M`+ue.xmin+`,`+(V-N)+`h-4v`+2*N+`h4ZM`+(ue.xmax-1)+`,`+(V-N)+`h4v`+2*N+`h-4Z`)):a===`v`?(ue=w?b(C,[o,Y],[s,Y]):[[o,V],[o,Y],[s,Y],[s,V]],ue.xmin=Math.min(o,s),ue.xmax=Math.max(o,s),ue.ymin=w?Y:Math.min(V,Y),ue.ymax=w?Y:Math.max(V,Y),Ce.attr(`d`,`M`+(R-N)+`,`+ue.ymin+`v-4h`+2*N+`v4ZM`+(R-N)+`,`+(ue.ymax-1)+`v4h`+2*N+`v-4Z`)):a===`d`&&(ue=w?b(C,[R,V],[q,Y]):[[R,V],[R,Y],[q,Y],[q,V]],ue.xmin=Math.min(R,q),ue.xmax=Math.max(R,q),ue.ymin=Math.min(V,Y),ue.ymax=Math.max(V,Y),Ce.attr(`d`,`M0,0Z`))}else h&&(ae.addPt([q,Y]),ue=ae.filtered);if(r.selectionDefs&&r.selectionDefs.length?(ce=le(r.mergedPolygons,ue,ie),ue.subtract=ie,oe=K(r.selectionDefs.concat([ue]))):(ce=[ue],oe=F(ue)),_(de(ce,v),ve,r),x){var l=pe(E,!1),u=l.eventData?l.eventData.points.slice():[];l=pe(E,!1,oe,je,r),oe=l.selectionTesters,_e=l.eventData;var d=ae?ae.filtered:xe(ce);O.throttle(ke,M.SELECTDELAY,function(){Ae=fe(oe,je);for(var e=Ae.slice(),t=0;t<u.length;t++){for(var n=u[t],r=!1,i=0;i<e.length;i++)if(e[i].curveNumber===n.curveNumber&&e[i].pointNumber===n.pointNumber){r=!0;break}r||e.push(n)}e.length&&(_e||={},_e.points=e),Me(_e,d),Te(E,_e)})}},r.clickFn=function(e,t){if(Ce.remove(),E._fullLayout._activeShapeIndex>=0){E._fullLayout._deactivateShape(E);return}if(!y){var n=D.clickmode;O.done(ke).then(function(){if(O.clear(ke),e===2){for(ve.remove(),me=0;me<je.length;me++)he=je[me],he._module.selectPoints(he,!1);if(se(E,je),Z(r),De(E),je.length){var a=je[0].xaxis,o=je[0].yaxis;if(a&&o){for(var c=[],l=E._fullLayout.selections,u=0;u<l.length;u++){var d=l[u];d&&(d.xref!==a._id||d.yref!==o._id)&&c.push(d)}c.length<l.length&&(E._fullLayout._noEmitSelectedAtStart=!0,i.call(`_guiRelayout`,E,{selections:c}))}}}else n.indexOf(`select`)>-1&&H(t,E,r.xaxes,r.yaxes,r.subplot,r,ve),n===`event`&&Ee(E,void 0);s.click(E,t,I.id)}).catch(T.error)}},r.doneFn=function(){Ce.remove(),O.done(ke).then(function(){O.clear(ke),!k&&ue&&r.selectionDefs&&(ue.subtract=ie,r.selectionDefs.push(ue),r.mergedPolygons.length=0,[].push.apply(r.mergedPolygons,ce)),(k||y)&&Z(r,k),r.doneFnCompleted&&r.doneFnCompleted(Ae),x&&Ee(E,_e)}).catch(T.error)}}function H(e,t,n,r,i,a,o){var s=t._hoverdata,c=t._fullLayout.clickmode.indexOf(`event`)>-1,l=[],u,d,f,m,h,g,v,y,b,x;if(ne(s)){J(e,t,a),u=ee(t,n,r,i);var S=re(s,u);if(S.pointNumbers.length>0?ae(u,S):oe(u)&&(v=ie(S))){for(o&&o.remove(),x=0;x<u.length;x++)d=u[x],d._module.selectPoints(d,!1);se(t,u),Z(a),c&&De(t)}else{for(y=e.shiftKey&&(v===void 0?ie(S):v),f=U(S.pointNumber,S.searchInfo,y),m=K(a.selectionDefs.concat([f]),m),x=0;x<u.length;x++)if(h=u[x]._module.selectPoints(u[x],m),g=ue(h,u[x]),l.length)for(var C=0;C<g.length;C++)l.push(g[C]);else l=g;if(b={points:l},se(t,u,b),f&&a&&a.selectionDefs.push(f),o){var w=a.mergedPolygons;_(de(w,p(a.dragmode)),o,a)}c&&Ee(t,b)}}}function U(e,t,n){return{pointNumber:e,searchInfo:t,subtract:!!n}}function W(e){return`pointNumber`in e&&`searchInfo`in e}function G(e){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(t,n,r,i){var a=e.searchInfo.cd[0].trace.index;return i.cd[0].trace.index===a&&r===e.pointNumber},isRect:!1,degenerate:!1,subtract:!!e.subtract}}function K(e){if(!e.length)return;for(var t=[],n=W(e[0])?0:e[0][0][0],r=n,i=W(e[0])?0:e[0][0][1],a=i,o=0;o<e.length;o++)if(W(e[o]))t.push(G(e[o]));else{var s=F(e[o]);s.subtract=!!e[o].subtract,t.push(s),n=Math.min(n,s.xmin),r=Math.max(r,s.xmax),i=Math.min(i,s.ymin),a=Math.max(a,s.ymax)}function c(e,n,r,i){for(var a=!1,o=0;o<t.length;o++)t[o].contains(e,n,r,i)&&(a=!t[o].subtract);return a}return{xmin:n,xmax:r,ymin:i,ymax:a,pts:[],contains:c,isRect:!1,degenerate:!1}}function J(e,t,n){var r=t._fullLayout,i=n.plotinfo,a=n.dragmode,o=r._lastSelectedSubplot&&r._lastSelectedSubplot===i.id,s=(e.shiftKey||e.altKey)&&!(f(a)&&p(a));o&&s&&i.selection&&i.selection.selectionDefs&&!n.selectionDefs?(n.selectionDefs=i.selection.selectionDefs,n.mergedPolygons=i.selection.mergedPolygons):(!s||!i.selection)&&Z(n),o||(v(t),r._lastSelectedSubplot=i.id)}function Y(e){return e._fullLayout._activeShapeIndex>=0}function X(e){return e._fullLayout._activeSelectionIndex>=0}function Z(e,t){var n=e.dragmode,r=e.plotinfo,a=e.gd;Y(a)&&a._fullLayout._deactivateShape(a),X(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,s=f(n),c=m(n);if(s||c){var l=o.selectAll(`.select-outline-`+r.id);if(l&&a._fullLayout._outlining){var u;s&&(u=S(l,e)),u&&i.call(`_guiRelayout`,a,{shapes:u});var d;c&&!B(e)&&(d=C(l,e)),d&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call(`_guiRelayout`,a,{selections:d}).then(function(){t&&w(a)})),a._fullLayout._outlining=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function Q(e){return e._id}function ee(e,t,n,r){if(!e.calcdata)return[];var i=[],a=t.map(Q),o=n.map(Q),s,c,l;for(l=0;l<e.calcdata.length;l++)if(s=e.calcdata[l],c=s[0].trace,!(c.visible!==!0||!c._module||!c._module.selectPoints))if(B({subplot:r})&&(c.subplot===r||c.geo===r))i.push(te(c._module,s,t[0],n[0]));else if(c.type===`splom`){if(c._xaxes[a[0]]&&c._yaxes[o[0]]){var u=te(c._module,s,t[0],n[0]);u.scene=e._fullLayout._splomScenes[c.uid],i.push(u)}}else if(c.type===`sankey`){var d=te(c._module,s,t[0],n[0]);i.push(d)}else{if(a.indexOf(c.xaxis)===-1&&(!c._xA||!c._xA.overlaying)||o.indexOf(c.yaxis)===-1&&(!c._yA||!c._yA.overlaying))continue;i.push(te(c._module,s,k(e,c.xaxis),k(e,c.yaxis)))}return i}function te(e,t,n,r){return{_module:e,cd:t,xaxis:n,yaxis:r}}function ne(e){return e&&Array.isArray(e)&&e[0].hoverOnBox!==!0}function re(e,t){var n=e[0],r=-1,i=[],a,o;for(o=0;o<t.length;o++)if(a=t[o],n.fullData.index===a.cd[0].trace.index){if(n.hoverOnBox===!0)break;n.pointNumber===void 0?n.binNumber!==void 0&&(r=n.binNumber,i=n.pointNumbers):r=n.pointNumber;break}return{pointNumber:r,pointNumbers:i,searchInfo:a}}function ie(e){var t=e.searchInfo.cd[0].trace,n=e.pointNumber,r=e.pointNumbers,i=r.length>0?r[0]:n;return t.selectedpoints?t.selectedpoints.indexOf(i)>-1:!1}function ae(e,t){var n=[],r,i,a,o;for(o=0;o<e.length;o++)r=e[o],r.cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&n.push(r);if(n.length===1&&(a=n[0]===t.searchInfo,a&&(i=t.searchInfo.cd[0].trace,i.selectedpoints.length===t.pointNumbers.length))){for(o=0;o<t.pointNumbers.length;o++)if(i.selectedpoints.indexOf(t.pointNumbers[o])<0)return!1;return!0}return!1}function oe(e){var t=0,n,r,i;for(i=0;i<e.length;i++)if(n=e[i],r=n.cd[0].trace,r.selectedpoints&&(r.selectedpoints.length>1||(t+=r.selectedpoints.length,t>1)))return!1;return t===1}function se(e,t,n){var r;for(r=0;r<t.length;r++){var i=t[r].cd[0].trace._fullInput,a=e._fullLayout._tracePreGUI[i.uid]||{};a.selectedpoints===void 0&&(a.selectedpoints=i._input.selectedpoints||null)}var o;if(n){var s=n.points||[];for(r=0;r<t.length;r++)o=t[r].cd[0].trace,o._input.selectedpoints=o._fullInput.selectedpoints=[],o._fullInput!==o&&(o.selectedpoints=[]);for(var c=0;c<s.length;c++){var l=s[c],u=l.data,d=l.fullData,f=l.pointIndex,p=l.pointIndices;p?([].push.apply(u.selectedpoints,p),o._fullInput!==o&&[].push.apply(d.selectedpoints,p)):(u.selectedpoints.push(f),o._fullInput!==o&&d.selectedpoints.push(f))}}else for(r=0;r<t.length;r++)o=t[r].cd[0].trace,delete o.selectedpoints,delete o._input.selectedpoints,o._fullInput!==o&&delete o._fullInput.selectedpoints;ce(e,t)}function ce(e,t){for(var n=!1,r=0;r<t.length;r++){var a=t[r],o=a.cd;i.traceIs(o[0].trace,`regl`)&&(n=!0);var s=a._module,c=s.styleOnSelect||s.style;c&&(c(e,o,o[0].node3),o[0].nodeRangePlot3&&c(e,o,o[0].nodeRangePlot3))}n&&(A(e),j(e))}function le(e,t,r){for(var i=(r?n.difference:n.union)({regions:e},{regions:[t]}).regions.reverse(),a=0;a<i.length;a++){var o=i[a];o.subtract=ye(o,i.slice(0,a))}return i}function ue(e,t){if(Array.isArray(e))for(var n=t.cd,r=t.cd[0].trace,i=0;i<e.length;i++)e[i]=c(e[i],r,n);return e}function de(e,t){for(var n=[],r=0;r<e.length;r++){n[r]=[];for(var i=0;i<e[r].length;i++){n[r][i]=[],n[r][i][0]=i?`L`:`M`;for(var a=0;a<e[r][i].length;a++)n[r][i].push(e[r][i][a])}t||n[r].push([`Z`,n[r][0][1],n[r][0][2]])}return n}function fe(e,t){for(var n=[],r,i=[],a,o=0;o<t.length;o++){var s=t[o];a=s._module.selectPoints(s,e),i.push(a),r=ue(a,s),n=n.concat(r)}return n}function pe(e,t,n,r,i){var a=!!r,o,s,c;i&&(o=i.plotinfo,s=i.xaxes[0]._id,c=i.yaxes[0]._id);var l=[],u=[],d=ve(e),p=e._fullLayout;if(o){var h=p._zoomlayer,g=p.dragmode,_=f(g),v=m(g);if(_||v){var y=k(e,s,`x`),b=k(e,c,`y`);if(y&&b){var S=h.selectAll(`.select-outline-`+o.id);if(S&&e._fullLayout._outlining&&S.length){for(var C=x(S[0][0].getAttribute(`d`),e,o),w=[],T=0;T<C.length;T++){for(var E=C[T],D=[],O=0;O<E.length;O++)D.push([be(y,E[O][1]),be(b,E[O][2])]);D.xref=s,D.yref=c,D.subtract=ye(D,w),w.push(D)}d=d.concat(w)}}}}var A=s&&c?[s+c]:p._subplots.cartesian;me(e);for(var j={},M=0;M<A.length;M++){var N=A[M],P=N.indexOf(`y`),F=N.slice(0,P),I=N.slice(P),L=s&&c?n:void 0;if(L=_e(d,F,I,L),L){var R=r;if(!a){var z=k(e,F,`x`),B=k(e,I,`y`);R=ee(e,[z],[B],N);for(var V=0;V<R.length;V++){var H=R[V],U=H.cd[0],W=U.trace;if(H._module.name===`scattergl`&&!U.t.xpx){var G=W.x,K=W.y,q=W._length;U.t.xpx=[],U.t.ypx=[];for(var J=0;J<q;J++)U.t.xpx[J]=z.c2p(G[J]),U.t.ypx[J]=B.c2p(K[J])}H._module.name===`splom`&&(j[W.uid]||(j[W.uid]=!0))}}var Y=fe(L,R);l=l.concat(Y),u=u.concat(R)}}var X={points:l};se(e,u,X);var Z=p.clickmode.indexOf(`event`)>-1&&t;if(!o&&t){var Q=ve(e,!0);if(Q.length){var te=Q[0].xref,ne=Q[0].yref;if(te&&ne){var re=xe(Q);Ce([k(e,te,`x`),k(e,ne,`y`)])(X,re)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:Z&&Ee(e,X),p._reselect=!1}if(!o&&p._deselect){var ie=p._deselect;s=ie.xref,c=ie.yref,he(s,c,u)||ge(e,s,c,r),Z&&(X.points.length?Ee(e,X):De(e)),p._deselect=!1}return{eventData:X,selectionTesters:n}}function me(e){var t=e.calcdata;if(t)for(var n=0;n<t.length;n++){var r=t[n][0].trace,i=e._fullLayout._splomScenes;if(i){var a=i[r.uid];a&&(a.selectBatch=[])}}}function he(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];if(i.xaxis&&i.xaxis._id===e&&i.yaxis&&i.yaxis._id===t)return!0}return!1}function ge(e,t,n,r){r=ee(e,[k(e,t,`x`)],[k(e,n,`y`)],t+n);for(var i=0;i<r.length;i++){var a=r[i];a._module.selectPoints(a,!1)}se(e,r)}function _e(e,t,n,r){for(var i,a=0;a<e.length;a++){var o=e[a];if(!(t!==o.xref||n!==o.yref))if(i){var s=!!o.subtract;i=le(i,o,s),r=K(i)}else i=[o],r=F(o)}return r}function ve(e,t){for(var n=[],r=e._fullLayout,i=r.selections,a=i.length,o=0;o<a;o++)if(!(t&&o!==r._activeSelectionIndex)){var s=i[o];if(s){var c=s.xref,l=s.yref,u=k(e,c,`x`),d=k(e,l,`y`),f,p,m,_,v;if(s.type===`rect`){v=[];var y=be(u,s.x0),b=be(u,s.x1),x=be(d,s.y0),S=be(d,s.y1);v=[[y,x],[y,S],[b,S],[b,x]],f=Math.min(y,b),p=Math.max(y,b),m=Math.min(x,S),_=Math.max(x,S),v.xmin=f,v.xmax=p,v.ymin=m,v.ymax=_,v.xref=c,v.yref=l,v.subtract=!1,v.isRect=!0,n.push(v)}else if(s.type===`path`)for(var C=s.path.split(`Z`),w=[],T=0;T<C.length;T++){var E=C[T];if(E){E+=`Z`;var D=h.extractPathCoords(E,g.paramIsX,`raw`),O=h.extractPathCoords(E,g.paramIsY,`raw`);f=1/0,p=-1/0,m=1/0,_=-1/0,v=[];for(var A=0;A<D.length;A++){var j=be(u,D[A]),M=be(d,O[A]);v.push([j,M]),f=Math.min(j,f),p=Math.max(j,p),m=Math.min(M,m),_=Math.max(M,_)}v.xmin=f,v.xmax=p,v.ymin=m,v.ymax=_,v.xref=c,v.yref=l,v.subtract=ye(v,w),w.push(v),n.push(v)}}}}return n}function ye(e,t){for(var n=!1,i=0;i<t.length;i++)for(var a=t[i],o=0;o<e.length;o++)if(r(e[o],a)){n=!n;break}return n}function be(e,t){return e.type===`date`&&(t=t.replace(`_`,` `)),e.type===`log`?e.c2p(t):e.r2p(t,null,e.calendar)}function xe(e){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];n=n.concat(i),n=n.concat([i[0]])}return Se(n)}function Se(e){return e.isRect=e.length===5&&e[0][0]===e[4][0]&&e[0][1]===e[4][1]&&e[0][0]===e[1][0]&&e[2][0]===e[3][0]&&e[0][1]===e[3][1]&&e[1][1]===e[2][1]||e[0][1]===e[1][1]&&e[2][1]===e[3][1]&&e[0][0]===e[3][0]&&e[1][0]===e[2][0],e.isRect&&(e.xmin=Math.min(e[0][0],e[2][0]),e.xmax=Math.max(e[0][0],e[2][0]),e.ymin=Math.min(e[0][1],e[2][1]),e.ymax=Math.max(e[0][1],e[2][1])),e}function Ce(e){return function(t,n){for(var r,i,a=0;a<e.length;a++){var o=e[a],s=o._id,c=s.charAt(0);if(n.isRect){r||={};var l=n[c+`min`],u=n[c+`max`];l!==void 0&&u!==void 0&&(r[s]=[L(o,l),L(o,u)].sort(E))}else i||={},i[s]=n.map(R(o))}r&&(t.range=r),i&&(t.lassoPoints=i)}}function we(e){return e.plotinfo.fillRangeItems||Ce(e.xaxes.concat(e.yaxes))}function Te(e,t){e.emit(`plotly_selecting`,t)}function Ee(e,t){t&&(t.selections=(e.layout||{}).selections||[]),e.emit(`plotly_selected`,t)}function De(e){e.emit(`plotly_deselect`,null)}t.exports={reselect:pe,prepSelect:V,clearOutline:v,clearSelectionsCache:Z,selectOnClick:H}}),br=h((e,t)=>{t.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}]}),xr=h((e,t)=>{t.exports={axisRefDescription:function(e,t,n){return[`If set to a`,e,`axis id (e.g. *`+e+`* or`,`*`+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`",`position refers to the distance from the`,t,`of the plotting`,`area in normalized coordinates where *0* (*1*) corresponds to the`,t,`(`+n+`). If set to a`,e,`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`,t,`of the domain of that axis: e.g.,`,`*`+e+`2 domain* refers to the domain of the second`,e,` axis and a`,e,`position of 0.5 refers to the`,`point between the`,t,`and the`,n,`of the domain of the`,`second`,e,`axis.`].join(` `)}}}),Sr=h((e,t)=>{var n=br(),r=B(),i=bt(),a=yt().templatedArray;xr(),t.exports=a(`annotation`,{visible:{valType:`boolean`,dflt:!0,editType:`calc+arraydraw`},text:{valType:`string`,editType:`calc+arraydraw`},textangle:{valType:`angle`,dflt:0,editType:`calc+arraydraw`},font:r({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:n.length,dflt:1,editType:`arraydraw`},startarrowhead:{valType:`integer`,min:0,max:n.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`,i.idRegex.x.toString()],editType:`calc`},ayref:{valType:`enumerated`,dflt:`pixel`,values:[`pixel`,i.idRegex.y.toString()],editType:`calc`},xref:{valType:`enumerated`,values:[`paper`,i.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`,i.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:r({editType:`arraydraw`}),editType:`arraydraw`},captureevents:{valType:`boolean`,editType:`arraydraw`},editType:`calc`})}),Cr=h((e,t)=>{t.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}),wr=h((e,t)=>{t.exports=function(e){return{valType:`color`,editType:`style`,anim:!0}}}),Tr=h((e,t)=>{var n=jt().axisHoverFormat,{hovertemplateAttrs:r,texttemplateAttrs:i,templatefallbackAttrs:a}=ze(),o=Pt(),s=B(),c=Le().dash,l=Le().pattern,u=tn(),d=Cr(),f=z().extendFlat,p=wr();function m(e){return{valType:`any`,dflt:0,editType:`calc`}}function h(e){return{valType:`any`,editType:`calc`}}function g(e){return{valType:`enumerated`,values:[`start`,`middle`,`end`],dflt:`middle`,editType:`calc`}}t.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:m(`x`),yperiod:m(`y`),xperiod0:h(`x0`),yperiod0:h(`y0`),xperiodalignment:g(`x`),yperiodalignment:g(`y`),xhoverformat:n(`x`),yhoverformat:n(`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:i(),texttemplatefallback:a({editType:`calc`}),hovertext:{valType:`string`,dflt:``,arrayOk:!0,editType:`style`},mode:{valType:`flaglist`,flags:[`lines`,`markers`,`text`],extras:[`none`],editType:`calc`},hoveron:{valType:`flaglist`,flags:[`points`,`fills`],editType:`style`},hovertemplate:r({},{keys:d.eventDataKeys}),hovertemplatefallback:a(),line:{color:{valType:`color`,editType:`style`,anim:!0},width:{valType:`number`,min:0,dflt:2,editType:`style`,anim:!0},shape:{valType:`enumerated`,values:[`linear`,`spline`,`hv`,`vh`,`hvh`,`vhv`],dflt:`linear`,editType:`plot`},smoothing:{valType:`number`,min:0,max:1.3,dflt:1,editType:`plot`},dash:f({},c,{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:p(!0),fillgradient:f({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:l,marker:f({symbol:{valType:`enumerated`,values:u.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:f({width:{valType:`number`,min:0,arrayOk:!0,editType:`style`,anim:!0},dash:f({},c,{arrayOk:!0}),editType:`calc`},o(`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`},o(`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:s({editType:`calc`,colorEditType:`style`,arrayOk:!0}),zorder:{valType:`integer`,dflt:0,editType:`plot`}}}),Er=h((e,t)=>{var n=Sr(),r=Tr().line,i=Le().dash,a=z().extendFlat,o=Ie().overrideAll,s=yt().templatedArray;xr(),t.exports=o(s(`selection`,{type:{valType:`enumerated`,values:[`rect`,`path`]},xref:a({},n.xref,{}),yref:a({},n.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:r.color,width:a({},r.width,{min:1,dflt:1}),dash:a({},i,{dflt:`dot`})}}),`arraydraw`,`from-root`)}),Dr=h((e,t)=>{var n=$(),r=sn(),i=Vt(),a=Er(),o=qn();t.exports=function(e,t){i(e,t,{name:`selections`,handleItemDefaults:s});for(var n=t.selections,r=0;r<n.length;r++){var a=n[r];a&&a.path===void 0&&(a.x0===void 0||a.x1===void 0||a.y0===void 0||a.y1===void 0)&&(t.selections[r]=null)}};function s(e,t,i){function s(r,i){return n.coerce(e,t,a,r,i)}var c=s(`type`,s(`path`)?`path`:`rect`)!==`path`;c&&delete t.path,s(`opacity`),s(`line.color`),s(`line.width`),s(`line.dash`);for(var l=[`x`,`y`],u=0;u<2;u++){var d=l[u],f={_fullLayout:i},p,m,h,g=r.coerceRef(e,t,f,d);if(p=r.getFromId(f,g),p._selectionIndices.push(t._index),h=o.rangeToShapePosition(p),m=o.shapePositionToRange(p),c){var _=d+`0`,v=d+`1`,y=e[_],b=e[v];e[_]=m(e[_],!0),e[v]=m(e[v],!0),r.coercePosition(t,f,s,g,_),r.coercePosition(t,f,s,g,v);var x=t[_],S=t[v];x!==void 0&&S!==void 0&&(t[_]=h(x),t[v]=h(S),e[_]=y,e[v]=b)}}c&&n.noneOrAll(e,t,[`x0`,`x1`,`y0`,`y1`])}}),Or=h((e,t)=>{t.exports=function(e,t,n){n(`newselection.mode`),n(`newselection.line.width`)&&(n(`newselection.line.color`),n(`newselection.line.dash`)),n(`activeselection.fillcolor`),n(`activeselection.opacity`)}}),kr=h((e,t)=>{var n=Ke(),r=$(),i=xt();t.exports=function(e){return function(t,a){var o=t[e];if(Array.isArray(o))for(var s=n.subplotsRegistry.cartesian,c=s.idRegex,l=a._subplots,u=l.xaxis,d=l.yaxis,f=l.cartesian,p=a._has(`cartesian`),m=0;m<o.length;m++){var h=o[m];if(r.isPlainObject(h)){var g=i.cleanId(h.xref,`x`,!1),_=i.cleanId(h.yref,`y`,!1),v=c.x.test(g),y=c.y.test(_);if(v||y){p||r.pushUnique(a._basePlotModules,s);var b=!1;v&&u.indexOf(g)===-1&&(u.push(g),b=!0),y&&d.indexOf(_)===-1&&(d.push(_),b=!0),b&&v&&y&&f.push(g+_)}}}}}}),Ar=h((e,t)=>{var n=sr(),r=yr();t.exports={moduleType:`component`,name:`selections`,layoutAttributes:Er(),supplyLayoutDefaults:Dr(),supplyDrawNewSelectionDefaults:Or(),includeBasePlot:kr()(`selections`),draw:n.draw,drawOne:n.drawOne,reselect:r.reselect,prepSelect:r.prepSelect,clearOutline:r.clearOutline,clearSelectionsCache:r.clearSelectionsCache,selectOnClick:r.selectOnClick}}),jr=h((e,t)=>{var n=S(),r=$(),i=r.numberFormat,a=R(),o=dn(),s=Ke(),c=r.strTranslate,l=kt(),u=q(),d=tn(),f=Ln(),p=sn(),m=gn(),h=hn(),g=Rn(),_=g.selectingOrDrawing,v=g.freeMode,y=Ot().FROM_TL,b=zn(),x=or().redrawReglTraces,C=Et(),w=xt().getFromId,T=Ar().prepSelect,E=Ar().clearOutline,D=Ar().selectOnClick,O=ir(),k=bt(),A=k.MINDRAG,j=k.MINZOOM,M=!0;function N(e,t,i,o,c,u,m,g){var S=e._fullLayout._zoomlayer,M=m+g===`nsew`,N=(m+g).length===1,P,R,K,q,re,ie,ae,oe,se,ce,le,ue,de,fe,pe,me,he,ge,_e,ve,ye,be,xe;i+=t.yaxis._shift;function Se(){if(P=t.xaxis,R=t.yaxis,se=P._length,ce=R._length,ae=P._offset,oe=R._offset,K={},K[P._id]=P,q={},q[R._id]=R,m&&g)for(var n=t.overlays,r=0;r<n.length;r++){var i=n[r].xaxis;K[i._id]=i;var a=n[r].yaxis;q[a._id]=a}re=ne(K),ie=ne(q),de=I(re,g),fe=I(ie,m),pe=!fe&&!de,ue=ee(e,e._fullLayout._axisMatchGroups,K,q),le=ee(e,e._fullLayout._axisConstraintGroups,K,q,ue);var o=le.isSubplotConstrained||ue.isSubplotConstrained;me=g||o,he=m||o;var s=e._fullLayout;ge=s._has(`scattergl`),_e=s._has(`splom`),ve=s._has(`svg`)}Se();var Ce=H(fe+de,e._fullLayout.dragmode,M),we=F(t,m+g+`drag`,Ce,i,o,c,u);if(pe&&!M)return we.onmousedown=null,we.style.pointerEvents=`none`,we;var Te={element:we,gd:e,plotinfo:t};Te.prepFn=function(t,n,r){var i=Te.dragmode,a=e._fullLayout.dragmode;a!==i&&(Te.dragmode=a),Se(),be=e._fullLayout._invScaleX,xe=e._fullLayout._invScaleY,pe||(M?t.shiftKey?a===`pan`?a=`zoom`:_(a)||(a=`pan`):t.ctrlKey&&(a=`pan`):a=`pan`),v(a)?Te.minDrag=1:Te.minDrag=void 0,_(a)?(Te.xaxes=re,Te.yaxes=ie,T(t,n,r,Te,a)):(Te.clickFn=De,_(i)&&Ee(),pe||(a===`zoom`?(Te.moveFn=ze,Te.doneFn=Ve,Te.minDrag=1,Re(t,n,r)):a===`pan`&&(Te.moveFn=qe,Te.doneFn=Ze))),e._fullLayout._redrag=function(){var t=e._dragdata;if(t&&t.element===we){var n=e._fullLayout.dragmode;_(n)||(Se(),Qe([0,0,se,ce]),Te.moveFn(t.dx,t.dy))}}};function Ee(){Te.plotinfo.selection=!1,E(e)}function De(e,r){var i=Te.gd;if(i._fullLayout._activeShapeIndex>=0){i._fullLayout._deactivateShape(i);return}var a=i._fullLayout.clickmode;if(J(i),e===2&&!N&&Xe(),M)a.indexOf(`select`)>-1&&D(r,i,re,ie,t.id,Te),a.indexOf(`event`)>-1&&f.click(i,r,t.id);else if(e===1&&N){var o=m?R:P,c=m===`s`||g===`w`?0:1,u=o._name+`.range[`+c+`]`,d=L(o,c),p=`left`,h=`middle`;if(o.fixedrange)return;m?(h=m===`n`?`top`:`bottom`,o.side===`right`&&(p=`right`)):g===`e`&&(p=`right`),i._context.showAxisRangeEntryBoxes&&n.select(we).call(l.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(d),fill:o.tickfont?o.tickfont.color:`#444`,horizontalAlign:p,verticalAlign:h}).on(`edit`,function(e){var t=o.d2r(e);t!==void 0&&s.call(`_guiRelayout`,i,u,t)})}}h.init(Te);var Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le;function Re(t,n,i){var o=we.getBoundingClientRect();Oe=n-o.left,ke=i-o.top,e._fullLayout._calcInverseTransform(e);var s=r.apply3DTransform(e._fullLayout._invTransform)(Oe,ke);Oe=s[0],ke=s[1],Ae={l:Oe,r:Oe,w:0,t:ke,b:ke,h:0},je=e._hmpixcount?e._hmlumcount/e._hmpixcount:a(e._fullLayout.plot_bgcolor).getLuminance(),Me=`M0,0H`+se+`V`+ce+`H0V0`,Ne=!1,Pe=`xy`,Le=!1,Fe=U(S,je,ae,oe,Me),Ie=W(S,ae,oe)}function ze(t,n){if(e._transitioningWithDuration)return!1;var r=Math.max(0,Math.min(se,be*t+Oe)),i=Math.max(0,Math.min(ce,xe*n+ke)),a=Math.abs(r-Oe),o=Math.abs(i-ke);Ae.l=Math.min(Oe,r),Ae.r=Math.max(Oe,r),Ae.t=Math.min(ke,i),Ae.b=Math.max(ke,i);function s(){Pe=``,Ae.r=Ae.l,Ae.t=Ae.b,Ie.attr(`d`,`M0,0Z`)}if(le.isSubplotConstrained)a>j||o>j?(Pe=`xy`,a/se>o/ce?(o=a*ce/se,ke>i?Ae.t=ke-o:Ae.b=ke+o):(a=o*se/ce,Oe>r?Ae.l=Oe-a:Ae.r=Oe+a),Ie.attr(`d`,Q(Ae))):s();else if(ue.isSubplotConstrained)if(a>j||o>j){Pe=`xy`;var c=Math.min(Ae.l/se,(ce-Ae.b)/ce),l=Math.max(Ae.r/se,(ce-Ae.t)/ce);Ae.l=c*se,Ae.r=l*se,Ae.b=(1-c)*ce,Ae.t=(1-l)*ce,Ie.attr(`d`,Q(Ae))}else s();else !fe||o<Math.min(Math.max(a*.6,A),j)?a<A||!de?s():(Ae.t=0,Ae.b=ce,Pe=`x`,Ie.attr(`d`,X(Ae,ke))):!de||a<Math.min(o*.6,j)?(Ae.l=0,Ae.r=se,Pe=`y`,Ie.attr(`d`,Z(Ae,Oe))):(Pe=`xy`,Ie.attr(`d`,Q(Ae)));Ae.w=Ae.r-Ae.l,Ae.h=Ae.b-Ae.t,Pe&&(Le=!0),e._dragged=Le,G(Fe,Ie,Ae,Me,Ne,je),Be(),e.emit(`plotly_relayouting`,ye),Ne=!0}function Be(){ye={},(Pe===`xy`||Pe===`x`)&&(z(re,Ae.l/se,Ae.r/se,ye,le.xaxes),Je(`x`,ye)),(Pe===`xy`||Pe===`y`)&&(z(ie,(ce-Ae.b)/ce,(ce-Ae.t)/ce,ye,le.yaxes),Je(`y`,ye))}function Ve(){Be(),J(e),Ze(),Y(e)}var He=[0,0,se,ce],Ue=null,We=k.REDRAWDELAY,Ge=t.mainplot?e._fullLayout._plots[t.mainplot]:t;function Ke(t){if(!e._context._scrollZoom.cartesian&&!e._fullLayout._enablescrollzoom)return;if(Ee(),e._transitioningWithDuration){t.preventDefault(),t.stopPropagation();return}Se(),clearTimeout(Ue);var n=-t.deltaY;if(isFinite(n)||(n=t.wheelDelta/10),!isFinite(n)){r.log(`Did not find wheel motion attributes: `,t);return}var i=Math.exp(-Math.min(Math.max(n,-20),20)/200),a=Ge.draglayer.select(`.nsewdrag`).node().getBoundingClientRect(),o=(t.clientX-a.left)/a.width,s=(a.bottom-t.clientY)/a.height,c;function l(e,t,n){if(e.fixedrange)return;var i=r.simpleMap(e.range,e.r2l),a=i[0]+(i[1]-i[0])*t;function o(t){return e.l2r(a+(t-a)*n)}e.range=i.map(o)}if(me){for(g||(o=.5),c=0;c<re.length;c++)l(re[c],o,i);Je(`x`),He[2]*=i,He[0]+=He[2]*o*(1/i-1)}if(he){for(m||(s=.5),c=0;c<ie.length;c++)l(ie[c],s,i);Je(`y`),He[3]*=i,He[1]+=He[3]*(1-s)*(1/i-1)}Qe(He),Ye(),e.emit(`plotly_relayouting`,ye),Ue=setTimeout(function(){e._fullLayout&&(He=[0,0,se,ce],Ze())},We),t.preventDefault()}m.length*g.length!==1&&te(we,Ke);function qe(t,n){if(t*=be,n*=xe,e._transitioningWithDuration)return;if(e._fullLayout._replotting=!0,de===`ew`||fe===`ns`){var r=de?-t:0,i=fe?-n:0;if(ue.isSubplotConstrained){if(de&&fe){var a=(t/se-n/ce)/2;t=a*se,n=-a*ce,r=-t,i=-n}fe?r=-i*se/ce:i=-r*ce/se}de&&(B(re,t),Je(`x`)),fe&&(B(ie,n),Je(`y`)),Qe([r,i,se,ce]),Ye(),e.emit(`plotly_relayouting`,ye);return}function o(e,t,n){for(var r=1-t,i,a,o=0;o<e.length;o++){var s=e[o];if(!s.fixedrange){i=s,a=s._rl[r]+(s._rl[t]-s._rl[r])/V(n/s._length);var c=s.l2r(a);c!==!1&&c!==void 0&&(s.range[t]=c)}}return i._length*(i._rl[t]-a)/(i._rl[t]-i._rl[r])}var s=de===`w`==(fe===`n`)?1:-1;if(de&&fe&&(le.isSubplotConstrained||ue.isSubplotConstrained)){var c=(t/se+s*n/ce)/2;t=c*se,n=s*c*ce}var l,u;if(de===`w`?t=o(re,0,t):de===`e`?t=o(re,1,-t):de||(t=0),fe===`n`?n=o(ie,1,n):fe===`s`?n=o(ie,0,-n):fe||(n=0),l=de===`w`?t:0,u=fe===`n`?n:0,le.isSubplotConstrained&&!ue.isSubplotConstrained||ue.isSubplotConstrained&&de&&fe&&s>0){var d;if(ue.isSubplotConstrained||!de&&fe.length===1){for(d=0;d<re.length;d++)re[d].range=re[d]._r.slice(),O(re[d],1-n/ce);t=n*se/ce,l=t/2}if(ue.isSubplotConstrained||!fe&&de.length===1){for(d=0;d<ie.length;d++)ie[d].range=ie[d]._r.slice(),O(ie[d],1-t/se);n=t*ce/se,u=n/2}}(!ue.isSubplotConstrained||!fe)&&Je(`x`),(!ue.isSubplotConstrained||!de)&&Je(`y`);var f=se-t,p=ce-n;ue.isSubplotConstrained&&!(de&&fe)&&(de?(u=l?0:t*ce/se,p=f*ce/se):(l=u?0:n*se/ce,f=p*se/ce)),Qe([l,u,f,p]),Ye(),e.emit(`plotly_relayouting`,ye)}function Je(e,t){for(var n=ue.isSubplotConstrained?{x:ie,y:re}[e]:ue[e+`axes`],r=ue.isSubplotConstrained?{x:re,y:ie}[e]:[],i=0;i<n.length;i++){var a=n[i],o=a._id,s=ue.xLinks[o]||ue.yLinks[o],c=r[0]||K[s]||q[s];c&&(t?(t[a._name+`.range[0]`]=t[c._name+`.range[0]`],t[a._name+`.range[1]`]=t[c._name+`.range[1]`]):a.range=c.range.slice())}}function Ye(){var n=[],r;function i(e){for(r=0;r<e.length;r++)e[r].fixedrange||n.push(e[r]._id)}function a(e,t){for(r=0;r<e.length;r++){var i=e[r],a=i[t];!i.fixedrange&&a.tickmode===`sync`&&n.push(a._id)}}for(me&&(i(re),i(le.xaxes),i(ue.xaxes),a(t.overlays,`xaxis`)),he&&(i(ie),i(le.yaxes),i(ue.yaxes),a(t.overlays,`yaxis`)),ye={},r=0;r<n.length;r++){var o=n[r],s=w(e,o);p.drawOne(e,s,{skipTitle:!0}),ye[s._name+`.range[0]`]=s.range[0],ye[s._name+`.range[1]`]=s.range[1]}p.redrawComponents(e,n)}function Xe(){if(!e._transitioningWithDuration){var t=e._context.doubleClick,n=[];de&&(n=n.concat(re)),fe&&(n=n.concat(ie)),ue.xaxes&&(n=n.concat(ue.xaxes)),ue.yaxes&&(n=n.concat(ue.yaxes));var r={},i,a;if(t===`reset+autosize`)for(t=`autosize`,a=0;a<n.length;a++){i=n[a];var o=i._rangeInitial0,c=i._rangeInitial1,l=o!==void 0||c!==void 0;if(l&&(o!==void 0&&o!==i.range[0]||c!==void 0&&c!==i.range[1])||!l&&i.autorange!==!0){t=`reset`;break}}if(t===`autosize`)for(a=0;a<n.length;a++)i=n[a],i.fixedrange||(r[i._name+`.autorange`]=!0);else if(t===`reset`){for((de||le.isSubplotConstrained)&&(n=n.concat(le.xaxes)),fe&&!le.isSubplotConstrained&&(n=n.concat(le.yaxes)),le.isSubplotConstrained&&(de?fe||(n=n.concat(ie)):n=n.concat(re)),a=0;a<n.length;a++)if(i=n[a],!i.fixedrange){var u=i._name,d=i._autorangeInitial;i._rangeInitial0===void 0&&i._rangeInitial1===void 0?r[u+`.autorange`]=!0:i._rangeInitial0===void 0?(r[u+`.autorange`]=d,r[u+`.range`]=[null,i._rangeInitial1]):i._rangeInitial1===void 0?(r[u+`.range`]=[i._rangeInitial0,null],r[u+`.autorange`]=d):r[u+`.range`]=[i._rangeInitial0,i._rangeInitial1]}}e.emit(`plotly_doubleclick`,null),s.call(`_guiRelayout`,e,r)}}function Ze(){Qe([0,0,se,ce]),r.syncOrAsync([C.previousPromises,function(){e._fullLayout._replotting=!1,s.call(`_guiRelayout`,e,ye)}],e)}function Qe(t){var n=e._fullLayout,i=n._plots,a=n._subplots.cartesian,o,c,l,u;if(_e&&s.subplotsRegistry.splom.drag(e),ge){for(o=0;o<a.length;o++)if(c=i[a[o]],l=c.xaxis,u=c.yaxis,c._scene){l.limitRange&&l.limitRange(),u.limitRange&&u.limitRange();var f=r.simpleMap(l.range,l.r2l),p=r.simpleMap(u.range,u.r2l);c._scene.update({range:[f[0],p[0],f[1],p[1]]})}}if((_e||ge)&&(b(e),x(e)),ve){var h=t[2]/P._length,_=t[3]/R._length;for(o=0;o<a.length;o++){c=i[a[o]],l=c.xaxis,u=c.yaxis;var v=(me||ue.isSubplotConstrained)&&!l.fixedrange&&K[l._id],y=(he||ue.isSubplotConstrained)&&!u.fixedrange&&q[u._id],S,C,w,T;if(v?(S=h,w=g||ue.isSubplotConstrained?t[0]:tt(l,S)):ue.xaHash[l._id]?(S=h,w=t[0]*l._length/P._length):ue.yaHash[l._id]?(S=_,w=fe===`ns`?-t[1]*l._length/R._length:tt(l,S,{n:`top`,s:`bottom`}[fe])):(S=$e(l,h,_),w=et(l,S)),S>1&&(l.maxallowed!==void 0&&me===(l.range[0]<l.range[1]?`e`:`w`)||l.minallowed!==void 0&&me===(l.range[0]<l.range[1]?`w`:`e`))&&(S=1,w=0),y?(C=_,T=m||ue.isSubplotConstrained?t[1]:tt(u,C)):ue.yaHash[u._id]?(C=_,T=t[1]*u._length/R._length):ue.xaHash[u._id]?(C=h,T=de===`ew`?-t[0]*u._length/P._length:tt(u,C,{e:`right`,w:`left`}[de])):(C=$e(u,h,_),T=et(u,C)),C>1&&(u.maxallowed!==void 0&&he===(u.range[0]<u.range[1]?`n`:`s`)||u.minallowed!==void 0&&he===(u.range[0]<u.range[1]?`s`:`n`))&&(C=1,T=0),!(!S&&!C)){S||=1,C||=1;var E=l._offset-w/S,D=u._offset-T/C;c.clipRect.call(d.setTranslate,w,T).call(d.setScale,S,C),c.plot.call(d.setTranslate,E,D).call(d.setScale,1/S,1/C),(S!==c.xScaleFactor||C!==c.yScaleFactor)&&(d.setPointGroupScale(c.zoomScalePts,S,C),d.setTextPointsScale(c.zoomScaleTxt,S,C)),d.hideOutsideRangePoints(c.clipOnAxisFalseTraces,c),c.xScaleFactor=S,c.yScaleFactor=C}}}}function $e(e,t,n){return e.fixedrange?0:me&&le.xaHash[e._id]?t:he&&(le.isSubplotConstrained?le.xaHash:le.yaHash)[e._id]?n:0}function et(e,t){return t?(e.range=e._r.slice(),O(e,t),tt(e,t)):0}function tt(e,t,n){return e._length*(1-t)*y[n||e.constraintoward||`middle`]}return we}function P(e,t,n,i){var a=r.ensureSingle(e.draglayer,t,n,function(t){t.classed(`drag`,!0).style({fill:`transparent`,"stroke-width":0}).attr(`data-subplot`,e.id)});return a.call(m,i),a.node()}function F(e,t,r,i,a,o,s){var c=P(e,`rect`,t,r);return n.select(c).call(d.setRect,i,a,o,s),c}function I(e,t){for(var n=0;n<e.length;n++)if(!e[n].fixedrange)return t;return``}function L(e,t){var n=e.range[t],r=Math.abs(n-e.range[1-t]),a;return e.type===`date`?n:e.type===`log`?(a=Math.ceil(Math.max(0,-Math.log(r)/Math.LN10))+3,i(`.`+a+`g`)(10**n)):(a=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(r)/Math.LN10)+4,i(`.`+String(a)+`g`)(n))}function z(e,t,n,r,i){for(var a=0;a<e.length;a++){var o=e[a];if(!o.fixedrange)if(o.rangebreaks){var s=o._id.charAt(0)===`y`,c=s?1-t:t,l=s?1-n:n;r[o._name+`.range[0]`]=o.l2r(o.p2l(c*o._length)),r[o._name+`.range[1]`]=o.l2r(o.p2l(l*o._length))}else{var u=o._rl[0],d=o._rl[1]-u;r[o._name+`.range[0]`]=o.l2r(u+d*t),r[o._name+`.range[1]`]=o.l2r(u+d*n)}}if(i&&i.length){var f=(t+(1-n))/2;z(i,f,1-f,r,[])}}function B(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(!r.fixedrange){if(r.rangebreaks){var i=0,a=r._length,o=(r.p2l(i+t)-r.p2l(i)+(r.p2l(a+t)-r.p2l(a)))/2;r.range=[r.l2r(r._rl[0]-o),r.l2r(r._rl[1]-o)]}else r.range=[r.l2r(r._rl[0]-t/r._m),r.l2r(r._rl[1]-t/r._m)];r.limitRange&&r.limitRange()}}}function V(e){return 1-(e>=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function H(e,t,n){return e?e===`nsew`?n?``:t===`pan`?`move`:`crosshair`:e.toLowerCase()+`-resize`:`pointer`}function U(e,t,n,r,i){return e.append(`path`).attr(`class`,`zoombox`).style({fill:t>.2?`rgba(0,0,0,0)`:`rgba(255,255,255,0)`,"stroke-width":0}).attr(`transform`,c(n,r)).attr(`d`,i+`Z`)}function W(e,t,n){return e.append(`path`).attr(`class`,`zoombox-corners`).style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr(`transform`,c(t,n)).attr(`d`,`M0,0Z`)}function G(e,t,n,r,i,a){e.attr(`d`,r+`M`+n.l+`,`+n.t+`v`+n.h+`h`+n.w+`v-`+n.h+`h-`+n.w+`Z`),K(e,t,i,a)}function K(e,t,n,r){n||(e.transition().style(`fill`,r>.2?`rgba(0,0,0,0.4)`:`rgba(255,255,255,0.3)`).duration(200),t.transition().style(`opacity`,1).duration(200))}function J(e){n.select(e).selectAll(`.zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners`).remove()}function Y(e){M&&e.data&&e._context.showTips&&(r.notifier(r._(e,`Double-click to zoom back out`),`long`,e),M=!1)}function X(e,t){return`M`+(e.l-.5)+`,`+(t-j-.5)+`h-3v`+(2*j+1)+`h3ZM`+(e.r+.5)+`,`+(t-j-.5)+`h3v`+(2*j+1)+`h-3Z`}function Z(e,t){return`M`+(t-j-.5)+`,`+(e.t-.5)+`v-3h`+(2*j+1)+`v3ZM`+(t-j-.5)+`,`+(e.b+.5)+`v3h`+(2*j+1)+`v-3Z`}function Q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,j)/2);return`M`+(e.l-3.5)+`,`+(e.t-.5+t)+`h3v`+-t+`h`+t+`v-3h-`+(t+3)+`ZM`+(e.r+3.5)+`,`+(e.t-.5+t)+`h-3v`+-t+`h`+-t+`v-3h`+(t+3)+`ZM`+(e.r+3.5)+`,`+(e.b+.5-t)+`h-3v`+t+`h`+-t+`v3h`+(t+3)+`ZM`+(e.l-3.5)+`,`+(e.b+.5-t)+`h3v`+t+`h`+t+`v3h-`+(t+3)+`Z`}function ee(e,t,n,i,a){for(var o=!1,s={},c={},l,u,d,f,p=(a||{}).xaHash,m=(a||{}).yaHash,h=0;h<t.length;h++){var g=t[h];for(l in n)if(g[l]){for(d in g)!(a&&(p[d]||m[d]))&&!(d.charAt(0)===`x`?n:i)[d]&&(s[d]=l);for(u in i)!(a&&(p[u]||m[u]))&&g[u]&&(o=!0)}for(u in i)if(g[u])for(f in g)!(a&&(p[f]||m[f]))&&!(f.charAt(0)===`x`?n:i)[f]&&(c[f]=u)}o&&(r.extendFlat(s,c),c={});var _={},v=[];for(d in s){var y=w(e,d);v.push(y),_[y._id]=y}var b={},x=[];for(f in c){var S=w(e,f);x.push(S),b[S._id]=S}return{xaHash:_,yaHash:b,xaxes:v,yaxes:x,xLinks:s,yLinks:c,isSubplotConstrained:o}}function te(e,t){if(!o)e.onwheel===void 0?e.onmousewheel===void 0?e.isAddedWheelEvent||(e.isAddedWheelEvent=!0,e.addEventListener(`wheel`,t,{passive:!1})):e.onmousewheel=t:e.onwheel=t;else{var n=e.onwheel===void 0?`mousewheel`:`wheel`;e._onwheel&&e.removeEventListener(n,e._onwheel),e._onwheel=t,e.addEventListener(n,t,{passive:!1})}}function ne(e){var t=[];for(var n in e)t.push(e[n]);return t}t.exports={makeDragBox:N,makeDragger:P,makeRectDragger:F,makeZoombox:U,makeCorners:W,updateZoombox:G,xyCorners:Q,transitionZoombox:K,removeZoombox:J,showDoubleClickNotifier:Y,attachWheelEventHandler:te}}),Mr=h(e=>{var t=S(),n=Ln(),r=hn(),i=gn(),a=jr().makeDragBox,o=bt().DRAGGERSIZE;e.initInteractions=function(i){var s=i._fullLayout;if(i._context.staticPlot){t.select(i).selectAll(`.drag`).remove();return}if(!(!s._has(`cartesian`)&&!s._has(`splom`))){Object.keys(s._plots||{}).sort(function(e,t){if((s._plots[e].mainplot&&!0)===(s._plots[t].mainplot&&!0)){var n=e.split(`y`),r=t.split(`y`);return n[0]===r[0]?Number(n[1]||1)-Number(r[1]||1):Number(n[0]||1)-Number(r[0]||1)}return s._plots[e].mainplot?1:-1}).forEach(function(e){var t=s._plots[e],c=t.xaxis,l=t.yaxis;if(!t.mainplot){var u=a(i,t,c._offset,l._offset,c._length,l._length,`ns`,`ew`);u.onmousemove=function(t){i._fullLayout._rehover=function(){i._fullLayout._hoversubplot===e&&i._fullLayout._plots[e]&&n.hover(i,t,e)},n.hover(i,t,e),i._fullLayout._lasthover=u,i._fullLayout._hoversubplot=e},u.onmouseout=function(e){i._dragging||(i._fullLayout._hoversubplot=null,r.unhover(i,e))},i._context.showAxisDragHandles&&(a(i,t,c._offset-o,l._offset-o,o,o,`n`,`w`),a(i,t,c._offset+c._length,l._offset-o,o,o,`n`,`e`),a(i,t,c._offset-o,l._offset+l._length,o,o,`s`,`w`),a(i,t,c._offset+c._length,l._offset+l._length,o,o,`s`,`e`))}if(i._context.showAxisDragHandles){if(e===c._mainSubplot){var d=c._mainLinePosition;c.side===`top`&&(d-=o),a(i,t,c._offset+c._length*.1,d,c._length*.8,o,``,`ew`),a(i,t,c._offset,d,c._length*.1,o,``,`w`),a(i,t,c._offset+c._length*.9,d,c._length*.1,o,``,`e`)}if(e===l._mainSubplot){var f=l._mainLinePosition;l.side!==`right`&&(f-=o),a(i,t,f,l._offset+l._length*.1,o,l._length*.8,`ns`,``),a(i,t,f,l._offset+l._length*.9,o,l._length*.1,`s`,``),a(i,t,f,l._offset,o,l._length*.1,`n`,``)}}});var c=s._hoverlayer.node();c.onmousemove=function(e){e.target=i._fullLayout._lasthover,n.hover(i,e,s._hoversubplot)},c.onclick=function(e){e.target=i._fullLayout._lasthover,n.click(i,e)},c.onmousedown=function(e){i._fullLayout._lasthover.onmousedown(e)},e.updateFx(i)}},e.updateFx=function(e){var t=e._fullLayout,n=t.dragmode===`pan`?`move`:`crosshair`;i(t._draggers,n)}}),Nr=h((e,t)=>{var n=Ke();t.exports=function(e){for(var t=n.layoutArrayContainers,r=n.layoutArrayRegexes,i=e.split(`[`)[0],a,o,s=0;s<r.length;s++)if(o=e.match(r[s]),o&&o.index===0){a=o[0];break}if(a||=t[t.indexOf(i)],!a)return!1;var c=e.slice(a.length);return c?(o=c.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/),o?{array:a,index:Number(o[1]),property:o[3]||``}:!1):{array:a,index:``,property:``}}}),Pr=h(e=>{var t=A(),n=te(),r=ee(),i=Ye().sorterAsc,a=Ke();e.containerArrayMatch=Nr();var o=e.isAddVal=function(e){return e===`add`||t(e)},s=e.isRemoveVal=function(e){return e===null||e===`remove`};e.applyContainerArrayChanges=function(e,t,c,l,u){var d=t.astr,f=a.getComponentMethod(d,`supplyLayoutDefaults`),p=a.getComponentMethod(d,`draw`),m=a.getComponentMethod(d,`drawOne`),h=l.replot||l.recalc||f===n||p===n,g=e.layout,_=e._fullLayout;if(c[``]){Object.keys(c).length>1&&r.warn(`Full array edits are incompatible with other edits`,d);var v=c[``][``];if(s(v))t.set(null);else if(Array.isArray(v))t.set(v);else return r.warn(`Unrecognized full array edit value`,d,v),!0;return h?!1:(f(g,_),p(e),!0)}var y=Object.keys(c).map(Number).sort(i),b=t.get(),x=b||[],S=u(_,d).get(),C=[],w=-1,T=x.length,E,D,O,k,A,j,M,N;for(E=0;E<y.length;E++){if(O=y[E],k=c[O],A=Object.keys(k),j=k[``],M=o(j),O<0||O>x.length-(M?0:1)){r.warn(`index out of range`,d,O);continue}if(j!==void 0)A.length>1&&r.warn(`Insertion & removal are incompatible with edits to the same index.`,d,O),s(j)?C.push(O):M?(j===`add`&&(j={}),x.splice(O,0,j),S&&S.splice(O,0,{})):r.warn(`Unrecognized full object edit value`,d,O,j),w===-1&&(w=O);else for(D=0;D<A.length;D++)N=d+`[`+O+`].`,u(x[O],A[D],N).set(k[A[D]])}for(E=C.length-1;E>=0;E--)x.splice(C[E],1),S&&S.splice(C[E],1);if(x.length?b||t.set(x):t.set(null),h)return!1;if(f(g,_),m!==n){var P;if(w===-1)P=y;else{for(T=Math.max(x.length,T),P=[],E=0;E<y.length&&(O=y[E],!(O>=w));E++)P.push(O);for(E=w;E<T;E++)P.push(E)}for(E=0;E<P.length;E++)m(e,P[E])}else p(e);return!0}}),Fr=h(e=>{var t=D(),n=Ke(),r=$(),i=Et(),a=xt(),o=q(),s=a.cleanId,c=a.getFromTrace,l=n.traceIs,u=[`x`,`y`,`z`];e.clearPromiseQueue=function(e){Array.isArray(e._promises)&&e._promises.length>0&&r.log(`Clearing previous rejected promises from queue.`),e._promises=[]},e.cleanLayout=function(t){var n;t||={},t.xaxis1&&(t.xaxis||=t.xaxis1,delete t.xaxis1),t.yaxis1&&(t.yaxis||=t.yaxis1,delete t.yaxis1),t.scene1&&(t.scene||=t.scene1,delete t.scene1);var a=(i.subplotsRegistry.cartesian||{}).attrRegex;(i.subplotsRegistry.polar||{}).attrRegex,(i.subplotsRegistry.ternary||{}).attrRegex,(i.subplotsRegistry.gl3d||{}).attrRegex;var c=Object.keys(t);for(n=0;n<c.length;n++){var l=c[n];if(a&&a.test(l)){var u=t[l];u.anchor&&u.anchor!==`free`&&(u.anchor=s(u.anchor)),u.overlaying&&=s(u.overlaying),u.type||(u.isdate?u.type=`date`:u.islog?u.type=`log`:u.isdate===!1&&u.islog===!1&&(u.type=`linear`)),(u.autorange===`withzero`||u.autorange===`tozero`)&&(u.autorange=!0,u.rangemode=`tozero`),u.insiderange&&delete u.range,delete u.islog,delete u.isdate,delete u.categories,h(u,`domain`)&&delete u.domain}}var f=Array.isArray(t.annotations)?t.annotations.length:0;for(n=0;n<f;n++){var p=t.annotations[n];r.isPlainObject(p)&&(d(p,`xref`),d(p,`yref`))}var m=Array.isArray(t.shapes)?t.shapes.length:0;for(n=0;n<m;n++){var g=t.shapes[n];r.isPlainObject(g)&&(d(g,`xref`,!0),d(g,`yref`,!0))}var _=Array.isArray(t.images)?t.images.length:0;for(n=0;n<_;n++){var v=t.images[n];r.isPlainObject(v)&&(d(v,`xref`),d(v,`yref`))}var y=t.legend;return y&&(y.x>3?(y.x=1.02,y.xanchor=`left`):y.x<-2&&(y.x=-.02,y.xanchor=`right`),y.y>3?(y.y=1.02,y.yanchor=`bottom`):y.y<-2&&(y.y=-.02,y.yanchor=`top`)),t.dragmode===`rotate`&&(t.dragmode=`orbit`),o.clean(t),t.template&&t.template.layout&&e.cleanLayout(t.template.layout),t};function d(e,t,n=!1){var r=e[t],i=t.charAt(0);n&&Array.isArray(r)||r&&r!==`paper`&&(e[t]=s(r,i,!0))}e.cleanData=function(t){for(var a=0;a<t.length;a++){var c=t[a],u;if(c.type===`histogramy`&&`xbins`in c&&!(`ybins`in c)&&(c.ybins=c.xbins,delete c.xbins),c.type===`histogramy`&&e.swapXYData(c),(c.type===`histogramx`||c.type===`histogramy`)&&(c.type=`histogram`),`scl`in c&&!(`colorscale`in c)&&(c.colorscale=c.scl,delete c.scl),`reversescl`in c&&!(`reversescale`in c)&&(c.reversescale=c.reversescl,delete c.reversescl),c.xaxis&&=s(c.xaxis,`x`),c.yaxis&&=s(c.yaxis,`y`),l(c,`gl3d`)&&c.scene&&(c.scene=i.subplotsRegistry.gl3d.cleanId(c.scene)),!l(c,`pie-like`)&&!l(c,`bar-like`))if(Array.isArray(c.textposition))for(u=0;u<c.textposition.length;u++)c.textposition[u]=m(c.textposition[u]);else c.textposition&&=m(c.textposition);var d=n.getModule(c);if(d&&d.colorbar){var g=d.colorbar.container,_=g?c[g]:c;_&&_.colorscale&&(_.colorscale===`YIGnBu`&&(_.colorscale=`YlGnBu`),_.colorscale===`YIOrRd`&&(_.colorscale=`YlOrRd`))}if(c.type===`surface`&&r.isPlainObject(c.contours)){var v=[`x`,`y`,`z`];for(u=0;u<v.length;u++){var y=c.contours[v[u]];r.isPlainObject(y)&&(y.highlightColor&&(y.highlightcolor=y.highlightColor,delete y.highlightColor),y.highlightWidth&&(y.highlightwidth=y.highlightWidth,delete y.highlightWidth))}}if(c.type===`candlestick`||c.type===`ohlc`){var b=(c.increasing||{}).showlegend!==!1,x=(c.decreasing||{}).showlegend!==!1,S=f(c.increasing),C=f(c.decreasing);if(S!==!1&&C!==!1){var w=p(S,C,b,x);w&&(c.name=w)}else (S||C)&&!c.name&&(c.name=S||C)}h(c,`line`)&&delete c.line,`marker`in c&&(h(c.marker,`line`)&&delete c.marker.line,h(c,`marker`)&&delete c.marker),o.clean(c),c.autobinx&&(delete c.autobinx,delete c.xbins),c.autobiny&&(delete c.autobiny,delete c.ybins)}};function f(e){if(!r.isPlainObject(e))return!1;var t=e.name;return delete e.name,delete e.showlegend,(typeof t==`string`||typeof t==`number`)&&String(t)}function p(e,t,n,r){if(n&&!r)return e;if(r&&!n||!e.trim())return t;if(!t.trim())return e;var i=Math.min(e.length,t.length),a;for(a=0;a<i&&e.charAt(a)===t.charAt(a);a++);return e.slice(0,a).trim()}function m(e){var t=`middle`,n=`center`;return typeof e==`string`&&(e.indexOf(`top`)===-1?e.indexOf(`bottom`)!==-1&&(t=`bottom`):t=`top`,e.indexOf(`left`)===-1?e.indexOf(`right`)!==-1&&(n=`right`):n=`left`),t+` `+n}function h(e,t){return t in e&&typeof e[t]==`object`&&Object.keys(e[t]).length===0}e.swapXYData=function(e){var t;if(r.swapAttrs(e,[`?`,`?0`,`d?`,`?bins`,`nbins?`,`autobin?`,`?src`,`error_?`]),Array.isArray(e.z)&&Array.isArray(e.z[0])&&(e.transpose?delete e.transpose:e.transpose=!0),e.error_x&&e.error_y){var n=e.error_y,i=`copy_ystyle`in n?n.copy_ystyle:!(n.color||n.thickness||n.width);r.swapAttrs(e,[`error_?.copy_ystyle`]),i&&r.swapAttrs(e,[`error_?.color`,`error_?.thickness`,`error_?.width`])}if(typeof e.hoverinfo==`string`){var a=e.hoverinfo.split(`+`);for(t=0;t<a.length;t++)a[t]===`x`?a[t]=`y`:a[t]===`y`&&(a[t]=`x`);e.hoverinfo=a.join(`+`)}},e.coerceTraceIndices=function(e,n){if(t(n))return[n];if(!Array.isArray(n)||!n.length)return e.data.map(function(e,t){return t});if(Array.isArray(n)){for(var i=[],a=0;a<n.length;a++)r.isIndex(n[a],e.data.length)?i.push(n[a]):r.warn(`trace index (`,n[a],`) is not a number or is out of bounds`);return i}return n},e.manageArrayContainers=function(e,n,i){var a=e.obj,o=e.parts,s=o.length,c=o[s-1],l=t(c);if(l&&n===null){var u=o.slice(0,s-1).join(`.`);r.nestedProperty(a,u).get().splice(c,1)}else l&&e.get()===void 0&&e.get()===void 0&&(i[e.astr]=null),e.set(n)};var g=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function _(e){var t=e.search(g);if(t>0)return e.slice(0,t)}e.hasParent=function(e,t){for(var n=_(t);n;){if(n in e)return!0;n=_(n)}return!1},e.clearAxisTypes=function(e,t,n){for(var i=0;i<t.length;i++)for(var a=e._fullData[i],o=0;o<3;o++){var s=c(e,a,u[o]);if(s&&s.type!==`log`){var l=s._name,d=s._id.slice(1);if(d.slice(0,5)===`scene`){if(n[d]!==void 0)continue;l=d+`.`+l}var f=l+`.type`;n[l]===void 0&&n[f]===void 0&&r.nestedProperty(e.layout,f).set(null)}}};var v=(e,t)=>{let n=(...e)=>e.every(e=>r.isPlainObject(e))||e.every(e=>Array.isArray(e));if([e,t].every(e=>Array.isArray(e))){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],a=t[r];if(i!==a&&!(n(i,a)&&v(i,a)))return!1}return!0}else if([e,t].every(e=>r.isPlainObject(e))){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){if(r.startsWith(`_`))continue;let i=e[r],a=t[r];if(i!==a&&!(n(i,a)&&v(i,a)))return!1}return!0}return!1};e.collectionsAreEqual=v}),Ir=h(e=>{var t=S(),n=D(),r=pt(),i=$(),a=i.nestedProperty,o=ht(),s=gt(),c=Ke(),l=vt(),u=Et(),d=sn(),f=ln(),p=Mt(),m=tn(),h=q(),g=Mr().initInteractions,_=Dt(),v=Ar().clearOutline,y=Z().dfltConfig,b=Pr(),x=Fr(),C=or(),w=Ie(),T=bt().AX_NAME_PATTERN,E=0,O=5;function k(n,r,a,s){var l;if(n=i.getGraphDiv(n),o.init(n),i.isPlainObject(r)){var f=r;r=f.data,a=f.layout,s=f.config,l=f.frames}if(o.triggerHandler(n,`plotly_beforeplot`,[r,a,s])===!1)return Promise.reject();!r&&!a&&!i.isPlotDiv(n)&&i.warn(`Calling _doPlot as if redrawing but this container doesn't yet have a plot.`,n);function p(){if(l)return e.addFrames(n,l)}P(n,s),a||={},t.select(n).classed(`js-plotly-plot`,!0),m.makeTester(),Array.isArray(n._promises)||(n._promises=[]);var h=(n.data||[]).length===0&&Array.isArray(r);Array.isArray(r)&&(x.cleanData(r),h?n.data=r:n.data.push.apply(n.data,r),n.empty=!1),(!n.layout||h)&&(n.layout=x.cleanLayout(a)),u.supplyDefaults(n);var _=n._fullLayout,v=_._has(`cartesian`);_._replotting=!0,(h||_._shouldCreateBgLayer)&&(Me(n),_._shouldCreateBgLayer&&delete _._shouldCreateBgLayer),m.initGradients(n),m.initPatterns(n),h&&d.saveShowSpikeInitial(n);var y=!n.calcdata||n.calcdata.length!==(n._fullData||[]).length;y&&u.doCalcdata(n);for(var b=0;b<n.calcdata.length;b++)n.calcdata[b][0].trace=n._fullData[b];n._context.responsive?n._responsiveChartHandler||(n._responsiveChartHandler=function(){i.isHidden(n)||u.resize(n)},window.addEventListener(`resize`,n._responsiveChartHandler)):i.clearResponsive(n);var S=i.extendFlat({},_._size),w=0;function T(){for(var e=_._basePlotModules,t=0;t<e.length;t++)e[t].drawFramework&&e[t].drawFramework(n);!_._glcanvas&&_._has(`gl`)&&(_._glcanvas=_._glcontainer.selectAll(`.gl-canvas`).data([{key:`contextLayer`,context:!0,pick:!1},{key:`focusLayer`,context:!1,pick:!1},{key:`pickLayer`,context:!1,pick:!0}],function(e){return e.key}),_._glcanvas.enter().append(`canvas`).attr(`class`,function(e){return`gl-canvas gl-canvas-`+e.key.replace(`Layer`,``)}).style({position:`absolute`,top:0,left:0,overflow:`visible`,"pointer-events":`none`}));var r=n._context.plotGlPixelRatio;if(_._glcanvas){_._glcanvas.attr(`width`,_.width*r).attr(`height`,_.height*r).style(`width`,_.width+`px`).style(`height`,_.height+`px`);var a=_._glcanvas.data()[0].regl;if(a&&(Math.floor(_.width*r)!==a._gl.drawingBufferWidth||Math.floor(_.height*r)!==a._gl.drawingBufferHeight)){var o=`WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.`;if(w)i.error(o);else return i.log(o+` Clearing graph and plotting again.`),u.cleanPlot([],{},n._fullData,_),u.supplyDefaults(n),_=n._fullLayout,u.doCalcdata(n),w++,T()}}return _.modebar.orientation===`h`?_._modebardiv.style(`height`,null).style(`width`,`100%`):_._modebardiv.style(`width`,null).style(`height`,_.height+`px`),u.previousPromises(n)}function E(){if(u.clearAutoMarginIds(n),C.drawMarginPushers(n),d.allowAutoMargin(n),n._fullLayout.title.text&&n._fullLayout.title.automargin&&u.allowAutoMargin(n,`title.automargin`),_._has(`pie`))for(var e=n._fullData,t=0;t<e.length;t++){var r=e[t];r.type===`pie`&&r.automargin&&u.allowAutoMargin(n,`pie.`+r.uid+`.automargin`)}return u.doAutoMargin(n),u.previousPromises(n)}function D(){if(u.didMarginChange(S,_._size))return i.syncOrAsync([E,C.layoutStyles],n)}function O(){if(!y){k();return}return i.syncOrAsync([c.getComponentMethod(`shapes`,`calcAutorange`),c.getComponentMethod(`annotations`,`calcAutorange`),k],n)}function k(){n._transitioning||(C.doAutoRangeAndConstraints(n),h&&d.saveRangeInitial(n),c.getComponentMethod(`rangeslider`,`calcAutorange`)(n))}function j(){return d.draw(n,h?``:`redraw`)}var M=[u.previousPromises,p,T,E,D];v&&M.push(O),M.push(C.layoutStyles),v&&M.push(j,function(e){var t=e._fullLayout._insideTickLabelsUpdaterange;if(t)return e._fullLayout._insideTickLabelsUpdaterange=void 0,ae(e,t).then(function(){d.saveRangeInitial(e,!0)})}),M.push(C.drawData,C.finalDraw,g,u.addLinks,u.rehover,u.redrag,u.reselect,u.doAutoMargin,u.previousPromises);var N=i.syncOrAsync(M,n);return(!N||!N.then)&&(N=Promise.resolve()),N.then(function(){return A(n),n})}function A(e){var t=e._fullLayout;t._redrawFromAutoMarginCount?t._redrawFromAutoMarginCount--:e.emit(`plotly_afterplot`)}function j(e){return i.extendFlat(y,e)}function M(e,t){try{e._fullLayout._paper.style(`background`,t)}catch(e){i.error(e)}}function N(e,t){M(e,h.combine(t,`white`))}function P(e,n){if(!e._context){e._context=i.extendDeep({},y);var a=t.select(`base`);e._context._baseUrl=a.size()&&a.attr(`href`)?window.location.href.split(`#`)[0]:``}var o=e._context,s,c,l;if(n){for(c=Object.keys(n),s=0;s<c.length;s++)l=c[s],!(l===`editable`||l===`edits`)&&l in o&&(l===`setBackground`&&n[l]===`opaque`?o[l]=N:o[l]=n[l]);var u=n.editable;if(u!==void 0)for(o.editable=u,c=Object.keys(o.edits),s=0;s<c.length;s++)o.edits[c[s]]=u;if(n.edits)for(c=Object.keys(n.edits),s=0;s<c.length;s++)l=c[s],l in o.edits&&(o.edits[l]=n.edits[l]);o._exportedPlot=n._exportedPlot}o.staticPlot&&(o.editable=!1,o.edits={},o.autosizable=!1,o.scrollZoom=!1,o.doubleClick=!1,o.showTips=!1,o.showLink=!1,o.displayModeBar=!1),o.displayModeBar===`hover`&&!r&&(o.displayModeBar=!0),(o.setBackground===`transparent`||typeof o.setBackground!=`function`)&&(o.setBackground=M),o._hasZeroHeight=o._hasZeroHeight||e.clientHeight===0,o._hasZeroWidth=o._hasZeroWidth||e.clientWidth===0;var d=o.scrollZoom,f=o._scrollZoom={};if(d===!0)f.cartesian=1,f.gl3d=1,f.geo=1,f.mapbox=1,f.map=1;else if(typeof d==`string`){var p=d.split(`+`);for(s=0;s<p.length;s++)f[p[s]]=1}else d!==!1&&(f.gl3d=1,f.geo=1,f.mapbox=1,f.map=1)}function F(t){if(t=i.getGraphDiv(t),!i.isPlotDiv(t))throw Error(`This element is not a Plotly plot: `+t);return x.cleanData(t.data),x.cleanLayout(t.layout),t.calcdata=void 0,e._doPlot(t).then(function(){return t.emit(`plotly_redraw`),t})}function I(t,n,r,a){return t=i.getGraphDiv(t),u.cleanPlot([],{},t._fullData||[],t._fullLayout||{}),u.purge(t),e._doPlot(t,n,r,a)}function L(e,t){var n=t+1,r=[],i,a;for(i=0;i<e.length;i++)a=e[i],a<0?r.push(n+a):r.push(a);return r}function R(e,t,n){var r,i;for(r=0;r<t.length;r++){if(i=t[r],i!==parseInt(i,10))throw Error(`all values in `+n+` must be integers`);if(i>=e.data.length||i<-e.data.length)throw Error(n+` must be valid indices for gd.data.`);if(t.indexOf(i,r+1)>-1||i>=0&&t.indexOf(-e.data.length+i)>-1||i<0&&t.indexOf(e.data.length+i)>-1)throw Error(`each index in `+n+` must be unique.`)}}function z(e,t,n){if(!Array.isArray(e.data))throw Error(`gd.data must be an array.`);if(t===void 0)throw Error(`currentIndices is a required argument.`);if(Array.isArray(t)||(t=[t]),R(e,t,`currentIndices`),n!==void 0&&!Array.isArray(n)&&(n=[n]),n!==void 0&&R(e,n,`newIndices`),n!==void 0&&t.length!==n.length)throw Error(`current and new indices must be of equal length.`)}function B(e,t,n){var r,i;if(!Array.isArray(e.data))throw Error(`gd.data must be an array.`);if(t===void 0)throw Error(`traces must be defined.`);for(Array.isArray(t)||(t=[t]),r=0;r<t.length;r++)if(i=t[r],typeof i!=`object`||Array.isArray(i)||i===null)throw Error(`all values in traces array must be non-array objects`);if(n!==void 0&&!Array.isArray(n)&&(n=[n]),n!==void 0&&n.length!==t.length)throw Error(`if indices is specified, traces.length must equal indices.length`)}function V(e,t,n,r){var a=i.isPlainObject(r);if(!Array.isArray(e.data))throw Error(`gd.data must be an array`);if(!i.isPlainObject(t))throw Error(`update must be a key:value object`);if(n===void 0)throw Error(`indices must be an integer or array of integers`);for(var o in R(e,n,`indices`),t){if(!Array.isArray(t[o])||t[o].length!==n.length)throw Error(`attribute `+o+` must be an array of length equal to indices array length`);if(a&&(!(o in r)||!Array.isArray(r[o])||r[o].length!==t[o].length))throw 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 H(e,t,r,o){var s=i.isPlainObject(o),c=[],l,u,d,f,p;for(var m in Array.isArray(r)||(r=[r]),r=L(r,e.data.length-1),t)for(var h=0;h<r.length;h++){if(l=e.data[r[h]],d=a(l,m),u=d.get(),f=t[m][h],!i.isArrayOrTypedArray(f))throw Error(`attribute: `+m+` index: `+h+` must be an array`);if(!i.isArrayOrTypedArray(u))throw Error(`cannot extend missing or non-array attribute: `+m);if(u.constructor!==f.constructor)throw Error(`cannot extend array with an array of a different type: `+m);p=s?o[m][h]:o,n(p)||(p=-1),c.push({prop:d,target:u,insert:f,maxp:Math.floor(p)})}return c}function U(e,t,n,r,i){V(e,t,n,r);for(var a=H(e,t,n,r),o={},s={},c=0;c<a.length;c++){var l=a[c].prop,u=a[c].maxp,d=i(a[c].target,a[c].insert,u);l.set(d[0]),Array.isArray(o[l.astr])||(o[l.astr]=[]),o[l.astr].push(d[1]),Array.isArray(s[l.astr])||(s[l.astr]=[]),s[l.astr].push(a[c].target.length)}return{update:o,maxPoints:s}}function W(e,t){var n=new e.constructor(e.length+t.length);return n.set(e),n.set(t,e.length),n}function G(t,n,r,a){t=i.getGraphDiv(t);function o(e,t,n){var r,a;if(i.isTypedArray(e))if(n<0){var o=new e.constructor(0),s=W(e,t);n<0?(r=s,a=o):(r=o,a=s)}else if(r=new e.constructor(n),a=new e.constructor(e.length+t.length-n),n===t.length)r.set(t),a.set(e);else if(n<t.length){var c=t.length-n;r.set(t.subarray(c)),a.set(e),a.set(t.subarray(0,c),e.length)}else{var l=n-t.length,u=e.length-l;r.set(e.subarray(u)),r.set(t,l),a.set(e.subarray(0,u))}else r=e.concat(t),a=n>=0&&n<r.length?r.splice(0,r.length-n):[];return[r,a]}var c=U(t,n,r,a,o),l=e.redraw(t),u=[t,c.update,r,c.maxPoints];return s.add(t,e.prependTraces,u,G,arguments),l}function K(t,n,r,a){t=i.getGraphDiv(t);function o(e,t,n){var r,a;if(i.isTypedArray(e))if(n<=0){var o=new e.constructor(0),s=W(t,e);n<0?(r=s,a=o):(r=o,a=s)}else if(r=new e.constructor(n),a=new e.constructor(e.length+t.length-n),n===t.length)r.set(t),a.set(e);else if(n<t.length){var c=t.length-n;r.set(t.subarray(0,c)),a.set(t.subarray(c)),a.set(e,c)}else{var l=n-t.length;r.set(t),r.set(e.subarray(0,l),t.length),a.set(e.subarray(l))}else r=t.concat(e),a=n>=0&&n<r.length?r.splice(n,r.length):[];return[r,a]}var c=U(t,n,r,a,o),l=e.redraw(t),u=[t,c.update,r,c.maxPoints];return s.add(t,e.extendTraces,u,K,arguments),l}function J(t,n,r){t=i.getGraphDiv(t);var a=[],o=e.deleteTraces,c=J,l=[t,a],u=[t,n],d,f;for(B(t,n,r),Array.isArray(n)||(n=[n]),n=n.map(function(e){return i.extendFlat({},e)}),x.cleanData(n),d=0;d<n.length;d++)t.data.push(n[d]);for(d=0;d<n.length;d++)a.push(-n.length+d);if(r===void 0)return f=e.redraw(t),s.add(t,o,l,c,u),f;Array.isArray(r)||(r=[r]);try{z(t,a,r)}catch(e){throw t.data.splice(t.data.length-n.length,n.length),e}return s.startSequence(t),s.add(t,o,l,c,u),f=e.moveTraces(t,a,r),s.stopSequence(t),f}function Y(t,n){t=i.getGraphDiv(t);var r=[],a=e.addTraces,o=Y,c=[t,r,n],l=[t,n],u,d;if(n===void 0)throw Error(`indices must be an integer or array of integers.`);for(Array.isArray(n)||(n=[n]),R(t,n,`indices`),n=L(n,t.data.length-1),n.sort(i.sorterDes),u=0;u<n.length;u+=1)d=t.data.splice(n[u],1)[0],r.push(d);var f=e.redraw(t);return s.add(t,a,c,o,l),f}function X(t,n,r){t=i.getGraphDiv(t);var a=[],o=[],c=X,l=X,u=[t,r,n],d=[t,n,r],f;if(z(t,n,r),n=Array.isArray(n)?n:[n],r===void 0)for(r=[],f=0;f<n.length;f++)r.push(-n.length+f);for(r=Array.isArray(r)?r:[r],n=L(n,t.data.length-1),r=L(r,t.data.length-1),f=0;f<t.data.length;f++)n.indexOf(f)===-1&&a.push(t.data[f]);for(f=0;f<n.length;f++)o.push({newIndex:r[f],trace:t.data[n[f]]});for(o.sort(function(e,t){return e.newIndex-t.newIndex}),f=0;f<o.length;f+=1)a.splice(o[f].newIndex,0,o[f].trace);t.data=a;var p=e.redraw(t);return s.add(t,c,u,l,d),p}function Q(t,n,r,a){t=i.getGraphDiv(t),x.clearPromiseQueue(t);var o={};if(typeof n==`string`)o[n]=r;else if(i.isPlainObject(n))o=i.extendFlat({},n),a===void 0&&(a=r);else return i.warn(`Restyle fail.`,n,r,a),Promise.reject();Object.keys(o).length&&(t.changed=!0);var c=x.coerceTraceIndices(t,a),l=ie(t,o,c),d=l.flags;d.calc&&(t.calcdata=void 0),d.clearAxisTypes&&x.clearAxisTypes(t,c,{});var f=[];d.fullReplot?f.push(e._doPlot):(f.push(u.previousPromises),u.supplyDefaults(t),d.markerSize&&(u.doCalcdata(t),se(f)),d.style&&f.push(C.doTraceStyle),d.colorbars&&f.push(C.doColorBars),f.push(A)),f.push(u.rehover,u.redrag,u.reselect),s.add(t,Q,[t,l.undoit,l.traces],Q,[t,l.redoit,l.traces]);var p=i.syncOrAsync(f,t);return(!p||!p.then)&&(p=Promise.resolve()),p.then(function(){return t.emit(`plotly_restyle`,l.eventData),t})}function ee(e){return e===void 0?null:e}function te(e,t){return t?function(t,n,r){var i=a(t,n),o=i.set;return i.set=function(t){ne((r||``)+n,i.get(),t,e),o(t)},i}:a}function ne(e,t,n,r){if(Array.isArray(t)||Array.isArray(n))for(var a=Array.isArray(t)?t:[],o=Array.isArray(n)?n:[],s=Math.max(a.length,o.length),c=0;c<s;c++)ne(e+`[`+c+`]`,a[c],o[c],r);else if(i.isPlainObject(t)||i.isPlainObject(n)){var l=i.isPlainObject(t)?t:{},u=i.isPlainObject(n)?n:{};for(var d in i.extendFlat({},l,u))ne(e+`.`+d,l[d],u[d],r)}else r[e]===void 0&&(r[e]=ee(t))}function re(e,t,n){for(var r in n)ne(r,a(e,r).get(),n[r],t)}function ie(e,t,n){var r=e._fullLayout,o=e._fullData,s=e.data,f=r._guiEditing,p=te(r._preGUI,f),m=i.extendDeepAll({},t),h,g=w.traceFlags(),_={},v={},y;function b(){return n.map(function(){})}function S(e){var t=d.id2name(e);y.indexOf(t)===-1&&y.push(t)}function C(e){return`LAYOUT`+e+`.autorange`}function T(e){return`LAYOUT`+e+`.range`}function E(e){for(var t=e;t<o.length;t++)if(o[t]._input===s[e])return o[t]}function D(i,a,o){if(Array.isArray(i)){i.forEach(function(e){D(e,a,o)});return}if(!(i in t||x.hasParent(t,i))){var c;if(i.slice(0,6)===`LAYOUT`)c=p(e.layout,i.replace(`LAYOUT`,``));else{var l=n[o],u=r._tracePreGUI[E(l)._fullInput.uid];c=te(u,f)(s[l],i)}i in v||(v[i]=b()),v[i][o]===void 0&&(v[i][o]=ee(c.get())),a!==void 0&&c.set(a)}}function O(e){return function(t){return o[t][e]}}function k(e){return function(t,r){return t===!1?o[n[r]][e]:null}}for(var A in t){if(x.hasParent(t,A))throw Error(`cannot set `+A+` and a parent attribute simultaneously`);var j=t[A],M,N,P,F,I,L;if((A===`autobinx`||A===`autobiny`)&&(A=A.charAt(A.length-1)+`bins`,j=Array.isArray(j)?j.map(k(A)):j===!1?n.map(O(A)):null),_[A]=j,A.slice(0,6)===`LAYOUT`){P=p(e.layout,A.replace(`LAYOUT`,``)),v[A]=[ee(P.get())],P.set(Array.isArray(j)?j[0]:j),g.calc=!0;continue}for(v[A]=b(),h=0;h<n.length;h++){M=s[n[h]],N=E(n[h]);var R=r._tracePreGUI[N._fullInput.uid];if(P=te(R,f)(M,A),F=P.get(),I=Array.isArray(j)?j[h%j.length]:j,I!==void 0){var z=P.parts[P.parts.length-1],B=A.slice(0,A.length-z.length-1),V=B?B+`.`:``,H=B?a(N,B).get():N;if(L=l.getTraceValObject(N,P.parts),L&&L.impliedEdits&&I!==null)for(var U in L.impliedEdits)D(i.relativeAttr(A,U),L.impliedEdits[U],h);else if((z===`thicknessmode`||z===`lenmode`)&&F!==I&&(I===`fraction`||I===`pixels`)&&H){var W=r._size,G=H.orient,K=G===`top`||G===`bottom`;if(z===`thicknessmode`){var q=K?W.h:W.w;D(V+`thickness`,H.thickness*(I===`fraction`?1/q:q),h)}else{var J=K?W.w:W.h;D(V+`len`,H.len*(I===`fraction`?1/J:J),h)}}else if(A===`type`&&(I===`pie`!=(F===`pie`)||I===`funnelarea`!=(F===`funnelarea`))){var Y=`x`,X=`y`;(I===`bar`||F===`bar`)&&M.orientation===`h`&&(Y=`y`,X=`x`),i.swapAttrs(M,[`?`,`?src`],`labels`,Y),i.swapAttrs(M,[`d?`,`?0`],`label`,Y),i.swapAttrs(M,[`?`,`?src`],`values`,X),F===`pie`||F===`funnelarea`?(a(M,`marker.color`).set(a(M,`marker.colors`).get()),r._pielayer.selectAll(`g.trace`).remove()):c.traceIs(M,`cartesian`)&&a(M,`marker.colors`).set(a(M,`marker.color`).get())}if(v[A][h]=ee(F),[`swapxy`,`swapxyaxes`,`orientation`,`orientationaxes`].indexOf(A)!==-1){if(A===`orientation`){P.set(I);var Z=M.x&&!M.y?`h`:`v`;if((P.get()||Z)===N.orientation)continue}else A===`orientationaxes`&&(M.orientation={v:`h`,h:`v`}[N.orientation]);x.swapXYData(M),g.calc=g.clearAxisTypes=!0}else u.dataArrayContainers.indexOf(P.parts[0])===-1?(L?L.arrayOk&&!c.traceIs(N,`regl`)&&(i.isArrayOrTypedArray(I)||i.isArrayOrTypedArray(F))?g.calc=!0:w.update(g,L):g.calc=!0,P.set(I)):(x.manageArrayContainers(P,I,v),g.calc=!0)}}if([`swapxyaxes`,`orientationaxes`].indexOf(A)!==-1&&d.swap(e,n),A===`orientationaxes`){var Q=a(e.layout,`hovermode`),ne=Q.get();ne===`x`?Q.set(`y`):ne===`y`?Q.set(`x`):ne===`x unified`?Q.set(`y unified`):ne===`y unified`&&Q.set(`x unified`)}if([`orientation`,`type`].indexOf(A)!==-1){for(y=[],h=0;h<n.length;h++){var re=s[n[h]];c.traceIs(re,`cartesian`)&&(S(re.xaxis||`x`),S(re.yaxis||`y`))}D(y.map(C),!0,0),D(y.map(T),[0,1],0)}}return(g.calc||g.plot)&&(g.fullReplot=!0),{flags:g,undoit:v,redoit:_,traces:n,eventData:i.extendDeepNoArrays([],[m,n])}}function ae(e,t,n){e=i.getGraphDiv(e),x.clearPromiseQueue(e);var r={};if(typeof t==`string`)r[t]=n;else if(i.isPlainObject(t))r=i.extendFlat({},t);else return i.warn(`Relayout fail.`,t,n),Promise.reject();Object.keys(r).length&&(e.changed=!0);var a=de(e,r),o=a.flags;o.calc&&(e.calcdata=void 0);var c=[u.previousPromises];o.layoutReplot?c.push(C.layoutReplot):Object.keys(r).length&&(oe(e,o,a)||u.supplyDefaults(e),o.legend&&c.push(C.doLegend),o.layoutstyle&&c.push(C.layoutStyles),o.axrange&&se(c,a.rangesAltered),o.ticks&&c.push(C.doTicksRelayout),o.modebar&&c.push(C.doModeBar),o.camera&&c.push(C.doCamera),o.colorbars&&c.push(C.doColorBars),c.push(A)),c.push(u.rehover,u.redrag,u.reselect),s.add(e,ae,[e,a.undoit],ae,[e,a.redoit]);var l=i.syncOrAsync(c,e);return(!l||!l.then)&&(l=Promise.resolve(e)),l.then(function(){return e.emit(`plotly_relayout`,a.eventData),e})}function oe(e,t,n){var r=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if(a!==`axrange`&&t[a])return!1;var o,s,c=function(e,t){return i.coerce(o,s,p,e,t)},l={};for(var u in n.rangesAltered){var m=d.id2name(u);if(o=e.layout[m],s=r[m],f(o,s,c,l),s._matchGroup){for(var h in s._matchGroup)if(h!==u){var g=r[d.id2name(h)];g.autorange=s.autorange,g.range=s.range.slice(),g._input.range=s.range.slice()}}}return!0}function se(e,t){var n=t?function(e){var n=[],r=!0;for(var i in t){var a=d.getFromId(e,i);if(n.push(i),(a.ticklabelposition||``).indexOf(`inside`)!==-1&&a._anchorAxis&&n.push(a._anchorAxis._id),a._matchGroup)for(var o in a._matchGroup)t[o]||n.push(o)}return d.draw(e,n,{skipTitle:r})}:function(e){return d.draw(e,`redraw`)};e.push(v,C.doAutoRangeAndConstraints,n,C.drawData,C.finalDraw)}var ce=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,le=/^[xyz]axis[0-9]*\.autorange$/,ue=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function de(e,t){var n=e.layout,r=e._fullLayout,o=r._guiEditing,s=te(r._preGUI,o),u=Object.keys(t),f=d.list(e),p=i.extendDeepAll({},t),m={},h,g,_;for(u=Object.keys(t),g=0;g<u.length;g++)if(u[g].indexOf(`allaxes`)===0){for(_=0;_<f.length;_++){var v=f[_]._id.slice(1),y=v.indexOf(`scene`)===-1?``:v+`.`,S=u[g].replace(`allaxes`,y+f[_]._name);t[S]||(t[S]=t[u[g]])}delete t[u[g]]}var C=w.layoutFlags(),E={},D={};function O(e,r){if(Array.isArray(e)){e.forEach(function(e){O(e,r)});return}if(!(e in t||x.hasParent(t,e))){var i=s(n,e);e in D||(D[e]=ee(i.get())),r!==void 0&&i.set(r)}}var k={},A;function j(e){var t=d.name2id(e.split(`.`)[0]);return k[t]=1,t}for(var M in t){if(x.hasParent(t,M))throw Error(`cannot set `+M+` and a parent attribute simultaneously`);for(var N=s(n,M),P=t[M],F=N.parts.length-1;F>0&&typeof N.parts[F]!=`string`;)F--;var I=N.parts[F],L=N.parts[F-1]+`.`+I,R=N.parts.slice(0,F).join(`.`),z=a(e.layout,R).get(),B=a(r,R).get(),V=N.get();if(P!==void 0){E[M]=P,D[M]=I===`reverse`?P:ee(V);var H=l.getLayoutValObject(r,N.parts);if(H&&H.impliedEdits&&P!==null)for(var U in H.impliedEdits)O(i.relativeAttr(M,U),H.impliedEdits[U]);if([`width`,`height`].indexOf(M)!==-1)if(P){O(`autosize`,null);var W=M===`height`?`width`:`height`;O(W,r[W])}else r[M]=e._initialAutoSize[M];else if(M===`autosize`)O(`width`,P?null:r.width),O(`height`,P?null:r.height);else if(L.match(ce))j(L),a(r,R+`._inputRange`).set(null);else if(L.match(le)){j(L),a(r,R+`._inputRange`).set(null);var G=a(r,R).get();G._inputDomain&&(G._input.domain=G._inputDomain.slice())}else L.match(ue)&&a(r,R+`._inputDomain`).set(null);if(I===`type`){A=z;var K=B.type===`linear`&&P===`log`,q=B.type===`log`&&P===`linear`;if(K||q){if(!A||!A.range)O(R+`.autorange`,!0);else if(B.autorange)K&&(A.range=A.range[1]>A.range[0]?[1,2]:[2,1]);else{var J=A.range[0],Y=A.range[1];K?(J<=0&&Y<=0&&O(R+`.autorange`,!0),J<=0?J=Y/1e6:Y<=0&&(Y=J/1e6),O(R+`.range[0]`,Math.log(J)/Math.LN10),O(R+`.range[1]`,Math.log(Y)/Math.LN10)):(O(R+`.range[0]`,10**J),O(R+`.range[1]`,10**Y))}Array.isArray(r._subplots.polar)&&r._subplots.polar.length&&r[N.parts[0]]&&N.parts[1]===`radialaxis`&&delete r[N.parts[0]]._subplot.viewInitial[`radialaxis.range`],c.getComponentMethod(`annotations`,`convertCoords`)(e,B,P,O),c.getComponentMethod(`images`,`convertCoords`)(e,B,P,O)}else O(R+`.autorange`,!0),O(R+`.range`,null);a(r,R+`._inputRange`).set(null)}else if(I.match(T)){var X=a(r,M).get(),Z=(P||{}).type;(!Z||Z===`-`)&&(Z=`linear`),c.getComponentMethod(`annotations`,`convertCoords`)(e,X,Z,O),c.getComponentMethod(`images`,`convertCoords`)(e,X,Z,O)}var Q=b.containerArrayMatch(M);if(Q){h=Q.array,g=Q.index;var ne=Q.property,re=H||{editType:`calc`};g!==``&&ne===``&&(b.isAddVal(P)?D[M]=null:b.isRemoveVal(P)?D[M]=(a(n,h).get()||[])[g]:i.warn(`unrecognized full object value`,t)),w.update(C,re),m[h]||(m[h]={});var ie=m[h][g];ie||=m[h][g]={},ie[ne]=P,delete t[M]}else I===`reverse`?(z.range?z.range.reverse():(O(R+`.autorange`,!0),z.range=[1,0]),B.autorange?C.calc=!0:C.plot=!0):(M===`dragmode`&&(P===!1&&V!==!1||P!==!1&&V===!1)||r._has(`scatter-like`)&&r._has(`regl`)&&M===`dragmode`&&(P===`lasso`||P===`select`)&&!(V===`lasso`||V===`select`)?C.plot=!0:H?w.update(C,H):C.calc=!0,N.set(P))}}for(h in m)b.applyContainerArrayChanges(e,s(n,h),m[h],C,s)||(C.plot=!0);for(var ae in k){A=d.getFromId(e,ae);var oe=A&&A._constraintGroup;if(oe)for(var se in C.calc=!0,oe)k[se]||(d.getFromId(e,se)._constraintShrinkable=!0)}(fe(e)||t.height||t.width)&&(C.plot=!0);var de=r.shapes;for(g=0;g<de.length;g++)if(de[g].showlegend){C.calc=!0;break}return(C.plot||C.calc)&&(C.layoutReplot=!0),{flags:C,rangesAltered:k,undoit:D,redoit:E,eventData:p}}function fe(e){var t=e._fullLayout,n=t.width,r=t.height;return e.layout.autosize&&u.plotAutoSize(e,e.layout,t),t.width!==n||t.height!==r}function pe(t,n,r,a){t=i.getGraphDiv(t),x.clearPromiseQueue(t),i.isPlainObject(n)||(n={}),i.isPlainObject(r)||(r={}),Object.keys(n).length&&(t.changed=!0),Object.keys(r).length&&(t.changed=!0);var o=x.coerceTraceIndices(t,a),c=ie(t,i.extendFlat({},n),o),l=c.flags,d=de(t,i.extendFlat({},r)),f=d.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&x.clearAxisTypes(t,o,r);var p=[];f.layoutReplot?p.push(C.layoutReplot):l.fullReplot?p.push(e._doPlot):(p.push(u.previousPromises),oe(t,f,d)||u.supplyDefaults(t),l.style&&p.push(C.doTraceStyle),(l.colorbars||f.colorbars)&&p.push(C.doColorBars),f.legend&&p.push(C.doLegend),f.layoutstyle&&p.push(C.layoutStyles),f.axrange&&se(p,d.rangesAltered),f.ticks&&p.push(C.doTicksRelayout),f.modebar&&p.push(C.doModeBar),f.camera&&p.push(C.doCamera),p.push(A)),p.push(u.rehover,u.redrag,u.reselect),s.add(t,pe,[t,c.undoit,d.undoit,c.traces],pe,[t,c.redoit,d.redoit,c.traces]);var m=i.syncOrAsync(p,t);return(!m||!m.then)&&(m=Promise.resolve(t)),m.then(function(){return t.emit(`plotly_update`,{data:c.eventData,layout:d.eventData}),t})}function me(e){return function(t){t._fullLayout._guiEditing=!0;var n=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,n}}var he=[{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`}],ge=[{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 _e(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=e.match(r.pattern);if(i){var a=i[1]||``;return{head:a,tail:e.slice(a.length+1),attr:r.attr}}}}function ve(e,t){var n=a(t,e).get();if(n!==void 0)return n;var r=e.split(`.`);for(r.pop();r.length>1;)if(r.pop(),n=a(t,r.join(`.`)+`.uirevision`).get(),n!==void 0)return n;return t.uirevision}function ye(e,t){for(var n=0;n<t.length;n++)if(t[n]._fullInput.uid===e)return n;return-1}function be(e,t,n){for(var r=0;r<t.length;r++)if(t[r].uid===e)return r;return!t[n]||t[n].uid?-1:n}function xe(e,t){var n=i.isPlainObject(e),r=Array.isArray(e);return n||r?(n&&i.isPlainObject(t)||r&&Array.isArray(t))&&JSON.stringify(e)===JSON.stringify(t):e===t}function Se(e,t,n,r){var o=r._preGUI,s,c,l,u,d,f,p,m,h,g,_=[],v={},y={};for(s in o){if(d=_e(s,he),d){if(h=d.head,g=d.tail,c=d.attr||h+`.uirevision`,l=a(r,c).get(),u=l&&ve(c,t),u&&u===l){if(f=o[s],f===null&&(f=void 0),p=a(t,s),m=p.get(),xe(m,f)){m===void 0&&g===`autorange`&&_.push(h),p.set(ee(a(r,s).get()));continue}else if(g===`autorange`||g.slice(0,6)===`range[`){var b=o[h+`.range[0]`],x=o[h+`.range[1]`],S=o[h+`.autorange`];if(S||S===null&&b===null&&x===null){if(!(h in v)){var C=a(t,h).get();v[h]=C&&(C.autorange||C.autorange!==!1&&(!C.range||C.range.length!==2))}if(v[h]){p.set(ee(a(r,s).get()));continue}}}}}else i.warn(`unrecognized GUI edit: `+s);delete o[s],d&&d.tail.slice(0,6)===`range[`&&(y[d.head]=1)}for(var w=0;w<_.length;w++){var T=_[w];if(y[T]){var E=a(t,T).get();E&&delete E.autorange}}var D=r._tracePreGUI;for(var O in D){var k=D[O],A=null,j;for(s in k){if(!A){var M=ye(O,n);if(M<0){delete D[O];break}j=n[M]._fullInput;var N=be(O,e,j.index);if(N<0){delete D[O];break}A=e[N]}if(d=_e(s,ge),d){if(d.attr?(l=a(r,d.attr).get(),u=l&&ve(d.attr,t)):(l=j.uirevision,u=A.uirevision,u===void 0&&(u=t.uirevision)),u&&u===l&&(f=k[s],f===null&&(f=void 0),p=a(A,s),m=p.get(),xe(m,f))){p.set(ee(a(j,s).get()));continue}}else i.warn(`unrecognized GUI edit: `+s+` in trace uid `+O);delete k[s]}}}function Ce(t,n,r,a){var o,s;function l(){return e.addFrames(t,o)}t=i.getGraphDiv(t),x.clearPromiseQueue(t);var d=t._fullData,f=t._fullLayout;if(!i.isPlotDiv(t)||!d||!f)s=e.newPlot(t,n,r,a);else{if(i.isPlainObject(n)){var p=n;n=p.data,r=p.layout,a=p.config,o=p.frames}var m=!1;if(a){let e=i.extendDeepAll({},t._context);t._context=void 0,P(t,a),m=!x.collectionsAreEqual(e,t._context)}if(m){let i=t._ev.eventNames().map(e=>[e,t._ev.listeners(e)]);s=e.newPlot(t,n,r,a).then(()=>{for(let[e,n]of i)n.forEach(n=>t.on(e,n));return e.react(t,n,r,a)})}else{t.data=n||[],x.cleanData(t.data),t.layout=r||{},x.cleanLayout(t.layout),Se(t.data,t.layout,d,f),u.supplyDefaults(t,{skipUpdateCalc:!0});var h=t._fullData,g=t._fullLayout,_=g.datarevision===void 0,v=g.transition,y=Te(t,f,g,_,v),b=y.newDataRevision,S=we(t,d,h,_,v,b);if(fe(t)&&(y.layoutReplot=!0),S.calc||y.calc){t.calcdata=void 0;for(var w=Object.getOwnPropertyNames(g),T=0;T<w.length;T++){var E=w[T],D=E.substring(0,5);if(D===`xaxis`||D===`yaxis`){var O=g[E]._emptyCategories;O&&O()}}}else u.supplyDefaultsUpdateCalc(t.calcdata,h);var k=[];if(o&&(t._transitionData={},u.createTransitionData(t),k.push(l)),g.transition&&(S.anim||y.anim))y.ticks&&k.push(C.doTicksRelayout),u.doCalcdata(t),C.doAutoRangeAndConstraints(t),k.push(function(){return u.transitionFromReact(t,S,y,f)});else if(S.fullReplot||y.layoutReplot)t._fullLayout._skipDefaults=!0,k.push(e._doPlot);else{for(var j in y.arrays){var M=y.arrays[j];if(M.length){var N=c.getComponentMethod(j,`drawOne`);if(N!==i.noop)for(var F=0;F<M.length;F++)N(t,M[F]);else{var I=c.getComponentMethod(j,`draw`);if(I===i.noop)throw Error(`cannot draw components: `+j);I(t)}}}k.push(u.previousPromises),S.style&&k.push(C.doTraceStyle),(S.colorbars||y.colorbars)&&k.push(C.doColorBars),y.legend&&k.push(C.doLegend),y.layoutstyle&&k.push(C.layoutStyles),y.axrange&&se(k),y.ticks&&k.push(C.doTicksRelayout),y.modebar&&k.push(C.doModeBar),y.camera&&k.push(C.doCamera),k.push(A)}k.push(u.rehover,u.redrag,u.reselect),s=i.syncOrAsync(k,t),(!s||!s.then)&&(s=Promise.resolve(t))}}return s.then(()=>(m||t.emit(`plotly_react`,{config:a,data:n,layout:r}),t))}function we(e,t,n,r,i,a){var o=t.length===n.length;if(!i&&!o)return{fullReplot:!0,calc:!0};var s=w.traceFlags();s.arrays={},s.nChanges=0,s.nChangesAnim=0;var c,u;function d(e){var t=l.getTraceValObject(u,e);return!u._module.animatable&&t.anim&&(t.anim=!1),t}var f={getValObject:d,flags:s,immutable:r,transition:i,newDataRevision:a,gd:e},p={};for(c=0;c<t.length;c++)if(n[c]){if(u=n[c]._fullInput,p[u.uid])continue;p[u.uid]=1,Ee(t[c]._fullInput,u,[],f)}return(s.calc||s.plot)&&(s.fullReplot=!0),i&&s.nChanges&&s.nChangesAnim&&(s.anim=s.nChanges===s.nChangesAnim&&o?`all`:`some`),s}function Te(e,t,n,r,i){var a=w.layoutFlags();a.arrays={},a.rangesAltered={},a.nChanges=0,a.nChangesAnim=0;function o(e){return l.getLayoutValObject(n,e)}for(var s in n)if(!(!s.startsWith(`xaxis`)&&!s.startsWith(`yaxis`))&&t[s]){var c=n[s].domain,u=t[s].domain,d=t[s]._inputDomain;t[s]._inputDomain&&(c[0]===d[0]&&c[1]===d[1]?n[s].domain=t[s].domain:(c[0]!==u[0]||c[1]!==u[1])&&(n[s]._inputDomain=null))}return Ee(t,n,[],{getValObject:o,flags:a,immutable:r,transition:i,gd:e}),(a.plot||a.calc)&&(a.layoutReplot=!0),i&&a.nChanges&&a.nChangesAnim&&(a.anim=a.nChanges===a.nChangesAnim?`all`:`some`),a}function Ee(e,t,n,r){var a,o,s,c=r.getValObject,l=r.flags,u=r.immutable,d=r.inArray,f=r.arrayIndex;function p(){var e=a.editType;if(d&&e.indexOf(`arraydraw`)!==-1){i.pushUnique(l.arrays[d],f);return}w.update(l,a),e!==`none`&&l.nChanges++,r.transition&&a.anim&&l.nChangesAnim++,(ce.test(s)||le.test(s))&&(l.rangesAltered[n[0]]=1),o===`datarevision`&&(l.newDataRevision=1)}function m(e){return e.valType===`data_array`||e.arrayOk}for(o in e){if(l.calc&&!r.transition)return;var h=e[o],g=t[o],_=n.concat(o);if(s=_.join(`.`),!(o.charAt(0)===`_`||typeof h==`function`||h===g)){if((o===`tick0`||o===`dtick`)&&n[0]!==`geo`){var v=t.tickmode;if(v===`auto`||v===`array`||!v)continue}if(!(o===`range`&&t.autorange)&&!((o===`zmin`||o===`zmax`)&&t.type===`contourcarpet`)&&(a=c(_),a&&!(a._compareAsJSON&&JSON.stringify(h)===JSON.stringify(g)))){var y=a.valType,b,x=m(a),S=Array.isArray(h),C=Array.isArray(g);if(S&&C){var T=`_input_`+o,E=e[T],D=t[T];if(Array.isArray(E)&&E===D)continue}if(g===void 0)x&&S?l.calc=!0:p();else if(a._isLinkedToArray){var O=[],k=!1;d||(l.arrays[o]=O);var A=Math.min(h.length,g.length),j=Math.max(h.length,g.length);if(A!==j)if(a.editType===`arraydraw`)k=!0;else{p();continue}for(b=0;b<A;b++)Ee(h[b],g[b],_.concat(b),i.extendFlat({inArray:o,arrayIndex:b},r));if(k)for(b=A;b<j;b++)O.push(b)}else !y&&i.isPlainObject(h)?Ee(h,g,_,r):x?S&&C?(u&&(l.calc=!0),(u||r.newDataRevision)&&p()):S===C?p():l.calc=!0:S&&C?(h.length!==g.length||String(h)!==String(g))&&p():p()}}}for(o in t)if(!(o in e||o.charAt(0)===`_`||typeof t[o]==`function`))if(a=c(n.concat(o)),m(a)&&Array.isArray(t[o])){l.calc=!0;return}else p()}function De(e,t,n){if(e=i.getGraphDiv(e),!i.isPlotDiv(e))throw Error(`This element is not a Plotly plot: `+e+`. It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/`);var r=e._transitionData;r._frameQueue||=[],n=u.supplyAnimationDefaults(n);var a=n.transition,o=n.frame;r._frameWaitingCnt===void 0&&(r._frameWaitingCnt=0);function s(e){return Array.isArray(a)?e>=a.length?a[0]:a[e]:a}function c(e){return Array.isArray(o)?e>=o.length?o[0]:o[e]:o}function l(e,t){var n=0;return function(){if(e&&++n===t)return e()}}return new Promise(function(o,d){function f(){if(r._frameQueue.length!==0){for(;r._frameQueue.length;){var t=r._frameQueue.pop();t.onInterrupt&&t.onInterrupt()}e.emit(`plotly_animationinterrupted`,[])}}function p(t){if(t.length!==0){for(var i=0;i<t.length;i++){var a=t[i].type===`byname`?u.computeFrame(e,t[i].name):t[i].data,f=c(i),p=s(i);p.duration=Math.min(p.duration,f.duration);var m={frame:a,name:t[i].name,frameOpts:f,transitionOpts:p};i===t.length-1&&(m.onComplete=l(o,2),m.onInterrupt=d),r._frameQueue.push(m)}n.mode===`immediate`&&(r._lastFrameAt=-1/0),r._animationRaf||g()}}function m(){e.emit(`plotly_animated`),window.cancelAnimationFrame(r._animationRaf),r._animationRaf=null}function h(){r._currentFrame&&r._currentFrame.onComplete&&r._currentFrame.onComplete();var t=r._currentFrame=r._frameQueue.shift();if(t){var n=t.name?t.name.toString():null;e._fullLayout._currentFrame=n,r._lastFrameAt=Date.now(),r._timeToNext=t.frameOpts.duration,u.transition(e,t.frame.data,t.frame.layout,x.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then(function(){t.onComplete&&t.onComplete()}),e.emit(`plotly_animatingframe`,{name:n,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else m()}function g(){e.emit(`plotly_animating`),r._lastFrameAt=-1/0,r._timeToNext=0,r._runningTransitions=0,r._currentFrame=null;var t=function(){r._animationRaf=window.requestAnimationFrame(t),Date.now()-r._lastFrameAt>r._timeToNext&&h()};t()}var _=0;function v(e){return Array.isArray(a)?_>=a.length?e.transitionOpts=a[_]:e.transitionOpts=a[0]:e.transitionOpts=a,_++,e}var y,b,S=[],C=t==null,w=Array.isArray(t);if(!C&&!w&&i.isPlainObject(t))S.push({type:`object`,data:v(i.extendFlat({},t))});else if(C||[`string`,`number`].indexOf(typeof t)!==-1)for(y=0;y<r._frames.length;y++)b=r._frames[y],b&&(C||String(b.group)===String(t))&&S.push({type:`byname`,name:String(b.name),data:v({name:b.name})});else if(w)for(y=0;y<t.length;y++){var T=t[y];[`number`,`string`].indexOf(typeof T)===-1?i.isPlainObject(T)&&S.push({type:`object`,data:v(i.extendFlat({},T))}):(T=String(T),S.push({type:`byname`,name:T,data:v({name:T})}))}for(y=0;y<S.length;y++)if(b=S[y],b.type===`byname`&&!r._frameHash[b.data.name]){i.warn(`animate failure: frame not found: "`+b.data.name+`"`),d();return}[`next`,`immediate`].indexOf(n.mode)!==-1&&f(),n.direction===`reverse`&&S.reverse();var E=e._fullLayout._currentFrame;if(E&&n.fromcurrent){var D=-1;for(y=0;y<S.length;y++)if(b=S[y],b.type===`byname`&&b.name===E){D=y;break}if(D>0&&D<S.length-1){var O=[];for(y=0;y<S.length;y++)b=S[y],(S[y].type!==`byname`||y>D)&&O.push(b);S=O}}S.length>0?p(S):(e.emit(`plotly_animated`),o())})}function Oe(e,t,n){if(e=i.getGraphDiv(e),t==null)return Promise.resolve();if(!i.isPlotDiv(e))throw Error(`This element is not a Plotly plot: `+e+`. It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/`);var r,a,o,c,l=e._transitionData._frames,d=e._transitionData._frameHash;if(!Array.isArray(t))throw Error(`addFrames failure: frameList must be an Array of frame definitions`+t);var f=l.length+t.length*2,p=[],m={};for(r=t.length-1;r>=0;r--)if(i.isPlainObject(t[r])){var h=t[r].name,g=(d[h]||m[h]||{}).name,_=t[r].name,v=d[g]||m[g];g&&_&&typeof _==`number`&&v&&E<O&&(E++,i.warn(`addFrames: overwriting frame "`+(d[g]||m[g]).name+`" with a frame whose name of type "number" also equates to "`+g+`". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.`),E===O&&i.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.`)),m[h]={name:h},p.push({frame:u.supplyFrameDefaults(t[r]),index:n&&n[r]!==void 0&&n[r]!==null?n[r]:f+r})}p.sort(function(e,t){return e.index>t.index?-1:e.index<t.index?1:0});var y=[],b=[],x=l.length;for(r=p.length-1;r>=0;r--){if(a=p[r].frame,typeof a.name==`number`&&i.warn(`Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings`),!a.name)for(;d[a.name=`frame `+ e._transitionData._counter++];);if(d[a.name]){for(o=0;o<l.length&&(l[o]||{}).name!==a.name;o++);y.push({type:`replace`,index:o,value:a}),b.unshift({type:`replace`,index:o,value:l[o]})}else c=Math.max(0,Math.min(p[r].index,x)),y.push({type:`insert`,index:c,value:a}),b.unshift({type:`delete`,index:c}),x++}var S=u.modifyFrames,C=u.modifyFrames,w=[e,b],T=[e,y];return s&&s.add(e,S,w,C,T),u.modifyFrames(e,y)}function ke(e,t){if(e=i.getGraphDiv(e),!i.isPlotDiv(e))throw Error(`This element is not a Plotly plot: `+e);var n,r,a=e._transitionData._frames,o=[],c=[];if(!t)for(t=[],n=0;n<a.length;n++)t.push(n);for(t=t.slice(),t.sort(),n=t.length-1;n>=0;n--)r=t[n],o.push({type:`delete`,index:r}),c.unshift({type:`insert`,index:r,value:a[r]});var l=u.modifyFrames,d=u.modifyFrames,f=[e,c],p=[e,o];return s&&s.add(e,l,f,d,p),u.modifyFrames(e,o)}function Ae(e){e=i.getGraphDiv(e);var t=e._fullLayout||{},n=e._fullData||[];return u.cleanPlot([],{},n,t),u.purge(e),o.purge(e),t._container&&t._container.remove(),delete e._context,e}function je(e){var t=e._fullLayout,n=e.getBoundingClientRect();if(!i.equalDomRects(n,t._lastBBox)){var r=t._invTransform=i.inverseTransformMatrix(i.getFullTransformMatrix(e));t._invScaleX=Math.sqrt(r[0][0]*r[0][0]+r[0][1]*r[0][1]+r[0][2]*r[0][2]),t._invScaleY=Math.sqrt(r[1][0]*r[1][0]+r[1][1]*r[1][1]+r[1][2]*r[1][2]),t._lastBBox=n}}function Me(e){var n=t.select(e),r=e._fullLayout;if(r._calcInverseTransform=je,r._calcInverseTransform(e),r._container=n.selectAll(`.plot-container`).data([0]),r._container.enter().insert(`div`,`:first-child`).classed(`plot-container`,!0).classed(`plotly`,!0).style({width:`100%`,height:`100%`}),r._paperdiv=r._container.selectAll(`.svg-container`).data([0]),r._paperdiv.enter().append(`div`).classed(`user-select-none`,!0).classed(`svg-container`,!0).style(`position`,`relative`),r._glcontainer=r._paperdiv.selectAll(`.gl-container`).data([{}]),r._glcontainer.enter().append(`div`).classed(`gl-container`,!0),r._paperdiv.selectAll(`.main-svg`).remove(),r._paperdiv.select(`.modebar-container`).remove(),r._paper=r._paperdiv.insert(`svg`,`:first-child`).classed(`main-svg`,!0),r._toppaper=r._paperdiv.append(`svg`).classed(`main-svg`,!0),r._modebardiv=r._paperdiv.append(`div`),delete r._modeBar,r._hoverpaper=r._paperdiv.append(`svg`).classed(`main-svg`,!0),!r._uid){var a={};t.selectAll(`defs`).each(function(){this.id&&(a[this.id.split(`-`)[1]]=1)}),r._uid=i.randstr(a)}r._paperdiv.selectAll(`.main-svg`).attr(_.svgAttrs),r._defs=r._paper.append(`defs`).attr(`id`,`defs-`+r._uid),r._clips=r._defs.append(`g`).classed(`clips`,!0),r._topdefs=r._toppaper.append(`defs`).attr(`id`,`topdefs-`+r._uid),r._topclips=r._topdefs.append(`g`).classed(`clips`,!0),r._bgLayer=r._paper.append(`g`).classed(`bglayer`,!0),r._draggers=r._paper.append(`g`).classed(`draglayer`,!0);var o=r._paper.append(`g`).classed(`layer-below`,!0);r._imageLowerLayer=o.append(`g`).classed(`imagelayer`,!0),r._shapeLowerLayer=o.append(`g`).classed(`shapelayer`,!0),r._cartesianlayer=r._paper.append(`g`).classed(`cartesianlayer`,!0),r._polarlayer=r._paper.append(`g`).classed(`polarlayer`,!0),r._smithlayer=r._paper.append(`g`).classed(`smithlayer`,!0),r._ternarylayer=r._paper.append(`g`).classed(`ternarylayer`,!0),r._geolayer=r._paper.append(`g`).classed(`geolayer`,!0),r._funnelarealayer=r._paper.append(`g`).classed(`funnelarealayer`,!0),r._pielayer=r._paper.append(`g`).classed(`pielayer`,!0),r._iciclelayer=r._paper.append(`g`).classed(`iciclelayer`,!0),r._treemaplayer=r._paper.append(`g`).classed(`treemaplayer`,!0),r._sunburstlayer=r._paper.append(`g`).classed(`sunburstlayer`,!0),r._indicatorlayer=r._toppaper.append(`g`).classed(`indicatorlayer`,!0),r._glimages=r._paper.append(`g`).classed(`glimages`,!0);var s=r._toppaper.append(`g`).classed(`layer-above`,!0);r._imageUpperLayer=s.append(`g`).classed(`imagelayer`,!0),r._shapeUpperLayer=s.append(`g`).classed(`shapelayer`,!0),r._selectionLayer=r._toppaper.append(`g`).classed(`selectionlayer`,!0),r._infolayer=r._toppaper.append(`g`).classed(`infolayer`,!0),r._menulayer=r._toppaper.append(`g`).classed(`menulayer`,!0),r._zoomlayer=r._toppaper.append(`g`).classed(`zoomlayer`,!0),r._hoverlayer=r._hoverpaper.append(`g`).classed(`hoverlayer`,!0),r._modebardiv.classed(`modebar-container`,!0).style(`position`,`absolute`).style(`top`,`0px`).style(`right`,`0px`),e.emit(`plotly_framework`)}e.animate=De,e.addFrames=Oe,e.deleteFrames=ke,e.addTraces=J,e.deleteTraces=Y,e.extendTraces=G,e.moveTraces=X,e.prependTraces=K,e.newPlot=I,e._doPlot=k,e.purge=Ae,e.react=Ce,e.redraw=F,e.relayout=ae,e.restyle=Q,e.setPlotConfig=j,e.update=pe,e._guiRelayout=me(ae),e._guiRestyle=me(Q),e._guiUpdate=me(pe),e._storeDirectGUIEdit=re}),Lr=h(e=>{var t=Ke();e.getDelay=function(e){return e._has&&(e._has(`gl3d`)||e._has(`mapbox`)||e._has(`map`))?500:0},e.getRedrawFunc=function(e){return function(){t.getComponentMethod(`colorbar`,`draw`)(e)}},e.encodeSVG=function(e){return`data:image/svg+xml,`+encodeURIComponent(e)},e.encodeJSON=function(e){return`data:application/json,`+encodeURIComponent(e)};var n=window.URL||window.webkitURL;e.createObjectURL=function(e){return n.createObjectURL(e)},e.revokeObjectURL=function(e){return n.revokeObjectURL(e)},e.createBlob=function(e,t){if(t===`svg`)return new window.Blob([e],{type:`image/svg+xml;charset=utf-8`});if(t===`full-json`)return new window.Blob([e],{type:`application/json;charset=utf-8`});var n=r(window.atob(e));return new window.Blob([n],{type:`image/`+t})},e.octetStream=function(e){document.location.href=`data:application/octet-stream`+e};function r(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i<t;i++)r[i]=e.charCodeAt(i);return n}e.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/}),Rr=h((e,t)=>{var n=S();$();var r=tn(),i=q();Dt();var a=/"/g,o=`TOBESTRIPPED`,s=RegExp(`("`+o+`)|(`+o+`")`,`g`);function c(e){var t=n.select(`body`).append(`div`).style({display:`none`}).html(``),r=e.replace(/(&[^;]*;)/gi,function(e){return e===`&lt;`?`&#60;`:e===`&rt;`?`&#62;`:e.indexOf(`<`)!==-1||e.indexOf(`>`)!==-1?``:t.html(e).text()});return t.remove(),r}function l(e){return e.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,`&amp;`)}t.exports=function(e,t,u){var d=e._fullLayout,f=d._paper,p=d._toppaper,m=d.width,h=d.height,g;f.insert(`rect`,`:first-child`).call(r.setRect,0,0,m,h).call(i.fill,d.paper_bgcolor);var _=d._basePlotModules||[];for(g=0;g<_.length;g++){var v=_[g];v.toSVG&&v.toSVG(e)}if(p){var y=p.node().childNodes,b=Array.prototype.slice.call(y);for(g=0;g<b.length;g++){var x=b[g];x.childNodes.length&&f.node().appendChild(x)}}d._draggers&&d._draggers.remove(),f.node().style.background=``,f.selectAll(`text`).attr({"data-unformatted":null,"data-math":null}).each(function(){var e=n.select(this);if(this.style.visibility===`hidden`||this.style.display===`none`){e.remove();return}else e.style({visibility:null,display:null});var t=this.style.fontFamily;t&&t.indexOf(`"`)!==-1&&e.style(`font-family`,t.replace(a,o));var r=this.style.fontWeight;r&&(r===`normal`||r===`400`)&&e.style(`font-weight`,void 0);var i=this.style.fontStyle;i&&i===`normal`&&e.style(`font-style`,void 0);var s=this.style.fontVariant;s&&s===`normal`&&e.style(`font-variant`,void 0)}),f.selectAll(`.gradient_filled,.pattern_filled`).each(function(){var e=n.select(this),t=this.style.fill;t&&t.indexOf(`url(`)!==-1&&e.style(`fill`,t.replace(a,o));var r=this.style.stroke;r&&r.indexOf(`url(`)!==-1&&e.style(`stroke`,r.replace(a,o))}),(t===`pdf`||t===`eps`)&&f.selectAll(`#MathJax_SVG_glyphs path`).attr(`stroke-width`,0),t===`svg`&&u&&(f.attr(`width`,u*m),f.attr(`height`,u*h),f.attr(`viewBox`,`0 0 `+m+` `+h));var S=new window.XMLSerializer().serializeToString(f.node());return S=c(S),S=l(S),S=S.replace(s,`'`),S}}),zr=h((e,t)=>{var n=$(),r=mt().EventEmitter,i=Lr();function a(e){var t=e.emitter||new r,a=new Promise(function(r,a){var o=window.Image,s=e.svg,c=e.format||`png`,l=e.canvas,u=e.scale||1,d=e.width||300,f=e.height||150,p=u*d,m=u*f,h=l.getContext(`2d`,{willReadFrequently:!0}),g=new o,_,v;c===`svg`||n.isSafari()?v=i.encodeSVG(s):(_=i.createBlob(s,`svg`),v=i.createObjectURL(_)),l.width=p,l.height=m,g.onload=function(){var n;switch(_=null,i.revokeObjectURL(v),c!==`svg`&&h.drawImage(g,0,0,p,m),c){case`jpeg`:n=l.toDataURL(`image/jpeg`);break;case`png`:n=l.toDataURL(`image/png`);break;case`webp`:n=l.toDataURL(`image/webp`);break;case`svg`:n=v;break;default:var o=`Image format is not jpeg, png, svg or webp.`;if(a(Error(o)),!e.promise)return t.emit(`error`,o)}r(n),e.promise||t.emit(`success`,n)},g.onerror=function(n){if(_=null,i.revokeObjectURL(v),a(n),!e.promise)return t.emit(`error`,n)},g.src=v});return e.promise?a:t}t.exports=a}),Br=h((e,t)=>{var n=D(),r=Ir(),i=Et(),a=$(),o=Lr(),s=Rr(),c=zr(),l=b().version,u={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 d(e,t){t||={};var d,f,p,m;a.isPlainObject(e)?(d=e.data||[],f=e.layout||{},p=e.config||{},m={}):(e=a.getGraphDiv(e),d=a.extendDeep([],e.data),f=a.extendDeep({},e.layout),p=e._context,m=e._fullLayout||{});function h(e){return!(e in t)||a.validate(t[e],u[e])}if(!h(`width`)&&t.width!==null||!h(`height`)&&t.height!==null)throw Error(`Height and width should be pixel values.`);if(!h(`format`))throw Error(`Export format is not `+a.join2(u.format.values,`, `,` or `)+`.`);var g={};function _(e,n){return a.coerce(t,g,u,e,n)}var v=_(`format`),y=_(`width`),b=_(`height`),x=_(`scale`),S=_(`setBackground`),C=_(`imageDataOnly`),w=document.createElement(`div`);w.style.position=`absolute`,w.style.left=`-5000px`,document.body.appendChild(w);var T=a.extendFlat({},f);y?T.width=y:t.width===null&&n(m.width)&&(T.width=m.width),b?T.height=b:t.height===null&&n(m.height)&&(T.height=m.height);var E=a.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:S}),D=o.getRedrawFunc(w);function O(){return new Promise(function(e){setTimeout(e,o.getDelay(w._fullLayout))})}function k(){return new Promise(function(e,t){var n=s(w,v,x),u=w._fullLayout.width,d=w._fullLayout.height;function f(){r.purge(w),document.body.removeChild(w)}if(v===`full-json`){var p=i.graphJson(w,!1,`keepdata`,`object`,!0,!0);return p.version=l,p=JSON.stringify(p),f(),e(C?p:o.encodeJSON(p))}if(f(),v===`svg`)return e(C?n:o.encodeSVG(n));var m=document.createElement(`canvas`);m.id=a.randstr(),c({format:v,width:u,height:d,scale:x,canvas:m,svg:n,promise:!0}).then(e).catch(t)})}function A(e){return C?e.replace(o.IMAGE_URL_PREFIX,``):e}return new Promise(function(e,t){r.newPlot(w,d,T,E).then(D).then(O).then(k).then(function(t){e(A(t))}).catch(function(e){t(e)})})}t.exports=d}),Vr=h((e,t)=>{var n=$(),r=Et(),i=vt(),a=Z().dfltConfig,o=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;t.exports=function(e,t){e===void 0&&(e=[]),t===void 0&&(t={});var c=i.get(),d=[],f={_context:n.extendFlat({},a)},m,h;s(e)?(f.data=n.extendDeep([],e),m=e):(f.data=[],m=[],d.push(p(`array`,`data`))),o(t)?(f.layout=n.extendDeep({},t),h=t):(f.layout={},h={},arguments.length>1&&d.push(p(`object`,`layout`))),r.supplyDefaults(f);for(var g=f._fullData,_=m.length,v=0;v<_;v++){var y=m[v],b=[`data`,v];if(!o(y)){d.push(p(`object`,b));continue}var x=g[v],S=x.type,C=c.traces[S].attributes;C.type={valType:`enumerated`,values:[S]},x.visible===!1&&y.visible!==!1&&d.push(p(`invisible`,b)),l(y,x,C,d,b)}var w=f._fullLayout,T=u(c,g);return l(h,w,T,d,`layout`),d.length===0?void 0:d};function l(e,t,r,i,a,u){u||=[];for(var d=Object.keys(e),f=0;f<d.length;f++){var g=d[f],_=u.slice();_.push(g);var v=e[g],y=t[g],b=h(r,g),x=(b||{}).valType,S=x===`info_array`,C=x===`colorscale`,w=(b||{}).items;if(!m(r,g))i.push(p(`schema`,a,_));else if(o(v)&&o(y)&&x!==`any`)l(v,y,b,i,a,_);else if(S&&s(v)){v.length>y.length&&i.push(p(`unused`,a,_.concat(y.length)));var T=y.length,E=Array.isArray(w);E&&(T=Math.min(T,w.length));var D,O,k,A,j;if(b.dimensions===2)for(O=0;O<T;O++)if(s(v[O])){v[O].length>y[O].length&&i.push(p(`unused`,a,_.concat(O,y[O].length)));var M=y[O].length;for(D=0;D<(E?Math.min(M,w[O].length):M);D++)k=E?w[O][D]:w,A=v[O][D],j=y[O][D],n.validate(A,k)?j!==A&&j!==+A&&i.push(p(`dynamic`,a,_.concat(O,D),A,j)):i.push(p(`value`,a,_.concat(O,D),A))}else i.push(p(`array`,a,_.concat(O),v[O]));else for(O=0;O<T;O++)k=E?w[O]:w,A=v[O],j=y[O],n.validate(A,k)?j!==A&&j!==+A&&i.push(p(`dynamic`,a,_.concat(O),A,j)):i.push(p(`value`,a,_.concat(O),A))}else if(b.items&&!S&&s(v)){var N=w[Object.keys(w)[0]],P=[],F,I;for(F=0;F<y.length;F++){var L=y[F]._index||F;if(I=_.slice(),I.push(L),o(v[L])&&o(y[F])){P.push(L);var R=v[L],z=y[F];o(R)&&R.visible!==!1&&z.visible===!1?i.push(p(`invisible`,a,I)):l(R,z,N,i,a,I)}}for(F=0;F<v.length;F++)I=_.slice(),I.push(F),o(v[F])?P.indexOf(F)===-1&&i.push(p(`unused`,a,I)):i.push(p(`object`,a,I,v[F]))}else !o(v)&&o(y)?i.push(p(`object`,a,_,v)):!c(v)&&c(y)&&!S&&!C?i.push(p(`array`,a,_,v)):g in t?n.validate(v,b)?b.valType===`enumerated`&&(b.coerceNumber&&v!==+y||!c(v)&&v!==y||String(v)!==String(y))&&i.push(p(`dynamic`,a,_,v,y)):i.push(p(`value`,a,_,v)):i.push(p(`unused`,a,_,v))}return i}function u(e,t){for(var r=e.layout.layoutAttributes,i=0;i<t.length;i++){var a=t[i],o=e.traces[a.type],s=o.layoutAttributes;s&&(a.subplot?n.extendFlat(r[o.attributes.subplot.dflt],s):n.extendFlat(r,s))}return r}var d={object:function(e,t){var n;return n=e===`layout`&&t===``?`The layout argument`:e[0]===`data`&&t===``?`Trace `+e[1]+` in the data argument`:f(e)+`key `+t,n+` must be linked to an object container`},array:function(e,t){var n;return n=e===`data`?`The data argument`:f(e)+`key `+t,n+` must be linked to an array container`},schema:function(e,t){return f(e)+`key `+t+` is not part of the schema`},unused:function(e,t,n){var r=o(n)?`container`:`key`;return f(e)+r+` `+t+` did not get coerced`},dynamic:function(e,t,n,r){return[f(e)+`key`,t,`(set to '`+n+`')`,`got reset to`,`'`+r+`'`,`during defaults.`].join(` `)},invisible:function(e,t){return(t?f(e)+`item `+t:`Trace `+e[1])+` got defaulted to be not visible`},value:function(e,t,n){return[f(e)+`key `+t,`is set to an invalid value (`+n+`)`].join(` `)}};function f(e){return s(e)?`In data trace `+e[1]+`, `:`In `+e+`, `}function p(e,t,r,i,a){r||=``;var o,c;s(t)?(o=t[0],c=t[1]):(o=t,c=null);var l=v(r),u=d[e](t,l,i,a);return n.log(u),{code:e,container:o,trace:c,path:r,astr:l,msg:u}}function m(e,t){var n=_(t),r=n.keyMinusId,i=n.id;return r in e&&e[r]._isSubplotObj&&i?!0:t in e}function h(e,t){return t in e?e[t]:e[_(t).keyMinusId]}var g=n.counterRegex(`([a-z]+)`);function _(e){var t=e.match(g);return{keyMinusId:t&&t[1],id:t&&t[2]}}function v(e){if(!s(e))return String(e);for(var t=``,n=0;n<e.length;n++){var r=e[n];typeof r==`number`?t=t.slice(0,-1)+`[`+r+`]`:t+=r,n<e.length-1&&(t+=`.`)}return t}}),Hr=h((e,t)=>{var n=$(),r=Lr();function i(e,t,i){var a=document.createElement(`a`),o=`download`in a;return new Promise(function(s,c){var l,u;if(o)return l=r.createBlob(e,i),u=r.createObjectURL(l),a.href=u,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),r.revokeObjectURL(u),l=null,s(t);if(n.isSafari()){var d=i===`svg`?`,`:`;base64,`;return r.octetStream(d+encodeURIComponent(e)),s(t)}c(Error(`download error`))})}t.exports=i}),Ur=h((e,t)=>{var n=$(),r=Br(),i=Hr();Lr();function a(e,t){var a;return n.isPlainObject(e)||(a=n.getGraphDiv(e)),t||={},t.format=t.format||`png`,t.width=t.width||null,t.height=t.height||null,t.imageDataOnly=!0,new Promise(function(n,o){a&&a._snapshotInProgress&&o(Error(`Snapshotting already in progress.`)),a&&(a._snapshotInProgress=!0);var s=r(e,t),c=t.filename||e.fn||`newplot`;c+=`.`+t.format.replace(`-`,`.`),s.then(function(e){return a&&(a._snapshotInProgress=!1),i(e,c,t.format)}).then(function(e){n(e)}).catch(function(e){a&&(a._snapshotInProgress=!1),o(e)})})}t.exports=a}),Wr=h(e=>{var t=$(),n=t.isPlainObject,r=vt(),i=Et(),a=W(),o=yt(),s=Z().dfltConfig;e.makeTemplate=function(e){e=t.isPlainObject(e)?e:t.getGraphDiv(e),e=t.extendDeep({_context:s},{data:e.data,layout:e.layout}),i.supplyDefaults(e);var r=e.data||[],o=e.layout||{};o._basePlotModules=e._fullLayout._basePlotModules,o._modules=e._fullLayout._modules;var l={data:{},layout:{}};r.forEach(function(e){var n={};u(e,n,f.bind(null,e));var r=t.coerce(e,{},a,`type`),i=l.data[r];i||=l.data[r]=[],i.push(n)}),u(o,l.layout,d.bind(null,o)),delete l.layout.template;var p=o.template;if(n(p)){var m=p.layout,h,g,_,v,y,b;n(m)&&c(m,l.layout);var x=p.data;if(n(x)){for(g in l.data)if(_=x[g],Array.isArray(_)){for(y=l.data[g],b=y.length,v=_.length,h=0;h<b;h++)c(_[h%v],y[h]);for(h=b;h<v;h++)y.push(t.extendDeep({},_[h]))}for(g in x)g in l.data||(l.data[g]=t.extendDeep([],x[g]))}}return l};function c(e,r){e=t.extendDeep({},e);var i=Object.keys(e).sort(),a,s;function u(t,r,i){if(n(r)&&n(t))c(t,r);else if(Array.isArray(r)&&Array.isArray(t)){var a=o.arrayTemplater({_template:e},i);for(s=0;s<r.length;s++){var l=r[s],u=a.newItem(l)._template;u&&c(u,l)}var d=a.defaultItems();for(s=0;s<d.length;s++)r.push(d[s]._template);for(s=0;s<r.length;s++)delete r[s].templateitemname}}for(a=0;a<i.length;a++){var d=i[a],f=e[d];if(d in r?u(f,r[d],d):r[d]=f,l(d)===d)for(var p in r){var m=l(p);p!==m&&m===d&&!(p in e)&&u(f,r[p],d)}}}function l(e){return e.replace(/[0-9]+$/,``)}function u(e,r,i,a,s){var c=s&&i(s);for(var d in e){var f=e[d],m=p(e,d,a),h=p(e,d,s),g=i(h);if(!g){var _=l(d);_!==d&&(h=p(e,_,s),g=i(h))}if(!(c&&c===g)&&!(!g||g._noTemplating||g.valType===`data_array`||g.arrayOk&&Array.isArray(f)))if(!g.valType&&n(f))u(f,r,i,m,h);else if(g._isLinkedToArray&&Array.isArray(f))for(var v=!1,y=0,b={},x=0;x<f.length;x++){var S=f[x];if(n(S)){var C=S.name;if(C)b[C]||(u(S,r,i,p(f,y,m),p(f,y,h)),y++,b[C]=1);else if(!v){var w=p(e,o.arrayDefaultKey(d),a),T=p(f,y,m);u(S,r,i,T,p(f,y,h));var E=t.nestedProperty(r,T);t.nestedProperty(r,w).set(E.get()),E.set(null),v=!0}}}else t.nestedProperty(r,m).set(f)}}function d(e,n){return r.getLayoutValObject(e,t.nestedProperty({},n).parts)}function f(e,n){return r.getTraceValObject(e,t.nestedProperty({},n).parts)}function p(e,t,n){var r;return r=n?Array.isArray(e)?n+`[`+t+`]`:n+`.`+t:t,r}e.validateTemplate=function(e,r){var a=t.extendDeep({},{_context:s,data:e.data,layout:e.layout}),o=a.layout||{};n(r)||(r=o.template||{});var c=r.layout,u=r.data,d=[];a.layout=o,a.layout.template=r,i.supplyDefaults(a);var f=a._fullLayout,g=a._fullData,_={};function v(e,t){for(var r in e)if(r.charAt(0)!==`_`&&n(e[r])){var i=l(r),a=[],o;for(o=0;o<t.length;o++)a.push(p(e,r,t[o])),i!==r&&a.push(p(e,i,t[o]));for(o=0;o<a.length;o++)_[a[o]]=1;v(e[r],a)}}function y(e,t){for(var r in e)if(r.indexOf(`defaults`)===-1&&n(e[r])){var i=p(e,r,t);_[i]?y(e[r],i):d.push({code:`unused`,path:i})}}if(n(c)?(v(f,[`layout`]),y(c,`layout`)):d.push({code:`layout`}),!n(u))d.push({code:`data`});else{for(var b={},x,S=0;S<g.length;S++){var C=g[S];x=C.type,b[x]=(b[x]||0)+1,C._fullInput._template||d.push({code:`missing`,index:C.index,traceType:x})}for(x in u){var w=u[x].length,T=b[x]||0;w>T?d.push({code:`unused`,traceType:x,templateCount:w,dataCount:T}):T>w&&d.push({code:`reused`,traceType:x,templateCount:w,dataCount:T})}}function E(e,t){for(var r in e)if(r.charAt(0)!==`_`){var i=e[r],a=p(e,r,t);n(i)?(Array.isArray(e)&&i._template===!1&&i.templateitemname&&d.push({code:`missing`,path:a,templateitemname:i.templateitemname}),E(i,a)):Array.isArray(i)&&m(i)&&E(i,a)}}if(E({data:g,layout:f},``),d.length)return d.map(h)};function m(e){for(var t=0;t<e.length;t++)if(n(e[t]))return!0}function h(e){var t;switch(e.code){case`data`:t=`The template has no key data.`;break;case`layout`:t=`The template has no key layout.`;break;case`missing`:t=e.path?`There are no templates for item `+e.path+` with name `+e.templateitemname:`There are no templates for trace `+e.index+`, of type `+e.traceType+`.`;break;case`unused`:t=e.path?`The template item at `+e.path+` was not used in constructing the plot.`:e.dataCount?`Some of the templates of type `+e.traceType+` were not used. The template has `+e.templateCount+` traces, the data only has `+e.dataCount+` of this type.`:`The template has `+e.templateCount+` traces of type `+e.traceType+` but there are none in the data.`;break;case`reused`:t=`Some of the templates of type `+e.traceType+` were used more than once. The template has `+e.templateCount+` traces, the data has `+e.dataCount+` of this type.`;break}return e.msg=t,e}}),Gr=h(e=>{var t=Ir();e._doPlot=t._doPlot,e.newPlot=t.newPlot,e.restyle=t.restyle,e.relayout=t.relayout,e.redraw=t.redraw,e.update=t.update,e._guiRestyle=t._guiRestyle,e._guiRelayout=t._guiRelayout,e._guiUpdate=t._guiUpdate,e._storeDirectGUIEdit=t._storeDirectGUIEdit,e.react=t.react,e.extendTraces=t.extendTraces,e.prependTraces=t.prependTraces,e.addTraces=t.addTraces,e.deleteTraces=t.deleteTraces,e.moveTraces=t.moveTraces,e.purge=t.purge,e.addFrames=t.addFrames,e.deleteFrames=t.deleteFrames,e.animate=t.animate,e.setPlotConfig=t.setPlotConfig;var n=Pe().getGraphDiv,r=Xn().eraseActiveShape;e.deleteActiveShape=function(e){return r(n(e))},e.toImage=Br(),e.validate=Vr(),e.downloadImage=Ur();var i=Wr();e.makeTemplate=i.makeTemplate,e.validateTemplate=i.validateTemplate}),Kr=h((e,t)=>{var n=$(),r=Ke();t.exports=function(e,t,i,a){var o=a(`x`),s=a(`y`),c;if(r.getComponentMethod(`calendars`,`handleTraceDefaults`)(e,t,[`x`,`y`],i),o){var l=n.minRowLength(o);s?c=Math.min(l,n.minRowLength(s)):(c=l,a(`y0`),a(`dy`))}else{if(!s)return 0;c=n.minRowLength(s),a(`x0`),a(`dx`)}return t._length=c,c}}),qr=h((e,t)=>{var n=$().dateTick0,r=O().ONEWEEK;function i(e,t){return e%r===0?n(t,1):n(t,0)}t.exports=function(e,t,n,r,a){if(a||={x:!0,y:!0},a.x){var o=r(`xperiod`);o&&(r(`xperiod0`,i(o,t.xcalendar)),r(`xperiodalignment`))}if(a.y){var s=r(`yperiod`);s&&(r(`yperiod0`,i(s,t.ycalendar)),r(`yperiodalignment`))}}}),Jr=h((e,t)=>{var n=[`orientation`,`groupnorm`,`stackgaps`];t.exports=function(e,t,r,i){var a=r._scatterStackOpts,o=i(`stackgroup`);if(o){var s=t.xaxis+t.yaxis,c=a[s];c||=a[s]={};var l=c[o],u=!1;l?l.traces.push(t):(l=c[o]={traceIndices:[],traces:[t]},u=!0);for(var d={orientation:t.x&&!t.y?`h`:`v`},f=0;f<n.length;f++){var p=n[f],m=p+`Found`;if(!l[m]){var h=e[p]!==void 0,g=p===`orientation`;if((h||u)&&(l[p]=i(p,d[p]),g&&(l.fillDflt=l[p]===`h`?`tonextx`:`tonexty`),h&&(l[m]=!0,!u&&(delete l.traces[0][p],g))))for(var _=0;_<l.traces.length-1;_++){var v=l.traces[_];v._input.fill!==v.fill&&(v.fill=l.fillDflt)}}}return l}}}),Yr=h((e,t)=>{var n=q(),r=At().hasColorscale,i=Gt(),a=Xt();t.exports=function(e,t,o,s,c,l={}){var u=a.isBubble(e),d=(e.line||{}).color,f;d&&(o=d),c(`marker.symbol`),c(`marker.opacity`,u?.7:1),c(`marker.size`),l.noAngle||(c(`marker.angle`),l.noAngleRef||c(`marker.angleref`),l.noStandOff||c(`marker.standoff`)),c(`marker.color`,o),r(e,`marker`)&&i(e,t,s,c,{prefix:`marker.`,cLetter:`c`}),l.noSelect||(c(`selected.marker.color`),c(`unselected.marker.color`),c(`selected.marker.size`),c(`unselected.marker.size`)),l.noLine||(f=d&&!Array.isArray(d)&&t.marker.color!==d?d:u?n.background:n.defaultLine,c(`marker.line.color`,f),r(e,`marker.line`)&&i(e,t,s,c,{prefix:`marker.line.`,cLetter:`c`}),c(`marker.line.width`,u?1:0),l.noLineDash||c(`marker.line.dash`)),u&&(c(`marker.sizeref`),c(`marker.sizemin`),c(`marker.sizemode`)),l.gradient&&c(`marker.gradient.type`)!==`none`&&c(`marker.gradient.color`)}}),Xr=h((e,t)=>{var n=$().isArrayOrTypedArray,r=At().hasColorscale,i=Gt();t.exports=function(e,t,a,o,s,c){c||={};var l=(e.marker||{}).color;l&&l._inputArray&&(l=l._inputArray),s(`line.color`,a),r(e,`line`)?i(e,t,o,s,{prefix:`line.`,cLetter:`c`}):s(`line.color`,(n(l)?!1:l)||a),s(`line.width`),c.noDash||s(`line.dash`),c.backoff&&s(`line.backoff`)}}),Zr=h((e,t)=>{t.exports=function(e,t,n){n(`line.shape`)===`spline`&&n(`line.smoothing`)}}),Qr=h((e,t)=>{var n=$();t.exports=function(e,t,r,i,a){a||={},i(`textposition`),n.coerceFont(i,`textfont`,a.font||r.font,a),a.noSelect||(i(`selected.textfont.color`),i(`unselected.textfont.color`))}}),$r=h((e,t)=>{var n=q(),r=$().isArrayOrTypedArray;function i(e){for(var t=n.interpolate(e[0][1],e[1][1],.5),r=2;r<e.length;r++){var i=n.interpolate(e[r-1][1],e[r][1],.5);t=n.interpolate(t,i,e[r-1][0]/e[r][0])}return t}t.exports=function(e,t,a,o,s){s||={};var c=!1;if(t.marker){var l=t.marker.color,u=(t.marker.line||{}).color;l&&!r(l)?c=l:u&&!r(u)&&(c=u)}var d;if(s.moduleHasFillgradient&&o(`fillgradient.type`)!==`none`){o(`fillgradient.start`),o(`fillgradient.stop`);var f=o(`fillgradient.colorscale`);f&&(d=i(f))}o(`fillcolor`,n.addOpacity((t.line||{}).color||c||d||a,.5))}}),ei=h((e,t)=>{var n=$(),r=Ke(),i=Tr(),a=Cr(),o=Xt(),s=Kr(),c=qr(),l=Jr(),u=Yr(),d=Xr(),f=Zr(),p=Qr(),m=$r(),h=$().coercePattern;t.exports=function(e,t,g,_){function v(r,a){return n.coerce(e,t,i,r,a)}var y=s(e,t,_,v);if(y||(t.visible=!1),t.visible){c(e,t,_,v),v(`xhoverformat`),v(`yhoverformat`),v(`zorder`);var b=l(e,t,_,v);_.scattermode===`group`&&t.orientation===void 0&&v(`orientation`,`v`);var x=!b&&y<a.PTS_LINESONLY?`lines+markers`:`lines`;v(`text`),v(`hovertext`),v(`mode`,x),o.hasMarkers(t)&&u(e,t,g,_,v,{gradient:!0}),o.hasLines(t)&&(d(e,t,g,_,v,{backoff:!0}),f(e,t,v),v(`connectgaps`),v(`line.simplify`)),o.hasText(t)&&(v(`texttemplate`),v(`texttemplatefallback`),p(e,t,_,v));var S=[];(o.hasMarkers(t)||o.hasText(t))&&(v(`cliponaxis`),v(`marker.maxdisplayed`),S.push(`points`)),v(`fill`,b?b.fillDflt:`none`),t.fill!==`none`&&(m(e,t,g,v,{moduleHasFillgradient:!0}),o.hasLines(t)||f(e,t,v),h(v,`fillpattern`,t.fillcolor,!1));var C=(t.line||{}).color,w=(t.marker||{}).color;(t.fill===`tonext`||t.fill===`toself`)&&S.push(`fills`),v(`hoveron`,S.join(`+`)||`points`),t.hoveron!==`fills`&&(v(`hovertemplate`),v(`hovertemplatefallback`));var T=r.getComponentMethod(`errorbars`,`supplyDefaults`);T(e,t,C||w||g,{axis:`y`}),T(e,t,C||w||g,{axis:`x`,inherit:`y`}),n.coerceSelectionMarkerOpacity(t,v)}}}),ti=h((e,t)=>{var n=ar().getAxisGroup;t.exports=function(e,t,r,i,a){var o=t.orientation,s=t[{v:`x`,h:`y`}[o]+`axis`],c=n(r,s)+o,l=r._alignmentOpts||{},u=i(`alignmentgroup`),d=l[c];d||=l[c]={};var f=d[u];f?f.traces.push(t):f=d[u]={traces:[t],alignmentIndex:Object.keys(d).length,offsetGroups:{}};var p=i(`offsetgroup`)||``,m=f.offsetGroups,h=m[p];t._offsetIndex=0,(a!==`group`||p)&&(h||=m[p]={offsetIndex:Object.keys(m).length},t._offsetIndex=h.offsetIndex)}}),ni=h((e,t)=>{var n=$(),r=ti(),i=Tr();t.exports=function(e,t){var a,o,s,c=t.scattermode;function l(e){return n.coerce(o._input,o,i,e)}if(t.scattermode===`group`)for(s=0;s<e.length;s++)o=e[s],o.type===`scatter`&&(a=o._input,r(a,o,t,l,c));for(s=0;s<e.length;s++){var u=e[s];if(u.type===`scatter`){var d=u.fill;if(!(d===`none`||d===`toself`)&&(u.opacity=void 0,d===`tonexty`||d===`tonextx`))for(var f=s-1;f>=0;f--){var p=e[f];if(p.type===`scatter`&&p.xaxis===u.xaxis&&p.yaxis===u.yaxis){p.opacity=void 0;break}}}}}}),ri=h((e,t)=>{var n=$(),r=Ct();t.exports=function(e,t){function i(i,a){return n.coerce(e,t,r,i,a)}var a=t.barmode===`group`;t.scattermode===`group`&&i(`scattergap`,a?t.bargap:.2)}}),ii=h((e,t)=>{var n=D(),r=$(),i=r.dateTime2ms,a=r.incrementMonth,o=O().ONEAVGMONTH;t.exports=function(e,t,r,s){if(t.type!==`date`)return{vals:s};var c=e[r+`periodalignment`];if(!c)return{vals:s};var l=e[r+`period`],u;if(n(l)){if(l=+l,l<=0)return{vals:s}}else if(typeof l==`string`&&l.charAt(0)===`M`){var d=+l.substring(1);if(d>0&&Math.round(d)===d)u=d;else return{vals:s}}for(var f=t.calendar,p=c===`start`,m=c===`end`,h=e[r+`period0`],g=i(h,f)||0,_=[],v=[],y=[],b=s.length,x=0;x<b;x++){var S=s[x],C,w,T;if(u){for(C=Math.round((S-g)/(u*o)),T=a(g,u*C,f);T>S;)T=a(T,-u,f);for(;T<=S;)T=a(T,u,f);w=a(T,-u,f)}else{for(C=Math.round((S-g)/l),T=g+C*l;T>S;)T-=l;for(;T<=S;)T+=l;w=T-l}_[x]=p?w:m?T:(w+T)/2,v[x]=w,y[x]=T}return{vals:_,starts:v,ends:y}}}),ai=h((e,t)=>{var n=At().hasColorscale,r=Jt(),i=Xt();t.exports=function(e,t){i.hasLines(t)&&n(t,`line`)&&r(e,t,{vals:t.line.color,containerStr:`line`,cLetter:`c`}),i.hasMarkers(t)&&(n(t,`marker`)&&r(e,t,{vals:t.marker.color,containerStr:`marker`,cLetter:`c`}),n(t,`marker.line`)&&r(e,t,{vals:t.marker.line.color,containerStr:`marker.line`,cLetter:`c`}))}}),oi=h((e,t)=>{var n=$();t.exports=function(e,t){for(var r=0;r<e.length;r++)e[r].i=r;n.mergeArray(t.text,e,`tx`),n.mergeArray(t.texttemplate,e,`txt`),n.mergeArray(t.hovertext,e,`htx`),n.mergeArray(t.customdata,e,`data`),n.mergeArray(t.textposition,e,`tp`),t.textfont&&(n.mergeArrayCastPositive(t.textfont.size,e,`ts`),n.mergeArray(t.textfont.color,e,`tc`),n.mergeArray(t.textfont.family,e,`tf`),n.mergeArray(t.textfont.weight,e,`tw`),n.mergeArray(t.textfont.style,e,`ty`),n.mergeArray(t.textfont.variant,e,`tv`),n.mergeArray(t.textfont.textcase,e,`tC`),n.mergeArray(t.textfont.lineposition,e,`tE`),n.mergeArray(t.textfont.shadow,e,`tS`));var i=t.marker;if(i){n.mergeArrayCastPositive(i.size,e,`ms`),n.mergeArrayCastPositive(i.opacity,e,`mo`),n.mergeArray(i.symbol,e,`mx`),n.mergeArray(i.angle,e,`ma`),n.mergeArray(i.standoff,e,`mf`),n.mergeArray(i.color,e,`mc`);var a=i.line;i.line&&(n.mergeArray(a.color,e,`mlc`),n.mergeArrayCastPositive(a.width,e,`mlw`),n.mergeArray(a.dash,e,`mld`));var o=i.gradient;o&&o.type!==`none`&&(n.mergeArray(o.type,e,`mgt`),n.mergeArray(o.color,e,`mgc`))}}}),si=h((e,t)=>{var n=$();t.exports=function(e,t){n.isArrayOrTypedArray(t.selectedpoints)&&n.tagSelected(e,t)}}),ci=h((e,t)=>{var n=D(),r=$(),i=sn(),a=ii(),o=O().BADNUM,s=Xt(),c=ai(),l=oi(),u=si();function d(e,t){var s=e._fullLayout,d=t._xA=i.getFromId(e,t.xaxis||`x`,`x`),h=t._yA=i.getFromId(e,t.yaxis||`y`,`y`),_=d.makeCalcdata(t,`x`),v=h.makeCalcdata(t,`y`),y=a(t,d,`x`,_),b=a(t,h,`y`,v),x=y.vals,S=b.vals,C=t._length,w=Array(C),T=t.ids,E=g(t,s,d,h),D=!1,O,k,A,j,M,N;m(s,t);var P=`x`,F=`y`,I;E?(r.pushUnique(E.traceIndices,t.index),O=E.orientation===`v`,O?(F=`s`,I=`x`):(P=`s`,I=`y`),M=E.stackgaps===`interpolate`):f(e,t,d,h,x,S,p(t,C));var L=!!t.xperiodalignment,R=!!t.yperiodalignment;for(k=0;k<C;k++){var z=w[k]={},B=n(x[k]),V=n(S[k]);B&&V?(z[P]=x[k],z[F]=S[k],L&&(z.orig_x=_[k],z.xEnd=y.ends[k],z.xStart=y.starts[k]),R&&(z.orig_y=v[k],z.yEnd=b.ends[k],z.yStart=b.starts[k])):E&&(O?B:V)?(z[I]=O?x[k]:S[k],z.gap=!0,M?(z.s=o,D=!0):z.s=0):z[P]=z[F]=o,T&&(z.id=String(T[k]))}if(l(w,t),c(e,t),u(w,t),E){for(k=0;k<w.length;)w[k][I]===o?w.splice(k,1):k++;if(r.sort(w,function(e,t){return e[I]-t[I]||e.i-t.i}),D){for(k=0;k<w.length-1&&w[k].gap;)k++;for(N=w[k].s,N||=w[k].s=0,A=0;A<k;A++)w[A].s=N;for(j=w.length-1;j>k&&w[j].gap;)j--;for(N=w[j].s,A=w.length-1;A>j;A--)w[A].s=N;for(;k<j;)if(k++,w[k].gap){for(A=k+1;w[A].gap;)A++;for(var H=w[k-1][I],U=w[k-1].s,W=(w[A].s-U)/(w[A][I]-H);k<A;)w[k].s=U+(w[k][I]-H)*W,k++}}}return w}function f(e,t,n,r,a,o,c){var l=t._length,u=e._fullLayout,d=n._id,f=r._id,p=u._firstScatter[h(t)]===t.uid,m=(g(t,u,n,r)||{}).orientation,_=t.fill;n._minDtick=0,r._minDtick=0;var v={padded:!0},y={padded:!0};c&&(v.ppad=y.ppad=c);var b=l<2||a[0]!==a[l-1]||o[0]!==o[l-1];b&&(_===`tozerox`||_===`tonextx`&&(p||m===`h`))?v.tozero=!0:!(t.error_y||{}).visible&&(_===`tonexty`||_===`tozeroy`||!s.hasMarkers(t)&&!s.hasText(t))&&(v.padded=!1,v.ppad=0),b&&(_===`tozeroy`||_===`tonexty`&&(p||m===`v`))?y.tozero=!0:(_===`tonextx`||_===`tozerox`)&&(y.padded=!1),d&&(t._extremes[d]=i.findExtremes(n,a,v)),f&&(t._extremes[f]=i.findExtremes(r,o,y))}function p(e,t){if(s.hasMarkers(e)){var n=e.marker,a=1.6*(e.marker.sizeref||1),o;if(o=e.marker.sizemode===`area`?function(e){return Math.max(Math.sqrt((e||0)/a),3)}:function(e){return Math.max((e||0)/a,3)},r.isArrayOrTypedArray(n.size)){var c={type:`linear`};i.setConvert(c);for(var l=c.makeCalcdata(e.marker,`size`),u=Array(t),d=0;d<t;d++)u[d]=o(l[d]);return u}else return o(n.size)}}function m(e,t){var n=h(t),r=e._firstScatter;r[n]||(r[n]=t.uid)}function h(e){var t=e.stackgroup;return e.xaxis+e.yaxis+e.type+(t?`-`+t:``)}function g(e,t,n,r){var i=e.stackgroup;if(i){var a=t._scatterStackOpts[n._id+r._id][i],o=a.orientation===`v`?r:n;if(o.type===`linear`||o.type===`log`)return a}}t.exports={calc:d,calcMarkerSize:p,calcAxisExpansion:f,setFirstScatter:m,getStackOpts:g}}),li=h((e,t)=>{t.exports=r;var n=$().distinctVals;function r(e,t){this.traces=e,this.sepNegVal=t.sepNegVal,this.overlapNoMerge=t.overlapNoMerge;for(var r=1/0,i=t.posAxis._id.charAt(0),a=[],o=0;o<e.length;o++){for(var s=e[o],c=0;c<s.length;c++){var l=s[c],u=l.p;u===void 0&&(u=l[i]),u!==void 0&&a.push(u)}s[0]&&s[0].width1&&(r=Math.min(s[0].width1,r))}this.positions=a;var d=n(a);this.distinctPositions=d.vals,d.vals.length===1&&r!==1/0?this.minDiff=r:this.minDiff=Math.min(d.minDiff,r);var f=(t.posAxis||{}).type;(f===`category`||f===`multicategory`)&&(this.minDiff=1),this.binWidth=this.minDiff,this.bins={}}r.prototype.put=function(e,t,n){var r=this.getLabel(e,t,n),i=this.bins[r]||0;return this.bins[r]=i+n,i},r.prototype.get=function(e,t,n){var r=this.getLabel(e,t,n);return this.bins[r]||0},r.prototype.getLabel=function(e,t,n){return(n<0&&this.sepNegVal?`v`:`^`)+(this.overlapNoMerge?e:Math.round(e/this.binWidth))+`g`+t}}),ui=h((e,t)=>{t.exports={TEXTPAD:3,eventDataKeys:[`value`,`label`]}}),di=h((e,t)=>{var n=D(),{isArrayOrTypedArray:r}=$(),{BADNUM:i}=O(),a=Ke(),o=sn(),{getAxisGroup:s}=ar(),c=li(),{TEXTPAD:l}=ui(),{LINE_SPACING:u}=Ot(),{BR_TAG_ALL:d}=kt();function f(e,t){for(var n=t.xaxis,r=t.yaxis,i=e._fullLayout,o=e._fullData,s=e.calcdata,c=[],l=[],u=0;u<o.length;u++){var d=o[u];if(d.visible===!0&&a.traceIs(d,`bar`)&&d.xaxis===n._id&&d.yaxis===r._id&&(d.orientation===`h`?c.push(s[u]):l.push(s[u]),d._computePh))for(var f=e.calcdata[u],m=0;m<f.length;m++)typeof f[m].ph0==`function`&&(f[m].ph0=f[m].ph0()),typeof f[m].ph1==`function`&&(f[m].ph1=f[m].ph1())}var h={xCat:n.type===`category`||n.type===`multicategory`,yCat:r.type===`category`||r.type===`multicategory`,mode:i.barmode,norm:i.barnorm,gap:i.bargap,groupgap:i.bargroupgap};p(e,n,r,l,h),p(e,r,n,c,h)}function p(e,t,n,r,i){if(r.length){var a,o,s,c,l;switch(g(n,r),i.mode){case`overlay`:_(e,t,n,r,i);break;case`group`:for(a=[],o=[],s=0;s<r.length;s++)c=r[s],l=c[0].trace,l.offset===void 0?o.push(c):a.push(c);o.length&&v(e,t,n,o,i),a.length&&_(e,t,n,a,i);break;case`stack`:case`relative`:for(a=[],o=[],s=0;s<r.length;s++)c=r[s],l=c[0].trace,l.base===void 0?o.push(c):a.push(c);h(o),o.length&&y(e,t,n,o,i),a.length&&_(e,t,n,a,i);break}m(r),N(r,t)}}function m(e){var t,r,i,a,o,s,c;for(t=0;t<e.length;t++)r=e[t],i=r[0].trace,a=r[0].t,a.cornerradiusvalue===void 0&&(o=i.marker?i.marker.cornerradius:void 0,o!==void 0&&(s=n(o)?+o:+o.slice(0,-1),c=n(o)?`px`:`%`,a.cornerradiusvalue=s,a.cornerradiusform=c))}function h(e){if(!(e.length<2)){var t,r,i,a,o,s,c;for(t=0;t<e.length&&(r=e[t],i=r[0].trace,o=i.marker?i.marker.cornerradius:void 0,o===void 0);t++);if(o!==void 0)for(s=n(o)?+o:+o.slice(0,-1),c=n(o)?`px`:`%`,t=0;t<e.length;t++)r=e[t],a=r[0].t,a.cornerradiusvalue=s,a.cornerradiusform=c}}function g(e,t){var i,a;for(i=0;i<t.length;i++){var o=t[i],s=o[0].trace,c=s.type===`funnel`?s._base:s.base,l,u=s.orientation===`h`?s.xcalendar:s.ycalendar,d=e.type===`category`||e.type===`multicategory`?function(){return null}:e.d2c;if(r(c)){for(a=0;a<Math.min(c.length,o.length);a++)l=d(c[a],0,u),n(l)?(o[a].b=+l,o[a].hasB=1):o[a].b=0;for(;a<o.length;a++)o[a].b=0}else{l=d(c,0,u);var f=n(l);for(l=f?l:0,a=0;a<o.length;a++)o[a].b=l,f&&(o[a].hasB=1)}}}function _(e,t,n,r,i){for(var a=0;a<r.length;a++){var o=r[a],s=new c([o],{posAxis:t,sepNegVal:!1,overlapNoMerge:!i.norm});b(e,t,s,i),i.norm?(E(s),A(n,s,i)):w(n,s)}}function v(e,t,n,r,i){var a=new c(r,{posAxis:t,sepNegVal:!1,overlapNoMerge:!i.norm});b(e,t,a,i),k(a,t),i.norm?(E(a),A(n,a,i)):w(n,a)}function y(e,t,n,r,a){var o=new c(r,{posAxis:t,sepNegVal:a.mode===`relative`,overlapNoMerge:!(a.norm||a.mode===`stack`||a.mode===`relative`)});b(e,t,o,a),T(n,o,a);for(var s=0;s<r.length;s++)for(var l=r[s],u=l[0].t.offsetindex,d=0;d<l.length;d++){var f=l[d];f.s!==i&&f.b+f.s===o.get(f.p,u,f.s)&&(f._outmost=!0)}a.norm&&A(n,o,a)}function b(e,t,n,r){var i=e._fullLayout,a=n.positions,o=n.distinctPositions,c=n.minDiff,l=n.traces,u=l.length,d=a.length!==o.length,f=c*(1-r.gap),p,m,h,g;if(t._id===`angularaxis`)p=f,m=p*(1-(r.groupgap||0)),h=-m/2;else{var _=s(i,t._id)+l[0][0].trace.orientation;g=i._alignmentOpts[_]||{}}for(var v=0;v<u;v++){var y=l[v],b=y[0].trace;if(t._id!==`angularaxis`){var w=g[b.alignmentgroup]||{},T=Object.keys(w.offsetGroups||{}).length;p=T?f/T:d?f/u:f,m=p*(1-(r.groupgap||0)),h=T?((2*b._offsetIndex+1-T)*p-m)/2:d?((2*v+1-u)*p-m)/2:-m/2}var E=y[0].t;E.barwidth=m,E.offsetindex=b._offsetIndex||0,E.poffset=h,E.bargroupwidth=f,E.bardelta=c}n.binWidth=l[0][0].t.barwidth/100,x(n),S(t,n),t._id===`angularaxis`?C(t,n):C(t,n,d)}function x(e){var t=e.traces,i,a;for(i=0;i<t.length;i++){var o=t[i],s=o[0],c=s.trace,l=s.t,u=c._offset||c.offset,d=l.poffset,f;if(r(u)){for(f=Array.prototype.slice.call(u,0,o.length),a=0;a<f.length;a++)n(f[a])||(f[a]=d);for(a=f.length;a<o.length;a++)f.push(d);l.poffset=f}else u!==void 0&&(l.poffset=u);var p=c._width||c.width,m=l.barwidth;if(r(p)){var h=Array.prototype.slice.call(p,0,o.length);for(a=0;a<h.length;a++)n(h[a])||(h[a]=m);for(a=h.length;a<o.length;a++)h.push(m);if(l.barwidth=h,u===void 0){for(f=[],a=0;a<o.length;a++)f.push(d+(m-h[a])/2);l.poffset=f}}else p!==void 0&&(l.barwidth=p,u===void 0&&(l.poffset=d+(m-p)/2))}}function S(e,t){for(var n=t.traces,i=P(e),a=0;a<n.length;a++)for(var o=n[a],s=o[0].t,c=s.poffset,l=r(c),u=s.barwidth,d=r(u),f=0;f<o.length;f++){var p=o[f],m=p.w=d?u[f]:u;p.p===void 0&&(p.p=p[i],p[`orig_`+i]=p[i]);var h=(l?c[f]:c)+m/2;p[i]=p.p+h}}function C(e,t,n){var i=t.traces,a=t.minDiff/2;o.minDtick(e,t.minDiff,t.distinctPositions[0],n);for(var s=0;s<i.length;s++){var c=i[s],l=c[0],u=l.trace,d=[],f,p,m,h;for(h=0;h<c.length;h++)f=c[h],p=f.p-a,m=f.p+a,d.push(p,m);if(u.width||u.offset){var g=l.t,_=g.poffset,v=g.barwidth,y=r(_),b=r(v);for(h=0;h<c.length;h++){f=c[h];var x=y?_[h]:_,S=b?v[h]:v;p=f.p+x,m=p+S,d.push(p,m)}}u._extremes[e._id]=o.findExtremes(e,d,{padded:!1})}}function w(e,t){for(var n=t.traces,r=P(e),i=0;i<n.length;i++){for(var a=n[i],s=a[0].trace,c=s.type===`scatter`,l=s.orientation===`v`,u=[],d=!1,f=0;f<a.length;f++){var p=a[f],m=c?0:p.b,h=c?l?p.y:p.x:m+p.s;p[r]=h,u.push(h),p.hasB&&u.push(m),(!p.hasB||!p.b)&&(d=!0)}let{ppadminus:t,ppadplus:g}=j(s,a);s._extremes[e._id]=o.findExtremes(e,u,{tozero:d,padded:!0,ppadplus:g,ppadminus:t})}}function T(e,t,n){var r=P(e),a=t.traces,s,c,l,u,d,f,p;for(u=0;u<a.length;u++)if(s=a[u],c=s[0].trace,c.type===`funnel`)for(p=s[0].t.offsetindex,d=0;d<s.length;d++)f=s[d],f.s!==i&&t.put(f.p,p,-.5*f.s);for(u=0;u<a.length;u++){s=a[u],c=s[0].trace,l=c.type===`funnel`,p=c.type===`barpolar`?0:s[0].t.offsetindex;var m=[];for(d=0;d<s.length;d++)if(f=s[d],f.s!==i){var h=l?f.s:f.s+f.b,g=t.put(f.p,p,h),_=g+h;f.b=g,f[r]=_,n.norm||(m.push(_),f.hasB&&m.push(g))}if(!n.norm){let{ppadminus:t,ppadplus:n}=j(c,s);c._extremes[e._id]=o.findExtremes(e,m,{tozero:!0,padded:!0,ppadplus:n,ppadminus:t})}}}function E(e){for(var t=e.traces,n=0;n<t.length;n++)for(var r=t[n],a=r[0].t.offsetindex,o=0;o<r.length;o++){var s=r[o];s.s!==i&&e.put(s.p,a,s.b+s.s)}}function k(e,t){for(var n=e.traces,r=0;r<n.length;r++){var a=n[r],o=a[0].trace,s=a[0].t.offsetindex;if(o.base===void 0)for(var l=new c([a],{posAxis:t,sepNegVal:!0,overlapNoMerge:!0}),u=0;u<a.length;u++){var d=a[u];if(d.p!==i){var f=l.put(d.p,s,d.b+d.s);f&&(d.b=f)}}}}function A(e,t,r){var a=t.traces,s=P(e),c=r.norm===`fraction`?1:100,l=c/1e9,u=e.l2c(e.c2l(0)),d=r.mode===`stack`?c:u;function f(t){return n(e.c2l(t))&&(t<u-l||t>d+l||!n(u))}for(var p=0;p<a.length;p++){for(var m=a[p],h=m[0].t.offsetindex,g=m[0].trace,_=[],v=!1,y=!1,b=0;b<m.length;b++){var x=m[b];if(x.s!==i){var S=Math.abs(c/t.get(x.p,h,x.s));x.b*=S,x.s*=S;var C=x.b,w=C+x.s;x[s]=w,_.push(w),y||=f(w),x.hasB&&(_.push(C),y||=f(C)),(!x.hasB||!x.b)&&(v=!0)}}let{ppadminus:n,ppadplus:r}=j(g,m);g._extremes[e._id]=o.findExtremes(e,_,{tozero:v,padded:y,ppadplus:r,ppadminus:n})}}function j(e,t){if(e.orientation===`v`&&(e.text||e.texttemplate)&&e.textposition===`outside`&&(e.textangle===`auto`||e.textangle===0)){let i=function(e){return!e||typeof e!=`string`?0:(e.match(d)||[]).length+1};var n=e.texttemplate?i(e.texttemplate):r(e.text)?Math.max(...e.text.map(e=>i(e))):i(e.text);let a=e.outsidetextfont.size*u*n+l;return{ppadplus:t.some(e=>e.s<0)?a:0,ppadminus:t.some(e=>e.s>=0)?a:0}}return{ppadplus:void 0,ppadminus:void 0}}function M(e,t,n,r){for(var i=P(r),a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var c=o[s],l=c[i];c._sMin=t[l],c._sMax=n[l]}}function N(e,t){var i=P(t),a={},o,s,c,l=1/0,u=-1/0;for(o=0;o<e.length;o++)for(c=e[o],s=0;s<c.length;s++){var d=c[s].p;n(d)&&(l=Math.min(l,d),u=Math.max(u,d))}var f=1e4/(u-l),p=a.round=function(e){return String(Math.round(f*(e-l)))},m={},h={},g=e.some(function(e){var t=e[0].trace;return`marker`in t&&t.marker.cornerradius});for(o=0;o<e.length;o++){c=e[o],c[0].t.extents=a;var _=c[0].t.poffset,v=r(_);for(s=0;s<c.length;s++){var y=c[s],b=y[i]-y.w/2;if(n(b)){var x=y[i]+y.w/2,S=p(y.p);a[S]?a[S]=[Math.min(b,a[S][0]),Math.max(x,a[S][1])]:a[S]=[b,x]}if(y.p0=y.p+(v?_[s]:_),y.p1=y.p0+y.w,y.s0=y.b,y.s1=y.s0+y.s,g){var C=Math.min(y.s0,y.s1)||0,w=Math.max(y.s0,y.s1)||0,T=y[i];m[T]=T in m?Math.min(m[T],C):C,h[T]=T in h?Math.max(h[T],w):w}}}g&&M(e,m,h,t)}function P(e){return e._id.charAt(0)}t.exports={crossTraceCalc:f,setGroupPositions:p}}),fi=h((e,t)=>{var n=ci(),r=di().setGroupPositions;function i(e,t){for(var n=t.xaxis,i=t.yaxis,a=e._fullLayout,o=e._fullData,s=e.calcdata,c=[],l=[],u=0;u<o.length;u++){var d=o[u];d.visible===!0&&d.type===`scatter`&&d.xaxis===n._id&&d.yaxis===i._id&&(d.orientation===`h`?c.push(s[u]):d.orientation===`v`&&l.push(s[u]))}var f={mode:a.scattermode,gap:a.scattergap};r(e,n,i,l,f),r(e,i,n,c,f)}t.exports=function(e,t){e._fullLayout.scattermode===`group`&&i(e,t);var r=t.xaxis,o=t.yaxis,s=r._id+o._id,c=e._fullLayout._scatterStackOpts[s];if(c){var l=e.calcdata,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w;for(var T in c){y=c[T];var E=y.traceIndices;if(E.length){for(b=y.stackgaps===`interpolate`,x=y.groupnorm,y.orientation===`v`?(S=`x`,C=`y`):(S=`y`,C=`x`),w=Array(E.length),u=0;u<w.length;u++)w[u]=!1;h=l[E[0]];var D=Array(h.length);for(u=0;u<h.length;u++)D[u]=h[u][S];for(u=1;u<E.length;u++){for(m=l[E[u]],d=f=0;d<m.length;d++){for(g=m[d][S];g>D[f]&&f<D.length;f++)a(m,d,D[f],u,w,b,S),d++;if(g!==D[f]){for(p=0;p<u;p++)a(l[E[p]],f,g,p,w,b,S);D.splice(f,0,g)}f++}for(;f<D.length;f++)a(m,d,D[f],u,w,b,S),d++}var O=D.length;for(d=0;d<h.length;d++){for(_=h[d][C]=h[d].s,u=1;u<E.length;u++)m=l[E[u]],m[0].trace._rawLength=m[0].trace._length,m[0].trace._length=O,_+=m[d].s,m[d][C]=_;if(x)for(v=(x===`fraction`?_:_/100)||1,u=0;u<E.length;u++){var k=l[E[u]][d];k[C]/=v,k.sNorm=k.s/v}}for(u=0;u<E.length;u++){m=l[E[u]];var A=m[0].trace,j=n.calcMarkerSize(A,A._rawLength),M=Array.isArray(j);if(j&&w[u]||M){var N=j;for(j=Array(O),d=0;d<O;d++)j[d]=m[d].gap?0:M?N[m[d].i]:N}var P=Array(O),F=Array(O);for(d=0;d<O;d++)P[d]=m[d].x,F[d]=m[d].y;n.calcAxisExpansion(e,A,r,o,P,F,j),m[0].t.orientation=y.orientation}}}}};function a(e,t,n,r,i,a,s){i[r]=!0;var c={i:null,gap:!0,s:0};if(c[s]=n,e.splice(t,0,c),t&&n===e[t-1][s]){var l=e[t-1];c.s=l.s,c.i=l.i,c.gap=l.gap}else a&&(c.s=o(e,t,n,s));t||(e[0].t=e[1].t,e[0].trace=e[1].trace,delete e[1].t,delete e[1].trace)}function o(e,t,n,r){var i=e[t-1],a=e[t+1];return a?i?i.s+(a.s-i.s)*(n-i[r])/(a[r]-i[r]):a.s:i.s}}),pi=h((e,t)=>{var n=tn(),r=O(),i=r.BADNUM,a=r.LOG_CLIP,o=a+.5,s=a-.5,c=$(),l=c.segmentsIntersect,u=c.constrain,d=Cr();t.exports=function(e,t){var r=t.trace||{},a=t.xaxis,f=t.yaxis,p=a.type===`log`,m=f.type===`log`,h=a._length,g=f._length,_=t.backoff,v=r.marker,y=t.connectGaps,b=t.baseTolerance,x=t.shape,S=x===`linear`,C=r.fill&&r.fill!==`none`,w=[],T=d.minTolerance,E=e.length,D=Array(E),O=0,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W;function G(n){var r=e[n];if(!r)return!1;var c=t.linearized?a.l2p(r.x):a.c2p(r.x),l=t.linearized?f.l2p(r.y):f.c2p(r.y);if(c===i){if(p&&(c=a.c2p(r.x,!0)),c===i)return!1;m&&l===i&&(c*=Math.abs(a._m*g*(a._m>0?o:s)/(f._m*h*(f._m>0?o:s)))),c*=1e3}if(l===i){if(m&&(l=f.c2p(r.y,!0)),l===i)return!1;l*=1e3}return[c,l]}function K(e,t,n,r){var i=n-e,a=r-t,o=.5-e,s=.5-t,c=i*i+a*a,l=i*o+a*s;if(l>0&&l<c){var u=o*a-s*i;if(u*u<c)return!0}}var q,J;function Y(e,t){var n=e[0]/h,r=e[1]/g,i=Math.max(0,-n,n-1,-r,r-1);return i&&q!==void 0&&K(n,r,q,J)&&(i=0),i&&t&&K(n,r,t[0]/h,t[1]/g)&&(i=0),(1+d.toleranceGrowth*i)*b}function X(e,t){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}var Z=d.maxScreensAway,Q=-h*Z,ee=h*(1+Z),te=-g*Z,ne=g*(1+Z),re=[[Q,te,ee,te],[ee,te,ee,ne],[ee,ne,Q,ne],[Q,ne,Q,te]],ie,ae,oe,se,ce,le;function ue(e,t){for(var n=[],r=0,i=0;i<4;i++){var a=re[i],o=l(e[0],e[1],t[0],t[1],a[0],a[1],a[2],a[3]);o&&(!r||Math.abs(o.x-n[0][0])>1||Math.abs(o.y-n[0][1])>1)&&(o=[o.x,o.y],r&&X(o,e)<X(n[0],e)?n.unshift(o):n.push(o),r++)}return n}function de(e){if(e[0]<Q||e[0]>ee||e[1]<te||e[1]>ne)return[u(e[0],Q,ee),u(e[1],te,ne)]}function fe(e,t){if(e[0]===t[0]&&(e[0]===Q||e[0]===ee)||e[1]===t[1]&&(e[1]===te||e[1]===ne))return!0}function pe(e,t){var n=[],r=de(e),i=de(t);return r&&i&&fe(r,i)||(r&&n.push(r),i&&n.push(i)),n}function me(e,t,n){return function(r,i){var a=de(r),o=de(i),s=[];if(a&&o&&fe(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*c.constrain((r[e]+i[e])/2,t,n)-((a||r)[e]+(o||i)[e]);if(l){var u=a&&o?l>0==a[e]>o[e]?a:o:a||o;u[e]+=l}return s}}var he;x===`linear`||x===`spline`?he=ue:x===`hv`||x===`vh`?he=pe:x===`hvh`?he=me(0,Q,ee):x===`vhv`&&(he=me(1,te,ne));function ge(e,t){var n=t[0]-e[0],r=(t[1]-e[1])/n;return(e[1]*t[0]-t[1]*e[0])/n>0?[r>0?Q:ee,ne]:[r>0?ee:Q,te]}function _e(e){var t=e[0],n=e[1],r=t===D[O-1][0],i=n===D[O-1][1];if(!(r&&i))if(O>1){var a=t===D[O-2][0],o=n===D[O-2][1];r&&(t===Q||t===ee)&&a?o?O--:D[O-1]=e:i&&(n===te||n===ne)&&o?a?O--:D[O-1]=e:D[O++]=e}else D[O++]=e}function ve(e){D[O-1][0]!==e[0]&&D[O-1][1]!==e[1]&&_e([oe,se]),_e(e),ce=null,oe=se=0}var ye=c.isArrayOrTypedArray(v);function be(t){if(t&&_&&(t.i=k,t.d=e,t.trace=r,t.marker=ye?v[t.i]:v,t.backoff=_),q=t[0]/h,J=t[1]/g,ie=t[0]<Q?Q:t[0]>ee?ee:0,ae=t[1]<te?te:t[1]>ne?ne:0,ie||ae){if(!O)D[O++]=[ie||t[0],ae||t[1]];else if(ce){var n=he(ce,t);n.length>1&&(ve(n[0]),D[O++]=n[1])}else le=he(D[O-1],t)[0],D[O++]=le;var i=D[O-1];ie&&ae&&(i[0]!==ie||i[1]!==ae)?(ce&&(oe!==ie&&se!==ae?_e(oe&&se?ge(ce,t):[oe||ie,se||ae]):oe&&se&&_e([oe,se])),_e([ie,ae])):oe-ie&&se-ae&&_e([ie||oe,ae||se]),ce=t,oe=ie,se=ae}else ce&&ve(he(ce,t)[0]),D[O++]=t}for(k=0;k<E;k++)if(A=G(k),A){for(O=0,ce=null,be(A),k++;k<E;k++){if(M=G(k),!M){if(y)continue;break}if(!S||!t.simplify){be(M);continue}var xe=G(k+1);if(R=X(M,A),!(!(C&&(O===0||O===E-1))&&R<Y(M,xe)*T)){for(I=[(M[0]-A[0])/R,(M[1]-A[1])/R],N=A,z=R,B=H=U=0,F=!1,j=M,k++;k<e.length;k++){if(P=xe,xe=G(k+1),!P){if(y)continue;break}if(L=[P[0]-A[0],P[1]-A[1]],W=L[0]*I[1]-L[1]*I[0],H=Math.min(H,W),U=Math.max(U,W),U-H>Y(P,xe))break;j=P,V=L[0]*I[0]+L[1]*I[1],V>z?(z=V,M=P,F=!1):V<B&&(B=V,N=P,F=!0)}if(F?(be(M),j!==N&&be(N)):(N!==A&&be(N),j!==M&&be(M)),be(j),k>=e.length||!P)break;be(P),A=P}}ce&&_e([oe||ce[0],se||ce[1]]),w.push(D.slice(0,O))}var Se=x.slice(x.length-1);if(_&&Se!==`h`&&Se!==`v`){for(var Ce=!1,we=-1,Te=[],Ee=0;Ee<w.length;Ee++)for(var De=0;De<w[Ee].length-1;De++){var Oe=w[Ee][De],ke=w[Ee][De+1],Ae=n.applyBackoff(ke,Oe);(Ae[0]!==ke[0]||Ae[1]!==ke[1])&&(Ce=!0),Te[we+1]||(we++,Te[we]=[Oe,[Ae[0],Ae[1]]])}return Ce?Te:w}return w}}),mi=h((e,t)=>{var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var i,a,o,s,c,l={},u=!1,d=-1,f=0,p=-1;for(a=0;a<r.length;a++)i=r[a][0].trace,o=i.stackgroup||``,o?o in l?c=l[o]:(c=l[o]=f,f++):i.fill in n&&p>=0?c=p:(c=p=f,f++),c<d&&(u=!0),i._groupIndex=d=c;var m=r.slice();u&&m.sort(function(e,t){var n=e[0].trace,r=t[0].trace;return n._groupIndex-r._groupIndex||n.index-r.index});var h={};for(a=0;a<m.length;a++)i=m[a][0].trace,o=i.stackgroup||``,i.visible===!0?(i._nexttrace=null,i.fill in n&&(s=h[o],i._prevtrace=s||null,s&&(s._nexttrace=i)),i._ownfill=i.fill&&(i.fill.slice(0,6)===`tozero`||i.fill===`toself`||i.fill.slice(0,2)===`to`&&!i._prevtrace),h[o]=i):i._prevtrace=i._nexttrace=i._ownfill=null;return m}}),hi=h((e,t)=>{var n=S(),r=Ke(),i=$(),a=i.ensureSingle,o=i.identity,s=tn(),c=Xt(),l=pi(),u=mi(),d=_r().tester;t.exports=function(e,t,r,i,a,o){var s,c,l=!a,d=!!a&&a.duration>0,m=u(e,t,r);s=i.selectAll(`g.trace`).data(m,function(e){return e[0].trace.uid}),s.enter().append(`g`).attr(`class`,function(e){return`trace scatter trace`+e[0].trace.uid}).style(`stroke-miterlimit`,2),s.order(),f(e,s,t),d?(o&&(c=o()),n.transition().duration(a.duration).ease(a.easing).each(`end`,function(){c&&c()}).each(`interrupt`,function(){c&&c()}).each(function(){i.selectAll(`g.trace`).each(function(n,r){p(e,r,t,n,m,this,a)})})):s.each(function(n,r){p(e,r,t,n,m,this,a)}),l&&s.exit().remove(),i.selectAll(`path:not([d])`).remove()};function f(e,t,r){t.each(function(t){var i=a(n.select(this),`g`,`fills`);s.setClipUrl(i,r.layerClipId,e);var c=t[0].trace;c._ownFill=null,c._nextFill=null;var l=[];c._ownfill&&l.push(`_ownFill`),c._nexttrace&&l.push(`_nextFill`);var u=i.selectAll(`g`).data(l,o);u.enter().append(`g`),u.exit().remove(),u.order().each(function(e){c[e]=a(n.select(this),`path`,`js-fill`)})})}function p(e,t,u,f,p,h,g){var _=e._context.staticPlot,v;m(e,t,u,f,p);var y=!!g&&g.duration>0;function b(e){return y?e.transition():e}var x=u.xaxis,S=u.yaxis,C=f[0].trace,w=C.line,T=n.select(h),E=a(T,`g`,`errorbars`),D=a(T,`g`,`lines`),O=a(T,`g`,`points`),k=a(T,`g`,`text`);if(r.getComponentMethod(`errorbars`,`plot`)(e,E,u,g),C.visible!==!0)return;b(T).style(`opacity`,C.opacity);var A,j,M=C.fill.charAt(C.fill.length-1);M!==`x`&&M!==`y`&&(M=``);var N,P;M===`y`?(N=1,P=S.c2p(0,!0)):M===`x`&&(N=0,P=x.c2p(0,!0)),f[0][u.isRangePlot?`nodeRangePlot3`:`node3`]=T;var F=``,I=[],L=C._prevtrace,R=null,z=null;L&&(F=L._prevRevpath||``,j=L._nextFill,I=L._ownPolygons,R=L._fillsegments,z=L._fillElement);var B,V,H=``,U=``,W,G,K,q,J,Y,X=[];C._polygons=[];var Z=[],Q=[],ee=i.noop;if(A=C._ownFill,c.hasLines(C)||C.fill!==`none`){j&&j.datum(f),[`hv`,`vh`,`hvh`,`vhv`].indexOf(w.shape)===-1?W=G=w.shape===`spline`?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return`M`+e.join(`L`)}:(W=s.steps(w.shape),G=s.steps(w.shape.split(``).reverse().join(``))),K=function(e){return G(e.reverse())},Q=l(f,{xaxis:x,yaxis:S,trace:C,connectGaps:C.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:C.fill}),Z=Array(Q.length);var te=0;for(v=0;v<Q.length;v++){var ne,re=Q[v];!ne||!M?(ne=re.slice(),Z[te]=ne,te++):ne.push.apply(ne,re)}C._fillElement=null,C._fillExclusionElement=z,C._fillsegments=Z.slice(0,te),Z=C._fillsegments,Q.length&&(q=Q[0][0].slice(),J=Q[Q.length-1],Y=J[J.length-1].slice()),ee=function(e){return function(t){if(B=W(t),V=K(t),H?M?(H+=`L`+B.slice(1),U=V+(`L`+U.slice(1))):(H+=`Z`+B,U=V+`Z`+U):(H=B,U=V),c.hasLines(C)){var r=n.select(this);if(r.datum(f),e)b(r.style(`opacity`,0).attr(`d`,B).call(s.lineGroupStyle)).style(`opacity`,1);else{var i=b(r);i.attr(`d`,B),s.singleLineStyle(f,i)}}}}}var ie=D.selectAll(`.js-line`).data(Q);b(ie.exit()).style(`opacity`,0).remove(),ie.each(ee(!1)),ie.enter().append(`path`).classed(`js-line`,!0).style(`vector-effect`,_?`none`:`non-scaling-stroke`).call(s.lineGroupStyle).each(ee(!0)),s.setClipUrl(ie,u.layerClipId,e);function ae(e){b(e).attr(`d`,`M0,0Z`)}var oe=function(){var e=Array(Z.length);for(v=0;v<Z.length;v++)e[v]=d(Z[v]);return e},se=function(e){var t,n;if(!e||e.length===0)for(t=Array(Z.length),n=0;n<Z.length;n++){var r=Z[n][0].slice(),i=Z[n][Z[n].length-1].slice();r[N]=i[N]=P;var a=[i,r].concat(Z[n]);t[n]=d(a)}else{for(t=Array(e.length-1+Z.length),n=0;n<e.length-1;n++)t[n]=d(e[n]);var o=e[e.length-1].slice();for(o.reverse(),n=0;n<Z.length;n++)t[e.length-1+n]=d(Z[n].concat(o))}return t};Q.length?(A?(A.datum(f),q&&Y&&(M?(q[N]=Y[N]=P,b(A).attr(`d`,`M`+Y+`L`+q+`L`+H.slice(1)).call(s.singleFillStyle,e),X=se(null)):(b(A).attr(`d`,H+`Z`).call(s.singleFillStyle,e),X=oe())),C._polygons=X,C._fillElement=A):j&&(C.fill.slice(0,6)===`tonext`&&H&&F?(C.fill===`tonext`?(b(j).attr(`d`,H+`Z`+F+`Z`).call(s.singleFillStyle,e),X=oe(),C._polygons=X.concat(I)):(b(j).attr(`d`,H+`L`+F.slice(1)+`Z`).call(s.singleFillStyle,e),X=se(R),C._polygons=X),C._fillElement=j):ae(j)),C._prevRevpath=U):(A?ae(A):j&&ae(j),C._prevRevpath=null),C._ownPolygons=X;function ce(e){return e.filter(function(e){return!e.gap&&e.vis})}function le(e){return e.filter(function(e){return e.vis})}function ue(e){return e.filter(function(e){return!e.gap})}function de(e){return e.id}function fe(e){if(e.ids)return de}function pe(){return!1}function me(t,r,i){var a,l,d,f=i[0].trace,p=c.hasMarkers(f),m=c.hasText(f),h=fe(f),g=pe,_=pe;if(p||m){var v=o,C=f.stackgroup,w=C&&e._fullLayout._scatterStackOpts[x._id+S._id][C].stackgaps===`infer zero`;f.marker.maxdisplayed||f._needsCull?v=w?le:ce:C&&!w&&(v=ue),p&&(g=v),m&&(_=v)}l=t.selectAll(`path.point`),a=l.data(g,h);var T=a.enter().append(`path`).classed(`point`,!0);y&&T.call(s.pointStyle,f,e).call(s.translatePoints,x,S).style(`opacity`,0).transition().style(`opacity`,1),a.order();var E;p&&(E=s.makePointStyleFns(f)),a.each(function(t){var r=n.select(this),i=b(r);d=s.translatePoint(t,i,x,S),d?(s.singlePointStyle(t,i,f,E,e),u.layerClipId&&s.hideOutsideRangePoint(t,i,x,S,f.xcalendar,f.ycalendar),f.customdata&&r.classed(`plotly-customdata`,t.data!==null&&t.data!==void 0)):i.remove()}),y?a.exit().transition().style(`opacity`,0).remove():a.exit().remove(),l=r.selectAll(`g`),a=l.data(_,h),a.enter().append(`g`).classed(`textpoint`,!0).append(`text`),a.order(),a.each(function(e){var t=n.select(this),r=b(t.select(`text`));d=s.translatePoint(e,r,x,S),d?u.layerClipId&&s.hideOutsideRangePoint(e,t,x,S,f.xcalendar,f.ycalendar):t.remove()}),a.selectAll(`text`).call(s.textPointStyle,f,e).each(function(e){var t=x.c2p(e.x),r=S.c2p(e.y);n.select(this).selectAll(`tspan.line`).each(function(){b(n.select(this)).attr({x:t,y:r})})}),a.exit().remove()}O.datum(f),k.datum(f),me(O,k,f);var he=C.cliponaxis===!1?null:u.layerClipId;s.setClipUrl(O,he,e),s.setClipUrl(k,he,e)}function m(e,t,r,a,o){var s=r.xaxis,l=r.yaxis,u=n.extent(i.simpleMap(s.range,s.r2c)),d=n.extent(i.simpleMap(l.range,l.r2c)),f=a[0].trace;if(c.hasMarkers(f)){var p=f.marker.maxdisplayed;if(p!==0){var m=a.filter(function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=d[0]&&e.y<=d[1]}),h=Math.ceil(m.length/p),g=0;o.forEach(function(e,n){var r=e[0].trace;c.hasMarkers(r)&&r.marker.maxdisplayed>0&&n<t&&g++});var _=Math.round(g*h/3+Math.floor(g/3)*h/7.1);a.forEach(function(e){delete e.vis}),m.forEach(function(e,t){Math.round((t+_)%h)===0&&(e.vis=!0)})}}}}),gi=h((e,t)=>{t.exports={container:`marker`,min:`cmin`,max:`cmax`}}),_i=h((e,t)=>{var n=sn();t.exports=function(e,t,r){var i={},a={_fullLayout:r},o=n.getFromTrace(a,t,`x`),s=n.getFromTrace(a,t,`y`),c=e.orig_x;c===void 0&&(c=e.x);var l=e.orig_y;return l===void 0&&(l=e.y),i.xLabel=n.tickText(o,o.c2l(c),!0).text,i.yLabel=n.tickText(s,s.c2l(l),!0).text,i}}),vi=h((e,t)=>{var n=S(),r=tn(),i=Ke();function a(e){var t=n.select(e).selectAll(`g.trace.scatter`);t.style(`opacity`,function(e){return e[0].trace.opacity}),t.selectAll(`g.points`).each(function(t){o(n.select(this),t.trace||t[0].trace,e)}),t.selectAll(`g.text`).each(function(t){s(n.select(this),t.trace||t[0].trace,e)}),t.selectAll(`g.trace path.js-line`).call(r.lineGroupStyle),t.selectAll(`g.trace path.js-fill`).call(r.fillGroupStyle,e,!1),i.getComponentMethod(`errorbars`,`style`)(t)}function o(e,t,n){r.pointStyle(e.selectAll(`path.point`),t,n)}function s(e,t,n){r.textPointStyle(e.selectAll(`text`),t,n)}function c(e,t,n){var i=t[0].trace;i.selectedpoints?(r.selectedPointStyle(n.selectAll(`path.point`),i),r.selectedTextStyle(n.selectAll(`text`),i)):(o(n,i,e),s(n,i,e))}t.exports={style:a,stylePoints:o,styleText:s,styleOnSelect:c}}),yi=h((e,t)=>{var n=q(),r=Xt();t.exports=function(e,t){var i,a;if(e.mode===`lines`)return i=e.line.color,i&&n.opacity(i)?i:e.fillcolor;if(e.mode===`none`)return e.fill?e.fillcolor:``;var o=t.mcc||(e.marker||{}).color,s=t.mlcc||((e.marker||{}).line||{}).color;return a=o&&n.opacity(o)?o:s&&n.opacity(s)&&(t.mlw||((e.marker||{}).line||{}).width)?s:``,a?n.opacity(a)<.3?n.addOpacity(a,.3):a:(i=(e.line||{}).color,i&&n.opacity(i)&&r.hasLines(e)&&e.line.width?i:e.fillcolor)}}),bi=h((e,t)=>{var n=$(),r=Ln(),i=Ke(),a=yi(),o=q(),s=n.fillText;t.exports=function(e,t,c,l){var u=e.cd,d=u[0].trace,f=e.xa,p=e.ya,m=f.c2p(t),h=p.c2p(c),g=[m,h],_=d.hoveron||``,v=d.mode.indexOf(`markers`)===-1?.5:3,y=!!d.xperiodalignment,b=!!d.yperiodalignment;if(_.indexOf(`points`)!==-1){var x=function(e){if(y){var t=f.c2p(e.xStart),n=f.c2p(e.xEnd);return m>=Math.min(t,n)&&m<=Math.max(t,n)?0:1/0}var r=Math.max(3,e.mrc||0),i=1-1/r,a=Math.abs(f.c2p(e.x)-m);return a<r?i*a/r:a-r+i},S=function(e){if(b){var t=p.c2p(e.yStart),n=p.c2p(e.yEnd);return h>=Math.min(t,n)&&h<=Math.max(t,n)?0:1/0}var r=Math.max(3,e.mrc||0),i=1-1/r,a=Math.abs(p.c2p(e.y)-h);return a<r?i*a/r:a-r+i},C=function(e){var t=Math.max(v,e.mrc||0),n=f.c2p(e.x)-m,r=p.c2p(e.y)-h;return Math.max(Math.sqrt(n*n+r*r)-t,1-v/t)},w=r.getDistanceFunction(l,x,S,C);if(r.getClosest(u,w,e),e.index!==!1){var T=u[e.index],E=f.c2p(T.x,!0),D=p.c2p(T.y,!0),O=T.mrc||1;e.index=T.i;var k=u[0].t.orientation,A=k&&(T.sNorm||T.s),j=k===`h`?A:T.orig_x===void 0?T.x:T.orig_x,M=k===`v`?A:T.orig_y===void 0?T.y:T.orig_y;return n.extendFlat(e,{color:a(d,T),x0:E-O,x1:E+O,xLabelVal:j,y0:D-O,y1:D+O,yLabelVal:M,spikeDistance:C(T),hovertemplate:d.hovertemplate}),s(T,d,e),i.getComponentMethod(`errorbars`,`hoverInfo`)(T,d,e),[e]}}function N(e){if(!e)return!1;var t=e.node();try{var n=new DOMPoint(g[0],g[1]);return t.isPointInFill(n)}catch{var r=t.ownerSVGElement.createSVGPoint();return r.x=g[0],r.y=g[1],t.isPointInFill(r)}}function P(e){var t,n=[],r=1/0,i=-1/0,a=1/0,o=-1/0,s;for(t=0;t<e.length;t++){var c=e[t];c.contains(g)&&(n.push(c),a=Math.min(a,c.ymin),o=Math.max(o,c.ymax))}if(n.length===0)return null;a=Math.max(a,0),o=Math.min(o,p._length),s=(a+o)/2;var l,u,d,m,h,_,v;for(t=0;t<n.length;t++)for(u=n[t].pts,l=1;l<u.length;l++)_=u[l-1][1],v=u[l][1],_>s!=v>=s&&(m=u[l-1][0],h=u[l][0],v-_&&(d=m+(h-m)*(s-_)/(v-_),r=Math.min(r,d),i=Math.max(i,d)));return r=Math.max(r,0),i=Math.min(i,f._length),{x0:r,x1:i,y0:s,y1:s}}if(_.indexOf(`fills`)!==-1&&d._fillElement&&N(d._fillElement)&&!N(d._fillExclusionElement)){var F=P(d._polygons);F===null&&(F={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var I=o.defaultLine;return o.opacity(d.fillcolor)?I=d.fillcolor:o.opacity((d.line||{}).color)&&(I=d.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:F.x0,x1:F.x1,y0:F.y0,y1:F.y1,color:I,hovertemplate:!1}),delete e.index,d.text&&!n.isArrayOrTypedArray(d.text)?e.text=String(d.text):e.text=d.name,[e]}}}),xi=h((e,t)=>{var n=Xt();t.exports=function(e,t){var r=e.cd,i=e.xaxis,a=e.yaxis,o=[],s=r[0].trace,c,l,u,d;if(!n.hasMarkers(s)&&!n.hasText(s))return[];if(t===!1)for(c=0;c<r.length;c++)r[c].selected=0;else for(c=0;c<r.length;c++)l=r[c],u=i.c2p(l.x),d=a.c2p(l.y),l.i!==null&&t.contains([u,d],!1,c,e)?(o.push({pointNumber:l.i,x:i.c2d(l.x),y:a.c2d(l.y)}),l.selected=1):l.selected=0;return o}}),Si=h((e,t)=>{t.exports={xaxis:{valType:`subplotid`,dflt:`x`,editType:`calc+clearAxisTypes`},yaxis:{valType:`subplotid`,dflt:`y`,editType:`calc+clearAxisTypes`}}}),Ci=h((e,t)=>{var n=Ke().traceIs,r=an();t.exports=function(e,t,n,r){n(`autotypenumbers`,r.autotypenumbersDflt),n(`type`,(r.splomStash||{}).type)===`-`&&(i(t,r.data),t.type===`-`?t.type=`linear`:e.type=t.type)};function i(e,t){if(e.type===`-`){var i=e._id,c=i.charAt(0),l;i.indexOf(`scene`)!==-1&&(i=c);var u=a(t,i,c);if(u){if(u.type===`histogram`&&c==={v:`y`,h:`x`}[u.orientation||`v`]){e.type=`linear`;return}var d=c+`calendar`,f=u[d],p={noMultiCategory:!n(u,`cartesian`)||n(u,`noMultiCategory`)};if(u.type===`box`&&u._hasPreCompStats&&c==={h:`x`,v:`y`}[u.orientation||`v`]&&(p.noMultiCategory=!0),p.autotypenumbers=e.autotypenumbers,s(u,c)){var m=o(u),h=[];for(l=0;l<t.length;l++){var g=t[l];!n(g,`box-violin`)||(g[c+`axis`]||c)!==i||(g[m]===void 0?g.name===void 0?h.push(`text`):h.push(g.name):h.push(g[m][0]),g[d]!==f&&(f=void 0))}e.type=r(h,f,p)}else if(u.type===`splom`){var _=u.dimensions[u._axesDim[i]];_.visible&&(e.type=r(_.values,f,p))}else e.type=r(u[c]||[u[c+`0`]],f,p)}}}function a(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(i.type===`splom`&&i._length>0&&(i[`_`+n+`axes`]||{})[t]||(i[n+`axis`]||n)===t&&(s(i,n)||(i[n]||[]).length||i[n+`0`]))return i}}function o(e){return{v:`x`,h:`y`}[e.orientation||`v`]}function s(e,t){var r=o(e),i=n(e,`box-violin`),a=n(e._fullInput||{},`candlestick`);return i&&!a&&t===r&&e[r]===void 0&&e[r+`0`]===void 0}}),wi=h((e,t)=>{var n=j().isTypedArraySpec;function r(e,t){var n=t.dataAttr||e._id.charAt(0),r={},i,a,o;if(t.axData)i=t.axData;else for(i=[],a=0;a<t.data.length;a++){var s=t.data[a];s[n+`axis`]===e._id&&i.push(s)}for(a=0;a<i.length;a++){var c=i[a][n];for(o=0;o<c.length;o++){var l=c[o];l!=null&&(r[l]=1)}}return Object.keys(r)}t.exports=function(e,t,i,a){if(t.type===`category`){var o=e.categoryarray,s=Array.isArray(o)&&o.length>0||n(o),c;s&&(c=`array`);var l=i(`categoryorder`,c),u;l===`array`&&(u=i(`categoryarray`)),!s&&l===`array`&&(l=t.categoryorder=`trace`),l===`trace`?t._initialCategories=[]:l===`array`?t._initialCategories=u.slice():(u=r(t,a).sort(),l===`category ascending`?t._initialCategories=u:l===`category descending`&&(t._initialCategories=u.reverse()))}}}),Ti=h((e,t)=>{var n=R().mix,r=K(),i=$();t.exports=function(e,t,a,o){o||={};var s=o.dfltColor;function c(n,r){return i.coerce2(e,t,o.attributes,n,r)}var l=c(`linecolor`,s),u=c(`linewidth`);a(`showline`,o.showLine||!!l||!!u)||(delete t.linecolor,delete t.linewidth);var d=c(`gridcolor`,n(s,o.bgColor,o.blend||r.lightFraction).toRgbString()),f=c(`gridwidth`),p=c(`griddash`);if(a(`showgrid`,o.showGrid||!!d||!!f||!!p)||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),o.hasMinor){var m=c(`minor.gridcolor`,n(t.gridcolor,o.bgColor,67).toRgbString()),h=c(`minor.gridwidth`,t.gridwidth||1),g=c(`minor.griddash`,t.griddash||`solid`);a(`minor.showgrid`,!!m||!!h||!!g)||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!o.noZeroLine){c(`zerolinelayer`);var _=c(`zerolinecolor`,s),v=c(`zerolinewidth`);a(`zeroline`,o.showGrid||!!_||!!v)||(delete t.zerolinelayer,delete t.zerolinecolor,delete t.zerolinewidth)}}}),Ei=h((e,t)=>{var n=D(),r=Ke(),i=$(),a=yt(),o=Vt(),s=Mt(),c=Rt(),l=zt(),u=Ht(),d=Ut(),f=wi(),p=Ti(),m=ln(),h=rn(),g=bt().WEEKDAY_PATTERN,_=bt().HOUR_PATTERN;t.exports=function(e,t,n,_,y){var b=_.letter,x=_.font||{},S=_.splomStash||{},C=n(`visible`,!_.visibleDflt),w=t._template||{},T=t.type||w.type||`-`,E;T===`date`&&(r.getComponentMethod(`calendars`,`handleDefaults`)(e,t,`calendar`,_.calendar),_.noTicklabelmode||(E=n(`ticklabelmode`))),!_.noTicklabelindex&&(T===`date`||T===`linear`)&&n(`ticklabelindex`);var D=``;(!_.noTicklabelposition||T===`multicategory`)&&(D=i.coerce(e,t,{ticklabelposition:{valType:`enumerated`,dflt:`outside`,values:E===`period`?[`outside`,`inside`]:b===`x`?[`outside`,`inside`,`outside left`,`inside left`,`outside right`,`inside right`]:[`outside`,`inside`,`outside top`,`inside top`,`outside bottom`,`inside bottom`]}},`ticklabelposition`)),_.noTicklabeloverflow||n(`ticklabeloverflow`,D.indexOf(`inside`)===-1?T===`category`||T===`multicategory`?`allow`:`hide past div`:`hide past domain`),h(t,y),m(e,t,n,_),f(e,t,n,_),_.noHover||(T!==`category`&&n(`hoverformat`),_.noUnifiedhovertitle||n(`unifiedhovertitle.text`));var O=n(`color`),k=O===s.color.dflt?x.color:O,A=S.label||y._dfltTitle[b];if(d(e,t,n,T,_),!C)return t;n(`title.text`,A),i.coerceFont(n,`title.font`,x,{overrideDflt:{size:i.bigFont(x.size),color:k}}),c(e,t,n,T);var j=_.hasMinor;if(j&&(a.newContainer(t,`minor`),c(e,t,n,T,{isMinor:!0})),u(e,t,n,T,_),l(e,t,n,_),j){var M=_.isMinor;_.isMinor=!0,l(e,t,n,_),_.isMinor=M}p(e,t,n,{dfltColor:O,bgColor:_.bgColor,showGrid:_.showGrid,hasMinor:j,attributes:s}),j&&!t.minor.ticks&&!t.minor.showgrid&&delete t.minor,(t.showline||t.ticks)&&n(`mirror`);var N=T===`multicategory`;if(!_.noTickson&&(T===`category`||N)&&(t.ticks||t.showgrid)&&(N?(n(`tickson`,`boundaries`),delete t.ticklabelposition):n(`tickson`)),N&&n(`showdividers`)&&(n(`dividercolor`),n(`dividerwidth`)),T===`date`)if(o(e,t,{name:`rangebreaks`,inclusionAttr:`enabled`,handleItemDefaults:v}),!t.rangebreaks.length)delete t.rangebreaks;else{for(var P=0;P<t.rangebreaks.length;P++)if(t.rangebreaks[P].pattern===g){t._hasDayOfWeekBreaks=!0;break}if(h(t,y),y._has(`scattergl`)||y._has(`splom`))for(var F=0;F<_.data.length;F++){var I=_.data[F];(I.type===`scattergl`||I.type===`splom`)&&(I.visible=!1,i.warn(I.type+` traces do not work on axes with rangebreaks. Setting trace `+I.index+" to `visible: false`."))}}return t};function v(e,t,r){function a(n,r){return i.coerce(e,t,s.rangebreaks,n,r)}if(a(`enabled`)){var o=a(`bounds`);if(o&&o.length>=2){var c=``,l,u;if(o.length===2){for(l=0;l<2;l++)if(u=b(o[l]),u){c=g;break}}var d=a(`pattern`,c);if(d===g)for(l=0;l<2;l++)u=b(o[l]),u&&(t.bounds[l]=o[l]=u-1);if(d)for(l=0;l<2;l++)switch(u=o[l],d){case g:if(!n(u)){t.enabled=!1;return}if(u=+u,u!==Math.floor(u)||u<0||u>=7){t.enabled=!1;return}t.bounds[l]=o[l]=u;break;case _:if(!n(u)){t.enabled=!1;return}if(u=+u,u<0||u>24){t.enabled=!1;return}t.bounds[l]=o[l]=u;break}if(r.autorange===!1){var f=r.range;if(f[0]<f[1]){if(o[0]<f[0]&&o[1]>f[1]){t.enabled=!1;return}}else if(o[0]>f[0]&&o[1]<f[1]){t.enabled=!1;return}}}else{var p=a(`values`);if(p&&p.length)a(`dvalue`);else{t.enabled=!1;return}}}}var y={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function b(e){if(typeof e==`string`)return y[e.slice(0,3).toLowerCase()]}}),Di=h((e,t)=>{var n=D(),r=$();t.exports=function(e,t,i,a){var o=a.counterAxes||[],s=a.overlayableAxes||[],c=a.letter,l=a.grid,u=a.overlayingDomain,d,f,p,m,h,g;l&&(f=l._domains[c][l._axisMap[t._id]],d=l._anchors[t._id],f&&(p=l[c+`side`].split(` `)[0],m=l.domain[c][p===`right`||p===`top`?1:0])),f||=[0,1],d||=n(e.position)?`free`:o[0]||`free`,p||=c===`x`?`bottom`:`left`,m||=0,h=0,g=!1;var _=r.coerce(e,t,{anchor:{valType:`enumerated`,values:[`free`].concat(o),dflt:d}},`anchor`),v=r.coerce(e,t,{side:{valType:`enumerated`,values:c===`x`?[`bottom`,`top`]:[`left`,`right`],dflt:p}},`side`);_===`free`&&(c===`y`&&(i(`autoshift`)&&(m=v===`left`?u[0]:u[1],g=t.automargin?t.automargin:!0,h=v===`left`?-3:3),i(`shift`,h)),i(`position`,m)),i(`automargin`,g);var y=!1;if(s.length&&(y=r.coerce(e,t,{overlaying:{valType:`enumerated`,values:[!1].concat(s),dflt:!1}},`overlaying`)),!y){var b=i(`domain`,f);b[0]>b[1]-1/4096&&(t.domain=f),r.noneOrAll(e.domain,t.domain,f),t.tickmode===`sync`&&(t.tickmode=`auto`)}return i(`layer`),t}}),Oi=h((e,t)=>{var n=$(),r=q(),i=Qt().isUnifiedHover,a=Nn(),o=yt(),s=We(),c=Mt(),l=Ci(),u=Ei(),d=ar(),f=Di(),p=xt(),m=p.id2name,h=p.name2id,g=bt().AX_ID_PATTERN,_=Ke(),v=_.traceIs,y=_.getComponentMethod;function b(e,t,n){Array.isArray(e[t])?e[t].push(n):e[t]=[n]}t.exports=function(e,t,_){var x=t.autotypenumbers,S={},C={},w={},T={},E={},D={},O={},k={},A={},j={},M,N;for(M=0;M<_.length;M++){var P=_[M];if(v(P,`cartesian`)){var F;if(P.xaxis)F=m(P.xaxis),b(S,F,P);else if(P.xaxes)for(N=0;N<P.xaxes.length;N++)b(S,m(P.xaxes[N]),P);var I;if(P.yaxis)I=m(P.yaxis),b(S,I,P);else if(P.yaxes)for(N=0;N<P.yaxes.length;N++)b(S,m(P.yaxes[N]),P);if(P.type===`funnel`?P.orientation===`h`?(F&&(C[F]=!0),I&&(O[I]=!0)):I&&(w[I]=!0):P.type===`image`?(I&&(k[I]=!0),F&&(k[F]=!0)):(I&&(E[I]=!0,D[I]=!0),(!v(P,`carpet`)||P.type===`carpet`&&!P._cheater)&&F&&(T[F]=!0)),P.type===`carpet`&&P._cheater&&F&&(C[F]=!0),v(P,`2dMap`)&&(A[F]=!0,A[I]=!0),v(P,`oriented`)){var L=P.orientation===`h`?I:F;j[L]=!0}}}var R=t._subplots,z=R.xaxis,B=R.yaxis,V=n.simpleMap(z,m),H=n.simpleMap(B,m),U=V.concat(H),W=r.background;z.length&&B.length&&(W=n.coerce(e,t,s,`plot_bgcolor`));var G=r.combine(W,t.paper_bgcolor),K,q,J,Y,X;function Z(){var e=S[K]||[];X._traceIndices=e.map(function(e){return e.index}),X._annIndices=[],X._shapeIndices=[],X._selectionIndices=[],X._imgIndices=[],X._subplotsWith=[],X._counterAxes=[],X._name=X._attr=K,X._id=q}function Q(e,t){return n.coerce(Y,X,c,e,t)}function ee(e,t){return n.coerce2(Y,X,c,e,t)}function te(e){return e===`x`?B:z}function ne(t,n){for(var r=t===`x`?V:H,i=[],a=0;a<r.length;a++){var o=r[a];o!==n&&!(e[o]||{}).overlaying&&i.push(h(o))}return i}var re={x:te(`x`),y:te(`y`)},ie=re.x.concat(re.y),ae={},oe=[];function se(){var e=Y.matches;g.test(e)&&ie.indexOf(e)===-1&&(ae[e]=Y.type,oe=Object.keys(ae))}var ce=a(e,t),le=i(ce);for(M=0;M<U.length;M++){K=U[M],q=h(K),J=K.charAt(0),n.isPlainObject(e[K])||(e[K]={}),Y=e[K],X=o.newContainer(t,K,J+`axis`),Z();var ue=J===`x`&&!T[K]&&C[K]||J===`y`&&!E[K]&&w[K],de=J===`y`&&(!D[K]&&O[K]||k[K]),fe={hasMinor:!0,letter:J,font:t.font,outerTicks:A[K],showGrid:!j[K],data:S[K]||[],bgColor:G,calendar:t.calendar,automargin:!0,visibleDflt:ue,reverseDflt:de,autotypenumbersDflt:x,splomStash:((t._splomAxes||{})[J]||{})[q],noAutotickangles:J===`y`};Q(`uirevision`,t.uirevision),l(Y,X,Q,fe),u(Y,X,Q,fe,t);var pe=le&&J===ce.charAt(0),me=ee(`spikecolor`,le?X.color:void 0),he=ee(`spikethickness`,le?1.5:void 0),ge=ee(`spikedash`,le?`dot`:void 0),_e=ee(`spikemode`,le?`across`:void 0),ve=ee(`spikesnap`);Q(`showspikes`,!!pe||!!me||!!he||!!ge||!!_e||!!ve)||(delete X.spikecolor,delete X.spikethickness,delete X.spikedash,delete X.spikemode,delete X.spikesnap);var ye=m(Y.overlaying),be=[0,1];if(t[ye]!==void 0){var xe=m(t[ye].anchor);t[xe]!==void 0&&(be=t[xe].domain)}f(Y,X,Q,{letter:J,counterAxes:re[J],overlayableAxes:ne(J,K),grid:t.grid,overlayingDomain:be}),Q(`title.standoff`),se(),X._input=Y}for(M=0;M<oe.length;){q=oe[M++],K=m(q),J=K.charAt(0),n.isPlainObject(e[K])||(e[K]={}),Y=e[K],X=o.newContainer(t,K,J+`axis`),Z();var Se={letter:J,font:t.font,outerTicks:A[K],showGrid:!j[K],data:[],bgColor:G,calendar:t.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:x,splomStash:((t._splomAxes||{})[J]||{})[q]};Q(`uirevision`,t.uirevision),X.type=ae[q]||`linear`,u(Y,X,Q,Se,t),f(Y,X,Q,{letter:J,counterAxes:re[J],overlayableAxes:ne(J,K),grid:t.grid}),Q(`fixedrange`),Q(`modebardisable`),se(),X._input=Y}var Ce=y(`rangeslider`,`handleDefaults`),we=y(`rangeselector`,`handleDefaults`);for(M=0;M<V.length;M++)K=V[M],Y=e[K],X=t[K],Ce(e,t,K),X.type===`date`&&we(Y,X,t,H,X.calendar),Q(`fixedrange`),Q(`modebardisable`);for(M=0;M<H.length;M++){K=H[M],Y=e[K],X=t[K];var Te=t[m(X.anchor)];Q(`fixedrange`,y(`rangeslider`,`isVisible`)(Te)),Q(`modebardisable`)}d.handleDefaults(e,t,{axIds:ie.concat(oe).sort(p.idSort),axHasImage:k})}}),ki=h((e,t)=>{var n=S(),r=Ke(),i=$(),a=tn(),o=sn();t.exports=function(e,t,s,c){var l=e._fullLayout;if(t.length===0){o.redrawComponents(e);return}function u(e){var t=e.xaxis,n=e.yaxis;l._defs.select(`#`+e.clipId+`> rect`).call(a.setTranslate,0,0).call(a.setScale,1,1),e.plot.call(a.setTranslate,t._offset,n._offset).call(a.setScale,1,1);var r=e.plot.selectAll(`.scatterlayer .trace`);r.selectAll(`.point`).call(a.setPointGroupScale,1,1),r.selectAll(`.textpoint`).call(a.setTextPointsScale,1,1),r.call(a.hideOutsideRangePoints,e)}function d(t,n){var r=t.plotinfo,s=r.xaxis,c=r.yaxis,l=s._length,u=c._length,d=!!t.xr1,f=!!t.yr1,p=[];if(d){var m=i.simpleMap(t.xr0,s.r2l),h=i.simpleMap(t.xr1,s.r2l),g=m[1]-m[0],_=h[1]-h[0];p[0]=(m[0]*(1-n)+n*h[0]-m[0])/(m[1]-m[0])*l,p[2]=l*(1-n+n*_/g),s.range[0]=s.l2r(m[0]*(1-n)+n*h[0]),s.range[1]=s.l2r(m[1]*(1-n)+n*h[1])}else p[0]=0,p[2]=l;if(f){var v=i.simpleMap(t.yr0,c.r2l),y=i.simpleMap(t.yr1,c.r2l),b=v[1]-v[0],x=y[1]-y[0];p[1]=(v[1]*(1-n)+n*y[1]-v[1])/(v[0]-v[1])*u,p[3]=u*(1-n+n*x/b),c.range[0]=s.l2r(v[0]*(1-n)+n*y[0]),c.range[1]=c.l2r(v[1]*(1-n)+n*y[1])}else p[1]=0,p[3]=u;o.drawOne(e,s,{skipTitle:!0}),o.drawOne(e,c,{skipTitle:!0}),o.redrawComponents(e,[s._id,c._id]);var S=d?l/p[2]:1,C=f?u/p[3]:1,w=d?p[0]:0,T=f?p[1]:0,E=d?p[0]/p[2]*l:0,D=f?p[1]/p[3]*u:0,O=s._offset-E,k=c._offset-D;r.clipRect.call(a.setTranslate,w,T).call(a.setScale,1/S,1/C),r.plot.call(a.setTranslate,O,k).call(a.setScale,S,C),a.setPointGroupScale(r.zoomScalePts,1/S,1/C),a.setTextPointsScale(r.zoomScaleTxt,1/S,1/C)}var f;c&&(f=c());function p(){for(var n={},i=0;i<t.length;i++){var a=t[i],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr1&&(n[o._name+`.range`]=a.xr1.slice()),a.yr1&&(n[s._name+`.range`]=a.yr1.slice())}return f&&f(),r.call(`relayout`,e,n).then(function(){for(var e=0;e<t.length;e++)u(t[e].plotinfo)})}function m(){for(var n={},i=0;i<t.length;i++){var a=t[i],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr0&&(n[o._name+`.range`]=a.xr0.slice()),a.yr0&&(n[s._name+`.range`]=a.yr0.slice())}return r.call(`relayout`,e,n).then(function(){for(var e=0;e<t.length;e++)u(t[e].plotinfo)})}var h,g,_,v=n.ease(s.easing);e._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(_),_=null,m()});function y(){g=Date.now();for(var e=v(Math.min(1,(g-h)/s.duration)),n=0;n<t.length;n++)d(t[n],e);g-h>s.duration?(p(),_=window.cancelAnimationFrame(y)):_=window.requestAnimationFrame(y)}return h=Date.now(),_=window.requestAnimationFrame(y),Promise.resolve()}}),Ai=h(e=>{var t=S(),n=Ke(),r=$(),i=Et(),a=tn(),o=wt().getModuleCalcData,s=xt(),c=bt(),l=Dt(),u=r.ensureSingle;function d(e,t,n){return r.ensureSingle(e,t,n,function(e){e.datum(n)})}var f=c.zindexSeparator;e.name=`cartesian`,e.attr=[`xaxis`,`yaxis`],e.idRoot=[`x`,`y`],e.idRegex=c.idRegex,e.attrRegex=c.attrRegex,e.attributes=Si(),e.layoutAttributes=Mt(),e.supplyLayoutDefaults=Oi(),e.transitionAxes=ki(),e.finalizeSubplots=function(e,t){var n=t._subplots,i=n.xaxis,a=n.yaxis,o=n.cartesian,l=o,u={},d={},f,p,m;for(f=0;f<l.length;f++){var h=l[f].split(`y`);u[h[0]]=1,d[`y`+h[1]]=1}for(f=0;f<i.length;f++)p=i[f],u[p]||(m=(e[s.id2name(p)]||{}).anchor,c.idRegex.y.test(m)||(m=`y`),o.push(p+m),l.push(p+m),d[m]||(d[m]=1,r.pushUnique(a,m)));for(f=0;f<a.length;f++)m=a[f],d[m]||(p=(e[s.id2name(m)]||{}).anchor,c.idRegex.x.test(p)||(p=`x`),o.push(p+m),l.push(p+m),u[p]||(u[p]=1,r.pushUnique(i,p)));if(!l.length){for(var g in p=``,m=``,e)c.attrRegex.test(g)&&(g.charAt(0)===`x`?(!p||+g.slice(5)<+p.slice(5))&&(p=g):(!m||+g.slice(5)<+m.slice(5))&&(m=g));p=p?s.name2id(p):`x`,m=m?s.name2id(m):`y`,i.push(p),a.push(m),o.push(p+m)}},e.plot=function(e,t,n,i){var a=e._fullLayout,o=a._subplots.cartesian,s=e.calcdata,c;if(!Array.isArray(t))for(t=[],c=0;c<s.length;c++)t.push(c);for(var l=a._zindices,u=0;u<l.length;u++){var d=l[u];for(c=0;c<o.length;c++){var m=o[c],h=a._plots[m];if(u>0){var g=h.id;if(g.indexOf(f)!==-1)continue;g+=f+(u+1),h=r.extendFlat({},h,{id:g,plot:a._cartesianlayer.selectAll(`.subplot`).select(`.`+g)})}for(var _=[],v,y=0;y<s.length;y++){var b=s[y],x=b[0].trace;d===(x.zorder||0)&&x.xaxis+x.yaxis===m&&((t.indexOf(x.index)!==-1||x.carpet)&&(v&&v[0].trace.xaxis+v[0].trace.yaxis===m&&[`tonextx`,`tonexty`,`tonext`].indexOf(x.fill)!==-1&&_.indexOf(v)===-1&&_.push(v),_.push(b)),v=b)}p(e,h,_,n,i)}}};function p(e,r,i,s,l){for(var u=c.traceLayerClasses,d=e._fullLayout,f=d._zindices,p=d._modules,m,h,g,_=[],v=[],y=0;y<f.length;y++)for(var b=f[y],x=0;x<p.length;x++){m=p[x];var S=m.name,C=n.modules[S].categories;if(C.svg){var w=m.layerName||S+`layer`,T=w+(y?Number(y)+1:``),E=m.plot;h=o(i,E,b),g=h[0],i=h[1],g.length&&_.push({i:u.indexOf(w),zindex:y,className:T,plotMethod:E,cdModule:g}),C.zoomScale&&v.push(`.`+T)}}_.sort(function(e,t){return(e.zindex||0)-(t.zindex||0)||e.i-t.i});var D=r.plot.selectAll(`g.mlayer`).data(_,function(e){return e.className});if(D.enter().append(`g`).attr(`class`,function(e){return e.className}).classed(`mlayer`,!0).classed(`rangeplot`,r.isRangePlot),D.exit().remove(),D.order(),D.each(function(n){var i=t.select(this),o=n.className;n.plotMethod(e,r,n.cdModule,i,s,l),c.clipOnAxisFalseQuery.indexOf(`.`+o)===-1&&a.setClipUrl(i,r.layerClipId,e)}),d._has(`scattergl`)&&(m=n.getModule(`scattergl`),g=o(i,m)[0],m.plot(e,r,g)),!e._context.staticPlot&&(r._hasClipOnAxisFalse&&(r.clipOnAxisFalseTraces=r.plot.selectAll(c.clipOnAxisFalseQuery.join(`,`)).selectAll(`.trace`)),v.length)){var O=r.plot.selectAll(v.join(`,`)).selectAll(`.trace`);r.zoomScalePts=O.selectAll(`path.point`),r.zoomScaleTxt=O.selectAll(`.textpoint`)}}e.clean=function(e,t,n,r){var i=r._plots||{},a=t._plots||{},o=r._subplots||{},c,l,u;if(r._hasOnlyLargeSploms&&!t._hasOnlyLargeSploms)for(u in i)c=i[u],c.plotgroup&&c.plotgroup.remove();var d=r._has&&r._has(`gl`),p=t._has&&t._has(`gl`);if(d&&!p)for(u in i)c=i[u],c._scene&&c._scene.destroy();if(o.xaxis&&o.yaxis){var m=s.listIds({_fullLayout:r});for(l=0;l<m.length;l++){var h=m[l];t[s.id2name(h)]||r._infolayer.selectAll(`.g-`+h+`title`).remove()}}var v=r._has&&r._has(`cartesian`),y=t._has&&t._has(`cartesian`);if(v&&!y)g(r._cartesianlayer.selectAll(`.subplot`),r),r._defs.selectAll(`.axesclip`).remove(),delete r._axisConstraintGroups,delete r._axisMatchGroups;else if(o.cartesian)for(l=0;l<o.cartesian.length;l++){var b=o.cartesian[l];if(b.indexOf(f)===-1&&!a[b]){var x=`.`+b+`,.`+b+`-x,.`+b+`-y`;r._cartesianlayer.selectAll(x).remove(),_(b,r)}}},e.drawFramework=function(e){var n=e._fullLayout,i=e.calcdata,a,o={};for(a=0;a<i.length;a++){var s=i[a][0],c=s.trace.zorder||0;o[c]||(o[c]=[]),o[c].push(s)}var l=Object.keys(o).map(Number).sort(r.sorterAsc);l.length||(l=[0]),n._zindices=l;var d=m(e),p=d.length,_=[];for(a=0;a<p;a++)_[a]=d[a].slice();for(var v=1;v<l.length;v++){var y=[];for(a=0;a<p;a++)y[a]=d[a].slice(),y[a][0]+=f+(v+1);_=_.concat(y)}var b=n._cartesianlayer.selectAll(`.subplot`).data(_,String);b.enter().append(`g`).attr(`class`,function(e){return`subplot `+e[0]}),b.order(),b.exit().call(g,n),b.each(function(i){var a=i[0],o=a.indexOf(f),s=o!==-1,c=s?a.slice(0,o):a,l=n._plots[a];l||(l=r.extendFlat({},n._plots[c]),l&&(l.id=a,n._plots[a]=l,n._subplots.cartesian.push(a))),l&&(l.plotgroup=t.select(this),h(e,l),s||(l.draglayer=u(n._draggers,`g`,a)))})},e.rangePlot=function(e,t,n){h(e,t),p(e,t,n),i.style(e)};function m(e){var t=e._fullLayout,n=t._zindices.length,r=t._subplots.cartesian,i=r.length,a,o,s,c,l,u,d=[],p=[];for(a=0;a<i;a++){s=r[a],c=t._plots[s],l=c.xaxis,u=c.yaxis;var m=l._mainAxis,h=u._mainAxis,g=m._id+h._id,_=t._plots[g];c.overlays=[],g!==s&&_?(c.mainplot=g,c.mainplotinfo=_,p.push(s)):(c.mainplot=void 0,c.mainplotinfo=void 0,d.push(s))}for(a=0;a<p.length;a++)s=p[a],c=t._plots[s],c.mainplotinfo.overlays.push(c);var v=d.concat(p),y=[];for(a=0;a<i;a++){s=v[a],c=t._plots[s],l=c.xaxis,u=c.yaxis;for(var b=[],x=1;x<=n;x++){var S=``;for(x>1&&(S+=f+x),b.push(s+S),o=0;o<c.overlays.length;o++)b.push(c.overlays[o].id+S)}b=b.concat([l.layer,u.layer,l.overlaying||``,u.overlaying||``]),y.push(b)}return y}function h(e,t){var n=e._fullLayout,r=t.plotgroup,i=t.id,a=i.indexOf(f)!==-1,o=c.layerValue2layerClass[t.xaxis.layer],l=c.layerValue2layerClass[t.yaxis.layer],p=n._hasOnlyLargeSploms,m=n._zindices.length>1,h=t.mainplotinfo;if(!t.mainplot||m)if(p)t.xlines=u(r,`path`,`xlines-above`),t.ylines=u(r,`path`,`ylines-above`),t.xaxislayer=u(r,`g`,`xaxislayer-above`),t.yaxislayer=u(r,`g`,`yaxislayer-above`);else{if(!a){var g=u(r,`g`,`layer-subplot`);t.shapelayer=u(g,`g`,`shapelayer`),t.imagelayer=u(g,`g`,`imagelayer`),h&&m?(t.minorGridlayer=h.minorGridlayer,t.gridlayer=h.gridlayer,t.zerolinelayer=h.zerolinelayer):(t.minorGridlayer=u(r,`g`,`minor-gridlayer`),t.gridlayer=u(r,`g`,`gridlayer`),t.zerolinelayer=u(r,`g`,`zerolinelayer`));var _=u(r,`g`,`layer-between`);t.shapelayerBetween=u(_,`g`,`shapelayer`),t.imagelayerBetween=u(_,`g`,`imagelayer`),u(r,`path`,`xlines-below`),u(r,`path`,`ylines-below`),t.overlinesBelow=u(r,`g`,`overlines-below`),u(r,`g`,`xaxislayer-below`),u(r,`g`,`yaxislayer-below`),t.overaxesBelow=u(r,`g`,`overaxes-below`)}t.overplot=u(r,`g`,`overplot`),t.plot=u(t.overplot,`g`,i),h&&m?t.zerolinelayerAbove=h.zerolinelayerAbove:t.zerolinelayerAbove=u(r,`g`,`zerolinelayer-above`),a||(t.xlines=u(r,`path`,`xlines-above`),t.ylines=u(r,`path`,`ylines-above`),t.overlinesAbove=u(r,`g`,`overlines-above`),u(r,`g`,`xaxislayer-above`),u(r,`g`,`yaxislayer-above`),t.overaxesAbove=u(r,`g`,`overaxes-above`),t.xlines=r.select(`.xlines-`+o),t.ylines=r.select(`.ylines-`+l),t.xaxislayer=r.select(`.xaxislayer-`+o),t.yaxislayer=r.select(`.yaxislayer-`+l))}else{var v=h.plotgroup,y=i+`-x`,b=i+`-y`;t.minorGridlayer=h.minorGridlayer,t.gridlayer=h.gridlayer,t.zerolinelayer=h.zerolinelayer,t.zerolinelayerAbove=h.zerolinelayerAbove,u(h.overlinesBelow,`path`,y),u(h.overlinesBelow,`path`,b),u(h.overaxesBelow,`g`,y),u(h.overaxesBelow,`g`,b),t.plot=u(h.overplot,`g`,i),u(h.overlinesAbove,`path`,y),u(h.overlinesAbove,`path`,b),u(h.overaxesAbove,`g`,y),u(h.overaxesAbove,`g`,b),t.xlines=v.select(`.overlines-`+o).select(`.`+y),t.ylines=v.select(`.overlines-`+l).select(`.`+b),t.xaxislayer=v.select(`.overaxes-`+o).select(`.`+y),t.yaxislayer=v.select(`.overaxes-`+l).select(`.`+b)}a||(p||(d(t.minorGridlayer,`g`,t.xaxis._id),d(t.minorGridlayer,`g`,t.yaxis._id),t.minorGridlayer.selectAll(`g`).map(function(e){return e[0]}).sort(s.idSort),d(t.gridlayer,`g`,t.xaxis._id),d(t.gridlayer,`g`,t.yaxis._id),t.gridlayer.selectAll(`g`).map(function(e){return e[0]}).sort(s.idSort)),t.xlines.style(`fill`,`none`).classed(`crisp`,!0),t.ylines.style(`fill`,`none`).classed(`crisp`,!0))}function g(e,n){if(e){var r={};for(var i in e.each(function(e){var i=e[0];t.select(this).remove(),_(i,n),r[i]=!0}),n._plots)for(var a=n._plots[i],o=a.overlays||[],s=0;s<o.length;s++){var c=o[s];r[c.id]&&c.plot.selectAll(`.trace`).remove()}}}function _(e,t){t._draggers.selectAll(`g.`+e).remove(),t._defs.select(`#clip`+t._uid+e+`plot`).remove()}e.toSVG=function(e){var n=e._fullLayout._glimages,r=t.select(e).selectAll(`.svg-container`),i=r.filter(function(e,t){return t===r.size()-1}).selectAll(`.gl-canvas-context, .gl-canvas-focus`);function a(){var e=this,t=e.toDataURL(`image/png`);n.append(`svg:image`).attr({xmlns:l.svg,"xlink:href":t,preserveAspectRatio:`none`,x:0,y:0,width:e.style.width,height:e.style.height})}i.each(a)},e.updateFx=Mr().updateFx}),ji=h((e,t)=>{var n=Xt();t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:Tr(),layoutAttributes:Ct(),supplyDefaults:ei(),crossTraceDefaults:ni(),supplyLayoutDefaults:ri(),calc:ci().calc,crossTraceCalc:fi(),arraysToCalcdata:oi(),plot:hi(),colorbar:gi(),formatLabels:_i(),style:vi().style,styleOnSelect:vi().styleOnSelect,hoverPoints:bi(),selectPoints:xi(),animatable:!0,moduleType:`trace`,name:`scatter`,basePlotModule:Ai(),categories:[`cartesian`,`svg`,`symbols`,`errorBarsOK`,`showLegend`,`scatter-like`,`zoomScale`],meta:{}}}),Mi=h((e,t)=>{var n=S(),r=q(),i=br(),a=$(),o=a.strScale,s=a.strRotate,c=a.strTranslate;t.exports=function(e,t,a){var l=e.node(),u=i[a.arrowhead||0],d=i[a.startarrowhead||0],f=(a.arrowwidth||1)*(a.arrowsize||1),p=(a.arrowwidth||1)*(a.startarrowsize||1),m=t.indexOf(`start`)>=0,h=t.indexOf(`end`)>=0,g=u.backoff*f+a.standoff,_=d.backoff*p+a.startstandoff,v,y,b,x;if(l.nodeName===`line`){v={x:+e.attr(`x1`),y:+e.attr(`y1`)},y={x:+e.attr(`x2`),y:+e.attr(`y2`)};var S=v.x-y.x,C=v.y-y.y;if(b=Math.atan2(C,S),x=b+Math.PI,g&&_&&g+_>Math.sqrt(S*S+C*C)){F();return}if(g){if(g*g>S*S+C*C){F();return}var w=g*Math.cos(b),T=g*Math.sin(b);y.x+=w,y.y+=T,e.attr({x2:y.x,y2:y.y})}if(_){if(_*_>S*S+C*C){F();return}var E=_*Math.cos(b),D=_*Math.sin(b);v.x-=E,v.y-=D,e.attr({x1:v.x,y1:v.y})}}else if(l.nodeName===`path`){var O=l.getTotalLength(),k=``;if(O<g+_){F();return}var A=l.getPointAtLength(0),j=l.getPointAtLength(.1);b=Math.atan2(A.y-j.y,A.x-j.x),v=l.getPointAtLength(Math.min(_,O)),k=`0px,`+_+`px,`;var M=l.getPointAtLength(O),N=l.getPointAtLength(O-.1);x=Math.atan2(M.y-N.y,M.x-N.x),y=l.getPointAtLength(Math.max(0,O-g));var P=k?_+g:g;k+=O-P+`px,`+O+`px`,e.style(`stroke-dasharray`,k)}function F(){e.style(`stroke-dasharray`,`0px,100px`)}function I(t,i,u,d){t.path&&(t.noRotate&&(u=0),n.select(l.parentNode).append(`path`).attr({class:e.attr(`class`),d:t.path,transform:c(i.x,i.y)+s(u*180/Math.PI)+o(d)}).style({fill:r.rgb(a.arrowcolor),"stroke-width":0}))}m&&I(d,v,b,p),h&&I(u,y,x,f)}}),Ni=h((e,t)=>{var n=S(),r=Ke(),i=Et(),a=$(),o=a.strTranslate,s=sn(),c=q(),l=tn(),u=Ln(),d=kt(),f=gn(),p=hn(),m=yt().arrayEditor,h=Mi();t.exports={draw:g,drawOne:_,drawRaw:y};function g(e){var t=e._fullLayout;t._infolayer.selectAll(`.annotation`).remove();for(var n=0;n<t.annotations.length;n++)t.annotations[n].visible&&_(e,n);return i.previousPromises(e)}function _(e,t){var n=e._fullLayout.annotations[t]||{},r=s.getFromId(e,n.xref),i=s.getFromId(e,n.yref);r&&r.setScale(),i&&i.setScale(),y(e,n,t,!1,r,i)}function v(e,t,n,r,i){var a=i[n],o=i[n+`ref`],c=n.indexOf(`y`)!==-1,l=s.getRefType(o)===`domain`,u=c?r.h:r.w;return e?l?a+(c?-t:t)/e._length:e.p2r(e.r2p(a)+t):a+(c?-t:t)/u}function y(e,t,i,g,_,y){var b=e._fullLayout,x=e._fullLayout._size,S=e._context.edits,C,w;g?(C=`annotation-`+g,w=g+`.annotations`):(C=`annotation`,w=`annotations`);var T=m(e.layout,w,t),E=T.modifyBase,D=T.modifyItem,O=T.getUpdateObj;b._infolayer.selectAll(`.`+C+`[data-index="`+i+`"]`).remove();var k=`clip`+b._uid+`_ann`+i;if(!t._input||t.visible===!1){n.selectAll(`#`+k).remove();return}var A={x:{},y:{}},j=+t.textangle||0,M=b._infolayer.append(`g`).classed(C,!0).attr(`data-index`,String(i)).style(`opacity`,t.opacity),N=M.append(`g`).classed(`annotation-text-g`,!0),P=S[t.showarrow?`annotationTail`:`annotationPosition`],F=t.captureevents||S.annotationText||P;function I(e){var n={index:i,annotation:t._input,fullAnnotation:t,event:e};return g&&(n.subplotId=g),n}var L=N.append(`g`).style(`pointer-events`,F?`all`:null).call(f,`pointer`).on(`click`,function(){e._dragging=!1,e.emit(`plotly_clickannotation`,I(n.event))});t.hovertext&&L.on(`mouseover`,function(){var n=t.hoverlabel,r=n.font,i=this.getBoundingClientRect(),a=e.getBoundingClientRect();u.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:t.hovertext,color:n.bgcolor,borderColor:n.bordercolor,fontFamily:r.family,fontSize:r.size,fontColor:r.color,fontWeight:r.weight,fontStyle:r.style,fontVariant:r.variant,fontShadow:r.fontShadow,fontLineposition:r.fontLineposition,fontTextcase:r.fontTextcase},{container:b._hoverlayer.node(),outerContainer:b._paper.node(),gd:e})}).on(`mouseout`,function(){u.loneUnhover(b._hoverlayer.node())});var R=t.borderwidth,z=R+t.borderpad,B=L.append(`rect`).attr(`class`,`bg`).style(`stroke-width`,R+`px`).call(c.stroke,t.bordercolor).call(c.fill,t.bgcolor),V=t.width||t.height,H=b._topclips.selectAll(`#`+k).data(V?[0]:[]);H.enter().append(`clipPath`).classed(`annclip`,!0).attr(`id`,k).append(`rect`),H.exit().remove();var U=t.font,W=b._meta?a.templateString(t.text,b._meta):t.text,G=L.append(`text`).classed(`annotation-text`,!0).text(W);function K(n){return n.call(l.font,U).attr({"text-anchor":{left:`start`,right:`end`}[t.align]||`middle`}),d.convertToTspans(n,e,q),n}function q(){var n=G.selectAll(`a`);n.size()===1&&n.text()===G.text()&&L.insert(`a`,`:first-child`).attr({"xlink:xlink:href":n.attr(`xlink:href`),"xlink:xlink:show":n.attr(`xlink:show`)}).style({cursor:`pointer`}).node().appendChild(B.node());var i=L.select(`.annotation-text-math-group`),u=!i.empty(),m=l.bBox((u?i:G).node()),C=m.width,w=m.height,T=t.width||C,F=t.height||w,U=Math.round(T+2*z),W=Math.round(F+2*z);function K(e,t){return t===`auto`&&(t=e<1/3?`left`:e>2/3?`right`:`center`),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var q=!1,J=[`x`,`y`],Y=0;Y<J.length;Y++){var X=J[Y],Z=t[X+`ref`]||X,Q=t[`a`+X+`ref`],ee={x:_,y}[X],te=(j+(X===`x`?0:-90))*Math.PI/180,ne=U*Math.cos(te),re=W*Math.sin(te),ie=Math.abs(ne)+Math.abs(re),ae=t[X+`anchor`],oe=t[X+`shift`]*(X===`x`?1:-1),se=A[X],ce,le,ue,de,fe,pe=s.getRefType(Z);if(ee&&pe!==`domain`){var me=ee.r2fraction(t[X]);(me<0||me>1)&&(Q===Z?(me=ee.r2fraction(t[`a`+X]),(me<0||me>1)&&(q=!0)):q=!0),ce=ee._offset+ee.r2p(t[X]),de=.5}else{var he=pe===`domain`;X===`x`?(ue=t[X],ce=he?ee._offset+ee._length*ue:ce=x.l+x.w*ue):(ue=1-t[X],ce=he?ee._offset+ee._length*ue:ce=x.t+x.h*ue),de=t.showarrow?.5:ue}if(t.showarrow){se.head=ce;var ge=t[`a`+X];if(fe=ne*K(.5,t.xanchor)-re*K(.5,t.yanchor),Q===Z){var _e=s.getRefType(Q);_e===`domain`?(X===`y`&&(ge=1-ge),se.tail=ee._offset+ee._length*ge):_e===`paper`?X===`y`?(ge=1-ge,se.tail=x.t+x.h*ge):se.tail=x.l+x.w*ge:se.tail=ee._offset+ee.r2p(ge),le=fe}else se.tail=ce+ge,le=fe+ge;se.text=se.tail+fe;var ve=b[X===`x`?`width`:`height`];if(Z===`paper`&&(se.head=a.constrain(se.head,1,ve-1)),Q===`pixel`){var ye=-Math.max(se.tail-3,se.text),be=Math.min(se.tail+3,se.text)-ve;ye>0?(se.tail+=ye,se.text+=ye):be>0&&(se.tail-=be,se.text-=be)}se.tail+=oe,se.head+=oe}else fe=ie*K(de,ae),le=fe,se.text=ce+fe;se.text+=oe,fe+=oe,le+=oe,t[`_`+X+`padplus`]=ie/2+le,t[`_`+X+`padminus`]=ie/2-le,t[`_`+X+`size`]=ie,t[`_`+X+`shift`]=fe}if(q){L.remove();return}var xe=0,Se=0;if(t.align!==`left`&&(xe=(T-C)*(t.align===`center`?.5:1)),t.valign!==`top`&&(Se=(F-w)*(t.valign===`middle`?.5:1)),u)i.select(`svg`).attr({x:z+xe-1,y:z+Se}).call(l.setClipUrl,V?k:null,e);else{var Ce=z+Se-m.top,we=z+xe-m.left;G.call(d.positionText,we,Ce).call(l.setClipUrl,V?k:null,e)}H.select(`rect`).call(l.setRect,z,z,T,F),B.call(l.setRect,R/2,R/2,U-R,W-R),L.call(l.setTranslate,Math.round(A.x.text-U/2),Math.round(A.y.text-W/2)),N.attr({transform:`rotate(`+j+`,`+A.x.text+`,`+A.y.text+`)`});var Te=function(n,i){M.selectAll(`.annotation-arrow-g`).remove();var s=A.x.head,u=A.y.head,d=A.x.tail+n,f=A.y.tail+i,m=A.x.text+n,b=A.y.text+i,C=a.rotationXYMatrix(j,m,b),w=a.apply2DTransform(C),T=a.apply2DTransform2(C),k=+B.attr(`width`),P=+B.attr(`height`),F=m-.5*k,I=F+k,R=b-.5*P,z=R+P,V=[[F,R,F,z],[F,z,I,z],[I,z,I,R],[I,R,F,R]].map(T);if(!V.reduce(function(e,t){return e^!!a.segmentsIntersect(s,u,s+1e6,u+1e6,t[0],t[1],t[2],t[3])},!1)){V.forEach(function(e){var t=a.segmentsIntersect(d,f,s,u,e[0],e[1],e[2],e[3]);t&&(d=t.x,f=t.y)});var H=t.arrowwidth,U=t.arrowcolor,W=t.arrowside,G=M.append(`g`).style({opacity:c.opacity(U)}).classed(`annotation-arrow-g`,!0),K=G.append(`path`).attr(`d`,`M`+d+`,`+f+`L`+s+`,`+u).style(`stroke-width`,H+`px`).call(c.stroke,c.rgb(U));if(h(K,W,t),S.annotationPosition&&K.node().parentNode&&!g){var q=s,J=u;if(t.standoff){var Y=Math.sqrt((s-d)**2+(u-f)**2);q+=t.standoff*(d-s)/Y,J+=t.standoff*(f-u)/Y}var X=G.append(`path`).classed(`annotation-arrow`,!0).classed(`anndrag`,!0).classed(`cursor-move`,!0).attr({d:`M3,3H-3V-3H3ZM0,0L`+(d-q)+`,`+(f-J),transform:o(q,J)}).style(`stroke-width`,H+6+`px`).call(c.stroke,`rgba(0,0,0,0)`).call(c.fill,`rgba(0,0,0,0)`),Z,Q;p.init({element:X.node(),gd:e,prepFn:function(){var e=l.getTranslate(L);Z=e.x,Q=e.y,_&&_.autorange&&E(_._name+`.autorange`,!0),y&&y.autorange&&E(y._name+`.autorange`,!0)},moveFn:function(e,n){var r=w(Z,Q),i=r[0]+e,a=r[1]+n;L.call(l.setTranslate,i,a),D(`x`,v(_,e,`x`,x,t)),D(`y`,v(y,n,`y`,x,t)),t.axref===t.xref&&D(`ax`,v(_,e,`ax`,x,t)),t.ayref===t.yref&&D(`ay`,v(y,n,`ay`,x,t)),G.attr(`transform`,o(e,n)),N.attr({transform:`rotate(`+j+`,`+i+`,`+a+`)`})},doneFn:function(){r.call(`_guiRelayout`,e,O());var t=document.querySelector(`.js-notes-box-panel`);t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&Te(0,0),P){var Ee;p.init({element:L.node(),gd:e,prepFn:function(){Ee=N.attr(`transform`)},moveFn:function(e,n){var r=`pointer`;if(t.showarrow)t.axref===t.xref?D(`ax`,v(_,e,`ax`,x,t)):D(`ax`,t.ax+e),t.ayref===t.yref?D(`ay`,v(y,n,`ay`,x.w,t)):D(`ay`,t.ay+n),Te(e,n);else{if(g)return;var i,a;if(_)i=v(_,e,`x`,x,t);else{var s=t._xsize/x.w,c=t.x+(t._xshift-t.xshift)/x.w-s/2;i=p.align(c+e/x.w,s,0,1,t.xanchor)}if(y)a=v(y,n,`y`,x,t);else{var l=t._ysize/x.h,u=t.y-(t._yshift+t.yshift)/x.h-l/2;a=p.align(u-n/x.h,l,0,1,t.yanchor)}D(`x`,i),D(`y`,a),(!_||!y)&&(r=p.getCursor(_?.5:i,y?.5:a,t.xanchor,t.yanchor))}N.attr({transform:o(e,n)+Ee}),f(L,r)},clickFn:function(n,r){t.captureevents&&e.emit(`plotly_clickannotation`,I(r))},doneFn:function(){f(L),r.call(`_guiRelayout`,e,O());var t=document.querySelector(`.js-notes-box-panel`);t&&t.redraw(t.selectedObj)}})}}S.annotationText?G.call(d.makeEditable,{delegate:L,gd:e}).call(K).on(`edit`,function(n){t.text=n,this.call(K),D(`text`,n),_&&_.autorange&&E(_._name+`.autorange`,!0),y&&y.autorange&&E(y._name+`.autorange`,!0),r.call(`_guiRelayout`,e,O())}):G.call(K)}}),Pi=h((e,t)=>{var n=$(),r=Ke(),i=yt().arrayEditor;t.exports={hasClickToShow:a,onClick:o};function a(e,t){var n=s(e,t);return n.on.length>0||n.explicitOff.length>0}function o(e,t){var a=s(e,t),o=a.on,c=a.off.concat(a.explicitOff),l={},u=e._fullLayout.annotations,d,f;if(o.length||c.length){for(d=0;d<o.length;d++)f=i(e.layout,`annotations`,u[o[d]]),f.modifyItem(`visible`,!0),n.extendFlat(l,f.getUpdateObj());for(d=0;d<c.length;d++)f=i(e.layout,`annotations`,u[c[d]]),f.modifyItem(`visible`,!1),n.extendFlat(l,f.getUpdateObj());return r.call(`update`,e,{},l)}}function s(e,t){var n=e._fullLayout.annotations,r=[],i=[],a=[],o=(t||[]).length,s,l,u,d,f,p,m,h;for(s=0;s<n.length;s++)if(u=n[s],d=u.clicktoshow,d){for(l=0;l<o;l++)if(f=t[l],p=f.xaxis,m=f.yaxis,p._id===u.xref&&m._id===u.yref&&p.d2r(f.x)===c(u._xclick,p)&&m.d2r(f.y)===c(u._yclick,m)){h=u.visible?d===`onout`?i:a:r,h.push(s);break}l===o&&u.visible&&d===`onout`&&i.push(s)}return{on:r,off:i,explicitOff:a}}function c(e,t){return t.type===`log`?t.l2r(e):t.d2r(e)}}),Fi=h((e,t)=>{var n=$(),r=q();t.exports=function(e,t,i,a){a(`opacity`);var o=a(`bgcolor`),s=a(`bordercolor`),c=r.opacity(s);a(`borderpad`);var l=a(`borderwidth`),u=a(`showarrow`);if(a(`text`,u?` `:i._dfltTitle.annotation),a(`textangle`),n.coerceFont(a,`font`,i.font),a(`width`),a(`align`),a(`height`)&&a(`valign`),u){var d=a(`arrowside`),f,p;d.indexOf(`end`)!==-1&&(f=a(`arrowhead`),p=a(`arrowsize`)),d.indexOf(`start`)!==-1&&(a(`startarrowhead`,f),a(`startarrowsize`,p)),a(`arrowcolor`,c?t.bordercolor:r.defaultLine),a(`arrowwidth`,(c&&l||1)*2),a(`standoff`),a(`startstandoff`)}var m=a(`hovertext`),h=i.hoverlabel||{};if(m){var g=a(`hoverlabel.bgcolor`,h.bgcolor||(r.opacity(o)?r.rgb(o):r.defaultLine)),_=a(`hoverlabel.bordercolor`,h.bordercolor||r.contrast(g)),v=n.extendFlat({},h.font);v.color||=_,n.coerceFont(a,`hoverlabel.font`,v)}a(`captureevents`,!!m)}}),Ii=h((e,t)=>{var n=$(),r=sn(),i=Vt(),a=Fi(),o=Sr();t.exports=function(e,t){i(e,t,{name:`annotations`,handleItemDefaults:s})};function s(e,t,i){function s(r,i){return n.coerce(e,t,o,r,i)}var c=s(`visible`),l=s(`clicktoshow`);if(c||l){a(e,t,i,s);for(var u=t.showarrow,d=[`x`,`y`],f=[-10,-30],p={_fullLayout:i},m=0;m<2;m++){var h=d[m],g=r.coerceRef(e,t,p,h,``,`paper`);if(g!==`paper`&&r.getFromId(p,g)._annIndices.push(t._index),r.coercePosition(t,p,s,g,h,.5),u){var _=`a`+h,v=r.coerceRef(e,t,p,_,`pixel`,[`pixel`,`paper`]);v!==`pixel`&&v!==g&&(v=t[_]=`pixel`);var y=v===`pixel`?f[m]:.4;r.coercePosition(t,p,s,v,_,y)}s(h+`anchor`),s(h+`shift`)}if(n.noneOrAll(e,t,[`x`,`y`]),u&&n.noneOrAll(e,t,[`ax`,`ay`]),l){var b=s(`xclick`),x=s(`yclick`);t._xclick=b===void 0?t.x:r.cleanPosition(b,p,t.xref),t._yclick=x===void 0?t.y:r.cleanPosition(x,p,t.yref)}}}}),Li=h((e,t)=>{var n=$(),r=sn(),i=Ni().draw;t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,a],e)};function a(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach(function(t){var n=r.getFromId(e,t.xref),i=r.getFromId(e,t.yref),a=r.getRefType(t.xref),s=r.getRefType(t.yref);t._extremes={},a===`range`&&o(t,n),s===`range`&&o(t,i)})}function o(e,t){var n=t._id,i=n.charAt(0),a=e[i],o=e[`a`+i],s=e[i+`ref`],c=e[`a`+i+`ref`],l=e[`_`+i+`padplus`],u=e[`_`+i+`padminus`],d={x:1,y:-1}[i]*e[i+`shift`],f=3*e.arrowsize*e.arrowwidth||0,p=f+d,m=f-d,h=3*e.startarrowsize*e.arrowwidth||0,g=h+d,_=h-d,v;if(c===s){var y=r.findExtremes(t,[t.r2c(a)],{ppadplus:p,ppadminus:m}),b=r.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(l,g),ppadminus:Math.max(u,_)});v={min:[y.min[0],b.min[0]],max:[y.max[0],b.max[0]]}}else g=o?g+o:g,_=o?_-o:_,v=r.findExtremes(t,[t.r2c(a)],{ppadplus:Math.max(l,p,g),ppadminus:Math.max(u,m,_)});e._extremes[n]=v}}),Ri=h((e,t)=>{var n=D(),r=F();t.exports=function(e,t,i,a){t||={};var o=i===`log`&&t.type===`linear`,s=i===`linear`&&t.type===`log`;if(!(o||s))return;var c=e._fullLayout.annotations,l=t._id.charAt(0),u,d;function f(e){var i=u[e],s=null;s=o?r(i,t.range):10**i,n(s)||(s=null),a(d+e,s)}for(var p=0;p<c.length;p++)u=c[p],d=`annotations[`+p+`].`,u[l+`ref`]===t._id&&f(l),u[`a`+l+`ref`]===t._id&&f(`a`+l)}}),zi=h((e,t)=>{var n=Ni(),r=Pi();t.exports={moduleType:`component`,name:`annotations`,layoutAttributes:Sr(),supplyLayoutDefaults:Ii(),includeBasePlot:kr()(`annotations`),calcAutorange:Li(),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:r.hasClickToShow,onClick:r.onClick,convertCoords:Ri()}}),Bi=h((e,t)=>{var n=Sr(),r=Ie().overrideAll,i=yt().templatedArray;t.exports=r(i(`annotation`,{visible:n.visible,x:{valType:`any`},y:{valType:`any`},z:{valType:`any`},ax:{valType:`number`},ay:{valType:`number`},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,startarrowhead:n.startarrowhead,arrowside:n.arrowside,arrowsize:n.arrowsize,startarrowsize:n.startarrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,startstandoff:n.startstandoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents}),`calc`,`from-root`)}),Vi=h((e,t)=>{var n=$(),r=sn(),i=Vt(),a=Fi(),o=Bi();t.exports=function(e,t,n){i(e,t,{name:`annotations`,handleItemDefaults:s,fullLayout:n.fullLayout})};function s(e,t,i,s){function c(r,i){return n.coerce(e,t,o,r,i)}function l(e){var n=e+`axis`,a={_fullLayout:{}};return a._fullLayout[n]=i[n],r.coercePosition(t,a,c,e,e,.5)}c(`visible`)&&(a(e,t,s.fullLayout,c),l(`x`),l(`y`),l(`z`),n.noneOrAll(e,t,[`x`,`y`,`z`]),t.xref=`x`,t.yref=`y`,t.zref=`z`,c(`xanchor`),c(`yanchor`),c(`xshift`),c(`yshift`),t.showarrow&&(t.axref=`pixel`,t.ayref=`pixel`,c(`ax`,-10),c(`ay`,-30),n.noneOrAll(e,t,[`ax`,`ay`])))}}),Hi=h((e,t)=>{var n=$(),r=sn();t.exports=function(e){for(var t=e.fullSceneLayout.annotations,n=0;n<t.length;n++)i(t[n],e);e.fullLayout._infolayer.selectAll(`.annotation-`+e.id).remove()};function i(e,t){var i=t.fullSceneLayout.domain,a=t.fullLayout._size,o={pdata:null,type:`linear`,autorange:!1,range:[-1/0,1/0]};e._xa={},n.extendFlat(e._xa,o),r.setConvert(e._xa),e._xa._offset=a.l+i.x[0]*a.w,e._xa.l2p=function(){return .5*(1+e._pdata[0]/e._pdata[3])*a.w*(i.x[1]-i.x[0])},e._ya={},n.extendFlat(e._ya,o),r.setConvert(e._ya),e._ya._offset=a.t+(1-i.y[1])*a.h,e._ya.l2p=function(){return .5*(1-e._pdata[1]/e._pdata[3])*a.h*(i.y[1]-i.y[0])}}}),Ui=h((e,t)=>{function n(e,t){var n=[0,0,0,0],r,i;for(r=0;r<4;++r)for(i=0;i<4;++i)n[i]+=e[4*r+i]*t[r];return n}function r(e,t){return n(e.projection,n(e.view,n(e.model,[t[0],t[1],t[2],1])))}t.exports=r}),Wi=h((e,t)=>{var n=Ni().drawRaw,r=Ui(),i=[`x`,`y`,`z`];t.exports=function(e){for(var t=e.fullSceneLayout,a=e.dataScale,o=t.annotations,s=0;s<o.length;s++){for(var c=o[s],l=!1,u=0;u<3;u++){var d=i[u],f=c[d],p=t[d+`axis`].r2fraction(f);if(p<0||p>1){l=!0;break}}l?e.fullLayout._infolayer.select(`.annotation-`+e.id+`[data-index="`+s+`"]`).remove():(c._pdata=r(e.glplot.cameraParams,[t.xaxis.r2l(c.x)*a[0],t.yaxis.r2l(c.y)*a[1],t.zaxis.r2l(c.z)*a[2]]),n(e.graphDiv,c,s,e.id,c._xa,c._ya))}}}),Gi=h((e,t)=>{var n=Ke(),r=$();t.exports={moduleType:`component`,name:`annotations3d`,schema:{subplots:{scene:{annotations:Bi()}}},layoutAttributes:Bi(),handleDefaults:Vi(),includeBasePlot:i,convert:Hi(),draw:Wi()};function i(e,t){var i=n.subplotsRegistry.gl3d;if(i)for(var a=i.attrRegex,o=Object.keys(e),s=0;s<o.length;s++){var c=o[s];a.test(c)&&(e[c].annotations||[]).length&&(r.pushUnique(t._basePlotModules,i),r.pushUnique(t._subplots.gl3d,c))}}}),Ki=h((e,t)=>{bt();var n=B(),r=Tr().line,i=Le().dash,a=z().extendFlat,o=yt().templatedArray;xr();var s=W(),c=Sr(),{shapeTexttemplateAttrs:l,templatefallbackAttrs:u}=ze(),d=Be();t.exports=o(`shape`,{visible:a({},s.visible,{editType:`calc+arraydraw`}),showlegend:{valType:`boolean`,dflt:!1,editType:`calc+arraydraw`},legend:a({},s.legend,{editType:`calc+arraydraw`}),legendgroup:a({},s.legendgroup,{editType:`calc+arraydraw`}),legendgrouptitle:{text:a({},s.legendgrouptitle.text,{editType:`calc+arraydraw`}),font:n({editType:`calc+arraydraw`}),editType:`calc+arraydraw`},legendrank:a({},s.legendrank,{editType:`calc+arraydraw`}),legendwidth:a({},s.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:a({},c.xref,{arrayOk:!0}),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:a({},c.yref,{arrayOk:!0}),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:a({},r.color,{editType:`arraydraw`}),width:a({},r.width,{editType:`calc+arraydraw`}),dash:a({},i,{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:l({},{keys:Object.keys(d)}),texttemplatefallback:u({editType:`arraydraw`}),font:n({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`})}),qi=h((e,t)=>{var n=$(),r=sn(),i=Vt(),a=Ki(),o=qn();t.exports=function(e,t){i(e,t,{name:`shapes`,handleItemDefaults:c})};function s(e,t){return e?`bottom`:t.indexOf(`top`)===-1?t.indexOf(`bottom`)===-1?`middle`:`bottom`:`top`}function c(e,t,i){function c(r,i){return n.coerce(e,t,a,r,i)}if(t._isShape=!0,!c(`visible`))return;c(`showlegend`)&&(c(`legend`),c(`legendwidth`),c(`legendgroup`),c(`legendgrouptitle.text`),n.coerceFont(c,`legendgrouptitle.font`),c(`legendrank`));var l=c(`path`),u=c(`type`,l?`path`:`rect`),d=u!==`path`;d&&delete t.path,c(`editable`),c(`layer`),c(`opacity`),c(`fillcolor`),c(`fillrule`),c(`line.width`)&&(c(`line.color`),c(`line.dash`));var f=c(`xsizemode`),p=c(`ysizemode`);let m=[.25,.75],h=[0,10];[`x`,`y`].forEach(a=>{var s=a+`anchor`,g=a===`x`?f:p,_={_fullLayout:i},v,y,b,x;let S=e[a+`ref`];if(Array.isArray(S)&&S.length>0){let n=o.countDefiningCoords(u,l,a);x=r.coerceRefArray(e,t,_,a,void 0,`paper`,n),t[`_`+a+`refArray`]=!0}else x=r.coerceRef(e,t,_,a,void 0,`paper`);if(Array.isArray(x))x.forEach(function(e){r.getRefType(e)===`range`&&(v=r.getFromId(_,e),v&&v._shapeIndices.indexOf(t._index)===-1&&v._shapeIndices.push(t._index))}),d&&[0,1].forEach(function(i){let l=x[i];r.getRefType(l)===`range`?(v=r.getFromId(_,l),y=o.shapePositionToRange(v),b=o.rangeToShapePosition(v),(v.type===`category`||v.type===`multicategory`)&&c(a+i+`shift`)):y=b=n.identity;let u=a+i,d=e[u];if(e[u]=y(e[u],!0),g===`pixel`?c(u,h[i]):r.coercePosition(t,_,c,l,u,m[i]),t[u]=b(t[u]),e[u]=d,i===0&&g===`pixel`){let n=e[s];e[s]=y(e[s],!0),r.coercePosition(t,_,c,l,s,.25),t[s]=b(t[s]),e[s]=n}});else{if(r.getRefType(x)===`range`?(v=r.getFromId(_,x),v._shapeIndices.push(t._index),b=o.rangeToShapePosition(v),y=o.shapePositionToRange(v),d&&(v.type===`category`||v.type===`multicategory`)&&(c(a+`0shift`),c(a+`1shift`))):y=b=n.identity,d){let n=a+`0`,i=a+`1`,o=e[n],s=e[i];e[n]=y(e[n],!0),e[i]=y(e[i],!0),g===`pixel`?(c(n,h[0]),c(i,h[1])):(r.coercePosition(t,_,c,x,n,m[0]),r.coercePosition(t,_,c,x,i,m[1])),t[n]=b(t[n]),t[i]=b(t[i]),e[n]=o,e[i]=s}if(g===`pixel`){let n=e[s];e[s]=y(e[s],!0),r.coercePosition(t,_,c,x,s,.25),t[s]=b(t[s]),e[s]=n}}}),d&&n.noneOrAll(e,t,[`x0`,`x1`,`y0`,`y1`]);var g=u===`line`,_,v;if(d&&(_=c(`label.texttemplate`),c(`label.texttemplatefallback`)),_||(v=c(`label.text`)),v||_){c(`label.textangle`);var y=c(`label.textposition`,g?`middle`:`middle center`);c(`label.xanchor`),c(`label.yanchor`,s(g,y)),c(`label.padding`),n.coerceFont(c,`label.font`,i.font)}}}),Ji=h((e,t)=>{var n=q(),r=$();function i(e,t){return e?`bottom`:t.indexOf(`top`)===-1?t.indexOf(`bottom`)===-1?`middle`:`bottom`:`top`}t.exports=function(e,t,a){if(a(`newshape.visible`),a(`newshape.name`),a(`newshape.showlegend`),a(`newshape.legend`),a(`newshape.legendwidth`),a(`newshape.legendgroup`),a(`newshape.legendgrouptitle.text`),r.coerceFont(a,`newshape.legendgrouptitle.font`),a(`newshape.legendrank`),a(`newshape.drawdirection`),a(`newshape.layer`),a(`newshape.fillcolor`),a(`newshape.fillrule`),a(`newshape.opacity`),a(`newshape.line.width`)){var o=(e||{}).plot_bgcolor||`#FFF`;a(`newshape.line.color`,n.contrast(o)),a(`newshape.line.dash`)}var s=e.dragmode===`drawline`,c=a(`newshape.label.text`),l=a(`newshape.label.texttemplate`);if(a(`newshape.label.texttemplatefallback`),c||l){a(`newshape.label.textangle`);var u=a(`newshape.label.textposition`,s?`middle`:`middle center`);a(`newshape.label.xanchor`),a(`newshape.label.yanchor`,i(s,u)),a(`newshape.label.padding`),r.coerceFont(a,`newshape.label.font`,t.font)}a(`activeshape.fillcolor`),a(`activeshape.opacity`)}}),Yi=h((e,t)=>{var n=$(),r=sn(),i=Kn(),a=qn();t.exports=function(e){var t=e._fullLayout,a=n.filterVisible(t.shapes);if(!(!a.length||!e._fullData.length))for(var l=0;l<a.length;l++){var d=a[l];d._extremes={};var f,p,m=r.getRefType(d.xref),h=r.getRefType(d.yref);if(m===`array`){let t=o(e,d,`x`);Object.entries(t).forEach(([t,n])=>{f=r.getFromId(e,t),d._extremes[f._id]=r.findExtremes(f,n,s(d))})}else d.xref!==`paper`&&m!==`domain`&&(f=r.getFromId(e,d.xref),p=u(f,d,i.paramIsX),p&&(d._extremes[f._id]=r.findExtremes(f,p,s(d))));if(h===`array`){let t=o(e,d,`y`);Object.entries(t).forEach(([t,n])=>{f=r.getFromId(e,t),d._extremes[f._id]=r.findExtremes(f,n,c(d))})}else d.yref!==`paper`&&h!==`domain`&&(f=r.getFromId(e,d.yref),p=u(f,d,i.paramIsY),p&&(d._extremes[f._id]=r.findExtremes(f,p,c(d))))}};function o(e,t,n){let o=t[n+`ref`],s=n===`x`?i.paramIsX:i.paramIsY;function c(e,t){e===`paper`||r.getRefType(e)===`domain`||(l[e]||(l[e]=[]),l[e].push(t))}let l={};if(t.type===`path`&&t.path){let e=t.path.match(i.segmentRE)||[];for(var u=0,d=0;d<e.length;d++){let t=e[d],n=s[t.charAt(0)].drawn;if(n===void 0)continue;let r=t.slice(1).match(i.paramRE);r&&r.length>n&&(c(o[u],r[n]),u++)}}else c(o[0],t[n+`0`]),c(o[1],t[n+`1`]);let f={};for(let t in l){let n=r.getFromId(e,t);if(n){var p=n.type===`category`||n.type===`multicategory`?n.r2c:n.d2c;n.type===`date`&&(p=a.decodeDate(p)),f[n._id]=l[t].map(p)}}return f}function s(e){return l(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function c(e){return l(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function l(e,t,r,o,s,c){var l=e/2,u=c;if(t===`pixel`){var d=s?a.extractPathCoords(s,c?i.paramIsY:i.paramIsX):[r,o],f=n.aggNums(Math.max,null,d),p=n.aggNums(Math.min,null,d),m=p<0?Math.abs(p)+l:l,h=f>0?f+l:l;return{ppad:l,ppadplus:u?m:h,ppadminus:u?h:m}}else return{ppad:l}}function u(e,t,n){var r=e._id.charAt(0)===`x`?`x`:`y`,o=e.type===`category`||e.type===`multicategory`,s,c,l=0,u=0,d=o?e.r2c:e.d2c;if(t[r+`sizemode`]===`scaled`?(s=t[r+`0`],c=t[r+`1`],o&&(l=t[r+`0shift`],u=t[r+`1shift`])):(s=t[r+`anchor`],c=t[r+`anchor`]),s!==void 0)return[d(s)+l,d(c)+u];if(t.path){var f=1/0,p=-1/0,m=t.path.match(i.segmentRE),h,g,_,v,y;for(e.type===`date`&&(d=a.decodeDate(d)),h=0;h<m.length;h++)g=m[h],_=n[g.charAt(0)].drawn,_!==void 0&&(v=m[h].slice(1).match(i.paramRE),!(!v||v.length<_)&&(y=d(v[_]),y<f&&(f=y),y>p&&(p=y)));if(p>=f)return[f,p]}}}),Xi=h((e,t)=>{var n=Xn();t.exports={moduleType:`component`,name:`shapes`,layoutAttributes:Ki(),supplyLayoutDefaults:qi(),supplyDrawNewShapeDefaults:Ji(),includeBasePlot:kr()(`shapes`),calcAutorange:Yi(),draw:n.draw,drawOne:n.drawOne}}),Zi=h((e,t)=>{var n=bt(),r=yt().templatedArray;xr(),t.exports=r(`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`,n.idRegex.x.toString()],dflt:`paper`,editType:`arraydraw`},yref:{valType:`enumerated`,values:[`paper`,n.idRegex.y.toString()],dflt:`paper`,editType:`arraydraw`},editType:`arraydraw`})}),Qi=h((e,t)=>{var n=$(),r=sn(),i=Vt(),a=Zi(),o=`images`;t.exports=function(e,t){i(e,t,{name:o,handleItemDefaults:s})};function s(e,t,i){function o(r,i){return n.coerce(e,t,a,r,i)}if(!o(`visible`,!!o(`source`)))return t;o(`layer`),o(`xanchor`),o(`yanchor`),o(`sizex`),o(`sizey`),o(`sizing`),o(`opacity`);for(var s={_fullLayout:i},c=[`x`,`y`],l=0;l<2;l++){var u=c[l],d=r.coerceRef(e,t,s,u,`paper`,void 0);d!==`paper`&&r.getFromId(s,d)._imgIndices.push(t._index),r.coercePosition(t,s,o,d,u,0)}return t}}),$i=h((e,t)=>{var n=S(),r=tn(),i=sn(),a=xt(),o=Dt();t.exports=function(e){var t=e._fullLayout,s=[],c={},l=[],u,d;for(d=0;d<t.images.length;d++){var f=t.images[d];if(f.visible)if(f.layer===`below`&&f.xref!==`paper`&&f.yref!==`paper`){u=a.ref2id(f.xref)+a.ref2id(f.yref);var p=t._plots[u];if(!p){l.push(f);continue}p.mainplot&&(u=p.mainplot.id),c[u]||(c[u]=[]),c[u].push(f)}else f.layer===`above`?s.push(f):l.push(f)}var m={x:{left:{sizing:`xMin`,offset:0},center:{sizing:`xMid`,offset:-1/2},right:{sizing:`xMax`,offset:-1}},y:{top:{sizing:`YMin`,offset:0},middle:{sizing:`YMid`,offset:-1/2},bottom:{sizing:`YMax`,offset:-1}}};function h(t){var r=n.select(this);if(this._imgSrc!==t.source)if(r.attr(`xmlns`,o.svg),!e._context.staticPlot||t.source&&t.source.slice(0,5)===`data:`)r.attr(`xlink:href`,t.source),this._imgSrc=t.source;else{var i=new Promise(function(e){var n=new Image;this.img=n,n.setAttribute(`crossOrigin`,`anonymous`),n.onerror=i,n.onload=function(){var t=document.createElement(`canvas`);t.width=this.width,t.height=this.height,t.getContext(`2d`,{willReadFrequently:!0}).drawImage(this,0,0);var n=t.toDataURL(`image/png`);r.attr(`xlink:href`,n),e()},r.on(`error`,i),n.src=t.source,this._imgSrc=t.source;function i(){r.remove(),e()}}.bind(this));e._promises.push(i)}}function g(a){var o=n.select(this),s=i.getFromId(e,a.xref),c=i.getFromId(e,a.yref),l=i.getRefType(a.xref)===`domain`,u=i.getRefType(a.yref)===`domain`,d=t._size,f=s===void 0?a.sizex*d.w:typeof a.xref==`string`&&l?s._length*a.sizex:Math.abs(s.l2p(a.sizex)-s.l2p(0)),p=c===void 0?a.sizey*d.h:typeof a.yref==`string`&&u?c._length*a.sizey:Math.abs(c.l2p(a.sizey)-c.l2p(0)),h=f*m.x[a.xanchor].offset,g=p*m.y[a.yanchor].offset,_=m.x[a.xanchor].sizing+m.y[a.yanchor].sizing,v,y;switch(v=s===void 0?a.x*d.w+d.l:typeof a.xref==`string`&&l?s._length*a.x+s._offset:s.r2p(a.x)+s._offset,v+=h,y=c===void 0?d.h-a.y*d.h+d.t:typeof a.yref==`string`&&u?c._length*(1-a.y)+c._offset:c.r2p(a.y)+c._offset,y+=g,a.sizing){case`fill`:_+=` slice`;break;case`stretch`:_=`none`;break}o.attr({x:v,y,width:f,height:p,preserveAspectRatio:_,opacity:a.opacity});var b=(s&&i.getRefType(a.xref)!==`domain`?s._id:``)+(c&&i.getRefType(a.yref)!==`domain`?c._id:``);r.setClipUrl(o,b?`clip`+t._uid+b:null,e)}function _(e){return[e.xref,e.x,e.sizex,e.yref,e.y,e.sizey].join(`_`)}function v(e,t){return e._index-t._index}var y=t._imageLowerLayer.selectAll(`image`).data(l,_),b=t._imageUpperLayer.selectAll(`image`).data(s,_);y.enter().append(`image`),b.enter().append(`image`),y.exit().remove(),b.exit().remove(),y.each(function(e){h.bind(this)(e),g.bind(this)(e)}),b.each(function(e){h.bind(this)(e),g.bind(this)(e)}),y.sort(v),b.sort(v);var x=Object.keys(t._plots);for(d=0;d<x.length;d++){u=x[d];var S=t._plots[u];if(S.imagelayer){var C=S.imagelayer.selectAll(`image`).data(c[u]||[],_);C.enter().append(`image`),C.exit().remove(),C.each(function(e){h.bind(this)(e),g.bind(this)(e)}),C.sort(v)}}}}),ea=h((e,t)=>{var n=D(),r=F();t.exports=function(e,t,i,a){t||={};var o=i===`log`&&t.type===`linear`,s=i===`linear`&&t.type===`log`;if(o||s){for(var c=e._fullLayout.images,l=t._id.charAt(0),u,d,f=0;f<c.length;f++)if(u=c[f],d=`images[`+f+`].`,u[l+`ref`]===t._id){var p=u[l],m=u[`size`+l],h=null,g=null;if(o){h=r(p,t.range);var _=m/10**h/2;g=2*Math.log(_+Math.sqrt(1+_*_))/Math.LN10}else h=10**p,g=h*(10**(m/2)-10**(-m/2));n(h)?n(g)||(g=null):(h=null,g=null),a(d+l,h),a(d+`size`+l,g)}}}}),ta=h((e,t)=>{t.exports={moduleType:`component`,name:`images`,layoutAttributes:Zi(),supplyLayoutDefaults:Qi(),includeBasePlot:kr()(`images`),draw:$i(),convertCoords:ea()}}),na=h((e,t)=>{t.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:`▼`}}}),ra=h((e,t)=>{var n=B(),r=K(),i=z().extendFlat,a=Ie().overrideAll,o=Ue(),s=yt().templatedArray;t.exports=a(s(`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:s(`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}}),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:i(o({editType:`arraydraw`}),{}),font:n({}),bgcolor:{valType:`color`},bordercolor:{valType:`color`,dflt:r.borderLine},borderwidth:{valType:`number`,min:0,dflt:1,editType:`arraydraw`}}),`arraydraw`,`from-root`)}),ia=h((e,t)=>{var n=$(),r=Vt(),i=ra(),a=na().name,o=i.buttons;t.exports=function(e,t){r(e,t,{name:a,handleItemDefaults:s})};function s(e,t,a){function o(r,a){return n.coerce(e,t,i,r,a)}o(`visible`,r(e,t,{name:`buttons`,handleItemDefaults:c}).length>0)&&(o(`active`),o(`direction`),o(`type`),o(`showactive`),o(`x`),o(`y`),n.noneOrAll(e,t,[`x`,`y`]),o(`xanchor`),o(`yanchor`),o(`pad.t`),o(`pad.r`),o(`pad.b`),o(`pad.l`),n.coerceFont(o,`font`,a.font),o(`bgcolor`,a.paper_bgcolor),o(`bordercolor`),o(`borderwidth`))}function c(e,t){function r(r,i){return n.coerce(e,t,o,r,i)}r(`visible`,e.method===`skip`||Array.isArray(e.args))&&(r(`method`),r(`args`),r(`args2`),r(`label`),r(`execute`))}}),aa=h((e,t)=>{t.exports=o;var n=S(),r=q(),i=tn(),a=$();function o(e,t,n){this.gd=e,this.container=t,this.id=n,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})}o.barWidth=2,o.barLength=20,o.barRadius=2,o.barPad=1,o.barColor=`#808BA4`,o.prototype.enable=function(e,t,a){var s=this.gd._fullLayout,c=s.width,l=s.height;this.position=e;var u=this.position.l,d=this.position.w,f=this.position.t,p=this.position.h,m=this.position.direction,h=m===`down`,g=m===`left`,_=m===`right`,v=m===`up`,y=d,b=p,x,S,C,w;!h&&!g&&!_&&!v&&(this.position.direction=`down`,h=!0),h||v?(x=u,S=x+y,h?(C=f,w=Math.min(C+b,l),b=w-C):(w=f+b,C=Math.max(w-b,0),b=w-C)):(C=f,w=C+b,g?(S=u+y,x=Math.max(S-y,0),y=S-x):(x=u,S=Math.min(x+y,c),y=S-x)),this._box={l:x,t:C,w:y,h:b};var T=d>y,E=o.barLength+2*o.barPad,D=o.barWidth+2*o.barPad,O=u,k=f+p;k+D>l&&(k=l-D);var A=this.container.selectAll(`rect.scrollbar-horizontal`).data(T?[0]:[]);A.exit().on(`.drag`,null).remove(),A.enter().append(`rect`).classed(`scrollbar-horizontal`,!0).call(r.fill,o.barColor),T?(this.hbar=A.attr({rx:o.barRadius,ry:o.barRadius,x:O,y:k,width:E,height:D}),this._hbarXMin=O+E/2,this._hbarTranslateMax=y-E):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var j=p>b,M=o.barWidth+2*o.barPad,N=o.barLength+2*o.barPad,P=u+d,F=f;P+M>c&&(P=c-M);var I=this.container.selectAll(`rect.scrollbar-vertical`).data(j?[0]:[]);I.exit().on(`.drag`,null).remove(),I.enter().append(`rect`).classed(`scrollbar-vertical`,!0).call(r.fill,o.barColor),j?(this.vbar=I.attr({rx:o.barRadius,ry:o.barRadius,x:P,y:F,width:M,height:N}),this._vbarYMin=F+N/2,this._vbarTranslateMax=b-N):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var L=this.id,R=x-.5,z=j?S+M+.5:S+.5,B=C-.5,V=T?w+D+.5:w+.5,H=s._topdefs.selectAll(`#`+L).data(T||j?[0]:[]);if(H.exit().remove(),H.enter().append(`clipPath`).attr(`id`,L).append(`rect`),T||j?(this._clipRect=H.select(`rect`).attr({x:Math.floor(R),y:Math.floor(B),width:Math.ceil(z)-Math.floor(R),height:Math.ceil(V)-Math.floor(B)}),this.container.call(i.setClipUrl,L,this.gd),this.bg.attr({x:u,y:f,width:d,height:p})):(this.bg.attr({width:0,height:0}),this.container.on(`wheel`,null).on(`.drag`,null).call(i.setClipUrl,null),delete this._clipRect),T||j){var U=n.behavior.drag().on(`dragstart`,function(){n.event.sourceEvent.preventDefault()}).on(`drag`,this._onBoxDrag.bind(this));this.container.on(`wheel`,null).on(`wheel`,this._onBoxWheel.bind(this)).on(`.drag`,null).call(U);var W=n.behavior.drag().on(`dragstart`,function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()}).on(`drag`,this._onBarDrag.bind(this));T&&this.hbar.on(`.drag`,null).call(W),j&&this.vbar.on(`.drag`,null).call(W)}this.setTranslate(t,a)},o.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on(`wheel`,null).on(`.drag`,null).call(i.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)},o.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},o.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},o.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,i=r+this._hbarTranslateMax;e=(a.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var o=t+this._vbarYMin,s=o+this._vbarTranslateMax;t=(a.constrain(n.event.y,o,s)-o)/(s-o)*(this.position.h-this._box.h)}this.setTranslate(e,t)},o.prototype.setTranslate=function(e,t){var n=this.position.w-this._box.w,r=this.position.h-this._box.h;if(e=a.constrain(e||0,0,n),t=a.constrain(t||0,0,r),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var o=e/n;this.hbar.call(i.setTranslate,e+o*this._hbarTranslateMax,t)}if(this.vbar){var s=t/r;this.vbar.call(i.setTranslate,e,t+s*this._vbarTranslateMax)}}}),oa=h((e,t)=>{var n=S(),r=Et(),i=q(),a=tn(),o=$(),s=kt(),c=yt().arrayEditor,l=Ot().LINE_SPACING,u=na(),d=aa();t.exports=function(e){var t=e._fullLayout,i=o.filterVisible(t[u.name]);function a(t){r.autoMargin(e,O(t))}var s=t._menulayer.selectAll(`g.`+u.containerClassName).data(i.length>0?[0]:[]);if(s.enter().append(`g`).classed(u.containerClassName,!0).style(`cursor`,`pointer`),s.exit().each(function(){n.select(this).selectAll(`g.`+u.headerGroupClassName).each(a)}).remove(),i.length!==0){var c=s.selectAll(`g.`+u.headerGroupClassName).data(i,f);c.enter().append(`g`).classed(u.headerGroupClassName,!0);for(var l=o.ensureSingle(s,`g`,u.dropdownButtonGroupClassName,function(e){e.style(`pointer-events`,`all`)}),p=0;p<i.length;p++){var v=i[p];D(e,v)}var y=new d(e,l,`updatemenus`+t._uid);c.enter().size()&&(l.node().parentNode.appendChild(l.node()),l.call(A)),c.exit().each(function(e){l.call(A),a(e)}).remove(),c.each(function(t){var i=n.select(this),a=t.type===`dropdown`?l:null;r.manageCommandObserver(e,t,t.buttons,function(n){h(e,t,t.buttons[n.index],i,a,y,n.index,!0)}),t.type===`dropdown`?(g(e,i,l,y,t),m(l,t)&&_(e,i,l,y,t)):_(e,i,null,null,t)})}};function f(e){return e._index}function p(e){return+e.attr(u.menuIndexAttrName)==-1}function m(e,t){return+e.attr(u.menuIndexAttrName)===t._index}function h(e,t,n,r,i,a,o,s){t.active=o,c(e.layout,u.name,t).applyUpdate(`active`,o),t.type===`buttons`?_(e,r,null,null,t):t.type===`dropdown`&&(i.attr(u.menuIndexAttrName,`-1`),g(e,r,i,a,t),s||_(e,r,i,a,t))}function g(e,t,n,r,i){var s=o.ensureSingle(t,`g`,u.headerClassName,function(e){e.style(`pointer-events`,`all`)}),c=i._dims,l=i.active,d=i.buttons[l]||u.blankHeaderOpts,f={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},p={width:c.headerWidth,height:c.headerHeight};s.call(b,i,d,e).call(k,i,f,p),o.ensureSingle(t,`text`,u.headerArrowClassName,function(e){e.attr(`text-anchor`,`end`).call(a.font,i.font).text(u.arrowSymbol[i.direction])}).attr({x:c.headerWidth-u.arrowOffsetX+i.pad.l,y:c.headerHeight/2+u.textOffsetY+i.pad.t}),s.on(`click`,function(){n.call(A,String(m(n,i)?-1:i._index)),_(e,t,n,r,i)}),s.on(`mouseover`,function(){s.call(T)}),s.on(`mouseout`,function(){s.call(E,i)}),a.setTranslate(t,c.lx,c.ly)}function _(e,t,i,a,s){i||(i=t,i.attr(`pointer-events`,`all`));var c=!p(i)||s.type===`buttons`?s.buttons:[],l=s.type===`dropdown`?u.dropdownButtonClassName:u.buttonClassName,d=i.selectAll(`g.`+l).data(o.filterVisible(c)),f=d.enter().append(`g`).classed(l,!0),m=d.exit();s.type===`dropdown`?(f.attr(`opacity`,`0`).transition().attr(`opacity`,`1`),m.transition().attr(`opacity`,`0`).remove()):m.remove();var g=0,_=0,x=s._dims,S=[`up`,`down`].indexOf(s.direction)!==-1;s.type===`dropdown`&&(S?_=x.headerHeight+u.gapButtonHeader:g=x.headerWidth+u.gapButtonHeader),s.type===`dropdown`&&s.direction===`up`&&(_=-u.gapButtonHeader+u.gapButton-x.openHeight),s.type===`dropdown`&&s.direction===`left`&&(g=-u.gapButtonHeader+u.gapButton-x.openWidth);var C={x:x.lx+g+s.pad.l,y:x.ly+_+s.pad.t,yPad:u.gapButton,xPad:u.gapButton,index:0},D={l:C.x+s.borderwidth,t:C.y+s.borderwidth};d.each(function(o,c){var l=n.select(this);l.call(b,s,o,e).call(k,s,C),l.on(`click`,function(){n.event.defaultPrevented||(o.execute&&(o.args2&&s.active===c?(h(e,s,o,t,i,a,-1),r.executeAPICommand(e,o.method,o.args2)):(h(e,s,o,t,i,a,c),r.executeAPICommand(e,o.method,o.args))),e.emit(`plotly_buttonclicked`,{menu:s,button:o,active:s.active}))}),l.on(`mouseover`,function(){l.call(T)}),l.on(`mouseout`,function(){l.call(E,s),d.call(w,s)})}),d.call(w,s),S?(D.w=Math.max(x.openWidth,x.headerWidth),D.h=C.y-D.t):(D.w=C.x-D.l,D.h=Math.max(x.openHeight,x.headerHeight)),D.direction=s.direction,a&&(d.size()?v(e,t,i,a,s,D):y(a))}function v(e,t,n,r,i,a){var o=i.direction,s=o===`up`||o===`down`,c=i._dims,l=i.active,d,f,p;if(s)for(f=0,p=0;p<l;p++)f+=c.heights[p]+u.gapButton;else for(d=0,p=0;p<l;p++)d+=c.widths[p]+u.gapButton;r.enable(a,d,f),r.hbar&&r.hbar.attr(`opacity`,`0`).transition().attr(`opacity`,`1`),r.vbar&&r.vbar.attr(`opacity`,`0`).transition().attr(`opacity`,`1`)}function y(e){var t=!!e.hbar,n=!!e.vbar;t&&e.hbar.transition().attr(`opacity`,`0`).each(`end`,function(){t=!1,n||e.disable()}),n&&e.vbar.transition().attr(`opacity`,`0`).each(`end`,function(){n=!1,t||e.disable()})}function b(e,t,n,r){e.call(x,t).call(C,t,n,r)}function x(e,t){o.ensureSingle(e,`rect`,u.itemRectClassName,function(e){e.attr({rx:u.rx,ry:u.ry,"shape-rendering":`crispEdges`})}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style(`stroke-width`,t.borderwidth+`px`)}function C(e,t,n,r){var i=o.ensureSingle(e,`text`,u.itemTextClassName,function(e){e.attr({"text-anchor":`start`,"data-notex":1})}),c=n.label,l=r._fullLayout._meta;l&&(c=o.templateString(c,l)),i.call(a.font,t.font).text(c).call(s.convertToTspans,r)}function w(e,t){var r=t.active;e.each(function(e,a){var o=n.select(this);a===r&&t.showactive&&o.select(`rect.`+u.itemRectClassName).call(i.fill,u.activeColor)})}function T(e){e.select(`rect.`+u.itemRectClassName).call(i.fill,u.hoverColor)}function E(e,t){e.select(`rect.`+u.itemRectClassName).call(i.fill,t.bgcolor)}function D(e,t){var i=t._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},c=a.tester.selectAll(`g.`+u.dropdownButtonClassName).data(o.filterVisible(t.buttons));c.enter().append(`g`).classed(u.dropdownButtonClassName,!0);var d=[`up`,`down`].indexOf(t.direction)!==-1;c.each(function(r,o){var c=n.select(this);c.call(b,t,r,e);var f=c.select(`.`+u.itemTextClassName),p=f.node()&&a.bBox(f.node()).width,m=Math.max(p+u.textPadX,u.minWidth),h=t.font.size*l,g=s.lineCount(f),_=Math.max(h*g,u.minHeight)+u.textOffsetY;_=Math.ceil(_),m=Math.ceil(m),i.widths[o]=m,i.heights[o]=_,i.height1=Math.max(i.height1,_),i.width1=Math.max(i.width1,m),d?(i.totalWidth=Math.max(i.totalWidth,m),i.openWidth=i.totalWidth,i.totalHeight+=_+u.gapButton,i.openHeight+=_+u.gapButton):(i.totalWidth+=m+u.gapButton,i.openWidth+=m+u.gapButton,i.totalHeight=Math.max(i.totalHeight,_),i.openHeight=i.totalHeight)}),d?i.totalHeight-=u.gapButton:i.totalWidth-=u.gapButton,i.headerWidth=i.width1+u.arrowPadX,i.headerHeight=i.height1,t.type===`dropdown`&&(d?(i.width1+=u.arrowPadX,i.totalHeight=i.height1):i.totalWidth=i.width1,i.totalWidth+=u.arrowPadX),c.remove();var f=i.totalWidth+t.pad.l+t.pad.r,p=i.totalHeight+t.pad.t+t.pad.b,m=e._fullLayout._size;i.lx=m.l+m.w*t.x,i.ly=m.t+m.h*(1-t.y);var h=`left`;o.isRightAnchor(t)&&(i.lx-=f,h=`right`),o.isCenterAnchor(t)&&(i.lx-=f/2,h=`center`);var g=`top`;o.isBottomAnchor(t)&&(i.ly-=p,g=`bottom`),o.isMiddleAnchor(t)&&(i.ly-=p/2,g=`middle`),i.totalWidth=Math.ceil(i.totalWidth),i.totalHeight=Math.ceil(i.totalHeight),i.lx=Math.round(i.lx),i.ly=Math.round(i.ly),r.autoMargin(e,O(t),{x:t.x,y:t.y,l:f*({right:1,center:.5}[h]||0),r:f*({left:1,center:.5}[h]||0),b:p*({top:1,middle:.5}[g]||0),t:p*({bottom:1,middle:.5}[g]||0)})}function O(e){return u.autoMarginIdRoot+e._index}function k(e,t,n,r){r||={};var i=e.select(`.`+u.itemRectClassName),o=e.select(`.`+u.itemTextClassName),c=t.borderwidth,d=n.index,f=t._dims;a.setTranslate(e,c+n.x,c+n.y);var p=[`up`,`down`].indexOf(t.direction)!==-1,m=r.height||(p?f.heights[d]:f.height1);i.attr({x:0,y:0,width:r.width||(p?f.width1:f.widths[d]),height:m});var h=t.font.size*l,g=(s.lineCount(o)-1)*h/2;s.positionText(o,u.textOffsetX,m/2-g+u.textOffsetY),p?n.y+=f.heights[d]+n.yPad:n.x+=f.widths[d]+n.xPad,n.index++}function A(e,t){e.attr(u.menuIndexAttrName,t||`-1`).selectAll(`g.`+u.dropdownButtonClassName).remove()}}),sa=h((e,t)=>{t.exports={moduleType:`component`,name:na().name,layoutAttributes:ra(),supplyLayoutDefaults:ia(),draw:oa()}}),ca=h((e,t)=>{t.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}}),la=h((e,t)=>{var n=B(),r=Ue(),i=z().extendDeepAll,a=Ie().overrideAll,o=Fe(),s=yt().templatedArray,c=ca();t.exports=a(s(`slider`,{visible:{valType:`boolean`,dflt:!0},active:{valType:`number`,min:0,dflt:0},steps:s(`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}}),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:i(r({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:o.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:n({})},font:n({}),activebgcolor:{valType:`color`,dflt:c.gripBgActiveColor},bgcolor:{valType:`color`,dflt:c.railBgColor},bordercolor:{valType:`color`,dflt:c.railBorderColor},borderwidth:{valType:`number`,min:0,dflt:c.railBorderWidth},ticklen:{valType:`number`,min:0,dflt:c.tickLength},tickcolor:{valType:`color`,dflt:c.tickColor},tickwidth:{valType:`number`,min:0,dflt:1},minorticklen:{valType:`number`,min:0,dflt:c.minorTickLength}}),`arraydraw`,`from-root`)}),ua=h((e,t)=>{var n=$(),r=Vt(),i=la(),a=ca().name,o=i.steps;t.exports=function(e,t){r(e,t,{name:a,handleItemDefaults:s})};function s(e,t,a){function o(r,a){return n.coerce(e,t,i,r,a)}for(var s=r(e,t,{name:`steps`,handleItemDefaults:c}),l=0,u=0;u<s.length;u++)s[u].visible&&l++;var d;if(d=l<2?t.visible=!1:o(`visible`),d){t._stepCount=l;var f=t._visibleSteps=n.filterVisible(s);(s[o(`active`)]||{}).visible||(t.active=f[0]._index),o(`x`),o(`y`),n.noneOrAll(e,t,[`x`,`y`]),o(`xanchor`),o(`yanchor`),o(`len`),o(`lenmode`),o(`pad.t`),o(`pad.r`),o(`pad.b`),o(`pad.l`),n.coerceFont(o,`font`,a.font),o(`currentvalue.visible`)&&(o(`currentvalue.xanchor`),o(`currentvalue.prefix`),o(`currentvalue.suffix`),o(`currentvalue.offset`),n.coerceFont(o,`currentvalue.font`,t.font)),o(`transition.duration`),o(`transition.easing`),o(`bgcolor`),o(`activebgcolor`),o(`bordercolor`),o(`borderwidth`),o(`ticklen`),o(`tickwidth`),o(`tickcolor`),o(`minorticklen`)}}function c(e,t){function r(r,i){return n.coerce(e,t,o,r,i)}(e.method!==`skip`&&!Array.isArray(e.args)?t.visible=!1:r(`visible`))&&(r(`method`),r(`args`),r(`value`,r(`label`,`step-`+t._index)),r(`execute`))}}),da=h((e,t)=>{var n=S(),r=Et(),i=q(),a=tn(),o=$(),s=o.strTranslate,c=kt(),l=yt().arrayEditor,u=ca(),d=Ot(),f=d.LINE_SPACING,p=d.FROM_TL,m=d.FROM_BR;t.exports=function(e){var t=e._context.staticPlot,i=e._fullLayout,a=g(i,e),o=i._infolayer.selectAll(`g.`+u.containerClassName).data(a.length>0?[0]:[]);o.enter().append(`g`).classed(u.containerClassName,!0).style(`cursor`,t?null:`ew-resize`);function s(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),r.autoMargin(e,h(t))}if(o.exit().each(function(){n.select(this).selectAll(`g.`+u.groupClassName).each(s)}).remove(),a.length!==0){var c=o.selectAll(`g.`+u.groupClassName).data(a,_);c.enter().append(`g`).classed(u.groupClassName,!0),c.exit().each(s).remove();for(var l=0;l<a.length;l++){var d=a[l];v(e,d)}c.each(function(t){var i=n.select(this);k(t),r.manageCommandObserver(e,t,t._visibleSteps,function(t){var n=i.data()[0];n.active!==t.index&&(n._dragging||E(e,i,n,t.index,!1,!0))}),y(e,n.select(this),t)})}};function h(e){return u.autoMarginIdRoot+e._index}function g(e,t){for(var n=e[u.name],r=[],i=0;i<n.length;i++){var a=n[i];a.visible&&(a._gd=t,r.push(a))}return r}function _(e){return e._index}function v(e,t){var i=a.tester.selectAll(`g.`+u.labelGroupClass).data(t._visibleSteps);i.enter().append(`g`).classed(u.labelGroupClass,!0);var s=0,l=0;i.each(function(e){var r=C(n.select(this),{step:e},t).node();if(r){var i=a.bBox(r);l=Math.max(l,i.height),s=Math.max(s,i.width)}}),i.remove();var d=t._dims={};d.inputAreaWidth=Math.max(u.railWidth,u.gripHeight);var f=e._fullLayout._size;d.lx=f.l+f.w*t.x,d.ly=f.t+f.h*(1-t.y),t.lenmode===`fraction`?d.outerLength=Math.round(f.w*t.len):d.outerLength=t.len,d.inputAreaStart=0,d.inputAreaLength=Math.round(d.outerLength-t.pad.l-t.pad.r);var g=(d.inputAreaLength-2*u.stepInset)/(t._stepCount-1),_=s+u.labelPadding;if(d.labelStride=Math.max(1,Math.ceil(_/g)),d.labelHeight=l,d.currentValueMaxWidth=0,d.currentValueHeight=0,d.currentValueTotalHeight=0,d.currentValueMaxLines=1,t.currentvalue.visible){var v=a.tester.append(`g`);i.each(function(e){var n=b(v,t,e.label),r=n.node()&&a.bBox(n.node())||{width:0,height:0},i=c.lineCount(n);d.currentValueMaxWidth=Math.max(d.currentValueMaxWidth,Math.ceil(r.width)),d.currentValueHeight=Math.max(d.currentValueHeight,Math.ceil(r.height)),d.currentValueMaxLines=Math.max(d.currentValueMaxLines,i)}),d.currentValueTotalHeight=d.currentValueHeight+t.currentvalue.offset,v.remove()}d.height=d.currentValueTotalHeight+u.tickOffset+t.ticklen+u.labelOffset+d.labelHeight+t.pad.t+t.pad.b;var y=`left`;o.isRightAnchor(t)&&(d.lx-=d.outerLength,y=`right`),o.isCenterAnchor(t)&&(d.lx-=d.outerLength/2,y=`center`);var x=`top`;o.isBottomAnchor(t)&&(d.ly-=d.height,x=`bottom`),o.isMiddleAnchor(t)&&(d.ly-=d.height/2,x=`middle`),d.outerLength=Math.ceil(d.outerLength),d.height=Math.ceil(d.height),d.lx=Math.round(d.lx),d.ly=Math.round(d.ly);var S={y:t.y,b:d.height*m[x],t:d.height*p[x]};t.lenmode===`fraction`?(S.l=0,S.xl=t.x-t.len*p[y],S.r=0,S.xr=t.x+t.len*m[y]):(S.x=t.x,S.l=d.outerLength*p[y],S.r=d.outerLength*m[y]),r.autoMargin(e,h(t),S)}function y(e,t,n){(n.steps[n.active]||{}).visible||(n.active=n._visibleSteps[0]._index),t.call(b,n).call(P,n).call(w,n).call(O,n).call(N,e,n).call(x,e,n);var r=n._dims;a.setTranslate(t,r.lx+n.pad.l,r.ly+n.pad.t),t.call(A,n,!1),t.call(b,n)}function b(e,t,n){if(t.currentvalue.visible){var r=t._dims,i,s;switch(t.currentvalue.xanchor){case`right`:i=r.inputAreaLength-u.currentValueInset-r.currentValueMaxWidth,s=`left`;break;case`center`:i=r.inputAreaLength*.5,s=`middle`;break;default:i=u.currentValueInset,s=`left`}var l=o.ensureSingle(e,`text`,u.labelClass,function(e){e.attr({"text-anchor":s,"data-notex":1})}),d=t.currentvalue.prefix?t.currentvalue.prefix:``;if(typeof n==`string`)d+=n;else{var p=t.steps[t.active].label,m=t._gd._fullLayout._meta;m&&(p=o.templateString(p,m)),d+=p}t.currentvalue.suffix&&(d+=t.currentvalue.suffix),l.call(a.font,t.currentvalue.font).text(d).call(c.convertToTspans,t._gd);var h=c.lineCount(l),g=(r.currentValueMaxLines+1-h)*t.currentvalue.font.size*f;return c.positionText(l,i,g),l}}function x(e,t,n){o.ensureSingle(e,`rect`,u.gripRectClass,function(r){r.call(D,t,e,n).style(`pointer-events`,`all`)}).attr({width:u.gripWidth,height:u.gripHeight,rx:u.gripRadius,ry:u.gripRadius}).call(i.stroke,n.bordercolor).call(i.fill,n.bgcolor).style(`stroke-width`,n.borderwidth+`px`)}function C(e,t,n){var r=o.ensureSingle(e,`text`,u.labelClass,function(e){e.attr({"text-anchor":`middle`,"data-notex":1})}),i=t.step.label,s=n._gd._fullLayout._meta;return s&&(i=o.templateString(i,s)),r.call(a.font,n.font).text(i).call(c.convertToTspans,n._gd),r}function w(e,t){var r=o.ensureSingle(e,`g`,u.labelsClass),i=t._dims,s=r.selectAll(`g.`+u.labelGroupClass).data(i.labelSteps);s.enter().append(`g`).classed(u.labelGroupClass,!0),s.exit().remove(),s.each(function(e){var r=n.select(this);r.call(C,e,t),a.setTranslate(r,j(t,e.fraction),u.tickOffset+t.ticklen+t.font.size*f+u.labelOffset+i.currentValueTotalHeight)})}function T(e,t,n,r,i){var a=Math.round(r*(n._stepCount-1)),o=n._visibleSteps[a]._index;o!==n.active&&E(e,t,n,o,!0,i)}function E(e,t,n,i,a,o){var s=n.active;n.active=i,l(e.layout,u.name,n).applyUpdate(`active`,i);var c=n.steps[n.active];t.call(A,n,o),t.call(b,n),e.emit(`plotly_sliderchange`,{slider:n,step:n.steps[n.active],interaction:a,previousActive:s}),c&&c.method&&a&&(t._nextMethod?(t._nextMethod.step=c,t._nextMethod.doCallback=a,t._nextMethod.doTransition=o):(t._nextMethod={step:c,doCallback:a,doTransition:o},t._nextMethodRaf=window.requestAnimationFrame(function(){var n=t._nextMethod.step;n.method&&(n.execute&&r.executeAPICommand(e,n.method,n.args),t._nextMethod=null,t._nextMethodRaf=null)})))}function D(e,t,r){if(t._context.staticPlot)return;var a=r.node(),o=n.select(t);function s(){return r.data()[0]}function c(){var e=s();t.emit(`plotly_sliderstart`,{slider:e});var c=r.select(`.`+u.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),c.call(i.fill,e.activebgcolor),T(t,r,e,M(e,n.mouse(a)[0]),!0),e._dragging=!0;function l(){var e=s();T(t,r,e,M(e,n.mouse(a)[0]),!1)}o.on(`mousemove`,l),o.on(`touchmove`,l);function d(){var e=s();e._dragging=!1,c.call(i.fill,e.bgcolor),o.on(`mouseup`,null),o.on(`mousemove`,null),o.on(`touchend`,null),o.on(`touchmove`,null),t.emit(`plotly_sliderend`,{slider:e,step:e.steps[e.active]})}o.on(`mouseup`,d),o.on(`touchend`,d)}e.on(`mousedown`,c),e.on(`touchstart`,c)}function O(e,t){var r=e.selectAll(`rect.`+u.tickRectClass).data(t._visibleSteps),o=t._dims;r.enter().append(`rect`).classed(u.tickRectClass,!0),r.exit().remove(),r.attr({width:t.tickwidth+`px`,"shape-rendering":`crispEdges`}),r.each(function(e,r){var s=r%o.labelStride===0,c=n.select(this);c.attr({height:s?t.ticklen:t.minorticklen}).call(i.fill,t.tickcolor),a.setTranslate(c,j(t,r/(t._stepCount-1))-.5*t.tickwidth,(s?u.tickOffset:u.minorTickOffset)+o.currentValueTotalHeight)})}function k(e){var t=e._dims;t.labelSteps=[];for(var n=e._stepCount,r=0;r<n;r+=t.labelStride)t.labelSteps.push({fraction:r/(n-1),step:e._visibleSteps[r]})}function A(e,t,n){for(var r=e.select(`rect.`+u.gripRectClass),i=0,a=0;a<t._stepCount;a++)if(t._visibleSteps[a]._index===t.active){i=a;break}var o=j(t,i/(t._stepCount-1));if(!t._invokingCommand){var c=r;n&&t.transition.duration>0&&(c=c.transition().duration(t.transition.duration).ease(t.transition.easing)),c.attr(`transform`,s(o-u.gripWidth*.5,t._dims.currentValueTotalHeight))}}function j(e,t){var n=e._dims;return n.inputAreaStart+u.stepInset+(n.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function M(e,t){var n=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-n.inputAreaStart)/(n.inputAreaLength-2*u.stepInset-2*n.inputAreaStart)))}function N(e,t,n){var r=n._dims,s=o.ensureSingle(e,`rect`,u.railTouchRectClass,function(r){r.call(D,t,e,n).style(`pointer-events`,`all`)});s.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,u.tickOffset+n.ticklen+r.labelHeight)}).call(i.fill,n.bgcolor).attr(`opacity`,0),a.setTranslate(s,0,r.currentValueTotalHeight)}function P(e,t){var n=t._dims,r=n.inputAreaLength-u.railInset*2,s=o.ensureSingle(e,`rect`,u.railRectClass);s.attr({width:r,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":`crispEdges`}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style(`stroke-width`,t.borderwidth+`px`),a.setTranslate(s,u.railInset,(n.inputAreaWidth-u.railWidth)*.5+n.currentValueTotalHeight)}}),fa=h((e,t)=>{t.exports={moduleType:`component`,name:ca().name,layoutAttributes:la(),supplyLayoutDefaults:ua(),draw:da()}}),pa=h((e,t)=>{var n=K();t.exports={bgcolor:{valType:`color`,dflt:n.background,editType:`plot`},bordercolor:{valType:`color`,dflt:n.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`}}),ma=h((e,t)=>{t.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`}}),ha=h((e,t)=>{t.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}}),ga=h(e=>{var t=xt(),n=kt(),r=ha(),i=Ot().LINE_SPACING,a=r.name;function o(e){var t=e&&e[a];return t&&t.visible}e.isVisible=o,e.makeData=function(e){for(var n=t.list({_fullLayout:e},`x`,!0),r=e.margin,i=[],s=0;s<n.length;s++){var c=n[s];if(o(c)){i.push(c);var l=c[a];l._id=a+c._id,l._height=(e.height-r.b-r.t)*l.thickness,l._offsetShift=Math.floor(l.borderwidth/2)}}e._rangeSliderData=i},e.autoMarginOpts=function(e,t){var o=e._fullLayout,s=t[a],c=t._id.charAt(0),l=0,u=0;if(t.side===`bottom`&&(l=t._depth,t.title.text!==o._dfltTitle[c])){u=1.5*t.title.font.size+10+s._offsetShift;var d=(t.title.text.match(n.BR_TAG_ALL)||[]).length;u+=d*t.title.font.size*i}return{x:0,y:t._counterDomainMin,l:0,r:0,t:0,b:s._height+l+Math.max(o.margin.b,u),pad:r.extraPad+s._offsetShift*2}}}),_a=h((e,t)=>{var n=$(),r=yt(),i=xt(),a=pa(),o=ma();t.exports=function(e,t,s){var c=e[s],l=t[s];if(!(c.rangeslider||t._requestRangeslider[l._id]))return;n.isPlainObject(c.rangeslider)||(c.rangeslider={});var u=c.rangeslider,d=r.newContainer(l,`rangeslider`);function f(e,t){return n.coerce(u,d,a,e,t)}var p,m;function h(e,t){return n.coerce(p,m,o,e,t)}if(f(`visible`)){f(`bgcolor`,t.plot_bgcolor),f(`bordercolor`),f(`borderwidth`),f(`thickness`),f(`autorange`,!l.isValidRange(u.range)),f(`range`);var g=t._subplots;if(g)for(var _=g.cartesian.filter(function(e){return e.slice(0,Math.max(0,e.indexOf(`y`)))===i.name2id(s)}).map(function(e){return e.slice(e.indexOf(`y`),e.length)}),v=n.simpleMap(_,i.id2name),y=0;y<v.length;y++){var b=v[y];p=u[b]||{},m=r.newContainer(d,b,`yaxis`);var x=t[b],S;p.range&&x.isValidRange(p.range)&&(S=`fixed`),h(`rangemode`,S)!==`match`&&h(`range`,x.range.slice())}d._input=u}}}),va=h((e,t)=>{var n=xt().list,r=on().getAutoRange,i=ha();t.exports=function(e){for(var t=n(e,`x`,!0),a=0;a<t.length;a++){var o=t[a],s=o[i.name];s&&s.visible&&s.autorange&&(s._input.autorange=!0,s._input.range=s.range=r(e,o))}}}),ya=h((e,t)=>{var n=S(),r=Ke(),i=Et(),a=$(),o=a.strTranslate,s=tn(),c=q(),l=nn(),u=Ai(),d=xt(),f=hn(),p=gn(),m=ha();t.exports=function(e){for(var t=e._fullLayout,r=t._rangeSliderData,i=0;i<r.length;i++){var s=r[i][m.name];s._clipId=s._id+`-`+t._uid}function c(e){return e._name}var u=t._infolayer.selectAll(`g.`+m.containerClassName).data(r,c);u.exit().each(function(e){var n=e[m.name];t._topdefs.select(`#`+n._clipId).remove()}).remove(),r.length!==0&&(u.enter().append(`g`).classed(m.containerClassName,!0).attr(`pointer-events`,`all`),u.each(function(r){var i=n.select(this),s=r[m.name],c=t[d.id2name(r.anchor)],u=s[d.id2name(r.anchor)];if(s.range){var f=a.simpleMap(s.range,r.r2l),p=a.simpleMap(r.range,r.r2l),h=p[0]<p[1]?[Math.min(f[0],p[0]),Math.max(f[1],p[1])]:[Math.max(f[0],p[0]),Math.min(f[1],p[1])];s.range=s._input.range=a.simpleMap(h,r.l2r)}r.cleanRange(`rangeslider.range`);var _=t._size,S=r.domain;s._width=_.w*(S[1]-S[0]);var C=Math.round(_.l+_.w*S[0]),D=Math.round(_.t+_.h*(1-r._counterDomainMin)+(r.side===`bottom`?r._depth:0)+s._offsetShift+m.extraPad);i.attr(`transform`,o(C,D)),s._rl=a.simpleMap(s.range,r.r2l);var O=s._rl[0],k=s._rl[1],A=k-O;if(s.p2d=function(e){return e/s._width*A+O},s.d2p=function(e){return(e-O)/A*s._width},r.rangebreaks){var j=r.locateBreaks(O,k);if(j.length){var M,N,P=0;for(M=0;M<j.length;M++)N=j[M],P+=N.max-N.min;var F=s._width/(k-O-P),I=[-F*O];for(M=0;M<j.length;M++)N=j[M],I.push(I[I.length-1]-F*(N.max-N.min));for(s.d2p=function(e){for(var t=I[0],n=0;n<j.length;n++){var r=j[n];if(e>=r.max)t=I[n+1];else if(e<r.min)break}return t+F*e},M=0;M<j.length;M++)N=j[M],N.pmin=s.d2p(N.min),N.pmax=s.d2p(N.max);s.p2d=function(e){for(var t=I[0],n=0;n<j.length;n++){var r=j[n];if(e>=r.pmax)t=I[n+1];else if(e<r.pmin)break}return(e-t)/F}}}if(u.rangemode!==`match`){var L=c.r2l(u.range[0]),R=c.r2l(u.range[1])-L;s.d2pOppAxis=function(e){return(e-L)/R*s._height}}i.call(y,e,r,s).call(b,e,r,s).call(x,e,r,s).call(w,e,r,s,u).call(T,e,r,s).call(E,e,r,s),g(i,e,r,s),v(i,e,r,s,c,u),r.side===`bottom`&&l.draw(e,r._id+`title`,{propContainer:r,propName:r._name+`.title.text`,placeholder:t._dfltTitle.x,attributes:{x:r._offset+r._length/2,y:D+s._height+s._offsetShift+10+1.5*r.title.font.size,"text-anchor":`middle`}})}))};function h(e){return typeof e.clientX==`number`?e.clientX:e.touches&&e.touches.length>0?e.touches[0].clientX:0}function g(e,t,r,i){if(t._context.staticPlot)return;var o=e.select(`rect.`+m.slideBoxClassName).node(),s=e.select(`rect.`+m.grabAreaMinClassName).node(),c=e.select(`rect.`+m.grabAreaMaxClassName).node();function l(){var l=n.event,u=l.target,d=h(l),m=d-e.node().getBoundingClientRect().left,g=i.d2p(r._rl[0]),v=i.d2p(r._rl[1]),y=f.coverSlip();this.addEventListener(`touchmove`,b),this.addEventListener(`touchend`,x),y.addEventListener(`mousemove`,b),y.addEventListener(`mouseup`,x);function b(a){var l=+h(a)-d,f,b,x;switch(u){case o:if(x=`ew-resize`,g+l>r._length||v+l<0)return;f=g+l,b=v+l;break;case s:if(x=`col-resize`,g+l>r._length)return;f=g+l,b=v;break;case c:if(x=`col-resize`,v+l<0)return;f=g,b=v+l;break;default:x=`ew-resize`,f=m,b=m+l;break}if(b<f){var S=b;b=f,f=S}i._pixelMin=f,i._pixelMax=b,p(n.select(y),x),_(e,t,r,i)}function x(){y.removeEventListener(`mousemove`,b),y.removeEventListener(`mouseup`,x),this.removeEventListener(`touchmove`,b),this.removeEventListener(`touchend`,x),a.removeElement(y)}}e.on(`mousedown`,l),e.on(`touchstart`,l)}function _(e,t,n,i){function o(e){return n.l2r(a.constrain(e,i._rl[0],i._rl[1]))}var s=o(i.p2d(i._pixelMin)),c=o(i.p2d(i._pixelMax));window.requestAnimationFrame(function(){r.call(`_guiRelayout`,t,n._name+`.range`,[s,c])})}function v(e,t,n,r,i,s){var c=m.handleWidth/2;function l(e){return a.constrain(e,0,r._width)}function u(e){return a.constrain(e,0,r._height)}function d(e){return a.constrain(e,-c,r._width+c)}var f=l(r.d2p(n._rl[0])),p=l(r.d2p(n._rl[1]));if(e.select(`rect.`+m.slideBoxClassName).attr(`x`,f).attr(`width`,p-f),e.select(`rect.`+m.maskMinClassName).attr(`width`,f),e.select(`rect.`+m.maskMaxClassName).attr(`x`,p).attr(`width`,r._width-p),s.rangemode!==`match`){var h=r._height-u(r.d2pOppAxis(i._rl[1])),g=r._height-u(r.d2pOppAxis(i._rl[0]));e.select(`rect.`+m.maskMinOppAxisClassName).attr(`x`,f).attr(`height`,h).attr(`width`,p-f),e.select(`rect.`+m.maskMaxOppAxisClassName).attr(`x`,f).attr(`y`,g).attr(`height`,r._height-g).attr(`width`,p-f),e.select(`rect.`+m.slideBoxClassName).attr(`y`,h).attr(`height`,g-h)}var _=.5,v=Math.round(d(f-c))-_,y=Math.round(d(p-c))+_;e.select(`g.`+m.grabberMinClassName).attr(`transform`,o(v,_)),e.select(`g.`+m.grabberMaxClassName).attr(`transform`,o(y,_))}function y(e,t,n,r){var i=a.ensureSingle(e,`rect`,m.bgClassName,function(e){e.attr({x:0,y:0,"shape-rendering":`crispEdges`})}),l=r.borderwidth%2==0?r.borderwidth:r.borderwidth-1,u=-r._offsetShift,d=s.crispRound(t,r.borderwidth);i.attr({width:r._width+l,height:r._height+l,transform:o(u,u),"stroke-width":d}).call(c.stroke,r.bordercolor).call(c.fill,r.bgcolor)}function b(e,t,n,r){var i=t._fullLayout;a.ensureSingleById(i._topdefs,`clipPath`,r._clipId,function(e){e.append(`rect`).attr({x:0,y:0})}).select(`rect`).attr({width:r._width,height:r._height})}function x(e,t,r,o){var c=t.calcdata,l=e.selectAll(`g.`+m.rangePlotClassName).data(r._subplotsWith,a.identity);l.enter().append(`g`).attr(`class`,function(e){return m.rangePlotClassName+` `+e}).call(s.setClipUrl,o._clipId,t),l.order(),l.exit().remove();var f;l.each(function(e,a){var s=n.select(this),l=a===0,p=d.getFromId(t,e,`y`),m=p._name,h=o[m],g={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:o.range.slice(),calendar:r.calendar},width:o._width,height:o._height,margin:{t:0,b:0,l:0,r:0}},_context:t._context};r.rangebreaks&&(g.layout.xaxis.rangebreaks=r.rangebreaks),g.layout[m]={type:p.type,domain:[0,1],range:h.rangemode===`match`?p.range.slice():h.range.slice(),calendar:p.calendar},p.rangebreaks&&(g.layout[m].rangebreaks=p.rangebreaks),i.supplyDefaults(g);var _=g._fullLayout.xaxis,v=g._fullLayout[m];_.clearCalc(),_.setScale(),v.clearCalc(),v.setScale();var y={id:e,plotgroup:s,xaxis:_,yaxis:v,isRangePlot:!0};l?f=y:(y.mainplot=`xy`,y.mainplotinfo=f),u.rangePlot(t,y,C(c,e))})}function C(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=i[0].trace;a.xaxis+a.yaxis===t&&n.push(i)}return n}function w(e,t,n,r,i){a.ensureSingle(e,`rect`,m.maskMinClassName,function(e){e.attr({x:0,y:0,"shape-rendering":`crispEdges`})}).attr(`height`,r._height).call(c.fill,m.maskColor),a.ensureSingle(e,`rect`,m.maskMaxClassName,function(e){e.attr({y:0,"shape-rendering":`crispEdges`})}).attr(`height`,r._height).call(c.fill,m.maskColor),i.rangemode!==`match`&&(a.ensureSingle(e,`rect`,m.maskMinOppAxisClassName,function(e){e.attr({y:0,"shape-rendering":`crispEdges`})}).attr(`width`,r._width).call(c.fill,m.maskOppAxisColor),a.ensureSingle(e,`rect`,m.maskMaxOppAxisClassName,function(e){e.attr({y:0,"shape-rendering":`crispEdges`})}).attr(`width`,r._width).style(`border-top`,m.maskOppBorder).call(c.fill,m.maskOppAxisColor))}function T(e,t,n,r){t._context.staticPlot||a.ensureSingle(e,`rect`,m.slideBoxClassName,function(e){e.attr({y:0,cursor:m.slideBoxCursor,"shape-rendering":`crispEdges`})}).attr({height:r._height,fill:m.slideBoxFill})}function E(e,t,n,r){var i=a.ensureSingle(e,`g`,m.grabberMinClassName),o=a.ensureSingle(e,`g`,m.grabberMaxClassName),s={x:0,width:m.handleWidth,rx:m.handleRadius,fill:c.background,stroke:c.defaultLine,"stroke-width":m.handleStrokeWidth,"shape-rendering":`crispEdges`},l={y:Math.round(r._height/4),height:Math.round(r._height/2)};a.ensureSingle(i,`rect`,m.handleMinClassName,function(e){e.attr(s)}).attr(l),a.ensureSingle(o,`rect`,m.handleMaxClassName,function(e){e.attr(s)}).attr(l);var u={width:m.grabAreaWidth,x:0,y:0,fill:m.grabAreaFill,cursor:t._context.staticPlot?void 0:m.grabAreaCursor};a.ensureSingle(i,`rect`,m.grabAreaMinClassName,function(e){e.attr(u)}).attr(`height`,r._height),a.ensureSingle(o,`rect`,m.grabAreaMaxClassName,function(e){e.attr(u)}).attr(`height`,r._height)}}),ba=h((e,t)=>{var n=$(),r=pa(),i=ma(),a=ga();t.exports={moduleType:`component`,name:`rangeslider`,schema:{subplots:{xaxis:{rangeslider:n.extendFlat({},r,{yaxis:i})}}},layoutAttributes:pa(),handleDefaults:_a(),calcAutorange:va(),draw:ya(),isVisible:a.isVisible,makeData:a.makeData,autoMarginOpts:a.autoMarginOpts}}),xa=h((e,t)=>{var n=B(),r=K(),i=yt().templatedArray;t.exports={visible:{valType:`boolean`,editType:`plot`},buttons:i(`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`}),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:n({editType:`plot`}),bgcolor:{valType:`color`,dflt:r.lightLine,editType:`plot`},activecolor:{valType:`color`,editType:`plot`},bordercolor:{valType:`color`,dflt:r.defaultLine,editType:`plot`},borderwidth:{valType:`number`,min:0,dflt:0,editType:`plot`},editType:`plot`}}),Sa=h((e,t)=>{t.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}),Ca=h((e,t)=>{var n=$(),r=q(),i=yt(),a=Vt(),o=xa(),s=Sa();t.exports=function(e,t,u,d,f){var p=e.rangeselector||{},m=i.newContainer(t,`rangeselector`);function h(e,t){return n.coerce(p,m,o,e,t)}if(h(`visible`,a(p,m,{name:`buttons`,handleItemDefaults:c,calendar:f}).length>0)){var g=l(t,u,d);h(`x`,g[0]),h(`y`,g[1]),n.noneOrAll(e,t,[`x`,`y`]),h(`xanchor`),h(`yanchor`),n.coerceFont(h,`font`,u.font);var _=h(`bgcolor`);h(`activecolor`,r.contrast(_,s.lightAmount,s.darkAmount)),h(`bordercolor`),h(`borderwidth`)}};function c(e,t,r,i){var a=i.calendar;function s(r,i){return n.coerce(e,t,o.buttons,r,i)}if(s(`visible`)){var c=s(`step`);c!==`all`&&(a&&a!==`gregorian`&&(c===`month`||c===`year`)?t.stepmode=`backward`:s(`stepmode`),s(`count`)),s(`label`)}}function l(e,t,n){for(var r=n.filter(function(n){return t[n].anchor===e._id}),i=0,a=0;a<r.length;a++){var o=t[r[a]].domain;o&&(i=Math.max(o[1],i))}return[e.domain[0],i+s.yPad]}}),wa=h((e,t)=>{var n=C(),r=$().titleCase;t.exports=function(e,t){var n=e._name,r={};if(t.step===`all`)r[n+`.autorange`]=!0;else{var a=i(e,t);r[n+`.range[0]`]=a[0],r[n+`.range[1]`]=a[1]}return r};function i(e,t){var i=e.range,a=new Date(e.r2l(i[1])),o=t.step,s=n[`utc`+r(o)],c=t.count,l;switch(t.stepmode){case`backward`:l=e.l2r(+s.offset(a,-c));break;case`todate`:var u=s.offset(a,-c);l=e.l2r(+s.ceil(u));break}var d=i[1];return[l,d]}}),Ta=h((e,t)=>{var n=S(),r=Ke(),i=Et(),a=q(),o=tn(),s=$(),c=s.strTranslate,l=kt(),u=xt(),d=Ot(),f=d.LINE_SPACING,p=d.FROM_TL,m=d.FROM_BR,h=Sa(),g=wa();t.exports=function(e){var t=e._fullLayout._infolayer.selectAll(`.rangeselector`).data(_(e),v);t.enter().append(`g`).classed(`rangeselector`,!0),t.exit().remove(),t.style({cursor:`pointer`,"pointer-events":`all`}),t.each(function(t){var i=n.select(this),a=t,o=a.rangeselector,c=i.selectAll(`g.button`).data(s.filterVisible(o.buttons));c.enter().append(`g`).classed(`button`,!0),c.exit().remove(),c.each(function(t){var i=n.select(this),s=g(a,t);t._isActive=y(a,t,s),i.call(b,o,t),i.call(C,o,t,e),i.on(`click`,function(){e._dragged||r.call(`_guiRelayout`,e,s)}),i.on(`mouseover`,function(){t._isHovered=!0,i.call(b,o,t)}),i.on(`mouseout`,function(){t._isHovered=!1,i.call(b,o,t)})}),T(e,c,o,a._name,i)})};function _(e){for(var t=u.list(e,`x`,!0),n=[],r=0;r<t.length;r++){var i=t[r];i.rangeselector&&i.rangeselector.visible&&n.push(i)}return n}function v(e){return e._id}function y(e,t,n){if(t.step===`all`)return e.autorange===!0;var r=Object.keys(n);return e.range[0]===n[r[0]]&&e.range[1]===n[r[1]]}function b(e,t,n){var r=s.ensureSingle(e,`rect`,`selector-rect`,function(e){e.attr(`shape-rendering`,`crispEdges`)});r.attr({rx:h.rx,ry:h.ry}),r.call(a.stroke,t.bordercolor).call(a.fill,x(t,n)).style(`stroke-width`,t.borderwidth+`px`)}function x(e,t){return t._isActive||t._isHovered?e.activecolor:e.bgcolor}function C(e,t,n,r){function i(e){l.convertToTspans(e,r)}s.ensureSingle(e,`text`,`selector-text`,function(e){e.attr(`text-anchor`,`middle`)}).call(o.font,t.font).text(w(n,r._fullLayout._meta)).call(i)}function w(e,t){return e.label?t?s.templateString(e.label,t):e.label:e.step===`all`?`all`:e.count+e.step.charAt(0)}function T(e,t,r,a,u){var d=0,g=0,_=r.borderwidth;t.each(function(){var e=n.select(this).select(`.selector-text`),t=r.font.size*f,i=Math.max(t*l.lineCount(e),16)+3;g=Math.max(g,i)}),t.each(function(){var e=n.select(this),t=e.select(`.selector-rect`),i=e.select(`.selector-text`),a=i.node()&&o.bBox(i.node()).width,s=r.font.size*f,u=l.lineCount(i),p=Math.max(a+10,h.minButtonWidth);e.attr(`transform`,c(_+d,_)),t.attr({x:0,y:0,width:p,height:g}),l.positionText(i,p/2,g/2-(u-1)*s/2+3),d+=p+5});var v=e._fullLayout._size,y=v.l+v.w*r.x,b=v.t+v.h*(1-r.y),x=`left`;s.isRightAnchor(r)&&(y-=d,x=`right`),s.isCenterAnchor(r)&&(y-=d/2,x=`center`);var S=`top`;s.isBottomAnchor(r)&&(b-=g,S=`bottom`),s.isMiddleAnchor(r)&&(b-=g/2,S=`middle`),d=Math.ceil(d),g=Math.ceil(g),y=Math.round(y),b=Math.round(b),i.autoMargin(e,a+`-range-selector`,{x:r.x,y:r.y,l:d*p[x],r:d*m[x],b:g*m[S],t:g*p[S]}),u.attr(`transform`,c(y,b))}}),Ea=h((e,t)=>{t.exports={moduleType:`component`,name:`rangeselector`,schema:{subplots:{xaxis:{rangeselector:xa()}}},layoutAttributes:xa(),handleDefaults:Ca(),draw:Ta()}}),Da=h(e=>{var t=z().extendFlat;e.attributes=function(e,n){e||={},n||={};var r={valType:`info_array`,editType:e.editType,items:[{valType:`number`,min:0,max:1,editType:e.editType},{valType:`number`,min:0,max:1,editType:e.editType}],dflt:[0,1]};e.name&&e.name+``,e.trace,n.description&&``+n.description;var i={x:t({},r,{}),y:t({},r,{}),editType:e.editType};return e.noGridCell||(i.row={valType:`integer`,min:0,dflt:0,editType:e.editType},i.column={valType:`integer`,min:0,dflt:0,editType:e.editType}),i},e.defaults=function(e,t,n,r){var i=r&&r.x||[0,1],a=r&&r.y||[0,1],o=t.grid;if(o){var s=n(`domain.column`);s!==void 0&&(s<o.columns?i=o._domains.x[s]:delete e.domain.column);var c=n(`domain.row`);c!==void 0&&(c<o.rows?a=o._domains.y[c]:delete e.domain.row)}var l=n(`domain.x`,i),u=n(`domain.y`,a);l[0]<l[1]||(e.domain.x=i.slice()),u[0]<u[1]||(e.domain.y=a.slice())}}),Oa=h((e,t)=>{var n=$(),r=Y().counter,i=Da().attributes,a=bt().idRegex,o=yt(),s={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:[r(`xy`).toString(),``],editType:`plot`},editType:`plot`},xaxes:{valType:`info_array`,freeLength:!0,items:{valType:`enumerated`,values:[a.x.toString(),``],editType:`plot`},editType:`plot`},yaxes:{valType:`info_array`,freeLength:!0,items:{valType:`enumerated`,values:[a.y.toString(),``],editType:`plot`},editType:`plot`},pattern:{valType:`enumerated`,values:[`independent`,`coupled`],dflt:`coupled`,editType:`plot`},xgap:{valType:`number`,min:0,max:1,editType:`plot`},ygap:{valType:`number`,min:0,max:1,editType:`plot`},domain:i({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 c(e,t,n){var r=t[n+`axes`],i=Object.keys((e._splomAxes||{})[n]||{});if(Array.isArray(r))return r;if(i.length)return i}function l(e,t){var r=e.grid||{},i=c(t,r,`x`),a=c(t,r,`y`);if(!e.grid&&!i&&!a)return;var l=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),d=Array.isArray(i),f=Array.isArray(a),p=d&&i!==r.xaxes&&f&&a!==r.yaxes,m,h;l?(m=r.subplots.length,h=r.subplots[0].length):(f&&(m=a.length),d&&(h=i.length));var g=o.newContainer(t,`grid`);function _(e,t){return n.coerce(r,g,s,e,t)}var v=_(`rows`,m),y=_(`columns`,h);if(!(v*y>1)){delete t.grid;return}!l&&!d&&!f&&_(`pattern`)===`independent`&&(l=!0),g._hasSubplotGrid=l;var b=_(`roworder`)===`top to bottom`,x=l?.2:.1,S=l?.3:.1,C,w;p&&t._splomGridDflt&&(C=t._splomGridDflt.xside,w=t._splomGridDflt.yside),g._domains={x:u(`x`,_,x,C,y),y:u(`y`,_,S,w,v,b)}}function u(e,t,n,r,i,a){var o=t(e+`gap`,n),s=t(`domain.`+e);t(e+`side`,r);for(var c=Array(i),l=s[0],u=(s[1]-l)/(i-o),d=u*(1-o),f=0;f<i;f++){var p=l+u*f;c[a?i-1-f:f]=[p,p+d]}return c}function d(e,t){var n=t.grid;if(!(!n||!n._domains)){var r=e.grid||{},i=t._subplots,a=n._hasSubplotGrid,o=n.rows,s=n.columns,l=n.pattern===`independent`,u,d,p,m,h,g,_,v=n._axisMap={};if(a){var y=r.subplots||[];g=n.subplots=Array(o);var b=1;for(u=0;u<o;u++){var x=g[u]=Array(s),S=y[u]||[];for(d=0;d<s;d++)if(l?(h=b===1?`xy`:`x`+b+`y`+b,b++):h=S[d],x[d]=``,i.cartesian.indexOf(h)!==-1){if(_=h.indexOf(`y`),p=h.slice(0,_),m=h.slice(_),v[p]!==void 0&&v[p]!==d||v[m]!==void 0&&v[m]!==u)continue;x[d]=h,v[p]=d,v[m]=u}}}else{var C=c(t,r,`x`),w=c(t,r,`y`);n.xaxes=f(C,i.xaxis,s,v,`x`),n.yaxes=f(w,i.yaxis,o,v,`y`)}var T=n._anchors={},E=n.roworder===`top to bottom`;for(var D in v){var O=D.charAt(0),k=n[O+`side`],A,j,M;if(k.length<8)T[D]=`free`;else if(O===`x`){if(k.charAt(0)===`t`===E?(A=0,j=1,M=o):(A=o-1,j=-1,M=-1),a){var N=v[D];for(u=A;u!==M;u+=j)if(h=g[u][N],h&&(_=h.indexOf(`y`),h.slice(0,_)===D)){T[D]=h.slice(_);break}}else for(u=A;u!==M;u+=j)if(m=n.yaxes[u],i.cartesian.indexOf(D+m)!==-1){T[D]=m;break}}else if(k.charAt(0)===`l`?(A=0,j=1,M=s):(A=s-1,j=-1,M=-1),a){var P=v[D];for(u=A;u!==M;u+=j)if(h=g[P][u],h&&(_=h.indexOf(`y`),h.slice(_)===D)){T[D]=h.slice(0,_);break}}else for(u=A;u!==M;u+=j)if(p=n.xaxes[u],i.cartesian.indexOf(p+D)!==-1){T[D]=p;break}}}}function f(e,t,n,r,i){var a=Array(n),o;function s(e,n){t.indexOf(n)!==-1&&r[n]===void 0?(a[e]=n,r[n]=e):a[e]=``}if(Array.isArray(e))for(o=0;o<n;o++)s(o,e[o]);else for(s(0,i),o=1;o<n;o++)s(o,i+(o+1));return a}t.exports={moduleType:`component`,name:`grid`,schema:{layout:{grid:s}},layoutAttributes:s,sizeDefaults:l,contentDefaults:d}}),ka=h((e,t)=>{t.exports={visible:{valType:`boolean`,editType:`calc`},type:{valType:`enumerated`,values:[`percent`,`constant`,`sqrt`,`data`],editType:`calc`},symmetric:{valType:`boolean`,editType:`calc`},array:{valType:`data_array`,editType:`calc`},arrayminus:{valType:`data_array`,editType:`calc`},value:{valType:`number`,min:0,dflt:10,editType:`calc`},valueminus:{valType:`number`,min:0,dflt:10,editType:`calc`},traceref:{valType:`integer`,min:0,dflt:0,editType:`style`},tracerefminus:{valType:`integer`,min:0,dflt:0,editType:`style`},copy_ystyle:{valType:`boolean`,editType:`plot`},copy_zstyle:{valType:`boolean`,editType:`style`},color:{valType:`color`,editType:`style`},thickness:{valType:`number`,min:0,dflt:2,editType:`style`},width:{valType:`number`,min:0,editType:`plot`},editType:`calc`}}),Aa=h((e,t)=>{var n=D(),r=Ke(),i=$(),a=yt(),o=ka();t.exports=function(e,t,s,c){var l=`error_`+c.axis,u=a.newContainer(t,l),d=e[l]||{};function f(e,t){return i.coerce(d,u,o,e,t)}if(f(`visible`,d.array!==void 0||d.value!==void 0||d.type===`sqrt`)!==!1){var p=f(`type`,`array`in d?`data`:`percent`),m=!0;p!==`sqrt`&&(m=f(`symmetric`,!((p===`data`?`arrayminus`:`valueminus`)in d))),p===`data`?(f(`array`),f(`traceref`),m||(f(`arrayminus`),f(`tracerefminus`))):(p===`percent`||p===`constant`)&&(f(`value`),m||f(`valueminus`));var h=`copy_`+c.inherit+`style`;c.inherit&&(t[`error_`+c.inherit]||{}).visible&&f(h,!(d.color||n(d.thickness)||n(d.width))),(!c.inherit||!u[h])&&(f(`color`,s),f(`thickness`),f(`width`,r.traceIs(t,`gl3d`)?0:4))}}}),ja=h((e,t)=>{t.exports=function(e){var t=e.type,r=e.symmetric;if(t===`data`){var i=e.array||[];if(r)return function(e,t){var n=+i[t];return[n,n]};var a=e.arrayminus||[];return function(e,t){var n=+i[t],r=+a[t];return!isNaN(n)||!isNaN(r)?[r||0,n||0]:[NaN,NaN]}}else{var o=n(t,e.value),s=n(t,e.valueminus);return r||e.valueminus===void 0?function(e){var t=o(e);return[t,t]}:function(e){return[s(e),o(e)]}}};function n(e,t){if(e===`percent`)return function(e){return Math.abs(e*t/100)};if(e===`constant`)return function(){return Math.abs(t)};if(e===`sqrt`)return function(e){return Math.sqrt(Math.abs(e))}}}),Ma=h((e,t)=>{var n=D(),r=Ke(),i=sn(),a=$(),o=ja();t.exports=function(e){for(var t=e.calcdata,n=0;n<t.length;n++){var a=t[n],o=a[0].trace;if(o.visible===!0&&r.traceIs(o,`errorBarsOK`)){var c=i.getFromId(e,o.xaxis),l=i.getFromId(e,o.yaxis);s(a,o,c,`x`),s(a,o,l,`y`)}}};function s(e,t,r,s){var c=t[`error_`+s]||{},l=c.visible&&[`linear`,`log`].indexOf(r.type)!==-1,u=[];if(l){for(var d=o(c),f=0;f<e.length;f++){var p=e[f],m=p.i;if(m===void 0)m=f;else if(m===null)continue;var h=p[s];if(n(r.c2l(h))){var g=d(h,m);if(n(g[0])&&n(g[1])){var _=p[s+`s`]=h-g[0],v=p[s+`h`]=h+g[1];u.push(_,v)}}}var y=r._id,b=t._extremes[y],x=i.findExtremes(r,u,a.extendFlat({tozero:b.opts.tozero},{padded:!0}));b.min=b.min.concat(x.min),b.max=b.max.concat(x.max)}}}),Na=h((e,t)=>{var n=S(),r=D(),i=tn(),a=Xt();t.exports=function(e,t,s,c){var l,u=s.xaxis,d=s.yaxis,f=c&&c.duration>0,p=e._context.staticPlot;t.each(function(t){var m=t[0].trace,h=m.error_x||{},g=m.error_y||{},_;m.ids&&(_=function(e){return e.id});var v=a.hasMarkers(m)&&m.marker.maxdisplayed>0;!g.visible&&!h.visible&&(t=[]);var y=n.select(this).selectAll(`g.errorbar`).data(t,_);if(y.exit().remove(),t.length){h.visible||y.selectAll(`path.xerror`).remove(),g.visible||y.selectAll(`path.yerror`).remove(),y.style(`opacity`,1);var b=y.enter().append(`g`).classed(`errorbar`,!0);f&&b.style(`opacity`,0).transition().duration(c.duration).style(`opacity`,1),i.setClipUrl(y,s.layerClipId,e),y.each(function(e){var t=n.select(this),i=o(e,u,d);if(!(v&&!e.vis)){var a,s=t.select(`path.yerror`);if(g.visible&&r(i.x)&&r(i.yh)&&r(i.ys)){var m=g.width;a=`M`+(i.x-m)+`,`+i.yh+`h`+2*m+`m-`+m+`,0V`+i.ys,i.noYS||(a+=`m-`+m+`,0h`+2*m),l=!s.size(),l?s=t.append(`path`).style(`vector-effect`,p?`none`:`non-scaling-stroke`).classed(`yerror`,!0):f&&(s=s.transition().duration(c.duration).ease(c.easing)),s.attr(`d`,a)}else s.remove();var _=t.select(`path.xerror`);if(h.visible&&r(i.y)&&r(i.xh)&&r(i.xs)){var y=(h.copy_ystyle?g:h).width;a=`M`+i.xh+`,`+(i.y-y)+`v`+2*y+`m0,-`+y+`H`+i.xs,i.noXS||(a+=`m0,-`+y+`v`+2*y),l=!_.size(),l?_=t.append(`path`).style(`vector-effect`,p?`none`:`non-scaling-stroke`).classed(`xerror`,!0):f&&(_=_.transition().duration(c.duration).ease(c.easing)),_.attr(`d`,a)}else _.remove()}})}})};function o(e,t,n){var i={x:t.c2p(e.x),y:n.c2p(e.y)};return e.yh!==void 0&&(i.yh=n.c2p(e.yh),i.ys=n.c2p(e.ys),r(i.ys)||(i.noYS=!0,i.ys=n.c2p(e.ys,!0))),e.xh!==void 0&&(i.xh=t.c2p(e.xh),i.xs=t.c2p(e.xs),r(i.xs)||(i.noXS=!0,i.xs=t.c2p(e.xs,!0))),i}}),Pa=h((e,t)=>{var n=S(),r=q();t.exports=function(e){e.each(function(e){var t=e[0].trace,i=t.error_y||{},a=t.error_x||{},o=n.select(this);o.selectAll(`path.yerror`).style(`stroke-width`,i.thickness+`px`).call(r.stroke,i.color),a.copy_ystyle&&(a=i),o.selectAll(`path.xerror`).style(`stroke-width`,a.thickness+`px`).call(r.stroke,a.color)})}}),Fa=h((e,t)=>{var n=$(),r=Ie().overrideAll,i=ka(),a={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i)};delete a.error_x.copy_zstyle,delete a.error_y.copy_zstyle,delete a.error_y.copy_ystyle;var o={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i),error_z:n.extendFlat({},i)};delete o.error_x.copy_ystyle,delete o.error_y.copy_ystyle,delete o.error_z.copy_ystyle,delete o.error_z.copy_zstyle,t.exports={moduleType:`component`,name:`errorbars`,schema:{traces:{scatter:a,bar:a,histogram:a,scatter3d:r(o,`calc`,`nested`),scattergl:r(a,`calc`,`nested`)}},supplyDefaults:Aa(),calc:Ma(),makeComputeError:ja(),plot:Na(),style:Pa(),hoverInfo:s};function s(e,t,n){(t.error_y||{}).visible&&(n.yerr=e.yh-e.y,t.error_y.symmetric||(n.yerrneg=e.y-e.ys)),(t.error_x||{}).visible&&(n.xerr=e.xh-e.x,t.error_x.symmetric||(n.xerrneg=e.x-e.xs))}}),Ia=h((e,t)=>{t.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`}}}),La=h((e,t)=>{var n=S(),r=R(),i=Et(),a=Ke(),o=sn(),s=hn(),c=$(),l=c.strTranslate,u=z().extendFlat,d=gn(),f=tn(),p=q(),m=nn(),h=kt(),g=At().flipScale,_=Ei(),v=Di(),y=Mt(),b=Ot(),x=b.LINE_SPACING,C=b.FROM_TL,w=b.FROM_BR,T=Ia().cn;function E(e){var t=e._fullLayout._infolayer.selectAll(`g.`+T.colorbar).data(D(e),function(e){return e._id});t.enter().append(`g`).attr(`class`,function(e){return e._id}).classed(T.colorbar,!0),t.each(function(t){var r=n.select(this);c.ensureSingle(r,`rect`,T.cbbg),c.ensureSingle(r,`g`,T.cbfills),c.ensureSingle(r,`g`,T.cblines),c.ensureSingle(r,`g`,T.cbaxis,function(e){e.classed(T.crisp,!0)}),c.ensureSingle(r,`g`,T.cbtitleunshift,function(e){e.append(`g`).classed(T.cbtitle,!0)}),c.ensureSingle(r,`rect`,T.cboutline);var i=O(r,t,e);i&&i.then&&(e._promises||[]).push(i),e._context.edits.colorbarPosition&&k(r,t,e)}),t.exit().each(function(t){i.autoMargin(e,t._id)}).remove(),t.order()}function D(e){var t=e._fullLayout,n=e.calcdata,r=[],i,a,o,s;function c(e){return u(e,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function l(){typeof s.calc==`function`?s.calc(e,o,i):(i._fillgradient=a.reversescale?g(a.colorscale):a.colorscale,i._zrange=[a[s.min],a[s.max]])}for(var d=0;d<n.length;d++)if(o=n[d][0].trace,o._module){var f=o._module.colorbar;if(o.visible===!0&&f)for(var p=Array.isArray(f),m=p?f:[f],h=0;h<m.length;h++){s=m[h];var _=s.container;a=_?o[_]:o,a&&a.showscale&&(i=c(a.colorbar),i._id=`cb`+o.uid+(p&&_?`-`+_:``),i._traceIndex=o.index,i._propPrefix=(_?_+`.`:``)+`colorbar.`,i._meta=o._meta,l(),r.push(i))}}for(var v in t._colorAxes)if(a=t[v],a.showscale){var y=t._colorAxes[v];i=c(a.colorbar),i._id=`cb`+v,i._propPrefix=v+`.colorbar.`,i._meta=t._meta,s={min:`cmin`,max:`cmax`},y[0]!==`heatmap`&&(o=y[1],s.calc=o._module.colorbar.calc),l(),r.push(i)}return r}function O(e,t,a){var s=t.orientation===`v`,d=t.len,g=t.lenmode,_=t.thickness,v=t.thicknessmode,y=t.outlinewidth,b=t.borderwidth,S=t.bgcolor,E=t.xanchor,D=t.yanchor,O=t.xpad,k=t.ypad,M=t.x,N=s?t.y:1-t.y,P=t.yref===`paper`,F=t.xref===`paper`,I=a._fullLayout,L=I._size,R=t._fillcolor,z=t._line,B=t.title,V=B.side,H=t._zrange||n.extent((typeof R==`function`?R:z.color).domain()),U=typeof z.color==`function`?z.color:function(){return z.color},W=typeof R==`function`?R:function(){return R},G=t._levels,K=A(a,t,H),q=K.fill,J=K.line,Y=Math.round(_*(v===`fraction`?s?L.w:L.h:1)),X=Y/(s?L.w:L.h),Z=Math.round(d*(g===`fraction`?s?L.h:L.w:1)),Q=Z/(s?L.h:L.w),ee=F?L.w:a._fullLayout.width,te=P?L.h:a._fullLayout.height,ne=Math.round(s?M*ee+O:N*te+k),re={center:.5,right:1}[E]||0,ie={top:1,middle:.5}[D]||0,ae=s?M-re*X:N-ie*X,oe=s?N-ie*Q:M-re*Q,se=Math.round(s?te*(1-oe):ee*oe);t._lenFrac=Q,t._thickFrac=X,t._uFrac=ae,t._vFrac=oe;var ce=t._axis=j(a,t,H);ce.position=X+(s?M+O/L.w:N+k/L.h);var le=[`top`,`bottom`].indexOf(V)!==-1;if(s&&le&&(ce.title.side=V,ce.titlex=M+O/L.w,ce.titley=oe+(B.side===`top`?Q-k/L.h:k/L.h)),!s&&!le&&(ce.title.side=V,ce.titley=N+k/L.h,ce.titlex=oe+O/L.w),z.color&&t.tickmode===`auto`){ce.tickmode=`linear`,ce.tick0=G.start;var ue=G.size,de=c.constrain(Z/50,4,15)+1,fe=(H[1]-H[0])/((t.nticks||de)*ue);if(fe>1){var pe=10**Math.floor(Math.log(fe)/Math.LN10);ue*=pe*c.roundUp(fe/pe,[2,5,10]),(Math.abs(G.start)/G.size+1e-6)%1<2e-6&&(ce.tick0=0)}ce.dtick=ue}ce.domain=s?[oe+k/L.h,oe+Q-k/L.h]:[oe+O/L.w,oe+Q-O/L.w],ce.setScale(),e.attr(`transform`,l(Math.round(L.l),Math.round(L.t)));var me=e.select(`.`+T.cbtitleunshift).attr(`transform`,l(-Math.round(L.l),-Math.round(L.t))),he=ce.ticklabelposition,ge=ce.title.font.size,_e=e.select(`.`+T.cbaxis),ve,ye=0,be=0;function xe(n,r){var i={propContainer:ce,propName:t._propPrefix+`title.text`,traceIndex:t._traceIndex,_meta:t._meta,placeholder:I._dfltTitle.colorbar,containerGroup:e.select(`.`+T.cbtitle)},o=n.charAt(0)===`h`?n.slice(1):`h`+n;e.selectAll(`.`+o+`,.`+o+`-math-group`).remove(),m.draw(a,n,u(i,r||{}))}function Se(){if(s&&le||!s&&!le){var e,t;V===`top`&&(e=O+L.l+ee*M,t=k+L.t+te*(1-oe-Q)+3+ge*.75),V===`bottom`&&(e=O+L.l+ee*M,t=k+L.t+te*(1-oe)-3-ge*.25),V===`right`&&(t=k+L.t+te*N+3+ge*.75,e=O+L.l+ee*oe),xe(ce._id+`title`,{attributes:{x:e,y:t,"text-anchor":s?`start`:`middle`}})}}function Ce(){if(s&&!le||!s&&le){var e=ce.position||0,r=ce._offset+ce._length/2,i,o;if(V===`right`)o=r,i=L.l+ee*e+10+ge*(ce.showticklabels?1:.5);else if(i=r,V===`bottom`&&(o=L.t+te*e+10+(he.indexOf(`inside`)===-1?ce.tickfont.size:0)+(ce.ticks!==`inside`&&t.ticklen||0)),V===`top`){var c=B.text.split(`<br>`).length;o=L.t+te*e+10-Y-x*ge*c}xe((s?`h`:`v`)+ce._id+`title`,{avoid:{selection:n.select(a).selectAll(`g.`+ce._id+`tick`),side:V,offsetTop:s?0:L.t,offsetLeft:s?L.l:0,maxShift:s?I.width:I.height},attributes:{x:i,y:o,"text-anchor":`middle`},transform:{rotate:s?-90:0,offset:0}})}}function we(){if(!s&&!le||s&&le){var i=e.select(`.`+T.cbtitle),u=i.select(`text`),d=[-y/2,y/2],p=i.select(`.h`+ce._id+`title-math-group`).node(),m=15.6;u.node()&&(m=parseInt(u.node().style.fontSize,10)*x);var g;if(p?(g=f.bBox(p),be=g.width,ye=g.height,ye>m&&(d[1]-=(ye-m)/2)):u.node()&&!u.classed(T.jsPlaceholder)&&(g=f.bBox(u.node()),be=g.width,ye=g.height),s){if(ye){if(ye+=5,V===`top`)ce.domain[1]-=ye/L.h,d[1]*=-1;else{ce.domain[0]+=ye/L.h;var _=h.lineCount(u);d[1]+=(1-_)*m}i.attr(`transform`,l(d[0],d[1])),ce.setScale()}}else be&&(V===`right`&&(ce.domain[0]+=(be+ge/2)/L.w),i.attr(`transform`,l(d[0],d[1])),ce.setScale())}e.selectAll(`.`+T.cbfills+`,.`+T.cblines).attr(`transform`,s?l(0,Math.round(L.h*(1-ce.domain[1]))):l(Math.round(L.w*ce.domain[0]),0)),_e.attr(`transform`,s?l(0,Math.round(-L.t)):l(Math.round(-L.l),0));var v=e.select(`.`+T.cbfills).selectAll(`rect.`+T.cbfill).attr(`style`,``).data(q);v.enter().append(`rect`).classed(T.cbfill,!0).attr(`style`,``),v.exit().remove();var b=H.map(ce.c2p).map(Math.round).sort(function(e,t){return e-t});v.each(function(e,i){var o=[i===0?H[0]:(q[i]+q[i-1])/2,i===q.length-1?H[1]:(q[i]+q[i+1])/2].map(ce.c2p).map(Math.round);s&&(o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,b[0],b[1]));var l=n.select(this).attr(s?`x`:`y`,ne).attr(s?`y`:`x`,n.min(o)).attr(s?`width`:`height`,Math.max(Y,2)).attr(s?`height`:`width`,Math.max(n.max(o)-n.min(o),2));if(t._fillgradient)f.gradient(l,a,t._id,s?`vertical`:`horizontalreversed`,t._fillgradient,`fill`);else{var u=W(e).replace(`e-`,``);l.attr(`fill`,r(u).toHexString())}});var S=e.select(`.`+T.cblines).selectAll(`path.`+T.cbline).data(z.color&&z.width?J:[]);S.enter().append(`path`).classed(T.cbline,!0),S.exit().remove(),S.each(function(e){var t=ne,r=Math.round(ce.c2p(e))+z.width/2%1;n.select(this).attr(`d`,`M`+(s?t+`,`+r:r+`,`+t)+(s?`h`:`v`)+Y).call(f.lineGroupStyle,z.width,U(e),z.dash)}),_e.selectAll(`g.`+ce._id+`tick,path`).remove();var C=ne+Y+(y||0)/2-(t.ticks===`outside`?1:0),w=o.calcTicks(ce),E=o.getTickSigns(ce)[2];return o.drawTicks(a,ce,{vals:ce.ticks===`inside`?o.clipEnds(ce,w):w,layer:_e,path:o.makeTickPath(ce,C,E),transFn:o.makeTransTickFn(ce)}),o.drawLabels(a,ce,{vals:w,layer:_e,transFn:o.makeTransTickLabelFn(ce),labelFns:o.makeLabelFns(ce,C)})}function Te(){var n,o=Y+y/2;he.indexOf(`inside`)===-1&&(n=f.bBox(_e.node()),o+=s?n.width:n.height),ve=me.select(`text`);var c=0,u=s&&V===`top`,m=!s&&V===`right`,h=0;if(ve.node()&&!ve.classed(T.jsPlaceholder)){var x,A=me.select(`.h`+ce._id+`title-math-group`).node();A&&(s&&le||!s&&!le)?(n=f.bBox(A),c=n.width,x=n.height):(n=f.bBox(me.node()),c=n.right-L.l-(s?ne:se),x=n.bottom-L.t-(s?se:ne),!s&&V===`top`&&(o+=n.height,h=n.height)),m&&(ve.attr(`transform`,l(c/2+ge/2,0)),c*=2),o=Math.max(o,s?c:x)}var j=(s?O:k)*2+o+b+y/2,R=0;!s&&B.text&&D===`bottom`&&N<=0&&(R=j/2,j+=R,h+=R),I._hColorbarMoveTitle=R,I._hColorbarMoveCBTitle=h;var z=b+y,H=(s?ne:se)-z/2-(s?O:0),U=(s?se:ne)-(s?Z:k+h-R);e.select(`.`+T.cbbg).attr(`x`,H).attr(`y`,U).attr(s?`width`:`height`,Math.max(j-R,2)).attr(s?`height`:`width`,Math.max(Z+z,2)).call(p.fill,S).call(p.stroke,t.bordercolor).style(`stroke-width`,b);var W=m?Math.max(c-10,0):0;e.selectAll(`.`+T.cboutline).attr(`x`,(s?ne:se+O)+W).attr(`y`,(s?se+k-Z:ne)+(u?ye:0)).attr(s?`width`:`height`,Math.max(Y,2)).attr(s?`height`:`width`,Math.max(Z-(s?2*k+ye:2*O+W),2)).call(p.stroke,t.outlinecolor).style({fill:`none`,"stroke-width":y});var G=s?re*j:0,K=s?0:(1-ie)*j-h;if(G=F?L.l-G:-G,K=P?L.t-K:-K,e.attr(`transform`,l(G,K)),!s&&(b||r(S).getAlpha()&&!r.equals(I.paper_bgcolor,S))){var q=_e.selectAll(`text`),J=q[0].length,X=e.select(`.`+T.cbbg).node(),Q=f.bBox(X),ee=f.getTranslate(e),te=2;q.each(function(e,t){var n=0,r=J-1;if(t===n||t===r){var i=f.bBox(this),a=f.getTranslate(this),o;if(t===r){var s=i.right+a.x;o=Q.right+ee.x+se-b-te+M-s,o>0&&(o=0)}else if(t===n){var c=i.left+a.x;o=Q.left+ee.x+se+b+te-c,o<0&&(o=0)}o&&(J<3?this.setAttribute(`transform`,`translate(`+o+`,0) `+this.getAttribute(`transform`)):this.setAttribute(`visibility`,`hidden`))}})}var ae={},oe=C[E],ue=w[E],de=C[D],fe=w[D],pe=j-Y;s?(g===`pixels`?(ae.y=N,ae.t=Z*de,ae.b=Z*fe):(ae.t=ae.b=0,ae.yt=N+d*de,ae.yb=N-d*fe),v===`pixels`?(ae.x=M,ae.l=j*oe,ae.r=j*ue):(ae.l=pe*oe,ae.r=pe*ue,ae.xl=M-_*oe,ae.xr=M+_*ue)):(g===`pixels`?(ae.x=M,ae.l=Z*oe,ae.r=Z*ue):(ae.l=ae.r=0,ae.xl=M+d*oe,ae.xr=M-d*ue),v===`pixels`?(ae.y=1-N,ae.t=j*de,ae.b=j*fe):(ae.t=pe*de,ae.b=pe*fe,ae.yt=N-_*de,ae.yb=N+_*fe));var be=t.y<.5?`b`:`t`,xe=t.x<.5?`l`:`r`;a._fullLayout._reservedMargin[t._id]={};var Se={r:I.width-H-G,l:H+ae.r,b:I.height-U-K,t:U+ae.b};F&&P?i.autoMargin(a,t._id,ae):F?a._fullLayout._reservedMargin[t._id][be]=Se[be]:P||s?a._fullLayout._reservedMargin[t._id][xe]=Se[xe]:a._fullLayout._reservedMargin[t._id][be]=Se[be]}return c.syncOrAsync([i.previousPromises,Se,we,Ce,i.previousPromises,Te],a)}function k(e,t,n){var r=t.orientation===`v`,i=n._fullLayout._size,o,c,u;s.init({element:e.node(),gd:n,prepFn:function(){o=e.attr(`transform`),d(e)},moveFn:function(n,a){e.attr(`transform`,o+l(n,a)),c=s.align((r?t._uFrac:t._vFrac)+n/i.w,r?t._thickFrac:t._lenFrac,0,1,t.xanchor),u=s.align((r?t._vFrac:1-t._uFrac)-a/i.h,r?t._lenFrac:t._thickFrac,0,1,t.yanchor),d(e,s.getCursor(c,u,t.xanchor,t.yanchor))},doneFn:function(){if(d(e),c!==void 0&&u!==void 0){var r={};r[t._propPrefix+`x`]=c,r[t._propPrefix+`y`]=u,t._traceIndex===void 0?a.call(`_guiRelayout`,n,r):a.call(`_guiRestyle`,n,r,t._traceIndex)}}})}function A(e,t,n){var r=t._levels,i=[],a=[],o,s,c=r.end+r.size/100,l=r.size,u=1.001*n[0]-.001*n[1],d=1.001*n[1]-.001*n[0];for(s=0;s<1e5&&(o=r.start+s*l,!(l>0?o>=c:o<=c));s++)o>u&&o<d&&i.push(o);if(t._fillgradient)a=[0];else if(typeof t._fillcolor==`function`){var f=t._filllevels;if(f)for(c=f.end+f.size/100,l=f.size,s=0;s<1e5&&(o=f.start+s*l,!(l>0?o>=c:o<=c));s++)o>n[0]&&o<n[1]&&a.push(o);else a=i.map(function(e){return e-r.size/2}),a.push(a[a.length-1]+r.size)}else t._fillcolor&&typeof t._fillcolor==`string`&&(a=[0]);return r.size<0&&(i.reverse(),a.reverse()),{line:i,fill:a}}function j(e,t,n){var r=e._fullLayout,i=t.orientation===`v`,a={type:`linear`,range:n,tickmode:t.tickmode,nticks:t.nticks,tick0:t.tick0,dtick:t.dtick,tickvals:t.tickvals,ticktext:t.ticktext,ticks:t.ticks,ticklen:t.ticklen,tickwidth:t.tickwidth,tickcolor:t.tickcolor,showticklabels:t.showticklabels,labelalias:t.labelalias,ticklabelposition:t.ticklabelposition,ticklabeloverflow:t.ticklabeloverflow,ticklabelstep:t.ticklabelstep,tickfont:t.tickfont,tickangle:t.tickangle,tickformat:t.tickformat,exponentformat:t.exponentformat,minexponent:t.minexponent,separatethousands:t.separatethousands,showexponent:t.showexponent,showtickprefix:t.showtickprefix,tickprefix:t.tickprefix,showticksuffix:t.showticksuffix,ticksuffix:t.ticksuffix,title:t.title,showline:!0,anchor:`free`,side:i?`right`:`bottom`,position:1},o=i?`y`:`x`,s={type:`linear`,_id:o+t._id},l={letter:o,font:r.font,noAutotickangles:o===`y`,noHover:!0,noTickson:!0,noTicklabelmode:!0,noInsideRange:!0,calendar:r.calendar};function u(e,t){return c.coerce(a,s,y,e,t)}return _(a,s,u,l,r),v(a,s,u,l),s}t.exports={draw:E}}),Ra=h((e,t)=>{t.exports={moduleType:`component`,name:`colorbar`,attributes:Nt(),supplyDefaults:Wt(),draw:La().draw,hasColorbar:It()}}),za=h((e,t)=>{t.exports={moduleType:`component`,name:`legend`,layoutAttributes:vn(),supplyLayoutDefaults:bn(),draw:On(),style:Dn()}}),Ba=h((e,t)=>{t.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`}}}),Va=h((e,t)=>{t.exports={moduleType:`locale`,name:`en-US`,dictionary:{"Click to enter Colorscale title":`Click to enter Colorscale title`},format:{date:`%m/%d/%Y`}}}),Ha=h((e,t)=>{var n=Ke(),r=$(),i=r.extendFlat,a=r.extendDeep;function o(e){var t;switch(e){case`themes__thumb`:t={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`:t={title:{text:``},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:``,margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:t={}}return t}function s(e){return[`xaxis`,`yaxis`,`zaxis`].indexOf(e.slice(0,5))>-1}t.exports=function(e,t){var r,c=e.data,l=e.layout,u=a([],c),d=a({},l,o(t.tileClass)),f=e._context||{};if(t.width&&(d.width=t.width),t.height&&(d.height=t.height),t.tileClass===`thumbnail`||t.tileClass===`themes__thumb`){d.annotations=[];var p=Object.keys(d);for(r=0;r<p.length;r++)s(p[r])&&(d[p[r]].title={text:``});for(r=0;r<u.length;r++){var m=u[r];m.showscale=!1,m.marker&&(m.marker.showscale=!1),n.traceIs(m,`pie-like`)&&(m.textposition=`none`)}}if(Array.isArray(t.annotations))for(r=0;r<t.annotations.length;r++)d.annotations.push(t.annotations[r]);var h=Object.keys(d).filter(function(e){return e.match(/^scene\d*$/)});if(h.length){var g={};for(t.tileClass===`thumbnail`&&(g={title:{text:``},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<h.length;r++){var _=d[h[r]];_.xaxis||={},_.yaxis||={},_.zaxis||={},i(_.xaxis,g),i(_.yaxis,g),i(_.zaxis,g),_._scene=null}}var v=document.createElement(`div`);t.tileClass&&(v.className=t.tileClass);var y={gd:v,td:v,layout:d,data:u,config:{staticPlot:t.staticPlot===void 0?!0:t.staticPlot,plotGlPixelRatio:t.plotGlPixelRatio===void 0?2:t.plotGlPixelRatio,displaylogo:t.displaylogo||!1,showLink:t.showLink||!1,showTips:t.showTips||!1,mapboxAccessToken:f.mapboxAccessToken}};return t.setBackground!==`transparent`&&(y.config.setBackground=t.setBackground||`opaque`),y.gd.defaultLayout=o(t.tileClass),y}}),Ua=h((e,t)=>{var n=mt().EventEmitter,r=Ke(),i=$(),a=Lr(),o=Ha(),s=Rr(),c=zr();function l(e,t){var l=new n,u=o(e,{format:`png`}),d=u.gd;d.style.position=`absolute`,d.style.left=`-5000px`,document.body.appendChild(d);function f(){var e=a.getDelay(d._fullLayout);setTimeout(function(){var e=s(d),n=document.createElement(`canvas`);n.id=i.randstr(),l=c({format:t.format,width:d._fullLayout.width,height:d._fullLayout.height,canvas:n,emitter:l,svg:e}),l.clean=function(){d&&document.body.removeChild(d)}},e)}var p=a.getRedrawFunc(d);return r.call(`_doPlot`,d,u.data,u.layout,u.config).then(p).then(f).catch(function(e){l.emit(`error`,e)}),l}t.exports=l}),Wa=h((e,t)=>{var n=Lr();t.exports={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:Ha(),toSVG:Rr(),svgToImg:zr(),toImage:Ua(),downloadImage:Ur()}}),Ga=h(e=>{e.version=b().version,x(),dt();var t=e.register=Ke().register,n=Gr(),r=Object.keys(n);for(a=0;a<r.length;a++)i=r[a],i.charAt(0)!==`_`&&(e[i]=n[i]),t({moduleType:`apiMethod`,name:i,fn:n[i]});var i,a;t(ji()),t([zi(),Gi(),Ar(),Xi(),ta(),sa(),fa(),ba(),Ea(),Oa(),Fa(),Yt(),Ra(),za(),Ln(),rr()]),t([Ba(),Va()]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(t(window.PlotlyLocales),delete window.PlotlyLocales),e.Icons=Bn();var o=Ln(),s=Et();e.Plots={resize:s.resize,graphJson:s.graphJson,sendDataToCloud:s.sendDataToCloud},e.Fx={hover:o.hover,unhover:o.unhover,loneHover:o.loneHover,loneUnhover:o.loneUnhover},e.Snapshot=Wa(),e.PlotSchema=vt()}),Ka=h((e,t)=>{t.exports=Ga()}),qa=h((e,t)=>{var n=Tr(),r=jt().axisHoverFormat,{hovertemplateAttrs:i,texttemplateAttrs:a,templatefallbackAttrs:o}=ze(),s=Pt(),c=B(),l=ui(),u=Le().pattern,d=z().extendFlat,f=c({editType:`calc`,arrayOk:!0,colorEditType:`style`}),p=n.marker.line,m=d({line:d({width:d({},p.width,{dflt:0}),editType:`calc`},s(`marker.line`)),editType:`calc`},s(`marker`),{opacity:{valType:`number`,arrayOk:!0,dflt:1,min:0,max:1,editType:`style`},pattern:u,cornerradius:{valType:`any`,editType:`calc`}});t.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:r(`x`),yhoverformat:r(`y`),text:n.text,texttemplate:a({editType:`plot`},{keys:l.eventDataKeys}),texttemplatefallback:o({editType:`plot`}),hovertext:n.hovertext,hovertemplate:i({},{keys:l.eventDataKeys}),hovertemplatefallback:o(),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:d({},f,{}),insidetextfont:d({},f,{}),outsidetextfont:d({},f,{}),constraintext:{valType:`enumerated`,values:[`inside`,`outside`,`both`,`none`],dflt:`both`,editType:`calc`},cliponaxis:d({},n.cliponaxis,{}),orientation:{valType:`enumerated`,values:[`v`,`h`],editType:`calc+clearAxisTypes`},base:{valType:`any`,dflt:null,arrayOk:!0,editType:`calc`},offset:{valType:`number`,dflt:null,arrayOk:!0,editType:`calc`},width:{valType:`number`,dflt:null,min:0,arrayOk:!0,editType:`calc`},marker:m,offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:{marker:{opacity:n.selected.marker.opacity,color:n.selected.marker.color,editType:`style`},textfont:n.selected.textfont,editType:`style`},unselected:{marker:{opacity:n.unselected.marker.opacity,color:n.unselected.marker.color,editType:`style`},textfont:n.unselected.textfont,editType:`style`},zorder:n.zorder}}),Ja=h((e,t)=>{t.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`}}}),Ya=h((e,t)=>{var n=q(),r=At().hasColorscale,i=Gt(),a=$().coercePattern;t.exports=function(e,t,o,s,c){var l=o(`marker.color`,s),u=r(e,`marker`);u&&i(e,t,c,o,{prefix:`marker.`,cLetter:`c`}),o(`marker.line.color`,n.defaultLine),r(e,`marker.line`)&&i(e,t,c,o,{prefix:`marker.line.`,cLetter:`c`}),o(`marker.line.width`),o(`marker.opacity`),a(o,`marker.pattern`,l,u),o(`selected.marker.color`),o(`unselected.marker.color`)}}),Xa=h((e,t)=>{var n=D(),r=$(),i=q(),a=Ke(),o=Kr(),s=qr(),c=Ya(),l=ti(),u=qa(),d=r.coerceFont;function f(e,t,n,l){function d(n,i){return r.coerce(e,t,u,n,i)}if(!o(e,t,l,d)){t.visible=!1;return}s(e,t,l,d),d(`xhoverformat`),d(`yhoverformat`),d(`zorder`),d(`orientation`,t.x&&!t.y?`h`:`v`),d(`base`),d(`offset`),d(`width`),d(`text`),d(`hovertext`),d(`hovertemplate`),d(`hovertemplatefallback`),h(e,t,l,d,d(`textposition`),{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),c(e,t,d,n,l);var f=(t.marker.line||{}).color,p=a.getComponentMethod(`errorbars`,`supplyDefaults`);p(e,t,f||i.defaultLine,{axis:`y`}),p(e,t,f||i.defaultLine,{axis:`x`,inherit:`y`}),r.coerceSelectionMarkerOpacity(t,d)}function p(e,t){var n,i;function a(e,t){return r.coerce(i._input,i,u,e,t)}for(var o=0;o<e.length;o++)if(i=e[o],i.type===`bar`){n=i._input;var s=a(`marker.cornerradius`,t.barcornerradius);i.marker&&(i.marker.cornerradius=m(s)),l(n,i,t,a,t.barmode)}}function m(e){if(n(e)){if(e=+e,e>=0)return e}else if(typeof e==`string`&&(e=e.trim(),e.slice(-1)===`%`&&n(e.slice(0,-1))&&(e=+e.slice(0,-1),e>=0)))return e+`%`}function h(e,t,n,i,a,o){o||={};var s=o.moduleHasSelected!==!1,c=o.moduleHasUnselected!==!1,l=o.moduleHasConstrain!==!1,u=o.moduleHasCliponaxis!==!1,f=o.moduleHasTextangle!==!1,p=o.moduleHasInsideanchor!==!1,m=!!o.hasPathbar,h=Array.isArray(a)||a===`auto`,g=h||a===`inside`,_=h||a===`outside`;if(g||_){var v=d(i,`textfont`,n.font),y=r.extendFlat({},v),b=!(e.textfont&&e.textfont.color);if(b&&delete y.color,d(i,`insidetextfont`,y),m){var x=r.extendFlat({},v);b&&delete x.color,d(i,`pathbar.textfont`,x)}_&&d(i,`outsidetextfont`,v),s&&i(`selected.textfont.color`),c&&i(`unselected.textfont.color`),l&&i(`constraintext`),u&&i(`cliponaxis`),f&&i(`textangle`),i(`texttemplate`),i(`texttemplatefallback`)}g&&p&&i(`insidetextanchor`)}t.exports={supplyDefaults:f,crossTraceDefaults:p,handleText:h,validateCornerradius:m}}),Za=h((e,t)=>{var n=Ke(),r=sn(),i=$(),a=Ja(),o=Xa().validateCornerradius;t.exports=function(e,t,s){function c(n,r){return i.coerce(e,t,a,n,r)}for(var l=!1,u=!1,d=!1,f={},p=c(`barmode`),m=p===`group`,h=0;h<s.length;h++){var g=s[h];if(n.traceIs(g,`bar`)&&g.visible)l=!0;else continue;var _=g.xaxis+g.yaxis;m?(f[_]&&(d=!0),f[_]=!0):(_+=g._input.offsetgroup,f.length>0&&!f[_]&&(d=!0),f[_]=!0),g.visible&&g.type===`histogram`&&r.getFromId({_fullLayout:t},g[g.orientation===`v`?`xaxis`:`yaxis`]).type!==`category`&&(u=!0)}if(!l){delete t.barmode;return}p!==`overlay`&&c(`barnorm`),c(`bargap`,u&&!d?0:.2),c(`bargroupgap`),t.barcornerradius=o(c(`barcornerradius`))}}),Qa=h((e,t)=>{var n=$();t.exports=function(e,t){for(var r=0;r<e.length;r++)e[r].i=r;n.mergeArray(t.text,e,`tx`),n.mergeArray(t.hovertext,e,`htx`);var i=t.marker;if(i){n.mergeArray(i.opacity,e,`mo`,!0),n.mergeArray(i.color,e,`mc`);var a=i.line;a&&(n.mergeArray(a.color,e,`mlc`),n.mergeArrayCastPositive(a.width,e,`mlw`))}}}),$a=h((e,t)=>{var n=sn(),r=ii(),i=At().hasColorscale,a=Jt(),o=Qa(),s=si();t.exports=function(e,t){var c=n.getFromId(e,t.xaxis||`x`),l=n.getFromId(e,t.yaxis||`y`),u,d,f,p,m,h,g={msUTC:!!(t.base||t.base===0)};t.orientation===`h`?(u=c.makeCalcdata(t,`x`,g),f=l.makeCalcdata(t,`y`),p=r(t,l,`y`,f),m=!!t.yperiodalignment,h=`y`):(u=l.makeCalcdata(t,`y`,g),f=c.makeCalcdata(t,`x`),p=r(t,c,`x`,f),m=!!t.xperiodalignment,h=`x`),d=p.vals;for(var _=Math.min(d.length,u.length),v=Array(_),y=0;y<_;y++)v[y]={p:d[y],s:u[y]},m&&(v[y].orig_p=f[y],v[y][h+`End`]=p.ends[y],v[y][h+`Start`]=p.starts[y]),t.ids&&(v[y].id=String(t.ids[y]));return i(t,`marker`)&&a(e,t,{vals:t.marker.color,containerStr:`marker`,cLetter:`c`}),i(t,`marker.line`)&&a(e,t,{vals:t.marker.line.color,containerStr:`marker.line`,cLetter:`c`}),o(v,t),s(v,t),v}}),eo=h((e,t)=>{var n=S(),r=$();function i(e,t,i){var a=e._fullLayout,o=a[`_`+i+`Text_minsize`];if(o){var s=a.uniformtext.mode===`hide`,c;switch(i){case`funnelarea`:case`pie`:case`sunburst`:c=`g.slice`;break;case`treemap`:case`icicle`:c=`g.slice, g.pathbar`;break;default:c=`g.points > g.point`}t.selectAll(c).each(function(e){var t=e.transform;if(t){t.scale=s&&t.hide?0:o/t.fontSize;var i=n.select(this).select(`text`);r.setTransormAndDisplay(i,t)}})}}function a(e,t,n){if(n.uniformtext.mode){var r=s(e),i=n.uniformtext.minsize,a=t.scale*t.fontSize;t.hide=a<i,n[r]=n[r]||1/0,t.hide||(n[r]=Math.min(n[r],Math.max(a,i)))}}function o(e,t){var n=s(e);t[n]=void 0}function s(e){return`_`+e+`Text_minsize`}t.exports={recordMinTextSize:a,clearMinTextSize:o,resizeText:i}}),to=h(e=>{var t=D(),n=R(),r=$().isArrayOrTypedArray;e.coerceString=function(e,t,n){if(typeof t==`string`){if(t||!e.noBlank)return t}else if((typeof t==`number`||t===!0)&&!e.strict)return String(t);return n===void 0?e.dflt:n},e.coerceNumber=function(e,n,r){if(t(n)){n=+n;var i=e.min,a=e.max;if(!(i!==void 0&&n<i||a!==void 0&&n>a))return n}return r===void 0?e.dflt:r},e.coerceColor=function(e,t,r){return n(t).isValid()?t:r===void 0?e.dflt:r},e.coerceEnumerated=function(e,t,n){return e.coerceNumber&&(t=+t),e.values.indexOf(t)===-1?n===void 0?e.dflt:n:t},e.getValue=function(e,t){var n;return r(e)?t<e.length&&(n=e[t]):n=e,n},e.getLineWidth=function(e,t){return 0<t.mlw?t.mlw:r(e.marker.line.width)?0:e.marker.line.width}}),no=h((e,t)=>{var n=S(),r=q(),i=tn(),a=$(),o=Ke(),s=eo().resizeText,c=qa(),l=c.textfont,u=c.insidetextfont,d=c.outsidetextfont,f=to();function p(e){var t=n.select(e).selectAll(`g[class^="barlayer"]`).selectAll(`g.trace`);s(e,t,`bar`);var r=t.size(),i=e._fullLayout;t.style(`opacity`,function(e){return e[0].trace.opacity}).each(function(e){(i.barmode===`stack`&&r>1||i.bargap===0&&i.bargroupgap===0&&!e[0].trace.marker.line.width)&&n.select(this).attr(`shape-rendering`,`crispEdges`)}),t.selectAll(`g.points`).each(function(t){var r=n.select(this),i=t[0].trace;m(r,i,e)}),o.getComponentMethod(`errorbars`,`style`)(t)}function m(e,t,n){i.pointStyle(e.selectAll(`path`),t,n),h(e,t,n)}function h(e,t,r){e.selectAll(`text`).each(function(e){var o=n.select(this),s=a.ensureUniformFontSize(r,y(o,e,t,r));i.font(o,s)})}function g(e,t,n){var r=t[0].trace;r.selectedpoints?_(n,r,e):(m(n,r,e),o.getComponentMethod(`errorbars`,`style`)(n))}function _(e,t,n){i.selectedPointStyle(e.selectAll(`path`),t),v(e.selectAll(`text`),t,n)}function v(e,t,r){e.each(function(e){var o=n.select(this),s;if(e.selected){s=a.ensureUniformFontSize(r,y(o,e,t,r));var c=t.selected.textfont&&t.selected.textfont.color;c&&(s.color=c),i.font(o,s)}else i.selectedTextStyle(o,t)})}function y(e,t,n,r){var i=r._fullLayout.font,a=n.textfont;if(e.classed(`bartext-inside`)){var o=T(t,n);a=x(n,t.i,i,o)}else e.classed(`bartext-outside`)&&(a=C(n,t.i,i));return a}function b(e,t,n){return w(l,e.textfont,t,n)}function x(e,t,n,i){var a=b(e,t,n);return(e._input.textfont===void 0||e._input.textfont.color===void 0||Array.isArray(e.textfont.color)&&e.textfont.color[t]===void 0)&&(a={color:r.contrast(i),family:a.family,size:a.size,weight:a.weight,style:a.style,variant:a.variant,textcase:a.textcase,lineposition:a.lineposition,shadow:a.shadow}),w(u,e.insidetextfont,t,a)}function C(e,t,n){var r=b(e,t,n);return w(d,e.outsidetextfont,t,r)}function w(e,t,n,r){t||={};var i=f.getValue(t.family,n),a=f.getValue(t.size,n),o=f.getValue(t.color,n),s=f.getValue(t.weight,n),c=f.getValue(t.style,n),l=f.getValue(t.variant,n),u=f.getValue(t.textcase,n),d=f.getValue(t.lineposition,n),p=f.getValue(t.shadow,n);return{family:f.coerceString(e.family,i,r.family),size:f.coerceNumber(e.size,a,r.size),color:f.coerceColor(e.color,o,r.color),weight:f.coerceString(e.weight,s,r.weight),style:f.coerceString(e.style,c,r.style),variant:f.coerceString(e.variant,l,r.variant),textcase:f.coerceString(e.variant,u,r.textcase),lineposition:f.coerceString(e.variant,d,r.lineposition),shadow:f.coerceString(e.variant,p,r.shadow)}}function T(e,t){return t.type===`waterfall`?t[e.dir].marker.color:e.mcc||e.mc||t.marker.color}t.exports={style:p,styleTextPoints:h,styleOnSelect:g,getInsideTextFont:x,getOutsideTextFont:C,getBarColor:T,resizeText:s}}),ro=h((e,t)=>{var n=S(),r=D(),i=$(),a=kt(),o=q(),s=tn(),c=Ke(),l=sn().tickText,u=eo(),d=u.recordMinTextSize,f=u.clearMinTextSize,p=no(),m=to(),h=ui(),g=qa(),_=g.text,v=g.textposition,y=Qt().appendArrayPointValue,b=h.TEXTPAD;function x(e){return e.id}function C(e){if(e.ids)return x}function w(e){return(e>0)-(e<0)}function T(e,t){return e<t?1:-1}function E(e,t,n,r){var i=[],a=[],o=r?t:n,s=r?n:t;return i[0]=o.c2p(e.s0,!0),a[0]=s.c2p(e.p0,!0),i[1]=o.c2p(e.s1,!0),a[1]=s.c2p(e.p1,!0),r?[i,a]:[a,i]}function O(e,t,n,r){if(!t.uniformtext.mode&&k(n)){var i;return r&&(i=r()),e.transition().duration(n.duration).ease(n.easing).each(`end`,function(){i&&i()}).each(`interrupt`,function(){i&&i()})}else return e}function k(e){return e&&e.duration>0}function A(e,t,a,l,u,d){var p=t.xaxis,h=t.yaxis,g=e._fullLayout,_=e._context.staticPlot;u||(u={mode:g.barmode,norm:g.barmode,gap:g.bargap,groupgap:g.bargroupgap},f(`bar`,g));var v=i.makeTraceGroups(l,a,`trace bars`).each(function(a){var c=n.select(this),l=a[0].trace,f=a[0].t,v=l.type===`waterfall`,y=l.type===`funnel`,b=l.type===`histogram`,x=l.type===`bar`,S=x||y,D=0;v&&l.connector.visible&&l.connector.mode===`between`&&(D=l.connector.line.width/2);var A=l.orientation===`h`,M=k(u),N=i.ensureSingle(c,`g`,`points`),P=C(l),F=N.selectAll(`g.point`).data(i.identity,P);F.enter().append(`g`).classed(`point`,!0),F.exit().remove(),F.each(function(c,v){var y=n.select(this),C=E(c,p,h,A),k=C[0][0],N=C[0][1],P=C[1][0],F=C[1][1],I=(A?N-k:F-P)===0;I&&S&&m.getLineWidth(l,c)&&(I=!1),I||=!r(k)||!r(N)||!r(P)||!r(F),c.isBlank=I,I&&(A?N=k:F=P),D&&!I&&(A?(k-=T(k,N)*D,N+=T(k,N)*D):(P-=T(P,F)*D,F+=T(P,F)*D));var L,R;if(l.type===`waterfall`){if(!I){var z=l[c.dir].marker;L=z.line.width,R=z.color}}else L=m.getLineWidth(l,c),R=c.mc||l.marker.color;function B(e){var t=n.round(L/2%1,2);return u.gap===0&&u.groupgap===0?n.round(Math.round(e)-t,2):e}function V(e,t,n){return n&&e===t?e:Math.abs(e-t)>=2?B(e):e>t?Math.ceil(e):Math.floor(e)}var H=o.opacity(R)<1||L>.01?B:V;e._context.staticPlot||(k=H(k,N,A),N=H(N,k,A),P=H(P,F,!A),F=H(F,P,!A));var U=A?p.c2p:h.c2p,W=c.s0>0?c._sMax:c.s0<0?c._sMin:c.s1>0?c._sMax:c._sMin;function G(e,t){if(!e)return 0;var n=Math.abs(A?F-P:N-k),r=Math.abs(A?N-k:F-P),i=H(Math.abs(U(W,!0)-U(0,!0))),a=c.hasB?Math.min(n/2,r/2):Math.min(n/2,i),o=t===`%`?Math.min(50,e)/100*n:e;return H(Math.max(Math.min(o,a),0))}var K=x||b?G(f.cornerradiusvalue,f.cornerradiusform):0,q,J,Y=`M`+k+`,`+P+`V`+F+`H`+N+`V`+P+`Z`,X=0;if(K&&c.s){var Z=w(c.s0)===0||w(c.s)===w(c.s0)?c.s1:c.s0;if(X=H(c.hasB?0:Math.abs(U(W,!0)-U(Z,!0))),X<K){var Q=T(k,N),ee=T(P,F),te=Q===-ee?1:0;if(A)if(c.hasB)q=`M`+(k+K*Q)+`,`+P+`A `+K+`,`+K+` 0 0 `+te+` `+k+`,`+(P+K*ee)+`V`+(F-K*ee)+`A `+K+`,`+K+` 0 0 `+te+` `+(k+K*Q)+`,`+F+`H`+(N-K*Q)+`A `+K+`,`+K+` 0 0 `+te+` `+N+`,`+(F-K*ee)+`V`+(P+K*ee)+`A `+K+`,`+K+` 0 0 `+te+` `+(N-K*Q)+`,`+P+`Z`;else{J=Math.abs(N-k)+X;var ne=J<K?K-Math.sqrt(J*(2*K-J)):0,re=X>0?Math.sqrt(X*(2*K-X)):0,ie=Q>0?Math.max:Math.min;q=`M`+k+`,`+P+`V`+(F-ne*ee)+`H`+ie(N-(K-X)*Q,k)+`A `+K+`,`+K+` 0 0 `+te+` `+N+`,`+(F-K*ee-re)+`V`+(P+K*ee+re)+`A `+K+`,`+K+` 0 0 `+te+` `+ie(N-(K-X)*Q,k)+`,`+(P+ne*ee)+`Z`}else if(c.hasB)q=`M`+(k+K*Q)+`,`+P+`A `+K+`,`+K+` 0 0 `+te+` `+k+`,`+(P+K*ee)+`V`+(F-K*ee)+`A `+K+`,`+K+` 0 0 `+te+` `+(k+K*Q)+`,`+F+`H`+(N-K*Q)+`A `+K+`,`+K+` 0 0 `+te+` `+N+`,`+(F-K*ee)+`V`+(P+K*ee)+`A `+K+`,`+K+` 0 0 `+te+` `+(N-K*Q)+`,`+P+`Z`;else{J=Math.abs(F-P)+X;var ae=J<K?K-Math.sqrt(J*(2*K-J)):0,oe=X>0?Math.sqrt(X*(2*K-X)):0,se=ee>0?Math.max:Math.min;q=`M`+(k+ae*Q)+`,`+P+`V`+se(F-(K-X)*ee,P)+`A `+K+`,`+K+` 0 0 `+te+` `+(k+K*Q-oe)+`,`+F+`H`+(N-K*Q+oe)+`A `+K+`,`+K+` 0 0 `+te+` `+(N-ae*Q)+`,`+se(F-(K-X)*ee,P)+`V`+P+`Z`}}else q=Y}else q=Y;var ce=O(i.ensureSingle(y,`path`),g,u,d);if(ce.style(`vector-effect`,_?`none`:`non-scaling-stroke`).attr(`d`,isNaN((N-k)*(F-P))||I&&e._context.staticPlot?`M0,0Z`:q).call(s.setClipUrl,t.layerClipId,e),!g.uniformtext.mode&&M){var le=s.makePointStyleFns(l);s.singlePointStyle(c,ce,l,le,e)}j(e,t,y,a,v,k,N,P,F,K,X,u,d),t.layerClipId&&s.hideOutsideRangePoint(c,y.select(`text`),p,h,l.xcalendar,l.ycalendar)});var I=l.cliponaxis===!1;s.setClipUrl(c,I?null:t.layerClipId,e)});c.getComponentMethod(`errorbars`,`plot`)(e,v,t,u)}function j(e,t,n,r,o,c,l,u,f,m,h,g,_){var v=t.xaxis,y=t.yaxis,x=e._fullLayout,S;function C(t,n,r){return i.ensureSingle(t,`text`).text(n).attr({class:`bartext bartext-`+S,"text-anchor":`middle`,"data-notex":1}).call(s.font,r).call(a.convertToTspans,e)}var w=r[0].trace,T=w.orientation===`h`,E=R(x,r,o,v,y);S=z(w,o);var D=g.mode===`stack`||g.mode===`relative`,k=r[o],A=!D||k._outmost,j=k.hasB,N=m&&m-h>b;if(!E||S===`none`||(k.isBlank||c===l||u===f)&&(S===`auto`||S===`inside`)){n.select(`text`).remove();return}var P=x.font,I=p.getBarColor(r[o],w),B=p.getInsideTextFont(w,o,P,I),V=p.getOutsideTextFont(w,o,P),H=w.insidetextanchor||`end`,U=n.datum();T?v.type===`log`&&U.s0<=0&&(c=v.range[0]<v.range[1]?0:v._length):y.type===`log`&&U.s0<=0&&(u=y.range[0]<y.range[1]?y._length:0);var W=Math.abs(l-c),G=Math.abs(f-u),K=W-2*b,q=G-2*b,J,Y,X,Z,Q;if(S===`outside`&&!A&&!k.hasB&&(S=`inside`),S===`auto`)if(A){S=`inside`,Q=i.ensureUniformFontSize(e,B),J=C(n,E,Q),Y=s.bBox(J.node()),X=Y.width,Z=Y.height;var ee=X>0&&Z>0,te=N?j?M(K-2*m,q,X,Z,T)||M(K,q-2*m,X,Z,T):T?M(K-(m-h),q,X,Z,T)||M(K,q-2*(m-h),X,Z,T):M(K,q-(m-h),X,Z,T)||M(K-2*(m-h),q,X,Z,T):M(K,q,X,Z,T);ee&&te?S=`inside`:(S=`outside`,J.remove(),J=null)}else S=`inside`;if(!J){Q=i.ensureUniformFontSize(e,S===`outside`?V:B),J=C(n,E,Q);var ne=J.attr(`transform`);if(J.attr(`transform`,``),Y=s.bBox(J.node()),X=Y.width,Z=Y.height,J.attr(`transform`,ne),X<=0||Z<=0){J.remove();return}}var re=w.textangle,ie,ae;S===`outside`?(ae=w.constraintext===`both`||w.constraintext===`outside`,ie=L(c,l,u,f,Y,{isHorizontal:T,constrained:ae,angle:re})):(ae=w.constraintext===`both`||w.constraintext===`inside`,ie=F(c,l,u,f,Y,{isHorizontal:T,constrained:ae,angle:re,anchor:H,hasB:j,r:m,overhead:h})),ie.fontSize=Q.size,d(w.type===`histogram`?`bar`:w.type,ie,x),k.transform=ie;var oe=O(J,x,g,_);i.setTransormAndDisplay(oe,ie)}function M(e,t,n,r,i){if(e<0||t<0)return!1;var a=n<=e&&r<=t,o=n<=t&&r<=e,s=i?e>=t/r*n:t>=e/n*r;return a||o||s}function N(e){return e===`auto`?0:e}function P(e,t){var n=Math.PI/180*t,r=Math.abs(Math.sin(n)),i=Math.abs(Math.cos(n));return{x:e.width*i+e.height*r,y:e.width*r+e.height*i}}function F(e,t,n,r,i,a){var o=!!a.isHorizontal,s=!!a.constrained,c=a.angle||0,l=a.anchor,u=l===`end`,d=l===`start`,f=((a.leftToRight||0)+1)/2,p=1-f,m=a.hasB,h=a.r,g=a.overhead,_=i.width,v=i.height,y=Math.abs(t-e),x=Math.abs(r-n),S=y>2*b&&x>2*b?b:0;y-=2*S,x-=2*S;var C=N(c);c===`auto`&&!(_<=y&&v<=x)&&(_>y||v>x)&&(!(_>x||v>y)||_<v!=y<x)&&(C+=90);var w=P(i,C),E,D;if(h&&h-g>b){var O=I(e,t,n,r,w,h,g,o,m);E=O.scale,D=O.pad}else E=1,s&&(E=Math.min(1,y/w.x,x/w.y)),D=0;var k=i.left*p+i.right*f,A=(i.top+i.bottom)/2,j=(e+b)*p+(t-b)*f,M=(n+r)/2,F=0,L=0;if(d||u){var R=(o?w.x:w.y)/2;h&&(u||m)&&(S+=D);var z=o?T(e,t):T(n,r);o?d?(j=e+z*S,F=-z*R):(j=t-z*S,F=z*R):d?(M=n+z*S,L=-z*R):(M=r-z*S,L=z*R)}return{textX:k,textY:A,targetX:j,targetY:M,anchorX:F,anchorY:L,scale:E,rotate:C}}function I(e,t,n,r,i,a,o,s,c){var l=Math.max(0,Math.abs(t-e)-2*b),u=Math.max(0,Math.abs(r-n)-2*b),d=a-b,f=o?d-Math.sqrt(d*d-(d-o)*(d-o)):d,p=c?d*2:s?d-o:2*f,m=c?d*2:s?2*f:d-o,h,g,_,v,y;return i.y/i.x>=u/(l-p)?v=u/i.y:i.y/i.x<=(u-m)/l?v=l/i.x:!c&&s?(h=i.x*i.x+i.y*i.y/4,g=-2*i.x*(l-d)-i.y*(u/2-d),_=(l-d)*(l-d)+(u/2-d)*(u/2-d)-d*d,v=(-g+Math.sqrt(g*g-4*h*_))/(2*h)):c?(h=(i.x*i.x+i.y*i.y)/4,g=-i.x*(l/2-d)-i.y*(u/2-d),_=(l/2-d)*(l/2-d)+(u/2-d)*(u/2-d)-d*d,v=(-g+Math.sqrt(g*g-4*h*_))/(2*h)):(h=i.x*i.x/4+i.y*i.y,g=-i.x*(l/2-d)-2*i.y*(u-d),_=(l/2-d)*(l/2-d)+(u-d)*(u-d)-d*d,v=(-g+Math.sqrt(g*g-4*h*_))/(2*h)),v=Math.min(1,v),y=s?Math.max(0,d-Math.sqrt(Math.max(0,d*d-(d-(u-i.y*v)/2)*(d-(u-i.y*v)/2)))-o):Math.max(0,d-Math.sqrt(Math.max(0,d*d-(d-(l-i.x*v)/2)*(d-(l-i.x*v)/2)))-o),{scale:v,pad:y}}function L(e,t,n,r,i,a){var o=!!a.isHorizontal,s=!!a.constrained,c=a.angle||0,l=i.width,u=i.height,d=Math.abs(t-e),f=Math.abs(r-n),p=o?f>2*b?b:0:d>2*b?b:0,m=1;s&&(m=o?Math.min(1,f/u):Math.min(1,d/l));var h=N(c),g=P(i,h),_=(o?g.x:g.y)/2,v=(i.left+i.right)/2,y=(i.top+i.bottom)/2,x=(e+t)/2,S=(n+r)/2,C=0,w=0,E=o?T(t,e):T(n,r);return o?(x=t-E*p,C=E*_):(S=r+E*p,w=-E*_),{textX:v,textY:y,targetX:x,targetY:S,anchorX:C,anchorY:w,scale:m,rotate:h}}function R(e,t,n,r,i){var a=t[0].trace,o=a.texttemplate,s;return s=o?B(e,t,n,r,i):a.textinfo?V(t,n,r,i):m.getValue(a.text,n),m.coerceString(_,s)}function z(e,t){var n=m.getValue(e.textposition,t);return m.coerceEnumerated(v,n)}function B(e,t,n,r,a){var o=t[0].trace,s=i.castOption(o,n,`texttemplate`);if(!s)return``;var c=o.type===`histogram`,u=o.type===`waterfall`,d=o.type===`funnel`,f=o.orientation===`h`,p,m,h,g;f?(p=`y`,m=a,h=`x`,g=r):(p=`x`,m=r,h=`y`,g=a);function _(e){return l(m,m.c2l(e),!0).text}function v(e){return l(g,g.c2l(e),!0).text}var b=t[n],x={};x.label=b.p,x.labelLabel=x[p+`Label`]=_(b.p);var S=i.castOption(o,b.i,`text`);(S===0||S)&&(x.text=S),x.value=b.s,x.valueLabel=x[h+`Label`]=v(b.s);var C={};y(C,o,b.i),(c||C.x===void 0)&&(C.x=f?x.value:x.label),(c||C.y===void 0)&&(C.y=f?x.label:x.value),(c||C.xLabel===void 0)&&(C.xLabel=f?x.valueLabel:x.labelLabel),(c||C.yLabel===void 0)&&(C.yLabel=f?x.labelLabel:x.valueLabel),u&&(x.delta=+b.rawS||b.s,x.deltaLabel=v(x.delta),x.final=b.v,x.finalLabel=v(x.final),x.initial=x.final-x.delta,x.initialLabel=v(x.initial)),d&&(x.value=b.s,x.valueLabel=v(x.value),x.percentInitial=b.begR,x.percentInitialLabel=i.formatPercent(b.begR),x.percentPrevious=b.difR,x.percentPreviousLabel=i.formatPercent(b.difR),x.percentTotal=b.sumR,x.percenTotalLabel=i.formatPercent(b.sumR));var w=i.castOption(o,b.i,`customdata`);return w&&(x.customdata=w),i.texttemplateString({data:[C,x,o._meta],fallback:o.texttemplatefallback,labels:x,locale:e._d3locale,template:s})}function V(e,t,n,r){var a=e[0].trace,o=a.orientation===`h`,s=a.type===`waterfall`,c=a.type===`funnel`;function u(e){return l(o?r:n,e,!0).text}function d(e){return l(o?n:r,+e,!0).text}var f=a.textinfo,p=e[t],m=f.split(`+`),h=[],g,_=function(e){return m.indexOf(e)!==-1};if(_(`label`)&&h.push(u(e[t].p)),_(`text`)&&(g=i.castOption(a,p.i,`text`),(g===0||g)&&h.push(g)),s){var v=+p.rawS||p.s,y=p.v,b=y-v;_(`initial`)&&h.push(d(b)),_(`delta`)&&h.push(d(v)),_(`final`)&&h.push(d(y))}if(c){_(`value`)&&h.push(d(p.s));var x=0;_(`percent initial`)&&x++,_(`percent previous`)&&x++,_(`percent total`)&&x++;var S=x>1;_(`percent initial`)&&(g=i.formatPercent(p.begR),S&&(g+=` of initial`),h.push(g)),_(`percent previous`)&&(g=i.formatPercent(p.difR),S&&(g+=` of previous`),h.push(g)),_(`percent total`)&&(g=i.formatPercent(p.sumR),S&&(g+=` of total`),h.push(g))}return h.join(`<br>`)}t.exports={plot:A,toMoveInsideBar:F}}),io=h((e,t)=>{var n=Ln(),r=Ke(),i=q(),a=$().fillText,o=to().getLineWidth,s=sn().hoverLabelText,c=O().BADNUM;function l(e,t,n,i,a){var o=u(e,t,n,i,a);if(o){var s=o.cd,c=s[0].trace,l=s[o.index];return o.color=d(c,l),r.getComponentMethod(`errorbars`,`hoverInfo`)(l,c,o),[o]}}function u(e,t,r,i,o){var l=e.cd,u=l[0].trace,d=l[0].t,f=i===`closest`,p=u.type===`waterfall`,m=e.maxHoverDistance,h=e.maxSpikeDistance,g,_,v,y,b,x,S;u.orientation===`h`?(g=r,_=t,v=`y`,y=`x`,b=F,x=M):(g=t,_=r,v=`x`,y=`y`,x=F,b=M);var C=u[v+`period`],w=f||C;function T(e){return D(e,-1)}function E(e){return D(e,1)}function D(e,t){var n=e.w;return e[v]+t*n/2}function O(e){return e[v+`End`]-e[v+`Start`]}var k=f?T:C?function(e){return e.p-O(e)/2}:function(e){return Math.min(T(e),e.p-d.bardelta/2)},A=f?E:C?function(e){return e.p+O(e)/2}:function(e){return Math.max(E(e),e.p+d.bardelta/2)};function j(e,t,r){return o.finiteRange&&(r=0),n.inbox(e-g,t-g,r+Math.min(1,Math.abs(t-e)/S)-1)}function M(e){return j(k(e),A(e),m)}function N(e){return j(T(e),E(e),h)}function P(e){var t=e[y];if(p){var n=Math.abs(e.rawS)||0;_>0?t+=n:_<0&&(t-=n)}return t}function F(e){var t=_,r=e.b,i=P(e);return n.inbox(r-t,i-t,m+(i-t)/(i-r)-1)}function I(e){var t=_,r=e.b,i=P(e);return n.inbox(r-t,i-t,h+(i-t)/(i-r)-1)}var L=e[v+`a`],R=e[y+`a`];S=Math.abs(L.r2c(L.range[1])-L.r2c(L.range[0]));function z(e){return(b(e)+x(e))/2}var B=n.getDistanceFunction(i,b,x,z);if(n.getClosest(l,B,e),e.index!==!1&&l[e.index].p!==c){w||(k=function(e){return Math.min(T(e),e.p-d.bargroupwidth/2)},A=function(e){return Math.max(E(e),e.p+d.bargroupwidth/2)});var V=l[e.index],H=u.base?V.b+V.s:V.s;e[y+`0`]=e[y+`1`]=R.c2p(V[y],!0),e[y+`LabelVal`]=H;var U=d.extents[d.extents.round(V.p)];e[v+`0`]=L.c2p(f?k(V):U[0],!0),e[v+`1`]=L.c2p(f?A(V):U[1],!0);var W=V.orig_p!==void 0;return e[v+`LabelVal`]=W?V.orig_p:V.p,e.labelLabel=s(L,e[v+`LabelVal`],u[v+`hoverformat`]),e.valueLabel=s(R,e[y+`LabelVal`],u[y+`hoverformat`]),e.baseLabel=s(R,V.b,u[y+`hoverformat`]),e.spikeDistance=(I(V)+N(V))/2,e[v+`Spike`]=L.c2p(V.p,!0),a(V,u,e),e.hovertemplate=u.hovertemplate,e}}function d(e,t){var n=t.mcc||e.marker.color,r=t.mlcc||e.marker.line.color,a=o(e,t);if(i.opacity(n))return n;if(i.opacity(r)&&a)return r}t.exports={hoverPoints:l,hoverOnBars:u,getTraceColor:d}}),ao=h((e,t)=>{t.exports=function(e,t,n){return e.x=`xVal`in t?t.xVal:t.x,e.y=`yVal`in t?t.yVal:t.y,t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),n.orientation===`h`?(e.label=e.y,e.value=e.x):(e.label=e.x,e.value=e.y),e}}),oo=h((e,t)=>{t.exports=function(e,t){var r=e.cd,i=e.xaxis,a=e.yaxis,o=r[0].trace,s=o.type===`funnel`,c=o.orientation===`h`,l=[],u;if(t===!1)for(u=0;u<r.length;u++)r[u].selected=0;else for(u=0;u<r.length;u++){var d=r[u],f=`ct`in d?d.ct:n(d,i,a,c,s);t.contains(f,!1,u,e)?(l.push({pointNumber:u,x:i.c2d(d.x),y:a.c2d(d.y)}),d.selected=1):d.selected=0}return l};function n(e,t,n,r,i){var a=t.c2p(r?e.s0:e.p0,!0),o=t.c2p(r?e.s1:e.p1,!0),s=n.c2p(r?e.p0:e.s0,!0),c=n.c2p(r?e.p1:e.s1,!0);return i?[(a+o)/2,(s+c)/2]:r?[o,(s+c)/2]:[(a+o)/2,c]}}),so=h((e,t)=>{t.exports={attributes:qa(),layoutAttributes:Ja(),supplyDefaults:Xa().supplyDefaults,crossTraceDefaults:Xa().crossTraceDefaults,supplyLayoutDefaults:Za(),calc:$a(),crossTraceCalc:di().crossTraceCalc,colorbar:gi(),arraysToCalcdata:Qa(),plot:ro().plot,style:no().style,styleOnSelect:no().styleOnSelect,hoverPoints:io().hoverPoints,eventData:ao(),selectPoints:oo(),moduleType:`trace`,name:`bar`,basePlotModule:Ai(),categories:[`bar-like`,`cartesian`,`svg`,`bar`,`oriented`,`errorBarsOK`,`showLegend`,`zoomScale`],animatable:!0,meta:{}}}),co=h((e,t)=>{t.exports=so()}),lo=h((e,t)=>{var n=wr(),r=Tr(),i=qa(),a=K(),o=jt().axisHoverFormat,{hovertemplateAttrs:s,templatefallbackAttrs:c}=ze(),l=z().extendFlat,u=r.marker,d=u.line;t.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:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:o(`x`),yhoverformat:o(`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:l({},u.symbol,{arrayOk:!1,editType:`plot`}),opacity:l({},u.opacity,{arrayOk:!1,dflt:1,editType:`style`}),angle:l({},u.angle,{arrayOk:!1,editType:`calc`}),size:l({},u.size,{arrayOk:!1,editType:`calc`}),color:l({},u.color,{arrayOk:!1,editType:`style`}),line:{color:l({},d.color,{arrayOk:!1,dflt:a.defaultLine,editType:`style`}),width:l({},d.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:n(),whiskerwidth:{valType:`number`,min:0,max:1,dflt:.5,editType:`calc`},showwhiskers:{valType:`boolean`,editType:`calc`},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:r.selected.marker,editType:`style`},unselected:{marker:r.unselected.marker,editType:`style`},text:l({},r.text,{}),hovertext:l({},r.hovertext,{}),hovertemplate:s({}),hovertemplatefallback:c(),hoveron:{valType:`flaglist`,flags:[`boxes`,`points`],dflt:`boxes+points`,editType:`style`},zorder:r.zorder}}),uo=h((e,t)=>{t.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`}}}),fo=h((e,t)=>{var n=$(),r=Ke(),i=q(),a=qr(),o=ti(),s=an(),c=lo();function l(e,t,r,o){function s(r,i){return n.coerce(e,t,c,r,i)}if(u(e,t,s,o),t.visible!==!1){a(e,t,o,s),s(`xhoverformat`),s(`yhoverformat`);var l=t._hasPreCompStats;l&&(s(`lowerfence`),s(`upperfence`)),s(`line.color`,(e.marker||{}).color||r),s(`line.width`),s(`fillcolor`,i.addOpacity(t.line.color,.5));var f=!1;if(l){var p=s(`mean`),m=s(`sd`);p&&p.length&&(f=!0,m&&m.length&&(f=`sd`))}s(`whiskerwidth`);var h=s(`sizemode`),g;h===`quartiles`&&(g=s(`boxmean`,f)),s(`showwhiskers`,h===`quartiles`),(h===`sd`||g===`sd`)&&s(`sdmultiple`),s(`width`),s(`quartilemethod`);var _=!1;if(l){var v=s(`notchspan`);v&&v.length&&(_=!0)}else n.validate(e.notchwidth,c.notchwidth)&&(_=!0);s(`notched`,_)&&s(`notchwidth`),d(e,t,s,{prefix:`box`}),s(`zorder`)}}function u(e,t,i,a){function o(e){var t=0;return e&&e.length&&(t+=1,n.isArrayOrTypedArray(e[0])&&e[0].length&&(t+=1)),t}function l(t){return n.validate(e[t],c[t])}var u=i(`y`),d=i(`x`),f;if(t.type===`box`){var p=i(`q1`),m=i(`median`),h=i(`q3`);t._hasPreCompStats=p&&p.length&&m&&m.length&&h&&h.length,f=Math.min(n.minRowLength(p),n.minRowLength(m),n.minRowLength(h))}var g=o(u),_=o(d),v=g&&n.minRowLength(u),y=_&&n.minRowLength(d),b=a.calendar,x={autotypenumbers:a.autotypenumbers},S,C;if(t._hasPreCompStats)switch(String(_)+String(g)){case`00`:var w=l(`x0`)||l(`dx`);S=(l(`y0`)||l(`dy`))&&!w?`h`:`v`,C=f;break;case`10`:S=`v`,C=Math.min(f,y);break;case`20`:S=`h`,C=Math.min(f,d.length);break;case`01`:S=`h`,C=Math.min(f,v);break;case`02`:S=`v`,C=Math.min(f,u.length);break;case`12`:S=`v`,C=Math.min(f,y,u.length);break;case`21`:S=`h`,C=Math.min(f,d.length,v);break;case`11`:C=0;break;case`22`:var T=!1,E;for(E=0;E<d.length;E++)if(s(d[E],b,x)===`category`){T=!0;break}if(T)S=`v`,C=Math.min(f,y,u.length);else{for(E=0;E<u.length;E++)if(s(u[E],b,x)===`category`){T=!0;break}T?(S=`h`,C=Math.min(f,d.length,v)):(S=`v`,C=Math.min(f,y,u.length))}break}else g>0?(S=`v`,C=_>0?Math.min(y,v):Math.min(v)):_>0?(S=`h`,C=Math.min(y)):C=0;if(!C){t.visible=!1;return}t._length=C;var D=i(`orientation`,S);t._hasPreCompStats?D===`v`&&_===0?(i(`x0`,0),i(`dx`,1)):D===`h`&&g===0&&(i(`y0`,0),i(`dy`,1)):D===`v`&&_===0?i(`x0`):D===`h`&&g===0&&i(`y0`),r.getComponentMethod(`calendars`,`handleTraceDefaults`)(e,t,[`x`,`y`],a)}function d(e,t,r,i){var a=i.prefix,o=n.coerce2(e,t,c,`marker.outliercolor`),s=r(`marker.line.outliercolor`),l=`outliers`;t._hasPreCompStats?l=`all`:(o||s)&&(l=`suspectedoutliers`);var u=r(a+`points`,l);u?(r(`jitter`,u===`all`?.3:0),r(`pointpos`,u===`all`?-1.5:0),r(`marker.symbol`),r(`marker.opacity`),r(`marker.size`),r(`marker.angle`),r(`marker.color`,t.line.color),r(`marker.line.color`),r(`marker.line.width`),u===`suspectedoutliers`&&(r(`marker.line.outliercolor`,t.marker.color),r(`marker.line.outlierwidth`)),r(`selected.marker.color`),r(`unselected.marker.color`),r(`selected.marker.size`),r(`unselected.marker.size`),r(`text`),r(`hovertext`)):delete t.marker;var d=r(`hoveron`);(d===`all`||d.indexOf(`points`)!==-1)&&(r(`hovertemplate`),r(`hovertemplatefallback`)),n.coerceSelectionMarkerOpacity(t,r)}function f(e,t){var r,i;function a(e){return n.coerce(i._input,i,c,e)}for(var s=0;s<e.length;s++){i=e[s];var l=i.type;if(l===`box`||l===`violin`){r=i._input;var u=t[l+`mode`];u===`group`&&o(r,i,t,a,u)}}}t.exports={supplyDefaults:l,crossTraceDefaults:f,handleSampleDefaults:u,handlePointsDefaults:d}}),po=h((e,t)=>{var n=Ke(),r=$(),i=uo();function a(e,t,r,i,a){for(var o=a+`Layout`,s=!1,c=0;c<r.length;c++){var l=r[c];if(n.traceIs(l,o)){s=!0;break}}s&&(i(a+`mode`),i(a+`gap`),i(a+`groupgap`))}function o(e,t,n){function o(n,a){return r.coerce(e,t,i,n,a)}a(e,t,n,o,`box`)}t.exports={supplyLayoutDefaults:o,_supply:a}}),mo=h((e,t)=>{var n=D(),r=sn(),i=ii(),a=$(),o=O().BADNUM,s=a._;t.exports=function(e,t){var i=e._fullLayout,d=r.getFromId(e,t.xaxis||`x`),x=r.getFromId(e,t.yaxis||`y`),S=[],C=t.type===`violin`?`_numViolins`:`_numBoxes`,w,T,E,D,O,k,A;t.orientation===`h`?(E=d,D=`x`,O=x,k=`y`,A=!!t.yperiodalignment):(E=x,D=`y`,O=d,k=`x`,A=!!t.xperiodalignment);var j=c(t,k,O,i[C]),M=j[0],N=j[1],P=a.distinctVals(M,O),F=P.vals,I=P.minDiff/2,L,R,z,B,V,H,U=(t.boxpoints||t.points)===`all`?a.identity:function(e){return e.v<L.lf||e.v>L.uf};if(t._hasPreCompStats){var W=t[D],G=function(e){return E.d2c((t[e]||[])[w])},K=1/0,q=-1/0;for(w=0;w<t._length;w++){var J=M[w];if(n(J)){if(L={},L.pos=L[k]=J,A&&N&&(L.orig_p=N[w]),L.q1=G(`q1`),L.med=G(`median`),L.q3=G(`q3`),R=[],W&&a.isArrayOrTypedArray(W[w]))for(T=0;T<W[w].length;T++)H=E.d2c(W[w][T]),H!==o&&(V={v:H,i:[w,T]},f(V,t,[w,T]),R.push(V));if(L.pts=R.sort(m),z=L[D]=R.map(h),B=z.length,L.med!==o&&L.q1!==o&&L.q3!==o&&L.med>=L.q1&&L.q3>=L.med){var Y=G(`lowerfence`);L.lf=Y!==o&&Y<=L.q1?Y:g(L,z,B);var X=G(`upperfence`);L.uf=X!==o&&X>=L.q3?X:_(L,z,B);var Z=G(`mean`);L.mean=Z===o?B?a.mean(z,B):(L.q1+L.q3)/2:Z;var Q=G(`sd`);L.sd=Z!==o&&Q>=0?Q:B?a.stdev(z,B,L.mean):L.q3-L.q1,L.lo=v(L),L.uo=y(L);var ee=G(`notchspan`);ee=ee!==o&&ee>0?ee:b(L,B),L.ln=L.med-ee,L.un=L.med+ee;var te=L.lf,ne=L.uf;t.boxpoints&&z.length&&(te=Math.min(te,z[0]),ne=Math.max(ne,z[B-1])),t.notched&&(te=Math.min(te,L.ln),ne=Math.max(ne,L.un)),L.min=te,L.max=ne}else{a.warn([`Invalid input - make sure that q1 <= median <= q3`,`q1 = `+L.q1,`median = `+L.med,`q3 = `+L.q3].join(`
`));var re=L.med===o?L.q1===o?L.q3===o?0:L.q3:L.q3===o?L.q1:(L.q1+L.q3)/2:L.med;L.med=re,L.q1=L.q3=re,L.lf=L.uf=re,L.mean=L.sd=re,L.ln=L.un=re,L.min=L.max=re}K=Math.min(K,L.min),q=Math.max(q,L.max),L.pts2=R.filter(U),S.push(L)}}t._extremes[E._id]=r.findExtremes(E,[K,q],{padded:!0})}else{var ie=E.makeCalcdata(t,D),ae=l(F,I),oe=F.length,se=u(oe);for(w=0;w<t._length;w++)if(H=ie[w],n(H)){var ce=a.findBin(M[w],ae);ce>=0&&ce<oe&&(V={v:H,i:w},f(V,t,w),se[ce].push(V))}var le=1/0,ue=-1/0,de=t.quartilemethod,fe=de===`exclusive`,pe=de===`inclusive`;for(w=0;w<oe;w++)if(se[w].length>0){if(L={},L.pos=L[k]=F[w],R=L.pts=se[w].sort(m),z=L[D]=R.map(h),B=z.length,L.min=z[0],L.max=z[B-1],L.mean=a.mean(z,B),L.sd=a.stdev(z,B,L.mean)*t.sdmultiple,L.med=a.interp(z,.5),B%2&&(fe||pe)){var me,he;fe?(me=z.slice(0,B/2),he=z.slice(B/2+1)):pe&&(me=z.slice(0,B/2+1),he=z.slice(B/2)),L.q1=a.interp(me,.5),L.q3=a.interp(he,.5)}else L.q1=a.interp(z,.25),L.q3=a.interp(z,.75);L.lf=g(L,z,B),L.uf=_(L,z,B),L.lo=v(L),L.uo=y(L);var ge=b(L,B);L.ln=L.med-ge,L.un=L.med+ge,le=Math.min(le,L.ln),ue=Math.max(ue,L.un),L.pts2=R.filter(U),S.push(L)}t.notched&&a.isTypedArray(ie)&&(ie=Array.from(ie)),t._extremes[E._id]=r.findExtremes(E,t.notched?ie.concat([le,ue]):ie,{padded:!0})}return p(S,t),S.length>0?(S[0].t={num:i[C],dPos:I,posLetter:k,valLetter:D,labels:{med:s(e,`median:`),min:s(e,`min:`),q1:s(e,`q1:`),q3:s(e,`q3:`),max:s(e,`max:`),mean:t.boxmean===`sd`||t.sizemode===`sd`?s(e,`mean ± σ:`).replace(`σ`,t.sdmultiple===1?`σ`:t.sdmultiple+`σ`):s(e,`mean:`),lf:s(e,`lower fence:`),uf:s(e,`upper fence:`)}},i[C]++,S):[{t:{empty:!0}}]};function c(e,t,r,o){var s=t in e,c=t+`0`in e,l=`d`+t in e;if(s||c&&l){var u=r.makeCalcdata(e,t);return[i(e,r,t,u).vals,u]}for(var d=c?e[t+`0`]:(`name`in e)&&(r.type===`category`||n(e.name)&&[`linear`,`log`].indexOf(r.type)!==-1||a.isDateTime(e.name)&&r.type===`date`)?e.name:o,f=r.type===`multicategory`?r.r2c_just_indices(d):r.d2c(d,0,e[t+`calendar`]),p=e._length,m=Array(p),h=0;h<p;h++)m[h]=f;return[m]}function l(e,t){for(var n=e.length,r=Array(n+1),i=0;i<n;i++)r[i]=e[i]-t;return r[n]=e[n-1]+t,r}function u(e){for(var t=Array(e),n=0;n<e;n++)t[n]=[];return t}var d={text:`tx`,hovertext:`htx`};function f(e,t,n){for(var r in d)a.isArrayOrTypedArray(t[r])&&(Array.isArray(n)?a.isArrayOrTypedArray(t[r][n[0]])&&(e[d[r]]=t[r][n[0]][n[1]]):e[d[r]]=t[r][n])}function p(e,t){if(a.isArrayOrTypedArray(t.selectedpoints))for(var n=0;n<e.length;n++){for(var r=e[n].pts||[],i={},o=0;o<r.length;o++)i[r[o].i]=o;a.tagSelected(r,t,i)}}function m(e,t){return e.v-t.v}function h(e){return e.v}function g(e,t,n){return n===0?e.q1:Math.min(e.q1,t[Math.min(a.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,n-1)])}function _(e,t,n){return n===0?e.q3:Math.max(e.q3,t[Math.max(a.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function v(e){return 4*e.q1-3*e.q3}function y(e){return 4*e.q3-3*e.q1}function b(e,t){return t===0?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}}),ho=h((e,t)=>{var n=sn(),r=$(),i=ar().getAxisGroup,a=[`v`,`h`];function o(e,t){for(var n=e.calcdata,r=t.xaxis,i=t.yaxis,o=0;o<a.length;o++){for(var c=a[o],l=c===`h`?i:r,u=[],d=0;d<n.length;d++){var f=n[d],p=f[0].t,m=f[0].trace;m.visible===!0&&(m.type===`box`||m.type===`candlestick`)&&!p.empty&&(m.orientation||`v`)===c&&m.xaxis===r._id&&m.yaxis===i._id&&u.push(d)}s(`box`,e,u,l)}}function s(e,t,a,o){var s=t.calcdata,c=t._fullLayout,l=o._id,u=l.charAt(0),d,f,p,m=[],h=0;for(d=0;d<a.length;d++)for(p=s[a[d]],f=0;f<p.length;f++)m.push(o.c2l(p[f].pos,!0)),h+=(p[f].pts2||[]).length;if(m.length){var g=r.distinctVals(m);(o.type===`category`||o.type===`multicategory`)&&(g.minDiff=1);var _=g.minDiff/2;n.minDtick(o,g.minDiff,g.vals[0],!0);var v=c[e===`violin`?`_numViolins`:`_numBoxes`],y=c[e+`mode`]===`group`&&v>1,b=1-c[e+`gap`],x=1-c[e+`groupgap`];for(d=0;d<a.length;d++){p=s[a[d]];var S=p[0].trace,C=p[0].t,w=S.width,T=S.side,E,D,O,k;if(w)E=D=k=w/2,O=0;else if(E=_,y){var A=i(c,o._id)+S.orientation,j=(c._alignmentOpts[A]||{})[S.alignmentgroup]||{},M=Object.keys(j.offsetGroups||{}).length,N=M||v,P=M?S._offsetIndex:C.num;D=E*b*x/N,O=2*E*(-.5+(P+.5)/N)*b,k=E*b/N}else D=E*b*x,O=0,k=E;C.dPos=E,C.bPos=O,C.bdPos=D,C.wHover=k;var F,I,L=O+D,R,z,B,V,H,U,W=!!w,G=(S.boxpoints||S.points)&&h>0;if(T===`positive`?(F=E*(w?1:.5),R=L,I=R=O):T===`negative`?(F=R=O,I=E*(w?1:.5),z=L):(F=I=E,R=z=L),G){var K=S.pointpos,q=S.jitter,J=S.marker.size/2,Y=0;K+q>=0&&(Y=L*(K+q),Y>F?(W=!0,H=J,B=Y):Y>R&&(H=J,B=F)),Y<=F&&(B=F);var X=0;K-q<=0&&(X=-L*(K-q),X>I?(W=!0,U=J,V=X):X>z&&(U=J,V=I)),X<=I&&(V=I)}else B=F,V=I;var Z=Array(p.length);for(f=0;f<p.length;f++)Z[f]=p[f].pos;S._extremes[l]=n.findExtremes(o,Z,{padded:W,vpadminus:V,vpadplus:B,vpadLinearized:!0,ppadminus:{x:U,y:H}[u],ppadplus:{x:H,y:U}[u]})}}}t.exports={crossTraceCalc:o,setPositionOffset:s}}),go=h((e,t)=>{var n=S(),r=$(),i=tn(),a=5,o=.01;function s(e,t,i,a){var o=e._context.staticPlot,s=t.xaxis,d=t.yaxis;r.makeTraceGroups(a,i,`trace boxes`).each(function(e){var t=n.select(this),r=e[0],i=r.t,a=r.trace;if(i.wdPos=i.bdPos*a.whiskerwidth,a.visible!==!0||i.empty){t.remove();return}var f,p;a.orientation===`h`?(f=d,p=s):(f=s,p=d),c(t,{pos:f,val:p},a,i,o),l(t,{x:s,y:d},a,i),u(t,{pos:f,val:p},a,i)})}function c(e,t,i,a,o){var s=i.orientation===`h`,c=t.val,l=t.pos,u=!!l.rangebreaks,d=a.bPos,f=a.wdPos||0,p=a.bPosPxOffset||0,m=i.whiskerwidth||0,h=i.showwhiskers!==!1,g=i.notched||!1,_=g?1-2*i.notchwidth:1,v,y;Array.isArray(a.bdPos)?(v=a.bdPos[0],y=a.bdPos[1]):(v=a.bdPos,y=a.bdPos);var b=e.selectAll(`path.box`).data(i.type!==`violin`||i.box.visible?r.identity:[]);b.enter().append(`path`).style(`vector-effect`,o?`none`:`non-scaling-stroke`).attr(`class`,`box`),b.exit().remove(),b.each(function(e){if(e.empty)return n.select(this).attr(`d`,`M0,0Z`);var t=l.c2l(e.pos+d,!0),a=l.l2p(t-v)+p,o=l.l2p(t+y)+p,b=u?(a+o)/2:l.l2p(t)+p,x=i.whiskerwidth,S=u?a*x+(1-x)*b:l.l2p(t-f)+p,C=u?o*x+(1-x)*b:l.l2p(t+f)+p,w=l.l2p(t-v*_)+p,T=l.l2p(t+y*_)+p,E=i.sizemode===`sd`,D=c.c2p(E?e.mean-e.sd:e.q1,!0),O=E?c.c2p(e.mean+e.sd,!0):c.c2p(e.q3,!0),k=r.constrain(E?c.c2p(e.mean,!0):c.c2p(e.med,!0),Math.min(D,O)+1,Math.max(D,O)-1),A=e.lf===void 0||i.boxpoints===!1||E,j=c.c2p(A?e.min:e.lf,!0),M=c.c2p(A?e.max:e.uf,!0),N=c.c2p(e.ln,!0),P=c.c2p(e.un,!0);s?n.select(this).attr(`d`,`M`+k+`,`+w+`V`+T+`M`+D+`,`+a+`V`+o+(g?`H`+N+`L`+k+`,`+T+`L`+P+`,`+o:``)+`H`+O+`V`+a+(g?`H`+P+`L`+k+`,`+w+`L`+N+`,`+a:``)+`Z`+(h?`M`+D+`,`+b+`H`+j+`M`+O+`,`+b+`H`+M+(m===0?``:`M`+j+`,`+S+`V`+C+`M`+M+`,`+S+`V`+C):``)):n.select(this).attr(`d`,`M`+w+`,`+k+`H`+T+`M`+a+`,`+D+`H`+o+(g?`V`+N+`L`+T+`,`+k+`L`+o+`,`+P:``)+`V`+O+`H`+a+(g?`V`+P+`L`+w+`,`+k+`L`+a+`,`+N:``)+`Z`+(h?`M`+b+`,`+D+`V`+j+`M`+b+`,`+O+`V`+M+(m===0?``:`M`+S+`,`+j+`H`+C+`M`+S+`,`+M+`H`+C):``))})}function l(e,t,n,s){var c=t.x,l=t.y,u=s.bdPos,d=s.bPos,f=n.boxpoints||n.points;r.seedPseudoRandom();var p=e.selectAll(`g.points`).data(f?function(e){return e.forEach(function(e){e.t=s,e.trace=n}),e}:[]);p.enter().append(`g`).attr(`class`,`points`),p.exit().remove();var m=p.selectAll(`path`).data(function(e){var t,i=e.pts2,s=Math.max((e.max-e.min)/10,e.q3-e.q1),c=s*1e-9,l=s*o,p=[],m=0,h;if(n.jitter){if(s===0)for(m=1,p=Array(i.length),t=0;t<i.length;t++)p[t]=1;else for(t=0;t<i.length;t++){var g=Math.max(0,t-a),_=i[g].v,v=Math.min(i.length-1,t+a),y=i[v].v;f!==`all`&&(i[t].v<e.lf?y=Math.min(y,e.lf):_=Math.max(_,e.uf));var b=Math.sqrt(l*(v-g)/(y-_+c))||0;b=r.constrain(Math.abs(b),0,1),p.push(b),m=Math.max(b,m)}h=n.jitter*2/(m||1)}for(t=0;t<i.length;t++){var x=i[t],S=x.v,C=n.jitter?h*p[t]*(r.pseudoRandom()-.5):0,w=e.pos+d+u*(n.pointpos+C);n.orientation===`h`?(x.y=w,x.x=S):(x.x=w,x.y=S),f===`suspectedoutliers`&&S<e.uo&&S>e.lo&&(x.so=!0)}return i});m.enter().append(`path`).classed(`point`,!0),m.exit().remove(),m.call(i.translatePoints,c,l)}function u(e,t,i,a){var o=t.val,s=t.pos,c=!!s.rangebreaks,l=a.bPos,u=a.bPosPxOffset||0,d=i.boxmean||(i.meanline||{}).visible,f,p;Array.isArray(a.bdPos)?(f=a.bdPos[0],p=a.bdPos[1]):(f=a.bdPos,p=a.bdPos);var m=e.selectAll(`path.mean`).data(i.type===`box`&&i.boxmean||i.type===`violin`&&i.box.visible&&i.meanline.visible?r.identity:[]);m.enter().append(`path`).attr(`class`,`mean`).style({fill:`none`,"vector-effect":`non-scaling-stroke`}),m.exit().remove(),m.each(function(e){var t=s.c2l(e.pos+l,!0),r=s.l2p(t-f)+u,a=s.l2p(t+p)+u,m=c?(r+a)/2:s.l2p(t)+u,h=o.c2p(e.mean,!0),g=o.c2p(e.mean-e.sd,!0),_=o.c2p(e.mean+e.sd,!0);i.orientation===`h`?n.select(this).attr(`d`,`M`+h+`,`+r+`V`+a+(d===`sd`?`m0,0L`+g+`,`+m+`L`+h+`,`+r+`L`+_+`,`+m+`Z`:``)):n.select(this).attr(`d`,`M`+r+`,`+h+`H`+a+(d===`sd`?`m0,0L`+m+`,`+g+`L`+r+`,`+h+`L`+m+`,`+_+`Z`:``))})}t.exports={plot:s,plotBoxAndWhiskers:c,plotPoints:l,plotBoxMean:u}}),_o=h((e,t)=>{var n=S(),r=q(),i=tn();function a(e,t,a){var o=a||n.select(e).selectAll(`g.trace.boxes`);o.style(`opacity`,function(e){return e[0].trace.opacity}),o.each(function(t){var a=n.select(this),o=t[0].trace,s=o.line.width;function c(e,t,n,i){e.style(`stroke-width`,t+`px`).call(r.stroke,n).call(r.fill,i)}var l=a.selectAll(`path.box`);if(o.type===`candlestick`)l.each(function(e){if(!e.empty){var t=n.select(this),r=o[e.dir];c(t,r.line.width,r.line.color,r.fillcolor),t.style(`opacity`,o.selectedpoints&&!e.selected?.3:1)}});else{c(l,s,o.line.color,o.fillcolor),a.selectAll(`path.mean`).style({"stroke-width":s,"stroke-dasharray":2*s+`px,`+s+`px`}).call(r.stroke,o.line.color);var u=a.selectAll(`path.point`);i.pointStyle(u,o,e)}})}function o(e,t,n){var r=t[0].trace,a=n.selectAll(`path.point`);r.selectedpoints?i.selectedPointStyle(a,r):i.pointStyle(a,r,e)}t.exports={style:a,styleOnSelect:o}}),vo=h((e,t)=>{var n=sn(),r=$(),i=Ln(),a=q(),o=r.fillText;function s(e,t,n,r){var i=e.cd[0].trace.hoveron,a=[],o;return i.indexOf(`boxes`)!==-1&&(a=a.concat(c(e,t,n,r))),i.indexOf(`points`)!==-1&&(o=l(e,t,n)),r===`closest`?o?[o]:a:(o&&a.push(o),a)}function c(e,t,o,s){var c=e.cd,l=e.xa,u=e.ya,d=c[0].trace,f=c[0].t,p=d.type===`violin`,m,h,g,_,v,y,b,x,S,C,w,T=f.bdPos,E,D,O=f.wHover,k=function(e){return g.c2l(e.pos)+f.bPos-g.c2l(y)};p&&d.side!==`both`?(d.side===`positive`&&(S=function(e){var t=k(e);return i.inbox(t,t+O,C)},E=T,D=0),d.side===`negative`&&(S=function(e){var t=k(e);return i.inbox(t-O,t,C)},E=0,D=T)):(S=function(e){var t=k(e);return i.inbox(t-O,t+O,C)},E=D=T);var A=p?function(e){return i.inbox(e.span[0]-v,e.span[1]-v,C)}:function(e){return i.inbox(e.min-v,e.max-v,C)};d.orientation===`h`?(v=t,y=o,b=A,x=S,m=`y`,g=u,h=`x`,_=l):(v=o,y=t,b=S,x=A,m=`x`,g=l,h=`y`,_=u);var j=Math.min(1,T/Math.abs(g.r2c(g.range[1])-g.r2c(g.range[0])));C=e.maxHoverDistance-j,w=e.maxSpikeDistance-j;function M(e){return(b(e)+x(e))/2}var N=i.getDistanceFunction(s,b,x,M);if(i.getClosest(c,N,e),e.index===!1)return[];var P=c[e.index],F=d.line.color,I=(d.marker||{}).color;a.opacity(F)&&d.line.width?e.color=F:a.opacity(I)&&d.boxpoints?e.color=I:e.color=d.fillcolor,e[m+`0`]=g.c2p(P.pos+f.bPos-D,!0),e[m+`1`]=g.c2p(P.pos+f.bPos+E,!0),e[m+`LabelVal`]=P.orig_p===void 0?P.pos:P.orig_p;var L=m+`Spike`;e.spikeDistance=M(P)*w/C,e[L]=g.c2p(P.pos,!0);var R=d.boxmean||d.sizemode===`sd`||(d.meanline||{}).visible,z=d.boxpoints||d.points,B=z&&R?[`max`,`uf`,`q3`,`med`,`mean`,`q1`,`lf`,`min`]:z&&!R?[`max`,`uf`,`q3`,`med`,`q1`,`lf`,`min`]:!z&&R?[`max`,`q3`,`med`,`mean`,`q1`,`min`]:[`max`,`q3`,`med`,`q1`,`min`],V=_.range[1]<_.range[0];d.orientation===(V?`v`:`h`)&&B.reverse();for(var H=e.spikeDistance,U=e[L],W=[],G=0;G<B.length;G++){var K=B[G];if(K in P){var q=P[K],J=_.c2p(q,!0),Y=r.extendFlat({},e);Y.attr=K,Y[h+`0`]=Y[h+`1`]=J,Y[h+`LabelVal`]=q,Y[h+`Label`]=(f.labels?f.labels[K]+` `:``)+n.hoverLabelText(_,q,d[h+`hoverformat`]),Y.hoverOnBox=!0,K===`mean`&&`sd`in P&&(d.boxmean===`sd`||d.sizemode===`sd`)&&(Y[h+`err`]=P.sd),Y.hovertemplate=!1,W.push(Y)}}e.name=``,e.spikeDistance=void 0,e[L]=void 0;for(var X=0;X<W.length;X++)W[X].attr===`med`?(W[X].spikeDistance=H,W[X][L]=U):(W[X].name=``,W[X].spikeDistance=void 0,W[X][L]=void 0);return W}function l(e,t,n){for(var a=e.cd,s=e.xa,c=e.ya,l=a[0].trace,u=s.c2p(t),d=c.c2p(n),f,p=i.quadrature(function(e){var t=Math.max(3,e.mrc||0);return Math.max(Math.abs(s.c2p(e.x)-u)-t,1-3/t)},function(e){var t=Math.max(3,e.mrc||0);return Math.max(Math.abs(c.c2p(e.y)-d)-t,1-3/t)}),m=!1,h,g,_=0;_<a.length;_++){h=a[_];for(var v=0;v<(h.pts||[]).length;v++){g=h.pts[v];var y=p(g);y<=e.distance&&(e.distance=y,m=[_,v])}}if(!m)return!1;h=a[m[0]],g=h.pts[m[1]];var b=s.c2p(g.x,!0),x=c.c2p(g.y,!0),S=g.mrc||1;f=r.extendFlat({},e,{index:g.i,color:(l.marker||{}).color,name:l.name,x0:b-S,x1:b+S,y0:x-S,y1:x+S,spikeDistance:e.distance,hovertemplate:l.hovertemplate});var C=h.orig_p,w=C===void 0?h.pos:C,T;l.orientation===`h`?(T=c,f.xLabelVal=g.x,f.yLabelVal=w):(T=s,f.xLabelVal=w,f.yLabelVal=g.y);var E=T._id.charAt(0);return f[E+`Spike`]=T.c2p(h.pos,!0),o(g,l,f),f}t.exports={hoverPoints:s,hoverOnBoxes:c,hoverOnPoints:l}}),yo=h((e,t)=>{t.exports=function(e,t){return t.hoverOnBox&&(e.hoverOnBox=t.hoverOnBox),`xVal`in t&&(e.x=t.xVal),`yVal`in t&&(e.y=t.yVal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}}),bo=h((e,t)=>{t.exports=function(e,t){var n=e.cd,r=e.xaxis,i=e.yaxis,a=[],o,s;if(t===!1)for(o=0;o<n.length;o++)for(s=0;s<(n[o].pts||[]).length;s++)n[o].pts[s].selected=0;else for(o=0;o<n.length;o++)for(s=0;s<(n[o].pts||[]).length;s++){var c=n[o].pts[s],l=r.c2p(c.x),u=i.c2p(c.y);t.contains([l,u],null,c.i,e)?(a.push({pointNumber:c.i,x:r.c2d(c.x),y:i.c2d(c.y)}),c.selected=1):c.selected=0}return a}}),xo=h((e,t)=>{t.exports={attributes:lo(),layoutAttributes:uo(),supplyDefaults:fo().supplyDefaults,crossTraceDefaults:fo().crossTraceDefaults,supplyLayoutDefaults:po().supplyLayoutDefaults,calc:mo(),crossTraceCalc:ho().crossTraceCalc,plot:go().plot,style:_o().style,styleOnSelect:_o().styleOnSelect,hoverPoints:vo().hoverPoints,eventData:yo(),selectPoints:bo(),moduleType:`trace`,name:`box`,basePlotModule:Ai(),categories:[`cartesian`,`svg`,`symbols`,`oriented`,`box-violin`,`showLegend`,`boxLayout`,`zoomScale`],meta:{}}}),So=h((e,t)=>{t.exports=xo()}),Co=h((e,t)=>{var n=Pt(),{extendFlat:r}=z(),i=W(),{axisHoverFormat:a}=jt(),o=B(),{hovertemplateAttrs:s,templatefallbackAttrs:c,texttemplateAttrs:l}=ze(),u=Tr();t.exports=r({z:{valType:`data_array`,editType:`calc`},x:r({},u.x,{impliedEdits:{xtype:`array`}}),x0:r({},u.x0,{impliedEdits:{xtype:`scaled`}}),dx:r({},u.dx,{impliedEdits:{xtype:`scaled`}}),y:r({},u.y,{impliedEdits:{ytype:`array`}}),y0:r({},u.y0,{impliedEdits:{ytype:`scaled`}}),dy:r({},u.dy,{impliedEdits:{ytype:`scaled`}}),xperiod:r({},u.xperiod,{impliedEdits:{xtype:`scaled`}}),yperiod:r({},u.yperiod,{impliedEdits:{ytype:`scaled`}}),xperiod0:r({},u.xperiod0,{impliedEdits:{xtype:`scaled`}}),yperiod0:r({},u.yperiod0,{impliedEdits:{ytype:`scaled`}}),xperiodalignment:r({},u.xperiodalignment,{impliedEdits:{xtype:`scaled`}}),yperiodalignment:r({},u.yperiodalignment,{impliedEdits:{ytype:`scaled`}}),text:{valType:`data_array`,editType:`calc`},hovertext:{valType:`data_array`,editType:`calc`},transpose:{valType:`boolean`,dflt:!1,editType:`calc`},xtype:{valType:`enumerated`,values:[`array`,`scaled`],editType:`calc+clearAxisTypes`},ytype:{valType:`enumerated`,values:[`array`,`scaled`],editType:`calc+clearAxisTypes`},zsmooth:{valType:`enumerated`,values:[`fast`,`best`,!1],dflt:!1,editType:`calc`},hoverongaps:{valType:`boolean`,dflt:!0,editType:`none`},connectgaps:{valType:`boolean`,editType:`calc`},xgap:{valType:`number`,dflt:0,min:0,editType:`plot`},ygap:{valType:`number`,dflt:0,min:0,editType:`plot`},xhoverformat:a(`x`),yhoverformat:a(`y`),zhoverformat:a(`z`,1),hovertemplate:s(),hovertemplatefallback:c(),texttemplate:l({arrayOk:!1,editType:`plot`},{keys:[`x`,`y`,`z`,`text`]}),texttemplatefallback:c({editType:`plot`}),textfont:o({editType:`plot`,autoSize:!0,autoColor:!0,colorEditType:`style`}),showlegend:r({},i.showlegend,{dflt:!1}),zorder:u.zorder},n(``,{cLetter:`z`,autoColorDflt:!1}))}),wo=h((e,t)=>{var n=D(),r=$(),i=Ke();t.exports=function(e,t,n,s,c,l){var u=n(`z`);c||=`x`,l||=`y`;var d,f;if(u===void 0||!u.length)return 0;if(r.isArray1D(u)){d=n(c),f=n(l);var p=r.minRowLength(d),m=r.minRowLength(f);if(p===0||m===0)return 0;t._length=Math.min(p,m,u.length)}else{if(d=a(c,n),f=a(l,n),!o(u))return 0;n(`transpose`),t._length=null}return i.getComponentMethod(`calendars`,`handleTraceDefaults`)(e,t,[c,l],s),!0};function a(e,t){var n=t(e);return(n?t(e+`type`,`array`):`scaled`)===`scaled`&&(t(e+`0`),t(`d`+e)),n}function o(e){for(var t=!0,i=!1,a=!1,o,s=0;s<e.length;s++){if(o=e[s],!r.isArrayOrTypedArray(o)){t=!1;break}o.length>0&&(i=!0);for(var c=0;c<o.length;c++)if(n(o[c])){a=!0;break}}return t&&i&&a}}),To=h((e,t)=>{var n=$();t.exports=function(e,t){e(`texttemplate`),e(`texttemplatefallback`);var r=n.extendFlat({},t.font,{color:`auto`,size:`auto`});n.coerceFont(e,`textfont`,r)}}),Eo=h((e,t)=>{t.exports=function(e,t,n){n(`zsmooth`)===!1&&(n(`xgap`),n(`ygap`)),n(`zhoverformat`)}}),Do=h((e,t)=>{var n=$(),r=wo(),i=To(),a=qr(),o=Eo(),s=Gt(),c=Co();t.exports=function(e,t,l,u){function d(r,i){return n.coerce(e,t,c,r,i)}if(!r(e,t,d,u)){t.visible=!1;return}a(e,t,u,d),d(`xhoverformat`),d(`yhoverformat`),d(`text`),d(`hovertext`),d(`hovertemplate`),d(`hovertemplatefallback`),i(d,u),o(e,t,d,u),d(`hoverongaps`),d(`connectgaps`,n.isArray1D(t.z)&&t.zsmooth!==!1),s(e,t,u,d,{prefix:``,cLetter:`z`}),d(`zorder`)}}),Oo=h((e,t)=>{var n=D();t.exports={count:function(e,t,n){return n[e]++,1},sum:function(e,t,r,i){var a=i[t];return n(a)?(a=Number(a),r[e]+=a,a):0},avg:function(e,t,r,i,a){var o=i[t];return n(o)&&(o=Number(o),r[e]+=o,a[e]++),0},min:function(e,t,r,i){var a=i[t];if(n(a))if(a=Number(a),n(r[e])){if(r[e]>a){var o=a-r[e];return r[e]=a,o}}else return r[e]=a,a;return 0},max:function(e,t,r,i){var a=i[t];if(n(a))if(a=Number(a),n(r[e])){if(r[e]<a){var o=a-r[e];return r[e]=a,o}}else return r[e]=a,a;return 0}}}),ko=h((e,t)=>{t.exports={percent:function(e,t){for(var n=e.length,r=100/t,i=0;i<n;i++)e[i]*=r},probability:function(e,t){for(var n=e.length,r=0;r<n;r++)e[r]/=t},density:function(e,t,n,r){var i=e.length;r||=1;for(var a=0;a<i;a++)e[a]*=n[a]*r},"probability density":function(e,t,n,r){var i=e.length;r&&(t/=r);for(var a=0;a<i;a++)e[a]*=n[a]/t}}}),Ao=h((e,t)=>{t.exports=function(e,t){for(var n=e.length,r=0,i=0;i<n;i++)t[i]?(e[i]/=t[i],r+=e[i]):e[i]=null;return r}}),jo=h((e,t)=>{var n=O(),r=n.ONEAVGYEAR,i=n.ONEAVGMONTH,a=n.ONEDAY,o=n.ONEHOUR,s=n.ONEMIN,c=n.ONESEC,l=sn().tickIncrement;t.exports=function(e,t,n,i,o){var s=-1.1*t,c=-.1*t,d=e-c,f=n[0],p=n[1],m=Math.min(u(f+c,f+d,i,o),u(p+c,p+d,i,o)),h=Math.min(u(f+s,f+c,i,o),u(p+s,p+c,i,o)),g,_;if(m>h&&h<Math.abs(p-f)/4e3?(g=m,_=!1):(g=Math.min(m,h),_=!0),i.type===`date`&&g>a){var v=g===r?1:6,y=g===r?`M12`:`M1`;return function(t,n){var a=i.c2d(t,r,o),s=a.indexOf(`-`,v);s>0&&(a=a.slice(0,s));var c=i.d2c(a,0,o);if(c<t){var u=l(c,y,!1,o);(c+u)/2<t+e&&(c=u)}return n&&_?l(c,y,!0,o):c}}return function(t,n){var r=g*Math.round(t/g);return r+g/10<t&&r+g*.9<t+e&&(r+=g),n&&_&&(r-=g),r}};function u(e,t,n,r){if(e*t<=0)return 1/0;for(var i=Math.abs(t-e),a=n.type===`date`,o=d(i,a),s=0;s<10;s++){var c=d(o*80,a);if(o===c)break;if(f(c,e,t,a,n,r))o=c;else break}return o}function d(e,t){return t&&e>c?e>a?e>r*1.1?r:e>i*1.1?i:a:e>o?o:e>s?s:c:10**Math.floor(Math.log(e)/Math.LN10)}function f(e,t,n,i,o,s){if(i&&e>a){var c=p(t,o,s),l=p(n,o,s),u=e===r?0:1;return c[u]!==l[u]}return Math.floor(n/e)-Math.floor(t/e)>.1}function p(e,t,n){var i=t.c2d(e,r,n).split(`-`);return i[0]===``&&(i.unshift(),i[0]=`-`+i[0]),i}}),Mo=h((e,t)=>{var n=D(),r=$(),i=Ke(),a=sn(),{hasColorscale:o}=At(),s=Jt(),c=Qa(),l=Oo(),u=ko(),d=Ao(),f=jo();function p(e,t){var i=[],p=[],h=t.orientation===`h`,g=a.getFromId(e,h?t.yaxis:t.xaxis),v=h?`y`:`x`,y={x:`y`,y:`x`}[v],b=t[v+`calendar`],x=t.cumulative,S,C=m(e,t,g,v),w=C[0],T=C[1],E=typeof w.size==`string`,D=[],O=E?D:w,k=[],A=[],j=[],M=0,N=t.histnorm,P=t.histfunc,F=N.indexOf(`density`)!==-1,I,L,R;x.enabled&&F&&(N=N.replace(/ ?density$/,``),F=!1);var z=P===`max`||P===`min`?null:0,B=l.count,V=u[N],H=!1,U=function(e){return g.r2c(e,0,b)},W;for(r.isArrayOrTypedArray(t[y])&&P!==`count`&&(W=t[y],H=P===`avg`,B=l[P]),S=U(w.start),L=U(w.end)+(S-a.tickIncrement(S,w.size,!1,b))/1e6;S<L&&i.length<1e6&&(I=a.tickIncrement(S,w.size,!1,b),i.push((S+I)/2),p.push(z),j.push([]),D.push(S),F&&k.push(1/(I-S)),H&&A.push(0),!(I<=S));)S=I;D.push(S),!E&&g.type===`date`&&(O={start:U(O.start),end:U(O.end),size:O.size}),e._fullLayout._roundFnOpts||(e._fullLayout._roundFnOpts={});var G=t[`_`+v+`bingroup`],K={leftGap:1/0,rightGap:1/0};G&&(e._fullLayout._roundFnOpts[G]||(e._fullLayout._roundFnOpts[G]=K),K=e._fullLayout._roundFnOpts[G]);var q=p.length,J=!0,Y=K.leftGap,X=K.rightGap,Z={};for(S=0;S<T.length;S++){var Q=T[S];R=r.findBin(Q,O),R>=0&&R<q&&(M+=B(R,S,p,W,A),J&&j[R].length&&Q!==T[j[R][0]]&&(J=!1),j[R].push(S),Z[S]=R,Y=Math.min(Y,Q-D[R]),X=Math.min(X,D[R+1]-Q))}K.leftGap=Y,K.rightGap=X;var ee;J||(ee=function(t,n){return function(){var r=e._fullLayout._roundFnOpts[G];return f(r.leftGap,r.rightGap,D,g,b)(t,n)}}),H&&(M=d(p,A)),V&&V(p,M,k),x.enabled&&_(p,x.direction,x.currentbin);var te=Math.min(i.length,p.length),ne=[],re=0,ie=te-1;for(S=0;S<te;S++)if(p[S]){re=S;break}for(S=te-1;S>=re;S--)if(p[S]){ie=S;break}for(S=re;S<=ie;S++)if(n(i[S])&&n(p[S])){var ae={p:i[S],s:p[S],b:0};x.enabled||(ae.pts=j[S],J?ae.ph0=ae.ph1=j[S].length?T[j[S][0]]:i[S]:(t._computePh=!0,ae.ph0=ee(D[S]),ae.ph1=ee(D[S+1],!0))),ne.push(ae)}return ne.length===1&&(ne[0].width1=a.tickIncrement(ne[0].p,w.size,!1,b)-ne[0].p),o(t,`marker`)&&s(e,t,{vals:t.marker.color,containerStr:`marker`,cLetter:`c`}),o(t,`marker.line`)&&s(e,t,{vals:t.marker.line.color,containerStr:`marker.line`,cLetter:`c`}),c(ne,t),r.isArrayOrTypedArray(t.selectedpoints)&&r.tagSelected(ne,t,Z),ne}function m(e,t,o,s,c){var l=s+`bins`,u=e._fullLayout,d=t[`_`+s+`bingroup`],f=u._histogramBinOpts[d],p=u.barmode===`overlay`,m,g,_,v,y,b,x,S=function(e){return o.r2c(e,0,v)},C=function(e){return o.c2r(e,0,v)},w=o.type===`date`?function(e){return e||e===0?r.cleanDate(e,null,v):null}:function(e){return n(e)?Number(e):null};function T(e,t,n){t[e+`Found`]?(t[e]=w(t[e]),t[e]===null&&(t[e]=n[e])):(b[e]=t[e]=n[e],r.nestedProperty(g[0],l+`.`+e).set(n[e]))}if(t[`_`+s+`autoBinFinished`])delete t[`_`+s+`autoBinFinished`];else{g=f.traces;var E=[],D=!0,O=!1,k=!1;for(m=0;m<g.length;m++)if(_=g[m],_.visible){var A=f.dirs[m];y=_[`_`+A+`pos0`]=o.makeCalcdata(_,A),E=r.concat(E,y),delete _[`_`+s+`autoBinFinished`],t.visible===!0&&(D?D=!1:(delete _._autoBin,_[`_`+s+`autoBinFinished`]=1),i.traceIs(_,`2dMap`)&&(O=!0),_.type===`histogram2dcontour`&&(k=!0))}v=g[0][s+`calendar`];var j=a.autoBin(E,o,f.nbins,O,v,f.sizeFound&&f.size),M=g[0]._autoBin={};if(b=M[f.dirs[0]]={},k&&(f.size||(j.start=C(a.tickIncrement(S(j.start),j.size,!0,v))),f.end===void 0&&(j.end=C(a.tickIncrement(S(j.end),j.size,!1,v)))),p&&!i.traceIs(t,`2dMap`)&&j._dataSpan===0&&o.type!==`category`&&o.type!==`multicategory`&&t.bingroup===``&&t.xbins===void 0){if(c)return[j,y,!0];j=h(e,t,o,s,l)}x=_.cumulative||{},x.enabled&&x.currentbin!==`include`&&(x.direction===`decreasing`?j.start=C(a.tickIncrement(S(j.start),j.size,!0,v)):j.end=C(a.tickIncrement(S(j.end),j.size,!1,v))),f.size=j.size,f.sizeFound||(b.size=j.size,r.nestedProperty(g[0],l+`.size`).set(j.size)),T(`start`,f,j),T(`end`,f,j)}y=t[`_`+s+`pos0`],delete t[`_`+s+`pos0`];var N=t._input[l]||{},P=r.extendFlat({},f),F=f.start,I=o.r2l(N.start),L=I!==void 0;if((f.startFound||L)&&I!==o.r2l(F)){var R=L?I:r.aggNums(Math.min,null,y),z={type:o.type===`category`||o.type===`multicategory`?`linear`:o.type,r2l:o.r2l,dtick:f.size,tick0:F,calendar:v,range:[R,a.tickIncrement(R,f.size,!1,v)].map(o.l2r)},B=a.tickFirst(z);B>o.r2l(R)&&(B=a.tickIncrement(B,f.size,!0,v)),P.start=o.l2r(B),L||r.nestedProperty(t,l+`.start`).set(P.start)}var V=f.end,H=o.r2l(N.end),U=H!==void 0;if((f.endFound||U)&&H!==o.r2l(V)){var W=U?H:r.aggNums(Math.max,null,y);P.end=o.l2r(W),U||r.nestedProperty(t,l+`.start`).set(P.end)}var G=`autobin`+s;return t._input[G]===!1&&(t._input[l]=r.extendFlat({},t[l]||{}),delete t._input[G],delete t[G]),[P,y]}function h(e,t,n,i,a){var o=e._fullLayout,s=g(e,t),c=!1,l=1/0,u=[t],d,f,p;for(d=0;d<s.length;d++)if(f=s[d],f===t)c=!0;else if(!c)p=o._histogramBinOpts[f[`_`+i+`bingroup`]],l=Math.min(l,p.size||f[a].size);else{var h=m(e,f,n,i,!0),_=h[0],v=h[2];f[`_`+i+`autoBinFinished`]=1,f[`_`+i+`pos0`]=h[1],v?u.push(f):l=Math.min(l,_.size)}var y=Array(u.length);for(d=0;d<u.length;d++)for(var b=u[d][`_`+i+`pos0`],x=0;x<b.length;x++)if(b[x]!==void 0){y[d]=b[x];break}for(isFinite(l)||(l=r.distinctVals(y).minDiff),d=0;d<u.length;d++){f=u[d];var S=f[i+`calendar`],C={start:n.c2r(y[d]-l/2,0,S),end:n.c2r(y[d]+l/2,0,S),size:l};f._input[a]=f[a]=C,p=o._histogramBinOpts[f[`_`+i+`bingroup`]],p&&r.extendFlat(p,C)}return t[a]}function g(e,t){for(var n=t.xaxis,r=t.yaxis,i=t.orientation,a=[],o=e._fullData,s=0;s<o.length;s++){var c=o[s];c.type===`histogram`&&c.visible===!0&&c.orientation===i&&c.xaxis===n&&c.yaxis===r&&a.push(c)}return a}function _(e,t,n){var r,i,a;function o(t){a=e[t],e[t]/=2}function s(t){i=e[t],e[t]=a+i/2,a+=i}if(n===`half`)if(t===`increasing`)for(o(0),r=1;r<e.length;r++)s(r);else for(o(e.length-1),r=e.length-2;r>=0;r--)s(r);else if(t===`increasing`){for(r=1;r<e.length;r++)e[r]+=e[r-1];n===`exclude`&&(e.unshift(0),e.pop())}else{for(r=e.length-2;r>=0;r--)e[r]+=e[r+1];n===`exclude`&&(e.push(0),e.shift())}}t.exports={calc:p,calcAllAutoBins:m}}),No=h((e,t)=>{var n=$(),r=sn(),i=Oo(),a=ko(),o=Ao(),s=jo(),c=Mo().calcAllAutoBins;t.exports=function(e,t){var s=r.getFromId(e,t.xaxis),f=r.getFromId(e,t.yaxis),p=t.xcalendar,m=t.ycalendar,h=function(e){return s.r2c(e,0,p)},g=function(e){return f.r2c(e,0,m)},_=function(e){return s.c2r(e,0,p)},v=function(e){return f.c2r(e,0,m)},y,b,x,S,C=c(e,t,s,`x`),w=C[0],T=C[1],E=c(e,t,f,`y`),D=E[0],O=E[1],k=t._length;T.length>k&&T.splice(k,T.length-k),O.length>k&&O.splice(k,O.length-k);var A=[],j=[],M=[],N=typeof w.size==`string`,P=typeof D.size==`string`,F=[],I=[],L=N?F:w,R=P?I:D,z=0,B=[],V=[],H=t.histnorm,U=t.histfunc,W=H.indexOf(`density`)!==-1,G=U===`max`||U===`min`?null:0,K=i.count,q=a[H],J=!1,Y=[],X=[],Z=`z`in t?t.z:`marker`in t&&Array.isArray(t.marker.color)?t.marker.color:``;Z&&U!==`count`&&(J=U===`avg`,K=i[U]);var Q=w.size,ee=h(w.start),te=h(w.end)+(ee-r.tickIncrement(ee,Q,!1,p))/1e6;for(y=ee;y<te;y=r.tickIncrement(y,Q,!1,p))j.push(G),F.push(y),J&&M.push(0);F.push(y);var ne=j.length,re=(y-ee)/ne,ie=_(ee+re/2),ae=D.size,oe=g(D.start),se=g(D.end)+(oe-r.tickIncrement(oe,ae,!1,m))/1e6;for(y=oe;y<se;y=r.tickIncrement(y,ae,!1,m)){A.push(j.slice()),I.push(y);var ce=Array(ne);for(b=0;b<ne;b++)ce[b]=[];V.push(ce),J&&B.push(M.slice())}I.push(y);var le=A.length,ue=(y-oe)/le,de=v(oe+ue/2);W&&(Y=l(j.length,L,re,N),X=l(A.length,R,ue,P)),!N&&s.type===`date`&&(L=u(h,L)),!P&&f.type===`date`&&(R=u(g,R));var fe=!0,pe=!0,me=Array(ne),he=Array(le),ge=1/0,_e=1/0,ve=1/0,ye=1/0;for(y=0;y<k;y++){var be=T[y],xe=O[y];x=n.findBin(be,L),S=n.findBin(xe,R),x>=0&&x<ne&&S>=0&&S<le&&(z+=K(x,y,A[S],Z,B[S]),V[S][x].push(y),fe&&(me[x]===void 0?me[x]=be:me[x]!==be&&(fe=!1)),pe&&(he[S]===void 0?he[S]=xe:he[S]!==xe&&(pe=!1)),ge=Math.min(ge,be-F[x]),_e=Math.min(_e,F[x+1]-be),ve=Math.min(ve,xe-I[S]),ye=Math.min(ye,I[S+1]-xe))}if(J)for(S=0;S<le;S++)z+=o(A[S],B[S]);if(q)for(S=0;S<le;S++)q(A[S],z,Y,X[S]);return{x:T,xRanges:d(F,fe&&me,ge,_e,s,p),x0:ie,dx:re,y:O,yRanges:d(I,pe&&he,ve,ye,f,m),y0:de,dy:ue,z:A,pts:V}};function l(e,t,n,r){var i=Array(e),a;if(r)for(a=0;a<e;a++)i[a]=1/(t[a+1]-t[a]);else{var o=1/n;for(a=0;a<e;a++)i[a]=o}return i}function u(e,t){return{start:e(t.start),end:e(t.end),size:t.size}}function d(e,t,n,r,i,a){var o,c=e.length-1,l=Array(c),u=s(n,r,e,i,a);for(o=0;o<c;o++){var d=(t||[])[o];l[o]=d===void 0?[u(e[o]),u(e[o+1],!0)]:[d,d]}return l}}),Po=h((e,t)=>{var n=$(),r=O().BADNUM,i=ii();t.exports=function(e,t,a,o,s,c){var l=e._length,u=t.makeCalcdata(e,o),d=a.makeCalcdata(e,s);u=i(e,t,o,u).vals,d=i(e,a,s,d).vals;var f=e.text,p=f!==void 0&&n.isArray1D(f),m=e.hovertext,h=m!==void 0&&n.isArray1D(m),g,_,v=n.distinctVals(u),y=v.vals,b=n.distinctVals(d),x=b.vals,S=[],C,w,T=x.length,E=y.length;for(g=0;g<c.length;g++)S[g]=n.init2dArray(T,E);p&&(C=n.init2dArray(T,E)),h&&(w=n.init2dArray(T,E));var D=n.init2dArray(T,E);for(g=0;g<l;g++)if(u[g]!==r&&d[g]!==r){var O=n.findBin(u[g]+v.minDiff/2,y),k=n.findBin(d[g]+b.minDiff/2,x);for(_=0;_<c.length;_++){var A=e[c[_]],j=S[_];j[k][O]=A[g],D[k][O]=g}p&&(C[k][O]=f[g]),h&&(w[k][O]=m[g])}for(e[`_`+o]=y,e[`_`+s]=x,_=0;_<c.length;_++)e[`_`+c[_]]=S[_];p&&(e._text=C),h&&(e._hovertext=w),t&&t.type===`category`&&(e[`_`+o+`CategoryMap`]=y.map(function(e){return t._categories[e]})),a&&a.type===`category`&&(e[`_`+s+`CategoryMap`]=x.map(function(e){return a._categories[e]})),e._after2before=D}}),Fo=h((e,t)=>{var n=D(),r=$(),i=O().BADNUM;t.exports=function(e,t,a,o){var s,c,l,u,d,f;function p(e){if(n(e))return+e}if(t&&t.transpose){for(s=0,d=0;d<e.length;d++)s=Math.max(s,e[d].length);if(s===0)return!1;l=function(e){return e.length},u=function(e,t,n){return(e[n]||[])[t]}}else s=e.length,l=function(e,t){return e[t].length},u=function(e,t,n){return(e[t]||[])[n]};var m=function(e,t,n){return t===i||n===i?i:u(e,t,n)};function h(e){if(t&&t.type!==`carpet`&&t.type!==`contourcarpet`&&e&&e.type===`category`&&t[`_`+e._id.charAt(0)].length){var n=e._id.charAt(0),a={},o=t[`_`+n+`CategoryMap`]||t[n];for(d=0;d<o.length;d++)a[o[d]]=d;return function(t){var n=a[e._categories[t]];return n+1?n:i}}else return r.identity}var g=h(a),_=h(o);o&&o.type===`category`&&(s=o._categories.length);var v=Array(s);for(d=0;d<s;d++)for(c=a&&a.type===`category`?a._categories.length:l(e,d),v[d]=Array(c),f=0;f<c;f++)v[d][f]=p(m(e,_(d),g(f)));return v}}),Io=h((e,t)=>{var n=$(),r=.01,i=[[-1,0],[1,0],[0,-1],[0,1]];function a(e){return .5-.25*Math.min(1,e*.5)}t.exports=function(e,t){var i=1,s;for(o(e,t),s=0;s<t.length&&!(t[s][2]<4);s++);for(t=t.slice(s),s=0;s<100&&i>r;s++)i=o(e,t,a(i));return i>r&&n.log(`interp2d didn't converge quickly`,i),e};function o(e,t,n){var r=0,a,o,s,c,l,u,d,f,p,m,h,g,_;for(c=0;c<t.length;c++){for(a=t[c],o=a[0],s=a[1],h=e[o][s],m=0,p=0,l=0;l<4;l++)u=i[l],d=e[o+u[0]],d&&(f=d[s+u[1]],f!==void 0&&(m===0?g=_=f:(g=Math.min(g,f),_=Math.max(_,f)),p++,m+=f));if(p===0)throw`iterateInterp2d order is wrong: no defined neighbors`;e[o][s]=m/p,h===void 0?p<4&&(r=1):(e[o][s]=(1+n)*e[o][s]-n*h,_>g&&(r=Math.max(r,Math.abs(e[o][s]-h)/(_-g))))}return r}}),Lo=h((e,t)=>{var n=$().maxRowLength;t.exports=function(e){var t=[],r={},i=[],a=e[0],o=[],s=[0,0,0],c=n(e),l,u,d,f,p,m,h,g;for(u=0;u<e.length;u++)for(l=o,o=a,a=e[u+1]||[],d=0;d<c;d++)o[d]===void 0&&(m=(o[d-1]===void 0?0:1)+(o[d+1]===void 0?0:1)+(l[d]===void 0?0:1)+(a[d]===void 0?0:1),m?(u===0&&m++,d===0&&m++,u===e.length-1&&m++,d===o.length-1&&m++,m<4&&(r[[u,d]]=[u,d,m]),t.push([u,d,m])):i.push([u,d]));for(;i.length;){for(h={},g=!1,p=i.length-1;p>=0;p--)f=i[p],u=f[0],d=f[1],m=((r[[u-1,d]]||s)[2]+(r[[u+1,d]]||s)[2]+(r[[u,d-1]]||s)[2]+(r[[u,d+1]]||s)[2])/20,m&&(h[f]=[u,d,m],i.splice(p,1),g=!0);if(!g)throw`findEmpties iterated with no new neighbors`;for(f in h)r[f]=h[f],t.push(h[f])}return t.sort(function(e,t){return t[2]-e[2]})}}),Ro=h((e,t)=>{var n=Ke(),r=$().isArrayOrTypedArray;t.exports=function(e,t,i,a,o,s){var c=[],l=n.traceIs(e,`contour`),u=n.traceIs(e,`histogram`),d,f,p;if(r(t)&&t.length>1&&!u&&s.type!==`category`){var m=t.length;if(m<=o){if(l)c=Array.from(t).slice(0,o);else if(o===1)c=s.type===`log`?[.5*t[0],2*t[0]]:[t[0]-.5,t[0]+.5];else if(s.type===`log`){for(c=[t[0]**1.5/t[1]**.5],p=1;p<m;p++)c.push(Math.sqrt(t[p-1]*t[p]));c.push(t[m-1]**1.5/t[m-2]**.5)}else{for(c=[1.5*t[0]-.5*t[1]],p=1;p<m;p++)c.push((t[p-1]+t[p])*.5);c.push(1.5*t[m-1]-.5*t[m-2])}if(m<o){var h=c[c.length-1],g;if(s.type===`log`)for(g=h/c[c.length-2],p=m;p<o;p++)h*=g,c.push(h);else for(g=h-c[c.length-2],p=m;p<o;p++)h+=g,c.push(h)}}else return l?t.slice(0,o):t.slice(0,o+1)}else{var _=e[s._id.charAt(0)+`calendar`];for(d=u?s.r2c(i,0,_):r(t)&&t.length===1?t[0]:i===void 0?0:(s.type===`log`?s.d2c:s.r2c)(i,0,_),f=a||1,p=l?0:-.5;p<o;p++)c.push(d+f*p)}return c}}),zo=h((e,t)=>{var n=Ke(),r=$(),i=sn(),a=ii(),o=No(),s=Jt(),c=Po(),l=Fo(),u=Io(),d=Lo(),f=Ro(),p=O().BADNUM;t.exports=function(e,t){var p=i.getFromId(e,t.xaxis||`x`),g=i.getFromId(e,t.yaxis||`y`),_=n.traceIs(t,`contour`),v=n.traceIs(t,`histogram`),y=_?`best`:t.zsmooth,b,x,S,C,w,T,E,D,O,k,A;if(p._minDtick=0,g._minDtick=0,v)A=o(e,t),C=A.orig_x,b=A.x,x=A.x0,S=A.dx,D=A.orig_y,w=A.y,T=A.y0,E=A.dy,O=A.z;else{var j=t.z;r.isArray1D(j)?(c(t,p,g,`x`,`y`,[`z`]),b=t._x,w=t._y,j=t._z):(C=t.x?p.makeCalcdata(t,`x`):[],D=t.y?g.makeCalcdata(t,`y`):[],b=a(t,p,`x`,C).vals,w=a(t,g,`y`,D).vals,t._x=b,t._y=w),x=t.x0,S=t.dx,T=t.y0,E=t.dy,O=l(j,t,p,g)}(p.rangebreaks||g.rangebreaks)&&(O=h(b,w,O),v||(b=m(b),w=m(w),t._x=b,t._y=w)),!v&&(_||t.connectgaps)&&(t._emptypoints=d(O),u(O,t._emptypoints));function M(e){y=t._input.zsmooth=t.zsmooth=!1,r.warn(`cannot use zsmooth: "fast": `+e)}function N(e){if(e.length>1){var t=(e[e.length-1]-e[0])/(e.length-1),n=Math.abs(t/100);for(k=0;k<e.length-1;k++)if(Math.abs(e[k+1]-e[k]-t)>n)return!1}return!0}t._islinear=!1,p.type===`log`||g.type===`log`?y===`fast`&&M(`log axis found`):N(b)?N(w)?t._islinear=!0:y===`fast`&&M(`y scale is not linear`):y===`fast`&&M(`x scale is not linear`);var P=r.maxRowLength(O),F=t.xtype===`scaled`?``:b,I=f(t,F,x,S,P,p),L=t.ytype===`scaled`?``:w,R=f(t,L,T,E,O.length,g);t._extremes[p._id]=i.findExtremes(p,I),t._extremes[g._id]=i.findExtremes(g,R);var z={x:I,y:R,z:O,text:t._text||t.text,hovertext:t._hovertext||t.hovertext};if(t.xperiodalignment&&C&&(z.orig_x=C),t.yperiodalignment&&D&&(z.orig_y=D),F&&F.length===I.length-1&&(z.xCenter=F),L&&L.length===R.length-1&&(z.yCenter=L),v&&(z.xRanges=A.xRanges,z.yRanges=A.yRanges,z.pts=A.pts),_||s(e,t,{vals:O,cLetter:`z`}),_&&t.contours&&t.contours.coloring===`heatmap`){var B={type:t.type===`contour`?`heatmap`:`histogram2d`,xcalendar:t.xcalendar,ycalendar:t.ycalendar};z.xfill=f(B,F,x,S,P,p),z.yfill=f(B,L,T,E,O.length,g)}return[z]};function m(e){for(var t=[],n=e.length,r=0;r<n;r++){var i=e[r];i!==p&&t.push(i)}return t}function h(e,t,n){for(var r=[],i=-1,a=0;a<n.length;a++)if(t[a]!==p){i++,r[i]=[];for(var o=0;o<n[a].length;o++)e[o]!==p&&r[i].push(n[a][o])}return r}}),Bo=h(e=>{e.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`]],e.STYLE=e.CSS_DECLARATIONS.map(function(e){return e.join(`: `)+`; `}).join(``)}),Vo=h((e,t)=>{var n=Bo(),r=tn(),i=$(),a=null;function o(){if(a!==null)return a;a=!1;var e=i.isSafari()||i.isMacWKWebView()||i.isIOS();if(window.navigator.userAgent&&!e){var t=Array.from(n.CSS_DECLARATIONS).reverse(),o=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof o==`function`)a=t.some(function(e){return o.apply(null,e)});else{var s=r.tester.append(`image`).attr(`style`,n.STYLE),c=window.getComputedStyle(s.node()).imageRendering;a=t.some(function(e){var t=e[1];return c===t||c===t.toLowerCase()}),s.remove()}}return a}t.exports=o}),Ho=h((e,t)=>{var n=S(),r=R(),i=Ke(),a=tn(),o=sn(),s=$(),c=kt(),l=_i(),u=q(),d=Yt().extractOpts,f=Yt().makeColorScaleFuncFromTrace,p=Dt(),m=Ot().LINE_SPACING,h=Vo(),g=Bo().STYLE,_=`heatmap-label`;function v(e){return e.selectAll(`g.`+_)}function y(e){v(e).remove()}t.exports=function(e,t,S,w){var T=t.xaxis,E=t.yaxis;s.makeTraceGroups(w,S,`hm`).each(function(t){var S=n.select(this),w=t[0],D=w.trace,O=D.xgap||0,k=D.ygap||0,A=w.z,j=w.x,M=w.y,N=w.xCenter,P=w.yCenter,F=i.traceIs(D,`contour`),I=F?`best`:D.zsmooth,L=A.length,R=s.maxRowLength(A),z=!1,B=!1,V,H,U,W,G,K,q,J;for(K=0;V===void 0&&K<j.length-1;)V=T.c2p(j[K]),K++;for(K=j.length-1;H===void 0&&K>0;)H=T.c2p(j[K]),K--;for(H<V&&(U=H,H=V,V=U,z=!0),K=0;W===void 0&&K<M.length-1;)W=E.c2p(M[K]),K++;for(K=M.length-1;G===void 0&&K>0;)G=E.c2p(M[K]),K--;G<W&&(U=W,W=G,G=U,B=!0),F&&(N=j,P=M,j=w.xfill,M=w.yfill);var Y=`default`;if(I?Y=I===`best`?`smooth`:`fast`:D._islinear&&O===0&&k===0&&h()&&(Y=`fast`),Y!==`fast`){var X=I===`best`?0:.5;V=Math.max(-X*T._length,V),H=Math.min((1+X)*T._length,H),W=Math.max(-X*E._length,W),G=Math.min((1+X)*E._length,G)}var Z=Math.round(H-V),Q=Math.round(G-W);if(V>=T._length||H<=0||W>=E._length||G<=0){S.selectAll(`image`).data([]).exit().remove(),y(S);return}var ee,te;Y===`fast`?(ee=R,te=L):(ee=Z,te=Q);var ne=document.createElement(`canvas`);ne.width=ee,ne.height=te;var re=ne.getContext(`2d`,{willReadFrequently:!0}),ie=f(D,{noNumericCheck:!0,returnArray:!0}),ae,oe;Y===`fast`?(ae=z?function(e){return R-1-e}:s.identity,oe=B?function(e){return L-1-e}:s.identity):(ae=function(e){return s.constrain(Math.round(T.c2p(j[e])-V),0,Z)},oe=function(e){return s.constrain(Math.round(E.c2p(M[e])-W),0,Q)});var se=oe(0),ce=[se,se],le=z?0:1,ue=B?0:1,de=0,fe=0,pe=0,me=0,he,ge,_e,ve,ye;function be(e,t){if(e!==void 0){var n=ie(e);return n[0]=Math.round(n[0]),n[1]=Math.round(n[1]),n[2]=Math.round(n[2]),de+=t,fe+=n[0]*t,pe+=n[1]*t,me+=n[2]*t,n}return[0,0,0,0]}function xe(e,t,n,r){var i=e[n.bin0];if(i===void 0)return be(void 0,1);var a=e[n.bin1],o=t[n.bin0],s=t[n.bin1],c=a-i||0,l=o-i||0,u;return u=a===void 0?s===void 0?0:o===void 0?2*(s-i):(2*s-o-i)*2/3:s===void 0?o===void 0?0:(2*i-a-o)*2/3:o===void 0?(2*s-a-i)*2/3:s+i-a-o,be(i+n.frac*c+r.frac*(l+n.frac*u))}if(Y!==`default`){var Se=0,Ce;try{Ce=new Uint8Array(ee*te*4)}catch{Ce=Array(ee*te*4)}if(Y===`smooth`){var we=N||j,Te=P||M,Ee=Array(we.length),De=Array(Te.length),Oe=Array(Z),ke=N?x:b,Ae=P?x:b,je,Me,Ne;for(K=0;K<we.length;K++)Ee[K]=Math.round(T.c2p(we[K])-V);for(K=0;K<Te.length;K++)De[K]=Math.round(E.c2p(Te[K])-W);for(K=0;K<Z;K++)Oe[K]=ke(K,Ee);for(q=0;q<Q;q++)for(je=Ae(q,De),Me=A[je.bin0],Ne=A[je.bin1],K=0;K<Z;K++,Se+=4)ye=xe(Me,Ne,Oe[K],je),C(Ce,Se,ye)}else for(q=0;q<L;q++)for(ve=A[q],ce=oe(q),K=0;K<R;K++)ye=be(ve[K],1),Se=(ce*R+ae(K))*4,C(Ce,Se,ye);var Pe=re.createImageData(ee,te);try{Pe.data.set(Ce)}catch{var Fe=Pe.data,Ie=Fe.length;for(q=0;q<Ie;q++)Fe[q]=Ce[q]}re.putImageData(Pe,0,0)}else{var Le=Math.floor(O/2),Re=Math.floor(k/2);for(q=0;q<L;q++)if(ve=A[q],ce.reverse(),ce[ue]=oe(q+1),!(ce[0]===ce[1]||ce[0]===void 0||ce[1]===void 0))for(ge=ae(0),he=[ge,ge],K=0;K<R;K++)he.reverse(),he[le]=ae(K+1),!(he[0]===he[1]||he[0]===void 0||he[1]===void 0)&&(_e=ve[K],ye=be(_e,(he[1]-he[0])*(ce[1]-ce[0])),re.fillStyle=`rgba(`+ye.join(`,`)+`)`,re.fillRect(he[0]+Le,ce[0]+Re,he[1]-he[0]-O,ce[1]-ce[0]-k))}fe=Math.round(fe/de),pe=Math.round(pe/de),me=Math.round(me/de);var ze=r(`rgb(`+fe+`,`+pe+`,`+me+`)`);e._hmpixcount=(e._hmpixcount||0)+de,e._hmlumcount=(e._hmlumcount||0)+de*ze.getLuminance();var Be=S.selectAll(`image`).data(t);Be.enter().append(`svg:image`).attr({xmlns:p.svg,preserveAspectRatio:`none`}),Be.attr({height:Q,width:Z,x:V,y:W,"xlink:href":ne.toDataURL(`image/png`)}),Y===`fast`&&!I&&Be.attr(`style`,g),y(S);var Ve=D.texttemplate;if(Ve){var He=d(D),Ue={type:`linear`,range:[He.min,He.max],_separators:T._separators,_numFormat:T._numFormat},We=D.type===`histogram2dcontour`,Ge=D.type===`contour`,Ke=Ge?1:0,qe=Ge?L-1:L,Je=Ge?1:0,Ye=Ge?R-1:R,Xe=[];for(K=Ke;K<qe;K++){var Ze;if(Ge)Ze=w.y[K];else if(We){if(K===0||K===L-1)continue;Ze=w.y[K]}else if(w.yCenter)Ze=w.yCenter[K];else{if(K+1===L&&w.y[K+1]===void 0)continue;Ze=(w.y[K]+w.y[K+1])/2}var Qe=Math.round(E.c2p(Ze));if(!(0>Qe||Qe>E._length))for(q=Je;q<Ye;q++){var $e;if(Ge)$e=w.x[q];else if(We){if(q===0||q===R-1)continue;$e=w.x[q]}else if(w.xCenter)$e=w.xCenter[q];else{if(q+1===R&&w.x[q+1]===void 0)continue;$e=(w.x[q]+w.x[q+1])/2}var et=Math.round(T.c2p($e));if(!(0>et||et>T._length)){var tt=l({x:$e,y:Ze},D,e._fullLayout);tt.x=$e,tt.y=Ze;var nt=w.z[K][q];nt===void 0?(tt.z=``,tt.zLabel=``):(tt.z=nt,tt.zLabel=o.tickText(Ue,nt,`hover`).text);var rt=w.text&&w.text[K]&&w.text[K][q];(rt===void 0||rt===!1)&&(rt=``),tt.text=rt;var it=s.texttemplateString({data:[tt,D._meta],fallback:D.texttemplatefallback,labels:tt,locale:e._fullLayout._d3locale,template:Ve});if(it){var at=it.split(`<br>`),ot=at.length,st=0;for(J=0;J<ot;J++)st=Math.max(st,at[J].length);Xe.push({l:ot,c:st,t:it,x:et,y:Qe,z:nt})}}}}var ct=D.textfont,lt=ct.size,ut=e._fullLayout.font.size;if(!lt||lt===`auto`){var $=1/0,dt=1/0,ft=0,pt=0;for(J=0;J<Xe.length;J++){var mt=Xe[J];if(ft=Math.max(ft,mt.l),pt=Math.max(pt,mt.c),J<Xe.length-1){var ht=Xe[J+1],gt=Math.abs(ht.x-mt.x),_t=Math.abs(ht.y-mt.y);gt&&($=Math.min($,gt)),_t&&(dt=Math.min(dt,_t))}}!isFinite($)||!isFinite(dt)?lt=ut:($-=O,dt-=k,$/=pt,dt/=ft,$/=m/2,dt/=m,lt=Math.min(Math.floor($),Math.floor(dt),ut))}if(lt<=0||!isFinite(lt))return;var vt=function(e){return e.x},yt=function(e){return e.y-lt*(e.l*m/2-1)};v(S).data(Xe).enter().append(`g`).classed(_,1).append(`text`).attr(`text-anchor`,`middle`).each(function(t){var r=n.select(this),i=ct.color;(!i||i===`auto`)&&(i=u.contrast(t.z===void 0?e._fullLayout.plot_bgcolor:`rgba(`+ie(t.z).join()+`)`)),r.attr(`data-notex`,1).call(c.positionText,vt(t),yt(t)).call(a.font,{family:ct.family,size:lt,color:i,weight:ct.weight,style:ct.style,variant:ct.variant,textcase:ct.textcase,lineposition:ct.lineposition,shadow:ct.shadow}).text(t.t).call(c.convertToTspans,e)})}})};function b(e,t){var n=t.length-2,r=s.constrain(s.findBin(e,t),0,n),i=t[r],a=t[r+1],o=s.constrain(r+(e-i)/(a-i)-.5,0,n),c=Math.round(o),l=Math.abs(o-c);return!o||o===n||!l?{bin0:c,bin1:c,frac:0}:{bin0:c,frac:l,bin1:Math.round(c+l/(o-c))}}function x(e,t){var n=t.length-1,r=s.constrain(s.findBin(e,t),0,n),i=t[r],a=t[r+1],o=(e-i)/(a-i)||0;return o<=0?{bin0:r,bin1:r,frac:0}:o<.5?{bin0:r,bin1:r+1,frac:o}:{bin0:r+1,bin1:r,frac:1-o}}function C(e,t,n){e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=Math.round(n[3]*255)}}),Uo=h((e,t)=>{t.exports={min:`zmin`,max:`zmax`}}),Wo=h((e,t)=>{var n=S();t.exports=function(e){n.select(e).selectAll(`.hm image`).style(`opacity`,function(e){return e.trace.opacity})}}),Go=h((e,t)=>{var n=Ln(),r=$(),i=r.isArrayOrTypedArray,a=sn(),o=Yt().extractOpts;t.exports=function(e,t,s,c,l){l||={};var u=l.isContour,d=e.cd[0],f=d.trace,p=e.xa,m=e.ya,h=d.x,g=d.y,_=d.z,v=d.xCenter,y=d.yCenter,b=d.zmask,x=f.zhoverformat,S=h,C=g,w,T,E,D;if(e.index!==!1){try{E=Math.round(e.index[1]),D=Math.round(e.index[0])}catch{r.error(`Error hovering on heatmap, pointNumber must be [row,col], found:`,e.index);return}if(E<0||E>=_[0].length||D<0||D>_.length)return}else{if(n.inbox(t-h[0],t-h[h.length-1],0)>0||n.inbox(s-g[0],s-g[g.length-1],0)>0)return;if(u){var O;for(S=[2*h[0]-h[1]],O=1;O<h.length;O++)S.push((h[O]+h[O-1])/2);for(S.push([2*h[h.length-1]-h[h.length-2]]),C=[2*g[0]-g[1]],O=1;O<g.length;O++)C.push((g[O]+g[O-1])/2);C.push([2*g[g.length-1]-g[g.length-2]])}E=Math.max(0,Math.min(S.length-2,r.findBin(t,S))),D=Math.max(0,Math.min(C.length-2,r.findBin(s,C)))}var k=p.c2p(h[E]),A=p.c2p(h[E+1]),j=m.c2p(g[D]),M=m.c2p(g[D+1]),N,P;u?(N=d.orig_x||h,P=d.orig_y||g,A=k,w=N[E],M=j,T=P[D]):(N=d.orig_x||v||h,P=d.orig_y||y||g,w=v?N[E]:(N[E]+N[E+1])/2,T=y?P[D]:(P[D]+P[D+1])/2,p&&p.type===`category`&&(w=h[E]),m&&m.type===`category`&&(T=g[D]),f.zsmooth&&(k=A=p.c2p(w),j=M=m.c2p(T)));var F=_[D][E];if(b&&!b[D][E]&&(F=void 0),!(F===void 0&&!f.hoverongaps)){var I;i(d.hovertext)&&i(d.hovertext[D])?I=d.hovertext[D][E]:i(d.text)&&i(d.text[D])&&(I=d.text[D][E]);var L=o(f),R={type:`linear`,range:[L.min,L.max],hoverformat:x,_separators:p._separators,_numFormat:p._numFormat},z=a.tickText(R,F,`hover`).text;return[r.extendFlat(e,{index:f._after2before?f._after2before[D][E]:[D,E],distance:e.maxHoverDistance,spikeDistance:e.maxSpikeDistance,x0:k,x1:A,y0:j,y1:M,xLabelVal:w,yLabelVal:T,zLabelVal:F,zLabel:z,text:I})]}}}),Ko=h((e,t)=>{t.exports={attributes:Co(),supplyDefaults:Do(),calc:zo(),plot:Ho(),colorbar:Uo(),style:Wo(),hoverPoints:Go(),moduleType:`trace`,name:`heatmap`,basePlotModule:Ai(),categories:[`cartesian`,`svg`,`2dMap`,`showLegend`],meta:{}}}),qo=h((e,t)=>{t.exports=Ko()}),Jo=h((e,t)=>{t.exports=function(e,t){return{start:{valType:`any`,editType:`calc`},end:{valType:`any`,editType:`calc`},size:{valType:`any`,editType:`calc`},editType:`calc`}}}),Yo=h((e,t)=>{t.exports={eventDataKeys:[`binNumber`]}}),Xo=h((e,t)=>{var n=qa(),r=jt().axisHoverFormat,{hovertemplateAttrs:i,texttemplateAttrs:a,templatefallbackAttrs:o}=ze(),s=B(),c=Jo(),l=Yo(),u=z().extendFlat;t.exports={x:{valType:`data_array`,editType:`calc+clearAxisTypes`},y:{valType:`data_array`,editType:`calc+clearAxisTypes`},xhoverformat:r(`x`),yhoverformat:r(`y`),text:u({},n.text,{}),hovertext:u({},n.hovertext,{}),orientation:n.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:c(`x`,!0),nbinsy:{valType:`integer`,min:0,dflt:0,editType:`calc`},ybins:c(`y`,!0),autobinx:{valType:`boolean`,dflt:null,editType:`calc`},autobiny:{valType:`boolean`,dflt:null,editType:`calc`},bingroup:{valType:`string`,dflt:``,editType:`calc`},hovertemplate:i({},{keys:l.eventDataKeys}),hovertemplatefallback:o(),texttemplate:a({arrayOk:!1,editType:`plot`},{keys:[`label`,`value`]}),texttemplatefallback:o({editType:`plot`}),textposition:u({},n.textposition,{arrayOk:!1}),textfont:s({arrayOk:!1,editType:`plot`,colorEditType:`style`}),outsidetextfont:s({arrayOk:!1,editType:`plot`,colorEditType:`style`}),insidetextfont:s({arrayOk:!1,editType:`plot`,colorEditType:`style`}),insidetextanchor:n.insidetextanchor,textangle:n.textangle,cliponaxis:n.cliponaxis,constraintext:n.constraintext,marker:n.marker,offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,zorder:n.zorder}}),Zo=h((e,t)=>{var n=Ke(),r=$(),i=q(),a=Xa().handleText,o=Ya(),s=Xo();t.exports=function(e,t,c,l){function u(n,i){return r.coerce(e,t,s,n,i)}var d=u(`x`),f=u(`y`);u(`cumulative.enabled`)&&(u(`cumulative.direction`),u(`cumulative.currentbin`)),u(`text`),a(e,t,l,u,u(`textposition`),{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),u(`hovertext`),u(`hovertemplate`),u(`hovertemplatefallback`),u(`xhoverformat`),u(`yhoverformat`);var p=u(`orientation`,f&&!d?`h`:`v`),m=p===`v`?`x`:`y`,h=p===`v`?`y`:`x`,g=d&&f?Math.min(r.minRowLength(d)&&r.minRowLength(f)):r.minRowLength(t[m]||[]);if(!g){t.visible=!1;return}t._length=g,n.getComponentMethod(`calendars`,`handleTraceDefaults`)(e,t,[`x`,`y`],l),t[h]&&u(`histfunc`),u(`histnorm`),u(`autobin`+m),o(e,t,u,c,l),r.coerceSelectionMarkerOpacity(t,u);var _=(t.marker.line||{}).color,v=n.getComponentMethod(`errorbars`,`supplyDefaults`);v(e,t,_||i.defaultLine,{axis:`y`}),v(e,t,_||i.defaultLine,{axis:`x`,inherit:`y`}),u(`zorder`)}}),Qo=h((e,t)=>{var n=$(),r=xt(),i=Ke().traceIs,a=ti(),o=Xa().validateCornerradius,s=n.nestedProperty,c=ar().getAxisGroup,l=[{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`}],u=[`x`,`y`];t.exports=function(e,t){var d=t._histogramBinOpts={},f=[],p={},m=[],h,g,_,v,y,b,x;function S(e,t){return n.coerce(h._input,h,h._module.attributes,e,t)}function C(e){return e.orientation===`v`?`x`:`y`}function w(e,n){return r.getFromTrace({_fullLayout:t},e,n).type}function T(e,t,r){var i=e.uid+`__`+r;t||=i;var a=w(e,r),o=e[r+`calendar`]||``,s=d[t],c=!0;s&&(a===s.axType&&o===s.calendar?(c=!1,s.traces.push(e),s.dirs.push(r)):(t=i,a!==s.axType&&n.warn([`Attempted to group the bins of trace`,e.index,`set on a`,`type:`+a,`axis`,`with bins on`,`type:`+s.axType,`axis.`].join(` `)),o!==s.calendar&&n.warn([`Attempted to group the bins of trace`,e.index,`set with a`,o,`calendar`,`with bins`,s.calendar?`on a `+s.calendar+` calendar`:`w/o a set calendar`].join(` `)))),c&&(d[t]={traces:[e],dirs:[r],axType:a,calendar:e[r+`calendar`]||``}),e[`_`+r+`bingroup`]=t}for(y=0;y<e.length;y++)if(h=e[y],i(h,`histogram`)){if(f.push(h),delete h._xautoBinFinished,delete h._yautoBinFinished,h.type===`histogram`){var E=S(`marker.cornerradius`,t.barcornerradius);h.marker&&(h.marker.cornerradius=o(E))}i(h,`2dMap`)||a(h._input,h,t,S,t.barmode)}var D=t._alignmentOpts||{};for(y=0;y<f.length;y++){if(h=f[y],_=``,!i(h,`2dMap`)){if(v=C(h),t.barmode===`group`&&h.alignmentgroup){var O=h[v+`axis`],k=c(t,O)+h.orientation;(D[k]||{})[h.alignmentgroup]&&(_=k)}!_&&t.barmode!==`overlay`&&(_=c(t,h.xaxis)+c(t,h.yaxis)+C(h))}_?(p[_]||(p[_]=[]),p[_].push(h)):m.push(h)}for(_ in p){if(g=p[_],g.length===1){m.push(g[0]);continue}var A=!1;for(g.length&&(h=g[0],A=S(`bingroup`)),_=A||_,y=0;y<g.length;y++){h=g[y];var j=h._input.bingroup;j&&j!==_&&n.warn([`Trace`,h.index,`must match`,`within bingroup`,_+`.`,`Ignoring its bingroup:`,j,`setting.`].join(` `)),h.bingroup=_,T(h,_,C(h))}}for(y=0;y<m.length;y++){h=m[y];var M=S(`bingroup`);if(i(h,`2dMap`))for(x=0;x<2;x++){v=u[x];var N=S(v+`bingroup`,M?M+`__`+v:null);T(h,N,v)}else T(h,M,C(h))}for(_ in d){var P=d[_];for(g=P.traces,b=0;b<l.length;b++){var F=l[b],I=F.name,L,R;if(!(I===`nbins`&&P.sizeFound)){for(y=0;y<g.length;y++){if(h=g[y],v=P.dirs[y],L=F.aStr[v],s(h._input,L).get()!==void 0){P[I]=S(L),P[I+`Found`]=!0;break}R=(h._autoBin||{})[v]||{},R[I]&&s(h,L).set(R[I])}if(I===`start`||I===`end`)for(;y<g.length;y++)h=g[y],h[`_`+v+`bingroup`]&&(R=(h._autoBin||{})[v]||{},S(L,R[I]));I===`nbins`&&!P.sizeFound&&!P.nbinsFound&&(h=g[0],P[I]=S(L))}}}}}),$o=h((e,t)=>{var n=io().hoverPoints,r=sn().hoverLabelText;t.exports=function(e,t,i,a,o){var s=n(e,t,i,a,o);if(s){e=s[0];var c=e.cd[e.index],l=e.cd[0].trace;if(!l.cumulative.enabled){var u=l.orientation===`h`?`y`:`x`;e[u+`Label`]=r(e[u+`a`],[c.ph0,c.ph1],l[u+`hoverformat`])}return s}}}),es=h((e,t)=>{t.exports=function(e,t,n,r,i){if(e.x=`xVal`in t?t.xVal:t.x,e.y=`yVal`in t?t.yVal:t.y,`zLabelVal`in t&&(e.z=t.zLabelVal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),!(n.cumulative||{}).enabled){var a=Array.isArray(i)?r[0].pts[i[0]][i[1]]:r[i].pts;e.pointNumbers=a,e.binNumber=e.pointNumber,delete e.pointNumber,delete e.pointIndex;var o;if(n._indexToPoints){o=[];for(var s=0;s<a.length;s++)o=o.concat(n._indexToPoints[a[s]])}else o=a;e.pointIndices=o}return e}}),ts=h((e,t)=>{t.exports={attributes:Xo(),layoutAttributes:Ja(),supplyDefaults:Zo(),crossTraceDefaults:Qo(),supplyLayoutDefaults:Za(),calc:Mo().calc,crossTraceCalc:di().crossTraceCalc,plot:ro().plot,layerName:`barlayer`,style:no().style,styleOnSelect:no().styleOnSelect,colorbar:gi(),hoverPoints:$o(),selectPoints:oo(),eventData:es(),moduleType:`trace`,name:`histogram`,basePlotModule:Ai(),categories:[`bar-like`,`cartesian`,`svg`,`bar`,`histogram`,`oriented`,`errorBarsOK`,`showLegend`],meta:{}}}),ns=h((e,t)=>{t.exports=ts()}),rs=h((e,t)=>{var n=Xo(),r=Jo(),i=Co(),a=W(),o=jt().axisHoverFormat,{hovertemplateAttrs:s,texttemplateAttrs:c,templatefallbackAttrs:l}=ze(),u=Pt(),d=z().extendFlat;t.exports=d({x:n.x,y:n.y,z:{valType:`data_array`,editType:`calc`},marker:{color:{valType:`data_array`,editType:`calc`},editType:`calc`},histnorm:n.histnorm,histfunc:n.histfunc,nbinsx:n.nbinsx,xbins:r(`x`),nbinsy:n.nbinsy,ybins:r(`y`),autobinx:n.autobinx,autobiny:n.autobiny,bingroup:d({},n.bingroup,{}),xbingroup:d({},n.bingroup,{}),ybingroup:d({},n.bingroup,{}),xgap:i.xgap,ygap:i.ygap,zsmooth:i.zsmooth,xhoverformat:o(`x`),yhoverformat:o(`y`),zhoverformat:o(`z`,1),hovertemplate:s({},{keys:[`z`]}),hovertemplatefallback:l(),texttemplate:c({arrayOk:!1,editType:`plot`},{keys:[`z`]}),texttemplatefallback:l({editType:`plot`}),textfont:i.textfont,showlegend:d({},a.showlegend,{dflt:!1})},u(``,{cLetter:`z`,autoColorDflt:!1}))}),is=h((e,t)=>{var n=Ke(),r=$();t.exports=function(e,t,i,a){var o=i(`x`),s=i(`y`),c=r.minRowLength(o),l=r.minRowLength(s);if(!c||!l){t.visible=!1;return}t._length=Math.min(c,l),n.getComponentMethod(`calendars`,`handleTraceDefaults`)(e,t,[`x`,`y`],a),(i(`z`)||i(`marker.color`))&&i(`histfunc`),i(`histnorm`),i(`autobinx`),i(`autobiny`)}}),as=h((e,t)=>{var n=$(),r=is(),i=Eo(),a=Gt(),o=To(),s=rs();t.exports=function(e,t,c,l){function u(r,i){return n.coerce(e,t,s,r,i)}r(e,t,u,l),t.visible!==!1&&(i(e,t,u,l),a(e,t,l,u,{prefix:``,cLetter:`z`}),u(`hovertemplate`),u(`hovertemplatefallback`),o(u,l),u(`xhoverformat`),u(`yhoverformat`))}}),os=h((e,t)=>{var n=Go(),r=sn().hoverLabelText;t.exports=function(e,t,i,a,o){var s=n(e,t,i,a,o);if(s){e=s[0];var c=e.index,l=c[0],u=c[1],d=e.cd[0],f=d.trace,p=d.xRanges[u],m=d.yRanges[l];return e.xLabel=r(e.xa,[p[0],p[1]],f.xhoverformat),e.yLabel=r(e.ya,[m[0],m[1]],f.yhoverformat),s}}}),ss=h((e,t)=>{t.exports={attributes:rs(),supplyDefaults:as(),crossTraceDefaults:Qo(),calc:zo(),plot:Ho(),layerName:`heatmaplayer`,colorbar:Uo(),style:Wo(),hoverPoints:os(),eventData:es(),moduleType:`trace`,name:`histogram2d`,basePlotModule:Ai(),categories:[`cartesian`,`svg`,`2dMap`,`histogram`,`showLegend`],meta:{}}}),cs=h((e,t)=>{t.exports=ss()}),ls=h((e,t)=>{t.exports={COMPARISON_OPS:[`=`,`!=`,`<`,`>=`,`>`,`<=`],COMPARISON_OPS2:[`=`,`<`,`>=`,`>`,`<=`],INTERVAL_OPS:[`[]`,`()`,`[)`,`(]`,`][`,`)(`,`](`,`)[`],SET_OPS:[`{}`,`}{`],CONSTRAINT_REDUCTION:{"=":`=`,"<":`<`,"<=":`<`,">":`>`,">=":`>`,"[]":`[]`,"()":`[]`,"[)":`[]`,"(]":`[]`,"][":`][`,")(":`][`,"](":`][`,")[":`][`}}}),us=h((e,t)=>{var n=Co(),r=Tr(),i=jt(),a=i.axisHoverFormat,o=i.descriptionOnlyNumbers,s=Pt(),c=Le().dash,l=B(),u=z().extendFlat,d=ls(),f=d.COMPARISON_OPS2,p=d.INTERVAL_OPS,m=r.line;t.exports=u({z:n.z,x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,text:n.text,hovertext:n.hovertext,transpose:n.transpose,xtype:n.xtype,ytype:n.ytype,xhoverformat:a(`x`),yhoverformat:a(`y`),zhoverformat:a(`z`,1),hovertemplate:n.hovertemplate,hovertemplatefallback:n.hovertemplatefallback,texttemplate:u({},n.texttemplate,{}),texttemplatefallback:n.texttemplatefallback,textfont:u({},n.textfont,{}),hoverongaps:n.hoverongaps,connectgaps:u({},n.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:l({editType:`plot`,colorEditType:`style`}),labelformat:{valType:`string`,dflt:``,editType:`plot`,description:o(`contour label`)},operation:{valType:`enumerated`,values:[].concat(f,p),dflt:`=`,editType:`calc`},value:{valType:`any`,dflt:0,editType:`calc`},editType:`calc`,impliedEdits:{autocontour:!1}},line:{color:u({},m.color,{editType:`style+colorbars`}),width:{valType:`number`,min:0,editType:`style+colorbars`},dash:c,smoothing:u({},m.smoothing,{}),editType:`plot`},zorder:r.zorder},s(``,{cLetter:`z`,autoColorDflt:!1,editTypeOverride:`calc`}))}),ds=h((e,t)=>{var n=rs(),r=us(),i=Pt(),a=jt().axisHoverFormat,o=z().extendFlat;t.exports=o({x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,nbinsx:n.nbinsx,xbins:n.xbins,nbinsy:n.nbinsy,ybins:n.ybins,autobinx:n.autobinx,autobiny:n.autobiny,bingroup:n.bingroup,xbingroup:n.xbingroup,ybingroup:n.ybingroup,autocontour:r.autocontour,ncontours:r.ncontours,contours:r.contours,line:{color:r.line.color,width:o({},r.line.width,{dflt:.5}),dash:r.line.dash,smoothing:r.line.smoothing,editType:`plot`},xhoverformat:a(`x`),yhoverformat:a(`y`),zhoverformat:a(`z`,1),hovertemplate:n.hovertemplate,hovertemplatefallback:n.hovertemplatefallback,texttemplate:r.texttemplate,texttemplatefallback:r.texttemplatefallback,textfont:r.textfont},i(``,{cLetter:`z`,editTypeOverride:`calc`}))}),fs=h((e,t)=>{t.exports=function(e,t,n,r){var i=r(`contours.start`),a=r(`contours.end`),o=i===!1||a===!1,s=n(`contours.size`);((o?t.autocontour=!0:n(`autocontour`,!1))||!s)&&n(`ncontours`)}}),ps=h((e,t)=>{var n=$();t.exports=function(e,t,r,i){if(i||={},e(`contours.showlabels`)){var a=t.font;n.coerceFont(e,`contours.labelfont`,a,{overrideDflt:{color:r}}),e(`contours.labelformat`)}i.hasHover!==!1&&e(`zhoverformat`)}}),ms=h((e,t)=>{var n=Gt(),r=ps();t.exports=function(e,t,i,a,o){var s=i(`contours.coloring`),c,l=``;s===`fill`&&(c=i(`contours.showlines`)),c!==!1&&(s!==`lines`&&(l=i(`line.color`,`#000`)),i(`line.width`,.5),i(`line.dash`)),s!==`none`&&(e.showlegend!==!0&&(t.showlegend=!1),t._dfltShowLegend=!1,n(e,t,a,i,{prefix:``,cLetter:`z`})),i(`line.smoothing`),r(i,a,l,o)}}),hs=h((e,t)=>{var n=$(),r=is(),i=fs(),a=ms(),o=To(),s=ds();t.exports=function(e,t,c,l){function u(r,i){return n.coerce(e,t,s,r,i)}function d(r){return n.coerce2(e,t,s,r)}r(e,t,u,l),t.visible!==!1&&(i(e,t,u,d),a(e,t,u,l),u(`xhoverformat`),u(`yhoverformat`),u(`hovertemplate`),u(`hovertemplatefallback`),t.contours&&t.contours.coloring===`heatmap`&&o(u,l))}}),gs=h((e,t)=>{var n=sn(),r=$();t.exports=function(e,t){var a=e.contours;if(e.autocontour){var o=e.zmin,s=e.zmax;(e.zauto||o===void 0)&&(o=r.aggNums(Math.min,null,t)),(e.zauto||s===void 0)&&(s=r.aggNums(Math.max,null,t));var c=i(o,s,e.ncontours);a.size=c.dtick,a.start=n.tickFirst(c),c.range.reverse(),a.end=n.tickFirst(c),a.start===o&&(a.start+=a.size),a.end===s&&(a.end-=a.size),a.start>a.end&&(a.start=a.end=(a.start+a.end)/2),e._input.contours||(e._input.contours={}),r.extendFlat(e._input.contours,{start:a.start,end:a.end,size:a.size}),e._input.autocontour=!0}else if(a.type!==`constraint`){var l=a.start,u=a.end,d=e._input.contours;l>u&&(a.start=d.start=u,u=a.end=d.end=l,l=a.start),!(a.size>0)&&(d.size=a.size=l===u?1:i(l,u,e.ncontours).dtick)}};function i(e,t,r){var i={type:`linear`,range:[e,t]};return n.autoTicks(i,(t-e)/(r||15)),i}}),_s=h((e,t)=>{t.exports=function(e){return e.end+e.size/1e6}}),vs=h((e,t)=>{var n=Yt(),r=zo(),i=gs(),a=_s();t.exports=function(e,t){var o=r(e,t),s=o[0].z;i(t,s);var c=t.contours,l=n.extractOpts(t),u;if(c.coloring===`heatmap`&&l.auto&&t.autocontour===!1){var d=c.start,f=a(c),p=c.size||1,m=Math.floor((f-d)/p)+1;isFinite(p)||(p=1,m=1);var h=d-p/2;u=[h,h+m*p]}else u=s;return n.calc(e,t,{vals:u,cLetter:`z`}),o}}),ys=h((e,t)=>{t.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}}}),bs=h((e,t)=>{var n=ys();t.exports=function(e){var t=e[0].z,i=t.length,a=t[0].length,o=i===2||a===2,s,c,l,u,d,f,p,m,h;for(c=0;c<i-1;c++)for(u=[],c===0&&(u=u.concat(n.BOTTOMSTART)),c===i-2&&(u=u.concat(n.TOPSTART)),s=0;s<a-1;s++)for(l=u.slice(),s===0&&(l=l.concat(n.LEFTSTART)),s===a-2&&(l=l.concat(n.RIGHTSTART)),d=s+`,`+c,f=[[t[c][s],t[c][s+1]],[t[c+1][s],t[c+1][s+1]]],h=0;h<e.length;h++)m=e[h],p=r(m.level,f),p&&(m.crossings[d]=p,l.indexOf(p)!==-1&&(m.starts.push([s,c]),o&&l.indexOf(p,l.indexOf(p)+1)!==-1&&m.starts.push([s,c])))};function r(e,t){var n=(t[0][0]>e?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return n===5||n===10?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?n===5?713:1114:n===5?104:208:n===15?0:n}}),xs=h((e,t)=>{var n=$(),r=ys();t.exports=function(e,t,r){var i,a,s,c,l;for(t||=.01,r||=.01,s=0;s<e.length;s++){for(c=e[s],l=0;l<c.starts.length;l++)a=c.starts[l],o(c,a,`edge`,t,r);for(i=0;Object.keys(c.crossings).length&&i<1e4;)i++,a=Object.keys(c.crossings)[0].split(`,`).map(Number),o(c,a,void 0,t,r);i===1e4&&n.log(`Infinite loop in contour?`)}};function i(e,t,n,r){return Math.abs(e[0]-t[0])<n&&Math.abs(e[1]-t[1])<r}function a(e,t){var n=e[2]-t[2],r=e[3]-t[3];return Math.sqrt(n*n+r*r)}function o(e,t,o,l,u){var d=t.join(`,`),f=e.crossings[d],p=s(f,o,t),m=[c(e,t,[-p[0],-p[1]])],h=e.z.length,g=e.z[0].length,_=t.slice(),v=p.slice(),y;for(y=0;y<1e4;y++){if(f>20?(f=r.CHOOSESADDLE[f][(p[0]||p[1])<0?0:1],e.crossings[d]=r.SADDLEREMAINDER[f]):delete e.crossings[d],p=r.NEWDELTA[f],!p){n.log(`Found bad marching index:`,f,t,e.level);break}m.push(c(e,t,p)),t[0]+=p[0],t[1]+=p[1],d=t.join(`,`),i(m[m.length-1],m[m.length-2],l,u)&&m.pop();var b=p[0]&&(t[0]<0||t[0]>g-2)||p[1]&&(t[1]<0||t[1]>h-2);if(t[0]===_[0]&&t[1]===_[1]&&p[0]===v[0]&&p[1]===v[1]||o&&b)break;f=e.crossings[d]}y===1e4&&n.log(`Infinite loop in contour?`);var x=i(m[0],m[m.length-1],l,u),S=0,C=.2*e.smoothing,w=[],T=0,E,D,O,k,A,j,M,N,P,F,I;for(y=1;y<m.length;y++)M=a(m[y],m[y-1]),S+=M,w.push(M);var L=S/w.length*C;function R(e){return m[e%m.length]}for(y=m.length-2;y>=T;y--)if(E=w[y],E<L){for(O=0,D=y-1;D>=T&&E+w[D]<L;D--)E+=w[D];if(x&&y===m.length-2)for(O=0;O<D&&E+w[O]<L;O++)E+=w[O];A=y-D+O+1,j=Math.floor((y+D+O+2)/2),k=!x&&y===m.length-2?m[m.length-1]:!x&&D===-1?m[0]:A%2?R(j):[(R(j)[0]+R(j+1)[0])/2,(R(j)[1]+R(j+1)[1])/2],m.splice(D+1,y-D+1,k),y=D+1,O&&(T=O),x&&(y===m.length-2?m[O]=m[m.length-1]:y===0&&(m[m.length-1]=m[0]))}for(m.splice(0,T),y=0;y<m.length;y++)m[y].length=2;if(!(m.length<2))if(x)m.pop(),e.paths.push(m);else{o||n.log(`Unclosed interior contour?`,e.level,_.join(`,`),m.join(`L`));var z=!1;for(N=0;N<e.edgepaths.length;N++)if(F=e.edgepaths[N],!z&&i(F[0],m[m.length-1],l,u)){m.pop(),z=!0;var B=!1;for(P=0;P<e.edgepaths.length;P++)if(I=e.edgepaths[P],i(I[I.length-1],m[0],l,u)){B=!0,m.shift(),e.edgepaths.splice(N,1),P===N?e.paths.push(m.concat(I)):(P>N&&P--,e.edgepaths[P]=I.concat(m,F));break}B||(e.edgepaths[N]=m.concat(F))}for(N=0;N<e.edgepaths.length&&!z;N++)F=e.edgepaths[N],i(F[F.length-1],m[0],l,u)&&(m.shift(),e.edgepaths[N]=F.concat(m),z=!0);z||e.edgepaths.push(m)}}function s(e,t,n){var i=0,a=0;return e>20&&t?e===208||e===1114?i=n[0]===0?1:-1:a=n[1]===0?1:-1:r.BOTTOMSTART.indexOf(e)===-1?r.LEFTSTART.indexOf(e)===-1?r.TOPSTART.indexOf(e)===-1?i=-1:a=-1:i=1:a=1,[i,a]}function c(e,t,n){var r=t[0]+Math.max(n[0],0),i=t[1]+Math.max(n[1],0),a=e.z[i][r],o=e.xaxis,s=e.yaxis;if(n[1]){var c=(e.level-a)/(e.z[i][r+1]-a),l=(c===1?0:(1-c)*o.c2l(e.x[r]))+(c===0?0:c*o.c2l(e.x[r+1]));return[o.c2p(o.l2c(l),!0),s.c2p(e.y[i],!0),r+c,i]}else{var u=(e.level-a)/(e.z[i+1][r]-a),d=(u===1?0:(1-u)*s.c2l(e.y[i]))+(u===0?0:u*s.c2l(e.y[i+1]));return[o.c2p(e.x[r],!0),s.c2p(s.l2c(d),!0),r,i+u]}}}),Ss=h((e,t)=>{var n=ls(),r=D();t.exports={"[]":a(`[]`),"][":a(`][`),">":o(`>`),"<":o(`<`),"=":o(`=`)};function i(e,t){var i=Array.isArray(t),a;function o(e){return r(e)?+e:null}return n.COMPARISON_OPS2.indexOf(e)===-1?n.INTERVAL_OPS.indexOf(e)===-1?n.SET_OPS.indexOf(e)!==-1&&(a=i?t.map(o):[o(t)]):a=i?[o(t[0]),o(t[1])]:[o(t),o(t)]:a=o(i?t[0]:t),a}function a(e){return function(t){t=i(e,t);var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]);return{start:n,end:r,size:r-n}}}function o(e){return function(t){return t=i(e,t),{start:t,end:1/0,size:1/0}}}}),Cs=h((e,t)=>{var n=$(),r=Ss(),i=_s();t.exports=function(e,t,a){for(var o=e.type===`constraint`?r[e._operation](e.value):e,s=o.size,c=[],l=i(o),u=a.trace._carpetTrace,d=u?{xaxis:u.aaxis,yaxis:u.baxis,x:a.a,y:a.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:a.x,y:a.y},f=o.start;f<l;f+=s)if(c.push(n.extendFlat({level:f,crossings:{},starts:[],edgepaths:[],paths:[],z:a.z,smoothing:a.trace.line.smoothing},d)),c.length>1e3){n.warn(`Too many contours, clipping at 1000`,e);break}return c}}),ws=h((e,t)=>{var n=$();t.exports=function(e,t){var i,a,o,s=function(e){return e.reverse()},c=function(e){return e};switch(t){case`=`:case`<`:return e;case`>`:for(e.length!==1&&n.warn(`Contour data invalid for the specified inequality operation.`),a=e[0],i=0;i<a.edgepaths.length;i++)a.edgepaths[i]=s(a.edgepaths[i]);for(i=0;i<a.paths.length;i++)a.paths[i]=s(a.paths[i]);for(i=0;i<a.starts.length;i++)a.starts[i]=s(a.starts[i]);return e;case`][`:var l=s;s=c,c=l;case`[]`:for(e.length!==2&&n.warn(`Contour data invalid for the specified inequality range operation.`),a=r(e[0]),o=r(e[1]),i=0;i<a.edgepaths.length;i++)a.edgepaths[i]=s(a.edgepaths[i]);for(i=0;i<a.paths.length;i++)a.paths[i]=s(a.paths[i]);for(i=0;i<a.starts.length;i++)a.starts[i]=s(a.starts[i]);for(;o.edgepaths.length;)a.edgepaths.push(c(o.edgepaths.shift()));for(;o.paths.length;)a.paths.push(c(o.paths.shift()));for(;o.starts.length;)a.starts.push(c(o.starts.shift()));return[a]}};function r(e){return n.extendFlat({},e,{edgepaths:n.extendDeep([],e.edgepaths),paths:n.extendDeep([],e.paths),starts:n.extendDeep([],e.starts)})}}),Ts=h((e,t)=>{t.exports=function(e,t){var n=e[0],r=n.z,i;switch(t.type){case`levels`:var a=Math.min(r[0][0],r[0][1]);for(i=0;i<e.length;i++){var o=e[i];o.prefixBoundary=!o.edgepaths.length&&(a>o.level||o.starts.length&&a===o.level)}break;case`constraint`:if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,c=n.y.length,l=-1/0,u=1/0;for(i=0;i<c;i++)u=Math.min(u,r[i][0]),u=Math.min(u,r[i][s-1]),l=Math.max(l,r[i][0]),l=Math.max(l,r[i][s-1]);for(i=1;i<s-1;i++)u=Math.min(u,r[0][i]),u=Math.min(u,r[c-1][i]),l=Math.max(l,r[0][i]),l=Math.max(l,r[c-1][i]);var d=t.value,f,p;switch(t._operation){case`>`:d>l&&(n.prefixBoundary=!0);break;case`<`:(d<u||n.starts.length&&d===u)&&(n.prefixBoundary=!0);break;case`[]`:f=Math.min(d[0],d[1]),p=Math.max(d[0],d[1]),(p<u||f>l||n.starts.length&&p===u)&&(n.prefixBoundary=!0);break;case`][`:f=Math.min(d[0],d[1]),p=Math.max(d[0],d[1]),f<u&&p>l&&(n.prefixBoundary=!0);break}break}}}),Es=h(e=>{var t=S(),n=$(),r=tn(),i=Yt(),a=kt(),o=sn(),s=rn(),c=Ho(),l=bs(),u=xs(),d=Cs(),f=ws(),p=Ts(),m=ys(),h=m.LABELOPTIMIZER;e.plot=function(e,r,i,a){var o=r.xaxis,s=r.yaxis;n.makeTraceGroups(a,i,`contour`).each(function(i){var a=t.select(this),p=i[0],m=p.trace,h=p.x,v=p.y,b=m.contours,S=d(b,r,p),C=n.ensureSingle(a,`g`,`heatmapcoloring`),w=[];b.coloring===`heatmap`&&(w=[i]),c(e,r,w,C),l(S),u(S);var T=o.c2p(h[0],!0),E=o.c2p(h[h.length-1],!0),D=s.c2p(v[0],!0),O=s.c2p(v[v.length-1],!0),k=[[T,O],[E,O],[E,D],[T,D]],A=S;b.type===`constraint`&&(A=f(S,b._operation)),g(a,k,b),_(a,A,k,b),y(a,S,e,p,b),x(a,r,e,p,k)})};function g(e,t,r){var i=n.ensureSingle(e,`g`,`contourbg`).selectAll(`path`).data(r.coloring===`fill`?[0]:[]);i.enter().append(`path`),i.exit().remove(),i.attr(`d`,`M`+t.join(`L`)+`Z`).style(`stroke`,`none`)}function _(e,r,i,a){var o=a.coloring===`fill`||a.type===`constraint`&&a._operation!==`=`,s=`M`+i.join(`L`)+`Z`;o&&p(r,a);var c=n.ensureSingle(e,`g`,`contourfill`).selectAll(`path`).data(o?r:[]);c.enter().append(`path`),c.exit().remove(),c.each(function(e){var n=(e.prefixBoundary?s:``)+v(e,i);n?t.select(this).attr(`d`,n).style(`stroke`,`none`):t.select(this).remove()})}function v(e,t){var i=``,a=0,o=e.edgepaths.map(function(e,t){return t}),s=!0,c,l,u,d,f,p;function m(e){return Math.abs(e[1]-t[0][1])<.01}function h(e){return Math.abs(e[1]-t[2][1])<.01}function g(e){return Math.abs(e[0]-t[0][0])<.01}function _(e){return Math.abs(e[0]-t[2][0])<.01}for(;o.length;){for(p=r.smoothopen(e.edgepaths[a],e.smoothing),i+=s?p:p.replace(/^M/,`L`),o.splice(o.indexOf(a),1),c=e.edgepaths[a][e.edgepaths[a].length-1],d=-1,u=0;u<4;u++){if(!c){n.log(`Missing end?`,a,e);break}for(m(c)&&!_(c)?l=t[1]:g(c)?l=t[0]:h(c)?l=t[3]:_(c)&&(l=t[2]),f=0;f<e.edgepaths.length;f++){var v=e.edgepaths[f][0];Math.abs(c[0]-l[0])<.01?Math.abs(c[0]-v[0])<.01&&(v[1]-c[1])*(l[1]-v[1])>=0&&(l=v,d=f):Math.abs(c[1]-l[1])<.01?Math.abs(c[1]-v[1])<.01&&(v[0]-c[0])*(l[0]-v[0])>=0&&(l=v,d=f):n.log(`endpt to newendpt is not vert. or horz.`,c,l,v)}if(c=l,d>=0)break;i+=`L`+l}if(d===e.edgepaths.length){n.log(`unclosed perimeter path`);break}a=d,s=o.indexOf(a)===-1,s&&(a=o[0],i+=`Z`)}for(a=0;a<e.paths.length;a++)i+=r.smoothclosed(e.paths[a],e.smoothing);return i}function y(i,a,o,s,c){var l=o._context.staticPlot,u=n.ensureSingle(i,`g`,`contourlines`),d=c.showlines!==!1,f=c.showlabels,p=d&&f,h=e.createLines(u,d||f,a,l),g=e.createLineClip(u,p,o,s.trace.uid),_=i.selectAll(`g.contourlabels`).data(f?[0]:[]);if(_.exit().remove(),_.enter().append(`g`).classed(`contourlabels`,!0),f){var v=[],y=[];n.clearLocationCache();var b=e.labelFormatter(o,s),x=r.tester.append(`text`).attr(`data-notex`,1).call(r.font,c.labelfont),S=a[0].xaxis,C=a[0].yaxis,w=S._length,T=C._length,E=S.range,D=C.range,O=n.aggNums(Math.min,null,s.x),k=n.aggNums(Math.max,null,s.x),A=n.aggNums(Math.min,null,s.y),j=n.aggNums(Math.max,null,s.y),M=Math.max(S.c2p(O,!0),0),N=Math.min(S.c2p(k,!0),w),P=Math.max(C.c2p(j,!0),0),F=Math.min(C.c2p(A,!0),T),I={};E[0]<E[1]?(I.left=M,I.right=N):(I.left=N,I.right=M),D[0]<D[1]?(I.top=P,I.bottom=F):(I.top=F,I.bottom=P),I.middle=(I.top+I.bottom)/2,I.center=(I.left+I.right)/2,v.push([[I.left,I.top],[I.right,I.top],[I.right,I.bottom],[I.left,I.bottom]]);var L=Math.sqrt(w*w+T*T),R=m.LABELDISTANCE*L/Math.max(1,a.length/m.LABELINCREASE);h.each(function(r){var i=e.calcTextOpts(r.level,b,x,o);t.select(this).selectAll(`path`).each(function(){var t=this,r=n.getVisibleSegment(t,I,i.height/2);if(r&&!(r.len<(i.width+i.height)*m.LABELMIN))for(var a=Math.min(Math.ceil(r.len/R),m.LABELMAX),o=0;o<a;o++){var s=e.findBestTextLocation(t,r,i,y,I);if(!s)break;e.addLabelData(s,i,y,v)}})}),x.remove(),e.drawLabels(_,y,o,g,p?v:null)}f&&!d&&h.remove()}e.createLines=function(e,t,n,i){var a=n[0].smoothing,o=e.selectAll(`g.contourlevel`).data(t?n:[]);if(o.exit().remove(),o.enter().append(`g`).classed(`contourlevel`,!0),t){var s=o.selectAll(`path.openline`).data(function(e){return e.pedgepaths||e.edgepaths});s.exit().remove(),s.enter().append(`path`).classed(`openline`,!0),s.attr(`d`,function(e){return r.smoothopen(e,a)}).style(`stroke-miterlimit`,1).style(`vector-effect`,i?`none`:`non-scaling-stroke`);var c=o.selectAll(`path.closedline`).data(function(e){return e.ppaths||e.paths});c.exit().remove(),c.enter().append(`path`).classed(`closedline`,!0),c.attr(`d`,function(e){return r.smoothclosed(e,a)}).style(`stroke-miterlimit`,1).style(`vector-effect`,i?`none`:`non-scaling-stroke`)}return o},e.createLineClip=function(e,t,n,i){var a=n._fullLayout._clips,o=t?`clipline`+i:null,s=a.selectAll(`#`+o).data(t?[0]:[]);return s.exit().remove(),s.enter().append(`clipPath`).classed(`contourlineclip`,!0).attr(`id`,o),r.setClipUrl(e,o,n),s},e.labelFormatter=function(e,t){var r=e._fullLayout,a=t.trace,c=a.contours,l={type:`linear`,_id:`ycontour`,showexponent:`all`,exponentformat:`B`};if(c.labelformat)l.tickformat=c.labelformat,s(l,r);else{var u=i.extractOpts(a);if(u&&u.colorbar&&u.colorbar._axis)l=u.colorbar._axis;else{if(c.type===`constraint`){var d=c.value;n.isArrayOrTypedArray(d)?l.range=[d[0],d[d.length-1]]:l.range=[d,d]}else l.range=[c.start,c.end],l.nticks=(c.end-c.start)/c.size;l.range[0]===l.range[1]&&(l.range[1]+=l.range[0]||1),l.nticks||=1e3,s(l,r),o.prepTicks(l),l._tmin=null,l._tmax=null}}return function(e){return o.tickText(l,e).text}},e.calcTextOpts=function(e,t,n,i){var o=t(e);n.text(o).call(a.convertToTspans,i);var s=n.node(),c=r.bBox(s,!0);return{text:o,width:c.width,height:c.height,fontSize:+s.style[`font-size`].replace(`px`,``),level:e,dy:(c.top+c.bottom)/2}},e.findBestTextLocation=function(e,t,r,i,a){var o=r.width,s,c,l,u,d;t.isClosed?(c=t.len/h.INITIALSEARCHPOINTS,s=t.min+c/2,l=t.max):(c=(t.len-o)/(h.INITIALSEARCHPOINTS+1),s=t.min+c+o/2,l=t.max-(c+o)/2);for(var f=1/0,p=0;p<h.ITERATIONS;p++){for(var m=s;m<l;m+=c){var g=n.getTextLocation(e,t.total,m,o),_=b(g,r,i,a);_<f&&(f=_,d=g,u=m)}if(f>h.MAXCOST*2)break;p&&(c/=2),s=u-c/2,l=s+c*1.5}if(f<=h.MAXCOST)return d};function b(e,t,r,i){var a=t.width/2,o=t.height/2,s=e.x,c=e.y,l=e.theta,u=Math.cos(l)*a,d=Math.sin(l)*a,f=(s>i.center?i.right-s:s-i.left)/(u+Math.abs(Math.sin(l)*o)),p=(c>i.middle?i.bottom-c:c-i.top)/(Math.abs(d)+Math.cos(l)*o);if(f<1||p<1)return 1/0;var m=h.EDGECOST*(1/(f-1)+1/(p-1));m+=h.ANGLECOST*l*l;for(var g=s-u,_=c-d,v=s+u,y=c+d,b=0;b<r.length;b++){var x=r[b],S=Math.cos(x.theta)*x.width/2,C=Math.sin(x.theta)*x.width/2,w=n.segmentDistance(g,_,v,y,x.x-S,x.y-C,x.x+S,x.y+C)*2/(t.height+x.height),T=x.level===t.level,E=T?h.SAMELEVELDISTANCE:1;if(w<=E)return 1/0;var D=h.NEIGHBORCOST*(T?h.SAMELEVELFACTOR:1);m+=D/(w-E)}return m}e.addLabelData=function(e,t,n,r){var i=t.fontSize,a=t.width+i/3,o=Math.max(0,t.height-i/3),s=e.x,c=e.y,l=e.theta,u=Math.sin(l),d=Math.cos(l),f=function(e,t){return[s+e*d-t*u,c+e*u+t*d]},p=[f(-a/2,-o/2),f(-a/2,o/2),f(a/2,o/2),f(a/2,-o/2)];n.push({text:t.text,x:s,y:c,dy:t.dy,theta:l,level:t.level,width:a,height:o}),r.push(p)},e.drawLabels=function(e,r,i,o,s){var c=e.selectAll(`text`).data(r,function(e){return e.text+`,`+e.x+`,`+e.y+`,`+e.theta});if(c.exit().remove(),c.enter().append(`text`).attr({"data-notex":1,"text-anchor":`middle`}).each(function(e){var n=e.x+Math.sin(e.theta)*e.dy,r=e.y-Math.cos(e.theta)*e.dy;t.select(this).text(e.text).attr({x:n,y:r,transform:`rotate(`+180*e.theta/Math.PI+` `+n+` `+r+`)`}).call(a.convertToTspans,i)}),s){for(var l=``,u=0;u<s.length;u++)l+=`M`+s[u].join(`L`)+`Z`;n.ensureSingle(o,`path`,``).attr(`d`,l)}};function x(e,t,i,a,o){var s=a.trace,c=i._fullLayout._clips,d=`clip`+s.uid,f=c.selectAll(`#`+d).data(s.connectgaps?[]:[0]);if(f.enter().append(`clipPath`).classed(`contourclip`,!0).attr(`id`,d),f.exit().remove(),s.connectgaps===!1){var m={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:t.xaxis,yaxis:t.yaxis,x:a.x,y:a.y,z:C(a),smoothing:0};l([m]),u([m]),p([m],{type:`levels`}),n.ensureSingle(f,`path`,``).attr(`d`,(m.prefixBoundary?`M`+o.join(`L`)+`Z`:``)+v(m,o))}else d=null;r.setClipUrl(e,d,i)}function C(e){var t=e.trace._emptypoints,n=[],r=e.z.length,i=e.z[0].length,a,o=[],s;for(a=0;a<i;a++)o.push(1);for(a=0;a<r;a++)n.push(o.slice());for(a=0;a<t.length;a++)s=t[a],n[s[0]][s[1]]=0;return e.zmask=n,n}}),Ds=h((e,t)=>{var n=S(),r=Yt(),i=_s();t.exports=function(e){var t=e.contours,a=t.start,o=i(t),s=t.size||1,c=Math.floor((o-a)/s)+1,l=t.coloring===`lines`?0:1,u=r.extractOpts(e);isFinite(s)||(s=1,c=1);var d=u.reversescale?r.flipScale(u.colorscale):u.colorscale,f=d.length,p=Array(f),m=Array(f),h,g,_=u.min,v=u.max;if(t.coloring===`heatmap`){for(g=0;g<f;g++)h=d[g],p[g]=h[0]*(v-_)+_,m[g]=h[1];var y=n.extent([_,v,t.start,t.start+s*(c-1)]),b=y[_<v?0:1],x=y[_<v?1:0];b!==_&&(p.splice(0,0,b),m.splice(0,0,m[0])),x!==v&&(p.push(x),m.push(m[m.length-1]))}else{var S=e._input&&typeof e._input.zmin==`number`&&typeof e._input.zmax==`number`;for(S&&(a<=_||o>=v)&&(a<=_&&(a=_),o>=v&&(o=v),c=Math.floor((o-a)/s)+1,l=0),g=0;g<f;g++)h=d[g],p[g]=(h[0]*(c+l-1)-l/2)*s+a,m[g]=h[1];(S||e.autocontour)&&(p[0]>_&&(p.unshift(_),m.unshift(m[0])),p[p.length-1]<v&&(p.push(v),m.push(m[m.length-1])))}return r.makeColorScaleFunc({domain:p,range:m},{noNumericCheck:!0})}}),Os=h((e,t)=>{var n=S(),r=tn(),i=Wo(),a=Ds();t.exports=function(e){var t=n.select(e).selectAll(`g.contour`);t.style(`opacity`,function(e){return e[0].trace.opacity}),t.each(function(e){var t=n.select(this),i=e[0].trace,o=i.contours,s=i.line,c=o.size||1,l=o.start,u=o.type===`constraint`,d=!u&&o.coloring===`lines`,f=!u&&o.coloring===`fill`,p=d||f?a(i):null;t.selectAll(`g.contourlevel`).each(function(e){n.select(this).selectAll(`path`).call(r.lineGroupStyle,s.width,d?p(e.level):s.color,s.dash)});var m=o.labelfont;if(t.selectAll(`g.contourlabels text`).each(function(e){r.font(n.select(this),{weight:m.weight,style:m.style,variant:m.variant,textcase:m.textcase,lineposition:m.lineposition,shadow:m.shadow,family:m.family,size:m.size,color:m.color||(d?p(e.level):s.color)})}),u)t.selectAll(`g.contourfill path`).style(`fill`,i.fillcolor);else if(f){var h;t.selectAll(`g.contourfill path`).style(`fill`,function(e){return h===void 0&&(h=e.level),p(e.level+.5*c)}),h===void 0&&(h=l),t.selectAll(`g.contourbg path`).style(`fill`,p(h-.5*c))}}),i(e)}}),ks=h((e,t)=>{var n=Yt(),r=Ds(),i=_s();function a(e,t,a){var o=t.contours,s=t.line,c=o.size||1,l=o.coloring,u=r(t,{isColorbar:!0});if(l===`heatmap`){var d=n.extractOpts(t);a._fillgradient=d.reversescale?n.flipScale(d.colorscale):d.colorscale,a._zrange=[d.min,d.max]}else l===`fill`&&(a._fillcolor=u);a._line={color:l===`lines`?u:s.color,width:o.showlines===!1?0:s.width,dash:s.dash},a._levels={start:o.start,end:i(o),size:c}}t.exports={min:`zmin`,max:`zmax`,calc:a}}),As=h((e,t)=>{var n=q(),r=Go();t.exports=function(e,t,i,a,o){o||={},o.isContour=!0;var s=r(e,t,i,a,o);return s&&s.forEach(function(e){var t=e.trace;t.contours.type===`constraint`&&(t.fillcolor&&n.opacity(t.fillcolor)?e.color=n.addOpacity(t.fillcolor,1):t.contours.showlines&&n.opacity(t.line.color)&&(e.color=n.addOpacity(t.line.color,1)))}),s}}),js=h((e,t)=>{t.exports={attributes:ds(),supplyDefaults:hs(),crossTraceDefaults:Qo(),calc:vs(),plot:Es().plot,layerName:`contourlayer`,style:Os(),colorbar:ks(),hoverPoints:As(),moduleType:`trace`,name:`histogram2dcontour`,basePlotModule:Ai(),categories:[`cartesian`,`svg`,`2dMap`,`contour`,`histogram`,`showLegend`],meta:{}}}),Ms=h((e,t)=>{t.exports=js()}),Ns=h((e,t)=>{var n=D(),r=ps(),i=q(),a=i.addOpacity,o=i.opacity,s=ls(),c=$().isArrayOrTypedArray,l=s.CONSTRAINT_REDUCTION,u=s.COMPARISON_OPS2;t.exports=function(e,t,n,i,s,c){var u=t.contours,f,p,m,h=n(`contours.operation`);u._operation=l[h],d(n,u),h===`=`?f=u.showlines=!0:(f=n(`contours.showlines`),m=n(`fillcolor`,a((e.line||{}).color||s,.5))),f&&(p=n(`line.color`,m&&o(m)?a(t.fillcolor,1):s),n(`line.width`,2),n(`line.dash`)),n(`line.smoothing`),r(n,i,p,c)};function d(e,t){var r;u.indexOf(t.operation)===-1?(e(`contours.value`,[0,1]),c(t.value)?t.value.length>2?t.value=t.value.slice(2):t.length===0?t.value=[0,1]:t.length<2?(r=parseFloat(t.value[0]),t.value=[r,r+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:n(t.value)&&(r=parseFloat(t.value),t.value=[r,r+1])):(e(`contours.value`,0),n(t.value)||(c(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}}),Ps=h((e,t)=>{var n=$(),r=wo(),i=qr(),a=Ns(),o=fs(),s=ms(),c=To(),l=us();t.exports=function(e,t,u,d){function f(r,i){return n.coerce(e,t,l,r,i)}function p(r){return n.coerce2(e,t,l,r)}if(!r(e,t,f,d)){t.visible=!1;return}i(e,t,d,f),f(`xhoverformat`),f(`yhoverformat`),f(`text`),f(`hovertext`),f(`hoverongaps`),f(`hovertemplate`),f(`hovertemplatefallback`);var m=f(`contours.type`)===`constraint`;f(`connectgaps`,n.isArray1D(t.z)),m?a(e,t,f,d,u):(o(e,t,f,p),s(e,t,f,d)),t.contours&&t.contours.coloring===`heatmap`&&c(f,d),f(`zorder`)}}),Fs=h((e,t)=>{t.exports={attributes:us(),supplyDefaults:Ps(),calc:vs(),plot:Es().plot,style:Os(),colorbar:ks(),hoverPoints:As(),moduleType:`trace`,name:`contour`,basePlotModule:Ai(),categories:[`cartesian`,`svg`,`2dMap`,`contour`,`showLegend`],meta:{}}}),Is=h((e,t)=>{t.exports=Fs()}),Ls=h((e,t)=>{var{hovertemplateAttrs:n,texttemplateAttrs:r,templatefallbackAttrs:i}=ze(),a=wr(),o=Tr(),s=W(),c=Pt(),l=Le().dash,u=z().extendFlat,d=o.marker,f=o.line,p=d.line;t.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:u({},o.mode,{dflt:`markers`}),text:u({},o.text,{}),texttemplate:r({editType:`plot`},{keys:[`a`,`b`,`c`,`text`]}),texttemplatefallback:i({editType:`plot`}),hovertext:u({},o.hovertext,{}),line:{color:f.color,width:f.width,dash:l,backoff:f.backoff,shape:u({},f.shape,{values:[`linear`,`spline`]}),smoothing:f.smoothing,editType:`calc`},connectgaps:o.connectgaps,cliponaxis:o.cliponaxis,fill:u({},o.fill,{values:[`none`,`toself`,`tonext`],dflt:`none`}),fillcolor:a(),marker:u({symbol:d.symbol,opacity:d.opacity,angle:d.angle,angleref:d.angleref,standoff:d.standoff,maxdisplayed:d.maxdisplayed,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode,line:u({width:p.width,dash:p.dash,editType:`calc`},c(`marker.line`)),gradient:d.gradient,editType:`calc`},c(`marker`)),textfont:o.textfont,textposition:o.textposition,selected:o.selected,unselected:o.unselected,hoverinfo:u({},s.hoverinfo,{flags:[`a`,`b`,`c`,`text`,`name`]}),hoveron:o.hoveron,hovertemplate:n(),hovertemplatefallback:i()}}),Rs=h((e,t)=>{var n=$(),r=Cr(),i=Xt(),a=Yr(),o=Xr(),s=Zr(),c=Qr(),l=$r(),u=Ls();t.exports=function(e,t,d,f){function p(r,i){return n.coerce(e,t,u,r,i)}var m=p(`a`),h=p(`b`),g=p(`c`),_;if(m?(_=m.length,h?(_=Math.min(_,h.length),g&&(_=Math.min(_,g.length))):_=g?Math.min(_,g.length):0):h&&g&&(_=Math.min(h.length,g.length)),!_){t.visible=!1;return}t._length=_,p(`sum`),p(`text`),p(`hovertext`),t.hoveron!==`fills`&&(p(`hovertemplate`),p(`hovertemplatefallback`)),p(`mode`,_<r.PTS_LINESONLY?`lines+markers`:`lines`),i.hasMarkers(t)&&a(e,t,d,f,p,{gradient:!0}),i.hasLines(t)&&(o(e,t,d,f,p,{backoff:!0}),s(e,t,p),p(`connectgaps`)),i.hasText(t)&&(p(`texttemplate`),p(`texttemplatefallback`),c(e,t,f,p));var v=[];(i.hasMarkers(t)||i.hasText(t))&&(p(`cliponaxis`),p(`marker.maxdisplayed`),v.push(`points`)),p(`fill`),t.fill!==`none`&&(l(e,t,d,p),i.hasLines(t)||s(e,t,p)),(t.fill===`tonext`||t.fill===`toself`)&&v.push(`fills`),p(`hoveron`,v.join(`+`)||`points`),n.coerceSelectionMarkerOpacity(t,p)}}),zs=h((e,t)=>{var n=sn();t.exports=function(e,t,r){var i={},a=r[t.subplot]._subplot;return i.aLabel=n.tickText(a.aaxis,e.a,!0).text,i.bLabel=n.tickText(a.baxis,e.b,!0).text,i.cLabel=n.tickText(a.caxis,e.c,!0).text,i}}),Bs=h((e,t)=>{var n=D(),r=ai(),i=oi(),a=si(),o=ci().calcMarkerSize,s=[`a`,`b`,`c`],c={a:[`b`,`c`],b:[`a`,`c`],c:[`a`,`b`]};t.exports=function(e,t){var l=e._fullLayout[t.subplot].sum,u=t.sum||l,d={a:t.a,b:t.b,c:t.c},f=t.ids,p,m,h,g,_,v;for(p=0;p<s.length;p++)if(h=s[p],!d[h]){for(_=d[c[h][0]],v=d[c[h][1]],g=Array(_.length),m=0;m<_.length;m++)g[m]=u-_[m]-v[m];d[h]=g}var y=t._length,b=Array(y),x,S,C,w,T,E;for(p=0;p<y;p++)x=d.a[p],S=d.b[p],C=d.c[p],n(x)&&n(S)&&n(C)?(x=+x,S=+S,C=+C,w=l/(x+S+C),w!==1&&(x*=w,S*=w,C*=w),E=x,T=C-S,b[p]={x:T,y:E,a:x,b:S,c:C},f&&(b[p].id=f[p])):b[p]={x:!1,y:!1};return o(t,y),r(e,t),i(b,t),a(b,t),b}}),Vs=h((e,t)=>{var n=hi();t.exports=function(e,t,r){var i=t.plotContainer;i.select(`.scatterlayer`).selectAll(`*`).remove();for(var a=t.xaxis,o=t.yaxis,s={xaxis:a,yaxis:o,plot:i,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},c=t.layers.frontplot.select(`g.scatterlayer`),l=0;l<r.length;l++){var u=r[l];u.length&&(u[0].trace._xA=a,u[0].trace._yA=o)}n(e,s,r,c)}}),Hs=h((e,t)=>{var n=bi();t.exports=function(e,t,r,i){var a=n(e,t,r,i);if(!a||a[0].index===!1)return;var o=a[0];if(o.index===void 0){var s=1-o.y0/e.ya._length,c=e.xa._length,l=c*s/2,u=c-l;return o.x0=Math.max(Math.min(o.x0,u),l),o.x1=Math.max(Math.min(o.x1,u),l),a}var d=o.cd[o.index],f=o.trace,p=o.subplot;o.a=d.a,o.b=d.b,o.c=d.c,o.xLabelVal=void 0,o.yLabelVal=void 0;var m={};m[f.subplot]={_subplot:p};var h=f._module.formatLabels(d,f,m);o.aLabel=h.aLabel,o.bLabel=h.bLabel,o.cLabel=h.cLabel;var g=d.hi||f.hoverinfo,_=[];function v(e,t){_.push(e._hovertitle+`: `+t)}if(!f.hovertemplate){var y=g.split(`+`);y.indexOf(`all`)!==-1&&(y=[`a`,`b`,`c`]),y.indexOf(`a`)!==-1&&v(p.aaxis,o.aLabel),y.indexOf(`b`)!==-1&&v(p.baxis,o.bLabel),y.indexOf(`c`)!==-1&&v(p.caxis,o.cLabel)}return o.extraText=_.join(`<br>`),o.hovertemplate=f.hovertemplate,a}}),Us=h((e,t)=>{t.exports=function(e,t,n,r,i){if(t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),r[i]){var a=r[i];e.a=a.a,e.b=a.b,e.c=a.c}else e.a=t.a,e.b=t.b,e.c=t.c;return e}}),Ws=h((e,t)=>{var n=S(),r=R(),i=Ke(),a=$(),o=a.strTranslate,s=a._,c=q(),l=tn(),u=rn(),d=z().extendFlat,f=Et(),p=sn(),m=hn(),h=Ln(),g=Rn(),_=g.freeMode,v=g.rectMode,y=nn(),b=Ar().prepSelect,x=Ar().selectOnClick,C=Ar().clearOutline,w=Ar().clearSelectionsCache,T=bt();function E(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.updateFx(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}t.exports=E;var D=E.prototype;D.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},D.plot=function(e,t){var n=this,r=t[n.id],i=t._size;n._hasClipOnAxisFalse=!1;for(var a=0;a<e.length;a++)if(e[a][0].trace.cliponaxis===!1){n._hasClipOnAxisFalse=!0;break}n.updateLayers(r),n.adjustLayout(r,i),f.generalUpdatePerTraceModule(n.graphDiv,n,e,r),n.layers.plotbg.select(`path`).call(c.fill,r.bgcolor)},D.makeFramework=function(e){var t=this,n=t.graphDiv,r=e[t.id],i=t.clipId=`clip`+t.layoutId+t.id,o=t.clipIdRelative=`clip-relative`+t.layoutId+t.id;t.clipDef=a.ensureSingleById(e._clips,`clipPath`,i,function(e){e.append(`path`).attr(`d`,`M0,0Z`)}),t.clipDefRelative=a.ensureSingleById(e._clips,`clipPath`,o,function(e){e.append(`path`).attr(`d`,`M0,0Z`)}),t.plotContainer=a.ensureSingle(t.container,`g`,t.id),t.updateLayers(r),l.setClipUrl(t.layers.backplot,i,n),l.setClipUrl(t.layers.grids,i,n)},D.updateFx=function(e){e._ternarylayer.selectAll(`g.toplevel`).style(`cursor`,e.dragmode===`pan`?`move`:`crosshair`)},D.updateLayers=function(e){var t=this,r=t.layers,i=[`draglayer`,`plotbg`,`backplot`,`grids`];e.aaxis.layer===`below traces`&&i.push(`aaxis`,`aline`),e.baxis.layer===`below traces`&&i.push(`baxis`,`bline`),e.caxis.layer===`below traces`&&i.push(`caxis`,`cline`),i.push(`frontplot`),e.aaxis.layer===`above traces`&&i.push(`aaxis`,`aline`),e.baxis.layer===`above traces`&&i.push(`baxis`,`bline`),e.caxis.layer===`above traces`&&i.push(`caxis`,`cline`);var a=t.plotContainer.selectAll(`g.toplevel`).data(i,String),o=[`agrid`,`bgrid`,`cgrid`];a.enter().append(`g`).attr(`class`,function(e){return`toplevel `+e}).each(function(e){var t=n.select(this);r[e]=t,e===`frontplot`?t.append(`g`).classed(`scatterlayer`,!0):e===`backplot`?t.append(`g`).classed(`maplayer`,!0):e===`plotbg`?t.append(`path`).attr(`d`,`M0,0Z`):e===`aline`||e===`bline`||e===`cline`?t.append(`path`):e===`grids`&&o.forEach(function(e){r[e]=t.append(`g`).classed(`grid `+e,!0)})}),a.order()};var O=Math.sqrt(4/3);D.adjustLayout=function(e,t){var n=this,r=e.domain,i=(r.x[0]+r.x[1])/2,a=(r.y[0]+r.y[1])/2,s=r.x[1]-r.x[0],f=r.y[1]-r.y[0],p=s*t.w,m=f*t.h,h=e.sum,g=e.aaxis.min,_=e.baxis.min,v=e.caxis.min,y,b,x,S,C,w;p>O*m?(S=m,x=S*O):(x=p,S=x/O),C=s*x/p,w=f*S/m,y=t.l+t.w*i-x/2,b=t.t+t.h*(1-a)-S/2,n.x0=y,n.y0=b,n.w=x,n.h=S,n.sum=h,n.xaxis={type:`linear`,range:[g+2*v-h,h-g-2*_],domain:[i-C/2,i+C/2],_id:`x`},u(n.xaxis,n.graphDiv._fullLayout),n.xaxis.setScale(),n.xaxis.isPtWithinRange=function(e){return e.a>=n.aaxis.range[0]&&e.a<=n.aaxis.range[1]&&e.b>=n.baxis.range[1]&&e.b<=n.baxis.range[0]&&e.c>=n.caxis.range[1]&&e.c<=n.caxis.range[0]},n.yaxis={type:`linear`,range:[g,h-_-v],domain:[a-w/2,a+w/2],_id:`y`},u(n.yaxis,n.graphDiv._fullLayout),n.yaxis.setScale(),n.yaxis.isPtWithinRange=function(){return!0};var T=n.yaxis.domain[0],E=n.aaxis=d({},e.aaxis,{range:[g,h-_-v],side:`left`,tickangle:(+e.aaxis.tickangle||0)-30,domain:[T,T+w*O],anchor:`free`,position:0,_id:`y`,_length:x});u(E,n.graphDiv._fullLayout),E.setScale();var D=n.baxis=d({},e.baxis,{range:[h-g-v,_],side:`bottom`,domain:n.xaxis.domain,anchor:`free`,position:0,_id:`x`,_length:x});u(D,n.graphDiv._fullLayout),D.setScale();var k=n.caxis=d({},e.caxis,{range:[h-g-_,v],side:`right`,tickangle:(+e.caxis.tickangle||0)+30,domain:[T,T+w*O],anchor:`free`,position:0,_id:`y`,_length:x});u(k,n.graphDiv._fullLayout),k.setScale();var A=`M`+y+`,`+(b+S)+`h`+x+`l-`+x/2+`,-`+S+`Z`;n.clipDef.select(`path`).attr(`d`,A),n.layers.plotbg.select(`path`).attr(`d`,A);var j=`M0,`+S+`h`+x+`l-`+x/2+`,-`+S+`Z`;n.clipDefRelative.select(`path`).attr(`d`,j);var M=o(y,b);n.plotContainer.selectAll(`.scatterlayer,.maplayer`).attr(`transform`,M),n.clipDefRelative.select(`path`).attr(`transform`,null);var N=o(y-D._offset,b+S);n.layers.baxis.attr(`transform`,N),n.layers.bgrid.attr(`transform`,N);var P=o(y+x/2,b)+`rotate(30)`+o(0,-E._offset);n.layers.aaxis.attr(`transform`,P),n.layers.agrid.attr(`transform`,P);var F=o(y+x/2,b)+`rotate(-30)`+o(0,-k._offset);n.layers.caxis.attr(`transform`,F),n.layers.cgrid.attr(`transform`,F),n.drawAxes(!0),n.layers.aline.select(`path`).attr(`d`,E.showline?`M`+y+`,`+(b+S)+`l`+x/2+`,-`+S:`M0,0`).call(c.stroke,E.linecolor||`#000`).style(`stroke-width`,(E.linewidth||0)+`px`),n.layers.bline.select(`path`).attr(`d`,D.showline?`M`+y+`,`+(b+S)+`h`+x:`M0,0`).call(c.stroke,D.linecolor||`#000`).style(`stroke-width`,(D.linewidth||0)+`px`),n.layers.cline.select(`path`).attr(`d`,k.showline?`M`+(y+x/2)+`,`+b+`l`+x/2+`,`+S:`M0,0`).call(c.stroke,k.linecolor||`#000`).style(`stroke-width`,(k.linewidth||0)+`px`),n.graphDiv._context.staticPlot||n.initInteractions(),l.setClipUrl(n.layers.frontplot,n._hasClipOnAxisFalse?null:n.clipId,n.graphDiv)},D.drawAxes=function(e){var t=this,n=t.graphDiv,r=t.id.slice(7)+`title`,i=t.layers,a=t.aaxis,o=t.baxis,c=t.caxis;if(t.drawAx(a),t.drawAx(o),t.drawAx(c),e){var l=Math.max(a.showticklabels?a.tickfont.size/2:0,(c.showticklabels?c.tickfont.size*.75:0)+(c.ticks===`outside`?c.ticklen*.87:0)),u=(o.showticklabels?o.tickfont.size:0)+(o.ticks===`outside`?o.ticklen:0)+3;i[`a-title`]=y.draw(n,`a`+r,{propContainer:a,propName:t.id+`.aaxis.title.text`,placeholder:s(n,`Click to enter Component A title`),attributes:{x:t.x0+t.w/2,y:t.y0-a.title.font.size/3-l,"text-anchor":`middle`}}),i[`b-title`]=y.draw(n,`b`+r,{propContainer:o,propName:t.id+`.baxis.title.text`,placeholder:s(n,`Click to enter Component B title`),attributes:{x:t.x0-u,y:t.y0+t.h+o.title.font.size*.83+u,"text-anchor":`middle`}}),i[`c-title`]=y.draw(n,`c`+r,{propContainer:c,propName:t.id+`.caxis.title.text`,placeholder:s(n,`Click to enter Component C title`),attributes:{x:t.x0+t.w+u,y:t.y0+t.h+c.title.font.size*.83+u,"text-anchor":`middle`}})}},D.drawAx=function(e){var t=this,n=t.graphDiv,r=e._name,i=r.charAt(0),o=e._id,s=t.layers[r],c=30,l=i+`tickLayout`,u=k(e);t[l]!==u&&(s.selectAll(`.`+o+`tick`).remove(),t[l]=u),e.setScale();var d=p.calcTicks(e),f=p.clipEnds(e,d),m=p.makeTransTickFn(e),h=p.getTickSigns(e)[2],g=a.deg2rad(c),_=h*(e.linewidth||1)/2,v=h*e.ticklen,y=t.w,b=t.h,x=i===`b`?`M0,`+_+`l`+Math.sin(g)*v+`,`+Math.cos(g)*v:`M`+_+`,0l`+Math.cos(g)*v+`,`+-Math.sin(g)*v,S={a:`M0,0l`+b+`,-`+y/2,b:`M0,0l-`+y/2+`,-`+b,c:`M0,0l-`+b+`,`+y/2}[i];p.drawTicks(n,e,{vals:e.ticks===`inside`?f:d,layer:s,path:x,transFn:m,crisp:!1}),p.drawGrid(n,e,{vals:f,layer:t.layers[i+`grid`],path:S,transFn:m,crisp:!1}),p.drawLabels(n,e,{vals:d,layer:s,transFn:m,labelFns:p.makeLabelFns(e,0,c)})};function k(e){return e.ticks+String(e.ticklen)+String(e.showticklabels)}var A=T.MINZOOM/2+.87,j=`m-0.87,.5h`+A+`v3h-`+(A+5.2)+`l`+(A/2+2.6)+`,-`+(A*.87+4.5)+`l2.6,1.5l-`+A/2+`,`+A*.87+`Z`,M=`m0.87,.5h-`+A+`v3h`+(A+5.2)+`l-`+(A/2+2.6)+`,-`+(A*.87+4.5)+`l-2.6,1.5l`+A/2+`,`+A*.87+`Z`,N=`m0,1l`+A/2+`,`+A*.87+`l2.6,-1.5l-`+(A/2+2.6)+`,-`+(A*.87+4.5)+`l-`+(A/2+2.6)+`,`+(A*.87+4.5)+`l2.6,1.5l`+A/2+`,-`+A*.87+`Z`,P=`m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z`,F=!0;D.clearOutline=function(){w(this.dragOptions),C(this.dragOptions.gd)},D.initInteractions=function(){var e=this,t=e.layers.plotbg.select(`path`).node(),n=e.graphDiv,u=n._fullLayout._zoomlayer,d,f;this.dragOptions={element:t,gd:n,plotinfo:{id:e.id,domain:n._fullLayout[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis},subplot:e.id,prepFn:function(t,r,i){e.dragOptions.xaxes=[e.xaxis],e.dragOptions.yaxes=[e.yaxis],d=n._fullLayout._invScaleX,f=n._fullLayout._invScaleY;var a=e.dragOptions.dragmode=n._fullLayout.dragmode;_(a)?e.dragOptions.minDrag=1:e.dragOptions.minDrag=void 0,a===`zoom`?(e.dragOptions.moveFn=U,e.dragOptions.clickFn=R,e.dragOptions.doneFn=W,z(t,r,i)):a===`pan`?(e.dragOptions.moveFn=K,e.dragOptions.clickFn=R,e.dragOptions.doneFn=q,G(),e.clearOutline(n)):(v(a)||_(a))&&b(t,r,i,e.dragOptions,a)}};var p,g,y,S,C,w,E,D,k,A;function L(t){var n={};return n[e.id+`.aaxis.min`]=t.a,n[e.id+`.baxis.min`]=t.b,n[e.id+`.caxis.min`]=t.c,n}function R(t,r){var a=n._fullLayout.clickmode;I(n),t===2&&(n.emit(`plotly_doubleclick`,null),i.call(`_guiRelayout`,n,L({a:0,b:0,c:0}))),a.indexOf(`select`)>-1&&t===1&&x(r,n,[e.xaxis],[e.yaxis],e.id,e.dragOptions),a.indexOf(`event`)>-1&&h.click(n,r,e.id)}function z(i,s,l){var d=t.getBoundingClientRect();p=s-d.left,g=l-d.top,n._fullLayout._calcInverseTransform(n);var f=n._fullLayout._invTransform,m=a.apply3DTransform(f)(p,g);p=m[0],g=m[1],y={a:e.aaxis.range[0],b:e.baxis.range[1],c:e.caxis.range[1]},C=y,S=e.aaxis.range[1]-y.a,w=r(e.graphDiv._fullLayout[e.id].bgcolor).getLuminance(),E=`M0,`+e.h+`L`+e.w/2+`, 0L`+e.w+`,`+e.h+`Z`,D=!1,k=u.append(`path`).attr(`class`,`zoombox`).attr(`transform`,o(e.x0,e.y0)).style({fill:w>.2?`rgba(0,0,0,0)`:`rgba(255,255,255,0)`,"stroke-width":0}).attr(`d`,E),A=u.append(`path`).attr(`class`,`zoombox-corners`).attr(`transform`,o(e.x0,e.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr(`d`,`M0,0Z`),e.clearOutline(n)}function B(t,n){return 1-n/e.h}function V(t,n){return 1-(t+(e.h-n)/Math.sqrt(3))/e.w}function H(t,n){return(t-(e.h-n)/Math.sqrt(3))/e.w}function U(t,r){var i=p+t*d,a=g+r*f,o=Math.max(0,Math.min(1,B(p,g),B(i,a))),s=Math.max(0,Math.min(1,V(p,g),V(i,a))),c=Math.max(0,Math.min(1,H(p,g),H(i,a))),l=(o/2+c)*e.w,u=(1-o/2-s)*e.w,m=(l+u)/2,h=u-l,_=(1-o)*e.h,v=_-h/O;h<T.MINZOOM?(C=y,k.attr(`d`,E),A.attr(`d`,`M0,0Z`)):(C={a:y.a+o*S,b:y.b+s*S,c:y.c+c*S},k.attr(`d`,E+`M`+l+`,`+_+`H`+u+`L`+m+`,`+v+`L`+l+`,`+_+`Z`),A.attr(`d`,`M`+p+`,`+g+P+`M`+l+`,`+_+j+`M`+u+`,`+_+M+`M`+m+`,`+v+N)),D||=(k.transition().style(`fill`,w>.2?`rgba(0,0,0,0.4)`:`rgba(255,255,255,0.3)`).duration(200),A.transition().style(`opacity`,1).duration(200),!0),n.emit(`plotly_relayouting`,L(C))}function W(){I(n),C!==y&&(i.call(`_guiRelayout`,n,L(C)),F&&n.data&&n._context.showTips&&(a.notifier(s(n,`Double-click to zoom back out`),`long`,n),F=!1))}function G(){y={a:e.aaxis.range[0],b:e.baxis.range[1],c:e.caxis.range[1]},C=y}function K(t,r){var i=t/e.xaxis._m,s=r/e.yaxis._m;C={a:y.a-s,b:y.b+(i+s)/2,c:y.c-(i-s)/2};var c=[C.a,C.b,C.c].sort(a.sorterAsc),u={a:c.indexOf(C.a),b:c.indexOf(C.b),c:c.indexOf(C.c)};c[0]<0&&(c[1]+c[0]/2<0?(c[2]+=c[0]+c[1],c[0]=c[1]=0):(c[2]+=c[0]/2,c[1]+=c[0]/2,c[0]=0),C={a:c[u.a],b:c[u.b],c:c[u.c]},r=(y.a-C.a)*e.yaxis._m,t=(y.c-C.c-y.b+C.b)*e.xaxis._m);var d=o(e.x0+t,e.y0+r);e.plotContainer.selectAll(`.scatterlayer,.maplayer`).attr(`transform`,d);var f=o(-t,-r);e.clipDefRelative.select(`path`).attr(`transform`,f),e.aaxis.range=[C.a,e.sum-C.b-C.c],e.baxis.range=[e.sum-C.a-C.c,C.b],e.caxis.range=[e.sum-C.a-C.b,C.c],e.drawAxes(!1),e._hasClipOnAxisFalse&&e.plotContainer.select(`.scatterlayer`).selectAll(`.trace`).call(l.hideOutsideRangePoints,e),n.emit(`plotly_relayouting`,L(C))}function q(){i.call(`_guiRelayout`,n,L(C))}t.onmousemove=function(r){h.hover(n,r,e.id),n._fullLayout._lasthover=t,n._fullLayout._hoversubplot=e.id},t.onmouseout=function(e){n._dragging||m.unhover(n,e)},m.init(this.dragOptions)};function I(e){n.select(e).selectAll(`.zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners`).remove()}}),Gs=h((e,t)=>{var n=K(),r=Da().attributes,i=Mt(),a=Ie().overrideAll,o=z().extendFlat,s={title:{text:i.title.text,font:i.title.font},color:i.color,tickmode:i.minor.tickmode,nticks:o({},i.nticks,{dflt:6,min:1}),tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,ticklabelstep:i.ticklabelstep,showticklabels:i.showticklabels,labelalias:i.labelalias,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash,layer:i.layer,min:{valType:`number`,dflt:0,min:0}},c=t.exports=a({domain:r({name:`ternary`}),bgcolor:{valType:`color`,dflt:n.background},sum:{valType:`number`,dflt:1,min:0},aaxis:s,baxis:s,caxis:s},`plot`,`from-root`);c.uirevision={valType:`any`,editType:`none`},c.aaxis.uirevision=c.baxis.uirevision=c.caxis.uirevision={valType:`any`,editType:`none`}}),Ks=h((e,t)=>{var n=$(),r=yt(),i=Da().defaults;t.exports=function(e,t,a,o){var s=o.type,c=o.attributes,l=o.handleDefaults,u=o.partition||`x`,d=t._subplots[s],f=d.length,p=f&&d[0].replace(/\d+$/,``),m,h;function g(e,t){return n.coerce(m,h,c,e,t)}for(var _=0;_<f;_++){var v=d[_];m=e[v]?e[v]:e[v]={},h=r.newContainer(t,v,p),o.noUirevision||g(`uirevision`,t.uirevision);var y={};y[u]=[_/f,(_+1)/f],i(h,t,g,y),o.id=v,l(m,h,g,o)}}}),qs=h((e,t)=>{var n=q(),r=yt(),i=$(),a=Ks(),o=Ht(),s=Ut(),c=zt(),l=Rt(),u=Ti(),d=Gs(),f=[`aaxis`,`baxis`,`caxis`];t.exports=function(e,t,n){a(e,t,n,{type:`ternary`,attributes:d,handleDefaults:p,font:t.font,paper_bgcolor:t.paper_bgcolor})};function p(e,t,i,a){var o=i(`bgcolor`),s=i(`sum`);a.bgColor=n.combine(o,a.paper_bgcolor);for(var c,l,u,d=0;d<f.length;d++)c=f[d],l=e[c]||{},u=r.newContainer(t,c),u._name=c,m(l,u,a,t);var p=t.aaxis,h=t.baxis,g=t.caxis;p.min+h.min+g.min>=s&&(p.min=0,h.min=0,g.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function m(e,t,n,r){var a=d[t._name];function f(n,r){return i.coerce(e,t,a,n,r)}f(`uirevision`,r.uirevision),t.type=`linear`;var p=f(`color`),m=p===a.color.dflt?n.font.color:p,h=t._name.charAt(0).toUpperCase(),g=`Component `+h,_=f(`title.text`,g);t._hovertitle=_===g?_:h,i.coerceFont(f,`title.font`,n.font,{overrideDflt:{size:i.bigFont(n.font.size),color:m}}),f(`min`),l(e,t,f,`linear`),s(e,t,f,`linear`),o(e,t,f,`linear`,{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),c(e,t,f,{outerTicks:!0}),f(`showticklabels`)&&(i.coerceFont(f,`tickfont`,n.font,{overrideDflt:{color:m}}),f(`tickangle`),f(`tickformat`)),u(e,t,f,{dfltColor:p,bgColor:n.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),f(`hoverformat`),f(`layer`)}}),Js=h(e=>{var t=Ws(),n=wt().getSubplotCalcData,r=$().counterRegex,i=`ternary`;e.name=i;var a=e.attr=`subplot`;e.idRoot=i,e.idRegex=e.attrRegex=r(i);var o=e.attributes={};o[a]={valType:`subplotid`,dflt:`ternary`,editType:`calc`},e.layoutAttributes=Gs(),e.supplyLayoutDefaults=qs(),e.plot=function(e){for(var r=e._fullLayout,a=e.calcdata,o=r._subplots[i],s=0;s<o.length;s++){var c=o[s],l=n(a,i,c),u=r[c]._subplot;u||(u=new t({id:c,graphDiv:e,container:r._ternarylayer.node()},r),r[c]._subplot=u),u.plot(l,r,e._promises)}},e.clean=function(e,t,n,r){for(var a=r._subplots[i]||[],o=0;o<a.length;o++){var s=a[o],c=r[s]._subplot;!t[s]&&c&&(c.plotContainer.remove(),c.clipDef.remove(),c.clipDefRelative.remove(),c.layers[`a-title`].remove(),c.layers[`b-title`].remove(),c.layers[`c-title`].remove())}},e.updateFx=function(e){var t=e._fullLayout;t._ternarylayer.selectAll(`g.toplevel`).style(`cursor`,t.dragmode===`pan`?`move`:`crosshair`)}}),Ys=h((e,t)=>{t.exports={attributes:Ls(),supplyDefaults:Rs(),colorbar:gi(),formatLabels:zs(),calc:Bs(),plot:Vs(),style:vi().style,styleOnSelect:vi().styleOnSelect,hoverPoints:Hs(),selectPoints:xi(),eventData:Us(),moduleType:`trace`,name:`scatterternary`,basePlotModule:Js(),categories:[`ternary`,`symbols`,`showLegend`,`scatter-like`],meta:{}}}),Xs=h((e,t)=>{t.exports=Ys()}),Zs=h((e,t)=>{var n=lo(),r=z().extendFlat,i=jt().axisHoverFormat;t.exports={y:n.y,x:n.x,x0:n.x0,y0:n.y0,xhoverformat:i(`x`),yhoverformat:i(`y`),name:r({},n.name,{}),orientation:r({},n.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:n.fillcolor,points:r({},n.boxpoints,{}),jitter:r({},n.jitter,{}),pointpos:r({},n.pointpos,{}),width:r({},n.width,{}),marker:n.marker,text:n.text,hovertext:n.hovertext,hovertemplate:n.hovertemplate,hovertemplatefallback:n.hovertemplatefallback,quartilemethod:n.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:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,hoveron:{valType:`flaglist`,flags:[`violins`,`points`,`kde`],dflt:`violins+points+kde`,extras:[`all`],editType:`style`},zorder:n.zorder}}),Qs=h((e,t)=>{var n=uo(),r=$().extendFlat;t.exports={violinmode:r({},n.boxmode,{}),violingap:r({},n.boxgap,{}),violingroupgap:r({},n.boxgroupgap,{})}}),$s=h((e,t)=>{var n=$(),r=q(),i=fo(),a=Zs();t.exports=function(e,t,o,s){function c(r,i){return n.coerce(e,t,a,r,i)}function l(r,i){return n.coerce2(e,t,a,r,i)}if(i.handleSampleDefaults(e,t,c,s),t.visible!==!1){c(`bandwidth`),c(`side`),c(`width`)||(c(`scalegroup`,t.name),c(`scalemode`));var u=c(`span`),d;Array.isArray(u)&&(d=`manual`),c(`spanmode`,d);var f=c(`line.color`,(e.marker||{}).color||o),p=c(`line.width`),m=c(`fillcolor`,r.addOpacity(t.line.color,.5));i.handlePointsDefaults(e,t,c,{prefix:``});var h=l(`box.width`),g=l(`box.fillcolor`,m),_=l(`box.line.color`,f),v=l(`box.line.width`,p);c(`box.visible`,!!(h||g||_||v))||(t.box={visible:!1});var y=l(`meanline.color`,f),b=l(`meanline.width`,p);c(`meanline.visible`,!!(y||b))||(t.meanline={visible:!1}),c(`quartilemethod`),c(`zorder`)}}}),ec=h((e,t)=>{var n=$(),r=Qs(),i=po();t.exports=function(e,t,a){function o(i,a){return n.coerce(e,t,r,i,a)}i._supply(e,t,a,o,`violin`)}}),tc=h(e=>{var t=$(),n={gaussian:function(e){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*e*e)}};e.makeKDE=function(e,t,r){var i=r.length,a=n.gaussian,o=e.bandwidth,s=1/(i*o);return function(e){for(var t=0,n=0;n<i;n++)t+=a((e-r[n])/o);return s*t}},e.getPositionOnKdePath=function(e,n,r){var i,a;n.orientation===`h`?(i=`y`,a=`x`):(i=`x`,a=`y`);var o=t.findPointOnPath(e.path,r,a,{pathLength:e.pathLength}),s=e.posCenterPx,c=o[i];return[c,n.side===`both`?2*s-c:s]},e.getKdeValue=function(t,n,r){var i=t.pts.map(e.extractVal);return e.makeKDE(t,n,i)(r)/t.posDensityScale},e.extractVal=function(e){return e.v}}),nc=h((e,t)=>{var n=$(),r=sn(),i=mo(),a=tc(),o=O().BADNUM;t.exports=function(e,t){var o=i(e,t);if(o[0].t.empty)return o;for(var s=e._fullLayout,u=r.getFromId(e,t[t.orientation===`h`?`xaxis`:`yaxis`]),d=1/0,f=-1/0,p=0,m=0,h=0;h<o.length;h++){var g=o[h],_=g.pts.map(a.extractVal),v=g.bandwidth=c(t,g,_),y=g.span=l(t,g,u,v);if(g.min===g.max&&v===0)y=g.span=[g.min,g.max],g.density=[{v:1,t:y[0]}],g.bandwidth=v,p=Math.max(p,1);else{var b=y[1]-y[0],x=Math.ceil(b/(v/3)),S=b/x;if(!isFinite(S)||!isFinite(x))return n.error(`Something went wrong with computing the violin span`),o[0].t.empty=!0,o;var C=a.makeKDE(g,t,_);g.density=Array(x+1);for(var w=0;w<g.density.length;w++){var T=y[0]+w*S,E=C(T);g.density[w]={v:E,t:T},p=Math.max(p,E)}}m=Math.max(m,_.length),d=Math.min(d,y[0]),f=Math.max(f,y[1])}var D=r.findExtremes(u,[d,f],{padded:!0});if(t._extremes[u._id]=D,t.width)o[0].t.maxKDE=p;else{var O=s._violinScaleGroupStats,k=t.scalegroup,A=O[k];A?(A.maxKDE=Math.max(A.maxKDE,p),A.maxCount=Math.max(A.maxCount,m)):O[k]={maxKDE:p,maxCount:m}}return o[0].t.labels.kde=n._(e,`kde:`),o};function s(e,t,n){return 1.059*Math.min(t,n/1.349)*e**-.2}function c(e,t,r){var i=t.max-t.min;if(!i)return e.bandwidth?e.bandwidth:0;if(e.bandwidth)return Math.max(e.bandwidth,i/1e4);var a=r.length,o=n.stdev(r,a-1,t.mean);return Math.max(s(a,o,t.q3-t.q1),i/100)}function l(e,t,n,i){var a=e.spanmode,s=e.span||[],c=[t.min,t.max],l=[t.min-2*i,t.max+2*i],u;function d(r){var i=s[r],a=n.type===`multicategory`?n.r2c(i):n.d2c(i,0,e[t.valLetter+`calendar`]);return a===o?l[r]:a}u=a===`soft`?l:a===`hard`?c:[d(0),d(1)];var f={type:`linear`,range:u};return r.setConvert(f),f.cleanRange(),u}}),rc=h((e,t)=>{var n=ho().setPositionOffset,r=[`v`,`h`];t.exports=function(e,t){for(var i=e.calcdata,a=t.xaxis,o=t.yaxis,s=0;s<r.length;s++){for(var c=r[s],l=c===`h`?o:a,u=[],d=0;d<i.length;d++){var f=i[d],p=f[0].t,m=f[0].trace;m.visible===!0&&m.type===`violin`&&!p.empty&&m.orientation===c&&m.xaxis===a._id&&m.yaxis===o._id&&u.push(d)}n(`violin`,e,u,l)}}}),ic=h((e,t)=>{var n=S(),r=$(),i=tn(),a=go(),o=pi(),s=tc();t.exports=function(e,t,c,l){var u=e._context.staticPlot,d=e._fullLayout,f=t.xaxis,p=t.yaxis;function m(e,t){var n=o(e,{xaxis:f,yaxis:p,trace:t,connectGaps:!0,baseTolerance:.75,shape:`spline`,simplify:!0,linearized:!0});return i.smoothopen(n[0],1)}r.makeTraceGroups(l,c,`trace violins`).each(function(e){var i=n.select(this),o=e[0],c=o.t,l=o.trace;if(l.visible!==!0||c.empty){i.remove();return}var h=c.bPos,g=c.bdPos,_=t[c.valLetter+`axis`],v=t[c.posLetter+`axis`],y=l.side===`both`,b=y||l.side===`positive`,x=y||l.side===`negative`,S=i.selectAll(`path.violin`).data(r.identity);S.enter().append(`path`).style(`vector-effect`,u?`none`:`non-scaling-stroke`).attr(`class`,`violin`),S.exit().remove(),S.each(function(e){var t=n.select(this),r=e.density,i=r.length,a=v.c2l(e.pos+h,!0),o=v.l2p(a),s;if(l.width)s=c.maxKDE/g;else{var u=d._violinScaleGroupStats[l.scalegroup];s=l.scalemode===`count`?u.maxKDE/g*(u.maxCount/e.pts.length):u.maxKDE/g}var f,p,S,C,w,T,E;if(b){for(T=Array(i),C=0;C<i;C++)E=T[C]={},E[c.posLetter]=a+r[C].v/s,E[c.valLetter]=_.c2l(r[C].t,!0);f=m(T,l)}if(x){for(T=Array(i),w=0,C=i-1;w<i;w++,C--)E=T[w]={},E[c.posLetter]=a-r[C].v/s,E[c.valLetter]=_.c2l(r[C].t,!0);p=m(T,l)}if(y)S=f+`L`+p.slice(1)+`Z`;else{var D=[o,_.c2p(r[0].t)],O=[o,_.c2p(r[i-1].t)];l.orientation===`h`&&(D.reverse(),O.reverse()),S=b?`M`+D+`L`+f.slice(1)+`L`+O:`M`+O+`L`+p.slice(1)+`L`+D}t.attr(`d`,S),e.posCenterPx=o,e.posDensityScale=s*g,e.path=t.node(),e.pathLength=e.path.getTotalLength()/(y?2:1)});var C=l.box,w=C.width,T=(C.line||{}).width,E,D;y?(E=g*w,D=0):b?(E=[0,g*w/2],D=T*{x:1,y:-1}[c.posLetter]):(E=[g*w/2,0],D=T*{x:-1,y:1}[c.posLetter]),a.plotBoxAndWhiskers(i,{pos:v,val:_},l,{bPos:h,bdPos:E,bPosPxOffset:D}),a.plotBoxMean(i,{pos:v,val:_},l,{bPos:h,bdPos:E,bPosPxOffset:D});var O;!l.box.visible&&l.meanline.visible&&(O=r.identity);var k=i.selectAll(`path.meanline`).data(O||[]);k.enter().append(`path`).attr(`class`,`meanline`).style(`fill`,`none`).style(`vector-effect`,u?`none`:`non-scaling-stroke`),k.exit().remove(),k.each(function(e){var t=_.c2p(e.mean,!0),r=s.getPositionOnKdePath(e,l,t);n.select(this).attr(`d`,l.orientation===`h`?`M`+t+`,`+r[0]+`V`+r[1]:`M`+r[0]+`,`+t+`H`+r[1])}),a.plotPoints(i,{x:f,y:p},l,c)})}}),ac=h((e,t)=>{var n=S(),r=q(),i=vi().stylePoints;t.exports=function(e){var t=n.select(e).selectAll(`g.trace.violins`);t.style(`opacity`,function(e){return e[0].trace.opacity}),t.each(function(t){var a=t[0].trace,o=n.select(this),s=a.box||{},c=s.line||{},l=a.meanline||{},u=l.width;o.selectAll(`path.violin`).style(`stroke-width`,a.line.width+`px`).call(r.stroke,a.line.color).call(r.fill,a.fillcolor),o.selectAll(`path.box`).style(`stroke-width`,c.width+`px`).call(r.stroke,c.color).call(r.fill,s.fillcolor);var d={"stroke-width":u+`px`,"stroke-dasharray":2*u+`px,`+u+`px`};o.selectAll(`path.mean`).style(d).call(r.stroke,l.color),o.selectAll(`path.meanline`).style(d).call(r.stroke,l.color),i(o,a,e)})}}),oc=h((e,t)=>{var n=q(),r=$(),i=sn(),a=vo(),o=tc();t.exports=function(e,t,s,c,l){l||={};var u=l.hoverLayer,d=e.cd,f=d[0].trace,p=f.hoveron,m=p.indexOf(`violins`)!==-1,h=p.indexOf(`kde`)!==-1,g=[],_,v;if(m||h){var y=a.hoverOnBoxes(e,t,s,c);if(h&&y.length>0){var b=e.xa,x=e.ya,S,C,w,T,E;f.orientation===`h`?(E=t,S=`y`,w=x,C=`x`,T=b):(E=s,S=`x`,w=b,C=`y`,T=x);var D=d[e.index];if(E>=D.span[0]&&E<=D.span[1]){var O=r.extendFlat({},e),k=T.c2p(E,!0),A=o.getKdeValue(D,f,E),j=o.getPositionOnKdePath(D,f,k),M=w._offset,N=w._length;O[S+`0`]=j[0],O[S+`1`]=j[1],O[C+`0`]=O[C+`1`]=k,O[C+`Label`]=C+`: `+i.hoverLabelText(T,E,f[C+`hoverformat`])+`, `+d[0].t.labels.kde+` `+A.toFixed(3);for(var P=0,F=0;F<y.length;F++)if(y[F].attr===`med`){P=F;break}O.spikeDistance=y[P].spikeDistance;var I=S+`Spike`;O[I]=y[P][I],y[P].spikeDistance=void 0,y[P][I]=void 0,O.hovertemplate=!1,g.push(O),v={},v[S+`1`]=r.constrain(M+j[0],M,M+N),v[S+`2`]=r.constrain(M+j[1],M,M+N),v[C+`1`]=v[C+`2`]=T._offset+k}}m&&(g=g.concat(y))}p.indexOf(`points`)!==-1&&(_=a.hoverOnPoints(e,t,s));var L=u.selectAll(`.violinline-`+f.uid).data(v?[0]:[]);return L.enter().append(`line`).classed(`violinline-`+f.uid,!0).attr(`stroke-width`,1.5),L.exit().remove(),L.attr(v).call(n.stroke,e.color),c===`closest`?_?[_]:g:(_&&g.push(_),g)}}),sc=h((e,t)=>{t.exports={attributes:Zs(),layoutAttributes:Qs(),supplyDefaults:$s(),crossTraceDefaults:fo().crossTraceDefaults,supplyLayoutDefaults:ec(),calc:nc(),crossTraceCalc:rc(),plot:ic(),style:ac(),styleOnSelect:vi().styleOnSelect,hoverPoints:oc(),selectPoints:bo(),moduleType:`trace`,name:`violin`,basePlotModule:Ai(),categories:[`cartesian`,`svg`,`symbols`,`oriented`,`box-violin`,`showLegend`,`violinLayout`,`zoomScale`],meta:{}}}),cc=h((e,t)=>{t.exports=sc()}),lc=h((e,t)=>{t.exports={eventDataKeys:[`percentInitial`,`percentPrevious`,`percentTotal`]}}),uc=h((e,t)=>{var n=qa(),r=Tr().line,i=W(),a=jt().axisHoverFormat,{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:c}=ze(),l=lc(),u=z().extendFlat,d=q();t.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:a(`x`),yhoverformat:a(`y`),hovertext:n.hovertext,hovertemplate:o({},{keys:l.eventDataKeys}),hovertemplatefallback:c(),hoverinfo:u({},i.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:s({editType:`plot`},{keys:l.eventDataKeys.concat([`label`,`value`])}),texttemplatefallback:c({editType:`plot`}),text:n.text,textposition:n.textposition,insidetextanchor:u({},n.insidetextanchor,{dflt:`middle`}),textangle:u({},n.textangle,{dflt:0}),textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:n.outsidetextfont,constraintext:n.constraintext,cliponaxis:n.cliponaxis,orientation:u({},n.orientation,{}),offset:u({},n.offset,{arrayOk:!1}),width:u({},n.width,{arrayOk:!1}),marker:f(),connector:{fillcolor:{valType:`color`,editType:`style`},line:{color:u({},r.color,{dflt:d.defaultLine}),width:u({},r.width,{dflt:0,editType:`plot`}),dash:r.dash,editType:`style`},visible:{valType:`boolean`,dflt:!0,editType:`plot`},editType:`plot`},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,zorder:n.zorder};function f(){var e=u({},n.marker);return delete e.pattern,delete e.cornerradius,e}}),dc=h((e,t)=>{t.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`}}}),fc=h((e,t)=>{var n=$(),r=ti(),i=Xa().handleText,a=Kr(),o=qr(),s=uc(),c=q();function l(e,t,r,l){function d(r,i){return n.coerce(e,t,s,r,i)}if(!a(e,t,l,d)){t.visible=!1;return}o(e,t,l,d),d(`xhoverformat`),d(`yhoverformat`),d(`orientation`,t.y&&!t.x?`v`:`h`),d(`offset`),d(`width`);var f=d(`text`);d(`hovertext`),d(`hovertemplate`),d(`hovertemplatefallback`),i(e,t,l,d,d(`textposition`),{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),t.textposition!==`none`&&!t.texttemplate&&d(`textinfo`,n.isArrayOrTypedArray(f)?`text+value`:`value`);var p=d(`marker.color`,r);d(`marker.line.color`,c.defaultLine),d(`marker.line.width`),d(`connector.visible`)&&(d(`connector.fillcolor`,u(p)),d(`connector.line.width`)&&(d(`connector.line.color`),d(`connector.line.dash`))),d(`zorder`)}function u(e){var t=n.isArrayOrTypedArray(e)?`#000`:e;return c.addOpacity(t,.5*c.opacity(t))}function d(e,t){var i,a;function o(e){return n.coerce(a._input,a,s,e)}for(var c=0;c<e.length;c++)a=e[c],a.type===`funnel`&&(i=a._input,r(i,a,t,o,t.funnelmode))}t.exports={supplyDefaults:l,crossTraceDefaults:d}}),pc=h((e,t)=>{var n=$(),r=dc();t.exports=function(e,t,i){var a=!1;function o(i,a){return n.coerce(e,t,r,i,a)}for(var s=0;s<i.length;s++){var c=i[s];if(c.visible&&c.type===`funnel`){a=!0;break}}a&&(o(`funnelmode`),o(`funnelgap`,.2),o(`funnelgroupgap`))}}),mc=h((e,t)=>{var n=$();t.exports=function(e,t){for(var r=0;r<e.length;r++)e[r].i=r;n.mergeArray(t.text,e,`tx`),n.mergeArray(t.hovertext,e,`htx`);var i=t.marker;if(i){n.mergeArray(i.opacity,e,`mo`),n.mergeArray(i.color,e,`mc`);var a=i.line;a&&(n.mergeArray(a.color,e,`mlc`),n.mergeArrayCastPositive(a.width,e,`mlw`))}}}),hc=h((e,t)=>{var n=sn(),r=ii(),i=mc(),a=si(),o=O().BADNUM;t.exports=function(e,t){var c=n.getFromId(e,t.xaxis||`x`),l=n.getFromId(e,t.yaxis||`y`),u,d,f,p,m,h,g,_;t.orientation===`h`?(u=c.makeCalcdata(t,`x`),f=l.makeCalcdata(t,`y`),p=r(t,l,`y`,f),m=!!t.yperiodalignment,h=`y`):(u=l.makeCalcdata(t,`y`),f=c.makeCalcdata(t,`x`),p=r(t,c,`x`,f),m=!!t.xperiodalignment,h=`x`),d=p.vals;var v=Math.min(d.length,u.length),y=Array(v);for(t._base=[],g=0;g<v;g++){u[g]<0&&(u[g]=o);var b=!1;u[g]!==o&&g+1<v&&u[g+1]!==o&&(b=!0),_=y[g]={p:d[g],s:u[g],cNext:b},t._base[g]=-.5*_.s,m&&(y[g].orig_p=f[g],y[g][h+`End`]=p.ends[g],y[g][h+`Start`]=p.starts[g]),t.ids&&(_.id=String(t.ids[g])),g===0&&(y[0].vTotal=0),y[0].vTotal+=s(_.s),_.begR=s(_.s)/s(y[0].s)}var x;for(g=0;g<v;g++)_=y[g],_.s!==o&&(_.sumR=_.s/y[0].vTotal,_.difR=x===void 0?1:_.s/x,x=_.s);return i(y,t),a(y,t),y};function s(e){return e===o?0:e}}),gc=h((e,t)=>{var n=di().setGroupPositions;t.exports=function(e,t){var r=e._fullLayout,i=e._fullData,a=e.calcdata,o=t.xaxis,s=t.yaxis,c=[],l=[],u=[],d,f;for(f=0;f<i.length;f++){var p=i[f],m=p.orientation===`h`;p.visible===!0&&p.xaxis===o._id&&p.yaxis===s._id&&p.type===`funnel`&&(d=a[f],m?u.push(d):l.push(d),c.push(d))}var h={mode:r.funnelmode,norm:r.funnelnorm,gap:r.funnelgap,groupgap:r.funnelgroupgap};for(n(e,o,s,l,h),n(e,s,o,u,h),f=0;f<c.length;f++){d=c[f];for(var g=0;g<d.length;g++)g+1<d.length&&(d[g].nextP0=d[g+1].p0,d[g].nextS0=d[g+1].s0,d[g].nextP1=d[g+1].p1,d[g].nextS1=d[g+1].s1)}}}),_c=h((e,t)=>{var n=S(),r=$(),i=tn(),a=O().BADNUM,o=ro(),s=eo().clearMinTextSize;t.exports=function(e,t,n,r){var i=e._fullLayout;s(`funnel`,i),c(e,t,n,r),l(e,t,n,r),o.plot(e,t,n,r,{mode:i.funnelmode,norm:i.funnelmode,gap:i.funnelgap,groupgap:i.funnelgroupgap})};function c(e,t,o,s){var c=t.xaxis,l=t.yaxis;r.makeTraceGroups(s,o,`trace bars`).each(function(o){var s=n.select(this),d=o[0].trace,f=r.ensureSingle(s,`g`,`regions`);if(!d.connector||!d.connector.visible){f.remove();return}var p=d.orientation===`h`,m=f.selectAll(`g.region`).data(r.identity);m.enter().append(`g`).classed(`region`,!0),m.exit().remove();var h=m.size();m.each(function(o,s){if(!(s!==h-1&&!o.cNext)){var d=u(o,c,l,p),f=d[0],m=d[1],g=``;f[0]!==a&&m[0]!==a&&f[1]!==a&&m[1]!==a&&f[2]!==a&&m[2]!==a&&f[3]!==a&&m[3]!==a&&(p?g+=`M`+f[0]+`,`+m[1]+`L`+f[2]+`,`+m[2]+`H`+f[3]+`L`+f[1]+`,`+m[1]+`Z`:g+=`M`+f[1]+`,`+m[1]+`L`+f[2]+`,`+m[3]+`V`+m[2]+`L`+f[1]+`,`+m[0]+`Z`),g===``&&(g=`M0,0Z`),r.ensureSingle(n.select(this),`path`).attr(`d`,g).call(i.setClipUrl,t.layerClipId,e)}})})}function l(e,t,a,o){var s=t.xaxis,c=t.yaxis;r.makeTraceGroups(o,a,`trace bars`).each(function(a){var o=n.select(this),l=a[0].trace,d=r.ensureSingle(o,`g`,`lines`);if(!l.connector||!l.connector.visible||!l.connector.line.width){d.remove();return}var f=l.orientation===`h`,p=d.selectAll(`g.line`).data(r.identity);p.enter().append(`g`).classed(`line`,!0),p.exit().remove();var m=p.size();p.each(function(a,o){if(!(o!==m-1&&!a.cNext)){var l=u(a,s,c,f),d=l[0],p=l[1],h=``;d[3]!==void 0&&p[3]!==void 0&&(f?(h+=`M`+d[0]+`,`+p[1]+`L`+d[2]+`,`+p[2],h+=`M`+d[1]+`,`+p[1]+`L`+d[3]+`,`+p[2]):(h+=`M`+d[1]+`,`+p[1]+`L`+d[2]+`,`+p[3],h+=`M`+d[1]+`,`+p[0]+`L`+d[2]+`,`+p[2])),h===``&&(h=`M0,0Z`),r.ensureSingle(n.select(this),`path`).attr(`d`,h).call(i.setClipUrl,t.layerClipId,e)}})})}function u(e,t,n,r){var i=[],a=[],o=r?t:n,s=r?n:t;return i[0]=o.c2p(e.s0,!0),a[0]=s.c2p(e.p0,!0),i[1]=o.c2p(e.s1,!0),a[1]=s.c2p(e.p1,!0),i[2]=o.c2p(e.nextS0,!0),a[2]=s.c2p(e.nextP0,!0),i[3]=o.c2p(e.nextS1,!0),a[3]=s.c2p(e.nextP1,!0),r?[i,a]:[a,i]}}),vc=h((e,t)=>{var n=S(),r=tn(),i=q(),a=J().DESELECTDIM,o=no(),s=eo().resizeText,c=o.styleTextPoints;function l(e,t,o){var l=o||n.select(e).selectAll(`g[class^="funnellayer"]`).selectAll(`g.trace`);s(e,l,`funnel`),l.style(`opacity`,function(e){return e[0].trace.opacity}),l.each(function(t){var o=n.select(this),s=t[0].trace;o.selectAll(`.point > path`).each(function(e){if(!e.isBlank){var t=s.marker;n.select(this).call(i.fill,e.mc||t.color).call(i.stroke,e.mlc||t.line.color).call(r.dashLine,t.line.dash,e.mlw||t.line.width).style(`opacity`,s.selectedpoints&&!e.selected?a:1)}}),c(o,s,e),o.selectAll(`.regions`).each(function(){n.select(this).selectAll(`path`).style(`stroke-width`,0).call(i.fill,s.connector.fillcolor)}),o.selectAll(`.lines`).each(function(){var e=s.connector.line;r.lineGroupStyle(n.select(this).selectAll(`path`),e.width,e.color,e.dash)})})}t.exports={style:l}}),yc=h((e,t)=>{var n=q().opacity,r=io().hoverOnBars,i=$().formatPercent;t.exports=function(e,t,n,o,s){var c=r(e,t,n,o,s);if(c){var l=c.cd,u=l[0].trace,d=u.orientation===`h`,f=l[c.index],p=d?`x`:`y`;c[p+`LabelVal`]=f.s,c.percentInitial=f.begR,c.percentInitialLabel=i(f.begR,1),c.percentPrevious=f.difR,c.percentPreviousLabel=i(f.difR,1),c.percentTotal=f.sumR,c.percentTotalLabel=i(f.sumR,1);var m=f.hi||u.hoverinfo,h=[];if(m&&m!==`none`&&m!==`skip`){var g=m===`all`,_=m.split(`+`),v=function(e){return g||_.indexOf(e)!==-1};v(`percent initial`)&&h.push(c.percentInitialLabel+` of initial`),v(`percent previous`)&&h.push(c.percentPreviousLabel+` of previous`),v(`percent total`)&&h.push(c.percentTotalLabel+` of total`)}return c.extraText=h.join(`<br>`),c.color=a(u,f),[c]}};function a(e,t){var r=e.marker,i=t.mc||r.color,a=t.mlc||r.line.color,o=t.mlw||r.line.width;if(n(i))return i;if(n(a)&&o)return a}}),bc=h((e,t)=>{t.exports=function(e,t){return e.x=`xVal`in t?t.xVal:t.x,e.y=`yVal`in t?t.yVal:t.y,`percentInitial`in t&&(e.percentInitial=t.percentInitial),`percentPrevious`in t&&(e.percentPrevious=t.percentPrevious),`percentTotal`in t&&(e.percentTotal=t.percentTotal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}}),xc=h((e,t)=>{t.exports={attributes:uc(),layoutAttributes:dc(),supplyDefaults:fc().supplyDefaults,crossTraceDefaults:fc().crossTraceDefaults,supplyLayoutDefaults:pc(),calc:hc(),crossTraceCalc:gc(),plot:_c(),style:vc().style,hoverPoints:yc(),eventData:bc(),selectPoints:oo(),moduleType:`trace`,name:`funnel`,basePlotModule:Ai(),categories:[`bar-like`,`cartesian`,`svg`,`oriented`,`showLegend`,`zoomScale`],meta:{}}}),Sc=h((e,t)=>{t.exports=xc()}),Cc=h((e,t)=>{t.exports={eventDataKeys:[`initial`,`delta`,`final`]}}),wc=h((e,t)=>{var n=qa(),r=Tr().line,i=W(),a=jt().axisHoverFormat,{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:c}=ze(),l=Cc(),u=z().extendFlat,d=q();function f(e){return{marker:{color:u({},n.marker.color,{arrayOk:!1,editType:`style`}),line:{color:u({},n.marker.line.color,{arrayOk:!1,editType:`style`}),width:u({},n.marker.line.width,{arrayOk:!1,editType:`style`}),editType:`style`},editType:`style`},editType:`style`}}t.exports={measure:{valType:`data_array`,dflt:[],editType:`calc`},base:{valType:`number`,dflt:null,arrayOk:!1,editType:`calc`},x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:a(`x`),yhoverformat:a(`y`),hovertext:n.hovertext,hovertemplate:o({},{keys:l.eventDataKeys}),hovertemplatefallback:c(),hoverinfo:u({},i.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:s({editType:`plot`},{keys:l.eventDataKeys.concat([`label`])}),texttemplatefallback:c({editType:`plot`}),text:n.text,textposition:n.textposition,insidetextanchor:n.insidetextanchor,textangle:n.textangle,textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:n.outsidetextfont,constraintext:n.constraintext,cliponaxis:n.cliponaxis,orientation:n.orientation,offset:n.offset,width:n.width,increasing:f(`increasing`),decreasing:f(`decreasing`),totals:f(`intermediate sums and total`),connector:{line:{color:u({},r.color,{dflt:d.defaultLine}),width:u({},r.width,{editType:`plot`}),dash:r.dash,editType:`plot`},mode:{valType:`enumerated`,values:[`spanning`,`between`],dflt:`between`,editType:`plot`},visible:{valType:`boolean`,dflt:!0,editType:`plot`},editType:`plot`},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,zorder:n.zorder}}),Tc=h((e,t)=>{t.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`}}}),Ec=h((e,t)=>{t.exports={INCREASING:{COLOR:`#3D9970`,SYMBOL:`▲`},DECREASING:{COLOR:`#FF4136`,SYMBOL:`▼`}}}),Dc=h((e,t)=>{var n=$(),r=ti(),i=Xa().handleText,a=Kr(),o=qr(),s=wc(),c=q(),l=Ec(),u=l.INCREASING.COLOR,d=l.DECREASING.COLOR,f=`#4499FF`;function p(e,t,n){e(t+`.marker.color`,n),e(t+`.marker.line.color`,c.defaultLine),e(t+`.marker.line.width`)}function m(e,t,r,c){function l(r,i){return n.coerce(e,t,s,r,i)}if(!a(e,t,c,l)){t.visible=!1;return}o(e,t,c,l),l(`xhoverformat`),l(`yhoverformat`),l(`measure`),l(`orientation`,t.x&&!t.y?`h`:`v`),l(`base`),l(`offset`),l(`width`),l(`text`),l(`hovertext`),l(`hovertemplate`),l(`hovertemplatefallback`),i(e,t,c,l,l(`textposition`),{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),t.textposition!==`none`&&(l(`texttemplate`),l(`texttemplatefallback`),t.texttemplate||l(`textinfo`)),p(l,`increasing`,u),p(l,`decreasing`,d),p(l,`totals`,f),l(`connector.visible`)&&(l(`connector.mode`),l(`connector.line.width`)&&(l(`connector.line.color`),l(`connector.line.dash`))),l(`zorder`)}function h(e,t){var i,a;function o(e){return n.coerce(a._input,a,s,e)}if(t.waterfallmode===`group`)for(var c=0;c<e.length;c++)a=e[c],i=a._input,r(i,a,t,o,t.waterfallmode)}t.exports={supplyDefaults:m,crossTraceDefaults:h}}),Oc=h((e,t)=>{var n=$(),r=Tc();t.exports=function(e,t,i){var a=!1;function o(i,a){return n.coerce(e,t,r,i,a)}for(var s=0;s<i.length;s++){var c=i[s];if(c.visible&&c.type===`waterfall`){a=!0;break}}a&&(o(`waterfallmode`),o(`waterfallgap`,.2),o(`waterfallgroupgap`))}}),kc=h((e,t)=>{var n=sn(),r=ii(),i=$().mergeArray,a=si(),o=O().BADNUM;function s(e){return e===`a`||e===`absolute`}function c(e){return e===`t`||e===`total`}t.exports=function(e,t){var l=n.getFromId(e,t.xaxis||`x`),u=n.getFromId(e,t.yaxis||`y`),d,f,p,m,h,g;t.orientation===`h`?(d=l.makeCalcdata(t,`x`),p=u.makeCalcdata(t,`y`),m=r(t,u,`y`,p),h=!!t.yperiodalignment,g=`y`):(d=u.makeCalcdata(t,`y`),p=l.makeCalcdata(t,`x`),m=r(t,l,`x`,p),h=!!t.xperiodalignment,g=`x`),f=m.vals;for(var _=Math.min(f.length,d.length),v=Array(_),y=0,b,x=!1,S=0;S<_;S++){var C=d[S]||0,w=!1;(d[S]!==o||c(t.measure[S])||s(t.measure[S]))&&S+1<_&&(d[S+1]!==o||c(t.measure[S+1])||s(t.measure[S+1]))&&(w=!0);var T=v[S]={i:S,p:f[S],s:C,rawS:C,cNext:w};s(t.measure[S])?(y=T.s,T.isSum=!0,T.dir=`totals`,T.s=y):c(t.measure[S])?(T.isSum=!0,T.dir=`totals`,T.s=y):(T.isSum=!1,T.dir=T.rawS<0?`decreasing`:`increasing`,b=T.s,T.s=y+b,y+=b),T.dir===`totals`&&(x=!0),h&&(v[S].orig_p=p[S],v[S][g+`End`]=m.ends[S],v[S][g+`Start`]=m.starts[S]),t.ids&&(T.id=String(t.ids[S])),T.v=(t.base||0)+y}return v.length&&(v[0].hasTotals=x),i(t.text,v,`tx`),i(t.hovertext,v,`htx`),a(v,t),v}}),Ac=h((e,t)=>{var n=di().setGroupPositions;t.exports=function(e,t){var r=e._fullLayout,i=e._fullData,a=e.calcdata,o=t.xaxis,s=t.yaxis,c=[],l=[],u=[],d,f;for(f=0;f<i.length;f++){var p=i[f];p.visible===!0&&p.xaxis===o._id&&p.yaxis===s._id&&p.type===`waterfall`&&(d=a[f],p.orientation===`h`?u.push(d):l.push(d),c.push(d))}var m={mode:r.waterfallmode,norm:r.waterfallnorm,gap:r.waterfallgap,groupgap:r.waterfallgroupgap};for(n(e,o,s,l,m),n(e,s,o,u,m),f=0;f<c.length;f++){d=c[f];for(var h=0;h<d.length;h++){var g=d[h];g.isSum===!1&&(g.s0+=h===0?0:d[h-1].s),h+1<d.length&&(d[h].nextP0=d[h+1].p0,d[h].nextS0=d[h+1].s0)}}}}),jc=h((e,t)=>{var n=S(),r=$(),i=tn(),a=O().BADNUM,o=ro(),s=eo().clearMinTextSize;t.exports=function(e,t,n,r){var i=e._fullLayout;s(`waterfall`,i),o.plot(e,t,n,r,{mode:i.waterfallmode,norm:i.waterfallmode,gap:i.waterfallgap,groupgap:i.waterfallgroupgap}),c(e,t,n,r)};function c(e,t,o,s){var c=t.xaxis,u=t.yaxis;r.makeTraceGroups(s,o,`trace bars`).each(function(o){var s=n.select(this),d=o[0].trace,f=r.ensureSingle(s,`g`,`lines`);if(!d.connector||!d.connector.visible){f.remove();return}var p=d.orientation===`h`,m=d.connector.mode,h=f.selectAll(`g.line`).data(r.identity);h.enter().append(`g`).classed(`line`,!0),h.exit().remove();var g=h.size();h.each(function(o,s){if(!(s!==g-1&&!o.cNext)){var d=l(o,c,u,p),f=d[0],h=d[1],_=``;f[0]!==a&&h[0]!==a&&f[1]!==a&&h[1]!==a&&(m===`spanning`&&!o.isSum&&s>0&&(p?_+=`M`+f[0]+`,`+h[1]+`V`+h[0]:_+=`M`+f[1]+`,`+h[0]+`H`+f[0]),m!==`between`&&(o.isSum||s<g-1)&&(p?_+=`M`+f[1]+`,`+h[0]+`V`+h[1]:_+=`M`+f[0]+`,`+h[1]+`H`+f[1]),f[2]!==a&&h[2]!==a&&(p?_+=`M`+f[1]+`,`+h[1]+`V`+h[2]:_+=`M`+f[1]+`,`+h[1]+`H`+f[2])),_===``&&(_=`M0,0Z`),r.ensureSingle(n.select(this),`path`).attr(`d`,_).call(i.setClipUrl,t.layerClipId,e)}})})}function l(e,t,n,r){var i=[],a=[],o=r?t:n,s=r?n:t;return i[0]=o.c2p(e.s0,!0),a[0]=s.c2p(e.p0,!0),i[1]=o.c2p(e.s1,!0),a[1]=s.c2p(e.p1,!0),i[2]=o.c2p(e.nextS0,!0),a[2]=s.c2p(e.nextP0,!0),r?[i,a]:[a,i]}}),Mc=h((e,t)=>{var n=S(),r=tn(),i=q(),a=J().DESELECTDIM,o=no(),s=eo().resizeText,c=o.styleTextPoints;function l(e,t,o){var l=o||n.select(e).selectAll(`g[class^="waterfalllayer"]`).selectAll(`g.trace`);s(e,l,`waterfall`),l.style(`opacity`,function(e){return e[0].trace.opacity}),l.each(function(t){var o=n.select(this),s=t[0].trace;o.selectAll(`.point > path`).each(function(e){if(!e.isBlank){var t=s[e.dir].marker;n.select(this).call(i.fill,t.color).call(i.stroke,t.line.color).call(r.dashLine,t.line.dash,t.line.width).style(`opacity`,s.selectedpoints&&!e.selected?a:1)}}),c(o,s,e),o.selectAll(`.lines`).each(function(){var e=s.connector.line;r.lineGroupStyle(n.select(this).selectAll(`path`),e.width,e.color,e.dash)})})}t.exports={style:l}}),Nc=h((e,t)=>{var n=sn().hoverLabelText,r=q().opacity,i=io().hoverOnBars,a=Ec(),o={increasing:a.INCREASING.SYMBOL,decreasing:a.DECREASING.SYMBOL};t.exports=function(e,t,r,a,c){var l=i(e,t,r,a,c);if(!l)return;var u=l.cd,d=u[0].trace,f=d.orientation===`h`,p=f?`x`:`y`,m=f?e.xa:e.ya;function h(e){return n(m,e,d[p+`hoverformat`])}var g=u[l.index],_=g.isSum?g.b+g.s:g.rawS;l.initial=g.b+g.s-_,l.delta=_,l.final=l.initial+l.delta;var v=h(Math.abs(l.delta));l.deltaLabel=_<0?`(`+v+`)`:v,l.finalLabel=h(l.final),l.initialLabel=h(l.initial);var y=g.hi||d.hoverinfo,b=[];if(y&&y!==`none`&&y!==`skip`){var x=y===`all`,S=y.split(`+`),C=function(e){return x||S.indexOf(e)!==-1};g.isSum||(C(`final`)&&(f?!C(`x`):!C(`y`))&&b.push(l.finalLabel),C(`delta`)&&(_<0?b.push(l.deltaLabel+` `+o.decreasing):b.push(l.deltaLabel+` `+o.increasing)),C(`initial`)&&b.push(`Initial: `+l.initialLabel))}return b.length&&(l.extraText=b.join(`<br>`)),l.color=s(d,g),[l]};function s(e,t){var n=e[t.dir].marker,i=n.color,a=n.line.color,o=n.line.width;if(r(i))return i;if(r(a)&&o)return a}}),Pc=h((e,t)=>{t.exports=function(e,t){return e.x=`xVal`in t?t.xVal:t.x,e.y=`yVal`in t?t.yVal:t.y,`initial`in t&&(e.initial=t.initial),`delta`in t&&(e.delta=t.delta),`final`in t&&(e.final=t.final),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}}),Fc=h((e,t)=>{t.exports={attributes:wc(),layoutAttributes:Tc(),supplyDefaults:Dc().supplyDefaults,crossTraceDefaults:Dc().crossTraceDefaults,supplyLayoutDefaults:Oc(),calc:kc(),crossTraceCalc:Ac(),plot:jc(),style:Mc().style,hoverPoints:Nc(),eventData:Pc(),selectPoints:oo(),moduleType:`trace`,name:`waterfall`,basePlotModule:Ai(),categories:[`bar-like`,`cartesian`,`svg`,`oriented`,`showLegend`,`zoomScale`],meta:{}}}),Ic=h((e,t)=>{t.exports=Fc()}),Lc=h((e,t)=>{t.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(e){return e.slice(0,3)},suffix:[``,``,``]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(e){return e.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(e){return e.slice(0,4)},suffix:[``,``,``,``]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(e){var t=e.slice(0,3);return t[1]+=`%`,t[2]+=`%`,t},suffix:[`°`,`%`,`%`]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(e){var t=e.slice(0,4);return t[1]+=`%`,t[2]+=`%`,t},suffix:[`°`,`%`,`%`,``]}}}}),Rc=h((e,t)=>{var n=W(),r=Tr().zorder,{hovertemplateAttrs:i,templatefallbackAttrs:a}=ze(),o=z().extendFlat,s=Lc().colormodel,c=[`rgb`,`rgba`,`rgba256`,`hsl`,`hsla`],l=[],u=[];for(f=0;f<c.length;f++)d=s[c[f]],l.push("For the `"+c[f]+"` colormodel, it is ["+(d.zminDflt||d.min).join(`, `)+`].`),u.push("For the `"+c[f]+"` colormodel, it is ["+(d.zmaxDflt||d.max).join(`, `)+`].`);var d,f;t.exports=o({source:{valType:`string`,editType:`calc`},z:{valType:`data_array`,editType:`calc`},colormodel:{valType:`enumerated`,values:c,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:o({},n.hoverinfo,{flags:[`x`,`y`,`z`,`color`,`name`,`text`],dflt:`x+y+z+text+name`}),hovertemplate:i({},{keys:[`z`,`color`,`colormodel`]}),hovertemplatefallback:a(),zorder:r})}),zc=h((e,t)=>{var n=$(),r=Rc(),i=Lc(),a=Lr().IMAGE_URL_PREFIX;t.exports=function(e,t){function o(i,a){return n.coerce(e,t,r,i,a)}o(`source`),t.source&&!t.source.match(a)&&delete t.source,t._hasSource=!!t.source;var s=o(`z`);if(t._hasZ=!(s===void 0||!s.length||!s[0]||!s[0].length),!t._hasZ&&!t._hasSource){t.visible=!1;return}o(`x0`),o(`y0`),o(`dx`),o(`dy`);var c;t._hasZ?(o(`colormodel`,`rgb`),c=i.colormodel[t.colormodel],o(`zmin`,c.zminDflt||c.min),o(`zmax`,c.zmaxDflt||c.max)):t._hasSource&&(t.colormodel=`rgba256`,c=i.colormodel[t.colormodel],t.zmin=c.zminDflt,t.zmax=c.zmaxDflt),o(`zsmooth`),o(`text`),o(`hovertext`),o(`hovertemplate`),o(`hovertemplatefallback`),t._length=null,o(`zorder`)}}),Bc=h((e,t)=>{typeof Object.create==`function`?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}}),Vc=h((e,t)=>{t.exports=mt().EventEmitter}),Hc=h(e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;for(a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;var a,o;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}}),Uc=h(e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else{if(a===c)return o?NaN:(p?-1:1)*(1/0);o+=2**r,a-=l}return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}}),Wc=h(e=>{var t=Hc(),n=Uc(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,`parent`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,`offset`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return f(e,t);if(ArrayBuffer.isView(e))return m(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(ae(e,ArrayBuffer)||e&&ae(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(ae(e,SharedArrayBuffer)||e&&ae(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=g(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:_(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function f(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=y(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function p(e){let t=e.length<0?0:_(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function m(e){if(ae(e,Uint8Array)){let t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}function h(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function g(e){if(s.isBuffer(e)){let t=_(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||oe(e.length)?o(0):p(e);if(e.type===`Buffer`&&Array.isArray(e.data))return p(e.data)}function _(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function v(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(ae(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),ae(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(e){switch(String(e).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}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(ae(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function y(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ae(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return ee(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return re(e).length;default:if(i)return r?-1:ee(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=y;function b(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return F(this,t,n);case`utf8`:case`utf-8`:return A(this,t,n);case`ascii`:return N(this,t,n);case`latin1`:case`binary`:return P(this,t,n);case`base64`:return k(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return I(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function x(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)x(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?A(this,0,e):b.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(ae(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:o<a?1:0};function S(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,oe(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:C(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function C(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return S(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return S(this,e,t,n,!1)};function w(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(oe(r))return o;e[n+o]=r}return o}function T(e,t,n,r){return ie(ee(t,e.length-n),e,n,r)}function E(e,t,n,r){return ie(te(t),e,n,r)}function D(e,t,n,r){return ie(re(t),e,n,r)}function O(e,t,n,r){return ie(ne(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return w(this,e,t,n);case`utf8`:case`utf-8`:return T(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return E(this,e,t,n);case`base64`:return D(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return O(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function k(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function A(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return M(r)}var j=4096;function M(e){let t=e.length;if(t<=j)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=j));return n}function N(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function P(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function F(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=se[e[r]];return i}function I(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function L(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=ce(function(e){e>>>=0,Y(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&X(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=ce(function(e){e>>>=0,Y(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&X(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=ce(function(e){e>>>=0,Y(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&X(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=ce(function(e){e>>>=0,Y(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&X(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),n.read(this,e,!1,52,8)};function R(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;R(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;R(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function z(e,t,n,r,i){J(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function B(e,t,n,r,i){J(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=ce(function(e,t=0){return z(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=ce(function(e,t=0){return B(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);R(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);R(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=ce(function(e,t=0){return z(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=ce(function(e,t=0){return B(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function V(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function H(e,t,r,i,a){return t=+t,r>>>=0,a||V(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return H(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return H(this,e,t,!1,n)};function U(e,t,r,i,a){return t=+t,r>>>=0,a||V(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};var W={};function G(e,t,n){W[e]=class extends n{constructor(){super(),Object.defineProperty(this,`message`,{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,`code`,{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}G(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),G(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),G(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=K(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=K(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function K(e){let t=``,n=e.length,r=e[0]===`-`?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function q(e,t,n){Y(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&X(t,e.length-(n+1))}function J(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new W.ERR_OUT_OF_RANGE(`value`,i,e)}q(r,i,a)}function Y(e,t){if(typeof e!=`number`)throw new W.ERR_INVALID_ARG_TYPE(t,`number`,e)}function X(e,t,n){throw Math.floor(e)===e?t<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE(n||`offset`,`>= ${n?1:0} and <= ${t}`,e):(Y(e,n),new W.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}var Z=/[^+/0-9A-Za-z-_]/g;function Q(e){if(e=e.split(`=`)[0],e=e.trim().replace(Z,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function ee(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function te(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function ne(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function re(e){return t.toByteArray(Q(e))}function ie(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function ae(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function oe(e){return e!==e}var se=function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function ce(e){return typeof BigInt>`u`?le:e}function le(){throw Error(`BigInt not supported`)}}),Gc=h((e,t)=>{t.exports=function(){if(typeof Symbol!=`function`||typeof Object.getOwnPropertySymbols!=`function`)return!1;if(typeof Symbol.iterator==`symbol`)return!0;var e={},t=Symbol(`test`),n=Object(t);if(typeof t==`string`||Object.prototype.toString.call(t)!==`[object Symbol]`||Object.prototype.toString.call(n)!==`[object Symbol]`)return!1;var r=42;for(var i in e[t]=r,e)return!1;if(typeof Object.keys==`function`&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames==`function`&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor==`function`){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==r||o.enumerable!==!0)return!1}return!0}}),Kc=h((e,t)=>{var n=Gc();t.exports=function(){return n()&&!!Symbol.toStringTag}}),qc=h((e,t)=>{t.exports=Object}),Jc=h((e,t)=>{t.exports=Error}),Yc=h((e,t)=>{t.exports=EvalError}),Xc=h((e,t)=>{t.exports=RangeError}),Zc=h((e,t)=>{t.exports=ReferenceError}),Qc=h((e,t)=>{t.exports=SyntaxError}),$c=h((e,t)=>{t.exports=TypeError}),el=h((e,t)=>{t.exports=URIError}),tl=h((e,t)=>{t.exports=Math.abs}),nl=h((e,t)=>{t.exports=Math.floor}),rl=h((e,t)=>{t.exports=Math.max}),il=h((e,t)=>{t.exports=Math.min}),al=h((e,t)=>{t.exports=Math.pow}),ol=h((e,t)=>{t.exports=Math.round}),sl=h((e,t)=>{t.exports=Number.isNaN||function(e){return e!==e}}),cl=h((e,t)=>{var n=sl();t.exports=function(e){return n(e)||e===0?e:e<0?-1:1}}),ll=h((e,t)=>{t.exports=Object.getOwnPropertyDescriptor}),ul=h((e,t)=>{var n=ll();if(n)try{n([],`length`)}catch{n=null}t.exports=n}),dl=h((e,t)=>{var n=Object.defineProperty||!1;if(n)try{n({},`a`,{value:1})}catch{n=!1}t.exports=n}),fl=h((e,t)=>{var n=typeof Symbol<`u`&&Symbol,r=Gc();t.exports=function(){return typeof n!=`function`||typeof Symbol!=`function`||typeof n(`foo`)!=`symbol`||typeof Symbol(`bar`)!=`symbol`?!1:r()}}),pl=h((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect.getPrototypeOf||null}),ml=h((e,t)=>{t.exports=qc().getPrototypeOf||null}),hl=h((e,t)=>{var n=`Function.prototype.bind called on incompatible `,r=Object.prototype.toString,i=Math.max,a=`[object Function]`,o=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},s=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},c=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||r.apply(t)!==a)throw TypeError(n+t);for(var l=s(arguments,1),u,d=function(){if(this instanceof u){var n=t.apply(this,o(l,arguments));return Object(n)===n?n:this}return t.apply(e,o(l,arguments))},f=i(0,t.length-l.length),p=[],m=0;m<f;m++)p[m]=`$`+m;if(u=Function(`binder`,`return function (`+c(p,`,`)+`){ return binder.apply(this,arguments); }`)(d),t.prototype){var h=function(){};h.prototype=t.prototype,u.prototype=new h,h.prototype=null}return u}}),_l=h((e,t)=>{var n=hl();t.exports=Function.prototype.bind||n}),vl=h((e,t)=>{t.exports=Function.prototype.call}),yl=h((e,t)=>{t.exports=Function.prototype.apply}),bl=h((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect&&Reflect.apply}),xl=h((e,t)=>{var n=_l(),r=yl(),i=vl();t.exports=bl()||n.call(i,r)}),Sl=h((e,t)=>{var n=_l(),r=$c(),i=vl(),a=xl();t.exports=function(e){if(e.length<1||typeof e[0]!=`function`)throw new r(`a function is required`);return a(n,i,e)}}),Cl=h((e,t)=>{var n=Sl(),r=ul(),i;try{i=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=`object`||!(`code`in e)||e.code!==`ERR_PROTO_ACCESS`)throw e}var a=!!i&&r&&r(Object.prototype,`__proto__`),o=Object,s=o.getPrototypeOf;t.exports=a&&typeof a.get==`function`?n([a.get]):typeof s==`function`?function(e){return s(e==null?e:o(e))}:!1}),wl=h((e,t)=>{var n=pl(),r=ml(),i=Cl();t.exports=n?function(e){return n(e)}:r?function(e){if(!e||typeof e!=`object`&&typeof e!=`function`)throw TypeError(`getProto: not an object`);return r(e)}:i?function(e){return i(e)}:null}),Tl=h((e,t)=>{var n=Function.prototype.call,r=Object.prototype.hasOwnProperty;t.exports=_l().call(n,r)}),El=h((e,t)=>{var n,r=qc(),i=Jc(),a=Yc(),o=Xc(),s=Zc(),c=Qc(),l=$c(),u=el(),d=tl(),f=nl(),p=rl(),m=il(),h=al(),g=ol(),_=cl(),v=Function,y=function(e){try{return v(`"use strict"; return (`+e+`).constructor;`)()}catch{}},b=ul(),x=dl(),S=function(){throw new l},C=b?function(){try{return arguments.callee,S}catch{try{return b(arguments,`callee`).get}catch{return S}}}():S,w=fl()(),T=wl(),E=ml(),D=pl(),O=yl(),k=vl(),A={},j=typeof Uint8Array>`u`||!T?n:T(Uint8Array),M={__proto__:null,"%AggregateError%":typeof AggregateError>`u`?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>`u`?n:ArrayBuffer,"%ArrayIteratorPrototype%":w&&T?T([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":typeof Atomics>`u`?n:Atomics,"%BigInt%":typeof BigInt>`u`?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>`u`?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>`u`?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>`u`?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>`u`?n:Float16Array,"%Float32Array%":typeof Float32Array>`u`?n:Float32Array,"%Float64Array%":typeof Float64Array>`u`?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>`u`?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":A,"%Int8Array%":typeof Int8Array>`u`?n:Int8Array,"%Int16Array%":typeof Int16Array>`u`?n:Int16Array,"%Int32Array%":typeof Int32Array>`u`?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&T?T(T([][Symbol.iterator]())):n,"%JSON%":typeof JSON==`object`?JSON:n,"%Map%":typeof Map>`u`?n:Map,"%MapIteratorPrototype%":typeof Map>`u`||!w||!T?n:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>`u`?n:Promise,"%Proxy%":typeof Proxy>`u`?n:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>`u`?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>`u`?n:Set,"%SetIteratorPrototype%":typeof Set>`u`||!w||!T?n:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>`u`?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&T?T(``[Symbol.iterator]()):n,"%Symbol%":w?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":C,"%TypedArray%":j,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>`u`?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>`u`?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>`u`?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>`u`?n:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>`u`?n:WeakMap,"%WeakRef%":typeof WeakRef>`u`?n:WeakRef,"%WeakSet%":typeof WeakSet>`u`?n:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":O,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":E,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":_,"%Reflect.getPrototypeOf%":D};if(T)try{null.error}catch(e){N=T(T(e)),M[`%Error.prototype%`]=N}var N,P=function e(t){var n;if(t===`%AsyncFunction%`)n=y(`async function () {}`);else if(t===`%GeneratorFunction%`)n=y(`function* () {}`);else if(t===`%AsyncGeneratorFunction%`)n=y(`async function* () {}`);else if(t===`%AsyncGenerator%`){var r=e(`%AsyncGeneratorFunction%`);r&&(n=r.prototype)}else if(t===`%AsyncIteratorPrototype%`){var i=e(`%AsyncGenerator%`);i&&T&&(n=T(i.prototype))}return M[t]=n,n},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`]},I=_l(),L=Tl(),R=I.call(k,Array.prototype.concat),z=I.call(O,Array.prototype.splice),B=I.call(k,String.prototype.replace),V=I.call(k,String.prototype.slice),H=I.call(k,RegExp.prototype.exec),U=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,G=function(e){var t=V(e,0,1),n=V(e,-1);if(t===`%`&&n!==`%`)throw new c("invalid intrinsic syntax, expected closing `%`");if(n===`%`&&t!==`%`)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return B(e,U,function(e,t,n,i){r[r.length]=n?B(i,W,`$1`):t||e}),r},K=function(e,t){var n=e,r;if(L(F,n)&&(r=F[n],n=`%`+r[0]+`%`),L(M,n)){var i=M[n];if(i===A&&(i=P(n)),i===void 0&&!t)throw new l(`intrinsic `+e+` exists, but is not available. Please file an issue!`);return{alias:r,name:n,value:i}}throw new c(`intrinsic `+e+` does not exist!`)};t.exports=function(e,t){if(typeof e!=`string`||e.length===0)throw new l(`intrinsic name must be a non-empty string`);if(arguments.length>1&&typeof t!=`boolean`)throw new l(`"allowMissing" argument must be a boolean`);if(H(/^%?[^%]*%?$/,e)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=G(e),r=n.length>0?n[0]:``,i=K(`%`+r+`%`,t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(r=u[0],z(n,R([0,1],u)));for(var d=1,f=!0;d<n.length;d+=1){var p=n[d],m=V(p,0,1),h=V(p,-1);if((m===`"`||m===`'`||m==="`"||h===`"`||h===`'`||h==="`")&&m!==h)throw new c(`property names with quotes must have matching quotes`);if((p===`constructor`||!f)&&(s=!0),r+=`.`+p,a=`%`+r+`%`,L(M,a))o=M[a];else if(o!=null){if(!(p in o)){if(!t)throw new l(`base intrinsic for `+e+` exists, but the property is not available.`);return}if(b&&d+1>=n.length){var g=b(o,p);f=!!g,o=f&&`get`in g&&!(`originalValue`in g.get)?g.get:o[p]}else f=L(o,p),o=o[p];f&&!s&&(M[a]=o)}}return o}}),Dl=h((e,t)=>{var n=dl(),r=Qc(),i=$c(),a=ul();t.exports=function(e,t,o){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`obj` must be an object or a function`");if(typeof t!=`string`&&typeof t!=`symbol`)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=`boolean`&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=`boolean`&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=`boolean`&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=`boolean`)throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,d=!!a&&a(e,t);if(n)n(e,t,{configurable:l===null&&d?d.configurable:!l,enumerable:s===null&&d?d.enumerable:!s,value:o,writable:c===null&&d?d.writable:!c});else if(u||!s&&!c&&!l)e[t]=o;else throw new r(`This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.`)}}),Ol=h((e,t)=>{var n=dl(),r=function(){return!!n};r.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],`length`,{value:1}).length!==1}catch{return!0}},t.exports=r}),kl=h((e,t)=>{var n=El(),r=Dl(),i=Ol()(),a=ul(),o=$c(),s=n(`%Math.floor%`);t.exports=function(e,t){if(typeof e!=`function`)throw new o("`fn` is not a function");if(typeof t!=`number`||t<0||t>4294967295||s(t)!==t)throw new o("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],c=!0,l=!0;if(`length`in e&&a){var u=a(e,`length`);u&&!u.configurable&&(c=!1),u&&!u.writable&&(l=!1)}return(c||l||!n)&&(i?r(e,`length`,t,!0,!0):r(e,`length`,t)),e}}),Al=h((e,t)=>{var n=_l(),r=El(),i=kl(),a=$c(),o=r(`%Function.prototype.apply%`),s=r(`%Function.prototype.call%`),c=r(`%Reflect.apply%`,!0)||n.call(s,o),l=dl(),u=r(`%Math.max%`);t.exports=function(e){if(typeof e!=`function`)throw new a(`a function is required`);return i(c(n,s,arguments),1+u(0,e.length-(arguments.length-1)),!0)};var d=function(){return c(n,o,arguments)};l?l(t.exports,`apply`,{value:d}):t.exports.apply=d}),jl=h((e,t)=>{var n=El(),r=Al(),i=r(n(`String.prototype.indexOf`));t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r(a):a}}),Ml=h((e,t)=>{var n=Kc()(),r=jl()(`Object.prototype.toString`),i=function(e){return n&&e&&typeof e==`object`&&Symbol.toStringTag in e?!1:r(e)===`[object Arguments]`},a=function(e){return i(e)?!0:typeof e==`object`&&!!e&&typeof e.length==`number`&&e.length>=0&&r(e)!==`[object Array]`&&r(e.callee)===`[object Function]`},o=function(){return i(arguments)}();i.isLegacyArguments=a,t.exports=o?i:a}),Nl=h((e,t)=>{var n=Object.prototype.toString,r=Function.prototype.toString,i=/^\s*(?:function)?\*/,a=Kc()(),o=Object.getPrototypeOf,s=function(){if(!a)return!1;try{return Function(`return function*() {}`)()}catch{}},c;t.exports=function(e){if(typeof e!=`function`)return!1;if(i.test(r.call(e)))return!0;if(!a)return n.call(e)===`[object GeneratorFunction]`;if(!o)return!1;if(c===void 0){var t=s();c=t?o(t):!1}return o(e)===c}}),Pl=h((e,t)=>{var n=Function.prototype.toString,r=typeof Reflect==`object`&&Reflect!==null&&Reflect.apply,i,a;if(typeof r==`function`&&typeof Object.defineProperty==`function`)try{i=Object.defineProperty({},`length`,{get:function(){throw a}}),a={},r(function(){throw 42},null,i)}catch(e){e!==a&&(r=null)}else r=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch{return!1}},c=function(e){try{return s(e)?!1:(n.call(e),!0)}catch{return!1}},l=Object.prototype.toString,u=`[object Object]`,d=`[object Function]`,f=`[object GeneratorFunction]`,p=`[object HTMLAllCollection]`,m=`[object HTML document.all class]`,h=`[object HTMLCollection]`,g=typeof Symbol==`function`&&!!Symbol.toStringTag,_=!(0 in[,]),v=function(){return!1};typeof document==`object`&&(y=document.all,l.call(y)===l.call(document.all)&&(v=function(e){if((_||!e)&&(e===void 0||typeof e==`object`))try{var t=l.call(e);return(t===p||t===m||t===h||t===u)&&e(``)==null}catch{}return!1}));var y;t.exports=r?function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;try{r(e,null,i)}catch(e){if(e!==a)return!1}return!s(e)&&c(e)}:function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;if(g)return c(e);if(s(e))return!1;var t=l.call(e);return t!==d&&t!==f&&!/^\[object HTML/.test(t)?!1:c(e)}}),Fl=h((e,t)=>{var n=Pl(),r=Object.prototype.toString,i=Object.prototype.hasOwnProperty,a=function(e,t,n){for(var r=0,a=e.length;r<a;r++)i.call(e,r)&&(n==null?t(e[r],r,e):t.call(n,e[r],r,e))},o=function(e,t,n){for(var r=0,i=e.length;r<i;r++)n==null?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)},s=function(e,t,n){for(var r in e)i.call(e,r)&&(n==null?t(e[r],r,e):t.call(n,e[r],r,e))};t.exports=function(e,t,i){if(!n(t))throw TypeError(`iterator must be a function`);var c;arguments.length>=3&&(c=i),r.call(e)===`[object Array]`?a(e,t,c):typeof e==`string`?o(e,t,c):s(e,t,c)}}),Il=h((e,t)=>{var n=[`BigInt64Array`,`BigUint64Array`,`Float32Array`,`Float64Array`,`Int16Array`,`Int32Array`,`Int8Array`,`Uint16Array`,`Uint32Array`,`Uint8Array`,`Uint8ClampedArray`],r=typeof globalThis>`u`?window:globalThis;t.exports=function(){for(var e=[],t=0;t<n.length;t++)typeof r[n[t]]==`function`&&(e[e.length]=n[t]);return e}}),Ll=h((e,t)=>{var n=Fl(),r=Il(),i=Al(),a=jl(),o=ul(),s=a(`Object.prototype.toString`),c=Kc()(),l=typeof globalThis>`u`?window:globalThis,u=r(),d=a(`String.prototype.slice`),f=Object.getPrototypeOf,p=a(`Array.prototype.indexOf`,!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},m={__proto__:null};c&&o&&f?n(u,function(e){var t=new l[e];if(Symbol.toStringTag in t){var n=f(t),r=o(n,Symbol.toStringTag);r||=o(f(n),Symbol.toStringTag),m[`$`+e]=i(r.get)}}):n(u,function(e){var t=new l[e],n=t.slice||t.set;n&&(m[`$`+e]=i(n))});var h=function(e){var t=!1;return n(m,function(n,r){if(!t)try{`$`+n(e)===r&&(t=d(r,1))}catch{}}),t},g=function(e){var t=!1;return n(m,function(n,r){if(!t)try{n(e),t=d(r,1)}catch{}}),t};t.exports=function(e){if(!e||typeof e!=`object`)return!1;if(!c){var t=d(s(e),8,-1);return p(u,t)>-1?t:t===`Object`?g(e):!1}return o?h(e):null}}),Rl=h((e,t)=>{var n=Fl(),r=Il(),i=jl(),a=i(`Object.prototype.toString`),o=Kc()(),s=ul(),c=typeof globalThis>`u`?window:globalThis,l=r(),u=i(`Array.prototype.indexOf`,!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},d=i(`String.prototype.slice`),f={},p=Object.getPrototypeOf;o&&s&&p&&n(l,function(e){var t=new c[e];if(Symbol.toStringTag in t){var n=p(t),r=s(n,Symbol.toStringTag);r||=s(p(n),Symbol.toStringTag),f[e]=r.get}});var m=function(e){var t=!1;return n(f,function(n,r){if(!t)try{t=n.call(e)===r}catch{}}),t};t.exports=function(e){return!e||typeof e!=`object`?!1:!o||!(Symbol.toStringTag in e)?u(l,d(a(e),8,-1))>-1:s?m(e):!1}}),zl=h(e=>{var t=Ml(),n=Nl(),r=Ll(),i=Rl();function a(e){return e.call.bind(e)}var o=typeof BigInt<`u`,s=typeof Symbol<`u`,c=a(Object.prototype.toString),l=a(Number.prototype.valueOf),u=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);o&&(f=a(BigInt.prototype.valueOf));var f;s&&(p=a(Symbol.prototype.valueOf));var p;function m(e,t){if(typeof e!=`object`)return!1;try{return t(e),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=i;function h(e){return typeof Promise<`u`&&e instanceof Promise||typeof e==`object`&&!!e&&typeof e.then==`function`&&typeof e.catch==`function`}e.isPromise=h;function g(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):i(e)||z(e)}e.isArrayBufferView=g;function _(e){return r(e)===`Uint8Array`}e.isUint8Array=_;function v(e){return r(e)===`Uint8ClampedArray`}e.isUint8ClampedArray=v;function y(e){return r(e)===`Uint16Array`}e.isUint16Array=y;function b(e){return r(e)===`Uint32Array`}e.isUint32Array=b;function x(e){return r(e)===`Int8Array`}e.isInt8Array=x;function S(e){return r(e)===`Int16Array`}e.isInt16Array=S;function C(e){return r(e)===`Int32Array`}e.isInt32Array=C;function w(e){return r(e)===`Float32Array`}e.isFloat32Array=w;function T(e){return r(e)===`Float64Array`}e.isFloat64Array=T;function E(e){return r(e)===`BigInt64Array`}e.isBigInt64Array=E;function D(e){return r(e)===`BigUint64Array`}e.isBigUint64Array=D;function O(e){return c(e)===`[object Map]`}O.working=typeof Map<`u`&&O(new Map);function k(e){return typeof Map>`u`?!1:O.working?O(e):e instanceof Map}e.isMap=k;function A(e){return c(e)===`[object Set]`}A.working=typeof Set<`u`&&A(new Set);function j(e){return typeof Set>`u`?!1:A.working?A(e):e instanceof Set}e.isSet=j;function M(e){return c(e)===`[object WeakMap]`}M.working=typeof WeakMap<`u`&&M(new WeakMap);function N(e){return typeof WeakMap>`u`?!1:M.working?M(e):e instanceof WeakMap}e.isWeakMap=N;function P(e){return c(e)===`[object WeakSet]`}P.working=typeof WeakSet<`u`&&P(new WeakSet);function F(e){return P(e)}e.isWeakSet=F;function I(e){return c(e)===`[object ArrayBuffer]`}I.working=typeof ArrayBuffer<`u`&&I(new ArrayBuffer);function L(e){return typeof ArrayBuffer>`u`?!1:I.working?I(e):e instanceof ArrayBuffer}e.isArrayBuffer=L;function R(e){return c(e)===`[object DataView]`}R.working=typeof ArrayBuffer<`u`&&typeof DataView<`u`&&R(new DataView(new ArrayBuffer(1),0,1));function z(e){return typeof DataView>`u`?!1:R.working?R(e):e instanceof DataView}e.isDataView=z;var B=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:void 0;function V(e){return c(e)===`[object SharedArrayBuffer]`}function H(e){return B===void 0?!1:(V.working===void 0&&(V.working=V(new B)),V.working?V(e):e instanceof B)}e.isSharedArrayBuffer=H;function U(e){return c(e)===`[object AsyncFunction]`}e.isAsyncFunction=U;function W(e){return c(e)===`[object Map Iterator]`}e.isMapIterator=W;function G(e){return c(e)===`[object Set Iterator]`}e.isSetIterator=G;function K(e){return c(e)===`[object Generator]`}e.isGeneratorObject=K;function q(e){return c(e)===`[object WebAssembly.Module]`}e.isWebAssemblyCompiledModule=q;function J(e){return m(e,l)}e.isNumberObject=J;function Y(e){return m(e,u)}e.isStringObject=Y;function X(e){return m(e,d)}e.isBooleanObject=X;function Z(e){return o&&m(e,f)}e.isBigIntObject=Z;function Q(e){return s&&m(e,p)}e.isSymbolObject=Q;function ee(e){return J(e)||Y(e)||X(e)||Z(e)||Q(e)}e.isBoxedPrimitive=ee;function te(e){return typeof Uint8Array<`u`&&(L(e)||H(e))}e.isAnyArrayBuffer=te,[`isProxy`,`isExternal`,`isModuleNamespaceObject`].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw Error(t+` is not supported in userland`)}})})}),Bl=h((e,t)=>{t.exports=function(e){return e&&typeof e==`object`&&typeof e.copy==`function`&&typeof e.fill==`function`&&typeof e.readUInt8==`function`}}),Vl=h(e=>{var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},n=/%[sdj%]/g;e.format=function(e){if(!x(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(o(arguments[r]));return t.join(` `)}for(var r=1,i=arguments,a=i.length,s=String(e).replace(n,function(e){if(e===`%%`)return`%`;if(r>=a)return e;switch(e){case`%s`:return String(i[r++]);case`%d`:return Number(i[r++]);case`%j`:try{return JSON.stringify(i[r++])}catch{return`[Circular]`}default:return e}}),c=i[r];r<a;c=i[++r])v(c)||!T(c)?s+=` `+c:s+=` `+o(c);return s},e.deprecate=function(t,n){if(typeof process<`u`&&process.noDeprecation===!0)return t;if(typeof process>`u`)return function(){return e.deprecate(t,n).apply(this,arguments)};var r=!1;function i(){if(!r){if(process.throwDeprecation)throw Error(n);process.traceDeprecation?console.trace(n):console.error(n),r=!0}return t.apply(this,arguments)}return i};var r={},i=/^$/;a=`false`,a=a.replace(/[|\\{}()[\]^$+?.]/g,`\\$&`).replace(/\*/g,`.*`).replace(/,/g,`$|^`).toUpperCase(),i=RegExp(`^`+a+`$`,`i`);var a;e.debuglog=function(t){if(t=t.toUpperCase(),!r[t])if(i.test(t)){var n=process.pid;r[t]=function(){var r=e.format.apply(e,arguments);console.error(`%s %d: %s`,t,n,r)}}else r[t]=function(){};return r[t]};function o(t,n){var r={seen:[],stylize:c};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),_(n)?r.showHidden=n:n&&e._extend(r,n),C(r.showHidden)&&(r.showHidden=!1),C(r.depth)&&(r.depth=2),C(r.colors)&&(r.colors=!1),C(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),u(r,t,r.depth)}e.inspect=o,o.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]},o.styles={special:`cyan`,number:`yellow`,boolean:`yellow`,undefined:`grey`,null:`bold`,string:`green`,date:`magenta`,regexp:`red`};function s(e,t){var n=o.styles[t];return n?`\x1B[`+o.colors[n][0]+`m`+e+`\x1B[`+o.colors[n][1]+`m`:e}function c(e,t){return e}function l(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(t,n,r){if(t.customInspect&&n&&O(n.inspect)&&n.inspect!==e.inspect&&!(n.constructor&&n.constructor.prototype===n)){var i=n.inspect(r,t);return x(i)||(i=u(t,i,r)),i}var a=d(t,n);if(a)return a;var o=Object.keys(n),s=l(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(n)),D(n)&&(o.indexOf(`message`)>=0||o.indexOf(`description`)>=0))return f(n);if(o.length===0){if(O(n)){var c=n.name?`: `+n.name:``;return t.stylize(`[Function`+c+`]`,`special`)}if(w(n))return t.stylize(RegExp.prototype.toString.call(n),`regexp`);if(E(n))return t.stylize(Date.prototype.toString.call(n),`date`);if(D(n))return f(n)}var _=``,v=!1,y=[`{`,`}`];if(g(n)&&(v=!0,y=[`[`,`]`]),O(n)&&(_=` [Function`+(n.name?`: `+n.name:``)+`]`),w(n)&&(_=` `+RegExp.prototype.toString.call(n)),E(n)&&(_=` `+Date.prototype.toUTCString.call(n)),D(n)&&(_=` `+f(n)),o.length===0&&(!v||n.length==0))return y[0]+_+y[1];if(r<0)return w(n)?t.stylize(RegExp.prototype.toString.call(n),`regexp`):t.stylize(`[Object]`,`special`);t.seen.push(n);var b;return b=v?p(t,n,r,s,o):o.map(function(e){return m(t,n,r,s,e,v)}),t.seen.pop(),h(b,_,y)}function d(e,t){if(C(t))return e.stylize(`undefined`,`undefined`);if(x(t)){var n=`'`+JSON.stringify(t).replace(/^"|"$/g,``).replace(/'/g,`\\'`).replace(/\\"/g,`"`)+`'`;return e.stylize(n,`string`)}if(b(t))return e.stylize(``+t,`number`);if(_(t))return e.stylize(``+t,`boolean`);if(v(t))return e.stylize(`null`,`null`)}function f(e){return`[`+Error.prototype.toString.call(e)+`]`}function p(e,t,n,r,i){for(var a=[],o=0,s=t.length;o<s;++o)P(t,String(o))?a.push(m(e,t,n,r,String(o),!0)):a.push(``);return i.forEach(function(i){i.match(/^\d+$/)||a.push(m(e,t,n,r,i,!0))}),a}function m(e,t,n,r,i,a){var o,s,c;if(c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},c.get?s=c.set?e.stylize(`[Getter/Setter]`,`special`):e.stylize(`[Getter]`,`special`):c.set&&(s=e.stylize(`[Setter]`,`special`)),P(r,i)||(o=`[`+i+`]`),s||(e.seen.indexOf(c.value)<0?(s=v(n)?u(e,c.value,null):u(e,c.value,n-1),s.indexOf(`
`)>-1&&(s=a?s.split(`
`).map(function(e){return` `+e}).join(`
`).slice(2):`
`+s.split(`
`).map(function(e){return` `+e}).join(`
`))):s=e.stylize(`[Circular]`,`special`)),C(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(``+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,`name`)):(o=o.replace(/'/g,`\\'`).replace(/\\"/g,`"`).replace(/(^"|"$)/g,`'`),o=e.stylize(o,`string`))}return o+`: `+s}function h(e,t,n){var r=0;return e.reduce(function(e,t){return r++,t.indexOf(`
`)>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,``).length+1},0)>60?n[0]+(t===``?``:t+`
`)+` `+e.join(`,
`)+` `+n[1]:n[0]+t+` `+e.join(`, `)+` `+n[1]}e.types=zl();function g(e){return Array.isArray(e)}e.isArray=g;function _(e){return typeof e==`boolean`}e.isBoolean=_;function v(e){return e===null}e.isNull=v;function y(e){return e==null}e.isNullOrUndefined=y;function b(e){return typeof e==`number`}e.isNumber=b;function x(e){return typeof e==`string`}e.isString=x;function S(e){return typeof e==`symbol`}e.isSymbol=S;function C(e){return e===void 0}e.isUndefined=C;function w(e){return T(e)&&A(e)===`[object RegExp]`}e.isRegExp=w,e.types.isRegExp=w;function T(e){return typeof e==`object`&&!!e}e.isObject=T;function E(e){return T(e)&&A(e)===`[object Date]`}e.isDate=E,e.types.isDate=E;function D(e){return T(e)&&(A(e)===`[object Error]`||e instanceof Error)}e.isError=D,e.types.isNativeError=D;function O(e){return typeof e==`function`}e.isFunction=O;function k(e){return e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`||typeof e==`symbol`||e===void 0}e.isPrimitive=k,e.isBuffer=Bl();function A(e){return Object.prototype.toString.call(e)}function j(e){return e<10?`0`+e.toString(10):e.toString(10)}var M=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function N(){var e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(`:`);return[e.getDate(),M[e.getMonth()],t].join(` `)}e.log=function(){console.log(`%s - %s`,N(),e.format.apply(e,arguments))},e.inherits=Bc(),e._extend=function(e,t){if(!t||!T(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var F=typeof Symbol<`u`?Symbol(`util.promisify.custom`):void 0;e.promisify=function(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type Function`);if(F&&e[F]){var n=e[F];if(typeof n!=`function`)throw TypeError(`The "util.promisify.custom" argument must be of type Function`);return Object.defineProperty(n,F,{value:n,enumerable:!1,writable:!1,configurable:!0}),n}function n(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push(function(e,r){e?n(e):t(r)});try{e.apply(this,i)}catch(e){n(e)}return r}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),F&&Object.defineProperty(n,F,{value:n,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(n,t(e))},e.promisify.custom=F;function I(e,t){if(!e){var n=Error(`Promise was rejected with a falsy value`);n.reason=e,e=n}return t(e)}function L(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type Function`);function n(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var r=t.pop();if(typeof r!=`function`)throw TypeError(`The last argument must be of type Function`);var i=this,a=function(){return r.apply(i,arguments)};e.apply(this,t).then(function(e){process.nextTick(a.bind(null,null,e))},function(e){process.nextTick(I.bind(null,e,a))})}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.defineProperties(n,t(e)),n}e.callbackify=L}),Hl=h((e,t)=>{function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t];t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}var c=Wc().Buffer,l=Vl().inspect,u=l&&l.custom||`inspect`;function d(e,t,n){c.prototype.copy.call(e,t,n)}t.exports=function(){function e(){a(this,e),this.head=null,this.tail=null,this.length=0}return s(e,[{key:`push`,value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:`unshift`,value:function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}},{key:`shift`,value:function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:`clear`,value:function(){this.head=this.tail=null,this.length=0}},{key:`join`,value:function(e){if(this.length===0)return``;for(var t=this.head,n=``+t.data;t=t.next;)n+=e+t.data;return n}},{key:`concat`,value:function(e){if(this.length===0)return c.alloc(0);for(var t=c.allocUnsafe(e>>>0),n=this.head,r=0;n;)d(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:`consume`,value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:`first`,value:function(){return this.head.data}},{key:`_getString`,value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,a=e>i.length?i.length:e;if(a===i.length?r+=i:r+=i.slice(0,e),e-=a,e===0){a===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++n}return this.length-=n,r}},{key:`_getBuffer`,value:function(e){var t=c.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),e-=a,e===0){a===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(a));break}++r}return this.length-=r,t}},{key:u,value:function(e,t){return l(this,r({},t,{depth:0,customInspect:!1}))}}]),e}()}),Ul=h((e,t)=>{function n(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(o,this,e)):process.nextTick(o,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?n._writableState?n._writableState.errorEmitted?process.nextTick(i,n):(n._writableState.errorEmitted=!0,process.nextTick(r,n,e)):process.nextTick(r,n,e):t?(process.nextTick(i,n),t(e)):process.nextTick(i,n)}),this)}function r(e,t){o(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit(`close`)}function a(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(e,t){e.emit(`error`,t)}function s(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit(`error`,t)}t.exports={destroy:n,undestroy:a,errorOrDestroy:s}}),Wl=h((e,t)=>{function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var r={};function i(e,t,i){i||=Error;function a(e,n,r){return typeof t==`string`?t:t(e,n,r)}var o=function(e){n(t,e);function t(t,n,r){return e.call(this,a(t,n,r))||this}return t}(i);o.prototype.name=i.name,o.prototype.code=e,r[e]=o}function a(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?`one of ${t} ${e.slice(0,n-1).join(`, `)}, or `+e[n-1]:n===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function o(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function s(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function c(e,t,n){return typeof n!=`number`&&(n=0),n+t.length>e.length?!1:e.indexOf(t,n)!==-1}i(`ERR_INVALID_OPT_VALUE`,function(e,t){return`The value "`+t+`" is invalid for option "`+e+`"`},TypeError),i(`ERR_INVALID_ARG_TYPE`,function(e,t,n){var r;typeof t==`string`&&o(t,`not `)?(r=`must not be`,t=t.replace(/^not /,``)):r=`must be`;var i=s(e,` argument`)?`The ${e} ${r} ${a(t,`type`)}`:`The "${e}" ${c(e,`.`)?`property`:`argument`} ${r} ${a(t,`type`)}`;return i+=`. Received type ${typeof n}`,i},TypeError),i(`ERR_STREAM_PUSH_AFTER_EOF`,`stream.push() after EOF`),i(`ERR_METHOD_NOT_IMPLEMENTED`,function(e){return`The `+e+` method is not implemented`}),i(`ERR_STREAM_PREMATURE_CLOSE`,`Premature close`),i(`ERR_STREAM_DESTROYED`,function(e){return`Cannot call `+e+` after a stream was destroyed`}),i(`ERR_MULTIPLE_CALLBACK`,`Callback called multiple times`),i(`ERR_STREAM_CANNOT_PIPE`,`Cannot pipe, not readable`),i(`ERR_STREAM_WRITE_AFTER_END`,`write after end`),i(`ERR_STREAM_NULL_VALUES`,`May not write null values to stream`,TypeError),i(`ERR_UNKNOWN_ENCODING`,function(e){return`Unknown encoding: `+e},TypeError),i(`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`,`stream.unshift() after end event`),t.exports.codes=r}),Gl=h((e,t)=>{var n=Wl().codes.ERR_INVALID_OPT_VALUE;function r(e,t,n){return e.highWaterMark==null?t?e[n]:null:e.highWaterMark}function i(e,t,i,a){var o=r(t,a,i);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new n(a?i:`highWaterMark`,o);return Math.floor(o)}return e.objectMode?16:16*1024}t.exports={getHighWaterMark:i}}),Kl=h((e,t)=>{t.exports=n;function n(e,t){if(r(`noDeprecation`))return e;var n=!1;function i(){if(!n){if(r(`throwDeprecation`))throw Error(t);r(`traceDeprecation`)?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}return i}function r(e){try{if(!window.localStorage)return!1}catch{return!1}var t=window.localStorage[e];return t==null?!1:String(t).toLowerCase()===`true`}}),ql=h((e,t)=>{t.exports=T;function n(e){var t=this;this.next=null,this.entry=null,this.finish=function(){H(t,e)}}var r;T.WritableState=C;var i={deprecate:Kl()},a=Vc(),o=Wc().Buffer,s=window.Uint8Array||function(){};function c(e){return o.from(e)}function l(e){return o.isBuffer(e)||e instanceof s}var u=Ul(),d=Gl().getHighWaterMark,f=Wl().codes,p=f.ERR_INVALID_ARG_TYPE,m=f.ERR_METHOD_NOT_IMPLEMENTED,h=f.ERR_MULTIPLE_CALLBACK,g=f.ERR_STREAM_CANNOT_PIPE,_=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,y=f.ERR_STREAM_WRITE_AFTER_END,b=f.ERR_UNKNOWN_ENCODING,x=u.errorOrDestroy;Bc()(T,a);function S(){}function C(e,t,i){r||=Jl(),e||={},typeof i!=`boolean`&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,`writableHighWaterMark`,i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=e.decodeStrings!==!1,this.defaultEncoding=e.defaultEncoding||`utf8`,this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){N(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}C.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},(function(){try{Object.defineProperty(C.prototype,`buffer`,{get:i.deprecate(function(){return this.getBuffer()},`_writableState.buffer is deprecated. Use _writableState.getBuffer instead.`,`DEP0003`)})}catch{}})();var w;typeof Symbol==`function`&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==`function`?(w=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(e){return w.call(this,e)?!0:this===T?e&&e._writableState instanceof C:!1}})):w=function(e){return e instanceof this};function T(e){r||=Jl();var t=this instanceof r;if(!t&&!w.call(T,this))return new T(e);this._writableState=new C(e,this,t),this.writable=!0,e&&(typeof e.write==`function`&&(this._write=e.write),typeof e.writev==`function`&&(this._writev=e.writev),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.final==`function`&&(this._final=e.final)),a.call(this)}T.prototype.pipe=function(){x(this,new g)};function E(e,t){var n=new y;x(e,n),process.nextTick(t,n)}function D(e,t,n,r){var i;return n===null?i=new v:typeof n!=`string`&&!t.objectMode&&(i=new p(`chunk`,[`string`,`Buffer`],n)),i?(x(e,i),process.nextTick(r,i),!1):!0}T.prototype.write=function(e,t,n){var r=this._writableState,i=!1,a=!r.objectMode&&l(e);return a&&!o.isBuffer(e)&&(e=c(e)),typeof t==`function`&&(n=t,t=null),a?t=`buffer`:t||=r.defaultEncoding,typeof n!=`function`&&(n=S),r.ending?E(this,n):(a||D(this,r,e,n))&&(r.pendingcb++,i=k(this,r,a,e,t,n)),i},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&I(this,e))},T.prototype.setDefaultEncoding=function(e){if(typeof e==`string`&&(e=e.toLowerCase()),!([`hex`,`utf8`,`utf-8`,`ascii`,`binary`,`base64`,`ucs2`,`ucs-2`,`utf16le`,`utf-16le`,`raw`].indexOf((e+``).toLowerCase())>-1))throw new b(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,`writableBuffer`,{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function O(e,t,n){return!e.objectMode&&e.decodeStrings!==!1&&typeof t==`string`&&(t=o.from(t,n)),t}Object.defineProperty(T.prototype,`writableHighWaterMark`,{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function k(e,t,n,r,i,a){if(!n){var o=O(t,r,i);r!==o&&(n=!0,i=`buffer`,r=o)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,s,r,i,a);return c}function A(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new _(`write`)):n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function j(e,t,n,r,i){--t.pendingcb,n?(process.nextTick(i,r),process.nextTick(B,e,t),e._writableState.errorEmitted=!0,x(e,r)):(i(r),e._writableState.errorEmitted=!0,x(e,r),B(e,t))}function M(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function N(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(typeof i!=`function`)throw new h;if(M(n),t)j(e,n,r,t,i);else{var a=L(n)||e.destroyed;!a&&!n.corked&&!n.bufferProcessing&&n.bufferedRequest&&I(e,n),r?process.nextTick(P,e,n,a,i):P(e,n,a,i)}}function P(e,t,n,r){n||F(e,t),t.pendingcb--,r(),B(e,t)}function F(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit(`drain`))}function I(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,a=Array(i),o=t.corkedRequestsFree;o.entry=r;for(var s=0,c=!0;r;)a[s]=r,r.isBuf||(c=!1),r=r.next,s+=1;a.allBuffers=c,A(e,t,!0,t.length,a,``,o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new n(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,d=r.callback;if(A(e,t,!1,t.objectMode?1:l.length,l,u,d),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}T.prototype._write=function(e,t,n){n(new m(`_write()`))},T.prototype._writev=null,T.prototype.end=function(e,t,n){var r=this._writableState;return typeof e==`function`?(n=e,e=null,t=null):typeof t==`function`&&(n=t,t=null),e!=null&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||V(this,r,n),this},Object.defineProperty(T.prototype,`writableLength`,{enumerable:!1,get:function(){return this._writableState.length}});function L(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function R(e,t){e._final(function(n){t.pendingcb--,n&&x(e,n),t.prefinished=!0,e.emit(`prefinish`),B(e,t)})}function z(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final==`function`&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(R,e,t)):(t.prefinished=!0,e.emit(`prefinish`)))}function B(e,t){var n=L(t);if(n&&(z(e,t),t.pendingcb===0&&(t.finished=!0,e.emit(`finish`),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}function V(e,t,n){t.ending=!0,B(e,t),n&&(t.finished?process.nextTick(n):e.once(`finish`,n)),t.ended=!0,e.writable=!1}function H(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree.next=e}Object.defineProperty(T.prototype,`destroyed`,{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=u.destroy,T.prototype._undestroy=u.undestroy,T.prototype._destroy=function(e,t){t(e)}}),Jl=h((e,t)=>{var n=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=c;var r=eu(),i=ql();for(Bc()(c,r),a=n(i.prototype),s=0;s<a.length;s++)o=a[s],c.prototype[o]||(c.prototype[o]=i.prototype[o]);var a,o,s;function c(e){if(!(this instanceof c))return new c(e);r.call(this,e),i.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once(`end`,l)))}Object.defineProperty(c.prototype,`writableHighWaterMark`,{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,`writableBuffer`,{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,`writableLength`,{enumerable:!1,get:function(){return this._writableState.length}});function l(){this._writableState.ended||process.nextTick(u,this)}function u(e){e.end()}Object.defineProperty(c.prototype,`destroyed`,{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}),Yl=h((e,t)=>{var n=Wc(),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}}),Xl=h(e=>{var t=Yl().Buffer,n=t.isEncoding||function(e){switch(e=``+e,e&&e.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 r(e){if(!e)return`utf8`;for(var t;;)switch(e){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 e;default:if(t)return;e=(``+e).toLowerCase(),t=!0}}function i(e){var i=r(e);if(typeof i!=`string`&&(t.isEncoding===n||!n(e)))throw Error(`Unknown encoding: `+e);return i||e}e.StringDecoder=a;function a(e){this.encoding=i(e);var n;switch(this.encoding){case`utf16le`:this.text=f,this.end=p,n=4;break;case`utf8`:this.fillLast=l,n=4;break;case`base64`:this.text=m,this.end=h,n=3;break;default:this.write=g,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}a.prototype.write=function(e){if(e.length===0)return``;var t,n;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return``;n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||``},a.prototype.end=d,a.prototype.text=u,a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||i===-2?0:(i=o(t[r]),i>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||i===-2?0:(i=o(t[r]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function c(e,t,n){if((t[0]&192)!=128)return e.lastNeed=0,``;if(e.lastNeed>1&&t.length>1){if((t[1]&192)!=128)return e.lastNeed=1,``;if(e.lastNeed>2&&t.length>2&&(t[2]&192)!=128)return e.lastNeed=2,``}}function l(e){var t=this.lastTotal-this.lastNeed,n=c(this,e,t);if(n!==void 0)return n;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function u(e,t){var n=s(this,e,t);if(!this.lastNeed)return e.toString(`utf8`,t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString(`utf8`,t,r)}function d(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+``:t}function f(e,t){if((e.length-t)%2==0){var n=e.toString(`utf16le`,t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(`utf16le`,t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):``;if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(`utf16le`,0,n)}return t}function m(e,t){var n=(e.length-t)%3;return n===0?e.toString(`base64`,t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(`base64`,t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+this.lastChar.toString(`base64`,0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function _(e){return e&&e.length?this.write(e):``}}),Zl=h((e,t)=>{var n=Wl().codes.ERR_STREAM_PREMATURE_CLOSE;function r(e){var t=!1;return function(){if(!t){t=!0;var n=[...arguments];e.apply(this,n)}}}function i(){}function a(e){return e.setHeader&&typeof e.abort==`function`}function o(e,t,s){if(typeof t==`function`)return o(e,null,t);t||={},s=r(s||i);var c=t.readable||t.readable!==!1&&e.readable,l=t.writable||t.writable!==!1&&e.writable,u=function(){e.writable||f()},d=e._writableState&&e._writableState.finished,f=function(){l=!1,d=!0,c||s.call(e)},p=e._readableState&&e._readableState.endEmitted,m=function(){c=!1,p=!0,l||s.call(e)},h=function(t){s.call(e,t)},g=function(){var t;if(c&&!p)return(!e._readableState||!e._readableState.ended)&&(t=new n),s.call(e,t);if(l&&!d)return(!e._writableState||!e._writableState.ended)&&(t=new n),s.call(e,t)},_=function(){e.req.on(`finish`,f)};return a(e)?(e.on(`complete`,f),e.on(`abort`,g),e.req?_():e.on(`request`,_)):l&&!e._writableState&&(e.on(`end`,u),e.on(`close`,u)),e.on(`end`,m),e.on(`finish`,f),t.error!==!1&&e.on(`error`,h),e.on(`close`,g),function(){e.removeListener(`complete`,f),e.removeListener(`abort`,g),e.removeListener(`request`,_),e.req&&e.req.removeListener(`finish`,f),e.removeListener(`end`,u),e.removeListener(`close`,u),e.removeListener(`finish`,f),e.removeListener(`end`,m),e.removeListener(`error`,h),e.removeListener(`close`,g)}}t.exports=o}),Ql=h((e,t)=>{var n;function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=Zl(),a=Symbol(`lastResolve`),o=Symbol(`lastReject`),s=Symbol(`error`),c=Symbol(`ended`),l=Symbol(`lastPromise`),u=Symbol(`handlePromise`),d=Symbol(`stream`);function f(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(t!==null){var n=e[d].read();n!==null&&(e[l]=null,e[a]=null,e[o]=null,t(f(n,!1)))}}function m(e){process.nextTick(p,e)}function h(e,t){return function(n,r){e.then(function(){if(t[c]){n(f(void 0,!0));return}t[u](n,r)},r)}}var g=Object.getPrototypeOf(function(){}),_=Object.setPrototypeOf((n={get stream(){return this[d]},next:function(){var e=this,t=this[s];if(t!==null)return Promise.reject(t);if(this[c])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(t,n){process.nextTick(function(){e[s]?n(e[s]):t(f(void 0,!0))})});var n=this[l],r;if(n)r=new Promise(h(n,this));else{var i=this[d].read();if(i!==null)return Promise.resolve(f(i,!1));r=new Promise(this[u])}return this[l]=r,r}},r(n,Symbol.asyncIterator,function(){return this}),r(n,`return`,function(){var e=this;return new Promise(function(t,n){e[d].destroy(null,function(e){if(e){n(e);return}t(f(void 0,!0))})})}),n),g);t.exports=function(e){var t,n=Object.create(_,(t={},r(t,d,{value:e,writable:!0}),r(t,a,{value:null,writable:!0}),r(t,o,{value:null,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,c,{value:e._readableState.endEmitted,writable:!0}),r(t,u,{value:function(e,t){var r=n[d].read();r?(n[l]=null,n[a]=null,n[o]=null,e(f(r,!1))):(n[a]=e,n[o]=t)},writable:!0}),t));return n[l]=null,i(e,function(e){if(e&&e.code!==`ERR_STREAM_PREMATURE_CLOSE`){var t=n[o];t!==null&&(n[l]=null,n[a]=null,n[o]=null,t(e)),n[s]=e;return}var r=n[a];r!==null&&(n[l]=null,n[a]=null,n[o]=null,r(f(void 0,!0))),n[c]=!0}),e.on(`readable`,m.bind(null,n)),n}}),$l=h((e,t)=>{t.exports=function(){throw Error(`Readable.from is not available in the browser`)}}),eu=h((e,t)=>{t.exports=E;var n;E.ReadableState=T,mt().EventEmitter;var r=function(e,t){return e.listeners(t).length},i=Vc(),a=Wc().Buffer,o=window.Uint8Array||function(){};function s(e){return a.from(e)}function c(e){return a.isBuffer(e)||e instanceof o}var l=Vl(),u=l&&l.debuglog?l.debuglog(`stream`):function(){},d=Hl(),f=Ul(),p=Gl().getHighWaterMark,m=Wl().codes,h=m.ERR_INVALID_ARG_TYPE,g=m.ERR_STREAM_PUSH_AFTER_EOF,_=m.ERR_METHOD_NOT_IMPLEMENTED,v=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,y,b,x;Bc()(E,i);var S=f.errorOrDestroy,C=[`error`,`close`,`destroy`,`pause`,`resume`];function w(e,t,n){if(typeof e.prependListener==`function`)return e.prependListener(t,n);!e._events||!e._events[t]?e.on(t,n):Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]}function T(e,t,r){n||=Jl(),e||={},typeof r!=`boolean`&&(r=t instanceof n),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=p(this,e,`readableHighWaterMark`,r),this.buffer=new d,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=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||`utf8`,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(y||=Xl().StringDecoder,this.decoder=new y(e.encoding),this.encoding=e.encoding)}function E(e){if(n||=Jl(),!(this instanceof E))return new E(e);var t=this instanceof n;this._readableState=new T(e,this,t),this.readable=!0,e&&(typeof e.read==`function`&&(this._read=e.read),typeof e.destroy==`function`&&(this._destroy=e.destroy)),i.call(this)}Object.defineProperty(E.prototype,`destroyed`,{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=f.destroy,E.prototype._undestroy=f.undestroy,E.prototype._destroy=function(e,t){t(e)},E.prototype.push=function(e,t){var n=this._readableState,r;return n.objectMode?r=!0:typeof e==`string`&&(t||=n.defaultEncoding,t!==n.encoding&&(e=a.from(e,t),t=``),r=!0),D(this,e,t,!1,r)},E.prototype.unshift=function(e){return D(this,e,null,!0,!1)};function D(e,t,n,r,i){u(`readableAddChunk`,t);var o=e._readableState;if(t===null)o.reading=!1,N(e,o);else{var c;if(i||(c=k(o,t)),c)S(e,c);else if(o.objectMode||t&&t.length>0)if(typeof t!=`string`&&!o.objectMode&&Object.getPrototypeOf(t)!==a.prototype&&(t=s(t)),r)o.endEmitted?S(e,new v):O(e,o,t,!0);else if(o.ended)S(e,new g);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||t.length!==0?O(e,o,t,!1):I(e,o)):O(e,o,t,!1)}else r||(o.reading=!1,I(e,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function O(e,t,n,r){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit(`data`,n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&P(e)),I(e,t)}function k(e,t){var n;return!c(t)&&typeof t!=`string`&&t!==void 0&&!e.objectMode&&(n=new h(`chunk`,[`string`,`Buffer`,`Uint8Array`],t)),n}E.prototype.isPaused=function(){return this._readableState.flowing===!1},E.prototype.setEncoding=function(e){y||=Xl().StringDecoder;var t=new y(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r=``;n!==null;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),r!==``&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var A=1073741824;function j(e){return e>=A?e=A:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function M(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=j(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}E.prototype.read=function(e){u(`read`,e),e=parseInt(e,10);var t=this._readableState,n=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark===0?t.length>0:t.length>=t.highWaterMark)||t.ended))return u(`read: emitReadable`,t.length,t.ended),t.length===0&&t.ended?G(this):P(this),null;if(e=M(e,t),e===0&&t.ended)return t.length===0&&G(this),null;var r=t.needReadable;u(`need readable`,r),(t.length===0||t.length-e<t.highWaterMark)&&(r=!0,u(`length less than watermark`,r)),t.ended||t.reading?(r=!1,u(`reading or ended`,r)):r&&(u(`do read`),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=M(n,t)));var i;return i=e>0?W(e,t):null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&G(this)),i!==null&&this.emit(`data`,i),i};function N(e,t){if(u(`onEofChunk`),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?P(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,F(e)))}}function P(e){var t=e._readableState;u(`emitReadable`,t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u(`emitReadable`,t.flowing),t.emittedReadable=!0,process.nextTick(F,e))}function F(e){var t=e._readableState;u(`emitReadable_`,t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit(`readable`),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,U(e)}function I(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var n=t.length;if(u(`maybeReadMore read 0`),e.read(0),n===t.length)break}t.readingMore=!1}E.prototype._read=function(e){S(this,new _(`_read()`))},E.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,u(`pipe count=%d opts=%j`,i.pipesCount,t);var a=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr?s:g;i.endEmitted?process.nextTick(a):n.once(`end`,a),e.on(`unpipe`,o);function o(e,t){u(`onunpipe`),e===n&&t&&t.hasUnpiped===!1&&(t.hasUnpiped=!0,d())}function s(){u(`onend`),e.end()}var c=R(n);e.on(`drain`,c);var l=!1;function d(){u(`cleanup`),e.removeListener(`close`,m),e.removeListener(`finish`,h),e.removeListener(`drain`,c),e.removeListener(`error`,p),e.removeListener(`unpipe`,o),n.removeListener(`end`,s),n.removeListener(`end`,g),n.removeListener(`data`,f),l=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c()}n.on(`data`,f);function f(t){u(`ondata`);var r=e.write(t);u(`dest.write`,r),r===!1&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&q(i.pipes,e)!==-1)&&!l&&(u(`false write response, pause`,i.awaitDrain),i.awaitDrain++),n.pause())}function p(t){u(`onerror`,t),g(),e.removeListener(`error`,p),r(e,`error`)===0&&S(e,t)}w(e,`error`,p);function m(){e.removeListener(`finish`,h),g()}e.once(`close`,m);function h(){u(`onfinish`),e.removeListener(`close`,m),g()}e.once(`finish`,h);function g(){u(`unpipe`),n.unpipe(e)}return e.emit(`pipe`,n),i.flowing||(u(`pipe resume`),n.resume()),e};function R(e){return function(){var t=e._readableState;u(`pipeOnDrain`,t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&r(e,`data`)&&(t.flowing=!0,U(e))}}E.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||=t.pipes,t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit(`unpipe`,this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit(`unpipe`,this,{hasUnpiped:!1});return this}var o=q(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),--t.pipesCount,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit(`unpipe`,this,n),this)},E.prototype.on=function(e,t){var n=i.prototype.on.call(this,e,t),r=this._readableState;return e===`data`?(r.readableListening=this.listenerCount(`readable`)>0,r.flowing!==!1&&this.resume()):e===`readable`&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,u(`on readable`,r.length,r.reading),r.length?P(this):r.reading||process.nextTick(B,this)),n},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var n=i.prototype.removeListener.call(this,e,t);return e===`readable`&&process.nextTick(z,this),n},E.prototype.removeAllListeners=function(e){var t=i.prototype.removeAllListeners.apply(this,arguments);return(e===`readable`||e===void 0)&&process.nextTick(z,this),t};function z(e){var t=e._readableState;t.readableListening=e.listenerCount(`readable`)>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount(`data`)>0&&e.resume()}function B(e){u(`readable nexttick read 0`),e.read(0)}E.prototype.resume=function(){var e=this._readableState;return e.flowing||(u(`resume`),e.flowing=!e.readableListening,V(this,e)),e.paused=!1,this};function V(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(H,e,t))}function H(e,t){u(`resume`,t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(`resume`),U(e),t.flowing&&!t.reading&&e.read(0)}E.prototype.pause=function(){return u(`call pause flowing=%j`,this._readableState.flowing),this._readableState.flowing!==!1&&(u(`pause`),this._readableState.flowing=!1,this.emit(`pause`)),this._readableState.paused=!0,this};function U(e){var t=e._readableState;for(u(`flow`,t.flowing);t.flowing&&e.read()!==null;);}E.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on(`end`,function(){if(u(`wrapped end`),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on(`data`,function(i){u(`wrapped data`),n.decoder&&(i=n.decoder.write(i)),!(n.objectMode&&i==null)&&!(!n.objectMode&&(!i||!i.length))&&(t.push(i)||(r=!0,e.pause()))}),e)this[i]===void 0&&typeof e[i]==`function`&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<C.length;a++)e.on(C[a],this.emit.bind(this,C[a]));return this._read=function(t){u(`wrapped _read`,t),r&&(r=!1,e.resume())},this},typeof Symbol==`function`&&(E.prototype[Symbol.asyncIterator]=function(){return b===void 0&&(b=Ql()),b(this)}),Object.defineProperty(E.prototype,`readableHighWaterMark`,{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,`readableBuffer`,{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,`readableFlowing`,{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),E._fromList=W,Object.defineProperty(E.prototype,`readableLength`,{enumerable:!1,get:function(){return this._readableState.length}});function W(e,t){if(t.length===0)return null;var n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(``):t.buffer.length===1?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function G(e){var t=e._readableState;u(`endReadable`,t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(K,t,e))}function K(e,t){if(u(`endReadableNT`,e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit(`end`),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}typeof Symbol==`function`&&(E.from=function(e,t){return x===void 0&&(x=$l()),x(E,e,t)});function q(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}}),tu=h((e,t)=>{t.exports=l;var n=Wl().codes,r=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=n.ERR_TRANSFORM_WITH_LENGTH_0,s=Jl();Bc()(l,s);function c(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(r===null)return this.emit(`error`,new i);n.writechunk=null,n.writecb=null,t!=null&&this.push(t),r(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);s.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform==`function`&&(this._transform=e.transform),typeof e.flush==`function`&&(this._flush=e.flush)),this.on(`prefinish`,u)}function u(){var e=this;typeof this._flush==`function`&&!this._readableState.destroyed?this._flush(function(t,n){d(e,t,n)}):d(this,null,null)}l.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,n){n(new r(`_transform()`))},l.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},l.prototype._destroy=function(e,t){s.prototype._destroy.call(this,e,function(e){t(e)})};function d(e,t,n){if(t)return e.emit(`error`,t);if(n!=null&&e.push(n),e._writableState.length)throw new o;if(e._transformState.transforming)throw new a;return e.push(null)}}),nu=h((e,t)=>{t.exports=r;var n=tu();Bc()(r,n);function r(e){if(!(this instanceof r))return new r(e);n.call(this,e)}r.prototype._transform=function(e,t,n){n(null,e)}}),ru=h((e,t)=>{var n;function r(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var i=Wl().codes,a=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function c(e){return e.setHeader&&typeof e.abort==`function`}function l(e,t,i,a){a=r(a);var s=!1;e.on(`close`,function(){s=!0}),n===void 0&&(n=Zl()),n(e,{readable:t,writable:i},function(e){if(e)return a(e);s=!0,a()});var l=!1;return function(t){if(!s&&!l){if(l=!0,c(e))return e.abort();if(typeof e.destroy==`function`)return e.destroy();a(t||new o(`pipe`))}}}function u(e){e()}function d(e,t){return e.pipe(t)}function f(e){return!e.length||typeof e[e.length-1]!=`function`?s:e.pop()}function p(){var e=[...arguments],t=f(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new a(`streams`);var n,r=e.map(function(i,a){var o=a<e.length-1;return l(i,o,a>0,function(e){n||=e,e&&r.forEach(u),!o&&(r.forEach(u),t(n))})});return e.reduce(d)}t.exports=p}),iu=h((e,t)=>{t.exports=r;var n=mt().EventEmitter;Bc()(r,n),r.Readable=eu(),r.Writable=ql(),r.Duplex=Jl(),r.Transform=tu(),r.PassThrough=nu(),r.finished=Zl(),r.pipeline=ru(),r.Stream=r;function r(){n.call(this)}r.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&e.write(t)===!1&&r.pause&&r.pause()}r.on(`data`,i);function a(){r.readable&&r.resume&&r.resume()}e.on(`drain`,a),!e._isStdio&&(!t||t.end!==!1)&&(r.on(`end`,s),r.on(`close`,c));var o=!1;function s(){o||(o=!0,e.end())}function c(){o||(o=!0,typeof e.destroy==`function`&&e.destroy())}function l(e){if(u(),n.listenerCount(this,`error`)===0)throw e}r.on(`error`,l),e.on(`error`,l);function u(){r.removeListener(`data`,i),e.removeListener(`drain`,a),r.removeListener(`end`,s),r.removeListener(`close`,c),r.removeListener(`error`,l),e.removeListener(`error`,l),r.removeListener(`end`,u),r.removeListener(`close`,u),e.removeListener(`close`,u)}return r.on(`end`,u),r.on(`close`,u),e.on(`close`,u),e.emit(`pipe`,r),e}}),au=h(e=>{var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},n=/%[sdj%]/g;e.format=function(e){if(!x(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(o(arguments[r]));return t.join(` `)}for(var r=1,i=arguments,a=i.length,s=String(e).replace(n,function(e){if(e===`%%`)return`%`;if(r>=a)return e;switch(e){case`%s`:return String(i[r++]);case`%d`:return Number(i[r++]);case`%j`:try{return JSON.stringify(i[r++])}catch{return`[Circular]`}default:return e}}),c=i[r];r<a;c=i[++r])v(c)||!T(c)?s+=` `+c:s+=` `+o(c);return s},e.deprecate=function(t,n){if(typeof process<`u`&&process.noDeprecation===!0)return t;if(typeof process>`u`)return function(){return e.deprecate(t,n).apply(this,arguments)};var r=!1;function i(){if(!r){if(process.throwDeprecation)throw Error(n);process.traceDeprecation?console.trace(n):console.error(n),r=!0}return t.apply(this,arguments)}return i};var r={},i=/^$/;a=`false`,a=a.replace(/[|\\{}()[\]^$+?.]/g,`\\$&`).replace(/\*/g,`.*`).replace(/,/g,`$|^`).toUpperCase(),i=RegExp(`^`+a+`$`,`i`);var a;e.debuglog=function(t){if(t=t.toUpperCase(),!r[t])if(i.test(t)){var n=process.pid;r[t]=function(){var r=e.format.apply(e,arguments);console.error(`%s %d: %s`,t,n,r)}}else r[t]=function(){};return r[t]};function o(t,n){var r={seen:[],stylize:c};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),_(n)?r.showHidden=n:n&&e._extend(r,n),C(r.showHidden)&&(r.showHidden=!1),C(r.depth)&&(r.depth=2),C(r.colors)&&(r.colors=!1),C(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),u(r,t,r.depth)}e.inspect=o,o.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]},o.styles={special:`cyan`,number:`yellow`,boolean:`yellow`,undefined:`grey`,null:`bold`,string:`green`,date:`magenta`,regexp:`red`};function s(e,t){var n=o.styles[t];return n?`\x1B[`+o.colors[n][0]+`m`+e+`\x1B[`+o.colors[n][1]+`m`:e}function c(e,t){return e}function l(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(t,n,r){if(t.customInspect&&n&&O(n.inspect)&&n.inspect!==e.inspect&&!(n.constructor&&n.constructor.prototype===n)){var i=n.inspect(r,t);return x(i)||(i=u(t,i,r)),i}var a=d(t,n);if(a)return a;var o=Object.keys(n),s=l(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(n)),D(n)&&(o.indexOf(`message`)>=0||o.indexOf(`description`)>=0))return f(n);if(o.length===0){if(O(n)){var c=n.name?`: `+n.name:``;return t.stylize(`[Function`+c+`]`,`special`)}if(w(n))return t.stylize(RegExp.prototype.toString.call(n),`regexp`);if(E(n))return t.stylize(Date.prototype.toString.call(n),`date`);if(D(n))return f(n)}var _=``,v=!1,y=[`{`,`}`];if(g(n)&&(v=!0,y=[`[`,`]`]),O(n)&&(_=` [Function`+(n.name?`: `+n.name:``)+`]`),w(n)&&(_=` `+RegExp.prototype.toString.call(n)),E(n)&&(_=` `+Date.prototype.toUTCString.call(n)),D(n)&&(_=` `+f(n)),o.length===0&&(!v||n.length==0))return y[0]+_+y[1];if(r<0)return w(n)?t.stylize(RegExp.prototype.toString.call(n),`regexp`):t.stylize(`[Object]`,`special`);t.seen.push(n);var b;return b=v?p(t,n,r,s,o):o.map(function(e){return m(t,n,r,s,e,v)}),t.seen.pop(),h(b,_,y)}function d(e,t){if(C(t))return e.stylize(`undefined`,`undefined`);if(x(t)){var n=`'`+JSON.stringify(t).replace(/^"|"$/g,``).replace(/'/g,`\\'`).replace(/\\"/g,`"`)+`'`;return e.stylize(n,`string`)}if(b(t))return e.stylize(``+t,`number`);if(_(t))return e.stylize(``+t,`boolean`);if(v(t))return e.stylize(`null`,`null`)}function f(e){return`[`+Error.prototype.toString.call(e)+`]`}function p(e,t,n,r,i){for(var a=[],o=0,s=t.length;o<s;++o)P(t,String(o))?a.push(m(e,t,n,r,String(o),!0)):a.push(``);return i.forEach(function(i){i.match(/^\d+$/)||a.push(m(e,t,n,r,i,!0))}),a}function m(e,t,n,r,i,a){var o,s,c;if(c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},c.get?s=c.set?e.stylize(`[Getter/Setter]`,`special`):e.stylize(`[Getter]`,`special`):c.set&&(s=e.stylize(`[Setter]`,`special`)),P(r,i)||(o=`[`+i+`]`),s||(e.seen.indexOf(c.value)<0?(s=v(n)?u(e,c.value,null):u(e,c.value,n-1),s.indexOf(`
`)>-1&&(s=a?s.split(`
`).map(function(e){return` `+e}).join(`
`).slice(2):`
`+s.split(`
`).map(function(e){return` `+e}).join(`
`))):s=e.stylize(`[Circular]`,`special`)),C(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(``+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,`name`)):(o=o.replace(/'/g,`\\'`).replace(/\\"/g,`"`).replace(/(^"|"$)/g,`'`),o=e.stylize(o,`string`))}return o+`: `+s}function h(e,t,n){var r=0;return e.reduce(function(e,t){return r++,t.indexOf(`
`)>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,``).length+1},0)>60?n[0]+(t===``?``:t+`
`)+` `+e.join(`,
`)+` `+n[1]:n[0]+t+` `+e.join(`, `)+` `+n[1]}e.types=zl();function g(e){return Array.isArray(e)}e.isArray=g;function _(e){return typeof e==`boolean`}e.isBoolean=_;function v(e){return e===null}e.isNull=v;function y(e){return e==null}e.isNullOrUndefined=y;function b(e){return typeof e==`number`}e.isNumber=b;function x(e){return typeof e==`string`}e.isString=x;function S(e){return typeof e==`symbol`}e.isSymbol=S;function C(e){return e===void 0}e.isUndefined=C;function w(e){return T(e)&&A(e)===`[object RegExp]`}e.isRegExp=w,e.types.isRegExp=w;function T(e){return typeof e==`object`&&!!e}e.isObject=T;function E(e){return T(e)&&A(e)===`[object Date]`}e.isDate=E,e.types.isDate=E;function D(e){return T(e)&&(A(e)===`[object Error]`||e instanceof Error)}e.isError=D,e.types.isNativeError=D;function O(e){return typeof e==`function`}e.isFunction=O;function k(e){return e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`||typeof e==`symbol`||e===void 0}e.isPrimitive=k,e.isBuffer=Bl();function A(e){return Object.prototype.toString.call(e)}function j(e){return e<10?`0`+e.toString(10):e.toString(10)}var M=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function N(){var e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(`:`);return[e.getDate(),M[e.getMonth()],t].join(` `)}e.log=function(){console.log(`%s - %s`,N(),e.format.apply(e,arguments))},e.inherits=Bc(),e._extend=function(e,t){if(!t||!T(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var F=typeof Symbol<`u`?Symbol(`util.promisify.custom`):void 0;e.promisify=function(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type Function`);if(F&&e[F]){var n=e[F];if(typeof n!=`function`)throw TypeError(`The "util.promisify.custom" argument must be of type Function`);return Object.defineProperty(n,F,{value:n,enumerable:!1,writable:!1,configurable:!0}),n}function n(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push(function(e,r){e?n(e):t(r)});try{e.apply(this,i)}catch(e){n(e)}return r}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),F&&Object.defineProperty(n,F,{value:n,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(n,t(e))},e.promisify.custom=F;function I(e,t){if(!e){var n=Error(`Promise was rejected with a falsy value`);n.reason=e,e=n}return t(e)}function L(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type Function`);function n(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var r=t.pop();if(typeof r!=`function`)throw TypeError(`The last argument must be of type Function`);var i=this,a=function(){return r.apply(i,arguments)};e.apply(this,t).then(function(e){process.nextTick(a.bind(null,null,e))},function(e){process.nextTick(I.bind(null,e,a))})}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.defineProperties(n,t(e)),n}e.callbackify=L}),ou=h((e,t)=>{function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function a(e){var t=o(e,`string`);return n(t)===`symbol`?t:String(t)}function o(e,t){if(n(e)!==`object`||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!==`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&l(e,t)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function u(e){var t=p();return function(){var n=m(e),r;if(t){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}function d(e,t){if(t&&(n(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return f(e)}function f(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function p(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}var h={},g,_;function v(e,t,n){n||=Error;function r(e,n,r){return typeof t==`string`?t:t(e,n,r)}h[e]=function(t){c(a,t);var n=u(a);function a(t,i,o){var c;return s(this,a),c=n.call(this,r(t,i,o)),c.code=e,c}return i(a)}(n)}function y(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?`one of ${t} ${e.slice(0,n-1).join(`, `)}, or `+e[n-1]:n===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function b(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function x(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function S(e,t,n){return typeof n!=`number`&&(n=0),n+t.length>e.length?!1:e.indexOf(t,n)!==-1}v(`ERR_AMBIGUOUS_ARGUMENT`,`The "%s" argument is ambiguous. %s`,TypeError),v(`ERR_INVALID_ARG_TYPE`,function(e,t,r){g===void 0&&(g=Cu()),g(typeof e==`string`,`'name' must be a string`);var i;typeof t==`string`&&b(t,`not `)?(i=`must not be`,t=t.replace(/^not /,``)):i=`must be`;var a=x(e,` argument`)?`The ${e} ${i} ${y(t,`type`)}`:`The "${e}" ${S(e,`.`)?`property`:`argument`} ${i} ${y(t,`type`)}`;return a+=`. Received type ${n(r)}`,a},TypeError),v(`ERR_INVALID_ARG_VALUE`,function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`is invalid`;_===void 0&&(_=au());var r=_.inspect(t);return r.length>128&&(r=`${r.slice(0,128)}...`),`The argument '${e}' ${n}. Received ${r}`},TypeError,RangeError),v(`ERR_INVALID_RETURN_VALUE`,function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?`instance of ${r.constructor.name}`:`type ${n(r)}`,`Expected ${e} to be returned from the "${t}" function but got ${i}.`},TypeError),v(`ERR_MISSING_ARGS`,function(){var e=[...arguments];g===void 0&&(g=Cu()),g(e.length>0,`At least one arg needs to be specified`);var t=`The `,n=e.length;switch(e=e.map(function(e){return`"${e}"`}),n){case 1:t+=`${e[0]} argument`;break;case 2:t+=`${e[0]} and ${e[1]} arguments`;break;default:t+=e.slice(0,n-1).join(`, `),t+=`, and ${e[n-1]} arguments`;break}return`${t} must be specified`},TypeError),t.exports.codes=h}),su=h((e,t)=>{function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t];t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,n){return t=c(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function c(e){var t=l(e,`string`);return b(t)===`symbol`?t:String(t)}function l(e,t){if(b(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(b(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function u(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&v(e,t)}function d(e){var t=g();return function(){var n=y(e),r;if(t){var i=y(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f(this,r)}}function f(e,t){if(t&&(b(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return p(e)}function p(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function m(e){var t=typeof Map==`function`?new Map:void 0;return m=function(e){if(e===null||!_(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return h(e,arguments,y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)},m(e)}function h(e,t,n){return h=g()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&v(i,n.prototype),i},h.apply(null,arguments)}function g(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _(e){return Function.toString.call(e).indexOf(`[native code]`)!==-1}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e){"@babel/helpers - typeof";return b=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},b(e)}var x=au().inspect,S=ou().codes.ERR_INVALID_ARG_TYPE;function C(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function w(e,t){if(t=Math.floor(t),e.length==0||t==0)return``;var n=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+=e.substring(0,n-e.length),e}var T=``,E=``,D=``,O=``,k={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:`},A=10;function j(e){var t=Object.keys(e),n=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){n[t]=e[t]}),Object.defineProperty(n,`message`,{value:e.message}),n}function M(e){return x(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function N(e,t,n){var r=``,i=``,a=0,o=``,s=!1,c=M(e),l=c.split(`
`),u=M(t).split(`
`),d=0,f=``;if(n===`strictEqual`&&b(e)===`object`&&b(t)===`object`&&e!==null&&t!==null&&(n=`strictEqualObject`),l.length===1&&u.length===1&&l[0]!==u[0]){var p=l[0].length+u[0].length;if(p<=A){if((b(e)!==`object`||e===null)&&(b(t)!==`object`||t===null)&&(e!==0||t!==0))return`${k[n]}
${l[0]} !== ${u[0]}
`}else if(n!==`strictEqualObject`&&p<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;l[0][d]===u[0][d];)d++;d>2&&(f=`
${w(` `,d)}^`,d=0)}}for(var m=l[l.length-1],h=u[u.length-1];m===h&&(d++<2?o=`
${m}${o}`:r=m,l.pop(),u.pop(),!(l.length===0||u.length===0));)m=l[l.length-1],h=u[u.length-1];var g=Math.max(l.length,u.length);if(g===0){var _=c.split(`
`);if(_.length>30)for(_[26]=`${T}...${O}`;_.length>27;)_.pop();return`${k.notIdentical}
${_.join(`
`)}
`}d>3&&(o=`
${T}...${O}${o}`,s=!0),r!==``&&(o=`
${r}${o}`,r=``);var v=0,y=k[n]+`
${E}+ actual${O} ${D}- expected${O}`,x=` ${T}...${O} Lines skipped`;for(d=0;d<g;d++){var S=d-a;if(l.length<d+1)S>1&&d>2&&(S>4?(i+=`
${T}...${O}`,s=!0):S>3&&(i+=`
${u[d-2]}`,v++),i+=`
${u[d-1]}`,v++),a=d,r+=`
${D}-${O} ${u[d]}`,v++;else if(u.length<d+1)S>1&&d>2&&(S>4?(i+=`
${T}...${O}`,s=!0):S>3&&(i+=`
${l[d-2]}`,v++),i+=`
${l[d-1]}`,v++),a=d,i+=`
${E}+${O} ${l[d]}`,v++;else{var j=u[d],N=l[d],P=N!==j&&(!C(N,`,`)||N.slice(0,-1)!==j);P&&C(j,`,`)&&j.slice(0,-1)===N&&(P=!1,N+=`,`),P?(S>1&&d>2&&(S>4?(i+=`
${T}...${O}`,s=!0):S>3&&(i+=`
${l[d-2]}`,v++),i+=`
${l[d-1]}`,v++),a=d,i+=`
${E}+${O} ${N}`,r+=`
${D}-${O} ${j}`,v+=2):(i+=r,r=``,(S===1||d===0)&&(i+=`
${N}`,v++))}if(v>20&&d<g-2)return`${y}${x}
${i}
${T}...${O}${r}
${T}...${O}`}return`${y}${s?x:``}
${i}${r}${o}${f}`}t.exports=function(e,t){u(i,e);var n=d(i);function i(e){var t;if(a(this,i),b(e)!==`object`||e===null)throw new S(`options`,`Object`,e);var r=e.message,o=e.operator,s=e.stackStartFn,c=e.actual,l=e.expected,u=Error.stackTraceLimit;if(Error.stackTraceLimit=0,r!=null)t=n.call(this,String(r));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&process.stderr.getColorDepth()!==1?(T=`\x1B[34m`,E=`\x1B[32m`,O=`\x1B[39m`,D=`\x1B[31m`):(T=``,E=``,O=``,D=``)),b(c)===`object`&&c!==null&&b(l)===`object`&&l!==null&&`stack`in c&&c instanceof Error&&`stack`in l&&l instanceof Error&&(c=j(c),l=j(l)),o===`deepStrictEqual`||o===`strictEqual`)t=n.call(this,N(c,l,o));else if(o===`notDeepStrictEqual`||o===`notStrictEqual`){var d=k[o],m=M(c).split(`
`);if(o===`notStrictEqual`&&b(c)===`object`&&c!==null&&(d=k.notStrictEqualObject),m.length>30)for(m[26]=`${T}...${O}`;m.length>27;)m.pop();t=m.length===1?n.call(this,`${d} ${m[0]}`):n.call(this,`${d}
${m.join(`
`)}
`)}else{var h=M(c),g=``,_=k[o];o===`notDeepEqual`||o===`notEqual`?(h=`${k[o]}
${h}`,h.length>1024&&(h=`${h.slice(0,1021)}...`)):(g=`${M(l)}`,h.length>512&&(h=`${h.slice(0,509)}...`),g.length>512&&(g=`${g.slice(0,509)}...`),o===`deepEqual`||o===`equal`?h=`${_}
${h}
should equal
`:g=` ${o} ${g}`),t=n.call(this,`${h}${g}`)}return Error.stackTraceLimit=u,t.generatedMessage=!r,Object.defineProperty(p(t),`name`,{value:`AssertionError [ERR_ASSERTION]`,enumerable:!1,writable:!0,configurable:!0}),t.code=`ERR_ASSERTION`,t.actual=c,t.expected=l,t.operator=o,Error.captureStackTrace&&Error.captureStackTrace(p(t),s),t.stack,t.name=`AssertionError`,f(t)}return s(i,[{key:`toString`,value:function(){return`${this.name} [${this.code}]: ${this.message}`}},{key:t,value:function(e,t){return x(this,r(r({},t),{},{customInspect:!1,depth:0}))}}]),i}(m(Error),x.custom)}),cu=h((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){var t=n.call(e),r=t===`[object Arguments]`;return r||=t!==`[object Array]`&&typeof e==`object`&&!!e&&typeof e.length==`number`&&e.length>=0&&n.call(e.callee)===`[object Function]`,r}}),lu=h((e,t)=>{var n;Object.keys||(r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=cu(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},`toString`),c=o.call(function(){},`prototype`),l=[`toString`,`toLocaleString`,`valueOf`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`constructor`],u=function(e){var t=e.constructor;return t&&t.prototype===e},d={$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},f=function(){if(typeof window>`u`)return!1;for(var e in window)try{if(!d[`$`+e]&&r.call(window,e)&&window[e]!==null&&typeof window[e]==`object`)try{u(window[e])}catch{return!0}}catch{return!0}return!1}(),p=function(e){if(typeof window>`u`||!f)return u(e);try{return u(e)}catch{return!1}},n=function(e){var t=typeof e==`object`&&!!e,n=i.call(e)===`[object Function]`,o=a(e),u=t&&i.call(e)===`[object String]`,d=[];if(!t&&!n&&!o)throw TypeError(`Object.keys called on a non-object`);var f=c&&n;if(u&&e.length>0&&!r.call(e,0))for(var m=0;m<e.length;++m)d.push(String(m));if(o&&e.length>0)for(var h=0;h<e.length;++h)d.push(String(h));else for(var g in e)!(f&&g===`prototype`)&&r.call(e,g)&&d.push(String(g));if(s)for(var _=p(e),v=0;v<l.length;++v)!(_&&l[v]===`constructor`)&&r.call(e,l[v])&&d.push(l[v]);return d});var r,i,a,o,s,c,l,u,d,f,p;t.exports=n}),uu=h((e,t)=>{var n=Array.prototype.slice,r=cu(),i=Object.keys,a=i?function(e){return i(e)}:lu(),o=Object.keys;a.shim=function(){return Object.keys?(function(){var e=Object.keys(arguments);return e&&e.length===arguments.length})(1,2)||(Object.keys=function(e){return r(e)?o(n.call(e)):o(e)}):Object.keys=a,Object.keys||a},t.exports=a}),du=h((e,t)=>{var n=uu(),r=Gc()(),i=jl(),a=Object,o=i(`Array.prototype.push`),s=i(`Object.prototype.propertyIsEnumerable`),c=r?Object.getOwnPropertySymbols:null;t.exports=function(e,t){if(e==null)throw TypeError(`target must be an object`);var i=a(e);if(arguments.length===1)return i;for(var l=1;l<arguments.length;++l){var u=a(arguments[l]),d=n(u),f=r&&(Object.getOwnPropertySymbols||c);if(f)for(var p=f(u),m=0;m<p.length;++m){var h=p[m];s(u,h)&&o(d,h)}for(var g=0;g<d.length;++g){var _=d[g];s(u,_)&&(i[_]=u[_])}}return i}}),fu=h((e,t)=>{var n=du(),r=function(){if(!Object.assign)return!1;for(var e=`abcdefghijklmnopqrst`,t=e.split(``),n={},r=0;r<t.length;++r)n[t[r]]=t[r];var i=Object.assign({},n),a=``;for(var o in i)a+=o;return e!==a},i=function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,`xy`)}catch{return e[1]===`y`}return!1};t.exports=function(){return!Object.assign||r()||i()?n:Object.assign}}),pu=h((e,t)=>{var n=function(e){return e!==e};t.exports=function(e,t){return e===0&&t===0?1/e==1/t:!!(e===t||n(e)&&n(t))}}),mu=h((e,t)=>{var n=pu();t.exports=function(){return typeof Object.is==`function`?Object.is:n}}),hu=h((e,t)=>{var n=uu(),r=typeof Symbol==`function`&&typeof Symbol(`foo`)==`symbol`,i=Object.prototype.toString,a=Array.prototype.concat,o=Object.defineProperty,s=function(e){return typeof e==`function`&&i.call(e)===`[object Function]`},c=Ol()(),l=o&&c,u=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!s(r)||!r())return}l?o(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n},d=function(e,t){var i=arguments.length>2?arguments[2]:{},o=n(t);r&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)u(e,o[s],t[o[s]],i[o[s]])};d.supportsDescriptors=!!l,t.exports=d}),gu=h((e,t)=>{var n=mu(),r=hu();t.exports=function(){var e=n();return r(Object,{is:e},{is:function(){return Object.is!==e}}),e}}),_u=h((e,t)=>{var n=hu(),r=Al(),i=pu(),a=mu(),o=gu(),s=r(a(),Object);n(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s}),vu=h((e,t)=>{t.exports=function(e){return e!==e}}),yu=h((e,t)=>{var n=vu();t.exports=function(){return Number.isNaN&&!Number.isNaN(`a`)?Number.isNaN:n}}),bu=h((e,t)=>{var n=hu(),r=yu();t.exports=function(){var e=r();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}}),xu=h((e,t)=>{var n=Al(),r=hu(),i=vu(),a=yu(),o=bu(),s=n(a(),Number);r(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s}),Su=h((e,t)=>{function n(e,t){return s(e)||o(e,t)||i(e,t)||r()}function r(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(e,t){if(e){if(typeof e==`string`)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}}function a(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function s(e){if(Array.isArray(e))return e}function c(e){"@babel/helpers - typeof";return c=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},c(e)}var l=/a/g.flags!==void 0,u=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},d=function(e){var t=[];return e.forEach(function(e,n){return t.push([n,e])}),t},f=Object.is?Object.is:_u(),p=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},m=Number.isNaN?Number.isNaN:xu();function h(e){return e.call.bind(e)}var g=h(Object.prototype.hasOwnProperty),_=h(Object.prototype.propertyIsEnumerable),v=h(Object.prototype.toString),y=au().types,b=y.isAnyArrayBuffer,x=y.isArrayBufferView,S=y.isDate,C=y.isMap,w=y.isRegExp,T=y.isSet,E=y.isNativeError,D=y.isBoxedPrimitive,O=y.isNumberObject,k=y.isStringObject,A=y.isBooleanObject,j=y.isBigIntObject,M=y.isSymbolObject,N=y.isFloat32Array,P=y.isFloat64Array;function F(e){if(e.length===0||e.length>10)return!0;for(var t=0;t<e.length;t++){var n=e.charCodeAt(t);if(n<48||n>57)return!0}return e.length===10&&e>=2**32}function I(e){return Object.keys(e).filter(F).concat(p(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function L(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0}var R=void 0,z=!0,B=!1,V=0,H=1,U=2,W=3;function G(e,t){return l?e.source===t.source&&e.flags===t.flags:RegExp.prototype.toString.call(e)===RegExp.prototype.toString.call(t)}function K(e,t){if(e.byteLength!==t.byteLength)return!1;for(var n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}function q(e,t){return e.byteLength===t.byteLength?L(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))===0:!1}function J(e,t){return e.byteLength===t.byteLength&&L(new Uint8Array(e),new Uint8Array(t))===0}function Y(e,t){return O(e)?O(t)&&f(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):k(e)?k(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):A(e)?A(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):j(e)?j(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):M(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}function X(e,t,n,r){if(e===t)return e===0&&n?f(e,t):!0;if(n){if(c(e)!==`object`)return typeof e==`number`&&m(e)&&m(t);if(c(t)!==`object`||e===null||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(e===null||c(e)!==`object`)return t===null||c(t)!==`object`?e==t:!1;if(t===null||c(t)!==`object`)return!1}var i=v(e);if(i!==v(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var a=I(e,R),o=I(t,R);return a.length===o.length?Q(e,t,n,r,H,a):!1}if(i===`[object Object]`&&(!C(e)&&C(t)||!T(e)&&T(t)))return!1;if(S(e)){if(!S(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||!G(e,t))return!1}else if(E(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else if(x(e)){if(!n&&(N(e)||P(e))){if(!K(e,t))return!1}else if(!q(e,t))return!1;var s=I(e,R),l=I(t,R);return s.length===l.length?Q(e,t,n,r,V,s):!1}else{if(T(e))return!T(t)||e.size!==t.size?!1:Q(e,t,n,r,U);if(C(e))return!C(t)||e.size!==t.size?!1:Q(e,t,n,r,W);if(b(e)){if(!J(e,t))return!1}else if(D(e)&&!Y(e,t))return!1}return Q(e,t,n,r,V)}function Z(e,t){return t.filter(function(t){return _(e,t)})}function Q(e,t,n,r,i,a){if(arguments.length===5){a=Object.keys(e);var o=Object.keys(t);if(a.length!==o.length)return!1}for(var s=0;s<a.length;s++)if(!g(t,a[s]))return!1;if(n&&arguments.length===5){var c=p(e);if(c.length!==0){var l=0;for(s=0;s<c.length;s++){var u=c[s];if(_(e,u)){if(!_(t,u))return!1;a.push(u),l++}else if(_(t,u))return!1}var d=p(t);if(c.length!==d.length&&Z(t,d).length!==l)return!1}else{var f=p(t);if(f.length!==0&&Z(t,f).length!==0)return!1}}if(a.length===0&&(i===V||i===H&&e.length===0||e.size===0))return!0;if(r===void 0)r={val1:new Map,val2:new Map,position:0};else{var m=r.val1.get(e);if(m!==void 0){var h=r.val2.get(t);if(h!==void 0)return m===h}r.position++}r.val1.set(e,r.position),r.val2.set(t,r.position);var v=se(e,t,n,a,r,i);return r.val1.delete(e),r.val2.delete(t),v}function ee(e,t,n,r){for(var i=u(e),a=0;a<i.length;a++){var o=i[a];if(X(t,o,n,r))return e.delete(o),!0}return!1}function te(e){switch(c(e)){case`undefined`:return null;case`object`:return;case`symbol`:return!1;case`string`:e=+e;case`number`:if(m(e))return!1}return!0}function ne(e,t,n){var r=te(n);return r??(t.has(r)&&!e.has(r))}function re(e,t,n,r,i){var a=te(n);if(a!=null)return a;var o=t.get(a);return o===void 0&&!t.has(a)||!X(r,o,!1,i)?!1:!e.has(a)&&X(r,o,!1,i)}function ie(e,t,n,r){for(var i=null,a=u(e),o=0;o<a.length;o++){var s=a[o];if(c(s)===`object`&&s!==null)i===null&&(i=new Set),i.add(s);else if(!t.has(s)){if(n||!ne(e,t,s))return!1;i===null&&(i=new Set),i.add(s)}}if(i!==null){for(var l=u(t),d=0;d<l.length;d++){var f=l[d];if(c(f)===`object`&&f!==null){if(!ee(i,f,n,r))return!1}else if(!n&&!e.has(f)&&!ee(i,f,n,r))return!1}return i.size===0}return!0}function ae(e,t,n,r,i,a){for(var o=u(e),s=0;s<o.length;s++){var c=o[s];if(X(n,c,i,a)&&X(r,t.get(c),i,a))return e.delete(c),!0}return!1}function oe(e,t,r,i){for(var a=null,o=d(e),s=0;s<o.length;s++){var l=n(o[s],2),u=l[0],f=l[1];if(c(u)===`object`&&u!==null)a===null&&(a=new Set),a.add(u);else{var p=t.get(u);if(p===void 0&&!t.has(u)||!X(f,p,r,i)){if(r||!re(e,t,u,f,i))return!1;a===null&&(a=new Set),a.add(u)}}}if(a!==null){for(var m=d(t),h=0;h<m.length;h++){var g=n(m[h],2),_=g[0],v=g[1];if(c(_)===`object`&&_!==null){if(!ae(a,e,_,v,r,i))return!1}else if(!r&&(!e.has(_)||!X(e.get(_),v,!1,i))&&!ae(a,e,_,v,!1,i))return!1}return a.size===0}return!0}function se(e,t,n,r,i,a){var o=0;if(a===U){if(!ie(e,t,n,i))return!1}else if(a===W){if(!oe(e,t,n,i))return!1}else if(a===H)for(;o<e.length;o++)if(g(e,o)){if(!g(t,o)||!X(e[o],t[o],n,i))return!1}else{if(g(t,o))return!1;for(var s=Object.keys(e);o<s.length;o++){var c=s[o];if(!g(t,c)||!X(e[c],t[c],n,i))return!1}return s.length===Object.keys(t).length}for(o=0;o<r.length;o++){var l=r[o];if(!X(e[l],t[l],n,i))return!1}return!0}function ce(e,t){return X(e,t,B)}function le(e,t){return X(e,t,z)}t.exports={isDeepEqual:ce,isDeepStrictEqual:le}}),Cu=h((e,t)=>{function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function a(e){var t=o(e,`string`);return n(t)===`symbol`?t:String(t)}function o(e,t){if(n(e)!==`object`||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!==`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var c=ou().codes,l=c.ERR_AMBIGUOUS_ARGUMENT,u=c.ERR_INVALID_ARG_TYPE,d=c.ERR_INVALID_ARG_VALUE,f=c.ERR_INVALID_RETURN_VALUE,p=c.ERR_MISSING_ARGS,m=su(),h=au().inspect,g=au().types,_=g.isPromise,v=g.isRegExp,y=fu()(),b=mu()(),x=jl()(`RegExp.prototype.test`),S,C;function w(){var e=Su();S=e.isDeepEqual,C=e.isDeepStrictEqual}var T=!1,E=t.exports=j,D={};function O(e){throw e.message instanceof Error?e.message:new m(e)}function k(e,t,n,r,i){var a=arguments.length,o;if(a===0?o=`Failed`:a===1?(n=e,e=void 0):(T===!1&&(T=!0,(process.emitWarning?process.emitWarning:console.warn.bind(console))(`assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.`,`DeprecationWarning`,`DEP0094`)),a===2&&(r=`!=`)),n instanceof Error)throw n;var s={actual:e,expected:t,operator:r===void 0?`fail`:r,stackStartFn:i||k};n!==void 0&&(s.message=n);var c=new m(s);throw o&&(c.message=o,c.generatedMessage=!0),c}E.fail=k,E.AssertionError=m;function A(e,t,n,r){if(!n){var i=!1;if(t===0)i=!0,r="No value argument passed to `assert.ok()`";else if(r instanceof Error)throw r;var a=new m({actual:n,expected:!0,message:r,operator:`==`,stackStartFn:e});throw a.generatedMessage=i,a}}function j(){var e=[...arguments];A.apply(void 0,[j,e.length].concat(e))}E.ok=j,E.equal=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);t!=n&&O({actual:t,expected:n,message:r,operator:`==`,stackStartFn:e})},E.notEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);t==n&&O({actual:t,expected:n,message:r,operator:`!=`,stackStartFn:e})},E.deepEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);S===void 0&&w(),S(t,n)||O({actual:t,expected:n,message:r,operator:`deepEqual`,stackStartFn:e})},E.notDeepEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);S===void 0&&w(),S(t,n)&&O({actual:t,expected:n,message:r,operator:`notDeepEqual`,stackStartFn:e})},E.deepStrictEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);S===void 0&&w(),C(t,n)||O({actual:t,expected:n,message:r,operator:`deepStrictEqual`,stackStartFn:e})},E.notDeepStrictEqual=M;function M(e,t,n){if(arguments.length<2)throw new p(`actual`,`expected`);S===void 0&&w(),C(e,t)&&O({actual:e,expected:t,message:n,operator:`notDeepStrictEqual`,stackStartFn:M})}E.strictEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);b(t,n)||O({actual:t,expected:n,message:r,operator:`strictEqual`,stackStartFn:e})},E.notStrictEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);b(t,n)&&O({actual:t,expected:n,message:r,operator:`notStrictEqual`,stackStartFn:e})};var N=i(function e(t,n,r){var i=this;s(this,e),n.forEach(function(e){e in t&&(r!==void 0&&typeof r[e]==`string`&&v(t[e])&&x(t[e],r[e])?i[e]=r[e]:i[e]=t[e])})});function P(e,t,n,r,i,a){if(!(n in e)||!C(e[n],t[n])){if(!r){var o=new m({actual:new N(e,i),expected:new N(t,i,e),operator:`deepStrictEqual`,stackStartFn:a});throw o.actual=e,o.expected=t,o.operator=a.name,o}O({actual:e,expected:t,message:r,operator:a.name,stackStartFn:a})}}function F(e,t,r,i){if(typeof t!=`function`){if(v(t))return x(t,e);if(arguments.length===2)throw new u(`expected`,[`Function`,`RegExp`],t);if(n(e)!==`object`||e===null){var a=new m({actual:e,expected:t,message:r,operator:`deepStrictEqual`,stackStartFn:i});throw a.operator=i.name,a}var o=Object.keys(t);if(t instanceof Error)o.push(`name`,`message`);else if(o.length===0)throw new d(`error`,t,`may not be an empty object`);return S===void 0&&w(),o.forEach(function(n){typeof e[n]==`string`&&v(t[n])&&x(t[n],e[n])||P(e,t,n,r,o,i)}),!0}return t.prototype!==void 0&&e instanceof t?!0:Error.isPrototypeOf(t)?!1:t.call({},e)===!0}function I(e){if(typeof e!=`function`)throw new u(`fn`,`Function`,e);try{e()}catch(e){return e}return D}function L(e){return _(e)||e!==null&&n(e)===`object`&&typeof e.then==`function`&&typeof e.catch==`function`}function R(e){return Promise.resolve().then(function(){var t;if(typeof e==`function`){if(t=e(),!L(t))throw new f(`instance of Promise`,`promiseFn`,t)}else if(L(e))t=e;else throw new u(`promiseFn`,[`Function`,`Promise`],e);return Promise.resolve().then(function(){return t}).then(function(){return D}).catch(function(e){return e})})}function z(e,t,r,i){if(typeof r==`string`){if(arguments.length===4)throw new u(`error`,[`Object`,`Error`,`Function`,`RegExp`],r);if(n(t)===`object`&&t!==null){if(t.message===r)throw new l(`error/message`,`The error message "${t.message}" is identical to the message.`)}else if(t===r)throw new l(`error/message`,`The error "${t}" is identical to the message.`);i=r,r=void 0}else if(r!=null&&n(r)!==`object`&&typeof r!=`function`)throw new u(`error`,[`Object`,`Error`,`Function`,`RegExp`],r);if(t===D){var a=``;r&&r.name&&(a+=` (${r.name})`),a+=i?`: ${i}`:`.`;var o=e.name===`rejects`?`rejection`:`exception`;O({actual:void 0,expected:r,operator:e.name,message:`Missing expected ${o}${a}`,stackStartFn:e})}if(r&&!F(t,r,i,e))throw t}function B(e,t,n,r){if(t!==D){if(typeof n==`string`&&(r=n,n=void 0),!n||F(t,n)){var i=r?`: ${r}`:`.`,a=e.name===`doesNotReject`?`rejection`:`exception`;O({actual:t,expected:n,operator:e.name,message:`Got unwanted ${a}${i}
Actual message: "${t&&t.message}"`,stackStartFn:e})}throw t}}E.throws=function e(t){var n=[...arguments].slice(1);z.apply(void 0,[e,I(t)].concat(n))},E.rejects=function e(t){var n=[...arguments].slice(1);return R(t).then(function(t){return z.apply(void 0,[e,t].concat(n))})},E.doesNotThrow=function e(t){var n=[...arguments].slice(1);B.apply(void 0,[e,I(t)].concat(n))},E.doesNotReject=function e(t){var n=[...arguments].slice(1);return R(t).then(function(t){return B.apply(void 0,[e,t].concat(n))})},E.ifError=function e(t){if(t!=null){var r=`ifError got unwanted exception: `;n(t)===`object`&&typeof t.message==`string`?t.message.length===0&&t.constructor?r+=t.constructor.name:r+=t.message:r+=h(t);var i=new m({actual:t,expected:null,operator:`ifError`,message:r,stackStartFn:e}),a=t.stack;if(typeof a==`string`){var o=a.split(`
`);o.shift();for(var s=i.stack.split(`
`),c=0;c<o.length;c++){var l=s.indexOf(o[c]);if(l!==-1){s=s.slice(0,l);break}}i.stack=`${s.join(`
`)}
${o.join(`
`)}`}throw i}};function V(e,t,r,i,a){if(!v(t))throw new u(`regexp`,`RegExp`,t);var o=a===`match`;if(typeof e!=`string`||x(t,e)!==o){if(r instanceof Error)throw r;var s=!r;r||=typeof e==`string`?(o?`The input did not match the regular expression `:`The input was expected to not match the regular expression `)+`${h(t)}. Input:
${h(e)}
`:`The "string" argument must be of type string. Received type ${n(e)} (${h(e)})`;var c=new m({actual:e,expected:t,message:r,operator:a,stackStartFn:i});throw c.generatedMessage=s,c}}E.match=function e(t,n,r){V(t,n,r,e,`match`)},E.doesNotMatch=function e(t,n,r){V(t,n,r,e,`doesNotMatch`)};function H(){var e=[...arguments];A.apply(void 0,[H,e.length].concat(e))}E.strict=y(H,E,{equal:E.strictEqual,deepEqual:E.deepStrictEqual,notEqual:E.notStrictEqual,notDeepEqual:E.notDeepStrictEqual}),E.strict.strict=E.strict}),wu=h((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return s(e);if(n===`number`&&isNaN(e)===!1)return t.long?l(e):c(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function s(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var s=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return s*o;case`days`:case`day`:case`d`:return s*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return s*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return s*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return s*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return s;default:return}}}}function c(e){return e>=a?Math.round(e/a)+`d`:e>=i?Math.round(e/i)+`h`:e>=r?Math.round(e/r)+`m`:e>=n?Math.round(e/n)+`s`:e+`ms`}function l(e){return u(e,a,`day`)||u(e,i,`hour`)||u(e,r,`minute`)||u(e,n,`second`)||e+` ms`}function u(e,t,n){if(!(e<t))return e<t*1.5?Math.floor(e/t)+` `+n:Math.ceil(e/t)+` `+n+`s`}}),Tu=h((e,t)=>{e=t.exports=i.debug=i.default=i,e.coerce=c,e.disable=o,e.enable=a,e.enabled=s,e.humanize=wu(),e.names=[],e.skips=[],e.formatters={};var n;function r(t){var n=0,r;for(r in t)n=(n<<5)-n+t.charCodeAt(r),n|=0;return e.colors[Math.abs(n)%e.colors.length]}function i(t){function i(){if(i.enabled){var t=i,r=+new Date;t.diff=r-(n||r),t.prev=n,t.curr=r,n=r;for(var a=Array(arguments.length),o=0;o<a.length;o++)a[o]=arguments[o];a[0]=e.coerce(a[0]),typeof a[0]!=`string`&&a.unshift(`%O`);var s=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,function(n,r){if(n===`%%`)return n;s++;var i=e.formatters[r];if(typeof i==`function`){var o=a[s];n=i.call(t,o),a.splice(s,1),s--}return n}),e.formatArgs.call(t,a),(i.log||e.log||console.log.bind(console)).apply(t,a)}}return i.namespace=t,i.enabled=e.enabled(t),i.useColors=e.useColors(),i.color=r(t),typeof e.init==`function`&&e.init(i),i}function a(t){e.save(t),e.names=[],e.skips=[];for(var n=(typeof t==`string`?t:``).split(/[\s,]+/),r=n.length,i=0;i<r;i++)n[i]&&(t=n[i].replace(/\*/g,`.*?`),t[0]===`-`?e.skips.push(RegExp(`^`+t.substr(1)+`$`)):e.names.push(RegExp(`^`+t+`$`)))}function o(){e.enable(``)}function s(t){var n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}}),Eu=h((e,t)=>{e=t.exports=Tu(),e.log=i,e.formatArgs=r,e.save=a,e.load=o,e.useColors=n,e.storage=typeof chrome<`u`&&chrome.storage!==void 0?chrome.storage.local:s(),e.colors=[`lightseagreen`,`forestgreen`,`goldenrod`,`dodgerblue`,`darkorchid`,`crimson`];function n(){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+)/)}e.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}};function r(t){var n=this.useColors;if(t[0]=(n?`%c`:``)+this.namespace+(n?` %c`:` `)+t[0]+(n?`%c `:` `)+`+`+e.humanize(this.diff),n){var r=`color: `+this.color;t.splice(1,0,r,`color: inherit`);var i=0,a=0;t[0].replace(/%[a-zA-Z%]/g,function(e){e!==`%%`&&(i++,e===`%c`&&(a=i))}),t.splice(a,0,r)}}function i(){return typeof console==`object`&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{t==null?e.storage.removeItem(`debug`):e.storage.debug=t}catch{}}function o(){var t;try{t=e.storage.debug}catch{}return!t&&typeof process<`u`&&`env`in process&&(t={}.DEBUG),t}e.enable(o());function s(){try{return window.localStorage}catch{}}}),Du=h((e,t)=>{var n=Cu(),r=Eu()(`stream-parser`);t.exports=c;var i=-1,a=0,o=1,s=2;function c(e){var t=e&&typeof e._transform==`function`,n=e&&typeof e._write==`function`;if(!t&&!n)throw Error(`must pass a Writable or Transform stream in`);r(`extending Parser into stream`),e._bytes=u,e._skipBytes=d,t&&(e._passthrough=f),t?e._transform=m:e._write=p}function l(e){r(`initializing parser stream`),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=i,e._parserCallback=null,typeof e.push==`function`&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function u(e,t){n(!this._parserCallback,`there is already a "callback" set!`),n(isFinite(e)&&e>0,`can only buffer a finite number of bytes > 0, got "`+e+`"`),this._parserInit||l(this),r(`buffering %o bytes`,e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=a}function d(e,t){n(!this._parserCallback,`there is already a "callback" set!`),n(e>0,`can only skip > 0 bytes, got "`+e+`"`),this._parserInit||l(this),r(`skipping %o bytes`,e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=o}function f(e,t){n(!this._parserCallback,`There is already a "callback" set!`),n(e>0,`can only pass through > 0 bytes, got "`+e+`"`),this._parserInit||l(this),r(`passing through %o bytes`,e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=s}function p(e,t,n){this._parserInit||l(this),r(`write(%o bytes)`,e.length),typeof t==`function`&&(n=t),_(this,e,null,n)}function m(e,t,n){this._parserInit||l(this),r(`transform(%o bytes)`,e.length),typeof t!=`function`&&(t=this._parserOutput),_(this,e,t,n)}function h(e,t,n,r){return e._parserBytesLeft<=0?r(Error(`got data but not currently parsing anything`)):t.length<=e._parserBytesLeft?function(){return g(e,t,n,r)}:function(){var i=t.slice(0,e._parserBytesLeft);return g(e,i,n,function(a){if(a)return r(a);if(t.length>i.length)return function(){return h(e,t.slice(i.length),n,r)}})}}function g(e,t,n,o){if(e._parserBytesLeft-=t.length,r(`%o bytes left for stream piece`,e._parserBytesLeft),e._parserState===a?(e._parserBuffers.push(t),e._parserBuffered+=t.length):e._parserState===s&&n(t),e._parserBytesLeft===0){var c=e._parserCallback;if(c&&e._parserState===a&&e._parserBuffers.length>1&&(t=Buffer.concat(e._parserBuffers,e._parserBuffered)),e._parserState!==a&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=i,e._parserBuffers.splice(0),c){var l=[];t&&l.push(t),n&&l.push(n);var u=c.length>l.length;u&&l.push(v(o));var d=c.apply(e,l);if(!u||o===d)return o}}else return o}var _=v(h);function v(e){return function(){for(var t=e.apply(this,arguments);typeof t==`function`;)t=t();return t}}}),Ou=h(e=>{var t=iu().Transform,n=Du();function r(){t.call(this,{readableObjectMode:!0})}r.prototype=Object.create(t.prototype),r.prototype.constructor=r,n(r.prototype),e.ParserStream=r,e.sliceEq=function(e,t,n){for(var r=t,i=0;i<n.length;)if(e[r++]!==n[i++])return!1;return!0},e.str2arr=function(e,t){var n=[],r=0;if(t&&t===`hex`)for(;r<e.length;)n.push(parseInt(e.slice(r,r+2),16)),r+=2;else for(;r<e.length;r++)n.push(e.charCodeAt(r)&255);return n},e.readUInt16LE=function(e,t){return e[t]|e[t+1]<<8},e.readUInt16BE=function(e,t){return e[t+1]|e[t]<<8},e.readUInt32LE=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]*16777216},e.readUInt32BE=function(e,t){return e[t+3]|e[t+2]<<8|e[t+1]<<16|e[t]*16777216};function i(e,t,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``,this.name=this.constructor.name,this.message=e,t&&(this.code=t),n&&(this.statusCode=n)}i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,e.ProbeError=i}),ku=h((e,t)=>{var n=Ou().readUInt16BE,r=Ou().readUInt32BE;function i(e,t){if(e.length<4+t)return null;var n=r(e,t);return e.length<n+t||n<8?null:{boxtype:String.fromCharCode.apply(null,e.slice(t+4,t+8)),data:e.slice(t+8,t+n),end:t+n}}t.exports.unbox=i;function a(e,t){for(var n=0;;){var a=i(e,n);if(!a)break;switch(a.boxtype){case`ispe`:t.sizes.push({width:r(a.data,4),height:r(a.data,8)});break;case`irot`:t.transforms.push({type:`irot`,value:a.data[0]&3});break;case`imir`:t.transforms.push({type:`imir`,value:a.data[0]&1});break}n=a.end}}function o(e,t,n){for(var r=0,i=0;i<n;i++)r=r*256+(e[t+i]||0);return r}function s(e,t){for(var r=e[4]>>4&15,i=e[4]&15,a=e[5]>>4&15,s=n(e,6),c=8,l=0;l<s;l++){var u=n(e,c);c+=2;var d=n(e,c);c+=2;var f=o(e,c,a);c+=a;var p=n(e,c);if(c+=2,d===0&&p===1){var m=o(e,c,r),h=o(e,c+r,i);t.item_loc[u]={length:h,offset:m+f}}c+=p*(r+i)}}function c(e,t){for(var r=n(e,4),a=6,o=0;o<r;o++){var s=i(e,a);if(!s)break;if(s.boxtype===`infe`){for(var c=n(s.data,4),l=``,u=8;u<s.data.length&&s.data[u];u++)l+=String.fromCharCode(s.data[u]);t.item_inf[l]=c}a=s.end}}function l(e,t){for(var n=0;;){var r=i(e,n);if(!r)break;r.boxtype===`ipco`&&a(r.data,t),n=r.end}}function u(e,t){for(var n=4;;){var r=i(e,n);if(!r)break;r.boxtype===`iprp`&&l(r.data,t),r.boxtype===`iloc`&&s(r.data,t),r.boxtype===`iinf`&&c(r.data,t),n=r.end}}function d(e){var t=e.reduce(function(e,t){return e.width>t.width||e.width===t.width&&e.height>t.height?e:t}),n=e.reduce(function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t}),r;return r=t.width>n.height||t.width===n.height&&t.height>n.width?t:n,r}t.exports.readSizeFromMeta=function(e){var t={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(u(e,t),t.sizes.length){var n=d(t.sizes),r=1;t.transforms.forEach(function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},n={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(e.type===`imir`&&(e.value===0?r=n[r]:(r=n[r],r=t[r],r=t[r])),e.type===`irot`)for(var i=0;i<e.value;i++)r=t[r]});var i=null;return t.item_inf.Exif&&(i=t.item_loc[t.item_inf.Exif]),{width:n.width,height:n.height,orientation:t.transforms.length?r:null,variants:t.sizes,exif_location:i}}},t.exports.getMimeType=function(e){var t=String.fromCharCode.apply(null,e.slice(0,4)),n={};n[t]=!0;for(var r=8;r<e.length;r+=4)n[String.fromCharCode.apply(null,e.slice(r,r+4))]=!0;if(!(!n.mif1&&!n.msf1&&!n.miaf))return t===`avif`||t===`avis`||t===`avio`?{type:`avif`,mime:`image/avif`}:t===`heic`||t===`heix`?{type:`heic`,mime:`image/heic`}:t===`hevc`||t===`hevx`?{type:`heic`,mime:`image/heic-sequence`}:n.avif||n.avis?{type:`avif`,mime:`image/avif`}:n.heic||n.heix||n.hevc||n.hevx||n.heis?n.msf1?{type:`heif`,mime:`image/heif-sequence`}:{type:`heif`,mime:`image/heif`}:{type:`avif`,mime:`image/avif`}}}),Au=h((e,t)=>{function n(e,t){var n=Error(e);return n.code=t,n}function r(e){try{return decodeURIComponent(escape(e))}catch{return e}}function i(e,t,r){this.input=e.subarray(t,r),this.start=t;var i=String.fromCharCode.apply(null,this.input.subarray(0,4));if(i!==`II*\0`&&i!==`MM\0*`)throw n(`invalid TIFF signature`,`EBADDATA`);this.big_endian=i[0]===`M`}i.prototype.each=function(e){for(this.aborted=!1,this.ifds_to_read=[{id:0,offset:this.read_uint32(4)}];this.ifds_to_read.length>0&&!this.aborted;){var t=this.ifds_to_read.shift();t.offset&&this.scan_ifd(t.id,t.offset,e)}},i.prototype.read_uint16=function(e){var t=this.input;if(e+2>t.length)throw n(`unexpected EOF`,`EBADDATA`);return this.big_endian?t[e]*256+t[e+1]:t[e]+t[e+1]*256},i.prototype.read_uint32=function(e){var t=this.input;if(e+4>t.length)throw n(`unexpected EOF`,`EBADDATA`);return this.big_endian?t[e]*16777216+t[e+1]*65536+t[e+2]*256+t[e+3]:t[e]+t[e+1]*256+t[e+2]*65536+t[e+3]*16777216},i.prototype.is_subifd_link=function(e,t){return e===0&&t===34665||e===0&&t===34853||e===34665&&t===40965},i.prototype.exif_format_length=function(e){switch(e){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}},i.prototype.exif_format_read=function(e,t){var n;switch(e){case 1:case 2:return n=this.input[t],n;case 6:return n=this.input[t],n|(n&128)*33554430;case 3:return n=this.read_uint16(t),n;case 8:return n=this.read_uint16(t),n|(n&32768)*131070;case 4:return n=this.read_uint32(t),n;case 9:return n=this.read_uint32(t),n|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},i.prototype.scan_ifd=function(e,t,i){var a=this.read_uint16(t);t+=2;for(var o=0;o<a;o++){var s=this.read_uint16(t),c=this.read_uint16(t+2),l=this.read_uint32(t+4),u=this.exif_format_length(c),d=l*u,f=d<=4?t+8:this.read_uint32(t+8),p=!1;if(f+d>this.input.length)throw n(`unexpected EOF`,`EBADDATA`);for(var m=[],h=f,g=0;g<l;g++,h+=u){var _=this.exif_format_read(c,h);if(_===null){m=null;break}m.push(_)}if(Array.isArray(m)&&c===2&&(m=r(String.fromCharCode.apply(null,m)),m&&m[m.length-1]===`\0`&&(m=m.slice(0,-1))),this.is_subifd_link(e,s)&&Array.isArray(m)&&Number.isInteger(m[0])&&m[0]>0&&(this.ifds_to_read.push({id:s,offset:m[0]}),p=!0),i({is_big_endian:this.big_endian,ifd:e,tag:s,format:c,count:l,entry_offset:t+this.start,data_length:d,data_offset:f+this.start,value:m,is_subifd_link:p})===!1){this.aborted=!0;return}t+=12}e===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})},t.exports.ExifParser=i,t.exports.get_orientation=function(e){var t=0;try{return new i(e,0,e.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}}}),ju=h((e,t)=>{var n=Ou().str2arr,r=Ou().sliceEq,i=Ou().readUInt32BE,a=ku(),o=Au(),s=n(`ftyp`);t.exports=function(e){if(r(e,4,s)){var t=a.unbox(e,0);if(t){var n=a.getMimeType(t.data);if(n){for(var c,l=t.end;;){var u=a.unbox(e,l);if(!u)break;if(l=u.end,u.boxtype===`mdat`)return;if(u.boxtype===`meta`){c=u.data;break}}if(c){var d=a.readSizeFromMeta(c);if(d){var f={width:d.width,height:d.height,type:n.type,mime:n.mime,wUnits:`px`,hUnits:`px`};if(d.variants.length>1&&(f.variants=d.variants),d.orientation&&(f.orientation=d.orientation),d.exif_location&&d.exif_location.offset+d.exif_location.length<=e.length){var p=i(e,d.exif_location.offset),m=e.slice(d.exif_location.offset+p+4,d.exif_location.offset+d.exif_location.length),h=o.get_orientation(m);h>0&&(f.orientation=h)}return f}}}}}}}),Mu=h((e,t)=>{var n=Ou().str2arr,r=Ou().sliceEq,i=Ou().readUInt16LE,a=n(`BM`);t.exports=function(e){if(!(e.length<26)&&r(e,0,a))return{width:i(e,18),height:i(e,22),type:`bmp`,mime:`image/bmp`,wUnits:`px`,hUnits:`px`}}}),Nu=h((e,t)=>{var n=Ou().str2arr,r=Ou().sliceEq,i=Ou().readUInt16LE,a=n(`GIF87a`),o=n(`GIF89a`);t.exports=function(e){if(!(e.length<10)&&!(!r(e,0,a)&&!r(e,0,o)))return{width:i(e,6),height:i(e,8),type:`gif`,mime:`image/gif`,wUnits:`px`,hUnits:`px`}}}),Pu=h((e,t)=>{var n=Ou().readUInt16LE,r=0,i=1,a=16;t.exports=function(e){var t=n(e,0),o=n(e,2),s=n(e,4);if(!(t!==r||o!==i||!s)){for(var c=[],l={width:0,height:0},u=0;u<s;u++){var d=e[6+a*u]||256,f=e[6+a*u+1]||256,p={width:d,height:f};c.push(p),(d>l.width||f>l.height)&&(l=p)}return{width:l.width,height:l.height,variants:c,type:`ico`,mime:`image/x-icon`,wUnits:`px`,hUnits:`px`}}}}),Fu=h((e,t)=>{var n=Ou().readUInt16BE,r=Ou().str2arr,i=Ou().sliceEq,a=Au(),o=r(`Exif\0\0`);t.exports=function(e){if(!(e.length<2)&&!(e[0]!==255||e[1]!==216||e[2]!==255))for(var t=2;;){for(;;){if(e.length-t<2)return;if(e[t++]===255)break}for(var r=e[t++],s;r===255;)r=e[t++];if(208<=r&&r<=217||r===1)s=0;else if(192<=r&&r<=254){if(e.length-t<2)return;s=n(e,t)-2,t+=2}else return;if(r===217||r===218)return;var c;if(r===225&&s>=10&&i(e,t,o)&&(c=a.get_orientation(e.slice(t+6,t+s))),s>=5&&192<=r&&r<=207&&r!==196&&r!==200&&r!==204){if(e.length-t<s)return;var l={width:n(e,t+3),height:n(e,t+1),type:`jpg`,mime:`image/jpeg`,wUnits:`px`,hUnits:`px`};return c>0&&(l.orientation=c),l}t+=s}}}),Iu=h((e,t)=>{var n=Ou().str2arr,r=Ou().sliceEq,i=Ou().readUInt32BE,a=n(`‰PNG\r

`),o=n(`IHDR`);t.exports=function(e){if(!(e.length<24)&&r(e,0,a)&&r(e,12,o))return{width:i(e,16),height:i(e,20),type:`png`,mime:`image/png`,wUnits:`px`,hUnits:`px`}}}),Lu=h((e,t)=>{var n=Ou().str2arr,r=Ou().sliceEq,i=Ou().readUInt32BE,a=n(`8BPS\0`);t.exports=function(e){if(!(e.length<22)&&r(e,0,a))return{width:i(e,18),height:i(e,14),type:`psd`,mime:`image/vnd.adobe.photoshop`,wUnits:`px`,hUnits:`px`}}}),Ru=h((e,t)=>{function n(e){return e===32||e===9||e===13||e===10}function r(e){return typeof e==`number`&&isFinite(e)&&e>0}function i(e){var t=0,r=e.length;for(e[0]===239&&e[1]===187&&e[2]===191&&(t=3);t<r&&n(e[t]);)t++;return t===r?!1:e[t]===60}var a=/<[-_.:a-zA-Z0-9][^>]*>/,o=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,s=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,c=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,u=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function d(e){var t=e.match(s),n=e.match(c),r=e.match(l);return{width:t&&(t[1]||t[2]),height:n&&(n[1]||n[2]),viewbox:r&&(r[1]||r[2])}}function f(e){return u.test(e)?e.match(u)[0]:`px`}t.exports=function(e){if(i(e)){for(var t=``,n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);var s=(t.match(a)||[``])[0];if(o.test(s)){var c=d(s),l=parseFloat(c.width),u=parseFloat(c.height);if(c.width&&c.height)return!r(l)||!r(u)?void 0:{width:l,height:u,type:`svg`,mime:`image/svg+xml`,wUnits:f(c.width),hUnits:f(c.height)};var p=(c.viewbox||``).split(` `),m={width:p[2],height:p[3]},h=parseFloat(m.width),g=parseFloat(m.height);if(!(!r(h)||!r(g))&&f(m.width)===f(m.height)){var _=h/g;return c.width?r(l)?{width:l,height:l/_,type:`svg`,mime:`image/svg+xml`,wUnits:f(c.width),hUnits:f(c.width)}:void 0:c.height?r(u)?{width:u*_,height:u,type:`svg`,mime:`image/svg+xml`,wUnits:f(c.height),hUnits:f(c.height)}:void 0:{width:h,height:g,type:`svg`,mime:`image/svg+xml`,wUnits:f(m.width),hUnits:f(m.height)}}}}}}),zu=h((e,t)=>{var n=Ou().str2arr,r=Ou().sliceEq,i=Ou().readUInt16LE,a=Ou().readUInt16BE,o=Ou().readUInt32LE,s=Ou().readUInt32BE,c=n(`II*\0`),l=n(`MM\0*`);function u(e,t,n){return n?a(e,t):i(e,t)}function d(e,t,n){return n?s(e,t):o(e,t)}function f(e,t,n){var r=u(e,t+2,n);return d(e,t+4,n)!==1||r!==3&&r!==4?null:r===3?u(e,t+8,n):d(e,t+8,n)}t.exports=function(e){if(!(e.length<8)&&!(!r(e,0,c)&&!r(e,0,l))){var t=e[0]===77,n=d(e,4,t)-8;if(!(n<0)){var i=n+8;if(!(e.length-i<2)){var a=u(e,i+0,t)*12;if(!(a<=0)&&(i+=2,!(e.length-i<a))){var o,s,p,m;for(o=0;o<a;o+=12)m=u(e,i+o,t),m===256?s=f(e,i+o,t):m===257&&(p=f(e,i+o,t));if(s&&p)return{width:s,height:p,type:`tiff`,mime:`image/tiff`,wUnits:`px`,hUnits:`px`}}}}}}}),Bu=h((e,t)=>{var n=Ou().str2arr,r=Ou().sliceEq,i=Ou().readUInt16LE,a=Ou().readUInt32LE,o=Au(),s=n(`RIFF`),c=n(`WEBP`);function l(e,t){if(!(e[t+3]!==157||e[t+4]!==1||e[t+5]!==42))return{width:i(e,t+6)&16383,height:i(e,t+8)&16383,type:`webp`,mime:`image/webp`,wUnits:`px`,hUnits:`px`}}function u(e,t){if(e[t]===47){var n=a(e,t+1);return{width:(n&16383)+1,height:(n>>14&16383)+1,type:`webp`,mime:`image/webp`,wUnits:`px`,hUnits:`px`}}}function d(e,t){return{width:(e[t+6]<<16|e[t+5]<<8|e[t+4])+1,height:(e[t+9]<<t|e[t+8]<<8|e[t+7])+1,type:`webp`,mime:`image/webp`,wUnits:`px`,hUnits:`px`}}t.exports=function(e){if(!(e.length<16)&&!(!r(e,0,s)&&!r(e,8,c))){var t=12,n=null,i=0,f=a(e,4)+8;if(!(f>e.length)){for(;t+8<f;){if(e[t]===0){t++;continue}var p=String.fromCharCode.apply(null,e.slice(t,t+4)),m=a(e,t+4);p===`VP8 `&&m>=10?n||=l(e,t+8):p===`VP8L`&&m>=9?n||=u(e,t+8):p===`VP8X`&&m>=10?n||=d(e,t+8):p===`EXIF`&&(i=o.get_orientation(e.slice(t+8,t+8+m)),t=1/0),t+=8+m}if(n)return i>0&&(n.orientation=i),n}}}}),Vu=h((e,t)=>{t.exports={avif:ju(),bmp:Mu(),gif:Nu(),ico:Pu(),jpeg:Fu(),png:Iu(),psd:Lu(),svg:Ru(),tiff:zu(),webp:Bu()}}),Hu=h((e,t)=>{var n=Vu();function r(e){for(var t=Object.keys(n),r=0;r<t.length;r++){var i=n[t[r]](e);if(i)return i}return null}t.exports=function(e){return r(e)},t.exports.parsers=n}),Uu=h(e=>{var t=Hu(),n=Lr().IMAGE_URL_PREFIX,r=Wc().Buffer;e.getImageSize=function(e){return t(new r(e.replace(n,``),`base64`))}}),Wu=h((e,t)=>{var n=$(),r=Lc(),i=D(),a=sn(),o=$().maxRowLength,s=Uu().getImageSize;t.exports=function(e,t){var n,r;if(t._hasZ)n=t.z.length,r=o(t.z);else if(t._hasSource){var i=s(t.source);n=i.height,r=i.width}var c=a.getFromId(e,t.xaxis||`x`),l=a.getFromId(e,t.yaxis||`y`),d=c.d2c(t.x0)-t.dx/2,f=l.d2c(t.y0)-t.dy/2,p,m=[d,d+r*t.dx],h=[f,f+n*t.dy];if(c&&c.type===`log`)for(p=0;p<r;p++)m.push(d+p*t.dx);if(l&&l.type===`log`)for(p=0;p<n;p++)h.push(f+p*t.dy);return t._extremes[c._id]=a.findExtremes(c,m),t._extremes[l._id]=a.findExtremes(l,h),t._scaler=u(t),[{x0:d,y0:f,z:t.z,w:r,h:n}]};function c(e,t,r,i){return function(a){return n.constrain((a-e)*t,r,i)}}function l(e,t){return function(r){return n.constrain(r,e,t)}}function u(e){var t=r.colormodel[e.colormodel],n=(t.colormodel||e.colormodel).length;e._sArray=[];for(var a=0;a<n;a++)t.min[a]!==e.zmin[a]||t.max[a]!==e.zmax[a]?e._sArray.push(c(e.zmin[a],(t.max[a]-t.min[a])/(e.zmax[a]-e.zmin[a]),t.min[a],t.max[a])):e._sArray.push(l(t.min[a],t.max[a]));return function(t){for(var r=t.slice(0,n),a=0;a<n;a++){var o=r[a];if(!i(o))return!1;r[a]=e._sArray[a](o)}return r}}}),Gu=h((e,t)=>{var n=S(),r=$(),i=r.strTranslate,a=Dt(),o=Lc(),s=Vo(),c=Bo().STYLE;t.exports=function(e,t,l,u){var d=t.xaxis,f=t.yaxis,p=!e._context._exportedPlot&&s();r.makeTraceGroups(u,l,`im`).each(function(t){var s=n.select(this),l=t[0],u=l.trace,m=(u.zsmooth===`fast`||u.zsmooth===!1&&p)&&!u._hasZ&&u._hasSource&&d.type===`linear`&&f.type===`linear`;u._realImage=m;var h=l.z,g=l.x0,_=l.y0,v=l.w,y=l.h,b=u.dx,x=u.dy,S,C,w,T,E,D;for(D=0;S===void 0&&D<v;)S=d.c2p(g+D*b),D++;for(D=v;C===void 0&&D>0;)C=d.c2p(g+D*b),D--;for(D=0;T===void 0&&D<y;)T=f.c2p(_+D*x),D++;for(D=y;E===void 0&&D>0;)E=f.c2p(_+D*x),D--;if(C<S&&(w=C,C=S,S=w),E<T&&(w=T,T=E,E=w),!m){var O=.5;S=Math.max(-O*d._length,S),C=Math.min((1+O)*d._length,C),T=Math.max(-O*f._length,T),E=Math.min((1+O)*f._length,E)}var k=Math.round(C-S),A=Math.round(E-T);if(k<=0||A<=0){s.selectAll(`image`).data([]).exit().remove();return}function j(e){var t=document.createElement(`canvas`);t.width=k,t.height=A;var n=t.getContext(`2d`,{willReadFrequently:!0}),i=function(e){return r.constrain(Math.round(d.c2p(g+e*b)-S),0,k)},a=function(e){return r.constrain(Math.round(f.c2p(_+e*x)-T),0,A)},s=o.colormodel[u.colormodel],c=s.colormodel||u.colormodel,p=s.fmt,m;for(D=0;D<l.w;D++){var h=i(D),v=i(D+1);if(!(v===h||isNaN(v)||isNaN(h)))for(var y=0;y<l.h;y++){var C=a(y),w=a(y+1);w===C||isNaN(w)||isNaN(C)||!e(D,y)||(m=u._scaler(e(D,y)),m?n.fillStyle=c+`(`+p(m).join(`,`)+`)`:n.fillStyle=`rgba(0,0,0,0)`,n.fillRect(h,C,v-h,w-C))}}return t}var M=s.selectAll(`image`).data([t]);M.enter().append(`svg:image`).attr({xmlns:a.svg,preserveAspectRatio:`none`}),M.exit().remove();var N=u.zsmooth===!1?c:``;if(m){var P=r.simpleMap(d.range,d.r2l),F=r.simpleMap(f.range,f.r2l),I=P[1]<P[0],L=F[1]>F[0];if(I||L){var R=S+k/2,z=T+A/2;N+=`transform:`+i(R+`px`,z+`px`)+`scale(`+(I?-1:1)+`,`+(L?-1:1)+`)`+i(-R+`px`,-z+`px`)+`;`}}M.attr(`style`,N);var B=new Promise(function(e){if(u._hasZ)e();else if(u._hasSource)if(u._canvas&&u._canvas.el.width===v&&u._canvas.el.height===y&&u._canvas.source===u.source)e();else{var t=document.createElement(`canvas`);t.width=v,t.height=y;var n=t.getContext(`2d`,{willReadFrequently:!0});u._image=u._image||new Image;var r=u._image;r.onload=function(){n.drawImage(r,0,0),u._canvas={el:t,source:u.source},e()},r.setAttribute(`src`,u.source)}}).then(function(){var e,t;if(u._hasZ)t=j(function(e,t){var n=h[t][e];return r.isTypedArray(n)&&(n=Array.from(n)),n}),e=t.toDataURL(`image/png`);else if(u._hasSource)if(m)e=u.source;else{var n=u._canvas.el.getContext(`2d`,{willReadFrequently:!0}).getImageData(0,0,v,y).data;t=j(function(e,t){var r=4*(t*v+e);return[n[r],n[r+1],n[r+2],n[r+3]]}),e=t.toDataURL(`image/png`)}M.attr({"xlink:href":e,height:A,width:k,x:S,y:T})});e._promises.push(B)})}}),Ku=h((e,t)=>{var n=S();t.exports=function(e){n.select(e).selectAll(`.im image`).style(`opacity`,function(e){return e[0].trace.opacity})}}),qu=h((e,t)=>{var n=Ln(),r=$(),i=r.isArrayOrTypedArray,a=Lc();t.exports=function(e,t,o){var s=e.cd[0],c=s.trace,l=e.xa,u=e.ya;if(!(n.inbox(t-s.x0,t-(s.x0+s.w*c.dx),0)>0||n.inbox(o-s.y0,o-(s.y0+s.h*c.dy),0)>0)){var d=Math.floor((t-s.x0)/c.dx),f=Math.floor(Math.abs(o-s.y0)/c.dy),p;if(c._hasZ?p=s.z[f][d]:c._hasSource&&(p=c._canvas.el.getContext(`2d`,{willReadFrequently:!0}).getImageData(d,f,1,1).data),p){var m=s.hi||c.hoverinfo,h;if(m){var g=m.split(`+`);g.indexOf(`all`)!==-1&&(g=[`color`]),g.indexOf(`color`)!==-1&&(h=!0)}var _=a.colormodel[c.colormodel],v=_.colormodel||c.colormodel,y=v.length,b=c._scaler(p),x=_.suffix,S=[];(c.hovertemplate||h)&&(S.push(`[`+[b[0]+x[0],b[1]+x[1],b[2]+x[2]].join(`, `)),y===4&&S.push(`, `+b[3]+x[3]),S.push(`]`),S=S.join(``),e.extraText=v.toUpperCase()+`: `+S);var C;i(c.hovertext)&&i(c.hovertext[f])?C=c.hovertext[f][d]:i(c.text)&&i(c.text[f])&&(C=c.text[f][d]);var w=u.c2p(s.y0+(f+.5)*c.dy),T=s.x0+(d+.5)*c.dx,E=s.y0+(f+.5)*c.dy,D=`[`+p.slice(0,c.colormodel.length).join(`, `)+`]`;return[r.extendFlat(e,{index:[f,d],x0:l.c2p(s.x0+d*c.dx),x1:l.c2p(s.x0+(d+1)*c.dx),y0:w,y1:w,color:b,xVal:T,xLabelVal:T,yVal:E,yLabelVal:E,zLabelVal:D,text:C,hovertemplateLabels:{zLabel:D,colorLabel:S,"color[0]Label":b[0]+x[0],"color[1]Label":b[1]+x[1],"color[2]Label":b[2]+x[2],"color[3]Label":b[3]+x[3]}})]}}}}),Ju=h((e,t)=>{t.exports=function(e,t){return`xVal`in t&&(e.x=t.xVal),`yVal`in t&&(e.y=t.yVal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e.color=t.color,e.colormodel=t.trace.colormodel,e.z||=t.color,e}}),Yu=h((e,t)=>{t.exports={attributes:Rc(),supplyDefaults:zc(),calc:Wu(),plot:Gu(),style:Ku(),hoverPoints:qu(),eventData:Ju(),moduleType:`trace`,name:`image`,basePlotModule:Ai(),categories:[`cartesian`,`svg`,`2dMap`,`noSortingByValue`],animatable:!1,meta:{}}}),Xu=h((e,t)=>{t.exports=Yu()}),Zu=h((e,t)=>{var n=W(),r=Da().attributes,i=B(),a=K(),{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:c}=ze(),l=z().extendFlat,u=Le().pattern,d=i({editType:`plot`,arrayOk:!0,colorEditType:`plot`});t.exports={labels:{valType:`data_array`,editType:`calc`},label0:{valType:`number`,dflt:0,editType:`calc`},dlabel:{valType:`number`,dflt:1,editType:`calc`},values:{valType:`data_array`,editType:`calc`},marker:{colors:{valType:`data_array`,editType:`calc`},line:{color:{valType:`color`,dflt:a.defaultLine,arrayOk:!0,editType:`style`},width:{valType:`number`,min:0,dflt:0,arrayOk:!0,editType:`style`},editType:`calc`},pattern:u,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:l({},n.hoverinfo,{flags:[`label`,`text`,`value`,`percent`,`name`]}),hovertemplate:o({},{keys:[`label`,`color`,`value`,`percent`,`text`]}),hovertemplatefallback:c(),texttemplate:s({editType:`plot`},{keys:[`label`,`color`,`value`,`percent`,`text`]}),texttemplatefallback:c({editType:`plot`}),textposition:{valType:`enumerated`,values:[`inside`,`outside`,`auto`,`none`],dflt:`auto`,arrayOk:!0,editType:`plot`},textfont:l({},d,{}),insidetextorientation:{valType:`enumerated`,values:[`horizontal`,`radial`,`tangential`,`auto`],dflt:`auto`,editType:`plot`},insidetextfont:l({},d,{}),outsidetextfont:l({},d,{}),automargin:{valType:`boolean`,dflt:!1,editType:`plot`},showlegend:l({},n.showlegend,{arrayOk:!0}),legend:l({},n.legend,{arrayOk:!0}),title:{text:{valType:`string`,dflt:``,editType:`plot`},font:l({},d,{}),position:{valType:`enumerated`,values:[`top left`,`top center`,`top right`,`middle center`,`bottom left`,`bottom center`,`bottom right`],editType:`plot`},editType:`plot`},domain:r({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`}}}),Qu=h((e,t)=>{var n=D(),r=$(),i=Zu(),a=Da().defaults,o=Xa().handleText,s=$().coercePattern;function c(e,t){var i=r.isArrayOrTypedArray(e),a=r.isArrayOrTypedArray(t),o=Math.min(i?e.length:1/0,a?t.length:1/0);if(isFinite(o)||(o=0),o&&a){for(var s,c=0;c<o;c++){var l=t[c];if(n(l)&&l>0){s=!0;break}}s||(o=0)}return{hasLabels:i,hasValues:a,len:o}}function l(e,t,n,r,i){r(`marker.line.width`)&&r(`marker.line.color`,i?void 0:n.paper_bgcolor),s(r,`marker.pattern`,r(`marker.colors`)),e.marker&&!t.marker.pattern.fgcolor&&(t.marker.pattern.fgcolor=e.marker.colors),t.marker.pattern.bgcolor||(t.marker.pattern.bgcolor=n.paper_bgcolor)}function u(e,t,n,s){function u(n,a){return r.coerce(e,t,i,n,a)}var d=c(u(`labels`),u(`values`)),f=d.len;if(t._hasLabels=d.hasLabels,t._hasValues=d.hasValues,!t._hasLabels&&t._hasValues&&(u(`label0`),u(`dlabel`)),!f){t.visible=!1;return}t._length=f,l(e,t,s,u,!0),u(`scalegroup`);var p=u(`text`),m=u(`texttemplate`);u(`texttemplatefallback`);var h;if(m||(h=u(`textinfo`,r.isArrayOrTypedArray(p)?`text+percent`:`percent`)),u(`hovertext`),u(`hovertemplate`),u(`hovertemplatefallback`),m||h&&h!==`none`){var g=u(`textposition`);o(e,t,s,u,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||g===`auto`||g===`outside`)&&u(`automargin`),(g===`inside`||g===`auto`||Array.isArray(g))&&u(`insidetextorientation`)}else h===`none`&&u(`textposition`,`none`);a(t,s,u);var _=u(`hole`);if(u(`title.text`)){var v=u(`title.position`,_?`middle center`:`top center`);!_&&v===`middle center`&&(t.title.position=`top center`),r.coerceFont(u,`title.font`,s.font)}u(`sort`),u(`direction`),u(`rotation`),u(`pull`)}t.exports={handleLabelsAndValues:c,handleMarkerDefaults:l,supplyDefaults:u}}),$u=h((e,t)=>{t.exports={hiddenlabels:{valType:`data_array`,editType:`calc`},piecolorway:{valType:`colorlist`,editType:`calc`},extendpiecolors:{valType:`boolean`,dflt:!0,editType:`calc`}}}),ed=h((e,t)=>{var n=$(),r=$u();t.exports=function(e,t){function i(i,a){return n.coerce(e,t,r,i,a)}i(`hiddenlabels`),i(`piecolorway`,t.colorway),i(`extendpiecolors`)}}),td=h((e,t)=>{var n=D(),r=R(),i=q(),a={};function o(e,t){var r=[],i=e._fullLayout,a=i.hiddenlabels||[],o=t.labels,c=t.marker.colors||[],l=t.values,u=t._length,d=t._hasValues&&u,f,p;if(t.dlabel)for(o=Array(u),f=0;f<u;f++)o[f]=String(t.label0+f*t.dlabel);var m={},h=s(i[`_`+t.type+`colormap`]),g=0,_=!1;for(f=0;f<u;f++){var v,y,b;if(d){if(v=l[f],!n(v))continue;v=+v}else v=1;y=o[f],(y===void 0||y===``)&&(y=f),y=String(y);var x=m[y];x===void 0?(m[y]=r.length,b=a.indexOf(y)!==-1,b||(g+=v),r.push({v,label:y,color:h(c[f],y),i:f,pts:[f],hidden:b})):(_=!0,p=r[x],p.v+=v,p.pts.push(f),p.hidden||(g+=v),p.color===!1&&c[f]&&(p.color=h(c[f],y)))}return r=r.filter(function(e){return e.v>=0}),(t.type===`funnelarea`?_:t.sort)&&r.sort(function(e,t){return t.v-e.v}),r[0]&&(r[0].vTotal=g),r}function s(e){return function(t,n){return!t||(t=r(t),!t.isValid())?!1:(t=i.addOpacity(t,t.getAlpha()),e[n]||(e[n]=t),t)}}function c(e,t){var n=(t||{}).type;n||=`pie`;var r=e._fullLayout,i=e.calcdata,o=r[n+`colorway`],s=r[`_`+n+`colormap`];r[`extend`+n+`colors`]&&(o=l(o,a));for(var c=0,u=0;u<i.length;u++){var d=i[u];if(d[0].trace.type===n)for(var f=0;f<d.length;f++){var p=d[f];p.color===!1&&(s[p.label]?p.color=s[p.label]:(s[p.label]=p.color=o[c%o.length],c++))}}}function l(e,t){var n,i=JSON.stringify(e),a=t[i];if(!a){for(a=e.slice(),n=0;n<e.length;n++)a.push(r(e[n]).lighten(20).toHexString());for(n=0;n<e.length;n++)a.push(r(e[n]).darken(20).toHexString());t[i]=a}return a}t.exports={calc:o,crossTraceCalc:c,makePullColorFn:s,generateExtendedColors:l}}),nd=h((e,t)=>{var n=Qt().appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return e.pts.length===1&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),t.type===`funnelarea`&&(delete r.v,delete r.i),r}}),rd=h((e,t)=>{var n=S(),r=Et(),i=Ln(),a=q(),o=tn(),s=$(),c=s.strScale,l=s.strTranslate,u=kt(),d=eo(),f=d.recordMinTextSize,p=d.clearMinTextSize,m=ui().TEXTPAD,h=wn(),g=nd(),_=$().isValidTextValue;function v(e,t){var i=e._context.staticPlot,a=e._fullLayout,d=a._size;p(`pie`,a),w(t,e),B(t,d);var m=s.makeTraceGroups(a._pielayer,t,`trace`).each(function(t){var p=n.select(this),m=t[0],g=m.trace;H(t),p.attr(`stroke-linejoin`,`round`),p.each(function(){var _=n.select(this).selectAll(`g.slice`).data(t);_.enter().append(`g`).classed(`slice`,!0),_.exit().remove();var v=[[[],[]],[[],[]]],S=!1;_.each(function(r,c){if(r.hidden){n.select(this).selectAll(`path,g`).remove();return}r.pointNumber=r.i,r.curveNumber=g.index,v[r.pxmid[1]<0?0:1][r.pxmid[0]<0?0:1].push(r);var l=m.cx,d=m.cy,p=n.select(this),_=p.selectAll(`path.surface`).data([r]);if(_.enter().append(`path`).classed(`surface`,!0).style({"pointer-events":i?`none`:`all`}),p.call(b,e,t),g.pull){var y=+h.castOption(g.pull,r.pts)||0;y>0&&(l+=y*r.pxmid[0],d+=y*r.pxmid[1])}r.cxFinal=l,r.cyFinal=d;function w(e,t,n,i){var a=i*(t[0]-e[0]),o=i*(t[1]-e[1]);return`a`+i*m.r+`,`+i*m.r+` 0 `+r.largeArc+(n?` 1 `:` 0 `)+a+`,`+o}var E=g.hole;if(r.v===m.vTotal){var D=`M`+(l+r.px0[0])+`,`+(d+r.px0[1])+w(r.px0,r.pxmid,!0,1)+w(r.pxmid,r.px0,!0,1)+`Z`;E?_.attr(`d`,`M`+(l+E*r.px0[0])+`,`+(d+E*r.px0[1])+w(r.px0,r.pxmid,!1,E)+w(r.pxmid,r.px0,!1,E)+`Z`+D):_.attr(`d`,D)}else{var O=w(r.px0,r.px1,!0,1);if(E){var k=1-E;_.attr(`d`,`M`+(l+E*r.px1[0])+`,`+(d+E*r.px1[1])+w(r.px1,r.px0,!1,E)+`l`+k*r.px0[0]+`,`+k*r.px0[1]+O+`Z`)}else _.attr(`d`,`M`+l+`,`+d+`l`+r.px0[0]+`,`+r.px0[1]+O+`Z`)}W(e,r,m);var A=h.castOption(g.textposition,r.pts),j=p.selectAll(`g.slicetext`).data(r.text&&A!==`none`?[0]:[]);j.enter().append(`g`).classed(`slicetext`,!0),j.exit().remove(),j.each(function(){var i=s.ensureSingle(n.select(this),`text`,``,function(e){e.attr(`data-notex`,1)}),p=s.ensureUniformFontSize(e,A===`outside`?x(g,r,a.font):C(g,r,a.font));i.text(r.text).attr({class:`slicetext`,transform:``,"text-anchor":`middle`}).call(o.font,p).call(u.convertToTspans,e);var h=o.bBox(i.node()),_;if(A===`outside`)_=N(h,r);else if(_=T(h,r,m),A===`auto`&&_.scale<1){var v=s.ensureUniformFontSize(e,g.outsidetextfont);i.call(o.font,v),h=o.bBox(i.node()),_=N(h,r)}var y=_.textPosAngle,b=y===void 0?r.pxmid:U(m.r,y);if(_.targetX=l+b[0]*_.rCenter+(_.x||0),_.targetY=d+b[1]*_.rCenter+(_.y||0),G(_,h),_.outside){var w=_.targetY;r.yLabelMin=w-h.height/2,r.yLabelMid=w,r.yLabelMax=w+h.height/2,r.labelExtraX=0,r.labelExtraY=0,S=!0}_.fontSize=p.size,f(g.type,_,a),t[c].transform=_,s.setTransormAndDisplay(i,_)})});var w=n.select(this).selectAll(`g.titletext`).data(g.title.text?[0]:[]);if(w.enter().append(`g`).classed(`titletext`,!0),w.exit().remove(),w.each(function(){var t=s.ensureSingle(n.select(this),`text`,``,function(e){e.attr(`data-notex`,1)}),r=g.title.text;g._meta&&(r=s.templateString(r,g._meta)),t.text(r).attr({class:`titletext`,transform:``,"text-anchor":`middle`}).call(o.font,g.title.font).call(u.convertToTspans,e);var i=g.title.position===`middle center`?P(m):F(m,d);t.attr(`transform`,l(i.x,i.y)+c(Math.min(1,i.scale))+l(i.tx,i.ty))}),S&&z(v,g),y(_,g),S&&g.automargin){var E=o.bBox(p.node()),D=g.domain,O=d.w*(D.x[1]-D.x[0]),k=d.h*(D.y[1]-D.y[0]),A=(.5*O-m.r)/d.w,j=(.5*k-m.r)/d.h;r.autoMargin(e,`pie.`+g.uid+`.automargin`,{xl:D.x[0]-A,xr:D.x[1]+A,yb:D.y[0]-j,yt:D.y[1]+j,l:Math.max(m.cx-m.r-E.left,0),r:Math.max(E.right-(m.cx+m.r),0),b:Math.max(E.bottom-(m.cy+m.r),0),t:Math.max(m.cy-m.r-E.top,0),pad:5})}})});setTimeout(function(){m.selectAll(`tspan`).each(function(){var e=n.select(this);e.attr(`dy`)&&e.attr(`dy`,e.attr(`dy`))})},0)}function y(e,t){e.each(function(e){var r=n.select(this);if(!e.labelExtraX&&!e.labelExtraY){r.select(`path.textline`).remove();return}var i=r.select(`g.slicetext text`);e.transform.targetX+=e.labelExtraX,e.transform.targetY+=e.labelExtraY,s.setTransormAndDisplay(i,e.transform);var o=e.cxFinal+e.pxmid[0],c=e.cyFinal+e.pxmid[1],l=`M`+o+`,`+c,u=(e.yLabelMax-e.yLabelMin)*(e.pxmid[0]<0?-1:1)/4;if(e.labelExtraX){var d=e.labelExtraX*e.pxmid[1]/e.pxmid[0],f=e.yLabelMid+e.labelExtraY-(e.cyFinal+e.pxmid[1]);Math.abs(d)>Math.abs(f)?l+=`l`+f*e.pxmid[0]/e.pxmid[1]+`,`+f+`H`+(o+e.labelExtraX+u):l+=`l`+e.labelExtraX+`,`+d+`v`+(f-d)+`h`+u}else l+=`V`+(e.yLabelMid+e.labelExtraY)+`h`+u;s.ensureSingle(r,`path`,`textline`).call(a.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:`none`})})}function b(e,t,r){var a=r[0],o=a.cx,c=a.cy,l=a.trace,u=l.type===`funnelarea`;`_hasHoverLabel`in l||(l._hasHoverLabel=!1),`_hasHoverEvent`in l||(l._hasHoverEvent=!1),e.on(`mouseover`,function(e){var r=t._fullLayout,d=t._fullData[l.index];if(!(t._dragging||r.hovermode===!1)){var f=d.hoverinfo;if(Array.isArray(f)&&(f=i.castHoverinfo({hoverinfo:[h.castOption(f,e.pts)],_module:l._module},r,0)),f===`all`&&(f=`label+text+value+percent+name`),d.hovertemplate||f!==`none`&&f!==`skip`&&f){var p=e.rInscribed||0,m=o+e.pxmid[0]*(1-p),_=c+e.pxmid[1]*(1-p),v=r.separators,y=[];if(f&&f.indexOf(`label`)!==-1&&y.push(e.label),e.text=h.castOption(d.hovertext||d.text,e.pts),f&&f.indexOf(`text`)!==-1){var b=e.text;s.isValidTextValue(b)&&y.push(b)}e.value=e.v,e.valueLabel=h.formatPieValue(e.v,v),f&&f.indexOf(`value`)!==-1&&y.push(e.valueLabel),e.percent=e.v/a.vTotal,e.percentLabel=h.formatPiePercent(e.percent,v),f&&f.indexOf(`percent`)!==-1&&y.push(e.percentLabel);var x=d.hoverlabel,S=x.font,C=[];i.loneHover({trace:l,x0:m-p*a.r,x1:m+p*a.r,y:_,_x0:u?o+e.TL[0]:m-p*a.r,_x1:u?o+e.TR[0]:m+p*a.r,_y0:u?c+e.TL[1]:_-p*a.r,_y1:u?c+e.BL[1]:_+p*a.r,text:y.join(`<br>`),name:d.hovertemplate||f.indexOf(`name`)!==-1?d.name:void 0,idealAlign:e.pxmid[0]<0?`left`:`right`,color:h.castOption(x.bgcolor,e.pts)||e.color,borderColor:h.castOption(x.bordercolor,e.pts),fontFamily:h.castOption(S.family,e.pts),fontSize:h.castOption(S.size,e.pts),fontColor:h.castOption(S.color,e.pts),nameLength:h.castOption(x.namelength,e.pts),textAlign:h.castOption(x.align,e.pts),hovertemplate:h.castOption(d.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,d)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:C}),e.bbox=C[0],l._hasHoverLabel=!0}l._hasHoverEvent=!0,t.emit(`plotly_hover`,{points:[g(e,d)],event:n.event})}}),e.on(`mouseout`,function(e){var r=t._fullLayout,a=t._fullData[l.index],o=n.select(this).datum();l._hasHoverEvent&&=(e.originalEvent=n.event,t.emit(`plotly_unhover`,{points:[g(o,a)],event:n.event}),!1),l._hasHoverLabel&&=(i.loneUnhover(r._hoverlayer.node()),!1)}),e.on(`click`,function(e){var r=t._fullLayout,a=t._fullData[l.index];t._dragging||r.hovermode===!1||(t._hoverdata=[g(e,a)],i.click(t,n.event))})}function x(e,t,n){return{color:h.castOption(e.outsidetextfont.color,t.pts)||h.castOption(e.textfont.color,t.pts)||n.color,family:h.castOption(e.outsidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||n.family,size:h.castOption(e.outsidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||n.size,weight:h.castOption(e.outsidetextfont.weight,t.pts)||h.castOption(e.textfont.weight,t.pts)||n.weight,style:h.castOption(e.outsidetextfont.style,t.pts)||h.castOption(e.textfont.style,t.pts)||n.style,variant:h.castOption(e.outsidetextfont.variant,t.pts)||h.castOption(e.textfont.variant,t.pts)||n.variant,textcase:h.castOption(e.outsidetextfont.textcase,t.pts)||h.castOption(e.textfont.textcase,t.pts)||n.textcase,lineposition:h.castOption(e.outsidetextfont.lineposition,t.pts)||h.castOption(e.textfont.lineposition,t.pts)||n.lineposition,shadow:h.castOption(e.outsidetextfont.shadow,t.pts)||h.castOption(e.textfont.shadow,t.pts)||n.shadow}}function C(e,t,n){var r=h.castOption(e.insidetextfont.color,t.pts);!r&&e._input.textfont&&(r=h.castOption(e._input.textfont.color,t.pts));var i=h.castOption(e.insidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||n.family,o=h.castOption(e.insidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||n.size,s=h.castOption(e.insidetextfont.weight,t.pts)||h.castOption(e.textfont.weight,t.pts)||n.weight,c=h.castOption(e.insidetextfont.style,t.pts)||h.castOption(e.textfont.style,t.pts)||n.style,l=h.castOption(e.insidetextfont.variant,t.pts)||h.castOption(e.textfont.variant,t.pts)||n.variant,u=h.castOption(e.insidetextfont.textcase,t.pts)||h.castOption(e.textfont.textcase,t.pts)||n.textcase,d=h.castOption(e.insidetextfont.lineposition,t.pts)||h.castOption(e.textfont.lineposition,t.pts)||n.lineposition,f=h.castOption(e.insidetextfont.shadow,t.pts)||h.castOption(e.textfont.shadow,t.pts)||n.shadow;return{color:r||a.contrast(t.color),family:i,size:o,weight:s,style:c,variant:l,textcase:u,lineposition:d,shadow:f}}function w(e,t){for(var n,r,i=0;i<e.length;i++)if(n=e[i][0],r=n.trace,r.title.text){var a=r.title.text;r._meta&&(a=s.templateString(a,r._meta));var c=o.tester.append(`text`).attr(`data-notex`,1).text(a).call(o.font,r.title.font).call(u.convertToTspans,t),l=o.bBox(c.node(),!0);n.titleBox={width:l.width,height:l.height},c.remove()}}function T(e,t,n){var r=n.r||t.rpx1,i=t.rInscribed;if(t.startangle===t.stopangle)return{rCenter:1-i,scale:0,rotate:0,textPosAngle:0};var a=t.ring,o=a===1&&Math.abs(t.startangle-t.stopangle)===Math.PI*2,s=t.halfangle,c=t.midangle,l=n.trace.insidetextorientation,u=l===`horizontal`,d=l===`tangential`,f=l===`radial`,p=l===`auto`,m=[],h;if(!p){var g=function(n,i){if(E(t,n)){var o=Math.abs(n-t.startangle),s=Math.abs(n-t.stopangle),c=o<s?o:s;h=i===`tan`?O(e,r,a,c,0):D(e,r,a,c,Math.PI/2),h.textPosAngle=n,m.push(h)}},_;if(u||d){for(_=4;_>=-4;_-=2)g(Math.PI*_,`tan`);for(_=4;_>=-4;_-=2)g(Math.PI*(_+1),`tan`)}if(u||f){for(_=4;_>=-4;_-=2)g(Math.PI*(_+1.5),`rad`);for(_=4;_>=-4;_-=2)g(Math.PI*(_+.5),`rad`)}}if(o||p||u){var v=Math.sqrt(e.width*e.width+e.height*e.height);if(h={scale:i*r*2/v,rCenter:1-i,rotate:0},h.textPosAngle=(t.startangle+t.stopangle)/2,h.scale>=1)return h;m.push(h)}(p||f)&&(h=D(e,r,a,s,c),h.textPosAngle=(t.startangle+t.stopangle)/2,m.push(h)),(p||d)&&(h=O(e,r,a,s,c),h.textPosAngle=(t.startangle+t.stopangle)/2,m.push(h));for(var y=0,b=0,x=0;x<m.length;x++){var S=m[x].scale;if(b<S&&(b=S,y=x),!p&&b>=1)break}return m[y]}function E(e,t){var n=e.startangle,r=e.stopangle;return n>t&&t>r||n<t&&t<r}function D(e,t,n,r,i){t=Math.max(0,t-2*m);var a=e.width/e.height,o=j(a,r,t,n);return{scale:o*2/e.height,rCenter:k(a,o/t),rotate:A(i)}}function O(e,t,n,r,i){t=Math.max(0,t-2*m);var a=e.height/e.width,o=j(a,r,t,n);return{scale:o*2/e.width,rCenter:k(a,o/t),rotate:A(i+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function j(e,t,n,r){var i=e+1/(2*Math.tan(t));return n*Math.min(1/(Math.sqrt(i*i+.5)+i),r/(Math.sqrt(e*e+r/2)+e))}function M(e,t){return e.v===t.vTotal&&!t.trace.hole?1:Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2)}function N(e,t){var n=t.pxmid[0],r=t.pxmid[1],i=e.width/2,a=e.height/2;return n<0&&(i*=-1),r<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+n*n/(r*r)),outside:!0}}function P(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}function F(e,t){var n=1,r=1,i,a=e.trace,o={x:e.cx,y:e.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=R(a),a.title.position.indexOf(`top`)===-1?a.title.position.indexOf(`bottom`)!==-1&&(o.y+=(1+i)*e.r):(o.y-=(1+i)*e.r,s.ty-=e.titleBox.height);var c=I(e.r,e.trace.aspectratio),l=t.w*(a.domain.x[1]-a.domain.x[0])/2;return a.title.position.indexOf(`left`)===-1?a.title.position.indexOf(`center`)===-1?a.title.position.indexOf(`right`)!==-1&&(l+=c,o.x+=(1+i)*c,s.tx-=e.titleBox.width/2):l*=2:(l+=c,o.x-=(1+i)*c,s.tx+=e.titleBox.width/2),n=l/e.titleBox.width,r=L(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(n,r),tx:s.tx,ty:s.ty}}function I(e,t){return e/(t===void 0?1:t)}function L(e,t){var n=e.trace,r=t.h*(n.domain.y[1]-n.domain.y[0]);return Math.min(e.titleBox.height,r/2)}function R(e){var t=e.pull;if(!t)return 0;var n;if(s.isArrayOrTypedArray(t))for(t=0,n=0;n<e.pull.length;n++)e.pull[n]>t&&(t=e.pull[n]);return t}function z(e,t){var n,r,i,a,o,c,l,u,d,f,p,m,g;function _(e,t){return e.pxmid[1]-t.pxmid[1]}function v(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,n){n||={};var i=n.labelExtraY+(r?n.yLabelMax:n.yLabelMin),u=r?e.yLabelMin:e.yLabelMax,d=r?e.yLabelMax:e.yLabelMin,p=e.cyFinal+o(e.px0[1],e.px1[1]),m=i-u,g,_,v,y,b,x;if(m*l>0&&(e.labelExtraY=m),s.isArrayOrTypedArray(t.pull))for(_=0;_<f.length;_++)v=f[_],!(v===e||(h.castOption(t.pull,e.pts)||0)>=(h.castOption(t.pull,v.pts)||0))&&((e.pxmid[1]-v.pxmid[1])*l>0?(y=v.cyFinal+o(v.px0[1],v.px1[1]),m=y-u-e.labelExtraY,m*l>0&&(e.labelExtraY+=m)):(d+e.labelExtraY-p)*l>0&&(g=3*c*Math.abs(_-f.indexOf(e)),b=v.cxFinal+a(v.px0[0],v.px1[0]),x=b+g-(e.cxFinal+e.pxmid[0])-e.labelExtraX,x*c>0&&(e.labelExtraX+=x)))}for(r=0;r<2;r++)for(i=r?_:v,o=r?Math.max:Math.min,l=r?1:-1,n=0;n<2;n++){for(a=n?Math.max:Math.min,c=n?1:-1,u=e[r][n],u.sort(i),d=e[1-r][n],f=d.concat(u),m=[],p=0;p<u.length;p++)u[p].yLabelMid!==void 0&&m.push(u[p]);for(g=!1,p=0;r&&p<d.length;p++)if(d[p].yLabelMid!==void 0){g=d[p];break}for(p=0;p<m.length;p++){var b=p&&m[p-1];g&&!p&&(b=g),y(m[p],b)}}}function B(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r][0],a=i.trace,o=a.domain,s=t.w*(o.x[1]-o.x[0]),c=t.h*(o.y[1]-o.y[0]);a.title.text&&a.title.position!==`middle center`&&(c-=L(i,t));var l=s/2,u=c/2;a.type===`funnelarea`&&!a.scalegroup&&(u/=a.aspectratio),i.r=Math.min(l,u)/(1+R(a)),i.cx=t.l+t.w*(a.domain.x[1]+a.domain.x[0])/2,i.cy=t.t+t.h*(1-a.domain.y[0])-c/2,a.title.text&&a.title.position.indexOf(`bottom`)!==-1&&(i.cy-=L(i,t)),a.scalegroup&&n.indexOf(a.scalegroup)===-1&&n.push(a.scalegroup)}V(e,n)}function V(e,t){for(var n,r,i,a=0;a<t.length;a++){var o=1/0,s=t[a];for(r=0;r<e.length;r++)if(n=e[r][0],i=n.trace,i.scalegroup===s){var c;if(i.type===`pie`)c=n.r*n.r;else if(i.type===`funnelarea`){var l,u;i.aspectratio>1?(l=n.r,u=l/i.aspectratio):(u=n.r,l=u*i.aspectratio),l*=(1+i.baseratio)/2,c=l*u}o=Math.min(o,c/n.vTotal)}for(r=0;r<e.length;r++)if(n=e[r][0],i=n.trace,i.scalegroup===s){var d=o*n.vTotal;i.type===`funnelarea`&&(d/=(1+i.baseratio)/2,d/=i.aspectratio),n.r=Math.sqrt(d)}}}function H(e){var t=e[0],n=t.r,r=t.trace,i=h.getRotationAngle(r.rotation),a=2*Math.PI/t.vTotal,o=`px0`,s=`px1`,c,l,u;if(r.direction===`counterclockwise`){for(c=0;c<e.length&&e[c].hidden;c++);if(c===e.length)return;i+=a*e[c].v,a*=-1,o=`px1`,s=`px0`}for(u=U(n,i),c=0;c<e.length;c++)l=e[c],!l.hidden&&(l[o]=u,l.startangle=i,i+=a*l.v/2,l.pxmid=U(n,i),l.midangle=i,i+=a*l.v/2,u=U(n,i),l.stopangle=i,l[s]=u,l.largeArc=l.v>t.vTotal/2?1:0,l.halfangle=Math.PI*Math.min(l.v/t.vTotal,.5),l.ring=1-r.hole,l.rInscribed=M(l,t))}function U(e,t){return[e*Math.sin(t),-e*Math.cos(t)]}function W(e,t,n){var r=e._fullLayout,i=n.trace,a=i.texttemplate,o=i.textinfo;if(!a&&o&&o!==`none`){var c=o.split(`+`),l=function(e){return c.indexOf(e)!==-1},u=l(`label`),d=l(`text`),f=l(`value`),p=l(`percent`),m=r.separators,g;if(g=u?[t.label]:[],d){var v=h.getFirstFilled(i.text,t.pts);_(v)&&g.push(v)}f&&g.push(h.formatPieValue(t.v,m)),p&&g.push(h.formatPiePercent(t.v/n.vTotal,m)),t.text=g.join(`<br>`)}function y(e){return{label:e.label,value:e.v,valueLabel:h.formatPieValue(e.v,r.separators),percent:e.v/n.vTotal,percentLabel:h.formatPiePercent(e.v/n.vTotal,r.separators),color:e.color,text:e.text,customdata:s.castOption(i,e.i,`customdata`)}}if(a){var b=s.castOption(i,t.i,`texttemplate`);if(!b)t.text=``;else{var x=y(t),S=h.getFirstFilled(i.text,t.pts);(_(S)||S===``)&&(x.text=S),t.text=s.texttemplateString({data:[x,i._meta],fallback:i.texttemplatefallback,labels:x,locale:e._fullLayout._d3locale,template:b})}}}function G(e,t){var n=e.rotate*Math.PI/180,r=Math.cos(n),i=Math.sin(n),a=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=a*r-o*i,e.textY=a*i+o*r,e.noCenter=!0}t.exports={plot:v,formatSliceLabel:W,transformInsideText:T,determineInsideTextFont:C,positionTitleOutside:F,prerenderTitles:w,layoutAreas:B,attachFxHandlers:b,computeTransform:G}}),id=h((e,t)=>{var n=S(),r=En(),i=eo().resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(`.trace`);i(e,t,`pie`),t.each(function(t){var i=t[0].trace,a=n.select(this);a.style({opacity:i.opacity}),a.selectAll(`path.surface`).each(function(t){n.select(this).call(r,t,i,e)})})}}),ad=h(e=>{var t=Et();e.name=`pie`,e.plot=function(n,r,i,a){t.plotBasePlot(e.name,n,r,i,a)},e.clean=function(n,r,i,a){t.cleanBasePlot(e.name,n,r,i,a)}}),od=h((e,t)=>{t.exports={attributes:Zu(),supplyDefaults:Qu().supplyDefaults,supplyLayoutDefaults:ed(),layoutAttributes:$u(),calc:td().calc,crossTraceCalc:td().crossTraceCalc,plot:rd().plot,style:id(),styleOne:En(),moduleType:`trace`,name:`pie`,basePlotModule:ad(),categories:[`pie-like`,`pie`,`showLegend`],meta:{}}}),sd=h((e,t)=>{t.exports=od()}),cd=h(e=>{var t=Et();e.name=`sunburst`,e.plot=function(n,r,i,a){t.plotBasePlot(e.name,n,r,i,a)},e.clean=function(n,r,i,a){t.cleanBasePlot(e.name,n,r,i,a)}}),ld=h((e,t)=>{t.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:`linear`,eventDataKeys:[`currentPath`,`root`,`entry`,`percentRoot`,`percentEntry`,`percentParent`]}}),ud=h((e,t)=>{var n=W(),{hovertemplateAttrs:r,texttemplateAttrs:i,templatefallbackAttrs:a}=ze(),o=Pt(),s=Da().attributes,c=Zu(),l=ld(),u=z().extendFlat,d=Le().pattern;t.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:u({colors:{valType:`data_array`,editType:`calc`},line:{color:u({},c.marker.line.color,{dflt:null}),width:u({},c.marker.line.width,{dflt:1}),editType:`calc`},pattern:d,editType:`calc`},o(`marker`,{colorAttr:`colors`,anim:!1})),leaf:{opacity:{valType:`number`,editType:`style`,min:0,max:1},editType:`plot`},text:c.text,textinfo:{valType:`flaglist`,flags:[`label`,`text`,`value`,`current path`,`percent root`,`percent entry`,`percent parent`],extras:[`none`],editType:`plot`},texttemplate:i({editType:`plot`},{keys:l.eventDataKeys.concat([`label`,`value`])}),texttemplatefallback:a({editType:`plot`}),hovertext:c.hovertext,hoverinfo:u({},n.hoverinfo,{flags:[`label`,`text`,`value`,`name`,`current path`,`percent root`,`percent entry`,`percent parent`],dflt:`label+text+value+name`}),hovertemplate:r({},{keys:l.eventDataKeys}),hovertemplatefallback:a(),textfont:c.textfont,insidetextorientation:c.insidetextorientation,insidetextfont:c.insidetextfont,outsidetextfont:u({},c.outsidetextfont,{}),rotation:{valType:`angle`,dflt:0,editType:`plot`},sort:c.sort,root:{color:{valType:`color`,editType:`calc`,dflt:`rgba(0,0,0,0)`},editType:`calc`},domain:s({name:`sunburst`,trace:!0,editType:`calc`})}}),dd=h((e,t)=>{t.exports={sunburstcolorway:{valType:`colorlist`,editType:`calc`},extendsunburstcolors:{valType:`boolean`,dflt:!0,editType:`calc`}}}),fd=h((e,t)=>{var n=$(),r=ud(),i=Da().defaults,a=Xa().handleText,o=Qu().handleMarkerDefaults,s=Yt(),c=s.hasColorscale,l=s.handleDefaults;t.exports=function(e,t,s,u){function d(i,a){return n.coerce(e,t,r,i,a)}var f=d(`labels`),p=d(`parents`);if(!f||!f.length||!p||!p.length){t.visible=!1;return}var m=d(`values`);m&&m.length?d(`branchvalues`):d(`count`),d(`level`),d(`maxdepth`),o(e,t,u,d);var h=t._hasColorscale=c(e,`marker`,`colors`)||(e.marker||{}).coloraxis;h&&l(e,t,u,d,{prefix:`marker.`,cLetter:`c`}),d(`leaf.opacity`,h?1:.7);var g=d(`text`);d(`texttemplate`),d(`texttemplatefallback`),t.texttemplate||d(`textinfo`,n.isArrayOrTypedArray(g)?`text+label`:`label`),d(`hovertext`),d(`hovertemplate`),d(`hovertemplatefallback`),a(e,t,u,d,`auto`,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),d(`insidetextorientation`),d(`sort`),d(`rotation`),d(`root.color`),i(t,u,d),t._length=null}}),pd=h((e,t)=>{var n=$(),r=dd();t.exports=function(e,t){function i(i,a){return n.coerce(e,t,r,i,a)}i(`sunburstcolorway`,t.colorway),i(`extendsunburstcolors`)}}),md=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):(n||=self,r(n.d3=n.d3||{}))})(e,function(e){function t(e,t){return e.parent===t.parent?1:2}function n(e){return e.reduce(r,0)/e.length}function r(e,t){return e+t.x}function i(e){return 1+e.reduce(a,0)}function a(e,t){return Math.max(e,t.y)}function o(e){for(var t;t=e.children;)e=t[0];return e}function s(e){for(var t;t=e.children;)e=t[t.length-1];return e}function c(){var e=t,r=1,a=1,c=!1;function l(t){var l,u=0;t.eachAfter(function(t){var r=t.children;r?(t.x=n(r),t.y=i(r)):(t.x=l?u+=e(t,l):0,t.y=0,l=t)});var d=o(t),f=s(t),p=d.x-e(d,f)/2,m=f.x+e(f,d)/2;return t.eachAfter(c?function(e){e.x=(e.x-t.x)*r,e.y=(t.y-e.y)*a}:function(e){e.x=(e.x-p)/(m-p)*r,e.y=(1-(t.y?e.y/t.y:1))*a})}return l.separation=function(t){return arguments.length?(e=t,l):e},l.size=function(e){return arguments.length?(c=!1,r=+e[0],a=+e[1],l):c?null:[r,a]},l.nodeSize=function(e){return arguments.length?(c=!0,r=+e[0],a=+e[1],l):c?[r,a]:null},l}function l(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function u(){return this.eachAfter(l)}function d(e){var t=this,n,r=[t],i,a,o;do for(n=r.reverse(),r=[];t=n.pop();)if(e(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)r.push(i[a]);while(r.length);return this}function f(e){for(var t=this,n=[t],r,i;t=n.pop();)if(e(t),r=t.children,r)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}function p(e){for(var t=this,n=[t],r=[],i,a,o;t=n.pop();)if(r.push(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)n.push(i[a]);for(;t=r.pop();)e(t);return this}function m(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function h(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function g(e){for(var t=this,n=_(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function _(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function v(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function y(){var e=[];return this.each(function(t){e.push(t)}),e}function b(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function x(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function S(e,t){var n=new D(e),r=+e.value&&(n.value=e.value),i,a=[n],o,s,c,l;for(t??=w;i=a.pop();)if(r&&(i.value=+i.data.value),(s=t(i.data))&&(l=s.length))for(i.children=Array(l),c=l-1;c>=0;--c)a.push(o=i.children[c]=new D(s[c])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(E)}function C(){return S(this).eachBefore(T)}function w(e){return e.children}function T(e){e.data=e.data.data}function E(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function D(e){this.data=e,this.depth=this.height=0,this.parent=null}D.prototype=S.prototype={constructor:D,count:u,each:d,eachAfter:p,eachBefore:f,sum:m,sort:h,path:g,ancestors:v,descendants:y,leaves:b,links:x,copy:C};var O=Array.prototype.slice;function k(e){for(var t=e.length,n,r;t;)r=Math.random()*t--|0,n=e[t],e[t]=e[r],e[r]=n;return e}function A(e){for(var t=0,n=(e=k(O.call(e))).length,r=[],i,a;t<n;)i=e[t],a&&N(a,i)?++t:(a=F(r=j(r,i)),t=0);return a}function j(e,t){var n,r;if(P(t,e))return[t];for(n=0;n<e.length;++n)if(M(t,e[n])&&P(L(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(M(L(e[n],e[r]),t)&&M(L(e[n],t),e[r])&&M(L(e[r],t),e[n])&&P(R(e[n],e[r],t),e))return[e[n],e[r],t];throw Error()}function M(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function N(e,t){var n=e.r-t.r+1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function P(e,t){for(var n=0;n<t.length;++n)if(!N(e,t[n]))return!1;return!0}function F(e){switch(e.length){case 1:return I(e[0]);case 2:return L(e[0],e[1]);case 3:return R(e[0],e[1],e[2])}}function I(e){return{x:e.x,y:e.y,r:e.r}}function L(e,t){var n=e.x,r=e.y,i=e.r,a=t.x,o=t.y,s=t.r,c=a-n,l=o-r,u=s-i,d=Math.sqrt(c*c+l*l);return{x:(n+a+c/d*u)/2,y:(r+o+l/d*u)/2,r:(d+i+s)/2}}function R(e,t,n){var r=e.x,i=e.y,a=e.r,o=t.x,s=t.y,c=t.r,l=n.x,u=n.y,d=n.r,f=r-o,p=r-l,m=i-s,h=i-u,g=c-a,_=d-a,v=r*r+i*i-a*a,y=v-o*o-s*s+c*c,b=v-l*l-u*u+d*d,x=p*m-f*h,S=(m*b-h*y)/(x*2)-r,C=(h*g-m*_)/x,w=(p*y-f*b)/(x*2)-i,T=(f*_-p*g)/x,E=C*C+T*T-1,D=2*(a+S*C+w*T),O=S*S+w*w-a*a,k=-(E?(D+Math.sqrt(D*D-4*E*O))/(2*E):O/D);return{x:r+S+C*k,y:i+w+T*k,r:k}}function z(e,t,n){var r=e.x-t.x,i,a,o=e.y-t.y,s,c,l=r*r+o*o;l?(a=t.r+n.r,a*=a,c=e.r+n.r,c*=c,a>c?(i=(l+c-a)/(2*l),s=Math.sqrt(Math.max(0,c/l-i*i)),n.x=e.x-i*r-s*o,n.y=e.y-i*o+s*r):(i=(l+a-c)/(2*l),s=Math.sqrt(Math.max(0,a/l-i*i)),n.x=t.x+i*r-s*o,n.y=t.y+i*o+s*r)):(n.x=t.x+n.r,n.y=t.y)}function B(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function V(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,a=(t.y*n.r+n.y*t.r)/r;return i*i+a*a}function H(e){this._=e,this.next=null,this.previous=null}function U(e){if(!(i=e.length))return 0;var t,n,r,i,a,o,s,c,l,u,d;if(t=e[0],t.x=0,t.y=0,!(i>1))return t.r;if(n=e[1],t.x=-n.r,n.x=t.r,n.y=0,!(i>2))return t.r+n.r;z(n,t,r=e[2]),t=new H(t),n=new H(n),r=new H(r),t.next=r.previous=n,n.next=t.previous=r,r.next=n.previous=t;e:for(s=3;s<i;++s){z(t._,n._,r=e[s]),r=new H(r),c=n.next,l=t.previous,u=n._.r,d=t._.r;do if(u<=d){if(B(c._,r._)){n=c,t.next=n,n.previous=t,--s;continue e}u+=c._.r,c=c.next}else{if(B(l._,r._)){t=l,t.next=n,n.previous=t,--s;continue e}d+=l._.r,l=l.previous}while(c!==l.next);for(r.previous=t,r.next=n,t.next=n.previous=n=r,a=V(t);(r=r.next)!==n;)(o=V(r))<a&&(t=r,a=o);n=t.next}for(t=[n._],r=n;(r=r.next)!==n;)t.push(r._);for(r=A(t),s=0;s<i;++s)t=e[s],t.x-=r.x,t.y-=r.y;return r.r}function W(e){return U(e),e}function G(e){return e==null?null:K(e)}function K(e){if(typeof e!=`function`)throw Error();return e}function q(){return 0}function J(e){return function(){return e}}function Y(e){return Math.sqrt(e.value)}function X(){var e=null,t=1,n=1,r=q;function i(i){return i.x=t/2,i.y=n/2,e?i.eachBefore(Z(e)).eachAfter(Q(r,.5)).eachBefore(ee(1)):i.eachBefore(Z(Y)).eachAfter(Q(q,1)).eachAfter(Q(r,i.r/Math.min(t,n))).eachBefore(ee(Math.min(t,n)/(2*i.r))),i}return i.radius=function(t){return arguments.length?(e=G(t),i):e},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(e){return arguments.length?(r=typeof e==`function`?e:J(+e),i):r},i}function Z(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Q(e,t){return function(n){if(r=n.children){var r,i,a=r.length,o=e(n)*t||0,s;if(o)for(i=0;i<a;++i)r[i].r+=o;if(s=U(r),o)for(i=0;i<a;++i)r[i].r-=o;n.r=s+o}}}function ee(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function te(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ne(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function re(){var e=1,t=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=e,i.y1=t/o,i.eachBefore(a(t,o)),r&&i.eachBefore(te),i}function a(e,t){return function(r){r.children&&ne(r,r.x0,e*(r.depth+1)/t,r.x1,e*(r.depth+2)/t);var i=r.x0,a=r.y0,o=r.x1-n,s=r.y1-n;o<i&&(i=o=(i+o)/2),s<a&&(a=s=(a+s)/2),r.x0=i,r.y0=a,r.x1=o,r.y1=s}}return i.round=function(e){return arguments.length?(r=!!e,i):r},i.size=function(n){return arguments.length?(e=+n[0],t=+n[1],i):[e,t]},i.padding=function(e){return arguments.length?(n=+e,i):n},i}var ie=`$`,ae={depth:-1},oe={};function se(e){return e.id}function ce(e){return e.parentId}function le(){var e=se,t=ce;function n(n){var r,i,a=n.length,o,s,c,l=Array(a),u,d,f={};for(i=0;i<a;++i)r=n[i],c=l[i]=new D(r),(u=e(r,i,n))!=null&&(u+=``)&&(d=ie+(c.id=u),f[d]=d in f?oe:c);for(i=0;i<a;++i)if(c=l[i],u=t(n[i],i,n),u==null||!(u+=``)){if(o)throw Error(`multiple roots`);o=c}else{if(s=f[ie+u],!s)throw Error(`missing: `+u);if(s===oe)throw Error(`ambiguous: `+u);s.children?s.children.push(c):s.children=[c],c.parent=s}if(!o)throw Error(`no root`);if(o.parent=ae,o.eachBefore(function(e){e.depth=e.parent.depth+1,--a}).eachBefore(E),o.parent=null,a>0)throw Error(`cycle`);return o}return n.id=function(t){return arguments.length?(e=K(t),n):e},n.parentId=function(e){return arguments.length?(t=K(e),n):t},n}function ue(e,t){return e.parent===t.parent?1:2}function de(e){var t=e.children;return t?t[0]:e.t}function fe(e){var t=e.children;return t?t[t.length-1]:e.t}function pe(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function me(e){for(var t=0,n=0,r=e.children,i=r.length,a;--i>=0;)a=r[i],a.z+=t,a.m+=t,t+=a.s+(n+=a.c)}function he(e,t,n){return e.a.parent===t.parent?e.a:n}function ge(e,t){this._=e,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=t}ge.prototype=Object.create(D.prototype);function _e(e){for(var t=new ge(e,0),n,r=[t],i,a,o,s;n=r.pop();)if(a=n._.children)for(n.children=Array(s=a.length),o=s-1;o>=0;--o)r.push(i=n.children[o]=new ge(a[o],o)),i.parent=n;return(t.parent=new ge(null,0)).children=[t],t}function ve(){var e=ue,t=1,n=1,r=null;function i(i){var s=_e(i);if(s.eachAfter(a),s.parent.m=-s.z,s.eachBefore(o),r)i.eachBefore(c);else{var l=i,u=i,d=i;i.eachBefore(function(e){e.x<l.x&&(l=e),e.x>u.x&&(u=e),e.depth>d.depth&&(d=e)});var f=l===u?1:e(l,u)/2,p=f-l.x,m=t/(u.x+f+p),h=n/(d.depth||1);i.eachBefore(function(e){e.x=(e.x+p)*m,e.y=e.depth*h})}return i}function a(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){me(t);var a=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=s(t,i,t.parent.A||r[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(t,n,r){if(n){for(var i=t,a=t,o=n,s=i.parent.children[0],c=i.m,l=a.m,u=o.m,d=s.m,f;o=fe(o),i=de(i),o&&i;)s=de(s),a=fe(a),a.a=t,f=o.z+u-i.z-c+e(o._,i._),f>0&&(pe(he(o,t,r),t,f),c+=f,l+=f),u+=o.m,c+=i.m,d+=s.m,l+=a.m;o&&!fe(a)&&(a.t=o,a.m+=u-l),i&&!de(s)&&(s.t=i,s.m+=c-d,r=t)}return r}function c(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}function ye(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var be=(1+Math.sqrt(5))/2;function xe(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?ne(c,n,r,i,h?r+=m*g/h:a):ye(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var Se=function e(t){function n(e,n,r,i,a){xe(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n}(be);function Ce(){var e=Se,t=!1,n=1,r=1,i=[0],a=q,o=q,s=q,c=q,l=q;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(te),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=K(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:J(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:J(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:J(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:J(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:J(+e),u):l},u}function we(e,t,n,r,i){var a=e.children,o,s=a.length,c,l=Array(s+1);for(l[0]=c=o=0;o<s;++o)l[o+1]=c+=a[o].value;u(0,s,e.value,t,n,r,i);function u(e,t,n,r,i,o,s){if(e>=t-1){var c=a[e];c.x0=r,c.y0=i,c.x1=o,c.y1=s;return}for(var d=l[e],f=n/2+d,p=e+1,m=t-1;p<m;){var h=p+m>>>1;l[h]<f?p=h+1:m=h}f-l[p-1]<l[p]-f&&e+1<p&&--p;var g=l[p]-d,_=n-g;if(o-r>s-i){var v=(r*_+o*g)/n;u(e,p,g,r,i,v,s),u(p,t,_,v,i,o,s)}else{var y=(i*_+s*g)/n;u(e,p,g,r,i,o,y),u(p,t,_,r,y,o,s)}}}function Te(e,t,n,r,i){(e.depth&1?ye:ne)(e,t,n,r,i)}var Ee=function e(t){function n(e,n,r,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,c,l,u=-1,d,f=o.length,p=e.value;++u<f;){for(s=o[u],c=s.children,l=s.value=0,d=c.length;l<d;++l)s.value+=c[l].value;s.dice?ne(s,n,r,i,r+=(a-r)*s.value/p):ye(s,n,r,n+=(i-n)*s.value/p,a),p-=s.value}else e._squarify=o=xe(t,e,n,r,i,a),o.ratio=t}return n.ratio=function(t){return e((t=+t)>1?t:1)},n}(be);e.cluster=c,e.hierarchy=S,e.pack=X,e.packEnclose=A,e.packSiblings=W,e.partition=re,e.stratify=le,e.tree=ve,e.treemap=Ce,e.treemapBinary=we,e.treemapDice=ne,e.treemapResquarify=Ee,e.treemapSlice=ye,e.treemapSliceDice=Te,e.treemapSquarify=Se,Object.defineProperty(e,`__esModule`,{value:!0})})}),hd=h(e=>{var t=md(),n=D(),r=$(),i=Yt().makeColorScaleFuncFromTrace,a=td().makePullColorFn,o=td().generateExtendedColors,s=Yt().calc,c=O().ALMOST_EQUAL,l={},u={},d={};e.calc=function(e,o){var l=e._fullLayout,u=o.ids,d=r.isArrayOrTypedArray(u),p=o.labels,m=o.parents,h=o.values,g=r.isArrayOrTypedArray(h),_=[],v={},y={},b=function(e,t){v[e]?v[e].push(t):v[e]=[t],y[t]=1},x=function(e){return e||typeof e==`number`},S=function(e){return!g||n(h[e])&&h[e]>=0},C,w,T;d?(C=Math.min(u.length,m.length),w=function(e){return x(u[e])&&S(e)},T=function(e){return String(u[e])}):(C=Math.min(p.length,m.length),w=function(e){return x(p[e])&&S(e)},T=function(e){return String(p[e])}),g&&(C=Math.min(C,h.length));for(var E=0;E<C;E++)if(w(E)){var D=T(E),O=x(m[E])?String(m[E]):``,k={i:E,id:D,pid:O,label:x(p[E])?String(p[E]):``};g&&(k.v=+h[E]),_.push(k),b(O,D)}if(v[``]){if(v[``].length>1){for(var A=r.randstr(),j=0;j<_.length;j++)_[j].pid===``&&(_[j].pid=A);_.unshift({hasMultipleRoots:!0,id:A,pid:``,label:``})}}else{var M=[],N;for(N in v)y[N]||M.push(N);if(M.length===1)N=M[0],_.unshift({hasImpliedRoot:!0,id:N,pid:``,label:N});else return r.warn([`Multiple implied roots, cannot build`,o.type,`hierarchy of`,o.name+`.`,`These roots include:`,M.join(`, `)].join(` `))}var P;try{P=t.stratify().id(function(e){return e.id}).parentId(function(e){return e.pid})(_)}catch(e){return r.warn([`Failed to build`,o.type,`hierarchy of`,o.name+`.`,`Error:`,e.message].join(` `))}var F=t.hierarchy(P),I=!1;if(g)switch(o.branchvalues){case`remainder`:F.sum(function(e){return e.data.v});break;case`total`:F.each(function(e){var t=e.data.data,n=t.v;if(e.children){var i=e.children.reduce(function(e,t){return e+t.data.data.v},0);if((t.hasImpliedRoot||t.hasMultipleRoots)&&(n=i),n<i*c)return I=!0,r.warn([`Total value for node`,e.data.data.id,`of`,o.name,`is smaller than the sum of its children.`,`
parent value =`,n,`
children sum =`,i].join(` `))}e.value=n});break}else f(F,o,{branches:o.count.indexOf(`branches`)!==-1,leaves:o.count.indexOf(`leaves`)!==-1});if(!I){o.sort&&F.sort(function(e,t){return t.value-e.value});var L,R,z=o.marker.colors||[],B=!!z.length;return o._hasColorscale?(B||(z=g?o.values:o._values),s(e,o,{vals:z,containerStr:`marker`,cLetter:`c`}),R=i(o.marker)):L=a(l[`_`+o.type+`colormap`]),F.each(function(e){var t=e.data.data;t.color=o._hasColorscale?R(z[t.i]):L(z[t.i],t.id)}),_[0].hierarchy=F,_}},e._runCrossTraceCalc=function(e,t){var n=t._fullLayout,r=t.calcdata,i=n[e+`colorway`],a=n[`_`+e+`colormap`];n[`extend`+e+`colors`]&&(i=o(i,e===`icicle`?d:e===`treemap`?u:l));var s=0,c;function f(e){var t=e.data.data,n=t.id;t.color===!1&&(a[n]?t.color=a[n]:e.parent?e.parent.parent?t.color=e.parent.data.data.color:(a[n]=t.color=i[s%i.length],s++):t.color=c)}for(var p=0;p<r.length;p++){var m=r[p][0];m.trace.type===e&&m.hierarchy&&(c=m.trace.root.color,m.hierarchy.each(f))}},e.crossTraceCalc=function(t){return e._runCrossTraceCalc(`sunburst`,t)};function f(e,t,n){var r=0,i=e.children;if(i){for(var a=i.length,o=0;o<a;o++)r+=f(i[o],t,n);n.branches&&r++}else n.leaves&&r++;return e.value=e.data.data.value=r,t._values||=[],t._values[e.data.data.i]=r,r}});function gd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _d(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}var vd=m(()=>{});function yd(){}function bd(){return this.rgb().formatHex()}function xd(){return this.rgb().formatHex8()}function Sd(){return Ld(this).formatHsl()}function Cd(){return this.rgb().formatRgb()}function wd(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Jd.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Td(t):n===3?new kd(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ed(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ed(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Yd.exec(e))?new kd(t[1],t[2],t[3],1):(t=Xd.exec(e))?new kd(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Zd.exec(e))?Ed(t[1],t[2],t[3],t[4]):(t=Qd.exec(e))?Ed(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=$d.exec(e))?Id(t[1],t[2]/100,t[3]/100,1):(t=ef.exec(e))?Id(t[1],t[2]/100,t[3]/100,t[4]):tf.hasOwnProperty(e)?Td(tf[e]):e===`transparent`?new kd(NaN,NaN,NaN,0):null}function Td(e){return new kd(e>>16&255,e>>8&255,e&255,1)}function Ed(e,t,n,r){return r<=0&&(e=t=n=NaN),new kd(e,t,n,r)}function Dd(e){return e instanceof yd||(e=wd(e)),e?(e=e.rgb(),new kd(e.r,e.g,e.b,e.opacity)):new kd}function Od(e,t,n,r){return arguments.length===1?Dd(e):new kd(e,t,n,r??1)}function kd(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ad(){return`#${Fd(this.r)}${Fd(this.g)}${Fd(this.b)}`}function jd(){return`#${Fd(this.r)}${Fd(this.g)}${Fd(this.b)}${Fd((isNaN(this.opacity)?1:this.opacity)*255)}`}function Md(){let e=Nd(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Pd(this.r)}, ${Pd(this.g)}, ${Pd(this.b)}${e===1?`)`:`, ${e})`}`}function Nd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fd(e){return e=Pd(e),(e<16?`0`:``)+e.toString(16)}function Id(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new zd(e,t,n,r)}function Ld(e){if(e instanceof zd)return new zd(e.h,e.s,e.l,e.opacity);if(e instanceof yd||(e=wd(e)),!e)return new zd;if(e instanceof zd)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new zd(o,s,c,e.opacity)}function Rd(e,t,n,r){return arguments.length===1?Ld(e):new zd(e,t,n,r??1)}function zd(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Bd(e){return e=(e||0)%360,e<0?e+360:e}function Vd(e){return Math.max(0,Math.min(1,e||0))}function Hd(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Ud,Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf=m(()=>{vd(),Ud=.7,Wd=1/Ud,Gd=`\\s*([+-]?\\d+)\\s*`,Kd=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,qd=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Jd=/^#([0-9a-f]{3,8})$/,Yd=RegExp(`^rgb\\(${Gd},${Gd},${Gd}\\)$`),Xd=RegExp(`^rgb\\(${qd},${qd},${qd}\\)$`),Zd=RegExp(`^rgba\\(${Gd},${Gd},${Gd},${Kd}\\)$`),Qd=RegExp(`^rgba\\(${qd},${qd},${qd},${Kd}\\)$`),$d=RegExp(`^hsl\\(${Kd},${qd},${qd}\\)$`),ef=RegExp(`^hsla\\(${Kd},${qd},${qd},${Kd}\\)$`),tf={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},gd(yd,wd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:bd,formatHex:bd,formatHex8:xd,formatHsl:Sd,formatRgb:Cd,toString:Cd}),gd(kd,Od,_d(yd,{brighter(e){return e=e==null?Wd:Wd**+e,new kd(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ud:Ud**+e,new kd(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new kd(Pd(this.r),Pd(this.g),Pd(this.b),Nd(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:Ad,formatHex:Ad,formatHex8:jd,formatRgb:Md,toString:Md})),gd(zd,Rd,_d(yd,{brighter(e){return e=e==null?Wd:Wd**+e,new zd(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ud:Ud**+e,new zd(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new kd(Hd(e>=240?e-240:e+120,i,r),Hd(e,i,r),Hd(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new zd(Bd(this.h),Vd(this.s),Vd(this.l),Nd(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 e=Nd(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Bd(this.h)}, ${Vd(this.s)*100}%, ${Vd(this.l)*100}%${e===1?`)`:`, ${e})`}`}}))}),rf,af,of=m(()=>{rf=Math.PI/180,af=180/Math.PI});function sf(e){if(e instanceof lf)return new lf(e.l,e.a,e.b,e.opacity);if(e instanceof gf)return _f(e);e instanceof kd||(e=Dd(e));var t=pf(e.r),n=pf(e.g),r=pf(e.b),i=uf((.2225045*t+.7168786*n+.0606169*r)/bf),a,o;return t===n&&n===r?a=o=i:(a=uf((.4360747*t+.3850649*n+.1430804*r)/yf),o=uf((.0139322*t+.0971045*n+.7141733*r)/xf)),new lf(116*i-16,500*(a-i),200*(i-o),e.opacity)}function cf(e,t,n,r){return arguments.length===1?sf(e):new lf(e,t,n,r??1)}function lf(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function uf(e){return e>Tf?e**(1/3):e/wf+Sf}function df(e){return e>Cf?e*e*e:wf*(e-Sf)}function ff(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function pf(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function mf(e){if(e instanceof gf)return new gf(e.h,e.c,e.l,e.opacity);if(e instanceof lf||(e=sf(e)),e.a===0&&e.b===0)return new gf(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*af;return new gf(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function hf(e,t,n,r){return arguments.length===1?mf(e):new gf(e,t,n,r??1)}function gf(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function _f(e){if(isNaN(e.h))return new lf(e.l,0,0,e.opacity);var t=e.h*rf;return new lf(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}var vf,yf,bf,xf,Sf,Cf,wf,Tf,Ef=m(()=>{vd(),nf(),of(),vf=18,yf=.96422,bf=1,xf=.82521,Sf=4/29,Cf=6/29,wf=3*Cf*Cf,Tf=Cf*Cf*Cf,gd(lf,cf,_d(yd,{brighter(e){return new lf(this.l+vf*(e??1),this.a,this.b,this.opacity)},darker(e){return new lf(this.l-vf*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=yf*df(t),e=bf*df(e),n=xf*df(n),new kd(ff(3.1338561*t-1.6168667*e-.4906146*n),ff(-.9787684*t+1.9161415*e+.033454*n),ff(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),gd(gf,hf,_d(yd,{brighter(e){return new gf(this.h,this.c,this.l+vf*(e??1),this.opacity)},darker(e){return new gf(this.h,this.c,this.l-vf*(e??1),this.opacity)},rgb(){return _f(this).rgb()}}))});function Df(e){if(e instanceof kf)return new kf(e.h,e.s,e.l,e.opacity);e instanceof kd||(e=Dd(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Lf*r+Ff*t-If*n)/(Lf+Ff-If),a=r-i,o=(Pf*(n-i)-Mf*a)/Nf,s=Math.sqrt(o*o+a*a)/(Pf*i*(1-i)),c=s?Math.atan2(o,a)*af-120:NaN;return new kf(c<0?c+360:c,s,i,e.opacity)}function Of(e,t,n,r){return arguments.length===1?Df(e):new kf(e,t,n,r??1)}function kf(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}var Af,jf,Mf,Nf,Pf,Ff,If,Lf,Rf=m(()=>{vd(),nf(),of(),Af=-.14861,jf=1.78277,Mf=-.29227,Nf=-.90649,Pf=1.97294,Ff=Pf*Nf,If=Pf*jf,Lf=jf*Mf-Nf*Af,gd(kf,Of,_d(yd,{brighter(e){return e=e==null?Wd:Wd**+e,new kf(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ud:Ud**+e,new kf(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*rf,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new kd(255*(t+n*(Af*r+jf*i)),255*(t+n*(Mf*r+Nf*i)),255*(t+Pf*r*n),this.opacity)}}))}),zf=m(()=>{nf(),Ef(),Rf()});function Bf(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}function Vf(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1],o=r>0?e[r-1]:2*i-a,s=r<t-1?e[r+2]:2*a-i;return Bf((n-r/t)*t,o,i,a,s)}}var Hf=m(()=>{});function Uf(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],a=e[r%t],o=e[(r+1)%t],s=e[(r+2)%t];return Bf((n-r/t)*t,i,a,o,s)}}var Wf=m(()=>{Hf()}),Gf,Kf=m(()=>{Gf=e=>()=>e});function qf(e,t){return function(n){return e+n*t}}function Jf(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Yf(e,t){var n=t-e;return n?qf(e,n>180||n<-180?n-360*Math.round(n/360):n):Gf(isNaN(e)?t:e)}function Xf(e){return(e=+e)==1?Zf:function(t,n){return n-t?Jf(t,n,e):Gf(isNaN(t)?n:t)}}function Zf(e,t){var n=t-e;return n?qf(e,n):Gf(isNaN(e)?t:e)}var Qf=m(()=>{Kf()});function $f(e){return function(t){var n=t.length,r=Array(n),i=Array(n),a=Array(n),o,s;for(o=0;o<n;++o)s=Od(t[o]),r[o]=s.r||0,i[o]=s.g||0,a[o]=s.b||0;return r=e(r),i=e(i),a=e(a),s.opacity=1,function(e){return s.r=r(e),s.g=i(e),s.b=a(e),s+``}}}var ep,tp,np,rp=m(()=>{zf(),Hf(),Wf(),Qf(),ep=function e(t){var n=Xf(t);function r(e,t){var r=n((e=Od(e)).r,(t=Od(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Zf(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r}(1),tp=$f(Vf),np=$f(Uf)});function ip(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function ap(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var op=m(()=>{});function sp(e,t){return(ap(t)?ip:cp)(e,t)}function cp(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=Sp(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}var lp=m(()=>{Cp(),op()});function up(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}var dp=m(()=>{});function fp(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var pp=m(()=>{});function mp(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=Sp(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var hp=m(()=>{Cp()});function gp(e){return function(){return e}}function _p(e){return function(t){return e(t)+``}}function vp(e,t){var n=yp.lastIndex=bp.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=yp.exec(e))&&(i=bp.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:fp(r,i)})),n=bp.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?_p(c[0].x):gp(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}var yp,bp,xp=m(()=>{pp(),yp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bp=new RegExp(yp.source,`g`)});function Sp(e,t){var n=typeof t,r;return t==null||n===`boolean`?Gf(t):(n===`number`?fp:n===`string`?(r=wd(t))?(t=r,ep):vp:t instanceof wd?ep:t instanceof Date?up:ap(t)?ip:Array.isArray(t)?cp:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?mp:fp)(e,t)}var Cp=m(()=>{zf(),rp(),lp(),dp(),pp(),hp(),xp(),Kf(),op()});function wp(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var Tp=m(()=>{});function Ep(e,t){var n=Yf(+e,+t);return function(e){var t=n(e);return t-360*Math.floor(t/360)}}var Dp=m(()=>{Qf()});function Op(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var kp=m(()=>{});function Ap(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*jp,skewX:Math.atan(c)*jp,scaleX:o,scaleY:s}}var jp,Mp,Np=m(()=>{jp=180/Math.PI,Mp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function Pp(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Mp:Ap(t.a,t.b,t.c,t.d,t.e,t.f)}function Fp(e){return e==null?Mp:(Ip||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Ip.setAttribute(`transform`,e),(e=Ip.transform.baseVal.consolidate())?(e=e.matrix,Ap(e.a,e.b,e.c,e.d,e.e,e.f)):Mp)}var Ip,Lp=m(()=>{Np()});function Rp(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:fp(e,i)},{i:c-2,x:fp(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:fp(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:fp(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:fp(e,n)},{i:s-2,x:fp(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var zp,Bp,Vp=m(()=>{pp(),Lp(),zp=Rp(Pp,`px, `,`px)`,`deg)`),Bp=Rp(Fp,`, `,`)`,`)`)});function Hp(e){return((e=Math.exp(e))+1/e)/2}function Up(e){return((e=Math.exp(e))-1/e)/2}function Wp(e){return((e=Math.exp(2*e))-1)/(e+1)}var Gp,Kp,qp=m(()=>{Gp=1e-12,Kp=function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<Gp)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=Hp(y),c=s/(n*g)*(i*Wp(t*r+y)-Up(y));return[a+c*d,o+c*f,s*i/Hp(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4)});function Jp(e){return function(t,n){var r=e((t=Rd(t)).h,(n=Rd(n)).h),i=Zf(t.s,n.s),a=Zf(t.l,n.l),o=Zf(t.opacity,n.opacity);return function(e){return t.h=r(e),t.s=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var Yp,Xp,Zp=m(()=>{zf(),Qf(),Yp=Jp(Yf),Xp=Jp(Zf)});function Qp(e,t){var n=Zf((e=cf(e)).l,(t=cf(t)).l),r=Zf(e.a,t.a),i=Zf(e.b,t.b),a=Zf(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=r(t),e.b=i(t),e.opacity=a(t),e+``}}var $p=m(()=>{zf(),Qf()});function em(e){return function(t,n){var r=e((t=hf(t)).h,(n=hf(n)).h),i=Zf(t.c,n.c),a=Zf(t.l,n.l),o=Zf(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var tm,nm,rm=m(()=>{zf(),Qf(),tm=em(Yf),nm=em(Zf)});function im(e){return function t(n){n=+n;function r(t,r){var i=e((t=Of(t)).h,(r=Of(r)).h),a=Zf(t.s,r.s),o=Zf(t.l,r.l),s=Zf(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r}(1)}var am,om,sm=m(()=>{zf(),Qf(),am=im(Yf),om=im(Zf)});function cm(e,t){t===void 0&&(t=e,e=Sp);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}var lm=m(()=>{Cp()});function um(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var dm=m(()=>{}),fm={};g(fm,{interpolate:()=>Sp,interpolateArray:()=>sp,interpolateBasis:()=>Vf,interpolateBasisClosed:()=>Uf,interpolateCubehelix:()=>am,interpolateCubehelixLong:()=>om,interpolateDate:()=>up,interpolateDiscrete:()=>wp,interpolateHcl:()=>tm,interpolateHclLong:()=>nm,interpolateHsl:()=>Yp,interpolateHslLong:()=>Xp,interpolateHue:()=>Ep,interpolateLab:()=>Qp,interpolateNumber:()=>fp,interpolateNumberArray:()=>ip,interpolateObject:()=>mp,interpolateRgb:()=>ep,interpolateRgbBasis:()=>tp,interpolateRgbBasisClosed:()=>np,interpolateRound:()=>Op,interpolateString:()=>vp,interpolateTransformCss:()=>zp,interpolateTransformSvg:()=>Bp,interpolateZoom:()=>Kp,piecewise:()=>cm,quantize:()=>um});var pm=m(()=>{Cp(),lp(),Hf(),Wf(),dp(),Tp(),Dp(),pp(),op(),hp(),kp(),xp(),Vp(),qp(),rp(),Zp(),$p(),rm(),sm(),lm(),dm()}),mm=h((e,t)=>{var n=tn(),r=q();t.exports=function(e,t,i,a,o){var s=t.data.data,c=s.i,l=o||s.color;if(c>=0){t.i=s.i;var u=i.marker;u.pattern?(!u.colors||!u.pattern.shape)&&(u.color=l,t.color=l):(u.color=l,t.color=l),n.pointStyle(e,i,a,t)}else r.fill(e,l)}}),hm=h((e,t)=>{var n=S(),r=q(),i=$(),a=eo().resizeText,o=mm();function s(e){var t=e._fullLayout._sunburstlayer.selectAll(`.trace`);a(e,t,`sunburst`),t.each(function(t){var r=n.select(this),i=t[0].trace;r.style(`opacity`,i.opacity),r.selectAll(`path.surface`).each(function(t){n.select(this).call(c,t,i,e)})})}function c(e,t,n,a){var s=t.data.data,c=!t.children,l=s.i,u=i.castOption(n,l,`marker.line.color`)||r.defaultLine,d=i.castOption(n,l,`marker.line.width`)||0;e.call(o,t,n,a).style(`stroke-width`,d).call(r.stroke,u).style(`opacity`,c?n.leaf.opacity:null)}t.exports={style:s,styleOne:c}}),gm=h(e=>{var t=$(),n=q(),r=gn(),i=wn();e.findEntryWithLevel=function(t,n){var r;return n&&t.eachAfter(function(t){if(e.getPtId(t)===n)return r=t.copy()}),r||t},e.findEntryWithChild=function(t,n){var r;return t.eachAfter(function(t){for(var i=t.children||[],a=0;a<i.length;a++){var o=i[a];if(e.getPtId(o)===n)return r=t.copy()}}),r||t},e.isEntry=function(e){return!e.parent},e.isLeaf=function(e){return!e.children},e.getPtId=function(e){return e.data.data.id},e.getPtLabel=function(e){return e.data.data.label},e.getValue=function(e){return e.value},e.isHierarchyRoot=function(e){return s(e)===``},e.setSliceCursor=function(t,n,i){var a=i.isTransitioning;if(!a){var o=t.datum();a=i.hideOnRoot&&e.isHierarchyRoot(o)||i.hideOnLeaves&&e.isLeaf(o)}r(t,a?null:`pointer`)};function a(t,n,r){return{color:e.getOutsideTextFontKey(`color`,t,n,r),family:e.getOutsideTextFontKey(`family`,t,n,r),size:e.getOutsideTextFontKey(`size`,t,n,r),weight:e.getOutsideTextFontKey(`weight`,t,n,r),style:e.getOutsideTextFontKey(`style`,t,n,r),variant:e.getOutsideTextFontKey(`variant`,t,n,r),textcase:e.getOutsideTextFontKey(`textcase`,t,n,r),lineposition:e.getOutsideTextFontKey(`lineposition`,t,n,r),shadow:e.getOutsideTextFontKey(`shadow`,t,n,r)}}function o(r,i,a,o){var s=(o||{}).onPathbar,c=i.data.data,l=c.i,u=t.castOption(r,l,(s?`pathbar.textfont`:`insidetextfont`)+`.color`);return!u&&r._input.textfont&&(u=t.castOption(r._input,l,`textfont.color`)),{color:u||n.contrast(c.color),family:e.getInsideTextFontKey(`family`,r,i,a,o),size:e.getInsideTextFontKey(`size`,r,i,a,o),weight:e.getInsideTextFontKey(`weight`,r,i,a,o),style:e.getInsideTextFontKey(`style`,r,i,a,o),variant:e.getInsideTextFontKey(`variant`,r,i,a,o),textcase:e.getInsideTextFontKey(`textcase`,r,i,a,o),lineposition:e.getInsideTextFontKey(`lineposition`,r,i,a,o),shadow:e.getInsideTextFontKey(`shadow`,r,i,a,o)}}e.getInsideTextFontKey=function(e,n,r,i,a){var o=(a||{}).onPathbar?`pathbar.textfont`:`insidetextfont`,s=r.data.data.i;return t.castOption(n,s,o+`.`+e)||t.castOption(n,s,`textfont.`+e)||i.size},e.getOutsideTextFontKey=function(e,n,r,i){var a=r.data.data.i;return t.castOption(n,a,`outsidetextfont.`+e)||t.castOption(n,a,`textfont.`+e)||i.size},e.isOutsideText=function(t,n){return!t._hasColorscale&&e.isHierarchyRoot(n)},e.determineTextFont=function(t,n,r,i){return e.isOutsideText(t,n)?a(t,n,r):o(t,n,r,i)},e.hasTransition=function(e){return!!(e&&e.duration>0)},e.getMaxDepth=function(e){return e.maxdepth>=0?e.maxdepth:1/0},e.isHeader=function(t,n){return!(e.isLeaf(t)||t.depth===n._maxDepth-1)};function s(e){return e.data.data.pid}e.getParent=function(t,n){return e.findEntryWithLevel(t,s(n))},e.listPath=function(t,n){var r=t.parent;if(!r)return[];var i=n?[r.data[n]]:[r];return e.listPath(r,n).concat(i)},e.getPath=function(t){return e.listPath(t,`label`).join(`/`)+`/`},e.formatValue=i.formatPieValue,e.formatPercent=function(e,n){var r=t.formatPercent(e,0);return r===`0%`&&(r=i.formatPiePercent(e,n)),r}}),_m=h((e,t)=>{var n=S(),r=Ke(),i=Qt().appendArrayPointValue,a=Ln(),o=$(),s=ht(),c=gm(),l=wn().formatPieValue;t.exports=function(e,t,i,d,f){var p=d[0],m=p.trace,h=p.hierarchy,g=m.type===`sunburst`,_=m.type===`treemap`||m.type===`icicle`;`_hasHoverLabel`in m||(m._hasHoverLabel=!1),`_hasHoverEvent`in m||(m._hasHoverEvent=!1),e.on(`mouseover`,function(r){var s=i._fullLayout;if(!(i._dragging||s.hovermode===!1)){var d=i._fullData[m.index],v=r.data.data,y=v.i,b=c.isHierarchyRoot(r),x=c.getParent(h,r),S=c.getValue(r),C=function(e){return o.castOption(d,y,e)},w=C(`hovertemplate`),T=a.castHoverinfo(d,s,y),E=s.separators,D;if(w||T&&T!==`none`&&T!==`skip`){var O,k;g&&(O=p.cx+r.pxmid[0]*(1-r.rInscribed),k=p.cy+r.pxmid[1]*(1-r.rInscribed)),_&&(O=r._hoverX,k=r._hoverY);var A={},j=[],M=[],N=function(e){return j.indexOf(e)!==-1};T&&(j=T===`all`?d._module.attributes.hoverinfo.flags:T.split(`+`)),A.label=v.label,N(`label`)&&A.label&&M.push(A.label),v.hasOwnProperty(`v`)&&(A.value=v.v,A.valueLabel=l(A.value,E),N(`value`)&&M.push(A.valueLabel)),A.currentPath=r.currentPath=c.getPath(r.data),N(`current path`)&&!b&&M.push(A.currentPath);var P,F=[],I=function(){F.indexOf(P)===-1&&(M.push(P),F.push(P))};A.percentParent=r.percentParent=S/c.getValue(x),A.parent=r.parentString=c.getPtLabel(x),N(`percent parent`)&&(P=c.formatPercent(A.percentParent,E)+` of `+A.parent,I()),A.percentEntry=r.percentEntry=S/c.getValue(t),A.entry=r.entry=c.getPtLabel(t),N(`percent entry`)&&!b&&!r.onPathbar&&(P=c.formatPercent(A.percentEntry,E)+` of `+A.entry,I()),A.percentRoot=r.percentRoot=S/c.getValue(h),A.root=r.root=c.getPtLabel(h),N(`percent root`)&&!b&&(P=c.formatPercent(A.percentRoot,E)+` of `+A.root,I()),A.text=C(`hovertext`)||C(`text`),N(`text`)&&(P=A.text,o.isValidTextValue(P)&&M.push(P)),D=[u(r,d,f.eventDataKeys)];var L={trace:d,y:k,_x0:r._x0,_x1:r._x1,_y0:r._y0,_y1:r._y1,text:M.join(`<br>`),name:w||N(`name`)?d.name:void 0,color:C(`hoverlabel.bgcolor`)||v.color,borderColor:C(`hoverlabel.bordercolor`),fontFamily:C(`hoverlabel.font.family`),fontSize:C(`hoverlabel.font.size`),fontColor:C(`hoverlabel.font.color`),fontWeight:C(`hoverlabel.font.weight`),fontStyle:C(`hoverlabel.font.style`),fontVariant:C(`hoverlabel.font.variant`),nameLength:C(`hoverlabel.namelength`),textAlign:C(`hoverlabel.align`),hovertemplate:w,hovertemplateLabels:A,eventData:D};g&&(L.x0=O-r.rInscribed*r.rpx1,L.x1=O+r.rInscribed*r.rpx1,L.idealAlign=r.pxmid[0]<0?`left`:`right`),_&&(L.x=O,L.idealAlign=O<0?`left`:`right`);var R=[];a.loneHover(L,{container:s._hoverlayer.node(),outerContainer:s._paper.node(),gd:i,inOut_bbox:R}),D[0].bbox=R[0],m._hasHoverLabel=!0}if(_){var z=e.select(`path.surface`);f.styleOne(z,r,d,i,{hovered:!0})}m._hasHoverEvent=!0,i.emit(`plotly_hover`,{points:D||[u(r,d,f.eventDataKeys)],event:n.event})}}),e.on(`mouseout`,function(t){var r=i._fullLayout,o=i._fullData[m.index],s=n.select(this).datum();if(m._hasHoverEvent&&=(t.originalEvent=n.event,i.emit(`plotly_unhover`,{points:[u(s,o,f.eventDataKeys)],event:n.event}),!1),m._hasHoverLabel&&=(a.loneUnhover(r._hoverlayer.node()),!1),_){var c=e.select(`path.surface`);f.styleOne(c,s,o,i,{hovered:!1})}}),e.on(`click`,function(e){var t=i._fullLayout,o=i._fullData[m.index],l=g&&(c.isHierarchyRoot(e)||c.isLeaf(e)),d=c.getPtId(e),p=c.isEntry(e)?c.findEntryWithChild(h,d):c.findEntryWithLevel(h,d),_=c.getPtId(p),v={points:[u(e,o,f.eventDataKeys)],event:n.event};l||(v.nextLevel=_);var y=s.triggerHandler(i,`plotly_`+m.type+`click`,v);if(y!==!1&&t.hovermode&&(i._hoverdata=[u(e,o,f.eventDataKeys)],a.click(i,n.event)),!l&&y!==!1&&!i._dragging&&!i._transitioning){r.call(`_storeDirectGUIEdit`,o,t._tracePreGUI[o.uid],{level:o.level});var b={data:[{level:_}],traces:[m.index]},x={frame:{redraw:!1,duration:f.transitionTime},transition:{duration:f.transitionTime,easing:f.transitionEasing},mode:`immediate`,fromcurrent:!0};a.loneUnhover(t._hoverlayer.node()),r.call(`animate`,i,b,x)}})};function u(e,t,n){for(var r=e.data.data,a={curveNumber:t.index,pointNumber:r.i,data:t._input,fullData:t},o=0;o<n.length;o++){var s=n[o];s in e&&(a[s]=e[s])}return`parentString`in e&&!c.isHierarchyRoot(e)&&(a.parent=e.parentString),i(a,t,r.i),a}}),vm=h(e=>{var t=S(),n=md(),r=(pm(),y(fm)).interpolate,i=tn(),a=$(),o=kt(),s=eo(),c=s.recordMinTextSize,l=s.clearMinTextSize,u=rd(),d=wn().getRotationAngle,f=u.computeTransform,p=u.transformInsideText,m=hm().styleOne,h=no().resizeText,g=_m(),_=ld(),v=gm();e.plot=function(e,n,r,i){var a=e._fullLayout,o=a._sunburstlayer,s,c,u=!r,d=!a.uniformtext.mode&&v.hasTransition(r);l(`sunburst`,a),s=o.selectAll(`g.trace.sunburst`).data(n,function(e){return e[0].trace.uid}),s.enter().append(`g`).classed(`trace`,!0).classed(`sunburst`,!0).attr(`stroke-linejoin`,`round`),s.order(),d?(i&&(c=i()),t.transition().duration(r.duration).ease(r.easing).each(`end`,function(){c&&c()}).each(`interrupt`,function(){c&&c()}).each(function(){o.selectAll(`g.trace`).each(function(t){b(e,t,this,r)})})):(s.each(function(t){b(e,t,this,r)}),a.uniformtext.mode&&h(e,a._sunburstlayer.selectAll(`.trace`),`sunburst`)),u&&s.exit().remove()};function b(n,s,l,u){var h=n._context.staticPlot,y=n._fullLayout,b=!y.uniformtext.mode&&v.hasTransition(u),S=t.select(l).selectAll(`g.slice`),T=s[0],E=T.trace,D=T.hierarchy,O=v.findEntryWithLevel(D,E.level),k=v.getMaxDepth(E),A=y._size,j=E.domain,M=A.w*(j.x[1]-j.x[0]),N=A.h*(j.y[1]-j.y[0]),P=.5*Math.min(M,N),F=T.cx=A.l+A.w*(j.x[1]+j.x[0])/2,I=T.cy=A.t+A.h*(1-j.y[0])-N/2;if(!O)return S.remove();var L=null,R={};b&&S.each(function(e){R[v.getPtId(e)]={rpx0:e.rpx0,rpx1:e.rpx1,x0:e.x0,x1:e.x1,transform:e.transform},!L&&v.isEntry(e)&&(L=e)});var z=x(O).descendants(),B=O.height+1,V=0,H=k;T.hasMultipleRoots&&v.isHierarchyRoot(O)&&(z=z.slice(1),--B,V=1,H+=1),z=z.filter(function(e){return e.y1<=H});var U=d(E.rotation);U&&z.forEach(function(e){e.x0+=U,e.x1+=U});var W=Math.min(B,k),G=function(e){return(e-V)/W*P},K=function(e,t){return[e*Math.cos(t),-e*Math.sin(t)]},q=function(e){return a.pathAnnulus(e.rpx0,e.rpx1,e.x0,e.x1,F,I)},J=function(e){return F+w(e)[0]*(e.transform.rCenter||0)+(e.transform.x||0)},Y=function(e){return I+w(e)[1]*(e.transform.rCenter||0)+(e.transform.y||0)};S=S.data(z,v.getPtId),S.enter().append(`g`).classed(`slice`,!0),b?S.exit().transition().each(function(){var e=t.select(this);e.select(`path.surface`).transition().attrTween(`d`,function(e){var t=ee(e);return function(e){return q(t(e))}}),e.select(`g.slicetext`).attr(`opacity`,0)}).remove():S.exit().remove(),S.order();var X=null;if(b&&L){var Z=v.getPtId(L);S.each(function(e){X===null&&v.getPtId(e)===Z&&(X=e.x1)})}var Q=S;b&&(Q=Q.transition().each(`end`,function(){var e=t.select(this);v.setSliceCursor(e,n,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),Q.each(function(r){var l=t.select(this),u=a.ensureSingle(l,`path`,`surface`,function(e){e.style(`pointer-events`,h?`none`:`all`)});r.rpx0=G(r.y0),r.rpx1=G(r.y1),r.xmid=(r.x0+r.x1)/2,r.pxmid=K(r.rpx1,r.xmid),r.midangle=-(r.xmid-Math.PI/2),r.startangle=-(r.x0-Math.PI/2),r.stopangle=-(r.x1-Math.PI/2),r.halfangle=.5*Math.min(a.angleDelta(r.x0,r.x1)||Math.PI,Math.PI),r.ring=1-r.rpx0/r.rpx1,r.rInscribed=C(r,E),b?u.transition().attrTween(`d`,function(e){var t=te(e);return function(e){return q(t(e))}}):u.attr(`d`,q),l.call(g,O,n,s,{eventDataKeys:_.eventDataKeys,transitionTime:_.CLICK_TRANSITION_TIME,transitionEasing:_.CLICK_TRANSITION_EASING}).call(v.setSliceCursor,n,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:n._transitioning}),u.call(m,r,E,n);var d=a.ensureSingle(l,`g`,`slicetext`),x=a.ensureSingle(d,`text`,``,function(e){e.attr(`data-notex`,1)}),S=a.ensureUniformFontSize(n,v.determineTextFont(E,r,y.font));x.text(e.formatSliceLabel(r,O,E,s,y)).classed(`slicetext`,!0).attr(`text-anchor`,`middle`).call(i.font,S).call(o.convertToTspans,n);var w=i.bBox(x.node());r.transform=p(w,r,T),r.transform.targetX=J(r),r.transform.targetY=Y(r);var D=function(e,t){var n=e.transform;return f(n,t),n.fontSize=S.size,c(E.type,n,y),a.getTextTransform(n)};b?x.transition().attrTween(`transform`,function(e){var t=ne(e);return function(e){return D(t(e),w)}}):x.attr(`transform`,D(r,w))});function ee(e){var t=v.getPtId(e),n=R[t],i=R[v.getPtId(O)],a;if(i){var o=(e.x1>i.x1?2*Math.PI:0)+U;a=e.rpx1<i.rpx1?{x0:e.x0,x1:e.x1,rpx0:0,rpx1:0}:{x0:o,x1:o,rpx0:e.rpx0,rpx1:e.rpx1}}else{var s,c=v.getPtId(e.parent);S.each(function(e){if(v.getPtId(e)===c)return s=e});var l=s.children,u;l.forEach(function(e,n){if(v.getPtId(e)===t)return u=n});var d=l.length,f=r(s.x0,s.x1);a={rpx0:P,rpx1:P,x0:f(u/d),x1:f((u+1)/d)}}return r(n,a)}function te(e){var t=R[v.getPtId(e)],n,i={x0:e.x0,x1:e.x1,rpx0:e.rpx0,rpx1:e.rpx1};if(t)n=t;else if(L)if(e.parent)if(X){var o=(e.x1>X?2*Math.PI:0)+U;n={x0:o,x1:o}}else n={rpx0:P,rpx1:P},a.extendFlat(n,re(e));else n={rpx0:0,rpx1:0};else n={x0:U,x1:U};return r(n,i)}function ne(e){var t=R[v.getPtId(e)],n,i=e.transform;if(t)n=t;else if(n={rpx1:e.rpx1,transform:{textPosAngle:i.textPosAngle,scale:0,rotate:i.rotate,rCenter:i.rCenter,x:i.x,y:i.y}},L)if(e.parent)if(X){var o=e.x1>X?2*Math.PI:0;n.x0=n.x1=o}else a.extendFlat(n,re(e));else n.x0=n.x1=U;else n.x0=n.x1=U;var s=r(n.transform.textPosAngle,e.transform.textPosAngle),l=r(n.rpx1,e.rpx1),u=r(n.x0,e.x0),d=r(n.x1,e.x1),f=r(n.transform.scale,i.scale),p=r(n.transform.rotate,i.rotate),m=i.rCenter===0?3:n.transform.rCenter===0?1/3:1,h=r(n.transform.rCenter,i.rCenter),g=function(e){return h(e**+m)};return function(e){var t=l(e),n=u(e),r=d(e),a=g(e),o={pxmid:K(t,(n+r)/2),rpx1:t,transform:{textPosAngle:s(e),rCenter:a,x:i.x,y:i.y}};return c(E.type,i,y),{transform:{targetX:J(o),targetY:Y(o),scale:f(e),rotate:p(e),rCenter:a}}}}function re(e){var t=e.parent,n=R[v.getPtId(t)],i={};if(n){var a=t.children,o=a.indexOf(e),s=a.length,c=r(n.x0,n.x1);i.x0=c(o/s),i.x1=c(o/s)}else i.x0=i.x1=0;return i}}function x(e){return n.partition().size([2*Math.PI,e.height+1])(e)}e.formatSliceLabel=function(e,t,n,r,i){var o=n.texttemplate,s=n.textinfo;if(!o&&(!s||s===`none`))return``;var c=i.separators,l=r[0],u=e.data.data,d=l.hierarchy,f=v.isHierarchyRoot(e),p=v.getParent(d,e),m=v.getValue(e);if(!o){var h=s.split(`+`),g=function(e){return h.indexOf(e)!==-1},_=[],y;if(g(`label`)&&u.label&&_.push(u.label),u.hasOwnProperty(`v`)&&g(`value`)&&_.push(v.formatValue(u.v,c)),!f){g(`current path`)&&_.push(v.getPath(e.data));var b=0;g(`percent parent`)&&b++,g(`percent entry`)&&b++,g(`percent root`)&&b++;var x=b>1;if(b){var S,C=function(e){y=v.formatPercent(S,c),x&&(y+=` of `+e),_.push(y)};g(`percent parent`)&&!f&&(S=m/v.getValue(p),C(`parent`)),g(`percent entry`)&&(S=m/v.getValue(t),C(`entry`)),g(`percent root`)&&(S=m/v.getValue(d),C(`root`))}}return g(`text`)&&(y=a.castOption(n,u.i,`text`),a.isValidTextValue(y)&&_.push(y)),_.join(`<br>`)}var w=a.castOption(n,u.i,`texttemplate`);if(!w)return``;var T={};u.label&&(T.label=u.label),u.hasOwnProperty(`v`)&&(T.value=u.v,T.valueLabel=v.formatValue(u.v,c)),T.currentPath=v.getPath(e.data),f||(T.percentParent=m/v.getValue(p),T.percentParentLabel=v.formatPercent(T.percentParent,c),T.parent=v.getPtLabel(p)),T.percentEntry=m/v.getValue(t),T.percentEntryLabel=v.formatPercent(T.percentEntry,c),T.entry=v.getPtLabel(t),T.percentRoot=m/v.getValue(d),T.percentRootLabel=v.formatPercent(T.percentRoot,c),T.root=v.getPtLabel(d),u.hasOwnProperty(`color`)&&(T.color=u.color);var E=a.castOption(n,u.i,`text`);return(a.isValidTextValue(E)||E===``)&&(T.text=E),T.customdata=a.castOption(n,u.i,`customdata`),a.texttemplateString({data:[T,n._meta],fallback:n.texttemplatefallback,labels:T,locale:i._d3locale,template:w})};function C(e){return e.rpx0===0&&a.isFullCircle([e.x0,e.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2))}function w(e){return T(e.rpx1,e.transform.textPosAngle)}function T(e,t){return[e*Math.sin(t),-e*Math.cos(t)]}}),ym=h((e,t)=>{t.exports={moduleType:`trace`,name:`sunburst`,basePlotModule:cd(),categories:[],animatable:!0,attributes:ud(),layoutAttributes:dd(),supplyDefaults:fd(),supplyLayoutDefaults:pd(),calc:hd().calc,crossTraceCalc:hd().crossTraceCalc,plot:vm().plot,style:hm().style,colorbar:gi(),meta:{}}}),bm=h((e,t)=>{t.exports=ym()}),xm=h(e=>{var t=Et();e.name=`treemap`,e.plot=function(n,r,i,a){t.plotBasePlot(e.name,n,r,i,a)},e.clean=function(n,r,i,a){t.cleanBasePlot(e.name,n,r,i,a)}}),Sm=h((e,t)=>{t.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:`poly`,eventDataKeys:[`currentPath`,`root`,`entry`,`percentRoot`,`percentEntry`,`percentParent`],gapWithPathbar:1}}),Cm=h((e,t)=>{var{hovertemplateAttrs:n,texttemplateAttrs:r,templatefallbackAttrs:i}=ze(),a=Pt(),o=Da().attributes,s=Zu(),c=ud(),l=Sm(),u=z().extendFlat,d=Le().pattern;t.exports={labels:c.labels,parents:c.parents,values:c.values,branchvalues:c.branchvalues,count:c.count,level:c.level,maxdepth:c.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:u({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:c.marker.colors,pattern:d,depthfade:{valType:`enumerated`,values:[!0,!1,`reversed`],editType:`style`},line:c.marker.line,cornerradius:{valType:`number`,min:0,dflt:0,editType:`plot`},editType:`calc`},a(`marker`,{colorAttr:`colors`,anim:!1})),pathbar:{visible:{valType:`boolean`,dflt:!0,editType:`plot`},side:{valType:`enumerated`,values:[`top`,`bottom`],dflt:`top`,editType:`plot`},edgeshape:{valType:`enumerated`,values:[`>`,`<`,`|`,`/`,`\\`],dflt:`>`,editType:`plot`},thickness:{valType:`number`,min:12,editType:`plot`},textfont:u({},s.textfont,{}),editType:`calc`},text:s.text,textinfo:c.textinfo,texttemplate:r({editType:`plot`},{keys:l.eventDataKeys.concat([`label`,`value`])}),texttemplatefallback:i({editType:`plot`}),hovertext:s.hovertext,hoverinfo:c.hoverinfo,hovertemplate:n({},{keys:l.eventDataKeys}),hovertemplatefallback:i(),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u({},s.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:s.sort,root:c.root,domain:o({name:`treemap`,trace:!0,editType:`calc`})}}),wm=h((e,t)=>{t.exports={treemapcolorway:{valType:`colorlist`,editType:`calc`},extendtreemapcolors:{valType:`boolean`,dflt:!0,editType:`calc`}}}),Tm=h((e,t)=>{var n=$(),r=Cm(),i=q(),a=Da().defaults,o=Xa().handleText,s=ui().TEXTPAD,c=Qu().handleMarkerDefaults,l=Yt(),u=l.hasColorscale,d=l.handleDefaults;t.exports=function(e,t,l,f){function p(i,a){return n.coerce(e,t,r,i,a)}var m=p(`labels`),h=p(`parents`);if(!m||!m.length||!h||!h.length){t.visible=!1;return}var g=p(`values`);g&&g.length?p(`branchvalues`):p(`count`),p(`level`),p(`maxdepth`),p(`tiling.packing`)===`squarify`&&p(`tiling.squarifyratio`),p(`tiling.flip`),p(`tiling.pad`);var _=p(`text`);p(`texttemplate`),p(`texttemplatefallback`),t.texttemplate||p(`textinfo`,n.isArrayOrTypedArray(_)?`text+label`:`label`),p(`hovertext`),p(`hovertemplate`),p(`hovertemplatefallback`);var v=p(`pathbar.visible`);o(e,t,f,p,`auto`,{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p(`textposition`);var y=t.textposition.indexOf(`bottom`)!==-1;c(e,t,f,p),(t._hasColorscale=u(e,`marker`,`colors`)||(e.marker||{}).coloraxis)?d(e,t,f,p,{prefix:`marker.`,cLetter:`c`}):p(`marker.depthfade`,!(t.marker.colors||[]).length);var b=t.textfont.size*2;p(`marker.pad.t`,y?b/4:b),p(`marker.pad.l`,b/4),p(`marker.pad.r`,b/4),p(`marker.pad.b`,y?b:b/4),p(`marker.cornerradius`),t._hovered={marker:{line:{width:2,color:i.contrast(f.paper_bgcolor)}}},v&&(p(`pathbar.thickness`,t.pathbar.textfont.size+2*s),p(`pathbar.side`),p(`pathbar.edgeshape`)),p(`sort`),p(`root.color`),a(t,f,p),t._length=null}}),Em=h((e,t)=>{var n=$(),r=wm();t.exports=function(e,t){function i(i,a){return n.coerce(e,t,r,i,a)}i(`treemapcolorway`,t.colorway),i(`extendtreemapcolors`)}}),Dm=h(e=>{var t=hd();e.calc=function(e,n){return t.calc(e,n)},e.crossTraceCalc=function(e){return t._runCrossTraceCalc(`treemap`,e)}}),Om=h((e,t)=>{t.exports=function e(t,n,r){var i;r.swapXY&&(i=t.x0,t.x0=t.y0,t.y0=i,i=t.x1,t.x1=t.y1,t.y1=i),r.flipX&&(i=t.x0,t.x0=n[0]-t.x1,t.x1=n[0]-i),r.flipY&&(i=t.y0,t.y0=n[1]-t.y1,t.y1=n[1]-i);var a=t.children;if(a)for(var o=0;o<a.length;o++)e(a[o],n,r)}}),km=h((e,t)=>{var n=md(),r=Om();t.exports=function(e,t,a){var o=a.flipX,s=a.flipY,c=a.packing===`dice-slice`,l=a.pad[s?`bottom`:`top`],u=a.pad[o?`right`:`left`],d=a.pad[o?`left`:`right`],f=a.pad[s?`top`:`bottom`],p;c&&(p=u,u=l,l=p,p=d,d=f,f=p);var m=n.treemap().tile(i(a.packing,a.squarifyratio)).paddingInner(a.pad.inner).paddingLeft(u).paddingRight(d).paddingTop(l).paddingBottom(f).size(c?[t[1],t[0]]:t)(e);return(c||o||s)&&r(m,t,{swapXY:c,flipX:o,flipY:s}),m};function i(e,t){switch(e){case`squarify`:return n.treemapSquarify.ratio(t);case`binary`:return n.treemapBinary;case`dice`:return n.treemapDice;case`slice`:return n.treemapSlice;default:return n.treemapSliceDice}}}),Am=h((e,t)=>{var n=S(),r=q(),i=$(),a=gm(),o=eo().resizeText,s=mm();function c(e){var t=e._fullLayout._treemaplayer.selectAll(`.trace`);o(e,t,`treemap`),t.each(function(t){var r=n.select(this),i=t[0].trace;r.style(`opacity`,i.opacity),r.selectAll(`path.surface`).each(function(t){n.select(this).call(l,t,i,e,{hovered:!1})})})}function l(e,t,n,o,c){var l=(c||{}).hovered,u=t.data.data,d=u.i,f,p,m=u.color,h=a.isHierarchyRoot(t),g=1;if(l)f=n._hovered.marker.line.color,p=n._hovered.marker.line.width;else if(h&&m===n.root.color)g=100,f=`rgba(0,0,0,0)`,p=0;else if(f=i.castOption(n,d,`marker.line.color`)||r.defaultLine,p=i.castOption(n,d,`marker.line.width`)||0,!n._hasColorscale&&!t.onPathbar){var _=n.marker.depthfade;if(_){var v=r.combine(r.addOpacity(n._backgroundColor,.75),m),y;if(_===!0){var b=a.getMaxDepth(n);y=isFinite(b)?a.isLeaf(t)?0:n._maxVisibleLayers-(t.data.depth-n._entryDepth):t.data.height+1}else y=t.data.depth-n._entryDepth,n._atRootLevel||y++;if(y>0)for(var x=0;x<y;x++){var S=.5*x/y;m=r.combine(r.addOpacity(v,S),m)}}}e.call(s,t,n,o,m).style(`stroke-width`,p).call(r.stroke,f).style(`opacity`,g)}t.exports={style:c,styleOne:l}}),jm=h((e,t)=>{var n=S(),r=$(),i=tn(),a=kt(),o=km(),s=Am().styleOne,c=Sm(),l=gm(),u=_m(),d=!0;t.exports=function(e,t,f,p,m){var h=m.barDifY,g=m.width,_=m.height,v=m.viewX,y=m.viewY,b=m.pathSlice,x=m.toMoveInsideSlice,S=m.strTransform,C=m.hasTransition,w=m.handleSlicesExit,T=m.makeUpdateSliceInterpolator,E=m.makeUpdateTextInterpolator,D={},O=e._context.staticPlot,k=e._fullLayout,A=t[0],j=A.trace,M=A.hierarchy,N=g/j._entryDepth,P=l.listPath(f.data,`id`),F=o(M.copy(),[g,_],{packing:`dice`,pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();F=F.filter(function(e){var t=P.indexOf(e.data.id);return t===-1?!1:(e.x0=N*t,e.x1=N*(t+1),e.y0=h,e.y1=h+_,e.onPathbar=!0,!0)}),F.reverse(),p=p.data(F,l.getPtId),p.enter().append(`g`).classed(`pathbar`,!0),w(p,d,D,[g,_],b),p.order();var I=p;C&&(I=I.transition().each(`end`,function(){var t=n.select(this);l.setSliceCursor(t,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),I.each(function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=y(o.y0),o._y1=y(o.y1),o._hoverX=v(o.x1-Math.min(g,_)/2),o._hoverY=y(o.y1-_/2);var p=n.select(this),m=r.ensureSingle(p,`path`,`surface`,function(e){e.style(`pointer-events`,O?`none`:`all`)});C?m.transition().attrTween(`d`,function(e){var t=T(e,d,D,[g,_]);return function(e){return b(t(e))}}):m.attr(`d`,b),p.call(u,f,e,t,{styleOne:s,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:e._transitioning}),m.call(s,o,j,e,{hovered:!1}),o._text=(l.getPtLabel(o)||``).split(`<br>`).join(` `)||``;var h=r.ensureSingle(p,`g`,`slicetext`),w=r.ensureSingle(h,`text`,``,function(e){e.attr(`data-notex`,1)}),A=r.ensureUniformFontSize(e,l.determineTextFont(j,o,k.font,{onPathbar:!0}));w.text(o._text||` `).classed(`slicetext`,!0).attr(`text-anchor`,`start`).call(i.font,A).call(a.convertToTspans,e),o.textBB=i.bBox(w.node()),o.transform=x(o,{fontSize:A.size,onPathbar:!0}),o.transform.fontSize=A.size,C?w.transition().attrTween(`transform`,function(e){var t=E(e,d,D,[g,_]);return function(e){return S(t(e))}}):w.attr(`transform`,S(o))})}}),Mm=h((e,t)=>{var n=S(),r=(pm(),y(fm)).interpolate,i=gm(),a=$(),o=ui().TEXTPAD,s=ro().toMoveInsideBar,c=eo().recordMinTextSize,l=Sm(),u=jm();function d(e){return i.isHierarchyRoot(e)?``:i.getPtId(e)}t.exports=function(e,t,f,p,m){var h=e._fullLayout,g=t[0],_=g.trace,v=_.type===`icicle`,y=g.hierarchy,b=i.findEntryWithLevel(y,_.level),x=n.select(f),S=x.selectAll(`g.pathbar`),C=x.selectAll(`g.slice`);if(!b){S.remove(),C.remove();return}var w=i.isHierarchyRoot(b),T=!h.uniformtext.mode&&i.hasTransition(p),E=i.getMaxDepth(_),D=function(e){return e.data.depth-b.data.depth<E},O=h._size,k=_.domain,A=O.w*(k.x[1]-k.x[0]),j=O.h*(k.y[1]-k.y[0]),M=A,N=_.pathbar.thickness,P=_.marker.line.width+l.gapWithPathbar,F=_.pathbar.visible?_.pathbar.side.indexOf(`bottom`)>-1?j+P:-(N+P):0,I={x0:M,x1:M,y0:F,y1:F+N},L=function(e,t,n){var r=_.tiling.pad,i=function(e){return e-r<=t.x0},a=function(e){return e+r>=t.x1},o=function(e){return e-r<=t.y0},s=function(e){return e+r>=t.y1};return e.x0===t.x0&&e.x1===t.x1&&e.y0===t.y0&&e.y1===t.y1?{x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1}:{x0:i(e.x0-r)?0:a(e.x0-r)?n[0]:e.x0,x1:i(e.x1+r)?0:a(e.x1+r)?n[0]:e.x1,y0:o(e.y0-r)?0:s(e.y0-r)?n[1]:e.y0,y1:o(e.y1+r)?0:s(e.y1+r)?n[1]:e.y1}},R=null,z={},B={},V=null,H=function(e,t){return t?z[d(e)]:B[d(e)]},U=function(e,t,n,r){if(t)return z[d(y)]||I;var i=B[_.level]||n;return D(e)?L(e,i,r):{}};g.hasMultipleRoots&&w&&E++,_._maxDepth=E,_._backgroundColor=h.paper_bgcolor,_._entryDepth=b.data.depth,_._atRootLevel=w;var W=-A/2+O.l+O.w*(k.x[1]+k.x[0])/2,G=-j/2+O.t+O.h*(1-(k.y[1]+k.y[0])/2),K=function(e){return W+e},q=function(e){return G+e},J=q(0),Y=K(0),X=function(e){return Y+e},Z=function(e){return J+e};function Q(e,t){return e+`,`+t}var ee=X(0),te=function(e){e.x=Math.max(ee,e.x)},ne=_.pathbar.edgeshape,re=function(e){var t=X(Math.max(Math.min(e.x0,e.x0),0)),n=X(Math.min(Math.max(e.x1,e.x1),M)),r=Z(e.y0),i=Z(e.y1),a=N/2,o={},s={};o.x=t,s.x=n,o.y=s.y=(r+i)/2;var c={x:t,y:r},l={x:n,y:r},u={x:n,y:i},d={x:t,y:i};return ne===`>`?(c.x-=a,l.x-=a,u.x-=a,d.x-=a):ne===`/`?(u.x-=a,d.x-=a,o.x-=a/2,s.x-=a/2):ne===`\\`?(c.x-=a,l.x-=a,o.x-=a/2,s.x-=a/2):ne===`<`&&(o.x-=a,s.x-=a),te(c),te(d),te(o),te(l),te(u),te(s),`M`+Q(c.x,c.y)+`L`+Q(l.x,l.y)+`L`+Q(s.x,s.y)+`L`+Q(u.x,u.y)+`L`+Q(d.x,d.y)+`L`+Q(o.x,o.y)+`Z`},ie=_[v?`tiling`:`marker`].pad,ae=function(e){return _.textposition.indexOf(e)!==-1},oe=ae(`top`),se=ae(`left`),ce=ae(`right`),le=ae(`bottom`),ue=function(e){var t=K(e.x0),n=K(e.x1),r=q(e.y0),i=q(e.y1),a=n-t,o=i-r;if(!a||!o)return``;var s=_.marker.cornerradius||0,c=Math.min(s,a/2,o/2);c&&e.data&&e.data.data&&e.data.data.label&&(oe&&(c=Math.min(c,ie.t)),se&&(c=Math.min(c,ie.l)),ce&&(c=Math.min(c,ie.r)),le&&(c=Math.min(c,ie.b)));var l=function(e,t){return c?`a`+Q(c,c)+` 0 0 1 `+Q(e,t):``};return`M`+Q(t,r+c)+l(c,-c)+`L`+Q(n-c,r)+l(c,c)+`L`+Q(n,i-c)+l(-c,c)+`L`+Q(t+c,i)+l(-c,-c)+`Z`},de=function(e,t){var n=e.x0,r=e.x1,i=e.y0,a=e.y1,l=e.textBB,u=oe||t.isHeader&&!le?`start`:le?`end`:`middle`,d=ae(`right`),f=ae(`left`)||t.onPathbar?-1:d?1:0;if(t.isHeader){if(n+=(v?ie:ie.l)-o,r-=(v?ie:ie.r)-o,n>=r){var p=(n+r)/2;n=p,r=p}var m;le?(m=a-(v?ie:ie.b),i<m&&m<a&&(i=m)):(m=i+(v?ie:ie.t),i<m&&m<a&&(a=m))}var g=s(n,r,i,a,l,{isHorizontal:!1,constrained:!0,angle:0,anchor:u,leftToRight:f});return g.fontSize=t.fontSize,g.targetX=K(g.targetX),g.targetY=q(g.targetY),isNaN(g.targetX)||isNaN(g.targetY)?{}:(n!==r&&i!==a&&c(_.type,g,h),{scale:g.scale,rotate:g.rotate,textX:g.textX,textY:g.textY,anchorX:g.anchorX,anchorY:g.anchorY,targetX:g.targetX,targetY:g.targetY})},fe=function(e,t){for(var n,r=0,i=e;!n&&r<E;)r++,i=i.parent,i?n=H(i,t):r=E;return n||{}},pe=function(e,t,n,i){var a=H(e,t),o;if(t)o=I;else{var s=H(b,t);o=s?L(e,s,i):{}}return r(a,o)},me=function(e,t,n,i,o){var s=H(e,t),c;if(s)c=s;else if(t)c=I;else if(R)if(e.parent){var l=V||n;l&&!t?c=L(e,l,i):(c={},a.extendFlat(c,fe(e,t)))}else c=a.extendFlat({},e),v&&(o.orientation===`h`?o.flipX?c.x0=e.x1:c.x1=0:o.flipY?c.y0=e.y1:c.y1=0);else c={};return r(c,{x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})},he=function(e,t,n,o){var s=H(e,t),l={},u=U(e,t,n,o);a.extendFlat(l,{transform:de({x0:u.x0,x1:u.x1,y0:u.y0,y1:u.y1,textBB:e.textBB,_text:e._text},{isHeader:i.isHeader(e,_)})}),s?l=s:e.parent&&a.extendFlat(l,fe(e,t));var d=e.transform;return e.x0!==e.x1&&e.y0!==e.y1&&c(_.type,d,h),r(l,{transform:{scale:d.scale,rotate:d.rotate,textX:d.textX,textY:d.textY,anchorX:d.anchorX,anchorY:d.anchorY,targetX:d.targetX,targetY:d.targetY}})},ge=function(e,t,r,i,a){var o=i[0],s=i[1];T?e.exit().transition().each(function(){var e=n.select(this);e.select(`path.surface`).transition().attrTween(`d`,function(e){var n=pe(e,t,r,[o,s]);return function(e){return a(n(e))}}),e.select(`g.slicetext`).attr(`opacity`,0)}).remove():e.exit().remove()},_e=function(e){var t=e.transform;return e.x0!==e.x1&&e.y0!==e.y1&&c(_.type,t,h),a.getTextTransform({textX:t.textX,textY:t.textY,anchorX:t.anchorX,anchorY:t.anchorY,targetX:t.targetX,targetY:t.targetY,scale:t.scale,rotate:t.rotate})};T&&(S.each(function(e){z[d(e)]={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1},e.transform&&(z[d(e)].transform={textX:e.transform.textX,textY:e.transform.textY,anchorX:e.transform.anchorX,anchorY:e.transform.anchorY,targetX:e.transform.targetX,targetY:e.transform.targetY,scale:e.transform.scale,rotate:e.transform.rotate})}),C.each(function(e){B[d(e)]={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1},e.transform&&(B[d(e)].transform={textX:e.transform.textX,textY:e.transform.textY,anchorX:e.transform.anchorX,anchorY:e.transform.anchorY,targetX:e.transform.targetX,targetY:e.transform.targetY,scale:e.transform.scale,rotate:e.transform.rotate}),!R&&i.isEntry(e)&&(R=e)})),V=m(e,t,b,C,{width:A,height:j,viewX:K,viewY:q,pathSlice:ue,toMoveInsideSlice:de,prevEntry:R,makeUpdateSliceInterpolator:me,makeUpdateTextInterpolator:he,handleSlicesExit:ge,hasTransition:T,strTransform:_e}),_.pathbar.visible?u(e,t,b,S,{barDifY:F,width:M,height:N,viewX:X,viewY:Z,pathSlice:re,toMoveInsideSlice:de,makeUpdateSliceInterpolator:me,makeUpdateTextInterpolator:he,handleSlicesExit:ge,hasTransition:T,strTransform:_e}):S.remove()}}),Nm=h((e,t)=>{var n=S(),r=gm(),i=eo().clearMinTextSize,a=no().resizeText,o=Mm();t.exports=function(e,t,s,c,l){var u=l.type,d=l.drawDescendants,f=e._fullLayout,p=f[`_`+u+`layer`],m,h,g=!s;i(u,f),m=p.selectAll(`g.trace.`+u).data(t,function(e){return e[0].trace.uid}),m.enter().append(`g`).classed(`trace`,!0).classed(u,!0),m.order(),!f.uniformtext.mode&&r.hasTransition(s)?(c&&(h=c()),n.transition().duration(s.duration).ease(s.easing).each(`end`,function(){h&&h()}).each(`interrupt`,function(){h&&h()}).each(function(){p.selectAll(`g.trace`).each(function(t){o(e,t,this,s,d)})})):(m.each(function(t){o(e,t,this,s,d)}),f.uniformtext.mode&&a(e,p.selectAll(`.trace`),u)),g&&m.exit().remove()}}),Pm=h((e,t)=>{var n=S(),r=$(),i=tn(),a=kt(),o=km(),s=Am().styleOne,c=Sm(),l=gm(),u=_m(),d=vm().formatSliceLabel,f=!1;t.exports=function(e,t,p,m,h){var g=h.width,_=h.height,v=h.viewX,y=h.viewY,b=h.pathSlice,x=h.toMoveInsideSlice,S=h.strTransform,C=h.hasTransition,w=h.handleSlicesExit,T=h.makeUpdateSliceInterpolator,E=h.makeUpdateTextInterpolator,D=h.prevEntry,O={},k=e._context.staticPlot,A=e._fullLayout,j=t[0].trace,M=j.textposition.indexOf(`left`)!==-1,N=j.textposition.indexOf(`right`)!==-1,P=j.textposition.indexOf(`bottom`)!==-1,F=!P&&!j.marker.pad.t||P&&!j.marker.pad.b,I=o(p,[g,_],{packing:j.tiling.packing,squarifyratio:j.tiling.squarifyratio,flipX:j.tiling.flip.indexOf(`x`)>-1,flipY:j.tiling.flip.indexOf(`y`)>-1,pad:{inner:j.tiling.pad,top:j.marker.pad.t,left:j.marker.pad.l,right:j.marker.pad.r,bottom:j.marker.pad.b}}).descendants(),L=1/0,R=-1/0;I.forEach(function(e){var t=e.depth;t>=j._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(L=Math.min(L,t),R=Math.max(R,t))}),m=m.data(I,l.getPtId),j._maxVisibleLayers=isFinite(R)?R-L+1:0,m.enter().append(`g`).classed(`slice`,!0),w(m,f,O,[g,_],b),m.order();var z=null;if(C&&D){var B=l.getPtId(D);m.each(function(e){z===null&&l.getPtId(e)===B&&(z={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})})}var V=function(){return z||{x0:0,x1:g,y0:0,y1:_}},H=m;return C&&(H=H.transition().each(`end`,function(){var t=n.select(this);l.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),H.each(function(o){var m=l.isHeader(o,j);o._x0=v(o.x0),o._x1=v(o.x1),o._y0=y(o.y0),o._y1=y(o.y1),o._hoverX=v(o.x1-j.marker.pad.r),o._hoverY=y(P?o.y1-j.marker.pad.b/2:o.y0+j.marker.pad.t/2);var h=n.select(this),w=r.ensureSingle(h,`path`,`surface`,function(e){e.style(`pointer-events`,k?`none`:`all`)});C?w.transition().attrTween(`d`,function(e){var t=T(e,f,V(),[g,_]);return function(e){return b(t(e))}}):w.attr(`d`,b),h.call(u,p,e,t,{styleOne:s,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,e,{isTransitioning:e._transitioning}),w.call(s,o,j,e,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text=``:m?o._text=F?``:l.getPtLabel(o)||``:o._text=d(o,p,j,t,A)||``;var D=r.ensureSingle(h,`g`,`slicetext`),O=r.ensureSingle(D,`text`,``,function(e){e.attr(`data-notex`,1)}),I=r.ensureUniformFontSize(e,l.determineTextFont(j,o,A.font)),L=o._text||` `,R=m&&L.indexOf(`<br>`)===-1;O.text(L).classed(`slicetext`,!0).attr(`text-anchor`,N?`end`:M||R?`start`:`middle`).call(i.font,I).call(a.convertToTspans,e),o.textBB=i.bBox(O.node()),o.transform=x(o,{fontSize:I.size,isHeader:m}),o.transform.fontSize=I.size,C?O.transition().attrTween(`transform`,function(e){var t=E(e,f,V(),[g,_]);return function(e){return S(t(e))}}):O.attr(`transform`,S(o))}),z}}),Fm=h((e,t)=>{var n=Nm(),r=Pm();t.exports=function(e,t,i,a){return n(e,t,i,a,{type:`treemap`,drawDescendants:r})}}),Im=h((e,t)=>{t.exports={moduleType:`trace`,name:`treemap`,basePlotModule:xm(),categories:[],animatable:!0,attributes:Cm(),layoutAttributes:wm(),supplyDefaults:Tm(),supplyLayoutDefaults:Em(),calc:Dm().calc,crossTraceCalc:Dm().crossTraceCalc,plot:Fm(),style:Am().style,colorbar:gi(),meta:{}}}),Lm=h((e,t)=>{t.exports=Im()}),Rm=h(e=>{var t=Et();e.name=`icicle`,e.plot=function(n,r,i,a){t.plotBasePlot(e.name,n,r,i,a)},e.clean=function(n,r,i,a){t.cleanBasePlot(e.name,n,r,i,a)}}),zm=h((e,t)=>{var{hovertemplateAttrs:n,texttemplateAttrs:r,templatefallbackAttrs:i}=ze(),a=Pt(),o=Da().attributes,s=Zu(),c=ud(),l=Cm(),u=Sm(),d=z().extendFlat,f=Le().pattern;t.exports={labels:c.labels,parents:c.parents,values:c.values,branchvalues:c.branchvalues,count:c.count,level:c.level,maxdepth:c.maxdepth,tiling:{orientation:{valType:`enumerated`,values:[`v`,`h`],dflt:`h`,editType:`plot`},flip:l.tiling.flip,pad:{valType:`number`,min:0,dflt:0,editType:`plot`},editType:`calc`},marker:d({colors:c.marker.colors,line:c.marker.line,pattern:f,editType:`calc`},a(`marker`,{colorAttr:`colors`,anim:!1})),leaf:c.leaf,pathbar:l.pathbar,text:s.text,textinfo:c.textinfo,texttemplate:r({editType:`plot`},{keys:u.eventDataKeys.concat([`label`,`value`])}),texttemplatefallback:i({editType:`plot`}),hovertext:s.hovertext,hoverinfo:c.hoverinfo,hovertemplate:n({},{keys:u.eventDataKeys}),hovertemplatefallback:i(),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:l.outsidetextfont,textposition:l.textposition,sort:s.sort,root:c.root,domain:o({name:`icicle`,trace:!0,editType:`calc`})}}),Bm=h((e,t)=>{t.exports={iciclecolorway:{valType:`colorlist`,editType:`calc`},extendiciclecolors:{valType:`boolean`,dflt:!0,editType:`calc`}}}),Vm=h((e,t)=>{var n=$(),r=zm(),i=q(),a=Da().defaults,o=Xa().handleText,s=ui().TEXTPAD,c=Qu().handleMarkerDefaults,l=Yt(),u=l.hasColorscale,d=l.handleDefaults;t.exports=function(e,t,l,f){function p(i,a){return n.coerce(e,t,r,i,a)}var m=p(`labels`),h=p(`parents`);if(!m||!m.length||!h||!h.length){t.visible=!1;return}var g=p(`values`);g&&g.length?p(`branchvalues`):p(`count`),p(`level`),p(`maxdepth`),p(`tiling.orientation`),p(`tiling.flip`),p(`tiling.pad`);var _=p(`text`);p(`texttemplate`),p(`texttemplatefallback`),t.texttemplate||p(`textinfo`,n.isArrayOrTypedArray(_)?`text+label`:`label`),p(`hovertext`),p(`hovertemplate`),p(`hovertemplatefallback`);var v=p(`pathbar.visible`);o(e,t,f,p,`auto`,{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p(`textposition`),c(e,t,f,p);var y=t._hasColorscale=u(e,`marker`,`colors`)||(e.marker||{}).coloraxis;y&&d(e,t,f,p,{prefix:`marker.`,cLetter:`c`}),p(`leaf.opacity`,y?1:.7),t._hovered={marker:{line:{width:2,color:i.contrast(f.paper_bgcolor)}}},v&&(p(`pathbar.thickness`,t.pathbar.textfont.size+2*s),p(`pathbar.side`),p(`pathbar.edgeshape`)),p(`sort`),p(`root.color`),a(t,f,p),t._length=null}}),Hm=h((e,t)=>{var n=$(),r=Bm();t.exports=function(e,t){function i(i,a){return n.coerce(e,t,r,i,a)}i(`iciclecolorway`,t.colorway),i(`extendiciclecolors`)}}),Um=h(e=>{var t=hd();e.calc=function(e,n){return t.calc(e,n)},e.crossTraceCalc=function(e){return t._runCrossTraceCalc(`icicle`,e)}}),Wm=h((e,t)=>{var n=md(),r=Om();t.exports=function(e,t,i){var a=i.flipX,o=i.flipY,s=i.orientation===`h`,c=i.maxDepth,l=t[0],u=t[1];c&&(l=(e.height+1)*t[0]/Math.min(e.height+1,c),u=(e.height+1)*t[1]/Math.min(e.height+1,c));var d=n.partition().padding(i.pad.inner).size(s?[t[1],l]:[t[0],u])(e);return(s||a||o)&&r(d,t,{swapXY:s,flipX:a,flipY:o}),d}}),Gm=h((e,t)=>{var n=S(),r=q(),i=$(),a=eo().resizeText,o=mm();function s(e){var t=e._fullLayout._iciclelayer.selectAll(`.trace`);a(e,t,`icicle`),t.each(function(t){var r=n.select(this),i=t[0].trace;r.style(`opacity`,i.opacity),r.selectAll(`path.surface`).each(function(t){n.select(this).call(c,t,i,e)})})}function c(e,t,n,a){var s=t.data.data,c=!t.children,l=s.i,u=i.castOption(n,l,`marker.line.color`)||r.defaultLine,d=i.castOption(n,l,`marker.line.width`)||0;e.call(o,t,n,a).style(`stroke-width`,d).call(r.stroke,u).style(`opacity`,c?n.leaf.opacity:null)}t.exports={style:s,styleOne:c}}),Km=h((e,t)=>{var n=S(),r=$(),i=tn(),a=kt(),o=Wm(),s=Gm().styleOne,c=Sm(),l=gm(),u=_m(),d=vm().formatSliceLabel,f=!1;t.exports=function(e,t,p,m,h){var g=h.width,_=h.height,v=h.viewX,y=h.viewY,b=h.pathSlice,x=h.toMoveInsideSlice,S=h.strTransform,C=h.hasTransition,w=h.handleSlicesExit,T=h.makeUpdateSliceInterpolator,E=h.makeUpdateTextInterpolator,D=h.prevEntry,O={},k=e._context.staticPlot,A=e._fullLayout,j=t[0].trace,M=j.textposition.indexOf(`left`)!==-1,N=j.textposition.indexOf(`right`)!==-1,P=j.textposition.indexOf(`bottom`)!==-1,F=o(p,[g,_],{flipX:j.tiling.flip.indexOf(`x`)>-1,flipY:j.tiling.flip.indexOf(`y`)>-1,orientation:j.tiling.orientation,pad:{inner:j.tiling.pad},maxDepth:j._maxDepth}).descendants(),I=1/0,L=-1/0;F.forEach(function(e){var t=e.depth;t>=j._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(I=Math.min(I,t),L=Math.max(L,t))}),m=m.data(F,l.getPtId),j._maxVisibleLayers=isFinite(L)?L-I+1:0,m.enter().append(`g`).classed(`slice`,!0),w(m,f,O,[g,_],b),m.order();var R=null;if(C&&D){var z=l.getPtId(D);m.each(function(e){R===null&&l.getPtId(e)===z&&(R={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})})}var B=function(){return R||{x0:0,x1:g,y0:0,y1:_}},V=m;return C&&(V=V.transition().each(`end`,function(){var t=n.select(this);l.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),V.each(function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=y(o.y0),o._y1=y(o.y1),o._hoverX=v(o.x1-j.tiling.pad),o._hoverY=y(P?o.y1-j.tiling.pad/2:o.y0+j.tiling.pad/2);var m=n.select(this),h=r.ensureSingle(m,`path`,`surface`,function(e){e.style(`pointer-events`,k?`none`:`all`)});C?h.transition().attrTween(`d`,function(e){var t=T(e,f,B(),[g,_],{orientation:j.tiling.orientation,flipX:j.tiling.flip.indexOf(`x`)>-1,flipY:j.tiling.flip.indexOf(`y`)>-1});return function(e){return b(t(e))}}):h.attr(`d`,b),m.call(u,p,e,t,{styleOne:s,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,e,{isTransitioning:e._transitioning}),h.call(s,o,j,e,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text=``:o._text=d(o,p,j,t,A)||``;var w=r.ensureSingle(m,`g`,`slicetext`),D=r.ensureSingle(w,`text`,``,function(e){e.attr(`data-notex`,1)}),O=r.ensureUniformFontSize(e,l.determineTextFont(j,o,A.font));D.text(o._text||` `).classed(`slicetext`,!0).attr(`text-anchor`,N?`end`:M?`start`:`middle`).call(i.font,O).call(a.convertToTspans,e),o.textBB=i.bBox(D.node()),o.transform=x(o,{fontSize:O.size}),o.transform.fontSize=O.size,C?D.transition().attrTween(`transform`,function(e){var t=E(e,f,B(),[g,_]);return function(e){return S(t(e))}}):D.attr(`transform`,S(o))}),R}}),qm=h((e,t)=>{var n=Nm(),r=Km();t.exports=function(e,t,i,a){return n(e,t,i,a,{type:`icicle`,drawDescendants:r})}}),Jm=h((e,t)=>{t.exports={moduleType:`trace`,name:`icicle`,basePlotModule:Rm(),categories:[],animatable:!0,attributes:zm(),layoutAttributes:Bm(),supplyDefaults:Vm(),supplyLayoutDefaults:Hm(),calc:Um().calc,crossTraceCalc:Um().crossTraceCalc,plot:qm(),style:Gm().style,colorbar:gi(),meta:{}}}),Ym=h((e,t)=>{t.exports=Jm()}),Xm=h(e=>{var t=Et();e.name=`funnelarea`,e.plot=function(n,r,i,a){t.plotBasePlot(e.name,n,r,i,a)},e.clean=function(n,r,i,a){t.cleanBasePlot(e.name,n,r,i,a)}}),Zm=h((e,t)=>{var n=Zu(),r=W(),i=Da().attributes,{hovertemplateAttrs:a,texttemplateAttrs:o,templatefallbackAttrs:s}=ze(),c=z().extendFlat;t.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:c({},n.marker.line.color,{dflt:null}),width:c({},n.marker.line.width,{dflt:1}),editType:`calc`},pattern:n.marker.pattern,editType:`calc`},text:n.text,hovertext:n.hovertext,scalegroup:c({},n.scalegroup,{}),textinfo:c({},n.textinfo,{flags:[`label`,`text`,`value`,`percent`]}),texttemplate:o({editType:`plot`},{keys:[`label`,`color`,`value`,`text`,`percent`]}),texttemplatefallback:s({editType:`plot`}),hoverinfo:c({},r.hoverinfo,{flags:[`label`,`text`,`value`,`percent`,`name`]}),hovertemplate:a({},{keys:[`label`,`color`,`value`,`text`,`percent`]}),hovertemplatefallback:s(),textposition:c({},n.textposition,{values:[`inside`,`none`],dflt:`inside`}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:c({},n.title.position,{values:[`top left`,`top center`,`top right`],dflt:`top center`}),editType:`plot`},domain:i({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`}}}),Qm=h((e,t)=>{t.exports={hiddenlabels:$u().hiddenlabels,funnelareacolorway:{valType:`colorlist`,editType:`calc`},extendfunnelareacolors:{valType:`boolean`,dflt:!0,editType:`calc`}}}),$m=h((e,t)=>{var n=$(),r=Zm(),i=Da().defaults,a=Xa().handleText,o=Qu().handleLabelsAndValues,s=Qu().handleMarkerDefaults;t.exports=function(e,t,c,l){function u(i,a){return n.coerce(e,t,r,i,a)}var d=o(u(`labels`),u(`values`)),f=d.len;if(t._hasLabels=d.hasLabels,t._hasValues=d.hasValues,!t._hasLabels&&t._hasValues&&(u(`label0`),u(`dlabel`)),!f){t.visible=!1;return}t._length=f,s(e,t,l,u),u(`scalegroup`);var p=u(`text`),m=u(`texttemplate`);u(`texttemplatefallback`);var h;m||(h=u(`textinfo`,Array.isArray(p)?`text+percent`:`percent`)),u(`hovertext`),u(`hovertemplate`),u(`hovertemplatefallback`),m||h&&h!==`none`?a(e,t,l,u,u(`textposition`),{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}):h===`none`&&u(`textposition`,`none`),i(t,l,u),u(`title.text`)&&(u(`title.position`),n.coerceFont(u,`title.font`,l.font)),u(`aspectratio`),u(`baseratio`)}}),eh=h((e,t)=>{var n=$(),r=Qm();t.exports=function(e,t){function i(i,a){return n.coerce(e,t,r,i,a)}i(`hiddenlabels`),i(`funnelareacolorway`,t.colorway),i(`extendfunnelareacolors`)}}),th=h((e,t)=>{var n=td();function r(e,t){return n.calc(e,t)}function i(e){n.crossTraceCalc(e,{type:`funnelarea`})}t.exports={calc:r,crossTraceCalc:i}}),nh=h((e,t)=>{var n=S(),r=tn(),i=$(),a=i.strScale,o=i.strTranslate,s=kt(),c=ro().toMoveInsideBar,l=eo(),u=l.recordMinTextSize,d=l.clearMinTextSize,f=wn(),p=rd(),m=p.attachFxHandlers,h=p.determineInsideTextFont,g=p.layoutAreas,_=p.prerenderTitles,v=p.positionTitleOutside,y=p.formatSliceLabel;t.exports=function(e,t){var l=e._context.staticPlot,p=e._fullLayout;d(`funnelarea`,p),_(t,e),g(t,p._size),i.makeTraceGroups(p._funnelarealayer,t,`trace`).each(function(t){var d=n.select(this),g=t[0],_=g.trace;C(t),d.each(function(){var d=n.select(this).selectAll(`g.slice`).data(t);d.enter().append(`g`).classed(`slice`,!0),d.exit().remove(),d.each(function(a,o){if(a.hidden){n.select(this).selectAll(`path,g`).remove();return}a.pointNumber=a.i,a.curveNumber=_.index;var d=g.cx,v=g.cy,x=n.select(this),S=x.selectAll(`path.surface`).data([a]);S.enter().append(`path`).classed(`surface`,!0).style({"pointer-events":l?`none`:`all`}),x.call(m,e,t);var C=`M`+(d+a.TR[0])+`,`+(v+a.TR[1])+b(a.TR,a.BR)+b(a.BR,a.BL)+b(a.BL,a.TL)+`Z`;S.attr(`d`,C),y(e,a,g);var w=f.castOption(_.textposition,a.pts),T=x.selectAll(`g.slicetext`).data(a.text&&w!==`none`?[0]:[]);T.enter().append(`g`).classed(`slicetext`,!0),T.exit().remove(),T.each(function(){var l=i.ensureSingle(n.select(this),`text`,``,function(e){e.attr(`data-notex`,1)}),f=i.ensureUniformFontSize(e,h(_,a,p.font));l.text(a.text).attr({class:`slicetext`,transform:``,"text-anchor":`middle`}).call(r.font,f).call(s.convertToTspans,e);var m=r.bBox(l.node()),g,y,b,x=Math.min(a.BL[1],a.BR[1])+v,S=Math.max(a.TL[1],a.TR[1])+v;y=Math.max(a.TL[0],a.BL[0])+d,b=Math.min(a.TR[0],a.BR[0])+d,g=c(y,b,x,S,m,{isHorizontal:!0,constrained:!0,angle:0,anchor:`middle`}),g.fontSize=f.size,u(_.type,g,p),t[o].transform=g,i.setTransormAndDisplay(l,g)})});var x=n.select(this).selectAll(`g.titletext`).data(_.title.text?[0]:[]);x.enter().append(`g`).classed(`titletext`,!0),x.exit().remove(),x.each(function(){var t=i.ensureSingle(n.select(this),`text`,``,function(e){e.attr(`data-notex`,1)}),c=_.title.text;_._meta&&(c=i.templateString(c,_._meta)),t.text(c).attr({class:`titletext`,transform:``,"text-anchor":`middle`}).call(r.font,_.title.font).call(s.convertToTspans,e);var l=v(g,p._size);t.attr(`transform`,o(l.x,l.y)+a(Math.min(1,l.scale))+o(l.tx,l.ty))})})})};function b(e,t){var n=t[0]-e[0],r=t[1]-e[1];return`l`+n+`,`+r}function x(e,t){return[.5*(e[0]+t[0]),.5*(e[1]+t[1])]}function C(e){if(!e.length)return;var t=e[0],n=t.trace,r=n.aspectratio,i=n.baseratio;i>.999&&(i=.999);var a=i**2,o=t.vTotal,s=o*a/(1-a),c=o,l=s/o;function u(){var e=Math.sqrt(l);return{x:e,y:-e}}function d(){var e=u();return[e.x,e.y]}var f,p=[];p.push(d());var m,h;for(m=e.length-1;m>-1;m--)if(h=e[m],!h.hidden){var g=h.v/c;l+=g,p.push(d())}var _=1/0,v=-1/0;for(m=0;m<p.length;m++)f=p[m],_=Math.min(_,f[1]),v=Math.max(v,f[1]);for(m=0;m<p.length;m++)p[m][1]-=(v+_)/2;var y=p[p.length-1][0],b=t.r,S=(v-_)/2,C=b/y,w=b/S*r;for(t.r=w*S,m=0;m<p.length;m++)p[m][0]*=C,p[m][1]*=w;f=p[0];var T=[-f[0],f[1]],E=[f[0],f[1]],D=0;for(m=e.length-1;m>-1;m--)if(h=e[m],!h.hidden){D+=1;var O=p[D][0],k=p[D][1];h.TL=[-O,k],h.TR=[O,k],h.BL=T,h.BR=E,h.pxmid=x(h.TR,h.BR),T=h.TL,E=h.TR}}}),rh=h((e,t)=>{var n=S(),r=En(),i=eo().resizeText;t.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(`.trace`);i(e,t,`funnelarea`),t.each(function(t){var i=t[0].trace,a=n.select(this);a.style({opacity:i.opacity}),a.selectAll(`path.surface`).each(function(t){n.select(this).call(r,t,i,e)})})}}),ih=h((e,t)=>{t.exports={moduleType:`trace`,name:`funnelarea`,basePlotModule:Xm(),categories:[`pie-like`,`funnelarea`,`showLegend`],attributes:Zm(),layoutAttributes:Qm(),supplyDefaults:$m(),supplyLayoutDefaults:eh(),calc:th().calc,crossTraceCalc:th().crossTraceCalc,plot:nh(),style:rh(),styleOne:En(),meta:{}}}),ah=h((e,t)=>{t.exports=ih()}),oh=h((e,t)=>{(function(){var e={1964:function(e,t,n){e.exports={alpha_shape:n(3502),convex_hull:n(7352),delaunay_triangulate:n(7642),gl_cone3d:n(6405),gl_error3d:n(9165),gl_line3d:n(5714),gl_mesh3d:n(7201),gl_plot3d:n(4100),gl_scatter3d:n(8418),gl_streamtube3d:n(7815),gl_surface3d:n(9499),ndarray:n(9618),ndarray_linear_interpolate:n(4317)}},4793:function(e,t,n){function r(e){"@babel/helpers - typeof";return r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},r(e)}var i=n(7507),a=n(3778),o=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;t.hp=u,t.IS=50;var s=2147483647;u.TYPED_ARRAY_SUPPORT=c(),!u.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,`parent`,{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,`offset`,{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function l(e){if(e>s)throw RangeError(`The value "`+e+`" is invalid for option "size"`);var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return m(e)}return d(e,t,n)}u.poolSize=8192;function d(e,t,n){if(typeof e==`string`)return h(e,t);if(ArrayBuffer.isView(e))return _(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+r(e));if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return v(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);var i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return u.from(i,t,n);var a=y(e);if(a)return a;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return u.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+r(e))}u.from=function(e,t,n){return d(e,t,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function f(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function p(e,t,n){return f(e),e<=0||t===void 0?l(e):typeof n==`string`?l(e).fill(t,n):l(e).fill(t)}u.alloc=function(e,t,n){return p(e,t,n)};function m(e){return f(e),l(e<0?0:b(e)|0)}u.allocUnsafe=function(e){return m(e)},u.allocUnsafeSlow=function(e){return m(e)};function h(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!u.isEncoding(t))throw TypeError(`Unknown encoding: `+t);var n=x(e,t)|0,r=l(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function g(e){for(var t=e.length<0?0:b(e.length)|0,n=l(t),r=0;r<t;r+=1)n[r]=e[r]&255;return n}function _(e){if(Z(e,Uint8Array)){var t=new Uint8Array(e);return v(t.buffer,t.byteOffset,t.byteLength)}return g(e)}function v(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);var r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,u.prototype),r}function y(e){if(u.isBuffer(e)){var t=b(e.length)|0,n=l(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||Q(e.length)?l(0):g(e);if(e.type===`Buffer`&&Array.isArray(e.data))return g(e.data)}function b(e){if(e>=s)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+s.toString(16)+` bytes`);return e|0}u.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==u.prototype},u.compare=function(e,t){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).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}},u.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return u.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(Z(a,Uint8Array))i+a.length>r.length?u.from(a).copy(r,i):Uint8Array.prototype.set.call(r,a,i);else if(u.isBuffer(a))a.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=a.length}return r};function x(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+r(e));var n=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&n===0)return 0;for(var a=!1;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return K(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return Y(e).length;default:if(a)return i?-1:K(e).length;t=(``+t).toLowerCase(),a=!0}}u.byteLength=x;function S(e,t,n){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return L(this,t,n);case`utf8`:case`utf-8`:return M(this,t,n);case`ascii`:return F(this,t,n);case`latin1`:case`binary`:return I(this,t,n);case`base64`:return j(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return R(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}u.prototype._isBuffer=!0;function C(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(var t=0;t<e;t+=2)C(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(var t=0;t<e;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(var t=0;t<e;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this},u.prototype.toString=function(){var e=this.length;return e===0?``:arguments.length===0?M(this,0,e):S.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:u.compare(this,e)===0},u.prototype.inspect=function(){var e=``,n=t.IS;return e=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(e+=` ... `),`<Buffer `+e+`>`},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,n,i,a){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+r(e));if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),t<0||n>e.length||i<0||a>this.length)throw RangeError(`out of range index`);if(i>=a&&t>=n)return 0;if(i>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var o=a-i,s=n-t,c=Math.min(o,s),l=this.slice(i,a),d=e.slice(t,n),f=0;f<c;++f)if(l[f]!==d[f]){o=l[f],s=d[f];break}return o<s?-1:s<o?1:0};function w(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Q(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=u.from(t,r)),u.isBuffer(t))return t.length===0?-1:T(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):T(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function T(e,t,n,r,i){var a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}var l;if(i){var u=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,u===-1?0:l-u)){if(u===-1&&(u=l),l-u+1===s)return u*a}else u!==-1&&(l-=l-u),u=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){for(var d=!0,f=0;f<s;f++)if(c(e,l+f)!==c(t,f)){d=!1;break}if(d)return l}return-1}u.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},u.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)};function E(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(o*2,2),16);if(Q(s))return o;e[n+o]=s}return o}function D(e,t,n,r){return X(K(t,e.length-n),e,n,r)}function O(e,t,n,r){return X(q(t),e,n,r)}function k(e,t,n,r){return X(Y(t),e,n,r)}function A(e,t,n,r){return X(J(t,e.length-n),e,n,r)}u.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);var i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;for(var a=!1;;)switch(r){case`hex`:return E(this,e,t,n);case`utf8`:case`utf-8`:return D(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return O(this,e,t,n);case`base64`:return k(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return A(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function j(e,t,n){return t===0&&n===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,n))}function M(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=n){var c,l,u,d;switch(s){case 1:a<128&&(o=a);break;case 2:c=e[i+1],(c&192)==128&&(d=(a&31)<<6|c&63,d>127&&(o=d));break;case 3:c=e[i+1],l=e[i+2],(c&192)==128&&(l&192)==128&&(d=(a&15)<<12|(c&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:c=e[i+1],l=e[i+2],u=e[i+3],(c&192)==128&&(l&192)==128&&(u&192)==128&&(d=(a&15)<<18|(c&63)<<12|(l&63)<<6|u&63,d>65535&&d<1114112&&(o=d))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),i+=s}return P(r)}var N=4096;function P(e){var t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);for(var n=``,r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=N));return n}function F(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function I(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function L(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i=``,a=t;a<n;++a)i+=ee[e[a]];return i}function R(e,t,n){for(var r=e.slice(t,n),i=``,a=0;a<r.length-1;a+=2)i+=String.fromCharCode(r[a]+r[a+1]*256);return i}u.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,u.prototype),r};function z(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||z(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},u.prototype.readInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||z(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||z(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||z(e,4,this.length),a.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||z(e,4,this.length),a.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||z(e,8,this.length),a.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||z(e,8,this.length),a.read(this,e,!1,52,8)};function B(e,t,n,r,i,a){if(!u.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var i=2**(8*n)-1;B(this,e,t,n,i,0)}var a=1,o=0;for(this[t]=e&255;++o<n&&(a*=256);)this[t+o]=e/a&255;return t+n},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var i=2**(8*n)-1;B(this,e,t,n,i,0)}var a=n-1,o=1;for(this[t+a]=e&255;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,255,0),this[t]=e&255,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);B(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=e&255;++a<n&&(o*=256);)e<0&&s===0&&this[t+a-1]!==0&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);B(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=e&255;--a>=0&&(o*=256);)e<0&&s===0&&this[t+a+1]!==0&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function V(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function H(e,t,n,r,i){return t=+t,n>>>=0,i||V(e,t,n,4,34028234663852886e22,-34028234663852886e22),a.write(e,t,n,r,23,4),n+4}u.prototype.writeFloatLE=function(e,t,n){return H(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return H(this,e,t,!1,n)};function U(e,t,n,r,i){return t=+t,n>>>=0,i||V(e,t,n,8,17976931348623157e292,-17976931348623157e292),a.write(e,t,n,r,52,8),n+8}u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},u.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!u.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){var i=e.charCodeAt(0);(r===`utf8`&&i<128||r===`latin1`)&&(e=i)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;var a;if(typeof e==`number`)for(a=t;a<n;++a)this[a]=e;else{var o=u.isBuffer(e)?e:u.from(e,r),s=o.length;if(s===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var W=/[^+/0-9A-Za-z-_]/g;function G(e){if(e=e.split(`=`)[0],e=e.trim().replace(W,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function K(e,t){t||=1/0;for(var n,r=e.length,i=null,a=[],o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function q(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function J(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function Y(e){return i.toByteArray(G(e))}function X(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Z(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Q(e){return e!==e}var ee=function(){for(var e=`0123456789abcdef`,t=Array(256),n=0;n<16;++n)for(var r=n*16,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},9216:function(e){e.exports=i,e.exports.isMobile=i,e.exports.default=i;var t=/(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,n=/CrOS/,r=/android|ipad|playbook|silk/i;function i(e){e||={};var i=e.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 a=t.test(i)&&!n.test(i)||!!e.tablet&&r.test(i);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&i.indexOf(`Macintosh`)!==-1&&i.indexOf(`Safari`)!==-1&&(a=!0),a}},6296:function(e,t,n){e.exports=c;var r=n(7261),i=n(9977),a=n(1811);function o(e,t){this._controllerNames=Object.keys(e),this._controllerList=this._controllerNames.map(function(t){return e[t]}),this._mode=t,this._active=e[t],this._active||=(this._mode=`turntable`,e.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=o.prototype;s.flush=function(e){for(var t=this._controllerList,n=0;n<t.length;++n)t[n].flush(e)},s.idle=function(e){for(var t=this._controllerList,n=0;n<t.length;++n)t[n].idle(e)},s.lookAt=function(e,t,n,r){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].lookAt(e,t,n,r)},s.rotate=function(e,t,n,r){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].rotate(e,t,n,r)},s.pan=function(e,t,n,r){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].pan(e,t,n,r)},s.translate=function(e,t,n,r){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].translate(e,t,n,r)},s.setMatrix=function(e,t){for(var n=this._controllerList,r=0;r<n.length;++r)n[r].setMatrix(e,t)},s.setDistanceLimits=function(e,t){for(var n=this._controllerList,r=0;r<n.length;++r)n[r].setDistanceLimits(e,t)},s.setDistance=function(e,t){for(var n=this._controllerList,r=0;r<n.length;++r)n[r].setDistance(e,t)},s.recalcMatrix=function(e){this._active.recalcMatrix(e)},s.getDistance=function(e){return this._active.getDistance(e)},s.getDistanceLimits=function(e){return this._active.getDistanceLimits(e)},s.lastT=function(){return this._active.lastT()},s.setMode=function(e){if(e!==this._mode){var t=this._controllerNames.indexOf(e);if(!(t<0)){var n=this._active,r=this._controllerList[t],i=Math.max(n.lastT(),r.lastT());n.recalcMatrix(i),r.setMatrix(i,n.computedMatrix),this._active=r,this._mode=e,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 c(e){e||={};var t=e.eye||[0,0,1],n=e.center||[0,0,0],s=e.up||[0,1,0],c=e.distanceLimits||[0,1/0],l=e.mode||`turntable`,u=r(),d=i(),f=a();return u.setDistanceLimits(c[0],c[1]),u.lookAt(0,t,n,s),d.setDistanceLimits(c[0],c[1]),d.lookAt(0,t,n,s),f.setDistanceLimits(c[0],c[1]),f.lookAt(0,t,n,s),new o({turntable:u,orbit:d,matrix:f},l)}},7169:function(e,t,n){var r=typeof WeakMap>`u`?n(1538):WeakMap,i=n(2762),a=n(8116),o=new r;function s(e){var t=o.get(e),n=t&&(t._triangleBuffer.handle||t._triangleBuffer.buffer);if(!n||!e.isBuffer(n)){var r=i(e,new Float32Array([-1,-1,-1,4,4,-1]));t=a(e,[{buffer:r,type:e.FLOAT,size:2}]),t._triangleBuffer=r,o.set(e,t)}t.bind(),e.drawArrays(e.TRIANGLES,0,3),t.unbind()}e.exports=s},1085:function(e,t,n){var r=n(1371);e.exports=i;function i(e,t,n){t=typeof t==`number`?t:1,n||=`: `;var i=e.split(/\r?\n/),a=String(i.length+t-1).length;return i.map(function(e,i){var o=i+t,s=String(o).length;return r(o,a-s)+n+e}).join(`
`)}},3952:function(e,t,n){e.exports=a;var r=n(3250);function i(e,t){for(var n=Array(t+1),i=0;i<e.length;++i)n[i]=e[i];for(var i=0;i<=e.length;++i){for(var a=e.length;a<=t;++a){for(var o=Array(t),s=0;s<t;++s)o[s]=(a+1-i)**+s;n[a]=o}if(r.apply(void 0,n))return!0}return!1}function a(e){var t=e.length;if(t===0)return[];if(t===1)return[0];for(var n=e[0].length,r=[e[0]],a=[0],o=1;o<t;++o){if(r.push(e[o]),!i(r,n)){r.pop();continue}if(a.push(o),a.length===n+1)return a}return a}},5995:function(e,t,n){e.exports=a;var r=n(7642),i=n(6037);function a(e,t){return r(t).filter(function(n){for(var r=Array(n.length),a=0;a<n.length;++a)r[a]=t[n[a]];return i(r)*e<1})}},3502:function(e,t,n){e.exports=a;var r=n(5995),i=n(9127);function a(e,t){return i(r(e,t))}},6468:function(e){e.exports=function(e){return atob(e)}},2642:function(e,t,n){e.exports=a;var r=n(727);function i(e){for(var t=0,n=0;n<e.length;++n)t+=e[n];return t}function a(e,t){for(var n=t.length,a=Array(n+1),o=0;o<n;++o){for(var s=Array(n+1),c=0;c<=n;++c)s[c]=e[c][o];a[o]=s}a[n]=Array(n+1);for(var o=0;o<=n;++o)a[n][o]=1;for(var l=Array(n+1),o=0;o<n;++o)l[o]=t[o];l[n]=1;var u=r(a,l),d=i(u[n+1]);d===0&&(d=1);for(var f=Array(n+1),o=0;o<=n;++o)f[o]=i(u[o])/d;return f}},7507:function(e,t){t.byteLength=l,t.toByteArray=d,t.fromByteArray=m;for(var n=[],r=[],i=typeof Uint8Array<`u`?Uint8Array:Array,a=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,o=0,s=a.length;o<s;++o)n[o]=a[o],r[a.charCodeAt(o)]=o;r[45]=62,r[95]=63;function c(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function l(e){var t=c(e),n=t[0],r=t[1];return(n+r)*3/4-r}function u(e,t,n){return(t+n)*3/4-n}function d(e){var t,n=c(e),a=n[0],o=n[1],s=new i(u(e,a,o)),l=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=r[e.charCodeAt(f)]<<18|r[e.charCodeAt(f+1)]<<12|r[e.charCodeAt(f+2)]<<6|r[e.charCodeAt(f+3)],s[l++]=t>>16&255,s[l++]=t>>8&255,s[l++]=t&255;return o===2&&(t=r[e.charCodeAt(f)]<<2|r[e.charCodeAt(f+1)]>>4,s[l++]=t&255),o===1&&(t=r[e.charCodeAt(f)]<<10|r[e.charCodeAt(f+1)]<<4|r[e.charCodeAt(f+2)]>>2,s[l++]=t>>8&255,s[l++]=t&255),s}function f(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[e&63]}function p(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(f(r));return i.join(``)}function m(e){for(var t,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(p(e,s,s+o>c?c:s+o));return i===1?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+`==`)):i===2&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+`=`)),a.join(``)}},3865:function(e,t,n){var r=n(869);e.exports=i;function i(e,t){return r(e[0].mul(t[1]).add(t[0].mul(e[1])),e[1].mul(t[1]))}},1318:function(e){e.exports=t;function t(e,t){return e[0].mul(t[1]).cmp(t[0].mul(e[1]))}},8697:function(e,t,n){var r=n(869);e.exports=i;function i(e,t){return r(e[0].mul(t[1]),e[1].mul(t[0]))}},7842:function(e,t,n){var r=n(6330),i=n(1533),a=n(2651),o=n(6768),s=n(869),c=n(8697);e.exports=l;function l(e,t){if(r(e))return t?c(e,l(t)):[e[0].clone(),e[1].clone()];var n=0,u,d;if(i(e))u=e.clone();else if(typeof e==`string`)u=o(e);else{if(e===0)return[a(0),a(1)];if(e===Math.floor(e))u=a(e);else{for(;e!==Math.floor(e);)e*=2**256,n-=256;u=a(e)}}if(r(t))u.mul(t[1]),d=t[0].clone();else if(i(t))d=t.clone();else if(typeof t==`string`)d=o(t);else if(!t)d=a(1);else if(t===Math.floor(t))d=a(t);else{for(;t!==Math.floor(t);)t*=2**256,n+=256;d=a(t)}return n>0?u=u.ushln(n):n<0&&(d=d.ushln(-n)),s(u,d)}},6330:function(e,t,n){var r=n(1533);e.exports=i;function i(e){return Array.isArray(e)&&e.length===2&&r(e[0])&&r(e[1])}},5716:function(e,t,n){var r=n(6859);e.exports=i;function i(e){return e.cmp(new r(0))}},1369:function(e,t,n){var r=n(5716);e.exports=i;function i(e){var t=e.length,n=e.words,i=0;if(t===1)i=n[0];else if(t===2)i=n[0]+n[1]*67108864;else for(var a=0;a<t;a++){var o=n[a];i+=o*67108864**a}return r(e)*i}},4025:function(e,t,n){var r=n(2361),i=n(8828).countTrailingZeros;e.exports=a;function a(e){var t=i(r.lo(e));if(t<32)return t;var n=i(r.hi(e));return n>20?52:n+32}},1533:function(e,t,n){n(6859),e.exports=r;function r(e){return e&&typeof e==`object`&&!!e.words}},2651:function(e,t,n){var r=n(6859),i=n(2361);e.exports=a;function a(e){var t=i.exponent(e);return t<52?new r(e):new r(e*2**(52-t)).ushln(t-52)}},869:function(e,t,n){var r=n(2651),i=n(5716);e.exports=a;function a(e,t){var n=i(e),a=i(t);if(n===0)return[r(0),r(1)];if(a===0)return[r(0),r(0)];a<0&&(e=e.neg(),t=t.neg());var o=e.gcd(t);return o.cmpn(1)?[e.div(o),t.div(o)]:[e,t]}},6768:function(e,t,n){var r=n(6859);e.exports=i;function i(e){return new r(e)}},6504:function(e,t,n){var r=n(869);e.exports=i;function i(e,t){return r(e[0].mul(t[0]),e[1].mul(t[1]))}},7721:function(e,t,n){var r=n(5716);e.exports=i;function i(e){return r(e[0])*r(e[1])}},5572:function(e,t,n){var r=n(869);e.exports=i;function i(e,t){return r(e[0].mul(t[1]).sub(e[1].mul(t[0])),e[1].mul(t[1]))}},946:function(e,t,n){var r=n(1369),i=n(4025);e.exports=a;function a(e){var t=e[0],n=e[1];if(t.cmpn(0)===0)return 0;var a=t.abs().divmod(n.abs()),o=a.div,s=r(o),c=a.mod,l=t.negative===n.negative?1:-1;if(c.cmpn(0)===0)return l*s;if(s){var u=i(s)+4,d=r(c.ushln(u).divRound(n));return l*(s+d*2**-u)}else{var f=n.bitLength()-c.bitLength()+53,d=r(c.ushln(f).divRound(n));return f<1023?l*d*2**-f:(d*=2**-1023,l*d*2**(1023-f))}}},2478:function(e){function t(e,t,n,r,i){for(var a=i+1;r<=i;){var o=r+i>>>1,s=e[o];(n===void 0?s-t:n(s,t))>=0?(a=o,i=o-1):r=o+1}return a}function n(e,t,n,r,i){for(var a=i+1;r<=i;){var o=r+i>>>1,s=e[o];(n===void 0?s-t:n(s,t))>0?(a=o,i=o-1):r=o+1}return a}function r(e,t,n,r,i){for(var a=r-1;r<=i;){var o=r+i>>>1,s=e[o];(n===void 0?s-t:n(s,t))<0?(a=o,r=o+1):i=o-1}return a}function i(e,t,n,r,i){for(var a=r-1;r<=i;){var o=r+i>>>1,s=e[o];(n===void 0?s-t:n(s,t))<=0?(a=o,r=o+1):i=o-1}return a}function a(e,t,n,r,i){for(;r<=i;){var a=r+i>>>1,o=e[a],s=n===void 0?o-t:n(o,t);if(s===0)return a;s<=0?r=a+1:i=a-1}return-1}function o(e,t,n,r,i,a){return typeof n==`function`?a(e,t,n,r===void 0?0:r|0,i===void 0?e.length-1:i|0):a(e,t,void 0,n===void 0?0:n|0,r===void 0?e.length-1:r|0)}e.exports={ge:function(e,n,r,i,a){return o(e,n,r,i,a,t)},gt:function(e,t,r,i,a){return o(e,t,r,i,a,n)},lt:function(e,t,n,i,a){return o(e,t,n,i,a,r)},le:function(e,t,n,r,a){return o(e,t,n,r,a,i)},eq:function(e,t,n,r,i){return o(e,t,n,r,i,a)}}},8828:function(e,t){"use restrict";var n=32;t.INT_BITS=n,t.INT_MAX=2147483647,t.INT_MIN=-1<<n-1,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>n-1;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e<t)},t.max=function(e,t){return e^(e^t)&-(e<t)},t.isPow2=function(e){return!(e&e-1)&&!!e},t.log2=function(e){var t,n;return t=(e>65535)<<4,e>>>=t,n=(e>255)<<3,e>>>=n,t|=n,n=(e>15)<<2,e>>>=n,t|=n,n=(e>3)<<1,e>>>=n,t|=n,t|e>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return e-=e>>>1&1431655765,e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24};function r(e){var t=32;return e&=-e,e&&t--,e&65535&&(t-=16),e&16711935&&(t-=8),e&252645135&&(t-=4),e&858993459&&(t-=2),e&1431655765&&--t,t}t.countTrailingZeros=r,t.nextPow2=function(e){return e+=e===0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,e&=15,27030>>>e&1};var i=Array(256);(function(e){for(var t=0;t<256;++t){var n=t,r=t,i=7;for(n>>>=1;n;n>>>=1)r<<=1,r|=n&1,--i;e[t]=r<<i&255}})(i),t.reverse=function(e){return i[e&255]<<24|i[e>>>8&255]<<16|i[e>>>16&255]<<8|i[e>>>24&255]},t.interleave2=function(e,t){return e&=65535,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t&=65535,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1},t.deinterleave2=function(e,t){return e=e>>>t&1431655765,e=(e|e>>>1)&858993459,e=(e|e>>>2)&252645135,e=(e|e>>>4)&16711935,e=(e|e>>>16)&65535,e<<16>>16},t.interleave3=function(e,t,n){return e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,t&=1023,t=(t|t<<16)&4278190335,t=(t|t<<8)&251719695,t=(t|t<<4)&3272356035,t=(t|t<<2)&1227133513,e|=t<<1,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,e|n<<2},t.deinterleave3=function(e,t){return e=e>>>t&1227133513,e=(e|e>>>2)&3272356035,e=(e|e>>>4)&251719695,e=(e|e>>>8)&4278190335,e=(e|e>>>16)&1023,e<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},6859:function(e,t,n){e=n.nmd(e),function(e,t){function r(e,t){if(!e)throw Error(t||`Assertion failed`)}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function a(e,t,n){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,e!==null&&((t===`le`||t===`be`)&&(n=t,t=10),this._init(e||0,t||10,n||`be`))}typeof e==`object`?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var o;try{o=typeof window<`u`&&window.Buffer!==void 0?window.Buffer:n(7790).Buffer}catch{}a.isBN=function(e){return e instanceof a?!0:typeof e==`object`&&!!e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,n){if(typeof e==`number`)return this._initNumber(e,t,n);if(typeof e==`object`)return this._initArray(e,t,n);t===`hex`&&(t=16),r(t===(t|0)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,``);var i=0;e[0]===`-`&&(i++,this.negative=1),i<e.length&&(t===16?this._parseHex(e,i,n):(this._parseBase(e,t,i),n===`le`&&this._initArray(this.toArray(),t,n)))},a.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),n===`le`&&this._initArray(this.toArray(),t,n)},a.prototype._initArray=function(e,t,n){if(r(typeof e.length==`number`),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if(n===`be`)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,s+=24,s>=26&&(s-=26,a++);else if(n===`le`)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,s+=24,s>=26&&(s-=26,a++);return this.strip()};function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i=0,a=0,o;if(n===`be`)for(r=e.length-1;r>=t;r-=2)o=c(e,t,r)<<i,this.words[a]|=o&67108863,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)o=c(e,t,r)<<i,this.words[a]|=o&67108863,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()};function l(e,t,n,r){for(var i=0,a=Math.min(e.length,n),o=t;o<a;o++){var s=e.charCodeAt(o)-48;i*=r,s>=49?i+=s-49+10:s>=17?i+=s-17+10:i+=s}return i}a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,c=0,u=n;u<s;u+=r)c=l(e,u,u+r,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(o!==0){var d=1;for(c=l(e,u,e.length,t),u=0;u<o;u++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},a.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?`<BN-R: `:`<BN: `)+this.toString(16)+`>`};var u=`.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`.split(`.`),d=[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],f=[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];a.prototype.toString=function(e,t){e||=10,t=t|0||1;var n;if(e===16||e===`hex`){n=``;for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],c=((s<<i|a)&16777215).toString(16);a=s>>>24-i&16777215,i+=2,i>=26&&(i-=26,o--),n=a!==0||o!==this.length-1?u[6-c.length]+c+n:c+n}for(a!==0&&(n=a.toString(16)+n);n.length%t!==0;)n=`0`+n;return this.negative!==0&&(n=`-`+n),n}if(e===(e|0)&&e>=2&&e<=36){var l=d[e],p=f[e];n=``;var m=this.clone();for(m.negative=0;!m.isZero();){var h=m.modn(p).toString(e);m=m.idivn(p),n=m.isZero()?h+n:u[l-h.length]+h+n}for(this.isZero()&&(n=`0`+n);n.length%t!==0;)n=`0`+n;return this.negative!==0&&(n=`-`+n),n}r(!1,`Base should be between 2 and 36`)},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,`Number can only safely store up to 53 bits`),this.negative===0?e:-e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return r(o!==void 0),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,`byte array longer than desired length`),r(a>0,`Requested array length <= 0`),this.strip();var o=t===`le`,s=new e(a),c,l,u=this.clone();if(o){for(l=0;!u.isZero();l++)c=u.andln(255),u.iushrn(8),s[l]=c;for(;l<a;l++)s[l]=0}else{for(l=0;l<a-i;l++)s[l]=0;for(l=0;!u.isZero();l++)c=u.andln(255),u.iushrn(8),s[a-l-1]=c}return s},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(e===0)return 26;var t=e,n=0;return!(t&8191)&&(n+=13,t>>>=13),!(t&127)&&(n+=7,t>>>=7),!(t&15)&&(n+=4,t>>>=4),!(t&3)&&(n+=2,t>>>=2),!(t&1)&&n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t};function p(e){for(var t=Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=(e.words[r]&1<<i)>>>i}return t}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,n!==26)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return this.negative===0?this.clone():this.abs().inotn(e).iaddn(1)},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return r((this.negative|e.negative)===0),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){for(var t=this.length>e.length?e:this,n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return r((this.negative|e.negative)===0),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return r((this.negative|e.negative)===0),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r(typeof e==`number`&&e>=0);var t=Math.ceil(e/26)|0,n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=~this.words[i]&67108863;return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r(typeof e==`number`&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),t?this.words[n]=this.words[n]|1<<i:this.words[n]=this.words[n]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t;if(this.negative!==0&&e.negative===0)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();var n,r;this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)t=(n.words[a]|0)+(r.words[a]|0)+i,this.words[a]=t&67108863,i=t>>>26;for(;i!==0&&a<n.length;a++)t=(n.words[a]|0)+i,this.words[a]=t&67108863,i=t>>>26;if(this.length=n.length,i!==0)this.words[this.length]=i,this.length++;else if(n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this},a.prototype.add=function(e){var t;return e.negative!==0&&this.negative===0?(e.negative=0,t=this.sub(e),e.negative^=1,t):e.negative===0&&this.negative!==0?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(n===0)return this.negative=0,this.length=1,this.words[0]=0,this;var r,i;n>0?(r=this,i=e):(r=e,i=this);for(var a=0,o=0;o<i.length;o++)t=(r.words[o]|0)-(i.words[o]|0)+a,a=t>>26,this.words[o]=t&67108863;for(;a!==0&&o<r.length;o++)t=(r.words[o]|0)+a,a=t>>26,this.words[o]=t&67108863;if(a===0&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=e.words[0]|0,a=t.words[0]|0,o=i*a,s=o&67108863,c=o/67108864|0;n.words[0]=s;for(var l=1;l<r;l++){for(var u=c>>>26,d=c&67108863,f=Math.min(l,t.length-1),p=Math.max(0,l-e.length+1);p<=f;p++){var m=l-p|0;i=e.words[m]|0,a=t.words[p]|0,o=i*a+d,u+=o/67108864|0,d=o&67108863}n.words[l]=d|0,c=u|0}return c===0?n.length--:n.words[l]=c|0,n.strip()}var h=function(e,t,n){var r=e.words,i=t.words,a=n.words,o=0,s,c,l,u=r[0]|0,d=u&8191,f=u>>>13,p=r[1]|0,m=p&8191,h=p>>>13,g=r[2]|0,_=g&8191,v=g>>>13,y=r[3]|0,b=y&8191,x=y>>>13,S=r[4]|0,C=S&8191,w=S>>>13,T=r[5]|0,E=T&8191,D=T>>>13,O=r[6]|0,k=O&8191,A=O>>>13,j=r[7]|0,M=j&8191,N=j>>>13,P=r[8]|0,F=P&8191,I=P>>>13,L=r[9]|0,R=L&8191,z=L>>>13,B=i[0]|0,V=B&8191,H=B>>>13,U=i[1]|0,W=U&8191,G=U>>>13,K=i[2]|0,q=K&8191,J=K>>>13,Y=i[3]|0,X=Y&8191,Z=Y>>>13,Q=i[4]|0,ee=Q&8191,te=Q>>>13,ne=i[5]|0,re=ne&8191,ie=ne>>>13,ae=i[6]|0,oe=ae&8191,se=ae>>>13,ce=i[7]|0,le=ce&8191,ue=ce>>>13,de=i[8]|0,fe=de&8191,pe=de>>>13,me=i[9]|0,he=me&8191,ge=me>>>13;n.negative=e.negative^t.negative,n.length=19,s=Math.imul(d,V),c=Math.imul(d,H),c=c+Math.imul(f,V)|0,l=Math.imul(f,H);var _e=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(_e>>>26)|0,_e&=67108863,s=Math.imul(m,V),c=Math.imul(m,H),c=c+Math.imul(h,V)|0,l=Math.imul(h,H),s=s+Math.imul(d,W)|0,c=c+Math.imul(d,G)|0,c=c+Math.imul(f,W)|0,l=l+Math.imul(f,G)|0;var ve=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(ve>>>26)|0,ve&=67108863,s=Math.imul(_,V),c=Math.imul(_,H),c=c+Math.imul(v,V)|0,l=Math.imul(v,H),s=s+Math.imul(m,W)|0,c=c+Math.imul(m,G)|0,c=c+Math.imul(h,W)|0,l=l+Math.imul(h,G)|0,s=s+Math.imul(d,q)|0,c=c+Math.imul(d,J)|0,c=c+Math.imul(f,q)|0,l=l+Math.imul(f,J)|0;var ye=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(ye>>>26)|0,ye&=67108863,s=Math.imul(b,V),c=Math.imul(b,H),c=c+Math.imul(x,V)|0,l=Math.imul(x,H),s=s+Math.imul(_,W)|0,c=c+Math.imul(_,G)|0,c=c+Math.imul(v,W)|0,l=l+Math.imul(v,G)|0,s=s+Math.imul(m,q)|0,c=c+Math.imul(m,J)|0,c=c+Math.imul(h,q)|0,l=l+Math.imul(h,J)|0,s=s+Math.imul(d,X)|0,c=c+Math.imul(d,Z)|0,c=c+Math.imul(f,X)|0,l=l+Math.imul(f,Z)|0;var be=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(be>>>26)|0,be&=67108863,s=Math.imul(C,V),c=Math.imul(C,H),c=c+Math.imul(w,V)|0,l=Math.imul(w,H),s=s+Math.imul(b,W)|0,c=c+Math.imul(b,G)|0,c=c+Math.imul(x,W)|0,l=l+Math.imul(x,G)|0,s=s+Math.imul(_,q)|0,c=c+Math.imul(_,J)|0,c=c+Math.imul(v,q)|0,l=l+Math.imul(v,J)|0,s=s+Math.imul(m,X)|0,c=c+Math.imul(m,Z)|0,c=c+Math.imul(h,X)|0,l=l+Math.imul(h,Z)|0,s=s+Math.imul(d,ee)|0,c=c+Math.imul(d,te)|0,c=c+Math.imul(f,ee)|0,l=l+Math.imul(f,te)|0;var xe=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(xe>>>26)|0,xe&=67108863,s=Math.imul(E,V),c=Math.imul(E,H),c=c+Math.imul(D,V)|0,l=Math.imul(D,H),s=s+Math.imul(C,W)|0,c=c+Math.imul(C,G)|0,c=c+Math.imul(w,W)|0,l=l+Math.imul(w,G)|0,s=s+Math.imul(b,q)|0,c=c+Math.imul(b,J)|0,c=c+Math.imul(x,q)|0,l=l+Math.imul(x,J)|0,s=s+Math.imul(_,X)|0,c=c+Math.imul(_,Z)|0,c=c+Math.imul(v,X)|0,l=l+Math.imul(v,Z)|0,s=s+Math.imul(m,ee)|0,c=c+Math.imul(m,te)|0,c=c+Math.imul(h,ee)|0,l=l+Math.imul(h,te)|0,s=s+Math.imul(d,re)|0,c=c+Math.imul(d,ie)|0,c=c+Math.imul(f,re)|0,l=l+Math.imul(f,ie)|0;var Se=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Se>>>26)|0,Se&=67108863,s=Math.imul(k,V),c=Math.imul(k,H),c=c+Math.imul(A,V)|0,l=Math.imul(A,H),s=s+Math.imul(E,W)|0,c=c+Math.imul(E,G)|0,c=c+Math.imul(D,W)|0,l=l+Math.imul(D,G)|0,s=s+Math.imul(C,q)|0,c=c+Math.imul(C,J)|0,c=c+Math.imul(w,q)|0,l=l+Math.imul(w,J)|0,s=s+Math.imul(b,X)|0,c=c+Math.imul(b,Z)|0,c=c+Math.imul(x,X)|0,l=l+Math.imul(x,Z)|0,s=s+Math.imul(_,ee)|0,c=c+Math.imul(_,te)|0,c=c+Math.imul(v,ee)|0,l=l+Math.imul(v,te)|0,s=s+Math.imul(m,re)|0,c=c+Math.imul(m,ie)|0,c=c+Math.imul(h,re)|0,l=l+Math.imul(h,ie)|0,s=s+Math.imul(d,oe)|0,c=c+Math.imul(d,se)|0,c=c+Math.imul(f,oe)|0,l=l+Math.imul(f,se)|0;var Ce=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,s=Math.imul(M,V),c=Math.imul(M,H),c=c+Math.imul(N,V)|0,l=Math.imul(N,H),s=s+Math.imul(k,W)|0,c=c+Math.imul(k,G)|0,c=c+Math.imul(A,W)|0,l=l+Math.imul(A,G)|0,s=s+Math.imul(E,q)|0,c=c+Math.imul(E,J)|0,c=c+Math.imul(D,q)|0,l=l+Math.imul(D,J)|0,s=s+Math.imul(C,X)|0,c=c+Math.imul(C,Z)|0,c=c+Math.imul(w,X)|0,l=l+Math.imul(w,Z)|0,s=s+Math.imul(b,ee)|0,c=c+Math.imul(b,te)|0,c=c+Math.imul(x,ee)|0,l=l+Math.imul(x,te)|0,s=s+Math.imul(_,re)|0,c=c+Math.imul(_,ie)|0,c=c+Math.imul(v,re)|0,l=l+Math.imul(v,ie)|0,s=s+Math.imul(m,oe)|0,c=c+Math.imul(m,se)|0,c=c+Math.imul(h,oe)|0,l=l+Math.imul(h,se)|0,s=s+Math.imul(d,le)|0,c=c+Math.imul(d,ue)|0,c=c+Math.imul(f,le)|0,l=l+Math.imul(f,ue)|0;var we=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(we>>>26)|0,we&=67108863,s=Math.imul(F,V),c=Math.imul(F,H),c=c+Math.imul(I,V)|0,l=Math.imul(I,H),s=s+Math.imul(M,W)|0,c=c+Math.imul(M,G)|0,c=c+Math.imul(N,W)|0,l=l+Math.imul(N,G)|0,s=s+Math.imul(k,q)|0,c=c+Math.imul(k,J)|0,c=c+Math.imul(A,q)|0,l=l+Math.imul(A,J)|0,s=s+Math.imul(E,X)|0,c=c+Math.imul(E,Z)|0,c=c+Math.imul(D,X)|0,l=l+Math.imul(D,Z)|0,s=s+Math.imul(C,ee)|0,c=c+Math.imul(C,te)|0,c=c+Math.imul(w,ee)|0,l=l+Math.imul(w,te)|0,s=s+Math.imul(b,re)|0,c=c+Math.imul(b,ie)|0,c=c+Math.imul(x,re)|0,l=l+Math.imul(x,ie)|0,s=s+Math.imul(_,oe)|0,c=c+Math.imul(_,se)|0,c=c+Math.imul(v,oe)|0,l=l+Math.imul(v,se)|0,s=s+Math.imul(m,le)|0,c=c+Math.imul(m,ue)|0,c=c+Math.imul(h,le)|0,l=l+Math.imul(h,ue)|0,s=s+Math.imul(d,fe)|0,c=c+Math.imul(d,pe)|0,c=c+Math.imul(f,fe)|0,l=l+Math.imul(f,pe)|0;var Te=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Te>>>26)|0,Te&=67108863,s=Math.imul(R,V),c=Math.imul(R,H),c=c+Math.imul(z,V)|0,l=Math.imul(z,H),s=s+Math.imul(F,W)|0,c=c+Math.imul(F,G)|0,c=c+Math.imul(I,W)|0,l=l+Math.imul(I,G)|0,s=s+Math.imul(M,q)|0,c=c+Math.imul(M,J)|0,c=c+Math.imul(N,q)|0,l=l+Math.imul(N,J)|0,s=s+Math.imul(k,X)|0,c=c+Math.imul(k,Z)|0,c=c+Math.imul(A,X)|0,l=l+Math.imul(A,Z)|0,s=s+Math.imul(E,ee)|0,c=c+Math.imul(E,te)|0,c=c+Math.imul(D,ee)|0,l=l+Math.imul(D,te)|0,s=s+Math.imul(C,re)|0,c=c+Math.imul(C,ie)|0,c=c+Math.imul(w,re)|0,l=l+Math.imul(w,ie)|0,s=s+Math.imul(b,oe)|0,c=c+Math.imul(b,se)|0,c=c+Math.imul(x,oe)|0,l=l+Math.imul(x,se)|0,s=s+Math.imul(_,le)|0,c=c+Math.imul(_,ue)|0,c=c+Math.imul(v,le)|0,l=l+Math.imul(v,ue)|0,s=s+Math.imul(m,fe)|0,c=c+Math.imul(m,pe)|0,c=c+Math.imul(h,fe)|0,l=l+Math.imul(h,pe)|0,s=s+Math.imul(d,he)|0,c=c+Math.imul(d,ge)|0,c=c+Math.imul(f,he)|0,l=l+Math.imul(f,ge)|0;var Ee=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,s=Math.imul(R,W),c=Math.imul(R,G),c=c+Math.imul(z,W)|0,l=Math.imul(z,G),s=s+Math.imul(F,q)|0,c=c+Math.imul(F,J)|0,c=c+Math.imul(I,q)|0,l=l+Math.imul(I,J)|0,s=s+Math.imul(M,X)|0,c=c+Math.imul(M,Z)|0,c=c+Math.imul(N,X)|0,l=l+Math.imul(N,Z)|0,s=s+Math.imul(k,ee)|0,c=c+Math.imul(k,te)|0,c=c+Math.imul(A,ee)|0,l=l+Math.imul(A,te)|0,s=s+Math.imul(E,re)|0,c=c+Math.imul(E,ie)|0,c=c+Math.imul(D,re)|0,l=l+Math.imul(D,ie)|0,s=s+Math.imul(C,oe)|0,c=c+Math.imul(C,se)|0,c=c+Math.imul(w,oe)|0,l=l+Math.imul(w,se)|0,s=s+Math.imul(b,le)|0,c=c+Math.imul(b,ue)|0,c=c+Math.imul(x,le)|0,l=l+Math.imul(x,ue)|0,s=s+Math.imul(_,fe)|0,c=c+Math.imul(_,pe)|0,c=c+Math.imul(v,fe)|0,l=l+Math.imul(v,pe)|0,s=s+Math.imul(m,he)|0,c=c+Math.imul(m,ge)|0,c=c+Math.imul(h,he)|0,l=l+Math.imul(h,ge)|0;var De=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(De>>>26)|0,De&=67108863,s=Math.imul(R,q),c=Math.imul(R,J),c=c+Math.imul(z,q)|0,l=Math.imul(z,J),s=s+Math.imul(F,X)|0,c=c+Math.imul(F,Z)|0,c=c+Math.imul(I,X)|0,l=l+Math.imul(I,Z)|0,s=s+Math.imul(M,ee)|0,c=c+Math.imul(M,te)|0,c=c+Math.imul(N,ee)|0,l=l+Math.imul(N,te)|0,s=s+Math.imul(k,re)|0,c=c+Math.imul(k,ie)|0,c=c+Math.imul(A,re)|0,l=l+Math.imul(A,ie)|0,s=s+Math.imul(E,oe)|0,c=c+Math.imul(E,se)|0,c=c+Math.imul(D,oe)|0,l=l+Math.imul(D,se)|0,s=s+Math.imul(C,le)|0,c=c+Math.imul(C,ue)|0,c=c+Math.imul(w,le)|0,l=l+Math.imul(w,ue)|0,s=s+Math.imul(b,fe)|0,c=c+Math.imul(b,pe)|0,c=c+Math.imul(x,fe)|0,l=l+Math.imul(x,pe)|0,s=s+Math.imul(_,he)|0,c=c+Math.imul(_,ge)|0,c=c+Math.imul(v,he)|0,l=l+Math.imul(v,ge)|0;var Oe=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,s=Math.imul(R,X),c=Math.imul(R,Z),c=c+Math.imul(z,X)|0,l=Math.imul(z,Z),s=s+Math.imul(F,ee)|0,c=c+Math.imul(F,te)|0,c=c+Math.imul(I,ee)|0,l=l+Math.imul(I,te)|0,s=s+Math.imul(M,re)|0,c=c+Math.imul(M,ie)|0,c=c+Math.imul(N,re)|0,l=l+Math.imul(N,ie)|0,s=s+Math.imul(k,oe)|0,c=c+Math.imul(k,se)|0,c=c+Math.imul(A,oe)|0,l=l+Math.imul(A,se)|0,s=s+Math.imul(E,le)|0,c=c+Math.imul(E,ue)|0,c=c+Math.imul(D,le)|0,l=l+Math.imul(D,ue)|0,s=s+Math.imul(C,fe)|0,c=c+Math.imul(C,pe)|0,c=c+Math.imul(w,fe)|0,l=l+Math.imul(w,pe)|0,s=s+Math.imul(b,he)|0,c=c+Math.imul(b,ge)|0,c=c+Math.imul(x,he)|0,l=l+Math.imul(x,ge)|0;var ke=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(ke>>>26)|0,ke&=67108863,s=Math.imul(R,ee),c=Math.imul(R,te),c=c+Math.imul(z,ee)|0,l=Math.imul(z,te),s=s+Math.imul(F,re)|0,c=c+Math.imul(F,ie)|0,c=c+Math.imul(I,re)|0,l=l+Math.imul(I,ie)|0,s=s+Math.imul(M,oe)|0,c=c+Math.imul(M,se)|0,c=c+Math.imul(N,oe)|0,l=l+Math.imul(N,se)|0,s=s+Math.imul(k,le)|0,c=c+Math.imul(k,ue)|0,c=c+Math.imul(A,le)|0,l=l+Math.imul(A,ue)|0,s=s+Math.imul(E,fe)|0,c=c+Math.imul(E,pe)|0,c=c+Math.imul(D,fe)|0,l=l+Math.imul(D,pe)|0,s=s+Math.imul(C,he)|0,c=c+Math.imul(C,ge)|0,c=c+Math.imul(w,he)|0,l=l+Math.imul(w,ge)|0;var Ae=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,s=Math.imul(R,re),c=Math.imul(R,ie),c=c+Math.imul(z,re)|0,l=Math.imul(z,ie),s=s+Math.imul(F,oe)|0,c=c+Math.imul(F,se)|0,c=c+Math.imul(I,oe)|0,l=l+Math.imul(I,se)|0,s=s+Math.imul(M,le)|0,c=c+Math.imul(M,ue)|0,c=c+Math.imul(N,le)|0,l=l+Math.imul(N,ue)|0,s=s+Math.imul(k,fe)|0,c=c+Math.imul(k,pe)|0,c=c+Math.imul(A,fe)|0,l=l+Math.imul(A,pe)|0,s=s+Math.imul(E,he)|0,c=c+Math.imul(E,ge)|0,c=c+Math.imul(D,he)|0,l=l+Math.imul(D,ge)|0;var je=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(je>>>26)|0,je&=67108863,s=Math.imul(R,oe),c=Math.imul(R,se),c=c+Math.imul(z,oe)|0,l=Math.imul(z,se),s=s+Math.imul(F,le)|0,c=c+Math.imul(F,ue)|0,c=c+Math.imul(I,le)|0,l=l+Math.imul(I,ue)|0,s=s+Math.imul(M,fe)|0,c=c+Math.imul(M,pe)|0,c=c+Math.imul(N,fe)|0,l=l+Math.imul(N,pe)|0,s=s+Math.imul(k,he)|0,c=c+Math.imul(k,ge)|0,c=c+Math.imul(A,he)|0,l=l+Math.imul(A,ge)|0;var Me=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Me>>>26)|0,Me&=67108863,s=Math.imul(R,le),c=Math.imul(R,ue),c=c+Math.imul(z,le)|0,l=Math.imul(z,ue),s=s+Math.imul(F,fe)|0,c=c+Math.imul(F,pe)|0,c=c+Math.imul(I,fe)|0,l=l+Math.imul(I,pe)|0,s=s+Math.imul(M,he)|0,c=c+Math.imul(M,ge)|0,c=c+Math.imul(N,he)|0,l=l+Math.imul(N,ge)|0;var Ne=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,s=Math.imul(R,fe),c=Math.imul(R,pe),c=c+Math.imul(z,fe)|0,l=Math.imul(z,pe),s=s+Math.imul(F,he)|0,c=c+Math.imul(F,ge)|0,c=c+Math.imul(I,he)|0,l=l+Math.imul(I,ge)|0;var Pe=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,s=Math.imul(R,he),c=Math.imul(R,ge),c=c+Math.imul(z,he)|0,l=Math.imul(z,ge);var Fe=(o+s|0)+((c&8191)<<13)|0;return o=(l+(c>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,a[0]=_e,a[1]=ve,a[2]=ye,a[3]=be,a[4]=xe,a[5]=Se,a[6]=Ce,a[7]=we,a[8]=Te,a[9]=Ee,a[10]=De,a[11]=Oe,a[12]=ke,a[13]=Ae,a[14]=je,a[15]=Me,a[16]=Ne,a[17]=Pe,a[18]=Fe,o!==0&&(a[19]=o,n.length++),n};Math.imul||(h=m);function g(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a<n.length-1;a++){var o=i;i=0;for(var s=r&67108863,c=Math.min(a,t.length-1),l=Math.max(0,a-e.length+1);l<=c;l++){var u=a-l,d=(e.words[u]|0)*(t.words[l]|0),f=d&67108863;o=o+(d/67108864|0)|0,f=f+s|0,s=f&67108863,o=o+(f>>>26)|0,i+=o>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return r===0?n.length--:n.words[a]=r,n.strip()}function _(e,t,n){return new v().mulp(e,t,n)}a.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=this.length===10&&e.length===10?h(this,e,t):r<63?m(this,e,t):r<1024?g(this,e,t):_(this,e,t),n};function v(e,t){this.x=e,this.y=t}v.prototype.makeRBT=function(e){for(var t=Array(e),n=a.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},v.prototype.revBin=function(e,t,n){if(e===0||e===n-1)return e;for(var r=0,i=0;i<t;i++)r|=(e&1)<<t-i-1,e>>=1;return r},v.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o<a;o++)r[o]=t[e[o]],i[o]=n[e[o]]},v.prototype.transform=function(e,t,n,r,i,a){this.permute(a,e,t,n,r,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,c=Math.cos(2*Math.PI/s),l=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var d=c,f=l,p=0;p<o;p++){var m=n[u+p],h=r[u+p],g=n[u+p+o],_=r[u+p+o],v=d*g-f*_;_=d*_+f*g,g=v,n[u+p]=m+g,r[u+p]=h+_,n[u+p+o]=m-g,r[u+p+o]=h-_,p!==s&&(v=c*d-l*f,f=c*f+l*d,d=v)}},v.prototype.guessLen13b=function(e,t){var n=Math.max(t,e)|1,r=n&1,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},v.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=e[r];e[r]=e[n-r-1],e[n-r-1]=i,i=t[r],t[r]=-t[n-r-1],t[n-r-1]=-i}},v.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var i=Math.round(e[2*r+1]/t)*8192+Math.round(e[2*r]/t)+n;e[r]=i&67108863,n=i<67108864?0:i/67108864|0}return e},v.prototype.convert13b=function(e,t,n,i){for(var a=0,o=0;o<t;o++)a+=e[o]|0,n[2*o]=a&8191,a>>>=13,n[2*o+1]=a&8191,a>>>=13;for(o=2*t;o<i;++o)n[o]=0;r(a===0),r((a&-8192)==0)},v.prototype.stub=function(e){for(var t=Array(e),n=0;n<e;n++)t[n]=0;return t},v.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(r),a=this.stub(r),o=Array(r),s=Array(r),c=Array(r),l=Array(r),u=Array(r),d=Array(r),f=n.words;f.length=r,this.convert13b(e.words,e.length,o,r),this.convert13b(t.words,t.length,l,r),this.transform(o,a,s,c,r,i),this.transform(l,a,u,d,r,i);for(var p=0;p<r;p++){var m=s[p]*u[p]-c[p]*d[p];c[p]=s[p]*d[p]+c[p]*u[p],s[p]=m}return this.conjugate(s,c,r),this.transform(s,c,f,a,r,i),this.conjugate(f,a,r),this.normalize13b(f,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=Array(this.length+e.length),_(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){r(typeof e==`number`),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(this.words[n]|0)*e,a=(i&67108863)+(t&67108863);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[n]=a&67108863}return t!==0&&(this.words[n]=t,this.length++),this.length=e===0?1:this.length,this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=p(e);if(t.length===0)return new a(1);for(var n=this,r=0;r<t.length&&t[r]===0;r++,n=n.sqr());if(++r<t.length)for(var i=n.sqr();r<t.length;r++,i=i.sqr())t[r]!==0&&(n=n.mul(i));return n},a.prototype.iushln=function(e){r(typeof e==`number`&&e>=0);var t=e%26,n=(e-t)/26,i=67108863>>>26-t<<26-t,a;if(t!==0){var o=0;for(a=0;a<this.length;a++){var s=this.words[a]&i,c=(this.words[a]|0)-s<<t;this.words[a]=c|o,o=s>>>26-t}o&&(this.words[a]=o,this.length++)}if(n!==0){for(a=this.length-1;a>=0;a--)this.words[a+n]=this.words[a];for(a=0;a<n;a++)this.words[a]=0;this.length+=n}return this.strip()},a.prototype.ishln=function(e){return r(this.negative===0),this.iushln(e)},a.prototype.iushrn=function(e,t,n){r(typeof e==`number`&&e>=0);var i=t?(t-t%26)/26:0,a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,c=n;if(i-=o,i=Math.max(0,i),c){for(var l=0;l<o;l++)c.words[l]=this.words[l];c.length=o}if(o!==0)if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var u=0;for(l=this.length-1;l>=0&&(u!==0||l>=i);l--){var d=this.words[l]|0;this.words[l]=u<<26-a|d>>>a,u=d&s}return c&&u!==0&&(c.words[c.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,n){return r(this.negative===0),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r(typeof e==`number`&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return this.length<=n?!1:!!(this.words[n]&i)},a.prototype.imaskn=function(e){r(typeof e==`number`&&e>=0);var t=e%26,n=(e-t)/26;if(r(this.negative===0,`imaskn works only with positive numbers`),this.length<=n)return this;if(t!==0&&n++,this.length=Math.min(n,this.length),t!==0){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return r(typeof e==`number`),r(e<67108864),e<0?this.isubn(-e):this.negative===0?this._iaddn(e):this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r(typeof e==`number`),r(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,--this.words[t+1];return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,n){var i=e.length+n,a;this._expand(i);var o,s=0;for(a=0;a<e.length;a++){o=(this.words[a+n]|0)+s;var c=(e.words[a]|0)*t;o-=c&67108863,s=(o>>26)-(c/67108864|0),this.words[a+n]=o&67108863}for(;a<this.length-n;a++)o=(this.words[a+n]|0)+s,s=o>>26,this.words[a+n]=o&67108863;if(s===0)return this.strip();for(r(s===-1),s=0,a=0;a<this.length;a++)o=-(this.words[a]|0)+s,s=o>>26,this.words[a]=o&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var n=this.length-e.length,r=this.clone(),i=e,o=i.words[i.length-1]|0;n=26-this._countBits(o),n!==0&&(i=i.ushln(n),r.iushln(n),o=i.words[i.length-1]|0);var s=r.length-i.length,c;if(t!==`mod`){c=new a(null),c.length=s+1,c.words=Array(c.length);for(var l=0;l<c.length;l++)c.words[l]=0}var u=r.clone()._ishlnsubmul(i,1,s);u.negative===0&&(r=u,c&&(c.words[s]=1));for(var d=s-1;d>=0;d--){var f=(r.words[i.length+d]|0)*67108864+(r.words[i.length+d-1]|0);for(f=Math.min(f/o|0,67108863),r._ishlnsubmul(i,f,d);r.negative!==0;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);c&&(c.words[d]=f)}return c&&c.strip(),r.strip(),t!==`div`&&n!==0&&r.iushrn(n),{div:c||null,mod:r}},a.prototype.divmod=function(e,t,n){if(r(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return this.negative!==0&&e.negative===0?(s=this.neg().divmod(e,t),t!==`mod`&&(i=s.div.neg()),t!==`div`&&(o=s.mod.neg(),n&&o.negative!==0&&o.iadd(e)),{div:i,mod:o}):this.negative===0&&e.negative!==0?(s=this.divmod(e.neg(),t),t!==`mod`&&(i=s.div.neg()),{div:i,mod:s.mod}):(this.negative&e.negative)===0?e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?t===`div`?{div:this.divn(e.words[0]),mod:null}:t===`mod`?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t):(s=this.neg().divmod(e.neg(),t),t!==`div`&&(o=s.mod.neg(),n&&o.negative!==0&&o.isub(e)),{div:s.div,mod:o})},a.prototype.div=function(e){return this.divmod(e,`div`,!1).div},a.prototype.mod=function(e){return this.divmod(e,`mod`,!1).mod},a.prototype.umod=function(e){return this.divmod(e,`mod`,!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=t.div.negative===0?t.mod:t.mod.isub(e),r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||i===1&&a===0?t.div:t.div.negative===0?t.div.iaddn(1):t.div.isubn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(this.words[i]|0))%e;return n},a.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(this.words[n]|0)+t*67108864;this.words[n]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(e.negative===0),r(!e.isZero());var t=this,n=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var i=new a(1),o=new a(0),s=new a(0),c=new a(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var u=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;(t.words[0]&p)===0&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(d)),i.iushrn(1),o.iushrn(1);for(var m=0,h=1;(n.words[0]&h)===0&&m<26;++m,h<<=1);if(m>0)for(n.iushrn(m);m-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),o.isub(c)):(n.isub(t),s.isub(i),c.isub(o))}return{a:s,b:c,gcd:n.iushln(l)}},a.prototype._invmp=function(e){r(e.negative===0),r(!e.isZero());var t=this,n=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var i=new a(1),o=new a(0),s=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;(t.words[0]&l)===0&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,d=1;(n.words[0]&d)===0&&u<26;++u,d<<=1);if(u>0)for(n.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(o)):(n.isub(t),o.isub(i))}var f;return f=t.cmpn(1)===0?i:o,f.cmpn(0)<0&&f.iadd(e),f},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);do{for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(i===0||n.cmpn(1)===0)break;t.isub(n)}while(!0);return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(this.words[0]&1)==0},a.prototype.isOdd=function(){return(this.words[0]&1)==1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r(typeof e==`number`);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var a=i,o=n;a!==0&&o<this.length;o++){var s=this.words[o]|0;s+=a,a=s>>>26,s&=67108863,this.words[o]=s}return a!==0&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var t=e<0;if(this.negative!==0&&!t)return-1;if(this.negative===0&&t)return 1;this.strip();var n;if(this.length>1)n=1;else{t&&(e=-e),r(e<=67108863,`Number is too big`);var i=this.words[0]|0;n=i===e?0:i<e?-1:1}return this.negative===0?n:-n|0},a.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var t=this.ucmp(e);return this.negative===0?t:-t|0},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=this.words[n]|0,i=e.words[n]|0;if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new T(e)},a.prototype.toRed=function(e){return r(!this.red,`Already a number in reduction context`),r(this.negative===0,`red works only with positives`),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,`fromRed works only with numbers in reduction context`),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,`Already a number in reduction context`),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,`redAdd works only with red numbers`),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,`redIAdd works only with red numbers`),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,`redSub works only with red numbers`),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,`redISub works only with red numbers`),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,`redShl works only with red numbers`),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,`redSqr works only with red numbers`),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,`redISqr works only with red numbers`),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,`redSqrt works only with red numbers`),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,`redInvm works only with red numbers`),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,`redNeg works only with red numbers`),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,`redPow(normalNum)`),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}b.prototype._tmp=function(){var e=new a(null);return e.words=Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t=e,n;do this.split(t,this.tmp),t=this.imulK(t),t=t.iadd(this.tmp),n=t.bitLength();while(n>this.n);var r=n<this.n?-1:t.ucmp(this.p);return r===0?(t.words[0]=0,t.length=1):r>0?t.isub(this.p):t.strip===void 0?t._strip():t.strip(),t},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)};function x(){b.call(this,`k256`,`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`)}i(x,b),x.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9){e.words[0]=0,e.length=1;return}var a=e.words[9];for(t.words[t.length++]=a&n,i=10;i<e.length;i++){var o=e.words[i]|0;e.words[i-10]=(o&n)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,a===0&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=e.words[n]|0;t+=r*977,e.words[n]=t&67108863,t=r*64+(t/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function S(){b.call(this,`p224`,`ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001`)}i(S,b);function C(){b.call(this,`p192`,`ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff`)}i(C,b);function w(){b.call(this,`25519`,`7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed`)}i(w,b),w.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=(e.words[n]|0)*19+t,i=r&67108863;r>>>=26,e.words[n]=i,t=r}return t!==0&&(e.words[e.length++]=t),e},a._prime=function(e){if(y[e])return y[e];var t;if(e===`k256`)t=new x;else if(e===`p224`)t=new S;else if(e===`p192`)t=new C;else if(e===`p25519`)t=new w;else throw Error(`Unknown prime `+e);return y[e]=t,t};function T(e){if(typeof e==`string`){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),`modulus must be greater than 1`),this.m=e,this.prime=null}T.prototype._verify1=function(e){r(e.negative===0,`red works only with positives`),r(e.red,`red works only with red numbers`)},T.prototype._verify2=function(e,t){r((e.negative|t.negative)===0,`red works only with positives`),r(e.red&&e.red===t.red,`red works only with red numbers`)},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),t===3){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),o=0;!i.isZero()&&i.andln(1)===0;)o++,i.iushrn(1);r(!i.isZero());var s=new a(1).toRed(this),c=s.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);this.pow(u,l).cmp(c)!==0;)u.redIAdd(c);for(var d=this.pow(u,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),m=o;p.cmp(s)!==0;){for(var h=p,g=0;h.cmp(s)!==0;g++)h=h.redSqr();r(g<m);var _=this.pow(d,new a(1).iushln(m-g-1));f=f.redMul(_),d=_.redSqr(),p=p.redMul(d),m=g}return f},T.prototype.invm=function(e){var t=e._invmp(this.m);return t.negative===0?this.imod(t):(t.negative=0,this.imod(t).redNeg())},T.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(t.cmpn(1)===0)return e.clone();var n=4,r=Array(1<<n);r[0]=new a(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,c=0,l=t.bitLength()%26;for(l===0&&(l=26),i=t.length-1;i>=0;i--){for(var u=t.words[i],d=l-1;d>=0;d--){var f=u>>d&1;if(o!==r[0]&&(o=this.sqr(o)),f===0&&s===0){c=0;continue}s<<=1,s|=f,c++,!(c!==n&&(i!==0||d!==0))&&(o=this.mul(o,r[s]),c=0,s=0)}l=26}return o},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new E(e)};function E(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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(E,T),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)},6204:function(e){e.exports=t;function t(e){var t,n,r,i=e.length,a=0;for(t=0;t<i;++t)a+=e[t].length;var o=Array(a),s=0;for(t=0;t<i;++t){var c=e[t],l=c.length;for(n=0;n<l;++n){var u=o[s++]=Array(l-1),d=0;for(r=0;r<l;++r)r!==n&&(u[d++]=c[r]);if(n&1){var f=u[1];u[1]=u[0],u[0]=f}}}return o}},6867:function(e,t,n){e.exports=p;var r=n(1888),i=n(855),a=n(7150);function o(e,t){for(var n=0;n<e;++n)if(!(t[n]<=t[n+e]))return!0;return!1}function s(e,t,n,r){for(var i=0,a=0,s=0,c=e.length;s<c;++s){var l=e[s];if(!o(t,l)){for(var u=0;u<2*t;++u)n[i++]=l[u];r[a++]=s}}return a}function c(e,t,n,o){var c=e.length,l=t.length;if(!(c<=0||l<=0)){var u=e[0].length>>>1;if(!(u<=0)){var d,f=r.mallocDouble(2*u*c),p=r.mallocInt32(c);if(c=s(e,u,f,p),c>0){if(u===1&&o)i.init(c),d=i.sweepComplete(u,n,0,c,f,p,0,c,f,p);else{var m=r.mallocDouble(2*u*l),h=r.mallocInt32(l);l=s(t,u,m,h),l>0&&(i.init(c+l),d=u===1?i.sweepBipartite(u,n,0,c,f,p,0,l,m,h):a(u,n,o,c,f,p,l,m,h),r.free(m),r.free(h))}r.free(f),r.free(p)}return d}}}var l;function u(e,t){l.push([e,t])}function d(e){return l=[],c(e,e,u,!0),l}function f(e,t){return l=[],c(e,t,u,!1),l}function p(e,t,n){switch(arguments.length){case 1:return d(e);case 2:return typeof t==`function`?c(e,e,t,!0):f(e,t);case 3:return c(e,t,n,!1);default:throw Error(`box-intersect: Invalid arguments`)}}},2455:function(e,t){function n(){function e(e,t,n,r,i,a,o,s,c,l,u){for(var d=2*e,f=r,p=d*r;f<i;++f,p+=d){var m=a[t+p],h=a[t+p+e],g=o[f];e:for(var _=s,v=d*s;_<c;++_,v+=d){var y=l[t+v],b=l[t+v+e],x=u[_];if(!(b<m||h<y)){for(var S=t+1;S<e;++S){var C=a[S+p],w=a[S+e+p],T=l[S+v],E=l[S+e+v];if(w<T||E<C)continue e}var D=n(g,x);if(D!==void 0)return D}}}}function t(e,t,n,r,i,a,o,s,c,l,u){for(var d=2*e,f=s,p=d*s;f<c;++f,p+=d){var m=l[t+p],h=l[t+p+e],g=u[f];e:for(var _=r,v=d*r;_<i;++_,v+=d){var y=a[t+v],b=a[t+v+e],x=o[_];if(!(h<y||b<m)){for(var S=t+1;S<e;++S){var C=a[S+v],w=a[S+e+v],T=l[S+p],E=l[S+e+p];if(w<T||E<C)continue e}var D=n(x,g);if(D!==void 0)return D}}}}function n(n,r,i,a,o,s,c,l,u,d,f){return o-a>u-l?e(n,r,i,a,o,s,c,l,u,d,f):t(n,r,i,a,o,s,c,l,u,d,f)}return n}function r(){function e(e,t,n,r,i,a,o,s,c,l,u){for(var d=2*e,f=r,p=d*r;f<i;++f,p+=d){var m=a[t+p],h=a[t+p+e],g=o[f];e:for(var _=s,v=d*s;_<c;++_,v+=d){var y=l[t+v],b=u[_];if(!(y<=m||h<y)){for(var x=t+1;x<e;++x){var S=a[x+p],C=a[x+e+p],w=l[x+v],T=l[x+e+v];if(C<w||T<S)continue e}var E=n(b,g);if(E!==void 0)return E}}}}function t(e,t,n,r,i,a,o,s,c,l,u){for(var d=2*e,f=r,p=d*r;f<i;++f,p+=d){var m=a[t+p],h=a[t+p+e],g=o[f];e:for(var _=s,v=d*s;_<c;++_,v+=d){var y=l[t+v],b=u[_];if(!(y<m||h<y)){for(var x=t+1;x<e;++x){var S=a[x+p],C=a[x+e+p],w=l[x+v],T=l[x+e+v];if(C<w||T<S)continue e}var E=n(g,b);if(E!==void 0)return E}}}}function n(e,t,n,r,i,a,o,s,c,l,u){for(var d=2*e,f=s,p=d*s;f<c;++f,p+=d){var m=l[t+p],h=u[f];e:for(var g=r,_=d*r;g<i;++g,_+=d){var v=a[t+_],y=a[t+_+e],b=o[g];if(!(m<=v||y<m)){for(var x=t+1;x<e;++x){var S=a[x+_],C=a[x+e+_],w=l[x+p],T=l[x+e+p];if(C<w||T<S)continue e}var E=n(h,b);if(E!==void 0)return E}}}}function r(e,t,n,r,i,a,o,s,c,l,u){for(var d=2*e,f=s,p=d*s;f<c;++f,p+=d){var m=l[t+p],h=u[f];e:for(var g=r,_=d*r;g<i;++g,_+=d){var v=a[t+_],y=a[t+_+e],b=o[g];if(!(m<v||y<m)){for(var x=t+1;x<e;++x){var S=a[x+_],C=a[x+e+_],w=l[x+p],T=l[x+e+p];if(C<w||T<S)continue e}var E=n(b,h);if(E!==void 0)return E}}}}function i(i,a,o,s,c,l,u,d,f,p,m,h){return l-c>p-f?s?e(i,a,o,c,l,u,d,f,p,m,h):t(i,a,o,c,l,u,d,f,p,m,h):s?n(i,a,o,c,l,u,d,f,p,m,h):r(i,a,o,c,l,u,d,f,p,m,h)}return i}function i(e){return e?n():r()}t.partial=i(!1),t.full=i(!0)},7150:function(e,t,n){e.exports=k;var r=n(1888),i=n(8828),a=n(2455),o=a.partial,s=a.full,c=n(855),l=n(3545),u=n(8105),d=128,f=1<<22,p=1<<22,m=u(`!(lo>=p0)&&!(p1>=hi)`),h=u(`lo===p0`),g=u(`lo<p0`),_=u(`hi<=p0`),v=u(`lo<=p0&&p0<=hi`),y=u(`lo<p0&&p0<=hi`),b=6,x=2,S=1024,C=r.mallocInt32(S),w=r.mallocDouble(S);function T(e,t){var n=8*i.log2(t+1)*(e+1)|0,a=i.nextPow2(b*n);C.length<a&&(r.free(C),C=r.mallocInt32(a));var o=i.nextPow2(x*n);w.length<o&&(r.free(w),w=r.mallocDouble(o))}function E(e,t,n,r,i,a,o,s,c){var l=b*e;C[l]=t,C[l+1]=n,C[l+2]=r,C[l+3]=i,C[l+4]=a,C[l+5]=o;var u=x*e;w[u]=s,w[u+1]=c}function D(e,t,n,r,i,a,o,s,c,l,u){var d=2*e,f=c*d,p=l[f+t];e:for(var m=i,h=i*d;m<a;++m,h+=d){var g=o[h+t],_=o[h+t+e];if(!(p<g||_<p)&&!(r&&p===g)){for(var v=s[m],y=t+1;y<e;++y){var g=o[h+y],_=o[h+y+e],b=l[f+y],x=l[f+y+e];if(_<b||x<g)continue e}var S;if(S=r?n(u,v):n(v,u),S!==void 0)return S}}}function O(e,t,n,r,i,a,o,s,c,l){var u=2*e,d=s*u,f=c[d+t];e:for(var p=r,m=r*u;p<i;++p,m+=u){var h=o[p];if(h!==l){var g=a[m+t],_=a[m+t+e];if(!(f<g||_<f)){for(var v=t+1;v<e;++v){var g=a[m+v],_=a[m+v+e],y=c[d+v],b=c[d+v+e];if(_<y||b<g)continue e}var x=n(h,l);if(x!==void 0)return x}}}}function k(e,t,n,r,i,a,u,S,k){T(e,r+u);var A=0,j=2*e,M;for(E(A++,0,0,r,0,u,n?16:0,-1/0,1/0),n||E(A++,0,0,u,0,r,1,-1/0,1/0);A>0;){--A;var N=A*b,P=C[N],F=C[N+1],I=C[N+2],L=C[N+3],R=C[N+4],z=C[N+5],B=A*x,V=w[B],H=w[B+1],U=z&1,W=!!(z&16),G=i,K=a,q=S,J=k;if(U&&(G=S,K=k,q=i,J=a),!(z&2&&(I=g(e,P,F,I,G,K,H),F>=I))&&!(z&4&&(F=_(e,P,F,I,G,K,V),F>=I))){var Y=I-F,X=R-L;if(W){if(e*Y*(Y+X)<p){if(M=c.scanComplete(e,P,t,F,I,G,K,L,R,q,J),M!==void 0)return M;continue}}else if(e*Math.min(Y,X)<d){if(M=o(e,P,t,U,F,I,G,K,L,R,q,J),M!==void 0)return M;continue}else if(e*Y*X<f){if(M=c.scanBipartite(e,P,t,U,F,I,G,K,L,R,q,J),M!==void 0)return M;continue}var Z=m(e,P,F,I,G,K,V,H);if(F<Z)if(e*(Z-F)<d){if(M=s(e,P+1,t,F,Z,G,K,L,R,q,J),M!==void 0)return M}else if(P===e-2){if(M=U?c.sweepBipartite(e,t,L,R,q,J,F,Z,G,K):c.sweepBipartite(e,t,F,Z,G,K,L,R,q,J),M!==void 0)return M}else E(A++,P+1,F,Z,L,R,U,-1/0,1/0),E(A++,P+1,L,R,F,Z,U^1,-1/0,1/0);if(Z<I){var Q=l(e,P,L,R,q,J),ee=q[j*Q+P],te=h(e,P,Q,R,q,J,ee);if(te<R&&E(A++,P,Z,I,te,R,(U|4)+(W?16:0),ee,H),L<Q&&E(A++,P,Z,I,L,Q,(U|2)+(W?16:0),V,ee),Q+1===te){if(M=W?O(e,P,t,Z,I,G,K,Q,q,J[Q]):D(e,P,t,U,Z,I,G,K,Q,q,J[Q]),M!==void 0)return M}else if(Q<te){var ne;if(W){if(ne=v(e,P,Z,I,G,K,ee),Z<ne){var re=h(e,P,Z,ne,G,K,ee);if(P===e-2){if(Z<re&&(M=c.sweepComplete(e,t,Z,re,G,K,Q,te,q,J),M!==void 0)||re<ne&&(M=c.sweepBipartite(e,t,re,ne,G,K,Q,te,q,J),M!==void 0))return M}else Z<re&&E(A++,P+1,Z,re,Q,te,16,-1/0,1/0),re<ne&&(E(A++,P+1,re,ne,Q,te,0,-1/0,1/0),E(A++,P+1,Q,te,re,ne,1,-1/0,1/0))}}else ne=U?y(e,P,Z,I,G,K,ee):v(e,P,Z,I,G,K,ee),Z<ne&&(P===e-2?M=U?c.sweepBipartite(e,t,Q,te,q,J,Z,ne,G,K):c.sweepBipartite(e,t,Z,ne,G,K,Q,te,q,J):(E(A++,P+1,Z,ne,Q,te,U,-1/0,1/0),E(A++,P+1,Q,te,Z,ne,U^1,-1/0,1/0)))}}}}}},3545:function(e,t,n){e.exports=o;var r=n(8105)(`lo<p0`),i=8;function a(e,t,n,r,i,a){for(var o=2*e,s=o*(n+1)+t,c=n+1;c<r;++c,s+=o)for(var l=i[s],u=c,d=o*(c-1);u>n&&i[d+t]>l;--u,d-=o){for(var f=d,p=d+o,m=0;m<o;++m,++f,++p){var h=i[f];i[f]=i[p],i[p]=h}var g=a[u];a[u]=a[u-1],a[u-1]=g}}function o(e,t,n,o,s,c){if(o<=n+1)return n;for(var l=n,u=o,d=o+n>>>1,f=2*e,p=d,m=s[f*d+t];l<u;){if(u-l<i){a(e,t,l,u,s,c),m=s[f*d+t];break}var h=u-l,g=Math.random()*h+l|0,_=s[f*g+t],v=Math.random()*h+l|0,y=s[f*v+t],b=Math.random()*h+l|0,x=s[f*b+t];_<=y?x>=y?(p=v,m=y):_>=x?(p=g,m=_):(p=b,m=x):y>=x?(p=v,m=y):x>=_?(p=g,m=_):(p=b,m=x);for(var S=f*(u-1),C=f*p,w=0;w<f;++w,++S,++C){var T=s[S];s[S]=s[C],s[C]=T}var E=c[u-1];c[u-1]=c[p],c[p]=E,p=r(e,t,l,u-1,s,c,m);for(var S=f*(u-1),C=f*p,w=0;w<f;++w,++S,++C){var T=s[S];s[S]=s[C],s[C]=T}var E=c[u-1];if(c[u-1]=c[p],c[p]=E,d<p){for(u=p-1;l<u&&s[f*(u-1)+t]===m;)--u;u+=1}else if(p<d)for(l=p+1;l<u&&s[f*l+t]===m;)l+=1;else break}return r(e,t,n,d,s,c,s[f*d+t])}},8105:function(e){e.exports=n;var t={"lo===p0":r,"lo<p0":i,"lo<=p0":a,"hi<=p0":o,"lo<p0&&p0<=hi":c,"lo<=p0&&p0<=hi":s,"!(lo>=p0)&&!(p1>=hi)":l};function n(e){return t[e]}function r(e,t,n,r,i,a,o){for(var s=2*e,c=s*n,l=c,u=n,d=t,f=e+t,p=n;r>p;++p,c+=s)if(i[c+d]===o)if(u===p)u+=1,l+=s;else{for(var m=0;s>m;++m){var h=i[c+m];i[c+m]=i[l],i[l++]=h}var g=a[p];a[p]=a[u],a[u++]=g}return u}function i(e,t,n,r,i,a,o){for(var s=2*e,c=s*n,l=c,u=n,d=t,f=e+t,p=n;r>p;++p,c+=s)if(i[c+d]<o)if(u===p)u+=1,l+=s;else{for(var m=0;s>m;++m){var h=i[c+m];i[c+m]=i[l],i[l++]=h}var g=a[p];a[p]=a[u],a[u++]=g}return u}function a(e,t,n,r,i,a,o){for(var s=2*e,c=s*n,l=c,u=n,d=e+t,f=n;r>f;++f,c+=s)if(i[c+d]<=o)if(u===f)u+=1,l+=s;else{for(var p=0;s>p;++p){var m=i[c+p];i[c+p]=i[l],i[l++]=m}var h=a[f];a[f]=a[u],a[u++]=h}return u}function o(e,t,n,r,i,a,o){for(var s=2*e,c=s*n,l=c,u=n,d=e+t,f=n;r>f;++f,c+=s)if(i[c+d]<=o)if(u===f)u+=1,l+=s;else{for(var p=0;s>p;++p){var m=i[c+p];i[c+p]=i[l],i[l++]=m}var h=a[f];a[f]=a[u],a[u++]=h}return u}function s(e,t,n,r,i,a,o){for(var s=2*e,c=s*n,l=c,u=n,d=t,f=e+t,p=n;r>p;++p,c+=s){var m=i[c+d],h=i[c+f];if(m<=o&&o<=h)if(u===p)u+=1,l+=s;else{for(var g=0;s>g;++g){var _=i[c+g];i[c+g]=i[l],i[l++]=_}var v=a[p];a[p]=a[u],a[u++]=v}}return u}function c(e,t,n,r,i,a,o){for(var s=2*e,c=s*n,l=c,u=n,d=t,f=e+t,p=n;r>p;++p,c+=s){var m=i[c+d],h=i[c+f];if(m<o&&o<=h)if(u===p)u+=1,l+=s;else{for(var g=0;s>g;++g){var _=i[c+g];i[c+g]=i[l],i[l++]=_}var v=a[p];a[p]=a[u],a[u++]=v}}return u}function l(e,t,n,r,i,a,o,s){for(var c=2*e,l=c*n,u=l,d=n,f=t,p=e+t,m=n;r>m;++m,l+=c){var h=i[l+f],g=i[l+p];if(!(h>=o)&&!(s>=g))if(d===m)d+=1,u+=c;else{for(var _=0;c>_;++_){var v=i[l+_];i[l+_]=i[u],i[u++]=v}var y=a[m];a[m]=a[d],a[d++]=y}}return d}},4192:function(e){e.exports=n;var t=32;function n(e,n){n<=4*t?r(0,n-1,e):u(0,n-1,e)}function r(e,t,n){for(var r=2*(e+1),i=e+1;i<=t;++i){for(var a=n[r++],o=n[r++],s=i,c=r-2;s-- >e;){var l=n[c-2],u=n[c-1];if(l<a||l===a&&u<o)break;n[c]=l,n[c+1]=u,c-=2}n[c]=a,n[c+1]=o}}function i(e,t,n){e*=2,t*=2;var r=n[e],i=n[e+1];n[e]=n[t],n[e+1]=n[t+1],n[t]=r,n[t+1]=i}function a(e,t,n){e*=2,t*=2,n[e]=n[t],n[e+1]=n[t+1]}function o(e,t,n,r){e*=2,t*=2,n*=2;var i=r[e],a=r[e+1];r[e]=r[t],r[e+1]=r[t+1],r[t]=r[n],r[t+1]=r[n+1],r[n]=i,r[n+1]=a}function s(e,t,n,r,i){e*=2,t*=2,i[e]=i[t],i[t]=n,i[e+1]=i[t+1],i[t+1]=r}function c(e,t,n){e*=2,t*=2;var r=n[e],i=n[t];return r<i?!1:r===i?n[e+1]>n[t+1]:!0}function l(e,t,n,r){e*=2;var i=r[e];return i<t?!0:i===t?r[e+1]<n:!1}function u(e,n,d){var f=(n-e+1)/6|0,p=e+f,m=n-f,h=e+n>>1,g=h-f,_=h+f,v=p,y=g,b=h,x=_,S=m,C=e+1,w=n-1,T=0;c(v,y,d)&&(T=v,v=y,y=T),c(x,S,d)&&(T=x,x=S,S=T),c(v,b,d)&&(T=v,v=b,b=T),c(y,b,d)&&(T=y,y=b,b=T),c(v,x,d)&&(T=v,v=x,x=T),c(b,x,d)&&(T=b,b=x,x=T),c(y,S,d)&&(T=y,y=S,S=T),c(y,b,d)&&(T=y,y=b,b=T),c(x,S,d)&&(T=x,x=S,S=T);for(var E=d[2*y],D=d[2*y+1],O=d[2*x],k=d[2*x+1],A=2*v,j=2*b,M=2*S,N=2*p,P=2*h,F=2*m,I=0;I<2;++I){var L=d[A+I],R=d[j+I],z=d[M+I];d[N+I]=L,d[P+I]=R,d[F+I]=z}a(g,e,d),a(_,n,d);for(var B=C;B<=w;++B)if(l(B,E,D,d))B!==C&&i(B,C,d),++C;else if(!l(B,O,k,d))for(;;)if(l(w,O,k,d)){l(w,E,D,d)?(o(B,C,w,d),++C,--w):(i(B,w,d),--w);break}else{if(--w<B)break;continue}s(e,C-1,E,D,d),s(n,w+1,O,k,d),C-2-e<=t?r(e,C-2,d):u(e,C-2,d),n-(w+2)<=t?r(w+2,n,d):u(w+2,n,d),w-C<=t?r(C,w,d):u(C,w,d)}},855:function(e,t,n){e.exports={init:h,sweepBipartite:v,sweepComplete:y,scanBipartite:b,scanComplete:x};var r=n(1888),i=n(8828),a=n(4192),o=1<<28,s=1024,c=r.mallocInt32(s),l=r.mallocInt32(s),u=r.mallocInt32(s),d=r.mallocInt32(s),f=r.mallocInt32(s),p=r.mallocInt32(s),m=r.mallocDouble(s*8);function h(e){var t=i.nextPow2(e);c.length<t&&(r.free(c),c=r.mallocInt32(t)),l.length<t&&(r.free(l),l=r.mallocInt32(t)),u.length<t&&(r.free(u),u=r.mallocInt32(t)),d.length<t&&(r.free(d),d=r.mallocInt32(t)),f.length<t&&(r.free(f),f=r.mallocInt32(t)),p.length<t&&(r.free(p),p=r.mallocInt32(t));var n=8*t;m.length<n&&(r.free(m),m=r.mallocDouble(n))}function g(e,t,n,r){var i=t[r],a=e[n-1];e[i]=a,t[a]=i}function _(e,t,n,r){e[n]=r,t[r]=n}function v(e,t,n,r,i,s,f,p,h,v){for(var y=0,b=2*e,x=e-1,S=b-1,C=n;C<r;++C){var w=s[C],T=b*C;m[y++]=i[T+x],m[y++]=-(w+1),m[y++]=i[T+S],m[y++]=w}for(var C=f;C<p;++C){var w=v[C]+o,E=b*C;m[y++]=h[E+x],m[y++]=-w,m[y++]=h[E+S],m[y++]=w}var D=y>>>1;a(m,D);for(var O=0,k=0,C=0;C<D;++C){var A=m[2*C+1]|0;if(A>=o)A=A-o|0,g(u,d,k--,A);else if(A>=0)g(c,l,O--,A);else if(A<=-o){A=-A-o|0;for(var j=0;j<O;++j){var M=t(c[j],A);if(M!==void 0)return M}_(u,d,k++,A)}else{A=-A-1|0;for(var j=0;j<k;++j){var M=t(A,u[j]);if(M!==void 0)return M}_(c,l,O++,A)}}}function y(e,t,n,r,i,o,s,h,v,y){for(var b=0,x=2*e,S=e-1,C=x-1,w=n;w<r;++w){var T=o[w]+1<<1,E=x*w;m[b++]=i[E+S],m[b++]=-T,m[b++]=i[E+C],m[b++]=T}for(var w=s;w<h;++w){var T=y[w]+1<<1,D=x*w;m[b++]=v[D+S],m[b++]=-T|1,m[b++]=v[D+C],m[b++]=T|1}var O=b>>>1;a(m,O);for(var k=0,A=0,j=0,w=0;w<O;++w){var M=m[2*w+1]|0,N=M&1;if(w<O-1&&M>>1==m[2*w+3]>>1&&(N=2,w+=1),M<0){for(var P=-(M>>1)-1,F=0;F<j;++F){var I=t(f[F],P);if(I!==void 0)return I}if(N!==0)for(var F=0;F<k;++F){var I=t(c[F],P);if(I!==void 0)return I}if(N!==1)for(var F=0;F<A;++F){var I=t(u[F],P);if(I!==void 0)return I}N===0?_(c,l,k++,P):N===1?_(u,d,A++,P):N===2&&_(f,p,j++,P)}else{var P=(M>>1)-1;N===0?g(c,l,k--,P):N===1?g(u,d,A--,P):N===2&&g(f,p,j--,P)}}}function b(e,t,n,r,i,s,u,d,f,p,h,v){var y=0,b=2*e,x=t,S=t+e,C=1,w=1;r?w=o:C=o;for(var T=i;T<s;++T){var E=T+C,D=b*T;m[y++]=u[D+x],m[y++]=-E,m[y++]=u[D+S],m[y++]=E}for(var T=f;T<p;++T){var E=T+w,O=b*T;m[y++]=h[O+x],m[y++]=-E}var k=y>>>1;a(m,k);for(var A=0,T=0;T<k;++T){var j=m[2*T+1]|0;if(j<0){var E=-j,M=!1;if(E>=o?(M=!r,E-=o):(M=!!r,--E),M)_(c,l,A++,E);else{var N=v[E],P=b*E,F=h[P+t+1],I=h[P+t+1+e];e:for(var L=0;L<A;++L){var R=c[L],z=b*R;if(!(I<u[z+t+1]||u[z+t+1+e]<F)){for(var B=t+2;B<e;++B)if(h[P+B+e]<u[z+B]||u[z+B+e]<h[P+B])continue e;var V=d[R],H;if(H=r?n(N,V):n(V,N),H!==void 0)return H}}}}else g(c,l,A--,j-C)}}function x(e,t,n,r,i,s,l,u,d,f,p){for(var h=0,g=2*e,_=t,v=t+e,y=r;y<i;++y){var b=y+o,x=g*y;m[h++]=s[x+_],m[h++]=-b,m[h++]=s[x+v],m[h++]=b}for(var y=u;y<d;++y){var b=y+1,S=g*y;m[h++]=f[S+_],m[h++]=-b}var C=h>>>1;a(m,C);for(var w=0,y=0;y<C;++y){var T=m[2*y+1]|0;if(T<0){var b=-T;if(b>=o)c[w++]=b-o;else{--b;var E=p[b],D=g*b,O=f[D+t+1],k=f[D+t+1+e];e:for(var A=0;A<w;++A){var j=c[A],M=l[j];if(M===E)break;var N=g*j;if(!(k<s[N+t+1]||s[N+t+1+e]<O)){for(var P=t+2;P<e;++P)if(f[D+P+e]<s[N+P]||s[N+P+e]<f[D+P])continue e;var F=n(M,E);if(F!==void 0)return F}}}}else{for(var b=T-o,A=w-1;A>=0;--A)if(c[A]===b){for(var P=A+1;P<w;++P)c[P-1]=c[P];break}--w}}}},2538:function(e,t,n){var r=n(8902),i=n(5542),a=n(2272),o=n(5023);e.exports=d;function s(e){return[Math.min(e[0],e[1]),Math.max(e[0],e[1])]}function c(e,t){return e[0]-t[0]||e[1]-t[1]}function l(e){return e.map(s).sort(c)}function u(e,t,n){return t in e?e[t]:n}function d(e,t,n){Array.isArray(t)?(n||={},t||=[]):(n=t||{},t=[]);var s=!!u(n,`delaunay`,!0),c=!!u(n,`interior`,!0),d=!!u(n,`exterior`,!0),f=!!u(n,`infinity`,!1);if(!c&&!d||e.length===0)return[];var p=r(e,t);if(s||c!==d||f){for(var m=i(e.length,l(t)),h=0;h<p.length;++h){var g=p[h];m.addTriangle(g[0],g[1],g[2])}return s&&a(e,m),d?c?f?o(m,0,f):m.cells():o(m,1,f):o(m,-1)}else return p}},2272:function(e,t,n){var r=n(2646)[4];n(2478),e.exports=a;function i(e,t,n,i,a,o){var s=t.opposite(i,a);if(!(s<0)){if(a<i){var c=i;i=a,a=c,c=o,o=s,s=c}t.isConstraint(i,a)||r(e[i],e[a],e[o],e[s])<0&&n.push(i,a)}}function a(e,t){for(var n=[],a=e.length,o=t.stars,s=0;s<a;++s)for(var c=o[s],l=1;l<c.length;l+=2){var u=c[l];if(!(u<s)&&!t.isConstraint(s,u)){for(var d=c[l-1],f=-1,p=1;p<c.length;p+=2)if(c[p-1]===u){f=c[p];break}f<0||r(e[s],e[u],e[d],e[f])<0&&n.push(s,u)}}for(;n.length>0;){for(var u=n.pop(),s=n.pop(),d=-1,f=-1,c=o[s],m=1;m<c.length;m+=2){var h=c[m-1],g=c[m];h===u?f=g:g===u&&(d=h)}d<0||f<0||r(e[s],e[u],e[d],e[f])>=0||(t.flip(s,u),i(e,t,n,d,s,f),i(e,t,n,s,f,d),i(e,t,n,f,u,d),i(e,t,n,u,d,f))}}},5023:function(e,t,n){var r=n(2478);e.exports=l;function i(e,t,n,r,i,a,o){this.cells=e,this.neighbor=t,this.flags=r,this.constraint=n,this.active=i,this.next=a,this.boundary=o}var a=i.prototype;function o(e,t){return e[0]-t[0]||e[1]-t[1]||e[2]-t[2]}a.locate=function(){var e=[0,0,0];return function(t,n,i){var a=t,s=n,c=i;return n<i?n<t&&(a=n,s=i,c=t):i<t&&(a=i,s=t,c=n),a<0?-1:(e[0]=a,e[1]=s,e[2]=c,r.eq(this.cells,e,o))}}();function s(e,t){for(var n=e.cells(),r=n.length,a=0;a<r;++a){var s=n[a],c=s[0],l=s[1],u=s[2];l<u?l<c&&(s[0]=l,s[1]=u,s[2]=c):u<c&&(s[0]=u,s[1]=c,s[2]=l)}n.sort(o);for(var d=Array(r),a=0;a<d.length;++a)d[a]=0;var f=[],p=[],m=Array(3*r),h=Array(3*r),g=null;t&&(g=[]);for(var _=new i(n,m,h,d,f,p,g),a=0;a<r;++a)for(var s=n[a],v=0;v<3;++v){var c=s[v],l=s[(v+1)%3],y=m[3*a+v]=_.locate(l,c,e.opposite(l,c)),b=h[3*a+v]=e.isConstraint(c,l);y<0&&(b?p.push(a):(f.push(a),d[a]=1),t&&g.push([l,c,-1]))}return _}function c(e,t,n){for(var r=0,i=0;i<e.length;++i)t[i]===n&&(e[r++]=e[i]);return e.length=r,e}function l(e,t,n){var r=s(e,n);if(t===0)return n?r.cells.concat(r.boundary):r.cells;for(var i=1,a=r.active,o=r.next,l=r.flags,u=r.cells,d=r.constraint,f=r.neighbor;a.length>0||o.length>0;){for(;a.length>0;){var p=a.pop();if(l[p]!==-i){l[p]=i;for(var m=u[p],h=0;h<3;++h){var g=f[3*p+h];g>=0&&l[g]===0&&(d[3*p+h]?o.push(g):(a.push(g),l[g]=i))}}}var _=o;o=a,a=_,o.length=0,i=-i}var v=c(u,l,t);return n?v.concat(r.boundary):v}},8902:function(e,t,n){var r=n(2478),i=n(3250)[3],a=0,o=1,s=2;e.exports=g;function c(e,t,n,r,i){this.a=e,this.b=t,this.idx=n,this.lowerIds=r,this.upperIds=i}function l(e,t,n,r){this.a=e,this.b=t,this.type=n,this.idx=r}function u(e,t){var n=e.a[0]-t.a[0]||e.a[1]-t.a[1]||e.type-t.type;return n||e.type!==a&&(n=i(e.a,e.b,t.b),n)?n:e.idx-t.idx}function d(e,t){return i(e.a,e.b,t)}function f(e,t,n,a,o){for(var s=r.lt(t,a,d),c=r.gt(t,a,d),l=s;l<c;++l){for(var u=t[l],f=u.lowerIds,p=f.length;p>1&&i(n[f[p-2]],n[f[p-1]],a)>0;)e.push([f[p-1],f[p-2],o]),--p;f.length=p,f.push(o);for(var m=u.upperIds,p=m.length;p>1&&i(n[m[p-2]],n[m[p-1]],a)<0;)e.push([m[p-2],m[p-1],o]),--p;m.length=p,m.push(o)}}function p(e,t){var n;return n=e.a[0]<t.a[0]?i(e.a,e.b,t.a):i(t.b,t.a,e.a),n||(n=t.b[0]<e.b[0]?i(e.a,e.b,t.b):i(t.b,t.a,e.b),n||e.idx-t.idx)}function m(e,t,n){var i=r.le(e,n,p),a=e[i],o=a.upperIds,s=o[o.length-1];a.upperIds=[s],e.splice(i+1,0,new c(n.a,n.b,n.idx,[s],o))}function h(e,t,n){var i=n.a;n.a=n.b,n.b=i;var a=r.eq(e,n,p),o=e[a],s=e[a-1];s.upperIds=o.upperIds,e.splice(a,1)}function g(e,t){for(var n=e.length,r=t.length,i=[],d=0;d<n;++d)i.push(new l(e[d],null,a,d));for(var d=0;d<r;++d){var p=t[d],g=e[p[0]],_=e[p[1]];g[0]<_[0]?i.push(new l(g,_,s,d),new l(_,g,o,d)):g[0]>_[0]&&i.push(new l(_,g,s,d),new l(g,_,o,d))}i.sort(u);for(var v=i[0].a[0]-(1+Math.abs(i[0].a[0]))*2**-52,y=[new c([v,1],[v,0],-1,[],[],[],[])],b=[],d=0,x=i.length;d<x;++d){var S=i[d],C=S.type;C===a?f(b,y,e,S.a,S.idx):C===s?m(y,e,S):h(y,e,S)}return b}},5542:function(e,t,n){var r=n(2478);e.exports=s;function i(e,t){this.stars=e,this.edges=t}var a=i.prototype;function o(e,t,n){for(var r=1,i=e.length;r<i;r+=2)if(e[r-1]===t&&e[r]===n){e[r-1]=e[i-2],e[r]=e[i-1],e.length=i-2;return}}a.isConstraint=function(){var e=[0,0];function t(e,t){return e[0]-t[0]||e[1]-t[1]}return function(n,i){return e[0]=Math.min(n,i),e[1]=Math.max(n,i),r.eq(this.edges,e,t)>=0}}(),a.removeTriangle=function(e,t,n){var r=this.stars;o(r[e],t,n),o(r[t],n,e),o(r[n],e,t)},a.addTriangle=function(e,t,n){var r=this.stars;r[e].push(t,n),r[t].push(n,e),r[n].push(e,t)},a.opposite=function(e,t){for(var n=this.stars[t],r=1,i=n.length;r<i;r+=2)if(n[r]===e)return n[r-1];return-1},a.flip=function(e,t){var n=this.opposite(e,t),r=this.opposite(t,e);this.removeTriangle(e,t,n),this.removeTriangle(t,e,r),this.addTriangle(e,r,n),this.addTriangle(t,n,r)},a.edges=function(){for(var e=this.stars,t=[],n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length;a<o;a+=2)t.push([i[a],i[a+1]]);return t},a.cells=function(){for(var e=this.stars,t=[],n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length;a<o;a+=2){var s=i[a],c=i[a+1];n<Math.min(s,c)&&t.push([n,s,c])}return t};function s(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=[];return new i(n,t)}},2419:function(e){e.exports=t;function t(e){for(var t=1,n=1;n<e.length;++n)for(var r=0;r<n;++r)if(e[n]<e[r])t=-t;else if(e[r]===e[n])return 0;return t}},3628:function(e,t,n){var r=n(1338),i=n(727);function a(e,t){for(var n=0,r=e.length,i=0;i<r;++i)n+=e[i]*t[i];return n}function o(e){var t=e.length;if(t===0)return[];e[0].length;var n=r([e.length+1,e.length+1],1),o=r([e.length+1],1);n[t][t]=0;for(var s=0;s<t;++s){for(var c=0;c<=s;++c)n[c][s]=n[s][c]=2*a(e[s],e[c]);o[s]=a(e[s],e[s])}for(var l=i(n,o),u=0,d=l[t+1],s=0;s<d.length;++s)u+=d[s];for(var f=Array(t),s=0;s<t;++s){for(var d=l[s],p=0,c=0;c<d.length;++c)p+=d[c];f[s]=p/u}return f}function s(e){if(e.length===0)return[];for(var t=e[0].length,n=r([t]),i=o(e),a=0;a<e.length;++a)for(var s=0;s<t;++s)n[s]+=e[a][s]*i[a];return n}s.barycenetric=o,e.exports=s},6037:function(e,t,n){e.exports=i;var r=n(3628);function i(e){for(var t=r(e),n=0,i=0;i<e.length;++i)for(var a=e[i],o=0;o<t.length;++o)n+=(a[o]-t[o])**2;return Math.sqrt(n/e.length)}},332:function(e,t,n){e.exports=w;var r=n(1755),i=n(6867),a=n(1125),o=n(7842),s=n(1318),c=n(946),l=n(5838),u=n(1278),d=n(3637);function f(e){var t=c(e);return[u(t,-1/0),u(t,1/0)]}function p(e,t){for(var n=Array(t.length),r=0;r<t.length;++r){var i=t[r],a=e[i[0]],o=e[i[1]];n[r]=[u(Math.min(a[0],o[0]),-1/0),u(Math.min(a[1],o[1]),-1/0),u(Math.max(a[0],o[0]),1/0),u(Math.max(a[1],o[1]),1/0)]}return n}function m(e){for(var t=Array(e.length),n=0;n<e.length;++n){var r=e[n];t[n]=[u(r[0],-1/0),u(r[1],-1/0),u(r[0],1/0),u(r[1],1/0)]}return t}function h(e,t,n){var r=[];return i(n,function(n,i){var o=t[n],s=t[i];if(!(o[0]===s[0]||o[0]===s[1]||o[1]===s[0]||o[1]===s[1])){var c=e[o[0]],l=e[o[1]],u=e[s[0]],d=e[s[1]];a(c,l,u,d)&&r.push([n,i])}}),r}function g(e,t,n,r){var o=[];return i(n,r,function(n,r){var i=t[n];if(!(i[0]===r||i[1]===r)){var s=e[r],c=e[i[0]],l=e[i[1]];a(c,l,s,s)&&o.push([n,r])}}),o}function _(e,t,n,r,i){var a,u,f=e.map(function(e){return[o(e[0]),o(e[1])]});for(a=0;a<n.length;++a){var p=n[a];u=p[0];var m=p[1],h=t[u],g=t[m],_=d(l(e[h[0]]),l(e[h[1]]),l(e[g[0]]),l(e[g[1]]));if(_){var v=e.length;e.push([c(_[0]),c(_[1])]),f.push(_),r.push([u,v],[m,v])}}for(r.sort(function(e,t){if(e[0]!==t[0])return e[0]-t[0];var n=f[e[1]],r=f[t[1]];return s(n[0],r[0])||s(n[1],r[1])}),a=r.length-1;a>=0;--a){var y=r[a];u=y[0];var b=t[u],x=b[0],S=b[1],C=e[x],w=e[S];if((C[0]-w[0]||C[1]-w[1])<0){var T=x;x=S,S=T}b[0]=x;var E=b[1]=y[1],D;for(i&&(D=b[2]);a>0&&r[a-1][0]===u;){var y=r[--a],O=y[1];i?t.push([E,O,D]):t.push([E,O]),E=O}i?t.push([E,S,D]):t.push([E,S])}return f}function v(e,t,n){for(var a=t.length,o=new r(a),s=[],c=0;c<t.length;++c){var l=t[c],d=f(l[0]),p=f(l[1]);s.push([u(d[0],-1/0),u(p[0],-1/0),u(d[1],1/0),u(p[1],1/0)])}i(s,function(e,t){o.link(e,t)});for(var m=!0,h=Array(a),c=0;c<a;++c){var g=o.find(c);g!==c&&(m=!1,e[g]=[Math.min(e[c][0],e[g][0]),Math.min(e[c][1],e[g][1])])}if(m)return null;for(var _=0,c=0;c<a;++c){var g=o.find(c);g===c?(h[c]=_,e[_++]=e[c]):h[c]=-1}e.length=_;for(var c=0;c<a;++c)h[c]<0&&(h[c]=h[o.find(c)]);return h}function y(e,t){return e[0]-t[0]||e[1]-t[1]}function b(e,t){return e[0]-t[0]||e[1]-t[1]||(e[2]<t[2]?-1:e[2]>t[2]?1:0)}function x(e,t,n){if(e.length!==0){if(t)for(var r=0;r<e.length;++r){var i=e[r],a=t[i[0]],o=t[i[1]];i[0]=Math.min(a,o),i[1]=Math.max(a,o)}else for(var r=0;r<e.length;++r){var i=e[r],a=i[0],o=i[1];i[0]=Math.min(a,o),i[1]=Math.max(a,o)}n?e.sort(b):e.sort(y);for(var s=1,r=1;r<e.length;++r){var c=e[r-1],l=e[r];l[0]===c[0]&&l[1]===c[1]&&(!n||l[2]===c[2])||(e[s++]=l)}e.length=s}}function S(e,t,n){var r=v(e,[],m(e));return x(t,r,n),!!r}function C(e,t,n){var r=p(e,t),i=h(e,t,r),a=m(e),o=g(e,t,r,a),s=v(e,_(e,t,i,o,n),a);return x(t,s,n),s?!0:i.length>0||o.length>0}function w(e,t,n){var r;if(n){r=t;for(var i=Array(t.length),a=0;a<t.length;++a){var o=t[a];i[a]=[o[0],o[1],n[a]]}t=i}for(var s=S(e,t,!!n);C(e,t,!!n);)s=!0;if(n&&s){r.length=0,n.length=0;for(var a=0;a<t.length;++a){var o=t[a];r.push([o[0],o[1]]),n.push(o[2])}}return s}},3637:function(e,t,n){e.exports=d;var r=n(6504),i=n(8697),a=n(5572),o=n(7721),s=n(544),c=n(2653),l=n(8987);function u(e,t){return a(r(e[0],t[1]),r(e[1],t[0]))}function d(e,t,n,r){var a=s(t,e),d=s(r,n),f=u(a,d);return o(f)===0?null:c(e,l(a,i(u(d,s(e,n)),f)))}},3642:function(e){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(e,t,n){var r=n(3642),i=n(395);e.exports=a;function a(e){var t,n,a,l,u,d,f,p,m,h,g;if(e||={},p=(e.nshades||72)-1,f=e.format||`hex`,d=e.colormap,d||=`jet`,typeof d==`string`){if(d=d.toLowerCase(),!r[d])throw Error(d+` not a supported colorscale`);u=r[d]}else if(Array.isArray(d))u=d.slice();else throw Error(`unsupported colormap option`,d);if(u.length>p+1)throw Error(d+` map requires nshades to be at least size `+u.length);h=Array.isArray(e.alpha)?e.alpha.length===2?e.alpha.slice():[1,1]:typeof e.alpha==`number`?[e.alpha,e.alpha]:[1,1],t=u.map(function(e){return Math.round(e.index*p)}),h[0]=Math.min(Math.max(h[0],0),1),h[1]=Math.min(Math.max(h[1],0),1);var _=u.map(function(e,t){var n=u[t].index,r=u[t].rgb.slice();return r.length===4&&r[3]>=0&&r[3]<=1||(r[3]=h[0]+(h[1]-h[0])*n),r}),m=[];for(g=0;g<t.length-1;++g){l=t[g+1]-t[g],n=_[g],a=_[g+1];for(var v=0;v<l;v++){var y=v/l;m.push([Math.round(i(n[0],a[0],y)),Math.round(i(n[1],a[1],y)),Math.round(i(n[2],a[2],y)),i(n[3],a[3],y)])}}return m.push(u[u.length-1].rgb.concat(h[1])),f===`hex`?m=m.map(s):f===`rgbaString`?m=m.map(c):f===`float`&&(m=m.map(o)),m}function o(e){return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function s(e){for(var t,n=`#`,r=0;r<3;++r)t=e[r],t=t.toString(16),n+=(`00`+t).substr(t.length);return n}function c(e){return`rgba(`+e.join(`,`)+`)`}},3140:function(e,t,n){e.exports=l;var r=n(3250),i=n(8572),a=n(9362),o=n(5382),s=n(8210);function c(e,t,n){var r=a(e[0],-t[0]),i=a(e[1],-t[1]),c=a(n[0],-t[0]),l=a(n[1],-t[1]),u=s(o(r,c),o(i,l));return u[u.length-1]>=0}function l(e,t,n,a){var o=r(t,n,a);if(o===0){var s=i(r(e,t,n)),l=i(r(e,t,a));if(s===l){if(s===0){var u=c(e,t,n);return u===c(e,t,a)?0:u?1:-1}return 0}else{if(l===0)return s>0||c(e,t,a)?-1:1;if(s===0)return l>0||c(e,t,n)?1:-1}return i(l-s)}var d=r(e,t,n);return d>0?o>0&&r(e,t,a)>0?1:-1:d<0?o>0||r(e,t,a)>0?1:-1:r(e,t,a)>0||c(e,t,n)?1:-1}},8572:function(e){e.exports=function(e){return e<0?-1:e>0?1:0}},8507:function(e){e.exports=r;var t=Math.min;function n(e,t){return e-t}function r(e,r){var i=e.length,a=e.length-r.length;if(a)return a;switch(i){case 0:return 0;case 1:return e[0]-r[0];case 2:return e[0]+e[1]-r[0]-r[1]||t(e[0],e[1])-t(r[0],r[1]);case 3:var o=e[0]+e[1],s=r[0]+r[1];if(a=o+e[2]-(s+r[2]),a)return a;var c=t(e[0],e[1]),l=t(r[0],r[1]);return t(c,e[2])-t(l,r[2])||t(c+e[2],o)-t(l+r[2],s);case 4:var u=e[0],d=e[1],f=e[2],p=e[3],m=r[0],h=r[1],g=r[2],_=r[3];return u+d+f+p-(m+h+g+_)||t(u,d,f,p)-t(m,h,g,_,m)||t(u+d,u+f,u+p,d+f,d+p,f+p)-t(m+h,m+g,m+_,h+g,h+_,g+_)||t(u+d+f,u+d+p,u+f+p,d+f+p)-t(m+h+g,m+h+_,m+g+_,h+g+_);default:for(var v=e.slice().sort(n),y=r.slice().sort(n),b=0;b<i;++b)if(a=v[b]-y[b],a)return a;return 0}}},3788:function(e,t,n){var r=n(8507),i=n(2419);e.exports=a;function a(e,t){return r(e,t)||i(e)-i(t)}},7352:function(e,t,n){var r=n(5721),i=n(4750),a=n(2690);e.exports=o;function o(e){var t=e.length;if(t===0)return[];if(t===1)return[[0]];var n=e[0].length;return n===0?[]:n===1?r(e):n===2?i(e):a(e,n)}},5721:function(e){e.exports=t;function t(e){for(var t=0,n=0,r=1;r<e.length;++r)e[r][0]<e[t][0]&&(t=r),e[r][0]>e[n][0]&&(n=r);return t<n?[[t],[n]]:t>n?[[n],[t]]:[[t]]}},4750:function(e,t,n){e.exports=i;var r=n(3090);function i(e){var t=r(e),n=t.length;if(n<=2)return[];for(var i=Array(n),a=t[n-1],o=0;o<n;++o){var s=t[o];i[o]=[a,s],a=s}return i}},2690:function(e,t,n){e.exports=s;var r=n(8954),i=n(3952);function a(e,t){for(var n=e.length,r=Array(n),i=0;i<t.length;++i)r[i]=e[t[i]];for(var a=t.length,i=0;i<n;++i)t.indexOf(i)<0&&(r[a++]=e[i]);return r}function o(e,t){for(var n=e.length,r=t.length,i=0;i<n;++i)for(var a=e[i],o=0;o<a.length;++o){var s=a[o];if(s<r)a[o]=t[s];else{s-=r;for(var c=0;c<r;++c)s>=t[c]&&(s+=1);a[o]=s}}return e}function s(e,t){try{return r(e,!0)}catch{var n=i(e);return n.length<=t?[]:o(r(a(e,n),!0),n)}}},4769:function(e){function t(e,t,n,r,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,c=-6*i*i+6*i,l=3*i*i-2*i;if(e.length){a||=Array(e.length);for(var u=e.length-1;u>=0;--u)a[u]=o*e[u]+s*t[u]+c*n[u]+l*r[u];return a}return o*e+s*t+c*n[u]+l*r}function n(e,t,n,r,i,a){var o=i-1,s=i*i,c=o*o,l=(1+2*i)*c,u=i*c,d=s*(3-2*i),f=s*o;if(e.length){a||=Array(e.length);for(var p=e.length-1;p>=0;--p)a[p]=l*e[p]+u*t[p]+d*n[p]+f*r[p];return a}return l*e+u*t+d*n+f*r}e.exports=n,e.exports.derivative=t},7642:function(e,t,n){var r=n(8954),i=n(1682);e.exports=c;function a(e,t){this.point=e,this.index=t}function o(e,t){for(var n=e.point,r=t.point,i=n.length,a=0;a<i;++a){var o=r[a]-n[a];if(o)return o}return 0}function s(e,t,n){if(e===1)return n?[[-1,0]]:[];var r=t.map(function(e,t){return[e[0],t]});r.sort(function(e,t){return e[0]-t[0]});for(var i=Array(e-1),a=1;a<e;++a){var o=r[a-1],s=r[a];i[a-1]=[o[1],s[1]]}return n&&i.push([-1,i[0][1]],[i[e-1][1],-1]),i}function c(e,t){var n=e.length;if(n===0)return[];var c=e[0].length;if(c<1)return[];if(c===1)return s(n,e,t);for(var l=Array(n),u=1,d=0;d<n;++d){for(var f=e[d],p=Array(c+1),m=0,h=0;h<c;++h){var g=f[h];p[h]=g,m+=g*g}p[c]=m,l[d]=new a(p,d),u=Math.max(m,u)}i(l,o),n=l.length;for(var _=Array(n+c+1),v=Array(n+c+1),y=(c+1)*(c+1)*u,b=Array(c+1),d=0;d<=c;++d)b[d]=0;b[c]=y,_[0]=b.slice(),v[0]=-1;for(var d=0;d<=c;++d){var p=b.slice();p[d]=1,_[d+1]=p,v[d+1]=-1}for(var d=0;d<n;++d){var x=l[d];_[d+c+1]=x.point,v[d+c+1]=x.index}var S=r(_,!1);if(S=t?S.filter(function(e){for(var t=0,n=0;n<=c;++n){var r=v[e[n]];if(r<0&&++t>=2)return!1;e[n]=r}return!0}):S.filter(function(e){for(var t=0;t<=c;++t){var n=v[e[t]];if(n<0)return!1;e[t]=n}return!0}),c&1)for(var d=0;d<S.length;++d){var x=S[d],p=x[0];x[0]=x[1],x[1]=p}return S}},2361:function(e){var t=!1;if(typeof Float64Array<`u`){var n=new Float64Array(1),r=new Uint32Array(n.buffer);if(n[0]=1,t=!0,r[1]===1072693248){let t=function(e,t){return r[0]=e,r[1]=t,n[0]},i=function(e){return n[0]=e,r[0]},a=function(e){return n[0]=e,r[1]};e.exports=function(e){return n[0]=e,[r[0],r[1]]},e.exports.pack=t,e.exports.lo=i,e.exports.hi=a}else if(r[0]===1072693248){let t=function(e,t){return r[1]=e,r[0]=t,n[0]},i=function(e){return n[0]=e,r[1]},a=function(e){return n[0]=e,r[0]};e.exports=function(e){return n[0]=e,[r[1],r[0]]},e.exports.pack=t,e.exports.lo=i,e.exports.hi=a}else t=!1}if(!t){let t=function(e,t){return i.writeUInt32LE(e,0,!0),i.writeUInt32LE(t,4,!0),i.readDoubleLE(0,!0)},n=function(e){return i.writeDoubleLE(e,0,!0),i.readUInt32LE(0,!0)},r=function(e){return i.writeDoubleLE(e,0,!0),i.readUInt32LE(4,!0)};var i=new Buffer(8);e.exports=function(e){return i.writeDoubleLE(e,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},e.exports.pack=t,e.exports.lo=n,e.exports.hi=r}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var n=e.exports.lo(t),r=e.exports.hi(t),i=r&(1<<20)-1;return r&2146435072&&(i+=1048576),[n,i]},e.exports.denormalized=function(t){return!(e.exports.hi(t)&2146435072)}},1338:function(e){function t(e,n,r){var i=e[r]|0;if(i<=0)return[];var a=Array(i),o;if(r===e.length-1)for(o=0;o<i;++o)a[o]=n;else for(o=0;o<i;++o)a[o]=t(e,n,r+1);return a}function n(e,t){var n,r;for(n=Array(e),r=0;r<e;++r)n[r]=t;return n}function r(e,r){switch(r===void 0&&(r=0),typeof e){case`number`:if(e>0)return n(e|0,r);break;case`object`:if(typeof e.length==`number`)return t(e,r,0);break}return[]}e.exports=r},3134:function(e,t,n){e.exports=i;var r=n(1682);function i(e,t){var n=e.length;if(typeof t!=`number`){t=0;for(var i=0;i<n;++i){var a=e[i];t=Math.max(t,a[0],a[1])}t=(t|0)+1}t|=0;for(var o=Array(t),i=0;i<t;++i)o[i]=[];for(var i=0;i<n;++i){var a=e[i];o[a[0]].push(a[1]),o[a[1]].push(a[0])}for(var s=0;s<t;++s)r(o[s],function(e,t){return e-t});return o}},5033:function(e){e.exports=t;function t(e,t,n){var r=t||0,i=n||1;return[[e[12]+e[0],e[13]+e[1],e[14]+e[2],e[15]+e[3]],[e[12]-e[0],e[13]-e[1],e[14]-e[2],e[15]-e[3]],[e[12]+e[4],e[13]+e[5],e[14]+e[6],e[15]+e[7]],[e[12]-e[4],e[13]-e[5],e[14]-e[6],e[15]-e[7]],[r*e[12]+e[8],r*e[13]+e[9],r*e[14]+e[10],r*e[15]+e[11]],[i*e[12]-e[8],i*e[13]-e[9],i*e[14]-e[10],i*e[15]-e[11]]]}},9215:function(e,t,n){e.exports=l;var r=n(4769),i=n(2478);function a(e,t,n){return Math.min(t,Math.max(e,n))}function o(e,t,n){this.dimension=e.length,this.bounds=[Array(this.dimension),Array(this.dimension)];for(var r=0;r<this.dimension;++r)this.bounds[0][r]=-1/0,this.bounds[1][r]=1/0;this._state=e.slice().reverse(),this._velocity=t.slice().reverse(),this._time=[n],this._scratch=[e.slice(),e.slice(),e.slice(),e.slice(),e.slice()]}var s=o.prototype;s.flush=function(e){var t=i.gt(this._time,e)-1;t<=0||(this._time.splice(0,t),this._state.splice(0,t*this.dimension),this._velocity.splice(0,t*this.dimension))},s.curve=function(e){var t=this._time,n=t.length,o=i.le(t,e),s=this._scratch[0],c=this._state,l=this._velocity,u=this.dimension,d=this.bounds;if(o<0)for(var f=u-1,p=0;p<u;++p,--f)s[p]=c[f];else if(o>=n-1)for(var f=c.length-1,m=e-t[n-1],p=0;p<u;++p,--f)s[p]=c[f]+m*l[f];else{for(var f=u*(o+1)-1,h=t[o],g=t[o+1]-h||1,_=this._scratch[1],v=this._scratch[2],y=this._scratch[3],b=this._scratch[4],x=!0,p=0;p<u;++p,--f)_[p]=c[f],y[p]=l[f]*g,v[p]=c[f+u],b[p]=l[f+u]*g,x=x&&_[p]===v[p]&&y[p]===b[p]&&y[p]===0;if(x)for(var p=0;p<u;++p)s[p]=_[p];else r(_,y,v,b,(e-h)/g,s)}for(var S=d[0],C=d[1],p=0;p<u;++p)s[p]=a(S[p],C[p],s[p]);return s},s.dcurve=function(e){var t=this._time,n=t.length,a=i.le(t,e),o=this._scratch[0],s=this._state,c=this._velocity,l=this.dimension;if(a>=n-1)for(var u=s.length-1,d=e-t[n-1],f=0;f<l;++f,--u)o[f]=c[u];else{for(var u=l*(a+1)-1,p=t[a],m=t[a+1]-p||1,h=this._scratch[1],g=this._scratch[2],_=this._scratch[3],v=this._scratch[4],y=!0,f=0;f<l;++f,--u)h[f]=s[u],_[f]=c[u]*m,g[f]=s[u+l],v[f]=c[u+l]*m,y=y&&h[f]===g[f]&&_[f]===v[f]&&_[f]===0;if(y)for(var f=0;f<l;++f)o[f]=0;else{r.derivative(h,_,g,v,(e-p)/m,o);for(var f=0;f<l;++f)o[f]/=m}}return o},s.lastT=function(){var e=this._time;return e[e.length-1]},s.stable=function(){for(var e=this._velocity,t=e.length,n=this.dimension-1;n>=0;--n)if(e[--t])return!1;return!0},s.jump=function(e){var t=this.lastT(),n=this.dimension;if(!(e<t||arguments.length!==n+1)){var r=this._state,i=this._velocity,o=r.length-this.dimension,s=this.bounds,c=s[0],l=s[1];this._time.push(t,e);for(var u=0;u<2;++u)for(var d=0;d<n;++d)r.push(r[o++]),i.push(0);this._time.push(e);for(var d=n;d>0;--d)r.push(a(c[d-1],l[d-1],arguments[d])),i.push(0)}},s.push=function(e){var t=this.lastT(),n=this.dimension;if(!(e<t||arguments.length!==n+1)){var r=this._state,i=this._velocity,o=r.length-this.dimension,s=e-t,c=this.bounds,l=c[0],u=c[1],d=s>1e-6?1/s:0;this._time.push(e);for(var f=n;f>0;--f){var p=a(l[f-1],u[f-1],arguments[f]);r.push(p),i.push((p-r[o++])*d)}}},s.set=function(e){var t=this.dimension;if(!(e<this.lastT()||arguments.length!==t+1)){var n=this._state,r=this._velocity,i=this.bounds,o=i[0],s=i[1];this._time.push(e);for(var c=t;c>0;--c)n.push(a(o[c-1],s[c-1],arguments[c])),r.push(0)}},s.move=function(e){var t=this.lastT(),n=this.dimension;if(!(e<=t||arguments.length!==n+1)){var r=this._state,i=this._velocity,o=r.length-this.dimension,s=this.bounds,c=s[0],l=s[1],u=e-t,d=u>1e-6?1/u:0;this._time.push(e);for(var f=n;f>0;--f){var p=arguments[f];r.push(a(c[f-1],l[f-1],r[o++]+p)),i.push(p*d)}}},s.idle=function(e){var t=this.lastT();if(!(e<t)){var n=this.dimension,r=this._state,i=this._velocity,o=r.length-n,s=this.bounds,c=s[0],l=s[1],u=e-t;this._time.push(e);for(var d=n-1;d>=0;--d)r.push(a(c[d],l[d],r[o]+u*i[o])),i.push(0),o+=1}};function c(e){for(var t=Array(e),n=0;n<e;++n)t[n]=0;return t}function l(e,t,n){switch(arguments.length){case 0:return new o([0],[0],0);case 1:if(typeof e==`number`){var r=c(e);return new o(r,r,0)}else return new o(e,c(e.length),0);case 2:if(typeof t==`number`){var r=c(e.length);return new o(e,r,+t)}else n=0;case 3:if(e.length!==t.length)throw Error(`state and velocity lengths must match`);return new o(e,t,n)}}},3840:function(e){e.exports=_;var t=0,n=1;function r(e,t,n,r,i,a){this._color=e,this.key=t,this.value=n,this.left=r,this.right=i,this._count=a}function i(e){return new r(e._color,e.key,e.value,e.left,e.right,e._count)}function a(e,t){return new r(e,t.key,t.value,t.left,t.right,t._count)}function o(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function s(e,t){this._compare=e,this.root=t}var c=s.prototype;Object.defineProperty(c,`keys`,{get:function(){var e=[];return this.forEach(function(t,n){e.push(t)}),e}}),Object.defineProperty(c,`values`,{get:function(){var e=[];return this.forEach(function(t,n){e.push(n)}),e}}),Object.defineProperty(c,`length`,{get:function(){return this.root?this.root._count:0}}),c.insert=function(e,i){for(var c=this._compare,l=this.root,u=[],d=[];l;){var f=c(e,l.key);u.push(l),d.push(f),l=f<=0?l.left:l.right}u.push(new r(t,e,i,null,null,1));for(var p=u.length-2;p>=0;--p){var l=u[p];d[p]<=0?u[p]=new r(l._color,l.key,l.value,u[p+1],l.right,l._count+1):u[p]=new r(l._color,l.key,l.value,l.left,u[p+1],l._count+1)}for(var p=u.length-1;p>1;--p){var m=u[p-1],l=u[p];if(m._color===n||l._color===n)break;var h=u[p-2];if(h.left===m)if(m.left===l){var g=h.right;if(g&&g._color===t)m._color=n,h.right=a(n,g),h._color=t,--p;else{if(h._color=t,h.left=m.right,m._color=n,m.right=h,u[p-2]=m,u[p-1]=l,o(h),o(m),p>=3){var _=u[p-3];_.left===h?_.left=m:_.right=m}break}}else{var g=h.right;if(g&&g._color===t)m._color=n,h.right=a(n,g),h._color=t,--p;else{if(m.right=l.left,h._color=t,h.left=l.right,l._color=n,l.left=m,l.right=h,u[p-2]=l,u[p-1]=m,o(h),o(m),o(l),p>=3){var _=u[p-3];_.left===h?_.left=l:_.right=l}break}}else if(m.right===l){var g=h.left;if(g&&g._color===t)m._color=n,h.left=a(n,g),h._color=t,--p;else{if(h._color=t,h.right=m.left,m._color=n,m.left=h,u[p-2]=m,u[p-1]=l,o(h),o(m),p>=3){var _=u[p-3];_.right===h?_.right=m:_.left=m}break}}else{var g=h.left;if(g&&g._color===t)m._color=n,h.left=a(n,g),h._color=t,--p;else{if(m.left=l.right,h._color=t,h.right=l.left,l._color=n,l.right=m,l.left=h,u[p-2]=l,u[p-1]=m,o(h),o(m),o(l),p>=3){var _=u[p-3];_.right===h?_.right=l:_.left=l}break}}}return u[0]._color=n,new s(c,u[0])};function l(e,t){if(t.left){var n=l(e,t.left);if(n)return n}var n=e(t.key,t.value);if(n)return n;if(t.right)return l(e,t.right)}function u(e,t,n,r){if(t(e,r.key)<=0){if(r.left){var i=u(e,t,n,r.left);if(i)return i}var i=n(r.key,r.value);if(i)return i}if(r.right)return u(e,t,n,r.right)}function d(e,t,n,r,i){var a=n(e,i.key),o=n(t,i.key),s;if(a<=0&&(i.left&&(s=d(e,t,n,r,i.left),s)||o>0&&(s=r(i.key,i.value),s)))return s;if(o>0&&i.right)return d(e,t,n,r,i.right)}c.forEach=function(e,t,n){if(this.root)switch(arguments.length){case 1:return l(e,this.root);case 2:return u(t,this._compare,e,this.root);case 3:return this._compare(t,n)>=0?void 0:d(t,n,this._compare,e,this.root)}},Object.defineProperty(c,`begin`,{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.left;return new f(this,e)}}),Object.defineProperty(c,`end`,{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.right;return new f(this,e)}}),c.at=function(e){if(e<0)return new f(this,[]);for(var t=this.root,n=[];;){if(n.push(t),t.left){if(e<t.left._count){t=t.left;continue}e-=t.left._count}if(!e)return new f(this,n);if(--e,t.right){if(e>=t.right._count)break;t=t.right}else break}return new f(this,[])},c.ge=function(e){for(var t=this._compare,n=this.root,r=[],i=0;n;){var a=t(e,n.key);r.push(n),a<=0&&(i=r.length),n=a<=0?n.left:n.right}return r.length=i,new f(this,r)},c.gt=function(e){for(var t=this._compare,n=this.root,r=[],i=0;n;){var a=t(e,n.key);r.push(n),a<0&&(i=r.length),n=a<0?n.left:n.right}return r.length=i,new f(this,r)},c.lt=function(e){for(var t=this._compare,n=this.root,r=[],i=0;n;){var a=t(e,n.key);r.push(n),a>0&&(i=r.length),n=a<=0?n.left:n.right}return r.length=i,new f(this,r)},c.le=function(e){for(var t=this._compare,n=this.root,r=[],i=0;n;){var a=t(e,n.key);r.push(n),a>=0&&(i=r.length),n=a<0?n.left:n.right}return r.length=i,new f(this,r)},c.find=function(e){for(var t=this._compare,n=this.root,r=[];n;){var i=t(e,n.key);if(r.push(n),i===0)return new f(this,r);n=i<=0?n.left:n.right}return new f(this,[])},c.remove=function(e){var t=this.find(e);return t?t.remove():this},c.get=function(e){for(var t=this._compare,n=this.root;n;){var r=t(e,n.key);if(r===0)return n.value;n=r<=0?n.left:n.right}};function f(e,t){this.tree=e,this._stack=t}var p=f.prototype;Object.defineProperty(p,`valid`,{get:function(){return this._stack.length>0}}),Object.defineProperty(p,`node`,{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),p.clone=function(){return new f(this.tree,this._stack.slice())};function m(e,t){e.key=t.key,e.value=t.value,e.left=t.left,e.right=t.right,e._color=t._color,e._count=t._count}function h(e){for(var r,s,c,l,u=e.length-1;u>=0;--u){if(r=e[u],u===0){r._color=n;return}if(s=e[u-1],s.left===r){if(c=s.right,c.right&&c.right._color===t){if(c=s.right=i(c),l=c.right=i(c.right),s.right=c.left,c.left=s,c.right=l,c._color=s._color,r._color=n,s._color=n,l._color=n,o(s),o(c),u>1){var d=e[u-2];d.left===s?d.left=c:d.right=c}e[u-1]=c;return}else if(c.left&&c.left._color===t){if(c=s.right=i(c),l=c.left=i(c.left),s.right=l.left,c.left=l.right,l.left=s,l.right=c,l._color=s._color,s._color=n,c._color=n,r._color=n,o(s),o(c),o(l),u>1){var d=e[u-2];d.left===s?d.left=l:d.right=l}e[u-1]=l;return}if(c._color===n)if(s._color===t){s._color=n,s.right=a(t,c);return}else{s.right=a(t,c);continue}else{if(c=i(c),s.right=c.left,c.left=s,c._color=s._color,s._color=t,o(s),o(c),u>1){var d=e[u-2];d.left===s?d.left=c:d.right=c}e[u-1]=c,e[u]=s,u+1<e.length?e[u+1]=r:e.push(r),u+=2}}else{if(c=s.left,c.left&&c.left._color===t){if(c=s.left=i(c),l=c.left=i(c.left),s.left=c.right,c.right=s,c.left=l,c._color=s._color,r._color=n,s._color=n,l._color=n,o(s),o(c),u>1){var d=e[u-2];d.right===s?d.right=c:d.left=c}e[u-1]=c;return}else if(c.right&&c.right._color===t){if(c=s.left=i(c),l=c.right=i(c.right),s.left=l.right,c.right=l.left,l.right=s,l.left=c,l._color=s._color,s._color=n,c._color=n,r._color=n,o(s),o(c),o(l),u>1){var d=e[u-2];d.right===s?d.right=l:d.left=l}e[u-1]=l;return}if(c._color===n)if(s._color===t){s._color=n,s.left=a(t,c);return}else{s.left=a(t,c);continue}else{if(c=i(c),s.left=c.right,c.right=s,c._color=s._color,s._color=t,o(s),o(c),u>1){var d=e[u-2];d.right===s?d.right=c:d.left=c}e[u-1]=c,e[u]=s,u+1<e.length?e[u+1]=r:e.push(r),u+=2}}}}p.remove=function(){var e=this._stack;if(e.length===0)return this.tree;var i=Array(e.length),a=e[e.length-1];i[i.length-1]=new r(a._color,a.key,a.value,a.left,a.right,a._count);for(var o=e.length-2;o>=0;--o){var a=e[o];a.left===e[o+1]?i[o]=new r(a._color,a.key,a.value,i[o+1],a.right,a._count):i[o]=new r(a._color,a.key,a.value,a.left,i[o+1],a._count)}if(a=i[i.length-1],a.left&&a.right){var c=i.length;for(a=a.left;a.right;)i.push(a),a=a.right;var l=i[c-1];i.push(new r(a._color,l.key,l.value,a.left,a.right,a._count)),i[c-1].key=a.key,i[c-1].value=a.value;for(var o=i.length-2;o>=c;--o)a=i[o],i[o]=new r(a._color,a.key,a.value,a.left,i[o+1],a._count);i[c-1].left=i[c]}if(a=i[i.length-1],a._color===t){var u=i[i.length-2];u.left===a?u.left=null:u.right===a&&(u.right=null),i.pop();for(var o=0;o<i.length;++o)i[o]._count--;return new s(this.tree._compare,i[0])}else if(a.left||a.right){a.left?m(a,a.left):a.right&&m(a,a.right),a._color=n;for(var o=0;o<i.length-1;++o)i[o]._count--;return new s(this.tree._compare,i[0])}else{if(i.length===1)return new s(this.tree._compare,null);for(var o=0;o<i.length;++o)i[o]._count--;var d=i[i.length-2];h(i),d.left===a?d.left=null:d.right=null}return new s(this.tree._compare,i[0])},Object.defineProperty(p,`key`,{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(p,`value`,{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(p,`index`,{get:function(){var e=0,t=this._stack;if(t.length===0){var n=this.tree.root;return n?n._count:0}else t[t.length-1].left&&(e=t[t.length-1].left._count);for(var r=t.length-2;r>=0;--r)t[r+1]===t[r].right&&(++e,t[r].left&&(e+=t[r].left._count));return e},enumerable:!0}),p.next=function(){var e=this._stack;if(e.length!==0){var t=e[e.length-1];if(t.right)for(t=t.right;t;)e.push(t),t=t.left;else for(e.pop();e.length>0&&e[e.length-1].right===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(p,`hasNext`,{get:function(){var e=this._stack;if(e.length===0)return!1;if(e[e.length-1].right)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].left===e[t])return!0;return!1}}),p.update=function(e){var t=this._stack;if(t.length===0)throw Error(`Can't update empty node!`);var n=Array(t.length),i=t[t.length-1];n[n.length-1]=new r(i._color,i.key,e,i.left,i.right,i._count);for(var a=t.length-2;a>=0;--a)i=t[a],i.left===t[a+1]?n[a]=new r(i._color,i.key,i.value,n[a+1],i.right,i._count):n[a]=new r(i._color,i.key,i.value,i.left,n[a+1],i._count);return new s(this.tree._compare,n[0])},p.prev=function(){var e=this._stack;if(e.length!==0){var t=e[e.length-1];if(t.left)for(t=t.left;t;)e.push(t),t=t.right;else for(e.pop();e.length>0&&e[e.length-1].left===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(p,`hasPrev`,{get:function(){var e=this._stack;if(e.length===0)return!1;if(e[e.length-1].left)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].right===e[t])return!0;return!1}});function g(e,t){return e<t?-1:e>t?1:0}function _(e){return new s(e||g,null)}},3837:function(e,t,n){e.exports=T;var r=n(4935),i=n(501),a=n(5304),o=n(6429),s=n(6444),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),l=ArrayBuffer,u=DataView;function d(e){return l.isView(e)&&!(e instanceof u)}function f(e){return Array.isArray(e)||d(e)}function p(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function m(e){this.gl=e,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=a(e)}var h=m.prototype;h.update=function(e){e||={};function t(t,n,r){if(r in e){var i=e[r],a=this[r],o;(t?f(i)&&f(i[0]):f(i))?this[r]=o=[n(i[0]),n(i[1]),n(i[2])]:this[r]=o=[n(i),n(i),n(i)];for(var s=0;s<3;++s)if(o[s]!==a[s])return!0}return!1}var n=t.bind(this,!1,Number),a=t.bind(this,!1,Boolean),o=t.bind(this,!1,String),c=t.bind(this,!0,function(e){if(f(e)){if(e.length===3)return[+e[0],+e[1],+e[2],1];if(e.length===4)return[+e[0],+e[1],+e[2],+e[3]]}return[0,0,0,1]}),l,u=!1,d=!1;if(`bounds`in e)for(var p=e.bounds,m=0;m<2;++m)for(var h=0;h<3;++h)p[m][h]!==this.bounds[m][h]&&(d=!0),this.bounds[m][h]=p[m][h];if(`ticks`in e){l=e.ticks,u=!0,this.autoTicks=!1;for(var m=0;m<3;++m)this.tickSpacing[m]=0}else n(`tickSpacing`)&&(this.autoTicks=!0,d=!0);if(this._firstInit&&=(`ticks`in e||`tickSpacing`in e||(this.autoTicks=!0),d=!0,u=!0,!1),d&&this.autoTicks&&(l=s.create(this.bounds,this.tickSpacing),u=!0),u){for(var m=0;m<3;++m)l[m].sort(function(e,t){return e.x-t.x});s.equal(l,this.ticks)?u=!1:this.ticks=l}a(`tickEnable`),o(`tickFont`)&&(u=!0),o(`tickFontStyle`)&&(u=!0),o(`tickFontWeight`)&&(u=!0),o(`tickFontVariant`)&&(u=!0),n(`tickSize`),n(`tickAngle`),n(`tickPad`),c(`tickColor`);var g=o(`labels`);o(`labelFont`)&&(g=!0),o(`labelFontStyle`)&&(g=!0),o(`labelFontWeight`)&&(g=!0),o(`labelFontVariant`)&&(g=!0),a(`labelEnable`),n(`labelSize`),n(`labelPad`),c(`labelColor`),a(`lineEnable`),a(`lineMirror`),n(`lineWidth`),c(`lineColor`),a(`lineTickEnable`),a(`lineTickMirror`),n(`lineTickLength`),n(`lineTickWidth`),c(`lineTickColor`),a(`gridEnable`),n(`gridWidth`),c(`gridColor`),a(`zeroEnable`),c(`zeroLineColor`),n(`zeroLineWidth`),a(`backgroundEnable`),c(`backgroundColor`);var _=[{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]}],v=[{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&&(g||u)&&this._text.update(this.bounds,this.labels,_,this.ticks,v):this._text=r(this.gl,this.bounds,this.labels,_,this.ticks,v),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||=i(this.gl,this.bounds,this.ticks)};function g(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var _=[new g,new g,new g];function v(e,t,n,r,i){for(var a=e.primalOffset,o=e.primalMinor,s=e.mirrorOffset,c=e.mirrorMinor,l=r[t],u=0;u<3;++u)if(t!==u){var d=a,f=s,p=o,m=c;l&1<<u&&(d=s,f=a,p=c,m=o),d[u]=n[0][u],f[u]=n[1][u],i[u]>0?(p[u]=-1,m[u]=0):(p[u]=0,m[u]=1)}}var y=[0,0,0],b={model:c,view:c,projection:c,_ortho:!1};h.isOpaque=function(){return!0},h.isTransparent=function(){return!1},h.drawTransparent=function(e){};var x=0,S=[0,0,0],C=[0,0,0],w=[0,0,0];h.draw=function(e){e||=b;for(var t=this.gl,n=e.model||c,r=e.view||c,i=e.projection||c,a=this.bounds,s=e._ortho||!1,l=o(n,r,i,a,s),u=l.cubeEdges,d=l.axis,f=r[12],m=r[13],h=r[14],g=r[15],T=(s?2:1)*this.pixelRatio*(i[3]*f+i[7]*m+i[11]*h+i[15]*g)/t.drawingBufferHeight,E=0;E<3;++E)this.lastCubeProps.cubeEdges[E]=u[E],this.lastCubeProps.axis[E]=d[E];for(var D=_,E=0;E<3;++E)v(_[E],E,this.bounds,u,d);for(var t=this.gl,O=y,E=0;E<3;++E)this.backgroundEnable[E]?O[E]=d[E]:O[E]=0;this._background.draw(n,r,i,a,O,this.backgroundColor),this._lines.bind(n,r,i,this);for(var E=0;E<3;++E){var k=[0,0,0];d[E]>0?k[E]=a[1][E]:k[E]=a[0][E];for(var A=0;A<2;++A){var j=(E+1+A)%3,M=(E+1+(A^1))%3;this.gridEnable[j]&&this._lines.drawGrid(j,M,this.bounds,k,this.gridColor[j],this.gridWidth[j]*this.pixelRatio)}for(var A=0;A<2;++A){var j=(E+1+A)%3,M=(E+1+(A^1))%3;this.zeroEnable[M]&&Math.min(a[0][M],a[1][M])<=0&&Math.max(a[0][M],a[1][M])>=0&&this._lines.drawZero(j,M,this.bounds,k,this.zeroLineColor[M],this.zeroLineWidth[M]*this.pixelRatio)}}for(var E=0;E<3;++E){this.lineEnable[E]&&this._lines.drawAxisLine(E,this.bounds,D[E].primalOffset,this.lineColor[E],this.lineWidth[E]*this.pixelRatio),this.lineMirror[E]&&this._lines.drawAxisLine(E,this.bounds,D[E].mirrorOffset,this.lineColor[E],this.lineWidth[E]*this.pixelRatio);for(var N=p(S,D[E].primalMinor),P=p(C,D[E].mirrorMinor),F=this.lineTickLength,A=0;A<3;++A){var I=T/n[5*A];N[A]*=F[A]*I,P[A]*=F[A]*I}this.lineTickEnable[E]&&this._lines.drawAxisTicks(E,D[E].primalOffset,N,this.lineTickColor[E],this.lineTickWidth[E]*this.pixelRatio),this.lineTickMirror[E]&&this._lines.drawAxisTicks(E,D[E].mirrorOffset,P,this.lineTickColor[E],this.lineTickWidth[E]*this.pixelRatio)}this._lines.unbind(),this._text.bind(n,r,i,this.pixelRatio);var L,R=.5,z,B;function V(e){B=[0,0,0],B[e]=1}function H(e,t,n){var r=(e+1)%3,i=(e+2)%3,a=t[r],o=t[i],s=n[r],c=n[i];if(a>0&&c>0){V(r);return}else if(a>0&&c<0){V(r);return}else if(a<0&&c>0){V(r);return}else if(a<0&&c<0){V(r);return}else if(o>0&&s>0){V(i);return}else if(o>0&&s<0){V(i);return}else if(o<0&&s>0){V(i);return}else if(o<0&&s<0){V(i);return}}for(var E=0;E<3;++E){for(var U=D[E].primalMinor,W=D[E].mirrorMinor,G=p(w,D[E].primalOffset),A=0;A<3;++A)this.lineTickEnable[E]&&(G[A]+=T*U[A]*Math.max(this.lineTickLength[A],0)/n[5*A]);var K=[0,0,0];if(K[E]=1,this.tickEnable[E]){this.tickAngle[E]===-3600?(this.tickAngle[E]=0,this.tickAlign[E]=`auto`):this.tickAlign[E]=-1,z=1,L=[this.tickAlign[E],R,z],L[0]===`auto`?L[0]=x:L[0]=parseInt(``+L[0]),B=[0,0,0],H(E,U,W);for(var A=0;A<3;++A)G[A]+=T*U[A]*this.tickPad[A]/n[5*A];this._text.drawTicks(E,this.tickSize[E],this.tickAngle[E],G,this.tickColor[E],K,B,L)}if(this.labelEnable[E]){z=0,B=[0,0,0],this.labels[E].length>4&&(V(E),z=1),L=[this.labelAlign[E],R,z],L[0]===`auto`?L[0]=x:L[0]=parseInt(``+L[0]);for(var A=0;A<3;++A)G[A]+=T*U[A]*this.labelPad[A]/n[5*A];G[E]+=.5*(a[0][E]+a[1][E]),this._text.drawLabel(E,this.labelSize[E],this.labelAngle[E],G,this.labelColor[E],[0,0,0],B,L)}}this._text.unbind()},h.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function T(e,t){var n=new m(e);return n.update(t),n}},5304:function(e,t,n){e.exports=c;var r=n(2762),i=n(8116),a=n(1879).bg;function o(e,t,n,r){this.gl=e,this.buffer=t,this.vao=n,this.shader=r}var s=o.prototype;s.draw=function(e,t,n,r,i,a){for(var o=!1,s=0;s<3;++s)o||=i[s];if(o){var c=this.gl;c.enable(c.POLYGON_OFFSET_FILL),c.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:e,view:t,projection:n,bounds:r,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),c.disable(c.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function c(e){for(var t=[],n=[],s=0,c=0;c<3;++c)for(var l=(c+1)%3,u=(c+2)%3,d=[0,0,0],f=[0,0,0],p=-1;p<=1;p+=2){n.push(s,s+2,s+1,s+1,s+2,s+3),d[c]=p,f[c]=p;for(var m=-1;m<=1;m+=2){d[l]=m;for(var h=-1;h<=1;h+=2)d[u]=h,t.push(d[0],d[1],d[2],f[0],f[1],f[2]),s+=1}var g=l;l=u,u=g}var _=r(e,new Float32Array(t)),v=r(e,new Uint16Array(n),e.ELEMENT_ARRAY_BUFFER),y=i(e,[{buffer:_,type:e.FLOAT,size:3,offset:0,stride:24},{buffer:_,type:e.FLOAT,size:3,offset:12,stride:24}],v),b=a(e);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(e,_,y,b)}},6429:function(e,t,n){e.exports=v;var r=n(8828),i=n(6760),a=n(5202),o=n(3250),s=Array(16),c=Array(8),l=Array(8),u=[,,,],d=[0,0,0];(function(){for(var e=0;e<8;++e)c[e]=[1,1,1,1],l[e]=[1,1,1]})();function f(e,t,n){for(var r=0;r<4;++r){e[r]=n[12+r];for(var i=0;i<3;++i)e[r]+=t[i]*n[4*i+r]}}var p=[[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 m(e){for(var t=0;t<p.length;++t)if(e=a.positive(e,p[t]),e.length<3)return 0;for(var n=e[0],r=n[0]/n[3],i=n[1]/n[3],o=0,t=1;t+1<e.length;++t){var s=e[t],c=e[t+1],l=s[0]/s[3],u=s[1]/s[3],d=c[0]/c[3],f=c[1]/c[3],m=l-r,h=u-i,g=d-r,_=f-i;o+=Math.abs(m*_-h*g)}return o}var h=[1,1,1],g=[0,0,0],_={cubeEdges:h,axis:g};function v(e,t,n,a,p){i(s,t,e),i(s,n,s);for(var v=0,y=0;y<2;++y){u[2]=a[y][2];for(var b=0;b<2;++b){u[1]=a[b][1];for(var x=0;x<2;++x)u[0]=a[x][0],f(c[v],u,s),v+=1}}for(var S=-1,y=0;y<8;++y){for(var C=c[y][3],w=0;w<3;++w)l[y][w]=c[y][w]/C;p&&(l[y][2]*=-1),C<0&&(S<0||l[y][2]<l[S][2])&&(S=y)}if(S<0){S=0;for(var T=0;T<3;++T){for(var E=(T+2)%3,D=(T+1)%3,O=-1,k=-1,A=0;A<2;++A){var j=A<<T,M=j+(A<<E)+(1-A<<D),N=j+(1-A<<E)+(A<<D);o(l[j],l[M],l[N],d)<0||(A?O=1:k=1)}if(O<0||k<0){k>O&&(S|=1<<T);continue}for(var A=0;A<2;++A){var j=A<<T,M=j+(A<<E)+(1-A<<D),N=j+(1-A<<E)+(A<<D),P=m([c[j],c[M],c[N],c[j+(1<<E)+(1<<D)]]);A?O=P:k=P}if(k>O){S|=1<<T;continue}}}for(var F=7^S,I=-1,y=0;y<8;++y)y===S||y===F||(I<0||l[I][1]>l[y][1])&&(I=y);for(var L=-1,y=0;y<3;++y){var R=I^1<<y;if(!(R===S||R===F)){L<0&&(L=R);var D=l[R];D[0]<l[L][0]&&(L=R)}}for(var z=-1,y=0;y<3;++y){var R=I^1<<y;if(!(R===S||R===F||R===L)){z<0&&(z=R);var D=l[R];D[0]>l[z][0]&&(z=R)}}var B=h;B[0]=B[1]=B[2]=0,B[r.log2(L^I)]=I&L,B[r.log2(I^z)]=I&z;var V=z^7;V===S||V===F?(V=L^7,B[r.log2(z^V)]=V&z):B[r.log2(L^V)]=V&L;for(var H=g,U=S,T=0;T<3;++T)U&1<<T?H[T]=-1:H[T]=1;return _}},501:function(e,t,n){e.exports=h;var r=n(2762),i=n(8116),a=n(1879).n,o=[0,0,0],s=[0,0,0],c=[0,0,0],l=[0,0,0],u=[1,1];function d(e){return e[0]=e[1]=e[2]=0,e}function f(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function p(e,t,n,r,i,a,o,s){this.gl=e,this.vertBuffer=t,this.vao=n,this.shader=r,this.tickCount=i,this.tickOffset=a,this.gridCount=o,this.gridOffset=s}var m=p.prototype;m.bind=function(e,t,n){this.shader.bind(),this.shader.uniforms.model=e,this.shader.uniforms.view=t,this.shader.uniforms.projection=n,u[0]=this.gl.drawingBufferWidth,u[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=u,this.vao.bind()},m.unbind=function(){this.vao.unbind()},m.drawAxisLine=function(e,t,n,r,i){var a=d(s);this.shader.uniforms.majorAxis=s,a[e]=t[1][e]-t[0][e],this.shader.uniforms.minorAxis=a;var o=f(l,n);o[e]+=t[0][e],this.shader.uniforms.offset=o,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=r;var u=d(c);u[(e+2)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6);var u=d(c);u[(e+1)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6)},m.drawAxisTicks=function(e,t,n,r,i){if(this.tickCount[e]){var a=d(o);a[e]=1,this.shader.uniforms.majorAxis=a,this.shader.uniforms.offset=t,this.shader.uniforms.minorAxis=n,this.shader.uniforms.color=r,this.shader.uniforms.lineWidth=i;var s=d(c);s[e]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[e],this.tickOffset[e])}},m.drawGrid=function(e,t,n,r,i,a){if(this.gridCount[e]){var u=d(s);u[t]=n[1][t]-n[0][t],this.shader.uniforms.minorAxis=u;var p=f(l,r);p[t]+=n[0][t],this.shader.uniforms.offset=p;var m=d(o);m[e]=1,this.shader.uniforms.majorAxis=m;var h=d(c);h[e]=1,this.shader.uniforms.screenAxis=h,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,this.gridCount[e],this.gridOffset[e])}},m.drawZero=function(e,t,n,r,i,a){var o=d(s);this.shader.uniforms.majorAxis=o,o[e]=n[1][e]-n[0][e],this.shader.uniforms.minorAxis=o;var u=f(l,r);u[e]+=n[0][e],this.shader.uniforms.offset=u;var p=d(c);p[t]=1,this.shader.uniforms.screenAxis=p,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,6)},m.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()};function h(e,t,n){var o=[],s=[0,0,0],c=[0,0,0],l=[0,0,0],u=[0,0,0];o.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var d=0;d<3;++d){for(var f=o.length/3|0,m=0;m<n[d].length;++m){var h=+n[d][m].x;o.push(h,0,1,h,1,1,h,0,-1,h,0,-1,h,1,1,h,1,-1)}var g=o.length/3|0;s[d]=f,c[d]=g-f;for(var f=o.length/3|0,_=0;_<n[d].length;++_){var h=+n[d][_].x;o.push(h,0,1,h,1,1,h,0,-1,h,0,-1,h,1,1,h,1,-1)}var g=o.length/3|0;l[d]=f,u[d]=g-f}var v=r(e,new Float32Array(o)),y=i(e,[{buffer:v,type:e.FLOAT,size:3,stride:0,offset:0}]),b=a(e);return b.attributes.position.location=0,new p(e,v,y,b,c,s,u,l)}},1879:function(e,t,n){var r=n(3236),i=n(9405),a=r([`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);
}
`]),o=r([`precision highp float;
#define GLSLIFY 1
uniform vec4 color;
void main() {
gl_FragColor = color;
}`]);t.n=function(e){return i(e,a,o,null,[{name:`position`,type:`vec3`}])};var s=r([`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);
}
`]),c=r([`precision highp float;
#define GLSLIFY 1
uniform vec4 color;
void main() {
gl_FragColor = color;
}`]);t.Q=function(e){return i(e,s,c,null,[{name:`position`,type:`vec3`}])};var l=r([`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);
}
`]),u=r([`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];
}`]);t.bg=function(e){return i(e,l,u,null,[{name:`position`,type:`vec3`},{name:`normal`,type:`vec3`}])}},4935:function(e,t,n){e.exports=m;var r=n(2762),i=n(8116),a=n(4359),o=n(1879).Q,s=window||process.global||{},c=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var l=3;function u(e,t,n,r){this.gl=e,this.shader=t,this.buffer=n,this.vao=r,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var d=u.prototype,f=[0,0];d.bind=function(e,t,n,r){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=e,i.view=t,i.projection=n,i.pixelScale=r,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},d.unbind=function(){this.vao.unbind()},d.update=function(e,t,n,r,i){var a=[];function o(e,t,n,r,i,o){var s=[n.style,n.weight,n.variant,n.family].join(`_`),l=c[s];l||=c[s]={};var u=l[t];u||=l[t]=p(t,{triangles:!0,font:n.family,fontStyle:n.style,fontWeight:n.weight,fontVariant:n.variant,textAlign:`center`,textBaseline:`middle`,lineSpacing:i,styletags:o});for(var d=(r||12)/12,f=u.positions,m=u.cells,h=0,g=m.length;h<g;++h)for(var _=m[h],v=2;v>=0;--v){var y=f[_[v]];a.push(d*y[0],-d*y[1],e)}}for(var s=[0,0,0],u=[0,0,0],d=[0,0,0],f=[0,0,0],m=1.25,h={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},g=0;g<3;++g){d[g]=a.length/l|0,o(.5*(e[0][g]+e[1][g]),t[g],n[g],12,m,h),f[g]=(a.length/l|0)-d[g],s[g]=a.length/l|0;for(var _=0;_<r[g].length;++_)if(r[g][_].text){var v={family:r[g][_].font||i[g].family,style:i[g].fontStyle||i[g].style,weight:i[g].fontWeight||i[g].weight,variant:i[g].fontVariant||i[g].variant};o(r[g][_].x,r[g][_].text,v,r[g][_].fontSize||12,m,h)}u[g]=(a.length/l|0)-s[g]}this.buffer.update(a),this.tickOffset=s,this.tickCount=u,this.labelOffset=d,this.labelCount=f},d.drawTicks=function(e,t,n,r,i,a,o,s){this.tickCount[e]&&(this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=n,this.shader.uniforms.scale=t,this.shader.uniforms.offset=r,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[e],this.tickOffset[e]))},d.drawLabel=function(e,t,n,r,i,a,o,s){this.labelCount[e]&&(this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=n,this.shader.uniforms.scale=t,this.shader.uniforms.offset=r,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.labelCount[e],this.labelOffset[e]))},d.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function p(e,t){try{return a(e,t)}catch(t){return console.warn(`error vectorizing text:"`+e+`" error:`,t),{cells:[],positions:[]}}}function m(e,t,n,a,s,c){var l=r(e),d=i(e,[{buffer:l,size:3}]),f=o(e);f.attributes.position.location=0;var p=new u(e,f,l,d);return p.update(t,n,a,s,c),p}},6444:function(e,t){t.create=r,t.equal=i;function n(e,t){var n=e+``,r=n.indexOf(`.`),i=0;r>=0&&(i=n.length-r-1);var a=10**i,o=Math.round(e*t*a),s=o+``;if(s.indexOf(`e`)>=0)return s;var c=o/a,l=o%a;o<0?(c=-Math.ceil(c)|0,l=-l|0):(c=Math.floor(c)|0,l|=0);var u=``+c;if(o<0&&(u=`-`+u),i){for(var d=``+l;d.length<i;)d=`0`+d;return u+`.`+d}else return u}function r(e,t){for(var r=[],i=0;i<3;++i){for(var a=[],o=.5*(e[0][i]+e[1][i]),s=0;s*t[i]<=e[1][i];++s)a.push({x:s*t[i],text:n(t[i],s)});for(var s=-1;s*t[i]>=e[0][i];--s)a.push({x:s*t[i],text:n(t[i],s)});r.push(a)}return r}function i(e,t){for(var n=0;n<3;++n){if(e[n].length!==t[n].length)return!1;for(var r=0;r<e[n].length;++r){var i=e[n][r],a=t[n][r];if(i.x!==a.x||i.text!==a.text||i.font!==a.font||i.fontColor!==a.fontColor||i.fontSize!==a.fontSize||i.dx!==a.dx||i.dy!==a.dy)return!1}}return!0}},5445:function(e,t,n){e.exports=_;var r=n(5033),i=n(5202),a=n(6429),o=n(6760),s=n(5665),c=n(5352),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),u=new Float32Array(16);function d(e,t,n){this.lo=e,this.hi=t,this.pixelsPerDataUnit=n}var f=[0,0,0,1],p=[0,0,0,1];function m(e,t,n,r,i){for(var a=0;a<3;++a){for(var o=f,s=p,l=0;l<3;++l)s[l]=o[l]=n[l];s[3]=o[3]=1,s[a]+=1,c(s,s,t),s[3]<0&&(e[a]=1/0),--o[a],c(o,o,t),o[3]<0&&(e[a]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*r,d=(o[1]/o[3]-s[1]/s[3])*i;e[a]=.25*Math.sqrt(u*u+d*d)}return e}var h=[new d(1/0,-1/0,1/0),new d(1/0,-1/0,1/0),new d(1/0,-1/0,1/0)],g=[0,0,0];function _(e,t,n,c,d){var f=t.model||l,p=t.view||l,_=t.projection||l,v=t._ortho||!1,y=e.bounds,d=d||a(f,p,_,y,v),b=d.axis;o(u,p,f),o(u,_,u);for(var x=h,S=0;S<3;++S)x[S].lo=1/0,x[S].hi=-1/0,x[S].pixelsPerDataUnit=1/0;var C=r(s(u,u));s(u,u);for(var w=0;w<3;++w){var T=(w+1)%3,E=(w+2)%3,D=g;e:for(var S=0;S<2;++S){var O=[];if(b[w]<0!=!!S){D[w]=y[S][w];for(var k=0;k<2;++k){D[T]=y[k^S][T];for(var A=0;A<2;++A)D[E]=y[A^k^S][E],O.push(D.slice())}for(var j=v?5:4,k=j;k===j;++k){if(O.length===0)continue e;O=i.positive(O,C[k])}for(var k=0;k<O.length;++k)for(var E=O[k],M=m(g,u,E,n,c),A=0;A<3;++A)x[A].lo=Math.min(x[A].lo,E[A]),x[A].hi=Math.max(x[A].hi,E[A]),A!==w&&(x[A].pixelsPerDataUnit=Math.min(x[A].pixelsPerDataUnit,Math.abs(M[A])))}}}return x}},2762:function(e,t,n){var r=n(1888),i=n(5298),a=n(9618),o=[`uint8`,`uint8_clamped`,`uint16`,`uint32`,`int8`,`int16`,`int32`,`float32`];function s(e,t,n,r,i){this.gl=e,this.type=t,this.handle=n,this.length=r,this.usage=i}var c=s.prototype;c.bind=function(){this.gl.bindBuffer(this.type,this.handle)},c.unbind=function(){this.gl.bindBuffer(this.type,null)},c.dispose=function(){this.gl.deleteBuffer(this.handle)};function l(e,t,n,r,i,a){var o=i.length*i.BYTES_PER_ELEMENT;if(a<0)return e.bufferData(t,i,r),o;if(o+a>n)throw Error(`gl-buffer: If resizing buffer, must not specify offset`);return e.bufferSubData(t,a,i),n}function u(e,t){for(var n=r.malloc(e.length,t),i=e.length,a=0;a<i;++a)n[a]=e[a];return n}function d(e,t){for(var n=1,r=t.length-1;r>=0;--r){if(t[r]!==n)return!1;n*=e[r]}return!0}c.update=function(e,t){if(typeof t!=`number`&&(t=-1),this.bind(),typeof e==`object`&&e.shape!==void 0){var n=e.dtype;if(o.indexOf(n)<0&&(n=`float32`),this.type===this.gl.ELEMENT_ARRAY_BUFFER&&(n=gl.getExtension(`OES_element_index_uint`)&&n!==`uint16`?`uint32`:`uint16`),n===e.dtype&&d(e.shape,e.stride))e.offset===0&&e.data.length===e.shape[0]?this.length=l(this.gl,this.type,this.length,this.usage,e.data,t):this.length=l(this.gl,this.type,this.length,this.usage,e.data.subarray(e.offset,e.shape[0]),t);else{var s=r.malloc(e.size,n),c=a(s,e.shape);i.assign(c,e),t<0?this.length=l(this.gl,this.type,this.length,this.usage,s,t):this.length=l(this.gl,this.type,this.length,this.usage,s.subarray(0,e.size),t),r.free(s)}}else if(Array.isArray(e)){var f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(e,`uint16`):u(e,`float32`);t<0?this.length=l(this.gl,this.type,this.length,this.usage,f,t):this.length=l(this.gl,this.type,this.length,this.usage,f.subarray(0,e.length),t),r.free(f)}else if(typeof e==`object`&&typeof e.length==`number`)this.length=l(this.gl,this.type,this.length,this.usage,e,t);else if(typeof e==`number`||e===void 0){if(t>=0)throw Error(`gl-buffer: Cannot specify offset when resizing buffer`);e|=0,e<=0&&(e=1),this.gl.bufferData(this.type,e|0,this.usage),this.length=e}else throw Error(`gl-buffer: Invalid data type`)};function f(e,t,n,r){if(n||=e.ARRAY_BUFFER,r||=e.DYNAMIC_DRAW,n!==e.ARRAY_BUFFER&&n!==e.ELEMENT_ARRAY_BUFFER)throw Error(`gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER`);if(r!==e.DYNAMIC_DRAW&&r!==e.STATIC_DRAW&&r!==e.STREAM_DRAW)throw Error(`gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW`);var i=e.createBuffer(),a=new s(e,n,i,0,r);return a.update(t),a}e.exports=f},6405:function(e,t,n){var r=n(2931);e.exports=function(e,t){var n=e.positions,i=e.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:e.vertexIntensityBounds,vectors:[],cells:[],coneOffset:e.coneOffset,colormap:e.colormap};if(e.positions.length===0)return t&&(t[0]=[0,0,0],t[1]=[0,0,0]),a;for(var o=0,s=1/0,c=-1/0,l=1/0,u=-1/0,d=1/0,f=-1/0,p=null,m=null,h=[],g=1/0,_=!1,v=e.coneSizemode===`raw`,y=0;y<n.length;y++){var b=n[y];s=Math.min(b[0],s),c=Math.max(b[0],c),l=Math.min(b[1],l),u=Math.max(b[1],u),d=Math.min(b[2],d),f=Math.max(b[2],f);var x=i[y];if(r.length(x)>o&&(o=r.length(x)),y&&!v){var S=2*r.distance(p,b)/(r.length(m)+r.length(x));S?(g=Math.min(g,S),_=!1):_=!0}_||(p=b,m=x),h.push(x)}var C=[s,l,d],w=[c,u,f];t&&(t[0]=C,t[1]=w),o===0&&(o=1);var T=1/o;isFinite(g)||(g=1),a.vectorScale=g;var E=e.coneSize||(v?1:.5);e.absoluteConeSize&&(E=e.absoluteConeSize*T),a.coneScale=E;for(var y=0,D=0;y<n.length;y++)for(var b=n[y],O=b[0],k=b[1],A=b[2],j=h[y],M=r.length(j)*T,N=0,P=8;N<P;N++){a.positions.push([O,k,A,D++]),a.positions.push([O,k,A,D++]),a.positions.push([O,k,A,D++]),a.positions.push([O,k,A,D++]),a.positions.push([O,k,A,D++]),a.positions.push([O,k,A,D++]),a.vectors.push(j),a.vectors.push(j),a.vectors.push(j),a.vectors.push(j),a.vectors.push(j),a.vectors.push(j),a.vertexIntensity.push(M,M,M),a.vertexIntensity.push(M,M,M);var F=a.positions.length;a.cells.push([F-6,F-5,F-4],[F-3,F-2,F-1])}return a};var i=n(614);e.exports.createMesh=n(9060),e.exports.createConeMesh=function(t,n){return e.exports.createMesh(t,n,{shaders:i,traceType:`cone`})}},9060:function(e,t,n){var r=n(9405),i=n(2762),a=n(8116),o=n(7766),s=n(6760),c=n(7608),l=n(9618),u=n(6729),d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function f(e,t,n,r,i,a,o,s,c,l,u){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=n,this.pickShader=r,this.trianglePositions=i,this.triangleVectors=a,this.triangleColors=s,this.triangleUVs=c,this.triangleIds=o,this.triangleVAO=l,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=u,this.tubeScale=1,this.coneScale=2,this.vectorScale=1,this.coneOffset=.25,this._model=d,this._view=d,this._projection=d,this._resolution=[1,1]}var p=f.prototype;p.isOpaque=function(){return this.opacity>=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(e){this.pickId=e};function m(e){for(var t=u({colormap:e,nshades:256,format:`rgba`}),n=new Uint8Array(256*4),r=0;r<256;++r){for(var i=t[r],a=0;a<3;++a)n[4*r+a]=i[a];n[4*r+3]=i[3]*255}return l(n,[256,256,4],[4,0,1])}function h(e){for(var t=e.length,n=Array(t),r=0;r<t;++r)n[r]=e[r][2];return n}p.update=function(e){e||={};var t=this.gl;this.dirty=!0,`lightPosition`in e&&(this.lightPosition=e.lightPosition),`opacity`in e&&(this.opacity=e.opacity),`ambient`in e&&(this.ambientLight=e.ambient),`diffuse`in e&&(this.diffuseLight=e.diffuse),`specular`in e&&(this.specularLight=e.specular),`roughness`in e&&(this.roughness=e.roughness),`fresnel`in e&&(this.fresnel=e.fresnel),e.tubeScale!==void 0&&(this.tubeScale=e.tubeScale),e.vectorScale!==void 0&&(this.vectorScale=e.vectorScale),e.coneScale!==void 0&&(this.coneScale=e.coneScale),e.coneOffset!==void 0&&(this.coneOffset=e.coneOffset),e.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=t.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=t.LINEAR,this.texture.setPixels(m(e.colormap)),this.texture.generateMipmap());var n=e.cells,r=e.positions,i=e.vectors;if(!(!r||!n||!i)){var a=[],o=[],s=[],c=[],l=[];this.cells=n,this.positions=r,this.vectors=i;var u=e.meshColor||[1,1,1,1],d=e.vertexIntensity,f=1/0,p=-1/0;if(d)if(e.vertexIntensityBounds)f=+e.vertexIntensityBounds[0],p=+e.vertexIntensityBounds[1];else for(var g=0;g<d.length;++g){var _=d[g];f=Math.min(f,_),p=Math.max(p,_)}else for(var g=0;g<r.length;++g){var _=r[g][2];f=Math.min(f,_),p=Math.max(p,_)}d?this.intensity=d:this.intensity=h(r),this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(var g=0;g<r.length;++g)for(var v=r[g],y=0;y<3;++y)isNaN(v[y])||!isFinite(v[y])||(this.bounds[0][y]=Math.min(this.bounds[0][y],v[y]),this.bounds[1][y]=Math.max(this.bounds[1][y],v[y]));var b=0;e:for(var g=0;g<n.length;++g){var x=n[g];switch(x.length){case 3:for(var y=0;y<3;++y)for(var S=x[y],v=r[S],C=0;C<3;++C)if(isNaN(v[C])||!isFinite(v[C]))continue e;for(var y=0;y<3;++y){var S=x[2-y],v=r[S];a.push(v[0],v[1],v[2],v[3]);var w=i[S];o.push(w[0],w[1],w[2],w[3]||0);var T=u;T.length===3?s.push(T[0],T[1],T[2],1):s.push(T[0],T[1],T[2],T[3]);var E=d?[(d[S]-f)/(p-f),0]:[(v[2]-f)/(p-f),0];c.push(E[0],E[1]),l.push(g)}b+=1;break;default:break}}this.triangleCount=b,this.trianglePositions.update(a),this.triangleVectors.update(o),this.triangleColors.update(s),this.triangleUVs.update(c),this.triangleIds.update(new Uint32Array(l))}},p.drawTransparent=p.draw=function(e){e||={};for(var t=this.gl,n=e.model||d,r=e.view||d,i=e.projection||d,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var l={model:n,view:r,projection:i,inverseModel:d.slice(),clipBounds:a,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};l.inverseModel=c(l.inverseModel,l.model),t.disable(t.CULL_FACE),this.texture.bind(0);var u=Array(16);s(u,l.view,l.model),s(u,l.projection,u),c(u,u);for(var o=0;o<3;++o)l.eyePosition[o]=u[12+o]/u[15];for(var f=u[15],o=0;o<3;++o)f+=this.lightPosition[o]*u[4*o+3];for(var o=0;o<3;++o){for(var p=u[12+o],m=0;m<3;++m)p+=u[4*m+o]*this.lightPosition[m];l.lightPosition[o]=p/f}if(this.triangleCount>0){var h=this.triShader;h.bind(),h.uniforms=l,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},p.drawPick=function(e){e||={};for(var t=this.gl,n=e.model||d,r=e.view||d,i=e.projection||d,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(n),this._view=[].slice.call(r),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s={model:n,view:r,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},c=this.pickShader;c.bind(),c.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},p.pick=function(e){if(!e||e.id!==this.pickId)return null;var t=e.value[0]+256*e.value[1]+65536*e.value[2],n=this.cells[t],r=this.positions[n[1]].slice(0,3),i={position:r,dataCoordinate:r,index:Math.floor(n[1]/48)};return this.traceType===`cone`?i.index=Math.floor(n[1]/48):this.traceType===`streamtube`&&(i.intensity=this.intensity[n[1]],i.velocity=this.vectors[n[1]].slice(0,3),i.divergence=this.vectors[n[1]][3],i.index=t),i},p.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 g(e,t){var n=r(e,t.meshShader.vertex,t.meshShader.fragment,null,t.meshShader.attributes);return n.attributes.position.location=0,n.attributes.color.location=2,n.attributes.uv.location=3,n.attributes.vector.location=4,n}function _(e,t){var n=r(e,t.pickShader.vertex,t.pickShader.fragment,null,t.pickShader.attributes);return n.attributes.position.location=0,n.attributes.id.location=1,n.attributes.vector.location=4,n}function v(e,t,n){var r=n.shaders;arguments.length===1&&(t=e,e=t.gl);var s=g(e,r),c=_(e,r),u=o(e,l(new Uint8Array([255,255,255,255]),[1,1,4]));u.generateMipmap(),u.minFilter=e.LINEAR_MIPMAP_LINEAR,u.magFilter=e.LINEAR;var d=i(e),p=i(e),m=i(e),h=i(e),v=i(e),y=a(e,[{buffer:d,type:e.FLOAT,size:4},{buffer:v,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:e.FLOAT,size:4},{buffer:h,type:e.FLOAT,size:2},{buffer:p,type:e.FLOAT,size:4}]),b=new f(e,u,s,c,d,p,v,m,h,y,n.traceType||`cone`);return b.update(t),b}e.exports=v},614:function(e,t,n){var r=n(3236),i=r([`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;
}
`]),a=r([`#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;
}
`]),o=r([`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=r([`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.meshShader={vertex:i,fragment:a,attributes:[{name:`position`,type:`vec4`},{name:`color`,type:`vec4`},{name:`uv`,type:`vec2`},{name:`vector`,type:`vec3`}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:`position`,type:`vec4`},{name:`id`,type:`vec4`},{name:`vector`,type:`vec3`}]}},737:function(e){e.exports={0:`NONE`,1:`ONE`,2:`LINE_LOOP`,3:`LINE_STRIP`,4:`TRIANGLES`,5:`TRIANGLE_STRIP`,6:`TRIANGLE_FAN`,256:`DEPTH_BUFFER_BIT`,512:`NEVER`,513:`LESS`,514:`EQUAL`,515:`LEQUAL`,516:`GREATER`,517:`NOTEQUAL`,518:`GEQUAL`,519:`ALWAYS`,768:`SRC_COLOR`,769:`ONE_MINUS_SRC_COLOR`,770:`SRC_ALPHA`,771:`ONE_MINUS_SRC_ALPHA`,772:`DST_ALPHA`,773:`ONE_MINUS_DST_ALPHA`,774:`DST_COLOR`,775:`ONE_MINUS_DST_COLOR`,776:`SRC_ALPHA_SATURATE`,1024:`STENCIL_BUFFER_BIT`,1028:`FRONT`,1029:`BACK`,1032:`FRONT_AND_BACK`,1280:`INVALID_ENUM`,1281:`INVALID_VALUE`,1282:`INVALID_OPERATION`,1285:`OUT_OF_MEMORY`,1286:`INVALID_FRAMEBUFFER_OPERATION`,2304:`CW`,2305:`CCW`,2849:`LINE_WIDTH`,2884:`CULL_FACE`,2885:`CULL_FACE_MODE`,2886:`FRONT_FACE`,2928:`DEPTH_RANGE`,2929:`DEPTH_TEST`,2930:`DEPTH_WRITEMASK`,2931:`DEPTH_CLEAR_VALUE`,2932:`DEPTH_FUNC`,2960:`STENCIL_TEST`,2961:`STENCIL_CLEAR_VALUE`,2962:`STENCIL_FUNC`,2963:`STENCIL_VALUE_MASK`,2964:`STENCIL_FAIL`,2965:`STENCIL_PASS_DEPTH_FAIL`,2966:`STENCIL_PASS_DEPTH_PASS`,2967:`STENCIL_REF`,2968:`STENCIL_WRITEMASK`,2978:`VIEWPORT`,3024:`DITHER`,3042:`BLEND`,3088:`SCISSOR_BOX`,3089:`SCISSOR_TEST`,3106:`COLOR_CLEAR_VALUE`,3107:`COLOR_WRITEMASK`,3317:`UNPACK_ALIGNMENT`,3333:`PACK_ALIGNMENT`,3379:`MAX_TEXTURE_SIZE`,3386:`MAX_VIEWPORT_DIMS`,3408:`SUBPIXEL_BITS`,3410:`RED_BITS`,3411:`GREEN_BITS`,3412:`BLUE_BITS`,3413:`ALPHA_BITS`,3414:`DEPTH_BITS`,3415:`STENCIL_BITS`,3553:`TEXTURE_2D`,4352:`DONT_CARE`,4353:`FASTEST`,4354:`NICEST`,5120:`BYTE`,5121:`UNSIGNED_BYTE`,5122:`SHORT`,5123:`UNSIGNED_SHORT`,5124:`INT`,5125:`UNSIGNED_INT`,5126:`FLOAT`,5386:`INVERT`,5890:`TEXTURE`,6401:`STENCIL_INDEX`,6402:`DEPTH_COMPONENT`,6406:`ALPHA`,6407:`RGB`,6408:`RGBA`,6409:`LUMINANCE`,6410:`LUMINANCE_ALPHA`,7680:`KEEP`,7681:`REPLACE`,7682:`INCR`,7683:`DECR`,7936:`VENDOR`,7937:`RENDERER`,7938:`VERSION`,9728:`NEAREST`,9729:`LINEAR`,9984:`NEAREST_MIPMAP_NEAREST`,9985:`LINEAR_MIPMAP_NEAREST`,9986:`NEAREST_MIPMAP_LINEAR`,9987:`LINEAR_MIPMAP_LINEAR`,10240:`TEXTURE_MAG_FILTER`,10241:`TEXTURE_MIN_FILTER`,10242:`TEXTURE_WRAP_S`,10243:`TEXTURE_WRAP_T`,10497:`REPEAT`,10752:`POLYGON_OFFSET_UNITS`,16384:`COLOR_BUFFER_BIT`,32769:`CONSTANT_COLOR`,32770:`ONE_MINUS_CONSTANT_COLOR`,32771:`CONSTANT_ALPHA`,32772:`ONE_MINUS_CONSTANT_ALPHA`,32773:`BLEND_COLOR`,32774:`FUNC_ADD`,32777:`BLEND_EQUATION_RGB`,32778:`FUNC_SUBTRACT`,32779:`FUNC_REVERSE_SUBTRACT`,32819:`UNSIGNED_SHORT_4_4_4_4`,32820:`UNSIGNED_SHORT_5_5_5_1`,32823:`POLYGON_OFFSET_FILL`,32824:`POLYGON_OFFSET_FACTOR`,32854:`RGBA4`,32855:`RGB5_A1`,32873:`TEXTURE_BINDING_2D`,32926:`SAMPLE_ALPHA_TO_COVERAGE`,32928:`SAMPLE_COVERAGE`,32936:`SAMPLE_BUFFERS`,32937:`SAMPLES`,32938:`SAMPLE_COVERAGE_VALUE`,32939:`SAMPLE_COVERAGE_INVERT`,32968:`BLEND_DST_RGB`,32969:`BLEND_SRC_RGB`,32970:`BLEND_DST_ALPHA`,32971:`BLEND_SRC_ALPHA`,33071:`CLAMP_TO_EDGE`,33170:`GENERATE_MIPMAP_HINT`,33189:`DEPTH_COMPONENT16`,33306:`DEPTH_STENCIL_ATTACHMENT`,33635:`UNSIGNED_SHORT_5_6_5`,33648:`MIRRORED_REPEAT`,33901:`ALIASED_POINT_SIZE_RANGE`,33902:`ALIASED_LINE_WIDTH_RANGE`,33984:`TEXTURE0`,33985:`TEXTURE1`,33986:`TEXTURE2`,33987:`TEXTURE3`,33988:`TEXTURE4`,33989:`TEXTURE5`,33990:`TEXTURE6`,33991:`TEXTURE7`,33992:`TEXTURE8`,33993:`TEXTURE9`,33994:`TEXTURE10`,33995:`TEXTURE11`,33996:`TEXTURE12`,33997:`TEXTURE13`,33998:`TEXTURE14`,33999:`TEXTURE15`,34e3:`TEXTURE16`,34001:`TEXTURE17`,34002:`TEXTURE18`,34003:`TEXTURE19`,34004:`TEXTURE20`,34005:`TEXTURE21`,34006:`TEXTURE22`,34007:`TEXTURE23`,34008:`TEXTURE24`,34009:`TEXTURE25`,34010:`TEXTURE26`,34011:`TEXTURE27`,34012:`TEXTURE28`,34013:`TEXTURE29`,34014:`TEXTURE30`,34015:`TEXTURE31`,34016:`ACTIVE_TEXTURE`,34024:`MAX_RENDERBUFFER_SIZE`,34041:`DEPTH_STENCIL`,34055:`INCR_WRAP`,34056:`DECR_WRAP`,34067:`TEXTURE_CUBE_MAP`,34068:`TEXTURE_BINDING_CUBE_MAP`,34069:`TEXTURE_CUBE_MAP_POSITIVE_X`,34070:`TEXTURE_CUBE_MAP_NEGATIVE_X`,34071:`TEXTURE_CUBE_MAP_POSITIVE_Y`,34072:`TEXTURE_CUBE_MAP_NEGATIVE_Y`,34073:`TEXTURE_CUBE_MAP_POSITIVE_Z`,34074:`TEXTURE_CUBE_MAP_NEGATIVE_Z`,34076:`MAX_CUBE_MAP_TEXTURE_SIZE`,34338:`VERTEX_ATTRIB_ARRAY_ENABLED`,34339:`VERTEX_ATTRIB_ARRAY_SIZE`,34340:`VERTEX_ATTRIB_ARRAY_STRIDE`,34341:`VERTEX_ATTRIB_ARRAY_TYPE`,34342:`CURRENT_VERTEX_ATTRIB`,34373:`VERTEX_ATTRIB_ARRAY_POINTER`,34466:`NUM_COMPRESSED_TEXTURE_FORMATS`,34467:`COMPRESSED_TEXTURE_FORMATS`,34660:`BUFFER_SIZE`,34661:`BUFFER_USAGE`,34816:`STENCIL_BACK_FUNC`,34817:`STENCIL_BACK_FAIL`,34818:`STENCIL_BACK_PASS_DEPTH_FAIL`,34819:`STENCIL_BACK_PASS_DEPTH_PASS`,34877:`BLEND_EQUATION_ALPHA`,34921:`MAX_VERTEX_ATTRIBS`,34922:`VERTEX_ATTRIB_ARRAY_NORMALIZED`,34930:`MAX_TEXTURE_IMAGE_UNITS`,34962:`ARRAY_BUFFER`,34963:`ELEMENT_ARRAY_BUFFER`,34964:`ARRAY_BUFFER_BINDING`,34965:`ELEMENT_ARRAY_BUFFER_BINDING`,34975:`VERTEX_ATTRIB_ARRAY_BUFFER_BINDING`,35040:`STREAM_DRAW`,35044:`STATIC_DRAW`,35048:`DYNAMIC_DRAW`,35632:`FRAGMENT_SHADER`,35633:`VERTEX_SHADER`,35660:`MAX_VERTEX_TEXTURE_IMAGE_UNITS`,35661:`MAX_COMBINED_TEXTURE_IMAGE_UNITS`,35663:`SHADER_TYPE`,35664:`FLOAT_VEC2`,35665:`FLOAT_VEC3`,35666:`FLOAT_VEC4`,35667:`INT_VEC2`,35668:`INT_VEC3`,35669:`INT_VEC4`,35670:`BOOL`,35671:`BOOL_VEC2`,35672:`BOOL_VEC3`,35673:`BOOL_VEC4`,35674:`FLOAT_MAT2`,35675:`FLOAT_MAT3`,35676:`FLOAT_MAT4`,35678:`SAMPLER_2D`,35680:`SAMPLER_CUBE`,35712:`DELETE_STATUS`,35713:`COMPILE_STATUS`,35714:`LINK_STATUS`,35715:`VALIDATE_STATUS`,35716:`INFO_LOG_LENGTH`,35717:`ATTACHED_SHADERS`,35718:`ACTIVE_UNIFORMS`,35719:`ACTIVE_UNIFORM_MAX_LENGTH`,35720:`SHADER_SOURCE_LENGTH`,35721:`ACTIVE_ATTRIBUTES`,35722:`ACTIVE_ATTRIBUTE_MAX_LENGTH`,35724:`SHADING_LANGUAGE_VERSION`,35725:`CURRENT_PROGRAM`,36003:`STENCIL_BACK_REF`,36004:`STENCIL_BACK_VALUE_MASK`,36005:`STENCIL_BACK_WRITEMASK`,36006:`FRAMEBUFFER_BINDING`,36007:`RENDERBUFFER_BINDING`,36048:`FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE`,36049:`FRAMEBUFFER_ATTACHMENT_OBJECT_NAME`,36050:`FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL`,36051:`FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE`,36053:`FRAMEBUFFER_COMPLETE`,36054:`FRAMEBUFFER_INCOMPLETE_ATTACHMENT`,36055:`FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT`,36057:`FRAMEBUFFER_INCOMPLETE_DIMENSIONS`,36061:`FRAMEBUFFER_UNSUPPORTED`,36064:`COLOR_ATTACHMENT0`,36096:`DEPTH_ATTACHMENT`,36128:`STENCIL_ATTACHMENT`,36160:`FRAMEBUFFER`,36161:`RENDERBUFFER`,36162:`RENDERBUFFER_WIDTH`,36163:`RENDERBUFFER_HEIGHT`,36164:`RENDERBUFFER_INTERNAL_FORMAT`,36168:`STENCIL_INDEX8`,36176:`RENDERBUFFER_RED_SIZE`,36177:`RENDERBUFFER_GREEN_SIZE`,36178:`RENDERBUFFER_BLUE_SIZE`,36179:`RENDERBUFFER_ALPHA_SIZE`,36180:`RENDERBUFFER_DEPTH_SIZE`,36181:`RENDERBUFFER_STENCIL_SIZE`,36194:`RGB565`,36336:`LOW_FLOAT`,36337:`MEDIUM_FLOAT`,36338:`HIGH_FLOAT`,36339:`LOW_INT`,36340:`MEDIUM_INT`,36341:`HIGH_INT`,36346:`SHADER_COMPILER`,36347:`MAX_VERTEX_UNIFORM_VECTORS`,36348:`MAX_VARYING_VECTORS`,36349:`MAX_FRAGMENT_UNIFORM_VECTORS`,37440:`UNPACK_FLIP_Y_WEBGL`,37441:`UNPACK_PREMULTIPLY_ALPHA_WEBGL`,37442:`CONTEXT_LOST_WEBGL`,37443:`UNPACK_COLORSPACE_CONVERSION_WEBGL`,37444:`BROWSER_DEFAULT_WEBGL`}},5171:function(e,t,n){var r=n(737);e.exports=function(e){return r[e]}},9165:function(e,t,n){e.exports=f;var r=n(2762),i=n(8116),a=n(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,n,r){this.gl=e,this.shader=r,this.buffer=t,this.vao=n,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 c=s.prototype;c.isOpaque=function(){return!this.hasAlpha},c.isTransparent=function(){return this.hasAlpha},c.drawTransparent=c.draw=function(e){var t=this.gl,n=this.shader.uniforms;this.shader.bind();var r=n.view=e.view||o,i=n.projection=e.projection||o;n.model=e.model||o,n.clipBounds=this.clipBounds,n.opacity=this.opacity;var a=r[12],s=r[13],c=r[14],l=r[15],u=(e._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*c+i[15]*l)/t.drawingBufferHeight;this.vao.bind();for(var d=0;d<3;++d)t.lineWidth(this.lineWidth[d]*this.pixelRatio),n.capSize=this.capSize[d]*u,this.lineCount[d]&&t.drawArrays(t.LINES,this.lineOffset[d],this.lineCount[d]);this.vao.unbind()};function l(e,t){for(var n=0;n<3;++n)e[0][n]=Math.min(e[0][n],t[n]),e[1][n]=Math.max(e[1][n],t[n])}var u=function(){for(var e=[,,,],t=0;t<3;++t){for(var n=[],r=1;r<=2;++r)for(var i=-1;i<=1;i+=2){var a=(r+t)%3,o=[0,0,0];o[a]=i,n.push(o)}e[t]=n}return e}();function d(e,t,n,r){for(var i=u[r],a=0;a<i.length;++a){var o=i[a];e.push(t[0],t[1],t[2],n[0],n[1],n[2],n[3],o[0],o[1],o[2])}return i.length}c.update=function(e){e||={},`lineWidth`in e&&(this.lineWidth=e.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),`capSize`in e&&(this.capSize=e.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),this.hasAlpha=!1,`opacity`in e&&(this.opacity=+e.opacity,this.opacity<1&&(this.hasAlpha=!0));var t=e.color||[[0,0,0],[0,0,0],[0,0,0]],n=e.position,r=e.error;if(Array.isArray(t[0])||(t=[t,t,t]),n&&r){var i=[],a=n.length,o=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var s=0;s<3;++s){this.lineOffset[s]=o;e:for(var c=0;c<a;++c){for(var u=n[c],f=0;f<3;++f)if(isNaN(u[f])||!isFinite(u[f]))continue e;var p=r[c],m=t[s];if(Array.isArray(m[0])&&(m=t[c]),m.length===3?m=[m[0],m[1],m[2],1]:m.length===4&&(m=[m[0],m[1],m[2],m[3]],!this.hasAlpha&&m[3]<1&&(this.hasAlpha=!0)),!(isNaN(p[0][s])||isNaN(p[1][s]))){if(p[0][s]<0){var h=u.slice();h[s]+=p[0][s],i.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,h[0],h[1],h[2],m[0],m[1],m[2],m[3],0,0,0),l(this.bounds,h),o+=2+d(i,h,m,s)}if(p[1][s]>0){var h=u.slice();h[s]+=p[1][s],i.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,h[0],h[1],h[2],m[0],m[1],m[2],m[3],0,0,0),l(this.bounds,h),o+=2+d(i,h,m,s)}}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},c.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function f(e){var t=e.gl,n=r(t),o=i(t,[{buffer:n,type:t.FLOAT,size:3,offset:0,stride:40},{buffer:n,type:t.FLOAT,size:4,offset:12,stride:40},{buffer:n,type:t.FLOAT,size:3,offset:28,stride:40}]),c=a(t);c.attributes.position.location=0,c.attributes.color.location=1,c.attributes.offset.location=2;var l=new s(t,n,o,c);return l.update(e),l}},3436:function(e,t,n){var r=n(3236),i=n(9405),a=r([`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;
}`]),o=r([`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;
}`]);e.exports=function(e){return i(e,a,o,null,[{name:`position`,type:`vec3`},{name:`color`,type:`vec4`},{name:`offset`,type:`vec3`}])}},2260:function(e,t,n){var r=n(7766);e.exports=y;var i=null,a,o,s,c;function l(e){return[e.getParameter(e.FRAMEBUFFER_BINDING),e.getParameter(e.RENDERBUFFER_BINDING),e.getParameter(e.TEXTURE_BINDING_2D)]}function u(e,t){e.bindFramebuffer(e.FRAMEBUFFER,t[0]),e.bindRenderbuffer(e.RENDERBUFFER,t[1]),e.bindTexture(e.TEXTURE_2D,t[2])}function d(e,t){var n=e.getParameter(t.MAX_COLOR_ATTACHMENTS_WEBGL);i=Array(n+1);for(var r=0;r<=n;++r){for(var a=Array(n),o=0;o<r;++o)a[o]=e.COLOR_ATTACHMENT0+o;for(var o=r;o<n;++o)a[o]=e.NONE;i[r]=a}}function f(e){switch(e){case a:throw Error(`gl-fbo: Framebuffer unsupported`);case o:throw Error(`gl-fbo: Framebuffer incomplete attachment`);case s:throw Error(`gl-fbo: Framebuffer incomplete dimensions`);case c:throw Error(`gl-fbo: Framebuffer incomplete missing attachment`);default:throw Error(`gl-fbo: Framebuffer failed for unspecified reason`)}}function p(e,t,n,i,a,o){if(!i)return null;var s=r(e,t,n,a,i);return s.magFilter=e.NEAREST,s.minFilter=e.NEAREST,s.mipSamples=1,s.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,o,e.TEXTURE_2D,s.handle,0),s}function m(e,t,n,r,i){var a=e.createRenderbuffer();return e.bindRenderbuffer(e.RENDERBUFFER,a),e.renderbufferStorage(e.RENDERBUFFER,r,t,n),e.framebufferRenderbuffer(e.FRAMEBUFFER,i,e.RENDERBUFFER,a),a}function h(e){var t=l(e.gl),n=e.gl,r=e.handle=n.createFramebuffer(),a=e._shape[0],o=e._shape[1],s=e.color.length,c=e._ext,d=e._useStencil,h=e._useDepth,g=e._colorType;n.bindFramebuffer(n.FRAMEBUFFER,r);for(var _=0;_<s;++_)e.color[_]=p(n,a,o,g,n.RGBA,n.COLOR_ATTACHMENT0+_);s===0?(e._color_rb=m(n,a,o,n.RGBA4,n.COLOR_ATTACHMENT0),c&&c.drawBuffersWEBGL(i[0])):s>1&&c.drawBuffersWEBGL(i[s]);var v=n.getExtension(`WEBGL_depth_texture`);v?d?e.depth=p(n,a,o,v.UNSIGNED_INT_24_8_WEBGL,n.DEPTH_STENCIL,n.DEPTH_STENCIL_ATTACHMENT):h&&(e.depth=p(n,a,o,n.UNSIGNED_SHORT,n.DEPTH_COMPONENT,n.DEPTH_ATTACHMENT)):h&&d?e._depth_rb=m(n,a,o,n.DEPTH_STENCIL,n.DEPTH_STENCIL_ATTACHMENT):h?e._depth_rb=m(n,a,o,n.DEPTH_COMPONENT16,n.DEPTH_ATTACHMENT):d&&(e._depth_rb=m(n,a,o,n.STENCIL_INDEX,n.STENCIL_ATTACHMENT));var y=n.checkFramebufferStatus(n.FRAMEBUFFER);if(y!==n.FRAMEBUFFER_COMPLETE){e._destroyed=!0,n.bindFramebuffer(n.FRAMEBUFFER,null),n.deleteFramebuffer(e.handle),e.handle=null,e.depth&&=(e.depth.dispose(),null),e._depth_rb&&=(n.deleteRenderbuffer(e._depth_rb),null);for(var _=0;_<e.color.length;++_)e.color[_].dispose(),e.color[_]=null;e._color_rb&&=(n.deleteRenderbuffer(e._color_rb),null),u(n,t),f(y)}u(n,t)}function g(e,t,n,r,i,a,o,s){this.gl=e,this._shape=[t|0,n|0],this._destroyed=!1,this._ext=s,this.color=Array(i);for(var c=0;c<i;++c)this.color[c]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=r,this._useDepth=a,this._useStencil=o;var l=this,u=[t|0,n|0];Object.defineProperties(u,{0:{get:function(){return l._shape[0]},set:function(e){return l.width=e}},1:{get:function(){return l._shape[1]},set:function(e){return l.height=e}}}),this._shapeVector=u,h(this)}var _=g.prototype;function v(e,t,n){if(e._destroyed)throw Error(`gl-fbo: Can't resize destroyed FBO`);if(!(e._shape[0]===t&&e._shape[1]===n)){var r=e.gl,i=r.getParameter(r.MAX_RENDERBUFFER_SIZE);if(t<0||t>i||n<0||n>i)throw Error(`gl-fbo: Can't resize FBO, invalid dimensions`);e._shape[0]=t,e._shape[1]=n;for(var a=l(r),o=0;o<e.color.length;++o)e.color[o].shape=e._shape;e._color_rb&&(r.bindRenderbuffer(r.RENDERBUFFER,e._color_rb),r.renderbufferStorage(r.RENDERBUFFER,r.RGBA4,e._shape[0],e._shape[1])),e.depth&&(e.depth.shape=e._shape),e._depth_rb&&(r.bindRenderbuffer(r.RENDERBUFFER,e._depth_rb),e._useDepth&&e._useStencil?r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e._shape[0],e._shape[1]):e._useDepth?r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,e._shape[0],e._shape[1]):e._useStencil&&r.renderbufferStorage(r.RENDERBUFFER,r.STENCIL_INDEX,e._shape[0],e._shape[1])),r.bindFramebuffer(r.FRAMEBUFFER,e.handle);var s=r.checkFramebufferStatus(r.FRAMEBUFFER);s!==r.FRAMEBUFFER_COMPLETE&&(e.dispose(),u(r,a),f(s)),u(r,a)}}Object.defineProperties(_,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(e){if(Array.isArray(e)||(e=[e|0,e|0]),e.length!==2)throw Error(`gl-fbo: Shape vector must be length 2`);var t=e[0]|0,n=e[1]|0;return v(this,t,n),[t,n]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(e){return e|=0,v(this,e,this._shape[1]),e},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(e){return e|=0,v(this,this._shape[0],e),e},enumerable:!1}}),_.bind=function(){if(!this._destroyed){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this.handle),e.viewport(0,0,this._shape[0],this._shape[1])}},_.dispose=function(){if(!this._destroyed){this._destroyed=!0;var e=this.gl;e.deleteFramebuffer(this.handle),this.handle=null,this.depth&&=(this.depth.dispose(),null),this._depth_rb&&=(e.deleteRenderbuffer(this._depth_rb),null);for(var t=0;t<this.color.length;++t)this.color[t].dispose(),this.color[t]=null;this._color_rb&&=(e.deleteRenderbuffer(this._color_rb),null)}};function y(e,t,n,r){a||(a=e.FRAMEBUFFER_UNSUPPORTED,o=e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,s=e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,c=e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var l=e.getExtension(`WEBGL_draw_buffers`);if(!i&&l&&d(e,l),Array.isArray(t)&&(r=n,n=t[1]|0,t=t[0]|0),typeof t!=`number`)throw Error(`gl-fbo: Missing shape parameter`);var u=e.getParameter(e.MAX_RENDERBUFFER_SIZE);if(t<0||t>u||n<0||n>u)throw Error(`gl-fbo: Parameters are too large for FBO`);r||={};var f=1;if(`color`in r){if(f=Math.max(r.color|0,0),f<0)throw Error(`gl-fbo: Must specify a nonnegative number of colors`);if(f>1)if(l){if(f>e.getParameter(l.MAX_COLOR_ATTACHMENTS_WEBGL))throw Error(`gl-fbo: Context does not support `+f+` draw buffers`)}else throw Error(`gl-fbo: Multiple draw buffer extension not supported`)}var p=e.UNSIGNED_BYTE,m=e.getExtension(`OES_texture_float`);if(r.float&&f>0){if(!m)throw Error(`gl-fbo: Context does not support floating point textures`);p=e.FLOAT}else r.preferFloat&&f>0&&m&&(p=e.FLOAT);var h=!0;`depth`in r&&(h=!!r.depth);var _=!1;return`stencil`in r&&(_=!!r.stencil),new g(e,t,n,p,f,h,_,l)}},2992:function(e,t,n){var r=n(3387).sprintf,i=n(5171),a=n(1848),o=n(1085);e.exports=s;function s(e,t,n){var s=a(t)||`of unknown name (see npm glsl-shader-name)`,c=`unknown type`;n!==void 0&&(c=n===i.FRAGMENT_SHADER?`fragment`:`vertex`);for(var l=r(`Error compiling %s shader %s:
`,c,s),u=r(`%s%s`,l,e),d=e.split(`
`),f={},p=0;p<d.length;p++){var m=d[p];if(!(m===``||m===`\0`)){var h=parseInt(m.split(`:`)[2]);if(isNaN(h))throw Error(r(`Could not parse error: %s`,m));f[h]=m}}for(var g=o(t).split(`
`),p=0;p<g.length;p++)if(!(!f[p+3]&&!f[p+2]&&!f[p+1])){var _=g[p];if(l+=_+`
`,f[p+1]){var v=f[p+1];v=v.substr(v.split(`:`,3).join(`:`).length+1).trim(),l+=r(`^^^ %s
`,v)}}return{long:l.trim(),short:u.trim()}}},7319:function(e,t,n){var r=n(3236),i=n(9405),a=r([`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;
}
`]),o=r([`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=r([`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);
}`]),c=[{name:`position`,type:`vec3`},{name:`nextPosition`,type:`vec3`},{name:`arcLength`,type:`float`},{name:`lineWidth`,type:`float`},{name:`color`,type:`vec4`}];t.createShader=function(e){return i(e,a,o,null,c)},t.createPickShader=function(e){return i(e,a,s,null,c)}},5714:function(e,t,n){e.exports=b;var r=n(2762),i=n(8116),a=n(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer);function c(e,t,n,r){return o[0]=r,o[1]=n,o[2]=t,o[3]=e,s[0]}var l=n(2478),u=n(9618),d=n(7319),f=d.createShader,p=d.createPickShader,m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(e,t){for(var n=0,r=0;r<3;++r){var i=e[r]-t[r];n+=i*i}return Math.sqrt(n)}function g(e){for(var t=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],n=0;n<3;++n)t[0][n]=Math.max(e[0][n],t[0][n]),t[1][n]=Math.min(e[1][n],t[1][n]);return t}function _(e,t,n,r){this.arcLength=e,this.position=t,this.index=n,this.dataCoordinate=r}function v(e,t,n,r,i,a){this.gl=e,this.shader=t,this.pickShader=n,this.buffer=r,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=v.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(e){this.pickId=e},y.drawTransparent=y.draw=function(e){if(this.vertexCount){var t=this.gl,n=this.shader,r=this.vao;n.bind(),n.uniforms={model:e.model||m,view:e.view||m,projection:e.projection||m,clipBounds:g(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},r.bind(),r.draw(t.TRIANGLE_STRIP,this.vertexCount),r.unbind()}},y.drawPick=function(e){if(this.vertexCount){var t=this.gl,n=this.pickShader,r=this.vao;n.bind(),n.uniforms={model:e.model||m,view:e.view||m,projection:e.projection||m,pickId:this.pickId,clipBounds:g(this.clipBounds),screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},r.bind(),r.draw(t.TRIANGLE_STRIP,this.vertexCount),r.unbind()}},y.update=function(e){var t,n;this.dirty=!0;var r=!!e.connectGaps;`dashScale`in e&&(this.dashScale=e.dashScale),this.hasAlpha=!1,`opacity`in e&&(this.opacity=+e.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,c=0,d=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],f=e.position||e.positions;if(f){var p=e.color||e.colors||[0,0,0,1],m=e.lineWidth||1,g=!1;e:for(t=1;t<f.length;++t){var _=f[t-1],v=f[t];for(a.push(s),o.push(_.slice()),n=0;n<3;++n){if(isNaN(_[n])||isNaN(v[n])||!isFinite(_[n])||!isFinite(v[n])){if(!r&&i.length>0){for(var y=0;y<24;++y)i.push(i[i.length-12]);c+=2,g=!0}continue e}d[0][n]=Math.min(d[0][n],_[n],v[n]),d[1][n]=Math.max(d[1][n],_[n],v[n])}var b,x;Array.isArray(p[0])?(b=p.length>t-1?p[t-1]:p.length>0?p[p.length-1]:[0,0,0,1],x=p.length>t?p[t]:p.length>0?p[p.length-1]:[0,0,0,1]):b=x=p,b.length===3&&(b=[b[0],b[1],b[2],1]),x.length===3&&(x=[x[0],x[1],x[2],1]),!this.hasAlpha&&b[3]<1&&(this.hasAlpha=!0);var S=Array.isArray(m)?m.length>t-1?m[t-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m,C=s;if(s+=h(_,v),g){for(n=0;n<2;++n)i.push(_[0],_[1],_[2],v[0],v[1],v[2],C,S,b[0],b[1],b[2],b[3]);c+=2,g=!1}i.push(_[0],_[1],_[2],v[0],v[1],v[2],C,S,b[0],b[1],b[2],b[3],_[0],_[1],_[2],v[0],v[1],v[2],C,-S,b[0],b[1],b[2],b[3],v[0],v[1],v[2],_[0],_[1],_[2],s,-S,x[0],x[1],x[2],x[3],v[0],v[1],v[2],_[0],_[1],_[2],s,S,x[0],x[1],x[2],x[3]),c+=4}}if(this.buffer.update(i),a.push(s),o.push(f[f.length-1].slice()),this.bounds=d,this.vertexCount=c,this.points=o,this.arcLength=a,`dashes`in e){var w=e.dashes.slice();for(w.unshift(0),t=1;t<w.length;++t)w[t]=w[t-1]+w[t];var T=u(Array(256*4),[256,1,4]);for(t=0;t<256;++t){for(n=0;n<4;++n)T.set(t,0,n,0);l.le(w,w[w.length-1]*t/255)&1?T.set(t,0,0,0):T.set(t,0,0,255)}this.texture.setPixels(T)}},y.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},y.pick=function(e){if(!e||e.id!==this.pickId)return null;var t=c(e.value[0],e.value[1],e.value[2],0),n=l.le(this.arcLength,t);if(n<0)return null;if(n===this.arcLength.length-1)return new _(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),n);for(var r=this.points[n],i=this.points[Math.min(n+1,this.points.length-1)],a=(t-this.arcLength[n])/(this.arcLength[n+1]-this.arcLength[n]),o=1-a,s=[0,0,0],u=0;u<3;++u)s[u]=o*r[u]+a*i[u];var d=Math.min(a<.5?n:n+1,this.points.length-1);return new _(t,s,d,this.points[d])};function b(e){var t=e.gl||e.scene&&e.scene.gl,n=f(t);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;var o=p(t);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=r(t),c=i(t,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),l=u(Array(256*4),[256,1,4]),d=0;d<1024;++d)l.data[d]=255;var m=a(t,l);m.wrap=t.REPEAT;var h=new v(t,n,o,s,c,m);return h.update(e),h}},1903:function(e){e.exports=t;function t(e){var t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},6864:function(e){e.exports=t;function t(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},9921:function(e){e.exports=t;function t(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=t*o-n*a,v=t*s-r*a,y=t*c-i*a,b=n*s-r*o,x=n*c-i*o,S=r*c-i*s,C=l*m-u*p,w=l*h-d*p,T=l*g-f*p,E=u*h-d*m,D=u*g-f*m;return _*(d*g-f*h)-v*D+y*E+b*T-x*w+S*C}},7399:function(e){e.exports=t;function t(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n+n,s=r+r,c=i+i,l=n*o,u=r*o,d=r*s,f=i*o,p=i*s,m=i*c,h=a*o,g=a*s,_=a*c;return e[0]=1-d-m,e[1]=u+_,e[2]=f-g,e[3]=0,e[4]=u-_,e[5]=1-l-m,e[6]=p+h,e[7]=0,e[8]=f+g,e[9]=p-h,e[10]=1-l-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},6743:function(e){e.exports=t;function t(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=r+r,c=i+i,l=a+a,u=r*s,d=r*c,f=r*l,p=i*c,m=i*l,h=a*l,g=o*s,_=o*c,v=o*l;return e[0]=1-(p+h),e[1]=d+v,e[2]=f-_,e[3]=0,e[4]=d-v,e[5]=1-(u+h),e[6]=m+g,e[7]=0,e[8]=f+_,e[9]=m-g,e[10]=1-(u+p),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}},7894:function(e){e.exports=t;function t(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},7608:function(e){e.exports=t;function t(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14],_=t[15],v=n*s-r*o,y=n*c-i*o,b=n*l-a*o,x=r*c-i*s,S=r*l-a*s,C=i*l-a*c,w=u*h-d*m,T=u*g-f*m,E=u*_-p*m,D=d*g-f*h,O=d*_-p*h,k=f*_-p*g,A=v*k-y*O+b*D+x*E-S*T+C*w;return A?(A=1/A,e[0]=(s*k-c*O+l*D)*A,e[1]=(i*O-r*k-a*D)*A,e[2]=(h*C-g*S+_*x)*A,e[3]=(f*S-d*C-p*x)*A,e[4]=(c*E-o*k-l*T)*A,e[5]=(n*k-i*E+a*T)*A,e[6]=(g*b-m*C-_*y)*A,e[7]=(u*C-f*b+p*y)*A,e[8]=(o*O-s*E+l*w)*A,e[9]=(r*E-n*O-a*w)*A,e[10]=(m*S-h*b+_*v)*A,e[11]=(d*b-u*S-p*v)*A,e[12]=(s*T-o*D-c*w)*A,e[13]=(n*D-r*T+i*w)*A,e[14]=(h*y-m*x-g*v)*A,e[15]=(u*x-d*y+f*v)*A,e):null}},6582:function(e,t,n){var r=n(7894);e.exports=i;function i(e,t,n,i){var a,o,s,c,l,u,d,f,p,m,h=t[0],g=t[1],_=t[2],v=i[0],y=i[1],b=i[2],x=n[0],S=n[1],C=n[2];return Math.abs(h-x)<1e-6&&Math.abs(g-S)<1e-6&&Math.abs(_-C)<1e-6?r(e):(d=h-x,f=g-S,p=_-C,m=1/Math.sqrt(d*d+f*f+p*p),d*=m,f*=m,p*=m,a=y*p-b*f,o=b*d-v*p,s=v*f-y*d,m=Math.sqrt(a*a+o*o+s*s),m?(m=1/m,a*=m,o*=m,s*=m):(a=0,o=0,s=0),c=f*s-p*o,l=p*a-d*s,u=d*o-f*a,m=Math.sqrt(c*c+l*l+u*u),m?(m=1/m,c*=m,l*=m,u*=m):(c=0,l=0,u=0),e[0]=a,e[1]=c,e[2]=d,e[3]=0,e[4]=o,e[5]=l,e[6]=f,e[7]=0,e[8]=s,e[9]=u,e[10]=p,e[11]=0,e[12]=-(a*h+o*g+s*_),e[13]=-(c*h+l*g+u*_),e[14]=-(d*h+f*g+p*_),e[15]=1,e)}},6760:function(e){e.exports=t;function t(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=n[0],b=n[1],x=n[2],S=n[3];return e[0]=y*r+b*s+x*d+S*h,e[1]=y*i+b*c+x*f+S*g,e[2]=y*a+b*l+x*p+S*_,e[3]=y*o+b*u+x*m+S*v,y=n[4],b=n[5],x=n[6],S=n[7],e[4]=y*r+b*s+x*d+S*h,e[5]=y*i+b*c+x*f+S*g,e[6]=y*a+b*l+x*p+S*_,e[7]=y*o+b*u+x*m+S*v,y=n[8],b=n[9],x=n[10],S=n[11],e[8]=y*r+b*s+x*d+S*h,e[9]=y*i+b*c+x*f+S*g,e[10]=y*a+b*l+x*p+S*_,e[11]=y*o+b*u+x*m+S*v,y=n[12],b=n[13],x=n[14],S=n[15],e[12]=y*r+b*s+x*d+S*h,e[13]=y*i+b*c+x*f+S*g,e[14]=y*a+b*l+x*p+S*_,e[15]=y*o+b*u+x*m+S*v,e}},4040:function(e){e.exports=t;function t(e,t,n,r,i,a,o){var s=1/(t-n),c=1/(r-i),l=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*c,e[14]=(o+a)*l,e[15]=1,e}},4772:function(e){e.exports=t;function t(e,t,n,r,i){var a=1/Math.tan(t/2),o=1/(r-i);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+r)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*r*o,e[15]=0,e}},6079:function(e){e.exports=t;function t(e,t,n,r){var i=r[0],a=r[1],o=r[2],s=Math.sqrt(i*i+a*a+o*o),c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j;return Math.abs(s)<1e-6?null:(s=1/s,i*=s,a*=s,o*=s,c=Math.sin(n),l=Math.cos(n),u=1-l,d=t[0],f=t[1],p=t[2],m=t[3],h=t[4],g=t[5],_=t[6],v=t[7],y=t[8],b=t[9],x=t[10],S=t[11],C=i*i*u+l,w=a*i*u+o*c,T=o*i*u-a*c,E=i*a*u-o*c,D=a*a*u+l,O=o*a*u+i*c,k=i*o*u+a*c,A=a*o*u-i*c,j=o*o*u+l,e[0]=d*C+h*w+y*T,e[1]=f*C+g*w+b*T,e[2]=p*C+_*w+x*T,e[3]=m*C+v*w+S*T,e[4]=d*E+h*D+y*O,e[5]=f*E+g*D+b*O,e[6]=p*E+_*D+x*O,e[7]=m*E+v*D+S*O,e[8]=d*k+h*A+y*j,e[9]=f*k+g*A+b*j,e[10]=p*k+_*A+x*j,e[11]=m*k+v*A+S*j,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}},5567:function(e){e.exports=t;function t(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+l*r,e[5]=o*i+u*r,e[6]=s*i+d*r,e[7]=c*i+f*r,e[8]=l*i-a*r,e[9]=u*i-o*r,e[10]=d*i-s*r,e[11]=f*i-c*r,e}},2408:function(e){e.exports=t;function t(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[8],u=t[9],d=t[10],f=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-l*r,e[1]=o*i-u*r,e[2]=s*i-d*r,e[3]=c*i-f*r,e[8]=a*r+l*i,e[9]=o*r+u*i,e[10]=s*r+d*i,e[11]=c*r+f*i,e}},7089:function(e){e.exports=t;function t(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[4],u=t[5],d=t[6],f=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+l*r,e[1]=o*i+u*r,e[2]=s*i+d*r,e[3]=c*i+f*r,e[4]=l*i-a*r,e[5]=u*i-o*r,e[6]=d*i-s*r,e[7]=f*i-c*r,e}},2504:function(e){e.exports=t;function t(e,t,n){var r=n[0],i=n[1],a=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},7656:function(e){e.exports=t;function t(e,t,n){var r=n[0],i=n[1],a=n[2],o,s,c,l,u,d,f,p,m,h,g,_;return t===e?(e[12]=t[0]*r+t[4]*i+t[8]*a+t[12],e[13]=t[1]*r+t[5]*i+t[9]*a+t[13],e[14]=t[2]*r+t[6]*i+t[10]*a+t[14],e[15]=t[3]*r+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],c=t[2],l=t[3],u=t[4],d=t[5],f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],e[0]=o,e[1]=s,e[2]=c,e[3]=l,e[4]=u,e[5]=d,e[6]=f,e[7]=p,e[8]=m,e[9]=h,e[10]=g,e[11]=_,e[12]=o*r+u*i+m*a+t[12],e[13]=s*r+d*i+h*a+t[13],e[14]=c*r+f*i+g*a+t[14],e[15]=l*r+p*i+_*a+t[15]),e}},5665:function(e){e.exports=t;function t(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}},7626:function(e,t,n){var r=n(2642),i=n(9346);e.exports=l;function a(e,t){for(var n=[0,0,0,0],r=0;r<4;++r)for(var i=0;i<4;++i)n[i]+=e[4*r+i]*t[r];return n}function o(e,t,n,r,i){for(var o=a(r,a(n,a(t,[e[0],e[1],e[2],1]))),s=0;s<3;++s)o[s]/=o[3];return[.5*i[0]*(1+o[0]),.5*i[1]*(1-o[1])]}function s(e,t){if(e.length===2){for(var n=0,a=0,o=0;o<2;++o)n+=(t[o]-e[0][o])**2,a+=(t[o]-e[1][o])**2;return n=Math.sqrt(n),a=Math.sqrt(a),n+a<1e-6?[1,0]:[a/(n+a),n/(a+n)]}else if(e.length===3){var s=[0,0];return i(e[0],e[1],e[2],t,s),r(e,s)}return[]}function c(e,t){for(var n=[0,0,0],r=0;r<e.length;++r)for(var i=e[r],a=t[r],o=0;o<3;++o)n[o]+=a*i[o];return n}function l(e,t,n,r,i,a){if(e.length===1)return[0,e[0].slice()];for(var l=Array(e.length),u=0;u<e.length;++u)l[u]=o(e[u],n,r,i,a);for(var d=0,f=1/0,u=0;u<l.length;++u){for(var p=0,m=0;m<2;++m)p+=(l[u][m]-t[m])**2;p<f&&(f=p,d=u)}for(var h=s(l,t),g=0,u=0;u<3;++u){if(h[u]<-.001||h[u]>1.0001)return null;g+=h[u]}return Math.abs(g-1)>.001?null:[d,c(e,h),h]}},840:function(e,t,n){var r=n(3236),i=r([`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;
}
`]),a=r([`#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;
}
`]),o=r([`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=r([`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;
}`]),c=r([`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;
}`]),l=r([`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;
}`]),u=r([`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;
}`]),d=r([`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);
}`]),f=r([`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;
}`]),p=r([`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)));
}`]),m=r([`precision highp float;
#define GLSLIFY 1
uniform vec3 contourColor;
void main() {
gl_FragColor = vec4(contourColor, 1.0);
}
`]);t.meshShader={vertex:i,fragment:a,attributes:[{name:`position`,type:`vec3`},{name:`normal`,type:`vec3`},{name:`color`,type:`vec4`},{name:`uv`,type:`vec2`}]},t.wireShader={vertex:o,fragment:s,attributes:[{name:`position`,type:`vec3`},{name:`color`,type:`vec4`},{name:`uv`,type:`vec2`}]},t.pointShader={vertex:c,fragment:l,attributes:[{name:`position`,type:`vec3`},{name:`color`,type:`vec4`},{name:`uv`,type:`vec2`},{name:`pointSize`,type:`float`}]},t.pickShader={vertex:u,fragment:d,attributes:[{name:`position`,type:`vec3`},{name:`id`,type:`vec4`}]},t.pointPickShader={vertex:f,fragment:d,attributes:[{name:`position`,type:`vec3`},{name:`pointSize`,type:`float`},{name:`id`,type:`vec4`}]},t.contourShader={vertex:p,fragment:m,attributes:[{name:`position`,type:`vec3`}]}},7201:function(e,t,n){var r=1e-6,i=1e-6,a=n(9405),o=n(2762),s=n(8116),c=n(7766),l=n(8406),u=n(6760),d=n(7608),f=n(9618),p=n(6729),m=n(7765),h=n(1888),g=n(840),_=n(7626),v=g.meshShader,y=g.wireShader,b=g.pointShader,x=g.pickShader,S=g.pointPickShader,C=g.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,T,E,D){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=n,this.lineShader=r,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=c,this.triangleColors=u,this.triangleNormals=f,this.triangleUVs=d,this.triangleIds=l,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=m,this.edgeColors=g,this.edgeUVs=_,this.edgeIds=h,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=y,this.pointColors=x,this.pointUVs=S,this.pointSizes=C,this.pointIds=b,this.pointVAO=T,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=E,this.contourVAO=D,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=w,this._view=w,this._projection=w,this._resolution=[1,1]}var E=T.prototype;E.isOpaque=function(){return!this.hasAlpha},E.isTransparent=function(){return this.hasAlpha},E.pickSlots=1,E.setPickBase=function(e){this.pickId=e};function D(e,t){if(!t||!t.length)return 1;for(var n=0;n<t.length;++n){if(t.length<2)return 1;if(t[n][0]===e)return t[n][1];if(t[n][0]>e&&n>0){var r=(t[n][0]-e)/(t[n][0]-t[n-1][0]);return t[n][1]*(1-r)+r*t[n-1][1]}}return 1}function O(e,t){for(var n=p({colormap:e,nshades:256,format:`rgba`}),r=new Uint8Array(256*4),i=0;i<256;++i){for(var a=n[i],o=0;o<3;++o)r[4*i+o]=a[o];t?r[4*i+3]=255*D(i/255,t):r[4*i+3]=255*a[3]}return f(r,[256,256,4],[4,0,1])}function k(e){for(var t=e.length,n=Array(t),r=0;r<t;++r)n[r]=e[r][2];return n}E.highlight=function(e){if(!e||!this.contourEnable){this.contourCount=0;return}for(var t=m(this.cells,this.intensity,e.intensity),n=t.cells,r=t.vertexIds,i=t.vertexWeights,a=n.length,o=h.mallocFloat32(6*a),s=0,c=0;c<a;++c)for(var l=n[c],u=0;u<2;++u){var d=l[0];l.length===2&&(d=l[u]);for(var f=r[d][0],p=r[d][1],g=i[d],_=1-g,v=this.positions[f],y=this.positions[p],b=0;b<3;++b)o[s++]=g*v[b]+_*y[b]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),h.free(o)},E.update=function(e){e||={};var t=this.gl;this.dirty=!0,`contourEnable`in e&&(this.contourEnable=e.contourEnable),`contourColor`in e&&(this.contourColor=e.contourColor),`lineWidth`in e&&(this.lineWidth=e.lineWidth),`lightPosition`in e&&(this.lightPosition=e.lightPosition),this.hasAlpha=!1,`opacity`in e&&(this.opacity=e.opacity,this.opacity<1&&(this.hasAlpha=!0)),`opacityscale`in e&&(this.opacityscale=e.opacityscale,this.hasAlpha=!0),`ambient`in e&&(this.ambientLight=e.ambient),`diffuse`in e&&(this.diffuseLight=e.diffuse),`specular`in e&&(this.specularLight=e.specular),`roughness`in e&&(this.roughness=e.roughness),`fresnel`in e&&(this.fresnel=e.fresnel),e.texture?(this.texture.dispose(),this.texture=c(t,e.texture)):e.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=t.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=t.LINEAR,this.texture.setPixels(O(e.colormap,this.opacityscale)),this.texture.generateMipmap());var n=e.cells,a=e.positions;if(!(!a||!n)){var o=[],s=[],u=[],d=[],f=[],p=[],m=[],h=[],g=[],_=[],v=[],y=[],b=[],x=[];this.cells=n,this.positions=a;var S=e.vertexNormals,C=e.cellNormals,w=e.vertexNormalsEpsilon===void 0?r:e.vertexNormalsEpsilon,T=e.faceNormalsEpsilon===void 0?i:e.faceNormalsEpsilon;e.useFacetNormals&&!C&&(C=l.faceNormals(n,a,T)),!C&&!S&&(S=l.vertexNormals(n,a,w));var E=e.vertexColors,A=e.cellColors,j=e.meshColor||[1,1,1,1],M=e.vertexUVs,N=e.vertexIntensity,P=e.cellUVs,F=e.cellIntensity,I=1/0,L=-1/0;if(!M&&!P)if(N)if(e.vertexIntensityBounds)I=+e.vertexIntensityBounds[0],L=+e.vertexIntensityBounds[1];else for(var R=0;R<N.length;++R){var z=N[R];I=Math.min(I,z),L=Math.max(L,z)}else if(F)if(e.cellIntensityBounds)I=+e.cellIntensityBounds[0],L=+e.cellIntensityBounds[1];else for(var R=0;R<F.length;++R){var z=F[R];I=Math.min(I,z),L=Math.max(L,z)}else for(var R=0;R<a.length;++R){var z=a[R][2];I=Math.min(I,z),L=Math.max(L,z)}N?this.intensity=N:F?this.intensity=F:this.intensity=k(a),this.pickVertex=!(F||A);var B=e.pointSizes,V=e.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(var R=0;R<a.length;++R)for(var H=a[R],U=0;U<3;++U)isNaN(H[U])||!isFinite(H[U])||(this.bounds[0][U]=Math.min(this.bounds[0][U],H[U]),this.bounds[1][U]=Math.max(this.bounds[1][U],H[U]));var W=0,G=0,K=0;e:for(var R=0;R<n.length;++R){var q=n[R];switch(q.length){case 1:for(var J=q[0],H=a[J],U=0;U<3;++U)if(isNaN(H[U])||!isFinite(H[U]))continue e;_.push(H[0],H[1],H[2]);var Y=E?E[J]:A?A[R]:j;this.opacityscale&&N?s.push(Y[0],Y[1],Y[2],this.opacity*D((N[J]-I)/(L-I),this.opacityscale)):Y.length===3?v.push(Y[0],Y[1],Y[2],this.opacity):(v.push(Y[0],Y[1],Y[2],Y[3]*this.opacity),Y[3]<1&&(this.hasAlpha=!0));var X=M?M[J]:N?[(N[J]-I)/(L-I),0]:P?P[R]:F?[(F[R]-I)/(L-I),0]:[(H[2]-I)/(L-I),0];y.push(X[0],X[1]),B?b.push(B[J]):b.push(V),x.push(R),K+=1;break;case 2:for(var U=0;U<2;++U)for(var J=q[U],H=a[J],Z=0;Z<3;++Z)if(isNaN(H[Z])||!isFinite(H[Z]))continue e;for(var U=0;U<2;++U){var J=q[U],H=a[J];p.push(H[0],H[1],H[2]);var Y=E?E[J]:A?A[R]:j;this.opacityscale&&N?s.push(Y[0],Y[1],Y[2],this.opacity*D((N[J]-I)/(L-I),this.opacityscale)):Y.length===3?m.push(Y[0],Y[1],Y[2],this.opacity):(m.push(Y[0],Y[1],Y[2],Y[3]*this.opacity),Y[3]<1&&(this.hasAlpha=!0));var X=M?M[J]:N?[(N[J]-I)/(L-I),0]:P?P[R]:F?[(F[R]-I)/(L-I),0]:[(H[2]-I)/(L-I),0];h.push(X[0],X[1]),g.push(R)}G+=1;break;case 3:for(var U=0;U<3;++U)for(var J=q[U],H=a[J],Z=0;Z<3;++Z)if(isNaN(H[Z])||!isFinite(H[Z]))continue e;for(var U=0;U<3;++U){var J=q[2-U],H=a[J];o.push(H[0],H[1],H[2]);var Y=E?E[J]:A?A[R]:j;Y?this.opacityscale&&N?s.push(Y[0],Y[1],Y[2],this.opacity*D((N[J]-I)/(L-I),this.opacityscale)):Y.length===3?s.push(Y[0],Y[1],Y[2],this.opacity):(s.push(Y[0],Y[1],Y[2],Y[3]*this.opacity),Y[3]<1&&(this.hasAlpha=!0)):s.push(.5,.5,.5,1);var X=M?M[J]:N?[(N[J]-I)/(L-I),0]:P?P[R]:F?[(F[R]-I)/(L-I),0]:[(H[2]-I)/(L-I),0];d.push(X[0],X[1]);var Q=S?S[J]:C[R];u.push(Q[0],Q[1],Q[2]),f.push(R)}W+=1;break;default:break}}this.pointCount=K,this.edgeCount=G,this.triangleCount=W,this.pointPositions.update(_),this.pointColors.update(v),this.pointUVs.update(y),this.pointSizes.update(b),this.pointIds.update(new Uint32Array(x)),this.edgePositions.update(p),this.edgeColors.update(m),this.edgeUVs.update(h),this.edgeIds.update(new Uint32Array(g)),this.trianglePositions.update(o),this.triangleColors.update(s),this.triangleUVs.update(d),this.triangleNormals.update(u),this.triangleIds.update(new Uint32Array(f))}},E.drawTransparent=E.draw=function(e){e||={};for(var t=this.gl,n=e.model||w,r=e.view||w,i=e.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var s={model:n,view:r,projection:i,inverseModel:w.slice(),clipBounds:a,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};s.inverseModel=d(s.inverseModel,s.model),t.disable(t.CULL_FACE),this.texture.bind(0);var c=Array(16);u(c,s.view,s.model),u(c,s.projection,c),d(c,c);for(var o=0;o<3;++o)s.eyePosition[o]=c[12+o]/c[15];for(var l=c[15],o=0;o<3;++o)l+=this.lightPosition[o]*c[4*o+3];for(var o=0;o<3;++o){for(var f=c[12+o],p=0;p<3;++p)f+=c[4*p+o]*this.lightPosition[p];s.lightPosition[o]=f/l}if(this.triangleCount>0){var m=this.triShader;m.bind(),m.uniforms=s,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var m=this.lineShader;m.bind(),m.uniforms=s,this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var m=this.pointShader;m.bind(),m.uniforms=s,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var m=this.contourShader;m.bind(),m.uniforms=s,this.contourVAO.bind(),t.drawArrays(t.LINES,0,this.contourCount),this.contourVAO.unbind()}},E.drawPick=function(e){e||={};for(var t=this.gl,n=e.model||w,r=e.view||w,i=e.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(n),this._view=[].slice.call(r),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s={model:n,view:r,projection:i,clipBounds:a,pickId:this.pickId/255},c=this.pickShader;if(c.bind(),c.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var c=this.pointPickShader;c.bind(),c.uniforms=s,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind()}},E.pick=function(e){if(!e||e.id!==this.pickId)return null;for(var t=e.value[0]+256*e.value[1]+65536*e.value[2],n=this.cells[t],r=this.positions,i=Array(n.length),a=0;a<n.length;++a)i[a]=r[n[a]];var o=e.coord[0],s=e.coord[1];if(!this.pickVertex){var c=this.positions[n[0]],l=this.positions[n[1]],u=this.positions[n[2]],d=[(c[0]+l[0]+u[0])/3,(c[1]+l[1]+u[1])/3,(c[2]+l[2]+u[2])/3];return{_cellCenter:!0,position:[o,s],index:t,cell:n,cellId:t,intensity:this.intensity[t],dataCoordinate:d}}var f=_(i,[o*this.pixelRatio,this._resolution[1]-s*this.pixelRatio],this._model,this._view,this._projection,this._resolution);if(!f)return null;for(var p=f[2],m=0,a=0;a<n.length;++a)m+=p[a]*this.intensity[n[a]];return{position:f[1],index:n[f[0]],cell:n,cellId:t,intensity:m,dataCoordinate:this.positions[n[f[0]]]}},E.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 A(e){var t=a(e,v.vertex,v.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t.attributes.normal.location=4,t}function j(e){var t=a(e,y.vertex,y.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t}function M(e){var t=a(e,b.vertex,b.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t.attributes.pointSize.location=4,t}function N(e){var t=a(e,x.vertex,x.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t}function P(e){var t=a(e,S.vertex,S.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t.attributes.pointSize.location=4,t}function F(e){var t=a(e,C.vertex,C.fragment);return t.attributes.position.location=0,t}function I(e,t){if(arguments.length===1&&(t=e,e=t.gl),!(e.getExtension(`OES_standard_derivatives`)||e.getExtension(`MOZ_OES_standard_derivatives`)||e.getExtension(`WEBKIT_OES_standard_derivatives`)))throw Error(`derivatives not supported`);var n=A(e),r=j(e),i=M(e),a=N(e),l=P(e),u=F(e),d=c(e,f(new Uint8Array([255,255,255,255]),[1,1,4]));d.generateMipmap(),d.minFilter=e.LINEAR_MIPMAP_LINEAR,d.magFilter=e.LINEAR;var p=o(e),m=o(e),h=o(e),g=o(e),_=o(e),v=s(e,[{buffer:p,type:e.FLOAT,size:3},{buffer:_,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:e.FLOAT,size:4},{buffer:h,type:e.FLOAT,size:2},{buffer:g,type:e.FLOAT,size:3}]),y=o(e),b=o(e),x=o(e),S=o(e),C=s(e,[{buffer:y,type:e.FLOAT,size:3},{buffer:S,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:b,type:e.FLOAT,size:4},{buffer:x,type:e.FLOAT,size:2}]),w=o(e),E=o(e),D=o(e),O=o(e),k=o(e),I=s(e,[{buffer:w,type:e.FLOAT,size:3},{buffer:k,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:E,type:e.FLOAT,size:4},{buffer:D,type:e.FLOAT,size:2},{buffer:O,type:e.FLOAT,size:1}]),L=o(e),R=s(e,[{buffer:L,type:e.FLOAT,size:3}]),z=new T(e,d,n,r,i,a,l,u,p,_,m,h,g,v,y,S,b,x,C,w,k,E,D,O,I,L,R);return z.update(t),z}e.exports=I},4437:function(e,t,n){e.exports=l;var r=n(3025),i=n(6296),a=n(351),o=n(8512),s=n(24),c=n(7520);function l(e,t){e||=document.body,t||={};var n=[.01,1/0];`distanceLimits`in t&&(n[0]=t.distanceLimits[0],n[1]=t.distanceLimits[1]),`zoomMin`in t&&(n[0]=t.zoomMin),`zoomMax`in t&&(n[1]=t.zoomMax);var l=i({center:t.center||[0,0,0],up:t.up||[0,1,0],eye:t.eye||[0,0,10],mode:t.mode||`orbit`,distanceLimits:n}),u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d=0,f=e.clientWidth,p=e.clientHeight,m={keyBindingMode:`rotate`,enableWheel:!0,view:l,element:e,delay:t.delay||16,rotateSpeed:t.rotateSpeed||1,zoomSpeed:t.zoomSpeed||1,translateSpeed:t.translateSpeed||1,flipX:!!t.flipX,flipY:!!t.flipY,modes:l.modes,_ortho:t._ortho||t.projection&&t.projection.type===`orthographic`||!1,tick:function(){var t=r(),n=this.delay,i=t-2*n;l.idle(t-n),l.recalcMatrix(i),l.flush(t-(100+n*2));for(var a=!0,o=l.computedMatrix,s=0;s<16;++s)a&&=u[s]===o[s],u[s]=o[s];var c=e.clientWidth===f&&e.clientHeight===p;return f=e.clientWidth,p=e.clientHeight,a?!c:(d=Math.exp(l.computedRadius[0]),!0)},lookAt:function(e,t,n){l.lookAt(l.lastT(),e,t,n)},rotate:function(e,t,n){l.rotate(l.lastT(),e,t,n)},pan:function(e,t,n){l.pan(l.lastT(),e,t,n)},translate:function(e,t,n){l.translate(l.lastT(),e,t,n)}};return Object.defineProperties(m,{matrix:{get:function(){return l.computedMatrix},set:function(e){return l.setMatrix(l.lastT(),e),l.computedMatrix},enumerable:!0},mode:{get:function(){return l.getMode()},set:function(e){var t=l.computedUp.slice(),n=l.computedEye.slice(),i=l.computedCenter.slice();if(l.setMode(e),e===`turntable`){var a=r();l._active.lookAt(a,n,i,t),l._active.lookAt(a+500,n,i,[0,0,1]),l._active.flush(a)}return l.getMode()},enumerable:!0},center:{get:function(){return l.computedCenter},set:function(e){return l.lookAt(l.lastT(),null,e),l.computedCenter},enumerable:!0},eye:{get:function(){return l.computedEye},set:function(e){return l.lookAt(l.lastT(),e),l.computedEye},enumerable:!0},up:{get:function(){return l.computedUp},set:function(e){return l.lookAt(l.lastT(),null,null,e),l.computedUp},enumerable:!0},distance:{get:function(){return d},set:function(e){return l.setDistance(l.lastT(),e),e},enumerable:!0},distanceLimits:{get:function(){return l.getDistanceLimits(n)},set:function(e){return l.setDistanceLimits(e),e},enumerable:!0}}),e.addEventListener(`contextmenu`,function(e){return e.preventDefault(),!1}),m._lastX=-1,m._lastY=-1,m._lastMods={shift:!1,control:!1,alt:!1,meta:!1},m.enableMouseListeners=function(){m.mouseListener=a(e,t),e.addEventListener(`touchstart`,function(n){var r=s(n.changedTouches[0],e);t(0,r[0],r[1],m._lastMods),t(1,r[0],r[1],m._lastMods)},c?{passive:!0}:!1),e.addEventListener(`touchmove`,function(n){var r=s(n.changedTouches[0],e);t(1,r[0],r[1],m._lastMods),n.preventDefault()},c?{passive:!1}:!1),e.addEventListener(`touchend`,function(e){t(0,m._lastX,m._lastY,m._lastMods)},c?{passive:!0}:!1);function t(t,n,i,a){var o=m.keyBindingMode;if(o!==!1){var s=o===`rotate`,c=o===`pan`,u=o===`zoom`,f=!!a.control,p=!!a.alt,h=!!a.shift,g=!!(t&1),_=!!(t&2),v=!!(t&4),y=1/e.clientHeight,b=y*(n-m._lastX),x=y*(i-m._lastY),S=m.flipX?1:-1,C=m.flipY?1:-1,w=Math.PI*m.rotateSpeed,T=r();if(m._lastX!==-1&&m._lastY!==-1&&((s&&g&&!f&&!p&&!h||g&&!f&&!p&&h)&&l.rotate(T,S*w*b,-C*w*x,0),(c&&g&&!f&&!p&&!h||_||g&&f&&!p&&!h)&&l.pan(T,-m.translateSpeed*b*d,m.translateSpeed*x*d,0),u&&g&&!f&&!p&&!h||v||g&&!f&&p&&!h)){var E=-m.zoomSpeed*x/window.innerHeight*(T-l.lastT())*100;l.pan(T,0,0,d*(Math.exp(E)-1))}return m._lastX=n,m._lastY=i,m._lastMods=a,!0}}m.wheelListener=o(e,function(e,t){if(m.keyBindingMode!==!1&&m.enableWheel){var n=m.flipX?1:-1,i=m.flipY?1:-1,a=r();if(Math.abs(e)>Math.abs(t))l.rotate(a,0,0,-e*n*Math.PI*m.rotateSpeed/window.innerWidth);else if(!m._ortho){var o=-m.zoomSpeed*i*t/window.innerHeight*(a-l.lastT())/20;l.pan(a,0,0,d*(Math.exp(o)-1))}}},!0)},m.enableMouseListeners(),m}},799:function(e,t,n){var r=n(3236),i=n(9405),a=r([`precision mediump float;
#define GLSLIFY 1
attribute vec2 position;
varying vec2 uv;
void main() {
uv = position;
gl_Position = vec4(position, 0, 1);
}`]),o=r([`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);
}`]);e.exports=function(e){return i(e,a,o,null,[{name:`position`,type:`vec2`}])}},4100:function(e,t,n){var r=n(4437),i=n(3837),a=n(5445),o=n(4449),s=n(3589),c=n(2260),l=n(7169),u=n(351),d=n(4772),f=n(4040),p=n(799),m=n(9216)({tablet:!0,featureDetect:!0});e.exports={createScene:y,createCamera:r};function h(){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 g(e,t){var n=null;try{n=e.getContext(`webgl`,t),n||=e.getContext(`experimental-webgl`,t)}catch{return null}return n}function _(e){var t=Math.round(Math.log(Math.abs(e))/Math.log(10));if(t<0){var n=Math.round(10**-t);return Math.ceil(e*n)/n}else if(t>0){var n=Math.round(10**t);return Math.ceil(e/n)*n}return Math.ceil(e)}function v(e){return typeof e==`boolean`?e:!0}function y(e){e||={},e.camera=e.camera||{};var t=e.canvas;t||(t=document.createElement(`canvas`),e.container?e.container.appendChild(t):document.body.appendChild(t));var n=e.gl;if(n||=(e.glOptions&&(m=!!e.glOptions.preserveDrawingBuffer),g(t,e.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:m})),!n)throw Error(`webgl not supported`);var d=e.bounds||[[-10,-10,-10],[10,10,10]],f=new h,y=c(n,n.drawingBufferWidth,n.drawingBufferHeight,{preferFloat:!m}),x=p(n),S=e.cameraObject&&e.cameraObject._ortho===!0||e.camera.projection&&e.camera.projection.type===`orthographic`||!1,C={eye:e.camera.eye||[2,0,0],center:e.camera.center||[0,0,0],up:e.camera.up||[0,1,0],zoomMin:e.camera.zoomMax||.1,zoomMax:e.camera.zoomMin||100,mode:e.camera.mode||`turntable`,_ortho:S},w=e.axes||{},T=i(n,w);T.enable=!w.disable;var E=e.spikes||{},D=o(n,E),O=[],k=[],A=[],j=[],M=!0,N=!0,P={view:null,projection:Array(16),model:Array(16),_ortho:!1},N=!0,F=[n.drawingBufferWidth,n.drawingBufferHeight],I=e.cameraObject||r(t,C),L={gl:n,contextLost:!1,pixelRatio:e.pixelRatio||1,canvas:t,selection:f,camera:I,axes:T,axesPixels:null,spikes:D,bounds:d,objects:O,shape:F,aspect:e.aspectRatio||[1,1,1],pickRadius:e.pickRadius||10,zNear:e.zNear||.01,zFar:e.zFar||1e3,fovy:e.fovy||Math.PI/4,clearColor:e.clearColor||[0,0,0,0],autoResize:v(e.autoResize),autoBounds:v(e.autoBounds),autoScale:!!e.autoScale,autoCenter:v(e.autoCenter),clipToBounds:v(e.clipToBounds),snapToData:!!e.snapToData,onselect:e.onselect||null,onrender:e.onrender||null,onclick:e.onclick||null,cameraParams:P,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(e){this.aspect[0]=e.x,this.aspect[1]=e.y,this.aspect[2]=e.z,N=!0},setBounds:function(e,t){this.bounds[0][e]=t.min,this.bounds[1][e]=t.max},setClearColor:function(e){this.clearColor=e},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)}},R=[n.drawingBufferWidth/L.pixelRatio|0,n.drawingBufferHeight/L.pixelRatio|0];function z(){if(!L._stopped&&L.autoResize){var e=t.parentNode,n=1,r=1;e&&e!==document.body?(n=e.clientWidth,r=e.clientHeight):(n=window.innerWidth,r=window.innerHeight);var i=Math.ceil(n*L.pixelRatio)|0,a=Math.ceil(r*L.pixelRatio)|0;if(i!==t.width||a!==t.height){t.width=i,t.height=a;var o=t.style;o.position=o.position||`absolute`,o.left=`0px`,o.top=`0px`,o.width=n+`px`,o.height=r+`px`,M=!0}}}L.autoResize&&z(),window.addEventListener(`resize`,z);function B(){for(var e=O.length,t=j.length,r=0;r<t;++r)A[r]=0;e:for(var r=0;r<e;++r){var i=O[r],a=i.pickSlots;if(!a){k[r]=-1;continue}for(var o=0;o<t;++o)if(A[o]+a<255){k[r]=o,i.setPickBase(A[o]+1),A[o]+=a;continue e}var c=s(n,F);k[r]=t,j.push(c),A.push(a),i.setPickBase(1),t+=1}for(;t>0&&A[t-1]===0;)A.pop(),j.pop().dispose()}L.update=function(e){L._stopped||(e||={},M=!0,N=!0)},L.add=function(e){L._stopped||(e.axes=T,O.push(e),k.push(-1),M=!0,N=!0,B())},L.remove=function(e){if(!L._stopped){var t=O.indexOf(e);t<0||(O.splice(t,1),k.pop(),M=!0,N=!0,B())}},L.dispose=function(){if(!L._stopped&&(L._stopped=!0,window.removeEventListener(`resize`,z),t.removeEventListener(`webglcontextlost`,V),L.mouseListener.enabled=!1,!L.contextLost)){T.dispose(),D.dispose();for(var e=0;e<O.length;++e)O[e].dispose();y.dispose();for(var e=0;e<j.length;++e)j[e].dispose();x.dispose(),n=null,T=null,D=null,O=[]}},L._mouseRotating=!1,L._prevButtons=0,L.enableMouseListeners=function(){L.mouseListener=u(t,function(e,t,n){if(!L._stopped){var r=j.length,i=O.length,a=f.object;f.distance=1/0,f.mouse[0]=t,f.mouse[1]=n,f.object=null,f.screen=null,f.dataCoordinate=f.dataPosition=null;var o=!1;if(e&&L._prevButtons)L._mouseRotating=!0;else{L._mouseRotating&&(N=!0),L._mouseRotating=!1;for(var s=0;s<r;++s){var c=j[s].query(t,R[1]-n-1,L.pickRadius);if(c){if(c.distance>f.distance)continue;for(var l=0;l<i;++l){var u=O[l];if(k[l]===s){var d=u.pick(c);d&&(f.buttons=e,f.screen=c.coord,f.distance=c.distance,f.object=u,f.index=d.distance,f.dataPosition=d.position,f.dataCoordinate=d.dataCoordinate,f.data=d,o=!0)}}}}}a&&a!==f.object&&(a.highlight&&a.highlight(null),M=!0),f.object&&(f.object.highlight&&f.object.highlight(f.data),M=!0),o||=f.object!==a,o&&L.onselect&&L.onselect(f),e&1&&!(L._prevButtons&1)&&L.onclick&&L.onclick(f),L._prevButtons=e}})};function V(){if(L.contextLost)return!0;n.isContextLost()&&(L.contextLost=!0,L.mouseListener.enabled=!1,L.selection.object=null,L.oncontextloss&&L.oncontextloss())}t.addEventListener(`webglcontextlost`,V);function H(){if(!V()){n.colorMask(!0,!0,!0,!0),n.depthMask(!0),n.disable(n.BLEND),n.enable(n.DEPTH_TEST),n.depthFunc(n.LEQUAL);for(var e=O.length,t=j.length,r=0;r<t;++r){var i=j[r];i.shape=R,i.begin();for(var a=0;a<e;++a)if(k[a]===r){var o=O[a];o.drawPick&&(o.pixelRatio=1,o.drawPick(P))}i.end()}}}var U=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],W=[U[0].slice(),U[1].slice()];function G(){if(!V()){z();var e=L.camera.tick();P.view=L.camera.matrix,M||=e,N||=e,T.pixelRatio=L.pixelRatio,D.pixelRatio=L.pixelRatio;var t=O.length,r=U[0],i=U[1];r[0]=r[1]=r[2]=1/0,i[0]=i[1]=i[2]=-1/0;for(var o=0;o<t;++o){var s=O[o];s.pixelRatio=L.pixelRatio,s.axes=L.axes,M||=!!s.dirty,N||=!!s.dirty;var c=s.bounds;if(c)for(var u=c[0],d=c[1],p=0;p<3;++p)r[p]=Math.min(r[p],u[p]),i[p]=Math.max(i[p],d[p])}var m=L.bounds;if(L.autoBounds)for(var p=0;p<3;++p){if(i[p]<r[p])r[p]=-1,i[p]=1;else{r[p]===i[p]&&(--r[p],i[p]+=1);var h=.05*(i[p]-r[p]);r[p]=r[p]-h,i[p]=i[p]+h}m[0][p]=r[p],m[1][p]=i[p]}for(var g=!1,p=0;p<3;++p)g=g||W[0][p]!==m[0][p]||W[1][p]!==m[1][p],W[0][p]=m[0][p],W[1][p]=m[1][p];if(N||=g,M||=g,M){if(g){for(var v=[0,0,0],o=0;o<3;++o)v[o]=_((m[1][o]-m[0][o])/10);T.autoTicks?T.update({bounds:m,tickSpacing:v}):T.update({bounds:m})}var C=n.drawingBufferWidth,w=n.drawingBufferHeight;F[0]=C,F[1]=w,R[0]=Math.max(C/L.pixelRatio,1)|0,R[1]=Math.max(w/L.pixelRatio,1)|0,b(L,S);for(var o=0;o<t;++o){var s=O[o];s.axesBounds=m,L.clipToBounds&&(s.clipBounds=m)}f.object&&(L.snapToData?D.position=f.dataCoordinate:D.position=f.dataPosition,D.bounds=m),N&&(N=!1,H()),L.axesPixels=a(L.axes,P,C,w),L.onrender&&L.onrender(),n.bindFramebuffer(n.FRAMEBUFFER,null),n.viewport(0,0,C,w),L.clearRGBA(),n.depthMask(!0),n.colorMask(!0,!0,!0,!0),n.enable(n.DEPTH_TEST),n.depthFunc(n.LEQUAL),n.disable(n.BLEND),n.disable(n.CULL_FACE);var E=!1;T.enable&&(E||=T.isTransparent(),T.draw(P)),D.axes=T,f.object&&D.draw(P),n.disable(n.CULL_FACE);for(var o=0;o<t;++o){var s=O[o];s.axes=T,s.pixelRatio=L.pixelRatio,s.isOpaque&&s.isOpaque()&&s.draw(P),s.isTransparent&&s.isTransparent()&&(E=!0)}if(E){y.shape=F,y.bind(),n.clear(n.DEPTH_BUFFER_BIT),n.colorMask(!1,!1,!1,!1),n.depthMask(!0),n.depthFunc(n.LESS),T.enable&&T.isTransparent()&&T.drawTransparent(P);for(var o=0;o<t;++o){var s=O[o];s.isOpaque&&s.isOpaque()&&s.draw(P)}n.enable(n.BLEND),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA),n.colorMask(!0,!0,!0,!0),n.depthMask(!1),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),T.isTransparent()&&T.drawTransparent(P);for(var o=0;o<t;++o){var s=O[o];s.isTransparent&&s.isTransparent()&&s.drawTransparent(P)}n.bindFramebuffer(n.FRAMEBUFFER,null),n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA),n.disable(n.DEPTH_TEST),x.bind(),y.color[0].bind(0),x.uniforms.accumBuffer=0,l(n),n.disable(n.BLEND)}M=!1;for(var o=0;o<t;++o)O[o].dirty=!1}}}function K(){L._stopped||L.contextLost||(G(),requestAnimationFrame(K))}return L.enableMouseListeners(),K(),L.redraw=function(){L._stopped||(M=!0,G())},L}function b(e,t){var n=e.bounds,r=e.cameraParams,i=r.projection,a=r.model,o=e.gl.drawingBufferWidth,s=e.gl.drawingBufferHeight,c=e.zNear,l=e.zFar,u=e.fovy,p=o/s;t?(f(i,-p,p,-1,1,c,l),r._ortho=!0):(d(i,u,p,c,l),r._ortho=!1);for(var m=0;m<16;++m)a[m]=0;a[15]=1;for(var h=0,m=0;m<3;++m)h=Math.max(h,n[1][m]-n[0][m]);for(var m=0;m<3;++m)e.autoScale?a[5*m]=e.aspect[m]/(n[1][m]-n[0][m]):a[5*m]=1/h,e.autoCenter&&(a[12+m]=-a[5*m]*.5*(n[0][m]+n[1][m]))}},783:function(e){e.exports=t;function t(e,t,n,r){var i=t[0],a=t[1],o=t[2],s=t[3],c=n[0],l=n[1],u=n[2],d=n[3],f,p,m,h,g;return p=i*c+a*l+o*u+s*d,p<0&&(p=-p,c=-c,l=-l,u=-u,d=-d),1-p>1e-6?(f=Math.acos(p),m=Math.sin(f),h=Math.sin((1-r)*f)/m,g=Math.sin(r*f)/m):(h=1-r,g=r),e[0]=h*i+g*c,e[1]=h*a+g*l,e[2]=h*o+g*u,e[3]=h*s+g*d,e}},5964:function(e){e.exports=function(e){return!e&&e!==0?``:e.toString()}},9366:function(e,t,n){var r=n(4359);e.exports=a;var i={};function a(e,t,n){var a=[t.style,t.weight,t.variant,t.family].join(`_`),o=i[a];if(o||=i[a]={},e in o)return o[e];var s={textAlign:`center`,textBaseline:`middle`,lineHeight:1,font:t.family,fontStyle:t.style,fontWeight:t.weight,fontVariant:t.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}};s.triangles=!0;var c=r(e,s);s.triangles=!1;var l=r(e,s),u,d;if(n&&n!==1){for(u=0;u<c.positions.length;++u)for(d=0;d<c.positions[u].length;++d)c.positions[u][d]/=n;for(u=0;u<l.positions.length;++u)for(d=0;d<l.positions[u].length;++d)l.positions[u][d]/=n}var f=[[1/0,1/0],[-1/0,-1/0]],p=l.positions.length;for(u=0;u<p;++u){var m=l.positions[u];for(d=0;d<2;++d)f[0][d]=Math.min(f[0][d],m[d]),f[1][d]=Math.max(f[1][d],m[d])}return o[e]=[c,l,f]}},1283:function(e,t,n){var r=n(9405),i=n(3236),a=i([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
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;
}
}`]),o=i([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
attribute vec3 position;
attribute vec4 color;
attribute vec2 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=i([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
attribute vec3 position;
attribute vec4 color;
attribute vec2 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;
}
}
`]),c=i([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 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;
}
`]),l=i([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 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);
}`]),u=[{name:`position`,type:`vec3`},{name:`color`,type:`vec4`},{name:`glyph`,type:`vec2`},{name:`id`,type:`vec4`}],d={vertex:a,fragment:c,attributes:u},f={vertex:o,fragment:c,attributes:u},p={vertex:s,fragment:c,attributes:u},m={vertex:a,fragment:l,attributes:u},h={vertex:o,fragment:l,attributes:u},g={vertex:s,fragment:l,attributes:u};function _(e,t){var n=r(e,t),i=n.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,n}t.createPerspective=function(e){return _(e,d)},t.createOrtho=function(e){return _(e,f)},t.createProject=function(e){return _(e,p)},t.createPickPerspective=function(e){return _(e,m)},t.createPickOrtho=function(e){return _(e,h)},t.createPickProject=function(e){return _(e,g)}},8418:function(e,t,n){var r=n(5219),i=n(2762),a=n(8116),o=n(1888),s=n(6760),c=n(1283),l=n(9366),u=n(5964),d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],f=ArrayBuffer,p=DataView;function m(e){return f.isView(e)&&!(e instanceof p)}function h(e){return Array.isArray(e)||m(e)}e.exports=R;function g(e,t){var n=e[0],r=e[1],i=e[2],a=e[3];return e[0]=t[0]*n+t[4]*r+t[8]*i+t[12]*a,e[1]=t[1]*n+t[5]*r+t[9]*i+t[13]*a,e[2]=t[2]*n+t[6]*r+t[10]*i+t[14]*a,e[3]=t[3]*n+t[7]*r+t[11]*i+t[15]*a,e}function _(e,t,n,r){return g(r,r,n),g(r,r,t),g(r,r,e)}function v(e,t){this.index=e,this.dataCoordinate=this.position=t}function y(e){return e===!0||e>1?1:e}function b(e,t,n,r,i,a,o,s,c,l,u,d){this.gl=e,this.pixelRatio=1,this.shader=t,this.orthoShader=n,this.projectShader=r,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=c,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=l,this.pickOrthoShader=u,this.pickProjectShader=d,this.points=[],this._selectResult=new v(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 x=b.prototype;x.pickSlots=1,x.setPickBase=function(e){this.pickId=e},x.isTransparent=function(){if(this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&this.projectHasAlpha)return!0;return!1},x.isOpaque=function(){if(!this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&!this.projectHasAlpha)return!0;return!1};var S=[0,0],C=[0,0,0],w=[0,0,0],T=[0,0,0,1],E=[0,0,0,1],D=d.slice(),O=[0,0,0],k=[[0,0,0],[0,0,0]];function A(e){return e[0]=e[1]=e[2]=0,e}function j(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=1,e}function M(e,t,n,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[n]=r,e}function N(e){for(var t=k,n=0;n<2;++n)for(var r=0;r<3;++r)t[n][r]=Math.max(Math.min(e[n][r],1e8),-1e8);return t}function P(e,t,n,r){var i=t.axesProject,a=t.gl,o=e.uniforms,c=n.model||d,l=n.view||d,u=n.projection||d,f=t.axesBounds,p=N(t.clipBounds),m=t.axes&&t.axes.lastCubeProps?t.axes.lastCubeProps.axis:[1,1,1];S[0]=2/a.drawingBufferWidth,S[1]=2/a.drawingBufferHeight,e.bind(),o.view=l,o.projection=u,o.screenSize=S,o.highlightId=t.highlightId,o.highlightScale=t.highlightScale,o.clipBounds=p,o.pickGroup=t.pickId/255,o.pixelRatio=r;for(var h=0;h<3;++h)if(i[h]){o.scale=t.projectScale[h],o.opacity=t.projectOpacity[h];for(var g=D,v=0;v<16;++v)g[v]=0;for(var v=0;v<4;++v)g[5*v]=1;g[5*h]=0,m[h]<0?g[12+h]=f[0][h]:g[12+h]=f[1][h],s(g,c,g),o.model=g;var y=(h+1)%3,b=(h+2)%3,x=A(C),k=A(w);x[y]=1,k[b]=1;var P=_(u,l,c,j(T,x)),F=_(u,l,c,j(E,k));if(Math.abs(P[1])>Math.abs(F[1])){var I=P;P=F,F=I,I=x,x=k,k=I;var L=y;y=b,b=L}P[0]<0&&(x[y]=-1),F[1]>0&&(k[b]=-1);for(var R=0,z=0,v=0;v<4;++v)R+=c[4*y+v]**2,z+=c[4*b+v]**2;x[y]/=Math.sqrt(R),k[b]/=Math.sqrt(z),o.axes[0]=x,o.axes[1]=k,o.fragClipBounds[0]=M(O,p[0],h,-1e8),o.fragClipBounds[1]=M(O,p[1],h,1e8),t.vao.bind(),t.vao.draw(a.TRIANGLES,t.vertexCount),t.lineWidth>0&&(a.lineWidth(t.lineWidth*r),t.vao.draw(a.LINES,t.lineVertexCount,t.vertexCount)),t.vao.unbind()}}var F=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function I(e,t,n,r,i,a,o){var s=n.gl;if((a===n.projectHasAlpha||o)&&P(t,n,r,i),a===n.hasAlpha||o){e.bind();var c=e.uniforms;c.model=r.model||d,c.view=r.view||d,c.projection=r.projection||d,S[0]=2/s.drawingBufferWidth,S[1]=2/s.drawingBufferHeight,c.screenSize=S,c.highlightId=n.highlightId,c.highlightScale=n.highlightScale,c.fragClipBounds=F,c.clipBounds=n.axes.bounds,c.opacity=n.opacity,c.pickGroup=n.pickId/255,c.pixelRatio=i,n.vao.bind(),n.vao.draw(s.TRIANGLES,n.vertexCount),n.lineWidth>0&&(s.lineWidth(n.lineWidth*i),n.vao.draw(s.LINES,n.lineVertexCount,n.vertexCount)),n.vao.unbind()}}x.draw=function(e){I(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,e,this.pixelRatio,!1,!1)},x.drawTransparent=function(e){I(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,e,this.pixelRatio,!0,!1)},x.drawPick=function(e){I(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,e,1,!0,!0)},x.pick=function(e){if(!e||e.id!==this.pickId)return null;var t=e.value[2]+(e.value[1]<<8)+(e.value[0]<<16);if(t>=this.pointCount||t<0)return null;var n=this.points[t],r=this._selectResult;r.index=t;for(var i=0;i<3;++i)r.position[i]=r.dataCoordinate[i]=n[i];return r},x.highlight=function(e){if(!e)this.highlightId=[1,1,1,1];else{var t=e.index,n=t&255,r=t>>8&255,i=t>>16&255;this.highlightId=[n/255,r/255,i/255,0]}};function L(e,t,n,i){var a=h(e)?t<e.length?e[t]:void 0:e;a=u(a);var o=!0;r(a)&&(a=`▼`,o=!1),n||={};var s=n.family;h(s)&&(s=s[t]),s||=`normal`;var c=n.weight;h(c)&&(c=c[t]),c||=`normal`;var d=n.style;h(d)&&(d=d[t]),d||=`normal`;var f=n.variant;h(f)&&(f=f[t]),f||=`normal`;var p=l(a,{family:s,weight:c,style:d,variant:f},i),p=l(a,n,i);return{mesh:p[0],lines:p[1],bounds:p[2],visible:o}}x.update=function(e){if(e||={},`perspective`in e&&(this.useOrtho=!e.perspective),`orthographic`in e&&(this.useOrtho=!!e.orthographic),`lineWidth`in e&&(this.lineWidth=e.lineWidth),`project`in e)if(h(e.project))this.axesProject=e.project;else{var t=!!e.project;this.axesProject=[t,t,t]}if(`projectScale`in e)if(h(e.projectScale))this.projectScale=e.projectScale.slice();else{var n=+e.projectScale;this.projectScale=[n,n,n]}if(this.projectHasAlpha=!1,`projectOpacity`in e){if(h(e.projectOpacity))this.projectOpacity=e.projectOpacity.slice();else{var n=+e.projectOpacity;this.projectOpacity=[n,n,n]}for(var r=0;r<3;++r)this.projectOpacity[r]=y(this.projectOpacity[r]),this.projectOpacity[r]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,`opacity`in e&&(this.opacity=y(e.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i=e.position,a={family:e.font||`normal`,style:e.fontStyle||`normal`,weight:e.fontWeight||`normal`,variant:e.fontVariant||`normal`},s=e.alignment||[0,0],c,l;if(s.length===2)c=s[0],l=s[1];else{c=[],l=[];for(var r=0;r<s.length;++r)c[r]=s[r][0],l[r]=s[r][1]}var u=[1/0,1/0,1/0],d=[-1/0,-1/0,-1/0],f=e.glyph,p=e.color,m=e.size,g=e.angle,_=e.lineColor,v=-1,b=0,x=0,S=0;if(i.length){S=i.length;e:for(var r=0;r<S;++r){for(var C=i[r],w=0;w<3;++w)if(isNaN(C[w])||!isFinite(C[w]))continue e;var T=L(f,r,a,this.pixelRatio),E=T.mesh,D=T.lines,O=T.bounds;b+=E.cells.length*3,x+=D.edges.length*2}}var k=b+x,A=o.mallocFloat(3*k),j=o.mallocFloat(4*k),M=o.mallocFloat(2*k),N=o.mallocUint32(k);if(k>0){var P=0,F=b,I=[0,0,0,1],R=[0,0,0,1],z=h(p)&&h(p[0]),B=h(_)&&h(_[0]);e:for(var r=0;r<S;++r){v+=1;for(var C=i[r],w=0;w<3;++w){if(isNaN(C[w])||!isFinite(C[w]))continue e;d[w]=Math.max(d[w],C[w]),u[w]=Math.min(u[w],C[w])}var T=L(f,r,a,this.pixelRatio),E=T.mesh,D=T.lines,O=T.bounds,V=T.visible;if(!V)I=[1,1,1,0];else if(h(p)){var H;if(H=z?r<p.length?p[r]:[0,0,0,0]:p,H.length===3){for(var w=0;w<3;++w)I[w]=H[w];I[3]=1}else if(H.length===4){for(var w=0;w<4;++w)I[w]=H[w];!this.hasAlpha&&H[3]<1&&(this.hasAlpha=!0)}}else I[0]=I[1]=I[2]=0,I[3]=1;if(!V)R=[1,1,1,0];else if(h(_)){var H;if(H=B?r<_.length?_[r]:[0,0,0,0]:_,H.length===3){for(var w=0;w<3;++w)R[w]=H[w];R[w]=1}else if(H.length===4){for(var w=0;w<4;++w)R[w]=H[w];!this.hasAlpha&&H[3]<1&&(this.hasAlpha=!0)}}else R[0]=R[1]=R[2]=0,R[3]=1;var U=.5;V?h(m)?U=r<m.length?+m[r]:12:m?U=+m:this.useOrtho&&(U=12):U=0;var W=0;h(g)?W=r<g.length?+g[r]:0:g&&(W=+g);for(var G=Math.cos(W),K=Math.sin(W),C=i[r],w=0;w<3;++w)d[w]=Math.max(d[w],C[w]),u[w]=Math.min(u[w],C[w]);var q=c,J=l,q=0;h(c)?q=r<c.length?c[r]:0:c&&(q=c);var J=0;h(l)?J=r<l.length?l[r]:0:l&&(J=l),q*=q>0?1-O[0][0]:q<0?1+O[1][0]:1,J*=J>0?1-O[0][1]:J<0?1+O[1][1]:1;for(var Y=[q,J],X=E.cells||[],Z=E.positions||[],w=0;w<X.length;++w)for(var Q=X[w],ee=0;ee<3;++ee){for(var te=0;te<3;++te)A[3*P+te]=C[te];for(var te=0;te<4;++te)j[4*P+te]=I[te];N[P]=v;var ne=Z[Q[ee]];M[2*P]=U*(G*ne[0]-K*ne[1]+Y[0]),M[2*P+1]=U*(K*ne[0]+G*ne[1]+Y[1]),P+=1}for(var X=D.edges,Z=D.positions,w=0;w<X.length;++w)for(var Q=X[w],ee=0;ee<2;++ee){for(var te=0;te<3;++te)A[3*F+te]=C[te];for(var te=0;te<4;++te)j[4*F+te]=R[te];N[F]=v;var ne=Z[Q[ee]];M[2*F]=U*(G*ne[0]-K*ne[1]+Y[0]),M[2*F+1]=U*(K*ne[0]+G*ne[1]+Y[1]),F+=1}}}this.bounds=[u,d],this.points=i,this.pointCount=i.length,this.vertexCount=b,this.lineVertexCount=x,this.pointBuffer.update(A),this.colorBuffer.update(j),this.glyphBuffer.update(M),this.idBuffer.update(N),o.free(A),o.free(j),o.free(M),o.free(N)},x.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 R(e){var t=e.gl,n=c.createPerspective(t),r=c.createOrtho(t),o=c.createProject(t),s=c.createPickPerspective(t),l=c.createPickOrtho(t),u=c.createPickProject(t),d=i(t),f=i(t),p=i(t),m=i(t),h=new b(t,n,r,o,d,f,p,m,a(t,[{buffer:d,size:3,type:t.FLOAT},{buffer:f,size:4,type:t.FLOAT},{buffer:p,size:2,type:t.FLOAT},{buffer:m,size:4,type:t.UNSIGNED_BYTE,normalized:!0}]),s,l,u);return h.update(e),h}},3589:function(e,t,n){e.exports=d;var r=n(2260),i=n(1888),a=n(9618),o=n(8828).nextPow2,s=function(e,t,n){for(var r=1e8,i=-1,a=-1,o=e.shape[0],s=e.shape[1],c=0;c<o;c++)for(var l=0;l<s;l++){var u=e.get(c,l,0),d=e.get(c,l,1),f=e.get(c,l,2),p=e.get(c,l,3);if(u<255||d<255||f<255||p<255){var m=t-c,h=n-l,g=m*m+h*h;g<r&&(r=g,i=c,a=l)}}return[i,a,r]};function c(e,t,n,r,i){this.coord=[e,t],this.id=n,this.value=r,this.distance=i}function l(e,t,n){this.gl=e,this.fbo=t,this.buffer=n,this._readTimeout=null;var r=this;this._readCallback=function(){r.gl&&(t.bind(),e.readPixels(0,0,t.shape[0],t.shape[1],e.RGBA,e.UNSIGNED_BYTE,r.buffer),r._readTimeout=null)}}var u=l.prototype;Object.defineProperty(u,`shape`,{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(e){if(this.gl){this.fbo.shape=e;var t=this.fbo.shape[0],n=this.fbo.shape[1];if(n*t*4>this.buffer.length){i.free(this.buffer);for(var r=this.buffer=i.mallocUint8(o(n*t*4)),a=0;a<n*t*4;++a)r[a]=255}return e}}}),u.begin=function(){var e=this.gl;this.shape,e&&(this.fbo.bind(),e.clearColor(1,1,1,1),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT))},u.end=function(){var e=this.gl;e&&(e.bindFramebuffer(e.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},u.query=function(e,t,n){if(!this.gl)return null;var r=this.fbo.shape.slice();e|=0,t|=0,typeof n!=`number`&&(n=1);var i=Math.min(Math.max(e-n,0),r[0])|0,o=Math.min(Math.max(e+n,0),r[0])|0,l=Math.min(Math.max(t-n,0),r[1])|0,u=Math.min(Math.max(t+n,0),r[1])|0;if(o<=i||u<=l)return null;var d=[o-i,u-l],f=a(this.buffer,[d[0],d[1],4],[4,r[0]*4,1],4*(i+r[0]*l)),p=s(f.hi(d[0],d[1],1),n,n),m=p[0],h=p[1];if(m<0||this.radius**2<p[2])return null;var g=f.get(m,h,0),_=f.get(m,h,1),v=f.get(m,h,2),y=f.get(m,h,3);return new c(m+i|0,h+l|0,g,[_,v,y],Math.sqrt(p[2]))},u.dispose=function(){this.gl&&(this.fbo.dispose(),i.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))};function d(e,t){var n=t[0],a=t[1];return new l(e,r(e,n,a,{}),i.mallocUint8(n*a*4))}},9405:function(e,t,n){var r=n(3327),i=n(8731),a=n(216),o=n(5091),s=n(2145),c=n(8866);function l(e){this.gl=e,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var u=l.prototype;u.bind=function(){this.program||this._relink();var e,t=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),n=this.gl.lastAttribCount;if(t>n)for(e=n;e<t;e++)this.gl.enableVertexAttribArray(e);else if(n>t)for(e=t;e<n;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=t,this.gl.useProgram(this.program)},u.dispose=function(){for(var e=this.gl.lastAttribCount,t=0;t<e;t++)this.gl.disableVertexAttribArray(t);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 d(e,t){return e.name<t.name?-1:1}u.update=function(e,t,n,l){if(!t||arguments.length===1){var u=e;e=u.vertex,t=u.fragment,n=u.uniforms,l=u.attributes}var f=this,p=f.gl,m=f._vref;f._vref=o.shader(p,p.VERTEX_SHADER,e),m&&m.dispose(),f.vertShader=f._vref.shader;var h=this._fref;if(f._fref=o.shader(p,p.FRAGMENT_SHADER,t),h&&h.dispose(),f.fragShader=f._fref.shader,!n||!l){var g=p.createProgram();if(p.attachShader(g,f.fragShader),p.attachShader(g,f.vertShader),p.linkProgram(g),!p.getProgramParameter(g,p.LINK_STATUS)){var _=p.getProgramInfoLog(g);throw new c(_,`Error linking program:`+_)}n||=s.uniforms(p,g),l||=s.attributes(p,g),p.deleteProgram(g)}l=l.slice(),l.sort(d);var v=[],y=[],b=[],x;for(x=0;x<l.length;++x){var S=l[x];if(S.type.indexOf(`mat`)>=0){for(var C=S.type.charAt(S.type.length-1)|0,w=Array(C),T=0;T<C;++T)w[T]=b.length,y.push(S.name+`[`+T+`]`),typeof S.location==`number`?b.push(S.location+T):Array.isArray(S.location)&&S.location.length===C&&typeof S.location[T]==`number`?b.push(S.location[T]|0):b.push(-1);v.push({name:S.name,type:S.type,locations:w})}else v.push({name:S.name,type:S.type,locations:[b.length]}),y.push(S.name),typeof S.location==`number`?b.push(S.location|0):b.push(-1)}var E=0;for(x=0;x<b.length;++x)if(b[x]<0){for(;b.indexOf(E)>=0;)E+=1;b[x]=E}var D=Array(n.length);function O(){f.program=o.program(p,f._vref,f._fref,y,b);for(var e=0;e<n.length;++e)D[e]=p.getUniformLocation(f.program,n[e].name)}O(),f._relink=O,f.types={uniforms:a(n),attributes:a(l)},f.attributes=i(p,f,v,b),Object.defineProperty(f,`uniforms`,r(p,f,n,D))};function f(e,t,n,r,i){var a=new l(e);return a.update(t,n,r,i),a}e.exports=f},8866:function(e){function t(e,t,n){this.shortMessage=t||``,this.longMessage=n||``,this.rawError=e||``,this.message=`gl-shader: `+(t||e||``)+(n?`
`+n:``),this.stack=Error().stack}t.prototype=Error(),t.prototype.name=`GLError`,t.prototype.constructor=t,e.exports=t},8731:function(e,t,n){e.exports=l;var r=n(8866);function i(e,t,n,r,i,a){this._gl=e,this._wrapper=t,this._index=n,this._locations=r,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(e,t,n,r){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,e||a.FLOAT,!!t,n||0,r||0),a.enableVertexAttribArray(o)},a.set=function(e,t,n,r){return this._constFunc(this._locations[this._index],e,t,n,r)},Object.defineProperty(a,`location`,{get:function(){return this._locations[this._index]},set:function(e){return e!==this._locations[this._index]&&(this._locations[this._index]=e|0,this._wrapper.program=null),e|0}});var o=[function(e,t,n){return n.length===void 0?e.vertexAttrib1f(t,n):e.vertexAttrib1fv(t,n)},function(e,t,n,r){return n.length===void 0?e.vertexAttrib2f(t,n,r):e.vertexAttrib2fv(t,n)},function(e,t,n,r,i){return n.length===void 0?e.vertexAttrib3f(t,n,r,i):e.vertexAttrib3fv(t,n)},function(e,t,n,r,i,a){return n.length===void 0?e.vertexAttrib4f(t,n,r,i,a):e.vertexAttrib4fv(t,n)}];function s(e,t,n,r,a,s,c){var l=o[a],u=new i(e,t,n,r,a,l);Object.defineProperty(s,c,{set:function(t){return e.disableVertexAttribArray(r[n]),l(e,r[n],t),t},get:function(){return u},enumerable:!0})}function c(e,t,n,r,i,a,o){for(var c=Array(i),l=Array(i),u=0;u<i;++u)s(e,t,n[u],r,i,c,u),l[u]=c[u];Object.defineProperty(c,`location`,{set:function(e){if(Array.isArray(e))for(var t=0;t<i;++t)l[t].location=e[t];else for(var t=0;t<i;++t)l[t].location=e+t;return e},get:function(){for(var e=Array(i),t=0;t<i;++t)e[t]=r[n[t]];return e},enumerable:!0}),c.pointer=function(t,a,o,s){t||=e.FLOAT,a=!!a,o||=i*i,s||=0;for(var c=0;c<i;++c){var l=r[n[c]];e.vertexAttribPointer(l,i,t,a,o,s+c*i),e.enableVertexAttribArray(l)}};var d=Array(i),f=e[`vertexAttrib`+i+`fv`];Object.defineProperty(a,o,{set:function(t){for(var a=0;a<i;++a){var o=r[n[a]];if(e.disableVertexAttribArray(o),Array.isArray(t[0]))f.call(e,o,t[a]);else{for(var s=0;s<i;++s)d[s]=t[i*a+s];f.call(e,o,d)}}return t},get:function(){return c},enumerable:!0})}function l(e,t,n,i){for(var a={},o=0,l=n.length;o<l;++o){var u=n[o],d=u.name,f=u.type,p=u.locations;switch(f){case`bool`:case`int`:case`float`:s(e,t,p[0],i,1,a,d);break;default:if(f.indexOf(`vec`)>=0){var m=f.charCodeAt(f.length-1)-48;if(m<2||m>4)throw new r(``,`Invalid data type for attribute `+d+`: `+f);s(e,t,p[0],i,m,a,d)}else if(f.indexOf(`mat`)>=0){var m=f.charCodeAt(f.length-1)-48;if(m<2||m>4)throw new r(``,`Invalid data type for attribute `+d+`: `+f);c(e,t,p,i,m,a,d)}else throw new r(``,`Unknown data type for attribute `+d+`: `+f);break}}return a}},3327:function(e,t,n){var r=n(216),i=n(8866);e.exports=s;function a(e){return function(){return e}}function o(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=t;return n}function s(e,t,n,s){function c(e){return function(t,n,r){return t.getUniform(n.program,r[e])}}function l(t){return function(r){for(var a=u(``,t),o=0;o<a.length;++o){var c=a[o],l=c[0],d=c[1];if(s[d]){var f=r;if(typeof l==`string`&&(l.indexOf(`.`)===0||l.indexOf(`[`)===0)){var p=l;if(l.indexOf(`.`)===0&&(p=l.slice(1)),p.indexOf(`]`)===p.length-1){var m=p.indexOf(`[`),h=p.slice(0,m),g=p.slice(m+1,p.length-1);f=h?r[h][g]:r[g]}else f=r[p]}var _=n[d].type,v;switch(_){case`bool`:case`int`:case`sampler2D`:case`samplerCube`:e.uniform1i(s[d],f);break;case`float`:e.uniform1f(s[d],f);break;default:var y=_.indexOf(`vec`);if(0<=y&&y<=1&&_.length===4+y){if(v=_.charCodeAt(_.length-1)-48,v<2||v>4)throw new i(``,`Invalid data type`);switch(_.charAt(0)){case`b`:case`i`:e[`uniform`+v+`iv`](s[d],f);break;case`v`:e[`uniform`+v+`fv`](s[d],f);break;default:throw new i(``,`Unrecognized data type for vector `+name+`: `+_)}}else if(_.indexOf(`mat`)===0&&_.length===4){if(v=_.charCodeAt(_.length-1)-48,v<2||v>4)throw new i(``,`Invalid uniform dimension type for matrix `+name+`: `+_);e[`uniformMatrix`+v+`fv`](s[d],!1,f);break}else throw new i(``,`Unknown uniform data type for `+name+`: `+_)}}}}}function u(e,t){if(typeof t!=`object`)return[[e,t]];var n=[];for(var r in t){var i=t[r],a=e;parseInt(r)+``===r?a+=`[`+r+`]`:a+=`.`+r,typeof i==`object`?n.push.apply(n,u(a,i)):n.push([a,i])}return n}function d(e){switch(e){case`bool`:return!1;case`int`:case`sampler2D`:case`samplerCube`:return 0;case`float`:return 0;default:var t=e.indexOf(`vec`);if(0<=t&&t<=1&&e.length===4+t){var n=e.charCodeAt(e.length-1)-48;if(n<2||n>4)throw new i(``,`Invalid data type`);return e.charAt(0)===`b`?o(n,!1):o(n,0)}else if(e.indexOf(`mat`)===0&&e.length===4){var n=e.charCodeAt(e.length-1)-48;if(n<2||n>4)throw new i(``,`Invalid uniform dimension type for matrix `+name+`: `+e);return o(n*n,0)}else throw new i(``,`Unknown uniform data type for `+name+`: `+e)}}function f(e,t,r){if(typeof r==`object`){var i=p(r);Object.defineProperty(e,t,{get:a(i),set:l(r),enumerable:!0,configurable:!1})}else s[r]?Object.defineProperty(e,t,{get:c(r),set:l(r),enumerable:!0,configurable:!1}):e[t]=d(n[r].type)}function p(e){var t;if(Array.isArray(e)){t=Array(e.length);for(var n=0;n<e.length;++n)f(t,n,e[n])}else for(var r in t={},e)f(t,r,e[r]);return t}var m=r(n,!0);return{get:a(p(m)),set:l(m),enumerable:!0,configurable:!0}}},216:function(e){e.exports=t;function t(e,t){for(var n={},r=0;r<e.length;++r)for(var i=e[r].name,a=i.split(`.`),o=n,s=0;s<a.length;++s){var c=a[s].split(`[`);if(c.length>1){c[0]in o||(o[c[0]]=[]),o=o[c[0]];for(var l=1;l<c.length;++l){var u=parseInt(c[l]);l<c.length-1||s<a.length-1?(u in o||(l<c.length-1?o[u]=[]:o[u]={}),o=o[u]):t?o[u]=r:o[u]=e[r].type}}else s<a.length-1?(c[0]in o||(o[c[0]]={}),o=o[c[0]]):t?o[c[0]]=r:o[c[0]]=e[r].type}return n}},2145:function(e,t){t.uniforms=a,t.attributes=o;var n={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`},r=null;function i(e,t){if(!r){var i=Object.keys(n);r={};for(var a=0;a<i.length;++a){var o=i[a];r[e[o]]=n[o]}}return r[t]}function a(e,t){for(var n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),r=[],a=0;a<n;++a){var o=e.getActiveUniform(t,a);if(o){var s=i(e,o.type);if(o.size>1)for(var c=0;c<o.size;++c)r.push({name:o.name.replace(`[0]`,`[`+c+`]`),type:s});else r.push({name:o.name,type:s})}}return r}function o(e,t){for(var n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),r=[],a=0;a<n;++a){var o=e.getActiveAttrib(t,a);o&&r.push({name:o.name,type:i(e,o.type)})}return r}},5091:function(e,t,n){t.shader=p,t.program=m;var r=n(8866),i=n(2992),a=new(typeof WeakMap>`u`?n(606):WeakMap),o=0;function s(e,t,n,r,i,a,o){this.id=e,this.src=t,this.type=n,this.shader=r,this.count=a,this.programs=[],this.cache=o}s.prototype.dispose=function(){if(--this.count===0){for(var e=this.cache,t=e.gl,n=this.programs,r=0,i=n.length;r<i;++r){var a=e.programs[n[r]];a&&(delete e.programs[r],t.deleteProgram(a))}t.deleteShader(this.shader),delete e.shaders[this.type===t.FRAGMENT_SHADER|0][this.src]}};function c(e){this.gl=e,this.shaders=[{},{}],this.programs={}}var l=c.prototype;function u(e,t,n){var a=e.createShader(t);if(e.shaderSource(a,n),e.compileShader(a),!e.getShaderParameter(a,e.COMPILE_STATUS)){var o=e.getShaderInfoLog(a);try{var s=i(o,n,t)}catch(e){throw console.warn(`Failed to format compiler error: `+e),new r(o,`Error compiling shader:
`+o)}throw new r(o,s.short,s.long)}return a}l.getShaderReference=function(e,t){var n=this.gl,r=this.shaders[e===n.FRAGMENT_SHADER|0],i=r[t];if(!i||!n.isShader(i.shader)){var a=u(n,e,t);i=r[t]=new s(o++,t,e,a,[],1,this)}else i.count+=1;return i};function d(e,t,n,i,a){var o=e.createProgram();e.attachShader(o,t),e.attachShader(o,n);for(var s=0;s<i.length;++s)e.bindAttribLocation(o,a[s],i[s]);if(e.linkProgram(o),!e.getProgramParameter(o,e.LINK_STATUS)){var c=e.getProgramInfoLog(o);throw new r(c,`Error linking program: `+c)}return o}l.getProgram=function(e,t,n,r){var i=[e.id,t.id,n.join(`:`),r.join(`:`)].join(`@`),a=this.programs[i];return(!a||!this.gl.isProgram(a))&&(this.programs[i]=a=d(this.gl,e.shader,t.shader,n,r),e.programs.push(i),t.programs.push(i)),a};function f(e){var t=a.get(e);return t||(t=new c(e),a.set(e,t)),t}function p(e,t,n){return f(e).getShaderReference(t,n)}function m(e,t,n,r,i){return f(e).getProgram(t,n,r,i)}},1493:function(e,t,n){var r=n(3236),i=n(9405),a=r([`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];
}
`]),o=r([`precision mediump float;
#define GLSLIFY 1
varying vec4 fragColor;
void main() {
gl_FragColor = fragColor;
}`]);e.exports=function(e){return i(e,a,o,null,[{name:`position`,type:`vec3`},{name:`color`,type:`vec3`},{name:`weight`,type:`float`}])}},4449:function(e,t,n){var r=n(2762),i=n(8116),a=n(1493);e.exports=f;var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,n,r){this.gl=e,this.buffer=t,this.vao=n,this.shader=r,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 c=s.prototype,l=[0,0,0],u=[0,0,0],d=[0,0];c.isTransparent=function(){return!1},c.drawTransparent=function(e){},c.draw=function(e){var t=this.gl,n=this.vao,r=this.shader;n.bind(),r.bind();var i=e.model||o,a=e.view||o,s=e.projection||o,c;this.axes&&(c=this.axes.lastCubeProps.axis);for(var f=l,p=u,m=0;m<3;++m)c&&c[m]<0?(f[m]=this.bounds[0][m],p[m]=this.bounds[1][m]):(f[m]=this.bounds[1][m],p[m]=this.bounds[0][m]);d[0]=t.drawingBufferWidth,d[1]=t.drawingBufferHeight,r.uniforms.model=i,r.uniforms.view=a,r.uniforms.projection=s,r.uniforms.coordinates=[this.position,f,p],r.uniforms.colors=this.colors,r.uniforms.screenShape=d;for(var m=0;m<3;++m)r.uniforms.lineWidth=this.lineWidth[m]*this.pixelRatio,this.enabled[m]&&(n.draw(t.TRIANGLES,6,6*m),this.drawSides[m]&&n.draw(t.TRIANGLES,12,18+12*m));n.unbind()},c.update=function(e){e&&(`bounds`in e&&(this.bounds=e.bounds),`position`in e&&(this.position=e.position),`lineWidth`in e&&(this.lineWidth=e.lineWidth),`colors`in e&&(this.colors=e.colors),`enabled`in e&&(this.enabled=e.enabled),`drawSides`in e&&(this.drawSides=e.drawSides))},c.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function f(e,t){var n=[];function o(e,t,r,i,a,o){var s=[e,t,r,0,0,0,1];s[i+3]=1,s[i]=a,n.push.apply(n,s),s[6]=-1,n.push.apply(n,s),s[i]=o,n.push.apply(n,s),n.push.apply(n,s),s[6]=1,n.push.apply(n,s),s[i]=a,n.push.apply(n,s)}o(0,0,0,0,0,1),o(0,0,0,1,0,1),o(0,0,0,2,0,1),o(1,0,0,1,-1,1),o(1,0,0,2,-1,1),o(0,1,0,0,-1,1),o(0,1,0,2,-1,1),o(0,0,1,0,-1,1),o(0,0,1,1,-1,1);var c=r(e,n),l=i(e,[{type:e.FLOAT,buffer:c,size:3,offset:0,stride:28},{type:e.FLOAT,buffer:c,size:3,offset:12,stride:28},{type:e.FLOAT,buffer:c,size:1,offset:24,stride:28}]),u=a(e);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var d=new s(e,c,l,u);return d.update(t),d}},6740:function(e,t,n){var r=n(3236),i=r([`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;
}
`]),a=r([`#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;
}
`]),o=r([`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=r([`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.meshShader={vertex:i,fragment:a,attributes:[{name:`position`,type:`vec4`},{name:`color`,type:`vec4`},{name:`uv`,type:`vec2`},{name:`vector`,type:`vec4`}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:`position`,type:`vec4`},{name:`id`,type:`vec4`},{name:`vector`,type:`vec4`}]}},7815:function(e,t,n){var r=n(2931),i=n(9970),a=[`xyz`,`xzy`,`yxz`,`yzx`,`zxy`,`zyx`],o=function(e,t,n,a){for(var o=e.points,s=e.velocities,c=e.divergences,l=[],u=[],d=[],f=[],p=[],m=[],h=0,g=0,_=i.create(),v=i.create(),y=8,b=0;b<o.length;b++){var x=o[b],S=s[b],C=c[b];t===0&&(C=n*.05),g=r.length(S)/a,_=i.create(),r.copy(_,S),_[3]=C;for(var w=0;w<y;w++)p[w]=[x[0],x[1],x[2],w];if(f.length>0)for(var w=0;w<y;w++){var T=(w+1)%y;l.push(f[w],p[w],p[T],p[T],f[T],f[w]),d.push(v,_,_,_,v,v),m.push(h,g,g,g,h,h);var E=l.length;u.push([E-6,E-5,E-4],[E-3,E-2,E-1])}var D=f;f=p,p=D;var O=v;v=_,_=O;var k=h;h=g,g=k}return{positions:l,cells:u,vectors:d,vertexIntensity:m}},s=function(e,t,n,i){for(var a=0,s=0;s<e.length;s++)for(var c=e[s].velocities,l=0;l<c.length;l++)a=Math.max(a,r.length(c[l]));for(var u=e.map(function(e){return o(e,n,i,a)}),d=[],f=[],p=[],m=[],s=0;s<u.length;s++){var h=u[s],g=d.length;d=d.concat(h.positions),p=p.concat(h.vectors),m=m.concat(h.vertexIntensity);for(var l=0;l<h.cells.length;l++){var _=h.cells[l],v=[];f.push(v);for(var y=0;y<_.length;y++)v.push(_[y]+g)}}return{positions:d,cells:f,vectors:p,vertexIntensity:m,colormap:t}},c=function(e,t){var n=e.length,r;for(r=0;r<n;r++){var i=e[r];if(i===t)return r;if(i>t)return r-1}return r},l=function(e,t,n){return e<t?t:e>n?n:e},u=function(e,t,n){var i=t.vectors,a=t.meshgrid,o=e[0],s=e[1],u=e[2],d=a[0].length,f=a[1].length,p=a[2].length,m=c(a[0],o),h=c(a[1],s),g=c(a[2],u),_=m+1,v=h+1,y=g+1;if(m=l(m,0,d-1),_=l(_,0,d-1),h=l(h,0,f-1),v=l(v,0,f-1),g=l(g,0,p-1),y=l(y,0,p-1),m<0||h<0||g<0||_>d-1||v>f-1||y>p-1)return r.create();var b=a[0][m],x=a[0][_],S=a[1][h],C=a[1][v],w=a[2][g],T=a[2][y],E=(o-b)/(x-b),D=(s-S)/(C-S),O=(u-w)/(T-w);isFinite(E)||(E=.5),isFinite(D)||(D=.5),isFinite(O)||(O=.5);var k,A,j,M,N,P;switch(n.reversedX&&(m=d-1-m,_=d-1-_),n.reversedY&&(h=f-1-h,v=f-1-v),n.reversedZ&&(g=p-1-g,y=p-1-y),n.filled){case 5:N=g,P=y,j=h*p,M=v*p,k=m*p*f,A=_*p*f;break;case 4:N=g,P=y,k=m*p,A=_*p,j=h*p*d,M=v*p*d;break;case 3:j=h,M=v,N=g*f,P=y*f,k=m*f*p,A=_*f*p;break;case 2:j=h,M=v,k=m*f,A=_*f,N=g*f*d,P=y*f*d;break;case 1:k=m,A=_,N=g*d,P=y*d,j=h*d*p,M=v*d*p;break;default:k=m,A=_,j=h*d,M=v*d,N=g*d*f,P=y*d*f;break}var F=i[k+j+N],I=i[k+j+P],L=i[k+M+N],R=i[k+M+P],z=i[A+j+N],B=i[A+j+P],V=i[A+M+N],H=i[A+M+P],U=r.create(),W=r.create(),G=r.create(),K=r.create();r.lerp(U,F,z,E),r.lerp(W,I,B,E),r.lerp(G,L,V,E),r.lerp(K,R,H,E);var q=r.create(),J=r.create();r.lerp(q,U,G,D),r.lerp(J,W,K,D);var Y=r.create();return r.lerp(Y,q,J,O),Y},d=function(e){var t=1/0;e.sort(function(e,t){return e-t});for(var n=e.length,r=1;r<n;r++){var i=Math.abs(e[r]-e[r-1]);i<t&&(t=i)}return t},f=function(e){for(var t=[],n=[],r=[],i={},a={},o={},s=e.length,c=0;c<s;c++){var l=e[c],u=l[0],f=l[1],p=l[2];i[u]||(t.push(u),i[u]=!0),a[f]||(n.push(f),a[f]=!0),o[p]||(r.push(p),o[p]=!0)}var m=d(t),h=d(n),g=d(r),_=Math.min(m,h,g);return isFinite(_)?_:1};e.exports=function(e,t){var n=e.startingPositions,i=e.maxLength||1e3,o=e.tubeSize||1,c=e.absoluteTubeSize,l=e.gridFill||`+x+y+z`,d={};l.indexOf(`-x`)!==-1&&(d.reversedX=!0),l.indexOf(`-y`)!==-1&&(d.reversedY=!0),l.indexOf(`-z`)!==-1&&(d.reversedZ=!0),d.filled=a.indexOf(l.replace(/-/g,``).replace(/\+/g,``));var p=e.getVelocity||function(t){return u(t,e,d)},m=e.getDivergence||function(e,t){var n=r.create(),i=1e-4;r.add(n,e,[i,0,0]);var a=p(n);r.subtract(a,a,t),r.scale(a,a,1/i),r.add(n,e,[0,i,0]);var o=p(n);r.subtract(o,o,t),r.scale(o,o,1/i),r.add(n,e,[0,0,i]);var s=p(n);return r.subtract(s,s,t),r.scale(s,s,1/i),r.add(n,a,o),r.add(n,n,s),n},h=[],g=t[0][0],_=t[0][1],v=t[0][2],y=t[1][0],b=t[1][1],x=t[1][2],S=function(e){var t=e[0],n=e[1],r=e[2];return!(t<g||t>y||n<_||n>b||r<v||r>x)},C=10*r.distance(t[0],t[1])/i,w=C*C,T=1,E=0,D=n.length;D>1&&(T=f(n));for(var O=0;O<D;O++){var k=r.create();r.copy(k,n[O]);var A=[k],j=[],M=p(k),N=k;j.push(M);var P=[],F=m(k,M),I=r.length(F);isFinite(I)&&I>E&&(E=I),P.push(I),h.push({points:A,velocities:j,divergences:P});for(var L=0;L<i*100&&A.length<i&&S(k);){L++;var R=r.clone(M),z=r.squaredLength(R);if(z===0)break;if(z>w&&r.scale(R,R,C/Math.sqrt(z)),r.add(R,R,k),M=p(R),r.squaredDistance(N,R)-w>-1e-4*w){A.push(R),N=R,j.push(M);var F=m(R,M),I=r.length(F);isFinite(I)&&I>E&&(E=I),P.push(I)}k=R}}var B=s(h,e.colormap,E,T);return c?B.tubeScale=c:(E===0&&(E=1),B.tubeScale=o*.5*T/E),B};var p=n(6740),m=n(6405).createMesh;e.exports.createTubeMesh=function(e,t){return m(e,t,{shaders:p,traceType:`streamtube`})}},990:function(e,t,n){var r=n(9405),i=n(3236),a=i([`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);
}
`]),o=i([`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=i([`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);
}
`]),c=i([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform 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));
}
`]);t.createShader=function(e){var t=r(e,a,o,null,[{name:`uv`,type:`vec4`},{name:`f`,type:`vec3`},{name:`normal`,type:`vec3`}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createPickShader=function(e){var t=r(e,a,c,null,[{name:`uv`,type:`vec4`},{name:`f`,type:`vec3`},{name:`normal`,type:`vec3`}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createContourShader=function(e){var t=r(e,s,o,null,[{name:`uv`,type:`vec4`},{name:`f`,type:`float`}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t},t.createPickContourShader=function(e){var t=r(e,s,c,null,[{name:`uv`,type:`vec4`},{name:`f`,type:`float`}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t}},9499:function(e,t,n){e.exports=H;var r=n(8828),i=n(2762),a=n(8116),o=n(7766),s=n(1888),c=n(6729),l=n(5298),u=n(9994),d=n(9618),f=n(3711),p=n(6760),m=n(7608),h=n(2478),g=n(6199),_=n(990),v=_.createShader,y=_.createContourShader,b=_.createPickShader,x=_.createPickContourShader,S=40,C=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],w=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],T=[[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 e=0;e<3;++e){var t=T[e],n=(e+1)%3,r=(e+2)%3;t[n+0]=1,t[r+3]=1,t[e+6]=1}})();function E(e,t,n,r,i){this.position=e,this.index=t,this.uv=n,this.level=r,this.dataCoordinate=i}var D=256;function O(e,t,n,r,i,a,o,c,l,u,f,p,m,h,g){this.gl=e,this.shape=t,this.bounds=n,this.objectOffset=g,this.intensityBounds=[],this._shader=r,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=c,this._contourShader=l,this._contourPickShader=u,this._contourBuffer=f,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new E([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=m,this._dynamicVAO=h,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=[d(s.mallocFloat(1024),[0,0]),d(s.mallocFloat(1024),[0,0]),d(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 k=O.prototype;k.genColormap=function(e,t){var n=!1,r=u([c({colormap:e,nshades:D,format:`rgba`}).map(function(e,r){var i=t?A(r/255,t):e[3];return i<1&&(n=!0),[e[0],e[1],e[2],255*i]})]);return l.divseq(r,255),this.hasAlphaScale=n,r},k.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},k.isOpaque=function(){return!this.isTransparent()},k.pickSlots=1,k.setPickBase=function(e){this.pickId=e};function A(e,t){if(!t||!t.length)return 1;for(var n=0;n<t.length;++n){if(t.length<2)return 1;if(t[n][0]===e)return t[n][1];if(t[n][0]>e&&n>0){var r=(t[n][0]-e)/(t[n][0]-t[n-1][0]);return t[n][1]*(1-r)+r*t[n-1][1]}}return 1}var j=[0,0,0],M={showSurface:!1,showContour:!1,projections:[C.slice(),C.slice(),C.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function N(e,t){var n,r,i,a=t.axes&&t.axes.lastCubeProps.axis||j,o=t.showSurface,s=t.showContour;for(n=0;n<3;++n)for(o||=t.surfaceProject[n],r=0;r<3;++r)s||=t.contourProject[n][r];for(n=0;n<3;++n){var c=M.projections[n];for(r=0;r<16;++r)c[r]=0;for(r=0;r<4;++r)c[5*r]=1;c[5*n]=0,c[12+n]=t.axesBounds[+(a[n]>0)][n],p(c,e.model,c);var l=M.clipBounds[n];for(i=0;i<2;++i)for(r=0;r<3;++r)l[i][r]=e.clipBounds[i][r];l[0][n]=-1e8,l[1][n]=1e8}return M.showSurface=o,M.showContour=s,M}var P={model:C,view:C,projection:C,inverseModel:C.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},F=C.slice(),I=[1,0,0,0,1,0,0,0,1];function L(e,t){e||={};var n=this.gl;n.disable(n.CULL_FACE),this._colorMap.bind(0);var r=P;r.model=e.model||C,r.view=e.view||C,r.projection=e.projection||C,r.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],r.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],r.objectOffset=this.objectOffset,r.contourColor=this.contourColor[0],r.inverseModel=m(r.inverseModel,r.model);for(var i=0;i<2;++i)for(var a=r.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);r.kambient=this.ambientLight,r.kdiffuse=this.diffuseLight,r.kspecular=this.specularLight,r.roughness=this.roughness,r.fresnel=this.fresnel,r.opacity=this.opacity,r.height=0,r.permutation=I,r.vertexColor=this.vertexColor;var s=F;for(p(s,r.view,r.model),p(s,r.projection,s),m(s,s),i=0;i<3;++i)r.eyePosition[i]=s[12+i]/s[15];var c=s[15];for(i=0;i<3;++i)c+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var l=s[12+i];for(o=0;o<3;++o)l+=s[4*o+i]*this.lightPosition[o];r.lightPosition[i]=l/c}var u=N(r,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=r,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(n.TRIANGLES,this._vertexCount),i=0;i<3;++i)!this.surfaceProject[i]||!this.vertexCount||(this._shader.uniforms.model=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(n.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var d=this._contourShader;r.kambient=1,r.kdiffuse=0,r.kspecular=0,r.opacity=1,d.bind(),d.uniforms=r;var f=this._contourVAO;for(f.bind(),i=0;i<3;++i)for(d.uniforms.permutation=T[i],n.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o<this.contourLevels[i].length;++o)o===this.highlightLevel[i]?(d.uniforms.contourColor=this.highlightColor[i],d.uniforms.contourTint=this.highlightTint[i]):(o===0||o-1===this.highlightLevel[i])&&(d.uniforms.contourColor=this.contourColor[i],d.uniforms.contourTint=this.contourTint[i]),this._contourCounts[i][o]&&(d.uniforms.height=this.contourLevels[i][o],f.draw(n.LINES,this._contourCounts[i][o],this._contourOffsets[i][o]));for(i=0;i<3;++i)for(d.uniforms.model=u.projections[i],d.uniforms.clipBounds=u.clipBounds[i],o=0;o<3;++o)if(this.contourProject[i][o]){d.uniforms.permutation=T[o],n.lineWidth(this.contourWidth[o]*this.pixelRatio);for(var h=0;h<this.contourLevels[o].length;++h)h===this.highlightLevel[o]?(d.uniforms.contourColor=this.highlightColor[o],d.uniforms.contourTint=this.highlightTint[o]):(h===0||h-1===this.highlightLevel[o])&&(d.uniforms.contourColor=this.contourColor[o],d.uniforms.contourTint=this.contourTint[o]),this._contourCounts[o][h]&&(d.uniforms.height=this.contourLevels[o][h],f.draw(n.LINES,this._contourCounts[o][h],this._contourOffsets[o][h]))}for(f.unbind(),f=this._dynamicVAO,f.bind(),i=0;i<3;++i)if(this._dynamicCounts[i]!==0)for(d.uniforms.model=r.model,d.uniforms.clipBounds=r.clipBounds,d.uniforms.permutation=T[i],n.lineWidth(this.dynamicWidth[i]*this.pixelRatio),d.uniforms.contourColor=this.dynamicColor[i],d.uniforms.contourTint=this.dynamicTint[i],d.uniforms.height=this.dynamicLevel[i],f.draw(n.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),o=0;o<3;++o)this.contourProject[o][i]&&(d.uniforms.model=u.projections[o],d.uniforms.clipBounds=u.clipBounds[o],f.draw(n.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));f.unbind()}}k.draw=function(e){return L.call(this,e,!1)},k.drawTransparent=function(e){return L.call(this,e,!0)};var R={model:C,view:C,projection:C,inverseModel:C,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]};k.drawPick=function(e){e||={};var t=this.gl;t.disable(t.CULL_FACE);var n=R;n.model=e.model||C,n.view=e.view||C,n.projection=e.projection||C,n.shape=this._field[2].shape,n.pickId=this.pickId/255,n.lowerBound=this.bounds[0],n.upperBound=this.bounds[1],n.objectOffset=this.objectOffset,n.permutation=I;for(var r=0;r<2;++r)for(var i=n.clipBounds[r],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[r][a],-1e8),1e8);var o=N(n,this);if(o.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=n,this._vao.bind(),this._vao.draw(t.TRIANGLES,this._vertexCount),r=0;r<3;++r)this.surfaceProject[r]&&(this._pickShader.uniforms.model=o.projections[r],this._pickShader.uniforms.clipBounds=o.clipBounds[r],this._vao.draw(t.TRIANGLES,this._vertexCount));this._vao.unbind()}if(o.showContour){var s=this._contourPickShader;s.bind(),s.uniforms=n;var c=this._contourVAO;for(c.bind(),a=0;a<3;++a)for(t.lineWidth(this.contourWidth[a]*this.pixelRatio),s.uniforms.permutation=T[a],r=0;r<this.contourLevels[a].length;++r)this._contourCounts[a][r]&&(s.uniforms.height=this.contourLevels[a][r],c.draw(t.LINES,this._contourCounts[a][r],this._contourOffsets[a][r]));for(r=0;r<3;++r)for(s.uniforms.model=o.projections[r],s.uniforms.clipBounds=o.clipBounds[r],a=0;a<3;++a)if(this.contourProject[r][a]){s.uniforms.permutation=T[a],t.lineWidth(this.contourWidth[a]*this.pixelRatio);for(var l=0;l<this.contourLevels[a].length;++l)this._contourCounts[a][l]&&(s.uniforms.height=this.contourLevels[a][l],c.draw(t.LINES,this._contourCounts[a][l],this._contourOffsets[a][l]))}c.unbind()}},k.pick=function(e){if(!e||e.id!==this.pickId)return null;var t=this._field[2].shape,n=this._pickResult,r=t[0]*(e.value[0]+(e.value[2]>>4)/16)/255,i=Math.floor(r),a=r-i,o=t[1]*(e.value[1]+(e.value[2]&15)/16)/255,s=Math.floor(o),c=o-s;i+=1,s+=1;var l=n.position;l[0]=l[1]=l[2]=0;for(var u=0;u<2;++u)for(var d=u?a:1-a,f=0;f<2;++f)for(var p=f?c:1-c,m=i+u,g=s+f,_=d*p,v=0;v<3;++v)l[v]+=this._field[v].get(m,g)*_;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=h.le(this.contourLevels[b],l[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]<this.contourLevels[b].length-1){var x=this.contourLevels[b][y[b]],S=this.contourLevels[b][y[b]+1];Math.abs(x-l[b])>Math.abs(S-l[b])&&(y[b]+=1)}for(n.index[0]=a<.5?i:i+1,n.index[1]=c<.5?s:s+1,n.uv[0]=r/t[0],n.uv[1]=o/t[1],v=0;v<3;++v)n.dataCoordinate[v]=this._field[v].get(n.index[0],n.index[1]);return n},k.padField=function(e,t){var n=t.shape.slice(),r=e.shape.slice();l.assign(e.lo(1,1).hi(n[0],n[1]),t),l.assign(e.lo(1).hi(n[0],1),t.hi(n[0],1)),l.assign(e.lo(1,r[1]-1).hi(n[0],1),t.lo(0,n[1]-1).hi(n[0],1)),l.assign(e.lo(0,1).hi(1,n[1]),t.hi(1)),l.assign(e.lo(r[0]-1,1).hi(1,n[1]),t.lo(n[0]-1)),e.set(0,0,t.get(0,0)),e.set(0,r[1]-1,t.get(0,n[1]-1)),e.set(r[0]-1,0,t.get(n[0]-1,0)),e.set(r[0]-1,r[1]-1,t.get(n[0]-1,n[1]-1))};function z(e,t){return Array.isArray(e)?[t(e[0]),t(e[1]),t(e[2])]:[t(e),t(e),t(e)]}function B(e){return Array.isArray(e)?e.length===3?[e[0],e[1],e[2],1]:[e[0],e[1],e[2],e[3]]:[0,0,0,1]}function V(e){if(Array.isArray(e)){if(Array.isArray(e))return[B(e[0]),B(e[1]),B(e[2])];var t=B(e);return[t.slice(),t.slice(),t.slice()]}}k.update=function(e){e||={},this.objectOffset=e.objectOffset||this.objectOffset,this.dirty=!0,`contourWidth`in e&&(this.contourWidth=z(e.contourWidth,Number)),`showContour`in e&&(this.showContour=z(e.showContour,Boolean)),`showSurface`in e&&(this.showSurface=!!e.showSurface),`contourTint`in e&&(this.contourTint=z(e.contourTint,Boolean)),`contourColor`in e&&(this.contourColor=V(e.contourColor)),`contourProject`in e&&(this.contourProject=z(e.contourProject,function(e){return z(e,Boolean)})),`surfaceProject`in e&&(this.surfaceProject=e.surfaceProject),`dynamicColor`in e&&(this.dynamicColor=V(e.dynamicColor)),`dynamicTint`in e&&(this.dynamicTint=z(e.dynamicTint,Number)),`dynamicWidth`in e&&(this.dynamicWidth=z(e.dynamicWidth,Number)),`opacity`in e&&(this.opacity=e.opacity),`opacityscale`in e&&(this.opacityscale=e.opacityscale),`colorBounds`in e&&(this.colorBounds=e.colorBounds),`vertexColor`in e&&(this.vertexColor=e.vertexColor?1:0),`colormap`in e&&this._colorMap.setPixels(this.genColormap(e.colormap,this.opacityscale));var t=e.field||e.coords&&e.coords[2]||null,n=!1;if(t||=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0),`field`in e||`coords`in e){var i=(t.shape[0]+2)*(t.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(r.nextPow2(i))),this._field[2]=d(this._field[2].data,[t.shape[0]+2,t.shape[1]+2]),this.padField(this._field[2],t),this.shape=t.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=d(this._field[o].data,[a[0]+2,a[1]+2]);if(e.coords){var c=e.coords;if(!Array.isArray(c)||c.length!==3)throw Error(`gl-surface: invalid coordinates for x/y`);for(o=0;o<2;++o){var l=c[o];for(_=0;_<2;++_)if(l.shape[_]!==a[_])throw Error(`gl-surface: coords have incorrect shape`);this.padField(this._field[o],l)}}else if(e.ticks){var u=e.ticks;if(!Array.isArray(u)||u.length!==2)throw Error(`gl-surface: invalid ticks`);for(o=0;o<2;++o){var p=u[o];if((Array.isArray(p)||p.length)&&(p=d(p)),p.shape[0]!==a[o])throw Error(`gl-surface: invalid tick length`);var m=d(p.data,a);m.stride[o]=p.stride[0],m.stride[o^1]=0,this.padField(this._field[o],m)}}else{for(o=0;o<2;++o){var h=[0,0];h[o]=1,this._field[o]=d(this._field[o].data,[a[0]+2,a[1]+2],h,0)}this._field[0].set(0,0,0);for(var _=0;_<a[0];++_)this._field[0].set(_+1,0,_);for(this._field[0].set(a[0]+1,0,a[0]-1),this._field[1].set(0,0,0),_=0;_<a[1];++_)this._field[1].set(0,_+1,_);this._field[1].set(0,a[1]+1,a[1]-1)}var v=this._field,y=d(s.mallocFloat(v[2].size*3*2),[3,a[0]+2,a[1]+2,2]);for(o=0;o<3;++o)g(y.pick(o),v[o],`mirror`);var b=d(s.mallocFloat(v[2].size*3),[a[0]+2,a[1]+2,3]);for(o=0;o<a[0]+2;++o)for(_=0;_<a[1]+2;++_){var x=y.get(0,o,_,0),S=y.get(0,o,_,1),C=y.get(1,o,_,0),T=y.get(1,o,_,1),E=y.get(2,o,_,0),D=y.get(2,o,_,1),O=C*D-T*E,k=E*S-D*x,A=x*T-S*C,j=Math.sqrt(O*O+k*k+A*A);j<1e-8?(j=Math.max(Math.abs(O),Math.abs(k),Math.abs(A)),j<1e-8?(A=1,k=O=0,j=1):j=1/j):j=1/Math.sqrt(j),b.set(o,_,0,O*j),b.set(o,_,1,k*j),b.set(o,_,2,A*j)}s.free(y.data);var M=[1/0,1/0,1/0],N=[-1/0,-1/0,-1/0],P=1/0,F=-1/0,I=(a[0]-1)*(a[1]-1)*6,L=s.mallocFloat(r.nextPow2(10*I)),R=0,B=0;for(o=0;o<a[0]-1;++o)e:for(_=0;_<a[1]-1;++_){for(var H=0;H<2;++H)for(var U=0;U<2;++U)for(var W=0;W<3;++W){var G=this._field[W].get(1+o+H,1+_+U);if(isNaN(G)||!isFinite(G))continue e}for(W=0;W<6;++W){var K=o+w[W][0],q=_+w[W][1],J=this._field[0].get(K+1,q+1),Y=this._field[1].get(K+1,q+1);G=this._field[2].get(K+1,q+1),O=b.get(K+1,q+1,0),k=b.get(K+1,q+1,1),A=b.get(K+1,q+1,2),e.intensity&&(X=e.intensity.get(K,q));var X=e.intensity?e.intensity.get(K,q):G+this.objectOffset[2];L[R++]=K,L[R++]=q,L[R++]=J,L[R++]=Y,L[R++]=G,L[R++]=0,L[R++]=X,L[R++]=O,L[R++]=k,L[R++]=A,M[0]=Math.min(M[0],J+this.objectOffset[0]),M[1]=Math.min(M[1],Y+this.objectOffset[1]),M[2]=Math.min(M[2],G+this.objectOffset[2]),P=Math.min(P,X),N[0]=Math.max(N[0],J+this.objectOffset[0]),N[1]=Math.max(N[1],Y+this.objectOffset[1]),N[2]=Math.max(N[2],G+this.objectOffset[2]),F=Math.max(F,X),B+=1}}for(e.intensityBounds&&(P=+e.intensityBounds[0],F=+e.intensityBounds[1]),o=6;o<R;o+=10)L[o]=(L[o]-P)/(F-P);this._vertexCount=B,this._coordinateBuffer.update(L.subarray(0,R)),s.freeFloat(L),s.free(b.data),this.bounds=[M,N],this.intensity=e.intensity||this._field[2],(this.intensityBounds[0]!==P||this.intensityBounds[1]!==F)&&(n=!0),this.intensityBounds=[P,F]}if(`levels`in e){var Z=e.levels;for(Z=Array.isArray(Z[0])?Z.slice():[[],[],Z],o=0;o<3;++o)Z[o]=Z[o].slice(),Z[o].sort(function(e,t){return e-t});for(o=0;o<3;++o)for(_=0;_<Z[o].length;++_)Z[o][_]-=this.objectOffset[o];e:for(o=0;o<3;++o){if(Z[o].length!==this.contourLevels[o].length){n=!0;break}for(_=0;_<Z[o].length;++_)if(Z[o][_]!==this.contourLevels[o][_]){n=!0;break e}}this.contourLevels=Z}if(n){v=this._field,a=this.shape;for(var Q=[],ee=0;ee<3;++ee){var te=this.contourLevels[ee],ne=[],re=[],ie=[0,0,0];for(o=0;o<te.length;++o){var ae=f(this._field[ee],te[o]);ne.push(Q.length/5|0),B=0;e:for(_=0;_<ae.cells.length;++_){var oe=ae.cells[_];for(W=0;W<2;++W){var se=ae.positions[oe[W]],ce=se[0],le=Math.floor(ce)|0,ue=ce-le,de=se[1],fe=Math.floor(de)|0,pe=de-fe,me=!1;t:for(var he=0;he<3;++he){ie[he]=0;var ge=(ee+he+1)%3;for(H=0;H<2;++H){var _e=H?ue:1-ue;for(K=Math.min(Math.max(le+H,0),a[0])|0,U=0;U<2;++U){var ve=U?pe:1-pe;if(q=Math.min(Math.max(fe+U,0),a[1])|0,G=he<2?this._field[ge].get(K,q):(this.intensity.get(K,q)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(G)||isNaN(G)){me=!0;break t}var ye=_e*ve;ie[he]+=ye*G}}}if(!me)Q.push(ie[0],ie[1],se[0],se[1],ie[2]),B+=1;else{if(W>0){for(var be=0;be<5;++be)Q.pop();--B}continue e}}}re.push(B)}this._contourOffsets[ee]=ne,this._contourCounts[ee]=re}var xe=s.mallocFloat(Q.length);for(o=0;o<Q.length;++o)xe[o]=Q[o];this._contourBuffer.update(xe),s.freeFloat(xe)}},k.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 e=0;e<3;++e)s.freeFloat(this._field[e].data)},k.highlight=function(e){var t;if(!e){this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],this.highlightLevel=[-1,-1,-1];return}for(t=0;t<3;++t)this.enableHighlight[t]?this.highlightLevel[t]=e.level[t]:this.highlightLevel[t]=-1;var n;for(n=this.snapToData?e.dataCoordinate:e.position,t=0;t<3;++t)n[t]-=this.objectOffset[t];if(!((!this.enableDynamic[0]||n[0]===this.dynamicLevel[0])&&(!this.enableDynamic[1]||n[1]===this.dynamicLevel[1])&&(!this.enableDynamic[2]||n[2]===this.dynamicLevel[2]))){for(var r=0,i=this.shape,a=s.mallocFloat(12*i[0]*i[1]),o=0;o<3;++o){if(!this.enableDynamic[o]){this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;continue}this.dynamicLevel[o]=n[o];var c=(o+1)%3,l=(o+2)%3,u=this._field[o],d=this._field[c],p=this._field[l],m=f(u,n[o]),h=m.cells,g=m.positions;for(this._dynamicOffsets[o]=r,t=0;t<h.length;++t)for(var _=h[t],v=0;v<2;++v){var y=g[_[v]],b=+y[0],x=b|0,S=Math.min(x+1,i[0])|0,C=b-x,w=1-C,T=+y[1],E=T|0,D=Math.min(E+1,i[1])|0,O=T-E,k=1-O,A=w*k,j=w*O,M=C*k,N=C*O,P=A*d.get(x,E)+j*d.get(x,D)+M*d.get(S,E)+N*d.get(S,D),F=A*p.get(x,E)+j*p.get(x,D)+M*p.get(S,E)+N*p.get(S,D);if(isNaN(P)||isNaN(F)){v&&--r;break}a[2*r+0]=P,a[2*r+1]=F,r+=1}this._dynamicCounts[o]=r-this._dynamicOffsets[o]}this._dynamicBuffer.update(a.subarray(0,2*r)),s.freeFloat(a)}};function H(e){var t=e.gl,n=v(t),r=b(t),s=y(t),c=x(t),l=i(t),u=a(t,[{buffer:l,size:4,stride:S,offset:0},{buffer:l,size:3,stride:S,offset:16},{buffer:l,size:3,stride:S,offset:28}]),d=i(t),f=a(t,[{buffer:d,size:4,stride:20,offset:0},{buffer:d,size:1,stride:20,offset:16}]),p=i(t),m=a(t,[{buffer:p,size:2,type:t.FLOAT}]),h=o(t,1,D,t.RGBA,t.UNSIGNED_BYTE);h.minFilter=t.LINEAR,h.magFilter=t.LINEAR;var g=new O(t,[0,0],[[0,0,0],[0,0,0]],n,r,l,u,h,s,c,d,f,p,m,[0,0,0]),_={levels:[[],[],[]]};for(var C in e)_[C]=e[C];return _.colormap=_.colormap||`jet`,g.update(_),g}},7766:function(e,t,n){var r=n(9618),i=n(5298),a=n(1888);e.exports=x;var o=null,s=null,c=null;function l(e){o=[e.LINEAR,e.NEAREST_MIPMAP_LINEAR,e.LINEAR_MIPMAP_NEAREST,e.LINEAR_MIPMAP_NEAREST],s=[e.NEAREST,e.LINEAR,e.NEAREST_MIPMAP_NEAREST,e.NEAREST_MIPMAP_LINEAR,e.LINEAR_MIPMAP_NEAREST,e.LINEAR_MIPMAP_LINEAR],c=[e.REPEAT,e.CLAMP_TO_EDGE,e.MIRRORED_REPEAT]}function u(e){return typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLVideoElement<`u`&&e instanceof HTMLVideoElement||typeof ImageData<`u`&&e instanceof ImageData}var d=function(e,t){i.muls(e,t,255)};function f(e,t,n){var r=e.gl,i=r.getParameter(r.MAX_TEXTURE_SIZE);if(t<0||t>i||n<0||n>i)throw Error(`gl-texture2d: Invalid texture size`);return e._shape=[t,n],e.bind(),r.texImage2D(r.TEXTURE_2D,0,e.format,t,n,0,e.format,e.type,null),e._mipLevels=[0],e}function p(e,t,n,r,i,a){this.gl=e,this.handle=t,this.format=i,this.type=a,this._shape=[n,r],this._mipLevels=[0],this._magFilter=e.NEAREST,this._minFilter=e.NEAREST,this._wrapS=e.CLAMP_TO_EDGE,this._wrapT=e.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(e){return o.wrapS=e}},{get:function(){return o._wrapT},set:function(e){return o.wrapT=e}}]),this._wrapVector=s;var c=[this._shape[0],this._shape[1]];Object.defineProperties(c,[{get:function(){return o._shape[0]},set:function(e){return o.width=e}},{get:function(){return o._shape[1]},set:function(e){return o.height=e}}]),this._shapeVector=c}var m=p.prototype;Object.defineProperties(m,{minFilter:{get:function(){return this._minFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension(`OES_texture_float_linear`)||(e=t.NEAREST)),s.indexOf(e)<0)throw Error(`gl-texture2d: Unknown filter mode `+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),this._minFilter=e}},magFilter:{get:function(){return this._magFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension(`OES_texture_float_linear`)||(e=t.NEAREST)),s.indexOf(e)<0)throw Error(`gl-texture2d: Unknown filter mode `+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),this._magFilter=e}},mipSamples:{get:function(){return this._anisoSamples},set:function(e){var t=this._anisoSamples;if(this._anisoSamples=Math.max(e,1)|0,t!==this._anisoSamples){var n=this.gl.getExtension(`EXT_texture_filter_anisotropic`);n&&this.gl.texParameterf(this.gl.TEXTURE_2D,n.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(e){if(this.bind(),c.indexOf(e)<0)throw Error(`gl-texture2d: Unknown wrap mode `+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,e),this._wrapS=e}},wrapT:{get:function(){return this._wrapT},set:function(e){if(this.bind(),c.indexOf(e)<0)throw Error(`gl-texture2d: Unknown wrap mode `+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,e),this._wrapT=e}},wrap:{get:function(){return this._wrapVector},set:function(e){if(Array.isArray(e)||(e=[e,e]),e.length!==2)throw Error(`gl-texture2d: Must specify wrap mode for rows and columns`);for(var t=0;t<2;++t)if(c.indexOf(e[t])<0)throw Error(`gl-texture2d: Unknown wrap mode `+e);this._wrapS=e[0],this._wrapT=e[1];var n=this.gl;return this.bind(),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,this._wrapS),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,this._wrapT),e}},shape:{get:function(){return this._shapeVector},set:function(e){if(!Array.isArray(e))e=[e|0,e|0];else if(e.length!==2)throw Error(`gl-texture2d: Invalid texture shape`);return f(this,e[0]|0,e[1]|0),[e[0]|0,e[1]|0]}},width:{get:function(){return this._shape[0]},set:function(e){return e|=0,f(this,e,this._shape[1]),e}},height:{get:function(){return this._shape[1]},set:function(e){return e|=0,f(this,this._shape[0],e),e}}}),m.bind=function(e){var t=this.gl;return e!==void 0&&t.activeTexture(t.TEXTURE0+(e|0)),t.bindTexture(t.TEXTURE_2D,this.handle),e===void 0?t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0:e|0},m.dispose=function(){this.gl.deleteTexture(this.handle)},m.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var e=Math.min(this._shape[0],this._shape[1]),t=0;e>0;++t,e>>>=1)this._mipLevels.indexOf(t)<0&&this._mipLevels.push(t)},m.setPixels=function(e,t,n,r){var i=this.gl;this.bind(),Array.isArray(t)?(r=n,n=t[1]|0,t=t[0]|0):(t||=0,n||=0),r||=0;var a=u(e)?e:e.raw;if(a)this._mipLevels.indexOf(r)<0?(i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,this.type,a),this._mipLevels.push(r)):i.texSubImage2D(i.TEXTURE_2D,r,t,n,this.format,this.type,a);else if(e.shape&&e.stride&&e.data){if(e.shape.length<2||t+e.shape[1]>this._shape[1]>>>r||n+e.shape[0]>this._shape[0]>>>r||t<0||n<0)throw Error(`gl-texture2d: Texture dimensions are out of bounds`);g(i,t,n,r,this.format,this.type,this._mipLevels,e)}else throw Error(`gl-texture2d: Unsupported data type`)};function h(e,t){return e.length===3?t[2]===1&&t[1]===e[0]*e[2]&&t[0]===e[2]:t[0]===1&&t[1]===e[0]}function g(e,t,n,o,s,c,l,u){var f=u.dtype,p=u.shape.slice();if(p.length<2||p.length>3)throw Error(`gl-texture2d: Invalid ndarray, must be 2d or 3d`);var m=0,g=0,_=h(p,u.stride.slice());if(f===`float32`?m=e.FLOAT:f===`float64`?(m=e.FLOAT,_=!1,f=`float32`):f===`uint8`?m=e.UNSIGNED_BYTE:(m=e.UNSIGNED_BYTE,_=!1,f=`uint8`),p.length===2)g=e.LUMINANCE,p=[p[0],p[1],1],u=r(u.data,p,[u.stride[0],u.stride[1],1],u.offset);else if(p.length===3){if(p[2]===1)g=e.ALPHA;else if(p[2]===2)g=e.LUMINANCE_ALPHA;else if(p[2]===3)g=e.RGB;else if(p[2]===4)g=e.RGBA;else throw Error(`gl-texture2d: Invalid shape for pixel coords`);p[2]}else throw Error(`gl-texture2d: Invalid shape for texture`);if((g===e.LUMINANCE||g===e.ALPHA)&&(s===e.LUMINANCE||s===e.ALPHA)&&(g=s),g!==s)throw Error(`gl-texture2d: Incompatible texture format for setPixels`);var v=u.size,y=l.indexOf(o)<0;if(y&&l.push(o),m===c&&_)u.offset===0&&u.data.length===v?y?e.texImage2D(e.TEXTURE_2D,o,s,p[0],p[1],0,s,c,u.data):e.texSubImage2D(e.TEXTURE_2D,o,t,n,p[0],p[1],s,c,u.data):y?e.texImage2D(e.TEXTURE_2D,o,s,p[0],p[1],0,s,c,u.data.subarray(u.offset,u.offset+v)):e.texSubImage2D(e.TEXTURE_2D,o,t,n,p[0],p[1],s,c,u.data.subarray(u.offset,u.offset+v));else{var b=c===e.FLOAT?a.mallocFloat32(v):a.mallocUint8(v),x=r(b,p,[p[2],p[2]*p[0],1]);m===e.FLOAT&&c===e.UNSIGNED_BYTE?d(x,u):i.assign(x,u),y?e.texImage2D(e.TEXTURE_2D,o,s,p[0],p[1],0,s,c,b.subarray(0,v)):e.texSubImage2D(e.TEXTURE_2D,o,t,n,p[0],p[1],s,c,b.subarray(0,v)),c===e.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}function _(e){var t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t}function v(e,t,n,r,i){var a=e.getParameter(e.MAX_TEXTURE_SIZE);if(t<0||t>a||n<0||n>a)throw Error(`gl-texture2d: Invalid texture shape`);if(i===e.FLOAT&&!e.getExtension(`OES_texture_float`))throw Error(`gl-texture2d: Floating point textures not supported on this platform`);var o=_(e);return e.texImage2D(e.TEXTURE_2D,0,r,t,n,0,r,i,null),new p(e,o,t,n,r,i)}function y(e,t,n,r,i,a){var o=_(e);return e.texImage2D(e.TEXTURE_2D,0,i,i,a,t),new p(e,o,n,r,i,a)}function b(e,t){var n=t.dtype,o=t.shape.slice(),s=e.getParameter(e.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw Error(`gl-texture2d: Invalid texture size`);var c=h(o,t.stride.slice()),l=0;n===`float32`?l=e.FLOAT:n===`float64`?(l=e.FLOAT,c=!1,n=`float32`):n===`uint8`?l=e.UNSIGNED_BYTE:(l=e.UNSIGNED_BYTE,c=!1,n=`uint8`);var u=0;if(o.length===2)u=e.LUMINANCE,o=[o[0],o[1],1],t=r(t.data,o,[t.stride[0],t.stride[1],1],t.offset);else if(o.length===3)if(o[2]===1)u=e.ALPHA;else if(o[2]===2)u=e.LUMINANCE_ALPHA;else if(o[2]===3)u=e.RGB;else if(o[2]===4)u=e.RGBA;else throw Error(`gl-texture2d: Invalid shape for pixel coords`);else throw Error(`gl-texture2d: Invalid shape for texture`);l===e.FLOAT&&!e.getExtension(`OES_texture_float`)&&(l=e.UNSIGNED_BYTE,c=!1);var f,m,g=t.size;if(c)f=t.offset===0&&t.data.length===g?t.data:t.data.subarray(t.offset,t.offset+g);else{var v=[o[2],o[2]*o[0],1];m=a.malloc(g,n);var y=r(m,o,v,0);(n===`float32`||n===`float64`)&&l===e.UNSIGNED_BYTE?d(y,t):i.assign(y,t),f=m.subarray(0,g)}var b=_(e);return e.texImage2D(e.TEXTURE_2D,0,u,o[0],o[1],0,u,l,f),c||a.free(m),new p(e,b,o[0],o[1],u,l)}function x(e){if(arguments.length<=1)throw Error(`gl-texture2d: Missing arguments for texture2d constructor`);if(o||l(e),typeof arguments[1]==`number`)return v(e,arguments[1],arguments[2],arguments[3]||e.RGBA,arguments[4]||e.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return v(e,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||e.RGBA,arguments[3]||e.UNSIGNED_BYTE);if(typeof arguments[1]==`object`){var t=arguments[1],n=u(t)?t:t.raw;if(n)return y(e,n,t.width|0,t.height|0,arguments[2]||e.RGBA,arguments[3]||e.UNSIGNED_BYTE);if(t.shape&&t.data&&t.stride)return b(e,t)}throw Error(`gl-texture2d: Invalid arguments for texture2d constructor`)}},1433:function(e){function t(e,t,n){t?t.bind():e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null);var r=e.getParameter(e.MAX_VERTEX_ATTRIBS)|0;if(n){if(n.length>r)throw Error(`gl-vao: Too many vertex attributes`);for(var i=0;i<n.length;++i){var a=n[i];if(a.buffer){var o=a.buffer,s=a.size||4,c=a.type||e.FLOAT,l=!!a.normalized,u=a.stride||0,d=a.offset||0;o.bind(),e.enableVertexAttribArray(i),e.vertexAttribPointer(i,s,c,l,u,d)}else{if(typeof a==`number`)e.vertexAttrib1f(i,a);else if(a.length===1)e.vertexAttrib1f(i,a[0]);else if(a.length===2)e.vertexAttrib2f(i,a[0],a[1]);else if(a.length===3)e.vertexAttrib3f(i,a[0],a[1],a[2]);else if(a.length===4)e.vertexAttrib4f(i,a[0],a[1],a[2],a[3]);else throw Error(`gl-vao: Invalid vertex attribute`);e.disableVertexAttribArray(i)}}for(;i<r;++i)e.disableVertexAttribArray(i)}else{e.bindBuffer(e.ARRAY_BUFFER,null);for(var i=0;i<r;++i)e.disableVertexAttribArray(i)}}e.exports=t},870:function(e,t,n){var r=n(1433);function i(e){this.gl=e,this._elements=null,this._attributes=null,this._elementsType=e.UNSIGNED_SHORT}i.prototype.bind=function(){r(this.gl,this._elements,this._attributes)},i.prototype.update=function(e,t,n){this._elements=t,this._attributes=e,this._elementsType=n||this.gl.UNSIGNED_SHORT},i.prototype.dispose=function(){},i.prototype.unbind=function(){},i.prototype.draw=function(e,t,n){n||=0;var r=this.gl;this._elements?r.drawElements(e,t,this._elementsType,n):r.drawArrays(e,n,t)};function a(e){return new i(e)}e.exports=a},7518:function(e,t,n){var r=n(1433);function i(e,t,n,r,i,a){this.location=e,this.dimension=t,this.a=n,this.b=r,this.c=i,this.d=a}i.prototype.bind=function(e){switch(this.dimension){case 1:e.vertexAttrib1f(this.location,this.a);break;case 2:e.vertexAttrib2f(this.location,this.a,this.b);break;case 3:e.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:e.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d);break}};function a(e,t,n){this.gl=e,this._ext=t,this.handle=n,this._attribs=[],this._useElements=!1,this._elementsType=e.UNSIGNED_SHORT}a.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var e=0;e<this._attribs.length;++e)this._attribs[e].bind(this.gl)},a.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},a.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},a.prototype.update=function(e,t,n){if(this.bind(),r(this.gl,t,e),this.unbind(),this._attribs.length=0,e)for(var a=0;a<e.length;++a){var o=e[a];typeof o==`number`?this._attribs.push(new i(a,1,o)):Array.isArray(o)&&this._attribs.push(new i(a,o.length,o[0],o[1],o[2],o[3]))}this._useElements=!!t,this._elementsType=n||this.gl.UNSIGNED_SHORT},a.prototype.draw=function(e,t,n){n||=0;var r=this.gl;this._useElements?r.drawElements(e,t,this._elementsType,n):r.drawArrays(e,n,t)};function o(e,t){return new a(e,t,t.createVertexArrayOES())}e.exports=o},8116:function(e,t,n){var r=n(7518),i=n(870);function a(e){this.bindVertexArrayOES=e.bindVertexArray.bind(e),this.createVertexArrayOES=e.createVertexArray.bind(e),this.deleteVertexArrayOES=e.deleteVertexArray.bind(e)}function o(e,t,n,o){var s=e.createVertexArray?new a(e):e.getExtension(`OES_vertex_array_object`),c;return c=s?r(e,s):i(e),c.update(t,n,o),c}e.exports=o},5632:function(e){e.exports=t;function t(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}},8192:function(e,t,n){e.exports=o;var r=n(2825),i=n(3536),a=n(244);function o(e,t){var n=r(e[0],e[1],e[2]),o=r(t[0],t[1],t[2]);i(n,n),i(o,o);var s=a(n,o);return s>1?0:Math.acos(s)}},9226:function(e){e.exports=t;function t(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}},3126:function(e){e.exports=t;function t(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},3990:function(e){e.exports=t;function t(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},1091:function(e){e.exports=t;function t(){var e=new Float32Array(3);return e[0]=0,e[1]=0,e[2]=0,e}},5911:function(e){e.exports=t;function t(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],c=n[2];return e[0]=i*c-a*s,e[1]=a*o-r*c,e[2]=r*s-i*o,e}},5455:function(e,t,n){e.exports=n(7056)},7056:function(e){e.exports=t;function t(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(n*n+r*r+i*i)}},4008:function(e,t,n){e.exports=n(6690)},6690:function(e){e.exports=t;function t(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}},244:function(e){e.exports=t;function t(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}},2613:function(e){e.exports=1e-6},9922:function(e,t,n){e.exports=i;var r=n(2613);function i(e,t){var n=e[0],i=e[1],a=e[2],o=t[0],s=t[1],c=t[2];return Math.abs(n-o)<=r*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=r*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-c)<=r*Math.max(1,Math.abs(a),Math.abs(c))}},9265:function(e){e.exports=t;function t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}},2681:function(e){e.exports=t;function t(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}},5137:function(e,t,n){e.exports=i;var r=n(1091)();function i(e,t,n,i,a,o){var s,c;for(t||=3,n||=0,c=i?Math.min(i*t+n,e.length):e.length,s=n;s<c;s+=t)r[0]=e[s],r[1]=e[s+1],r[2]=e[s+2],a(r,r,o),e[s]=r[0],e[s+1]=r[1],e[s+2]=r[2];return e}},2825:function(e){e.exports=t;function t(e,t,n){var r=new Float32Array(3);return r[0]=e,r[1]=t,r[2]=n,r}},2931:function(e,t,n){e.exports={EPSILON:n(2613),create:n(1091),clone:n(3126),angle:n(8192),fromValues:n(2825),copy:n(3990),set:n(1463),equals:n(9922),exactEquals:n(9265),add:n(5632),subtract:n(6843),sub:n(2229),multiply:n(5847),mul:n(4505),divide:n(6690),div:n(4008),min:n(8107),max:n(7417),floor:n(2681),ceil:n(9226),round:n(2447),scale:n(6621),scaleAndAdd:n(8489),distance:n(7056),dist:n(5455),squaredDistance:n(2953),sqrDist:n(6141),length:n(1387),len:n(868),squaredLength:n(3066),sqrLen:n(5486),negate:n(5093),inverse:n(811),normalize:n(3536),dot:n(244),cross:n(5911),lerp:n(6658),random:n(7636),transformMat4:n(5673),transformMat3:n(492),transformQuat:n(264),rotateX:n(6894),rotateY:n(109),rotateZ:n(8692),forEach:n(5137)}},811:function(e){e.exports=t;function t(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}},868:function(e,t,n){e.exports=n(1387)},1387:function(e){e.exports=t;function t(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)}},6658:function(e){e.exports=t;function t(e,t,n,r){var i=t[0],a=t[1],o=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=o+r*(n[2]-o),e}},7417:function(e){e.exports=t;function t(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}},8107:function(e){e.exports=t;function t(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}},4505:function(e,t,n){e.exports=n(5847)},5847:function(e){e.exports=t;function t(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}},5093:function(e){e.exports=t;function t(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}},3536:function(e){e.exports=t;function t(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e}},7636:function(e){e.exports=t;function t(e,t){t||=1;var n=Math.random()*2*Math.PI,r=Math.random()*2-1,i=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(n)*i,e[1]=Math.sin(n)*i,e[2]=r*t,e}},6894:function(e){e.exports=t;function t(e,t,n,r){var i=n[1],a=n[2],o=t[1]-i,s=t[2]-a,c=Math.sin(r),l=Math.cos(r);return e[0]=t[0],e[1]=i+o*l-s*c,e[2]=a+o*c+s*l,e}},109:function(e){e.exports=t;function t(e,t,n,r){var i=n[0],a=n[2],o=t[0]-i,s=t[2]-a,c=Math.sin(r),l=Math.cos(r);return e[0]=i+s*c+o*l,e[1]=t[1],e[2]=a+s*l-o*c,e}},8692:function(e){e.exports=t;function t(e,t,n,r){var i=n[0],a=n[1],o=t[0]-i,s=t[1]-a,c=Math.sin(r),l=Math.cos(r);return e[0]=i+o*l-s*c,e[1]=a+o*c+s*l,e[2]=t[2],e}},2447:function(e){e.exports=t;function t(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}},6621:function(e){e.exports=t;function t(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}},8489:function(e){e.exports=t;function t(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e}},1463:function(e){e.exports=t;function t(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}},6141:function(e,t,n){e.exports=n(2953)},5486:function(e,t,n){e.exports=n(3066)},2953:function(e){e.exports=t;function t(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i}},3066:function(e){e.exports=t;function t(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r}},2229:function(e,t,n){e.exports=n(6843)},6843:function(e){e.exports=t;function t(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}},492:function(e){e.exports=t;function t(e,t,n){var r=t[0],i=t[1],a=t[2];return e[0]=r*n[0]+i*n[3]+a*n[6],e[1]=r*n[1]+i*n[4]+a*n[7],e[2]=r*n[2]+i*n[5]+a*n[8],e}},5673:function(e){e.exports=t;function t(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o||=1,e[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,e[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,e[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,e}},264:function(e){e.exports=t;function t(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],c=n[2],l=n[3],u=l*r+s*a-c*i,d=l*i+c*r-o*a,f=l*a+o*i-s*r,p=-o*r-s*i-c*a;return e[0]=u*l+p*-o+d*-c-f*-s,e[1]=d*l+p*-s+f*-o-u*-c,e[2]=f*l+p*-c+u*-s-d*-o,e}},4361:function(e){e.exports=t;function t(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}},2335:function(e){e.exports=t;function t(e){var t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},2933:function(e){e.exports=t;function t(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},7536:function(e){e.exports=t;function t(){var e=new Float32Array(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}},4691:function(e){e.exports=t;function t(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(n*n+r*r+i*i+a*a)}},1373:function(e){e.exports=t;function t(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}},3750:function(e){e.exports=t;function t(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}},3390:function(e){e.exports=t;function t(e,t,n,r){var i=new Float32Array(4);return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i}},9970:function(e,t,n){e.exports={create:n(7536),clone:n(2335),fromValues:n(3390),copy:n(2933),set:n(4578),add:n(4361),subtract:n(6860),multiply:n(3576),divide:n(1373),min:n(2334),max:n(160),scale:n(9288),scaleAndAdd:n(4844),distance:n(4691),squaredDistance:n(7960),length:n(6808),squaredLength:n(483),negate:n(1498),inverse:n(4494),normalize:n(5177),dot:n(3750),lerp:n(2573),random:n(9131),transformMat4:n(5352),transformQuat:n(4041)}},4494:function(e){e.exports=t;function t(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}},6808:function(e){e.exports=t;function t(e){var t=e[0],n=e[1],r=e[2],i=e[3];return Math.sqrt(t*t+n*n+r*r+i*i)}},2573:function(e){e.exports=t;function t(e,t,n,r){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=o+r*(n[2]-o),e[3]=s+r*(n[3]-s),e}},160:function(e){e.exports=t;function t(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}},2334:function(e){e.exports=t;function t(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}},3576:function(e){e.exports=t;function t(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}},1498:function(e){e.exports=t;function t(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}},5177:function(e){e.exports=t;function t(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),e[0]=n*o,e[1]=r*o,e[2]=i*o,e[3]=a*o),e}},9131:function(e,t,n){var r=n(5177),i=n(9288);e.exports=a;function a(e,t){return t||=1,e[0]=Math.random(),e[1]=Math.random(),e[2]=Math.random(),e[3]=Math.random(),r(e,e),i(e,e,t),e}},9288:function(e){e.exports=t;function t(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}},4844:function(e){e.exports=t;function t(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e}},4578:function(e){e.exports=t;function t(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}},7960:function(e){e.exports=t;function t(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return n*n+r*r+i*i+a*a}},483:function(e){e.exports=t;function t(e){var t=e[0],n=e[1],r=e[2],i=e[3];return t*t+n*n+r*r+i*i}},6860:function(e){e.exports=t;function t(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}},5352:function(e){e.exports=t;function t(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,e}},4041:function(e){e.exports=t;function t(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],c=n[2],l=n[3],u=l*r+s*a-c*i,d=l*i+c*r-o*a,f=l*a+o*i-s*r,p=-o*r-s*i-c*a;return e[0]=u*l+p*-o+d*-c-f*-s,e[1]=d*l+p*-s+f*-o-u*-c,e[2]=f*l+p*-c+u*-s-d*-o,e[3]=t[3],e}},1848:function(e,t,n){var r=n(4905),i=n(6468);e.exports=a;function a(e){for(var t=Array.isArray(e)?e:r(e),n=0;n<t.length;n++){var a=t[n];if(a.type===`preprocessor`){var o=a.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(o&&o[2]){var s=o[1],c=o[2];return(s?i(c):c).trim()}}}}},5874:function(e,t,n){e.exports=C;var r=n(620),i=n(7827),a=n(6852),o=n(7932),s=n(3508),c=999,l=9999,u=0,d=1,f=2,p=3,m=4,h=5,g=6,_=7,v=8,y=9,b=10,x=11,S=[`block-comment`,`line-comment`,`preprocessor`,`operator`,`integer`,`float`,`ident`,`builtin`,`keyword`,`whitespace`,`eof`,`integer`];function C(e){var t=0,n=0,C=c,w,T,E=[],D=[],O=1,k=0,A=0,j=!1,M=!1,N=``,P;e||={};var F=a,I=r;e.version===`300 es`&&(F=s,I=o);for(var L={},R={},t=0;t<F.length;t++)L[F[t]]=!0;for(var t=0;t<I.length;t++)R[I[t]]=!0;return function(e){return D=[],e===null?V():B(e)};function z(e){e.length&&D.push({type:S[C],data:e,position:A,line:O,column:k})}function B(e){t=0,e.toString&&(e=e.toString()),N+=e.replace(/\r\n/g,`
`),P=N.length;for(var r;w=N[t],t<P;){switch(r=t,C){case u:t=K();break;case d:t=G();break;case f:t=W();break;case p:t=q();break;case m:t=X();break;case x:t=Y();break;case h:t=Z();break;case l:t=Q();break;case y:t=U();break;case c:t=H();break}if(r!==t)switch(N[r]){case`
`:k=0,++O;break;default:++k;break}}return n+=t,N=N.slice(t),D}function V(e){return E.length&&z(E.join(``)),C=b,z(`(eof)`),D}function H(){return E=E.length?[]:E,T===`/`&&w===`*`?(A=n+t-1,C=u,T=w,t+1):T===`/`&&w===`/`?(A=n+t-1,C=d,T=w,t+1):w===`#`?(C=f,A=n+t,t):/\s/.test(w)?(C=y,A=n+t,t):(j=/\d/.test(w),M=/[^\w_]/.test(w),A=n+t,C=j?m:M?p:l,t)}function U(){return/[^\s]/g.test(w)?(z(E.join(``)),C=c,t):(E.push(w),T=w,t+1)}function W(){return(w===`\r`||w===`
`)&&T!==`\\`?(z(E.join(``)),C=c,t):(E.push(w),T=w,t+1)}function G(){return W()}function K(){return w===`/`&&T===`*`?(E.push(w),z(E.join(``)),C=c,t+1):(E.push(w),T=w,t+1)}function q(){if(T===`.`&&/\d/.test(w))return C=h,t;if(T===`/`&&w===`*`)return C=u,t;if(T===`/`&&w===`/`)return C=d,t;if(w===`.`&&E.length){for(;J(E););return C=h,t}if(w===`;`||w===`)`||w===`(`){if(E.length)for(;J(E););return z(w),C=c,t+1}var e=E.length===2&&w!==`=`;if(/[\w_\d\s]/.test(w)||e){for(;J(E););return C=c,t}return E.push(w),T=w,t+1}function J(e){var t=0,n,r;do{if(n=i.indexOf(e.slice(0,e.length+t).join(``)),r=i[n],n===-1){if(t--+e.length>0)continue;r=e.slice(0,1).join(``)}return z(r),A+=r.length,E=E.slice(r.length),E.length}while(!0)}function Y(){return/[^a-fA-F0-9]/.test(w)?(z(E.join(``)),C=c,t):(E.push(w),T=w,t+1)}function X(){return w===`.`||/[eE]/.test(w)?(E.push(w),C=h,T=w,t+1):w===`x`&&E.length===1&&E[0]===`0`?(C=x,E.push(w),T=w,t+1):/[^\d]/.test(w)?(z(E.join(``)),C=c,t):(E.push(w),T=w,t+1)}function Z(){return w===`f`&&(E.push(w),T=w,t+=1),/[eE]/.test(w)||(w===`-`||w===`+`)&&/[eE]/.test(T)?(E.push(w),T=w,t+1):/[^\d]/.test(w)?(z(E.join(``)),C=c,t):(E.push(w),T=w,t+1)}function Q(){if(/[^\d\w_]/.test(w)){var e=E.join(``);return C=R[e]?v:L[e]?_:g,z(E.join(``)),C=c,t}return E.push(w),T=w,t+1}}},3508:function(e,t,n){var r=n(6852);r=r.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),e.exports=r.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`.split(`.`))},6852:function(e){e.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`.split(`.`)},7932:function(e,t,n){e.exports=n(620).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`.split(`.`))},620:function(e){e.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`.split(`.`)},7827:function(e){e.exports=`<<= >>= ++ -- << >> <= >= == != && || += -= *= /= %= &= ^^ ^= |= ( ) [ ] . ! ~ * / % + - < > & ^ | ? : = , ; { }`.split(` `)},4905:function(e,t,n){var r=n(5874);e.exports=i;function i(e,t){var n=r(t),i=[];return i=i.concat(n(e)),i=i.concat(n(null)),i}},3236:function(e){e.exports=function(e){typeof e==`string`&&(e=[e]);for(var t=[].slice.call(arguments,1),n=[],r=0;r<e.length-1;r++)n.push(e[r],t[r]||``);return n.push(e[r]),n.join(``)}},7520:function(e,t,n){var r=n(9507);function i(){var e=!1;try{var t=Object.defineProperty({},`passive`,{get:function(){e=!0}});window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t)}catch{e=!1}return e}e.exports=r&&i()},3778:function(e,t){t.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else{if(a===c)return o?NaN:(p?-1:1)*(1/0);o+=2**r,a-=l}return(p?-1:1)*o*2**(a-r)},t.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}},8954:function(e,t,n){e.exports=p;var r=n(3250),i=n(6803).Fw;function a(e,t,n){this.vertices=e,this.adjacent=t,this.boundary=n,this.lastVisited=-1}a.prototype.flip=function(){var e=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=e;var t=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=t};function o(e,t,n){this.vertices=e,this.cell=t,this.index=n}function s(e,t){return i(e.vertices,t.vertices)}function c(e){return function(){var t=this.tuple;return e.apply(this,t)}}function l(e){var t=r[e+1];return t||=r,c(t)}var u=[];function d(e,t,n){this.dimension=e,this.vertices=t,this.simplices=n,this.interior=n.filter(function(e){return!e.boundary}),this.tuple=Array(e+1);for(var r=0;r<=e;++r)this.tuple[r]=this.vertices[r];var i=u[e];i||=u[e]=l(e),this.orient=i}var f=d.prototype;f.handleBoundaryDegeneracy=function(e,t){var n=this.dimension,r=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[e];for(e.lastVisited=-r;o.length>0;){e=o.pop();for(var s=e.adjacent,c=0;c<=n;++c){var l=s[c];if(!(!l.boundary||l.lastVisited<=-r)){for(var u=l.vertices,d=0;d<=n;++d){var f=u[d];f<0?i[d]=t:i[d]=a[f]}var p=this.orient();if(p>0)return l;l.lastVisited=-r,p===0&&o.push(l)}}}return null},f.walk=function(e,t){var n=this.vertices.length-1,r=this.dimension,i=this.vertices,a=this.tuple,o=t?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];e:for(;!s.boundary;){for(var c=s.vertices,l=s.adjacent,u=0;u<=r;++u)a[u]=i[c[u]];s.lastVisited=n;for(var u=0;u<=r;++u){var d=l[u];if(!(d.lastVisited>=n)){var f=a[u];a[u]=e;var p=this.orient();if(a[u]=f,p<0){s=d;continue e}else d.boundary?d.lastVisited=-n:d.lastVisited=n}}return}return s},f.addPeaks=function(e,t){var n=this.vertices.length-1,r=this.dimension,i=this.vertices,c=this.tuple,l=this.interior,u=this.simplices,d=[t];t.lastVisited=n,t.vertices[t.vertices.indexOf(-1)]=n,t.boundary=!1,l.push(t);for(var f=[];d.length>0;){var t=d.pop(),p=t.vertices,m=t.adjacent,h=p.indexOf(n);if(!(h<0)){for(var g=0;g<=r;++g)if(g!==h){var _=m[g];if(!(!_.boundary||_.lastVisited>=n)){var v=_.vertices;if(_.lastVisited!==-n){for(var y=0,b=0;b<=r;++b)v[b]<0?(y=b,c[b]=e):c[b]=i[v[b]];if(this.orient()>0){v[y]=n,_.boundary=!1,l.push(_),d.push(_),_.lastVisited=n;continue}else _.lastVisited=-n}var x=_.adjacent,S=p.slice(),C=m.slice(),w=new a(S,C,!0);u.push(w);var T=x.indexOf(t);if(!(T<0)){x[T]=w,C[h]=_,S[g]=-1,C[g]=t,m[g]=w,w.flip();for(var b=0;b<=r;++b){var E=S[b];if(!(E<0||E===n)){for(var D=Array(r-1),O=0,k=0;k<=r;++k){var A=S[k];A<0||k===b||(D[O++]=A)}f.push(new o(D,w,b))}}}}}}}f.sort(s);for(var g=0;g+1<f.length;g+=2){var j=f[g],M=f[g+1],N=j.index,P=M.index;N<0||P<0||(j.cell.adjacent[j.index]=M.cell,M.cell.adjacent[M.index]=j.cell)}},f.insert=function(e,t){var n=this.vertices;n.push(e);var r=this.walk(e,t);if(r){for(var i=this.dimension,a=this.tuple,o=0;o<=i;++o){var s=r.vertices[o];s<0?a[o]=e:a[o]=n[s]}var c=this.orient(a);c<0||c===0&&(r=this.handleBoundaryDegeneracy(r,e),!r)||this.addPeaks(e,r)}},f.boundary=function(){for(var e=this.dimension,t=[],n=this.simplices,r=n.length,i=0;i<r;++i){var a=n[i];if(a.boundary){for(var o=Array(e),s=a.vertices,c=0,l=0,u=0;u<=e;++u)s[u]>=0?o[c++]=s[u]:l=u&1;if(l===(e&1)){var d=o[0];o[0]=o[1],o[1]=d}t.push(o)}}return t};function p(e,t){var n=e.length;if(n===0)throw Error(`Must have at least d+1 points`);var i=e[0].length;if(n<=i)throw Error(`Must input at least d+1 points`);var o=e.slice(0,i+1),s=r.apply(void 0,o);if(s===0)throw Error(`Input not in general position`);for(var c=Array(i+1),l=0;l<=i;++l)c[l]=l;s<0&&(c[0]=1,c[1]=0);for(var u=new a(c,Array(i+1),!1),f=u.adjacent,p=Array(i+2),l=0;l<=i;++l){for(var m=c.slice(),h=0;h<=i;++h)h===l&&(m[h]=-1);var g=m[0];m[0]=m[1],m[1]=g;var _=new a(m,Array(i+1),!0);f[l]=_,p[l]=_}p[i+1]=u;for(var l=0;l<=i;++l)for(var m=f[l].vertices,v=f[l].adjacent,h=0;h<=i;++h){var y=m[h];if(y<0){v[h]=u;continue}for(var b=0;b<=i;++b)f[b].vertices.indexOf(y)<0&&(v[h]=f[b])}for(var x=new d(i,o,p),S=!!t,l=i+1;l<n;++l)x.insert(e[l],S);return x.boundary()}},3352:function(e,t,n){var r=n(2478),i=0,a=1,o=2;e.exports=S;function s(e,t,n,r,i){this.mid=e,this.left=t,this.right=n,this.leftPoints=r,this.rightPoints=i,this.count=(t?t.count:0)+(n?n.count:0)+r.length}var c=s.prototype;function l(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function u(e,t){var n=y(t);e.mid=n.mid,e.left=n.left,e.right=n.right,e.leftPoints=n.leftPoints,e.rightPoints=n.rightPoints,e.count=n.count}function d(e,t){var n=e.intervals([]);n.push(t),u(e,n)}function f(e,t){var n=e.intervals([]),r=n.indexOf(t);return r<0?i:(n.splice(r,1),u(e,n),a)}c.intervals=function(e){return e.push.apply(e,this.leftPoints),this.left&&this.left.intervals(e),this.right&&this.right.intervals(e),e},c.insert=function(e){var t=this.count-this.leftPoints.length;if(this.count+=1,e[1]<this.mid)this.left?4*(this.left.count+1)>3*(t+1)?d(this,e):this.left.insert(e):this.left=y([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?d(this,e):this.right.insert(e):this.right=y([e]);else{var n=r.ge(this.leftPoints,e,_),i=r.ge(this.rightPoints,e,v);this.leftPoints.splice(n,0,e),this.rightPoints.splice(i,0,e)}},c.remove=function(e){var t=this.count-this.leftPoints;if(e[1]<this.mid){if(!this.left)return i;if(4*(this.right?this.right.count:0)>3*(t-1))return f(this,e);var n=this.left.remove(e);return n===o?(this.left=null,--this.count,a):(n===a&&--this.count,n)}else if(e[0]>this.mid){if(!this.right)return i;if(4*(this.left?this.left.count:0)>3*(t-1))return f(this,e);var n=this.right.remove(e);return n===o?(this.right=null,--this.count,a):(n===a&&--this.count,n)}else{if(this.count===1)return this.leftPoints[0]===e?o:i;if(this.leftPoints.length===1&&this.leftPoints[0]===e){if(this.left&&this.right){for(var s=this,c=this.left;c.right;)s=c,c=c.right;if(s===this)c.right=this.right;else{var u=this.left,n=this.right;s.count-=c.count,s.right=c.left,c.left=u,c.right=n}l(this,c),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?l(this,this.left):l(this,this.right);return a}for(var u=r.ge(this.leftPoints,e,_);u<this.leftPoints.length&&this.leftPoints[u][0]===e[0];++u)if(this.leftPoints[u]===e){--this.count,this.leftPoints.splice(u,1);for(var n=r.ge(this.rightPoints,e,v);n<this.rightPoints.length&&this.rightPoints[n][1]===e[1];++n)if(this.rightPoints[n]===e)return this.rightPoints.splice(n,1),a}return i}};function p(e,t,n){for(var r=0;r<e.length&&e[r][0]<=t;++r){var i=n(e[r]);if(i)return i}}function m(e,t,n){for(var r=e.length-1;r>=0&&e[r][1]>=t;--r){var i=n(e[r]);if(i)return i}}function h(e,t){for(var n=0;n<e.length;++n){var r=t(e[n]);if(r)return r}}c.queryPoint=function(e,t){if(e<this.mid){if(this.left){var n=this.left.queryPoint(e,t);if(n)return n}return p(this.leftPoints,e,t)}else if(e>this.mid){if(this.right){var n=this.right.queryPoint(e,t);if(n)return n}return m(this.rightPoints,e,t)}else return h(this.leftPoints,t)},c.queryInterval=function(e,t,n){if(e<this.mid&&this.left){var r=this.left.queryInterval(e,t,n);if(r)return r}if(t>this.mid&&this.right){var r=this.right.queryInterval(e,t,n);if(r)return r}return t<this.mid?p(this.leftPoints,t,n):e>this.mid?m(this.rightPoints,e,n):h(this.leftPoints,n)};function g(e,t){return e-t}function _(e,t){return e[0]-t[0]||e[1]-t[1]}function v(e,t){return e[1]-t[1]||e[0]-t[0]}function y(e){if(e.length===0)return null;for(var t=[],n=0;n<e.length;++n)t.push(e[n][0],e[n][1]);t.sort(g);for(var r=t[t.length>>1],i=[],a=[],o=[],n=0;n<e.length;++n){var c=e[n];c[1]<r?i.push(c):r<c[0]?a.push(c):o.push(c)}var l=o,u=o.slice();return l.sort(_),u.sort(v),new s(r,y(i),y(a),l,u)}function b(e){this.root=e}var x=b.prototype;x.insert=function(e){this.root?this.root.insert(e):this.root=new s(e[0],null,null,[e],[e])},x.remove=function(e){if(this.root){var t=this.root.remove(e);return t===o&&(this.root=null),t!==i}return!1},x.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)},x.queryInterval=function(e,t,n){if(e<=t&&this.root)return this.root.queryInterval(e,t,n)},Object.defineProperty(x,`count`,{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(x,`intervals`,{get:function(){return this.root?this.root.intervals([]):[]}});function S(e){return!e||e.length===0?new b(null):new b(y(e))}},9507:function(e){e.exports=!0},7163:function(e){e.exports=function(e){return e!=null&&(t(e)||n(e)||!!e._isBuffer)};function t(e){return!!e.constructor&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}function n(e){return typeof e.readFloatLE==`function`&&typeof e.slice==`function`&&t(e.slice(0,0))}},5219:function(e){e.exports=function(e){for(var t=e.length,n,r=0;r<t;r++)if(n=e.charCodeAt(r),(n<9||n>13)&&n!==32&&n!==133&&n!==160&&n!==5760&&n!==6158&&(n<8192||n>8205)&&n!==8232&&n!==8233&&n!==8239&&n!==8287&&n!==8288&&n!==12288&&n!==65279)return!1;return!0}},395:function(e){function t(e,t,n){return e*(1-n)+t*n}e.exports=t},2652:function(e,t,n){var r=n(4335),i=n(6864),a=n(1903),o=n(9921),s=n(7608),c=n(5665),l={length:n(1387),normalize:n(3536),dot:n(244),cross:n(5911)},u=i(),d=i(),f=[0,0,0,0],p=[[0,0,0],[0,0,0],[0,0,0]],m=[0,0,0];e.exports=function(e,t,n,i,v,y){if(t||=[0,0,0],n||=[0,0,0],i||=[0,0,0],v||=[0,0,0,1],y||=[0,0,0,1],!r(u,e)||(a(d,u),d[3]=0,d[7]=0,d[11]=0,d[15]=1,Math.abs(o(d)<1e-8)))return!1;var b=u[3],x=u[7],S=u[11],C=u[12],w=u[13],T=u[14],E=u[15];if(b!==0||x!==0||S!==0){if(f[0]=b,f[1]=x,f[2]=S,f[3]=E,!s(d,d))return!1;c(d,d),h(v,f,d)}else v[0]=v[1]=v[2]=0,v[3]=1;if(t[0]=C,t[1]=w,t[2]=T,g(p,u),n[0]=l.length(p[0]),l.normalize(p[0],p[0]),i[0]=l.dot(p[0],p[1]),_(p[1],p[1],p[0],1,-i[0]),n[1]=l.length(p[1]),l.normalize(p[1],p[1]),i[0]/=n[1],i[1]=l.dot(p[0],p[2]),_(p[2],p[2],p[0],1,-i[1]),i[2]=l.dot(p[1],p[2]),_(p[2],p[2],p[1],1,-i[2]),n[2]=l.length(p[2]),l.normalize(p[2],p[2]),i[1]/=n[2],i[2]/=n[2],l.cross(m,p[1],p[2]),l.dot(p[0],m)<0)for(var D=0;D<3;D++)n[D]*=-1,p[D][0]*=-1,p[D][1]*=-1,p[D][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+p[0][0]-p[1][1]-p[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-p[0][0]+p[1][1]-p[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-p[0][0]-p[1][1]+p[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+p[0][0]+p[1][1]+p[2][2],0)),p[2][1]>p[1][2]&&(y[0]=-y[0]),p[0][2]>p[2][0]&&(y[1]=-y[1]),p[1][0]>p[0][1]&&(y[2]=-y[2]),!0};function h(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,e}function g(e,t){e[0][0]=t[0],e[0][1]=t[1],e[0][2]=t[2],e[1][0]=t[4],e[1][1]=t[5],e[1][2]=t[6],e[2][0]=t[8],e[2][1]=t[9],e[2][2]=t[10]}function _(e,t,n,r,i){e[0]=t[0]*r+n[0]*i,e[1]=t[1]*r+n[1]*i,e[2]=t[2]*r+n[2]*i}},4335:function(e){e.exports=function(e,t){var n=t[15];if(n===0)return!1;for(var r=1/n,i=0;i<16;i++)e[i]=t[i]*r;return!0}},7442:function(e,t,n){var r=n(6658),i=n(7182),a=n(2652),o=n(9921),s=n(8648),c=f(),l=f(),u=f();e.exports=d;function d(e,t,n,d){if(o(t)===0||o(n)===0)return!1;var f=a(t,c.translate,c.scale,c.skew,c.perspective,c.quaternion),p=a(n,l.translate,l.scale,l.skew,l.perspective,l.quaternion);return!f||!p?!1:(r(u.translate,c.translate,l.translate,d),r(u.skew,c.skew,l.skew,d),r(u.scale,c.scale,l.scale,d),r(u.perspective,c.perspective,l.perspective,d),s(u.quaternion,c.quaternion,l.quaternion,d),i(e,u.translate,u.scale,u.skew,u.perspective,u.quaternion),!0)}function f(){return{translate:p(),scale:p(1),skew:p(),perspective:m(),quaternion:m()}}function p(e){return[e||0,e||0,e||0]}function m(){return[0,0,0,1]}},7182:function(e,t,n){var r={identity:n(7894),translate:n(7656),multiply:n(6760),create:n(6864),scale:n(2504),fromRotationTranslation:n(6743)};r.create();var i=r.create();e.exports=function(e,t,n,a,o,s){return r.identity(e),r.fromRotationTranslation(e,s,t),e[3]=o[0],e[7]=o[1],e[11]=o[2],e[15]=o[3],r.identity(i),a[2]!==0&&(i[9]=a[2],r.multiply(e,e,i)),a[1]!==0&&(i[9]=0,i[8]=a[1],r.multiply(e,e,i)),a[0]!==0&&(i[8]=0,i[4]=a[0],r.multiply(e,e,i)),r.scale(e,e,n),e}},1811:function(e,t,n){var r=n(2478),i=n(7442),a=n(7608),o=n(5567),s=n(2408),c=n(7089),l=n(6582),u=n(7656);n(2504);var d=n(3536),f=[0,0,0];e.exports=g;function p(e){this._components=e.slice(),this._time=[0],this.prevMatrix=e.slice(),this.nextMatrix=e.slice(),this.computedMatrix=e.slice(),this.computedInverse=e.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 m=p.prototype;m.recalcMatrix=function(e){var t=this._time,n=r.le(t,e),o=this.computedMatrix;if(!(n<0)){var s=this._components;if(n===t.length-1)for(var c=16*n,l=0;l<16;++l)o[l]=s[c++];else{for(var u=t[n+1]-t[n],c=16*n,f=this.prevMatrix,p=!0,l=0;l<16;++l)f[l]=s[c++];for(var m=this.nextMatrix,l=0;l<16;++l)m[l]=s[c++],p&&=f[l]===m[l];if(u<1e-6||p)for(var l=0;l<16;++l)o[l]=f[l];else i(o,f,m,(e-t[n])/u)}var h=this.computedUp;h[0]=o[1],h[1]=o[5],h[2]=o[9],d(h,h);var g=this.computedInverse;a(g,o);var _=this.computedEye,v=g[15];_[0]=g[12]/v,_[1]=g[13]/v,_[2]=g[14]/v;for(var y=this.computedCenter,b=Math.exp(this.computedRadius[0]),l=0;l<3;++l)y[l]=_[l]-o[2+4*l]*b}},m.idle=function(e){if(!(e<this.lastT())){for(var t=this._components,n=t.length-16,r=0;r<16;++r)t.push(t[n++]);this._time.push(e)}},m.flush=function(e){var t=r.gt(this._time,e)-2;t<0||(this._time.splice(0,t),this._components.splice(0,16*t))},m.lastT=function(){return this._time[this._time.length-1]},m.lookAt=function(e,t,n,r){this.recalcMatrix(e),t||=this.computedEye,n||=f,r||=this.computedUp,this.setMatrix(e,l(this.computedMatrix,t,n,r));for(var i=0,a=0;a<3;++a)i+=(n[a]-t[a])**2;i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},m.rotate=function(e,t,n,r){this.recalcMatrix(e);var i=this.computedInverse;t&&s(i,i,t),n&&o(i,i,n),r&&c(i,i,r),this.setMatrix(e,a(this.computedMatrix,i))};var h=[0,0,0];m.pan=function(e,t,n,r){h[0]=-(t||0),h[1]=-(n||0),h[2]=-(r||0),this.recalcMatrix(e);var i=this.computedInverse;u(i,i,h),this.setMatrix(e,a(i,i))},m.translate=function(e,t,n,r){h[0]=t||0,h[1]=n||0,h[2]=r||0,this.recalcMatrix(e);var i=this.computedMatrix;u(i,i,h),this.setMatrix(e,i)},m.setMatrix=function(e,t){if(!(e<this.lastT())){this._time.push(e);for(var n=0;n<16;++n)this._components.push(t[n])}},m.setDistance=function(e,t){this.computedRadius[0]=t},m.setDistanceLimits=function(e,t){var n=this._limits;n[0]=e,n[1]=t},m.getDistanceLimits=function(e){var t=this._limits;return e?(e[0]=t[0],e[1]=t[1],e):t};function g(e){return e||={},new p(e.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}},3090:function(e,t,n){e.exports=i;var r=n(3250)[3];function i(e){var t=e.length;if(t<3){for(var n=Array(t),i=0;i<t;++i)n[i]=i;return t===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]?[0]:n}for(var a=Array(t),i=0;i<t;++i)a[i]=i;a.sort(function(t,n){return e[t][0]-e[n][0]||e[t][1]-e[n][1]});for(var o=[a[0],a[1]],s=[a[0],a[1]],i=2;i<t;++i){for(var c=a[i],l=e[c],u=o.length;u>1&&r(e[o[u-2]],e[o[u-1]],l)<=0;)--u,o.pop();for(o.push(c),u=s.length;u>1&&r(e[s[u-2]],e[s[u-1]],l)>=0;)--u,s.pop();s.push(c)}for(var n=Array(s.length+o.length-2),d=0,i=0,f=o.length;i<f;++i)n[d++]=o[i];for(var p=s.length-2;p>0;--p)n[d++]=s[p];return n}},351:function(e,t,n){e.exports=i;var r=n(4687);function i(e,t){t||(t=e,e=window);var n=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function c(e){var t=!1;return`altKey`in e&&(t||=e.altKey!==o.alt,o.alt=!!e.altKey),`shiftKey`in e&&(t||=e.shiftKey!==o.shift,o.shift=!!e.shiftKey),`ctrlKey`in e&&(t||=e.ctrlKey!==o.control,o.control=!!e.ctrlKey),`metaKey`in e&&(t||=e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function l(e,s){var l=r.x(s),u=r.y(s);`buttons`in s&&(e=s.buttons|0),(e!==n||l!==i||u!==a||c(s))&&(n=e|0,i=l||0,a=u||0,t&&t(n,i,a,o))}function u(e){l(0,e)}function d(){(n||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,n=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function f(e){c(e)&&t&&t(n,i,a,o)}function p(e){r.buttons(e)===0?l(0,e):l(n,e)}function m(e){l(n|r.buttons(e),e)}function h(e){l(n&~r.buttons(e),e)}function g(){s||(s=!0,e.addEventListener(`mousemove`,p),e.addEventListener(`mousedown`,m),e.addEventListener(`mouseup`,h),e.addEventListener(`mouseleave`,u),e.addEventListener(`mouseenter`,u),e.addEventListener(`mouseout`,u),e.addEventListener(`mouseover`,u),e.addEventListener(`blur`,d),e.addEventListener(`keyup`,f),e.addEventListener(`keydown`,f),e.addEventListener(`keypress`,f),e!==window&&(window.addEventListener(`blur`,d),window.addEventListener(`keyup`,f),window.addEventListener(`keydown`,f),window.addEventListener(`keypress`,f)))}function _(){s&&(s=!1,e.removeEventListener(`mousemove`,p),e.removeEventListener(`mousedown`,m),e.removeEventListener(`mouseup`,h),e.removeEventListener(`mouseleave`,u),e.removeEventListener(`mouseenter`,u),e.removeEventListener(`mouseout`,u),e.removeEventListener(`mouseover`,u),e.removeEventListener(`blur`,d),e.removeEventListener(`keyup`,f),e.removeEventListener(`keydown`,f),e.removeEventListener(`keypress`,f),e!==window&&(window.removeEventListener(`blur`,d),window.removeEventListener(`keyup`,f),window.removeEventListener(`keydown`,f),window.removeEventListener(`keypress`,f)))}g();var v={element:e};return Object.defineProperties(v,{enabled:{get:function(){return s},set:function(e){e?g():_()},enumerable:!0},buttons:{get:function(){return n},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),v}},24:function(e){var t={left:0,top:0};e.exports=n;function n(e,t,n){t=t||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var i=e.clientX||0,a=e.clientY||0,o=r(t);return n[0]=i-o.left,n[1]=a-o.top,n}function r(e){return e===window||e===document||e===document.body?t:e.getBoundingClientRect()}},4687:function(e,t){function n(e){if(typeof e==`object`){if(`buttons`in e)return e.buttons;if(`which`in e){var t=e.which;if(t===2)return 4;if(t===3)return 2;if(t>0)return 1<<t-1}else if(`button`in e){var t=e.button;if(t===1)return 4;if(t===2)return 2;if(t>=0)return 1<<t}}return 0}t.buttons=n;function r(e){return e.target||e.srcElement||window}t.element=r;function i(e){if(typeof e==`object`){if(`offsetX`in e)return e.offsetX;var t=r(e).getBoundingClientRect();return e.clientX-t.left}return 0}t.x=i;function a(e){if(typeof e==`object`){if(`offsetY`in e)return e.offsetY;var t=r(e).getBoundingClientRect();return e.clientY-t.top}return 0}t.y=a},8512:function(e,t,n){var r=n(665);e.exports=i;function i(e,t,n){typeof e==`function`&&(n=!!t,t=e,e=window);var i=r(`ex`,e),a=function(e){n&&e.preventDefault();var r=e.deltaX||0,a=e.deltaY||0,o=e.deltaZ||0,s=e.deltaMode,c=1;switch(s){case 1:c=i;break;case 2:c=window.innerHeight;break}if(r*=c,a*=c,o*=c,r||a||o)return t(r,a,o,e)};return e.addEventListener(`wheel`,a),a}},2640:function(e,t,n){var r=n(1888);e.exports=o;var i={"false,0,1":function(e,t,n,r,i){return function(a,o,s,c){var l=a.shape[0]|0,u=a.shape[1]|0,d=a.data,f=a.offset|0,p=a.stride[0]|0,m=a.stride[1]|0,h=f,g,_=-p|0,v=0,y=-m|0,b=0,x=-p-m|0,S=0,C=p|0,w=m-p*l|0,T=0,E=0,D=0,O=2*l|0,k=r(O),A=r(O),j=0,M=0,N=-1,P=-1,F=0,I=-l|0,L=l|0,R=0,z=-l-1|0,B=l-1|0,V=0,H=0,U=0;for(T=0;T<l;++T)k[j++]=n(d[h],o,s,c),h+=C;if(h+=w,u>0){if(E=1,k[j++]=n(d[h],o,s,c),h+=C,l>0)for(T=1,g=d[h],M=k[j]=n(g,o,s,c),F=k[j+N],R=k[j+I],V=k[j+z],(M!==F||M!==R||M!==V)&&(v=d[h+_],b=d[h+y],S=d[h+x],e(T,E,g,v,b,S,M,F,R,V,o,s,c),H=A[j]=D++),j+=1,h+=C,T=2;T<l;++T)g=d[h],M=k[j]=n(g,o,s,c),F=k[j+N],R=k[j+I],V=k[j+z],(M!==F||M!==R||M!==V)&&(v=d[h+_],b=d[h+y],S=d[h+x],e(T,E,g,v,b,S,M,F,R,V,o,s,c),H=A[j]=D++,V!==F&&t(A[j+N],H,S,v,V,F,o,s,c)),j+=1,h+=C;for(h+=w,j=0,U=N,N=P,P=U,U=I,I=L,L=U,U=z,z=B,B=U,E=2;E<u;++E){if(k[j++]=n(d[h],o,s,c),h+=C,l>0)for(T=1,g=d[h],M=k[j]=n(g,o,s,c),F=k[j+N],R=k[j+I],V=k[j+z],(M!==F||M!==R||M!==V)&&(v=d[h+_],b=d[h+y],S=d[h+x],e(T,E,g,v,b,S,M,F,R,V,o,s,c),H=A[j]=D++,V!==R&&t(A[j+I],H,b,S,R,V,o,s,c)),j+=1,h+=C,T=2;T<l;++T)g=d[h],M=k[j]=n(g,o,s,c),F=k[j+N],R=k[j+I],V=k[j+z],(M!==F||M!==R||M!==V)&&(v=d[h+_],b=d[h+y],S=d[h+x],e(T,E,g,v,b,S,M,F,R,V,o,s,c),H=A[j]=D++,V!==R&&t(A[j+I],H,b,S,R,V,o,s,c),V!==F&&t(A[j+N],H,S,v,V,F,o,s,c)),j+=1,h+=C;E&1&&(j=0),U=N,N=P,P=U,U=I,I=L,L=U,U=z,z=B,B=U,h+=w}}i(A),i(k)}},"false,1,0":function(e,t,n,r,i){return function(a,o,s,c){var l=a.shape[0]|0,u=a.shape[1]|0,d=a.data,f=a.offset|0,p=a.stride[0]|0,m=a.stride[1]|0,h=f,g,_=-p|0,v=0,y=-m|0,b=0,x=-p-m|0,S=0,C=m|0,w=p-m*u|0,T=0,E=0,D=0,O=2*u|0,k=r(O),A=r(O),j=0,M=0,N=-1,P=-1,F=0,I=-u|0,L=u|0,R=0,z=-u-1|0,B=u-1|0,V=0,H=0,U=0;for(E=0;E<u;++E)k[j++]=n(d[h],o,s,c),h+=C;if(h+=w,l>0){if(T=1,k[j++]=n(d[h],o,s,c),h+=C,u>0)for(E=1,g=d[h],M=k[j]=n(g,o,s,c),R=k[j+I],F=k[j+N],V=k[j+z],(M!==R||M!==F||M!==V)&&(v=d[h+_],b=d[h+y],S=d[h+x],e(T,E,g,v,b,S,M,R,F,V,o,s,c),H=A[j]=D++),j+=1,h+=C,E=2;E<u;++E)g=d[h],M=k[j]=n(g,o,s,c),R=k[j+I],F=k[j+N],V=k[j+z],(M!==R||M!==F||M!==V)&&(v=d[h+_],b=d[h+y],S=d[h+x],e(T,E,g,v,b,S,M,R,F,V,o,s,c),H=A[j]=D++,V!==F&&t(A[j+N],H,b,S,F,V,o,s,c)),j+=1,h+=C;for(h+=w,j=0,U=I,I=L,L=U,U=N,N=P,P=U,U=z,z=B,B=U,T=2;T<l;++T){if(k[j++]=n(d[h],o,s,c),h+=C,u>0)for(E=1,g=d[h],M=k[j]=n(g,o,s,c),R=k[j+I],F=k[j+N],V=k[j+z],(M!==R||M!==F||M!==V)&&(v=d[h+_],b=d[h+y],S=d[h+x],e(T,E,g,v,b,S,M,R,F,V,o,s,c),H=A[j]=D++,V!==R&&t(A[j+I],H,S,v,V,R,o,s,c)),j+=1,h+=C,E=2;E<u;++E)g=d[h],M=k[j]=n(g,o,s,c),R=k[j+I],F=k[j+N],V=k[j+z],(M!==R||M!==F||M!==V)&&(v=d[h+_],b=d[h+y],S=d[h+x],e(T,E,g,v,b,S,M,R,F,V,o,s,c),H=A[j]=D++,V!==F&&t(A[j+N],H,b,S,F,V,o,s,c),V!==R&&t(A[j+I],H,S,v,V,R,o,s,c)),j+=1,h+=C;T&1&&(j=0),U=I,I=L,L=U,U=N,N=P,P=U,U=z,z=B,B=U,h+=w}}i(A),i(k)}}};function a(e,t,n,a,o,s){var c=i[[s,o].join(`,`)];return c(e,t,n,r.mallocUint32,r.freeUint32)}function o(e){function t(e){throw Error(`ndarray-extract-contour: `+e)}typeof e!=`object`&&t(`Must specify arguments`);var n=e.order;Array.isArray(n)||t(`Must specify order`);var r=e.arrayArguments||1;r<1&&t(`Must have at least one array argument`);var i=e.scalarArguments||0;i<0&&t(`Scalar arg count must be > 0`),typeof e.vertex!=`function`&&t(`Must specify vertex creation function`),typeof e.cell!=`function`&&t(`Must specify cell creation function`),typeof e.phase!=`function`&&t(`Must specify phase function`);for(var o=e.getters||[],s=Array(r),c=0;c<r;++c)o.indexOf(c)>=0?s[c]=!0:s[c]=!1;return a(e.vertex,e.cell,e.phase,i,n,s)}},6199:function(e,t,n){var r=n(1338),i={zero:function(e,t,n,r){var i=e[0],a=n[0];r|=0;var o=0,s=a;for(o=0;o<i;++o)t[r]=0,r+=s},fdTemplate1:function(e,t,n,r,i,a,o){var s=e[0],c=n[0],l=a[0],u=-1*c,d=c;r|=0,o|=0;var f=0,p=c,m=l;for(f=0;f<s;++f)i[o]=.5*(t[r+u]-t[r+d]),r+=p,o+=m},fdTemplate2:function(e,t,n,r,i,a,o,s,c,l){var u=e[0],d=e[1],f=n[0],p=n[1],m=a[0],h=a[1],g=c[0],_=c[1],v=-1*f,y=f,b=-1*p,x=p;r|=0,o|=0,l|=0;var S=0,C=0,w=p,T=f-d*p,E=h,D=m-d*h,O=_,k=g-d*_;for(C=0;C<u;++C){for(S=0;S<d;++S)i[o]=.5*(t[r+v]-t[r+y]),s[l]=.5*(t[r+b]-t[r+x]),r+=w,o+=E,l+=O;r+=T,o+=D,l+=k}}},a={cdiff:function(e){var t={};return function(n,r,i){var a=n.dtype,o=n.order,s=r.dtype,c=r.order,l=i.dtype,u=i.order,d=[a,o.join(),s,c.join(),l,u.join()].join(),f=t[d];return f||(t[d]=f=e([a,o,s,c,l,u])),f(n.shape.slice(0),n.data,n.stride,n.offset|0,r.data,r.stride,r.offset|0,i.data,i.stride,i.offset|0)}},zero:function(e){var t={};return function(n){var r=n.dtype,i=n.order,a=[r,i.join()].join(),o=t[a];return o||(t[a]=o=e([r,i])),o(n.shape.slice(0),n.data,n.stride,n.offset|0)}},fdTemplate1:function(e){var t={};return function(n,r){var i=n.dtype,a=n.order,o=r.dtype,s=r.order,c=[i,a.join(),o,s.join()].join(),l=t[c];return l||(t[c]=l=e([i,a,o,s])),l(n.shape.slice(0),n.data,n.stride,n.offset|0,r.data,r.stride,r.offset|0)}},fdTemplate2:function(e){var t={};return function(n,r,i){var a=n.dtype,o=n.order,s=r.dtype,c=r.order,l=i.dtype,u=i.order,d=[a,o.join(),s,c.join(),l,u.join()].join(),f=t[d];return f||(t[d]=f=e([a,o,s,c,l,u])),f(n.shape.slice(0),n.data,n.stride,n.offset|0,r.data,r.stride,r.offset|0,i.data,i.stride,i.offset|0)}}};function o(e){var t=a[e.funcName];return t(s.bind(void 0,e))}function s(e){return i[e.funcName]}function c(e){return o({funcName:e.funcName})}var l={},u={},d=c({funcName:`cdiff`}),f=c({funcName:`zero`});function p(e){return e in l?l[e]:l[e]=c({funcName:`fdTemplate`+e})}function m(e,t,n,r){return function(e,i){var a=i.shape.slice();return a[0]>2&&a[1]>2&&r(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(n(i.pick(0,-1).lo(1).hi(a[1]-2),e.pick(0,-1,1).lo(1).hi(a[1]-2)),t(e.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(n(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),e.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),t(e.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(n(i.pick(-1,0).lo(1).hi(a[0]-2),e.pick(-1,0,0).lo(1).hi(a[0]-2)),t(e.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(n(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),e.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),t(e.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),e.set(0,0,0,0),e.set(0,0,1,0),e.set(a[0]-1,0,0,0),e.set(a[0]-1,0,1,0),e.set(0,a[1]-1,0,0),e.set(0,a[1]-1,1,0),e.set(a[0]-1,a[1]-1,0,0),e.set(a[0]-1,a[1]-1,1,0),e}}function h(e){var t=e.join(),n=u[t];if(n)return n;for(var r=e.length,i=[d,f],a=1;a<=r;++a)i.push(p(a));var n=m.apply(void 0,i);return u[t]=n,n}e.exports=function(e,t,n){return Array.isArray(n)||(n=typeof n==`string`?r(t.dimension,n):r(t.dimension,`clamp`)),t.size===0?e:t.dimension===0?(e.set(0),e):h(n)(e,t)}},4317:function(e){function t(e,t){var n=Math.floor(t),r=t-n,i=0<=n&&n<e.shape[0],a=0<=n+1&&n+1<e.shape[0],o=i?+e.get(n):0,s=a?+e.get(n+1):0;return(1-r)*o+r*s}function n(e,t,n){var r=Math.floor(t),i=t-r,a=0<=r&&r<e.shape[0],o=0<=r+1&&r+1<e.shape[0],s=Math.floor(n),c=n-s,l=0<=s&&s<e.shape[1],u=0<=s+1&&s+1<e.shape[1],d=a&&l?e.get(r,s):0,f=a&&u?e.get(r,s+1):0,p=o&&l?e.get(r+1,s):0,m=o&&u?e.get(r+1,s+1):0;return(1-c)*((1-i)*d+i*p)+c*((1-i)*f+i*m)}function r(e,t,n,r){var i=Math.floor(t),a=t-i,o=0<=i&&i<e.shape[0],s=0<=i+1&&i+1<e.shape[0],c=Math.floor(n),l=n-c,u=0<=c&&c<e.shape[1],d=0<=c+1&&c+1<e.shape[1],f=Math.floor(r),p=r-f,m=0<=f&&f<e.shape[2],h=0<=f+1&&f+1<e.shape[2],g=o&&u&&m?e.get(i,c,f):0,_=o&&d&&m?e.get(i,c+1,f):0,v=s&&u&&m?e.get(i+1,c,f):0,y=s&&d&&m?e.get(i+1,c+1,f):0,b=o&&u&&h?e.get(i,c,f+1):0,x=o&&d&&h?e.get(i,c+1,f+1):0,S=s&&u&&h?e.get(i+1,c,f+1):0,C=s&&d&&h?e.get(i+1,c+1,f+1):0;return(1-p)*((1-l)*((1-a)*g+a*v)+l*((1-a)*_+a*y))+p*((1-l)*((1-a)*b+a*S)+l*((1-a)*x+a*C))}function i(e){var t=e.shape.length|0,n=Array(t),r=Array(t),i=Array(t),a=Array(t),o,s;for(o=0;o<t;++o)s=+arguments[o+1],n[o]=Math.floor(s),r[o]=s-n[o],i[o]=0<=n[o]&&n[o]<e.shape[o],a[o]=0<=n[o]+1&&n[o]+1<e.shape[o];var c=0,l,u,d;e:for(o=0;o<1<<t;++o){for(u=1,d=e.offset,l=0;l<t;++l)if(o&1<<l){if(!a[l])continue e;u*=r[l],d+=e.stride[l]*(n[l]+1)}else{if(!i[l])continue e;u*=1-r[l],d+=e.stride[l]*n[l]}c+=u*e.data[d]}return c}function a(e,a,o,s){switch(e.shape.length){case 0:return 0;case 1:return t(e,a);case 2:return n(e,a,o);case 3:return r(e,a,o,s);default:return i.apply(void 0,arguments)}}e.exports=a,e.exports.d1=t,e.exports.d2=n,e.exports.d3=r},5298:function(e,t){var n={"float64,2,1,0":function(){return function(e,t,n,r,i){var a=e[0],o=e[1],s=e[2],c=n[0],l=n[1],u=n[2];r|=0;var d=0,f=0,p=0,m=u,h=l-s*u,g=c-o*l;for(p=0;p<a;++p){for(f=0;f<o;++f){for(d=0;d<s;++d)t[r]/=i,r+=m;r+=h}r+=g}}},"uint8,2,0,1,float64,2,1,0":function(){return function(e,t,n,r,i,a,o,s){var c=e[0],l=e[1],u=e[2],d=n[0],f=n[1],p=n[2],m=a[0],h=a[1],g=a[2];r|=0,o|=0;for(var _=r,v=o,y=e[0]|0;y>0;){y<64?(c=y,y=0):(c=64,y-=64);for(var b=e[1]|0;b>0;){b<64?(l=b,b=0):(l=64,b-=64),r=_+y*d+b*f,o=v+y*m+b*h;var x=0,S=0,C=0,w=p,T=d-u*p,E=f-c*d,D=g,O=m-u*g,k=h-c*m;for(C=0;C<l;++C){for(S=0;S<c;++S){for(x=0;x<u;++x)t[r]=i[o]*s,r+=w,o+=D;r+=T,o+=O}r+=E,o+=k}}}}},"float32,1,0,float32,1,0":function(){return function(e,t,n,r,i,a,o){var s=e[0],c=e[1],l=n[0],u=n[1],d=a[0],f=a[1];r|=0,o|=0;var p=0,m=0,h=u,g=l-c*u,_=f,v=d-c*f;for(m=0;m<s;++m){for(p=0;p<c;++p)t[r]=i[o],r+=h,o+=_;r+=g,o+=v}}},"float32,1,0,float32,0,1":function(){return function(e,t,n,r,i,a,o){var s=e[0],c=e[1],l=n[0],u=n[1],d=a[0],f=a[1];r|=0,o|=0;for(var p=r,m=o,h=e[1]|0;h>0;){h<64?(c=h,h=0):(c=64,h-=64);for(var g=e[0]|0;g>0;){g<64?(s=g,g=0):(s=64,g-=64),r=p+h*u+g*l,o=m+h*f+g*d;var _=0,v=0,y=u,b=l-c*u,x=f,S=d-c*f;for(v=0;v<s;++v){for(_=0;_<c;++_)t[r]=i[o],r+=y,o+=x;r+=b,o+=S}}}}},"uint8,2,0,1,uint8,1,2,0":function(){return function(e,t,n,r,i,a,o){var s=e[0],c=e[1],l=e[2],u=n[0],d=n[1],f=n[2],p=a[0],m=a[1],h=a[2];r|=0,o|=0;for(var g=r,_=o,v=e[2]|0;v>0;){v<64?(l=v,v=0):(l=64,v-=64);for(var y=e[0]|0;y>0;){y<64?(s=y,y=0):(s=64,y-=64);for(var b=e[1]|0;b>0;){b<64?(c=b,b=0):(c=64,b-=64),r=g+v*f+y*u+b*d,o=_+v*h+y*p+b*m;var x=0,S=0,C=0,w=f,T=u-l*f,E=d-s*u,D=h,O=p-l*h,k=m-s*p;for(C=0;C<c;++C){for(S=0;S<s;++S){for(x=0;x<l;++x)t[r]=i[o],r+=w,o+=D;r+=T,o+=O}r+=E,o+=k}}}}}},"uint8,2,0,1,array,2,0,1":function(){return function(e,t,n,r,i,a,o){var s=e[0],c=e[1],l=e[2],u=n[0],d=n[1],f=n[2],p=a[0],m=a[1],h=a[2];r|=0,o|=0;var g=0,_=0,v=0,y=f,b=u-l*f,x=d-s*u,S=h,C=p-l*h,w=m-s*p;for(v=0;v<c;++v){for(_=0;_<s;++_){for(g=0;g<l;++g)t[r]=i[o],r+=y,o+=S;r+=b,o+=C}r+=x,o+=w}}}};function r(e,t){var r=n[t.join(`,`)];return r()}var i=r,a={mul:function(e){var t={};return function(n,r,i){var a=n.dtype,o=n.order,s=r.dtype,c=r.order,l=i.dtype,u=i.order,d=[a,o.join(),s,c.join(),l,u.join()].join(),f=t[d];return f||(t[d]=f=e([a,o,s,c,l,u])),f(n.shape.slice(0),n.data,n.stride,n.offset|0,r.data,r.stride,r.offset|0,i.data,i.stride,i.offset|0)}},muls:function(e){var t={};return function(n,r,i){var a=n.dtype,o=n.order,s=r.dtype,c=r.order,l=[a,o.join(),s,c.join()].join(),u=t[l];return u||(t[l]=u=e([a,o,s,c])),u(n.shape.slice(0),n.data,n.stride,n.offset|0,r.data,r.stride,r.offset|0,i)}},mulseq:function(e){var t={};return function(n,r){var i=n.dtype,a=n.order,o=[i,a.join()].join(),s=t[o];return s||(t[o]=s=e([i,a])),s(n.shape.slice(0),n.data,n.stride,n.offset|0,r)}},div:function(e){var t={};return function(n,r,i){var a=n.dtype,o=n.order,s=r.dtype,c=r.order,l=i.dtype,u=i.order,d=[a,o.join(),s,c.join(),l,u.join()].join(),f=t[d];return f||(t[d]=f=e([a,o,s,c,l,u])),f(n.shape.slice(0),n.data,n.stride,n.offset|0,r.data,r.stride,r.offset|0,i.data,i.stride,i.offset|0)}},divs:function(e){var t={};return function(n,r,i){var a=n.dtype,o=n.order,s=r.dtype,c=r.order,l=[a,o.join(),s,c.join()].join(),u=t[l];return u||(t[l]=u=e([a,o,s,c])),u(n.shape.slice(0),n.data,n.stride,n.offset|0,r.data,r.stride,r.offset|0,i)}},divseq:function(e){var t={};return function(n,r){var i=n.dtype,a=n.order,o=[i,a.join()].join(),s=t[o];return s||(t[o]=s=e([i,a])),s(n.shape.slice(0),n.data,n.stride,n.offset|0,r)}},assign:function(e){var t={};return function(n,r){var i=n.dtype,a=n.order,o=r.dtype,s=r.order,c=[i,a.join(),o,s.join()].join(),l=t[c];return l||(t[c]=l=e([i,a,o,s])),l(n.shape.slice(0),n.data,n.stride,n.offset|0,r.data,r.stride,r.offset|0)}}};function o(e){var t=a[e.funcName];return t(i.bind(void 0,e))}function s(e){return o({funcName:e.funcName})}var c={mul:`*`,div:`/`};(function(){for(var e in c)t[e]=s({funcName:e}),t[e+`s`]=s({funcName:e+`s`}),t[e+`seq`]=s({funcName:e+`seq`})})(),t.assign=s({funcName:`assign`})},9994:function(e,t,n){var r=n(9618),i=n(8277);e.exports=function(e,t){for(var n=[],a=e,o=1;Array.isArray(a);)n.push(a.length),o*=a.length,a=a[0];return n.length===0?r():(t||=r(new Float64Array(o),n),i(t,e),t)}},8277:function(e){function t(){return function(e,t,n,r,i){var a=e[0],o=e[1],s=e[2],c=n[0],l=n[1],u=n[2],d=[0,0,0];r|=0;var f=0,p=0,m=0,h=u,g=l-s*u,_=c-o*l;for(m=0;m<a;++m){for(p=0;p<o;++p){for(f=0;f<s;++f){var v=i,y;for(y=0;y<d.length-1;++y)v=v[d[y]];t[r]=v[d[d.length-1]],r+=h,++d[2]}r+=g,d[2]-=s,++d[1]}r+=_,d[1]-=o,++d[0]}}}function n(){return t()}var r=n;function i(e){var t={};return function(n,r){var i=n.dtype,a=n.order,o=[i,a.join()].join(),s=t[o];return s||(t[o]=s=e([i,a])),s(n.shape.slice(0),n.data,n.stride,n.offset|0,r)}}function a(e){return i(r.bind(void 0,e))}function o(e){return a({funcName:e.funcName})}e.exports=o({funcName:`convert`})},7640:function(e,t,n){var r=n(1888);function i(e){switch(e){case`uint32`:return[r.mallocUint32,r.freeUint32];default:return null}}var a={"uint32,1,0":function(e,t){return function(n,r,i,a,o,s,c,l,u,d,f){var p,m,h,g=n*o+a,_,v=e(l),y,b,x,S;for(p=n+1;p<=r;++p){for(m=p,g+=o,h=g,y=0,b=g,_=0;_<l;++_)v[y++]=i[b],b+=u;e:for(;m-- >n;){y=0,b=h-o;t:for(_=0;_<l;++_){if(x=i[b],S=v[y],x<S)break e;if(x>S)break t;b+=d,y+=f}for(y=h,b=h-o,_=0;_<l;++_)i[y]=i[b],y+=u,b+=u;h-=o}for(y=h,b=0,_=0;_<l;++_)i[y]=v[b++],y+=u}t(v)}}};function o(e,t){var n=i(t),r=a[[t,e].join(`,`)];return n?r(n[0],n[1]):r()}var s={"uint32,1,0":function(e,t,n){return function r(i,a,o,s,c,l,u,d,f,p,m){var h=(a-i+1)/6|0,g=i+h,_=a-h,v=i+a>>1,y=v-h,b=v+h,x=g,S=y,C=v,w=b,T=_,E=i+1,D=a-1,O=!0,k,A,j,M,N,P,F,I,L,R=0,z=0,B=0,V,H,U,W,G,K,q,J,Y,X,Z,Q,ee,te,ne,re,ie=d,ae=t(ie),oe=t(ie);H=c*x,U=c*S,re=s;e:for(V=0;V<d;++V){if(F=H+re,I=U+re,B=o[F]-o[I],B>0){A=x,x=S,S=A;break e}if(B<0)break e;re+=p}H=c*w,U=c*T,re=s;e:for(V=0;V<d;++V){if(F=H+re,I=U+re,B=o[F]-o[I],B>0){A=w,w=T,T=A;break e}if(B<0)break e;re+=p}H=c*x,U=c*C,re=s;e:for(V=0;V<d;++V){if(F=H+re,I=U+re,B=o[F]-o[I],B>0){A=x,x=C,C=A;break e}if(B<0)break e;re+=p}H=c*S,U=c*C,re=s;e:for(V=0;V<d;++V){if(F=H+re,I=U+re,B=o[F]-o[I],B>0){A=S,S=C,C=A;break e}if(B<0)break e;re+=p}H=c*x,U=c*w,re=s;e:for(V=0;V<d;++V){if(F=H+re,I=U+re,B=o[F]-o[I],B>0){A=x,x=w,w=A;break e}if(B<0)break e;re+=p}H=c*C,U=c*w,re=s;e:for(V=0;V<d;++V){if(F=H+re,I=U+re,B=o[F]-o[I],B>0){A=C,C=w,w=A;break e}if(B<0)break e;re+=p}H=c*S,U=c*T,re=s;e:for(V=0;V<d;++V){if(F=H+re,I=U+re,B=o[F]-o[I],B>0){A=S,S=T,T=A;break e}if(B<0)break e;re+=p}H=c*S,U=c*C,re=s;e:for(V=0;V<d;++V){if(F=H+re,I=U+re,B=o[F]-o[I],B>0){A=S,S=C,C=A;break e}if(B<0)break e;re+=p}H=c*w,U=c*T,re=s;e:for(V=0;V<d;++V){if(F=H+re,I=U+re,B=o[F]-o[I],B>0){A=w,w=T,T=A;break e}if(B<0)break e;re+=p}for(H=c*x,U=c*S,W=c*C,G=c*w,K=c*T,q=c*g,J=c*v,Y=c*_,ne=0,re=s,V=0;V<d;++V)F=H+re,I=U+re,L=W+re,X=G+re,Z=K+re,Q=q+re,ee=J+re,te=Y+re,ae[ne]=o[I],oe[ne]=o[X],O&&=ae[ne]===oe[ne],j=o[F],M=o[L],N=o[Z],o[Q]=j,o[ee]=M,o[te]=N,++ne,re+=f;for(H=c*y,U=c*i,re=s,V=0;V<d;++V)F=H+re,I=U+re,o[F]=o[I],re+=f;for(H=c*b,U=c*a,re=s,V=0;V<d;++V)F=H+re,I=U+re,o[F]=o[I],re+=f;if(O)for(P=E;P<=D;++P){F=s+P*c,ne=0;e:for(V=0;V<d;++V){if(B=o[F]-ae[ne],B!==0)break e;ne+=m,F+=p}if(B!==0)if(B<0){if(P!==E)for(H=c*P,U=c*E,re=s,V=0;V<d;++V)F=H+re,I=U+re,k=o[F],o[F]=o[I],o[I]=k,re+=f;++E}else for(;;){F=s+D*c,ne=0;e:for(V=0;V<d;++V){if(B=o[F]-ae[ne],B!==0)break e;ne+=m,F+=p}if(B>0)D--;else if(B<0){for(H=c*P,U=c*E,W=c*D,re=s,V=0;V<d;++V)F=H+re,I=U+re,L=W+re,k=o[F],o[F]=o[I],o[I]=o[L],o[L]=k,re+=f;++E,--D;break}else{for(H=c*P,U=c*D,re=s,V=0;V<d;++V)F=H+re,I=U+re,k=o[F],o[F]=o[I],o[I]=k,re+=f;--D;break}}}else for(P=E;P<=D;++P){F=s+P*c,ne=0;e:for(V=0;V<d;++V){if(R=o[F]-ae[ne],R!==0)break e;ne+=m,F+=p}if(R<0){if(P!==E)for(H=c*P,U=c*E,re=s,V=0;V<d;++V)F=H+re,I=U+re,k=o[F],o[F]=o[I],o[I]=k,re+=f;++E}else{F=s+P*c,ne=0;e:for(V=0;V<d;++V){if(z=o[F]-oe[ne],z!==0)break e;ne+=m,F+=p}if(z>0)for(;;){F=s+D*c,ne=0;e:for(V=0;V<d;++V){if(B=o[F]-oe[ne],B!==0)break e;ne+=m,F+=p}if(B>0){if(--D<P)break;continue}else{F=s+D*c,ne=0;e:for(V=0;V<d;++V){if(B=o[F]-ae[ne],B!==0)break e;ne+=m,F+=p}if(B<0){for(H=c*P,U=c*E,W=c*D,re=s,V=0;V<d;++V)F=H+re,I=U+re,L=W+re,k=o[F],o[F]=o[I],o[I]=o[L],o[L]=k,re+=f;++E,--D}else{for(H=c*P,U=c*D,re=s,V=0;V<d;++V)F=H+re,I=U+re,k=o[F],o[F]=o[I],o[I]=k,re+=f;--D}break}}}}for(H=c*i,U=c*(E-1),ne=0,re=s,V=0;V<d;++V)F=H+re,I=U+re,o[F]=o[I],o[I]=ae[ne],++ne,re+=f;for(H=c*a,U=c*(D+1),ne=0,re=s,V=0;V<d;++V)F=H+re,I=U+re,o[F]=o[I],o[I]=oe[ne],++ne,re+=f;if(E-2-i<=32?e(i,E-2,o,s,c,l,u,d,f,p,m):r(i,E-2,o,s,c,l,u,d,f,p,m),a-(D+2)<=32?e(D+2,a,o,s,c,l,u,d,f,p,m):r(D+2,a,o,s,c,l,u,d,f,p,m),O){n(ae),n(oe);return}if(E<g&&D>_){e:for(;;){for(F=s+E*c,ne=0,re=s,V=0;V<d;++V){if(o[F]!==ae[ne])break e;++ne,F+=f}++E}e:for(;;){for(F=s+D*c,ne=0,re=s,V=0;V<d;++V){if(o[F]!==oe[ne])break e;++ne,F+=f}--D}for(P=E;P<=D;++P){F=s+P*c,ne=0;e:for(V=0;V<d;++V){if(R=o[F]-ae[ne],R!==0)break e;ne+=m,F+=p}if(R===0){if(P!==E)for(H=c*P,U=c*E,re=s,V=0;V<d;++V)F=H+re,I=U+re,k=o[F],o[F]=o[I],o[I]=k,re+=f;++E}else{F=s+P*c,ne=0;e:for(V=0;V<d;++V){if(z=o[F]-oe[ne],z!==0)break e;ne+=m,F+=p}if(z===0)for(;;){F=s+D*c,ne=0;e:for(V=0;V<d;++V){if(B=o[F]-oe[ne],B!==0)break e;ne+=m,F+=p}if(B===0){if(--D<P)break;continue}else{F=s+D*c,ne=0;e:for(V=0;V<d;++V){if(B=o[F]-ae[ne],B!==0)break e;ne+=m,F+=p}if(B<0){for(H=c*P,U=c*E,W=c*D,re=s,V=0;V<d;++V)F=H+re,I=U+re,L=W+re,k=o[F],o[F]=o[I],o[I]=o[L],o[L]=k,re+=f;++E,--D}else{for(H=c*P,U=c*D,re=s,V=0;V<d;++V)F=H+re,I=U+re,k=o[F],o[F]=o[I],o[I]=k,re+=f;--D}break}}}}}n(ae),n(oe),D-E<=32?e(E,D,o,s,c,l,u,d,f,p,m):r(E,D,o,s,c,l,u,d,f,p,m)}}};function c(e,t,n){var r=i(t),a=s[[t,e].join(`,`)];return e.length>1&&r?a(n,r[0],r[1]):a(n)}var l={"uint32,1,0":function(e,t){return function(n){var r=n.data,i=n.offset|0,a=n.shape,o=n.stride,s=o[0]|0,c=a[0]|0,l=o[1]|0,u=a[1]|0,d=l,f=l,p=1;c<=32?e(0,c-1,r,i,s,l,c,u,d,f,p):t(0,c-1,r,i,s,l,c,u,d,f,p)}}};function u(e,t){var n=l[[t,e].join(`,`)],r=o(e,t);return n(r,c(e,t,r))}e.exports=u},446:function(e,t,n){var r=n(7640),i={};function a(e){var t=e.order,n=e.dtype,a=[t,n].join(`:`),o=i[a];return o||(i[a]=o=r(t,n)),o(e),e}e.exports=a},9618:function(e,t,n){var r=n(7163),i=typeof Float64Array<`u`;function a(e,t){return e[0]-t[0]}function o(){var e=this.stride,t=Array(e.length),n;for(n=0;n<t.length;++n)t[n]=[Math.abs(e[n]),n];t.sort(a);var r=Array(t.length);for(n=0;n<r.length;++n)r[n]=t[n][1];return r}var s={T:function(e){function t(e){this.data=e}var n=t.prototype;return n.dtype=e,n.index=function(){return-1},n.size=0,n.dimension=-1,n.shape=n.stride=n.order=[],n.lo=n.hi=n.transpose=n.step=function(){return new t(this.data)},n.get=n.set=function(){},n.pick=function(){return null},function(e){return new t(e)}},0:function(e,t){function n(e,t){this.data=e,this.offset=t}var r=n.prototype;return r.dtype=e,r.index=function(){return this.offset},r.dimension=0,r.size=1,r.shape=r.stride=r.order=[],r.lo=r.hi=r.transpose=r.step=function(){return new n(this.data,this.offset)},r.pick=function(){return t(this.data)},r.valueOf=r.get=function(){return e===`generic`?this.data.get(this.offset):this.data[this.offset]},r.set=function(t){return e===`generic`?this.data.set(this.offset,t):this.data[this.offset]=t},function(e,t,r,i){return new n(e,i)}},1:function(e,t,n){function r(e,t,n,r){this.data=e,this.shape=[t],this.stride=[n],this.offset=r|0}var i=r.prototype;return i.dtype=e,i.dimension=1,Object.defineProperty(i,`size`,{get:function(){return this.shape[0]}}),i.order=[0],i.set=function(t,n){return e===`generic`?this.data.set(this.offset+this.stride[0]*t,n):this.data[this.offset+this.stride[0]*t]=n},i.get=function(t){return e===`generic`?this.data.get(this.offset+this.stride[0]*t):this.data[this.offset+this.stride[0]*t]},i.index=function(e){return this.offset+this.stride[0]*e},i.hi=function(e){return new r(this.data,typeof e!=`number`||e<0?this.shape[0]:e|0,this.stride[0],this.offset)},i.lo=function(e){var t=this.offset,n=0,i=this.shape[0],a=this.stride[0];return typeof e==`number`&&e>=0&&(n=e|0,t+=a*n,i-=n),new r(this.data,i,a,t)},i.step=function(e){var t=this.shape[0],n=this.stride[0],i=this.offset,a=0,o=Math.ceil;return typeof e==`number`&&(a=e|0,a<0?(i+=n*(t-1),t=o(-t/a)):t=o(t/a),n*=a),new r(this.data,t,n,i)},i.transpose=function(e){e=e===void 0?0:e|0;var t=this.shape,n=this.stride;return new r(this.data,t[e],n[e],this.offset)},i.pick=function(e){var n=[],r=[],i=this.offset;typeof e==`number`&&e>=0?i=i+this.stride[0]*e|0:(n.push(this.shape[0]),r.push(this.stride[0]));var a=t[n.length+1];return a(this.data,n,r,i)},function(e,t,n,i){return new r(e,t[0],n[0],i)}},2:function(e,t,n){function r(e,t,n,r,i,a){this.data=e,this.shape=[t,n],this.stride=[r,i],this.offset=a|0}var i=r.prototype;return i.dtype=e,i.dimension=2,Object.defineProperty(i,`size`,{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,`order`,{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(t,n,r){return e===`generic`?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*n,r):this.data[this.offset+this.stride[0]*t+this.stride[1]*n]=r},i.get=function(t,n){return e===`generic`?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*n):this.data[this.offset+this.stride[0]*t+this.stride[1]*n]},i.index=function(e,t){return this.offset+this.stride[0]*e+this.stride[1]*t},i.hi=function(e,t){return new r(this.data,typeof e!=`number`||e<0?this.shape[0]:e|0,typeof t!=`number`||t<0?this.shape[1]:t|0,this.stride[0],this.stride[1],this.offset)},i.lo=function(e,t){var n=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],c=this.stride[1];return typeof e==`number`&&e>=0&&(i=e|0,n+=s*i,a-=i),typeof t==`number`&&t>=0&&(i=t|0,n+=c*i,o-=i),new r(this.data,a,o,s,c,n)},i.step=function(e,t){var n=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,c=0,l=Math.ceil;return typeof e==`number`&&(c=e|0,c<0?(s+=a*(n-1),n=l(-n/c)):n=l(n/c),a*=c),typeof t==`number`&&(c=t|0,c<0?(s+=o*(i-1),i=l(-i/c)):i=l(i/c),o*=c),new r(this.data,n,i,a,o,s)},i.transpose=function(e,t){e=e===void 0?0:e|0,t=t===void 0?1:t|0;var n=this.shape,i=this.stride;return new r(this.data,n[e],n[t],i[e],i[t],this.offset)},i.pick=function(e,n){var r=[],i=[],a=this.offset;typeof e==`number`&&e>=0?a=a+this.stride[0]*e|0:(r.push(this.shape[0]),i.push(this.stride[0])),typeof n==`number`&&n>=0?a=a+this.stride[1]*n|0:(r.push(this.shape[1]),i.push(this.stride[1]));var o=t[r.length+1];return o(this.data,r,i,a)},function(e,t,n,i){return new r(e,t[0],t[1],n[0],n[1],i)}},3:function(e,t,n){function r(e,t,n,r,i,a,o,s){this.data=e,this.shape=[t,n,r],this.stride=[i,a,o],this.offset=s|0}var i=r.prototype;return i.dtype=e,i.dimension=3,Object.defineProperty(i,`size`,{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,`order`,{get:function(){var e=Math.abs(this.stride[0]),t=Math.abs(this.stride[1]),n=Math.abs(this.stride[2]);return e>t?t>n?[2,1,0]:e>n?[1,2,0]:[1,0,2]:e>n?[2,0,1]:n>t?[0,1,2]:[0,2,1]}}),i.set=function(t,n,r,i){return e===`generic`?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*n+this.stride[2]*r,i):this.data[this.offset+this.stride[0]*t+this.stride[1]*n+this.stride[2]*r]=i},i.get=function(t,n,r){return e===`generic`?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*n+this.stride[2]*r):this.data[this.offset+this.stride[0]*t+this.stride[1]*n+this.stride[2]*r]},i.index=function(e,t,n){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*n},i.hi=function(e,t,n){return new r(this.data,typeof e!=`number`||e<0?this.shape[0]:e|0,typeof t!=`number`||t<0?this.shape[1]:t|0,typeof n!=`number`||n<0?this.shape[2]:n|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(e,t,n){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],c=this.shape[2],l=this.stride[0],u=this.stride[1],d=this.stride[2];return typeof e==`number`&&e>=0&&(a=e|0,i+=l*a,o-=a),typeof t==`number`&&t>=0&&(a=t|0,i+=u*a,s-=a),typeof n==`number`&&n>=0&&(a=n|0,i+=d*a,c-=a),new r(this.data,o,s,c,l,u,d,i)},i.step=function(e,t,n){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],c=this.stride[1],l=this.stride[2],u=this.offset,d=0,f=Math.ceil;return typeof e==`number`&&(d=e|0,d<0?(u+=s*(i-1),i=f(-i/d)):i=f(i/d),s*=d),typeof t==`number`&&(d=t|0,d<0?(u+=c*(a-1),a=f(-a/d)):a=f(a/d),c*=d),typeof n==`number`&&(d=n|0,d<0?(u+=l*(o-1),o=f(-o/d)):o=f(o/d),l*=d),new r(this.data,i,a,o,s,c,l,u)},i.transpose=function(e,t,n){e=e===void 0?0:e|0,t=t===void 0?1:t|0,n=n===void 0?2:n|0;var i=this.shape,a=this.stride;return new r(this.data,i[e],i[t],i[n],a[e],a[t],a[n],this.offset)},i.pick=function(e,n,r){var i=[],a=[],o=this.offset;typeof e==`number`&&e>=0?o=o+this.stride[0]*e|0:(i.push(this.shape[0]),a.push(this.stride[0])),typeof n==`number`&&n>=0?o=o+this.stride[1]*n|0:(i.push(this.shape[1]),a.push(this.stride[1])),typeof r==`number`&&r>=0?o=o+this.stride[2]*r|0:(i.push(this.shape[2]),a.push(this.stride[2]));var s=t[i.length+1];return s(this.data,i,a,o)},function(e,t,n,i){return new r(e,t[0],t[1],t[2],n[0],n[1],n[2],i)}},4:function(e,t,n){function r(e,t,n,r,i,a,o,s,c,l){this.data=e,this.shape=[t,n,r,i],this.stride=[a,o,s,c],this.offset=l|0}var i=r.prototype;return i.dtype=e,i.dimension=4,Object.defineProperty(i,`size`,{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,`order`,{get:n}),i.set=function(t,n,r,i,a){return e===`generic`?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*n+this.stride[2]*r+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*t+this.stride[1]*n+this.stride[2]*r+this.stride[3]*i]=a},i.get=function(t,n,r,i){return e===`generic`?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*n+this.stride[2]*r+this.stride[3]*i):this.data[this.offset+this.stride[0]*t+this.stride[1]*n+this.stride[2]*r+this.stride[3]*i]},i.index=function(e,t,n,r){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*n+this.stride[3]*r},i.hi=function(e,t,n,i){return new r(this.data,typeof e!=`number`||e<0?this.shape[0]:e|0,typeof t!=`number`||t<0?this.shape[1]:t|0,typeof n!=`number`||n<0?this.shape[2]:n|0,typeof i!=`number`||i<0?this.shape[3]:i|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(e,t,n,i){var a=this.offset,o=0,s=this.shape[0],c=this.shape[1],l=this.shape[2],u=this.shape[3],d=this.stride[0],f=this.stride[1],p=this.stride[2],m=this.stride[3];return typeof e==`number`&&e>=0&&(o=e|0,a+=d*o,s-=o),typeof t==`number`&&t>=0&&(o=t|0,a+=f*o,c-=o),typeof n==`number`&&n>=0&&(o=n|0,a+=p*o,l-=o),typeof i==`number`&&i>=0&&(o=i|0,a+=m*o,u-=o),new r(this.data,s,c,l,u,d,f,p,m,a)},i.step=function(e,t,n,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],c=this.shape[3],l=this.stride[0],u=this.stride[1],d=this.stride[2],f=this.stride[3],p=this.offset,m=0,h=Math.ceil;return typeof e==`number`&&(m=e|0,m<0?(p+=l*(a-1),a=h(-a/m)):a=h(a/m),l*=m),typeof t==`number`&&(m=t|0,m<0?(p+=u*(o-1),o=h(-o/m)):o=h(o/m),u*=m),typeof n==`number`&&(m=n|0,m<0?(p+=d*(s-1),s=h(-s/m)):s=h(s/m),d*=m),typeof i==`number`&&(m=i|0,m<0?(p+=f*(c-1),c=h(-c/m)):c=h(c/m),f*=m),new r(this.data,a,o,s,c,l,u,d,f,p)},i.transpose=function(e,t,n,i){e=e===void 0?0:e|0,t=t===void 0?1:t|0,n=n===void 0?2:n|0,i=i===void 0?3:i|0;var a=this.shape,o=this.stride;return new r(this.data,a[e],a[t],a[n],a[i],o[e],o[t],o[n],o[i],this.offset)},i.pick=function(e,n,r,i){var a=[],o=[],s=this.offset;typeof e==`number`&&e>=0?s=s+this.stride[0]*e|0:(a.push(this.shape[0]),o.push(this.stride[0])),typeof n==`number`&&n>=0?s=s+this.stride[1]*n|0:(a.push(this.shape[1]),o.push(this.stride[1])),typeof r==`number`&&r>=0?s=s+this.stride[2]*r|0:(a.push(this.shape[2]),o.push(this.stride[2])),typeof i==`number`&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3]));var c=t[a.length+1];return c(this.data,a,o,s)},function(e,t,n,i){return new r(e,t[0],t[1],t[2],t[3],n[0],n[1],n[2],n[3],i)}},5:function(e,t,n){function r(e,t,n,r,i,a,o,s,c,l,u,d){this.data=e,this.shape=[t,n,r,i,a],this.stride=[o,s,c,l,u],this.offset=d|0}var i=r.prototype;return i.dtype=e,i.dimension=5,Object.defineProperty(i,`size`,{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,`order`,{get:n}),i.set=function(t,n,r,i,a,o){return e===`generic`?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*n+this.stride[2]*r+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*t+this.stride[1]*n+this.stride[2]*r+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(t,n,r,i,a){return e===`generic`?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*n+this.stride[2]*r+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*t+this.stride[1]*n+this.stride[2]*r+this.stride[3]*i+this.stride[4]*a]},i.index=function(e,t,n,r,i){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*n+this.stride[3]*r+this.stride[4]*i},i.hi=function(e,t,n,i,a){return new r(this.data,typeof e!=`number`||e<0?this.shape[0]:e|0,typeof t!=`number`||t<0?this.shape[1]:t|0,typeof n!=`number`||n<0?this.shape[2]:n|0,typeof i!=`number`||i<0?this.shape[3]:i|0,typeof a!=`number`||a<0?this.shape[4]:a|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(e,t,n,i,a){var o=this.offset,s=0,c=this.shape[0],l=this.shape[1],u=this.shape[2],d=this.shape[3],f=this.shape[4],p=this.stride[0],m=this.stride[1],h=this.stride[2],g=this.stride[3],_=this.stride[4];return typeof e==`number`&&e>=0&&(s=e|0,o+=p*s,c-=s),typeof t==`number`&&t>=0&&(s=t|0,o+=m*s,l-=s),typeof n==`number`&&n>=0&&(s=n|0,o+=h*s,u-=s),typeof i==`number`&&i>=0&&(s=i|0,o+=g*s,d-=s),typeof a==`number`&&a>=0&&(s=a|0,o+=_*s,f-=s),new r(this.data,c,l,u,d,f,p,m,h,g,_,o)},i.step=function(e,t,n,i,a){var o=this.shape[0],s=this.shape[1],c=this.shape[2],l=this.shape[3],u=this.shape[4],d=this.stride[0],f=this.stride[1],p=this.stride[2],m=this.stride[3],h=this.stride[4],g=this.offset,_=0,v=Math.ceil;return typeof e==`number`&&(_=e|0,_<0?(g+=d*(o-1),o=v(-o/_)):o=v(o/_),d*=_),typeof t==`number`&&(_=t|0,_<0?(g+=f*(s-1),s=v(-s/_)):s=v(s/_),f*=_),typeof n==`number`&&(_=n|0,_<0?(g+=p*(c-1),c=v(-c/_)):c=v(c/_),p*=_),typeof i==`number`&&(_=i|0,_<0?(g+=m*(l-1),l=v(-l/_)):l=v(l/_),m*=_),typeof a==`number`&&(_=a|0,_<0?(g+=h*(u-1),u=v(-u/_)):u=v(u/_),h*=_),new r(this.data,o,s,c,l,u,d,f,p,m,h,g)},i.transpose=function(e,t,n,i,a){e=e===void 0?0:e|0,t=t===void 0?1:t|0,n=n===void 0?2:n|0,i=i===void 0?3:i|0,a=a===void 0?4:a|0;var o=this.shape,s=this.stride;return new r(this.data,o[e],o[t],o[n],o[i],o[a],s[e],s[t],s[n],s[i],s[a],this.offset)},i.pick=function(e,n,r,i,a){var o=[],s=[],c=this.offset;typeof e==`number`&&e>=0?c=c+this.stride[0]*e|0:(o.push(this.shape[0]),s.push(this.stride[0])),typeof n==`number`&&n>=0?c=c+this.stride[1]*n|0:(o.push(this.shape[1]),s.push(this.stride[1])),typeof r==`number`&&r>=0?c=c+this.stride[2]*r|0:(o.push(this.shape[2]),s.push(this.stride[2])),typeof i==`number`&&i>=0?c=c+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),typeof a==`number`&&a>=0?c=c+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4]));var l=t[o.length+1];return l(this.data,o,s,c)},function(e,t,n,i){return new r(e,t[0],t[1],t[2],t[3],t[4],n[0],n[1],n[2],n[3],n[4],i)}}};function c(e,t){var n=s[t===-1?`T`:String(t)];return t===-1?n(e):t===0?n(e,u[e][0]):n(e,u[e],o)}function l(e){if(r(e))return`buffer`;if(i)switch(Object.prototype.toString.call(e)){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(e)?`array`:`generic`}var u={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function d(e,t,n,r){if(e===void 0){var i=u.array[0];return i([])}else typeof e==`number`&&(e=[e]);t===void 0&&(t=[e.length]);var a=t.length;if(n===void 0){n=Array(a);for(var o=a-1,s=1;o>=0;--o)n[o]=s,s*=t[o]}if(r===void 0){r=0;for(var o=0;o<a;++o)n[o]<0&&(r-=(t[o]-1)*n[o])}for(var d=l(e),f=u[d];f.length<=a+1;)f.push(c(d,f.length-1));var i=f[a+1];return i(e,t,n,r)}e.exports=d},1278:function(e,t,n){var r=n(2361),i=2**-1074,a=-1>>>0;e.exports=o;function o(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(e===0)return t<0?-i:i;var n=r.hi(e),o=r.lo(e);return t>e==e>0?o===a?(n+=1,o=0):o+=1:o===0?(o=a,--n):--o,r.pack(o,n)}},8406:function(e,t){var n=1e-6,r=1e-6;t.vertexNormals=function(e,t,r){for(var i=t.length,a=Array(i),o=r===void 0?n:r,s=0;s<i;++s)a[s]=[0,0,0];for(var s=0;s<e.length;++s)for(var c=e[s],l=0,u=c[c.length-1],d=c[0],f=0;f<c.length;++f){l=u,u=d,d=c[(f+1)%c.length];for(var p=t[l],m=t[u],h=t[d],g=[,,,],_=0,v=[,,,],y=0,b=0;b<3;++b)g[b]=p[b]-m[b],_+=g[b]*g[b],v[b]=h[b]-m[b],y+=v[b]*v[b];if(_*y>o)for(var x=a[u],S=1/Math.sqrt(_*y),b=0;b<3;++b){var C=(b+1)%3,w=(b+2)%3;x[b]+=S*(v[C]*g[w]-v[w]*g[C])}}for(var s=0;s<i;++s){for(var x=a[s],T=0,b=0;b<3;++b)T+=x[b]*x[b];if(T>o)for(var S=1/Math.sqrt(T),b=0;b<3;++b)x[b]*=S;else for(var b=0;b<3;++b)x[b]=0}return a},t.faceNormals=function(e,t,n){for(var i=e.length,a=Array(i),o=n===void 0?r:n,s=0;s<i;++s){for(var c=e[s],l=[,,,],u=0;u<3;++u)l[u]=t[c[u]];for(var d=[,,,],f=[,,,],u=0;u<3;++u)d[u]=l[1][u]-l[0][u],f[u]=l[2][u]-l[0][u];for(var p=[,,,],m=0,u=0;u<3;++u){var h=(u+1)%3,g=(u+2)%3;p[u]=d[h]*f[g]-d[g]*f[h],m+=p[u]*p[u]}m=m>o?1/Math.sqrt(m):0;for(var u=0;u<3;++u)p[u]*=m;a[s]=p}return a}},4081:function(e){e.exports=t;function t(e,t,n,r,i,a,o,s,c,l){var u=t+a+l;if(d>0){var d=Math.sqrt(u+1);e[0]=.5*(o-c)/d,e[1]=.5*(s-r)/d,e[2]=.5*(n-a)/d,e[3]=.5*d}else{var f=Math.max(t,a,l),d=Math.sqrt(2*f-u+1);t>=f?(e[0]=.5*d,e[1]=.5*(i+n)/d,e[2]=.5*(s+r)/d,e[3]=.5*(o-c)/d):a>=f?(e[0]=.5*(n+i)/d,e[1]=.5*d,e[2]=.5*(c+o)/d,e[3]=.5*(s-r)/d):(e[0]=.5*(r+s)/d,e[1]=.5*(o+c)/d,e[2]=.5*d,e[3]=.5*(n-i)/d)}return e}},9977:function(e,t,n){e.exports=p;var r=n(9215),i=n(6582),a=n(7399),o=n(7608),s=n(4081);function c(e,t,n){return Math.sqrt(e**2+t**2+n**2)}function l(e,t,n,r){return Math.sqrt(e**2+t**2+n**2+r**2)}function u(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=l(n,r,i,a);o>1e-6?(e[0]=n/o,e[1]=r/o,e[2]=i/o,e[3]=a/o):(e[0]=e[1]=e[2]=0,e[3]=1)}function d(e,t,n){this.radius=r([n]),this.center=r(t),this.rotation=r(e),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 f=d.prototype;f.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},f.recalcMatrix=function(e){this.radius.curve(e),this.center.curve(e),this.rotation.curve(e);var t=this.computedRotation;u(t,t);var n=this.computedMatrix;a(n,t);var r=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=r[0]+s*n[2],i[1]=r[1]+s*n[6],i[2]=r[2]+s*n[10],o[0]=n[1],o[1]=n[5],o[2]=n[9];for(var c=0;c<3;++c){for(var l=0,d=0;d<3;++d)l+=n[c+4*d]*i[d];n[12+c]=-l}},f.getMatrix=function(e,t){this.recalcMatrix(e);var n=this.computedMatrix;if(t){for(var r=0;r<16;++r)t[r]=n[r];return t}return n},f.idle=function(e){this.center.idle(e),this.radius.idle(e),this.rotation.idle(e)},f.flush=function(e){this.center.flush(e),this.radius.flush(e),this.rotation.flush(e)},f.pan=function(e,t,n,r){t||=0,n||=0,r||=0,this.recalcMatrix(e);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],d=i[4],f=i[8],p=u*a+d*o+f*s;u-=a*p,d-=o*p,f-=s*p;var m=c(u,d,f);u/=m,d/=m,f/=m;var h=i[2],g=i[6],_=i[10],v=h*a+g*o+_*s,y=h*u+g*d+_*f;h-=v*a+y*u,g-=v*o+y*d,_-=v*s+y*f;var b=c(h,g,_);h/=b,g/=b,_/=b;var x=u*t+a*n,S=d*t+o*n,C=f*t+s*n;this.center.move(e,x,S,C);var w=Math.exp(this.computedRadius[0]);w=Math.max(1e-4,w+r),this.radius.set(e,Math.log(w))},f.rotate=function(e,t,n,r){this.recalcMatrix(e),t||=0,n||=0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],u=i[1],d=i[5],f=i[9],p=i[2],m=i[6],h=i[10],g=t*a+n*u,_=t*o+n*d,v=t*s+n*f,y=-(m*v-h*_),b=-(h*g-p*v),x=-(p*_-m*g),S=Math.sqrt(Math.max(0,1-y**2-b**2-x**2)),C=l(y,b,x,S);C>1e-6?(y/=C,b/=C,x/=C,S/=C):(y=b=x=0,S=1);var w=this.computedRotation,T=w[0],E=w[1],D=w[2],O=w[3],k=T*S+O*y+E*x-D*b,A=E*S+O*b+D*y-T*x,j=D*S+O*x+T*b-E*y,M=O*S-T*y-E*b-D*x;if(r){y=p,b=m,x=h;var N=Math.sin(r)/c(y,b,x);y*=N,b*=N,x*=N,S=Math.cos(t),k=k*S+M*y+A*x-j*b,A=A*S+M*b+j*y-k*x,j=j*S+M*x+k*b-A*y,M=M*S-k*y-A*b-j*x}var P=l(k,A,j,M);P>1e-6?(k/=P,A/=P,j/=P,M/=P):(k=A=j=0,M=1),this.rotation.set(e,k,A,j,M)},f.lookAt=function(e,t,n,r){this.recalcMatrix(e),n||=this.computedCenter,t||=this.computedEye,r||=this.computedUp;var a=this.computedMatrix;i(a,t,n,r);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),u(o,o),this.rotation.set(e,o[0],o[1],o[2],o[3]);for(var c=0,l=0;l<3;++l)c+=(n[l]-t[l])**2;this.radius.set(e,.5*Math.log(Math.max(c,1e-6))),this.center.set(e,n[0],n[1],n[2])},f.translate=function(e,t,n,r){this.center.move(e,t||0,n||0,r||0)},f.setMatrix=function(e,t){var n=this.computedRotation;s(n,t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]),u(n,n),this.rotation.set(e,n[0],n[1],n[2],n[3]);var r=this.computedMatrix;o(r,t);var i=r[15];if(Math.abs(i)>1e-6){var a=r[12]/i,c=r[13]/i,l=r[14]/i;this.recalcMatrix(e);var d=Math.exp(this.computedRadius[0]);this.center.set(e,a-r[2]*d,c-r[6]*d,l-r[10]*d),this.radius.idle(e)}else this.center.idle(e),this.radius.idle(e)},f.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},f.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},f.getDistanceLimits=function(e){var t=this.radius.bounds;return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},f.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]}},f.fromJSON=function(e){var t=this.lastT(),n=e.center;n&&this.center.set(t,n[0],n[1],n[2]);var r=e.rotation;r&&this.rotation.set(t,r[0],r[1],r[2],r[3]);var i=e.distance;i&&i>0&&this.radius.set(t,Math.log(i)),this.setDistanceLimits(e.zoomMin,e.zoomMax)};function p(e){e||={};var t=e.center||[0,0,0],n=e.rotation||[0,0,0,1],r=e.radius||1;t=[].slice.call(t,0,3),n=[].slice.call(n,0,4),u(n,n);var i=new d(n,t,Math.log(r));return i.setDistanceLimits(e.zoomMin,e.zoomMax),(`eye`in e||`up`in e)&&i.lookAt(0,e.eye,e.center,e.up),i}},1371:function(e,t,n){var r=n(3233);e.exports=function(e,t,n){return n=n===void 0?` `:n+``,r(n,t)+e}},3202:function(e){e.exports=function(e,t){return t||=[0,``],e=String(e),t[0]=parseFloat(e,10),t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||``,t}},3088:function(e,t,n){e.exports=i;var r=n(3140);function i(e,t){for(var n=t.length|0,i=e.length,a=[Array(n),Array(n)],o=0;o<n;++o)a[0][o]=[],a[1][o]=[];for(var o=0;o<i;++o){var s=e[o];a[0][s[0]].push(s),a[1][s[1]].push(s)}for(var c=[],o=0;o<n;++o)a[0][o].length+a[1][o].length===0&&c.push([o]);function l(e,t){var n=a[t][e[t]];n.splice(n.indexOf(e),1)}function u(e,n,i){for(var o,s,c,u=0;u<2;++u)if(a[u][n].length>0){o=a[u][n][0],c=u;break}s=o[c^1];for(var d=0;d<2;++d)for(var f=a[d][n],p=0;p<f.length;++p){var m=f[p],h=m[d^1];r(t[e],t[n],t[s],t[h])>0&&(o=m,s=h,c=d)}return i||o&&l(o,c),s}function d(e,n){var i=a[n][e][0],o=[e];l(i,n);for(var s=i[n^1];;){for(;s!==e;)o.push(s),s=u(o[o.length-2],s,!1);if(a[0][e].length+a[1][e].length===0)break;var c=o[o.length-1],d=e,f=o[1],p=u(c,d,!0);if(r(t[c],t[d],t[f],t[p])<0)break;o.push(e),s=u(c,d)}return o}function f(e,t){return t[1]===t[t.length-1]}for(var o=0;o<n;++o)for(var p=0;p<2;++p){for(var m=[];a[p][o].length>0;){a[0][o].length;var h=d(o,p);f(m,h)?m.push.apply(m,h):(m.length>0&&c.push(m),m=h)}m.length>0&&c.push(m)}return c}},5609:function(e,t,n){e.exports=i;var r=n(3134);function i(e,t){for(var n=r(e,t.length),i=Array(t.length),a=Array(t.length),o=[],s=0;s<t.length;++s){var c=n[s].length;a[s]=c,i[s]=!0,c<=1&&o.push(s)}for(;o.length>0;){var l=o.pop();i[l]=!1;for(var u=n[l],s=0;s<u.length;++s){var d=u[s];--a[d]===0&&o.push(d)}}for(var f=Array(t.length),p=[],s=0;s<t.length;++s)if(i[s]){var l=p.length;f[s]=l,p.push(t[s])}else f[s]=-1;for(var m=[],s=0;s<e.length;++s){var h=e[s];i[h[0]]&&i[h[1]]&&m.push([f[h[0]],f[h[1]]])}return[m,p]}},2095:function(e,t,n){e.exports=f;var r=n(3134),i=n(3088),a=n(5085),o=n(5250),s=n(8210),c=n(1682),l=n(5609);function u(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=t;return n}function d(e){for(var t=Array(e),n=0;n<e;++n)t[n]=[];return t}function f(e,t){var n=l(e,t);e=n[0],t=n[1];for(var f=t.length,p=e.length,m=r(e,t.length),h=0;h<f;++h)if(m[h].length%2==1)throw Error(`planar-graph-to-polyline: graph must be manifold`);var g=i(e,t);function _(e){for(var n=e.length,r=[0],i=0;i<n;++i){var a=t[e[i]],c=t[e[(i+1)%n]],l=o(-a[0],a[1]),u=o(-a[0],c[1]),d=o(c[0],a[1]),f=o(c[0],c[1]);r=s(r,s(s(l,u),s(d,f)))}return r[r.length-1]>0}g=g.filter(_);for(var v=g.length,y=Array(v),b=Array(v),h=0;h<v;++h){y[h]=h;var x=Array(v),S=a([g[h].map(function(e){return t[e]})]),C=0;e:for(var w=0;w<v;++w)if(x[w]=0,h!==w){for(var T=g[w],E=T.length,D=0;D<E;++D){var O=S(t[T[D]]);if(O!==0){O<0&&(x[w]=1,C+=1);continue e}}x[w]=1,C+=1}b[h]=[C,h,x]}b.sort(function(e,t){return t[0]-e[0]});for(var h=0;h<v;++h)for(var x=b[h],k=x[1],A=x[2],w=0;w<v;++w)A[w]&&(y[w]=k);for(var j=d(v),h=0;h<v;++h)j[h].push(y[h]),j[y[h]].push(h);for(var M={},N=u(f,!1),h=0;h<v;++h)for(var T=g[h],E=T.length,w=0;w<E;++w){var P=T[w],F=T[(w+1)%E],I=Math.min(P,F)+`:`+Math.max(P,F);if(I in M){var L=M[I];j[L].push(h),j[h].push(L),N[P]=N[F]=!0}else M[I]=h}function R(e){for(var t=e.length,n=0;n<t;++n)if(!N[e[n]])return!1;return!0}for(var z=[],B=u(v,-1),h=0;h<v;++h)y[h]===h&&!R(g[h])?(z.push(h),B[h]=0):B[h]=-1;for(var n=[];z.length>0;){var V=z.pop(),H=j[V];c(H,function(e,t){return e-t});var U=H.length,W=B[V],G;if(W===0){var T=g[V];G=[T]}for(var h=0;h<U;++h){var K=H[h];if(!(B[K]>=0)&&(B[K]=W^1,z.push(K),W===0)){var T=g[K];R(T)||(T.reverse(),G.push(T))}}W===0&&n.push(G)}return n}},5085:function(e,t,n){e.exports=m;var r=n(3250)[3],i=n(4209),a=n(3352),o=n(2478);function s(){return!0}function c(e){return function(t,n){var r=e[t];return r?!!r.queryPoint(n,s):!1}}function l(e){for(var t={},n=0;n<e.length;++n){var r=e[n],i=r[0][0],o=r[0][1],s=r[1][1],l=[Math.min(o,s),Math.max(o,s)];i in t?t[i].push(l):t[i]=[l]}for(var u={},d=Object.keys(t),n=0;n<d.length;++n){var f=t[d[n]];u[d[n]]=a(f)}return c(u)}function u(e,t){return function(n){var i=o.le(t,n[0]);if(i<0)return 1;var a=e[i];if(!a)if(i>0&&t[i]===n[0])a=e[i-1];else return 1;for(var s=1;a;){var c=a.key,l=r(n,c[0],c[1]);if(c[0][0]<c[1][0])if(l<0)a=a.left;else if(l>0)s=-1,a=a.right;else return 0;else if(l>0)a=a.left;else if(l<0)s=1,a=a.right;else return 0}return s}}function d(e){return 1}function f(e){return function(t){return e(t[0],t[1])?0:1}}function p(e,t){return function(n){return e(n[0],n[1])?0:t(n)}}function m(e){for(var t=e.length,n=[],r=[],a=0;a<t;++a)for(var o=e[a],s=o.length,c=s-1,m=0;m<s;c=m++){var h=o[c],g=o[m];h[0]===g[0]?r.push([h,g]):n.push([h,g])}if(n.length===0)return r.length===0?d:f(l(r));var _=i(n),v=u(_.slabs,_.coordinates);return r.length===0?v:p(l(r),v)}},9346:function(e){var t=new Float64Array(4),n=new Float64Array(4),r=new Float64Array(4);function i(e,i,a,o,s){t.length<o.length&&(t=new Float64Array(o.length),n=new Float64Array(o.length),r=new Float64Array(o.length));for(var c=0;c<o.length;++c)t[c]=e[c]-o[c],n[c]=i[c]-e[c],r[c]=a[c]-e[c];for(var l=0,u=0,d=0,f=0,p=0,m=0,c=0;c<o.length;++c){var h=n[c],g=r[c],_=t[c];l+=h*h,u+=h*g,d+=g*g,f+=_*h,p+=_*g,m+=_*_}var v=Math.abs(l*d-u*u),y=u*p-d*f,b=u*f-l*p,x;if(y+b<=v)if(y<0)b<0&&f<0?(b=0,-f>=l?(y=1,x=l+2*f+m):(y=-f/l,x=f*y+m)):(y=0,p>=0?(b=0,x=m):-p>=d?(b=1,x=d+2*p+m):(b=-p/d,x=p*b+m));else if(b<0)b=0,f>=0?(y=0,x=m):-f>=l?(y=1,x=l+2*f+m):(y=-f/l,x=f*y+m);else{var S=1/v;y*=S,b*=S,x=y*(l*y+u*b+2*f)+b*(u*y+d*b+2*p)+m}else{var C,w,T,E;y<0?(C=u+f,w=d+p,w>C?(T=w-C,E=l-2*u+d,T>=E?(y=1,b=0,x=l+2*f+m):(y=T/E,b=1-y,x=y*(l*y+u*b+2*f)+b*(u*y+d*b+2*p)+m)):(y=0,w<=0?(b=1,x=d+2*p+m):p>=0?(b=0,x=m):(b=-p/d,x=p*b+m))):b<0?(C=u+p,w=l+f,w>C?(T=w-C,E=l-2*u+d,T>=E?(b=1,y=0,x=d+2*p+m):(b=T/E,y=1-b,x=y*(l*y+u*b+2*f)+b*(u*y+d*b+2*p)+m)):(b=0,w<=0?(y=1,x=l+2*f+m):f>=0?(y=0,x=m):(y=-f/l,x=f*y+m))):(T=d+p-u-f,T<=0?(y=0,b=1,x=d+2*p+m):(E=l-2*u+d,T>=E?(y=1,b=0,x=l+2*f+m):(y=T/E,b=1-y,x=y*(l*y+u*b+2*f)+b*(u*y+d*b+2*p)+m)))}for(var D=1-y-b,c=0;c<o.length;++c)s[c]=D*e[c]+y*i[c]+b*a[c];return x<0?0:x}e.exports=i},8648:function(e,t,n){e.exports=n(783)},2653:function(e,t,n){var r=n(3865);e.exports=i;function i(e,t){for(var n=e.length,i=Array(n),a=0;a<n;++a)i[a]=r(e[a],t[a]);return i}},5838:function(e,t,n){e.exports=i;var r=n(7842);function i(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=r(e[n]);return t}},8987:function(e,t,n){var r=n(7842),i=n(6504);e.exports=a;function a(e,t){for(var n=r(t),a=e.length,o=Array(a),s=0;s<a;++s)o[s]=i(e[s],n);return o}},544:function(e,t,n){var r=n(5572);e.exports=i;function i(e,t){for(var n=e.length,i=Array(n),a=0;a<n;++a)i[a]=r(e[a],t[a]);return i}},5771:function(e,t,n){var r=n(8507),i=n(3788),a=n(2419);e.exports=o;function o(e){e.sort(i);for(var t=e.length,n=0,o=0;o<t;++o){var s=e[o],c=a(s);if(c!==0){if(n>0){var l=e[n-1];if(r(s,l)===0&&a(l)!==c){--n;continue}}e[n++]=s}}return e.length=n,e}},3233:function(e){var t=``,n;e.exports=r;function r(e,r){if(typeof e!=`string`)throw TypeError(`expected a string`);if(r===1)return e;if(r===2)return e+e;var i=e.length*r;if(n!==e||n===void 0)n=e,t=``;else if(t.length>=i)return t.substr(0,i);for(;i>t.length&&r>1;)r&1&&(t+=e),r>>=1,e+=e;return t+=e,t=t.substr(0,i),t}},3025:function(e,t,n){e.exports=n.g.performance&&n.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(e){e.exports=t;function t(e){for(var t=e.length,n=e[e.length-1],r=t,i=t-2;i>=0;--i){var a=n,o=e[i];n=a+o;var s=n-a,c=o-s;c&&(e[--r]=n,n=c)}for(var l=0,i=r;i<t;++i){var a=e[i],o=n;n=a+o;var s=n-a,c=o-s;c&&(e[l++]=c)}return e[l++]=n,e.length=l,e}},2962:function(e,t,n){var r=n(5250),i=n(8210),a=n(3012),o=n(7004),s=6;function c(e,t,n,r){return function(t){return r(e(n(t[0][0],t[1][1]),n(-t[0][1],t[1][0])))}}function l(e,t,n,r){return function(i){return r(e(t(e(n(i[1][1],i[2][2]),n(-i[1][2],i[2][1])),i[0][0]),e(t(e(n(i[1][0],i[2][2]),n(-i[1][2],i[2][0])),-i[0][1]),t(e(n(i[1][0],i[2][1]),n(-i[1][1],i[2][0])),i[0][2]))))}}function u(e,t,n,r){return function(i){return r(e(e(t(e(t(e(n(i[2][2],i[3][3]),n(-i[2][3],i[3][2])),i[1][1]),e(t(e(n(i[2][1],i[3][3]),n(-i[2][3],i[3][1])),-i[1][2]),t(e(n(i[2][1],i[3][2]),n(-i[2][2],i[3][1])),i[1][3]))),i[0][0]),t(e(t(e(n(i[2][2],i[3][3]),n(-i[2][3],i[3][2])),i[1][0]),e(t(e(n(i[2][0],i[3][3]),n(-i[2][3],i[3][0])),-i[1][2]),t(e(n(i[2][0],i[3][2]),n(-i[2][2],i[3][0])),i[1][3]))),-i[0][1])),e(t(e(t(e(n(i[2][1],i[3][3]),n(-i[2][3],i[3][1])),i[1][0]),e(t(e(n(i[2][0],i[3][3]),n(-i[2][3],i[3][0])),-i[1][1]),t(e(n(i[2][0],i[3][1]),n(-i[2][1],i[3][0])),i[1][3]))),i[0][2]),t(e(t(e(n(i[2][1],i[3][2]),n(-i[2][2],i[3][1])),i[1][0]),e(t(e(n(i[2][0],i[3][2]),n(-i[2][2],i[3][0])),-i[1][1]),t(e(n(i[2][0],i[3][1]),n(-i[2][1],i[3][0])),i[1][2]))),-i[0][3]))))}}function d(e,t,n,r){return function(i){return r(e(e(t(e(e(t(e(t(e(n(i[3][3],i[4][4]),n(-i[3][4],i[4][3])),i[2][2]),e(t(e(n(i[3][2],i[4][4]),n(-i[3][4],i[4][2])),-i[2][3]),t(e(n(i[3][2],i[4][3]),n(-i[3][3],i[4][2])),i[2][4]))),i[1][1]),t(e(t(e(n(i[3][3],i[4][4]),n(-i[3][4],i[4][3])),i[2][1]),e(t(e(n(i[3][1],i[4][4]),n(-i[3][4],i[4][1])),-i[2][3]),t(e(n(i[3][1],i[4][3]),n(-i[3][3],i[4][1])),i[2][4]))),-i[1][2])),e(t(e(t(e(n(i[3][2],i[4][4]),n(-i[3][4],i[4][2])),i[2][1]),e(t(e(n(i[3][1],i[4][4]),n(-i[3][4],i[4][1])),-i[2][2]),t(e(n(i[3][1],i[4][2]),n(-i[3][2],i[4][1])),i[2][4]))),i[1][3]),t(e(t(e(n(i[3][2],i[4][3]),n(-i[3][3],i[4][2])),i[2][1]),e(t(e(n(i[3][1],i[4][3]),n(-i[3][3],i[4][1])),-i[2][2]),t(e(n(i[3][1],i[4][2]),n(-i[3][2],i[4][1])),i[2][3]))),-i[1][4]))),i[0][0]),t(e(e(t(e(t(e(n(i[3][3],i[4][4]),n(-i[3][4],i[4][3])),i[2][2]),e(t(e(n(i[3][2],i[4][4]),n(-i[3][4],i[4][2])),-i[2][3]),t(e(n(i[3][2],i[4][3]),n(-i[3][3],i[4][2])),i[2][4]))),i[1][0]),t(e(t(e(n(i[3][3],i[4][4]),n(-i[3][4],i[4][3])),i[2][0]),e(t(e(n(i[3][0],i[4][4]),n(-i[3][4],i[4][0])),-i[2][3]),t(e(n(i[3][0],i[4][3]),n(-i[3][3],i[4][0])),i[2][4]))),-i[1][2])),e(t(e(t(e(n(i[3][2],i[4][4]),n(-i[3][4],i[4][2])),i[2][0]),e(t(e(n(i[3][0],i[4][4]),n(-i[3][4],i[4][0])),-i[2][2]),t(e(n(i[3][0],i[4][2]),n(-i[3][2],i[4][0])),i[2][4]))),i[1][3]),t(e(t(e(n(i[3][2],i[4][3]),n(-i[3][3],i[4][2])),i[2][0]),e(t(e(n(i[3][0],i[4][3]),n(-i[3][3],i[4][0])),-i[2][2]),t(e(n(i[3][0],i[4][2]),n(-i[3][2],i[4][0])),i[2][3]))),-i[1][4]))),-i[0][1])),e(t(e(e(t(e(t(e(n(i[3][3],i[4][4]),n(-i[3][4],i[4][3])),i[2][1]),e(t(e(n(i[3][1],i[4][4]),n(-i[3][4],i[4][1])),-i[2][3]),t(e(n(i[3][1],i[4][3]),n(-i[3][3],i[4][1])),i[2][4]))),i[1][0]),t(e(t(e(n(i[3][3],i[4][4]),n(-i[3][4],i[4][3])),i[2][0]),e(t(e(n(i[3][0],i[4][4]),n(-i[3][4],i[4][0])),-i[2][3]),t(e(n(i[3][0],i[4][3]),n(-i[3][3],i[4][0])),i[2][4]))),-i[1][1])),e(t(e(t(e(n(i[3][1],i[4][4]),n(-i[3][4],i[4][1])),i[2][0]),e(t(e(n(i[3][0],i[4][4]),n(-i[3][4],i[4][0])),-i[2][1]),t(e(n(i[3][0],i[4][1]),n(-i[3][1],i[4][0])),i[2][4]))),i[1][3]),t(e(t(e(n(i[3][1],i[4][3]),n(-i[3][3],i[4][1])),i[2][0]),e(t(e(n(i[3][0],i[4][3]),n(-i[3][3],i[4][0])),-i[2][1]),t(e(n(i[3][0],i[4][1]),n(-i[3][1],i[4][0])),i[2][3]))),-i[1][4]))),i[0][2]),e(t(e(e(t(e(t(e(n(i[3][2],i[4][4]),n(-i[3][4],i[4][2])),i[2][1]),e(t(e(n(i[3][1],i[4][4]),n(-i[3][4],i[4][1])),-i[2][2]),t(e(n(i[3][1],i[4][2]),n(-i[3][2],i[4][1])),i[2][4]))),i[1][0]),t(e(t(e(n(i[3][2],i[4][4]),n(-i[3][4],i[4][2])),i[2][0]),e(t(e(n(i[3][0],i[4][4]),n(-i[3][4],i[4][0])),-i[2][2]),t(e(n(i[3][0],i[4][2]),n(-i[3][2],i[4][0])),i[2][4]))),-i[1][1])),e(t(e(t(e(n(i[3][1],i[4][4]),n(-i[3][4],i[4][1])),i[2][0]),e(t(e(n(i[3][0],i[4][4]),n(-i[3][4],i[4][0])),-i[2][1]),t(e(n(i[3][0],i[4][1]),n(-i[3][1],i[4][0])),i[2][4]))),i[1][2]),t(e(t(e(n(i[3][1],i[4][2]),n(-i[3][2],i[4][1])),i[2][0]),e(t(e(n(i[3][0],i[4][2]),n(-i[3][2],i[4][0])),-i[2][1]),t(e(n(i[3][0],i[4][1]),n(-i[3][1],i[4][0])),i[2][2]))),-i[1][4]))),-i[0][3]),t(e(e(t(e(t(e(n(i[3][2],i[4][3]),n(-i[3][3],i[4][2])),i[2][1]),e(t(e(n(i[3][1],i[4][3]),n(-i[3][3],i[4][1])),-i[2][2]),t(e(n(i[3][1],i[4][2]),n(-i[3][2],i[4][1])),i[2][3]))),i[1][0]),t(e(t(e(n(i[3][2],i[4][3]),n(-i[3][3],i[4][2])),i[2][0]),e(t(e(n(i[3][0],i[4][3]),n(-i[3][3],i[4][0])),-i[2][2]),t(e(n(i[3][0],i[4][2]),n(-i[3][2],i[4][0])),i[2][3]))),-i[1][1])),e(t(e(t(e(n(i[3][1],i[4][3]),n(-i[3][3],i[4][1])),i[2][0]),e(t(e(n(i[3][0],i[4][3]),n(-i[3][3],i[4][0])),-i[2][1]),t(e(n(i[3][0],i[4][1]),n(-i[3][1],i[4][0])),i[2][3]))),i[1][2]),t(e(t(e(n(i[3][1],i[4][2]),n(-i[3][2],i[4][1])),i[2][0]),e(t(e(n(i[3][0],i[4][2]),n(-i[3][2],i[4][0])),-i[2][1]),t(e(n(i[3][0],i[4][1]),n(-i[3][1],i[4][0])),i[2][2]))),-i[1][3]))),i[0][4])))))}}function f(e){return(e===2?c:e===3?l:e===4?u:e===5?d:void 0)(i,a,r,o)}var p=[function(){return[0]},function(e){return[e[0][0]]}];function m(e,t,n,r,i,a,o,s){return function(c){switch(c.length){case 0:return e(c);case 1:return t(c);case 2:return n(c);case 3:return r(c);case 4:return i(c);case 5:return a(c)}var l=o[c.length];return l||=o[c.length]=s(c.length),l(c)}}function h(){for(;p.length<s;)p.push(f(p.length));e.exports=m.apply(void 0,p.concat([p,f]));for(var t=0;t<p.length;++t)e.exports[t]=p[t]}h()},1944:function(e,t,n){var r=n(5250),i=n(8210);e.exports=a;function a(e,t){for(var n=r(e[0],t[0]),a=1;a<e.length;++a)n=i(n,r(e[a],t[a]));return n}},2646:function(e,t,n){var r=n(5250),i=n(8210),a=n(8545),o=n(3012),s=6;function c(e){return(e===3?f:e===4?p:e===5?m:h)(i,a,r,o)}function l(){return 0}function u(){return 0}function d(){return 0}function f(e,t,n,r){function i(i,a,o){var s=n(i[0],i[0]),c=r(s,a[0]),l=r(s,o[0]),u=n(a[0],a[0]),d=r(u,i[0]),f=r(u,o[0]),p=n(o[0],o[0]),m=r(p,i[0]),h=t(e(t(r(p,a[0]),f),t(d,c)),t(m,l));return h[h.length-1]}return i}function p(e,t,n,r){function i(i,a,o,s){var c=e(n(i[0],i[0]),n(i[1],i[1])),l=r(c,a[0]),u=r(c,o[0]),d=r(c,s[0]),f=e(n(a[0],a[0]),n(a[1],a[1])),p=r(f,i[0]),m=r(f,o[0]),h=r(f,s[0]),g=e(n(o[0],o[0]),n(o[1],o[1])),_=r(g,i[0]),v=r(g,a[0]),y=r(g,s[0]),b=e(n(s[0],s[0]),n(s[1],s[1])),x=r(b,i[0]),S=r(b,a[0]),C=r(b,o[0]),w=t(e(e(r(t(C,y),a[1]),e(r(t(S,h),-o[1]),r(t(v,m),s[1]))),e(r(t(S,h),i[1]),e(r(t(x,d),-a[1]),r(t(p,l),s[1])))),e(e(r(t(C,y),i[1]),e(r(t(x,d),-o[1]),r(t(_,u),s[1]))),e(r(t(v,m),i[1]),e(r(t(_,u),-a[1]),r(t(p,l),o[1])))));return w[w.length-1]}return i}function m(e,t,n,r){function i(i,a,o,s,c){var l=e(n(i[0],i[0]),e(n(i[1],i[1]),n(i[2],i[2]))),u=r(l,a[0]),d=r(l,o[0]),f=r(l,s[0]),p=r(l,c[0]),m=e(n(a[0],a[0]),e(n(a[1],a[1]),n(a[2],a[2]))),h=r(m,i[0]),g=r(m,o[0]),_=r(m,s[0]),v=r(m,c[0]),y=e(n(o[0],o[0]),e(n(o[1],o[1]),n(o[2],o[2]))),b=r(y,i[0]),x=r(y,a[0]),S=r(y,s[0]),C=r(y,c[0]),w=e(n(s[0],s[0]),e(n(s[1],s[1]),n(s[2],s[2]))),T=r(w,i[0]),E=r(w,a[0]),D=r(w,o[0]),O=r(w,c[0]),k=e(n(c[0],c[0]),e(n(c[1],c[1]),n(c[2],c[2]))),A=r(k,i[0]),j=r(k,a[0]),M=r(k,o[0]),N=r(k,s[0]),P=t(e(e(e(r(e(r(t(N,O),o[1]),e(r(t(M,C),-s[1]),r(t(D,S),c[1]))),a[2]),e(r(e(r(t(N,O),a[1]),e(r(t(j,v),-s[1]),r(t(E,_),c[1]))),-o[2]),r(e(r(t(M,C),a[1]),e(r(t(j,v),-o[1]),r(t(x,g),c[1]))),s[2]))),e(r(e(r(t(D,S),a[1]),e(r(t(E,_),-o[1]),r(t(x,g),s[1]))),-c[2]),e(r(e(r(t(N,O),a[1]),e(r(t(j,v),-s[1]),r(t(E,_),c[1]))),i[2]),r(e(r(t(N,O),i[1]),e(r(t(A,p),-s[1]),r(t(T,f),c[1]))),-a[2])))),e(e(r(e(r(t(j,v),i[1]),e(r(t(A,p),-a[1]),r(t(h,u),c[1]))),s[2]),e(r(e(r(t(E,_),i[1]),e(r(t(T,f),-a[1]),r(t(h,u),s[1]))),-c[2]),r(e(r(t(D,S),a[1]),e(r(t(E,_),-o[1]),r(t(x,g),s[1]))),i[2]))),e(r(e(r(t(D,S),i[1]),e(r(t(T,f),-o[1]),r(t(b,d),s[1]))),-a[2]),e(r(e(r(t(E,_),i[1]),e(r(t(T,f),-a[1]),r(t(h,u),s[1]))),o[2]),r(e(r(t(x,g),i[1]),e(r(t(b,d),-a[1]),r(t(h,u),o[1]))),-s[2]))))),e(e(e(r(e(r(t(N,O),o[1]),e(r(t(M,C),-s[1]),r(t(D,S),c[1]))),i[2]),r(e(r(t(N,O),i[1]),e(r(t(A,p),-s[1]),r(t(T,f),c[1]))),-o[2])),e(r(e(r(t(M,C),i[1]),e(r(t(A,p),-o[1]),r(t(b,d),c[1]))),s[2]),r(e(r(t(D,S),i[1]),e(r(t(T,f),-o[1]),r(t(b,d),s[1]))),-c[2]))),e(e(r(e(r(t(M,C),a[1]),e(r(t(j,v),-o[1]),r(t(x,g),c[1]))),i[2]),r(e(r(t(M,C),i[1]),e(r(t(A,p),-o[1]),r(t(b,d),c[1]))),-a[2])),e(r(e(r(t(j,v),i[1]),e(r(t(A,p),-a[1]),r(t(h,u),c[1]))),o[2]),r(e(r(t(x,g),i[1]),e(r(t(b,d),-a[1]),r(t(h,u),o[1]))),-c[2])))));return P[P.length-1]}return i}function h(e,t,n,r){function i(i,a,o,s,c,l){var u=e(e(n(i[0],i[0]),n(i[1],i[1])),e(n(i[2],i[2]),n(i[3],i[3]))),d=r(u,a[0]),f=r(u,o[0]),p=r(u,s[0]),m=r(u,c[0]),h=r(u,l[0]),g=e(e(n(a[0],a[0]),n(a[1],a[1])),e(n(a[2],a[2]),n(a[3],a[3]))),_=r(g,i[0]),v=r(g,o[0]),y=r(g,s[0]),b=r(g,c[0]),x=r(g,l[0]),S=e(e(n(o[0],o[0]),n(o[1],o[1])),e(n(o[2],o[2]),n(o[3],o[3]))),C=r(S,i[0]),w=r(S,a[0]),T=r(S,s[0]),E=r(S,c[0]),D=r(S,l[0]),O=e(e(n(s[0],s[0]),n(s[1],s[1])),e(n(s[2],s[2]),n(s[3],s[3]))),k=r(O,i[0]),A=r(O,a[0]),j=r(O,o[0]),M=r(O,c[0]),N=r(O,l[0]),P=e(e(n(c[0],c[0]),n(c[1],c[1])),e(n(c[2],c[2]),n(c[3],c[3]))),F=r(P,i[0]),I=r(P,a[0]),L=r(P,o[0]),R=r(P,s[0]),z=r(P,l[0]),B=e(e(n(l[0],l[0]),n(l[1],l[1])),e(n(l[2],l[2]),n(l[3],l[3]))),V=r(B,i[0]),H=r(B,a[0]),U=r(B,o[0]),W=r(B,s[0]),G=r(B,c[0]),K=t(e(e(e(r(e(e(r(e(r(t(G,z),s[1]),e(r(t(W,N),-c[1]),r(t(R,M),l[1]))),o[2]),r(e(r(t(G,z),o[1]),e(r(t(U,D),-c[1]),r(t(L,E),l[1]))),-s[2])),e(r(e(r(t(W,N),o[1]),e(r(t(U,D),-s[1]),r(t(j,T),l[1]))),c[2]),r(e(r(t(R,M),o[1]),e(r(t(L,E),-s[1]),r(t(j,T),c[1]))),-l[2]))),a[3]),e(r(e(e(r(e(r(t(G,z),s[1]),e(r(t(W,N),-c[1]),r(t(R,M),l[1]))),a[2]),r(e(r(t(G,z),a[1]),e(r(t(H,x),-c[1]),r(t(I,b),l[1]))),-s[2])),e(r(e(r(t(W,N),a[1]),e(r(t(H,x),-s[1]),r(t(A,y),l[1]))),c[2]),r(e(r(t(R,M),a[1]),e(r(t(I,b),-s[1]),r(t(A,y),c[1]))),-l[2]))),-o[3]),r(e(e(r(e(r(t(G,z),o[1]),e(r(t(U,D),-c[1]),r(t(L,E),l[1]))),a[2]),r(e(r(t(G,z),a[1]),e(r(t(H,x),-c[1]),r(t(I,b),l[1]))),-o[2])),e(r(e(r(t(U,D),a[1]),e(r(t(H,x),-o[1]),r(t(w,v),l[1]))),c[2]),r(e(r(t(L,E),a[1]),e(r(t(I,b),-o[1]),r(t(w,v),c[1]))),-l[2]))),s[3]))),e(e(r(e(e(r(e(r(t(W,N),o[1]),e(r(t(U,D),-s[1]),r(t(j,T),l[1]))),a[2]),r(e(r(t(W,N),a[1]),e(r(t(H,x),-s[1]),r(t(A,y),l[1]))),-o[2])),e(r(e(r(t(U,D),a[1]),e(r(t(H,x),-o[1]),r(t(w,v),l[1]))),s[2]),r(e(r(t(j,T),a[1]),e(r(t(A,y),-o[1]),r(t(w,v),s[1]))),-l[2]))),-c[3]),r(e(e(r(e(r(t(R,M),o[1]),e(r(t(L,E),-s[1]),r(t(j,T),c[1]))),a[2]),r(e(r(t(R,M),a[1]),e(r(t(I,b),-s[1]),r(t(A,y),c[1]))),-o[2])),e(r(e(r(t(L,E),a[1]),e(r(t(I,b),-o[1]),r(t(w,v),c[1]))),s[2]),r(e(r(t(j,T),a[1]),e(r(t(A,y),-o[1]),r(t(w,v),s[1]))),-c[2]))),l[3])),e(r(e(e(r(e(r(t(G,z),s[1]),e(r(t(W,N),-c[1]),r(t(R,M),l[1]))),a[2]),r(e(r(t(G,z),a[1]),e(r(t(H,x),-c[1]),r(t(I,b),l[1]))),-s[2])),e(r(e(r(t(W,N),a[1]),e(r(t(H,x),-s[1]),r(t(A,y),l[1]))),c[2]),r(e(r(t(R,M),a[1]),e(r(t(I,b),-s[1]),r(t(A,y),c[1]))),-l[2]))),i[3]),r(e(e(r(e(r(t(G,z),s[1]),e(r(t(W,N),-c[1]),r(t(R,M),l[1]))),i[2]),r(e(r(t(G,z),i[1]),e(r(t(V,h),-c[1]),r(t(F,m),l[1]))),-s[2])),e(r(e(r(t(W,N),i[1]),e(r(t(V,h),-s[1]),r(t(k,p),l[1]))),c[2]),r(e(r(t(R,M),i[1]),e(r(t(F,m),-s[1]),r(t(k,p),c[1]))),-l[2]))),-a[3])))),e(e(e(r(e(e(r(e(r(t(G,z),a[1]),e(r(t(H,x),-c[1]),r(t(I,b),l[1]))),i[2]),r(e(r(t(G,z),i[1]),e(r(t(V,h),-c[1]),r(t(F,m),l[1]))),-a[2])),e(r(e(r(t(H,x),i[1]),e(r(t(V,h),-a[1]),r(t(_,d),l[1]))),c[2]),r(e(r(t(I,b),i[1]),e(r(t(F,m),-a[1]),r(t(_,d),c[1]))),-l[2]))),s[3]),r(e(e(r(e(r(t(W,N),a[1]),e(r(t(H,x),-s[1]),r(t(A,y),l[1]))),i[2]),r(e(r(t(W,N),i[1]),e(r(t(V,h),-s[1]),r(t(k,p),l[1]))),-a[2])),e(r(e(r(t(H,x),i[1]),e(r(t(V,h),-a[1]),r(t(_,d),l[1]))),s[2]),r(e(r(t(A,y),i[1]),e(r(t(k,p),-a[1]),r(t(_,d),s[1]))),-l[2]))),-c[3])),e(r(e(e(r(e(r(t(R,M),a[1]),e(r(t(I,b),-s[1]),r(t(A,y),c[1]))),i[2]),r(e(r(t(R,M),i[1]),e(r(t(F,m),-s[1]),r(t(k,p),c[1]))),-a[2])),e(r(e(r(t(I,b),i[1]),e(r(t(F,m),-a[1]),r(t(_,d),c[1]))),s[2]),r(e(r(t(A,y),i[1]),e(r(t(k,p),-a[1]),r(t(_,d),s[1]))),-c[2]))),l[3]),r(e(e(r(e(r(t(W,N),o[1]),e(r(t(U,D),-s[1]),r(t(j,T),l[1]))),a[2]),r(e(r(t(W,N),a[1]),e(r(t(H,x),-s[1]),r(t(A,y),l[1]))),-o[2])),e(r(e(r(t(U,D),a[1]),e(r(t(H,x),-o[1]),r(t(w,v),l[1]))),s[2]),r(e(r(t(j,T),a[1]),e(r(t(A,y),-o[1]),r(t(w,v),s[1]))),-l[2]))),i[3]))),e(e(r(e(e(r(e(r(t(W,N),o[1]),e(r(t(U,D),-s[1]),r(t(j,T),l[1]))),i[2]),r(e(r(t(W,N),i[1]),e(r(t(V,h),-s[1]),r(t(k,p),l[1]))),-o[2])),e(r(e(r(t(U,D),i[1]),e(r(t(V,h),-o[1]),r(t(C,f),l[1]))),s[2]),r(e(r(t(j,T),i[1]),e(r(t(k,p),-o[1]),r(t(C,f),s[1]))),-l[2]))),-a[3]),r(e(e(r(e(r(t(W,N),a[1]),e(r(t(H,x),-s[1]),r(t(A,y),l[1]))),i[2]),r(e(r(t(W,N),i[1]),e(r(t(V,h),-s[1]),r(t(k,p),l[1]))),-a[2])),e(r(e(r(t(H,x),i[1]),e(r(t(V,h),-a[1]),r(t(_,d),l[1]))),s[2]),r(e(r(t(A,y),i[1]),e(r(t(k,p),-a[1]),r(t(_,d),s[1]))),-l[2]))),o[3])),e(r(e(e(r(e(r(t(U,D),a[1]),e(r(t(H,x),-o[1]),r(t(w,v),l[1]))),i[2]),r(e(r(t(U,D),i[1]),e(r(t(V,h),-o[1]),r(t(C,f),l[1]))),-a[2])),e(r(e(r(t(H,x),i[1]),e(r(t(V,h),-a[1]),r(t(_,d),l[1]))),o[2]),r(e(r(t(w,v),i[1]),e(r(t(C,f),-a[1]),r(t(_,d),o[1]))),-l[2]))),-s[3]),r(e(e(r(e(r(t(j,T),a[1]),e(r(t(A,y),-o[1]),r(t(w,v),s[1]))),i[2]),r(e(r(t(j,T),i[1]),e(r(t(k,p),-o[1]),r(t(C,f),s[1]))),-a[2])),e(r(e(r(t(A,y),i[1]),e(r(t(k,p),-a[1]),r(t(_,d),s[1]))),o[2]),r(e(r(t(w,v),i[1]),e(r(t(C,f),-a[1]),r(t(_,d),o[1]))),-s[2]))),l[3]))))),e(e(e(r(e(e(r(e(r(t(G,z),s[1]),e(r(t(W,N),-c[1]),r(t(R,M),l[1]))),o[2]),r(e(r(t(G,z),o[1]),e(r(t(U,D),-c[1]),r(t(L,E),l[1]))),-s[2])),e(r(e(r(t(W,N),o[1]),e(r(t(U,D),-s[1]),r(t(j,T),l[1]))),c[2]),r(e(r(t(R,M),o[1]),e(r(t(L,E),-s[1]),r(t(j,T),c[1]))),-l[2]))),i[3]),e(r(e(e(r(e(r(t(G,z),s[1]),e(r(t(W,N),-c[1]),r(t(R,M),l[1]))),i[2]),r(e(r(t(G,z),i[1]),e(r(t(V,h),-c[1]),r(t(F,m),l[1]))),-s[2])),e(r(e(r(t(W,N),i[1]),e(r(t(V,h),-s[1]),r(t(k,p),l[1]))),c[2]),r(e(r(t(R,M),i[1]),e(r(t(F,m),-s[1]),r(t(k,p),c[1]))),-l[2]))),-o[3]),r(e(e(r(e(r(t(G,z),o[1]),e(r(t(U,D),-c[1]),r(t(L,E),l[1]))),i[2]),r(e(r(t(G,z),i[1]),e(r(t(V,h),-c[1]),r(t(F,m),l[1]))),-o[2])),e(r(e(r(t(U,D),i[1]),e(r(t(V,h),-o[1]),r(t(C,f),l[1]))),c[2]),r(e(r(t(L,E),i[1]),e(r(t(F,m),-o[1]),r(t(C,f),c[1]))),-l[2]))),s[3]))),e(e(r(e(e(r(e(r(t(W,N),o[1]),e(r(t(U,D),-s[1]),r(t(j,T),l[1]))),i[2]),r(e(r(t(W,N),i[1]),e(r(t(V,h),-s[1]),r(t(k,p),l[1]))),-o[2])),e(r(e(r(t(U,D),i[1]),e(r(t(V,h),-o[1]),r(t(C,f),l[1]))),s[2]),r(e(r(t(j,T),i[1]),e(r(t(k,p),-o[1]),r(t(C,f),s[1]))),-l[2]))),-c[3]),r(e(e(r(e(r(t(R,M),o[1]),e(r(t(L,E),-s[1]),r(t(j,T),c[1]))),i[2]),r(e(r(t(R,M),i[1]),e(r(t(F,m),-s[1]),r(t(k,p),c[1]))),-o[2])),e(r(e(r(t(L,E),i[1]),e(r(t(F,m),-o[1]),r(t(C,f),c[1]))),s[2]),r(e(r(t(j,T),i[1]),e(r(t(k,p),-o[1]),r(t(C,f),s[1]))),-c[2]))),l[3])),e(r(e(e(r(e(r(t(G,z),o[1]),e(r(t(U,D),-c[1]),r(t(L,E),l[1]))),a[2]),r(e(r(t(G,z),a[1]),e(r(t(H,x),-c[1]),r(t(I,b),l[1]))),-o[2])),e(r(e(r(t(U,D),a[1]),e(r(t(H,x),-o[1]),r(t(w,v),l[1]))),c[2]),r(e(r(t(L,E),a[1]),e(r(t(I,b),-o[1]),r(t(w,v),c[1]))),-l[2]))),i[3]),r(e(e(r(e(r(t(G,z),o[1]),e(r(t(U,D),-c[1]),r(t(L,E),l[1]))),i[2]),r(e(r(t(G,z),i[1]),e(r(t(V,h),-c[1]),r(t(F,m),l[1]))),-o[2])),e(r(e(r(t(U,D),i[1]),e(r(t(V,h),-o[1]),r(t(C,f),l[1]))),c[2]),r(e(r(t(L,E),i[1]),e(r(t(F,m),-o[1]),r(t(C,f),c[1]))),-l[2]))),-a[3])))),e(e(e(r(e(e(r(e(r(t(G,z),a[1]),e(r(t(H,x),-c[1]),r(t(I,b),l[1]))),i[2]),r(e(r(t(G,z),i[1]),e(r(t(V,h),-c[1]),r(t(F,m),l[1]))),-a[2])),e(r(e(r(t(H,x),i[1]),e(r(t(V,h),-a[1]),r(t(_,d),l[1]))),c[2]),r(e(r(t(I,b),i[1]),e(r(t(F,m),-a[1]),r(t(_,d),c[1]))),-l[2]))),o[3]),r(e(e(r(e(r(t(U,D),a[1]),e(r(t(H,x),-o[1]),r(t(w,v),l[1]))),i[2]),r(e(r(t(U,D),i[1]),e(r(t(V,h),-o[1]),r(t(C,f),l[1]))),-a[2])),e(r(e(r(t(H,x),i[1]),e(r(t(V,h),-a[1]),r(t(_,d),l[1]))),o[2]),r(e(r(t(w,v),i[1]),e(r(t(C,f),-a[1]),r(t(_,d),o[1]))),-l[2]))),-c[3])),e(r(e(e(r(e(r(t(L,E),a[1]),e(r(t(I,b),-o[1]),r(t(w,v),c[1]))),i[2]),r(e(r(t(L,E),i[1]),e(r(t(F,m),-o[1]),r(t(C,f),c[1]))),-a[2])),e(r(e(r(t(I,b),i[1]),e(r(t(F,m),-a[1]),r(t(_,d),c[1]))),o[2]),r(e(r(t(w,v),i[1]),e(r(t(C,f),-a[1]),r(t(_,d),o[1]))),-c[2]))),l[3]),r(e(e(r(e(r(t(R,M),o[1]),e(r(t(L,E),-s[1]),r(t(j,T),c[1]))),a[2]),r(e(r(t(R,M),a[1]),e(r(t(I,b),-s[1]),r(t(A,y),c[1]))),-o[2])),e(r(e(r(t(L,E),a[1]),e(r(t(I,b),-o[1]),r(t(w,v),c[1]))),s[2]),r(e(r(t(j,T),a[1]),e(r(t(A,y),-o[1]),r(t(w,v),s[1]))),-c[2]))),i[3]))),e(e(r(e(e(r(e(r(t(R,M),o[1]),e(r(t(L,E),-s[1]),r(t(j,T),c[1]))),i[2]),r(e(r(t(R,M),i[1]),e(r(t(F,m),-s[1]),r(t(k,p),c[1]))),-o[2])),e(r(e(r(t(L,E),i[1]),e(r(t(F,m),-o[1]),r(t(C,f),c[1]))),s[2]),r(e(r(t(j,T),i[1]),e(r(t(k,p),-o[1]),r(t(C,f),s[1]))),-c[2]))),-a[3]),r(e(e(r(e(r(t(R,M),a[1]),e(r(t(I,b),-s[1]),r(t(A,y),c[1]))),i[2]),r(e(r(t(R,M),i[1]),e(r(t(F,m),-s[1]),r(t(k,p),c[1]))),-a[2])),e(r(e(r(t(I,b),i[1]),e(r(t(F,m),-a[1]),r(t(_,d),c[1]))),s[2]),r(e(r(t(A,y),i[1]),e(r(t(k,p),-a[1]),r(t(_,d),s[1]))),-c[2]))),o[3])),e(r(e(e(r(e(r(t(L,E),a[1]),e(r(t(I,b),-o[1]),r(t(w,v),c[1]))),i[2]),r(e(r(t(L,E),i[1]),e(r(t(F,m),-o[1]),r(t(C,f),c[1]))),-a[2])),e(r(e(r(t(I,b),i[1]),e(r(t(F,m),-a[1]),r(t(_,d),c[1]))),o[2]),r(e(r(t(w,v),i[1]),e(r(t(C,f),-a[1]),r(t(_,d),o[1]))),-c[2]))),-s[3]),r(e(e(r(e(r(t(j,T),a[1]),e(r(t(A,y),-o[1]),r(t(w,v),s[1]))),i[2]),r(e(r(t(j,T),i[1]),e(r(t(k,p),-o[1]),r(t(C,f),s[1]))),-a[2])),e(r(e(r(t(A,y),i[1]),e(r(t(k,p),-a[1]),r(t(_,d),s[1]))),o[2]),r(e(r(t(w,v),i[1]),e(r(t(C,f),-a[1]),r(t(_,d),o[1]))),-s[2]))),c[3]))))));return K[K.length-1]}return i}var g=[l,u,d];function _(e){var t=g[e.length];return t||=g[e.length]=c(e.length),t.apply(void 0,e)}function v(e,t,n,r,i,a,o,s){function c(t,n,c,l,u,d){switch(arguments.length){case 0:case 1:return 0;case 2:return r(t,n);case 3:return i(t,n,c);case 4:return a(t,n,c,l);case 5:return o(t,n,c,l,u);case 6:return s(t,n,c,l,u,d)}for(var f=Array(arguments.length),p=0;p<arguments.length;++p)f[p]=arguments[p];return e(f)}return c}function y(){for(;g.length<=s;)g.push(c(g.length));e.exports=v.apply(void 0,[_].concat(g));for(var t=0;t<=s;++t)e.exports[t]=g[t]}y()},727:function(e,t,n){var r=n(2962),i=6;function a(e){return(e===2?c:e===3?l:e===4?u:e===5?d:f)(e<6?r[e]:r)}function o(){return[[0]]}function s(e,t){return[[t[0]],[e[0][0]]]}function c(e){return function(t,n){return[e([[+n[0],+t[0][1]],[+n[1],+t[1][1]]]),e([[+t[0][0],+n[0]],[+t[1][0],+n[1]]]),e(t)]}}function l(e){return function(t,n){return[e([[+n[0],+t[0][1],+t[0][2]],[+n[1],+t[1][1],+t[1][2]],[+n[2],+t[2][1],+t[2][2]]]),e([[+t[0][0],+n[0],+t[0][2]],[+t[1][0],+n[1],+t[1][2]],[+t[2][0],+n[2],+t[2][2]]]),e([[+t[0][0],+t[0][1],+n[0]],[+t[1][0],+t[1][1],+n[1]],[+t[2][0],+t[2][1],+n[2]]]),e(t)]}}function u(e){return function(t,n){return[e([[+n[0],+t[0][1],+t[0][2],+t[0][3]],[+n[1],+t[1][1],+t[1][2],+t[1][3]],[+n[2],+t[2][1],+t[2][2],+t[2][3]],[+n[3],+t[3][1],+t[3][2],+t[3][3]]]),e([[+t[0][0],+n[0],+t[0][2],+t[0][3]],[+t[1][0],+n[1],+t[1][2],+t[1][3]],[+t[2][0],+n[2],+t[2][2],+t[2][3]],[+t[3][0],+n[3],+t[3][2],+t[3][3]]]),e([[+t[0][0],+t[0][1],+n[0],+t[0][3]],[+t[1][0],+t[1][1],+n[1],+t[1][3]],[+t[2][0],+t[2][1],+n[2],+t[2][3]],[+t[3][0],+t[3][1],+n[3],+t[3][3]]]),e([[+t[0][0],+t[0][1],+t[0][2],+n[0]],[+t[1][0],+t[1][1],+t[1][2],+n[1]],[+t[2][0],+t[2][1],+t[2][2],+n[2]],[+t[3][0],+t[3][1],+t[3][2],+n[3]]]),e(t)]}}function d(e){return function(t,n){return[e([[+n[0],+t[0][1],+t[0][2],+t[0][3],+t[0][4]],[+n[1],+t[1][1],+t[1][2],+t[1][3],+t[1][4]],[+n[2],+t[2][1],+t[2][2],+t[2][3],+t[2][4]],[+n[3],+t[3][1],+t[3][2],+t[3][3],+t[3][4]],[+n[4],+t[4][1],+t[4][2],+t[4][3],+t[4][4]]]),e([[+t[0][0],+n[0],+t[0][2],+t[0][3],+t[0][4]],[+t[1][0],+n[1],+t[1][2],+t[1][3],+t[1][4]],[+t[2][0],+n[2],+t[2][2],+t[2][3],+t[2][4]],[+t[3][0],+n[3],+t[3][2],+t[3][3],+t[3][4]],[+t[4][0],+n[4],+t[4][2],+t[4][3],+t[4][4]]]),e([[+t[0][0],+t[0][1],+n[0],+t[0][3],+t[0][4]],[+t[1][0],+t[1][1],+n[1],+t[1][3],+t[1][4]],[+t[2][0],+t[2][1],+n[2],+t[2][3],+t[2][4]],[+t[3][0],+t[3][1],+n[3],+t[3][3],+t[3][4]],[+t[4][0],+t[4][1],+n[4],+t[4][3],+t[4][4]]]),e([[+t[0][0],+t[0][1],+t[0][2],+n[0],+t[0][4]],[+t[1][0],+t[1][1],+t[1][2],+n[1],+t[1][4]],[+t[2][0],+t[2][1],+t[2][2],+n[2],+t[2][4]],[+t[3][0],+t[3][1],+t[3][2],+n[3],+t[3][4]],[+t[4][0],+t[4][1],+t[4][2],+n[4],+t[4][4]]]),e([[+t[0][0],+t[0][1],+t[0][2],+t[0][3],+n[0]],[+t[1][0],+t[1][1],+t[1][2],+t[1][3],+n[1]],[+t[2][0],+t[2][1],+t[2][2],+t[2][3],+n[2]],[+t[3][0],+t[3][1],+t[3][2],+t[3][3],+n[3]],[+t[4][0],+t[4][1],+t[4][2],+t[4][3],+n[4]]]),e(t)]}}function f(e){return function(t,n){return[e([[+n[0],+t[0][1],+t[0][2],+t[0][3],+t[0][4],+t[0][5]],[+n[1],+t[1][1],+t[1][2],+t[1][3],+t[1][4],+t[1][5]],[+n[2],+t[2][1],+t[2][2],+t[2][3],+t[2][4],+t[2][5]],[+n[3],+t[3][1],+t[3][2],+t[3][3],+t[3][4],+t[3][5]],[+n[4],+t[4][1],+t[4][2],+t[4][3],+t[4][4],+t[4][5]],[+n[5],+t[5][1],+t[5][2],+t[5][3],+t[5][4],+t[5][5]]]),e([[+t[0][0],+n[0],+t[0][2],+t[0][3],+t[0][4],+t[0][5]],[+t[1][0],+n[1],+t[1][2],+t[1][3],+t[1][4],+t[1][5]],[+t[2][0],+n[2],+t[2][2],+t[2][3],+t[2][4],+t[2][5]],[+t[3][0],+n[3],+t[3][2],+t[3][3],+t[3][4],+t[3][5]],[+t[4][0],+n[4],+t[4][2],+t[4][3],+t[4][4],+t[4][5]],[+t[5][0],+n[5],+t[5][2],+t[5][3],+t[5][4],+t[5][5]]]),e([[+t[0][0],+t[0][1],+n[0],+t[0][3],+t[0][4],+t[0][5]],[+t[1][0],+t[1][1],+n[1],+t[1][3],+t[1][4],+t[1][5]],[+t[2][0],+t[2][1],+n[2],+t[2][3],+t[2][4],+t[2][5]],[+t[3][0],+t[3][1],+n[3],+t[3][3],+t[3][4],+t[3][5]],[+t[4][0],+t[4][1],+n[4],+t[4][3],+t[4][4],+t[4][5]],[+t[5][0],+t[5][1],+n[5],+t[5][3],+t[5][4],+t[5][5]]]),e([[+t[0][0],+t[0][1],+t[0][2],+n[0],+t[0][4],+t[0][5]],[+t[1][0],+t[1][1],+t[1][2],+n[1],+t[1][4],+t[1][5]],[+t[2][0],+t[2][1],+t[2][2],+n[2],+t[2][4],+t[2][5]],[+t[3][0],+t[3][1],+t[3][2],+n[3],+t[3][4],+t[3][5]],[+t[4][0],+t[4][1],+t[4][2],+n[4],+t[4][4],+t[4][5]],[+t[5][0],+t[5][1],+t[5][2],+n[5],+t[5][4],+t[5][5]]]),e([[+t[0][0],+t[0][1],+t[0][2],+t[0][3],+n[0],+t[0][5]],[+t[1][0],+t[1][1],+t[1][2],+t[1][3],+n[1],+t[1][5]],[+t[2][0],+t[2][1],+t[2][2],+t[2][3],+n[2],+t[2][5]],[+t[3][0],+t[3][1],+t[3][2],+t[3][3],+n[3],+t[3][5]],[+t[4][0],+t[4][1],+t[4][2],+t[4][3],+n[4],+t[4][5]],[+t[5][0],+t[5][1],+t[5][2],+t[5][3],+n[5],+t[5][5]]]),e([[+t[0][0],+t[0][1],+t[0][2],+t[0][3],+t[0][4],+n[0]],[+t[1][0],+t[1][1],+t[1][2],+t[1][3],+t[1][4],+n[1]],[+t[2][0],+t[2][1],+t[2][2],+t[2][3],+t[2][4],+n[2]],[+t[3][0],+t[3][1],+t[3][2],+t[3][3],+t[3][4],+n[3]],[+t[4][0],+t[4][1],+t[4][2],+t[4][3],+t[4][4],+n[4]],[+t[5][0],+t[5][1],+t[5][2],+t[5][3],+t[5][4],+n[5]]]),e(t)]}}var p=[o,s];function m(e,t,n,r,i,a,o,s){return function(c,l){switch(c.length){case 0:return e(c,l);case 1:return t(c,l);case 2:return n(c,l);case 3:return r(c,l);case 4:return i(c,l);case 5:return a(c,l)}var u=o[c.length];return u||=o[c.length]=s(c.length),u(c,l)}}function h(){for(;p.length<i;)p.push(a(p.length));e.exports=m.apply(void 0,p.concat([p,a]));for(var t=0;t<i;++t)e.exports[t]=p[t]}h()},3250:function(e,t,n){var r=n(5250),i=n(8210),a=n(3012),o=n(8545),s=5,c=11102230246251565e-32,l=(3+16*c)*c,u=(7+56*c)*c;function d(e,t,n,r){return function(n,i,a){var o=r(e(e(t(i[1],a[0]),t(-a[1],i[0])),e(t(n[1],i[0]),t(-i[1],n[0]))),e(t(n[1],a[0]),t(-a[1],n[0])));return o[o.length-1]}}function f(e,t,n,r){return function(i,a,o,s){var c=r(e(e(n(e(t(o[1],s[0]),t(-s[1],o[0])),a[2]),e(n(e(t(a[1],s[0]),t(-s[1],a[0])),-o[2]),n(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]))),e(n(e(t(a[1],s[0]),t(-s[1],a[0])),i[2]),e(n(e(t(i[1],s[0]),t(-s[1],i[0])),-a[2]),n(e(t(i[1],a[0]),t(-a[1],i[0])),s[2])))),e(e(n(e(t(o[1],s[0]),t(-s[1],o[0])),i[2]),e(n(e(t(i[1],s[0]),t(-s[1],i[0])),-o[2]),n(e(t(i[1],o[0]),t(-o[1],i[0])),s[2]))),e(n(e(t(a[1],o[0]),t(-o[1],a[0])),i[2]),e(n(e(t(i[1],o[0]),t(-o[1],i[0])),-a[2]),n(e(t(i[1],a[0]),t(-a[1],i[0])),o[2])))));return c[c.length-1]}}function p(e,t,n,r){return function(i,a,o,s,c){var l=r(e(e(e(n(e(n(e(t(s[1],c[0]),t(-c[1],s[0])),o[2]),e(n(e(t(o[1],c[0]),t(-c[1],o[0])),-s[2]),n(e(t(o[1],s[0]),t(-s[1],o[0])),c[2]))),a[3]),e(n(e(n(e(t(s[1],c[0]),t(-c[1],s[0])),a[2]),e(n(e(t(a[1],c[0]),t(-c[1],a[0])),-s[2]),n(e(t(a[1],s[0]),t(-s[1],a[0])),c[2]))),-o[3]),n(e(n(e(t(o[1],c[0]),t(-c[1],o[0])),a[2]),e(n(e(t(a[1],c[0]),t(-c[1],a[0])),-o[2]),n(e(t(a[1],o[0]),t(-o[1],a[0])),c[2]))),s[3]))),e(n(e(n(e(t(o[1],s[0]),t(-s[1],o[0])),a[2]),e(n(e(t(a[1],s[0]),t(-s[1],a[0])),-o[2]),n(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]))),-c[3]),e(n(e(n(e(t(s[1],c[0]),t(-c[1],s[0])),a[2]),e(n(e(t(a[1],c[0]),t(-c[1],a[0])),-s[2]),n(e(t(a[1],s[0]),t(-s[1],a[0])),c[2]))),i[3]),n(e(n(e(t(s[1],c[0]),t(-c[1],s[0])),i[2]),e(n(e(t(i[1],c[0]),t(-c[1],i[0])),-s[2]),n(e(t(i[1],s[0]),t(-s[1],i[0])),c[2]))),-a[3])))),e(e(n(e(n(e(t(a[1],c[0]),t(-c[1],a[0])),i[2]),e(n(e(t(i[1],c[0]),t(-c[1],i[0])),-a[2]),n(e(t(i[1],a[0]),t(-a[1],i[0])),c[2]))),s[3]),e(n(e(n(e(t(a[1],s[0]),t(-s[1],a[0])),i[2]),e(n(e(t(i[1],s[0]),t(-s[1],i[0])),-a[2]),n(e(t(i[1],a[0]),t(-a[1],i[0])),s[2]))),-c[3]),n(e(n(e(t(o[1],s[0]),t(-s[1],o[0])),a[2]),e(n(e(t(a[1],s[0]),t(-s[1],a[0])),-o[2]),n(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]))),i[3]))),e(n(e(n(e(t(o[1],s[0]),t(-s[1],o[0])),i[2]),e(n(e(t(i[1],s[0]),t(-s[1],i[0])),-o[2]),n(e(t(i[1],o[0]),t(-o[1],i[0])),s[2]))),-a[3]),e(n(e(n(e(t(a[1],s[0]),t(-s[1],a[0])),i[2]),e(n(e(t(i[1],s[0]),t(-s[1],i[0])),-a[2]),n(e(t(i[1],a[0]),t(-a[1],i[0])),s[2]))),o[3]),n(e(n(e(t(a[1],o[0]),t(-o[1],a[0])),i[2]),e(n(e(t(i[1],o[0]),t(-o[1],i[0])),-a[2]),n(e(t(i[1],a[0]),t(-a[1],i[0])),o[2]))),-s[3]))))),e(e(e(n(e(n(e(t(s[1],c[0]),t(-c[1],s[0])),o[2]),e(n(e(t(o[1],c[0]),t(-c[1],o[0])),-s[2]),n(e(t(o[1],s[0]),t(-s[1],o[0])),c[2]))),i[3]),n(e(n(e(t(s[1],c[0]),t(-c[1],s[0])),i[2]),e(n(e(t(i[1],c[0]),t(-c[1],i[0])),-s[2]),n(e(t(i[1],s[0]),t(-s[1],i[0])),c[2]))),-o[3])),e(n(e(n(e(t(o[1],c[0]),t(-c[1],o[0])),i[2]),e(n(e(t(i[1],c[0]),t(-c[1],i[0])),-o[2]),n(e(t(i[1],o[0]),t(-o[1],i[0])),c[2]))),s[3]),n(e(n(e(t(o[1],s[0]),t(-s[1],o[0])),i[2]),e(n(e(t(i[1],s[0]),t(-s[1],i[0])),-o[2]),n(e(t(i[1],o[0]),t(-o[1],i[0])),s[2]))),-c[3]))),e(e(n(e(n(e(t(o[1],c[0]),t(-c[1],o[0])),a[2]),e(n(e(t(a[1],c[0]),t(-c[1],a[0])),-o[2]),n(e(t(a[1],o[0]),t(-o[1],a[0])),c[2]))),i[3]),n(e(n(e(t(o[1],c[0]),t(-c[1],o[0])),i[2]),e(n(e(t(i[1],c[0]),t(-c[1],i[0])),-o[2]),n(e(t(i[1],o[0]),t(-o[1],i[0])),c[2]))),-a[3])),e(n(e(n(e(t(a[1],c[0]),t(-c[1],a[0])),i[2]),e(n(e(t(i[1],c[0]),t(-c[1],i[0])),-a[2]),n(e(t(i[1],a[0]),t(-a[1],i[0])),c[2]))),o[3]),n(e(n(e(t(a[1],o[0]),t(-o[1],a[0])),i[2]),e(n(e(t(i[1],o[0]),t(-o[1],i[0])),-a[2]),n(e(t(i[1],a[0]),t(-a[1],i[0])),o[2]))),-c[3])))));return l[l.length-1]}}function m(e){return(e===3?d:e===4?f:p)(i,r,a,o)}var h=m(3),g=m(4),_=[function(){return 0},function(){return 0},function(e,t){return t[0]-e[0]},function(e,t,n){var r=(e[1]-n[1])*(t[0]-n[0]),i=(e[0]-n[0])*(t[1]-n[1]),a=r-i,o;if(r>0){if(i<=0)return a;o=r+i}else if(r<0){if(i>=0)return a;o=-(r+i)}else return a;var s=l*o;return a>=s||a<=-s?a:h(e,t,n)},function(e,t,n,r){var i=e[0]-r[0],a=t[0]-r[0],o=n[0]-r[0],s=e[1]-r[1],c=t[1]-r[1],l=n[1]-r[1],d=e[2]-r[2],f=t[2]-r[2],p=n[2]-r[2],m=a*l,h=o*c,_=o*s,v=i*l,y=i*c,b=a*s,x=d*(m-h)+f*(_-v)+p*(y-b),S=u*((Math.abs(m)+Math.abs(h))*Math.abs(d)+(Math.abs(_)+Math.abs(v))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(p));return x>S||-x>S?x:g(e,t,n,r)}];function v(e){var t=_[e.length];return t||=_[e.length]=m(e.length),t.apply(void 0,e)}function y(e,t,n,r,i,a,o){return function(t,n,s,c,l){switch(arguments.length){case 0:case 1:return 0;case 2:return r(t,n);case 3:return i(t,n,s);case 4:return a(t,n,s,c);case 5:return o(t,n,s,c,l)}for(var u=Array(arguments.length),d=0;d<arguments.length;++d)u[d]=arguments[d];return e(u)}}function b(){for(;_.length<=s;)_.push(m(_.length));e.exports=y.apply(void 0,[v].concat(_));for(var t=0;t<=s;++t)e.exports[t]=_[t]}b()},5382:function(e,t,n){var r=n(8210),i=n(3012);e.exports=a;function a(e,t){if(e.length===1)return i(t,e[0]);if(t.length===1)return i(e,t[0]);if(e.length===0||t.length===0)return[0];var n=[0];if(e.length<t.length)for(var a=0;a<e.length;++a)n=r(n,i(t,e[a]));else for(var a=0;a<t.length;++a)n=r(n,i(e,t[a]));return n}},3012:function(e,t,n){var r=n(5250),i=n(9362);e.exports=a;function a(e,t){var n=e.length;if(n===1){var a=r(e[0],t);return a[0]?a:[a[1]]}var o=Array(2*n),s=[.1,.1],c=[.1,.1],l=0;r(e[0],t,s),s[0]&&(o[l++]=s[0]);for(var u=1;u<n;++u){r(e[u],t,c);var d=s[1];i(d,c[0],s),s[0]&&(o[l++]=s[0]);var f=c[1],p=s[1],m=f+p,h=p-(m-f);s[1]=m,h&&(o[l++]=h)}return s[1]&&(o[l++]=s[1]),l===0&&(o[l++]=0),o.length=l,o}},1125:function(e,t,n){e.exports=a;var r=n(3250)[3];function i(e,t,n,r){for(var i=0;i<2;++i){var a=e[i],o=t[i],s=Math.min(a,o),c=Math.max(a,o),l=n[i],u=r[i];if(Math.max(l,u)<s||c<Math.min(l,u))return!1}return!0}function a(e,t,n,a){var o=r(e,n,a),s=r(t,n,a);if(o>0&&s>0||o<0&&s<0)return!1;var c=r(n,e,t),l=r(a,e,t);return c>0&&l>0||c<0&&l<0?!1:o===0&&s===0&&c===0&&l===0?i(e,t,n,a):!0}},8545:function(e){e.exports=n;function t(e,t){var n=e+t,r=n-e,i=n-r,a=t-r,o=e-i+a;return o?[o,n]:[n]}function n(e,n){var r=e.length|0,i=n.length|0;if(r===1&&i===1)return t(e[0],-n[0]);var a=r+i,o=Array(a),s=0,c=0,l=0,u=Math.abs,d=e[c],f=u(d),p=-n[l],m=u(p),h,g;f<m?(g=d,c+=1,c<r&&(d=e[c],f=u(d))):(g=p,l+=1,l<i&&(p=-n[l],m=u(p))),c<r&&f<m||l>=i?(h=d,c+=1,c<r&&(d=e[c],f=u(d))):(h=p,l+=1,l<i&&(p=-n[l],m=u(p)));for(var _=h+g,v=_-h,y=g-v,b=y,x=_,S,C,w,T,E;c<r&&l<i;)f<m?(h=d,c+=1,c<r&&(d=e[c],f=u(d))):(h=p,l+=1,l<i&&(p=-n[l],m=u(p))),g=b,_=h+g,v=_-h,y=g-v,y&&(o[s++]=y),S=x+_,C=S-x,w=S-C,T=_-C,E=x-w,b=E+T,x=S;for(;c<r;)h=d,g=b,_=h+g,v=_-h,y=g-v,y&&(o[s++]=y),S=x+_,C=S-x,w=S-C,T=_-C,E=x-w,b=E+T,x=S,c+=1,c<r&&(d=e[c]);for(;l<i;)h=p,g=b,_=h+g,v=_-h,y=g-v,y&&(o[s++]=y),S=x+_,C=S-x,w=S-C,T=_-C,E=x-w,b=E+T,x=S,l+=1,l<i&&(p=-n[l]);return b&&(o[s++]=b),x&&(o[s++]=x),s||(o[s++]=0),o.length=s,o}},8210:function(e){e.exports=n;function t(e,t){var n=e+t,r=n-e,i=n-r,a=t-r,o=e-i+a;return o?[o,n]:[n]}function n(e,n){var r=e.length|0,i=n.length|0;if(r===1&&i===1)return t(e[0],n[0]);var a=r+i,o=Array(a),s=0,c=0,l=0,u=Math.abs,d=e[c],f=u(d),p=n[l],m=u(p),h,g;f<m?(g=d,c+=1,c<r&&(d=e[c],f=u(d))):(g=p,l+=1,l<i&&(p=n[l],m=u(p))),c<r&&f<m||l>=i?(h=d,c+=1,c<r&&(d=e[c],f=u(d))):(h=p,l+=1,l<i&&(p=n[l],m=u(p)));for(var _=h+g,v=_-h,y=g-v,b=y,x=_,S,C,w,T,E;c<r&&l<i;)f<m?(h=d,c+=1,c<r&&(d=e[c],f=u(d))):(h=p,l+=1,l<i&&(p=n[l],m=u(p))),g=b,_=h+g,v=_-h,y=g-v,y&&(o[s++]=y),S=x+_,C=S-x,w=S-C,T=_-C,E=x-w,b=E+T,x=S;for(;c<r;)h=d,g=b,_=h+g,v=_-h,y=g-v,y&&(o[s++]=y),S=x+_,C=S-x,w=S-C,T=_-C,E=x-w,b=E+T,x=S,c+=1,c<r&&(d=e[c]);for(;l<i;)h=p,g=b,_=h+g,v=_-h,y=g-v,y&&(o[s++]=y),S=x+_,C=S-x,w=S-C,T=_-C,E=x-w,b=E+T,x=S,l+=1,l<i&&(p=n[l]);return b&&(o[s++]=b),x&&(o[s++]=x),s||(o[s++]=0),o.length=s,o}},9127:function(e,t,n){e.exports=a;var r=n(6204),i=n(5771);function a(e){return i(r(e))}},7765:function(e,t,n){e.exports=p;var r=n(9618),i=n(1888),a=n(446),o=n(1570);function s(e){for(var t=e.length,n=0,r=0;r<t;++r)n=Math.max(n,e[r].length)|0;return n-1}function c(e,t){for(var n=e.length,r=i.mallocUint8(n),a=0;a<n;++a)r[a]=e[a]<t|0;return r}function l(e,t){for(var n=e.length,o=t*(t+1)/2*n|0,s=i.mallocUint32(o*2),c=0,l=0;l<n;++l)for(var u=e[l],t=u.length,d=0;d<t;++d)for(var f=0;f<d;++f){var p=u[f],m=u[d];s[c++]=Math.min(p,m)|0,s[c++]=Math.max(p,m)|0}a(r(s,[c/2|0,2]));for(var h=2,l=2;l<c;l+=2)s[l-2]===s[l]&&s[l-1]===s[l+1]||(s[h++]=s[l],s[h++]=s[l+1]);return r(s,[h/2|0,2])}function u(e,t,n,a){for(var o=e.data,s=e.shape[0],c=i.mallocDouble(s),l=0,u=0;u<s;++u){var d=o[2*u],f=o[2*u+1];if(n[d]!==n[f]){var p=t[d],m=t[f];o[2*l]=d,o[2*l+1]=f,c[l++]=(m-a)/(m-p)}}return e.shape[0]=l,r(c,[l])}function d(e,t){var n=i.mallocInt32(t*2),r=e.shape[0],a=e.data;n[0]=0;for(var o=0,s=0;s<r;++s){var c=a[2*s];if(c!==o){for(n[2*o+1]=s;++o<c;)n[2*o]=s,n[2*o+1]=s;n[2*o]=s}}for(n[2*o+1]=r;++o<t;)n[2*o]=n[2*o+1]=r;return n}function f(e){for(var t=e.shape[0]|0,n=e.data,r=Array(t),i=0;i<t;++i)r[i]=[n[2*i],n[2*i+1]];return r}function p(e,t,n,r){if(n||=0,r===void 0&&(r=s(e)),e.length===0||r<1)return{cells:[],vertexIds:[],vertexWeights:[]};var a=c(t,+n),p=l(e,r),m=u(p,t,a,+n),h=d(p,t.length|0),g=o(r)(e,p.data,h,a),_=f(p),v=[].slice.call(m.data,0,m.shape[0]);return i.free(a),i.free(p.data),i.free(m.data),i.free(h),{cells:g,vertexIds:_,vertexWeights:v}}},1570:function(e){e.exports=n;var t=[function(){function e(e,t,n,r){for(var i=e.length,a=[],o=0;o<i;++o)var s=e[o],c=s.length;return a}return e},function(){function e(e,t,n,r){for(var i=Math.min(n,r)|0,a=Math.max(n,r)|0,o=e[2*i],s=e[2*i+1];o<s;){var c=o+s>>1,l=t[2*c+1];if(l===a)return c;a<l?s=c:o=c+1}return o}function t(t,n,r,i){for(var a=t.length,o=[],s=0;s<a;++s){var c=t[s];if(c.length===2){var l=(i[c[0]]<<0)+(i[c[1]]<<1);if(l===0||l===3)continue;switch(l){case 0:break;case 1:o.push([e(r,n,c[0],c[1])]);break;case 2:o.push([e(r,n,c[1],c[0])]);break;case 3:break}}}return o}return t},function(){function e(e,t,n,r){for(var i=Math.min(n,r)|0,a=Math.max(n,r)|0,o=e[2*i],s=e[2*i+1];o<s;){var c=o+s>>1,l=t[2*c+1];if(l===a)return c;a<l?s=c:o=c+1}return o}function t(t,n,r,i){for(var a=t.length,o=[],s=0;s<a;++s){var c=t[s],l=c.length;if(l===3){var u=(i[c[0]]<<0)+(i[c[1]]<<1)+(i[c[2]]<<2);if(u===0||u===7)continue;switch(u){case 0:break;case 1:o.push([e(r,n,c[0],c[2]),e(r,n,c[0],c[1])]);break;case 2:o.push([e(r,n,c[1],c[0]),e(r,n,c[1],c[2])]);break;case 3:o.push([e(r,n,c[0],c[2]),e(r,n,c[1],c[2])]);break;case 4:o.push([e(r,n,c[2],c[1]),e(r,n,c[2],c[0])]);break;case 5:o.push([e(r,n,c[2],c[1]),e(r,n,c[0],c[1])]);break;case 6:o.push([e(r,n,c[1],c[0]),e(r,n,c[2],c[0])]);break;case 7:break}}else if(l===2){var u=(i[c[0]]<<0)+(i[c[1]]<<1);if(u===0||u===3)continue;switch(u){case 0:break;case 1:o.push([e(r,n,c[0],c[1])]);break;case 2:o.push([e(r,n,c[1],c[0])]);break;case 3:break}}}return o}return t},function(){function e(e,t,n,r){for(var i=Math.min(n,r)|0,a=Math.max(n,r)|0,o=e[2*i],s=e[2*i+1];o<s;){var c=o+s>>1,l=t[2*c+1];if(l===a)return c;a<l?s=c:o=c+1}return o}function t(t,n,r,i){for(var a=t.length,o=[],s=0;s<a;++s){var c=t[s],l=c.length;if(l===4){var u=(i[c[0]]<<0)+(i[c[1]]<<1)+(i[c[2]]<<2)+(i[c[3]]<<3);if(u===0||u===15)continue;switch(u){case 0:break;case 1:o.push([e(r,n,c[0],c[1]),e(r,n,c[0],c[2]),e(r,n,c[0],c[3])]);break;case 2:o.push([e(r,n,c[1],c[2]),e(r,n,c[1],c[0]),e(r,n,c[1],c[3])]);break;case 3:o.push([e(r,n,c[1],c[2]),e(r,n,c[0],c[2]),e(r,n,c[0],c[3])],[e(r,n,c[1],c[3]),e(r,n,c[1],c[2]),e(r,n,c[0],c[3])]);break;case 4:o.push([e(r,n,c[2],c[0]),e(r,n,c[2],c[1]),e(r,n,c[2],c[3])]);break;case 5:o.push([e(r,n,c[0],c[1]),e(r,n,c[2],c[1]),e(r,n,c[0],c[3])],[e(r,n,c[2],c[1]),e(r,n,c[2],c[3]),e(r,n,c[0],c[3])]);break;case 6:o.push([e(r,n,c[2],c[0]),e(r,n,c[1],c[0]),e(r,n,c[1],c[3])],[e(r,n,c[2],c[3]),e(r,n,c[2],c[0]),e(r,n,c[1],c[3])]);break;case 7:o.push([e(r,n,c[0],c[3]),e(r,n,c[1],c[3]),e(r,n,c[2],c[3])]);break;case 8:o.push([e(r,n,c[3],c[1]),e(r,n,c[3],c[0]),e(r,n,c[3],c[2])]);break;case 9:o.push([e(r,n,c[3],c[1]),e(r,n,c[0],c[1]),e(r,n,c[0],c[2])],[e(r,n,c[3],c[2]),e(r,n,c[3],c[1]),e(r,n,c[0],c[2])]);break;case 10:o.push([e(r,n,c[1],c[0]),e(r,n,c[3],c[0]),e(r,n,c[1],c[2])],[e(r,n,c[3],c[0]),e(r,n,c[3],c[2]),e(r,n,c[1],c[2])]);break;case 11:o.push([e(r,n,c[1],c[2]),e(r,n,c[0],c[2]),e(r,n,c[3],c[2])]);break;case 12:o.push([e(r,n,c[3],c[0]),e(r,n,c[2],c[0]),e(r,n,c[2],c[1])],[e(r,n,c[3],c[1]),e(r,n,c[3],c[0]),e(r,n,c[2],c[1])]);break;case 13:o.push([e(r,n,c[0],c[1]),e(r,n,c[2],c[1]),e(r,n,c[3],c[1])]);break;case 14:o.push([e(r,n,c[2],c[0]),e(r,n,c[1],c[0]),e(r,n,c[3],c[0])]);break;case 15:break}}else if(l===3){var u=(i[c[0]]<<0)+(i[c[1]]<<1)+(i[c[2]]<<2);if(u===0||u===7)continue;switch(u){case 0:break;case 1:o.push([e(r,n,c[0],c[2]),e(r,n,c[0],c[1])]);break;case 2:o.push([e(r,n,c[1],c[0]),e(r,n,c[1],c[2])]);break;case 3:o.push([e(r,n,c[0],c[2]),e(r,n,c[1],c[2])]);break;case 4:o.push([e(r,n,c[2],c[1]),e(r,n,c[2],c[0])]);break;case 5:o.push([e(r,n,c[2],c[1]),e(r,n,c[0],c[1])]);break;case 6:o.push([e(r,n,c[1],c[0]),e(r,n,c[2],c[0])]);break;case 7:break}}else if(l===2){var u=(i[c[0]]<<0)+(i[c[1]]<<1);if(u===0||u===3)continue;switch(u){case 0:break;case 1:o.push([e(r,n,c[0],c[1])]);break;case 2:o.push([e(r,n,c[1],c[0])]);break;case 3:break}}}return o}return t}];function n(e){return t[e]()}},6803:function(e,t,n){n(8828),n(1755);function r(e,t){var n=e.length,r=e.length-t.length,i=Math.min;if(r)return r;switch(n){case 0:return 0;case 1:return e[0]-t[0];case 2:var a=e[0]+e[1]-t[0]-t[1];return a||i(e[0],e[1])-i(t[0],t[1]);case 3:var o=e[0]+e[1],s=t[0]+t[1];if(a=o+e[2]-(s+t[2]),a)return a;var c=i(e[0],e[1]),l=i(t[0],t[1]),a=i(c,e[2])-i(l,t[2]);return a||i(c+e[2],o)-i(l+t[2],s);default:var u=e.slice(0);u.sort();var d=t.slice(0);d.sort();for(var f=0;f<n;++f)if(r=u[f]-d[f],r)return r;return 0}}t.Fw=r},3105:function(e,t){"use restrict";var n=32;t.INT_BITS=n,t.INT_MAX=2147483647,t.INT_MIN=-1<<n-1,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>n-1;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e<t)},t.max=function(e,t){return e^(e^t)&-(e<t)},t.isPow2=function(e){return!(e&e-1)&&!!e},t.log2=function(e){var t,n;return t=(e>65535)<<4,e>>>=t,n=(e>255)<<3,e>>>=n,t|=n,n=(e>15)<<2,e>>>=n,t|=n,n=(e>3)<<1,e>>>=n,t|=n,t|e>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return e-=e>>>1&1431655765,e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24};function r(e){var t=32;return e&=-e,e&&t--,e&65535&&(t-=16),e&16711935&&(t-=8),e&252645135&&(t-=4),e&858993459&&(t-=2),e&1431655765&&--t,t}t.countTrailingZeros=r,t.nextPow2=function(e){return e+=e===0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,e&=15,27030>>>e&1};var i=Array(256);(function(e){for(var t=0;t<256;++t){var n=t,r=t,i=7;for(n>>>=1;n;n>>>=1)r<<=1,r|=n&1,--i;e[t]=r<<i&255}})(i),t.reverse=function(e){return i[e&255]<<24|i[e>>>8&255]<<16|i[e>>>16&255]<<8|i[e>>>24&255]},t.interleave2=function(e,t){return e&=65535,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t&=65535,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1},t.deinterleave2=function(e,t){return e=e>>>t&1431655765,e=(e|e>>>1)&858993459,e=(e|e>>>2)&252645135,e=(e|e>>>4)&16711935,e=(e|e>>>16)&65535,e<<16>>16},t.interleave3=function(e,t,n){return e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,t&=1023,t=(t|t<<16)&4278190335,t=(t|t<<8)&251719695,t=(t|t<<4)&3272356035,t=(t|t<<2)&1227133513,e|=t<<1,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,e|n<<2},t.deinterleave3=function(e,t){return e=e>>>t&1227133513,e=(e|e>>>2)&3272356035,e=(e|e>>>4)&251719695,e=(e|e>>>8)&4278190335,e=(e|e>>>16)&1023,e<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},2014:function(e,t,n){"use restrict";var r=n(3105),i=n(4623);function a(e){for(var t=0,n=Math.max,r=0,i=e.length;r<i;++r)t=n(t,e[r].length);return t-1}t.dimension=a;function o(e){for(var t=-1,n=Math.max,r=0,i=e.length;r<i;++r)for(var a=e[r],o=0,s=a.length;o<s;++o)t=n(t,a[o]);return t+1}t.countVertices=o;function s(e){for(var t=Array(e.length),n=0,r=e.length;n<r;++n)t[n]=e[n].slice(0);return t}t.cloneCells=s;function c(e,t){var n=e.length,r=e.length-t.length,i=Math.min;if(r)return r;switch(n){case 0:return 0;case 1:return e[0]-t[0];case 2:var a=e[0]+e[1]-t[0]-t[1];return a||i(e[0],e[1])-i(t[0],t[1]);case 3:var o=e[0]+e[1],s=t[0]+t[1];if(a=o+e[2]-(s+t[2]),a)return a;var c=i(e[0],e[1]),l=i(t[0],t[1]),a=i(c,e[2])-i(l,t[2]);return a||i(c+e[2],o)-i(l+t[2],s);default:var u=e.slice(0);u.sort();var d=t.slice(0);d.sort();for(var f=0;f<n;++f)if(r=u[f]-d[f],r)return r;return 0}}t.compareCells=c;function l(e,t){return c(e[0],t[0])}function u(e,t){if(t){for(var n=e.length,r=Array(n),i=0;i<n;++i)r[i]=[e[i],t[i]];r.sort(l);for(var i=0;i<n;++i)e[i]=r[i][0],t[i]=r[i][1];return e}else return e.sort(c),e}t.normalize=u;function d(e){if(e.length===0)return[];for(var t=1,n=e.length,r=1;r<n;++r){var i=e[r];if(c(i,e[r-1])){if(r===t){t++;continue}e[t++]=i}}return e.length=t,e}t.unique=d;function f(e,t){for(var n=0,r=e.length-1,i=-1;n<=r;){var a=n+r>>1,o=c(e[a],t);o<=0?(o===0&&(i=a),n=a+1):o>0&&(r=a-1)}return i}t.findCell=f;function p(e,t){for(var n=Array(e.length),i=0,a=n.length;i<a;++i)n[i]=[];for(var o=[],i=0,s=t.length;i<s;++i)for(var l=t[i],u=l.length,d=1,p=1<<u;d<p;++d){o.length=r.popCount(d);for(var m=0,h=0;h<u;++h)d&1<<h&&(o[m++]=l[h]);var g=f(e,o);if(!(g<0))for(;n[g++].push(i),!(g>=e.length||c(e[g],o)!==0););}return n}t.incidence=p;function m(e,t){if(!t)return p(d(g(e,0)),e,0);for(var n=Array(t),r=0;r<t;++r)n[r]=[];for(var r=0,i=e.length;r<i;++r)for(var a=e[r],o=0,s=a.length;o<s;++o)n[a[o]].push(r);return n}t.dual=m;function h(e){for(var t=[],n=0,r=e.length;n<r;++n)for(var i=e[n],a=i.length|0,o=1,s=1<<a;o<s;++o){for(var c=[],l=0;l<a;++l)o>>>l&1&&c.push(i[l]);t.push(c)}return u(t)}t.explode=h;function g(e,t){if(t<0)return[];for(var n=[],i=(1<<t+1)-1,a=0;a<e.length;++a)for(var o=e[a],s=i;s<1<<o.length;s=r.nextCombination(s)){for(var c=Array(t+1),l=0,d=0;d<o.length;++d)s&1<<d&&(c[l++]=o[d]);n.push(c)}return u(n)}t.skeleton=g;function _(e){for(var t=[],n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length;a<o;++a){for(var s=Array(i.length-1),c=0,l=0;c<o;++c)c!==a&&(s[l++]=i[c]);t.push(s)}return u(t)}t.boundary=_;function v(e,t){for(var n=new i(t),r=0;r<e.length;++r)for(var a=e[r],o=0;o<a.length;++o)for(var s=o+1;s<a.length;++s)n.link(a[o],a[s]);for(var c=[],l=n.ranks,r=0;r<l.length;++r)l[r]=-1;for(var r=0;r<e.length;++r){var u=n.find(e[r][0]);l[u]<0?(l[u]=c.length,c.push([e[r].slice(0)])):c[l[u]].push(e[r].slice(0))}return c}function y(e){for(var t=d(u(g(e,0))),n=new i(t.length),r=0;r<e.length;++r)for(var a=e[r],o=0;o<a.length;++o)for(var s=f(t,[a[o]]),c=o+1;c<a.length;++c)n.link(s,f(t,[a[c]]));for(var l=[],p=n.ranks,r=0;r<p.length;++r)p[r]=-1;for(var r=0;r<e.length;++r){var m=n.find(f(t,[e[r][0]]));p[m]<0?(p[m]=l.length,l.push([e[r].slice(0)])):l[p[m]].push(e[r].slice(0))}return l}function b(e,t){return t?v(e,t):y(e)}t.connectedComponents=b},4623:function(e){"use restrict";e.exports=t;function t(e){this.roots=Array(e),this.ranks=Array(e);for(var t=0;t<e;++t)this.roots[t]=t,this.ranks[t]=0}t.prototype.length=function(){return this.roots.length},t.prototype.makeSet=function(){var e=this.roots.length;return this.roots.push(e),this.ranks.push(0),e},t.prototype.find=function(e){for(var t=this.roots;t[e]!==e;){var n=t[e];t[e]=t[n],e=n}return e},t.prototype.link=function(e,t){var n=this.find(e),r=this.find(t);if(n!==r){var i=this.ranks,a=this.roots,o=i[n],s=i[r];o<s?a[n]=r:s<o?a[r]=n:(a[r]=n,++i[n])}}},5878:function(e,t,n){e.exports=o;var r=n(3250),i=n(2014);function a(e,t,n){return Math.abs(r(e,t,n))/Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}function o(e,t,n){for(var r=t.length,o=e.length,s=Array(r),c=Array(r),l=Array(r),u=Array(r),d=0;d<r;++d)s[d]=c[d]=-1,l[d]=1/0,u[d]=!1;for(var d=0;d<o;++d){var f=e[d];if(f.length!==2)throw Error(`Input must be a graph`);var p=f[1],m=f[0];c[m]===-1?c[m]=p:c[m]=-2,s[p]===-1?s[p]=m:s[p]=-2}function h(e){if(u[e])return 1/0;var n=s[e],r=c[e];return n<0||r<0?1/0:a(t[e],t[n],t[r])}function g(e,t){var n=w[e],r=w[t];w[e]=r,w[t]=n,T[n]=t,T[r]=e}function _(e){return l[w[e]]}function v(e){return e&1?e-1>>1:(e>>1)-1}function y(e){for(var t=_(e);;){var n=t,r=2*e+1,i=2*(e+1),a=e;if(r<E){var o=_(r);o<n&&(a=r,n=o)}if(i<E&&_(i)<n&&(a=i),a===e)return e;g(e,a),e=a}}function b(e){for(var t=_(e);e>0;){var n=v(e);if(n>=0&&t<_(n)){g(e,n),e=n;continue}return e}}function x(){if(E>0){var e=w[0];return g(0,E-1),--E,y(0),e}return-1}function S(e,t){var n=w[e];return l[n]===t?e:(l[n]=-1/0,b(e),x(),l[n]=t,E+=1,b(E-1))}function C(e){if(!u[e]){u[e]=!0;var t=s[e],n=c[e];s[n]>=0&&(s[n]=t),c[t]>=0&&(c[t]=n),T[t]>=0&&S(T[t],h(t)),T[n]>=0&&S(T[n],h(n))}}for(var w=[],T=Array(r),d=0;d<r;++d)(l[d]=h(d))<1/0?(T[d]=w.length,w.push(d)):T[d]=-1;for(var E=w.length,d=E>>1;d>=0;--d)y(d);for(;;){var D=x();if(D<0||l[D]>n)break;C(D)}for(var O=[],d=0;d<r;++d)u[d]||(T[d]=O.length,O.push(t[d].slice()));O.length;function k(e,t){if(e[t]<0)return t;var n=t,r=t;do{var i=e[r];if(!u[r]||i<0||i===r||(r=i,i=e[r],!u[r]||i<0||i===r))break;r=i,n=e[n]}while(n!==r);for(var a=t;a!==r;a=e[a])e[a]=r;return r}var A=[];return e.forEach(function(e){var t=k(s,e[0]),n=k(c,e[1]);if(t>=0&&n>=0&&t!==n){var r=T[t],i=T[n];r!==i&&A.push([r,i])}}),i.unique(i.normalize(A)),{positions:O,edges:A}}},1303:function(e,t,n){e.exports=a;var r=n(3250);function i(e,t){var n,i;if(t[0][0]<t[1][0])n=t[0],i=t[1];else if(t[0][0]>t[1][0])n=t[1],i=t[0];else{var a=Math.min(e[0][1],e[1][1]),o=Math.max(e[0][1],e[1][1]),s=Math.min(t[0][1],t[1][1]),c=Math.max(t[0][1],t[1][1]);return o<s?o-s:a>c?a-c:o-c}var l,u;e[0][1]<e[1][1]?(l=e[0],u=e[1]):(l=e[1],u=e[0]);var d=r(i,n,l);return d||(d=r(i,n,u),d)?d:u-i}function a(e,t){var n,a;if(t[0][0]<t[1][0])n=t[0],a=t[1];else if(t[0][0]>t[1][0])n=t[1],a=t[0];else return i(t,e);var o,s;if(e[0][0]<e[1][0])o=e[0],s=e[1];else if(e[0][0]>e[1][0])o=e[1],s=e[0];else return-i(e,t);var c=r(n,a,s),l=r(n,a,o);if(c<0){if(l<=0)return c}else if(c>0){if(l>=0)return c}else if(l)return l;if(c=r(s,o,a),l=r(s,o,n),c<0){if(l<=0)return c}else if(c>0){if(l>=0)return c}else if(l)return l;return a[0]-s[0]}},4209:function(e,t,n){e.exports=p;var r=n(2478),i=n(3840),a=n(3250),o=n(1303);function s(e,t,n){this.slabs=e,this.coordinates=t,this.horizontal=n}var c=s.prototype;function l(e,t){return e.y-t}function u(e,t){for(var n=null;e;){var r=e.key,i,o;r[0][0]<r[1][0]?(i=r[0],o=r[1]):(i=r[1],o=r[0]);var s=a(i,o,t);if(s<0)e=e.left;else if(s>0)if(t[0]!==r[1][0])n=e,e=e.right;else{var c=u(e.right,t);if(c)return c;e=e.left}else{if(t[0]!==r[1][0])return e;var c=u(e.right,t);if(c)return c;e=e.left}}return n}c.castUp=function(e){var t=r.le(this.coordinates,e[0]);if(t<0)return-1;this.slabs[t];var n=u(this.slabs[t],e),i=-1;if(n&&(i=n.value),this.coordinates[t]===e[0]){var s=null;if(n&&(s=n.key),t>0){var c=u(this.slabs[t-1],e);c&&(s?o(c.key,s)>0&&(s=c.key,i=c.value):(i=c.value,s=c.key))}var d=this.horizontal[t];if(d.length>0){var f=r.ge(d,e[1],l);if(f<d.length){var p=d[f];if(e[1]===p.y){if(p.closed)return p.index;for(;f<d.length-1&&d[f+1].y===e[1];)if(f+=1,p=d[f],p.closed)return p.index;if(p.y===e[1]&&!p.start){if(f+=1,f>=d.length)return i;p=d[f]}}if(p.start)if(s){var m=a(s[0],s[1],[e[0],p.y]);s[0][0]>s[1][0]&&(m=-m),m>0&&(i=p.index)}else i=p.index;else p.y!==e[1]&&(i=p.index)}}}return i};function d(e,t,n,r){this.y=e,this.index=t,this.start=n,this.closed=r}function f(e,t,n,r){this.x=e,this.segment=t,this.create=n,this.index=r}function p(e){for(var t=e.length,n=2*t,r=Array(n),a=0;a<t;++a){var c=e[a],l=c[0][0]<c[1][0];r[2*a]=new f(c[0][0],c,l,a),r[2*a+1]=new f(c[1][0],c,!l,a)}r.sort(function(e,t){var n=e.x-t.x;return n||(n=e.create-t.create,n)?n:Math.min(e.segment[0][1],e.segment[1][1])-Math.min(t.segment[0][1],t.segment[1][1])});for(var u=i(o),p=[],m=[],h=[],a=0;a<n;){for(var g=r[a].x,_=[];a<n;){var v=r[a];if(v.x!==g)break;a+=1,v.segment[0][0]===v.x&&v.segment[1][0]===v.x?v.create&&(v.segment[0][1]<v.segment[1][1]?(_.push(new d(v.segment[0][1],v.index,!0,!0)),_.push(new d(v.segment[1][1],v.index,!1,!1))):(_.push(new d(v.segment[1][1],v.index,!0,!1)),_.push(new d(v.segment[0][1],v.index,!1,!0)))):u=v.create?u.insert(v.segment,v.index):u.remove(v.segment)}p.push(u.root),m.push(g),h.push(_)}return new s(p,m,h)}},5202:function(e,t,n){var r=n(1944),i=n(8210);e.exports=s,e.exports.positive=c,e.exports.negative=l;function a(e,t){var n=i(r(e,t),[t[t.length-1]]);return n[n.length-1]}function o(e,t,n,r){var i=r-t,a=-t/i;a<0?a=0:a>1&&(a=1);for(var o=1-a,s=e.length,c=Array(s),l=0;l<s;++l)c[l]=a*e[l]+o*n[l];return c}function s(e,t){for(var n=[],r=[],i=a(e[e.length-1],t),s=e[e.length-1],c=e[0],l=0;l<e.length;++l,s=c){c=e[l];var u=a(c,t);if(i<0&&u>0||i>0&&u<0){var d=o(s,u,c,i);n.push(d),r.push(d.slice())}u<0?r.push(c.slice()):u>0?n.push(c.slice()):(n.push(c.slice()),r.push(c.slice())),i=u}return{positive:n,negative:r}}function c(e,t){for(var n=[],r=a(e[e.length-1],t),i=e[e.length-1],s=e[0],c=0;c<e.length;++c,i=s){s=e[c];var l=a(s,t);(r<0&&l>0||r>0&&l<0)&&n.push(o(i,l,s,r)),l>=0&&n.push(s.slice()),r=l}return n}function l(e,t){for(var n=[],r=a(e[e.length-1],t),i=e[e.length-1],s=e[0],c=0;c<e.length;++c,i=s){s=e[c];var l=a(s,t);(r<0&&l>0||r>0&&l<0)&&n.push(o(i,l,s,r)),l<=0&&n.push(s.slice()),r=l}return n}},3387:function(e,t,n){var r;(function(){var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(e){return s(l(e),arguments)}function o(e,t){return a.apply(null,[e].concat(t||[]))}function s(e,t){var n=1,r=e.length,o,s=``,c,l,u,d,f,p,m,h;for(c=0;c<r;c++)if(typeof e[c]==`string`)s+=e[c];else if(typeof e[c]==`object`){if(u=e[c],u.keys)for(o=t[n],l=0;l<u.keys.length;l++){if(o==null)throw Error(a(`[sprintf] Cannot access property "%s" of undefined value "%s"`,u.keys[l],u.keys[l-1]));o=o[u.keys[l]]}else o=u.param_no?t[u.param_no]:t[n++];if(i.not_type.test(u.type)&&i.not_primitive.test(u.type)&&o instanceof Function&&(o=o()),i.numeric_arg.test(u.type)&&typeof o!=`number`&&isNaN(o))throw TypeError(a(`[sprintf] expecting number but found %T`,o));switch(i.number.test(u.type)&&(m=o>=0),u.type){case`b`:o=parseInt(o,10).toString(2);break;case`c`:o=String.fromCharCode(parseInt(o,10));break;case`d`:case`i`:o=parseInt(o,10);break;case`j`:o=JSON.stringify(o,null,u.width?parseInt(u.width):0);break;case`e`:o=u.precision?parseFloat(o).toExponential(u.precision):parseFloat(o).toExponential();break;case`f`:o=u.precision?parseFloat(o).toFixed(u.precision):parseFloat(o);break;case`g`:o=u.precision?String(Number(o.toPrecision(u.precision))):parseFloat(o);break;case`o`:o=(parseInt(o,10)>>>0).toString(8);break;case`s`:o=String(o),o=u.precision?o.substring(0,u.precision):o;break;case`t`:o=String(!!o),o=u.precision?o.substring(0,u.precision):o;break;case`T`:o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=u.precision?o.substring(0,u.precision):o;break;case`u`:o=parseInt(o,10)>>>0;break;case`v`:o=o.valueOf(),o=u.precision?o.substring(0,u.precision):o;break;case`x`:o=(parseInt(o,10)>>>0).toString(16);break;case`X`:o=(parseInt(o,10)>>>0).toString(16).toUpperCase();break}i.json.test(u.type)?s+=o:(i.number.test(u.type)&&(!m||u.sign)?(h=m?`+`:`-`,o=o.toString().replace(i.sign,``)):h=``,f=u.pad_char?u.pad_char===`0`?`0`:u.pad_char.charAt(1):` `,p=u.width-(h+o).length,d=u.width&&p>0?f.repeat(p):``,s+=u.align?h+o+d:f===`0`?h+d+o:d+h+o)}return s}var c=Object.create(null);function l(e){if(c[e])return c[e];for(var t=e,n,r=[],a=0;t;){if((n=i.text.exec(t))!==null)r.push(n[0]);else if((n=i.modulo.exec(t))!==null)r.push(`%`);else if((n=i.placeholder.exec(t))!==null){if(n[2]){a|=1;var o=[],s=n[2],l=[];if((l=i.key.exec(s))!==null)for(o.push(l[1]);(s=s.substring(l[0].length))!==``;)if((l=i.key_access.exec(s))!==null)o.push(l[1]);else if((l=i.index_access.exec(s))!==null)o.push(l[1]);else throw SyntaxError(`[sprintf] failed to parse named argument key`);else throw SyntaxError(`[sprintf] failed to parse named argument key`);n[2]=o}else a|=2;if(a===3)throw Error(`[sprintf] mixing positional and named placeholders is not (yet) supported`);r.push({placeholder:n[0],param_no:n[1],keys:n[2],sign:n[3],pad_char:n[4],align:n[5],width:n[6],precision:n[7],type:n[8]})}else throw SyntaxError(`[sprintf] unexpected placeholder`);t=t.substring(n[0].length)}return c[e]=r}t.sprintf=a,t.vsprintf=o,typeof window<`u`&&(window.sprintf=a,window.vsprintf=o,r=function(){return{sprintf:a,vsprintf:o}}.call(t,n,t,e),r!==void 0&&(e.exports=r))})()},3711:function(e,t,n){e.exports=l;var r=n(2640),i=n(781),a={"2d":function(e,t,n){var r=e({order:t,scalarArguments:3,getters:n===`generic`?[0]:void 0,phase:function(e,t,n,r){return e>r|0},vertex:function(e,t,n,r,i,a,o,s,c,l,u,d,f){var p=(o<<0)+(s<<1)+(c<<2)+(l<<3)|0;if(!(p===0||p===15))switch(p){case 0:u.push([e-.5,t-.5]);break;case 1:u.push([e-.25-.25*(r+n-2*f)/(n-r),t-.25-.25*(i+n-2*f)/(n-i)]);break;case 2:u.push([e-.75-.25*(-r-n+2*f)/(r-n),t-.25-.25*(a+r-2*f)/(r-a)]);break;case 3:u.push([e-.5,t-.5-.5*(i+n+a+r-4*f)/(n-i+r-a)]);break;case 4:u.push([e-.25-.25*(a+i-2*f)/(i-a),t-.75-.25*(-i-n+2*f)/(i-n)]);break;case 5:u.push([e-.5-.5*(r+n+a+i-4*f)/(n-r+i-a),t-.5]);break;case 6:u.push([e-.5-.25*(-r-n+a+i)/(r-n+i-a),t-.5-.25*(-i-n+a+r)/(i-n+r-a)]);break;case 7:u.push([e-.75-.25*(a+i-2*f)/(i-a),t-.75-.25*(a+r-2*f)/(r-a)]);break;case 8:u.push([e-.75-.25*(-a-i+2*f)/(a-i),t-.75-.25*(-a-r+2*f)/(a-r)]);break;case 9:u.push([e-.5-.25*(r+n+-a-i)/(n-r+a-i),t-.5-.25*(i+n+-a-r)/(n-i+a-r)]);break;case 10:u.push([e-.5-.5*(-r-n+-a-i+4*f)/(r-n+a-i),t-.5]);break;case 11:u.push([e-.25-.25*(-a-i+2*f)/(a-i),t-.75-.25*(i+n-2*f)/(n-i)]);break;case 12:u.push([e-.5,t-.5-.5*(-i-n+-a-r+4*f)/(i-n+a-r)]);break;case 13:u.push([e-.75-.25*(r+n-2*f)/(n-r),t-.25-.25*(-a-r+2*f)/(a-r)]);break;case 14:u.push([e-.25-.25*(-r-n+2*f)/(r-n),t-.25-.25*(-i-n+2*f)/(i-n)]);break;case 15:u.push([e-.5,t-.5]);break}},cell:function(e,t,n,r,i,a,o,s,c){i?s.push([e,t]):s.push([t,e])}});return function(e,t){var n=[],i=[];return r(e,n,i,t),{positions:n,cells:i}}}};function o(e,t){var n=a[e.length+`d`];if(n)return n(r,e,t)}function s(e,t){for(var n=i(e,t),r=n.length,a=Array(r),o=Array(r),s=0;s<r;++s)a[s]=[n[s]],o[s]=[s];return{positions:a,cells:o}}var c={};function l(e,t){if(e.dimension<=0)return{positions:[],cells:[]};if(e.dimension===1)return s(e,t);var n=e.order.join()+`-`+e.dtype,r=c[n],t=+t||0;return r||=c[n]=o(e.order,e.dtype),r(e,t)}},665:function(e,t,n){var r=n(3202);e.exports=s;var i=96;function a(e,t){var n=r(getComputedStyle(e).getPropertyValue(t));return n[0]*s(n[1],e)}function o(e,t){var n=document.createElement(`div`);n.style[`font-size`]=`128`+e,t.appendChild(n);var r=a(n,`font-size`)/128;return t.removeChild(n),r}function s(e,t){switch(t||=document.body,e=(e||`px`).trim().toLowerCase(),(t===window||t===document)&&(t=document.body),e){case`%`:return t.clientHeight/100;case`ch`:case`ex`:return o(e,t);case`em`:return a(t,`font-size`);case`rem`:return a(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 i;case`cm`:return i/2.54;case`mm`:return i/25.4;case`pt`:return i/72;case`pc`:return i/6}return 1}},7261:function(e,t,n){e.exports=h;var r=n(9215),i=n(7608),a=n(6079),o=n(5911),s=n(3536),c=n(244);function l(e,t,n){return Math.sqrt(e**2+t**2+n**2)}function u(e){return Math.min(1,Math.max(-1,e))}function d(e){var t=Math.abs(e[0]),n=Math.abs(e[1]),r=Math.abs(e[2]),i=[0,0,0];t>Math.max(n,r)?i[2]=1:n>Math.max(t,r)?i[0]=1:i[1]=1;for(var a=0,o=0,c=0;c<3;++c)a+=e[c]*e[c],o+=i[c]*e[c];for(var c=0;c<3;++c)i[c]-=o/a*e[c];return s(i,i),i}function f(e,t,n,i,a,o,s,c){this.center=r(n),this.up=r(i),this.right=r(a),this.radius=r([o]),this.angle=r([s,c]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(e,t),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=Array(16);for(var l=0;l<16;++l)this.computedMatrix[l]=.5;this.recalcMatrix(0)}var p=f.prototype;p.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},p.getDistanceLimits=function(e){var t=this.radius.bounds[0];return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},p.recalcMatrix=function(e){this.center.curve(e),this.up.curve(e),this.right.curve(e),this.radius.curve(e),this.angle.curve(e);for(var t=this.computedUp,n=this.computedRight,r=0,i=0,a=0;a<3;++a)i+=t[a]*n[a],r+=t[a]*t[a];for(var c=Math.sqrt(r),u=0,a=0;a<3;++a)n[a]-=t[a]*i/r,u+=n[a]*n[a],t[a]/=c;for(var d=Math.sqrt(u),a=0;a<3;++a)n[a]/=d;var f=this.computedToward;o(f,t,n),s(f,f);for(var p=Math.exp(this.computedRadius[0]),m=this.computedAngle[0],h=this.computedAngle[1],g=Math.cos(m),_=Math.sin(m),v=Math.cos(h),y=Math.sin(h),b=this.computedCenter,x=g*v,S=_*v,C=y,w=-g*y,T=-_*y,E=v,D=this.computedEye,O=this.computedMatrix,a=0;a<3;++a){var k=x*n[a]+S*f[a]+C*t[a];O[4*a+1]=w*n[a]+T*f[a]+E*t[a],O[4*a+2]=k,O[4*a+3]=0}var A=O[1],j=O[5],M=O[9],N=O[2],P=O[6],F=O[10],I=j*F-M*P,L=M*N-A*F,R=A*P-j*N,z=l(I,L,R);I/=z,L/=z,R/=z,O[0]=I,O[4]=L,O[8]=R;for(var a=0;a<3;++a)D[a]=b[a]+O[2+4*a]*p;for(var a=0;a<3;++a){for(var u=0,B=0;B<3;++B)u+=O[a+4*B]*D[B];O[12+a]=-u}O[15]=1},p.getMatrix=function(e,t){this.recalcMatrix(e);var n=this.computedMatrix;if(t){for(var r=0;r<16;++r)t[r]=n[r];return t}return n};var m=[0,0,0];p.rotate=function(e,t,n,r){if(this.angle.move(e,t,n),r){this.recalcMatrix(e);var i=this.computedMatrix;m[0]=i[2],m[1]=i[6],m[2]=i[10];for(var o=this.computedUp,s=this.computedRight,c=this.computedToward,l=0;l<3;++l)i[4*l]=o[l],i[4*l+1]=s[l],i[4*l+2]=c[l];a(i,i,r,m);for(var l=0;l<3;++l)o[l]=i[4*l],s[l]=i[4*l+1];this.up.set(e,o[0],o[1],o[2]),this.right.set(e,s[0],s[1],s[2])}},p.pan=function(e,t,n,r){t||=0,n||=0,r||=0,this.recalcMatrix(e);var i=this.computedMatrix;Math.exp(this.computedRadius[0]);var a=i[1],o=i[5],s=i[9],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],d=i[4],f=i[8],p=u*a+d*o+f*s;u-=a*p,d-=o*p,f-=s*p;var m=l(u,d,f);u/=m,d/=m,f/=m;var h=u*t+a*n,g=d*t+o*n,_=f*t+s*n;this.center.move(e,h,g,_);var v=Math.exp(this.computedRadius[0]);v=Math.max(1e-4,v+r),this.radius.set(e,Math.log(v))},p.translate=function(e,t,n,r){this.center.move(e,t||0,n||0,r||0)},p.setMatrix=function(e,t,n,r){var a=1;typeof n==`number`&&(a=n|0),(a<0||a>3)&&(a=1);var o=(a+2)%3;(a+1)%3,t||=(this.recalcMatrix(e),this.computedMatrix);var s=t[a],c=t[a+4],d=t[a+8];if(r){var f=Math.abs(s),p=Math.abs(c),m=Math.abs(d),h=Math.max(f,p,m);f===h?(s=s<0?-1:1,c=d=0):m===h?(d=d<0?-1:1,s=c=0):(c=c<0?-1:1,s=d=0)}else{var g=l(s,c,d);s/=g,c/=g,d/=g}var _=t[o],v=t[o+4],y=t[o+8],b=_*s+v*c+y*d;_-=s*b,v-=c*b,y-=d*b;var x=l(_,v,y);_/=x,v/=x,y/=x;var S=c*y-d*v,C=d*_-s*y,w=s*v-c*_,T=l(S,C,w);S/=T,C/=T,w/=T,this.center.jump(e,W,G,K),this.radius.idle(e),this.up.jump(e,s,c,d),this.right.jump(e,_,v,y);var E,D;if(a===2){var O=t[1],k=t[5],A=t[9],j=O*_+k*v+A*y,M=O*S+k*C+A*w;E=I<0?-Math.PI/2:Math.PI/2,D=Math.atan2(M,j)}else{var N=t[2],P=t[6],F=t[10],I=N*s+P*c+F*d,L=N*_+P*v+F*y,R=N*S+P*C+F*w;E=Math.asin(u(I)),D=Math.atan2(R,L)}this.angle.jump(e,D,E),this.recalcMatrix(e);var z=t[2],B=t[6],V=t[10],H=this.computedMatrix;i(H,t);var U=H[15],W=H[12]/U,G=H[13]/U,K=H[14]/U,q=Math.exp(this.computedRadius[0]);this.center.jump(e,W-z*q,G-B*q,K-V*q)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(e){this.center.idle(e),this.up.idle(e),this.right.idle(e),this.radius.idle(e),this.angle.idle(e)},p.flush=function(e){this.center.flush(e),this.up.flush(e),this.right.flush(e),this.radius.flush(e),this.angle.flush(e)},p.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},p.lookAt=function(e,t,n,r){this.recalcMatrix(e),t||=this.computedEye,n||=this.computedCenter,r||=this.computedUp;var i=r[0],a=r[1],o=r[2],s=l(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var c=t[0]-n[0],d=t[1]-n[1],f=t[2]-n[2],p=l(c,d,f);if(!(p<1e-6)){c/=p,d/=p,f/=p;var m=this.computedRight,h=m[0],g=m[1],_=m[2],v=i*h+a*g+o*_;h-=v*i,g-=v*a,_-=v*o;var y=l(h,g,_);if(!(y<.01&&(h=a*f-o*d,g=o*c-i*f,_=i*d-a*c,y=l(h,g,_),y<1e-6))){h/=y,g/=y,_/=y,this.up.set(e,i,a,o),this.right.set(e,h,g,_),this.center.set(e,n[0],n[1],n[2]),this.radius.set(e,Math.log(p));var b=a*_-o*g,x=o*h-i*_,S=i*g-a*h,C=l(b,x,S);b/=C,x/=C,S/=C;var w=i*c+a*d+o*f,T=h*c+g*d+_*f,E=b*c+x*d+S*f,D=Math.asin(u(w)),O=Math.atan2(E,T),k=this.angle._state,A=k[k.length-1],j=k[k.length-2];A%=2*Math.PI;var M=Math.abs(A+2*Math.PI-O),N=Math.abs(A-O),P=Math.abs(A-2*Math.PI-O);M<N&&(A+=2*Math.PI),P<N&&(A-=2*Math.PI),this.angle.jump(this.angle.lastT(),A,j),this.angle.set(e,O,D)}}}};function h(e){e||={};var t=e.center||[0,0,0],n=e.up||[0,1,0],r=e.right||d(n),i=e.radius||1,a=e.theta||0,u=e.phi||0;if(t=[].slice.call(t,0,3),n=[].slice.call(n,0,3),s(n,n),r=[].slice.call(r,0,3),s(r,r),`eye`in e){var p=e.eye,m=[p[0]-t[0],p[1]-t[1],p[2]-t[2]];o(r,m,n),l(r[0],r[1],r[2])<1e-6?r=d(n):s(r,r),i=l(m[0],m[1],m[2]);var h=c(n,m)/i,g=c(r,m)/i;u=Math.acos(h),a=Math.acos(g)}return i=Math.log(i),new f(e.zoomMin,e.zoomMax,t,n,r,i,a,u)}},5250:function(e){e.exports=n;var t=+(2**27+1);function n(e,n,r){var i=e*n,a=t*e,o=a-(a-e),s=e-o,c=t*n,l=c-(c-n),u=n-l,d=i-o*l-s*l-o*u,f=s*u-d;return r?(r[0]=f,r[1]=i,r):[f,i]}},9362:function(e){e.exports=t;function t(e,t,n){var r=e+t,i=r-e,a=r-i,o=t-i,s=e-a;return n?(n[0]=s+o,n[1]=r,n):[s+o,r]}},1888:function(e,t,n){var r=n(8828),i=n(1338),a=n(4793).hp;n.g.__TYPEDARRAY_POOL||(n.g.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o=typeof Uint8ClampedArray<`u`,s=typeof BigUint64Array<`u`,c=typeof BigInt64Array<`u`,l=n.g.__TYPEDARRAY_POOL;l.UINT8C||=i([32,0]),l.BIGUINT64||=i([32,0]),l.BIGINT64||=i([32,0]),l.BUFFER||=i([32,0]);var u=l.DATA,d=l.BUFFER;t.free=function(e){if(a.isBuffer(e))d[r.log2(e.length)].push(e);else{if(Object.prototype.toString.call(e)!==`[object ArrayBuffer]`&&(e=e.buffer),!e)return;var t=e.length||e.byteLength;u[r.log2(t)|0].push(e)}};function f(e){if(e){var t=e.length||e.byteLength;u[r.log2(t)].push(e)}}function p(e){f(e.buffer)}t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=p,t.freeArrayBuffer=f,t.freeBuffer=function(e){d[r.log2(e.length)].push(e)},t.malloc=function(e,t){if(t===void 0||t===`arraybuffer`)return m(e);switch(t){case`uint8`:return h(e);case`uint16`:return g(e);case`uint32`:return _(e);case`int8`:return v(e);case`int16`:return y(e);case`int32`:return b(e);case`float`:case`float32`:return x(e);case`double`:case`float64`:return S(e);case`uint8_clamped`:return C(e);case`bigint64`:return T(e);case`biguint64`:return w(e);case`buffer`:return D(e);case`data`:case`dataview`:return E(e);default:return null}return null};function m(e){var e=r.nextPow2(e),t=u[r.log2(e)];return t.length>0?t.pop():new ArrayBuffer(e)}t.mallocArrayBuffer=m;function h(e){return new Uint8Array(m(e),0,e)}t.mallocUint8=h;function g(e){return new Uint16Array(m(2*e),0,e)}t.mallocUint16=g;function _(e){return new Uint32Array(m(4*e),0,e)}t.mallocUint32=_;function v(e){return new Int8Array(m(e),0,e)}t.mallocInt8=v;function y(e){return new Int16Array(m(2*e),0,e)}t.mallocInt16=y;function b(e){return new Int32Array(m(4*e),0,e)}t.mallocInt32=b;function x(e){return new Float32Array(m(4*e),0,e)}t.mallocFloat32=t.mallocFloat=x;function S(e){return new Float64Array(m(8*e),0,e)}t.mallocFloat64=t.mallocDouble=S;function C(e){return o?new Uint8ClampedArray(m(e),0,e):h(e)}t.mallocUint8Clamped=C;function w(e){return s?new BigUint64Array(m(8*e),0,e):null}t.mallocBigUint64=w;function T(e){return c?new BigInt64Array(m(8*e),0,e):null}t.mallocBigInt64=T;function E(e){return new DataView(m(e),0,e)}t.mallocDataView=E;function D(e){e=r.nextPow2(e);var t=d[r.log2(e)];return t.length>0?t.pop():new a(e)}t.mallocBuffer=D,t.clearCache=function(){for(var e=0;e<32;++e)l.UINT8[e].length=0,l.UINT16[e].length=0,l.UINT32[e].length=0,l.INT8[e].length=0,l.INT16[e].length=0,l.INT32[e].length=0,l.FLOAT[e].length=0,l.DOUBLE[e].length=0,l.BIGUINT64[e].length=0,l.BIGINT64[e].length=0,l.UINT8C[e].length=0,u[e].length=0,d[e].length=0}},1755:function(e){"use restrict";e.exports=t;function t(e){this.roots=Array(e),this.ranks=Array(e);for(var t=0;t<e;++t)this.roots[t]=t,this.ranks[t]=0}var n=t.prototype;Object.defineProperty(n,`length`,{get:function(){return this.roots.length}}),n.makeSet=function(){var e=this.roots.length;return this.roots.push(e),this.ranks.push(0),e},n.find=function(e){for(var t=e,n=this.roots;n[e]!==e;)e=n[e];for(;n[t]!==e;){var r=n[t];n[t]=e,t=r}return e},n.link=function(e,t){var n=this.find(e),r=this.find(t);if(n!==r){var i=this.ranks,a=this.roots,o=i[n],s=i[r];o<s?a[n]=r:s<o?a[r]=n:(a[r]=n,++i[n])}}},1682:function(e){function t(e,t){for(var n=1,r=e.length,i=e[0],a=e[0],o=1;o<r;++o)if(a=i,i=e[o],t(i,a)){if(o===n){n++;continue}e[n++]=i}return e.length=n,e}function n(e){for(var t=1,n=e.length,r=e[0],i=e[0],a=1;a<n;++a,i=r)if(i=r,r=e[a],r!==i){if(a===t){t++;continue}e[t++]=r}return e.length=t,e}function r(e,r,i){return e.length===0?e:r?(i||e.sort(r),t(e,r)):(i||e.sort(),n(e))}e.exports=r},4359:function(e,t,n){e.exports=o;var r=n(7718),i=null,a=null;typeof document<`u`&&(i=document.createElement(`canvas`),i.width=8192,i.height=1024,a=i.getContext(`2d`));function o(e,t){return(typeof t!=`object`||!t)&&(t={}),r(e,t.canvas||i,t.context||a,t)}},7718:function(e,t,n){e.exports=T,e.exports.processPixels=w;var r=n(3711),i=n(9618),a=n(5878),o=n(332),s=n(2538),c=n(2095),l=`b`,u=`b|`,d=`i`,f=`i|`,p=`sup`,m=`+`,h=`+1`,g=`sub`,_=`-`,v=`-1`;function y(e,t,n,r){for(var i=`<`+e+`>`,a=`</`+e+`>`,o=i.length,s=a.length,c=t[0]===m||t[0]===_,l=0,u=-s;l>-1&&(l=n.indexOf(i,l),!(l===-1||(u=n.indexOf(a,l+o),u===-1)||u<=l));){for(var d=l;d<u+s;++d)if(d<l+o||d>=u)r[d]=null,n=n.substr(0,d)+` `+n.substr(d+1);else if(r[d]!==null){var f=r[d].indexOf(t[0]);f===-1?r[d]+=t:c&&(r[d]=r[d].substr(0,f+1)+(1+parseInt(r[d][f+1]))+r[d].substr(f+2))}var p=l+o,h=n.substr(p,u-p).indexOf(i);l=h===-1?u+s:h}return r}function b(e,t,n){for(var r=t.textAlign||`start`,i=t.textBaseline||`alphabetic`,a=[1<<30,1<<30],o=[0,0],s=e.length,c=0;c<s;++c)for(var l=e[c],u=0;u<2;++u)a[u]=Math.min(a[u],l[u])|0,o[u]=Math.max(o[u],l[u])|0;var d=0;switch(r){case`center`:d=-.5*(a[0]+o[0]);break;case`right`:case`end`:d=-o[0];break;case`left`:case`start`:d=-a[0];break;default:throw Error(`vectorize-text: Unrecognized textAlign: '`+r+`'`)}var f=0;switch(i){case`hanging`:case`top`:f=-a[1];break;case`middle`:f=-.5*(a[1]+o[1]);break;case`alphabetic`:case`ideographic`:f=-3*n;break;case`bottom`:f=-o[1];break;default:throw Error(`vectorize-text: Unrecoginized textBaseline: '`+i+`'`)}var p=1/n;return`lineHeight`in t?p*=+t.lineHeight:`width`in t?p=t.width/(o[0]-a[0]):`height`in t&&(p=t.height/(o[1]-a[1])),e.map(function(e){return[p*(e[0]+d),p*(e[1]+f)]})}function x(e,t,n,r,a,o){n=n.replace(/\n/g,``),n=o.breaklines===!0?n.replace(/\<br\>/g,`
`):n.replace(/\<br\>/g,` `);var s=``,c=[];for(A=0;A<n.length;++A)c[A]=s;o.bolds===!0&&(c=y(l,u,n,c)),o.italics===!0&&(c=y(d,f,n,c)),o.superscripts===!0&&(c=y(p,h,n,c)),o.subscripts===!0&&(c=y(g,v,n,c));var b=[],x=``;for(A=0;A<n.length;++A)c[A]!==null&&(x+=n[A],b.push(c[A]));var S=x.split(`
`),C=S.length,w=Math.round(a*r),T=r,E=r*2,D=0,O=C*w+E;e.height<O&&(e.height=O),t.fillStyle=`#000`,t.fillRect(0,0,e.width,e.height),t.fillStyle=`#fff`;var k,A,j,M,N,P=0,F=``;function I(){if(F!==``){var e=t.measureText(F).width;t.fillText(F,T+j,E+M),j+=e}}function L(){return``+Math.round(N)+`px `}function R(e,n){var r=``+t.font;if(o.subscripts===!0){var i=e.indexOf(_),a=n.indexOf(_),s=i>-1?parseInt(e[1+i]):0,c=a>-1?parseInt(n[1+a]):0;s!==c&&(r=r.replace(L(),`?px `),N*=.75**(c-s),r=r.replace(`?px `,L())),M+=.25*w*(c-s)}if(o.superscripts===!0){var l=e.indexOf(m),d=n.indexOf(m),p=l>-1?parseInt(e[1+l]):0,h=d>-1?parseInt(n[1+d]):0;p!==h&&(r=r.replace(L(),`?px `),N*=.75**(h-p),r=r.replace(`?px `,L())),M-=.25*w*(h-p)}if(o.bolds===!0){var g=e.indexOf(u)>-1,v=n.indexOf(u)>-1;!g&&v&&(r=y?r.replace(`italic `,`italic bold `):`bold `+r),g&&!v&&(r=r.replace(`bold `,``))}if(o.italics===!0){var y=e.indexOf(f)>-1,b=n.indexOf(f)>-1;!y&&b&&(r=`italic `+r),y&&!b&&(r=r.replace(`italic `,``))}t.font=r}for(k=0;k<C;++k){var z=S[k]+`
`;for(j=0,M=k*w,N=r,F=``,A=0;A<z.length;++A){var B=A+P<b.length?b[A+P]:b[b.length-1];s===B?F+=z[A]:(I(),F=z[A],B!==void 0&&(R(s,B),s=B))}I(),P+=z.length;var V=Math.round(j+2*T)|0;D<V&&(D=V)}var H=D,U=E+w*C;return i(t.getImageData(0,0,H,U).data,[U,H,4]).pick(-1,-1,0).transpose(1,0)}function S(e,t){var n=r(e,128);return t?a(n.cells,n.positions,.25):{edges:n.cells,positions:n.positions}}function C(e,t,n,r){var i=S(e,r),a=b(i.positions,t,n),l=i.edges,u=t.orientation===`ccw`;if(o(a,l),t.polygons||t.polygon||t.polyline){for(var d=c(l,a),f=Array(d.length),p=0;p<d.length;++p){for(var m=d[p],h=Array(m.length),g=0;g<m.length;++g){for(var _=m[g],v=Array(_.length),y=0;y<_.length;++y)v[y]=a[_[y]].slice();u&&v.reverse(),h[g]=v}f[p]=h}return f}else return t.triangles||t.triangulate||t.triangle?{cells:s(a,l,{delaunay:!1,exterior:!1,interior:!0}),positions:a}:{edges:l,positions:a}}function w(e,t,n){try{return C(e,t,n,!0)}catch{}try{return C(e,t,n,!1)}catch{}return t.polygons||t.polyline||t.polygon?[]:t.triangles||t.triangulate||t.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function T(e,t,n,r){var i=64,a=1.25,o={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};return r&&(r.size&&r.size>0&&(i=r.size),r.lineSpacing&&r.lineSpacing>0&&(a=r.lineSpacing),r.styletags&&r.styletags.breaklines&&(o.breaklines=!!r.styletags.breaklines),r.styletags&&r.styletags.bolds&&(o.bolds=!!r.styletags.bolds),r.styletags&&r.styletags.italics&&(o.italics=!!r.styletags.italics),r.styletags&&r.styletags.subscripts&&(o.subscripts=!!r.styletags.subscripts),r.styletags&&r.styletags.superscripts&&(o.superscripts=!!r.styletags.superscripts)),n.font=[r.fontStyle,r.fontVariant,r.fontWeight,i+`px`,r.font].filter(function(e){return e}).join(` `),n.textAlign=`start`,n.textBaseline=`alphabetic`,n.direction=`ltr`,w(x(t,n,e,i,a,o),r,i)}},1538:function(e){(function(){if(typeof ses<`u`&&ses.ok&&!ses.ok())return;function t(e){e.permitHostObjects___&&e.permitHostObjects___(t)}typeof ses<`u`&&(ses.weakMapPermitHostObjects=t);var n=!1;if(typeof WeakMap==`function`){var r=WeakMap;if(!(typeof navigator<`u`&&/Firefox/.test(navigator.userAgent))){var i=new r,a=Object.freeze({});if(i.set(a,1),i.get(a)!==1)n=!0;else{e.exports=WeakMap;return}}}var o=Object.getOwnPropertyNames,s=Object.defineProperty,c=Object.isExtensible,l=`weakmap:`,u=l+`ident:`+Math.random()+`___`;if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`&&typeof ArrayBuffer==`function`&&typeof Uint8Array==`function`){var d=new Uint8Array(new ArrayBuffer(25));crypto.getRandomValues(d),u=l+`rand:`+Array.prototype.map.call(d,function(e){return(e%36).toString(36)}).join(``)+`___`}function f(e){return!(e.substr(0,l.length)==l&&e.substr(e.length-3)===`___`)}if(s(Object,`getOwnPropertyNames`,{value:function(e){return o(e).filter(f)}}),`getPropertyNames`in Object){var p=Object.getPropertyNames;s(Object,`getPropertyNames`,{value:function(e){return p(e).filter(f)}})}function m(e){if(e!==Object(e))throw TypeError(`Not an object: `+e);var t=e[u];if(t&&t.key===e)return t;if(c(e)){t={key:e};try{return s(e,u,{value:t,writable:!1,enumerable:!1,configurable:!1}),t}catch{return}}}(function(){var e=Object.freeze;s(Object,`freeze`,{value:function(t){return m(t),e(t)}});var t=Object.seal;s(Object,`seal`,{value:function(e){return m(e),t(e)}});var n=Object.preventExtensions;s(Object,`preventExtensions`,{value:function(e){return m(e),n(e)}})})();function h(e){return e.prototype=null,Object.freeze(e)}var g=!1;function _(){!g&&typeof console<`u`&&(g=!0,console.warn(`WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future.`))}var v=0,y=function(){this instanceof y||_();var e=[],t=[],n=v++;function r(r,i){var a,o=m(r);return o?n in o?o[n]:i:(a=e.indexOf(r),a>=0?t[a]:i)}function i(t){var r=m(t);return r?n in r:e.indexOf(t)>=0}function a(r,i){var a,o=m(r);return o?o[n]=i:(a=e.indexOf(r),a>=0?t[a]=i:(a=e.length,t[a]=i,e[a]=r)),this}function o(r){var i=m(r),a,o;return i?n in i&&delete i[n]:(a=e.indexOf(r),a<0?!1:(o=e.length-1,e[a]=void 0,t[a]=t[o],e[a]=e[o],e.length=o,t.length=o,!0))}return Object.create(y.prototype,{get___:{value:h(r)},has___:{value:h(i)},set___:{value:h(a)},delete___:{value:h(o)}})};y.prototype=Object.create(Object.prototype,{get:{value:function(e,t){return this.get___(e,t)},writable:!0,configurable:!0},has:{value:function(e){return this.has___(e)},writable:!0,configurable:!0},set:{value:function(e,t){return this.set___(e,t)},writable:!0,configurable:!0},delete:{value:function(e){return this.delete___(e)},writable:!0,configurable:!0}}),typeof r==`function`?function(){n&&typeof Proxy<`u`&&(Proxy=void 0);function i(){this instanceof y||_();var e=new r,i=void 0,a=!1;function o(t,n){return i?e.has(t)?e.get(t):i.get___(t,n):e.get(t,n)}function s(t){return e.has(t)||(i?i.has___(t):!1)}var c=n?function(t,n){return e.set(t,n),e.has(t)||(i||=new y,i.set(t,n)),this}:function(t,n){if(a)try{e.set(t,n)}catch{i||=new y,i.set___(t,n)}else e.set(t,n);return this};function l(t){var n=!!e.delete(t);return i&&i.delete___(t)||n}return Object.create(y.prototype,{get___:{value:h(o)},has___:{value:h(s)},set___:{value:h(c)},delete___:{value:h(l)},permitHostObjects___:{value:h(function(e){if(e===t)a=!0;else throw Error(`bogus call to permitHostObjects___`)})}})}i.prototype=y.prototype,e.exports=i,Object.defineProperty(WeakMap.prototype,`constructor`,{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<`u`&&(Proxy=void 0),e.exports=y)})()},236:function(e,t,n){var r=n(8284);e.exports=i;function i(){var e={};return function(t){if((typeof t!=`object`||!t)&&typeof t!=`function`)throw Error(`Weakmap-shim: Key must be object`);var n=t.valueOf(e);return n&&n.identity===e?n:r(t,e)}}},8284:function(e){e.exports=t;function t(e,t){var n={identity:t},r=e.valueOf;return Object.defineProperty(e,`valueOf`,{value:function(e){return e===t?n:r.apply(this,arguments)},writable:!0}),n}},606:function(e,t,n){var r=n(236);e.exports=i;function i(){var e=r();return{get:function(t,n){var r=e(t);return r.hasOwnProperty(`value`)?r.value:n},set:function(t,n){return e(t).value=n,this},has:function(t){return`value`in e(t)},delete:function(t){return delete e(t).value}}}},3349:function(e){function t(){return function(e,t,n,r,i,a){var o=e[0],s=n[0],c=[0],l=s;r|=0;var u=0,d=s;for(u=0;u<o;++u){var f=t[r]-a,p=t[r+l]-a;f>=0!=p>=0&&i.push(c[0]+.5+.5*(f+p)/(f-p)),r+=d,++c[0]}}}function n(){return t()}var r=n;function i(e){var t={};return function(n,r,i){var a=n.dtype,o=n.order,s=[a,o.join()].join(),c=t[s];return c||(t[s]=c=e([a,o])),c(n.shape.slice(0),n.data,n.stride,n.offset|0,r,i)}}function a(e){return i(r.bind(void 0,e))}function o(e){return a({funcName:e.funcName})}e.exports=o({funcName:`zeroCrossings`})},781:function(e,t,n){e.exports=i;var r=n(3349);function i(e,t){var n=[];return t=+t||0,r(e.hi(e.shape[0]-1),n,t),n}},7790:function(){}},n={};function r(t){var i=n[t];if(i!==void 0)return i.exports;var a=n[t]={id:t,loaded:!1,exports:{}};return e[t].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}(function(){r.g=function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}}()})(),function(){r.nmd=function(e){return e.paths=[],e.children||=[],e}}(),t.exports=r(1964)})()}),sh=h((e,t)=>{t.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]}}),ch=h((e,t)=>{var n=sh();t.exports=i;var r={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function i(e){var t,i=[],a=1,o;if(typeof e==`string`)if(e=e.toLowerCase(),n[e])i=n[e].slice(),o=`rgb`;else if(e===`transparent`)a=0,o=`rgb`,i=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var s=e.slice(1),c=s.length,l=c<=4;a=1,l?(i=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],c===4&&(a=parseInt(s[3]+s[3],16)/255)):(i=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],c===8&&(a=parseInt(s[6]+s[7],16)/255)),i[0]||=0,i[1]||=0,i[2]||=0,o=`rgb`}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var u=t[1],d=u===`rgb`,s=u.replace(/a$/,``);o=s;var c=s===`cmyk`?4:s===`gray`?1:3;i=t[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(e,t){if(/%$/.test(e))return t===c?parseFloat(e)/100:s===`rgb`?parseFloat(e)*255/100:parseFloat(e);if(s[t]===`h`){if(/deg$/.test(e))return parseFloat(e);if(r[e]!==void 0)return r[e]}return parseFloat(e)}),u===s&&i.push(1),a=d||i[c]===void 0?1:i[c],i=i.slice(0,c)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(i=e.match(/([0-9]+)/g).map(function(e){return parseFloat(e)}),o=e.match(/([a-z])/gi).join(``).toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(i=[e[0],e[1],e[2]],o=`rgb`,a=e.length===4?e[3]:1):e instanceof Object&&(e.r!=null||e.red!=null||e.R!=null?(o=`rgb`,i=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(o=`hsl`,i=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),a=e.a||e.alpha||e.opacity||1,e.opacity!=null&&(a/=100)):(o=`rgb`,i=[e>>>16,(e&65280)>>>8,e&255]);return{space:o,values:i,alpha:a}}}),lh=h((e,t)=>{var n=ch();t.exports=function(e){Array.isArray(e)&&e.raw&&(e=String.raw.apply(null,arguments));var t,i=n(e);if(!i.space)return[];var a=[0,0,0],o=i.space[0]===`h`?[360,100,100]:[255,255,255];return t=[,,,],t[0]=Math.min(Math.max(i.values[0],a[0]),o[0]),t[1]=Math.min(Math.max(i.values[1],a[1]),o[1]),t[2]=Math.min(Math.max(i.values[2],a[2]),o[2]),i.space[0]===`h`&&(t=r(t)),t.push(Math.min(Math.max(i.alpha,0),1)),t};function r(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a,o,s,c,l=0;if(n===0)return c=r*255,[c,c,c];for(a=r<.5?r*(1+n):r+n-r*n,i=2*r-a,s=[0,0,0];l<3;)o=t+1/3*-(l-1),o<0?o++:o>1&&o--,c=6*o<1?i+(a-i)*6*o:2*o<1?a:3*o<2?i+(a-i)*(2/3-o)*6:i,s[l++]=c*255;return s}}),uh=h((e,t)=>{t.exports=n;function n(e,t,n){return t<n?e<t?t:e>n?n:e:e<n?n:e>t?t:e}}),dh=h((e,t)=>{t.exports=function(e){switch(e){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}}}),fh=h((e,t)=>{var n=lh(),r=uh(),i=dh();t.exports=function(e,t){(t===`float`||!t)&&(t=`array`),t===`uint`&&(t=`uint8`),t===`uint_clamped`&&(t=`uint8_clamped`);var o=new(i(t))(4),s=t!==`uint8`&&t!==`uint8_clamped`;return(!e.length||typeof e==`string`)&&(e=n(e),e[0]/=255,e[1]/=255,e[2]/=255),a(e)?(o[0]=e[0],o[1]=e[1],o[2]=e[2],o[3]=e[3]==null?255:e[3],s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(s?(o[0]=e[0],o[1]=e[1],o[2]=e[2],o[3]=e[3]==null?1:e[3]):(o[0]=r(Math.floor(e[0]*255),0,255),o[1]=r(Math.floor(e[1]*255),0,255),o[2]=r(Math.floor(e[2]*255),0,255),o[3]=e[3]==null?255:r(Math.floor(e[3]*255),0,255)),o)};function a(e){return!!(e instanceof Uint8Array||e instanceof Uint8ClampedArray||Array.isArray(e)&&(e[0]>1||e[0]===0)&&(e[1]>1||e[1]===0)&&(e[2]>1||e[2]===0)&&(!e[3]||e[3]>1))}}),ph=h((e,t)=>{var n=fh();function r(e){return e?n(e):[0,0,0,1]}t.exports=r}),mh=h((e,t)=>{var n=D(),r=R(),i=fh(),a=Yt(),o=K().defaultLine,s=j().isArrayOrTypedArray,c=i(o),l=1;function u(e,t){var n=e;return n[3]*=t,n}function d(e){if(n(e))return c;var t=i(e);return t.length?t:c}function f(e){return n(e)?e:l}function p(e,t,n){var r=e.color;r&&r._inputArray&&(r=r._inputArray);var o=s(r),p=s(t),m=a.extractOpts(e),h=[],g,_,v,y,b;if(g=m.colorscale===void 0?d:a.makeColorScaleFuncFromTrace(e),_=o?function(e,t){return e[t]===void 0?c:i(g(e[t]))}:d,v=p?function(e,t){return e[t]===void 0?l:f(e[t])}:f,o||p)for(var x=0;x<n;x++)y=_(r,x),b=v(t,x),h[x]=u(y,b);else h=u(i(r),t);return h}function m(e){var t=a.extractOpts(e),n=t.colorscale;return t.reversescale&&(n=a.flipScale(t.colorscale)),n.map(function(e){var t=e[0],n=r(e[1]).toRgb();return{index:t,rgb:[n.r,n.g,n.b,n.a]}})}t.exports={formatColor:p,parseColorScale:m}}),hh=h((e,t)=>{t.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]}}),gh=h((e,t)=>{t.exports={circle:`●`,"circle-open":`○`,square:`■`,"square-open":`□`,diamond:`◆`,"diamond-open":`◇`,cross:`+`,x:`❌`}}),_h=h((e,t)=>{var n=Ke();function r(e,t,r,i){if(!t||!t.visible)return null;for(var a=n.getComponentMethod(`errorbars`,`makeComputeError`)(t),o=Array(e.length),s=0;s<e.length;s++){var c=a(+e[s],s);if(i.type===`log`){var l=i.c2l(e[s]),u=e[s]-c[0],d=e[s]+c[1];if(o[s]=[(i.c2l(u,!0)-l)*r,(i.c2l(d,!0)-l)*r],u>0){var f=i.c2l(u);i._lowerLogErrorBound||=f,i._lowerErrorBound=Math.min(i._lowerLogErrorBound,f)}}else o[s]=[-c[0]*r,c[1]*r]}return o}function i(e){for(var t=0;t<e.length;t++)if(e[t])return e[t].length;return 0}function a(e,t,n){var a=[r(e.x,e.error_x,t[0],n.xaxis),r(e.y,e.error_y,t[1],n.yaxis),r(e.z,e.error_z,t[2],n.zaxis)],o=i(a);if(o===0)return null;for(var s=Array(o),c=0;c<o;c++){for(var l=[[0,0,0],[0,0,0]],u=0;u<3;u++)if(a[u])for(var d=0;d<2;d++)l[d][u]=a[u][c][d];s[c]=l}return s}t.exports=a}),vh=h((e,t)=>{var n=oh().gl_line3d,r=oh().gl_scatter3d,i=oh().gl_error3d,a=oh().gl_mesh3d,o=oh().delaunay_triangulate,s=$(),c=ph(),l=mh().formatColor,u=Zt(),d=hh(),f=gh(),p=sn(),m=Qt().appendArrayPointValue,h=_h();function g(e,t){this.scene=e,this.uid=t,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 _=g.prototype;_.handlePick=function(e){if(e.object&&(e.object===this.linePlot||e.object===this.delaunayMesh||e.object===this.textMarkers||e.object===this.scatterPlot)){var t=e.index=e.data.index;return e.object.highlight&&e.object.highlight(null),this.scatterPlot&&(e.object=this.scatterPlot,this.scatterPlot.highlight(e.data)),e.textLabel=``,this.textLabels&&(s.isArrayOrTypedArray(this.textLabels)?(this.textLabels[t]||this.textLabels[t]===0)&&(e.textLabel=this.textLabels[t]):e.textLabel=this.textLabels),e.traceCoordinate=[this.data.x[t],this.data.y[t],this.data.z[t]],!0}};function v(e,t,n){var r=(n+1)%3,i=(n+2)%3,a=[],s=[],c;for(c=0;c<e.length;++c){var l=e[c];isNaN(l[r])||!isFinite(l[r])||isNaN(l[i])||!isFinite(l[i])||(a.push([l[r],l[i]]),s.push(c))}var u=o(a);for(c=0;c<u.length;++c)for(var d=u[c],f=0;f<d.length;++f)d[f]=s[d[f]];return{positions:e,cells:u,meshColor:t}}function y(e){for(var t=[0,0,0],n=[[0,0,0],[0,0,0],[0,0,0]],r=[1,1,1],i=0;i<3;i++){var a=e[i];a&&a.copy_zstyle!==!1&&e[2].visible!==!1&&(a=e[2]),!(!a||!a.visible)&&(t[i]=a.width/2,n[i]=c(a.color),r[i]=a.thickness)}return{capSize:t,color:n,lineWidth:r}}function b(e){return e==null?0:e.indexOf(`left`)>-1?-1:e.indexOf(`right`)>-1?1:0}function x(e){return e==null?0:e.indexOf(`top`)>-1?-1:e.indexOf(`bottom`)>-1?1:0}function S(e){var t=0,n=0,r=[t,n];if(Array.isArray(e))for(var i=0;i<e.length;i++)r[i]=[t,n],e[i]&&(r[i][0]=b(e[i]),r[i][1]=x(e[i]));else r[0]=b(e),r[1]=x(e);return r}function C(e,t){return t(e*4)}function w(e){return f[e]}function T(e,t,n,r,i){var a=null;if(s.isArrayOrTypedArray(e)){a=[];for(var o=0;o<t;o++)e[o]===void 0?a[o]=r:a[o]=n(e[o],i)}else a=n(e,s.identity);return a}function E(e,t){var n=[],r=e.fullSceneLayout,i=e.dataScale,a=r.xaxis,o=r.yaxis,d=r.zaxis,f=t.marker,g=t.line,_=t.x||[],v=t.y||[],b=t.z||[],x=_.length,E=t.xcalendar,D=t.ycalendar,O=t.zcalendar,k,A,j,M,N,P;for(N=0;N<x;N++)k=a.d2l(_[N],0,E)*i[0],A=o.d2l(v[N],0,D)*i[1],j=d.d2l(b[N],0,O)*i[2],n[N]=[k,A,j];if(Array.isArray(t.text))P=t.text;else if(s.isTypedArray(t.text))P=Array.from(t.text);else if(t.text!==void 0)for(P=Array(x),N=0;N<x;N++)P[N]=t.text;function F(e,t){var n=r[e];return p.tickText(n,n.d2l(t),!0).text}var I=t.texttemplate;if(I){var L=e.fullLayout._d3locale,R=Array.isArray(I),z=R?Math.min(I.length,x):x,B=R?function(e){return I[e]}:function(){return I};for(P=Array(z),N=0;N<z;N++){var V={x:_[N],y:v[N],z:b[N]},H={xLabel:F(`xaxis`,_[N]),yLabel:F(`yaxis`,v[N]),zLabel:F(`zaxis`,b[N])},U={};m(U,t,N),P[N]=s.texttemplateString({data:[U,V,t._meta],fallback:t.texttemplatefallback,labels:H,locale:L,template:B(N)})}}if(M={position:n,mode:t.mode,text:P},`line`in t&&(M.lineColor=l(g,1,x),M.lineWidth=g.width,M.lineDashes=g.dash),`marker`in t){var W=u(t);M.scatterColor=l(f,1,x),M.scatterSize=T(f.size,x,C,20,W),M.scatterMarker=T(f.symbol,x,w,`●`),M.scatterLineWidth=f.line.width,M.scatterLineColor=l(f.line,1,x),M.scatterAngle=0}`textposition`in t&&(M.textOffset=S(t.textposition),M.textColor=l(t.textfont,1,x),M.textSize=T(t.textfont.size,x,s.identity,12),M.textFontFamily=t.textfont.family,M.textFontWeight=t.textfont.weight,M.textFontStyle=t.textfont.style,M.textFontVariant=t.textfont.variant,M.textAngle=0);var G=[`x`,`y`,`z`];for(M.project=[!1,!1,!1],M.projectScale=[1,1,1],M.projectOpacity=[1,1,1],N=0;N<3;++N){var K=t.projection[G[N]];(M.project[N]=K.show)&&(M.projectOpacity[N]=K.opacity,M.projectScale[N]=K.scale)}M.errorBounds=h(t,i,r);var q=y([t.error_x,t.error_y,t.error_z]);return M.errorColor=q.color,M.errorLineWidth=q.lineWidth,M.errorCapSize=q.capSize,M.delaunayAxis=t.surfaceaxis,M.delaunayColor=c(t.surfacecolor),M}function D(e){if(s.isArrayOrTypedArray(e)){var t=e[0];return s.isArrayOrTypedArray(t)&&(e=t),`rgb(`+e.slice(0,3).map(function(e){return Math.round(e*255)})+`)`}return null}function O(e){return s.isArrayOrTypedArray(e)?e.length===4&&typeof e[0]==`number`?D(e):e.map(D):null}_.update=function(e){var t=this.scene.glplot.gl,o,s,c,l,u=d.solid;this.data=e;var f=E(this.scene,e);`mode`in f&&(this.mode=f.mode),`lineDashes`in f&&f.lineDashes in d&&(u=d[f.lineDashes]),this.color=O(f.scatterColor)||O(f.lineColor),this.dataPoints=f.position,o={gl:this.scene.glplot.gl,position:f.position,color:f.lineColor,lineWidth:f.lineWidth||1,dashes:u[0],dashScale:u[1],opacity:e.opacity,connectGaps:e.connectgaps},this.mode.indexOf(`lines`)===-1?this.linePlot&&=(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),null):this.linePlot?this.linePlot.update(o):(this.linePlot=n(o),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot));var p=e.opacity;if(e.marker&&e.marker.opacity!==void 0&&(p*=e.marker.opacity),s={gl:this.scene.glplot.gl,position:f.position,color:f.scatterColor,size:f.scatterSize,glyph:f.scatterMarker,opacity:p,orthographic:!0,lineWidth:f.scatterLineWidth,lineColor:f.scatterLineColor,project:f.project,projectScale:f.projectScale,projectOpacity:f.projectOpacity},this.mode.indexOf(`markers`)===-1?this.scatterPlot&&=(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),null):this.scatterPlot?this.scatterPlot.update(s):(this.scatterPlot=r(s),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)),l={gl:this.scene.glplot.gl,position:f.position,glyph:f.text,color:f.textColor,size:f.textSize,angle:f.textAngle,alignment:f.textOffset,font:f.textFontFamily,fontWeight:f.textFontWeight,fontStyle:f.textFontStyle,fontVariant:f.textFontVariant,orthographic:!0,lineWidth:0,project:!1,opacity:e.opacity},this.textLabels=e.hovertext||e.text,this.mode.indexOf(`text`)===-1?this.textMarkers&&=(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),null):this.textMarkers?this.textMarkers.update(l):(this.textMarkers=r(l),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)),c={gl:this.scene.glplot.gl,position:f.position,color:f.errorColor,error:f.errorBounds,lineWidth:f.errorLineWidth,capSize:f.errorCapSize,opacity:e.opacity},this.errorBars?f.errorBounds?this.errorBars.update(c):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):f.errorBounds&&(this.errorBars=i(c),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),f.delaunayAxis>=0){var m=v(f.position,f.delaunayColor,f.delaunayAxis);m.opacity=e.opacity,this.delaunayMesh?this.delaunayMesh.update(m):(m.gl=t,this.delaunayMesh=a(m),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&=(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),null)},_.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 k(e,t){var n=new g(e,t.uid);return n.update(t),n}t.exports=k}),yh=h((e,t)=>{var n=Tr(),r=B(),i=Pt(),a=jt().axisHoverFormat,{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:c}=ze(),l=W(),u=hh(),d=gh(),f=z().extendFlat,p=Ie().overrideAll,m=Xe(),h=n.line,g=n.marker,_=g.line,v=f({width:h.width,dash:{valType:`enumerated`,values:m(u),dflt:`solid`}},i(`line`));function y(e){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=t.exports=p({x:n.x,y:n.y,z:{valType:`data_array`},text:f({},n.text,{}),texttemplate:s(),texttemplatefallback:c({editType:`calc`}),hovertext:f({},n.hovertext,{}),hovertemplate:o(),hovertemplatefallback:c(),xhoverformat:a(`x`),yhoverformat:a(`y`),zhoverformat:a(`z`),mode:f({},n.mode,{dflt:`lines+markers`}),surfaceaxis:{valType:`enumerated`,values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:`color`},projection:{x:y(`x`),y:y(`y`),z:y(`z`)},connectgaps:n.connectgaps,line:v,marker:f({symbol:{valType:`enumerated`,values:m(d),dflt:`circle`,arrayOk:!0},size:f({},g.size,{dflt:8}),sizeref:g.sizeref,sizemin:g.sizemin,sizemode:g.sizemode,opacity:f({},g.opacity,{arrayOk:!1}),colorbar:g.colorbar,line:f({width:f({},_.width,{arrayOk:!1})},i(`marker.line`))},i(`marker`)),textposition:f({},n.textposition,{dflt:`top center`}),textfont:r({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:`calc`,colorEditType:`style`,arrayOk:!0,variantValues:[`normal`,`small-caps`]}),opacity:l.opacity,hoverinfo:f({},l.hoverinfo)},`calc`,`nested`);b.x.editType=b.y.editType=b.z.editType=`calc+clearAxisTypes`}),bh=h((e,t)=>{var n=Ke(),r=$(),i=Xt(),a=Yr(),o=Xr(),s=Qr(),c=yh();t.exports=function(e,t,u,d){function f(n,i){return r.coerce(e,t,c,n,i)}if(!l(e,t,f,d)){t.visible=!1;return}f(`text`),f(`hovertext`),f(`hovertemplate`),f(`hovertemplatefallback`),f(`xhoverformat`),f(`yhoverformat`),f(`zhoverformat`),f(`mode`),i.hasMarkers(t)&&a(e,t,u,d,f,{noAngle:!0,noLineDash:!0,noSelect:!0}),i.hasLines(t)&&(f(`connectgaps`),o(e,t,u,d,f)),i.hasText(t)&&(f(`texttemplate`),f(`texttemplatefallback`),s(e,t,d,f,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var p=(t.line||{}).color,m=(t.marker||{}).color;f(`surfaceaxis`)>=0&&f(`surfacecolor`,p||m);for(var h=[`x`,`y`,`z`],g=0;g<3;++g){var _=`projection.`+h[g];f(_+`.show`)&&(f(_+`.opacity`),f(_+`.scale`))}var v=n.getComponentMethod(`errorbars`,`supplyDefaults`);v(e,t,p||m||u,{axis:`z`}),v(e,t,p||m||u,{axis:`y`,inherit:`z`}),v(e,t,p||m||u,{axis:`x`,inherit:`z`})};function l(e,t,r,i){var a=0,o=r(`x`),s=r(`y`),c=r(`z`);return n.getComponentMethod(`calendars`,`handleTraceDefaults`)(e,t,[`x`,`y`,`z`],i),o&&s&&c&&(a=Math.min(o.length,s.length,c.length),t._length=t._xlength=t._ylength=t._zlength=a),a}}),xh=h((e,t)=>{var n=oi(),r=ai();t.exports=function(e,t){var i=[{x:!1,y:!1,trace:t,t:{}}];return n(i,t),r(e,t),i}}),Sh=h((e,t)=>{t.exports=n;function n(e,t){if(typeof e!=`string`)throw TypeError(`must specify type string`);if(t||={},typeof document>`u`&&!t.canvas)return null;var n=t.canvas||document.createElement(`canvas`);typeof t.width==`number`&&(n.width=t.width),typeof t.height==`number`&&(n.height=t.height);var r=t,i;try{var a=[e];e.indexOf(`webgl`)===0&&a.push(`experimental-`+e);for(var o=0;o<a.length;o++)if(i=n.getContext(a[o],r),i)return i}catch{i=null}return i||null}}),Ch=h((e,t)=>{var n=Sh();t.exports=function(e){return n(`webgl`,e)}}),wh=h((e,t)=>{var n=q(),r=function(){};t.exports=function(e){for(var t in e)typeof e[t]==`function`&&(e[t]=r);e.destroy=function(){e.container.parentNode.removeChild(e.container)};var i=document.createElement(`div`);i.className=`no-webgl`,i.style.cursor=`pointer`,i.style.fontSize=`24px`,i.style.color=n.defaults[0],i.style.position=`absolute`,i.style.left=i.style.top=`0px`,i.style.width=i.style.height=`100%`,i.style[`background-color`]=n.lightLine,i.style[`z-index`]=30;var a=document.createElement(`p`);return a.textContent=`WebGL is not supported by your browser - visit https://get.webgl.org for more info`,a.style.position=`relative`,a.style.top=`50%`,a.style.left=`50%`,a.style.height=`30%`,a.style.width=`50%`,a.style.margin=`-15% 0 0 -25%`,i.appendChild(a),e.container.appendChild(i),e.container.style.background=`#FFFFFF`,e.container.onclick=function(){window.open(`https://get.webgl.org`)},!1}}),Th=h((e,t)=>{var n=ph(),r=$(),i=[`xaxis`,`yaxis`,`zaxis`];function a(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=[`sans-serif`,`sans-serif`,`sans-serif`],this.tickSize=[12,12,12],this.tickFontWeight=[`normal`,`normal`,`normal`,`normal`],this.tickFontStyle=[`normal`,`normal`,`normal`,`normal`],this.tickFontVariant=[`normal`,`normal`,`normal`,`normal`],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=[`x`,`y`,`z`],this.labelEnable=[!0,!0,!0],this.labelFont=[`Open Sans`,`Open Sans`,`Open Sans`],this.labelSize=[20,20,20],this.labelFontWeight=[`normal`,`normal`,`normal`,`normal`],this.labelFontStyle=[`normal`,`normal`,`normal`,`normal`],this.labelFontVariant=[`normal`,`normal`,`normal`,`normal`],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}var o=a.prototype;o.merge=function(e,t){for(var a=this,o=0;o<3;++o){var s=t[i[o]];if(!s.visible){a.tickEnable[o]=!1,a.labelEnable[o]=!1,a.lineEnable[o]=!1,a.lineTickEnable[o]=!1,a.gridEnable[o]=!1,a.zeroEnable[o]=!1,a.backgroundEnable[o]=!1;continue}a.labels[o]=e._meta?r.templateString(s.title.text,e._meta):s.title.text,`font`in s.title&&(s.title.font.color&&(a.labelColor[o]=n(s.title.font.color)),s.title.font.family&&(a.labelFont[o]=s.title.font.family),s.title.font.size&&(a.labelSize[o]=s.title.font.size),s.title.font.weight&&(a.labelFontWeight[o]=s.title.font.weight),s.title.font.style&&(a.labelFontStyle[o]=s.title.font.style),s.title.font.variant&&(a.labelFontVariant[o]=s.title.font.variant)),`showline`in s&&(a.lineEnable[o]=s.showline),`linecolor`in s&&(a.lineColor[o]=n(s.linecolor)),`linewidth`in s&&(a.lineWidth[o]=s.linewidth),`showgrid`in s&&(a.gridEnable[o]=s.showgrid),`gridcolor`in s&&(a.gridColor[o]=n(s.gridcolor)),`gridwidth`in s&&(a.gridWidth[o]=s.gridwidth),s.type===`log`?a.zeroEnable[o]=!1:`zeroline`in s&&(a.zeroEnable[o]=s.zeroline),`zerolinecolor`in s&&(a.zeroLineColor[o]=n(s.zerolinecolor)),`zerolinewidth`in s&&(a.zeroLineWidth[o]=s.zerolinewidth),`ticks`in s&&s.ticks?a.lineTickEnable[o]=!0:a.lineTickEnable[o]=!1,`ticklen`in s&&(a.lineTickLength[o]=a._defaultLineTickLength[o]=s.ticklen),`tickcolor`in s&&(a.lineTickColor[o]=n(s.tickcolor)),`tickwidth`in s&&(a.lineTickWidth[o]=s.tickwidth),`tickangle`in s&&(a.tickAngle[o]=s.tickangle===`auto`?-3600:Math.PI*-s.tickangle/180),`showticklabels`in s&&(a.tickEnable[o]=s.showticklabels),`tickfont`in s&&(s.tickfont.color&&(a.tickColor[o]=n(s.tickfont.color)),s.tickfont.family&&(a.tickFont[o]=s.tickfont.family),s.tickfont.size&&(a.tickSize[o]=s.tickfont.size),s.tickfont.weight&&(a.tickFontWeight[o]=s.tickfont.weight),s.tickfont.style&&(a.tickFontStyle[o]=s.tickfont.style),s.tickfont.variant&&(a.tickFontVariant[o]=s.tickfont.variant)),`mirror`in s?[`ticks`,`all`,`allticks`].indexOf(s.mirror)===-1?s.mirror===!0?(a.lineTickMirror[o]=!1,a.lineMirror[o]=!0):(a.lineTickMirror[o]=!1,a.lineMirror[o]=!1):(a.lineTickMirror[o]=!0,a.lineMirror[o]=!0):a.lineMirror[o]=!1,`showbackground`in s&&s.showbackground!==!1?(a.backgroundEnable[o]=!0,a.backgroundColor[o]=n(s.backgroundcolor)):a.backgroundEnable[o]=!1}};function s(e,t){var n=new a;return n.merge(e,t),n}t.exports=s}),Eh=h((e,t)=>{var n=ph(),r=[`xaxis`,`yaxis`,`zaxis`];function i(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}var a=i.prototype;a.merge=function(e){for(var t=0;t<3;++t){var i=e[r[t]];if(!i.visible){this.enabled[t]=!1,this.drawSides[t]=!1;continue}this.enabled[t]=i.showspikes,this.colors[t]=n(i.spikecolor),this.drawSides[t]=i.spikesides,this.lineWidth[t]=i.spikethickness}};function o(e){var t=new i;return t.merge(e),t}t.exports=o}),Dh=h((e,t)=>{t.exports=s;var n=sn(),r=$(),i=[`xaxis`,`yaxis`,`zaxis`],a=[0,0,0];function o(e){for(var t=[,,,],n=0;n<3;++n){for(var r=e[n],i=Array(r.length),a=0;a<r.length;++a)i[a]=r[a].x;t[n]=i}return t}function s(e){for(var t=e.axesOptions,s=e.glplot.axesPixels,c=e.fullSceneLayout,l=[[],[],[]],u=0;u<3;++u){var d=c[i[u]];if(d._length=(s[u].hi-s[u].lo)*s[u].pixelsPerDataUnit/e.dataScale[u],Math.abs(d._length)===1/0||isNaN(d._length))l[u]=[];else{d._input_range=d.range.slice(),d.range[0]=s[u].lo/e.dataScale[u],d.range[1]=s[u].hi/e.dataScale[u],d._m=1/(e.dataScale[u]*s[u].pixelsPerDataUnit),d.range[0]===d.range[1]&&(--d.range[0],d.range[1]+=1);var f=d.tickmode;if(d.tickmode===`auto`){d.tickmode=`linear`;var p=d.nticks||r.constrain(d._length/40,4,9);n.autoTicks(d,Math.abs(d.range[1]-d.range[0])/p)}for(var m=n.calcTicks(d,{msUTC:!0}),h=0;h<m.length;++h)m[h].x=m[h].x*e.dataScale[u],d.type===`date`&&(m[h].text=m[h].text.replace(/\<br\>/g,` `));l[u]=m,d.tickmode=f}}t.ticks=l;for(var u=0;u<3;++u){a[u]=.5*(e.glplot.bounds[0][u]+e.glplot.bounds[1][u]);for(var h=0;h<2;++h)t.bounds[h][u]=e.glplot.bounds[h][u]}e.contourLevels=o(l)}}),Oh=h((e,t)=>{var n=oh().gl_plot3d,r=n.createCamera,i=n.createScene,a=Ch(),o=dn(),s=Ke(),c=$(),l=c.preserveDrawingBuffer(),u=sn(),d=Ln(),f=ph(),p=wh(),m=Ui(),h=Th(),g=Eh(),_=Dh(),v=on().applyAutorangeOptions,y,b,x=!1;function S(e,t){var n=document.createElement(`div`),r=e.container;this.graphDiv=e.graphDiv;var i=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);i.style.position=`absolute`,i.style.top=i.style.left=`0px`,i.style.width=i.style.height=`100%`,i.style[`z-index`]=20,i.style[`pointer-events`]=`none`,n.appendChild(i),this.svgContainer=i,n.id=e.id,n.style.position=`absolute`,n.style.top=n.style.left=`0px`,n.style.width=n.style.height=`100%`,r.appendChild(n),this.fullLayout=t,this.id=e.id||`scene`,this.fullSceneLayout=t[this.id],this.plotArgs=[[],{},{}],this.axesOptions=h(t,t[this.id]),this.spikeOptions=g(t[this.id]),this.container=n,this.staticMode=!!e.staticPlot,this.pixelRatio=this.pixelRatio||e.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=s.getComponentMethod(`annotations3d`,`convert`),this.drawAnnotations=s.getComponentMethod(`annotations3d`,`draw`),this.initializeGLPlot()}var C=S.prototype;C.prepareOptions=function(){var e=this,t={canvas:e.canvas,gl:e.gl,glOptions:{preserveDrawingBuffer:l,premultipliedAlpha:!0,antialias:!0},container:e.container,axes:e.axesOptions,spikes:e.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:e.camera,pixelRatio:e.pixelRatio};if(e.staticMode){if(!b&&(y=document.createElement(`canvas`),b=a({canvas:y,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!b))throw Error(`error creating static canvas/context for image server`);t.gl=b,t.canvas=y}return t};var w=!0;C.tryCreatePlot=function(){var e=this,t=e.prepareOptions(),n=!0;try{e.glplot=i(t)}catch{if(e.staticMode||!w||l)n=!1;else{c.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{l=t.glOptions.preserveDrawingBuffer=!0,e.glplot=i(t)}catch{l=t.glOptions.preserveDrawingBuffer=!1,n=!1}}}return w=!1,n},C.initializeGLCamera=function(){var e=this,t=e.fullSceneLayout.camera,n=t.projection.type===`orthographic`;e.camera=r(e.container,{center:[t.center.x,t.center.y,t.center.z],eye:[t.eye.x,t.eye.y,t.eye.z],up:[t.up.x,t.up.y,t.up.z],_ortho:n,zoomMin:.01,zoomMax:100,mode:`orbit`})},C.initializeGLPlot=function(){var e=this;if(e.initializeGLCamera(),!e.tryCreatePlot())return p(e);e.traces={},e.make4thDimension();var t=e.graphDiv,n=t.layout,r=function(){var t={};return e.isCameraChanged(n)&&(t[e.id+`.camera`]=e.getCamera()),e.isAspectChanged(n)&&(t[e.id+`.aspectratio`]=e.glplot.getAspectratio(),n[e.id].aspectmode!==`manual`&&(e.fullSceneLayout.aspectmode=n[e.id].aspectmode=t[e.id+`.aspectmode`]=`manual`)),t},i=function(e){if(e.fullSceneLayout.dragmode!==!1){var t=r();e.saveLayout(n),e.graphDiv.emit(`plotly_relayout`,t)}};return e.glplot.canvas&&(e.glplot.canvas.addEventListener(`mouseup`,function(){i(e)}),e.glplot.canvas.addEventListener(`touchstart`,function(){x=!0}),e.glplot.canvas.addEventListener(`wheel`,function(n){if(t._context._scrollZoom.gl3d){if(e.camera._ortho){var r=n.deltaX>n.deltaY?1.1:.9090909090909091,a=e.glplot.getAspectratio();e.glplot.setAspectratio({x:r*a.x,y:r*a.y,z:r*a.z})}i(e)}},o?{passive:!1}:!1),e.glplot.canvas.addEventListener(`mousemove`,function(){if(e.fullSceneLayout.dragmode!==!1&&e.camera.mouseListener.buttons!==0){var t=r();e.graphDiv.emit(`plotly_relayouting`,t)}}),e.staticMode||e.glplot.canvas.addEventListener(`webglcontextlost`,function(n){t&&t.emit&&t.emit(`plotly_webglcontextlost`,{event:n,layer:e.id})},!1)),e.glplot.oncontextloss=function(){e.recoverContext()},e.glplot.onrender=function(){e.render()},!0},C.render=function(){var e=this,t=e.graphDiv,n,r=e.svgContainer,i=e.container.getBoundingClientRect();t._fullLayout._calcInverseTransform(t);var a=t._fullLayout._invScaleX,o=t._fullLayout._invScaleY,s=i.width*a,l=i.height*o;r.setAttributeNS(null,`viewBox`,`0 0 `+s+` `+l),r.setAttributeNS(null,`width`,s),r.setAttributeNS(null,`height`,l),_(e),e.glplot.axes.update(e.axesOptions);for(var f=Object.keys(e.traces),p=null,h=e.glplot.selection,g=0;g<f.length;++g)n=e.traces[f[g]],n.data.hoverinfo!==`skip`&&n.handlePick(h)&&(p=n),n.setContourLevels&&n.setContourLevels();function v(t,n,r){var i=e.fullSceneLayout[t+`axis`];return i.type!==`log`&&(n=i.d2l(n)),u.hoverLabelText(i,n,r)}if(p!==null){var y=m(e.glplot.cameraParams,h.dataCoordinate);n=p.data;var b=t._fullData[n.index],S=h.index,C={xLabel:v(`x`,h.traceCoordinate[0],n.xhoverformat),yLabel:v(`y`,h.traceCoordinate[1],n.yhoverformat),zLabel:v(`z`,h.traceCoordinate[2],n.zhoverformat)},w=d.castHoverinfo(b,e.fullLayout,S),T=(w||``).split(`+`),E=w&&w===`all`;!b.hovertemplate&&!E&&(T.indexOf(`x`)===-1&&(C.xLabel=void 0),T.indexOf(`y`)===-1&&(C.yLabel=void 0),T.indexOf(`z`)===-1&&(C.zLabel=void 0),T.indexOf(`text`)===-1&&(h.textLabel=void 0),T.indexOf(`name`)===-1&&(p.name=void 0));var D,O=[];n.type===`cone`||n.type===`streamtube`?(C.uLabel=v(`x`,h.traceCoordinate[3],n.uhoverformat),(E||T.indexOf(`u`)!==-1)&&O.push(`u: `+C.uLabel),C.vLabel=v(`y`,h.traceCoordinate[4],n.vhoverformat),(E||T.indexOf(`v`)!==-1)&&O.push(`v: `+C.vLabel),C.wLabel=v(`z`,h.traceCoordinate[5],n.whoverformat),(E||T.indexOf(`w`)!==-1)&&O.push(`w: `+C.wLabel),C.normLabel=h.traceCoordinate[6].toPrecision(3),(E||T.indexOf(`norm`)!==-1)&&O.push(`norm: `+C.normLabel),n.type===`streamtube`&&(C.divergenceLabel=h.traceCoordinate[7].toPrecision(3),(E||T.indexOf(`divergence`)!==-1)&&O.push(`divergence: `+C.divergenceLabel)),h.textLabel&&O.push(h.textLabel),D=O.join(`<br>`)):n.type===`isosurface`||n.type===`volume`?(C.valueLabel=u.hoverLabelText(e._mockAxis,e._mockAxis.d2l(h.traceCoordinate[3]),n.valuehoverformat),O.push(`value: `+C.valueLabel),h.textLabel&&O.push(h.textLabel),D=O.join(`<br>`)):D=h.textLabel;var k={x:h.traceCoordinate[0],y:h.traceCoordinate[1],z:h.traceCoordinate[2],data:b._input,fullData:b,curveNumber:b.index,pointNumber:S};d.appendArrayPointValue(k,b,S),n._module.eventData&&(k=b._module.eventData(k,h,b,{},S));var A={points:[k]};if(e.fullSceneLayout.hovermode){var j=[];d.loneHover({trace:b,x:(.5+.5*y[0]/y[3])*s,y:(.5-.5*y[1]/y[3])*l,xLabel:C.xLabel,yLabel:C.yLabel,zLabel:C.zLabel,text:D,name:p.name,color:d.castHoverOption(b,S,`bgcolor`)||p.color,borderColor:d.castHoverOption(b,S,`bordercolor`),fontFamily:d.castHoverOption(b,S,`font.family`),fontSize:d.castHoverOption(b,S,`font.size`),fontColor:d.castHoverOption(b,S,`font.color`),nameLength:d.castHoverOption(b,S,`namelength`),textAlign:d.castHoverOption(b,S,`align`),hovertemplate:c.castOption(b,S,`hovertemplate`),hovertemplateLabels:c.extendFlat({},k,C),eventData:[k]},{container:r,gd:t,inOut_bbox:j}),k.bbox=j[0]}h.distance<5&&(h.buttons||x)?t.emit(`plotly_click`,A):t.emit(`plotly_hover`,A),this.oldEventData=A}else d.loneUnhover(r),this.oldEventData&&t.emit(`plotly_unhover`,this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},C.recoverContext=function(){var e=this;e.glplot.dispose();var t=function(){if(e.glplot.gl.isContextLost()){requestAnimationFrame(t);return}if(!e.initializeGLPlot()){c.error(`Catastrophic and unrecoverable WebGL error. Context lost.`);return}e.plot.apply(e,e.plotArgs)};requestAnimationFrame(t)};var T=[`xaxis`,`yaxis`,`zaxis`];function E(e,t,n){for(var r=e.fullSceneLayout,i=0;i<3;i++){var a=T[i],o=a.charAt(0),s=r[a],l=t[o],u=t[o+`calendar`],d=t[`_`+o+`length`];if(!c.isArrayOrTypedArray(l))n[0][i]=Math.min(n[0][i],0),n[1][i]=Math.max(n[1][i],d-1);else for(var f,p=0;p<(d||l.length);p++)if(c.isArrayOrTypedArray(l[p]))for(var m=0;m<l[p].length;++m)f=s.d2l(l[p][m],0,u),!isNaN(f)&&isFinite(f)&&(n[0][i]=Math.min(n[0][i],f),n[1][i]=Math.max(n[1][i],f));else f=s.d2l(l[p],0,u),!isNaN(f)&&isFinite(f)&&(n[0][i]=Math.min(n[0][i],f),n[1][i]=Math.max(n[1][i],f))}}function D(e,t){for(var n=e.fullSceneLayout,r=n.annotations||[],i=0;i<3;i++)for(var a=T[i],o=a.charAt(0),s=n[a],c=0;c<r.length;c++){var l=r[c];if(l.visible){var u=s.r2l(l[o]);!isNaN(u)&&isFinite(u)&&(t[0][i]=Math.min(t[0][i],u),t[1][i]=Math.max(t[1][i],u))}}}C.plot=function(e,t,n){var r=this;if(r.plotArgs=[e,t,n],!r.glplot.contextLost){var i,a,o,s,c,l,u=t[r.id],d=n[r.id];r.fullLayout=t,r.fullSceneLayout=u,r.axesOptions.merge(t,u),r.spikeOptions.merge(u),r.setViewport(u),r.updateFx(u.dragmode,u.hovermode),r.camera.enableWheel=r.graphDiv._context._scrollZoom.gl3d,r.glplot.setClearColor(f(u.bgcolor)),r.setConvert(c),e?Array.isArray(e)||(e=[e]):e=[];var p=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(o=0;o<e.length;++o)i=e[o],!(i.visible!==!0||i._length===0)&&E(this,i,p);D(this,p);var m=[1,1,1];for(s=0;s<3;++s)p[1][s]===p[0][s]?m[s]=1:m[s]=1/(p[1][s]-p[0][s]);for(r.dataScale=m,r.convertAnnotations(this),o=0;o<e.length;++o)i=e[o],!(i.visible!==!0||i._length===0)&&(a=r.traces[i.uid],a?a.data.type===i.type?a.update(i):(a.dispose(),a=i._module.plot(this,i),r.traces[i.uid]=a):(a=i._module.plot(this,i),r.traces[i.uid]=a),a.name=i.name);var h=Object.keys(r.traces);e:for(o=0;o<h.length;++o){for(s=0;s<e.length;++s)if(e[s].uid===h[o]&&e[s].visible===!0&&e[s]._length!==0)continue e;a=r.traces[h[o]],a.dispose(),delete r.traces[h[o]]}r.glplot.objects.sort(function(e,t){return e._trace.data.index-t._trace.data.index});var g=[[0,0,0],[0,0,0]],_=[],y={};for(o=0;o<3;++o){c=u[T[o]],l=c.type,l in y?(y[l].acc*=m[o],y[l].count+=1):y[l]={acc:m[o],count:1};var b;if(c.autorange){g[0][o]=1/0,g[1][o]=-1/0;var x=r.glplot.objects,S=r.fullSceneLayout.annotations||[],C=c._name.charAt(0);for(s=0;s<x.length;s++){var w=x[s],O=w.bounds,k=w._trace.data._pad||0;w.constructor.name===`ErrorBars`&&c._lowerLogErrorBound?g[0][o]=Math.min(g[0][o],c._lowerLogErrorBound):g[0][o]=Math.min(g[0][o],O[0][o]/m[o]-k),g[1][o]=Math.max(g[1][o],O[1][o]/m[o]+k)}for(s=0;s<S.length;s++){var A=S[s];if(A.visible){var j=c.r2l(A[C]);g[0][o]=Math.min(g[0][o],j),g[1][o]=Math.max(g[1][o],j)}}if(`rangemode`in c&&c.rangemode===`tozero`&&(g[0][o]=Math.min(g[0][o],0),g[1][o]=Math.max(g[1][o],0)),g[0][o]>g[1][o])g[0][o]=-1,g[1][o]=1;else{var M=g[1][o]-g[0][o];g[0][o]-=M/32,g[1][o]+=M/32}if(b=[g[0][o],g[1][o]],b=v(b,c),g[0][o]=b[0],g[1][o]=b[1],c.isReversed()){var N=g[0][o];g[0][o]=g[1][o],g[1][o]=N}}else b=c.range,g[0][o]=c.r2l(b[0]),g[1][o]=c.r2l(b[1]);g[0][o]===g[1][o]&&(--g[0][o],g[1][o]+=1),_[o]=g[1][o]-g[0][o],c.range=[g[0][o],g[1][o]],c.limitRange(),r.glplot.setBounds(o,{min:c.range[0]*m[o],max:c.range[1]*m[o]})}var P,F=u.aspectmode;if(F===`cube`)P=[1,1,1];else if(F===`manual`){var I=u.aspectratio;P=[I.x,I.y,I.z]}else if(F===`auto`||F===`data`){var L=[1,1,1];for(o=0;o<3;++o){c=u[T[o]],l=c.type;var R=y[l];L[o]=R.acc**(1/R.count)/m[o]}P=F===`data`||Math.max.apply(null,L)/Math.min.apply(null,L)<=4?L:[1,1,1]}else throw Error(`scene.js aspectRatio was not one of the enumerated types`);u.aspectratio.x=d.aspectratio.x=P[0],u.aspectratio.y=d.aspectratio.y=P[1],u.aspectratio.z=d.aspectratio.z=P[2],r.glplot.setAspectratio(u.aspectratio),r.viewInitial.aspectratio||(r.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),r.viewInitial.aspectmode||(r.viewInitial.aspectmode=u.aspectmode);var z=u.domain||null,B=t._size||null;if(z&&B){var V=r.container.style;V.position=`absolute`,V.left=B.l+z.x[0]*B.w+`px`,V.top=B.t+(1-z.y[1])*B.h+`px`,V.width=B.w*(z.x[1]-z.x[0])+`px`,V.height=B.h*(z.y[1]-z.y[0])+`px`}r.glplot.redraw()}},C.destroy=function(){var e=this;e.glplot&&=(e.camera.mouseListener.enabled=!1,e.container.removeEventListener(`wheel`,e.camera.wheelListener),e.camera=null,e.glplot.dispose(),e.container.parentNode.removeChild(e.container),null)};function O(e){return[[e.eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]}function k(e){return{up:{x:e.up[0],y:e.up[1],z:e.up[2]},center:{x:e.center[0],y:e.center[1],z:e.center[2]},eye:{x:e.eye[0],y:e.eye[1],z:e.eye[2]},projection:{type:e._ortho===!0?`orthographic`:`perspective`}}}C.getCamera=function(){var e=this;return e.camera.view.recalcMatrix(e.camera.view.lastT()),k(e.camera)},C.setViewport=function(e){var t=this,n=e.camera;t.camera.lookAt.apply(this,O(n)),t.glplot.setAspectratio(e.aspectratio),n.projection.type===`orthographic`!==t.camera._ortho&&(t.glplot.redraw(),t.glplot.clearRGBA(),t.glplot.dispose(),t.initializeGLPlot())},C.isCameraChanged=function(e){var t=this,n=t.getCamera(),r=c.nestedProperty(e,t.id+`.camera`).get();function i(e,t,n,r){var i=[`up`,`center`,`eye`],a=[`x`,`y`,`z`];return t[i[n]]&&e[i[n]][a[r]]===t[i[n]][a[r]]}var a=!1;if(r===void 0)a=!0;else{for(var o=0;o<3;o++)for(var s=0;s<3;s++)if(!i(n,r,o,s)){a=!0;break}(!r.projection||n.projection&&n.projection.type!==r.projection.type)&&(a=!0)}return a},C.isAspectChanged=function(e){var t=this,n=t.glplot.getAspectratio(),r=c.nestedProperty(e,t.id+`.aspectratio`).get();return r===void 0||r.x!==n.x||r.y!==n.y||r.z!==n.z},C.saveLayout=function(e){var t=this,n=t.fullLayout,r,i,a,o,l,u,d=t.isCameraChanged(e),f=t.isAspectChanged(e),p=d||f;if(p){var m={};d&&(r=t.getCamera(),i=c.nestedProperty(e,t.id+`.camera`),a=i.get(),m[t.id+`.camera`]=a),f&&(o=t.glplot.getAspectratio(),l=c.nestedProperty(e,t.id+`.aspectratio`),u=l.get(),m[t.id+`.aspectratio`]=u),s.call(`_storeDirectGUIEdit`,e,n._preGUI,m),d&&(i.set(r),c.nestedProperty(n,t.id+`.camera`).set(r)),f&&(l.set(o),c.nestedProperty(n,t.id+`.aspectratio`).set(o),t.glplot.redraw())}return p},C.updateFx=function(e,t){var n=this,r=n.camera;if(r)if(e===`orbit`)r.mode=`orbit`,r.keyBindingMode=`rotate`;else if(e===`turntable`){r.up=[0,0,1],r.mode=`turntable`,r.keyBindingMode=`rotate`;var i=n.graphDiv,a=i._fullLayout,o=n.fullSceneLayout.camera,l=o.up.x,u=o.up.y,d=o.up.z;if(d/Math.sqrt(l*l+u*u+d*d)<.999){var f=n.id+`.camera.up`,p={x:0,y:0,z:1},m={};m[f]=p;var h=i.layout;s.call(`_storeDirectGUIEdit`,h,a._preGUI,m),o.up=p,c.nestedProperty(h,f).set(p)}}else r.keyBindingMode=e;n.fullSceneLayout.hovermode=t};function A(e,t,n){for(var r=0,i=n-1;r<i;++r,--i)for(var a=0;a<t;++a)for(var o=0;o<4;++o){var s=4*(t*r+a)+o,c=4*(t*i+a)+o,l=e[s];e[s]=e[c],e[c]=l}}function j(e,t,n){for(var r=0;r<n;++r)for(var i=0;i<t;++i){var a=4*(t*r+i),o=e[a+3];if(o>0)for(var s=255/o,c=0;c<3;++c)e[a+c]=Math.min(s*e[a+c],255)}}C.toImage=function(e){var t=this;e||=`png`,t.staticMode&&t.container.appendChild(y),t.glplot.redraw();var n=t.glplot.gl,r=n.drawingBufferWidth,i=n.drawingBufferHeight;n.bindFramebuffer(n.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);n.readPixels(0,0,r,i,n.RGBA,n.UNSIGNED_BYTE,a),A(a,r,i),j(a,r,i);var o=document.createElement(`canvas`);o.width=r,o.height=i;var s=o.getContext(`2d`,{willReadFrequently:!0}),c=s.createImageData(r,i);c.data.set(a),s.putImageData(c,0,0);var l;switch(e){case`jpeg`:l=o.toDataURL(`image/jpeg`);break;case`webp`:l=o.toDataURL(`image/webp`);break;default:l=o.toDataURL(`image/png`)}return t.staticMode&&t.container.removeChild(y),l},C.setConvert=function(){for(var e=this,t=0;t<3;t++){var n=e.fullSceneLayout[T[t]];u.setConvert(n,e.fullLayout),n.setScale=c.noop}},C.make4thDimension=function(){var e=this,t=e.graphDiv._fullLayout;e._mockAxis={type:`linear`,showexponent:`all`,exponentformat:`B`},u.setConvert(e._mockAxis,t)},t.exports=S}),kh=h((e,t)=>{t.exports={scene:{valType:`subplotid`,dflt:`scene`,editType:`calc+clearAxisTypes`}}}),Ah=h((e,t)=>{var n=q(),r=Mt(),i=z().extendFlat,a=Ie().overrideAll;t.exports=a({visible:r.visible,showspikes:{valType:`boolean`,dflt:!0},spikesides:{valType:`boolean`,dflt:!0},spikethickness:{valType:`number`,min:0,dflt:2},spikecolor:{valType:`color`,dflt:n.defaultLine},showbackground:{valType:`boolean`,dflt:!1},backgroundcolor:{valType:`color`,dflt:`rgba(204, 204, 204, 0.5)`},showaxeslabels:{valType:`boolean`,dflt:!0},color:r.color,categoryorder:r.categoryorder,categoryarray:r.categoryarray,title:{text:r.title.text,font:r.title.font},type:i({},r.type,{values:[`-`,`linear`,`log`,`date`,`category`]}),autotypenumbers:r.autotypenumbers,autorange:r.autorange,autorangeoptions:{minallowed:r.autorangeoptions.minallowed,maxallowed:r.autorangeoptions.maxallowed,clipmin:r.autorangeoptions.clipmin,clipmax:r.autorangeoptions.clipmax,include:r.autorangeoptions.include,editType:`plot`},rangemode:r.rangemode,minallowed:r.minallowed,maxallowed:r.maxallowed,range:i({},r.range,{items:[{valType:`any`,editType:`plot`,impliedEdits:{"^autorange":!1}},{valType:`any`,editType:`plot`,impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:r.minor.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:r.ticks,mirror:r.mirror,ticklen:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,showticklabels:r.showticklabels,labelalias:r.labelalias,tickfont:r.tickfont,tickangle:r.tickangle,tickprefix:r.tickprefix,showtickprefix:r.showtickprefix,ticksuffix:r.ticksuffix,showticksuffix:r.showticksuffix,showexponent:r.showexponent,exponentformat:r.exponentformat,minexponent:r.minexponent,separatethousands:r.separatethousands,tickformat:r.tickformat,tickformatstops:r.tickformatstops,hoverformat:r.hoverformat,showline:r.showline,linecolor:r.linecolor,linewidth:r.linewidth,showgrid:r.showgrid,gridcolor:i({},r.gridcolor,{dflt:`rgb(204, 204, 204)`}),gridwidth:r.gridwidth,zeroline:r.zeroline,zerolinecolor:r.zerolinecolor,zerolinewidth:r.zerolinewidth},`plot`,`from-root`)}),jh=h((e,t)=>{var n=Ah(),r=Da().attributes,i=z().extendFlat,a=$().counterRegex;function o(e,t,n){return{x:{valType:`number`,dflt:e,editType:`camera`},y:{valType:`number`,dflt:t,editType:`camera`},z:{valType:`number`,dflt:n,editType:`camera`},editType:`camera`}}t.exports={_arrayAttrRegexps:[a(`scene`,`.annotations`,!0)],bgcolor:{valType:`color`,dflt:`rgba(0,0,0,0)`,editType:`plot`},camera:{up:i(o(0,0,1),{}),center:i(o(0,0,0),{}),eye:i(o(1.25,1.25,1.25),{}),projection:{type:{valType:`enumerated`,values:[`perspective`,`orthographic`],dflt:`perspective`,editType:`calc`},editType:`calc`},editType:`camera`},domain:r({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:n,yaxis:n,zaxis:n,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`}}),Mh=h((e,t)=>{var n=R().mix,r=$(),i=yt(),a=Ah(),o=Ci(),s=Ei(),c=[`xaxis`,`yaxis`,`zaxis`],l=13600/187;t.exports=function(e,t,u){var d,f;function p(e,t){return r.coerce(d,f,a,e,t)}for(var m=0;m<c.length;m++){var h=c[m];d=e[h]||{},f=i.newContainer(t,h),f._id=h[0]+u.scene,f._name=h,o(d,f,p,u),s(d,f,p,{font:u.font,letter:h[0],data:u.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:u.bgColor,calendar:u.calendar},u.fullLayout),p(`gridcolor`,n(f.color,u.bgColor,l).toRgbString()),p(`title.text`,h[0]),f.setScale=r.noop,p(`showspikes`)&&(p(`spikesides`),p(`spikethickness`),p(`spikecolor`,f.color)),p(`showaxeslabels`),p(`showbackground`)&&p(`backgroundcolor`)}}}),Nh=h((e,t)=>{var n=$(),r=q(),i=Ke(),a=Ks(),o=Mh(),s=jh(),c=wt().getSubplotData,l=`gl3d`;t.exports=function(e,t,r){var i=t._basePlotModules.length>1;function o(t){if(!i&&n.validate(e[t],s[t]))return e[t]}a(e,t,r,{type:l,attributes:s,handleDefaults:u,fullLayout:t,font:t.font,fullData:r,getDfltFromLayout:o,autotypenumbersDflt:t.autotypenumbers,paper_bgcolor:t.paper_bgcolor,calendar:t.calendar})};function u(e,t,n,a){for(var s=n(`bgcolor`),u=r.combine(s,a.paper_bgcolor),d=[`up`,`center`,`eye`],f=0;f<d.length;f++)n(`camera.`+d[f]+`.x`),n(`camera.`+d[f]+`.y`),n(`camera.`+d[f]+`.z`);n(`camera.projection.type`);var p=!!n(`aspectratio.x`)&&!!n(`aspectratio.y`)&&!!n(`aspectratio.z`),m=n(`aspectmode`,p?`manual`:`auto`);p||(e.aspectratio=t.aspectratio={x:1,y:1,z:1},m===`manual`&&(t.aspectmode=`auto`),e.aspectmode=t.aspectmode);var h=c(a.fullData,l,a.id);o(e,t,{font:a.font,scene:a.id,data:h,bgColor:u,calendar:a.calendar,autotypenumbersDflt:a.autotypenumbersDflt,fullLayout:a.fullLayout}),i.getComponentMethod(`annotations3d`,`handleDefaults`)(e,t,a);var g=a.getDfltFromLayout(`dragmode`);if(g!==!1&&!g)if(g=`orbit`,e.camera&&e.camera.up){var _=e.camera.up.x,v=e.camera.up.y,y=e.camera.up.z;y!==0&&(!_||!v||!y||y/Math.sqrt(_*_+v*v+y*y)>.999)&&(g=`turntable`)}else g=`turntable`;n(`dragmode`,g),n(`hovermode`,a.getDfltFromLayout(`hovermode`))}}),Ph=h(e=>{var t=Ie().overrideAll,n=H(),r=Oh(),i=wt().getSubplotData,a=$(),o=Dt(),s=`gl3d`,c=`scene`;e.name=s,e.attr=c,e.idRoot=c,e.idRegex=e.attrRegex=a.counterRegex(`scene`),e.attributes=kh(),e.layoutAttributes=jh(),e.baseLayoutAttrOverrides=t({hoverlabel:n.hoverlabel},`plot`,`nested`),e.supplyLayoutDefaults=Nh(),e.plot=function(e){for(var t=e._fullLayout,n=e._fullData,a=t._subplots[s],o=0;o<a.length;o++){var c=a[o],l=i(n,s,c),u=t[c],d=u.camera,f=u._scene;f||(f=new r({id:c,graphDiv:e,container:e.querySelector(`.gl-container`),staticPlot:e._context.staticPlot,plotGlPixelRatio:e._context.plotGlPixelRatio,camera:d},t),u._scene=f),f.viewInitial||={up:{x:d.up.x,y:d.up.y,z:d.up.z},eye:{x:d.eye.x,y:d.eye.y,z:d.eye.z},center:{x:d.center.x,y:d.center.y,z:d.center.z}},f.plot(l,t,e.layout)}},e.clean=function(e,t,n,r){for(var i=r._subplots[s]||[],a=0;a<i.length;a++){var o=i[a];!t[o]&&r[o]._scene&&(r[o]._scene.destroy(),r._infolayer&&r._infolayer.selectAll(`.annotation-`+o).remove())}},e.toSVG=function(e){for(var t=e._fullLayout,n=t._subplots[s],r=t._size,i=0;i<n.length;i++){var a=t[n[i]],c=a.domain,l=a._scene,u=l.toImage(`png`);t._glimages.append(`svg:image`).attr({xmlns:o.svg,"xlink:href":u,x:r.l+r.w*c.x[0],y:r.t+r.h*(1-c.y[1]),width:r.w*(c.x[1]-c.x[0]),height:r.h*(c.y[1]-c.y[0]),preserveAspectRatio:`none`}),l.destroy()}},e.cleanId=function(e){if(e.match(/^scene[0-9]*$/)){var t=e.slice(5);return t===`1`&&(t=``),c+t}},e.updateFx=function(e){for(var t=e._fullLayout,n=t._subplots[s],r=0;r<n.length;r++)t[n[r]]._scene.updateFx(t.dragmode,t.hovermode)}}),Fh=h((e,t)=>{t.exports={plot:vh(),attributes:yh(),markerSymbols:gh(),supplyDefaults:bh(),colorbar:[{container:`marker`,min:`cmin`,max:`cmax`},{container:`line`,min:`cmin`,max:`cmax`}],calc:xh(),moduleType:`trace`,name:`scatter3d`,basePlotModule:Ph(),categories:[`gl3d`,`symbols`,`showLegend`,`scatter-like`],meta:{}}}),Ih=h((e,t)=>{t.exports=Fh()}),Lh=h((e,t)=>{var n=q(),r=Pt(),i=jt().axisHoverFormat,{hovertemplateAttrs:a,templatefallbackAttrs:o}=ze(),s=W(),c=z().extendFlat,l=Ie().overrideAll;function u(e){return{valType:`boolean`,dflt:!1}}function d(e){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:u(`x`),y:u(`y`),z:u(`z`)},color:{valType:`color`,dflt:n.defaultLine},usecolormap:{valType:`boolean`,dflt:!1},width:{valType:`number`,min:1,max:16,dflt:2},highlight:{valType:`boolean`,dflt:!0},highlightcolor:{valType:`color`,dflt:n.defaultLine},highlightwidth:{valType:`number`,min:1,max:16,dflt:2}}}var f=t.exports=l(c({z:{valType:`data_array`},x:{valType:`data_array`},y:{valType:`data_array`},text:{valType:`string`,dflt:``,arrayOk:!0},hovertext:{valType:`string`,dflt:``,arrayOk:!0},hovertemplate:a(),hovertemplatefallback:o(),xhoverformat:i(`x`),yhoverformat:i(`y`),zhoverformat:i(`z`),connectgaps:{valType:`boolean`,dflt:!1,editType:`calc`},surfacecolor:{valType:`data_array`}},r(``,{colorAttr:`z or surfacecolor`,showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:`calc`}),{contours:{x:d(`x`),y:d(`y`),z:d(`z`)},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:c({},s.hoverinfo),showlegend:c({},s.showlegend,{dflt:!1})}),`calc`,`nested`);f.x.editType=f.y.editType=f.z.editType=`calc+clearAxisTypes`}),Rh=h((e,t)=>{var n=Ke(),r=$(),i=Gt(),a=Lh(),o=.1;function s(e,t){for(var n=[],r=32,i=0;i<r;i++){var a=i/(r-1),o=t+(1-t)*(1-Math.sin(e*a*Math.PI)**2);n.push([a,Math.max(0,Math.min(1,o))])}return n}function c(e){var t=0;if(!Array.isArray(e)||e.length<2||!e[0]||!e[e.length-1]||+e[0][0]!=0||+e[e.length-1][0]!=1)return!1;for(var n=0;n<e.length;n++){var r=e[n];if(r.length!==2||+r[0]<t)return!1;t=+r[0]}return!0}function l(e,t,o,s){var c,l;function d(n,i){return r.coerce(e,t,a,n,i)}var f=d(`x`),p=d(`y`),m=d(`z`);if(!m||!m.length||f&&f.length<1||p&&p.length<1){t.visible=!1;return}t._xlength=Array.isArray(f)&&r.isArrayOrTypedArray(f[0])?m.length:m[0].length,t._ylength=m.length,n.getComponentMethod(`calendars`,`handleTraceDefaults`)(e,t,[`x`,`y`,`z`],s),d(`text`),d(`hovertext`),d(`hovertemplate`),d(`hovertemplatefallback`),d(`xhoverformat`),d(`yhoverformat`),d(`zhoverformat`),[`lighting.ambient`,`lighting.diffuse`,`lighting.specular`,`lighting.roughness`,`lighting.fresnel`,`lightposition.x`,`lightposition.y`,`lightposition.z`,`hidesurface`,`connectgaps`,`opacity`].forEach(function(e){d(e)}),d(`surfacecolor`);var h=[`x`,`y`,`z`];for(c=0;c<3;++c){var g=`contours.`+h[c],_=d(g+`.show`),v=d(g+`.highlight`);if(_||v)for(l=0;l<3;++l)d(g+`.project.`+h[l]);_&&(d(g+`.color`),d(g+`.width`),d(g+`.usecolormap`)),v&&(d(g+`.highlightcolor`),d(g+`.highlightwidth`)),d(g+`.start`),d(g+`.end`),d(g+`.size`)}i(e,t,s,d,{prefix:``,cLetter:`c`}),u(e,t,s,d),t._length=null}function u(e,t,n,r){var i=r(`opacityscale`);i===`max`?t.opacityscale=[[0,o],[1,1]]:i===`min`?t.opacityscale=[[0,1],[1,o]]:i===`extremes`?t.opacityscale=s(1,o):c(i)||(t.opacityscale=void 0)}t.exports={supplyDefaults:l,opacityscaleDefaults:u}}),zh=h((e,t)=>{var n=Jt();t.exports=function(e,t){t.surfacecolor?n(e,t,{vals:t.surfacecolor,containerStr:``,cLetter:`c`}):n(e,t,{vals:t.z,containerStr:``,cLetter:`c`})}}),Bh=h((e,t)=>{var n=oh().gl_surface3d,r=oh().ndarray,i=oh().ndarray_linear_interpolate.d2,a=Io(),o=Lo(),s=$().isArrayOrTypedArray,c=mh().parseColorScale,l=ph(),u=Yt().extractOpts;function d(e,t,n){this.scene=e,this.uid=n,this.surface=t,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 f=d.prototype;f.getXat=function(e,t,n,r){var i=s(this.data.x)?s(this.data.x[0])?this.data.x[t][e]:this.data.x[e]:e;return n===void 0?i:r.d2l(i,0,n)},f.getYat=function(e,t,n,r){var i=s(this.data.y)?s(this.data.y[0])?this.data.y[t][e]:this.data.y[t]:t;return n===void 0?i:r.d2l(i,0,n)},f.getZat=function(e,t,n,r){var i=this.data.z[t][e];return i===null&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[t][e]),n===void 0?i:r.d2l(i,0,n)},f.handlePick=function(e){if(e.object===this.surface){var t=(e.data.index[0]-1)/this.dataScaleX-1,n=(e.data.index[1]-1)/this.dataScaleY-1,r=Math.max(Math.min(Math.round(t),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(n),this.data._ylength-1),0);e.index=[r,i],e.traceCoordinate=[this.getXat(r,i),this.getYat(r,i),this.getZat(r,i)],e.dataCoordinate=[this.getXat(r,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(r,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(r,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++)e.dataCoordinate[a]!=null&&(e.dataCoordinate[a]*=this.scene.dataScale[a]);var o=this.data.hovertext||this.data.text;return s(o)&&o[i]&&o[i][r]!==void 0?e.textLabel=o[i][r]:o?e.textLabel=o:e.textLabel=``,e.data.dataCoordinate=e.dataCoordinate.slice(),this.surface.highlight(e.data),this.scene.glplot.spikes.position=e.dataCoordinate,!0}};function p(e){var t=e[0].rgb,n=e[e.length-1].rgb;return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}var m=[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 h(e,t){if(e<t)return 0;for(var n=0;Math.floor(e%t)===0;)e/=t,n++;return n}function g(e){for(var t=[],n=0;n<m.length;n++){var r=m[n];t.push(h(e,r))}return t}function _(e){for(var t=g(e),n=e,r=0;r<m.length;r++)if(t[r]>0){n=m[r];break}return n}function v(e,t){if(!(e<1||t<1)){for(var n=g(e),r=g(t),i=1,a=0;a<m.length;a++)i*=m[a]**+Math.max(n[a],r[a]);return i}}function y(e){if(e.length!==0){for(var t=1,n=0;n<e.length;n++)t=v(t,e[n]);return t}}f.calcXnums=function(e){var t,n=[];for(t=1;t<e;t++){var r=this.getXat(t-1,0),i=this.getXat(t,0);i!==r&&r!=null&&i!=null?n[t-1]=Math.abs(i-r):n[t-1]=0}var a=0;for(t=1;t<e;t++)a+=n[t-1];for(t=1;t<e;t++)n[t-1]===0?n[t-1]=1:n[t-1]=Math.round(a/n[t-1]);return n},f.calcYnums=function(e){var t,n=[];for(t=1;t<e;t++){var r=this.getYat(0,t-1),i=this.getYat(0,t);i!==r&&r!=null&&i!=null?n[t-1]=Math.abs(i-r):n[t-1]=0}var a=0;for(t=1;t<e;t++)a+=n[t-1];for(t=1;t<e;t++)n[t-1]===0?n[t-1]=1:n[t-1]=Math.round(a/n[t-1]);return n};var b=[1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,1260],x=b[9],S=b[13];f.estimateScale=function(e,t){for(var n=1+y(t===0?this.calcXnums(e):this.calcYnums(e));n<x;)n*=2;for(;n>S;)n--,n/=_(n),n++,n<x&&(n=S);var r=Math.round(n/e);return r>1?r:1};function C(e,t,n){var r=n[8]+n[2]*t[0]+n[5]*t[1];return e[0]=(n[6]+n[0]*t[0]+n[3]*t[1])/r,e[1]=(n[7]+n[1]*t[0]+n[4]*t[1])/r,e}function w(e,t,n){return T(e,t,C,n),e}function T(e,t,n,r){for(var a=[0,0],o=e.shape[0],s=e.shape[1],c=0;c<o;c++)for(var l=0;l<s;l++)n(a,[c,l],r),e.set(c,l,i(t,a[0],a[1]));return e}f.refineCoords=function(e){for(var t=this.dataScaleX,n=this.dataScaleY,i=e[0].shape[0],a=e[0].shape[1],o=Math.floor(e[0].shape[0]*t+1)|0,s=Math.floor(e[0].shape[1]*n+1)|0,c=1+i+1,l=1+a+1,u=r(new Float32Array(c*l),[c,l]),d=[1/t,0,0,0,1/n,0,0,0,1],f=0;f<e.length;++f){this.surface.padField(u,e[f]);var p=r(new Float32Array(o*s),[o,s]);w(p,u,d),e[f]=p}};function E(e,t){for(var n=!1,r=0;r<e.length;r++)if(t===e[r]){n=!0;break}n===!1&&e.push(t)}f.setContourLevels=function(){var e=[[],[],[]],t=[!1,!1,!1],n=!1,r,i,a;for(r=0;r<3;++r)if(this.showContour[r]&&(n=!0,this.contourSize[r]>0&&this.contourStart[r]!==null&&this.contourEnd[r]!==null&&this.contourEnd[r]>this.contourStart[r]))for(t[r]=!0,i=this.contourStart[r];i<this.contourEnd[r];i+=this.contourSize[r])a=i*this.scene.dataScale[r],E(e[r],a);if(n){var o=[[],[],[]];for(r=0;r<3;++r)this.showContour[r]&&(o[r]=t[r]?e[r]:this.scene.contourLevels[r]);this.surface.update({levels:o})}},f.update=function(e){var t=this.scene,n=t.fullSceneLayout,i=this.surface,s=c(e),d=t.dataScale,f=e.z[0].length,m=e._ylength,h=t.contourLevels;this.data=e;var g,_,v,y,b=[];for(g=0;g<3;g++)for(b[g]=[],_=0;_<f;_++)b[g][_]=[];for(_=0;_<f;_++)for(v=0;v<m;v++)b[0][_][v]=this.getXat(_,v,e.xcalendar,n.xaxis),b[1][_][v]=this.getYat(_,v,e.ycalendar,n.yaxis),b[2][_][v]=this.getZat(_,v,e.zcalendar,n.zaxis);if(e.connectgaps)for(e._emptypoints=o(b[2]),a(b[2],e._emptypoints),e._interpolatedZ=[],_=0;_<f;_++)for(e._interpolatedZ[_]=[],v=0;v<m;v++)e._interpolatedZ[_][v]=b[2][_][v];for(g=0;g<3;g++)for(_=0;_<f;_++)for(v=0;v<m;v++)y=b[g][_][v],y==null?b[g][_][v]=NaN:y=b[g][_][v]*=d[g];for(g=0;g<3;g++)for(_=0;_<f;_++)for(v=0;v<m;v++)y=b[g][_][v],y!=null&&(this.minValues[g]>y&&(this.minValues[g]=y),this.maxValues[g]<y&&(this.maxValues[g]=y));for(g=0;g<3;g++)this.objectOffset[g]=.5*(this.minValues[g]+this.maxValues[g]);for(g=0;g<3;g++)for(_=0;_<f;_++)for(v=0;v<m;v++)y=b[g][_][v],y!=null&&(b[g][_][v]-=this.objectOffset[g]);var x=[r(new Float32Array(f*m),[f,m]),r(new Float32Array(f*m),[f,m]),r(new Float32Array(f*m),[f,m])];for(g=0;g<3;g++)for(_=0;_<f;_++)for(v=0;v<m;v++)x[g].set(_,v,b[g][_][v]);b=[];var C={colormap:s,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!e.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:e.opacityscale,opacity:e.opacity},w=u(e);if(C.intensityBounds=[w.min,w.max],e.surfacecolor){var T=r(new Float32Array(f*m),[f,m]);for(_=0;_<f;_++)for(v=0;v<m;v++)T.set(_,v,e.surfacecolor[v][_]);x.push(T)}else C.intensityBounds[0]*=d[2],C.intensityBounds[1]*=d[2];(S<x[0].shape[0]||S<x[0].shape[1])&&(this.refineData=!1),this.refineData===!0&&(this.dataScaleX=this.estimateScale(x[0].shape[0],0),this.dataScaleY=this.estimateScale(x[0].shape[1],1),(this.dataScaleX!==1||this.dataScaleY!==1)&&this.refineCoords(x)),e.surfacecolor&&(C.intensity=x.pop());var E=[!0,!0,!0],D=[`x`,`y`,`z`];for(g=0;g<3;++g){var O=e.contours[D[g]];E[g]=O.highlight,C.showContour[g]=O.show||O.highlight,C.showContour[g]&&(C.contourProject[g]=[O.project.x,O.project.y,O.project.z],O.show?(this.showContour[g]=!0,C.levels[g]=h[g],i.highlightColor[g]=C.contourColor[g]=l(O.color),O.usecolormap?i.highlightTint[g]=C.contourTint[g]=0:i.highlightTint[g]=C.contourTint[g]=1,C.contourWidth[g]=O.width,this.contourStart[g]=O.start,this.contourEnd[g]=O.end,this.contourSize[g]=O.size):(this.showContour[g]=!1,this.contourStart[g]=null,this.contourEnd[g]=null,this.contourSize[g]=0),O.highlight&&(C.dynamicColor[g]=l(O.highlightcolor),C.dynamicWidth[g]=O.highlightwidth))}p(s)&&(C.vertexColor=!0),C.objectOffset=this.objectOffset,C.coords=x,i.update(C),i.visible=e.visible,i.enableDynamic=E,i.enableHighlight=E,i.snapToData=!0,`lighting`in e&&(i.ambientLight=e.lighting.ambient,i.diffuseLight=e.lighting.diffuse,i.specularLight=e.lighting.specular,i.roughness=e.lighting.roughness,i.fresnel=e.lighting.fresnel),`lightposition`in e&&(i.lightPosition=[e.lightposition.x,e.lightposition.y,e.lightposition.z])},f.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()};function D(e,t){var r=e.glplot.gl,i=n({gl:r}),a=new d(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}t.exports=D}),Vh=h((e,t)=>{t.exports={attributes:Lh(),supplyDefaults:Rh().supplyDefaults,colorbar:{min:`cmin`,max:`cmax`},calc:zh(),plot:Bh(),moduleType:`trace`,name:`surface`,basePlotModule:Ph(),categories:[`gl3d`,`2dMap`,`showLegend`],meta:{}}}),Hh=h((e,t)=>{t.exports=Vh()}),Uh=h((e,t)=>{var n=Pt(),r=jt().axisHoverFormat,{hovertemplateAttrs:i,templatefallbackAttrs:a}=ze(),o=Lh(),s=W(),c=z().extendFlat;t.exports=c({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:i({editType:`calc`}),hovertemplatefallback:a({editType:`calc`}),xhoverformat:r(`x`),yhoverformat:r(`y`),zhoverformat:r(`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`}},n(``,{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:`calc`}),{opacity:o.opacity,flatshading:{valType:`boolean`,dflt:!1,editType:`calc`},contour:{show:c({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:`calc`},lightposition:{x:c({},o.lightposition.x,{dflt:1e5}),y:c({},o.lightposition.y,{dflt:1e5}),z:c({},o.lightposition.z,{dflt:0}),editType:`calc`},lighting:c({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`},o.lighting),hoverinfo:c({},s.hoverinfo,{editType:`calc`}),showlegend:c({},s.showlegend,{dflt:!1})})}),Wh=h((e,t)=>{var n=Pt(),r=jt().axisHoverFormat,{hovertemplateAttrs:i,templatefallbackAttrs:a}=ze(),o=Uh(),s=W(),c=z().extendFlat,l=Ie().overrideAll;function u(e){return{show:{valType:`boolean`,dflt:!1},locations:{valType:`data_array`,dflt:[]},fill:{valType:`number`,min:0,max:1,dflt:1}}}function d(e){return{show:{valType:`boolean`,dflt:!0},fill:{valType:`number`,min:0,max:1,dflt:1}}}var f=t.exports=l(c({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:u(`x`),y:u(`y`),z:u(`z`)},caps:{x:d(`x`),y:d(`y`),z:d(`z`)},text:{valType:`string`,dflt:``,arrayOk:!0},hovertext:{valType:`string`,dflt:``,arrayOk:!0},hovertemplate:i(),hovertemplatefallback:a(),xhoverformat:r(`x`),yhoverformat:r(`y`),zhoverformat:r(`z`),valuehoverformat:r(`value`,1),showlegend:c({},s.showlegend,{dflt:!1})},n(``,{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:`calc`}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:c({},s.hoverinfo)}),`calc`,`nested`);f.flatshading.dflt=!0,f.lighting.facenormalsepsilon.dflt=0,f.x.editType=f.y.editType=f.z.editType=f.value.editType=`calc+clearAxisTypes`}),Gh=h((e,t)=>{var n=$(),r=Ke(),i=Wh(),a=Gt();function o(e,t,r,a){function o(r,a){return n.coerce(e,t,i,r,a)}s(e,t,r,a,o)}function s(e,t,n,i,o){var s=o(`isomin`),c=o(`isomax`);c!=null&&s!=null&&s>c&&(t.isomin=null,t.isomax=null);var l=o(`x`),u=o(`y`),d=o(`z`),f=o(`value`);if(!l||!l.length||!u||!u.length||!d||!d.length||!f||!f.length){t.visible=!1;return}r.getComponentMethod(`calendars`,`handleTraceDefaults`)(e,t,[`x`,`y`,`z`],i),o(`valuehoverformat`),[`x`,`y`,`z`].forEach(function(e){o(e+`hoverformat`);var t=`caps.`+e;o(t+`.show`)&&o(t+`.fill`);var n=`slices.`+e;o(n+`.show`)&&(o(n+`.fill`),o(n+`.locations`))}),o(`spaceframe.show`)&&o(`spaceframe.fill`),o(`surface.show`)&&(o(`surface.count`),o(`surface.fill`),o(`surface.pattern`)),o(`contour.show`)&&(o(`contour.color`),o(`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(e){o(e)}),a(e,t,i,o,{prefix:``,cLetter:`c`}),t._length=null}t.exports={supplyDefaults:o,supplyIsoDefaults:s}}),Kh=h((e,t)=>{var n=$(),r=Jt();function i(e,t){t._len=Math.min(t.u.length,t.v.length,t.w.length,t.x.length,t.y.length,t.z.length),t._u=s(t.u,t._len),t._v=s(t.v,t._len),t._w=s(t.w,t._len),t._x=s(t.x,t._len),t._y=s(t.y,t._len),t._z=s(t.z,t._len);var n=a(t);t._gridFill=n.fill,t._Xs=n.Xs,t._Ys=n.Ys,t._Zs=n.Zs,t._len=n.len;var i=0,o,c,l;t.starts&&(o=s(t.starts.x||[]),c=s(t.starts.y||[]),l=s(t.starts.z||[]),i=Math.min(o.length,c.length,l.length)),t._startsX=o||[],t._startsY=c||[],t._startsZ=l||[];var u=0,d=1/0,f;for(f=0;f<t._len;f++){var p=t._u[f],m=t._v[f],h=t._w[f],g=Math.sqrt(p*p+m*m+h*h);u=Math.max(u,g),d=Math.min(d,g)}for(r(e,t,{vals:[d,u],containerStr:``,cLetter:`c`}),f=0;f<i;f++){var _=o[f];n.xMax=Math.max(n.xMax,_),n.xMin=Math.min(n.xMin,_);var v=c[f];n.yMax=Math.max(n.yMax,v),n.yMin=Math.min(n.yMin,v);var y=l[f];n.zMax=Math.max(n.zMax,y),n.zMin=Math.min(n.zMin,y)}t._slen=i,t._normMax=u,t._xbnds=[n.xMin,n.xMax],t._ybnds=[n.yMin,n.yMax],t._zbnds=[n.zMin,n.zMax]}function a(e){var t=e._x,r=e._y,i=e._z,a=e._len,s,c,l,u=-1/0,d=1/0,f=-1/0,p=1/0,m=-1/0,h=1/0,g=``,_,v,y,b,x,S,C,w,T;for(a&&(b=t[0],S=r[0],w=i[0]),a>1&&(x=t[a-1],C=r[a-1],T=i[a-1]),s=0;s<a;s++)u=Math.max(u,t[s]),d=Math.min(d,t[s]),f=Math.max(f,r[s]),p=Math.min(p,r[s]),m=Math.max(m,i[s]),h=Math.min(h,i[s]),!_&&t[s]!==b&&(_=!0,g+=`x`),!v&&r[s]!==S&&(v=!0,g+=`y`),!y&&i[s]!==w&&(y=!0,g+=`z`);_||(g+=`x`),v||(g+=`y`),y||(g+=`z`);var E=o(e._x),D=o(e._y),O=o(e._z);g=g.replace(`x`,(b>x?`-`:`+`)+`x`),g=g.replace(`y`,(S>C?`-`:`+`)+`y`),g=g.replace(`z`,(w>T?`-`:`+`)+`z`);var k=function(){a=0,E=[],D=[],O=[]};(!a||a<E.length*D.length*O.length)&&k();var A=function(e){return e===`x`?t:e===`y`?r:i},j=function(e){return e===`x`?E:e===`y`?D:O},M=function(e){return e[a-1]<e[0]?-1:1},N=A(g[1]),P=A(g[3]),F=A(g[5]),I=j(g[1]).length,L=j(g[3]).length,R=j(g[5]).length,z=!1,B=function(e,t,n){return I*(L*e+t)+n},V=M(A(g[1])),H=M(A(g[3])),U=M(A(g[5]));for(s=0;s<R-1;s++){for(c=0;c<L-1;c++){for(l=0;l<I-1;l++){var W=B(s,c,l),G=B(s,c,l+1),K=B(s,c+1,l),q=B(s+1,c,l);if((!(N[W]*V<N[G]*V)||!(P[W]*H<P[K]*H)||!(F[W]*U<F[q]*U))&&(z=!0),z)break}if(z)break}if(z)break}return z&&(n.warn(`Encountered arbitrary coordinates! Unable to input data grid.`),k()),{xMin:d,yMin:p,zMin:h,xMax:u,yMax:f,zMax:m,Xs:E,Ys:D,Zs:O,len:a,fill:g}}function o(e){return n.distinctVals(e).vals}function s(e,t){if(t===void 0&&(t=e.length),n.isTypedArray(e))return e.subarray(0,t);for(var r=[],i=0;i<t;i++)r[i]=+e[i];return r}t.exports={calc:i,filter:s,processGrid:a}}),qh=h((e,t)=>{var n=Jt(),r=Kh().processGrid,i=Kh().filter;t.exports=function(e,t){t._len=Math.min(t.x.length,t.y.length,t.z.length,t.value.length),t._x=i(t.x,t._len),t._y=i(t.y,t._len),t._z=i(t.z,t._len),t._value=i(t.value,t._len);var a=r(t);t._gridFill=a.fill,t._Xs=a.Xs,t._Ys=a.Ys,t._Zs=a.Zs,t._len=a.len;for(var o=1/0,s=-1/0,c=0;c<t._len;c++){var l=t._value[c];o=Math.min(o,l),s=Math.max(s,l)}t._minValues=o,t._maxValues=s,t._vMin=t.isomin===void 0||t.isomin===null?o:t.isomin,t._vMax=t.isomax===void 0||t.isomax===null?s:t.isomax,n(e,t,{vals:[t._vMin,t._vMax],containerStr:``,cLetter:`c`})}}),Jh=h((e,t)=>{t.exports=function(e,t,n,r){r||=e.length;for(var i=Array(r),a=0;a<r;a++)i[a]=[e[a],t[a],n[a]];return i}}),Yh=h((e,t)=>{var n=oh().gl_mesh3d,r=mh().parseColorScale,i=$().isArrayOrTypedArray,a=ph(),o=Yt().extractOpts,s=Jh(),c=function(e,t){for(var n=t.length-1;n>0;n--){var r=Math.min(t[n],t[n-1]),i=Math.max(t[n],t[n-1]);if(i>r&&r<e&&e<=i)return{id:n,distRatio:(i-e)/(i-r)}}return{id:0,distRatio:0}};function l(e,t,n){this.scene=e,this.uid=n,this.mesh=t,this.name=``,this.data=null,this.showContour=!1}var u=l.prototype;u.handlePick=function(e){if(e.object===this.mesh){var t=e.data.index,n=this.data._meshX[t],r=this.data._meshY[t],a=this.data._meshZ[t],o=this.data._Ys.length,s=this.data._Zs.length,l=c(n,this.data._Xs).id,u=c(r,this.data._Ys).id,d=e.index=c(a,this.data._Zs).id+s*u+s*o*l;e.traceCoordinate=[this.data._meshX[d],this.data._meshY[d],this.data._meshZ[d],this.data._value[d]];var f=this.data.hovertext||this.data.text;return i(f)&&f[d]!==void 0?e.textLabel=f[d]:f&&(e.textLabel=f),!0}},u.update=function(e){var t=this.scene,n=t.fullSceneLayout;this.data=f(e);function i(e,t,n,r){return t.map(function(t){return e.d2l(t,0,r)*n})}var c={positions:s(i(n.xaxis,e._meshX,t.dataScale[0],e.xcalendar),i(n.yaxis,e._meshY,t.dataScale[1],e.ycalendar),i(n.zaxis,e._meshZ,t.dataScale[2],e.zcalendar)),cells:s(e._meshI,e._meshJ,e._meshK),lightPosition:[e.lightposition.x,e.lightposition.y,e.lightposition.z],ambient:e.lighting.ambient,diffuse:e.lighting.diffuse,specular:e.lighting.specular,roughness:e.lighting.roughness,fresnel:e.lighting.fresnel,vertexNormalsEpsilon:e.lighting.vertexnormalsepsilon,faceNormalsEpsilon:e.lighting.facenormalsepsilon,opacity:e.opacity,contourEnable:e.contour.show,contourColor:a(e.contour.color).slice(0,3),contourWidth:e.contour.width,useFacetNormals:e.flatshading},l=o(e);c.vertexIntensity=e._meshIntensity,c.vertexIntensityBounds=[l.min,l.max],c.colormap=r(e),this.mesh.update(c)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};var d=[`xyz`,`xzy`,`yxz`,`yzx`,`zxy`,`zyx`];function f(e){e._meshI=[],e._meshJ=[],e._meshK=[];var t=e.surface.show,n=e.spaceframe.show,r=e.surface.fill,i=e.spaceframe.fill,a=!1,o=!1,s=0,l,u,f=e._Xs,p=e._Ys,m=e._Zs,h=f.length,g=p.length,_=m.length,v=d.indexOf(e._gridFill.replace(/-/g,``).replace(/\+/g,``)),y=function(e,t,n){switch(v){case 5:return n+_*t+_*g*e;case 4:return n+_*e+_*h*t;case 3:return t+g*n+g*_*e;case 2:return t+g*e+g*h*n;case 1:return e+h*n+h*_*t;default:return e+h*t+h*g*n}},b=e._minValues,x=e._maxValues,S=e._vMin,C=e._vMax,w,T,E,D;function O(e,t,n){for(var r=D.length,i=u;i<r;i++)if(e===w[i]&&t===T[i]&&n===E[i])return i;return-1}function k(){u=l}function A(){w=[],T=[],E=[],D=[],l=0,k()}function j(e,t,n,r){return w.push(e),T.push(t),E.push(n),D.push(r),l++,l-1}function M(t,n,r){return e._meshI.push(t),e._meshJ.push(n),e._meshK.push(r),s++,s-1}function N(e,t,n){for(var r=[],i=0;i<e.length;i++)r[i]=(e[i]+t[i]+n[i])/3;return r}function P(e,t,n){for(var r=[],i=0;i<e.length;i++)r[i]=e[i]*(1-n)+n*t[i];return r}var F;function I(e){F=e}function L(e,t){var n=e[0],r=e[1],i=e[2],a=N(n,r,i),o=Math.sqrt(1-F),s=P(a,n,o),c=P(a,r,o),l=P(a,i,o),u=t[0],d=t[1],f=t[2];return{xyzv:[[n,r,c],[c,s,n],[r,i,l],[l,c,r],[i,n,s],[s,l,i]],abc:[[u,d,-1],[-1,-1,u],[d,f,-1],[-1,-1,d],[f,u,-1],[-1,-1,f]]}}function R(e,t){return e===`all`||e===null?!0:e.indexOf(t)>-1}function z(e,t){return e===null?t:e}function B(e,t,n){k();var r=[t],i=[n];if(F>=1)r=[t],i=[n];else if(F>0){var a=L(t,n);r=a.xyzv,i=a.abc}for(var o=0;o<r.length;o++){t=r[o],n=i[o];for(var s=[],c=0;c<3;c++){var l=t[c][0],u=t[c][1],d=t[c][2],f=t[c][3],p=n[c]>-1?n[c]:O(l,u,d);p>-1?s[c]=p:s[c]=j(l,u,d,z(e,f))}M(s[0],s[1],s[2])}}function V(e,t,n){var r=function(r,i,a){B(e,[t[r],t[i],t[a]],[n[r],n[i],n[a]])};r(0,1,2),r(2,3,0)}function H(e,t,n){var r=function(r,i,a){B(e,[t[r],t[i],t[a]],[n[r],n[i],n[a]])};r(0,1,2),r(3,0,1),r(2,3,0),r(1,2,3)}function U(e,t,n,r){var i=e[3];i<n&&(i=n),i>r&&(i=r);for(var a=(e[3]-i)/(e[3]-t[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*e[s]+a*t[s];return o}function W(e,t,n){return e>=t&&e<=n}function G(e){var t=.001*(C-S);return e>=S-t&&e<=C+t}function K(t){for(var n=[],r=0;r<4;r++){var i=t[r];n.push([e._x[i],e._y[i],e._z[i],e._value[i]])}return n}var q=3;function J(e,t,n,r,i,a){a||=1,n=[-1,-1,-1];var o=!1,s=[W(t[0][3],r,i),W(t[1][3],r,i),W(t[2][3],r,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var c=function(e,t,n){return G(t[0][3])&&G(t[1][3])&&G(t[2][3])?(B(e,t,n),!0):a<q?J(e,t,n,S,C,++a):!1};if(s[0]&&s[1]&&s[2])return c(e,t,n)||o;var l=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach(function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=t[a[0]],d=t[a[1]],f=t[a[2]],p=U(f,u,r,i),m=U(f,d,r,i);o=c(e,[m,p,u],[-1,-1,n[a[0]]])||o,o=c(e,[u,d,m],[n[a[0]],n[a[1]],-1])||o,l=!0}}),l||[[0,1,2],[1,2,0],[2,0,1]].forEach(function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=t[a[0]],d=t[a[1]],f=t[a[2]],p=U(d,u,r,i);o=c(e,[U(f,u,r,i),p,u],[-1,-1,n[a[0]]])||o,l=!0}}),o}function Y(e,t,n,r){var i=!1,a=K(t),s=[W(a[0][3],n,r),W(a[1][3],n,r),W(a[2][3],n,r),W(a[3][3],n,r)];if(!s[0]&&!s[1]&&!s[2]&&!s[3])return i;if(s[0]&&s[1]&&s[2]&&s[3])return o&&(i=H(e,a,t)||i),i;var c=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach(function(l){if(s[l[0]]&&s[l[1]]&&s[l[2]]&&!s[l[3]]){var u=a[l[0]],d=a[l[1]],f=a[l[2]],p=a[l[3]];i=o?B(e,[u,d,f],[t[l[0]],t[l[1]],t[l[2]]])||i:B(null,[U(p,u,n,r),U(p,d,n,r),U(p,f,n,r)],[-1,-1,-1])||i,c=!0}}),c||([[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(l){if(s[l[0]]&&s[l[1]]&&!s[l[2]]&&!s[l[3]]){var u=a[l[0]],d=a[l[1]],f=a[l[2]],p=a[l[3]],m=U(f,u,n,r),h=U(f,d,n,r),g=U(p,d,n,r),_=U(p,u,n,r);o?(i=B(e,[u,_,m],[t[l[0]],-1,-1])||i,i=B(e,[d,h,g],[t[l[1]],-1,-1])||i):i=V(null,[m,h,g,_],[-1,-1,-1,-1])||i,c=!0}}),c)||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach(function(l){if(s[l[0]]&&!s[l[1]]&&!s[l[2]]&&!s[l[3]]){var u=a[l[0]],d=a[l[1]],f=a[l[2]],p=a[l[3]],m=U(d,u,n,r),h=U(f,u,n,r),g=U(p,u,n,r);o?(i=B(e,[u,m,h],[t[l[0]],-1,-1])||i,i=B(e,[u,h,g],[t[l[0]],-1,-1])||i,i=B(e,[u,g,m],[t[l[0]],-1,-1])||i):i=B(null,[m,h,g],[-1,-1,-1])||i,c=!0}}),i}function X(e,t,n,r,i,s,c,l,u,d,f){var p=!1;return a&&(R(e,`A`)&&(p=Y(null,[t,n,r,s],d,f)||p),R(e,`B`)&&(p=Y(null,[n,r,i,u],d,f)||p),R(e,`C`)&&(p=Y(null,[n,s,c,u],d,f)||p),R(e,`D`)&&(p=Y(null,[r,s,l,u],d,f)||p),R(e,`E`)&&(p=Y(null,[n,r,s,u],d,f)||p)),o&&(p=Y(e,[n,r,s,u],d,f)||p),p}function Z(e,t,n,r,i,a,o,s){return[s[0]===!0?!0:J(e,K([t,n,r]),[t,n,r],a,o),s[1]===!0?!0:J(e,K([r,i,t]),[r,i,t],a,o)]}function Q(e,t,n,r,i,a,o,s,c){return s?Z(e,t,n,i,r,a,o,c):Z(e,n,i,r,t,a,o,c)}function ee(e,t,n,r,i,a,o){var s=!1,c,l,u,d,f=function(){s=J(e,[c,l,u],[-1,-1,-1],i,a)||s,s=J(e,[u,d,c],[-1,-1,-1],i,a)||s},p=o[0],m=o[1],h=o[2];return p&&(c=P(K([y(t,n-0,r-0)])[0],K([y(t-1,n-0,r-0)])[0],p),l=P(K([y(t,n-0,r-1)])[0],K([y(t-1,n-0,r-1)])[0],p),u=P(K([y(t,n-1,r-1)])[0],K([y(t-1,n-1,r-1)])[0],p),d=P(K([y(t,n-1,r-0)])[0],K([y(t-1,n-1,r-0)])[0],p),f()),m&&(c=P(K([y(t-0,n,r-0)])[0],K([y(t-0,n-1,r-0)])[0],m),l=P(K([y(t-0,n,r-1)])[0],K([y(t-0,n-1,r-1)])[0],m),u=P(K([y(t-1,n,r-1)])[0],K([y(t-1,n-1,r-1)])[0],m),d=P(K([y(t-1,n,r-0)])[0],K([y(t-1,n-1,r-0)])[0],m),f()),h&&(c=P(K([y(t-0,n-0,r)])[0],K([y(t-0,n-0,r-1)])[0],h),l=P(K([y(t-0,n-1,r)])[0],K([y(t-0,n-1,r-1)])[0],h),u=P(K([y(t-1,n-1,r)])[0],K([y(t-1,n-1,r-1)])[0],h),d=P(K([y(t-1,n-0,r)])[0],K([y(t-1,n-0,r-1)])[0],h),f()),s}function te(e,t,n,r,i,o,s,c,l,u,d,f){var p=e;return f?(a&&e===`even`&&(p=null),X(p,t,n,r,i,o,s,c,l,u,d)):(a&&e===`odd`&&(p=null),X(p,l,c,s,o,i,r,n,t,u,d))}function ne(e,t,n,r,i){for(var a=[],o=0,s=0;s<t.length;s++)for(var c=t[s],l=1;l<_;l++)for(var u=1;u<g;u++)a.push(Q(e,y(c,u-1,l-1),y(c,u-1,l),y(c,u,l-1),y(c,u,l),n,r,(c+u+l)%2,i&&i[o]?i[o]:[])),o++;return a}function re(e,t,n,r,i){for(var a=[],o=0,s=0;s<t.length;s++)for(var c=t[s],l=1;l<h;l++)for(var u=1;u<_;u++)a.push(Q(e,y(l-1,c,u-1),y(l,c,u-1),y(l-1,c,u),y(l,c,u),n,r,(l+c+u)%2,i&&i[o]?i[o]:[])),o++;return a}function ie(e,t,n,r,i){for(var a=[],o=0,s=0;s<t.length;s++)for(var c=t[s],l=1;l<g;l++)for(var u=1;u<h;u++)a.push(Q(e,y(u-1,l-1,c),y(u-1,l,c),y(u,l-1,c),y(u,l,c),n,r,(u+l+c)%2,i&&i[o]?i[o]:[])),o++;return a}function ae(e,t,n){for(var r=1;r<_;r++)for(var i=1;i<g;i++)for(var a=1;a<h;a++)te(e,y(a-1,i-1,r-1),y(a-1,i-1,r),y(a-1,i,r-1),y(a-1,i,r),y(a,i-1,r-1),y(a,i-1,r),y(a,i,r-1),y(a,i,r),t,n,(a+i+r)%2)}function oe(e,t,n){o=!0,ae(e,t,n),o=!1}function se(e,t,n){a=!0,ae(e,t,n),a=!1}function ce(e,t,n,r,i,a){for(var o=[],s=0,c=0;c<t.length;c++)for(var l=t[c],u=1;u<_;u++)for(var d=1;d<g;d++)o.push(ee(e,l,d,u,n,r,i[c],a&&a[s]?a[s]:[])),s++;return o}function le(e,t,n,r,i,a){for(var o=[],s=0,c=0;c<t.length;c++)for(var l=t[c],u=1;u<h;u++)for(var d=1;d<_;d++)o.push(ee(e,u,l,d,n,r,i[c],a&&a[s]?a[s]:[])),s++;return o}function ue(e,t,n,r,i,a){for(var o=[],s=0,c=0;c<t.length;c++)for(var l=t[c],u=1;u<g;u++)for(var d=1;d<h;d++)o.push(ee(e,d,u,l,n,r,i[c],a&&a[s]?a[s]:[])),s++;return o}function de(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n}function fe(){for(var t=0;t<h;t++)for(var n=0;n<g;n++)for(var r=0;r<_;r++){var i=y(t,n,r);j(e._x[i],e._y[i],e._z[i],e._value[i])}}function pe(){A(),fe();var a=null;if(n&&i&&(I(i),oe(a,S,C)),t&&r){I(r);for(var o=e.surface.pattern,l=e.surface.count,u=0;u<l;u++){var d=l===1?.5:u/(l-1),v=(1-d)*S+d*C,y=Math.abs(v-b)>Math.abs(v-x)?[b,v]:[v,x];se(o,y[0],y[1])}}var O=[[Math.min(S,x),Math.max(S,x)],[Math.min(b,C),Math.max(b,C)]];[`x`,`y`,`z`].forEach(function(t){for(var n=[],r=0;r<O.length;r++){var i=0,o=O[r][0],s=O[r][1],l=e.slices[t];if(l.show&&l.fill){I(l.fill);var u=[],d=[],v=[];if(l.locations.length)for(var y=0;y<l.locations.length;y++){var b=c(l.locations[y],t===`x`?f:t===`y`?p:m);b.distRatio===0?u.push(b.id):b.id>0&&(d.push(b.id),t===`x`?v.push([b.distRatio,0,0]):t===`y`?v.push([0,b.distRatio,0]):v.push([0,0,b.distRatio]))}else u=t===`x`?de(1,h-1):t===`y`?de(1,g-1):de(1,_-1);d.length>0&&(t===`x`?n[i]=ce(a,d,o,s,v,n[i]):t===`y`?n[i]=le(a,d,o,s,v,n[i]):n[i]=ue(a,d,o,s,v,n[i]),i++),u.length>0&&(t===`x`?n[i]=ne(a,u,o,s,n[i]):t===`y`?n[i]=re(a,u,o,s,n[i]):n[i]=ie(a,u,o,s,n[i]),i++)}var x=e.caps[t];x.show&&x.fill&&(I(x.fill),t===`x`?n[i]=ne(a,[0,h-1],o,s,n[i]):t===`y`?n[i]=re(a,[0,g-1],o,s,n[i]):n[i]=ie(a,[0,_-1],o,s,n[i]),i++)}}),s===0&&A(),e._meshX=w,e._meshY=T,e._meshZ=E,e._meshIntensity=D,e._Xs=f,e._Ys=p,e._Zs=m}return pe(),e}function p(e,t){var r=e.glplot.gl,i=n({gl:r}),a=new l(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}t.exports={findNearestOnAxis:c,generateIsoMeshes:f,createIsosurfaceTrace:p}}),Xh=h((e,t)=>{t.exports={attributes:Wh(),supplyDefaults:Gh().supplyDefaults,calc:qh(),colorbar:{min:`cmin`,max:`cmax`},plot:Yh().createIsosurfaceTrace,moduleType:`trace`,name:`isosurface`,basePlotModule:Ph(),categories:[`gl3d`,`showLegend`],meta:{}}}),Zh=h((e,t)=>{t.exports=Xh()}),Qh=h((e,t)=>{var n=Pt(),r=Wh(),i=Lh(),a=W(),o=z().extendFlat,s=Ie().overrideAll,c=t.exports=s(o({x:r.x,y:r.y,z:r.z,value:r.value,isomin:r.isomin,isomax:r.isomax,surface:r.surface,spaceframe:{show:{valType:`boolean`,dflt:!1},fill:{valType:`number`,min:0,max:1,dflt:1}},slices:r.slices,caps:r.caps,text:r.text,hovertext:r.hovertext,xhoverformat:r.xhoverformat,yhoverformat:r.yhoverformat,zhoverformat:r.zhoverformat,valuehoverformat:r.valuehoverformat,hovertemplate:r.hovertemplate,hovertemplatefallback:r.hovertemplatefallback},n(``,{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:`calc`}),{colorbar:r.colorbar,opacity:r.opacity,opacityscale:i.opacityscale,lightposition:r.lightposition,lighting:r.lighting,flatshading:r.flatshading,contour:r.contour,hoverinfo:o({},a.hoverinfo),showlegend:o({},a.showlegend,{dflt:!1})}),`calc`,`nested`);c.x.editType=c.y.editType=c.z.editType=c.value.editType=`calc+clearAxisTypes`}),$h=h((e,t)=>{var n=$(),r=Qh(),i=Gh().supplyIsoDefaults,a=Rh().opacityscaleDefaults;t.exports=function(e,t,o,s){function c(i,a){return n.coerce(e,t,r,i,a)}i(e,t,o,s,c),a(e,t,s,c)}}),eg=h((e,t)=>{var n=oh().gl_mesh3d,r=mh().parseColorScale,i=$().isArrayOrTypedArray,a=ph(),o=Yt().extractOpts,s=Jh(),c=Yh().findNearestOnAxis,l=Yh().generateIsoMeshes;function u(e,t,n){this.scene=e,this.uid=n,this.mesh=t,this.name=``,this.data=null,this.showContour=!1}var d=u.prototype;d.handlePick=function(e){if(e.object===this.mesh){var t=e.data.index,n=this.data._meshX[t],r=this.data._meshY[t],a=this.data._meshZ[t],o=this.data._Ys.length,s=this.data._Zs.length,l=c(n,this.data._Xs).id,u=c(r,this.data._Ys).id,d=e.index=c(a,this.data._Zs).id+s*u+s*o*l;e.traceCoordinate=[this.data._meshX[d],this.data._meshY[d],this.data._meshZ[d],this.data._value[d]];var f=this.data.hovertext||this.data.text;return i(f)&&f[d]!==void 0?e.textLabel=f[d]:f&&(e.textLabel=f),!0}},d.update=function(e){var t=this.scene,n=t.fullSceneLayout;this.data=l(e);function i(e,t,n,r){return t.map(function(t){return e.d2l(t,0,r)*n})}var c={positions:s(i(n.xaxis,e._meshX,t.dataScale[0],e.xcalendar),i(n.yaxis,e._meshY,t.dataScale[1],e.ycalendar),i(n.zaxis,e._meshZ,t.dataScale[2],e.zcalendar)),cells:s(e._meshI,e._meshJ,e._meshK),lightPosition:[e.lightposition.x,e.lightposition.y,e.lightposition.z],ambient:e.lighting.ambient,diffuse:e.lighting.diffuse,specular:e.lighting.specular,roughness:e.lighting.roughness,fresnel:e.lighting.fresnel,vertexNormalsEpsilon:e.lighting.vertexnormalsepsilon,faceNormalsEpsilon:e.lighting.facenormalsepsilon,opacity:e.opacity,opacityscale:e.opacityscale,contourEnable:e.contour.show,contourColor:a(e.contour.color).slice(0,3),contourWidth:e.contour.width,useFacetNormals:e.flatshading},u=o(e);c.vertexIntensity=e._meshIntensity,c.vertexIntensityBounds=[u.min,u.max],c.colormap=r(e),this.mesh.update(c)},d.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function f(e,t){var r=e.glplot.gl,i=n({gl:r}),a=new u(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}t.exports=f}),tg=h((e,t)=>{t.exports={attributes:Qh(),supplyDefaults:$h(),calc:qh(),colorbar:{min:`cmin`,max:`cmax`},plot:eg(),moduleType:`trace`,name:`volume`,basePlotModule:Ph(),categories:[`gl3d`,`showLegend`],meta:{}}}),ng=h((e,t)=>{t.exports=tg()}),rg=h((e,t)=>{var n=Ke(),r=$(),i=Gt(),a=Uh();t.exports=function(e,t,o,s){function c(n,i){return r.coerce(e,t,a,n,i)}function l(e){var t=e.map(function(e){var t=c(e);return t&&r.isArrayOrTypedArray(t)?t:null});return t.every(function(e){return e&&e.length===t[0].length})&&t}if(!l([`x`,`y`,`z`])){t.visible=!1;return}if(l([`i`,`j`,`k`]),t.i&&(!t.j||!t.k)||t.j&&(!t.k||!t.i)||t.k&&(!t.i||!t.j)){t.visible=!1;return}n.getComponentMethod(`calendars`,`handleTraceDefaults`)(e,t,[`x`,`y`,`z`],s),[`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(e){c(e)}),c(`contour.show`)&&(c(`contour.color`),c(`contour.width`)),`intensity`in e?(c(`intensity`),c(`intensitymode`),i(e,t,s,c,{prefix:``,cLetter:`c`})):(t.showscale=!1,`facecolor`in e?c(`facecolor`):`vertexcolor`in e?c(`vertexcolor`):c(`color`,o)),c(`text`),c(`hovertext`),c(`hovertemplate`),c(`hovertemplatefallback`),c(`xhoverformat`),c(`yhoverformat`),c(`zhoverformat`),t._length=null}}),ig=h((e,t)=>{var n=Jt();t.exports=function(e,t){t.intensity&&n(e,t,{vals:t.intensity,containerStr:``,cLetter:`c`})}}),ag=h((e,t)=>{var n=oh().gl_mesh3d,r=oh().delaunay_triangulate,i=oh().alpha_shape,a=oh().convex_hull,o=mh().parseColorScale,s=$().isArrayOrTypedArray,c=ph(),l=Yt().extractOpts,u=Jh();function d(e,t,n){this.scene=e,this.uid=n,this.mesh=t,this.name=``,this.color=`#fff`,this.data=null,this.showContour=!1}var f=d.prototype;f.handlePick=function(e){if(e.object===this.mesh){var t=e.index=e.data.index;e.data._cellCenter?e.traceCoordinate=e.data.dataCoordinate:e.traceCoordinate=[this.data.x[t],this.data.y[t],this.data.z[t]];var n=this.data.hovertext||this.data.text;return s(n)&&n[t]!==void 0?e.textLabel=n[t]:n&&(e.textLabel=n),!0}};function p(e){for(var t=[],n=e.length,r=0;r<n;r++)t[r]=c(e[r]);return t}function m(e,t,n,r){for(var i=[],a=t.length,o=0;o<a;o++)i[o]=e.d2l(t[o],0,r)*n;return i}function h(e){for(var t=[],n=e.length,r=0;r<n;r++)t[r]=Math.round(e[r]);return t}function g(e,t){for(var n=[`x`,`y`,`z`].indexOf(e),i=[],a=t.length,o=0;o<a;o++)i[o]=[t[o][(n+1)%3],t[o][(n+2)%3]];return r(i)}function _(e,t){for(var n=e.length,r=0;r<n;r++)if(e[r]<=-.5||e[r]>=t-.5)return!1;return!0}f.update=function(e){var t=this.scene,n=t.fullSceneLayout;this.data=e;var r=e.x.length,s=u(m(n.xaxis,e.x,t.dataScale[0],e.xcalendar),m(n.yaxis,e.y,t.dataScale[1],e.ycalendar),m(n.zaxis,e.z,t.dataScale[2],e.zcalendar)),d;if(e.i&&e.j&&e.k){if(e.i.length!==e.j.length||e.j.length!==e.k.length||!_(e.i,r)||!_(e.j,r)||!_(e.k,r))return;d=u(h(e.i),h(e.j),h(e.k))}else d=e.alphahull===0?a(s):e.alphahull>0?i(e.alphahull,s):g(e.delaunayaxis,s);var f={positions:s,cells:d,lightPosition:[e.lightposition.x,e.lightposition.y,e.lightposition.z],ambient:e.lighting.ambient,diffuse:e.lighting.diffuse,specular:e.lighting.specular,roughness:e.lighting.roughness,fresnel:e.lighting.fresnel,vertexNormalsEpsilon:e.lighting.vertexnormalsepsilon,faceNormalsEpsilon:e.lighting.facenormalsepsilon,opacity:e.opacity,contourEnable:e.contour.show,contourColor:c(e.contour.color).slice(0,3),contourWidth:e.contour.width,useFacetNormals:e.flatshading};if(e.intensity){var v=l(e);this.color=`#fff`;var y=e.intensitymode;f[y+`Intensity`]=e.intensity,f[y+`IntensityBounds`]=[v.min,v.max],f.colormap=o(e)}else e.vertexcolor?(this.color=e.vertexcolor[0],f.vertexColors=p(e.vertexcolor)):e.facecolor?(this.color=e.facecolor[0],f.cellColors=p(e.facecolor)):(this.color=e.color,f.meshColor=c(e.color));this.mesh.update(f)},f.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function v(e,t){var r=e.glplot.gl,i=n({gl:r}),a=new d(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}t.exports=v}),og=h((e,t)=>{t.exports={attributes:Uh(),supplyDefaults:rg(),calc:ig(),colorbar:{min:`cmin`,max:`cmax`},plot:ag(),moduleType:`trace`,name:`mesh3d`,basePlotModule:Ph(),categories:[`gl3d`,`showLegend`],meta:{}}}),sg=h((e,t)=>{t.exports=og()}),cg=h((e,t)=>{var n=Pt(),r=jt().axisHoverFormat,{hovertemplateAttrs:i,templatefallbackAttrs:a}=ze(),o=Uh(),s=W(),c=z().extendFlat,l={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:i({editType:`calc`},{keys:[`norm`]}),hovertemplatefallback:a({editType:`calc`}),uhoverformat:r(`u`,1),vhoverformat:r(`v`,1),whoverformat:r(`w`,1),xhoverformat:r(`x`),yhoverformat:r(`y`),zhoverformat:r(`z`),showlegend:c({},s.showlegend,{dflt:!1})};c(l,n(``,{colorAttr:`u/v/w norm`,showScaleDflt:!0,editTypeOverride:`calc`})),[`opacity`,`lightposition`,`lighting`].forEach(function(e){l[e]=o[e]}),l.hoverinfo=c({},s.hoverinfo,{editType:`calc`,flags:[`x`,`y`,`z`,`u`,`v`,`w`,`norm`,`text`,`name`],dflt:`x+y+z+norm+text+name`}),t.exports=l}),lg=h((e,t)=>{var n=$(),r=Gt(),i=cg();t.exports=function(e,t,a,o){function s(r,a){return n.coerce(e,t,i,r,a)}var c=s(`u`),l=s(`v`),u=s(`w`),d=s(`x`),f=s(`y`),p=s(`z`);if(!c||!c.length||!l||!l.length||!u||!u.length||!d||!d.length||!f||!f.length||!p||!p.length){t.visible=!1;return}s(`sizeref`,s(`sizemode`)===`raw`?1:.5),s(`anchor`),s(`lighting.ambient`),s(`lighting.diffuse`),s(`lighting.specular`),s(`lighting.roughness`),s(`lighting.fresnel`),s(`lightposition.x`),s(`lightposition.y`),s(`lightposition.z`),r(e,t,o,s,{prefix:``,cLetter:`c`}),s(`text`),s(`hovertext`),s(`hovertemplate`),s(`hovertemplatefallback`),s(`uhoverformat`),s(`vhoverformat`),s(`whoverformat`),s(`xhoverformat`),s(`yhoverformat`),s(`zhoverformat`),t._length=null}}),ug=h((e,t)=>{var n=Jt();t.exports=function(e,t){for(var r=t.u,i=t.v,a=t.w,o=Math.min(t.x.length,t.y.length,t.z.length,r.length,i.length,a.length),s=-1/0,c=1/0,l=0;l<o;l++){var u=r[l],d=i[l],f=a[l],p=Math.sqrt(u*u+d*d+f*f);s=Math.max(s,p),c=Math.min(c,p)}t._len=o,t._normMax=s,n(e,t,{vals:[c,s],containerStr:``,cLetter:`c`})}}),dg=h((e,t)=>{var n=oh().gl_cone3d,r=oh().gl_cone3d.createConeMesh,i=$().simpleMap,a=mh().parseColorScale,o=Yt().extractOpts,s=$().isArrayOrTypedArray,c=Jh();function l(e,t){this.scene=e,this.uid=t,this.mesh=null,this.data=null}var u=l.prototype;u.handlePick=function(e){if(e.object===this.mesh){var t=e.index=e.data.index,n=this.data.x[t],r=this.data.y[t],i=this.data.z[t],a=this.data.u[t],o=this.data.v[t],c=this.data.w[t];e.traceCoordinate=[n,r,i,a,o,c,Math.sqrt(a*a+o*o+c*c)];var l=this.data.hovertext||this.data.text;return s(l)&&l[t]!==void 0?e.textLabel=l[t]:l&&(e.textLabel=l),!0}};var d={xaxis:0,yaxis:1,zaxis:2},f={tip:1,tail:0,cm:.25,center:.5},p={tip:1,tail:1,cm:.75,center:.5};function m(e,t){var r=e.fullSceneLayout,s=e.dataScale,l={};function u(e,t){var n=r[t],a=s[d[t]];return i(e,function(e){return n.d2l(e)*a})}l.vectors=c(u(t.u,`xaxis`),u(t.v,`yaxis`),u(t.w,`zaxis`),t._len),l.positions=c(u(t.x,`xaxis`),u(t.y,`yaxis`),u(t.z,`zaxis`),t._len);var m=o(t);l.colormap=a(t),l.vertexIntensityBounds=[m.min/t._normMax,m.max/t._normMax],l.coneOffset=f[t.anchor];var h=t.sizemode;h===`scaled`?l.coneSize=t.sizeref||.5:h===`absolute`?l.coneSize=t.sizeref&&t._normMax?t.sizeref/t._normMax:.5:h===`raw`&&(l.coneSize=t.sizeref),l.coneSizemode=h;var g=n(l),_=t.lightposition;return g.lightPosition=[_.x,_.y,_.z],g.ambient=t.lighting.ambient,g.diffuse=t.lighting.diffuse,g.specular=t.lighting.specular,g.roughness=t.lighting.roughness,g.fresnel=t.lighting.fresnel,g.opacity=t.opacity,t._pad=p[t.anchor]*g.vectorScale*g.coneScale*t._normMax,g}u.update=function(e){this.data=e;var t=m(this.scene,e);this.mesh.update(t)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function h(e,t){var n=e.glplot.gl,i=r(n,m(e,t)),a=new l(e,t.uid);return a.mesh=i,a.data=t,i._trace=a,e.glplot.add(i),a}t.exports=h}),fg=h((e,t)=>{t.exports={moduleType:`trace`,name:`cone`,basePlotModule:Ph(),categories:[`gl3d`,`showLegend`],attributes:cg(),supplyDefaults:lg(),colorbar:{min:`cmin`,max:`cmax`},calc:ug(),plot:dg(),eventData:function(e,t){return e.norm=t.traceCoordinate[6],e},meta:{}}}),pg=h((e,t)=>{t.exports=fg()}),mg=h((e,t)=>{var n=Pt(),r=jt().axisHoverFormat,{hovertemplateAttrs:i,templatefallbackAttrs:a}=ze(),o=Uh(),s=W(),c=z().extendFlat,l={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:i({editType:`calc`},{keys:[`tubex`,`tubey`,`tubez`,`tubeu`,`tubev`,`tubew`,`norm`,`divergence`]}),hovertemplatefallback:a({editType:`calc`}),uhoverformat:r(`u`,1),vhoverformat:r(`v`,1),whoverformat:r(`w`,1),xhoverformat:r(`x`),yhoverformat:r(`y`),zhoverformat:r(`z`),showlegend:c({},s.showlegend,{dflt:!1})};c(l,n(``,{colorAttr:`u/v/w norm`,showScaleDflt:!0,editTypeOverride:`calc`})),[`opacity`,`lightposition`,`lighting`].forEach(function(e){l[e]=o[e]}),l.hoverinfo=c({},s.hoverinfo,{editType:`calc`,flags:[`x`,`y`,`z`,`u`,`v`,`w`,`norm`,`divergence`,`text`,`name`],dflt:`x+y+z+norm+text+name`}),t.exports=l}),hg=h((e,t)=>{var n=$(),r=Gt(),i=mg();t.exports=function(e,t,a,o){function s(r,a){return n.coerce(e,t,i,r,a)}var c=s(`u`),l=s(`v`),u=s(`w`),d=s(`x`),f=s(`y`),p=s(`z`);if(!c||!c.length||!l||!l.length||!u||!u.length||!d||!d.length||!f||!f.length||!p||!p.length){t.visible=!1;return}s(`starts.x`),s(`starts.y`),s(`starts.z`),s(`maxdisplayed`),s(`sizeref`),s(`lighting.ambient`),s(`lighting.diffuse`),s(`lighting.specular`),s(`lighting.roughness`),s(`lighting.fresnel`),s(`lightposition.x`),s(`lightposition.y`),s(`lightposition.z`),r(e,t,o,s,{prefix:``,cLetter:`c`}),s(`text`),s(`hovertext`),s(`hovertemplate`),s(`hovertemplatefallback`),s(`uhoverformat`),s(`vhoverformat`),s(`whoverformat`),s(`xhoverformat`),s(`yhoverformat`),s(`zhoverformat`),t._length=null}}),gg=h((e,t)=>{var n=oh().gl_streamtube3d,r=n.createTubeMesh,i=$(),a=mh().parseColorScale,o=Yt().extractOpts,s=Jh(),c={xaxis:0,yaxis:1,zaxis:2};function l(e,t){this.scene=e,this.uid=t,this.mesh=null,this.data=null}var u=l.prototype;u.handlePick=function(e){var t=this.scene.fullSceneLayout,n=this.scene.dataScale;function r(e,r){var i=t[r],a=n[c[r]];return i.l2c(e)/a}if(e.object===this.mesh){var i=e.data.position,a=e.data.velocity;return e.traceCoordinate=[r(i[0],`xaxis`),r(i[1],`yaxis`),r(i[2],`zaxis`),r(a[0],`xaxis`),r(a[1],`yaxis`),r(a[2],`zaxis`),e.data.intensity*this.data._normMax,e.data.divergence],e.textLabel=this.data.hovertext||this.data.text,!0}};function d(e){var t=e.length,n;return n=t>2?e.slice(1,t-1):t===2?[(e[0]+e[1])/2]:e,n}function f(e){var t=e.length;return t===1?[.5,.5]:[e[1]-e[0],e[t-1]-e[t-2]]}function p(e,t){var r=e.fullSceneLayout,l=e.dataScale,u=t._len,p={};function m(e,t){var n=r[t],a=l[c[t]];return i.simpleMap(e,function(e){return n.d2l(e)*a})}if(p.vectors=s(m(t._u,`xaxis`),m(t._v,`yaxis`),m(t._w,`zaxis`),u),!u)return{positions:[],cells:[]};var h=m(t._Xs,`xaxis`),g=m(t._Ys,`yaxis`),_=m(t._Zs,`zaxis`);if(p.meshgrid=[h,g,_],p.gridFill=t._gridFill,t._slen)p.startingPositions=s(m(t._startsX,`xaxis`),m(t._startsY,`yaxis`),m(t._startsZ,`zaxis`));else{for(var v=g[0],y=d(h),b=d(_),x=Array(y.length*b.length),S=0,C=0;C<y.length;C++)for(var w=0;w<b.length;w++)x[S++]=[y[C],v,b[w]];p.startingPositions=x}p.colormap=a(t),p.tubeSize=t.sizeref,p.maxLength=t.maxdisplayed;var T=m(t._xbnds,`xaxis`),E=m(t._ybnds,`yaxis`),D=m(t._zbnds,`zaxis`),O=f(h),k=f(g),A=f(_),j=n(p,[[T[0]-O[0],E[0]-k[0],D[0]-A[0]],[T[1]+O[1],E[1]+k[1],D[1]+A[1]]]),M=o(t);j.vertexIntensityBounds=[M.min/t._normMax,M.max/t._normMax];var N=t.lightposition;return j.lightPosition=[N.x,N.y,N.z],j.ambient=t.lighting.ambient,j.diffuse=t.lighting.diffuse,j.specular=t.lighting.specular,j.roughness=t.lighting.roughness,j.fresnel=t.lighting.fresnel,j.opacity=t.opacity,t._pad=j.tubeScale*t.sizeref*2,j}u.update=function(e){this.data=e;var t=p(this.scene,e);this.mesh.update(t)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function m(e,t){var n=e.glplot.gl,i=r(n,p(e,t)),a=new l(e,t.uid);return a.mesh=i,a.data=t,i._trace=a,e.glplot.add(i),a}t.exports=m}),_g=h((e,t)=>{t.exports={moduleType:`trace`,name:`streamtube`,basePlotModule:Ph(),categories:[`gl3d`,`showLegend`],attributes:mg(),supplyDefaults:hg(),colorbar:{min:`cmin`,max:`cmax`},calc:Kh().calc,plot:gg(),eventData:function(e,t){return e.tubex=e.x,e.tubey=e.y,e.tubez=e.z,e.tubeu=t.traceCoordinate[3],e.tubev=t.traceCoordinate[4],e.tubew=t.traceCoordinate[5],e.norm=t.traceCoordinate[6],e.divergence=t.traceCoordinate[7],delete e.x,delete e.y,delete e.z,e},meta:{}}}),vg=h((e,t)=>{t.exports=_g()}),yg=h((e,t)=>{var{hovertemplateAttrs:n,texttemplateAttrs:r,templatefallbackAttrs:i}=ze(),a=wr(),o=Tr(),s=W(),c=Pt(),l=Le().dash,u=z().extendFlat,d=Ie().overrideAll,f=o.marker,p=o.line,m=f.line;["The library used by the *country names* `locationmode` option is changing in an upcoming version.",`Country names in existing plots may not work in the new version.`].join(` `),t.exports=d({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:u({},o.mode,{dflt:`markers`}),text:u({},o.text,{}),texttemplate:r({editType:`plot`},{keys:[`lat`,`lon`,`location`,`text`]}),texttemplatefallback:i({editType:`plot`}),hovertext:u({},o.hovertext,{}),textfont:o.textfont,textposition:o.textposition,line:{color:p.color,width:p.width,dash:l},connectgaps:o.connectgaps,marker:u({symbol:f.symbol,opacity:f.opacity,angle:f.angle,angleref:u({},f.angleref,{values:[`previous`,`up`,`north`]}),standoff:f.standoff,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode,colorbar:f.colorbar,line:u({width:m.width,dash:m.dash},c(`marker.line`)),gradient:f.gradient},c(`marker`)),fill:{valType:`enumerated`,values:[`none`,`toself`],dflt:`none`},fillcolor:a(),selected:o.selected,unselected:o.unselected,hoverinfo:u({},s.hoverinfo,{flags:[`lon`,`lat`,`location`,`text`,`name`]}),hovertemplate:n(),hovertemplatefallback:i()},`calc`,`nested`)}),bg=h((e,t)=>{var n=$(),r=Xt(),i=Yr(),a=Xr(),o=Qr(),s=$r(),c=yg(),l=["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(` `);t.exports=function(e,t,u,d){function f(r,i){return n.coerce(e,t,c,r,i)}var p=f(`locations`),m;if(p&&p.length){var h=f(`geojson`),g;(typeof h==`string`&&h!==``||n.isPlainObject(h))&&(g=`geojson-id`);var _=f(`locationmode`,g);_===`country names`&&n.warn(l),_===`geojson-id`&&f(`featureidkey`),m=p.length}else{var v=f(`lon`)||[],y=f(`lat`)||[];m=Math.min(v.length,y.length)}if(!m){t.visible=!1;return}t._length=m,f(`text`),f(`hovertext`),f(`hovertemplate`),f(`hovertemplatefallback`),f(`mode`),r.hasMarkers(t)&&i(e,t,u,d,f,{gradient:!0}),r.hasLines(t)&&(a(e,t,u,d,f),f(`connectgaps`)),r.hasText(t)&&(f(`texttemplate`),f(`texttemplatefallback`),o(e,t,d,f)),f(`fill`),t.fill!==`none`&&s(e,t,u,f),n.coerceSelectionMarkerOpacity(t,f)}}),xg=h((e,t)=>{var n=sn();t.exports=function(e,t,r){var i={},a=r[t.geo]._subplot.mockAxis,o=e.lonlat;return i.lonLabel=n.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=n.tickText(a,a.c2l(o[1]),!0).text,i}}),Sg=h((e,t)=>{var n=D(),r=O().BADNUM,i=ai(),a=oi(),o=si(),s=$().isArrayOrTypedArray,c=$()._;function l(e){return e&&typeof e==`string`}t.exports=function(e,t){for(var u=s(t.locations),d=u?t.locations.length:t._length,f=Array(d),p=t.geojson?function(e){return l(e)||n(e)}:l,m=0;m<d;m++){var h=f[m]={};if(u){var g=t.locations[m];h.loc=p(g)?g:null}else{var _=t.lon[m],v=t.lat[m];n(_)&&n(v)?h.lonlat=[+_,+v]:h.lonlat=[r,r]}}return a(f,t),i(e,t),o(f,t),d&&(f[0].t={labels:{lat:c(e,`lat:`)+` `,lon:c(e,`lon:`)+` `}}),f}}),Cg=h(e=>{e.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`},e.axesNames=[`lonaxis`,`lataxis`],e.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},e.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},e.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]}},e.clipPad=.001,e.precision=.1,e.landColor=`#F0DC82`,e.waterColor=`#3399FF`,e.locationmodeToLayer={"ISO-3":`countries`,"USA-states":`subunits`,"country names":`countries`},e.sphereSVG={type:`Sphere`},e.fillLayers={ocean:1,land:1,lakes:1},e.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},e.layers=[`bg`,`ocean`,`land`,`lakes`,`subunits`,`countries`,`coastlines`,`rivers`,`lataxis`,`lonaxis`,`frame`,`backplot`,`frontplot`],e.layersForChoropleth=[`bg`,`ocean`,`land`,`subunits`,`countries`,`coastlines`,`lataxis`,`lonaxis`,`frame`,`backplot`,`rivers`,`lakes`,`frontplot`],e.layerNameToAdjective={ocean:`ocean`,land:`land`,lakes:`lake`,subunits:`subunit`,countries:`country`,coastlines:`coastline`,rivers:`river`,frame:`frame`}}),wg=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):(n||=self,r(n.topojson=n.topojson||{}))})(e,function(e){function t(e){return e}function n(e){if(e==null)return t;var n,r,i=e.scale[0],a=e.scale[1],o=e.translate[0],s=e.translate[1];return function(e,t){t||(n=r=0);var c=2,l=e.length,u=Array(l);for(u[0]=(n+=e[0])*i+o,u[1]=(r+=e[1])*a+s;c<l;)u[c]=e[c],++c;return u}}function r(e){var t=n(e.transform),r,i=1/0,a=i,o=-i,s=-i;function c(e){e=t(e),e[0]<i&&(i=e[0]),e[0]>o&&(o=e[0]),e[1]<a&&(a=e[1]),e[1]>s&&(s=e[1])}function l(e){switch(e.type){case`GeometryCollection`:e.geometries.forEach(l);break;case`Point`:c(e.coordinates);break;case`MultiPoint`:e.coordinates.forEach(c);break}}for(r in e.arcs.forEach(function(e){for(var n=-1,r=e.length,c;++n<r;)c=t(e[n],n),c[0]<i&&(i=c[0]),c[0]>o&&(o=c[0]),c[1]<a&&(a=c[1]),c[1]>s&&(s=c[1])}),e.objects)l(e.objects[r]);return[i,a,o,s]}function i(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function a(e,t){return typeof t==`string`&&(t=e.objects[t]),t.type===`GeometryCollection`?{type:`FeatureCollection`,features:t.geometries.map(function(t){return o(e,t)})}:o(e,t)}function o(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,a=s(e,t);return n==null&&r==null?{type:`Feature`,properties:i,geometry:a}:r==null?{type:`Feature`,id:n,properties:i,geometry:a}:{type:`Feature`,id:n,bbox:r,properties:i,geometry:a}}function s(e,t){var r=n(e.transform),a=e.arcs;function o(e,t){t.length&&t.pop();for(var n=a[e<0?~e:e],o=0,s=n.length;o<s;++o)t.push(r(n[o],o));e<0&&i(t,s)}function s(e){return r(e)}function c(e){for(var t=[],n=0,r=e.length;n<r;++n)o(e[n],t);return t.length<2&&t.push(t[0]),t}function l(e){for(var t=c(e);t.length<4;)t.push(t[0]);return t}function u(e){return e.map(l)}function d(e){var t=e.type,n;switch(t){case`GeometryCollection`:return{type:t,geometries:e.geometries.map(d)};case`Point`:n=s(e.coordinates);break;case`MultiPoint`:n=e.coordinates.map(s);break;case`LineString`:n=c(e.arcs);break;case`MultiLineString`:n=e.arcs.map(c);break;case`Polygon`:n=u(e.arcs);break;case`MultiPolygon`:n=e.arcs.map(u);break;default:return null}return{type:t,coordinates:n}}return d(t)}function c(e,t){var n={},r={},i={},a=[],o=-1;t.forEach(function(n,r){var i=e.arcs[n<0?~n:n],a;i.length<3&&!i[1][0]&&!i[1][1]&&(a=t[++o],t[o]=n,t[r]=a)}),t.forEach(function(e){var t=s(e),n=t[0],a=t[1],o,c;if(o=i[n])if(delete i[o.end],o.push(e),o.end=a,c=r[a]){delete r[c.start];var l=c===o?o:o.concat(c);r[l.start=o.start]=i[l.end=c.end]=l}else r[o.start]=i[o.end]=o;else if(o=r[a])if(delete r[o.start],o.unshift(e),o.start=n,c=i[n]){delete i[c.end];var u=c===o?o:c.concat(o);r[u.start=c.start]=i[u.end=o.end]=u}else r[o.start]=i[o.end]=o;else o=[e],r[o.start=n]=i[o.end=a]=o});function s(t){var n=e.arcs[t<0?~t:t],r=n[0],i;return e.transform?(i=[0,0],n.forEach(function(e){i[0]+=e[0],i[1]+=e[1]})):i=n[n.length-1],t<0?[i,r]:[r,i]}function c(e,t){for(var r in e){var i=e[r];delete t[i.start],delete i.start,delete i.end,i.forEach(function(e){n[e<0?~e:e]=1}),a.push(i)}}return c(i,r),c(r,i),t.forEach(function(e){n[e<0?~e:e]||a.push([e])}),a}function l(e){return s(e,u.apply(this,arguments))}function u(e,t,n){var r,i,a;if(arguments.length>1)r=d(e,t,n);else for(i=0,r=Array(a=e.arcs.length);i<a;++i)r[i]=i;return{type:`MultiLineString`,arcs:c(e,r)}}function d(e,t,n){var r=[],i=[],a;function o(e){var t=e<0?~e:e;(i[t]||(i[t]=[])).push({i:e,g:a})}function s(e){e.forEach(o)}function c(e){e.forEach(s)}function l(e){e.forEach(c)}function u(e){switch(a=e,e.type){case`GeometryCollection`:e.geometries.forEach(u);break;case`LineString`:s(e.arcs);break;case`MultiLineString`:case`Polygon`:c(e.arcs);break;case`MultiPolygon`:l(e.arcs);break}}return u(t),i.forEach(n==null?function(e){r.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&r.push(e[0].i)}),r}function f(e){for(var t=-1,n=e.length,r,i=e[n-1],a=0;++t<n;)r=i,i=e[t],a+=r[0]*i[1]-r[1]*i[0];return Math.abs(a)}function p(e){return s(e,m.apply(this,arguments))}function m(e,t){var n={},r=[],i=[];t.forEach(a);function a(e){switch(e.type){case`GeometryCollection`:e.geometries.forEach(a);break;case`Polygon`:o(e.arcs);break;case`MultiPolygon`:e.arcs.forEach(o);break}}function o(e){e.forEach(function(t){t.forEach(function(t){(n[t=t<0?~t:t]||(n[t]=[])).push(e)})}),r.push(e)}function l(t){return f(s(e,{type:`Polygon`,arcs:[t]}).coordinates[0])}return r.forEach(function(e){if(!e._){var t=[],r=[e];for(e._=1,i.push(t);e=r.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){n[e<0?~e:e].forEach(function(e){e._||(e._=1,r.push(e))})})})}}),r.forEach(function(e){delete e._}),{type:`MultiPolygon`,arcs:i.map(function(t){var r=[],i;if(t.forEach(function(e){e.forEach(function(e){e.forEach(function(e){n[e<0?~e:e].length<2&&r.push(e)})})}),r=c(e,r),(i=r.length)>1)for(var a=1,o=l(r[0]),s,u;a<i;++a)(s=l(r[a]))>o&&(u=r[0],r[0]=r[a],r[a]=u,o=s);return r}).filter(function(e){return e.length>0})}}function h(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function g(e){var t={},n=e.map(function(){return[]});function r(e,n){e.forEach(function(e){e<0&&(e=~e);var r=t[e];r?r.push(n):t[e]=[n]})}function i(e,t){e.forEach(function(e){r(e,t)})}function a(e,t){e.type===`GeometryCollection`?e.geometries.forEach(function(e){a(e,t)}):e.type in o&&o[e.type](e.arcs,t)}var o={LineString:r,MultiLineString:i,Polygon:i,MultiPolygon:function(e,t){e.forEach(function(e){i(e,t)})}};for(var s in e.forEach(a),t)for(var c=t[s],l=c.length,u=0;u<l;++u)for(var d=u+1;d<l;++d){var f=c[u],p=c[d],m;(m=n[f])[s=h(m,p)]!==p&&m.splice(s,0,p),(m=n[p])[s=h(m,f)]!==f&&m.splice(s,0,f)}return n}function _(e){if(e==null)return t;var n,r,i=e.scale[0],a=e.scale[1],o=e.translate[0],s=e.translate[1];return function(e,t){t||(n=r=0);var c=2,l=e.length,u=Array(l),d=Math.round((e[0]-o)/i),f=Math.round((e[1]-s)/a);for(u[0]=d-n,n=d,u[1]=f-r,r=f;c<l;)u[c]=e[c],++c;return u}}function v(e,t){if(e.transform)throw Error(`already quantized`);if(!t||!t.scale){if(!((s=Math.floor(t))>=2))throw Error(`n must be ≥2`);l=e.bbox||r(e);var n=l[0],i=l[1],a=l[2],o=l[3],s;t={scale:[a-n?(a-n)/(s-1):1,o-i?(o-i)/(s-1):1],translate:[n,i]}}else l=e.bbox;var c=_(t),l,u,d=e.objects,f={};function p(e){return c(e)}function m(e){var t;switch(e.type){case`GeometryCollection`:t={type:`GeometryCollection`,geometries:e.geometries.map(m)};break;case`Point`:t={type:`Point`,coordinates:p(e.coordinates)};break;case`MultiPoint`:t={type:`MultiPoint`,coordinates:e.coordinates.map(p)};break;default:return e}return e.id!=null&&(t.id=e.id),e.bbox!=null&&(t.bbox=e.bbox),e.properties!=null&&(t.properties=e.properties),t}function h(e){var t=0,n=1,r=e.length,i,a=Array(r);for(a[0]=c(e[0],0);++t<r;)((i=c(e[t],t))[0]||i[1])&&(a[n++]=i);return n===1&&(a[n++]=[0,0]),a.length=n,a}for(u in d)f[u]=m(d[u]);return{type:`Topology`,bbox:l,transform:t,objects:f,arcs:e.arcs.map(h)}}e.bbox=r,e.feature=a,e.merge=p,e.mergeArcs=m,e.mesh=l,e.meshArcs=u,e.neighbors=g,e.quantize=v,e.transform=n,e.untransform=_,Object.defineProperty(e,`__esModule`,{value:!0})})}),Tg=h((e,t)=>{var n=t.exports={},r=Cg().locationmodeToLayer,i=wg().feature;n.getTopojsonName=function(e){return[e.scope.replace(/ /g,`-`),`_`,e.resolution.toString(),`m`].join(``)},n.getTopojsonPath=function(e,t){return e+=e.endsWith(`/`)?``:`/`,`${e}${t}.json`},n.getTopojsonFeatures=function(e,t){var n=r[e.locationmode],a=t.objects[n];return i(t,a).features}}),Eg=h(e=>{var t=O().BADNUM;e.calcTraceToLineCoords=function(e){for(var n=e[0].trace.connectgaps,r=[],i=[],a=0;a<e.length;a++){var o=e[a].lonlat;o[0]===t?!n&&i.length>0&&(r.push(i),i=[]):i.push(o)}return i.length>0&&r.push(i),r},e.makeLine=function(e){return e.length===1?{type:`LineString`,coordinates:e[0]}:{type:`MultiLineString`,coordinates:e}},e.makePolygon=function(e){if(e.length===1)return{type:`Polygon`,coordinates:e};for(var t=Array(e.length),n=0;n<e.length;n++)t[n]=[e[n]];return{type:`MultiPolygon`,coordinates:t}},e.makeBlank=function(){return{type:`Point`,coordinates:[]}}}),Dg=h((e,t)=>{t.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`}}),Og=h(e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=6371008.8,n={centimeters:t*100,centimetres:t*100,degrees:360/(2*Math.PI),feet:t*3.28084,inches:t*39.37,kilometers:t/1e3,kilometres:t/1e3,meters:t,metres:t,miles:t/1609.344,millimeters:t*1e3,millimetres:t*1e3,nauticalmiles:t/1852,radians:1,yards:t*1.0936},r={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:2.9155334959812285e-7,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(e,t,n={}){let r={type:`Feature`};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function a(e,t,n={}){switch(e){case`Point`:return o(t).geometry;case`LineString`:return u(t).geometry;case`Polygon`:return c(t).geometry;case`MultiPoint`:return m(t).geometry;case`MultiLineString`:return p(t).geometry;case`MultiPolygon`:return h(t).geometry;default:throw Error(e+` is invalid`)}}function o(e,t,n={}){if(!e)throw Error(`coordinates is required`);if(!Array.isArray(e))throw Error(`coordinates must be an Array`);if(e.length<2)throw Error(`coordinates must be at least 2 numbers long`);if(!D(e[0])||!D(e[1]))throw Error(`coordinates must contain numbers`);return i({type:`Point`,coordinates:e},t,n)}function s(e,t,n={}){return f(e.map(e=>o(e,t)),n)}function c(e,t,n={}){for(let t of e){if(t.length<4)throw Error(`Each LinearRing of a Polygon must have 4 or more Positions.`);if(t[t.length-1].length!==t[0].length)throw Error(`First and last Position are not equivalent.`);for(let e=0;e<t[t.length-1].length;e++)if(t[t.length-1][e]!==t[0][e])throw Error(`First and last Position are not equivalent.`)}return i({type:`Polygon`,coordinates:e},t,n)}function l(e,t,n={}){return f(e.map(e=>c(e,t)),n)}function u(e,t,n={}){if(e.length<2)throw Error(`coordinates must be an array of two or more positions`);return i({type:`LineString`,coordinates:e},t,n)}function d(e,t,n={}){return f(e.map(e=>u(e,t)),n)}function f(e,t={}){let n={type:`FeatureCollection`};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}function p(e,t,n={}){return i({type:`MultiLineString`,coordinates:e},t,n)}function m(e,t,n={}){return i({type:`MultiPoint`,coordinates:e},t,n)}function h(e,t,n={}){return i({type:`MultiPolygon`,coordinates:e},t,n)}function g(e,t,n={}){return i({type:`GeometryCollection`,geometries:e},t,n)}function _(e,t=0){if(t&&!(t>=0))throw Error(`precision must be a positive number`);let n=10**(t||0);return Math.round(e*n)/n}function v(e,t=`kilometers`){let r=n[t];if(!r)throw Error(t+` units is invalid`);return e*r}function y(e,t=`kilometers`){let r=n[t];if(!r)throw Error(t+` units is invalid`);return e/r}function b(e,t){return C(y(e,t))}function x(e){let t=e%360;return t<0&&(t+=360),t}function S(e){return e%=360,e>180?e-360:e<-180?e+360:e}function C(e){return e%(2*Math.PI)*180/Math.PI}function w(e){return e%360*Math.PI/180}function T(e,t=`kilometers`,n=`kilometers`){if(!(e>=0))throw Error(`length must be a positive number`);return v(y(e,t),n)}function E(e,t=`meters`,n=`kilometers`){if(!(e>=0))throw Error(`area must be a positive number`);let i=r[t];if(!i)throw Error(`invalid original units`);let a=r[n];if(!a)throw Error(`invalid final units`);return e/i*a}function D(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function O(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function k(e){if(!e)throw Error(`bbox is required`);if(!Array.isArray(e))throw Error(`bbox must be an Array`);if(e.length!==4&&e.length!==6)throw Error(`bbox must be an Array of 4 or 6 numbers`);e.forEach(e=>{if(!D(e))throw Error(`bbox must only contain numbers`)})}function A(e){if(!e)throw Error(`id is required`);if([`string`,`number`].indexOf(typeof e)===-1)throw Error(`id must be a number or a string`)}e.areaFactors=r,e.azimuthToBearing=S,e.bearingToAzimuth=x,e.convertArea=E,e.convertLength=T,e.degreesToRadians=w,e.earthRadius=t,e.factors=n,e.feature=i,e.featureCollection=f,e.geometry=a,e.geometryCollection=g,e.isNumber=D,e.isObject=O,e.lengthToDegrees=b,e.lengthToRadians=y,e.lineString=u,e.lineStrings=d,e.multiLineString=p,e.multiPoint=m,e.multiPolygon=h,e.point=o,e.points=s,e.polygon=c,e.polygons=l,e.radiansToDegrees=C,e.radiansToLength=v,e.round=_,e.validateBBox=k,e.validateId=A}),kg=h(e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Og();function n(e,t,r){if(e!==null)for(var i,a,o,s,c,l,u,d=0,f=0,p,m=e.type,h=m===`FeatureCollection`,g=m===`Feature`,_=h?e.features.length:1,v=0;v<_;v++){u=h?e.features[v].geometry:g?e.geometry:e,p=u?u.type===`GeometryCollection`:!1,c=p?u.geometries.length:1;for(var y=0;y<c;y++){var b=0,x=0;if(s=p?u.geometries[y]:u,s!==null){l=s.coordinates;var S=s.type;switch(d=r&&(S===`Polygon`||S===`MultiPolygon`)?1:0,S){case null:break;case`Point`:if(t(l,f,v,b,x)===!1)return!1;f++,b++;break;case`LineString`:case`MultiPoint`:for(i=0;i<l.length;i++){if(t(l[i],f,v,b,x)===!1)return!1;f++,S===`MultiPoint`&&b++}S===`LineString`&&b++;break;case`Polygon`:case`MultiLineString`:for(i=0;i<l.length;i++){for(a=0;a<l[i].length-d;a++){if(t(l[i][a],f,v,b,x)===!1)return!1;f++}S===`MultiLineString`&&b++,S===`Polygon`&&x++}S===`Polygon`&&b++;break;case`MultiPolygon`:for(i=0;i<l.length;i++){for(x=0,a=0;a<l[i].length;a++){for(o=0;o<l[i][a].length-d;o++){if(t(l[i][a][o],f,v,b,x)===!1)return!1;f++}x++}b++}break;case`GeometryCollection`:for(i=0;i<s.geometries.length;i++)if(n(s.geometries[i],t,r)===!1)return!1;break;default:throw Error(`Unknown Geometry Type`)}}}}}function r(e,t,r,i){var a=r;return n(e,function(e,n,i,o,s){a=n===0&&r===void 0?e:t(a,e,n,i,o,s)},i),a}function i(e,t){var n;switch(e.type){case`FeatureCollection`:for(n=0;n<e.features.length&&t(e.features[n].properties,n)!==!1;n++);break;case`Feature`:t(e.properties,0);break}}function a(e,t,n){var r=n;return i(e,function(e,i){r=i===0&&n===void 0?e:t(r,e,i)}),r}function o(e,t){if(e.type===`Feature`)t(e,0);else if(e.type===`FeatureCollection`)for(var n=0;n<e.features.length&&t(e.features[n],n)!==!1;n++);}function s(e,t,n){var r=n;return o(e,function(e,i){r=i===0&&n===void 0?e:t(r,e,i)}),r}function c(e){var t=[];return n(e,function(e){t.push(e)}),t}function l(e,t){var n,r,i,a,o,s,c,l,u,d,f=0,p=e.type===`FeatureCollection`,m=e.type===`Feature`,h=p?e.features.length:1;for(n=0;n<h;n++){for(s=p?e.features[n].geometry:m?e.geometry:e,l=p?e.features[n].properties:m?e.properties:{},u=p?e.features[n].bbox:m?e.bbox:void 0,d=p?e.features[n].id:m?e.id:void 0,c=s?s.type===`GeometryCollection`:!1,o=c?s.geometries.length:1,i=0;i<o;i++){if(a=c?s.geometries[i]:s,a===null){if(t(null,f,l,u,d)===!1)return!1;continue}switch(a.type){case`Point`:case`LineString`:case`MultiPoint`:case`Polygon`:case`MultiLineString`:case`MultiPolygon`:if(t(a,f,l,u,d)===!1)return!1;break;case`GeometryCollection`:for(r=0;r<a.geometries.length;r++)if(t(a.geometries[r],f,l,u,d)===!1)return!1;break;default:throw Error(`Unknown Geometry Type`)}}f++}}function u(e,t,n){var r=n;return l(e,function(e,i,a,o,s){r=i===0&&n===void 0?e:t(r,e,i,a,o,s)}),r}function d(e,n){l(e,function(e,r,i,a,o){var s=e===null?null:e.type;switch(s){case null:case`Point`:case`LineString`:case`Polygon`:return n(t.feature.call(void 0,e,i,{bbox:a,id:o}),r,0)===!1?!1:void 0}var c;switch(s){case`MultiPoint`:c=`Point`;break;case`MultiLineString`:c=`LineString`;break;case`MultiPolygon`:c=`Polygon`;break}for(var l=0;l<e.coordinates.length;l++){var u=e.coordinates[l],d={type:c,coordinates:u};if(n(t.feature.call(void 0,d,i),r,l)===!1)return!1}})}function f(e,t,n){var r=n;return d(e,function(e,i,a){r=i===0&&a===0&&n===void 0?e:t(r,e,i,a)}),r}function p(e,r){d(e,function(e,i,a){var o=0;if(e.geometry){var s=e.geometry.type;if(!(s===`Point`||s===`MultiPoint`)){var c,l=0,u=0,d=0;if(n(e,function(n,s,f,p,m){if(c===void 0||i>l||p>u||m>d){c=n,l=i,u=p,d=m,o=0;return}if(r(t.lineString.call(void 0,[c,n],e.properties),i,a,m,o)===!1)return!1;o++,c=n})===!1)return!1}}})}function m(e,t,n){var r=n,i=!1;return p(e,function(e,a,o,s,c){r=i===!1&&n===void 0?e:t(r,e,a,o,s,c),i=!0}),r}function h(e,n){if(!e)throw Error(`geojson is required`);d(e,function(e,r,i){if(e.geometry!==null){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case`LineString`:if(n(e,r,i,0,0)===!1)return!1;break;case`Polygon`:for(var s=0;s<o.length;s++)if(n(t.lineString.call(void 0,o[s],e.properties),r,i,s)===!1)return!1;break}}})}function g(e,t,n){var r=n;return h(e,function(e,i,a,o){r=i===0&&n===void 0?e:t(r,e,i,a,o)}),r}function _(e,n){if(n||={},!t.isObject.call(void 0,n))throw Error(`options is invalid`);var r=n.featureIndex||0,i=n.multiFeatureIndex||0,a=n.geometryIndex||0,o=n.segmentIndex||0,s=n.properties,c;switch(e.type){case`FeatureCollection`:r<0&&(r=e.features.length+r),s||=e.features[r].properties,c=e.features[r].geometry;break;case`Feature`:s||=e.properties,c=e.geometry;break;case`Point`:case`MultiPoint`:return null;case`LineString`:case`Polygon`:case`MultiLineString`:case`MultiPolygon`:c=e;break;default:throw Error(`geojson is invalid`)}if(c===null)return null;var l=c.coordinates;switch(c.type){case`Point`:case`MultiPoint`:return null;case`LineString`:return o<0&&(o=l.length+o-1),t.lineString.call(void 0,[l[o],l[o+1]],s,n);case`Polygon`:return a<0&&(a=l.length+a),o<0&&(o=l[a].length+o-1),t.lineString.call(void 0,[l[a][o],l[a][o+1]],s,n);case`MultiLineString`:return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o-1),t.lineString.call(void 0,[l[i][o],l[i][o+1]],s,n);case`MultiPolygon`:return i<0&&(i=l.length+i),a<0&&(a=l[i].length+a),o<0&&(o=l[i][a].length-o-1),t.lineString.call(void 0,[l[i][a][o],l[i][a][o+1]],s,n)}throw Error(`geojson is invalid`)}function v(e,n){if(n||={},!t.isObject.call(void 0,n))throw Error(`options is invalid`);var r=n.featureIndex||0,i=n.multiFeatureIndex||0,a=n.geometryIndex||0,o=n.coordIndex||0,s=n.properties,c;switch(e.type){case`FeatureCollection`:r<0&&(r=e.features.length+r),s||=e.features[r].properties,c=e.features[r].geometry;break;case`Feature`:s||=e.properties,c=e.geometry;break;case`Point`:case`MultiPoint`:return null;case`LineString`:case`Polygon`:case`MultiLineString`:case`MultiPolygon`:c=e;break;default:throw Error(`geojson is invalid`)}if(c===null)return null;var l=c.coordinates;switch(c.type){case`Point`:return t.point.call(void 0,l,s,n);case`MultiPoint`:return i<0&&(i=l.length+i),t.point.call(void 0,l[i],s,n);case`LineString`:return o<0&&(o=l.length+o),t.point.call(void 0,l[o],s,n);case`Polygon`:return a<0&&(a=l.length+a),o<0&&(o=l[a].length+o),t.point.call(void 0,l[a][o],s,n);case`MultiLineString`:return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),t.point.call(void 0,l[i][o],s,n);case`MultiPolygon`:return i<0&&(i=l.length+i),a<0&&(a=l[i].length+a),o<0&&(o=l[i][a].length-o),t.point.call(void 0,l[i][a][o],s,n)}throw Error(`geojson is invalid`)}e.coordAll=c,e.coordEach=n,e.coordReduce=r,e.featureEach=o,e.featureReduce=s,e.findPoint=v,e.findSegment=_,e.flattenEach=d,e.flattenReduce=f,e.geomEach=l,e.geomReduce=u,e.lineEach=h,e.lineReduce=g,e.propEach=i,e.propReduce=a,e.segmentEach=p,e.segmentReduce=m}),Ag=h(e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Og(),n=kg();function r(e){return n.geomReduce.call(void 0,e,(e,t)=>e+i(t),0)}function i(e){let t=0,n;switch(e.type){case`Polygon`:return a(e.coordinates);case`MultiPolygon`:for(n=0;n<e.coordinates.length;n++)t+=a(e.coordinates[n]);return t;case`Point`:case`MultiPoint`:case`LineString`:case`MultiLineString`:return 0}return 0}function a(e){let t=0;if(e&&e.length>0){t+=Math.abs(c(e[0]));for(let n=1;n<e.length;n++)t-=Math.abs(c(e[n]))}return t}var o=t.earthRadius*t.earthRadius/2,s=Math.PI/180;function c(e){let t=e.length-1;if(t<=2)return 0;let n=0,r=0;for(;r<t;){let i=e[r],a=e[r+1===t?0:r+1],o=e[r+2>=t?(r+2)%t:r+2],c=i[0]*s,l=a[1]*s,u=o[0]*s;n+=(u-c)*Math.sin(l),r++}return n*o}var l=r;e.area=r,e.default=l}),jg=h(e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Og(),n=kg();function r(e,r={}){let i=0,a=0,o=0;return n.coordEach.call(void 0,e,function(e){i+=e[0],a+=e[1],o++},!0),t.point.call(void 0,[i/o,a/o],r.properties)}var i=r;e.centroid=r,e.default=i}),Mg=h(e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=kg();function n(e,n={}){if(e.bbox!=null&&n.recompute!==!0)return e.bbox;let r=[1/0,1/0,-1/0,-1/0];return t.coordEach.call(void 0,e,e=>{r[0]>e[0]&&(r[0]=e[0]),r[1]>e[1]&&(r[1]=e[1]),r[2]<e[0]&&(r[2]=e[0]),r[3]<e[1]&&(r[3]=e[1])}),r}var r=n;e.bbox=n,e.default=r}),Ng=h((e,t)=>{var n={alabama:`AL`,alaska:`AK`,arizona:`AZ`,arkansas:`AR`,california:`CA`,colorado:`CO`,connecticut:`CT`,delaware:`DE`,"district of columbia":`DC`,florida:`FL`,georgia:`GA`,hawaii:`HI`,idaho:`ID`,illinois:`IL`,indiana:`IN`,iowa:`IA`,kansas:`KS`,kentucky:`KY`,louisiana:`LA`,maine:`ME`,maryland:`MD`,massachusetts:`MA`,michigan:`MI`,minnesota:`MN`,mississippi:`MS`,missouri:`MO`,montana:`MT`,nebraska:`NE`,nevada:`NV`,"new hampshire":`NH`,"new jersey":`NJ`,"new mexico":`NM`,"new york":`NY`,"north carolina":`NC`,"north dakota":`ND`,ohio:`OH`,oklahoma:`OK`,oregon:`OR`,pennsylvania:`PA`,"rhode island":`RI`,"south carolina":`SC`,"south dakota":`SD`,tennessee:`TN`,texas:`TX`,utah:`UT`,vermont:`VT`,virginia:`VA`,washington:`WA`,"washington dc":`DC`,"washington d.c.":`DC`,"west virginia":`WV`,wisconsin:`WI`,wyoming:`WY`};t.exports={usaLocationAbbreviations:new Set(Object.values(n)),usaLocationList:n}}),Pg=h((e,t)=>{var n=S(),r=Dg(),{area:i}=Ag(),{centroid:a}=jg(),{bbox:o}=Mg(),s=Je(),c=ee(),l=A(),u=M(),d=_r(),{usaLocationAbbreviations:f,usaLocationList:p}=Ng(),m=Object.keys(r),h={"ISO-3":s,"USA-states":_,"country names":g};function g(e){for(var t=0;t<m.length;t++){var n=m[t];if(new RegExp(r[n]).test(e.trim().toLowerCase()))return n}return c.log(`Unrecognized country name: `+e+`.`),!1}function _(e){return e=e.trim(),(f.has(e.toUpperCase())?e.toUpperCase():p[e.toLowerCase()])||(c.log(`Unrecognized US location: `+e+`.`),!1)}function v(e,t,n){if(!t||typeof t!=`string`)return!1;let r=h[e](t);if(r){let t;if(e===`USA-states`){t=[];for(let e of n)e?.properties?.gu===`USA`&&t.push(e)}else t=n;for(let e of t)if(e.id===r)return e;c.log(`Location with id ${r} does not have a matching topojson feature at this resolution.`)}return!1}function y(e){var t=e.geometry,n=t.coordinates,r=e.id,i=[],a,o,s,c;function l(e){for(var t=0;t<e.length-1;t++)if(e[t][0]>0&&e[t+1][0]<0)return t;return null}switch(a=r===`RUS`||r===`FJI`?function(e){var t;if(l(e)===null)t=e;else for(t=Array(e.length),c=0;c<e.length;c++)t[c]=[e[c][0]<0?e[c][0]+360:e[c][0],e[c][1]];i.push(d.tester(t))}:r===`ATA`?function(e){var t=l(e);if(t===null)return i.push(d.tester(e));var n=Array(e.length+1),r=0;for(c=0;c<e.length;c++)c>t?n[r++]=[e[c][0]+360,e[c][1]]:c===t?(n[r++]=e[c],n[r++]=[e[c][0],-90]):n[r++]=e[c];var a=d.tester(n);a.pts.pop(),i.push(a)}:function(e){i.push(d.tester(e))},t.type){case`MultiPolygon`:for(o=0;o<n.length;o++)for(s=0;s<n[o].length;s++)a(n[o][s]);break;case`Polygon`:for(o=0;o<n.length;o++)a(n[o]);break}return i}function b(e){var t=e.geojson,n=window.PlotlyGeoAssets||{},r=typeof t==`string`?n[t]:t;return l(r)?r:(c.error(`Oops ... something went wrong when fetching `+t),!1)}function x(e){var t=e[0].trace,n=b(t);if(!n)return!1;var r={},i=[],a;for(a=0;a<t._length;a++){var o=e[a];(o.loc||o.loc===0)&&(r[o.loc]=o)}function s(e){var n=u(e,t.featureidkey||`id`).get(),a=r[n];if(a){var o=e.geometry;if(o.type===`Polygon`||o.type===`MultiPolygon`){var s={type:`Feature`,id:n,geometry:o,properties:{}};s.geometry.coordinates.length>0?s.properties.ct=C(s):s.properties.ct=[NaN,NaN],a.fIn=e,a.fOut=s,i.push(s)}else c.log([`Location`,a.loc,`does not have a valid GeoJSON geometry.`,`Traces with locationmode *geojson-id* only support`,`*Polygon* and *MultiPolygon* geometries.`].join(` `))}delete r[n]}switch(n.type){case`FeatureCollection`:var l=n.features;for(a=0;a<l.length;a++)s(l[a]);break;case`Feature`:s(n);break;default:return c.warn([`Invalid GeoJSON type`,(n.type||`none`)+`.`,`Traces with locationmode *geojson-id* only support`,`*FeatureCollection* and *Feature* types.`].join(` `)),!1}for(var d in r)c.log([`Location *`+d+`*`,`does not have a matching feature with id-key`,`*`+t.featureidkey+`*.`].join(` `));return i}function C(e){var t=e.geometry,n;if(t.type===`MultiPolygon`)for(var r=t.coordinates,o=0,s=0;s<r.length;s++){var c={type:`Polygon`,coordinates:r[s]},l=i(c);l>o&&(o=l,n=c)}else n=t;return a(n).geometry.coordinates}function w(e){var t=window.PlotlyGeoAssets||{},r=[];function i(e){return new Promise(function(r,i){n.json(e,function(n,a){if(n){delete t[e];var o=n.status===404?`GeoJSON at URL "`+e+`" does not exist.`:`Unexpected error while fetching from `+e;return i(Error(o))}return t[e]=a,r(a)})})}function a(e){return new Promise(function(n,r){var i=0,a=setInterval(function(){if(t[e]&&t[e]!==`pending`)return clearInterval(a),n(t[e]);if(i>100)return clearInterval(a),r(`Unexpected error while fetching from `+e);i++},50)})}for(var o=0;o<e.length;o++){var s=e[o][0].trace.geojson;typeof s==`string`&&(t[s]?t[s]===`pending`&&r.push(a(s)):(t[s]=`pending`,r.push(i(s))))}return r}function T(e){return o(e)}t.exports={locationToFeature:v,feature2polygons:y,getTraceGeojson:b,extractTraceFeature:x,fetchTraceGeoData:w,computeBbox:T}}),Fg=h((e,t)=>{var n=S(),r=tn(),i=q(),a=vi(),o=a.stylePoints,s=a.styleText;t.exports=function(e,t){t&&c(e,t)};function c(e,t){var a=t[0].trace,c=t[0].node3;c.style(`opacity`,t[0].trace.opacity),o(c,a,e),s(c,a,e),c.selectAll(`path.js-line`).style(`fill`,`none`).each(function(e){var t=n.select(this),a=e.trace,o=a.line||{};t.call(i.stroke,o.color).call(r.dashLine,o.dash||``,o.width||0),a.fill!==`none`&&t.call(i.fill,a.fillcolor)})}}),Ig=h((e,t)=>{var n=S(),r=$(),i=Tg().getTopojsonFeatures,a=Eg(),o=Pg(),s=on().findExtremes,c=O().BADNUM,l=ci().calcMarkerSize,u=Xt(),d=Fg();function f(e,t,i){var o=t.layers.frontplot.select(`.scatterlayer`),s=r.makeTraceGroups(o,i,`trace scattergeo`);function l(e,t){e.lonlat[0]===c&&n.select(t).remove()}s.selectAll(`*`).remove(),s.each(function(t){var i=n.select(this),o=t[0].trace;if(u.hasLines(o)||o.fill!==`none`){var s=a.calcTraceToLineCoords(t),c=o.fill===`none`?a.makeLine(s):a.makePolygon(s);i.selectAll(`path.js-line`).data([{geojson:c,trace:o}]).enter().append(`path`).classed(`js-line`,!0).style(`stroke-miterlimit`,2)}u.hasMarkers(o)&&i.selectAll(`path.point`).data(r.identity).enter().append(`path`).classed(`point`,!0).each(function(e){l(e,this)}),u.hasText(o)&&i.selectAll(`g`).data(r.identity).enter().append(`g`).append(`text`).each(function(e){l(e,this)}),d(e,t)})}function p(e,t){var n=e[0].trace,a=t[n.geo],u=a._subplot,d=n._length,f,p;if(r.isArrayOrTypedArray(n.locations)){var m=n.locationmode,h=m===`geojson-id`?o.extractTraceFeature(e):i(n,u.topojson);for(f=0;f<d;f++){p=e[f];var g=m===`geojson-id`?p.fOut:o.locationToFeature(m,p.loc,h);p.lonlat=g?g.properties.ct:[c,c]}}var _={padded:!0},v,y;if(a.fitbounds===`geojson`&&n.locationmode===`geojson-id`){var b=o.computeBbox(o.getTraceGeojson(n));v=[b[0],b[2]],y=[b[1],b[3]]}else{for(v=Array(d),y=Array(d),f=0;f<d;f++)p=e[f],v[f]=p.lonlat[0],y[f]=p.lonlat[1];_.ppad=l(n,d)}n._extremes.lon=s(a.lonaxis._ax,v,_),n._extremes.lat=s(a.lataxis._ax,y,_)}t.exports={calcGeoJSON:p,plot:f}}),Lg=h((e,t)=>{var n=Ln(),r=O().BADNUM,i=yi(),a=$().fillText,o=yg();t.exports=function(e,t,a){var o=e.cd,c=o[0].trace,l=e.xa,u=e.ya,d=e.subplot,f=d.projection.isLonLatOverEdges,p=d.project;function m(e){var n=e.lonlat;if(n[0]===r||f(n))return 1/0;var i=p(n),o=p([t,a]),s=Math.abs(i[0]-o[0]),c=Math.abs(i[1]-o[1]),l=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(s*s+c*c)-l,1-3/l)}if(n.getClosest(o,m,e),e.index!==!1){var h=o[e.index],g=h.lonlat,_=[l.c2p(g),u.c2p(g)],v=h.mrc||1;e.x0=_[0]-v,e.x1=_[0]+v,e.y0=_[1]-v,e.y1=_[1]+v,e.loc=h.loc,e.lon=g[0],e.lat=g[1];var y={};y[c.geo]={_subplot:d};var b=c._module.formatLabels(h,c,y);return e.lonLabel=b.lonLabel,e.latLabel=b.latLabel,e.color=i(c,h),e.extraText=s(c,h,e,o[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}};function s(e,t,n,r){if(e.hovertemplate)return;var i=t.hi||e.hoverinfo,s=i===`all`?o.hoverinfo.flags:i.split(`+`),c=s.indexOf(`location`)!==-1&&Array.isArray(e.locations),l=s.indexOf(`lon`)!==-1,u=s.indexOf(`lat`)!==-1,d=s.indexOf(`text`)!==-1,f=[];function p(e){return e+`°`}return c?f.push(t.loc):l&&u?f.push(`(`+p(n.latLabel)+`, `+p(n.lonLabel)+`)`):l?f.push(r.lon+p(n.lonLabel)):u&&f.push(r.lat+p(n.latLabel)),d&&a(t,e,f),f.join(`<br>`)}}),Rg=h((e,t)=>{t.exports=function(e,t,n,r,i){e.lon=t.lon,e.lat=t.lat,e.location=t.loc?t.loc:null;var a=r[i];return a.fIn&&a.fIn.properties&&(e.properties=a.fIn.properties),e}}),zg=h((e,t)=>{var n=Xt(),r=O().BADNUM;t.exports=function(e,t){var i=e.cd,a=e.xaxis,o=e.yaxis,s=[],c=i[0].trace,l,u,d,f,p;if(!n.hasMarkers(c)&&!n.hasText(c))return[];if(t===!1)for(p=0;p<i.length;p++)i[p].selected=0;else for(p=0;p<i.length;p++)l=i[p],u=l.lonlat,u[0]!==r&&(d=a.c2p(u),f=o.c2p(u),t.contains([d,f],null,p,e)?(s.push({pointNumber:p,lon:u[0],lat:u[1]}),l.selected=1):l.selected=0);return s}}),Bg=h((e,t)=>{(function(n,r){r(typeof e==`object`&&t!==void 0?e:n.d3=n.d3||{})})(e,function(e){function t(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function n(e){return e.length===1&&(e=r(e)),{left:function(t,n,r,i){for(r??=0,i??=t.length;r<i;){var a=r+i>>>1;e(t[a],n)<0?r=a+1:i=a}return r},right:function(t,n,r,i){for(r??=0,i??=t.length;r<i;){var a=r+i>>>1;e(t[a],n)>0?i=a:r=a+1}return r}}}function r(e){return function(n,r){return t(e(n),r)}}var i=n(t),a=i.right,o=i.left;function s(e,t){t??=c;for(var n=0,r=e.length-1,i=e[0],a=Array(r<0?0:r);n<r;)a[n]=t(i,i=e[++n]);return a}function c(e,t){return[e,t]}function l(e,t,n){var r=e.length,i=t.length,a=Array(r*i),o,s,l,u;for(n??=c,o=l=0;o<r;++o)for(u=e[o],s=0;s<i;++s,++l)a[l]=n(u,t[s]);return a}function u(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function d(e){return e===null?NaN:+e}function f(e,t){var n=e.length,r=0,i=-1,a=0,o,s,c=0;if(t==null)for(;++i<n;)isNaN(o=d(e[i]))||(s=o-a,a+=s/++r,c+=s*(o-a));else for(;++i<n;)isNaN(o=d(t(e[i],i,e)))||(s=o-a,a+=s/++r,c+=s*(o-a));if(r>1)return c/(r-1)}function p(e,t){var n=f(e,t);return n&&Math.sqrt(n)}function m(e,t){var n=e.length,r=-1,i,a,o;if(t==null){for(;++r<n;)if((i=e[r])!=null&&i>=i)for(a=o=i;++r<n;)(i=e[r])!=null&&(a>i&&(a=i),o<i&&(o=i))}else for(;++r<n;)if((i=t(e[r],r,e))!=null&&i>=i)for(a=o=i;++r<n;)(i=t(e[r],r,e))!=null&&(a>i&&(a=i),o<i&&(o=i));return[a,o]}var h=Array.prototype,g=h.slice,_=h.map;function v(e){return function(){return e}}function y(e){return e}function b(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}var x=Math.sqrt(50),S=Math.sqrt(10),C=Math.sqrt(2);function w(e,t,n){var r,i=-1,a,o,s;if(t=+t,e=+e,n=+n,e===t&&n>0)return[e];if((r=t<e)&&(a=e,e=t,t=a),(s=T(e,t,n))===0||!isFinite(s))return[];if(s>0)for(e=Math.ceil(e/s),t=Math.floor(t/s),o=Array(a=Math.ceil(t-e+1));++i<a;)o[i]=(e+i)*s;else for(e=Math.floor(e*s),t=Math.ceil(t*s),o=Array(a=Math.ceil(e-t+1));++i<a;)o[i]=(e-i)/s;return r&&o.reverse(),o}function T(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/10**i;return i>=0?(a>=x?10:a>=S?5:a>=C?2:1)*10**i:-(10**-i)/(a>=x?10:a>=S?5:a>=C?2:1)}function E(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=10**Math.floor(Math.log(r)/Math.LN10),a=r/i;return a>=x?i*=10:a>=S?i*=5:a>=C&&(i*=2),t<e?-i:i}function D(e){return Math.ceil(Math.log(e.length)/Math.LN2)+1}function O(){var e=y,t=m,n=D;function r(r){var i,o=r.length,s,c=Array(o);for(i=0;i<o;++i)c[i]=e(r[i],i,r);var l=t(c),u=l[0],d=l[1],f=n(c,u,d);Array.isArray(f)||(f=E(u,d,f),f=b(Math.ceil(u/f)*f,d,f));for(var p=f.length;f[0]<=u;)f.shift(),--p;for(;f[p-1]>d;)f.pop(),--p;var m=Array(p+1),h;for(i=0;i<=p;++i)h=m[i]=[],h.x0=i>0?f[i-1]:u,h.x1=i<p?f[i]:d;for(i=0;i<o;++i)s=c[i],u<=s&&s<=d&&m[a(f,s,0,p)].push(r[i]);return m}return r.value=function(t){return arguments.length?(e=typeof t==`function`?t:v(t),r):e},r.domain=function(e){return arguments.length?(t=typeof e==`function`?e:v([e[0],e[1]]),r):t},r.thresholds=function(e){return arguments.length?(n=typeof e==`function`?e:v(Array.isArray(e)?g.call(e):e),r):n},r}function k(e,t,n){if(n??=d,r=e.length){if((t=+t)<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function A(e,n,r){return e=_.call(e,d).sort(t),Math.ceil((r-n)/(2*(k(e,.75)-k(e,.25))*e.length**(-1/3)))}function j(e,t,n){return Math.ceil((n-t)/(3.5*p(e)*e.length**(-1/3)))}function M(e,t){var n=e.length,r=-1,i,a;if(t==null){for(;++r<n;)if((i=e[r])!=null&&i>=i)for(a=i;++r<n;)(i=e[r])!=null&&i>a&&(a=i)}else for(;++r<n;)if((i=t(e[r],r,e))!=null&&i>=i)for(a=i;++r<n;)(i=t(e[r],r,e))!=null&&i>a&&(a=i);return a}function N(e,t){var n=e.length,r=n,i=-1,a,o=0;if(t==null)for(;++i<n;)isNaN(a=d(e[i]))?--r:o+=a;else for(;++i<n;)isNaN(a=d(t(e[i],i,e)))?--r:o+=a;if(r)return o/r}function P(e,n){var r=e.length,i=-1,a,o=[];if(n==null)for(;++i<r;)isNaN(a=d(e[i]))||o.push(a);else for(;++i<r;)isNaN(a=d(n(e[i],i,e)))||o.push(a);return k(o.sort(t),.5)}function F(e){for(var t=e.length,n,r=-1,i=0,a,o;++r<t;)i+=e[r].length;for(a=Array(i);--t>=0;)for(o=e[t],n=o.length;--n>=0;)a[--i]=o[n];return a}function I(e,t){var n=e.length,r=-1,i,a;if(t==null){for(;++r<n;)if((i=e[r])!=null&&i>=i)for(a=i;++r<n;)(i=e[r])!=null&&a>i&&(a=i)}else for(;++r<n;)if((i=t(e[r],r,e))!=null&&i>=i)for(a=i;++r<n;)(i=t(e[r],r,e))!=null&&a>i&&(a=i);return a}function L(e,t){for(var n=t.length,r=Array(n);n--;)r[n]=e[t[n]];return r}function R(e,n){if(r=e.length){var r,i=0,a=0,o,s=e[a];for(n??=t;++i<r;)(n(o=e[i],s)<0||n(s,s)!==0)&&(s=o,a=i);if(n(s,s)===0)return a}}function z(e,t,n){for(var r=(n??e.length)-(t=t==null?0:+t),i,a;r;)a=Math.random()*r--|0,i=e[r+t],e[r+t]=e[a+t],e[a+t]=i;return e}function B(e,t){var n=e.length,r=-1,i,a=0;if(t==null)for(;++r<n;)(i=+e[r])&&(a+=i);else for(;++r<n;)(i=+t(e[r],r,e))&&(a+=i);return a}function V(e){if(!(a=e.length))return[];for(var t=-1,n=I(e,H),r=Array(n);++t<n;)for(var i=-1,a,o=r[t]=Array(a);++i<a;)o[i]=e[i][t];return r}function H(e){return e.length}function U(){return V(arguments)}e.bisect=a,e.bisectRight=a,e.bisectLeft=o,e.ascending=t,e.bisector=n,e.cross=l,e.descending=u,e.deviation=p,e.extent=m,e.histogram=O,e.thresholdFreedmanDiaconis=A,e.thresholdScott=j,e.thresholdSturges=D,e.max=M,e.mean=N,e.median=P,e.merge=F,e.min=I,e.pairs=s,e.permute=L,e.quantile=k,e.range=b,e.scan=R,e.shuffle=z,e.sum=B,e.ticks=w,e.tickIncrement=T,e.tickStep=E,e.transpose=V,e.variance=f,e.zip=U,Object.defineProperty(e,`__esModule`,{value:!0})})}),Vg=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e,Bg()):(n||=self,r(n.d3=n.d3||{},n.d3))})(e,function(e,t){function n(){return new r}function r(){this.reset()}r.prototype={constructor:r,reset:function(){this.s=this.t=0},add:function(e){a(i,e,this.t),a(this,i.s,this.s),this.s?this.t+=i.t:this.s=i.t},valueOf:function(){return this.s}};var i=new r;function a(e,t,n){var r=e.s=t+n,i=r-t;e.t=t-(r-i)+(n-i)}var o=1e-6,s=1e-12,c=Math.PI,l=c/2,u=c/4,d=c*2,f=180/c,p=c/180,m=Math.abs,h=Math.atan,g=Math.atan2,_=Math.cos,v=Math.ceil,y=Math.exp,b=Math.log,x=Math.pow,S=Math.sin,C=Math.sign||function(e){return e>0?1:e<0?-1:0},w=Math.sqrt,T=Math.tan;function E(e){return e>1?0:e<-1?c:Math.acos(e)}function D(e){return e>1?l:e<-1?-l:Math.asin(e)}function O(e){return(e=S(e/2))*e}function k(){}function A(e,t){e&&M.hasOwnProperty(e.type)&&M[e.type](e,t)}var j={Feature:function(e,t){A(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)A(n[r].geometry,t)}},M={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){N(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)N(n[r],t,0)},Polygon:function(e,t){P(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)P(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)A(n[r],t)}};function N(e,t,n){var r=-1,i=e.length-n,a;for(t.lineStart();++r<i;)a=e[r],t.point(a[0],a[1],a[2]);t.lineEnd()}function P(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)N(e[n],t,1);t.polygonEnd()}function F(e,t){e&&j.hasOwnProperty(e.type)?j[e.type](e,t):A(e,t)}var I=n(),L=n(),R,z,B,V,H,U={point:k,lineStart:k,lineEnd:k,polygonStart:function(){I.reset(),U.lineStart=W,U.lineEnd=G},polygonEnd:function(){var e=+I;L.add(e<0?d+e:e),this.lineStart=this.lineEnd=this.point=k},sphere:function(){L.add(d)}};function W(){U.point=K}function G(){q(R,z)}function K(e,t){U.point=q,R=e,z=t,e*=p,t*=p,B=e,V=_(t=t/2+u),H=S(t)}function q(e,t){e*=p,t*=p,t=t/2+u;var n=e-B,r=n>=0?1:-1,i=r*n,a=_(t),o=S(t),s=H*o,c=V*a+s*_(i),l=s*r*S(i);I.add(g(l,c)),B=e,V=a,H=o}function J(e){return L.reset(),F(e,U),L*2}function Y(e){return[g(e[1],e[0]),D(e[2])]}function X(e){var t=e[0],n=e[1],r=_(n);return[r*_(t),r*S(t),S(n)]}function Z(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Q(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function ee(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function te(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function ne(e){var t=w(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var re,ie,ae,oe,se,ce,le,ue,de=n(),fe,pe,me={point:he,lineStart:_e,lineEnd:ve,polygonStart:function(){me.point=ye,me.lineStart=be,me.lineEnd=xe,de.reset(),U.polygonStart()},polygonEnd:function(){U.polygonEnd(),me.point=he,me.lineStart=_e,me.lineEnd=ve,I<0?(re=-(ae=180),ie=-(oe=90)):de>o?oe=90:de<-o&&(ie=-90),pe[0]=re,pe[1]=ae},sphere:function(){re=-(ae=180),ie=-(oe=90)}};function he(e,t){fe.push(pe=[re=e,ae=e]),t<ie&&(ie=t),t>oe&&(oe=t)}function ge(e,t){var n=X([e*p,t*p]);if(ue){var r=Q(ue,n),i=Q([r[1],-r[0],0],r);ne(i),i=Y(i);var a=e-se,o=a>0?1:-1,s=i[0]*f*o,c,l=m(a)>180;l^(o*se<s&&s<o*e)?(c=i[1]*f,c>oe&&(oe=c)):(s=(s+360)%360-180,l^(o*se<s&&s<o*e)?(c=-i[1]*f,c<ie&&(ie=c)):(t<ie&&(ie=t),t>oe&&(oe=t))),l?e<se?Se(re,e)>Se(re,ae)&&(ae=e):Se(e,ae)>Se(re,ae)&&(re=e):ae>=re?(e<re&&(re=e),e>ae&&(ae=e)):e>se?Se(re,e)>Se(re,ae)&&(ae=e):Se(e,ae)>Se(re,ae)&&(re=e)}else fe.push(pe=[re=e,ae=e]);t<ie&&(ie=t),t>oe&&(oe=t),ue=n,se=e}function _e(){me.point=ge}function ve(){pe[0]=re,pe[1]=ae,me.point=he,ue=null}function ye(e,t){if(ue){var n=e-se;de.add(m(n)>180?n+(n>0?360:-360):n)}else ce=e,le=t;U.point(e,t),ge(e,t)}function be(){U.lineStart()}function xe(){ye(ce,le),U.lineEnd(),m(de)>o&&(re=-(ae=180)),pe[0]=re,pe[1]=ae,ue=null}function Se(e,t){return(t-=e)<0?t+360:t}function Ce(e,t){return e[0]-t[0]}function we(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function Te(e){var t,n,r,i,a,o,s;if(oe=ae=-(re=ie=1/0),fe=[],F(e,me),n=fe.length){for(fe.sort(Ce),t=1,r=fe[0],a=[r];t<n;++t)i=fe[t],we(r,i[0])||we(r,i[1])?(Se(r[0],i[1])>Se(r[0],r[1])&&(r[1]=i[1]),Se(i[0],r[1])>Se(r[0],r[1])&&(r[0]=i[0])):a.push(r=i);for(o=-1/0,n=a.length-1,t=0,r=a[n];t<=n;r=i,++t)i=a[t],(s=Se(r[1],i[0]))>o&&(o=s,re=i[0],ae=r[1])}return fe=pe=null,re===1/0||ie===1/0?[[NaN,NaN],[NaN,NaN]]:[[re,ie],[ae,oe]]}var Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He={sphere:k,point:Ue,lineStart:Ge,lineEnd:Je,polygonStart:function(){He.lineStart=Ye,He.lineEnd=Xe},polygonEnd:function(){He.lineStart=Ge,He.lineEnd=Je}};function Ue(e,t){e*=p,t*=p;var n=_(t);We(n*_(e),n*S(e),S(t))}function We(e,t,n){++Ee,Oe+=(e-Oe)/Ee,ke+=(t-ke)/Ee,Ae+=(n-Ae)/Ee}function Ge(){He.point=Ke}function Ke(e,t){e*=p,t*=p;var n=_(t);ze=n*_(e),Be=n*S(e),Ve=S(t),He.point=qe,We(ze,Be,Ve)}function qe(e,t){e*=p,t*=p;var n=_(t),r=n*_(e),i=n*S(e),a=S(t),o=g(w((o=Be*a-Ve*i)*o+(o=Ve*r-ze*a)*o+(o=ze*i-Be*r)*o),ze*r+Be*i+Ve*a);De+=o,je+=o*(ze+(ze=r)),Me+=o*(Be+(Be=i)),Ne+=o*(Ve+(Ve=a)),We(ze,Be,Ve)}function Je(){He.point=Ue}function Ye(){He.point=Ze}function Xe(){Qe(Le,Re),He.point=Ue}function Ze(e,t){Le=e,Re=t,e*=p,t*=p,He.point=Qe;var n=_(t);ze=n*_(e),Be=n*S(e),Ve=S(t),We(ze,Be,Ve)}function Qe(e,t){e*=p,t*=p;var n=_(t),r=n*_(e),i=n*S(e),a=S(t),o=Be*a-Ve*i,s=Ve*r-ze*a,c=ze*i-Be*r,l=w(o*o+s*s+c*c),u=D(l),d=l&&-u/l;Pe+=d*o,Fe+=d*s,Ie+=d*c,De+=u,je+=u*(ze+(ze=r)),Me+=u*(Be+(Be=i)),Ne+=u*(Ve+(Ve=a)),We(ze,Be,Ve)}function $e(e){Ee=De=Oe=ke=Ae=je=Me=Ne=Pe=Fe=Ie=0,F(e,He);var t=Pe,n=Fe,r=Ie,i=t*t+n*n+r*r;return i<s&&(t=je,n=Me,r=Ne,De<o&&(t=Oe,n=ke,r=Ae),i=t*t+n*n+r*r,i<s)?[NaN,NaN]:[g(n,t)*f,D(r/w(i))*f]}function et(e){return function(){return e}}function tt(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return n=t.invert(n,r),n&&e.invert(n[0],n[1])}),n}function nt(e,t){return[m(e)>c?e+Math.round(-e/d)*d:e,t]}nt.invert=nt;function rt(e,t,n){return(e%=d)?t||n?tt(at(e),ot(t,n)):at(e):t||n?ot(t,n):nt}function it(e){return function(t,n){return t+=e,[t>c?t-d:t<-c?t+d:t,n]}}function at(e){var t=it(e);return t.invert=it(-e),t}function ot(e,t){var n=_(e),r=S(e),i=_(t),a=S(t);function o(e,t){var o=_(t),s=_(e)*o,c=S(e)*o,l=S(t),u=l*n+s*r;return[g(c*i-u*a,s*n-l*r),D(u*i+c*a)]}return o.invert=function(e,t){var o=_(t),s=_(e)*o,c=S(e)*o,l=S(t),u=l*i-c*a;return[g(c*i+l*a,s*n+u*r),D(u*n-s*r)]},o}function st(e){e=rt(e[0]*p,e[1]*p,e.length>2?e[2]*p:0);function t(t){return t=e(t[0]*p,t[1]*p),t[0]*=f,t[1]*=f,t}return t.invert=function(t){return t=e.invert(t[0]*p,t[1]*p),t[0]*=f,t[1]*=f,t},t}function ct(e,t,n,r,i,a){if(n){var o=_(t),s=S(t),c=r*n;i==null?(i=t+r*d,a=t-c/2):(i=lt(o,i),a=lt(o,a),(r>0?i<a:i>a)&&(i+=r*d));for(var l,u=i;r>0?u>a:u<a;u-=c)l=Y([o,-s*_(u),-s*S(u)]),e.point(l[0],l[1])}}function lt(e,t){t=X(t),t[0]-=e,ne(t);var n=E(-t[1]);return((-t[2]<0?-n:n)+d-o)%d}function ut(){var e=et([0,0]),t=et(90),n=et(6),r,i,a={point:o};function o(e,t){r.push(e=i(e,t)),e[0]*=f,e[1]*=f}function s(){var o=e.apply(this,arguments),s=t.apply(this,arguments)*p,c=n.apply(this,arguments)*p;return r=[],i=rt(-o[0]*p,-o[1]*p,0).invert,ct(a,s,c,1),o={type:`Polygon`,coordinates:[r]},r=i=null,o}return s.center=function(t){return arguments.length?(e=typeof t==`function`?t:et([+t[0],+t[1]]),s):e},s.radius=function(e){return arguments.length?(t=typeof e==`function`?e:et(+e),s):t},s.precision=function(e){return arguments.length?(n=typeof e==`function`?e:et(+e),s):n},s}function $(){var e=[],t;return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:k,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function dt(e,t){return m(e[0]-t[0])<o&&m(e[1]-t[1])<o}function ft(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function pt(e,t,n,r,i){var a=[],s=[],c,l;if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n=e[0],r=e[t],l;if(dt(n,r)){if(!n[2]&&!r[2]){for(i.lineStart(),c=0;c<t;++c)i.point((n=e[c])[0],n[1]);i.lineEnd();return}r[0]+=2*o}a.push(l=new ft(n,e,null,!0)),s.push(l.o=new ft(n,null,l,!1)),a.push(l=new ft(r,e,null,!1)),s.push(l.o=new ft(r,null,l,!0))}}),a.length){for(s.sort(t),mt(a),mt(s),c=0,l=s.length;c<l;++c)s[c].e=n=!n;for(var u=a[0],d,f;;){for(var p=u,m=!0;p.v;)if((p=p.n)===u)return;d=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(m)for(c=0,l=d.length;c<l;++c)i.point((f=d[c])[0],f[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(m)for(d=p.p.z,c=d.length-1;c>=0;--c)i.point((f=d[c])[0],f[1]);else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,d=p.z,m=!m}while(!p.v);i.lineEnd()}}}function mt(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}var ht=n();function gt(e){return m(e[0])<=c?e[0]:C(e[0])*((m(e[0])+c)%d-c)}function _t(e,t){var n=gt(t),r=t[1],i=S(r),a=[S(n),-_(n),0],s=0,f=0;ht.reset(),i===1?r=l+o:i===-1&&(r=-l-o);for(var p=0,m=e.length;p<m;++p)if(v=(h=e[p]).length)for(var h,v,y=h[v-1],b=gt(y),x=y[1]/2+u,C=S(x),w=_(x),T=0;T<v;++T,b=O,C=A,w=j,y=E){var E=h[T],O=gt(E),k=E[1]/2+u,A=S(k),j=_(k),M=O-b,N=M>=0?1:-1,P=N*M,F=P>c,I=C*A;if(ht.add(g(I*N*S(P),w*j+I*_(P))),s+=F?M+N*d:M,F^b>=n^O>=n){var L=Q(X(y),X(E));ne(L);var R=Q(a,L);ne(R);var z=(F^M>=0?-1:1)*D(R[2]);(r>z||r===z&&(L[0]||L[1]))&&(f+=F^M>=0?1:-1)}}return(s<-o||s<o&&ht<-o)^f&1}function vt(e,n,r,i){return function(a){var o=n(a),s=$(),c=n(s),l=!1,u,d,f,p={point:m,lineStart:g,lineEnd:_,polygonStart:function(){p.point=v,p.lineStart=y,p.lineEnd=b,d=[],u=[]},polygonEnd:function(){p.point=m,p.lineStart=g,p.lineEnd=_,d=t.merge(d);var e=_t(u,i);d.length?(l||=(a.polygonStart(),!0),pt(d,bt,e,r,a)):e&&(l||=(a.polygonStart(),!0),a.lineStart(),r(null,null,1,a),a.lineEnd()),l&&=(a.polygonEnd(),!1),d=u=null},sphere:function(){a.polygonStart(),a.lineStart(),r(null,null,1,a),a.lineEnd(),a.polygonEnd()}};function m(t,n){e(t,n)&&a.point(t,n)}function h(e,t){o.point(e,t)}function g(){p.point=h,o.lineStart()}function _(){p.point=m,o.lineEnd()}function v(e,t){f.push([e,t]),c.point(e,t)}function y(){c.lineStart(),f=[]}function b(){v(f[0][0],f[0][1]),c.lineEnd();var e=c.clean(),t=s.result(),n,r=t.length,i,o,p;if(f.pop(),u.push(f),f=null,r){if(e&1){if(o=t[0],(i=o.length-1)>0){for(l||=(a.polygonStart(),!0),a.lineStart(),n=0;n<i;++n)a.point((p=o[n])[0],p[1]);a.lineEnd()}return}r>1&&e&2&&t.push(t.pop().concat(t.shift())),d.push(t.filter(yt))}}return p}}function yt(e){return e.length>1}function bt(e,t){return((e=e.x)[0]<0?e[1]-l-o:l-e[1])-((t=t.x)[0]<0?t[1]-l-o:l-t[1])}var xt=vt(function(){return!0},St,wt,[-c,-l]);function St(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(a,s){var u=a>0?c:-c,d=m(a-t);m(d-c)<o?(e.point(t,n=(n+s)/2>0?l:-l),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(u,n),e.point(a,n),i=0):r!==u&&d>=c&&(m(t-r)<o&&(t-=r*o),m(a-u)<o&&(a-=u*o),n=Ct(t,n,a,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(u,n),i=0),e.point(t=a,n=s),r=u},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function Ct(e,t,n,r){var i,a,s=S(e-n);return m(s)>o?h((S(t)*(a=_(r))*S(n)-S(r)*(i=_(t))*S(e))/(i*a*s)):(t+r)/2}function wt(e,t,n,r){var i;if(e==null)i=n*l,r.point(-c,i),r.point(0,i),r.point(c,i),r.point(c,0),r.point(c,-i),r.point(0,-i),r.point(-c,-i),r.point(-c,0),r.point(-c,i);else if(m(e[0]-t[0])>o){var a=e[0]<t[0]?c:-c;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(t[0],t[1])}function Tt(e){var t=_(e),n=6*p,r=t>0,i=m(t)>o;function a(t,r,i,a){ct(a,e,n,i,t,r)}function s(e,n){return _(e)*_(n)>t}function l(e){var t,n,a,o,l;return{lineStart:function(){o=a=!1,l=1},point:function(f,p){var m=[f,p],h,g=s(f,p),_=r?g?0:d(f,p):g?d(f+(f<0?c:-c),p):0;if(!t&&(o=a=g)&&e.lineStart(),g!==a&&(h=u(t,m),(!h||dt(t,h)||dt(m,h))&&(m[2]=1)),g!==a)l=0,g?(e.lineStart(),h=u(m,t),e.point(h[0],h[1])):(h=u(t,m),e.point(h[0],h[1],2),e.lineEnd()),t=h;else if(i&&t&&r^g){var v;!(_&n)&&(v=u(m,t,!0))&&(l=0,r?(e.lineStart(),e.point(v[0][0],v[0][1]),e.point(v[1][0],v[1][1]),e.lineEnd()):(e.point(v[1][0],v[1][1]),e.lineEnd(),e.lineStart(),e.point(v[0][0],v[0][1],3)))}g&&(!t||!dt(t,m))&&e.point(m[0],m[1]),t=m,a=g,n=_},lineEnd:function(){a&&e.lineEnd(),t=null},clean:function(){return l|(o&&a)<<1}}}function u(e,n,r){var i=X(e),a=X(n),s=[1,0,0],l=Q(i,a),u=Z(l,l),d=l[0],f=u-d*d;if(!f)return!r&&e;var p=t*u/f,h=-t*d/f,g=Q(s,l),_=te(s,p);ee(_,te(l,h));var v=g,y=Z(_,v),b=Z(v,v),x=y*y-b*(Z(_,_)-1);if(!(x<0)){var S=w(x),C=te(v,(-y-S)/b);if(ee(C,_),C=Y(C),!r)return C;var T=e[0],E=n[0],D=e[1],O=n[1],k;E<T&&(k=T,T=E,E=k);var A=E-T,j=m(A-c)<o,M=j||A<o;if(!j&&O<D&&(k=D,D=O,O=k),M?j?D+O>0^C[1]<(m(C[0]-T)<o?D:O):D<=C[1]&&C[1]<=O:A>c^(T<=C[0]&&C[0]<=E)){var N=te(v,(-y+S)/b);return ee(N,_),[C,Y(N)]}}}function d(t,n){var i=r?e:c-e,a=0;return t<-i?a|=1:t>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return vt(s,l,a,r?[0,-e]:[-c,e-c])}function Et(e,t,n,r,i,a){var o=e[0],s=e[1],c=t[0],l=t[1],u=0,d=1,f=c-o,p=l-s,m;if(m=n-o,!(!f&&m>0)){if(m/=f,f<0){if(m<u)return;m<d&&(d=m)}else if(f>0){if(m>d)return;m>u&&(u=m)}if(m=i-o,!(!f&&m<0)){if(m/=f,f<0){if(m>d)return;m>u&&(u=m)}else if(f>0){if(m<u)return;m<d&&(d=m)}if(m=r-s,!(!p&&m>0)){if(m/=p,p<0){if(m<u)return;m<d&&(d=m)}else if(p>0){if(m>d)return;m>u&&(u=m)}if(m=a-s,!(!p&&m<0)){if(m/=p,p<0){if(m>d)return;m>u&&(u=m)}else if(p>0){if(m<u)return;m<d&&(d=m)}return u>0&&(e[0]=o+u*f,e[1]=s+u*p),d<1&&(t[0]=o+d*f,t[1]=s+d*p),!0}}}}}var Dt=1e9,Ot=-Dt;function kt(e,n,r,i){function a(t,a){return e<=t&&t<=r&&n<=a&&a<=i}function s(t,a,o,s){var l=0,d=0;if(t==null||(l=c(t,o))!==(d=c(a,o))||u(t,a)<0^o>0)do s.point(l===0||l===3?e:r,l>1?i:n);while((l=(l+o+4)%4)!==d);else s.point(a[0],a[1])}function c(t,i){return m(t[0]-e)<o?i>0?0:3:m(t[0]-r)<o?i>0?2:1:m(t[1]-n)<o?i>0?1:0:i>0?3:2}function l(e,t){return u(e.x,t.x)}function u(e,t){var n=c(e,1),r=c(t,1);return n===r?n===0?t[1]-e[1]:n===1?e[0]-t[0]:n===2?e[1]-t[1]:t[0]-e[0]:n-r}return function(o){var c=o,u=$(),d,f,p,m,h,g,_,v,y,b,x,S={point:C,lineStart:D,lineEnd:O,polygonStart:T,polygonEnd:E};function C(e,t){a(e,t)&&c.point(e,t)}function w(){for(var t=0,n=0,r=f.length;n<r;++n)for(var a=f[n],o=1,s=a.length,c=a[0],l,u,d=c[0],p=c[1];o<s;++o)l=d,u=p,c=a[o],d=c[0],p=c[1],u<=i?p>i&&(d-l)*(i-u)>(p-u)*(e-l)&&++t:p<=i&&(d-l)*(i-u)<(p-u)*(e-l)&&--t;return t}function T(){c=u,d=[],f=[],x=!0}function E(){var e=w(),n=x&&e,r=(d=t.merge(d)).length;(n||r)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),r&&pt(d,l,e,s,o),o.polygonEnd()),c=o,d=f=p=null}function D(){S.point=k,f&&f.push(p=[]),b=!0,y=!1,_=v=NaN}function O(){d&&(k(m,h),g&&y&&u.rejoin(),d.push(u.result())),S.point=C,y&&c.lineEnd()}function k(t,o){var s=a(t,o);if(f&&p.push([t,o]),b)m=t,h=o,g=s,b=!1,s&&(c.lineStart(),c.point(t,o));else if(s&&y)c.point(t,o);else{var l=[_=Math.max(Ot,Math.min(Dt,_)),v=Math.max(Ot,Math.min(Dt,v))],u=[t=Math.max(Ot,Math.min(Dt,t)),o=Math.max(Ot,Math.min(Dt,o))];Et(l,u,e,n,r,i)?(y||(c.lineStart(),c.point(l[0],l[1])),c.point(u[0],u[1]),s||c.lineEnd(),x=!1):s&&(c.lineStart(),c.point(t,o),x=!1)}_=t,v=o,y=s}return S}}function At(){var e=0,t=0,n=960,r=500,i,a,o;return o={stream:function(o){return i&&a===o?i:i=kt(e,t,n,r)(a=o)},extent:function(s){return arguments.length?(e=+s[0][0],t=+s[0][1],n=+s[1][0],r=+s[1][1],i=a=null,o):[[e,t],[n,r]]}}}var jt=n(),Mt,Nt,Pt,Ft={sphere:k,point:k,lineStart:It,lineEnd:k,polygonStart:k,polygonEnd:k};function It(){Ft.point=Rt,Ft.lineEnd=Lt}function Lt(){Ft.point=Ft.lineEnd=k}function Rt(e,t){e*=p,t*=p,Mt=e,Nt=S(t),Pt=_(t),Ft.point=zt}function zt(e,t){e*=p,t*=p;var n=S(t),r=_(t),i=m(e-Mt),a=_(i),o=r*S(i),s=Pt*n-Nt*r*a,c=Nt*n+Pt*r*a;jt.add(g(w(o*o+s*s),c)),Mt=e,Nt=n,Pt=r}function Bt(e){return jt.reset(),F(e,Ft),+jt}var Vt=[null,null],Ht={type:`LineString`,coordinates:Vt};function Ut(e,t){return Vt[0]=e,Vt[1]=t,Bt(Ht)}var Wt={Feature:function(e,t){return Kt(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(Kt(n[r].geometry,t))return!0;return!1}},Gt={Sphere:function(){return!0},Point:function(e,t){return qt(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(qt(n[r],t))return!0;return!1},LineString:function(e,t){return Jt(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(Jt(n[r],t))return!0;return!1},Polygon:function(e,t){return Yt(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(Yt(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(Kt(n[r],t))return!0;return!1}};function Kt(e,t){return e&&Gt.hasOwnProperty(e.type)?Gt[e.type](e,t):!1}function qt(e,t){return Ut(e,t)===0}function Jt(e,t){for(var n,r,i,a=0,o=e.length;a<o;a++){if(r=Ut(e[a],t),r===0||a>0&&(i=Ut(e[a],e[a-1]),i>0&&n<=i&&r<=i&&(n+r-i)*(1-((n-r)/i)**2)<s*i))return!0;n=r}return!1}function Yt(e,t){return!!_t(e.map(Xt),Zt(t))}function Xt(e){return e=e.map(Zt),e.pop(),e}function Zt(e){return[e[0]*p,e[1]*p]}function Qt(e,t){return(e&&Wt.hasOwnProperty(e.type)?Wt[e.type]:Kt)(e,t)}function $t(e,n,r){var i=t.range(e,n-o,r).concat(n);return function(e){return i.map(function(t){return[e,t]})}}function en(e,n,r){var i=t.range(e,n-o,r).concat(n);return function(e){return i.map(function(t){return[t,e]})}}function tn(){var e,n,r,i,a,s,c,l,u=10,d=u,f=90,p=360,h,g,_,y,b=2.5;function x(){return{type:`MultiLineString`,coordinates:S()}}function S(){return t.range(v(i/f)*f,r,f).map(_).concat(t.range(v(l/p)*p,c,p).map(y)).concat(t.range(v(n/u)*u,e,u).filter(function(e){return m(e%f)>o}).map(h)).concat(t.range(v(s/d)*d,a,d).filter(function(e){return m(e%p)>o}).map(g))}return x.lines=function(){return S().map(function(e){return{type:`LineString`,coordinates:e}})},x.outline=function(){return{type:`Polygon`,coordinates:[_(i).concat(y(c).slice(1),_(r).reverse().slice(1),y(l).reverse().slice(1))]}},x.extent=function(e){return arguments.length?x.extentMajor(e).extentMinor(e):x.extentMinor()},x.extentMajor=function(e){return arguments.length?(i=+e[0][0],r=+e[1][0],l=+e[0][1],c=+e[1][1],i>r&&(e=i,i=r,r=e),l>c&&(e=l,l=c,c=e),x.precision(b)):[[i,l],[r,c]]},x.extentMinor=function(t){return arguments.length?(n=+t[0][0],e=+t[1][0],s=+t[0][1],a=+t[1][1],n>e&&(t=n,n=e,e=t),s>a&&(t=s,s=a,a=t),x.precision(b)):[[n,s],[e,a]]},x.step=function(e){return arguments.length?x.stepMajor(e).stepMinor(e):x.stepMinor()},x.stepMajor=function(e){return arguments.length?(f=+e[0],p=+e[1],x):[f,p]},x.stepMinor=function(e){return arguments.length?(u=+e[0],d=+e[1],x):[u,d]},x.precision=function(t){return arguments.length?(b=+t,h=$t(s,a,90),g=en(n,e,b),_=$t(l,c,90),y=en(i,r,b),x):b},x.extentMajor([[-180,-90+o],[180,90-o]]).extentMinor([[-180,-80-o],[180,80+o]])}function nn(){return tn()()}function rn(e,t){var n=e[0]*p,r=e[1]*p,i=t[0]*p,a=t[1]*p,o=_(r),s=S(r),c=_(a),l=S(a),u=o*_(n),d=o*S(n),m=c*_(i),h=c*S(i),v=2*D(w(O(a-r)+o*c*O(i-n))),y=S(v),b=v?function(e){var t=S(e*=v)/y,n=S(v-e)/y,r=n*u+t*m,i=n*d+t*h,a=n*s+t*l;return[g(i,r)*f,g(a,w(r*r+i*i))*f]}:function(){return[n*f,r*f]};return b.distance=v,b}function an(e){return e}var on=n(),sn=n(),cn,ln,un,dn,fn={point:k,lineStart:k,lineEnd:k,polygonStart:function(){fn.lineStart=pn,fn.lineEnd=gn},polygonEnd:function(){fn.lineStart=fn.lineEnd=fn.point=k,on.add(m(sn)),sn.reset()},result:function(){var e=on/2;return on.reset(),e}};function pn(){fn.point=mn}function mn(e,t){fn.point=hn,cn=un=e,ln=dn=t}function hn(e,t){sn.add(dn*e-un*t),un=e,dn=t}function gn(){hn(cn,ln)}var _n=1/0,vn=_n,yn=-_n,bn=yn,xn={point:Sn,lineStart:k,lineEnd:k,polygonStart:k,polygonEnd:k,result:function(){var e=[[_n,vn],[yn,bn]];return yn=bn=-(vn=_n=1/0),e}};function Sn(e,t){e<_n&&(_n=e),e>yn&&(yn=e),t<vn&&(vn=t),t>bn&&(bn=t)}var Cn=0,wn=0,Tn=0,En=0,Dn=0,On=0,kn=0,An=0,jn=0,Mn,Nn,Pn,Fn,In={point:Ln,lineStart:Rn,lineEnd:Vn,polygonStart:function(){In.lineStart=Hn,In.lineEnd=Un},polygonEnd:function(){In.point=Ln,In.lineStart=Rn,In.lineEnd=Vn},result:function(){var e=jn?[kn/jn,An/jn]:On?[En/On,Dn/On]:Tn?[Cn/Tn,wn/Tn]:[NaN,NaN];return Cn=wn=Tn=En=Dn=On=kn=An=jn=0,e}};function Ln(e,t){Cn+=e,wn+=t,++Tn}function Rn(){In.point=zn}function zn(e,t){In.point=Bn,Ln(Pn=e,Fn=t)}function Bn(e,t){var n=e-Pn,r=t-Fn,i=w(n*n+r*r);En+=i*(Pn+e)/2,Dn+=i*(Fn+t)/2,On+=i,Ln(Pn=e,Fn=t)}function Vn(){In.point=Ln}function Hn(){In.point=Wn}function Un(){Gn(Mn,Nn)}function Wn(e,t){In.point=Gn,Ln(Mn=Pn=e,Nn=Fn=t)}function Gn(e,t){var n=e-Pn,r=t-Fn,i=w(n*n+r*r);En+=i*(Pn+e)/2,Dn+=i*(Fn+t)/2,On+=i,i=Fn*e-Pn*t,kn+=i*(Pn+e),An+=i*(Fn+t),jn+=i*3,Ln(Pn=e,Fn=t)}function Kn(e){this._context=e}Kn.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,d);break}},result:k};var qn=n(),Jn,Yn,Xn,Zn,Qn,$n={point:k,lineStart:function(){$n.point=er},lineEnd:function(){Jn&&tr(Yn,Xn),$n.point=k},polygonStart:function(){Jn=!0},polygonEnd:function(){Jn=null},result:function(){var e=+qn;return qn.reset(),e}};function er(e,t){$n.point=tr,Yn=Zn=e,Xn=Qn=t}function tr(e,t){Zn-=e,Qn-=t,qn.add(w(Zn*Zn+Qn*Qn)),Zn=e,Qn=t}function nr(){this._string=[]}nr.prototype={_radius:4.5,_circle:rr(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,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(e,t){switch(this._point){case 0:this._string.push(`M`,e,`,`,t),this._point=1;break;case 1:this._string.push(`L`,e,`,`,t);break;default:this._circle??=rr(this._radius),this._string.push(`M`,e,`,`,t,this._circle);break}},result:function(){if(this._string.length){var e=this._string.join(``);return this._string=[],e}else return null}};function rr(e){return`m0,`+e+`a`+e+`,`+e+` 0 1,1 0,`+-2*e+`a`+e+`,`+e+` 0 1,1 0,`+2*e+`z`}function ir(e,t){var n=4.5,r,i;function a(e){return e&&(typeof n==`function`&&i.pointRadius(+n.apply(this,arguments)),F(e,r(i))),i.result()}return a.area=function(e){return F(e,r(fn)),fn.result()},a.measure=function(e){return F(e,r($n)),$n.result()},a.bounds=function(e){return F(e,r(xn)),xn.result()},a.centroid=function(e){return F(e,r(In)),In.result()},a.projection=function(t){return arguments.length?(r=t==null?(e=null,an):(e=t).stream,a):e},a.context=function(e){return arguments.length?(i=e==null?(t=null,new nr):new Kn(t=e),typeof n!=`function`&&i.pointRadius(n),a):t},a.pointRadius=function(e){return arguments.length?(n=typeof e==`function`?e:(i.pointRadius(+e),+e),a):n},a.projection(e).context(t)}function ar(e){return{stream:or(e)}}function or(e){return function(t){var n=new sr;for(var r in e)n[r]=e[r];return n.stream=t,n}}function sr(){}sr.prototype={constructor:sr,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function cr(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),F(n,e.stream(xn)),t(xn.result()),r!=null&&e.clipExtent(r),e}function lr(e,t,n){return cr(e,function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+t[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-a*(n[1][1]+n[0][1]))/2;e.scale(150*a).translate([o,s])},n)}function ur(e,t,n){return lr(e,[[0,0],t],n)}function dr(e,t,n){return cr(e,function(n){var r=+t,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];e.scale(150*i).translate([a,o])},n)}function fr(e,t,n){return cr(e,function(n){var r=+t,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([a,o])},n)}var pr=16,mr=_(30*p);function hr(e,t){return+t?_r(e,t):gr(e)}function gr(e){return or({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function _r(e,t){function n(r,i,a,s,c,l,u,d,f,p,h,_,v,y){var b=u-r,x=d-i,S=b*b+x*x;if(S>4*t&&v--){var C=s+p,T=c+h,E=l+_,O=w(C*C+T*T+E*E),k=D(E/=O),A=m(m(E)-1)<o||m(a-f)<o?(a+f)/2:g(T,C),j=e(A,k),M=j[0],N=j[1],P=M-r,F=N-i,I=x*P-b*F;(I*I/S>t||m((b*P+x*F)/S-.5)>.3||s*p+c*h+l*_<mr)&&(n(r,i,a,s,c,l,M,N,A,C/=O,T/=O,E,v,y),y.point(M,N),n(M,N,A,C,T,E,u,d,f,p,h,_,v,y))}}return function(t){var r,i,a,o,s,c,l,u,d,f,p,m,h={point:g,lineStart:_,lineEnd:y,polygonStart:function(){t.polygonStart(),h.lineStart=b},polygonEnd:function(){t.polygonEnd(),h.lineStart=_}};function g(n,r){n=e(n,r),t.point(n[0],n[1])}function _(){u=NaN,h.point=v,t.lineStart()}function v(r,i){var a=X([r,i]),o=e(r,i);n(u,d,l,f,p,m,u=o[0],d=o[1],l=r,f=a[0],p=a[1],m=a[2],pr,t),t.point(u,d)}function y(){h.point=g,t.lineEnd()}function b(){_(),h.point=x,h.lineEnd=S}function x(e,t){v(r=e,t),i=u,a=d,o=f,s=p,c=m,h.point=v}function S(){n(u,d,l,f,p,m,i,a,r,o,s,c,pr,t),h.lineEnd=y,y()}return h}}var vr=or({point:function(e,t){this.stream.point(e*p,t*p)}});function yr(e){return or({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function br(e,t,n,r,i){function a(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return a.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},a}function xr(e,t,n,r,i,a){var o=_(a),s=S(a),c=o*e,l=s*e,u=o/e,d=s/e,f=(s*n-o*t)/e,p=(s*t+o*n)/e;function m(e,a){return e*=r,a*=i,[c*e-l*a+t,n-l*e-c*a]}return m.invert=function(e,t){return[r*(u*e-d*t+f),i*(p-d*e-u*t)]},m}function Sr(e){return Cr(function(){return e})()}function Cr(e){var t,n=150,r=480,i=250,a=0,o=0,s=0,c=0,l=0,u,d=0,m=1,h=1,g=null,_=xt,v=null,y,b,x,S=an,C=.5,T,E,D,O,k;function A(e){return D(e[0]*p,e[1]*p)}function j(e){return e=D.invert(e[0],e[1]),e&&[e[0]*f,e[1]*f]}A.stream=function(e){return O&&k===e?O:O=vr(yr(u)(_(T(S(k=e)))))},A.preclip=function(e){return arguments.length?(_=e,g=void 0,N()):_},A.postclip=function(e){return arguments.length?(S=e,v=y=b=x=null,N()):S},A.clipAngle=function(e){return arguments.length?(_=+e?Tt(g=e*p):(g=null,xt),N()):g*f},A.clipExtent=function(e){return arguments.length?(S=e==null?(v=y=b=x=null,an):kt(v=+e[0][0],y=+e[0][1],b=+e[1][0],x=+e[1][1]),N()):v==null?null:[[v,y],[b,x]]},A.scale=function(e){return arguments.length?(n=+e,M()):n},A.translate=function(e){return arguments.length?(r=+e[0],i=+e[1],M()):[r,i]},A.center=function(e){return arguments.length?(a=e[0]%360*p,o=e[1]%360*p,M()):[a*f,o*f]},A.rotate=function(e){return arguments.length?(s=e[0]%360*p,c=e[1]%360*p,l=e.length>2?e[2]%360*p:0,M()):[s*f,c*f,l*f]},A.angle=function(e){return arguments.length?(d=e%360*p,M()):d*f},A.reflectX=function(e){return arguments.length?(m=e?-1:1,M()):m<0},A.reflectY=function(e){return arguments.length?(h=e?-1:1,M()):h<0},A.precision=function(e){return arguments.length?(T=hr(E,C=e*e),N()):w(C)},A.fitExtent=function(e,t){return lr(A,e,t)},A.fitSize=function(e,t){return ur(A,e,t)},A.fitWidth=function(e,t){return dr(A,e,t)},A.fitHeight=function(e,t){return fr(A,e,t)};function M(){var e=xr(n,0,0,m,h,d).apply(null,t(a,o)),f=(d?xr:br)(n,r-e[0],i-e[1],m,h,d);return u=rt(s,c,l),E=tt(t,f),D=tt(u,E),T=hr(E,C),N()}function N(){return O=k=null,A}return function(){return t=e.apply(this,arguments),A.invert=t.invert&&j,M()}}function wr(e){var t=0,n=c/3,r=Cr(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*p,n=e[1]*p):[t*f,n*f]},i}function Tr(e){var t=_(e);function n(e,n){return[e*t,S(n)/t]}return n.invert=function(e,n){return[e/t,D(n*t)]},n}function Er(e,t){var n=S(e),r=(n+S(t))/2;if(m(r)<o)return Tr(e);var i=1+n*(2*r-n),a=w(i)/r;function s(e,t){var n=w(i-2*r*S(t))/r;return[n*S(e*=r),a-n*_(e)]}return s.invert=function(e,t){var n=a-t,o=g(e,m(n))*C(n);return n*r<0&&(o-=c*C(e)*C(n)),[o/r,D((i-(e*e+n*n)*r*r)/(2*r))]},s}function Dr(){return wr(Er).scale(155.424).center([0,33.6442])}function Or(){return Dr().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function kr(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i<t;)e[i].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function Ar(){var e,t,n=Or(),r,i=Dr().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a,s=Dr().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c,l,u={point:function(e,t){l=[e,t]}};function d(e){var t=e[0],n=e[1];return l=null,r.point(t,n),l||(a.point(t,n),l)||(c.point(t,n),l)}d.invert=function(e){var t=n.scale(),r=n.translate(),a=(e[0]-r[0])/t,o=(e[1]-r[1])/t;return(o>=.12&&o<.234&&a>=-.425&&a<-.214?i:o>=.166&&o<.234&&a>=-.214&&a<-.115?s:n).invert(e)},d.stream=function(r){return e&&t===r?e:e=kr([n.stream(t=r),i.stream(r),s.stream(r)])},d.precision=function(e){return arguments.length?(n.precision(e),i.precision(e),s.precision(e),f()):n.precision()},d.scale=function(e){return arguments.length?(n.scale(e),i.scale(e*.35),s.scale(e),d.translate(n.translate())):n.scale()},d.translate=function(e){if(!arguments.length)return n.translate();var t=n.scale(),l=+e[0],d=+e[1];return r=n.translate(e).clipExtent([[l-.455*t,d-.238*t],[l+.455*t,d+.238*t]]).stream(u),a=i.translate([l-.307*t,d+.201*t]).clipExtent([[l-.425*t+o,d+.12*t+o],[l-.214*t-o,d+.234*t-o]]).stream(u),c=s.translate([l-.205*t,d+.212*t]).clipExtent([[l-.214*t+o,d+.166*t+o],[l-.115*t-o,d+.234*t-o]]).stream(u),f()},d.fitExtent=function(e,t){return lr(d,e,t)},d.fitSize=function(e,t){return ur(d,e,t)},d.fitWidth=function(e,t){return dr(d,e,t)},d.fitHeight=function(e,t){return fr(d,e,t)};function f(){return e=t=null,d}return d.scale(1070)}function jr(e){return function(t,n){var r=_(t),i=_(n),a=e(r*i);return[a*i*S(t),a*S(n)]}}function Mr(e){return function(t,n){var r=w(t*t+n*n),i=e(r),a=S(i),o=_(i);return[g(t*a,r*o),D(r&&n*a/r)]}}var Nr=jr(function(e){return w(2/(1+e))});Nr.invert=Mr(function(e){return 2*D(e/2)});function Pr(){return Sr(Nr).scale(124.75).clipAngle(179.999)}var Fr=jr(function(e){return(e=E(e))&&e/S(e)});Fr.invert=Mr(function(e){return e});function Ir(){return Sr(Fr).scale(79.4188).clipAngle(179.999)}function Lr(e,t){return[e,b(T((l+t)/2))]}Lr.invert=function(e,t){return[e,2*h(y(t))-l]};function Rr(){return zr(Lr).scale(961/d)}function zr(e){var t=Sr(e),n=t.center,r=t.scale,i=t.translate,a=t.clipExtent,o=null,s,l,u;t.scale=function(e){return arguments.length?(r(e),d()):r()},t.translate=function(e){return arguments.length?(i(e),d()):i()},t.center=function(e){return arguments.length?(n(e),d()):n()},t.clipExtent=function(e){return arguments.length?(e==null?o=s=l=u=null:(o=+e[0][0],s=+e[0][1],l=+e[1][0],u=+e[1][1]),d()):o==null?null:[[o,s],[l,u]]};function d(){var n=c*r(),i=t(st(t.rotate()).invert([0,0]));return a(o==null?[[i[0]-n,i[1]-n],[i[0]+n,i[1]+n]]:e===Lr?[[Math.max(i[0]-n,o),s],[Math.min(i[0]+n,l),u]]:[[o,Math.max(i[1]-n,s)],[l,Math.min(i[1]+n,u)]])}return d()}function Br(e){return T((l+e)/2)}function Vr(e,t){var n=_(e),r=e===t?S(e):b(n/_(t))/b(Br(t)/Br(e)),i=n*x(Br(e),r)/r;if(!r)return Lr;function a(e,t){i>0?t<-l+o&&(t=-l+o):t>l-o&&(t=l-o);var n=i/x(Br(t),r);return[n*S(r*e),i-n*_(r*e)]}return a.invert=function(e,t){var n=i-t,a=C(r)*w(e*e+n*n),o=g(e,m(n))*C(n);return n*r<0&&(o-=c*C(e)*C(n)),[o/r,2*h(x(i/a,1/r))-l]},a}function Hr(){return wr(Vr).scale(109.5).parallels([30,30])}function Ur(e,t){return[e,t]}Ur.invert=Ur;function Wr(){return Sr(Ur).scale(152.63)}function Gr(e,t){var n=_(e),r=e===t?S(e):(n-_(t))/(t-e),i=n/r+e;if(m(r)<o)return Ur;function a(e,t){var n=i-t,a=r*e;return[n*S(a),i-n*_(a)]}return a.invert=function(e,t){var n=i-t,a=g(e,m(n))*C(n);return n*r<0&&(a-=c*C(e)*C(n)),[a/r,i-C(r)*w(e*e+n*n)]},a}function Kr(){return wr(Gr).scale(131.154).center([0,13.9389])}var qr=1.340264,Jr=-.081106,Yr=893e-6,Xr=.003796,Zr=w(3)/2,Qr=12;function $r(e,t){var n=D(Zr*S(t)),r=n*n,i=r*r*r;return[e*_(n)/(Zr*(qr+3*Jr*r+i*(7*Yr+9*Xr*r))),n*(qr+Jr*r+i*(Yr+Xr*r))]}$r.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,a=0,o,c,l;a<Qr&&(c=n*(qr+Jr*r+i*(Yr+Xr*r))-t,l=qr+3*Jr*r+i*(7*Yr+9*Xr*r),n-=o=c/l,r=n*n,i=r*r*r,!(m(o)<s));++a);return[Zr*e*(qr+3*Jr*r+i*(7*Yr+9*Xr*r))/_(n),D(S(n)/Zr)]};function ei(){return Sr($r).scale(177.158)}function ti(e,t){var n=_(t),r=_(e)*n;return[n*S(e)/r,S(t)/r]}ti.invert=Mr(h);function ni(){return Sr(ti).scale(144.049).clipAngle(60)}function ri(){var e=1,t=0,n=0,r=1,i=1,a=0,o,s,c=null,l,u,d,m=1,h=1,g=or({point:function(e,t){var n=C([e,t]);this.stream.point(n[0],n[1])}}),v=an,y,b;function x(){return m=e*r,h=e*i,y=b=null,C}function C(e){var r=e[0]*m,i=e[1]*h;if(a){var c=i*o-r*s;r=r*o+i*s,i=c}return[r+t,i+n]}return C.invert=function(e){var r=e[0]-t,i=e[1]-n;if(a){var c=i*o+r*s;r=r*o-i*s,i=c}return[r/m,i/h]},C.stream=function(e){return y&&b===e?y:y=g(v(b=e))},C.postclip=function(e){return arguments.length?(v=e,c=l=u=d=null,x()):v},C.clipExtent=function(e){return arguments.length?(v=e==null?(c=l=u=d=null,an):kt(c=+e[0][0],l=+e[0][1],u=+e[1][0],d=+e[1][1]),x()):c==null?null:[[c,l],[u,d]]},C.scale=function(t){return arguments.length?(e=+t,x()):e},C.translate=function(e){return arguments.length?(t=+e[0],n=+e[1],x()):[t,n]},C.angle=function(e){return arguments.length?(a=e%360*p,s=S(a),o=_(a),x()):a*f},C.reflectX=function(e){return arguments.length?(r=e?-1:1,x()):r<0},C.reflectY=function(e){return arguments.length?(i=e?-1:1,x()):i<0},C.fitExtent=function(e,t){return lr(C,e,t)},C.fitSize=function(e,t){return ur(C,e,t)},C.fitWidth=function(e,t){return dr(C,e,t)},C.fitHeight=function(e,t){return fr(C,e,t)},C}function ii(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}ii.invert=function(e,t){var n=t,r=25,i;do{var a=n*n,s=a*a;n-=i=(n*(1.007226+a*(.015085+s*(-.044475+.028874*a-.005916*s)))-t)/(1.007226+a*(.015085*3+s*(-.044475*7+.028874*9*a-.005916*11*s)))}while(m(i)>o&&--r>0);return[e/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]};function ai(){return Sr(ii).scale(175.295)}function oi(e,t){return[_(t)*S(e),S(t)]}oi.invert=Mr(D);function si(){return Sr(oi).scale(249.5).clipAngle(90+o)}function ci(e,t){var n=_(t),r=1+_(e)*n;return[n*S(e)/r,S(t)/r]}ci.invert=Mr(function(e){return 2*h(e)});function li(){return Sr(ci).scale(250).clipAngle(142)}function ui(e,t){return[b(T((l+t)/2)),-e]}ui.invert=function(e,t){return[-t,2*h(y(e))-l]};function di(){var e=zr(ui),t=e.center,n=e.rotate;return e.center=function(e){return arguments.length?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])},e.rotate=function(e){return arguments.length?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])},n([0,0,90]).scale(159.155)}e.geoAlbers=Or,e.geoAlbersUsa=Ar,e.geoArea=J,e.geoAzimuthalEqualArea=Pr,e.geoAzimuthalEqualAreaRaw=Nr,e.geoAzimuthalEquidistant=Ir,e.geoAzimuthalEquidistantRaw=Fr,e.geoBounds=Te,e.geoCentroid=$e,e.geoCircle=ut,e.geoClipAntimeridian=xt,e.geoClipCircle=Tt,e.geoClipExtent=At,e.geoClipRectangle=kt,e.geoConicConformal=Hr,e.geoConicConformalRaw=Vr,e.geoConicEqualArea=Dr,e.geoConicEqualAreaRaw=Er,e.geoConicEquidistant=Kr,e.geoConicEquidistantRaw=Gr,e.geoContains=Qt,e.geoDistance=Ut,e.geoEqualEarth=ei,e.geoEqualEarthRaw=$r,e.geoEquirectangular=Wr,e.geoEquirectangularRaw=Ur,e.geoGnomonic=ni,e.geoGnomonicRaw=ti,e.geoGraticule=tn,e.geoGraticule10=nn,e.geoIdentity=ri,e.geoInterpolate=rn,e.geoLength=Bt,e.geoMercator=Rr,e.geoMercatorRaw=Lr,e.geoNaturalEarth1=ai,e.geoNaturalEarth1Raw=ii,e.geoOrthographic=si,e.geoOrthographicRaw=oi,e.geoPath=ir,e.geoProjection=Sr,e.geoProjectionMutator=Cr,e.geoRotation=st,e.geoStereographic=li,e.geoStereographicRaw=ci,e.geoStream=F,e.geoTransform=ar,e.geoTransverseMercator=di,e.geoTransverseMercatorRaw=ui,Object.defineProperty(e,`__esModule`,{value:!0})})}),Hg=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e,Vg(),Bg()):r(n.d3=n.d3||{},n.d3,n.d3)})(e,function(e,t,n){var r=Math.abs,i=Math.atan,a=Math.atan2,o=Math.cos,s=Math.exp,c=Math.floor,l=Math.log,u=Math.max,d=Math.min,f=Math.pow,p=Math.round,m=Math.sign||function(e){return e>0?1:e<0?-1:0},h=Math.sin,g=Math.tan,_=1e-6,v=1e-12,y=Math.PI,b=y/2,x=y/4,S=Math.SQRT1_2,C=j(2),w=j(y),T=y*2,E=180/y,D=y/180;function O(e){return e?e/Math.sin(e):1}function k(e){return e>1?b:e<-1?-b:Math.asin(e)}function A(e){return e>1?0:e<-1?y:Math.acos(e)}function j(e){return e>0?Math.sqrt(e):0}function M(e){return e=s(2*e),(e-1)/(e+1)}function N(e){return(s(e)-s(-e))/2}function P(e){return(s(e)+s(-e))/2}function F(e){return l(e+j(e*e+1))}function I(e){return l(e+j(e*e-1))}function L(e){var t=g(e/2),n=2*l(o(e/2))/(t*t);function i(e,t){var r=o(e),i=o(t),a=h(t),s=i*r,c=-((1-s?l((1+s)/2)/(1-s):-.5)+n/(1+s));return[c*i*h(e),c*a]}return i.invert=function(t,i){var s=j(t*t+i*i),c=-e/2,u=50,d;if(!s)return[0,0];do{var f=c/2,p=o(f),m=h(f),g=m/p,v=-l(r(p));c-=d=(2/g*v-n*g-s)/(-v/(m*m)+1-n/(2*p*p))*(p<0?.7:1)}while(r(d)>_&&--u>0);var y=h(c);return[a(t*y,s*o(c)),k(i*y/s)]},i}function R(){var e=b,n=t.geoProjectionMutator(L),r=n(e);return r.radius=function(t){return arguments.length?n(e=t*D):e*E},r.scale(179.976).clipAngle(147)}function z(e,t){var n=o(t),r=O(A(n*o(e/=2)));return[2*n*h(e)*r,h(t)*r]}z.invert=function(e,t){if(!(e*e+4*t*t>y*y+_)){var n=e,i=t,a=25;do{var s=h(n),c=h(n/2),l=o(n/2),u=h(i),d=o(i),f=h(2*i),p=u*u,m=d*d,g=c*c,v=1-m*l*l,b=v?A(d*l)*j(x=1/v):x=0,x,S=2*b*d*c-e,C=b*u-t,w=x*(m*g+b*d*l*p),T=x*(.5*s*f-b*2*u*c),E=x*.25*(f*c-b*u*m*s),D=x*(p*l+b*g*d),O=T*E-D*w;if(!O)break;var k=(C*T-S*D)/O,M=(S*E-C*w)/O;n-=k,i-=M}while((r(k)>_||r(M)>_)&&--a>0);return[n,i]}};function B(){return t.geoProjection(z).scale(152.63)}function V(e){var t=h(e),n=o(e),i=e>=0?1:-1,s=g(i*e),c=(1+t-n)/2;function l(e,r){var l=o(r),u=o(e/=2);return[(1+l)*h(e),(i*r>-a(u,s)-.001?0:-i*10)+c+h(r)*n-(1+l)*t*u]}return l.invert=function(e,l){var u=0,d=0,f=50;do{var p=o(u),m=h(u),g=o(d),v=h(d),y=1+g,b=y*m-e,x=c+v*n-y*t*p-l,S=y*p/2,C=-m*v,w=t*y*m/2,T=n*g+t*p*v,E=C*w-T*S,D=(x*C-b*T)/E/2,O=(b*w-x*S)/E;r(O)>2&&(O/=2),u-=D,d-=O}while((r(D)>_||r(O)>_)&&--f>0);return i*d>-a(o(u),s)-.001?[u*2,d]:null},l}function H(){var e=20*D,n=e>=0?1:-1,r=g(n*e),i=t.geoProjectionMutator(V),s=i(e),c=s.stream;return s.parallel=function(t){return arguments.length?(r=g((n=(e=t*D)>=0?1:-1)*e),i(e)):e*E},s.stream=function(t){var i=s.rotate(),l=c(t),u=(s.rotate([0,0]),c(t)),d=s.precision();return s.rotate(i),l.sphere=function(){u.polygonStart(),u.lineStart();for(var t=n*-180;n*t<180;t+=n*90)u.point(t,n*90);if(e)for(;n*(t-=3*n*d)>=-180;)u.point(t,n*-a(o(t*D/2),r)*E);u.lineEnd(),u.polygonEnd()},l},s.scale(218.695).center([0,28.0974])}function U(e,t){var n=g(t/2),r=j(1-n*n),i=1+r*o(e/=2),a=h(e)*r/i,s=n/i,c=a*a,l=s*s;return[4/3*a*(3+c-3*l),4/3*s*(3+3*c-l)]}U.invert=function(e,t){if(e*=3/8,t*=3/8,!e&&r(t)>1)return null;var n=e*e,i=t*t,s=1+n+i,c=j((s-j(s*s-4*t*t))/2),l=k(c)/3,u=c?I(r(t/c))/3:F(r(e))/3,d=o(l),f=P(u),p=f*f-d*d;return[m(e)*2*a(N(u)*d,.25-p),m(t)*2*a(f*h(l),.25+p)]};function W(){return t.geoProjection(U).scale(66.1603)}var G=j(8),K=l(1+C);function q(e,t){var n=r(t);return n<x?[e,l(g(x+t/2))]:[e*o(n)*(2*C-1/h(n)),m(t)*(2*C*(n-x)-l(g(n/2)))]}q.invert=function(e,t){if((u=r(t))<K)return[e,2*i(s(t))-b];var n=x,a=25,c,u;do{var d=o(n/2),f=g(n/2);n-=c=(G*(n-x)-l(f)-u)/(G-d*d/(2*f))}while(r(c)>v&&--a>0);return[e/(o(n)*(G-1/h(n))),m(t)*n]};function J(){return t.geoProjection(q).scale(112.314)}function Y(e){var n=2*y/e;function s(e,i){var s=t.geoAzimuthalEquidistantRaw(e,i);if(r(e)>b){var c=a(s[1],s[0]),l=j(s[0]*s[0]+s[1]*s[1]),u=n*p((c-b)/n)+b,d=a(h(c-=u),2-o(c));c=u+k(y/l*h(d))-d,s[0]=l*o(c),s[1]=l*h(c)}return s}return s.invert=function(e,r){var s=j(e*e+r*r);if(s>b){var c=a(r,e),l=n*p((c-b)/n)+b,u=c>l?-1:1,d=s*o(l-c),f=1/g(u*A((d-y)/j(y*(y-2*d)+s*s)));c=l+2*i((f+u*j(f*f-3))/3),e=s*o(c),r=s*h(c)}return t.geoAzimuthalEquidistantRaw.invert(e,r)},s}function X(){var e=5,n=t.geoProjectionMutator(Y),r=n(e),i=r.stream,s=.01,c=-o(s*D),l=h(s*D);return r.lobes=function(t){return arguments.length?n(e=+t):e},r.stream=function(t){var n=r.rotate(),u=i(t),d=(r.rotate([0,0]),i(t));return r.rotate(n),u.sphere=function(){d.polygonStart(),d.lineStart();for(var t=0,n=360/e,r=2*y/e,i=90-180/e,u=b;t<e;++t,i-=n,u-=r)d.point(a(l*o(u),c)*E,k(l*h(u))*E),i<-90?(d.point(-90,-180-i-s),d.point(-90,-180-i+s)):(d.point(90,i+s),d.point(90,i-s));d.lineEnd(),d.polygonEnd()},u},r.scale(87.8076).center([0,17.1875]).clipAngle(179.999)}function Z(e,n){if(arguments.length<2&&(n=e),n===1)return t.geoAzimuthalEqualAreaRaw;if(n===1/0)return Q;function r(r,i){var a=t.geoAzimuthalEqualAreaRaw(r/n,i);return a[0]*=e,a}return r.invert=function(r,i){var a=t.geoAzimuthalEqualAreaRaw.invert(r/e,i);return a[0]*=n,a},r}function Q(e,t){return[e*o(t)/o(t/=2),2*h(t)]}Q.invert=function(e,t){var n=2*k(t/2);return[e*o(n/2)/o(n),n]};function ee(){var e=2,n=t.geoProjectionMutator(Z),r=n(e);return r.coefficient=function(t){return arguments.length?n(e=+t):e},r.scale(169.529)}function te(e,t,n){var i=100,a,o,s;n=n===void 0?0:+n,t=+t;do o=e(n),s=e(n+_),o===s&&(s=o+_),n-=a=-1*_*(o-t)/(o-s);while(i-- >0&&r(a)>_);return i<0?NaN:n}function ne(e,t,n){return t===void 0&&(t=40),n===void 0&&(n=v),function(i,a,o,s){var c,l,u;o=o===void 0?0:+o,s=s===void 0?0:+s;for(var d=0;d<t;d++){var f=e(o,s),p=f[0]-i,m=f[1]-a;if(r(p)<n&&r(m)<n)break;var h=p*p+m*m;if(h>c){o-=l/=2,s-=u/=2;continue}c=h;var g=(o>0?-1:1)*n,_=(s>0?-1:1)*n,v=e(o+g,s),y=e(o,s+_),b=(v[0]-f[0])/g,x=(v[1]-f[1])/g,S=(y[0]-f[0])/_,C=(y[1]-f[1])/_,w=C*b-x*S,T=(r(w)<.5?.5:1)/w;if(l=(m*S-p*C)*T,u=(p*x-m*b)*T,o+=l,s+=u,r(l)<n&&r(u)<n)break}return[o,s]}}function re(){var e=Z(1.68,2),t=1.4,n=12;function r(r,i){if(r+i<-t){var a=(r-i+1.6)*(r+i+t)/8;r+=a,i-=.8*a*h(i+y/2)}var s=e(r,i),c=(1-o(r*i))/n;return s[1]<0&&(s[0]*=1+c),s[1]>0&&(s[1]*=1+c/1.5*s[0]*s[0]),s}return r.invert=ne(r),r}function ie(){return t.geoProjection(re()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function ae(e,t){var n=e*h(t),i=30,a;do t-=a=(t+h(t)-n)/(1+o(t));while(r(a)>_&&--i>0);return t/2}function oe(e,t,n){function r(r,i){return[e*r*o(i=ae(n,i)),t*h(i)]}return r.invert=function(r,i){return i=k(i/t),[r/(e*o(i)),k((2*i+h(2*i))/n)]},r}var se=oe(C/b,C,y);function ce(){return t.geoProjection(se).scale(169.529)}var le=2.00276,ue=1.11072;function de(e,t){var n=ae(y,t);return[le*e/(1/o(t)+ue/o(n)),(t+C*h(n))/le]}de.invert=function(e,t){var n=le*t,i=t<0?-x:x,a=25,s,c;do c=n-C*h(i),i-=s=(h(2*i)+2*i-y*h(c))/(2*o(2*i)+2+y*o(c)*C*o(i));while(r(s)>_&&--a>0);return c=n-C*h(i),[e*(1/o(c)+ue/o(i))/le,c]};function fe(){return t.geoProjection(de).scale(160.857)}function pe(e){var n=0,r=t.geoProjectionMutator(e),i=r(n);return i.parallel=function(e){return arguments.length?r(n=e*D):n*E},i}function me(e,t){return[e*o(t),t]}me.invert=function(e,t){return[e/o(t),t]};function he(){return t.geoProjection(me).scale(152.63)}function ge(e){if(!e)return me;var t=1/g(e);function n(n,r){var i=t+e-r,a=i&&n*o(r)/i;return[i*h(a),t-i*o(a)]}return n.invert=function(n,r){var i=j(n*n+(r=t-r)*r),s=t+e-i;return[i/o(s)*a(n,r),s]},n}function _e(){return pe(ge).scale(123.082).center([0,26.1441]).parallel(45)}function ve(e){function t(t,n){var r=b-n,i=r&&t*e*h(r)/r;return[r*h(i)/e,b-r*o(i)]}return t.invert=function(t,n){var r=t*e,i=b-n,o=j(r*r+i*i),s=a(r,i);return[(o?o/h(o):1)*s/e,b-o]},t}function ye(){var e=.5,n=t.geoProjectionMutator(ve),r=n(e);return r.fraction=function(t){return arguments.length?n(e=+t):e},r.scale(158.837)}var be=oe(1,4/y,y);function xe(){return t.geoProjection(be).scale(152.63)}function Se(e,t,n,i,s,c){var l=o(c),u;if(r(e)>1||r(c)>1)u=A(n*s+t*i*l);else{var d=h(e/2),f=h(c/2);u=2*k(j(d*d+t*i*f*f))}return r(u)>_?[u,a(i*h(c),t*s-n*i*l)]:[0,0]}function Ce(e,t,n){return A((e*e+t*t-n*n)/(2*e*t))}function we(e){return e-2*y*c((e+y)/(2*y))}function Te(e,t,n){for(var r=[[e[0],e[1],h(e[1]),o(e[1])],[t[0],t[1],h(t[1]),o(t[1])],[n[0],n[1],h(n[1]),o(n[1])]],i=r[2],a,s=0;s<3;++s,i=a)a=r[s],i.v=Se(a[1]-i[1],i[3],i[2],a[3],a[2],a[0]-i[0]),i.point=[0,0];var c=Ce(r[0].v[0],r[2].v[0],r[1].v[0]),l=Ce(r[0].v[0],r[1].v[0],r[2].v[0]),u=y-c;r[2].point[1]=0,r[0].point[0]=-(r[1].point[0]=r[0].v[0]/2);var d=[r[2].point[0]=r[0].point[0]+r[2].v[0]*o(c),2*(r[0].point[1]=r[1].point[1]=r[2].v[0]*h(c))];function f(e,t){var n=h(t),i=o(t),a=[,,,],s;for(s=0;s<3;++s){var c=r[s];if(a[s]=Se(t-c[1],c[3],c[2],i,n,e-c[0]),!a[s][0])return c.point;a[s][1]=we(a[s][1]-c.v[1])}var f=d.slice();for(s=0;s<3;++s){var p=s==2?0:s+1,m=Ce(r[s].v[0],a[s][0],a[p][0]);a[s][1]<0&&(m=-m),s?s==1?(m=l-m,f[0]-=a[s][0]*o(m),f[1]-=a[s][0]*h(m)):(m=u-m,f[0]+=a[s][0]*o(m),f[1]+=a[s][0]*h(m)):(f[0]+=a[s][0]*o(m),f[1]-=a[s][0]*h(m))}return f[0]/=3,f[1]/=3,f}return f}function Ee(e){return e[0]*=D,e[1]*=D,e}function De(){return Oe([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function Oe(e,n,r){var i=t.geoCentroid({type:`MultiPoint`,coordinates:[e,n,r]}),a=[-i[0],-i[1]],o=t.geoRotation(a),s=Te(Ee(o(e)),Ee(o(n)),Ee(o(r)));s.invert=ne(s);var c=t.geoProjection(s).rotate(a),l=c.center;return delete c.rotate,c.center=function(e){return arguments.length?l(o(e)):o.invert(l())},c.clipAngle(90)}function ke(e,t){var n=j(1-h(t));return[2/w*e*n,w*(1-n)]}ke.invert=function(e,t){var n=(n=t/w-1)*n;return[n>0?e*j(y/n)/2:0,k(1-n)]};function Ae(){return t.geoProjection(ke).scale(95.6464).center([0,30])}function je(e){var t=g(e);function n(e,n){return[e,(e?e/h(e):1)*(h(n)*o(e)-t*o(n))]}return n.invert=t?function(e,n){e&&(n*=h(e)/e);var r=o(e);return[e,2*a(j(r*r+t*t-n*n)-r,t-n)]}:function(e,t){return[e,k(e?t*g(e)/e:t)]},n}function Me(){return pe(je).scale(249.828).clipAngle(90)}var Ne=j(3);function Pe(e,t){return[Ne*e*(2*o(2*t/3)-1)/w,Ne*w*h(t/3)]}Pe.invert=function(e,t){var n=3*k(t/(Ne*w));return[w*e/(Ne*(2*o(2*n/3)-1)),n]};function Fe(){return t.geoProjection(Pe).scale(156.19)}function Ie(e){var t=o(e);function n(e,n){return[e*t,h(n)/t]}return n.invert=function(e,n){return[e/t,k(n*t)]},n}function Le(){return pe(Ie).parallel(38.58).scale(195.044)}function Re(e){var t=o(e);function n(e,n){return[e*t,(1+t)*g(n/2)]}return n.invert=function(e,n){return[e/t,i(n/(1+t))*2]},n}function ze(){return pe(Re).scale(124.75)}function Be(e,t){var n=j(8/(3*y));return[n*e*(1-r(t)/y),n*t]}Be.invert=function(e,t){var n=j(8/(3*y)),i=t/n;return[e/(n*(1-r(i)/y)),i]};function Ve(){return t.geoProjection(Be).scale(165.664)}function He(e,t){var n=j(4-3*h(r(t)));return[2/j(6*y)*e*n,m(t)*j(2*y/3)*(2-n)]}He.invert=function(e,t){var n=2-r(t)/j(2*y/3);return[e*j(6*y)/(2*n),m(t)*k((4-n*n)/3)]};function Ue(){return t.geoProjection(He).scale(165.664)}function We(e,t){var n=j(y*(4+y));return[2/n*e*(1+j(1-4*t*t/(y*y))),4/n*t]}We.invert=function(e,t){var n=j(y*(4+y))/2;return[e*n/(1+j(1-t*t*(4+y)/(4*y))),t*n/2]};function Ge(){return t.geoProjection(We).scale(180.739)}function Ke(e,t){var n=(2+b)*h(t);t/=2;for(var i=0,a=1/0;i<10&&r(a)>_;i++){var s=o(t);t-=a=(t+h(t)*(s+2)-n)/(2*s*(1+s))}return[2/j(y*(4+y))*e*(1+o(t)),2*j(y/(4+y))*h(t)]}Ke.invert=function(e,t){var n=t*j((4+y)/y)/2,r=k(n),i=o(r);return[e/(2/j(y*(4+y))*(1+i)),k((r+n*(i+2))/(2+b))]};function qe(){return t.geoProjection(Ke).scale(180.739)}function Je(e,t){return[e*(1+o(t))/j(2+y),2*t/j(2+y)]}Je.invert=function(e,t){var n=j(2+y),r=t*n/2;return[n*e/(1+o(r)),r]};function Ye(){return t.geoProjection(Je).scale(173.044)}function Xe(e,t){for(var n=(1+b)*h(t),i=0,a=1/0;i<10&&r(a)>_;i++)t-=a=(t+h(t)-n)/(1+o(t));return n=j(2+y),[e*(1+o(t))/n,2*t/n]}Xe.invert=function(e,t){var n=1+b,r=j(n/2);return[e*2*r/(1+o(t*=r)),k((t+h(t))/n)]};function Ze(){return t.geoProjection(Xe).scale(173.044)}var Qe=3+2*C;function $e(e,t){var n=h(e/=2),r=o(e),a=j(o(t)),s=o(t/=2),c=h(t)/(s+C*r*a),u=j(2/(1+c*c)),d=j((C*s+(r+n)*a)/(C*s+(r-n)*a));return[Qe*(u*(d-1/d)-2*l(d)),Qe*(u*c*(d+1/d)-2*i(c))]}$e.invert=function(e,t){if(!(c=U.invert(e/1.2,t*1.065)))return null;var n=c[0],a=c[1],s=20,c;e/=Qe,t/=Qe;do{var f=n/2,p=a/2,m=h(f),g=o(f),v=h(p),y=o(p),x=o(a),w=j(x),T=v/(y+C*g*w),E=T*T,D=j(2/(1+E)),O=(C*y+(g+m)*w)/(C*y+(g-m)*w),k=j(O),A=k-1/k,M=k+1/k,N=D*A-2*l(k)-e,P=D*T*M-2*i(T)-t,F=v&&S*w*m*E/v,I=(C*g*y+w)/(2*(y+C*g*w)*(y+C*g*w)*w),L=-.5*T*D*D*D,R=L*F,z=L*I,B=(B=2*y+C*w*(g-m))*B*k,V=(C*g*y*w+x)/B,H=-(C*m*v)/(w*B),W=A*R-2*V/k+D*(V+V/O),G=A*z-2*H/k+D*(H+H/O),K=T*M*R-2*F/(1+E)+D*M*F+D*T*(V-V/O),q=T*M*z-2*I/(1+E)+D*M*I+D*T*(H-H/O),J=G*K-q*W;if(!J)break;var Y=(P*G-N*q)/J,X=(N*K-P*W)/J;n-=Y,a=u(-b,d(b,a-X))}while((r(Y)>_||r(X)>_)&&--s>0);return r(r(a)-b)<_?[0,a]:s&&[n,a]};function et(){return t.geoProjection($e).scale(62.5271)}var tt=o(35*D);function nt(e,t){var n=g(t/2);return[e*tt*j(1-n*n),(1+tt)*n]}nt.invert=function(e,t){var n=t/(1+tt);return[e&&e/(tt*j(1-n*n)),2*i(n)]};function rt(){return t.geoProjection(nt).scale(137.152)}function it(e,t){var n=t/2,r=o(n);return[2*e/w*o(t)*r*r,w*g(n)]}it.invert=function(e,t){var n=i(t/w),r=o(n),a=2*n;return[e*w/2/(o(a)*r*r),a]};function at(){return t.geoProjection(it).scale(135.264)}function ot(e){var t=1-e,n=i(y,0)[0]-i(-y,0)[0],r=j(2*(i(0,b)[1]-i(0,-b)[1])/n);function i(n,r){var i=o(r),a=h(r);return[i/(t+e*i)*n,t*r+e*a]}function a(e,t){var n=i(e,t);return[n[0]*r,n[1]/r]}function s(e){return a(0,e)[1]}return a.invert=function(n,i){var a=te(s,i);return[n/r*(e+t/o(a)),a]},a}function st(){var e=.5,n=t.geoProjectionMutator(ot),r=n(e);return r.alpha=function(t){return arguments.length?n(e=+t):e},r.scale(168.725)}function ct(e){return[e[0]/2,k(g(e[1]/2*D))*E]}function lt(e){return[e[0]*2,2*i(h(e[1]*D))*E]}function ut(e){e??=t.geoOrthographic;var n=e(),r=t.geoEquirectangular().scale(E).precision(0).clipAngle(null).translate([0,0]);function i(e){return n(ct(e))}n.invert&&(i.invert=function(e){return lt(n.invert(e))}),i.stream=function(e){var t=n.stream(e),i=r.stream({point:function(e,n){t.point(e/2,k(g(-n/2*D))*E)},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}});return i.sphere=t.sphere,i};function a(e){i[e]=function(){return arguments.length?(n[e].apply(n,arguments),i):n[e]()}}return i.rotate=function(e){return arguments.length?(r.rotate(e),i):r.rotate()},i.center=function(e){return arguments.length?(n.center(ct(e)),i):lt(n.center())},a(`angle`),a(`clipAngle`),a(`clipExtent`),a(`fitExtent`),a(`fitHeight`),a(`fitSize`),a(`fitWidth`),a(`scale`),a(`translate`),a(`precision`),i.scale(249.5)}function $(e,n){var i=2*y/n,s=e*e;function c(n,c){var l=t.geoAzimuthalEquidistantRaw(n,c),u=l[0],d=l[1],f=u*u+d*d;if(f>s){var m=j(f),g=a(d,u),v=i*p(g/i),x=g-v,S=e*o(x),C=(e*h(x)-x*h(S))/(b-S),w=dt(x,C),T=(y-e)/ft(w,S,y);u=m;var E=50,D;do u-=D=(e+ft(w,S,u)*T-m)/(w(u)*T);while(r(D)>_&&--E>0);d=x*h(u),u<b&&(d-=C*(u-b));var O=h(v),k=o(v);l[0]=u*k-d*O,l[1]=u*O+d*k}return l}return c.invert=function(n,c){var l=n*n+c*c;if(l>s){var u=j(l),d=a(c,n),f=i*p(d/i),m=d-f;n=u*o(m),c=u*h(m);for(var g=n-b,_=h(n),x=c/_,S=n<b?1/0:0,C=10;;){var w=e*h(x),T=e*o(x),E=h(T),D=b-T,O=(w-x*E)/D,k=dt(x,O);if(r(S)<v||!--C)break;x-=S=(x*_-O*g-c)/(_-g*2*(D*(T+x*w*o(T)-E)-w*(w-x*E))/(D*D))}u=e+ft(k,T,n)*(y-e)/ft(k,T,y),d=f+x,n=u*o(d),c=u*h(d)}return t.geoAzimuthalEquidistantRaw.invert(n,c)},c}function dt(e,t){return function(n){var r=e*o(n);return n<b&&(r-=t),j(1+r*r)}}function ft(e,t,n){for(var r=50,i=(n-t)/r,a=e(t)+e(n),o=1,s=t;o<r;++o)a+=2*e(s+=i);return a*.5*i}function pt(){var e=6,n=30*D,r=o(n),i=h(n),s=t.geoProjectionMutator($),c=s(n,e),l=c.stream,u=.01,d=-o(u*D),f=h(u*D);return c.radius=function(t){return arguments.length?(r=o(n=t*D),i=h(n),s(n,e)):n*E},c.lobes=function(t){return arguments.length?s(n,e=+t):e},c.stream=function(t){var n=c.rotate(),s=l(t),u=(c.rotate([0,0]),l(t));return c.rotate(n),s.sphere=function(){u.polygonStart(),u.lineStart();for(var t=0,n=2*y/e,s=0;t<e;++t,s-=n)u.point(a(f*o(s),d)*E,k(f*h(s))*E),u.point(a(i*o(s-n/2),r)*E,k(i*h(s-n/2))*E);u.lineEnd(),u.polygonEnd()},s},c.rotate([90,-40]).scale(91.7095).clipAngle(179.999)}function mt(e,t,n,i,a,s,c,l){arguments.length<8&&(l=0);function u(r,u){if(!u)return[e*r/y,0];var d=u*u,f=e+d*(t+d*(n+d*i)),p=u*(a-1+d*(s-l+d*c)),m=(f*f+p*p)/(2*p),g=r*k(f/m)/y;return[m*h(g),u*(1+d*l)+m*(1-o(g))]}return u.invert=function(u,d){var f=y*u/e,p=d,m,g,v=50;do{var b=p*p,x=e+b*(t+b*(n+b*i)),S=p*(a-1+b*(s-l+b*c)),C=x*x+S*S,w=2*S,T=C/w,E=T*T,D=k(x/T)/y,O=f*D,A=x*x,M=(2*t+b*(4*n+b*6*i))*p,N=a+b*(3*s+b*5*c),P=2*(x*M+S*(N-1)),F=2*(N-1),I=(P*w-C*F)/(w*w),L=o(O),R=h(O),z=T*L,B=T*R,V=f/y*(1/j(1-A/E))*(M*T-x*I)/E,H=B-u,U=p*(1+b*l)+T-z-d,W=I*R+z*V,G=z*D,K=1+I-(I*L-B*V),q=B*D,J=W*q-K*G;if(!J)break;f-=m=(U*W-H*K)/J,p-=g=(H*q-U*G)/J}while((r(m)>_||r(g)>_)&&--v>0);return[f,p]},u}var ht=mt(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function gt(){return t.geoProjection(ht).scale(149.995)}var _t=mt(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function vt(){return t.geoProjection(_t).scale(153.93)}var yt=mt(5/6*y,-.62636,-.0344,0,1.3493,-.05524,0,.045);function bt(){return t.geoProjection(yt).scale(130.945)}function xt(e,t){var n=e*e,r=t*t;return[e*(1-.162388*r)*(.87-952426e-9*n*n),t*(1+r/12)]}xt.invert=function(e,t){var n=e,i=t,a=50,o;do{var s=i*i;i-=o=(i*(1+s/12)-t)/(1+s/4)}while(r(o)>_&&--a>0);a=50,e/=1-.162388*s;do{var c=(c=n*n)*c;n-=o=(n*(.87-952426e-9*c)-e)/(.87-.00476213*c)}while(r(o)>_&&--a>0);return[n,i]};function St(){return t.geoProjection(xt).scale(131.747)}var Ct=mt(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function wt(){return t.geoProjection(Ct).scale(131.087)}function Tt(e){var t=e(b,0)[0]-e(-b,0)[0];function n(n,r){var i=n>0?-.5:.5,a=e(n+i*y,r);return a[0]-=i*t,a}return e.invert&&(n.invert=function(n,r){var i=n>0?-.5:.5,a=e.invert(n+i*t,r),o=a[0]-i*y;return o<-y?o+=2*y:o>y&&(o-=2*y),a[0]=o,a}),n}function Et(e,t){var n=m(e),i=m(t),s=o(t),c=o(e)*s,l=h(e)*s,u=h(i*t);e=r(a(l,u)),t=k(c),r(e-b)>_&&(e%=b);var d=Dt(e>y/4?b-e:e,t);return e>y/4&&(u=d[0],d[0]=-d[1],d[1]=-u),d[0]*=n,d[1]*=-i,d}Et.invert=function(e,t){r(e)>1&&(e=m(e)*2-e),r(t)>1&&(t=m(t)*2-t);var n=m(e),i=m(t),s=-n*e,c=-i*t,l=c/s<1,u=Ot(l?c:s,l?s:c),d=u[0],f=u[1],p=o(f);return l&&(d=-b-d),[n*(a(h(d)*p,-h(f))+y),i*k(o(d)*p)]};function Dt(e,t){if(t===b)return[0,0];var n=h(t),i=n*n,a=i*i,s=1+a,c=1+3*a,l=1-a,u=k(1/j(s)),d=l+i*s*u,f=(1-n)/d,p=j(f),m=f*s,g=j(m),v=p*l,x,S;if(e===0)return[0,-(v+i*g)];var C=o(t),w=1/C,T=2*n*C,E=(-3*i+u*c)*T,D=(-d*C-(1-n)*E)/(d*d),O=l*(.5*D/p)-2*i*p*T,A=i*s*D+f*c*T,M=-w*T,N=-w*A,P=-2*w*O,F=4*e/y,I;if(e>.222*y||t<y/4&&e>.175*y){if(x=(v+i*j(m*(1+a)-v*v))/(1+a),e>y/4)return[x,x];var L=x,R=.5*x;x=.5*(R+L),S=50;do{var z=j(m-x*x),B=x*(P+M*z)+N*k(x/g)-F;if(!B)break;B<0?R=x:L=x,x=.5*(R+L)}while(r(L-R)>_&&--S>0)}else{x=_,S=25;do{var V=x*x,H=j(m-V),U=P+M*H,W=x*U+N*k(x/g)-F,G=U+(N-M*V)/H;x-=I=H?W/G:0}while(r(I)>_&&--S>0)}return[x,-v-i*j(m-x*x)]}function Ot(e,t){for(var n=0,i=1,a=.5,s=50;;){var c=a*a,l=j(a),u=k(1/j(1+c)),d=1-c+a*(1+c)*u,f=(1-l)/d,p=j(f),m=f*(1+c),h=p*(1-c),g=j(m-e*e),_=t+h+a*g;if(r(i-n)<v||--s===0||_===0)break;_>0?n=a:i=a,a=.5*(n+i)}if(!s)return null;var b=k(l),x=o(b),S=1/x,C=2*l*x,w=(-3*a+u*(1+3*c))*C,T=(-d*x-(1-l)*w)/(d*d),E=.5*T/p,D=(1-c)*E-2*a*p*C,O=-2*S*D,A=-S*C,M=-S*(a*(1+c)*T+f*(1+3*c)*C);return[y/4*(e*(O+A*g)+M*k(e/j(m))),b]}function kt(){return t.geoProjection(Tt(Et)).scale(239.75)}function At(e,t,n){var r,i,a;return e?(r=jt(e,n),t?(i=jt(t,1-n),a=i[1]*i[1]+n*r[0]*r[0]*i[0]*i[0],[[r[0]*i[2]/a,r[1]*r[2]*i[0]*i[1]/a],[r[1]*i[1]/a,-r[0]*r[2]*i[0]*i[2]/a],[r[2]*i[1]*i[2]/a,-n*r[0]*r[1]*i[0]/a]]):[[r[0],0],[r[1],0],[r[2],0]]):(i=jt(t,1-n),[[0,i[0]/i[1]],[1/i[1],0],[i[2]/i[1],0]])}function jt(e,t){var n,a,c,l,u;if(t<_)return l=h(e),a=o(e),n=t*(e-l*a)/4,[l-n*a,a+n*l,1-t*l*l/2,e-n];if(t>=1-_)return n=(1-t)/4,a=P(e),l=M(e),c=1/a,u=a*N(e),[l+n*(u-e)/(a*a),c-n*l*c*(u-e),c+n*l*c*(u+e),2*i(s(e))-b+n*(u-e)/a];var d=[1,0,0,0,0,0,0,0,0],f=[j(t),0,0,0,0,0,0,0,0],p=0;for(a=j(1-t),u=1;r(f[p]/d[p])>_&&p<8;)n=d[p++],f[p]=(n-a)/2,d[p]=(n+a)/2,a=j(n*a),u*=2;c=u*d[p]*e;do l=f[p]*h(a=c)/d[p],c=(k(l)+c)/2;while(--p);return[h(c),l=o(c),l/o(c-a),c]}function Mt(e,t,n){var a=r(e),o=N(r(t));if(a){var s=1/h(a),c=1/(g(a)*g(a)),l=-(c+n*(o*o*s*s)-1+n),u=(n-1)*c,d=(-l+j(l*l-4*u))/2;return[Nt(i(1/j(d)),n)*m(e),Nt(i(j((d/c-1)/n)),1-n)*m(t)]}return[0,Nt(i(o),1-n)*m(t)]}function Nt(e,t){if(!t)return e;if(t===1)return l(g(e/2+x));for(var n=1,a=j(1-t),o=j(t),s=0;r(o)>_;s++){if(e%y){var c=i(a*g(e)/n);c<0&&(c+=y),e+=c+~~(e/y)*y}else e+=e;o=(n+a)/2,a=j(n*a),o=((n=o)-a)/2}return e/(f(2,s)*n)}function Pt(e,t){var n=(C-1)/(C+1),i=j(1-n*n),a=Nt(b,i*i),c=-1,u=s(c*l(g(y/4+r(t)/2)))/j(n),d=Ft(u*o(c*e),u*h(c*e)),f=Mt(d[0],d[1],i*i);return[-f[1],(t>=0?1:-1)*(.5*a-f[0])]}function Ft(e,t){var n=e*e,r=t+1,i=1-n-t*t;return[.5*((e>=0?b:-b)-a(i,2*e)),-.25*l(i*i+4*n)+.5*l(r*r+n)]}function It(e,t){var n=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/n,(e[1]*t[0]-e[0]*t[1])/n]}Pt.invert=function(e,t){var n=(C-1)/(C+1),r=j(1-n*n),o=Nt(b,r*r),c=-1,u=At(.5*o-t,-e,r*r),d=It(u[0],u[1]);return[a(d[1],d[0])/c,2*i(s(.5/c*l(n*d[0]*d[0]+n*d[1]*d[1])))-b]};function Lt(){return t.geoProjection(Tt(Pt)).scale(151.496)}function Rt(e){var t=h(e),n=o(e),i=zt(e);i.invert=zt(-e);function s(e,a){var s=i(e,a);e=s[0],a=s[1];var c=h(a),l=o(a),u=o(e),d=A(t*c+n*l*u),f=h(d),p=r(f)>_?d/f:1;return[p*n*h(e),(r(e)>b?p:-p)*(t*l-n*c*u)]}return s.invert=function(e,n){var r=j(e*e+n*n),s=-h(r),c=o(r),l=r*c,u=-n*s,d=r*t,f=j(l*l+u*u-d*d),p=a(l*d+u*f,u*d-l*f),m=(r>b?-1:1)*a(e*s,r*o(p)*c+n*h(p)*s);return i.invert(m,p)},s}function zt(e){var t=h(e),n=o(e);return function(e,r){var i=o(r),s=o(e)*i,c=h(e)*i,l=h(r);return[a(c,s*n-l*t),k(l*n+s*t)]}}function Bt(){var e=0,n=t.geoProjectionMutator(Rt),r=n(e),i=r.rotate,a=r.stream,o=t.geoCircle();return r.parallel=function(t){if(!arguments.length)return e*E;var i=r.rotate();return n(e=t*D).rotate(i)},r.rotate=function(t){return arguments.length?(i.call(r,[t[0],t[1]-e*E]),o.center([-t[0],-t[1]]),r):(t=i.call(r),t[1]+=e*E,t)},r.stream=function(e){return e=a(e),e.sphere=function(){e.polygonStart();var t=.01,n=o.radius(90-t)().coordinates[0],r=n.length-1,i=-1,a;for(e.lineStart();++i<r;)e.point((a=n[i])[0],a[1]);for(e.lineEnd(),n=o.radius(90+t)().coordinates[0],r=n.length-1,e.lineStart();--i>=0;)e.point((a=n[i])[0],a[1]);e.lineEnd(),e.polygonEnd()},e},r.scale(79.4187).parallel(45).clipAngle(179.999)}var Vt=k(1-1/3)*E,Ht=Ie(0);function Ut(e){var t=Vt*D,n=ke(y,t)[0]-ke(-y,t)[0],i=Ht(0,t)[1],a=ke(0,t)[1],o=w-a,s=T/e,l=4/T,f=i+o*o*4/T;function p(p,m){var h,g=r(m);if(g>t){var _=d(e-1,u(0,c((p+y)/s)));p+=y*(e-1)/e-_*s,h=ke(p,g),h[0]=h[0]*T/n-T*(e-1)/(2*e)+_*T/e,h[1]=i+(h[1]-a)*4*o/T,m<0&&(h[1]=-h[1])}else h=Ht(p,m);return h[0]*=l,h[1]/=f,h}return p.invert=function(t,p){t/=l,p*=f;var m=r(p);if(m>i){var h=d(e-1,u(0,c((t+y)/s)));t=(t+y*(e-1)/e-h*s)*n/T;var g=ke.invert(t,.25*(m-i)*T/o+a);return g[0]-=y*(e-1)/e-h*s,p<0&&(g[1]=-g[1]),g}return Ht.invert(t,p)},p}function Wt(e,t){return[e,t&1?90-_:Vt]}function Gt(e,t){return[e,t&1?-90+_:-Vt]}function Kt(e){return[e[0]*(1-_),e[1]]}function qt(e){var t=[].concat(n.range(-180,180+e/2,e).map(Wt),n.range(180,-180-e/2,-e).map(Gt));return{type:`Polygon`,coordinates:[e===180?t.map(Kt):t]}}function Jt(){var e=4,n=t.geoProjectionMutator(Ut),r=n(e),i=r.stream;return r.lobes=function(t){return arguments.length?n(e=+t):e},r.stream=function(n){var a=r.rotate(),o=i(n),s=(r.rotate([0,0]),i(n));return r.rotate(a),o.sphere=function(){t.geoStream(qt(180/e),s)},o},r.scale(239.75)}function Yt(e){var t=1+e,n=k(h(1/t)),i=2*j(y/(s=y+4*n*t)),s,c=.5*i*(t+j(e*(2+e))),l=e*e,u=t*t;function d(d,f){var p=1-h(f),m,g;if(p&&p<2){var _=b-f,x=25,S;do{var C=h(_),w=o(_),T=n+a(C,t-w),E=1+u-2*t*w;_-=S=(_-l*n-t*C+E*T-.5*p*s)/(2*t*C*T)}while(r(S)>v&&--x>0);m=i*j(E),g=d*T/y}else m=i*(e+p),g=d*n/y;return[m*h(g),c-m*o(g)]}return d.invert=function(e,r){var o=e*e+(r-=c)*r,d=(1+u-o/(i*i))/(2*t),f=A(d),p=h(f),m=n+a(p,t-d);return[k(e/j(o))*y/m,k(1-2*(f-l*n-t*p+(1+u-2*t*d)*m)/s)]},d}function Xt(){var e=1,n=t.geoProjectionMutator(Yt),r=n(e);return r.ratio=function(t){return arguments.length?n(e=+t):e},r.scale(167.774).center([0,18.67])}var Zt=.7109889596207567,Qt=.0528035274542;function $t(e,t){return t>-Zt?(e=se(e,t),e[1]+=Qt,e):me(e,t)}$t.invert=function(e,t){return t>-Zt?se.invert(e,t-Qt):me.invert(e,t)};function en(){return t.geoProjection($t).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function tn(e,t){return r(t)>Zt?(e=se(e,t),e[1]-=t>0?Qt:-Qt,e):me(e,t)}tn.invert=function(e,t){return r(t)>Zt?se.invert(e,t+(t>0?Qt:-Qt)):me.invert(e,t)};function nn(){return t.geoProjection(tn).scale(152.63)}function rn(e,t,n,r){var i=j(4*y/(2*n+(1+e-t/2)*h(2*n)+(e+t)/2*h(4*n)+t/2*h(6*n))),a=j(r*h(n)*j((1+e*o(2*n)+t*o(4*n))/(1+e+t))),s=n*l(1);function c(n){return j(1+e*o(2*n)+t*o(4*n))}function l(r){var i=r*n;return(2*i+(1+e-t/2)*h(2*i)+(e+t)/2*h(4*i)+t/2*h(6*i))/n}function u(e){return c(e)*h(e)}var d=function(e,t){var r=n*te(l,s*h(t)/n,t/y);isNaN(r)&&(r=n*m(t));var u=i*c(r);return[u*a*e/y*o(r),u/a*h(r)]};return d.invert=function(e,t){var r=te(u,t*a/i);return[e*y/(o(r)*i*a*c(r)),k(n*l(r/n)/s)]},n===0&&(i=j(r/y),d=function(e,t){return[e*i,h(t)/i]},d.invert=function(e,t){return[e/i,k(t*i)]}),d}function an(){var e=1,n=0,r=45*D,i=2,a=t.geoProjectionMutator(rn),o=a(e,n,r,i);return o.a=function(t){return arguments.length?a(e=+t,n,r,i):e},o.b=function(t){return arguments.length?a(e,n=+t,r,i):n},o.psiMax=function(t){return arguments.length?a(e,n,r=+t*D,i):r*E},o.ratio=function(t){return arguments.length?a(e,n,r,i=+t):i},o.scale(180.739)}function on(e,t,n,r,i,a,o,s,c,l,u){if(u.nanEncountered)return NaN;var d,f,p,m,h,g,_,v,y,b;if(d=n-t,f=e(t+d*.25),p=e(n-d*.25),isNaN(f)){u.nanEncountered=!0;return}if(isNaN(p)){u.nanEncountered=!0;return}return m=d*(r+4*f+i)/12,h=d*(i+4*p+a)/12,g=m+h,b=(g-o)/15,l>c?(u.maxDepthCount++,g+b):Math.abs(b)<s?g+b:(_=t+d*.5,v=on(e,t,_,r,f,i,m,s*.5,c,l+1,u),isNaN(v)?(u.nanEncountered=!0,NaN):(y=on(e,_,n,i,p,a,h,s*.5,c,l+1,u),isNaN(y)?(u.nanEncountered=!0,NaN):v+y))}function sn(e,t,n,r,i){var a={maxDepthCount:0,nanEncountered:!1};r===void 0&&(r=1e-8),i===void 0&&(i=20);var o=e(t),s=e(.5*(t+n)),c=e(n);return on(e,t,n,o,s,c,(o+4*s+c)*(n-t)/6,r,i,1,a)}function cn(e,t,n){function i(n){return e+(1-e)*f(1-f(n,t),1/t)}function a(e){return sn(i,0,e,1e-4)}for(var o=1/a(1),s=1e3,c=1.00000001*o,l=[],u=0;u<=s;u++)l.push(a(u/s)*c);function d(e){var t=0,n=s,r=s>>1;do l[r]>e?n=r:t=r,r=t+n>>1;while(r>t);var i=l[r+1]-l[r];return i&&=(e-l[r+1])/i,(r+1+i)/s}var p=2*d(1)/y*o/n,g=function(e,t){var n=d(r(h(t))),a=i(n)*e;return n/=p,[a,t>=0?n:-n]};return g.invert=function(e,t){var n;return t*=p,r(t)<1&&(n=m(t)*k(a(r(t))*o)),[e/i(r(t)),n]},g}function ln(){var e=0,n=2.5,r=1.183136,i=t.geoProjectionMutator(cn),a=i(e,n,r);return a.alpha=function(t){return arguments.length?i(e=+t,n,r):e},a.k=function(t){return arguments.length?i(e,n=+t,r):n},a.gamma=function(t){return arguments.length?i(e,n,r=+t):r},a.scale(152.63)}function un(e,t){return r(e[0]-t[0])<_&&r(e[1]-t[1])<_}function dn(e,t){for(var n=-1,r=e.length,i=e[0],a,o,s,c=[];++n<r;){a=e[n],o=(a[0]-i[0])/t,s=(a[1]-i[1])/t;for(var l=0;l<t;++l)c.push([i[0]+l*o,i[1]+l*s]);i=a}return c.push(a),c}function fn(e){var t=[],r,i,a,o,s,c,l,u=e[0].length;for(l=0;l<u;++l)r=e[0][l],i=r[0][0],a=r[0][1],o=r[1][1],s=r[2][0],c=r[2][1],t.push(dn([[i+_,a+_],[i+_,o-_],[s-_,o-_],[s-_,c+_]],30));for(l=e[1].length-1;l>=0;--l)r=e[1][l],i=r[0][0],a=r[0][1],o=r[1][1],s=r[2][0],c=r[2][1],t.push(dn([[s-_,c-_],[s-_,o+_],[i+_,o+_],[i+_,a-_]],30));return{type:`Polygon`,coordinates:[n.merge(t)]}}function pn(e,n,r){var i,a;function o(t,r){for(var i=r<0?-1:1,a=n[+(r<0)],o=0,s=a.length-1;o<s&&t>a[o][2][0];++o);var c=e(t-a[o][1][0],r);return c[0]+=e(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],c}r?o.invert=r(o):e.invert&&(o.invert=function(t,r){for(var i=a[+(r<0)],s=n[+(r<0)],c=0,l=i.length;c<l;++c){var u=i[c];if(u[0][0]<=t&&t<u[1][0]&&u[0][1]<=r&&r<u[1][1]){var d=e.invert(t-e(s[c][1][0],0)[0],r);return d[0]+=s[c][1][0],un(o(d[0],d[1]),[t,r])?d:null}}});var s=t.geoProjection(o),c=s.stream;return s.stream=function(e){var n=s.rotate(),r=c(e),a=(s.rotate([0,0]),c(e));return s.rotate(n),r.sphere=function(){t.geoStream(i,a)},r},s.lobes=function(t){return arguments.length?(i=fn(t),n=t.map(function(e){return e.map(function(e){return[[e[0][0]*D,e[0][1]*D],[e[1][0]*D,e[1][1]*D],[e[2][0]*D,e[2][1]*D]]})}),a=n.map(function(t){return t.map(function(t){var n=e(t[0][0],t[0][1])[0],r=e(t[2][0],t[2][1])[0],i=e(t[1][0],t[0][1])[1],a=e(t[1][0],t[1][1])[1],o;return i>a&&(o=i,i=a,a=o),[[n,i],[r,a]]})}),s):n.map(function(e){return e.map(function(e){return[[e[0][0]*E,e[0][1]*E],[e[1][0]*E,e[1][1]*E],[e[2][0]*E,e[2][1]*E]]})})},n!=null&&s.lobes(n),s}var mn=[[[[-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 hn(){return pn(de,mn).scale(160.857)}var gn=[[[[-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 _n(){return pn(tn,gn).scale(152.63)}var vn=[[[[-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 yn(){return pn(se,vn).scale(169.529)}var bn=[[[[-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 xn(){return pn(se,bn).scale(169.529).rotate([20,0])}var Sn=[[[[-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 Cn(){return pn($t,Sn,ne).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var wn=[[[[-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 Tn(){return pn(me,wn).scale(152.63).rotate([-20,0])}function En(e,t){return[3/T*e*j(y*y/3-t*t),t]}En.invert=function(e,t){return[T/3*e/j(y*y/3-t*t),t]};function Dn(){return t.geoProjection(En).scale(158.837)}function On(e){function t(t,n){if(r(r(n)-b)<_)return[0,n<0?-2:2];var i=h(n),a=f((1+i)/(1-i),e/2),s=.5*(a+1/a)+o(t*=e);return[2*h(t)/s,(a-1/a)/s]}return t.invert=function(t,n){var i=r(n);if(r(i-2)<_)return t?null:[0,m(n)*b];if(i>2)return null;t/=2,n/=2;var o=t*t,s=n*n,c=2*n/(1+o+s);return c=f((1+c)/(1-c),1/e),[a(2*t,1-o-s)/e,k((c-1)/(c+1))]},t}function kn(){var e=.5,n=t.geoProjectionMutator(On),r=n(e);return r.spacing=function(t){return arguments.length?n(e=+t):e},r.scale(124.75)}var An=y/C;function jn(e,t){return[e*(1+j(o(t)))/2,t/(o(t/2)*o(e/6))]}jn.invert=function(e,t){var n=r(e),i=r(t),a=_,s=b;i<An?s*=i/An:a+=6*A(An/i);for(var c=0;c<25;c++){var l=h(s),u=j(o(s)),d=h(s/2),f=o(s/2),p=h(a/6),m=o(a/6),g=.5*a*(1+u)-n,v=s/(f*m)-i,y=u?-.25*a*l/u:0,x=.5*(1+u),S=(1+.5*s*d/f)/(f*m),C=s/f*(p/6)/(m*m),w=y*C-S*x,T=(g*C-v*x)/w,E=(v*y-g*S)/w;if(s-=T,a-=E,r(T)<_&&r(E)<_)break}return[e<0?-a:a,t<0?-s:s]};function Mn(){return t.geoProjection(jn).scale(97.2672)}function Nn(e,t){var n=e*e,r=t*t;return[e*(.975534+r*(-.119161+n*-.0143059+r*-.0547009)),t*(1.00384+n*(.0802894+r*-.02855+n*199025e-9)+r*(.0998909+r*-.0491032))]}Nn.invert=function(e,t){var n=m(e)*y,i=t/2,a=50;do{var o=n*n,s=i*i,c=n*i,l=n*(.975534+s*(-.119161+o*-.0143059+s*-.0547009))-e,u=i*(1.00384+o*(.0802894+s*-.02855+o*199025e-9)+s*(.0998909+s*-.0491032))-t,d=.975534-s*(.119161+3*o*.0143059+s*.0547009),f=-c*(2*.119161+4*.0547009*s+2*.0143059*o),p=c*(2*.0802894+4*199025e-9*o+2*-.02855*s),h=1.00384+o*(.0802894+199025e-9*o)+s*(3*(.0998909-.02855*o)-5*.0491032*s),g=f*p-h*d,v=(u*f-l*h)/g,b=(l*p-u*d)/g;n-=v,i-=b}while((r(v)>_||r(b)>_)&&--a>0);return a&&[n,i]};function Pn(){return t.geoProjection(Nn).scale(139.98)}function Fn(e,t){return[h(e)/o(t),g(t)*o(e)]}Fn.invert=function(e,t){var n=e*e,r=t*t+1,i=n+r,a=e?S*j((i-j(i*i-4*n))/n):1/j(r);return[k(e*a),m(t)*A(a)]};function In(){return t.geoProjection(Fn).scale(144.049).clipAngle(89.999)}function Ln(e){var t=o(e),n=g(x+e/2);function i(i,a){var o=a-e,s=r(o)<_?i*t:r(s=x+a/2)<_||r(r(s)-b)<_?0:i*o/l(g(s)/n);return[s,o]}return i.invert=function(i,a){var o,s=a+e;return[r(a)<_?i/t:r(o=x+s/2)<_||r(r(o)-b)<_?0:i*l(g(o)/n)/a,s]},i}function Rn(){return pe(Ln).parallel(40).scale(158.837)}function zn(e,t){return[e,1.25*l(g(x+.4*t))]}zn.invert=function(e,t){return[e,2.5*i(s(.8*t))-.625*y]};function Bn(){return t.geoProjection(zn).scale(108.318)}function Vn(e){var t=e.length-1;function n(n,r){for(var i=o(r),a=2/(1+i*o(n)),s=a*i*h(n),c=a*h(r),l=t,u=e[l],d=u[0],f=u[1],p;--l>=0;)u=e[l],d=u[0]+s*(p=d)-c*f,f=u[1]+s*f+c*p;return d=s*(p=d)-c*f,f=s*f+c*p,[d,f]}return n.invert=function(n,s){var c=20,l=n,u=s;do{for(var d=t,f=e[d],p=f[0],m=f[1],g=0,v=0,y;--d>=0;)f=e[d],g=p+l*(y=g)-u*v,v=m+l*v+u*y,p=f[0]+l*(y=p)-u*m,m=f[1]+l*m+u*y;g=p+l*(y=g)-u*v,v=m+l*v+u*y,p=l*(y=p)-u*m-n,m=l*m+u*y-s;var b=g*g+v*v,x,S;l-=x=(p*g+m*v)/b,u-=S=(m*g-p*v)/b}while(r(x)+r(S)>_*_&&--c>0);if(c){var C=j(l*l+u*u),w=2*i(C*.5),T=h(w);return[a(l*T,C*o(w)),C?k(u*T/C):0]}},n}var Hn=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Un=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Wn=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Gn=[[.9245,0],[0,0],[.01943,0]],Kn=[[.721316,0],[0,0],[-.00881625,-.00617325]];function qn(){return Qn(Hn,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Jn(){return Qn(Un,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Yn(){return Qn(Wn,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Xn(){return Qn(Gn,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Zn(){return Qn(Kn,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Qn(e,n){var r=t.geoProjection(Vn(e)).rotate(n).clipAngle(90),i=t.geoRotation(n),a=r.center;return delete r.rotate,r.center=function(e){return arguments.length?a(i(e)):i.invert(a())},r}var $n=j(6),er=j(7);function tr(e,t){var n=k(7*h(t)/(3*$n));return[$n*e*(2*o(2*n/3)-1)/er,9*h(n/3)/er]}tr.invert=function(e,t){var n=3*k(t*er/9);return[e*er/($n*(2*o(2*n/3)-1)),k(h(n)*3*$n/7)]};function nr(){return t.geoProjection(tr).scale(164.859)}function rr(e,t){for(var n=(1+S)*h(t),i=t,a=0,s;a<25&&(i-=s=(h(i/2)+h(i)-n)/(.5*o(i/2)+o(i)),!(r(s)<_));a++);return[e*(1+2*o(i)/o(i/2))/(3*C),2*j(3)*h(i/2)/j(2+C)]}rr.invert=function(e,t){var n=t*j(2+C)/(2*j(3)),r=2*k(n);return[3*C*e/(1+2*o(r)/o(r/2)),k((n+h(r))/(1+S))]};function ir(){return t.geoProjection(rr).scale(188.209)}function ar(e,t){for(var n=j(6/(4+y)),i=(1+y/4)*h(t),a=t/2,s=0,c;s<25&&(a-=c=(a/2+h(a)-i)/(.5+o(a)),!(r(c)<_));s++);return[n*(.5+o(a))*e/1.5,n*a]}ar.invert=function(e,t){var n=j(6/(4+y)),i=t/n;return r(r(i)-b)<_&&(i=i<0?-b:b),[1.5*e/(n*(.5+o(i))),k((i/2+h(i))/(1+y/4))]};function or(){return t.geoProjection(ar).scale(166.518)}function sr(e,t){var n=t*t,r=n*n,i=n*r;return[e*(.84719-.13063*n+i*i*(-.04515+.05494*n-.02326*r+.00331*i)),t*(1.01183+r*r*(-.02625+.01926*n-.00396*r))]}sr.invert=function(e,t){var n=t,i=25,a,o,s,c;do o=n*n,s=o*o,n-=a=(n*(1.01183+s*s*(-.02625+.01926*o-.00396*s))-t)/(1.01183+s*s*(9*-.02625+11*.01926*o+13*-.00396*s));while(r(a)>v&&--i>0);return o=n*n,s=o*o,c=o*s,[e/(.84719-.13063*o+c*c*(-.04515+.05494*o-.02326*s+.00331*c)),n]};function cr(){return t.geoProjection(sr).scale(175.295)}function lr(e,t){return[e*(1+o(t))/2,2*(t-g(t/2))]}lr.invert=function(e,t){for(var n=t/2,i=0,a=1/0;i<10&&r(a)>_;++i){var s=o(t/2);t-=a=(t-g(t/2)-n)/(1-.5/(s*s))}return[2*e/(1+o(t)),t]};function ur(){return t.geoProjection(lr).scale(152.63)}var dr=[[[[-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 fr(){return pn(Z(1/0),dr).rotate([20,0]).scale(152.63)}function pr(e,t){var n=h(t),i=o(t),a=m(e);if(e===0||r(t)===b)return[0,t];if(t===0)return[e,0];if(r(e)===b)return[e*i,b*n];var s=y/(2*e)-2*e/y,c=2*t/y,l=(1-c*c)/(n-c),u=s*s,d=l*l,f=1+u/d,p=1+d/u,g=(s*n/l-s/2)/f,_=(d*n/u+l/2)/p,v=g*g+i*i/f,x=_*_-(d*n*n/u+l*n-1)/p;return[b*(g+j(v)*a),b*(_+j(x<0?0:x)*m(-t*s)*a)]}pr.invert=function(e,t){e/=b,t/=b;var n=e*e,r=n+t*t,i=y*y;return[e?(r-1+j((1-r)*(1-r)+4*n))/(2*e)*b:0,te(function(e){return r*(y*h(e)-2*e)*y+4*e*e*(t-h(e))+2*y*e-i*t},0)]};function mr(){return t.geoProjection(pr).scale(127.267)}var hr=1.0148,gr=.23185,_r=-.14499,vr=.02406,yr=hr,br=5*gr,xr=7*_r,Sr=9*vr,Cr=1.790857183;function wr(e,t){var n=t*t;return[e,t*(hr+n*n*(gr+n*(_r+vr*n)))]}wr.invert=function(e,t){t>Cr?t=Cr:t<-Cr&&(t=-Cr);var n=t,i;do{var a=n*n;n-=i=(n*(hr+a*a*(gr+a*(_r+vr*a)))-t)/(yr+a*a*(br+a*(xr+Sr*a)))}while(r(i)>_);return[e,n]};function Tr(){return t.geoProjection(wr).scale(139.319)}function Er(e,t){if(r(t)<_)return[e,0];var n=g(t),i=e*h(t);return[h(i)/n,t+(1-o(i))/n]}Er.invert=function(e,t){if(r(t)<_)return[e,0];var n=e*e+t*t,i=t*.5,a=10,s;do{var c=g(i),l=1/o(i),u=n-2*t*i+i*i;i-=s=(c*u+2*(i-t))/(2+u*l*l+2*(i-t)*c)}while(r(s)>_&&--a>0);return c=g(i),[(r(t)<r(i+1/c)?k(e*c):m(t)*m(e)*(A(r(e*c))+b))/h(i),i]};function Dr(){return t.geoProjection(Er).scale(103.74)}function Or(e,t){var n=jr(e[1],e[0]),r=jr(t[1],t[0]),i=Nr(n,r),a=Mr(n)/Mr(r);return Ar([1,0,e[0][0],0,1,e[0][1]],Ar([a,0,0,0,a,0],Ar([o(i),h(i),0,-h(i),o(i),0],[1,0,-t[0][0],0,1,-t[0][1]])))}function kr(e){var t=1/(e[0]*e[4]-e[1]*e[3]);return[t*e[4],-t*e[1],t*(e[1]*e[5]-e[2]*e[4]),-t*e[3],t*e[0],t*(e[2]*e[3]-e[0]*e[5])]}function Ar(e,t){return[e[0]*t[0]+e[1]*t[3],e[0]*t[1]+e[1]*t[4],e[0]*t[2]+e[1]*t[5]+e[2],e[3]*t[0]+e[4]*t[3],e[3]*t[1]+e[4]*t[4],e[3]*t[2]+e[4]*t[5]+e[5]]}function jr(e,t){return[e[0]-t[0],e[1]-t[1]]}function Mr(e){return j(e[0]*e[0]+e[1]*e[1])}function Nr(e,t){return a(e[0]*t[1]-e[1]*t[0],e[0]*t[0]+e[1]*t[1])}function Pr(e,n,r){i(e,{transform:null});function i(e,t){if(e.edges=Rr(e.face),t.face){var n=e.shared=Lr(e.face,t.face),r=Or(n.map(t.project),n.map(e.project));e.transform=t.transform?Ar(t.transform,r):r;for(var a=t.edges,o=0,s=a.length;o<s;++o)Ir(n[0],a[o][1])&&Ir(n[1],a[o][0])&&(a[o]=e),Ir(n[0],a[o][0])&&Ir(n[1],a[o][1])&&(a[o]=e);for(a=e.edges,o=0,s=a.length;o<s;++o)Ir(n[0],a[o][0])&&Ir(n[1],a[o][1])&&(a[o]=t),Ir(n[0],a[o][1])&&Ir(n[1],a[o][0])&&(a[o]=t)}else e.transform=t.transform;return e.children&&e.children.forEach(function(t){i(t,e)}),e}function a(e,t){var r=n(e,t),i=r.project([e*E,t*E]),a;return(a=r.transform)?[a[0]*i[0]+a[1]*i[1]+a[2],-(a[3]*i[0]+a[4]*i[1]+a[5])]:(i[1]=-i[1],i)}zr(e)&&(a.invert=function(t,n){var r=o(e,[t,-n]);return r&&(r[0]*=D,r[1]*=D,r)});function o(e,t){var n=e.project.invert,r=e.transform,i=t;if(r&&(r=kr(r),i=[r[0]*i[0]+r[1]*i[1]+r[2],r[3]*i[0]+r[4]*i[1]+r[5]]),n&&e===s(a=n(i)))return a;for(var a,c=e.children,l=0,u=c&&c.length;l<u;++l)if(a=o(c[l],t))return a}function s(e){return n(e[0]*D,e[1]*D)}var c=t.geoProjection(a),l=c.stream;return c.stream=function(t){var n=c.rotate(),r=l(t),i=(c.rotate([0,0]),l(t));return c.rotate(n),r.sphere=function(){i.polygonStart(),i.lineStart(),Fr(i,e),i.lineEnd(),i.polygonEnd()},r},c.angle(r==null?-30:r*E)}function Fr(e,n,i){var a,o=n.edges,s=o.length,c,l={type:`MultiPoint`,coordinates:n.face},u=n.face.filter(function(e){return r(e[1])!==90}),d=t.geoBounds({type:`MultiPoint`,coordinates:u}),f=!1,p=-1,m=d[1][0]-d[0][0],h=m===180||m===360?[(d[0][0]+d[1][0])/2,(d[0][1]+d[1][1])/2]:t.geoCentroid(l);if(i)for(;++p<s&&o[p]!==i;);++p;for(var g=0;g<s;++g)c=o[(g+p)%s],Array.isArray(c)?(f||=(e.point((a=t.geoInterpolate(c[0],h)(_))[0],a[1]),!0),e.point((a=t.geoInterpolate(c[1],h)(_))[0],a[1])):(f=!1,c!==i&&Fr(e,c,n))}function Ir(e,t){return e&&t&&e[0]===t[0]&&e[1]===t[1]}function Lr(e,t){for(var n,r,i=e.length,a=null,o=0;o<i;++o){n=e[o];for(var s=t.length;--s>=0;)if(r=t[s],n[0]===r[0]&&n[1]===r[1]){if(a)return[a,n];a=n}}}function Rr(e){for(var t=e.length,n=[],r=e[t-1],i=0;i<t;++i)n.push([r,r=e[i]]);return n}function zr(e){return e.project.invert||e.children&&e.children.some(zr)}var Br=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],Vr=[[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(e){return e.map(function(e){return Br[e]})});function Hr(e){e||=function(e){var n=t.geoCentroid({type:`MultiPoint`,coordinates:e});return t.geoGnomonic().scale(1).translate([0,0]).rotate([-n[0],-n[1]])};var n=Vr.map(function(t){return{face:t,project:e(t)}});return[-1,0,0,1,0,1,4,5].forEach(function(e,t){var r=n[e];r&&(r.children||=[]).push(n[t])}),Pr(n[0],function(e,t){return n[e<-y/2?t<0?6:4:e<0?t<0?2:0:e<y/2?t<0?3:1:t<0?7:5]}).angle(-30).scale(101.858).center([0,45])}var Ur=2/j(3);function Wr(e,t){var n=ke(e,t);return[n[0]*Ur,n[1]]}Wr.invert=function(e,t){return ke.invert(e/Ur,t)};function Gr(e){e||=function(e){var n=t.geoCentroid({type:`MultiPoint`,coordinates:e});return t.geoProjection(Wr).translate([0,0]).scale(1).rotate(n[1]>0?[-n[0],0]:[180-n[0],180])};var n=Vr.map(function(t){return{face:t,project:e(t)}});return[-1,0,0,1,0,1,4,5].forEach(function(e,t){var r=n[e];r&&(r.children||=[]).push(n[t])}),Pr(n[0],function(e,t){return n[e<-y/2?t<0?6:4:e<0?t<0?2:0:e<y/2?t<0?3:1:t<0?7:5]}).angle(-30).scale(121.906).center([0,48.5904])}function Kr(e){e||=function(e){var n=e.length===6?t.geoCentroid({type:`MultiPoint`,coordinates:e}):e[0];return t.geoGnomonic().scale(1).translate([0,0]).rotate([-n[0],-n[1]])};var n=Vr.map(function(e){for(var t=e.map(Xr),n=t.length,r=t[n-1],i,a=[],o=0;o<n;++o)i=t[o],a.push(Yr([r[0]*.9486832980505138+i[0]*.31622776601683794,r[1]*.9486832980505138+i[1]*.31622776601683794,r[2]*.9486832980505138+i[2]*.31622776601683794]),Yr([i[0]*.9486832980505138+r[0]*.31622776601683794,i[1]*.9486832980505138+r[1]*.31622776601683794,i[2]*.9486832980505138+r[2]*.31622776601683794])),r=i;return a}),r=[],i=[-1,0,0,1,0,1,4,5];n.forEach(function(e,t){for(var a=Vr[t],o=a.length,s=r[t]=[],c=0;c<o;++c)n.push([a[c],e[(c*2+2)%(2*o)],e[(c*2+1)%(2*o)]]),i.push(t),s.push(Jr(Xr(e[(c*2+2)%(2*o)]),Xr(e[(c*2+1)%(2*o)])))});var a=n.map(function(t){return{project:e(t),face:t}});i.forEach(function(e,t){var n=a[e];n&&(n.children||=[]).push(a[t])});function s(e,t){var n=o(t),i=[n*o(e),n*h(e),h(t)],s=e<-y/2?t<0?6:4:e<0?t<0?2:0:e<y/2?t<0?3:1:t<0?7:5,c=r[s];return a[qr(c[0],i)<0?8+3*s:qr(c[1],i)<0?8+3*s+1:qr(c[2],i)<0?8+3*s+2:s]}return Pr(a[0],s).angle(-30).scale(110.625).center([0,45])}function qr(e,t){for(var n=0,r=e.length,i=0;n<r;++n)i+=e[n]*t[n];return i}function Jr(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Yr(e){return[a(e[1],e[0])*E,k(u(-1,d(1,e[2])))*E]}function Xr(e){var t=e[0]*D,n=e[1]*D,r=o(n);return[r*o(t),r*h(t),h(n)]}function Zr(){}function Qr(e){if((n=e.length)<4)return!1;for(var t=0,n,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)r+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return r<=0}function $r(e,t){for(var n=t[0],r=t[1],i=!1,a=0,o=e.length,s=o-1;a<o;s=a++){var c=e[a],l=c[0],u=c[1],d=e[s],f=d[0],p=d[1];u>r^p>r&&n<(f-l)*(r-u)/(p-u)+l&&(i=!i)}return i}function ei(e,t){var n=t.stream,r;if(!n)throw Error(`invalid projection`);switch(e&&e.type){case`Feature`:r=ni;break;case`FeatureCollection`:r=ti;break;default:r=ii;break}return r(e,n)}function ti(e,t){return{type:`FeatureCollection`,features:e.features.map(function(e){return ni(e,t)})}}function ni(e,t){return{type:`Feature`,id:e.id,properties:e.properties,geometry:ii(e.geometry,t)}}function ri(e,t){return{type:`GeometryCollection`,geometries:e.geometries.map(function(e){return ii(e,t)})}}function ii(e,n){if(!e)return null;if(e.type===`GeometryCollection`)return ri(e,n);var r;switch(e.type){case`Point`:r=si;break;case`MultiPoint`:r=si;break;case`LineString`:r=ci;break;case`MultiLineString`:r=ci;break;case`Polygon`:r=li;break;case`MultiPolygon`:r=li;break;case`Sphere`:r=li;break;default:return null}return t.geoStream(e,n(r)),r.result()}var ai=[],oi=[],si={point:function(e,t){ai.push([e,t])},result:function(){var e=ai.length?ai.length<2?{type:`Point`,coordinates:ai[0]}:{type:`MultiPoint`,coordinates:ai}:null;return ai=[],e}},ci={lineStart:Zr,point:function(e,t){ai.push([e,t])},lineEnd:function(){ai.length&&(oi.push(ai),ai=[])},result:function(){var e=oi.length?oi.length<2?{type:`LineString`,coordinates:oi[0]}:{type:`MultiLineString`,coordinates:oi}:null;return oi=[],e}},li={polygonStart:Zr,lineStart:Zr,point:function(e,t){ai.push([e,t])},lineEnd:function(){var e=ai.length;if(e){do ai.push(ai[0].slice());while(++e<4);oi.push(ai),ai=[]}},polygonEnd:Zr,result:function(){if(!oi.length)return null;var e=[],t=[];return oi.forEach(function(n){Qr(n)?e.push([n]):t.push(n)}),t.forEach(function(t){var n=t[0];e.some(function(e){if($r(e[0],n))return e.push(t),!0})||e.push([t])}),oi=[],e.length?e.length>1?{type:`MultiPolygon`,coordinates:e}:{type:`Polygon`,coordinates:e[0]}:null}};function ui(e){var n=e(b,0)[0]-e(-b,0)[0];function i(t,i){var a=r(t)<b,o=e(a?t:t>0?t-y:t+y,i),s=(o[0]-o[1])*S,c=(o[0]+o[1])*S;if(a)return[s,c];var l=n*S,u=s>0^c>0?-1:1;return[u*s-m(c)*l,u*c-m(s)*l]}return e.invert&&(i.invert=function(t,i){var a=(t+i)*S,o=(i-t)*S,s=r(a)<.5*n&&r(o)<.5*n;if(!s){var c=n*S,l=a>0^o>0?-1:1,u=-l*t+(o>0?1:-1)*c,d=-l*i+(a>0?1:-1)*c;a=(-u-d)*S,o=(u-d)*S}var f=e.invert(a,o);return s||(f[0]+=a>0?y:-y),f}),t.geoProjection(i).rotate([-90,-90,45]).clipAngle(179.999)}function di(){return ui(Et).scale(176.423)}function fi(){return ui(Pt).scale(111.48)}function pi(e,t){if(!(0<=(t=+t)&&t<=20))throw Error(`invalid digits`);function n(e){var n=e.length,r=2,i=Array(n);for(i[0]=+e[0].toFixed(t),i[1]=+e[1].toFixed(t);r<n;)i[r]=e[r],++r;return i}function r(e){return e.map(n)}function i(e){for(var t=n(e[0]),r=[t],i=1;i<e.length;i++){var a=n(e[i]);(a.length>2||a[0]!=t[0]||a[1]!=t[1])&&(r.push(a),t=a)}return r.length===1&&e.length>1&&r.push(n(e[e.length-1])),r}function a(e){return e.map(i)}function o(e){if(e==null)return e;var t;switch(e.type){case`GeometryCollection`:t={type:`GeometryCollection`,geometries:e.geometries.map(o)};break;case`Point`:t={type:`Point`,coordinates:n(e.coordinates)};break;case`MultiPoint`:t={type:e.type,coordinates:r(e.coordinates)};break;case`LineString`:t={type:e.type,coordinates:i(e.coordinates)};break;case`MultiLineString`:case`Polygon`:t={type:e.type,coordinates:a(e.coordinates)};break;case`MultiPolygon`:t={type:`MultiPolygon`,coordinates:e.coordinates.map(a)};break;default:return e}return e.bbox!=null&&(t.bbox=e.bbox),t}function s(e){var t={type:`Feature`,properties:e.properties,geometry:o(e.geometry)};return e.id!=null&&(t.id=e.id),e.bbox!=null&&(t.bbox=e.bbox),t}if(e!=null)switch(e.type){case`Feature`:return s(e);case`FeatureCollection`:var c={type:`FeatureCollection`,features:e.features.map(s)};return e.bbox!=null&&(c.bbox=e.bbox),c;default:return o(e)}return e}function mi(e){var t=h(e);function n(n,r){var a=t?g(n*t/2)/t:n/2;if(!r)return[2*a,-e];var s=2*i(a*h(r)),c=1/g(r);return[h(s)*c,r+(1-o(s))*c-e]}return n.invert=function(n,a){if(r(a+=e)<_)return[t?2*i(t*n/2)/t:n,0];var s=n*n+a*a,c=0,l=10,u;do{var d=g(c),f=1/o(c),p=s-2*a*c+c*c;c-=u=(d*p+2*(c-a))/(2+p*f*f+2*(c-a)*d)}while(r(u)>_&&--l>0);var m=n*(d=g(c)),v=g(r(a)<r(c+1/d)?k(m)*.5:A(m)*.5+y/4)/h(c);return[t?2*i(t*v)/t:2*v,c]},n}function hi(){return pe(mi).scale(131.215)}var gi=[[.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]];gi.forEach(function(e){e[1]*=1.0144});function _i(e,t){var n=d(18,r(t)*36/y),i=c(n),a=n-i,o=(m=gi[i])[0],s=m[1],l=(m=gi[++i])[0],u=m[1],f=(m=gi[d(19,++i)])[0],p=m[1],m;return[e*(l+a*(f-o)/2+a*a*(f-2*l+o)/2),(t>0?b:-b)*(u+a*(p-s)/2+a*a*(p-2*u+s)/2)]}_i.invert=function(e,t){var n=t/b,i=n*90,a=d(18,r(i/5)),o=u(0,c(a));do{var s=gi[o][1],l=gi[o+1][1],f=gi[d(19,o+2)][1],p=f-s,m=f-2*l+s,h=2*(r(n)-l)/p,g=m/p,_=h*(1-g*h*(1-2*g*h));if(_>=0||o===1){i=(t>=0?5:-5)*(_+a);var y=50,x;do a=d(18,r(i)/5),o=c(a),_=a-o,s=gi[o][1],l=gi[o+1][1],f=gi[d(19,o+2)][1],i-=(x=(t>=0?b:-b)*(l+_*(f-s)/2+_*_*(f-2*l+s)/2)-t)*E;while(r(x)>v&&--y>0);break}}while(--o>=0);var S=gi[o][0],C=gi[o+1][0],w=gi[d(19,o+2)][0];return[e/(C+_*(w-S)/2+_*_*(w-2*C+S)/2),i*D]};function vi(){return t.geoProjection(_i).scale(152.63)}function yi(e){function t(t,n){var r=o(n),i=(e-1)/(e-r*o(t));return[i*r*h(t),i*h(n)]}return t.invert=function(t,n){var r=t*t+n*n,i=j(r),o=(e-j(1-r*(e+1)/(e-1)))/((e-1)/i+i/(e-1));return[a(t*o,i*j(1-o*o)),i?k(n*o/i):0]},t}function bi(e,t){var n=yi(e);if(!t)return n;var r=o(t),i=h(t);function a(t,a){var o=n(t,a),s=o[1],c=s*i/(e-1)+r;return[o[0]*r/c,s/c]}return a.invert=function(t,a){var o=(e-1)/(e-1-a*i);return n.invert(o*t,o*a*r)},a}function xi(){var e=2,n=0,r=t.geoProjectionMutator(bi),i=r(e,n);return i.distance=function(t){return arguments.length?r(e=+t,n):e},i.tilt=function(t){return arguments.length?r(e,n=t*D):n*E},i.scale(432.147).clipAngle(A(1/e)*E-1e-6)}var Si=1e-4,Ci=1e4,wi=-180,Ti=wi+Si,Ei=180,Di=Ei-Si,Oi=-90,ki=Oi+Si,Ai=90,ji=Ai-Si;function Mi(e){return e.length>0}function Ni(e){return Math.floor(e*Ci)/Ci}function Pi(e){return e===Oi||e===Ai?[0,e]:[wi,Ni(e)]}function Fi(e){var t=e[0],n=e[1],r=!1;return t<=Ti?(t=wi,r=!0):t>=Di&&(t=Ei,r=!0),n<=ki?(n=Oi,r=!0):n>=ji&&(n=Ai,r=!0),r?[t,n]:e}function Ii(e){return e.map(Fi)}function Li(e,t,n){for(var r=0,i=e.length;r<i;++r){var a=e[r].slice();n.push({index:-1,polygon:t,ring:a});for(var o=0,s=a.length;o<s;++o){var c=a[o],l=c[0],u=c[1];if(l<=Ti||l>=Di||u<=ki||u>=ji){a[o]=Fi(c);for(var d=o+1;d<s;++d){var f=a[d],p=f[0],m=f[1];if(p>Ti&&p<Di&&m>ki&&m<ji)break}if(d===o+1)continue;if(o){var h={index:-1,polygon:t,ring:a.slice(0,o+1)};h.ring[h.ring.length-1]=Pi(u),n[n.length-1]=h}else n.pop();if(d>=s)break;n.push({index:-1,polygon:t,ring:a=a.slice(d-1)}),a[0]=Pi(a[0][1]),o=-1,s=a.length}}}}function Ri(e){var t,n=e.length,r={},i={},a,o,s,c,l;for(t=0;t<n;++t){if(a=e[t],o=a.ring[0],c=a.ring[a.ring.length-1],o[0]===c[0]&&o[1]===c[1]){a.polygon.push(a.ring),e[t]=null;continue}a.index=t,r[o]=i[c]=a}for(t=0;t<n;++t)if(a=e[t],a){if(o=a.ring[0],c=a.ring[a.ring.length-1],s=i[o],l=r[c],delete r[o],delete i[c],o[0]===c[0]&&o[1]===c[1]){a.polygon.push(a.ring);continue}s?(delete i[o],delete r[s.ring[0]],s.ring.pop(),e[s.index]=null,a={index:-1,polygon:s.polygon,ring:s.ring.concat(a.ring)},s===l?a.polygon.push(a.ring):(a.index=n++,e.push(r[a.ring[0]]=i[a.ring[a.ring.length-1]]=a))):l?(delete r[c],delete i[l.ring[l.ring.length-1]],a.ring.pop(),a={index:n++,polygon:l.polygon,ring:a.ring.concat(l.ring)},e[l.index]=null,e.push(r[a.ring[0]]=i[a.ring[a.ring.length-1]]=a)):(a.ring.push(a.ring[0]),a.polygon.push(a.ring))}}function zi(e){var t={type:`Feature`,geometry:Bi(e.geometry)};return e.id!=null&&(t.id=e.id),e.bbox!=null&&(t.bbox=e.bbox),e.properties!=null&&(t.properties=e.properties),t}function Bi(e){if(e==null)return e;var t,n,r,i;switch(e.type){case`GeometryCollection`:t={type:`GeometryCollection`,geometries:e.geometries.map(Bi)};break;case`Point`:t={type:`Point`,coordinates:Fi(e.coordinates)};break;case`MultiPoint`:case`LineString`:t={type:e.type,coordinates:Ii(e.coordinates)};break;case`MultiLineString`:t={type:`MultiLineString`,coordinates:e.coordinates.map(Ii)};break;case`Polygon`:var a=[];Li(e.coordinates,a,n=[]),Ri(n),t={type:`Polygon`,coordinates:a};break;case`MultiPolygon`:n=[],r=-1,i=e.coordinates.length;for(var o=Array(i);++r<i;)Li(e.coordinates[r],o[r]=[],n);Ri(n),t={type:`MultiPolygon`,coordinates:o.filter(Mi)};break;default:return e}return e.bbox!=null&&(t.bbox=e.bbox),t}function Vi(e){if(e==null)return e;switch(e.type){case`Feature`:return zi(e);case`FeatureCollection`:var t={type:`FeatureCollection`,features:e.features.map(zi)};return e.bbox!=null&&(t.bbox=e.bbox),t;default:return Bi(e)}}function Hi(e,t){var n=g(t/2),r=h(x*n);return[e*(.74482-.34588*r*r),1.70711*n]}Hi.invert=function(e,t){var n=t/1.70711,r=h(x*n);return[e/(.74482-.34588*r*r),2*i(n)]};function Ui(){return t.geoProjection(Hi).scale(146.153)}function Wi(e,n,r){var i=t.geoInterpolate(n,r),a=i(.5),o=t.geoRotation([-a[0],-a[1]])(n),s=i.distance/2,c=-k(h(o[1]*D)/h(s)),l=[-a[0],-a[1],-(o[0]>0?y-c:c)*E],u=t.geoProjection(e(s)).rotate(l),d=t.geoRotation(l),f=u.center;return delete u.rotate,u.center=function(e){return arguments.length?f(d(e)):d.invert(f())},u.clipAngle(90)}function Gi(e){var n=o(e);function r(e,r){var i=t.geoGnomonicRaw(e,r);return i[0]*=n,i}return r.invert=function(e,r){return t.geoGnomonicRaw.invert(e/n,r)},r}function Ki(){return qi([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function qi(e,t){return Wi(Gi,e,t)}function Ji(e){if(!(e*=2))return t.geoAzimuthalEquidistantRaw;var n=-e/2,r=-n,i=e*e,s=g(r),c=.5/h(r);function l(t,a){var s=A(o(a)*o(t-n)),c=A(o(a)*o(t-r)),l=a<0?-1:1;return s*=s,c*=c,[(s-c)/(2*e),l*j(4*i*c-(i-s+c)*(i-s+c))/(2*e)]}return l.invert=function(e,t){var i=t*t,l=o(j(i+(d=e+n)*d)),u=o(j(i+(d=e+r)*d)),d,f;return[a(f=l-u,d=(l+u)*s),(t<0?-1:1)*A(j(d*d+f*f)*c)]},l}function Yi(){return Xi([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function Xi(e,t){return Wi(Ji,e,t)}function Zi(e,t){if(r(t)<_)return[e,0];var n=r(t/b),i=k(n);if(r(e)<_||r(r(t)-b)<_)return[0,m(t)*y*g(i/2)];var a=o(i),s=r(y/e-e/y)/2,c=s*s,l=a/(n+a-1),u=l*(2/n-1),d=u*u,f=d+c,p=l-d,h=c+l;return[m(e)*y*(s*p+j(c*p*p-f*(l*l-d)))/f,m(t)*y*(u*h-s*j((c+1)*f-h*h))/f]}Zi.invert=function(e,t){if(r(t)<_)return[e,0];if(r(e)<_)return[0,b*h(2*i(t/y))];var n=(e/=y)*e,a=(t/=y)*t,s=n+a,c=s*s,l=-r(t)*(1+s),u=l-2*a+n,d=-2*l+1+2*a+c,f=a/d+(2*u*u*u/(d*d*d)-9*l*u/(d*d))/27,p=(l-u*u/(3*d))/d,g=2*j(-p/3),v=A(3*f/(p*g))/3;return[y*(s-1+j(1+2*(n-a)+c))/(2*e),m(t)*y*(-g*o(v+y/3)-u/(3*d))]};function Qi(){return t.geoProjection(Zi).scale(79.4183)}function $i(e,t){if(r(t)<_)return[e,0];var n=r(t/b),i=k(n);if(r(e)<_||r(r(t)-b)<_)return[0,m(t)*y*g(i/2)];var a=o(i),s=r(y/e-e/y)/2,c=s*s,l=a*(j(1+c)-s*a)/(1+c*n*n);return[m(e)*y*l,m(t)*y*j(1-l*(2*s+l))]}$i.invert=function(e,t){if(!e)return[0,b*h(2*i(t/y))];var n=r(e/y),o=(1-n*n-(t/=y)*t)/(2*n),s=j(o*o+1);return[m(e)*y*(s-o),m(t)*b*h(2*a(j((1-2*o*n)*(o+s)-n),j(s+o+n)))]};function ea(){return t.geoProjection($i).scale(79.4183)}function ta(e,t){if(r(t)<_)return[e,0];var n=t/b,i=k(n);if(r(e)<_||r(r(t)-b)<_)return[0,y*g(i/2)];var a=(y/e-e/y)/2,s=n/(1+o(i));return[y*(m(e)*j(a*a+1-s*s)-a),y*s]}ta.invert=function(e,t){if(!t)return[e,0];var n=t/y,r=(y*y*(1-n*n)-e*e)/(2*y*e);return[e?y*(m(e)*j(r*r+1)-r):0,b*h(2*i(n))]};function na(){return t.geoProjection(ta).scale(79.4183)}function ra(e,t){if(!t)return[e,0];var n=r(t);if(!e||n===b)return[0,t];var i=n/b,a=i*i,o=(8*i-a*(a+2)-5)/(2*a*(i-1)),s=o*o,c=i*o,l=a+s+2*c,u=i+3*o,d=e/b,f=d+1/d,p=m(r(e)-b)*j(f*f-4),h=p*p,g=l*(a+s*h-1)+(1-a)*(a*(u*u+4*s)+12*c*s+4*s*s),_=(p*(l+s-1)+2*j(g))/(4*l+h);return[m(e)*b*_,m(t)*b*j(1+p*r(_)-_*_)]}ra.invert=function(e,t){var n;if(!e||!t)return[e,t];t/=y;var i=m(e)*e/b,a=(i*i-1+4*t*t)/r(i),o=a*a,s=2*t,c=50;do{var l=s*s,u=(8*s-l*(l+2)-5)/(2*l*(s-1)),d=(3*s-l*s-10)/(2*l*s),f=u*u,p=s*u,h=s+u,g=h*h,v=s+3*u,x=g*(l+f*o-1)+(1-l)*(l*(v*v+4*f)+f*(12*p+4*f)),S=-2*h*(4*p*f+(1-4*l+3*l*l)*(1+d)+f*(-6+14*l-o+(-8+8*l-2*o)*d)+p*(-8+12*l+(-10+10*l-o)*d)),C=j(x),w=a*(g+f-1)+2*C-i*(4*g+o),T=a*(2*u*d+2*h*(1+d))+S/C-8*h*(a*(-1+f+g)+2*C)*(1+d)/(o+4*g);s-=n=w/T}while(n>_&&--c>0);return[m(e)*(j(a*a+4)+a)*y/4,b*s]};function ia(){return t.geoProjection(ra).scale(127.16)}function aa(e,t,n,r,i){function s(a,s){var c=n*h(r*s),l=j(1-c*c),u=j(2/(1+l*o(a*=i)));return[e*l*u*h(a),t*c*u]}return s.invert=function(o,s){var c=o/e,l=s/t,u=j(c*c+l*l),d=2*k(u/2);return[a(o*g(d),e*u)/i,u&&k(s*h(d)/(t*n*u))/r]},s}function oa(e,t,n,r){var i=y/3;e=u(e,_),t=u(t,_),e=d(e,b),t=d(t,y-_),n=u(n,0),n=d(n,100-_),r=u(r,_);var a=n/100+1,s=r/100,c=A(a*o(i))/i,l=h(e)/h(c*b),f=t/y,p=j(s*h(e/2)/h(t/2));return aa(p/j(f*l*c),1/(p*j(f*l*c)),l,c,f)}function sa(){var e=65*D,n=60*D,r=20,i=200,a=t.geoProjectionMutator(oa),o=a(e,n,r,i);return o.poleline=function(t){return arguments.length?a(e=+t*D,n,r,i):e*E},o.parallels=function(t){return arguments.length?a(e,n=+t*D,r,i):n*E},o.inflation=function(t){return arguments.length?a(e,n,r=+t,i):r},o.ratio=function(t){return arguments.length?a(e,n,r,i=+t):i},o.scale(163.775)}function ca(){return sa().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var la=4*y+3*j(3),ua=2*j(2*y*j(3)/la),da=oe(ua*j(3)/y,ua,la/6);function fa(){return t.geoProjection(da).scale(176.84)}function pa(e,t){return[e*j(1-3*t*t/(y*y)),t]}pa.invert=function(e,t){return[e/j(1-3*t*t/(y*y)),t]};function ma(){return t.geoProjection(pa).scale(152.63)}function ha(e,t){var n=o(t),r=o(e)*n,i=1-r,s=o(e=a(h(e)*n,-h(t))),c=h(e);return n=j(1-r*r),[c*n-s*i,-s*n-c*i]}ha.invert=function(e,t){var n=(e*e+t*t)/-2,r=j(-n*(2+n)),i=t*n+e*r,o=e*n-t*r,s=j(o*o+i*i);return[a(r*i,s*(1+n)),s?-k(r*o/s):0]};function ga(){return t.geoProjection(ha).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)}function _a(e,t){var n=z(e,t);return[(n[0]+e/b)/2,(n[1]+t)/2]}_a.invert=function(e,t){var n=e,i=t,a=25;do{var s=o(i),c=h(i),l=h(2*i),u=c*c,d=s*s,f=h(n),p=o(n/2),m=h(n/2),g=m*m,v=1-d*p*p,y=v?A(s*p)*j(x=1/v):x=0,x,S=.5*(2*y*s*m+n/b)-e,C=.5*(y*c+i)-t,w=.5*x*(d*g+y*s*p*u)+.5/b,T=x*(f*l/4-y*c*m),E=.125*x*(l*m-y*c*d*f),D=.5*x*(u*p+y*g*s)+.5,O=T*E-D*w,k=(C*T-S*D)/O,M=(S*E-C*w)/O;n-=k,i-=M}while((r(k)>_||r(M)>_)&&--a>0);return[n,i]};function va(){return t.geoProjection(_a).scale(158.837)}e.geoNaturalEarth=t.geoNaturalEarth1,e.geoNaturalEarthRaw=t.geoNaturalEarth1Raw,e.geoAiry=R,e.geoAiryRaw=L,e.geoAitoff=B,e.geoAitoffRaw=z,e.geoArmadillo=H,e.geoArmadilloRaw=V,e.geoAugust=W,e.geoAugustRaw=U,e.geoBaker=J,e.geoBakerRaw=q,e.geoBerghaus=X,e.geoBerghausRaw=Y,e.geoBertin1953=ie,e.geoBertin1953Raw=re,e.geoBoggs=fe,e.geoBoggsRaw=de,e.geoBonne=_e,e.geoBonneRaw=ge,e.geoBottomley=ye,e.geoBottomleyRaw=ve,e.geoBromley=xe,e.geoBromleyRaw=be,e.geoChamberlin=Oe,e.geoChamberlinRaw=Te,e.geoChamberlinAfrica=De,e.geoCollignon=Ae,e.geoCollignonRaw=ke,e.geoCraig=Me,e.geoCraigRaw=je,e.geoCraster=Fe,e.geoCrasterRaw=Pe,e.geoCylindricalEqualArea=Le,e.geoCylindricalEqualAreaRaw=Ie,e.geoCylindricalStereographic=ze,e.geoCylindricalStereographicRaw=Re,e.geoEckert1=Ve,e.geoEckert1Raw=Be,e.geoEckert2=Ue,e.geoEckert2Raw=He,e.geoEckert3=Ge,e.geoEckert3Raw=We,e.geoEckert4=qe,e.geoEckert4Raw=Ke,e.geoEckert5=Ye,e.geoEckert5Raw=Je,e.geoEckert6=Ze,e.geoEckert6Raw=Xe,e.geoEisenlohr=et,e.geoEisenlohrRaw=$e,e.geoFahey=rt,e.geoFaheyRaw=nt,e.geoFoucaut=at,e.geoFoucautRaw=it,e.geoFoucautSinusoidal=st,e.geoFoucautSinusoidalRaw=ot,e.geoGilbert=ut,e.geoGingery=pt,e.geoGingeryRaw=$,e.geoGinzburg4=gt,e.geoGinzburg4Raw=ht,e.geoGinzburg5=vt,e.geoGinzburg5Raw=_t,e.geoGinzburg6=bt,e.geoGinzburg6Raw=yt,e.geoGinzburg8=St,e.geoGinzburg8Raw=xt,e.geoGinzburg9=wt,e.geoGinzburg9Raw=Ct,e.geoGringorten=kt,e.geoGringortenRaw=Et,e.geoGuyou=Lt,e.geoGuyouRaw=Pt,e.geoHammer=ee,e.geoHammerRaw=Z,e.geoHammerRetroazimuthal=Bt,e.geoHammerRetroazimuthalRaw=Rt,e.geoHealpix=Jt,e.geoHealpixRaw=Ut,e.geoHill=Xt,e.geoHillRaw=Yt,e.geoHomolosine=nn,e.geoHomolosineRaw=tn,e.geoHufnagel=an,e.geoHufnagelRaw=rn,e.geoHyperelliptical=ln,e.geoHyperellipticalRaw=cn,e.geoInterrupt=pn,e.geoInterruptedBoggs=hn,e.geoInterruptedHomolosine=_n,e.geoInterruptedMollweide=yn,e.geoInterruptedMollweideHemispheres=xn,e.geoInterruptedSinuMollweide=Cn,e.geoInterruptedSinusoidal=Tn,e.geoKavrayskiy7=Dn,e.geoKavrayskiy7Raw=En,e.geoLagrange=kn,e.geoLagrangeRaw=On,e.geoLarrivee=Mn,e.geoLarriveeRaw=jn,e.geoLaskowski=Pn,e.geoLaskowskiRaw=Nn,e.geoLittrow=In,e.geoLittrowRaw=Fn,e.geoLoximuthal=Rn,e.geoLoximuthalRaw=Ln,e.geoMiller=Bn,e.geoMillerRaw=zn,e.geoModifiedStereographic=Qn,e.geoModifiedStereographicRaw=Vn,e.geoModifiedStereographicAlaska=qn,e.geoModifiedStereographicGs48=Jn,e.geoModifiedStereographicGs50=Yn,e.geoModifiedStereographicMiller=Xn,e.geoModifiedStereographicLee=Zn,e.geoMollweide=ce,e.geoMollweideRaw=se,e.geoMtFlatPolarParabolic=nr,e.geoMtFlatPolarParabolicRaw=tr,e.geoMtFlatPolarQuartic=ir,e.geoMtFlatPolarQuarticRaw=rr,e.geoMtFlatPolarSinusoidal=or,e.geoMtFlatPolarSinusoidalRaw=ar,e.geoNaturalEarth2=cr,e.geoNaturalEarth2Raw=sr,e.geoNellHammer=ur,e.geoNellHammerRaw=lr,e.geoInterruptedQuarticAuthalic=fr,e.geoNicolosi=mr,e.geoNicolosiRaw=pr,e.geoPatterson=Tr,e.geoPattersonRaw=wr,e.geoPolyconic=Dr,e.geoPolyconicRaw=Er,e.geoPolyhedral=Pr,e.geoPolyhedralButterfly=Hr,e.geoPolyhedralCollignon=Gr,e.geoPolyhedralWaterman=Kr,e.geoProject=ei,e.geoGringortenQuincuncial=di,e.geoPeirceQuincuncial=fi,e.geoPierceQuincuncial=fi,e.geoQuantize=pi,e.geoQuincuncial=ui,e.geoRectangularPolyconic=hi,e.geoRectangularPolyconicRaw=mi,e.geoRobinson=vi,e.geoRobinsonRaw=_i,e.geoSatellite=xi,e.geoSatelliteRaw=bi,e.geoSinuMollweide=en,e.geoSinuMollweideRaw=$t,e.geoSinusoidal=he,e.geoSinusoidalRaw=me,e.geoStitch=Vi,e.geoTimes=Ui,e.geoTimesRaw=Hi,e.geoTwoPointAzimuthal=qi,e.geoTwoPointAzimuthalRaw=Gi,e.geoTwoPointAzimuthalUsa=Ki,e.geoTwoPointEquidistant=Xi,e.geoTwoPointEquidistantRaw=Ji,e.geoTwoPointEquidistantUsa=Yi,e.geoVanDerGrinten=Qi,e.geoVanDerGrintenRaw=Zi,e.geoVanDerGrinten2=ea,e.geoVanDerGrinten2Raw=$i,e.geoVanDerGrinten3=na,e.geoVanDerGrinten3Raw=ta,e.geoVanDerGrinten4=ia,e.geoVanDerGrinten4Raw=ra,e.geoWagner=sa,e.geoWagner7=ca,e.geoWagnerRaw=oa,e.geoWagner4=fa,e.geoWagner4Raw=da,e.geoWagner6=ma,e.geoWagner6Raw=pa,e.geoWiechel=ga,e.geoWiechelRaw=ha,e.geoWinkel3=va,e.geoWinkel3Raw=_a,Object.defineProperty(e,`__esModule`,{value:!0})})}),Ug=h((e,t)=>{var n=S(),r=$(),i=Ke(),a=Math.PI/180,o=180/Math.PI,s={cursor:`pointer`},c={cursor:`auto`};function l(e,t){var n=e.projection,r;return r=t._isScoped?f:t._isClipped?m:p,r(e,n)}t.exports=l;function u(e,t){return n.behavior.zoom().translate(t.translate()).scale(t.scale())}function d(e,t,n){var a=e.id,o=e.graphDiv,s=o.layout,c=s[a],l=o._fullLayout,u=l[a],d={},f={};function p(e,t){d[a+`.`+e]=r.nestedProperty(c,e).get(),i.call(`_storeDirectGUIEdit`,s,l._preGUI,d);var n=r.nestedProperty(u,e);n.get()!==t&&(n.set(t),r.nestedProperty(c,e).set(t),f[a+`.`+e]=t)}n(p),p(`projection.scale`,t.scale()/e.fitScale),p(`fitbounds`,!1),o.emit(`plotly_relayout`,f)}function f(e,t){var r=u(e,t);function i(){n.select(this).style(s)}function a(){t.scale(n.event.scale).translate(n.event.translate),e.render(!0);var r=t.invert(e.midPt);e.graphDiv.emit(`plotly_relayouting`,{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})}function o(n){var r=t.invert(e.midPt);n(`center.lon`,r[0]),n(`center.lat`,r[1])}function l(){n.select(this).style(c),d(e,t,o)}return r.on(`zoomstart`,i).on(`zoom`,a).on(`zoomend`,l),r}function p(e,t){var r=u(e,t),i=2,a,o,l,f,p,m,h,g,_;function v(e){return t.invert(e)}function y(e){var n=v(e);if(!n)return!0;var r=t(n);return Math.abs(r[0]-e[0])>i||Math.abs(r[1]-e[1])>i}function b(){n.select(this).style(s),a=n.mouse(this),o=t.rotate(),l=t.translate(),f=o,p=v(a)}function x(){if(m=n.mouse(this),y(a)){r.scale(t.scale()),r.translate(t.translate());return}t.scale(n.event.scale),t.translate([l[0],n.event.translate[1]]),p?v(m)&&(g=v(m),h=[f[0]+(g[0]-p[0]),o[1],o[2]],t.rotate(h),f=h):(a=m,p=v(a)),_=!0,e.render(!0);var i=t.rotate(),s=t.invert(e.midPt);e.graphDiv.emit(`plotly_relayouting`,{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":s[0],"geo.center.lat":s[1],"geo.projection.rotation.lon":-i[0]})}function S(){n.select(this).style(c),_&&d(e,t,C)}function C(n){var r=t.rotate(),i=t.invert(e.midPt);n(`projection.rotation.lon`,-r[0]),n(`center.lon`,i[0]),n(`center.lat`,i[1])}return r.on(`zoomstart`,b).on(`zoom`,x).on(`zoomend`,S),r}function m(e,t){var r={r:t.rotate(),k:t.scale()},i=u(e,t),a=O(i,`zoomstart`,`zoom`,`zoomend`),o=0,l=i.on,f;i.on(`zoomstart`,function(){n.select(this).style(s);var e=n.mouse(this),o=t.rotate(),c=o,u=t.translate(),d=g(o);f=h(t,e),l.call(i,`zoom`,function(){var i=n.mouse(this);if(t.scale(r.k=n.event.scale),!f)e=i,f=h(t,e);else if(h(t,i)){t.rotate(o).translate(u);var s=h(t,i),l=r.r=y(w(_(d,v(f,s))),f,c);(!isFinite(l[0])||!isFinite(l[1])||!isFinite(l[2]))&&(l=c),t.rotate(l),c=l}m(a.of(this,arguments))}),p(a.of(this,arguments))}).on(`zoomend`,function(){n.select(this).style(c),l.call(i,`zoom`,null),b(a.of(this,arguments)),d(e,t,x)}).on(`zoom.redraw`,function(){e.render(!0);var n=t.rotate();e.graphDiv.emit(`plotly_relayouting`,{"geo.projection.scale":t.scale()/e.fitScale,"geo.projection.rotation.lon":-n[0],"geo.projection.rotation.lat":-n[1]})});function p(e){o++||e({type:`zoomstart`})}function m(e){e({type:`zoom`})}function b(e){--o||e({type:`zoomend`})}function x(e){var n=t.rotate();e(`projection.rotation.lon`,-n[0]),e(`projection.rotation.lat`,-n[1])}return n.rebind(i,a,`on`)}function h(e,t){var n=e.invert(t);return n&&isFinite(n[0])&&isFinite(n[1])&&T(n)}function g(e){var t=.5*e[0]*a,n=.5*e[1]*a,r=.5*e[2]*a,i=Math.sin(t),o=Math.cos(t),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return[o*c*u+i*s*l,i*c*u-o*s*l,o*s*u+i*c*l,o*c*l-i*s*u]}function _(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],c=t[2],l=t[3];return[n*o-r*s-i*c-a*l,n*s+r*o+i*l-a*c,n*c-r*l+i*o+a*s,n*l+r*c-i*s+a*o]}function v(e,t){if(!(!e||!t)){var n=D(e,t),r=Math.sqrt(E(n,n)),i=.5*Math.acos(Math.max(-1,Math.min(1,E(e,t)))),a=Math.sin(i)/r;return r&&[Math.cos(i),n[2]*a,-n[1]*a,n[0]*a]}}function y(e,t,n){var r=C(t,2,e[0]);r=C(r,1,e[1]),r=C(r,0,e[2]-n[2]);var i=t[0],a=t[1],s=t[2],c=r[0],l=r[1],u=r[2],d=Math.atan2(a,i)*o,f=Math.sqrt(i*i+a*a),p,m;Math.abs(l)>f?(m=(l>0?90:-90)-d,p=0):(m=Math.asin(l/f)*o-d,p=Math.sqrt(f*f-l*l));var h=180-m-2*d,g=(Math.atan2(u,c)-Math.atan2(s,p))*o,_=(Math.atan2(u,c)-Math.atan2(s,-p))*o;return b(n[0],n[1],m,g)<=b(n[0],n[1],h,_)?[m,g,n[2]]:[h,_,n[2]]}function b(e,t,n,r){var i=x(n-e),a=x(r-t);return Math.sqrt(i*i+a*a)}function x(e){return(e%360+540)%360-180}function C(e,t,n){var r=n*a,i=e.slice(),o=t===0?1:0,s=t===2?1:2,c=Math.cos(r),l=Math.sin(r);return i[o]=e[o]*c-e[s]*l,i[s]=e[s]*c+e[o]*l,i}function w(e){return[Math.atan2(2*(e[0]*e[1]+e[2]*e[3]),1-2*(e[1]*e[1]+e[2]*e[2]))*o,Math.asin(Math.max(-1,Math.min(1,2*(e[0]*e[2]-e[3]*e[1]))))*o,Math.atan2(2*(e[0]*e[3]+e[1]*e[2]),1-2*(e[2]*e[2]+e[3]*e[3]))*o]}function T(e){var t=e[0]*a,n=e[1]*a,r=Math.cos(n);return[r*Math.cos(t),r*Math.sin(t),Math.sin(n)]}function E(e,t){for(var n=0,r=0,i=e.length;r<i;++r)n+=e[r]*t[r];return n}function D(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function O(e){for(var t=0,r=arguments.length,i=[];++t<r;)i.push(arguments[t]);var a=n.dispatch.apply(null,i);return a.of=function(t,r){return function(i){var o;try{o=i.sourceEvent=n.event,i.target=e,n.event=i,a[i.type].apply(t,r)}finally{n.event=o}}},a}}),Wg=h((e,t)=>{var n=S(),r=Vg(),i=r.geoPath,a=r.geoDistance,o=Hg(),s=Ke(),c=$(),l=c.strTranslate,u=q(),d=tn(),f=Ln(),p=Et(),m=sn(),h=on().getAutoRange,g=hn(),_=Ar().prepSelect,v=Ar().clearOutline,y=Ar().selectOnClick,b=Ug(),x=Cg(),C=Pg(),w=Tg(),T=wg().feature;function E(e){this.id=e.id,this.graphDiv=e.graphDiv,this.container=e.container,this.topojsonURL=e.topojsonURL,this.isStatic=e.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 D=E.prototype;t.exports=function(e){return new E(e)},D.plot=function(e,t,n,r){var i=this;if(r)return i.update(e,t,!0);i._geoCalcData=e,i._fullLayout=t;var a=t[this.id],o=[],s=!1;for(var c in x.layerNameToAdjective)if(c!==`frame`&&a[`show`+c]){s=!0;break}for(var l=!1,u=0;u<e.length;u++){var d=e[0][0].trace;d._geo=i,d.locationmode&&(s=!0);var f=d.marker;if(f){var p=f.angle,m=f.angleref;(p||m===`north`||m===`previous`)&&(l=!0)}}if(this._hasMarkerAngles=l,s){var h=w.getTopojsonName(a);(i.topojson===null||h!==i.topojsonName)&&(i.topojsonName=h,PlotlyGeoAssets.topojson[i.topojsonName]===void 0&&o.push(i.fetchTopojson()))}o=o.concat(C.fetchTraceGeoData(e)),n.push(new Promise(function(n,r){Promise.all(o).then(function(){i.topojson=PlotlyGeoAssets.topojson[i.topojsonName],i.update(e,t),n()}).catch(r)}))},D.fetchTopojson=function(){var e=this,t=w.getTopojsonPath(e.topojsonURL,e.topojsonName);return new Promise(function(r,i){n.json(t,function(n,a){if(n)return n.status===404?i(Error([`plotly.js could not find topojson file at`,t+`.`,`Make sure the *topojsonURL* plot config option`,`is set properly.`].join(` `))):i(Error([`unexpected error while fetching topojson file at`,t].join(` `)));PlotlyGeoAssets.topojson[e.topojsonName]=a,r()})})},D.update=function(e,t,n){var r=t[this.id];this.hasChoropleth=!1;for(var i=0;i<e.length;i++){var a=e[i],o=a[0].trace;o.type===`choropleth`&&(this.hasChoropleth=!0),o.visible===!0&&o._length>0&&o._module.calcGeoJSON(a,t)}if(!n){if(this.updateProjection(e,t))return;(!this.viewInitial||this.scope!==r.scope)&&this.saveViewInitial(r)}this.scope=r.scope,this.updateBaseLayers(t,r),this.updateDims(t,r),this.updateFx(t,r),p.generalUpdatePerTraceModule(this.graphDiv,this,e,r);var s=this.layers.frontplot.select(`.scatterlayer`);this.dataPoints.point=s.selectAll(`.point`),this.dataPoints.text=s.selectAll(`text`),this.dataPaths.line=s.selectAll(`.js-line`);var c=this.layers.backplot.select(`.choroplethlayer`);this.dataPaths.choropleth=c.selectAll(`path`),this._render()},D.updateProjection=function(e,t){var n=this.graphDiv,r=t[this.id],i=t._size,a=r.domain,o=r.projection,s=r.lonaxis,l=r.lataxis,u=s._ax,d=l._ax,f=this.projection=O(r),p=[[i.l+i.w*a.x[0],i.t+i.h*(1-a.y[1])],[i.l+i.w*a.x[1],i.t+i.h*(1-a.y[0])]],m=r.center||{},g=o.rotation||{},_=s.range||[],v=l.range||[];if(r.fitbounds){u._length=p[1][0]-p[0][0],d._length=p[1][1]-p[0][1],u.range=h(n,u),d.range=h(n,d);var y=(u.range[0]+u.range[1])/2,b=(d.range[0]+d.range[1])/2;if(r._isScoped)m={lon:y,lat:b};else if(r._isClipped){m={lon:y,lat:b},g={lon:y,lat:b,roll:g.roll};var S=o.type,C=x.lonaxisSpan[S]/2||180,w=x.lataxisSpan[S]/2||90;_=[y-C,y+C],v=[b-w,b+w]}else m={lon:y,lat:b},g={lon:y,lat:g.lat,roll:g.roll}}f.center([m.lon-g.lon,m.lat-g.lat]).rotate([-g.lon,-g.lat,g.roll]).parallels(o.parallels);var T=A(_,v);f.fitExtent(p,T);var E=this.bounds=f.getBounds(T),D=this.fitScale=f.scale(),k=f.translate();if(r.fitbounds){var j=f.getBounds(A(u.range,d.range)),M=Math.min((E[1][0]-E[0][0])/(j[1][0]-j[0][0]),(E[1][1]-E[0][1])/(j[1][1]-j[0][1]));isFinite(M)?f.scale(M*D):c.warn(`Something went wrong during`+this.id+`fitbounds computations.`)}else f.scale(o.scale*D);var N=this.midPt=[(E[0][0]+E[1][0])/2,(E[0][1]+E[1][1])/2];if(f.translate([k[0]+(N[0]-k[0]),k[1]+(N[1]-k[1])]).clipExtent(E),r._isAlbersUsa){var P=f([m.lon,m.lat]),F=f.translate();f.translate([F[0]-(P[0]-F[0]),F[1]-(P[1]-F[1])])}},D.updateBaseLayers=function(e,t){var r=this,i=r.topojson,a=r.layers,o=r.basePaths;function s(e){return e===`lonaxis`||e===`lataxis`}function c(e){return!!x.lineLayers[e]}function l(e){return!!x.fillLayers[e]}var f=(this.hasChoropleth?x.layersForChoropleth:x.layers).filter(function(e){return c(e)||l(e)?t[`show`+e]:s(e)?t[e].showgrid:!0}),p=r.framework.selectAll(`.layer`).data(f,String);p.exit().each(function(e){delete a[e],delete o[e],n.select(this).remove()}),p.enter().append(`g`).attr(`class`,function(e){return`layer `+e}).each(function(e){var t=a[e]=n.select(this);e===`bg`?r.bgRect=t.append(`rect`).style(`pointer-events`,`all`):s(e)?o[e]=t.append(`path`).style(`fill`,`none`):e===`backplot`?t.append(`g`).classed(`choroplethlayer`,!0):e===`frontplot`?t.append(`g`).classed(`scatterlayer`,!0):c(e)?o[e]=t.append(`path`).style(`fill`,`none`).style(`stroke-miterlimit`,2):l(e)&&(o[e]=t.append(`path`).style(`stroke`,`none`))}),p.order(),p.each(function(n){var r=o[n],a=x.layerNameToAdjective[n];n===`frame`?r.datum(x.sphereSVG):c(n)||l(n)?r.datum(T(i,i.objects[n])):s(n)&&r.datum(k(n,t,e)).call(u.stroke,t[n].gridcolor).call(d.dashLine,t[n].griddash,t[n].gridwidth),c(n)?r.call(u.stroke,t[a+`color`]).call(d.dashLine,``,t[a+`width`]):l(n)&&r.call(u.fill,t[a+`color`])})},D.updateDims=function(e,t){var n=this.bounds,r=(t.framewidth||0)/2,i=n[0][0]-r,a=n[0][1]-r,o=n[1][0]-i+r,s=n[1][1]-a+r;d.setRect(this.clipRect,i,a,o,s),this.bgRect.call(d.setRect,i,a,o,s).call(u.fill,t.bgcolor),this.xaxis._offset=i,this.xaxis._length=o,this.yaxis._offset=a,this.yaxis._length=s},D.updateFx=function(e,t){var r=this,i=r.graphDiv,a=r.bgRect,o=e.dragmode,l=e.clickmode;if(r.isStatic)return;function u(){var e=r.viewInitial,t={};for(var n in e)t[r.id+`.`+n]=e[n];s.call(`_guiRelayout`,i,t),i.emit(`plotly_doubleclick`,null)}function d(e){return r.projection.invert([e[0]+r.xaxis._offset,e[1]+r.yaxis._offset])}var p={element:r.bgRect.node(),gd:i,plotinfo:{id:r.id,xaxis:r.xaxis,yaxis:r.yaxis,fillRangeItems:function(e,t){if(t.isRect){var n=e.range={};n[r.id]=[d([t.xmin,t.ymin]),d([t.xmax,t.ymax])]}else{var i=e.lassoPoints={};i[r.id]=t.map(d)}}},xaxes:[r.xaxis],yaxes:[r.yaxis],subplot:r.id,clickFn:function(e){e===2&&v(i)}};o===`pan`?(a.node().onmousedown=null,a.call(b(r,t)),a.on(`dblclick.zoom`,u),i._context._scrollZoom.geo||a.on(`wheel.zoom`,null)):(o===`select`||o===`lasso`)&&(a.on(`.zoom`,null),p.prepFn=function(e,t,n){_(e,t,n,p,o)},g.init(p)),a.on(`mousemove`,function(){var e=r.projection.invert(c.getPositionFromD3Event());if(!e)return g.unhover(i,n.event);r.xaxis.p2c=function(){return e[0]},r.yaxis.p2c=function(){return e[1]},f.hover(i,n.event,r.id)}),a.on(`mouseout`,function(){i._dragging||g.unhover(i,n.event)}),a.on(`click`,function(){o!==`select`&&o!==`lasso`&&(l.indexOf(`select`)>-1&&y(n.event,i,[r.xaxis],[r.yaxis],r.id,p),l.indexOf(`event`)>-1&&f.click(i,n.event))})},D.makeFramework=function(){var e=this,t=e.graphDiv,r=t._fullLayout,i=`clip`+r._uid+e.id;e.clipDef=r._clips.append(`clipPath`).attr(`id`,i),e.clipRect=e.clipDef.append(`rect`),e.framework=n.select(e.container).append(`g`).attr(`class`,`geo `+e.id).call(d.setClipUrl,i,t),e.project=function(t){var n=e.projection(t);return n?[n[0]-e.xaxis._offset,n[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:`x`,c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:`y`,c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:`linear`,showexponent:`all`,exponentformat:`B`},m.setConvert(e.mockAxis,r)},D.saveViewInitial=function(e){var t=e.center||{},n=e.projection,r=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale};var i=e._isScoped?{"center.lon":t.lon,"center.lat":t.lat}:e._isClipped?{"projection.rotation.lon":r.lon,"projection.rotation.lat":r.lat}:{"center.lon":t.lon,"center.lat":t.lat,"projection.rotation.lon":r.lon};c.extendFlat(this.viewInitial,i)},D.render=function(e){this._hasMarkerAngles&&e?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},D._render=function(){var e=this.projection,t=e.getPath(),n;function r(t){var n=e(t.lonlat);return n?l(n[0],n[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?`none`:null}for(n in this.basePaths)this.basePaths[n].attr(`d`,t);for(n in this.dataPaths)this.dataPaths[n].attr(`d`,function(e){return t(e.geojson)});for(n in this.dataPoints)this.dataPoints[n].attr(`display`,i).attr(`transform`,r)};function O(e){var t=e.projection,n=t.type,s=x.projNames[n];s=`geo`+c.titleCase(s);for(var l=(r[s]||o[s])(),u=e._isSatellite?Math.acos(1/t.distance)*180/Math.PI:e._isClipped?x.lonaxisSpan[n]/2:null,d=[`center`,`rotate`,`parallels`,`clipExtent`],f=function(e){return e?l:[]},p=0;p<d.length;p++){var m=d[p];typeof l[m]!=`function`&&(l[m]=f)}return l.isLonLatOverEdges=function(e){if(l(e)===null)return!0;if(u){var t=l.rotate();return a(e,[-t[0],-t[1]])>u*Math.PI/180}else return!1},l.getPath=function(){return i().projection(l)},l.getBounds=function(e){return l.getPath().bounds(e)},l.precision(x.precision),e._isSatellite&&l.tilt(t.tilt).distance(t.distance),u&&l.clipAngle(u-x.clipPad),l}function k(e,t,n){var r=1e-6,i=2.5,a=t[e],o=x.scopeDefaults[t.scope],s,c,l;e===`lonaxis`?(s=o.lonaxisRange,c=o.lataxisRange,l=function(e,t){return[e,t]}):e===`lataxis`&&(s=o.lataxisRange,c=o.lonaxisRange,l=function(e,t){return[t,e]});var u={type:`linear`,range:[s[0],s[1]-r],tick0:a.tick0,dtick:a.dtick};m.setConvert(u,n);var d=m.calcTicks(u);!t.isScoped&&e===`lonaxis`&&d.pop();for(var f=d.length,p=Array(f),h=0;h<f;h++)for(var g=d[h].x,_=p[h]=[],v=c[0];v<c[1]+i;v+=i)_.push(l(g,v));return{type:`MultiLineString`,coordinates:p}}function A(e,t){var n=x.clipPad,r=e[0]+n,i=e[1]-n,a=t[0]+n,o=t[1]-n;r>0&&i<0&&(i+=360);var s=(i-r)/4;return{type:`Polygon`,coordinates:[[[r,a],[r,o],[r+s,o],[r+2*s,o],[r+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[r,a]]]}}}),Gg=h((e,t)=>{var n=K(),r=Da().attributes,i=Le().dash,a=Cg(),o=Ie().overrideAll,s=Xe(),c={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:n.lightLine},gridwidth:{valType:`number`,min:0,dflt:1},griddash:i},l=t.exports=o({domain:r({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:s(a.scopeDefaults),dflt:`world`},projection:{type:{valType:`enumerated`,values:s(a.projNames)},rotation:{lon:{valType:`number`},lat:{valType:`number`},roll:{valType:`number`}},tilt:{valType:`number`,dflt:0},distance:{valType:`number`,min:1.001,dflt:2},parallels:{valType:`info_array`,items:[{valType:`number`},{valType:`number`}]},scale:{valType:`number`,min:0,dflt:1}},center:{lon:{valType:`number`},lat:{valType:`number`}},visible:{valType:`boolean`,dflt:!0},showcoastlines:{valType:`boolean`},coastlinecolor:{valType:`color`,dflt:n.defaultLine},coastlinewidth:{valType:`number`,min:0,dflt:1},showland:{valType:`boolean`,dflt:!1},landcolor:{valType:`color`,dflt:a.landColor},showocean:{valType:`boolean`,dflt:!1},oceancolor:{valType:`color`,dflt:a.waterColor},showlakes:{valType:`boolean`,dflt:!1},lakecolor:{valType:`color`,dflt:a.waterColor},showrivers:{valType:`boolean`,dflt:!1},rivercolor:{valType:`color`,dflt:a.waterColor},riverwidth:{valType:`number`,min:0,dflt:1},showcountries:{valType:`boolean`},countrycolor:{valType:`color`,dflt:n.defaultLine},countrywidth:{valType:`number`,min:0,dflt:1},showsubunits:{valType:`boolean`},subunitcolor:{valType:`color`,dflt:n.defaultLine},subunitwidth:{valType:`number`,min:0,dflt:1},showframe:{valType:`boolean`},framecolor:{valType:`color`,dflt:n.defaultLine},framewidth:{valType:`number`,min:0,dflt:1},bgcolor:{valType:`color`,dflt:n.background},lonaxis:c,lataxis:c},`plot`,`from-root`);l.uirevision={valType:`any`,editType:`none`}}),Kg=h((e,t)=>{var n=$(),r=Ks(),i=wt().getSubplotData,a=Cg(),o=Gg(),s=a.axesNames;t.exports=function(e,t,n){r(e,t,n,{type:`geo`,attributes:o,handleDefaults:c,fullData:n,partition:`y`})};function c(e,t,r,o){var c=i(o.fullData,`geo`,o.id).map(function(e){return e.index}),l=r(`resolution`),u=r(`scope`),d=a.scopeDefaults[u],f=r(`projection.type`,d.projType),p=t._isAlbersUsa=f===`albers usa`;p&&(u=t.scope=`usa`);var m=t._isScoped=u!==`world`,h=t._isSatellite=f===`satellite`,g=t._isConic=f.indexOf(`conic`)!==-1||f===`albers`,_=t._isClipped=!!a.lonaxisSpan[f];if(e.visible===!1){var v=n.extendDeep({},t._template);v.showcoastlines=!1,v.showcountries=!1,v.showframe=!1,v.showlakes=!1,v.showland=!1,v.showocean=!1,v.showrivers=!1,v.showsubunits=!1,v.lonaxis&&(v.lonaxis.showgrid=!1),v.lataxis&&(v.lataxis.showgrid=!1),t._template=v}for(var y=r(`visible`),b,x=0;x<s.length;x++){var S=s[x],C=[30,10][x],w;if(m)w=d[S+`Range`];else{var T=a[S+`Span`],E=(T[f]||T[`*`])/2,D=r(`projection.rotation.`+S.slice(0,3),d.projRotate[x]);w=[D-E,D+E]}var O=r(S+`.range`,w);r(S+`.tick0`),r(S+`.dtick`,C),b=r(S+`.showgrid`,y?void 0:!1),b&&(r(S+`.gridcolor`),r(S+`.gridwidth`),r(S+`.griddash`)),t[S]._ax={type:`linear`,_id:S.slice(0,3),_traceIndices:c,setScale:n.identity,c2l:n.identity,r2l:n.identity,autorange:!0,range:O.slice(),_m:1,_input:{}}}var k=t.lonaxis.range,A=t.lataxis.range,j=k[0],M=k[1];j>0&&M<0&&(M+=360);var N=(j+M)/2,P;if(!p){var F=m?d.projRotate:[N,0,0];P=r(`projection.rotation.lon`,F[0]),r(`projection.rotation.lat`,F[1]),r(`projection.rotation.roll`,F[2]),b=r(`showcoastlines`,!m&&y),b&&(r(`coastlinecolor`),r(`coastlinewidth`)),b=r(`showocean`,y?void 0:!1),b&&r(`oceancolor`)}var I,L;p?(I=-96.6,L=38.7):(I=m?N:P,L=(A[0]+A[1])/2),r(`center.lon`,I),r(`center.lat`,L),h&&(r(`projection.tilt`),r(`projection.distance`)),g&&r(`projection.parallels`,d.projParallels||[0,60]),r(`projection.scale`),b=r(`showland`,y?void 0:!1),b&&r(`landcolor`),b=r(`showlakes`,y?void 0:!1),b&&r(`lakecolor`),b=r(`showrivers`,y?void 0:!1),b&&(r(`rivercolor`),r(`riverwidth`)),b=r(`showcountries`,m&&u!==`usa`&&y),b&&(r(`countrycolor`),r(`countrywidth`)),(u===`usa`||u===`north america`&&l===50)&&(r(`showsubunits`,y),r(`subunitcolor`),r(`subunitwidth`)),m||(b=r(`showframe`,y),b&&(r(`framecolor`),r(`framewidth`))),r(`bgcolor`),r(`fitbounds`)&&(delete t.projection.scale,m?(delete t.center.lon,delete t.center.lat):_?(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon,delete t.projection.rotation.lat,delete t.lonaxis.range,delete t.lataxis.range):(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon))}}),qg=h((e,t)=>{var n=wt().getSubplotCalcData,r=$().counterRegex,i=Wg(),a=`geo`,o=r(a),s={};s[a]={valType:`subplotid`,dflt:a,editType:`calc`};function c(e){for(var t=e._fullLayout,r=e.calcdata,o=t._subplots[a],s=0;s<o.length;s++){var c=o[s],l=n(r,a,c),u=t[c]._subplot;u||(u=i({id:c,graphDiv:e,container:t._geolayer.node(),topojsonURL:e._context.topojsonURL,staticPlot:e._context.staticPlot}),t[c]._subplot=u),u.plot(l,t,e._promises)}}function l(e,t,n,r){for(var i=r._subplots[a]||[],o=0;o<i.length;o++){var s=i[o],c=r[s]._subplot;!t[s]&&c&&(c.framework.remove(),c.clipDef.remove())}}function u(e){for(var t=e._fullLayout,n=t._subplots[a],r=0;r<n.length;r++){var i=t[n[r]];i._subplot.updateFx(t,i)}}t.exports={attr:a,name:a,idRoot:a,idRegex:o,attrRegex:o,attributes:s,layoutAttributes:Gg(),supplyLayoutDefaults:Kg(),plot:c,updateFx:u,clean:l}}),Jg=h((e,t)=>{t.exports={attributes:yg(),supplyDefaults:bg(),colorbar:gi(),formatLabels:xg(),calc:Sg(),calcGeoJSON:Ig().calcGeoJSON,plot:Ig().plot,style:Fg(),styleOnSelect:vi().styleOnSelect,hoverPoints:Lg(),eventData:Rg(),selectPoints:zg(),moduleType:`trace`,name:`scattergeo`,basePlotModule:qg(),categories:[`geo`,`symbols`,`showLegend`,`scatter-like`],meta:{}}}),Yg=h((e,t)=>{t.exports=Jg()}),Xg=h((e,t)=>{var{hovertemplateAttrs:n,templatefallbackAttrs:r}=ze(),i=yg(),a=Pt(),o=W(),s=K().defaultLine,c=z().extendFlat,l=i.marker.line;t.exports=c({locations:{valType:`data_array`,editType:`calc`},locationmode:i.locationmode,z:{valType:`data_array`,editType:`calc`},geojson:c({},i.geojson,{}),featureidkey:i.featureidkey,text:c({},i.text,{}),hovertext:c({},i.hovertext,{}),marker:{line:{color:c({},l.color,{dflt:s}),width:c({},l.width,{dflt:1}),editType:`calc`},opacity:{valType:`number`,arrayOk:!0,min:0,max:1,dflt:1,editType:`style`},editType:`calc`},selected:{marker:{opacity:i.selected.marker.opacity,editType:`plot`},editType:`plot`},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:`plot`},editType:`plot`},hoverinfo:c({},o.hoverinfo,{editType:`calc`,flags:[`location`,`z`,`text`,`name`]}),hovertemplate:n(),hovertemplatefallback:r(),showlegend:c({},o.showlegend,{dflt:!1})},a(``,{cLetter:`z`,editTypeOverride:`calc`}))}),Zg=h((e,t)=>{var n=$(),r=Gt(),i=Xg(),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(` `);t.exports=function(e,t,o,s){function c(r,a){return n.coerce(e,t,i,r,a)}var l=c(`locations`),u=c(`z`);if(!(l&&l.length&&n.isArrayOrTypedArray(u)&&u.length)){t.visible=!1;return}t._length=Math.min(l.length,u.length);var d=c(`geojson`),f;(typeof d==`string`&&d!==``||n.isPlainObject(d))&&(f=`geojson-id`);var p=c(`locationmode`,f);p===`country names`&&n.warn(a),p===`geojson-id`&&c(`featureidkey`),c(`text`),c(`hovertext`),c(`hovertemplate`),c(`hovertemplatefallback`),c(`marker.line.width`)&&c(`marker.line.color`),c(`marker.opacity`),r(e,t,s,c,{prefix:``,cLetter:`z`}),n.coerceSelectionMarkerOpacity(t,c)}}),Qg=h((e,t)=>{var n=D(),r=O().BADNUM,i=Jt(),a=oi(),o=si();function s(e){return e&&typeof e==`string`}t.exports=function(e,t){for(var c=t._length,l=Array(c),u=t.geojson?function(e){return s(e)||n(e)}:s,d=0;d<c;d++){var f=l[d]={},p=t.locations[d],m=t.z[d];u(p)&&n(m)?(f.loc=p,f.z=m):(f.loc=null,f.z=r),f.index=d}return a(l,t),i(e,t,{vals:t.z,containerStr:``,cLetter:`z`}),o(l,t),l}}),$g=h((e,t)=>{var n=S(),r=q(),i=tn(),a=Yt();function o(e,t){t&&s(e,t)}function s(e,t){var o=t[0].trace,s=t[0].node3.selectAll(`.choroplethlocation`),c=o.marker||{},l=c.line||{},u=a.makeColorScaleFuncFromTrace(o);s.each(function(e){n.select(this).attr(`fill`,u(e.z)).call(r.stroke,e.mlc||l.color).call(i.dashLine,``,e.mlw||l.width||0).style(`opacity`,c.opacity)}),i.selectedPointStyle(s,o)}function c(e,t){var n=t[0].node3,r=t[0].trace;r.selectedpoints?i.selectedPointStyle(n.selectAll(`.choroplethlocation`),r):s(e,t)}t.exports={style:o,styleOnSelect:c}}),e_=h((e,t)=>{var n=S(),r=$(),i=Pg(),a=Tg().getTopojsonFeatures,o=on().findExtremes,s=$g().style;function c(e,t,i){var a=t.layers.backplot.select(`.choroplethlayer`);r.makeTraceGroups(a,i,`trace choropleth`).each(function(t){var i=n.select(this).selectAll(`path.choroplethlocation`).data(r.identity);i.enter().append(`path`).classed(`choroplethlocation`,!0),i.exit().remove(),s(e,t)})}function l(e,t){for(var n=e[0].trace,r=t[n.geo],s=r._subplot,c=n.locationmode,l=n._length,u=c===`geojson-id`?i.extractTraceFeature(e):a(n,s.topojson),d=[],f=[],p=0;p<l;p++){var m=e[p],h=c===`geojson-id`?m.fOut:i.locationToFeature(c,m.loc,u);if(h){m.geojson=h,m.ct=h.properties.ct,m._polygons=i.feature2polygons(h);var g=i.computeBbox(h);d.push(g[0],g[2]),f.push(g[1],g[3])}else m.geojson=null}if(r.fitbounds===`geojson`&&c===`geojson-id`){var _=i.computeBbox(i.getTraceGeojson(n));d=[_[0],_[2]],f=[_[1],_[3]]}var v={padded:!0};n._extremes.lon=o(r.lonaxis._ax,d,v),n._extremes.lat=o(r.lataxis._ax,f,v)}t.exports={calcGeoJSON:l,plot:c}}),t_=h((e,t)=>{var n=sn(),r=Xg(),i=$().fillText;t.exports=function(e,t,r){var i=e.cd,o=i[0].trace,s=e.subplot,c,l,u,d,f=[t,r],p=[t+360,r];for(l=0;l<i.length;l++)if(c=i[l],d=!1,c._polygons){for(u=0;u<c._polygons.length;u++)c._polygons[u].contains(f)&&(d=!d),c._polygons[u].contains(p)&&(d=!d);if(d)break}if(!(!d||!c))return e.x0=e.x1=e.xa.c2p(c.ct),e.y0=e.y1=e.ya.c2p(c.ct),e.index=c.index,e.location=c.loc,e.z=c.z,e.zLabel=n.tickText(s.mockAxis,s.mockAxis.c2l(c.z),`hover`).text,e.hovertemplate=c.hovertemplate,a(e,o,c),[e]};function a(e,t,n){if(!t.hovertemplate){var a=n.hi||t.hoverinfo,o=String(n.loc),s=a===`all`?r.hoverinfo.flags:a.split(`+`),c=s.indexOf(`name`)!==-1,l=s.indexOf(`location`)!==-1,u=s.indexOf(`z`)!==-1,d=s.indexOf(`text`)!==-1,f=!c&&l,p=[];f?e.nameOverride=o:(c&&(e.nameOverride=t.name),l&&p.push(o)),u&&p.push(e.zLabel),d&&i(n,t,p),e.extraText=p.join(`<br>`)}}}),n_=h((e,t)=>{t.exports=function(e,t,n,r,i){e.location=t.location,e.z=t.z;var a=r[i];return a.fIn&&a.fIn.properties&&(e.properties=a.fIn.properties),e.ct=a.ct,e}}),r_=h((e,t)=>{t.exports=function(e,t){var n=e.cd,r=e.xaxis,i=e.yaxis,a=[],o,s,c,l,u;if(t===!1)for(o=0;o<n.length;o++)n[o].selected=0;else for(o=0;o<n.length;o++)s=n[o],c=s.ct,c&&(l=r.c2p(c),u=i.c2p(c),t.contains([l,u],null,o,e)?(a.push({pointNumber:o,lon:c[0],lat:c[1]}),s.selected=1):s.selected=0);return a}}),i_=h((e,t)=>{t.exports={attributes:Xg(),supplyDefaults:Zg(),colorbar:Uo(),calc:Qg(),calcGeoJSON:e_().calcGeoJSON,plot:e_().plot,style:$g().style,styleOnSelect:$g().styleOnSelect,hoverPoints:t_(),eventData:n_(),selectPoints:r_(),moduleType:`trace`,name:`choropleth`,basePlotModule:qg(),categories:[`geo`,`noOpacity`,`showLegend`],meta:{}}}),a_=h((e,t)=>{t.exports=i_()}),o_=h((e,t)=>{var n=Ke(),r=$(),i=yi();function a(e,t,n,r){var i=e.cd,a=i[0].t,s=i[0].trace,c=e.xa,l=e.ya,u=a.x,d=a.y,f=c.c2p(t),p=l.c2p(n),m=e.distance,h;if(a.tree){var g=c.p2c(f-m),_=c.p2c(f+m),v=l.p2c(p-m),y=l.p2c(p+m);h=r===`x`?a.tree.range(Math.min(g,_),Math.min(l._rl[0],l._rl[1]),Math.max(g,_),Math.max(l._rl[0],l._rl[1])):a.tree.range(Math.min(g,_),Math.min(v,y),Math.max(g,_),Math.max(v,y))}else h=a.ids;var b,x,S,C,w,T,E,D,O,k=m;if(r===`x`){var A=!!s.xperiodalignment,j=!!s.yperiodalignment;for(w=0;w<h.length;w++){if(b=h[w],S=u[b],T=Math.abs(c.c2p(S)-f),A){var M=c.c2p(s._xStarts[b]),N=c.c2p(s._xEnds[b]);T=f>=Math.min(M,N)&&f<=Math.max(M,N)?0:1/0}if(T<k){if(k=T,C=d[b],E=l.c2p(C)-p,j){var P=l.c2p(s._yStarts[b]),F=l.c2p(s._yEnds[b]);E=p>=Math.min(P,F)&&p<=Math.max(P,F)?0:1/0}O=Math.sqrt(T*T+E*E),x=h[w]}}}else for(w=h.length-1;w>-1;w--)b=h[w],S=u[b],C=d[b],T=c.c2p(S)-f,E=l.c2p(C)-p,D=Math.sqrt(T*T+E*E),D<k&&(k=O=D,x=b);return e.index=x,e.distance=k,e.dxy=O,x===void 0?[e]:[o(e,u,d,s)]}function o(e,t,a,o){var s=e.xa,c=e.ya,l=e.distance,u=e.dxy,d=e.index,f={pointNumber:d,x:t[d],y:a[d]};f.tx=r.isArrayOrTypedArray(o.text)?o.text[d]:o.text,f.htx=Array.isArray(o.hovertext)?o.hovertext[d]:o.hovertext,f.data=Array.isArray(o.customdata)?o.customdata[d]:o.customdata,f.tp=Array.isArray(o.textposition)?o.textposition[d]:o.textposition;var p=o.textfont;p&&(f.ts=r.isArrayOrTypedArray(p.size)?p.size[d]:p.size,f.tc=r.isArrayOrTypedArray(p.color)?p.color[d]:p.color,f.tf=Array.isArray(p.family)?p.family[d]:p.family,f.tw=Array.isArray(p.weight)?p.weight[d]:p.weight,f.ty=Array.isArray(p.style)?p.style[d]:p.style,f.tv=Array.isArray(p.variant)?p.variant[d]:p.variant);var m=o.marker;m&&(f.ms=r.isArrayOrTypedArray(m.size)?m.size[d]:m.size,f.mo=r.isArrayOrTypedArray(m.opacity)?m.opacity[d]:m.opacity,f.mx=r.isArrayOrTypedArray(m.symbol)?m.symbol[d]:m.symbol,f.ma=r.isArrayOrTypedArray(m.angle)?m.angle[d]:m.angle,f.mc=r.isArrayOrTypedArray(m.color)?m.color[d]:m.color);var h=m&&m.line;h&&(f.mlc=Array.isArray(h.color)?h.color[d]:h.color,f.mlw=r.isArrayOrTypedArray(h.width)?h.width[d]:h.width);var g=m&&m.gradient;g&&g.type!==`none`&&(f.mgt=Array.isArray(g.type)?g.type[d]:g.type,f.mgc=Array.isArray(g.color)?g.color[d]:g.color);var _=s.c2p(f.x,!0),v=c.c2p(f.y,!0),y=f.mrc||1,b=o.hoverlabel;b&&(f.hbg=Array.isArray(b.bgcolor)?b.bgcolor[d]:b.bgcolor,f.hbc=Array.isArray(b.bordercolor)?b.bordercolor[d]:b.bordercolor,f.hts=r.isArrayOrTypedArray(b.font.size)?b.font.size[d]:b.font.size,f.htc=Array.isArray(b.font.color)?b.font.color[d]:b.font.color,f.htf=Array.isArray(b.font.family)?b.font.family[d]:b.font.family,f.hnl=r.isArrayOrTypedArray(b.namelength)?b.namelength[d]:b.namelength);var x=o.hoverinfo;x&&(f.hi=Array.isArray(x)?x[d]:x);var S=o.hovertemplate;S&&(f.ht=Array.isArray(S)?S[d]:S);var C={};C[e.index]=f;var w=o._origX,T=o._origY,E=r.extendFlat({},e,{color:i(o,f),x0:_-y,x1:_+y,xLabelVal:w?w[d]:f.x,y0:v-y,y1:v+y,yLabelVal:T?T[d]:f.y,cd:C,distance:l,spikeDistance:u,hovertemplate:f.ht});return f.htx?E.text=f.htx:f.tx?E.text=f.tx:o.text&&(E.text=o.text),r.fillText(f,o,E),n.getComponentMethod(`errorbars`,`hoverInfo`)(f,o,E),E}t.exports={hoverPoints:a,calcHover:o}}),s_=h((e,t)=>{var n=20;t.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:n,SYMBOL_STROKE:n/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]}}}),c_=h((e,t)=>{var n=W(),r=B(),i=wr(),a=Tr(),o=jt().axisHoverFormat,s=Pt(),c=Xe(),l=z().extendFlat,u=Ie().overrideAll,d=s_().DASHES,f=a.line,p=a.marker,m=p.line,h=t.exports=u({x:a.x,x0:a.x0,dx:a.dx,y:a.y,y0:a.y0,dy:a.dy,xperiod:a.xperiod,yperiod:a.yperiod,xperiod0:a.xperiod0,yperiod0:a.yperiod0,xperiodalignment:a.xperiodalignment,yperiodalignment:a.yperiodalignment,xhoverformat:o(`x`),yhoverformat:o(`y`),text:a.text,hovertext:a.hovertext,textposition:a.textposition,textfont:r({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:f.color,width:f.width,shape:{valType:`enumerated`,values:[`linear`,`hv`,`vh`,`hvh`,`vhv`],dflt:`linear`,editType:`plot`},dash:{valType:`enumerated`,values:c(d),dflt:`solid`}},marker:l({},s(`marker`),{symbol:p.symbol,angle:p.angle,size:p.size,sizeref:p.sizeref,sizemin:p.sizemin,sizemode:p.sizemode,opacity:p.opacity,colorbar:p.colorbar,line:l({},s(`marker.line`),{width:m.width})}),connectgaps:a.connectgaps,fill:l({},a.fill,{dflt:`none`}),fillcolor:i(),selected:{marker:a.selected.marker,textfont:a.selected.textfont},unselected:{marker:a.unselected.marker,textfont:a.unselected.textfont},opacity:n.opacity},`calc`,`nested`);h.x.editType=h.y.editType=h.x0.editType=h.y0.editType=`calc+clearAxisTypes`,h.hovertemplate=a.hovertemplate,h.hovertemplatefallback=a.hovertemplatefallback,h.texttemplate=a.texttemplate,h.texttemplatefallback=a.texttemplatefallback}),l_=h(e=>{var t=s_();e.isOpenSymbol=function(e){return typeof e==`string`?t.OPEN_RE.test(e):e%200>100},e.isDotSymbol=function(e){return typeof e==`string`?t.DOT_RE.test(e):e>200}}),u_=h((e,t)=>{var n=$(),r=Ke(),i=l_(),a=c_(),o=Cr(),s=Xt(),c=Kr(),l=qr(),u=Yr(),d=Xr(),f=$r(),p=Qr();t.exports=function(e,t,m,h){function g(r,i){return n.coerce(e,t,a,r,i)}var _=e.marker?i.isOpenSymbol(e.marker.symbol):!1,v=s.isBubble(e),y=c(e,t,h,g);if(!y){t.visible=!1;return}l(e,t,h,g),g(`xhoverformat`),g(`yhoverformat`);var b=y<o.PTS_LINESONLY?`lines+markers`:`lines`;g(`text`),g(`hovertext`),g(`hovertemplate`),g(`hovertemplatefallback`),g(`mode`,b),s.hasMarkers(t)&&(u(e,t,m,h,g,{noAngleRef:!0,noLineDash:!0,noStandOff:!0}),g(`marker.line.width`,_||v?1:0)),s.hasLines(t)&&(g(`connectgaps`),d(e,t,m,h,g),g(`line.shape`)),s.hasText(t)&&(g(`texttemplate`),g(`texttemplatefallback`),p(e,t,h,g,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var x=(t.line||{}).color,S=(t.marker||{}).color;g(`fill`),t.fill!==`none`&&f(e,t,m,g);var C=r.getComponentMethod(`errorbars`,`supplyDefaults`);C(e,t,x||S||m,{axis:`y`}),C(e,t,x||S||m,{axis:`x`,inherit:`y`}),n.coerceSelectionMarkerOpacity(t,g)}}),d_=h((e,t)=>{var n=_i();t.exports=function(e,t,r){var i=e.i;return`x`in e||(e.x=t._x[i]),`y`in e||(e.y=t._y[i]),n(e,t,r)}}),f_=h((e,t)=>{function n(e,t,n,r,i){for(var a=i+1;r<=i;){var o=r+i>>>1,s=e[o];(n===void 0?s-t:n(s,t))>=0?(a=o,i=o-1):r=o+1}return a}function r(e,t,n,r,i){for(var a=i+1;r<=i;){var o=r+i>>>1,s=e[o];(n===void 0?s-t:n(s,t))>0?(a=o,i=o-1):r=o+1}return a}function i(e,t,n,r,i){for(var a=r-1;r<=i;){var o=r+i>>>1,s=e[o];(n===void 0?s-t:n(s,t))<0?(a=o,r=o+1):i=o-1}return a}function a(e,t,n,r,i){for(var a=r-1;r<=i;){var o=r+i>>>1,s=e[o];(n===void 0?s-t:n(s,t))<=0?(a=o,r=o+1):i=o-1}return a}function o(e,t,n,r,i){for(;r<=i;){var a=r+i>>>1,o=e[a],s=n===void 0?o-t:n(o,t);if(s===0)return a;s<=0?r=a+1:i=a-1}return-1}function s(e,t,n,r,i,a){return typeof n==`function`?a(e,t,n,r===void 0?0:r|0,i===void 0?e.length-1:i|0):a(e,t,void 0,n===void 0?0:n|0,r===void 0?e.length-1:r|0)}t.exports={ge:function(e,t,r,i,a){return s(e,t,r,i,a,n)},gt:function(e,t,n,i,a){return s(e,t,n,i,a,r)},lt:function(e,t,n,r,a){return s(e,t,n,r,a,i)},le:function(e,t,n,r,i){return s(e,t,n,r,i,a)},eq:function(e,t,n,r,i){return s(e,t,n,r,i,o)}}}),p_=h((e,t)=>{t.exports=function(e,t,n){var i={},a,o;if(typeof t==`string`&&(t=r(t)),Array.isArray(t)){var s={};for(o=0;o<t.length;o++)s[t[o]]=!0;t=s}for(a in t)t[a]=r(t[a]);var c={};for(a in t){var l=t[a];if(Array.isArray(l))for(o=0;o<l.length;o++){var u=l[o];if(n&&(c[u]=!0),u in e){if(i[a]=e[u],n)for(var d=o;d<l.length;d++)c[l[d]]=!0;break}}else a in e&&(t[a]&&(i[a]=e[a]),n&&(c[a]=!0))}if(n)for(a in e)c[a]||(i[a]=e[a]);return i};var n={};function r(e){return n[e]?n[e]:(typeof e==`string`&&(e=n[e]=e.split(/\s*,\s*|\s+/)),e)}}),m_=h((e,t)=>{var n=p_();t.exports=r;function r(e){var t;return arguments.length>1&&(e=arguments),typeof e==`string`?e=e.split(/\s/).map(parseFloat):typeof e==`number`&&(e=[e]),e.length&&typeof e[0]==`number`?t=e.length===1?{width:e[0],height:e[0],x:0,y:0}:e.length===2?{width:e[0],height:e[1],x:0,y:0}:{x:e[0],y:e[1],width:e[2]-e[0]||0,height:e[3]-e[1]||0}:e&&(e=n(e,{left:`x l left Left`,top:`y t top Top`,width:`w width W Width`,height:`h height W Width`,bottom:`b bottom Bottom`,right:`r right Right`}),t={x:e.left||0,y:e.top||0},e.width==null?e.right?t.width=e.right-t.x:t.width=0:t.width=e.width,e.height==null?e.bottom?t.height=e.bottom-t.y:t.height=0:t.height=e.height),t}}),h_=h((e,t)=>{t.exports=n;function n(e,t){if(!e||e.length==null)throw Error(`Argument should be an array`);t=t==null?1:Math.floor(t);for(var n=Array(t*2),r=0;r<t;r++){for(var i=-1/0,a=1/0,o=r,s=e.length;o<s;o+=t)e[o]>i&&(i=e[o]),e[o]<a&&(a=e[o]);n[r]=a,n[t+r]=i}return n}}),g_=h((e,t)=>{t.exports=function(){for(var e=0;e<arguments.length;e++)if(arguments[e]!==void 0)return arguments[e]}}),__=h((e,t)=>{var n=dh();t.exports=r;function r(e,t,r){if(!e)throw TypeError(`must specify data as first parameter`);if(r=(r||0)|0,Array.isArray(e)&&e[0]&&typeof e[0][0]==`number`){var i=e[0].length,a=e.length*i,o,s,c,l;(!t||typeof t==`string`)&&(t=new(n(t||`float32`))(a+r));var u=t.length-r;if(a!==u)throw Error(`source length `+a+` (`+i+`x`+e.length+`) does not match destination length `+u);for(o=0,c=r;o<e.length;o++)for(s=0;s<i;s++)t[c++]=e[o][s]===null?NaN:e[o][s]}else if(!t||typeof t==`string`){var d=n(t||`float32`);if(Array.isArray(e)||t===`array`)for(t=new d(e.length+r),o=0,c=r,l=t.length;c<l;c++,o++)t[c]=e[o]===null?NaN:e[o];else r===0?t=new d(e):(t=new d(e.length+r),t.set(e,r))}else t.set(e,r);return t}}),v_=h((e,t)=>{t.exports=function(e){var t=typeof e;return e!==null&&(t===`object`||t===`function`)}}),y_=h((e,t)=>{t.exports=Math.log2||function(e){return Math.log(e)*Math.LOG2E}}),b_=h((e,t)=>{var n=f_(),r=uh(),i=m_(),a=h_(),o=p_(),s=g_(),c=__(),l=v_(),u=dh(),d=y_(),f=1073741824;t.exports=function(e,t){t||={},e=c(e,`float64`),t=o(t,{bounds:`range bounds dataBox databox`,maxDepth:`depth maxDepth maxdepth level maxLevel maxlevel levels`,dtype:`type dtype format out dst output destination`});let r=s(t.maxDepth,255),m=s(t.bounds,a(e,2));m[0]===m[2]&&m[2]++,m[1]===m[3]&&m[3]++;let h=p(e,m),g=e.length>>>1,_;t.dtype||=`array`,typeof t.dtype==`string`?_=new(u(t.dtype))(g):t.dtype&&(_=t.dtype,Array.isArray(_)&&(_.length=g));for(let e=0;e<g;++e)_[e]=e;let v=[],y=[],b=[],x=[];C(0,0,1,_,0,1);let S=0;for(let e=0;e<v.length;e++){let t=v[e];if(_.set)_.set(t,S);else for(let e=0,n=t.length;e<n;e++)_[e+S]=t[e];let n=S+v[e].length;x[e]=[S,n],S=n}return _.range=w,_;function C(e,t,n,i,a,o){if(!i.length)return null;let s=v[a]||(v[a]=[]),c=b[a]||(b[a]=[]),l=y[a]||(y[a]=[]),u=s.length;if(a++,a>r||o>f){for(let e=0;e<i.length;e++)s.push(i[e]),c.push(o),l.push(null,null,null,null);return u}if(s.push(i[0]),c.push(o),i.length<=1)return l.push(null,null,null,null),u;let d=n*.5,p=e+d,m=t+d,g=[],_=[],x=[],S=[];for(let e=1,t=i.length;e<t;e++){let t=i[e],n=h[t*2],r=h[t*2+1];n<p?r<m?g.push(t):_.push(t):r<m?x.push(t):S.push(t)}return o<<=2,l.push(C(e,t,d,g,a,o),C(e,m,d,_,a,o+1),C(p,t,d,x,a,o+2),C(p,m,d,S,a,o+3)),u}function w(...t){let n;if(l(t[t.length-1])){let e=t.pop();!t.length&&(e.x!=null||e.l!=null||e.left!=null)&&(t=[e],n={}),n=o(e,{level:`level maxLevel`,d:`d diam diameter r radius px pxSize pixel pixelSize maxD size minSize`,lod:`lod details ranges offsets`})}else n={};t.length||(t=m);let r=i(...t),[a,c,u,f]=[Math.min(r.x,r.x+r.width),Math.min(r.y,r.y+r.height),Math.max(r.x,r.x+r.width),Math.max(r.y,r.y+r.height)],[h,g,_,b]=p([a,c,u,f],m),x=s(n.level,v.length);if(n.d!=null){let e;typeof n.d==`number`?e=[n.d,n.d]:n.d.length&&(e=n.d),x=Math.min(Math.max(Math.ceil(-d(Math.abs(e[0])/(m[2]-m[0]))),Math.ceil(-d(Math.abs(e[1])/(m[3]-m[1])))),x)}if(x=Math.min(x,v.length),n.lod)return T(h,g,_,b,x);let S=[];C(0,0,1,0,0,1);function C(t,n,r,i,o,s){if(o===null||s===null)return;let l=t+r,d=n+r;if(h>l||g>d||_<t||b<n||i>=x||o===s)return;let p=v[i];s===void 0&&(s=p.length);for(let t=o;t<s;t++){let n=p[t],r=e[n*2],i=e[n*2+1];r>=a&&r<=u&&i>=c&&i<=f&&S.push(n)}let m=y[i],T=m[o*4+0],E=m[o*4+1],D=m[o*4+2],O=m[o*4+3],k=w(m,o+1),A=r*.5,j=i+1;C(t,n,A,j,T,E||D||O||k),C(t,n+A,A,j,E,D||O||k),C(t+A,n,A,j,D,O||k),C(t+A,n+A,A,j,O,k)}function w(e,t){let n=null,r=0;for(;n===null;)if(n=e[t*4+r],r++,r>e.length)return null;return n}return S}function T(e,t,r,i,a){let o=[];for(let s=0;s<a;s++){let a=b[s],c=x[s][0],l=E(e,t,s),u=E(r,i,s),d=n.ge(a,l),f=n.gt(a,u,d,a.length-1);o[s]=[d+c,f+c]}return o}function E(e,t,n){let r=1,i=.5,a=.5,o=.5;for(let s=0;s<n;s++)r<<=2,r+=e<i?t<a?0:1:t<a?2:3,o*=.5,i+=e<i?-o:o,a+=t<a?-o:o;return r}};function p(e,t){let[n,i,a,o]=t,s=1/(a-n),c=1/(o-i),l=Array(e.length);for(let t=0,a=e.length/2;t<a;t++)l[2*t]=r((e[2*t]-n)*s,0,1),l[2*t+1]=r((e[2*t+1]-i)*c,0,1);return l}}),x_=h((e,t)=>{t.exports=b_()}),S_=h((e,t)=>{t.exports=n;function n(e){var t=0,n=0,r=0,i=0;return e.map(function(e){e=e.slice();var a=e[0],o=a.toUpperCase();if(a!=o)switch(e[0]=o,a){case`a`:e[6]+=r,e[7]+=i;break;case`v`:e[1]+=i;break;case`h`:e[1]+=r;break;default:for(var s=1;s<e.length;)e[s++]+=r,e[s++]+=i}switch(o){case`Z`:r=t,i=n;break;case`H`:r=e[1];break;case`V`:i=e[1];break;case`M`:r=t=e[1],i=n=e[2];break;default:r=e[e.length-2],i=e[e.length-1]}return e})}}),C_=h((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0});var n=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),r=Math.PI*2,i=function(e,t,n,r,i,a,o){var s=e.x,c=e.y;s*=t,c*=n;var l=r*s-i*c,u=i*s+r*c;return{x:l+a,y:u+o}},a=function(e,t){var n=t===1.5707963267948966?.551915024494:t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),r=Math.cos(e),i=Math.sin(e),a=Math.cos(e+t),o=Math.sin(e+t);return[{x:r-i*n,y:i+r*n},{x:a+o*n,y:o-a*n},{x:a,y:o}]},o=function(e,t,n,r){var i=e*r-t*n<0?-1:1,a=e*n+t*r;return a>1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)},s=function(e,t,n,i,a,s,c,l,u,d,f,p){var m=a**2,h=s**2,g=f**2,_=p**2,v=m*h-m*_-h*g;v<0&&(v=0),v/=m*_+h*g,v=Math.sqrt(v)*(c===l?-1:1);var y=v*a/s*p,b=v*-s/a*f,x=d*y-u*b+(e+n)/2,S=u*y+d*b+(t+i)/2,C=(f-y)/a,w=(p-b)/s,T=(-f-y)/a,E=(-p-b)/s,D=o(1,0,C,w),O=o(C,w,T,E);return l===0&&O>0&&(O-=r),l===1&&O<0&&(O+=r),[x,S,D,O]};e.default=function(e){var t=e.px,o=e.py,c=e.cx,l=e.cy,u=e.rx,d=e.ry,f=e.xAxisRotation,p=f===void 0?0:f,m=e.largeArcFlag,h=m===void 0?0:m,g=e.sweepFlag,_=g===void 0?0:g,v=[];if(u===0||d===0)return[];var y=Math.sin(p*r/360),b=Math.cos(p*r/360),x=b*(t-c)/2+y*(o-l)/2,S=-y*(t-c)/2+b*(o-l)/2;if(x===0&&S===0)return[];u=Math.abs(u),d=Math.abs(d);var C=x**2/u**2+S**2/d**2;C>1&&(u*=Math.sqrt(C),d*=Math.sqrt(C));var w=n(s(t,o,c,l,u,d,h,_,y,b,x,S),4),T=w[0],E=w[1],D=w[2],O=w[3],k=Math.abs(O)/(r/4);Math.abs(1-k)<1e-7&&(k=1);var A=Math.max(Math.ceil(k),1);O/=A;for(var j=0;j<A;j++)v.push(a(D,O)),D+=O;return v.map(function(e){var t=i(e[0],u,d,b,y,T,E),n=t.x,r=t.y,a=i(e[1],u,d,b,y,T,E),o=a.x,s=a.y,c=i(e[2],u,d,b,y,T,E);return{x1:n,y1:r,x2:o,y2:s,x:c.x,y:c.y}})},t.exports=e.default}),w_=h((e,t)=>{t.exports=r;var n=C_();function r(e){for(var t,r=[],o=0,s=0,c=0,l=0,u=null,d=null,f=0,p=0,m=0,h=e.length;m<h;m++){var g=e[m],_=g[0];switch(_){case`M`:c=g[1],l=g[2];break;case`A`:var v=n({px:f,py:p,cx:g[6],cy:g[7],rx:g[1],ry:g[2],xAxisRotation:g[3],largeArcFlag:g[4],sweepFlag:g[5]});if(!v.length)continue;for(var y=0,b;y<v.length;y++)b=v[y],g=[`C`,b.x1,b.y1,b.x2,b.y2,b.x,b.y],y<v.length-1&&r.push(g);break;case`S`:var x=f,S=p;(t==`C`||t==`S`)&&(x+=x-o,S+=S-s),g=[`C`,x,S,g[1],g[2],g[3],g[4]];break;case`T`:t==`Q`||t==`T`?(u=f*2-u,d=p*2-d):(u=f,d=p),g=a(f,p,u,d,g[1],g[2]);break;case`Q`:u=g[1],d=g[2],g=a(f,p,g[1],g[2],g[3],g[4]);break;case`L`:g=i(f,p,g[1],g[2]);break;case`H`:g=i(f,p,g[1],p);break;case`V`:g=i(f,p,f,g[1]);break;case`Z`:g=i(f,p,c,l);break}t=_,f=g[g.length-2],p=g[g.length-1],g.length>4?(o=g[g.length-4],s=g[g.length-3]):(o=f,s=p),r.push(g)}return r}function i(e,t,n,r){return[`C`,e,t,n,r,n,r]}function a(e,t,n,r,i,a){return[`C`,e/3+2/3*n,t/3+2/3*r,i/3+2/3*n,a/3+2/3*r,i,a]}}),T_=h((e,t)=>{t.exports=function(e){return typeof e==`string`?(e=e.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(e)&&/[\dz]$/i.test(e)&&e.length>4)):!1}}),E_=h((e,t)=>{var n=$t(),r=S_(),i=w_(),a=T_(),o=Cu();t.exports=s;function s(e){if(Array.isArray(e)&&e.length===1&&typeof e[0]==`string`&&(e=e[0]),typeof e==`string`&&(o(a(e),`String is not an SVG path.`),e=n(e)),o(Array.isArray(e),`Argument should be a string or an array of path segments.`),e=r(e),e=i(e),!e.length)return[0,0,0,0];for(var t=[1/0,1/0,-1/0,-1/0],s=0,c=e.length;s<c;s++)for(var l=e[s].slice(1),u=0;u<l.length;u+=2)l[u+0]<t[0]&&(t[0]=l[u+0]),l[u+1]<t[1]&&(t[1]=l[u+1]),l[u+0]>t[2]&&(t[2]=l[u+0]),l[u+1]>t[3]&&(t[3]=l[u+1]);return t}}),D_=h((e,t)=>{var n=Math.PI,r=l(120);t.exports=i;function i(e){for(var t,n=[],r=0,i=0,c=0,u=0,d=null,f=null,p=0,m=0,h=0,g=e.length;h<g;h++){var _=e[h],v=_[0];switch(v){case`M`:c=_[1],u=_[2];break;case`A`:_=s(p,m,_[1],_[2],l(_[3]),_[4],_[5],_[6],_[7]),_.unshift(`C`),_.length>7&&(n.push(_.splice(0,7)),_.unshift(`C`));break;case`S`:var y=p,b=m;(t==`C`||t==`S`)&&(y+=y-r,b+=b-i),_=[`C`,y,b,_[1],_[2],_[3],_[4]];break;case`T`:t==`Q`||t==`T`?(d=p*2-d,f=m*2-f):(d=p,f=m),_=o(p,m,d,f,_[1],_[2]);break;case`Q`:d=_[1],f=_[2],_=o(p,m,_[1],_[2],_[3],_[4]);break;case`L`:_=a(p,m,_[1],_[2]);break;case`H`:_=a(p,m,_[1],m);break;case`V`:_=a(p,m,p,_[1]);break;case`Z`:_=a(p,m,c,u);break}t=v,p=_[_.length-2],m=_[_.length-1],_.length>4?(r=_[_.length-4],i=_[_.length-3]):(r=p,i=m),n.push(_)}return n}function a(e,t,n,r){return[`C`,e,t,n,r,n,r]}function o(e,t,n,r,i,a){return[`C`,e/3+2/3*n,t/3+2/3*r,i/3+2/3*n,a/3+2/3*r,i,a]}function s(e,t,i,a,o,l,u,d,f,p){if(p)C=p[0],w=p[1],x=p[2],S=p[3];else{var m=c(e,t,-o);e=m.x,t=m.y,m=c(d,f,-o),d=m.x,f=m.y;var h=(e-d)/2,g=(t-f)/2,_=h*h/(i*i)+g*g/(a*a);_>1&&(_=Math.sqrt(_),i=_*i,a=_*a);var v=i*i,y=a*a,b=(l==u?-1:1)*Math.sqrt(Math.abs((v*y-v*g*g-y*h*h)/(v*g*g+y*h*h)));b==1/0&&(b=1);var x=b*i*g/a+(e+d)/2,S=b*-a*h/i+(t+f)/2,C=Math.asin(((t-S)/a).toFixed(9)),w=Math.asin(((f-S)/a).toFixed(9));C=e<x?n-C:C,w=d<x?n-w:w,C<0&&(C=n*2+C),w<0&&(w=n*2+w),u&&C>w&&(C-=n*2),!u&&w>C&&(w-=n*2)}if(Math.abs(w-C)>r){var T=w,E=d,D=f;w=C+r*(u&&w>C?1:-1),d=x+i*Math.cos(w),f=S+a*Math.sin(w);var O=s(d,f,i,a,o,0,u,E,D,[w,T,x,S])}var k=Math.tan((w-C)/4),A=4/3*i*k,j=4/3*a*k,M=[2*e-(e+A*Math.sin(C)),2*t-(t-j*Math.cos(C)),d+A*Math.sin(w),f-j*Math.cos(w),d,f];if(p)return M;O&&(M=M.concat(O));for(var N=0;N<M.length;){var P=c(M[N],M[N+1],o);M[N++]=P.x,M[N++]=P.y}return M}function c(e,t,n){return{x:e*Math.cos(n)-t*Math.sin(n),y:e*Math.sin(n)+t*Math.cos(n)}}function l(e){return n/180*e}}),O_=h((e,t)=>{var n=S_(),r=D_(),i={M:`moveTo`,C:`bezierCurveTo`};t.exports=function(e,t){e.beginPath(),r(n(t)).forEach(function(t){var n=t[0],r=t.slice(1);e[i[n]].apply(e,r)}),e.closePath()}}),k_=h((e,t)=>{var n=uh();t.exports=i;var r=0x56bc75e2d63100000;function i(e,t){t||={};var i=t.cutoff==null?.25:t.cutoff,o=t.radius==null?8:t.radius,s=t.channel||0,c,l,u,d,f,p,m,h,g,_,v;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error(`For raw data width and height should be provided by options`);c=t.width,l=t.height,d=e,p=t.stride?t.stride:Math.floor(e.length/c/l)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(h=e,m=h.getContext(`2d`),c=h.width,l=h.height,g=m.getImageData(0,0,c,l),d=g.data,p=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(h=e.canvas,m=e,c=h.width,l=h.height,g=m.getImageData(0,0,c,l),d=g.data,p=4):window.ImageData&&e instanceof window.ImageData&&(g=e,c=e.width,l=e.height,d=g.data,p=4);if(u=Math.max(c,l),window.Uint8ClampedArray&&d instanceof window.Uint8ClampedArray||window.Uint8Array&&d instanceof window.Uint8Array)for(f=d,d=Array(c*l),_=0,v=f.length;_<v;_++)d[_]=f[_*p+s]/255;else if(p!==1)throw Error(`Raw data can have only 1 value per pixel`);var y=Array(c*l),b=Array(c*l),x=Array(u),S=Array(u),C=Array(u+1),w=Array(u);for(_=0,v=c*l;_<v;_++){var T=d[_];y[_]=T===1?0:T===0?r:Math.max(0,.5-T)**2,b[_]=T===1?r:T===0?0:Math.max(0,T-.5)**2}a(y,c,l,x,S,w,C),a(b,c,l,x,S,w,C);var E=window.Float32Array?new Float32Array(c*l):Array(c*l);for(_=0,v=c*l;_<v;_++)E[_]=n(1-((y[_]-b[_])/o+i),0,1);return E}function a(e,t,n,r,i,a,s){for(var c=0;c<t;c++){for(var l=0;l<n;l++)r[l]=e[l*t+c];for(o(r,i,a,s,n),l=0;l<n;l++)e[l*t+c]=i[l]}for(l=0;l<n;l++){for(c=0;c<t;c++)r[c]=e[l*t+c];for(o(r,i,a,s,t),c=0;c<t;c++)e[l*t+c]=Math.sqrt(i[c])}}function o(e,t,n,i,a){n[0]=0,i[0]=-r,i[1]=+r;for(var o=1,s=0;o<a;o++){for(var c=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);c<=i[s];)s--,c=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);s++,n[s]=o,i[s]=c,i[s+1]=+r}for(o=0,s=0;o<a;o++){for(;i[s+1]<o;)s++;t[o]=(o-n[s])*(o-n[s])+e[n[s]]}}}),A_=h((e,t)=>{var n=E_(),r=$t(),i=O_(),a=T_(),o=k_(),s=document.createElement(`canvas`),c=s.getContext(`2d`);t.exports=l;function l(e,t){if(!a(e))throw Error(`Argument should be valid svg path string`);t||={};var l,u;t.shape?(l=t.shape[0],u=t.shape[1]):(l=s.width=t.w||t.width||200,u=s.height=t.h||t.height||200);var f=Math.min(l,u),p=t.stroke||0,m=t.viewbox||t.viewBox||n(e),h=[l/(m[2]-m[0]),u/(m[3]-m[1])],g=Math.min(h[0]||0,h[1]||0)/2;if(c.fillStyle=`black`,c.fillRect(0,0,l,u),c.fillStyle=`white`,p&&(typeof p!=`number`&&(p=1),p>0?c.strokeStyle=`white`:c.strokeStyle=`black`,c.lineWidth=Math.abs(p)),c.translate(l*.5,u*.5),c.scale(g,g),d()){var _=new Path2D(e);c.fill(_),p&&c.stroke(_)}else i(c,r(e)),c.fill(),p&&c.stroke();return c.setTransform(1,0,0,1,0,0),o(c,{cutoff:t.cutoff==null?.5:t.cutoff,radius:t.radius==null?f*.5:t.radius})}var u;function d(){if(u!=null)return u;var e=document.createElement(`canvas`).getContext(`2d`);if(e.canvas.width=e.canvas.height=1,!window.Path2D)return u=!1;var t=new Path2D(`M0,0h1v1h-1v-1Z`);e.fillStyle=`black`,e.fill(t);var n=e.getImageData(0,0,1,1);return u=n&&n.data&&n.data[3]===255}}),j_=h((e,t)=>{var n=D(),r=A_(),i=fh(),a=Ke(),o=$(),s=o.isArrayOrTypedArray,c=tn(),l=xt(),u=mh().formatColor,d=Xt(),f=Zt(),p=l_(),m=s_(),h=J().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},_=Qt().appendArrayPointValue;function v(e,t){var n,r={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},i=e._context.plotGlPixelRatio;if(t.visible!==!0)return r;if(d.hasText(t)&&(r.text=y(e,t),r.textSel=C(e,t,t.selected),r.textUnsel=C(e,t,t.unselected)),d.hasMarkers(t)&&(r.marker=x(e,t),r.markerSel=S(e,t,t.selected),r.markerUnsel=S(e,t,t.unselected),!t.unselected&&s(t.marker.opacity))){var a=t.marker.opacity;for(r.markerUnsel.opacity=Array(a.length),n=0;n<a.length;n++)r.markerUnsel.opacity[n]=h*a[n]}if(d.hasLines(t)){r.line={overlay:!0,thickness:t.line.width*i,color:t.line.color,opacity:t.opacity};var o=(m.DASHES[t.line.dash]||[1]).slice();for(n=0;n<o.length;++n)o[n]*=t.line.width*i;r.line.dashes=o}return t.error_x&&t.error_x.visible&&(r.errorX=w(t,t.error_x,i)),t.error_y&&t.error_y.visible&&(r.errorY=w(t,t.error_y,i)),t.fill&&t.fill!==`none`&&(r.fill={closed:!0,fill:t.fillcolor,thickness:0}),r}function y(e,t){var r=e._fullLayout,i=t._length,a=t.textfont,c=t.textposition,l=s(c)?c:[c],u=a.color,d=a.size,f=a.family,p=a.weight,m=a.style,h=a.variant,g={},v,y=e._context.plotGlPixelRatio,x=t.texttemplate;if(x){g.text=[];var S=r._d3locale,C=Array.isArray(x),w=C?Math.min(x.length,i):i,T=C?function(e){return x[e]}:function(){return x};for(v=0;v<w;v++){var E={i:v},D=t._module.formatLabels(E,t,r),O={};_(O,t,v),g.text.push(o.texttemplateString({data:[O,E,t._meta],fallback:t.texttemplatefallback,labels:D,locale:S,template:T(v)}))}}else s(t.text)&&t.text.length<i?g.text=t.text.slice():g.text=t.text;if(s(g.text))for(v=g.text.length;v<i;v++)g.text[v]=``;for(g.opacity=t.opacity,g.font={},g.align=[],g.baseline=[],v=0;v<l.length;v++){var k=l[v].split(/\s+/);switch(k[1]){case`left`:g.align.push(`right`);break;case`right`:g.align.push(`left`);break;default:g.align.push(k[1])}switch(k[0]){case`top`:g.baseline.push(`bottom`);break;case`bottom`:g.baseline.push(`top`);break;default:g.baseline.push(k[0])}}if(s(u))for(g.color=Array(i),v=0;v<i;v++)g.color[v]=u[v];else g.color=u;if(s(d)||Array.isArray(f)||s(p)||Array.isArray(m)||Array.isArray(h))for(g.font=Array(i),v=0;v<i;v++){var A=g.font[v]={};A.size=(o.isTypedArray(d)?d[v]:s(d)?n(d[v])?d[v]:0:d)*y,A.family=Array.isArray(f)?f[v]:f,A.weight=b(s(p)?p[v]:p),A.style=Array.isArray(m)?m[v]:m,A.variant=Array.isArray(h)?h[v]:h}else g.font={size:d*y,family:f,weight:b(p),style:m,variant:h};return g}function b(e){return e<=1e3?e>500?`bold`:`normal`:e}function x(e,t){var n=t._length,r=t.marker,a={},o,c=s(r.symbol),l=s(r.angle),d=s(r.color),m=s(r.line.color),h=s(r.opacity),g=s(r.size),_=s(r.line.width),v;if(c||(v=p.isOpenSymbol(r.symbol)),c||d||m||h||l){a.symbols=Array(n),a.angles=Array(n),a.colors=Array(n),a.borderColors=Array(n);var y=r.symbol,b=r.angle,x=u(r,r.opacity,n),S=u(r.line,r.opacity,n);if(!s(S[0])){var C=S;for(S=Array(n),o=0;o<n;o++)S[o]=C}if(!s(x[0])){var w=x;for(x=Array(n),o=0;o<n;o++)x[o]=w}if(!s(y)){var T=y;for(y=Array(n),o=0;o<n;o++)y[o]=T}if(!s(b)){var E=b;for(b=Array(n),o=0;o<n;o++)b[o]=E}for(a.symbols=y,a.angles=b,a.colors=x,a.borderColors=S,o=0;o<n;o++)c&&(v=p.isOpenSymbol(r.symbol[o])),v&&(S[o]=x[o].slice(),x[o]=x[o].slice(),x[o][3]=0);for(a.opacity=t.opacity,a.markers=Array(n),o=0;o<n;o++)a.markers[o]=j({mx:a.symbols[o],ma:a.angles[o]},t)}else v?(a.color=i(r.color,`uint8`),a.color[3]=0,a.borderColor=i(r.color,`uint8`)):(a.color=i(r.color,`uint8`),a.borderColor=i(r.line.color,`uint8`)),a.opacity=t.opacity*r.opacity,a.marker=j({mx:r.symbol,ma:r.angle},t);var D=f(t,1),O;if(g||_){var k=a.sizes=Array(n),A=a.borderSizes=Array(n),M=0,N;if(g){for(o=0;o<n;o++)k[o]=D(r.size[o]),M+=k[o];N=M/n}else for(O=D(r.size),o=0;o<n;o++)k[o]=O;if(_)for(o=0;o<n;o++)A[o]=r.line.width[o];else for(O=r.line.width,o=0;o<n;o++)A[o]=O;a.sizeAvg=N}else a.size=D(r&&r.size||10),a.borderSizes=D(r.line.width);return a}function S(e,t,n){var r=t.marker,i={};return n&&(n.marker&&n.marker.symbol?i=x(e,o.extendFlat({},r,n.marker)):n.marker&&(n.marker.size&&(i.size=n.marker.size),n.marker.color&&(i.colors=n.marker.color),n.marker.opacity!==void 0&&(i.opacity=n.marker.opacity))),i}function C(e,t,n){var r={};if(!n)return r;if(n.textfont){var i={opacity:1,text:t.text,texttemplate:t.texttemplate,textposition:t.textposition,textfont:o.extendFlat({},t.textfont)};n.textfont&&o.extendFlat(i.textfont,n.textfont),r=y(e,i)}return r}function w(e,t,n){var r={capSize:t.width*2*n,lineWidth:t.thickness*n,color:t.color};return t.copy_ystyle&&(r=e.error_y),r}var T=m.SYMBOL_SDF_SIZE,E=m.SYMBOL_SIZE,O=m.SYMBOL_STROKE,k={},A=c.symbolFuncs[0](E*.05);function j(e,t){var n=e.mx;if(n===`circle`)return null;var i,a,o=c.symbolNumber(n),s=c.symbolFuncs[o%100],l=!!c.symbolNoDot[o%100],u=!!c.symbolNoFill[o%100],d=p.isDotSymbol(n);if(e.ma&&(n+=`_`+e.ma),k[n])return k[n];var f=c.getMarkerAngle(e,t);return i=d&&!l?s(E*1.1,f)+A:s(E,f),a=r(i,{w:T,h:T,viewBox:[-E,-E,E,E],stroke:u?O:-O}),k[n]=a,a||null}function M(e,t,n){var r=n.length,i=r/2,a,o;if(d.hasLines(t)&&i)if(t.line.shape===`hv`){for(a=[],o=0;o<i-1;o++)isNaN(n[o*2])||isNaN(n[o*2+1])?a.push(NaN,NaN,NaN,NaN):(a.push(n[o*2],n[o*2+1]),!isNaN(n[o*2+2])&&!isNaN(n[o*2+3])?a.push(n[o*2+2],n[o*2+1]):a.push(NaN,NaN));a.push(n[r-2],n[r-1])}else if(t.line.shape===`hvh`){for(a=[],o=0;o<i-1;o++)if(isNaN(n[o*2])||isNaN(n[o*2+1])||isNaN(n[o*2+2])||isNaN(n[o*2+3]))!isNaN(n[o*2])&&!isNaN(n[o*2+1])?a.push(n[o*2],n[o*2+1]):a.push(NaN,NaN),a.push(NaN,NaN);else{var s=(n[o*2]+n[o*2+2])/2;a.push(n[o*2],n[o*2+1],s,n[o*2+1],s,n[o*2+3])}a.push(n[r-2],n[r-1])}else if(t.line.shape===`vhv`){for(a=[],o=0;o<i-1;o++)if(isNaN(n[o*2])||isNaN(n[o*2+1])||isNaN(n[o*2+2])||isNaN(n[o*2+3]))!isNaN(n[o*2])&&!isNaN(n[o*2+1])?a.push(n[o*2],n[o*2+1]):a.push(NaN,NaN),a.push(NaN,NaN);else{var c=(n[o*2+1]+n[o*2+3])/2;a.push(n[o*2],n[o*2+1],n[o*2],c,n[o*2+2],c)}a.push(n[r-2],n[r-1])}else if(t.line.shape===`vh`){for(a=[],o=0;o<i-1;o++)isNaN(n[o*2])||isNaN(n[o*2+1])?a.push(NaN,NaN,NaN,NaN):(a.push(n[o*2],n[o*2+1]),!isNaN(n[o*2+2])&&!isNaN(n[o*2+3])?a.push(n[o*2],n[o*2+3]):a.push(NaN,NaN));a.push(n[r-2],n[r-1])}else a=n;var l=!1;for(o=0;o<a.length;o++)if(isNaN(a[o])){l=!0;break}var u=l||a.length>m.TOO_MANY_POINTS||d.hasMarkers(t)?`rect`:`round`;if(l&&t.connectgaps){var f=a[0],p=a[1];for(o=0;o<a.length;o+=2)isNaN(a[o])||isNaN(a[o+1])?(a[o]=f,a[o+1]=p):(f=a[o],p=a[o+1])}return{join:u,positions:a}}function N(e,t,r,i,o){var s=a.getComponentMethod(`errorbars`,`makeComputeError`),c=l.getFromId(e,t.xaxis,`x`),u=l.getFromId(e,t.yaxis,`y`),d=r.length/2,f={};function p(e,i){var a=i._id.charAt(0),o=t[`error_`+a];if(o&&o.visible&&(i.type===`linear`||i.type===`log`)){for(var c=s(o),l={x:0,y:1}[a],u={x:[0,1,2,3],y:[2,3,0,1]}[a],p=new Float64Array(4*d),m=1/0,h=-1/0,g=0,_=0;g<d;g++,_+=4){var v=e[g];if(n(v)){var y=r[g*2+l],b=c(v,g),x=b[0],S=b[1];if(n(x)&&n(S)){var C=v-x,w=v+S;p[_+u[0]]=y-i.c2l(C),p[_+u[1]]=i.c2l(w)-y,p[_+u[2]]=0,p[_+u[3]]=0,m=Math.min(m,v-x),h=Math.max(h,v+S)}}}f[a]={positions:r,errors:p,_bnds:[m,h]}}}return p(i,c),p(o,u),f}function P(e,t,n,r){var i=t._length,a={},o;if(d.hasMarkers(t)){var c=n.font,l=n.align,u=n.baseline;for(a.offset=Array(i),o=0;o<i;o++){var f=r.sizes?r.sizes[o]:r.size,p=s(c)?c[o].size:c.size,m=s(l)?l.length>1?l[o]:l[0]:l,h=s(u)?u.length>1?u[o]:u[0]:u,_=g[m],v=g[h],y=f?f/.8+1:0,b=-v*y-v*.5;a.offset[o]=[_*y/p,b/p]}}return a}t.exports={style:v,markerStyle:x,markerSelection:S,linePositions:M,errorBarPositions:N,textPosition:P}}),M_=h((e,t)=>{var n=$();t.exports=function(e,t){var r=t._scene,i={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},a={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return t._scene||(r=t._scene={},r.init=function(){n.extendFlat(r,a,i)},r.init(),r.update=function(e){var t=n.repeat(e,r.count);if(r.fill2d&&r.fill2d.update(t),r.scatter2d&&r.scatter2d.update(t),r.line2d&&r.line2d.update(t),r.error2d&&r.error2d.update(t.concat(t)),r.select2d&&r.select2d.update(t),r.glText)for(var i=0;i<r.count;i++)r.glText[i].update(e)},r.draw=function(){for(var e=r.count,t=r.fill2d,i=r.error2d,a=r.line2d,o=r.scatter2d,s=r.glText,c=r.select2d,l=r.selectBatch,u=r.unselectBatch,d=0;d<e;d++){if(t&&r.fillOrder[d]&&t.draw(r.fillOrder[d]),a&&r.lineOptions[d]&&a.draw(d),i&&(r.errorXOptions[d]&&i.draw(d),r.errorYOptions[d]&&i.draw(d+e)),o&&r.markerOptions[d])if(u[d].length){var f=n.repeat([],r.count);f[d]=u[d],o.draw(f)}else l[d].length||o.draw(d);s[d]&&r.textOptions[d]&&s[d].render()}c&&c.draw(l),r.dirty=!1},r.destroy=function(){r.fill2d&&r.fill2d.destroy&&r.fill2d.destroy(),r.scatter2d&&r.scatter2d.destroy&&r.scatter2d.destroy(),r.error2d&&r.error2d.destroy&&r.error2d.destroy(),r.line2d&&r.line2d.destroy&&r.line2d.destroy(),r.select2d&&r.select2d.destroy&&r.select2d.destroy(),r.glText&&r.glText.forEach(function(e){e.destroy&&e.destroy()}),r.lineOptions=null,r.fillOptions=null,r.markerOptions=null,r.markerSelectedOptions=null,r.markerUnselectedOptions=null,r.errorXOptions=null,r.errorYOptions=null,r.textOptions=null,r.textSelectedOptions=null,r.textUnselectedOptions=null,r.selectBatch=null,r.unselectBatch=null,t._scene=null}),r.dirty||n.extendFlat(r,i),r}}),N_=h((e,t)=>{var n=x_(),r=$(),i=xt(),a=on().findExtremes,o=ii(),s=ci(),c=s.calcMarkerSize,l=s.calcAxisExpansion,u=s.setFirstScatter,d=ai(),f=j_(),p=M_(),m=O().BADNUM,h=s_().TOO_MANY_POINTS;t.exports=function(e,t){var r=e._fullLayout,a=t._xA=i.getFromId(e,t.xaxis,`x`),s=t._yA=i.getFromId(e,t.yaxis,`y`),f=r._plots[t.xaxis+t.yaxis],v=t._length,y=v>=h,b=v*2,x={},S,C=a.makeCalcdata(t,`x`),w=s.makeCalcdata(t,`y`),T=o(t,a,`x`,C),E=o(t,s,`y`,w),D=T.vals,O=E.vals;t._x=D,t._y=O,t.xperiodalignment&&(t._origX=C,t._xStarts=T.starts,t._xEnds=T.ends),t.yperiodalignment&&(t._origY=w,t._yStarts=E.starts,t._yEnds=E.ends);var k=Array(b),A=Array(v);for(S=0;S<v;S++)k[S*2]=D[S]===m?NaN:D[S],k[S*2+1]=O[S]===m?NaN:O[S],A[S]=S;if(a.type===`log`)for(S=0;S<b;S+=2)k[S]=a.c2l(k[S]);if(s.type===`log`)for(S=1;S<b;S+=2)k[S]=s.c2l(k[S]);y&&a.type!==`log`&&s.type!==`log`?x.tree=n(k):x.ids=A,d(e,t);var j=_(e,f,t,k,D,O),M=p(e,f);u(r,t);var N;return y?j.marker&&(N=j.marker.sizeAvg||Math.max(j.marker.size,3)):N=c(t,v),l(e,t,a,s,D,O,N),j.errorX&&g(t,a,j.errorX),j.errorY&&g(t,s,j.errorY),j.fill&&!M.fill2d&&(M.fill2d=!0),j.marker&&!M.scatter2d&&(M.scatter2d=!0),j.line&&!M.line2d&&(M.line2d=!0),(j.errorX||j.errorY)&&!M.error2d&&(M.error2d=!0),j.text&&!M.glText&&(M.glText=!0),j.marker&&(j.marker.snap=v),M.lineOptions.push(j.line),M.errorXOptions.push(j.errorX),M.errorYOptions.push(j.errorY),M.fillOptions.push(j.fill),M.markerOptions.push(j.marker),M.markerSelectedOptions.push(j.markerSel),M.markerUnselectedOptions.push(j.markerUnsel),M.textOptions.push(j.text),M.textSelectedOptions.push(j.textSel),M.textUnselectedOptions.push(j.textUnsel),M.selectBatch.push([]),M.unselectBatch.push([]),x._scene=M,x.index=M.count,x.x=D,x.y=O,x.positions=k,M.count++,[{x:!1,y:!1,t:x,trace:t}]};function g(e,t,n){var r=e._extremes[t._id],i=a(t,n._bnds,{padded:!0});r.min=r.min.concat(i.min),r.max=r.max.concat(i.max)}function _(e,t,n,i,a,o){var s=f.style(e,n);if(s.marker&&(s.marker.positions=i),s.line&&i.length>1&&r.extendFlat(s.line,f.linePositions(e,n,i)),s.errorX||s.errorY){var c=f.errorBarPositions(e,n,i,a,o);s.errorX&&r.extendFlat(s.errorX,c.x),s.errorY&&r.extendFlat(s.errorY,c.y)}return s.text&&(r.extendFlat(s.text,{positions:i},f.textPosition(e,n,s.text,s.marker)),r.extendFlat(s.textSel,{positions:i},f.textPosition(e,n,s.text,s.markerSel)),r.extendFlat(s.textUnsel,{positions:i},f.textPosition(e,n,s.text,s.markerUnsel))),s}}),P_=h((e,t)=>{var n=$(),r=q(),i=J().DESELECTDIM;function a(e){var t=e[0],a=t.trace,o=t.t,s=o._scene,c=o.index,l=s.selectBatch[c],u=s.unselectBatch[c],d=s.textOptions[c],f=s.textSelectedOptions[c]||{},p=s.textUnselectedOptions[c]||{},m=n.extendFlat({},d),h,g;if(l.length||u.length){var _=f.color,v=p.color,y=d.color,b=n.isArrayOrTypedArray(y);for(m.color=Array(a._length),h=0;h<l.length;h++)g=l[h],m.color[g]=_||(b?y[g]:y);for(h=0;h<u.length;h++){g=u[h];var x=b?y[g]:y;m.color[g]=v||(_?x:r.addOpacity(x,i))}}s.glText[c].update(m)}t.exports={styleTextSelection:a}}),F_=h((e,t)=>{var n=Xt(),r=P_().styleTextSelection;t.exports=function(e,t){var i=e.cd,a=e.xaxis,o=e.yaxis,s=[],c=i[0].trace,l=i[0].t,u=c._length,d=l.x,f=l.y,p=l._scene,m=l.index;if(!p)return s;var h=n.hasText(c),g=n.hasMarkers(c),_=!g&&!h;if(c.visible!==!0||_)return s;var v=[],y=[];if(t!==!1&&!t.degenerate)for(var b=0;b<u;b++)t.contains([l.xpx[b],l.ypx[b]],!1,b,e)?(v.push(b),s.push({pointNumber:b,x:a.c2d(d[b]),y:o.c2d(f[b])})):y.push(b);if(g){var x=p.scatter2d;if(!v.length&&!y.length){var S=Array(p.count);S[m]=p.markerOptions[m],x.update.apply(x,S)}else if(!p.selectBatch[m].length&&!p.unselectBatch[m].length){var C=Array(p.count);C[m]=p.markerUnselectedOptions[m],x.update.apply(x,C)}}return p.selectBatch[m]=v,p.unselectBatch[m]=y,h&&r(i),s}}),I_=h((e,t)=>{var n=o_();t.exports={moduleType:`trace`,name:`scattergl`,basePlotModule:Ai(),categories:[`gl`,`regl`,`cartesian`,`symbols`,`errorBarsOK`,`showLegend`,`scatter-like`],attributes:c_(),supplyDefaults:u_(),crossTraceDefaults:ni(),colorbar:gi(),formatLabels:d_(),calc:N_(),hoverPoints:n.hoverPoints,selectPoints:F_(),meta:{}}}),L_=h((e,t)=>{var n=uh();t.exports=r,t.exports.to=r,t.exports.from=i;function r(e,t){t??=!0;var r=e[0],i=e[1],a=e[2],o=e[3];return o??=t?1:255,t&&(r*=255,i*=255,a*=255,o*=255),r=n(r,0,255)&255,i=n(i,0,255)&255,a=n(a,0,255)&255,o=n(o,0,255)&255,r*16777216+(i<<16)+(a<<8)+o}function i(e,t){e=+e;var n=e>>>24,r=(e&16711680)>>>16,i=(e&65280)>>>8,a=e&255;return t===!1?[n,r,i,a]:[n/255,r/255,i/255,a/255]}}),R_=h((e,t)=>{var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(e==null)throw TypeError(`Object.assign cannot be called with null or undefined`);return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String(`abc`);if(e[5]=`de`,Object.getOwnPropertyNames(e)[0]===`5`)return!1;for(var t={},n=0;n<10;n++)t[`_`+String.fromCharCode(n)]=n;if(Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(``)!==`0123456789`)return!1;var r={};return`abcdefghijklmnopqrst`.split(``).forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join(``)===`abcdefghijklmnopqrst`}catch{return!1}}t.exports=o()?Object.assign:function(e,t){for(var o,s=a(e),c,l=1;l<arguments.length;l++){for(var u in o=Object(arguments[l]),o)r.call(o,u)&&(s[u]=o[u]);if(n){c=n(o);for(var d=0;d<c.length;d++)i.call(o,c[d])&&(s[c[d]]=o[c[d]])}}return s}}),z_=h((e,t)=>{t.exports=function(e){typeof e==`string`&&(e=[e]);for(var t=[].slice.call(arguments,1),n=[],r=0;r<e.length-1;r++)n.push(e[r],t[r]||``);return n.push(e[r]),n.join(``)}}),B_=h((e,t)=>{t.exports=function(e,t,n){Array.isArray(n)||(n=[].slice.call(arguments,2));for(var r=0,i=n.length;r<i;r++){var a=n[r];for(var o in a)if(!(t[o]!==void 0&&!Array.isArray(t[o])&&e[o]===t[o])&&o in t){var s;if(a[o]===!0)s=t[o];else if(a[o]===!1||typeof a[o]==`function`&&(s=a[o](t[o],e,t),s===void 0))continue;e[o]=s}}return e}}),V_=h((e,t)=>{t.exports=typeof navigator<`u`&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}),H_=h((e,t)=>{t.exports=i,t.exports.float32=t.exports.float=i,t.exports.fract32=t.exports.fract=r;var n=new Float32Array(1);function r(e,t){if(e.length){if(e instanceof Float32Array)return new Float32Array(e.length);t instanceof Float32Array||(t=i(e));for(var n=0,r=t.length;n<r;n++)t[n]=e[n]-t[n];return t}return i(e-i(e))}function i(e){return e.length?e instanceof Float32Array?e:new Float32Array(e):(n[0]=e,n[0])}}),U_=h((e,t)=>{function n(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function r(e,t){return o(e)||n(e,t)||c(e,t)||d()}function i(e){return a(e)||s(e)||c(e)||u()}function a(e){if(Array.isArray(e))return l(e)}function o(e){if(Array.isArray(e))return e}function s(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function c(e,t){if(e){if(typeof e==`string`)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}}function l(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(){throw TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=fh(),p=h_(),m=L_(),h=x_(),g=R_(),_=z_(),v=p_(),y=B_(),b=__(),x=V_(),S=H_(),C=m_(),w=T;function T(e,t){var n=this;if(!(this instanceof T))return new T(e,t);typeof e==`function`?(t||={},t.regl=e):(t=e,e=null),t&&t.length&&(t.positions=t),e=t.regl;var r=e._gl,i,a=[],o={},s=[],c=[null],l=[null],u=255;this.tooManyColors=x,i=e.texture({data:new Uint8Array(u*4),width:u,height:1,type:`uint8`,format:`rgba`,wrapS:`clamp`,wrapT:`clamp`,mag:`nearest`,min:`nearest`}),g(this,{regl:e,gl:r,groups:s,markerCache:l,markerTextures:c,palette:a,paletteIds:o,paletteTexture:i,maxColors:u,maxSize:100,canvas:r.canvas}),this.update(t);var d={uniforms:{constPointSize:!!t.constPointSize,opacity:e.prop(`opacity`),paletteSize:function(e,t){return[n.tooManyColors?0:u,i.height]},pixelRatio:e.context(`pixelRatio`),scale:e.prop(`scale`),scaleFract:e.prop(`scaleFract`),translate:e.prop(`translate`),translateFract:e.prop(`translateFract`),markerTexture:e.prop(`markerTexture`),paletteTexture:i},attributes:{x:function(e,t){return t.xAttr||{buffer:t.positionBuffer,stride:8,offset:0}},y:function(e,t){return t.yAttr||{buffer:t.positionBuffer,stride:8,offset:4}},xFract:function(e,t){return t.xAttr?{constant:[0,0]}:{buffer:t.positionFractBuffer,stride:8,offset:0}},yFract:function(e,t){return t.yAttr?{constant:[0,0]}:{buffer:t.positionFractBuffer,stride:8,offset:4}},size:function(e,t){return t.size.length?{buffer:t.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(t.size*255/n.maxSize)]}},borderSize:function(e,t){return t.borderSize.length?{buffer:t.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(t.borderSize*255/n.maxSize)]}},colorId:function(e,t){return t.color.length?{buffer:t.colorBuffer,stride:n.tooManyColors?8:4,offset:0}:{constant:n.tooManyColors?a.slice(t.color*4,t.color*4+4):[t.color]}},borderColorId:function(e,t){return t.borderColor.length?{buffer:t.colorBuffer,stride:n.tooManyColors?8:4,offset:n.tooManyColors?4:2}:{constant:n.tooManyColors?a.slice(t.borderColor*4,t.borderColor*4+4):[t.borderColor]}},isActive:function(e,t){return t.activation===!0?{constant:[1]}:t.activation?t.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:e.prop(`viewport`)},viewport:e.prop(`viewport`),stencil:{enable:!1},depth:{enable:!1},elements:e.prop(`elements`),count:e.prop(`count`),offset:e.prop(`offset`),primitive:`points`},f=g({},d);f.frag=_([`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;
}
}
`]),f.vert=_([`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=e(f);var p=g({},d);p.frag=_([`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;
}
`]),p.vert=_([`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;
}
`]),x&&(p.frag=p.frag.replace(`smoothstep`,`smoothStep`),f.frag=f.frag.replace(`smoothstep`,`smoothStep`)),this.drawCircle=e(p)}T.defaults={color:`black`,borderColor:`transparent`,borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},T.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},T.prototype.draw=function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=this.groups;if(n.length===1&&Array.isArray(n[0])&&(n[0][0]===null||Array.isArray(n[0][0]))&&(n=n[0]),this.regl._refresh(),n.length)for(var a=0;a<n.length;a++)this.drawItem(a,n[a]);else i.forEach(function(t,n){e.drawItem(n)});return this},T.prototype.drawItem=function(e,t){var n=this.groups,r=n[e];if(typeof t==`number`&&(e=t,r=n[t],t=null),r&&r.count&&r.opacity){r.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,r,t));for(var a=[],o=1;o<r.activation.length;o++)!r.activation[o]||r.activation[o]!==!0&&!r.activation[o].data.length||a.push.apply(a,i(this.getMarkerDrawOptions(o,r,t)));a.length&&this.drawMarker(a)}},T.prototype.getMarkerDrawOptions=function(e,t,n){var i=t.range,a=t.tree,o=t.viewport,s=t.activation,c=t.selectionBuffer,l=t.count;if(this.regl,!a)return n?[g({},t,{markerTexture:this.markerTextures[e],activation:s[e],count:n.length,elements:n,offset:0})]:[g({},t,{markerTexture:this.markerTextures[e],activation:s[e],offset:0})];var u=[],d=a.range(i,{lod:!0,px:[(i[2]-i[0])/o.width,(i[3]-i[1])/o.height]});if(n){for(var f=s[e].data,p=new Uint8Array(l),m=0;m<n.length;m++){var h=n[m];p[h]=f?f[h]:1}c.subdata(p)}for(var _=d.length;_--;){var v=r(d[_],2),y=v[0],b=v[1];u.push(g({},t,{markerTexture:this.markerTextures[e],activation:n?c:s[e],offset:y,count:b-y}))}return u},T.prototype.update=function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length){n.length===1&&Array.isArray(n[0])&&(n=n[0]);var i=this.groups,a=this.gl,o=this.regl,s=this.maxSize,c=this.maxColors,l=this.palette;this.groups=i=n.map(function(t,n){var r=i[n];if(t===void 0)return r;t===null?t={positions:null}:typeof t==`function`?t={ondraw:t}:typeof t[0]==`number`&&(t={positions:t}),t=v(t,{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`}),t.positions===null&&(t.positions=[]),t.tooManyColors!=null&&(e.tooManyColors=t.tooManyColors),r||(i[n]=r={id:n,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:o.buffer({data:new Uint8Array,usage:`stream`,type:`uint8`}),sizeBuffer:o.buffer({data:new Uint8Array,usage:`dynamic`,type:`uint8`}),colorBuffer:o.buffer({data:new Uint8Array,usage:`dynamic`,type:`uint8`}),positionBuffer:o.buffer({data:new Uint8Array,usage:`dynamic`,type:`float`}),positionFractBuffer:o.buffer({data:new Uint8Array,usage:`dynamic`,type:`float`})},t=g({},T.defaults,t)),t.positions&&!(`marker`in t)&&(t.marker=r.marker,delete r.marker),t.marker&&!(`positions`in t)&&(t.positions=r.positions,delete r.positions);var u=0,d=0;if(y(r,t,[{snap:!0,size:function(e,t){return e??=T.defaults.size,u+=e&&e.length?1:0,e},borderSize:function(e,t){return e??=T.defaults.borderSize,u+=e&&e.length?1:0,e},opacity:parseFloat,color:function(t,n){return t??=T.defaults.color,t=e.updateColor(t),d++,t},borderColor:function(t,n){return t??=T.defaults.borderColor,t=e.updateColor(t),d++,t},bounds:function(e,t,n){return`range`in n||(n.range=null),e},positions:function(e,t,n){var r=t.snap,i=t.positionBuffer,a=t.positionFractBuffer,s=t.selectionBuffer;if(e.x||e.y)return e.x.length?t.xAttr={buffer:o.buffer(e.x),offset:0,stride:4,count:e.x.length}:t.xAttr={buffer:e.x.buffer,offset:e.x.offset*4||0,stride:(e.x.stride||1)*4,count:e.x.count},e.y.length?t.yAttr={buffer:o.buffer(e.y),offset:0,stride:4,count:e.y.length}:t.yAttr={buffer:e.y.buffer,offset:e.y.offset*4||0,stride:(e.y.stride||1)*4,count:e.y.count},t.count=Math.max(t.xAttr.count,t.yAttr.count),e;e=b(e,`float64`);var c=t.count=Math.floor(e.length/2),l=t.bounds=c?p(e,2):null;if(!n.range&&!t.range&&(delete t.range,n.range=l),!n.marker&&!t.marker&&(delete t.marker,n.marker=null),r&&(r===!0||c>r)?t.tree=h(e,{bounds:l}):r&&r.length&&(t.tree=r),t.tree){var u={primitive:`points`,usage:`static`,data:t.tree,type:`uint32`};t.elements?t.elements(u):t.elements=o.elements(u)}var d=S.float32(e);return i({data:d,usage:`dynamic`}),a({data:S.fract32(e,d),usage:`dynamic`}),s({data:new Uint8Array(c),type:`uint8`,usage:`stream`}),e}},{marker:function(t,n,r){var i=n.activation;if(i.forEach(function(e){return e&&e.destroy&&e.destroy()}),i.length=0,!t||typeof t[0]==`number`){var a=e.addMarker(t);i[a]=!0}else{for(var s=[],c=0,l=Math.min(t.length,n.count);c<l;c++){var u=e.addMarker(t[c]);s[u]||(s[u]=new Uint8Array(n.count)),s[u][c]=1}for(var d=0;d<s.length;d++)if(s[d]){var f={data:s[d],type:`uint8`,usage:`static`};i[d]?i[d](f):i[d]=o.buffer(f),i[d].data=s[d]}}return t},range:function(e,t,n){var r=t.bounds;if(r)return e||=r,t.scale=[1/(e[2]-e[0]),1/(e[3]-e[1])],t.translate=[-e[0],-e[1]],t.scaleFract=S.fract(t.scale),t.translateFract=S.fract(t.translate),e},viewport:function(e){return C(e||[a.drawingBufferWidth,a.drawingBufferHeight])}}]),u){var f=r,m=f.count,_=f.size,x=f.borderSize,w=f.sizeBuffer,E=new Uint8Array(m*2);if(_.length||x.length)for(var D=0;D<m;D++)E[D*2]=Math.round((_[D]==null?_:_[D])*255/s),E[D*2+1]=Math.round((x[D]==null?x:x[D])*255/s);w({data:E,usage:`dynamic`})}if(d){var O=r,k=O.count,A=O.color,j=O.borderColor,M=O.colorBuffer,N;if(e.tooManyColors){if(A.length||j.length){N=new Uint8Array(k*8);for(var P=0;P<k;P++){var F=A[P];N[P*8]=l[F*4],N[P*8+1]=l[F*4+1],N[P*8+2]=l[F*4+2],N[P*8+3]=l[F*4+3];var I=j[P];N[P*8+4]=l[I*4],N[P*8+5]=l[I*4+1],N[P*8+6]=l[I*4+2],N[P*8+7]=l[I*4+3]}}}else if(A.length||j.length){N=new Uint8Array(k*4+2);for(var L=0;L<k;L++)A[L]!=null&&(N[L*4]=A[L]%c,N[L*4+1]=Math.floor(A[L]/c)),j[L]!=null&&(N[L*4+2]=j[L]%c,N[L*4+3]=Math.floor(j[L]/c))}M({data:N||new Uint8Array,type:`uint8`,usage:`dynamic`})}return r})}},T.prototype.addMarker=function(e){var t=this.markerTextures,n=this.regl,r=this.markerCache,i=e==null?0:r.indexOf(e);if(i>=0)return i;var a;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)a=e;else{a=new Uint8Array(e.length);for(var o=0,s=e.length;o<s;o++)a[o]=e[o]*255}var c=Math.floor(Math.sqrt(a.length));return i=t.length,r.push(e),t.push(n.texture({channels:1,data:a,radius:c,mag:`linear`,min:`linear`})),i},T.prototype.updateColor=function(e){var t=this.paletteIds,n=this.palette,r=this.maxColors;Array.isArray(e)||(e=[e]);var i=[];if(typeof e[0]==`number`){var a=[];if(Array.isArray(e))for(var o=0;o<e.length;o+=4)a.push(e.slice(o,o+4));else for(var s=0;s<e.length;s+=4)a.push(e.subarray(s,s+4));e=a}for(var c=0;c<e.length;c++){var l=e[c];l=f(l,`uint8`);var u=m(l,!1);if(t[u]==null){var d=n.length;t[u]=Math.floor(d/4),n[d]=l[0],n[d+1]=l[1],n[d+2]=l[2],n[d+3]=l[3]}i[c]=t[u]}return!this.tooManyColors&&n.length>r*4&&(this.tooManyColors=!0),this.updatePalette(n),i.length===1?i[0]:i},T.prototype.updatePalette=function(e){if(!this.tooManyColors){var t=this.maxColors,n=this.paletteTexture,r=Math.ceil(e.length*.25/t);if(r>1){e=e.slice();for(var i=e.length*.25%t;i<r*t;i++)e.push(0,0,0,0)}n.height<r&&n.resize(t,r),n.subimage({width:Math.min(e.length*.25,t),height:r,data:e},0,0)}},T.prototype.destroy=function(){return this.groups.forEach(function(e){e.sizeBuffer.destroy(),e.positionBuffer.destroy(),e.positionFractBuffer.destroy(),e.colorBuffer.destroy(),e.activation.forEach(function(e){return e&&e.destroy&&e.destroy()}),e.selectionBuffer.destroy(),e.elements&&e.elements.destroy()}),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach(function(e){return e&&e.destroy&&e.destroy()}),this};var E=R_();t.exports=function(e,t){var n=new w(e,t),r=n.render.bind(n);return E(r,{render:r,update:n.update.bind(n),draw:n.draw.bind(n),destroy:n.destroy.bind(n),regl:n.regl,gl:n.gl,canvas:n.gl.canvas,groups:n.groups,markers:n.markerCache,palette:n.palette}),r}}),W_=h((e,t)=>{t.exports=n,t.exports.default=n;function n(e,t,n){n||=2;var i=t&&t.length,o=i?t[0]*n:e.length,s=r(e,0,o,n,!0),c=[];if(!s||s.next===s.prev)return c;var l,d,f,p,m,h,g;if(i&&(s=u(e,t,s,n)),e.length>80*n){l=f=e[0],d=p=e[1];for(var _=n;_<o;_+=n)m=e[_],h=e[_+1],m<l&&(l=m),h<d&&(d=h),m>f&&(f=m),h>p&&(p=h);g=Math.max(f-l,p-d),g=g===0?0:32767/g}return a(s,c,n,l,d,g,0),c}function r(e,t,n,r,i){var a,o;if(i===N(e,t,n,r)>0)for(a=t;a<n;a+=r)o=A(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=A(a,e[a],e[a+1],o);return o&&S(o,o.next)&&(j(o),o=o.next),o}function i(e,t){if(!e)return e;t||=e;var n=e,r;do if(r=!1,!n.steiner&&(S(n,n.next)||x(n.prev,n,n.next)===0)){if(j(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function a(e,t,n,r,u,d,f){if(e){!f&&d&&h(e,r,u,d);for(var p=e,m,g;e.prev!==e.next;){if(m=e.prev,g=e.next,d?s(e,r,u,d):o(e)){t.push(m.i/n|0),t.push(e.i/n|0),t.push(g.i/n|0),j(e),e=g.next,p=g.next;continue}if(e=g,e===p){f?f===1?(e=c(i(e),t,n),a(e,t,n,r,u,d,2)):f===2&&l(e,t,n,r,u,d):a(i(e),t,n,r,u,d,1);break}}}}function o(e){var t=e.prev,n=e,r=e.next;if(x(t,n,r)>=0)return!1;for(var i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=i<a?i<o?i:o:a<o?a:o,d=s<c?s<l?s:l:c<l?c:l,f=i>a?i>o?i:o:a>o?a:o,p=s>c?s>l?s:l:c>l?c:l,m=r.next;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&y(i,s,a,c,o,l,m.x,m.y)&&x(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function s(e,t,n,r){var i=e.prev,a=e,o=e.next;if(x(i,a,o)>=0)return!1;for(var s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=s<c?s<l?s:l:c<l?c:l,m=u<d?u<f?u:f:d<f?d:f,h=s>c?s>l?s:l:c>l?c:l,g=u>d?u>f?u:f:d>f?d:f,v=_(p,m,t,n,r),b=_(h,g,t,n,r),S=e.prevZ,C=e.nextZ;S&&S.z>=v&&C&&C.z<=b;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0||(S=S.prevZ,C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;S&&S.z>=v;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;C&&C.z<=b;){if(C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function c(e,t,n){var r=e;do{var a=r.prev,o=r.next.next;!S(a,o)&&C(a,r,r.next,o)&&D(a,o)&&D(o,a)&&(t.push(a.i/n|0),t.push(r.i/n|0),t.push(o.i/n|0),j(r),j(r.next),r=e=o),r=r.next}while(r!==e);return i(r)}function l(e,t,n,r,o,s){var c=e;do{for(var l=c.next.next;l!==c.prev;){if(c.i!==l.i&&b(c,l)){var u=k(c,l);c=i(c,c.next),u=i(u,u.next),a(c,t,n,r,o,s,0),a(u,t,n,r,o,s,0);return}l=l.next}c=c.next}while(c!==e)}function u(e,t,n,i){var a=[],o,s,c,l,u;for(o=0,s=t.length;o<s;o++)c=t[o]*i,l=o<s-1?t[o+1]*i:e.length,u=r(e,c,l,i,!1),u===u.next&&(u.steiner=!0),a.push(v(u));for(a.sort(d),o=0;o<a.length;o++)n=f(a[o],n);return n}function d(e,t){return e.x-t.x}function f(e,t){var n=p(e,t);if(!n)return t;var r=k(n,e);return i(r,r.next),i(n,n.next)}function p(e,t){var n=t,r=e.x,i=e.y,a=-1/0,o;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a&&(a=s,o=n.x<n.next.x?n:n.next,s===r))return o}n=n.next}while(n!==t);if(!o)return null;var c=o,l=o.x,u=o.y,d=1/0,f;n=o;do r>=n.x&&n.x>=l&&r!==n.x&&y(i<u?r:a,i,l,u,i<u?a:r,i,n.x,n.y)&&(f=Math.abs(i-n.y)/(r-n.x),D(n,e)&&(f<d||f===d&&(n.x>o.x||n.x===o.x&&m(o,n)))&&(o=n,d=f)),n=n.next;while(n!==c);return o}function m(e,t){return x(e.prev,e,t.prev)<0&&x(t.next,e,e.next)<0}function h(e,t,n,r){var i=e;do i.z===0&&(i.z=_(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ,r);t++);for(c=l;s>0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return e}function _(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function v(e){var t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function y(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function b(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!E(e,t)&&(D(e,t)&&D(t,e)&&O(e,t)&&(x(e.prev,e,t.prev)||x(e,t.prev,t))||S(e,t)&&x(e.prev,e,e.next)>0&&x(t.prev,t,t.next)>0)}function x(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,n,r){var i=T(x(e,t,n)),a=T(x(e,t,r)),o=T(x(n,r,e)),s=T(x(n,r,t));return!!(i!==a&&o!==s||i===0&&w(e,n,t)||a===0&&w(e,r,t)||o===0&&w(n,e,r)||s===0&&w(n,t,r))}function w(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function T(e){return e>0?1:e<0?-1:0}function E(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&C(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function D(e,t){return x(e.prev,e,e.next)<0?x(e,t,e.next)>=0&&x(e,e.prev,t)>=0:x(e,t,e.prev)<0||x(e,e.next,t)<0}function O(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function k(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function A(e,t,n,r){var i=new M(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function j(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}n.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(N(e,0,a,n));if(i)for(var s=0,c=t.length;s<c;s++){var l=t[s]*n,u=s<c-1?t[s+1]*n:e.length;o-=Math.abs(N(e,l,u,n))}var d=0;for(s=0;s<r.length;s+=3){var f=r[s]*n,p=r[s+1]*n,m=r[s+2]*n;d+=Math.abs((e[f]-e[m])*(e[p+1]-e[f+1])-(e[f]-e[p])*(e[m+1]-e[f+1]))}return o===0&&d===0?0:Math.abs((d-o)/o)};function N(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}n.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[i][a][o]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n}}),G_=h((e,t)=>{var n=h_();t.exports=r;function r(e,t,r){if(!e||e.length==null)throw Error(`Argument should be an array`);t??=1,r??=n(e,t);for(var i=0;i<t;i++){var a=r[t+i],o=r[i],s=i,c=e.length;if(a===1/0&&o===-1/0)for(s=i;s<c;s+=t)e[s]=e[s]===a?1:e[s]===o?0:.5;else if(a===1/0)for(s=i;s<c;s+=t)e[s]=e[s]===a?1:0;else if(o===-1/0)for(s=i;s<c;s+=t)e[s]=e[s]===o?0:1;else{var l=a-o;for(s=i;s<c;s+=t)isNaN(e[s])||(e[s]=l===0?.5:(e[s]-o)/l)}}return e}}),K_=h((e,t)=>{t.exports=function(){var e,t;if(typeof WeakMap!=`function`)return!1;try{e=new WeakMap([[t={},`one`],[{},`two`],[{},`three`]])}catch{return!1}return!(String(e)!==`[object WeakMap]`||typeof e.set!=`function`||e.set({},1)!==e||typeof e.delete!=`function`||typeof e.has!=`function`||e.get(t)!==`one`)}}),q_=h((e,t)=>{t.exports=function(){}}),J_=h((e,t)=>{var n=q_()();t.exports=function(e){return e!==n&&e!==null}}),Y_=h((e,t)=>{var n=Object.create,r=Object.getPrototypeOf,i={};t.exports=function(){var e=Object.setPrototypeOf,t=arguments[0]||n;return typeof e==`function`?r(e(t(null),i))===i:!1}}),X_=h((e,t)=>{var n=J_(),r={function:!0,object:!0};t.exports=function(e){return n(e)&&r[typeof e]||!1}}),Z_=h((e,t)=>{var n=J_();t.exports=function(e){if(!n(e))throw TypeError(`Cannot use null or undefined`);return e}}),Q_=h((e,t)=>{var n=Object.create,r;Y_()()||(r=$_()),t.exports=function(){var e,t,i;return!r||r.level!==1?n:(e={},t={},i={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(e){if(e===`__proto__`){t[e]={configurable:!0,enumerable:!1,writable:!0,value:void 0};return}t[e]=i}),Object.defineProperties(e,t),Object.defineProperty(r,`nullPolyfill`,{configurable:!1,enumerable:!1,writable:!1,value:e}),function(t,r){return n(t===null?e:t,r)})}()}),$_=h((e,t)=>{var n=X_(),r=Z_(),i=Object.prototype.isPrototypeOf,a=Object.defineProperty,o={configurable:!0,enumerable:!1,writable:!0,value:void 0},s=function(e,t){if(r(e),t===null||n(t))return e;throw TypeError(`Prototype must be null or an object`)};t.exports=function(e){var t,n;return e?(e.level===2?e.set?(n=e.set,t=function(e,t){return n.call(s(e,t),t),e}):t=function(e,t){return s(e,t).__proto__=t,e}:t=function e(t,n){var r;return s(t,n),r=i.call(e.nullPolyfill,t),r&&delete e.nullPolyfill.__proto__,n===null&&(n=e.nullPolyfill),t.__proto__=n,r&&a(e.nullPolyfill,`__proto__`,o),t},Object.defineProperty(t,`level`,{configurable:!1,enumerable:!1,writable:!1,value:e.level})):null}(function(){var e=Object.create(null),t={},n,r=Object.getOwnPropertyDescriptor(Object.prototype,`__proto__`);if(r){try{n=r.set,n.call(e,t)}catch{}if(Object.getPrototypeOf(e)===t)return{set:n,level:2}}return e.__proto__=t,Object.getPrototypeOf(e)===t?{level:2}:(e={},e.__proto__=t,Object.getPrototypeOf(e)===t?{level:1}:!1)}()),Q_()}),ev=h((e,t)=>{t.exports=Y_()()?Object.setPrototypeOf:$_()}),tv=h((e,t)=>{var n=X_();t.exports=function(e){if(!n(e))throw TypeError(e+` is not an Object`);return e}}),nv=h((e,t)=>{var n=Object.create(null),r=Math.random;t.exports=function(){var e;do e=r().toString(36).slice(2);while(n[e]);return e}}),rv=h((e,t)=>{var n=void 0;t.exports=function(e){return e!==n&&e!==null}}),iv=h((e,t)=>{var n=rv(),r={object:!0,function:!0,undefined:!0};t.exports=function(e){return n(e)?hasOwnProperty.call(r,typeof e):!1}}),av=h((e,t)=>{var n=iv();t.exports=function(e){if(!n(e))return!1;try{return e.constructor?e.constructor.prototype===e:!1}catch{return!1}}}),ov=h((e,t)=>{var n=av();t.exports=function(e){if(typeof e!=`function`||!hasOwnProperty.call(e,`length`))return!1;try{if(typeof e.length!=`number`||typeof e.call!=`function`||typeof e.apply!=`function`)return!1}catch{return!1}return!n(e)}}),sv=h((e,t)=>{var n=ov(),r=/^\s*class[\s{/}]/,i=Function.prototype.toString;t.exports=function(e){return!(!n(e)||r.test(i.call(e)))}}),cv=h((e,t)=>{t.exports=function(){var e=Object.assign,t;return typeof e==`function`?(t={foo:`raz`},e(t,{bar:`dwa`},{trzy:`trzy`}),t.foo+t.bar+t.trzy===`razdwatrzy`):!1}}),lv=h((e,t)=>{t.exports=function(){try{return!0}catch{return!1}}}),uv=h((e,t)=>{var n=J_(),r=Object.keys;t.exports=function(e){return r(n(e)?Object(e):e)}}),dv=h((e,t)=>{t.exports=lv()()?Object.keys:uv()}),fv=h((e,t)=>{var n=dv(),r=Z_(),i=Math.max;t.exports=function(e,t){var a,o,s=i(arguments.length,2),c;for(e=Object(r(e)),c=function(n){try{e[n]=t[n]}catch(e){a||=e}},o=1;o<s;++o)t=arguments[o],n(t).forEach(c);if(a!==void 0)throw a;return e}}),pv=h((e,t)=>{t.exports=cv()()?Object.assign:fv()}),mv=h((e,t)=>{var n=J_(),r=Array.prototype.forEach,i=Object.create,a=function(e,t){for(var n in e)t[n]=e[n]};t.exports=function(e){var t=i(null);return r.call(arguments,function(e){n(e)&&a(Object(e),t)}),t}}),hv=h((e,t)=>{var n=`razdwatrzy`;t.exports=function(){return typeof n.contains==`function`?n.contains(`dwa`)===!0&&n.contains(`foo`)===!1:!1}}),gv=h((e,t)=>{var n=String.prototype.indexOf;t.exports=function(e){return n.call(this,e,arguments[1])>-1}}),_v=h((e,t)=>{t.exports=hv()()?String.prototype.contains:gv()}),vv=h((e,t)=>{var n=rv(),r=sv(),i=pv(),a=mv(),o=_v(),s=t.exports=function(e,t){var r,s,c,l,u;return arguments.length<2||typeof e!=`string`?(l=t,t=e,e=null):l=arguments[2],n(e)?(r=o.call(e,`c`),s=o.call(e,`e`),c=o.call(e,`w`)):(r=c=!0,s=!1),u={value:t,configurable:r,enumerable:s,writable:c},l?i(a(l),u):u};s.gs=function(e,t,s){var c,l,u,d;return typeof e==`string`?u=arguments[3]:(u=s,s=t,t=e,e=null),n(t)?r(t)?n(s)?r(s)||(u=s,s=void 0):s=void 0:(u=t,t=s=void 0):t=void 0,n(e)?(c=o.call(e,`c`),l=o.call(e,`e`)):(c=!0,l=!1),d={get:t,set:s,configurable:c,enumerable:l},u?i(a(u),d):d}}),yv=h((e,t)=>{var n=Object.prototype.toString,r=n.call(function(){return arguments}());t.exports=function(e){return n.call(e)===r}}),bv=h((e,t)=>{var n=Object.prototype.toString,r=n.call(``);t.exports=function(e){return typeof e==`string`||e&&typeof e==`object`&&(e instanceof String||n.call(e)===r)||!1}}),xv=h((e,t)=>{t.exports=function(){return typeof globalThis!=`object`||!globalThis?!1:globalThis.Array===Array}}),Sv=h((e,t)=>{var n=function(){if(typeof self==`object`&&self)return self;if(typeof window==`object`&&window)return window;throw Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,`__global__`,{get:function(){return this},configurable:!0})}catch{return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()}),Cv=h((e,t)=>{t.exports=xv()()?globalThis:Sv()}),wv=h((e,t)=>{var n=Cv(),r={object:!0,symbol:!0};t.exports=function(){var e=n.Symbol;return typeof e==`function`?(e(`test symbol`),!(!r[typeof e.iterator]||!r[typeof e.toPrimitive]||!r[typeof e.toStringTag])):!1}}),Tv=h((e,t)=>{t.exports=function(e){return e?typeof e==`symbol`?!0:!e.constructor||e.constructor.name!==`Symbol`?!1:e[e.constructor.toStringTag]===`Symbol`:!1}}),Ev=h((e,t)=>{var n=Tv();t.exports=function(e){if(!n(e))throw TypeError(e+` is not a symbol`);return e}}),Dv=h((e,t)=>{var n=vv(),r=Object.create,i=Object.defineProperty,a=Object.prototype,o=r(null);t.exports=function(e){for(var t=0,r,s;o[e+(t||``)];)++t;return e+=t||``,o[e]=!0,r=`@@`+e,i(a,r,n.gs(null,function(e){s||=(s=!0,i(this,r,n(e)),!1)})),r}}),Ov=h((e,t)=>{var n=vv(),r=Cv().Symbol;t.exports=function(e){return Object.defineProperties(e,{hasInstance:n(``,r&&r.hasInstance||e(`hasInstance`)),isConcatSpreadable:n(``,r&&r.isConcatSpreadable||e(`isConcatSpreadable`)),iterator:n(``,r&&r.iterator||e(`iterator`)),match:n(``,r&&r.match||e(`match`)),replace:n(``,r&&r.replace||e(`replace`)),search:n(``,r&&r.search||e(`search`)),species:n(``,r&&r.species||e(`species`)),split:n(``,r&&r.split||e(`split`)),toPrimitive:n(``,r&&r.toPrimitive||e(`toPrimitive`)),toStringTag:n(``,r&&r.toStringTag||e(`toStringTag`)),unscopables:n(``,r&&r.unscopables||e(`unscopables`))})}}),kv=h((e,t)=>{var n=vv(),r=Ev(),i=Object.create(null);t.exports=function(e){return Object.defineProperties(e,{for:n(function(t){return i[t]?i[t]:i[t]=e(String(t))}),keyFor:n(function(e){for(var t in r(e),i)if(i[t]===e)return t})})}}),Av=h((e,t)=>{var n=vv(),r=Ev(),i=Cv().Symbol,a=Dv(),o=Ov(),s=kv(),c=Object.create,l=Object.defineProperties,u=Object.defineProperty,d,f,p;if(typeof i==`function`)try{String(i()),p=!0}catch{}else i=null;f=function(e){if(this instanceof f)throw TypeError(`Symbol is not a constructor`);return d(e)},t.exports=d=function e(t){var r;if(this instanceof e)throw TypeError(`Symbol is not a constructor`);return p?i(t):(r=c(f.prototype),t=t===void 0?``:String(t),l(r,{__description__:n(``,t),__name__:n(``,a(t))}))},o(d),s(d),l(f.prototype,{constructor:n(d),toString:n(``,function(){return this.__name__})}),l(d.prototype,{toString:n(function(){return`Symbol (`+r(this).__description__+`)`}),valueOf:n(function(){return r(this)})}),u(d.prototype,d.toPrimitive,n(``,function(){var e=r(this);return typeof e==`symbol`?e:e.toString()})),u(d.prototype,d.toStringTag,n(`c`,`Symbol`)),u(f.prototype,d.toStringTag,n(`c`,d.prototype[d.toStringTag])),u(f.prototype,d.toPrimitive,n(`c`,d.prototype[d.toPrimitive]))}),jv=h((e,t)=>{t.exports=wv()()?Cv().Symbol:Av()}),Mv=h((e,t)=>{var n=Z_();t.exports=function(){return n(this).length=0,this}}),Nv=h((e,t)=>{t.exports=function(e){if(typeof e!=`function`)throw TypeError(e+` is not a function`);return e}}),Pv=h((e,t)=>{var n=rv(),r=iv(),i=Object.prototype.toString;t.exports=function(e){if(!n(e))return null;if(r(e)){var t=e.toString;if(typeof t!=`function`||t===i)return null}try{return``+e}catch{return null}}}),Fv=h((e,t)=>{t.exports=function(e){try{return e.toString()}catch{try{return String(e)}catch{return null}}}}),Iv=h((e,t)=>{var n=Fv(),r=/[\n\r\u2028\u2029]/g;t.exports=function(e){var t=n(e);return t===null?`<Non-coercible to string value>`:(t.length>100&&(t=t.slice(0,99)+`…`),t=t.replace(r,function(e){switch(e){case`
`:return`\\n`;case`\r`:return`\\r`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:throw Error(`Unexpected character`)}}),t)}}),Lv=h((e,t)=>{var n=rv(),r=iv(),i=Pv(),a=Iv(),o=function(e,t){return e.replace(`%v`,a(t))};t.exports=function(e,t,a){if(!r(a))throw TypeError(o(t,e));if(!n(e)){if(`default`in a)return a.default;if(a.isOptional)return null}var s=i(a.errorMessage);throw n(s)||(s=t),TypeError(o(s,e))}}),Rv=h((e,t)=>{var n=Lv(),r=rv();t.exports=function(e){return r(e)?e:n(e,`Cannot use %v`,arguments[1])}}),zv=h((e,t)=>{var n=Lv(),r=sv();t.exports=function(e){return r(e)?e:n(e,`%v is not a plain function`,arguments[1])}}),Bv=h((e,t)=>{t.exports=function(){var e=Array.from,t,n;return typeof e==`function`?(t=[`raz`,`dwa`],n=e(t),!!(n&&n!==t&&n[1]===`dwa`)):!1}}),Vv=h((e,t)=>{var n=Object.prototype.toString,r=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);t.exports=function(e){return typeof e==`function`&&r(n.call(e))}}),Hv=h((e,t)=>{t.exports=function(){var e=Math.sign;return typeof e==`function`?e(10)===1&&e(-20)===-1:!1}}),Uv=h((e,t)=>{t.exports=function(e){return e=Number(e),isNaN(e)||e===0?e:e>0?1:-1}}),Wv=h((e,t)=>{t.exports=Hv()()?Math.sign:Uv()}),Gv=h((e,t)=>{var n=Wv(),r=Math.abs,i=Math.floor;t.exports=function(e){return isNaN(e)?0:(e=Number(e),e===0||!isFinite(e)?e:n(e)*i(r(e)))}}),Kv=h((e,t)=>{var n=Gv(),r=Math.max;t.exports=function(e){return r(0,n(e))}}),qv=h((e,t)=>{var n=jv().iterator,r=yv(),i=Vv(),a=Kv(),o=Nv(),s=Z_(),c=J_(),l=bv(),u=Array.isArray,d=Function.prototype.call,f={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;t.exports=function(e){var t=arguments[1],m=arguments[2],h,g,_,v,y,b,x,S,C,w;if(e=Object(s(e)),c(t)&&o(t),!this||this===Array||!i(this)){if(!t){if(r(e))return y=e.length,y===1?(v=[,],v[0]=e[0],v):Array.apply(null,e);if(u(e)){for(v=Array(y=e.length),g=0;g<y;++g)v[g]=e[g];return v}}v=[]}else h=this;if(!u(e)){if((C=e[n])!==void 0){for(x=o(C).call(e),h&&(v=new h),S=x.next(),g=0;!S.done;)w=t?d.call(t,m,S.value,g):S.value,h?(f.value=w,p(v,g,f)):v[g]=w,S=x.next(),++g;y=g}else if(l(e)){for(y=e.length,h&&(v=new h),g=0,_=0;g<y;++g)w=e[g],g+1<y&&(b=w.charCodeAt(0),b>=55296&&b<=56319&&(w+=e[++g])),w=t?d.call(t,m,w,_):w,h?(f.value=w,p(v,_,f)):v[_]=w,++_;y=_}}if(y===void 0)for(y=a(e.length),h&&(v=new h(y)),g=0;g<y;++g)w=t?d.call(t,m,e[g],g):e[g],h?(f.value=w,p(v,g,f)):v[g]=w;return h&&(f.value=null,v.length=y),v}}),Jv=h((e,t)=>{t.exports=Bv()()?Array.from:qv()}),Yv=h((e,t)=>{var n=Jv(),r=pv(),i=Z_();t.exports=function(e){var t=Object(i(e)),a=arguments[1],o=Object(arguments[2]);if(t!==e&&!a)return t;var s={};return a?n(a,function(t){(o.ensure||t in e)&&(s[t]=e[t])}):r(s,e),s}}),Xv=h((e,t)=>{var n=Nv(),r=Z_(),i=Function.prototype.bind,a=Function.prototype.call,o=Object.keys,s=Object.prototype.propertyIsEnumerable;t.exports=function(e,t){return function(c,l){var u,d=arguments[2],f=arguments[3];return c=Object(r(c)),n(l),u=o(c),f&&u.sort(typeof f==`function`?i.call(f,c):void 0),typeof e!=`function`&&(e=u[e]),a.call(e,u,function(e,n){return s.call(c,e)?a.call(l,d,c[e],e,c,n):t})}}}),Zv=h((e,t)=>{t.exports=Xv()(`forEach`)}),Qv=h((e,t)=>{var n=Nv(),r=Zv(),i=Function.prototype.call;t.exports=function(e,t){var a={},o=arguments[2];return n(t),r(e,function(e,n,r,s){a[n]=i.call(t,o,e,n,r,s)}),a}}),$v=h((e,t)=>{var n=rv(),r=Rv(),i=zv(),a=Yv(),o=mv(),s=Qv(),c=Function.prototype.bind,l=Object.defineProperty,u=Object.prototype.hasOwnProperty,d=function(e,t,n){var o=r(t)&&i(t.value),s;return s=a(t),delete s.writable,delete s.value,s.get=function(){return!n.overwriteDefinition&&u.call(this,e)?o:(t.value=c.call(o,n.resolveContext?n.resolveContext(this):this),l(this,e,t),this[e])},s};t.exports=function(e){var t=o(arguments[1]);return n(t.resolveContext)&&i(t.resolveContext),s(e,function(e,n){return d(n,e,t)})}}),ey=h((e,t)=>{var n=Mv(),r=pv(),i=Nv(),a=Z_(),o=vv(),s=$v(),c=jv(),l=Object.defineProperty,u=Object.defineProperties,d;t.exports=d=function(e,t){if(!(this instanceof d))throw TypeError(`Constructor requires 'new'`);u(this,{__list__:o(`w`,a(e)),__context__:o(`w`,t),__nextIndex__:o(`w`,0)}),t&&(i(t.on),t.on(`_add`,this._onAdd),t.on(`_delete`,this._onDelete),t.on(`_clear`,this._onClear))},delete d.prototype.constructor,u(d.prototype,r({_next:o(function(){var e;if(this.__list__){if(this.__redo__&&(e=this.__redo__.shift(),e!==void 0))return e;if(this.__nextIndex__<this.__list__.length)return this.__nextIndex__++;this._unBind()}}),next:o(function(){return this._createResult(this._next())}),_createResult:o(function(e){return e===void 0?{done:!0,value:void 0}:{done:!1,value:this._resolve(e)}}),_resolve:o(function(e){return this.__list__[e]}),_unBind:o(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),null)}),toString:o(function(){return`[object `+(this[c.toStringTag]||`Object`)+`]`})},s({_onAdd:o(function(e){if(!(e>=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){l(this,`__redo__`,o(`c`,[e]));return}this.__redo__.forEach(function(t,n){t>=e&&(this.__redo__[n]=++t)},this),this.__redo__.push(e)}}),_onDelete:o(function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(t=this.__redo__.indexOf(e),t!==-1&&this.__redo__.splice(t,1),this.__redo__.forEach(function(t,n){t>e&&(this.__redo__[n]=--t)},this)))}),_onClear:o(function(){this.__redo__&&n.call(this.__redo__),this.__nextIndex__=0})}))),l(d.prototype,c.iterator,o(function(){return this}))}),ty=h((e,t)=>{var n=ev(),r=_v(),i=vv(),a=jv(),o=ey(),s=Object.defineProperty,c=t.exports=function(e,t){if(!(this instanceof c))throw TypeError(`Constructor requires 'new'`);o.call(this,e),t=t?r.call(t,`key+value`)?`key+value`:r.call(t,`key`)?`key`:`value`:`value`,s(this,`__kind__`,i(``,t))};n&&n(c,o),delete c.prototype.constructor,c.prototype=Object.create(o.prototype,{_resolve:i(function(e){return this.__kind__===`value`?this.__list__[e]:this.__kind__===`key+value`?[e,this.__list__[e]]:e})}),s(c.prototype,a.toStringTag,i(`c`,`Array Iterator`))}),ny=h((e,t)=>{var n=ev(),r=vv(),i=jv(),a=ey(),o=Object.defineProperty,s=t.exports=function(e){if(!(this instanceof s))throw TypeError(`Constructor requires 'new'`);e=String(e),a.call(this,e),o(this,`__length__`,r(``,e.length))};n&&n(s,a),delete s.prototype.constructor,s.prototype=Object.create(a.prototype,{_next:r(function(){if(this.__list__){if(this.__nextIndex__<this.__length__)return this.__nextIndex__++;this._unBind()}}),_resolve:r(function(e){var t=this.__list__[e],n;return this.__nextIndex__===this.__length__?t:(n=t.charCodeAt(0),n>=55296&&n<=56319?t+this.__list__[this.__nextIndex__++]:t)})}),o(s.prototype,i.toStringTag,r(`c`,`String Iterator`))}),ry=h((e,t)=>{var n=yv(),r=J_(),i=bv(),a=jv().iterator,o=Array.isArray;t.exports=function(e){return r(e)?o(e)||i(e)||n(e)?!0:typeof e[a]==`function`:!1}}),iy=h((e,t)=>{var n=ry();t.exports=function(e){if(!n(e))throw TypeError(e+` is not iterable`);return e}}),ay=h((e,t)=>{var n=yv(),r=bv(),i=ty(),a=ny(),o=iy(),s=jv().iterator;t.exports=function(e){return typeof o(e)[s]==`function`?e[s]():n(e)?new i(e):r(e)?new a(e):new i(e)}}),oy=h((e,t)=>{var n=yv(),r=Nv(),i=bv(),a=ay(),o=Array.isArray,s=Function.prototype.call,c=Array.prototype.some;t.exports=function(e,t){var l,u=arguments[2],d,f,p,m,h,g,_;if(o(e)||n(e)?l=`array`:i(e)?l=`string`:e=a(e),r(t),f=function(){p=!0},l===`array`){c.call(e,function(e){return s.call(t,u,e,f),p});return}if(l===`string`){for(h=e.length,m=0;m<h&&(g=e[m],m+1<h&&(_=g.charCodeAt(0),_>=55296&&_<=56319&&(g+=e[++m])),s.call(t,u,g,f),!p);++m);return}for(d=e.next();!d.done;){if(s.call(t,u,d.value,f),p)return;d=e.next()}}}),sy=h((e,t)=>{t.exports=function(){return typeof WeakMap==`function`?Object.prototype.toString.call(new WeakMap)===`[object WeakMap]`:!1}()}),cy=h((e,t)=>{var n=J_(),r=ev(),i=tv(),a=Z_(),o=nv(),s=vv(),c=ay(),l=oy(),u=jv().toStringTag,d=sy(),f=Array.isArray,p=Object.defineProperty,m=Object.prototype.hasOwnProperty,h=Object.getPrototypeOf,g;t.exports=g=function(){var e=arguments[0],t;if(!(this instanceof g))throw TypeError(`Constructor requires 'new'`);return t=d&&r&&WeakMap!==g?r(new WeakMap,h(this)):this,n(e)&&(f(e)||(e=c(e))),p(t,`__weakMapData__`,s(`c`,`$weakMap$`+o())),e&&l(e,function(e){a(e),t.set(e[0],e[1])}),t},d&&(r&&r(g,WeakMap),g.prototype=Object.create(WeakMap.prototype,{constructor:s(g)})),Object.defineProperties(g.prototype,{delete:s(function(e){return m.call(i(e),this.__weakMapData__)?(delete e[this.__weakMapData__],!0):!1}),get:s(function(e){if(m.call(i(e),this.__weakMapData__))return e[this.__weakMapData__]}),has:s(function(e){return m.call(i(e),this.__weakMapData__)}),set:s(function(e,t){return p(i(e),this.__weakMapData__,s(`c`,t)),this}),toString:s(function(){return`[object WeakMap]`})}),p(g.prototype,u,s(`c`,`WeakMap`))}),ly=h((e,t)=>{t.exports=K_()()?WeakMap:cy()}),uy=h((e,t)=>{t.exports=function(e,t,n){if(typeof Array.prototype.findIndex==`function`)return e.findIndex(t,n);if(typeof t!=`function`)throw TypeError(`predicate must be a function`);var r=Object(e),i=r.length;if(i===0)return-1;for(var a=0;a<i;a++)if(t.call(n,r[a],a,r))return a;return-1}}),dy=h((e,t)=>{var n=fh(),r=h_(),i=R_(),a=p_(),o=__(),s=W_(),c=G_(),{float32:l,fract32:u}=H_(),d=ly(),f=m_(),p=uy(),m=`
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.;
}
`,h=`
precision highp float;
uniform float dashLength, pixelRatio, thickness, opacity, id;
uniform sampler2D dashTexture;
varying vec4 fragColor;
varying vec2 tangent;
void main() {
float alpha = 1.;
float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;
float dash = texture2D(dashTexture, vec2(t, .5)).r;
gl_FragColor = fragColor;
gl_FragColor.a *= alpha * opacity * dash;
}
`,g=`
precision highp float;
attribute vec2 position, positionFract;
uniform vec4 color;
uniform vec2 scale, scaleFract, translate, translateFract;
uniform float pixelRatio, id;
uniform vec4 viewport;
uniform float opacity;
varying vec4 fragColor;
const float MAX_LINES = 256.;
void main() {
float depth = (MAX_LINES - 4. - id) / (MAX_LINES);
vec2 position = position * scale + translate
+ positionFract * scale + translateFract
+ position * scaleFract
+ positionFract * scaleFract;
gl_Position = vec4(position * 2.0 - 1.0, depth, 1);
fragColor = color / 255.;
fragColor.a *= opacity;
}
`,_=`
precision highp float;
varying vec4 fragColor;
void main() {
gl_FragColor = fragColor;
}
`,v=`
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;
}
}
}
`,y=`
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;
}
`;t.exports=b;function b(e,t){if(!(this instanceof b))return new b(e,t);if(typeof e==`function`?(t||={},t.regl=e):t=e,t.length&&(t.positions=t),e=t.regl,!e.hasExtension(`ANGLE_instanced_arrays`))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=e._gl,this.regl=e,this.passes=[],this.shaders=b.shaders.has(e)?b.shaders.get(e):b.shaders.set(e,b.createShaders(e)).get(e),this.update(t)}b.dashMult=2,b.maxPatternLength=256,b.precisionThreshold=3e6,b.maxPoints=1e4,b.maxLines=2048,b.shaders=new d,b.createShaders=function(e){let t=e.buffer({usage:`static`,type:`float`,data:[0,1,0,0,1,1,1,0]}),n={primitive:`triangle strip`,instances:e.prop(`count`),count:4,offset:0,uniforms:{miterMode:(e,t)=>t.join===`round`?2:1,miterLimit:e.prop(`miterLimit`),scale:e.prop(`scale`),scaleFract:e.prop(`scaleFract`),translateFract:e.prop(`translateFract`),translate:e.prop(`translate`),thickness:e.prop(`thickness`),dashTexture:e.prop(`dashTexture`),opacity:e.prop(`opacity`),pixelRatio:e.context(`pixelRatio`),id:e.prop(`id`),dashLength:e.prop(`dashLength`),viewport:(e,t)=>[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight],depth:e.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:(e,t)=>!t.overlay},stencil:{enable:!1},scissor:{enable:!0,box:e.prop(`viewport`)},viewport:e.prop(`viewport`)},r=e(i({vert:m,frag:h,attributes:{lineEnd:{buffer:t,divisor:0,stride:8,offset:0},lineTop:{buffer:t,divisor:0,stride:8,offset:4},aCoord:{buffer:e.prop(`positionBuffer`),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop(`positionBuffer`),stride:8,offset:16,divisor:1},aCoordFract:{buffer:e.prop(`positionFractBuffer`),stride:8,offset:8,divisor:1},bCoordFract:{buffer:e.prop(`positionFractBuffer`),stride:8,offset:16,divisor:1},color:{buffer:e.prop(`colorBuffer`),stride:4,offset:0,divisor:1}}},n)),a;try{a=e(i({cull:{enable:!0,face:`back`},vert:v,frag:y,attributes:{lineEnd:{buffer:t,divisor:0,stride:8,offset:0},lineTop:{buffer:t,divisor:0,stride:8,offset:4},aColor:{buffer:e.prop(`colorBuffer`),stride:4,offset:0,divisor:1},bColor:{buffer:e.prop(`colorBuffer`),stride:4,offset:4,divisor:1},prevCoord:{buffer:e.prop(`positionBuffer`),stride:8,offset:0,divisor:1},aCoord:{buffer:e.prop(`positionBuffer`),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop(`positionBuffer`),stride:8,offset:16,divisor:1},nextCoord:{buffer:e.prop(`positionBuffer`),stride:8,offset:24,divisor:1}}},n))}catch{a=r}return{fill:e({primitive:`triangle`,elements:(e,t)=>t.triangles,offset:0,vert:g,frag:_,uniforms:{scale:e.prop(`scale`),color:e.prop(`fill`),scaleFract:e.prop(`scaleFract`),translateFract:e.prop(`translateFract`),translate:e.prop(`translate`),opacity:e.prop(`opacity`),pixelRatio:e.context(`pixelRatio`),id:e.prop(`id`),viewport:(e,t)=>[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]},attributes:{position:{buffer:e.prop(`positionBuffer`),stride:8,offset:8},positionFract:{buffer:e.prop(`positionFractBuffer`),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:r,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(...e){e.length&&this.update(...e),this.draw()},b.prototype.draw=function(...e){return(e.length?e:this.passes).forEach((e,t)=>{if(e&&Array.isArray(e))return this.draw(...e);typeof e==`number`&&(e=this.passes[e]),e&&e.count>1&&e.opacity&&(this.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&this.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>b.precisionThreshold||e.scale[1]*e.viewport.height>b.precisionThreshold||e.join===`rect`||!e.join&&(e.thickness<=2||e.count>=b.maxPoints)?this.shaders.rect(e):this.shaders.miter(e)))}),this},b.prototype.update=function(e){if(!e)return;e.length==null?Array.isArray(e)||(e=[e]):typeof e[0]==`number`&&(e=[{positions:e}]);let{regl:t,gl:d}=this;if(e.forEach((e,m)=>{let h=this.passes[m];if(e!==void 0){if(e===null){this.passes[m]=null;return}if(typeof e[0]==`number`&&(e={positions:e}),e=a(e,{positions:`positions points data coords`,thickness:`thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth`,join:`lineJoin linejoin join type mode`,miterLimit:`miterlimit miterLimit`,dashes:`dash dashes dasharray dash-array dashArray`,color:`color colour stroke colors colours stroke-color strokeColor`,fill:`fill fill-color fillColor`,opacity:`alpha opacity`,overlay:`overlay crease overlap intersect`,close:`closed close closed-path closePath`,range:`range dataBox`,viewport:`viewport viewBox`,hole:`holes hole hollow`,splitNull:`splitNull`}),h||(this.passes[m]=h={id:m,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:t.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:`linear`,min:`linear`}),colorBuffer:t.buffer({usage:`dynamic`,type:`uint8`,data:new Uint8Array}),positionBuffer:t.buffer({usage:`dynamic`,type:`float`,data:new Uint8Array}),positionFractBuffer:t.buffer({usage:`dynamic`,type:`float`,data:new Uint8Array})},e=i({},b.defaults,e)),e.thickness!=null&&(h.thickness=parseFloat(e.thickness)),e.opacity!=null&&(h.opacity=parseFloat(e.opacity)),e.miterLimit!=null&&(h.miterLimit=parseFloat(e.miterLimit)),e.overlay!=null&&(h.overlay=!!e.overlay,m<b.maxLines&&(h.depth=2*(b.maxLines-1-m%b.maxLines)/b.maxLines-1)),e.join!=null&&(h.join=e.join),e.hole!=null&&(h.hole=e.hole),e.fill!=null&&(h.fill=e.fill?n(e.fill,`uint8`):null),e.viewport!=null&&(h.viewport=f(e.viewport)),h.viewport||=f([d.drawingBufferWidth,d.drawingBufferHeight]),e.close!=null&&(h.close=e.close),e.positions===null&&(e.positions=[]),e.positions){let t,n;if(e.positions.x&&e.positions.y){let r=e.positions.x,i=e.positions.y;n=h.count=Math.max(r.length,i.length),t=new Float64Array(n*2);for(let e=0;e<n;e++)t[e*2]=r[e],t[e*2+1]=i[e]}else t=o(e.positions,`float64`),n=h.count=Math.floor(t.length/2);let i=h.bounds=r(t,2);if(h.fill){let n=[],r={},i=0;for(let e=0,a=0,o=h.count;e<o;e++){let o=t[e*2],s=t[e*2+1];isNaN(o)||isNaN(s)||o==null||s==null?(o=t[i*2],s=t[i*2+1],r[e]=i):i=e,n[a++]=o,n[a++]=s}if(e.splitNull){h.count-1 in r||(r[h.count]=h.count-1);let e=Object.keys(r).map(Number).sort((e,t)=>e-t),t=[],i=0,a=h.hole==null?null:h.hole[0];if(a!=null){let t=p(e,e=>e>=a);e=e.slice(0,t),e.push(a)}for(let r=0;r<e.length;r++){let o=s(n.slice(i*2,e[r]*2).concat(a?n.slice(a*2):[]),(h.hole||[]).map(t=>t-a+(e[r]-i)));o=o.map(t=>t+i+(t+i<e[r]?0:a-e[r])),t.push(...o),i=e[r]+1}for(let e=0,n=t.length;e<n;e++)r[t[e]]!=null&&(t[e]=r[t[e]]);h.triangles=t}else{let e=s(n,h.hole||[]);for(let t=0,n=e.length;t<n;t++)r[e[t]]!=null&&(e[t]=r[e[t]]);h.triangles=e}}let a=new Float64Array(t);c(a,2,i);let d=new Float64Array(n*2+6);h.close?t[0]===t[n*2-2]&&t[1]===t[n*2-1]?(d[0]=a[n*2-4],d[1]=a[n*2-3]):(d[0]=a[n*2-2],d[1]=a[n*2-1]):(d[0]=a[0],d[1]=a[1]),d.set(a,2),h.close?t[0]===t[n*2-2]&&t[1]===t[n*2-1]?(d[n*2+2]=a[2],d[n*2+3]=a[3],--h.count):(d[n*2+2]=a[0],d[n*2+3]=a[1],d[n*2+4]=a[2],d[n*2+5]=a[3]):(d[n*2+2]=a[n*2-2],d[n*2+3]=a[n*2-1],d[n*2+4]=a[n*2-2],d[n*2+5]=a[n*2-1]);var g=l(d);h.positionBuffer(g);var _=u(d,g);h.positionFractBuffer(_)}if(e.range?h.range=e.range:h.range||=h.bounds,(e.range||e.positions)&&h.count){let e=h.bounds,t=e[2]-e[0],n=e[3]-e[1],r=h.range[2]-h.range[0],i=h.range[3]-h.range[1];h.scale=[t/r,n/i],h.translate=[-h.range[0]/r+e[0]/r||0,-h.range[1]/i+e[1]/i||0],h.scaleFract=u(h.scale),h.translateFract=u(h.translate)}if(e.dashes){let t=0,n;if(!e.dashes||e.dashes.length<2)t=1,n=new Uint8Array([255,255,255,255,255,255,255,255]);else{t=0;for(let n=0;n<e.dashes.length;++n)t+=e.dashes[n];n=new Uint8Array(t*b.dashMult);let r=0,i=255;for(let t=0;t<2;t++)for(let t=0;t<e.dashes.length;++t){for(let a=0,o=e.dashes[t]*b.dashMult*.5;a<o;++a)n[r++]=i;i^=255}}h.dashLength=t,h.dashTexture({channels:1,data:n,width:n.length,height:1,mag:`linear`,min:`linear`},0,0)}if(e.color){let t=h.count,r=e.color;r||=`transparent`;let i=new Uint8Array(t*4+4);if(!Array.isArray(r)||typeof r[0]==`number`){let e=n(r,`uint8`);for(let n=0;n<t+1;n++)i.set(e,n*4)}else{for(let e=0;e<t;e++){let t=n(r[e],`uint8`);i.set(t,e*4)}i.set(n(r[0],`uint8`),t*4)}h.colorBuffer({usage:`dynamic`,type:`uint8`,data:i})}}}),e.length<this.passes.length){for(let t=e.length;t<this.passes.length;t++){let e=this.passes[t];e&&(e.colorBuffer.destroy(),e.positionBuffer.destroy(),e.dashTexture.destroy())}this.passes.length=e.length}let m=[];for(let e=0;e<this.passes.length;e++)this.passes[e]!==null&&m.push(this.passes[e]);return this.passes=m,this},b.prototype.destroy=function(){return this.passes.forEach(e=>{e.colorBuffer.destroy(),e.positionBuffer.destroy(),e.dashTexture.destroy()}),this.passes.length=0,this}}),fy=h((e,t)=>{var n=h_(),r=fh(),i=B_(),a=p_(),o=R_(),s=__(),{float32:c,fract32:l}=H_();t.exports=d;var u=[[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 d(e,t){if(typeof e==`function`?(t||={},t.regl=e):t=e,t.length&&(t.positions=t),e=t.regl,!e.hasExtension(`ANGLE_instanced_arrays`))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let d=e._gl,f,p,m,h,g,_,v={color:`black`,capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},y=[];return h=e.buffer({usage:`dynamic`,type:`uint8`,data:new Uint8Array}),p=e.buffer({usage:`dynamic`,type:`float`,data:new Uint8Array}),m=e.buffer({usage:`dynamic`,type:`float`,data:new Uint8Array}),g=e.buffer({usage:`dynamic`,type:`float`,data:new Uint8Array}),_=e.buffer({usage:`static`,type:`float`,data:u}),C(t),f=e({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:e.prop(`range`),lineWidth:e.prop(`lineWidth`),capSize:e.prop(`capSize`),opacity:e.prop(`opacity`),scale:e.prop(`scale`),translate:e.prop(`translate`),scaleFract:e.prop(`scaleFract`),translateFract:e.prop(`translateFract`),viewport:(e,t)=>[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]},attributes:{color:{buffer:h,offset:(e,t)=>t.offset*4,divisor:1},position:{buffer:p,offset:(e,t)=>t.offset*8,divisor:1},positionFract:{buffer:m,offset:(e,t)=>t.offset*8,divisor:1},error:{buffer:g,offset:(e,t)=>t.offset*16,divisor:1},direction:{buffer:_,stride:24,offset:0},lineOffset:{buffer:_,stride:24,offset:8},capOffset:{buffer:_,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:e.prop(`viewport`)},viewport:e.prop(`viewport`),stencil:!1,instances:e.prop(`count`),count:u.length}),o(b,{update:C,draw:x,destroy:w,regl:e,gl:d,canvas:d.canvas,groups:y}),b;function b(e){e?C(e):e===null&&w(),x()}function x(t){if(typeof t==`number`)return S(t);t&&!Array.isArray(t)&&(t=[t]),e._refresh(),y.forEach((e,n)=>{if(e){if(t&&(t[n]?e.draw=!0:e.draw=!1),!e.draw){e.draw=!0;return}S(n)}})}function S(e){typeof e==`number`&&(e=y[e]),e!=null&&e&&e.count&&e.color&&e.opacity&&e.positions&&e.positions.length>1&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],f(e),e.after&&e.after(e))}function C(e){if(!e)return;e.length==null?Array.isArray(e)||(e=[e]):typeof e[0]==`number`&&(e=[{positions:e}]);let t=0,u=0;if(b.groups=y=e.map((e,c)=>{let f=y[c];if(e)typeof e==`function`?e={after:e}:typeof e[0]==`number`&&(e={positions:e});else return f;return e=a(e,{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||(y[c]=f={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},e=o({},v,e)),i(f,e,[{lineWidth:e=>e*.5,capSize:e=>e*.5,opacity:parseFloat,errors:e=>(e=s(e),u+=e.length,e),positions:(e,r)=>(e=s(e,`float64`),r.count=Math.floor(e.length/2),r.bounds=n(e,2),r.offset=t,t+=r.count,e)},{color:(e,t)=>{let n=t.count;if(e||=`transparent`,!Array.isArray(e)||typeof e[0]==`number`){let t=e;e=Array(n);for(let r=0;r<n;r++)e[r]=t}if(e.length<n)throw Error(`Not enough colors`);let i=new Uint8Array(n*4);for(let t=0;t<n;t++){let n=r(e[t],`uint8`);i.set(n,t*4)}return i},range:(e,t,n)=>{let r=t.bounds;return e||=r,t.scale=[1/(e[2]-e[0]),1/(e[3]-e[1])],t.translate=[-e[0],-e[1]],t.scaleFract=l(t.scale),t.translateFract=l(t.translate),e},viewport:e=>{let t;return Array.isArray(e)?t={x:e[0],y:e[1],width:e[2]-e[0],height:e[3]-e[1]}:e?(t={x:e.x||e.left||0,y:e.y||e.top||0},e.right?t.width=e.right-t.x:t.width=e.w||e.width||0,e.bottom?t.height=e.bottom-t.y:t.height=e.h||e.height||0):t={x:0,y:0,width:d.drawingBufferWidth,height:d.drawingBufferHeight},t}}]),f}),t||u){let e=y.reduce((e,t,n)=>e+(t?t.count:0),0),t=new Float64Array(e*2),n=new Uint8Array(e*4),r=new Float32Array(e*4);y.forEach((e,i)=>{if(!e)return;let{positions:a,count:o,offset:s,color:c,errors:l}=e;o&&(n.set(c,s*4),r.set(l,s*4),t.set(a,s*2))});var f=c(t);p(f);var _=l(t,f);m(_),h(n),g(r)}}function w(){p.destroy(),m.destroy(),h.destroy(),g.destroy(),_.destroy()}}}),py=h((e,t)=>{var n=/[\'\"]/;t.exports=function(e){return e?(n.test(e.charAt(0))&&(e=e.substr(1)),n.test(e.charAt(e.length-1))&&(e=e.substr(0,e.length-1)),e):``}}),my=h((e,t)=>{t.exports=[`inherit`,`initial`,`unset`]}),hy=h((e,t)=>{t.exports=[`caption`,`icon`,`menu`,`message-box`,`small-caption`,`status-bar`]}),gy=h((e,t)=>{t.exports=[`normal`,`bold`,`bolder`,`lighter`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`]}),_y=h((e,t)=>{t.exports=[`normal`,`italic`,`oblique`]}),vy=h((e,t)=>{t.exports=[`normal`,`condensed`,`semi-condensed`,`extra-condensed`,`ultra-condensed`,`expanded`,`semi-expanded`,`extra-expanded`,`ultra-expanded`]}),yy=h((e,t)=>{function n(e,t){if(typeof e!=`string`)return[e];var n=[e];typeof t==`string`||Array.isArray(t)?t={brackets:t}:t||={};var r=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:[`{}`,`[]`,`()`],i=t.escape||`___`,a=!!t.flat;r.forEach(function(e){var t=new RegExp([`\\`,e[0],`[^\\`,e[0],`\\`,e[1],`]*\\`,e[1]].join(``)),r=[];function a(t,a,o){var s=n.push(t.slice(e[0].length,-e[1].length))-1;return r.push(s),i+s+i}n.forEach(function(e,r){for(var i,o=0;e!=i;)if(i=e,e=e.replace(t,a),o++>1e4)throw Error(`References have circular dependency. Please, check them.`);n[r]=e}),r=r.reverse(),n=n.map(function(t){return r.forEach(function(n){t=t.replace(RegExp(`(\\`+i+n+`\\`+i+`)`,`g`),e[0]+`$1`+e[1])}),t})});var o=RegExp(`\\`+i+`([0-9]+)\\`+i);function s(e,t,n){for(var r=[],i,a=0;i=o.exec(e);){if(a++>1e4)throw Error(`Circular references in parenthesis`);r.push(e.slice(0,i.index)),r.push(s(t[i[1]],t)),e=e.slice(i.index+i[0].length)}return r.push(e),r}return a?n:s(n[0],n)}function r(e,t){if(t&&t.flat){var n=t&&t.escape||`___`,r=e[0],i;if(!r)return``;for(var a=RegExp(`\\`+n+`([0-9]+)\\`+n),o=0;r!=i;){if(o++>1e4)throw Error(`Circular references in `+e);i=r,r=r.replace(a,s)}return r}return e.reduce(function e(t,n){return Array.isArray(n)&&(n=n.reduce(e,``)),t+n},``);function s(t,n){if(e[n]==null)throw Error(`Reference `+n+`is undefined`);return e[n]}}function i(e,t){return Array.isArray(e)?r(e,t):n(e,t)}i.parse=n,i.stringify=r,t.exports=i}),by=h((e,t)=>{var n=yy();t.exports=function(e,t,r){if(e==null)throw Error(`First argument should be a string`);if(t==null)throw Error(`Separator should be a string or a RegExp`);r?(typeof r==`string`||Array.isArray(r))&&(r={ignore:r}):r={},r.escape??=!0,r.ignore==null?r.ignore=[`[]`,`()`,`{}`,`<>`,`""`,`''`,"``",`“”`,`«»`]:(typeof r.ignore==`string`&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map(function(e){return e.length===1&&(e+=e),e}));var i=n.parse(e,{flat:!0,brackets:r.ignore}),a=i[0].split(t);if(r.escape){for(var o=[],s=0;s<a.length;s++){var c=a[s],l=a[s+1];c[c.length-1]===`\\`&&c[c.length-2]!==`\\`?(o.push(c+t+l),s++):o.push(c)}a=o}for(var s=0;s<a.length;s++)i[0]=a[s],a[s]=n.stringify(i,{flat:!0});return a}}),xy=h((e,t)=>{t.exports=[`xx-small`,`x-small`,`small`,`medium`,`large`,`x-large`,`xx-large`,`larger`,`smaller`]}),Sy=h((e,t)=>{var n=xy();t.exports={isSize:function(e){return/^[\d\.]/.test(e)||e.indexOf(`/`)!==-1||n.indexOf(e)!==-1}}}),Cy=h((e,t)=>{var n=py(),r=my(),i=hy(),a=gy(),o=_y(),s=vy(),c=by(),l=Sy().isSize;t.exports=d;var u=d.cache={};function d(e){if(typeof e!=`string`)throw Error(`Font argument must be a string.`);if(u[e])return u[e];if(e===``)throw Error(`Cannot parse an empty string.`);if(i.indexOf(e)!==-1)return u[e]={system:e};for(var t={style:`normal`,variant:`normal`,weight:`normal`,stretch:`normal`,lineHeight:`normal`,size:`1rem`,family:[`serif`]},d=c(e,/\s+/),p;p=d.shift();){if(r.indexOf(p)!==-1)return[`style`,`variant`,`weight`,`stretch`].forEach(function(e){t[e]=p}),u[e]=t;if(o.indexOf(p)!==-1){t.style=p;continue}if(p===`normal`||p===`small-caps`){t.variant=p;continue}if(s.indexOf(p)!==-1){t.stretch=p;continue}if(a.indexOf(p)!==-1){t.weight=p;continue}if(l(p)){var m=c(p,`/`);if(t.size=m[0],m[1]==null?d[0]===`/`&&(d.shift(),t.lineHeight=f(d.shift())):t.lineHeight=f(m[1]),!d.length)throw Error(`Missing required font-family.`);return t.family=c(d.join(` `),/\s*,\s*/).map(n),u[e]=t}throw Error(`Unknown or unsupported font token: `+p)}throw Error(`Missing required font-size.`)}function f(e){var t=parseFloat(e);return t.toString()===e?t:e}}),wy=h((e,t)=>{var n=p_(),r=Sy().isSize,i=p(my()),a=p(hy()),o=p(gy()),s=p(_y()),c=p(vy()),l={normal:1,"small-caps":1},u={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},d={style:`normal`,variant:`normal`,weight:`normal`,stretch:`normal`,size:`1rem`,lineHeight:`normal`,family:`serif`};t.exports=function(e){if(e=n(e,{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`}),e.system)return e.system&&f(e.system,a),e.system;if(f(e.style,s),f(e.variant,l),f(e.weight,o),f(e.stretch,c),e.size??=d.size,typeof e.size==`number`&&(e.size+=`px`),!r)throw Error("Bad size value `"+e.size+"`");e.family||=d.family,Array.isArray(e.family)&&(e.family.length||(e.family=[d.family]),e.family=e.family.map(function(e){return u[e]?e:`"`+e+`"`}).join(`, `));var t=[];return t.push(e.style),e.variant!==e.style&&t.push(e.variant),e.weight!==e.variant&&e.weight!==e.style&&t.push(e.weight),e.stretch!==e.weight&&e.stretch!==e.variant&&e.stretch!==e.style&&t.push(e.stretch),t.push(e.size+(e.lineHeight==null||e.lineHeight===`normal`||e.lineHeight+``==`1`?``:`/`+e.lineHeight)),t.push(e.family),t.filter(Boolean).join(` `)};function f(e,t){if(e&&!t[e]&&!i[e])throw Error("Unknown keyword `"+e+"`");return e}function p(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=1;return t}}),Ty=h((e,t)=>{t.exports={parse:Cy(),stringify:wy()}}),Ey=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():n.createREGL=r()})(e,function(){var e=function(e,t){for(var n=Object.keys(t),r=0;r<n.length;++r)e[n[r]]=t[n[r]];return e},t=0,n=0,r=5,i=6;function a(e,n){this.id=t++,this.type=e,this.data=n}function o(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}function s(e){if(e.length===0)return[];var t=e.charAt(0),n=e.charAt(e.length-1);if(e.length>1&&t===n&&(t===`"`||t===`'`))return[`"`+o(e.substr(1,e.length-2))+`"`];var r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(r)return s(e.substr(0,r.index)).concat(s(r[1])).concat(s(e.substr(r.index+r[0].length)));var i=e.split(`.`);if(i.length===1)return[`"`+o(e)+`"`];for(var a=[],c=0;c<i.length;++c)a=a.concat(s(i[c]));return a}function c(e){return`[`+s(e).join(`][`)+`]`}function l(e,t){return new a(e,c(t+``))}function u(e){return typeof e==`function`&&!e._reglType||e instanceof a}function d(e,t){if(typeof e==`function`)return new a(n,e);if(typeof e==`number`||typeof e==`boolean`)return new a(r,e);if(Array.isArray(e))return new a(i,e.map(function(e,n){return d(e,t+`[`+n+`]`)}));if(e instanceof a)return e}var f={DynamicVariable:a,define:l,isDynamic:u,unbox:d,accessor:c},p={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},m=typeof performance<`u`&&performance.now?function(){return performance.now()}:function(){return+new Date};function h(){var e={"":0},t=[``];return{id:function(n){var r=e[n];return r||(r=e[n]=t.length,t.push(n),r)},str:function(e){return t[e]}}}function g(t,n,r){var i=document.createElement(`canvas`);e(i.style,{border:0,margin:0,padding:0,top:0,left:0,width:`100%`,height:`100%`}),t.appendChild(i),t===document.body&&(i.style.position=`absolute`,e(t.style,{margin:0,padding:0}));function a(){var e=window.innerWidth,n=window.innerHeight;if(t!==document.body){var a=i.getBoundingClientRect();e=a.right-a.left,n=a.bottom-a.top}i.width=r*e,i.height=r*n}var o;t!==document.body&&typeof ResizeObserver==`function`?(o=new ResizeObserver(function(){setTimeout(a)}),o.observe(t)):window.addEventListener(`resize`,a,!1);function s(){o?o.disconnect():window.removeEventListener(`resize`,a),t.removeChild(i)}return a(),{canvas:i,onDestroy:s}}function _(e,t){function n(n){try{return e.getContext(n,t)}catch{return null}}return n(`webgl`)||n(`experimental-webgl`)||n(`webgl-experimental`)}function v(e){return typeof e.nodeName==`string`&&typeof e.appendChild==`function`&&typeof e.getBoundingClientRect==`function`}function y(e){return typeof e.drawArrays==`function`||typeof e.drawElements==`function`}function b(e){return typeof e==`string`?e.split():e}function x(e){return typeof e==`string`?document.querySelector(e):e}function S(e){var t=e||{},n,r,i,a,o={},s=[],c=[],l=typeof window>`u`?1:window.devicePixelRatio,u=!1,d={},f=function(e){},p=function(){};if(typeof t==`string`?n=document.querySelector(t):typeof t==`object`&&(v(t)?n=t:y(t)?(a=t,i=a.canvas):(`gl`in t?a=t.gl:`canvas`in t?i=x(t.canvas):`container`in t&&(r=x(t.container)),`attributes`in t&&(o=t.attributes),`extensions`in t&&(s=b(t.extensions)),`optionalExtensions`in t&&(c=b(t.optionalExtensions)),`onDone`in t&&(f=t.onDone),`profile`in t&&(u=!!t.profile),`pixelRatio`in t&&(l=+t.pixelRatio),`cachedCode`in t&&(d=t.cachedCode))),n&&(n.nodeName.toLowerCase()===`canvas`?i=n:r=n),!a){if(!i){var m=g(r||document.body,f,l);if(!m)return null;i=m.canvas,p=m.onDestroy}o.premultipliedAlpha===void 0&&(o.premultipliedAlpha=!0),a=_(i,o)}return a?{gl:a,canvas:i,container:r,extensions:s,optionalExtensions:c,pixelRatio:l,profile:u,cachedCode:d,onDone:f,onDestroy:p}:(p(),f(`webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org`),null)}function C(e,t){var n={};function r(t){var r=t.toLowerCase(),i;try{i=n[r]=e.getExtension(r)}catch{}return!!i}for(var i=0;i<t.extensions.length;++i){var a=t.extensions[i];if(!r(a))return t.onDestroy(),t.onDone(`"`+a+`" extension is not supported by the current WebGL context, try upgrading your system or a different browser`),null}return t.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach(function(e){if(n[e]&&!r(e))throw Error(`(regl): error restoring extension `+e)})}}}function w(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=t(r);return n}var T=5120,E=5121,D=5122,O=5123,k=5124,A=5125,j=5126;function M(e){for(var t=16;t<=1<<28;t*=16)if(e<=t)return t;return 0}function N(e){var t,n;return t=(e>65535)<<4,e>>>=t,n=(e>255)<<3,e>>>=n,t|=n,n=(e>15)<<2,e>>>=n,t|=n,n=(e>3)<<1,e>>>=n,t|=n,t|e>>1}function P(){var e=w(8,function(){return[]});function t(t){var n=M(t),r=e[N(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(t){e[N(t.byteLength)>>2].push(t)}function r(e,n){var r=null;switch(e){case T:r=new Int8Array(t(n),0,n);break;case E:r=new Uint8Array(t(n),0,n);break;case D:r=new Int16Array(t(2*n),0,n);break;case O:r=new Uint16Array(t(2*n),0,n);break;case k:r=new Int32Array(t(4*n),0,n);break;case A:r=new Uint32Array(t(4*n),0,n);break;case j:r=new Float32Array(t(4*n),0,n);break;default:return null}return r.length===n?r:r.subarray(0,n)}function i(e){n(e.buffer)}return{alloc:t,free:n,allocType:r,freeType:i}}var F=P();F.zero=P();var I=3408,L=3410,R=3411,z=3412,B=3413,V=3414,H=3415,U=33901,W=33902,G=3379,K=3386,q=34921,J=36347,Y=36348,X=35661,Z=35660,Q=34930,ee=36349,te=34076,ne=34024,re=7936,ie=7937,ae=7938,oe=35724,se=34047,ce=36063,le=34852,ue=3553,de=34067,fe=34069,pe=33984,me=6408,he=5126,ge=5121,_e=36160,ve=36053,ye=36064,be=16384,xe=function(e,t){var n=1;t.ext_texture_filter_anisotropic&&(n=e.getParameter(se));var r=1,i=1;t.webgl_draw_buffers&&(r=e.getParameter(le),i=e.getParameter(ce));var a=!!t.oes_texture_float;if(a){var o=e.createTexture();e.bindTexture(ue,o),e.texImage2D(ue,0,me,1,1,0,me,he,null);var s=e.createFramebuffer();if(e.bindFramebuffer(_e,s),e.framebufferTexture2D(_e,ye,ue,o,0),e.bindTexture(ue,null),e.checkFramebufferStatus(_e)!==ve)a=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(be);var c=F.allocType(he,4);e.readPixels(0,0,1,1,me,he,c),e.getError()?a=!1:(e.deleteFramebuffer(s),e.deleteTexture(o),a=c[0]===1),F.freeType(c)}}var l=typeof navigator<`u`&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),u=!0;if(!l){var d=e.createTexture(),f=F.allocType(ge,36);e.activeTexture(pe),e.bindTexture(de,d),e.texImage2D(fe,0,me,3,3,0,me,ge,f),F.freeType(f),e.bindTexture(de,null),e.deleteTexture(d),u=!e.getError()}return{colorBits:[e.getParameter(L),e.getParameter(R),e.getParameter(z),e.getParameter(B)],depthBits:e.getParameter(V),stencilBits:e.getParameter(H),subpixelBits:e.getParameter(I),extensions:Object.keys(t).filter(function(e){return!!t[e]}),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:e.getParameter(U),lineWidthDims:e.getParameter(W),maxViewportDims:e.getParameter(K),maxCombinedTextureUnits:e.getParameter(X),maxCubeMapSize:e.getParameter(te),maxRenderbufferSize:e.getParameter(ne),maxTextureUnits:e.getParameter(Q),maxTextureSize:e.getParameter(G),maxAttributes:e.getParameter(q),maxVertexUniforms:e.getParameter(J),maxVertexTextureUnits:e.getParameter(Z),maxVaryingVectors:e.getParameter(Y),maxFragmentUniforms:e.getParameter(ee),glsl:e.getParameter(oe),renderer:e.getParameter(ie),vendor:e.getParameter(re),version:e.getParameter(ae),readFloat:a,npotTextureCube:u}},Se=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 Ce(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)||Se(e.data))}var we=function(e){return Object.keys(e).map(function(t){return e[t]})},Te={shape:je,flatten:Ae};function Ee(e,t,n){for(var r=0;r<t;++r)n[r]=e[r]}function De(e,t,n,r){for(var i=0,a=0;a<t;++a)for(var o=e[a],s=0;s<n;++s)r[i++]=o[s]}function Oe(e,t,n,r,i,a){for(var o=a,s=0;s<t;++s)for(var c=e[s],l=0;l<n;++l)for(var u=c[l],d=0;d<r;++d)i[o++]=u[d]}function ke(e,t,n,r,i){for(var a=1,o=n+1;o<t.length;++o)a*=t[o];var s=t[n];if(t.length-n===4){var c=t[n+1],l=t[n+2],u=t[n+3];for(o=0;o<s;++o)Oe(e[o],c,l,u,r,i),i+=a}else for(o=0;o<s;++o)ke(e[o],t,n+1,r,i),i+=a}function Ae(e,t,n,r){var i=1;if(t.length)for(var a=0;a<t.length;++a)i*=t[a];else i=0;var o=r||F.allocType(n,i);switch(t.length){case 0:break;case 1:Ee(e,t[0],o);break;case 2:De(e,t[0],t[1],o);break;case 3:Oe(e,t[0],t[1],t[2],o,0);break;default:ke(e,t,0,o,0)}return o}function je(e){for(var t=[],n=e;n.length;n=n[0])t.push(n.length);return t}var Me={"[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},Ne={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},Pe={dynamic:35048,stream:35040,static:35044},Fe=Te.flatten,Ie=Te.shape,Le=35044,Re=35040,ze=5121,Be=5126,Ve=[];Ve[5120]=1,Ve[5122]=2,Ve[5124]=4,Ve[5121]=1,Ve[5123]=2,Ve[5125]=4,Ve[5126]=4;function He(e){return Me[Object.prototype.toString.call(e)]|0}function Ue(e,t){for(var n=0;n<t.length;++n)e[n]=t[n]}function We(e,t,n,r,i,a,o){for(var s=0,c=0;c<n;++c)for(var l=0;l<r;++l)e[s++]=t[i*c+a*l+o]}function Ge(e,t,n,r){var i=0,a={};function o(t){this.id=i++,this.buffer=e.createBuffer(),this.type=t,this.usage=Le,this.byteLength=0,this.dimension=1,this.dtype=ze,this.persistentData=null,n.profile&&(this.stats={size:0})}o.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},o.prototype.destroy=function(){f(this)};var s=[];function c(e,t){var n=s.pop();return n||=new o(e),n.bind(),d(n,t,Re,0,1,!1),n}function l(e){s.push(e)}function u(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function d(e,t,n,r,i,a){var o;if(e.usage=n,Array.isArray(t)){if(e.dtype=r||Be,t.length>0){var s;if(Array.isArray(t[0])){o=Ie(t);for(var c=1,l=1;l<o.length;++l)c*=o[l];e.dimension=c,s=Fe(t,o,e.dtype),u(e,s,n),a?e.persistentData=s:F.freeType(s)}else if(typeof t[0]==`number`){e.dimension=i;var d=F.allocType(e.dtype,t.length);Ue(d,t),u(e,d,n),a?e.persistentData=d:F.freeType(d)}else Se(t[0])&&(e.dimension=t[0].length,e.dtype=r||He(t[0])||Be,s=Fe(t,[t.length,t[0].length],e.dtype),u(e,s,n),a?e.persistentData=s:F.freeType(s))}}else if(Se(t))e.dtype=r||He(t),e.dimension=i,u(e,t,n),a&&(e.persistentData=new Uint8Array(new Uint8Array(t.buffer)));else if(Ce(t)){o=t.shape;var f=t.stride,p=t.offset,m=0,h=0,g=0,_=0;o.length===1?(m=o[0],h=1,g=f[0],_=0):o.length===2&&(m=o[0],h=o[1],g=f[0],_=f[1]),e.dtype=r||He(t.data)||Be,e.dimension=h;var v=F.allocType(e.dtype,m*h);We(v,t.data,m,h,g,_,p),u(e,v,n),a?e.persistentData=v:F.freeType(v)}else t instanceof ArrayBuffer&&(e.dtype=ze,e.dimension=i,u(e,t,n),a&&(e.persistentData=new Uint8Array(new Uint8Array(t))))}function f(n){t.bufferCount--,r(n);var i=n.buffer;e.deleteBuffer(i),n.buffer=null,delete a[n.id]}function p(r,i,s,c){t.bufferCount++;var l=new o(i);a[l.id]=l;function u(t){var r=Le,i=null,a=0,o=0,s=1;return Array.isArray(t)||Se(t)||Ce(t)||t instanceof ArrayBuffer?i=t:typeof t==`number`?a=t|0:t&&(`data`in t&&(i=t.data),`usage`in t&&(r=Pe[t.usage]),`type`in t&&(o=Ne[t.type]),`dimension`in t&&(s=t.dimension|0),`length`in t&&(a=t.length|0)),l.bind(),i?d(l,i,r,o,s,c):(a&&e.bufferData(l.type,a,r),l.dtype=o||ze,l.usage=r,l.dimension=s,l.byteLength=a),n.profile&&(l.stats.size=l.byteLength*Ve[l.dtype]),u}function p(t,n){e.bufferSubData(l.type,n,t)}function m(e,t){var n=(t||0)|0,r;if(l.bind(),Se(e)||e instanceof ArrayBuffer)p(e,n);else if(Array.isArray(e)){if(e.length>0){if(typeof e[0]==`number`){var i=F.allocType(l.dtype,e.length);Ue(i,e),p(i,n),F.freeType(i)}else if(Array.isArray(e[0])||Se(e[0])){r=Ie(e);var a=Fe(e,r,l.dtype);p(a,n),F.freeType(a)}}}else if(Ce(e)){r=e.shape;var o=e.stride,s=0,c=0,d=0,f=0;r.length===1?(s=r[0],c=1,d=o[0],f=0):r.length===2&&(s=r[0],c=r[1],d=o[0],f=o[1]);var m=Array.isArray(e.data)?l.dtype:He(e.data),h=F.allocType(m,s*c);We(h,e.data,s,c,d,f,e.offset),p(h,n),F.freeType(h)}return u}return s||u(r),u._reglType=`buffer`,u._buffer=l,u.subdata=m,n.profile&&(u.stats=l.stats),u.destroy=function(){f(l)},u}function m(){we(a).forEach(function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)})}return n.profile&&(t.getTotalBufferSize=function(){var e=0;return Object.keys(a).forEach(function(t){e+=a[t].stats.size}),e}),{create:p,createStream:c,destroyStream:l,clear:function(){we(a).forEach(f),s.forEach(f)},getBuffer:function(e){return e&&e._buffer instanceof o?e._buffer:null},restore:m,_initBuffer:d}}var Ke={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},qe=0,Je=1,Ye=4,Xe=5120,Ze=5121,Qe=5122,$e=5123,et=5124,tt=5125,nt=34963,rt=35040,it=35044;function at(e,t,n,r){var i={},a=0,o={uint8:Ze,uint16:$e};t.oes_element_index_uint&&(o.uint32=tt);function s(e){this.id=a++,i[this.id]=this,this.buffer=e,this.primType=Ye,this.vertCount=0,this.type=0}s.prototype.bind=function(){this.buffer.bind()};var c=[];function l(e){var t=c.pop();return t||=new s(n.create(null,nt,!0,!1)._buffer),d(t,e,rt,-1,-1,0,0),t}function u(e){c.push(e)}function d(r,i,a,o,s,c,l){r.buffer.bind();var u;if(i){var d=l;!l&&(!Se(i)||Ce(i)&&!Se(i.data))&&(d=t.oes_element_index_uint?tt:$e),n._initBuffer(r.buffer,i,a,d,3)}else e.bufferData(nt,c,a),r.buffer.dtype=u||Ze,r.buffer.usage=a,r.buffer.dimension=3,r.buffer.byteLength=c;if(u=l,!l){switch(r.buffer.dtype){case Ze:case Xe:u=Ze;break;case $e:case Qe:u=$e;break;case tt:case et:u=tt;break;default:}r.buffer.dtype=u}r.type=u;var f=s;f<0&&(f=r.buffer.byteLength,u===$e?f>>=1:u===tt&&(f>>=2)),r.vertCount=f;var p=o;if(o<0){p=Ye;var m=r.buffer.dimension;m===1&&(p=qe),m===2&&(p=Je),m===3&&(p=Ye)}r.primType=p}function f(e){r.elementsCount--,delete i[e.id],e.buffer.destroy(),e.buffer=null}function p(e,t){var i=n.create(null,nt,!0),a=new s(i._buffer);r.elementsCount++;function c(e){if(!e)i(),a.primType=Ye,a.vertCount=0,a.type=Ze;else if(typeof e==`number`)i(e),a.primType=Ye,a.vertCount=e|0,a.type=Ze;else{var t=null,n=it,r=-1,s=-1,l=0,u=0;Array.isArray(e)||Se(e)||Ce(e)?t=e:(`data`in e&&(t=e.data),`usage`in e&&(n=Pe[e.usage]),`primitive`in e&&(r=Ke[e.primitive]),`count`in e&&(s=e.count|0),`type`in e&&(u=o[e.type]),`length`in e?l=e.length|0:(l=s,u===$e||u===Qe?l*=2:(u===tt||u===et)&&(l*=4))),d(a,t,n,r,s,l,u)}return c}return c(e),c._reglType=`elements`,c._elements=a,c.subdata=function(e,t){return i.subdata(e,t),c},c.destroy=function(){f(a)},c}return{create:p,createStream:l,destroyStream:u,getElements:function(e){return typeof e==`function`&&e._elements instanceof s?e._elements:null},clear:function(){we(i).forEach(f)}}}var ot=new Float32Array(1),st=new Uint32Array(ot.buffer),ct=5123;function lt(e){for(var t=F.allocType(ct,e.length),n=0;n<e.length;++n)if(isNaN(e[n]))t[n]=65535;else if(e[n]===1/0)t[n]=31744;else if(e[n]===-1/0)t[n]=64512;else{ot[0]=e[n];var r=st[0],i=r>>>31<<15,a=(r<<1>>>24)-127,o=r>>13&1023;if(a<-24)t[n]=i;else if(a<-14){var s=-14-a;t[n]=i+(o+1024>>s)}else a>15?t[n]=i+31744:t[n]=i+(a+15<<10)+o}return t}function ut(e){return Array.isArray(e)||Se(e)}var $=34467,dt=3553,ft=34067,pt=34069,mt=6408,ht=6406,gt=6407,_t=6409,vt=6410,yt=32854,bt=32855,xt=36194,St=32819,Ct=32820,wt=33635,Tt=34042,Et=6402,Dt=34041,Ot=35904,kt=35906,At=36193,jt=33776,Mt=33777,Nt=33778,Pt=33779,Ft=35986,It=35987,Lt=34798,Rt=35840,zt=35841,Bt=35842,Vt=35843,Ht=36196,Ut=5121,Wt=5123,Gt=5125,Kt=5126,qt=10242,Jt=10243,Yt=10497,Xt=33071,Zt=33648,Qt=10240,$t=10241,en=9728,tn=9729,nn=9984,rn=9985,an=9986,on=9987,sn=33170,cn=4352,ln=4353,un=4354,dn=34046,fn=3317,pn=37440,mn=37441,hn=37443,gn=37444,_n=33984,vn=[nn,an,rn,on],yn=[0,_t,vt,gt,mt],bn={};bn[_t]=bn[ht]=bn[Et]=1,bn[Dt]=bn[vt]=2,bn[gt]=bn[Ot]=3,bn[mt]=bn[kt]=4;function xn(e){return`[object `+e+`]`}var Sn=xn(`HTMLCanvasElement`),Cn=xn(`OffscreenCanvas`),wn=xn(`CanvasRenderingContext2D`),Tn=xn(`ImageBitmap`),En=xn(`HTMLImageElement`),Dn=xn(`HTMLVideoElement`),On=Object.keys(Me).concat([Sn,Cn,wn,Tn,En,Dn]),kn=[];kn[Ut]=1,kn[Kt]=4,kn[At]=2,kn[Wt]=2,kn[Gt]=4;var An=[];An[yt]=2,An[bt]=2,An[xt]=2,An[Dt]=4,An[jt]=.5,An[Mt]=.5,An[Nt]=1,An[Pt]=1,An[Ft]=.5,An[It]=1,An[Lt]=1,An[Rt]=.5,An[zt]=.25,An[Bt]=.5,An[Vt]=.25,An[Ht]=.5;function jn(e){return Array.isArray(e)&&(e.length===0||typeof e[0]==`number`)}function Mn(e){return Array.isArray(e)?!(e.length===0||!ut(e[0])):!1}function Nn(e){return Object.prototype.toString.call(e)}function Pn(e){return Nn(e)===Sn}function Fn(e){return Nn(e)===Cn}function In(e){return Nn(e)===wn}function Ln(e){return Nn(e)===Tn}function Rn(e){return Nn(e)===En}function zn(e){return Nn(e)===Dn}function Bn(e){if(!e)return!1;var t=Nn(e);return On.indexOf(t)>=0?!0:jn(e)||Mn(e)||Ce(e)}function Vn(e){return Me[Object.prototype.toString.call(e)]|0}function Hn(e,t){var n=t.length;switch(e.type){case Ut:case Wt:case Gt:case Kt:var r=F.allocType(e.type,n);r.set(t),e.data=r;break;case At:e.data=lt(t);break;default:}}function Un(e,t){return F.allocType(e.type===At?Kt:e.type,t)}function Wn(e,t){e.type===At?(e.data=lt(t),F.freeType(t)):e.data=t}function Gn(e,t,n,r,i,a){for(var o=e.width,s=e.height,c=e.channels,l=Un(e,o*s*c),u=0,d=0;d<s;++d)for(var f=0;f<o;++f)for(var p=0;p<c;++p)l[u++]=t[n*f+r*d+i*p+a];Wn(e,l)}function Kn(e,t,n,r,i,a){var o;if(o=An[e]===void 0?bn[e]*kn[t]:An[e],a&&(o*=6),i){for(var s=0,c=n;c>=1;)s+=o*c*c,c/=2;return s}else return o*n*r}function qn(t,n,r,i,a,o,s){var c={"don't care":cn,"dont care":cn,nice:un,fast:ln},l={repeat:Yt,clamp:Xt,mirror:Zt},u={nearest:en,linear:tn},d=e({mipmap:on,"nearest mipmap nearest":nn,"linear mipmap nearest":rn,"nearest mipmap linear":an,"linear mipmap linear":on},u),f={none:0,browser:gn},p={uint8:Ut,rgba4:St,rgb565:wt,"rgb5 a1":Ct},m={alpha:ht,luminance:_t,"luminance alpha":vt,rgb:gt,rgba:mt,rgba4:yt,"rgb5 a1":bt,rgb565:xt},h={};n.ext_srgb&&(m.srgb=Ot,m.srgba=kt),n.oes_texture_float&&(p.float32=p.float=Kt),n.oes_texture_half_float&&(p.float16=p[`half float`]=At),n.webgl_depth_texture&&(e(m,{depth:Et,"depth stencil":Dt}),e(p,{uint16:Wt,uint32:Gt,"depth stencil":Tt})),n.webgl_compressed_texture_s3tc&&e(h,{"rgb s3tc dxt1":jt,"rgba s3tc dxt1":Mt,"rgba s3tc dxt3":Nt,"rgba s3tc dxt5":Pt}),n.webgl_compressed_texture_atc&&e(h,{"rgb atc":Ft,"rgba atc explicit alpha":It,"rgba atc interpolated alpha":Lt}),n.webgl_compressed_texture_pvrtc&&e(h,{"rgb pvrtc 4bppv1":Rt,"rgb pvrtc 2bppv1":zt,"rgba pvrtc 4bppv1":Bt,"rgba pvrtc 2bppv1":Vt}),n.webgl_compressed_texture_etc1&&(h[`rgb etc1`]=Ht);var g=Array.prototype.slice.call(t.getParameter($));Object.keys(h).forEach(function(e){var t=h[e];g.indexOf(t)>=0&&(m[e]=t)});var _=Object.keys(m);r.textureFormats=_;var v=[];Object.keys(m).forEach(function(e){var t=m[e];v[t]=e});var y=[];Object.keys(p).forEach(function(e){var t=p[e];y[t]=e});var b=[];Object.keys(u).forEach(function(e){var t=u[e];b[t]=e});var x=[];Object.keys(d).forEach(function(e){var t=d[e];x[t]=e});var S=[];Object.keys(l).forEach(function(e){var t=l[e];S[t]=e});var C=_.reduce(function(e,t){var r=m[t];return r===_t||r===ht||r===_t||r===vt||r===Et||r===Dt||n.ext_srgb&&(r===Ot||r===kt)?e[r]=r:r===bt||t.indexOf(`rgba`)>=0?e[r]=mt:e[r]=gt,e},{});function w(){this.internalformat=mt,this.format=mt,this.type=Ut,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=gn,this.width=0,this.height=0,this.channels=0}function T(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function E(e,t){if(!(typeof t!=`object`||!t)){`premultiplyAlpha`in t&&(e.premultiplyAlpha=t.premultiplyAlpha),`flipY`in t&&(e.flipY=t.flipY),`alignment`in t&&(e.unpackAlignment=t.alignment),`colorSpace`in t&&(e.colorSpace=f[t.colorSpace]),`type`in t&&(e.type=p[t.type]);var n=e.width,r=e.height,i=e.channels,a=!1;`shape`in t?(n=t.shape[0],r=t.shape[1],t.shape.length===3&&(i=t.shape[2],a=!0)):(`radius`in t&&(n=r=t.radius),`width`in t&&(n=t.width),`height`in t&&(r=t.height),`channels`in t&&(i=t.channels,a=!0)),e.width=n|0,e.height=r|0,e.channels=i|0;var o=!1;if(`format`in t){var s=t.format;e.format=C[e.internalformat=m[s]],s in p&&(`type`in t||(e.type=p[s])),s in h&&(e.compressed=!0),o=!0}!a&&o?e.channels=bn[e.format]:a&&!o&&e.channels!==yn[e.format]&&(e.format=e.internalformat=yn[e.channels])}}function D(e){t.pixelStorei(pn,e.flipY),t.pixelStorei(mn,e.premultiplyAlpha),t.pixelStorei(hn,e.colorSpace),t.pixelStorei(fn,e.unpackAlignment)}function O(){w.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function k(e,t){var n=null;if(Bn(t)?n=t:t&&(E(e,t),`x`in t&&(e.xOffset=t.x|0),`y`in t&&(e.yOffset=t.y|0),Bn(t.data)&&(n=t.data)),t.copy){var r=a.viewportWidth,i=a.viewportHeight;e.width=e.width||r-e.xOffset,e.height=e.height||i-e.yOffset,e.needsCopy=!0}else if(!n)e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;else if(Se(n))e.channels=e.channels||4,e.data=n,!(`type`in t)&&e.type===Ut&&(e.type=Vn(n));else if(jn(n))e.channels=e.channels||4,Hn(e,n),e.alignment=1,e.needsFree=!0;else if(Ce(n)){var o=n.data;!Array.isArray(o)&&e.type===Ut&&(e.type=Vn(o));var s=n.shape,c=n.stride,l,u,d,f,p,m;s.length===3?(d=s[2],m=c[2]):(d=1,m=1),l=s[0],u=s[1],f=c[0],p=c[1],e.alignment=1,e.width=l,e.height=u,e.channels=d,e.format=e.internalformat=yn[d],e.needsFree=!0,Gn(e,o,f,p,m,n.offset)}else if(Pn(n)||Fn(n)||In(n))Pn(n)||Fn(n)?e.element=n:e.element=n.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(Ln(n))e.element=n,e.width=n.width,e.height=n.height,e.channels=4;else if(Rn(n))e.element=n,e.width=n.naturalWidth,e.height=n.naturalHeight,e.channels=4;else if(zn(n))e.element=n,e.width=n.videoWidth,e.height=n.videoHeight,e.channels=4;else if(Mn(n)){var h=e.width||n[0].length,g=e.height||n.length,_=e.channels;ut(n[0][0])?_||=n[0][0].length:_||=1;for(var v=Te.shape(n),y=1,b=0;b<v.length;++b)y*=v[b];var x=Un(e,y);Te.flatten(n,v,``,x),Wn(e,x),e.alignment=1,e.width=h,e.height=g,e.channels=_,e.format=e.internalformat=yn[_],e.needsFree=!0}e.type===Kt||e.type}function A(e,n,r){var a=e.element,o=e.data,s=e.internalformat,c=e.format,l=e.type,u=e.width,d=e.height;D(e),a?t.texImage2D(n,r,c,c,l,a):e.compressed?t.compressedTexImage2D(n,r,s,u,d,0,o):e.needsCopy?(i(),t.copyTexImage2D(n,r,c,e.xOffset,e.yOffset,u,d,0)):t.texImage2D(n,r,c,u,d,0,c,l,o||null)}function j(e,n,r,a,o){var s=e.element,c=e.data,l=e.internalformat,u=e.format,d=e.type,f=e.width,p=e.height;D(e),s?t.texSubImage2D(n,o,r,a,u,d,s):e.compressed?t.compressedTexSubImage2D(n,o,r,a,l,f,p,c):e.needsCopy?(i(),t.copyTexSubImage2D(n,o,r,a,e.xOffset,e.yOffset,f,p)):t.texSubImage2D(n,o,r,a,f,p,u,d,c)}var M=[];function N(){return M.pop()||new O}function P(e){e.needsFree&&F.freeType(e.data),O.call(e),M.push(e)}function I(){w.call(this),this.genMipmaps=!1,this.mipmapHint=cn,this.mipmask=0,this.images=Array(16)}function L(e,t,n){var r=e.images[0]=N();e.mipmask=1,r.width=e.width=t,r.height=e.height=n,r.channels=e.channels=4}function R(e,t){var n=null;if(Bn(t))n=e.images[0]=N(),T(n,e),k(n,t),e.mipmask=1;else if(E(e,t),Array.isArray(t.mipmap))for(var r=t.mipmap,i=0;i<r.length;++i)n=e.images[i]=N(),T(n,e),n.width>>=i,n.height>>=i,k(n,r[i]),e.mipmask|=1<<i;else n=e.images[0]=N(),T(n,e),k(n,t),e.mipmask=1;T(e,e.images[0]),e.compressed&&(e.internalformat===jt||e.internalformat===Mt||e.internalformat===Nt||e.internalformat)}function z(e,t){for(var n=e.images,r=0;r<n.length;++r){if(!n[r])return;A(n[r],t,r)}}var B=[];function V(){var e=B.pop()||new I;w.call(e),e.mipmask=0;for(var t=0;t<16;++t)e.images[t]=null;return e}function H(e){for(var t=e.images,n=0;n<t.length;++n)t[n]&&P(t[n]),t[n]=null;B.push(e)}function U(){this.minFilter=en,this.magFilter=en,this.wrapS=Xt,this.wrapT=Xt,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=cn}function W(e,t){`min`in t&&(e.minFilter=d[t.min],vn.indexOf(e.minFilter)>=0&&!(`faces`in t)&&(e.genMipmaps=!0)),`mag`in t&&(e.magFilter=u[t.mag]);var n=e.wrapS,r=e.wrapT;if(`wrap`in t){var i=t.wrap;typeof i==`string`?n=r=l[i]:Array.isArray(i)&&(n=l[i[0]],r=l[i[1]])}else `wrapS`in t&&(n=l[t.wrapS]),`wrapT`in t&&(r=l[t.wrapT]);if(e.wrapS=n,e.wrapT=r,`anisotropic`in t&&(t.anisotropic,e.anisotropic=t.anisotropic),`mipmap`in t){var a=!1;switch(typeof t.mipmap){case`string`:e.mipmapHint=c[t.mipmap],e.genMipmaps=!0,a=!0;break;case`boolean`:a=e.genMipmaps=t.mipmap;break;case`object`:e.genMipmaps=!1,a=!0;break;default:}a&&!(`min`in t)&&(e.minFilter=nn)}}function G(e,r){t.texParameteri(r,$t,e.minFilter),t.texParameteri(r,Qt,e.magFilter),t.texParameteri(r,qt,e.wrapS),t.texParameteri(r,Jt,e.wrapT),n.ext_texture_filter_anisotropic&&t.texParameteri(r,dn,e.anisotropic),e.genMipmaps&&(t.hint(sn,e.mipmapHint),t.generateMipmap(r))}var K=0,q={},J=r.maxTextureUnits,Y=Array(J).map(function(){return null});function X(e){w.call(this),this.mipmask=0,this.internalformat=mt,this.id=K++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new U,s.profile&&(this.stats={size:0})}function Z(e){t.activeTexture(_n),t.bindTexture(e.target,e.texture)}function Q(){var e=Y[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(dt,null)}function ee(e){var n=e.texture,r=e.unit,i=e.target;r>=0&&(t.activeTexture(_n+r),t.bindTexture(i,null),Y[r]=null),t.deleteTexture(n),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete q[e.id],o.textureCount--}e(X.prototype,{bind:function(){var e=this;e.bindCount+=1;var n=e.unit;if(n<0){for(var r=0;r<J;++r){var i=Y[r];if(i){if(i.bindCount>0)continue;i.unit=-1}Y[r]=e,n=r;break}s.profile&&o.maxTextureUnits<n+1&&(o.maxTextureUnits=n+1),e.unit=n,t.activeTexture(_n+n),t.bindTexture(e.target,e.texture)}return n},unbind:function(){--this.bindCount},decRef:function(){--this.refCount<=0&&ee(this)}});function te(e,n){var r=new X(dt);q[r.id]=r,o.textureCount++;function i(e,t){var n=r.texInfo;U.call(n);var a=V();return typeof e==`number`?typeof t==`number`?L(a,e|0,t|0):L(a,e|0,e|0):e?(W(n,e),R(a,e)):L(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,T(r,a),r.internalformat=a.internalformat,i.width=a.width,i.height=a.height,Z(r),z(a,dt),G(n,dt),Q(),H(a),s.profile&&(r.stats.size=Kn(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),i.format=v[r.internalformat],i.type=y[r.type],i.mag=b[n.magFilter],i.min=x[n.minFilter],i.wrapS=S[n.wrapS],i.wrapT=S[n.wrapT],i}function a(e,t,n,a){var o=t|0,s=n|0,c=a|0,l=N();return T(l,r),l.width=0,l.height=0,k(l,e),l.width=l.width||(r.width>>c)-o,l.height=l.height||(r.height>>c)-s,Z(r),j(l,dt,o,s,c),Q(),P(l),i}function c(e,n){var a=e|0,o=n|0||a;if(a===r.width&&o===r.height)return i;i.width=r.width=a,i.height=r.height=o,Z(r);for(var c=0;r.mipmask>>c;++c){var l=a>>c,u=o>>c;if(!l||!u)break;t.texImage2D(dt,c,r.format,l,u,0,r.format,r.type,null)}return Q(),s.profile&&(r.stats.size=Kn(r.internalformat,r.type,a,o,!1,!1)),i}return i(e,n),i.subimage=a,i.resize=c,i._reglType=`texture2d`,i._texture=r,s.profile&&(i.stats=r.stats),i.destroy=function(){r.decRef()},i}function ne(e,n,r,i,a,c){var l=new X(ft);q[l.id]=l,o.cubeCount++;var u=[,,,,,,];function d(e,t,n,r,i,a){var o,c=l.texInfo;for(U.call(c),o=0;o<6;++o)u[o]=V();if(typeof e==`number`||!e){var f=e|0||1;for(o=0;o<6;++o)L(u[o],f,f)}else if(typeof e==`object`)if(t)R(u[0],e),R(u[1],t),R(u[2],n),R(u[3],r),R(u[4],i),R(u[5],a);else if(W(c,e),E(l,e),`faces`in e){var p=e.faces;for(o=0;o<6;++o)T(u[o],l),R(u[o],p[o])}else for(o=0;o<6;++o)R(u[o],e);for(T(l,u[0]),c.genMipmaps?l.mipmask=(u[0].width<<1)-1:l.mipmask=u[0].mipmask,l.internalformat=u[0].internalformat,d.width=u[0].width,d.height=u[0].height,Z(l),o=0;o<6;++o)z(u[o],pt+o);for(G(c,ft),Q(),s.profile&&(l.stats.size=Kn(l.internalformat,l.type,d.width,d.height,c.genMipmaps,!0)),d.format=v[l.internalformat],d.type=y[l.type],d.mag=b[c.magFilter],d.min=x[c.minFilter],d.wrapS=S[c.wrapS],d.wrapT=S[c.wrapT],o=0;o<6;++o)H(u[o]);return d}function f(e,t,n,r,i){var a=n|0,o=r|0,s=i|0,c=N();return T(c,l),c.width=0,c.height=0,k(c,t),c.width=c.width||(l.width>>s)-a,c.height=c.height||(l.height>>s)-o,Z(l),j(c,pt+e,a,o,s),Q(),P(c),d}function p(e){var n=e|0;if(n!==l.width){d.width=l.width=n,d.height=l.height=n,Z(l);for(var r=0;r<6;++r)for(var i=0;l.mipmask>>i;++i)t.texImage2D(pt+r,i,l.format,n>>i,n>>i,0,l.format,l.type,null);return Q(),s.profile&&(l.stats.size=Kn(l.internalformat,l.type,d.width,d.height,!1,!0)),d}}return d(e,n,r,i,a,c),d.subimage=f,d.resize=p,d._reglType=`textureCube`,d._texture=l,s.profile&&(d.stats=l.stats),d.destroy=function(){l.decRef()},d}function re(){for(var e=0;e<J;++e)t.activeTexture(_n+e),t.bindTexture(dt,null),Y[e]=null;we(q).forEach(ee),o.cubeCount=0,o.textureCount=0}s.profile&&(o.getTotalTextureSize=function(){var e=0;return Object.keys(q).forEach(function(t){e+=q[t].stats.size}),e});function ie(){for(var e=0;e<J;++e){var n=Y[e];n&&(n.bindCount=0,n.unit=-1,Y[e]=null)}we(q).forEach(function(e){e.texture=t.createTexture(),t.bindTexture(e.target,e.texture);for(var n=0;n<32;++n)if(e.mipmask&1<<n)if(e.target===dt)t.texImage2D(dt,n,e.internalformat,e.width>>n,e.height>>n,0,e.internalformat,e.type,null);else for(var r=0;r<6;++r)t.texImage2D(pt+r,n,e.internalformat,e.width>>n,e.height>>n,0,e.internalformat,e.type,null);G(e.texInfo,e.target)})}function ae(){for(var e=0;e<J;++e){var n=Y[e];n&&(n.bindCount=0,n.unit=-1,Y[e]=null),t.activeTexture(_n+e),t.bindTexture(dt,null),t.bindTexture(ft,null)}}return{create2D:te,createCube:ne,clear:re,getTexture:function(e){return null},restore:ie,refresh:ae}}var Jn=36161,Yn=32854,Xn=32855,Zn=36194,Qn=33189,$n=36168,er=34041,tr=35907,nr=34836,rr=34842,ir=34843,ar=[];ar[Yn]=2,ar[Xn]=2,ar[Zn]=2,ar[Qn]=2,ar[$n]=1,ar[er]=4,ar[tr]=4,ar[nr]=16,ar[rr]=8,ar[ir]=6;function or(e,t,n){return ar[e]*t*n}var sr=function(e,t,n,r,i){var a={rgba4:Yn,rgb565:Zn,"rgb5 a1":Xn,depth:Qn,stencil:$n,"depth stencil":er};t.ext_srgb&&(a.srgba=tr),t.ext_color_buffer_half_float&&(a.rgba16f=rr,a.rgb16f=ir),t.webgl_color_buffer_float&&(a.rgba32f=nr);var o=[];Object.keys(a).forEach(function(e){var t=a[e];o[t]=e});var s=0,c={};function l(e){this.id=s++,this.refCount=1,this.renderbuffer=e,this.format=Yn,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}l.prototype.decRef=function(){--this.refCount<=0&&u(this)};function u(t){var n=t.renderbuffer;e.bindRenderbuffer(Jn,null),e.deleteRenderbuffer(n),t.renderbuffer=null,t.refCount=0,delete c[t.id],r.renderbufferCount--}function d(t,n){var s=new l(e.createRenderbuffer());c[s.id]=s,r.renderbufferCount++;function u(t,n){var r=0,c=0,l=Yn;if(typeof t==`object`&&t){var d=t;if(`shape`in d){var f=d.shape;r=f[0]|0,c=f[1]|0}else `radius`in d&&(r=c=d.radius|0),`width`in d&&(r=d.width|0),`height`in d&&(c=d.height|0);`format`in d&&(l=a[d.format])}else typeof t==`number`?(r=t|0,c=typeof n==`number`?n|0:r):t||(r=c=1);if(!(r===s.width&&c===s.height&&l===s.format))return u.width=s.width=r,u.height=s.height=c,s.format=l,e.bindRenderbuffer(Jn,s.renderbuffer),e.renderbufferStorage(Jn,l,r,c),i.profile&&(s.stats.size=or(s.format,s.width,s.height)),u.format=o[s.format],u}function d(t,n){var r=t|0,a=n|0||r;return r===s.width&&a===s.height||(u.width=s.width=r,u.height=s.height=a,e.bindRenderbuffer(Jn,s.renderbuffer),e.renderbufferStorage(Jn,s.format,r,a),i.profile&&(s.stats.size=or(s.format,s.width,s.height))),u}return u(t,n),u.resize=d,u._reglType=`renderbuffer`,u._renderbuffer=s,i.profile&&(u.stats=s.stats),u.destroy=function(){s.decRef()},u}i.profile&&(r.getTotalRenderbufferSize=function(){var e=0;return Object.keys(c).forEach(function(t){e+=c[t].stats.size}),e});function f(){we(c).forEach(function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(Jn,t.renderbuffer),e.renderbufferStorage(Jn,t.format,t.width,t.height)}),e.bindRenderbuffer(Jn,null)}return{create:d,clear:function(){we(c).forEach(u)},restore:f}},cr=36160,lr=36161,ur=3553,dr=34069,fr=36064,pr=36096,mr=36128,hr=33306,gr=36193,_r=5121,vr=5126,yr=6407,br=6408,xr=[];xr[br]=4,xr[yr]=3;var Sr=[];Sr[_r]=1,Sr[vr]=4,Sr[gr]=2;function Cr(t,n,r,i,a,o){var s={cur:null,next:null,dirty:!1,setFBO:null},c=[`rgba`],l=[`rgba4`,`rgb565`,`rgb5 a1`];n.ext_srgb&&l.push(`srgba`),n.ext_color_buffer_half_float&&l.push(`rgba16f`,`rgb16f`),n.webgl_color_buffer_float&&l.push(`rgba32f`);var u=[`uint8`];n.oes_texture_half_float&&u.push(`half float`,`float16`),n.oes_texture_float&&u.push(`float`,`float32`);function d(e,t,n){this.target=e,this.texture=t,this.renderbuffer=n;var r=0,i=0;t?(r=t.width,i=t.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function f(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function p(e,t,n){if(e)if(e.texture){var r=e.texture._texture;Math.max(1,r.width),Math.max(1,r.height),r.refCount+=1}else{var i=e.renderbuffer._renderbuffer;i.refCount+=1}}function m(e,n){n&&(n.texture?t.framebufferTexture2D(cr,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(cr,e,lr,n.renderbuffer._renderbuffer.renderbuffer))}function h(e){var t=ur,n=null,r=null,i=e;typeof e==`object`&&(i=e.data,`target`in e&&(t=e.target|0));var a=i._reglType;return a===`texture2d`||a===`textureCube`?n=i:a===`renderbuffer`&&(r=i,t=lr),new d(t,n,r)}function g(e,t,n,r,o){if(n){var s=i.create2D({width:e,height:t,format:r,type:o});return s._texture.refCount=0,new d(ur,s,null)}else{var c=a.create({width:e,height:t,format:r});return c._renderbuffer.refCount=0,new d(lr,null,c)}}function _(e){return e&&(e.texture||e.renderbuffer)}function v(e,t,n){e&&(e.texture?e.texture.resize(t,n):e.renderbuffer&&e.renderbuffer.resize(t,n),e.width=t,e.height=n)}var y=0,b={};function x(){this.id=y++,b[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function S(e){e.colorAttachments.forEach(f),f(e.depthAttachment),f(e.stencilAttachment),f(e.depthStencilAttachment)}function C(e){var n=e.framebuffer;t.deleteFramebuffer(n),e.framebuffer=null,o.framebufferCount--,delete b[e.id]}function w(e){var n;t.bindFramebuffer(cr,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)m(fr+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(cr,fr+n,ur,null,0);t.framebufferTexture2D(cr,hr,ur,null,0),t.framebufferTexture2D(cr,pr,ur,null,0),t.framebufferTexture2D(cr,mr,ur,null,0),m(pr,e.depthAttachment),m(mr,e.stencilAttachment),m(hr,e.depthStencilAttachment),t.checkFramebufferStatus(cr),t.isContextLost(),t.bindFramebuffer(cr,s.next?s.next.framebuffer:null),s.cur=s.next,t.getError()}function T(t,n){var r=new x;o.framebufferCount++;function i(e,t){var n,a=0,o=0,s=!0,u=!0,d=null,f=!0,m=`rgba`,v=`uint8`,y=1,b=null,x=null,C=null,T=!1;if(typeof e==`number`)a=e|0,o=t|0||a;else if(!e)a=o=1;else{var E=e;if(`shape`in E){var D=E.shape;a=D[0],o=D[1]}else `radius`in E&&(a=o=E.radius),`width`in E&&(a=E.width),`height`in E&&(o=E.height);(`color`in E||`colors`in E)&&(d=E.color||E.colors),d||(`colorCount`in E&&(y=E.colorCount|0),`colorTexture`in E&&(f=!!E.colorTexture,m=`rgba4`),`colorType`in E&&(v=E.colorType,f||(v===`half float`||v===`float16`?m=`rgba16f`:(v===`float`||v===`float32`)&&(m=`rgba32f`))),`colorFormat`in E&&(m=E.colorFormat,c.indexOf(m)>=0?f=!0:l.indexOf(m)>=0&&(f=!1))),(`depthTexture`in E||`depthStencilTexture`in E)&&(T=!!(E.depthTexture||E.depthStencilTexture)),`depth`in E&&(typeof E.depth==`boolean`?s=E.depth:(b=E.depth,u=!1)),`stencil`in E&&(typeof E.stencil==`boolean`?u=E.stencil:(x=E.stencil,s=!1)),`depthStencil`in E&&(typeof E.depthStencil==`boolean`?s=u=E.depthStencil:(C=E.depthStencil,s=!1,u=!1))}var O=null,k=null,A=null,j=null;if(Array.isArray(d))O=d.map(h);else if(d)O=[h(d)];else for(O=Array(y),n=0;n<y;++n)O[n]=g(a,o,f,m,v);a||=O[0].width,o||=O[0].height,b?k=h(b):s&&!u&&(k=g(a,o,T,`depth`,`uint32`)),x?A=h(x):u&&!s&&(A=g(a,o,!1,`stencil`,`uint8`)),C?j=h(C):!b&&!x&&u&&s&&(j=g(a,o,T,`depth stencil`,`depth stencil`));var M=null;for(n=0;n<O.length;++n)if(p(O[n],a,o),O[n]&&O[n].texture){var N=xr[O[n].texture._texture.format]*Sr[O[n].texture._texture.type];M===null&&(M=N)}return p(k,a,o),p(A,a,o),p(j,a,o),S(r),r.width=a,r.height=o,r.colorAttachments=O,r.depthAttachment=k,r.stencilAttachment=A,r.depthStencilAttachment=j,i.color=O.map(_),i.depth=_(k),i.stencil=_(A),i.depthStencil=_(j),i.width=r.width,i.height=r.height,w(r),i}function a(e,t){var n=Math.max(e|0,1),a=Math.max(t|0||n,1);if(n===r.width&&a===r.height)return i;for(var o=r.colorAttachments,s=0;s<o.length;++s)v(o[s],n,a);return v(r.depthAttachment,n,a),v(r.stencilAttachment,n,a),v(r.depthStencilAttachment,n,a),r.width=i.width=n,r.height=i.height=a,w(r),i}return i(t,n),e(i,{resize:a,_reglType:`framebuffer`,_framebuffer:r,destroy:function(){C(r),S(r)},use:function(e){s.setFBO({framebuffer:i},e)}})}function E(t){var n=[,,,,,,];function r(t){var a,o={color:null},s=0,c=null,l=`rgba`,u=`uint8`,d=1;if(typeof t==`number`)s=t|0;else if(!t)s=1;else{var f=t;`shape`in f?s=f.shape[0]:(`radius`in f&&(s=f.radius|0),`width`in f?(s=f.width|0,`height`in f):`height`in f&&(s=f.height|0)),(`color`in f||`colors`in f)&&(c=f.color||f.colors),c||(`colorCount`in f&&(d=f.colorCount|0),`colorType`in f&&(u=f.colorType),`colorFormat`in f&&(l=f.colorFormat)),`depth`in f&&(o.depth=f.depth),`stencil`in f&&(o.stencil=f.stencil),`depthStencil`in f&&(o.depthStencil=f.depthStencil)}var p;if(c)if(Array.isArray(c))for(p=[],a=0;a<c.length;++a)p[a]=c[a];else p=[c];else{p=Array(d);var m={radius:s,format:l,type:u};for(a=0;a<d;++a)p[a]=i.createCube(m)}for(o.color=Array(p.length),a=0;a<p.length;++a){var h=p[a];s||=h.width,o.color[a]={target:dr,data:p[a]}}for(a=0;a<6;++a){for(var g=0;g<p.length;++g)o.color[g].target=dr+a;a>0&&(o.depth=n[0].depth,o.stencil=n[0].stencil,o.depthStencil=n[0].depthStencil),n[a]?n[a](o):n[a]=T(o)}return e(r,{width:s,height:s,color:p})}function a(e){var t,i=e|0;if(i===r.width)return r;var a=r.color;for(t=0;t<a.length;++t)a[t].resize(i);for(t=0;t<6;++t)n[t].resize(i);return r.width=r.height=i,r}return r(t),e(r,{faces:n,resize:a,_reglType:`framebufferCube`,destroy:function(){n.forEach(function(e){e.destroy()})}})}function D(){s.cur=null,s.next=null,s.dirty=!0,we(b).forEach(function(e){e.framebuffer=t.createFramebuffer(),w(e)})}return e(s,{getFramebuffer:function(e){if(typeof e==`function`&&e._reglType===`framebuffer`){var t=e._framebuffer;if(t instanceof x)return t}return null},create:T,createCube:E,clear:function(){we(b).forEach(C)},restore:D})}var wr=5126,Tr=34962,Er=34963;function Dr(){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=wr,this.offset=0,this.stride=0,this.divisor=0}function Or(e,t,n,r,i,a,o){for(var s=n.maxAttributes,c=Array(s),l=0;l<s;++l)c[l]=new Dr;var u=0,d={},f={Record:Dr,scope:{},state:c,currentVAO:null,targetVAO:null,restore:m()?x:function(){},createVAO:S,getVAO:g,destroyBuffer:p,setVAO:m()?_:v,clear:m()?y:function(){}};function p(t){for(var n=0;n<c.length;++n){var r=c[n];r.buffer===t&&(e.disableVertexAttribArray(n),r.buffer=null)}}function m(){return t.oes_vertex_array_object}function h(){return t.angle_instanced_arrays}function g(e){return typeof e==`function`&&e._vao?e._vao:null}function _(e){if(e!==f.currentVAO){var t=m();e?t.bindVertexArrayOES(e.vao):t.bindVertexArrayOES(null),f.currentVAO=e}}function v(t){if(t!==f.currentVAO){if(t)t.bindAttrs();else{for(var n=h(),r=0;r<c.length;++r){var i=c[r];i.buffer?(e.enableVertexAttribArray(r),i.buffer.bind(),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offfset),n&&i.divisor&&n.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}o.elements?e.bindBuffer(Er,o.elements.buffer.buffer):e.bindBuffer(Er,null)}f.currentVAO=t}}function y(){we(d).forEach(function(e){e.destroy()})}function b(){this.id=++u,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var e=m();e?this.vao=e.createVertexArrayOES():this.vao=null,d[this.id]=this,this.buffers=[]}b.prototype.bindAttrs=function(){for(var t=h(),n=this.attributes,r=0;r<n.length;++r){var i=n[r];i.buffer?(e.enableVertexAttribArray(r),e.bindBuffer(Tr,i.buffer.buffer),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offset),t&&i.divisor&&t.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}for(var o=n.length;o<s;++o)e.disableVertexAttribArray(o);var c=a.getElements(this.elements);c?e.bindBuffer(Er,c.buffer.buffer):e.bindBuffer(Er,null)},b.prototype.refresh=function(){var e=m();e&&(e.bindVertexArrayOES(this.vao),this.bindAttrs(),f.currentVAO=null,e.bindVertexArrayOES(null))},b.prototype.destroy=function(){if(this.vao){var e=m();this===f.currentVAO&&(f.currentVAO=null,e.bindVertexArrayOES(null)),e.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&=(this.elements.destroy(),this.elements=null,!1),d[this.id]&&(delete d[this.id],--r.vaoCount)};function x(){m()&&we(d).forEach(function(e){e.refresh()})}function S(e){var t=new b;r.vaoCount+=1;function n(e){var r;if(Array.isArray(e))r=e,t.elements&&t.ownsElements&&t.elements.destroy(),t.elements=null,t.ownsElements=!1,t.offset=0,t.count=0,t.instances=-1,t.primitive=4;else{if(e.elements){var o=e.elements;t.ownsElements?typeof o==`function`&&o._reglType===`elements`?(t.elements.destroy(),t.ownsElements=!1):(t.elements(o),t.ownsElements=!1):a.getElements(e.elements)?(t.elements=e.elements,t.ownsElements=!1):(t.elements=a.create(e.elements),t.ownsElements=!0)}else t.elements=null,t.ownsElements=!1;r=e.attributes,t.offset=0,t.count=-1,t.instances=-1,t.primitive=4,t.elements&&(t.count=t.elements._elements.vertCount,t.primitive=t.elements._elements.primType),`offset`in e&&(t.offset=e.offset|0),`count`in e&&(t.count=e.count|0),`instances`in e&&(t.instances=e.instances|0),`primitive`in e&&(t.primitive=Ke[e.primitive])}var s={},c=t.attributes;c.length=r.length;for(var l=0;l<r.length;++l){var u=r[l],d=c[l]=new Dr,f=u.data||u;if(Array.isArray(f)||Se(f)||Ce(f)){var p;t.buffers[l]&&(p=t.buffers[l],Se(f)&&p._buffer.byteLength>=f.byteLength?p.subdata(f):(p.destroy(),t.buffers[l]=null)),t.buffers[l]||(p=t.buffers[l]=i.create(u,Tr,!1,!0)),d.buffer=i.getBuffer(p),d.size=d.buffer.dimension|0,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1,s[l]=1}else i.getBuffer(u)?(d.buffer=i.getBuffer(u),d.size=d.buffer.dimension|0,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1):i.getBuffer(u.buffer)?(d.buffer=i.getBuffer(u.buffer),d.size=(+u.size||d.buffer.dimension)|0,d.normalized=!!u.normalized||!1,`type`in u?d.type=Ne[u.type]:d.type=d.buffer.dtype,d.offset=(u.offset||0)|0,d.stride=(u.stride||0)|0,d.divisor=(u.divisor||0)|0,d.state=1):`x`in u&&(d.x=+u.x||0,d.y=+u.y||0,d.z=+u.z||0,d.w=+u.w||0,d.state=2)}for(var m=0;m<t.buffers.length;++m)!s[m]&&t.buffers[m]&&(t.buffers[m].destroy(),t.buffers[m]=null);return t.refresh(),n}return n.destroy=function(){for(var e=0;e<t.buffers.length;++e)t.buffers[e]&&t.buffers[e].destroy();t.buffers.length=0,t.ownsElements&&=(t.elements.destroy(),t.elements=null,!1),t.destroy()},n._vao=t,n._reglType=`vao`,n(e)}return f}var kr=35632,Ar=35633,jr=35718,Mr=35721;function Nr(t,n,r,i){var a={},o={};function s(e,t,n,r){this.name=e,this.id=t,this.location=n,this.info=r}function c(e,t){for(var n=0;n<e.length;++n)if(e[n].id===t.id){e[n].location=t.location;return}e.push(t)}function l(e,r,i){var s=e===kr?a:o,c=s[r];if(!c){var l=n.str(r);c=t.createShader(e),t.shaderSource(c,l),t.compileShader(c),s[r]=c}return c}var u={},d=[],f=0;function p(e,t){this.id=f++,this.fragId=e,this.vertId=t,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function m(e,r,a){var o,u,d=l(kr,e.fragId),f=l(Ar,e.vertId),p=e.program=t.createProgram();if(t.attachShader(p,d),t.attachShader(p,f),a)for(o=0;o<a.length;++o){var m=a[o];t.bindAttribLocation(p,m[0],m[1])}t.linkProgram(p);var h=t.getProgramParameter(p,jr);i.profile&&(e.stats.uniformsCount=h);var g=e.uniforms;for(o=0;o<h;++o)if(u=t.getActiveUniform(p,o),u)if(u.size>1)for(var _=0;_<u.size;++_){var v=u.name.replace(`[0]`,`[`+_+`]`);c(g,new s(v,n.id(v),t.getUniformLocation(p,v),u))}else c(g,new s(u.name,n.id(u.name),t.getUniformLocation(p,u.name),u));var y=t.getProgramParameter(p,Mr);i.profile&&(e.stats.attributesCount=y);var b=e.attributes;for(o=0;o<y;++o)u=t.getActiveAttrib(p,o),u&&c(b,new s(u.name,n.id(u.name),t.getAttribLocation(p,u.name),u))}i.profile&&(r.getMaxUniformsCount=function(){var e=0;return d.forEach(function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)}),e},r.getMaxAttributesCount=function(){var e=0;return d.forEach(function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)}),e});function h(){a={},o={};for(var e=0;e<d.length;++e)m(d[e],null,d[e].attributes.map(function(e){return[e.location,e.name]}))}return{clear:function(){var e=t.deleteShader.bind(t);we(a).forEach(e),a={},we(o).forEach(e),o={},d.forEach(function(e){t.deleteProgram(e.program)}),d.length=0,u={},r.shaderCount=0},program:function(n,i,s,c){var l=u[i];l||=u[i]={};var f=l[n];if(f&&(f.refCount++,!c))return f;var h=new p(i,n);return r.shaderCount++,m(h,s,c),f||(l[n]=h),d.push(h),e(h,{destroy:function(){if(h.refCount--,h.refCount<=0){t.deleteProgram(h.program);var e=d.indexOf(h);d.splice(e,1),r.shaderCount--}l[h.vertId].refCount<=0&&(t.deleteShader(o[h.vertId]),delete o[h.vertId],delete u[h.fragId][h.vertId]),Object.keys(u[h.fragId]).length||(t.deleteShader(a[h.fragId]),delete a[h.fragId],delete u[h.fragId])}})},restore:h,shader:l,frag:-1,vert:-1}}var Pr=6408,Fr=5121,Ir=3333,Lr=5126;function Rr(e,t,n,r,i,a,o){function s(i){var a=t.next===null?Fr:t.next.colorAttachments[0].texture._texture.type,o=0,s=0,c=r.framebufferWidth,l=r.framebufferHeight,u=null;Se(i)?u=i:i&&(o=i.x|0,s=i.y|0,c=(i.width||r.framebufferWidth-o)|0,l=(i.height||r.framebufferHeight-s)|0,u=i.data||null),n();var d=c*l*4;return u||(a===Fr?u=new Uint8Array(d):a===Lr&&(u||=new Float32Array(d))),e.pixelStorei(Ir,4),e.readPixels(o,s,c,l,Pr,a,u),u}function c(e){var n;return t.setFBO({framebuffer:e.framebuffer},function(){n=s(e)}),n}function l(e){return!e||!(`framebuffer`in e)?s(e):c(e)}return l}var zr=0;function Br(e){return Hr(Vr(Ur(e)))}function Vr(e){return Gr(ti(Wr(e),e.length*8))}function Hr(e){for(var t=zr?`0123456789ABCDEF`:`0123456789abcdef`,n=``,r,i=0;i<e.length;i++)r=e.charCodeAt(i),n+=t.charAt(r>>>4&15)+t.charAt(r&15);return n}function Ur(e){for(var t=``,n=-1,r,i;++n<e.length;)r=e.charCodeAt(n),i=n+1<e.length?e.charCodeAt(n+1):0,55296<=r&&r<=56319&&56320<=i&&i<=57343&&(r=65536+((r&1023)<<10)+(i&1023),n++),r<=127?t+=String.fromCharCode(r):r<=2047?t+=String.fromCharCode(192|r>>>6&31,128|r&63):r<=65535?t+=String.fromCharCode(224|r>>>12&15,128|r>>>6&63,128|r&63):r<=2097151&&(t+=String.fromCharCode(240|r>>>18&7,128|r>>>12&63,128|r>>>6&63,128|r&63));return t}function Wr(e){for(var t=Array(e.length>>2),n=0;n<t.length;n++)t[n]=0;for(var n=0;n<e.length*8;n+=8)t[n>>5]|=(e.charCodeAt(n/8)&255)<<24-n%32;return t}function Gr(e){for(var t=``,n=0;n<e.length*32;n+=8)t+=String.fromCharCode(e[n>>5]>>>24-n%32&255);return t}function Kr(e,t){return e>>>t|e<<32-t}function qr(e,t){return e>>>t}function Jr(e,t,n){return e&t^~e&n}function Yr(e,t,n){return e&t^e&n^t&n}function Xr(e){return Kr(e,2)^Kr(e,13)^Kr(e,22)}function Zr(e){return Kr(e,6)^Kr(e,11)^Kr(e,25)}function Qr(e){return Kr(e,7)^Kr(e,18)^qr(e,3)}function $r(e){return Kr(e,17)^Kr(e,19)^qr(e,10)}var ei=[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 ti(e,t){var n=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),i,a,o,s,c,l,u,d,f,p,m,h;for(e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t,f=0;f<e.length;f+=16){for(i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],u=n[6],d=n[7],p=0;p<64;p++)p<16?r[p]=e[p+f]:r[p]=ni(ni(ni($r(r[p-2]),r[p-7]),Qr(r[p-15])),r[p-16]),m=ni(ni(ni(ni(d,Zr(c)),Jr(c,l,u)),ei[p]),r[p]),h=ni(Xr(i),Yr(i,a,o)),d=u,u=l,l=c,c=ni(s,m),s=o,o=a,a=i,i=ni(m,h);n[0]=ni(i,n[0]),n[1]=ni(a,n[1]),n[2]=ni(o,n[2]),n[3]=ni(s,n[3]),n[4]=ni(c,n[4]),n[5]=ni(l,n[5]),n[6]=ni(u,n[6]),n[7]=ni(d,n[7])}return n}function ni(e,t){var n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function ri(e){return Array.prototype.slice.call(e)}function ii(e){return ri(e).join(``)}function ai(t){var n=t&&t.cache,r=0,i=[],a=[],o=[];function s(e,t){var n=t&&t.stable;if(!n){for(var s=0;s<a.length;++s)if(a[s]===e&&!o[s])return i[s]}var c=`g`+ r++;return i.push(c),a.push(e),o.push(n),c}function c(){var t=[];function n(){t.push.apply(t,ri(arguments))}var i=[];function a(){var e=`v`+ r++;return i.push(e),arguments.length>0&&(t.push(e,`=`),t.push.apply(t,ri(arguments)),t.push(`;`)),e}return e(n,{def:a,toString:function(){return ii([i.length>0?`var `+i.join(`,`)+`;`:``,ii(t)])}})}function l(){var t=c(),n=c(),r=t.toString,i=n.toString;function a(e,r){n(e,r,`=`,t.def(e,r),`;`)}return e(function(){t.apply(t,ri(arguments))},{def:t.def,entry:t,exit:n,save:a,set:function(e,n,r){a(e,n),t(e,n,`=`,r,`;`)},toString:function(){return r()+i()}})}function u(){var t=ii(arguments),n=l(),r=l(),i=n.toString,a=r.toString;return e(n,{then:function(){return n.apply(n,ri(arguments)),this},else:function(){return r.apply(r,ri(arguments)),this},toString:function(){var e=a();return e&&=`else{`+e+`}`,ii([`if(`,t,`){`,i(),`}`,e])}})}var d=c(),f={};function p(t,n){var r=[];function i(){var e=`a`+r.length;return r.push(e),e}n||=0;for(var a=0;a<n;++a)i();var o=l(),s=o.toString;return f[t]=e(o,{arg:i,toString:function(){return ii([`function(`,r.join(),`){`,s(),`}`])}})}function m(){var e=[`"use strict";`,d,`return {`];Object.keys(f).forEach(function(t){e.push(`"`,t,`":`,f[t].toString(),`,`)}),e.push(`}`);var t=ii(e).replace(/;/g,`;
`).replace(/}/g,`}
`).replace(/{/g,`{
`),r;if(n&&(r=Br(t),n[r]))return n[r].apply(null,a);var o=Function.apply(null,i.concat(t));return n&&(n[r]=o),o.apply(null,a)}return{global:d,link:s,block:c,proc:p,scope:l,cond:u,compile:m}}var oi=`xyzw`.split(``),si=5121,ci=1,li=2,ui=0,di=1,fi=2,pi=3,mi=4,hi=5,gi=6,_i=`dither`,vi=`blend.enable`,yi=`blend.color`,bi=`blend.equation`,xi=`blend.func`,Si=`depth.enable`,Ci=`depth.func`,wi=`depth.range`,Ti=`depth.mask`,Ei=`colorMask`,Di=`cull.enable`,Oi=`cull.face`,ki=`frontFace`,Ai=`lineWidth`,ji=`polygonOffset.enable`,Mi=`polygonOffset.offset`,Ni=`sample.alpha`,Pi=`sample.enable`,Fi=`sample.coverage`,Ii=`stencil.enable`,Li=`stencil.mask`,Ri=`stencil.func`,zi=`stencil.opFront`,Bi=`stencil.opBack`,Vi=`scissor.enable`,Hi=`scissor.box`,Ui=`viewport`,Wi=`profile`,Gi=`framebuffer`,Ki=`vert`,qi=`frag`,Ji=`elements`,Yi=`primitive`,Xi=`count`,Zi=`offset`,Qi=`instances`,$i=`vao`,ea=`Width`,ta=`Height`,na=Gi+ea,ra=Gi+ta,ia=Ui+ea,aa=Ui+ta,oa=`drawingBuffer`,sa=oa+ea,ca=oa+ta,la=[xi,bi,Ri,zi,Bi,Fi,Ui,Hi,Mi],ua=34962,da=34963,fa=2884,pa=3042,ma=3024,ha=2960,ga=2929,_a=3089,va=32823,ya=32926,ba=32928,xa=5126,Sa=35664,Ca=35665,wa=35666,Ta=5124,Ea=35667,Da=35668,Oa=35669,ka=35670,Aa=35671,ja=35672,Ma=35673,Na=35674,Pa=35675,Fa=35676,Ia=35678,La=35680,Ra=4,za=1028,Ba=1029,Va=2304,Ha=2305,Ua=32775,Wa=32776,Ga=519,Ka=7680,qa=0,Ja=1,Ya=32774,Xa=513,Za=36160,Qa=36064,$a={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},eo={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},to={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},no={cw:Va,ccw:Ha};function ro(e){return Array.isArray(e)||Se(e)||Ce(e)}function io(e){return e.sort(function(e,t){return e===Ui?-1:t===Ui?1:e<t?-1:1})}function ao(e,t,n,r){this.thisDep=e,this.contextDep=t,this.propDep=n,this.append=r}function oo(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function so(e){return new ao(!1,!1,!1,e)}function co(e,t){var n=e.type;if(n===ui){var r=e.data.length;return new ao(!0,r>=1,r>=2,t)}else if(n===mi){var i=e.data;return new ao(i.thisDep,i.contextDep,i.propDep,t)}else{if(n===hi)return new ao(!1,!1,!1,t);if(n===gi){for(var a=!1,o=!1,s=!1,c=0;c<e.data.length;++c){var l=e.data[c];if(l.type===di)s=!0;else if(l.type===fi)o=!0;else if(l.type===pi)a=!0;else if(l.type===ui){a=!0;var u=l.data;u>=1&&(o=!0),u>=2&&(s=!0)}else l.type===mi&&(a||=l.data.thisDep,o||=l.data.contextDep,s||=l.data.propDep)}return new ao(a,o,s,t)}else return new ao(n===pi,n===fi,n===di,t)}}var lo=new ao(!1,!1,!1,function(){});function uo(t,n,r,i,a,o,s,c,l,u,d,p,m,h,g,_){var v=u.Record,y={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(y.min=Ua,y.max=Wa);var b=r.angle_instanced_arrays,x=r.webgl_draw_buffers,S=r.oes_vertex_array_object,C={dirty:!0,profile:_.profile},T={},E=[],D={},O={};function k(e){return e.replace(`.`,`_`)}function A(e,t,n){var r=k(e);E.push(e),T[r]=C[r]=!!n,D[r]=t}function j(e,t,n){var r=k(e);E.push(e),Array.isArray(n)?(C[r]=n.slice(),T[r]=n.slice()):C[r]=T[r]=n,O[r]=t}function M(e){return!!isNaN(e)}A(_i,ma),A(vi,pa),j(yi,`blendColor`,[0,0,0,0]),j(bi,`blendEquationSeparate`,[Ya,Ya]),j(xi,`blendFuncSeparate`,[Ja,qa,Ja,qa]),A(Si,ga,!0),j(Ci,`depthFunc`,Xa),j(wi,`depthRange`,[0,1]),j(Ti,`depthMask`,!0),j(Ei,Ei,[!0,!0,!0,!0]),A(Di,fa),j(Oi,`cullFace`,Ba),j(ki,ki,Ha),j(Ai,Ai,1),A(ji,va),j(Mi,`polygonOffset`,[0,0]),A(Ni,ya),A(Pi,ba),j(Fi,`sampleCoverage`,[1,!1]),A(Ii,ha),j(Li,`stencilMask`,-1),j(Ri,`stencilFunc`,[Ga,0,-1]),j(zi,`stencilOpSeparate`,[za,Ka,Ka,Ka]),j(Bi,`stencilOpSeparate`,[Ba,Ka,Ka,Ka]),A(Vi,_a),j(Hi,`scissor`,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),j(Ui,Ui,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var N={gl:t,context:m,strings:n,next:T,current:C,draw:p,elements:o,buffer:a,shader:d,attributes:u.state,vao:u,uniforms:l,framebuffer:c,extensions:r,timer:h,isBufferArgs:ro},P={primTypes:Ke,compareFuncs:eo,blendFuncs:$a,blendEquations:y,stencilOps:to,glTypes:Ne,orientationType:no};x&&(P.backBuffer=[Ba],P.drawBuffer=w(i.maxDrawbuffers,function(e){return e===0?[0]:w(e,function(e){return Qa+e})}));var F=0;function I(){var e=ai({cache:g}),t=e.link,r=e.global;e.id=F++,e.batchId=`0`;var i=t(N),a=e.shared={props:`a0`};Object.keys(N).forEach(function(e){a[e]=r.def(i,`.`,e)});var o=e.next={},s=e.current={};Object.keys(O).forEach(function(e){Array.isArray(C[e])&&(o[e]=r.def(a.next,`.`,e),s[e]=r.def(a.current,`.`,e))});var c=e.constants={};Object.keys(P).forEach(function(e){c[e]=r.def(JSON.stringify(P[e]))}),e.invoke=function(n,r){switch(r.type){case ui:var i=[`this`,a.context,a.props,e.batchId];return n.def(t(r.data),`.call(`,i.slice(0,Math.max(r.data.length+1,4)),`)`);case di:return n.def(a.props,r.data);case fi:return n.def(a.context,r.data);case pi:return n.def(`this`,r.data);case mi:return r.data.append(e,n),r.data.ref;case hi:return r.data.toString();case gi:return r.data.map(function(t){return e.invoke(n,t)})}},e.attribCache={};var l={};return e.scopeAttrib=function(e){var r=n.id(e);if(r in l)return l[r];var i=u.scope[r];return i||=u.scope[r]=new v,l[r]=t(i)},e}function L(e){var t=e.static,n=e.dynamic,r;if(Wi in t){var i=!!t[Wi];r=so(function(e,t){return i}),r.enable=i}else if(Wi in n){var a=n[Wi];r=co(a,function(e,t){return e.invoke(t,a)})}return r}function R(e,t){var n=e.static,r=e.dynamic;if(Gi in n){var i=n[Gi];return i?(i=c.getFramebuffer(i),so(function(e,t){var n=e.link(i),r=e.shared;t.set(r.framebuffer,`.next`,n);var a=r.context;return t.set(a,`.`+na,n+`.width`),t.set(a,`.`+ra,n+`.height`),n})):so(function(e,t){var n=e.shared;t.set(n.framebuffer,`.next`,`null`);var r=n.context;return t.set(r,`.`+na,r+`.`+sa),t.set(r,`.`+ra,r+`.`+ca),`null`})}else if(Gi in r){var a=r[Gi];return co(a,function(e,t){var n=e.invoke(t,a),r=e.shared,i=r.framebuffer,o=t.def(i,`.getFramebuffer(`,n,`)`);t.set(i,`.next`,o);var s=r.context;return t.set(s,`.`+na,o+`?`+o+`.width:`+s+`.`+sa),t.set(s,`.`+ra,o+`?`+o+`.height:`+s+`.`+ca),o})}else return null}function z(e,t,n){var r=e.static,i=e.dynamic;function a(e){if(e in r){var n=r[e],a=!0,o=n.x|0,s=n.y|0,c,l;return`width`in n?c=n.width|0:a=!1,`height`in n?l=n.height|0:a=!1,new ao(!a&&t&&t.thisDep,!a&&t&&t.contextDep,!a&&t&&t.propDep,function(e,t){var r=e.shared.context,i=c;`width`in n||(i=t.def(r,`.`,na,`-`,o));var a=l;return`height`in n||(a=t.def(r,`.`,ra,`-`,s)),[o,s,i,a]})}else if(e in i){var u=i[e],d=co(u,function(e,t){var n=e.invoke(t,u),r=e.shared.context,i=t.def(n,`.x|0`),a=t.def(n,`.y|0`);return[i,a,t.def(`"width" in `,n,`?`,n,`.width|0:`,`(`,r,`.`,na,`-`,i,`)`),t.def(`"height" in `,n,`?`,n,`.height|0:`,`(`,r,`.`,ra,`-`,a,`)`)]});return t&&(d.thisDep=d.thisDep||t.thisDep,d.contextDep=d.contextDep||t.contextDep,d.propDep=d.propDep||t.propDep),d}else return t?new ao(t.thisDep,t.contextDep,t.propDep,function(e,t){var n=e.shared.context;return[0,0,t.def(n,`.`,na),t.def(n,`.`,ra)]}):null}var o=a(Ui);if(o){var s=o;o=new ao(o.thisDep,o.contextDep,o.propDep,function(e,t){var n=s.append(e,t),r=e.shared.context;return t.set(r,`.`+ia,n[2]),t.set(r,`.`+aa,n[3]),n})}return{viewport:o,scissor_box:a(Hi)}}function B(e,t){var n=e.static;if(typeof n[qi]==`string`&&typeof n[Ki]==`string`){if(Object.keys(t.dynamic).length>0)return null;var r=t.static,i=Object.keys(r);if(i.length>0&&typeof r[i[0]]==`number`){for(var a=[],o=0;o<i.length;++o)a.push([r[i[o]]|0,i[o]]);return a}}return null}function V(e,t,r){var i=e.static,a=e.dynamic;function o(e){if(e in i){var t=n.id(i[e]),r=so(function(){return t});return r.id=t,r}else if(e in a){var o=a[e];return co(o,function(e,t){var n=e.invoke(t,o);return t.def(e.shared.strings,`.id(`,n,`)`)})}return null}var s=o(qi),c=o(Ki),l=null,u;return oo(s)&&oo(c)?(l=d.program(c.id,s.id,null,r),u=so(function(e,t){return e.link(l)})):u=new ao(s&&s.thisDep||c&&c.thisDep,s&&s.contextDep||c&&c.contextDep,s&&s.propDep||c&&c.propDep,function(e,t){var n=e.shared.shader,r=s?s.append(e,t):t.def(n,`.`,qi),i=c?c.append(e,t):t.def(n,`.`,Ki),a=n+`.program(`+i+`,`+r;return t.def(a+`)`)}),{frag:s,vert:c,progVar:u,program:l}}function H(e,t){var n=e.static,r=e.dynamic,i={},a=!1;function s(){if($i in n){var e=n[$i];return e!==null&&u.getVAO(e)===null&&(e=u.createVAO(e)),a=!0,i.vao=e,so(function(t){var n=u.getVAO(e);return n?t.link(n):`null`})}else if($i in r){a=!0;var t=r[$i];return co(t,function(e,n){var r=e.invoke(n,t);return n.def(e.shared.vao+`.getVAO(`+r+`)`)})}return null}var c=s(),l=!1;function d(){if(Ji in n){var e=n[Ji];if(i.elements=e,ro(e)){var t=i.elements=o.create(e,!0);e=o.getElements(t),l=!0}else e&&(e=o.getElements(e),l=!0);var s=so(function(t,n){if(e){var r=t.link(e);return t.ELEMENTS=r,r}return t.ELEMENTS=null,null});return s.value=e,s}else if(Ji in r){l=!0;var u=r[Ji];return co(u,function(e,t){var n=e.shared,r=n.isBufferArgs,i=n.elements,a=e.invoke(t,u),o=t.def(`null`),s=t.def(r,`(`,a,`)`),c=e.cond(s).then(o,`=`,i,`.createStream(`,a,`);`).else(o,`=`,i,`.getElements(`,a,`);`);return t.entry(c),t.exit(e.cond(s).then(i,`.destroyStream(`,o,`);`)),e.ELEMENTS=o,o})}else if(a)return new ao(c.thisDep,c.contextDep,c.propDep,function(e,t){return t.def(e.shared.vao+`.currentVAO?`+e.shared.elements+`.getElements(`+e.shared.vao+`.currentVAO.elements):null`)});return null}var f=d();function p(){if(Yi in n){var e=n[Yi];return i.primitive=e,so(function(t,n){return Ke[e]})}else if(Yi in r){var t=r[Yi];return co(t,function(e,n){var r=e.constants.primTypes,i=e.invoke(n,t);return n.def(r,`[`,i,`]`)})}else{if(l)return oo(f)?f.value?so(function(e,t){return t.def(e.ELEMENTS,`.primType`)}):so(function(){return Ra}):new ao(f.thisDep,f.contextDep,f.propDep,function(e,t){var n=e.ELEMENTS;return t.def(n,`?`,n,`.primType:`,Ra)});if(a)return new ao(c.thisDep,c.contextDep,c.propDep,function(e,t){return t.def(e.shared.vao+`.currentVAO?`+e.shared.vao+`.currentVAO.primitive:`+Ra)})}return null}function m(e,t){if(e in n){var o=n[e]|0;return t?i.offset=o:i.instances=o,so(function(e,n){return t&&(e.OFFSET=o),o})}else if(e in r){var s=r[e];return co(s,function(e,n){var r=e.invoke(n,s);return t&&(e.OFFSET=r),r})}else if(t){if(l)return so(function(e,t){return e.OFFSET=0,0});if(a)return new ao(c.thisDep,c.contextDep,c.propDep,function(e,t){return t.def(e.shared.vao+`.currentVAO?`+e.shared.vao+`.currentVAO.offset:0`)})}else if(a)return new ao(c.thisDep,c.contextDep,c.propDep,function(e,t){return t.def(e.shared.vao+`.currentVAO?`+e.shared.vao+`.currentVAO.instances:-1`)});return null}var h=m(Zi,!0);function g(){if(Xi in n){var e=n[Xi]|0;return i.count=e,so(function(){return e})}else if(Xi in r){var t=r[Xi];return co(t,function(e,n){return e.invoke(n,t)})}else if(l)return oo(f)?f?h?new ao(h.thisDep,h.contextDep,h.propDep,function(e,t){return t.def(e.ELEMENTS,`.vertCount-`,e.OFFSET)}):so(function(e,t){return t.def(e.ELEMENTS,`.vertCount`)}):so(function(){return-1}):new ao(f.thisDep||h.thisDep,f.contextDep||h.contextDep,f.propDep||h.propDep,function(e,t){var n=e.ELEMENTS;return e.OFFSET?t.def(n,`?`,n,`.vertCount-`,e.OFFSET,`:-1`):t.def(n,`?`,n,`.vertCount:-1`)});else if(a)return new ao(c.thisDep,c.contextDep,c.propDep,function(e,t){return t.def(e.shared.vao,`.currentVAO?`,e.shared.vao,`.currentVAO.count:-1`)});return null}return{elements:f,primitive:p(),count:g(),instances:m(Qi,!1),offset:h,vao:c,vaoActive:a,elementsActive:l,static:i}}function U(e,t){var n=e.static,r=e.dynamic,i={};return E.forEach(function(e){var t=k(e);function a(a,o){if(e in n){var s=a(n[e]);i[t]=so(function(){return s})}else if(e in r){var c=r[e];i[t]=co(c,function(e,t){return o(e,t,e.invoke(t,c))})}}switch(e){case Di:case vi:case _i:case Ii:case Si:case Vi:case ji:case Ni:case Pi:case Ti:return a(function(e){return e},function(e,t,n){return n});case Ci:return a(function(e){return eo[e]},function(e,t,n){var r=e.constants.compareFuncs;return t.def(r,`[`,n,`]`)});case wi:return a(function(e){return e},function(e,t,n){return[t.def(`+`,n,`[0]`),t.def(`+`,n,`[1]`)]});case xi:return a(function(e){var t=`srcRGB`in e?e.srcRGB:e.src,n=`srcAlpha`in e?e.srcAlpha:e.src,r=`dstRGB`in e?e.dstRGB:e.dst,i=`dstAlpha`in e?e.dstAlpha:e.dst;return[$a[t],$a[r],$a[n],$a[i]]},function(e,t,n){var r=e.constants.blendFuncs;function i(e,r){return t.def(`"`,e,r,`" in `,n,`?`,n,`.`,e,r,`:`,n,`.`,e)}var a=i(`src`,`RGB`),o=i(`dst`,`RGB`),s=t.def(r,`[`,a,`]`),c=t.def(r,`[`,i(`src`,`Alpha`),`]`);return[s,t.def(r,`[`,o,`]`),c,t.def(r,`[`,i(`dst`,`Alpha`),`]`)]});case bi:return a(function(e){if(typeof e==`string`)return[y[e],y[e]];if(typeof e==`object`)return[y[e.rgb],y[e.alpha]]},function(e,t,n){var r=e.constants.blendEquations,i=t.def(),a=t.def(),o=e.cond(`typeof `,n,`==="string"`);return o.then(i,`=`,a,`=`,r,`[`,n,`];`),o.else(i,`=`,r,`[`,n,`.rgb];`,a,`=`,r,`[`,n,`.alpha];`),t(o),[i,a]});case yi:return a(function(e){return w(4,function(t){return+e[t]})},function(e,t,n){return w(4,function(e){return t.def(`+`,n,`[`,e,`]`)})});case Li:return a(function(e){return e|0},function(e,t,n){return t.def(n,`|0`)});case Ri:return a(function(e){var t=e.cmp||`keep`,n=e.ref||0,r=`mask`in e?e.mask:-1;return[eo[t],n,r]},function(e,t,n){var r=e.constants.compareFuncs;return[t.def(`"cmp" in `,n,`?`,r,`[`,n,`.cmp]`,`:`,Ka),t.def(n,`.ref|0`),t.def(`"mask" in `,n,`?`,n,`.mask|0:-1`)]});case zi:case Bi:return a(function(t){var n=t.fail||`keep`,r=t.zfail||`keep`,i=t.zpass||`keep`;return[e===Bi?Ba:za,to[n],to[r],to[i]]},function(t,n,r){var i=t.constants.stencilOps;function a(e){return n.def(`"`,e,`" in `,r,`?`,i,`[`,r,`.`,e,`]:`,Ka)}return[e===Bi?Ba:za,a(`fail`),a(`zfail`),a(`zpass`)]});case Mi:return a(function(e){return[e.factor|0,e.units|0]},function(e,t,n){return[t.def(n,`.factor|0`),t.def(n,`.units|0`)]});case Oi:return a(function(e){var t=0;return e===`front`?t=za:e===`back`&&(t=Ba),t},function(e,t,n){return t.def(n,`==="front"?`,za,`:`,Ba)});case Ai:return a(function(e){return e},function(e,t,n){return n});case ki:return a(function(e){return no[e]},function(e,t,n){return t.def(n+`==="cw"?`+Va+`:`+Ha)});case Ei:return a(function(e){return e.map(function(e){return!!e})},function(e,t,n){return w(4,function(e){return`!!`+n+`[`+e+`]`})});case Fi:return a(function(e){return[`value`in e?e.value:1,!!e.invert]},function(e,t,n){return[t.def(`"value" in `,n,`?+`,n,`.value:1`),t.def(`!!`,n,`.invert`)]})}}),i}function W(e,t){var n=e.static,r=e.dynamic,i={};return Object.keys(n).forEach(function(e){var t=n[e],r;if(typeof t==`number`||typeof t==`boolean`)r=so(function(){return t});else if(typeof t==`function`){var a=t._reglType;a===`texture2d`||a===`textureCube`?r=so(function(e){return e.link(t)}):(a===`framebuffer`||a===`framebufferCube`)&&(r=so(function(e){return e.link(t.color[0])}))}else ut(t)&&(r=so(function(e){return e.global.def(`[`,w(t.length,function(e){return t[e]}),`]`)}));r.value=t,i[e]=r}),Object.keys(r).forEach(function(e){var t=r[e];i[e]=co(t,function(e,n){return e.invoke(n,t)})}),i}function G(e,t){var r=e.static,i=e.dynamic,o={};return Object.keys(r).forEach(function(e){var t=r[e],i=n.id(e),s=new v;if(ro(t))s.state=ci,s.buffer=a.getBuffer(a.create(t,ua,!1,!0)),s.type=0;else{var c=a.getBuffer(t);if(c)s.state=ci,s.buffer=c,s.type=0;else if(`constant`in t){var l=t.constant;s.buffer=`null`,s.state=li,typeof l==`number`?s.x=l:oi.forEach(function(e,t){t<l.length&&(s[e]=l[t])})}else{c=ro(t.buffer)?a.getBuffer(a.create(t.buffer,ua,!1,!0)):a.getBuffer(t.buffer);var u=t.offset|0,d=t.stride|0,f=t.size|0,p=!!t.normalized,m=0;`type`in t&&(m=Ne[t.type]);var h=t.divisor|0;s.buffer=c,s.state=ci,s.size=f,s.normalized=p,s.type=m||c.dtype,s.offset=u,s.stride=d,s.divisor=h}}o[e]=so(function(e,t){var n=e.attribCache;if(i in n)return n[i];var r={isStream:!1};return Object.keys(s).forEach(function(e){r[e]=s[e]}),s.buffer&&(r.buffer=e.link(s.buffer),r.type=r.type||r.buffer+`.dtype`),n[i]=r,r})}),Object.keys(i).forEach(function(e){var t=i[e];function n(e,n){var r=e.invoke(n,t),i=e.shared,a=e.constants,o=i.isBufferArgs,s=i.buffer,c={isStream:n.def(!1)},l=new v;l.state=ci,Object.keys(l).forEach(function(e){c[e]=n.def(``+l[e])});var u=c.buffer,d=c.type;n(`if(`,o,`(`,r,`)){`,c.isStream,`=true;`,u,`=`,s,`.createStream(`,ua,`,`,r,`);`,d,`=`,u,`.dtype;`,`}else{`,u,`=`,s,`.getBuffer(`,r,`);`,`if(`,u,`){`,d,`=`,u,`.dtype;`,`}else if("constant" in `,r,`){`,c.state,`=`,li,`;`,`if(typeof `+r+`.constant === "number"){`,c[oi[0]],`=`,r,`.constant;`,oi.slice(1).map(function(e){return c[e]}).join(`=`),`=0;`,`}else{`,oi.map(function(e,t){return c[e]+`=`+r+`.constant.length>`+t+`?`+r+`.constant[`+t+`]:0;`}).join(``),`}}else{`,`if(`,o,`(`,r,`.buffer)){`,u,`=`,s,`.createStream(`,ua,`,`,r,`.buffer);`,`}else{`,u,`=`,s,`.getBuffer(`,r,`.buffer);`,`}`,d,`="type" in `,r,`?`,a.glTypes,`[`,r,`.type]:`,u,`.dtype;`,c.normalized,`=!!`,r,`.normalized;`);function f(e){n(c[e],`=`,r,`.`,e,`|0;`)}return f(`size`),f(`offset`),f(`stride`),f(`divisor`),n(`}}`),n.exit(`if(`,c.isStream,`){`,s,`.destroyStream(`,u,`);`,`}`),c}o[e]=co(t,n)}),o}function K(e){var t=e.static,n=e.dynamic,r={};return Object.keys(t).forEach(function(e){var n=t[e];r[e]=so(function(e,t){return typeof n==`number`||typeof n==`boolean`?``+n:e.link(n)})}),Object.keys(n).forEach(function(e){var t=n[e];r[e]=co(t,function(e,n){return e.invoke(n,t)})}),r}function q(e,t,n,i,a){e.static,e.dynamic;var o=B(e,t),s=R(e,a),c=z(e,s,a),l=H(e,a),d=U(e,a),f=V(e,a,o);function p(e){var t=c[e];t&&(d[e]=t)}p(Ui),p(k(Hi));var m={framebuffer:s,draw:l,shader:f,state:d,dirty:Object.keys(d).length>0,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(m.profile=L(e,a),m.uniforms=W(n,a),m.drawVAO=m.scopeVAO=l.vao,!m.drawVAO&&f.program&&!o&&r.angle_instanced_arrays&&l.static.elements){var h=!0,g=f.program.attributes.map(function(e){var n=t.static[e];return h&&=!!n,n});if(h&&g.length>0){var _=u.getVAO(u.createVAO({attributes:g,elements:l.static.elements}));m.drawVAO=new ao(null,null,null,function(e,t){return e.link(_)}),m.useVAO=!0}}return o?m.useVAO=!0:m.attributes=G(t,a),m.context=K(i,a),m}function J(e,t,n){var r=e.shared.context,i=e.scope();Object.keys(n).forEach(function(a){t.save(r,`.`+a);var o=n[a].append(e,t);Array.isArray(o)?i(r,`.`,a,`=[`,o.join(),`];`):i(r,`.`,a,`=`,o,`;`)}),t(i)}function Y(e,t,n,r){var i=e.shared,a=i.gl,o=i.framebuffer,s;x&&(s=t.def(i.extensions,`.webgl_draw_buffers`));var c=e.constants,l=c.drawBuffer,u=c.backBuffer,d=n?n.append(e,t):t.def(o,`.next`);r||t(`if(`,d,`!==`,o,`.cur){`),t(`if(`,d,`){`,a,`.bindFramebuffer(`,Za,`,`,d,`.framebuffer);`),x&&t(s,`.drawBuffersWEBGL(`,l,`[`,d,`.colorAttachments.length]);`),t(`}else{`,a,`.bindFramebuffer(`,Za,`,null);`),x&&t(s,`.drawBuffersWEBGL(`,u,`);`),t(`}`,o,`.cur=`,d,`;`),r||t(`}`)}function X(e,t,n){var r=e.shared,i=r.gl,a=e.current,o=e.next,s=r.current,c=r.next,l=e.cond(s,`.dirty`);E.forEach(function(t){var r=k(t);if(!(r in n.state)){var u,d;if(r in o){u=o[r],d=a[r];var f=w(C[r].length,function(e){return l.def(u,`[`,e,`]`)});l(e.cond(f.map(function(e,t){return e+`!==`+d+`[`+t+`]`}).join(`||`)).then(i,`.`,O[r],`(`,f,`);`,f.map(function(e,t){return d+`[`+t+`]=`+e}).join(`;`),`;`))}else{u=l.def(c,`.`,r);var p=e.cond(u,`!==`,s,`.`,r);l(p),r in D?p(e.cond(u).then(i,`.enable(`,D[r],`);`).else(i,`.disable(`,D[r],`);`),s,`.`,r,`=`,u,`;`):p(i,`.`,O[r],`(`,u,`);`,s,`.`,r,`=`,u,`;`)}}}),Object.keys(n.state).length===0&&l(s,`.dirty=false;`),t(l)}function Z(e,t,n,r){var i=e.shared,a=e.current,o=i.current,s=i.gl,c;io(Object.keys(n)).forEach(function(i){var l=n[i];if(!(r&&!r(l))){var u=l.append(e,t);if(D[i]){var d=D[i];oo(l)?(c=e.link(u,{stable:!0}),t(e.cond(c).then(s,`.enable(`,d,`);`).else(s,`.disable(`,d,`);`)),t(o,`.`,i,`=`,c,`;`)):(t(e.cond(u).then(s,`.enable(`,d,`);`).else(s,`.disable(`,d,`);`)),t(o,`.`,i,`=`,u,`;`))}else if(ut(u)){var f=a[i];t(s,`.`,O[i],`(`,u,`);`,u.map(function(e,t){return f+`[`+t+`]=`+e}).join(`;`),`;`)}else oo(l)?(c=e.link(u,{stable:!0}),t(s,`.`,O[i],`(`,c,`);`,o,`.`,i,`=`,c,`;`)):t(s,`.`,O[i],`(`,u,`);`,o,`.`,i,`=`,u,`;`)}})}function Q(e,t){b&&(e.instancing=t.def(e.shared.extensions,`.angle_instanced_arrays`))}function ee(e,t,n,r,i){var a=e.shared,o=e.stats,s=a.current,c=a.timer,l=n.profile;function u(){return typeof performance>`u`?`Date.now()`:`performance.now()`}var d,f;function p(e){d=t.def(),e(d,`=`,u(),`;`),typeof i==`string`?e(o,`.count+=`,i,`;`):e(o,`.count++;`),h&&(r?(f=t.def(),e(f,`=`,c,`.getNumPendingQueries();`)):e(c,`.beginQuery(`,o,`);`))}function m(e){e(o,`.cpuTime+=`,u(),`-`,d,`;`),h&&(r?e(c,`.pushScopeStats(`,f,`,`,c,`.getNumPendingQueries(),`,o,`);`):e(c,`.endQuery();`))}function g(e){var n=t.def(s,`.profile`);t(s,`.profile=`,e,`;`),t.exit(s,`.profile=`,n,`;`)}var _;if(l){if(oo(l)){l.enable?(p(t),m(t.exit),g(`true`)):g(`false`);return}_=l.append(e,t),g(_)}else _=t.def(s,`.profile`);var v=e.block();p(v),t(`if(`,_,`){`,v,`}`);var y=e.block();m(y),t.exit(`if(`,_,`){`,y,`}`)}function te(e,t,n,r,i){var a=e.shared;function o(e){switch(e){case Sa:case Ea:case Aa:return 2;case Ca:case Da:case ja:return 3;case wa:case Oa:case Ma:return 4;default:return 1}}function s(n,r,i){var o=a.gl,s=t.def(n,`.location`),c=t.def(a.attributes,`[`,s,`]`),l=i.state,u=i.buffer,d=[i.x,i.y,i.z,i.w],f=[`buffer`,`normalized`,`offset`,`stride`];function p(){t(`if(!`,c,`.buffer){`,o,`.enableVertexAttribArray(`,s,`);}`);var n=i.type,a;if(a=i.size?t.def(i.size,`||`,r):r,t(`if(`,c,`.type!==`,n,`||`,c,`.size!==`,a,`||`,f.map(function(e){return c+`.`+e+`!==`+i[e]}).join(`||`),`){`,o,`.bindBuffer(`,ua,`,`,u,`.buffer);`,o,`.vertexAttribPointer(`,[s,a,n,i.normalized,i.stride,i.offset],`);`,c,`.type=`,n,`;`,c,`.size=`,a,`;`,f.map(function(e){return c+`.`+e+`=`+i[e]+`;`}).join(``),`}`),b){var l=i.divisor;t(`if(`,c,`.divisor!==`,l,`){`,e.instancing,`.vertexAttribDivisorANGLE(`,[s,l],`);`,c,`.divisor=`,l,`;}`)}}function m(){t(`if(`,c,`.buffer){`,o,`.disableVertexAttribArray(`,s,`);`,c,`.buffer=null;`,`}if(`,oi.map(function(e,t){return c+`.`+e+`!==`+d[t]}).join(`||`),`){`,o,`.vertexAttrib4f(`,s,`,`,d,`);`,oi.map(function(e,t){return c+`.`+e+`=`+d[t]+`;`}).join(``),`}`)}l===ci?p():l===li?m():(t(`if(`,l,`===`,ci,`){`),p(),t(`}else{`),m(),t(`}`))}r.forEach(function(r){var a=r.name,c=n.attributes[a],l;if(c){if(!i(c))return;l=c.append(e,t)}else{if(!i(lo))return;var u=e.scopeAttrib(a);l={},Object.keys(new v).forEach(function(e){l[e]=t.def(u,`.`,e)})}s(e.link(r),o(r.info.type),l)})}function ne(e,t,r,i,a,o){for(var s=e.shared,c=s.gl,l,u=0;u<i.length;++u){var d=i[u],f=d.name,p=d.info.type,m=r.uniforms[f],h=e.link(d)+`.location`,g;if(m){if(!a(m))continue;if(oo(m)){var _=m.value;if(p===Ia||p===La){var v=e.link(_._texture||_.color[0]._texture);t(c,`.uniform1i(`,h,`,`,v+`.bind());`),t.exit(v,`.unbind();`)}else if(p===Na||p===Pa||p===Fa){var y=e.global.def(`new Float32Array([`+Array.prototype.slice.call(_)+`])`),b=2;p===Pa?b=3:p===Fa&&(b=4),t(c,`.uniformMatrix`,b,`fv(`,h,`,false,`,y,`);`)}else{switch(p){case xa:l=`1f`;break;case Sa:l=`2f`;break;case Ca:l=`3f`;break;case wa:l=`4f`;break;case ka:l=`1i`;break;case Ta:l=`1i`;break;case Aa:l=`2i`;break;case Ea:l=`2i`;break;case ja:l=`3i`;break;case Da:l=`3i`;break;case Ma:l=`4i`;break;case Oa:l=`4i`;break}t(c,`.uniform`,l,`(`,h,`,`,ut(_)?Array.prototype.slice.call(_):_,`);`)}continue}else g=m.append(e,t)}else{if(!a(lo))continue;g=t.def(s.uniforms,`[`,n.id(f),`]`)}p===Ia?t(`if(`,g,`&&`,g,`._reglType==="framebuffer"){`,g,`=`,g,`.color[0];`,`}`):p===La&&t(`if(`,g,`&&`,g,`._reglType==="framebufferCube"){`,g,`=`,g,`.color[0];`,`}`);var x=1;switch(p){case Ia:case La:var S=t.def(g,`._texture`);t(c,`.uniform1i(`,h,`,`,S,`.bind());`),t.exit(S,`.unbind();`);continue;case Ta:case ka:l=`1i`;break;case Ea:case Aa:l=`2i`,x=2;break;case Da:case ja:l=`3i`,x=3;break;case Oa:case Ma:l=`4i`,x=4;break;case xa:l=`1f`;break;case Sa:l=`2f`,x=2;break;case Ca:l=`3f`,x=3;break;case wa:l=`4f`,x=4;break;case Na:l=`Matrix2fv`;break;case Pa:l=`Matrix3fv`;break;case Fa:l=`Matrix4fv`;break}if(l.charAt(0)===`M`){t(c,`.uniform`,l,`(`,h,`,`);var C=(p-Na+2)**2,T=e.global.def(`new Float32Array(`,C,`)`);Array.isArray(g)?t(`false,(`,w(C,function(e){return T+`[`+e+`]=`+g[e]}),`,`,T,`)`):t(`false,(Array.isArray(`,g,`)||`,g,` instanceof Float32Array)?`,g,`:(`,w(C,function(e){return T+`[`+e+`]=`+g+`[`+e+`]`}),`,`,T,`)`),t(`);`)}else if(x>1){for(var E=[],D=[],O=0;O<x;++O)Array.isArray(g)?D.push(g[O]):D.push(t.def(g+`[`+O+`]`)),o&&E.push(t.def());o&&t(`if(!`,e.batchId,`||`,E.map(function(e,t){return e+`!==`+D[t]}).join(`||`),`){`,E.map(function(e,t){return e+`=`+D[t]+`;`}).join(``)),t(c,`.uniform`,l,`(`,h,`,`,D.join(`,`),`);`),o&&t(`}`)}else{if(o){var k=t.def();t(`if(!`,e.batchId,`||`,k,`!==`,g,`){`,k,`=`,g,`;`)}t(c,`.uniform`,l,`(`,h,`,`,g,`);`),o&&t(`}`)}}}function re(e,t,n,r){var i=e.shared,a=i.gl,o=i.draw,s=r.draw;function c(){var c=s.elements,l,u=t;return c?((c.contextDep&&r.contextDynamic||c.propDep)&&(u=n),l=c.append(e,u),s.elementsActive&&u(`if(`+l+`)`+a+`.bindBuffer(`+da+`,`+l+`.buffer.buffer);`)):(l=u.def(),u(l,`=`,o,`.`,Ji,`;`,`if(`,l,`){`,a,`.bindBuffer(`,da,`,`,l,`.buffer.buffer);}`,`else if(`,i.vao,`.currentVAO){`,l,`=`,e.shared.elements+`.getElements(`+i.vao,`.currentVAO.elements);`,S?``:`if(`+l+`)`+a+`.bindBuffer(`+da+`,`+l+`.buffer.buffer);`,`}`)),l}function l(){var i=s.count,a,c=t;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(c=n),a=i.append(e,c)):a=c.def(o,`.`,Xi),a}var u=c();function d(i){var a=s[i];return a?a.contextDep&&r.contextDynamic||a.propDep?a.append(e,n):a.append(e,t):t.def(o,`.`,i)}var f=d(Yi),p=d(Zi),m=l();if(typeof m==`number`){if(m===0)return}else n(`if(`,m,`){`),n.exit(`}`);var h,g;b&&(h=d(Qi),g=e.instancing);var _=u+`.type`,v=s.elements&&oo(s.elements)&&!s.vaoActive;function y(){function e(){n(g,`.drawElementsInstancedANGLE(`,[f,m,_,p+`<<((`+_+`-`+si+`)>>1)`,h],`);`)}function t(){n(g,`.drawArraysInstancedANGLE(`,[f,p,m,h],`);`)}u&&u!==`null`?v?e():(n(`if(`,u,`){`),e(),n(`}else{`),t(),n(`}`)):t()}function x(){function e(){n(a+`.drawElements(`+[f,m,_,p+`<<((`+_+`-`+si+`)>>1)`]+`);`)}function t(){n(a+`.drawArrays(`+[f,p,m]+`);`)}u&&u!==`null`?v?e():(n(`if(`,u,`){`),e(),n(`}else{`),t(),n(`}`)):t()}b&&(typeof h!=`number`||h>=0)?typeof h==`string`?(n(`if(`,h,`>0){`),y(),n(`}else if(`,h,`<0){`),x(),n(`}`)):y():x()}function ie(e,t,n,r,i){var a=I(),o=a.proc(`body`,i);return b&&(a.instancing=o.def(a.shared.extensions,`.angle_instanced_arrays`)),e(a,o,n,r),a.compile().body}function ae(e,t,n,r){Q(e,t),n.useVAO?n.drawVAO?t(e.shared.vao,`.setVAO(`,n.drawVAO.append(e,t),`);`):t(e.shared.vao,`.setVAO(`,e.shared.vao,`.targetVAO);`):(t(e.shared.vao,`.setVAO(null);`),te(e,t,n,r.attributes,function(){return!0})),ne(e,t,n,r.uniforms,function(){return!0},!1),re(e,t,t,n)}function oe(e,t){var n=e.proc(`draw`,1);Q(e,n),J(e,n,t.context),Y(e,n,t.framebuffer),X(e,n,t),Z(e,n,t.state),ee(e,n,t,!1,!0);var r=t.shader.progVar.append(e,n);if(n(e.shared.gl,`.useProgram(`,r,`.program);`),t.shader.program)ae(e,n,t,t.shader.program);else{n(e.shared.vao,`.setVAO(null);`);var i=e.global.def(`{}`),a=n.def(r,`.id`),o=n.def(i,`[`,a,`]`);n(e.cond(o).then(o,`.call(this,a0);`).else(o,`=`,i,`[`,a,`]=`,e.link(function(n){return ie(ae,e,t,n,1)}),`(`,r,`);`,o,`.call(this,a0);`))}Object.keys(t.state).length>0&&n(e.shared.current,`.dirty=true;`),e.shared.vao&&n(e.shared.vao,`.setVAO(null);`)}function se(e,t,n,r){e.batchId=`a1`,Q(e,t);function i(){return!0}te(e,t,n,r.attributes,i),ne(e,t,n,r.uniforms,i,!1),re(e,t,t,n)}function ce(e,t,n,r){Q(e,t);var i=n.contextDep,a=t.def(),o=`a0`,s=`a1`,c=t.def();e.shared.props=c,e.batchId=a;var l=e.scope(),u=e.scope();t(l.entry,`for(`,a,`=0;`,a,`<`,s,`;++`,a,`){`,c,`=`,o,`[`,a,`];`,u,`}`,l.exit);function d(e){return e.contextDep&&i||e.propDep}function f(e){return!d(e)}if(n.needsContext&&J(e,u,n.context),n.needsFramebuffer&&Y(e,u,n.framebuffer),Z(e,u,n.state,d),n.profile&&d(n.profile)&&ee(e,u,n,!1,!0),r)n.useVAO?n.drawVAO?d(n.drawVAO)?u(e.shared.vao,`.setVAO(`,n.drawVAO.append(e,u),`);`):l(e.shared.vao,`.setVAO(`,n.drawVAO.append(e,l),`);`):l(e.shared.vao,`.setVAO(`,e.shared.vao,`.targetVAO);`):(l(e.shared.vao,`.setVAO(null);`),te(e,l,n,r.attributes,f),te(e,u,n,r.attributes,d)),ne(e,l,n,r.uniforms,f,!1),ne(e,u,n,r.uniforms,d,!0),re(e,l,u,n);else{var p=e.global.def(`{}`),m=n.shader.progVar.append(e,u),h=u.def(m,`.id`),g=u.def(p,`[`,h,`]`);u(e.shared.gl,`.useProgram(`,m,`.program);`,`if(!`,g,`){`,g,`=`,p,`[`,h,`]=`,e.link(function(t){return ie(se,e,n,t,2)}),`(`,m,`);}`,g,`.call(this,a0[`,a,`],`,a,`);`)}}function le(e,t){var n=e.proc(`batch`,2);e.batchId=`0`,Q(e,n);var r=!1,i=!0;Object.keys(t.context).forEach(function(e){r||=t.context[e].propDep}),r||(J(e,n,t.context),i=!1);var a=t.framebuffer,o=!1;a?(a.propDep?r=o=!0:a.contextDep&&r&&(o=!0),o||Y(e,n,a)):Y(e,n,null),t.state.viewport&&t.state.viewport.propDep&&(r=!0);function s(e){return e.contextDep&&r||e.propDep}X(e,n,t),Z(e,n,t.state,function(e){return!s(e)}),(!t.profile||!s(t.profile))&&ee(e,n,t,!1,`a1`),t.contextDep=r,t.needsContext=i,t.needsFramebuffer=o;var c=t.shader.progVar;if(c.contextDep&&r||c.propDep)ce(e,n,t,null);else{var l=c.append(e,n);if(n(e.shared.gl,`.useProgram(`,l,`.program);`),t.shader.program)ce(e,n,t,t.shader.program);else{n(e.shared.vao,`.setVAO(null);`);var u=e.global.def(`{}`),d=n.def(l,`.id`),f=n.def(u,`[`,d,`]`);n(e.cond(f).then(f,`.call(this,a0,a1);`).else(f,`=`,u,`[`,d,`]=`,e.link(function(n){return ie(ce,e,t,n,2)}),`(`,l,`);`,f,`.call(this,a0,a1);`))}}Object.keys(t.state).length>0&&n(e.shared.current,`.dirty=true;`),e.shared.vao&&n(e.shared.vao,`.setVAO(null);`)}function ue(e,t){var r=e.proc(`scope`,3);e.batchId=`a2`;var i=e.shared,a=i.current;if(J(e,r,t.context),t.framebuffer&&t.framebuffer.append(e,r),io(Object.keys(t.state)).forEach(function(n){var a=t.state[n],o=a.append(e,r);ut(o)?o.forEach(function(t,i){M(t)?r.set(e.next[n],`[`+i+`]`,t):r.set(e.next[n],`[`+i+`]`,e.link(t,{stable:!0}))}):oo(a)?r.set(i.next,`.`+n,e.link(o,{stable:!0})):r.set(i.next,`.`+n,o)}),ee(e,r,t,!0,!0),[Ji,Zi,Xi,Qi,Yi].forEach(function(n){var a=t.draw[n];if(a){var o=a.append(e,r);M(o)?r.set(i.draw,`.`+n,o):r.set(i.draw,`.`+n,e.link(o),{stable:!0})}}),Object.keys(t.uniforms).forEach(function(a){var o=t.uniforms[a].append(e,r);Array.isArray(o)&&(o=`[`+o.map(function(t){return M(t)?t:e.link(t,{stable:!0})})+`]`),r.set(i.uniforms,`[`+e.link(n.id(a),{stable:!0})+`]`,o)}),Object.keys(t.attributes).forEach(function(n){var i=t.attributes[n].append(e,r),a=e.scopeAttrib(n);Object.keys(new v).forEach(function(e){r.set(a,`.`+e,i[e])})}),t.scopeVAO){var o=t.scopeVAO.append(e,r);M(o)?r.set(i.vao,`.targetVAO`,o):r.set(i.vao,`.targetVAO`,e.link(o,{stable:!0}))}function s(n){var a=t.shader[n];if(a){var o=a.append(e,r);M(o)?r.set(i.shader,`.`+n,o):r.set(i.shader,`.`+n,e.link(o,{stable:!0}))}}s(Ki),s(qi),Object.keys(t.state).length>0&&(r(a,`.dirty=true;`),r.exit(a,`.dirty=true;`)),r(`a1(`,e.shared.context,`,a0,`,e.batchId,`);`)}function de(e){if(!(typeof e!=`object`||ut(e))){for(var t=Object.keys(e),n=0;n<t.length;++n)if(f.isDynamic(e[t[n]]))return!0;return!1}}function fe(e,t,n){var r=t.static[n];if(!r||!de(r))return;var i=e.global,a=Object.keys(r),o=!1,s=!1,c=!1,l=e.global.def(`{}`);a.forEach(function(t){var n=r[t];if(f.isDynamic(n)){typeof n==`function`&&(n=r[t]=f.unbox(n));var a=co(n,null);o||=a.thisDep,c||=a.propDep,s||=a.contextDep}else{switch(i(l,`.`,t,`=`),typeof n){case`number`:i(n);break;case`string`:i(`"`,n,`"`);break;case`object`:Array.isArray(n)&&i(`[`,n.join(),`]`);break;default:i(e.link(n));break}i(`;`)}});function u(e,t){a.forEach(function(n){var i=r[n];f.isDynamic(i)&&t(l,`.`,n,`=`,e.invoke(t,i),`;`)})}t.dynamic[n]=new f.DynamicVariable(mi,{thisDep:o,contextDep:s,propDep:c,ref:l,append:u}),delete t.static[n]}function pe(t,n,r,i,a){var o=I();o.stats=o.link(a),Object.keys(n.static).forEach(function(e){fe(o,n,e)}),la.forEach(function(e){fe(o,t,e)});var s=q(t,n,r,i,o);return s.shader.program&&(s.shader.program.attributes.sort(function(e,t){return e.name<t.name?-1:1}),s.shader.program.uniforms.sort(function(e,t){return e.name<t.name?-1:1})),oe(o,s),ue(o,s),le(o,s),e(o.compile(),{destroy:function(){s.shader.program.destroy()}})}return{next:T,current:C,procs:function(){var e=I(),t=e.proc(`poll`),n=e.proc(`refresh`),a=e.block();t(a),n(a);var o=e.shared,s=o.gl,c=o.next,l=o.current;a(l,`.dirty=false;`),Y(e,t),Y(e,n,null,!0);var u;b&&(u=e.link(b)),r.oes_vertex_array_object&&n(e.link(r.oes_vertex_array_object),`.bindVertexArrayOES(null);`);var d=n.def(o.attributes),f=n.def(0),p=e.cond(f,`.buffer`);p.then(s,`.enableVertexAttribArray(i);`,s,`.bindBuffer(`,ua,`,`,f,`.buffer.buffer);`,s,`.vertexAttribPointer(i,`,f,`.size,`,f,`.type,`,f,`.normalized,`,f,`.stride,`,f,`.offset);`).else(s,`.disableVertexAttribArray(i);`,s,`.vertexAttrib4f(i,`,f,`.x,`,f,`.y,`,f,`.z,`,f,`.w);`,f,`.buffer=null;`);var m=e.link(i.maxAttributes,{stable:!0});return n(`for(var i=0;i<`,m,`;++i){`,f,`=`,d,`[i];`,p,`}`),b&&n(`for(var i=0;i<`,m,`;++i){`,u,`.vertexAttribDivisorANGLE(i,`,d,`[i].divisor);`,`}`),n(e.shared.vao,`.currentVAO=null;`,e.shared.vao,`.setVAO(`,e.shared.vao,`.targetVAO);`),Object.keys(D).forEach(function(r){var i=D[r],o=a.def(c,`.`,r),u=e.block();u(`if(`,o,`){`,s,`.enable(`,i,`)}else{`,s,`.disable(`,i,`)}`,l,`.`,r,`=`,o,`;`),n(u),t(`if(`,o,`!==`,l,`.`,r,`){`,u,`}`)}),Object.keys(O).forEach(function(r){var i=O[r],o=C[r],u,d,f=e.block();if(f(s,`.`,i,`(`),ut(o)){var p=o.length;u=e.global.def(c,`.`,r),d=e.global.def(l,`.`,r),f(w(p,function(e){return u+`[`+e+`]`}),`);`,w(p,function(e){return d+`[`+e+`]=`+u+`[`+e+`];`}).join(``)),t(`if(`,w(p,function(e){return u+`[`+e+`]!==`+d+`[`+e+`]`}).join(`||`),`){`,f,`}`)}else u=a.def(c,`.`,r),d=a.def(l,`.`,r),f(u,`);`,l,`.`,r,`=`,u,`;`),t(`if(`,u,`!==`,d,`){`,f,`}`);n(f)}),e.compile()}(),compile:pe}}function fo(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var po=34918,mo=34919,ho=35007,go=function(e,t){if(!t.ext_disjoint_timer_query)return null;var n=[];function r(){return n.pop()||t.ext_disjoint_timer_query.createQueryEXT()}function i(e){n.push(e)}var a=[];function o(e){var n=r();t.ext_disjoint_timer_query.beginQueryEXT(ho,n),a.push(n),p(a.length-1,a.length,e)}function s(){t.ext_disjoint_timer_query.endQueryEXT(ho)}function c(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var l=[];function u(){return l.pop()||new c}function d(e){l.push(e)}var f=[];function p(e,t,n){var r=u();r.startQueryIndex=e,r.endQueryIndex=t,r.sum=0,r.stats=n,f.push(r)}var m=[],h=[];function g(){var e,n,r=a.length;if(r!==0){h.length=Math.max(h.length,r+1),m.length=Math.max(m.length,r+1),m[0]=0,h[0]=0;var o=0;for(e=0,n=0;n<a.length;++n){var s=a[n];t.ext_disjoint_timer_query.getQueryObjectEXT(s,mo)?(o+=t.ext_disjoint_timer_query.getQueryObjectEXT(s,po),i(s)):a[e++]=s,m[n+1]=o,h[n+1]=e}for(a.length=e,e=0,n=0;n<f.length;++n){var c=f[n],l=c.startQueryIndex,u=c.endQueryIndex;c.sum+=m[u]-m[l];var p=h[l],g=h[u];g===p?(c.stats.gpuTime+=c.sum/1e6,d(c)):(c.startQueryIndex=p,c.endQueryIndex=g,f[e++]=c)}f.length=e}}return{beginQuery:o,endQuery:s,pushScopeStats:p,update:g,getNumPendingQueries:function(){return a.length},clear:function(){n.push.apply(n,a);for(var e=0;e<n.length;e++)t.ext_disjoint_timer_query.deleteQueryEXT(n[e]);a.length=0,n.length=0},restore:function(){a.length=0,n.length=0}}},_o=16384,vo=256,yo=1024,bo=34962,xo=`webglcontextlost`,So=`webglcontextrestored`,Co=1,wo=2,To=3;function Eo(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}function Do(t){var n=S(t);if(!n)return null;var r=n.gl,i=r.getContextAttributes();r.isContextLost();var a=C(r,n);if(!a)return null;var o=h(),s=fo(),c=n.cachedCode||{},l=a.extensions,u=go(r,l),d=m(),g=r.drawingBufferWidth,_=r.drawingBufferHeight,v={tick:0,time:0,viewportWidth:g,viewportHeight:_,framebufferWidth:g,framebufferHeight:_,drawingBufferWidth:g,drawingBufferHeight:_,pixelRatio:n.pixelRatio},y={},b={elements:null,primitive:4,count:-1,offset:0,instances:-1},x=xe(r,l),w=Ge(r,s,n,D),T=at(r,l,w,s),E=Or(r,l,x,s,w,T,b);function D(e){return E.destroyBuffer(e)}var O=Nr(r,o,s,n),k=qn(r,l,x,function(){M.procs.poll()},v,s,n),A=sr(r,l,x,s,n),j=Cr(r,l,x,k,A,s),M=uo(r,o,l,x,w,T,k,j,y,E,O,b,v,u,c,n),N=Rr(r,j,M.procs.poll,v,i,l,x),P=M.next,F=r.canvas,I=[],L=[],R=[],z=[n.onDestroy],B=null;function V(){if(I.length===0){u&&u.update(),B=null;return}B=p.next(V),ee();for(var e=I.length-1;e>=0;--e){var t=I[e];t&&t(v,null,0)}r.flush(),u&&u.update()}function H(){!B&&I.length>0&&(B=p.next(V))}function U(){B&&=(p.cancel(V),null)}function W(e){e.preventDefault(),U(),L.forEach(function(e){e()})}function G(e){r.getError(),a.restore(),O.restore(),w.restore(),k.restore(),A.restore(),j.restore(),E.restore(),u&&u.restore(),M.procs.refresh(),H(),R.forEach(function(e){e()})}F&&(F.addEventListener(xo,W,!1),F.addEventListener(So,G,!1));function K(){I.length=0,U(),F&&(F.removeEventListener(xo,W),F.removeEventListener(So,G)),O.clear(),j.clear(),A.clear(),E.clear(),k.clear(),T.clear(),w.clear(),u&&u.clear(),z.forEach(function(e){e()})}function q(t){function n(t){var n=e({},t);delete n.uniforms,delete n.attributes,delete n.context,delete n.vao,`stencil`in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op);function r(e){if(e in n){var t=n[e];delete n[e],Object.keys(t).forEach(function(r){n[e+`.`+r]=t[r]})}}return r(`blend`),r(`depth`),r(`cull`),r(`stencil`),r(`polygonOffset`),r(`scissor`),r(`sample`),`vao`in t&&(n.vao=t.vao),n}function r(e,t){var n={},r={};return Object.keys(e).forEach(function(i){var a=e[i];if(f.isDynamic(a)){r[i]=f.unbox(a,i);return}else if(t&&Array.isArray(a)){for(var o=0;o<a.length;++o)if(f.isDynamic(a[o])){r[i]=f.unbox(a,i);return}}n[i]=a}),{dynamic:r,static:n}}var i=r(t.context||{},!0),a=r(t.uniforms||{},!0),o=r(t.attributes||{},!1),s=r(n(t),!1),c={gpuTime:0,cpuTime:0,count:0},l=M.compile(s,o,a,i,c),u=l.draw,d=l.batch,p=l.scope,m=[];function h(e){for(;m.length<e;)m.push(null);return m}function g(e,t){var n;if(typeof e==`function`)return p.call(this,null,e,0);if(typeof t==`function`)if(typeof e==`number`)for(n=0;n<e;++n)p.call(this,null,t,n);else if(Array.isArray(e))for(n=0;n<e.length;++n)p.call(this,e[n],t,n);else return p.call(this,e,t,0);else if(typeof e==`number`){if(e>0)return d.call(this,h(e|0),e|0)}else if(Array.isArray(e)){if(e.length)return d.call(this,e,e.length)}else return u.call(this,e)}return e(g,{stats:c,destroy:function(){l.destroy()}})}var J=j.setFBO=q({framebuffer:f.define.call(null,Co,`framebuffer`)});function Y(e,t){var n=0;M.procs.poll();var i=t.color;i&&(r.clearColor(+i[0]||0,+i[1]||0,+i[2]||0,+i[3]||0),n|=_o),`depth`in t&&(r.clearDepth(+t.depth),n|=vo),`stencil`in t&&(r.clearStencil(t.stencil|0),n|=yo),r.clear(n)}function X(t){if(`framebuffer`in t)if(t.framebuffer&&t.framebuffer_reglType===`framebufferCube`)for(var n=0;n<6;++n)J(e({framebuffer:t.framebuffer.faces[n]},t),Y);else J(t,Y);else Y(null,t)}function Z(e){I.push(e);function t(){var t=Eo(I,e);function n(){var e=Eo(I,n);I[e]=I[I.length-1],--I.length,I.length<=0&&U()}I[t]=n}return H(),{cancel:t}}function Q(){var e=P.viewport,t=P.scissor_box;e[0]=e[1]=t[0]=t[1]=0,v.viewportWidth=v.framebufferWidth=v.drawingBufferWidth=e[2]=t[2]=r.drawingBufferWidth,v.viewportHeight=v.framebufferHeight=v.drawingBufferHeight=e[3]=t[3]=r.drawingBufferHeight}function ee(){v.tick+=1,v.time=ne(),Q(),M.procs.poll()}function te(){k.refresh(),Q(),M.procs.refresh(),u&&u.update()}function ne(){return(m()-d)/1e3}te();function re(e,t){var n;switch(e){case`frame`:return Z(t);case`lost`:n=L;break;case`restore`:n=R;break;case`destroy`:n=z;break;default:}return n.push(t),{cancel:function(){for(var e=0;e<n.length;++e)if(n[e]===t){n[e]=n[n.length-1],n.pop();return}}}}function ie(){return c}function ae(e){Object.entries(e).forEach(function(e){c[e[0]]=e[1]})}var oe=e(q,{clear:X,prop:f.define.bind(null,Co),context:f.define.bind(null,wo),this:f.define.bind(null,To),draw:q({}),buffer:function(e){return w.create(e,bo,!1,!1)},elements:function(e){return T.create(e,!1)},texture:k.create2D,cube:k.createCube,renderbuffer:A.create,framebuffer:j.create,framebufferCube:j.createCube,vao:E.createVAO,attributes:i,frame:Z,on:re,limits:x,hasExtension:function(e){return x.extensions.indexOf(e.toLowerCase())>=0},read:N,destroy:K,_gl:r,_refresh:te,poll:function(){ee(),u&&u.update()},now:ne,stats:s,getCachedCode:ie,preloadCachedCode:ae});return n.onDone(null,oe),oe}return Do})}),Dy=h((e,t)=>{var n=p_();t.exports=function(e){if(e?typeof e==`string`&&(e={container:e}):e={},e=i(e)||a(e)?{container:e}:o(e)?{gl:e}:n(e,{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),e.pixelRatio||=window.pixelRatio||1,e.gl)return e.gl;if(e.canvas&&(e.container=e.canvas.parentNode),e.container){if(typeof e.container==`string`){var t=document.querySelector(e.container);if(!t)throw Error(`Element `+e.container+` is not found`);e.container=t}i(e.container)?(e.canvas=e.container,e.container=e.canvas.parentNode):e.canvas||(e.canvas=s(),e.container.appendChild(e.canvas),r(e))}else if(!e.canvas)if(typeof document<`u`)e.container=document.body||document.documentElement,e.canvas=s(),e.container.appendChild(e.canvas),r(e);else throw Error(`Not DOM environment. Use headless-gl.`);return e.gl||[`webgl`,`experimental-webgl`,`webgl-experimental`].some(function(t){try{e.gl=e.canvas.getContext(t,e.attrs)}catch{}return e.gl}),e.gl};function r(e){if(e.container)if(e.container==document.body)document.body.style.width||(e.canvas.width=e.width||e.pixelRatio*window.innerWidth),document.body.style.height||(e.canvas.height=e.height||e.pixelRatio*window.innerHeight);else{var t=e.container.getBoundingClientRect();e.canvas.width=e.width||t.right-t.left,e.canvas.height=e.height||t.bottom-t.top}}function i(e){return typeof e.getContext==`function`&&`width`in e&&`height`in e}function a(e){return typeof e.nodeName==`string`&&typeof e.appendChild==`function`&&typeof e.getBoundingClientRect==`function`}function o(e){return typeof e.drawArrays==`function`||typeof e.drawElements==`function`}function s(){var e=document.createElement(`canvas`);return e.style.position=`absolute`,e.style.top=0,e.style.left=0,e}}),Oy=h((e,t)=>{var n=wy(),r=[32,126];t.exports=i;function i(e){e||={};var t=e.shape?e.shape:e.canvas?[e.canvas.width,e.canvas.height]:[512,512],i=e.canvas||document.createElement(`canvas`),a=e.font,o=typeof e.step==`number`?[e.step,e.step]:e.step||[32,32],s=e.chars||r;if(a&&typeof a!=`string`&&(a=n(a)),!Array.isArray(s))s=String(s).split(``);else if(s.length===2&&typeof s[0]==`number`&&typeof s[1]==`number`){for(var c=[],l=s[0],u=0;l<=s[1];l++)c[u++]=String.fromCharCode(l);s=c}t=t.slice(),i.width=t[0],i.height=t[1];var d=i.getContext(`2d`);d.fillStyle=`#000`,d.fillRect(0,0,i.width,i.height),d.font=a,d.textAlign=`center`,d.textBaseline=`middle`,d.fillStyle=`#fff`;for(var f=o[0]/2,p=o[1]/2,l=0;l<s.length;l++)d.fillText(s[l],f,p),(f+=o[0])>t[0]-o[0]/2&&(f=o[0]/2,p+=o[1]);return i}}),ky=h(e=>{"use restrict";var t=32;e.INT_BITS=t,e.INT_MAX=2147483647,e.INT_MIN=-1<<t-1,e.sign=function(e){return(e>0)-(e<0)},e.abs=function(e){var n=e>>t-1;return(e^n)-n},e.min=function(e,t){return t^(e^t)&-(e<t)},e.max=function(e,t){return e^(e^t)&-(e<t)},e.isPow2=function(e){return!(e&e-1)&&!!e},e.log2=function(e){var t,n;return t=(e>65535)<<4,e>>>=t,n=(e>255)<<3,e>>>=n,t|=n,n=(e>15)<<2,e>>>=n,t|=n,n=(e>3)<<1,e>>>=n,t|=n,t|e>>1},e.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},e.popCount=function(e){return e-=e>>>1&1431655765,e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24};function n(e){var t=32;return e&=-e,e&&t--,e&65535&&(t-=16),e&16711935&&(t-=8),e&252645135&&(t-=4),e&858993459&&(t-=2),e&1431655765&&--t,t}e.countTrailingZeros=n,e.nextPow2=function(e){return e+=e===0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1},e.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e-(e>>>1)},e.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,e&=15,27030>>>e&1};var r=Array(256);(function(e){for(var t=0;t<256;++t){var n=t,r=t,i=7;for(n>>>=1;n;n>>>=1)r<<=1,r|=n&1,--i;e[t]=r<<i&255}})(r),e.reverse=function(e){return r[e&255]<<24|r[e>>>8&255]<<16|r[e>>>16&255]<<8|r[e>>>24&255]},e.interleave2=function(e,t){return e&=65535,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t&=65535,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1},e.deinterleave2=function(e,t){return e=e>>>t&1431655765,e=(e|e>>>1)&858993459,e=(e|e>>>2)&252645135,e=(e|e>>>4)&16711935,e=(e|e>>>16)&65535,e<<16>>16},e.interleave3=function(e,t,n){return e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,t&=1023,t=(t|t<<16)&4278190335,t=(t|t<<8)&251719695,t=(t|t<<4)&3272356035,t=(t|t<<2)&1227133513,e|=t<<1,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,e|n<<2},e.deinterleave3=function(e,t){return e=e>>>t&1227133513,e=(e|e>>>2)&3272356035,e=(e|e>>>4)&251719695,e=(e|e>>>8)&4278190335,e=(e|e>>>16)&1023,e<<22>>22},e.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>n(e)+1}}),Ay=h((e,t)=>{function n(e,t,r){var i=e[r]|0;if(i<=0)return[];var a=Array(i),o;if(r===e.length-1)for(o=0;o<i;++o)a[o]=t;else for(o=0;o<i;++o)a[o]=n(e,t,r+1);return a}function r(e,t){var n,r;for(n=Array(e),r=0;r<e;++r)n[r]=t;return n}function i(e,t){switch(t===void 0&&(t=0),typeof e){case`number`:if(e>0)return r(e|0,t);break;case`object`:if(typeof e.length==`number`)return n(e,t,0);break}return[]}t.exports=i}),jy=h(e=>{var t=ky(),n=Ay(),r=Wc().Buffer;window.__TYPEDARRAY_POOL||(window.__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`,a=typeof BigUint64Array<`u`,o=typeof BigInt64Array<`u`,s=window.__TYPEDARRAY_POOL;s.UINT8C||=n([32,0]),s.BIGUINT64||=n([32,0]),s.BIGINT64||=n([32,0]),s.BUFFER||=n([32,0]);var c=s.DATA,l=s.BUFFER;e.free=function(e){if(r.isBuffer(e))l[t.log2(e.length)].push(e);else{if(Object.prototype.toString.call(e)!==`[object ArrayBuffer]`&&(e=e.buffer),!e)return;var n=e.length||e.byteLength;c[t.log2(n)|0].push(e)}};function u(e){if(e){var n=e.length||e.byteLength;c[t.log2(n)].push(e)}}function d(e){u(e.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=d,e.freeArrayBuffer=u,e.freeBuffer=function(e){l[t.log2(e.length)].push(e)},e.malloc=function(e,t){if(t===void 0||t===`arraybuffer`)return f(e);switch(t){case`uint8`:return p(e);case`uint16`:return m(e);case`uint32`:return h(e);case`int8`:return g(e);case`int16`:return _(e);case`int32`:return v(e);case`float`:case`float32`:return y(e);case`double`:case`float64`:return b(e);case`uint8_clamped`:return x(e);case`bigint64`:return C(e);case`biguint64`:return S(e);case`buffer`:return T(e);case`data`:case`dataview`:return w(e);default:return null}return null};function f(e){var e=t.nextPow2(e),n=c[t.log2(e)];return n.length>0?n.pop():new ArrayBuffer(e)}e.mallocArrayBuffer=f;function p(e){return new Uint8Array(f(e),0,e)}e.mallocUint8=p;function m(e){return new Uint16Array(f(2*e),0,e)}e.mallocUint16=m;function h(e){return new Uint32Array(f(4*e),0,e)}e.mallocUint32=h;function g(e){return new Int8Array(f(e),0,e)}e.mallocInt8=g;function _(e){return new Int16Array(f(2*e),0,e)}e.mallocInt16=_;function v(e){return new Int32Array(f(4*e),0,e)}e.mallocInt32=v;function y(e){return new Float32Array(f(4*e),0,e)}e.mallocFloat32=e.mallocFloat=y;function b(e){return new Float64Array(f(8*e),0,e)}e.mallocFloat64=e.mallocDouble=b;function x(e){return i?new Uint8ClampedArray(f(e),0,e):p(e)}e.mallocUint8Clamped=x;function S(e){return a?new BigUint64Array(f(8*e),0,e):null}e.mallocBigUint64=S;function C(e){return o?new BigInt64Array(f(8*e),0,e):null}e.mallocBigInt64=C;function w(e){return new DataView(f(e),0,e)}e.mallocDataView=w;function T(e){e=t.nextPow2(e);var n=l[t.log2(e)];return n.length>0?n.pop():new r(e)}e.mallocBuffer=T,e.clearCache=function(){for(var e=0;e<32;++e)s.UINT8[e].length=0,s.UINT16[e].length=0,s.UINT32[e].length=0,s.INT8[e].length=0,s.INT16[e].length=0,s.INT32[e].length=0,s.FLOAT[e].length=0,s.DOUBLE[e].length=0,s.BIGUINT64[e].length=0,s.BIGINT64[e].length=0,s.UINT8C[e].length=0,c[e].length=0,l[e].length=0}}),My=h((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){var t;return n.call(e)===`[object Object]`&&(t=Object.getPrototypeOf(e),t===null||t===Object.getPrototypeOf({}))}}),Ny=h((e,t)=>{t.exports=function(e,t){return t||=[0,``],e=String(e),t[0]=parseFloat(e,10),t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||``,t}}),Py=h((e,t)=>{var n=Ny();t.exports=o;var r=96;function i(e,t){var r=n(getComputedStyle(e).getPropertyValue(t));return r[0]*o(r[1],e)}function a(e,t){var n=document.createElement(`div`);n.style[`font-size`]=`128`+e,t.appendChild(n);var r=i(n,`font-size`)/128;return t.removeChild(n),r}function o(e,t){switch(t||=document.body,e=(e||`px`).trim().toLowerCase(),(t===window||t===document)&&(t=document.body),e){case`%`:return t.clientHeight/100;case`ch`:case`ex`:return a(e,t);case`em`:return i(t,`font-size`);case`rem`:return i(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 r;case`cm`:return r/2.54;case`mm`:return r/25.4;case`pt`:return r/72;case`pc`:return r/6}return 1}}),Fy=h((e,t)=>{t.exports=i;var n=(i.canvas=document.createElement(`canvas`)).getContext(`2d`),r=a([32,126]);i.createPairs=a,i.ascii=r;function i(e,t){Array.isArray(e)&&(e=e.join(`, `));var i={},o,s=16,c=.05;t&&(t.length===2&&typeof t[0]==`number`?o=a(t):Array.isArray(t)?o=t:(t.o?o=a(t.o):t.pairs&&(o=t.pairs),t.fontSize&&(s=t.fontSize),t.threshold!=null&&(c=t.threshold))),o||=r,n.font=s+`px `+e;for(var l=0;l<o.length;l++){var u=o[l],d=n.measureText(u[0]).width+n.measureText(u[1]).width,f=n.measureText(u).width;Math.abs(d-f)>s*c&&(i[u]=(f-d)/s*1e3)}return i}function a(e){for(var t=[],n=e[0];n<=e[1];n++)for(var r=String.fromCharCode(n),i=e[0];i<e[1];i++){var a=r+String.fromCharCode(i);t.push(a)}return t}}),Iy=h((e,t)=>{t.exports=n,n.canvas=document.createElement(`canvas`),n.cache={};function n(e,t){t||={},(typeof e==`string`||Array.isArray(e))&&(t.family=e);var o=Array.isArray(t.family)?t.family.join(`, `):t.family;if(!o)throw Error("`family` must be defined");var s=t.size||t.fontSize||t.em||48,c=t.weight||t.fontWeight||``,e=[t.style||t.fontStyle||``,c,s].join(` `)+`px `+o,l=t.origin||`top`;if(n.cache[o]&&s<=n.cache[o].em)return r(n.cache[o],l);var u=t.canvas||n.canvas,d=u.getContext(`2d`),f={upper:t.upper===void 0?`H`:t.upper,lower:t.lower===void 0?`x`:t.lower,descent:t.descent===void 0?`p`:t.descent,ascent:t.ascent===void 0?`h`:t.ascent,tittle:t.tittle===void 0?`i`:t.tittle,overshoot:t.overshoot===void 0?`O`:t.overshoot},p=Math.ceil(s*1.5);u.height=p,u.width=p*.5,d.font=e;var m=`H`,h={top:0};d.clearRect(0,0,p,p),d.textBaseline=`top`,d.fillStyle=`black`,d.fillText(m,0,0);var g=i(d.getImageData(0,0,p,p));d.clearRect(0,0,p,p),d.textBaseline=`bottom`,d.fillText(m,0,p),h.lineHeight=h.bottom=p-i(d.getImageData(0,0,p,p))+g,d.clearRect(0,0,p,p),d.textBaseline=`alphabetic`,d.fillText(m,0,p);var _=p-i(d.getImageData(0,0,p,p))-1+g;for(var v in h.baseline=h.alphabetic=_,d.clearRect(0,0,p,p),d.textBaseline=`middle`,d.fillText(m,0,p*.5),h.median=h.middle=p-i(d.getImageData(0,0,p,p))-1+g-p*.5,d.clearRect(0,0,p,p),d.textBaseline=`hanging`,d.fillText(m,0,p*.5),h.hanging=p-i(d.getImageData(0,0,p,p))-1+g-p*.5,d.clearRect(0,0,p,p),d.textBaseline=`ideographic`,d.fillText(m,0,p),h.ideographic=p-i(d.getImageData(0,0,p,p))-1+g,f.upper&&(d.clearRect(0,0,p,p),d.textBaseline=`top`,d.fillText(f.upper,0,0),h.upper=i(d.getImageData(0,0,p,p)),h.capHeight=h.baseline-h.upper),f.lower&&(d.clearRect(0,0,p,p),d.textBaseline=`top`,d.fillText(f.lower,0,0),h.lower=i(d.getImageData(0,0,p,p)),h.xHeight=h.baseline-h.lower),f.tittle&&(d.clearRect(0,0,p,p),d.textBaseline=`top`,d.fillText(f.tittle,0,0),h.tittle=i(d.getImageData(0,0,p,p))),f.ascent&&(d.clearRect(0,0,p,p),d.textBaseline=`top`,d.fillText(f.ascent,0,0),h.ascent=i(d.getImageData(0,0,p,p))),f.descent&&(d.clearRect(0,0,p,p),d.textBaseline=`top`,d.fillText(f.descent,0,0),h.descent=a(d.getImageData(0,0,p,p))),f.overshoot&&(d.clearRect(0,0,p,p),d.textBaseline=`top`,d.fillText(f.overshoot,0,0),h.overshoot=a(d.getImageData(0,0,p,p))-_),h)h[v]/=s;return h.em=s,n.cache[o]=h,r(h,l)}function r(e,t){var n={};for(var r in typeof t==`string`&&(t=e[t]),e)r!==`em`&&(n[r]=e[r]-t);return n}function i(e){for(var t=e.height,n=e.data,r=3;r<n.length;r+=4)if(n[r]!==0)return Math.floor((r-3)*.25/t)}function a(e){for(var t=e.height,n=e.data,r=n.length-1;r>0;r-=4)if(n[r]!==0)return Math.floor((r-3)*.25/t)}}),Ly=h((e,t)=>{var n=Ty(),r=p_(),i=Ey(),a=Dy(),o=ly(),s=fh(),c=Oy(),l=jy(),u=m_(),d=My(),f=Ny(),p=Py(),m=Fy(),h=R_(),g=Iy(),_=__(),v=ky().nextPow2,y=new o,b=!1;document.body&&(x=document.body.appendChild(document.createElement(`div`)),x.style.font=`italic small-caps bold condensed 16px/2 cursive`,getComputedStyle(x).fontStretch&&(b=!0),document.body.removeChild(x));var x,S=function(e){C(e)?(e={regl:e},this.gl=e.regl._gl):this.gl=a(e),this.shader=y.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=e.regl||i({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(),y.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(d(e)?e:{})};S.prototype.createShader=function(){var e=this.regl;return{regl:e,draw:e({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:e.prop(`count`),offset:e.prop(`offset`),attributes:{charOffset:{offset:4,stride:8,buffer:e.this(`sizeBuffer`)},width:{offset:0,stride:8,buffer:e.this(`sizeBuffer`)},char:e.this(`charBuffer`),position:e.this(`position`)},uniforms:{atlasSize:function(e,t){return[t.atlas.width,t.atlas.height]},atlasDim:function(e,t){return[t.atlas.cols,t.atlas.rows]},atlas:function(e,t){return t.atlas.texture},charStep:function(e,t){return t.atlas.step},em:function(e,t){return t.atlas.em},color:e.prop(`color`),opacity:e.prop(`opacity`),viewport:e.this(`viewportArray`),scale:e.this(`scale`),align:e.prop(`align`),baseline:e.prop(`baseline`),translate:e.this(`translate`),positionOffset:e.prop(`positionOffset`)},primitive:`points`,viewport:e.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;
}`}),atlas:{}}},S.prototype.update=function(e){var t=this;if(typeof e==`string`)e={text:e};else if(!e)return;e=r(e,{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),e.opacity!=null&&(Array.isArray(e.opacity)?this.opacity=e.opacity.map(function(e){return parseFloat(e)}):this.opacity=parseFloat(e.opacity)),e.viewport!=null&&(this.viewport=u(e.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport??(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]),e.kerning!=null&&(this.kerning=e.kerning),e.offset!=null&&(typeof e.offset==`number`&&(e.offset=[e.offset,0]),this.positionOffset=_(e.offset)),e.direction&&(this.direction=e.direction),e.range&&(this.range=e.range,this.scale=[1/(e.range[2]-e.range[0]),1/(e.range[3]-e.range[1])],this.translate=[-e.range[0],-e.range[1]]),e.scale&&(this.scale=e.scale),e.translate&&(this.translate=e.translate),this.scale||=[1/this.viewport.width,1/this.viewport.height],this.translate||=[0,0],!this.font.length&&!e.font&&(e.font=S.baseFontSize+`px sans-serif`);var i=!1,a=!1;if(e.font&&(Array.isArray(e.font)?e.font:[e.font]).forEach(function(e,r){if(typeof e==`string`)try{e=n.parse(e)}catch{e=n.parse(S.baseFontSize+`px `+e)}else{var o=e.style,s=e.weight,c=e.stretch,l=e.variant;e=n.parse(n.stringify(e)),o&&(e.style=o),s&&(e.weight=s),c&&(e.stretch=c),l&&(e.variant=l)}var u=n.stringify({size:S.baseFontSize,family:e.family,stretch:b?e.stretch:void 0,variant:e.variant,weight:e.weight,style:e.style}),d=f(e.size),m=Math.round(d[0]*p(d[1]));if(m!==t.fontSize[r]&&(a=!0,t.fontSize[r]=m),(!t.font[r]||u!=t.font[r].baseString)&&(i=!0,t.font[r]=S.fonts[u],!t.font[r])){var h=e.family.join(`, `),_=[e.style];e.style!=e.variant&&_.push(e.variant),e.variant!=e.weight&&_.push(e.weight),b&&e.weight!=e.stretch&&_.push(e.stretch),t.font[r]={baseString:u,family:h,weight:e.weight,stretch:e.stretch,style:e.style,variant:e.variant,width:{},kerning:{},metrics:g(h,{origin:`top`,fontSize:S.baseFontSize,fontStyle:_.join(` `)})},S.fonts[u]=t.font[r]}}),(i||a)&&this.font.forEach(function(r,i){var a=n.stringify({size:t.fontSize[i],family:r.family,stretch:b?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(t.fontAtlas[i]=t.shader.atlas[a],!t.fontAtlas[i]){var o=r.metrics;t.shader.atlas[a]=t.fontAtlas[i]={fontString:a,step:Math.ceil(t.fontSize[i]*o.bottom*.5)*2,em:t.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:t.regl.texture()}}e.text??=t.text}),typeof e.text==`string`&&e.position&&e.position.length>2){for(var o=Array(e.position.length*.5),d=0;d<o.length;d++)o[d]=e.text;e.text=o}var y;if(e.text!=null||i){if(this.textOffsets=[0],Array.isArray(e.text)){this.count=e.text[0].length,this.counts=[this.count];for(var x=1;x<e.text.length;x++)this.textOffsets[x]=this.textOffsets[x-1]+e.text[x-1].length,this.count+=e.text[x].length,this.counts.push(e.text[x].length);this.text=e.text.join(``)}else this.text=e.text,this.count=this.text.length,this.counts=[this.count];y=[],this.font.forEach(function(e,n){S.atlasContext.font=e.baseString;for(var r=t.fontAtlas[n],i=0;i<t.text.length;i++){var a=t.text.charAt(i);if(r.ids[a]??(r.ids[a]=r.chars.length,r.chars.push(a),y.push(a)),e.width[a]==null&&(e.width[a]=S.atlasContext.measureText(a).width/S.baseFontSize,t.kerning)){var o=[];for(var s in e.width)o.push(s+a,a+s);h(e.kerning,m(e.family,{pairs:o}))}}})}if(e.position)if(e.position.length>2){for(var C=!e.position[0].length,w=l.mallocFloat(this.count*2),T=0,E=0;T<this.counts.length;T++){var D=this.counts[T];if(C)for(var O=0;O<D;O++)w[E++]=e.position[T*2],w[E++]=e.position[T*2+1];else for(var k=0;k<D;k++)w[E++]=e.position[T][0],w[E++]=e.position[T][1]}this.position.call?this.position({type:`float`,data:w}):this.position=this.regl.buffer({type:`float`,data:w}),l.freeFloat(w)}else this.position.destroy&&this.position.destroy(),this.position={constant:e.position};if(e.text||i){var A=l.mallocUint8(this.count),j=l.mallocFloat(this.count*2);this.textWidth=[];for(var M=0,N=0;M<this.counts.length;M++){for(var P=this.counts[M],F=this.font[M]||this.font[0],I=this.fontAtlas[M]||this.fontAtlas[0],L=0;L<P;L++){var R=this.text.charAt(N),z=this.text.charAt(N-1);if(A[N]=I.ids[R],j[N*2]=F.width[R],L){var B=j[N*2-2],V=j[N*2],H=j[N*2-1]+B*.5+V*.5;if(this.kerning){var U=F.kerning[z+R];U&&(H+=U*.001)}j[N*2+1]=H}else j[N*2+1]=j[N*2]*.5;N++}this.textWidth.push(j.length?j[N*2-2]*.5+j[N*2-1]:0)}e.align||=this.align,this.charBuffer({data:A,type:`uint8`,usage:`stream`}),this.sizeBuffer({data:j,type:`float`,usage:`stream`}),l.freeUint8(A),l.freeFloat(j),y.length&&this.font.forEach(function(e,n){var r=t.fontAtlas[n],i=r.step,a=Math.floor(S.maxAtlasSize/i),o=Math.min(a,r.chars.length),s=Math.ceil(r.chars.length/o),l=v(o*i),u=v(s*i);r.width=l,r.height=u,r.rows=s,r.cols=o,r.em&&r.texture({data:c({canvas:S.atlasCanvas,font:r.fontString,chars:r.chars,shape:[l,u],step:[i,i]})})})}if(e.align&&(this.align=e.align,this.alignOffset=this.textWidth.map(function(e,n){var r=Array.isArray(t.align)?t.align.length>1?t.align[n]:t.align[0]:t.align;if(typeof r==`number`)return r;switch(r){case`right`:case`end`:return-e;case`center`:case`centre`:case`middle`:return-e*.5}return 0})),this.baseline==null&&e.baseline==null&&(e.baseline=0),e.baseline!=null&&(this.baseline=e.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(e,n){var r=(t.font[n]||t.font[0]).metrics,i=0;return i+=r.bottom*.5,typeof e==`number`?i+=e-r.baseline:i+=-r[e],i*=-1,i})),e.color!=null)if(e.color||=`transparent`,typeof e.color==`string`||!isNaN(e.color))this.color=s(e.color,`uint8`);else{var W;if(typeof e.color[0]==`number`&&e.color.length>this.counts.length){var G=e.color.length;W=l.mallocUint8(G);for(var K=(e.color.subarray||e.color.slice).bind(e.color),q=0;q<G;q+=4)W.set(s(K(q,q+4),`uint8`),q)}else{var J=e.color.length;W=l.mallocUint8(J*4);for(var Y=0;Y<J;Y++)W.set(s(e.color[Y]||0,`uint8`),Y*4)}this.color=W}if(e.position||e.text||e.color||e.baseline||e.align||e.font||e.offset||e.opacity)if(this.color.length>4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var X=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(X);for(var Z=0;Z<this.batch.length;Z++)this.batch[Z]={count:this.counts.length>1?this.counts[Z]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Z]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(Z*4,Z*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Z]:this.opacity,baseline:this.baselineOffset[Z]==null?this.baselineOffset[0]:this.baselineOffset[Z],align:this.align?this.alignOffset[Z]==null?this.alignOffset[0]:this.alignOffset[Z]:0,atlas:this.fontAtlas[Z]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(Z*2,Z*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=[]},S.prototype.destroy=function(){},S.prototype.kerning=!0,S.prototype.position={constant:new Float32Array(2)},S.prototype.translate=null,S.prototype.scale=null,S.prototype.font=null,S.prototype.text=``,S.prototype.positionOffset=[0,0],S.prototype.opacity=1,S.prototype.color=new Uint8Array([0,0,0,255]),S.prototype.alignOffset=[0,0],S.maxAtlasSize=1024,S.atlasCanvas=document.createElement(`canvas`),S.atlasContext=S.atlasCanvas.getContext(`2d`,{alpha:!1}),S.baseFontSize=64,S.fonts={};function C(e){return typeof e==`function`&&e._gl&&e.prop&&e.texture&&e.buffer}t.exports=S}),Ry=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():n.createREGL=r()})(e,function(){var e=function(e,t){for(var n=Object.keys(t),r=0;r<n.length;++r)e[n[r]]=t[n[r]];return e},t=0,n=0,r=5,i=6;function a(e,n){this.id=t++,this.type=e,this.data=n}function o(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}function s(e){if(e.length===0)return[];var t=e.charAt(0),n=e.charAt(e.length-1);if(e.length>1&&t===n&&(t===`"`||t===`'`))return[`"`+o(e.substr(1,e.length-2))+`"`];var r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(r)return s(e.substr(0,r.index)).concat(s(r[1])).concat(s(e.substr(r.index+r[0].length)));var i=e.split(`.`);if(i.length===1)return[`"`+o(e)+`"`];for(var a=[],c=0;c<i.length;++c)a=a.concat(s(i[c]));return a}function c(e){return`[`+s(e).join(`][`)+`]`}function l(e,t){return new a(e,c(t+``))}function u(e){return typeof e==`function`&&!e._reglType||e instanceof a}function d(e,t){if(typeof e==`function`)return new a(n,e);if(typeof e==`number`||typeof e==`boolean`)return new a(r,e);if(Array.isArray(e))return new a(i,e.map(function(e,n){return d(e,t+`[`+n+`]`)}));if(e instanceof a)return e}var f={DynamicVariable:a,define:l,isDynamic:u,unbox:d,accessor:c},p={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},m=typeof performance<`u`&&performance.now?function(){return performance.now()}:function(){return+new Date};function h(){var e={"":0},t=[``];return{id:function(n){var r=e[n];return r||(r=e[n]=t.length,t.push(n),r)},str:function(e){return t[e]}}}function g(t,n,r){var i=document.createElement(`canvas`);e(i.style,{border:0,margin:0,padding:0,top:0,left:0,width:`100%`,height:`100%`}),t.appendChild(i),t===document.body&&(i.style.position=`absolute`,e(t.style,{margin:0,padding:0}));function a(){var e=window.innerWidth,n=window.innerHeight;if(t!==document.body){var a=i.getBoundingClientRect();e=a.right-a.left,n=a.bottom-a.top}i.width=r*e,i.height=r*n}var o;t!==document.body&&typeof ResizeObserver==`function`?(o=new ResizeObserver(function(){setTimeout(a)}),o.observe(t)):window.addEventListener(`resize`,a,!1);function s(){o?o.disconnect():window.removeEventListener(`resize`,a),t.removeChild(i)}return a(),{canvas:i,onDestroy:s}}function _(e,t){function n(n){try{return e.getContext(n,t)}catch{return null}}return n(`webgl`)||n(`experimental-webgl`)||n(`webgl-experimental`)}function v(e){return typeof e.nodeName==`string`&&typeof e.appendChild==`function`&&typeof e.getBoundingClientRect==`function`}function y(e){return typeof e.drawArrays==`function`||typeof e.drawElements==`function`}function b(e){return typeof e==`string`?e.split():e}function x(e){return typeof e==`string`?document.querySelector(e):e}function S(e){var t=e||{},n,r,i,a,o={},s=[],c=[],l=typeof window>`u`?1:window.devicePixelRatio,u=!1,d={},f=function(e){},p=function(){};if(typeof t==`string`?n=document.querySelector(t):typeof t==`object`&&(v(t)?n=t:y(t)?(a=t,i=a.canvas):(`gl`in t?a=t.gl:`canvas`in t?i=x(t.canvas):`container`in t&&(r=x(t.container)),`attributes`in t&&(o=t.attributes),`extensions`in t&&(s=b(t.extensions)),`optionalExtensions`in t&&(c=b(t.optionalExtensions)),`onDone`in t&&(f=t.onDone),`profile`in t&&(u=!!t.profile),`pixelRatio`in t&&(l=+t.pixelRatio),`cachedCode`in t&&(d=t.cachedCode))),n&&(n.nodeName.toLowerCase()===`canvas`?i=n:r=n),!a){if(!i){var m=g(r||document.body,f,l);if(!m)return null;i=m.canvas,p=m.onDestroy}o.premultipliedAlpha===void 0&&(o.premultipliedAlpha=!0),a=_(i,o)}return a?{gl:a,canvas:i,container:r,extensions:s,optionalExtensions:c,pixelRatio:l,profile:u,cachedCode:d,onDone:f,onDestroy:p}:(p(),f(`webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org`),null)}function C(e,t){var n={};function r(t){var r=t.toLowerCase(),i;try{i=n[r]=e.getExtension(r)}catch{}return!!i}for(var i=0;i<t.extensions.length;++i){var a=t.extensions[i];if(!r(a))return t.onDestroy(),t.onDone(`"`+a+`" extension is not supported by the current WebGL context, try upgrading your system or a different browser`),null}return t.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach(function(e){if(n[e]&&!r(e))throw Error(`(regl): error restoring extension `+e)})}}}function w(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=t(r);return n}var T=5120,E=5121,D=5122,O=5123,k=5124,A=5125,j=5126;function M(e){for(var t=16;t<=1<<28;t*=16)if(e<=t)return t;return 0}function N(e){var t,n;return t=(e>65535)<<4,e>>>=t,n=(e>255)<<3,e>>>=n,t|=n,n=(e>15)<<2,e>>>=n,t|=n,n=(e>3)<<1,e>>>=n,t|=n,t|e>>1}function P(){var e=w(8,function(){return[]});function t(t){var n=M(t),r=e[N(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(t){e[N(t.byteLength)>>2].push(t)}function r(e,n){var r=null;switch(e){case T:r=new Int8Array(t(n),0,n);break;case E:r=new Uint8Array(t(n),0,n);break;case D:r=new Int16Array(t(2*n),0,n);break;case O:r=new Uint16Array(t(2*n),0,n);break;case k:r=new Int32Array(t(4*n),0,n);break;case A:r=new Uint32Array(t(4*n),0,n);break;case j:r=new Float32Array(t(4*n),0,n);break;default:return null}return r.length===n?r:r.subarray(0,n)}function i(e){n(e.buffer)}return{alloc:t,free:n,allocType:r,freeType:i}}var F=P();F.zero=P();var I=3408,L=3410,R=3411,z=3412,B=3413,V=3414,H=3415,U=33901,W=33902,G=3379,K=3386,q=34921,J=36347,Y=36348,X=35661,Z=35660,Q=34930,ee=36349,te=34076,ne=34024,re=7936,ie=7937,ae=7938,oe=35724,se=34047,ce=36063,le=34852,ue=3553,de=34067,fe=34069,pe=33984,me=6408,he=5126,ge=5121,_e=36160,ve=36053,ye=36064,be=16384,xe=function(e,t){var n=1;t.ext_texture_filter_anisotropic&&(n=e.getParameter(se));var r=1,i=1;t.webgl_draw_buffers&&(r=e.getParameter(le),i=e.getParameter(ce));var a=!!t.oes_texture_float;if(a){var o=e.createTexture();e.bindTexture(ue,o),e.texImage2D(ue,0,me,1,1,0,me,he,null);var s=e.createFramebuffer();if(e.bindFramebuffer(_e,s),e.framebufferTexture2D(_e,ye,ue,o,0),e.bindTexture(ue,null),e.checkFramebufferStatus(_e)!==ve)a=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(be);var c=F.allocType(he,4);e.readPixels(0,0,1,1,me,he,c),e.getError()?a=!1:(e.deleteFramebuffer(s),e.deleteTexture(o),a=c[0]===1),F.freeType(c)}}var l=typeof navigator<`u`&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),u=!0;if(!l){var d=e.createTexture(),f=F.allocType(ge,36);e.activeTexture(pe),e.bindTexture(de,d),e.texImage2D(fe,0,me,3,3,0,me,ge,f),F.freeType(f),e.bindTexture(de,null),e.deleteTexture(d),u=!e.getError()}return{colorBits:[e.getParameter(L),e.getParameter(R),e.getParameter(z),e.getParameter(B)],depthBits:e.getParameter(V),stencilBits:e.getParameter(H),subpixelBits:e.getParameter(I),extensions:Object.keys(t).filter(function(e){return!!t[e]}),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:e.getParameter(U),lineWidthDims:e.getParameter(W),maxViewportDims:e.getParameter(K),maxCombinedTextureUnits:e.getParameter(X),maxCubeMapSize:e.getParameter(te),maxRenderbufferSize:e.getParameter(ne),maxTextureUnits:e.getParameter(Q),maxTextureSize:e.getParameter(G),maxAttributes:e.getParameter(q),maxVertexUniforms:e.getParameter(J),maxVertexTextureUnits:e.getParameter(Z),maxVaryingVectors:e.getParameter(Y),maxFragmentUniforms:e.getParameter(ee),glsl:e.getParameter(oe),renderer:e.getParameter(ie),vendor:e.getParameter(re),version:e.getParameter(ae),readFloat:a,npotTextureCube:u}},Se=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 Ce(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)||Se(e.data))}var we=function(e){return Object.keys(e).map(function(t){return e[t]})},Te={shape:je,flatten:Ae};function Ee(e,t,n){for(var r=0;r<t;++r)n[r]=e[r]}function De(e,t,n,r){for(var i=0,a=0;a<t;++a)for(var o=e[a],s=0;s<n;++s)r[i++]=o[s]}function Oe(e,t,n,r,i,a){for(var o=a,s=0;s<t;++s)for(var c=e[s],l=0;l<n;++l)for(var u=c[l],d=0;d<r;++d)i[o++]=u[d]}function ke(e,t,n,r,i){for(var a=1,o=n+1;o<t.length;++o)a*=t[o];var s=t[n];if(t.length-n===4){var c=t[n+1],l=t[n+2],u=t[n+3];for(o=0;o<s;++o)Oe(e[o],c,l,u,r,i),i+=a}else for(o=0;o<s;++o)ke(e[o],t,n+1,r,i),i+=a}function Ae(e,t,n,r){var i=1;if(t.length)for(var a=0;a<t.length;++a)i*=t[a];else i=0;var o=r||F.allocType(n,i);switch(t.length){case 0:break;case 1:Ee(e,t[0],o);break;case 2:De(e,t[0],t[1],o);break;case 3:Oe(e,t[0],t[1],t[2],o,0);break;default:ke(e,t,0,o,0)}return o}function je(e){for(var t=[],n=e;n.length;n=n[0])t.push(n.length);return t}var Me={"[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},Ne={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},Pe={dynamic:35048,stream:35040,static:35044},Fe=Te.flatten,Ie=Te.shape,Le=35044,Re=35040,ze=5121,Be=5126,Ve=[];Ve[5120]=1,Ve[5122]=2,Ve[5124]=4,Ve[5121]=1,Ve[5123]=2,Ve[5125]=4,Ve[5126]=4;function He(e){return Me[Object.prototype.toString.call(e)]|0}function Ue(e,t){for(var n=0;n<t.length;++n)e[n]=t[n]}function We(e,t,n,r,i,a,o){for(var s=0,c=0;c<n;++c)for(var l=0;l<r;++l)e[s++]=t[i*c+a*l+o]}function Ge(e,t,n,r){var i=0,a={};function o(t){this.id=i++,this.buffer=e.createBuffer(),this.type=t,this.usage=Le,this.byteLength=0,this.dimension=1,this.dtype=ze,this.persistentData=null,n.profile&&(this.stats={size:0})}o.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},o.prototype.destroy=function(){f(this)};var s=[];function c(e,t){var n=s.pop();return n||=new o(e),n.bind(),d(n,t,Re,0,1,!1),n}function l(e){s.push(e)}function u(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function d(e,t,n,r,i,a){var o;if(e.usage=n,Array.isArray(t)){if(e.dtype=r||Be,t.length>0){var s;if(Array.isArray(t[0])){o=Ie(t);for(var c=1,l=1;l<o.length;++l)c*=o[l];e.dimension=c,s=Fe(t,o,e.dtype),u(e,s,n),a?e.persistentData=s:F.freeType(s)}else if(typeof t[0]==`number`){e.dimension=i;var d=F.allocType(e.dtype,t.length);Ue(d,t),u(e,d,n),a?e.persistentData=d:F.freeType(d)}else Se(t[0])&&(e.dimension=t[0].length,e.dtype=r||He(t[0])||Be,s=Fe(t,[t.length,t[0].length],e.dtype),u(e,s,n),a?e.persistentData=s:F.freeType(s))}}else if(Se(t))e.dtype=r||He(t),e.dimension=i,u(e,t,n),a&&(e.persistentData=new Uint8Array(new Uint8Array(t.buffer)));else if(Ce(t)){o=t.shape;var f=t.stride,p=t.offset,m=0,h=0,g=0,_=0;o.length===1?(m=o[0],h=1,g=f[0],_=0):o.length===2&&(m=o[0],h=o[1],g=f[0],_=f[1]),e.dtype=r||He(t.data)||Be,e.dimension=h;var v=F.allocType(e.dtype,m*h);We(v,t.data,m,h,g,_,p),u(e,v,n),a?e.persistentData=v:F.freeType(v)}else t instanceof ArrayBuffer&&(e.dtype=ze,e.dimension=i,u(e,t,n),a&&(e.persistentData=new Uint8Array(new Uint8Array(t))))}function f(n){t.bufferCount--,r(n);var i=n.buffer;e.deleteBuffer(i),n.buffer=null,delete a[n.id]}function p(r,i,s,c){t.bufferCount++;var l=new o(i);a[l.id]=l;function u(t){var r=Le,i=null,a=0,o=0,s=1;return Array.isArray(t)||Se(t)||Ce(t)||t instanceof ArrayBuffer?i=t:typeof t==`number`?a=t|0:t&&(`data`in t&&(i=t.data),`usage`in t&&(r=Pe[t.usage]),`type`in t&&(o=Ne[t.type]),`dimension`in t&&(s=t.dimension|0),`length`in t&&(a=t.length|0)),l.bind(),i?d(l,i,r,o,s,c):(a&&e.bufferData(l.type,a,r),l.dtype=o||ze,l.usage=r,l.dimension=s,l.byteLength=a),n.profile&&(l.stats.size=l.byteLength*Ve[l.dtype]),u}function p(t,n){e.bufferSubData(l.type,n,t)}function m(e,t){var n=(t||0)|0,r;if(l.bind(),Se(e)||e instanceof ArrayBuffer)p(e,n);else if(Array.isArray(e)){if(e.length>0){if(typeof e[0]==`number`){var i=F.allocType(l.dtype,e.length);Ue(i,e),p(i,n),F.freeType(i)}else if(Array.isArray(e[0])||Se(e[0])){r=Ie(e);var a=Fe(e,r,l.dtype);p(a,n),F.freeType(a)}}}else if(Ce(e)){r=e.shape;var o=e.stride,s=0,c=0,d=0,f=0;r.length===1?(s=r[0],c=1,d=o[0],f=0):r.length===2&&(s=r[0],c=r[1],d=o[0],f=o[1]);var m=Array.isArray(e.data)?l.dtype:He(e.data),h=F.allocType(m,s*c);We(h,e.data,s,c,d,f,e.offset),p(h,n),F.freeType(h)}return u}return s||u(r),u._reglType=`buffer`,u._buffer=l,u.subdata=m,n.profile&&(u.stats=l.stats),u.destroy=function(){f(l)},u}function m(){we(a).forEach(function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)})}return n.profile&&(t.getTotalBufferSize=function(){var e=0;return Object.keys(a).forEach(function(t){e+=a[t].stats.size}),e}),{create:p,createStream:c,destroyStream:l,clear:function(){we(a).forEach(f),s.forEach(f)},getBuffer:function(e){return e&&e._buffer instanceof o?e._buffer:null},restore:m,_initBuffer:d}}var Ke={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},qe=0,Je=1,Ye=4,Xe=5120,Ze=5121,Qe=5122,$e=5123,et=5124,tt=5125,nt=34963,rt=35040,it=35044;function at(e,t,n,r){var i={},a=0,o={uint8:Ze,uint16:$e};t.oes_element_index_uint&&(o.uint32=tt);function s(e){this.id=a++,i[this.id]=this,this.buffer=e,this.primType=Ye,this.vertCount=0,this.type=0}s.prototype.bind=function(){this.buffer.bind()};var c=[];function l(e){var t=c.pop();return t||=new s(n.create(null,nt,!0,!1)._buffer),d(t,e,rt,-1,-1,0,0),t}function u(e){c.push(e)}function d(r,i,a,o,s,c,l){r.buffer.bind();var u;if(i){var d=l;!l&&(!Se(i)||Ce(i)&&!Se(i.data))&&(d=t.oes_element_index_uint?tt:$e),n._initBuffer(r.buffer,i,a,d,3)}else e.bufferData(nt,c,a),r.buffer.dtype=u||Ze,r.buffer.usage=a,r.buffer.dimension=3,r.buffer.byteLength=c;if(u=l,!l){switch(r.buffer.dtype){case Ze:case Xe:u=Ze;break;case $e:case Qe:u=$e;break;case tt:case et:u=tt;break;default:}r.buffer.dtype=u}r.type=u;var f=s;f<0&&(f=r.buffer.byteLength,u===$e?f>>=1:u===tt&&(f>>=2)),r.vertCount=f;var p=o;if(o<0){p=Ye;var m=r.buffer.dimension;m===1&&(p=qe),m===2&&(p=Je),m===3&&(p=Ye)}r.primType=p}function f(e){r.elementsCount--,delete i[e.id],e.buffer.destroy(),e.buffer=null}function p(e,t){var i=n.create(null,nt,!0),a=new s(i._buffer);r.elementsCount++;function c(e){if(!e)i(),a.primType=Ye,a.vertCount=0,a.type=Ze;else if(typeof e==`number`)i(e),a.primType=Ye,a.vertCount=e|0,a.type=Ze;else{var t=null,n=it,r=-1,s=-1,l=0,u=0;Array.isArray(e)||Se(e)||Ce(e)?t=e:(`data`in e&&(t=e.data),`usage`in e&&(n=Pe[e.usage]),`primitive`in e&&(r=Ke[e.primitive]),`count`in e&&(s=e.count|0),`type`in e&&(u=o[e.type]),`length`in e?l=e.length|0:(l=s,u===$e||u===Qe?l*=2:(u===tt||u===et)&&(l*=4))),d(a,t,n,r,s,l,u)}return c}return c(e),c._reglType=`elements`,c._elements=a,c.subdata=function(e,t){return i.subdata(e,t),c},c.destroy=function(){f(a)},c}return{create:p,createStream:l,destroyStream:u,getElements:function(e){return typeof e==`function`&&e._elements instanceof s?e._elements:null},clear:function(){we(i).forEach(f)}}}var ot=new Float32Array(1),st=new Uint32Array(ot.buffer),ct=5123;function lt(e){for(var t=F.allocType(ct,e.length),n=0;n<e.length;++n)if(isNaN(e[n]))t[n]=65535;else if(e[n]===1/0)t[n]=31744;else if(e[n]===-1/0)t[n]=64512;else{ot[0]=e[n];var r=st[0],i=r>>>31<<15,a=(r<<1>>>24)-127,o=r>>13&1023;if(a<-24)t[n]=i;else if(a<-14){var s=-14-a;t[n]=i+(o+1024>>s)}else a>15?t[n]=i+31744:t[n]=i+(a+15<<10)+o}return t}function ut(e){return Array.isArray(e)||Se(e)}var $=34467,dt=3553,ft=34067,pt=34069,mt=6408,ht=6406,gt=6407,_t=6409,vt=6410,yt=32854,bt=32855,xt=36194,St=32819,Ct=32820,wt=33635,Tt=34042,Et=6402,Dt=34041,Ot=35904,kt=35906,At=36193,jt=33776,Mt=33777,Nt=33778,Pt=33779,Ft=35986,It=35987,Lt=34798,Rt=35840,zt=35841,Bt=35842,Vt=35843,Ht=36196,Ut=5121,Wt=5123,Gt=5125,Kt=5126,qt=10242,Jt=10243,Yt=10497,Xt=33071,Zt=33648,Qt=10240,$t=10241,en=9728,tn=9729,nn=9984,rn=9985,an=9986,on=9987,sn=33170,cn=4352,ln=4353,un=4354,dn=34046,fn=3317,pn=37440,mn=37441,hn=37443,gn=37444,_n=33984,vn=[nn,an,rn,on],yn=[0,_t,vt,gt,mt],bn={};bn[_t]=bn[ht]=bn[Et]=1,bn[Dt]=bn[vt]=2,bn[gt]=bn[Ot]=3,bn[mt]=bn[kt]=4;function xn(e){return`[object `+e+`]`}var Sn=xn(`HTMLCanvasElement`),Cn=xn(`OffscreenCanvas`),wn=xn(`CanvasRenderingContext2D`),Tn=xn(`ImageBitmap`),En=xn(`HTMLImageElement`),Dn=xn(`HTMLVideoElement`),On=Object.keys(Me).concat([Sn,Cn,wn,Tn,En,Dn]),kn=[];kn[Ut]=1,kn[Kt]=4,kn[At]=2,kn[Wt]=2,kn[Gt]=4;var An=[];An[yt]=2,An[bt]=2,An[xt]=2,An[Dt]=4,An[jt]=.5,An[Mt]=.5,An[Nt]=1,An[Pt]=1,An[Ft]=.5,An[It]=1,An[Lt]=1,An[Rt]=.5,An[zt]=.25,An[Bt]=.5,An[Vt]=.25,An[Ht]=.5;function jn(e){return Array.isArray(e)&&(e.length===0||typeof e[0]==`number`)}function Mn(e){return Array.isArray(e)?!(e.length===0||!ut(e[0])):!1}function Nn(e){return Object.prototype.toString.call(e)}function Pn(e){return Nn(e)===Sn}function Fn(e){return Nn(e)===Cn}function In(e){return Nn(e)===wn}function Ln(e){return Nn(e)===Tn}function Rn(e){return Nn(e)===En}function zn(e){return Nn(e)===Dn}function Bn(e){if(!e)return!1;var t=Nn(e);return On.indexOf(t)>=0?!0:jn(e)||Mn(e)||Ce(e)}function Vn(e){return Me[Object.prototype.toString.call(e)]|0}function Hn(e,t){var n=t.length;switch(e.type){case Ut:case Wt:case Gt:case Kt:var r=F.allocType(e.type,n);r.set(t),e.data=r;break;case At:e.data=lt(t);break;default:}}function Un(e,t){return F.allocType(e.type===At?Kt:e.type,t)}function Wn(e,t){e.type===At?(e.data=lt(t),F.freeType(t)):e.data=t}function Gn(e,t,n,r,i,a){for(var o=e.width,s=e.height,c=e.channels,l=Un(e,o*s*c),u=0,d=0;d<s;++d)for(var f=0;f<o;++f)for(var p=0;p<c;++p)l[u++]=t[n*f+r*d+i*p+a];Wn(e,l)}function Kn(e,t,n,r,i,a){var o;if(o=An[e]===void 0?bn[e]*kn[t]:An[e],a&&(o*=6),i){for(var s=0,c=n;c>=1;)s+=o*c*c,c/=2;return s}else return o*n*r}function qn(t,n,r,i,a,o,s){var c={"don't care":cn,"dont care":cn,nice:un,fast:ln},l={repeat:Yt,clamp:Xt,mirror:Zt},u={nearest:en,linear:tn},d=e({mipmap:on,"nearest mipmap nearest":nn,"linear mipmap nearest":rn,"nearest mipmap linear":an,"linear mipmap linear":on},u),f={none:0,browser:gn},p={uint8:Ut,rgba4:St,rgb565:wt,"rgb5 a1":Ct},m={alpha:ht,luminance:_t,"luminance alpha":vt,rgb:gt,rgba:mt,rgba4:yt,"rgb5 a1":bt,rgb565:xt},h={};n.ext_srgb&&(m.srgb=Ot,m.srgba=kt),n.oes_texture_float&&(p.float32=p.float=Kt),n.oes_texture_half_float&&(p.float16=p[`half float`]=At),n.webgl_depth_texture&&(e(m,{depth:Et,"depth stencil":Dt}),e(p,{uint16:Wt,uint32:Gt,"depth stencil":Tt})),n.webgl_compressed_texture_s3tc&&e(h,{"rgb s3tc dxt1":jt,"rgba s3tc dxt1":Mt,"rgba s3tc dxt3":Nt,"rgba s3tc dxt5":Pt}),n.webgl_compressed_texture_atc&&e(h,{"rgb atc":Ft,"rgba atc explicit alpha":It,"rgba atc interpolated alpha":Lt}),n.webgl_compressed_texture_pvrtc&&e(h,{"rgb pvrtc 4bppv1":Rt,"rgb pvrtc 2bppv1":zt,"rgba pvrtc 4bppv1":Bt,"rgba pvrtc 2bppv1":Vt}),n.webgl_compressed_texture_etc1&&(h[`rgb etc1`]=Ht);var g=Array.prototype.slice.call(t.getParameter($));Object.keys(h).forEach(function(e){var t=h[e];g.indexOf(t)>=0&&(m[e]=t)});var _=Object.keys(m);r.textureFormats=_;var v=[];Object.keys(m).forEach(function(e){var t=m[e];v[t]=e});var y=[];Object.keys(p).forEach(function(e){var t=p[e];y[t]=e});var b=[];Object.keys(u).forEach(function(e){var t=u[e];b[t]=e});var x=[];Object.keys(d).forEach(function(e){var t=d[e];x[t]=e});var S=[];Object.keys(l).forEach(function(e){var t=l[e];S[t]=e});var C=_.reduce(function(e,t){var r=m[t];return r===_t||r===ht||r===_t||r===vt||r===Et||r===Dt||n.ext_srgb&&(r===Ot||r===kt)?e[r]=r:r===bt||t.indexOf(`rgba`)>=0?e[r]=mt:e[r]=gt,e},{});function w(){this.internalformat=mt,this.format=mt,this.type=Ut,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=gn,this.width=0,this.height=0,this.channels=0}function T(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function E(e,t){if(!(typeof t!=`object`||!t)){`premultiplyAlpha`in t&&(e.premultiplyAlpha=t.premultiplyAlpha),`flipY`in t&&(e.flipY=t.flipY),`alignment`in t&&(e.unpackAlignment=t.alignment),`colorSpace`in t&&(e.colorSpace=f[t.colorSpace]),`type`in t&&(e.type=p[t.type]);var n=e.width,r=e.height,i=e.channels,a=!1;`shape`in t?(n=t.shape[0],r=t.shape[1],t.shape.length===3&&(i=t.shape[2],a=!0)):(`radius`in t&&(n=r=t.radius),`width`in t&&(n=t.width),`height`in t&&(r=t.height),`channels`in t&&(i=t.channels,a=!0)),e.width=n|0,e.height=r|0,e.channels=i|0;var o=!1;if(`format`in t){var s=t.format;e.format=C[e.internalformat=m[s]],s in p&&(`type`in t||(e.type=p[s])),s in h&&(e.compressed=!0),o=!0}!a&&o?e.channels=bn[e.format]:a&&!o&&e.channels!==yn[e.format]&&(e.format=e.internalformat=yn[e.channels])}}function D(e){t.pixelStorei(pn,e.flipY),t.pixelStorei(mn,e.premultiplyAlpha),t.pixelStorei(hn,e.colorSpace),t.pixelStorei(fn,e.unpackAlignment)}function O(){w.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function k(e,t){var n=null;if(Bn(t)?n=t:t&&(E(e,t),`x`in t&&(e.xOffset=t.x|0),`y`in t&&(e.yOffset=t.y|0),Bn(t.data)&&(n=t.data)),t.copy){var r=a.viewportWidth,i=a.viewportHeight;e.width=e.width||r-e.xOffset,e.height=e.height||i-e.yOffset,e.needsCopy=!0}else if(!n)e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;else if(Se(n))e.channels=e.channels||4,e.data=n,!(`type`in t)&&e.type===Ut&&(e.type=Vn(n));else if(jn(n))e.channels=e.channels||4,Hn(e,n),e.alignment=1,e.needsFree=!0;else if(Ce(n)){var o=n.data;!Array.isArray(o)&&e.type===Ut&&(e.type=Vn(o));var s=n.shape,c=n.stride,l,u,d,f,p,m;s.length===3?(d=s[2],m=c[2]):(d=1,m=1),l=s[0],u=s[1],f=c[0],p=c[1],e.alignment=1,e.width=l,e.height=u,e.channels=d,e.format=e.internalformat=yn[d],e.needsFree=!0,Gn(e,o,f,p,m,n.offset)}else if(Pn(n)||Fn(n)||In(n))Pn(n)||Fn(n)?e.element=n:e.element=n.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(Ln(n))e.element=n,e.width=n.width,e.height=n.height,e.channels=4;else if(Rn(n))e.element=n,e.width=n.naturalWidth,e.height=n.naturalHeight,e.channels=4;else if(zn(n))e.element=n,e.width=n.videoWidth,e.height=n.videoHeight,e.channels=4;else if(Mn(n)){var h=e.width||n[0].length,g=e.height||n.length,_=e.channels;ut(n[0][0])?_||=n[0][0].length:_||=1;for(var v=Te.shape(n),y=1,b=0;b<v.length;++b)y*=v[b];var x=Un(e,y);Te.flatten(n,v,``,x),Wn(e,x),e.alignment=1,e.width=h,e.height=g,e.channels=_,e.format=e.internalformat=yn[_],e.needsFree=!0}e.type===Kt||e.type}function A(e,n,r){var a=e.element,o=e.data,s=e.internalformat,c=e.format,l=e.type,u=e.width,d=e.height;D(e),a?t.texImage2D(n,r,c,c,l,a):e.compressed?t.compressedTexImage2D(n,r,s,u,d,0,o):e.needsCopy?(i(),t.copyTexImage2D(n,r,c,e.xOffset,e.yOffset,u,d,0)):t.texImage2D(n,r,c,u,d,0,c,l,o||null)}function j(e,n,r,a,o){var s=e.element,c=e.data,l=e.internalformat,u=e.format,d=e.type,f=e.width,p=e.height;D(e),s?t.texSubImage2D(n,o,r,a,u,d,s):e.compressed?t.compressedTexSubImage2D(n,o,r,a,l,f,p,c):e.needsCopy?(i(),t.copyTexSubImage2D(n,o,r,a,e.xOffset,e.yOffset,f,p)):t.texSubImage2D(n,o,r,a,f,p,u,d,c)}var M=[];function N(){return M.pop()||new O}function P(e){e.needsFree&&F.freeType(e.data),O.call(e),M.push(e)}function I(){w.call(this),this.genMipmaps=!1,this.mipmapHint=cn,this.mipmask=0,this.images=Array(16)}function L(e,t,n){var r=e.images[0]=N();e.mipmask=1,r.width=e.width=t,r.height=e.height=n,r.channels=e.channels=4}function R(e,t){var n=null;if(Bn(t))n=e.images[0]=N(),T(n,e),k(n,t),e.mipmask=1;else if(E(e,t),Array.isArray(t.mipmap))for(var r=t.mipmap,i=0;i<r.length;++i)n=e.images[i]=N(),T(n,e),n.width>>=i,n.height>>=i,k(n,r[i]),e.mipmask|=1<<i;else n=e.images[0]=N(),T(n,e),k(n,t),e.mipmask=1;T(e,e.images[0]),e.compressed&&(e.internalformat===jt||e.internalformat===Mt||e.internalformat===Nt||e.internalformat)}function z(e,t){for(var n=e.images,r=0;r<n.length;++r){if(!n[r])return;A(n[r],t,r)}}var B=[];function V(){var e=B.pop()||new I;w.call(e),e.mipmask=0;for(var t=0;t<16;++t)e.images[t]=null;return e}function H(e){for(var t=e.images,n=0;n<t.length;++n)t[n]&&P(t[n]),t[n]=null;B.push(e)}function U(){this.minFilter=en,this.magFilter=en,this.wrapS=Xt,this.wrapT=Xt,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=cn}function W(e,t){`min`in t&&(e.minFilter=d[t.min],vn.indexOf(e.minFilter)>=0&&!(`faces`in t)&&(e.genMipmaps=!0)),`mag`in t&&(e.magFilter=u[t.mag]);var n=e.wrapS,r=e.wrapT;if(`wrap`in t){var i=t.wrap;typeof i==`string`?n=r=l[i]:Array.isArray(i)&&(n=l[i[0]],r=l[i[1]])}else `wrapS`in t&&(n=l[t.wrapS]),`wrapT`in t&&(r=l[t.wrapT]);if(e.wrapS=n,e.wrapT=r,`anisotropic`in t&&(t.anisotropic,e.anisotropic=t.anisotropic),`mipmap`in t){var a=!1;switch(typeof t.mipmap){case`string`:e.mipmapHint=c[t.mipmap],e.genMipmaps=!0,a=!0;break;case`boolean`:a=e.genMipmaps=t.mipmap;break;case`object`:e.genMipmaps=!1,a=!0;break;default:}a&&!(`min`in t)&&(e.minFilter=nn)}}function G(e,r){t.texParameteri(r,$t,e.minFilter),t.texParameteri(r,Qt,e.magFilter),t.texParameteri(r,qt,e.wrapS),t.texParameteri(r,Jt,e.wrapT),n.ext_texture_filter_anisotropic&&t.texParameteri(r,dn,e.anisotropic),e.genMipmaps&&(t.hint(sn,e.mipmapHint),t.generateMipmap(r))}var K=0,q={},J=r.maxTextureUnits,Y=Array(J).map(function(){return null});function X(e){w.call(this),this.mipmask=0,this.internalformat=mt,this.id=K++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new U,s.profile&&(this.stats={size:0})}function Z(e){t.activeTexture(_n),t.bindTexture(e.target,e.texture)}function Q(){var e=Y[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(dt,null)}function ee(e){var n=e.texture,r=e.unit,i=e.target;r>=0&&(t.activeTexture(_n+r),t.bindTexture(i,null),Y[r]=null),t.deleteTexture(n),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete q[e.id],o.textureCount--}e(X.prototype,{bind:function(){var e=this;e.bindCount+=1;var n=e.unit;if(n<0){for(var r=0;r<J;++r){var i=Y[r];if(i){if(i.bindCount>0)continue;i.unit=-1}Y[r]=e,n=r;break}s.profile&&o.maxTextureUnits<n+1&&(o.maxTextureUnits=n+1),e.unit=n,t.activeTexture(_n+n),t.bindTexture(e.target,e.texture)}return n},unbind:function(){--this.bindCount},decRef:function(){--this.refCount<=0&&ee(this)}});function te(e,n){var r=new X(dt);q[r.id]=r,o.textureCount++;function i(e,t){var n=r.texInfo;U.call(n);var a=V();return typeof e==`number`?typeof t==`number`?L(a,e|0,t|0):L(a,e|0,e|0):e?(W(n,e),R(a,e)):L(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,T(r,a),r.internalformat=a.internalformat,i.width=a.width,i.height=a.height,Z(r),z(a,dt),G(n,dt),Q(),H(a),s.profile&&(r.stats.size=Kn(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),i.format=v[r.internalformat],i.type=y[r.type],i.mag=b[n.magFilter],i.min=x[n.minFilter],i.wrapS=S[n.wrapS],i.wrapT=S[n.wrapT],i}function a(e,t,n,a){var o=t|0,s=n|0,c=a|0,l=N();return T(l,r),l.width=0,l.height=0,k(l,e),l.width=l.width||(r.width>>c)-o,l.height=l.height||(r.height>>c)-s,Z(r),j(l,dt,o,s,c),Q(),P(l),i}function c(e,n){var a=e|0,o=n|0||a;if(a===r.width&&o===r.height)return i;i.width=r.width=a,i.height=r.height=o,Z(r);for(var c=0;r.mipmask>>c;++c){var l=a>>c,u=o>>c;if(!l||!u)break;t.texImage2D(dt,c,r.format,l,u,0,r.format,r.type,null)}return Q(),s.profile&&(r.stats.size=Kn(r.internalformat,r.type,a,o,!1,!1)),i}return i(e,n),i.subimage=a,i.resize=c,i._reglType=`texture2d`,i._texture=r,s.profile&&(i.stats=r.stats),i.destroy=function(){r.decRef()},i}function ne(e,n,r,i,a,c){var l=new X(ft);q[l.id]=l,o.cubeCount++;var u=[,,,,,,];function d(e,t,n,r,i,a){var o,c=l.texInfo;for(U.call(c),o=0;o<6;++o)u[o]=V();if(typeof e==`number`||!e){var f=e|0||1;for(o=0;o<6;++o)L(u[o],f,f)}else if(typeof e==`object`)if(t)R(u[0],e),R(u[1],t),R(u[2],n),R(u[3],r),R(u[4],i),R(u[5],a);else if(W(c,e),E(l,e),`faces`in e){var p=e.faces;for(o=0;o<6;++o)T(u[o],l),R(u[o],p[o])}else for(o=0;o<6;++o)R(u[o],e);for(T(l,u[0]),c.genMipmaps?l.mipmask=(u[0].width<<1)-1:l.mipmask=u[0].mipmask,l.internalformat=u[0].internalformat,d.width=u[0].width,d.height=u[0].height,Z(l),o=0;o<6;++o)z(u[o],pt+o);for(G(c,ft),Q(),s.profile&&(l.stats.size=Kn(l.internalformat,l.type,d.width,d.height,c.genMipmaps,!0)),d.format=v[l.internalformat],d.type=y[l.type],d.mag=b[c.magFilter],d.min=x[c.minFilter],d.wrapS=S[c.wrapS],d.wrapT=S[c.wrapT],o=0;o<6;++o)H(u[o]);return d}function f(e,t,n,r,i){var a=n|0,o=r|0,s=i|0,c=N();return T(c,l),c.width=0,c.height=0,k(c,t),c.width=c.width||(l.width>>s)-a,c.height=c.height||(l.height>>s)-o,Z(l),j(c,pt+e,a,o,s),Q(),P(c),d}function p(e){var n=e|0;if(n!==l.width){d.width=l.width=n,d.height=l.height=n,Z(l);for(var r=0;r<6;++r)for(var i=0;l.mipmask>>i;++i)t.texImage2D(pt+r,i,l.format,n>>i,n>>i,0,l.format,l.type,null);return Q(),s.profile&&(l.stats.size=Kn(l.internalformat,l.type,d.width,d.height,!1,!0)),d}}return d(e,n,r,i,a,c),d.subimage=f,d.resize=p,d._reglType=`textureCube`,d._texture=l,s.profile&&(d.stats=l.stats),d.destroy=function(){l.decRef()},d}function re(){for(var e=0;e<J;++e)t.activeTexture(_n+e),t.bindTexture(dt,null),Y[e]=null;we(q).forEach(ee),o.cubeCount=0,o.textureCount=0}s.profile&&(o.getTotalTextureSize=function(){var e=0;return Object.keys(q).forEach(function(t){e+=q[t].stats.size}),e});function ie(){for(var e=0;e<J;++e){var n=Y[e];n&&(n.bindCount=0,n.unit=-1,Y[e]=null)}we(q).forEach(function(e){e.texture=t.createTexture(),t.bindTexture(e.target,e.texture);for(var n=0;n<32;++n)if(e.mipmask&1<<n)if(e.target===dt)t.texImage2D(dt,n,e.internalformat,e.width>>n,e.height>>n,0,e.internalformat,e.type,null);else for(var r=0;r<6;++r)t.texImage2D(pt+r,n,e.internalformat,e.width>>n,e.height>>n,0,e.internalformat,e.type,null);G(e.texInfo,e.target)})}function ae(){for(var e=0;e<J;++e){var n=Y[e];n&&(n.bindCount=0,n.unit=-1,Y[e]=null),t.activeTexture(_n+e),t.bindTexture(dt,null),t.bindTexture(ft,null)}}return{create2D:te,createCube:ne,clear:re,getTexture:function(e){return null},restore:ie,refresh:ae}}var Jn=36161,Yn=32854,Xn=32855,Zn=36194,Qn=33189,$n=36168,er=34041,tr=35907,nr=34836,rr=34842,ir=34843,ar=[];ar[Yn]=2,ar[Xn]=2,ar[Zn]=2,ar[Qn]=2,ar[$n]=1,ar[er]=4,ar[tr]=4,ar[nr]=16,ar[rr]=8,ar[ir]=6;function or(e,t,n){return ar[e]*t*n}var sr=function(e,t,n,r,i){var a={rgba4:Yn,rgb565:Zn,"rgb5 a1":Xn,depth:Qn,stencil:$n,"depth stencil":er};t.ext_srgb&&(a.srgba=tr),t.ext_color_buffer_half_float&&(a.rgba16f=rr,a.rgb16f=ir),t.webgl_color_buffer_float&&(a.rgba32f=nr);var o=[];Object.keys(a).forEach(function(e){var t=a[e];o[t]=e});var s=0,c={};function l(e){this.id=s++,this.refCount=1,this.renderbuffer=e,this.format=Yn,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}l.prototype.decRef=function(){--this.refCount<=0&&u(this)};function u(t){var n=t.renderbuffer;e.bindRenderbuffer(Jn,null),e.deleteRenderbuffer(n),t.renderbuffer=null,t.refCount=0,delete c[t.id],r.renderbufferCount--}function d(t,n){var s=new l(e.createRenderbuffer());c[s.id]=s,r.renderbufferCount++;function u(t,n){var r=0,c=0,l=Yn;if(typeof t==`object`&&t){var d=t;if(`shape`in d){var f=d.shape;r=f[0]|0,c=f[1]|0}else `radius`in d&&(r=c=d.radius|0),`width`in d&&(r=d.width|0),`height`in d&&(c=d.height|0);`format`in d&&(l=a[d.format])}else typeof t==`number`?(r=t|0,c=typeof n==`number`?n|0:r):t||(r=c=1);if(!(r===s.width&&c===s.height&&l===s.format))return u.width=s.width=r,u.height=s.height=c,s.format=l,e.bindRenderbuffer(Jn,s.renderbuffer),e.renderbufferStorage(Jn,l,r,c),i.profile&&(s.stats.size=or(s.format,s.width,s.height)),u.format=o[s.format],u}function d(t,n){var r=t|0,a=n|0||r;return r===s.width&&a===s.height||(u.width=s.width=r,u.height=s.height=a,e.bindRenderbuffer(Jn,s.renderbuffer),e.renderbufferStorage(Jn,s.format,r,a),i.profile&&(s.stats.size=or(s.format,s.width,s.height))),u}return u(t,n),u.resize=d,u._reglType=`renderbuffer`,u._renderbuffer=s,i.profile&&(u.stats=s.stats),u.destroy=function(){s.decRef()},u}i.profile&&(r.getTotalRenderbufferSize=function(){var e=0;return Object.keys(c).forEach(function(t){e+=c[t].stats.size}),e});function f(){we(c).forEach(function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(Jn,t.renderbuffer),e.renderbufferStorage(Jn,t.format,t.width,t.height)}),e.bindRenderbuffer(Jn,null)}return{create:d,clear:function(){we(c).forEach(u)},restore:f}},cr=36160,lr=36161,ur=3553,dr=34069,fr=36064,pr=36096,mr=36128,hr=33306,gr=36193,_r=5121,vr=5126,yr=6407,br=6408,xr=[];xr[br]=4,xr[yr]=3;var Sr=[];Sr[_r]=1,Sr[vr]=4,Sr[gr]=2;function Cr(t,n,r,i,a,o){var s={cur:null,next:null,dirty:!1,setFBO:null},c=[`rgba`],l=[`rgba4`,`rgb565`,`rgb5 a1`];n.ext_srgb&&l.push(`srgba`),n.ext_color_buffer_half_float&&l.push(`rgba16f`,`rgb16f`),n.webgl_color_buffer_float&&l.push(`rgba32f`);var u=[`uint8`];n.oes_texture_half_float&&u.push(`half float`,`float16`),n.oes_texture_float&&u.push(`float`,`float32`);function d(e,t,n){this.target=e,this.texture=t,this.renderbuffer=n;var r=0,i=0;t?(r=t.width,i=t.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function f(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function p(e,t,n){if(e)if(e.texture){var r=e.texture._texture;Math.max(1,r.width),Math.max(1,r.height),r.refCount+=1}else{var i=e.renderbuffer._renderbuffer;i.refCount+=1}}function m(e,n){n&&(n.texture?t.framebufferTexture2D(cr,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(cr,e,lr,n.renderbuffer._renderbuffer.renderbuffer))}function h(e){var t=ur,n=null,r=null,i=e;typeof e==`object`&&(i=e.data,`target`in e&&(t=e.target|0));var a=i._reglType;return a===`texture2d`||a===`textureCube`?n=i:a===`renderbuffer`&&(r=i,t=lr),new d(t,n,r)}function g(e,t,n,r,o){if(n){var s=i.create2D({width:e,height:t,format:r,type:o});return s._texture.refCount=0,new d(ur,s,null)}else{var c=a.create({width:e,height:t,format:r});return c._renderbuffer.refCount=0,new d(lr,null,c)}}function _(e){return e&&(e.texture||e.renderbuffer)}function v(e,t,n){e&&(e.texture?e.texture.resize(t,n):e.renderbuffer&&e.renderbuffer.resize(t,n),e.width=t,e.height=n)}var y=0,b={};function x(){this.id=y++,b[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function S(e){e.colorAttachments.forEach(f),f(e.depthAttachment),f(e.stencilAttachment),f(e.depthStencilAttachment)}function C(e){var n=e.framebuffer;t.deleteFramebuffer(n),e.framebuffer=null,o.framebufferCount--,delete b[e.id]}function w(e){var n;t.bindFramebuffer(cr,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)m(fr+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(cr,fr+n,ur,null,0);t.framebufferTexture2D(cr,hr,ur,null,0),t.framebufferTexture2D(cr,pr,ur,null,0),t.framebufferTexture2D(cr,mr,ur,null,0),m(pr,e.depthAttachment),m(mr,e.stencilAttachment),m(hr,e.depthStencilAttachment),t.checkFramebufferStatus(cr),t.isContextLost(),t.bindFramebuffer(cr,s.next?s.next.framebuffer:null),s.cur=s.next,t.getError()}function T(t,n){var r=new x;o.framebufferCount++;function i(e,t){var n,a=0,o=0,s=!0,u=!0,d=null,f=!0,m=`rgba`,v=`uint8`,y=1,b=null,x=null,C=null,T=!1;if(typeof e==`number`)a=e|0,o=t|0||a;else if(!e)a=o=1;else{var E=e;if(`shape`in E){var D=E.shape;a=D[0],o=D[1]}else `radius`in E&&(a=o=E.radius),`width`in E&&(a=E.width),`height`in E&&(o=E.height);(`color`in E||`colors`in E)&&(d=E.color||E.colors),d||(`colorCount`in E&&(y=E.colorCount|0),`colorTexture`in E&&(f=!!E.colorTexture,m=`rgba4`),`colorType`in E&&(v=E.colorType,f||(v===`half float`||v===`float16`?m=`rgba16f`:(v===`float`||v===`float32`)&&(m=`rgba32f`))),`colorFormat`in E&&(m=E.colorFormat,c.indexOf(m)>=0?f=!0:l.indexOf(m)>=0&&(f=!1))),(`depthTexture`in E||`depthStencilTexture`in E)&&(T=!!(E.depthTexture||E.depthStencilTexture)),`depth`in E&&(typeof E.depth==`boolean`?s=E.depth:(b=E.depth,u=!1)),`stencil`in E&&(typeof E.stencil==`boolean`?u=E.stencil:(x=E.stencil,s=!1)),`depthStencil`in E&&(typeof E.depthStencil==`boolean`?s=u=E.depthStencil:(C=E.depthStencil,s=!1,u=!1))}var O=null,k=null,A=null,j=null;if(Array.isArray(d))O=d.map(h);else if(d)O=[h(d)];else for(O=Array(y),n=0;n<y;++n)O[n]=g(a,o,f,m,v);a||=O[0].width,o||=O[0].height,b?k=h(b):s&&!u&&(k=g(a,o,T,`depth`,`uint32`)),x?A=h(x):u&&!s&&(A=g(a,o,!1,`stencil`,`uint8`)),C?j=h(C):!b&&!x&&u&&s&&(j=g(a,o,T,`depth stencil`,`depth stencil`));var M=null;for(n=0;n<O.length;++n)if(p(O[n],a,o),O[n]&&O[n].texture){var N=xr[O[n].texture._texture.format]*Sr[O[n].texture._texture.type];M===null&&(M=N)}return p(k,a,o),p(A,a,o),p(j,a,o),S(r),r.width=a,r.height=o,r.colorAttachments=O,r.depthAttachment=k,r.stencilAttachment=A,r.depthStencilAttachment=j,i.color=O.map(_),i.depth=_(k),i.stencil=_(A),i.depthStencil=_(j),i.width=r.width,i.height=r.height,w(r),i}function a(e,t){var n=Math.max(e|0,1),a=Math.max(t|0||n,1);if(n===r.width&&a===r.height)return i;for(var o=r.colorAttachments,s=0;s<o.length;++s)v(o[s],n,a);return v(r.depthAttachment,n,a),v(r.stencilAttachment,n,a),v(r.depthStencilAttachment,n,a),r.width=i.width=n,r.height=i.height=a,w(r),i}return i(t,n),e(i,{resize:a,_reglType:`framebuffer`,_framebuffer:r,destroy:function(){C(r),S(r)},use:function(e){s.setFBO({framebuffer:i},e)}})}function E(t){var n=[,,,,,,];function r(t){var a,o={color:null},s=0,c=null,l=`rgba`,u=`uint8`,d=1;if(typeof t==`number`)s=t|0;else if(!t)s=1;else{var f=t;`shape`in f?s=f.shape[0]:(`radius`in f&&(s=f.radius|0),`width`in f?(s=f.width|0,`height`in f):`height`in f&&(s=f.height|0)),(`color`in f||`colors`in f)&&(c=f.color||f.colors),c||(`colorCount`in f&&(d=f.colorCount|0),`colorType`in f&&(u=f.colorType),`colorFormat`in f&&(l=f.colorFormat)),`depth`in f&&(o.depth=f.depth),`stencil`in f&&(o.stencil=f.stencil),`depthStencil`in f&&(o.depthStencil=f.depthStencil)}var p;if(c)if(Array.isArray(c))for(p=[],a=0;a<c.length;++a)p[a]=c[a];else p=[c];else{p=Array(d);var m={radius:s,format:l,type:u};for(a=0;a<d;++a)p[a]=i.createCube(m)}for(o.color=Array(p.length),a=0;a<p.length;++a){var h=p[a];s||=h.width,o.color[a]={target:dr,data:p[a]}}for(a=0;a<6;++a){for(var g=0;g<p.length;++g)o.color[g].target=dr+a;a>0&&(o.depth=n[0].depth,o.stencil=n[0].stencil,o.depthStencil=n[0].depthStencil),n[a]?n[a](o):n[a]=T(o)}return e(r,{width:s,height:s,color:p})}function a(e){var t,i=e|0;if(i===r.width)return r;var a=r.color;for(t=0;t<a.length;++t)a[t].resize(i);for(t=0;t<6;++t)n[t].resize(i);return r.width=r.height=i,r}return r(t),e(r,{faces:n,resize:a,_reglType:`framebufferCube`,destroy:function(){n.forEach(function(e){e.destroy()})}})}function D(){s.cur=null,s.next=null,s.dirty=!0,we(b).forEach(function(e){e.framebuffer=t.createFramebuffer(),w(e)})}return e(s,{getFramebuffer:function(e){if(typeof e==`function`&&e._reglType===`framebuffer`){var t=e._framebuffer;if(t instanceof x)return t}return null},create:T,createCube:E,clear:function(){we(b).forEach(C)},restore:D})}var wr=5126,Tr=34962,Er=34963;function Dr(){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=wr,this.offset=0,this.stride=0,this.divisor=0}function Or(e,t,n,r,i,a,o){for(var s=n.maxAttributes,c=Array(s),l=0;l<s;++l)c[l]=new Dr;var u=0,d={},f={Record:Dr,scope:{},state:c,currentVAO:null,targetVAO:null,restore:m()?x:function(){},createVAO:S,getVAO:g,destroyBuffer:p,setVAO:m()?_:v,clear:m()?y:function(){}};function p(t){for(var n=0;n<c.length;++n){var r=c[n];r.buffer===t&&(e.disableVertexAttribArray(n),r.buffer=null)}}function m(){return t.oes_vertex_array_object}function h(){return t.angle_instanced_arrays}function g(e){return typeof e==`function`&&e._vao?e._vao:null}function _(e){if(e!==f.currentVAO){var t=m();e?t.bindVertexArrayOES(e.vao):t.bindVertexArrayOES(null),f.currentVAO=e}}function v(t){if(t!==f.currentVAO){if(t)t.bindAttrs();else{for(var n=h(),r=0;r<c.length;++r){var i=c[r];i.buffer?(e.enableVertexAttribArray(r),i.buffer.bind(),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offfset),n&&i.divisor&&n.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}o.elements?e.bindBuffer(Er,o.elements.buffer.buffer):e.bindBuffer(Er,null)}f.currentVAO=t}}function y(){we(d).forEach(function(e){e.destroy()})}function b(){this.id=++u,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var e=m();e?this.vao=e.createVertexArrayOES():this.vao=null,d[this.id]=this,this.buffers=[]}b.prototype.bindAttrs=function(){for(var t=h(),n=this.attributes,r=0;r<n.length;++r){var i=n[r];i.buffer?(e.enableVertexAttribArray(r),e.bindBuffer(Tr,i.buffer.buffer),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offset),t&&i.divisor&&t.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}for(var o=n.length;o<s;++o)e.disableVertexAttribArray(o);var c=a.getElements(this.elements);c?e.bindBuffer(Er,c.buffer.buffer):e.bindBuffer(Er,null)},b.prototype.refresh=function(){var e=m();e&&(e.bindVertexArrayOES(this.vao),this.bindAttrs(),f.currentVAO=null,e.bindVertexArrayOES(null))},b.prototype.destroy=function(){if(this.vao){var e=m();this===f.currentVAO&&(f.currentVAO=null,e.bindVertexArrayOES(null)),e.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&=(this.elements.destroy(),this.elements=null,!1),d[this.id]&&(delete d[this.id],--r.vaoCount)};function x(){m()&&we(d).forEach(function(e){e.refresh()})}function S(e){var t=new b;r.vaoCount+=1;function n(e){var r;if(Array.isArray(e))r=e,t.elements&&t.ownsElements&&t.elements.destroy(),t.elements=null,t.ownsElements=!1,t.offset=0,t.count=0,t.instances=-1,t.primitive=4;else{if(e.elements){var o=e.elements;t.ownsElements?typeof o==`function`&&o._reglType===`elements`?(t.elements.destroy(),t.ownsElements=!1):(t.elements(o),t.ownsElements=!1):a.getElements(e.elements)?(t.elements=e.elements,t.ownsElements=!1):(t.elements=a.create(e.elements),t.ownsElements=!0)}else t.elements=null,t.ownsElements=!1;r=e.attributes,t.offset=0,t.count=-1,t.instances=-1,t.primitive=4,t.elements&&(t.count=t.elements._elements.vertCount,t.primitive=t.elements._elements.primType),`offset`in e&&(t.offset=e.offset|0),`count`in e&&(t.count=e.count|0),`instances`in e&&(t.instances=e.instances|0),`primitive`in e&&(t.primitive=Ke[e.primitive])}var s={},c=t.attributes;c.length=r.length;for(var l=0;l<r.length;++l){var u=r[l],d=c[l]=new Dr,f=u.data||u;if(Array.isArray(f)||Se(f)||Ce(f)){var p;t.buffers[l]&&(p=t.buffers[l],Se(f)&&p._buffer.byteLength>=f.byteLength?p.subdata(f):(p.destroy(),t.buffers[l]=null)),t.buffers[l]||(p=t.buffers[l]=i.create(u,Tr,!1,!0)),d.buffer=i.getBuffer(p),d.size=d.buffer.dimension|0,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1,s[l]=1}else i.getBuffer(u)?(d.buffer=i.getBuffer(u),d.size=d.buffer.dimension|0,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1):i.getBuffer(u.buffer)?(d.buffer=i.getBuffer(u.buffer),d.size=(+u.size||d.buffer.dimension)|0,d.normalized=!!u.normalized||!1,`type`in u?d.type=Ne[u.type]:d.type=d.buffer.dtype,d.offset=(u.offset||0)|0,d.stride=(u.stride||0)|0,d.divisor=(u.divisor||0)|0,d.state=1):`x`in u&&(d.x=+u.x||0,d.y=+u.y||0,d.z=+u.z||0,d.w=+u.w||0,d.state=2)}for(var m=0;m<t.buffers.length;++m)!s[m]&&t.buffers[m]&&(t.buffers[m].destroy(),t.buffers[m]=null);return t.refresh(),n}return n.destroy=function(){for(var e=0;e<t.buffers.length;++e)t.buffers[e]&&t.buffers[e].destroy();t.buffers.length=0,t.ownsElements&&=(t.elements.destroy(),t.elements=null,!1),t.destroy()},n._vao=t,n._reglType=`vao`,n(e)}return f}var kr=35632,Ar=35633,jr=35718,Mr=35721;function Nr(t,n,r,i){var a={},o={};function s(e,t,n,r){this.name=e,this.id=t,this.location=n,this.info=r}function c(e,t){for(var n=0;n<e.length;++n)if(e[n].id===t.id){e[n].location=t.location;return}e.push(t)}function l(e,r,i){var s=e===kr?a:o,c=s[r];if(!c){var l=n.str(r);c=t.createShader(e),t.shaderSource(c,l),t.compileShader(c),s[r]=c}return c}var u={},d=[],f=0;function p(e,t){this.id=f++,this.fragId=e,this.vertId=t,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function m(e,r,a){var o,u,d=l(kr,e.fragId),f=l(Ar,e.vertId),p=e.program=t.createProgram();if(t.attachShader(p,d),t.attachShader(p,f),a)for(o=0;o<a.length;++o){var m=a[o];t.bindAttribLocation(p,m[0],m[1])}t.linkProgram(p);var h=t.getProgramParameter(p,jr);i.profile&&(e.stats.uniformsCount=h);var g=e.uniforms;for(o=0;o<h;++o)if(u=t.getActiveUniform(p,o),u)if(u.size>1)for(var _=0;_<u.size;++_){var v=u.name.replace(`[0]`,`[`+_+`]`);c(g,new s(v,n.id(v),t.getUniformLocation(p,v),u))}else c(g,new s(u.name,n.id(u.name),t.getUniformLocation(p,u.name),u));var y=t.getProgramParameter(p,Mr);i.profile&&(e.stats.attributesCount=y);var b=e.attributes;for(o=0;o<y;++o)u=t.getActiveAttrib(p,o),u&&c(b,new s(u.name,n.id(u.name),t.getAttribLocation(p,u.name),u))}i.profile&&(r.getMaxUniformsCount=function(){var e=0;return d.forEach(function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)}),e},r.getMaxAttributesCount=function(){var e=0;return d.forEach(function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)}),e});function h(){a={},o={};for(var e=0;e<d.length;++e)m(d[e],null,d[e].attributes.map(function(e){return[e.location,e.name]}))}return{clear:function(){var e=t.deleteShader.bind(t);we(a).forEach(e),a={},we(o).forEach(e),o={},d.forEach(function(e){t.deleteProgram(e.program)}),d.length=0,u={},r.shaderCount=0},program:function(n,i,s,c){var l=u[i];l||=u[i]={};var f=l[n];if(f&&(f.refCount++,!c))return f;var h=new p(i,n);return r.shaderCount++,m(h,s,c),f||(l[n]=h),d.push(h),e(h,{destroy:function(){if(h.refCount--,h.refCount<=0){t.deleteProgram(h.program);var e=d.indexOf(h);d.splice(e,1),r.shaderCount--}l[h.vertId].refCount<=0&&(t.deleteShader(o[h.vertId]),delete o[h.vertId],delete u[h.fragId][h.vertId]),Object.keys(u[h.fragId]).length||(t.deleteShader(a[h.fragId]),delete a[h.fragId],delete u[h.fragId])}})},restore:h,shader:l,frag:-1,vert:-1}}var Pr=6408,Fr=5121,Ir=3333,Lr=5126;function Rr(e,t,n,r,i,a,o){function s(i){var a=t.next===null?Fr:t.next.colorAttachments[0].texture._texture.type,o=0,s=0,c=r.framebufferWidth,l=r.framebufferHeight,u=null;Se(i)?u=i:i&&(o=i.x|0,s=i.y|0,c=(i.width||r.framebufferWidth-o)|0,l=(i.height||r.framebufferHeight-s)|0,u=i.data||null),n();var d=c*l*4;return u||(a===Fr?u=new Uint8Array(d):a===Lr&&(u||=new Float32Array(d))),e.pixelStorei(Ir,4),e.readPixels(o,s,c,l,Pr,a,u),u}function c(e){var n;return t.setFBO({framebuffer:e.framebuffer},function(){n=s(e)}),n}function l(e){return!e||!(`framebuffer`in e)?s(e):c(e)}return l}var zr=0;function Br(e){return Hr(Vr(Ur(e)))}function Vr(e){return Gr(ti(Wr(e),e.length*8))}function Hr(e){for(var t=zr?`0123456789ABCDEF`:`0123456789abcdef`,n=``,r,i=0;i<e.length;i++)r=e.charCodeAt(i),n+=t.charAt(r>>>4&15)+t.charAt(r&15);return n}function Ur(e){for(var t=``,n=-1,r,i;++n<e.length;)r=e.charCodeAt(n),i=n+1<e.length?e.charCodeAt(n+1):0,55296<=r&&r<=56319&&56320<=i&&i<=57343&&(r=65536+((r&1023)<<10)+(i&1023),n++),r<=127?t+=String.fromCharCode(r):r<=2047?t+=String.fromCharCode(192|r>>>6&31,128|r&63):r<=65535?t+=String.fromCharCode(224|r>>>12&15,128|r>>>6&63,128|r&63):r<=2097151&&(t+=String.fromCharCode(240|r>>>18&7,128|r>>>12&63,128|r>>>6&63,128|r&63));return t}function Wr(e){for(var t=Array(e.length>>2),n=0;n<t.length;n++)t[n]=0;for(var n=0;n<e.length*8;n+=8)t[n>>5]|=(e.charCodeAt(n/8)&255)<<24-n%32;return t}function Gr(e){for(var t=``,n=0;n<e.length*32;n+=8)t+=String.fromCharCode(e[n>>5]>>>24-n%32&255);return t}function Kr(e,t){return e>>>t|e<<32-t}function qr(e,t){return e>>>t}function Jr(e,t,n){return e&t^~e&n}function Yr(e,t,n){return e&t^e&n^t&n}function Xr(e){return Kr(e,2)^Kr(e,13)^Kr(e,22)}function Zr(e){return Kr(e,6)^Kr(e,11)^Kr(e,25)}function Qr(e){return Kr(e,7)^Kr(e,18)^qr(e,3)}function $r(e){return Kr(e,17)^Kr(e,19)^qr(e,10)}var ei=[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 ti(e,t){var n=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),i,a,o,s,c,l,u,d,f,p,m,h;for(e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t,f=0;f<e.length;f+=16){for(i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],u=n[6],d=n[7],p=0;p<64;p++)p<16?r[p]=e[p+f]:r[p]=ni(ni(ni($r(r[p-2]),r[p-7]),Qr(r[p-15])),r[p-16]),m=ni(ni(ni(ni(d,Zr(c)),Jr(c,l,u)),ei[p]),r[p]),h=ni(Xr(i),Yr(i,a,o)),d=u,u=l,l=c,c=ni(s,m),s=o,o=a,a=i,i=ni(m,h);n[0]=ni(i,n[0]),n[1]=ni(a,n[1]),n[2]=ni(o,n[2]),n[3]=ni(s,n[3]),n[4]=ni(c,n[4]),n[5]=ni(l,n[5]),n[6]=ni(u,n[6]),n[7]=ni(d,n[7])}return n}function ni(e,t){var n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function ri(e){return Array.prototype.slice.call(e)}function ii(e){return ri(e).join(``)}function ai(t){var n=t&&t.cache,r=0,i=[],a=[],o=[];function s(e,t){var n=t&&t.stable;if(!n){for(var s=0;s<a.length;++s)if(a[s]===e&&!o[s])return i[s]}var c=`g`+ r++;return i.push(c),a.push(e),o.push(n),c}function c(){var t=[];function n(){t.push.apply(t,ri(arguments))}var i=[];function a(){var e=`v`+ r++;return i.push(e),arguments.length>0&&(t.push(e,`=`),t.push.apply(t,ri(arguments)),t.push(`;`)),e}return e(n,{def:a,toString:function(){return ii([i.length>0?`var `+i.join(`,`)+`;`:``,ii(t)])}})}function l(){var t=c(),n=c(),r=t.toString,i=n.toString;function a(e,r){n(e,r,`=`,t.def(e,r),`;`)}return e(function(){t.apply(t,ri(arguments))},{def:t.def,entry:t,exit:n,save:a,set:function(e,n,r){a(e,n),t(e,n,`=`,r,`;`)},toString:function(){return r()+i()}})}function u(){var t=ii(arguments),n=l(),r=l(),i=n.toString,a=r.toString;return e(n,{then:function(){return n.apply(n,ri(arguments)),this},else:function(){return r.apply(r,ri(arguments)),this},toString:function(){var e=a();return e&&=`else{`+e+`}`,ii([`if(`,t,`){`,i(),`}`,e])}})}var d=c(),f={};function p(t,n){var r=[];function i(){var e=`a`+r.length;return r.push(e),e}n||=0;for(var a=0;a<n;++a)i();var o=l(),s=o.toString;return f[t]=e(o,{arg:i,toString:function(){return ii([`function(`,r.join(),`){`,s(),`}`])}})}function m(){var e=[`"use strict";`,d,`return {`];Object.keys(f).forEach(function(t){e.push(`"`,t,`":`,f[t].toString(),`,`)}),e.push(`}`);var t=ii(e).replace(/;/g,`;
`).replace(/}/g,`}
`).replace(/{/g,`{
`),r;if(n&&(r=Br(t),n[r]))return n[r].apply(null,a);var o=Function.apply(null,i.concat(t));return n&&(n[r]=o),o.apply(null,a)}return{global:d,link:s,block:c,proc:p,scope:l,cond:u,compile:m}}var oi=`xyzw`.split(``),si=5121,ci=1,li=2,ui=0,di=1,fi=2,pi=3,mi=4,hi=5,gi=6,_i=`dither`,vi=`blend.enable`,yi=`blend.color`,bi=`blend.equation`,xi=`blend.func`,Si=`depth.enable`,Ci=`depth.func`,wi=`depth.range`,Ti=`depth.mask`,Ei=`colorMask`,Di=`cull.enable`,Oi=`cull.face`,ki=`frontFace`,Ai=`lineWidth`,ji=`polygonOffset.enable`,Mi=`polygonOffset.offset`,Ni=`sample.alpha`,Pi=`sample.enable`,Fi=`sample.coverage`,Ii=`stencil.enable`,Li=`stencil.mask`,Ri=`stencil.func`,zi=`stencil.opFront`,Bi=`stencil.opBack`,Vi=`scissor.enable`,Hi=`scissor.box`,Ui=`viewport`,Wi=`profile`,Gi=`framebuffer`,Ki=`vert`,qi=`frag`,Ji=`elements`,Yi=`primitive`,Xi=`count`,Zi=`offset`,Qi=`instances`,$i=`vao`,ea=`Width`,ta=`Height`,na=Gi+ea,ra=Gi+ta,ia=Ui+ea,aa=Ui+ta,oa=`drawingBuffer`,sa=oa+ea,ca=oa+ta,la=[xi,bi,Ri,zi,Bi,Fi,Ui,Hi,Mi],ua=34962,da=34963,fa=2884,pa=3042,ma=3024,ha=2960,ga=2929,_a=3089,va=32823,ya=32926,ba=32928,xa=5126,Sa=35664,Ca=35665,wa=35666,Ta=5124,Ea=35667,Da=35668,Oa=35669,ka=35670,Aa=35671,ja=35672,Ma=35673,Na=35674,Pa=35675,Fa=35676,Ia=35678,La=35680,Ra=4,za=1028,Ba=1029,Va=2304,Ha=2305,Ua=32775,Wa=32776,Ga=519,Ka=7680,qa=0,Ja=1,Ya=32774,Xa=513,Za=36160,Qa=36064,$a={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},eo={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},to={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},no={cw:Va,ccw:Ha};function ro(e){return Array.isArray(e)||Se(e)||Ce(e)}function io(e){return e.sort(function(e,t){return e===Ui?-1:t===Ui?1:e<t?-1:1})}function ao(e,t,n,r){this.thisDep=e,this.contextDep=t,this.propDep=n,this.append=r}function oo(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function so(e){return new ao(!1,!1,!1,e)}function co(e,t){var n=e.type;if(n===ui){var r=e.data.length;return new ao(!0,r>=1,r>=2,t)}else if(n===mi){var i=e.data;return new ao(i.thisDep,i.contextDep,i.propDep,t)}else{if(n===hi)return new ao(!1,!1,!1,t);if(n===gi){for(var a=!1,o=!1,s=!1,c=0;c<e.data.length;++c){var l=e.data[c];if(l.type===di)s=!0;else if(l.type===fi)o=!0;else if(l.type===pi)a=!0;else if(l.type===ui){a=!0;var u=l.data;u>=1&&(o=!0),u>=2&&(s=!0)}else l.type===mi&&(a||=l.data.thisDep,o||=l.data.contextDep,s||=l.data.propDep)}return new ao(a,o,s,t)}else return new ao(n===pi,n===fi,n===di,t)}}var lo=new ao(!1,!1,!1,function(){});function uo(t,n,r,i,a,o,s,c,l,u,d,p,m,h,g,_){var v=u.Record,y={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(y.min=Ua,y.max=Wa);var b=r.angle_instanced_arrays,x=r.webgl_draw_buffers,S=r.oes_vertex_array_object,C={dirty:!0,profile:_.profile},T={},E=[],D={},O={};function k(e){return e.replace(`.`,`_`)}function A(e,t,n){var r=k(e);E.push(e),T[r]=C[r]=!!n,D[r]=t}function j(e,t,n){var r=k(e);E.push(e),Array.isArray(n)?(C[r]=n.slice(),T[r]=n.slice()):C[r]=T[r]=n,O[r]=t}function M(e){return!!isNaN(e)}A(_i,ma),A(vi,pa),j(yi,`blendColor`,[0,0,0,0]),j(bi,`blendEquationSeparate`,[Ya,Ya]),j(xi,`blendFuncSeparate`,[Ja,qa,Ja,qa]),A(Si,ga,!0),j(Ci,`depthFunc`,Xa),j(wi,`depthRange`,[0,1]),j(Ti,`depthMask`,!0),j(Ei,Ei,[!0,!0,!0,!0]),A(Di,fa),j(Oi,`cullFace`,Ba),j(ki,ki,Ha),j(Ai,Ai,1),A(ji,va),j(Mi,`polygonOffset`,[0,0]),A(Ni,ya),A(Pi,ba),j(Fi,`sampleCoverage`,[1,!1]),A(Ii,ha),j(Li,`stencilMask`,-1),j(Ri,`stencilFunc`,[Ga,0,-1]),j(zi,`stencilOpSeparate`,[za,Ka,Ka,Ka]),j(Bi,`stencilOpSeparate`,[Ba,Ka,Ka,Ka]),A(Vi,_a),j(Hi,`scissor`,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),j(Ui,Ui,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var N={gl:t,context:m,strings:n,next:T,current:C,draw:p,elements:o,buffer:a,shader:d,attributes:u.state,vao:u,uniforms:l,framebuffer:c,extensions:r,timer:h,isBufferArgs:ro},P={primTypes:Ke,compareFuncs:eo,blendFuncs:$a,blendEquations:y,stencilOps:to,glTypes:Ne,orientationType:no};x&&(P.backBuffer=[Ba],P.drawBuffer=w(i.maxDrawbuffers,function(e){return e===0?[0]:w(e,function(e){return Qa+e})}));var F=0;function I(){var e=ai({cache:g}),t=e.link,r=e.global;e.id=F++,e.batchId=`0`;var i=t(N),a=e.shared={props:`a0`};Object.keys(N).forEach(function(e){a[e]=r.def(i,`.`,e)});var o=e.next={},s=e.current={};Object.keys(O).forEach(function(e){Array.isArray(C[e])&&(o[e]=r.def(a.next,`.`,e),s[e]=r.def(a.current,`.`,e))});var c=e.constants={};Object.keys(P).forEach(function(e){c[e]=r.def(JSON.stringify(P[e]))}),e.invoke=function(n,r){switch(r.type){case ui:var i=[`this`,a.context,a.props,e.batchId];return n.def(t(r.data),`.call(`,i.slice(0,Math.max(r.data.length+1,4)),`)`);case di:return n.def(a.props,r.data);case fi:return n.def(a.context,r.data);case pi:return n.def(`this`,r.data);case mi:return r.data.append(e,n),r.data.ref;case hi:return r.data.toString();case gi:return r.data.map(function(t){return e.invoke(n,t)})}},e.attribCache={};var l={};return e.scopeAttrib=function(e){var r=n.id(e);if(r in l)return l[r];var i=u.scope[r];return i||=u.scope[r]=new v,l[r]=t(i)},e}function L(e){var t=e.static,n=e.dynamic,r;if(Wi in t){var i=!!t[Wi];r=so(function(e,t){return i}),r.enable=i}else if(Wi in n){var a=n[Wi];r=co(a,function(e,t){return e.invoke(t,a)})}return r}function R(e,t){var n=e.static,r=e.dynamic;if(Gi in n){var i=n[Gi];return i?(i=c.getFramebuffer(i),so(function(e,t){var n=e.link(i),r=e.shared;t.set(r.framebuffer,`.next`,n);var a=r.context;return t.set(a,`.`+na,n+`.width`),t.set(a,`.`+ra,n+`.height`),n})):so(function(e,t){var n=e.shared;t.set(n.framebuffer,`.next`,`null`);var r=n.context;return t.set(r,`.`+na,r+`.`+sa),t.set(r,`.`+ra,r+`.`+ca),`null`})}else if(Gi in r){var a=r[Gi];return co(a,function(e,t){var n=e.invoke(t,a),r=e.shared,i=r.framebuffer,o=t.def(i,`.getFramebuffer(`,n,`)`);t.set(i,`.next`,o);var s=r.context;return t.set(s,`.`+na,o+`?`+o+`.width:`+s+`.`+sa),t.set(s,`.`+ra,o+`?`+o+`.height:`+s+`.`+ca),o})}else return null}function z(e,t,n){var r=e.static,i=e.dynamic;function a(e){if(e in r){var n=r[e],a=!0,o=n.x|0,s=n.y|0,c,l;return`width`in n?c=n.width|0:a=!1,`height`in n?l=n.height|0:a=!1,new ao(!a&&t&&t.thisDep,!a&&t&&t.contextDep,!a&&t&&t.propDep,function(e,t){var r=e.shared.context,i=c;`width`in n||(i=t.def(r,`.`,na,`-`,o));var a=l;return`height`in n||(a=t.def(r,`.`,ra,`-`,s)),[o,s,i,a]})}else if(e in i){var u=i[e],d=co(u,function(e,t){var n=e.invoke(t,u),r=e.shared.context,i=t.def(n,`.x|0`),a=t.def(n,`.y|0`);return[i,a,t.def(`"width" in `,n,`?`,n,`.width|0:`,`(`,r,`.`,na,`-`,i,`)`),t.def(`"height" in `,n,`?`,n,`.height|0:`,`(`,r,`.`,ra,`-`,a,`)`)]});return t&&(d.thisDep=d.thisDep||t.thisDep,d.contextDep=d.contextDep||t.contextDep,d.propDep=d.propDep||t.propDep),d}else return t?new ao(t.thisDep,t.contextDep,t.propDep,function(e,t){var n=e.shared.context;return[0,0,t.def(n,`.`,na),t.def(n,`.`,ra)]}):null}var o=a(Ui);if(o){var s=o;o=new ao(o.thisDep,o.contextDep,o.propDep,function(e,t){var n=s.append(e,t),r=e.shared.context;return t.set(r,`.`+ia,n[2]),t.set(r,`.`+aa,n[3]),n})}return{viewport:o,scissor_box:a(Hi)}}function B(e,t){var n=e.static;if(typeof n[qi]==`string`&&typeof n[Ki]==`string`){if(Object.keys(t.dynamic).length>0)return null;var r=t.static,i=Object.keys(r);if(i.length>0&&typeof r[i[0]]==`number`){for(var a=[],o=0;o<i.length;++o)a.push([r[i[o]]|0,i[o]]);return a}}return null}function V(e,t,r){var i=e.static,a=e.dynamic;function o(e){if(e in i){var t=n.id(i[e]),r=so(function(){return t});return r.id=t,r}else if(e in a){var o=a[e];return co(o,function(e,t){var n=e.invoke(t,o);return t.def(e.shared.strings,`.id(`,n,`)`)})}return null}var s=o(qi),c=o(Ki),l=null,u;return oo(s)&&oo(c)?(l=d.program(c.id,s.id,null,r),u=so(function(e,t){return e.link(l)})):u=new ao(s&&s.thisDep||c&&c.thisDep,s&&s.contextDep||c&&c.contextDep,s&&s.propDep||c&&c.propDep,function(e,t){var n=e.shared.shader,r=s?s.append(e,t):t.def(n,`.`,qi),i=c?c.append(e,t):t.def(n,`.`,Ki),a=n+`.program(`+i+`,`+r;return t.def(a+`)`)}),{frag:s,vert:c,progVar:u,program:l}}function H(e,t){var n=e.static,r=e.dynamic,i={},a=!1;function s(){if($i in n){var e=n[$i];return e!==null&&u.getVAO(e)===null&&(e=u.createVAO(e)),a=!0,i.vao=e,so(function(t){var n=u.getVAO(e);return n?t.link(n):`null`})}else if($i in r){a=!0;var t=r[$i];return co(t,function(e,n){var r=e.invoke(n,t);return n.def(e.shared.vao+`.getVAO(`+r+`)`)})}return null}var c=s(),l=!1;function d(){if(Ji in n){var e=n[Ji];if(i.elements=e,ro(e)){var t=i.elements=o.create(e,!0);e=o.getElements(t),l=!0}else e&&(e=o.getElements(e),l=!0);var s=so(function(t,n){if(e){var r=t.link(e);return t.ELEMENTS=r,r}return t.ELEMENTS=null,null});return s.value=e,s}else if(Ji in r){l=!0;var u=r[Ji];return co(u,function(e,t){var n=e.shared,r=n.isBufferArgs,i=n.elements,a=e.invoke(t,u),o=t.def(`null`),s=t.def(r,`(`,a,`)`),c=e.cond(s).then(o,`=`,i,`.createStream(`,a,`);`).else(o,`=`,i,`.getElements(`,a,`);`);return t.entry(c),t.exit(e.cond(s).then(i,`.destroyStream(`,o,`);`)),e.ELEMENTS=o,o})}else if(a)return new ao(c.thisDep,c.contextDep,c.propDep,function(e,t){return t.def(e.shared.vao+`.currentVAO?`+e.shared.elements+`.getElements(`+e.shared.vao+`.currentVAO.elements):null`)});return null}var f=d();function p(){if(Yi in n){var e=n[Yi];return i.primitive=e,so(function(t,n){return Ke[e]})}else if(Yi in r){var t=r[Yi];return co(t,function(e,n){var r=e.constants.primTypes,i=e.invoke(n,t);return n.def(r,`[`,i,`]`)})}else{if(l)return oo(f)?f.value?so(function(e,t){return t.def(e.ELEMENTS,`.primType`)}):so(function(){return Ra}):new ao(f.thisDep,f.contextDep,f.propDep,function(e,t){var n=e.ELEMENTS;return t.def(n,`?`,n,`.primType:`,Ra)});if(a)return new ao(c.thisDep,c.contextDep,c.propDep,function(e,t){return t.def(e.shared.vao+`.currentVAO?`+e.shared.vao+`.currentVAO.primitive:`+Ra)})}return null}function m(e,t){if(e in n){var o=n[e]|0;return t?i.offset=o:i.instances=o,so(function(e,n){return t&&(e.OFFSET=o),o})}else if(e in r){var s=r[e];return co(s,function(e,n){var r=e.invoke(n,s);return t&&(e.OFFSET=r),r})}else if(t){if(l)return so(function(e,t){return e.OFFSET=0,0});if(a)return new ao(c.thisDep,c.contextDep,c.propDep,function(e,t){return t.def(e.shared.vao+`.currentVAO?`+e.shared.vao+`.currentVAO.offset:0`)})}else if(a)return new ao(c.thisDep,c.contextDep,c.propDep,function(e,t){return t.def(e.shared.vao+`.currentVAO?`+e.shared.vao+`.currentVAO.instances:-1`)});return null}var h=m(Zi,!0);function g(){if(Xi in n){var e=n[Xi]|0;return i.count=e,so(function(){return e})}else if(Xi in r){var t=r[Xi];return co(t,function(e,n){return e.invoke(n,t)})}else if(l)return oo(f)?f?h?new ao(h.thisDep,h.contextDep,h.propDep,function(e,t){return t.def(e.ELEMENTS,`.vertCount-`,e.OFFSET)}):so(function(e,t){return t.def(e.ELEMENTS,`.vertCount`)}):so(function(){return-1}):new ao(f.thisDep||h.thisDep,f.contextDep||h.contextDep,f.propDep||h.propDep,function(e,t){var n=e.ELEMENTS;return e.OFFSET?t.def(n,`?`,n,`.vertCount-`,e.OFFSET,`:-1`):t.def(n,`?`,n,`.vertCount:-1`)});else if(a)return new ao(c.thisDep,c.contextDep,c.propDep,function(e,t){return t.def(e.shared.vao,`.currentVAO?`,e.shared.vao,`.currentVAO.count:-1`)});return null}return{elements:f,primitive:p(),count:g(),instances:m(Qi,!1),offset:h,vao:c,vaoActive:a,elementsActive:l,static:i}}function U(e,t){var n=e.static,r=e.dynamic,i={};return E.forEach(function(e){var t=k(e);function a(a,o){if(e in n){var s=a(n[e]);i[t]=so(function(){return s})}else if(e in r){var c=r[e];i[t]=co(c,function(e,t){return o(e,t,e.invoke(t,c))})}}switch(e){case Di:case vi:case _i:case Ii:case Si:case Vi:case ji:case Ni:case Pi:case Ti:return a(function(e){return e},function(e,t,n){return n});case Ci:return a(function(e){return eo[e]},function(e,t,n){var r=e.constants.compareFuncs;return t.def(r,`[`,n,`]`)});case wi:return a(function(e){return e},function(e,t,n){return[t.def(`+`,n,`[0]`),t.def(`+`,n,`[1]`)]});case xi:return a(function(e){var t=`srcRGB`in e?e.srcRGB:e.src,n=`srcAlpha`in e?e.srcAlpha:e.src,r=`dstRGB`in e?e.dstRGB:e.dst,i=`dstAlpha`in e?e.dstAlpha:e.dst;return[$a[t],$a[r],$a[n],$a[i]]},function(e,t,n){var r=e.constants.blendFuncs;function i(e,r){return t.def(`"`,e,r,`" in `,n,`?`,n,`.`,e,r,`:`,n,`.`,e)}var a=i(`src`,`RGB`),o=i(`dst`,`RGB`),s=t.def(r,`[`,a,`]`),c=t.def(r,`[`,i(`src`,`Alpha`),`]`);return[s,t.def(r,`[`,o,`]`),c,t.def(r,`[`,i(`dst`,`Alpha`),`]`)]});case bi:return a(function(e){if(typeof e==`string`)return[y[e],y[e]];if(typeof e==`object`)return[y[e.rgb],y[e.alpha]]},function(e,t,n){var r=e.constants.blendEquations,i=t.def(),a=t.def(),o=e.cond(`typeof `,n,`==="string"`);return o.then(i,`=`,a,`=`,r,`[`,n,`];`),o.else(i,`=`,r,`[`,n,`.rgb];`,a,`=`,r,`[`,n,`.alpha];`),t(o),[i,a]});case yi:return a(function(e){return w(4,function(t){return+e[t]})},function(e,t,n){return w(4,function(e){return t.def(`+`,n,`[`,e,`]`)})});case Li:return a(function(e){return e|0},function(e,t,n){return t.def(n,`|0`)});case Ri:return a(function(e){var t=e.cmp||`keep`,n=e.ref||0,r=`mask`in e?e.mask:-1;return[eo[t],n,r]},function(e,t,n){var r=e.constants.compareFuncs;return[t.def(`"cmp" in `,n,`?`,r,`[`,n,`.cmp]`,`:`,Ka),t.def(n,`.ref|0`),t.def(`"mask" in `,n,`?`,n,`.mask|0:-1`)]});case zi:case Bi:return a(function(t){var n=t.fail||`keep`,r=t.zfail||`keep`,i=t.zpass||`keep`;return[e===Bi?Ba:za,to[n],to[r],to[i]]},function(t,n,r){var i=t.constants.stencilOps;function a(e){return n.def(`"`,e,`" in `,r,`?`,i,`[`,r,`.`,e,`]:`,Ka)}return[e===Bi?Ba:za,a(`fail`),a(`zfail`),a(`zpass`)]});case Mi:return a(function(e){return[e.factor|0,e.units|0]},function(e,t,n){return[t.def(n,`.factor|0`),t.def(n,`.units|0`)]});case Oi:return a(function(e){var t=0;return e===`front`?t=za:e===`back`&&(t=Ba),t},function(e,t,n){return t.def(n,`==="front"?`,za,`:`,Ba)});case Ai:return a(function(e){return e},function(e,t,n){return n});case ki:return a(function(e){return no[e]},function(e,t,n){return t.def(n+`==="cw"?`+Va+`:`+Ha)});case Ei:return a(function(e){return e.map(function(e){return!!e})},function(e,t,n){return w(4,function(e){return`!!`+n+`[`+e+`]`})});case Fi:return a(function(e){return[`value`in e?e.value:1,!!e.invert]},function(e,t,n){return[t.def(`"value" in `,n,`?+`,n,`.value:1`),t.def(`!!`,n,`.invert`)]})}}),i}function W(e,t){var n=e.static,r=e.dynamic,i={};return Object.keys(n).forEach(function(e){var t=n[e],r;if(typeof t==`number`||typeof t==`boolean`)r=so(function(){return t});else if(typeof t==`function`){var a=t._reglType;a===`texture2d`||a===`textureCube`?r=so(function(e){return e.link(t)}):(a===`framebuffer`||a===`framebufferCube`)&&(r=so(function(e){return e.link(t.color[0])}))}else ut(t)&&(r=so(function(e){return e.global.def(`[`,w(t.length,function(e){return t[e]}),`]`)}));r.value=t,i[e]=r}),Object.keys(r).forEach(function(e){var t=r[e];i[e]=co(t,function(e,n){return e.invoke(n,t)})}),i}function G(e,t){var r=e.static,i=e.dynamic,o={};return Object.keys(r).forEach(function(e){var t=r[e],i=n.id(e),s=new v;if(ro(t))s.state=ci,s.buffer=a.getBuffer(a.create(t,ua,!1,!0)),s.type=0;else{var c=a.getBuffer(t);if(c)s.state=ci,s.buffer=c,s.type=0;else if(`constant`in t){var l=t.constant;s.buffer=`null`,s.state=li,typeof l==`number`?s.x=l:oi.forEach(function(e,t){t<l.length&&(s[e]=l[t])})}else{c=ro(t.buffer)?a.getBuffer(a.create(t.buffer,ua,!1,!0)):a.getBuffer(t.buffer);var u=t.offset|0,d=t.stride|0,f=t.size|0,p=!!t.normalized,m=0;`type`in t&&(m=Ne[t.type]);var h=t.divisor|0;s.buffer=c,s.state=ci,s.size=f,s.normalized=p,s.type=m||c.dtype,s.offset=u,s.stride=d,s.divisor=h}}o[e]=so(function(e,t){var n=e.attribCache;if(i in n)return n[i];var r={isStream:!1};return Object.keys(s).forEach(function(e){r[e]=s[e]}),s.buffer&&(r.buffer=e.link(s.buffer),r.type=r.type||r.buffer+`.dtype`),n[i]=r,r})}),Object.keys(i).forEach(function(e){var t=i[e];function n(e,n){var r=e.invoke(n,t),i=e.shared,a=e.constants,o=i.isBufferArgs,s=i.buffer,c={isStream:n.def(!1)},l=new v;l.state=ci,Object.keys(l).forEach(function(e){c[e]=n.def(``+l[e])});var u=c.buffer,d=c.type;n(`if(`,o,`(`,r,`)){`,c.isStream,`=true;`,u,`=`,s,`.createStream(`,ua,`,`,r,`);`,d,`=`,u,`.dtype;`,`}else{`,u,`=`,s,`.getBuffer(`,r,`);`,`if(`,u,`){`,d,`=`,u,`.dtype;`,`}else if("constant" in `,r,`){`,c.state,`=`,li,`;`,`if(typeof `+r+`.constant === "number"){`,c[oi[0]],`=`,r,`.constant;`,oi.slice(1).map(function(e){return c[e]}).join(`=`),`=0;`,`}else{`,oi.map(function(e,t){return c[e]+`=`+r+`.constant.length>`+t+`?`+r+`.constant[`+t+`]:0;`}).join(``),`}}else{`,`if(`,o,`(`,r,`.buffer)){`,u,`=`,s,`.createStream(`,ua,`,`,r,`.buffer);`,`}else{`,u,`=`,s,`.getBuffer(`,r,`.buffer);`,`}`,d,`="type" in `,r,`?`,a.glTypes,`[`,r,`.type]:`,u,`.dtype;`,c.normalized,`=!!`,r,`.normalized;`);function f(e){n(c[e],`=`,r,`.`,e,`|0;`)}return f(`size`),f(`offset`),f(`stride`),f(`divisor`),n(`}}`),n.exit(`if(`,c.isStream,`){`,s,`.destroyStream(`,u,`);`,`}`),c}o[e]=co(t,n)}),o}function K(e){var t=e.static,n=e.dynamic,r={};return Object.keys(t).forEach(function(e){var n=t[e];r[e]=so(function(e,t){return typeof n==`number`||typeof n==`boolean`?``+n:e.link(n)})}),Object.keys(n).forEach(function(e){var t=n[e];r[e]=co(t,function(e,n){return e.invoke(n,t)})}),r}function q(e,t,n,i,a){e.static,e.dynamic;var o=B(e,t),s=R(e,a),c=z(e,s,a),l=H(e,a),d=U(e,a),f=V(e,a,o);function p(e){var t=c[e];t&&(d[e]=t)}p(Ui),p(k(Hi));var m={framebuffer:s,draw:l,shader:f,state:d,dirty:Object.keys(d).length>0,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(m.profile=L(e,a),m.uniforms=W(n,a),m.drawVAO=m.scopeVAO=l.vao,!m.drawVAO&&f.program&&!o&&r.angle_instanced_arrays&&l.static.elements){var h=!0,g=f.program.attributes.map(function(e){var n=t.static[e];return h&&=!!n,n});if(h&&g.length>0){var _=u.getVAO(u.createVAO({attributes:g,elements:l.static.elements}));m.drawVAO=new ao(null,null,null,function(e,t){return e.link(_)}),m.useVAO=!0}}return o?m.useVAO=!0:m.attributes=G(t,a),m.context=K(i,a),m}function J(e,t,n){var r=e.shared.context,i=e.scope();Object.keys(n).forEach(function(a){t.save(r,`.`+a);var o=n[a].append(e,t);Array.isArray(o)?i(r,`.`,a,`=[`,o.join(),`];`):i(r,`.`,a,`=`,o,`;`)}),t(i)}function Y(e,t,n,r){var i=e.shared,a=i.gl,o=i.framebuffer,s;x&&(s=t.def(i.extensions,`.webgl_draw_buffers`));var c=e.constants,l=c.drawBuffer,u=c.backBuffer,d=n?n.append(e,t):t.def(o,`.next`);r||t(`if(`,d,`!==`,o,`.cur){`),t(`if(`,d,`){`,a,`.bindFramebuffer(`,Za,`,`,d,`.framebuffer);`),x&&t(s,`.drawBuffersWEBGL(`,l,`[`,d,`.colorAttachments.length]);`),t(`}else{`,a,`.bindFramebuffer(`,Za,`,null);`),x&&t(s,`.drawBuffersWEBGL(`,u,`);`),t(`}`,o,`.cur=`,d,`;`),r||t(`}`)}function X(e,t,n){var r=e.shared,i=r.gl,a=e.current,o=e.next,s=r.current,c=r.next,l=e.cond(s,`.dirty`);E.forEach(function(t){var r=k(t);if(!(r in n.state)){var u,d;if(r in o){u=o[r],d=a[r];var f=w(C[r].length,function(e){return l.def(u,`[`,e,`]`)});l(e.cond(f.map(function(e,t){return e+`!==`+d+`[`+t+`]`}).join(`||`)).then(i,`.`,O[r],`(`,f,`);`,f.map(function(e,t){return d+`[`+t+`]=`+e}).join(`;`),`;`))}else{u=l.def(c,`.`,r);var p=e.cond(u,`!==`,s,`.`,r);l(p),r in D?p(e.cond(u).then(i,`.enable(`,D[r],`);`).else(i,`.disable(`,D[r],`);`),s,`.`,r,`=`,u,`;`):p(i,`.`,O[r],`(`,u,`);`,s,`.`,r,`=`,u,`;`)}}}),Object.keys(n.state).length===0&&l(s,`.dirty=false;`),t(l)}function Z(e,t,n,r){var i=e.shared,a=e.current,o=i.current,s=i.gl,c;io(Object.keys(n)).forEach(function(i){var l=n[i];if(!(r&&!r(l))){var u=l.append(e,t);if(D[i]){var d=D[i];oo(l)?(c=e.link(u,{stable:!0}),t(e.cond(c).then(s,`.enable(`,d,`);`).else(s,`.disable(`,d,`);`)),t(o,`.`,i,`=`,c,`;`)):(t(e.cond(u).then(s,`.enable(`,d,`);`).else(s,`.disable(`,d,`);`)),t(o,`.`,i,`=`,u,`;`))}else if(ut(u)){var f=a[i];t(s,`.`,O[i],`(`,u,`);`,u.map(function(e,t){return f+`[`+t+`]=`+e}).join(`;`),`;`)}else oo(l)?(c=e.link(u,{stable:!0}),t(s,`.`,O[i],`(`,c,`);`,o,`.`,i,`=`,c,`;`)):t(s,`.`,O[i],`(`,u,`);`,o,`.`,i,`=`,u,`;`)}})}function Q(e,t){b&&(e.instancing=t.def(e.shared.extensions,`.angle_instanced_arrays`))}function ee(e,t,n,r,i){var a=e.shared,o=e.stats,s=a.current,c=a.timer,l=n.profile;function u(){return typeof performance>`u`?`Date.now()`:`performance.now()`}var d,f;function p(e){d=t.def(),e(d,`=`,u(),`;`),typeof i==`string`?e(o,`.count+=`,i,`;`):e(o,`.count++;`),h&&(r?(f=t.def(),e(f,`=`,c,`.getNumPendingQueries();`)):e(c,`.beginQuery(`,o,`);`))}function m(e){e(o,`.cpuTime+=`,u(),`-`,d,`;`),h&&(r?e(c,`.pushScopeStats(`,f,`,`,c,`.getNumPendingQueries(),`,o,`);`):e(c,`.endQuery();`))}function g(e){var n=t.def(s,`.profile`);t(s,`.profile=`,e,`;`),t.exit(s,`.profile=`,n,`;`)}var _;if(l){if(oo(l)){l.enable?(p(t),m(t.exit),g(`true`)):g(`false`);return}_=l.append(e,t),g(_)}else _=t.def(s,`.profile`);var v=e.block();p(v),t(`if(`,_,`){`,v,`}`);var y=e.block();m(y),t.exit(`if(`,_,`){`,y,`}`)}function te(e,t,n,r,i){var a=e.shared;function o(e){switch(e){case Sa:case Ea:case Aa:return 2;case Ca:case Da:case ja:return 3;case wa:case Oa:case Ma:return 4;default:return 1}}function s(n,r,i){var o=a.gl,s=t.def(n,`.location`),c=t.def(a.attributes,`[`,s,`]`),l=i.state,u=i.buffer,d=[i.x,i.y,i.z,i.w],f=[`buffer`,`normalized`,`offset`,`stride`];function p(){t(`if(!`,c,`.buffer){`,o,`.enableVertexAttribArray(`,s,`);}`);var n=i.type,a;if(a=i.size?t.def(i.size,`||`,r):r,t(`if(`,c,`.type!==`,n,`||`,c,`.size!==`,a,`||`,f.map(function(e){return c+`.`+e+`!==`+i[e]}).join(`||`),`){`,o,`.bindBuffer(`,ua,`,`,u,`.buffer);`,o,`.vertexAttribPointer(`,[s,a,n,i.normalized,i.stride,i.offset],`);`,c,`.type=`,n,`;`,c,`.size=`,a,`;`,f.map(function(e){return c+`.`+e+`=`+i[e]+`;`}).join(``),`}`),b){var l=i.divisor;t(`if(`,c,`.divisor!==`,l,`){`,e.instancing,`.vertexAttribDivisorANGLE(`,[s,l],`);`,c,`.divisor=`,l,`;}`)}}function m(){t(`if(`,c,`.buffer){`,o,`.disableVertexAttribArray(`,s,`);`,c,`.buffer=null;`,`}if(`,oi.map(function(e,t){return c+`.`+e+`!==`+d[t]}).join(`||`),`){`,o,`.vertexAttrib4f(`,s,`,`,d,`);`,oi.map(function(e,t){return c+`.`+e+`=`+d[t]+`;`}).join(``),`}`)}l===ci?p():l===li?m():(t(`if(`,l,`===`,ci,`){`),p(),t(`}else{`),m(),t(`}`))}r.forEach(function(r){var a=r.name,c=n.attributes[a],l;if(c){if(!i(c))return;l=c.append(e,t)}else{if(!i(lo))return;var u=e.scopeAttrib(a);l={},Object.keys(new v).forEach(function(e){l[e]=t.def(u,`.`,e)})}s(e.link(r),o(r.info.type),l)})}function ne(e,t,r,i,a,o){for(var s=e.shared,c=s.gl,l,u=0;u<i.length;++u){var d=i[u],f=d.name,p=d.info.type,m=r.uniforms[f],h=e.link(d)+`.location`,g;if(m){if(!a(m))continue;if(oo(m)){var _=m.value;if(p===Ia||p===La){var v=e.link(_._texture||_.color[0]._texture);t(c,`.uniform1i(`,h,`,`,v+`.bind());`),t.exit(v,`.unbind();`)}else if(p===Na||p===Pa||p===Fa){var y=e.global.def(`new Float32Array([`+Array.prototype.slice.call(_)+`])`),b=2;p===Pa?b=3:p===Fa&&(b=4),t(c,`.uniformMatrix`,b,`fv(`,h,`,false,`,y,`);`)}else{switch(p){case xa:l=`1f`;break;case Sa:l=`2f`;break;case Ca:l=`3f`;break;case wa:l=`4f`;break;case ka:l=`1i`;break;case Ta:l=`1i`;break;case Aa:l=`2i`;break;case Ea:l=`2i`;break;case ja:l=`3i`;break;case Da:l=`3i`;break;case Ma:l=`4i`;break;case Oa:l=`4i`;break}t(c,`.uniform`,l,`(`,h,`,`,ut(_)?Array.prototype.slice.call(_):_,`);`)}continue}else g=m.append(e,t)}else{if(!a(lo))continue;g=t.def(s.uniforms,`[`,n.id(f),`]`)}p===Ia?t(`if(`,g,`&&`,g,`._reglType==="framebuffer"){`,g,`=`,g,`.color[0];`,`}`):p===La&&t(`if(`,g,`&&`,g,`._reglType==="framebufferCube"){`,g,`=`,g,`.color[0];`,`}`);var x=1;switch(p){case Ia:case La:var S=t.def(g,`._texture`);t(c,`.uniform1i(`,h,`,`,S,`.bind());`),t.exit(S,`.unbind();`);continue;case Ta:case ka:l=`1i`;break;case Ea:case Aa:l=`2i`,x=2;break;case Da:case ja:l=`3i`,x=3;break;case Oa:case Ma:l=`4i`,x=4;break;case xa:l=`1f`;break;case Sa:l=`2f`,x=2;break;case Ca:l=`3f`,x=3;break;case wa:l=`4f`,x=4;break;case Na:l=`Matrix2fv`;break;case Pa:l=`Matrix3fv`;break;case Fa:l=`Matrix4fv`;break}if(l.charAt(0)===`M`){t(c,`.uniform`,l,`(`,h,`,`);var C=(p-Na+2)**2,T=e.global.def(`new Float32Array(`,C,`)`);Array.isArray(g)?t(`false,(`,w(C,function(e){return T+`[`+e+`]=`+g[e]}),`,`,T,`)`):t(`false,(Array.isArray(`,g,`)||`,g,` instanceof Float32Array)?`,g,`:(`,w(C,function(e){return T+`[`+e+`]=`+g+`[`+e+`]`}),`,`,T,`)`),t(`);`)}else if(x>1){for(var E=[],D=[],O=0;O<x;++O)Array.isArray(g)?D.push(g[O]):D.push(t.def(g+`[`+O+`]`)),o&&E.push(t.def());o&&t(`if(!`,e.batchId,`||`,E.map(function(e,t){return e+`!==`+D[t]}).join(`||`),`){`,E.map(function(e,t){return e+`=`+D[t]+`;`}).join(``)),t(c,`.uniform`,l,`(`,h,`,`,D.join(`,`),`);`),o&&t(`}`)}else{if(o){var k=t.def();t(`if(!`,e.batchId,`||`,k,`!==`,g,`){`,k,`=`,g,`;`)}t(c,`.uniform`,l,`(`,h,`,`,g,`);`),o&&t(`}`)}}}function re(e,t,n,r){var i=e.shared,a=i.gl,o=i.draw,s=r.draw;function c(){var c=s.elements,l,u=t;return c?((c.contextDep&&r.contextDynamic||c.propDep)&&(u=n),l=c.append(e,u),s.elementsActive&&u(`if(`+l+`)`+a+`.bindBuffer(`+da+`,`+l+`.buffer.buffer);`)):(l=u.def(),u(l,`=`,o,`.`,Ji,`;`,`if(`,l,`){`,a,`.bindBuffer(`,da,`,`,l,`.buffer.buffer);}`,`else if(`,i.vao,`.currentVAO){`,l,`=`,e.shared.elements+`.getElements(`+i.vao,`.currentVAO.elements);`,S?``:`if(`+l+`)`+a+`.bindBuffer(`+da+`,`+l+`.buffer.buffer);`,`}`)),l}function l(){var i=s.count,a,c=t;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(c=n),a=i.append(e,c)):a=c.def(o,`.`,Xi),a}var u=c();function d(i){var a=s[i];return a?a.contextDep&&r.contextDynamic||a.propDep?a.append(e,n):a.append(e,t):t.def(o,`.`,i)}var f=d(Yi),p=d(Zi),m=l();if(typeof m==`number`){if(m===0)return}else n(`if(`,m,`){`),n.exit(`}`);var h,g;b&&(h=d(Qi),g=e.instancing);var _=u+`.type`,v=s.elements&&oo(s.elements)&&!s.vaoActive;function y(){function e(){n(g,`.drawElementsInstancedANGLE(`,[f,m,_,p+`<<((`+_+`-`+si+`)>>1)`,h],`);`)}function t(){n(g,`.drawArraysInstancedANGLE(`,[f,p,m,h],`);`)}u&&u!==`null`?v?e():(n(`if(`,u,`){`),e(),n(`}else{`),t(),n(`}`)):t()}function x(){function e(){n(a+`.drawElements(`+[f,m,_,p+`<<((`+_+`-`+si+`)>>1)`]+`);`)}function t(){n(a+`.drawArrays(`+[f,p,m]+`);`)}u&&u!==`null`?v?e():(n(`if(`,u,`){`),e(),n(`}else{`),t(),n(`}`)):t()}b&&(typeof h!=`number`||h>=0)?typeof h==`string`?(n(`if(`,h,`>0){`),y(),n(`}else if(`,h,`<0){`),x(),n(`}`)):y():x()}function ie(e,t,n,r,i){var a=I(),o=a.proc(`body`,i);return b&&(a.instancing=o.def(a.shared.extensions,`.angle_instanced_arrays`)),e(a,o,n,r),a.compile().body}function ae(e,t,n,r){Q(e,t),n.useVAO?n.drawVAO?t(e.shared.vao,`.setVAO(`,n.drawVAO.append(e,t),`);`):t(e.shared.vao,`.setVAO(`,e.shared.vao,`.targetVAO);`):(t(e.shared.vao,`.setVAO(null);`),te(e,t,n,r.attributes,function(){return!0})),ne(e,t,n,r.uniforms,function(){return!0},!1),re(e,t,t,n)}function oe(e,t){var n=e.proc(`draw`,1);Q(e,n),J(e,n,t.context),Y(e,n,t.framebuffer),X(e,n,t),Z(e,n,t.state),ee(e,n,t,!1,!0);var r=t.shader.progVar.append(e,n);if(n(e.shared.gl,`.useProgram(`,r,`.program);`),t.shader.program)ae(e,n,t,t.shader.program);else{n(e.shared.vao,`.setVAO(null);`);var i=e.global.def(`{}`),a=n.def(r,`.id`),o=n.def(i,`[`,a,`]`);n(e.cond(o).then(o,`.call(this,a0);`).else(o,`=`,i,`[`,a,`]=`,e.link(function(n){return ie(ae,e,t,n,1)}),`(`,r,`);`,o,`.call(this,a0);`))}Object.keys(t.state).length>0&&n(e.shared.current,`.dirty=true;`),e.shared.vao&&n(e.shared.vao,`.setVAO(null);`)}function se(e,t,n,r){e.batchId=`a1`,Q(e,t);function i(){return!0}te(e,t,n,r.attributes,i),ne(e,t,n,r.uniforms,i,!1),re(e,t,t,n)}function ce(e,t,n,r){Q(e,t);var i=n.contextDep,a=t.def(),o=`a0`,s=`a1`,c=t.def();e.shared.props=c,e.batchId=a;var l=e.scope(),u=e.scope();t(l.entry,`for(`,a,`=0;`,a,`<`,s,`;++`,a,`){`,c,`=`,o,`[`,a,`];`,u,`}`,l.exit);function d(e){return e.contextDep&&i||e.propDep}function f(e){return!d(e)}if(n.needsContext&&J(e,u,n.context),n.needsFramebuffer&&Y(e,u,n.framebuffer),Z(e,u,n.state,d),n.profile&&d(n.profile)&&ee(e,u,n,!1,!0),r)n.useVAO?n.drawVAO?d(n.drawVAO)?u(e.shared.vao,`.setVAO(`,n.drawVAO.append(e,u),`);`):l(e.shared.vao,`.setVAO(`,n.drawVAO.append(e,l),`);`):l(e.shared.vao,`.setVAO(`,e.shared.vao,`.targetVAO);`):(l(e.shared.vao,`.setVAO(null);`),te(e,l,n,r.attributes,f),te(e,u,n,r.attributes,d)),ne(e,l,n,r.uniforms,f,!1),ne(e,u,n,r.uniforms,d,!0),re(e,l,u,n);else{var p=e.global.def(`{}`),m=n.shader.progVar.append(e,u),h=u.def(m,`.id`),g=u.def(p,`[`,h,`]`);u(e.shared.gl,`.useProgram(`,m,`.program);`,`if(!`,g,`){`,g,`=`,p,`[`,h,`]=`,e.link(function(t){return ie(se,e,n,t,2)}),`(`,m,`);}`,g,`.call(this,a0[`,a,`],`,a,`);`)}}function le(e,t){var n=e.proc(`batch`,2);e.batchId=`0`,Q(e,n);var r=!1,i=!0;Object.keys(t.context).forEach(function(e){r||=t.context[e].propDep}),r||(J(e,n,t.context),i=!1);var a=t.framebuffer,o=!1;a?(a.propDep?r=o=!0:a.contextDep&&r&&(o=!0),o||Y(e,n,a)):Y(e,n,null),t.state.viewport&&t.state.viewport.propDep&&(r=!0);function s(e){return e.contextDep&&r||e.propDep}X(e,n,t),Z(e,n,t.state,function(e){return!s(e)}),(!t.profile||!s(t.profile))&&ee(e,n,t,!1,`a1`),t.contextDep=r,t.needsContext=i,t.needsFramebuffer=o;var c=t.shader.progVar;if(c.contextDep&&r||c.propDep)ce(e,n,t,null);else{var l=c.append(e,n);if(n(e.shared.gl,`.useProgram(`,l,`.program);`),t.shader.program)ce(e,n,t,t.shader.program);else{n(e.shared.vao,`.setVAO(null);`);var u=e.global.def(`{}`),d=n.def(l,`.id`),f=n.def(u,`[`,d,`]`);n(e.cond(f).then(f,`.call(this,a0,a1);`).else(f,`=`,u,`[`,d,`]=`,e.link(function(n){return ie(ce,e,t,n,2)}),`(`,l,`);`,f,`.call(this,a0,a1);`))}}Object.keys(t.state).length>0&&n(e.shared.current,`.dirty=true;`),e.shared.vao&&n(e.shared.vao,`.setVAO(null);`)}function ue(e,t){var r=e.proc(`scope`,3);e.batchId=`a2`;var i=e.shared,a=i.current;if(J(e,r,t.context),t.framebuffer&&t.framebuffer.append(e,r),io(Object.keys(t.state)).forEach(function(n){var a=t.state[n],o=a.append(e,r);ut(o)?o.forEach(function(t,i){M(t)?r.set(e.next[n],`[`+i+`]`,t):r.set(e.next[n],`[`+i+`]`,e.link(t,{stable:!0}))}):oo(a)?r.set(i.next,`.`+n,e.link(o,{stable:!0})):r.set(i.next,`.`+n,o)}),ee(e,r,t,!0,!0),[Ji,Zi,Xi,Qi,Yi].forEach(function(n){var a=t.draw[n];if(a){var o=a.append(e,r);M(o)?r.set(i.draw,`.`+n,o):r.set(i.draw,`.`+n,e.link(o),{stable:!0})}}),Object.keys(t.uniforms).forEach(function(a){var o=t.uniforms[a].append(e,r);Array.isArray(o)&&(o=`[`+o.map(function(t){return M(t)?t:e.link(t,{stable:!0})})+`]`),r.set(i.uniforms,`[`+e.link(n.id(a),{stable:!0})+`]`,o)}),Object.keys(t.attributes).forEach(function(n){var i=t.attributes[n].append(e,r),a=e.scopeAttrib(n);Object.keys(new v).forEach(function(e){r.set(a,`.`+e,i[e])})}),t.scopeVAO){var o=t.scopeVAO.append(e,r);M(o)?r.set(i.vao,`.targetVAO`,o):r.set(i.vao,`.targetVAO`,e.link(o,{stable:!0}))}function s(n){var a=t.shader[n];if(a){var o=a.append(e,r);M(o)?r.set(i.shader,`.`+n,o):r.set(i.shader,`.`+n,e.link(o,{stable:!0}))}}s(Ki),s(qi),Object.keys(t.state).length>0&&(r(a,`.dirty=true;`),r.exit(a,`.dirty=true;`)),r(`a1(`,e.shared.context,`,a0,`,e.batchId,`);`)}function de(e){if(!(typeof e!=`object`||ut(e))){for(var t=Object.keys(e),n=0;n<t.length;++n)if(f.isDynamic(e[t[n]]))return!0;return!1}}function fe(e,t,n){var r=t.static[n];if(!r||!de(r))return;var i=e.global,a=Object.keys(r),o=!1,s=!1,c=!1,l=e.global.def(`{}`);a.forEach(function(t){var n=r[t];if(f.isDynamic(n)){typeof n==`function`&&(n=r[t]=f.unbox(n));var a=co(n,null);o||=a.thisDep,c||=a.propDep,s||=a.contextDep}else{switch(i(l,`.`,t,`=`),typeof n){case`number`:i(n);break;case`string`:i(`"`,n,`"`);break;case`object`:Array.isArray(n)&&i(`[`,n.join(),`]`);break;default:i(e.link(n));break}i(`;`)}});function u(e,t){a.forEach(function(n){var i=r[n];f.isDynamic(i)&&t(l,`.`,n,`=`,e.invoke(t,i),`;`)})}t.dynamic[n]=new f.DynamicVariable(mi,{thisDep:o,contextDep:s,propDep:c,ref:l,append:u}),delete t.static[n]}function pe(t,n,r,i,a){var o=I();o.stats=o.link(a),Object.keys(n.static).forEach(function(e){fe(o,n,e)}),la.forEach(function(e){fe(o,t,e)});var s=q(t,n,r,i,o);return s.shader.program&&(s.shader.program.attributes.sort(function(e,t){return e.name<t.name?-1:1}),s.shader.program.uniforms.sort(function(e,t){return e.name<t.name?-1:1})),oe(o,s),ue(o,s),le(o,s),e(o.compile(),{destroy:function(){s.shader.program.destroy()}})}return{next:T,current:C,procs:function(){var e=I(),t=e.proc(`poll`),n=e.proc(`refresh`),a=e.block();t(a),n(a);var o=e.shared,s=o.gl,c=o.next,l=o.current;a(l,`.dirty=false;`),Y(e,t),Y(e,n,null,!0);var u;b&&(u=e.link(b)),r.oes_vertex_array_object&&n(e.link(r.oes_vertex_array_object),`.bindVertexArrayOES(null);`);var d=n.def(o.attributes),f=n.def(0),p=e.cond(f,`.buffer`);p.then(s,`.enableVertexAttribArray(i);`,s,`.bindBuffer(`,ua,`,`,f,`.buffer.buffer);`,s,`.vertexAttribPointer(i,`,f,`.size,`,f,`.type,`,f,`.normalized,`,f,`.stride,`,f,`.offset);`).else(s,`.disableVertexAttribArray(i);`,s,`.vertexAttrib4f(i,`,f,`.x,`,f,`.y,`,f,`.z,`,f,`.w);`,f,`.buffer=null;`);var m=e.link(i.maxAttributes,{stable:!0});return n(`for(var i=0;i<`,m,`;++i){`,f,`=`,d,`[i];`,p,`}`),b&&n(`for(var i=0;i<`,m,`;++i){`,u,`.vertexAttribDivisorANGLE(i,`,d,`[i].divisor);`,`}`),n(e.shared.vao,`.currentVAO=null;`,e.shared.vao,`.setVAO(`,e.shared.vao,`.targetVAO);`),Object.keys(D).forEach(function(r){var i=D[r],o=a.def(c,`.`,r),u=e.block();u(`if(`,o,`){`,s,`.enable(`,i,`)}else{`,s,`.disable(`,i,`)}`,l,`.`,r,`=`,o,`;`),n(u),t(`if(`,o,`!==`,l,`.`,r,`){`,u,`}`)}),Object.keys(O).forEach(function(r){var i=O[r],o=C[r],u,d,f=e.block();if(f(s,`.`,i,`(`),ut(o)){var p=o.length;u=e.global.def(c,`.`,r),d=e.global.def(l,`.`,r),f(w(p,function(e){return u+`[`+e+`]`}),`);`,w(p,function(e){return d+`[`+e+`]=`+u+`[`+e+`];`}).join(``)),t(`if(`,w(p,function(e){return u+`[`+e+`]!==`+d+`[`+e+`]`}).join(`||`),`){`,f,`}`)}else u=a.def(c,`.`,r),d=a.def(l,`.`,r),f(u,`);`,l,`.`,r,`=`,u,`;`),t(`if(`,u,`!==`,d,`){`,f,`}`);n(f)}),e.compile()}(),compile:pe}}function fo(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var po=34918,mo=34919,ho=35007,go=function(e,t){if(!t.ext_disjoint_timer_query)return null;var n=[];function r(){return n.pop()||t.ext_disjoint_timer_query.createQueryEXT()}function i(e){n.push(e)}var a=[];function o(e){var n=r();t.ext_disjoint_timer_query.beginQueryEXT(ho,n),a.push(n),p(a.length-1,a.length,e)}function s(){t.ext_disjoint_timer_query.endQueryEXT(ho)}function c(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var l=[];function u(){return l.pop()||new c}function d(e){l.push(e)}var f=[];function p(e,t,n){var r=u();r.startQueryIndex=e,r.endQueryIndex=t,r.sum=0,r.stats=n,f.push(r)}var m=[],h=[];function g(){var e,n,r=a.length;if(r!==0){h.length=Math.max(h.length,r+1),m.length=Math.max(m.length,r+1),m[0]=0,h[0]=0;var o=0;for(e=0,n=0;n<a.length;++n){var s=a[n];t.ext_disjoint_timer_query.getQueryObjectEXT(s,mo)?(o+=t.ext_disjoint_timer_query.getQueryObjectEXT(s,po),i(s)):a[e++]=s,m[n+1]=o,h[n+1]=e}for(a.length=e,e=0,n=0;n<f.length;++n){var c=f[n],l=c.startQueryIndex,u=c.endQueryIndex;c.sum+=m[u]-m[l];var p=h[l],g=h[u];g===p?(c.stats.gpuTime+=c.sum/1e6,d(c)):(c.startQueryIndex=p,c.endQueryIndex=g,f[e++]=c)}f.length=e}}return{beginQuery:o,endQuery:s,pushScopeStats:p,update:g,getNumPendingQueries:function(){return a.length},clear:function(){n.push.apply(n,a);for(var e=0;e<n.length;e++)t.ext_disjoint_timer_query.deleteQueryEXT(n[e]);a.length=0,n.length=0},restore:function(){a.length=0,n.length=0}}},_o=16384,vo=256,yo=1024,bo=34962,xo=`webglcontextlost`,So=`webglcontextrestored`,Co=1,wo=2,To=3;function Eo(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}function Do(t){var n=S(t);if(!n)return null;var r=n.gl,i=r.getContextAttributes();r.isContextLost();var a=C(r,n);if(!a)return null;var o=h(),s=fo(),c=n.cachedCode||{},l=a.extensions,u=go(r,l),d=m(),g=r.drawingBufferWidth,_=r.drawingBufferHeight,v={tick:0,time:0,viewportWidth:g,viewportHeight:_,framebufferWidth:g,framebufferHeight:_,drawingBufferWidth:g,drawingBufferHeight:_,pixelRatio:n.pixelRatio},y={},b={elements:null,primitive:4,count:-1,offset:0,instances:-1},x=xe(r,l),w=Ge(r,s,n,D),T=at(r,l,w,s),E=Or(r,l,x,s,w,T,b);function D(e){return E.destroyBuffer(e)}var O=Nr(r,o,s,n),k=qn(r,l,x,function(){M.procs.poll()},v,s,n),A=sr(r,l,x,s,n),j=Cr(r,l,x,k,A,s),M=uo(r,o,l,x,w,T,k,j,y,E,O,b,v,u,c,n),N=Rr(r,j,M.procs.poll,v,i,l,x),P=M.next,F=r.canvas,I=[],L=[],R=[],z=[n.onDestroy],B=null;function V(){if(I.length===0){u&&u.update(),B=null;return}B=p.next(V),ee();for(var e=I.length-1;e>=0;--e){var t=I[e];t&&t(v,null,0)}r.flush(),u&&u.update()}function H(){!B&&I.length>0&&(B=p.next(V))}function U(){B&&=(p.cancel(V),null)}function W(e){e.preventDefault(),U(),L.forEach(function(e){e()})}function G(e){r.getError(),a.restore(),O.restore(),w.restore(),k.restore(),A.restore(),j.restore(),E.restore(),u&&u.restore(),M.procs.refresh(),H(),R.forEach(function(e){e()})}F&&(F.addEventListener(xo,W,!1),F.addEventListener(So,G,!1));function K(){I.length=0,U(),F&&(F.removeEventListener(xo,W),F.removeEventListener(So,G)),O.clear(),j.clear(),A.clear(),E.clear(),k.clear(),T.clear(),w.clear(),u&&u.clear(),z.forEach(function(e){e()})}function q(t){function n(t){var n=e({},t);delete n.uniforms,delete n.attributes,delete n.context,delete n.vao,`stencil`in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op);function r(e){if(e in n){var t=n[e];delete n[e],Object.keys(t).forEach(function(r){n[e+`.`+r]=t[r]})}}return r(`blend`),r(`depth`),r(`cull`),r(`stencil`),r(`polygonOffset`),r(`scissor`),r(`sample`),`vao`in t&&(n.vao=t.vao),n}function r(e,t){var n={},r={};return Object.keys(e).forEach(function(i){var a=e[i];if(f.isDynamic(a)){r[i]=f.unbox(a,i);return}else if(t&&Array.isArray(a)){for(var o=0;o<a.length;++o)if(f.isDynamic(a[o])){r[i]=f.unbox(a,i);return}}n[i]=a}),{dynamic:r,static:n}}var i=r(t.context||{},!0),a=r(t.uniforms||{},!0),o=r(t.attributes||{},!1),s=r(n(t),!1),c={gpuTime:0,cpuTime:0,count:0},l=M.compile(s,o,a,i,c),u=l.draw,d=l.batch,p=l.scope,m=[];function h(e){for(;m.length<e;)m.push(null);return m}function g(e,t){var n;if(typeof e==`function`)return p.call(this,null,e,0);if(typeof t==`function`)if(typeof e==`number`)for(n=0;n<e;++n)p.call(this,null,t,n);else if(Array.isArray(e))for(n=0;n<e.length;++n)p.call(this,e[n],t,n);else return p.call(this,e,t,0);else if(typeof e==`number`){if(e>0)return d.call(this,h(e|0),e|0)}else if(Array.isArray(e)){if(e.length)return d.call(this,e,e.length)}else return u.call(this,e)}return e(g,{stats:c,destroy:function(){l.destroy()}})}var J=j.setFBO=q({framebuffer:f.define.call(null,Co,`framebuffer`)});function Y(e,t){var n=0;M.procs.poll();var i=t.color;i&&(r.clearColor(+i[0]||0,+i[1]||0,+i[2]||0,+i[3]||0),n|=_o),`depth`in t&&(r.clearDepth(+t.depth),n|=vo),`stencil`in t&&(r.clearStencil(t.stencil|0),n|=yo),r.clear(n)}function X(t){if(`framebuffer`in t)if(t.framebuffer&&t.framebuffer_reglType===`framebufferCube`)for(var n=0;n<6;++n)J(e({framebuffer:t.framebuffer.faces[n]},t),Y);else J(t,Y);else Y(null,t)}function Z(e){I.push(e);function t(){var t=Eo(I,e);function n(){var e=Eo(I,n);I[e]=I[I.length-1],--I.length,I.length<=0&&U()}I[t]=n}return H(),{cancel:t}}function Q(){var e=P.viewport,t=P.scissor_box;e[0]=e[1]=t[0]=t[1]=0,v.viewportWidth=v.framebufferWidth=v.drawingBufferWidth=e[2]=t[2]=r.drawingBufferWidth,v.viewportHeight=v.framebufferHeight=v.drawingBufferHeight=e[3]=t[3]=r.drawingBufferHeight}function ee(){v.tick+=1,v.time=ne(),Q(),M.procs.poll()}function te(){k.refresh(),Q(),M.procs.refresh(),u&&u.update()}function ne(){return(m()-d)/1e3}te();function re(e,t){var n;switch(e){case`frame`:return Z(t);case`lost`:n=L;break;case`restore`:n=R;break;case`destroy`:n=z;break;default:}return n.push(t),{cancel:function(){for(var e=0;e<n.length;++e)if(n[e]===t){n[e]=n[n.length-1],n.pop();return}}}}function ie(){return c}function ae(e){Object.entries(e).forEach(function(e){c[e[0]]=e[1]})}var oe=e(q,{clear:X,prop:f.define.bind(null,Co),context:f.define.bind(null,wo),this:f.define.bind(null,To),draw:q({}),buffer:function(e){return w.create(e,bo,!1,!1)},elements:function(e){return T.create(e,!1)},texture:k.create2D,cube:k.createCube,renderbuffer:A.create,framebuffer:j.create,framebufferCube:j.createCube,vao:E.createVAO,attributes:i,frame:Z,on:re,limits:x,hasExtension:function(e){return x.extensions.indexOf(e.toLowerCase())>=0},read:N,destroy:K,_gl:r,_refresh:te,poll:function(){ee(),u&&u.update()},now:ne,stats:s,getCachedCode:ie,preloadCachedCode:ae});return n.onDone(null,oe),oe}return Do})}),zy=h((e,t)=>{var n=wh(),r=Ry();t.exports=function(e,t,i){var a=e._fullLayout,o=!0;return a._glcanvas.each(function(n){if(n.regl){n.regl.preloadCachedCode(i);return}if(!(n.pick&&!a._has(`parcoords`))){try{n.regl=r({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:e._context.plotGlPixelRatio||window.devicePixelRatio,extensions:t||[],cachedCode:i||{}})}catch{o=!1}n.regl||(o=!1),o&&this.addEventListener(`webglcontextlost`,function(t){e&&e.emit&&e.emit(`plotly_webglcontextlost`,{event:t,layer:n.key})},!1)}}),o||n({container:a._glcontainer.node()}),o}}),By=h((e,t)=>{var n=U_(),r=dy(),i=fy(),a=Ly(),o=$(),s=Rn().selectMode,c=zy(),l=Xt(),u=mi(),d=P_().styleTextSelection,f={};function p(e,t,n,r){var i=e._size,a=e.width*r,o=e.height*r,s=i.l*r,c=i.b*r,l=i.r*r,u=i.t*r,d=i.w*r,f=i.h*r;return[s+t.domain[0]*d,c+n.domain[0]*f,a-l-(1-t.domain[1])*d,o-u-(1-n.domain[1])*f]}var e=t.exports=function(e,t,m){if(m.length){var h=e._fullLayout,g=t._scene,_=t.xaxis,v=t.yaxis,y,b;if(g){if(!c(e,[`ANGLE_instanced_arrays`,`OES_element_index_uint`],f)){g.init();return}var x=g.count,S=h._glcanvas.data()[0].regl;if(u(e,t,m),g.dirty){if((g.line2d||g.error2d)&&!(g.scatter2d||g.fill2d||g.glText)&&S.clear({color:!0,depth:!0}),g.error2d===!0&&(g.error2d=i(S)),g.line2d===!0&&(g.line2d=r(S)),g.scatter2d===!0&&(g.scatter2d=n(S)),g.fill2d===!0&&(g.fill2d=r(S)),g.glText===!0)for(g.glText=Array(x),y=0;y<x;y++)g.glText[y]=new a(S);if(g.glText){if(x>g.glText.length){var C=x-g.glText.length;for(y=0;y<C;y++)g.glText.push(new a(S))}else if(x<g.glText.length){var w=g.glText.length-x;g.glText.splice(x,w).forEach(function(e){e.destroy()})}for(y=0;y<x;y++)g.glText[y].update(g.textOptions[y])}if(g.line2d&&(g.line2d.update(g.lineOptions),g.lineOptions=g.lineOptions.map(function(e){if(e&&e.positions){for(var t=e.positions,n=0;n<t.length&&(isNaN(t[n])||isNaN(t[n+1]));)n+=2;for(var r=t.length-2;r>n&&(isNaN(t[r])||isNaN(t[r+1]));)r-=2;e.positions=t.slice(n,r+2)}return e}),g.line2d.update(g.lineOptions)),g.error2d){var T=(g.errorXOptions||[]).concat(g.errorYOptions||[]);g.error2d.update(T)}g.scatter2d&&g.scatter2d.update(g.markerOptions),g.fillOrder=o.repeat(null,x),g.fill2d&&(g.fillOptions=g.fillOptions.map(function(e,t){var n=m[t];if(!(!e||!n||!n[0]||!n[0].trace)){var r=n[0],i=r.trace,a=r.t,o=g.lineOptions[t],s,c,l=[];i._ownfill&&l.push(t),i._nexttrace&&l.push(t+1),l.length&&(g.fillOrder[t]=l);var u=[],d=o&&o.positions||a.positions,f,p;if(i.fill===`tozeroy`){for(f=0;f<d.length&&isNaN(d[f+1]);)f+=2;for(p=d.length-2;p>f&&isNaN(d[p+1]);)p-=2;d[f+1]!==0&&(u=[d[f],0]),u=u.concat(d.slice(f,p+2)),d[p+1]!==0&&(u=u.concat([d[p],0]))}else if(i.fill===`tozerox`){for(f=0;f<d.length&&isNaN(d[f]);)f+=2;for(p=d.length-2;p>f&&isNaN(d[p]);)p-=2;d[f]!==0&&(u=[0,d[f+1]]),u=u.concat(d.slice(f,p+2)),d[p]!==0&&(u=u.concat([0,d[p+1]]))}else if(i.fill===`toself`||i.fill===`tonext`){for(u=[],s=0,e.splitNull=!0,c=0;c<d.length;c+=2)(isNaN(d[c])||isNaN(d[c+1]))&&(u=u.concat(d.slice(s,c)),u.push(d[s],d[s+1]),u.push(null,null),s=c+2);u=u.concat(d.slice(s)),s&&u.push(d[s],d[s+1])}else{var h=i._nexttrace;if(h){var _=g.lineOptions[t+1];if(_){var v=_.positions;if(i.fill===`tonexty`){for(u=d.slice(),t=Math.floor(v.length/2);t--;){var y=v[t*2],b=v[t*2+1];isNaN(y)||isNaN(b)||u.push(y,b)}e.fill=h.fillcolor}}}}if(i._prevtrace&&i._prevtrace.fill===`tonext`){var x=g.lineOptions[t-1].positions,S=u.length/2;s=S;var C=[s];for(c=0;c<x.length;c+=2)(isNaN(x[c])||isNaN(x[c+1]))&&(C.push(c/2+S+1),s=c+2);u=u.concat(x),e.hole=C}return e.fillmode=i.fill,e.opacity=i.opacity,e.positions=u,e}}),g.fill2d.update(g.fillOptions))}var E=h.dragmode,D=s(E),O=h.clickmode.indexOf(`select`)>-1;for(let[e]of m)if(e){var k=e.trace,A=e.t,j=A.index,M=k._length,N=A.x,P=A.y;if(k.selectedpoints||D||O){if(D||=!0,k.selectedpoints){var F=g.selectBatch[j]=o.selIndices2selPoints(k),I={};for(b=0;b<F.length;b++)I[F[b]]=1;var L=[];for(b=0;b<M;b++)I[b]||L.push(b);g.unselectBatch[j]=L}var R=A.xpx=Array(M),z=A.ypx=Array(M);for(b=0;b<M;b++)R[b]=_.c2p(N[b]),z[b]=v.c2p(P[b])}else A.xpx=A.ypx=null}if(D){if(g.select2d||=n(h._glcanvas.data()[1].regl),g.scatter2d){var B=Array(x);for(y=0;y<x;y++)B[y]=g.selectBatch[y].length||g.unselectBatch[y].length?g.markerUnselectedOptions[y]:{};g.scatter2d.update(B)}g.select2d&&(g.select2d.update(g.markerOptions),g.select2d.update(g.markerSelectedOptions)),g.glText&&m.forEach(function(e){var t=((e||[])[0]||{}).trace||{};l.hasText(t)&&d(e)})}else g.scatter2d&&g.scatter2d.update(g.markerOptions);var V={viewport:p(h,_,v,e._context.plotGlPixelRatio),range:[(_._rl||_.range)[0],(v._rl||v.range)[0],(_._rl||_.range)[1],(v._rl||v.range)[1]]},H=o.repeat(V,g.count);g.fill2d&&g.fill2d.update(H),g.line2d&&g.line2d.update(H),g.error2d&&g.error2d.update(H.concat(H)),g.scatter2d&&g.scatter2d.update(H),g.select2d&&g.select2d.update(H),g.glText&&g.glText.forEach(function(e){e.update(V)})}}};e.reglPrecompiled=f}),Vy=h((e,t)=>{var n=I_();n.plot=By(),t.exports=n}),Hy=h((e,t)=>{t.exports=Vy()}),Uy=h((e,t)=>{var n=Tr(),r=Pt(),i=jt().axisHoverFormat,{hovertemplateAttrs:a,templatefallbackAttrs:o}=ze(),s=c_(),c=bt().idRegex,l=yt().templatedArray,u=z().extendFlat,d=n.marker,f=d.line,p=u(r(`marker.line`,{editTypeOverride:`calc`}),{width:u({},f.width,{editType:`calc`}),editType:`calc`}),m=u(r(`marker`),{symbol:d.symbol,angle:d.angle,size:u({},d.size,{editType:`markerSize`}),sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode,opacity:d.opacity,colorbar:d.colorbar,line:p,editType:`calc`});m.color.editType=m.cmin.editType=m.cmax.editType=`style`;function h(e){return{valType:`info_array`,freeLength:!0,editType:`calc`,items:{valType:`subplotid`,regex:c[e],editType:`plot`}}}t.exports={dimensions:l(`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:u({},s.text,{}),hovertext:u({},s.hovertext,{}),hovertemplate:a(),hovertemplatefallback:o(),xhoverformat:i(`x`),yhoverformat:i(`y`),marker:m,xaxes:h(`x`),yaxes:h(`y`),diagonal:{visible:{valType:`boolean`,dflt:!0,editType:`calc`},editType:`calc`},showupperhalf:{valType:`boolean`,dflt:!0,editType:`calc`},showlowerhalf:{valType:`boolean`,dflt:!0,editType:`calc`},selected:{marker:s.selected.marker,editType:`calc`},unselected:{marker:s.unselected.marker,editType:`calc`},opacity:s.opacity}}),Wy=h((e,t)=>{t.exports=function(e,t,n,r){r||=1/0;var i,a;for(i=0;i<t.length;i++)a=t[i],a.visible&&(r=Math.min(r,a[n].length));for(r===1/0&&(r=0),e._length=r,i=0;i<t.length;i++)a=t[i],a.visible&&(a._length=r);return r}}),Gy=h((e,t)=>{var n=$(),r=Vt(),i=Uy(),a=Xt(),o=Yr(),s=Wy(),c=l_().isOpenSymbol;t.exports=function(e,t,d,f){function p(r,a){return n.coerce(e,t,i,r,a)}var m=r(e,t,{name:`dimensions`,handleItemDefaults:l}),h=p(`diagonal.visible`),g=p(`showupperhalf`),_=p(`showlowerhalf`);if(!s(t,m,`values`)||!h&&!g&&!_){t.visible=!1;return}p(`text`),p(`hovertext`),p(`hovertemplate`),p(`hovertemplatefallback`),p(`xhoverformat`),p(`yhoverformat`),o(e,t,d,f,p,{noAngleRef:!0,noLineDash:!0,noStandOff:!0});var v=c(t.marker.symbol),y=a.isBubble(t);p(`marker.line.width`,v||y?1:0),u(e,t,f,p),n.coerceSelectionMarkerOpacity(t,p)};function l(e,t){function r(r,a){return n.coerce(e,t,i.dimensions,r,a)}r(`label`);var a=r(`values`);a&&a.length?r(`visible`):t.visible=!1,r(`axis.type`),r(`axis.matches`)}function u(e,t,n,r){var i=t.dimensions,a=i.length,o=t.showupperhalf,s=t.showlowerhalf,c=t.diagonal.visible,l,u,d=Array(a),f=Array(a);for(l=0;l<a;l++){var p=l?l+1:``;d[l]=`x`+p,f[l]=`y`+p}var m=r(`xaxes`,d),h=r(`yaxes`,f),g=t._diag=Array(a);t._xaxes={},t._yaxes={};var _=[],v=[];function y(e,r,i,a){if(e){var o=e.charAt(0),s=n._splomAxes[o];if(t[`_`+o+`axes`][e]=1,a.push(e),!(e in s)){var c=s[e]={};i&&(c.label=i.label||``,i.visible&&i.axis&&(i.axis.type&&(c.type=i.axis.type),i.axis.matches&&(c.matches=r)))}}}var b=!c&&!s,x=!c&&!o;for(t._axesDim={},l=0;l<a;l++){var S=i[l],C=l===0,w=l===a-1,T=C&&b||w&&x?void 0:m[l],E=C&&x||w&&b?void 0:h[l];y(T,E,S,_),y(E,T,S,v),g[l]=[T,E],t._axesDim[T]=l,t._axesDim[E]=l}for(l=0;l<_.length;l++)for(u=0;u<v.length;u++){var D=_[l]+v[u];(l>u&&o||l<u&&s||l===u&&(c||!s||!o))&&(n._splomSubplots[D]=1)}(!s||!c&&o&&s)&&(n._splomGridDflt.xside=`bottom`,n._splomGridDflt.yside=`left`)}}),Ky=h((e,t)=>{var n=$();t.exports=function(e,t){var r=e._fullLayout,i=t.uid,a=r._splomScenes;a||=r._splomScenes={};var o={dirty:!0,selectBatch:[],unselectBatch:[]},s={matrix:!1,selectBatch:[],unselectBatch:[]},c=a[t.uid];return c||(c=a[i]=n.extendFlat({},o,s),c.draw=function(){c.matrix&&c.matrix.draw&&(c.selectBatch.length||c.unselectBatch.length?c.matrix.draw(c.unselectBatch,c.selectBatch):c.matrix.draw()),c.dirty=!1},c.destroy=function(){c.matrix&&c.matrix.destroy&&c.matrix.destroy(),c.matrixOptions=null,c.selectBatch=null,c.unselectBatch=null,c=null}),c.dirty||n.extendFlat(c,o),c}}),qy=h((e,t)=>{var n=$(),r=xt(),i=ci().calcMarkerSize,a=ci().calcAxisExpansion,o=ai(),s=j_().markerSelection,c=j_().markerStyle,l=Ky(),u=O().BADNUM,d=s_().TOO_MANY_POINTS;t.exports=function(e,t){var f=t.dimensions,p=t._length,m={},h=m.cdata=[],g=m.data=[],_=t._visibleDims=[],v,y,b,x,S;function C(e,r){for(var i=e.makeCalcdata({v:r.values,vcalendar:t.calendar},`v`),a=0;a<i.length;a++)i[a]=i[a]===u?NaN:i[a];h.push(i),g.push(e.type===`log`?n.simpleMap(i,e.c2l):i)}for(v=0;v<f.length;v++)if(b=f[v],b.visible){if(x=r.getFromId(e,t._diag[v][0]),S=r.getFromId(e,t._diag[v][1]),x&&S&&x.type!==S.type){n.log(`Skipping splom dimension `+v+` with conflicting axis types`);continue}x?(C(x,b),S&&S.type===`category`&&(S._categories=x._categories.slice())):C(S,b),_.push(v)}o(e,t),n.extendFlat(m,c(e,t));var w=h.length*p>d,T;for(T=w?m.sizeAvg||Math.max(m.size,3):i(t,p),y=0;y<_.length;y++)v=_[y],b=f[v],x=r.getFromId(e,t._diag[v][0])||{},S=r.getFromId(e,t._diag[v][1])||{},a(e,t,x,S,h[y],h[y],T);var E=l(e,t);return E.matrix||=!0,E.matrixOptions=m,E.selectedOptions=s(e,t,t.selected),E.unselectedOptions=s(e,t,t.unselected),[{x:!1,y:!1,t:{},trace:t}]}}),Jy=h((e,t)=>{(function(){var e,n,r,i,a,o;typeof performance<`u`&&performance!==null&&performance.now?t.exports=function(){return performance.now()}:typeof process<`u`&&process!==null&&process.hrtime?(t.exports=function(){return(e()-a)/1e6},n=process.hrtime,e=function(){var e;return e=n(),e[0]*1e9+e[1]},i=e(),o=process.uptime()*1e9,a=i-o):Date.now?(t.exports=function(){return Date.now()-r},r=Date.now()):(t.exports=function(){return new Date().getTime()-r},r=new Date().getTime())}).call(e)}),Yy=h((e,t)=>{var n=Jy(),r=window,i=[`moz`,`webkit`],a=`AnimationFrame`,o=r[`request`+a],s=r[`cancel`+a]||r[`cancelRequest`+a];for(c=0;!o&&c<i.length;c++)o=r[i[c]+`Request`+a],s=r[i[c]+`Cancel`+a]||r[i[c]+`CancelRequest`+a];var c;(!o||!s)&&(l=0,u=0,d=[],f=1e3/60,o=function(e){if(d.length===0){var t=n(),r=Math.max(0,f-(t-l));l=r+t,setTimeout(function(){var e=d.slice(0);d.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(l)}catch(e){setTimeout(function(){throw e},0)}},Math.round(r))}return d.push({handle:++u,callback:e,cancelled:!1}),u},s=function(e){for(var t=0;t<d.length;t++)d[t].handle===e&&(d[t].cancelled=!0)});var l,u,d,f;t.exports=function(e){return o.call(r,e)},t.exports.cancel=function(){s.apply(r,arguments)},t.exports.polyfill=function(e){e||=r,e.requestAnimationFrame=o,e.cancelAnimationFrame=s}}),Xy=h((e,t)=>{t.exports=function(e,t){var n=typeof e==`number`,r=typeof t==`number`;n&&!r?(t=e,e=0):!n&&!r&&(e=0,t=0),e|=0,t|=0;var i=t-e;if(i<0)throw Error(`array length must be positive`);for(var a=Array(i),o=0,s=e;o<i;o++,s++)a[o]=s;return a}}),Zy=h((e,t)=>{var n=U_(),r=p_(),i=h_(),a=Yy(),o=Xy(),s=m_(),c=__();t.exports=l;function l(e,t){if(!(this instanceof l))return new l(e,t);this.traces=[],this.passes={},this.regl=e,this.scatter=n(e),this.canvas=this.scatter.canvas}l.prototype.render=function(...e){return e.length&&this.update(...e),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?this.planned??=a(()=>{this.draw(),this.dirty=!0,this.planned=null}):(this.draw(),this.dirty=!0,a(()=>{this.dirty=!1})),this)},l.prototype.update=function(...e){if(!e.length)return;for(let t=0;t<e.length;t++)this.updateItem(t,e[t]);this.traces=this.traces.filter(Boolean);let t=[],n=0;for(let e=0;e<this.traces.length;e++){let r=this.traces[e],i=this.traces[e].passes;for(let e=0;e<i.length;e++)t.push(this.passes[i[e]]);r.passOffset=n,n+=r.passes.length}return this.scatter.update(...t),this},l.prototype.updateItem=function(e,t){let{regl:n}=this;if(t===null)return this.traces[e]=null,this;if(!t)return this;let a=r(t,{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`}),o=this.traces[e]||(this.traces[e]={id:e,buffer:n.buffer({usage:`dynamic`,type:`float`,data:new Uint8Array}),color:`black`,marker:null,size:12,borderColor:`transparent`,borderSize:1,viewport:s([n._gl.drawingBufferWidth,n._gl.drawingBufferHeight]),padding:[0,0,0,0],opacity:1,diagonal:!0,upper:!0,lower:!0});if(a.color!=null&&(o.color=a.color),a.size!=null&&(o.size=a.size),a.marker!=null&&(o.marker=a.marker),a.borderColor!=null&&(o.borderColor=a.borderColor),a.borderSize!=null&&(o.borderSize=a.borderSize),a.opacity!=null&&(o.opacity=a.opacity),a.viewport&&(o.viewport=s(a.viewport)),a.diagonal!=null&&(o.diagonal=a.diagonal),a.upper!=null&&(o.upper=a.upper),a.lower!=null&&(o.lower=a.lower),a.data){o.buffer(c(a.data)),o.columns=a.data.length,o.count=a.data[0].length,o.bounds=[];for(let e=0;e<o.columns;e++)o.bounds[e]=i(a.data[e],1)}let l;a.range&&(o.range=a.range,l=o.range&&typeof o.range[0]!=`number`),a.domain&&(o.domain=a.domain);let p=!1;a.padding!=null&&(Array.isArray(a.padding)&&a.padding.length===o.columns&&typeof a.padding[a.padding.length-1]==`number`?(o.padding=a.padding.map(f),p=!0):o.padding=f(a.padding));let m=o.columns,h=o.count,g=o.viewport.width,_=o.viewport.height,v=o.viewport.x,y=o.viewport.y,b=g/m,x=_/m;o.passes=[];for(let e=0;e<m;e++)for(let t=0;t<m;t++){if(!o.diagonal&&t===e||!o.upper&&e>t||!o.lower&&e<t)continue;let n=u(o.id,e,t),r=this.passes[n]||(this.passes[n]={});if(a.data&&(a.transpose?r.positions={x:{buffer:o.buffer,offset:t,count:h,stride:m},y:{buffer:o.buffer,offset:e,count:h,stride:m}}:r.positions={x:{buffer:o.buffer,offset:t*h,count:h},y:{buffer:o.buffer,offset:e*h,count:h}},r.bounds=d(o.bounds,e,t)),a.domain||a.viewport||a.data){let n=p?d(o.padding,e,t):o.padding;if(o.domain){let[i,a,s,c]=d(o.domain,e,t);r.viewport=[v+i*g+n[0],y+a*_+n[1],v+s*g-n[2],y+c*_-n[3]]}else r.viewport=[v+t*b+b*n[0],y+e*x+x*n[1],v+(t+1)*b-b*n[2],y+(e+1)*x-x*n[3]]}a.color&&(r.color=o.color),a.size&&(r.size=o.size),a.marker&&(r.marker=o.marker),a.borderSize&&(r.borderSize=o.borderSize),a.borderColor&&(r.borderColor=o.borderColor),a.opacity&&(r.opacity=o.opacity),a.range&&(r.range=l?d(o.range,e,t):o.range||r.bounds),o.passes.push(n)}return this},l.prototype.draw=function(...e){if(!e.length)this.scatter.draw();else{let t=[];for(let n=0;n<e.length;n++)if(typeof e[n]==`number`){let{passes:r,passOffset:i}=this.traces[e[n]];t.push(...o(i,i+r.length))}else if(e[n].length){let r=e[n],{passes:i,passOffset:a}=this.traces[n];i=i.map((e,n)=>{t[a+n]=r})}this.scatter.draw(...t)}return this},l.prototype.destroy=function(){return this.traces.forEach(e=>{e.buffer&&e.buffer.destroy&&e.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function u(e,t,n){let r=e.id==null?e:e.id,i=t,a=n;return r<<16|(i&255)<<8|a&255}function d(e,t,n){let r,i,a,o,s=e[t],c=e[n];return s.length>2?(s[0],s[2],r=s[1],i=s[3]):s.length?(r=s[0],i=s[1]):(s.x,r=s.y,s.x+s.width,i=s.y+s.height),c.length>2?(a=c[0],o=c[2],c[1],c[3]):c.length?(a=c[0],o=c[1]):(a=c.x,c.y,o=c.x+c.width,c.y+c.height),[a,r,o,i]}function f(e){if(typeof e==`number`)return[e,e,e,e];if(e.length===2)return[e[0],e[1],e[0],e[1]];{let t=s(e);return[t.x,t.y,t.x+t.width,t.y+t.height]}}}),Qy=h((e,t)=>{var n=Zy(),r=$(),i=xt(),a=Rn().selectMode;t.exports=function(e,t,n){if(n.length)for(var r=0;r<n.length;r++)o(e,n[r][0])};function o(e,t){var o=e._fullLayout,s=o._size,c=t.trace,l=t.t,u=o._splomScenes[c.uid],d=u.matrixOptions,f=d.cdata,p=o._glcanvas.data()[0].regl,m=o.dragmode,h,g,_,v,y;if(f.length!==0){d.lower=c.showupperhalf,d.upper=c.showlowerhalf,d.diagonal=c.diagonal.visible;var b=c._visibleDims,x=f.length,S=u.viewOpts={};for(S.ranges=Array(x),S.domains=Array(x),y=0;y<b.length;y++){_=b[y];var C=S.ranges[y]=[,,,,],w=S.domains[y]=[,,,,];h=i.getFromId(e,c._diag[_][0]),h&&(C[0]=h._rl[0],C[2]=h._rl[1],w[0]=h.domain[0],w[2]=h.domain[1]),g=i.getFromId(e,c._diag[_][1]),g&&(C[1]=g._rl[0],C[3]=g._rl[1],w[1]=g.domain[0],w[3]=g.domain[1])}var T=e._context.plotGlPixelRatio,E=s.l*T,D=s.b*T,O=s.w*T,k=s.h*T;S.viewport=[E,D,O+E,k+D],u.matrix===!0&&(u.matrix=n(p));var A=o.clickmode.indexOf(`select`)>-1,j=a(m)||!!c.selectedpoints||A,M=!0;if(j){var N=c._length;if(c.selectedpoints){u.selectBatch=c.selectedpoints;var P=c.selectedpoints,F={};for(_=0;_<P.length;_++)F[P[_]]=!0;var I=[];for(_=0;_<N;_++)F[_]||I.push(_);u.unselectBatch=I}var L=l.xpx=Array(x),R=l.ypx=Array(x);for(y=0;y<b.length;y++){if(_=b[y],h=i.getFromId(e,c._diag[_][0]),h)for(L[y]=Array(N),v=0;v<N;v++)L[y][v]=h.c2p(f[y][v]);if(g=i.getFromId(e,c._diag[_][1]),g)for(R[y]=Array(N),v=0;v<N;v++)R[y][v]=g.c2p(f[y][v])}if(u.selectBatch.length||u.unselectBatch.length){var z=r.extendFlat({},d,u.unselectedOptions,S),B=r.extendFlat({},d,u.selectedOptions,S);u.matrix.update(z,B),M=!1}}else l.xpx=l.ypx=null;if(M){var V=r.extendFlat({},d,S);u.matrix.update(V,null)}}}}),$y=h(e=>{e.getDimIndex=function(e,t){for(var n=t._id,r={x:0,y:1}[n.charAt(0)],i=e._visibleDims,a=0;a<i.length;a++){var o=i[a];if(e._diag[o][r]===n)return a}return!1}}),eb=h((e,t)=>{var n=$y(),r=o_().calcHover,i=sn().getFromId,a=z().extendFlat;function o(e,t,n,r,o){o||={};var c=(r||``).charAt(0)===`x`,l=(r||``).charAt(0)===`y`,u=s(e,t,n);if((c||l)&&o.hoversubplots===`axis`&&u[0])for(var d=(c?e.xa:e.ya)._subplotsWith,f=o.gd,p=a({},e),m=0;m<d.length;m++){var h=d[m];if(h!==e.xa._id+e.ya._id){l?p.xa=i(f,h,`x`):p.ya=i(f,h,`y`);var g=s(p,t,n,c||l);u=u.concat(g)}}return u}function s(e,t,i,a){var o=e.cd[0].trace,s=e.scene.matrixOptions.cdata,c=e.xa,l=e.ya,u=c.c2p(t),d=l.c2p(i),f=e.distance,p=n.getDimIndex(o,c),m=n.getDimIndex(o,l);if(p===!1||m===!1)return[e];for(var h=s[p],g=s[m],_,v,y=f,b=0;b<h.length;b++)if(!(a&&b!==e.index)){var x=h[b],S=g[b],C=c.c2p(x)-u,w=l.c2p(S)-d,T=Math.sqrt(C*C+w*w);(a||T<y)&&(y=v=T,_=b)}return e.index=_,e.distance=y,e.dxy=v,_===void 0?[e]:[r(e,h,g,o)]}t.exports={hoverPoints:o}}),tb=h((e,t)=>{var n=$(),r=n.pushUnique,i=Xt(),a=$y();t.exports=function(e,t){var o=e.cd,s=o[0].trace,c=o[0].t,l=e.scene,u=l.matrixOptions.cdata,d=e.xaxis,f=e.yaxis,p=[];if(!l)return p;var m=!i.hasMarkers(s)&&!i.hasText(s);if(s.visible!==!0||m)return p;var h=a.getDimIndex(s,d),g=a.getDimIndex(s,f);if(h===!1||g===!1)return p;var _=c.xpx[h],v=c.ypx[g],y=u[h],b=u[g],x=(e.scene.selectBatch||[]).slice(),S=[];if(t!==!1&&!t.degenerate)for(var C=0;C<y.length;C++)t.contains([_[C],v[C]],null,C,e)?(p.push({pointNumber:C,x:y[C],y:b[C]}),r(x,C)):x.indexOf(C)===-1?S.push(C):r(x,C);var w=l.matrixOptions;return!x.length&&!S.length?l.matrix.update(w,null):!l.selectBatch.length&&!l.unselectBatch.length&&l.matrix.update(l.unselectedOptions,n.extendFlat({},w,l.selectedOptions,l.viewOpts)),l.selectBatch=x,l.unselectBatch=S,p}}),nb=h((e,t)=>{var n=$(),r=ai(),i=j_().markerStyle;t.exports=function(e,t){var a=t.trace,o=e._fullLayout._splomScenes[a.uid];if(o){r(e,a),n.extendFlat(o.matrixOptions,i(e,a));var s=n.extendFlat({},o.matrixOptions,o.viewOpts);o.matrix.update(s,null)}}}),rb=h((e,t)=>{var n=Ke(),r=Oa();t.exports={moduleType:`trace`,name:`splom`,categories:[`gl`,`regl`,`cartesian`,`symbols`,`showLegend`,`scatter-like`],attributes:Uy(),supplyDefaults:Gy(),colorbar:gi(),calc:qy(),plot:Qy(),hoverPoints:eb().hoverPoints,selectPoints:tb(),editStyle:nb(),meta:{}},n.register(r)}),ib=h((e,t)=>{var n=dy(),r=Ke(),i=zy(),a=wt().getModuleCalcData,o=Ai(),s=xt().getFromId,c=sn().shouldShowZeroLine,l=`splom`,u={};function d(e){var t=e._fullLayout,n=r.getModule(l),o=a(e.calcdata,n)[0];i(e,[`ANGLE_instanced_arrays`,`OES_element_index_uint`],u)&&(t._hasOnlyLargeSploms&&m(e),n.plot(e,{},o))}function f(e){var t=e.calcdata,n=e._fullLayout;n._hasOnlyLargeSploms&&m(e);for(var r=0;r<t.length;r++){var i=t[r][0].trace,a=n._splomScenes[i.uid];i.type===`splom`&&a&&a.matrix&&p(e,i,a)}}function p(e,t,n){for(var r=n.matrixOptions.data.length,i=t._visibleDims,a=n.viewOpts.ranges=Array(r),o=0;o<i.length;o++){var c=i[o],l=a[o]=[,,,,],u=s(e,t._diag[c][0]);u&&(l[0]=u.r2l(u.range[0]),l[2]=u.r2l(u.range[1]));var d=s(e,t._diag[c][1]);d&&(l[1]=d.r2l(d.range[0]),l[3]=d.r2l(d.range[1]))}n.selectBatch.length||n.unselectBatch.length?n.matrix.update({ranges:a},{ranges:a}):n.matrix.update({ranges:a})}function m(e){var t=e._fullLayout,r=t._glcanvas.data()[0].regl,i=t._splomGrid;i||=t._splomGrid=n(r),i.update(h(e))}function h(e){var t=e._context.plotGlPixelRatio,n=e._fullLayout,r=n._size,i=[0,0,n.width*t,n.height*t],a={},o;function s(e,n,r,o,s,c){r*=t,o*=t,s*=t,c*=t;var l=n[e+`color`],u=n[e+`width`],d=String(l+u);d in a?a[d].data.push(NaN,NaN,r,o,s,c):a[d]={data:[r,o,s,c],join:`rect`,thickness:u*t,color:l,viewport:i,range:i,overlay:!1}}for(o in n._splomSubplots){var l=n._plots[o],u=l.xaxis,d=l.yaxis,f=u._gridVals,p=d._gridVals,m=u._offset,h=u._length,g=d._length,_=r.b+d.domain[0]*r.h,v=-d._m,y=-v*d.r2l(d.range[0],d.calendar),b,x;if(u.showgrid)for(o=0;o<f.length;o++)b=m+u.l2p(f[o].x),s(`grid`,u,b,_,b,_+g);if(d.showgrid)for(o=0;o<p.length;o++)x=_+y+v*p[o].x,s(`grid`,d,m,x,m+h,x);c(e,u,d)&&(b=m+u.l2p(0),s(`zeroline`,u,b,_,b,_+g)),c(e,d,u)&&(x=_+y+0,s(`zeroline`,d,m,x,m+h,x))}var S=[];for(o in a)S.push(a[o]);return S}function g(e,t,n,r){var i={},a;if(r._splomScenes){for(a=0;a<e.length;a++){var s=e[a];s.type===`splom`&&(i[s.uid]=1)}for(a=0;a<n.length;a++){var c=n[a];if(!i[c.uid]){var l=r._splomScenes[c.uid];l&&l.destroy&&l.destroy(),r._splomScenes[c.uid]=null,delete r._splomScenes[c.uid]}}}Object.keys(r._splomScenes||{}).length===0&&delete r._splomScenes,r._splomGrid&&!t._hasOnlyLargeSploms&&r._hasOnlyLargeSploms&&(r._splomGrid.destroy(),r._splomGrid=null,delete r._splomGrid),o.clean(e,t,n,r)}t.exports={name:l,attr:o.attr,attrRegex:o.attrRegex,layoutAttributes:o.layoutAttributes,supplyLayoutDefaults:o.supplyLayoutDefaults,drawFramework:o.drawFramework,plot:d,drag:f,updateGrid:m,clean:g,updateFx:o.updateFx,toSVG:o.toSVG,reglPrecompiled:u}}),ab=h((e,t)=>{var n=rb();n.basePlotModule=ib(),t.exports=n}),ob=h((e,t)=>{t.exports=ab()}),sb=h((e,t)=>{var n=Pt(),r=Mt(),i=B(),a=Da().attributes,o=z().extendFlat,s=yt().templatedArray;t.exports={domain:a({name:`parcoords`,trace:!0,editType:`plot`}),labelangle:{valType:`angle`,dflt:0,editType:`plot`},labelside:{valType:`enumerated`,values:[`top`,`bottom`],dflt:`top`,editType:`plot`},labelfont:i({editType:`plot`}),tickfont:i({autoShadowDflt:!0,editType:`plot`}),rangefont:i({editType:`plot`}),dimensions:s(`dimension`,{label:{valType:`string`,editType:`plot`},tickvals:o({},r.tickvals,{editType:`plot`}),ticktext:o({},r.ticktext,{editType:`plot`}),tickformat:o({},r.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:o({editType:`calc`},n(`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`}}}),cb=h((e,t)=>{t.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`}}}),lb=h((e,t)=>{var n=Je();function r(e){return[e]}t.exports={keyFun:function(e){return e.key},repeat:r,descend:n,wrap:r,unwrap:function(e){return e[0]}}}),ub=h((e,t)=>{var n=cb(),r=S(),i=lb().keyFun,a=lb().repeat,o=$().sorterAsc,s=$().strTranslate,c=n.bar.snapRatio;function l(e,t){return e*(1-c)+t*c}var u=n.bar.snapClose;function d(e,t){return e*(1-u)+t*u}function f(e,t,n,r){if(p(n,r))return n;var i=e?-1:1,a=0,o=t.length-1;if(i<0){var s=a;a=o,o=s}for(var c=t[a],u=c,f=a;i*f<i*o;f+=i){var m=f+i,h=t[m];if(i*n<i*d(c,h))return l(c,u);if(i*n<i*h||m===o)return l(h,c);u=c,c=h}}function p(e,t){for(var n=0;n<t.length;n++)if(e>=t[n][0]&&e<=t[n][1])return!0;return!1}function m(e){e.attr(`x`,-n.bar.captureWidth/2).attr(`width`,n.bar.captureWidth)}function h(e){e.attr(`visibility`,`visible`).style(`visibility`,`visible`).attr(`fill`,`yellow`).attr(`opacity`,0)}function g(e){if(!e.brush.filterSpecified)return`0,`+e.height;for(var t=_(e.brush.filter.getConsolidated(),e.height),n=[0],r,i,a,o=t.length?t[0][0]:null,s=0;s<t.length;s++)r=t[s],i=r[1]-r[0],n.push(o),n.push(i),a=s+1,a<t.length&&(o=t[a][0]-r[1]);return n.push(e.height),n}function _(e,t){return e.map(function(e){return e.map(function(e){return Math.max(0,e*t)}).sort(o)})}function v(e,t){var r=n.bar.handleHeight;if(!(t>e[1]+r||t<e[0]-r))return t>=.9*e[1]+.1*e[0]?`n`:t<=.9*e[0]+.1*e[1]?`s`:`ns`}function y(){r.select(document.body).style(`cursor`,null)}function b(e){e.attr(`stroke-dasharray`,g)}function x(e,t){var i=r.select(e).selectAll(`.highlight, .highlight-shadow`);b(t?i.transition().duration(n.bar.snapDuration).each(`end`,t):i)}function C(e,t){var n=e.brush,r=n.filterSpecified,i=NaN,a={},o;if(r){var s=e.height,c=n.filter.getConsolidated(),l=_(c,s),u=NaN,d=NaN,f=NaN;for(o=0;o<=l.length;o++){var p=l[o];if(p&&p[0]<=t&&t<=p[1]){u=o;break}else if(d=o?o-1:NaN,p&&p[0]>t){f=o;break}}if(i=u,isNaN(i)&&(i=isNaN(d)||isNaN(f)?isNaN(d)?f:d:t-l[d][1]<l[f][0]-t?d:f),!isNaN(i)){var m=l[i],h=v(m,t);h&&(a.interval=c[i],a.intervalPix=m,a.region=h)}}if(e.ordinal&&!a.region){var g=e.unitTickvals,y=e.unitToPaddedPx.invert(t);for(o=0;o<g.length;o++){var b=[g[Math.max(o-1,0)]*.25+g[o]*.75,g[Math.min(o+1,g.length-1)]*.25+g[o]*.75];if(y>=b[0]&&y<=b[1]){a.clickableOrdinalRange=b;break}}}return a}function w(e,t){r.event.sourceEvent.stopPropagation();var i=t.height-r.mouse(e)[1]-2*n.verticalPadding,a=t.unitToPaddedPx.invert(i),o=t.brush,s=C(t,i),c=s.interval,l=o.svgBrush;if(l.wasDragged=!1,l.grabbingBar=s.region===`ns`,l.grabbingBar){var u=c.map(t.unitToPaddedPx);l.grabPoint=i-u[0]-n.verticalPadding,l.barLength=u[1]-u[0]}l.clickableOrdinalRange=s.clickableOrdinalRange,l.stayingIntervals=t.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],c&&(l.stayingIntervals=l.stayingIntervals.filter(function(e){return e[0]!==c[0]&&e[1]!==c[1]})),l.startExtent=s.region?c[s.region===`s`?1:0]:a,t.parent.inBrushDrag=!0,l.brushStartCallback()}function T(e,t){r.event.sourceEvent.stopPropagation();var i=t.height-r.mouse(e)[1]-2*n.verticalPadding,a=t.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[i-a.grabPoint,i+a.barLength-a.grabPoint].map(t.unitToPaddedPx.invert):a.newExtent=[a.startExtent,t.unitToPaddedPx.invert(i)].sort(o),t.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(t),x(e.parentNode)}function E(e,t){var n=t.brush,i=n.filter,a=n.svgBrush;a._dragging||(D(e,t),T(e,t),t.brush.svgBrush.wasDragged=!1),a._dragging=!1,r.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,t.parent.inBrushDrag=!1,y(),!a.wasDragged){a.wasDragged=void 0,a.clickableOrdinalRange?n.filterSpecified&&t.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],n.filterSpecified=!0):o?(a.extent=a.stayingIntervals,a.extent.length===0&&N(n)):N(n),a.brushCallback(t),x(e.parentNode),a.brushEndCallback(n.filterSpecified?i.getConsolidated():[]);return}var s=function(){i.set(i.getConsolidated())};if(t.ordinal){var c=t.unitTickvals;c[c.length-1]<c[0]&&c.reverse(),a.newExtent=[f(0,c,a.newExtent[0],a.stayingIntervals),f(1,c,a.newExtent[1],a.stayingIntervals)];var l=a.newExtent[1]>a.newExtent[0];a.extent=a.stayingIntervals.concat(l?[a.newExtent]:[]),a.extent.length||N(n),a.brushCallback(t),l?x(e.parentNode,s):(s(),x(e.parentNode))}else s();a.brushEndCallback(n.filterSpecified?i.getConsolidated():[])}function D(e,t){var i=C(t,t.height-r.mouse(e)[1]-2*n.verticalPadding),a=`crosshair`;i.clickableOrdinalRange?a=`pointer`:i.region&&(a=i.region+`-resize`),r.select(document.body).style(`cursor`,a)}function O(e){e.on(`mousemove`,function(e){r.event.preventDefault(),e.parent.inBrushDrag||D(this,e)}).on(`mouseleave`,function(e){e.parent.inBrushDrag||y()}).call(r.behavior.drag().on(`dragstart`,function(e){w(this,e)}).on(`drag`,function(e){T(this,e)}).on(`dragend`,function(e){E(this,e)}))}function k(e,t){return e[0]-t[0]}function A(e,t,r){var i=r._context.staticPlot,o=e.selectAll(`.background`).data(a);o.enter().append(`rect`).classed(`background`,!0).call(m).call(h).style(`pointer-events`,i?`none`:`auto`).attr(`transform`,s(0,n.verticalPadding)),o.call(O).attr(`height`,function(e){return e.height-n.verticalPadding});var c=e.selectAll(`.highlight-shadow`).data(a);c.enter().append(`line`).classed(`highlight-shadow`,!0).attr(`x`,-n.bar.width/2).attr(`stroke-width`,n.bar.width+n.bar.strokeWidth).attr(`stroke`,t).attr(`opacity`,n.bar.strokeOpacity).attr(`stroke-linecap`,`butt`),c.attr(`y1`,function(e){return e.height}).call(b);var l=e.selectAll(`.highlight`).data(a);l.enter().append(`line`).classed(`highlight`,!0).attr(`x`,-n.bar.width/2).attr(`stroke-width`,n.bar.width-n.bar.strokeWidth).attr(`stroke`,n.bar.fillColor).attr(`opacity`,n.bar.fillOpacity).attr(`stroke-linecap`,`butt`),l.attr(`y1`,function(e){return e.height}).call(b)}function j(e,t,r){var o=e.selectAll(`.`+n.cn.axisBrush).data(a,i);o.enter().append(`g`).classed(n.cn.axisBrush,!0),A(o,t,r)}function M(e){return e.svgBrush.extent.map(function(e){return e.slice()})}function N(e){e.filterSpecified=!1,e.svgBrush.extent=[[-1/0,1/0]]}function P(e){return function(t){var n=t.brush,r=M(n).slice();n.filter.set(r),e()}}function F(e){for(var t=e.slice(),n=[],r,i=t.shift();i;){for(r=i.slice();(i=t.shift())&&i[0]<=r[1];)r[1]=Math.max(r[1],i[1]);n.push(r)}return n.length===1&&n[0][0]>n[0][1]&&(n=[]),n}function I(){var e=[],t,n;return{set:function(r){e=r.map(function(e){return e.slice().sort(o)}).sort(k),e.length===1&&e[0][0]===-1/0&&e[0][1]===1/0&&(e=[[0,-1]]),t=F(e),n=e.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0])},get:function(){return e.slice()},getConsolidated:function(){return t},getBounds:function(){return n}}}function L(e,t,n,r,i,a){var o=I();return o.set(n),{filter:o,filterSpecified:t,svgBrush:{extent:[],brushStartCallback:r,brushCallback:P(i),brushEndCallback:a}}}function R(e,t){if(Array.isArray(e[0])?(e=e.map(function(e){return e.sort(o)}),e=t.multiselect?F(e.sort(k)):[e[0]]):e=[e.sort(o)],t.tickvals){var n=t.tickvals.slice().sort(o);if(e=e.map(function(e){var t=[f(0,n,e[0],[]),f(1,n,e[1],[])];if(t[1]>t[0])return t}).filter(function(e){return e}),!e.length)return}return e.length>1?e:e[0]}t.exports={makeBrush:L,ensureAxisBrush:j,cleanRanges:R}}),db=h((e,t)=>{var n=$(),r=At().hasColorscale,i=Gt(),a=Da().defaults,o=Vt(),s=sn(),c=sb(),l=ub(),u=cb().maxDimensionCount,d=Wy();function f(e,t,a,o,s){var c=s(`line.color`,a);if(r(e,`line`)&&n.isArrayOrTypedArray(c)){if(c.length)return s(`line.colorscale`),i(e,t,o,s,{prefix:`line.`,cLetter:`c`}),c.length;t.line.color=a}return 1/0}function p(e,t,r,i){function a(r,i){return n.coerce(e,t,c.dimensions,r,i)}var o=a(`values`),u=a(`visible`);if(o&&o.length||(u=t.visible=!1),u){a(`label`),a(`tickvals`),a(`ticktext`),a(`tickformat`),t._ax={_id:`y`,type:`linear`,showexponent:`all`,exponentformat:`B`,range:a(`range`)},s.setConvert(t._ax,i.layout),a(`multiselect`);var d=a(`constraintrange`);d&&(t.constraintrange=l.cleanRanges(d,t))}}t.exports=function(e,t,r,i){function s(r,i){return n.coerce(e,t,c,r,i)}var l=e.dimensions;Array.isArray(l)&&l.length>u&&(n.log(`parcoords traces support up to `+u+` dimensions at the moment`),l.splice(u));var m=o(e,t,{name:`dimensions`,layout:i,handleItemDefaults:p}),h=f(e,t,r,i,s);a(t,i,s),(!Array.isArray(m)||!m.length)&&(t.visible=!1),d(t,m,`values`,h);var g=n.extendFlat({},i.font,{size:Math.round(i.font.size/1.2)});n.coerceFont(s,`labelfont`,g),n.coerceFont(s,`tickfont`,g,{autoShadowDflt:!0}),n.coerceFont(s,`rangefont`,g),s(`labelangle`),s(`labelside`),s(`unselected.line.color`),s(`unselected.line.opacity`)}}),fb=h((e,t)=>{var n=$().isArrayOrTypedArray,r=Yt(),i=lb().wrap;t.exports=function(e,t){var o,s;return r.hasColorscale(t,`line`)&&n(t.line.color)?(o=t.line.color,s=r.extractOpts(t.line).colorscale,r.calc(e,t,{vals:o,containerStr:`line`,cLetter:`c`})):(o=a(t._length),s=[[0,t.line.color],[1,t.line.color]]),i({lineColor:o,cscale:s})};function a(e){for(var t=Array(e),n=0;n<e;n++)t[n]=.5;return t}});function pb(e){var t,n=[],r=1,i;if(typeof e==`number`||typeof e==`number`)return{space:`rgb`,values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(e=String(e).toLowerCase(),mb.default[e])n=mb.default[e].slice(),i=`rgb`;else if(e===`transparent`)r=0,i=`rgb`,n=[0,0,0];else if(e[0]===`#`){var a=e.slice(1),o=a.length,s=o<=4;r=1,s?(n=[parseInt(a[0]+a[0],16),parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16)],o===4&&(r=parseInt(a[3]+a[3],16)/255)):(n=[parseInt(a[0]+a[1],16),parseInt(a[2]+a[3],16),parseInt(a[4]+a[5],16)],o===8&&(r=parseInt(a[6]+a[7],16)/255)),n[0]||=0,n[1]||=0,n[2]||=0,i=`rgb`}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){i=t[1].replace(/a$/,``);var c=i===`cmyk`?4:i===`gray`?1:3;n=t[2].trim().split(/\s*[,\/]\s*|\s+/),i===`color`&&(i=n.shift()),n=n.map(function(e,t){if(e[e.length-1]===`%`)return e=parseFloat(e)/100,t===3?e:i===`rgb`?e*255:i[0]===`h`||i[0]===`l`&&!t?e*100:i===`lab`?e*125:i===`lch`?t<2?e*150:e*360:i[0]===`o`&&!t?e:i===`oklab`?e*.4:i===`oklch`?t<2?e*.4:e*360:e;if(i[t]===`h`||t===2&&i[i.length-1]===`h`){if(gb[e]!==void 0)return gb[e];if(e.endsWith(`deg`))return parseFloat(e);if(e.endsWith(`turn`))return parseFloat(e)*360;if(e.endsWith(`grad`))return parseFloat(e)*360/400;if(e.endsWith(`rad`))return parseFloat(e)*180/Math.PI}return e===`none`?0:parseFloat(e)}),r=n.length>c?n.pop():1}else /[0-9](?:\s|\/|,)/.test(e)&&(n=e.match(/([0-9]+)/g).map(function(e){return parseFloat(e)}),i=(e.match(/([a-z])/gi)?.join(``))?.toLowerCase()||`rgb`);return{space:i,values:n,alpha:r}}var mb,hb,gb,_b=m(()=>{mb=v(sh(),1),hb=pb,gb={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}),vb,yb=m(()=>{vb={name:`rgb`,min:[0,0,0],max:[255,255,255],channel:[`red`,`green`,`blue`],alias:[`RGB`]}}),bb,xb=m(()=>{yb(),bb={name:`hsl`,min:[0,0,0],max:[360,100,100],channel:[`hue`,`saturation`,`lightness`],alias:[`HSL`],rgb:function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a,o,s,c,l=0;if(n===0)return c=r*255,[c,c,c];for(a=r<.5?r*(1+n):r+n-r*n,i=2*r-a,s=[0,0,0];l<3;)o=t+1/3*-(l-1),o<0?o++:o>1&&o--,c=6*o<1?i+(a-i)*6*o:2*o<1?a:3*o<2?i+(a-i)*(2/3-o)*6:i,s[l++]=c*255;return s}},vb.hsl=function(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c,l;return a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(s*60,360),s<0&&(s+=360),l=(i+a)/2,c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]}}),Sb={};g(Sb,{default:()=>Cb});function Cb(e){Array.isArray(e)&&e.raw&&(e=String.raw(...arguments)),e instanceof Number&&(e=+e);var t,n=hb(e);if(!n.space)return[];let r=n.space[0]===`h`?bb.min:vb.min,i=n.space[0]===`h`?bb.max:vb.max;return t=[,,,],t[0]=Math.min(Math.max(n.values[0],r[0]),i[0]),t[1]=Math.min(Math.max(n.values[1],r[1]),i[1]),t[2]=Math.min(Math.max(n.values[2],r[2]),i[2]),n.space[0]===`h`&&(t=bb.rgb(t)),t.push(Math.min(Math.max(n.alpha,0),1)),t}var wb=m(()=>{_b(),yb(),xb()}),Tb=h(e=>{var t=$().isTypedArray;e.convertTypedArray=function(e){return t(e)?Array.prototype.slice.call(e):e},e.isOrdinal=function(e){return!!e.tickvals},e.isVisible=function(e){return e.visible||!(`visible`in e)}}),Eb=h((e,t)=>{var n=[`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(`
`),r=[`precision highp float;`,``,`varying vec4 fragColor;`,``,`void main() {`,` gl_FragColor = fragColor;`,`}`].join(`
`),i=cb().maxDimensionCount,a=$(),o=1e-6,s=2048,c=new Uint8Array(4),l=new Uint8Array(4),u={shape:[256,1],format:`rgba`,type:`uint8`,mag:`nearest`,min:`nearest`};function d(e){e.read({x:0,y:0,width:1,height:1,data:c})}function f(e,t,n,r,i){var a=e._gl;a.enable(a.SCISSOR_TEST),a.scissor(t,n,r,i),e.clear({color:[0,0,0,0],depth:1})}function p(e,t,n,r,i,a){var o=a.key;function s(c){var l=Math.min(r,i-c*r);c===0&&(window.cancelAnimationFrame(n.currentRafs[o]),delete n.currentRafs[o],f(e,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),!n.clearOnly&&(a.count=2*l,a.offset=2*c*r,t(a),c*r+l<i&&(n.currentRafs[o]=window.requestAnimationFrame(function(){s(c+1)})),n.drawCompleted=!1)}n.drawCompleted||=(d(e),!0),s(0)}function m(e){return Math.max(o,Math.min(1-o,e))}function h(e,t){for(var n=Array(256),r=0;r<256;r++)n[r]=e(r/255).concat(t);return n}function g(e,t){return(e>>>8*t)%256/255}function _(e,t,n){for(var r=Array(e*(i+4)),a=0,o=0;o<e;o++){for(var s=0;s<i;s++)r[a++]=s<t.length?t[s].paddedUnitValues[o]:.5;r[a++]=g(o,2),r[a++]=g(o,1),r[a++]=g(o,0),r[a++]=m(n[o])}return r}function v(e,t,n){for(var r=Array(t*8),i=0,a=0;a<t;a++)for(var o=0;o<2;o++)for(var s=0;s<4;s++){var c=e*4+s,l=n[a*64+c];c===63&&o===0&&(l*=-1),r[i++]=l}return r}function y(e){return(`0`+e).slice(-2)}function b(e){return e<i?`p`+y(e+1)+`_`+y(e+4):`colors`}function x(e,t,n){for(var r=0;r<=i;r+=4)e[b(r)](v(r/4,t,n))}function S(e){for(var t={},n=0;n<=i;n+=4)t[b(n)]=e.buffer({usage:`dynamic`,type:`float`,data:new Uint8Array});return t}function C(e,t,n,r,i,o,s,c,l,u,d,f,p,m){for(var h=[[],[]],g=0;g<64;g++)h[0][g]=g===i?1:0,h[1][g]=g===o?1:0;s*=m,c*=m,l*=m,u*=m;var _=e.lines.canvasOverdrag*m,v=e.domain,y=e.canvasWidth*m,b=e.canvasHeight*m,x=e.pad.l*m,S=e.pad.b*m,C=e.layoutHeight*m,w=e.layoutWidth*m,T=e.deselectedLines.color,E=e.deselectedLines.opacity;return a.extendFlat({key:d,resolution:[y,b],viewBoxPos:[s+_,c],viewBoxSize:[l,u],i0:i,i1:o,dim0A:h[0].slice(0,16),dim0B:h[0].slice(16,32),dim0C:h[0].slice(32,48),dim0D:h[0].slice(48,64),dim1A:h[1].slice(0,16),dim1B:h[1].slice(16,32),dim1C:h[1].slice(32,48),dim1D:h[1].slice(48,64),drwLayer:f,contextColor:[T[0]/255,T[1]/255,T[2]/255,E===`auto`?Math.max(1/255,(1/e.lines.color.length)**(1/3)):T[3]*E],scissorX:(r===t?0:s+_)+(x-_)+w*v.x[0],scissorWidth:(r===n?y-s+_:l+.5)+(r===t?s+_:0),scissorY:c+S+C*v.y[0],scissorHeight:u,viewportX:x-_+w*v.x[0],viewportY:S+C*v.y[0],viewportWidth:y,viewportHeight:b},p)}function w(e){var t=s-1,n=Math.max(0,Math.floor(e[0]*t),0),r=Math.min(t,Math.ceil(e[1]*t),t);return[Math.min(n,r),Math.max(n,r)]}t.exports=function(e,t){var i=t.context,o=t.pick,c=t.regl,d=c._gl,m=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE),g=Math.max(m[0],Math.min(m[1],t.viewModel.plotGlPixelRatio)),v={currentRafs:{},drawCompleted:!0,clearOnly:!1},y,b,T,E,D=S(c),O,k=c.texture(u),A=[];M(t);var j=c({profile:!1,blend:{enable:i,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:!i,mask:!0,func:`less`,range:[0,1]},cull:{enable:!0,face:`back`},scissor:{enable:!0,box:{x:c.prop(`scissorX`),y:c.prop(`scissorY`),width:c.prop(`scissorWidth`),height:c.prop(`scissorHeight`)}},viewport:{x:c.prop(`viewportX`),y:c.prop(`viewportY`),width:c.prop(`viewportWidth`),height:c.prop(`viewportHeight`)},dither:!1,vert:n,frag:r,primitive:`lines`,lineWidth:g,attributes:D,uniforms:{resolution:c.prop(`resolution`),viewBoxPos:c.prop(`viewBoxPos`),viewBoxSize:c.prop(`viewBoxSize`),dim0A:c.prop(`dim0A`),dim1A:c.prop(`dim1A`),dim0B:c.prop(`dim0B`),dim1B:c.prop(`dim1B`),dim0C:c.prop(`dim0C`),dim1C:c.prop(`dim1C`),dim0D:c.prop(`dim0D`),dim1D:c.prop(`dim1D`),loA:c.prop(`loA`),hiA:c.prop(`hiA`),loB:c.prop(`loB`),hiB:c.prop(`hiB`),loC:c.prop(`loC`),hiC:c.prop(`hiC`),loD:c.prop(`loD`),hiD:c.prop(`hiD`),palette:k,contextColor:c.prop(`contextColor`),maskTexture:c.prop(`maskTexture`),drwLayer:c.prop(`drwLayer`),maskHeight:c.prop(`maskHeight`)},offset:c.prop(`offset`),count:c.prop(`count`)});function M(e){y=e.model,b=e.viewModel,T=b.dimensions.slice(),E=T[0]?T[0].values.length:0;var t=y.lines,n=o?t.color.map(function(e,n){return n/t.color.length}):t.color,r=_(E,T,n);x(D,E,r),!i&&!o&&(k=c.texture(a.extendFlat({data:h(y.unitToColor,255)},u)))}function N(e){var t,n,r,i=[[],[]];for(r=0;r<64;r++){var a=!e&&r<T.length?T[r].brush.filter.getBounds():[-1/0,1/0];i[0][r]=a[0],i[1][r]=a[1]}var o=s*8,l=Array(o);for(t=0;t<o;t++)l[t]=255;if(!e)for(t=0;t<T.length;t++){var u=t%8,d=(t-u)/8,f=2**u,p=T[t].brush.filter.get();if(!(p.length<2)){var m=w(p[0])[1];for(n=1;n<p.length;n++){var h=w(p[n]);for(r=m+1;r<h[0];r++)l[r*8+d]&=~f;m=Math.max(m,h[1])}}}var g={shape:[8,s],format:`alpha`,type:`uint8`,mag:`nearest`,min:`nearest`,data:l};return O?O(g):O=c.texture(g),{maskTexture:O,maskHeight:s,loA:i[0].slice(0,16),loB:i[0].slice(16,32),loC:i[0].slice(32,48),loD:i[0].slice(48,64),hiA:i[1].slice(0,16),hiB:i[1].slice(16,32),hiC:i[1].slice(32,48),hiD:i[1].slice(48,64)}}function P(e,t,n){var r=e.length,a,s,l,u=1/0,d=-1/0;for(a=0;a<r;a++)e[a].dim0.canvasX<u&&(u=e[a].dim0.canvasX,s=a),e[a].dim1.canvasX>d&&(d=e[a].dim1.canvasX,l=a);r===0&&f(c,0,0,y.canvasWidth,y.canvasHeight);var m=N(i);for(a=0;a<r;a++){var h=e[a],g=h.dim0.crossfilterDimensionIndex,_=h.dim1.crossfilterDimensionIndex,b=h.canvasX,x=h.canvasY,S=b+h.panelSizeX,w=h.plotGlPixelRatio;if(t||!A[g]||A[g][0]!==b||A[g][1]!==S){A[g]=[b,S];var T=C(y,s,l,a,g,_,b,x,h.panelSizeX,h.panelSizeY,h.dim0.crossfilterDimensionIndex,i?0:o?2:1,m,w);v.clearOnly=n,p(c,j,v,t?y.lines.blockLineCount:E,E,T)}}}function F(e,t){return c.read({x:e,y:t,width:1,height:1,data:l}),l}function I(e,t,n,r){var i=new Uint8Array(4*n*r);return c.read({x:e,y:t,width:n,height:r,data:i}),i}function L(){for(var t in e.style[`pointer-events`]=`none`,k.destroy(),O&&O.destroy(),D)D[t].destroy()}return{render:P,readPixel:F,readPixels:I,destroy:L,update:M}}}),Db=h((e,t)=>{var n=S(),r=$(),i=r.isArrayOrTypedArray,a=r.numberFormat,o=(wb(),y(Sb)).default,s=sn(),c=r.strRotate,l=r.strTranslate,u=kt(),d=tn(),f=Yt(),p=lb(),m=p.keyFun,h=p.repeat,g=p.unwrap,_=Tb(),v=cb(),b=ub(),x=Eb();function C(e,t,n){return r.aggNums(e,null,t,n)}function w(e,t){return E(C(Math.min,e,t),C(Math.max,e,t))}function T(e){var t=e.range;return t?E(t[0],t[1]):w(e.values,e._length)}function E(e,t){return(isNaN(e)||!isFinite(e))&&(e=0),(isNaN(t)||!isFinite(t))&&(t=0),e===t&&(e===0?(--e,t+=1):(e*=.9,t*=1.1)),[e,t]}function D(e,t){return t?function(n,r){return t[r]??e(n)}:e}function O(e,t,r,i,o){var s=T(r);return i?n.scale.ordinal().domain(i.map(D(a(r.tickformat),o))).range(i.map(function(n){var r=(n-s[0])/(s[1]-s[0]);return e-t+r*(2*t-e)})):n.scale.linear().domain(s).range([e-t,t])}function k(e,t){return n.scale.linear().range([t,e-t])}function A(e,t){return n.scale.linear().domain(T(e)).range([t,1-t])}function j(e){if(e.tickvals){var t=T(e);return n.scale.ordinal().domain(e.tickvals).range(e.tickvals.map(function(e){return(e-t[0])/(t[1]-t[0])}))}}function M(e){var t=e.map(function(e){return e[0]}),r=e.map(function(e){var t=o(e[1]);return n.rgb(`rgb(`+t[0]+`,`+t[1]+`,`+t[2]+`)`)}),i=function(e){return function(t){return t[e]}},a=`rgb`.split(``).map(function(e){return n.scale.linear().clamp(!0).domain(t).range(r.map(i(e)))});return function(e){return a.map(function(t){return t(e)})}}function N(e){return e.dimensions.some(function(e){return e.brush.filterSpecified})}function P(e,t,i){var a=g(t),s=a.trace,c=_.convertTypedArray(a.lineColor),l=s.line,u={color:o(s.unselected.line.color),opacity:s.unselected.line.opacity},d=f.extractOpts(l),p=d.reversescale?f.flipScale(a.cscale):a.cscale,m=s.domain,h=s.dimensions,y=e.width,b=s.labelangle,x=s.labelside,S=s.labelfont,C=s.tickfont,w=s.rangefont,E=r.extendDeepNoArrays({},l,{color:c.map(n.scale.linear().domain(T({values:c,range:[d.min,d.max],_length:s._length}))),blockLineCount:v.blockLineCount,canvasOverdrag:v.overdrag*v.canvasPixelRatio}),D=Math.floor(y*(m.x[1]-m.x[0])),O=Math.floor(e.height*(m.y[1]-m.y[0])),k=e.margin||{l:80,r:80,t:100,b:80},A=D,j=O;return{key:i,colCount:h.filter(_.isVisible).length,dimensions:h,tickDistance:v.tickDistance,unitToColor:M(p),lines:E,deselectedLines:u,labelAngle:b,labelSide:x,labelFont:S,tickFont:C,rangeFont:w,layoutWidth:y,layoutHeight:e.height,domain:m,translateX:m.x[0]*y,translateY:e.height-m.y[1]*e.height,pad:k,canvasWidth:A*v.canvasPixelRatio+2*E.canvasOverdrag,canvasHeight:j*v.canvasPixelRatio,width:A,height:j,canvasPixelRatio:v.canvasPixelRatio}}function F(e,t,n){var o=n.width,s=n.height,c=n.dimensions,l=n.canvasPixelRatio,u=function(e){return o*e/Math.max(1,n.colCount-1)},d=v.verticalPadding/s,f=k(s,v.verticalPadding),p={key:n.key,xScale:u,model:n,inBrushDrag:!1},m={};return p.dimensions=c.filter(_.isVisible).map(function(o,c){var h=A(o,d),g=m[o.label];m[o.label]=(g||0)+1;var y=o.label+(g?`__`+g:``),x=o.constraintrange,S=x&&x.length;S&&!i(x[0])&&(x=[x]);var C=S?x.map(function(e){return e.map(h)}):[[-1/0,1/0]],w=function(){var t=p;t.focusLayer&&t.focusLayer.render(t.panels,!0);var n=N(t);!e.contextShown()&&n?(t.contextLayer&&t.contextLayer.render(t.panels,!0),e.contextShown(!0)):e.contextShown()&&!n&&(t.contextLayer&&t.contextLayer.render(t.panels,!0,!0),e.contextShown(!1))},T=o.values;T.length>o._length&&(T=T.slice(0,o._length));var E=o.tickvals,D;function k(e,t){return{val:e,text:D[t]}}function M(e,t){return e.val-t.val}if(i(E)&&E.length){r.isTypedArray(E)&&(E=Array.from(E)),D=o.ticktext,!i(D)||!D.length?D=E.map(a(o.tickformat)):D.length>E.length?D=D.slice(0,E.length):E.length>D.length&&(E=E.slice(0,D.length));for(var P=1;P<E.length;P++)if(E[P]<E[P-1]){for(var F=E.map(k).sort(M),I=0;I<E.length;I++)E[I]=F[I].val,D[I]=F[I].text;break}}else E=void 0;return T=_.convertTypedArray(T),{key:y,label:o.label,tickFormat:o.tickformat,tickvals:E,ticktext:D,ordinal:_.isOrdinal(o),multiselect:o.multiselect,xIndex:c,crossfilterDimensionIndex:c,visibleIndex:o._index,height:s,values:T,paddedUnitValues:T.map(h),unitTickvals:E&&E.map(h),xScale:u,x:u(c),canvasX:u(c)*l,unitToPaddedPx:f,domainScale:O(s,v.verticalPadding,o,E,D),ordinalScale:j(o),parent:p,model:n,brush:b.makeBrush(e,S,C,function(){e.linePickActive(!1)},w,function(n){if(p.focusLayer.render(p.panels,!0),p.pickLayer&&p.pickLayer.render(p.panels,!0),e.linePickActive(!0),t&&t.filterChanged){var i=h.invert,a=n.map(function(e){return e.map(i).sort(r.sorterAsc)}).sort(function(e,t){return e[0]-t[0]});t.filterChanged(p.key,o._index,a)}})}}),p}function I(e){e.classed(v.cn.axisExtentText,!0).attr(`text-anchor`,`middle`).style(`cursor`,`default`)}function L(){var e=!0,t=!1;return{linePickActive:function(t){return arguments.length?e=!!t:e},contextShown:function(e){return arguments.length?t=!!e:t}}}function R(e,t){var n=t===`top`?1:-1,r=e*Math.PI/180;return{dir:n,dx:Math.sin(r),dy:Math.cos(r),degrees:e}}function z(e,t,n){for(var r=t.panels||=[],i=e.data(),a=0;a<i.length-1;a++){var o=r[a]||(r[a]={}),s=i[a],c=i[a+1];o.dim0=s,o.dim1=c,o.canvasX=s.canvasX,o.panelSizeX=c.canvasX-s.canvasX,o.panelSizeY=t.model.canvasHeight,o.y=0,o.canvasY=0,o.plotGlPixelRatio=n}}function B(e){for(var t=0;t<e.length;t++)for(var n=0;n<e[t].length;n++)for(var r=e[t][n].trace,i=r.dimensions,a=0;a<i.length;a++){var o=i[a].values,c=i[a]._ax;c&&(c.range?c.range=E(c.range[0],c.range[1]):c.range=w(o,r._length),c.dtick||=.01*(Math.abs(c.range[1]-c.range[0])||1),c.tickformat=i[a].tickformat,s.calcTicks(c),c.cleanRange())}}function V(e,t){return s.tickText(e._ax,t,!1).text}function H(e,t){if(e.ordinal)return``;var n=e.domainScale.domain(),r=n[t?n.length-1:0];return V(e.model.dimensions[e.visibleIndex],r)}t.exports=function(e,t,i,a){var o=e._context.staticPlot,s=e._fullLayout,f=s._toppaper,p=s._glcontainer,y=e._context.plotGlPixelRatio,S=e._fullLayout.paper_bgcolor;B(t);var C=L(),w=t.filter(function(e){return g(e).trace.visible}).map(P.bind(0,i)).map(F.bind(0,C,a));p.each(function(e,t){return r.extendFlat(e,w[t])});var T=p.selectAll(`.gl-canvas`).each(function(e){e.viewModel=w[0],e.viewModel.plotGlPixelRatio=y,e.viewModel.paperColor=S,e.model=e.viewModel?e.viewModel.model:null}),E=null;T.filter(function(e){return e.pick}).style(`pointer-events`,o?`none`:`auto`).on(`mousemove`,function(e){if(C.linePickActive()&&e.lineLayer&&a&&a.hover){var t=n.event,r=this.width,i=this.height,o=n.mouse(this),s=o[0],c=o[1];if(s<0||c<0||s>=r||c>=i)return;var l=e.lineLayer.readPixel(s,i-1-c),u=l[3]!==0,d=u?l[2]+256*(l[1]+256*l[0]):null,f={x:s,y:c,clientX:t.clientX,clientY:t.clientY,dataIndex:e.model.key,curveNumber:d};d!==E&&(u?a.hover(f):a.unhover&&a.unhover(f),E=d)}}),T.style(`opacity`,function(e){return e.pick?0:1}),f.style(`background`,`rgba(255, 255, 255, 0)`);var D=f.selectAll(`.`+v.cn.parcoords).data(w,m);D.exit().remove(),D.enter().append(`g`).classed(v.cn.parcoords,!0).style(`shape-rendering`,`crispEdges`).style(`pointer-events`,`none`),D.attr(`transform`,function(e){return l(e.model.translateX,e.model.translateY)});var O=D.selectAll(`.`+v.cn.parcoordsControlView).data(h,m);O.enter().append(`g`).classed(v.cn.parcoordsControlView,!0),O.attr(`transform`,function(e){return l(e.model.pad.l,e.model.pad.t)});var k=O.selectAll(`.`+v.cn.yAxis).data(function(e){return e.dimensions},m);k.enter().append(`g`).classed(v.cn.yAxis,!0),O.each(function(e){z(k,e,y)}),T.each(function(e){if(e.viewModel){!e.lineLayer||a?e.lineLayer=x(this,e):e.lineLayer.update(e),(e.key||e.key===0)&&(e.viewModel[e.key]=e.lineLayer);var t=!e.context||a;e.lineLayer.render(e.viewModel.panels,t)}}),k.attr(`transform`,function(e){return l(e.xScale(e.xIndex),0)}),k.call(n.behavior.drag().origin(function(e){return e}).on(`drag`,function(e){var t=e.parent;C.linePickActive(!1),e.x=Math.max(-v.overdrag,Math.min(e.model.width+v.overdrag,n.event.x)),e.canvasX=e.x*e.model.canvasPixelRatio,k.sort(function(e,t){return e.x-t.x}).each(function(t,n){t.xIndex=n,t.x=e===t?t.x:t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio}),z(k,t,y),k.filter(function(t){return Math.abs(e.xIndex-t.xIndex)!==0}).attr(`transform`,function(e){return l(e.xScale(e.xIndex),0)}),n.select(this).attr(`transform`,l(e.x,0)),k.each(function(n,r,i){i===e.parent.key&&(t.dimensions[r]=n)}),t.contextLayer&&t.contextLayer.render(t.panels,!1,!N(t)),t.focusLayer.render&&t.focusLayer.render(t.panels)}).on(`dragend`,function(e){var t=e.parent;e.x=e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio,z(k,t,y),n.select(this).attr(`transform`,function(e){return l(e.x,0)}),t.contextLayer&&t.contextLayer.render(t.panels,!1,!N(t)),t.focusLayer&&t.focusLayer.render(t.panels),t.pickLayer&&t.pickLayer.render(t.panels,!0),C.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(t.key,t.dimensions.map(function(e){return e.crossfilterDimensionIndex}))})),k.exit().remove();var A=k.selectAll(`.`+v.cn.axisOverlays).data(h,m);A.enter().append(`g`).classed(v.cn.axisOverlays,!0),A.selectAll(`.`+v.cn.axis).remove();var j=A.selectAll(`.`+v.cn.axis).data(h,m);j.enter().append(`g`).classed(v.cn.axis,!0),j.each(function(e){var t=e.model.height/e.model.tickDistance,r=e.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient(`left`).tickSize(4).outerTickSize(2).ticks(t,e.tickFormat).tickValues(e.ordinal?i:null).tickFormat(function(t){return _.isOrdinal(e)?t:V(e.model.dimensions[e.visibleIndex],t)}).scale(r)),d.font(j.selectAll(`text`),e.model.tickFont)}),j.selectAll(`.domain, .tick>line`).attr(`fill`,`none`).attr(`stroke`,`black`).attr(`stroke-opacity`,.25).attr(`stroke-width`,`1px`),j.selectAll(`text`).style(`cursor`,`default`);var M=A.selectAll(`.`+v.cn.axisHeading).data(h,m);M.enter().append(`g`).classed(v.cn.axisHeading,!0);var U=M.selectAll(`.`+v.cn.axisTitle).data(h,m);U.enter().append(`text`).classed(v.cn.axisTitle,!0).attr(`text-anchor`,`middle`).style(`cursor`,`ew-resize`).style(`pointer-events`,o?`none`:`auto`),U.text(function(e){return e.label}).each(function(t){var r=n.select(this);d.font(r,t.model.labelFont),u.convertToTspans(r,e)}).attr(`transform`,function(e){var t=R(e.model.labelAngle,e.model.labelSide),n=v.axisTitleOffset;return(t.dir>0?``:l(0,2*n+e.model.height))+c(t.degrees)+l(-n*t.dx,-n*t.dy)}).attr(`text-anchor`,function(e){var t=R(e.model.labelAngle,e.model.labelSide),n=Math.abs(t.dx),r=Math.abs(t.dy);return 2*n>r?t.dir*t.dx<0?`start`:`end`:`middle`});var W=A.selectAll(`.`+v.cn.axisExtent).data(h,m);W.enter().append(`g`).classed(v.cn.axisExtent,!0);var G=W.selectAll(`.`+v.cn.axisExtentTop).data(h,m);G.enter().append(`g`).classed(v.cn.axisExtentTop,!0),G.attr(`transform`,l(0,-v.axisExtentOffset));var K=G.selectAll(`.`+v.cn.axisExtentTopText).data(h,m);K.enter().append(`text`).classed(v.cn.axisExtentTopText,!0).call(I),K.text(function(e){return H(e,!0)}).each(function(e){d.font(n.select(this),e.model.rangeFont)});var q=W.selectAll(`.`+v.cn.axisExtentBottom).data(h,m);q.enter().append(`g`).classed(v.cn.axisExtentBottom,!0),q.attr(`transform`,function(e){return l(0,e.model.height+v.axisExtentOffset)});var J=q.selectAll(`.`+v.cn.axisExtentBottomText).data(h,m);J.enter().append(`text`).classed(v.cn.axisExtentBottomText,!0).attr(`dy`,`0.75em`).call(I),J.text(function(e){return H(e,!1)}).each(function(e){d.font(n.select(this),e.model.rangeFont)}),b.ensureAxisBrush(A,S,e)}}),Ob=h((e,t)=>{var n=Db(),r=zy(),i=Tb().isVisible,a={};function o(e,t,n){var r=t.indexOf(n),i=e.indexOf(r);return i===-1&&(i+=t.length),i}function s(e,t){return function(n,r){return o(e,t,n)-o(e,t,r)}}var e=t.exports=function(e,t){var o=e._fullLayout;if(r(e,[],a)){var c={},l={},u={},d={},f=o._size;t.forEach(function(t,n){var r=t[0].trace;u[n]=r.index;var i=d[n]=r.index;c[n]=e.data[i].dimensions,l[n]=e.data[i].dimensions.slice()}),n(e,t,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(t,n,r){var i=l[t][n],a=r.map(function(e){return e.slice()}),s=`dimensions[`+n+`].constraintrange`,c=o._tracePreGUI[e._fullData[u[t]]._fullInput.uid];c[s]===void 0&&(c[s]=i.constraintrange||null);var f=e._fullData[u[t]].dimensions[n];a.length?(a.length===1&&(a=a[0]),i.constraintrange=a,f.constraintrange=a.slice(),a=[a]):(delete i.constraintrange,delete f.constraintrange,a=null);var p={};p[s]=a,e.emit(`plotly_restyle`,[p,[d[t]]])},hover:function(t){e.emit(`plotly_hover`,t)},unhover:function(t){e.emit(`plotly_unhover`,t)},axesMoved:function(t,n){var r=s(n,l[t].filter(i));c[t].sort(r),l[t].filter(function(e){return!i(e)}).sort(function(e){return l[t].indexOf(e)}).forEach(function(e){c[t].splice(c[t].indexOf(e),1),c[t].splice(l[t].indexOf(e),0,e)}),e.emit(`plotly_restyle`,[{dimensions:[c[t]]},[d[t]]])}})}};e.reglPrecompiled=a}),kb=h(e=>{var t=S(),n=wt().getModuleCalcData,r=Ob(),i=Dt();e.name=`parcoords`,e.plot=function(e){var t=n(e.calcdata,`parcoords`)[0];t.length&&r(e,t)},e.clean=function(e,t,n,r){var i=r._has&&r._has(`parcoords`),a=t._has&&t._has(`parcoords`);i&&!a&&(r._paperdiv.selectAll(`.parcoords`).remove(),r._glimages.selectAll(`*`).remove())},e.toSVG=function(e){var n=e._fullLayout._glimages,r=t.select(e).selectAll(`.svg-container`),a=r.filter(function(e,t){return t===r.size()-1}).selectAll(`.gl-canvas-context, .gl-canvas-focus`);function o(){var e=this,t=e.toDataURL(`image/png`);n.append(`svg:image`).attr({xmlns:i.svg,"xlink:href":t,preserveAspectRatio:`none`,x:0,y:0,width:e.style.width,height:e.style.height})}a.each(o),window.setTimeout(function(){t.selectAll(`#filterBarPattern`).attr(`id`,`filterBarPattern`)},60)}}),Ab=h((e,t)=>{t.exports={attributes:sb(),supplyDefaults:db(),calc:fb(),colorbar:{container:`line`,min:`cmin`,max:`cmax`},moduleType:`trace`,name:`parcoords`,basePlotModule:kb(),categories:[`gl`,`regl`,`noOpacity`,`noHover`],meta:{}}}),jb=h((e,t)=>{var n=Ab();n.plot=Ob(),t.exports=n}),Mb=h((e,t)=>{t.exports=jb()}),Nb=h((e,t)=>{var n=z().extendFlat,r=W(),i=B(),a=Pt(),{hovertemplateAttrs:o,templatefallbackAttrs:s}=ze(),c=Da().attributes,l=n({editType:`calc`},a(`line`,{editTypeOverride:`calc`}),{shape:{valType:`enumerated`,values:[`linear`,`hspline`],dflt:`linear`,editType:`plot`},hovertemplate:o({editType:`plot`,arrayOk:!1},{keys:[`count`,`probability`]}),hovertemplatefallback:s({editType:`plot`})});t.exports={domain:c({name:`parcats`,trace:!0,editType:`calc`}),hoverinfo:n({},r.hoverinfo,{flags:[`count`,`probability`],editType:`plot`,arrayOk:!1}),hoveron:{valType:`enumerated`,values:[`category`,`color`,`dimension`],dflt:`category`,editType:`plot`},hovertemplate:o({editType:`plot`,arrayOk:!1},{keys:[`count`,`probability`,`category`,`categorycount`,`colorcount`,`bandcolorcount`]}),hovertemplatefallback:s({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:i({editType:`calc`}),tickfont:i({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:l,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}}),Pb=h((e,t)=>{var n=$(),r=At().hasColorscale,i=Gt(),a=Da().defaults,o=Vt(),s=Nb(),c=Wy(),l=j().isTypedArraySpec;function u(e,t,a,o,s){s(`line.shape`),s(`line.hovertemplate`),s(`line.hovertemplatefallback`);var c=s(`line.color`,o.colorway[0]);if(r(e,`line`)&&n.isArrayOrTypedArray(c)){if(c.length)return s(`line.colorscale`),i(e,t,o,s,{prefix:`line.`,cLetter:`c`}),c.length;t.line.color=a}return 1/0}function d(e,t){function r(r,i){return n.coerce(e,t,s.dimensions,r,i)}var i=r(`values`),a=r(`visible`);if(i&&i.length||(a=t.visible=!1),a){r(`label`),r(`displayindex`,t._index);var o=e.categoryarray,c=n.isArrayOrTypedArray(o)&&o.length>0||l(o),u;c&&(u=`array`);var d=r(`categoryorder`,u);d===`array`?(r(`categoryarray`),r(`ticktext`)):(delete e.categoryarray,delete e.ticktext),!c&&d===`array`&&(t.categoryorder=`trace`)}}t.exports=function(e,t,r,i){function l(r,i){return n.coerce(e,t,s,r,i)}var f=o(e,t,{name:`dimensions`,handleItemDefaults:d}),p=u(e,t,r,i,l);a(t,i,l),(!Array.isArray(f)||!f.length)&&(t.visible=!1),c(t,f,`values`,p),l(`hoveron`),l(`hovertemplate`),l(`hovertemplatefallback`),l(`arrangement`),l(`bundlecolors`),l(`sortpaths`),l(`counts`);var m=i.font;n.coerceFont(l,`labelfont`,m,{overrideDflt:{size:Math.round(m.size)}}),n.coerceFont(l,`tickfont`,m,{autoShadowDflt:!0,overrideDflt:{size:Math.round(m.size/1.2)}})}}),Fb=h((e,t)=>{var n=lb().wrap,r=At().hasColorscale,i=Jt(),a=st(),o=tn(),s=$(),c=D();t.exports=function(e,t){var v=s.filterVisible(t.dimensions);if(v.length===0)return[];var y=v.map(function(e){var t;if(e.categoryorder===`trace`)t=null;else if(e.categoryorder===`array`)t=e.categoryarray;else{t=a(e.values);for(var n=!0,r=0;r<t.length;r++)if(!c(t[r])){n=!1;break}t.sort(n?s.sorterAsc:void 0),e.categoryorder===`category descending`&&(t=t.reverse())}return h(e.values,t)}),b=s.isArrayOrTypedArray(t.counts)?t.counts:[t.counts],x,S;g(v),v.forEach(function(e,t){_(e,y[t])});var C=t.line,w;C?(r(t,`line`)&&i(e,t,{vals:t.line.color,containerStr:`line`,cLetter:`c`}),w=o.tryColorscale(C)):w=s.identity;function T(e){var t,n;return s.isArrayOrTypedArray(C.color)?(t=C.color[e%C.color.length],n=t):t=C.color,{color:w(t),rawColor:n}}var E=v[0].values.length,D={},O=y.map(function(e){return e.inds});S=0;var k,A;for(k=0;k<E;k++){var j=[];for(A=0;A<O.length;A++)j.push(O[A][k]);x=b[k%b.length],S+=x;var M=T(k),N=j+`-`+M.rawColor;D[N]===void 0&&(D[N]=p(j,M.color,M.rawColor)),m(D[N],k,x)}var P=v.map(function(e,t){return u(t,e._index,e._displayindex,e.label,S)});for(k=0;k<E;k++)for(x=b[k%b.length],A=0;A<P.length;A++){var F=P[A].containerInd,I=y[A].inds[k],L=P[A].categories;if(L[I]===void 0){var R=t.dimensions[F]._categoryarray[I],z=t.dimensions[F]._ticktext[I];L[I]=d(A,I,R,z)}f(L[I],k,x)}return n(l(P,D,S))};function l(e,t,n){return{dimensions:e,paths:t,trace:void 0,maxCats:e.map(function(e){return e.categories.length}).reduce(function(e,t){return Math.max(e,t)}),count:n}}function u(e,t,n,r,i){return{dimensionInd:e,containerInd:t,displayInd:n,dimensionLabel:r,count:i,categories:[],dragX:null}}function d(e,t,n,r){return{dimensionInd:e,categoryInd:t,categoryValue:n,displayInd:t,categoryLabel:r,valueInds:[],count:0,dragY:null}}function f(e,t,n){e.valueInds.push(t),e.count+=n}function p(e,t,n){return{categoryInds:e,color:t,rawColor:n,valueInds:[],count:0}}function m(e,t,n){e.valueInds.push(t),e.count+=n}function h(e,t){t=t==null?[]:t.map(function(e){return e});var n={},r={},i=[];t.forEach(function(e,t){n[e]=0,r[e]=t});for(var a=0;a<e.length;a++){var o=e[a],s;n[o]===void 0?(n[o]=1,s=t.push(o)-1,r[o]=s):(n[o]++,s=r[o]),i.push(s)}var c=t.map(function(e){return n[e]});return{uniqueValues:t,uniqueCounts:c,inds:i}}function g(e){var t=e.map(function(e){return e.displayindex}),n;if(v(t))for(n=0;n<e.length;n++)e[n]._displayindex=e[n].displayindex;else for(n=0;n<e.length;n++)e[n]._displayindex=n}function _(e,t){e._categoryarray=t.uniqueValues,e.ticktext===null||e.ticktext===void 0?e._ticktext=[]:e._ticktext=e.ticktext.slice();for(var n=e._ticktext.length;n<t.uniqueValues.length;n++)e._ticktext.push(t.uniqueValues[n])}function v(e){for(var t=Array(e.length),n=0;n<e.length;n++){if(e[n]<0||e[n]>=e.length||t[e[n]]!==void 0)return!1;t[e[n]]=!0}return!0}}),Ib=h((e,t)=>{var n=S(),r=(pm(),y(fm)).interpolateNumber,i=Ir(),a=Ln(),o=$(),s=o.strTranslate,c=tn(),l=R(),u=kt();function d(e,t,r,i){var a=t._context.staticPlot,l=e.map(G.bind(0,t,r)),d=i.selectAll(`g.parcatslayer`).data([null]);d.enter().append(`g`).attr(`class`,`parcatslayer`).style(`pointer-events`,a?`none`:`all`);var _=d.selectAll(`g.trace.parcats`).data(l,f),v=_.enter().append(`g`).attr(`class`,`trace parcats`);_.attr(`transform`,function(e){return s(e.x,e.y)}),v.append(`g`).attr(`class`,`paths`);var y=_.select(`g.paths`).selectAll(`path.path`).data(function(e){return e.paths},f);y.attr(`fill`,function(e){return e.model.color});var S=y.enter().append(`path`).attr(`class`,`path`).attr(`stroke-opacity`,0).attr(`fill`,function(e){return e.model.color}).attr(`fill-opacity`,0);x(S),y.attr(`d`,function(e){return e.svgD}),S.empty()||y.sort(m),y.exit().remove(),y.on(`mouseover`,h).on(`mouseout`,g).on(`click`,b),v.append(`g`).attr(`class`,`dimensions`);var C=_.select(`g.dimensions`).selectAll(`g.dimension`).data(function(e){return e.dimensions},f);C.enter().append(`g`).attr(`class`,`dimension`),C.attr(`transform`,function(e){return s(e.x,0)}),C.exit().remove();var w=C.selectAll(`g.category`).data(function(e){return e.categories},f),E=w.enter().append(`g`).attr(`class`,`category`);w.attr(`transform`,function(e){return s(0,e.y)}),E.append(`rect`).attr(`class`,`catrect`).attr(`pointer-events`,`none`),w.select(`rect.catrect`).attr(`fill`,`none`).attr(`width`,function(e){return e.width}).attr(`height`,function(e){return e.height}),T(E);var O=w.selectAll(`rect.bandrect`).data(function(e){return e.bands},f);O.each(function(){o.raiseToTop(this)}),O.attr(`fill`,function(e){return e.color});var k=O.enter().append(`rect`).attr(`class`,`bandrect`).attr(`stroke-opacity`,0).attr(`fill`,function(e){return e.color}).attr(`fill-opacity`,0);O.attr(`fill`,function(e){return e.color}).attr(`width`,function(e){return e.width}).attr(`height`,function(e){return e.height}).attr(`y`,function(e){return e.y}).attr(`cursor`,function(e){return e.parcatsViewModel.arrangement===`fixed`?`default`:e.parcatsViewModel.arrangement===`perpendicular`?`ns-resize`:`move`}),D(k),O.exit().remove(),E.append(`text`).attr(`class`,`catlabel`).attr(`pointer-events`,`none`),w.select(`text.catlabel`).attr(`text-anchor`,function(e){return p(e)?`start`:`end`}).attr(`alignment-baseline`,`middle`).style(`fill`,`rgb(0, 0, 0)`).attr(`x`,function(e){return p(e)?e.width+5:-5}).attr(`y`,function(e){return e.height/2}).text(function(e){return e.model.categoryLabel}).each(function(e){c.font(n.select(this),e.parcatsViewModel.categorylabelfont),u.convertToTspans(n.select(this),t)}),E.append(`text`).attr(`class`,`dimlabel`),w.select(`text.dimlabel`).attr(`text-anchor`,`middle`).attr(`alignment-baseline`,`baseline`).attr(`cursor`,function(e){return e.parcatsViewModel.arrangement===`fixed`?`default`:`ew-resize`}).attr(`x`,function(e){return e.width/2}).attr(`y`,-5).text(function(e,t){return t===0?e.parcatsViewModel.model.dimensions[e.model.dimensionInd].dimensionLabel:null}).each(function(e){c.font(n.select(this),e.parcatsViewModel.labelfont)}),w.selectAll(`rect.bandrect`).on(`mouseover`,I).on(`mouseout`,L),w.exit().remove(),C.call(n.behavior.drag().origin(function(e){return{x:e.x,y:0}}).on(`dragstart`,z).on(`drag`,B).on(`dragend`,V)),_.each(function(e){e.traceSelection=n.select(this),e.pathSelection=n.select(this).selectAll(`g.paths`).selectAll(`path.path`),e.dimensionSelection=n.select(this).selectAll(`g.dimensions`).selectAll(`g.dimension`)}),_.exit().remove()}t.exports=function(e,t,n,r){d(n,e,r,t)};function f(e){return e.key}function p(e){var t=e.parcatsViewModel.dimensions.length,n=e.parcatsViewModel.dimensions[t-1].model.dimensionInd;return e.model.dimensionInd===n}function m(e,t){return e.model.rawColor>t.model.rawColor?1:e.model.rawColor<t.model.rawColor?-1:0}function h(e){if(!e.parcatsViewModel.dragDimension&&e.parcatsViewModel.hoverinfoItems.indexOf(`skip`)===-1){o.raiseToTop(this),C(n.select(this));var t=_(e),r=v(e);if(e.parcatsViewModel.graphDiv.emit(`plotly_hover`,{points:t,event:n.event,constraints:r}),e.parcatsViewModel.hoverinfoItems.indexOf(`none`)===-1){var i=n.mouse(this)[0],s=e.parcatsViewModel.graphDiv,c=e.parcatsViewModel.trace,u=s._fullLayout,d=u._paperdiv.node().getBoundingClientRect(),f=e.parcatsViewModel.graphDiv.getBoundingClientRect(),p,m,h;for(h=0;h<e.leftXs.length-1;h++)if(e.leftXs[h]+e.dimWidths[h]-2<=i&&i<=e.leftXs[h+1]+2){var g=e.parcatsViewModel.dimensions[h],y=e.parcatsViewModel.dimensions[h+1];p=(g.x+g.width+y.x)/2,m=(e.topYs[h]+e.topYs[h+1]+e.height)/2;break}var b=e.parcatsViewModel.x+p,x=e.parcatsViewModel.y+m,S=l.mostReadable(e.model.color,[`black`,`white`]),w=e.model.count,T=w/e.parcatsViewModel.model.count,E={countLabel:w,probabilityLabel:T.toFixed(3)},D=[];e.parcatsViewModel.hoverinfoItems.indexOf(`count`)!==-1&&D.push([`Count:`,E.countLabel].join(` `)),e.parcatsViewModel.hoverinfoItems.indexOf(`probability`)!==-1&&D.push([`P:`,E.probabilityLabel].join(` `));var O=D.join(`<br>`),k=n.mouse(s)[0];a.loneHover({trace:c,x:b-d.left+f.left,y:x-d.top+f.top,text:O,color:e.model.color,borderColor:`black`,fontFamily:`Monaco, "Courier New", monospace`,fontSize:10,fontColor:S,idealAlign:k<b?`right`:`left`,hovertemplate:(c.line||{}).hovertemplate,hovertemplateLabels:E,eventData:[{data:c._input,fullData:c,count:w,probability:T}]},{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:s})}}}function g(e){if(!e.parcatsViewModel.dragDimension&&(x(n.select(this)),a.loneUnhover(e.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),e.parcatsViewModel.pathSelection.sort(m),e.parcatsViewModel.hoverinfoItems.indexOf(`skip`)===-1)){var t=_(e),r=v(e);e.parcatsViewModel.graphDiv.emit(`plotly_unhover`,{points:t,event:n.event,constraints:r})}}function _(e){for(var t=[],n=H(e.parcatsViewModel),r=0;r<e.model.valueInds.length;r++){var i=e.model.valueInds[r];t.push({curveNumber:n,pointNumber:i})}return t}function v(e){for(var t={},n=e.parcatsViewModel.model.dimensions,r=0;r<n.length;r++){var i=n[r],a=i.categories[e.model.categoryInds[r]];t[i.containerInd]=a.categoryValue}return e.model.rawColor!==void 0&&(t.color=e.model.rawColor),t}function b(e){if(e.parcatsViewModel.hoverinfoItems.indexOf(`skip`)===-1){var t=_(e),r=v(e);e.parcatsViewModel.graphDiv.emit(`plotly_click`,{points:t,event:n.event,constraints:r})}}function x(e){e.attr(`fill`,function(e){return e.model.color}).attr(`fill-opacity`,.6).attr(`stroke`,`lightgray`).attr(`stroke-width`,.2).attr(`stroke-opacity`,1)}function C(e){e.attr(`fill-opacity`,.8).attr(`stroke`,function(e){return l.mostReadable(e.model.color,[`black`,`white`])}).attr(`stroke-width`,.3)}function w(e){e.select(`rect.catrect`).attr(`stroke`,`black`).attr(`stroke-width`,2.5)}function T(e){e.select(`rect.catrect`).attr(`stroke`,`black`).attr(`stroke-width`,1).attr(`stroke-opacity`,1)}function E(e){e.attr(`stroke`,`black`).attr(`stroke-width`,1.5)}function D(e){e.attr(`stroke`,`black`).attr(`stroke-width`,.2).attr(`stroke-opacity`,1).attr(`fill-opacity`,1)}function O(e){var t=e.parcatsViewModel.pathSelection,n=e.categoryViewModel.model.dimensionInd,r=e.categoryViewModel.model.categoryInd;return t.filter(function(t){return t.model.categoryInds[n]===r&&t.model.color===e.color})}function k(e){n.select(e.parentNode).selectAll(`rect.bandrect`).each(function(e){var t=O(e);C(t),t.each(function(){o.raiseToTop(this)})}),w(n.select(e.parentNode))}function A(e){var t=n.select(e).datum(),r=O(t);C(r),r.each(function(){o.raiseToTop(this)}),n.select(e.parentNode).selectAll(`rect.bandrect`).filter(function(e){return e.color===t.color}).each(function(){o.raiseToTop(this),E(n.select(this))})}function j(e,t,r){var i=n.select(e).datum(),a=i.categoryViewModel.model,o=i.parcatsViewModel.graphDiv,s=n.select(e.parentNode).selectAll(`rect.bandrect`),c=[];s.each(function(e){O(e).each(function(e){Array.prototype.push.apply(c,_(e))})});var l={};l[a.dimensionInd]=a.categoryValue,o.emit(t,{points:c,event:r,constraints:l})}function M(e,t,r){var i=n.select(e).datum(),a=i.categoryViewModel.model,o=i.parcatsViewModel.graphDiv,s=O(i),c=[];s.each(function(e){Array.prototype.push.apply(c,_(e))});var l={};l[a.dimensionInd]=a.categoryValue,i.rawColor!==void 0&&(l.color=i.rawColor),o.emit(t,{points:c,event:r,constraints:l})}function N(e,t,r){e._fullLayout._calcInverseTransform(e);var i=e._fullLayout._invScaleX,a=e._fullLayout._invScaleY,o=n.select(r.parentNode).select(`rect.catrect`),s=o.node().getBoundingClientRect(),c=o.datum(),l=c.parcatsViewModel,u=l.model.dimensions[c.model.dimensionInd],d=l.trace,f=s.top+s.height/2,p,m;l.dimensions.length>1&&u.displayInd===l.dimensions.length-1?(p=s.left,m=`left`):(p=s.left+s.width,m=`right`);var h=c.model.count,g=c.model.categoryLabel,_=h/c.parcatsViewModel.model.count,v={countLabel:h,categoryLabel:g,probabilityLabel:_.toFixed(3)},y=[];c.parcatsViewModel.hoverinfoItems.indexOf(`count`)!==-1&&y.push([`Count:`,v.countLabel].join(` `)),c.parcatsViewModel.hoverinfoItems.indexOf(`probability`)!==-1&&y.push([`P(`+v.categoryLabel+`):`,v.probabilityLabel].join(` `));var b=y.join(`<br>`);return{trace:d,x:i*(p-t.left),y:a*(f-t.top),text:b,color:`lightgray`,borderColor:`black`,fontFamily:`Monaco, "Courier New", monospace`,fontSize:12,fontColor:`black`,idealAlign:m,hovertemplate:d.hovertemplate,hovertemplateLabels:v,eventData:[{data:d._input,fullData:d,count:h,category:g,probability:_}]}}function P(e,t,r){var i=[];return n.select(r.parentNode.parentNode).selectAll(`g.category`).select(`rect.catrect`).each(function(){var n=this;i.push(N(e,t,n))}),i}function F(e,t,r){e._fullLayout._calcInverseTransform(e);var i=e._fullLayout._invScaleX,a=e._fullLayout._invScaleY,o=r.getBoundingClientRect(),s=n.select(r).datum(),c=s.categoryViewModel,u=c.parcatsViewModel,d=u.model.dimensions[c.model.dimensionInd],f=u.trace,p=o.y+o.height/2,m,h;u.dimensions.length>1&&d.displayInd===u.dimensions.length-1?(m=o.left,h=`left`):(m=o.left+o.width,h=`right`);var g=c.model.categoryLabel,_=s.parcatsViewModel.model.count,v=0;s.categoryViewModel.bands.forEach(function(e){e.color===s.color&&(v+=e.count)});var y=c.model.count,b=0;u.pathSelection.each(function(e){e.model.color===s.color&&(b+=e.model.count)});var x=v/_,S=v/b,C=v/y,w={countLabel:v,categoryLabel:g,probabilityLabel:x.toFixed(3)},T=[];c.parcatsViewModel.hoverinfoItems.indexOf(`count`)!==-1&&T.push([`Count:`,w.countLabel].join(` `)),c.parcatsViewModel.hoverinfoItems.indexOf(`probability`)!==-1&&(T.push(`P(color ∩ `+g+`): `+w.probabilityLabel),T.push(`P(`+g+` | color): `+S.toFixed(3)),T.push(`P(color | `+g+`): `+C.toFixed(3)));var E=T.join(`<br>`),D=l.mostReadable(s.color,[`black`,`white`]);return{trace:f,x:i*(m-t.left),y:a*(p-t.top),text:E,color:s.color,borderColor:`black`,fontFamily:`Monaco, "Courier New", monospace`,fontColor:D,fontSize:10,idealAlign:h,hovertemplate:f.hovertemplate,hovertemplateLabels:w,eventData:[{data:f._input,fullData:f,category:g,count:_,probability:x,categorycount:y,colorcount:b,bandcolorcount:v}]}}function I(e){if(!e.parcatsViewModel.dragDimension&&e.parcatsViewModel.hoverinfoItems.indexOf(`skip`)===-1){if(n.mouse(this)[1]<-1)return;var t=e.parcatsViewModel.graphDiv,r=t._fullLayout,i=r._paperdiv.node().getBoundingClientRect(),o=e.parcatsViewModel.hoveron,s=this;if(o===`color`?(A(s),M(s,`plotly_hover`,n.event)):(k(s),j(s,`plotly_hover`,n.event)),e.parcatsViewModel.hoverinfoItems.indexOf(`none`)===-1){var c;o===`category`?c=N(t,i,s):o===`color`?c=F(t,i,s):o===`dimension`&&(c=P(t,i,s)),c&&a.loneHover(c,{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t})}}}function L(e){var t=e.parcatsViewModel;if(!t.dragDimension&&(x(t.pathSelection),T(t.dimensionSelection.selectAll(`g.category`)),D(t.dimensionSelection.selectAll(`g.category`).selectAll(`rect.bandrect`)),a.loneUnhover(t.graphDiv._fullLayout._hoverlayer.node()),t.pathSelection.sort(m),t.hoverinfoItems.indexOf(`skip`)===-1)){var r=e.parcatsViewModel.hoveron,i=this;r===`color`?M(i,`plotly_unhover`,n.event):j(i,`plotly_unhover`,n.event)}}function z(e){e.parcatsViewModel.arrangement!==`fixed`&&(e.dragDimensionDisplayInd=e.model.displayInd,e.initialDragDimensionDisplayInds=e.parcatsViewModel.model.dimensions.map(function(e){return e.displayInd}),e.dragHasMoved=!1,e.dragCategoryDisplayInd=null,n.select(this).selectAll(`g.category`).select(`rect.catrect`).each(function(t){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=t.width+2&&-2<=i&&i<=t.height+2&&(e.dragCategoryDisplayInd=t.model.displayInd,e.initialDragCategoryDisplayInds=e.model.categories.map(function(e){return e.displayInd}),t.model.dragY=t.y,o.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll(`rect.bandrect`).each(function(t){t.y<i&&i<=t.y+t.height&&(e.potentialClickBand=this)}))}),e.parcatsViewModel.dragDimension=e,a.loneUnhover(e.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()))}function B(e){if(e.parcatsViewModel.arrangement!==`fixed`&&(e.dragHasMoved=!0,e.dragDimensionDisplayInd!==null)){var t=e.dragDimensionDisplayInd,r=t-1,i=t+1,a=e.parcatsViewModel.dimensions[t];if(e.dragCategoryDisplayInd!==null){var o=a.categories[e.dragCategoryDisplayInd];o.model.dragY+=n.event.dy;var s=o.model.dragY,c=o.model.displayInd,l=a.categories,u=l[c-1],d=l[c+1];u!==void 0&&s<u.y+u.height/2&&(o.model.displayInd=u.model.displayInd,u.model.displayInd=c),d!==void 0&&s+o.height>d.y+d.height/2&&(o.model.displayInd=d.model.displayInd,d.model.displayInd=c),e.dragCategoryDisplayInd=o.model.displayInd}if(e.dragCategoryDisplayInd===null||e.parcatsViewModel.arrangement===`freeform`){a.model.dragX=n.event.x;var f=e.parcatsViewModel.dimensions[r],p=e.parcatsViewModel.dimensions[i];f!==void 0&&a.model.dragX<f.x+f.width&&(a.model.displayInd=f.model.displayInd,f.model.displayInd=t),p!==void 0&&a.model.dragX+a.width>p.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=e.dragDimensionDisplayInd),e.dragDimensionDisplayInd=a.model.displayInd}J(e.parcatsViewModel),q(e.parcatsViewModel),W(e.parcatsViewModel),U(e.parcatsViewModel)}}function V(e){if(e.parcatsViewModel.arrangement!==`fixed`&&e.dragDimensionDisplayInd!==null){n.select(this).selectAll(`text`).attr(`font-weight`,`normal`);var t={},r=H(e.parcatsViewModel),a=e.parcatsViewModel.model.dimensions.map(function(e){return e.displayInd}),o=e.initialDragDimensionDisplayInds.some(function(e,t){return e!==a[t]});o&&a.forEach(function(n,r){var i=e.parcatsViewModel.model.dimensions[r].containerInd;t[`dimensions[`+i+`].displayindex`]=n});var s=!1;if(e.dragCategoryDisplayInd!==null){var c=e.model.categories.map(function(e){return e.displayInd});if(s=e.initialDragCategoryDisplayInds.some(function(e,t){return e!==c[t]}),s){var l=e.model.categories.slice().sort(function(e,t){return e.displayInd-t.displayInd}),u=l.map(function(e){return e.categoryValue}),d=l.map(function(e){return e.categoryLabel});t[`dimensions[`+e.model.containerInd+`].categoryarray`]=[u],t[`dimensions[`+e.model.containerInd+`].ticktext`]=[d],t[`dimensions[`+e.model.containerInd+`].categoryorder`]=`array`}}if(e.parcatsViewModel.hoverinfoItems.indexOf(`skip`)===-1&&!e.dragHasMoved&&e.potentialClickBand&&(e.parcatsViewModel.hoveron===`color`?M(e.potentialClickBand,`plotly_click`,n.event.sourceEvent):j(e.potentialClickBand,`plotly_click`,n.event.sourceEvent)),e.model.dragX=null,e.dragCategoryDisplayInd!==null){var f=e.parcatsViewModel.dimensions[e.dragDimensionDisplayInd].categories[e.dragCategoryDisplayInd];f.model.dragY=null,e.dragCategoryDisplayInd=null}e.dragDimensionDisplayInd=null,e.parcatsViewModel.dragDimension=null,e.dragHasMoved=null,e.potentialClickBand=null,J(e.parcatsViewModel),q(e.parcatsViewModel),n.transition().duration(300).ease(`cubic-in-out`).each(function(){W(e.parcatsViewModel,!0),U(e.parcatsViewModel,!0)}).each(`end`,function(){(o||s)&&i.restyle(e.parcatsViewModel.graphDiv,t,[r])})}}function H(e){for(var t,n=e.graphDiv._fullData,r=0;r<n.length;r++)if(e.key===n[r].uid){t=r;break}return t}function U(e,t){t===void 0&&(t=!1);function n(e){return t?e.transition():e}e.pathSelection.data(function(e){return e.paths},f),n(e.pathSelection).attr(`d`,function(e){return e.svgD})}function W(e,t){t===void 0&&(t=!1);function r(e){return t?e.transition():e}e.dimensionSelection.data(function(e){return e.dimensions},f);var i=e.dimensionSelection.selectAll(`g.category`).data(function(e){return e.categories},f);r(e.dimensionSelection).attr(`transform`,function(e){return s(e.x,0)}),r(i).attr(`transform`,function(e){return s(0,e.y)}),i.select(`.dimlabel`).text(function(e,t){return t===0?e.parcatsViewModel.model.dimensions[e.model.dimensionInd].dimensionLabel:null}),i.select(`.catlabel`).attr(`text-anchor`,function(e){return p(e)?`start`:`end`}).attr(`x`,function(e){return p(e)?e.width+5:-5}).each(function(e){var t,r;p(e)?(t=e.width+5,r=`start`):(t=-5,r=`end`),n.select(this).selectAll(`tspan`).attr(`x`,t).attr(`text-anchor`,r)});var a=i.selectAll(`rect.bandrect`).data(function(e){return e.bands},f),c=a.enter().append(`rect`).attr(`class`,`bandrect`).attr(`cursor`,`move`).attr(`stroke-opacity`,0).attr(`fill`,function(e){return e.color}).attr(`fill-opacity`,0);a.attr(`fill`,function(e){return e.color}).attr(`width`,function(e){return e.width}).attr(`height`,function(e){return e.height}).attr(`y`,function(e){return e.y}),D(c),a.each(function(){o.raiseToTop(this)}),a.exit().remove()}function G(e,t,n){var r=n[0],i=t.margin||{l:80,r:80,t:100,b:80},a=r.trace,o=a.domain,s=t.width,c=t.height,l=Math.floor(s*(o.x[1]-o.x[0])),u=Math.floor(c*(o.y[1]-o.y[0])),d=o.x[0]*s+i.l,f=t.height-o.y[1]*t.height+i.t,p=a.line.shape,m=a.hoverinfo===`all`?[`count`,`probability`]:(a.hoverinfo||``).split(`+`),h={trace:a,key:a.uid,model:r,x:d,y:f,width:l,height:u,hoveron:a.hoveron,hoverinfoItems:m,arrangement:a.arrangement,bundlecolors:a.bundlecolors,sortpaths:a.sortpaths,labelfont:a.labelfont,categorylabelfont:a.tickfont,pathShape:p,dragDimension:null,margin:i,paths:[],dimensions:[],graphDiv:e,traceSelection:null,pathSelection:null,dimensionSelection:null};return r.dimensions&&(J(h),q(h)),h}function K(e,t,n,i,a){var o=[],s=[],c,l;for(l=0;l<n.length-1;l++)c=r(n[l]+e[l],e[l+1]),o.push(c(a)),s.push(c(1-a));var u=`M `+e[0]+`,`+t[0];for(u+=`l`+n[0]+`,0 `,l=1;l<n.length;l++)u+=`C`+o[l-1]+`,`+t[l-1]+` `+s[l-1]+`,`+t[l]+` `+e[l]+`,`+t[l],u+=`l`+n[l]+`,0 `;for(u+=`l0,`+i+` `,u+=`l -`+n[n.length-1]+`,0 `,l=n.length-2;l>=0;l--)u+=`C`+s[l]+`,`+(t[l+1]+i)+` `+o[l]+`,`+(t[l]+i)+` `+(e[l]+n[l])+`,`+(t[l]+i),u+=`l-`+n[l]+`,0 `;return u+=`Z`,u}function q(e){var t=e.dimensions,n=e.model,r=t.map(function(e){return e.categories.map(function(e){return e.y})}),i=e.model.dimensions.map(function(e){return e.categories.map(function(e){return e.displayInd})}),a=e.model.dimensions.map(function(e){return e.displayInd}),o=e.dimensions.map(function(e){return e.model.dimensionInd}),s=t.map(function(e){return e.x}),c=t.map(function(e){return e.width}),l=[];for(var u in n.paths)n.paths.hasOwnProperty(u)&&l.push(n.paths[u]);function d(e){var t=e.categoryInds.map(function(e,t){return i[t][e]});return o.map(function(e){return t[e]})}l.sort(function(t,n){var r=d(t),i=d(n);return e.sortpaths===`backward`&&(r.reverse(),i.reverse()),r.push(t.valueInds[0]),i.push(n.valueInds[0]),e.bundlecolors&&(r.unshift(t.rawColor),i.unshift(n.rawColor)),r<i?-1:r>i?1:0});for(var f=Array(l.length),p=t[0].model.count,m=t[0].categories.map(function(e){return e.height}).reduce(function(e,t){return e+t}),h=0;h<l.length;h++){for(var g=l[h],_=p>0?m*(g.count/p):0,v=Array(r.length),y=0;y<g.categoryInds.length;y++){var b=g.categoryInds[y],x=i[y][b],S=a[y];v[S]=r[S][x],r[S][x]+=_;var C=e.dimensions[S].categories[x],w=C.bands.length,T=C.bands[w-1];if(T===void 0||g.rawColor!==T.rawColor){var E=T===void 0?0:T.y+T.height;C.bands.push({key:E,color:g.color,rawColor:g.rawColor,height:_,width:C.width,count:g.count,y:E,categoryViewModel:C,parcatsViewModel:e})}else{var D=C.bands[w-1];D.height+=_,D.count+=g.count}}var O=e.pathShape===`hspline`?K(s,v,c,_,.5):K(s,v,c,_,0);f[h]={key:g.valueInds[0],model:g,height:_,leftXs:s,topYs:v,dimWidths:c,svgD:O,parcatsViewModel:e}}e.paths=f}function J(e){var t=e.model.dimensions.map(function(e){return{displayInd:e.displayInd,dimensionInd:e.dimensionInd}});t.sort(function(e,t){return e.displayInd-t.displayInd});var n=[];for(var r in t){var i=t[r].dimensionInd,a=e.model.dimensions[i];n.push(Y(e,a))}e.dimensions=n}function Y(e,t){var n=40,r=16,i=e.model.dimensions.length,a=t.displayInd,o=n+(i>1?(e.width-2*n-r)/(i-1):0)*a,s=[],c=e.model.maxCats,l=t.categories.length,u=8,d=t.count,f=e.height-u*(c-1),p,m,h,g,_,v=(c-l)*u/2,y=t.categories.map(function(e){return{displayInd:e.displayInd,categoryInd:e.categoryInd}});for(y.sort(function(e,t){return e.displayInd-t.displayInd}),_=0;_<l;_++)g=y[_].categoryInd,m=t.categories[g],p=d>0?m.count/d*f:0,h={key:m.valueInds[0],model:m,width:r,height:p,y:m.dragY===null?v:m.dragY,bands:[],parcatsViewModel:e},v=v+p+u,s.push(h);return{key:t.dimensionInd,x:t.dragX===null?o:t.dragX,y:0,width:r,model:t,categories:s,parcatsViewModel:e,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}),Lb=h((e,t)=>{var n=Ib();t.exports=function(e,t,r,i){var a=e._fullLayout,o=a._paper,s=a._size;n(e,o,t,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}}),Rb=h(e=>{var t=wt().getModuleCalcData,n=Lb(),r=`parcats`;e.name=r,e.plot=function(e,i,a,o){var s=t(e.calcdata,r);if(s.length){var c=s[0];n(e,c,a,o)}},e.clean=function(e,t,n,r){var i=r._has&&r._has(`parcats`),a=t._has&&t._has(`parcats`);i&&!a&&r._paperdiv.selectAll(`.parcats`).remove()}}),zb=h((e,t)=>{t.exports={attributes:Nb(),supplyDefaults:Pb(),calc:Fb(),plot:Lb(),colorbar:{container:`line`,min:`cmin`,max:`cmax`},moduleType:`trace`,name:`parcats`,basePlotModule:Rb(),categories:[`noOpacity`],meta:{}}}),Bb=h((e,t)=>{t.exports=zb()}),Vb=h((e,t)=>{var n=Xe(),r=`1.13.4`,i=`© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors`,a=[`© <a target="_blank" href="https://carto.com/">Carto</a>`,i].join(` `),o=[`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(` `),s=[`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(` `),c={"open-street-map":{id:`osm`,version:8,sources:{"plotly-osm-tiles":{type:`raster`,attribution:i,tiles:[`https://a.tile.openstreetmap.org/{z}/{x}/{y}.png`,`https://b.tile.openstreetmap.org/{z}/{x}/{y}.png`],tileSize:256}},layers:[{id:`plotly-osm-tiles`,type:`raster`,source:`plotly-osm-tiles`,minzoom:0,maxzoom:22}],glyphs:`https://fonts.openmaptiles.org/{fontstack}/{range}.pbf`},"white-bg":{id:`white-bg`,version:8,sources:{},layers:[{id:`white-bg`,type:`background`,paint:{"background-color":`#FFFFFF`},minzoom:0,maxzoom:22}],glyphs:`https://fonts.openmaptiles.org/{fontstack}/{range}.pbf`},"carto-positron":{id:`carto-positron`,version:8,sources:{"plotly-carto-positron":{type:`raster`,attribution:a,tiles:[`https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png`],tileSize:256}},layers:[{id:`plotly-carto-positron`,type:`raster`,source:`plotly-carto-positron`,minzoom:0,maxzoom:22}],glyphs:`https://fonts.openmaptiles.org/{fontstack}/{range}.pbf`},"carto-darkmatter":{id:`carto-darkmatter`,version:8,sources:{"plotly-carto-darkmatter":{type:`raster`,attribution:a,tiles:[`https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png`],tileSize:256}},layers:[{id:`plotly-carto-darkmatter`,type:`raster`,source:`plotly-carto-darkmatter`,minzoom:0,maxzoom:22}],glyphs:`https://fonts.openmaptiles.org/{fontstack}/{range}.pbf`},"stamen-terrain":{id:`stamen-terrain`,version:8,sources:{"plotly-stamen-terrain":{type:`raster`,attribution:o,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:o,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:s,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`}},l=n(c);t.exports={requiredVersion:r,styleUrlPrefix:`mapbox://styles/mapbox/`,styleUrlSuffix:`v9`,styleValuesMapbox:[`basic`,`streets`,`outdoors`,`light`,`dark`,`satellite`,`satellite-streets`],styleValueDflt:`basic`,stylesNonMapbox:c,styleValuesNonMapbox:l,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@`+r+`.`].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:",l.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')`}}}),Hb=h((e,t)=>{var n=$(),r=q().defaultLine,i=Da().attributes,a=B(),o=Tr().textposition,s=Ie().overrideAll,c=yt().templatedArray,l=Vb(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt=`Open Sans Regular, Arial Unicode MS Regular`;var d=t.exports=s({_arrayAttrRegexps:[n.counterRegex(`mapbox`,`.layers`,!0)],domain:i({name:`mapbox`}),accesstoken:{valType:`string`,noBlank:!0,strict:!0},style:{valType:`any`,values:l.styleValuesMapbox.concat(l.styleValuesNonMapbox),dflt:l.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:c(`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:r},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:r}},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:u,textposition:n.extendFlat({},o,{arrayOk:!1})}})},`plot`,`from-root`);d.uirevision={valType:`any`,editType:`none`}}),Ub=h((e,t)=>{var{hovertemplateAttrs:n,texttemplateAttrs:r,templatefallbackAttrs:i}=ze(),a=wr(),o=yg(),s=Tr(),c=Hb(),l=W(),u=Pt(),d=z().extendFlat,f=Ie().overrideAll,p=Hb(),m=o.line,h=o.marker;t.exports=f({lon:o.lon,lat:o.lat,cluster:{enabled:{valType:`boolean`},maxzoom:d({},p.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:d({},h.opacity,{dflt:1})},mode:d({},s.mode,{dflt:`markers`}),text:d({},s.text,{}),texttemplate:r({editType:`plot`},{keys:[`lat`,`lon`,`text`]}),texttemplatefallback:i({editType:`plot`}),hovertext:d({},s.hovertext,{}),line:{color:m.color,width:m.width},connectgaps:s.connectgaps,marker:d({symbol:{valType:`string`,dflt:`circle`,arrayOk:!0},angle:{valType:`number`,dflt:`auto`,arrayOk:!0},allowoverlap:{valType:`boolean`,dflt:!1},opacity:h.opacity,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode},u(`marker`)),fill:o.fill,fillcolor:a(),textfont:c.layers.symbol.textfont,textposition:c.layers.symbol.textposition,below:{valType:`string`},selected:{marker:s.selected.marker},unselected:{marker:s.unselected.marker},hoverinfo:d({},l.hoverinfo,{flags:[`lon`,`lat`,`text`,`name`]}),hovertemplate:n(),hovertemplatefallback:i()},`calc`,`nested`)}),Wb=h((e,t)=>{var n=`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`.split(`.`);t.exports={isSupportedFont:function(e){return n.indexOf(e)!==-1}}}),Gb=h((e,t)=>{var n=$(),r=Xt(),i=Yr(),a=Xr(),o=Qr(),s=$r(),c=Ub(),l=Wb().isSupportedFont;t.exports=function(e,t,d,f){function p(r,i){return n.coerce(e,t,c,r,i)}function m(r,i){return n.coerce2(e,t,c,r,i)}if(!u(e,t,p)){t.visible=!1;return}if(p(`text`),p(`texttemplate`),p(`texttemplatefallback`),p(`hovertext`),p(`hovertemplate`),p(`hovertemplatefallback`),p(`mode`),p(`below`),r.hasMarkers(t)){i(e,t,d,f,p,{noLine:!0,noAngle:!0}),p(`marker.allowoverlap`),p(`marker.angle`);var h=t.marker;h.symbol!==`circle`&&(n.isArrayOrTypedArray(h.size)&&(h.size=h.size[0]),n.isArrayOrTypedArray(h.color)&&(h.color=h.color[0]))}r.hasLines(t)&&(a(e,t,d,f,p,{noDash:!0}),p(`connectgaps`));var g=m(`cluster.maxzoom`),_=m(`cluster.step`),v=m(`cluster.color`,t.marker&&t.marker.color||d),y=m(`cluster.size`),b=m(`cluster.opacity`);if(p(`cluster.enabled`,g!==!1||_!==!1||v!==!1||y!==!1||b!==!1)||r.hasText(t)){var x=f.font.family;o(e,t,f,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:l(x)?x:`Open Sans Regular`,weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}p(`fill`),t.fill!==`none`&&s(e,t,d,p),n.coerceSelectionMarkerOpacity(t,p)};function u(e,t,n){var r=n(`lon`)||[],i=n(`lat`)||[],a=Math.min(r.length,i.length);return t._length=a,a}}),Kb=h((e,t)=>{var n=sn();t.exports=function(e,t,r){var i={},a=r[t.subplot]._subplot.mockAxis,o=e.lonlat;return i.lonLabel=n.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=n.tickText(a,a.c2l(o[1]),!0).text,i}}),qb=h((e,t)=>{var n=$();t.exports=function(e,t){var r=e.split(` `),i=r[0],a=r[1],o=n.isArrayOrTypedArray(t)?n.mean(t):t,s=.5+o/100,c=1.5+o/100,l=[``,``],u=[0,0];switch(i){case`top`:l[0]=`top`,u[1]=-c;break;case`bottom`:l[0]=`bottom`,u[1]=c;break}switch(a){case`left`:l[1]=`right`,u[0]=-s;break;case`right`:l[1]=`left`,u[0]=s;break}var d;return d=l[0]&&l[1]?l.join(`-`):l[0]?l[0]:l[1]?l[1]:`center`,{anchor:d,offset:u}}}),Jb=h((e,t)=>{var n=D(),r=$(),i=O().BADNUM,a=Eg(),o=Yt(),s=tn(),c=Zt(),l=Xt(),u=Wb().isSupportedFont,d=qb(),f=Qt().appendArrayPointValue,p=kt().NEWLINES,m=kt().BR_TAG_ALL;t.exports=function(e,t){var n=t[0].trace,i=n.visible===!0&&n._length!==0,o=n.fill!==`none`,s=l.hasLines(n),c=l.hasMarkers(n),u=l.hasText(n),f=c&&n.marker.symbol===`circle`,p=c&&n.marker.symbol!==`circle`,m=n.cluster&&n.cluster.enabled,v=h(`fill`),y=h(`line`),b=h(`circle`),C=h(`symbol`),w={fill:v,line:y,circle:b,symbol:C};if(!i)return w;var T;if((o||s)&&(T=a.calcTraceToLineCoords(t)),o&&(v.geojson=a.makePolygon(T),v.layout.visibility=`visible`,r.extendFlat(v.paint,{"fill-color":n.fillcolor})),s&&(y.geojson=a.makeLine(T),y.layout.visibility=`visible`,r.extendFlat(y.paint,{"line-width":n.line.width,"line-color":n.line.color,"line-opacity":n.opacity})),f){var E=g(t);b.geojson=E.geojson,b.layout.visibility=`visible`,m&&(b.filter=[`!`,[`has`,`point_count`]],w.cluster={type:`circle`,filter:[`has`,`point_count`],layout:{visibility:`visible`},paint:{"circle-color":x(n.cluster.color,n.cluster.step),"circle-radius":x(n.cluster.size,n.cluster.step),"circle-opacity":x(n.cluster.opacity,n.cluster.step)}},w.clusterCount={type:`symbol`,filter:[`has`,`point_count`],paint:{},layout:{"text-field":`{point_count_abbreviated}`,"text-font":S(n),"text-size":12}}),r.extendFlat(b.paint,{"circle-color":E.mcc,"circle-radius":E.mrc,"circle-opacity":E.mo})}if(f&&m&&(b.filter=[`!`,[`has`,`point_count`]]),(p||u)&&(C.geojson=_(t,e),r.extendFlat(C.layout,{visibility:`visible`,"icon-image":`{symbol}-15`,"text-field":`{text}`}),p&&(r.extendFlat(C.layout,{"icon-size":n.marker.size/10}),`angle`in n.marker&&n.marker.angle!==`auto`&&r.extendFlat(C.layout,{"icon-rotate":{type:`identity`,property:`angle`},"icon-rotation-alignment":`map`}),C.layout[`icon-allow-overlap`]=n.marker.allowoverlap,r.extendFlat(C.paint,{"icon-opacity":n.opacity*n.marker.opacity,"icon-color":n.marker.color})),u)){var D=(n.marker||{}).size,O=d(n.textposition,D);r.extendFlat(C.layout,{"text-size":n.textfont.size,"text-anchor":O.anchor,"text-offset":O.offset,"text-font":S(n)}),r.extendFlat(C.paint,{"text-color":n.textfont.color,"text-opacity":n.opacity})}return w};function h(e){return{type:e,geojson:a.makeBlank(),layout:{visibility:`none`},filter:null,paint:{}}}function g(e){var t=e[0].trace,i=t.marker,a=t.selectedpoints,l=r.isArrayOrTypedArray(i.color),u=r.isArrayOrTypedArray(i.size),d=r.isArrayOrTypedArray(i.opacity),f;function p(e){return t.opacity*e}function m(e){return e/2}var h;l&&(h=o.hasColorscale(t,`marker`)?o.makeColorScaleFuncFromTrace(i):r.identity);var g;u&&(g=c(t));var _;d&&(_=function(e){return p(n(e)?+r.constrain(e,0,1):0)});var v=[];for(f=0;f<e.length;f++){var y=e[f],x=y.lonlat;if(!b(x)){var S={};h&&(S.mcc=y.mcc=h(y.mc)),g&&(S.mrc=y.mrc=g(y.ms)),_&&(S.mo=_(y.mo)),a&&(S.selected=y.selected||0),v.push({type:`Feature`,id:f+1,geometry:{type:`Point`,coordinates:x},properties:S})}}var C;if(a)for(C=s.makeSelectedPointStyleFns(t),f=0;f<v.length;f++){var w=v[f].properties;C.selectedOpacityFn&&(w.mo=p(C.selectedOpacityFn(w))),C.selectedColorFn&&(w.mcc=C.selectedColorFn(w)),C.selectedSizeFn&&(w.mrc=C.selectedSizeFn(w))}return{geojson:{type:`FeatureCollection`,features:v},mcc:l||C&&C.selectedColorFn?{type:`identity`,property:`mcc`}:i.color,mrc:u||C&&C.selectedSizeFn?{type:`identity`,property:`mrc`}:m(i.size),mo:d||C&&C.selectedOpacityFn?{type:`identity`,property:`mo`}:p(i.opacity)}}function _(e,t){for(var n=t._fullLayout,i=e[0].trace,a=i.marker||{},o=a.symbol,s=a.angle,c=o===`circle`?y:v(o),u=s===`auto`?y:v(s,!0),d=l.hasText(i)?v(i.text):y,h=[],g=0;g<e.length;g++){var _=e[g];if(!b(_.lonlat)){var x=i.texttemplate,S;if(x){var C=Array.isArray(x)?x[g]||``:x,w=i._module.formatLabels(_,i,n),T={};f(T,i,_.i),S=r.texttemplateString({data:[T,_,i._meta],fallback:i.texttemplatefallback,labels:w,locale:n._d3locale,template:C})}else S=d(g);S&&=S.replace(p,``).replace(m,`
`),h.push({type:`Feature`,geometry:{type:`Point`,coordinates:_.lonlat},properties:{symbol:c(g),angle:u(g),text:S}})}}return{type:`FeatureCollection`,features:h}}function v(e,t){return r.isArrayOrTypedArray(e)?t?function(t){return n(e[t])?+e[t]:0}:function(t){return e[t]}:e?function(){return e}:y}function y(){return``}function b(e){return e[0]===i}function x(e,t){var n;if(r.isArrayOrTypedArray(e)&&r.isArrayOrTypedArray(t)){n=[`step`,[`get`,`point_count`],e[0]];for(var i=1;i<e.length;i++)n.push(t[i-1],e[i])}else n=e;return n}function S(e){var t=e.textfont,n=t.family,r=t.style,i=t.weight,a=n.split(` `),o=a[a.length-1]===`Italic`;o&&a.pop(),o||=r===`italic`;var s=a.join(` `);return i===`bold`&&a.indexOf(`Bold`)===-1?s+=` Bold`:i<=1e3&&(a[0]===`Metropolis`?(s=`Metropolis`,i>850?s+=` Black`:i>750?s+=` Extra Bold`:i>650?s+=` Bold`:i>550?s+=` Semi Bold`:i>450?s+=` Medium`:i>350?s+=` Regular`:i>250?s+=` Light`:i>150?s+=` Extra Light`:s+=` Thin`):a.slice(0,2).join(` `)===`Open Sans`?(s=`Open Sans`,i>750?s+=` Extrabold`:i>650?s+=` Bold`:i>550?s+=` Semibold`:i>350?s+=` Regular`:s+=` Light`):a.slice(0,3).join(` `)===`Klokantech Noto Sans`&&(s=`Klokantech Noto Sans`,a[3]===`CJK`&&(s+=` CJK`),s+=i>500?` Bold`:` Regular`)),o&&(s+=` Italic`),s===`Open Sans Regular Italic`?s=`Open Sans Italic`:s===`Open Sans Regular Bold`?s=`Open Sans Bold`:s===`Open Sans Regular Bold Italic`?s=`Open Sans Bold Italic`:s===`Klokantech Noto Sans Regular Italic`&&(s=`Klokantech Noto Sans Italic`),u(s)||(s=n),s.split(`, `)}}),Yb=h((e,t)=>{var n=$(),r=Jb(),i=Vb().traceLayerPrefix,a={cluster:[`cluster`,`clusterCount`,`circle`],nonCluster:[`fill`,`line`,`circle`,`symbol`]};function o(e,t,n,r){this.type=`scattermapbox`,this.subplot=e,this.uid=t,this.clusterEnabled=n,this.isHidden=r,this.sourceIds={fill:`source-`+t+`-fill`,line:`source-`+t+`-line`,circle:`source-`+t+`-circle`,symbol:`source-`+t+`-symbol`,cluster:`source-`+t+`-circle`,clusterCount:`source-`+t+`-circle`},this.layerIds={fill:i+t+`-fill`,line:i+t+`-line`,circle:i+t+`-circle`,symbol:i+t+`-symbol`,cluster:i+t+`-cluster`,clusterCount:i+t+`-cluster-count`},this.below=null}var s=o.prototype;s.addSource=function(e,t,r){var i={type:`geojson`,data:t.geojson};r&&r.enabled&&n.extendFlat(i,{cluster:!0,clusterMaxZoom:r.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[e]);a?a.setData(t.geojson):this.subplot.map.addSource(this.sourceIds[e],i)},s.setSourceData=function(e,t){this.subplot.map.getSource(this.sourceIds[e]).setData(t.geojson)},s.addLayer=function(e,t,n){var r={type:t.type,id:this.layerIds[e],source:this.sourceIds[e],layout:t.layout,paint:t.paint};t.filter&&(r.filter=t.filter);for(var i=this.layerIds[e],a,o=this.subplot.getMapLayers(),s=0;s<o.length;s++)if(o[s].id===i){a=!0;break}a?(this.subplot.setOptions(i,`setLayoutProperty`,r.layout),r.layout.visibility===`visible`&&this.subplot.setOptions(i,`setPaintProperty`,r.paint)):this.subplot.addLayer(r,n)},s.update=function(e){var t=e[0].trace,n=this.subplot,i=n.map,o=r(n.gd,e),s=n.belowLookup[`trace-`+this.uid],c=!!(t.cluster&&t.cluster.enabled),l=!!this.clusterEnabled,u=this;function d(e){e||u.addSource(`circle`,o.circle,t.cluster);for(var n=a.cluster,r=0;r<n.length;r++){var i=n[r],c=o[i];u.addLayer(i,c,s)}}function f(e){for(var t=a.cluster,n=t.length-1;n>=0;n--){var r=t[n];i.removeLayer(u.layerIds[r])}e||i.removeSource(u.sourceIds.circle)}function p(e){for(var t=a.nonCluster,n=0;n<t.length;n++){var r=t[n],i=o[r];e||u.addSource(r,i),u.addLayer(r,i,s)}}function m(e){for(var t=a.nonCluster,n=t.length-1;n>=0;n--){var r=t[n];i.removeLayer(u.layerIds[r]),e||i.removeSource(u.sourceIds[r])}}function h(e){l?f(e):m(e)}function g(e){c?d(e):p(e)}function _(){for(var e=c?a.cluster:a.nonCluster,t=0;t<e.length;t++){var r=e[t],i=o[r];i&&(n.setOptions(u.layerIds[r],`setLayoutProperty`,i.layout),i.layout.visibility===`visible`&&(r!==`cluster`&&u.setSourceData(r,i),n.setOptions(u.layerIds[r],`setPaintProperty`,i.paint)))}}var v=this.isHidden,y=t.visible!==!0;y?v||h():v?y||g():l===c?(this.below!==s&&(h(!0),g(!0)),_()):(h(),g()),this.clusterEnabled=c,this.isHidden=y,this.below=s,e[0].trace._glTrace=this},s.dispose=function(){for(var e=this.subplot.map,t=this.clusterEnabled?a.cluster:a.nonCluster,n=t.length-1;n>=0;n--){var r=t[n];e.removeLayer(this.layerIds[r]),e.removeSource(this.sourceIds[r])}},t.exports=function(e,t){var n=t[0].trace,i=n.cluster&&n.cluster.enabled,s=n.visible!==!0,c=new o(e,n.uid,i,s),l=r(e.gd,t),u=c.below=e.belowLookup[`trace-`+n.uid],d,f,p;if(i)for(c.addSource(`circle`,l.circle,n.cluster),d=0;d<a.cluster.length;d++)f=a.cluster[d],p=l[f],c.addLayer(f,p,u);else for(d=0;d<a.nonCluster.length;d++)f=a.nonCluster[d],p=l[f],c.addSource(f,p,n.cluster),c.addLayer(f,p,u);return t[0].trace._glTrace=c,c}}),Xb=h((e,t)=>{var n=Ln(),r=$(),i=yi(),a=r.fillText,o=O().BADNUM,s=Vb().traceLayerPrefix;function c(e,t,a){var c=e.cd,u=c[0].trace,d=e.xa,f=e.ya,p=e.subplot,m=[],h=s+u.uid+`-circle`,g=u.cluster&&u.cluster.enabled;g&&(m=p.map.queryRenderedFeatures(null,{layers:[h]}).map(function(e){return e.id}));var _=(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360))*360,v=t-_;function y(e){var t=e.lonlat;if(t[0]===o||g&&m.indexOf(e.i+1)===-1)return 1/0;var n=r.modHalf(t[0],360),i=t[1],s=p.project([n,i]),c=s.x-d.c2p([v,i]),l=s.y-f.c2p([n,a]),u=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(c*c+l*l)-u,1-3/u)}if(n.getClosest(c,y,e),e.index!==!1){var b=c[e.index],x=b.lonlat,S=[r.modHalf(x[0],360)+_,x[1]],C=d.c2p(S),w=f.c2p(S),T=b.mrc||1;e.x0=C-T,e.x1=C+T,e.y0=w-T,e.y1=w+T;var E={};E[u.subplot]={_subplot:p};var D=u._module.formatLabels(b,u,E);return e.lonLabel=D.lonLabel,e.latLabel=D.latLabel,e.color=i(u,b),e.extraText=l(u,b,c[0].t.labels),e.hovertemplate=u.hovertemplate,[e]}}function l(e,t,n){if(e.hovertemplate)return;var r=(t.hi||e.hoverinfo).split(`+`),i=r.indexOf(`all`)!==-1,o=r.indexOf(`lon`)!==-1,s=r.indexOf(`lat`)!==-1,c=t.lonlat,l=[];function u(e){return e+`°`}return i||o&&s?l.push(`(`+u(c[1])+`, `+u(c[0])+`)`):o?l.push(n.lon+u(c[0])):s&&l.push(n.lat+u(c[1])),(i||r.indexOf(`text`)!==-1)&&a(t,e,l),l.join(`<br>`)}t.exports={hoverPoints:c,getExtraText:l}}),Zb=h((e,t)=>{t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e}}),Qb=h((e,t)=>{var n=$(),r=Xt(),i=O().BADNUM;t.exports=function(e,t){var a=e.cd,o=e.xaxis,s=e.yaxis,c=[],l=a[0].trace,u;if(!r.hasMarkers(l))return[];if(t===!1)for(u=0;u<a.length;u++)a[u].selected=0;else for(u=0;u<a.length;u++){var d=a[u],f=d.lonlat;if(f[0]!==i){var p=[n.modHalf(f[0],360),f[1]],m=[o.c2p(p),s.c2p(p)];t.contains(m,null,u,e)?(c.push({pointNumber:u,lon:f[0],lat:f[1]}),d.selected=1):d.selected=0}}return c}}),$b=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():(n||=self,n.mapboxgl=r())})(e,function(){var e,t,n;function r(r,i){if(!e)e=i;else if(!t)t=i;else{var a=`var sharedChunk = {}; (`+e+`)(sharedChunk); (`+t+`)(sharedChunk);`,o={};e(o),n=i(o),typeof window<`u`&&(n.workerUrl=window.URL.createObjectURL(new Blob([a],{type:`text/javascript`})))}}return r([`exports`],function(e){function t(e,t){return t={exports:{}},e(t,t.exports),t.exports}var n=`1.13.4`,r=i;function i(e,t,n,r){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=n,this.p2y=r}i.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},i.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},i.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},i.prototype.solveCurveX=function(e,t){t===void 0&&(t=1e-6);var n,r,i,a,o;for(i=e,o=0;o<8;o++){if(a=this.sampleCurveX(i)-e,Math.abs(a)<t)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s}if(n=0,r=1,i=e,i<n)return n;if(i>r)return r;for(;n<r;){if(a=this.sampleCurveX(i),Math.abs(a-e)<t)return i;e>a?n=i:r=i,i=(r-n)*.5+n}return i},i.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var a=o;function o(e,t){this.x=e,this.y=t}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,i=n*this.x+t*this.y;return this.x=r,this.y=i,this},_rotateAround:function(e,t){var n=Math.cos(e),r=Math.sin(e),i=t.x+n*(this.x-t.x)-r*(this.y-t.y),a=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(e){return e instanceof o?e:Array.isArray(e)?new o(e[0],e[1]):e};var s=typeof self<`u`?self:{};function c(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!c(e[n],t[n]))return!1;return!0}if(typeof e==`object`&&e&&t!==null){if(typeof t!=`object`||Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e)if(!c(e[r],t[r]))return!1;return!0}return e===t}var l=2**53-1;function u(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function d(e,t,n,i){var a=new r(e,t,n,i);return function(e){return a.solve(e)}}var f=d(.25,.1,.25,1);function p(e,t,n){return Math.min(n,Math.max(t,e))}function m(e,t,n){var r=n-t,i=((e-t)%r+r)%r+t;return i===t?n:i}function h(e,t,n){if(!e.length)return n(null,[]);var r=e.length,i=Array(e.length),a=null;e.forEach(function(e,o){t(e,function(e,t){e&&(a=e),i[o]=t,--r===0&&n(a,i)})})}function g(e){var t=[];for(var n in e)t.push(e[n]);return t}function _(e,t){var n=[];for(var r in e)r in t||n.push(r);return n}function v(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];for(var r=0,i=t;r<i.length;r+=1){var a=i[r];for(var o in a)e[o]=a[o]}return e}function y(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r];i in e&&(n[i]=e[i])}return n}var b=1;function x(){return b++}function S(){function e(t){return t?(t^Math.random()*16>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}return e()}function C(e){return e<=1?1:2**Math.ceil(Math.log(e)/Math.LN2)}function w(e){return e?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e):!1}function T(e,t){e.forEach(function(e){t[e]&&(t[e]=t[e].bind(t))})}function E(e,t){return e.indexOf(t,e.length-t.length)!==-1}function D(e,t,n){var r={};for(var i in e)r[i]=t.call(n||this,e[i],i,e);return r}function O(e,t,n){var r={};for(var i in e)t.call(n||this,e[i],i,e)&&(r[i]=e[i]);return r}function k(e){return Array.isArray(e)?e.map(k):typeof e==`object`&&e?D(e,k):e}function A(e,t){for(var n=0;n<e.length;n++)if(t.indexOf(e[n])>=0)return!0;return!1}var j={};function M(e){j[e]||(typeof console<`u`&&console.warn(e),j[e]=!0)}function N(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}function P(e){for(var t=0,n=0,r=e.length,i=r-1,a=void 0,o=void 0;n<r;i=n++)a=e[n],o=e[i],t+=(o.x-a.x)*(a.y+o.y);return t}function F(e){var t=e[0],n=e[1],r=e[2];return n+=90,n*=Math.PI/180,r*=Math.PI/180,{x:t*Math.cos(n)*Math.sin(r),y:t*Math.sin(n)*Math.sin(r),z:t*Math.cos(r)}}function I(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}function L(e){var t=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,n={};if(e.replace(t,function(e,t,r,i){var a=r||i;return n[t]=a?a.toLowerCase():!0,``}),n[`max-age`]){var r=parseInt(n[`max-age`],10);isNaN(r)?delete n[`max-age`]:n[`max-age`]=r}return n}var R=null;function z(e){if(R==null){var t=e.navigator?e.navigator.userAgent:null;R=!!e.safari||!!(t&&(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match(`Safari`)&&!t.match(`Chrome`)))}return R}function B(e){try{var t=s[e];return t.setItem(`_mapbox_test_`,1),t.removeItem(`_mapbox_test_`),!0}catch{return!1}}function V(e){return s.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(+(`0x`+t))}))}function H(e){return decodeURIComponent(s.atob(e).split(``).map(function(e){return`%`+(`00`+e.charCodeAt(0).toString(16)).slice(-2)}).join(``))}var U=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),W=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,G=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,K,q,J={now:U,frame:function(e){var t=W(e);return{cancel:function(){return G(t)}}},getImageData:function(e,t){t===void 0&&(t=0);var n=s.document.createElement(`canvas`),r=n.getContext(`2d`);if(!r)throw Error(`failed to create canvas 2d context`);return n.width=e.width,n.height=e.height,r.drawImage(e,0,0,e.width,e.height),r.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return K||=s.document.createElement(`a`),K.href=e,K.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(q??=s.matchMedia(`(prefers-reduced-motion: reduce)`),q.matches):!1}},Y={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},X={supported:!1,testSupport:ne},Z,Q=!1,ee,te=!1;s.document&&(ee=s.document.createElement(`img`),ee.onload=function(){Z&&re(Z),Z=null,te=!0},ee.onerror=function(){Q=!0,Z=null},ee.src=`data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=`);function ne(e){Q||!ee||(te?re(e):Z=e)}function re(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,ee),e.isContextLost())return;X.supported=!0}catch{}e.deleteTexture(t),Q=!0}var ie=`01`;function ae(){for(var e=`1`,t=`0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`,n=``,r=0;r<10;r++)n+=t[Math.floor(Math.random()*62)];return{token:[e,ie,n].join(``),tokenExpiresAt:Date.now()+720*60*1e3}}var oe=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};oe.prototype._createSkuToken=function(){var e=ae();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},oe.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},oe.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},oe.prototype.normalizeStyleURL=function(e,t){if(!se(e))return e;var n=pe(e);return n.path=`/styles/v1`+n.path,this._makeAPIURL(n,this._customAccessToken||t)},oe.prototype.normalizeGlyphsURL=function(e,t){if(!se(e))return e;var n=pe(e);return n.path=`/fonts/v1`+n.path,this._makeAPIURL(n,this._customAccessToken||t)},oe.prototype.normalizeSourceURL=function(e,t){if(!se(e))return e;var n=pe(e);return n.path=`/v4/`+n.authority+`.json`,n.params.push(`secure`),this._makeAPIURL(n,this._customAccessToken||t)},oe.prototype.normalizeSpriteURL=function(e,t,n,r){var i=pe(e);return se(e)?(i.path=`/styles/v1`+i.path+`/sprite`+t+n,this._makeAPIURL(i,this._customAccessToken||r)):(i.path+=``+t+n,me(i))},oe.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!se(e))return e;var n=pe(e),r=/(\.(png|jpg)\d*)(?=$)/,i=/^.+\/v4\//,a=J.devicePixelRatio>=2||t===512?`@2x`:``,o=X.supported?`.webp`:`$1`;n.path=n.path.replace(r,``+a+o),n.path=n.path.replace(i,`/`),n.path=`/v4`+n.path;var s=this._customAccessToken||de(n.params)||Y.ACCESS_TOKEN;return Y.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&n.params.push(`sku=`+this._skuToken),this._makeAPIURL(n,s)},oe.prototype.canonicalizeTileURL=function(e,t){var n=`/v4/`,r=/\.[\w]+$/,i=pe(e);if(!i.path.match(/(^\/v4\/)/)||!i.path.match(r))return e;var a=`mapbox://tiles/`;a+=i.path.replace(n,``);var o=i.params;return t&&(o=o.filter(function(e){return!e.match(/^access_token=/)})),o.length&&(a+=`?`+o.join(`&`)),a},oe.prototype.canonicalizeTileset=function(e,t){for(var n=t?se(t):!1,r=[],i=0,a=e.tiles||[];i<a.length;i+=1){var o=a[i];le(o)?r.push(this.canonicalizeTileURL(o,n)):r.push(o)}return r},oe.prototype._makeAPIURL=function(e,t){var n=`See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes`,r=pe(Y.API_URL);if(e.protocol=r.protocol,e.authority=r.authority,e.protocol===`http`){var i=e.params.indexOf(`secure`);i>=0&&e.params.splice(i,1)}if(r.path!==`/`&&(e.path=``+r.path+e.path),!Y.REQUIRE_ACCESS_TOKEN)return me(e);if(t||=Y.ACCESS_TOKEN,!t)throw Error(`An API access token is required to use Mapbox GL. `+n);if(t[0]===`s`)throw Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). `+n);return e.params=e.params.filter(function(e){return e.indexOf(`access_token`)===-1}),e.params.push(`access_token=`+t),me(e)};function se(e){return e.indexOf(`mapbox:`)===0}var ce=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function le(e){return ce.test(e)}function ue(e){return e.indexOf(`sku=`)>0&&le(e)}function de(e){for(var t=0,n=e;t<n.length;t+=1){var r=n[t].match(/^access_token=(.*)$/);if(r)return r[1]}return null}var fe=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function pe(e){var t=e.match(fe);if(!t)throw Error(`Unable to parse URL object`);return{protocol:t[1],authority:t[2],path:t[3]||`/`,params:t[4]?t[4].split(`&`):[]}}function me(e){var t=e.params.length?`?`+e.params.join(`&`):``;return e.protocol+`://`+e.authority+e.path+t}var he=`mapbox.eventData`;function ge(e){if(!e)return null;var t=e.split(`.`);if(!t||t.length!==3)return null;try{return JSON.parse(H(t[1]))}catch{return null}}var _e=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};_e.prototype.getStorageKey=function(e){var t=ge(Y.ACCESS_TOKEN),n=``;return n=t&&t.u?V(t.u):Y.ACCESS_TOKEN||``,e?he+`.`+e+`:`+n:he+`:`+n},_e.prototype.fetchEventData=function(){var e=B(`localStorage`),t=this.getStorageKey(),n=this.getStorageKey(`uuid`);if(e)try{var r=s.localStorage.getItem(t);r&&(this.eventData=JSON.parse(r));var i=s.localStorage.getItem(n);i&&(this.anonId=i)}catch{M(`Unable to read from LocalStorage`)}},_e.prototype.saveEventData=function(){var e=B(`localStorage`),t=this.getStorageKey(),n=this.getStorageKey(`uuid`);if(e)try{s.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(t,JSON.stringify(this.eventData))}catch{M(`Unable to write to LocalStorage`)}},_e.prototype.processRequests=function(e){},_e.prototype.postEvent=function(e,t,r,i){var a=this;if(Y.EVENTS_URL){var o=pe(Y.EVENTS_URL);o.params.push(`access_token=`+(i||Y.ACCESS_TOKEN||``));var s={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:`mapbox-gl-js`,sdkVersion:n,skuId:ie,userId:this.anonId},c=t?v(s,t):s;this.pendingRequest=Ze({url:me(o),headers:{"Content-Type":`text/plain`},body:JSON.stringify([c])},function(e){a.pendingRequest=null,r(e),a.saveEventData(),a.processRequests(i)})}},_e.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var ve=function(e){function t(){e.call(this,`map.load`),this.success={},this.skuToken=``}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postMapLoadEvent=function(e,t,n,r){this.skuToken=n,(Y.EVENTS_URL&&r||Y.ACCESS_TOKEN&&Array.isArray(e)&&e.some(function(e){return se(e)||le(e)}))&&this.queueRequest({id:t,timestamp:Date.now()},r)},t.prototype.processRequests=function(e){var t=this;if(!(this.pendingRequest||this.queue.length===0)){var n=this.queue.shift(),r=n.id,i=n.timestamp;r&&this.success[r]||(this.anonId||this.fetchEventData(),w(this.anonId)||(this.anonId=S()),this.postEvent(i,{skuToken:this.skuToken},function(e){e||r&&(t.success[r]=!0)},e))}},t}(_e),ye=new(function(e){function t(t){e.call(this,`appUserTurnstile`),this._customAccessToken=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postTurnstileEvent=function(e,t){Y.EVENTS_URL&&Y.ACCESS_TOKEN&&Array.isArray(e)&&e.some(function(e){return se(e)||le(e)})&&this.queueRequest(Date.now(),t)},t.prototype.processRequests=function(e){var t=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var n=ge(Y.ACCESS_TOKEN),r=n?n.u:Y.ACCESS_TOKEN,i=r!==this.eventData.tokenU;w(this.anonId)||(this.anonId=S(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),c=(a-this.eventData.lastSuccess)/(1440*60*1e3);i=i||c>=1||c<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},function(e){e||(t.eventData.lastSuccess=a,t.eventData.tokenU=r)},e)}},t}(_e)),be=ye.postTurnstileEvent.bind(ye),xe=new ve,Se=xe.postMapLoadEvent.bind(xe),Ce=`mapbox-tiles`,we=500,Te=50,Ee=1e3*60*7,De;function Oe(){s.caches&&!De&&(De=s.caches.open(Ce))}var ke;function Ae(e,t){if(ke===void 0)try{new Response(new ReadableStream),ke=!0}catch{ke=!1}ke?t(e.body):e.blob().then(t)}function je(e,t,n){if(Oe(),De){var r={status:t.status,statusText:t.statusText,headers:new s.Headers};t.headers.forEach(function(e,t){return r.headers.set(t,e)});var i=L(t.headers.get(`Cache-Control`)||``);i[`no-store`]||(i[`max-age`]&&r.headers.set(`Expires`,new Date(n+i[`max-age`]*1e3).toUTCString()),new Date(r.headers.get(`Expires`)).getTime()-n<Ee||Ae(t,function(t){var n=new s.Response(t,r);Oe(),De&&De.then(function(t){return t.put(Me(e.url),n)}).catch(function(e){return M(e.message)})}))}}function Me(e){var t=e.indexOf(`?`);return t<0?e:e.slice(0,t)}function Ne(e,t){if(Oe(),!De)return t(null);var n=Me(e.url);De.then(function(e){e.match(n).then(function(r){var i=Pe(r);e.delete(n),i&&e.put(n,r.clone()),t(null,r,i)}).catch(t)}).catch(t)}function Pe(e){if(!e)return!1;var t=new Date(e.headers.get(`Expires`)||0),n=L(e.headers.get(`Cache-Control`)||``);return t>Date.now()&&!n[`no-cache`]}var Fe=1/0;function Ie(e){Fe++,Fe>Te&&(e.getActor().send(`enforceCacheSizeLimit`,we),Fe=0)}function Le(e){Oe(),De&&De.then(function(t){t.keys().then(function(n){for(var r=0;r<n.length-e;r++)t.delete(n[r])})})}function Re(e){var t=s.caches.delete(Ce);e&&t.catch(e).then(function(){return e()})}function ze(e,t){we=e,Te=t}var Be;function Ve(){return Be??=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext(`2d`)&&typeof s.createImageBitmap==`function`,Be}var He={Unknown:`Unknown`,Style:`Style`,Source:`Source`,Tile:`Tile`,Glyphs:`Glyphs`,SpriteImage:`SpriteImage`,SpriteJSON:`SpriteJSON`,Image:`Image`};typeof Object.freeze==`function`&&Object.freeze(He);var Ue=function(e){function t(t,n,r){n===401&&le(r)&&(t+=`: you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes`),e.call(this,t),this.status=n,this.url=r,this.name=this.constructor.name,this.message=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.name+`: `+this.message+` (`+this.status+`): `+this.url},t}(Error),We=I()?function(){return self.worker&&self.worker.referrer}:function(){return(s.location.protocol===`blob:`?s.parent:s).location.href},Ge=function(e){return/^file:/.test(e)||/^file:/.test(We())&&!/^\w+:/.test(e)};function Ke(e,t){var n=new s.AbortController,r=new s.Request(e.url,{method:e.method||`GET`,body:e.body,credentials:e.credentials,headers:e.headers,referrer:We(),signal:n.signal}),i=!1,a=!1,o=ue(r.url);e.type===`json`&&r.headers.set(`Accept`,`application/json`);var c=function(n,i,c){if(!a){if(n&&n.message!==`SecurityError`&&M(n),i&&c)return l(i);var u=Date.now();s.fetch(r).then(function(n){return n.ok?l(n,o?n.clone():null,u):t(new Ue(n.statusText,n.status,e.url))}).catch(function(e){e.code!==20&&t(Error(e.message))})}},l=function(n,o,s){(e.type===`arrayBuffer`?n.arrayBuffer():e.type===`json`?n.json():n.text()).then(function(e){a||(o&&s&&je(r,o,s),i=!0,t(null,e,n.headers.get(`Cache-Control`),n.headers.get(`Expires`)))}).catch(function(e){a||t(Error(e.message))})};return o?Ne(r,c):c(null,null),{cancel:function(){a=!0,i||n.abort()}}}function qe(e,t){var n=new s.XMLHttpRequest;for(var r in n.open(e.method||`GET`,e.url,!0),e.type===`arrayBuffer`&&(n.responseType=`arraybuffer`),e.headers)n.setRequestHeader(r,e.headers[r]);return e.type===`json`&&(n.responseType=`text`,n.setRequestHeader(`Accept`,`application/json`)),n.withCredentials=e.credentials===`include`,n.onerror=function(){t(Error(n.statusText))},n.onload=function(){if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){var r=n.response;if(e.type===`json`)try{r=JSON.parse(n.response)}catch(e){return t(e)}t(null,r,n.getResponseHeader(`Cache-Control`),n.getResponseHeader(`Expires`))}else t(new Ue(n.statusText,n.status,e.url))},n.send(e.body),{cancel:function(){return n.abort()}}}var Je=function(e,t){if(!Ge(e.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty(`signal`))return Ke(e,t);if(I()&&self.worker&&self.worker.actor)return self.worker.actor.send(`getResource`,e,t,void 0,!0)}return qe(e,t)},Ye=function(e,t){return Je(v(e,{type:`json`}),t)},Xe=function(e,t){return Je(v(e,{type:`arrayBuffer`}),t)},Ze=function(e,t){return Je(v(e,{method:`POST`}),t)};function Qe(e){var t=s.document.createElement(`a`);return t.href=e,t.protocol===s.document.location.protocol&&t.host===s.document.location.host}var $e=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=`;function et(e,t,n,r){var i=new s.Image,a=s.URL;i.onload=function(){t(null,i),a.revokeObjectURL(i.src),i.onload=null,s.requestAnimationFrame(function(){i.src=$e})},i.onerror=function(){return t(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 o=new s.Blob([new Uint8Array(e)],{type:`image/png`});i.cacheControl=n,i.expires=r,i.src=e.byteLength?a.createObjectURL(o):$e}function tt(e,t){var n=new s.Blob([new Uint8Array(e)],{type:`image/png`});s.createImageBitmap(n).then(function(e){t(null,e)}).catch(function(e){t(Error(`Could not load image because of `+e.message+`. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}var nt,rt;(function(){nt=[],rt=0})();var it=function(e,t){if(X.supported&&(e.headers||={},e.headers.accept=`image/webp,*/*`),rt>=Y.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return nt.push(n),n}rt++;var r=!1,i=function(){if(!r)for(r=!0,rt--;nt.length&&rt<Y.MAX_PARALLEL_IMAGE_REQUESTS;){var e=nt.shift(),t=e.requestParameters,n=e.callback;e.cancelled||(e.cancel=it(t,n).cancel)}},a=Xe(e,function(e,n,r,a){i(),e?t(e):n&&(Ve()?tt(n,t):et(n,t,r,a))});return{cancel:function(){a.cancel(),i()}}},at=function(e,t){var n=s.document.createElement(`video`);n.muted=!0,n.onloadstart=function(){t(null,n)};for(var r=0;r<e.length;r++){var i=s.document.createElement(`source`);Qe(e[r])||(n.crossOrigin=`Anonymous`),i.src=e[r],n.appendChild(i)}return{cancel:function(){}}};function ot(e,t,n){n[e]&&n[e].indexOf(t)!==-1||(n[e]=n[e]||[],n[e].push(t))}function st(e,t,n){if(n&&n[e]){var r=n[e].indexOf(t);r!==-1&&n[e].splice(r,1)}}var ct=function(e,t){t===void 0&&(t={}),v(this,t),this.type=e},lt=function(e){function t(t,n){n===void 0&&(n={}),e.call(this,`error`,v({error:t},n))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(ct),ut=function(){};ut.prototype.on=function(e,t){return this._listeners=this._listeners||{},ot(e,t,this._listeners),this},ut.prototype.off=function(e,t){return st(e,t,this._listeners),st(e,t,this._oneTimeListeners),this},ut.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},ot(e,t,this._oneTimeListeners),this},ut.prototype.fire=function(e,t){typeof e==`string`&&(e=new ct(e,t||{}));var n=e.type;if(this.listens(n)){e.target=this;for(var r=this._listeners&&this._listeners[n]?this._listeners[n].slice():[],i=0,a=r;i<a.length;i+=1)a[i].call(this,e);for(var o=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[],s=0,c=o;s<c.length;s+=1){var l=c[s];st(n,l,this._oneTimeListeners),l.call(this,e)}var u=this._eventedParent;u&&(v(e,typeof this._eventedParentData==`function`?this._eventedParentData():this._eventedParentData),u.fire(e))}else e instanceof lt&&console.error(e.error);return this},ut.prototype.listens=function(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},ut.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var $=8,dt={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`}},ft={"*":{type:`source`}},pt=[`source_vector`,`source_raster`,`source_raster_dem`,`source_geojson`,`source_video`,`source_image`],mt={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:`*`}},ht={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:`*`}},gt={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:`*`}},_t={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`}},vt={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`}}},yt={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`}}},bt={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`}},xt=[`layout_fill`,`layout_line`,`layout_circle`,`layout_heatmap`,`layout_fill-extrusion`,`layout_symbol`,`layout_raster`,`layout_hillshade`,`layout_background`],St={visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},Ct={"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`}},wt={"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`}},Tt={visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},Et={"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`}},Dt={"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`}},Ot={visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},kt={visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},At={type:`array`,value:`*`},jt={type:`enum`,values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},Mt={type:`enum`,values:{Point:{},LineString:{},Polygon:{}}},Nt={type:`array`,minimum:0,maximum:24,value:[`number`,`color`],length:2},Pt={type:`array`,value:`*`,minimum:1},Ft={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}},It=[`paint_fill`,`paint_line`,`paint_circle`,`paint_heatmap`,`paint_fill-extrusion`,`paint_symbol`,`paint_raster`,`paint_hillshade`,`paint_background`],Lt={"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`}},Rt={"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`}},zt={"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`}},Bt={"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`}},Vt={"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`}},Ht={"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`}},Ut={"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`}},Wt={"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`}},Gt={duration:{type:`number`,default:300,minimum:0,units:`milliseconds`},delay:{type:`number`,default:0,minimum:0,units:`milliseconds`}},Kt={"*":{type:`string`}},qt={$version:$,$root:dt,sources:ft,source:pt,source_vector:mt,source_raster:ht,source_raster_dem:gt,source_geojson:_t,source_video:vt,source_image:yt,layer:bt,layout:xt,layout_background:St,layout_fill:Ct,layout_circle:wt,layout_heatmap:Tt,"layout_fill-extrusion":{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},layout_line:Et,layout_symbol:Dt,layout_raster:Ot,layout_hillshade:kt,filter:At,filter_operator:jt,geometry_type:Mt,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:Nt,expression:Pt,light:Ft,paint:It,paint_fill:Lt,"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:Rt,paint_circle:zt,paint_heatmap:Bt,paint_symbol:Vt,paint_raster:Ht,paint_hillshade:Ut,paint_background:Wt,transition:Gt,"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:Kt},Jt=function(e,t,n,r){this.message=(e?e+`: `:``)+n,r&&(this.identifier=r),t!=null&&t.__line__&&(this.line=t.__line__)};function Yt(e){var t=e.key,n=e.value;return n?[new Jt(t,n,`constants have been deprecated as of v8`)]:[]}function Xt(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];for(var r=0,i=t;r<i.length;r+=1){var a=i[r];for(var o in a)e[o]=a[o]}return e}function Zt(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Qt(e){if(Array.isArray(e))return e.map(Qt);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var n in e)t[n]=Qt(e[n]);return t}return Zt(e)}var $t=function(e){function t(t,n){e.call(this,n),this.message=n,this.key=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),en=function(e,t){t===void 0&&(t=[]),this.parent=e,this.bindings={};for(var n=0,r=t;n<r.length;n+=1){var i=r[n],a=i[0],o=i[1];this.bindings[a]=o}};en.prototype.concat=function(e){return new en(this,e)},en.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(e+` not found in scope.`)},en.prototype.has=function(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1};var tn={kind:`null`},nn={kind:`number`},rn={kind:`string`},an={kind:`boolean`},on={kind:`color`},sn={kind:`object`},cn={kind:`value`},ln={kind:`error`},un={kind:`collator`},dn={kind:`formatted`},fn={kind:`resolvedImage`};function pn(e,t){return{kind:`array`,itemType:e,N:t}}function mn(e){if(e.kind===`array`){var t=mn(e.itemType);return typeof e.N==`number`?`array<`+t+`, `+e.N+`>`:e.itemType.kind===`value`?`array`:`array<`+t+`>`}else return e.kind}var hn=[tn,nn,rn,an,on,dn,sn,pn(cn),fn];function gn(e,t){if(t.kind===`error`)return null;if(e.kind===`array`){if(t.kind===`array`&&(t.N===0&&t.itemType.kind===`value`||!gn(e.itemType,t.itemType))&&(typeof e.N!=`number`||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind===`value`)for(var n=0,r=hn;n<r.length;n+=1){var i=r[n];if(!gn(i,t))return null}}return`Expected `+mn(e)+` but found `+mn(t)+` instead.`}function _n(e,t){return t.some(function(t){return t.kind===e.kind})}function vn(e,t){return t.some(function(t){return t===`null`?e===null:t===`array`?Array.isArray(e):t===`object`?e&&!Array.isArray(e)&&typeof e==`object`:t===typeof e})}var yn=t(function(e,t){var n={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 r(e){return e=Math.round(e),e<0?0:e>255?255:e}function i(e){return e<0?0:e>1?1:e}function a(e){return e[e.length-1]===`%`?r(parseFloat(e)/100*255):r(parseInt(e))}function o(e){return e[e.length-1]===`%`?i(parseFloat(e)/100):i(parseFloat(e))}function s(e,t,n){return n<0?n+=1:n>1&&--n,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function c(e){var t=e.replace(/ /g,``).toLowerCase();if(t in n)return n[t].slice();if(t[0]===`#`){if(t.length===4){var i=parseInt(t.substr(1),16);return i>=0&&i<=4095?[(i&3840)>>4|(i&3840)>>8,i&240|(i&240)>>4,i&15|(i&15)<<4,1]:null}else if(t.length===7){var i=parseInt(t.substr(1),16);return i>=0&&i<=16777215?[(i&16711680)>>16,(i&65280)>>8,i&255,1]:null}return null}var c=t.indexOf(`(`),l=t.indexOf(`)`);if(c!==-1&&l+1===t.length){var u=t.substr(0,c),d=t.substr(c+1,l-(c+1)).split(`,`),f=1;switch(u){case`rgba`:if(d.length!==4)return null;f=o(d.pop());case`rgb`:return d.length===3?[a(d[0]),a(d[1]),a(d[2]),f]:null;case`hsla`:if(d.length!==4)return null;f=o(d.pop());case`hsl`:if(d.length!==3)return null;var p=(parseFloat(d[0])%360+360)%360/360,m=o(d[1]),h=o(d[2]),g=h<=.5?h*(m+1):h+m-h*m,_=h*2-g;return[r(s(_,g,p+1/3)*255),r(s(_,g,p)*255),r(s(_,g,p-1/3)*255),f];default:return null}}return null}try{t.parseCSSColor=c}catch{}}).parseCSSColor,bn=function(e,t,n,r){r===void 0&&(r=1),this.r=e,this.g=t,this.b=n,this.a=r};bn.parse=function(e){if(e){if(e instanceof bn)return e;if(typeof e==`string`){var t=yn(e);if(t)return new bn(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},bn.prototype.toString=function(){var e=this.toArray(),t=e[0],n=e[1],r=e[2],i=e[3];return`rgba(`+Math.round(t)+`,`+Math.round(n)+`,`+Math.round(r)+`,`+i+`)`},bn.prototype.toArray=function(){var e=this,t=e.r,n=e.g,r=e.b,i=e.a;return i===0?[0,0,0,0]:[t*255/i,n*255/i,r*255/i,i]},bn.black=new bn(0,0,0,1),bn.white=new bn(1,1,1,1),bn.transparent=new bn(0,0,0,0),bn.red=new bn(1,0,0,1);var xn=function(e,t,n){e?this.sensitivity=t?`variant`:`case`:this.sensitivity=t?`accent`:`base`,this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:`search`})};xn.prototype.compare=function(e,t){return this.collator.compare(e,t)},xn.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Sn=function(e,t,n,r,i){this.text=e,this.image=t,this.scale=n,this.fontStack=r,this.textColor=i},Cn=function(e){this.sections=e};Cn.fromString=function(e){return new Cn([new Sn(e,null,null,null,null)])},Cn.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(e){return e.text.length!==0||e.image&&e.image.name.length!==0})},Cn.factory=function(e){return e instanceof Cn?e:Cn.fromString(e)},Cn.prototype.toString=function(){return this.sections.length===0?``:this.sections.map(function(e){return e.text}).join(``)},Cn.prototype.serialize=function(){for(var e=[`format`],t=0,n=this.sections;t<n.length;t+=1){var r=n[t];if(r.image){e.push([`image`,r.image.name]);continue}e.push(r.text);var i={};r.fontStack&&(i[`text-font`]=[`literal`,r.fontStack.split(`,`)]),r.scale&&(i[`font-scale`]=r.scale),r.textColor&&(i[`text-color`]=[`rgba`].concat(r.textColor.toArray())),e.push(i)}return e};var wn=function(e){this.name=e.name,this.available=e.available};wn.prototype.toString=function(){return this.name},wn.fromString=function(e){return e?new wn({name:e,available:!1}):null},wn.prototype.serialize=function(){return[`image`,this.name]};function Tn(e,t,n,r){return typeof e==`number`&&e>=0&&e<=255&&typeof t==`number`&&t>=0&&t<=255&&typeof n==`number`&&n>=0&&n<=255?r===void 0||typeof r==`number`&&r>=0&&r<=1?null:`Invalid rgba value [`+[e,t,n,r].join(`, `)+`]: 'a' must be between 0 and 1.`:`Invalid rgba value [`+(typeof r==`number`?[e,t,n,r]:[e,t,n]).join(`, `)+`]: 'r', 'g', and 'b' must be between 0 and 255.`}function En(e){if(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||e instanceof bn||e instanceof xn||e instanceof Cn||e instanceof wn)return!0;if(Array.isArray(e)){for(var t=0,n=e;t<n.length;t+=1){var r=n[t];if(!En(r))return!1}return!0}else if(typeof e==`object`){for(var i in e)if(!En(e[i]))return!1;return!0}else return!1}function Dn(e){if(e===null)return tn;if(typeof e==`string`)return rn;if(typeof e==`boolean`)return an;if(typeof e==`number`)return nn;if(e instanceof bn)return on;if(e instanceof xn)return un;if(e instanceof Cn)return dn;if(e instanceof wn)return fn;if(Array.isArray(e)){for(var t=e.length,n,r=0,i=e;r<i.length;r+=1){var a=i[r],o=Dn(a);if(!n)n=o;else{if(n===o)continue;n=cn;break}}return pn(n||cn,t)}else return sn}function On(e){var t=typeof e;return e===null?``:t===`string`||t===`number`||t===`boolean`?String(e):e instanceof bn||e instanceof Cn||e instanceof wn?e.toString():JSON.stringify(e)}var kn=function(e,t){this.type=e,this.value=t};kn.parse=function(e,t){if(e.length!==2)return t.error(`'literal' expression requires exactly one argument, but found `+(e.length-1)+` instead.`);if(!En(e[1]))return t.error(`invalid value`);var n=e[1],r=Dn(n),i=t.expectedType;return r.kind===`array`&&r.N===0&&i&&i.kind===`array`&&(typeof i.N!=`number`||i.N===0)&&(r=i),new kn(r,n)},kn.prototype.evaluate=function(){return this.value},kn.prototype.eachChild=function(){},kn.prototype.outputDefined=function(){return!0},kn.prototype.serialize=function(){return this.type.kind===`array`||this.type.kind===`object`?[`literal`,this.value]:this.value instanceof bn?[`rgba`].concat(this.value.toArray()):this.value instanceof Cn?this.value.serialize():this.value};var An=function(e){this.name=`ExpressionEvaluationError`,this.message=e};An.prototype.toJSON=function(){return this.message};var jn={string:rn,number:nn,boolean:an,object:sn},Mn=function(e,t){this.type=e,this.args=t};Mn.parse=function(e,t){if(e.length<2)return t.error(`Expected at least one argument.`);var n=1,r,i=e[0];if(i===`array`){var a;if(e.length>2){var o=e[1];if(typeof o!=`string`||!(o in jn)||o===`object`)return t.error(`The item type argument of "array" must be one of string, number, boolean`,1);a=jn[o],n++}else a=cn;var s;if(e.length>3){if(e[2]!==null&&(typeof e[2]!=`number`||e[2]<0||e[2]!==Math.floor(e[2])))return t.error(`The length argument to "array" must be a positive integer literal`,2);s=e[2],n++}r=pn(a,s)}else r=jn[i];for(var c=[];n<e.length;n++){var l=t.parse(e[n],n,cn);if(!l)return null;c.push(l)}return new Mn(r,c)},Mn.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var n=this.args[t].evaluate(e);if(gn(this.type,Dn(n))){if(t===this.args.length-1)throw new An(`Expected value to be of type `+mn(this.type)+`, but found `+mn(Dn(n))+` instead.`)}else return n}return null},Mn.prototype.eachChild=function(e){this.args.forEach(e)},Mn.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},Mn.prototype.serialize=function(){var e=this.type,t=[e.kind];if(e.kind===`array`){var n=e.itemType;if(n.kind===`string`||n.kind===`number`||n.kind===`boolean`){t.push(n.kind);var r=e.N;(typeof r==`number`||this.args.length>1)&&t.push(r)}}return t.concat(this.args.map(function(e){return e.serialize()}))};var Nn=function(e){this.type=dn,this.sections=e};Nn.parse=function(e,t){if(e.length<2)return t.error(`Expected at least one argument.`);var n=e[1];if(!Array.isArray(n)&&typeof n==`object`)return t.error(`First argument must be an image or text section.`);for(var r=[],i=!1,a=1;a<=e.length-1;++a){var o=e[a];if(i&&typeof o==`object`&&!Array.isArray(o)){i=!1;var s=null;if(o[`font-scale`]&&(s=t.parse(o[`font-scale`],1,nn),!s))return null;var c=null;if(o[`text-font`]&&(c=t.parse(o[`text-font`],1,pn(rn)),!c))return null;var l=null;if(o[`text-color`]&&(l=t.parse(o[`text-color`],1,on),!l))return null;var u=r[r.length-1];u.scale=s,u.font=c,u.textColor=l}else{var d=t.parse(e[a],1,cn);if(!d)return null;var f=d.type.kind;if(f!==`string`&&f!==`value`&&f!==`null`&&f!==`resolvedImage`)return t.error(`Formatted text type must be 'string', 'value', 'image' or 'null'.`);i=!0,r.push({content:d,scale:null,font:null,textColor:null})}}return new Nn(r)},Nn.prototype.evaluate=function(e){return new Cn(this.sections.map(function(t){var n=t.content.evaluate(e);return Dn(n)===fn?new Sn(``,n,null,null,null):new Sn(On(n),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(`,`):null,t.textColor?t.textColor.evaluate(e):null)}))},Nn.prototype.eachChild=function(e){for(var t=0,n=this.sections;t<n.length;t+=1){var r=n[t];e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}},Nn.prototype.outputDefined=function(){return!1},Nn.prototype.serialize=function(){for(var e=[`format`],t=0,n=this.sections;t<n.length;t+=1){var r=n[t];e.push(r.content.serialize());var i={};r.scale&&(i[`font-scale`]=r.scale.serialize()),r.font&&(i[`text-font`]=r.font.serialize()),r.textColor&&(i[`text-color`]=r.textColor.serialize()),e.push(i)}return e};var Pn=function(e){this.type=fn,this.input=e};Pn.parse=function(e,t){if(e.length!==2)return t.error(`Expected two arguments.`);var n=t.parse(e[1],1,rn);return n?new Pn(n):t.error(`No image name provided.`)},Pn.prototype.evaluate=function(e){var t=this.input.evaluate(e),n=wn.fromString(t);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(t)>-1),n},Pn.prototype.eachChild=function(e){e(this.input)},Pn.prototype.outputDefined=function(){return!1},Pn.prototype.serialize=function(){return[`image`,this.input.serialize()]};var Fn={"to-boolean":an,"to-color":on,"to-number":nn,"to-string":rn},In=function(e,t){this.type=e,this.args=t};In.parse=function(e,t){if(e.length<2)return t.error(`Expected at least one argument.`);var n=e[0];if((n===`to-boolean`||n===`to-string`)&&e.length!==2)return t.error(`Expected one argument.`);for(var r=Fn[n],i=[],a=1;a<e.length;a++){var o=t.parse(e[a],a,cn);if(!o)return null;i.push(o)}return new In(r,i)},In.prototype.evaluate=function(e){if(this.type.kind===`boolean`)return!!this.args[0].evaluate(e);if(this.type.kind===`color`){for(var t,n,r=0,i=this.args;r<i.length;r+=1){if(t=i[r].evaluate(e),n=null,t instanceof bn)return t;if(typeof t==`string`){var a=e.parseColor(t);if(a)return a}else if(Array.isArray(t)&&(n=t.length<3||t.length>4?`Invalid rbga value `+JSON.stringify(t)+`: expected an array containing either three or four numeric values.`:Tn(t[0],t[1],t[2],t[3]),!n))return new bn(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new An(n||`Could not parse color from value '`+(typeof t==`string`?t:String(JSON.stringify(t)))+`'`)}else if(this.type.kind===`number`){for(var o=null,s=0,c=this.args;s<c.length;s+=1){if(o=c[s].evaluate(e),o===null)return 0;var l=Number(o);if(!isNaN(l))return l}throw new An(`Could not convert `+JSON.stringify(o)+` to number.`)}else return this.type.kind===`formatted`?Cn.fromString(On(this.args[0].evaluate(e))):this.type.kind===`resolvedImage`?wn.fromString(On(this.args[0].evaluate(e))):On(this.args[0].evaluate(e))},In.prototype.eachChild=function(e){this.args.forEach(e)},In.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},In.prototype.serialize=function(){if(this.type.kind===`formatted`)return new Nn([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind===`resolvedImage`)return new Pn(this.args[0]).serialize();var e=[`to-`+this.type.kind];return this.eachChild(function(t){e.push(t.serialize())}),e};var Ln=[`Unknown`,`Point`,`LineString`,`Polygon`],Rn=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Rn.prototype.id=function(){return this.feature&&`id`in this.feature?this.feature.id:null},Rn.prototype.geometryType=function(){return this.feature?typeof this.feature.type==`number`?Ln[this.feature.type]:this.feature.type:null},Rn.prototype.geometry=function(){return this.feature&&`geometry`in this.feature?this.feature.geometry:null},Rn.prototype.canonicalID=function(){return this.canonical},Rn.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Rn.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||=this._parseColorCache[e]=bn.parse(e),t};var zn=function(e,t,n,r){this.name=e,this.type=t,this._evaluate=n,this.args=r};zn.prototype.evaluate=function(e){return this._evaluate(e,this.args)},zn.prototype.eachChild=function(e){this.args.forEach(e)},zn.prototype.outputDefined=function(){return!1},zn.prototype.serialize=function(){return[this.name].concat(this.args.map(function(e){return e.serialize()}))},zn.parse=function(e,t){var n,r=e[0],i=zn.definitions[r];if(!i)return t.error(`Unknown expression "`+r+`". If you wanted a literal array, use ["literal", [...]].`,0);for(var a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter(function(t){var n=t[0];return!Array.isArray(n)||n.length===e.length-1}),c=null,l=0,u=s;l<u.length;l+=1){var d=u[l],f=d[0],p=d[1];c=new _r(t.registry,t.path,null,t.scope);for(var m=[],h=!1,g=1;g<e.length;g++){var _=e[g],v=Array.isArray(f)?f[g-1]:f.type,y=c.parse(_,1+m.length,v);if(!y){h=!0;break}m.push(y)}if(!h){if(Array.isArray(f)&&f.length!==m.length){c.error(`Expected `+f.length+` arguments, but found `+m.length+` instead.`);continue}for(var b=0;b<m.length;b++){var x=Array.isArray(f)?f[b]:f.type,S=m[b];c.concat(b+1).checkSubtype(x,S.type)}if(c.errors.length===0)return new zn(r,a,p,m)}}if(s.length===1)(n=t.errors).push.apply(n,c.errors);else{for(var C=(s.length?s:o).map(function(e){var t=e[0];return Bn(t)}).join(` | `),w=[],T=1;T<e.length;T++){var E=t.parse(e[T],1+w.length);if(!E)return null;w.push(mn(E.type))}t.error(`Expected arguments of type `+C+`, but found (`+w.join(`, `)+`) instead.`)}return null},zn.register=function(e,t){for(var n in zn.definitions=t,t)e[n]=zn};function Bn(e){return Array.isArray(e)?`(`+e.map(mn).join(`, `)+`)`:`(`+mn(e.type)+`...)`}var Vn=function(e,t,n){this.type=un,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=t};Vn.parse=function(e,t){if(e.length!==2)return t.error(`Expected one argument.`);var n=e[1];if(typeof n!=`object`||Array.isArray(n))return t.error(`Collator options argument must be an object.`);var r=t.parse(n[`case-sensitive`]===void 0?!1:n[`case-sensitive`],1,an);if(!r)return null;var i=t.parse(n[`diacritic-sensitive`]===void 0?!1:n[`diacritic-sensitive`],1,an);if(!i)return null;var a=null;return n.locale&&(a=t.parse(n.locale,1,rn),!a)?null:new Vn(r,i,a)},Vn.prototype.evaluate=function(e){return new xn(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},Vn.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},Vn.prototype.outputDefined=function(){return!1},Vn.prototype.serialize=function(){var e={};return e[`case-sensitive`]=this.caseSensitive.serialize(),e[`diacritic-sensitive`]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),[`collator`,e]};var Hn=8192;function Un(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Wn(e){return(180+e)/360}function Gn(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Kn(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function qn(e,t){var n=Wn(e[0]),r=Gn(e[1]),i=2**t.z;return[Math.round(n*i*Hn),Math.round(r*i*Hn)]}function Jn(e,t,n){var r=e[0]-t[0],i=e[1]-t[1],a=e[0]-n[0],o=e[1]-n[1];return r*o-a*i===0&&r*a<=0&&i*o<=0}function Yn(e,t,n){return t[1]>e[1]!=n[1]>e[1]&&e[0]<(n[0]-t[0])*(e[1]-t[1])/(n[1]-t[1])+t[0]}function Xn(e,t){for(var n=!1,r=0,i=t.length;r<i;r++)for(var a=t[r],o=0,s=a.length;o<s-1;o++){if(Jn(e,a[o],a[o+1]))return!1;Yn(e,a[o],a[o+1])&&(n=!n)}return n}function Zn(e,t){for(var n=0;n<t.length;n++)if(Xn(e,t[n]))return!0;return!1}function Qn(e,t){return e[0]*t[1]-e[1]*t[0]}function $n(e,t,n,r){var i=e[0]-n[0],a=e[1]-n[1],o=t[0]-n[0],s=t[1]-n[1],c=r[0]-n[0],l=r[1]-n[1],u=i*l-c*a,d=o*l-c*s;return u>0&&d<0||u<0&&d>0}function er(e,t,n,r){var i=[t[0]-e[0],t[1]-e[1]];return Qn([r[0]-n[0],r[1]-n[1]],i)===0?!1:!!($n(e,t,n,r)&&$n(n,r,e,t))}function tr(e,t,n){for(var r=0,i=n;r<i.length;r+=1)for(var a=i[r],o=0;o<a.length-1;++o)if(er(e,t,a[o],a[o+1]))return!0;return!1}function nr(e,t){for(var n=0;n<e.length;++n)if(!Xn(e[n],t))return!1;for(var r=0;r<e.length-1;++r)if(tr(e[r],e[r+1],t))return!1;return!0}function rr(e,t){for(var n=0;n<t.length;n++)if(nr(e,t[n]))return!0;return!1}function ir(e,t,n){for(var r=[],i=0;i<e.length;i++){for(var a=[],o=0;o<e[i].length;o++){var s=qn(e[i][o],n);Un(t,s),a.push(s)}r.push(a)}return r}function ar(e,t,n){for(var r=[],i=0;i<e.length;i++){var a=ir(e[i],t,n);r.push(a)}return r}function or(e,t,n,r){if(e[0]<n[0]||e[0]>n[2]){var i=r*.5,a=e[0]-n[0]>i?-r:n[0]-e[0]>i?r:0;a===0&&(a=e[0]-n[2]>i?-r:n[2]-e[0]>i?r:0),e[0]+=a}Un(t,e)}function sr(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function cr(e,t,n,r){for(var i=2**r.z*Hn,a=[r.x*Hn,r.y*Hn],o=[],s=0,c=e;s<c.length;s+=1)for(var l=c[s],u=0,d=l;u<d.length;u+=1){var f=d[u],p=[f.x+a[0],f.y+a[1]];or(p,t,n,i),o.push(p)}return o}function lr(e,t,n,r){for(var i=2**r.z*Hn,a=[r.x*Hn,r.y*Hn],o=[],s=0,c=e;s<c.length;s+=1){for(var l=c[s],u=[],d=0,f=l;d<f.length;d+=1){var p=f[d],m=[p.x+a[0],p.y+a[1]];Un(t,m),u.push(m)}o.push(u)}if(t[2]-t[0]<=i/2){sr(t);for(var h=0,g=o;h<g.length;h+=1)for(var _=g[h],v=0,y=_;v<y.length;v+=1){var b=y[v];or(b,t,n,i)}}return o}function ur(e,t){var n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){var a=ir(t.coordinates,r,i),o=cr(e.geometry(),n,r,i);if(!Kn(n,r))return!1;for(var s=0,c=o;s<c.length;s+=1){var l=c[s];if(!Xn(l,a))return!1}}if(t.type===`MultiPolygon`){var u=ar(t.coordinates,r,i),d=cr(e.geometry(),n,r,i);if(!Kn(n,r))return!1;for(var f=0,p=d;f<p.length;f+=1){var m=p[f];if(!Zn(m,u))return!1}}return!0}function dr(e,t){var n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){var a=ir(t.coordinates,r,i),o=lr(e.geometry(),n,r,i);if(!Kn(n,r))return!1;for(var s=0,c=o;s<c.length;s+=1){var l=c[s];if(!nr(l,a))return!1}}if(t.type===`MultiPolygon`){var u=ar(t.coordinates,r,i),d=lr(e.geometry(),n,r,i);if(!Kn(n,r))return!1;for(var f=0,p=d;f<p.length;f+=1){var m=p[f];if(!rr(m,u))return!1}}return!0}var fr=function(e,t){this.type=an,this.geojson=e,this.geometries=t};fr.parse=function(e,t){if(e.length!==2)return t.error(`'within' expression requires exactly one argument, but found `+(e.length-1)+` instead.`);if(En(e[1])){var n=e[1];if(n.type===`FeatureCollection`)for(var r=0;r<n.features.length;++r){var i=n.features[r].geometry.type;if(i===`Polygon`||i===`MultiPolygon`)return new fr(n,n.features[r].geometry)}else if(n.type===`Feature`){var a=n.geometry.type;if(a===`Polygon`||a===`MultiPolygon`)return new fr(n,n.geometry)}else if(n.type===`Polygon`||n.type===`MultiPolygon`)return new fr(n,n)}return t.error(`'within' expression requires valid geojson object that contains polygon geometry type.`)},fr.prototype.evaluate=function(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===`Point`)return ur(e,this.geometries);if(e.geometryType()===`LineString`)return dr(e,this.geometries)}return!1},fr.prototype.eachChild=function(){},fr.prototype.outputDefined=function(){return!0},fr.prototype.serialize=function(){return[`within`,this.geojson]};function pr(e){if(e instanceof zn&&(e.name===`get`&&e.args.length===1||e.name===`feature-state`||e.name===`has`&&e.args.length===1||e.name===`properties`||e.name===`geometry-type`||e.name===`id`||/^filter-/.test(e.name))||e instanceof fr)return!1;var t=!0;return e.eachChild(function(e){t&&!pr(e)&&(t=!1)}),t}function mr(e){if(e instanceof zn&&e.name===`feature-state`)return!1;var t=!0;return e.eachChild(function(e){t&&!mr(e)&&(t=!1)}),t}function hr(e,t){if(e instanceof zn&&t.indexOf(e.name)>=0)return!1;var n=!0;return e.eachChild(function(e){n&&!hr(e,t)&&(n=!1)}),n}var gr=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};gr.parse=function(e,t){if(e.length!==2||typeof e[1]!=`string`)return t.error(`'var' expression requires exactly one string literal argument.`);var n=e[1];return t.scope.has(n)?new gr(n,t.scope.get(n)):t.error(`Unknown variable "`+n+`". Make sure "`+n+`" has been bound in an enclosing "let" expression before using it.`,1)},gr.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},gr.prototype.eachChild=function(){},gr.prototype.outputDefined=function(){return!1},gr.prototype.serialize=function(){return[`var`,this.name]};var _r=function(e,t,n,r,i){t===void 0&&(t=[]),r===void 0&&(r=new en),i===void 0&&(i=[]),this.registry=e,this.path=t,this.key=t.map(function(e){return`[`+e+`]`}).join(``),this.scope=r,this.errors=i,this.expectedType=n};_r.prototype.parse=function(e,t,n,r,i){return i===void 0&&(i={}),t?this.concat(t,n,r)._parse(e,i):this._parse(e,i)},_r.prototype._parse=function(e,t){(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`)&&(e=[`literal`,e]);function n(e,t,n){return n===`assert`?new Mn(t,[e]):n===`coerce`?new In(t,[e]):e}if(Array.isArray(e)){if(e.length===0)return this.error(`Expected an array with at least one element. If you wanted a literal array, use ["literal", []].`);var r=e[0];if(typeof r!=`string`)return this.error(`Expression name must be a string, but found `+typeof r+` instead. If you wanted a literal array, use ["literal", [...]].`,0),null;var i=this.registry[r];if(i){var a=i.parse(e,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if((o.kind===`string`||o.kind===`number`||o.kind===`boolean`||o.kind===`object`||o.kind===`array`)&&s.kind===`value`)a=n(a,o,t.typeAnnotation||`assert`);else if((o.kind===`color`||o.kind===`formatted`||o.kind===`resolvedImage`)&&(s.kind===`value`||s.kind===`string`))a=n(a,o,t.typeAnnotation||`coerce`);else if(this.checkSubtype(o,s))return null}if(!(a instanceof kn)&&a.type.kind!==`resolvedImage`&&vr(a)){var c=new Rn;try{a=new kn(a.type,a.evaluate(c))}catch(e){return this.error(e.message),null}}return a}return this.error(`Unknown expression "`+r+`". If you wanted a literal array, use ["literal", [...]].`,0)}else return e===void 0?this.error(`'undefined' value invalid. Use null instead.`):typeof e==`object`?this.error(`Bare objects invalid. Use ["literal", {...}] instead.`):this.error(`Expected an array, but found `+typeof e+` instead.`)},_r.prototype.concat=function(e,t,n){var r=typeof e==`number`?this.path.concat(e):this.path,i=n?this.scope.concat(n):this.scope;return new _r(this.registry,r,t||null,i,this.errors)},_r.prototype.error=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];var r=``+this.key+t.map(function(e){return`[`+e+`]`}).join(``);this.errors.push(new $t(r,e))},_r.prototype.checkSubtype=function(e,t){var n=gn(e,t);return n&&this.error(n),n};function vr(e){if(e instanceof gr)return vr(e.boundExpression);if(e instanceof zn&&e.name===`error`||e instanceof Vn||e instanceof fr)return!1;var t=e instanceof In||e instanceof Mn,n=!0;return e.eachChild(function(e){t?n&&=vr(e):n&&=e instanceof kn}),n?pr(e)&&hr(e,[`zoom`,`heatmap-density`,`line-progress`,`accumulated`,`is-supported-script`]):!1}function yr(e,t){for(var n=e.length-1,r=0,i=n,a=0,o,s;r<=i;)if(a=Math.floor((r+i)/2),o=e[a],s=e[a+1],o<=t){if(a===n||t<s)return a;r=a+1}else if(o>t)i=a-1;else throw new An(`Input is not a number.`);return 0}var br=function(e,t,n){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var r=0,i=n;r<i.length;r+=1){var a=i[r],o=a[0],s=a[1];this.labels.push(o),this.outputs.push(s)}};br.parse=function(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only `+(e.length-1)+`.`);if((e.length-1)%2!=0)return t.error(`Expected an even number of arguments.`);var n=t.parse(e[1],1,nn);if(!n)return null;var r=[],i=null;t.expectedType&&t.expectedType.kind!==`value`&&(i=t.expectedType);for(var a=1;a<e.length;a+=2){var o=a===1?-1/0:e[a],s=e[a+1],c=a,l=a+1;if(typeof o!=`number`)return t.error(`Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,c);if(r.length&&r[r.length-1][0]>=o)return t.error(`Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.`,c);var u=t.parse(s,l,i);if(!u)return null;i||=u.type,r.push([o,u])}return new br(i,n,r)},br.prototype.evaluate=function(e){var t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);var i=t.length;return r>=t[i-1]?n[i-1].evaluate(e):n[yr(t,r)].evaluate(e)},br.prototype.eachChild=function(e){e(this.input);for(var t=0,n=this.outputs;t<n.length;t+=1){var r=n[t];e(r)}},br.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},br.prototype.serialize=function(){for(var e=[`step`,this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};function xr(e,t,n){return e*(1-n)+t*n}function Sr(e,t,n){return new bn(xr(e.r,t.r,n),xr(e.g,t.g,n),xr(e.b,t.b,n),xr(e.a,t.a,n))}function Cr(e,t,n){return e.map(function(e,r){return xr(e,t[r],n)})}var wr=Object.freeze({__proto__:null,number:xr,color:Sr,array:Cr}),Tr=.95047,Er=1,Dr=1.08883,Or=4/29,kr=6/29,Ar=3*kr*kr,jr=kr*kr*kr,Mr=Math.PI/180,Nr=180/Math.PI;function Pr(e){return e>jr?e**(1/3):e/Ar+Or}function Fr(e){return e>kr?e*e*e:Ar*(e-Or)}function Ir(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function Lr(e){return e/=255,e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Rr(e){var t=Lr(e.r),n=Lr(e.g),r=Lr(e.b),i=Pr((.4124564*t+.3575761*n+.1804375*r)/Tr),a=Pr((.2126729*t+.7151522*n+.072175*r)/Er),o=Pr((.0193339*t+.119192*n+.9503041*r)/Dr);return{l:116*a-16,a:500*(i-a),b:200*(a-o),alpha:e.a}}function zr(e){var t=(e.l+16)/116,n=isNaN(e.a)?t:t+e.a/500,r=isNaN(e.b)?t:t-e.b/200;return t=Er*Fr(t),n=Tr*Fr(n),r=Dr*Fr(r),new bn(Ir(3.2404542*n-1.5371385*t-.4985314*r),Ir(-.969266*n+1.8760108*t+.041556*r),Ir(.0556434*n-.2040259*t+1.0572252*r),e.alpha)}function Br(e,t,n){return{l:xr(e.l,t.l,n),a:xr(e.a,t.a,n),b:xr(e.b,t.b,n),alpha:xr(e.alpha,t.alpha,n)}}function Vr(e){var t=Rr(e),n=t.l,r=t.a,i=t.b,a=Math.atan2(i,r)*Nr;return{h:a<0?a+360:a,c:Math.sqrt(r*r+i*i),l:n,alpha:e.a}}function Hr(e){var t=e.h*Mr,n=e.c,r=e.l;return zr({l:r,a:Math.cos(t)*n,b:Math.sin(t)*n,alpha:e.alpha})}function Ur(e,t,n){var r=t-e;return e+n*(r>180||r<-180?r-360*Math.round(r/360):r)}function Wr(e,t,n){return{h:Ur(e.h,t.h,n),c:xr(e.c,t.c,n),l:xr(e.l,t.l,n),alpha:xr(e.alpha,t.alpha,n)}}var Gr={forward:Rr,reverse:zr,interpolate:Br},Kr={forward:Vr,reverse:Hr,interpolate:Wr},qr=Object.freeze({__proto__:null,lab:Gr,hcl:Kr}),Jr=function(e,t,n,r,i){this.type=e,this.operator=t,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(var a=0,o=i;a<o.length;a+=1){var s=o[a],c=s[0],l=s[1];this.labels.push(c),this.outputs.push(l)}};Jr.interpolationFactor=function(e,t,n,i){var a=0;if(e.name===`exponential`)a=Yr(t,e.base,n,i);else if(e.name===`linear`)a=Yr(t,1,n,i);else if(e.name===`cubic-bezier`){var o=e.controlPoints;a=new r(o[0],o[1],o[2],o[3]).solve(Yr(t,1,n,i))}return a},Jr.parse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e.slice(3);if(!Array.isArray(r)||r.length===0)return t.error(`Expected an interpolation type expression.`,1);if(r[0]===`linear`)r={name:`linear`};else if(r[0]===`exponential`){var o=r[1];if(typeof o!=`number`)return t.error(`Exponential interpolation requires a numeric base.`,1,1);r={name:`exponential`,base:o}}else if(r[0]===`cubic-bezier`){var s=r.slice(1);if(s.length!==4||s.some(function(e){return typeof e!=`number`||e<0||e>1}))return t.error(`Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.`,1);r={name:`cubic-bezier`,controlPoints:s}}else return t.error(`Unknown interpolation type `+String(r[0]),1,0);if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only `+(e.length-1)+`.`);if((e.length-1)%2!=0)return t.error(`Expected an even number of arguments.`);if(i=t.parse(i,2,nn),!i)return null;var c=[],l=null;n===`interpolate-hcl`||n===`interpolate-lab`?l=on:t.expectedType&&t.expectedType.kind!==`value`&&(l=t.expectedType);for(var u=0;u<a.length;u+=2){var d=a[u],f=a[u+1],p=u+3,m=u+4;if(typeof d!=`number`)return t.error(`Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,p);if(c.length&&c[c.length-1][0]>=d)return t.error(`Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.`,p);var h=t.parse(f,m,l);if(!h)return null;l||=h.type,c.push([d,h])}return l.kind!==`number`&&l.kind!==`color`&&!(l.kind===`array`&&l.itemType.kind===`number`&&typeof l.N==`number`)?t.error(`Type `+mn(l)+` is not interpolatable.`):new Jr(l,n,r,i,c)},Jr.prototype.evaluate=function(e){var t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);var i=t.length;if(r>=t[i-1])return n[i-1].evaluate(e);var a=yr(t,r),o=t[a],s=t[a+1],c=Jr.interpolationFactor(this.interpolation,r,o,s),l=n[a].evaluate(e),u=n[a+1].evaluate(e);return this.operator===`interpolate`?wr[this.type.kind.toLowerCase()](l,u,c):this.operator===`interpolate-hcl`?Kr.reverse(Kr.interpolate(Kr.forward(l),Kr.forward(u),c)):Gr.reverse(Gr.interpolate(Gr.forward(l),Gr.forward(u),c))},Jr.prototype.eachChild=function(e){e(this.input);for(var t=0,n=this.outputs;t<n.length;t+=1){var r=n[t];e(r)}},Jr.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},Jr.prototype.serialize=function(){for(var e=this.interpolation.name===`linear`?[`linear`]:this.interpolation.name===`exponential`?this.interpolation.base===1?[`linear`]:[`exponential`,this.interpolation.base]:[`cubic-bezier`].concat(this.interpolation.controlPoints),t=[this.operator,e,this.input.serialize()],n=0;n<this.labels.length;n++)t.push(this.labels[n],this.outputs[n].serialize());return t};function Yr(e,t,n,r){var i=r-n,a=e-n;return i===0?0:t===1?a/i:(t**+a-1)/(t**+i-1)}var Xr=function(e,t){this.type=e,this.args=t};Xr.parse=function(e,t){if(e.length<2)return t.error(`Expectected at least one argument.`);var n=null,r=t.expectedType;r&&r.kind!==`value`&&(n=r);for(var i=[],a=0,o=e.slice(1);a<o.length;a+=1){var s=o[a],c=t.parse(s,1+i.length,n,void 0,{typeAnnotation:`omit`});if(!c)return null;n||=c.type,i.push(c)}return r&&i.some(function(e){return gn(r,e.type)})?new Xr(cn,i):new Xr(n,i)},Xr.prototype.evaluate=function(e){for(var t=null,n=0,r,i=0,a=this.args;i<a.length;i+=1){var o=a[i];if(n++,t=o.evaluate(e),t&&t instanceof wn&&!t.available&&(r||=t.name,t=null,n===this.args.length&&(t=r)),t!==null)break}return t},Xr.prototype.eachChild=function(e){this.args.forEach(e)},Xr.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},Xr.prototype.serialize=function(){var e=[`coalesce`];return this.eachChild(function(t){e.push(t.serialize())}),e};var Zr=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};Zr.prototype.evaluate=function(e){return this.result.evaluate(e)},Zr.prototype.eachChild=function(e){for(var t=0,n=this.bindings;t<n.length;t+=1){var r=n[t];e(r[1])}e(this.result)},Zr.parse=function(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found `+(e.length-1)+` instead.`);for(var n=[],r=1;r<e.length-1;r+=2){var i=e[r];if(typeof i!=`string`)return t.error(`Expected string, but found `+typeof i+` instead.`,r);if(/[^a-zA-Z0-9_]/.test(i))return t.error(`Variable names must contain only alphanumeric characters or '_'.`,r);var a=t.parse(e[r+1],r+1);if(!a)return null;n.push([i,a])}var o=t.parse(e[e.length-1],e.length-1,t.expectedType,n);return o?new Zr(n,o):null},Zr.prototype.outputDefined=function(){return this.result.outputDefined()},Zr.prototype.serialize=function(){for(var e=[`let`],t=0,n=this.bindings;t<n.length;t+=1){var r=n[t],i=r[0],a=r[1];e.push(i,a.serialize())}return e.push(this.result.serialize()),e};var Qr=function(e,t,n){this.type=e,this.index=t,this.input=n};Qr.parse=function(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found `+(e.length-1)+` instead.`);var n=t.parse(e[1],1,nn),r=t.parse(e[2],2,pn(t.expectedType||cn));if(!n||!r)return null;var i=r.type;return new Qr(i.itemType,n,r)},Qr.prototype.evaluate=function(e){var t=this.index.evaluate(e),n=this.input.evaluate(e);if(t<0)throw new An(`Array index out of bounds: `+t+` < 0.`);if(t>=n.length)throw new An(`Array index out of bounds: `+t+` > `+(n.length-1)+`.`);if(t!==Math.floor(t))throw new An(`Array index must be an integer, but found `+t+` instead.`);return n[t]},Qr.prototype.eachChild=function(e){e(this.index),e(this.input)},Qr.prototype.outputDefined=function(){return!1},Qr.prototype.serialize=function(){return[`at`,this.index.serialize(),this.input.serialize()]};var $r=function(e,t){this.type=an,this.needle=e,this.haystack=t};$r.parse=function(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found `+(e.length-1)+` instead.`);var n=t.parse(e[1],1,cn),r=t.parse(e[2],2,cn);return!n||!r?null:_n(n.type,[an,rn,nn,tn,cn])?new $r(n,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found `+mn(n.type)+` instead`)},$r.prototype.evaluate=function(e){var t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!vn(t,[`boolean`,`string`,`number`,`null`]))throw new An(`Expected first argument to be of type boolean, string, number or null, but found `+mn(Dn(t))+` instead.`);if(!vn(n,[`string`,`array`]))throw new An(`Expected second argument to be of type array or string, but found `+mn(Dn(n))+` instead.`);return n.indexOf(t)>=0},$r.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},$r.prototype.outputDefined=function(){return!0},$r.prototype.serialize=function(){return[`in`,this.needle.serialize(),this.haystack.serialize()]};var ei=function(e,t,n){this.type=nn,this.needle=e,this.haystack=t,this.fromIndex=n};ei.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found `+(e.length-1)+` instead.`);var n=t.parse(e[1],1,cn),r=t.parse(e[2],2,cn);if(!n||!r)return null;if(!_n(n.type,[an,rn,nn,tn,cn]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found `+mn(n.type)+` instead`);if(e.length===4){var i=t.parse(e[3],3,nn);return i?new ei(n,r,i):null}else return new ei(n,r)},ei.prototype.evaluate=function(e){var t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!vn(t,[`boolean`,`string`,`number`,`null`]))throw new An(`Expected first argument to be of type boolean, string, number or null, but found `+mn(Dn(t))+` instead.`);if(!vn(n,[`string`,`array`]))throw new An(`Expected second argument to be of type array or string, but found `+mn(Dn(n))+` instead.`);if(this.fromIndex){var r=this.fromIndex.evaluate(e);return n.indexOf(t,r)}return n.indexOf(t)},ei.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},ei.prototype.outputDefined=function(){return!1},ei.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var e=this.fromIndex.serialize();return[`index-of`,this.needle.serialize(),this.haystack.serialize(),e]}return[`index-of`,this.needle.serialize(),this.haystack.serialize()]};var ti=function(e,t,n,r,i,a){this.inputType=e,this.type=t,this.input=n,this.cases=r,this.outputs=i,this.otherwise=a};ti.parse=function(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only `+(e.length-1)+`.`);if(e.length%2!=1)return t.error(`Expected an even number of arguments.`);var n,r;t.expectedType&&t.expectedType.kind!==`value`&&(r=t.expectedType);for(var i={},a=[],o=2;o<e.length-1;o+=2){var s=e[o],c=e[o+1];Array.isArray(s)||(s=[s]);var l=t.concat(o);if(s.length===0)return l.error(`Expected at least one branch label.`);for(var u=0,d=s;u<d.length;u+=1){var f=d[u];if(typeof f!=`number`&&typeof f!=`string`)return l.error(`Branch labels must be numbers or strings.`);if(typeof f==`number`&&Math.abs(f)>2**53-1)return l.error(`Branch labels must be integers no larger than `+(2**53-1)+`.`);if(typeof f==`number`&&Math.floor(f)!==f)return l.error(`Numeric branch labels must be integer values.`);if(!n)n=Dn(f);else if(l.checkSubtype(n,Dn(f)))return null;if(i[String(f)]!==void 0)return l.error(`Branch labels must be unique.`);i[String(f)]=a.length}var p=t.parse(c,o,r);if(!p)return null;r||=p.type,a.push(p)}var m=t.parse(e[1],1,cn);if(!m)return null;var h=t.parse(e[e.length-1],e.length-1,r);return!h||m.type.kind!==`value`&&t.concat(1).checkSubtype(n,m.type)?null:new ti(n,r,m,i,a,h)},ti.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(Dn(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},ti.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},ti.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})&&this.otherwise.outputDefined()},ti.prototype.serialize=function(){for(var e=this,t=[`match`,this.input.serialize()],n=Object.keys(this.cases).sort(),r=[],i={},a=0,o=n;a<o.length;a+=1){var s=o[a],c=i[this.cases[s]];c===void 0?(i[this.cases[s]]=r.length,r.push([this.cases[s],[s]])):r[c][1].push(s)}for(var l=function(t){return e.inputType.kind===`number`?Number(t):t},u=0,d=r;u<d.length;u+=1){var f=d[u],c=f[0],p=f[1];p.length===1?t.push(l(p[0])):t.push(p.map(l)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var ni=function(e,t,n){this.type=e,this.branches=t,this.otherwise=n};ni.parse=function(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only `+(e.length-1)+`.`);if(e.length%2!=0)return t.error(`Expected an odd number of arguments.`);var n;t.expectedType&&t.expectedType.kind!==`value`&&(n=t.expectedType);for(var r=[],i=1;i<e.length-1;i+=2){var a=t.parse(e[i],i,an);if(!a)return null;var o=t.parse(e[i+1],i+1,n);if(!o)return null;r.push([a,o]),n||=o.type}var s=t.parse(e[e.length-1],e.length-1,n);return s?new ni(n,r,s):null},ni.prototype.evaluate=function(e){for(var t=0,n=this.branches;t<n.length;t+=1){var r=n[t],i=r[0],a=r[1];if(i.evaluate(e))return a.evaluate(e)}return this.otherwise.evaluate(e)},ni.prototype.eachChild=function(e){for(var t=0,n=this.branches;t<n.length;t+=1){var r=n[t],i=r[0],a=r[1];e(i),e(a)}e(this.otherwise)},ni.prototype.outputDefined=function(){return this.branches.every(function(e){return e[0],e[1].outputDefined()})&&this.otherwise.outputDefined()},ni.prototype.serialize=function(){var e=[`case`];return this.eachChild(function(t){e.push(t.serialize())}),e};var ri=function(e,t,n,r){this.type=e,this.input=t,this.beginIndex=n,this.endIndex=r};ri.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found `+(e.length-1)+` instead.`);var n=t.parse(e[1],1,cn),r=t.parse(e[2],2,nn);if(!n||!r)return null;if(!_n(n.type,[pn(cn),rn,cn]))return t.error(`Expected first argument to be of type array or string, but found `+mn(n.type)+` instead`);if(e.length===4){var i=t.parse(e[3],3,nn);return i?new ri(n.type,n,r,i):null}else return new ri(n.type,n,r)},ri.prototype.evaluate=function(e){var t=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(!vn(t,[`string`,`array`]))throw new An(`Expected first argument to be of type array or string, but found `+mn(Dn(t))+` instead.`);if(this.endIndex){var r=this.endIndex.evaluate(e);return t.slice(n,r)}return t.slice(n)},ri.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},ri.prototype.outputDefined=function(){return!1},ri.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var e=this.endIndex.serialize();return[`slice`,this.input.serialize(),this.beginIndex.serialize(),e]}return[`slice`,this.input.serialize(),this.beginIndex.serialize()]};function ii(e,t){return e===`==`||e===`!=`?t.kind===`boolean`||t.kind===`string`||t.kind===`number`||t.kind===`null`||t.kind===`value`:t.kind===`string`||t.kind===`number`||t.kind===`value`}function ai(e,t,n){return t===n}function oi(e,t,n){return t!==n}function si(e,t,n){return t<n}function ci(e,t,n){return t>n}function li(e,t,n){return t<=n}function ui(e,t,n){return t>=n}function di(e,t,n,r){return r.compare(t,n)===0}function fi(e,t,n,r){return!di(e,t,n,r)}function pi(e,t,n,r){return r.compare(t,n)<0}function mi(e,t,n,r){return r.compare(t,n)>0}function hi(e,t,n,r){return r.compare(t,n)<=0}function gi(e,t,n,r){return r.compare(t,n)>=0}function _i(e,t,n){var r=e!==`==`&&e!==`!=`;return function(){function i(e,t,n){this.type=an,this.lhs=e,this.rhs=t,this.collator=n,this.hasUntypedArgument=e.type.kind===`value`||t.type.kind===`value`}return i.parse=function(e,t){if(e.length!==3&&e.length!==4)return t.error(`Expected two or three arguments.`);var n=e[0],a=t.parse(e[1],1,cn);if(!a)return null;if(!ii(n,a.type))return t.concat(1).error(`"`+n+`" comparisons are not supported for type '`+mn(a.type)+`'.`);var o=t.parse(e[2],2,cn);if(!o)return null;if(!ii(n,o.type))return t.concat(2).error(`"`+n+`" comparisons are not supported for type '`+mn(o.type)+`'.`);if(a.type.kind!==o.type.kind&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot compare types '`+mn(a.type)+`' and '`+mn(o.type)+`'.`);r&&(a.type.kind===`value`&&o.type.kind!==`value`?a=new Mn(o.type,[a]):a.type.kind!==`value`&&o.type.kind===`value`&&(o=new Mn(a.type,[o])));var s=null;if(e.length===4){if(a.type.kind!==`string`&&o.type.kind!==`string`&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot use collator to compare non-string types.`);if(s=t.parse(e[3],3,un),!s)return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){var s=Dn(a),c=Dn(o);if(s.kind!==c.kind||!(s.kind===`string`||s.kind===`number`))throw new An(`Expected arguments for "`+e+`" to be (string, string) or (number, number), but found (`+s.kind+`, `+c.kind+`) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){var l=Dn(a),u=Dn(o);if(l.kind!==`string`||u.kind!==`string`)return t(i,a,o)}return this.collator?n(i,a,o,this.collator.evaluate(i)):t(i,a,o)},i.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var t=[e];return this.eachChild(function(e){t.push(e.serialize())}),t},i}()}var vi=_i(`==`,ai,di),yi=_i(`!=`,oi,fi),bi=_i(`<`,si,pi),xi=_i(`>`,ci,mi),Si=_i(`<=`,li,hi),Ci=_i(`>=`,ui,gi),wi=function(e,t,n,r,i){this.type=rn,this.number=e,this.locale=t,this.currency=n,this.minFractionDigits=r,this.maxFractionDigits=i};wi.parse=function(e,t){if(e.length!==3)return t.error(`Expected two arguments.`);var n=t.parse(e[1],1,nn);if(!n)return null;var r=e[2];if(typeof r!=`object`||Array.isArray(r))return t.error(`NumberFormat options argument must be an object.`);var i=null;if(r.locale&&(i=t.parse(r.locale,1,rn),!i))return null;var a=null;if(r.currency&&(a=t.parse(r.currency,1,rn),!a))return null;var o=null;if(r[`min-fraction-digits`]&&(o=t.parse(r[`min-fraction-digits`],1,nn),!o))return null;var s=null;return r[`max-fraction-digits`]&&(s=t.parse(r[`max-fraction-digits`],1,nn),!s)?null:new wi(n,i,a,o,s)},wi.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?`currency`:`decimal`,currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},wi.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},wi.prototype.outputDefined=function(){return!1},wi.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e[`min-fraction-digits`]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e[`max-fraction-digits`]=this.maxFractionDigits.serialize()),[`number-format`,this.number.serialize(),e]};var Ti=function(e){this.type=nn,this.input=e};Ti.parse=function(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found `+(e.length-1)+` instead.`);var n=t.parse(e[1],1);return n?n.type.kind!==`array`&&n.type.kind!==`string`&&n.type.kind!==`value`?t.error(`Expected argument of type string or array, but found `+mn(n.type)+` instead.`):new Ti(n):null},Ti.prototype.evaluate=function(e){var t=this.input.evaluate(e);if(typeof t==`string`||Array.isArray(t))return t.length;throw new An(`Expected value to be of type string or array, but found `+mn(Dn(t))+` instead.`)},Ti.prototype.eachChild=function(e){e(this.input)},Ti.prototype.outputDefined=function(){return!1},Ti.prototype.serialize=function(){var e=[`length`];return this.eachChild(function(t){e.push(t.serialize())}),e};var Ei={"==":vi,"!=":yi,">":xi,"<":bi,">=":Ci,"<=":Si,array:Mn,at:Qr,boolean:Mn,case:ni,coalesce:Xr,collator:Vn,format:Nn,image:Pn,in:$r,"index-of":ei,interpolate:Jr,"interpolate-hcl":Jr,"interpolate-lab":Jr,length:Ti,let:Zr,literal:kn,match:ti,number:Mn,"number-format":wi,object:Mn,slice:ri,step:br,string:Mn,"to-boolean":In,"to-color":In,"to-number":In,"to-string":In,var:gr,within:fr};function Di(e,t){var n=t[0],r=t[1],i=t[2],a=t[3];n=n.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);var o=a?a.evaluate(e):1,s=Tn(n,r,i,o);if(s)throw new An(s);return new bn(n/255*o,r/255*o,i/255*o,o)}function Oi(e,t){return e in t}function ki(e,t){var n=t[e];return n===void 0?null:n}function Ai(e,t,n,r){for(;n<=r;){var i=n+r>>1;if(t[i]===e)return!0;t[i]>e?r=i-1:n=i+1}return!1}function ji(e){return{type:e}}zn.register(Ei,{error:[ln,[rn],function(e,t){var n=t[0];throw new An(n.evaluate(e))}],typeof:[rn,[cn],function(e,t){var n=t[0];return mn(Dn(n.evaluate(e)))}],"to-rgba":[pn(nn,4),[on],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[on,[nn,nn,nn],Di],rgba:[on,[nn,nn,nn,nn],Di],has:{type:an,overloads:[[[rn],function(e,t){var n=t[0];return Oi(n.evaluate(e),e.properties())}],[[rn,sn],function(e,t){var n=t[0],r=t[1];return Oi(n.evaluate(e),r.evaluate(e))}]]},get:{type:cn,overloads:[[[rn],function(e,t){var n=t[0];return ki(n.evaluate(e),e.properties())}],[[rn,sn],function(e,t){var n=t[0],r=t[1];return ki(n.evaluate(e),r.evaluate(e))}]]},"feature-state":[cn,[rn],function(e,t){var n=t[0];return ki(n.evaluate(e),e.featureState||{})}],properties:[sn,[],function(e){return e.properties()}],"geometry-type":[rn,[],function(e){return e.geometryType()}],id:[cn,[],function(e){return e.id()}],zoom:[nn,[],function(e){return e.globals.zoom}],"heatmap-density":[nn,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[nn,[],function(e){return e.globals.lineProgress||0}],accumulated:[cn,[],function(e){return e.globals.accumulated===void 0?null:e.globals.accumulated}],"+":[nn,ji(nn),function(e,t){for(var n=0,r=0,i=t;r<i.length;r+=1){var a=i[r];n+=a.evaluate(e)}return n}],"*":[nn,ji(nn),function(e,t){for(var n=1,r=0,i=t;r<i.length;r+=1){var a=i[r];n*=a.evaluate(e)}return n}],"-":{type:nn,overloads:[[[nn,nn],function(e,t){var n=t[0],r=t[1];return n.evaluate(e)-r.evaluate(e)}],[[nn],function(e,t){return-t[0].evaluate(e)}]]},"/":[nn,[nn,nn],function(e,t){var n=t[0],r=t[1];return n.evaluate(e)/r.evaluate(e)}],"%":[nn,[nn,nn],function(e,t){var n=t[0],r=t[1];return n.evaluate(e)%r.evaluate(e)}],ln2:[nn,[],function(){return Math.LN2}],pi:[nn,[],function(){return Math.PI}],e:[nn,[],function(){return Math.E}],"^":[nn,[nn,nn],function(e,t){var n=t[0],r=t[1];return n.evaluate(e)**+r.evaluate(e)}],sqrt:[nn,[nn],function(e,t){var n=t[0];return Math.sqrt(n.evaluate(e))}],log10:[nn,[nn],function(e,t){var n=t[0];return Math.log(n.evaluate(e))/Math.LN10}],ln:[nn,[nn],function(e,t){var n=t[0];return Math.log(n.evaluate(e))}],log2:[nn,[nn],function(e,t){var n=t[0];return Math.log(n.evaluate(e))/Math.LN2}],sin:[nn,[nn],function(e,t){var n=t[0];return Math.sin(n.evaluate(e))}],cos:[nn,[nn],function(e,t){var n=t[0];return Math.cos(n.evaluate(e))}],tan:[nn,[nn],function(e,t){var n=t[0];return Math.tan(n.evaluate(e))}],asin:[nn,[nn],function(e,t){var n=t[0];return Math.asin(n.evaluate(e))}],acos:[nn,[nn],function(e,t){var n=t[0];return Math.acos(n.evaluate(e))}],atan:[nn,[nn],function(e,t){var n=t[0];return Math.atan(n.evaluate(e))}],min:[nn,ji(nn),function(e,t){return Math.min.apply(Math,t.map(function(t){return t.evaluate(e)}))}],max:[nn,ji(nn),function(e,t){return Math.max.apply(Math,t.map(function(t){return t.evaluate(e)}))}],abs:[nn,[nn],function(e,t){var n=t[0];return Math.abs(n.evaluate(e))}],round:[nn,[nn],function(e,t){var n=t[0].evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[nn,[nn],function(e,t){var n=t[0];return Math.floor(n.evaluate(e))}],ceil:[nn,[nn],function(e,t){var n=t[0];return Math.ceil(n.evaluate(e))}],"filter-==":[an,[rn,cn],function(e,t){var n=t[0],r=t[1];return e.properties()[n.value]===r.value}],"filter-id-==":[an,[cn],function(e,t){var n=t[0];return e.id()===n.value}],"filter-type-==":[an,[rn],function(e,t){var n=t[0];return e.geometryType()===n.value}],"filter-<":[an,[rn,cn],function(e,t){var n=t[0],r=t[1],i=e.properties()[n.value],a=r.value;return typeof i==typeof a&&i<a}],"filter-id-<":[an,[cn],function(e,t){var n=t[0],r=e.id(),i=n.value;return typeof r==typeof i&&r<i}],"filter->":[an,[rn,cn],function(e,t){var n=t[0],r=t[1],i=e.properties()[n.value],a=r.value;return typeof i==typeof a&&i>a}],"filter-id->":[an,[cn],function(e,t){var n=t[0],r=e.id(),i=n.value;return typeof r==typeof i&&r>i}],"filter-<=":[an,[rn,cn],function(e,t){var n=t[0],r=t[1],i=e.properties()[n.value],a=r.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[an,[cn],function(e,t){var n=t[0],r=e.id(),i=n.value;return typeof r==typeof i&&r<=i}],"filter->=":[an,[rn,cn],function(e,t){var n=t[0],r=t[1],i=e.properties()[n.value],a=r.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[an,[cn],function(e,t){var n=t[0],r=e.id(),i=n.value;return typeof r==typeof i&&r>=i}],"filter-has":[an,[cn],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[an,[],function(e){return e.id()!==null&&e.id()!==void 0}],"filter-type-in":[an,[pn(rn)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[an,[pn(cn)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[an,[rn,pn(cn)],function(e,t){var n=t[0];return t[1].value.indexOf(e.properties()[n.value])>=0}],"filter-in-large":[an,[rn,pn(cn)],function(e,t){var n=t[0],r=t[1];return Ai(e.properties()[n.value],r.value,0,r.value.length-1)}],all:{type:an,overloads:[[[an,an],function(e,t){var n=t[0],r=t[1];return n.evaluate(e)&&r.evaluate(e)}],[ji(an),function(e,t){for(var n=0,r=t;n<r.length;n+=1)if(!r[n].evaluate(e))return!1;return!0}]]},any:{type:an,overloads:[[[an,an],function(e,t){var n=t[0],r=t[1];return n.evaluate(e)||r.evaluate(e)}],[ji(an),function(e,t){for(var n=0,r=t;n<r.length;n+=1)if(r[n].evaluate(e))return!0;return!1}]]},"!":[an,[an],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[an,[rn],function(e,t){var n=t[0],r=e.globals&&e.globals.isSupportedScript;return r?r(n.evaluate(e)):!0}],upcase:[rn,[rn],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[rn,[rn],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[rn,ji(cn),function(e,t){return t.map(function(t){return On(t.evaluate(e))}).join(``)}],"resolved-locale":[rn,[un],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});function Mi(e){return{result:`success`,value:e}}function Ni(e){return{result:`error`,value:e}}function Pi(e){return e[`property-type`]===`data-driven`||e[`property-type`]===`cross-faded-data-driven`}function Fi(e){return!!e.expression&&e.expression.parameters.indexOf(`zoom`)>-1}function Ii(e){return!!e.expression&&e.expression.interpolated}function Li(e){return e instanceof Number?`number`:e instanceof String?`string`:e instanceof Boolean?`boolean`:Array.isArray(e)?`array`:e===null?`null`:typeof e}function Ri(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function zi(e){return e}function Bi(e,t){var n=t.type===`color`,r=e.stops&&typeof e.stops[0][0]==`object`,i=r||e.property!==void 0,a=r||!i,o=e.type||(Ii(t)?`exponential`:`interval`);if(n&&(e=Xt({},e),e.stops&&=e.stops.map(function(e){return[e[0],bn.parse(e[1])]}),e.default?e.default=bn.parse(e.default):e.default=bn.parse(t.default)),e.colorSpace&&e.colorSpace!==`rgb`&&!qr[e.colorSpace])throw Error(`Unknown color space: `+e.colorSpace);var s,c,l;if(o===`exponential`)s=Wi;else if(o===`interval`)s=Ui;else if(o===`categorical`){s=Hi,c=Object.create(null);for(var u=0,d=e.stops;u<d.length;u+=1){var f=d[u];c[f[0]]=f[1]}l=typeof e.stops[0][0]}else if(o===`identity`)s=Gi;else throw Error(`Unknown function type "`+o+`"`);if(r){for(var p={},m=[],h=0;h<e.stops.length;h++){var g=e.stops[h],_=g[0].zoom;p[_]===void 0&&(p[_]={zoom:_,type:e.type,property:e.property,default:e.default,stops:[]},m.push(_)),p[_].stops.push([g[0].value,g[1]])}for(var v=[],y=0,b=m;y<b.length;y+=1){var x=b[y];v.push([p[x].zoom,Bi(p[x],t)])}var S={name:`linear`};return{kind:`composite`,interpolationType:S,interpolationFactor:Jr.interpolationFactor.bind(void 0,S),zoomStops:v.map(function(e){return e[0]}),evaluate:function(n,r){var i=n.zoom;return Wi({stops:v,base:e.base},t,i).evaluate(i,r)}}}else if(a){var C=o===`exponential`?{name:`exponential`,base:e.base===void 0?1:e.base}:null;return{kind:`camera`,interpolationType:C,interpolationFactor:Jr.interpolationFactor.bind(void 0,C),zoomStops:e.stops.map(function(e){return e[0]}),evaluate:function(n){var r=n.zoom;return s(e,t,r,c,l)}}}else return{kind:`source`,evaluate:function(n,r){var i=r&&r.properties?r.properties[e.property]:void 0;return i===void 0?Vi(e.default,t.default):s(e,t,i,c,l)}}}function Vi(e,t,n){if(e!==void 0)return e;if(t!==void 0)return t;if(n!==void 0)return n}function Hi(e,t,n,r,i){return Vi(typeof n===i?r[n]:void 0,e.default,t.default)}function Ui(e,t,n){if(Li(n)!==`number`)return Vi(e.default,t.default);var r=e.stops.length;if(r===1||n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[r-1][0])return e.stops[r-1][1];var i=yr(e.stops.map(function(e){return e[0]}),n);return e.stops[i][1]}function Wi(e,t,n){var r=e.base===void 0?1:e.base;if(Li(n)!==`number`)return Vi(e.default,t.default);var i=e.stops.length;if(i===1||n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[i-1][0])return e.stops[i-1][1];var a=yr(e.stops.map(function(e){return e[0]}),n),o=Ki(n,r,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],c=e.stops[a+1][1],l=wr[t.type]||zi;if(e.colorSpace&&e.colorSpace!==`rgb`){var u=qr[e.colorSpace];l=function(e,t){return u.reverse(u.interpolate(u.forward(e),u.forward(t),o))}}return typeof s.evaluate==`function`?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=s.evaluate.apply(void 0,e),r=c.evaluate.apply(void 0,e);if(!(n===void 0||r===void 0))return l(n,r,o)}}:l(s,c,o)}function Gi(e,t,n){return t.type===`color`?n=bn.parse(n):t.type===`formatted`?n=Cn.fromString(n.toString()):t.type===`resolvedImage`?n=wn.fromString(n.toString()):Li(n)!==t.type&&(t.type!==`enum`||!t.values[n])&&(n=void 0),Vi(n,e.default,t.default)}function Ki(e,t,n,r){var i=r-n,a=e-n;return i===0?0:t===1?a/i:(t**+a-1)/(t**+i-1)}var qi=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Rn,this._defaultValue=t?ra(t):null,this._enumValues=t&&t.type===`enum`?t.values:null};qi.prototype.evaluateWithoutErrorHandling=function(e,t,n,r,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},qi.prototype.evaluate=function(e,t,n,r,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(o==null||typeof o==`number`&&o!==o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new An(`Expected value to be one of `+Object.keys(this._enumValues).map(function(e){return JSON.stringify(e)}).join(`, `)+`, but found `+JSON.stringify(o)+` instead.`);return o}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,typeof console<`u`&&console.warn(e.message)),this._defaultValue}};function Ji(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`string`&&e[0]in Ei}function Yi(e,t){var n=new _r(Ei,[],t?na(t):void 0),r=n.parse(e,void 0,void 0,void 0,t&&t.type===`string`?{typeAnnotation:`coerce`}:void 0);return r?Mi(new qi(r,t)):Ni(n.errors)}var Xi=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!==`constant`&&!mr(t.expression)};Xi.prototype.evaluateWithoutErrorHandling=function(e,t,n,r,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)},Xi.prototype.evaluate=function(e,t,n,r,i,a){return this._styleExpression.evaluate(e,t,n,r,i,a)};var Zi=function(e,t,n,r){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent=e!==`camera`&&!mr(t.expression),this.interpolationType=r};Zi.prototype.evaluateWithoutErrorHandling=function(e,t,n,r,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)},Zi.prototype.evaluate=function(e,t,n,r,i,a){return this._styleExpression.evaluate(e,t,n,r,i,a)},Zi.prototype.interpolationFactor=function(e,t,n){return this.interpolationType?Jr.interpolationFactor(this.interpolationType,e,t,n):0};function Qi(e,t){if(e=Yi(e,t),e.result===`error`)return e;var n=e.value.expression,r=pr(n);if(!r&&!Pi(t))return Ni([new $t(``,`data expressions not supported`)]);var i=hr(n,[`zoom`]);if(!i&&!Fi(t))return Ni([new $t(``,`zoom expressions not supported`)]);var a=ta(n);if(!a&&!i)return Ni([new $t(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`)]);if(a instanceof $t)return Ni([a]);if(a instanceof Jr&&!Ii(t))return Ni([new $t(``,`"interpolate" expressions cannot be used with this property`)]);if(!a)return Mi(r?new Xi(`constant`,e.value):new Xi(`source`,e.value));var o=a instanceof Jr?a.interpolation:void 0;return Mi(r?new Zi(`camera`,e.value,a.labels,o):new Zi(`composite`,e.value,a.labels,o))}var $i=function(e,t){this._parameters=e,this._specification=t,Xt(this,Bi(this._parameters,this._specification))};$i.deserialize=function(e){return new $i(e._parameters,e._specification)},$i.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};function ea(e,t){if(Ri(e))return new $i(e,t);if(Ji(e)){var n=Qi(e,t);if(n.result===`error`)throw Error(n.value.map(function(e){return e.key+`: `+e.message}).join(`, `));return n.value}else{var r=e;return typeof e==`string`&&t.type===`color`&&(r=bn.parse(e)),{kind:`constant`,evaluate:function(){return r}}}}function ta(e){var t=null;if(e instanceof Zr)t=ta(e.result);else if(e instanceof Xr)for(var n=0,r=e.args;n<r.length;n+=1){var i=r[n];if(t=ta(i),t)break}else (e instanceof br||e instanceof Jr)&&e.input instanceof zn&&e.input.name===`zoom`&&(t=e);return t instanceof $t||e.eachChild(function(e){var n=ta(e);n instanceof $t?t=n:!t&&n?t=new $t(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`):t&&n&&t!==n&&(t=new $t(``,`Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.`))}),t}function na(e){var t={color:on,string:rn,number:nn,enum:rn,boolean:an,formatted:dn,resolvedImage:fn};return e.type===`array`?pn(t[e.value]||cn,e.length):t[e.type]}function ra(e){return e.type===`color`&&Ri(e.default)?new bn(0,0,0,0):e.type===`color`?bn.parse(e.default)||null:e.default===void 0?null:e.default}function ia(e){var t=e.key,n=e.value,r=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=[],c=Li(n);if(c!==`object`)return[new Jt(t,n,`object expected, `+c+` found`)];for(var l in n){var u=l.split(`.`)[0],d=r[u]||r[`*`],f=void 0;if(i[u])f=i[u];else if(r[u])f=La;else if(i[`*`])f=i[`*`];else if(r[`*`])f=La;else{s.push(new Jt(t,n[l],`unknown property "`+l+`"`));continue}s=s.concat(f({key:(t&&t+`.`)+l,value:n[l],valueSpec:d,style:a,styleSpec:o,object:n,objectKey:l},n))}for(var p in r)i[p]||r[p].required&&r[p].default===void 0&&n[p]===void 0&&s.push(new Jt(t,n,`missing required property "`+p+`"`));return s}function aa(e){var t=e.value,n=e.valueSpec,r=e.style,i=e.styleSpec,a=e.key,o=e.arrayElementValidator||La;if(Li(t)!==`array`)return[new Jt(a,t,`array expected, `+Li(t)+` found`)];if(n.length&&t.length!==n.length)return[new Jt(a,t,`array length `+n.length+` expected, length `+t.length+` found`)];if(n[`min-length`]&&t.length<n[`min-length`])return[new Jt(a,t,`array length at least `+n[`min-length`]+` expected, length `+t.length+` found`)];var s={type:n.value,values:n.values};i.$version<7&&(s.function=n.function),Li(n.value)===`object`&&(s=n.value);for(var c=[],l=0;l<t.length;l++)c=c.concat(o({array:t,arrayIndex:l,value:t[l],valueSpec:s,style:r,styleSpec:i,key:a+`[`+l+`]`}));return c}function oa(e){var t=e.key,n=e.value,r=e.valueSpec,i=Li(n);return i===`number`&&n!==n&&(i=`NaN`),i===`number`?`minimum`in r&&n<r.minimum?[new Jt(t,n,n+` is less than the minimum value `+r.minimum)]:`maximum`in r&&n>r.maximum?[new Jt(t,n,n+` is greater than the maximum value `+r.maximum)]:[]:[new Jt(t,n,`number expected, `+i+` found`)]}function sa(e){var t=e.valueSpec,n=Zt(e.value.type),r,i={},a,o,s=n!==`categorical`&&e.value.property===void 0,c=!s,l=Li(e.value.stops)===`array`&&Li(e.value.stops[0])===`array`&&Li(e.value.stops[0][0])===`object`,u=ia({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:d,default:m}});return n===`identity`&&s&&u.push(new Jt(e.key,e.value,`missing required property "property"`)),n!==`identity`&&!e.value.stops&&u.push(new Jt(e.key,e.value,`missing required property "stops"`)),n===`exponential`&&e.valueSpec.expression&&!Ii(e.valueSpec)&&u.push(new Jt(e.key,e.value,`exponential functions not supported`)),e.styleSpec.$version>=8&&(c&&!Pi(e.valueSpec)?u.push(new Jt(e.key,e.value,`property functions not supported`)):s&&!Fi(e.valueSpec)&&u.push(new Jt(e.key,e.value,`zoom functions not supported`))),(n===`categorical`||l)&&e.value.property===void 0&&u.push(new Jt(e.key,e.value,`"property" property is required`)),u;function d(e){if(n===`identity`)return[new Jt(e.key,e.value,`identity function may not have a "stops" property`)];var t=[],r=e.value;return t=t.concat(aa({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:f})),Li(r)===`array`&&r.length===0&&t.push(new Jt(e.key,r,`array must have at least one stop`)),t}function f(e){var n=[],r=e.value,s=e.key;if(Li(r)!==`array`)return[new Jt(s,r,`array expected, `+Li(r)+` found`)];if(r.length!==2)return[new Jt(s,r,`array length 2 expected, length `+r.length+` found`)];if(l){if(Li(r[0])!==`object`)return[new Jt(s,r,`object expected, `+Li(r[0])+` found`)];if(r[0].zoom===void 0)return[new Jt(s,r,`object stop key must have zoom`)];if(r[0].value===void 0)return[new Jt(s,r,`object stop key must have value`)];if(o&&o>Zt(r[0].zoom))return[new Jt(s,r[0].zoom,`stop zoom values must appear in ascending order`)];Zt(r[0].zoom)!==o&&(o=Zt(r[0].zoom),a=void 0,i={}),n=n.concat(ia({key:s+`[0]`,value:r[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:oa,value:p}}))}else n=n.concat(p({key:s+`[0]`,value:r[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},r));return Ji(Qt(r[1]))?n.concat([new Jt(s+`[1]`,r[1],`expressions are not allowed in function stops.`)]):n.concat(La({key:s+`[1]`,value:r[1],valueSpec:t,style:e.style,styleSpec:e.styleSpec}))}function p(e,o){var s=Li(e.value),c=Zt(e.value),l=e.value===null?o:e.value;if(!r)r=s;else if(s!==r)return[new Jt(e.key,l,s+` stop domain type must match previous stop domain type `+r)];if(s!==`number`&&s!==`string`&&s!==`boolean`)return[new Jt(e.key,l,`stop domain value must be a number, string, or boolean`)];if(s!==`number`&&n!==`categorical`){var u=`number expected, `+s+` found`;return Pi(t)&&n===void 0&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Jt(e.key,l,u)]}return n===`categorical`&&s===`number`&&(!isFinite(c)||Math.floor(c)!==c)?[new Jt(e.key,l,`integer expected, found `+c)]:n!==`categorical`&&s===`number`&&a!==void 0&&c<a?[new Jt(e.key,l,`stop domain values must appear in ascending order`)]:(a=c,n===`categorical`&&c in i?[new Jt(e.key,l,`stop domain values must be unique`)]:(i[c]=!0,[]))}function m(e){return La({key:e.key,value:e.value,valueSpec:t,style:e.style,styleSpec:e.styleSpec})}}function ca(e){var t=(e.expressionContext===`property`?Qi:Yi)(Qt(e.value),e.valueSpec);if(t.result===`error`)return t.value.map(function(t){return new Jt(``+e.key+t.key,e.value,t.message)});var n=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext===`property`&&e.propertyKey===`text-font`&&!n.outputDefined())return[new Jt(e.key,e.value,`Invalid data expression for "`+e.propertyKey+`". Output values must be contained as literals within the expression.`)];if(e.expressionContext===`property`&&e.propertyType===`layout`&&!mr(n))return[new Jt(e.key,e.value,`"feature-state" data expressions are not supported with layout properties.`)];if(e.expressionContext===`filter`&&!mr(n))return[new Jt(e.key,e.value,`"feature-state" data expressions are not supported with filters.`)];if(e.expressionContext&&e.expressionContext.indexOf(`cluster`)===0){if(!hr(n,[`zoom`,`feature-state`]))return[new Jt(e.key,e.value,`"zoom" and "feature-state" expressions are not supported with cluster properties.`)];if(e.expressionContext===`cluster-initial`&&!pr(n))return[new Jt(e.key,e.value,`Feature data expressions are not supported with initial expression part of cluster properties.`)]}return[]}function la(e){var t=e.value,n=e.key,r=Li(t);return r===`boolean`?[]:[new Jt(n,t,`boolean expected, `+r+` found`)]}function ua(e){var t=e.key,n=e.value,r=Li(n);return r===`string`?yn(n)===null?[new Jt(t,n,`color expected, "`+n+`" found`)]:[]:[new Jt(t,n,`color expected, `+r+` found`)]}function da(e){var t=e.key,n=e.value,r=e.valueSpec,i=[];return Array.isArray(r.values)?r.values.indexOf(Zt(n))===-1&&i.push(new Jt(t,n,`expected one of [`+r.values.join(`, `)+`], `+JSON.stringify(n)+` found`)):Object.keys(r.values).indexOf(Zt(n))===-1&&i.push(new Jt(t,n,`expected one of [`+Object.keys(r.values).join(`, `)+`], `+JSON.stringify(n)+` found`)),i}function fa(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case`has`:return e.length>=2&&e[1]!==`$id`&&e[1]!==`$type`;case`in`:return e.length>=3&&(typeof e[1]!=`string`||Array.isArray(e[2]));case`!in`:case`!has`:case`none`:return!1;case`==`:case`!=`:case`>`:case`>=`:case`<`:case`<=`:return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case`any`:case`all`:for(var t=0,n=e.slice(1);t<n.length;t+=1){var r=n[t];if(!fa(r)&&typeof r!=`boolean`)return!1}return!0;default:return!0}}var pa={type:`boolean`,default:!1,transition:!1,"property-type":`data-driven`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]}};function ma(e){if(e==null)return{filter:function(){return!0},needGeometry:!1};fa(e)||(e=_a(e));var t=Yi(e,pa);if(t.result===`error`)throw Error(t.value.map(function(e){return e.key+`: `+e.message}).join(`, `));return{filter:function(e,n,r){return t.value.evaluate(e,n,{},r)},needGeometry:ga(e)}}function ha(e,t){return e<t?-1:e>t?1:0}function ga(e){if(!Array.isArray(e))return!1;if(e[0]===`within`)return!0;for(var t=1;t<e.length;t++)if(ga(e[t]))return!0;return!1}function _a(e){if(!e)return!0;var t=e[0];return e.length<=1?t!==`any`:t===`==`?va(e[1],e[2],`==`):t===`!=`?Sa(va(e[1],e[2],`==`)):t===`<`||t===`>`||t===`<=`||t===`>=`?va(e[1],e[2],t):t===`any`?ya(e.slice(1)):t===`all`?[`all`].concat(e.slice(1).map(_a)):t===`none`?[`all`].concat(e.slice(1).map(_a).map(Sa)):t===`in`?ba(e[1],e.slice(2)):t===`!in`?Sa(ba(e[1],e.slice(2))):t===`has`?xa(e[1]):t===`!has`?Sa(xa(e[1])):t===`within`?e:!0}function va(e,t,n){switch(e){case`$type`:return[`filter-type-`+n,t];case`$id`:return[`filter-id-`+n,t];default:return[`filter-`+n,e,t]}}function ya(e){return[`any`].concat(e.map(_a))}function ba(e,t){if(t.length===0)return!1;switch(e){case`$type`:return[`filter-type-in`,[`literal`,t]];case`$id`:return[`filter-id-in`,[`literal`,t]];default:return t.length>200&&!t.some(function(e){return typeof e!=typeof t[0]})?[`filter-in-large`,e,[`literal`,t.sort(ha)]]:[`filter-in-small`,e,[`literal`,t]]}}function xa(e){switch(e){case`$type`:return!0;case`$id`:return[`filter-has-id`];default:return[`filter-has`,e]}}function Sa(e){return[`!`,e]}function Ca(e){return fa(Qt(e.value))?ca(Xt({},e,{expressionContext:`filter`,valueSpec:{value:`boolean`}})):wa(e)}function wa(e){var t=e.value,n=e.key;if(Li(t)!==`array`)return[new Jt(n,t,`array expected, `+Li(t)+` found`)];var r=e.styleSpec,i,a=[];if(t.length<1)return[new Jt(n,t,`filter array must have at least 1 element`)];switch(a=a.concat(da({key:n+`[0]`,value:t[0],valueSpec:r.filter_operator,style:e.style,styleSpec:e.styleSpec})),Zt(t[0])){case`<`:case`<=`:case`>`:case`>=`:t.length>=2&&Zt(t[1])===`$type`&&a.push(new Jt(n,t,`"$type" cannot be use with operator "`+t[0]+`"`));case`==`:case`!=`:t.length!==3&&a.push(new Jt(n,t,`filter array for operator "`+t[0]+`" must have 3 elements`));case`in`:case`!in`:t.length>=2&&(i=Li(t[1]),i!==`string`&&a.push(new Jt(n+`[1]`,t[1],`string expected, `+i+` found`)));for(var o=2;o<t.length;o++)i=Li(t[o]),Zt(t[1])===`$type`?a=a.concat(da({key:n+`[`+o+`]`,value:t[o],valueSpec:r.geometry_type,style:e.style,styleSpec:e.styleSpec})):i!==`string`&&i!==`number`&&i!==`boolean`&&a.push(new Jt(n+`[`+o+`]`,t[o],`string, number, or boolean expected, `+i+` found`));break;case`any`:case`all`:case`none`:for(var s=1;s<t.length;s++)a=a.concat(wa({key:n+`[`+s+`]`,value:t[s],style:e.style,styleSpec:e.styleSpec}));break;case`has`:case`!has`:i=Li(t[1]),t.length===2?i!==`string`&&a.push(new Jt(n+`[1]`,t[1],`string expected, `+i+` found`)):a.push(new Jt(n,t,`filter array for "`+t[0]+`" operator must have 2 elements`));break;case`within`:i=Li(t[1]),t.length===2?i!==`object`&&a.push(new Jt(n+`[1]`,t[1],`object expected, `+i+` found`)):a.push(new Jt(n,t,`filter array for "`+t[0]+`" operator must have 2 elements`));break}return a}function Ta(e,t){var n=e.key,r=e.style,i=e.styleSpec,a=e.value,o=e.objectKey,s=i[t+`_`+e.layerType];if(!s)return[];var c=o.match(/^(.*)-transition$/);if(t===`paint`&&c&&s[c[1]]&&s[c[1]].transition)return La({key:n,value:a,valueSpec:i.transition,style:r,styleSpec:i});var l=e.valueSpec||s[o];if(!l)return[new Jt(n,a,`unknown property "`+o+`"`)];var u;if(Li(a)===`string`&&Pi(l)&&!l.tokens&&(u=/^{([^}]+)}$/.exec(a)))return[new Jt(n,a,`"`+o+`" does not support interpolation syntax
Use an identity property function instead: \`{ "type": "identity", "property": `+JSON.stringify(u[1])+" }`.")];var d=[];return e.layerType===`symbol`&&(o===`text-field`&&r&&!r.glyphs&&d.push(new Jt(n,a,`use of "text-field" requires a style "glyphs" property`)),o===`text-font`&&Ri(Qt(a))&&Zt(a.type)===`identity`&&d.push(new Jt(n,a,`"text-font" does not support identity functions`))),d.concat(La({key:e.key,value:a,valueSpec:l,style:r,styleSpec:i,expressionContext:`property`,propertyType:t,propertyKey:o}))}function Ea(e){return Ta(e,`paint`)}function Da(e){return Ta(e,`layout`)}function Oa(e){var t=[],n=e.value,r=e.key,i=e.style,a=e.styleSpec;!n.type&&!n.ref&&t.push(new Jt(r,n,`either "type" or "ref" is required`));var o=Zt(n.type),s=Zt(n.ref);if(n.id)for(var c=Zt(n.id),l=0;l<e.arrayIndex;l++){var u=i.layers[l];Zt(u.id)===c&&t.push(new Jt(r,n.id,`duplicate layer id "`+n.id+`", previously used at line `+u.id.__line__))}if(`ref`in n){[`type`,`source`,`source-layer`,`filter`,`layout`].forEach(function(e){e in n&&t.push(new Jt(r,n[e],`"`+e+`" is prohibited for ref layers`))});var d;i.layers.forEach(function(e){Zt(e.id)===s&&(d=e)}),d?d.ref?t.push(new Jt(r,n.ref,`ref cannot reference another ref layer`)):o=Zt(d.type):t.push(new Jt(r,n.ref,`ref layer "`+s+`" not found`))}else if(o!==`background`)if(!n.source)t.push(new Jt(r,n,`missing required property "source"`));else{var f=i.sources&&i.sources[n.source],p=f&&Zt(f.type);f?p===`vector`&&o===`raster`?t.push(new Jt(r,n.source,`layer "`+n.id+`" requires a raster source`)):p===`raster`&&o!==`raster`?t.push(new Jt(r,n.source,`layer "`+n.id+`" requires a vector source`)):p===`vector`&&!n[`source-layer`]?t.push(new Jt(r,n,`layer "`+n.id+`" must specify a "source-layer"`)):p===`raster-dem`&&o!==`hillshade`?t.push(new Jt(r,n.source,`raster-dem source can only be used with layer type 'hillshade'.`)):o===`line`&&n.paint&&n.paint[`line-gradient`]&&(p!==`geojson`||!f.lineMetrics)&&t.push(new Jt(r,n,`layer "`+n.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new Jt(r,n.source,`source "`+n.source+`" not found`))}return t=t.concat(ia({key:r,value:n,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return La({key:r+`.type`,value:n.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,object:n,objectKey:`type`})},filter:Ca,layout:function(e){return ia({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return Da(Xt({layerType:o},e))}}})},paint:function(e){return ia({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return Ea(Xt({layerType:o},e))}}})}}})),t}function ka(e){var t=e.value,n=e.key,r=Li(t);return r===`string`?[]:[new Jt(n,t,`string expected, `+r+` found`)]}var Aa={promoteId:Ma};function ja(e){var t=e.value,n=e.key,r=e.styleSpec,i=e.style;if(!t.type)return[new Jt(n,t,`"type" is required`)];var a=Zt(t.type),o;switch(a){case`vector`:case`raster`:case`raster-dem`:return o=ia({key:n,value:t,valueSpec:r[`source_`+a.replace(`-`,`_`)],style:e.style,styleSpec:r,objectElementValidators:Aa}),o;case`geojson`:if(o=ia({key:n,value:t,valueSpec:r.source_geojson,style:i,styleSpec:r,objectElementValidators:Aa}),t.cluster)for(var s in t.clusterProperties){var c=t.clusterProperties[s],l=c[0],u=c[1],d=typeof l==`string`?[l,[`accumulated`],[`get`,s]]:l;o.push.apply(o,ca({key:n+`.`+s+`.map`,value:u,expressionContext:`cluster-map`})),o.push.apply(o,ca({key:n+`.`+s+`.reduce`,value:d,expressionContext:`cluster-reduce`}))}return o;case`video`:return ia({key:n,value:t,valueSpec:r.source_video,style:i,styleSpec:r});case`image`:return ia({key:n,value:t,valueSpec:r.source_image,style:i,styleSpec:r});case`canvas`:return[new Jt(n,null,`Please use runtime APIs to add canvas sources, rather than including them in stylesheets.`,`source.canvas`)];default:return da({key:n+`.type`,value:t.type,valueSpec:{values:[`vector`,`raster`,`raster-dem`,`geojson`,`video`,`image`]},style:i,styleSpec:r})}}function Ma(e){var t=e.key,n=e.value;if(Li(n)===`string`)return ka({key:t,value:n});var r=[];for(var i in n)r.push.apply(r,ka({key:t+`.`+i,value:n[i]}));return r}function Na(e){var t=e.value,n=e.styleSpec,r=n.light,i=e.style,a=[],o=Li(t);if(t===void 0)return a;if(o!==`object`)return a=a.concat([new Jt(`light`,t,`object expected, `+o+` found`)]),a;for(var s in t){var c=s.match(/^(.*)-transition$/);a=c&&r[c[1]]&&r[c[1]].transition?a.concat(La({key:s,value:t[s],valueSpec:n.transition,style:i,styleSpec:n})):r[s]?a.concat(La({key:s,value:t[s],valueSpec:r[s],style:i,styleSpec:n})):a.concat([new Jt(s,t[s],`unknown property "`+s+`"`)])}return a}function Pa(e){return ka(e).length===0?[]:ca(e)}function Fa(e){return ka(e).length===0?[]:ca(e)}var Ia={"*":function(){return[]},array:aa,boolean:la,number:oa,color:ua,constants:Yt,enum:da,filter:Ca,function:sa,layer:Oa,object:ia,source:ja,light:Na,string:ka,formatted:Pa,resolvedImage:Fa};function La(e){var t=e.value,n=e.valueSpec,r=e.styleSpec;return n.expression&&Ri(Zt(t))?sa(e):n.expression&&Ji(Qt(t))?ca(e):n.type&&Ia[n.type]?Ia[n.type](e):ia(Xt({},e,{valueSpec:n.type?r[n.type]:n}))}function Ra(e){var t=e.value,n=e.key,r=ka(e);return r.length||(t.indexOf(`{fontstack}`)===-1&&r.push(new Jt(n,t,`"glyphs" url must include a "{fontstack}" token`)),t.indexOf(`{range}`)===-1&&r.push(new Jt(n,t,`"glyphs" url must include a "{range}" token`))),r}function za(e,t){t===void 0&&(t=qt);var n=[];return n=n.concat(La({key:``,value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:Ra,"*":function(){return[]}}})),e.constants&&(n=n.concat(Yt({key:`constants`,value:e.constants,style:e,styleSpec:t}))),Ba(n)}za.source=Va(ja),za.light=Va(Na),za.layer=Va(Oa),za.filter=Va(Ca),za.paintProperty=Va(Ea),za.layoutProperty=Va(Da);function Ba(e){return[].concat(e).sort(function(e,t){return e.line-t.line})}function Va(e){return function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return Ba(e.apply(this,t))}}var Ha=za,Ua=Ha.light,Wa=Ha.paintProperty,Ga=Ha.layoutProperty;function Ka(e,t){var n=!1;if(t&&t.length)for(var r=0,i=t;r<i.length;r+=1){var a=i[r];e.fire(new lt(Error(a.message))),n=!0}return n}var qa=Ya,Ja=3;function Ya(e,t,n){var r=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var i=new Int32Array(this.arrayBuffer);e=i[0],t=i[1],n=i[2],this.d=t+2*n;for(var a=0;a<this.d*this.d;a++){var o=i[Ja+a],s=i[Ja+a+1];r.push(o===s?null:i.subarray(o,s))}var c=i[Ja+r.length],l=i[Ja+r.length+1];this.keys=i.subarray(c,l),this.bboxes=i.subarray(l),this.insert=this._insertReadonly}else{this.d=t+2*n;for(var u=0;u<this.d*this.d;u++)r.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=n,this.scale=t/e,this.uid=0;var d=n/t*e;this.min=-d,this.max=e+d}Ya.prototype.insert=function(e,t,n,r,i){this._forEachCell(t,n,r,i,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)},Ya.prototype._insertReadonly=function(){throw`Cannot insert into a GridIndex created from an ArrayBuffer.`},Ya.prototype._insertCell=function(e,t,n,r,i,a){this.cells[i].push(a)},Ya.prototype.query=function(e,t,n,r,i){var a=this.min,o=this.max;if(e<=a&&t<=a&&o<=n&&o<=r&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(e,t,n,r,this._queryCell,s,{},i),s},Ya.prototype._queryCell=function(e,t,n,r,i,a,o,s){var c=this.cells[i];if(c!==null)for(var l=this.keys,u=this.bboxes,d=0;d<c.length;d++){var f=c[d];if(o[f]===void 0){var p=f*4;(s?s(u[p+0],u[p+1],u[p+2],u[p+3]):e<=u[p+2]&&t<=u[p+3]&&n>=u[p+0]&&r>=u[p+1])?(o[f]=!0,a.push(l[f])):o[f]=!1}}},Ya.prototype._forEachCell=function(e,t,n,r,i,a,o,s){for(var c=this._convertToCellCoord(e),l=this._convertToCellCoord(t),u=this._convertToCellCoord(n),d=this._convertToCellCoord(r),f=c;f<=u;f++)for(var p=l;p<=d;p++){var m=this.d*p+f;if(!(s&&!s(this._convertFromCellCoord(f),this._convertFromCellCoord(p),this._convertFromCellCoord(f+1),this._convertFromCellCoord(p+1)))&&i.call(this,e,t,n,r,m,a,o,s))return}},Ya.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},Ya.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},Ya.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=Ja+this.cells.length+1+1,n=0,r=0;r<this.cells.length;r++)n+=this.cells[r].length;var i=new Int32Array(t+n+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var a=t,o=0;o<e.length;o++){var s=e[o];i[Ja+o]=a,i.set(s,a),a+=s.length}return i[Ja+e.length]=a,i.set(this.keys,a),a+=this.keys.length,i[Ja+e.length+1]=a,i.set(this.bboxes,a),a+=this.bboxes.length,i.buffer};var Xa=s.ImageData,Za=s.ImageBitmap,Qa={};function $a(e,t,n){n===void 0&&(n={}),Object.defineProperty(t,`_classRegistryKey`,{value:e,writeable:!1}),Qa[e]={klass:t,omit:n.omit||[],shallow:n.shallow||[]}}for(var eo in $a(`Object`,Object),qa.serialize=function(e,t){var n=e.toArrayBuffer();return t&&t.push(n),{buffer:n}},qa.deserialize=function(e){return new qa(e.buffer)},$a(`Grid`,qa),$a(`Color`,bn),$a(`Error`,Error),$a(`ResolvedImage`,wn),$a(`StylePropertyFunction`,$i),$a(`StyleExpression`,qi,{omit:[`_evaluator`]}),$a(`ZoomDependentExpression`,Zi),$a(`ZoomConstantExpression`,Xi),$a(`CompoundExpression`,zn,{omit:[`_evaluate`]}),Ei)Ei[eo]._classRegistryKey||$a(`Expression_`+eo,Ei[eo]);function to(e){return e&&typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name===`ArrayBuffer`)}function no(e){return Za&&e instanceof Za}function ro(e,t){if(e==null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(to(e)||no(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var n=e;return t&&t.push(n.buffer),n}if(e instanceof Xa)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var r=[],i=0,a=e;i<a.length;i+=1){var o=a[i];r.push(ro(o,t))}return r}if(typeof e==`object`){var s=e.constructor,c=s._classRegistryKey;if(!c)throw Error(`can't serialize object of unregistered class`);var l=s.serialize?s.serialize(e,t):{};if(!s.serialize){for(var u in e)if(e.hasOwnProperty(u)&&!(Qa[c].omit.indexOf(u)>=0)){var d=e[u];l[u]=Qa[c].shallow.indexOf(u)>=0?d:ro(d,t)}e instanceof Error&&(l.message=e.message)}if(l.$name)throw Error(`$name property is reserved for worker serialization logic.`);return c!==`Object`&&(l.$name=c),l}throw Error(`can't serialize object of type `+typeof e)}function io(e){if(e==null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||to(e)||no(e)||ArrayBuffer.isView(e)||e instanceof Xa)return e;if(Array.isArray(e))return e.map(io);if(typeof e==`object`){var t=e.$name||`Object`,n=Qa[t].klass;if(!n)throw Error(`can't deserialize unregistered class `+t);if(n.deserialize)return n.deserialize(e);for(var r=Object.create(n.prototype),i=0,a=Object.keys(e);i<a.length;i+=1){var o=a[i];if(o!==`$name`){var s=e[o];r[o]=Qa[t].shallow.indexOf(o)>=0?s:io(s)}}return r}throw Error(`can't deserialize object of type `+typeof e)}var ao=function(){this.first=!0};ao.prototype.update=function(e,t){var n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=t),e===this.lastZoom?!1:(this.lastZoom=e,this.lastFloorZoom=n,!0))};var oo={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function so(e){for(var t=0,n=e;t<n.length;t+=1){var r=n[t];if(fo(r.charCodeAt(0)))return!0}return!1}function co(e){for(var t=0,n=e;t<n.length;t+=1){var r=n[t];if(!lo(r.charCodeAt(0)))return!1}return!0}function lo(e){return!(oo.Arabic(e)||oo[`Arabic Supplement`](e)||oo[`Arabic Extended-A`](e)||oo[`Arabic Presentation Forms-A`](e)||oo[`Arabic Presentation Forms-B`](e))}function uo(e){return e<11904?!1:!!(oo[`Bopomofo Extended`](e)||oo.Bopomofo(e)||oo[`CJK Compatibility Forms`](e)||oo[`CJK Compatibility Ideographs`](e)||oo[`CJK Compatibility`](e)||oo[`CJK Radicals Supplement`](e)||oo[`CJK Strokes`](e)||oo[`CJK Symbols and Punctuation`](e)||oo[`CJK Unified Ideographs Extension A`](e)||oo[`CJK Unified Ideographs`](e)||oo[`Enclosed CJK Letters and Months`](e)||oo[`Halfwidth and Fullwidth Forms`](e)||oo.Hiragana(e)||oo[`Ideographic Description Characters`](e)||oo[`Kangxi Radicals`](e)||oo[`Katakana Phonetic Extensions`](e)||oo.Katakana(e)||oo[`Vertical Forms`](e)||oo[`Yi Radicals`](e)||oo[`Yi Syllables`](e))}function fo(e){return e===746||e===747?!0:e<4352?!1:!!(oo[`Bopomofo Extended`](e)||oo.Bopomofo(e)||oo[`CJK Compatibility Forms`](e)&&!(e>=65097&&e<=65103)||oo[`CJK Compatibility Ideographs`](e)||oo[`CJK Compatibility`](e)||oo[`CJK Radicals Supplement`](e)||oo[`CJK Strokes`](e)||oo[`CJK Symbols and Punctuation`](e)&&!(e>=12296&&e<=12305)&&!(e>=12308&&e<=12319)&&e!==12336||oo[`CJK Unified Ideographs Extension A`](e)||oo[`CJK Unified Ideographs`](e)||oo[`Enclosed CJK Letters and Months`](e)||oo[`Hangul Compatibility Jamo`](e)||oo[`Hangul Jamo Extended-A`](e)||oo[`Hangul Jamo Extended-B`](e)||oo[`Hangul Jamo`](e)||oo[`Hangul Syllables`](e)||oo.Hiragana(e)||oo[`Ideographic Description Characters`](e)||oo.Kanbun(e)||oo[`Kangxi Radicals`](e)||oo[`Katakana Phonetic Extensions`](e)||oo.Katakana(e)&&e!==12540||oo[`Halfwidth and Fullwidth Forms`](e)&&e!==65288&&e!==65289&&e!==65293&&!(e>=65306&&e<=65310)&&e!==65339&&e!==65341&&e!==65343&&!(e>=65371&&e<=65503)&&e!==65507&&!(e>=65512&&e<=65519)||oo[`Small Form Variants`](e)&&!(e>=65112&&e<=65118)&&!(e>=65123&&e<=65126)||oo[`Unified Canadian Aboriginal Syllabics`](e)||oo[`Unified Canadian Aboriginal Syllabics Extended`](e)||oo[`Vertical Forms`](e)||oo[`Yijing Hexagram Symbols`](e)||oo[`Yi Syllables`](e)||oo[`Yi Radicals`](e))}function po(e){return!!(oo[`Latin-1 Supplement`](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||oo[`General Punctuation`](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||oo[`Letterlike Symbols`](e)||oo[`Number Forms`](e)||oo[`Miscellaneous Technical`](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||oo[`Control Pictures`](e)&&e!==9251||oo[`Optical Character Recognition`](e)||oo[`Enclosed Alphanumerics`](e)||oo[`Geometric Shapes`](e)||oo[`Miscellaneous Symbols`](e)&&!(e>=9754&&e<=9759)||oo[`Miscellaneous Symbols and Arrows`](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||oo[`CJK Symbols and Punctuation`](e)||oo.Katakana(e)||oo[`Private Use Area`](e)||oo[`CJK Compatibility Forms`](e)||oo[`Small Form Variants`](e)||oo[`Halfwidth and Fullwidth Forms`](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}function mo(e){return!(fo(e)||po(e))}function ho(e){return oo.Arabic(e)||oo[`Arabic Supplement`](e)||oo[`Arabic Extended-A`](e)||oo[`Arabic Presentation Forms-A`](e)||oo[`Arabic Presentation Forms-B`](e)}function go(e){return e>=1424&&e<=2303||oo[`Arabic Presentation Forms-A`](e)||oo[`Arabic Presentation Forms-B`](e)}function _o(e,t){return!(!t&&go(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||oo.Khmer(e))}function vo(e){for(var t=0,n=e;t<n.length;t+=1){var r=n[t];if(go(r.charCodeAt(0)))return!0}return!1}function yo(e,t){for(var n=0,r=e;n<r.length;n+=1){var i=r[n];if(!_o(i.charCodeAt(0),t))return!1}return!0}var bo={unavailable:`unavailable`,deferred:`deferred`,loading:`loading`,loaded:`loaded`,error:`error`},xo=null,So=bo.unavailable,Co=null,wo=function(e){e&&typeof e==`string`&&e.indexOf(`NetworkError`)>-1&&(So=bo.error),xo&&xo(e)};function To(){Eo.fire(new ct(`pluginStateChange`,{pluginStatus:So,pluginURL:Co}))}var Eo=new ut,Do=function(){return So},Oo=function(e){return e({pluginStatus:So,pluginURL:Co}),Eo.on(`pluginStateChange`,e),e},ko=function(e,t,n){if(n===void 0&&(n=!1),So===bo.deferred||So===bo.loading||So===bo.loaded)throw Error(`setRTLTextPlugin cannot be called multiple times.`);Co=J.resolveURL(e),So=bo.deferred,xo=t,To(),n||Ao()},Ao=function(){if(So!==bo.deferred||!Co)throw Error(`rtl-text-plugin cannot be downloaded unless a pluginURL is specified`);So=bo.loading,To(),Co&&Xe({url:Co},function(e){e?wo(e):(So=bo.loaded,To())})},jo={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return So===bo.loaded||jo.applyArabicShaping!=null},isLoading:function(){return So===bo.loading},setState:function(e){So=e.pluginStatus,Co=e.pluginURL},isParsed:function(){return jo.applyArabicShaping!=null&&jo.processBidirectionalText!=null&&jo.processStyledBidirectionalText!=null},getPluginURL:function(){return Co}},Mo=function(){!jo.isLoading()&&!jo.isLoaded()&&Do()===`deferred`&&Ao()},No=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ao,this.transition={})};No.prototype.isSupportedScript=function(e){return yo(e,jo.isLoaded())},No.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},No.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),n=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*t}};var Po=function(e,t){this.property=e,this.value=t,this.expression=ea(t===void 0?e.specification.default:t,e.specification)};Po.prototype.isDataDriven=function(){return this.expression.kind===`source`||this.expression.kind===`composite`},Po.prototype.possiblyEvaluate=function(e,t,n){return this.property.possiblyEvaluate(this,e,t,n)};var Fo=function(e){this.property=e,this.value=new Po(e,void 0)};Fo.prototype.transitioned=function(e,t){return new Lo(this.property,this.value,t,v({},e.transition,this.transition),e.now)},Fo.prototype.untransitioned=function(){return new Lo(this.property,this.value,null,{},0)};var Io=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};Io.prototype.getValue=function(e){return k(this._values[e].value.value)},Io.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Fo(this._values[e].property)),this._values[e].value=new Po(this._values[e].property,t===null?void 0:k(t))},Io.prototype.getTransition=function(e){return k(this._values[e].transition)},Io.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Fo(this._values[e].property)),this._values[e].transition=k(t)||void 0},Io.prototype.serialize=function(){for(var e={},t=0,n=Object.keys(this._values);t<n.length;t+=1){var r=n[t],i=this.getValue(r);i!==void 0&&(e[r]=i);var a=this.getTransition(r);a!==void 0&&(e[r+`-transition`]=a)}return e},Io.prototype.transitioned=function(e,t){for(var n=new Ro(this._properties),r=0,i=Object.keys(this._values);r<i.length;r+=1){var a=i[r];n._values[a]=this._values[a].transitioned(e,t._values[a])}return n},Io.prototype.untransitioned=function(){for(var e=new Ro(this._properties),t=0,n=Object.keys(this._values);t<n.length;t+=1){var r=n[t];e._values[r]=this._values[r].untransitioned()}return e};var Lo=function(e,t,n,r,i){this.property=e,this.value=t,this.begin=i+r.delay||0,this.end=this.begin+r.duration||0,e.specification.transition&&(r.delay||r.duration)&&(this.prior=n)};Lo.prototype.possiblyEvaluate=function(e,t,n){var r=e.now||0,i=this.value.possiblyEvaluate(e,t,n),a=this.prior;if(a){if(r>this.end||this.value.isDataDriven())return this.prior=null,i;if(r<this.begin)return a.possiblyEvaluate(e,t,n);var o=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,n),i,u(o))}else return i};var Ro=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};Ro.prototype.possiblyEvaluate=function(e,t,n){for(var r=new Vo(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];r._values[o]=this._values[o].possiblyEvaluate(e,t,n)}return r},Ro.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1){var n=t[e];if(this._values[n].prior)return!0}return!1};var zo=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};zo.prototype.getValue=function(e){return k(this._values[e].value)},zo.prototype.setValue=function(e,t){this._values[e]=new Po(this._values[e].property,t===null?void 0:k(t))},zo.prototype.serialize=function(){for(var e={},t=0,n=Object.keys(this._values);t<n.length;t+=1){var r=n[t],i=this.getValue(r);i!==void 0&&(e[r]=i)}return e},zo.prototype.possiblyEvaluate=function(e,t,n){for(var r=new Vo(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];r._values[o]=this._values[o].possiblyEvaluate(e,t,n)}return r};var Bo=function(e,t,n){this.property=e,this.value=t,this.parameters=n};Bo.prototype.isConstant=function(){return this.value.kind===`constant`},Bo.prototype.constantOr=function(e){return this.value.kind===`constant`?this.value.value:e},Bo.prototype.evaluate=function(e,t,n,r){return this.property.evaluate(this.value,this.parameters,e,t,n,r)};var Vo=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};Vo.prototype.get=function(e){return this._values[e]};var Ho=function(e){this.specification=e};Ho.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},Ho.prototype.interpolate=function(e,t,n){var r=wr[this.specification.type];return r?r(e,t,n):e};var Uo=function(e,t){this.specification=e,this.overrides=t};Uo.prototype.possiblyEvaluate=function(e,t,n,r){return e.expression.kind===`constant`||e.expression.kind===`camera`?new Bo(this,{kind:`constant`,value:e.expression.evaluate(t,null,{},n,r)},t):new Bo(this,e.expression,t)},Uo.prototype.interpolate=function(e,t,n){if(e.value.kind!==`constant`||t.value.kind!==`constant`)return e;if(e.value.value===void 0||t.value.value===void 0)return new Bo(this,{kind:`constant`,value:void 0},e.parameters);var r=wr[this.specification.type];return r?new Bo(this,{kind:`constant`,value:r(e.value.value,t.value.value,n)},e.parameters):e},Uo.prototype.evaluate=function(e,t,n,r,i,a){return e.kind===`constant`?e.value:e.evaluate(t,n,r,i,a)};var Wo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.possiblyEvaluate=function(e,t,n,r){if(e.value===void 0)return new Bo(this,{kind:`constant`,value:void 0},t);if(e.expression.kind===`constant`){var i=e.expression.evaluate(t,null,{},n,r),a=e.property.specification.type===`resolvedImage`&&typeof i!=`string`?i.name:i,o=this._calculate(a,a,a,t);return new Bo(this,{kind:`constant`,value:o},t)}else if(e.expression.kind===`camera`){var s=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new Bo(this,{kind:`constant`,value:s},t)}else return new Bo(this,e.expression,t)},t.prototype.evaluate=function(e,t,n,r,i,a){if(e.kind===`source`){var o=e.evaluate(t,n,r,i,a);return this._calculate(o,o,o,t)}else return e.kind===`composite`?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},n,r),e.evaluate({zoom:Math.floor(t.zoom)},n,r),e.evaluate({zoom:Math.floor(t.zoom)+1},n,r),t):e.value},t.prototype._calculate=function(e,t,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}},t.prototype.interpolate=function(e){return e},t}(Uo),Go=function(e){this.specification=e};Go.prototype.possiblyEvaluate=function(e,t,n,r){if(e.value!==void 0)if(e.expression.kind===`constant`){var i=e.expression.evaluate(t,null,{},n,r);return this._calculate(i,i,i,t)}else return this._calculate(e.expression.evaluate(new No(Math.floor(t.zoom-1),t)),e.expression.evaluate(new No(Math.floor(t.zoom),t)),e.expression.evaluate(new No(Math.floor(t.zoom+1),t)),t)},Go.prototype._calculate=function(e,t,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}},Go.prototype.interpolate=function(e){return e};var Ko=function(e){this.specification=e};Ko.prototype.possiblyEvaluate=function(e,t,n,r){return!!e.expression.evaluate(t,null,{},n,r)},Ko.prototype.interpolate=function(){return!1};var qo=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var n=e[t];n.specification.overridable&&this.overridableProperties.push(t);var r=this.defaultPropertyValues[t]=new Po(n,void 0),i=this.defaultTransitionablePropertyValues[t]=new Fo(n);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=r.possiblyEvaluate({})}};$a(`DataDrivenProperty`,Uo),$a(`DataConstantProperty`,Ho),$a(`CrossFadedDataDrivenProperty`,Wo),$a(`CrossFadedProperty`,Go),$a(`ColorRampProperty`,Ko);var Jo=`-transition`,Yo=function(e){function t(t,n){if(e.call(this),this.id=t.id,this.type=t.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},t.type!==`custom`&&(t=t,this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!==`background`&&(this.source=t.source,this.sourceLayer=t[`source-layer`],this.filter=t.filter),n.layout&&(this._unevaluatedLayout=new zo(n.layout)),n.paint)){for(var r in this._transitionablePaint=new Io(n.paint),t.paint)this.setPaintProperty(r,t.paint[r],{validate:!1});for(var i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Vo(n.paint)}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(e){return e===`visibility`?this.visibility:this._unevaluatedLayout.getValue(e)},t.prototype.setLayoutProperty=function(e,t,n){if(n===void 0&&(n={}),t!=null){var r=`layers.`+this.id+`.layout.`+e;if(this._validate(Ga,r,e,t,n))return}if(e===`visibility`){this.visibility=t;return}this._unevaluatedLayout.setValue(e,t)},t.prototype.getPaintProperty=function(e){return E(e,Jo)?this._transitionablePaint.getTransition(e.slice(0,-Jo.length)):this._transitionablePaint.getValue(e)},t.prototype.setPaintProperty=function(e,t,n){if(n===void 0&&(n={}),t!=null){var r=`layers.`+this.id+`.paint.`+e;if(this._validate(Wa,r,e,t,n))return!1}if(E(e,Jo))return this._transitionablePaint.setTransition(e.slice(0,-Jo.length),t||void 0),!1;var i=this._transitionablePaint._values[e],a=i.property.specification[`property-type`]===`cross-faded-data-driven`,o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var c=this._transitionablePaint._values[e].value;return c.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(e,s,c)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){},t.prototype._handleOverridablePaintPropertyUpdate=function(e,t,n){return!1},t.prototype.isHidden=function(e){return this.minzoom&&e<this.minzoom||this.maxzoom&&e>=this.maxzoom?!0:this.visibility===`none`},t.prototype.updateTransitions=function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)},t.prototype.serialize=function(){var e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),O(e,function(e,t){return e!==void 0&&!(t===`layout`&&!Object.keys(e).length)&&!(t===`paint`&&!Object.keys(e).length)})},t.prototype._validate=function(e,t,n,r,i){return i===void 0&&(i={}),i&&i.validate===!1?!1:Ka(this,e.call(Ha,{key:t,layerType:this.type,objectKey:n,value:r,styleSpec:qt,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var e in this.paint._values){var t=this.paint.get(e);if(!(!(t instanceof Bo)||!Pi(t.property.specification))&&(t.value.kind===`source`||t.value.kind===`composite`)&&t.value.isStateDependent)return!0}return!1},t}(ut),Xo={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Zo=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Qo=128,$o=5,es=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};es.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},es.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},es.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},es.prototype.clear=function(){this.length=0},es.prototype.resize=function(e){this.reserve(e),this.length=e},es.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*$o),Qo),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},es.prototype._refreshViews=function(){throw Error(`_refreshViews() must be implemented by each concrete StructArray layout`)};function ts(e,t){t===void 0&&(t=1);var n=0,r=0;return{members:e.map(function(e){var i=ns(e.type),a=n=rs(n,Math.max(t,i)),o=e.components||1;return r=Math.max(r,i),n+=i*o,{name:e.name,type:e.type,components:o,offset:a}}),size:rs(n,Math.max(r,t)),alignment:t}}function ns(e){return Xo[e].BYTES_PER_ELEMENT}function rs(e,t){return Math.ceil(e/t)*t}var is=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)},t.prototype.emplace=function(e,t,n){var r=e*2;return this.int16[r+0]=t,this.int16[r+1]=n,e},t}(es);is.prototype.bytesPerElement=4,$a(`StructArrayLayout2i4`,is);var as=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)},t.prototype.emplace=function(e,t,n,r,i){var a=e*4;return this.int16[a+0]=t,this.int16[a+1]=n,this.int16[a+2]=r,this.int16[a+3]=i,e},t}(es);as.prototype.bytesPerElement=8,$a(`StructArrayLayout4i8`,as);var os=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)},t.prototype.emplace=function(e,t,n,r,i,a,o){var s=e*6;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(es);os.prototype.bytesPerElement=12,$a(`StructArrayLayout2i4i12`,os);var ss=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)},t.prototype.emplace=function(e,t,n,r,i,a,o){var s=e*4,c=e*8;return this.int16[s+0]=t,this.int16[s+1]=n,this.uint8[c+4]=r,this.uint8[c+5]=i,this.uint8[c+6]=a,this.uint8[c+7]=o,e},t}(es);ss.prototype.bytesPerElement=8,$a(`StructArrayLayout2i4ub8`,ss);var cs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)},t.prototype.emplace=function(e,t,n){var r=e*2;return this.float32[r+0]=t,this.float32[r+1]=n,e},t}(es);cs.prototype.bytesPerElement=8,$a(`StructArrayLayout2f8`,cs);var ls=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,a,o,s,c,l){var u=this.length;return this.resize(u+1),this.emplace(u,e,t,n,r,i,a,o,s,c,l)},t.prototype.emplace=function(e,t,n,r,i,a,o,s,c,l,u){var d=e*10;return this.uint16[d+0]=t,this.uint16[d+1]=n,this.uint16[d+2]=r,this.uint16[d+3]=i,this.uint16[d+4]=a,this.uint16[d+5]=o,this.uint16[d+6]=s,this.uint16[d+7]=c,this.uint16[d+8]=l,this.uint16[d+9]=u,e},t}(es);ls.prototype.bytesPerElement=20,$a(`StructArrayLayout10ui20`,ls);var us=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,a,o,s,c,l,u,d){var f=this.length;return this.resize(f+1),this.emplace(f,e,t,n,r,i,a,o,s,c,l,u,d)},t.prototype.emplace=function(e,t,n,r,i,a,o,s,c,l,u,d,f){var p=e*12;return this.int16[p+0]=t,this.int16[p+1]=n,this.int16[p+2]=r,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=c,this.int16[p+8]=l,this.int16[p+9]=u,this.int16[p+10]=d,this.int16[p+11]=f,e},t}(es);us.prototype.bytesPerElement=24,$a(`StructArrayLayout4i4ui4i24`,us);var ds=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)},t.prototype.emplace=function(e,t,n,r){var i=e*3;return this.float32[i+0]=t,this.float32[i+1]=n,this.float32[i+2]=r,e},t}(es);ds.prototype.bytesPerElement=12,$a(`StructArrayLayout3f12`,ds);var fs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var n=e*1;return this.uint32[n+0]=t,e},t}(es);fs.prototype.bytesPerElement=4,$a(`StructArrayLayout1ul4`,fs);var ps=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.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)},t.prototype.emplaceBack=function(e,t,n,r,i,a,o,s,c){var l=this.length;return this.resize(l+1),this.emplace(l,e,t,n,r,i,a,o,s,c)},t.prototype.emplace=function(e,t,n,r,i,a,o,s,c,l){var u=e*10,d=e*5;return this.int16[u+0]=t,this.int16[u+1]=n,this.int16[u+2]=r,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[d+3]=s,this.uint16[u+8]=c,this.uint16[u+9]=l,e},t}(es);ps.prototype.bytesPerElement=20,$a(`StructArrayLayout6i1ul2ui20`,ps);var ms=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)},t.prototype.emplace=function(e,t,n,r,i,a,o){var s=e*6;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(es);ms.prototype.bytesPerElement=12,$a(`StructArrayLayout2i2i2i12`,ms);var hs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i)},t.prototype.emplace=function(e,t,n,r,i,a){var o=e*4,s=e*8;return this.float32[o+0]=t,this.float32[o+1]=n,this.float32[o+2]=r,this.int16[s+6]=i,this.int16[s+7]=a,e},t}(es);hs.prototype.bytesPerElement=16,$a(`StructArrayLayout2f1f2i16`,hs);var gs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)},t.prototype.emplace=function(e,t,n,r,i){var a=e*12,o=e*3;return this.uint8[a+0]=t,this.uint8[a+1]=n,this.float32[o+1]=r,this.float32[o+2]=i,e},t}(es);gs.prototype.bytesPerElement=12,$a(`StructArrayLayout2ub2f12`,gs);var _s=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)},t.prototype.emplace=function(e,t,n,r){var i=e*3;return this.uint16[i+0]=t,this.uint16[i+1]=n,this.uint16[i+2]=r,e},t}(es);_s.prototype.bytesPerElement=6,$a(`StructArrayLayout3ui6`,_s);var vs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.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)},t.prototype.emplaceBack=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){var _=this.length;return this.resize(_+1),this.emplace(_,e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)},t.prototype.emplace=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){var v=e*24,y=e*12,b=e*48;return this.int16[v+0]=t,this.int16[v+1]=n,this.uint16[v+2]=r,this.uint16[v+3]=i,this.uint32[y+2]=a,this.uint32[y+3]=o,this.uint32[y+4]=s,this.uint16[v+10]=c,this.uint16[v+11]=l,this.uint16[v+12]=u,this.float32[y+7]=d,this.float32[y+8]=f,this.uint8[b+36]=p,this.uint8[b+37]=m,this.uint8[b+38]=h,this.uint32[y+10]=g,this.int16[v+22]=_,e},t}(es);vs.prototype.bytesPerElement=48,$a(`StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48`,vs);var ys=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.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)},t.prototype.emplaceBack=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D){var O=this.length;return this.resize(O+1),this.emplace(O,e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D)},t.prototype.emplace=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O){var k=e*34,A=e*17;return this.int16[k+0]=t,this.int16[k+1]=n,this.int16[k+2]=r,this.int16[k+3]=i,this.int16[k+4]=a,this.int16[k+5]=o,this.int16[k+6]=s,this.int16[k+7]=c,this.uint16[k+8]=l,this.uint16[k+9]=u,this.uint16[k+10]=d,this.uint16[k+11]=f,this.uint16[k+12]=p,this.uint16[k+13]=m,this.uint16[k+14]=h,this.uint16[k+15]=g,this.uint16[k+16]=_,this.uint16[k+17]=v,this.uint16[k+18]=y,this.uint16[k+19]=b,this.uint16[k+20]=x,this.uint16[k+21]=S,this.uint16[k+22]=C,this.uint32[A+12]=w,this.float32[A+13]=T,this.float32[A+14]=E,this.float32[A+15]=D,this.float32[A+16]=O,e},t}(es);ys.prototype.bytesPerElement=68,$a(`StructArrayLayout8i15ui1ul4f68`,ys);var bs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var n=e*1;return this.float32[n+0]=t,e},t}(es);bs.prototype.bytesPerElement=4,$a(`StructArrayLayout1f4`,bs);var xs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)},t.prototype.emplace=function(e,t,n,r){var i=e*3;return this.int16[i+0]=t,this.int16[i+1]=n,this.int16[i+2]=r,e},t}(es);xs.prototype.bytesPerElement=6,$a(`StructArrayLayout3i6`,xs);var Ss=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)},t.prototype.emplace=function(e,t,n,r){var i=e*2,a=e*4;return this.uint32[i+0]=t,this.uint16[a+2]=n,this.uint16[a+3]=r,e},t}(es);Ss.prototype.bytesPerElement=8,$a(`StructArrayLayout1ul2ui8`,Ss);var Cs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)},t.prototype.emplace=function(e,t,n){var r=e*2;return this.uint16[r+0]=t,this.uint16[r+1]=n,e},t}(es);Cs.prototype.bytesPerElement=4,$a(`StructArrayLayout2ui4`,Cs);var ws=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var n=e*1;return this.uint16[n+0]=t,e},t}(es);ws.prototype.bytesPerElement=2,$a(`StructArrayLayout1ui2`,ws);var Ts=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)},t.prototype.emplace=function(e,t,n,r,i){var a=e*4;return this.float32[a+0]=t,this.float32[a+1]=n,this.float32[a+2]=r,this.float32[a+3]=i,e},t}(es);Ts.prototype.bytesPerElement=16,$a(`StructArrayLayout4f16`,Ts);var Es=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={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 n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,n),t}(Zo);Es.prototype.size=20;var Ds=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Es(this,e)},t}(ps);$a(`CollisionBoxArray`,Ds);var Os=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={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 n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},n.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},n.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},n.segment.get=function(){return this._structArray.uint16[this._pos2+10]},n.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},n.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},n.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},n.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},n.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},n.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},n.placedOrientation.set=function(e){this._structArray.uint8[this._pos1+37]=e},n.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},n.hidden.set=function(e){this._structArray.uint8[this._pos1+38]=e},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},n.crossTileID.set=function(e){this._structArray.uint32[this._pos4+10]=e},n.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,n),t}(Zo);Os.prototype.size=48;var ks=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Os(this,e)},t}(vs);$a(`PlacedSymbolArray`,ks);var As=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={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 n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},n.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},n.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},n.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},n.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},n.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},n.key.get=function(){return this._structArray.uint16[this._pos2+8]},n.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},n.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},n.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},n.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},n.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},n.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},n.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},n.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},n.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},n.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},n.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},n.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},n.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},n.crossTileID.set=function(e){this._structArray.uint32[this._pos4+12]=e},n.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},n.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},n.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},n.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,n),t}(Zo);As.prototype.size=68;var js=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new As(this,e)},t}(ys);$a(`SymbolInstanceArray`,js);var Ms=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getoffsetX=function(e){return this.float32[e*1+0]},t}(bs);$a(`GlyphOffsetArray`,Ms);var Ns=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getx=function(e){return this.int16[e*3+0]},t.prototype.gety=function(e){return this.int16[e*3+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[e*3+2]},t}(xs);$a(`SymbolLineVertexArray`,Ns);var Ps=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,n),t}(Zo);Ps.prototype.size=8;var Fs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Ps(this,e)},t}(Ss);$a(`FeatureIndexArray`,Fs);var Is=ts([{name:`a_pos`,components:2,type:`Int16`}],4).members,Ls=function(e){e===void 0&&(e=[]),this.segments=e};Ls.prototype.prepareSegment=function(e,t,n,r){var i=this.segments[this.segments.length-1];return e>Ls.MAX_VERTEX_ARRAY_LENGTH&&M(`Max vertices per segment is `+Ls.MAX_VERTEX_ARRAY_LENGTH+`: bucket requested `+e),(!i||i.vertexLength+e>Ls.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==r)&&(i={vertexOffset:t.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},r!==void 0&&(i.sortKey=r),this.segments.push(i)),i},Ls.prototype.get=function(){return this.segments},Ls.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var n=t[e];for(var r in n.vaos)n.vaos[r].destroy()}},Ls.simpleSegment=function(e,t,n,r){return new Ls([{vertexOffset:e,primitiveOffset:t,vertexLength:n,primitiveLength:r,vaos:{},sortKey:0}])},Ls.MAX_VERTEX_ARRAY_LENGTH=2**16-1,$a(`SegmentVector`,Ls);function Rs(e,t){return e=p(Math.floor(e),0,255),t=p(Math.floor(t),0,255),256*e+t}var zs=ts([{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`}]),Bs=t(function(e){function t(e,t){var n,r,i,a,o,s,c,l;for(n=e.length&3,r=e.length-n,i=t,o=3432918353,s=461845907,l=0;l<r;)c=e.charCodeAt(l)&255|(e.charCodeAt(++l)&255)<<8|(e.charCodeAt(++l)&255)<<16|(e.charCodeAt(++l)&255)<<24,++l,c=(c&65535)*o+(((c>>>16)*o&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*s+(((c>>>16)*s&65535)<<16)&4294967295,i^=c,i=i<<13|i>>>19,a=(i&65535)*5+(((i>>>16)*5&65535)<<16)&4294967295,i=(a&65535)+27492+(((a>>>16)+58964&65535)<<16);switch(c=0,n){case 3:c^=(e.charCodeAt(l+2)&255)<<16;case 2:c^=(e.charCodeAt(l+1)&255)<<8;case 1:c^=e.charCodeAt(l)&255,c=(c&65535)*o+(((c>>>16)*o&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*s+(((c>>>16)*s&65535)<<16)&4294967295,i^=c}return i^=e.length,i^=i>>>16,i=(i&65535)*2246822507+(((i>>>16)*2246822507&65535)<<16)&4294967295,i^=i>>>13,i=(i&65535)*3266489909+(((i>>>16)*3266489909&65535)<<16)&4294967295,i^=i>>>16,i>>>0}e.exports=t}),Vs=t(function(e){function t(e,t){for(var n=e.length,r=t^n,i=0,a;n>=4;)a=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),a^=a>>>24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)^a,n-=4,++i;switch(n){case 3:r^=(e.charCodeAt(i+2)&255)<<16;case 2:r^=(e.charCodeAt(i+1)&255)<<8;case 1:r^=e.charCodeAt(i)&255,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)}return r^=r>>>13,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16),r^=r>>>15,r>>>0}e.exports=t}),Hs=Bs,Us=Bs,Ws=Vs;Hs.murmur3=Us,Hs.murmur2=Ws;var Gs=function(){this.ids=[],this.positions=[],this.indexed=!1};Gs.prototype.add=function(e,t,n,r){this.ids.push(qs(e)),this.positions.push(t,n,r)},Gs.prototype.getPositions=function(e){for(var t=qs(e),n=0,r=this.ids.length-1;n<r;){var i=n+r>>1;this.ids[i]>=t?r=i:n=i+1}for(var a=[];this.ids[n]===t;){var o=this.positions[3*n],s=this.positions[3*n+1],c=this.positions[3*n+2];a.push({index:o,start:s,end:c}),n++}return a},Gs.serialize=function(e,t){var n=new Float64Array(e.ids),r=new Uint32Array(e.positions);return Js(n,r,0,n.length-1),t&&t.push(n.buffer,r.buffer),{ids:n,positions:r}},Gs.deserialize=function(e){var t=new Gs;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var Ks=2**53-1;function qs(e){var t=+e;return!isNaN(t)&&t<=Ks?t:Hs(String(e))}function Js(e,t,n,r){for(;n<r;){for(var i=e[n+r>>1],a=n-1,o=r+1;;){do a++;while(e[a]<i);do o--;while(e[o]>i);if(a>=o)break;Ys(e,a,o),Ys(t,3*a,3*o),Ys(t,3*a+1,3*o+1),Ys(t,3*a+2,3*o+2)}o-n<r-o?(Js(e,t,n,o),n=o+1):(Js(e,t,o+1,r),r=o)}}function Ys(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}$a(`FeaturePositionMap`,Gs);var Xs=function(e,t){this.gl=e.gl,this.location=t},Zs=function(e){function t(t,n){e.call(this,t,n),this.current=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))},t}(Xs),Qs=function(e){function t(t,n){e.call(this,t,n),this.current=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))},t}(Xs),$s=function(e){function t(t,n){e.call(this,t,n),this.current=[0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){(e[0]!==this.current[0]||e[1]!==this.current[1])&&(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))},t}(Xs),ec=function(e){function t(t,n){e.call(this,t,n),this.current=[0,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2])&&(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))},t}(Xs),tc=function(e){function t(t,n){e.call(this,t,n),this.current=[0,0,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))},t}(Xs),nc=function(e){function t(t,n){e.call(this,t,n),this.current=bn.transparent}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))},t}(Xs),rc=new Float32Array(16),ic=function(e){function t(t,n){e.call(this,t,n),this.current=rc}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){if(e[12]!==this.current[12]||e[0]!==this.current[0]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);return}for(var t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}},t}(Xs);function ac(e){return[Rs(255*e.r,255*e.g),Rs(255*e.b,255*e.a)]}var oc=function(e,t,n){this.value=e,this.uniformNames=t.map(function(e){return`u_`+e}),this.type=n};oc.prototype.setUniform=function(e,t,n){e.set(n.constantOr(this.value))},oc.prototype.getBinding=function(e,t,n){return this.type===`color`?new nc(e,t):new Qs(e,t)};var sc=function(e,t){this.uniformNames=t.map(function(e){return`u_`+e}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};sc.prototype.setConstantPatternPositions=function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr},sc.prototype.setUniform=function(e,t,n,r){var i=r===`u_pattern_to`?this.patternTo:r===`u_pattern_from`?this.patternFrom:r===`u_pixel_ratio_to`?this.pixelRatioTo:r===`u_pixel_ratio_from`?this.pixelRatioFrom:null;i&&e.set(i)},sc.prototype.getBinding=function(e,t,n){return n.substr(0,9)===`u_pattern`?new tc(e,t):new Qs(e,t)};var cc=function(e,t,n,r){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=t.map(function(e){return{name:`a_`+e,type:`Float32`,components:n===`color`?2:1,offset:0}}),this.paintVertexArray=new r};cc.prototype.populatePaintArray=function(e,t,n,r,i){var a=this.paintVertexArray.length,o=this.expression.evaluate(new No(0),t,{},r,[],i);this.paintVertexArray.resize(e),this._setPaintValue(a,e,o)},cc.prototype.updatePaintArray=function(e,t,n,r){var i=this.expression.evaluate({zoom:0},n,r);this._setPaintValue(e,t,i)},cc.prototype._setPaintValue=function(e,t,n){if(this.type===`color`)for(var r=ac(n),i=e;i<t;i++)this.paintVertexArray.emplace(i,r[0],r[1]);else{for(var a=e;a<t;a++)this.paintVertexArray.emplace(a,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}},cc.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},cc.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var lc=function(e,t,n,r,i,a){this.expression=e,this.uniformNames=t.map(function(e){return`u_`+e+`_t`}),this.type=n,this.useIntegerZoom=r,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map(function(e){return{name:`a_`+e,type:`Float32`,components:n===`color`?4:2,offset:0}}),this.paintVertexArray=new a};lc.prototype.populatePaintArray=function(e,t,n,r,i){var a=this.expression.evaluate(new No(this.zoom),t,{},r,[],i),o=this.expression.evaluate(new No(this.zoom+1),t,{},r,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(s,e,a,o)},lc.prototype.updatePaintArray=function(e,t,n,r){var i=this.expression.evaluate({zoom:this.zoom},n,r),a=this.expression.evaluate({zoom:this.zoom+1},n,r);this._setPaintValue(e,t,i,a)},lc.prototype._setPaintValue=function(e,t,n,r){if(this.type===`color`)for(var i=ac(n),a=ac(r),o=e;o<t;o++)this.paintVertexArray.emplace(o,i[0],i[1],a[0],a[1]);else{for(var s=e;s<t;s++)this.paintVertexArray.emplace(s,n,r);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(r))}},lc.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},lc.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},lc.prototype.setUniform=function(e,t){var n=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,r=p(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);e.set(r)},lc.prototype.getBinding=function(e,t,n){return new Qs(e,t)};var uc=function(e,t,n,r,i,a){this.expression=e,this.type=t,this.useIntegerZoom=n,this.zoom=r,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i};uc.prototype.populatePaintArray=function(e,t,n){var r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(r,e,t.patterns&&t.patterns[this.layerId],n)},uc.prototype.updatePaintArray=function(e,t,n,r,i){this._setPaintValues(e,t,n.patterns&&n.patterns[this.layerId],i)},uc.prototype._setPaintValues=function(e,t,n,r){if(!(!r||!n)){var i=n.min,a=n.mid,o=n.max,s=r[i],c=r[a],l=r[o];if(!(!s||!c||!l))for(var u=e;u<t;u++)this.zoomInPaintVertexArray.emplace(u,c.tl[0],c.tl[1],c.br[0],c.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],c.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(u,c.tl[0],c.tl[1],c.br[0],c.br[1],l.tl[0],l.tl[1],l.br[0],l.br[1],c.pixelRatio,l.pixelRatio)}},uc.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,zs.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,zs.members,this.expression.isStateDependent))},uc.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var dc=function(e,t,n){this.binders={},this._buffers=[];var r=[];for(var i in e.paint._values)if(n(i)){var a=e.paint.get(i);if(!(!(a instanceof Bo)||!Pi(a.property.specification))){var o=pc(i,e.type),s=a.value,c=a.property.specification.type,l=a.property.useIntegerZoom,u=a.property.specification[`property-type`],d=u===`cross-faded`||u===`cross-faded-data-driven`;if(s.kind===`constant`)this.binders[i]=d?new sc(s.value,o):new oc(s.value,o,c),r.push(`/u_`+i);else if(s.kind===`source`||d){var f=hc(i,c,`source`);this.binders[i]=d?new uc(s,c,l,t,f,e.id):new cc(s,o,c,f),r.push(`/a_`+i)}else{var p=hc(i,c,`composite`);this.binders[i]=new lc(s,o,c,l,t,p),r.push(`/z_`+i)}}}this.cacheKey=r.sort().join(``)};dc.prototype.getMaxValue=function(e){var t=this.binders[e];return t instanceof cc||t instanceof lc?t.maxValue:0},dc.prototype.populatePaintArrays=function(e,t,n,r,i){for(var a in this.binders){var o=this.binders[a];(o instanceof cc||o instanceof lc||o instanceof uc)&&o.populatePaintArray(e,t,n,r,i)}},dc.prototype.setConstantPatternPositions=function(e,t){for(var n in this.binders){var r=this.binders[n];r instanceof sc&&r.setConstantPatternPositions(e,t)}},dc.prototype.updatePaintArrays=function(e,t,n,r,i){var a=!1;for(var o in e)for(var s=t.getPositions(o),c=0,l=s;c<l.length;c+=1){var u=l[c],d=n.feature(u.index);for(var f in this.binders){var p=this.binders[f];(p instanceof cc||p instanceof lc||p instanceof uc)&&p.expression.isStateDependent===!0&&(p.expression=r.paint.get(f).value,p.updatePaintArray(u.start,u.end,d,e[o],i),a=!0)}}return a},dc.prototype.defines=function(){var e=[];for(var t in this.binders){var n=this.binders[t];(n instanceof oc||n instanceof sc)&&e.push.apply(e,n.uniformNames.map(function(e){return`#define HAS_UNIFORM_`+e}))}return e},dc.prototype.getBinderAttributes=function(){var e=[];for(var t in this.binders){var n=this.binders[t];if(n instanceof cc||n instanceof lc)for(var r=0;r<n.paintVertexAttributes.length;r++)e.push(n.paintVertexAttributes[r].name);else if(n instanceof uc)for(var i=0;i<zs.members.length;i++)e.push(zs.members[i].name)}return e},dc.prototype.getBinderUniforms=function(){var e=[];for(var t in this.binders){var n=this.binders[t];if(n instanceof oc||n instanceof sc||n instanceof lc)for(var r=0,i=n.uniformNames;r<i.length;r+=1){var a=i[r];e.push(a)}}return e},dc.prototype.getPaintVertexBuffers=function(){return this._buffers},dc.prototype.getUniforms=function(e,t){var n=[];for(var r in this.binders){var i=this.binders[r];if(i instanceof oc||i instanceof sc||i instanceof lc)for(var a=0,o=i.uniformNames;a<o.length;a+=1){var s=o[a];if(t[s]){var c=i.getBinding(e,t[s],s);n.push({name:s,property:r,binding:c})}}}return n},dc.prototype.setUniforms=function(e,t,n,r){for(var i=0,a=t;i<a.length;i+=1){var o=a[i],s=o.name,c=o.property,l=o.binding;this.binders[c].setUniform(l,r,n.get(c),s)}},dc.prototype.updatePaintBuffers=function(e){for(var t in this._buffers=[],this.binders){var n=this.binders[t];if(e&&n instanceof uc){var r=e.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;r&&this._buffers.push(r)}else (n instanceof cc||n instanceof lc)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}},dc.prototype.upload=function(e){for(var t in this.binders){var n=this.binders[t];(n instanceof cc||n instanceof lc||n instanceof uc)&&n.upload(e)}this.updatePaintBuffers()},dc.prototype.destroy=function(){for(var e in this.binders){var t=this.binders[e];(t instanceof cc||t instanceof lc||t instanceof uc)&&t.destroy()}};var fc=function(e,t,n){n===void 0&&(n=function(){return!0}),this.programConfigurations={};for(var r=0,i=e;r<i.length;r+=1){var a=i[r];this.programConfigurations[a.id]=new dc(a,t,n)}this.needsUpload=!1,this._featureMap=new Gs,this._bufferOffset=0};fc.prototype.populatePaintArrays=function(e,t,n,r,i,a){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(e,t,r,i,a);t.id!==void 0&&this._featureMap.add(t.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0},fc.prototype.updatePaintArrays=function(e,t,n,r){for(var i=0,a=n;i<a.length;i+=1){var o=a[i];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,t,o,r)||this.needsUpload}},fc.prototype.get=function(e){return this.programConfigurations[e]},fc.prototype.upload=function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}},fc.prototype.destroy=function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()};function pc(e,t){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`]}[e]||[e.replace(t+`-`,``).replace(/-/g,`_`)]}function mc(e){return{"line-pattern":{source:ls,composite:ls},"fill-pattern":{source:ls,composite:ls},"fill-extrusion-pattern":{source:ls,composite:ls}}[e]}function hc(e,t,n){var r={color:{source:cs,composite:Ts},number:{source:bs,composite:cs}},i=mc(e);return i&&i[n]||r[t][n]}$a(`ConstantBinder`,oc),$a(`CrossFadedConstantBinder`,sc),$a(`SourceExpressionBinder`,cc),$a(`CrossFadedCompositeBinder`,uc),$a(`CompositeExpressionBinder`,lc),$a(`ProgramConfiguration`,dc,{omit:[`_buffers`]}),$a(`ProgramConfigurationSet`,fc);var gc=8192,_c=2**14-1,vc=-_c-1;function yc(e){for(var t=gc/e.extent,n=e.loadGeometry(),r=0;r<n.length;r++)for(var i=n[r],a=0;a<i.length;a++){var o=i[a],s=Math.round(o.x*t),c=Math.round(o.y*t);o.x=p(s,vc,_c),o.y=p(c,vc,_c),(s<o.x||s>o.x+1||c<o.y||c>o.y+1)&&M(`Geometry exceeds allowed extent, reduce your vector tile buffer size`)}return n}function bc(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?yc(e):[]}}function xc(e,t,n,r,i){e.emplaceBack(t*2+(r+1)/2,n*2+(i+1)/2)}var Sc=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(e){return e.id}),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new is,this.indexArray=new _s,this.segments=new Ls,this.programConfigurations=new fc(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(function(e){return e.isStateDependent()}).map(function(e){return e.id})};Sc.prototype.populate=function(e,t,n){var r=this.layers[0],i=[],a=null;r.type===`circle`&&(a=r.layout.get(`circle-sort-key`));for(var o=0,s=e;o<s.length;o+=1){var c=s[o],l=c.feature,u=c.id,d=c.index,f=c.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,m=bc(l,p);if(this.layers[0]._featureFilter.filter(new No(this.zoom),m,n)){var h=a?a.evaluate(m,{},n):void 0,g={id:u,properties:l.properties,type:l.type,sourceLayerIndex:f,index:d,geometry:p?m.geometry:yc(l),patterns:{},sortKey:h};i.push(g)}}a&&i.sort(function(e,t){return e.sortKey-t.sortKey});for(var _=0,v=i;_<v.length;_+=1){var y=v[_],b=y,x=b.geometry,S=b.index,C=b.sourceLayerIndex,w=e[S].feature;this.addFeature(y,x,S,n),t.featureIndex.insert(w,x,S,C,this.index)}},Sc.prototype.update=function(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)},Sc.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Sc.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Sc.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Is),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Sc.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Sc.prototype.addFeature=function(e,t,n,r){for(var i=0,a=t;i<a.length;i+=1)for(var o=a[i],s=0,c=o;s<c.length;s+=1){var l=c[s],u=l.x,d=l.y;if(!(u<0||u>=gc||d<0||d>=gc)){var f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),p=f.vertexLength;xc(this.layoutVertexArray,u,d,-1,-1),xc(this.layoutVertexArray,u,d,1,-1),xc(this.layoutVertexArray,u,d,1,1),xc(this.layoutVertexArray,u,d,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),f.vertexLength+=4,f.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},r)},$a(`CircleBucket`,Sc,{omit:[`layers`]});function Cc(e,t){for(var n=0;n<e.length;n++)if(Nc(t,e[n]))return!0;for(var r=0;r<t.length;r++)if(Nc(e,t[r]))return!0;return!!Oc(e,t)}function wc(e,t,n){return!!(Nc(e,t)||Ac(t,e,n))}function Tc(e,t){if(e.length===1)return Mc(t,e[0]);for(var n=0;n<t.length;n++)for(var r=t[n],i=0;i<r.length;i++)if(Nc(e,r[i]))return!0;for(var a=0;a<e.length;a++)if(Mc(t,e[a]))return!0;for(var o=0;o<t.length;o++)if(Oc(e,t[o]))return!0;return!1}function Ec(e,t,n){for(var r=0;r<t.length;r++){var i=t[r];if(e.length>=3){for(var a=0;a<i.length;a++)if(Nc(e,i[a]))return!0}if(Dc(e,i,n))return!0}return!1}function Dc(e,t,n){if(e.length>1){if(Oc(e,t))return!0;for(var r=0;r<t.length;r++)if(Ac(t[r],e,n))return!0}for(var i=0;i<e.length;i++)if(Ac(e[i],t,n))return!0;return!1}function Oc(e,t){if(e.length===0||t.length===0)return!1;for(var n=0;n<e.length-1;n++)for(var r=e[n],i=e[n+1],a=0;a<t.length-1;a++){var o=t[a],s=t[a+1];if(kc(r,i,o,s))return!0}return!1}function kc(e,t,n,r){return N(e,n,r)!==N(t,n,r)&&N(e,t,n)!==N(e,t,r)}function Ac(e,t,n){var r=n*n;if(t.length===1)return e.distSqr(t[0])<r;for(var i=1;i<t.length;i++){var a=t[i-1],o=t[i];if(jc(e,a,o)<r)return!0}return!1}function jc(e,t,n){var r=t.distSqr(n);if(r===0)return e.distSqr(t);var i=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/r;return i<0?e.distSqr(t):i>1?e.distSqr(n):e.distSqr(n.sub(t)._mult(i)._add(t))}function Mc(e,t){for(var n=!1,r,i,a,o=0;o<e.length;o++){r=e[o];for(var s=0,c=r.length-1;s<r.length;c=s++)i=r[s],a=r[c],i.y>t.y!=a.y>t.y&&t.x<(a.x-i.x)*(t.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function Nc(e,t){for(var n=!1,r=0,i=e.length-1;r<e.length;i=r++){var a=e[r],o=e[i];a.y>t.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(n=!n)}return n}function Pc(e,t,n,r,i){for(var o=0,s=e;o<s.length;o+=1){var c=s[o];if(t<=c.x&&n<=c.y&&r>=c.x&&i>=c.y)return!0}var l=[new a(t,n),new a(t,i),new a(r,i),new a(r,n)];if(e.length>2)for(var u=0,d=l;u<d.length;u+=1){var f=d[u];if(Nc(e,f))return!0}for(var p=0;p<e.length-1;p++){var m=e[p],h=e[p+1];if(Fc(m,h,l))return!0}return!1}function Fc(e,t,n){var r=n[0],i=n[2];if(e.x<r.x&&t.x<r.x||e.x>i.x&&t.x>i.x||e.y<r.y&&t.y<r.y||e.y>i.y&&t.y>i.y)return!1;var a=N(e,t,n[0]);return a!==N(e,t,n[1])||a!==N(e,t,n[2])||a!==N(e,t,n[3])}function Ic(e,t,n){var r=t.paint.get(e).value;return r.kind===`constant`?r.value:n.programConfigurations.get(t.id).getMaxValue(e)}function Lc(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Rc(e,t,n,r,i){if(!t[0]&&!t[1])return e;var o=a.convert(t)._mult(i);n===`viewport`&&o._rotate(-r);for(var s=[],c=0;c<e.length;c++){var l=e[c];s.push(l.sub(o))}return s}var zc=new qo({"circle-sort-key":new Uo(qt.layout_circle[`circle-sort-key`])}),Bc={paint:new qo({"circle-radius":new Uo(qt.paint_circle[`circle-radius`]),"circle-color":new Uo(qt.paint_circle[`circle-color`]),"circle-blur":new Uo(qt.paint_circle[`circle-blur`]),"circle-opacity":new Uo(qt.paint_circle[`circle-opacity`]),"circle-translate":new Ho(qt.paint_circle[`circle-translate`]),"circle-translate-anchor":new Ho(qt.paint_circle[`circle-translate-anchor`]),"circle-pitch-scale":new Ho(qt.paint_circle[`circle-pitch-scale`]),"circle-pitch-alignment":new Ho(qt.paint_circle[`circle-pitch-alignment`]),"circle-stroke-width":new Uo(qt.paint_circle[`circle-stroke-width`]),"circle-stroke-color":new Uo(qt.paint_circle[`circle-stroke-color`]),"circle-stroke-opacity":new Uo(qt.paint_circle[`circle-stroke-opacity`])}),layout:zc},Vc=typeof Float32Array<`u`?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,n=arguments.length;n--;)t+=e[n]*e[n];return Math.sqrt(t)});function Hc(){var e=new Vc(4);return Vc!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function Uc(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c+a*s,e[1]=i*c+o*s,e[2]=r*-s+a*c,e[3]=i*-s+o*c,e}function Wc(){var e=new Vc(9);return Vc!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Gc(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=-n,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Kc(){var e=new Vc(16);return Vc!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function qc(e){var t=new Vc(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Jc(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Yc(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14],_=t[15],v=n*s-r*o,y=n*c-i*o,b=n*l-a*o,x=r*c-i*s,S=r*l-a*s,C=i*l-a*c,w=u*h-d*m,T=u*g-f*m,E=u*_-p*m,D=d*g-f*h,O=d*_-p*h,k=f*_-p*g,A=v*k-y*O+b*D+x*E-S*T+C*w;return A?(A=1/A,e[0]=(s*k-c*O+l*D)*A,e[1]=(i*O-r*k-a*D)*A,e[2]=(h*C-g*S+_*x)*A,e[3]=(f*S-d*C-p*x)*A,e[4]=(c*E-o*k-l*T)*A,e[5]=(n*k-i*E+a*T)*A,e[6]=(g*b-m*C-_*y)*A,e[7]=(u*C-f*b+p*y)*A,e[8]=(o*O-s*E+l*w)*A,e[9]=(r*E-n*O-a*w)*A,e[10]=(m*S-h*b+_*v)*A,e[11]=(d*b-u*S-p*v)*A,e[12]=(s*T-o*D-c*w)*A,e[13]=(n*D-r*T+i*w)*A,e[14]=(h*y-m*x-g*v)*A,e[15]=(u*x-d*y+f*v)*A,e):null}function Xc(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=n[0],b=n[1],x=n[2],S=n[3];return e[0]=y*r+b*s+x*d+S*h,e[1]=y*i+b*c+x*f+S*g,e[2]=y*a+b*l+x*p+S*_,e[3]=y*o+b*u+x*m+S*v,y=n[4],b=n[5],x=n[6],S=n[7],e[4]=y*r+b*s+x*d+S*h,e[5]=y*i+b*c+x*f+S*g,e[6]=y*a+b*l+x*p+S*_,e[7]=y*o+b*u+x*m+S*v,y=n[8],b=n[9],x=n[10],S=n[11],e[8]=y*r+b*s+x*d+S*h,e[9]=y*i+b*c+x*f+S*g,e[10]=y*a+b*l+x*p+S*_,e[11]=y*o+b*u+x*m+S*v,y=n[12],b=n[13],x=n[14],S=n[15],e[12]=y*r+b*s+x*d+S*h,e[13]=y*i+b*c+x*f+S*g,e[14]=y*a+b*l+x*p+S*_,e[15]=y*o+b*u+x*m+S*v,e}function Zc(e,t,n){var r=n[0],i=n[1],a=n[2],o,s,c,l,u,d,f,p,m,h,g,_;return t===e?(e[12]=t[0]*r+t[4]*i+t[8]*a+t[12],e[13]=t[1]*r+t[5]*i+t[9]*a+t[13],e[14]=t[2]*r+t[6]*i+t[10]*a+t[14],e[15]=t[3]*r+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],c=t[2],l=t[3],u=t[4],d=t[5],f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],e[0]=o,e[1]=s,e[2]=c,e[3]=l,e[4]=u,e[5]=d,e[6]=f,e[7]=p,e[8]=m,e[9]=h,e[10]=g,e[11]=_,e[12]=o*r+u*i+m*a+t[12],e[13]=s*r+d*i+h*a+t[13],e[14]=c*r+f*i+g*a+t[14],e[15]=l*r+p*i+_*a+t[15]),e}function Qc(e,t,n){var r=n[0],i=n[1],a=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function $c(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+l*r,e[5]=o*i+u*r,e[6]=s*i+d*r,e[7]=c*i+f*r,e[8]=l*i-a*r,e[9]=u*i-o*r,e[10]=d*i-s*r,e[11]=f*i-c*r,e}function el(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[4],u=t[5],d=t[6],f=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+l*r,e[1]=o*i+u*r,e[2]=s*i+d*r,e[3]=c*i+f*r,e[4]=l*i-a*r,e[5]=u*i-o*r,e[6]=d*i-s*r,e[7]=f*i-c*r,e}function tl(e,t,n,r,i){var a=1/Math.tan(t/2),o;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(o=1/(r-i),e[10]=(i+r)*o,e[14]=2*i*r*o):(e[10]=-1,e[14]=-2*r),e}function nl(e,t,n,r,i,a,o){var s=1/(t-n),c=1/(r-i),l=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*c,e[14]=(o+a)*l,e[15]=1,e}var rl=Xc;function il(){var e=new Vc(3);return Vc!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function al(e){var t=new Vc(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ol(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function sl(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function cl(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function ll(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function ul(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function dl(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],c=n[2];return e[0]=i*c-a*s,e[1]=a*o-r*c,e[2]=r*s-i*o,e}function fl(e,t,n){var r=t[0],i=t[1],a=t[2];return e[0]=r*n[0]+i*n[3]+a*n[6],e[1]=r*n[1]+i*n[4]+a*n[7],e[2]=r*n[2]+i*n[5]+a*n[8],e}var pl=sl;(function(){var e=il();return function(t,n,r,i,a,o){var s,c;for(n||=3,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;s<c;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}})();function ml(){var e=new Vc(4);return Vc!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function hl(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function _l(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function vl(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,e}(function(){var e=ml();return function(t,n,r,i,a,o){var s,c;for(n||=4,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;s<c;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}})();function yl(){var e=new Vc(2);return Vc!=Float32Array&&(e[0]=0,e[1]=0),e}function bl(e){var t=e[0],n=e[1];return t*t+n*n}var xl=bl;(function(){var e=yl();return function(t,n,r,i,a,o){var s,c;for(n||=2,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;s<c;s+=n)e[0]=t[s],e[1]=t[s+1],a(e,e,o),t[s]=e[0],t[s+1]=e[1];return t}})();var Sl=function(e){function t(t){e.call(this,t,Bc)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new Sc(e)},t.prototype.queryRadius=function(e){var t=e;return Ic(`circle-radius`,this,t)+Ic(`circle-stroke-width`,this,t)+Lc(this.paint.get(`circle-translate`))},t.prototype.queryIntersectsFeature=function(e,t,n,r,i,a,o,s){for(var c=Rc(e,this.paint.get(`circle-translate`),this.paint.get(`circle-translate-anchor`),a.angle,o),l=this.paint.get(`circle-radius`).evaluate(t,n)+this.paint.get(`circle-stroke-width`).evaluate(t,n),u=this.paint.get(`circle-pitch-alignment`)===`map`,d=u?c:wl(c,s),f=u?l*o:l,p=0,m=r;p<m.length;p+=1)for(var h=m[p],g=0,_=h;g<_.length;g+=1){var v=_[g],y=u?v:Cl(v,s),b=f,x=vl([],[v.x,v.y,0,1],s);if(this.paint.get(`circle-pitch-scale`)===`viewport`&&this.paint.get(`circle-pitch-alignment`)===`map`?b*=x[3]/a.cameraToCenterDistance:this.paint.get(`circle-pitch-scale`)===`map`&&this.paint.get(`circle-pitch-alignment`)===`viewport`&&(b*=a.cameraToCenterDistance/x[3]),wc(d,y,b))return!0}return!1},t}(Yo);function Cl(e,t){var n=vl([],[e.x,e.y,0,1],t);return new a(n[0]/n[3],n[1]/n[3])}function wl(e,t){return e.map(function(e){return Cl(e,t)})}var Tl=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Sc);$a(`HeatmapBucket`,Tl,{omit:[`layers`]});function El(e,t,n,r){var i=t.width,a=t.height;if(!r)r=new Uint8Array(i*a*n);else if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==i*a*n)throw RangeError(`mismatched image size`);return e.width=i,e.height=a,e.data=r,e}function Dl(e,t,n){var r=t.width,i=t.height;if(!(r===e.width&&i===e.height)){var a=El({},{width:r,height:i},n);Ol(e,a,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,r),height:Math.min(e.height,i)},n),e.width=r,e.height=i,e.data=a.data}}function Ol(e,t,n,r,i,a){if(i.width===0||i.height===0)return t;if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw RangeError(`out of range source coordinates for image copy`);if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw RangeError(`out of range destination coordinates for image copy`);for(var o=e.data,s=t.data,c=0;c<i.height;c++)for(var l=((n.y+c)*e.width+n.x)*a,u=((r.y+c)*t.width+r.x)*a,d=0;d<i.width*a;d++)s[u+d]=o[l+d];return t}var kl=function(e,t){El(this,e,1,t)};kl.prototype.resize=function(e){Dl(this,e,1)},kl.prototype.clone=function(){return new kl({width:this.width,height:this.height},new Uint8Array(this.data))},kl.copy=function(e,t,n,r,i){Ol(e,t,n,r,i,1)};var Al=function(e,t){El(this,e,4,t)};Al.prototype.resize=function(e){Dl(this,e,4)},Al.prototype.replace=function(e,t){t?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e},Al.prototype.clone=function(){return new Al({width:this.width,height:this.height},new Uint8Array(this.data))},Al.copy=function(e,t,n,r,i){Ol(e,t,n,r,i,4)},$a(`AlphaImage`,kl),$a(`RGBAImage`,Al);var jl={paint:new qo({"heatmap-radius":new Uo(qt.paint_heatmap[`heatmap-radius`]),"heatmap-weight":new Uo(qt.paint_heatmap[`heatmap-weight`]),"heatmap-intensity":new Ho(qt.paint_heatmap[`heatmap-intensity`]),"heatmap-color":new Ko(qt.paint_heatmap[`heatmap-color`]),"heatmap-opacity":new Ho(qt.paint_heatmap[`heatmap-opacity`])})};function Ml(e){var t={},n=e.resolution||256,r=e.clips?e.clips.length:1,i=e.image||new Al({width:n,height:r}),a=function(n,r,a){t[e.evaluationKey]=a;var o=e.expression.evaluate(t);i.data[n+r+0]=Math.floor(o.r*255/o.a),i.data[n+r+1]=Math.floor(o.g*255/o.a),i.data[n+r+2]=Math.floor(o.b*255/o.a),i.data[n+r+3]=Math.floor(o.a*255)};if(e.clips)for(var o=0,s=0;o<r;++o,s+=n*4)for(var c=0,l=0;c<n;c++,l+=4){var u=c/(n-1),d=e.clips[o],f=d.start,p=d.end,m=f*(1-u)+p*u;a(s,l,m)}else for(var h=0,g=0;h<n;h++,g+=4){var _=h/(n-1);a(0,g,_)}return i}var Nl=function(e){function t(t){e.call(this,t,jl),this._updateColorRamp()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new Tl(e)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){e===`heatmap-color`&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){var e=this._transitionablePaint._values[`heatmap-color`].value.expression;this.colorRamp=Ml({expression:e,evaluationKey:`heatmapDensity`,image:this.colorRamp}),this.colorRampTexture=null},t.prototype.resize=function(){this.heatmapFbo&&=(this.heatmapFbo.destroy(),null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype.hasOffscreenPass=function(){return this.paint.get(`heatmap-opacity`)!==0&&this.visibility!==`none`},t}(Yo),Pl={paint:new qo({"hillshade-illumination-direction":new Ho(qt.paint_hillshade[`hillshade-illumination-direction`]),"hillshade-illumination-anchor":new Ho(qt.paint_hillshade[`hillshade-illumination-anchor`]),"hillshade-exaggeration":new Ho(qt.paint_hillshade[`hillshade-exaggeration`]),"hillshade-shadow-color":new Ho(qt.paint_hillshade[`hillshade-shadow-color`]),"hillshade-highlight-color":new Ho(qt.paint_hillshade[`hillshade-highlight-color`]),"hillshade-accent-color":new Ho(qt.paint_hillshade[`hillshade-accent-color`])})},Fl=function(e){function t(t){e.call(this,t,Pl)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.hasOffscreenPass=function(){return this.paint.get(`hillshade-exaggeration`)!==0&&this.visibility!==`none`},t}(Yo),Il=ts([{name:`a_pos`,components:2,type:`Int16`}],4).members,Ll=zl,Rl=zl;function zl(e,t,n){n||=2;var r=t&&t.length,i=r?t[0]*n:e.length,a=Bl(e,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;var s,c,l,u,d,f,p;if(r&&(a=ql(e,t,a,n)),e.length>80*n){s=l=e[0],c=u=e[1];for(var m=n;m<i;m+=n)d=e[m],f=e[m+1],d<s&&(s=d),f<c&&(c=f),d>l&&(l=d),f>u&&(u=f);p=Math.max(l-s,u-c),p=p===0?0:1/p}return Hl(a,o,n,s,c,p),o}function Bl(e,t,n,r,i){var a,o;if(i===gu(e,t,n,r)>0)for(a=t;a<n;a+=r)o=pu(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=pu(a,e[a],e[a+1],o);return o&&au(o,o.next)&&(mu(o),o=o.next),o}function Vl(e,t){if(!e)return e;t||=e;var n=e,r;do if(r=!1,!n.steiner&&(au(n,n.next)||iu(n.prev,n,n.next)===0)){if(mu(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function Hl(e,t,n,r,i,a,o){if(e){!o&&a&&Ql(e,r,i,a);for(var s=e,c,l;e.prev!==e.next;){if(c=e.prev,l=e.next,a?Wl(e,r,i,a):Ul(e)){t.push(c.i/n),t.push(e.i/n),t.push(l.i/n),mu(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=Gl(Vl(e),t,n),Hl(e,t,n,r,i,a,2)):o===2&&Kl(e,t,n,r,i,a):Hl(Vl(e),t,n,r,i,a,1);break}}}}function Ul(e){var t=e.prev,n=e,r=e.next;if(iu(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(nu(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&iu(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Wl(e,t,n,r){var i=e.prev,a=e,o=e.next;if(iu(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,c=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,l=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,d=eu(s,c,t,n,r),f=eu(l,u,t,n,r),p=e.prevZ,m=e.nextZ;p&&p.z>=d&&m&&m.z<=f;){if(p!==e.prev&&p!==e.next&&nu(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&iu(p.prev,p,p.next)>=0||(p=p.prevZ,m!==e.prev&&m!==e.next&&nu(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&iu(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&nu(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&iu(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=f;){if(m!==e.prev&&m!==e.next&&nu(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&iu(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function Gl(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!au(i,a)&&ou(i,r,r.next,a)&&uu(i,a)&&uu(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),mu(r),mu(r.next),r=e=a),r=r.next}while(r!==e);return Vl(r)}function Kl(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&ru(o,s)){var c=fu(o,s);o=Vl(o,o.next),c=Vl(c,c.next),Hl(o,t,n,r,i,a),Hl(c,t,n,r,i,a);return}s=s.next}o=o.next}while(o!==e)}function ql(e,t,n,r){var i=[],a,o,s,c,l;for(a=0,o=t.length;a<o;a++)s=t[a]*r,c=a<o-1?t[a+1]*r:e.length,l=Bl(e,s,c,r,!1),l===l.next&&(l.steiner=!0),i.push(tu(l));for(i.sort(Jl),a=0;a<i.length;a++)Yl(i[a],n),n=Vl(n,n.next);return n}function Jl(e,t){return e.x-t.x}function Yl(e,t){if(t=Xl(e,t),t){var n=fu(t,e);Vl(t,t.next),Vl(n,n.next)}}function Xl(e,t){var n=t,r=e.x,i=e.y,a=-1/0,o;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a){if(a=s,s===r){if(i===n.y)return n;if(i===n.next.y)return n.next}o=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!o)return null;if(r===a)return o;var c=o,l=o.x,u=o.y,d=1/0,f;n=o;do r>=n.x&&n.x>=l&&r!==n.x&&nu(i<u?r:a,i,l,u,i<u?a:r,i,n.x,n.y)&&(f=Math.abs(i-n.y)/(r-n.x),uu(n,e)&&(f<d||f===d&&(n.x>o.x||n.x===o.x&&Zl(o,n)))&&(o=n,d=f)),n=n.next;while(n!==c);return o}function Zl(e,t){return iu(e.prev,e,t.prev)<0&&iu(t.next,e,e.next)<0}function Ql(e,t,n,r){var i=e;do i.z===null&&(i.z=eu(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,$l(i)}function $l(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ,r);t++);for(c=l;s>0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return e}function eu(e,t,n,r,i){return e=32767*(e-n)*i,t=32767*(t-r)*i,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function tu(e){var t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function nu(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function ru(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!lu(e,t)&&(uu(e,t)&&uu(t,e)&&du(e,t)&&(iu(e.prev,e,t.prev)||iu(e,t.prev,t))||au(e,t)&&iu(e.prev,e,e.next)>0&&iu(t.prev,t,t.next)>0)}function iu(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function au(e,t){return e.x===t.x&&e.y===t.y}function ou(e,t,n,r){var i=cu(iu(e,t,n)),a=cu(iu(e,t,r)),o=cu(iu(n,r,e)),s=cu(iu(n,r,t));return!!(i!==a&&o!==s||i===0&&su(e,n,t)||a===0&&su(e,r,t)||o===0&&su(n,e,r)||s===0&&su(n,t,r))}function su(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function cu(e){return e>0?1:e<0?-1:0}function lu(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&ou(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function uu(e,t){return iu(e.prev,e,e.next)<0?iu(e,t,e.next)>=0&&iu(e,e.prev,t)>=0:iu(e,t,e.prev)<0||iu(e,e.next,t)<0}function du(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function fu(e,t){var n=new hu(e.i,e.x,e.y),r=new hu(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function pu(e,t,n,r){var i=new hu(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function mu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function hu(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}zl.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(gu(e,0,a,n));if(i)for(var s=0,c=t.length;s<c;s++){var l=t[s]*n,u=s<c-1?t[s+1]*n:e.length;o-=Math.abs(gu(e,l,u,n))}var d=0;for(s=0;s<r.length;s+=3){var f=r[s]*n,p=r[s+1]*n,m=r[s+2]*n;d+=Math.abs((e[f]-e[m])*(e[p+1]-e[f+1])-(e[f]-e[p])*(e[m+1]-e[f+1]))}return o===0&&d===0?0:Math.abs((d-o)/o)};function gu(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}zl.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[i][a][o]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},Ll.default=Rl;function _u(e,t,n,r,i){vu(e,t,n||0,r||e.length-1,i||bu)}function vu(e,t,n,r,i){for(;r>n;){if(r-n>600){var a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);vu(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}var u=e[t],d=n,f=r;for(yu(e,n,t),i(e[r],u)>0&&yu(e,n,r);d<f;){for(yu(e,d,f),d++,f--;i(e[d],u)<0;)d++;for(;i(e[f],u)>0;)f--}i(e[n],u)===0?yu(e,n,f):(f++,yu(e,f,r)),f<=t&&(n=f+1),t<=f&&(r=f-1)}}function yu(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function bu(e,t){return e<t?-1:e>t?1:0}function xu(e,t){var n=e.length;if(n<=1)return[e];for(var r=[],i,a,o=0;o<n;o++){var s=P(e[o]);s!==0&&(e[o].area=Math.abs(s),a===void 0&&(a=s<0),a===s<0?(i&&r.push(i),i=[e[o]]):i.push(e[o]))}if(i&&r.push(i),t>1)for(var c=0;c<r.length;c++)r[c].length<=t||(_u(r[c],t,1,r[c].length-1,Su),r[c]=r[c].slice(0,t));return r}function Su(e,t){return t.area-e.area}function Cu(e,t,n){for(var r=n.patternDependencies,i=!1,a=0,o=t;a<o.length;a+=1){var s=o[a].paint.get(e+`-pattern`);s.isConstant()||(i=!0);var c=s.constantOr(null);c&&(i=!0,r[c.to]=!0,r[c.from]=!0)}return i}function wu(e,t,n,r,i){for(var a=i.patternDependencies,o=0,s=t;o<s.length;o+=1){var c=s[o],l=c.paint.get(e+`-pattern`).value;if(l.kind!==`constant`){var u=l.evaluate({zoom:r-1},n,{},i.availableImages),d=l.evaluate({zoom:r},n,{},i.availableImages),f=l.evaluate({zoom:r+1},n,{},i.availableImages);u=u&&u.name?u.name:u,d=d&&d.name?d.name:d,f=f&&f.name?f.name:f,a[u]=!0,a[d]=!0,a[f]=!0,n.patterns[c.id]={min:u,mid:d,max:f}}}return n}var Tu=500,Eu=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(e){return e.id}),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new is,this.indexArray=new _s,this.indexArray2=new Cs,this.programConfigurations=new fc(e.layers,e.zoom),this.segments=new Ls,this.segments2=new Ls,this.stateDependentLayerIds=this.layers.filter(function(e){return e.isStateDependent()}).map(function(e){return e.id})};Eu.prototype.populate=function(e,t,n){this.hasPattern=Cu(`fill`,this.layers,t);for(var r=this.layers[0].layout.get(`fill-sort-key`),i=[],a=0,o=e;a<o.length;a+=1){var s=o[a],c=s.feature,l=s.id,u=s.index,d=s.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,p=bc(c,f);if(this.layers[0]._featureFilter.filter(new No(this.zoom),p,n)){var m=r?r.evaluate(p,{},n,t.availableImages):void 0,h={id:l,properties:c.properties,type:c.type,sourceLayerIndex:d,index:u,geometry:f?p.geometry:yc(c),patterns:{},sortKey:m};i.push(h)}}r&&i.sort(function(e,t){return e.sortKey-t.sortKey});for(var g=0,_=i;g<_.length;g+=1){var v=_[g],y=v,b=y.geometry,x=y.index,S=y.sourceLayerIndex;if(this.hasPattern){var C=wu(`fill`,this.layers,v,this.zoom,t);this.patternFeatures.push(C)}else this.addFeature(v,b,x,n,{});var w=e[x].feature;t.featureIndex.insert(w,b,x,S,this.index)}},Eu.prototype.update=function(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)},Eu.prototype.addFeatures=function(e,t,n){for(var r=0,i=this.patternFeatures;r<i.length;r+=1){var a=i[r];this.addFeature(a,a.geometry,a.index,t,n)}},Eu.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Eu.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Eu.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Il),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0},Eu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Eu.prototype.addFeature=function(e,t,n,r,i){for(var a=0,o=xu(t,Tu);a<o.length;a+=1){for(var s=o[a],c=0,l=0,u=s;l<u.length;l+=1){var d=u[l];c+=d.length}for(var f=this.segments.prepareSegment(c,this.layoutVertexArray,this.indexArray),p=f.vertexLength,m=[],h=[],g=0,_=s;g<_.length;g+=1){var v=_[g];if(v.length!==0){v!==s[0]&&h.push(m.length/2);var y=this.segments2.prepareSegment(v.length,this.layoutVertexArray,this.indexArray2),b=y.vertexLength;this.layoutVertexArray.emplaceBack(v[0].x,v[0].y),this.indexArray2.emplaceBack(b+v.length-1,b),m.push(v[0].x),m.push(v[0].y);for(var x=1;x<v.length;x++)this.layoutVertexArray.emplaceBack(v[x].x,v[x].y),this.indexArray2.emplaceBack(b+x-1,b+x),m.push(v[x].x),m.push(v[x].y);y.vertexLength+=v.length,y.primitiveLength+=v.length}}for(var S=Ll(m,h),C=0;C<S.length;C+=3)this.indexArray.emplaceBack(p+S[C],p+S[C+1],p+S[C+2]);f.vertexLength+=c,f.primitiveLength+=S.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,i,r)},$a(`FillBucket`,Eu,{omit:[`layers`,`patternFeatures`]});var Du=new qo({"fill-sort-key":new Uo(qt.layout_fill[`fill-sort-key`])}),Ou={paint:new qo({"fill-antialias":new Ho(qt.paint_fill[`fill-antialias`]),"fill-opacity":new Uo(qt.paint_fill[`fill-opacity`]),"fill-color":new Uo(qt.paint_fill[`fill-color`]),"fill-outline-color":new Uo(qt.paint_fill[`fill-outline-color`]),"fill-translate":new Ho(qt.paint_fill[`fill-translate`]),"fill-translate-anchor":new Ho(qt.paint_fill[`fill-translate-anchor`]),"fill-pattern":new Wo(qt.paint_fill[`fill-pattern`])}),layout:Du},ku=function(e){function t(t){e.call(this,t,Ou)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,n){e.prototype.recalculate.call(this,t,n);var r=this.paint._values[`fill-outline-color`];r.value.kind===`constant`&&r.value.value===void 0&&(this.paint._values[`fill-outline-color`]=this.paint._values[`fill-color`])},t.prototype.createBucket=function(e){return new Eu(e)},t.prototype.queryRadius=function(){return Lc(this.paint.get(`fill-translate`))},t.prototype.queryIntersectsFeature=function(e,t,n,r,i,a,o){return Tc(Rc(e,this.paint.get(`fill-translate`),this.paint.get(`fill-translate-anchor`),a.angle,o),r)},t.prototype.isTileClipped=function(){return!0},t}(Yo),Au=ts([{name:`a_pos`,components:2,type:`Int16`},{name:`a_normal_ed`,components:4,type:`Int16`}],4).members,ju=Mu;function Mu(e,t,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=i,e.readFields(Nu,this,t)}function Nu(e,t,n){e==1?t.id=n.readVarint():e==2?Pu(n,t):e==3?t.type=n.readVarint():e==4&&(t._geometry=n.pos)}function Pu(e,t){for(var n=e.readVarint()+e.pos;e.pos<n;){var r=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[r]=i}}Mu.types=[`Unknown`,`Point`,`LineString`,`Polygon`],Mu.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,n=1,r=0,i=0,o=0,s=[],c;e.pos<t;){if(r<=0){var l=e.readVarint();n=l&7,r=l>>3}if(r--,n===1||n===2)i+=e.readSVarint(),o+=e.readSVarint(),n===1&&(c&&s.push(c),c=[]),c.push(new a(i,o));else if(n===7)c&&c.push(c[0].clone());else throw Error(`unknown command `+n)}return c&&s.push(c),s},Mu.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,n=1,r=0,i=0,a=0,o=1/0,s=-1/0,c=1/0,l=-1/0;e.pos<t;){if(r<=0){var u=e.readVarint();n=u&7,r=u>>3}if(r--,n===1||n===2)i+=e.readSVarint(),a+=e.readSVarint(),i<o&&(o=i),i>s&&(s=i),a<c&&(c=a),a>l&&(l=a);else if(n!==7)throw Error(`unknown command `+n)}return[o,c,s,l]},Mu.prototype.toGeoJSON=function(e,t,n){var r=this.extent*2**n,i=this.extent*e,a=this.extent*t,o=this.loadGeometry(),s=Mu.types[this.type],c,l;function u(e){for(var t=0;t<e.length;t++){var n=e[t],o=180-(n.y+a)*360/r;e[t]=[(n.x+i)*360/r-180,360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90]}}switch(this.type){case 1:var d=[];for(c=0;c<o.length;c++)d[c]=o[c][0];o=d,u(o);break;case 2:for(c=0;c<o.length;c++)u(o[c]);break;case 3:for(o=Fu(o),c=0;c<o.length;c++)for(l=0;l<o[c].length;l++)u(o[c][l]);break}o.length===1?o=o[0]:s=`Multi`+s;var f={type:`Feature`,geometry:{type:s,coordinates:o},properties:this.properties};return`id`in this&&(f.id=this.id),f};function Fu(e){var t=e.length;if(t<=1)return[e];for(var n=[],r,i,a=0;a<t;a++){var o=Iu(e[a]);o!==0&&(i===void 0&&(i=o<0),i===o<0?(r&&n.push(r),r=[e[a]]):r.push(e[a]))}return r&&n.push(r),n}function Iu(e){for(var t=0,n=0,r=e.length,i=r-1,a,o;n<r;i=n++)a=e[n],o=e[i],t+=(o.x-a.x)*(a.y+o.y);return t}var Lu=Ru;function Ru(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(zu,this,t),this.length=this._features.length}function zu(e,t,n){e===15?t.version=n.readVarint():e===1?t.name=n.readString():e===5?t.extent=n.readVarint():e===2?t._features.push(n.pos):e===3?t._keys.push(n.readString()):e===4&&t._values.push(Bu(n))}function Bu(e){for(var t=null,n=e.readVarint()+e.pos;e.pos<n;){var r=e.readVarint()>>3;t=r===1?e.readString():r===2?e.readFloat():r===3?e.readDouble():r===4?e.readVarint64():r===5?e.readVarint():r===6?e.readSVarint():r===7?e.readBoolean():null}return t}Ru.prototype.feature=function(e){if(e<0||e>=this._features.length)throw Error(`feature index out of bounds`);this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new ju(this._pbf,t,this.extent,this._keys,this._values)};var Vu=Hu;function Hu(e,t){this.layers=e.readFields(Uu,{},t)}function Uu(e,t,n){if(e===3){var r=new Lu(n,n.readVarint()+n.pos);r.length&&(t[r.name]=r)}}var Wu={VectorTile:Vu,VectorTileFeature:ju,VectorTileLayer:Lu},Gu=Wu.VectorTileFeature.types,Ku=500,qu=2**13;function Ju(e,t,n,r,i,a,o,s){e.emplaceBack(t,n,Math.floor(r*qu)*2+o,i*qu*2,a*qu*2,Math.round(s))}var Yu=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(e){return e.id}),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new os,this.indexArray=new _s,this.programConfigurations=new fc(e.layers,e.zoom),this.segments=new Ls,this.stateDependentLayerIds=this.layers.filter(function(e){return e.isStateDependent()}).map(function(e){return e.id})};Yu.prototype.populate=function(e,t,n){this.features=[],this.hasPattern=Cu(`fill-extrusion`,this.layers,t);for(var r=0,i=e;r<i.length;r+=1){var a=i[r],o=a.feature,s=a.id,c=a.index,l=a.sourceLayerIndex,u=this.layers[0]._featureFilter.needGeometry,d=bc(o,u);if(this.layers[0]._featureFilter.filter(new No(this.zoom),d,n)){var f={id:s,sourceLayerIndex:l,index:c,geometry:u?d.geometry:yc(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push(wu(`fill-extrusion`,this.layers,f,this.zoom,t)):this.addFeature(f,f.geometry,c,n,{}),t.featureIndex.insert(o,f.geometry,c,l,this.index,!0)}}},Yu.prototype.addFeatures=function(e,t,n){for(var r=0,i=this.features;r<i.length;r+=1){var a=i[r],o=a.geometry;this.addFeature(a,o,a.index,t,n)}},Yu.prototype.update=function(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)},Yu.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Yu.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Yu.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Au),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Yu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Yu.prototype.addFeature=function(e,t,n,r,i){for(var a=0,o=xu(t,Ku);a<o.length;a+=1){for(var s=o[a],c=0,l=0,u=s;l<u.length;l+=1){var d=u[l];c+=d.length}for(var f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),p=0,m=s;p<m.length;p+=1){var h=m[p];if(h.length!==0&&!Zu(h))for(var g=0,_=0;_<h.length;_++){var v=h[_];if(_>=1){var y=h[_-1];if(!Xu(v,y)){f.vertexLength+4>Ls.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var b=v.sub(y)._perp()._unit(),x=y.dist(v);g+x>32768&&(g=0),Ju(this.layoutVertexArray,v.x,v.y,b.x,b.y,0,0,g),Ju(this.layoutVertexArray,v.x,v.y,b.x,b.y,0,1,g),g+=x,Ju(this.layoutVertexArray,y.x,y.y,b.x,b.y,0,0,g),Ju(this.layoutVertexArray,y.x,y.y,b.x,b.y,0,1,g);var S=f.vertexLength;this.indexArray.emplaceBack(S,S+2,S+1),this.indexArray.emplaceBack(S+1,S+2,S+3),f.vertexLength+=4,f.primitiveLength+=2}}}}if(f.vertexLength+c>Ls.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(c,this.layoutVertexArray,this.indexArray)),Gu[e.type]===`Polygon`){for(var C=[],w=[],T=f.vertexLength,E=0,D=s;E<D.length;E+=1){var O=D[E];if(O.length!==0){O!==s[0]&&w.push(C.length/2);for(var k=0;k<O.length;k++){var A=O[k];Ju(this.layoutVertexArray,A.x,A.y,0,0,1,1,0),C.push(A.x),C.push(A.y)}}}for(var j=Ll(C,w),M=0;M<j.length;M+=3)this.indexArray.emplaceBack(T+j[M],T+j[M+2],T+j[M+1]);f.primitiveLength+=j.length/3,f.vertexLength+=c}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,i,r)},$a(`FillExtrusionBucket`,Yu,{omit:[`layers`,`features`]});function Xu(e,t){return e.x===t.x&&(e.x<0||e.x>gc)||e.y===t.y&&(e.y<0||e.y>gc)}function Zu(e){return e.every(function(e){return e.x<0})||e.every(function(e){return e.x>gc})||e.every(function(e){return e.y<0})||e.every(function(e){return e.y>gc})}var Qu={paint:new qo({"fill-extrusion-opacity":new Ho(qt[`paint_fill-extrusion`][`fill-extrusion-opacity`]),"fill-extrusion-color":new Uo(qt[`paint_fill-extrusion`][`fill-extrusion-color`]),"fill-extrusion-translate":new Ho(qt[`paint_fill-extrusion`][`fill-extrusion-translate`]),"fill-extrusion-translate-anchor":new Ho(qt[`paint_fill-extrusion`][`fill-extrusion-translate-anchor`]),"fill-extrusion-pattern":new Wo(qt[`paint_fill-extrusion`][`fill-extrusion-pattern`]),"fill-extrusion-height":new Uo(qt[`paint_fill-extrusion`][`fill-extrusion-height`]),"fill-extrusion-base":new Uo(qt[`paint_fill-extrusion`][`fill-extrusion-base`]),"fill-extrusion-vertical-gradient":new Ho(qt[`paint_fill-extrusion`][`fill-extrusion-vertical-gradient`])})},$u=function(e){function t(t){e.call(this,t,Qu)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new Yu(e)},t.prototype.queryRadius=function(){return Lc(this.paint.get(`fill-extrusion-translate`))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(e,t,n,r,i,a,o,s){var c=Rc(e,this.paint.get(`fill-extrusion-translate`),this.paint.get(`fill-extrusion-translate-anchor`),a.angle,o),l=this.paint.get(`fill-extrusion-height`).evaluate(t,n),u=this.paint.get(`fill-extrusion-base`).evaluate(t,n),d=id(c,s,a,0),f=rd(r,u,l,s),p=f[0],m=f[1];return nd(p,m,d)},t}(Yo);function ed(e,t){return e.x*t.x+e.y*t.y}function td(e,t){if(e.length===1){for(var n=0,r=t[n++],i;!i||r.equals(i);)if(i=t[n++],!i)return 1/0;for(;n<t.length;n++){var a=t[n],o=e[0],s=i.sub(r),c=a.sub(r),l=o.sub(r),u=ed(s,s),d=ed(s,c),f=ed(c,c),p=ed(l,s),m=ed(l,c),h=u*f-d*d,g=(f*p-d*m)/h,_=(u*m-d*p)/h,v=1-g-_,y=r.z*v+i.z*g+a.z*_;if(isFinite(y))return y}return 1/0}else{for(var b=1/0,x=0,S=t;x<S.length;x+=1){var C=S[x];b=Math.min(b,C.z)}return b}}function nd(e,t,n){var r=1/0;Tc(n,t)&&(r=td(n,t[0]));for(var i=0;i<t.length;i++)for(var a=t[i],o=e[i],s=0;s<a.length-1;s++){var c=a[s],l=a[s+1],u=o[s],d=[c,l,o[s+1],u,c];Cc(n,d)&&(r=Math.min(r,td(n,d)))}return r===1/0?!1:r}function rd(e,t,n,r){for(var i=[],o=[],s=r[8]*t,c=r[9]*t,l=r[10]*t,u=r[11]*t,d=r[8]*n,f=r[9]*n,p=r[10]*n,m=r[11]*n,h=0,g=e;h<g.length;h+=1){for(var _=g[h],v=[],y=[],b=0,x=_;b<x.length;b+=1){var S=x[b],C=S.x,w=S.y,T=r[0]*C+r[4]*w+r[12],E=r[1]*C+r[5]*w+r[13],D=r[2]*C+r[6]*w+r[14],O=r[3]*C+r[7]*w+r[15],k=T+s,A=E+c,j=D+l,M=O+u,N=T+d,P=E+f,F=D+p,I=O+m,L=new a(k/M,A/M);L.z=j/M,v.push(L);var R=new a(N/I,P/I);R.z=F/I,y.push(R)}i.push(v),o.push(y)}return[i,o]}function id(e,t,n,r){for(var i=[],o=0,s=e;o<s.length;o+=1){var c=s[o],l=[c.x,c.y,r,1];vl(l,l,t),i.push(new a(l[0]/l[3],l[1]/l[3]))}return i}var ad=ts([{name:`a_pos_normal`,components:2,type:`Int16`},{name:`a_data`,components:4,type:`Uint8`}],4).members,od=ts([{name:`a_uv_x`,components:1,type:`Float32`},{name:`a_split_index`,components:1,type:`Float32`}]).members,sd=Wu.VectorTileFeature.types,cd=63,ld=Math.cos(75/2*(Math.PI/180)),ud=15,dd=20,fd=15,pd=1/2,md=2**(fd-1)/pd,hd=function(e){var t=this;this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(e){return e.id}),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(e){t.gradients[e.id]={}}),this.layoutVertexArray=new ss,this.layoutVertexArray2=new cs,this.indexArray=new _s,this.programConfigurations=new fc(e.layers,e.zoom),this.segments=new Ls,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(e){return e.isStateDependent()}).map(function(e){return e.id})};hd.prototype.populate=function(e,t,n){this.hasPattern=Cu(`line`,this.layers,t);for(var r=this.layers[0].layout.get(`line-sort-key`),i=[],a=0,o=e;a<o.length;a+=1){var s=o[a],c=s.feature,l=s.id,u=s.index,d=s.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,p=bc(c,f);if(this.layers[0]._featureFilter.filter(new No(this.zoom),p,n)){var m=r?r.evaluate(p,{},n):void 0,h={id:l,properties:c.properties,type:c.type,sourceLayerIndex:d,index:u,geometry:f?p.geometry:yc(c),patterns:{},sortKey:m};i.push(h)}}r&&i.sort(function(e,t){return e.sortKey-t.sortKey});for(var g=0,_=i;g<_.length;g+=1){var v=_[g],y=v,b=y.geometry,x=y.index,S=y.sourceLayerIndex;if(this.hasPattern){var C=wu(`line`,this.layers,v,this.zoom,t);this.patternFeatures.push(C)}else this.addFeature(v,b,x,n,{});var w=e[x].feature;t.featureIndex.insert(w,b,x,S,this.index)}},hd.prototype.update=function(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)},hd.prototype.addFeatures=function(e,t,n){for(var r=0,i=this.patternFeatures;r<i.length;r+=1){var a=i[r];this.addFeature(a,a.geometry,a.index,t,n)}},hd.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},hd.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},hd.prototype.upload=function(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,od)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ad),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},hd.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},hd.prototype.lineFeatureClips=function(e){if(e.properties&&e.properties.hasOwnProperty(`mapbox_clip_start`)&&e.properties.hasOwnProperty(`mapbox_clip_end`))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}},hd.prototype.addFeature=function(e,t,n,r,i){var a=this.layers[0].layout,o=a.get(`line-join`).evaluate(e,{}),s=a.get(`line-cap`),c=a.get(`line-miter-limit`),l=a.get(`line-round-limit`);this.lineClips=this.lineFeatureClips(e);for(var u=0,d=t;u<d.length;u+=1){var f=d[u];this.addLine(f,e,o,s,c,l)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,i,r)},hd.prototype.addLine=function(e,t,n,r,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var o=0;o<e.length-1;o++)this.totalDistance+=e[o].dist(e[o+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var s=sd[t.type]===`Polygon`,c=e.length;c>=2&&e[c-1].equals(e[c-2]);)c--;for(var l=0;l<c-1&&e[l].equals(e[l+1]);)l++;if(!(c<(s?3:2))){n===`bevel`&&(i=1.05);var u=this.overscaling<=16?ud*gc/(512*this.overscaling):0,d=this.segments.prepareSegment(c*10,this.layoutVertexArray,this.indexArray),f,p=void 0,m=void 0,h=void 0,g=void 0;this.e1=this.e2=-1,s&&(f=e[c-2],g=e[l].sub(f)._unit()._perp());for(var _=l;_<c;_++)if(m=_===c-1?s?e[l+1]:void 0:e[_+1],!(m&&e[_].equals(m))){g&&(h=g),f&&(p=f),f=e[_],g=m?m.sub(f)._unit()._perp():h,h||=g;var v=h.add(g);(v.x!==0||v.y!==0)&&v._unit();var y=h.x*g.x+h.y*g.y,b=v.x*g.x+v.y*g.y,x=b===0?1/0:1/b,S=2*Math.sqrt(2-2*b),C=b<ld&&p&&m,w=h.x*g.y-h.y*g.x>0;if(C&&_>l){var T=f.dist(p);if(T>2*u){var E=f.sub(f.sub(p)._mult(u/T)._round());this.updateDistance(p,E),this.addCurrentVertex(E,h,0,0,d),p=E}}var D=p&&m,O=D?n:s?`butt`:r;if(D&&O===`round`&&(x<a?O=`miter`:x<=2&&(O=`fakeround`)),O===`miter`&&x>i&&(O=`bevel`),O===`bevel`&&(x>2&&(O=`flipbevel`),x<i&&(O=`miter`)),p&&this.updateDistance(p,f),O===`miter`)v._mult(x),this.addCurrentVertex(f,v,0,0,d);else if(O===`flipbevel`){if(x>100)v=g.mult(-1);else{var k=x*h.add(g).mag()/h.sub(g).mag();v._perp()._mult(k*(w?-1:1))}this.addCurrentVertex(f,v,0,0,d),this.addCurrentVertex(f,v.mult(-1),0,0,d)}else if(O===`bevel`||O===`fakeround`){var A=-Math.sqrt(x*x-1),j=w?A:0,M=w?0:A;if(p&&this.addCurrentVertex(f,h,j,M,d),O===`fakeround`)for(var N=Math.round(S*180/Math.PI/dd),P=1;P<N;P++){var F=P/N;if(F!==.5){var I=F-.5,L=1.0904+y*(-3.2452+y*(3.55645-y*1.43519)),R=.848013+y*(-1.06021+y*.215638);F+=F*I*(F-1)*(L*I*I+R)}var z=g.sub(h)._mult(F)._add(h)._unit()._mult(w?-1:1);this.addHalfVertex(f,z.x,z.y,!1,w,0,d)}m&&this.addCurrentVertex(f,g,-j,-M,d)}else if(O===`butt`)this.addCurrentVertex(f,v,0,0,d);else if(O===`square`){var B=p?1:-1;this.addCurrentVertex(f,v,B,B,d)}else O===`round`&&(p&&(this.addCurrentVertex(f,h,0,0,d),this.addCurrentVertex(f,h,1,1,d,!0)),m&&(this.addCurrentVertex(f,g,-1,-1,d,!0),this.addCurrentVertex(f,g,0,0,d)));if(C&&_<c-1){var V=f.dist(m);if(V>2*u){var H=f.add(m.sub(f)._mult(u/V)._round());this.updateDistance(f,H),this.addCurrentVertex(H,g,0,0,d),f=H}}}}},hd.prototype.addCurrentVertex=function(e,t,n,r,i,a){a===void 0&&(a=!1);var o=t.x+t.y*n,s=t.y-t.x*n,c=-t.x+t.y*r,l=-t.y-t.x*r;this.addHalfVertex(e,o,s,a,!1,n,i),this.addHalfVertex(e,c,l,a,!0,-r,i),this.distance>md/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,t,n,r,i,a))},hd.prototype.addHalfVertex=function(e,t,n,r,i,a,o){var s=e.x,c=e.y,l=(this.lineClips?this.scaledDistance*(md-1):this.scaledDistance)*pd;if(this.layoutVertexArray.emplaceBack((s<<1)+(r?1:0),(c<<1)+(i?1:0),Math.round(cd*t)+128,Math.round(cd*n)+128,(a===0?0:a<0?-1:1)+1|(l&63)<<2,l>>6),this.lineClips){var u=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(u,this.lineClipsArray.length)}var d=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,d),o.primitiveLength++),i?this.e2=d:this.e1=d},hd.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},hd.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},$a(`LineBucket`,hd,{omit:[`layers`,`patternFeatures`]});var gd=new qo({"line-cap":new Ho(qt.layout_line[`line-cap`]),"line-join":new Uo(qt.layout_line[`line-join`]),"line-miter-limit":new Ho(qt.layout_line[`line-miter-limit`]),"line-round-limit":new Ho(qt.layout_line[`line-round-limit`]),"line-sort-key":new Uo(qt.layout_line[`line-sort-key`])}),_d={paint:new qo({"line-opacity":new Uo(qt.paint_line[`line-opacity`]),"line-color":new Uo(qt.paint_line[`line-color`]),"line-translate":new Ho(qt.paint_line[`line-translate`]),"line-translate-anchor":new Ho(qt.paint_line[`line-translate-anchor`]),"line-width":new Uo(qt.paint_line[`line-width`]),"line-gap-width":new Uo(qt.paint_line[`line-gap-width`]),"line-offset":new Uo(qt.paint_line[`line-offset`]),"line-blur":new Uo(qt.paint_line[`line-blur`]),"line-dasharray":new Go(qt.paint_line[`line-dasharray`]),"line-pattern":new Wo(qt.paint_line[`line-pattern`]),"line-gradient":new Ko(qt.paint_line[`line-gradient`])}),layout:gd},vd=new(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.possiblyEvaluate=function(t,n){return n=new No(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),e.prototype.possiblyEvaluate.call(this,t,n)},t.prototype.evaluate=function(t,n,r,i){return n=v({},n,{zoom:Math.floor(n.zoom)}),e.prototype.evaluate.call(this,t,n,r,i)},t}(Uo))(_d.paint.properties[`line-width`].specification);vd.useIntegerZoom=!0;var yd=function(e){function t(t){e.call(this,t,_d),this.gradientVersion=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){e===`line-gradient`&&(this.stepInterpolant=this._transitionablePaint._values[`line-gradient`].value.expression._styleExpression.expression instanceof br,this.gradientVersion=(this.gradientVersion+1)%l)},t.prototype.gradientExpression=function(){return this._transitionablePaint._values[`line-gradient`].value.expression},t.prototype.recalculate=function(t,n){e.prototype.recalculate.call(this,t,n),this.paint._values[`line-floorwidth`]=vd.possiblyEvaluate(this._transitioningPaint._values[`line-width`].value,t)},t.prototype.createBucket=function(e){return new hd(e)},t.prototype.queryRadius=function(e){var t=e,n=bd(Ic(`line-width`,this,t),Ic(`line-gap-width`,this,t)),r=Ic(`line-offset`,this,t);return n/2+Math.abs(r)+Lc(this.paint.get(`line-translate`))},t.prototype.queryIntersectsFeature=function(e,t,n,r,i,a,o){var s=Rc(e,this.paint.get(`line-translate`),this.paint.get(`line-translate-anchor`),a.angle,o),c=o/2*bd(this.paint.get(`line-width`).evaluate(t,n),this.paint.get(`line-gap-width`).evaluate(t,n)),l=this.paint.get(`line-offset`).evaluate(t,n);return l&&(r=xd(r,l*o)),Ec(s,r,c)},t.prototype.isTileClipped=function(){return!0},t}(Yo);function bd(e,t){return t>0?t+2*e:e}function xd(e,t){for(var n=[],r=new a(0,0),i=0;i<e.length;i++){for(var o=e[i],s=[],c=0;c<o.length;c++){var l=o[c-1],u=o[c],d=o[c+1],f=c===0?r:u.sub(l)._unit()._perp(),p=c===o.length-1?r:d.sub(u)._unit()._perp(),m=f._add(p)._unit(),h=m.x*p.x+m.y*p.y;m._mult(1/h),s.push(m._mult(t)._add(u))}n.push(s)}return n}var Sd=ts([{name:`a_pos_offset`,components:4,type:`Int16`},{name:`a_data`,components:4,type:`Uint16`},{name:`a_pixeloffset`,components:4,type:`Int16`}],4),Cd=ts([{name:`a_projected_pos`,components:3,type:`Float32`}],4);ts([{name:`a_fade_opacity`,components:1,type:`Uint32`}],4);var wd=ts([{name:`a_placed`,components:2,type:`Uint8`},{name:`a_shift`,components:2,type:`Float32`}]);ts([{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 Td=ts([{name:`a_pos`,components:2,type:`Int16`},{name:`a_anchor_pos`,components:2,type:`Int16`},{name:`a_extrude`,components:2,type:`Int16`}],4),Ed=ts([{name:`a_pos`,components:2,type:`Float32`},{name:`a_radius`,components:1,type:`Float32`},{name:`a_flags`,components:2,type:`Int16`}],4);ts([{name:`triangle`,components:3,type:`Uint16`}]),ts([{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`}]),ts([{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`}]),ts([{type:`Float32`,name:`offsetX`}]),ts([{type:`Int16`,name:`x`},{type:`Int16`,name:`y`},{type:`Int16`,name:`tileUnitDistanceFromAnchor`}]);function Dd(e,t,n){var r=t.layout.get(`text-transform`).evaluate(n,{});return r===`uppercase`?e=e.toLocaleUpperCase():r===`lowercase`&&(e=e.toLocaleLowerCase()),jo.applyArabicShaping&&(e=jo.applyArabicShaping(e)),e}function Od(e,t,n){return e.sections.forEach(function(e){e.text=Dd(e.text,t,n)}),e}function kd(e){var t={},n={},r=[],i=0;function a(t){r.push(e[t]),i++}function o(e,t,i){var a=n[e];return delete n[e],n[t]=a,r[a].geometry[0].pop(),r[a].geometry[0]=r[a].geometry[0].concat(i[0]),a}function s(e,n,i){var a=t[n];return delete t[n],t[e]=a,r[a].geometry[0].shift(),r[a].geometry[0]=i[0].concat(r[a].geometry[0]),a}function c(e,t,n){var r=n?t[0][t[0].length-1]:t[0][0];return e+`:`+r.x+`:`+r.y}for(var l=0;l<e.length;l++){var u=e[l],d=u.geometry,f=u.text?u.text.toString():null;if(!f){a(l);continue}var p=c(f,d),m=c(f,d,!0);if(p in n&&m in t&&n[p]!==t[m]){var h=s(p,m,d),g=o(p,m,r[h].geometry);delete t[p],delete n[m],n[c(f,r[g].geometry,!0)]=g,r[h].geometry=null}else p in n?o(p,m,d):m in t?s(p,m,d):(a(l),t[p]=i-1,n[m]=i-1)}return r.filter(function(e){return e.geometry})}var Ad={"!":`︕`,"#":``,$:``,"%":``,"&":``,"(":`︵`,")":`︶`,"*":``,"+":``,",":`︐`,"-":`︲`,".":`・`,"/":``,":":`︓`,";":`︔`,"<":`︿`,"=":``,">":`﹀`,"?":`︖`,"@":``,"[":`﹇`,"\\":``,"]":`﹈`,"^":``,_:`︳`,"`":``,"{":`︷`,"|":`―`,"}":`︸`,"~":``,"¢":`¢`,"£":`£`,"¥":`¥`,"¦":`¦`,"¬":`¬`,"¯":` ̄`,"":`︲`,"—":`︱`,"":`﹃`,"":`﹄`,"“":`﹁`,"”":`﹂`,"…":`︙`,"‧":`・`,"₩":`₩`,"、":`︑`,"。":`︒`,"〈":`︿`,"〉":`﹀`,"《":`︽`,"》":`︾`,"「":`﹁`,"」":`﹂`,"『":`﹃`,"』":`﹄`,"【":`︻`,"】":`︼`,"":`︹`,"":`︺`,"〖":`︗`,"〗":`︘`,"":`︕`,"":`︵`,"":`︶`,"":`︐`,"":`︲`,"":`・`,"":`︓`,"":`︔`,"":`︿`,"":`﹀`,"":`︖`,"":`﹇`,"":`﹈`,"_":`︳`,"":`︷`,"":`―`,"":`︸`,"⦅":`︵`,"⦆":`︶`,"。":`︒`,"「":`﹁`,"」":`﹂`};function jd(e){for(var t=``,n=0;n<e.length;n++){var r=e.charCodeAt(n+1)||null,i=e.charCodeAt(n-1)||null;(!r||!mo(r)||Ad[e[n+1]])&&(!i||!mo(i)||Ad[e[n-1]])&&Ad[e[n]]?t+=Ad[e[n]]:t+=e[n]}return t}var Md=24,Nd={read:function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else{if(a===c)return o?NaN:(p?-1:1)*(1/0);o+=2**r,a-=l}return(p?-1:1)*o*2**(a-r)},write:function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}},Pd=Fd;function Fd(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Fd.Varint=0,Fd.Fixed64=1,Fd.Bytes=2,Fd.Fixed32=5;var Id=65536*65536,Ld=1/Id,Rd=12,zd=typeof TextDecoder>`u`?null:new TextDecoder(`utf8`);Fd.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n||=this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,a=this.pos;this.type=r&7,e(i,t,this),this.pos===a&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=nf(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=af(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=nf(this.buf,this.pos)+nf(this.buf,this.pos+4)*Id;return this.pos+=8,e},readSFixed64:function(){var e=nf(this.buf,this.pos)+af(this.buf,this.pos+4)*Id;return this.pos+=8,e},readFloat:function(){var e=Nd.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Nd.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,n,r;return r=t[this.pos++],n=r&127,r<128||(r=t[this.pos++],n|=(r&127)<<7,r<128)||(r=t[this.pos++],n|=(r&127)<<14,r<128)||(r=t[this.pos++],n|=(r&127)<<21,r<128)?n:(r=t[this.pos],n|=(r&15)<<28,Bd(n,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=Rd&&zd?sf(this.buf,t,e):of(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Fd.Bytes)return e.push(this.readVarint(t));var n=Vd(this);for(e||=[];this.pos<n;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==Fd.Bytes)return e.push(this.readSVarint());var t=Vd(this);for(e||=[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Fd.Bytes)return e.push(this.readBoolean());var t=Vd(this);for(e||=[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Fd.Bytes)return e.push(this.readFloat());var t=Vd(this);for(e||=[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Fd.Bytes)return e.push(this.readDouble());var t=Vd(this);for(e||=[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Fd.Bytes)return e.push(this.readFixed32());var t=Vd(this);for(e||=[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Fd.Bytes)return e.push(this.readSFixed32());var t=Vd(this);for(e||=[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Fd.Bytes)return e.push(this.readFixed64());var t=Vd(this);for(e||=[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Fd.Bytes)return e.push(this.readSFixed64());var t=Vd(this);for(e||=[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=e&7;if(t===Fd.Varint)for(;this.buf[this.pos++]>127;);else if(t===Fd.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Fd.Fixed32)this.pos+=4;else if(t===Fd.Fixed64)this.pos+=8;else throw Error(`Unimplemented type: `+t)},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var n=new Uint8Array(t);n.set(this.buf),this.buf=n,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),rf(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),rf(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),rf(this.buf,e&-1,this.pos),rf(this.buf,Math.floor(e*Ld),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),rf(this.buf,e&-1,this.pos),rf(this.buf,Math.floor(e*Ld),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){Ud(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var t=this.pos;this.pos=cf(this.buf,e,this.pos);var n=this.pos-t;n>=128&&Kd(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(e){this.realloc(4),Nd.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Nd.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n<t;n++)this.buf[this.pos++]=e[n]},writeRawMessage:function(e,t){this.pos++;var n=this.pos;e(t,this);var r=this.pos-n;r>=128&&Kd(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,n){this.writeTag(e,Fd.Bytes),this.writeRawMessage(t,n)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,qd,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Jd,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Zd,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Yd,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Xd,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Qd,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,$d,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,ef,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,tf,t)},writeBytesField:function(e,t){this.writeTag(e,Fd.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Fd.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Fd.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Fd.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Fd.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Fd.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Fd.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Fd.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Fd.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Fd.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};function Bd(e,t,n){var r=n.buf,i,a;if(a=r[n.pos++],i=(a&112)>>4,a<128||(a=r[n.pos++],i|=(a&127)<<3,a<128)||(a=r[n.pos++],i|=(a&127)<<10,a<128)||(a=r[n.pos++],i|=(a&127)<<17,a<128)||(a=r[n.pos++],i|=(a&127)<<24,a<128)||(a=r[n.pos++],i|=(a&1)<<31,a<128))return Hd(e,i,t);throw Error(`Expected varint not more than 10 bytes`)}function Vd(e){return e.type===Fd.Bytes?e.readVarint()+e.pos:e.pos+1}function Hd(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Ud(e,t){var n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(n=~(-e%4294967296),r=~(-e/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw Error(`Given varint doesn't fit into 10 bytes`);t.realloc(10),Wd(n,r,t),Gd(r,t)}function Wd(e,t,n){n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos]=e&127}function Gd(e,t){var n=(e&7)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function Kd(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));n.realloc(r);for(var i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function qd(e,t){for(var n=0;n<e.length;n++)t.writeVarint(e[n])}function Jd(e,t){for(var n=0;n<e.length;n++)t.writeSVarint(e[n])}function Yd(e,t){for(var n=0;n<e.length;n++)t.writeFloat(e[n])}function Xd(e,t){for(var n=0;n<e.length;n++)t.writeDouble(e[n])}function Zd(e,t){for(var n=0;n<e.length;n++)t.writeBoolean(e[n])}function Qd(e,t){for(var n=0;n<e.length;n++)t.writeFixed32(e[n])}function $d(e,t){for(var n=0;n<e.length;n++)t.writeSFixed32(e[n])}function ef(e,t){for(var n=0;n<e.length;n++)t.writeFixed64(e[n])}function tf(e,t){for(var n=0;n<e.length;n++)t.writeSFixed64(e[n])}function nf(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function rf(e,t,n){e[n]=t,e[n+1]=t>>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function af(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function of(e,t,n){for(var r=``,i=t;i<n;){var a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s>n)break;var c,l,u;s===1?a<128&&(o=a):s===2?(c=e[i+1],(c&192)==128&&(o=(a&31)<<6|c&63,o<=127&&(o=null))):s===3?(c=e[i+1],l=e[i+2],(c&192)==128&&(l&192)==128&&(o=(a&15)<<12|(c&63)<<6|l&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):s===4&&(c=e[i+1],l=e[i+2],u=e[i+3],(c&192)==128&&(l&192)==128&&(u&192)==128&&(o=(a&15)<<18|(c&63)<<12|(l&63)<<6|u&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,s=1):o>65535&&(o-=65536,r+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),r+=String.fromCharCode(o),i+=s}return r}function sf(e,t,n){return zd.decode(e.subarray(t,n))}function cf(e,t,n){for(var r=0,i,a;r<t.length;r++){if(i=t.charCodeAt(r),i>55295&&i<57344)if(a)if(i<56320){e[n++]=239,e[n++]=191,e[n++]=189,a=i;continue}else i=a-55296<<10|i-56320|65536,a=null;else{i>56319||r+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):a=i;continue}else a&&=(e[n++]=239,e[n++]=191,e[n++]=189,null);i<128?e[n++]=i:(i<2048?e[n++]=i>>6|192:(i<65536?e[n++]=i>>12|224:(e[n++]=i>>18|240,e[n++]=i>>12&63|128),e[n++]=i>>6&63|128),e[n++]=i&63|128)}return n}var lf=3;function uf(e,t,n){e===1&&n.readMessage(df,t)}function df(e,t,n){if(e===3){var r=n.readMessage(ff,{}),i=r.id,a=r.bitmap,o=r.width,s=r.height,c=r.left,l=r.top,u=r.advance;t.push({id:i,bitmap:new kl({width:o+2*lf,height:s+2*lf},a),metrics:{width:o,height:s,left:c,top:l,advance:u}})}}function ff(e,t,n){e===1?t.id=n.readVarint():e===2?t.bitmap=n.readBytes():e===3?t.width=n.readVarint():e===4?t.height=n.readVarint():e===5?t.left=n.readSVarint():e===6?t.top=n.readSVarint():e===7&&(t.advance=n.readVarint())}function pf(e){return new Pd(e).readFields(uf,[])}var mf=lf;function hf(e){for(var t=0,n=0,r=0,i=e;r<i.length;r+=1){var a=i[r];t+=a.w*a.h,n=Math.max(n,a.w)}e.sort(function(e,t){return t.h-e.h});for(var o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),n),h:1/0}],s=0,c=0,l=0,u=e;l<u.length;l+=1)for(var d=u[l],f=o.length-1;f>=0;f--){var p=o[f];if(!(d.w>p.w||d.h>p.h)){if(d.x=p.x,d.y=p.y,c=Math.max(c,d.y+d.h),s=Math.max(s,d.x+d.w),d.w===p.w&&d.h===p.h){var m=o.pop();f<o.length&&(o[f]=m)}else d.h===p.h?(p.x+=d.w,p.w-=d.w):d.w===p.w?(p.y+=d.h,p.h-=d.h):(o.push({x:p.x+d.w,y:p.y,w:p.w-d.w,h:d.h}),p.y+=d.h,p.h-=d.h);break}}return{w:s,h:c,fill:t/(s*c)||0}}var gf=1,_f=function(e,t){var n=t.pixelRatio,r=t.version,i=t.stretchX,a=t.stretchY,o=t.content;this.paddedRect=e,this.pixelRatio=n,this.stretchX=i,this.stretchY=a,this.content=o,this.version=r},vf={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};vf.tl.get=function(){return[this.paddedRect.x+gf,this.paddedRect.y+gf]},vf.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-gf,this.paddedRect.y+this.paddedRect.h-gf]},vf.tlbr.get=function(){return this.tl.concat(this.br)},vf.displaySize.get=function(){return[(this.paddedRect.w-gf*2)/this.pixelRatio,(this.paddedRect.h-gf*2)/this.pixelRatio]},Object.defineProperties(_f.prototype,vf);var yf=function(e,t){var n={},r={};this.haveRenderCallbacks=[];var i=[];this.addImages(e,n,i),this.addImages(t,r,i);var a=hf(i),o=a.w,s=a.h,c=new Al({width:o||1,height:s||1});for(var l in e){var u=e[l],d=n[l].paddedRect;Al.copy(u.data,c,{x:0,y:0},{x:d.x+gf,y:d.y+gf},u.data)}for(var f in t){var p=t[f],m=r[f].paddedRect,h=m.x+gf,g=m.y+gf,_=p.data.width,v=p.data.height;Al.copy(p.data,c,{x:0,y:0},{x:h,y:g},p.data),Al.copy(p.data,c,{x:0,y:v-1},{x:h,y:g-1},{width:_,height:1}),Al.copy(p.data,c,{x:0,y:0},{x:h,y:g+v},{width:_,height:1}),Al.copy(p.data,c,{x:_-1,y:0},{x:h-1,y:g},{width:1,height:v}),Al.copy(p.data,c,{x:0,y:0},{x:h+_,y:g},{width:1,height:v})}this.image=c,this.iconPositions=n,this.patternPositions=r};yf.prototype.addImages=function(e,t,n){for(var r in e){var i=e[r],a={x:0,y:0,w:i.data.width+2*gf,h:i.data.height+2*gf};n.push(a),t[r]=new _f(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(r)}},yf.prototype.patchUpdatedImages=function(e,t){for(var n in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),t),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),t)},yf.prototype.patchUpdatedImage=function(e,t,n){if(!(!e||!t)&&e.version!==t.version){e.version=t.version;var r=e.tl,i=r[0],a=r[1];n.update(t.data,void 0,{x:i,y:a})}},$a(`ImagePosition`,_f),$a(`ImageAtlas`,yf);var bf={horizontal:1,vertical:2,horizontalOnly:3},xf=-17;function Sf(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].positionedGlyphs.length!==0)return!1;return!0}var Cf=57344,wf=63743,Tf=function(){this.scale=1,this.fontStack=``,this.imageName=null};Tf.forText=function(e,t){var n=new Tf;return n.scale=e||1,n.fontStack=t,n},Tf.forImage=function(e){var t=new Tf;return t.imageName=e,t};var Ef=function(){this.text=``,this.sectionIndex=[],this.sections=[],this.imageSectionID=null};Ef.fromFeature=function(e,t){for(var n=new Ef,r=0;r<e.sections.length;r++){var i=e.sections[r];i.image?n.addImageSection(i):n.addTextSection(i,t)}return n},Ef.prototype.length=function(){return this.text.length},Ef.prototype.getSection=function(e){return this.sections[this.sectionIndex[e]]},Ef.prototype.getSectionIndex=function(e){return this.sectionIndex[e]},Ef.prototype.getCharCode=function(e){return this.text.charCodeAt(e)},Ef.prototype.verticalizePunctuation=function(){this.text=jd(this.text)},Ef.prototype.trim=function(){for(var e=0,t=0;t<this.text.length&&kf[this.text.charCodeAt(t)];t++)e++;for(var n=this.text.length,r=this.text.length-1;r>=0&&r>=e&&kf[this.text.charCodeAt(r)];r--)n--;this.text=this.text.substring(e,n),this.sectionIndex=this.sectionIndex.slice(e,n)},Ef.prototype.substring=function(e,t){var n=new Ef;return n.text=this.text.substring(e,t),n.sectionIndex=this.sectionIndex.slice(e,t),n.sections=this.sections,n},Ef.prototype.toString=function(){return this.text},Ef.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce(function(t,n){return Math.max(t,e.sections[n].scale)},0)},Ef.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(Tf.forText(e.scale,e.fontStack||t));for(var n=this.sections.length-1,r=0;r<e.text.length;++r)this.sectionIndex.push(n)},Ef.prototype.addImageSection=function(e){var t=e.image?e.image.name:``;if(t.length===0){M(`Can't add FormattedSection with an empty image.`);return}var n=this.getNextImageSectionCharCode();if(!n){M(`Reached maximum number of images `+(wf-Cf+2));return}this.text+=String.fromCharCode(n),this.sections.push(Tf.forImage(t)),this.sectionIndex.push(this.sections.length-1)},Ef.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=wf?null:++this.imageSectionID:(this.imageSectionID=Cf,this.imageSectionID)};function Df(e,t){for(var n=[],r=e.text,i=0,a=0,o=t;a<o.length;a+=1){var s=o[a];n.push(e.substring(i,s)),i=s}return i<r.length&&n.push(e.substring(i,r.length)),n}function Of(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g=Ef.fromFeature(e,i);d===bf.vertical&&g.verticalizePunctuation();var _,v=jo.processBidirectionalText,y=jo.processStyledBidirectionalText;if(v&&g.sections.length===1){_=[];for(var b=v(g.toString(),Lf(g,l,a,t,r,p,m)),x=0,S=b;x<S.length;x+=1){var C=S[x],w=new Ef;w.text=C,w.sections=g.sections;for(var T=0;T<C.length;T++)w.sectionIndex.push(0);_.push(w)}}else if(y){_=[];for(var E=y(g.text,g.sectionIndex,Lf(g,l,a,t,r,p,m)),D=0,O=E;D<O.length;D+=1){var k=O[D],A=new Ef;A.text=k[0],A.sectionIndex=k[1],A.sections=g.sections,_.push(A)}}else _=Df(g,Lf(g,l,a,t,r,p,m));var j=[],M={positionedLines:j,text:g.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:d,iconsInText:!1,verticalizable:!1};return zf(M,t,n,r,_,o,s,c,d,l,f,h),Sf(j)?!1:M}var kf={};kf[9]=!0,kf[10]=!0,kf[11]=!0,kf[12]=!0,kf[13]=!0,kf[32]=!0;var Af={};Af[10]=!0,Af[32]=!0,Af[38]=!0,Af[40]=!0,Af[41]=!0,Af[43]=!0,Af[45]=!0,Af[47]=!0,Af[173]=!0,Af[183]=!0,Af[8203]=!0,Af[8208]=!0,Af[8211]=!0,Af[8231]=!0;function jf(e,t,n,r,i,a){if(t.imageName){var o=r[t.imageName];return o?o.displaySize[0]*t.scale*Md/a+i:0}else{var s=n[t.fontStack],c=s&&s[e];return c?c.metrics.advance*t.scale+i:0}}function Mf(e,t,n,r,i,a){for(var o=0,s=0;s<e.length();s++){var c=e.getSection(s);o+=jf(e.getCharCode(s),c,r,i,t,a)}var l=Math.max(1,Math.ceil(o/n));return o/l}function Nf(e,t,n,r){var i=(e-t)**2;return r?e<t?i/2:i*2:i+Math.abs(n)*n}function Pf(e,t,n){var r=0;return e===10&&(r-=1e4),n&&(r+=150),(e===40||e===65288)&&(r+=50),(t===41||t===65289)&&(r+=50),r}function Ff(e,t,n,r,i,a){for(var o=null,s=Nf(t,n,i,a),c=0,l=r;c<l.length;c+=1){var u=l[c],d=Nf(t-u.x,n,i,a)+u.badness;d<=s&&(o=u,s=d)}return{index:e,x:t,priorBreak:o,badness:s}}function If(e){return e?If(e.priorBreak).concat(e.index):[]}function Lf(e,t,n,r,i,a,o){if(a!==`point`||!e)return[];for(var s=[],c=Mf(e,t,n,r,i,o),l=e.text.indexOf(``)>=0,u=0,d=0;d<e.length();d++){var f=e.getSection(d),p=e.getCharCode(d);if(kf[p]||(u+=jf(p,f,r,i,t,o)),d<e.length()-1){var m=uo(p);(Af[p]||m||f.imageName)&&s.push(Ff(d+1,u,c,s,Pf(p,e.getCharCode(d+1),m&&l),!1))}}return If(Ff(e.length(),u,c,s,0,!0))}function Rf(e){var t=.5,n=.5;switch(e){case`right`:case`top-right`:case`bottom-right`:t=1;break;case`left`:case`top-left`:case`bottom-left`:t=0;break}switch(e){case`bottom`:case`bottom-right`:case`bottom-left`:n=1;break;case`top`:case`top-right`:case`top-left`:n=0;break}return{horizontalAlign:t,verticalAlign:n}}function zf(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=0,p=xf,m=0,h=0,g=s===`right`?1:s===`left`?0:.5,_=0,v=0,y=i;v<y.length;v+=1){var b=y[v];b.trim();var x=b.getMaxScale(),S=(x-1)*Md,C={positionedGlyphs:[],lineOffset:0};e.positionedLines[_]=C;var w=C.positionedGlyphs,T=0;if(!b.length()){p+=a,++_;continue}for(var E=0;E<b.length();E++){var D=b.getSection(E),O=b.getSectionIndex(E),k=b.getCharCode(E),A=0,j=null,M=null,N=null,P=Md,F=!(c===bf.horizontal||!u&&!fo(k)||u&&(kf[k]||ho(k)));if(D.imageName){var I=r[D.imageName];if(!I)continue;N=D.imageName,e.iconsInText=e.iconsInText||!0,M=I.paddedRect;var L=I.displaySize;D.scale=D.scale*Md/d,j={width:L[0],height:L[1],left:gf,top:-mf,advance:F?L[1]:L[0]},A=S+(Md-L[1]*D.scale),P=j.advance;var R=F?L[0]*D.scale-Md*x:L[1]*D.scale-Md*x;R>0&&R>T&&(T=R)}else{var z=n[D.fontStack],B=z&&z[k];if(B&&B.rect)M=B.rect,j=B.metrics;else{var V=t[D.fontStack],H=V&&V[k];if(!H)continue;j=H.metrics}A=(x-D.scale)*Md}F?(e.verticalizable=!0,w.push({glyph:k,imageName:N,x:f,y:p+A,vertical:F,scale:D.scale,fontStack:D.fontStack,sectionIndex:O,metrics:j,rect:M}),f+=P*D.scale+l):(w.push({glyph:k,imageName:N,x:f,y:p+A,vertical:F,scale:D.scale,fontStack:D.fontStack,sectionIndex:O,metrics:j,rect:M}),f+=j.advance*D.scale+l)}if(w.length!==0){var U=f-l;m=Math.max(U,m),Bf(w,0,w.length-1,g,T)}f=0;var W=a*x+T;C.lineOffset=Math.max(T,S),p+=W,h=Math.max(W,h),++_}var G=p-xf,K=Rf(o),q=K.horizontalAlign,J=K.verticalAlign;Vf(e.positionedLines,g,q,J,m,h,a,G,i.length),e.top+=-J*G,e.bottom=e.top+G,e.left+=-q*m,e.right=e.left+m}function Bf(e,t,n,r,i){if(!(!r&&!i))for(var a=e[n],o=a.metrics.advance*a.scale,s=(e[n].x+o)*r,c=t;c<=n;c++)e[c].x-=s,e[c].y+=i}function Vf(e,t,n,r,i,a,o,s,c){var l=(t-n)*i,u=0;u=a===o?(-r*c+.5)*o:-s*r-xf;for(var d=0,f=e;d<f.length;d+=1)for(var p=f[d],m=0,h=p.positionedGlyphs;m<h.length;m+=1){var g=h[m];g.x+=l,g.y+=u}}function Hf(e,t,n){var r=Rf(n),i=r.horizontalAlign,a=r.verticalAlign,o=t[0],s=t[1],c=o-e.displaySize[0]*i,l=c+e.displaySize[0],u=s-e.displaySize[1]*a;return{image:e,top:u,bottom:u+e.displaySize[1],left:c,right:l}}function Uf(e,t,n,r,i,a){var o=e.image,s;if(o.content){var c=o.content,l=o.pixelRatio||1;s=[c[0]/l,c[1]/l,o.displaySize[0]-c[2]/l,o.displaySize[1]-c[3]/l]}var u=t.left*a,d=t.right*a,f,p,m,h;n===`width`||n===`both`?(h=i[0]+u-r[3],p=i[0]+d+r[1]):(h=i[0]+(u+d-o.displaySize[0])/2,p=h+o.displaySize[0]);var g=t.top*a,_=t.bottom*a;return n===`height`||n===`both`?(f=i[1]+g-r[0],m=i[1]+_+r[2]):(f=i[1]+(g+_-o.displaySize[1])/2,m=f+o.displaySize[1]),{image:o,top:f,right:p,bottom:m,left:h,collisionPadding:s}}var Wf=function(e){function t(t,n,r,i){e.call(this,t,n),this.angle=r,i!==void 0&&(this.segment=i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t}(a);$a(`Anchor`,Wf);var Gf=128;function Kf(e,t){var n=t.expression;if(n.kind===`constant`)return{kind:`constant`,layoutSize:n.evaluate(new No(e+1))};if(n.kind===`source`)return{kind:`source`};for(var r=n.zoomStops,i=n.interpolationType,a=0;a<r.length&&r[a]<=e;)a++;a=Math.max(0,a-1);for(var o=a;o<r.length&&r[o]<e+1;)o++;o=Math.min(r.length-1,o);var s=r[a],c=r[o];return n.kind===`composite`?{kind:`composite`,minZoom:s,maxZoom:c,interpolationType:i}:{kind:`camera`,minZoom:s,maxZoom:c,minSize:n.evaluate(new No(s)),maxSize:n.evaluate(new No(c)),interpolationType:i}}function qf(e,t,n){var r=t.uSize,i=t.uSizeT,a=n.lowerSize,o=n.upperSize;return e.kind===`source`?a/Gf:e.kind===`composite`?xr(a/Gf,o/Gf,i):r}function Jf(e,t){var n=0,r=0;if(e.kind===`constant`)r=e.layoutSize;else if(e.kind!==`source`){var i=e.interpolationType,a=e.minZoom,o=e.maxZoom,s=i?p(Jr.interpolationFactor(i,t,a,o),0,1):0;e.kind===`camera`?r=xr(e.minSize,e.maxSize,s):n=s}return{uSizeT:n,uSize:r}}var Yf=Object.freeze({__proto__:null,getSizeData:Kf,evaluateSizeForFeature:qf,evaluateSizeForZoom:Jf,SIZE_PACK_FACTOR:Gf});function Xf(e,t,n,r,i){if(t.segment===void 0)return!0;for(var a=t,o=t.segment+1,s=0;s>-n/2;){if(o--,o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;for(var c=[],l=0;s<n/2;){var u=e[o-1],d=e[o],f=e[o+1];if(!f)return!1;var p=u.angleTo(d)-d.angleTo(f);for(p=Math.abs((p+3*Math.PI)%(Math.PI*2)-Math.PI),c.push({distance:s,angleDelta:p}),l+=p;s-c[0].distance>r;)l-=c.shift().angleDelta;if(l>i)return!1;o++,s+=d.dist(f)}return!0}function Zf(e){for(var t=0,n=0;n<e.length-1;n++)t+=e[n].dist(e[n+1]);return t}function Qf(e,t,n){return e?3/5*t*n:0}function $f(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function ep(e,t,n,r,i,a){for(var o=Qf(n,i,a),s=$f(n,r)*a,c=0,l=Zf(e)/2,u=0;u<e.length-1;u++){var d=e[u],f=e[u+1],p=d.dist(f);if(c+p>l){var m=(l-c)/p,h=new Wf(xr(d.x,f.x,m),xr(d.y,f.y,m),f.angleTo(d),u);return h._round(),!o||Xf(e,h,s,o,t)?h:void 0}c+=p}}function tp(e,t,n,r,i,a,o,s,c){var l=Qf(r,a,o),u=$f(r,i),d=u*o,f=e[0].x===0||e[0].x===c||e[0].y===0||e[0].y===c;t-d<t/4&&(t=d+t/4);var p=a*2;return np(e,f?t/2*s%t:(u/2+p)*o*s%t,t,l,n,d,f,!1,c)}function np(e,t,n,r,i,a,o,s,c){for(var l=a/2,u=Zf(e),d=0,f=t-n,p=[],m=0;m<e.length-1;m++){for(var h=e[m],g=e[m+1],_=h.dist(g),v=g.angleTo(h);f+n<d+_;){f+=n;var y=(f-d)/_,b=xr(h.x,g.x,y),x=xr(h.y,g.y,y);if(b>=0&&b<c&&x>=0&&x<c&&f-l>=0&&f+l<=u){var S=new Wf(b,x,v,m);S._round(),(!r||Xf(e,S,a,r,i))&&p.push(S)}}d+=_}return!s&&!p.length&&!o&&(p=np(e,d/2,n,r,i,a,o,!0,c)),p}function rp(e,t,n,r,i){for(var o=[],s=0;s<e.length;s++)for(var c=e[s],l=void 0,u=0;u<c.length-1;u++){var d=c[u],f=c[u+1];d.x<t&&f.x<t||(d.x<t?d=new a(t,d.y+(f.y-d.y)*((t-d.x)/(f.x-d.x)))._round():f.x<t&&(f=new a(t,d.y+(f.y-d.y)*((t-d.x)/(f.x-d.x)))._round()),!(d.y<n&&f.y<n)&&(d.y<n?d=new a(d.x+(f.x-d.x)*((n-d.y)/(f.y-d.y)),n)._round():f.y<n&&(f=new a(d.x+(f.x-d.x)*((n-d.y)/(f.y-d.y)),n)._round()),!(d.x>=r&&f.x>=r)&&(d.x>=r?d=new a(r,d.y+(f.y-d.y)*((r-d.x)/(f.x-d.x)))._round():f.x>=r&&(f=new a(r,d.y+(f.y-d.y)*((r-d.x)/(f.x-d.x)))._round()),!(d.y>=i&&f.y>=i)&&(d.y>=i?d=new a(d.x+(f.x-d.x)*((i-d.y)/(f.y-d.y)),i)._round():f.y>=i&&(f=new a(d.x+(f.x-d.x)*((i-d.y)/(f.y-d.y)),i)._round()),(!l||!d.equals(l[l.length-1]))&&(l=[d],o.push(l)),l.push(f)))))}return o}var ip=gf;function ap(e,t,n,r){var i=[],o=e.image,s=o.pixelRatio,c=o.paddedRect.w-2*ip,l=o.paddedRect.h-2*ip,u=e.right-e.left,d=e.bottom-e.top,f=o.stretchX||[[0,c]],p=o.stretchY||[[0,l]],m=function(e,t){return e+t[1]-t[0]},h=f.reduce(m,0),g=p.reduce(m,0),_=c-h,v=l-g,y=0,b=h,x=0,S=g,C=0,w=_,T=0,E=v;if(o.content&&r){var D=o.content;y=op(f,0,D[0]),x=op(p,0,D[1]),b=op(f,D[0],D[2]),S=op(p,D[1],D[3]),C=D[0]-y,T=D[1]-x,w=D[2]-D[0]-b,E=D[3]-D[1]-S}var O=function(r,i,c,l){var f=cp(r.stretch-y,b,u,e.left),p=lp(r.fixed-C,w,r.stretch,h),m=cp(i.stretch-x,S,d,e.top),_=lp(i.fixed-T,E,i.stretch,g),v=cp(c.stretch-y,b,u,e.left),D=lp(c.fixed-C,w,c.stretch,h),O=cp(l.stretch-x,S,d,e.top),k=lp(l.fixed-T,E,l.stretch,g),A=new a(f,m),j=new a(v,m),M=new a(v,O),N=new a(f,O),P=new a(p/s,_/s),F=new a(D/s,k/s),I=t*Math.PI/180;if(I){var L=Math.sin(I),R=Math.cos(I),z=[R,-L,L,R];A._matMult(z),j._matMult(z),N._matMult(z),M._matMult(z)}var B=r.stretch+r.fixed,V=c.stretch+c.fixed,H=i.stretch+i.fixed,U=l.stretch+l.fixed;return{tl:A,tr:j,bl:N,br:M,tex:{x:o.paddedRect.x+ip+B,y:o.paddedRect.y+ip+H,w:V-B,h:U-H},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:P,pixelOffsetBR:F,minFontScaleX:w/s/u,minFontScaleY:E/s/d,isSDF:n}};if(!r||!o.stretchX&&!o.stretchY)i.push(O({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:c+1},{fixed:0,stretch:l+1}));else for(var k=sp(f,_,h),A=sp(p,v,g),j=0;j<k.length-1;j++)for(var M=k[j],N=k[j+1],P=0;P<A.length-1;P++){var F=A[P],I=A[P+1];i.push(O(M,F,N,I))}return i}function op(e,t,n){for(var r=0,i=0,a=e;i<a.length;i+=1){var o=a[i];r+=Math.max(t,Math.min(n,o[1]))-Math.max(t,Math.min(n,o[0]))}return r}function sp(e,t,n){for(var r=[{fixed:-ip,stretch:0}],i=0,a=e;i<a.length;i+=1){var o=a[i],s=o[0],c=o[1],l=r[r.length-1];r.push({fixed:s-l.stretch,stretch:l.stretch}),r.push({fixed:s-l.stretch,stretch:l.stretch+(c-s)})}return r.push({fixed:t+ip,stretch:n}),r}function cp(e,t,n,r){return e/t*n+r}function lp(e,t,n,r){return e-t*n/r}function up(e,t,n,r,i,o,s,c){for(var l=r.layout.get(`text-rotate`).evaluate(o,{})*Math.PI/180,u=[],d=0,f=t.positionedLines;d<f.length;d+=1)for(var p=f[d],m=0,h=p.positionedGlyphs;m<h.length;m+=1){var g=h[m];if(g.rect){var _=g.rect||{},v=mf+1,y=!0,b=1,x=0,S=(i||c)&&g.vertical,C=g.metrics.advance*g.scale/2;if(c&&t.verticalizable){var w=(g.scale-1)*Md,T=(Md-g.metrics.width*g.scale)/2;x=p.lineOffset/2-(g.imageName?-T:w)}if(g.imageName){var E=s[g.imageName];y=E.sdf,b=E.pixelRatio,v=gf/b}var D=i?[g.x+C,g.y]:[0,0],O=i?[0,0]:[g.x+C+n[0],g.y+n[1]-x],k=[0,0];S&&(k=O,O=[0,0]);var A=(g.metrics.left-v)*g.scale-C+O[0],j=(-g.metrics.top-v)*g.scale+O[1],M=A+_.w*g.scale/b,N=j+_.h*g.scale/b,P=new a(A,j),F=new a(M,j),I=new a(A,N),L=new a(M,N);if(S){var R=new a(-C,C-xf),z=-Math.PI/2,B=Md/2-C,V=g.imageName?B:0,H=new a(5-xf-B,-V),U=new(Function.prototype.bind.apply(a,[null].concat(k)));P._rotateAround(z,R)._add(H)._add(U),F._rotateAround(z,R)._add(H)._add(U),I._rotateAround(z,R)._add(H)._add(U),L._rotateAround(z,R)._add(H)._add(U)}if(l){var W=Math.sin(l),G=Math.cos(l),K=[G,-W,W,G];P._matMult(K),F._matMult(K),I._matMult(K),L._matMult(K)}var q=new a(0,0),J=new a(0,0);u.push({tl:P,tr:F,bl:I,br:L,tex:_,writingMode:t.writingMode,glyphOffset:D,sectionIndex:g.sectionIndex,isSDF:y,pixelOffsetTL:q,pixelOffsetBR:J,minFontScaleX:0,minFontScaleY:0})}}return u}var dp=function(e,t,n,r,i,o,s,c,l,u){if(this.boxStartIndex=e.length,l){var d=o.top,f=o.bottom,p=o.collisionPadding;p&&(d-=p[1],f+=p[3]);var m=f-d;m>0&&(m=Math.max(10,m),this.circleDiameter=m)}else{var h=o.top*s-c,g=o.bottom*s+c,_=o.left*s-c,v=o.right*s+c,y=o.collisionPadding;if(y&&(_-=y[0]*s,h-=y[1]*s,v+=y[2]*s,g+=y[3]*s),u){var b=new a(_,h),x=new a(v,h),S=new a(_,g),C=new a(v,g),w=u*Math.PI/180;b._rotate(w),x._rotate(w),S._rotate(w),C._rotate(w),_=Math.min(b.x,x.x,S.x,C.x),v=Math.max(b.x,x.x,S.x,C.x),h=Math.min(b.y,x.y,S.y,C.y),g=Math.max(b.y,x.y,S.y,C.y)}e.emplaceBack(t.x,t.y,_,h,v,g,n,r,i)}this.boxEndIndex=e.length},fp=function(e,t){if(e===void 0&&(e=[]),t===void 0&&(t=pp),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)};fp.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},fp.prototype.pop=function(){if(this.length!==0){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},fp.prototype.peek=function(){return this.data[0]},fp.prototype._up=function(e){for(var t=this,n=t.data,r=t.compare,i=n[e];e>0;){var a=e-1>>1,o=n[a];if(r(i,o)>=0)break;n[e]=o,e=a}n[e]=i},fp.prototype._down=function(e){for(var t=this,n=t.data,r=t.compare,i=this.length>>1,a=n[e];e<i;){var o=(e<<1)+1,s=n[o],c=o+1;if(c<this.length&&r(n[c],s)<0&&(o=c,s=n[c]),r(s,a)>=0)break;n[e]=s,e=o}n[e]=a};function pp(e,t){return e<t?-1:e>t?1:0}function mp(e,t,n){t===void 0&&(t=1),n===void 0&&(n=!1);for(var r=1/0,i=1/0,o=-1/0,s=-1/0,c=e[0],l=0;l<c.length;l++){var u=c[l];(!l||u.x<r)&&(r=u.x),(!l||u.y<i)&&(i=u.y),(!l||u.x>o)&&(o=u.x),(!l||u.y>s)&&(s=u.y)}var d=o-r,f=s-i,p=Math.min(d,f),m=p/2,h=new fp([],hp);if(p===0)return new a(r,i);for(var g=r;g<o;g+=p)for(var _=i;_<s;_+=p)h.push(new gp(g+m,_+m,m,e));for(var v=vp(e),y=h.length;h.length;){var b=h.pop();(b.d>v.d||!v.d)&&(v=b,n&&console.log(`found best %d after %d probes`,Math.round(1e4*b.d)/1e4,y)),!(b.max-v.d<=t)&&(m=b.h/2,h.push(new gp(b.p.x-m,b.p.y-m,m,e)),h.push(new gp(b.p.x+m,b.p.y-m,m,e)),h.push(new gp(b.p.x-m,b.p.y+m,m,e)),h.push(new gp(b.p.x+m,b.p.y+m,m,e)),y+=4)}return n&&(console.log(`num probes: `+y),console.log(`best distance: `+v.d)),v.p}function hp(e,t){return t.max-e.max}function gp(e,t,n,r){this.p=new a(e,t),this.h=n,this.d=_p(this.p,r),this.max=this.d+this.h*Math.SQRT2}function _p(e,t){for(var n=!1,r=1/0,i=0;i<t.length;i++)for(var a=t[i],o=0,s=a.length,c=s-1;o<s;c=o++){var l=a[o],u=a[c];l.y>e.y!=u.y>e.y&&e.x<(u.x-l.x)*(e.y-l.y)/(u.y-l.y)+l.x&&(n=!n),r=Math.min(r,jc(e,l,u))}return(n?1:-1)*Math.sqrt(r)}function vp(e){for(var t=0,n=0,r=0,i=e[0],a=0,o=i.length,s=o-1;a<o;s=a++){var c=i[a],l=i[s],u=c.x*l.y-l.x*c.y;n+=(c.x+l.x)*u,r+=(c.y+l.y)*u,t+=u*3}return new gp(n/t,r/t,0,e)}var yp=7,bp=1/0;function xp(e,t){function n(e,t){var n=0,r=0;t<0&&(t=0);var i=t/Math.sqrt(2);switch(e){case`top-right`:case`top-left`:r=i-yp;break;case`bottom-right`:case`bottom-left`:r=-i+yp;break;case`bottom`:r=-t+yp;break;case`top`:r=t-yp;break}switch(e){case`top-right`:case`bottom-right`:n=-i;break;case`top-left`:case`bottom-left`:n=i;break;case`left`:n=t;break;case`right`:n=-t;break}return[n,r]}function r(e,t,n){var r=0,i=0;switch(t=Math.abs(t),n=Math.abs(n),e){case`top-right`:case`top-left`:case`top`:i=n-yp;break;case`bottom-right`:case`bottom-left`:case`bottom`:i=-n+yp;break}switch(e){case`top-right`:case`bottom-right`:case`right`:r=-t;break;case`top-left`:case`bottom-left`:case`left`:r=t;break}return[r,i]}return t[1]===bp?n(e,t[0]):r(e,t[0],t[1])}function Sp(e,t,n,r,i,a,o){e.createArrays(),e.tilePixelRatio=gc/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var s=e.layers[0].layout,c=e.layers[0]._unevaluatedLayout._values,l={};if(e.textSizeData.kind===`composite`){var u=e.textSizeData,d=u.minZoom,f=u.maxZoom;l.compositeTextSizes=[c[`text-size`].possiblyEvaluate(new No(d),o),c[`text-size`].possiblyEvaluate(new No(f),o)]}if(e.iconSizeData.kind===`composite`){var p=e.iconSizeData,m=p.minZoom,h=p.maxZoom;l.compositeIconSizes=[c[`icon-size`].possiblyEvaluate(new No(m),o),c[`icon-size`].possiblyEvaluate(new No(h),o)]}l.layoutTextSize=c[`text-size`].possiblyEvaluate(new No(e.zoom+1),o),l.layoutIconSize=c[`icon-size`].possiblyEvaluate(new No(e.zoom+1),o),l.textMaxSize=c[`text-size`].possiblyEvaluate(new No(18));for(var g=s.get(`text-line-height`)*Md,_=s.get(`text-rotation-alignment`)===`map`&&s.get(`symbol-placement`)!==`point`,v=s.get(`text-keep-upright`),y=s.get(`text-size`),b=function(){var a=S[x],c=s.get(`text-font`).evaluate(a,{},o).join(`,`),u=y.evaluate(a,{},o),d=l.layoutTextSize.evaluate(a,{},o),f=l.layoutIconSize.evaluate(a,{},o),p={horizontal:{},vertical:void 0},m=a.text,h=[0,0];if(m){var b=m.toString(),C=s.get(`text-letter-spacing`).evaluate(a,{},o)*Md,w=co(b)?C:0,T=s.get(`text-anchor`).evaluate(a,{},o),E=s.get(`text-variable-anchor`);if(!E){var D=s.get(`text-radial-offset`).evaluate(a,{},o);h=D?xp(T,[D*Md,bp]):s.get(`text-offset`).evaluate(a,{},o).map(function(e){return e*Md})}var O=_?`center`:s.get(`text-justify`).evaluate(a,{},o),k=s.get(`symbol-placement`),A=k===`point`?s.get(`text-max-width`).evaluate(a,{},o)*Md:0,j=function(){e.allowVerticalPlacement&&so(b)&&(p.vertical=Of(m,t,n,i,c,A,g,T,`left`,w,h,bf.vertical,!0,k,d,u))};if(!_&&E){for(var N=O===`auto`?E.map(function(e){return Cp(e)}):[O],P=!1,F=0;F<N.length;F++){var I=N[F];if(!p.horizontal[I])if(P)p.horizontal[I]=p.horizontal[0];else{var L=Of(m,t,n,i,c,A,g,`center`,I,w,h,bf.horizontal,!1,k,d,u);L&&(p.horizontal[I]=L,P=L.positionedLines.length===1)}}j()}else{O===`auto`&&(O=Cp(T));var R=Of(m,t,n,i,c,A,g,T,O,w,h,bf.horizontal,!1,k,d,u);R&&(p.horizontal[O]=R),j(),so(b)&&_&&v&&(p.vertical=Of(m,t,n,i,c,A,g,T,O,w,h,bf.vertical,!1,k,d,u))}}var z=void 0,B=!1;if(a.icon&&a.icon.name){var V=r[a.icon.name];V&&(z=Hf(i[a.icon.name],s.get(`icon-offset`).evaluate(a,{},o),s.get(`icon-anchor`).evaluate(a,{},o)),B=V.sdf,e.sdfIcons===void 0?e.sdfIcons=V.sdf:e.sdfIcons!==V.sdf&&M(`Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer`),(V.pixelRatio!==e.pixelRatio||s.get(`icon-rotate`).constantOr(1)!==0)&&(e.iconsNeedLinear=!0))}var H=Op(p.horizontal)||p.vertical;e.iconsInText=H?H.iconsInText:!1,(H||z)&&wp(e,a,p,z,r,l,d,f,h,B,o)},x=0,S=e.features;x<S.length;x+=1)b();a&&e.generateCollisionDebugBuffers()}function Cp(e){switch(e){case`right`:case`top-right`:case`bottom-right`:return`right`;case`left`:case`top-left`:case`bottom-left`:return`left`}return`center`}function wp(e,t,n,r,i,a,o,s,c,l,u){var d=a.textMaxSize.evaluate(t,{});d===void 0&&(d=o);var f=e.layers[0].layout,p=f.get(`icon-offset`).evaluate(t,{},u),m=Op(n.horizontal),h=24,g=o/h,_=e.tilePixelRatio*g,v=e.tilePixelRatio*d/h,y=e.tilePixelRatio*s,b=e.tilePixelRatio*f.get(`symbol-spacing`),x=f.get(`text-padding`)*e.tilePixelRatio,S=f.get(`icon-padding`)*e.tilePixelRatio,C=f.get(`text-max-angle`)/180*Math.PI,w=f.get(`text-rotation-alignment`)===`map`&&f.get(`symbol-placement`)!==`point`,T=f.get(`icon-rotation-alignment`)===`map`&&f.get(`symbol-placement`)!==`point`,E=f.get(`symbol-placement`),D=b/2,O=f.get(`icon-text-fit`),k;r&&O!==`none`&&(e.allowVerticalPlacement&&n.vertical&&(k=Uf(r,n.vertical,O,f.get(`icon-text-fit-padding`),p,g)),m&&(r=Uf(r,m,O,f.get(`icon-text-fit-padding`),p,g)));var A=function(s,d){d.x<0||d.x>=gc||d.y<0||d.y>=gc||kp(e,d,s,n,r,i,k,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,_,x,w,c,y,S,T,p,t,a,l,u,o)};if(E===`line`)for(var j=0,M=rp(t.geometry,0,0,gc,gc);j<M.length;j+=1)for(var N=M[j],P=tp(N,b,C,n.vertical||m,r,h,v,e.overscaling,gc),F=0,I=P;F<I.length;F+=1){var L=I[F],R=m;(!R||!Ap(e,R.text,D,L))&&A(N,L)}else if(E===`line-center`)for(var z=0,B=t.geometry;z<B.length;z+=1){var V=B[z];if(V.length>1){var H=ep(V,C,n.vertical||m,r,h,v);H&&A(V,H)}}else if(t.type===`Polygon`)for(var U=0,W=xu(t.geometry,0);U<W.length;U+=1){var G=W[U],K=mp(G,16);A(G[0],new Wf(K.x,K.y,0))}else if(t.type===`LineString`)for(var q=0,J=t.geometry;q<J.length;q+=1){var Y=J[q];A(Y,new Wf(Y[0].x,Y[0].y,0))}else if(t.type===`Point`)for(var X=0,Z=t.geometry;X<Z.length;X+=1)for(var Q=Z[X],ee=0,te=Q;ee<te.length;ee+=1){var ne=te[ee];A([ne],new Wf(ne.x,ne.y,0))}}var Tp=255,Ep=Tp*Gf;function Dp(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){var h=up(t,n,s,i,a,o,r,e.allowVerticalPlacement),g=e.textSizeData,_=null;g.kind===`source`?(_=[Gf*i.layout.get(`text-size`).evaluate(o,{})],_[0]>Ep&&M(e.layerIds[0]+`: Value for "text-size" is >= `+Tp+`. Reduce your "text-size".`)):g.kind===`composite`&&(_=[Gf*p.compositeTextSizes[0].evaluate(o,{},m),Gf*p.compositeTextSizes[1].evaluate(o,{},m)],(_[0]>Ep||_[1]>Ep)&&M(e.layerIds[0]+`: Value for "text-size" is >= `+Tp+`. Reduce your "text-size".`)),e.addSymbols(e.text,h,_,s,a,o,l,t,c.lineStartIndex,c.lineLength,f,m);for(var v=0,y=u;v<y.length;v+=1){var b=y[v];d[b]=e.text.placedSymbolArray.length-1}return h.length*4}function Op(e){for(var t in e)return e[t];return null}function kp(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w){var T,E=e.addToLineVertexArray(t,n),D,O,k,A,j=0,N=0,P=0,F=0,I=-1,L=-1,R={},z=Hs(``),B=0,V=0;if(s._unevaluatedLayout.getValue(`text-radial-offset`)===void 0?(T=s.layout.get(`text-offset`).evaluate(b,{},C).map(function(e){return e*Md}),B=T[0],V=T[1]):(B=s.layout.get(`text-radial-offset`).evaluate(b,{},C)*Md,V=bp),e.allowVerticalPlacement&&r.vertical){var H=s.layout.get(`text-rotate`).evaluate(b,{},C)+90,U=r.vertical;k=new dp(c,t,l,u,d,U,f,p,m,H),o&&(A=new dp(c,t,l,u,d,o,g,_,m,H))}if(i){var W=s.layout.get(`icon-rotate`).evaluate(b,{}),G=s.layout.get(`icon-text-fit`)!==`none`,K=ap(i,W,S,G),q=o?ap(o,W,S,G):void 0;O=new dp(c,t,l,u,d,i,g,_,!1,W),j=K.length*4;var J=e.iconSizeData,Y=null;J.kind===`source`?(Y=[Gf*s.layout.get(`icon-size`).evaluate(b,{})],Y[0]>Ep&&M(e.layerIds[0]+`: Value for "icon-size" is >= `+Tp+`. Reduce your "icon-size".`)):J.kind===`composite`&&(Y=[Gf*x.compositeIconSizes[0].evaluate(b,{},C),Gf*x.compositeIconSizes[1].evaluate(b,{},C)],(Y[0]>Ep||Y[1]>Ep)&&M(e.layerIds[0]+`: Value for "icon-size" is >= `+Tp+`. Reduce your "icon-size".`)),e.addSymbols(e.icon,K,Y,y,v,b,!1,t,E.lineStartIndex,E.lineLength,-1,C),I=e.icon.placedSymbolArray.length-1,q&&(N=q.length*4,e.addSymbols(e.icon,q,Y,y,v,b,bf.vertical,t,E.lineStartIndex,E.lineLength,-1,C),L=e.icon.placedSymbolArray.length-1)}for(var X in r.horizontal){var Z=r.horizontal[X];D||=(z=Hs(Z.text),new dp(c,t,l,u,d,Z,f,p,m,s.layout.get(`text-rotate`).evaluate(b,{},C)));var Q=Z.positionedLines.length===1;if(P+=Dp(e,t,Z,a,s,m,b,h,E,r.vertical?bf.horizontal:bf.horizontalOnly,Q?Object.keys(r.horizontal):[X],R,I,x,C),Q)break}r.vertical&&(F+=Dp(e,t,r.vertical,a,s,m,b,h,E,bf.vertical,[`vertical`],R,L,x,C));var ee=D?D.boxStartIndex:e.collisionBoxArray.length,te=D?D.boxEndIndex:e.collisionBoxArray.length,ne=k?k.boxStartIndex:e.collisionBoxArray.length,re=k?k.boxEndIndex:e.collisionBoxArray.length,ie=O?O.boxStartIndex:e.collisionBoxArray.length,ae=O?O.boxEndIndex:e.collisionBoxArray.length,oe=A?A.boxStartIndex:e.collisionBoxArray.length,se=A?A.boxEndIndex:e.collisionBoxArray.length,ce=-1,le=function(e,t){return e&&e.circleDiameter?Math.max(e.circleDiameter,t):t};ce=le(D,ce),ce=le(k,ce),ce=le(O,ce),ce=le(A,ce);var ue=ce>-1?1:0;ue&&(ce*=w/Md),e.glyphOffsetArray.length>=Rp.MAX_GLYPHS&&M(`Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907`),b.sortKey!==void 0&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,R.right>=0?R.right:-1,R.center>=0?R.center:-1,R.left>=0?R.left:-1,R.vertical||-1,I,L,z,ee,te,ne,re,ie,ae,oe,se,l,P,F,j,N,ue,0,f,B,V,ce)}function Ap(e,t,n,r){var i=e.compareText;if(!(t in i))i[t]=[];else for(var a=i[t],o=a.length-1;o>=0;o--)if(r.dist(a[o])<n)return!0;return i[t].push(r),!1}var jp=Wu.VectorTileFeature.types,Mp=[{name:`a_fade_opacity`,components:1,type:`Uint8`,offset:0}];function Np(e,t,n,r,i,a,o,s,c,l,u,d,f){var p=s?Math.min(Ep,Math.round(s[0])):0,m=s?Math.min(Ep,Math.round(s[1])):0;e.emplaceBack(t,n,Math.round(r*32),Math.round(i*32),a,o,(p<<1)+(c?1:0),m,l*16,u*16,d*256,f*256)}function Pp(e,t,n){e.emplaceBack(t.x,t.y,n),e.emplaceBack(t.x,t.y,n),e.emplaceBack(t.x,t.y,n),e.emplaceBack(t.x,t.y,n)}function Fp(e){for(var t=0,n=e.sections;t<n.length;t+=1){var r=n[t];if(vo(r.text))return!0}return!1}var Ip=function(e){this.layoutVertexArray=new us,this.indexArray=new _s,this.programConfigurations=e,this.segments=new Ls,this.dynamicLayoutVertexArray=new ds,this.opacityVertexArray=new fs,this.placedSymbolArray=new ks};Ip.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},Ip.prototype.upload=function(e,t,n,r){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Sd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Cd.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Mp,!0),this.opacityVertexBuffer.itemSize=1),(n||r)&&this.programConfigurations.upload(e))},Ip.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},$a(`SymbolBuffers`,Ip);var Lp=function(e,t,n){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new n,this.segments=new Ls,this.collisionVertexArray=new gs};Lp.prototype.upload=function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,wd.members,!0)},Lp.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},$a(`CollisionBuffers`,Lp);var Rp=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(e){return e.id}),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Jc([]),this.placementViewportMatrix=Jc([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Kf(this.zoom,t[`text-size`]),this.iconSizeData=Kf(this.zoom,t[`icon-size`]);var n=this.layers[0].layout,r=n.get(`symbol-sort-key`),i=n.get(`symbol-z-order`);this.canOverlap=n.get(`text-allow-overlap`)||n.get(`icon-allow-overlap`)||n.get(`text-ignore-placement`)||n.get(`icon-ignore-placement`),this.sortFeaturesByKey=i!==`viewport-y`&&r.constantOr(1)!==void 0,this.sortFeaturesByY=(i===`viewport-y`||i===`auto`&&!this.sortFeaturesByKey)&&this.canOverlap,n.get(`symbol-placement`)===`point`&&(this.writingModes=n.get(`text-writing-mode`).map(function(e){return bf[e]})),this.stateDependentLayerIds=this.layers.filter(function(e){return e.isStateDependent()}).map(function(e){return e.id}),this.sourceID=e.sourceID};Rp.prototype.createArrays=function(){this.text=new Ip(new fc(this.layers,this.zoom,function(e){return/^text/.test(e)})),this.icon=new Ip(new fc(this.layers,this.zoom,function(e){return/^icon/.test(e)})),this.glyphOffsetArray=new Ms,this.lineVertexArray=new Ns,this.symbolInstances=new js},Rp.prototype.calculateGlyphDependencies=function(e,t,n,r,i){for(var a=0;a<e.length;a++)if(t[e.charCodeAt(a)]=!0,(n||r)&&i){var o=Ad[e.charAt(a)];o&&(t[o.charCodeAt(0)]=!0)}},Rp.prototype.populate=function(e,t,n){var r=this.layers[0],i=r.layout,a=i.get(`text-font`),o=i.get(`text-field`),s=i.get(`icon-image`),c=(o.value.kind!==`constant`||o.value.value instanceof Cn&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&(a.value.kind!==`constant`||a.value.value.length>0),l=s.value.kind!==`constant`||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get(`symbol-sort-key`);if(this.features=[],!(!c&&!l)){for(var d=t.iconDependencies,f=t.glyphDependencies,p=t.availableImages,m=new No(this.zoom),h=0,g=e;h<g.length;h+=1){var _=g[h],v=_.feature,y=_.id,b=_.index,x=_.sourceLayerIndex,S=r._featureFilter.needGeometry,C=bc(v,S);if(r._featureFilter.filter(m,C,n)){S||(C.geometry=yc(v));var w=void 0;if(c){var T=r.getValueAndResolveTokens(`text-field`,C,n,p),E=Cn.factory(T);Fp(E)&&(this.hasRTLText=!0),(!this.hasRTLText||Do()===`unavailable`||this.hasRTLText&&jo.isParsed())&&(w=Od(E,r,C))}var D=void 0;if(l){var O=r.getValueAndResolveTokens(`icon-image`,C,n,p);D=O instanceof wn?O:wn.fromString(O)}if(!(!w&&!D)){var k=this.sortFeaturesByKey?u.evaluate(C,{},n):void 0,A={id:y,text:w,icon:D,index:b,sourceLayerIndex:x,geometry:C.geometry,properties:v.properties,type:jp[v.type],sortKey:k};if(this.features.push(A),D&&(d[D.name]=!0),w){var j=a.evaluate(C,{},n).join(`,`),M=i.get(`text-rotation-alignment`)===`map`&&i.get(`symbol-placement`)!==`point`;this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(bf.vertical)>=0;for(var N=0,P=w.sections;N<P.length;N+=1){var F=P[N];if(F.image)d[F.image.name]=!0;else{var I=so(w.toString()),L=F.fontStack||j,R=f[L]=f[L]||{};this.calculateGlyphDependencies(F.text,R,M,this.allowVerticalPlacement,I)}}}}}}i.get(`symbol-placement`)===`line`&&(this.features=kd(this.features)),this.sortFeaturesByKey&&this.features.sort(function(e,t){return e.sortKey-t.sortKey})}},Rp.prototype.update=function(e,t,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,n),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,n))},Rp.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Rp.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Rp.prototype.upload=function(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Rp.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Rp.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Rp.prototype.addToLineVertexArray=function(e,t){var n=this.lineVertexArray.length;if(e.segment!==void 0){for(var r=e.dist(t[e.segment+1]),i=e.dist(t[e.segment]),a={},o=e.segment+1;o<t.length;o++)a[o]={x:t[o].x,y:t[o].y,tileUnitDistanceFromAnchor:r},o<t.length-1&&(r+=t[o+1].dist(t[o]));for(var s=e.segment||0;s>=0;s--)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=t[s-1].dist(t[s]));for(var c=0;c<t.length;c++){var l=a[c];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}},Rp.prototype.addSymbols=function(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=e.indexArray,p=e.layoutVertexArray,m=e.segments.prepareSegment(4*t.length,p,f,this.canOverlap?a.sortKey:void 0),h=this.glyphOffsetArray.length,g=m.vertexLength,_=this.allowVerticalPlacement&&o===bf.vertical?Math.PI/2:0,v=a.text&&a.text.sections,y=0;y<t.length;y++){var b=t[y],x=b.tl,S=b.tr,C=b.bl,w=b.br,T=b.tex,E=b.pixelOffsetTL,D=b.pixelOffsetBR,O=b.minFontScaleX,k=b.minFontScaleY,A=b.glyphOffset,j=b.isSDF,M=b.sectionIndex,N=m.vertexLength,P=A[1];Np(p,s.x,s.y,x.x,P+x.y,T.x,T.y,n,j,E.x,E.y,O,k),Np(p,s.x,s.y,S.x,P+S.y,T.x+T.w,T.y,n,j,D.x,E.y,O,k),Np(p,s.x,s.y,C.x,P+C.y,T.x,T.y+T.h,n,j,E.x,D.y,O,k),Np(p,s.x,s.y,w.x,P+w.y,T.x+T.w,T.y+T.h,n,j,D.x,D.y,O,k),Pp(e.dynamicLayoutVertexArray,s,_),f.emplaceBack(N,N+1,N+2),f.emplaceBack(N+1,N+2,N+3),m.vertexLength+=4,m.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(A[0]),(y===t.length-1||M!==t[y+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(p.length,a,a.index,{},d,v&&v[M])}e.placedSymbolArray.emplaceBack(s.x,s.y,h,this.glyphOffsetArray.length-h,g,c,l,s.segment,n?n[0]:0,n?n[1]:0,r[0],r[1],o,0,!1,0,u)},Rp.prototype._addCollisionDebugVertex=function(e,t,n,r,i,a){return t.emplaceBack(0,0),e.emplaceBack(n.x,n.y,r,i,Math.round(a.x),Math.round(a.y))},Rp.prototype.addCollisionDebugVertices=function(e,t,n,r,i,o,s){var c=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=c.vertexLength,u=i.layoutVertexArray,d=i.collisionVertexArray,f=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,d,o,f,p,new a(e,t)),this._addCollisionDebugVertex(u,d,o,f,p,new a(n,t)),this._addCollisionDebugVertex(u,d,o,f,p,new a(n,r)),this._addCollisionDebugVertex(u,d,o,f,p,new a(e,r)),c.vertexLength+=4;var m=i.indexArray;m.emplaceBack(l,l+1),m.emplaceBack(l+1,l+2),m.emplaceBack(l+2,l+3),m.emplaceBack(l+3,l),c.primitiveLength+=4},Rp.prototype.addDebugCollisionBoxes=function(e,t,n,r){for(var i=e;i<t;i++){var a=this.collisionBoxArray.get(i),o=a.x1,s=a.y1,c=a.x2,l=a.y2;this.addCollisionDebugVertices(o,s,c,l,r?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,n)}},Rp.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Lp(ms,Td.members,Cs),this.iconCollisionBox=new Lp(ms,Td.members,Cs);for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},Rp.prototype._deserializeCollisionBoxesForSymbol=function(e,t,n,r,i,a,o,s,c){for(var l={},u=t;u<n;u++){var d=e.get(u);l.textBox={x1:d.x1,y1:d.y1,x2:d.x2,y2:d.y2,anchorPointX:d.anchorPointX,anchorPointY:d.anchorPointY},l.textFeatureIndex=d.featureIndex;break}for(var f=r;f<i;f++){var p=e.get(f);l.verticalTextBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},l.verticalTextFeatureIndex=p.featureIndex;break}for(var m=a;m<o;m++){var h=e.get(m);l.iconBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},l.iconFeatureIndex=h.featureIndex;break}for(var g=s;g<c;g++){var _=e.get(g);l.verticalIconBox={x1:_.x1,y1:_.y1,x2:_.x2,y2:_.y2,anchorPointX:_.anchorPointX,anchorPointY:_.anchorPointY},l.verticalIconFeatureIndex=_.featureIndex;break}return l},Rp.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var n=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}},Rp.prototype.hasTextData=function(){return this.text.segments.get().length>0},Rp.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Rp.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Rp.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Rp.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Rp.prototype.addIndicesForPlacedSymbol=function(e,t){for(var n=e.placedSymbolArray.get(t),r=n.vertexStartIndex+n.numGlyphs*4,i=n.vertexStartIndex;i<r;i+=4)e.indexArray.emplaceBack(i,i+1,i+2),e.indexArray.emplaceBack(i+1,i+2,i+3)},Rp.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var t=Math.sin(e),n=Math.cos(e),r=[],i=[],a=[],o=0;o<this.symbolInstances.length;++o){a.push(o);var s=this.symbolInstances.get(o);r.push(Math.round(t*s.anchorX+n*s.anchorY)|0),i.push(s.featureIndex)}return a.sort(function(e,t){return r[e]-r[t]||i[t]-i[e]}),a},Rp.prototype.addToSortKeyRanges=function(e,t){var n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===t?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})},Rp.prototype.sortFeatures=function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var n=0,r=this.symbolInstanceIndexes;n<r.length;n+=1){var i=r[n],a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach(function(e,n,r){e>=0&&r.indexOf(e)===n&&t.addIndicesForPlacedSymbol(t.text,e)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},$a(`SymbolBucket`,Rp,{omit:[`layers`,`collisionBoxArray`,`features`,`compareText`]}),Rp.MAX_GLYPHS=65535,Rp.addDynamicAttributes=Pp;function zp(e,t){return t.replace(/{([^{}]+)}/g,function(t,n){return n in e?String(e[n]):``})}var Bp=new qo({"symbol-placement":new Ho(qt.layout_symbol[`symbol-placement`]),"symbol-spacing":new Ho(qt.layout_symbol[`symbol-spacing`]),"symbol-avoid-edges":new Ho(qt.layout_symbol[`symbol-avoid-edges`]),"symbol-sort-key":new Uo(qt.layout_symbol[`symbol-sort-key`]),"symbol-z-order":new Ho(qt.layout_symbol[`symbol-z-order`]),"icon-allow-overlap":new Ho(qt.layout_symbol[`icon-allow-overlap`]),"icon-ignore-placement":new Ho(qt.layout_symbol[`icon-ignore-placement`]),"icon-optional":new Ho(qt.layout_symbol[`icon-optional`]),"icon-rotation-alignment":new Ho(qt.layout_symbol[`icon-rotation-alignment`]),"icon-size":new Uo(qt.layout_symbol[`icon-size`]),"icon-text-fit":new Ho(qt.layout_symbol[`icon-text-fit`]),"icon-text-fit-padding":new Ho(qt.layout_symbol[`icon-text-fit-padding`]),"icon-image":new Uo(qt.layout_symbol[`icon-image`]),"icon-rotate":new Uo(qt.layout_symbol[`icon-rotate`]),"icon-padding":new Ho(qt.layout_symbol[`icon-padding`]),"icon-keep-upright":new Ho(qt.layout_symbol[`icon-keep-upright`]),"icon-offset":new Uo(qt.layout_symbol[`icon-offset`]),"icon-anchor":new Uo(qt.layout_symbol[`icon-anchor`]),"icon-pitch-alignment":new Ho(qt.layout_symbol[`icon-pitch-alignment`]),"text-pitch-alignment":new Ho(qt.layout_symbol[`text-pitch-alignment`]),"text-rotation-alignment":new Ho(qt.layout_symbol[`text-rotation-alignment`]),"text-field":new Uo(qt.layout_symbol[`text-field`]),"text-font":new Uo(qt.layout_symbol[`text-font`]),"text-size":new Uo(qt.layout_symbol[`text-size`]),"text-max-width":new Uo(qt.layout_symbol[`text-max-width`]),"text-line-height":new Ho(qt.layout_symbol[`text-line-height`]),"text-letter-spacing":new Uo(qt.layout_symbol[`text-letter-spacing`]),"text-justify":new Uo(qt.layout_symbol[`text-justify`]),"text-radial-offset":new Uo(qt.layout_symbol[`text-radial-offset`]),"text-variable-anchor":new Ho(qt.layout_symbol[`text-variable-anchor`]),"text-anchor":new Uo(qt.layout_symbol[`text-anchor`]),"text-max-angle":new Ho(qt.layout_symbol[`text-max-angle`]),"text-writing-mode":new Ho(qt.layout_symbol[`text-writing-mode`]),"text-rotate":new Uo(qt.layout_symbol[`text-rotate`]),"text-padding":new Ho(qt.layout_symbol[`text-padding`]),"text-keep-upright":new Ho(qt.layout_symbol[`text-keep-upright`]),"text-transform":new Uo(qt.layout_symbol[`text-transform`]),"text-offset":new Uo(qt.layout_symbol[`text-offset`]),"text-allow-overlap":new Ho(qt.layout_symbol[`text-allow-overlap`]),"text-ignore-placement":new Ho(qt.layout_symbol[`text-ignore-placement`]),"text-optional":new Ho(qt.layout_symbol[`text-optional`])}),Vp={paint:new qo({"icon-opacity":new Uo(qt.paint_symbol[`icon-opacity`]),"icon-color":new Uo(qt.paint_symbol[`icon-color`]),"icon-halo-color":new Uo(qt.paint_symbol[`icon-halo-color`]),"icon-halo-width":new Uo(qt.paint_symbol[`icon-halo-width`]),"icon-halo-blur":new Uo(qt.paint_symbol[`icon-halo-blur`]),"icon-translate":new Ho(qt.paint_symbol[`icon-translate`]),"icon-translate-anchor":new Ho(qt.paint_symbol[`icon-translate-anchor`]),"text-opacity":new Uo(qt.paint_symbol[`text-opacity`]),"text-color":new Uo(qt.paint_symbol[`text-color`],{runtimeType:on,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new Uo(qt.paint_symbol[`text-halo-color`]),"text-halo-width":new Uo(qt.paint_symbol[`text-halo-width`]),"text-halo-blur":new Uo(qt.paint_symbol[`text-halo-blur`]),"text-translate":new Ho(qt.paint_symbol[`text-translate`]),"text-translate-anchor":new Ho(qt.paint_symbol[`text-translate-anchor`])}),layout:Bp},Hp=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:tn,this.defaultValue=e};Hp.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},Hp.prototype.eachChild=function(e){if(!this.defaultValue.isConstant()){var t=this.defaultValue.value;e(t._styleExpression.expression)}},Hp.prototype.outputDefined=function(){return!1},Hp.prototype.serialize=function(){return null},$a(`FormatSectionOverride`,Hp,{omit:[`defaultValue`]});var Up=function(e){function t(t){e.call(this,t,Vp)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,n){if(e.prototype.recalculate.call(this,t,n),this.layout.get(`icon-rotation-alignment`)===`auto`&&(this.layout.get(`symbol-placement`)===`point`?this.layout._values[`icon-rotation-alignment`]=`viewport`:this.layout._values[`icon-rotation-alignment`]=`map`),this.layout.get(`text-rotation-alignment`)===`auto`&&(this.layout.get(`symbol-placement`)===`point`?this.layout._values[`text-rotation-alignment`]=`viewport`:this.layout._values[`text-rotation-alignment`]=`map`),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 r=this.layout.get(`text-writing-mode`);if(r){for(var i=[],a=0,o=r;a<o.length;a+=1){var s=o[a];i.indexOf(s)<0&&i.push(s)}this.layout._values[`text-writing-mode`]=i}else this.layout._values[`text-writing-mode`]=[`horizontal`]}this._setPaintOverrides()},t.prototype.getValueAndResolveTokens=function(e,t,n,r){var i=this.layout.get(e).evaluate(t,{},n,r),a=this._unevaluatedLayout._values[e];return!a.isDataDriven()&&!Ji(a.value)&&i?zp(t.properties,i):i},t.prototype.createBucket=function(e){return new Rp(e)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var e=0,n=Vp.paint.overridableProperties;e<n.length;e+=1){var r=n[e];if(t.hasPaintOverride(this.layout,r)){var i=this.paint.get(r),a=new qi(new Hp(i),i.property.specification),o=null;o=i.value.kind===`constant`||i.value.kind===`source`?new Xi(`source`,a):new Zi(`composite`,a,i.value.zoomStops,i.value._interpolationType),this.paint._values[r]=new Bo(i.property,o,i.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(e,n,r){return!this.layout||n.isDataDriven()||r.isDataDriven()?!1:t.hasPaintOverride(this.layout,e)},t.hasPaintOverride=function(e,t){var n=e.get(`text-field`),r=Vp.paint.properties[t],i=!1,a=function(e){for(var t=0,n=e;t<n.length;t+=1){var a=n[t];if(r.overrides&&r.overrides.hasOverride(a)){i=!0;return}}};if(n.value.kind===`constant`&&n.value.value instanceof Cn)a(n.value.value.sections);else if(n.value.kind===`source`){var o=function(e){if(!i)if(e instanceof kn&&Dn(e.value)===dn){var t=e.value;a(t.sections)}else e instanceof Nn?a(e.sections):e.eachChild(o)},s=n.value;s._styleExpression&&o(s._styleExpression.expression)}return i},t}(Yo),Wp={paint:new qo({"background-color":new Ho(qt.paint_background[`background-color`]),"background-pattern":new Go(qt.paint_background[`background-pattern`]),"background-opacity":new Ho(qt.paint_background[`background-opacity`])})},Gp=function(e){function t(t){e.call(this,t,Wp)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Yo),Kp={paint:new qo({"raster-opacity":new Ho(qt.paint_raster[`raster-opacity`]),"raster-hue-rotate":new Ho(qt.paint_raster[`raster-hue-rotate`]),"raster-brightness-min":new Ho(qt.paint_raster[`raster-brightness-min`]),"raster-brightness-max":new Ho(qt.paint_raster[`raster-brightness-max`]),"raster-saturation":new Ho(qt.paint_raster[`raster-saturation`]),"raster-contrast":new Ho(qt.paint_raster[`raster-contrast`]),"raster-resampling":new Ho(qt.paint_raster[`raster-resampling`]),"raster-fade-duration":new Ho(qt.paint_raster[`raster-fade-duration`])})},qp=function(e){function t(t){e.call(this,t,Kp)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Yo);function Jp(e){var t=[],n=e.id;return n===void 0&&t.push({message:`layers.`+n+`: missing required property "id"`}),e.render===void 0&&t.push({message:`layers.`+n+`: missing required method "render"`}),e.renderingMode&&e.renderingMode!==`2d`&&e.renderingMode!==`3d`&&t.push({message:`layers.`+n+`: property "renderingMode" must be either "2d" or "3d"`}),t}var Yp=function(e){function t(t){e.call(this,t,{}),this.implementation=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.is3D=function(){return this.implementation.renderingMode===`3d`},t.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},t.prototype.recalculate=function(){},t.prototype.updateTransitions=function(){},t.prototype.hasTransition=function(){},t.prototype.serialize=function(){},t.prototype.onAdd=function(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},t.prototype.onRemove=function(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},t}(Yo),Xp={circle:Sl,heatmap:Nl,hillshade:Fl,fill:ku,"fill-extrusion":$u,line:yd,symbol:Up,background:Gp,raster:qp};function Zp(e){return e.type===`custom`?new Yp(e):new Xp[e.type](e)}var Qp=s.HTMLImageElement,$p=s.HTMLCanvasElement,em=s.HTMLVideoElement,tm=s.ImageData,nm=s.ImageBitmap,rm=function(e,t,n,r){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this.update(t,r)};rm.prototype.update=function(e,t,n){var r=e.width,i=e.height,a=(!this.size||this.size[0]!==r||this.size[1]!==i)&&!n,o=this.context,s=o.gl;if(this.useMipmap=!!(t&&t.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!t||t.premultiply!==!1)),a)this.size=[r,i],e instanceof Qp||e instanceof $p||e instanceof em||e instanceof tm||nm&&e instanceof nm?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,e):s.texImage2D(s.TEXTURE_2D,0,this.format,r,i,0,this.format,s.UNSIGNED_BYTE,e.data);else{var c=n||{x:0,y:0},l=c.x,u=c.y;e instanceof Qp||e instanceof $p||e instanceof em||e instanceof tm||nm&&e instanceof nm?s.texSubImage2D(s.TEXTURE_2D,0,l,u,s.RGBA,s.UNSIGNED_BYTE,e):s.texSubImage2D(s.TEXTURE_2D,0,l,u,r,i,s.RGBA,s.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},rm.prototype.bind=function(e,t,n){var r=this.context.gl;r.bindTexture(r.TEXTURE_2D,this.texture),n===r.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(n=r.LINEAR),e!==this.filter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,n||e),this.filter=e),t!==this.wrap&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,t),this.wrap=t)},rm.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},rm.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var im=function(e){var t=this;this._callback=e,this._triggered=!1,typeof MessageChannel<`u`&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){t._triggered=!1,t._callback()})};im.prototype.trigger=function(){var e=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){e._triggered=!1,e._callback()},0))},im.prototype.remove=function(){delete this._channel,this._callback=function(){}};var am=function(e,t,n){this.target=e,this.parent=t,this.mapId=n,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},T([`receive`,`process`],this),this.invoker=new im(this.process),this.target.addEventListener(`message`,this.receive,!1),this.globalScope=I()?e:s};am.prototype.send=function(e,t,n,r,i){var a=this;i===void 0&&(i=!1);var o=Math.round(Math.random()*0xde0b6b3a7640000).toString(36).substring(0,10);n&&(this.callbacks[o]=n);var s=z(this.globalScope)?void 0:[];return this.target.postMessage({id:o,type:e,hasCallback:!!n,targetMapId:r,mustQueue:i,sourceMapId:this.mapId,data:ro(t,s)},s),{cancel:function(){n&&delete a.callbacks[o],a.target.postMessage({id:o,type:`<cancel>`,targetMapId:r,sourceMapId:a.mapId})}}},am.prototype.receive=function(e){var t=e.data,n=t.id;if(n&&!(t.targetMapId&&this.mapId!==t.targetMapId))if(t.type===`<cancel>`){delete this.tasks[n];var r=this.cancelCallbacks[n];delete this.cancelCallbacks[n],r&&r()}else I()||t.mustQueue?(this.tasks[n]=t,this.taskQueue.push(n),this.invoker.trigger()):this.processTask(n,t)},am.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},am.prototype.processTask=function(e,t){var n=this;if(t.type===`<response>`){var r=this.callbacks[e];delete this.callbacks[e],r&&(t.error?r(io(t.error)):r(null,io(t.data)))}else{var i=!1,a=z(this.globalScope)?void 0:[],o=t.hasCallback?function(t,r){i=!0,delete n.cancelCallbacks[e],n.target.postMessage({id:e,type:`<response>`,sourceMapId:n.mapId,error:t?ro(t):null,data:ro(r,a)},a)}:function(e){i=!0},s=null,c=io(t.data);if(this.parent[t.type])s=this.parent[t.type](t.sourceMapId,c,o);else if(this.parent.getWorkerSource){var l=t.type.split(`.`);s=this.parent.getWorkerSource(t.sourceMapId,l[0],c.source)[l[1]](c,o)}else o(Error(`Could not find function `+t.type));!i&&s&&s.cancel&&(this.cancelCallbacks[e]=s.cancel)}},am.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener(`message`,this.receive,!1)};function om(e,t,n){t=2**n-t-1;var r=sm(e*256,t*256,n),i=sm((e+1)*256,(t+1)*256,n);return r[0]+`,`+r[1]+`,`+i[0]+`,`+i[1]}function sm(e,t,n){var r=2*Math.PI*6378137/256/2**n;return[e*r-2*Math.PI*6378137/2,t*r-2*Math.PI*6378137/2]}var cm=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};cm.prototype.setNorthEast=function(e){return this._ne=e instanceof um?new um(e.lng,e.lat):um.convert(e),this},cm.prototype.setSouthWest=function(e){return this._sw=e instanceof um?new um(e.lng,e.lat):um.convert(e),this},cm.prototype.extend=function(e){var t=this._sw,n=this._ne,r,i;if(e instanceof um)r=e,i=e;else if(e instanceof cm){if(r=e._sw,i=e._ne,!r||!i)return this}else{if(Array.isArray(e))if(e.length===4||e.every(Array.isArray)){var a=e;return this.extend(cm.convert(a))}else{var o=e;return this.extend(um.convert(o))}return this}return!t&&!n?(this._sw=new um(r.lng,r.lat),this._ne=new um(i.lng,i.lat)):(t.lng=Math.min(r.lng,t.lng),t.lat=Math.min(r.lat,t.lat),n.lng=Math.max(i.lng,n.lng),n.lat=Math.max(i.lat,n.lat)),this},cm.prototype.getCenter=function(){return new um((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},cm.prototype.getSouthWest=function(){return this._sw},cm.prototype.getNorthEast=function(){return this._ne},cm.prototype.getNorthWest=function(){return new um(this.getWest(),this.getNorth())},cm.prototype.getSouthEast=function(){return new um(this.getEast(),this.getSouth())},cm.prototype.getWest=function(){return this._sw.lng},cm.prototype.getSouth=function(){return this._sw.lat},cm.prototype.getEast=function(){return this._ne.lng},cm.prototype.getNorth=function(){return this._ne.lat},cm.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},cm.prototype.toString=function(){return`LngLatBounds(`+this._sw.toString()+`, `+this._ne.toString()+`)`},cm.prototype.isEmpty=function(){return!(this._sw&&this._ne)},cm.prototype.contains=function(e){var t=um.convert(e),n=t.lng,r=t.lat,i=this._sw.lat<=r&&r<=this._ne.lat,a=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=n&&n>=this._ne.lng),i&&a},cm.convert=function(e){return!e||e instanceof cm?e:new cm(e)};var lm=6371008.8,um=function(e,t){if(isNaN(e)||isNaN(t))throw Error(`Invalid LngLat object: (`+e+`, `+t+`)`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw Error(`Invalid LngLat latitude value: must be between -90 and 90`)};um.prototype.wrap=function(){return new um(m(this.lng,-180,180),this.lat)},um.prototype.toArray=function(){return[this.lng,this.lat]},um.prototype.toString=function(){return`LngLat(`+this.lng+`, `+this.lat+`)`},um.prototype.distanceTo=function(e){var t=Math.PI/180,n=this.lat*t,r=e.lat*t,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return lm*Math.acos(Math.min(i,1))},um.prototype.toBounds=function(e){e===void 0&&(e=0);var t=360*e/40075017,n=t/Math.cos(Math.PI/180*this.lat);return new cm(new um(this.lng-n,this.lat-t),new um(this.lng+n,this.lat+t))},um.convert=function(e){if(e instanceof um)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new um(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e==`object`&&e)return new um(Number(`lng`in e?e.lng:e.lon),Number(e.lat));throw 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 dm=2*Math.PI*lm;function fm(e){return dm*Math.cos(e*Math.PI/180)}function pm(e){return(180+e)/360}function mm(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function hm(e,t){return e/fm(t)}function gm(e){return e*360-180}function _m(e){var t=180-e*360;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function vm(e,t){return e*fm(_m(t))}function ym(e){return 1/Math.cos(e*Math.PI/180)}var bm=function(e,t,n){n===void 0&&(n=0),this.x=+e,this.y=+t,this.z=+n};bm.fromLngLat=function(e,t){t===void 0&&(t=0);var n=um.convert(e);return new bm(pm(n.lng),mm(n.lat),hm(t,n.lat))},bm.prototype.toLngLat=function(){return new um(gm(this.x),_m(this.y))},bm.prototype.toAltitude=function(){return vm(this.z,this.y)},bm.prototype.meterInMercatorCoordinateUnits=function(){return 1/dm*ym(_m(this.y))};var xm=function(e,t,n){this.z=e,this.x=t,this.y=n,this.key=wm(0,e,e,t,n)};xm.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},xm.prototype.url=function(e,t){var n=om(this.x,this.y,this.z),r=Tm(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(`{prefix}`,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(`{z}`,String(this.z)).replace(`{x}`,String(this.x)).replace(`{y}`,String(t===`tms`?2**this.z-this.y-1:this.y)).replace(`{quadkey}`,r).replace(`{bbox-epsg-3857}`,n)},xm.prototype.getTilePoint=function(e){var t=2**this.z;return new a((e.x*t-this.x)*gc,(e.y*t-this.y)*gc)},xm.prototype.toString=function(){return this.z+`/`+this.x+`/`+this.y};var Sm=function(e,t){this.wrap=e,this.canonical=t,this.key=wm(e,t.z,t.z,t.x,t.y)},Cm=function(e,t,n,r,i){this.overscaledZ=e,this.wrap=t,this.canonical=new xm(n,+r,+i),this.key=wm(t,e,n,r,i)};Cm.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},Cm.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new Cm(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Cm(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},Cm.prototype.calculateScaledKey=function(e,t){var n=this.canonical.z-e;return e>this.canonical.z?wm(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):wm(this.wrap*+t,e,e,this.canonical.x>>n,this.canonical.y>>n)},Cm.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t},Cm.prototype.children=function(e){if(this.overscaledZ>=e)return[new Cm(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,n=this.canonical.x*2,r=this.canonical.y*2;return[new Cm(t,this.wrap,t,n,r),new Cm(t,this.wrap,t,n+1,r),new Cm(t,this.wrap,t,n,r+1),new Cm(t,this.wrap,t,n+1,r+1)]},Cm.prototype.isLessThan=function(e){return this.wrap<e.wrap?!0:this.wrap>e.wrap?!1:this.overscaledZ<e.overscaledZ?!0:this.overscaledZ>e.overscaledZ?!1:this.canonical.x<e.canonical.x?!0:this.canonical.x>e.canonical.x?!1:this.canonical.y<e.canonical.y},Cm.prototype.wrapped=function(){return new Cm(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Cm.prototype.unwrapTo=function(e){return new Cm(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},Cm.prototype.overscaleFactor=function(){return 2**(this.overscaledZ-this.canonical.z)},Cm.prototype.toUnwrapped=function(){return new Sm(this.wrap,this.canonical)},Cm.prototype.toString=function(){return this.overscaledZ+`/`+this.canonical.x+`/`+this.canonical.y},Cm.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new bm(e.x-this.wrap,e.y))};function wm(e,t,n,r,i){e*=2,e<0&&(e=e*-1-1);var a=1<<n;return(a*a*e+a*i+r).toString(36)+n.toString(36)+t.toString(36)}function Tm(e,t,n){for(var r=``,i,a=e;a>0;a--)i=1<<a-1,r+=(t&i?1:0)+(n&i?2:0);return r}$a(`CanonicalTileID`,xm),$a(`OverscaledTileID`,Cm,{omit:[`posMatrix`]});var Em=function(e,t,n){if(this.uid=e,t.height!==t.width)throw RangeError(`DEM tiles must be square`);if(n&&n!==`mapbox`&&n!==`terrarium`)return M(`"`+n+`" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;var r=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=n||`mapbox`;for(var i=0;i<r;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(r,i)]=this.data[this._idx(r-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,r)]=this.data[this._idx(i,r-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(r,-1)]=this.data[this._idx(r-1,0)],this.data[this._idx(-1,r)]=this.data[this._idx(0,r-1)],this.data[this._idx(r,r)]=this.data[this._idx(r-1,r-1)]};Em.prototype.get=function(e,t){var n=new Uint8Array(this.data.buffer),r=this._idx(e,t)*4;return(this.encoding===`terrarium`?this._unpackTerrarium:this._unpackMapbox)(n[r],n[r+1],n[r+2])},Em.prototype.getUnpackVector=function(){return this.encoding===`terrarium`?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Em.prototype._idx=function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw RangeError(`out of range source coordinates for DEM data`);return(t+1)*this.stride+(e+1)},Em.prototype._unpackMapbox=function(e,t,n){return(e*256*256+t*256+n)/10-1e4},Em.prototype._unpackTerrarium=function(e,t,n){return e*256+t+n/256-32768},Em.prototype.getPixels=function(){return new Al({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Em.prototype.backfillBorder=function(e,t,n){if(this.dim!==e.dim)throw Error(`dem dimension mismatch`);var r=t*this.dim,i=t*this.dim+this.dim,a=n*this.dim,o=n*this.dim+this.dim;switch(t){case-1:r=i-1;break;case 1:i=r+1;break}switch(n){case-1:a=o-1;break;case 1:o=a+1;break}for(var s=-t*this.dim,c=-n*this.dim,l=a;l<o;l++)for(var u=r;u<i;u++)this.data[this._idx(u,l)]=e.data[this._idx(u+s,l+c)]},$a(`DEMData`,Em);function Dm(e,t){var n={};if(!t)return n;for(var r=function(){var e=a[i],r=e.layerIds.map(function(e){return t.getLayer(e)}).filter(Boolean);if(r.length!==0){e.layers=r,e.stateDependentLayerIds&&(e.stateDependentLayers=e.stateDependentLayerIds.map(function(e){return r.filter(function(t){return t.id===e})[0]}));for(var o=0,s=r;o<s.length;o+=1){var c=s[o];n[c.id]=e}}},i=0,a=e;i<a.length;i+=1)r();return n}var Om=function(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var n=e[t];this._stringToNumber[n]=t,this._numberToString[t]=n}};Om.prototype.encode=function(e){return this._stringToNumber[e]},Om.prototype.decode=function(e){return this._numberToString[e]};var km=function(e,t,n,r,i){this.type=`Feature`,this._vectorTileFeature=e,e._z=t,e._x=n,e._y=r,this.properties=e.properties,this.id=i},Am={geometry:{configurable:!0}};Am.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},Am.geometry.set=function(e){this._geometry=e},km.prototype.toJSON=function(){var e={geometry:this.geometry};for(var t in this)t===`_geometry`||t===`_vectorTileFeature`||(e[t]=this[t]);return e},Object.defineProperties(km.prototype,Am);var jm=function(){this.state={},this.stateChanges={},this.deletedStates={}};jm.prototype.updateState=function(e,t,n){var r=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][r]=this.stateChanges[e][r]||{},v(this.stateChanges[e][r],n),this.deletedStates[e]===null)for(var i in this.deletedStates[e]={},this.state[e])i!==r&&(this.deletedStates[e][i]=null);else if(this.deletedStates[e]&&this.deletedStates[e][r]===null)for(var a in this.deletedStates[e][r]={},this.state[e][r])n[a]||(this.deletedStates[e][r][a]=null);else for(var o in n)this.deletedStates[e]&&this.deletedStates[e][r]&&this.deletedStates[e][r][o]===null&&delete this.deletedStates[e][r][o]},jm.prototype.removeFeatureState=function(e,t,n){if(this.deletedStates[e]!==null){var r=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},n&&t!==void 0)this.deletedStates[e][r]!==null&&(this.deletedStates[e][r]=this.deletedStates[e][r]||{},this.deletedStates[e][r][n]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][r])for(n in this.deletedStates[e][r]={},this.stateChanges[e][r])this.deletedStates[e][r][n]=null;else this.deletedStates[e][r]=null;else this.deletedStates[e]=null}},jm.prototype.getState=function(e,t){var n=String(t),r=this.state[e]||{},i=this.stateChanges[e]||{},a=v({},r[n],i[n]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){var o=this.deletedStates[e][t];if(o===null)return{};for(var s in o)delete a[s]}return a},jm.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},jm.prototype.coalesceChanges=function(e,t){var n={};for(var r in this.stateChanges){this.state[r]=this.state[r]||{};var i={};for(var a in this.stateChanges[r])this.state[r][a]||(this.state[r][a]={}),v(this.state[r][a],this.stateChanges[r][a]),i[a]=this.state[r][a];n[r]=i}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(this.deletedStates[o]===null)for(var c in this.state[o])s[c]={},this.state[o][c]={};else for(var l in this.deletedStates[o]){if(this.deletedStates[o][l]===null)this.state[o][l]={};else for(var u=0,d=Object.keys(this.deletedStates[o][l]);u<d.length;u+=1){var f=d[u];delete this.state[o][l][f]}s[l]=this.state[o][l]}n[o]=n[o]||{},v(n[o],s)}if(this.stateChanges={},this.deletedStates={},Object.keys(n).length!==0)for(var p in e)e[p].setFeatureState(n,t)};var Mm=function(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new qa(gc,16,0),this.grid3D=new qa(gc,16,0),this.featureIndexArray=new Fs,this.promoteId=t};Mm.prototype.insert=function(e,t,n,r,i,a){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,r,i);for(var s=a?this.grid3D:this.grid,c=0;c<t.length;c++){for(var l=t[c],u=[1/0,1/0,-1/0,-1/0],d=0;d<l.length;d++){var f=l[d];u[0]=Math.min(u[0],f.x),u[1]=Math.min(u[1],f.y),u[2]=Math.max(u[2],f.x),u[3]=Math.max(u[3],f.y)}u[0]<gc&&u[1]<gc&&u[2]>=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},Mm.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Wu.VectorTile(new Pd(this.rawTileData)).layers,this.sourceLayerCoder=new Om(this.vtLayers?Object.keys(this.vtLayers).sort():[`_geojsonTileLayer`])),this.vtLayers},Mm.prototype.query=function(e,t,n,r){var i=this;this.loadVTLayers();for(var a=e.params||{},o=gc/e.tileSize/e.scale,s=ma(a.filter),c=e.queryGeometry,l=e.queryPadding*o,u=Pm(c),d=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),f=Pm(e.cameraQueryGeometry),p=this.grid3D.query(f.minX-l,f.minY-l,f.maxX+l,f.maxY+l,function(t,n,r,i){return Pc(e.cameraQueryGeometry,t-l,n-l,r+l,i+l)}),m=0,h=p;m<h.length;m+=1){var g=h[m];d.push(g)}d.sort(Fm);for(var _={},v,y=function(l){var u=d[l];if(u!==v){v=u;var f=i.featureIndexArray.get(u),p=null;i.loadMatchingFeature(_,f.bucketIndex,f.sourceLayerIndex,f.featureIndex,s,a.layers,a.availableImages,t,n,r,function(t,n,r){return p||=yc(t),n.queryIntersectsFeature(c,t,r,p,i.z,e.transform,o,e.pixelPosMatrix)})}},b=0;b<d.length;b++)y(b);return _},Mm.prototype.loadMatchingFeature=function(e,t,n,r,i,a,o,s,c,l,u){var d=this.bucketLayerIDs[t];if(!(a&&!A(a,d))){var f=this.sourceLayerCoder.decode(n),p=this.vtLayers[f].feature(r);if(i.needGeometry){var m=bc(p,!0);if(!i.filter(new No(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!i.filter(new No(this.tileID.overscaledZ),p))return;for(var h=this.getId(p,f),g=0;g<d.length;g++){var _=d[g];if(!(a&&a.indexOf(_)<0)){var y=s[_];if(y){var b={};h!==void 0&&l&&(b=l.getState(y.sourceLayer||`_geojsonTileLayer`,h));var x=v({},c[_]);x.paint=Nm(x.paint,y.paint,p,b,o),x.layout=Nm(x.layout,y.layout,p,b,o);var S=!u||u(p,y,b);if(S){var C=new km(p,this.z,this.x,this.y,h);C.layer=x;var w=e[_];w===void 0&&(w=e[_]=[]),w.push({featureIndex:r,feature:C,intersectionZ:S})}}}}}},Mm.prototype.lookupSymbolFeatures=function(e,t,n,r,i,a,o,s){var c={};this.loadVTLayers();for(var l=ma(i),u=0,d=e;u<d.length;u+=1){var f=d[u];this.loadMatchingFeature(c,n,r,f,l,a,o,s,t)}return c},Mm.prototype.hasLayer=function(e){for(var t=0,n=this.bucketLayerIDs;t<n.length;t+=1)for(var r=n[t],i=0,a=r;i<a.length;i+=1)if(e===a[i])return!0;return!1},Mm.prototype.getId=function(e,t){var n=e.id;if(this.promoteId){var r=typeof this.promoteId==`string`?this.promoteId:this.promoteId[t];n=e.properties[r],typeof n==`boolean`&&(n=Number(n))}return n},$a(`FeatureIndex`,Mm,{omit:[`rawTileData`,`sourceLayerCoder`]});function Nm(e,t,n,r,i){return D(e,function(e,a){var o=t instanceof Vo?t.get(a):null;return o&&o.evaluate?o.evaluate(n,r,i):o})}function Pm(e){for(var t=1/0,n=1/0,r=-1/0,i=-1/0,a=0,o=e;a<o.length;a+=1){var s=o[a];t=Math.min(t,s.x),n=Math.min(n,s.y),r=Math.max(r,s.x),i=Math.max(i,s.y)}return{minX:t,minY:n,maxX:r,maxY:i}}function Fm(e,t){return t-e}var Im=3e4,Lm=function(e,t){this.tileID=e,this.uid=x(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state=`loading`};Lm.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<J.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},Lm.prototype.wasRequested=function(){return this.state===`errored`||this.state===`loaded`||this.state===`reloading`},Lm.prototype.loadVectorData=function(e,t,n){if(this.hasData()&&this.unloadVectorData(),this.state=`loaded`,!e){this.collisionBoxArray=new Ds;return}for(var r in e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=Dm(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[r];if(i instanceof Rp)if(this.hasSymbolBuckets=!0,n)i.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var a in this.buckets){var o=this.buckets[a];if(o instanceof Rp&&o.hasRTLText){this.hasRTLText=!0,Mo();break}}for(var s in this.queryPadding=0,this.buckets){var c=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(s).queryRadius(c))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)},Lm.prototype.unloadVectorData=function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&=null,this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state=`unloaded`},Lm.prototype.getBucket=function(e){return this.buckets[e.id]},Lm.prototype.upload=function(e){for(var t in this.buckets){var n=this.buckets[t];n.uploadPending()&&n.upload(e)}var r=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new rm(e,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&=(this.glyphAtlasTexture=new rm(e,this.glyphAtlasImage,r.ALPHA),null)},Lm.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},Lm.prototype.queryRenderedFeatures=function(e,t,n,r,i,a,o,s,c,l){return!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData?{}:this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:l,transform:s,params:o,queryPadding:this.queryPadding*c},e,t,n)},Lm.prototype.querySourceFeatures=function(e,t){var n=this.latestFeatureIndex;if(!(!n||!n.rawTileData)){var r=n.loadVTLayers(),i=t?t.sourceLayer:``,a=r._geojsonTileLayer||r[i];if(a)for(var o=ma(t&&t.filter),s=this.tileID.canonical,c=s.z,l=s.x,u=s.y,d={z:c,x:l,y:u},f=0;f<a.length;f++){var p=a.feature(f);if(o.needGeometry){var m=bc(p,!0);if(!o.filter(new No(this.tileID.overscaledZ),m,this.tileID.canonical))continue}else if(!o.filter(new No(this.tileID.overscaledZ),p))continue;var h=new km(p,c,l,u,n.getId(p,i));h.tile=d,e.push(h)}}},Lm.prototype.hasData=function(){return this.state===`loaded`||this.state===`reloading`||this.state===`expired`},Lm.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Lm.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var n=L(e.cacheControl);n[`max-age`]&&(this.expirationTime=Date.now()+n[`max-age`]*1e3)}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var r=Date.now(),i=!1;if(this.expirationTime>r)i=!1;else if(!t)i=!0;else if(this.expirationTime<t)i=!0;else{var a=this.expirationTime-t;a?this.expirationTime=r+Math.max(a,Im):i=!0}i?(this.expiredRequestCount++,this.state=`expired`):this.expiredRequestCount=0}},Lm.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),2**31-1)},Lm.prototype.setFeatureState=function(e,t){if(!(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0)){var n=this.latestFeatureIndex.loadVTLayers();for(var r in this.buckets)if(t.style.hasLayer(r)){var i=this.buckets[r],a=i.layers[0].sourceLayer||`_geojsonTileLayer`,o=n[a],s=e[a];if(!(!o||!s||Object.keys(s).length===0)){i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});var c=t&&t.style&&t.style.getLayer(r);c&&(this.queryPadding=Math.max(this.queryPadding,c.queryRadius(i)))}}}},Lm.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},Lm.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<J.now()},Lm.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Lm.prototype.setHoldDuration=function(e){this.symbolFadeHoldUntil=J.now()+e},Lm.prototype.setDependencies=function(e,t){for(var n={},r=0,i=t;r<i.length;r+=1){var a=i[r];n[a]=!0}this.dependencies[e]=n},Lm.prototype.hasDependency=function(e,t){for(var n=0,r=e;n<r.length;n+=1){var i=r[n],a=this.dependencies[i];if(a){for(var o=0,s=t;o<s.length;o+=1)if(a[s[o]])return!0}}return!1};var Rm=[`type`,`source`,`source-layer`,`minzoom`,`maxzoom`,`filter`,`layout`],zm=s.performance,Bm=function(e){this._marks={start:[e.url,`start`].join(`#`),end:[e.url,`end`].join(`#`),measure:e.url.toString()},zm.mark(this._marks.start)};Bm.prototype.finish=function(){zm.mark(this._marks.end);var e=zm.getEntriesByName(this._marks.measure);return e.length===0&&(zm.measure(this._marks.measure,this._marks.start,this._marks.end),e=zm.getEntriesByName(this._marks.measure),zm.clearMarks(this._marks.start),zm.clearMarks(this._marks.end),zm.clearMeasures(this._marks.measure)),e},e.Actor=am,e.AlphaImage=kl,e.CanonicalTileID=xm,e.CollisionBoxArray=Ds,e.Color=bn,e.DEMData=Em,e.DataConstantProperty=Ho,e.DictionaryCoder=Om,e.EXTENT=gc,e.ErrorEvent=lt,e.EvaluationParameters=No,e.Event=ct,e.Evented=ut,e.FeatureIndex=Mm,e.FillBucket=Eu,e.FillExtrusionBucket=Yu,e.ImageAtlas=yf,e.ImagePosition=_f,e.LineBucket=hd,e.LngLat=um,e.LngLatBounds=cm,e.MercatorCoordinate=bm,e.ONE_EM=Md,e.OverscaledTileID=Cm,e.Point=a,e.Point$1=a,e.Properties=qo,e.Protobuf=Pd,e.RGBAImage=Al,e.RequestManager=oe,e.RequestPerformance=Bm,e.ResourceType=He,e.SegmentVector=Ls,e.SourceFeatureState=jm,e.StructArrayLayout1ui2=ws,e.StructArrayLayout2f1f2i16=hs,e.StructArrayLayout2i4=is,e.StructArrayLayout3ui6=_s,e.StructArrayLayout4i8=as,e.SymbolBucket=Rp,e.Texture=rm,e.Tile=Lm,e.Transitionable=Io,e.Uniform1f=Qs,e.Uniform1i=Zs,e.Uniform2f=$s,e.Uniform3f=ec,e.Uniform4f=tc,e.UniformColor=nc,e.UniformMatrix4f=ic,e.UnwrappedTileID=Sm,e.ValidationError=Jt,e.WritingMode=bf,e.ZoomHistory=ao,e.add=ol,e.addDynamicAttributes=Pp,e.asyncAll=h,e.bezier=d,e.bindAll=T,e.browser=J,e.cacheEntryPossiblyAdded=Ie,e.clamp=p,e.clearTileCache=Re,e.clipLine=rp,e.clone=qc,e.clone$1=k,e.clone$2=al,e.collisionCircleLayout=Ed,e.config=Y,e.create=Kc,e.create$1=Wc,e.create$2=Hc,e.createCommonjsModule=t,e.createExpression=Yi,e.createLayout=ts,e.createStyleLayer=Zp,e.cross=dl,e.deepEqual=c,e.dot=ul,e.dot$1=_l,e.ease=f,e.emitValidationErrors=Ka,e.endsWith=E,e.enforceCacheSizeLimit=Le,e.evaluateSizeForFeature=qf,e.evaluateSizeForZoom=Jf,e.evaluateVariableOffset=xp,e.evented=Eo,e.extend=v,e.featureFilter=ma,e.filterObject=O,e.fromRotation=Gc,e.getAnchorAlignment=Rf,e.getAnchorJustification=Cp,e.getArrayBuffer=Xe,e.getImage=it,e.getJSON=Ye,e.getRTLTextPluginStatus=Do,e.getReferrer=We,e.getVideo=at,e.identity=Jc,e.invert=Yc,e.isChar=oo,e.isMapboxURL=se,e.keysDifference=_,e.makeRequest=Je,e.mapObject=D,e.mercatorXfromLng=pm,e.mercatorYfromLat=mm,e.mercatorZfromAltitude=hm,e.mul=rl,e.multiply=Xc,e.mvt=Wu,e.nextPowerOfTwo=C,e.normalize=ll,e.number=xr,e.offscreenCanvasSupported=Ve,e.ortho=nl,e.parseGlyphPBF=pf,e.pbf=Pd,e.performSymbolLayout=Sp,e.perspective=tl,e.pick=y,e.plugin=jo,e.polygonIntersectsPolygon=Cc,e.postMapLoadEvent=Se,e.postTurnstileEvent=be,e.potpack=hf,e.refProperties=Rm,e.register=$a,e.registerForPluginStateChange=Oo,e.renderColorRamp=Ml,e.rotate=Uc,e.rotateX=$c,e.rotateZ=el,e.scale=Qc,e.scale$1=hl,e.scale$2=cl,e.setCacheLimits=ze,e.setRTLTextPlugin=ko,e.sphericalToCartesian=F,e.sqrLen=xl,e.styleSpec=qt,e.sub=pl,e.symbolSize=Yf,e.transformMat3=fl,e.transformMat4=vl,e.translate=Zc,e.triggerPluginCompletionEvent=wo,e.uniqueId=x,e.validateCustomStyleLayer=Jp,e.validateLight=Ua,e.validateStyle=Ha,e.values=g,e.vectorTile=Wu,e.version=n,e.warnOnce=M,e.webpSupported=X,e.window=s,e.wrap=m}),r([`./shared`],function(e){function t(e){var n=typeof e;if(n===`number`||n===`boolean`||n===`string`||e==null)return JSON.stringify(e);if(Array.isArray(e)){for(var r=`[`,i=0,a=e;i<a.length;i+=1){var o=a[i];r+=t(o)+`,`}return r+`]`}for(var s=Object.keys(e).sort(),c=`{`,l=0;l<s.length;l++)c+=JSON.stringify(s[l])+`:`+t(e[s[l]])+`,`;return c+`}`}function n(n){for(var r=``,i=0,a=e.refProperties;i<a.length;i+=1){var o=a[i];r+=`/`+t(n[o])}return r}function r(e,t){for(var r={},i=0;i<e.length;i++){var a=t&&t[e[i].id]||n(e[i]);t&&(t[e[i].id]=a);var o=r[a];o||=r[a]=[],o.push(e[i])}var s=[];for(var c in r)s.push(r[c]);return s}var i=function(e){this.keyCache={},e&&this.replace(e)};i.prototype.replace=function(e){this._layerConfigs={},this._layers={},this.update(e,[])},i.prototype.update=function(t,n){for(var i=this,a=0,o=t;a<o.length;a+=1){var s=o[a];this._layerConfigs[s.id]=s;var c=this._layers[s.id]=e.createStyleLayer(s);c._featureFilter=e.featureFilter(c.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var l=0,u=n;l<u.length;l+=1){var d=u[l];delete this.keyCache[d],delete this._layerConfigs[d],delete this._layers[d]}this.familiesBySource={};for(var f=r(e.values(this._layerConfigs),this.keyCache),p=0,m=f;p<m.length;p+=1){var h=m[p].map(function(e){return i._layers[e.id]}),g=h[0];if(g.visibility!==`none`){var _=g.source||``,v=this.familiesBySource[_];v||=this.familiesBySource[_]={};var y=g.sourceLayer||`_geojsonTileLayer`,b=v[y];b||=v[y]=[],b.push(h)}}};var a=1,o=function(t){var n={},r=[];for(var i in t){var o=t[i],s=n[i]={};for(var c in o){var l=o[+c];if(!(!l||l.bitmap.width===0||l.bitmap.height===0)){var u={x:0,y:0,w:l.bitmap.width+2*a,h:l.bitmap.height+2*a};r.push(u),s[c]={rect:u,metrics:l.metrics}}}}var d=e.potpack(r),f=d.w,p=d.h,m=new e.AlphaImage({width:f||1,height:p||1});for(var h in t){var g=t[h];for(var _ in g){var v=g[+_];if(!(!v||v.bitmap.width===0||v.bitmap.height===0)){var y=n[h][_].rect;e.AlphaImage.copy(v.bitmap,m,{x:0,y:0},{x:y.x+a,y:y.y+a},v.bitmap)}}}this.image=m,this.positions=n};e.register(`GlyphAtlas`,o);var s=function(t){this.tileID=new e.OverscaledTileID(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};s.prototype.parse=function(t,n,r,i,a){var s=this;this.status=`parsing`,this.data=t,this.collisionBoxArray=new e.CollisionBoxArray;var l=new e.DictionaryCoder(Object.keys(t.layers).sort()),u=new e.FeatureIndex(this.tileID,this.promoteId);u.bucketLayerIDs=[];var d={},f={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:r},p=n.familiesBySource[this.source];for(var m in p){var h=t.layers[m];if(h){h.version===1&&e.warnOnce(`Vector tile source "`+this.source+`" layer "`+m+`" does not use vector tile spec v2 and therefore may have some rendering errors.`);for(var g=l.encode(m),_=[],v=0;v<h.length;v++){var y=h.feature(v),b=u.getId(y,m);_.push({feature:y,id:b,index:v,sourceLayerIndex:g})}for(var x=0,S=p[m];x<S.length;x+=1){var C=S[x],w=C[0];!(w.minzoom&&this.zoom<Math.floor(w.minzoom))&&!(w.maxzoom&&this.zoom>=w.maxzoom)&&w.visibility!==`none`&&(c(C,this.zoom,r),(d[w.id]=w.createBucket({index:u.bucketLayerIDs.length,layers:C,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:g,sourceID:this.source})).populate(_,f,this.tileID.canonical),u.bucketLayerIDs.push(C.map(function(e){return e.id})))}}}var T,E,D,O,k=e.mapObject(f.glyphDependencies,function(e){return Object.keys(e).map(Number)});Object.keys(k).length?i.send(`getGlyphs`,{uid:this.uid,stacks:k},function(e,t){T||(T=e,E=t,M.call(s))}):E={};var A=Object.keys(f.iconDependencies);A.length?i.send(`getImages`,{icons:A,source:this.source,tileID:this.tileID,type:`icons`},function(e,t){T||(T=e,D=t,M.call(s))}):D={};var j=Object.keys(f.patternDependencies);j.length?i.send(`getImages`,{icons:j,source:this.source,tileID:this.tileID,type:`patterns`},function(e,t){T||(T=e,O=t,M.call(s))}):O={},M.call(this);function M(){if(T)return a(T);if(E&&D&&O){var t=new o(E),n=new e.ImageAtlas(D,O);for(var i in d){var s=d[i];s instanceof e.SymbolBucket?(c(s.layers,this.zoom,r),e.performSymbolLayout(s,E,t.positions,D,n.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):s.hasPattern&&(s instanceof e.LineBucket||s instanceof e.FillBucket||s instanceof e.FillExtrusionBucket)&&(c(s.layers,this.zoom,r),s.addFeatures(f,this.tileID.canonical,n.patternPositions))}this.status=`done`,a(null,{buckets:e.values(d).filter(function(e){return!e.isEmpty()}),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:n,glyphMap:this.returnDependencies?E:null,iconMap:this.returnDependencies?D:null,glyphPositions:this.returnDependencies?t.positions:null})}}};function c(t,n,r){for(var i=new e.EvaluationParameters(n),a=0,o=t;a<o.length;a+=1)o[a].recalculate(i,r)}function l(t,n){var r=e.getArrayBuffer(t.request,function(t,r,i,a){t?n(t):r&&n(null,{vectorTile:new e.vectorTile.VectorTile(new e.pbf(r)),rawData:r,cacheControl:i,expires:a})});return function(){r.cancel(),n()}}var u=function(e,t,n,r){this.actor=e,this.layerIndex=t,this.availableImages=n,this.loadVectorData=r||l,this.loading={},this.loaded={}};u.prototype.loadTile=function(t,n){var r=this,i=t.uid;this.loading||={};var a=t&&t.request&&t.request.collectResourceTiming?new e.RequestPerformance(t.request):!1,o=this.loading[i]=new s(t);o.abort=this.loadVectorData(t,function(t,s){if(delete r.loading[i],t||!s)return o.status=`done`,r.loaded[i]=o,n(t);var c=s.rawData,l={};s.expires&&(l.expires=s.expires),s.cacheControl&&(l.cacheControl=s.cacheControl);var u={};if(a){var d=a.finish();d&&(u.resourceTiming=JSON.parse(JSON.stringify(d)))}o.vectorTile=s.vectorTile,o.parse(s.vectorTile,r.layerIndex,r.availableImages,r.actor,function(t,r){if(t||!r)return n(t);n(null,e.extend({rawTileData:c.slice(0)},r,l,u))}),r.loaded=r.loaded||{},r.loaded[i]=o})},u.prototype.reloadTile=function(e,t){var n=this,r=this.loaded,i=e.uid,a=this;if(r&&r[i]){var o=r[i];o.showCollisionBoxes=e.showCollisionBoxes;var s=function(e,r){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,n.availableImages,a.actor,i)),t(e,r)};o.status===`parsing`?o.reloadCallback=s:o.status===`done`&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},u.prototype.abortTile=function(e,t){var n=this.loading,r=e.uid;n&&n[r]&&n[r].abort&&(n[r].abort(),delete n[r]),t()},u.prototype.removeTile=function(e,t){var n=this.loaded,r=e.uid;n&&n[r]&&delete n[r],t()};var d=e.window.ImageBitmap,f=function(){this.loaded={}};f.prototype.loadTile=function(t,n){var r=t.uid,i=t.encoding,a=t.rawImageData,o=d&&a instanceof d?this.getImageData(a):a,s=new e.DEMData(r,o,i);this.loaded=this.loaded||{},this.loaded[r]=s,n(null,s)},f.prototype.getImageData=function(t){(!this.offscreenCanvas||!this.offscreenCanvasContext)&&(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext(`2d`)),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var n=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:n.width,height:n.height},n.data)},f.prototype.removeTile=function(e){var t=this.loaded,n=e.uid;t&&t[n]&&delete t[n]};var p=m;function m(e,t){var n=e&&e.type,r;if(n===`FeatureCollection`)for(r=0;r<e.features.length;r++)m(e.features[r],t);else if(n===`GeometryCollection`)for(r=0;r<e.geometries.length;r++)m(e.geometries[r],t);else if(n===`Feature`)m(e.geometry,t);else if(n===`Polygon`)h(e.coordinates,t);else if(n===`MultiPolygon`)for(r=0;r<e.coordinates.length;r++)h(e.coordinates[r],t);return e}function h(e,t){if(e.length!==0){g(e[0],t);for(var n=1;n<e.length;n++)g(e[n],!t)}}function g(e,t){for(var n=0,r=0,i=e.length,a=i-1;r<i;a=r++)n+=(e[r][0]-e[a][0])*(e[a][1]+e[r][1]);n>=0!=!!t&&e.reverse()}var _=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,v=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,`id`in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};v.prototype.loadGeometry=function(){if(this._feature.type===1){for(var t=[],n=0,r=this._feature.geometry;n<r.length;n+=1){var i=r[n];t.push([new e.Point$1(i[0],i[1])])}return t}else{for(var a=[],o=0,s=this._feature.geometry;o<s.length;o+=1){for(var c=s[o],l=[],u=0,d=c;u<d.length;u+=1){var f=d[u];l.push(new e.Point$1(f[0],f[1]))}a.push(l)}return a}},v.prototype.toGeoJSON=function(e,t,n){return _.call(this,e,t,n)};var y=function(t){this.layers={_geojsonTileLayer:this},this.name=`_geojsonTileLayer`,this.extent=e.EXTENT,this.length=t.length,this._features=t};y.prototype.feature=function(e){return new v(this._features[e])};var b=e.vectorTile.VectorTileFeature,x=S;function S(e,t){this.options=t||{},this.features=e,this.length=e.length}S.prototype.feature=function(e){return new C(this.features[e],this.options.extent)};function C(e,t){this.id=typeof e.id==`number`?e.id:void 0,this.type=e.type,this.rawGeometry=e.type===1?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}C.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var n=0;n<t.length;n++){for(var r=t[n],i=[],a=0;a<r.length;a++)i.push(new e.Point$1(r[a][0],r[a][1]));this.geometry.push(i)}return this.geometry},C.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,n=-1/0,r=1/0,i=-1/0,a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var c=o[s];t=Math.min(t,c.x),n=Math.max(n,c.x),r=Math.min(r,c.y),i=Math.max(i,c.y)}return[t,r,n,i]},C.prototype.toGeoJSON=b.prototype.toGeoJSON;var w=O,T=O,E=k,D=x;function O(t){var n=new e.pbf;return A(t,n),n.finish()}function k(e,t){t||={};var n={};for(var r in e)n[r]=new x(e[r].features,t),n[r].name=r,n[r].version=t.version,n[r].extent=t.extent;return O({layers:n})}function A(e,t){for(var n in e.layers)t.writeMessage(3,j,e.layers[n])}function j(e,t){t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||``),t.writeVarintField(5,e.extent||4096);var n,r={keys:[],values:[],keycache:{},valuecache:{}};for(n=0;n<e.length;n++)r.feature=e.feature(n),t.writeMessage(2,M,r);var i=r.keys;for(n=0;n<i.length;n++)t.writeStringField(3,i[n]);var a=r.values;for(n=0;n<a.length;n++)t.writeMessage(4,L,a[n])}function M(e,t){var n=e.feature;n.id!==void 0&&t.writeVarintField(1,n.id),t.writeMessage(2,N,e),t.writeVarintField(3,n.type),t.writeMessage(4,I,n)}function N(e,t){var n=e.feature,r=e.keys,i=e.values,a=e.keycache,o=e.valuecache;for(var s in n.properties){var c=a[s];c===void 0&&(r.push(s),c=r.length-1,a[s]=c),t.writeVarint(c);var l=n.properties[s],u=typeof l;u!==`string`&&u!==`boolean`&&u!==`number`&&(l=JSON.stringify(l));var d=u+`:`+l,f=o[d];f===void 0&&(i.push(l),f=i.length-1,o[d]=f),t.writeVarint(f)}}function P(e,t){return(t<<3)+(e&7)}function F(e){return e<<1^e>>31}function I(e,t){for(var n=e.loadGeometry(),r=e.type,i=0,a=0,o=n.length,s=0;s<o;s++){var c=n[s],l=1;r===1&&(l=c.length),t.writeVarint(P(1,l));for(var u=r===3?c.length-1:c.length,d=0;d<u;d++){d===1&&r!==1&&t.writeVarint(P(2,u-1));var f=c[d].x-i,p=c[d].y-a;t.writeVarint(F(f)),t.writeVarint(F(p)),i+=f,a+=p}r===3&&t.writeVarint(P(7,1))}}function L(e,t){var n=typeof e;n===`string`?t.writeStringField(1,e):n===`boolean`?t.writeBooleanField(7,e):n===`number`&&(e%1==0?e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e):t.writeDoubleField(3,e))}w.fromVectorTileJs=T,w.fromGeojsonVt=E,w.GeoJSONWrapper=D;function R(e,t,n,r,i,a){if(!(i-r<=n)){var o=r+i>>1;z(e,t,o,r,i,a%2),R(e,t,n,r,o-1,a+1),R(e,t,n,o+1,i,a+1)}}function z(e,t,n,r,i,a){for(;i>r;){if(i-r>600){var o=i-r+1,s=n-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1);z(e,t,n,Math.max(r,Math.floor(n-s*l/o+u)),Math.min(i,Math.floor(n+(o-s)*l/o+u)),a)}var d=t[2*n+a],f=r,p=i;for(B(e,t,r,n),t[2*i+a]>d&&B(e,t,r,i);f<p;){for(B(e,t,f,p),f++,p--;t[2*f+a]<d;)f++;for(;t[2*p+a]>d;)p--}t[2*r+a]===d?B(e,t,r,p):(p++,B(e,t,p,i)),p<=n&&(r=p+1),n<=p&&(i=p-1)}}function B(e,t,n,r){V(e,n,r),V(t,2*n,2*r),V(t,2*n+1,2*r+1)}function V(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function H(e,t,n,r,i,a,o){for(var s=[0,e.length-1,0],c=[],l,u;s.length;){var d=s.pop(),f=s.pop(),p=s.pop();if(f-p<=o){for(var m=p;m<=f;m++)l=t[2*m],u=t[2*m+1],l>=n&&l<=i&&u>=r&&u<=a&&c.push(e[m]);continue}var h=Math.floor((p+f)/2);l=t[2*h],u=t[2*h+1],l>=n&&l<=i&&u>=r&&u<=a&&c.push(e[h]);var g=(d+1)%2;(d===0?n<=l:r<=u)&&(s.push(p),s.push(h-1),s.push(g)),(d===0?i>=l:a>=u)&&(s.push(h+1),s.push(f),s.push(g))}return c}function U(e,t,n,r,i,a){for(var o=[0,e.length-1,0],s=[],c=i*i;o.length;){var l=o.pop(),u=o.pop(),d=o.pop();if(u-d<=a){for(var f=d;f<=u;f++)W(t[2*f],t[2*f+1],n,r)<=c&&s.push(e[f]);continue}var p=Math.floor((d+u)/2),m=t[2*p],h=t[2*p+1];W(m,h,n,r)<=c&&s.push(e[p]);var g=(l+1)%2;(l===0?n-i<=m:r-i<=h)&&(o.push(d),o.push(p-1),o.push(g)),(l===0?n+i>=m:r+i>=h)&&(o.push(p+1),o.push(u),o.push(g))}return s}function W(e,t,n,r){var i=e-n,a=t-r;return i*i+a*a}var G=function(e){return e[0]},K=function(e){return e[1]},q=function(e,t,n,r,i){t===void 0&&(t=G),n===void 0&&(n=K),r===void 0&&(r=64),i===void 0&&(i=Float64Array),this.nodeSize=r,this.points=e;for(var a=this.ids=new(e.length<65536?Uint16Array:Uint32Array)(e.length),o=this.coords=new i(e.length*2),s=0;s<e.length;s++)a[s]=s,o[2*s]=t(e[s]),o[2*s+1]=n(e[s]);R(a,o,r,0,a.length-1,0)};q.prototype.range=function(e,t,n,r){return H(this.ids,this.coords,e,t,n,r,this.nodeSize)},q.prototype.within=function(e,t,n){return U(this.ids,this.coords,e,t,n,this.nodeSize)};var J={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},Y=function(e){this.options=ae(Object.create(J),e),this.trees=Array(this.options.maxZoom+1)};Y.prototype.load=function(e){var t=this.options,n=t.log,r=t.minZoom,i=t.maxZoom,a=t.nodeSize;n&&console.time(`total time`);var o=`prepare `+e.length+` points`;n&&console.time(o),this.points=e;for(var s=[],c=0;c<e.length;c++)e[c].geometry&&s.push(Z(e[c],c));this.trees[i+1]=new q(s,oe,se,a,Float32Array),n&&console.timeEnd(o);for(var l=i;l>=r;l--){var u=+Date.now();s=this._cluster(s,l),this.trees[l]=new q(s,oe,se,a,Float32Array),n&&console.log(`z%d: %d clusters in %dms`,l,s.length,+Date.now()-u)}return n&&console.timeEnd(`total time`),this},Y.prototype.getClusters=function(e,t){var n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){var o=this.getClusters([n,r,180,a],t),s=this.getClusters([-180,r,i,a],t);return o.concat(s)}for(var c=this.trees[this._limitZoom(t)],l=c.range(te(n),ne(a),te(i),ne(r)),u=[],d=0,f=l;d<f.length;d+=1){var p=f[d],m=c.points[p];u.push(m.numPoints?Q(m):this.points[m.index])}return u},Y.prototype.getChildren=function(e){var t=this._getOriginId(e),n=this._getOriginZoom(e),r=`No cluster with the specified id.`,i=this.trees[n];if(!i)throw Error(r);var a=i.points[t];if(!a)throw Error(r);for(var o=this.options.radius/(this.options.extent*2**(n-1)),s=i.within(a.x,a.y,o),c=[],l=0,u=s;l<u.length;l+=1){var d=u[l],f=i.points[d];f.parentId===e&&c.push(f.numPoints?Q(f):this.points[f.index])}if(c.length===0)throw Error(r);return c},Y.prototype.getLeaves=function(e,t,n){t||=10,n||=0;var r=[];return this._appendLeaves(r,e,t,n,0),r},Y.prototype.getTile=function(e,t,n){var r=this.trees[this._limitZoom(e)],i=2**e,a=this.options,o=a.extent,s=a.radius/o,c=(n-s)/i,l=(n+1+s)/i,u={features:[]};return this._addTileFeatures(r.range((t-s)/i,c,(t+1+s)/i,l),r.points,t,n,i,u),t===0&&this._addTileFeatures(r.range(1-s/i,c,1,l),r.points,i,n,i,u),t===i-1&&this._addTileFeatures(r.range(0,c,s/i,l),r.points,-1,n,i,u),u.features.length?u:null},Y.prototype.getClusterExpansionZoom=function(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var n=this.getChildren(e);if(t++,n.length!==1)break;e=n[0].properties.cluster_id}return t},Y.prototype._appendLeaves=function(e,t,n,r,i){for(var a=this.getChildren(t),o=0,s=a;o<s.length;o+=1){var c=s[o],l=c.properties;if(l&&l.cluster?i+l.point_count<=r?i+=l.point_count:i=this._appendLeaves(e,l.cluster_id,n,r,i):i<r?i++:e.push(c),e.length===n)break}return i},Y.prototype._addTileFeatures=function(e,t,n,r,i,a){for(var o=0,s=e;o<s.length;o+=1){var c=t[s[o]],l=c.numPoints,u={type:1,geometry:[[Math.round(this.options.extent*(c.x*i-n)),Math.round(this.options.extent*(c.y*i-r))]],tags:l?ee(c):this.points[c.index].properties},d=void 0;l?d=c.id:this.options.generateId?d=c.index:this.points[c.index].id&&(d=this.points[c.index].id),d!==void 0&&(u.id=d),a.features.push(u)}},Y.prototype._limitZoom=function(e){return Math.max(this.options.minZoom,Math.min(+e,this.options.maxZoom+1))},Y.prototype._cluster=function(e,t){for(var n=[],r=this.options,i=r.radius,a=r.extent,o=r.reduce,s=r.minPoints,c=i/(a*2**t),l=0;l<e.length;l++){var u=e[l];if(!(u.zoom<=t)){u.zoom=t;for(var d=this.trees[t+1],f=d.within(u.x,u.y,c),p=u.numPoints||1,m=p,h=0,g=f;h<g.length;h+=1){var _=g[h],v=d.points[_];v.zoom>t&&(m+=v.numPoints||1)}if(m>=s){for(var y=u.x*p,b=u.y*p,x=o&&p>1?this._map(u,!0):null,S=(l<<5)+(t+1)+this.points.length,C=0,w=f;C<w.length;C+=1){var T=w[C],E=d.points[T];if(!(E.zoom<=t)){E.zoom=t;var D=E.numPoints||1;y+=E.x*D,b+=E.y*D,E.parentId=S,o&&(x||=this._map(u,!0),o(x,this._map(E)))}}u.parentId=S,n.push(X(y/m,b/m,S,m,x))}else if(n.push(u),m>1)for(var O=0,k=f;O<k.length;O+=1){var A=k[O],j=d.points[A];j.zoom<=t||(j.zoom=t,n.push(j))}}}return n},Y.prototype._getOriginId=function(e){return e-this.points.length>>5},Y.prototype._getOriginZoom=function(e){return(e-this.points.length)%32},Y.prototype._map=function(e,t){if(e.numPoints)return t?ae({},e.properties):e.properties;var n=this.points[e.index].properties,r=this.options.map(n);return t&&r===n?ae({},r):r};function X(e,t,n,r,i){return{x:e,y:t,zoom:1/0,id:n,parentId:-1,numPoints:r,properties:i}}function Z(e,t){var n=e.geometry.coordinates,r=n[0],i=n[1];return{x:te(r),y:ne(i),zoom:1/0,index:t,parentId:-1}}function Q(e){return{type:`Feature`,id:e.id,properties:ee(e),geometry:{type:`Point`,coordinates:[re(e.x),ie(e.y)]}}}function ee(e){var t=e.numPoints,n=t>=1e4?Math.round(t/1e3)+`k`:t>=1e3?Math.round(t/100)/10+`k`:t;return ae(ae({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:n})}function te(e){return e/360+.5}function ne(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function re(e){return(e-.5)*360}function ie(e){var t=(180-e*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function ae(e,t){for(var n in t)e[n]=t[n];return e}function oe(e){return e.x}function se(e){return e.y}function ce(e,t,n,r){for(var i=r,a=n-t>>1,o=n-t,s,c=e[t],l=e[t+1],u=e[n],d=e[n+1],f=t+3;f<n;f+=3){var p=le(e[f],e[f+1],c,l,u,d);if(p>i)s=f,i=p;else if(p===i){var m=Math.abs(f-a);m<o&&(s=f,o=m)}}i>r&&(s-t>3&&ce(e,t,s,r),e[s+2]=i,n-s>3&&ce(e,s,n,r))}function le(e,t,n,r,i,a){var o=i-n,s=a-r;if(o!==0||s!==0){var c=((e-n)*o+(t-r)*s)/(o*o+s*s);c>1?(n=i,r=a):c>0&&(n+=o*c,r+=s*c)}return o=e-n,s=t-r,o*o+s*s}function ue(e,t,n,r){var i={id:e===void 0?null:e,type:t,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return de(i),i}function de(e){var t=e.geometry,n=e.type;if(n===`Point`||n===`MultiPoint`||n===`LineString`)fe(e,t);else if(n===`Polygon`||n===`MultiLineString`)for(var r=0;r<t.length;r++)fe(e,t[r]);else if(n===`MultiPolygon`)for(r=0;r<t.length;r++)for(var i=0;i<t[r].length;i++)fe(e,t[r][i])}function fe(e,t){for(var n=0;n<t.length;n+=3)e.minX=Math.min(e.minX,t[n]),e.minY=Math.min(e.minY,t[n+1]),e.maxX=Math.max(e.maxX,t[n]),e.maxY=Math.max(e.maxY,t[n+1])}function pe(e,t){var n=[];if(e.type===`FeatureCollection`)for(var r=0;r<e.features.length;r++)me(n,e.features[r],t,r);else e.type===`Feature`?me(n,e,t):me(n,{geometry:e},t);return n}function me(e,t,n,r){if(t.geometry){var i=t.geometry.coordinates,a=t.geometry.type,o=(n.tolerance/((1<<n.maxZoom)*n.extent))**2,s=[],c=t.id;if(n.promoteId?c=t.properties[n.promoteId]:n.generateId&&(c=r||0),a===`Point`)he(i,s);else if(a===`MultiPoint`)for(var l=0;l<i.length;l++)he(i[l],s);else if(a===`LineString`)ge(i,s,o,!1);else if(a===`MultiLineString`)if(n.lineMetrics){for(l=0;l<i.length;l++)s=[],ge(i[l],s,o,!1),e.push(ue(c,`LineString`,s,t.properties));return}else _e(i,s,o,!1);else if(a===`Polygon`)_e(i,s,o,!0);else if(a===`MultiPolygon`)for(l=0;l<i.length;l++){var u=[];_e(i[l],u,o,!0),s.push(u)}else if(a===`GeometryCollection`){for(l=0;l<t.geometry.geometries.length;l++)me(e,{id:c,geometry:t.geometry.geometries[l],properties:t.properties},n,r);return}else throw Error(`Input data is not a valid GeoJSON object.`);e.push(ue(c,a,s,t.properties))}}function he(e,t){t.push(ve(e[0])),t.push(ye(e[1])),t.push(0)}function ge(e,t,n,r){for(var i,a,o=0,s=0;s<e.length;s++){var c=ve(e[s][0]),l=ye(e[s][1]);t.push(c),t.push(l),t.push(0),s>0&&(r?o+=(i*l-c*a)/2:o+=Math.sqrt((c-i)**2+(l-a)**2)),i=c,a=l}var u=t.length-3;t[2]=1,ce(t,0,u,n),t[u+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function _e(e,t,n,r){for(var i=0;i<e.length;i++){var a=[];ge(e[i],a,n,r),t.push(a)}}function ve(e){return e/360+.5}function ye(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function be(e,t,n,r,i,a,o,s){if(n/=t,r/=t,a>=n&&o<r)return e;if(o<n||a>=r)return null;for(var c=[],l=0;l<e.length;l++){var u=e[l],d=u.geometry,f=u.type,p=i===0?u.minX:u.minY,m=i===0?u.maxX:u.maxY;if(p>=n&&m<r){c.push(u);continue}else if(m<n||p>=r)continue;var h=[];if(f===`Point`||f===`MultiPoint`)xe(d,h,n,r,i);else if(f===`LineString`)Se(d,h,n,r,i,!1,s.lineMetrics);else if(f===`MultiLineString`)we(d,h,n,r,i,!1);else if(f===`Polygon`)we(d,h,n,r,i,!0);else if(f===`MultiPolygon`)for(var g=0;g<d.length;g++){var _=[];we(d[g],_,n,r,i,!0),_.length&&h.push(_)}if(h.length){if(s.lineMetrics&&f===`LineString`){for(g=0;g<h.length;g++)c.push(ue(u.id,f,h[g],u.tags));continue}(f===`LineString`||f===`MultiLineString`)&&(h.length===1?(f=`LineString`,h=h[0]):f=`MultiLineString`),(f===`Point`||f===`MultiPoint`)&&(f=h.length===3?`Point`:`MultiPoint`),c.push(ue(u.id,f,h,u.tags))}}return c.length?c:null}function xe(e,t,n,r,i){for(var a=0;a<e.length;a+=3){var o=e[a+i];o>=n&&o<=r&&(t.push(e[a]),t.push(e[a+1]),t.push(e[a+2]))}}function Se(e,t,n,r,i,a,o){for(var s=Ce(e),c=i===0?Ee:De,l=e.start,u,d,f=0;f<e.length-3;f+=3){var p=e[f],m=e[f+1],h=e[f+2],g=e[f+3],_=e[f+4],v=i===0?p:m,y=i===0?g:_,b=!1;o&&(u=Math.sqrt((p-g)**2+(m-_)**2)),v<n?y>n&&(d=c(s,p,m,g,_,n),o&&(s.start=l+u*d)):v>r?y<r&&(d=c(s,p,m,g,_,r),o&&(s.start=l+u*d)):Te(s,p,m,h),y<n&&v>=n&&(d=c(s,p,m,g,_,n),b=!0),y>r&&v<=r&&(d=c(s,p,m,g,_,r),b=!0),!a&&b&&(o&&(s.end=l+u*d),t.push(s),s=Ce(e)),o&&(l+=u)}var x=e.length-3;p=e[x],m=e[x+1],h=e[x+2],v=i===0?p:m,v>=n&&v<=r&&Te(s,p,m,h),x=s.length-3,a&&x>=3&&(s[x]!==s[0]||s[x+1]!==s[1])&&Te(s,s[0],s[1],s[2]),s.length&&t.push(s)}function Ce(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function we(e,t,n,r,i,a){for(var o=0;o<e.length;o++)Se(e[o],t,n,r,i,a,!1)}function Te(e,t,n,r){e.push(t),e.push(n),e.push(r)}function Ee(e,t,n,r,i,a){var o=(a-t)/(r-t);return e.push(a),e.push(n+(i-n)*o),e.push(1),o}function De(e,t,n,r,i,a){var o=(a-n)/(i-n);return e.push(t+(r-t)*o),e.push(a),e.push(1),o}function Oe(e,t){var n=t.buffer/t.extent,r=e,i=be(e,1,-1-n,n,0,-1,2,t),a=be(e,1,1-n,2+n,0,-1,2,t);return(i||a)&&(r=be(e,1,-n,1+n,0,-1,2,t)||[],i&&(r=ke(i,1).concat(r)),a&&(r=r.concat(ke(a,-1)))),r}function ke(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=i.type,o;if(a===`Point`||a===`MultiPoint`||a===`LineString`)o=Ae(i.geometry,t);else if(a===`MultiLineString`||a===`Polygon`){o=[];for(var s=0;s<i.geometry.length;s++)o.push(Ae(i.geometry[s],t))}else if(a===`MultiPolygon`)for(o=[],s=0;s<i.geometry.length;s++){for(var c=[],l=0;l<i.geometry[s].length;l++)c.push(Ae(i.geometry[s][l],t));o.push(c)}n.push(ue(i.id,a,o,i.tags))}return n}function Ae(e,t){var n=[];n.size=e.size,e.start!==void 0&&(n.start=e.start,n.end=e.end);for(var r=0;r<e.length;r+=3)n.push(e[r]+t,e[r+1],e[r+2]);return n}function je(e,t){if(e.transformed)return e;var n=1<<e.z,r=e.x,i=e.y,a,o,s;for(a=0;a<e.features.length;a++){var c=e.features[a],l=c.geometry,u=c.type;if(c.geometry=[],u===1)for(o=0;o<l.length;o+=2)c.geometry.push(Me(l[o],l[o+1],t,n,r,i));else for(o=0;o<l.length;o++){var d=[];for(s=0;s<l[o].length;s+=2)d.push(Me(l[o][s],l[o][s+1],t,n,r,i));c.geometry.push(d)}}return e.transformed=!0,e}function Me(e,t,n,r,i,a){return[Math.round(n*(e*r-i)),Math.round(n*(t*r-a))]}function Ne(e,t,n,r,i){for(var a=t===i.maxZoom?0:i.tolerance/((1<<t)*i.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:r,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<e.length;s++){o.numFeatures++,Pe(o,e[s],a,i);var c=e[s].minX,l=e[s].minY,u=e[s].maxX,d=e[s].maxY;c<o.minX&&(o.minX=c),l<o.minY&&(o.minY=l),u>o.maxX&&(o.maxX=u),d>o.maxY&&(o.maxY=d)}return o}function Pe(e,t,n,r){var i=t.geometry,a=t.type,o=[];if(a===`Point`||a===`MultiPoint`)for(var s=0;s<i.length;s+=3)o.push(i[s]),o.push(i[s+1]),e.numPoints++,e.numSimplified++;else if(a===`LineString`)Fe(o,i,e,n,!1,!1);else if(a===`MultiLineString`||a===`Polygon`)for(s=0;s<i.length;s++)Fe(o,i[s],e,n,a===`Polygon`,s===0);else if(a===`MultiPolygon`)for(var c=0;c<i.length;c++){var l=i[c];for(s=0;s<l.length;s++)Fe(o,l[s],e,n,!0,s===0)}if(o.length){var u=t.tags||null;if(a===`LineString`&&r.lineMetrics){for(var d in u={},t.tags)u[d]=t.tags[d];u.mapbox_clip_start=i.start/i.size,u.mapbox_clip_end=i.end/i.size}var f={geometry:o,type:a===`Polygon`||a===`MultiPolygon`?3:a===`LineString`||a===`MultiLineString`?2:1,tags:u};t.id!==null&&(f.id=t.id),e.features.push(f)}}function Fe(e,t,n,r,i,a){var o=r*r;if(r>0&&t.size<(i?o:r)){n.numPoints+=t.length/3;return}for(var s=[],c=0;c<t.length;c+=3)(r===0||t[c+2]>o)&&(n.numSimplified++,s.push(t[c]),s.push(t[c+1])),n.numPoints++;i&&Ie(s,a),e.push(s)}function Ie(e,t){for(var n=0,r=0,i=e.length,a=i-2;r<i;a=r,r+=2)n+=(e[r]-e[a])*(e[r+1]+e[a+1]);if(n>0===t)for(r=0,i=e.length;r<i/2;r+=2){var o=e[r],s=e[r+1];e[r]=e[i-2-r],e[r+1]=e[i-1-r],e[i-2-r]=o,e[i-1-r]=s}}function Le(e,t){return new Re(e,t)}function Re(e,t){t=this.options=Be(Object.create(this.options),t);var n=t.debug;if(n&&console.time(`preprocess data`),t.maxZoom<0||t.maxZoom>24)throw Error(`maxZoom should be in the 0-24 range`);if(t.promoteId&&t.generateId)throw Error(`promoteId and generateId cannot be used together.`);var r=pe(e,t);this.tiles={},this.tileCoords=[],n&&(console.timeEnd(`preprocess data`),console.log(`index: maxZoom: %d, maxPoints: %d`,t.indexMaxZoom,t.indexMaxPoints),console.time(`generate tiles`),this.stats={},this.total=0),r=Oe(r,t),r.length&&this.splitTile(r,0,0,0),n&&(r.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)))}Re.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Re.prototype.splitTile=function(e,t,n,r,i,a,o){for(var s=[e,t,n,r],c=this.options,l=c.debug;s.length;){r=s.pop(),n=s.pop(),t=s.pop(),e=s.pop();var u=1<<t,d=ze(t,n,r),f=this.tiles[d];if(!f&&(l>1&&console.time(`creation`),f=this.tiles[d]=Ne(e,t,n,r,c),this.tileCoords.push({z:t,x:n,y:r}),l)){l>1&&(console.log(`tile z%d-%d-%d (features: %d, points: %d, simplified: %d)`,t,n,r,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd(`creation`));var p=`z`+t;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(f.source=e,i){if(t===c.maxZoom||t===i)continue;var m=1<<i-t;if(n!==Math.floor(a/m)||r!==Math.floor(o/m))continue}else if(t===c.indexMaxZoom||f.numPoints<=c.indexMaxPoints)continue;if(f.source=null,e.length!==0){l>1&&console.time(`clipping`);var h=.5*c.buffer/c.extent,g=.5-h,_=.5+h,v=1+h,y=b=x=S=null,b,x,S,C=be(e,u,n-h,n+_,0,f.minX,f.maxX,c),w=be(e,u,n+g,n+v,0,f.minX,f.maxX,c);e=null,C&&=(y=be(C,u,r-h,r+_,1,f.minY,f.maxY,c),b=be(C,u,r+g,r+v,1,f.minY,f.maxY,c),null),w&&=(x=be(w,u,r-h,r+_,1,f.minY,f.maxY,c),S=be(w,u,r+g,r+v,1,f.minY,f.maxY,c),null),l>1&&console.timeEnd(`clipping`),s.push(y||[],t+1,n*2,r*2),s.push(b||[],t+1,n*2,r*2+1),s.push(x||[],t+1,n*2+1,r*2),s.push(S||[],t+1,n*2+1,r*2+1)}}},Re.prototype.getTile=function(e,t,n){var r=this.options,i=r.extent,a=r.debug;if(e<0||e>24)return null;var o=1<<e;t=(t%o+o)%o;var s=ze(e,t,n);if(this.tiles[s])return je(this.tiles[s],i);a>1&&console.log(`drilling down to z%d-%d-%d`,e,t,n);for(var c=e,l=t,u=n,d;!d&&c>0;)c--,l=Math.floor(l/2),u=Math.floor(u/2),d=this.tiles[ze(c,l,u)];return!d||!d.source?null:(a>1&&console.log(`found parent tile z%d-%d-%d`,c,l,u),a>1&&console.time(`drilling down`),this.splitTile(d.source,c,l,u,e,t,n),a>1&&console.timeEnd(`drilling down`),this.tiles[s]?je(this.tiles[s],i):null)};function ze(e,t,n){return((1<<e)*n+t)*32+e}function Be(e,t){for(var n in t)e[n]=t[n];return e}function Ve(e,t){var n=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);var r=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!r)return t(null,null);var i=new y(r.features),a=w(i);(a.byteOffset!==0||a.byteLength!==a.buffer.byteLength)&&(a=new Uint8Array(a)),t(null,{vectorTile:i,rawData:a.buffer})}var He=function(t){function n(e,n,r,i){t.call(this,e,n,r,Ve),i&&(this.loadGeoJSON=i)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&this._state!==`Idle`?this._state=`NeedsLoadData`:(this._state=`Coalescing`,this._loadData())},n.prototype._loadData=function(){var t=this;if(!(!this._pendingCallback||!this._pendingLoadDataParams)){var n=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=r&&r.request&&r.request.collectResourceTiming?new e.RequestPerformance(r.request):!1;this.loadGeoJSON(r,function(a,o){if(a||!o)return n(a);if(typeof o!=`object`)return n(Error(`Input data given to '`+r.source+`' is not a valid GeoJSON object.`));p(o,!0);try{if(r.filter){var s=e.createExpression(r.filter,{type:`boolean`,"property-type":`data-driven`,overridable:!1,transition:!1});if(s.result===`error`)throw Error(s.value.map(function(e){return e.key+`: `+e.message}).join(`, `));o={type:`FeatureCollection`,features:o.features.filter(function(e){return s.value.evaluate({zoom:0},e)})}}t._geoJSONIndex=r.cluster?new Y(Ue(r)).load(o.features):Le(o,r.geojsonVtOptions)}catch(e){return n(e)}t.loaded={};var c={};if(i){var l=i.finish();l&&(c.resourceTiming={},c.resourceTiming[r.source]=JSON.parse(JSON.stringify(l)))}n(null,c)})}},n.prototype.coalesce=function(){this._state===`Coalescing`?this._state=`Idle`:this._state===`NeedsLoadData`&&(this._state=`Coalescing`,this._loadData())},n.prototype.reloadTile=function(e,n){var r=this.loaded,i=e.uid;return r&&r[i]?t.prototype.reloadTile.call(this,e,n):this.loadTile(e,n)},n.prototype.loadGeoJSON=function(t,n){if(t.request)e.getJSON(t.request,n);else if(typeof t.data==`string`)try{return n(null,JSON.parse(t.data))}catch{return n(Error(`Input data given to '`+t.source+`' is not a valid GeoJSON object.`))}else return n(Error(`Input data given to '`+t.source+`' is not a valid GeoJSON object.`))},n.prototype.removeSource=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()},n.prototype.getClusterExpansionZoom=function(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}},n.prototype.getClusterChildren=function(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}},n.prototype.getClusterLeaves=function(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}},n}(u);function Ue(t){var n=t.superclusterOptions,r=t.clusterProperties;if(!r||!n)return n;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},c=Object.keys(r),l=0,u=c;l<u.length;l+=1){var d=u[l],f=r[d],p=f[0],m=f[1],h=e.createExpression(m),g=e.createExpression(typeof p==`string`?[p,[`accumulated`],[`get`,d]]:p);i[d]=h.value,a[d]=g.value}return n.map=function(e){s.properties=e;for(var t={},n=0,r=c;n<r.length;n+=1){var a=r[n];t[a]=i[a].evaluate(o,s)}return t},n.reduce=function(e,t){s.properties=t;for(var n=0,r=c;n<r.length;n+=1){var i=r[n];o.accumulated=e[i],e[i]=a[i].evaluate(o,s)}},n}var We=function(t){var n=this;this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:u,geojson:He},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(e,t){if(n.workerSourceTypes[e])throw Error(`Worker source with name "`+e+`" already registered.`);n.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=function(t){if(e.plugin.isParsed())throw Error(`RTL text plugin already registered.`);e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText}};return We.prototype.setReferrer=function(e,t){this.referrer=t},We.prototype.setImages=function(e,t,n){for(var r in this.availableImages[e]=t,this.workerSources[e]){var i=this.workerSources[e][r];for(var a in i)i[a].availableImages=t}n()},We.prototype.setLayers=function(e,t,n){this.getLayerIndex(e).replace(t),n()},We.prototype.updateLayers=function(e,t,n){this.getLayerIndex(e).update(t.layers,t.removedIds),n()},We.prototype.loadTile=function(e,t,n){this.getWorkerSource(e,t.type,t.source).loadTile(t,n)},We.prototype.loadDEMTile=function(e,t,n){this.getDEMWorkerSource(e,t.source).loadTile(t,n)},We.prototype.reloadTile=function(e,t,n){this.getWorkerSource(e,t.type,t.source).reloadTile(t,n)},We.prototype.abortTile=function(e,t,n){this.getWorkerSource(e,t.type,t.source).abortTile(t,n)},We.prototype.removeTile=function(e,t,n){this.getWorkerSource(e,t.type,t.source).removeTile(t,n)},We.prototype.removeDEMTile=function(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t)},We.prototype.removeSource=function(e,t,n){if(!(!this.workerSources[e]||!this.workerSources[e][t.type]||!this.workerSources[e][t.type][t.source])){var r=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],r.removeSource===void 0?n():r.removeSource(t,n)}},We.prototype.loadWorkerSource=function(e,t,n){try{this.self.importScripts(t.url),n()}catch(e){n(e.toString())}},We.prototype.syncRTLPluginState=function(t,n,r){try{e.plugin.setState(n);var i=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&i!=null){this.self.importScripts(i);var a=e.plugin.isParsed();r(a?void 0:Error(`RTL Text Plugin failed to import scripts from `+i),a)}}catch(e){r(e.toString())}},We.prototype.getAvailableImages=function(e){var t=this.availableImages[e];return t||=[],t},We.prototype.getLayerIndex=function(e){var t=this.layerIndexes[e];return t||=this.layerIndexes[e]=new i,t},We.prototype.getWorkerSource=function(e,t,n){var r=this;if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][n]){var i={send:function(t,n,i){r.actor.send(t,n,i,e)}};this.workerSources[e][t][n]=new this.workerSourceTypes[t](i,this.getLayerIndex(e),this.getAvailableImages(e))}return this.workerSources[e][t][n]},We.prototype.getDEMWorkerSource=function(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new f),this.demWorkerSources[e][t]},We.prototype.enforceCacheSizeLimit=function(t,n){e.enforceCacheSizeLimit(n)},typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope&&(self.worker=new We(self)),We}),r([`./shared`],function(e){var t=e.createCommonjsModule(function(e){e.exports?e.exports=t:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=t,window.mapboxgl.notSupportedReason=n);function t(e){return!n(e)}function n(e){if(!r())return`not a browser`;if(!i())return`insufficent Array support`;if(!a())return`insufficient Function support`;if(!o())return`insufficient Object support`;if(!s())return`insufficient JSON support`;if(!c())return`insufficient worker support`;if(!l())return`insufficient Uint8ClampedArray support`;if(!u())return`insufficient ArrayBuffer support`;if(!d())return`insufficient Canvas/getImageData support`;if(!p(e&&e.failIfMajorPerformanceCaveat))return`insufficient WebGL support`}function r(){return typeof window<`u`&&typeof document<`u`}function i(){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 a(){return Function.prototype&&Function.prototype.bind}function o(){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 s(){return`JSON`in window&&`parse`in JSON&&`stringify`in JSON}function c(){if(!(`Worker`in window&&`Blob`in window&&`URL`in window))return!1;var e=new Blob([``],{type:`text/javascript`}),t=URL.createObjectURL(e),n,r;try{r=new Worker(t),n=!0}catch{n=!1}return r&&r.terminate(),URL.revokeObjectURL(t),n}function l(){return`Uint8ClampedArray`in window}function u(){return ArrayBuffer.isView}function d(){var e=document.createElement(`canvas`);e.width=e.height=1;var t=e.getContext(`2d`);if(!t)return!1;var n=t.getImageData(0,0,1,1);return n&&n.width===e.width}var f={};function p(e){return f[e]===void 0&&(f[e]=h(e)),f[e]}t.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};function m(e){var n=document.createElement(`canvas`),r=Object.create(t.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=e,n.probablySupportsContext?n.probablySupportsContext(`webgl`,r)||n.probablySupportsContext(`experimental-webgl`,r):n.supportsContext?n.supportsContext(`webgl`,r)||n.supportsContext(`experimental-webgl`,r):n.getContext(`webgl`,r)||n.getContext(`experimental-webgl`,r)}function h(e){var t=m(e);if(!t)return!1;var n=t.createShader(t.VERTEX_SHADER);return!n||t.isContextLost()?!1:(t.shaderSource(n,`void main() {}`),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)===!0)}}),n={};n.create=function(t,n,r){var i=e.window.document.createElement(t);return n!==void 0&&(i.className=n),r&&r.appendChild(i),i},n.createNS=function(t,n){return e.window.document.createElementNS(t,n)};var r=e.window.document&&e.window.document.documentElement.style;function i(e){if(!r)return e[0];for(var t=0;t<e.length;t++)if(e[t]in r)return e[t];return e[0]}var a=i([`userSelect`,`MozUserSelect`,`WebkitUserSelect`,`msUserSelect`]),o;n.disableDrag=function(){r&&a&&(o=r[a],r[a]=`none`)},n.enableDrag=function(){r&&a&&(r[a]=o)};var s=i([`transform`,`WebkitTransform`]);n.setTransform=function(e,t){e.style[s]=t};var c=!1;try{var l=Object.defineProperty({},`passive`,{get:function(){c=!0}});e.window.addEventListener(`test`,l,l),e.window.removeEventListener(`test`,l,l)}catch{c=!1}n.addEventListener=function(e,t,n,r){r===void 0&&(r={}),`passive`in r&&c?e.addEventListener(t,n,r):e.addEventListener(t,n,r.capture)},n.removeEventListener=function(e,t,n,r){r===void 0&&(r={}),`passive`in r&&c?e.removeEventListener(t,n,r):e.removeEventListener(t,n,r.capture)};var u=function(t){t.preventDefault(),t.stopPropagation(),e.window.removeEventListener(`click`,u,!0)};n.suppressClick=function(){e.window.addEventListener(`click`,u,!0),e.window.setTimeout(function(){e.window.removeEventListener(`click`,u,!0)},0)},n.mousePos=function(t,n){var r=t.getBoundingClientRect();return new e.Point(n.clientX-r.left-t.clientLeft,n.clientY-r.top-t.clientTop)},n.touchPos=function(t,n){for(var r=t.getBoundingClientRect(),i=[],a=0;a<n.length;a++)i.push(new e.Point(n[a].clientX-r.left-t.clientLeft,n[a].clientY-r.top-t.clientTop));return i},n.mouseButton=function(t){return e.window.InstallTrigger!==void 0&&t.button===2&&t.ctrlKey&&e.window.navigator.platform.toUpperCase().indexOf(`MAC`)>=0?0:t.button},n.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};function d(t,n,r){var i,a,o,s=e.browser.devicePixelRatio>1?`@2x`:``,c=e.getJSON(n.transformRequest(n.normalizeSpriteURL(t,s,`.json`),e.ResourceType.SpriteJSON),function(e,t){c=null,o||(o=e,i=t,u())}),l=e.getImage(n.transformRequest(n.normalizeSpriteURL(t,s,`.png`),e.ResourceType.SpriteImage),function(e,t){l=null,o||(o=e,a=t,u())});function u(){if(o)r(o);else if(i&&a){var t=e.browser.getImageData(a),n={};for(var s in i){var c=i[s],l=c.width,u=c.height,d=c.x,f=c.y,p=c.sdf,m=c.pixelRatio,h=c.stretchX,g=c.stretchY,_=c.content,v=new e.RGBAImage({width:l,height:u});e.RGBAImage.copy(t,v,{x:d,y:f},{x:0,y:0},{width:l,height:u}),n[s]={data:v,pixelRatio:m,sdf:p,stretchX:h,stretchY:g,content:_}}r(null,n)}}return{cancel:function(){c&&=(c.cancel(),null),l&&=(l.cancel(),null)}}}function f(e){var t=e.userImage;return t&&t.render&&t.render()?(e.data.replace(new Uint8Array(t.data.buffer)),!0):!1}var p=1,m=function(t){function n(){t.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.isLoaded=function(){return this.loaded},n.prototype.setLoaded=function(e){if(this.loaded!==e&&(this.loaded=e,e)){for(var t=0,n=this.requestors;t<n.length;t+=1){var r=n[t],i=r.ids,a=r.callback;this._notify(i,a)}this.requestors=[]}},n.prototype.getImage=function(e){return this.images[e]},n.prototype.addImage=function(e,t){this._validate(e,t)&&(this.images[e]=t)},n.prototype._validate=function(t,n){var r=!0;return this._validateStretch(n.stretchX,n.data&&n.data.width)||(this.fire(new e.ErrorEvent(Error(`Image "`+t+`" has invalid "stretchX" value`))),r=!1),this._validateStretch(n.stretchY,n.data&&n.data.height)||(this.fire(new e.ErrorEvent(Error(`Image "`+t+`" has invalid "stretchY" value`))),r=!1),this._validateContent(n.content,n)||(this.fire(new e.ErrorEvent(Error(`Image "`+t+`" has invalid "content" value`))),r=!1),r},n.prototype._validateStretch=function(e,t){if(!e)return!0;for(var n=0,r=0,i=e;r<i.length;r+=1){var a=i[r];if(a[0]<n||a[1]<a[0]||t<a[1])return!1;n=a[1]}return!0},n.prototype._validateContent=function(e,t){return e?!(e.length!==4||e[0]<0||t.data.width<e[0]||e[1]<0||t.data.height<e[1]||e[2]<0||t.data.width<e[2]||e[3]<0||t.data.height<e[3]||e[2]<e[0]||e[3]<e[1]):!0},n.prototype.updateImage=function(e,t){t.version=this.images[e].version+1,this.images[e]=t,this.updatedImages[e]=!0},n.prototype.removeImage=function(e){var t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()},n.prototype.listImages=function(){return Object.keys(this.images)},n.prototype.getImages=function(e,t){var n=!0;if(!this.isLoaded())for(var r=0,i=e;r<i.length;r+=1){var a=i[r];this.images[a]||(n=!1)}this.isLoaded()||n?this._notify(e,t):this.requestors.push({ids:e,callback:t})},n.prototype._notify=function(t,n){for(var r={},i=0,a=t;i<a.length;i+=1){var o=a[i];this.images[o]||this.fire(new e.Event(`styleimagemissing`,{id:o}));var s=this.images[o];s?r[o]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:!!(s.userImage&&s.userImage.render)}:e.warnOnce(`Image "`+o+`" 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.`)}n(null,r)},n.prototype.getPixelSize=function(){var e=this.atlasImage;return{width:e.width,height:e.height}},n.prototype.getPattern=function(t){var n=this.patterns[t],r=this.getImage(t);if(!r)return null;if(n&&n.position.version===r.version)return n.position;if(n)n.position.version=r.version;else{var i={w:r.data.width+p*2,h:r.data.height+p*2,x:0,y:0},a=new e.ImagePosition(i,r);this.patterns[t]={bin:i,position:a}}return this._updatePatternAtlas(),this.patterns[t].position},n.prototype.bind=function(t){var n=t.gl;this.atlasTexture?this.dirty&&=(this.atlasTexture.update(this.atlasImage),!1):this.atlasTexture=new e.Texture(t,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)},n.prototype._updatePatternAtlas=function(){var t=[];for(var n in this.patterns)t.push(this.patterns[n].bin);var r=e.potpack(t),i=r.w,a=r.h,o=this.atlasImage;for(var s in o.resize({width:i||1,height:a||1}),this.patterns){var c=this.patterns[s].bin,l=c.x+p,u=c.y+p,d=this.images[s].data,f=d.width,m=d.height;e.RGBAImage.copy(d,o,{x:0,y:0},{x:l,y:u},{width:f,height:m}),e.RGBAImage.copy(d,o,{x:0,y:m-1},{x:l,y:u-1},{width:f,height:1}),e.RGBAImage.copy(d,o,{x:0,y:0},{x:l,y:u+m},{width:f,height:1}),e.RGBAImage.copy(d,o,{x:f-1,y:0},{x:l-1,y:u},{width:1,height:m}),e.RGBAImage.copy(d,o,{x:0,y:0},{x:l+f,y:u},{width:1,height:m})}this.dirty=!0},n.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},n.prototype.dispatchRenderCallbacks=function(e){for(var t=0,n=e;t<n.length;t+=1){var r=n[t];if(!this.callbackDispatchedThisFrame[r]){this.callbackDispatchedThisFrame[r]=!0;var i=this.images[r];f(i)&&this.updateImage(r,i)}}},n}(e.Evented);function h(t,n,r,i,a){var o=n*256,s=o+255,c=i.transformRequest(i.normalizeGlyphsURL(r).replace(`{fontstack}`,t).replace(`{range}`,o+`-`+s),e.ResourceType.Glyphs);e.getArrayBuffer(c,function(t,n){if(t)a(t);else if(n){for(var r={},i=0,o=e.parseGlyphPBF(n);i<o.length;i+=1){var s=o[i];r[s.id]=s}a(null,r)}})}var g=y,_=y,v=0x56bc75e2d63100000;function y(e,t,n,r,i,a){this.fontSize=e||24,this.buffer=t===void 0?3:t,this.cutoff=r||.25,this.fontFamily=i||`sans-serif`,this.fontWeight=a||`normal`,this.radius=n||8;var o=this.size=this.fontSize+this.buffer*2;this.canvas=document.createElement(`canvas`),this.canvas.width=this.canvas.height=o,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(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf(`Gecko/`)>=0?1.2:1))}y.prototype.draw=function(e){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(e,this.buffer,this.middle);for(var t=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),r=0;r<this.size*this.size;r++){var i=t.data[r*4+3]/255;this.gridOuter[r]=i===1?0:i===0?v:Math.max(0,.5-i)**2,this.gridInner[r]=i===1?v:i===0?0:Math.max(0,i-.5)**2}for(b(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),b(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),r=0;r<this.size*this.size;r++){var a=this.gridOuter[r]-this.gridInner[r];n[r]=Math.max(0,Math.min(255,Math.round(255-255*(a/this.radius+this.cutoff))))}return n};function b(e,t,n,r,i,a,o){for(var s=0;s<t;s++){for(var c=0;c<n;c++)r[c]=e[c*t+s];for(x(r,i,a,o,n),c=0;c<n;c++)e[c*t+s]=i[c]}for(c=0;c<n;c++){for(s=0;s<t;s++)r[s]=e[c*t+s];for(x(r,i,a,o,t),s=0;s<t;s++)e[c*t+s]=Math.sqrt(i[s])}}function x(e,t,n,r,i){n[0]=0,r[0]=-v,r[1]=+v;for(var a=1,o=0;a<i;a++){for(var s=(e[a]+a*a-(e[n[o]]+n[o]*n[o]))/(2*a-2*n[o]);s<=r[o];)o--,s=(e[a]+a*a-(e[n[o]]+n[o]*n[o]))/(2*a-2*n[o]);o++,n[o]=a,r[o]=s,r[o+1]=+v}for(a=0,o=0;a<i;a++){for(;r[o+1]<a;)o++;t[a]=(a-n[o])*(a-n[o])+e[n[o]]}}g.default=_;var S=function(e,t){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={}};S.prototype.setURL=function(e){this.url=e},S.prototype.getGlyphs=function(t,n){var r=this,i=[];for(var a in t)for(var o=0,s=t[a];o<s.length;o+=1){var c=s[o];i.push({stack:a,id:c})}e.asyncAll(i,function(e,t){var n=e.stack,i=e.id,a=r.entries[n];a||=r.entries[n]={glyphs:{},requests:{},ranges:{}};var o=a.glyphs[i];if(o!==void 0){t(null,{stack:n,id:i,glyph:o});return}if(o=r._tinySDF(a,n,i),o){a.glyphs[i]=o,t(null,{stack:n,id:i,glyph:o});return}var s=Math.floor(i/256);if(s*256>65535){t(Error(`glyphs > 65535 not supported`));return}if(a.ranges[s]){t(null,{stack:n,id:i,glyph:o});return}var c=a.requests[s];c||(c=a.requests[s]=[],S.loadGlyphRange(n,s,r.url,r.requestManager,function(e,t){if(t){for(var n in t)r._doesCharSupportLocalGlyph(+n)||(a.glyphs[+n]=t[+n]);a.ranges[s]=!0}for(var i=0,o=c;i<o.length;i+=1){var l=o[i];l(e,t)}delete a.requests[s]})),c.push(function(e,r){e?t(e):r&&t(null,{stack:n,id:i,glyph:r[i]||null})})},function(e,t){if(e)n(e);else if(t){for(var r={},i=0,a=t;i<a.length;i+=1){var o=a[i],s=o.stack,c=o.id,l=o.glyph;(r[s]||(r[s]={}))[c]=l&&{id:l.id,bitmap:l.bitmap.clone(),metrics:l.metrics}}n(null,r)}})},S.prototype._doesCharSupportLocalGlyph=function(t){return!!this.localIdeographFontFamily&&(e.isChar[`CJK Unified Ideographs`](t)||e.isChar[`Hangul Syllables`](t)||e.isChar.Hiragana(t)||e.isChar.Katakana(t))},S.prototype._tinySDF=function(t,n,r){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(r)){var a=t.tinySDF;if(!a){var o=`400`;/bold/i.test(n)?o=`900`:/medium/i.test(n)?o=`500`:/light/i.test(n)&&(o=`200`),a=t.tinySDF=new S.TinySDF(24,3,8,.25,i,o)}return{id:r,bitmap:new e.AlphaImage({width:30,height:30},a.draw(String.fromCharCode(r))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},S.loadGlyphRange=h,S.TinySDF=g;var C=function(){this.specification=e.styleSpec.light.position};C.prototype.possiblyEvaluate=function(t,n){return e.sphericalToCartesian(t.expression.evaluate(n))},C.prototype.interpolate=function(t,n,r){return{x:e.number(t.x,n.x,r),y:e.number(t.y,n.y,r),z:e.number(t.z,n.z,r)}};var w=new e.Properties({anchor:new e.DataConstantProperty(e.styleSpec.light.anchor),position:new C,color:new e.DataConstantProperty(e.styleSpec.light.color),intensity:new e.DataConstantProperty(e.styleSpec.light.intensity)}),T=`-transition`,E=function(t){function n(n){t.call(this),this._transitionable=new e.Transitionable(w),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.getLight=function(){return this._transitionable.serialize()},n.prototype.setLight=function(t,n){if(n===void 0&&(n={}),!this._validate(e.validateLight,t,n))for(var r in t){var i=t[r];e.endsWith(r,T)?this._transitionable.setTransition(r.slice(0,-T.length),i):this._transitionable.setValue(r,i)}},n.prototype.updateTransitions=function(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)},n.prototype.hasTransition=function(){return this._transitioning.hasTransition()},n.prototype.recalculate=function(e){this.properties=this._transitioning.possiblyEvaluate(e)},n.prototype._validate=function(t,n,r){return r&&r.validate===!1?!1:e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:e.styleSpec})))},n}(e.Evented),D=function(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};D.prototype.getDash=function(e,t){var n=e.join(`,`)+String(t);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(e,t)),this.dashEntry[n]},D.prototype.getDashRanges=function(e,t,n){var r=e.length%2==1,i=[],a=r?-e[e.length-1]*n:0,o=e[0]*n,s=!0;i.push({left:a,right:o,isDash:s,zeroLength:e[0]===0});for(var c=e[0],l=1;l<e.length;l++){s=!s;var u=e[l];a=c*n,c+=u,o=c*n,i.push({left:a,right:o,isDash:s,zeroLength:u===0})}return i},D.prototype.addRoundDash=function(e,t,n){for(var r=t/2,i=-n;i<=n;i++)for(var a=this.nextRow+n+i,o=this.width*a,s=0,c=e[s],l=0;l<this.width;l++){l/c.right>1&&(c=e[++s]);var u=Math.abs(l-c.left),d=Math.abs(l-c.right),f=Math.min(u,d),p=void 0,m=i/n*(r+1);if(c.isDash){var h=r-Math.abs(m);p=Math.sqrt(f*f+h*h)}else p=r-Math.sqrt(f*f+m*m);this.data[o+l]=Math.max(0,Math.min(255,p+128))}},D.prototype.addRegularDash=function(e){for(var t=e.length-1;t>=0;--t){var n=e[t],r=e[t+1];n.zeroLength?e.splice(t,1):r&&r.isDash===n.isDash&&(r.left=n.left,e.splice(t,1))}var i=e[0],a=e[e.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,c=e[s],l=0;l<this.width;l++){l/c.right>1&&(c=e[++s]);var u=Math.abs(l-c.left),d=Math.abs(l-c.right),f=Math.min(u,d),p=c.isDash?f:-f;this.data[o+l]=Math.max(0,Math.min(255,p+128))}},D.prototype.addDash=function(t,n){var r=n?7:0,i=2*r+1;if(this.nextRow+i>this.height)return e.warnOnce(`LineAtlas out of space`),null;for(var a=0,o=0;o<t.length;o++)a+=t[o];if(a!==0){var s=this.width/a,c=this.getDashRanges(t,this.width,s);n?this.addRoundDash(c,s,r):this.addRegularDash(c)}var l={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:a};return this.nextRow+=i,this.dirty=!0,l},D.prototype.bind=function(e){var t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))};var O=function t(n,r){this.workerPool=n,this.actors=[],this.currentActor=0,this.id=e.uniqueId();for(var i=this.workerPool.acquire(this.id),a=0;a<i.length;a++){var o=i[a],s=new t.Actor(o,r,this.id);s.name=`Worker `+a,this.actors.push(s)}};O.prototype.broadcast=function(t,n,r){r||=function(){},e.asyncAll(this.actors,function(e,r){e.send(t,n,r)},r)},O.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},O.prototype.remove=function(){this.actors.forEach(function(e){e.remove()}),this.actors=[],this.workerPool.release(this.id)},O.Actor=e.Actor;function k(t,n,r){var i=function(i,a){if(i)return r(i);if(a){var o=e.pick(e.extend(a,t),[`tiles`,`minzoom`,`maxzoom`,`attribution`,`mapbox_logo`,`bounds`,`scheme`,`tileSize`,`encoding`]);a.vector_layers&&(o.vectorLayers=a.vector_layers,o.vectorLayerIds=o.vectorLayers.map(function(e){return e.id})),o.tiles=n.canonicalizeTileset(o,t.url),r(null,o)}};return t.url?e.getJSON(n.transformRequest(n.normalizeSourceURL(t.url),e.ResourceType.Source),i):e.browser.frame(function(){return i(null,t)})}var A=function(t,n,r){this.bounds=e.LngLatBounds.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=r||24};A.prototype.validateBounds=function(e){return!Array.isArray(e)||e.length!==4?[-180,-90,180,90]:[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]},A.prototype.contains=function(t){var n=2**t.z,r={minX:Math.floor(e.mercatorXfromLng(this.bounds.getWest())*n),minY:Math.floor(e.mercatorYfromLat(this.bounds.getNorth())*n),maxX:Math.ceil(e.mercatorXfromLng(this.bounds.getEast())*n),maxY:Math.ceil(e.mercatorYfromLat(this.bounds.getSouth())*n)};return t.x>=r.minX&&t.x<r.maxX&&t.y>=r.minY&&t.y<r.maxY};var j=function(t){function n(n,r,i,a){if(t.call(this),this.id=n,this.dispatcher=i,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.extend(this,e.pick(r,[`url`,`scheme`,`tileSize`,`promoteId`])),this._options=e.extend({type:`vector`},r),this._collectResourceTiming=r.collectResourceTiming,this.tileSize!==512)throw Error(`vector tile sources must have a tileSize of 512`);this.setEventedParent(a)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new e.Event(`dataloading`,{dataType:`source`})),this._tileJSONRequest=k(this._options,this.map._requestManager,function(n,r){t._tileJSONRequest=null,t._loaded=!0,n?t.fire(new e.ErrorEvent(n)):r&&(e.extend(t,r),r.bounds&&(t.tileBounds=new A(r.bounds,t.minzoom,t.maxzoom)),e.postTurnstileEvent(r.tiles,t.map._requestManager._customAccessToken),e.postMapLoadEvent(r.tiles,t.map._getMapId(),t.map._requestManager._skuToken,t.map._requestManager._customAccessToken),t.fire(new e.Event(`data`,{dataType:`source`,sourceDataType:`metadata`})),t.fire(new e.Event(`data`,{dataType:`source`,sourceDataType:`content`})))})},n.prototype.loaded=function(){return this._loaded},n.prototype.hasTile=function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)},n.prototype.onAdd=function(e){this.map=e,this.load()},n.prototype.setSourceProperty=function(e){this._tileJSONRequest&&this._tileJSONRequest.cancel(),e(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},n.prototype.setTiles=function(e){var t=this;return this.setSourceProperty(function(){t._options.tiles=e}),this},n.prototype.setUrl=function(e){var t=this;return this.setSourceProperty(function(){t.url=e,t._options.url=e}),this},n.prototype.onRemove=function(){this._tileJSONRequest&&=(this._tileJSONRequest.cancel(),null)},n.prototype.serialize=function(){return e.extend({},this._options)},n.prototype.loadTile=function(t,n){var r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(r,e.ResourceType.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};i.request.collectResourceTiming=this._collectResourceTiming,!t.actor||t.state===`expired`?(t.actor=this.dispatcher.getActor(),t.request=t.actor.send(`loadTile`,i,a.bind(this))):t.state===`loading`?t.reloadCallback=n:t.request=t.actor.send(`reloadTile`,i,a.bind(this));function a(r,i){if(delete t.request,t.aborted)return n(null);if(r&&r.status!==404)return n(r);i&&i.resourceTiming&&(t.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&t.setExpiryData(i),t.loadVectorData(i,this.map.painter),e.cacheEntryPossiblyAdded(this.dispatcher),n(null),t.reloadCallback&&=(this.loadTile(t,t.reloadCallback),null)}},n.prototype.abortTile=function(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send(`abortTile`,{uid:e.uid,type:this.type,source:this.id},void 0)},n.prototype.unloadTile=function(e){e.unloadVectorData(),e.actor&&e.actor.send(`removeTile`,{uid:e.uid,type:this.type,source:this.id},void 0)},n.prototype.hasTransition=function(){return!1},n}(e.Evented),M=function(t){function n(n,r,i,a){t.call(this),this.id=n,this.dispatcher=i,this.setEventedParent(a),this.type=`raster`,this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme=`xyz`,this.tileSize=512,this._loaded=!1,this._options=e.extend({type:`raster`},r),e.extend(this,e.pick(r,[`url`,`scheme`,`tileSize`]))}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new e.Event(`dataloading`,{dataType:`source`})),this._tileJSONRequest=k(this._options,this.map._requestManager,function(n,r){t._tileJSONRequest=null,t._loaded=!0,n?t.fire(new e.ErrorEvent(n)):r&&(e.extend(t,r),r.bounds&&(t.tileBounds=new A(r.bounds,t.minzoom,t.maxzoom)),e.postTurnstileEvent(r.tiles),e.postMapLoadEvent(r.tiles,t.map._getMapId(),t.map._requestManager._skuToken),t.fire(new e.Event(`data`,{dataType:`source`,sourceDataType:`metadata`})),t.fire(new e.Event(`data`,{dataType:`source`,sourceDataType:`content`})))})},n.prototype.loaded=function(){return this._loaded},n.prototype.onAdd=function(e){this.map=e,this.load()},n.prototype.onRemove=function(){this._tileJSONRequest&&=(this._tileJSONRequest.cancel(),null)},n.prototype.serialize=function(){return e.extend({},this._options)},n.prototype.hasTile=function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)},n.prototype.loadTile=function(t,n){var r=this,i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);t.request=e.getImage(this.map._requestManager.transformRequest(i,e.ResourceType.Tile),function(i,a){if(delete t.request,t.aborted)t.state=`unloaded`,n(null);else if(i)t.state=`errored`,n(i);else if(a){r.map._refreshExpiredTiles&&t.setExpiryData(a),delete a.cacheControl,delete a.expires;var o=r.map.painter.context,s=o.gl;t.texture=r.map.painter.getTileTexture(a.width),t.texture?t.texture.update(a,{useMipmap:!0}):(t.texture=new e.Texture(o,a,s.RGBA,{useMipmap:!0}),t.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),t.state=`loaded`,e.cacheEntryPossiblyAdded(r.dispatcher),n(null)}})},n.prototype.abortTile=function(e,t){e.request&&(e.request.cancel(),delete e.request),t()},n.prototype.unloadTile=function(e,t){e.texture&&this.map.painter.saveTileTexture(e.texture),t()},n.prototype.hasTransition=function(){return!1},n}(e.Evented),N=function(t){function n(n,r,i,a){t.call(this,n,r,i,a),this.type=`raster-dem`,this.maxzoom=22,this._options=e.extend({type:`raster-dem`},r),this.encoding=r.encoding||`mapbox`}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.serialize=function(){return{type:`raster-dem`,url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},n.prototype.loadTile=function(t,n){var r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);t.request=e.getImage(this.map._requestManager.transformRequest(r,e.ResourceType.Tile),i.bind(this)),t.neighboringTiles=this._getNeighboringTiles(t.tileID);function i(r,i){if(delete t.request,t.aborted)t.state=`unloaded`,n(null);else if(r)t.state=`errored`,n(r);else if(i){this.map._refreshExpiredTiles&&t.setExpiryData(i),delete i.cacheControl,delete i.expires;var o=e.window.ImageBitmap&&i instanceof e.window.ImageBitmap&&e.offscreenCanvasSupported()?i:e.browser.getImageData(i,1),s={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:o,encoding:this.encoding};(!t.actor||t.state===`expired`)&&(t.actor=this.dispatcher.getActor(),t.actor.send(`loadDEMTile`,s,a.bind(this)))}}function a(e,r){e&&(t.state=`errored`,n(e)),r&&(t.dem=r,t.needsHillshadePrepare=!0,t.state=`loaded`,n(null))}},n.prototype._getNeighboringTiles=function(t){var n=t.canonical,r=2**n.z,i=(n.x-1+r)%r,a=n.x===0?t.wrap-1:t.wrap,o=(n.x+1+r)%r,s=n.x+1===r?t.wrap+1:t.wrap,c={};return c[new e.OverscaledTileID(t.overscaledZ,a,n.z,i,n.y).key]={backfilled:!1},c[new e.OverscaledTileID(t.overscaledZ,s,n.z,o,n.y).key]={backfilled:!1},n.y>0&&(c[new e.OverscaledTileID(t.overscaledZ,a,n.z,i,n.y-1).key]={backfilled:!1},c[new e.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},c[new e.OverscaledTileID(t.overscaledZ,s,n.z,o,n.y-1).key]={backfilled:!1}),n.y+1<r&&(c[new e.OverscaledTileID(t.overscaledZ,a,n.z,i,n.y+1).key]={backfilled:!1},c[new e.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},c[new e.OverscaledTileID(t.overscaledZ,s,n.z,o,n.y+1).key]={backfilled:!1}),c},n.prototype.unloadTile=function(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state=`unloaded`,e.actor&&e.actor.send(`removeDEMTile`,{uid:e.uid,source:this.id})},n}(M),P=function(t){function n(n,r,i,a){t.call(this),this.id=n,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=i.getActor(),this.setEventedParent(a),this._data=r.data,this._options=e.extend({},r),this._collectResourceTiming=r.collectResourceTiming,this._resourceTiming=[],r.maxzoom!==void 0&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;var o=e.EXTENT/this.tileSize;this.workerOptions=e.extend({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(r.buffer===void 0?128:r.buffer)*o,tolerance:(r.tolerance===void 0?.375:r.tolerance)*o,extent:e.EXTENT,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:r.clusterMaxZoom===void 0?this.maxzoom-1:Math.min(r.clusterMaxZoom,this.maxzoom-1),minPoints:Math.max(2,r.clusterMinPoints||2),extent:e.EXTENT,radius:(r.clusterRadius||50)*o,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.load=function(){var t=this;this.fire(new e.Event(`dataloading`,{dataType:`source`})),this._updateWorkerData(function(n){if(n){t.fire(new e.ErrorEvent(n));return}var r={dataType:`source`,sourceDataType:`metadata`};t._collectResourceTiming&&t._resourceTiming&&t._resourceTiming.length>0&&(r.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new e.Event(`data`,r))})},n.prototype.onAdd=function(e){this.map=e,this.load()},n.prototype.setData=function(t){var n=this;return this._data=t,this.fire(new e.Event(`dataloading`,{dataType:`source`})),this._updateWorkerData(function(t){if(t){n.fire(new e.ErrorEvent(t));return}var r={dataType:`source`,sourceDataType:`content`};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(r.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new e.Event(`data`,r))}),this},n.prototype.getClusterExpansionZoom=function(e,t){return this.actor.send(`geojson.getClusterExpansionZoom`,{clusterId:e,source:this.id},t),this},n.prototype.getClusterChildren=function(e,t){return this.actor.send(`geojson.getClusterChildren`,{clusterId:e,source:this.id},t),this},n.prototype.getClusterLeaves=function(e,t,n,r){return this.actor.send(`geojson.getClusterLeaves`,{source:this.id,clusterId:e,limit:t,offset:n},r),this},n.prototype._updateWorkerData=function(t){var n=this;this._loaded=!1;var r=e.extend({},this.workerOptions),i=this._data;typeof i==`string`?(r.request=this.map._requestManager.transformRequest(e.browser.resolveURL(i),e.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(i),this.actor.send(this.type+`.loadData`,r,function(e,i){n._removed||i&&i.abandoned||(n._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[n.id]&&(n._resourceTiming=i.resourceTiming[n.id].slice(0)),n.actor.send(n.type+`.coalesce`,{source:r.source},null),t(e))})},n.prototype.loaded=function(){return this._loaded},n.prototype.loadTile=function(t,n){var r=this,i=t.actor?`reloadTile`:`loadTile`;t.actor=this.actor;var a={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(i,a,function(e,a){return delete t.request,t.unloadVectorData(),t.aborted?n(null):e?n(e):(t.loadVectorData(a,r.map.painter,i===`reloadTile`),n(null))})},n.prototype.abortTile=function(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0},n.prototype.unloadTile=function(e){e.unloadVectorData(),this.actor.send(`removeTile`,{uid:e.uid,type:this.type,source:this.id})},n.prototype.onRemove=function(){this._removed=!0,this.actor.send(`removeSource`,{type:this.type,source:this.id})},n.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},n.prototype.hasTransition=function(){return!1},n}(e.Evented),F=e.createLayout([{name:`a_pos`,type:`Int16`,components:2},{name:`a_texture_pos`,type:`Int16`,components:2}]),I=function(t){function n(e,n,r,i){t.call(this),this.id=e,this.dispatcher=r,this.coordinates=n.coordinates,this.type=`image`,this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=n}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.load=function(t,n){var r=this;this._loaded=!1,this.fire(new e.Event(`dataloading`,{dataType:`source`})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),function(i,a){r._loaded=!0,i?r.fire(new e.ErrorEvent(i)):a&&(r.image=a,t&&(r.coordinates=t),n&&n(),r._finishLoading())})},n.prototype.loaded=function(){return this._loaded},n.prototype.updateImage=function(e){var t=this;return!this.image||!e.url?this:(this.options.url=e.url,this.load(e.coordinates,function(){t.texture=null}),this)},n.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event(`data`,{dataType:`source`,sourceDataType:`metadata`})))},n.prototype.onAdd=function(e){this.map=e,this.load()},n.prototype.setCoordinates=function(t){var n=this;this.coordinates=t;var r=t.map(e.MercatorCoordinate.fromLngLat);this.tileID=L(r),this.minzoom=this.maxzoom=this.tileID.z;var i=r.map(function(e){return n.tileID.getTilePoint(e)._round()});return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event(`data`,{dataType:`source`,sourceDataType:`content`})),this},n.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var t=this.map.painter.context,n=t.gl;for(var r in this.boundsBuffer||=t.createVertexBuffer(this._boundsArray,F.members),this.boundsSegments||=e.SegmentVector.simpleSegment(0,0,4,2),this.texture||(this.texture=new e.Texture(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[r];i.state!==`loaded`&&(i.state=`loaded`,i.texture=this.texture)}}},n.prototype.loadTile=function(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state=`errored`,t(null))},n.prototype.serialize=function(){return{type:`image`,url:this.options.url,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return!1},n}(e.Evented);function L(t){for(var n=1/0,r=1/0,i=-1/0,a=-1/0,o=0,s=t;o<s.length;o+=1){var c=s[o];n=Math.min(n,c.x),r=Math.min(r,c.y),i=Math.max(i,c.x),a=Math.max(a,c.y)}var l=i-n,u=a-r,d=Math.max(0,Math.floor(-Math.log(Math.max(l,u))/Math.LN2)),f=2**d;return new e.CanonicalTileID(d,Math.floor((n+i)/2*f),Math.floor((r+a)/2*f))}var R=function(t){function n(e,n,r,i){t.call(this,e,n,r,i),this.roundZoom=!0,this.type=`video`,this.options=n}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.load=function(){var t=this;this._loaded=!1;var n=this.options;this.urls=[];for(var r=0,i=n.urls;r<i.length;r+=1){var a=i[r];this.urls.push(this.map._requestManager.transformRequest(a,e.ResourceType.Source).url)}e.getVideo(this.urls,function(n,r){t._loaded=!0,n?t.fire(new e.ErrorEvent(n)):r&&(t.video=r,t.video.loop=!0,t.video.addEventListener(`playing`,function(){t.map.triggerRepaint()}),t.map&&t.video.play(),t._finishLoading())})},n.prototype.pause=function(){this.video&&this.video.pause()},n.prototype.play=function(){this.video&&this.video.play()},n.prototype.seek=function(t){if(this.video){var n=this.video.seekable;t<n.start(0)||t>n.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError(`sources.`+this.id,null,`Playback for this video can be set only between the `+n.start(0)+` and `+n.end(0)+`-second mark.`))):this.video.currentTime=t}},n.prototype.getVideo=function(){return this.video},n.prototype.onAdd=function(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},n.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var t=this.map.painter.context,n=t.gl;for(var r in this.boundsBuffer||=t.createVertexBuffer(this._boundsArray,F.members),this.boundsSegments||=e.SegmentVector.simpleSegment(0,0,4,2),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[r];i.state!==`loaded`&&(i.state=`loaded`,i.texture=this.texture)}}},n.prototype.serialize=function(){return{type:`video`,urls:this.urls,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this.video&&!this.video.paused},n}(I),z=function(t){function n(n,r,i,a){t.call(this,n,r,i,a),r.coordinates?(!Array.isArray(r.coordinates)||r.coordinates.length!==4||r.coordinates.some(function(e){return!Array.isArray(e)||e.length!==2||e.some(function(e){return typeof e!=`number`})}))&&this.fire(new e.ErrorEvent(new e.ValidationError(`sources.`+n,null,`"coordinates" property must be an array of 4 longitude/latitude array pairs`))):this.fire(new e.ErrorEvent(new e.ValidationError(`sources.`+n,null,`missing required property "coordinates"`))),r.animate&&typeof r.animate!=`boolean`&&this.fire(new e.ErrorEvent(new e.ValidationError(`sources.`+n,null,`optional "animate" property must be a boolean value`))),r.canvas?typeof r.canvas!=`string`&&!(r.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError(`sources.`+n,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.ErrorEvent(new e.ValidationError(`sources.`+n,null,`missing required property "canvas"`))),this.options=r,this.animate=r.animate===void 0?!0:r.animate}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.load=function(){if(this._loaded=!0,this.canvas||=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new e.ErrorEvent(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(),!1)},this._finishLoading()},n.prototype.getCanvas=function(){return this.canvas},n.prototype.onAdd=function(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()},n.prototype.onRemove=function(){this.pause()},n.prototype.prepare=function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var n=this.map.painter.context,r=n.gl;for(var i in this.boundsBuffer||=n.createVertexBuffer(this._boundsArray,F.members),this.boundsSegments||=e.SegmentVector.simpleSegment(0,0,4,2),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(n,this.canvas,r.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];a.state!==`loaded`&&(a.state=`loaded`,a.texture=this.texture)}}},n.prototype.serialize=function(){return{type:`canvas`,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this._playing},n.prototype._hasInvalidDimensions=function(){for(var e=0,t=[this.canvas.width,this.canvas.height];e<t.length;e+=1){var n=t[e];if(isNaN(n)||n<=0)return!0}return!1},n}(I),B={vector:j,raster:M,"raster-dem":N,geojson:P,video:R,image:I,canvas:z},V=function(t,n,r,i){var a=new B[n.type](t,n,r,i);if(a.id!==t)throw Error(`Expected Source id to be `+t+` instead of `+a.id);return e.bindAll([`load`,`abort`,`unload`,`serialize`,`prepare`],a),a},H=function(e){return B[e]},U=function(e,t){B[e]=t};function W(t,n){var r=e.identity([]);return e.translate(r,r,[1,1,0]),e.scale(r,r,[t.width*.5,t.height*.5,1]),e.multiply(r,r,t.calculatePosMatrix(n.toUnwrapped()))}function G(e,t,n){if(e)for(var r=0,i=e;r<i.length;r+=1){var a=t[i[r]];if(a&&a.source===n&&a.type===`fill-extrusion`)return!0}else for(var o in t){var s=t[o];if(s.source===n&&s.type===`fill-extrusion`)return!0}return!1}function K(e,t,n,r,i,a){var o=G(i&&i.layers,t,e.id),s=a.maxPitchScaleFactor(),c=e.tilesIn(r,s,o);c.sort(Y);for(var l=[],u=0,d=c;u<d.length;u+=1){var f=d[u];l.push({wrappedTileID:f.tileID.wrapped().key,queryResults:f.tile.queryRenderedFeatures(t,n,e._state,f.queryGeometry,f.cameraQueryGeometry,f.scale,i,a,s,W(e.transform,f.tileID))})}var p=X(l);for(var m in p)p[m].forEach(function(t){var n=t.feature,r=e.getFeatureState(n.layer[`source-layer`],n.id);n.source=n.layer.source,n.layer[`source-layer`]&&(n.sourceLayer=n.layer[`source-layer`]),n.state=r});return p}function q(e,t,n,r,i,a,o){for(var s={},c=a.queryRenderedSymbols(r),l=[],u=0,d=Object.keys(c).map(Number);u<d.length;u+=1){var f=d[u];l.push(o[f])}l.sort(Y);for(var p=function(){var n=h[m],r=n.featureIndex.lookupSymbolFeatures(c[n.bucketInstanceId],t,n.bucketIndex,n.sourceLayerIndex,i.filter,i.layers,i.availableImages,e);for(var a in r){var o=s[a]=s[a]||[],l=r[a];l.sort(function(e,t){var r=n.featureSortOrder;if(r){var i=r.indexOf(e.featureIndex);return r.indexOf(t.featureIndex)-i}else return t.featureIndex-e.featureIndex});for(var u=0,d=l;u<d.length;u+=1){var f=d[u];o.push(f)}}},m=0,h=l;m<h.length;m+=1)p();var g=function(t){s[t].forEach(function(r){var i=r.feature,a=n[e[t].source].getFeatureState(i.layer[`source-layer`],i.id);i.source=i.layer.source,i.layer[`source-layer`]&&(i.sourceLayer=i.layer[`source-layer`]),i.state=a})};for(var _ in s)g(_);return s}function J(e,t){for(var n=e.getRenderableIds().map(function(t){return e.getTileByID(t)}),r=[],i={},a=0;a<n.length;a++){var o=n[a],s=o.tileID.canonical.key;i[s]||(i[s]=!0,o.querySourceFeatures(r,t))}return r}function Y(e,t){var n=e.tileID,r=t.tileID;return n.overscaledZ-r.overscaledZ||n.canonical.y-r.canonical.y||n.wrap-r.wrap||n.canonical.x-r.canonical.x}function X(e){for(var t={},n={},r=0,i=e;r<i.length;r+=1){var a=i[r],o=a.queryResults,s=a.wrappedTileID,c=n[s]=n[s]||{};for(var l in o)for(var u=o[l],d=c[l]=c[l]||{},f=t[l]=t[l]||[],p=0,m=u;p<m.length;p+=1){var h=m[p];d[h.featureIndex]||(d[h.featureIndex]=!0,f.push(h))}}return t}var Z=function(e,t){this.max=e,this.onRemove=t,this.reset()};Z.prototype.reset=function(){for(var e in this.data)for(var t=0,n=this.data[e];t<n.length;t+=1){var r=n[t];r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value)}return this.data={},this.order=[],this},Z.prototype.add=function(e,t,n){var r=this,i=e.wrapped().key;this.data[i]===void 0&&(this.data[i]=[]);var a={value:t,timeout:void 0};if(n!==void 0&&(a.timeout=setTimeout(function(){r.remove(e,a)},n)),this.data[i].push(a),this.order.push(i),this.order.length>this.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},Z.prototype.has=function(e){return e.wrapped().key in this.data},Z.prototype.getAndRemove=function(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null},Z.prototype._getAndRemoveByKey=function(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value},Z.prototype.getByKey=function(e){var t=this.data[e];return t?t[0].value:null},Z.prototype.get=function(e){return this.has(e)?this.data[e.wrapped().key][0].value:null},Z.prototype.remove=function(e,t){if(!this.has(e))return this;var n=e.wrapped().key,r=t===void 0?0:this.data[n].indexOf(t),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(i.value),this.order.splice(this.order.indexOf(n),1),this},Z.prototype.setMaxSize=function(e){for(this.max=e;this.order.length>this.max;){var t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this},Z.prototype.filter=function(e){var t=[];for(var n in this.data)for(var r=0,i=this.data[n];r<i.length;r+=1){var a=i[r];e(a.value)||t.push(a)}for(var o=0,s=t;o<s.length;o+=1){var c=s[o];this.remove(c.value.tileID,c)}};var Q=function(e,t,n){this.context=e;var r=e.gl;this.buffer=r.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer};Q.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Q.prototype.updateData=function(e){var t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)},Q.prototype.destroy=function(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)};var ee={Int8:`BYTE`,Uint8:`UNSIGNED_BYTE`,Int16:`SHORT`,Uint16:`UNSIGNED_SHORT`,Int32:`INT`,Uint32:`UNSIGNED_INT`,Float32:`FLOAT`},te=function(e,t,n,r){this.length=t.length,this.attributes=n,this.itemSize=t.bytesPerElement,this.dynamicDraw=r,this.context=e;var i=e.gl;this.buffer=i.createBuffer(),e.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer};te.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},te.prototype.updateData=function(e){var t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)},te.prototype.enableAttributes=function(e,t){for(var n=0;n<this.attributes.length;n++){var r=this.attributes[n],i=t.attributes[r.name];i!==void 0&&e.enableVertexAttribArray(i)}},te.prototype.setVertexAttribPointers=function(e,t,n){for(var r=0;r<this.attributes.length;r++){var i=this.attributes[r],a=t.attributes[i.name];a!==void 0&&e.vertexAttribPointer(a,i.components,e[ee[i.type]],!1,this.itemSize,i.offset+this.itemSize*(n||0))}},te.prototype.destroy=function(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)};var ne=function(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};ne.prototype.get=function(){return this.current},ne.prototype.set=function(e){},ne.prototype.getDefault=function(){return this.default},ne.prototype.setDefault=function(){this.set(this.default)};var re=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.getDefault=function(){return e.Color.transparent},n.prototype.set=function(e){var t=this.current;e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a&&!this.dirty||(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)},n}(ne),ie=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 1},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.clearDepth(e),this.current=e,this.dirty=!1)},t}(ne),ae=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 0},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.clearStencil(e),this.current=e,this.dirty=!1)},t}(ne),oe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return[!0,!0,!0,!0]},t.prototype.set=function(e){var t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&!this.dirty||(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)},t}(ne),se=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!0},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.depthMask(e),this.current=e,this.dirty=!1)},t}(ne),ce=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 255},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.stencilMask(e),this.current=e,this.dirty=!1)},t}(ne),le=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},t.prototype.set=function(e){var t=this.current;e.func===t.func&&e.ref===t.ref&&e.mask===t.mask&&!this.dirty||(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)},t}(ne),ue=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){var e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]},t.prototype.set=function(e){var t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&!this.dirty||(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)},t}(ne),de=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(!(e===this.current&&!this.dirty)){var t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}},t}(ne),fe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return[0,1]},t.prototype.set=function(e){var t=this.current;e[0]===t[0]&&e[1]===t[1]&&!this.dirty||(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)},t}(ne),pe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(!(e===this.current&&!this.dirty)){var t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}},t}(ne),me=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.LESS},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.depthFunc(e),this.current=e,this.dirty=!1)},t}(ne),he=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(!(e===this.current&&!this.dirty)){var t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}},t}(ne),ge=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){var e=this.gl;return[e.ONE,e.ZERO]},t.prototype.set=function(e){var t=this.current;e[0]===t[0]&&e[1]===t[1]&&!this.dirty||(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)},t}(ne),_e=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.getDefault=function(){return e.Color.transparent},n.prototype.set=function(e){var t=this.current;e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a&&!this.dirty||(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)},n}(ne),ve=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.FUNC_ADD},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.blendEquation(e),this.current=e,this.dirty=!1)},t}(ne),ye=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(!(e===this.current&&!this.dirty)){var t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}},t}(ne),be=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.BACK},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.cullFace(e),this.current=e,this.dirty=!1)},t}(ne),xe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.CCW},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.frontFace(e),this.current=e,this.dirty=!1)},t}(ne),Se=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.useProgram(e),this.current=e,this.dirty=!1)},t}(ne),Ce=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.TEXTURE0},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.activeTexture(e),this.current=e,this.dirty=!1)},t}(ne),we=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){var e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]},t.prototype.set=function(e){var t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&!this.dirty||(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)},t}(ne),Te=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(!(e===this.current&&!this.dirty)){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}},t}(ne),Ee=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(!(e===this.current&&!this.dirty)){var t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},t}(ne),De=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(!(e===this.current&&!this.dirty)){var t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}},t}(ne),Oe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(!(e===this.current&&!this.dirty)){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},t}(ne),ke=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){var t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1},t}(ne),Ae=function(e){function t(t){e.call(this,t),this.vao=t.extVertexArrayObject}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){!this.vao||e===this.current&&!this.dirty||(this.vao.bindVertexArrayOES(e),this.current=e,this.dirty=!1)},t}(ne),je=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 4},t.prototype.set=function(e){if(!(e===this.current&&!this.dirty)){var t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}},t}(ne),Me=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(!(e===this.current&&!this.dirty)){var t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}},t}(ne),Ne=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(!(e===this.current&&!this.dirty)){var t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}},t}(ne),Pe=function(e){function t(t,n){e.call(this,t),this.context=t,this.parent=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t}(ne),Fe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.setDirty=function(){this.dirty=!0},t.prototype.set=function(e){if(!(e===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}},t}(Pe),Ie=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){if(!(e===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},t}(Pe),Le=function(e,t,n,r){this.context=e,this.width=t,this.height=n;var i=this.framebuffer=e.gl.createFramebuffer();this.colorAttachment=new Fe(e,i),r&&(this.depthAttachment=new Ie(e,i))};Le.prototype.destroy=function(){var e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){var n=this.depthAttachment.get();n&&e.deleteRenderbuffer(n)}e.deleteFramebuffer(this.framebuffer)};var Re=519,ze=function(e,t,n){this.func=e,this.mask=t,this.range=n};ze.ReadOnly=!1,ze.ReadWrite=!0,ze.disabled=new ze(Re,ze.ReadOnly,[0,1]);var Be=519,Ve=7680,He=function(e,t,n,r,i,a){this.test=e,this.ref=t,this.mask=n,this.fail=r,this.depthFail=i,this.pass=a};He.disabled=new He({func:Be,mask:0},0,0,Ve,Ve,Ve);var Ue=0,We=1,Ge=771,Ke=function(e,t,n){this.blendFunction=e,this.blendColor=t,this.mask=n};Ke.Replace=[We,Ue],Ke.disabled=new Ke(Ke.Replace,e.Color.transparent,[!1,!1,!1,!1]),Ke.unblended=new Ke(Ke.Replace,e.Color.transparent,[!0,!0,!0,!0]),Ke.alphaBlended=new Ke([We,Ge],e.Color.transparent,[!0,!0,!0,!0]);var qe=1029,Je=2305,Ye=function(e,t,n){this.enable=e,this.mode=t,this.frontFace=n};Ye.disabled=new Ye(!1,qe,Je),Ye.backCCW=new Ye(!0,qe,Je);var Xe=function(e){this.gl=e,this.extVertexArrayObject=this.gl.getExtension(`OES_vertex_array_object`),this.clearColor=new re(this),this.clearDepth=new ie(this),this.clearStencil=new ae(this),this.colorMask=new oe(this),this.depthMask=new se(this),this.stencilMask=new ce(this),this.stencilFunc=new le(this),this.stencilOp=new ue(this),this.stencilTest=new de(this),this.depthRange=new fe(this),this.depthTest=new pe(this),this.depthFunc=new me(this),this.blend=new he(this),this.blendFunc=new ge(this),this.blendColor=new _e(this),this.blendEquation=new ve(this),this.cullFace=new ye(this),this.cullFaceSide=new be(this),this.frontFace=new xe(this),this.program=new Se(this),this.activeTexture=new Ce(this),this.viewport=new we(this),this.bindFramebuffer=new Te(this),this.bindRenderbuffer=new Ee(this),this.bindTexture=new De(this),this.bindVertexBuffer=new Oe(this),this.bindElementBuffer=new ke(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new Ae(this),this.pixelStoreUnpack=new je(this),this.pixelStoreUnpackPremultiplyAlpha=new Me(this),this.pixelStoreUnpackFlipY=new Ne(this),this.extTextureFilterAnisotropic=e.getExtension(`EXT_texture_filter_anisotropic`)||e.getExtension(`MOZ_EXT_texture_filter_anisotropic`)||e.getExtension(`WEBKIT_EXT_texture_filter_anisotropic`),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=e.getExtension(`OES_texture_half_float`),this.extTextureHalfFloat&&(e.getExtension(`OES_texture_half_float_linear`),this.extRenderToTextureHalfFloat=e.getExtension(`EXT_color_buffer_half_float`)),this.extTimerQuery=e.getExtension(`EXT_disjoint_timer_query`),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)};Xe.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()},Xe.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},Xe.prototype.createIndexBuffer=function(e,t){return new Q(this,e,t)},Xe.prototype.createVertexBuffer=function(e,t,n){return new te(this,e,t,n)},Xe.prototype.createRenderbuffer=function(e,t,n){var r=this.gl,i=r.createRenderbuffer();return this.bindRenderbuffer.set(i),r.renderbufferStorage(r.RENDERBUFFER,e,t,n),this.bindRenderbuffer.set(null),i},Xe.prototype.createFramebuffer=function(e,t,n){return new Le(this,e,t,n)},Xe.prototype.clear=function(e){var t=e.color,n=e.depth,r=this.gl,i=0;t&&(i|=r.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(i|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),r.clear(i)},Xe.prototype.setCullFace=function(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))},Xe.prototype.setDepthMode=function(e){e.func===this.gl.ALWAYS&&!e.mask?this.depthTest.set(!1):(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range))},Xe.prototype.setStencilMode=function(e){e.test.func===this.gl.ALWAYS&&!e.mask?this.stencilTest.set(!1):(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask}))},Xe.prototype.setColorMode=function(t){e.deepEqual(t.blendFunction,Ke.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)},Xe.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Ze=function(t){function n(n,r,i){var a=this;t.call(this),this.id=n,this.dispatcher=i,this.on(`data`,function(e){e.dataType===`source`&&e.sourceDataType===`metadata`&&(a._sourceLoaded=!0),a._sourceLoaded&&!a._paused&&e.dataType===`source`&&e.sourceDataType===`content`&&(a.reload(),a.transform&&a.update(a.transform))}),this.on(`error`,function(){a._sourceErrored=!0}),this._source=V(n,r,i,this),this._tiles={},this._cache=new Z(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new e.SourceFeatureState}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(e)},n.prototype.onRemove=function(e){this._source&&this._source.onRemove&&this._source.onRemove(e)},n.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var e in this._tiles){var t=this._tiles[e];if(t.state!==`loaded`&&t.state!==`errored`)return!1}return!0},n.prototype.getSource=function(){return this._source},n.prototype.pause=function(){this._paused=!0},n.prototype.resume=function(){if(this._paused){var e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}},n.prototype._loadTile=function(e,t){return this._source.loadTile(e,t)},n.prototype._unloadTile=function(e){if(this._source.unloadTile)return this._source.unloadTile(e,function(){})},n.prototype._abortTile=function(e){if(this._source.abortTile)return this._source.abortTile(e,function(){})},n.prototype.serialize=function(){return this._source.serialize()},n.prototype.prepare=function(e){for(var t in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var n=this._tiles[t];n.upload(e),n.prepare(this.map.style.imageManager)}},n.prototype.getIds=function(){return e.values(this._tiles).map(function(e){return e.tileID}).sort(Qe).map(function(e){return e.key})},n.prototype.getRenderableIds=function(t){var n=this,r=[];for(var i in this._tiles)this._isIdRenderable(i,t)&&r.push(this._tiles[i]);return t?r.sort(function(t,r){var i=t.tileID,a=r.tileID,o=new e.Point(i.canonical.x,i.canonical.y)._rotate(n.transform.angle),s=new e.Point(a.canonical.x,a.canonical.y)._rotate(n.transform.angle);return i.overscaledZ-a.overscaledZ||s.y-o.y||s.x-o.x}).map(function(e){return e.tileID.key}):r.map(function(e){return e.tileID}).sort(Qe).map(function(e){return e.key})},n.prototype.hasRenderableParent=function(e){var t=this.findLoadedParent(e,0);return t?this._isIdRenderable(t.tileID.key):!1},n.prototype._isIdRenderable=function(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())},n.prototype.reload=function(){if(this._paused){this._shouldReloadOnResume=!0;return}for(var e in this._cache.reset(),this._tiles)this._tiles[e].state!==`errored`&&this._reloadTile(e,`reloading`)},n.prototype._reloadTile=function(e,t){var n=this._tiles[e];n&&(n.state!==`loading`&&(n.state=t),this._loadTile(n,this._tileLoaded.bind(this,n,e,t)))},n.prototype._tileLoaded=function(t,n,r,i){if(i){t.state=`errored`,i.status===404?this.update(this.transform):this._source.fire(new e.ErrorEvent(i,{tile:t}));return}t.timeAdded=e.browser.now(),r===`expired`&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.getSource().type===`raster-dem`&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new e.Event(`data`,{dataType:`source`,tile:t,coord:t.tileID}))},n.prototype._backfillDEM=function(e){for(var t=this.getRenderableIds(),n=0;n<t.length;n++){var r=t[n];if(e.neighboringTiles&&e.neighboringTiles[r]){var i=this.getTileByID(r);a(e,i),a(i,e)}}function a(e,t){e.needsHillshadePrepare=!0;var n=t.tileID.canonical.x-e.tileID.canonical.x,r=t.tileID.canonical.y-e.tileID.canonical.y,i=2**e.tileID.canonical.z,a=t.tileID.key;n===0&&r===0||Math.abs(r)>1||(Math.abs(n)>1&&(Math.abs(n+i)===1?n+=i:Math.abs(n-i)===1&&(n-=i)),!(!t.dem||!e.dem)&&(e.dem.backfillBorder(t.dem,n,r),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}},n.prototype.getTile=function(e){return this.getTileByID(e.key)},n.prototype.getTileByID=function(e){return this._tiles[e]},n.prototype._retainLoadedChildren=function(e,t,n,r){for(var i in this._tiles){var a=this._tiles[i];if(!(r[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>n)){for(var o=a.tileID;a&&a.tileID.overscaledZ>t+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);a=this._tiles[s.key],a&&a.hasData()&&(o=s)}for(var c=o;c.overscaledZ>t;)if(c=c.scaledTo(c.overscaledZ-1),e[c.key]){r[o.key]=o;break}}}},n.prototype.findLoadedParent=function(e,t){if(e.key in this._loadedParentTiles){var n=this._loadedParentTiles[e.key];return n&&n.tileID.overscaledZ>=t?n:null}for(var r=e.overscaledZ-1;r>=t;r--){var i=e.scaledTo(r),a=this._getLoadedTile(i);if(a)return a}},n.prototype._getLoadedTile=function(e){var t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)},n.prototype.updateCacheSize=function(e){var t=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),n=Math.floor(t*5),r=typeof this._maxTileCacheSize==`number`?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(r)},n.prototype.handleWrapJump=function(e){var t=(e-(this._prevLng===void 0?e:this._prevLng))/360,n=Math.round(t);if(this._prevLng=e,n){var r={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+n),r[a.tileID.key]=a}for(var o in this._tiles=r,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var c=this._tiles[s];this._setTileReloadTimer(s,c)}}},n.prototype.update=function(t){var r=this;if(this.transform=t,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var i;this.used?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(t){return new e.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)}):(i=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter(function(e){return r._source.hasTile(e)}))):i=[];var a=t.coveringZoomLevel(this._source),o=Math.max(a-n.maxOverzooming,this._source.minzoom),s=Math.max(a+n.maxUnderzooming,this._source.minzoom),c=this._updateRetainedTiles(i,a);if($e(this._source.type)){for(var l={},u={},d=Object.keys(c),f=0,p=d;f<p.length;f+=1){var m=p[f],h=c[m],g=this._tiles[m];if(!(!g||g.fadeEndTime&&g.fadeEndTime<=e.browser.now())){var _=this.findLoadedParent(h,o);_&&(this._addTile(_.tileID),l[_.tileID.key]=_.tileID),u[m]=h}}for(var v in this._retainLoadedChildren(u,a,s,c),l)c[v]||(this._coveredTiles[v]=!0,c[v]=l[v])}for(var y in c)this._tiles[y].clearFadeHold();for(var b=e.keysDifference(this._tiles,c),x=0,S=b;x<S.length;x+=1){var C=S[x],w=this._tiles[C];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):(!w.hasSymbolBuckets||w.symbolFadeFinished())&&this._removeTile(C)}this._updateLoadedParentTileCache()}},n.prototype.releaseSymbolFadeTiles=function(){for(var e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)},n.prototype._updateRetainedTiles=function(e,t){for(var r={},i={},a=Math.max(t-n.maxOverzooming,this._source.minzoom),o=Math.max(t+n.maxUnderzooming,this._source.minzoom),s={},c=0,l=e;c<l.length;c+=1){var u=l[c],d=this._addTile(u);r[u.key]=u,!d.hasData()&&t<this._source.maxzoom&&(s[u.key]=u)}this._retainLoadedChildren(s,t,o,r);for(var f=0,p=e;f<p.length;f+=1){var m=p[f],h=this._tiles[m.key];if(!h.hasData()){if(t+1>this._source.maxzoom){var g=m.children(this._source.maxzoom)[0],_=this.getTile(g);if(_&&_.hasData()){r[g.key]=g;continue}}else{var v=m.children(this._source.maxzoom);if(r[v[0].key]&&r[v[1].key]&&r[v[2].key]&&r[v[3].key])continue}for(var y=h.wasRequested(),b=m.overscaledZ-1;b>=a;--b){var x=m.scaledTo(b);if(i[x.key]||(i[x.key]=!0,h=this.getTile(x),!h&&y&&(h=this._addTile(x)),h&&(r[x.key]=x,y=h.wasRequested(),h.hasData())))break}}}return r},n.prototype._updateLoadedParentTileCache=function(){for(var e in this._loadedParentTiles={},this._tiles){for(var t=[],n=void 0,r=this._tiles[e].tileID;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){n=this._loadedParentTiles[r.key];break}t.push(r.key);var i=r.scaledTo(r.overscaledZ-1);if(n=this._getLoadedTile(i),n)break;r=i}for(var a=0,o=t;a<o.length;a+=1){var s=o[a];this._loadedParentTiles[s]=n}}},n.prototype._addTile=function(t){var n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));var r=!!n;return r||(n=new e.Tile(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))),n?(n.uses++,this._tiles[t.key]=n,r||this._source.fire(new e.Event(`dataloading`,{tile:n,coord:n.tileID,dataType:`source`})),n):null},n.prototype._setTileReloadTimer=function(e,t){var n=this;e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);var r=t.getExpiryTimeout();r&&(this._timers[e]=setTimeout(function(){n._reloadTile(e,`expired`),delete n._timers[e]},r))},n.prototype._removeTile=function(e){var t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),!(t.uses>0)&&(t.hasData()&&t.state!==`reloading`?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))},n.prototype.clearTiles=function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(e);this._cache.reset()},n.prototype.tilesIn=function(t,n,r){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=r?o.getCameraQueryGeometry(t):t,c=t.map(function(e){return o.pointCoordinate(e)}),l=s.map(function(e){return o.pointCoordinate(e)}),u=this.getIds(),d=1/0,f=1/0,p=-1/0,m=-1/0,h=0,g=l;h<g.length;h+=1){var _=g[h];d=Math.min(d,_.x),f=Math.min(f,_.y),p=Math.max(p,_.x),m=Math.max(m,_.y)}for(var v=function(t){var r=i._tiles[u[t]];if(!r.holdingForFade()){var s=r.tileID,h=2**(o.zoom-r.tileID.overscaledZ),g=n*r.queryPadding*e.EXTENT/r.tileSize/h,_=[s.getTilePoint(new e.MercatorCoordinate(d,f)),s.getTilePoint(new e.MercatorCoordinate(p,m))];if(_[0].x-g<e.EXTENT&&_[0].y-g<e.EXTENT&&_[1].x+g>=0&&_[1].y+g>=0){var v=c.map(function(e){return s.getTilePoint(e)}),y=l.map(function(e){return s.getTilePoint(e)});a.push({tile:r,tileID:s,queryGeometry:v,cameraQueryGeometry:y,scale:h})}}},y=0;y<u.length;y++)v(y);return a},n.prototype.getVisibleCoordinates=function(e){for(var t=this,n=this.getRenderableIds(e).map(function(e){return t._tiles[e].tileID}),r=0,i=n;r<i.length;r+=1){var a=i[r];a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped())}return n},n.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if($e(this._source.type))for(var t in this._tiles){var n=this._tiles[t];if(n.fadeEndTime!==void 0&&n.fadeEndTime>=e.browser.now())return!0}return!1},n.prototype.setFeatureState=function(e,t,n){e||=`_geojsonTileLayer`,this._state.updateState(e,t,n)},n.prototype.removeFeatureState=function(e,t,n){e||=`_geojsonTileLayer`,this._state.removeFeatureState(e,t,n)},n.prototype.getFeatureState=function(e,t){return e||=`_geojsonTileLayer`,this._state.getState(e,t)},n.prototype.setDependencies=function(e,t,n){var r=this._tiles[e];r&&r.setDependencies(t,n)},n.prototype.reloadTilesForDependencies=function(e,t){for(var n in this._tiles)this._tiles[n].hasDependency(e,t)&&this._reloadTile(n,`reloading`);this._cache.filter(function(n){return!n.hasDependency(e,t)})},n}(e.Evented);Ze.maxOverzooming=10,Ze.maxUnderzooming=3;function Qe(e,t){var n=Math.abs(e.wrap*2)-+(e.wrap<0),r=Math.abs(t.wrap*2)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||r-n||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function $e(e){return e===`raster`||e===`image`||e===`video`}function et(){return new e.window.Worker(Vs.workerUrl)}var tt=`mapboxgl_preloaded_worker_pool`,nt=function(){this.active={}};nt.prototype.acquire=function(e){if(!this.workers)for(this.workers=[];this.workers.length<nt.workerCount;)this.workers.push(new et);return this.active[e]=!0,this.workers.slice()},nt.prototype.release=function(e){delete this.active[e],this.numActive()===0&&(this.workers.forEach(function(e){e.terminate()}),this.workers=null)},nt.prototype.isPreloaded=function(){return!!this.active[tt]},nt.prototype.numActive=function(){return Object.keys(this.active).length};var rt=Math.floor(e.browser.hardwareConcurrency/2);nt.workerCount=Math.max(Math.min(rt,6),1);var it;function at(){return it||=new nt,it}function ot(){at().acquire(tt)}function st(){var e=it;e&&(e.isPreloaded()&&e.numActive()===1?(e.release(tt),it=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 ct(t,n){var r={};for(var i in t)i!==`ref`&&(r[i]=t[i]);return e.refProperties.forEach(function(e){e in n&&(r[e]=n[e])}),r}function lt(e){e=e.slice();for(var t=Object.create(null),n=0;n<e.length;n++)t[e[n].id]=e[n];for(var r=0;r<e.length;r++)`ref`in e[r]&&(e[r]=ct(e[r],t[e[r].ref]));return e}function ut(){var t={},n=e.styleSpec.$version;for(var r in e.styleSpec.$root){var i=e.styleSpec.$root[r];if(i.required){var a=null;a=r===`version`?n:i.type===`array`?[]:{},a!=null&&(t[r]=a)}}return t}var $={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 dt(e,t,n){n.push({command:$.addSource,args:[e,t[e]]})}function ft(e,t,n){t.push({command:$.removeSource,args:[e]}),n[e]=!0}function pt(e,t,n,r){ft(e,n,r),dt(e,t,n)}function mt(t,n,r){for(var i in t[r])if(t[r].hasOwnProperty(i)&&i!==`data`&&!e.deepEqual(t[r][i],n[r][i]))return!1;for(i in n[r])if(n[r].hasOwnProperty(i)&&i!==`data`&&!e.deepEqual(t[r][i],n[r][i]))return!1;return!0}function ht(t,n,r,i){for(var a in t||={},n||={},t)t.hasOwnProperty(a)&&(n.hasOwnProperty(a)||ft(a,r,i));for(a in n)n.hasOwnProperty(a)&&(t.hasOwnProperty(a)?e.deepEqual(t[a],n[a])||(t[a].type===`geojson`&&n[a].type===`geojson`&&mt(t,n,a)?r.push({command:$.setGeoJSONSourceData,args:[a,n[a].data]}):pt(a,n,r,i)):dt(a,n,r))}function gt(t,n,r,i,a,o){for(var s in t||={},n||={},t)t.hasOwnProperty(s)&&(e.deepEqual(t[s],n[s])||r.push({command:o,args:[i,s,n[s],a]}));for(s in n)!n.hasOwnProperty(s)||t.hasOwnProperty(s)||e.deepEqual(t[s],n[s])||r.push({command:o,args:[i,s,n[s],a]})}function _t(e){return e.id}function vt(e,t){return e[t.id]=t,e}function yt(t,n,r){t||=[],n||=[];var i=t.map(_t),a=n.map(_t),o=t.reduce(vt,{}),s=n.reduce(vt,{}),c=i.slice(),l=Object.create(null),u,d,f,p,m,h,g;for(u=0,d=0;u<i.length;u++)f=i[u],s.hasOwnProperty(f)?d++:(r.push({command:$.removeLayer,args:[f]}),c.splice(c.indexOf(f,d),1));for(u=0,d=0;u<a.length;u++)f=a[a.length-1-u],c[c.length-1-u]!==f&&(o.hasOwnProperty(f)?(r.push({command:$.removeLayer,args:[f]}),c.splice(c.lastIndexOf(f,c.length-d),1)):d++,h=c[c.length-u],r.push({command:$.addLayer,args:[s[f],h]}),c.splice(c.length-u,0,f),l[f]=!0);for(u=0;u<a.length;u++)if(f=a[u],p=o[f],m=s[f],!(l[f]||e.deepEqual(p,m))){if(!e.deepEqual(p.source,m.source)||!e.deepEqual(p[`source-layer`],m[`source-layer`])||!e.deepEqual(p.type,m.type)){r.push({command:$.removeLayer,args:[f]}),h=c[c.lastIndexOf(f)+1],r.push({command:$.addLayer,args:[m,h]});continue}for(g in gt(p.layout,m.layout,r,f,null,$.setLayoutProperty),gt(p.paint,m.paint,r,f,null,$.setPaintProperty),e.deepEqual(p.filter,m.filter)||r.push({command:$.setFilter,args:[f,m.filter]}),(!e.deepEqual(p.minzoom,m.minzoom)||!e.deepEqual(p.maxzoom,m.maxzoom))&&r.push({command:$.setLayerZoomRange,args:[f,m.minzoom,m.maxzoom]}),p)p.hasOwnProperty(g)&&(g===`layout`||g===`paint`||g===`filter`||g===`metadata`||g===`minzoom`||g===`maxzoom`||(g.indexOf(`paint.`)===0?gt(p[g],m[g],r,f,g.slice(6),$.setPaintProperty):e.deepEqual(p[g],m[g])||r.push({command:$.setLayerProperty,args:[f,g,m[g]]})));for(g in m)!m.hasOwnProperty(g)||p.hasOwnProperty(g)||g===`layout`||g===`paint`||g===`filter`||g===`metadata`||g===`minzoom`||g===`maxzoom`||(g.indexOf(`paint.`)===0?gt(p[g],m[g],r,f,g.slice(6),$.setPaintProperty):e.deepEqual(p[g],m[g])||r.push({command:$.setLayerProperty,args:[f,g,m[g]]}))}}function bt(t,n){if(!t)return[{command:$.setStyle,args:[n]}];var r=[];try{if(!e.deepEqual(t.version,n.version))return[{command:$.setStyle,args:[n]}];e.deepEqual(t.center,n.center)||r.push({command:$.setCenter,args:[n.center]}),e.deepEqual(t.zoom,n.zoom)||r.push({command:$.setZoom,args:[n.zoom]}),e.deepEqual(t.bearing,n.bearing)||r.push({command:$.setBearing,args:[n.bearing]}),e.deepEqual(t.pitch,n.pitch)||r.push({command:$.setPitch,args:[n.pitch]}),e.deepEqual(t.sprite,n.sprite)||r.push({command:$.setSprite,args:[n.sprite]}),e.deepEqual(t.glyphs,n.glyphs)||r.push({command:$.setGlyphs,args:[n.glyphs]}),e.deepEqual(t.transition,n.transition)||r.push({command:$.setTransition,args:[n.transition]}),e.deepEqual(t.light,n.light)||r.push({command:$.setLight,args:[n.light]});var i={},a=[];ht(t.sources,n.sources,a,i);var o=[];t.layers&&t.layers.forEach(function(e){i[e.source]?r.push({command:$.removeLayer,args:[e.id]}):o.push(e)}),r=r.concat(a),yt(o,n.layers,r)}catch(e){console.warn(`Unable to compute style diff:`,e),r=[{command:$.setStyle,args:[n]}]}return r}var xt=function(e,t){this.reset(e,t)};xt.prototype.reset=function(e,t){this.points=e||[],this._distances=[0];for(var n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,this.length*.5),this.paddedLength=this.length-this.padding*2},xt.prototype.lerp=function(t){if(this.points.length===1)return this.points[0];t=e.clamp(t,0,1);for(var n=1,r=this._distances[n],i=t*this.paddedLength+this.padding;r<i&&n<this._distances.length;)r=this._distances[++n];var a=n-1,o=this._distances[a],s=r-o,c=s>0?(i-o)/s:0;return this.points[a].mult(1-c).add(this.points[n].mult(c))};var St=function(e,t,n){var r=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/n),this.yCellCount=Math.ceil(t/n);for(var a=0;a<this.xCellCount*this.yCellCount;a++)r.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0};St.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},St.prototype.insert=function(e,t,n,r,i){this._forEachCell(t,n,r,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)},St.prototype.insertCircle=function(e,t,n,r){this._forEachCell(t-r,n-r,t+r,n+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(n),this.circles.push(r)},St.prototype._insertBoxCell=function(e,t,n,r,i,a){this.boxCells[i].push(a)},St.prototype._insertCircleCell=function(e,t,n,r,i,a){this.circleCells[i].push(a)},St.prototype._query=function(e,t,n,r,i,a){if(n<0||e>this.width||r<0||t>this.height)return i?!1:[];var o=[];if(e<=0&&t<=0&&this.width<=n&&this.height<=r){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)o.push({key:this.boxKeys[s],x1:this.bboxes[s*4],y1:this.bboxes[s*4+1],x2:this.bboxes[s*4+2],y2:this.bboxes[s*4+3]});for(var c=0;c<this.circleKeys.length;c++){var l=this.circles[c*3],u=this.circles[c*3+1],d=this.circles[c*3+2];o.push({key:this.circleKeys[c],x1:l-d,y1:u-d,x2:l+d,y2:u+d})}return a?o.filter(a):o}else{var f={hitTest:i,seenUids:{box:{},circle:{}}};return this._forEachCell(e,t,n,r,this._queryCell,o,f,a),i?o.length>0:o}},St.prototype._queryCircle=function(e,t,n,r,i){var a=e-n,o=e+n,s=t-n,c=t+n;if(o<0||a>this.width||c<0||s>this.height)return r?!1:[];var l=[],u={hitTest:r,circle:{x:e,y:t,radius:n},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,c,this._queryCellCircle,l,u,i),r?l.length>0:l},St.prototype.query=function(e,t,n,r,i){return this._query(e,t,n,r,!1,i)},St.prototype.hitTest=function(e,t,n,r,i){return this._query(e,t,n,r,!0,i)},St.prototype.hitTestCircle=function(e,t,n,r){return this._queryCircle(e,t,n,!0,r)},St.prototype._queryCell=function(e,t,n,r,i,a,o,s){var c=o.seenUids,l=this.boxCells[i];if(l!==null)for(var u=this.bboxes,d=0,f=l;d<f.length;d+=1){var p=f[d];if(!c.box[p]){c.box[p]=!0;var m=p*4;if(e<=u[m+2]&&t<=u[m+3]&&n>=u[m+0]&&r>=u[m+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:u[m],y1:u[m+1],x2:u[m+2],y2:u[m+3]})}}}var h=this.circleCells[i];if(h!==null)for(var g=this.circles,_=0,v=h;_<v.length;_+=1){var y=v[_];if(!c.circle[y]){c.circle[y]=!0;var b=y*3;if(this._circleAndRectCollide(g[b],g[b+1],g[b+2],e,t,n,r)&&(!s||s(this.circleKeys[y]))){if(o.hitTest)return a.push(!0),!0;var x=g[b],S=g[b+1],C=g[b+2];a.push({key:this.circleKeys[y],x1:x-C,y1:S-C,x2:x+C,y2:S+C})}}}},St.prototype._queryCellCircle=function(e,t,n,r,i,a,o,s){var c=o.circle,l=o.seenUids,u=this.boxCells[i];if(u!==null)for(var d=this.bboxes,f=0,p=u;f<p.length;f+=1){var m=p[f];if(!l.box[m]){l.box[m]=!0;var h=m*4;if(this._circleAndRectCollide(c.x,c.y,c.radius,d[h+0],d[h+1],d[h+2],d[h+3])&&(!s||s(this.boxKeys[m])))return a.push(!0),!0}}var g=this.circleCells[i];if(g!==null)for(var _=this.circles,v=0,y=g;v<y.length;v+=1){var b=y[v];if(!l.circle[b]){l.circle[b]=!0;var x=b*3;if(this._circlesCollide(_[x],_[x+1],_[x+2],c.x,c.y,c.radius)&&(!s||s(this.circleKeys[b])))return a.push(!0),!0}}},St.prototype._forEachCell=function(e,t,n,r,i,a,o,s){for(var c=this._convertToXCellCoord(e),l=this._convertToYCellCoord(t),u=this._convertToXCellCoord(n),d=this._convertToYCellCoord(r),f=c;f<=u;f++)for(var p=l;p<=d;p++){var m=this.xCellCount*p+f;if(i.call(this,e,t,n,r,m,a,o,s))return}},St.prototype._convertToXCellCoord=function(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))},St.prototype._convertToYCellCoord=function(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))},St.prototype._circlesCollide=function(e,t,n,r,i,a){var o=r-e,s=i-t,c=n+a;return c*c>o*o+s*s},St.prototype._circleAndRectCollide=function(e,t,n,r,i,a,o){var s=(a-r)/2,c=Math.abs(e-(r+s));if(c>s+n)return!1;var l=(o-i)/2,u=Math.abs(t-(i+l));if(u>l+n)return!1;if(c<=s||u<=l)return!0;var d=c-s,f=u-l;return d*d+f*f<=n*n};function Ct(t,n,r,i,a){var o=e.create();return n?(e.scale(o,o,[1/a,1/a,1]),r||e.rotateZ(o,o,i.angle)):e.multiply(o,i.labelPlaneMatrix,t),o}function wt(t,n,r,i,a){if(n){var o=e.clone(t);return e.scale(o,o,[a,a,1]),r||e.rotateZ(o,o,-i.angle),o}else return i.glCoordMatrix}function Tt(t,n){var r=[t.x,t.y,0,1];It(r,r,n);var i=r[3];return{point:new e.Point(r[0]/i,r[1]/i),signedDistanceFromCamera:i}}function Et(e,t){return .5+e/t*.5}function Dt(e,t){var n=e[0]/e[3],r=e[1]/e[3];return n>=-t[0]&&n<=t[0]&&r>=-t[1]&&r<=t[1]}function Ot(t,n,r,i,a,o,s,c){var l=i?t.textSizeData:t.iconSizeData,u=e.evaluateSizeForZoom(l,r.transform.zoom),d=[256/r.width*2+1,256/r.height*2+1],f=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;f.clear();for(var p=t.lineVertexArray,m=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,h=r.transform.width/r.transform.height,g=!1,_=0;_<m.length;_++){var v=m.get(_);if(v.hidden||v.writingMode===e.WritingMode.vertical&&!g){Ft(v.numGlyphs,f);continue}g=!1;var y=[v.anchorX,v.anchorY,0,1];if(e.transformMat4(y,y,n),!Dt(y,d)){Ft(v.numGlyphs,f);continue}var b=y[3],x=Et(r.transform.cameraToCenterDistance,b),S=e.evaluateSizeForFeature(l,u,v),C=s?S/x:S*x,w=new e.Point(v.anchorX,v.anchorY),T=Tt(w,a).point,E={},D=jt(v,C,!1,c,n,a,o,t.glyphOffsetArray,p,f,T,w,E,h);g=D.useVertical,(D.notEnoughRoom||g||D.needsFlipping&&jt(v,C,!0,c,n,a,o,t.glyphOffsetArray,p,f,T,w,E,h).notEnoughRoom)&&Ft(v.numGlyphs,f)}i?t.text.dynamicLayoutVertexBuffer.updateData(f):t.icon.dynamicLayoutVertexBuffer.updateData(f)}function kt(e,t,n,r,i,a,o,s,c,l,u){var d=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,p=s.lineStartIndex+s.lineLength,m=t.getoffsetX(s.glyphStartIndex),h=t.getoffsetX(d-1),g=Nt(e*m,n,r,i,a,o,s.segment,f,p,c,l,u);if(!g)return null;var _=Nt(e*h,n,r,i,a,o,s.segment,f,p,c,l,u);return _?{first:g,last:_}:null}function At(t,n,r,i){return t===e.WritingMode.horizontal&&Math.abs(r.y-n.y)>Math.abs(r.x-n.x)*i?{useVertical:!0}:(t===e.WritingMode.vertical?n.y<r.y:n.x>r.x)?{needsFlipping:!0}:null}function jt(t,n,r,i,a,o,s,c,l,u,d,f,p,m){var h=n/24,g=t.lineOffsetX*h,_=t.lineOffsetY*h,v;if(t.numGlyphs>1){var y=t.glyphStartIndex+t.numGlyphs,b=t.lineStartIndex,x=t.lineStartIndex+t.lineLength,S=kt(h,c,g,_,r,d,f,t,l,o,p);if(!S)return{notEnoughRoom:!0};var C=Tt(S.first.point,s).point,w=Tt(S.last.point,s).point;if(i&&!r){var T=At(t.writingMode,C,w,m);if(T)return T}v=[S.first];for(var E=t.glyphStartIndex+1;E<y-1;E++)v.push(Nt(h*c.getoffsetX(E),g,_,r,d,f,t.segment,b,x,l,o,p));v.push(S.last)}else{if(i&&!r){var D=Tt(f,a).point,O=t.lineStartIndex+t.segment+1,k=new e.Point(l.getx(O),l.gety(O)),A=Tt(k,a),j=A.signedDistanceFromCamera>0?A.point:Mt(f,k,D,1,a),M=At(t.writingMode,D,j,m);if(M)return M}var N=Nt(h*c.getoffsetX(t.glyphStartIndex),g,_,r,d,f,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,l,o,p);if(!N)return{notEnoughRoom:!0};v=[N]}for(var P=0,F=v;P<F.length;P+=1){var I=F[P];e.addDynamicAttributes(u,I.point,I.angle)}return{}}function Mt(e,t,n,r,i){var a=Tt(e.add(e.sub(t)._unit()),i).point,o=n.sub(a);return n.add(o._mult(r/o.mag()))}function Nt(t,n,r,i,a,o,s,c,l,u,d,f){var p=i?t-n:t+n,m=p>0?1:-1,h=0;i&&(m*=-1,h=Math.PI),m<0&&(h+=Math.PI);for(var g=m>0?c+s:c+s+1,_=a,v=a,y=0,b=0,x=Math.abs(p),S=[];y+b<=x;){if(g+=m,g<c||g>=l)return null;if(v=_,S.push(_),_=f[g],_===void 0){var C=new e.Point(u.getx(g),u.gety(g)),w=Tt(C,d);if(w.signedDistanceFromCamera>0)_=f[g]=w.point;else{var T=g-m;_=Mt(y===0?o:new e.Point(u.getx(T),u.gety(T)),C,v,x-y+1,d)}}y+=b,b=v.dist(_)}var E=(x-y)/b,D=_.sub(v),O=D.mult(E)._add(v);O._add(D._unit()._perp()._mult(r*m));var k=h+Math.atan2(_.y-v.y,_.x-v.x);return S.push(O),{point:O,angle:k,path:S}}var Pt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ft(e,t){for(var n=0;n<e;n++){var r=t.length;t.resize(r+4),t.float32.set(Pt,r*3)}}function It(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e[3]=n[3]*r+n[7]*i+n[15],e}var Lt=100,Rt=function(e,t,n){t===void 0&&(t=new St(e.width+2*Lt,e.height+2*Lt,25)),n===void 0&&(n=new St(e.width+2*Lt,e.height+2*Lt,25)),this.transform=e,this.grid=t,this.ignoredGrid=n,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+Lt,this.screenBottomBoundary=e.height+Lt,this.gridRightBoundary=e.width+2*Lt,this.gridBottomBoundary=e.height+2*Lt};Rt.prototype.placeCollisionBox=function(e,t,n,r,i){var a=this.projectAndGetPerspectiveRatio(r,e.anchorPointX,e.anchorPointY),o=n*a.perspectiveRatio,s=e.x1*o+a.point.x,c=e.y1*o+a.point.y,l=e.x2*o+a.point.x,u=e.y2*o+a.point.y;return!this.isInsideGrid(s,c,l,u)||!t&&this.grid.hitTest(s,c,l,u,i)?{box:[],offscreen:!1}:{box:[s,c,l,u],offscreen:this.isOffscreen(s,c,l,u)}},Rt.prototype.placeCollisionCircles=function(t,n,r,i,a,o,s,c,l,u,d,f,p){var m=[],h=new e.Point(n.anchorX,n.anchorY),g=Tt(h,o),_=Et(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),v=(u?a/_:a*_)/e.ONE_EM,y=Tt(h,s).point,b=kt(v,i,n.lineOffsetX*v,n.lineOffsetY*v,!1,y,h,n,r,s,{}),x=!1,S=!1,C=!0;if(b){for(var w=f*.5*_+p,T=new e.Point(-Lt,-Lt),E=new e.Point(this.screenRightBoundary,this.screenBottomBoundary),D=new xt,O=b.first,k=b.last,A=[],j=O.path.length-1;j>=1;j--)A.push(O.path[j]);for(var M=1;M<k.path.length;M++)A.push(k.path[M]);var N=w*2.5;if(c){var P=A.map(function(e){return Tt(e,c)});A=P.some(function(e){return e.signedDistanceFromCamera<=0})?[]:P.map(function(e){return e.point})}var F=[];if(A.length>0){for(var I=A[0].clone(),L=A[0].clone(),R=1;R<A.length;R++)I.x=Math.min(I.x,A[R].x),I.y=Math.min(I.y,A[R].y),L.x=Math.max(L.x,A[R].x),L.y=Math.max(L.y,A[R].y);F=I.x>=T.x&&L.x<=E.x&&I.y>=T.y&&L.y<=E.y?[A]:L.x<T.x||I.x>E.x||L.y<T.y||I.y>E.y?[]:e.clipLine([A],T.x,T.y,E.x,E.y)}for(var z=0,B=F;z<B.length;z+=1){var V=B[z];D.reset(V,w*.25);var H=0;H=D.length<=.5*w?1:Math.ceil(D.paddedLength/N)+1;for(var U=0;U<H;U++){var W=U/Math.max(H-1,1),G=D.lerp(W),K=G.x+Lt,q=G.y+Lt;m.push(K,q,w,0);var J=K-w,Y=q-w,X=K+w,Z=q+w;if(C&&=this.isOffscreen(J,Y,X,Z),S||=this.isInsideGrid(J,Y,X,Z),!t&&this.grid.hitTestCircle(K,q,w,d)&&(x=!0,!l))return{circles:[],offscreen:!1,collisionDetected:x}}}}return{circles:!l&&x||!S?[]:m,offscreen:C,collisionDetected:x}},Rt.prototype.queryRenderedSymbols=function(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var n=[],r=1/0,i=1/0,a=-1/0,o=-1/0,s=0,c=t;s<c.length;s+=1){var l=c[s],u=new e.Point(l.x+Lt,l.y+Lt);r=Math.min(r,u.x),i=Math.min(i,u.y),a=Math.max(a,u.x),o=Math.max(o,u.y),n.push(u)}for(var d=this.grid.query(r,i,a,o).concat(this.ignoredGrid.query(r,i,a,o)),f={},p={},m=0,h=d;m<h.length;m+=1){var g=h[m],_=g.key;if(f[_.bucketInstanceId]===void 0&&(f[_.bucketInstanceId]={}),!f[_.bucketInstanceId][_.featureIndex]){var v=[new e.Point(g.x1,g.y1),new e.Point(g.x2,g.y1),new e.Point(g.x2,g.y2),new e.Point(g.x1,g.y2)];e.polygonIntersectsPolygon(n,v)&&(f[_.bucketInstanceId][_.featureIndex]=!0,p[_.bucketInstanceId]===void 0&&(p[_.bucketInstanceId]=[]),p[_.bucketInstanceId].push(_.featureIndex))}}return p},Rt.prototype.insertCollisionBox=function(e,t,n,r,i){var a=t?this.ignoredGrid:this.grid,o={bucketInstanceId:n,featureIndex:r,collisionGroupID:i};a.insert(o,e[0],e[1],e[2],e[3])},Rt.prototype.insertCollisionCircles=function(e,t,n,r,i){for(var a=t?this.ignoredGrid:this.grid,o={bucketInstanceId:n,featureIndex:r,collisionGroupID:i},s=0;s<e.length;s+=4)a.insertCircle(o,e[s],e[s+1],e[s+2])},Rt.prototype.projectAndGetPerspectiveRatio=function(t,n,r){var i=[n,r,0,1];return It(i,i,t),{point:new e.Point((i[0]/i[3]+1)/2*this.transform.width+Lt,(-i[1]/i[3]+1)/2*this.transform.height+Lt),perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/i[3])}},Rt.prototype.isOffscreen=function(e,t,n,r){return n<Lt||e>=this.screenRightBoundary||r<Lt||t>this.screenBottomBoundary},Rt.prototype.isInsideGrid=function(e,t,n,r){return n>=0&&e<this.gridRightBoundary&&r>=0&&t<this.gridBottomBoundary},Rt.prototype.getViewportMatrix=function(){var t=e.identity([]);return e.translate(t,t,[-Lt,-Lt,0]),t};function zt(t,n,r){return n*(e.EXTENT/(t.tileSize*2**(r-t.tileID.overscaledZ)))}var Bt=function(e,t,n,r){e?this.opacity=Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):this.opacity=r&&n?1:0,this.placed=n};Bt.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Vt=function(e,t,n,r,i){this.text=new Bt(e?e.text:null,t,n,i),this.icon=new Bt(e?e.icon:null,t,r,i)};Vt.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Ht=function(e,t,n){this.text=e,this.icon=t,this.skipFade=n},Ut=function(){this.invProjMatrix=e.create(),this.viewportMatrix=e.create(),this.circles=[]},Wt=function(e,t,n,r,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=n,this.bucketIndex=r,this.tileID=i},Gt=function(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}};Gt.prototype.get=function(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){var t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:function(e){return e.collisionGroupID===t}}}return this.collisionGroups[e]};function Kt(t,n,r,i,a){var o=e.getAnchorAlignment(t),s=o.horizontalAlign,c=o.verticalAlign,l=-(s-.5)*n,u=-(c-.5)*r,d=e.evaluateVariableOffset(t,i);return new e.Point(l+d[0]*a,u+d[1]*a)}function qt(t,n,r,i,a,o){var s=t.x1,c=t.x2,l=t.y1,u=t.y2,d=t.anchorPointX,f=t.anchorPointY,p=new e.Point(n,r);return i&&p._rotate(a?o:-o),{x1:s+p.x,y1:l+p.y,x2:c+p.x,y2:u+p.y,anchorPointX:d,anchorPointY:f}}var Jt=function(e,t,n,r){this.transform=e.clone(),this.collisionIndex=new Rt(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new Gt(n),this.collisionCircleArrays={},this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={}};Jt.prototype.getBucketParts=function(t,n,r,i){var a=r.getBucket(n),o=r.latestFeatureIndex;if(!(!a||!o||n.id!==a.layerIds[0])){var s=r.collisionBoxArray,c=a.layers[0].layout,l=2**(this.transform.zoom-r.tileID.overscaledZ),u=r.tileSize/e.EXTENT,d=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),f=c.get(`text-pitch-alignment`)===`map`,p=c.get(`text-rotation-alignment`)===`map`,m=zt(r,1,this.transform.zoom),h=Ct(d,f,p,this.transform,m),g=null;if(f){var _=wt(d,f,p,this.transform,m);g=e.multiply([],this.transform.labelPlaneMatrix,_)}this.retainedQueryData[a.bucketInstanceId]=new Wt(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,r.tileID);var v={bucket:a,layout:c,posMatrix:d,textLabelPlaneMatrix:h,labelToScreenMatrix:g,scale:l,textPixelRatio:u,holdingForFade:r.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(var y=0,b=a.sortKeyRanges;y<b.length;y+=1){var x=b[y],S=x.sortKey,C=x.symbolInstanceStart,w=x.symbolInstanceEnd;t.push({sortKey:S,symbolInstanceStart:C,symbolInstanceEnd:w,parameters:v})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:v})}},Jt.prototype.attemptAnchorPlacement=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){var h=[d.textOffset0,d.textOffset1],g=Kt(e,n,r,h,i),_=this.collisionIndex.placeCollisionBox(qt(t,g.x,g.y,a,o,this.transform.angle),u,s,c,l.predicate);if(!(m&&this.collisionIndex.placeCollisionBox(qt(m,g.x,g.y,a,o,this.transform.angle),u,s,c,l.predicate).box.length===0)&&_.box.length>0){var v;return this.prevPlacement&&this.prevPlacement.variableOffsets[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID].text&&(v=this.prevPlacement.variableOffsets[d.crossTileID].anchor),this.variableOffsets[d.crossTileID]={textOffset:h,width:n,height:r,anchor:e,textBoxScale:i,prevAnchor:v},this.markUsedJustification(f,e,d,p),f.allowVerticalPlacement&&(this.markUsedOrientation(f,p,d),this.placedOrientations[d.crossTileID]=p),{shift:g,placedGlyphBoxes:_}}},Jt.prototype.placeLayerBucketPart=function(t,n,r){var i=this,a=t.parameters,o=a.bucket,s=a.layout,c=a.posMatrix,l=a.textLabelPlaneMatrix,u=a.labelToScreenMatrix,d=a.textPixelRatio,f=a.holdingForFade,p=a.collisionBoxArray,m=a.partiallyEvaluatedTextSize,h=a.collisionGroup,g=s.get(`text-optional`),_=s.get(`icon-optional`),v=s.get(`text-allow-overlap`),y=s.get(`icon-allow-overlap`),b=s.get(`text-rotation-alignment`)===`map`,x=s.get(`text-pitch-alignment`)===`map`,S=s.get(`icon-text-fit`)!==`none`,C=s.get(`symbol-z-order`)===`viewport-y`,w=v&&(y||!o.hasIconData()||_),T=y&&(v||!o.hasTextData()||g);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);var E=function(t,a){if(!n[t.crossTileID]){if(f){i.placements[t.crossTileID]=new Ht(!1,!1,!1);return}var p=!1,C=!1,E=!0,D=null,O={box:null,offscreen:null},k={box:null,offscreen:null},A=null,j=null,M=null,N=0,P=0,F=0;a.textFeatureIndex?N=a.textFeatureIndex:t.useRuntimeCollisionCircles&&(N=t.featureIndex),a.verticalTextFeatureIndex&&(P=a.verticalTextFeatureIndex);var I=a.textBox;if(I){var L=function(n){var r=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!n&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[t.crossTileID];a&&(i.placedOrientations[t.crossTileID]=a,r=a,i.markUsedOrientation(o,r,t))}return r},R=function(n,r){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i<s.length&&(s[i]===e.WritingMode.vertical?(O=r(),k=O):O=n(),!(O&&O.box&&O.box.length));i+=1);else O=n()};if(s.get(`text-variable-anchor`)){var z=s.get(`text-variable-anchor`);if(i.prevPlacement&&i.prevPlacement.variableOffsets[t.crossTileID]){var B=i.prevPlacement.variableOffsets[t.crossTileID];z.indexOf(B.anchor)>0&&(z=z.filter(function(e){return e!==B.anchor}),z.unshift(B.anchor))}var V=function(e,n,r){for(var a=e.x2-e.x1,s=e.y2-e.y1,l=t.textBoxScale,u=S&&!y?n:null,f={box:[],offscreen:!1},m=v?z.length*2:z.length,g=0;g<m;++g){var _=z[g%z.length],C=g>=z.length,w=i.attemptAnchorPlacement(_,e,a,s,l,b,x,d,c,h,C,t,o,r,u);if(w&&(f=w.placedGlyphBoxes,f&&f.box&&f.box.length)){p=!0,D=w.shift;break}}return f};R(function(){return V(I,a.iconBox,e.WritingMode.horizontal)},function(){var n=a.verticalTextBox,r=O&&O.box&&O.box.length;return o.allowVerticalPlacement&&!r&&t.numVerticalGlyphVertices>0&&n?V(n,a.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}}),O&&(p=O.box,E=O.offscreen);var H=L(O&&O.box);if(!p&&i.prevPlacement){var U=i.prevPlacement.variableOffsets[t.crossTileID];U&&(i.variableOffsets[t.crossTileID]=U,i.markUsedJustification(o,U.anchor,t,H))}}else{var W=function(e,n){var r=i.collisionIndex.placeCollisionBox(e,v,d,c,h.predicate);return r&&r.box&&r.box.length&&(i.markUsedOrientation(o,n,t),i.placedOrientations[t.crossTileID]=n),r};R(function(){return W(I,e.WritingMode.horizontal)},function(){var n=a.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&n?W(n,e.WritingMode.vertical):{box:null,offscreen:null}}),L(O&&O.box&&O.box.length)}}if(A=O,p=A&&A.box&&A.box.length>0,E=A&&A.offscreen,t.useRuntimeCollisionCircles){var G=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),K=e.evaluateSizeForFeature(o.textSizeData,m,G),q=s.get(`text-padding`),J=t.collisionCircleDiameter;j=i.collisionIndex.placeCollisionCircles(v,G,o.lineVertexArray,o.glyphOffsetArray,K,c,l,u,r,x,h.predicate,J,q),p=v||j.circles.length>0&&!j.collisionDetected,E&&=j.offscreen}if(a.iconFeatureIndex&&(F=a.iconFeatureIndex),a.iconBox){var Y=function(e){var t=S&&D?qt(e,D.x,D.y,b,x,i.transform.angle):e;return i.collisionIndex.placeCollisionBox(t,y,d,c,h.predicate)};k&&k.box&&k.box.length&&a.verticalIconBox?(M=Y(a.verticalIconBox),C=M.box.length>0):(M=Y(a.iconBox),C=M.box.length>0),E&&=M.offscreen}var X=g||t.numHorizontalGlyphVertices===0&&t.numVerticalGlyphVertices===0,Z=_||t.numIconVertices===0;if(!X&&!Z?C=p=C&&p:Z?X||(C&&=p):p=C&&p,p&&A&&A.box&&(k&&k.box&&P?i.collisionIndex.insertCollisionBox(A.box,s.get(`text-ignore-placement`),o.bucketInstanceId,P,h.ID):i.collisionIndex.insertCollisionBox(A.box,s.get(`text-ignore-placement`),o.bucketInstanceId,N,h.ID)),C&&M&&i.collisionIndex.insertCollisionBox(M.box,s.get(`icon-ignore-placement`),o.bucketInstanceId,F,h.ID),j&&(p&&i.collisionIndex.insertCollisionCircles(j.circles,s.get(`text-ignore-placement`),o.bucketInstanceId,N,h.ID),r)){var Q=o.bucketInstanceId,ee=i.collisionCircleArrays[Q];ee===void 0&&(ee=i.collisionCircleArrays[Q]=new Ut);for(var te=0;te<j.circles.length;te+=4)ee.circles.push(j.circles[te+0]),ee.circles.push(j.circles[te+1]),ee.circles.push(j.circles[te+2]),ee.circles.push(j.collisionDetected?1:0)}i.placements[t.crossTileID]=new Ht(p||w,C||T,E||o.justReloaded),n[t.crossTileID]=!0}};if(C)for(var D=o.getSortedSymbolIndexes(this.transform.angle),O=D.length-1;O>=0;--O){var k=D[O];E(o.symbolInstances.get(k),o.collisionArrays[k])}else for(var A=t.symbolInstanceStart;A<t.symbolInstanceEnd;A++)E(o.symbolInstances.get(A),o.collisionArrays[A]);if(r&&o.bucketInstanceId in this.collisionCircleArrays){var j=this.collisionCircleArrays[o.bucketInstanceId];e.invert(j.invProjMatrix,c),j.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1},Jt.prototype.markUsedJustification=function(t,n,r,i){for(var a={left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex},o=i===e.WritingMode.vertical?r.verticalPlacedTextSymbolIndex:a[e.getAnchorJustification(n)],s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex],c=0,l=s;c<l.length;c+=1){var u=l[c];u>=0&&(o>=0&&u!==o?t.text.placedSymbolArray.get(u).crossTileID=0:t.text.placedSymbolArray.get(u).crossTileID=r.crossTileID)}},Jt.prototype.markUsedOrientation=function(t,n,r){for(var i=n===e.WritingMode.horizontal||n===e.WritingMode.horizontalOnly?n:0,a=n===e.WritingMode.vertical?n:0,o=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex],s=0,c=o;s<c.length;s+=1){var l=c[s];t.text.placedSymbolArray.get(l).placedOrientation=i}r.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=a)},Jt.prototype.commit=function(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;var t=this.prevPlacement,n=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;var r=t?t.symbolFadeChange(e):1,i=t?t.opacities:{},a=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(var s in this.placements){var c=this.placements[s],l=i[s];l?(this.opacities[s]=new Vt(l,r,c.text,c.icon),n=n||c.text!==l.text.placed||c.icon!==l.icon.placed):(this.opacities[s]=new Vt(null,r,c.text,c.icon,c.skipFade),n=n||c.text||c.icon)}for(var u in i){var d=i[u];if(!this.opacities[u]){var f=new Vt(d,r,!1,!1);f.isHidden()||(this.opacities[u]=f,n=n||d.text.placed||d.icon.placed)}}for(var p in a)!this.variableOffsets[p]&&this.opacities[p]&&!this.opacities[p].isHidden()&&(this.variableOffsets[p]=a[p]);for(var m in o)!this.placedOrientations[m]&&this.opacities[m]&&!this.opacities[m].isHidden()&&(this.placedOrientations[m]=o[m]);n?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!=`number`&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)},Jt.prototype.updateLayerOpacities=function(e,t){for(var n={},r=0,i=t;r<i.length;r+=1){var a=i[r],o=a.getBucket(e);o&&a.latestFeatureIndex&&e.id===o.layerIds[0]&&this.updateBucketOpacities(o,n,a.collisionBoxArray)}},Jt.prototype.updateBucketOpacities=function(t,n,r){var i=this;t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();var a=t.layers[0].layout,o=new Vt(null,0,!1,!1,!0),s=a.get(`text-allow-overlap`),c=a.get(`icon-allow-overlap`),l=a.get(`text-variable-anchor`),u=a.get(`text-rotation-alignment`)===`map`,d=a.get(`text-pitch-alignment`)===`map`,f=a.get(`icon-text-fit`)!==`none`,p=new Vt(null,0,s&&(c||!t.hasIconData()||a.get(`icon-optional`)),c&&(s||!t.hasTextData()||a.get(`text-optional`)),!0);!t.collisionArrays&&r&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(r);for(var m=function(e,t,n){for(var r=0;r<t/4;r++)e.opacityVertexArray.emplaceBack(n)},h=function(r){var a=t.symbolInstances.get(r),s=a.numHorizontalGlyphVertices,c=a.numVerticalGlyphVertices,h=a.crossTileID,g=n[h],_=i.opacities[h];g?_=o:_||(_=p,i.opacities[h]=_),n[h]=!0;var v=s>0||c>0,y=a.numIconVertices>0,b=i.placedOrientations[a.crossTileID],x=b===e.WritingMode.vertical,S=b===e.WritingMode.horizontal||b===e.WritingMode.horizontalOnly;if(v){var C=rn(_.text),w=x?an:C;m(t.text,s,w);var T=S?an:C;m(t.text,c,T);var E=_.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach(function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=E||x?1:0)}),a.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=E||S?1:0);var D=i.variableOffsets[a.crossTileID];D&&i.markUsedJustification(t,D.anchor,a,b);var O=i.placedOrientations[a.crossTileID];O&&(i.markUsedJustification(t,`left`,a,O),i.markUsedOrientation(t,O,a))}if(y){var k=rn(_.icon),A=!(f&&a.verticalPlacedIconSymbolIndex&&x);if(a.placedIconSymbolIndex>=0){var j=A?k:an;m(t.icon,a.numIconVertices,j),t.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=_.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var M=A?an:k;m(t.icon,a.numVerticalIconVertices,M),t.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=_.icon.isHidden()}}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var N=t.collisionArrays[r];if(N){var P=new e.Point(0,0);if(N.textBox||N.verticalTextBox){var F=!0;if(l){var I=i.variableOffsets[h];I?(P=Kt(I.anchor,I.width,I.height,I.textOffset,I.textBoxScale),u&&P._rotate(d?i.transform.angle:-i.transform.angle)):F=!1}N.textBox&&Yt(t.textCollisionBox.collisionVertexArray,_.text.placed,!F||x,P.x,P.y),N.verticalTextBox&&Yt(t.textCollisionBox.collisionVertexArray,_.text.placed,!F||S,P.x,P.y)}var L=!!(!S&&N.verticalIconBox);N.iconBox&&Yt(t.iconCollisionBox.collisionVertexArray,_.icon.placed,L,f?P.x:0,f?P.y:0),N.verticalIconBox&&Yt(t.iconCollisionBox.collisionVertexArray,_.icon.placed,!L,f?P.x:0,f?P.y:0)}}},g=0;g<t.symbolInstances.length;g++)h(g);if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){var _=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=_.invProjMatrix,t.placementViewportMatrix=_.viewportMatrix,t.collisionCircleArray=_.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}},Jt.prototype.symbolFadeChange=function(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Jt.prototype.zoomAdjustment=function(e){return Math.max(0,(this.transform.zoom-e)/1.5)},Jt.prototype.hasTransitions=function(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration},Jt.prototype.stillRecent=function(e,t){var n=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*n>e},Jt.prototype.setStale=function(){this.stale=!0};function Yt(e,t,n,r,i){e.emplaceBack(t?1:0,n?1:0,r||0,i||0),e.emplaceBack(t?1:0,n?1:0,r||0,i||0),e.emplaceBack(t?1:0,n?1:0,r||0,i||0),e.emplaceBack(t?1:0,n?1:0,r||0,i||0)}var Xt=2**25,Zt=2**24,Qt=2**17,$t=2**16,en=2**9,tn=2**8,nn=2**1;function rn(e){if(e.opacity===0&&!e.placed)return 0;if(e.opacity===1&&e.placed)return 4294967295;var t=e.placed?1:0,n=Math.floor(e.opacity*127);return n*Xt+t*Zt+n*Qt+t*$t+n*en+t*tn+n*nn+t}var an=0,on=function(e){this._sortAcrossTiles=e.layout.get(`symbol-z-order`)!==`viewport-y`&&e.layout.get(`symbol-sort-key`).constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};on.prototype.continuePlacement=function(e,t,n,r,i){for(var a=this._bucketParts;this._currentTileIndex<e.length;){var o=e[this._currentTileIndex];if(t.getBucketParts(a,r,o,this._sortAcrossTiles),this._currentTileIndex++,i())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort(function(e,t){return e.sortKey-t.sortKey}));this._currentPartIndex<a.length;){var s=a[this._currentPartIndex];if(t.placeLayerBucketPart(s,this._seenCrossTileIDs,n),this._currentPartIndex++,i())return!0}return!1};var sn=function(e,t,n,r,i,a,o){this.placement=new Jt(e,i,a,o),this._currentPlacementIndex=t.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=r,this._done=!1};sn.prototype.isDone=function(){return this._done},sn.prototype.continuePlacement=function(t,n,r){for(var i=this,a=e.browser.now(),o=function(){var t=e.browser.now()-a;return i._forceFullPlacement?!1:t>2};this._currentPlacementIndex>=0;){var s=n[t[this._currentPlacementIndex]],c=this.placement.collisionIndex.transform.zoom;if(s.type===`symbol`&&(!s.minzoom||s.minzoom<=c)&&(!s.maxzoom||s.maxzoom>c)){if(this._inProgressLayer||=new on(s),this._inProgressLayer.continuePlacement(r[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},sn.prototype.commit=function(e){return this.placement.commit(e),this.placement};var cn=512/e.EXTENT/2,ln=function(e,t,n){this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var r=0;r<t.length;r++){var i=t.get(r),a=i.key;this.indexedSymbolInstances[a]||(this.indexedSymbolInstances[a]=[]),this.indexedSymbolInstances[a].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,e)})}};ln.prototype.getScaledCoordinates=function(t,n){var r=cn/2**(n.canonical.z-this.tileID.canonical.z);return{x:Math.floor((n.canonical.x*e.EXTENT+t.anchorX)*r),y:Math.floor((n.canonical.y*e.EXTENT+t.anchorY)*r)}},ln.prototype.findMatches=function(e,t,n){for(var r=this.tileID.canonical.z<t.canonical.z?1:2**(this.tileID.canonical.z-t.canonical.z),i=0;i<e.length;i++){var a=e.get(i);if(!a.crossTileID){var o=this.indexedSymbolInstances[a.key];if(o)for(var s=this.getScaledCoordinates(a,t),c=0,l=o;c<l.length;c+=1){var u=l[c];if(Math.abs(u.coord.x-s.x)<=r&&Math.abs(u.coord.y-s.y)<=r&&!n[u.crossTileID]){n[u.crossTileID]=!0,a.crossTileID=u.crossTileID;break}}}}};var un=function(){this.maxCrossTileID=0};un.prototype.generate=function(){return++this.maxCrossTileID};var dn=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};dn.prototype.handleWrapJump=function(e){var t=Math.round((e-this.lng)/360);if(t!==0)for(var n in this.indexes){var r=this.indexes[n],i={};for(var a in r){var o=r[a];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+t),i[o.tileID.key]=o}this.indexes[n]=i}this.lng=e},dn.prototype.addBucket=function(e,t,n){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(var r=0;r<t.symbolInstances.length;r++){var i=t.symbolInstances.get(r);i.crossTileID=0}this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});var a=this.usedCrossTileIDs[e.overscaledZ];for(var o in this.indexes){var s=this.indexes[o];if(Number(o)>e.overscaledZ)for(var c in s){var l=s[c];l.tileID.isChildOf(e)&&l.findMatches(t.symbolInstances,e,a)}else{var u=s[e.scaledTo(Number(o)).key];u&&u.findMatches(t.symbolInstances,e,a)}}for(var d=0;d<t.symbolInstances.length;d++){var f=t.symbolInstances.get(d);f.crossTileID||(f.crossTileID=n.generate(),a[f.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new ln(e,t.symbolInstances,t.bucketInstanceId),!0},dn.prototype.removeBucketCrossTileIDs=function(e,t){for(var n in t.indexedSymbolInstances)for(var r=0,i=t.indexedSymbolInstances[n];r<i.length;r+=1){var a=i[r];delete this.usedCrossTileIDs[e][a.crossTileID]}},dn.prototype.removeStaleBuckets=function(e){var t=!1;for(var n in this.indexes){var r=this.indexes[n];for(var i in r)e[r[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,r[i]),delete r[i],t=!0)}return t};var fn=function(){this.layerIndexes={},this.crossTileIDs=new un,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};fn.prototype.addLayer=function(e,t,n){var r=this.layerIndexes[e.id];r===void 0&&(r=this.layerIndexes[e.id]=new dn);var i=!1,a={};r.handleWrapJump(n);for(var o=0,s=t;o<s.length;o+=1){var c=s[o],l=c.getBucket(e);!l||e.id!==l.layerIds[0]||(l.bucketInstanceId||=++this.maxBucketInstanceId,r.addBucket(c.tileID,l,this.crossTileIDs)&&(i=!0),a[l.bucketInstanceId]=!0)}return r.removeStaleBuckets(a)&&(i=!0),i},fn.prototype.pruneUnusedLayers=function(e){var t={};for(var n in e.forEach(function(e){t[e]=!0}),this.layerIndexes)t[n]||delete this.layerIndexes[n]};var pn=function(t,n){return e.emitValidationErrors(t,n&&n.filter(function(e){return e.identifier!==`source.canvas`}))},mn=e.pick($,[`addLayer`,`removeLayer`,`setPaintProperty`,`setLayoutProperty`,`setFilter`,`addSource`,`removeSource`,`setLayerZoomRange`,`setLight`,`setTransition`,`setGeoJSONSourceData`]),hn=e.pick($,[`setCenter`,`setZoom`,`setBearing`,`setPitch`]),gn=ut(),_n=function(t){function n(r,i){var a=this;i===void 0&&(i={}),t.call(this),this.map=r,this.dispatcher=new O(at(),this),this.imageManager=new m,this.imageManager.setEventedParent(this),this.glyphManager=new S(r._requestManager,i.localIdeographFontFamily),this.lineAtlas=new D(256,512),this.crossTileSymbolIndex=new fn,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast(`setReferrer`,e.getReferrer());var o=this;this._rtlTextPluginCallback=n.registerForPluginStateChange(function(t){var n={pluginStatus:t.pluginStatus,pluginURL:t.pluginURL};o.dispatcher.broadcast(`syncRTLPluginState`,n,function(t,n){if(e.triggerPluginCompletionEvent(t),n&&n.every(function(e){return e}))for(var r in o.sourceCaches)o.sourceCaches[r].reload()})}),this.on(`data`,function(e){if(!(e.dataType!==`source`||e.sourceDataType!==`metadata`)){var t=a.sourceCaches[e.sourceId];if(t){var n=t.getSource();if(!(!n||!n.vectorLayerIds))for(var r in a._layers){var i=a._layers[r];i.source===n.id&&a._validateLayer(i)}}}})}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.loadURL=function(t,n){var r=this;n===void 0&&(n={}),this.fire(new e.Event(`dataloading`,{dataType:`style`}));var i=typeof n.validate==`boolean`?n.validate:!e.isMapboxURL(t);t=this.map._requestManager.normalizeStyleURL(t,n.accessToken);var a=this.map._requestManager.transformRequest(t,e.ResourceType.Style);this._request=e.getJSON(a,function(t,n){r._request=null,t?r.fire(new e.ErrorEvent(t)):n&&r._load(n,i)})},n.prototype.loadJSON=function(t,n){var r=this;n===void 0&&(n={}),this.fire(new e.Event(`dataloading`,{dataType:`style`})),this._request=e.browser.frame(function(){r._request=null,r._load(t,n.validate!==!1)})},n.prototype.loadEmpty=function(){this.fire(new e.Event(`dataloading`,{dataType:`style`})),this._load(gn,!1)},n.prototype._load=function(t,n){if(!(n&&pn(this,e.validateStyle(t)))){for(var r in this._loaded=!0,this.stylesheet=t,t.sources)this.addSource(r,t.sources[r],{validate:!1});t.sprite?this._loadSprite(t.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);var i=lt(this.stylesheet.layers);this._order=i.map(function(e){return e.id}),this._layers={},this._serializedLayers={};for(var a=0,o=i;a<o.length;a+=1){var s=o[a];s=e.createStyleLayer(s),s.setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.serialize()}this.dispatcher.broadcast(`setLayers`,this._serializeLayers(this._order)),this.light=new E(this.stylesheet.light),this.fire(new e.Event(`data`,{dataType:`style`})),this.fire(new e.Event(`style.load`))}},n.prototype._loadSprite=function(t){var n=this;this._spriteRequest=d(t,this.map._requestManager,function(t,r){if(n._spriteRequest=null,t)n.fire(new e.ErrorEvent(t));else if(r)for(var i in r)n.imageManager.addImage(i,r[i]);n.imageManager.setLoaded(!0),n._availableImages=n.imageManager.listImages(),n.dispatcher.broadcast(`setImages`,n._availableImages),n.fire(new e.Event(`data`,{dataType:`style`}))})},n.prototype._validateLayer=function(t){var n=this.sourceCaches[t.source];if(n){var r=t.sourceLayer;if(r){var i=n.getSource();(i.type===`geojson`||i.vectorLayerIds&&i.vectorLayerIds.indexOf(r)===-1)&&this.fire(new e.ErrorEvent(Error(`Source layer "`+r+`" does not exist on source "`+i.id+`" as specified by style layer "`+t.id+`"`)))}}},n.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()},n.prototype._serializeLayers=function(e){for(var t=[],n=0,r=e;n<r.length;n+=1){var i=r[n],a=this._layers[i];a.type!==`custom`&&t.push(a.serialize())}return t},n.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(var t in this._layers)if(this._layers[t].hasTransition())return!0;return!1},n.prototype._checkLoaded=function(){if(!this._loaded)throw Error(`Style is not done loading`)},n.prototype.update=function(t){if(this._loaded){var n=this._changed;if(this._changed){var r=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var a in(r.length||i.length)&&this._updateWorkerLayers(r,i),this._updatedSources){var o=this._updatedSources[a];o===`reload`?this._reloadSource(a):o===`clear`&&this._clearSource(a)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}var c={};for(var l in this.sourceCaches){var u=this.sourceCaches[l];c[l]=u.used,u.used=!1}for(var d=0,f=this._order;d<f.length;d+=1){var p=f[d],m=this._layers[p];m.recalculate(t,this._availableImages),!m.isHidden(t.zoom)&&m.source&&(this.sourceCaches[m.source].used=!0)}for(var h in c){var g=this.sourceCaches[h];c[h]!==g.used&&g.fire(new e.Event(`data`,{sourceDataType:`visibility`,dataType:`source`,sourceId:h}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new e.Event(`data`,{dataType:`style`}))}},n.prototype._updateTilesForChangedImages=function(){var e=Object.keys(this._changedImages);if(e.length){for(var t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies([`icons`,`patterns`],e);this._changedImages={}}},n.prototype._updateWorkerLayers=function(e,t){this.dispatcher.broadcast(`updateLayers`,{layers:this._serializeLayers(e),removedIds:t})},n.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},n.prototype.setState=function(t){var n=this;if(this._checkLoaded(),pn(this,e.validateStyle(t)))return!1;t=e.clone$1(t),t.layers=lt(t.layers);var r=bt(this.serialize(),t).filter(function(e){return!(e.command in hn)});if(r.length===0)return!1;var i=r.filter(function(e){return!(e.command in mn)});if(i.length>0)throw Error(`Unimplemented: `+i.map(function(e){return e.command}).join(`, `)+`.`);return r.forEach(function(e){e.command!==`setTransition`&&n[e.command].apply(n,e.args)}),this.stylesheet=t,!0},n.prototype.addImage=function(t,n){if(this.getImage(t))return this.fire(new e.ErrorEvent(Error(`An image with this name already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)},n.prototype.updateImage=function(e,t){this.imageManager.updateImage(e,t)},n.prototype.getImage=function(e){return this.imageManager.getImage(e)},n.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(Error(`No image with this name exists.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)},n.prototype._afterImageUpdated=function(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast(`setImages`,this._availableImages),this.fire(new e.Event(`data`,{dataType:`style`}))},n.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},n.prototype.addSource=function(t,n,r){var i=this;if(r===void 0&&(r={}),this._checkLoaded(),this.sourceCaches[t]!==void 0)throw Error(`There is already a source with this ID`);if(!n.type)throw Error(`The type property must be defined, but only the following properties were given: `+Object.keys(n).join(`, `)+`.`);if(!([`vector`,`raster`,`geojson`,`video`,`image`].indexOf(n.type)>=0&&this._validate(e.validateStyle.source,`sources.`+t,n,null,r))){this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);var a=this.sourceCaches[t]=new Ze(t,n,this.dispatcher);a.style=this,a.setEventedParent(this,function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:t}}),a.onAdd(this.map),this._changed=!0}},n.prototype.removeSource=function(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw Error(`There is no source with this ID`);for(var n in this._layers)if(this._layers[n].source===t)return this.fire(new e.ErrorEvent(Error(`Source "`+t+`" cannot be removed while layer "`+n+`" is using it.`)));var r=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],r.fire(new e.Event(`data`,{sourceDataType:`metadata`,dataType:`source`,sourceId:t})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.onRemove(this.map),this._changed=!0},n.prototype.setGeoJSONSourceData=function(e,t){this._checkLoaded(),this.sourceCaches[e].getSource().setData(t),this._changed=!0},n.prototype.getSource=function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()},n.prototype.addLayer=function(t,n,r){r===void 0&&(r={}),this._checkLoaded();var i=t.id;if(this.getLayer(i)){this.fire(new e.ErrorEvent(Error(`Layer with id "`+i+`" already exists on this map`)));return}var a;if(t.type===`custom`){if(pn(this,e.validateCustomStyleLayer(t)))return;a=e.createStyleLayer(t)}else{if(typeof t.source==`object`&&(this.addSource(i,t.source),t=e.clone$1(t),t=e.extend(t,{source:i})),this._validate(e.validateStyle.layer,`layers.`+i,t,{arrayIndex:-1},r))return;a=e.createStyleLayer(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=n?this._order.indexOf(n):this._order.length;if(n&&o===-1){this.fire(new e.ErrorEvent(Error(`Layer with id "`+n+`" does not exist on this map.`)));return}if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&a.type!==`custom`){var s=this._removedLayers[i];delete this._removedLayers[i],s.type===a.type?(this._updatedSources[a.source]=`reload`,this.sourceCaches[a.source].pause()):this._updatedSources[a.source]=`clear`}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)},n.prototype.moveLayer=function(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t]){this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style and cannot be moved.`)));return}if(t!==n){var r=this._order.indexOf(t);this._order.splice(r,1);var i=n?this._order.indexOf(n):this._order.length;if(n&&i===-1){this.fire(new e.ErrorEvent(Error(`Layer with id "`+n+`" does not exist on this map.`)));return}this._order.splice(i,0,t),this._layerOrderChanged=!0}},n.prototype.removeLayer=function(t){this._checkLoaded();var n=this._layers[t];if(!n){this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style and cannot be removed.`)));return}n.setEventedParent(null);var r=this._order.indexOf(t);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)},n.prototype.getLayer=function(e){return this._layers[e]},n.prototype.hasLayer=function(e){return e in this._layers},n.prototype.setLayerZoomRange=function(t,n,r){this._checkLoaded();var i=this.getLayer(t);if(!i){this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style and cannot have zoom extent.`)));return}i.minzoom===n&&i.maxzoom===r||(n!=null&&(i.minzoom=n),r!=null&&(i.maxzoom=r),this._updateLayer(i))},n.prototype.setFilter=function(t,n,r){r===void 0&&(r={}),this._checkLoaded();var i=this.getLayer(t);if(!i){this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style and cannot be filtered.`)));return}if(!e.deepEqual(i.filter,n)){if(n==null){i.filter=void 0,this._updateLayer(i);return}this._validate(e.validateStyle.filter,`layers.`+i.id+`.filter`,n,null,r)||(i.filter=e.clone$1(n),this._updateLayer(i))}},n.prototype.getFilter=function(t){return e.clone$1(this.getLayer(t).filter)},n.prototype.setLayoutProperty=function(t,n,r,i){i===void 0&&(i={}),this._checkLoaded();var a=this.getLayer(t);if(!a){this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style and cannot be styled.`)));return}e.deepEqual(a.getLayoutProperty(n),r)||(a.setLayoutProperty(n,r,i),this._updateLayer(a))},n.prototype.getLayoutProperty=function(t,n){var r=this.getLayer(t);if(!r){this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style.`)));return}return r.getLayoutProperty(n)},n.prototype.setPaintProperty=function(t,n,r,i){i===void 0&&(i={}),this._checkLoaded();var a=this.getLayer(t);if(!a){this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style and cannot be styled.`)));return}e.deepEqual(a.getPaintProperty(n),r)||(a.setPaintProperty(n,r,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0)},n.prototype.getPaintProperty=function(e,t){return this.getLayer(e).getPaintProperty(t)},n.prototype.setFeatureState=function(t,n){this._checkLoaded();var r=t.source,i=t.sourceLayer,a=this.sourceCaches[r];if(a===void 0){this.fire(new e.ErrorEvent(Error(`The source '`+r+`' does not exist in the map's style.`)));return}var o=a.getSource().type;if(o===`geojson`&&i){this.fire(new e.ErrorEvent(Error(`GeoJSON sources cannot have a sourceLayer parameter.`)));return}if(o===`vector`&&!i){this.fire(new e.ErrorEvent(Error(`The sourceLayer parameter must be provided for vector source types.`)));return}t.id===void 0&&this.fire(new e.ErrorEvent(Error(`The feature id parameter must be provided.`))),a.setFeatureState(i,t.id,n)},n.prototype.removeFeatureState=function(t,n){this._checkLoaded();var r=t.source,i=this.sourceCaches[r];if(i===void 0){this.fire(new e.ErrorEvent(Error(`The source '`+r+`' does not exist in the map's style.`)));return}var a=i.getSource().type,o=a===`vector`?t.sourceLayer:void 0;if(a===`vector`&&!o){this.fire(new e.ErrorEvent(Error(`The sourceLayer parameter must be provided for vector source types.`)));return}if(n&&typeof t.id!=`string`&&typeof t.id!=`number`){this.fire(new e.ErrorEvent(Error(`A feature id is required to remove its specific state property.`)));return}i.removeFeatureState(o,t.id,n)},n.prototype.getFeatureState=function(t){this._checkLoaded();var n=t.source,r=t.sourceLayer,i=this.sourceCaches[n];if(i===void 0){this.fire(new e.ErrorEvent(Error(`The source '`+n+`' does not exist in the map's style.`)));return}if(i.getSource().type===`vector`&&!r){this.fire(new e.ErrorEvent(Error(`The sourceLayer parameter must be provided for vector source types.`)));return}return t.id===void 0&&this.fire(new e.ErrorEvent(Error(`The feature id parameter must be provided.`))),i.getFeatureState(r,t.id)},n.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},n.prototype.serialize=function(){return e.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:e.mapObject(this.sourceCaches,function(e){return e.serialize()}),layers:this._serializeLayers(this._order)},function(e){return e!==void 0})},n.prototype._updateLayer=function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.sourceCaches[e.source].getSource().type!==`raster`&&(this._updatedSources[e.source]=`reload`,this.sourceCaches[e.source].pause()),this._changed=!0},n.prototype._flattenAndSortRenderedFeatures=function(e){for(var t=this,n=function(e){return t._layers[e].type===`fill-extrusion`},r={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(n(o)){r[o]=a;for(var s=0,c=e;s<c.length;s+=1){var l=c[s][o];if(l)for(var u=0,d=l;u<d.length;u+=1){var f=d[u];i.push(f)}}}}i.sort(function(e,t){return t.intersectionZ-e.intersectionZ});for(var p=[],m=this._order.length-1;m>=0;m--){var h=this._order[m];if(n(h))for(var g=i.length-1;g>=0;g--){var _=i[g].feature;if(r[_.layer.id]<m)break;p.push(_),i.pop()}else for(var v=0,y=e;v<y.length;v+=1){var b=y[v][h];if(b)for(var x=0,S=b;x<S.length;x+=1){var C=S[x];p.push(C.feature)}}}return p},n.prototype.queryRenderedFeatures=function(t,n,r){n&&n.filter&&this._validate(e.validateStyle.filter,`queryRenderedFeatures.filter`,n.filter,null,n);var i={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new e.ErrorEvent(Error(`parameters.layers must be an Array.`))),[];for(var a=0,o=n.layers;a<o.length;a+=1){var s=o[a],c=this._layers[s];if(!c)return this.fire(new e.ErrorEvent(Error(`The layer '`+s+`' does not exist in the map's style and cannot be queried for features.`))),[];i[c.source]=!0}}var l=[];for(var u in n.availableImages=this._availableImages,this.sourceCaches)n.layers&&!i[u]||l.push(K(this.sourceCaches[u],this._layers,this._serializedLayers,t,n,r));return this.placement&&l.push(q(this._layers,this._serializedLayers,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(l)},n.prototype.querySourceFeatures=function(t,n){n&&n.filter&&this._validate(e.validateStyle.filter,`querySourceFeatures.filter`,n.filter,null,n);var r=this.sourceCaches[t];return r?J(r,n):[]},n.prototype.addSourceType=function(e,t,r){if(n.getSourceType(e))return r(Error(`A source type called "`+e+`" already exists.`));if(n.setSourceType(e,t),!t.workerSourceURL)return r(null,null);this.dispatcher.broadcast(`loadWorkerSource`,{name:e,url:t.workerSourceURL},r)},n.prototype.getLight=function(){return this.light.getLight()},n.prototype.setLight=function(t,n){n===void 0&&(n={}),this._checkLoaded();var r=this.light.getLight(),i=!1;for(var a in t)if(!e.deepEqual(t[a],r[a])){i=!0;break}if(i){var o={now:e.browser.now(),transition:e.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,n),this.light.updateTransitions(o)}},n.prototype._validate=function(t,n,r,i,a){return a===void 0&&(a={}),a&&a.validate===!1?!1:pn(this,t.call(e.validateStyle,e.extend({key:n,style:this.serialize(),value:r,styleSpec:e.styleSpec},i)))},n.prototype._remove=function(){for(var t in this._request&&=(this._request.cancel(),null),this._spriteRequest&&=(this._spriteRequest.cancel(),null),e.evented.off(`pluginStateChange`,this._rtlTextPluginCallback),this._layers)this._layers[t].setEventedParent(null);for(var n in this.sourceCaches)this.sourceCaches[n].clearTiles(),this.sourceCaches[n].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},n.prototype._clearSource=function(e){this.sourceCaches[e].clearTiles()},n.prototype._reloadSource=function(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()},n.prototype._updateSources=function(e){for(var t in this.sourceCaches)this.sourceCaches[t].update(e)},n.prototype._generateCollisionBoxes=function(){for(var e in this.sourceCaches)this._reloadSource(e)},n.prototype._updatePlacement=function(t,n,r,i,a){a===void 0&&(a=!1);for(var o=!1,s=!1,c={},l=0,u=this._order;l<u.length;l+=1){var d=u[l],f=this._layers[d];if(f.type===`symbol`){if(!c[f.source]){var p=this.sourceCaches[f.source];c[f.source]=p.getRenderableIds(!0).map(function(e){return p.getTileByID(e)}).sort(function(e,t){return t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)})}var m=this.crossTileSymbolIndex.addLayer(f,c[f.source],t.center.lng);o||=m}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),a=a||this._layerOrderChanged||r===0,(a||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.browser.now(),t.zoom))&&(this.pauseablePlacement=new sn(t,this._order,a,n,r,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,c),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.browser.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(var h=0,g=this._order;h<g.length;h+=1){var _=g[h],v=this._layers[_];v.type===`symbol`&&this.placement.updateLayerOpacities(v,c[v.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.browser.now())},n.prototype._releaseSymbolFadeTiles=function(){for(var e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()},n.prototype.getImages=function(e,t,n){this.imageManager.getImages(t.icons,n),this._updateTilesForChangedImages();var r=this.sourceCaches[t.source];r&&r.setDependencies(t.tileID.key,t.type,t.icons)},n.prototype.getGlyphs=function(e,t,n){this.glyphManager.getGlyphs(t.stacks,n)},n.prototype.getResource=function(t,n,r){return e.makeRequest(n,r)},n}(e.Evented);_n.getSourceType=H,_n.setSourceType=U,_n.registerForPluginStateChange=e.registerForPluginStateChange;var vn=e.createLayout([{name:`a_pos`,type:`Int16`,components:2}]),yn=`#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`,bn=`#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;}`,xn=`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
}`,Sn=`attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}`,Cn=`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
}`,wn=`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);}`,Tn=`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
}`,En=`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);}`,Dn=`void main() {gl_FragColor=vec4(1.0);}`,On=`attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}`,kn=`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
}`,An=`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;}`,jn=`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
}`,Mn=`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;}`,Nn=`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;}}`,Pn=`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;}`,Fn=`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;}`,In=`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);}`,Ln=`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);}`,Rn=`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);}`,zn=`#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
}`,Bn=`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);}`,Vn=`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
}`,Hn=`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;}`,Un=`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
}`,Wn=`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;}`,Gn=`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
}`,Kn=`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);}`,qn=`varying vec4 v_color;void main() {gl_FragColor=v_color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,Jn=`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;}`,Yn=`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
}`,Xn=`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;}`,Zn=`#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
}`,Qn=`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;}`,$n=`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
}`,er=`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;}`,tr=`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
}`,nr=`
#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);}`,rr=`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
}`,ir=`
#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);}`,ar=`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
}`,or=`
#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;}`,sr=`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
}`,cr=`
#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);}`,lr=`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
}`,ur=`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;}`,dr=`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
}`,fr=`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));}`,pr=`#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
}`,mr=`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);}`,hr=`#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
}`,gr=`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);}`,_r=Ur(yn,bn),vr=Ur(xn,Sn),yr=Ur(Cn,wn),br=Ur(Tn,En),xr=Ur(Dn,On),Sr=Ur(kn,An),Cr=Ur(jn,Mn),wr=Ur(Nn,Pn),Tr=Ur(Fn,In),Er=Ur(Ln,Rn),Dr=Ur(zn,Bn),Or=Ur(Vn,Hn),kr=Ur(Un,Wn),Ar=Ur(Gn,Kn),jr=Ur(qn,Jn),Mr=Ur(Yn,Xn),Nr=Ur(Zn,Qn),Pr=Ur($n,er),Fr=Ur(tr,nr),Ir=Ur(rr,ir),Lr=Ur(ar,or),Rr=Ur(sr,cr),zr=Ur(lr,ur),Br=Ur(dr,fr),Vr=Ur(pr,mr),Hr=Ur(hr,gr);function Ur(e,t){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=t.match(/attribute ([\w]+) ([\w]+)/g),i=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return e=e.replace(n,function(e,t,n,r,i){return s[i]=!0,t===`define`?`
#ifndef HAS_UNIFORM_u_`+i+`
varying `+n+` `+r+` `+i+`;
#else
uniform `+n+` `+r+` u_`+i+`;
#endif
`:`
#ifdef HAS_UNIFORM_u_`+i+`
`+n+` `+r+` `+i+` = u_`+i+`;
#endif
`}),t=t.replace(n,function(e,t,n,r,i){var a=r===`float`?`vec2`:`vec4`,o=i.match(/color/)?`color`:a;return s[i]?t===`define`?`
#ifndef HAS_UNIFORM_u_`+i+`
uniform lowp float u_`+i+`_t;
attribute `+n+` `+a+` a_`+i+`;
varying `+n+` `+r+` `+i+`;
#else
uniform `+n+` `+r+` u_`+i+`;
#endif
`:o===`vec4`?`
#ifndef HAS_UNIFORM_u_`+i+`
`+i+` = a_`+i+`;
#else
`+n+` `+r+` `+i+` = u_`+i+`;
#endif
`:`
#ifndef HAS_UNIFORM_u_`+i+`
`+i+` = unpack_mix_`+o+`(a_`+i+`, u_`+i+`_t);
#else
`+n+` `+r+` `+i+` = u_`+i+`;
#endif
`:t===`define`?`
#ifndef HAS_UNIFORM_u_`+i+`
uniform lowp float u_`+i+`_t;
attribute `+n+` `+a+` a_`+i+`;
#else
uniform `+n+` `+r+` u_`+i+`;
#endif
`:o===`vec4`?`
#ifndef HAS_UNIFORM_u_`+i+`
`+n+` `+r+` `+i+` = a_`+i+`;
#else
`+n+` `+r+` `+i+` = u_`+i+`;
#endif
`:`
#ifndef HAS_UNIFORM_u_`+i+`
`+n+` `+r+` `+i+` = unpack_mix_`+o+`(a_`+i+`, u_`+i+`_t);
#else
`+n+` `+r+` `+i+` = u_`+i+`;
#endif
`}),{fragmentSource:e,vertexSource:t,staticAttributes:r,staticUniforms:o}}var Wr=Object.freeze({__proto__:null,prelude:_r,background:vr,backgroundPattern:yr,circle:br,clippingMask:xr,heatmap:Sr,heatmapTexture:Cr,collisionBox:wr,collisionCircle:Tr,debug:Er,fill:Dr,fillOutline:Or,fillOutlinePattern:kr,fillPattern:Ar,fillExtrusion:jr,fillExtrusionPattern:Mr,hillshadePrepare:Nr,hillshade:Pr,line:Fr,lineGradient:Ir,linePattern:Lr,lineSDF:Rr,raster:zr,symbolIcon:Br,symbolSDF:Vr,symbolTextAndIcon:Hr}),Gr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Gr.prototype.bind=function(e,t,n,r,i,a,o,s){this.context=e;for(var c=this.boundPaintVertexBuffers.length!==r.length,l=0;!c&&l<r.length;l++)this.boundPaintVertexBuffers[l]!==r[l]&&(c=!0);var u=!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==n||c||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s;!e.extVertexArrayObject||u?this.freshBind(t,n,r,i,a,o,s):(e.bindVertexArrayOES.set(this.vao),o&&o.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind())},Gr.prototype.freshBind=function(e,t,n,r,i,a,o){var s,c=e.numAttributes,l=this.context,u=l.gl;if(l.extVertexArrayObject)this.vao&&this.destroy(),this.vao=l.extVertexArrayObject.createVertexArrayOES(),l.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=r,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o;else{s=l.currentNumAttributes||0;for(var d=c;d<s;d++)u.disableVertexAttribArray(d)}t.enableAttributes(u,e);for(var f=0,p=n;f<p.length;f+=1)p[f].enableAttributes(u,e);a&&a.enableAttributes(u,e),o&&o.enableAttributes(u,e),t.bind(),t.setVertexAttribPointers(u,e,i);for(var m=0,h=n;m<h.length;m+=1){var g=h[m];g.bind(),g.setVertexAttribPointers(u,e,i)}a&&(a.bind(),a.setVertexAttribPointers(u,e,i)),r&&r.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,e,i)),l.currentNumAttributes=c},Gr.prototype.destroy=function(){this.vao&&=(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),null)};function Kr(e){for(var t=[],n=0;n<e.length;n++)if(e[n]!==null){var r=e[n].split(` `);t.push(r.pop())}return t}var qr=function(e,t,n,r,i,a){var o=e.gl;this.program=o.createProgram();for(var s=Kr(n.staticAttributes),c=r?r.getBinderAttributes():[],l=s.concat(c),u=n.staticUniforms?Kr(n.staticUniforms):[],d=r?r.getBinderUniforms():[],f=u.concat(d),p=[],m=0,h=f;m<h.length;m+=1){var g=h[m];p.indexOf(g)<0&&p.push(g)}var _=r?r.defines():[];a&&_.push(`#define OVERDRAW_INSPECTOR;`);var v=_.concat(_r.fragmentSource,n.fragmentSource).join(`
`),y=_.concat(_r.vertexSource,n.vertexSource).join(`
`),b=o.createShader(o.FRAGMENT_SHADER);if(o.isContextLost()){this.failedToCreate=!0;return}o.shaderSource(b,v),o.compileShader(b),o.attachShader(this.program,b);var x=o.createShader(o.VERTEX_SHADER);if(o.isContextLost()){this.failedToCreate=!0;return}o.shaderSource(x,y),o.compileShader(x),o.attachShader(this.program,x),this.attributes={};var S={};this.numAttributes=l.length;for(var C=0;C<this.numAttributes;C++)l[C]&&(o.bindAttribLocation(this.program,C,l[C]),this.attributes[l[C]]=C);o.linkProgram(this.program),o.deleteShader(x),o.deleteShader(b);for(var w=0;w<p.length;w++){var T=p[w];if(T&&!S[T]){var E=o.getUniformLocation(this.program,T);E&&(S[T]=E)}}this.fixedUniforms=i(e,S),this.binderUniforms=r?r.getUniforms(e,S):[]};qr.prototype.draw=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g,_=e.gl;if(!this.failedToCreate){for(var v in e.program.set(this.program),e.setDepthMode(n),e.setStencilMode(r),e.setColorMode(i),e.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);p&&p.setUniforms(e,this.binderUniforms,d,{zoom:f});for(var y=(g={},g[_.LINES]=2,g[_.TRIANGLES]=3,g[_.LINE_STRIP]=1,g)[t],b=0,x=u.get();b<x.length;b+=1){var S=x[b],C=S.vaos||={};(C[s]||(C[s]=new Gr)).bind(e,this,c,p?p.getPaintVertexBuffers():[],l,S.vertexOffset,m,h),_.drawElements(t,S.primitiveLength*y,_.UNSIGNED_SHORT,S.primitiveOffset*y*2)}}};function Jr(e,t,n){var r=1/zt(n,1,t.transform.tileZoom),i=2**n.tileID.overscaledZ,a=n.tileSize*2**t.transform.tileZoom/i,o=a*(n.tileID.canonical.x+n.tileID.wrap*i),s=a*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[r,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[o&65535,s&65535]}}function Yr(e,t,n,r){var i=n.imageManager.getPattern(e.from.toString()),a=n.imageManager.getPattern(e.to.toString()),o=n.imageManager.getPixelSize(),s=o.width,c=o.height,l=2**r.tileID.overscaledZ,u=r.tileSize*2**n.transform.tileZoom/l,d=u*(r.tileID.canonical.x+r.tileID.wrap*l),f=u*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,c],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/zt(r,1,n.transform.tileZoom),u_pixel_coord_upper:[d>>16,f>>16],u_pixel_coord_lower:[d&65535,f&65535]}}var Xr=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_lightpos:new e.Uniform3f(t,n.u_lightpos),u_lightintensity:new e.Uniform1f(t,n.u_lightintensity),u_lightcolor:new e.Uniform3f(t,n.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,n.u_vertical_gradient),u_opacity:new e.Uniform1f(t,n.u_opacity)}},Zr=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_lightpos:new e.Uniform3f(t,n.u_lightpos),u_lightintensity:new e.Uniform1f(t,n.u_lightintensity),u_lightcolor:new e.Uniform3f(t,n.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,n.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,n.u_height_factor),u_image:new e.Uniform1i(t,n.u_image),u_texsize:new e.Uniform2f(t,n.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade),u_opacity:new e.Uniform1f(t,n.u_opacity)}},Qr=function(t,n,r,i){var a=n.style.light,o=a.properties.get(`position`),s=[o.x,o.y,o.z],c=e.create$1();a.properties.get(`anchor`)===`viewport`&&e.fromRotation(c,-n.transform.angle),e.transformMat3(s,s,c);var l=a.properties.get(`color`);return{u_matrix:t,u_lightpos:s,u_lightintensity:a.properties.get(`intensity`),u_lightcolor:[l.r,l.g,l.b],u_vertical_gradient:+r,u_opacity:i}},$r=function(t,n,r,i,a,o,s){return e.extend(Qr(t,n,r,i),Jr(o,n,s),{u_height_factor:-(2**a.overscaledZ)/s.tileSize/8})},ei=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}},ti=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_image:new e.Uniform1i(t,n.u_image),u_texsize:new e.Uniform2f(t,n.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade)}},ni=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_world:new e.Uniform2f(t,n.u_world)}},ri=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_world:new e.Uniform2f(t,n.u_world),u_image:new e.Uniform1i(t,n.u_image),u_texsize:new e.Uniform2f(t,n.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade)}},ii=function(e){return{u_matrix:e}},ai=function(t,n,r,i){return e.extend(ii(t),Jr(r,n,i))},oi=function(e,t){return{u_matrix:e,u_world:t}},si=function(t,n,r,i,a){return e.extend(ai(t,n,r,i),{u_world:a})},ci=function(t,n){return{u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,n.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,n.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}},li=function(t,n,r,i){var a=t.transform,o,s;if(i.paint.get(`circle-pitch-alignment`)===`map`){var c=zt(r,1,a.zoom);o=!0,s=[c,c]}else o=!1,s=a.pixelsToGLUnits;return{u_camera_to_center_distance:a.cameraToCenterDistance,u_scale_with_map:+(i.paint.get(`circle-pitch-scale`)===`map`),u_matrix:t.translatePosMatrix(n.posMatrix,r,i.paint.get(`circle-translate`),i.paint.get(`circle-translate-anchor`)),u_pitch_with_map:+o,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:s}},ui=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(t,n.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(t,n.u_extrude_scale),u_overscale_factor:new e.Uniform1f(t,n.u_overscale_factor)}},di=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_inv_matrix:new e.UniformMatrix4f(t,n.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(t,n.u_viewport_size)}},fi=function(e,t,n){var r=zt(n,1,t.zoom),i=2**(t.zoom-n.tileID.overscaledZ),a=n.tileID.overscaleFactor();return{u_matrix:e,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:r,u_extrude_scale:[t.pixelsToGLUnits[0]/(r*i),t.pixelsToGLUnits[1]/(r*i)],u_overscale_factor:a}},pi=function(e,t,n){return{u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}},mi=function(t,n){return{u_color:new e.UniformColor(t,n.u_color),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_overlay:new e.Uniform1i(t,n.u_overlay),u_overlay_scale:new e.Uniform1f(t,n.u_overlay_scale)}},hi=function(e,t,n){return n===void 0&&(n=1),{u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:n}},gi=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}},_i=function(e){return{u_matrix:e}},vi=function(t,n){return{u_extrude_scale:new e.Uniform1f(t,n.u_extrude_scale),u_intensity:new e.Uniform1f(t,n.u_intensity),u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}},yi=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_world:new e.Uniform2f(t,n.u_world),u_image:new e.Uniform1i(t,n.u_image),u_color_ramp:new e.Uniform1i(t,n.u_color_ramp),u_opacity:new e.Uniform1f(t,n.u_opacity)}},bi=function(e,t,n,r){return{u_matrix:e,u_extrude_scale:zt(t,1,n),u_intensity:r}},xi=function(t,n,r,i){var a=e.create();e.ortho(a,0,t.width,t.height,0,0,1);var o=t.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:r,u_color_ramp:i,u_opacity:n.paint.get(`heatmap-opacity`)}},Si=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_image:new e.Uniform1i(t,n.u_image),u_latrange:new e.Uniform2f(t,n.u_latrange),u_light:new e.Uniform2f(t,n.u_light),u_shadow:new e.UniformColor(t,n.u_shadow),u_highlight:new e.UniformColor(t,n.u_highlight),u_accent:new e.UniformColor(t,n.u_accent)}},Ci=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_image:new e.Uniform1i(t,n.u_image),u_dimension:new e.Uniform2f(t,n.u_dimension),u_zoom:new e.Uniform1f(t,n.u_zoom),u_unpack:new e.Uniform4f(t,n.u_unpack)}},wi=function(e,t,n){var r=n.paint.get(`hillshade-shadow-color`),i=n.paint.get(`hillshade-highlight-color`),a=n.paint.get(`hillshade-accent-color`),o=n.paint.get(`hillshade-illumination-direction`)*(Math.PI/180);n.paint.get(`hillshade-illumination-anchor`)===`viewport`&&(o-=e.transform.angle);var s=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped(),s),u_image:0,u_latrange:Ei(e,t.tileID),u_light:[n.paint.get(`hillshade-exaggeration`),o],u_shadow:r,u_highlight:i,u_accent:a}},Ti=function(t,n){var r=n.stride,i=e.create();return e.ortho(i,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(i,i,[0,-e.EXTENT,0]),{u_matrix:i,u_image:1,u_dimension:[r,r],u_zoom:t.overscaledZ,u_unpack:n.getUnpackVector()}};function Ei(t,n){var r=2**n.canonical.z,i=n.canonical.y;return[new e.MercatorCoordinate(0,i/r).toLngLat().lat,new e.MercatorCoordinate(0,(i+1)/r).toLngLat().lat]}var Di=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_ratio:new e.Uniform1f(t,n.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,n.u_units_to_pixels)}},Oi=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_ratio:new e.Uniform1f(t,n.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,n.u_units_to_pixels),u_image:new e.Uniform1i(t,n.u_image),u_image_height:new e.Uniform1f(t,n.u_image_height)}},ki=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_texsize:new e.Uniform2f(t,n.u_texsize),u_ratio:new e.Uniform1f(t,n.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_image:new e.Uniform1i(t,n.u_image),u_units_to_pixels:new e.Uniform2f(t,n.u_units_to_pixels),u_scale:new e.Uniform3f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade)}},Ai=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_ratio:new e.Uniform1f(t,n.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,n.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,n.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,n.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,n.u_sdfgamma),u_image:new e.Uniform1i(t,n.u_image),u_tex_y_a:new e.Uniform1f(t,n.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,n.u_tex_y_b),u_mix:new e.Uniform1f(t,n.u_mix)}},ji=function(t,n,r){var i=t.transform;return{u_matrix:Ii(t,n,r),u_ratio:1/zt(n,1,i.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Mi=function(t,n,r,i){return e.extend(ji(t,n,r),{u_image:0,u_image_height:i})},Ni=function(t,n,r,i){var a=t.transform,o=Fi(n,a);return{u_matrix:Ii(t,n,r),u_texsize:n.imageAtlasTexture.size,u_ratio:1/zt(n,1,a.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Pi=function(t,n,r,i,a){var o=t.transform,s=t.lineAtlas,c=Fi(n,o),l=r.layout.get(`line-cap`)===`round`,u=s.getDash(i.from,l),d=s.getDash(i.to,l),f=u.width*a.fromScale,p=d.width*a.toScale;return e.extend(ji(t,n,r),{u_patternscale_a:[c/f,-u.height/2],u_patternscale_b:[c/p,-d.height/2],u_sdfgamma:s.width/(Math.min(f,p)*256*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:d.y,u_mix:a.t})};function Fi(e,t){return 1/zt(e,1,t.tileZoom)}function Ii(e,t,n){return e.translatePosMatrix(t.tileID.posMatrix,t,n.paint.get(`line-translate`),n.paint.get(`line-translate-anchor`))}var Li=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_tl_parent:new e.Uniform2f(t,n.u_tl_parent),u_scale_parent:new e.Uniform1f(t,n.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,n.u_buffer_scale),u_fade_t:new e.Uniform1f(t,n.u_fade_t),u_opacity:new e.Uniform1f(t,n.u_opacity),u_image0:new e.Uniform1i(t,n.u_image0),u_image1:new e.Uniform1i(t,n.u_image1),u_brightness_low:new e.Uniform1f(t,n.u_brightness_low),u_brightness_high:new e.Uniform1f(t,n.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,n.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,n.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,n.u_spin_weights)}},Ri=function(e,t,n,r,i){return{u_matrix:e,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*i.paint.get(`raster-opacity`),u_image0:0,u_image1:1,u_brightness_low:i.paint.get(`raster-brightness-min`),u_brightness_high:i.paint.get(`raster-brightness-max`),u_saturation_factor:Vi(i.paint.get(`raster-saturation`)),u_contrast_factor:Bi(i.paint.get(`raster-contrast`)),u_spin_weights:zi(i.paint.get(`raster-hue-rotate`))}};function zi(e){e*=Math.PI/180;var t=Math.sin(e),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}function Bi(e){return e>0?1/(1-e):1+e}function Vi(e){return e>0?1-1/(1.001-e):-e}var Hi=function(t,n){return{u_is_size_zoom_constant:new e.Uniform1i(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,n.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,n.u_size_t),u_size:new e.Uniform1f(t,n.u_size),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,n.u_pitch),u_rotate_symbol:new e.Uniform1i(t,n.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,n.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,n.u_fade_change),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,n.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,n.u_coord_matrix),u_is_text:new e.Uniform1i(t,n.u_is_text),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_texsize:new e.Uniform2f(t,n.u_texsize),u_texture:new e.Uniform1i(t,n.u_texture)}},Ui=function(t,n){return{u_is_size_zoom_constant:new e.Uniform1i(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,n.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,n.u_size_t),u_size:new e.Uniform1f(t,n.u_size),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,n.u_pitch),u_rotate_symbol:new e.Uniform1i(t,n.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,n.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,n.u_fade_change),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,n.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,n.u_coord_matrix),u_is_text:new e.Uniform1i(t,n.u_is_text),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_texsize:new e.Uniform2f(t,n.u_texsize),u_texture:new e.Uniform1i(t,n.u_texture),u_gamma_scale:new e.Uniform1f(t,n.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,n.u_is_halo)}},Wi=function(t,n){return{u_is_size_zoom_constant:new e.Uniform1i(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,n.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,n.u_size_t),u_size:new e.Uniform1f(t,n.u_size),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,n.u_pitch),u_rotate_symbol:new e.Uniform1i(t,n.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,n.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,n.u_fade_change),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,n.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,n.u_coord_matrix),u_is_text:new e.Uniform1i(t,n.u_is_text),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_texsize:new e.Uniform2f(t,n.u_texsize),u_texsize_icon:new e.Uniform2f(t,n.u_texsize_icon),u_texture:new e.Uniform1i(t,n.u_texture),u_texture_icon:new e.Uniform1i(t,n.u_texture_icon),u_gamma_scale:new e.Uniform1f(t,n.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,n.u_is_halo)}},Gi=function(e,t,n,r,i,a,o,s,c,l){var u=i.transform;return{u_is_size_zoom_constant:+(e===`constant`||e===`source`),u_is_size_feature_constant:+(e===`constant`||e===`camera`),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:u.width/u.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+c,u_pitch_with_map:+r,u_texsize:l,u_texture:0}},Ki=function(t,n,r,i,a,o,s,c,l,u,d){var f=a.transform;return e.extend(Gi(t,n,r,i,a,o,s,c,l,u),{u_gamma_scale:i?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+d})},qi=function(t,n,r,i,a,o,s,c,l,u){return e.extend(Ki(t,n,r,i,a,o,s,c,!0,l,!0),{u_texsize_icon:u,u_texture_icon:1})},Ji=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_opacity:new e.Uniform1f(t,n.u_opacity),u_color:new e.UniformColor(t,n.u_color)}},Yi=function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_opacity:new e.Uniform1f(t,n.u_opacity),u_image:new e.Uniform1i(t,n.u_image),u_pattern_tl_a:new e.Uniform2f(t,n.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,n.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,n.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,n.u_pattern_br_b),u_texsize:new e.Uniform2f(t,n.u_texsize),u_mix:new e.Uniform1f(t,n.u_mix),u_pattern_size_a:new e.Uniform2f(t,n.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,n.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,n.u_scale_a),u_scale_b:new e.Uniform1f(t,n.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,n.u_tile_units_to_pixels)}},Xi=function(e,t,n){return{u_matrix:e,u_opacity:t,u_color:n}},Zi=function(t,n,r,i,a,o){return e.extend(Yr(i,o,r,a),{u_matrix:t,u_opacity:n})},Qi={fillExtrusion:Xr,fillExtrusionPattern:Zr,fill:ei,fillPattern:ti,fillOutline:ni,fillOutlinePattern:ri,circle:ci,collisionBox:ui,collisionCircle:di,debug:mi,clippingMask:gi,heatmap:vi,heatmapTexture:yi,hillshade:Si,hillshadePrepare:Ci,line:Di,lineGradient:Oi,linePattern:ki,lineSDF:Ai,raster:Li,symbolIcon:Hi,symbolSDF:Ui,symbolTextAndIcon:Wi,background:Ji,backgroundPattern:Yi},$i;function ea(t,n,r,i,a,o,s){for(var c=t.context,l=c.gl,u=t.useProgram(`collisionBox`),d=[],f=0,p=0,m=0;m<i.length;m++){var h=i[m],g=n.getTile(h),_=g.getBucket(r);if(_){var v=h.posMatrix;(a[0]!==0||a[1]!==0)&&(v=t.translatePosMatrix(h.posMatrix,g,a,o));var y=s?_.textCollisionBox:_.iconCollisionBox,b=_.collisionCircleArray;if(b.length>0){var x=e.create(),S=v;e.mul(x,_.placementInvProjMatrix,t.transform.glCoordMatrix),e.mul(x,x,_.placementViewportMatrix),d.push({circleArray:b,circleOffset:p,transform:S,invTransform:x}),f+=b.length/4,p=f}y&&u.draw(c,l.LINES,ze.disabled,He.disabled,t.colorModeForRenderPass(),Ye.disabled,fi(v,t.transform,g),r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,t.transform.zoom,null,null,y.collisionVertexBuffer)}}if(!(!s||!d.length)){var C=t.useProgram(`collisionCircle`),w=new e.StructArrayLayout2f1f2i16;w.resize(f*4),w._trim();for(var T=0,E=0,D=d;E<D.length;E+=1)for(var O=D[E],k=0;k<O.circleArray.length/4;k++){var A=k*4,j=O.circleArray[A+0],M=O.circleArray[A+1],N=O.circleArray[A+2],P=O.circleArray[A+3];w.emplace(T++,j,M,N,P,0),w.emplace(T++,j,M,N,P,1),w.emplace(T++,j,M,N,P,2),w.emplace(T++,j,M,N,P,3)}(!$i||$i.length<f*2)&&($i=ta(f));for(var F=c.createIndexBuffer($i,!0),I=c.createVertexBuffer(w,e.collisionCircleLayout.members,!0),L=0,R=d;L<R.length;L+=1){var z=R[L],B=pi(z.transform,z.invTransform,t.transform);C.draw(c,l.TRIANGLES,ze.disabled,He.disabled,t.colorModeForRenderPass(),Ye.disabled,B,r.id,I,F,e.SegmentVector.simpleSegment(0,z.circleOffset*2,z.circleArray.length,z.circleArray.length/2),null,t.transform.zoom,null,null,null)}I.destroy(),F.destroy()}}function ta(t){var n=t*2,r=new e.StructArrayLayout3ui6;r.resize(n),r._trim();for(var i=0;i<n;i++){var a=i*6;r.uint16[a+0]=i*4+0,r.uint16[a+1]=i*4+1,r.uint16[a+2]=i*4+2,r.uint16[a+3]=i*4+2,r.uint16[a+4]=i*4+3,r.uint16[a+5]=i*4+0}return r}var na=e.identity(new Float32Array(16));function ra(e,t,n,r,i){if(e.renderPass===`translucent`){var a=He.disabled,o=e.colorModeForRenderPass();n.layout.get(`text-variable-anchor`)&&aa(r,e,n,t,n.layout.get(`text-rotation-alignment`),n.layout.get(`text-pitch-alignment`),i),n.paint.get(`icon-opacity`).constantOr(1)!==0&&ca(e,t,n,r,!1,n.paint.get(`icon-translate`),n.paint.get(`icon-translate-anchor`),n.layout.get(`icon-rotation-alignment`),n.layout.get(`icon-pitch-alignment`),n.layout.get(`icon-keep-upright`),a,o),n.paint.get(`text-opacity`).constantOr(1)!==0&&ca(e,t,n,r,!0,n.paint.get(`text-translate`),n.paint.get(`text-translate-anchor`),n.layout.get(`text-rotation-alignment`),n.layout.get(`text-pitch-alignment`),n.layout.get(`text-keep-upright`),a,o),t.map.showCollisionBoxes&&(ea(e,t,n,r,n.paint.get(`text-translate`),n.paint.get(`text-translate-anchor`),!0),ea(e,t,n,r,n.paint.get(`icon-translate`),n.paint.get(`icon-translate-anchor`),!1))}}function ia(t,n,r,i,a,o){var s=e.getAnchorAlignment(t),c=s.horizontalAlign,l=s.verticalAlign,u=-(c-.5)*n,d=-(l-.5)*r,f=e.evaluateVariableOffset(t,i);return new e.Point((u/a+f[0])*o,(d/a+f[1])*o)}function aa(t,n,r,i,a,o,s){for(var c=n.transform,l=a===`map`,u=o===`map`,d=0,f=t;d<f.length;d+=1){var p=f[d],m=i.getTile(p),h=m.getBucket(r);if(!(!h||!h.text||!h.text.segments.get().length)){var g=h.textSizeData,_=e.evaluateSizeForZoom(g,c.zoom),v=zt(m,1,n.transform.zoom),y=Ct(p.posMatrix,u,l,n.transform,v),b=r.layout.get(`icon-text-fit`)!==`none`&&h.hasIconData();if(_){var x=2**(c.zoom-m.tileID.overscaledZ);oa(h,l,u,s,e.symbolSize,c,y,p.posMatrix,x,_,b)}}}}function oa(t,n,r,i,a,o,s,c,l,u,d){var f=t.text.placedSymbolArray,p=t.text.dynamicLayoutVertexArray,m=t.icon.dynamicLayoutVertexArray,h={};p.clear();for(var g=0;g<f.length;g++){var _=f.get(g),v=t.allowVerticalPlacement&&!_.placedOrientation,y=!_.hidden&&_.crossTileID&&!v?i[_.crossTileID]:null;if(!y)Ft(_.numGlyphs,p);else{var b=new e.Point(_.anchorX,_.anchorY),x=Tt(b,r?c:s),S=Et(o.cameraToCenterDistance,x.signedDistanceFromCamera),C=a.evaluateSizeForFeature(t.textSizeData,u,_)*S/e.ONE_EM;r&&(C*=t.tilePixelRatio/l);for(var w=y.width,T=y.height,E=y.anchor,D=y.textOffset,O=y.textBoxScale,k=ia(E,w,T,D,O,C),A=r?Tt(b.add(k),s).point:x.point.add(n?k.rotate(-o.angle):k),j=t.allowVerticalPlacement&&_.placedOrientation===e.WritingMode.vertical?Math.PI/2:0,M=0;M<_.numGlyphs;M++)e.addDynamicAttributes(p,A,j);d&&_.associatedIconIndex>=0&&(h[_.associatedIconIndex]={shiftedAnchor:A,angle:j})}}if(d){m.clear();for(var N=t.icon.placedSymbolArray,P=0;P<N.length;P++){var F=N.get(P);if(F.hidden)Ft(F.numGlyphs,m);else{var I=h[P];if(!I)Ft(F.numGlyphs,m);else for(var L=0;L<F.numGlyphs;L++)e.addDynamicAttributes(m,I.shiftedAnchor,I.angle)}}t.icon.dynamicLayoutVertexBuffer.updateData(m)}t.text.dynamicLayoutVertexBuffer.updateData(p)}function sa(e,t,n){return n.iconsInText&&t?`symbolTextAndIcon`:e?`symbolSDF`:`symbolIcon`}function ca(t,n,r,i,a,o,s,c,l,u,d,f){for(var p=t.context,m=p.gl,h=t.transform,g=c===`map`,_=l===`map`,v=g&&r.layout.get(`symbol-placement`)!==`point`,y=g&&!_&&!v,b=r.layout.get(`symbol-sort-key`).constantOr(1)!==void 0,x=!1,S=t.depthModeForSublayer(0,ze.ReadOnly),C=r.layout.get(`text-variable-anchor`),w=[],T=0,E=i;T<E.length;T+=1){var D=E[T],O=n.getTile(D),k=O.getBucket(r);if(k){var A=a?k.text:k.icon;if(!(!A||!A.segments.get().length)){var j=A.programConfigurations.get(r.id),M=a||k.sdfIcons,N=a?k.textSizeData:k.iconSizeData,P=_||h.pitch!==0,F=t.useProgram(sa(M,a,k),j),I=e.evaluateSizeForZoom(N,h.zoom),L=void 0,R=[0,0],z=void 0,B=void 0,V=null,H=void 0;if(a){if(z=O.glyphAtlasTexture,B=m.LINEAR,L=O.glyphAtlasTexture.size,k.iconsInText){R=O.imageAtlasTexture.size,V=O.imageAtlasTexture;var U=N.kind===`composite`||N.kind===`camera`;H=P||t.options.rotating||t.options.zooming||U?m.LINEAR:m.NEAREST}}else{var W=r.layout.get(`icon-size`).constantOr(0)!==1||k.iconsNeedLinear;z=O.imageAtlasTexture,B=M||t.options.rotating||t.options.zooming||W||P?m.LINEAR:m.NEAREST,L=O.imageAtlasTexture.size}var G=zt(O,1,t.transform.zoom),K=Ct(D.posMatrix,_,g,t.transform,G),q=wt(D.posMatrix,_,g,t.transform,G),J=C&&k.hasTextData(),Y=r.layout.get(`icon-text-fit`)!==`none`&&J&&k.hasIconData();v&&Ot(k,D.posMatrix,t,a,K,q,_,u);var X=t.translatePosMatrix(D.posMatrix,O,o,s),Z=v||a&&C||Y?na:K,Q=t.translatePosMatrix(q,O,o,s,!0),ee=M&&r.paint.get(a?`text-halo-width`:`icon-halo-width`).constantOr(1)!==0,te=void 0;te=M?k.iconsInText?qi(N.kind,I,y,_,t,X,Z,Q,L,R):Ki(N.kind,I,y,_,t,X,Z,Q,a,L,!0):Gi(N.kind,I,y,_,t,X,Z,Q,a,L);var ne={program:F,buffers:A,uniformValues:te,atlasTexture:z,atlasTextureIcon:V,atlasInterpolation:B,atlasInterpolationIcon:H,isSDF:M,hasHalo:ee};if(b&&k.canOverlap){x=!0;for(var re=A.segments.get(),ie=0,ae=re;ie<ae.length;ie+=1){var oe=ae[ie];w.push({segments:new e.SegmentVector([oe]),sortKey:oe.sortKey,state:ne})}}else w.push({segments:A.segments,sortKey:0,state:ne})}}}x&&w.sort(function(e,t){return e.sortKey-t.sortKey});for(var se=0,ce=w;se<ce.length;se+=1){var le=ce[se],ue=le.state;if(p.activeTexture.set(m.TEXTURE0),ue.atlasTexture.bind(ue.atlasInterpolation,m.CLAMP_TO_EDGE),ue.atlasTextureIcon&&(p.activeTexture.set(m.TEXTURE1),ue.atlasTextureIcon&&ue.atlasTextureIcon.bind(ue.atlasInterpolationIcon,m.CLAMP_TO_EDGE)),ue.isSDF){var de=ue.uniformValues;ue.hasHalo&&(de.u_is_halo=1,la(ue.buffers,le.segments,r,t,ue.program,S,d,f,de)),de.u_is_halo=0}la(ue.buffers,le.segments,r,t,ue.program,S,d,f,ue.uniformValues)}}function la(e,t,n,r,i,a,o,s,c){var l=r.context,u=l.gl;i.draw(l,u.TRIANGLES,a,o,s,Ye.disabled,c,n.id,e.layoutVertexBuffer,e.indexBuffer,t,n.paint,r.transform.zoom,e.programConfigurations.get(n.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function ua(t,n,r,i){if(t.renderPass===`translucent`){var a=r.paint.get(`circle-opacity`),o=r.paint.get(`circle-stroke-width`),s=r.paint.get(`circle-stroke-opacity`),c=r.layout.get(`circle-sort-key`).constantOr(1)!==void 0;if(!(a.constantOr(1)===0&&(o.constantOr(1)===0||s.constantOr(1)===0))){for(var l=t.context,u=l.gl,d=t.depthModeForSublayer(0,ze.ReadOnly),f=He.disabled,p=t.colorModeForRenderPass(),m=[],h=0;h<i.length;h++){var g=i[h],_=n.getTile(g),v=_.getBucket(r);if(v){var y=v.programConfigurations.get(r.id),b={programConfiguration:y,program:t.useProgram(`circle`,y),layoutVertexBuffer:v.layoutVertexBuffer,indexBuffer:v.indexBuffer,uniformValues:li(t,g,_,r)};if(c)for(var x=v.segments.get(),S=0,C=x;S<C.length;S+=1){var w=C[S];m.push({segments:new e.SegmentVector([w]),sortKey:w.sortKey,state:b})}else m.push({segments:v.segments,sortKey:0,state:b})}}c&&m.sort(function(e,t){return e.sortKey-t.sortKey});for(var T=0,E=m;T<E.length;T+=1){var D=E[T],O=D.state,k=O.programConfiguration,A=O.program,j=O.layoutVertexBuffer,M=O.indexBuffer,N=O.uniformValues,P=D.segments;A.draw(l,u.TRIANGLES,d,f,p,Ye.disabled,N,r.id,j,M,P,r.paint,t.transform.zoom,k)}}}}function da(t,n,r,i){if(r.paint.get(`heatmap-opacity`)!==0)if(t.renderPass===`offscreen`){var a=t.context,o=a.gl,s=He.disabled,c=new Ke([o.ONE,o.ONE],e.Color.transparent,[!0,!0,!0,!0]);fa(a,t,r),a.clear({color:e.Color.transparent});for(var l=0;l<i.length;l++){var u=i[l];if(!n.hasRenderableParent(u)){var d=n.getTile(u),f=d.getBucket(r);if(f){var p=f.programConfigurations.get(r.id),m=t.useProgram(`heatmap`,p),h=t.transform.zoom;m.draw(a,o.TRIANGLES,ze.disabled,s,c,Ye.disabled,bi(u.posMatrix,d,h,r.paint.get(`heatmap-intensity`)),r.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,r.paint,t.transform.zoom,p)}}}a.viewport.set([0,0,t.width,t.height])}else t.renderPass===`translucent`&&(t.context.setColorMode(t.colorModeForRenderPass()),ma(t,r))}function fa(e,t,n){var r=e.gl;e.activeTexture.set(r.TEXTURE1),e.viewport.set([0,0,t.width/4,t.height/4]);var i=n.heatmapFbo;if(i)r.bindTexture(r.TEXTURE_2D,i.colorAttachment.get()),e.bindFramebuffer.set(i.framebuffer);else{var a=r.createTexture();r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),i=n.heatmapFbo=e.createFramebuffer(t.width/4,t.height/4,!1),pa(e,t,a,i)}}function pa(e,t,n,r){var i=e.gl,a=e.extRenderToTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:i.UNSIGNED_BYTE;i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t.width/4,t.height/4,0,i.RGBA,a,null),r.colorAttachment.set(n)}function ma(t,n){var r=t.context,i=r.gl,a=n.heatmapFbo;if(a){r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),r.activeTexture.set(i.TEXTURE1);var o=n.colorRampTexture;o||=n.colorRampTexture=new e.Texture(r,n.colorRamp,i.RGBA),o.bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram(`heatmapTexture`).draw(r,i.TRIANGLES,ze.disabled,He.disabled,t.colorModeForRenderPass(),Ye.disabled,xi(t,n,0,1),n.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,n.paint,t.transform.zoom)}}function ha(t,n,r,i){if(t.renderPass===`translucent`){var a=r.paint.get(`line-opacity`),o=r.paint.get(`line-width`);if(!(a.constantOr(1)===0||o.constantOr(1)===0))for(var s=t.depthModeForSublayer(0,ze.ReadOnly),c=t.colorModeForRenderPass(),l=r.paint.get(`line-dasharray`),u=r.paint.get(`line-pattern`),d=u.constantOr(1),f=r.paint.get(`line-gradient`),p=r.getCrossfadeParameters(),m=d?`linePattern`:l?`lineSDF`:f?`lineGradient`:`line`,h=t.context,g=h.gl,_=!0,v=0,y=i;v<y.length;v+=1){var b=y[v],x=n.getTile(b);if(!(d&&!x.patternsLoaded())){var S=x.getBucket(r);if(S){var C=S.programConfigurations.get(r.id),w=t.context.program.get(),T=t.useProgram(m,C),E=_||T.program!==w,D=u.constantOr(null);if(D&&x.imageAtlas){var O=x.imageAtlas,k=O.patternPositions[D.to.toString()],A=O.patternPositions[D.from.toString()];k&&A&&C.setConstantPatternPositions(k,A)}var j=d?Ni(t,x,r,p):l?Pi(t,x,r,l,p):f?Mi(t,x,r,S.lineClipsArray.length):ji(t,x,r);if(d)h.activeTexture.set(g.TEXTURE0),x.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),C.updatePaintBuffers(p);else if(l&&(E||t.lineAtlas.dirty))h.activeTexture.set(g.TEXTURE0),t.lineAtlas.bind(h);else if(f){var M=S.gradients[r.id],N=M.texture;if(r.gradientVersion!==M.version){var P=256;if(r.stepInterpolant){var F=n.getSource().maxzoom,I=b.canonical.z===F?Math.ceil(1<<t.transform.maxZoom-b.canonical.z):1,L=S.maxLineLength/e.EXTENT*1024*I;P=e.clamp(e.nextPowerOfTwo(L),256,h.maxTextureSize)}M.gradient=e.renderColorRamp({expression:r.gradientExpression(),evaluationKey:`lineProgress`,resolution:P,image:M.gradient||void 0,clips:S.lineClipsArray}),M.texture?M.texture.update(M.gradient):M.texture=new e.Texture(h,M.gradient,g.RGBA),M.version=r.gradientVersion,N=M.texture}h.activeTexture.set(g.TEXTURE0),N.bind(r.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}T.draw(h,g.TRIANGLES,s,t.stencilModeForClipping(b),c,Ye.disabled,j,r.id,S.layoutVertexBuffer,S.indexBuffer,S.segments,r.paint,t.transform.zoom,C,S.layoutVertexBuffer2),_=!1}}}}}function ga(t,n,r,i){var a=r.paint.get(`fill-color`),o=r.paint.get(`fill-opacity`);if(o.constantOr(1)!==0){var s=t.colorModeForRenderPass(),c=r.paint.get(`fill-pattern`),l=t.opaquePassEnabledForLayer()&&!c.constantOr(1)&&a.constantOr(e.Color.transparent).a===1&&o.constantOr(0)===1?`opaque`:`translucent`;t.renderPass===l&&_a(t,n,r,i,t.depthModeForSublayer(1,t.renderPass===`opaque`?ze.ReadWrite:ze.ReadOnly),s,!1),t.renderPass===`translucent`&&r.paint.get(`fill-antialias`)&&_a(t,n,r,i,t.depthModeForSublayer(r.getPaintProperty(`fill-outline-color`)?2:0,ze.ReadOnly),s,!0)}}function _a(e,t,n,r,i,a,o){var s=e.context.gl,c=n.paint.get(`fill-pattern`),l=c&&c.constantOr(1),u=n.getCrossfadeParameters(),d,f,p,m,h;o?(f=l&&!n.getPaintProperty(`fill-outline-color`)?`fillOutlinePattern`:`fillOutline`,d=s.LINES):(f=l?`fillPattern`:`fill`,d=s.TRIANGLES);for(var g=0,_=r;g<_.length;g+=1){var v=_[g],y=t.getTile(v);if(!(l&&!y.patternsLoaded())){var b=y.getBucket(n);if(b){var x=b.programConfigurations.get(n.id),S=e.useProgram(f,x);l&&(e.context.activeTexture.set(s.TEXTURE0),y.imageAtlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),x.updatePaintBuffers(u));var C=c.constantOr(null);if(C&&y.imageAtlas){var w=y.imageAtlas,T=w.patternPositions[C.to.toString()],E=w.patternPositions[C.from.toString()];T&&E&&x.setConstantPatternPositions(T,E)}var D=e.translatePosMatrix(v.posMatrix,y,n.paint.get(`fill-translate`),n.paint.get(`fill-translate-anchor`));if(!o)m=b.indexBuffer,h=b.segments,p=l?ai(D,e,u,y):ii(D);else{m=b.indexBuffer2,h=b.segments2;var O=[s.drawingBufferWidth,s.drawingBufferHeight];p=f===`fillOutlinePattern`&&l?si(D,e,u,y,O):oi(D,O)}S.draw(e.context,d,i,e.stencilModeForClipping(v),a,Ye.disabled,p,n.id,b.layoutVertexBuffer,m,h,n.paint,e.transform.zoom,x)}}}}function va(e,t,n,r){var i=n.paint.get(`fill-extrusion-opacity`);if(i!==0&&e.renderPass===`translucent`){var a=new ze(e.context.gl.LEQUAL,ze.ReadWrite,e.depthRangeFor3D);if(i===1&&!n.paint.get(`fill-extrusion-pattern`).constantOr(1)){var o=e.colorModeForRenderPass();ya(e,t,n,r,a,He.disabled,o)}else ya(e,t,n,r,a,He.disabled,Ke.disabled),ya(e,t,n,r,a,e.stencilModeFor3D(),e.colorModeForRenderPass())}}function ya(e,t,n,r,i,a,o){for(var s=e.context,c=s.gl,l=n.paint.get(`fill-extrusion-pattern`),u=l.constantOr(1),d=n.getCrossfadeParameters(),f=n.paint.get(`fill-extrusion-opacity`),p=0,m=r;p<m.length;p+=1){var h=m[p],g=t.getTile(h),_=g.getBucket(n);if(_){var v=_.programConfigurations.get(n.id),y=e.useProgram(u?`fillExtrusionPattern`:`fillExtrusion`,v);u&&(e.context.activeTexture.set(c.TEXTURE0),g.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),v.updatePaintBuffers(d));var b=l.constantOr(null);if(b&&g.imageAtlas){var x=g.imageAtlas,S=x.patternPositions[b.to.toString()],C=x.patternPositions[b.from.toString()];S&&C&&v.setConstantPatternPositions(S,C)}var w=e.translatePosMatrix(h.posMatrix,g,n.paint.get(`fill-extrusion-translate`),n.paint.get(`fill-extrusion-translate-anchor`)),T=n.paint.get(`fill-extrusion-vertical-gradient`),E=u?$r(w,e,T,f,h,d,g):Qr(w,e,T,f);y.draw(s,s.gl.TRIANGLES,i,a,o,Ye.backCCW,E,n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,n.paint,e.transform.zoom,v)}}}function ba(e,t,n,r){if(!(e.renderPass!==`offscreen`&&e.renderPass!==`translucent`)){for(var i=e.context,a=e.depthModeForSublayer(0,ze.ReadOnly),o=e.colorModeForRenderPass(),s=e.renderPass===`translucent`?e.stencilConfigForOverlap(r):[{},r],c=s[0],l=s[1],u=0,d=l;u<d.length;u+=1){var f=d[u],p=t.getTile(f);p.needsHillshadePrepare&&e.renderPass===`offscreen`?Sa(e,p,n,a,He.disabled,o):e.renderPass===`translucent`&&xa(e,p,n,a,c[f.overscaledZ],o)}i.viewport.set([0,0,e.width,e.height])}}function xa(e,t,n,r,i,a){var o=e.context,s=o.gl,c=t.fbo;if(c){var l=e.useProgram(`hillshade`);o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,c.colorAttachment.get());var u=wi(e,t,n);l.draw(o,s.TRIANGLES,r,i,a,Ye.disabled,u,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function Sa(t,n,r,i,a,o){var s=t.context,c=s.gl,l=n.dem;if(l&&l.data){var u=l.dim,d=l.stride,f=l.getPixels();if(s.activeTexture.set(c.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||t.getTileTexture(d),n.demTexture){var p=n.demTexture;p.update(f,{premultiply:!1}),p.bind(c.NEAREST,c.CLAMP_TO_EDGE)}else n.demTexture=new e.Texture(s,f,c.RGBA,{premultiply:!1}),n.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);s.activeTexture.set(c.TEXTURE0);var m=n.fbo;if(!m){var h=new e.Texture(s,{width:u,height:u,data:null},c.RGBA);h.bind(c.LINEAR,c.CLAMP_TO_EDGE),m=n.fbo=s.createFramebuffer(u,u,!0),m.colorAttachment.set(h.texture)}s.bindFramebuffer.set(m.framebuffer),s.viewport.set([0,0,u,u]),t.useProgram(`hillshadePrepare`).draw(s,c.TRIANGLES,i,a,o,Ye.disabled,Ti(n.tileID,l),r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),n.needsHillshadePrepare=!1}}function Ca(e,t,n,r){if(e.renderPass===`translucent`&&n.paint.get(`raster-opacity`)!==0&&r.length)for(var i=e.context,a=i.gl,o=t.getSource(),s=e.useProgram(`raster`),c=e.colorModeForRenderPass(),l=o instanceof I?[{},r]:e.stencilConfigForOverlap(r),u=l[0],d=l[1],f=d[d.length-1].overscaledZ,p=!e.options.moving,m=0,h=d;m<h.length;m+=1){var g=h[m],_=e.depthModeForSublayer(g.overscaledZ-f,n.paint.get(`raster-opacity`)===1?ze.ReadWrite:ze.ReadOnly,a.LESS),v=t.getTile(g),y=e.transform.calculatePosMatrix(g.toUnwrapped(),p);v.registerFadeDuration(n.paint.get(`raster-fade-duration`));var b=t.findLoadedParent(g,0),x=wa(v,b,t,n,e.transform),S=void 0,C=void 0,w=n.paint.get(`raster-resampling`)===`nearest`?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),v.texture.bind(w,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),b?(b.texture.bind(w,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),S=2**(b.tileID.overscaledZ-v.tileID.overscaledZ),C=[v.tileID.canonical.x*S%1,v.tileID.canonical.y*S%1]):v.texture.bind(w,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);var T=Ri(y,C||[0,0],S||1,x,n);o instanceof I?s.draw(i,a.TRIANGLES,_,He.disabled,c,Ye.disabled,T,n.id,o.boundsBuffer,e.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,_,u[g.overscaledZ],c,Ye.disabled,T,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function wa(t,n,r,i,a){var o=i.paint.get(`raster-fade-duration`);if(o>0){var s=e.browser.now(),c=(s-t.timeAdded)/o,l=n?(s-n.timeAdded)/o:-1,u=r.getSource(),d=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),f=!n||Math.abs(n.tileID.overscaledZ-d)>Math.abs(t.tileID.overscaledZ-d),p=f&&t.refreshedUponExpiration?1:e.clamp(f?c:1-l,0,1);return t.refreshedUponExpiration&&c>=1&&(t.refreshedUponExpiration=!1),n?{opacity:1,mix:1-p}:{opacity:p,mix:0}}else return{opacity:1,mix:0}}function Ta(e,t,n){var r=n.paint.get(`background-color`),i=n.paint.get(`background-opacity`);if(i!==0){var a=e.context,o=a.gl,s=e.transform,c=s.tileSize,l=n.paint.get(`background-pattern`);if(!e.isPatternMissing(l)){var u=!l&&r.a===1&&i===1&&e.opaquePassEnabledForLayer()?`opaque`:`translucent`;if(e.renderPass===u){var d=He.disabled,f=e.depthModeForSublayer(0,u===`opaque`?ze.ReadWrite:ze.ReadOnly),p=e.colorModeForRenderPass(),m=e.useProgram(l?`backgroundPattern`:`background`),h=s.coveringTiles({tileSize:c});l&&(a.activeTexture.set(o.TEXTURE0),e.imageManager.bind(e.context));for(var g=n.getCrossfadeParameters(),_=0,v=h;_<v.length;_+=1){var y=v[_],b=e.transform.calculatePosMatrix(y.toUnwrapped()),x=l?Zi(b,i,e,l,{tileID:y,tileSize:c},g):Xi(b,i,r);m.draw(a,o.TRIANGLES,f,d,p,Ye.disabled,x,n.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}}}}var Ea=new e.Color(1,0,0,1),Da=new e.Color(0,1,0,1),Oa=new e.Color(0,0,1,1),ka=new e.Color(1,0,1,1),Aa=new e.Color(0,1,1,1);function ja(e){var t=e.transform.padding,n=3;Na(e,e.transform.height-(t.top||0),n,Ea),Na(e,t.bottom||0,n,Da),Pa(e,t.left||0,n,Oa),Pa(e,e.transform.width-(t.right||0),n,ka);var r=e.transform.centerPoint;Ma(e,r.x,e.transform.height-r.y,Aa)}function Ma(e,t,n,r){var i=20,a=2;Fa(e,t-a/2,n-i/2,a,i,r),Fa(e,t-i/2,n-a/2,i,a,r)}function Na(e,t,n,r){Fa(e,0,t+n/2,e.transform.width,n,r)}function Pa(e,t,n,r){Fa(e,t-n/2,0,n,e.transform.height,r)}function Fa(t,n,r,i,a,o){var s=t.context,c=s.gl;c.enable(c.SCISSOR_TEST),c.scissor(n*e.browser.devicePixelRatio,r*e.browser.devicePixelRatio,i*e.browser.devicePixelRatio,a*e.browser.devicePixelRatio),s.clear({color:o}),c.disable(c.SCISSOR_TEST)}function Ia(e,t,n){for(var r=0;r<n.length;r++)La(e,t,n[r])}function La(t,n,r){var i=t.context,a=i.gl,o=r.posMatrix,s=t.useProgram(`debug`),c=ze.disabled,l=He.disabled,u=t.colorModeForRenderPass(),d=`$debug`;i.activeTexture.set(a.TEXTURE0),t.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,c,l,u,Ye.disabled,hi(o,e.Color.red),d,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments);var f=n.getTileByID(r.key).latestRawTileData,p=f&&f.byteLength||0,m=Math.floor(p/1024),h=n.getTile(r).tileSize,g=512/Math.min(h,512)*(r.overscaledZ/t.transform.zoom)*.5,_=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(_+=` => `+r.overscaledZ),Ra(t,_+` `+m+`kb`),s.draw(i,a.TRIANGLES,c,l,Ke.alphaBlended,Ye.disabled,hi(o,e.Color.transparent,g),d,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments)}function Ra(e,t){e.initDebugOverlayCanvas();var n=e.debugOverlayCanvas,r=e.context.gl,i=e.debugOverlayCanvas.getContext(`2d`);i.clearRect(0,0,n.width,n.height),i.shadowColor=`white`,i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle=`white`,i.textBaseline=`top`,i.font=`bold 36px Open Sans, sans-serif`,i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(n),e.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}function za(e,t,n){var r=e.context,i=n.implementation;if(e.renderPass===`offscreen`){var a=i.prerender;a&&(e.setCustomLayerDefaults(),r.setColorMode(e.colorModeForRenderPass()),a.call(i,r.gl,e.transform.customLayerMatrix()),r.setDirty(),e.setBaseState())}else if(e.renderPass===`translucent`){e.setCustomLayerDefaults(),r.setColorMode(e.colorModeForRenderPass()),r.setStencilMode(He.disabled);var o=i.renderingMode===`3d`?new ze(e.context.gl.LEQUAL,ze.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,ze.ReadOnly);r.setDepthMode(o),i.render(r.gl,e.transform.customLayerMatrix()),r.setDirty(),e.setBaseState(),r.bindFramebuffer.set(null)}}var Ba={symbol:ra,circle:ua,heatmap:da,line:ha,fill:ga,"fill-extrusion":va,hillshade:ba,raster:Ca,background:Ta,debug:Ia,custom:za},Va=function(e,t){this.context=new Xe(e),this.transform=t,this._tileTextures={},this.setup(),this.numSublayers=Ze.maxUnderzooming+Ze.maxOverzooming+1,this.depthEpsilon=1/2**16,this.crossTileSymbolIndex=new fn,this.gpuTimers={}};Va.prototype.resize=function(t,n){if(this.width=t*e.browser.devicePixelRatio,this.height=n*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var r=0,i=this.style._order;r<i.length;r+=1){var a=i[r];this.style._layers[a].resize()}},Va.prototype.setup=function(){var t=this.context,n=new e.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(e.EXTENT,0),n.emplaceBack(0,e.EXTENT),n.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=t.createVertexBuffer(n,vn.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);var r=new e.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(e.EXTENT,0),r.emplaceBack(0,e.EXTENT),r.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=t.createVertexBuffer(r,vn.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);var i=new e.StructArrayLayout4i8;i.emplaceBack(0,0,0,0),i.emplaceBack(e.EXTENT,0,e.EXTENT,0),i.emplaceBack(0,e.EXTENT,0,e.EXTENT),i.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.rasterBoundsBuffer=t.createVertexBuffer(i,F.members),this.rasterBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);var a=new e.StructArrayLayout2i4;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,vn.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);var o=new e.StructArrayLayout1ui2;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);var s=new e.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s),this.emptyTexture=new e.Texture(t,{width:1,height:1,data:new Uint8Array([0,0,0,0])},t.gl.RGBA);var c=this.context.gl;this.stencilClearMode=new He({func:c.ALWAYS,mask:0},0,255,c.ZERO,c.ZERO,c.ZERO)},Va.prototype.clearStencil=function(){var t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var r=e.create();e.ortho(r,0,this.width,this.height,0,0,1),e.scale(r,r,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram(`clippingMask`).draw(t,n.TRIANGLES,ze.disabled,this.stencilClearMode,Ke.disabled,Ye.disabled,_i(r),`$clipping`,this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Va.prototype._renderTileClippingMasks=function(e,t){if(!(this.currentStencilSource===e.source||!e.isTileClipped()||!t||!t.length)){this.currentStencilSource=e.source;var n=this.context,r=n.gl;this.nextStencilID+t.length>256&&this.clearStencil(),n.setColorMode(Ke.disabled),n.setDepthMode(ze.disabled);var i=this.useProgram(`clippingMask`);this._tileClippingMaskIDs={};for(var a=0,o=t;a<o.length;a+=1){var s=o[a],c=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;i.draw(n,r.TRIANGLES,ze.disabled,new He({func:r.ALWAYS,mask:0},c,255,r.KEEP,r.KEEP,r.REPLACE),Ke.disabled,Ye.disabled,_i(s.posMatrix),`$clipping`,this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Va.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var e=this.nextStencilID++,t=this.context.gl;return new He({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)},Va.prototype.stencilModeForClipping=function(e){var t=this.context.gl;return new He({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)},Va.prototype.stencilConfigForOverlap=function(e){var t,n=this.context.gl,r=e.sort(function(e,t){return t.overscaledZ-e.overscaledZ}),i=r[r.length-1].overscaledZ,a=r[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s<a;s++)o[s+i]=new He({func:n.GEQUAL,mask:255},s+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=a,[o,r]}return[(t={},t[i]=He.disabled,t),r]},Va.prototype.colorModeForRenderPass=function(){var t=this.context.gl;if(this._showOverdrawInspector){var n=1/8;return new Ke([t.CONSTANT_COLOR,t.ONE],new e.Color(n,n,n,0),[!0,!0,!0,!0])}else return this.renderPass===`opaque`?Ke.unblended:Ke.alphaBlended},Va.prototype.depthModeForSublayer=function(e,t,n){if(!this.opaquePassEnabledForLayer())return ze.disabled;var r=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new ze(n||this.context.gl.LEQUAL,t,[r,r])},Va.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Va.prototype.render=function(t,n){var r=this;this.style=t,this.options=n,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.browser.now()),this.imageManager.beginFrame();var i=this.style._order,a=this.style.sourceCaches;for(var o in a){var s=a[o];s.used&&s.prepare(this.context)}var c={},l={},u={};for(var d in a){var f=a[d];c[d]=f.getVisibleCoordinates(),l[d]=c[d].slice().reverse(),u[d]=f.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var p=0;p<i.length;p++){var m=i[p];if(this.style._layers[m].is3D()){this.opaquePassCutoff=p;break}}this.renderPass=`offscreen`;for(var h=0,g=i;h<g.length;h+=1){var _=g[h],v=this.style._layers[_];if(!(!v.hasOffscreenPass()||v.isHidden(this.transform.zoom))){var y=l[v.source];v.type!==`custom`&&!y.length||this.renderLayer(this,a[v.source],v,y)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?e.Color.black:e.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass=`opaque`,this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){var b=this.style._layers[i[this.currentLayer]],x=a[b.source],S=c[b.source];this._renderTileClippingMasks(b,S),this.renderLayer(this,x,b,S)}for(this.renderPass=`translucent`,this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var C=this.style._layers[i[this.currentLayer]],w=a[C.source],T=(C.type===`symbol`?u:l)[C.source];this._renderTileClippingMasks(C,c[C.source]),this.renderLayer(this,w,C,T)}if(this.options.showTileBoundaries){var E,D;e.values(this.style._layers).forEach(function(e){e.source&&!e.isHidden(r.transform.zoom)&&(e.source!==(D&&D.id)&&(D=r.style.sourceCaches[e.source]),(!E||E.getSource().maxzoom<D.getSource().maxzoom)&&(E=D))}),E&&Ba.debug(this,E,E.getVisibleCoordinates())}this.options.showPadding&&ja(this),this.context.setDefault()},Va.prototype.renderLayer=function(e,t,n,r){n.isHidden(this.transform.zoom)||n.type!==`background`&&n.type!==`custom`&&!r.length||(this.id=n.id,this.gpuTimingStart(n),Ba[n.type](e,t,n,r,this.style.placement.variableOffsets),this.gpuTimingEnd())},Va.prototype.gpuTimingStart=function(e){if(this.options.gpuTiming){var t=this.context.extTimerQuery,n=this.gpuTimers[e.id];n||=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:t.createQueryEXT()},n.calls++,t.beginQueryEXT(t.TIME_ELAPSED_EXT,n.query)}},Va.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var e=this.context.extTimerQuery;e.endQueryEXT(e.TIME_ELAPSED_EXT)}},Va.prototype.collectGpuTimers=function(){var e=this.gpuTimers;return this.gpuTimers={},e},Va.prototype.queryGpuTimers=function(e){var t={};for(var n in e){var r=e[n],i=this.context.extTimerQuery,a=i.getQueryObjectEXT(r.query,i.QUERY_RESULT_EXT)/(1e3*1e3);i.deleteQueryEXT(r.query),t[n]=a}return t},Va.prototype.translatePosMatrix=function(t,n,r,i,a){if(!r[0]&&!r[1])return t;var o=a?i===`map`?this.transform.angle:0:i===`viewport`?-this.transform.angle:0;if(o){var s=Math.sin(o),c=Math.cos(o);r=[r[0]*c-r[1]*s,r[0]*s+r[1]*c]}var l=[a?r[0]:zt(n,r[0],this.transform.zoom),a?r[1]:zt(n,r[1],this.transform.zoom),0],u=new Float32Array(16);return e.translate(u,t,l),u},Va.prototype.saveTileTexture=function(e){var t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]},Va.prototype.getTileTexture=function(e){var t=this._tileTextures[e];return t&&t.length>0?t.pop():null},Va.prototype.isPatternMissing=function(e){if(!e)return!1;if(!e.from||!e.to)return!0;var t=this.imageManager.getPattern(e.from.toString()),n=this.imageManager.getPattern(e.to.toString());return!t||!n},Va.prototype.useProgram=function(e,t){this.cache=this.cache||{};var n=``+e+(t?t.cacheKey:``)+(this._showOverdrawInspector?`/overdraw`:``);return this.cache[n]||(this.cache[n]=new qr(this.context,e,Wr[e],t,Qi[e],this._showOverdrawInspector)),this.cache[n]},Va.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()},Va.prototype.setBaseState=function(){var e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)},Va.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement(`canvas`),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var t=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,t.RGBA)}},Va.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Ha=function(e,t){this.points=e,this.planes=t};Ha.fromInvProjectionMatrix=function(t,n,r){var i=[[-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]],a=2**r,o=i.map(function(n){return e.transformMat4([],n,t)}).map(function(t){return e.scale$1([],t,1/t[3]/n*a)});return new Ha(o,[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(t){var n=e.sub([],o[t[0]],o[t[1]]),r=e.sub([],o[t[2]],o[t[1]]),i=e.normalize([],e.cross([],n,r)),a=-e.dot(i,o[t[1]]);return i.concat(a)}))};var Ua=function(t,n){this.min=t,this.max=n,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};Ua.prototype.quadrant=function(t){for(var n=[t%2==0,t<2],r=e.clone$2(this.min),i=e.clone$2(this.max),a=0;a<n.length;a++)r[a]=n[a]?this.min[a]:this.center[a],i[a]=n[a]?this.center[a]:this.max[a];return i[2]=this.max[2],new Ua(r,i)},Ua.prototype.distanceX=function(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]},Ua.prototype.distanceY=function(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]},Ua.prototype.intersects=function(t){for(var n=[[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]],r=!0,i=0;i<t.planes.length;i++){for(var a=t.planes[i],o=0,s=0;s<n.length;s++)o+=e.dot$1(a,n[s])>=0;if(o===0)return 0;o!==n.length&&(r=!1)}if(r)return 2;for(var c=0;c<3;c++){for(var l=Number.MAX_VALUE,u=-Number.MAX_VALUE,d=0;d<t.points.length;d++){var f=t.points[d][c]-this.min[c];l=Math.min(l,f),u=Math.max(u,f)}if(u<0||l>this.max[c]-this.min[c])return 0}return 1};var Wa=function(e,t,n,r){if(e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0),isNaN(e)||e<0||isNaN(t)||t<0||isNaN(n)||n<0||isNaN(r)||r<0)throw Error(`Invalid value for edge-insets, top, bottom, left and right must all be numbers`);this.top=e,this.bottom=t,this.left=n,this.right=r};Wa.prototype.interpolate=function(t,n,r){return n.top!=null&&t.top!=null&&(this.top=e.number(t.top,n.top,r)),n.bottom!=null&&t.bottom!=null&&(this.bottom=e.number(t.bottom,n.bottom,r)),n.left!=null&&t.left!=null&&(this.left=e.number(t.left,n.left,r)),n.right!=null&&t.right!=null&&(this.right=e.number(t.right,n.right,r)),this},Wa.prototype.getCenter=function(t,n){var r=e.clamp((this.left+t-this.right)/2,0,t),i=e.clamp((this.top+n-this.bottom)/2,0,n);return new e.Point(r,i)},Wa.prototype.equals=function(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right},Wa.prototype.clone=function(){return new Wa(this.top,this.bottom,this.left,this.right)},Wa.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Ga=function(t,n,r,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=a===void 0?!0:a,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=r??0,this._maxPitch=i??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Wa,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ka={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}};Ga.prototype.clone=function(){var e=new Ga(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._calcMatrices(),e},Ka.minZoom.get=function(){return this._minZoom},Ka.minZoom.set=function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))},Ka.maxZoom.get=function(){return this._maxZoom},Ka.maxZoom.set=function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))},Ka.minPitch.get=function(){return this._minPitch},Ka.minPitch.set=function(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))},Ka.maxPitch.get=function(){return this._maxPitch},Ka.maxPitch.set=function(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))},Ka.renderWorldCopies.get=function(){return this._renderWorldCopies},Ka.renderWorldCopies.set=function(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e},Ka.worldSize.get=function(){return this.tileSize*this.scale},Ka.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ka.size.get=function(){return new e.Point(this.width,this.height)},Ka.bearing.get=function(){return-this.angle/Math.PI*180},Ka.bearing.set=function(t){var n=-e.wrap(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ka.pitch.get=function(){return this._pitch/Math.PI*180},Ka.pitch.set=function(t){var n=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())},Ka.fov.get=function(){return this._fov/Math.PI*180},Ka.fov.set=function(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())},Ka.zoom.get=function(){return this._zoom},Ka.zoom.set=function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())},Ka.center.get=function(){return this._center},Ka.center.set=function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())},Ka.padding.get=function(){return this._edgeInsets.toJSON()},Ka.padding.set=function(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())},Ka.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Ga.prototype.isPaddingEqual=function(e){return this._edgeInsets.equals(e)},Ga.prototype.interpolatePadding=function(e,t,n){this._unmodified=!1,this._edgeInsets.interpolate(e,t,n),this._constrain(),this._calcMatrices()},Ga.prototype.coveringZoomLevel=function(e){var t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)},Ga.prototype.getVisibleUnwrappedCoordinates=function(t){var n=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new e.Point(0,0)),i=this.pointCoordinate(new e.Point(this.width,0)),a=this.pointCoordinate(new e.Point(this.width,this.height)),o=this.pointCoordinate(new e.Point(0,this.height)),s=Math.floor(Math.min(r.x,i.x,a.x,o.x)),c=Math.floor(Math.max(r.x,i.x,a.x,o.x)),l=1,u=s-l;u<=c+l;u++)u!==0&&n.push(new e.UnwrappedTileID(u,t));return n},Ga.prototype.coveringTiles=function(t){var n=this.coveringZoomLevel(t),r=n;if(t.minzoom!==void 0&&n<t.minzoom)return[];t.maxzoom!==void 0&&n>t.maxzoom&&(n=t.maxzoom);var i=e.MercatorCoordinate.fromLngLat(this.center),a=2**n,o=[a*i.x,a*i.y,0],s=Ha.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n),c=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(c=n);var l=3,u=function(e){return{aabb:new Ua([e*a,0,0],[(e+1)*a,a,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}},d=[],f=[],p=n,m=t.reparseOverscaled?r:n;if(this._renderWorldCopies)for(var h=1;h<=3;h++)d.push(u(-h)),d.push(u(h));for(d.push(u(0));d.length>0;){var g=d.pop(),_=g.x,v=g.y,y=g.fullyVisible;if(!y){var b=g.aabb.intersects(s);if(b===0)continue;y=b===2}var x=g.aabb.distanceX(o),S=g.aabb.distanceY(o),C=Math.max(Math.abs(x),Math.abs(S)),w=l+(1<<p-g.zoom)-2;if(g.zoom===p||C>w&&g.zoom>=c){f.push({tileID:new e.OverscaledTileID(g.zoom===p?m:g.zoom,g.wrap,g.zoom,_,v),distanceSq:e.sqrLen([o[0]-.5-_,o[1]-.5-v])});continue}for(var T=0;T<4;T++){var E=(_<<1)+T%2,D=(v<<1)+(T>>1);d.push({aabb:g.aabb.quadrant(T),zoom:g.zoom+1,x:E,y:D,wrap:g.wrap,fullyVisible:y})}}return f.sort(function(e,t){return e.distanceSq-t.distanceSq}).map(function(e){return e.tileID})},Ga.prototype.resize=function(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()},Ka.unmodified.get=function(){return this._unmodified},Ga.prototype.zoomScale=function(e){return 2**e},Ga.prototype.scaleZoom=function(e){return Math.log(e)/Math.LN2},Ga.prototype.project=function(t){var n=e.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(t.lng)*this.worldSize,e.mercatorYfromLat(n)*this.worldSize)},Ga.prototype.unproject=function(t){return new e.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},Ka.point.get=function(){return this.project(this.center)},Ga.prototype.setLocationAtPoint=function(t,n){var r=this.pointCoordinate(n),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.MercatorCoordinate(a.x-(r.x-i.x),a.y-(r.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},Ga.prototype.locationPoint=function(e){return this.coordinatePoint(this.locationCoordinate(e))},Ga.prototype.pointLocation=function(e){return this.coordinateLocation(this.pointCoordinate(e))},Ga.prototype.locationCoordinate=function(t){return e.MercatorCoordinate.fromLngLat(t)},Ga.prototype.coordinateLocation=function(e){return e.toLngLat()},Ga.prototype.pointCoordinate=function(t){var n=0,r=[t.x,t.y,0,1],i=[t.x,t.y,1,1];e.transformMat4(r,r,this.pixelMatrixInverse),e.transformMat4(i,i,this.pixelMatrixInverse);var a=r[3],o=i[3],s=r[0]/a,c=i[0]/o,l=r[1]/a,u=i[1]/o,d=r[2]/a,f=i[2]/o,p=d===f?0:(n-d)/(f-d);return new e.MercatorCoordinate(e.number(s,c,p)/this.worldSize,e.number(l,u,p)/this.worldSize)},Ga.prototype.coordinatePoint=function(t){var n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(n,n,this.pixelMatrix),new e.Point(n[0]/n[3],n[1]/n[3])},Ga.prototype.getBounds=function(){return new e.LngLatBounds().extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},Ga.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},Ga.prototype.setMaxBounds=function(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Ga.prototype.calculatePosMatrix=function(t,n){n===void 0&&(n=!1);var r=t.key,i=n?this._alignedPosMatrixCache:this._posMatrixCache;if(i[r])return i[r];var a=t.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+2**a.z*t.wrap,c=e.identity(new Float64Array(16));return e.translate(c,c,[s*o,a.y*o,0]),e.scale(c,c,[o/e.EXTENT,o/e.EXTENT,1]),e.multiply(c,n?this.alignedProjMatrix:this.projMatrix,c),i[r]=new Float32Array(c),i[r]},Ga.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Ga.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var t=-90,n=90,r=-180,i=180,a,o,s,c,l=this.size,u=this._unmodified;if(this.latRange){var d=this.latRange;t=e.mercatorYfromLat(d[1])*this.worldSize,n=e.mercatorYfromLat(d[0])*this.worldSize,a=n-t<l.y?l.y/(n-t):0}if(this.lngRange){var f=this.lngRange;r=e.mercatorXfromLng(f[0])*this.worldSize,i=e.mercatorXfromLng(f[1])*this.worldSize,o=i-r<l.x?l.x/(i-r):0}var p=this.point,m=Math.max(o||0,a||0);if(m){this.center=this.unproject(new e.Point(o?(i+r)/2:p.x,a?(n+t)/2:p.y)),this.zoom+=this.scaleZoom(m),this._unmodified=u,this._constraining=!1;return}if(this.latRange){var h=p.y,g=l.y/2;h-g<t&&(c=t+g),h+g>n&&(c=n-g)}if(this.lngRange){var _=p.x,v=l.x/2;_-v<r&&(s=r+v),_+v>i&&(s=i-v)}(s!==void 0||c!==void 0)&&(this.center=this.unproject(new e.Point(s===void 0?p.x:s,c===void 0?p.y:c))),this._unmodified=u,this._constraining=!1}},Ga.prototype._calcMatrices=function(){if(this.height){var t=this._fov/2,n=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(t)*this.height;var r=Math.PI/2+this._pitch,i=this._fov*(.5+n.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-r-i,.01,Math.PI-.01)),o=this.point,s=o.x,c=o.y,l=(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance)*1.01,u=this.height/50,d=new Float64Array(16);e.perspective(d,this._fov,this.width/this.height,u,l),d[8]=-n.x*2/this.width,d[9]=n.y*2/this.height,e.scale(d,d,[1,-1,1]),e.translate(d,d,[0,0,-this.cameraToCenterDistance]),e.rotateX(d,d,this._pitch),e.rotateZ(d,d,this.angle),e.translate(d,d,[-s,-c,0]),this.mercatorMatrix=e.scale([],d,[this.worldSize,this.worldSize,this.worldSize]),e.scale(d,d,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=d,this.invProjMatrix=e.invert([],this.projMatrix);var f=this.width%2/2,p=this.height%2/2,m=Math.cos(this.angle),h=Math.sin(this.angle),g=s-Math.round(s)+m*f+h*p,_=c-Math.round(c)+m*p+h*f,v=new Float64Array(d);if(e.translate(v,v,[g>.5?g-1:g,_>.5?_-1:_,0]),this.alignedProjMatrix=v,d=e.create(),e.scale(d,d,[this.width/2,-this.height/2,1]),e.translate(d,d,[1,-1,0]),this.labelPlaneMatrix=d,d=e.create(),e.scale(d,d,[1,-1,1]),e.translate(d,d,[-1,-1,0]),e.scale(d,d,[2/this.width,2/this.height,1]),this.glCoordMatrix=d,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),d=e.invert(new Float64Array(16),this.pixelMatrix),!d)throw Error(`failed to invert matrix`);this.pixelMatrixInverse=d,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Ga.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new e.Point(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance},Ga.prototype.getCameraPoint=function(){var t=this._pitch,n=Math.tan(t)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,n))},Ga.prototype.getCameraQueryGeometry=function(t){var n=this.getCameraPoint();if(t.length===1)return[t[0],n];for(var r=n.x,i=n.y,a=n.x,o=n.y,s=0,c=t;s<c.length;s+=1){var l=c[s];r=Math.min(r,l.x),i=Math.min(i,l.y),a=Math.max(a,l.x),o=Math.max(o,l.y)}return[new e.Point(r,i),new e.Point(a,i),new e.Point(a,o),new e.Point(r,o),new e.Point(r,i)]},Object.defineProperties(Ga.prototype,Ka);function qa(e,t){var n=!1,r=null,i=function(){r=null,n&&=(e(),r=setTimeout(i,t),!1)};return function(){return n=!0,r||i(),r}}var Ja=function(t){this._hashName=t&&encodeURIComponent(t),e.bindAll([`_getCurrentHash`,`_onHashChange`,`_updateHash`],this),this._updateHash=qa(this._updateHashUnthrottled.bind(this),30*1e3/100)};Ja.prototype.addTo=function(t){return this._map=t,e.window.addEventListener(`hashchange`,this._onHashChange,!1),this._map.on(`moveend`,this._updateHash),this},Ja.prototype.remove=function(){return e.window.removeEventListener(`hashchange`,this._onHashChange,!1),this._map.off(`moveend`,this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Ja.prototype.getHashString=function(t){var n=this._map.getCenter(),r=Math.round(this._map.getZoom()*100)/100,i=10**Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.round(n.lng*i)/i,o=Math.round(n.lat*i)/i,s=this._map.getBearing(),c=this._map.getPitch(),l=``;if(t?l+=`/`+a+`/`+o+`/`+r:l+=r+`/`+o+`/`+a,(s||c)&&(l+=`/`+Math.round(s*10)/10),c&&(l+=`/`+Math.round(c)),this._hashName){var u=this._hashName,d=!1,f=e.window.location.hash.slice(1).split(`&`).map(function(e){var t=e.split(`=`)[0];return t===u?(d=!0,t+`=`+l):e}).filter(function(e){return e});return d||f.push(u+`=`+l),`#`+f.join(`&`)}return`#`+l},Ja.prototype._getCurrentHash=function(){var t=this,n=e.window.location.hash.replace(`#`,``);if(this._hashName){var r;return n.split(`&`).map(function(e){return e.split(`=`)}).forEach(function(e){e[0]===t._hashName&&(r=e)}),(r&&r[1]||``).split(`/`)}return n.split(`/`)},Ja.prototype._onHashChange=function(){var e=this._getCurrentHash();if(e.length>=3&&!e.some(function(e){return isNaN(e)})){var t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},Ja.prototype._updateHashUnthrottled=function(){var t=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,t)}catch{}};var Ya={linearity:.3,easing:e.bezier(0,0,.3,1)},Xa=e.extend({deceleration:2500,maxSpeed:1400},Ya),Za=e.extend({deceleration:20,maxSpeed:1400},Ya),Qa=e.extend({deceleration:1e3,maxSpeed:360},Ya),$a=e.extend({deceleration:1e3,maxSpeed:90},Ya),eo=function(e){this._map=e,this.clear()};eo.prototype.clear=function(){this._inertiaBuffer=[]},eo.prototype.record=function(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:t})},eo.prototype._drainInertiaBuffer=function(){for(var t=this._inertiaBuffer,n=e.browser.now(),r=160;t.length>0&&n-t[0].time>r;)t.shift()},eo.prototype._onMoveEnd=function(t){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var n={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},r=0,i=this._inertiaBuffer;r<i.length;r+=1){var a=i[r].settings;n.zoom+=a.zoomDelta||0,n.bearing+=a.bearingDelta||0,n.pitch+=a.pitchDelta||0,a.panDelta&&n.pan._add(a.panDelta),a.around&&(n.around=a.around),a.pinchAround&&(n.pinchAround=a.pinchAround)}var o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(n.pan.mag()){var c=no(n.pan.mag(),o,e.extend({},Xa,t||{}));s.offset=n.pan.mult(c.amount/n.pan.mag()),s.center=this._map.transform.center,to(s,c)}if(n.zoom){var l=no(n.zoom,o,Za);s.zoom=this._map.transform.zoom+l.amount,to(s,l)}if(n.bearing){var u=no(n.bearing,o,Qa);s.bearing=this._map.transform.bearing+e.clamp(u.amount,-179,179),to(s,u)}if(n.pitch){var d=no(n.pitch,o,$a);s.pitch=this._map.transform.pitch+d.amount,to(s,d)}if(s.zoom||s.bearing){var f=n.pinchAround===void 0?n.around:n.pinchAround;s.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),e.extend(s,{noMoveStart:!0})}};function to(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function no(t,n,r){var i=r.maxSpeed,a=r.linearity,o=r.deceleration,s=e.clamp(t*a/(n/1e3),-i,i),c=Math.abs(s)/(o*a);return{easing:r.easing,duration:c*1e3,amount:c/2*s}}var ro=function(t){function r(r,i,a,o){o===void 0&&(o={});var s=n.mousePos(i.getCanvasContainer(),a),c=i.unproject(s);t.call(this,r,e.extend({point:s,lngLat:c,originalEvent:a},o)),this._defaultPrevented=!1,this.target=i}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,i),r}(e.Event),io=function(t){function r(r,i,a){var o=r===`touchend`?a.changedTouches:a.touches,s=n.touchPos(i.getCanvasContainer(),o),c=s.map(function(e){return i.unproject(e)}),l=s.reduce(function(e,t,n,r){return e.add(t.div(r.length))},new e.Point(0,0)),u=i.unproject(l);t.call(this,r,{points:s,point:l,lngLats:c,lngLat:u,originalEvent:a}),this._defaultPrevented=!1}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,i),r}(e.Event),ao=function(e){function t(t,n,r){e.call(this,t,{originalEvent:r}),this._defaultPrevented=!1}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={defaultPrevented:{configurable:!0}};return t.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(t.prototype,n),t}(e.Event),oo=function(e,t){this._map=e,this._clickTolerance=t.clickTolerance};oo.prototype.reset=function(){delete this._mousedownPos},oo.prototype.wheel=function(e){return this._firePreventable(new ao(e.type,this._map,e))},oo.prototype.mousedown=function(e,t){return this._mousedownPos=t,this._firePreventable(new ro(e.type,this._map,e))},oo.prototype.mouseup=function(e){this._map.fire(new ro(e.type,this._map,e))},oo.prototype.click=function(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new ro(e.type,this._map,e))},oo.prototype.dblclick=function(e){return this._firePreventable(new ro(e.type,this._map,e))},oo.prototype.mouseover=function(e){this._map.fire(new ro(e.type,this._map,e))},oo.prototype.mouseout=function(e){this._map.fire(new ro(e.type,this._map,e))},oo.prototype.touchstart=function(e){return this._firePreventable(new io(e.type,this._map,e))},oo.prototype.touchmove=function(e){this._map.fire(new io(e.type,this._map,e))},oo.prototype.touchend=function(e){this._map.fire(new io(e.type,this._map,e))},oo.prototype.touchcancel=function(e){this._map.fire(new io(e.type,this._map,e))},oo.prototype._firePreventable=function(e){if(this._map.fire(e),e.defaultPrevented)return{}},oo.prototype.isEnabled=function(){return!0},oo.prototype.isActive=function(){return!1},oo.prototype.enable=function(){},oo.prototype.disable=function(){};var so=function(e){this._map=e};so.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},so.prototype.mousemove=function(e){this._map.fire(new ro(e.type,this._map,e))},so.prototype.mousedown=function(){this._delayContextMenu=!0},so.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ro(`contextmenu`,this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},so.prototype.contextmenu=function(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new ro(e.type,this._map,e)),this._map.listens(`contextmenu`)&&e.preventDefault()},so.prototype.isEnabled=function(){return!0},so.prototype.isActive=function(){return!1},so.prototype.enable=function(){},so.prototype.disable=function(){};var co=function(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1};co.prototype.isEnabled=function(){return!!this._enabled},co.prototype.isActive=function(){return!!this._active},co.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},co.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},co.prototype.mousedown=function(e,t){this.isEnabled()&&e.shiftKey&&e.button===0&&(n.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)},co.prototype.mousemoveWindow=function(e,t){if(this._active){var r=t;if(!(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)){var i=this._startPos;this._lastPos=r,this._box||(this._box=n.create(`div`,`mapboxgl-boxzoom`,this._container),this._container.classList.add(`mapboxgl-crosshair`),this._fireEvent(`boxzoomstart`,e));var a=Math.min(i.x,r.x),o=Math.max(i.x,r.x),s=Math.min(i.y,r.y),c=Math.max(i.y,r.y);n.setTransform(this._box,`translate(`+a+`px,`+s+`px)`),this._box.style.width=o-a+`px`,this._box.style.height=c-s+`px`}}},co.prototype.mouseupWindow=function(t,r){var i=this;if(this._active&&t.button===0){var a=this._startPos,o=r;if(this.reset(),n.suppressClick(),a.x===o.x&&a.y===o.y)this._fireEvent(`boxzoomcancel`,t);else return this._map.fire(new e.Event(`boxzoomend`,{originalEvent:t})),{cameraAnimation:function(e){return e.fitScreenCoordinates(a,o,i._map.getBearing(),{linear:!0})}}}},co.prototype.keydown=function(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent(`boxzoomcancel`,e))},co.prototype.reset=function(){this._active=!1,this._container.classList.remove(`mapboxgl-crosshair`),this._box&&=(n.remove(this._box),null),n.enableDrag(),delete this._startPos,delete this._lastPos},co.prototype._fireEvent=function(t,n){return this._map.fire(new e.Event(t,{originalEvent:n}))};function lo(e,t){for(var n={},r=0;r<e.length;r++)n[e[r].identifier]=t[r];return n}function uo(t){for(var n=new e.Point(0,0),r=0,i=t;r<i.length;r+=1){var a=i[r];n._add(a)}return n.div(t.length)}var fo=500,po=500,mo=30,ho=function(e){this.reset(),this.numTouches=e.numTouches};ho.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},ho.prototype.touchstart=function(e,t,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=uo(t),this.touches=lo(n,t)))},ho.prototype.touchmove=function(e,t,n){if(!(this.aborted||!this.centroid)){var r=lo(n,t);for(var i in this.touches){var a=this.touches[i],o=r[i];(!o||o.dist(a)>mo)&&(this.aborted=!0)}}},ho.prototype.touchend=function(e,t,n){if((!this.centroid||e.timeStamp-this.startTime>po)&&(this.aborted=!0),n.length===0){var r=!this.aborted&&this.centroid;if(this.reset(),r)return r}};var go=function(e){this.singleTap=new ho(e),this.numTaps=e.numTaps,this.reset()};go.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},go.prototype.touchstart=function(e,t,n){this.singleTap.touchstart(e,t,n)},go.prototype.touchmove=function(e,t,n){this.singleTap.touchmove(e,t,n)},go.prototype.touchend=function(e,t,n){var r=this.singleTap.touchend(e,t,n);if(r){var i=e.timeStamp-this.lastTime<fo,a=!this.lastTap||this.lastTap.dist(r)<mo;if((!i||!a)&&this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}};var _o=function(){this._zoomIn=new go({numTouches:1,numTaps:2}),this._zoomOut=new go({numTouches:2,numTaps:1}),this.reset()};_o.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},_o.prototype.touchstart=function(e,t,n){this._zoomIn.touchstart(e,t,n),this._zoomOut.touchstart(e,t,n)},_o.prototype.touchmove=function(e,t,n){this._zoomIn.touchmove(e,t,n),this._zoomOut.touchmove(e,t,n)},_o.prototype.touchend=function(e,t,n){var r=this,i=this._zoomIn.touchend(e,t,n),a=this._zoomOut.touchend(e,t,n);if(i)return this._active=!0,e.preventDefault(),setTimeout(function(){return r.reset()},0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(i)},{originalEvent:e})}};if(a)return this._active=!0,e.preventDefault(),setTimeout(function(){return r.reset()},0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(a)},{originalEvent:e})}}},_o.prototype.touchcancel=function(){this.reset()},_o.prototype.enable=function(){this._enabled=!0},_o.prototype.disable=function(){this._enabled=!1,this.reset()},_o.prototype.isEnabled=function(){return this._enabled},_o.prototype.isActive=function(){return this._active};var vo=0,yo=2,bo={};bo[vo]=1,bo[yo]=2;function xo(e,t){var n=bo[t];return e.buttons===void 0||(e.buttons&n)!==n}var So=function(e){this.reset(),this._clickTolerance=e.clickTolerance||1};So.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},So.prototype._correctButton=function(e,t){return!1},So.prototype._move=function(e,t){return{}},So.prototype.mousedown=function(e,t){if(!this._lastPoint){var r=n.mouseButton(e);this._correctButton(e,r)&&(this._lastPoint=t,this._eventButton=r)}},So.prototype.mousemoveWindow=function(e,t){var n=this._lastPoint;if(n){if(e.preventDefault(),xo(e,this._eventButton)){this.reset();return}if(!(!this._moved&&t.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=t,this._move(n,t)}},So.prototype.mouseupWindow=function(e){this._lastPoint&&n.mouseButton(e)===this._eventButton&&(this._moved&&n.suppressClick(),this.reset())},So.prototype.enable=function(){this._enabled=!0},So.prototype.disable=function(){this._enabled=!1,this.reset()},So.prototype.isEnabled=function(){return this._enabled},So.prototype.isActive=function(){return this._active};var Co=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.mousedown=function(t,n){e.prototype.mousedown.call(this,t,n),this._lastPoint&&(this._active=!0)},t.prototype._correctButton=function(e,t){return t===vo&&!e.ctrlKey},t.prototype._move=function(e,t){return{around:t,panDelta:t.sub(e)}},t}(So),wo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._correctButton=function(e,t){return t===vo&&e.ctrlKey||t===yo},t.prototype._move=function(e,t){var n=(t.x-e.x)*.8;if(n)return this._active=!0,{bearingDelta:n}},t.prototype.contextmenu=function(e){e.preventDefault()},t}(So),To=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._correctButton=function(e,t){return t===vo&&e.ctrlKey||t===yo},t.prototype._move=function(e,t){var n=(t.y-e.y)*-.5;if(n)return this._active=!0,{pitchDelta:n}},t.prototype.contextmenu=function(e){e.preventDefault()},t}(So),Eo=function(e){this._minTouches=1,this._clickTolerance=e.clickTolerance||1,this.reset()};Eo.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new e.Point(0,0)},Eo.prototype.touchstart=function(e,t,n){return this._calculateTransform(e,t,n)},Eo.prototype.touchmove=function(e,t,n){if(!(!this._active||n.length<this._minTouches))return e.preventDefault(),this._calculateTransform(e,t,n)},Eo.prototype.touchend=function(e,t,n){this._calculateTransform(e,t,n),this._active&&n.length<this._minTouches&&this.reset()},Eo.prototype.touchcancel=function(){this.reset()},Eo.prototype._calculateTransform=function(t,n,r){r.length>0&&(this._active=!0);var i=lo(r,n),a=new e.Point(0,0),o=new e.Point(0,0),s=0;for(var c in i){var l=i[c],u=this._touches[c];u&&(a._add(l),o._add(l.sub(u)),s++,i[c]=l)}if(this._touches=i,!(s<this._minTouches||!o.mag())){var d=o.div(s);if(this._sum._add(d),!(this._sum.mag()<this._clickTolerance))return{around:a.div(s),panDelta:d}}},Eo.prototype.enable=function(){this._enabled=!0},Eo.prototype.disable=function(){this._enabled=!1,this.reset()},Eo.prototype.isEnabled=function(){return this._enabled},Eo.prototype.isActive=function(){return this._active};var Do=function(){this.reset()};Do.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Do.prototype._start=function(e){},Do.prototype._move=function(e,t,n){return{}},Do.prototype.touchstart=function(e,t,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([t[0],t[1]]))},Do.prototype.touchmove=function(e,t,n){if(this._firstTwoTouches){e.preventDefault();var r=this._firstTwoTouches,i=r[0],a=r[1],o=Oo(n,t,i),s=Oo(n,t,a);if(!(!o||!s)){var c=this._aroundCenter?null:o.add(s).div(2);return this._move([o,s],c,e)}}},Do.prototype.touchend=function(e,t,r){if(this._firstTwoTouches){var i=this._firstTwoTouches,a=i[0],o=i[1],s=Oo(r,t,a),c=Oo(r,t,o);s&&c||(this._active&&n.suppressClick(),this.reset())}},Do.prototype.touchcancel=function(){this.reset()},Do.prototype.enable=function(e){this._enabled=!0,this._aroundCenter=!!e&&e.around===`center`},Do.prototype.disable=function(){this._enabled=!1,this.reset()},Do.prototype.isEnabled=function(){return this._enabled},Do.prototype.isActive=function(){return this._active};function Oo(e,t,n){for(var r=0;r<e.length;r++)if(e[r].identifier===n)return t[r]}var ko=.1;function Ao(e,t){return Math.log(e/t)/Math.LN2}var jo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),delete this._distance,delete this._startDistance},t.prototype._start=function(e){this._startDistance=this._distance=e[0].dist(e[1])},t.prototype._move=function(e,t){var n=this._distance;if(this._distance=e[0].dist(e[1]),!(!this._active&&Math.abs(Ao(this._distance,this._startDistance))<ko))return this._active=!0,{zoomDelta:Ao(this._distance,n),pinchAround:t}},t}(Do),Mo=25;function No(e,t){return e.angleWith(t)*180/Math.PI}var Po=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},t.prototype._start=function(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])},t.prototype._move=function(e,t){var n=this._vector;if(this._vector=e[0].sub(e[1]),!(!this._active&&this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:No(this._vector,n),pinchAround:t}},t.prototype._isBelowThreshold=function(e){this._minDiameter=Math.min(this._minDiameter,e.mag());var t=Mo/(Math.PI*this._minDiameter)*360,n=No(e,this._startVector);return Math.abs(n)<t},t}(Do);function Fo(e){return Math.abs(e.y)>Math.abs(e.x)}var Io=100,Lo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},t.prototype._start=function(e){this._lastPoints=e,Fo(e[0].sub(e[1]))&&(this._valid=!1)},t.prototype._move=function(e,t,n){var r=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,i,n.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(r.y+i.y)/2*-.5}},t.prototype.gestureBeginsVertically=function(e,t,n){if(this._valid!==void 0)return this._valid;var r=2,i=e.mag()>=r,a=t.mag()>=r;if(!(!i&&!a)){if(!i||!a)return this._firstMove===void 0&&(this._firstMove=n),n-this._firstMove<Io?void 0:!1;var o=e.y>0==t.y>0;return Fo(e)&&Fo(t)&&o}},t}(Do),Ro={panStep:100,bearingStep:15,pitchStep:10},zo=function(){var e=Ro;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1};zo.prototype.reset=function(){this._active=!1},zo.prototype.keydown=function(e){var t=this;if(!(e.altKey||e.ctrlKey||e.metaKey)){var n=0,r=0,i=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:function(s){var c=s.getZoom();s.easeTo({duration:300,easeId:`keyboardHandler`,easing:Bo,zoom:n?Math.round(c)+n*(e.shiftKey?2:1):c,bearing:s.getBearing()+r*t._bearingStep,pitch:s.getPitch()+i*t._pitchStep,offset:[-a*t._panStep,-o*t._panStep],center:s.getCenter()},{originalEvent:e})}}}},zo.prototype.enable=function(){this._enabled=!0},zo.prototype.disable=function(){this._enabled=!1,this.reset()},zo.prototype.isEnabled=function(){return this._enabled},zo.prototype.isActive=function(){return this._active},zo.prototype.disableRotation=function(){this._rotationDisabled=!0},zo.prototype.enableRotation=function(){this._rotationDisabled=!1};function Bo(e){return e*(2-e)}var Vo=4.000244140625,Ho=1/100,Uo=1/450,Wo=2,Go=function(t,n){this._map=t,this._el=t.getCanvasContainer(),this._handler=n,this._delta=0,this._defaultZoomRate=Ho,this._wheelZoomRate=Uo,e.bindAll([`_onTimeout`],this)};Go.prototype.setZoomRate=function(e){this._defaultZoomRate=e},Go.prototype.setWheelZoomRate=function(e){this._wheelZoomRate=e},Go.prototype.isEnabled=function(){return!!this._enabled},Go.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Go.prototype.isZooming=function(){return!!this._zooming},Go.prototype.enable=function(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=e&&e.around===`center`)},Go.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Go.prototype.wheel=function(t){if(this.isEnabled()){var n=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?t.deltaY*40:t.deltaY,r=e.browser.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,n!==0&&n%Vo===0?this._type=`wheel`:n!==0&&Math.abs(n)<4?this._type=`trackpad`:i>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*n)<200?`trackpad`:`wheel`,this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}},Go.prototype._onTimeout=function(e){this._type=`wheel`,this._delta-=this._lastValue,this._active||this._start(e)},Go.prototype._start=function(t){if(this._delta){this._frameId&&=null,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var r=n.mousePos(this._el,t);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Go.prototype.renderFrame=function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var n=this._map.transform;if(this._delta!==0){var r=this._type===`wheel`&&Math.abs(this._delta)>Vo?this._wheelZoomRate:this._defaultZoomRate,i=Wo/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&i!==0&&(i=1/i);var a=typeof this._targetZoom==`number`?n.zoomScale(this._targetZoom):n.scale;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(a*i))),this._type===`wheel`&&(this._startZoom=n.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o=typeof this._targetZoom==`number`?this._targetZoom:n.zoom,s=this._startZoom,c=this._easing,l=!1,u;if(this._type===`wheel`&&s&&c){var d=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),f=c(d);u=e.number(s,o,f),d<1?this._frameId||=!0:l=!0}else u=o,l=!0;return this._active=!0,l&&(this._active=!1,this._finishTimeout=setTimeout(function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!l,zoomDelta:u-n.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Go.prototype._smoothOutEasing=function(t){var n=e.ease;if(this._prevEase){var r=this._prevEase,i=(e.browser.now()-r.start)/r.duration,a=r.easing(i+.01)-r.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.27*.27-o*o);n=e.bezier(o,s,.25,1)}return this._prevEase={start:e.browser.now(),duration:t,easing:n},n},Go.prototype.reset=function(){this._active=!1};var Ko=function(e,t){this._clickZoom=e,this._tapZoom=t};Ko.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Ko.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Ko.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Ko.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var qo=function(){this.reset()};qo.prototype.reset=function(){this._active=!1},qo.prototype.dblclick=function(e,t){return e.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(e.shiftKey?-1:1),around:n.unproject(t)},{originalEvent:e})}}},qo.prototype.enable=function(){this._enabled=!0},qo.prototype.disable=function(){this._enabled=!1,this.reset()},qo.prototype.isEnabled=function(){return this._enabled},qo.prototype.isActive=function(){return this._active};var Jo=function(){this._tap=new go({numTouches:1,numTaps:1}),this.reset()};Jo.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Jo.prototype.touchstart=function(e,t,n){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>fo&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=t[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(e,t,n))},Jo.prototype.touchmove=function(e,t,n){if(!this._tapTime)this._tap.touchmove(e,t,n);else if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var r=t[0],i=r.y-this._swipePoint.y;return this._swipePoint=r,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}},Jo.prototype.touchend=function(e,t,n){this._tapTime?this._swipePoint&&n.length===0&&this.reset():this._tap.touchend(e,t,n)&&(this._tapTime=e.timeStamp)},Jo.prototype.touchcancel=function(){this.reset()},Jo.prototype.enable=function(){this._enabled=!0},Jo.prototype.disable=function(){this._enabled=!1,this.reset()},Jo.prototype.isEnabled=function(){return this._enabled},Jo.prototype.isActive=function(){return this._active};var Yo=function(e,t,n){this._el=e,this._mousePan=t,this._touchPan=n};Yo.prototype.enable=function(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add(`mapboxgl-touch-drag-pan`)},Yo.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove(`mapboxgl-touch-drag-pan`)},Yo.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Yo.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Xo=function(e,t,n){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=n};Xo.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Xo.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Xo.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Xo.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Zo=function(e,t,n,r){this._el=e,this._touchZoom=t,this._touchRotate=n,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0};Zo.prototype.enable=function(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add(`mapboxgl-touch-zoom-rotate`)},Zo.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove(`mapboxgl-touch-zoom-rotate`)},Zo.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Zo.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Zo.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Zo.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Qo=function(e){return e.zoom||e.drag||e.pitch||e.rotate},$o=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(e.Event);function es(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}var ts=function(t,r){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new eo(t),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r),e.bindAll([`handleEvent`,`handleWindowEvent`],this);var i=this._el;this._listeners=[[i,`touchstart`,{passive:!0}],[i,`touchmove`,{passive:!1}],[i,`touchend`,void 0],[i,`touchcancel`,void 0],[i,`mousedown`,void 0],[i,`mousemove`,void 0],[i,`mouseup`,void 0],[e.window.document,`mousemove`,{capture:!0}],[e.window.document,`mouseup`,void 0],[i,`mouseover`,void 0],[i,`mouseout`,void 0],[i,`dblclick`,void 0],[i,`click`,void 0],[i,`keydown`,{capture:!1}],[i,`keyup`,void 0],[i,`wheel`,{passive:!1}],[i,`contextmenu`,void 0],[e.window,`blur`,void 0]];for(var a=0,o=this._listeners;a<o.length;a+=1){var s=o[a],c=s[0],l=s[1],u=s[2];n.addEventListener(c,l,c===e.window.document?this.handleWindowEvent:this.handleEvent,u)}};ts.prototype.destroy=function(){for(var t=0,r=this._listeners;t<r.length;t+=1){var i=r[t],a=i[0],o=i[1],s=i[2];n.removeEventListener(a,o,a===e.window.document?this.handleWindowEvent:this.handleEvent,s)}},ts.prototype._addDefaultHandlers=function(e){var t=this._map,n=t.getCanvasContainer();this._add(`mapEvent`,new oo(t,e));var r=t.boxZoom=new co(t,e);this._add(`boxZoom`,r);var i=new _o,a=new qo;t.doubleClickZoom=new Ko(a,i),this._add(`tapZoom`,i),this._add(`clickZoom`,a);var o=new Jo;this._add(`tapDragZoom`,o);var s=t.touchPitch=new Lo;this._add(`touchPitch`,s);var c=new wo(e),l=new To(e);t.dragRotate=new Xo(e,c,l),this._add(`mouseRotate`,c,[`mousePitch`]),this._add(`mousePitch`,l,[`mouseRotate`]);var u=new Co(e),d=new Eo(e);t.dragPan=new Yo(n,u,d),this._add(`mousePan`,u),this._add(`touchPan`,d,[`touchZoom`,`touchRotate`]);var f=new Po,p=new jo;t.touchZoomRotate=new Zo(n,p,f,o),this._add(`touchRotate`,f,[`touchPan`,`touchZoom`]),this._add(`touchZoom`,p,[`touchPan`,`touchRotate`]);var m=t.scrollZoom=new Go(t,this);this._add(`scrollZoom`,m,[`mousePan`]);var h=t.keyboard=new zo;this._add(`keyboard`,h),this._add(`blockableMapEvent`,new so(t));for(var g=0,_=[`boxZoom`,`doubleClickZoom`,`tapDragZoom`,`touchPitch`,`dragRotate`,`dragPan`,`touchZoomRotate`,`scrollZoom`,`keyboard`];g<_.length;g+=1){var v=_[g];e.interactive&&e[v]&&t[v].enable(e[v])}},ts.prototype._add=function(e,t,n){this._handlers.push({handlerName:e,handler:t,allowed:n}),this._handlersById[e]=t},ts.prototype.stop=function(e){if(!this._updatingCamera){for(var t=0,n=this._handlers;t<n.length;t+=1)n[t].handler.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}},ts.prototype.isActive=function(){for(var e=0,t=this._handlers;e<t.length;e+=1)if(t[e].handler.isActive())return!0;return!1},ts.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},ts.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},ts.prototype.isMoving=function(){return!!Qo(this._eventsInProgress)||this.isZooming()},ts.prototype._blockedByActive=function(e,t,n){for(var r in e)if(r!==n&&(!t||t.indexOf(r)<0))return!0;return!1},ts.prototype.handleWindowEvent=function(e){this.handleEvent(e,e.type+`Window`)},ts.prototype._getMapTouches=function(e){for(var t=[],n=0,r=e;n<r.length;n+=1){var i=r[n],a=i.target;this._el.contains(a)&&t.push(i)}return t},ts.prototype.handleEvent=function(e,t){if(e.type===`blur`){this.stop(!0);return}this._updatingCamera=!0;for(var r=e.type===`renderFrame`?void 0:e,i={needsRenderFrame:!1},a={},o={},s=e.touches?this._getMapTouches(e.touches):void 0,c=s?n.touchPos(this._el,s):n.mousePos(this._el,e),l=0,u=this._handlers;l<u.length;l+=1){var d=u[l],f=d.handlerName,p=d.handler,m=d.allowed;if(p.isEnabled()){var h=void 0;this._blockedByActive(o,m,f)?p.reset():p[t||e.type]&&(h=p[t||e.type](e,c,s),this.mergeHandlerResult(i,a,h,f,r),h&&h.needsRenderFrame&&this._triggerRenderFrame()),(h||p.isActive())&&(o[f]=p)}}var g={};for(var _ in this._previousActiveHandlers)o[_]||(g[_]=r);this._previousActiveHandlers=o,(Object.keys(g).length||es(i))&&(this._changes.push([i,a,g]),this._triggerRenderFrame()),(Object.keys(o).length||es(i))&&this._map._stop(!0),this._updatingCamera=!1;var v=i.cameraAnimation;v&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],v(this._map))},ts.prototype.mergeHandlerResult=function(t,n,r,i,a){if(r){e.extend(t,r);var o={handlerName:i,originalEvent:r.originalEvent||a};r.zoomDelta!==void 0&&(n.zoom=o),r.panDelta!==void 0&&(n.drag=o),r.pitchDelta!==void 0&&(n.pitch=o),r.bearingDelta!==void 0&&(n.rotate=o)}},ts.prototype._applyChanges=function(){for(var t={},n={},r={},i=0,a=this._changes;i<a.length;i+=1){var o=a[i],s=o[0],c=o[1],l=o[2];s.panDelta&&(t.panDelta=(t.panDelta||new e.Point(0,0))._add(s.panDelta)),s.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+s.pitchDelta),s.around!==void 0&&(t.around=s.around),s.pinchAround!==void 0&&(t.pinchAround=s.pinchAround),s.noInertia&&(t.noInertia=s.noInertia),e.extend(n,c),e.extend(r,l)}this._updateMapTransform(t,n,r),this._changes=[]},ts.prototype._updateMapTransform=function(e,t,n){var r=this._map,i=r.transform;if(!es(e))return this._fireEvents(t,n,!0);var a=e.panDelta,o=e.zoomDelta,s=e.bearingDelta,c=e.pitchDelta,l=e.around,u=e.pinchAround;u!==void 0&&(l=u),r._stop(!0),l||=r.transform.centerPoint;var d=i.pointLocation(a?l.sub(a):l);s&&(i.bearing+=s),c&&(i.pitch+=c),o&&(i.zoom+=o),i.setLocationAtPoint(d,l),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,n,!0)},ts.prototype._fireEvents=function(t,n,r){var i=this,a=Qo(this._eventsInProgress),o=Qo(t),s={};for(var c in t){var l=t[c].originalEvent;this._eventsInProgress[c]||(s[c+`start`]=l),this._eventsInProgress[c]=t[c]}for(var u in!a&&o&&this._fireEvent(`movestart`,o.originalEvent),s)this._fireEvent(u,s[u]);for(var d in o&&this._fireEvent(`move`,o.originalEvent),t){var f=t[d].originalEvent;this._fireEvent(d,f)}var p={},m;for(var h in this._eventsInProgress){var g=this._eventsInProgress[h],_=g.handlerName,v=g.originalEvent;this._handlersById[_].isActive()||(delete this._eventsInProgress[h],m=n[_]||v,p[h+`end`]=m)}for(var y in p)this._fireEvent(y,p[y]);var b=Qo(this._eventsInProgress);if(r&&(a||o)&&!b){this._updatingCamera=!0;var x=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),S=function(e){return e!==0&&-i._bearingSnap<e&&e<i._bearingSnap};x?(S(x.bearing||this._map.getBearing())&&(x.bearing=0),this._map.easeTo(x,{originalEvent:m})):(this._map.fire(new e.Event(`moveend`,{originalEvent:m})),S(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},ts.prototype._fireEvent=function(t,n){this._map.fire(new e.Event(t,n?{originalEvent:n}:{}))},ts.prototype._requestFrame=function(){var e=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(t){delete e._frameId,e.handleEvent(new $o(`renderFrame`,{timeStamp:t})),e._applyChanges()})},ts.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var ns=function(t){function n(n,r){t.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=r.bearingSnap,e.bindAll([`_renderFrameCallback`],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.getCenter=function(){return new e.LngLat(this.transform.center.lng,this.transform.center.lat)},n.prototype.setCenter=function(e,t){return this.jumpTo({center:e},t)},n.prototype.panBy=function(t,n,r){return t=e.Point.convert(t).mult(-1),this.panTo(this.transform.center,e.extend({offset:t},n),r)},n.prototype.panTo=function(t,n,r){return this.easeTo(e.extend({center:t},n),r)},n.prototype.getZoom=function(){return this.transform.zoom},n.prototype.setZoom=function(e,t){return this.jumpTo({zoom:e},t),this},n.prototype.zoomTo=function(t,n,r){return this.easeTo(e.extend({zoom:t},n),r)},n.prototype.zoomIn=function(e,t){return this.zoomTo(this.getZoom()+1,e,t),this},n.prototype.zoomOut=function(e,t){return this.zoomTo(this.getZoom()-1,e,t),this},n.prototype.getBearing=function(){return this.transform.bearing},n.prototype.setBearing=function(e,t){return this.jumpTo({bearing:e},t),this},n.prototype.getPadding=function(){return this.transform.padding},n.prototype.setPadding=function(e,t){return this.jumpTo({padding:e},t),this},n.prototype.rotateTo=function(t,n,r){return this.easeTo(e.extend({bearing:t},n),r)},n.prototype.resetNorth=function(t,n){return this.rotateTo(0,e.extend({duration:1e3},t),n),this},n.prototype.resetNorthPitch=function(t,n){return this.easeTo(e.extend({bearing:0,pitch:0,duration:1e3},t),n),this},n.prototype.snapToNorth=function(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this},n.prototype.getPitch=function(){return this.transform.pitch},n.prototype.setPitch=function(e,t){return this.jumpTo({pitch:e},t),this},n.prototype.cameraForBounds=function(t,n){t=e.LngLatBounds.convert(t);var r=n&&n.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),r,n)},n.prototype._cameraForBoxAndBearing=function(t,n,r,i){var a={top:0,bottom:0,right:0,left:0};if(i=e.extend({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},i),typeof i.padding==`number`){var o=i.padding;i.padding={top:o,bottom:o,right:o,left:o}}i.padding=e.extend(a,i.padding);var s=this.transform,c=s.padding,l=s.project(e.LngLat.convert(t)),u=s.project(e.LngLat.convert(n)),d=l.rotate(-r*Math.PI/180),f=u.rotate(-r*Math.PI/180),p=new e.Point(Math.max(d.x,f.x),Math.max(d.y,f.y)),m=new e.Point(Math.min(d.x,f.x),Math.min(d.y,f.y)),h=p.sub(m),g=(s.width-(c.left+c.right+i.padding.left+i.padding.right))/h.x,_=(s.height-(c.top+c.bottom+i.padding.top+i.padding.bottom))/h.y;if(_<0||g<0){e.warnOnce(`Map cannot fit within canvas with the given bounds, padding, and/or offset.`);return}var v=Math.min(s.scaleZoom(s.scale*Math.min(g,_)),i.maxZoom),y=typeof i.offset.x==`number`?new e.Point(i.offset.x,i.offset.y):e.Point.convert(i.offset),b=(i.padding.left-i.padding.right)/2,x=(i.padding.top-i.padding.bottom)/2,S=new e.Point(b,x).rotate(r*Math.PI/180),C=y.add(S).mult(s.scale/s.zoomScale(v));return{center:s.unproject(l.add(u).div(2).sub(C)),zoom:v,bearing:r}},n.prototype.fitBounds=function(e,t,n){return this._fitInternal(this.cameraForBounds(e,t),t,n)},n.prototype.fitScreenCoordinates=function(t,n,r,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.Point.convert(t)),this.transform.pointLocation(e.Point.convert(n)),r,i),i,a)},n.prototype._fitInternal=function(t,n,r){return t?(n=e.extend(t,n),delete n.padding,n.linear?this.easeTo(n,r):this.flyTo(n,r)):this},n.prototype.jumpTo=function(t,n){this.stop();var r=this.transform,i=!1,a=!1,o=!1;return`zoom`in t&&r.zoom!==+t.zoom&&(i=!0,r.zoom=+t.zoom),t.center!==void 0&&(r.center=e.LngLat.convert(t.center)),`bearing`in t&&r.bearing!==+t.bearing&&(a=!0,r.bearing=+t.bearing),`pitch`in t&&r.pitch!==+t.pitch&&(o=!0,r.pitch=+t.pitch),t.padding!=null&&!r.isPaddingEqual(t.padding)&&(r.padding=t.padding),this.fire(new e.Event(`movestart`,n)).fire(new e.Event(`move`,n)),i&&this.fire(new e.Event(`zoomstart`,n)).fire(new e.Event(`zoom`,n)).fire(new e.Event(`zoomend`,n)),a&&this.fire(new e.Event(`rotatestart`,n)).fire(new e.Event(`rotate`,n)).fire(new e.Event(`rotateend`,n)),o&&this.fire(new e.Event(`pitchstart`,n)).fire(new e.Event(`pitch`,n)).fire(new e.Event(`pitchend`,n)),this.fire(new e.Event(`moveend`,n))},n.prototype.easeTo=function(t,n){var r=this;this._stop(!1,t.easeId),t=e.extend({offset:[0,0],duration:500,easing:e.ease},t),(t.animate===!1||!t.essential&&e.browser.prefersReducedMotion)&&(t.duration=0);var i=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),c=this.getPadding(),l=`zoom`in t?+t.zoom:a,u=`bearing`in t?this._normalizeBearing(t.bearing,o):o,d=`pitch`in t?+t.pitch:s,f=`padding`in t?t.padding:i.padding,p=e.Point.convert(t.offset),m=i.centerPoint.add(p),h=i.pointLocation(m),g=e.LngLat.convert(t.center||h);this._normalizeCenter(g);var _=i.project(h),v=i.project(g).sub(_),y=i.zoomScale(l-a),b,x;t.around&&(b=e.LngLat.convert(t.around),x=i.locationPoint(b));var S={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||l!==a,this._rotating=this._rotating||o!==u,this._pitching=this._pitching||d!==s,this._padding=!i.isPaddingEqual(f),this._easeId=t.easeId,this._prepareEase(n,t.noMoveStart,S),this._ease(function(t){if(r._zooming&&(i.zoom=e.number(a,l,t)),r._rotating&&(i.bearing=e.number(o,u,t)),r._pitching&&(i.pitch=e.number(s,d,t)),r._padding&&(i.interpolatePadding(c,f,t),m=i.centerPoint.add(p)),b)i.setLocationAtPoint(b,x);else{var h=i.zoomScale(i.zoom-a),g=(l>a?Math.min(2,y):Math.max(.5,y))**(1-t),S=i.unproject(_.add(v.mult(t*g)).mult(h));i.setLocationAtPoint(i.renderWorldCopies?S.wrap():S,m)}r._fireMoveEvents(n)},function(e){r._afterEase(n,e)},t),this},n.prototype._prepareEase=function(t,n,r){r===void 0&&(r={}),this._moving=!0,!n&&!r.moving&&this.fire(new e.Event(`movestart`,t)),this._zooming&&!r.zooming&&this.fire(new e.Event(`zoomstart`,t)),this._rotating&&!r.rotating&&this.fire(new e.Event(`rotatestart`,t)),this._pitching&&!r.pitching&&this.fire(new e.Event(`pitchstart`,t))},n.prototype._fireMoveEvents=function(t){this.fire(new e.Event(`move`,t)),this._zooming&&this.fire(new e.Event(`zoom`,t)),this._rotating&&this.fire(new e.Event(`rotate`,t)),this._pitching&&this.fire(new e.Event(`pitch`,t))},n.prototype._afterEase=function(t,n){if(!(this._easeId&&n&&this._easeId===n)){delete this._easeId;var r=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,r&&this.fire(new e.Event(`zoomend`,t)),i&&this.fire(new e.Event(`rotateend`,t)),a&&this.fire(new e.Event(`pitchend`,t)),this.fire(new e.Event(`moveend`,t))}},n.prototype.flyTo=function(t,n){var r=this;if(!t.essential&&e.browser.prefersReducedMotion){var i=e.pick(t,[`center`,`zoom`,`bearing`,`pitch`,`around`]);return this.jumpTo(i,n)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);var a=this.transform,o=this.getZoom(),s=this.getBearing(),c=this.getPitch(),l=this.getPadding(),u=`zoom`in t?e.clamp(+t.zoom,a.minZoom,a.maxZoom):o,d=`bearing`in t?this._normalizeBearing(t.bearing,s):s,f=`pitch`in t?+t.pitch:c,p=`padding`in t?t.padding:a.padding,m=a.zoomScale(u-o),h=e.Point.convert(t.offset),g=a.centerPoint.add(h),_=a.pointLocation(g),v=e.LngLat.convert(t.center||_);this._normalizeCenter(v);var y=a.project(_),b=a.project(v).sub(y),x=t.curve,S=Math.max(a.width,a.height),C=S/m,w=b.mag();if(`minZoom`in t){var T=e.clamp(Math.min(t.minZoom,o,u),a.minZoom,a.maxZoom),E=S/a.zoomScale(T-o);x=Math.sqrt(E/w*2)}var D=x*x;function O(e){var t=(C*C-S*S+(e?-1:1)*D*D*w*w)/(2*(e?C:S)*D*w);return Math.log(Math.sqrt(t*t+1)-t)}function k(e){return(Math.exp(e)-Math.exp(-e))/2}function A(e){return(Math.exp(e)+Math.exp(-e))/2}function j(e){return k(e)/A(e)}var M=O(0),N=function(e){return A(M)/A(M+x*e)},P=function(e){return S*((A(M)*j(M+x*e)-k(M))/D)/w},F=(O(1)-M)/x;if(Math.abs(w)<1e-6||!isFinite(F)){if(Math.abs(S-C)<1e-6)return this.easeTo(t,n);var I=C<S?-1:1;F=Math.abs(Math.log(C/S))/x,P=function(){return 0},N=function(e){return Math.exp(I*x*e)}}if(`duration`in t)t.duration=+t.duration;else{var L=`screenSpeed`in t?+t.screenSpeed/x:+t.speed;t.duration=1e3*F/L}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==d,this._pitching=f!==c,this._padding=!a.isPaddingEqual(p),this._prepareEase(n,!1),this._ease(function(t){var i=t*F,m=1/N(i);a.zoom=t===1?u:o+a.scaleZoom(m),r._rotating&&(a.bearing=e.number(s,d,t)),r._pitching&&(a.pitch=e.number(c,f,t)),r._padding&&(a.interpolatePadding(l,p,t),g=a.centerPoint.add(h));var _=t===1?v:a.unproject(y.add(b.mult(P(i))).mult(m));a.setLocationAtPoint(a.renderWorldCopies?_.wrap():_,g),r._fireMoveEvents(n)},function(){return r._afterEase(n)},t),this},n.prototype.isEasing=function(){return!!this._easeFrameId},n.prototype.stop=function(){return this._stop()},n.prototype._stop=function(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var n=this._onEaseEnd;delete this._onEaseEnd,n.call(this,t)}if(!e){var r=this.handlers;r&&r.stop(!1)}return this},n.prototype._ease=function(t,n,r){r.animate===!1||r.duration===0?(t(1),n()):(this._easeStart=e.browser.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},n.prototype._renderFrameCallback=function(){var t=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},n.prototype._normalizeBearing=function(t,n){t=e.wrap(t,-180,180);var r=Math.abs(t-n);return Math.abs(t-360-n)<r&&(t-=360),Math.abs(t+360-n)<r&&(t+=360),t},n.prototype._normalizeCenter=function(e){var t=this.transform;if(!(!t.renderWorldCopies||t.lngRange)){var n=e.lng-t.center.lng;e.lng+=n>180?-360:n<-180?360:0}},n}(e.Evented),rs=function(t){t===void 0&&(t={}),this.options=t,e.bindAll([`_toggleAttribution`,`_updateEditLink`,`_updateData`,`_updateCompact`],this)};rs.prototype.getDefaultPosition=function(){return`bottom-right`},rs.prototype.onAdd=function(e){var t=this.options&&this.options.compact;return this._map=e,this._container=n.create(`div`,`mapboxgl-ctrl mapboxgl-ctrl-attrib`),this._compactButton=n.create(`button`,`mapboxgl-ctrl-attrib-button`,this._container),this._compactButton.addEventListener(`click`,this._toggleAttribution),this._setElementTitle(this._compactButton,`ToggleAttribution`),this._innerContainer=n.create(`div`,`mapboxgl-ctrl-attrib-inner`,this._container),this._innerContainer.setAttribute(`role`,`list`),t&&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),t===void 0&&(this._map.on(`resize`,this._updateCompact),this._updateCompact()),this._container},rs.prototype.onRemove=function(){n.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},rs.prototype._setElementTitle=function(e,t){var n=this._map._getUIString(`AttributionControl.`+t);e.title=n,e.setAttribute(`aria-label`,n)},rs.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`))},rs.prototype._updateEditLink=function(){var t=this._editLink;t||=this._editLink=this._container.querySelector(`.mapbox-improve-map`);var n=[{key:`owner`,value:this.styleOwner},{key:`id`,value:this.styleId},{key:`access_token`,value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(t){var r=n.reduce(function(e,t,r){return t.value&&(e+=t.key+`=`+t.value+(r<n.length-1?`&`:``)),e},`?`);t.href=e.config.FEEDBACK_URL+`/`+r+(this._map._hash?this._map._hash.getHashString(!0):``),t.rel=`noopener nofollow`,this._setElementTitle(t,`MapFeedback`)}},rs.prototype._updateData=function(e){e&&(e.sourceDataType===`metadata`||e.sourceDataType===`visibility`||e.dataType===`style`)&&(this._updateAttributions(),this._updateEditLink())},rs.prototype._updateAttributions=function(){if(this._map.style){var e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(function(e){return typeof e==`string`?e:``})):typeof this.options.customAttribution==`string`&&e.push(this.options.customAttribution)),this._map.style.stylesheet){var t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}var n=this._map.style.sourceCaches;for(var r in n){var i=n[r];if(i.used){var a=i.getSource();a.attribution&&e.indexOf(a.attribution)<0&&e.push(a.attribution)}}e.sort(function(e,t){return e.length-t.length}),e=e.filter(function(t,n){for(var r=n+1;r<e.length;r++)if(e[r].indexOf(t)>=0)return!1;return!0});var o=e.join(` | `);o!==this._attribHTML&&(this._attribHTML=o,e.length?(this._innerContainer.innerHTML=o,this._container.classList.remove(`mapboxgl-attrib-empty`)):this._container.classList.add(`mapboxgl-attrib-empty`),this._editLink=null)}},rs.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add(`mapboxgl-compact`):this._container.classList.remove(`mapboxgl-compact`,`mapboxgl-compact-show`)};var is=function(){e.bindAll([`_updateLogo`],this),e.bindAll([`_updateCompact`],this)};is.prototype.onAdd=function(e){this._map=e,this._container=n.create(`div`,`mapboxgl-ctrl`);var t=n.create(`a`,`mapboxgl-ctrl-logo`);return t.target=`_blank`,t.rel=`noopener nofollow`,t.href=`https://www.mapbox.com/`,t.setAttribute(`aria-label`,this._map._getUIString(`LogoControl.Title`)),t.setAttribute(`rel`,`noopener nofollow`),this._container.appendChild(t),this._container.style.display=`none`,this._map.on(`sourcedata`,this._updateLogo),this._updateLogo(),this._map.on(`resize`,this._updateCompact),this._updateCompact(),this._container},is.prototype.onRemove=function(){n.remove(this._container),this._map.off(`sourcedata`,this._updateLogo),this._map.off(`resize`,this._updateCompact)},is.prototype.getDefaultPosition=function(){return`bottom-left`},is.prototype._updateLogo=function(e){(!e||e.sourceDataType===`metadata`)&&(this._container.style.display=this._logoRequired()?`block`:`none`)},is.prototype._logoRequired=function(){if(this._map.style){var e=this._map.style.sourceCaches;for(var t in e)if(e[t].getSource().mapbox_logo)return!0;return!1}},is.prototype._updateCompact=function(){var e=this._container.children;if(e.length){var t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add(`mapboxgl-compact`):t.classList.remove(`mapboxgl-compact`)}};var as=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};as.prototype.add=function(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t},as.prototype.remove=function(e){for(var t=this._currentlyRunning,n=t?this._queue.concat(t):this._queue,r=0,i=n;r<i.length;r+=1){var a=i[r];if(a.id===e){a.cancelled=!0;return}}},as.prototype.run=function(e){e===void 0&&(e=0);var t=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,r=t;n<r.length;n+=1){var i=r[n];if(!i.cancelled&&(i.callback(e),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},as.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var os={"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`},ss=e.window.HTMLImageElement,cs=e.window.HTMLElement,ls=e.window.ImageBitmap,us=-2,ds=22,fs=0,ps=60,ms={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:us,maxZoom:ds,minPitch:fs,maxPitch:ps,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},hs=function(r){function i(t){var n=this;if(t=e.extend({},ms,t),t.minZoom!=null&&t.maxZoom!=null&&t.minZoom>t.maxZoom)throw Error(`maxZoom must be greater than or equal to minZoom`);if(t.minPitch!=null&&t.maxPitch!=null&&t.minPitch>t.maxPitch)throw Error(`maxPitch must be greater than or equal to minPitch`);if(t.minPitch!=null&&t.minPitch<fs)throw Error(`minPitch must be greater than or equal to `+fs);if(t.maxPitch!=null&&t.maxPitch>ps)throw Error(`maxPitch must be less than or equal to `+ps);var i=new Ga(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies);if(r.call(this,i,t),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new as,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},os,t.locale),this._clickTolerance=t.clickTolerance,this._requestManager=new e.RequestManager(t.transformRequest,t.accessToken),typeof t.container==`string`){if(this._container=e.window.document.getElementById(t.container),!this._container)throw Error(`Container '`+t.container+`' not found.`)}else if(t.container instanceof cs)this._container=t.container;else throw Error(`Invalid type: 'container' must be a String or HTMLElement.`);if(t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll([`_onWindowOnline`,`_onWindowResize`,`_onMapScroll`,`_contextLost`,`_contextRestored`],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw Error(`Failed to initialize WebGL.`);this.on(`move`,function(){return n._update(!1)}),this.on(`moveend`,function(){return n._update(!1)}),this.on(`zoom`,function(){return n._update(!0)}),e.window!==void 0&&(e.window.addEventListener(`online`,this._onWindowOnline,!1),e.window.addEventListener(`resize`,this._onWindowResize,!1),e.window.addEventListener(`orientationchange`,this._onWindowResize,!1)),this.handlers=new ts(this,t);var a=typeof t.hash==`string`&&t.hash||void 0;this._hash=t.hash&&new Ja(a).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new rs({customAttribution:t.customAttribution})),this.addControl(new is,t.logoPosition),this.on(`style.load`,function(){n.transform.unmodified&&n.jumpTo(n.style.stylesheet)}),this.on(`data`,function(t){n._update(t.dataType===`style`),n.fire(new e.Event(t.dataType+`data`,t))}),this.on(`dataloading`,function(t){n.fire(new e.Event(t.dataType+`dataloading`,t))})}r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(t,n){if(n===void 0&&(n=t.getDefaultPosition?t.getDefaultPosition():`top-right`),!t||!t.onAdd)return this.fire(new e.ErrorEvent(Error(`Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.`)));var r=t.onAdd(this);this._controls.push(t);var i=this._controlPositions[n];return n.indexOf(`bottom`)===-1?i.appendChild(r):i.insertBefore(r,i.firstChild),this},i.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(Error(`Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.`)));var n=this._controls.indexOf(t);return n>-1&&this._controls.splice(n,1),t.onRemove(this),this},i.prototype.hasControl=function(e){return this._controls.indexOf(e)>-1},i.prototype.resize=function(t){var n=this._containerDimensions(),r=n[0],i=n[1];this._resizeCanvas(r,i),this.transform.resize(r,i),this.painter.resize(r,i);var a=!this._moving;return a&&(this.stop(),this.fire(new e.Event(`movestart`,t)).fire(new e.Event(`move`,t))),this.fire(new e.Event(`resize`,t)),a&&this.fire(new e.Event(`moveend`,t)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()},i.prototype.setMinZoom=function(e){if(e??=us,e>=us&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw Error(`minZoom must be between `+us+` and the current maxZoom, inclusive`)},i.prototype.getMinZoom=function(){return this.transform.minZoom},i.prototype.setMaxZoom=function(e){if(e??=ds,e>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw Error(`maxZoom must be greater than the current minZoom`)},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(e){if(e??=fs,e<fs)throw Error(`minPitch must be greater than or equal to `+fs);if(e>=fs&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()<e&&this.setPitch(e),this;throw Error(`minPitch must be between `+fs+` and the current maxPitch, inclusive`)},i.prototype.getMinPitch=function(){return this.transform.minPitch},i.prototype.setMaxPitch=function(e){if(e??=ps,e>ps)throw Error(`maxPitch must be less than or equal to `+ps);if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw Error(`maxPitch must be greater than the current minPitch`)},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(e){return this.transform.renderWorldCopies=e,this._update()},i.prototype.project=function(t){return this.transform.locationPoint(e.LngLat.convert(t))},i.prototype.unproject=function(t){return this.transform.pointLocation(e.Point.convert(t))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(e,t,n){var r=this,i;if(e===`mouseenter`||e===`mouseover`){var a=!1;return{layer:t,listener:n,delegates:{mousemove:function(i){var o=r.getLayer(t)?r.queryRenderedFeatures(i.point,{layers:[t]}):[];o.length?a||(a=!0,n.call(r,new ro(e,r,i.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}else if(e===`mouseleave`||e===`mouseout`){var o=!1;return{layer:t,listener:n,delegates:{mousemove:function(i){(r.getLayer(t)?r.queryRenderedFeatures(i.point,{layers:[t]}):[]).length?o=!0:o&&(o=!1,n.call(r,new ro(e,r,i.originalEvent)))},mouseout:function(t){o&&(o=!1,n.call(r,new ro(e,r,t.originalEvent)))}}}}else return{layer:t,listener:n,delegates:(i={},i[e]=function(e){var i=r.getLayer(t)?r.queryRenderedFeatures(e.point,{layers:[t]}):[];i.length&&(e.features=i,n.call(r,e),delete e.features)},i)}},i.prototype.on=function(e,t,n){if(n===void 0)return r.prototype.on.call(this,e,t);var i=this._createDelegatedListener(e,t,n);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(e,t,n){if(n===void 0)return r.prototype.once.call(this,e,t);var i=this._createDelegatedListener(e,t,n);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(e,t,n){var i=this;return n===void 0?r.prototype.off.call(this,e,t):(this._delegatedListeners&&this._delegatedListeners[e]&&function(r){for(var a=r[e],o=0;o<a.length;o++){var s=a[o];if(s.layer===t&&s.listener===n){for(var c in s.delegates)i.off(c,s.delegates[c]);return a.splice(o,1),i}}}(this._delegatedListeners),this)},i.prototype.queryRenderedFeatures=function(t,n){if(!this.style)return[];n===void 0&&t!==void 0&&!(t instanceof e.Point)&&!Array.isArray(t)&&(n=t,t=void 0),n||={},t||=[[0,0],[this.transform.width,this.transform.height]];var r;if(t instanceof e.Point||typeof t[0]==`number`)r=[e.Point.convert(t)];else{var i=e.Point.convert(t[0]),a=e.Point.convert(t[1]);r=[i,new e.Point(a.x,i.y),a,new e.Point(i.x,a.y),i]}return this.style.queryRenderedFeatures(r,n,this.transform)},i.prototype.querySourceFeatures=function(e,t){return this.style.querySourceFeatures(e,t)},i.prototype.setStyle=function(t,n){return n=e.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},n),n.diff!==!1&&n.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._updateStyle(t,n))},i.prototype._getUIString=function(e){var t=this._locale[e];if(t==null)throw Error(`Missing UI string '`+e+`'`);return t},i.prototype._updateStyle=function(e,t){if(this.style&&(this.style.setEventedParent(null),this.style._remove()),e)this.style=new _n(this,t||{});else return delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),typeof e==`string`?this.style.loadURL(e):this.style.loadJSON(e),this},i.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new _n(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},i.prototype._diffStyle=function(t,n){var r=this;if(typeof t==`string`){var i=this._requestManager.normalizeStyleURL(t),a=this._requestManager.transformRequest(i,e.ResourceType.Style);e.getJSON(a,function(t,i){t?r.fire(new e.ErrorEvent(t)):i&&r._updateDiff(i,n)})}else typeof t==`object`&&this._updateDiff(t,n)},i.prototype._updateDiff=function(t,n){try{this.style.setState(t)&&this._update(!0)}catch(r){e.warnOnce(`Unable to perform style diff: `+(r.message||r.error||r)+`. Rebuilding the style from scratch.`),this._updateStyle(t,n)}},i.prototype.getStyle=function(){if(this.style)return this.style.serialize()},i.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():e.warnOnce(`There is no style added to the map.`)},i.prototype.addSource=function(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)},i.prototype.isSourceLoaded=function(t){var n=this.style&&this.style.sourceCaches[t];if(n===void 0){this.fire(new e.ErrorEvent(Error(`There is no source with ID '`+t+`'`)));return}return n.loaded()},i.prototype.areTilesLoaded=function(){var e=this.style&&this.style.sourceCaches;for(var t in e){var n=e[t]._tiles;for(var r in n){var i=n[r];if(!(i.state===`loaded`||i.state===`errored`))return!1}}return!0},i.prototype.addSourceType=function(e,t,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,n)},i.prototype.removeSource=function(e){return this.style.removeSource(e),this._update(!0)},i.prototype.getSource=function(e){return this.style.getSource(e)},i.prototype.addImage=function(t,n,r){r===void 0&&(r={});var i=r.pixelRatio;i===void 0&&(i=1);var a=r.sdf;a===void 0&&(a=!1);var o=r.stretchX,s=r.stretchY,c=r.content;this._lazyInitEmptyStyle();var l=0;if(n instanceof ss||ls&&n instanceof ls){var u=e.browser.getImageData(n),d=u.width,f=u.height,p=u.data;this.style.addImage(t,{data:new e.RGBAImage({width:d,height:f},p),pixelRatio:i,stretchX:o,stretchY:s,content:c,sdf:a,version:l})}else{if(n.width===void 0||n.height===void 0)return this.fire(new e.ErrorEvent(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 m=n.width,h=n.height,g=n.data,_=n;this.style.addImage(t,{data:new e.RGBAImage({width:m,height:h},new Uint8Array(g)),pixelRatio:i,stretchX:o,stretchY:s,content:c,sdf:a,version:l,userImage:_}),_.onAdd&&_.onAdd(this,t)}},i.prototype.updateImage=function(t,n){var r=this.style.getImage(t);if(!r)return this.fire(new e.ErrorEvent(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var i=n instanceof ss||ls&&n instanceof ls?e.browser.getImageData(n):n,a=i.width,o=i.height,s=i.data;if(a===void 0||o===void 0)return this.fire(new e.ErrorEvent(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(a!==r.data.width||o!==r.data.height)return this.fire(new e.ErrorEvent(Error(`The width and height of the updated image must be that same as the previous version of the image`)));var c=!(n instanceof ss||ls&&n instanceof ls);r.data.replace(s,c),this.style.updateImage(t,r)},i.prototype.hasImage=function(t){return t?!!this.style.getImage(t):(this.fire(new e.ErrorEvent(Error(`Missing required image id`))),!1)},i.prototype.removeImage=function(e){this.style.removeImage(e)},i.prototype.loadImage=function(t,n){e.getImage(this._requestManager.transformRequest(t,e.ResourceType.Image),n)},i.prototype.listImages=function(){return this.style.listImages()},i.prototype.addLayer=function(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)},i.prototype.moveLayer=function(e,t){return this.style.moveLayer(e,t),this._update(!0)},i.prototype.removeLayer=function(e){return this.style.removeLayer(e),this._update(!0)},i.prototype.getLayer=function(e){return this.style.getLayer(e)},i.prototype.setLayerZoomRange=function(e,t,n){return this.style.setLayerZoomRange(e,t,n),this._update(!0)},i.prototype.setFilter=function(e,t,n){return n===void 0&&(n={}),this.style.setFilter(e,t,n),this._update(!0)},i.prototype.getFilter=function(e){return this.style.getFilter(e)},i.prototype.setPaintProperty=function(e,t,n,r){return r===void 0&&(r={}),this.style.setPaintProperty(e,t,n,r),this._update(!0)},i.prototype.getPaintProperty=function(e,t){return this.style.getPaintProperty(e,t)},i.prototype.setLayoutProperty=function(e,t,n,r){return r===void 0&&(r={}),this.style.setLayoutProperty(e,t,n,r),this._update(!0)},i.prototype.getLayoutProperty=function(e,t){return this.style.getLayoutProperty(e,t)},i.prototype.setLight=function(e,t){return t===void 0&&(t={}),this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)},i.prototype.getLight=function(){return this.style.getLight()},i.prototype.setFeatureState=function(e,t){return this.style.setFeatureState(e,t),this._update()},i.prototype.removeFeatureState=function(e,t){return this.style.removeFeatureState(e,t),this._update()},i.prototype.getFeatureState=function(e){return this.style.getFeatureState(e)},i.prototype.getContainer=function(){return this._container},i.prototype.getCanvasContainer=function(){return this._canvasContainer},i.prototype.getCanvas=function(){return this._canvas},i.prototype._containerDimensions=function(){var e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]},i.prototype._detectMissingCSS=function(){e.window.getComputedStyle(this._missingCSSCanary).getPropertyValue(`background-color`)!==`rgb(250, 128, 114)`&&e.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/.`)},i.prototype._setupContainer=function(){var e=this._container;e.classList.add(`mapboxgl-map`);var t=this._missingCSSCanary=n.create(`div`,`mapboxgl-canary`,e);t.style.visibility=`hidden`,this._detectMissingCSS();var r=this._canvasContainer=n.create(`div`,`mapboxgl-canvas-container`,e);this._interactive&&r.classList.add(`mapboxgl-interactive`),this._canvas=n.create(`canvas`,`mapboxgl-canvas`,r),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 i=this._containerDimensions();this._resizeCanvas(i[0],i[1]);var a=this._controlContainer=n.create(`div`,`mapboxgl-control-container`,e),o=this._controlPositions={};[`top-left`,`top-right`,`bottom-left`,`bottom-right`].forEach(function(e){o[e]=n.create(`div`,`mapboxgl-ctrl-`+e,a)}),this._container.addEventListener(`scroll`,this._onMapScroll,!1)},i.prototype._resizeCanvas=function(t,n){var r=e.browser.devicePixelRatio||1;this._canvas.width=r*t,this._canvas.height=r*n,this._canvas.style.width=t+`px`,this._canvas.style.height=n+`px`},i.prototype._setupPainter=function(){var n=e.extend({},t.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._canvas.getContext(`webgl`,n)||this._canvas.getContext(`experimental-webgl`,n);if(!r){this.fire(new e.ErrorEvent(Error(`Failed to initialize WebGL`)));return}this.painter=new Va(r,this.transform),e.webpSupported.testSupport(r)},i.prototype._contextLost=function(t){t.preventDefault(),this._frame&&=(this._frame.cancel(),null),this.fire(new e.Event(`webglcontextlost`,{originalEvent:t}))},i.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire(new e.Event(`webglcontextrestored`,{originalEvent:t}))},i.prototype._onMapScroll=function(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},i.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},i.prototype._update=function(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this},i.prototype._requestRenderFrame=function(e){return this._update(),this._renderTaskQueue.add(e)},i.prototype._cancelRenderFrame=function(e){this._renderTaskQueue.remove(e)},i.prototype._render=function(t){var n=this,r,i=0,a=this.painter.context.extTimerQuery;if(this.listens(`gpu-timing-frame`)&&(r=a.createQueryEXT(),a.beginQueryEXT(a.TIME_ELAPSED_EXT,r),i=e.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),!this._removed){var o=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var s=this.transform.zoom,c=e.browser.now();this.style.zoomHistory.update(s,c);var l=new e.EvaluationParameters(s,{now:c,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),u=l.crossFadingFactor();(u!==1||u!==this._crossFadingFactor)&&(o=!0,this._crossFadingFactor=u),this.style.update(l)}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 e.Event(`render`)),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new e.Event(`load`))),this.style&&(this.style.hasTransitions()||o)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens(`gpu-timing-frame`)){var d=e.browser.now()-i;a.endQueryEXT(a.TIME_ELAPSED_EXT,r),setTimeout(function(){var t=a.getQueryObjectEXT(r,a.QUERY_RESULT_EXT)/1e6;a.deleteQueryEXT(r),n.fire(new e.Event(`gpu-timing-frame`,{cpuTime:d,gpuTime:t}))},50)}if(this.listens(`gpu-timing-layer`)){var f=this.painter.collectGpuTimers();setTimeout(function(){var t=n.painter.queryGpuTimers(f);n.fire(new e.Event(`gpu-timing-layer`,{layerTimes:t}))},50)}var p=this._sourcesDirty||this._styleDirty||this._placementDirty;return p||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.Event(`idle`)),this._loaded&&!this._fullyLoaded&&!p&&(this._fullyLoaded=!0),this}},i.prototype.remove=function(){this._hash&&this._hash.remove();for(var t=0,n=this._controls;t<n.length;t+=1)n[t].onRemove(this);this._controls=[],this._frame&&=(this._frame.cancel(),null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),e.window!==void 0&&(e.window.removeEventListener(`resize`,this._onWindowResize,!1),e.window.removeEventListener(`orientationchange`,this._onWindowResize,!1),e.window.removeEventListener(`online`,this._onWindowOnline,!1));var r=this.painter.context.gl.getExtension(`WEBGL_lose_context`);r&&r.loseContext&&r.loseContext(),gs(this._canvasContainer),gs(this._controlContainer),gs(this._missingCSSCanary),this._container.classList.remove(`mapboxgl-map`),this._removed=!0,this.fire(new e.Event(`remove`))},i.prototype.triggerRepaint=function(){var t=this;this.style&&!this._frame&&(this._frame=e.browser.frame(function(e){t._frame=null,t._render(e)}))},i.prototype._onWindowOnline=function(){this._update()},i.prototype._onWindowResize=function(e){this._trackResize&&this.resize({originalEvent:e})._update()},a.showTileBoundaries.get=function(){return!!this._showTileBoundaries},a.showTileBoundaries.set=function(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())},a.showPadding.get=function(){return!!this._showPadding},a.showPadding.set=function(e){this._showPadding!==e&&(this._showPadding=e,this._update())},a.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},a.showCollisionBoxes.set=function(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())},a.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},a.showOverdrawInspector.set=function(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())},a.repaint.get=function(){return!!this._repaint},a.repaint.set=function(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())},a.vertices.get=function(){return!!this._vertices},a.vertices.set=function(e){this._vertices=e,this._update()},i.prototype._setCacheLimits=function(t,n){e.setCacheLimits(t,n)},a.version.get=function(){return e.version},Object.defineProperties(i.prototype,a),i}(ns);function gs(e){e.parentNode&&e.parentNode.removeChild(e)}var _s={showCompass:!0,showZoom:!0,visualizePitch:!1},vs=function(t){var r=this;this.options=e.extend({},_s,t),this._container=n.create(`div`,`mapboxgl-ctrl mapboxgl-ctrl-group`),this._container.addEventListener(`contextmenu`,function(e){return e.preventDefault()}),this.options.showZoom&&(e.bindAll([`_setButtonTitle`,`_updateZoomButtons`],this),this._zoomInButton=this._createButton(`mapboxgl-ctrl-zoom-in`,function(e){return r._map.zoomIn({},{originalEvent:e})}),n.create(`span`,`mapboxgl-ctrl-icon`,this._zoomInButton).setAttribute(`aria-hidden`,!0),this._zoomOutButton=this._createButton(`mapboxgl-ctrl-zoom-out`,function(e){return r._map.zoomOut({},{originalEvent:e})}),n.create(`span`,`mapboxgl-ctrl-icon`,this._zoomOutButton).setAttribute(`aria-hidden`,!0)),this.options.showCompass&&(e.bindAll([`_rotateCompassArrow`],this),this._compass=this._createButton(`mapboxgl-ctrl-compass`,function(e){r.options.visualizePitch?r._map.resetNorthPitch({},{originalEvent:e}):r._map.resetNorth({},{originalEvent:e})}),this._compassIcon=n.create(`span`,`mapboxgl-ctrl-icon`,this._compass),this._compassIcon.setAttribute(`aria-hidden`,!0))};vs.prototype._updateZoomButtons=function(){var e=this._map.getZoom(),t=e===this._map.getMaxZoom(),n=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute(`aria-disabled`,t.toString()),this._zoomOutButton.setAttribute(`aria-disabled`,n.toString())},vs.prototype._rotateCompassArrow=function(){var e=this.options.visualizePitch?`scale(`+1/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=e},vs.prototype.onAdd=function(e){return this._map=e,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 ys(this._map,this._compass,this.options.visualizePitch)),this._container},vs.prototype.onRemove=function(){n.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},vs.prototype._createButton=function(e,t){var r=n.create(`button`,e,this._container);return r.type=`button`,r.addEventListener(`click`,t),r},vs.prototype._setButtonTitle=function(e,t){var n=this._map._getUIString(`NavigationControl.`+t);e.title=n,e.setAttribute(`aria-label`,n)};var ys=function(t,r,i){i===void 0&&(i=!1),this._clickTolerance=10,this.element=r,this.mouseRotate=new wo({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,i&&(this.mousePitch=new To({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.bindAll([`mousedown`,`mousemove`,`mouseup`,`touchstart`,`touchmove`,`touchend`,`reset`],this),n.addEventListener(r,`mousedown`,this.mousedown),n.addEventListener(r,`touchstart`,this.touchstart,{passive:!1}),n.addEventListener(r,`touchmove`,this.touchmove),n.addEventListener(r,`touchend`,this.touchend),n.addEventListener(r,`touchcancel`,this.reset)};ys.prototype.down=function(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),n.disableDrag()},ys.prototype.move=function(e,t){var n=this.map,r=this.mouseRotate.mousemoveWindow(e,t);if(r&&r.bearingDelta&&n.setBearing(n.getBearing()+r.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(e,t);i&&i.pitchDelta&&n.setPitch(n.getPitch()+i.pitchDelta)}},ys.prototype.off=function(){var e=this.element;n.removeEventListener(e,`mousedown`,this.mousedown),n.removeEventListener(e,`touchstart`,this.touchstart,{passive:!1}),n.removeEventListener(e,`touchmove`,this.touchmove),n.removeEventListener(e,`touchend`,this.touchend),n.removeEventListener(e,`touchcancel`,this.reset),this.offTemp()},ys.prototype.offTemp=function(){n.enableDrag(),n.removeEventListener(e.window,`mousemove`,this.mousemove),n.removeEventListener(e.window,`mouseup`,this.mouseup)},ys.prototype.mousedown=function(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),n.mousePos(this.element,t)),n.addEventListener(e.window,`mousemove`,this.mousemove),n.addEventListener(e.window,`mouseup`,this.mouseup)},ys.prototype.mousemove=function(e){this.move(e,n.mousePos(this.element,e))},ys.prototype.mouseup=function(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()},ys.prototype.touchstart=function(e){e.targetTouches.length===1?(this._startPos=this._lastPos=n.touchPos(this.element,e.targetTouches)[0],this.down({type:`mousedown`,button:0,ctrlKey:!0,preventDefault:function(){return e.preventDefault()}},this._startPos)):this.reset()},ys.prototype.touchmove=function(e){e.targetTouches.length===1?(this._lastPos=n.touchPos(this.element,e.targetTouches)[0],this.move({preventDefault:function(){return e.preventDefault()}},this._lastPos)):this.reset()},ys.prototype.touchend=function(e){e.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},ys.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};function bs(t,n,r){if(t=new e.LngLat(t.lng,t.lat),n){var i=new e.LngLat(t.lng-360,t.lat),a=new e.LngLat(t.lng+360,t.lat),o=r.locationPoint(t).distSqr(n);r.locationPoint(i).distSqr(n)<o?t=i:r.locationPoint(a).distSqr(n)<o&&(t=a)}for(;Math.abs(t.lng-r.center.lng)>180;){var s=r.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}var xs={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 Ss(e,t,n){var r=e.classList;for(var i in xs)r.remove(`mapboxgl-`+n+`-anchor-`+i);r.add(`mapboxgl-`+n+`-anchor-`+t)}var Cs=function(t){function r(r,i){if(t.call(this),(r instanceof e.window.HTMLElement||i)&&(r=e.extend({element:r},i)),e.bindAll([`_update`,`_onMove`,`_onUp`,`_addDragHandler`,`_onMapClick`,`_onKeyPress`],this),this._anchor=r&&r.anchor||`center`,this._color=r&&r.color||`#3FB1CE`,this._scale=r&&r.scale||1,this._draggable=r&&r.draggable||!1,this._clickTolerance=r&&r.clickTolerance||0,this._isDragging=!1,this._state=`inactive`,this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||`auto`,this._pitchAlignment=r&&r.pitchAlignment&&r.pitchAlignment!==`auto`?r.pitchAlignment:this._rotationAlignment,!r||!r.element){this._defaultMarker=!0,this._element=n.create(`div`),this._element.setAttribute(`aria-label`,`Map marker`);var a=n.createNS(`http://www.w3.org/2000/svg`,`svg`),o=41,s=27;a.setAttributeNS(null,`display`,`block`),a.setAttributeNS(null,`height`,o+`px`),a.setAttributeNS(null,`width`,s+`px`),a.setAttributeNS(null,`viewBox`,`0 0 `+s+` `+o);var c=n.createNS(`http://www.w3.org/2000/svg`,`g`);c.setAttributeNS(null,`stroke`,`none`),c.setAttributeNS(null,`stroke-width`,`1`),c.setAttributeNS(null,`fill`,`none`),c.setAttributeNS(null,`fill-rule`,`evenodd`);var l=n.createNS(`http://www.w3.org/2000/svg`,`g`);l.setAttributeNS(null,`fill-rule`,`nonzero`);var u=n.createNS(`http://www.w3.org/2000/svg`,`g`);u.setAttributeNS(null,`transform`,`translate(3.0, 29.0)`),u.setAttributeNS(null,`fill`,`#000000`);for(var d=[{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`}],f=0,p=d;f<p.length;f+=1){var m=p[f],h=n.createNS(`http://www.w3.org/2000/svg`,`ellipse`);h.setAttributeNS(null,`opacity`,`0.04`),h.setAttributeNS(null,`cx`,`10.5`),h.setAttributeNS(null,`cy`,`5.80029008`),h.setAttributeNS(null,`rx`,m.rx),h.setAttributeNS(null,`ry`,m.ry),u.appendChild(h)}var g=n.createNS(`http://www.w3.org/2000/svg`,`g`);g.setAttributeNS(null,`fill`,this._color);var _=n.createNS(`http://www.w3.org/2000/svg`,`path`);_.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`),g.appendChild(_);var v=n.createNS(`http://www.w3.org/2000/svg`,`g`);v.setAttributeNS(null,`opacity`,`0.25`),v.setAttributeNS(null,`fill`,`#000000`);var y=n.createNS(`http://www.w3.org/2000/svg`,`path`);y.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`),v.appendChild(y);var b=n.createNS(`http://www.w3.org/2000/svg`,`g`);b.setAttributeNS(null,`transform`,`translate(6.0, 7.0)`),b.setAttributeNS(null,`fill`,`#FFFFFF`);var x=n.createNS(`http://www.w3.org/2000/svg`,`g`);x.setAttributeNS(null,`transform`,`translate(8.0, 8.0)`);var S=n.createNS(`http://www.w3.org/2000/svg`,`circle`);S.setAttributeNS(null,`fill`,`#000000`),S.setAttributeNS(null,`opacity`,`0.25`),S.setAttributeNS(null,`cx`,`5.5`),S.setAttributeNS(null,`cy`,`5.5`),S.setAttributeNS(null,`r`,`5.4999962`);var C=n.createNS(`http://www.w3.org/2000/svg`,`circle`);C.setAttributeNS(null,`fill`,`#FFFFFF`),C.setAttributeNS(null,`cx`,`5.5`),C.setAttributeNS(null,`cy`,`5.5`),C.setAttributeNS(null,`r`,`5.4999962`),x.appendChild(S),x.appendChild(C),l.appendChild(u),l.appendChild(g),l.appendChild(v),l.appendChild(b),l.appendChild(x),a.appendChild(l),a.setAttributeNS(null,`height`,o*this._scale+`px`),a.setAttributeNS(null,`width`,s*this._scale+`px`),this._element.appendChild(a),this._offset=e.Point.convert(r&&r.offset||[0,-14])}else this._element=r.element,this._offset=e.Point.convert(r&&r.offset||[0,0]);this._element.classList.add(`mapboxgl-marker`),this._element.addEventListener(`dragstart`,function(e){e.preventDefault()}),this._element.addEventListener(`mousedown`,function(e){e.preventDefault()}),Ss(this._element,this._anchor,`marker`),this._popup=null}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.addTo=function(e){return this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on(`move`,this._update),e.on(`moveend`,this._update),this.setDraggable(this._draggable),this._update(),this._map.on(`click`,this._onMapClick),this},r.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),n.remove(this._element),this._popup&&this._popup.remove(),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},r.prototype.getElement=function(){return this._element},r.prototype.setPopup=function(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener(`keypress`,this._onKeyPress),this._originalTabIndex||this._element.removeAttribute(`tabindex`)),e){if(!(`offset`in e.options)){var t=38.1,n=13.5,r=Math.sqrt(n**2/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-t],"bottom-left":[r,(t-n+r)*-1],"bottom-right":[-r,(t-n+r)*-1],left:[n,(t-n)*-1],right:[-n,(t-n)*-1]}:this._offset}this._popup=e,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},r.prototype._onKeyPress=function(e){var t=e.code,n=e.charCode||e.keyCode;(t===`Space`||t===`Enter`||n===32||n===13)&&this.togglePopup()},r.prototype._onMapClick=function(e){var t=e.originalEvent.target,n=this._element;this._popup&&(t===n||n.contains(t))&&this.togglePopup()},r.prototype.getPopup=function(){return this._popup},r.prototype.togglePopup=function(){var e=this._popup;if(e)e.isOpen()?e.remove():e.addTo(this._map);else return this;return this},r.prototype._update=function(e){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=bs(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var t=``;this._rotationAlignment===`viewport`||this._rotationAlignment===`auto`?t=`rotateZ(`+this._rotation+`deg)`:this._rotationAlignment===`map`&&(t=`rotateZ(`+(this._rotation-this._map.getBearing())+`deg)`);var r=``;this._pitchAlignment===`viewport`||this._pitchAlignment===`auto`?r=`rotateX(0deg)`:this._pitchAlignment===`map`&&(r=`rotateX(`+this._map.getPitch()+`deg)`),(!e||e.type===`moveend`)&&(this._pos=this._pos.round()),n.setTransform(this._element,xs[this._anchor]+` translate(`+this._pos.x+`px, `+this._pos.y+`px) `+r+` `+t)}},r.prototype.getOffset=function(){return this._offset},r.prototype.setOffset=function(t){return this._offset=e.Point.convert(t),this._update(),this},r.prototype._onMove=function(t){if(!this._isDragging){var n=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=n}this._isDragging&&(this._pos=t.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.Event(`dragstart`))),this.fire(new e.Event(`drag`)))},r.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 e.Event(`dragend`)),this._state=`inactive`},r.prototype._addDragHandler=function(e){this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.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))},r.prototype.setDraggable=function(e){return this._draggable=!!e,this._map&&(e?(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},r.prototype.isDraggable=function(){return this._draggable},r.prototype.setRotation=function(e){return this._rotation=e||0,this._update(),this},r.prototype.getRotation=function(){return this._rotation},r.prototype.setRotationAlignment=function(e){return this._rotationAlignment=e||`auto`,this._update(),this},r.prototype.getRotationAlignment=function(){return this._rotationAlignment},r.prototype.setPitchAlignment=function(e){return this._pitchAlignment=e&&e!==`auto`?e:this._rotationAlignment,this._update(),this},r.prototype.getPitchAlignment=function(){return this._pitchAlignment},r}(e.Evented),ws={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Ts;function Es(t){Ts===void 0?e.window.navigator.permissions===void 0?(Ts=!!e.window.navigator.geolocation,t(Ts)):e.window.navigator.permissions.query({name:`geolocation`}).then(function(e){Ts=e.state!==`denied`,t(Ts)}):t(Ts)}var Ds=0,Os=!1,ks=function(t){function r(n){t.call(this),this.options=e.extend({},ws,n),e.bindAll([`_onSuccess`,`_onError`,`_onZoom`,`_finish`,`_setupUI`,`_updateCamera`,`_updateMarker`],this)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.onAdd=function(e){return this._map=e,this._container=n.create(`div`,`mapboxgl-ctrl mapboxgl-ctrl-group`),Es(this._setupUI),this._container},r.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(e.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(),n.remove(this._container),this._map.off(`zoom`,this._onZoom),this._map=void 0,Ds=0,Os=!1},r.prototype._isOutOfMapMaxBounds=function(e){var t=this._map.getMaxBounds(),n=e.coords;return t&&(n.longitude<t.getWest()||n.longitude>t.getEast()||n.latitude<t.getSouth()||n.latitude>t.getNorth())},r.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}},r.prototype._onSuccess=function(t){if(this._map){if(this._isOutOfMapMaxBounds(t)){this._setErrorState(),this.fire(new e.Event(`outofmaxbounds`,t)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,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(t),(!this.options.trackUserLocation||this._watchState===`ACTIVE_LOCK`)&&this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove(`mapboxgl-user-location-dot-stale`),this.fire(new e.Event(`geolocate`,t)),this._finish()}},r.prototype._updateCamera=function(t){var n=new e.LngLat(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,i=this._map.getBearing(),a=e.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(r),a,{geolocateSource:!0})},r.prototype._updateMarker=function(t){if(t){var n=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},r.prototype._updateCircleRadius=function(){var e=this._map._container.clientHeight/2,t=this._map.unproject([0,e]),n=this._map.unproject([1,e]),r=t.distanceTo(n),i=Math.ceil(2*this._accuracy/r);this._circleElement.style.width=i+`px`,this._circleElement.style.height=i+`px`},r.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},r.prototype._onError=function(t){if(this._map){if(this.options.trackUserLocation)if(t.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 n=this._map._getUIString(`GeolocateControl.LocationNotAvailable`);this._geolocateButton.title=n,this._geolocateButton.setAttribute(`aria-label`,n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&Os)return;this._setErrorState()}this._watchState!==`OFF`&&this.options.showUserLocation&&this._dotElement.classList.add(`mapboxgl-user-location-dot-stale`),this.fire(new e.Event(`error`,t)),this._finish()}},r.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},r.prototype._setupUI=function(t){var r=this;if(this._container.addEventListener(`contextmenu`,function(e){return e.preventDefault()}),this._geolocateButton=n.create(`button`,`mapboxgl-ctrl-geolocate`,this._container),n.create(`span`,`mapboxgl-ctrl-icon`,this._geolocateButton).setAttribute(`aria-hidden`,!0),this._geolocateButton.type=`button`,t===!1){e.warnOnce(`Geolocation support is not available so the GeolocateControl will be disabled.`);var i=this._map._getUIString(`GeolocateControl.LocationNotAvailable`);this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute(`aria-label`,i)}else{var a=this._map._getUIString(`GeolocateControl.FindMyLocation`);this._geolocateButton.title=a,this._geolocateButton.setAttribute(`aria-label`,a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute(`aria-pressed`,`false`),this._watchState=`OFF`),this.options.showUserLocation&&(this._dotElement=n.create(`div`,`mapboxgl-user-location-dot`),this._userLocationDotMarker=new Cs(this._dotElement),this._circleElement=n.create(`div`,`mapboxgl-user-location-accuracy-circle`),this._accuracyCircleMarker=new Cs({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(t){var n=t.originalEvent&&t.originalEvent.type===`resize`;!t.geolocateSource&&r._watchState===`ACTIVE_LOCK`&&!n&&(r._watchState=`BACKGROUND`,r._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-background`),r._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-active`),r.fire(new e.Event(`trackuserlocationend`)))})},r.prototype.trigger=function(){if(!this._setup)return e.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 e.Event(`trackuserlocationstart`));break;case`WAITING_ACTIVE`:case`ACTIVE_LOCK`:case`ACTIVE_ERROR`:case`BACKGROUND_ERROR`:Ds--,Os=!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 e.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 e.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`),Ds++;var t;Ds>1?(t={maximumAge:6e5,timeout:0},Os=!0):(t=this.options.positionOptions,Os=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},r.prototype._clearWatch=function(){e.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)},r}(e.Evented),As={maxWidth:100,unit:`metric`},js=function(t){this.options=e.extend({},As,t),e.bindAll([`_onMove`,`setUnit`],this)};js.prototype.getDefaultPosition=function(){return`bottom-left`},js.prototype._onMove=function(){Ms(this._map,this._container,this.options)},js.prototype.onAdd=function(e){return this._map=e,this._container=n.create(`div`,`mapboxgl-ctrl mapboxgl-ctrl-scale`,e.getContainer()),this._map.on(`move`,this._onMove),this._onMove(),this._container},js.prototype.onRemove=function(){n.remove(this._container),this._map.off(`move`,this._onMove),this._map=void 0},js.prototype.setUnit=function(e){this.options.unit=e,Ms(this._map,this._container,this.options)};function Ms(e,t,n){var r=n&&n.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),o=e.unproject([r,i]),s=a.distanceTo(o);if(n&&n.unit===`imperial`){var c=3.2808*s;c>5280?Ns(t,r,c/5280,e._getUIString(`ScaleControl.Miles`)):Ns(t,r,c,e._getUIString(`ScaleControl.Feet`))}else n&&n.unit===`nautical`?Ns(t,r,s/1852,e._getUIString(`ScaleControl.NauticalMiles`)):s>=1e3?Ns(t,r,s/1e3,e._getUIString(`ScaleControl.Kilometers`)):Ns(t,r,s,e._getUIString(`ScaleControl.Meters`))}function Ns(e,t,n,r){var i=Fs(n),a=i/n;e.style.width=t*a+`px`,e.innerHTML=i+`&nbsp;`+r}function Ps(e){var t=10**Math.ceil(-Math.log(e)/Math.LN10);return Math.round(e*t)/t}function Fs(e){var t=10**((``+Math.floor(e)).length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:n>=1?1:Ps(n),t*n}var Is=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.window.HTMLElement?this._container=t.container:e.warnOnce(`Full screen control 'container' must be a DOM element.`)),e.bindAll([`_onClickFullscreen`,`_changeIcon`],this),`onfullscreenchange`in e.window.document?this._fullscreenchange=`fullscreenchange`:`onmozfullscreenchange`in e.window.document?this._fullscreenchange=`mozfullscreenchange`:`onwebkitfullscreenchange`in e.window.document?this._fullscreenchange=`webkitfullscreenchange`:`onmsfullscreenchange`in e.window.document&&(this._fullscreenchange=`MSFullscreenChange`)};Is.prototype.onAdd=function(t){return this._map=t,this._container||=this._map.getContainer(),this._controlContainer=n.create(`div`,`mapboxgl-ctrl mapboxgl-ctrl-group`),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display=`none`,e.warnOnce(`This device does not support fullscreen mode.`)),this._controlContainer},Is.prototype.onRemove=function(){n.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Is.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},Is.prototype._setupUI=function(){var t=this._fullscreenButton=n.create(`button`,`mapboxgl-ctrl-fullscreen`,this._controlContainer);n.create(`span`,`mapboxgl-ctrl-icon`,t).setAttribute(`aria-hidden`,!0),t.type=`button`,this._updateTitle(),this._fullscreenButton.addEventListener(`click`,this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Is.prototype._updateTitle=function(){var e=this._getTitle();this._fullscreenButton.setAttribute(`aria-label`,e),this._fullscreenButton.title=e},Is.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?`FullscreenControl.Exit`:`FullscreenControl.Enter`)},Is.prototype._isFullscreen=function(){return this._fullscreen},Is.prototype._changeIcon=function(){(e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(`mapboxgl-ctrl-shrink`),this._fullscreenButton.classList.toggle(`mapboxgl-ctrl-fullscreen`),this._updateTitle())},Is.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.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 Ls={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:``,maxWidth:`240px`},Rs=[`a[href]`,`[tabindex]:not([tabindex='-1'])`,`[contenteditable]:not([contenteditable='false'])`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`].join(`, `),zs=function(t){function r(n){t.call(this),this.options=e.extend(Object.create(Ls),n),e.bindAll([`_update`,`_onClose`,`remove`,`_onMouseMove`,`_onMouseUp`,`_onDrag`],this)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.addTo=function(t){return this._map&&this.remove(),this._map=t,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 e.Event(`open`)),this},r.prototype.isOpen=function(){return!!this._map},r.prototype.remove=function(){return this._content&&n.remove(this._content),this._container&&(n.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 e.Event(`close`)),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),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},r.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},r.prototype.getElement=function(){return this._container},r.prototype.setText=function(t){return this.setDOMContent(e.window.document.createTextNode(t))},r.prototype.setHTML=function(t){var n=e.window.document.createDocumentFragment(),r=e.window.document.createElement(`body`),i;for(r.innerHTML=t;i=r.firstChild,i;)n.appendChild(i);return this.setDOMContent(n)},r.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},r.prototype.setMaxWidth=function(e){return this.options.maxWidth=e,this._update(),this},r.prototype.setDOMContent=function(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=n.create(`div`,`mapboxgl-popup-content`,this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this},r.prototype.addClassName=function(e){this._container&&this._container.classList.add(e)},r.prototype.removeClassName=function(e){this._container&&this._container.classList.remove(e)},r.prototype.setOffset=function(e){return this.options.offset=e,this._update(),this},r.prototype.toggleClassName=function(e){if(this._container)return this._container.classList.toggle(e)},r.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=n.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))},r.prototype._onMouseUp=function(e){this._update(e.point)},r.prototype._onMouseMove=function(e){this._update(e.point)},r.prototype._onDrag=function(e){this._update(e.point)},r.prototype._update=function(e){var t=this,r=this._lngLat||this._trackPointer;if(!(!this._map||!r||!this._content)&&(this._container||(this._container=n.create(`div`,`mapboxgl-popup`,this._map.getContainer()),this._tip=n.create(`div`,`mapboxgl-popup-tip`,this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(` `).forEach(function(e){return t._container.classList.add(e)}),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=bs(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!e))){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,o=Bs(this.options.offset);if(!a){var s=this._container.offsetWidth,c=this._container.offsetHeight,l=i.y+o.bottom.y<c?[`top`]:i.y>this._map.transform.height-c?[`bottom`]:[];i.x<s/2?l.push(`left`):i.x>this._map.transform.width-s/2&&l.push(`right`),a=l.length===0?`bottom`:l.join(`-`)}var u=i.add(o[a]).round();n.setTransform(this._container,xs[a]+` translate(`+u.x+`px,`+u.y+`px)`),Ss(this._container,a,`popup`)}},r.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var e=this._container.querySelector(Rs);e&&e.focus()}},r.prototype._onClose=function(){this.remove()},r}(e.Evented);function Bs(t){if(t)if(typeof t==`number`){var n=Math.round(Math.sqrt(.5*t**2));return{center:new e.Point(0,0),top:new e.Point(0,t),"top-left":new e.Point(n,n),"top-right":new e.Point(-n,n),bottom:new e.Point(0,-t),"bottom-left":new e.Point(n,-n),"bottom-right":new e.Point(-n,-n),left:new e.Point(t,0),right:new e.Point(-t,0)}}else if(t instanceof e.Point||Array.isArray(t)){var r=e.Point.convert(t);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}else return{center:e.Point.convert(t.center||[0,0]),top:e.Point.convert(t.top||[0,0]),"top-left":e.Point.convert(t[`top-left`]||[0,0]),"top-right":e.Point.convert(t[`top-right`]||[0,0]),bottom:e.Point.convert(t.bottom||[0,0]),"bottom-left":e.Point.convert(t[`bottom-left`]||[0,0]),"bottom-right":e.Point.convert(t[`bottom-right`]||[0,0]),left:e.Point.convert(t.left||[0,0]),right:e.Point.convert(t.right||[0,0])};else return Bs(new e.Point(0,0))}var Vs={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:hs,NavigationControl:vs,GeolocateControl:ks,AttributionControl:rs,ScaleControl:js,FullscreenControl:Is,Popup:zs,Marker:Cs,Style:_n,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:ot,clearPrewarmedResources:st,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return nt.workerCount},set workerCount(e){nt.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){e.clearTileCache(t)},workerUrl:``};return Vs}),n})}),ex=h((e,t)=>{var n=$(),r=kt().sanitizeHTML,i=qb(),a=Vb();function o(e,t){this.subplot=e,this.uid=e.uid+`-`+t,this.index=t,this.idSource=`source-`+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;s.update=function(e){this.visible?this.needsNewImage(e)?this.updateImage(e):this.needsNewSource(e)?(this.removeLayer(),this.updateSource(e),this.updateLayer(e)):this.needsNewLayer(e)?this.updateLayer(e):this.updateStyle(e):(this.updateSource(e),this.updateLayer(e)),this.visible=c(e)},s.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&this.sourceType===`image`&&e.sourcetype===`image`&&(this.source!==e.source||JSON.stringify(this.coordinates)!==JSON.stringify(e.coordinates))},s.needsNewSource=function(e){return this.sourceType!==e.sourcetype||JSON.stringify(this.source)!==JSON.stringify(e.source)||this.layerType!==e.type},s.needsNewLayer=function(e){return this.layerType!==e.type||this.below!==this.subplot.belowLookup[`layout-`+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup[`layout-`+this.index]},s.updateImage=function(e){this.subplot.map.getSource(this.idSource).updateImage({url:e.source,coordinates:e.coordinates});var t=this.findFollowingMapboxLayerId(this.lookupBelow());t!==null&&this.subplot.map.moveLayer(this.idLayer,t)},s.updateSource=function(e){var t=this.subplot.map;if(t.getSource(this.idSource)&&t.removeSource(this.idSource),this.sourceType=e.sourcetype,this.source=e.source,c(e)){var n=u(e);t.addSource(this.idSource,n)}},s.findFollowingMapboxLayerId=function(e){if(e===`traces`)for(var t=this.subplot.getMapLayers(),n=0;n<t.length;n++){var r=t[n].id;if(typeof r==`string`&&r.indexOf(a.traceLayerPrefix)===0){e=r;break}}return e},s.updateLayer=function(e){var t=this.subplot,n=l(e),r=this.lookupBelow(),i=this.findFollowingMapboxLayerId(r);this.removeLayer(),c(e)&&t.addLayer({id:this.idLayer,source:this.idSource,"source-layer":e.sourcelayer||``,type:e.type,minzoom:e.minzoom,maxzoom:e.maxzoom,layout:n.layout,paint:n.paint},i),this.layerType=e.type,this.below=r},s.updateStyle=function(e){if(c(e)){var t=l(e);this.subplot.setOptions(this.idLayer,`setLayoutProperty`,t.layout),this.subplot.setOptions(this.idLayer,`setPaintProperty`,t.paint)}},s.removeLayer=function(){var e=this.subplot.map;e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer)},s.dispose=function(){var e=this.subplot.map;e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),e.getSource(this.idSource)&&e.removeSource(this.idSource)};function c(e){if(!e.visible)return!1;var t=e.source;if(Array.isArray(t)&&t.length>0){for(var r=0;r<t.length;r++)if(typeof t[r]!=`string`||t[r].length===0)return!1;return!0}return n.isPlainObject(t)||typeof t==`string`&&t.length>0}function l(e){var t={},r={};switch(e.type){case`circle`:n.extendFlat(r,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case`line`:n.extendFlat(r,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case`fill`:n.extendFlat(r,{"fill-color":e.color,"fill-outline-color":e.fill.outlinecolor,"fill-opacity":e.opacity});break;case`symbol`:var a=e.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(t,{"icon-image":a.icon+`-15`,"icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),n.extendFlat(r,{"icon-color":e.color,"text-color":a.textfont.color,"text-opacity":e.opacity});break;case`raster`:n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":e.opacity});break}return{layout:t,paint:r}}function u(e){var t=e.sourcetype,n=e.source,i={type:t},a;return t===`geojson`?a=`data`:t===`vector`?a=typeof n==`string`?`url`:`tiles`:t===`raster`?(a=`tiles`,i.tileSize=256):t===`image`&&(a=`url`,i.coordinates=e.coordinates),i[a]=n,e.sourceattribution&&(i.attribution=r(e.sourceattribution)),i}t.exports=function(e,t,n){var r=new o(e,t);return r.update(n),r}}),tx=h((e,t)=>{var n=$b(),r=$(),i=Pg(),a=Ke(),o=sn(),s=hn(),c=Ln(),l=Rn(),u=l.drawMode,d=l.selectMode,f=Ar().prepSelect,p=Ar().clearOutline,m=Ar().clearSelectionsCache,h=Ar().selectOnClick,g=Vb(),_=ex();function v(e,t){this.id=t,this.gd=e;var n=e._fullLayout,r=e._context;this.container=n._glcontainer.node(),this.isStatic=r.staticPlot,this.uid=n._uid+`-`+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(n),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var y=v.prototype;y.plot=function(e,t,n){var r=this,i=t[r.id];r.map&&i.accesstoken!==r.accessToken&&(r.map.remove(),r.map=null,r.styleObj=null,r.traceHash={},r.layerList=[]);var a=r.map?new Promise(function(n,i){r.updateMap(e,t,n,i)}):new Promise(function(n,i){r.createMap(e,t,n,i)});n.push(a)},y.createMap=function(e,t,r,a){var o=this,s=t[o.id],c=o.styleObj=x(s.style,t);o.accessToken=s.accesstoken;var l=s.bounds,u=l?[[l.west,l.south],[l.east,l.north]]:null,d=o.map=new n.Map({container:o.div,style:c.style,center:C(s.center),zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,maxBounds:u,interactive:!o.isStatic,preserveDrawingBuffer:o.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new n.AttributionControl({compact:!0}));d._canvas.style.left=`0px`,d._canvas.style.top=`0px`,o.rejectOnError(a),o.isStatic||o.initFx(e,t);var f=[];f.push(new Promise(function(e){d.once(`load`,e)})),f=f.concat(i.fetchTraceGeoData(e)),Promise.all(f).then(function(){o.fillBelowLookup(e,t),o.updateData(e),o.updateLayout(t),o.resolveOnRender(r)}).catch(a)},y.updateMap=function(e,t,n,r){var a=this,o=a.map,s=t[this.id];a.rejectOnError(r);var c=[],l=x(s.style,t);JSON.stringify(a.styleObj)!==JSON.stringify(l)&&(a.styleObj=l,o.setStyle(l.style),a.traceHash={},c.push(new Promise(function(e){o.once(`styledata`,e)}))),c=c.concat(i.fetchTraceGeoData(e)),Promise.all(c).then(function(){a.fillBelowLookup(e,t),a.updateData(e),a.updateLayout(t),a.resolveOnRender(n)}).catch(r)},y.fillBelowLookup=function(e,t){var n=t[this.id].layers,r,i,a=this.belowLookup={},o=!1;for(r=0;r<e.length;r++){var s=e[r][0].trace,c=s._module;typeof s.below==`string`?i=s.below:c.getBelow&&(i=c.getBelow(s,this)),i===``&&(o=!0),a[`trace-`+s.uid]=i||``}for(r=0;r<n.length;r++){var l=n[r];i=typeof l.below==`string`?l.below:o?`traces`:``,a[`layout-`+r]=i}var u={},d,f;for(d in a)i=a[d],u[i]?u[i].push(d):u[i]=[d];for(i in u){var p=u[i];if(p.length>1)for(r=0;r<p.length;r++)d=p[r],d.indexOf(`trace-`)===0?(f=d.split(`trace-`)[1],this.traceHash[f]&&(this.traceHash[f].below=null)):d.indexOf(`layout-`)===0&&(f=d.split(`layout-`)[1],this.layerList[f]&&(this.layerList[f].below=null))}};var b={choroplethmapbox:0,densitymapbox:1,scattermapbox:2};y.updateData=function(e){var t=this.traceHash,n,r,i,a,o=e.slice().sort(function(e,t){return b[e[0].trace.type]-b[t[0].trace.type]});for(i=0;i<o.length;i++){var s=o[i];r=s[0].trace,n=t[r.uid];var c=!1;n&&(n.type===r.type?(n.update(s),c=!0):n.dispose()),!c&&r._module&&(t[r.uid]=r._module.plot(this,s))}var l=Object.keys(t);e:for(i=0;i<l.length;i++){var u=l[i];for(a=0;a<e.length;a++)if(r=e[a][0].trace,u===r.uid)continue e;n=t[u],n.dispose(),delete t[u]}},y.updateLayout=function(e){var t=this.map,n=e[this.id];!this.dragging&&!this.wheeling&&(t.setCenter(C(n.center)),t.setZoom(n.zoom),t.setBearing(n.bearing),t.setPitch(n.pitch)),this.updateLayers(e),this.updateFramework(e),this.updateFx(e),this.map.resize(),this.gd._context._scrollZoom.mapbox?t.scrollZoom.enable():t.scrollZoom.disable()},y.resolveOnRender=function(e){var t=this.map;t.on(`render`,function n(){t.loaded()&&(t.off(`render`,n),setTimeout(e,10))})},y.rejectOnError=function(e){var t=this.map;function n(){e(Error(g.mapOnErrorMsg))}t.once(`error`,n),t.once(`style.error`,n),t.once(`source.error`,n),t.once(`tile.error`,n),t.once(`layer.error`,n)},y.createFramework=function(e){var t=this,n=t.div=document.createElement(`div`);n.id=t.uid,n.style.position=`absolute`,t.container.appendChild(n),t.xaxis={_id:`x`,c2p:function(e){return t.project(e).x}},t.yaxis={_id:`y`,c2p:function(e){return t.project(e).y}},t.updateFramework(e),t.mockAxis={type:`linear`,showexponent:`all`,exponentformat:`B`},o.setConvert(t.mockAxis,e)},y.initFx=function(e,t){var n=this,r=n.gd,i=n.map;i.on(`moveend`,function(e){if(n.map){var t=r._fullLayout;if(e.originalEvent||n.wheeling){var i=t[n.id];a.call(`_storeDirectGUIEdit`,r.layout,t._preGUI,n.getViewEdits(i));var o=n.getView();i._input.center=i.center=o.center,i._input.zoom=i.zoom=o.zoom,i._input.bearing=i.bearing=o.bearing,i._input.pitch=i.pitch=o.pitch,r.emit(`plotly_relayout`,n.getViewEditsWithDerived(o))}e.originalEvent&&e.originalEvent.type===`mouseup`?n.dragging=!1:n.wheeling&&=!1,t._rehover&&t._rehover()}}),i.on(`wheel`,function(){n.wheeling=!0}),i.on(`mousemove`,function(e){var t=n.div.getBoundingClientRect(),a=[e.originalEvent.offsetX,e.originalEvent.offsetY];e.target.getBoundingClientRect=function(){return t},n.xaxis.p2c=function(){return i.unproject(a).lng},n.yaxis.p2c=function(){return i.unproject(a).lat},r._fullLayout._rehover=function(){r._fullLayout._hoversubplot===n.id&&r._fullLayout[n.id]&&c.hover(r,e,n.id)},c.hover(r,e,n.id),r._fullLayout._hoversubplot=n.id});function o(){c.loneUnhover(t._hoverlayer)}i.on(`dragstart`,function(){n.dragging=!0,o()}),i.on(`zoomstart`,o),i.on(`mouseout`,function(){r._fullLayout._hoversubplot=null});function s(){var e=n.getView();r.emit(`plotly_relayouting`,n.getViewEditsWithDerived(e))}i.on(`drag`,s),i.on(`zoom`,s),i.on(`dblclick`,function(){var e=r._fullLayout[n.id];a.call(`_storeDirectGUIEdit`,r.layout,r._fullLayout._preGUI,n.getViewEdits(e));var t=n.viewInitial;i.setCenter(C(t.center)),i.setZoom(t.zoom),i.setBearing(t.bearing),i.setPitch(t.pitch);var o=n.getView();e._input.center=e.center=o.center,e._input.zoom=e.zoom=o.zoom,e._input.bearing=e.bearing=o.bearing,e._input.pitch=e.pitch=o.pitch,r.emit(`plotly_doubleclick`,null),r.emit(`plotly_relayout`,n.getViewEditsWithDerived(o))}),n.clearOutline=function(){m(n.dragOptions),p(n.dragOptions.gd)},n.onClickInPanFn=function(e){return function(t){var i=r._fullLayout.clickmode;i.indexOf(`select`)>-1&&h(t.originalEvent,r,[n.xaxis],[n.yaxis],n.id,e),i.indexOf(`event`)>-1&&c.click(r,t.originalEvent)}}},y.updateFx=function(e){var t=this,n=t.map,i=t.gd;if(t.isStatic)return;function a(e){var n=t.map.unproject(e);return[n.lng,n.lat]}var o=e.dragmode,c=function(e,n){if(n.isRect){var r=e.range={};r[t.id]=[a([n.xmin,n.ymin]),a([n.xmax,n.ymax])]}else{var i=e.lassoPoints={};i[t.id]=n.map(a)}},l=t.dragOptions;t.dragOptions=r.extendDeep(l||{},{dragmode:e.dragmode,element:t.div,gd:i,plotinfo:{id:t.id,domain:e[t.id].domain,xaxis:t.xaxis,yaxis:t.yaxis,fillRangeItems:c},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),n.off(`click`,t.onClickInPanHandler),d(o)||u(o)?(n.dragPan.disable(),n.on(`zoomstart`,t.clearOutline),t.dragOptions.prepFn=function(e,n,r){f(e,n,r,t.dragOptions,o)},s.init(t.dragOptions)):(n.dragPan.enable(),n.off(`zoomstart`,t.clearOutline),t.div.onmousedown=null,t.div.ontouchstart=null,t.div.removeEventListener(`touchstart`,t.div._ontouchstart),t.onClickInPanHandler=t.onClickInPanFn(t.dragOptions),n.on(`click`,t.onClickInPanHandler))},y.updateFramework=function(e){var t=e[this.id].domain,n=e._size,r=this.div.style;r.width=n.w*(t.x[1]-t.x[0])+`px`,r.height=n.h*(t.y[1]-t.y[0])+`px`,r.left=n.l+t.x[0]*n.w+`px`,r.top=n.t+(1-t.y[1])*n.h+`px`,this.xaxis._offset=n.l+t.x[0]*n.w,this.xaxis._length=n.w*(t.x[1]-t.x[0]),this.yaxis._offset=n.t+(1-t.y[1])*n.h,this.yaxis._length=n.h*(t.y[1]-t.y[0])},y.updateLayers=function(e){var t=e[this.id].layers,n=this.layerList,r;if(t.length!==n.length){for(r=0;r<n.length;r++)n[r].dispose();for(n=this.layerList=[],r=0;r<t.length;r++)n.push(_(this,r,t[r]))}else for(r=0;r<t.length;r++)n[r].update(t[r])},y.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},y.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},y.setOptions=function(e,t,n){for(var r in n)this.map[t](e,r,n[r])},y.getMapLayers=function(){return this.map.getStyle().layers},y.addLayer=function(e,t){var n=this.map;if(typeof t==`string`){if(t===``){n.addLayer(e,t);return}for(var i=this.getMapLayers(),a=0;a<i.length;a++)if(t===i[a].id){n.addLayer(e,t);return}r.warn([`Trying to add layer with *below* value`,t,`referencing a layer that does not exist`,`or that does not yet exist.`].join(` `))}n.addLayer(e)},y.project=function(e){return this.map.project(new n.LngLat(e[0],e[1]))},y.getView=function(){var e=this.map,t=e.getCenter(),n={lon:t.lng,lat:t.lat},r=e.getCanvas(),i=parseInt(r.style.width),a=parseInt(r.style.height);return{center:n,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch(),_derived:{coordinates:[e.unproject([0,0]).toArray(),e.unproject([i,0]).toArray(),e.unproject([i,a]).toArray(),e.unproject([0,a]).toArray()]}}},y.getViewEdits=function(e){for(var t=this.id,n=[`center`,`zoom`,`bearing`,`pitch`],r={},i=0;i<n.length;i++){var a=n[i];r[t+`.`+a]=e[a]}return r},y.getViewEditsWithDerived=function(e){var t=this.id,n=this.getViewEdits(e);return n[t+`._derived`]=e._derived,n};function x(e,t){var n={};if(r.isPlainObject(e))n.id=e.id,n.style=e;else if(typeof e==`string`)if(n.id=e,g.styleValuesMapbox.indexOf(e)!==-1)n.style=S(e);else if(g.stylesNonMapbox[e]){n.style=g.stylesNonMapbox[e];var i=n.style.sources[`plotly-`+e],a=i?i.tiles:void 0;a&&a[0]&&a[0].slice(-9)===`?api_key=`&&(a[0]+=t._mapboxAccessToken)}else n.style=e;else n.id=g.styleValueDflt,n.style=S(g.styleValueDflt);return n.transition={duration:0,delay:0},n}function S(e){return g.styleUrlPrefix+e+`-`+g.styleUrlSuffix}function C(e){return[e.lon,e.lat]}t.exports=v}),nx=h((e,t)=>{var n=$(),r=Ks(),i=Vt(),a=Hb();t.exports=function(e,t,n){r(e,t,n,{type:`mapbox`,attributes:a,handleDefaults:o,partition:`y`,accessToken:t._mapboxAccessToken})};function o(e,t,n,r){n(`accesstoken`,r.accessToken),n(`style`),n(`center.lon`),n(`center.lat`),n(`zoom`),n(`bearing`),n(`pitch`);var a=n(`bounds.west`),o=n(`bounds.east`),c=n(`bounds.south`),l=n(`bounds.north`);(a===void 0||o===void 0||c===void 0||l===void 0)&&delete t.bounds,i(e,t,{name:`layers`,handleItemDefaults:s}),t._input=e}function s(e,t){function r(r,i){return n.coerce(e,t,a.layers,r,i)}if(r(`visible`)){var i=r(`sourcetype`),o=i===`raster`||i===`image`;r(`source`),r(`sourceattribution`),i===`vector`&&r(`sourcelayer`),i===`image`&&r(`coordinates`);var s;o&&(s=`raster`);var c=r(`type`,s);o&&c!==`raster`&&(c=t.type=`raster`,n.log(`Source types *raster* and *image* must drawn *raster* layer type.`)),r(`below`),r(`color`),r(`opacity`),r(`minzoom`),r(`maxzoom`),c===`circle`&&r(`circle.radius`),c===`line`&&(r(`line.width`),r(`line.dash`)),c===`fill`&&r(`fill.outlinecolor`),c===`symbol`&&(r(`symbol.icon`),r(`symbol.iconsize`),r(`symbol.text`),n.coerceFont(r,`symbol.textfont`,void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),r(`symbol.textposition`),r(`symbol.placement`))}}}),rx=h(e=>{var t=$b(),n=$(),r=n.strTranslate,i=n.strScale,a=wt().getSubplotCalcData,o=Dt(),s=S(),c=tn(),l=kt(),u=tx(),d=`mapbox`,f=e.constants=Vb();e.name=d,e.attr=`subplot`,e.idRoot=d,e.idRegex=e.attrRegex=n.counterRegex(d);var p=[`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(` `);e.attributes={subplot:{valType:`subplotid`,dflt:`mapbox`,editType:`calc`}},e.layoutAttributes=Hb(),e.supplyLayoutDefaults=nx();var m=!0;e.plot=function(e){m&&(m=!1,n.warn(p));var r=e._fullLayout,i=e.calcdata,o=r._subplots[d];if(t.version!==f.requiredVersion)throw Error(f.wrongVersionErrorMsg);t.accessToken=h(e,o);for(var s=0;s<o.length;s++){var c=o[s],l=a(i,d,c),g=r[c],_=g._subplot;_||(_=new u(e,c),r[c]._subplot=_),_.viewInitial||={center:n.extendFlat({},g.center),zoom:g.zoom,bearing:g.bearing,pitch:g.pitch},_.plot(l,r,e._promises)}},e.clean=function(e,t,n,r){for(var i=r._subplots[d]||[],a=0;a<i.length;a++){var o=i[a];!t[o]&&r[o]._subplot&&r[o]._subplot.destroy()}},e.toSVG=function(e){for(var t=e._fullLayout,n=t._subplots[d],a=t._size,u=0;u<n.length;u++){var p=t[n[u]],m=p.domain,h=p._subplot.toImage(`png`);t._glimages.append(`svg:image`).attr({xmlns:o.svg,"xlink:href":h,x:a.l+a.w*m.x[0],y:a.t+a.h*(1-m.y[1]),width:a.w*(m.x[1]-m.x[0]),height:a.h*(m.y[1]-m.y[0]),preserveAspectRatio:`none`});var g=s.select(p._subplot.div);if(g.select(`.mapboxgl-ctrl-logo`).node().offsetParent!==null){var _=t._glimages.append(`g`);_.attr(`transform`,r(a.l+a.w*m.x[0]+10,a.t+a.h*(1-m.y[0])-31)),_.append(`path`).attr(`d`,f.mapboxLogo.path0).style({opacity:.9,fill:`#ffffff`,"enable-background":`new`}),_.append(`path`).attr(`d`,f.mapboxLogo.path1).style(`opacity`,.35).style(`enable-background`,`new`),_.append(`path`).attr(`d`,f.mapboxLogo.path2).style(`opacity`,.35).style(`enable-background`,`new`),_.append(`polygon`).attr(`points`,f.mapboxLogo.polygon).style({opacity:.9,fill:`#ffffff`,"enable-background":`new`})}var v=g.select(`.mapboxgl-ctrl-attrib`).text().replace(`Improve this map`,``),y=t._glimages.append(`g`),b=y.append(`text`);b.text(v).classed(`static-attribution`,!0).attr({"font-size":12,"font-family":`Arial`,color:`rgba(0, 0, 0, 0.75)`,"text-anchor":`end`,"data-unformatted":v});var x=c.bBox(b.node()),S=a.w*(m.x[1]-m.x[0]);if(x.width>S/2){var C=v.split(`|`).join(`<br>`);b.text(C).attr(`data-unformatted`,C).call(l.convertToTspans,e),x=c.bBox(b.node())}b.attr(`transform`,r(-3,-x.height+8)),y.insert(`rect`,`.static-attribution`).attr({x:-x.width-6,y:-x.height-3,width:x.width+6,height:x.height+3,fill:`rgba(255, 255, 255, 0.75)`});var w=1;x.width+6>S&&(w=S/(x.width+6));var T=[a.l+a.w*m.x[1],a.t+a.h*(1-m.y[0])];y.attr(`transform`,r(T[0],T[1])+i(w))}};function h(e,t){var r=e._fullLayout;if(e._context.mapboxAccessToken===``)return``;for(var i=[],a=[],o=!1,s=!1,c=0;c<t.length;c++){var l=r[t[c]],u=l.accesstoken;g(l.style)&&(u?n.pushUnique(i,u):(g(l._input.style)&&(n.error(`Uses Mapbox map style, but did not set an access token.`),o=!0),s=!0)),u&&n.pushUnique(a,u)}if(s){var d=o?f.noAccessTokenErrorMsg:f.missingStyleErrorMsg;throw n.error(d),Error(d)}return i.length?(i.length>1&&n.warn(f.multipleTokensErrorMsg),i[0]):(a.length&&n.log([`Listed mapbox access token(s)`,a.join(`,`),`but did not use a Mapbox map style, ignoring token(s).`].join(` `)),``)}function g(e){return typeof e==`string`&&(f.styleValuesMapbox.indexOf(e)!==-1||e.indexOf(`mapbox://`)===0||e.indexOf(`stamen`)===0)}e.updateFx=function(e){for(var t=e._fullLayout,n=t._subplots[d],r=0;r<n.length;r++)t[n[r]]._subplot.updateFx(t)}}),ix=h((e,t)=>{[`*scattermapbox* trace is deprecated!`,"Please consider switching to the *scattermap* trace type and `map` subplots.",`Learn more at: https://plotly.com/python/maplibre-migration/`,`as well as https://plotly.com/javascript/maplibre-migration/`].join(` `),t.exports={attributes:Ub(),supplyDefaults:Gb(),colorbar:gi(),formatLabels:Kb(),calc:Sg(),plot:Yb(),hoverPoints:Xb().hoverPoints,eventData:Zb(),selectPoints:Qb(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.update(t)},moduleType:`trace`,name:`scattermapbox`,basePlotModule:rx(),categories:[`mapbox`,`gl`,`symbols`,`showLegend`,`scatter-like`],meta:{}}}),ax=h((e,t)=>{t.exports=ix()}),ox=h((e,t)=>{var n=Xg(),r=Pt(),{hovertemplateAttrs:i,templatefallbackAttrs:a}=ze(),o=W(),s=z().extendFlat;t.exports=s({locations:{valType:`data_array`,editType:`calc`},z:{valType:`data_array`,editType:`calc`},geojson:{valType:`any`,editType:`calc`},featureidkey:s({},n.featureidkey,{}),below:{valType:`string`,editType:`plot`},text:n.text,hovertext:n.hovertext,marker:{line:{color:s({},n.marker.line.color,{editType:`plot`}),width:s({},n.marker.line.width,{editType:`plot`}),editType:`calc`},opacity:s({},n.marker.opacity,{editType:`plot`}),editType:`calc`},selected:{marker:{opacity:s({},n.selected.marker.opacity,{editType:`plot`}),editType:`plot`},editType:`plot`},unselected:{marker:{opacity:s({},n.unselected.marker.opacity,{editType:`plot`}),editType:`plot`},editType:`plot`},hoverinfo:n.hoverinfo,hovertemplate:i({},{keys:[`properties`]}),hovertemplatefallback:a(),showlegend:s({},o.showlegend,{dflt:!1})},r(``,{cLetter:`z`,editTypeOverride:`calc`}))}),sx=h((e,t)=>{var n=$(),r=Gt(),i=ox();t.exports=function(e,t,a,o){function s(r,a){return n.coerce(e,t,i,r,a)}var c=s(`locations`),l=s(`z`),u=s(`geojson`);if(!n.isArrayOrTypedArray(c)||!c.length||!n.isArrayOrTypedArray(l)||!l.length||!(typeof u==`string`&&u!==``||n.isPlainObject(u))){t.visible=!1;return}s(`featureidkey`),t._length=Math.min(c.length,l.length),s(`below`),s(`text`),s(`hovertext`),s(`hovertemplate`),s(`hovertemplatefallback`),s(`marker.line.width`)&&s(`marker.line.color`),s(`marker.opacity`),r(e,t,o,s,{prefix:``,cLetter:`z`}),n.coerceSelectionMarkerOpacity(t,s)}}),cx=h((e,t)=>{var n=D(),r=$(),i=Yt(),a=tn(),o=Eg().makeBlank,s=Pg();function c(e){var t=e[0].trace,a=t.visible===!0&&t._length!==0,c={layout:{visibility:`none`},paint:{}},u={layout:{visibility:`none`},paint:{}},d=t._opts={fill:c,line:u,geojson:o()};if(!a)return d;var f=s.extractTraceFeature(e);if(!f)return d;var p=i.makeColorScaleFuncFromTrace(t),m=t.marker,h=m.line||{},g;r.isArrayOrTypedArray(m.opacity)&&(g=function(e){var t=e.mo;return n(t)?+r.constrain(t,0,1):0});var _;r.isArrayOrTypedArray(h.color)&&(_=function(e){return e.mlc});var v;r.isArrayOrTypedArray(h.width)&&(v=function(e){return e.mlw});for(var y=0;y<e.length;y++){var b=e[y],x=b.fOut;if(x){var S=x.properties;S.fc=p(b.z),g&&(S.mo=g(b)),_&&(S.mlc=_(b)),v&&(S.mlw=v(b)),b.ct=S.ct,b._polygons=s.feature2polygons(x)}}var C=g?{type:`identity`,property:`mo`}:m.opacity;return r.extendFlat(c.paint,{"fill-color":{type:`identity`,property:`fc`},"fill-opacity":C}),r.extendFlat(u.paint,{"line-color":_?{type:`identity`,property:`mlc`}:h.color,"line-width":v?{type:`identity`,property:`mlw`}:h.width,"line-opacity":C}),c.layout.visibility=`visible`,u.layout.visibility=`visible`,d.geojson={type:`FeatureCollection`,features:f},l(e),d}function l(e){var t=e[0].trace,n=t._opts,i;if(t.selectedpoints){for(var o=a.makeSelectedPointStyleFns(t),s=0;s<e.length;s++){var c=e[s];c.fOut&&(c.fOut.properties.mo2=o.selectedOpacityFn(c))}i={type:`identity`,property:`mo2`}}else i=r.isArrayOrTypedArray(t.marker.opacity)?{type:`identity`,property:`mo`}:t.marker.opacity;return r.extendFlat(n.fill.paint,{"fill-opacity":i}),r.extendFlat(n.line.paint,{"line-opacity":i}),n}t.exports={convert:c,convertOnSelect:l}}),lx=h((e,t)=>{var n=cx().convert,r=cx().convertOnSelect,i=Vb().traceLayerPrefix;function a(e,t){this.type=`choroplethmapbox`,this.subplot=e,this.uid=t,this.sourceId=`source-`+t,this.layerList=[[`fill`,i+t+`-fill`],[`line`,i+t+`-line`]],this.below=null}var o=a.prototype;o.update=function(e){this._update(n(e)),e[0].trace._glTrace=this},o.updateOnSelect=function(e){this._update(r(e))},o._update=function(e){var t=this.subplot,n=this.layerList,r=t.belowLookup[`trace-`+this.uid];t.map.getSource(this.sourceId).setData(e.geojson),r!==this.below&&(this._removeLayers(),this._addLayers(e,r),this.below=r);for(var i=0;i<n.length;i++){var a=n[i],o=a[0],s=a[1],c=e[o];t.setOptions(s,`setLayoutProperty`,c.layout),c.layout.visibility===`visible`&&t.setOptions(s,`setPaintProperty`,c.paint)}},o._addLayers=function(e,t){for(var n=this.subplot,r=this.layerList,i=this.sourceId,a=0;a<r.length;a++){var o=r[a],s=o[0],c=e[s];n.addLayer({type:s,id:o[1],source:i,layout:c.layout,paint:c.paint},t)}},o._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,n=t.length-1;n>=0;n--)e.removeLayer(t[n][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var r=t[0].trace,i=new a(e,r.uid),o=i.sourceId,s=n(t),c=i.below=e.belowLookup[`trace-`+r.uid];return e.map.addSource(o,{type:`geojson`,data:s.geojson}),i._addLayers(s,c),t[0].trace._glTrace=i,i}}),ux=h((e,t)=>{[`*choroplethmapbox* trace is deprecated!`,"Please consider switching to the *choroplethmap* trace type and `map` subplots.",`Learn more at: https://plotly.com/python/maplibre-migration/`,`as well as https://plotly.com/javascript/maplibre-migration/`].join(` `),t.exports={attributes:ox(),supplyDefaults:sx(),colorbar:Uo(),calc:Qg(),plot:lx(),hoverPoints:t_(),eventData:n_(),selectPoints:r_(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.updateOnSelect(t)},getBelow:function(e,t){for(var n=t.getMapLayers(),r=n.length-2;r>=0;r--){var i=n[r].id;if(typeof i==`string`&&i.indexOf(`water`)===0){for(var a=r+1;a<n.length;a++)if(i=n[a].id,typeof i==`string`&&i.indexOf(`plotly-`)===-1)return i}}},moduleType:`trace`,name:`choroplethmapbox`,basePlotModule:rx(),categories:[`mapbox`,`gl`,`noOpacity`,`showLegend`],meta:{hr_name:`choropleth_mapbox`}}}),dx=h((e,t)=>{t.exports=ux()}),fx=h((e,t)=>{var n=Pt(),{hovertemplateAttrs:r,templatefallbackAttrs:i}=ze(),a=W(),o=Ub(),s=z().extendFlat;t.exports=s({lon:o.lon,lat:o.lat,z:{valType:`data_array`,editType:`calc`},radius:{valType:`number`,editType:`plot`,arrayOk:!0,min:1,dflt:30},below:{valType:`string`,editType:`plot`},text:o.text,hovertext:o.hovertext,hoverinfo:s({},a.hoverinfo,{flags:[`lon`,`lat`,`z`,`text`,`name`]}),hovertemplate:r(),hovertemplatefallback:i(),showlegend:s({},a.showlegend,{dflt:!1})},n(``,{cLetter:`z`,editTypeOverride:`calc`}))}),px=h((e,t)=>{var n=$(),r=Gt(),i=fx();t.exports=function(e,t,a,o){function s(r,a){return n.coerce(e,t,i,r,a)}var c=s(`lon`)||[],l=s(`lat`)||[],u=Math.min(c.length,l.length);if(!u){t.visible=!1;return}t._length=u,s(`z`),s(`radius`),s(`below`),s(`text`),s(`hovertext`),s(`hovertemplate`),s(`hovertemplatefallback`),r(e,t,o,s,{prefix:``,cLetter:`z`})}}),mx=h((e,t)=>{var n=D(),r=$().isArrayOrTypedArray,i=O().BADNUM,a=Jt(),o=$()._;t.exports=function(e,t){for(var s=t._length,c=Array(s),l=t.z,u=r(l)&&l.length,d=0;d<s;d++){var f=c[d]={},p=t.lon[d],m=t.lat[d];if(f.lonlat=n(p)&&n(m)?[+p,+m]:[i,i],u){var h=l[d];f.z=n(h)?h:i}}return a(e,t,{vals:u?l:[0,1],containerStr:``,cLetter:`z`}),s&&(c[0].t={labels:{lat:o(e,`lat:`)+` `,lon:o(e,`lon:`)+` `}}),c}}),hx=h((e,t)=>{var n=D(),r=$(),i=q(),a=Yt(),o=O().BADNUM,s=Eg().makeBlank;t.exports=function(e){var t=e[0].trace,c=t.visible===!0&&t._length!==0,l=t._opts={heatmap:{layout:{visibility:`none`},paint:{}},geojson:s()};if(!c)return l;var u=[],d,f=t.z,p=t.radius,m=r.isArrayOrTypedArray(f)&&f.length,h=r.isArrayOrTypedArray(p);for(d=0;d<e.length;d++){var g=e[d],_=g.lonlat;if(_[0]!==o){var v={};if(m){var y=g.z;v.z=y===o?0:y}h&&(v.r=n(p[d])&&p[d]>0?+p[d]:0),u.push({type:`Feature`,geometry:{type:`Point`,coordinates:_},properties:v})}}var b=a.extractOpts(t),x=b.reversescale?a.flipScale(b.colorscale):b.colorscale,S=x[0][1],C=[`interpolate`,[`linear`],[`heatmap-density`],0,i.opacity(S)<1?S:i.addOpacity(S,0)];for(d=1;d<x.length;d++)C.push(x[d][0],x[d][1]);var w=[`interpolate`,[`linear`],[`get`,`z`],b.min,0,b.max,1];return r.extendFlat(l.heatmap.paint,{"heatmap-weight":m?w:1/(b.max-b.min),"heatmap-color":C,"heatmap-radius":h?{type:`identity`,property:`r`}:t.radius,"heatmap-opacity":t.opacity}),l.geojson={type:`FeatureCollection`,features:u},l.heatmap.layout.visibility=`visible`,l}}),gx=h((e,t)=>{var n=hx(),r=Vb().traceLayerPrefix;function i(e,t){this.type=`densitymapbox`,this.subplot=e,this.uid=t,this.sourceId=`source-`+t,this.layerList=[[`heatmap`,r+t+`-heatmap`]],this.below=null}var a=i.prototype;a.update=function(e){var t=this.subplot,r=this.layerList,i=n(e),a=t.belowLookup[`trace-`+this.uid];t.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var o=0;o<r.length;o++){var s=r[o],c=s[0],l=s[1],u=i[c];t.setOptions(l,`setLayoutProperty`,u.layout),u.layout.visibility===`visible`&&t.setOptions(l,`setPaintProperty`,u.paint)}},a._addLayers=function(e,t){for(var n=this.subplot,r=this.layerList,i=this.sourceId,a=0;a<r.length;a++){var o=r[a],s=o[0],c=e[s];n.addLayer({type:s,id:o[1],source:i,layout:c.layout,paint:c.paint},t)}},a._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,n=t.length-1;n>=0;n--)e.removeLayer(t[n][1])},a.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var r=t[0].trace,a=new i(e,r.uid),o=a.sourceId,s=n(t),c=a.below=e.belowLookup[`trace-`+r.uid];return e.map.addSource(o,{type:`geojson`,data:s.geojson}),a._addLayers(s,c),a}}),_x=h((e,t)=>{var n=sn(),r=Xb().hoverPoints,i=Xb().getExtraText;t.exports=function(e,t,a){var o=r(e,t,a);if(o){var s=o[0],c=s.cd,l=c[0].trace,u=c[s.index];if(delete s.color,`z`in u){var d=s.subplot.mockAxis;s.z=u.z,s.zLabel=n.tickText(d,d.c2l(u.z),`hover`).text}return s.extraText=i(l,u,c[0].t.labels),[s]}}}),vx=h((e,t)=>{t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e.z=t.z,e}}),yx=h((e,t)=>{[`*densitymapbox* trace is deprecated!`,"Please consider switching to the *densitymap* trace type and `map` subplots.",`Learn more at: https://plotly.com/python/maplibre-migration/`,`as well as https://plotly.com/javascript/maplibre-migration/`].join(` `),t.exports={attributes:fx(),supplyDefaults:px(),colorbar:Uo(),formatLabels:Kb(),calc:mx(),plot:gx(),hoverPoints:_x(),eventData:vx(),getBelow:function(e,t){for(var n=t.getMapLayers(),r=0;r<n.length;r++){var i=n[r],a=i.id;if(i.type===`symbol`&&typeof a==`string`&&a.indexOf(`plotly-`)===-1)return a}},moduleType:`trace`,name:`densitymapbox`,basePlotModule:rx(),categories:[`mapbox`,`gl`,`showLegend`],meta:{hr_name:`density_mapbox`}}}),bx=h((e,t)=>{t.exports=yx()}),xx=h((e,t)=>{t.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`}}),Sx=h((e,t)=>{t.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`}}]}}),Cx=h((e,t)=>{var n=Xe(),r=xx(),i=Sx(),a=`© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors`,o=`https://basemaps.cartocdn.com/gl/positron-gl-style/style.json`,s=`https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json`,c=`https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json`,l=`https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json`,u=`https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json`,d=`https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json`,f={basic:c,streets:c,outdoors:c,light:o,dark:s,satellite:i,"satellite-streets":r,"open-street-map":{id:`osm`,version:8,sources:{"plotly-osm-tiles":{type:`raster`,attribution:a,tiles:[`https://tile.openstreetmap.org/{z}/{x}/{y}.png`],tileSize:256}},layers:[{id:`plotly-osm-tiles`,type:`raster`,source:`plotly-osm-tiles`,minzoom:0,maxzoom:22}],glyphs:`https://fonts.openmaptiles.org/{fontstack}/{range}.pbf`},"white-bg":{id:`white-bg`,version:8,sources:{},layers:[{id:`white-bg`,type:`background`,paint:{"background-color":`#FFFFFF`},minzoom:0,maxzoom:22}],glyphs:`https://fonts.openmaptiles.org/{fontstack}/{range}.pbf`},"carto-positron":o,"carto-darkmatter":s,"carto-voyager":c,"carto-positron-nolabels":l,"carto-darkmatter-nolabels":u,"carto-voyager-nolabels":d},p=n(f);t.exports={styleValueDflt:`basic`,stylesMap:f,styleValuesMap:p,traceLayerPrefix:`plotly-trace-layer-`,layoutLayerPrefix:`plotly-layout-layer-`,missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",p.join(`, `),`or use a tile service.`].join(`
`),mapOnErrorMsg:`Map error.`}}),wx=h((e,t)=>{var n=$(),r=q().defaultLine,i=Da().attributes,a=B(),o=Tr().textposition,s=Ie().overrideAll,c=yt().templatedArray,l=Cx(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt=`Open Sans Regular, Arial Unicode MS Regular`;var d=t.exports=s({_arrayAttrRegexps:[n.counterRegex(`map`,`.layers`,!0)],domain:i({name:`map`}),style:{valType:`any`,values:l.styleValuesMap,dflt:l.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:c(`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:r},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:r}},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:u,textposition:n.extendFlat({},o,{arrayOk:!1})}})},`plot`,`from-root`);d.uirevision={valType:`any`,editType:`none`}}),Tx=h((e,t)=>{var{hovertemplateAttrs:n,texttemplateAttrs:r,templatefallbackAttrs:i}=ze(),a=wr(),o=yg(),s=Tr(),c=wx(),l=W(),u=Pt(),d=z().extendFlat,f=Ie().overrideAll,p=wx(),m=o.line,h=o.marker;t.exports=f({lon:o.lon,lat:o.lat,cluster:{enabled:{valType:`boolean`},maxzoom:d({},p.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:d({},h.opacity,{dflt:1})},mode:d({},s.mode,{dflt:`markers`}),text:d({},s.text,{}),texttemplate:r({editType:`plot`},{keys:[`lat`,`lon`,`text`]}),texttemplatefallback:i({editType:`plot`}),hovertext:d({},s.hovertext,{}),line:{color:m.color,width:m.width},connectgaps:s.connectgaps,marker:d({symbol:{valType:`string`,dflt:`circle`,arrayOk:!0},angle:{valType:`number`,dflt:`auto`,arrayOk:!0},allowoverlap:{valType:`boolean`,dflt:!1},opacity:h.opacity,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode},u(`marker`)),fill:o.fill,fillcolor:a(),textfont:c.layers.symbol.textfont,textposition:c.layers.symbol.textposition,below:{valType:`string`},selected:{marker:s.selected.marker},unselected:{marker:s.unselected.marker},hoverinfo:d({},l.hoverinfo,{flags:[`lon`,`lat`,`text`,`name`]}),hovertemplate:n(),hovertemplatefallback:i()},`calc`,`nested`)}),Ex=h((e,t)=>{var n=`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`.split(`.`);t.exports={isSupportedFont:function(e){return n.indexOf(e)!==-1}}}),Dx=h((e,t)=>{var n=$(),r=Xt(),i=Yr(),a=Xr(),o=Qr(),s=$r(),c=Tx(),l=Ex().isSupportedFont;t.exports=function(e,t,d,f){function p(r,i){return n.coerce(e,t,c,r,i)}function m(r,i){return n.coerce2(e,t,c,r,i)}if(!u(e,t,p)){t.visible=!1;return}if(p(`text`),p(`texttemplate`),p(`texttemplatefallback`),p(`hovertext`),p(`hovertemplate`),p(`hovertemplatefallback`),p(`mode`),p(`below`),r.hasMarkers(t)){i(e,t,d,f,p,{noLine:!0,noAngle:!0}),p(`marker.allowoverlap`),p(`marker.angle`);var h=t.marker;h.symbol!==`circle`&&(n.isArrayOrTypedArray(h.size)&&(h.size=h.size[0]),n.isArrayOrTypedArray(h.color)&&(h.color=h.color[0]))}r.hasLines(t)&&(a(e,t,d,f,p,{noDash:!0}),p(`connectgaps`));var g=m(`cluster.maxzoom`),_=m(`cluster.step`),v=m(`cluster.color`,t.marker&&t.marker.color||d),y=m(`cluster.size`),b=m(`cluster.opacity`);if(p(`cluster.enabled`,g!==!1||_!==!1||v!==!1||y!==!1||b!==!1)||r.hasText(t)){var x=f.font.family;o(e,t,f,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:l(x)?x:`Open Sans Regular`,weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}p(`fill`),t.fill!==`none`&&s(e,t,d,p),n.coerceSelectionMarkerOpacity(t,p)};function u(e,t,n){var r=n(`lon`)||[],i=n(`lat`)||[],a=Math.min(r.length,i.length);return t._length=a,a}}),Ox=h((e,t)=>{var n=sn();t.exports=function(e,t,r){var i={},a=r[t.subplot]._subplot.mockAxis,o=e.lonlat;return i.lonLabel=n.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=n.tickText(a,a.c2l(o[1]),!0).text,i}}),kx=h((e,t)=>{var n=$();t.exports=function(e,t){var r=e.split(` `),i=r[0],a=r[1],o=n.isArrayOrTypedArray(t)?n.mean(t):t,s=.5+o/100,c=1.5+o/100,l=[``,``],u=[0,0];switch(i){case`top`:l[0]=`top`,u[1]=-c;break;case`bottom`:l[0]=`bottom`,u[1]=c;break}switch(a){case`left`:l[1]=`right`,u[0]=-s;break;case`right`:l[1]=`left`,u[0]=s;break}var d;return d=l[0]&&l[1]?l.join(`-`):l[0]?l[0]:l[1]?l[1]:`center`,{anchor:d,offset:u}}}),Ax=h((e,t)=>{var n=D(),r=$(),i=O().BADNUM,a=Eg(),o=Yt(),s=tn(),c=Zt(),l=Xt(),u=Ex().isSupportedFont,d=kx(),f=Qt().appendArrayPointValue,p=kt().NEWLINES,m=kt().BR_TAG_ALL;t.exports=function(e,t){var n=t[0].trace,i=n.visible===!0&&n._length!==0,o=n.fill!==`none`,s=l.hasLines(n),c=l.hasMarkers(n),u=l.hasText(n),f=c&&n.marker.symbol===`circle`,p=c&&n.marker.symbol!==`circle`,m=n.cluster&&n.cluster.enabled,v=h(`fill`),y=h(`line`),b=h(`circle`),C=h(`symbol`),w={fill:v,line:y,circle:b,symbol:C};if(!i)return w;var T;if((o||s)&&(T=a.calcTraceToLineCoords(t)),o&&(v.geojson=a.makePolygon(T),v.layout.visibility=`visible`,r.extendFlat(v.paint,{"fill-color":n.fillcolor})),s&&(y.geojson=a.makeLine(T),y.layout.visibility=`visible`,r.extendFlat(y.paint,{"line-width":n.line.width,"line-color":n.line.color,"line-opacity":n.opacity})),f){var E=g(t);b.geojson=E.geojson,b.layout.visibility=`visible`,m&&(b.filter=[`!`,[`has`,`point_count`]],w.cluster={type:`circle`,filter:[`has`,`point_count`],layout:{visibility:`visible`},paint:{"circle-color":x(n.cluster.color,n.cluster.step),"circle-radius":x(n.cluster.size,n.cluster.step),"circle-opacity":x(n.cluster.opacity,n.cluster.step)}},w.clusterCount={type:`symbol`,filter:[`has`,`point_count`],paint:{},layout:{"text-field":`{point_count_abbreviated}`,"text-font":S(n),"text-size":12}}),r.extendFlat(b.paint,{"circle-color":E.mcc,"circle-radius":E.mrc,"circle-opacity":E.mo})}if(f&&m&&(b.filter=[`!`,[`has`,`point_count`]]),(p||u)&&(C.geojson=_(t,e),r.extendFlat(C.layout,{visibility:`visible`,"icon-image":`{symbol}-15`,"text-field":`{text}`}),p&&(r.extendFlat(C.layout,{"icon-size":n.marker.size/10}),`angle`in n.marker&&n.marker.angle!==`auto`&&r.extendFlat(C.layout,{"icon-rotate":{type:`identity`,property:`angle`},"icon-rotation-alignment":`map`}),C.layout[`icon-allow-overlap`]=n.marker.allowoverlap,r.extendFlat(C.paint,{"icon-opacity":n.opacity*n.marker.opacity,"icon-color":n.marker.color})),u)){var D=(n.marker||{}).size,O=d(n.textposition,D);r.extendFlat(C.layout,{"text-size":n.textfont.size,"text-anchor":O.anchor,"text-offset":O.offset,"text-font":S(n)}),r.extendFlat(C.paint,{"text-color":n.textfont.color,"text-opacity":n.opacity})}return w};function h(e){return{type:e,geojson:a.makeBlank(),layout:{visibility:`none`},filter:null,paint:{}}}function g(e){var t=e[0].trace,i=t.marker,a=t.selectedpoints,l=r.isArrayOrTypedArray(i.color),u=r.isArrayOrTypedArray(i.size),d=r.isArrayOrTypedArray(i.opacity),f;function p(e){return t.opacity*e}function m(e){return e/2}var h;l&&(h=o.hasColorscale(t,`marker`)?o.makeColorScaleFuncFromTrace(i):r.identity);var g;u&&(g=c(t));var _;d&&(_=function(e){return p(n(e)?+r.constrain(e,0,1):0)});var v=[];for(f=0;f<e.length;f++){var y=e[f],x=y.lonlat;if(!b(x)){var S={};h&&(S.mcc=y.mcc=h(y.mc)),g&&(S.mrc=y.mrc=g(y.ms)),_&&(S.mo=_(y.mo)),a&&(S.selected=y.selected||0),v.push({type:`Feature`,id:f+1,geometry:{type:`Point`,coordinates:x},properties:S})}}var C;if(a)for(C=s.makeSelectedPointStyleFns(t),f=0;f<v.length;f++){var w=v[f].properties;C.selectedOpacityFn&&(w.mo=p(C.selectedOpacityFn(w))),C.selectedColorFn&&(w.mcc=C.selectedColorFn(w)),C.selectedSizeFn&&(w.mrc=C.selectedSizeFn(w))}return{geojson:{type:`FeatureCollection`,features:v},mcc:l||C&&C.selectedColorFn?{type:`identity`,property:`mcc`}:i.color,mrc:u||C&&C.selectedSizeFn?{type:`identity`,property:`mrc`}:m(i.size),mo:d||C&&C.selectedOpacityFn?{type:`identity`,property:`mo`}:p(i.opacity)}}function _(e,t){for(var n=t._fullLayout,i=e[0].trace,a=i.marker||{},o=a.symbol,s=a.angle,c=o===`circle`?y:v(o),u=s===`auto`?y:v(s,!0),d=l.hasText(i)?v(i.text):y,h=[],g=0;g<e.length;g++){var _=e[g];if(!b(_.lonlat)){var x=i.texttemplate,S;if(x){var C=Array.isArray(x)?x[g]||``:x,w=i._module.formatLabels(_,i,n),T={};f(T,i,_.i),S=r.texttemplateString({data:[T,_,i._meta],fallback:i.texttemplatefallback,labels:w,locale:n._d3locale,template:C})}else S=d(g);S&&=S.replace(p,``).replace(m,`
`),h.push({type:`Feature`,geometry:{type:`Point`,coordinates:_.lonlat},properties:{symbol:c(g),angle:u(g),text:S}})}}return{type:`FeatureCollection`,features:h}}function v(e,t){return r.isArrayOrTypedArray(e)?t?function(t){return n(e[t])?+e[t]:0}:function(t){return e[t]}:e?function(){return e}:y}function y(){return``}function b(e){return e[0]===i}function x(e,t){var n;if(r.isArrayOrTypedArray(e)&&r.isArrayOrTypedArray(t)){n=[`step`,[`get`,`point_count`],e[0]];for(var i=1;i<e.length;i++)n.push(t[i-1],e[i])}else n=e;return n}function S(e){var t=e.textfont,n=t.family,r=t.style,i=t.weight,a=n.split(` `),o=a[a.length-1]===`Italic`;o&&a.pop(),o||=r===`italic`;var s=a.join(` `);return i===`bold`&&a.indexOf(`Bold`)===-1?s+=` Bold`:i<=1e3&&(a[0]===`Metropolis`?(s=`Metropolis`,i>850?s+=` Black`:i>750?s+=` Extra Bold`:i>650?s+=` Bold`:i>550?s+=` Semi Bold`:i>450?s+=` Medium`:i>350?s+=` Regular`:i>250?s+=` Light`:i>150?s+=` Extra Light`:s+=` Thin`):a.slice(0,2).join(` `)===`Open Sans`?(s=`Open Sans`,i>750?s+=` Extrabold`:i>650?s+=` Bold`:i>550?s+=` Semibold`:i>350?s+=` Regular`:s+=` Light`):a.slice(0,3).join(` `)===`Klokantech Noto Sans`&&(s=`Klokantech Noto Sans`,a[3]===`CJK`&&(s+=` CJK`),s+=i>500?` Bold`:` Regular`)),o&&(s+=` Italic`),s===`Open Sans Regular Italic`?s=`Open Sans Italic`:s===`Open Sans Regular Bold`?s=`Open Sans Bold`:s===`Open Sans Regular Bold Italic`?s=`Open Sans Bold Italic`:s===`Klokantech Noto Sans Regular Italic`&&(s=`Klokantech Noto Sans Italic`),u(s)||(s=n),s.split(`, `)}}),jx=h((e,t)=>{var n=$(),r=Ax(),i=Cx().traceLayerPrefix,a={cluster:[`cluster`,`clusterCount`,`circle`],nonCluster:[`fill`,`line`,`circle`,`symbol`]};function o(e,t,n,r){this.type=`scattermap`,this.subplot=e,this.uid=t,this.clusterEnabled=n,this.isHidden=r,this.sourceIds={fill:`source-`+t+`-fill`,line:`source-`+t+`-line`,circle:`source-`+t+`-circle`,symbol:`source-`+t+`-symbol`,cluster:`source-`+t+`-circle`,clusterCount:`source-`+t+`-circle`},this.layerIds={fill:i+t+`-fill`,line:i+t+`-line`,circle:i+t+`-circle`,symbol:i+t+`-symbol`,cluster:i+t+`-cluster`,clusterCount:i+t+`-cluster-count`},this.below=null}var s=o.prototype;s.addSource=function(e,t,r){var i={type:`geojson`,data:t.geojson};r&&r.enabled&&n.extendFlat(i,{cluster:!0,clusterMaxZoom:r.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[e]);a?a.setData(t.geojson):this.subplot.map.addSource(this.sourceIds[e],i)},s.setSourceData=function(e,t){this.subplot.map.getSource(this.sourceIds[e]).setData(t.geojson)},s.addLayer=function(e,t,n){var r={type:t.type,id:this.layerIds[e],source:this.sourceIds[e],layout:t.layout,paint:t.paint};t.filter&&(r.filter=t.filter);for(var i=this.layerIds[e],a,o=this.subplot.getMapLayers(),s=0;s<o.length;s++)if(o[s].id===i){a=!0;break}a?(this.subplot.setOptions(i,`setLayoutProperty`,r.layout),r.layout.visibility===`visible`&&this.subplot.setOptions(i,`setPaintProperty`,r.paint)):this.subplot.addLayer(r,n)},s.update=function(e){var t=e[0].trace,n=this.subplot,i=n.map,o=r(n.gd,e),s=n.belowLookup[`trace-`+this.uid],c=!!(t.cluster&&t.cluster.enabled),l=!!this.clusterEnabled,u=this;function d(e){e||u.addSource(`circle`,o.circle,t.cluster);for(var n=a.cluster,r=0;r<n.length;r++){var i=n[r],c=o[i];u.addLayer(i,c,s)}}function f(e){for(var t=a.cluster,n=t.length-1;n>=0;n--){var r=t[n];i.removeLayer(u.layerIds[r])}e||i.removeSource(u.sourceIds.circle)}function p(e){for(var t=a.nonCluster,n=0;n<t.length;n++){var r=t[n],i=o[r];e||u.addSource(r,i),u.addLayer(r,i,s)}}function m(e){for(var t=a.nonCluster,n=t.length-1;n>=0;n--){var r=t[n];i.removeLayer(u.layerIds[r]),e||i.removeSource(u.sourceIds[r])}}function h(e){l?f(e):m(e)}function g(e){c?d(e):p(e)}function _(){for(var e=c?a.cluster:a.nonCluster,t=0;t<e.length;t++){var r=e[t],i=o[r];i&&(n.setOptions(u.layerIds[r],`setLayoutProperty`,i.layout),i.layout.visibility===`visible`&&(r!==`cluster`&&u.setSourceData(r,i),n.setOptions(u.layerIds[r],`setPaintProperty`,i.paint)))}}var v=this.isHidden,y=t.visible!==!0;y?v||h():v?y||g():l===c?(this.below!==s&&(h(!0),g(!0)),_()):(h(),g()),this.clusterEnabled=c,this.isHidden=y,this.below=s,e[0].trace._glTrace=this},s.dispose=function(){for(var e=this.subplot.map,t=this.clusterEnabled?a.cluster:a.nonCluster,n=t.length-1;n>=0;n--){var r=t[n];e.removeLayer(this.layerIds[r]),e.removeSource(this.sourceIds[r])}},t.exports=function(e,t){var n=t[0].trace,i=n.cluster&&n.cluster.enabled,s=n.visible!==!0,c=new o(e,n.uid,i,s),l=r(e.gd,t),u=c.below=e.belowLookup[`trace-`+n.uid],d,f,p;if(i)for(c.addSource(`circle`,l.circle,n.cluster),d=0;d<a.cluster.length;d++)f=a.cluster[d],p=l[f],c.addLayer(f,p,u);else for(d=0;d<a.nonCluster.length;d++)f=a.nonCluster[d],p=l[f],c.addSource(f,p,n.cluster),c.addLayer(f,p,u);return t[0].trace._glTrace=c,c}}),Mx=h((e,t)=>{var n=Ln(),r=$(),i=yi(),a=r.fillText,o=O().BADNUM,s=Cx().traceLayerPrefix;function c(e,t,a){var c=e.cd,u=c[0].trace,d=e.xa,f=e.ya,p=e.subplot,m=[],h=s+u.uid+`-circle`,g=u.cluster&&u.cluster.enabled;g&&(m=p.map.queryRenderedFeatures(null,{layers:[h]}).map(function(e){return e.id}));var _=(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360))*360,v=t-_;function y(e){var t=e.lonlat;if(t[0]===o||g&&m.indexOf(e.i+1)===-1)return 1/0;var n=r.modHalf(t[0],360),i=t[1],s=p.project([n,i]),c=s.x-d.c2p([v,i]),l=s.y-f.c2p([n,a]),u=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(c*c+l*l)-u,1-3/u)}if(n.getClosest(c,y,e),e.index!==!1){var b=c[e.index],x=b.lonlat,S=[r.modHalf(x[0],360)+_,x[1]],C=d.c2p(S),w=f.c2p(S),T=b.mrc||1;e.x0=C-T,e.x1=C+T,e.y0=w-T,e.y1=w+T;var E={};E[u.subplot]={_subplot:p};var D=u._module.formatLabels(b,u,E);return e.lonLabel=D.lonLabel,e.latLabel=D.latLabel,e.color=i(u,b),e.extraText=l(u,b,c[0].t.labels),e.hovertemplate=u.hovertemplate,[e]}}function l(e,t,n){if(e.hovertemplate)return;var r=(t.hi||e.hoverinfo).split(`+`),i=r.indexOf(`all`)!==-1,o=r.indexOf(`lon`)!==-1,s=r.indexOf(`lat`)!==-1,c=t.lonlat,l=[];function u(e){return e+`°`}return i||o&&s?l.push(`(`+u(c[1])+`, `+u(c[0])+`)`):o?l.push(n.lon+u(c[0])):s&&l.push(n.lat+u(c[1])),(i||r.indexOf(`text`)!==-1)&&a(t,e,l),l.join(`<br>`)}t.exports={hoverPoints:c,getExtraText:l}}),Nx=h((e,t)=>{t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e}}),Px=h((e,t)=>{var n=$(),r=Xt(),i=O().BADNUM;t.exports=function(e,t){var a=e.cd,o=e.xaxis,s=e.yaxis,c=[],l=a[0].trace,u;if(!r.hasMarkers(l))return[];if(t===!1)for(u=0;u<a.length;u++)a[u].selected=0;else for(u=0;u<a.length;u++){var d=a[u],f=d.lonlat;if(f[0]!==i){var p=[n.modHalf(f[0],360),f[1]],m=[o.c2p(p),s.c2p(p)];t.contains(m,null,u,e)?(c.push({pointNumber:u,lon:f[0],lat:f[1]}),d.selected=1):d.selected=0}}return c}}),Fx=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():(n=typeof globalThis<`u`?globalThis:n||self,n.maplibregl=r())})(e,function(){var e={},t={};function n(n,r,i){if(t[n]=i,n===`index`){var a=`var sharedModule = {}; (`+t.shared+`)(sharedModule); (`+t.worker+`)(sharedModule);`,o={};return t.shared(o),t.index(e,o),typeof window<`u`&&e.setWorkerUrl(window.URL.createObjectURL(new Blob([a],{type:`text/javascript`}))),e}}return n(`shared`,[`exports`],function(e){function t(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var r=i;function i(e,t){this.x=e,this.y=t}i.prototype={clone:function(){return new i(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=n*this.x+t*this.y;return this.x=t*this.x-n*this.y,this.y=r,this},_rotateAround:function(e,t){var n=Math.cos(e),r=Math.sin(e),i=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=t.x+n*(this.x-t.x)-r*(this.y-t.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(e){return e instanceof i?e:Array.isArray(e)?new i(e[0],e[1]):e};var a=n(r),o=s;function s(e,t,n,r){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=n,this.p2y=r}s.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(t===void 0&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,r=0;r<8;r++){var i=this.sampleCurveX(n)-e;if(Math.abs(i)<t)return n;var a=this.sampleCurveDerivativeX(n);if(Math.abs(a)<1e-6)break;n-=i/a}var o=0,s=1;for(n=e,r=0;r<20&&(i=this.sampleCurveX(n),!(Math.abs(i-e)<t));r++)e>i?o=n:s=n,n=.5*(s-o)+o;return n},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var c=n(o);let l,u;function p(){return l??=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)&&typeof createImageBitmap==`function`,l}function m(){if(u==null&&(u=!1,p())){let e=new OffscreenCanvas(5,5).getContext(`2d`,{willReadFrequently:!0});if(e){for(let t=0;t<25;t++){let n=4*t;e.fillStyle=`rgb(${n},${n+1},${n+2})`,e.fillRect(t%5,Math.floor(t/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let e=0;e<100;e++)if(e%4!=3&&t[e]!==e){u=!0;break}}}return u||!1}function h(e,t,n,r){let i=new c(e,t,n,r);return e=>i.solve(e)}let g=h(.25,.1,.25,1);function _(e,t,n){return Math.min(n,Math.max(t,e))}function v(e,t,n){let r=n-t,i=((e-t)%r+r)%r+t;return i===t?n:i}function y(e,...t){for(let n of t)for(let t in n)e[t]=n[t];return e}let b=1;function x(e,t,n){let r={};for(let n in e)r[n]=t.call(this,e[n],n,e);return r}function S(e,t,n){let r={};for(let n in e)t.call(this,e[n],n,e)&&(r[n]=e[n]);return r}function C(e){return Array.isArray(e)?e.map(C):typeof e==`object`&&e?x(e,C):e}let w={};function T(e){w[e]||(typeof console<`u`&&console.warn(e),w[e]=!0)}function E(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}function D(e){return typeof WorkerGlobalScope<`u`&&e!==void 0&&e instanceof WorkerGlobalScope}let O=null;function k(e){return typeof ImageBitmap<`u`&&e instanceof ImageBitmap}let A=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=`;function j(e,n,r,i,a){return t(this,void 0,void 0,function*(){if(typeof VideoFrame>`u`)throw Error(`VideoFrame not supported`);let t=new VideoFrame(e,{timestamp:0});try{let o=t?.format;if(!o||!o.startsWith(`BGR`)&&!o.startsWith(`RGB`))throw Error(`Unrecognized format ${o}`);let s=o.startsWith(`BGR`),c=new Uint8ClampedArray(i*a*4);if(yield t.copyTo(c,function(e,t,n,r,i){let a=4*Math.max(-t,0),o=(Math.max(0,n)-n)*r*4+a,s=4*r,c=Math.max(0,t),l=Math.max(0,n);return{rect:{x:c,y:l,width:Math.min(e.width,t+r)-c,height:Math.min(e.height,n+i)-l},layout:[{offset:o,stride:s}]}}(e,n,r,i,a)),s)for(let e=0;e<c.length;e+=4){let t=c[e];c[e]=c[e+2],c[e+2]=t}return c}finally{t.close()}})}let M,N,P=`AbortError`;function F(){return Error(P)}let I={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:``};function L(e){return I.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf(`://`))]}let R=`global-dispatcher`;class z extends Error{constructor(e,t,n,r){super(`AJAXError: ${t} (${e}): ${n}`),this.status=e,this.statusText=t,this.url=n,this.body=r}}let B=()=>D(self)?self.worker&&self.worker.referrer:(window.location.protocol===`blob:`?window.parent:window).location.href,V=function(e,n){if(/:\/\//.test(e.url)&&!/^https?:|^file:/.test(e.url)){let t=L(e.url);if(t)return t(e,n);if(D(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:`GR`,data:e,targetMapId:R},n)}if(!(/^file:/.test(r=e.url)||/^file:/.test(B())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,`signal`))return function(e,n){return t(this,void 0,void 0,function*(){let t=new Request(e.url,{method:e.method||`GET`,body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:B(),signal:n.signal});e.type!==`json`||t.headers.has(`Accept`)||t.headers.set(`Accept`,`application/json`);let r=yield fetch(t);if(!r.ok){let t=yield r.blob();throw new z(r.status,r.statusText,e.url,t)}let i;i=e.type===`arrayBuffer`||e.type===`image`?r.arrayBuffer():e.type===`json`?r.json():r.text();let a=yield i;if(n.signal.aborted)throw F();return{data:a,cacheControl:r.headers.get(`Cache-Control`),expires:r.headers.get(`Expires`)}})}(e,n);if(D(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:`GR`,data:e,mustQueue:!0,targetMapId:R},n)}var r;return function(e,t){return new Promise((n,r)=>{var i;let a=new XMLHttpRequest;a.open(e.method||`GET`,e.url,!0),e.type!==`arrayBuffer`&&e.type!==`image`||(a.responseType=`arraybuffer`);for(let t in e.headers)a.setRequestHeader(t,e.headers[t]);e.type===`json`&&(a.responseType=`text`,(i=e.headers)!=null&&i.Accept||a.setRequestHeader(`Accept`,`application/json`)),a.withCredentials=e.credentials===`include`,a.onerror=()=>{r(Error(a.statusText))},a.onload=()=>{if(!t.signal.aborted)if((a.status>=200&&a.status<300||a.status===0)&&a.response!==null){let t=a.response;if(e.type===`json`)try{t=JSON.parse(a.response)}catch(e){r(e);return}n({data:t,cacheControl:a.getResponseHeader(`Cache-Control`),expires:a.getResponseHeader(`Expires`)})}else{let t=new Blob([a.response],{type:a.getResponseHeader(`Content-Type`)});r(new z(a.status,a.statusText,e.url,t))}},t.signal.addEventListener(`abort`,()=>{a.abort(),r(F())}),a.send(e.body)})}(e,n)};function H(e){if(!e||e.indexOf(`://`)<=0||e.indexOf(`data:image/`)===0||e.indexOf(`blob:`)===0)return!0;let t=new URL(e),n=window.location;return t.protocol===n.protocol&&t.host===n.host}function U(e,t,n){n[e]&&n[e].indexOf(t)!==-1||(n[e]=n[e]||[],n[e].push(t))}function W(e,t,n){if(n&&n[e]){let r=n[e].indexOf(t);r!==-1&&n[e].splice(r,1)}}class G{constructor(e,t={}){y(this,t),this.type=e}}class K extends G{constructor(e,t={}){super(`error`,y({error:e},t))}}class q{on(e,t){return this._listeners=this._listeners||{},U(e,t,this._listeners),this}off(e,t){return W(e,t,this._listeners),W(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},U(e,t,this._oneTimeListeners),this):new Promise(t=>this.once(e,t))}fire(e,t){typeof e==`string`&&(e=new G(e,t||{}));let n=e.type;if(this.listens(n)){e.target=this;let t=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(let n of t)n.call(this,e);let r=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(let t of r)W(n,t,this._oneTimeListeners),t.call(this,e);let i=this._eventedParent;i&&(y(e,typeof this._eventedParentData==`function`?this._eventedParentData():this._eventedParentData),i.fire(e))}else e instanceof K&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}var J={$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 Y=[`type`,`source`,`source-layer`,`minzoom`,`maxzoom`,`filter`,`layout`];function X(e,t){let n={};for(let t in e)t!==`ref`&&(n[t]=e[t]);return Y.forEach(e=>{e in t&&(n[e]=t[e])}),n}function Z(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Z(e[n],t[n]))return!1;return!0}if(typeof e==`object`&&e&&t!==null){if(typeof t!=`object`||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(!Z(e[n],t[n]))return!1;return!0}return e===t}function Q(e,t){e.push(t)}function ee(e,t,n){Q(n,{command:`addSource`,args:[e,t[e]]})}function te(e,t,n){Q(t,{command:`removeSource`,args:[e]}),n[e]=!0}function ne(e,t,n,r){te(e,n,r),ee(e,t,n)}function re(e,t,n){let r;for(r in e[n])if(Object.prototype.hasOwnProperty.call(e[n],r)&&r!==`data`&&!Z(e[n][r],t[n][r]))return!1;for(r in t[n])if(Object.prototype.hasOwnProperty.call(t[n],r)&&r!==`data`&&!Z(e[n][r],t[n][r]))return!1;return!0}function ie(e,t,n,r,i,a){e||={},t||={};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(Z(e[o],t[o])||n.push({command:a,args:[r,o,t[o],i]}));for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&!Object.prototype.hasOwnProperty.call(e,o)&&(Z(e[o],t[o])||n.push({command:a,args:[r,o,t[o],i]}))}function ae(e){return e.id}function oe(e,t){return e[t.id]=t,e}class se{constructor(e,t,n,r){this.message=(e?`${e}: `:``)+n,r&&(this.identifier=r),t!=null&&t.__line__&&(this.line=t.__line__)}}function ce(e,...t){for(let n of t)for(let t in n)e[t]=n[t];return e}class le extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class ue{constructor(e,t=[]){this.parent=e,this.bindings={};for(let[e,n]of t)this.bindings[e]=n}concat(e){return new ue(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}let de={kind:`null`},fe={kind:`number`},pe={kind:`string`},me={kind:`boolean`},he={kind:`color`},ge={kind:`object`},_e={kind:`value`},ve={kind:`collator`},ye={kind:`formatted`},be={kind:`padding`},xe={kind:`resolvedImage`},Se={kind:`variableAnchorOffsetCollection`};function Ce(e,t){return{kind:`array`,itemType:e,N:t}}function we(e){if(e.kind===`array`){let t=we(e.itemType);return typeof e.N==`number`?`array<${t}, ${e.N}>`:e.itemType.kind===`value`?`array`:`array<${t}>`}return e.kind}let Te=[de,fe,pe,me,he,ye,ge,Ce(_e),be,xe,Se];function Ee(e,t){if(t.kind===`error`)return null;if(e.kind===`array`){if(t.kind===`array`&&(t.N===0&&t.itemType.kind===`value`||!Ee(e.itemType,t.itemType))&&(typeof e.N!=`number`||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind===`value`){for(let e of Te)if(!Ee(e,t))return null}}return`Expected ${we(e)} but found ${we(t)} instead.`}function De(e,t){return t.some(t=>t.kind===e.kind)}function Oe(e,t){return t.some(t=>t===`null`?e===null:t===`array`?Array.isArray(e):t===`object`?e&&!Array.isArray(e)&&typeof e==`object`:t===typeof e)}function ke(e,t){return e.kind===`array`&&t.kind===`array`?e.itemType.kind===t.itemType.kind&&typeof e.N==`number`:e.kind===t.kind}let Ae=.96422,je=.82521,Me=4/29,Ne=6/29,Pe=3*Ne*Ne;Ne*Ne*Ne;let Fe=Math.PI/180,Ie=180/Math.PI;function Le(e){return(e%=360)<0&&(e+=360),e}function Re([e,t,n,r]){let i,a,o=Be((.2225045*(e=ze(e))+.7168786*(t=ze(t))+.0606169*(n=ze(n)))/1);e===t&&t===n?i=a=o:(i=Be((.4360747*e+.3850649*t+.1430804*n)/Ae),a=Be((.0139322*e+.0971045*t+.7141733*n)/je));let s=116*o-16;return[s<0?0:s,500*(i-o),200*(o-a),r]}function ze(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Be(e){return e>.008856451679035631?e**(1/3):e/Pe+Me}function Ve([e,t,n,r]){let i=(e+16)/116,a=isNaN(t)?i:i+t/500,o=isNaN(n)?i:i-n/200;return i=1*Ue(i),a=Ae*Ue(a),o=je*Ue(o),[He(3.1338561*a-1.6168667*i-.4906146*o),He(-.9787684*a+1.9161415*i+.033454*o),He(.0719453*a-.2289914*i+1.4052427*o),r]}function He(e){return(e=e<=.00304?12.92*e:1.055*e**(1/2.4)-.055)<0?0:e>1?1:e}function Ue(e){return e>Ne?e*e*e:Pe*(e-Me)}function We(e){return parseInt(e.padEnd(2,e),16)/255}function Ge(e,t){return Ke(t?e/100:e,0,1)}function Ke(e,t,n){return Math.min(Math.max(t,e),n)}function qe(e){return!e.some(Number.isNaN)}let Je={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Ye{constructor(e,t,n,r=1,i=!0){this.r=e,this.g=t,this.b=n,this.a=r,i||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter(`rgb`,[e,t,n,r]))}static parse(e){if(e instanceof Ye)return e;if(typeof e!=`string`)return;let t=function(e){if((e=e.toLowerCase().trim())===`transparent`)return[0,0,0,0];let t=Je[e];if(t){let[e,n,r]=t;return[e/255,n/255,r/255,1]}if(e.startsWith(`#`)&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,n=1;return[We(e.slice(n,n+=t)),We(e.slice(n,n+=t)),We(e.slice(n,n+=t)),We(e.slice(n,n+t)||`ff`)]}if(e.startsWith(`rgb`)){let t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[e,n,r,i,a,o,s,c,l,u,d,f]=t,p=[i||` `,s||` `,u].join(``);if(p===` `||p===` /`||p===`,,`||p===`,,,`){let e=[r,o,l].join(``),t=e===`%%%`?100:e===``?255:0;if(t){let e=[Ke(+n/t,0,1),Ke(+a/t,0,1),Ke(+c/t,0,1),d?Ge(+d,f):1];if(qe(e))return e}}return}}let n=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(n){let[e,t,r,i,a,o,s,c,l]=n,u=[r||` `,a||` `,s].join(``);if(u===` `||u===` /`||u===`,,`||u===`,,,`){let e=[+t,Ke(+i,0,100),Ke(+o,0,100),c?Ge(+c,l):1];if(qe(e))return function([e,t,n,r]){function i(r){let i=(r+e/30)%12,a=t*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(i-3,9-i,1))}return e=Le(e),t/=100,n/=100,[i(0),i(8),i(4),r]}(e)}}}(e);return t?new Ye(...t,!1):void 0}get rgb(){let{r:e,g:t,b:n,a:r}=this,i=r||1/0;return this.overwriteGetter(`rgb`,[e/i,t/i,n/i,r])}get hcl(){return this.overwriteGetter(`hcl`,function(e){let[t,n,r,i]=Re(e),a=Math.sqrt(n*n+r*r);return[Math.round(1e4*a)?Le(Math.atan2(r,n)*Ie):NaN,a,t,i]}(this.rgb))}get lab(){return this.overwriteGetter(`lab`,Re(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,n,r]=this.rgb;return`rgba(${[e,t,n].map(e=>Math.round(255*e)).join(`,`)},${r})`}}Ye.black=new Ye(0,0,0,1),Ye.white=new Ye(1,1,1,1),Ye.transparent=new Ye(0,0,0,0),Ye.red=new Ye(1,0,0,1);class Xe{constructor(e,t,n){this.sensitivity=e?t?`variant`:`case`:t?`accent`:`base`,this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:`search`})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ze{constructor(e,t,n,r,i){this.text=e,this.image=t,this.scale=n,this.fontStack=r,this.textColor=i}}class Qe{constructor(e){this.sections=e}static fromString(e){return new Qe([new Ze(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Qe?e:Qe.fromString(e)}toString(){return this.sections.length===0?``:this.sections.map(e=>e.text).join(``)}}class $e{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof $e)return e;if(typeof e==`number`)return new $e([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let t of e)if(typeof t!=`number`)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new $e(e)}}toString(){return JSON.stringify(this.values)}}let et=new Set([`center`,`left`,`right`,`top`,`bottom`,`top-left`,`top-right`,`bottom-left`,`bottom-right`]);class tt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof tt)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t<e.length;t+=2){let n=e[t],r=e[t+1];if(typeof n!=`string`||!et.has(n)||!Array.isArray(r)||r.length!==2||typeof r[0]!=`number`||typeof r[1]!=`number`)return}return new tt(e)}}toString(){return JSON.stringify(this.values)}}class nt{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new nt({name:e,available:!1}):null}}function rt(e,t,n,r){return typeof e==`number`&&e>=0&&e<=255&&typeof t==`number`&&t>=0&&t<=255&&typeof n==`number`&&n>=0&&n<=255?r===void 0||typeof r==`number`&&r>=0&&r<=1?null:`Invalid rgba value [${[e,t,n,r].join(`, `)}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof r==`number`?[e,t,n,r]:[e,t,n]).join(`, `)}]: 'r', 'g', and 'b' must be between 0 and 255.`}function it(e){if(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||e instanceof Ye||e instanceof Xe||e instanceof Qe||e instanceof $e||e instanceof tt||e instanceof nt)return!0;if(Array.isArray(e)){for(let t of e)if(!it(t))return!1;return!0}if(typeof e==`object`){for(let t in e)if(!it(e[t]))return!1;return!0}return!1}function at(e){if(e===null)return de;if(typeof e==`string`)return pe;if(typeof e==`boolean`)return me;if(typeof e==`number`)return fe;if(e instanceof Ye)return he;if(e instanceof Xe)return ve;if(e instanceof Qe)return ye;if(e instanceof $e)return be;if(e instanceof tt)return Se;if(e instanceof nt)return xe;if(Array.isArray(e)){let t=e.length,n;for(let t of e){let e=at(t);if(n){if(n===e)continue;n=_e;break}n=e}return Ce(n||_e,t)}return ge}function ot(e){let t=typeof e;return e===null?``:t===`string`||t===`number`||t===`boolean`?String(e):e instanceof Ye||e instanceof Qe||e instanceof $e||e instanceof tt||e instanceof nt?e.toString():JSON.stringify(e)}class st{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(e.length!==2)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!it(e[1]))return t.error(`invalid value`);let n=e[1],r=at(n),i=t.expectedType;return r.kind!==`array`||r.N!==0||!i||i.kind!==`array`||typeof i.N==`number`&&i.N!==0||(r=i),new st(r,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ct{constructor(e){this.name=`ExpressionEvaluationError`,this.message=e}toJSON(){return this.message}}let lt={string:pe,number:fe,boolean:me,object:ge};class ut{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error(`Expected at least one argument.`);let n,r=1,i=e[0];if(i===`array`){let i,a;if(e.length>2){let n=e[1];if(typeof n!=`string`||!(n in lt)||n===`object`)return t.error(`The item type argument of "array" must be one of string, number, boolean`,1);i=lt[n],r++}else i=_e;if(e.length>3){if(e[2]!==null&&(typeof e[2]!=`number`||e[2]<0||e[2]!==Math.floor(e[2])))return t.error(`The length argument to "array" must be a positive integer literal`,2);a=e[2],r++}n=Ce(i,a)}else{if(!lt[i])throw Error(`Types doesn't contain name = ${i}`);n=lt[i]}let a=[];for(;r<e.length;r++){let n=t.parse(e[r],r,_e);if(!n)return null;a.push(n)}return new ut(n,a)}evaluate(e){for(let t=0;t<this.args.length;t++){let n=this.args[t].evaluate(e);if(!Ee(this.type,at(n)))return n;if(t===this.args.length-1)throw new ct(`Expected value to be of type ${we(this.type)}, but found ${we(at(n))} instead.`)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}let $={"to-boolean":me,"to-color":he,"to-number":fe,"to-string":pe};class dt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error(`Expected at least one argument.`);let n=e[0];if(!$[n])throw Error(`Can't parse ${n} as it is not part of the known types`);if((n===`to-boolean`||n===`to-string`)&&e.length!==2)return t.error(`Expected one argument.`);let r=$[n],i=[];for(let n=1;n<e.length;n++){let r=t.parse(e[n],n,_e);if(!r)return null;i.push(r)}return new dt(r,i)}evaluate(e){switch(this.type.kind){case`boolean`:return!!this.args[0].evaluate(e);case`color`:{let t,n;for(let r of this.args){if(t=r.evaluate(e),n=null,t instanceof Ye)return t;if(typeof t==`string`){let n=e.parseColor(t);if(n)return n}else if(Array.isArray(t)&&(n=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:rt(t[0],t[1],t[2],t[3]),!n))return new Ye(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new ct(n||`Could not parse color from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`padding`:{let t;for(let n of this.args){t=n.evaluate(e);let r=$e.parse(t);if(r)return r}throw new ct(`Could not parse padding from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`variableAnchorOffsetCollection`:{let t;for(let n of this.args){t=n.evaluate(e);let r=tt.parse(t);if(r)return r}throw new ct(`Could not parse variableAnchorOffsetCollection from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`number`:{let t=null;for(let n of this.args){if(t=n.evaluate(e),t===null)return 0;let r=Number(t);if(!isNaN(r))return r}throw new ct(`Could not convert ${JSON.stringify(t)} to number.`)}case`formatted`:return Qe.fromString(ot(this.args[0].evaluate(e)));case`resolvedImage`:return nt.fromString(ot(this.args[0].evaluate(e)));default:return ot(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}let ft=[`Unknown`,`Point`,`LineString`,`Polygon`];class pt{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`?ft[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(e){let t=this._parseColorCache[e];return t||=this._parseColorCache[e]=Ye.parse(e),t}}class mt{constructor(e,t,n=[],r,i=new ue,a=[]){this.registry=e,this.path=n,this.key=n.map(e=>`[${e}]`).join(``),this.scope=i,this.errors=a,this.expectedType=r,this._isConstant=t}parse(e,t,n,r,i={}){return t?this.concat(t,n,r)._parse(e,i):this._parse(e,i)}_parse(e,t){function n(e,t,n){return n===`assert`?new ut(t,[e]):n===`coerce`?new dt(t,[e]):e}if(e!==null&&typeof e!=`string`&&typeof e!=`boolean`&&typeof e!=`number`||(e=[`literal`,e]),Array.isArray(e)){if(e.length===0)return this.error(`Expected an array with at least one element. If you wanted a literal array, use ["literal", []].`);let r=e[0];if(typeof r!=`string`)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let i=this.registry[r];if(i){let r=i.parse(e,this);if(!r)return null;if(this.expectedType){let e=this.expectedType,i=r.type;if(e.kind!==`string`&&e.kind!==`number`&&e.kind!==`boolean`&&e.kind!==`object`&&e.kind!==`array`||i.kind!==`value`)if(e.kind!==`color`&&e.kind!==`formatted`&&e.kind!==`resolvedImage`||i.kind!==`value`&&i.kind!==`string`)if(e.kind!==`padding`||i.kind!==`value`&&i.kind!==`number`&&i.kind!==`array`)if(e.kind!==`variableAnchorOffsetCollection`||i.kind!==`value`&&i.kind!==`array`){if(this.checkSubtype(e,i))return null}else r=n(r,e,t.typeAnnotation||`coerce`);else r=n(r,e,t.typeAnnotation||`coerce`);else r=n(r,e,t.typeAnnotation||`coerce`);else r=n(r,e,t.typeAnnotation||`assert`)}if(!(r instanceof st)&&r.type.kind!==`resolvedImage`&&this._isConstant(r)){let e=new pt;try{r=new st(r.type,r.evaluate(e))}catch(e){return this.error(e.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?`'undefined' value invalid. Use null instead.`:typeof e==`object`?`Bare objects invalid. Use ["literal", {...}] instead.`:`Expected an array, but found ${typeof e} instead.`)}concat(e,t,n){let r=typeof e==`number`?this.path.concat(e):this.path,i=n?this.scope.concat(n):this.scope;return new mt(this.registry,this._isConstant,r,t||null,i,this.errors)}error(e,...t){let n=`${this.key}${t.map(e=>`[${e}]`).join(``)}`;this.errors.push(new le(n,e))}checkSubtype(e,t){let n=Ee(e,t);return n&&this.error(n),n}}class ht{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let n=[];for(let r=1;r<e.length-1;r+=2){let i=e[r];if(typeof i!=`string`)return t.error(`Expected string, but found ${typeof i} instead.`,r);if(/[^a-zA-Z0-9_]/.test(i))return t.error(`Variable names must contain only alphanumeric characters or '_'.`,r);let a=t.parse(e[r+1],r+1);if(!a)return null;n.push([i,a])}let r=t.parse(e[e.length-1],e.length-1,t.expectedType,n);return r?new ht(n,r):null}outputDefined(){return this.result.outputDefined()}}class gt{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(e.length!==2||typeof e[1]!=`string`)return t.error(`'var' expression requires exactly one string literal argument.`);let n=e[1];return t.scope.has(n)?new gt(n,t.scope.get(n)):t.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class _t{constructor(e,t,n){this.type=e,this.index=t,this.input=n}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let n=t.parse(e[1],1,fe),r=t.parse(e[2],2,Ce(t.expectedType||_e));return n&&r?new _t(r.type.itemType,n,r):null}evaluate(e){let t=this.index.evaluate(e),n=this.input.evaluate(e);if(t<0)throw new ct(`Array index out of bounds: ${t} < 0.`);if(t>=n.length)throw new ct(`Array index out of bounds: ${t} > ${n.length-1}.`);if(t!==Math.floor(t))throw new ct(`Array index must be an integer, but found ${t} instead.`);return n[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class vt{constructor(e,t){this.type=me,this.needle=e,this.haystack=t}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let n=t.parse(e[1],1,_e),r=t.parse(e[2],2,_e);return n&&r?De(n.type,[me,pe,fe,de,_e])?new vt(n,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${we(n.type)} instead`):null}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!Oe(t,[`boolean`,`string`,`number`,`null`]))throw new ct(`Expected first argument to be of type boolean, string, number or null, but found ${we(at(t))} instead.`);if(!Oe(n,[`string`,`array`]))throw new ct(`Expected second argument to be of type array or string, but found ${we(at(n))} instead.`);return n.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class yt{constructor(e,t,n){this.type=fe,this.needle=e,this.haystack=t,this.fromIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let n=t.parse(e[1],1,_e),r=t.parse(e[2],2,_e);if(!n||!r)return null;if(!De(n.type,[me,pe,fe,de,_e]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${we(n.type)} instead`);if(e.length===4){let i=t.parse(e[3],3,fe);return i?new yt(n,r,i):null}return new yt(n,r)}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!Oe(t,[`boolean`,`string`,`number`,`null`]))throw new ct(`Expected first argument to be of type boolean, string, number or null, but found ${we(at(t))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(e)),Oe(n,[`string`])){let e=n.indexOf(t,r);return e===-1?-1:[...n.slice(0,e)].length}if(Oe(n,[`array`]))return n.indexOf(t,r);throw new ct(`Expected second argument to be of type array or string, but found ${we(at(n))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class bt{constructor(e,t,n,r,i,a){this.inputType=e,this.type=t,this.input=n,this.cases=r,this.outputs=i,this.otherwise=a}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error(`Expected an even number of arguments.`);let n,r;t.expectedType&&t.expectedType.kind!==`value`&&(r=t.expectedType);let i={},a=[];for(let o=2;o<e.length-1;o+=2){let s=e[o],c=e[o+1];Array.isArray(s)||(s=[s]);let l=t.concat(o);if(s.length===0)return l.error(`Expected at least one branch label.`);for(let e of s){if(typeof e!=`number`&&typeof e!=`string`)return l.error(`Branch labels must be numbers or strings.`);if(typeof e==`number`&&Math.abs(e)>2**53-1)return l.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof e==`number`&&Math.floor(e)!==e)return l.error(`Numeric branch labels must be integer values.`);if(n){if(l.checkSubtype(n,at(e)))return null}else n=at(e);if(i[String(e)]!==void 0)return l.error(`Branch labels must be unique.`);i[String(e)]=a.length}let u=t.parse(c,o,r);if(!u)return null;r||=u.type,a.push(u)}let o=t.parse(e[1],1,_e);if(!o)return null;let s=t.parse(e[e.length-1],e.length-1,r);return s?o.type.kind!==`value`&&t.concat(1).checkSubtype(n,o.type)?null:new bt(n,r,o,i,a,s):null}evaluate(e){let t=this.input.evaluate(e);return(at(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class xt{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error(`Expected an odd number of arguments.`);let n;t.expectedType&&t.expectedType.kind!==`value`&&(n=t.expectedType);let r=[];for(let i=1;i<e.length-1;i+=2){let a=t.parse(e[i],i,me);if(!a)return null;let o=t.parse(e[i+1],i+1,n);if(!o)return null;r.push([a,o]),n||=o.type}let i=t.parse(e[e.length-1],e.length-1,n);if(!i)return null;if(!n)throw Error(`Can't infer output type`);return new xt(n,r,i)}evaluate(e){for(let[t,n]of this.branches)if(t.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,n]of this.branches)e(t),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}}class St{constructor(e,t,n,r){this.type=e,this.input=t,this.beginIndex=n,this.endIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let n=t.parse(e[1],1,_e),r=t.parse(e[2],2,fe);if(!n||!r)return null;if(!De(n.type,[Ce(_e),pe,_e]))return t.error(`Expected first argument to be of type array or string, but found ${we(n.type)} instead`);if(e.length===4){let i=t.parse(e[3],3,fe);return i?new St(n.type,n,r,i):null}return new St(n.type,n,r)}evaluate(e){let t=this.input.evaluate(e),n=this.beginIndex.evaluate(e),r;if(this.endIndex&&(r=this.endIndex.evaluate(e)),Oe(t,[`string`]))return[...t].slice(n,r).join(``);if(Oe(t,[`array`]))return t.slice(n,r);throw new ct(`Expected first argument to be of type array or string, but found ${we(at(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Ct(e,t){let n=e.length-1,r,i,a=0,o=n,s=0;for(;a<=o;)if(s=Math.floor((a+o)/2),r=e[s],i=e[s+1],r<=t){if(s===n||t<i)return s;a=s+1}else{if(!(r>t))throw new ct(`Input is not a number.`);o=s-1}return 0}class wt{constructor(e,t,n){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(let[e,t]of n)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error(`Expected an even number of arguments.`);let n=t.parse(e[1],1,fe);if(!n)return null;let r=[],i=null;t.expectedType&&t.expectedType.kind!==`value`&&(i=t.expectedType);for(let n=1;n<e.length;n+=2){let a=n===1?-1/0:e[n],o=e[n+1],s=n,c=n+1;if(typeof a!=`number`)return t.error(`Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,s);if(r.length&&r[r.length-1][0]>=a)return t.error(`Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.`,s);let l=t.parse(o,c,i);if(!l)return null;i||=l.type,r.push([a,l])}return new wt(i,n,r)}evaluate(e){let t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);let r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);let i=t.length;return r>=t[i-1]?n[i-1].evaluate(e):n[Ct(t,r)].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Tt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Et=Dt;function Dt(e,t,n,r){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=n,this.p2y=r}Dt.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(t===void 0&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,r=0;r<8;r++){var i=this.sampleCurveX(n)-e;if(Math.abs(i)<t)return n;var a=this.sampleCurveDerivativeX(n);if(Math.abs(a)<1e-6)break;n-=i/a}var o=0,s=1;for(n=e,r=0;r<20&&(i=this.sampleCurveX(n),!(Math.abs(i-e)<t));r++)e>i?o=n:s=n,n=.5*(s-o)+o;return n},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var Ot=Tt(Et);function kt(e,t,n){return e+n*(t-e)}function At(e,t,n){return e.map((e,r)=>kt(e,t[r],n))}let jt={number:kt,color:function(e,t,n,r=`rgb`){switch(r){case`rgb`:{let[r,i,a,o]=At(e.rgb,t.rgb,n);return new Ye(r,i,a,o,!1)}case`hcl`:{let[r,i,a,o]=e.hcl,[s,c,l,u]=t.hcl,d,f;if(isNaN(r)||isNaN(s))isNaN(r)?isNaN(s)?d=NaN:(d=s,a!==1&&a!==0||(f=c)):(d=r,l!==1&&l!==0||(f=i));else{let e=s-r;s>r&&e>180?e-=360:s<r&&r-s>180&&(e+=360),d=r+n*e}let[p,m,h,g]=function([e,t,n,r]){return e=isNaN(e)?0:e*Fe,Ve([n,Math.cos(e)*t,Math.sin(e)*t,r])}([d,f??kt(i,c,n),kt(a,l,n),kt(o,u,n)]);return new Ye(p,m,h,g,!1)}case`lab`:{let[r,i,a,o]=Ve(At(e.lab,t.lab,n));return new Ye(r,i,a,o,!1)}}},array:At,padding:function(e,t,n){return new $e(At(e.values,t.values,n))},variableAnchorOffsetCollection:function(e,t,n){let r=e.values,i=t.values;if(r.length!==i.length)throw new ct(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);let a=[];for(let e=0;e<r.length;e+=2){if(r[e]!==i[e])throw new ct(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${r[e]}, to[${e}]: ${i[e]}`);a.push(r[e]);let[t,o]=r[e+1],[s,c]=i[e+1];a.push([kt(t,s,n),kt(o,c,n)])}return new tt(a)}};class Mt{constructor(e,t,n,r,i){this.type=e,this.operator=t,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(let[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,n,r){let i=0;if(e.name===`exponential`)i=Nt(t,e.base,n,r);else if(e.name===`linear`)i=Nt(t,1,n,r);else if(e.name===`cubic-bezier`){let a=e.controlPoints;i=new Ot(a[0],a[1],a[2],a[3]).solve(Nt(t,1,n,r))}return i}static parse(e,t){let[n,r,i,...a]=e;if(!Array.isArray(r)||r.length===0)return t.error(`Expected an interpolation type expression.`,1);if(r[0]===`linear`)r={name:`linear`};else if(r[0]===`exponential`){let e=r[1];if(typeof e!=`number`)return t.error(`Exponential interpolation requires a numeric base.`,1,1);r={name:`exponential`,base:e}}else{if(r[0]!==`cubic-bezier`)return t.error(`Unknown interpolation type ${String(r[0])}`,1,0);{let e=r.slice(1);if(e.length!==4||e.some(e=>typeof e!=`number`||e<0||e>1))return t.error(`Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.`,1);r={name:`cubic-bezier`,controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error(`Expected an even number of arguments.`);if(i=t.parse(i,2,fe),!i)return null;let o=[],s=null;n===`interpolate-hcl`||n===`interpolate-lab`?s=he:t.expectedType&&t.expectedType.kind!==`value`&&(s=t.expectedType);for(let e=0;e<a.length;e+=2){let n=a[e],r=a[e+1],i=e+3,c=e+4;if(typeof n!=`number`)return t.error(`Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,i);if(o.length&&o[o.length-1][0]>=n)return t.error(`Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.`,i);let l=t.parse(r,c,s);if(!l)return null;s||=l.type,o.push([n,l])}return ke(s,fe)||ke(s,he)||ke(s,be)||ke(s,Se)||ke(s,Ce(fe))?new Mt(s,n,r,i,o):t.error(`Type ${we(s)} is not interpolatable.`)}evaluate(e){let t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);let r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);let i=t.length;if(r>=t[i-1])return n[i-1].evaluate(e);let a=Ct(t,r),o=Mt.interpolationFactor(this.interpolation,r,t[a],t[a+1]),s=n[a].evaluate(e),c=n[a+1].evaluate(e);switch(this.operator){case`interpolate`:return jt[this.type.kind](s,c,o);case`interpolate-hcl`:return jt.color(s,c,o,`hcl`);case`interpolate-lab`:return jt.color(s,c,o,`lab`)}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Nt(e,t,n,r){let i=r-n,a=e-n;return i===0?0:t===1?a/i:(t**+a-1)/(t**+i-1)}class Pt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error(`Expectected at least one argument.`);let n=null,r=t.expectedType;r&&r.kind!==`value`&&(n=r);let i=[];for(let r of e.slice(1)){let e=t.parse(r,1+i.length,n,void 0,{typeAnnotation:`omit`});if(!e)return null;n||=e.type,i.push(e)}if(!n)throw Error(`No output type`);return new Pt(r&&i.some(e=>Ee(r,e.type))?_e:n,i)}evaluate(e){let t,n=null,r=0;for(let i of this.args)if(r++,n=i.evaluate(e),n&&n instanceof nt&&!n.available&&(t||=n.name,n=null,r===this.args.length&&(n=t)),n!==null)break;return n}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function Ft(e,t){return e===`==`||e===`!=`?t.kind===`boolean`||t.kind===`string`||t.kind===`number`||t.kind===`null`||t.kind===`value`:t.kind===`string`||t.kind===`number`||t.kind===`value`}function It(e,t,n,r){return r.compare(t,n)===0}function Lt(e,t,n){let r=e!==`==`&&e!==`!=`;return class i{constructor(e,t,n){this.type=me,this.lhs=e,this.rhs=t,this.collator=n,this.hasUntypedArgument=e.type.kind===`value`||t.type.kind===`value`}static parse(e,t){if(e.length!==3&&e.length!==4)return t.error(`Expected two or three arguments.`);let n=e[0],a=t.parse(e[1],1,_e);if(!a)return null;if(!Ft(n,a.type))return t.concat(1).error(`"${n}" comparisons are not supported for type '${we(a.type)}'.`);let o=t.parse(e[2],2,_e);if(!o)return null;if(!Ft(n,o.type))return t.concat(2).error(`"${n}" comparisons are not supported for type '${we(o.type)}'.`);if(a.type.kind!==o.type.kind&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot compare types '${we(a.type)}' and '${we(o.type)}'.`);r&&(a.type.kind===`value`&&o.type.kind!==`value`?a=new ut(o.type,[a]):a.type.kind!==`value`&&o.type.kind===`value`&&(o=new ut(a.type,[o])));let s=null;if(e.length===4){if(a.type.kind!==`string`&&o.type.kind!==`string`&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot use collator to compare non-string types.`);if(s=t.parse(e[3],3,ve),!s)return null}return new i(a,o,s)}evaluate(i){let a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){let t=at(a),n=at(o);if(t.kind!==n.kind||t.kind!==`string`&&t.kind!==`number`)throw new ct(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${n.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){let e=at(a),n=at(o);if(e.kind!==`string`||n.kind!==`string`)return t(i,a,o)}return this.collator?n(i,a,o,this.collator.evaluate(i)):t(i,a,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}let Rt=Lt(`==`,function(e,t,n){return t===n},It),zt=Lt(`!=`,function(e,t,n){return t!==n},function(e,t,n,r){return!It(0,t,n,r)}),Bt=Lt(`<`,function(e,t,n){return t<n},function(e,t,n,r){return r.compare(t,n)<0}),Vt=Lt(`>`,function(e,t,n){return t>n},function(e,t,n,r){return r.compare(t,n)>0}),Ht=Lt(`<=`,function(e,t,n){return t<=n},function(e,t,n,r){return r.compare(t,n)<=0}),Ut=Lt(`>=`,function(e,t,n){return t>=n},function(e,t,n,r){return r.compare(t,n)>=0});class Wt{constructor(e,t,n){this.type=ve,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(e.length!==2)return t.error(`Expected one argument.`);let n=e[1];if(typeof n!=`object`||Array.isArray(n))return t.error(`Collator options argument must be an object.`);let r=t.parse(n[`case-sensitive`]!==void 0&&n[`case-sensitive`],1,me);if(!r)return null;let i=t.parse(n[`diacritic-sensitive`]!==void 0&&n[`diacritic-sensitive`],1,me);if(!i)return null;let a=null;return n.locale&&(a=t.parse(n.locale,1,pe),!a)?null:new Wt(r,i,a)}evaluate(e){return new Xe(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Gt{constructor(e,t,n,r,i){this.type=pe,this.number=e,this.locale=t,this.currency=n,this.minFractionDigits=r,this.maxFractionDigits=i}static parse(e,t){if(e.length!==3)return t.error(`Expected two arguments.`);let n=t.parse(e[1],1,fe);if(!n)return null;let r=e[2];if(typeof r!=`object`||Array.isArray(r))return t.error(`NumberFormat options argument must be an object.`);let i=null;if(r.locale&&(i=t.parse(r.locale,1,pe),!i))return null;let a=null;if(r.currency&&(a=t.parse(r.currency,1,pe),!a))return null;let o=null;if(r[`min-fraction-digits`]&&(o=t.parse(r[`min-fraction-digits`],1,fe),!o))return null;let s=null;return r[`max-fraction-digits`]&&(s=t.parse(r[`max-fraction-digits`],1,fe),!s)?null:new Gt(n,i,a,o,s)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?`currency`:`decimal`,currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Kt{constructor(e){this.type=ye,this.sections=e}static parse(e,t){if(e.length<2)return t.error(`Expected at least one argument.`);let n=e[1];if(!Array.isArray(n)&&typeof n==`object`)return t.error(`First argument must be an image or text section.`);let r=[],i=!1;for(let n=1;n<=e.length-1;++n){let a=e[n];if(i&&typeof a==`object`&&!Array.isArray(a)){i=!1;let e=null;if(a[`font-scale`]&&(e=t.parse(a[`font-scale`],1,fe),!e))return null;let n=null;if(a[`text-font`]&&(n=t.parse(a[`text-font`],1,Ce(pe)),!n))return null;let o=null;if(a[`text-color`]&&(o=t.parse(a[`text-color`],1,he),!o))return null;let s=r[r.length-1];s.scale=e,s.font=n,s.textColor=o}else{let a=t.parse(e[n],1,_e);if(!a)return null;let o=a.type.kind;if(o!==`string`&&o!==`value`&&o!==`null`&&o!==`resolvedImage`)return t.error(`Formatted text type must be 'string', 'value', 'image' or 'null'.`);i=!0,r.push({content:a,scale:null,font:null,textColor:null})}}return new Kt(r)}evaluate(e){return new Qe(this.sections.map(t=>{let n=t.content.evaluate(e);return at(n)===xe?new Ze(``,n,null,null,null):new Ze(ot(n),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(`,`):null,t.textColor?t.textColor.evaluate(e):null)}))}eachChild(e){for(let t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}}class qt{constructor(e){this.type=xe,this.input=e}static parse(e,t){if(e.length!==2)return t.error(`Expected two arguments.`);let n=t.parse(e[1],1,pe);return n?new qt(n):t.error(`No image name provided.`)}evaluate(e){let t=this.input.evaluate(e),n=nt.fromString(t);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(t)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}}class Jt{constructor(e){this.type=fe,this.input=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);let n=t.parse(e[1],1);return n?n.type.kind!==`array`&&n.type.kind!==`string`&&n.type.kind!==`value`?t.error(`Expected argument of type string or array, but found ${we(n.type)} instead.`):new Jt(n):null}evaluate(e){let t=this.input.evaluate(e);if(typeof t==`string`)return[...t].length;if(Array.isArray(t))return t.length;throw new ct(`Expected value to be of type string or array, but found ${we(at(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}let Yt=8192;function Xt(e,t){let n=(180+e[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=2**t.z;return[Math.round(n*i*Yt),Math.round(r*i*Yt)]}function Zt(e,t){let n=2**t.z;return[(i=(e[0]/Yt+t.x)/n,360*i-180),(r=(e[1]/Yt+t.y)/n,360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90)];var r,i}function Qt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function $t(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function en(e,t,n){let r=e[0]-t[0],i=e[1]-t[1],a=e[0]-n[0],o=e[1]-n[1];return r*o-a*i==0&&r*a<=0&&i*o<=0}function tn(e,t,n,r){return(i=[r[0]-n[0],r[1]-n[1]])[0]*(a=[t[0]-e[0],t[1]-e[1]])[1]-i[1]*a[0]!=0&&!(!cn(e,t,n,r)||!cn(n,r,e,t));var i,a}function nn(e,t,n){for(let r of n)for(let n=0;n<r.length-1;++n)if(tn(e,t,r[n],r[n+1]))return!0;return!1}function rn(e,t,n=!1){let r=!1;for(let s of t)for(let t=0;t<s.length-1;t++){if(en(e,s[t],s[t+1]))return n;(a=s[t])[1]>(i=e)[1]!=(o=s[t+1])[1]>i[1]&&i[0]<(o[0]-a[0])*(i[1]-a[1])/(o[1]-a[1])+a[0]&&(r=!r)}var i,a,o;return r}function an(e,t){for(let n of t)if(rn(e,n))return!0;return!1}function on(e,t){for(let n of e)if(!rn(n,t))return!1;for(let n=0;n<e.length-1;++n)if(nn(e[n],e[n+1],t))return!1;return!0}function sn(e,t){for(let n of t)if(on(e,n))return!0;return!1}function cn(e,t,n,r){let i=r[0]-n[0],a=r[1]-n[1],o=(e[0]-n[0])*a-i*(e[1]-n[1]),s=(t[0]-n[0])*a-i*(t[1]-n[1]);return o>0&&s<0||o<0&&s>0}function ln(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=[];for(let r=0;r<e[i].length;r++){let o=Xt(e[i][r],n);Qt(t,o),a.push(o)}r.push(a)}return r}function un(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=ln(e[i],t,n);r.push(a)}return r}function dn(e,t,n,r){if(e[0]<n[0]||e[0]>n[2]){let t=.5*r,i=e[0]-n[0]>t?-r:n[0]-e[0]>t?r:0;i===0&&(i=e[0]-n[2]>t?-r:n[2]-e[0]>t?r:0),e[0]+=i}Qt(t,e)}function fn(e,t,n,r){let i=2**r.z*Yt,a=[r.x*Yt,r.y*Yt],o=[];for(let r of e)for(let e of r){let r=[e.x+a[0],e.y+a[1]];dn(r,t,n,i),o.push(r)}return o}function pn(e,t,n,r){let i=2**r.z*Yt,a=[r.x*Yt,r.y*Yt],o=[];for(let n of e){let e=[];for(let r of n){let n=[r.x+a[0],r.y+a[1]];Qt(t,n),e.push(n)}o.push(e)}if(t[2]-t[0]<=i/2){(s=t)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(let e of o)for(let r of e)dn(r,t,n,i)}var s;return o}class mn{constructor(e,t){this.type=me,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(it(e[1])){let t=e[1];if(t.type===`FeatureCollection`){let e=[];for(let n of t.features){let{type:t,coordinates:r}=n.geometry;t===`Polygon`&&e.push(r),t===`MultiPolygon`&&e.push(...r)}if(e.length)return new mn(t,{type:`MultiPolygon`,coordinates:e})}else if(t.type===`Feature`){let e=t.geometry.type;if(e===`Polygon`||e===`MultiPolygon`)return new mn(t,t.geometry)}else if(t.type===`Polygon`||t.type===`MultiPolygon`)return new mn(t,t)}return t.error(`'within' expression requires valid geojson object that contains polygon geometry type.`)}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===`Point`)return function(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=ln(t.coordinates,r,i),o=fn(e.geometry(),n,r,i);if(!$t(n,r))return!1;for(let e of o)if(!rn(e,a))return!1}if(t.type===`MultiPolygon`){let a=un(t.coordinates,r,i),o=fn(e.geometry(),n,r,i);if(!$t(n,r))return!1;for(let e of o)if(!an(e,a))return!1}return!0}(e,this.geometries);if(e.geometryType()===`LineString`)return function(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=ln(t.coordinates,r,i),o=pn(e.geometry(),n,r,i);if(!$t(n,r))return!1;for(let e of o)if(!on(e,a))return!1}if(t.type===`MultiPolygon`){let a=un(t.coordinates,r,i),o=pn(e.geometry(),n,r,i);if(!$t(n,r))return!1;for(let e of o)if(!sn(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let hn=class{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:n}=this,r=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r}_down(e){let{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e<r;){let r=1+(e<<1),a=r+1;if(a<this.length&&n(t[a],t[r])<0&&(r=a),n(t[r],i)>=0)break;t[e]=t[r],e=r}t[e]=i}};function gn(e,t,n,r,i){_n(e,t,n,r||e.length-1,i||yn)}function _n(e,t,n,r,i){for(;r>n;){if(r-n>600){var a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);_n(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}var u=e[t],d=n,f=r;for(vn(e,n,t),i(e[r],u)>0&&vn(e,n,r);d<f;){for(vn(e,d,f),d++,f--;i(e[d],u)<0;)d++;for(;i(e[f],u)>0;)f--}i(e[n],u)===0?vn(e,n,f):vn(e,++f,r),f<=t&&(n=f+1),t<=f&&(r=f-1)}}function vn(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function yn(e,t){return e<t?-1:e>t?1:0}function bn(e,t){if(e.length<=1)return[e];let n=[],r,i;for(let t of e){let e=Sn(t);e!==0&&(t.area=Math.abs(e),i===void 0&&(i=e<0),i===e<0?(r&&n.push(r),r=[t]):r.push(t))}if(r&&n.push(r),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(gn(n[e],t,1,n[e].length-1,xn),n[e]=n[e].slice(0,t));return n}function xn(e,t){return t.area-e.area}function Sn(e){let t=0;for(let n,r,i=0,a=e.length,o=a-1;i<a;o=i++)n=e[i],r=e[o],t+=(r.x-n.x)*(n.y+r.y);return t}let Cn=1/298.257223563,wn=Cn*(2-Cn),Tn=Math.PI/180;class En{constructor(e){let t=6378.137*Tn*1e3,n=Math.cos(e*Tn),r=1/(1-wn*(1-n*n)),i=Math.sqrt(r);this.kx=t*i*n,this.ky=t*i*r*(1-wn)}distance(e,t){let n=this.wrap(e[0]-t[0])*this.kx,r=(e[1]-t[1])*this.ky;return Math.sqrt(n*n+r*r)}pointOnLine(e,t){let n,r,i,a,o=1/0;for(let s=0;s<e.length-1;s++){let c=e[s][0],l=e[s][1],u=this.wrap(e[s+1][0]-c)*this.kx,d=(e[s+1][1]-l)*this.ky,f=0;u===0&&d===0||(f=(this.wrap(t[0]-c)*this.kx*u+(t[1]-l)*this.ky*d)/(u*u+d*d),f>1?(c=e[s+1][0],l=e[s+1][1]):f>0&&(c+=u/this.kx*f,l+=d/this.ky*f)),u=this.wrap(t[0]-c)*this.kx,d=(t[1]-l)*this.ky;let p=u*u+d*d;p<o&&(o=p,n=c,r=l,i=s,a=f)}return{point:[n,r],index:i,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function Dn(e,t){return t[0]-e[0]}function On(e){return e[1]-e[0]+1}function kn(e,t){return e[1]>=e[0]&&e[1]<t}function An(e,t){if(e[0]>e[1])return[null,null];let n=On(e);if(t){if(n===2)return[e,null];let t=Math.floor(n/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(n===1)return[e,null];let r=Math.floor(n/2)-1;return[[e[0],e[0]+r],[e[0]+r+1,e[1]]]}function jn(e,t){if(!kn(t,e.length))return[1/0,1/0,-1/0,-1/0];let n=[1/0,1/0,-1/0,-1/0];for(let r=t[0];r<=t[1];++r)Qt(n,e[r]);return n}function Mn(e){let t=[1/0,1/0,-1/0,-1/0];for(let n of e)for(let e of n)Qt(t,e);return t}function Nn(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Pn(e,t,n){if(!Nn(e)||!Nn(t))return NaN;let r=0,i=0;return e[2]<t[0]&&(r=t[0]-e[2]),e[0]>t[2]&&(r=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),n.distance([0,0],[r,i])}function Fn(e,t,n){let r=n.pointOnLine(t,e);return n.distance(e,r.point)}function In(e,t,n,r,i){let a=Math.min(Fn(e,[n,r],i),Fn(t,[n,r],i)),o=Math.min(Fn(n,[e,t],i),Fn(r,[e,t],i));return Math.min(a,o)}function Ln(e,t,n,r,i){if(!kn(t,e.length)||!kn(r,n.length))return 1/0;let a=1/0;for(let o=t[0];o<t[1];++o){let t=e[o],s=e[o+1];for(let e=r[0];e<r[1];++e){let r=n[e],o=n[e+1];if(tn(t,s,r,o))return 0;a=Math.min(a,In(t,s,r,o,i))}}return a}function Rn(e,t,n,r,i){if(!kn(t,e.length)||!kn(r,n.length))return NaN;let a=1/0;for(let o=t[0];o<=t[1];++o)for(let t=r[0];t<=r[1];++t)if(a=Math.min(a,i.distance(e[o],n[t])),a===0)return a;return a}function zn(e,t,n){if(rn(e,t,!0))return 0;let r=1/0;for(let i of t){let t=i[0],a=i[i.length-1];if(t!==a&&(r=Math.min(r,Fn(e,[a,t],n)),r===0))return r;let o=n.pointOnLine(i,e);if(r=Math.min(r,n.distance(e,o.point)),r===0)return r}return r}function Bn(e,t,n,r){if(!kn(t,e.length))return NaN;for(let r=t[0];r<=t[1];++r)if(rn(e[r],n,!0))return 0;let i=1/0;for(let a=t[0];a<t[1];++a){let t=e[a],o=e[a+1];for(let e of n)for(let n=0,a=e.length,s=a-1;n<a;s=n++){let a=e[s],c=e[n];if(tn(t,o,a,c))return 0;i=Math.min(i,In(t,o,a,c,r))}}return i}function Vn(e,t){for(let n of e)for(let e of n)if(rn(e,t,!0))return!0;return!1}function Hn(e,t,n,r=1/0){let i=Mn(e),a=Mn(t);if(r!==1/0&&Pn(i,a,n)>=r)return r;if($t(i,a)){if(Vn(e,t))return 0}else if(Vn(t,e))return 0;let o=1/0;for(let r of e)for(let e=0,i=r.length,a=i-1;e<i;a=e++){let i=r[a],s=r[e];for(let e of t)for(let t=0,r=e.length,a=r-1;t<r;a=t++){let r=e[a],c=e[t];if(tn(i,s,r,c))return 0;o=Math.min(o,In(i,s,r,c,n))}}return o}function Un(e,t,n,r,i,a){if(!a)return;let o=Pn(jn(r,a),i,n);o<t&&e.push([o,a,[0,0]])}function Wn(e,t,n,r,i,a,o){if(!a||!o)return;let s=Pn(jn(r,a),jn(i,o),n);s<t&&e.push([s,a,o])}function Gn(e,t,n,r,i=1/0){let a=Math.min(r.distance(e[0],n[0][0]),i);if(a===0)return a;let o=new hn([[0,[0,e.length-1],[0,0]]],Dn),s=Mn(n);for(;o.length>0;){let i=o.pop();if(i[0]>=a)continue;let c=i[1],l=t?50:100;if(On(c)<=l){if(!kn(c,e.length))return NaN;if(t){let t=Bn(e,c,n,r);if(isNaN(t)||t===0)return t;a=Math.min(a,t)}else for(let t=c[0];t<=c[1];++t){let i=zn(e[t],n,r);if(a=Math.min(a,i),a===0)return 0}}else{let n=An(c,t);Un(o,a,r,e,s,n[0]),Un(o,a,r,e,s,n[1])}}return a}function Kn(e,t,n,r,i,a=1/0){let o=Math.min(a,i.distance(e[0],n[0]));if(o===0)return o;let s=new hn([[0,[0,e.length-1],[0,n.length-1]]],Dn);for(;s.length>0;){let a=s.pop();if(a[0]>=o)continue;let c=a[1],l=a[2],u=t?50:100,d=r?50:100;if(On(c)<=u&&On(l)<=d){if(!kn(c,e.length)&&kn(l,n.length))return NaN;let a;if(t&&r)a=Ln(e,c,n,l,i),o=Math.min(o,a);else if(t&&!r){let t=e.slice(c[0],c[1]+1);for(let e=l[0];e<=l[1];++e)if(a=Fn(n[e],t,i),o=Math.min(o,a),o===0)return o}else if(!t&&r){let t=n.slice(l[0],l[1]+1);for(let n=c[0];n<=c[1];++n)if(a=Fn(e[n],t,i),o=Math.min(o,a),o===0)return o}else a=Rn(e,c,n,l,i),o=Math.min(o,a)}else{let a=An(c,t),u=An(l,r);Wn(s,o,i,e,n,a[0],u[0]),Wn(s,o,i,e,n,a[0],u[1]),Wn(s,o,i,e,n,a[1],u[0]),Wn(s,o,i,e,n,a[1],u[1])}}return o}function qn(e){return e.type===`MultiPolygon`?e.coordinates.map(e=>({type:`Polygon`,coordinates:e})):e.type===`MultiLineString`?e.coordinates.map(e=>({type:`LineString`,coordinates:e})):e.type===`MultiPoint`?e.coordinates.map(e=>({type:`Point`,coordinates:e})):[e]}class Jn{constructor(e,t){this.type=fe,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(it(e[1])){let t=e[1];if(t.type===`FeatureCollection`)return new Jn(t,t.features.map(e=>qn(e.geometry)).flat());if(t.type===`Feature`)return new Jn(t,qn(t.geometry));if(`type`in t&&`coordinates`in t)return new Jn(t,qn(t))}return t.error(`'distance' expression requires valid geojson object that contains polygon geometry type.`)}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===`Point`)return function(e,t){let n=e.geometry(),r=n.flat().map(t=>Zt([t.x,t.y],e.canonical));if(n.length===0)return NaN;let i=new En(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,Kn(r,!1,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,Kn(r,!1,e.coordinates,!0,i,a));break;case`Polygon`:a=Math.min(a,Gn(r,!1,e.coordinates,i,a))}if(a===0)return a}return a}(e,this.geometries);if(e.geometryType()===`LineString`)return function(e,t){let n=e.geometry(),r=n.flat().map(t=>Zt([t.x,t.y],e.canonical));if(n.length===0)return NaN;let i=new En(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,Kn(r,!0,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,Kn(r,!0,e.coordinates,!0,i,a));break;case`Polygon`:a=Math.min(a,Gn(r,!0,e.coordinates,i,a))}if(a===0)return a}return a}(e,this.geometries);if(e.geometryType()===`Polygon`)return function(e,t){let n=e.geometry();if(n.length===0||n[0].length===0)return NaN;let r=bn(n,0).map(t=>t.map(t=>t.map(t=>Zt([t.x,t.y],e.canonical)))),i=new En(r[0][0][0][1]),a=1/0;for(let e of t)for(let t of r){switch(e.type){case`Point`:a=Math.min(a,Gn([e.coordinates],!1,t,i,a));break;case`LineString`:a=Math.min(a,Gn(e.coordinates,!0,t,i,a));break;case`Polygon`:a=Math.min(a,Hn(t,e.coordinates,i,a))}if(a===0)return a}return a}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let Yn={"==":Rt,"!=":zt,">":Vt,"<":Bt,">=":Ut,"<=":Ht,array:ut,at:_t,boolean:ut,case:xt,coalesce:Pt,collator:Wt,format:Kt,image:qt,in:vt,"index-of":yt,interpolate:Mt,"interpolate-hcl":Mt,"interpolate-lab":Mt,length:Jt,let:ht,literal:st,match:bt,number:ut,"number-format":Gt,object:ut,slice:St,step:wt,string:ut,"to-boolean":dt,"to-color":dt,"to-number":dt,"to-string":dt,var:gt,within:mn,distance:Jn};class Xn{constructor(e,t,n,r){this.name=e,this.type=t,this._evaluate=n,this.args=r}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){let n=e[0],r=Xn.definitions[n];if(!r)return t.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);let i=Array.isArray(r)?r[0]:r.type,a=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,o=a.filter(([t])=>!Array.isArray(t)||t.length===e.length-1),s=null;for(let[r,a]of o){s=new mt(t.registry,tr,t.path,null,t.scope);let o=[],c=!1;for(let t=1;t<e.length;t++){let n=e[t],i=Array.isArray(r)?r[t-1]:r.type,a=s.parse(n,1+o.length,i);if(!a){c=!0;break}o.push(a)}if(!c)if(Array.isArray(r)&&r.length!==o.length)s.error(`Expected ${r.length} arguments, but found ${o.length} instead.`);else{for(let e=0;e<o.length;e++){let t=Array.isArray(r)?r[e]:r.type,n=o[e];s.concat(e+1).checkSubtype(t,n.type)}if(s.errors.length===0)return new Xn(n,i,a,o)}}if(o.length===1)t.errors.push(...s.errors);else{let n=(o.length?o:a).map(([e])=>{return t=e,Array.isArray(t)?`(${t.map(we).join(`, `)})`:`(${we(t.type)}...)`;var t}).join(` | `),r=[];for(let n=1;n<e.length;n++){let i=t.parse(e[n],1+r.length);if(!i)return null;r.push(we(i.type))}t.error(`Expected arguments of type ${n}, but found (${r.join(`, `)}) instead.`)}return null}static register(e,t){Xn.definitions=t;for(let n in t)e[n]=Xn}}function Zn(e,[t,n,r,i]){t=t.evaluate(e),n=n.evaluate(e),r=r.evaluate(e);let a=i?i.evaluate(e):1,o=rt(t,n,r,a);if(o)throw new ct(o);return new Ye(t/255,n/255,r/255,a,!1)}function Qn(e,t){return e in t}function $n(e,t){let n=t[e];return n===void 0?null:n}function er(e){return{type:e}}function tr(e){if(e instanceof gt)return tr(e.boundExpression);if(e instanceof Xn&&e.name===`error`||e instanceof Wt||e instanceof mn||e instanceof Jn)return!1;let t=e instanceof dt||e instanceof ut,n=!0;return e.eachChild(e=>{n=t?n&&tr(e):n&&e instanceof st}),!!n&&nr(e)&&ir(e,[`zoom`,`heatmap-density`,`line-progress`,`accumulated`,`is-supported-script`])}function nr(e){if(e instanceof Xn&&(e.name===`get`&&e.args.length===1||e.name===`feature-state`||e.name===`has`&&e.args.length===1||e.name===`properties`||e.name===`geometry-type`||e.name===`id`||/^filter-/.test(e.name))||e instanceof mn||e instanceof Jn)return!1;let t=!0;return e.eachChild(e=>{t&&!nr(e)&&(t=!1)}),t}function rr(e){if(e instanceof Xn&&e.name===`feature-state`)return!1;let t=!0;return e.eachChild(e=>{t&&!rr(e)&&(t=!1)}),t}function ir(e,t){if(e instanceof Xn&&t.indexOf(e.name)>=0)return!1;let n=!0;return e.eachChild(e=>{n&&!ir(e,t)&&(n=!1)}),n}function ar(e){return{result:`success`,value:e}}function or(e){return{result:`error`,value:e}}function sr(e){return e[`property-type`]===`data-driven`||e[`property-type`]===`cross-faded-data-driven`}function cr(e){return!!e.expression&&e.expression.parameters.indexOf(`zoom`)>-1}function lr(e){return!!e.expression&&e.expression.interpolated}function ur(e){return e instanceof Number?`number`:e instanceof String?`string`:e instanceof Boolean?`boolean`:Array.isArray(e)?`array`:e===null?`null`:typeof e}function dr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function fr(e){return e}function pr(e,t){let n=t.type===`color`,r=e.stops&&typeof e.stops[0][0]==`object`,i=r||!(r||e.property!==void 0),a=e.type||(lr(t)?`exponential`:`interval`);if(n||t.type===`padding`){let r=n?Ye.parse:$e.parse;(e=ce({},e)).stops&&(e.stops=e.stops.map(e=>[e[0],r(e[1])])),e.default=r(e.default?e.default:t.default)}if(e.colorSpace&&(o=e.colorSpace)!==`rgb`&&o!==`hcl`&&o!==`lab`)throw Error(`Unknown color space: "${e.colorSpace}"`);var o;let s,c,l;if(a===`exponential`)s=_r;else if(a===`interval`)s=gr;else if(a===`categorical`){s=hr,c=Object.create(null);for(let t of e.stops)c[t[0]]=t[1];l=typeof e.stops[0][0]}else{if(a!==`identity`)throw Error(`Unknown function type "${a}"`);s=vr}if(r){let n={},r=[];for(let t=0;t<e.stops.length;t++){let i=e.stops[t],a=i[0].zoom;n[a]===void 0&&(n[a]={zoom:a,type:e.type,property:e.property,default:e.default,stops:[]},r.push(a)),n[a].stops.push([i[0].value,i[1]])}let i=[];for(let e of r)i.push([n[e].zoom,pr(n[e],t)]);let a={name:`linear`};return{kind:`composite`,interpolationType:a,interpolationFactor:Mt.interpolationFactor.bind(void 0,a),zoomStops:i.map(e=>e[0]),evaluate:({zoom:n},r)=>_r({stops:i,base:e.base},t,n).evaluate(n,r)}}if(i){let n=a===`exponential`?{name:`exponential`,base:e.base===void 0?1:e.base}:null;return{kind:`camera`,interpolationType:n,interpolationFactor:Mt.interpolationFactor.bind(void 0,n),zoomStops:e.stops.map(e=>e[0]),evaluate:({zoom:n})=>s(e,t,n,c,l)}}return{kind:`source`,evaluate(n,r){let i=r&&r.properties?r.properties[e.property]:void 0;return i===void 0?mr(e.default,t.default):s(e,t,i,c,l)}}}function mr(e,t,n){return e===void 0?t===void 0?n===void 0?void 0:n:t:e}function hr(e,t,n,r,i){return mr(typeof n===i?r[n]:void 0,e.default,t.default)}function gr(e,t,n){if(ur(n)!==`number`)return mr(e.default,t.default);let r=e.stops.length;if(r===1||n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[r-1][0])return e.stops[r-1][1];let i=Ct(e.stops.map(e=>e[0]),n);return e.stops[i][1]}function _r(e,t,n){let r=e.base===void 0?1:e.base;if(ur(n)!==`number`)return mr(e.default,t.default);let i=e.stops.length;if(i===1||n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[i-1][0])return e.stops[i-1][1];let a=Ct(e.stops.map(e=>e[0]),n),o=function(e,t,n,r){let i=r-n,a=e-n;return i===0?0:t===1?a/i:(t**+a-1)/(t**+i-1)}(n,r,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],c=e.stops[a+1][1],l=jt[t.type]||fr;return typeof s.evaluate==`function`?{evaluate(...t){let n=s.evaluate.apply(void 0,t),r=c.evaluate.apply(void 0,t);if(n!==void 0&&r!==void 0)return l(n,r,o,e.colorSpace)}}:l(s,c,o,e.colorSpace)}function vr(e,t,n){switch(t.type){case`color`:n=Ye.parse(n);break;case`formatted`:n=Qe.fromString(n.toString());break;case`resolvedImage`:n=nt.fromString(n.toString());break;case`padding`:n=$e.parse(n);break;default:ur(n)===t.type||t.type===`enum`&&t.values[n]||(n=void 0)}return mr(n,e.default,t.default)}Xn.register(Yn,{error:[{kind:`error`},[pe],(e,[t])=>{throw new ct(t.evaluate(e))}],typeof:[pe,[_e],(e,[t])=>we(at(t.evaluate(e)))],"to-rgba":[Ce(fe,4),[he],(e,[t])=>{let[n,r,i,a]=t.evaluate(e).rgb;return[255*n,255*r,255*i,a]}],rgb:[he,[fe,fe,fe],Zn],rgba:[he,[fe,fe,fe,fe],Zn],has:{type:me,overloads:[[[pe],(e,[t])=>Qn(t.evaluate(e),e.properties())],[[pe,ge],(e,[t,n])=>Qn(t.evaluate(e),n.evaluate(e))]]},get:{type:_e,overloads:[[[pe],(e,[t])=>$n(t.evaluate(e),e.properties())],[[pe,ge],(e,[t,n])=>$n(t.evaluate(e),n.evaluate(e))]]},"feature-state":[_e,[pe],(e,[t])=>$n(t.evaluate(e),e.featureState||{})],properties:[ge,[],e=>e.properties()],"geometry-type":[pe,[],e=>e.geometryType()],id:[_e,[],e=>e.id()],zoom:[fe,[],e=>e.globals.zoom],"heatmap-density":[fe,[],e=>e.globals.heatmapDensity||0],"line-progress":[fe,[],e=>e.globals.lineProgress||0],accumulated:[_e,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[fe,er(fe),(e,t)=>{let n=0;for(let r of t)n+=r.evaluate(e);return n}],"*":[fe,er(fe),(e,t)=>{let n=1;for(let r of t)n*=r.evaluate(e);return n}],"-":{type:fe,overloads:[[[fe,fe],(e,[t,n])=>t.evaluate(e)-n.evaluate(e)],[[fe],(e,[t])=>-t.evaluate(e)]]},"/":[fe,[fe,fe],(e,[t,n])=>t.evaluate(e)/n.evaluate(e)],"%":[fe,[fe,fe],(e,[t,n])=>t.evaluate(e)%n.evaluate(e)],ln2:[fe,[],()=>Math.LN2],pi:[fe,[],()=>Math.PI],e:[fe,[],()=>Math.E],"^":[fe,[fe,fe],(e,[t,n])=>t.evaluate(e)**+n.evaluate(e)],sqrt:[fe,[fe],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[fe,[fe],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[fe,[fe],(e,[t])=>Math.log(t.evaluate(e))],log2:[fe,[fe],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[fe,[fe],(e,[t])=>Math.sin(t.evaluate(e))],cos:[fe,[fe],(e,[t])=>Math.cos(t.evaluate(e))],tan:[fe,[fe],(e,[t])=>Math.tan(t.evaluate(e))],asin:[fe,[fe],(e,[t])=>Math.asin(t.evaluate(e))],acos:[fe,[fe],(e,[t])=>Math.acos(t.evaluate(e))],atan:[fe,[fe],(e,[t])=>Math.atan(t.evaluate(e))],min:[fe,er(fe),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[fe,er(fe),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[fe,[fe],(e,[t])=>Math.abs(t.evaluate(e))],round:[fe,[fe],(e,[t])=>{let n=t.evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[fe,[fe],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[fe,[fe],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[me,[pe,_e],(e,[t,n])=>e.properties()[t.value]===n.value],"filter-id-==":[me,[_e],(e,[t])=>e.id()===t.value],"filter-type-==":[me,[pe],(e,[t])=>e.geometryType()===t.value],"filter-<":[me,[pe,_e],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<i}],"filter-id-<":[me,[_e],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<r}],"filter->":[me,[pe,_e],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>i}],"filter-id->":[me,[_e],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>r}],"filter-<=":[me,[pe,_e],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<=i}],"filter-id-<=":[me,[_e],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<=r}],"filter->=":[me,[pe,_e],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>=i}],"filter-id->=":[me,[_e],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>=r}],"filter-has":[me,[_e],(e,[t])=>t.value in e.properties()],"filter-has-id":[me,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[me,[Ce(pe)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[me,[Ce(_e)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[me,[pe,Ce(_e)],(e,[t,n])=>n.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[me,[pe,Ce(_e)],(e,[t,n])=>function(e,t,n,r){for(;n<=r;){let i=n+r>>1;if(t[i]===e)return!0;t[i]>e?r=i-1:n=i+1}return!1}(e.properties()[t.value],n.value,0,n.value.length-1)],all:{type:me,overloads:[[[me,me],(e,[t,n])=>t.evaluate(e)&&n.evaluate(e)],[er(me),(e,t)=>{for(let n of t)if(!n.evaluate(e))return!1;return!0}]]},any:{type:me,overloads:[[[me,me],(e,[t,n])=>t.evaluate(e)||n.evaluate(e)],[er(me),(e,t)=>{for(let n of t)if(n.evaluate(e))return!0;return!1}]]},"!":[me,[me],(e,[t])=>!t.evaluate(e)],"is-supported-script":[me,[pe],(e,[t])=>{let n=e.globals&&e.globals.isSupportedScript;return!n||n(t.evaluate(e))}],upcase:[pe,[pe],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[pe,[pe],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[pe,er(_e),(e,t)=>t.map(t=>ot(t.evaluate(e))).join(``)],"resolved-locale":[pe,[ve],(e,[t])=>t.evaluate(e).resolvedLocale()]});class yr{constructor(e,t){var n;this.expression=e,this._warningHistory={},this._evaluator=new pt,this._defaultValue=t?(n=t).type===`color`&&dr(n.default)?new Ye(0,0,0,0):n.type===`color`?Ye.parse(n.default)||null:n.type===`padding`?$e.parse(n.default)||null:n.type===`variableAnchorOffsetCollection`?tt.parse(n.default)||null:n.default===void 0?null:n.default:null,this._enumValues=t&&t.type===`enum`?t.values:null}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,n,r,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(e==null||typeof e==`number`&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new ct(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(`, `)}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,typeof console<`u`&&console.warn(e.message)),this._defaultValue}}}function br(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`string`&&e[0]in Yn}function xr(e,t){let n=new mt(Yn,tr,[],t?function(e){let t={color:he,string:pe,number:fe,enum:pe,boolean:me,formatted:ye,padding:be,resolvedImage:xe,variableAnchorOffsetCollection:Se};return e.type===`array`?Ce(t[e.value]||_e,e.length):t[e.type]}(t):void 0),r=n.parse(e,void 0,void 0,void 0,t&&t.type===`string`?{typeAnnotation:`coerce`}:void 0);return r?ar(new yr(r,t)):or(n.errors)}class Sr{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!==`constant`&&!rr(t.expression)}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._styleExpression.evaluate(e,t,n,r,i,a)}}class Cr{constructor(e,t,n,r){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent=e!==`camera`&&!rr(t.expression),this.interpolationType=r}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._styleExpression.evaluate(e,t,n,r,i,a)}interpolationFactor(e,t,n){return this.interpolationType?Mt.interpolationFactor(this.interpolationType,e,t,n):0}}function wr(e,t){let n=xr(e,t);if(n.result===`error`)return n;let r=n.value.expression,i=nr(r);if(!i&&!sr(t))return or([new le(``,`data expressions not supported`)]);let a=ir(r,[`zoom`]);if(!a&&!cr(t))return or([new le(``,`zoom expressions not supported`)]);let o=Er(r);return o||a?o instanceof le?or([o]):o instanceof Mt&&!lr(t)?or([new le(``,`"interpolate" expressions cannot be used with this property`)]):ar(o?new Cr(i?`camera`:`composite`,n.value,o.labels,o instanceof Mt?o.interpolation:void 0):new Sr(i?`constant`:`source`,n.value)):or([new le(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`)])}class Tr{constructor(e,t){this._parameters=e,this._specification=t,ce(this,pr(this._parameters,this._specification))}static deserialize(e){return new Tr(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Er(e){let t=null;if(e instanceof ht)t=Er(e.result);else if(e instanceof Pt){for(let n of e.args)if(t=Er(n),t)break}else (e instanceof wt||e instanceof Mt)&&e.input instanceof Xn&&e.input.name===`zoom`&&(t=e);return t instanceof le||e.eachChild(e=>{let n=Er(e);n instanceof le?t=n:!t&&n?t=new le(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`):t&&n&&t!==n&&(t=new le(``,`Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.`))}),t}function Dr(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case`has`:return e.length>=2&&e[1]!==`$id`&&e[1]!==`$type`;case`in`:return e.length>=3&&(typeof e[1]!=`string`||Array.isArray(e[2]));case`!in`:case`!has`:case`none`:return!1;case`==`:case`!=`:case`>`:case`>=`:case`<`:case`<=`:return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case`any`:case`all`:for(let t of e.slice(1))if(!Dr(t)&&typeof t!=`boolean`)return!1;return!0;default:return!0}}let Or={type:`boolean`,default:!1,transition:!1,"property-type":`data-driven`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]}};function kr(e){if(e==null)return{filter:()=>!0,needGeometry:!1};Dr(e)||(e=Mr(e));let t=xr(e,Or);if(t.result===`error`)throw Error(t.value.map(e=>`${e.key}: ${e.message}`).join(`, `));return{filter:(e,n,r)=>t.value.evaluate(e,n,{},r),needGeometry:jr(e)}}function Ar(e,t){return e<t?-1:e>t?1:0}function jr(e){if(!Array.isArray(e))return!1;if(e[0]===`within`||e[0]===`distance`)return!0;for(let t=1;t<e.length;t++)if(jr(e[t]))return!0;return!1}function Mr(e){if(!e)return!0;let t=e[0];return e.length<=1?t!==`any`:t===`==`?Nr(e[1],e[2],`==`):t===`!=`?Ir(Nr(e[1],e[2],`==`)):t===`<`||t===`>`||t===`<=`||t===`>=`?Nr(e[1],e[2],t):t===`any`?(n=e.slice(1),[`any`].concat(n.map(Mr))):t===`all`?[`all`].concat(e.slice(1).map(Mr)):t===`none`?[`all`].concat(e.slice(1).map(Mr).map(Ir)):t===`in`?Pr(e[1],e.slice(2)):t===`!in`?Ir(Pr(e[1],e.slice(2))):t===`has`?Fr(e[1]):t!==`!has`||Ir(Fr(e[1]));var n}function Nr(e,t,n){switch(e){case`$type`:return[`filter-type-${n}`,t];case`$id`:return[`filter-id-${n}`,t];default:return[`filter-${n}`,e,t]}}function Pr(e,t){if(t.length===0)return!1;switch(e){case`$type`:return[`filter-type-in`,[`literal`,t]];case`$id`:return[`filter-id-in`,[`literal`,t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?[`filter-in-large`,e,[`literal`,t.sort(Ar)]]:[`filter-in-small`,e,[`literal`,t]]}}function Fr(e){switch(e){case`$type`:return!0;case`$id`:return[`filter-has-id`];default:return[`filter-has`,e]}}function Ir(e){return[`!`,e]}function Lr(e){let t=typeof e;if(t===`number`||t===`boolean`||t===`string`||e==null)return JSON.stringify(e);if(Array.isArray(e)){let t=`[`;for(let n of e)t+=`${Lr(n)},`;return`${t}]`}let n=Object.keys(e).sort(),r=`{`;for(let t=0;t<n.length;t++)r+=`${JSON.stringify(n[t])}:${Lr(e[n[t]])},`;return`${r}}`}function Rr(e){let t=``;for(let n of Y)t+=`/${Lr(e[n])}`;return t}function zr(e){let t=e.value;return t?[new se(e.key,t,`constants have been deprecated as of v8`)]:[]}function Br(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Vr(e){if(Array.isArray(e))return e.map(Vr);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let n in e)t[n]=Vr(e[n]);return t}return Br(e)}function Hr(e){let t=e.key,n=e.value,r=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=e.validateSpec,c=[],l=ur(n);if(l!==`object`)return[new se(t,n,`object expected, ${l} found`)];for(let e in n){let l=e.split(`.`)[0],u=r[l]||r[`*`],d;if(i[l])d=i[l];else if(r[l])d=s;else if(i[`*`])d=i[`*`];else{if(!r[`*`]){c.push(new se(t,n[e],`unknown property "${e}"`));continue}d=s}c=c.concat(d({key:(t&&`${t}.`)+e,value:n[e],valueSpec:u,style:a,styleSpec:o,object:n,objectKey:e,validateSpec:s},n))}for(let e in r)i[e]||r[e].required&&r[e].default===void 0&&n[e]===void 0&&c.push(new se(t,n,`missing required property "${e}"`));return c}function Ur(e){let t=e.value,n=e.valueSpec,r=e.style,i=e.styleSpec,a=e.key,o=e.arrayElementValidator||e.validateSpec;if(ur(t)!==`array`)return[new se(a,t,`array expected, ${ur(t)} found`)];if(n.length&&t.length!==n.length)return[new se(a,t,`array length ${n.length} expected, length ${t.length} found`)];if(n[`min-length`]&&t.length<n[`min-length`])return[new se(a,t,`array length at least ${n[`min-length`]} expected, length ${t.length} found`)];let s={type:n.value,values:n.values};i.$version<7&&(s.function=n.function),ur(n.value)===`object`&&(s=n.value);let c=[];for(let n=0;n<t.length;n++)c=c.concat(o({array:t,arrayIndex:n,value:t[n],valueSpec:s,validateSpec:e.validateSpec,style:r,styleSpec:i,key:`${a}[${n}]`}));return c}function Wr(e){let t=e.key,n=e.value,r=e.valueSpec,i=ur(n);return i===`number`&&n!=n&&(i=`NaN`),i===`number`?`minimum`in r&&n<r.minimum?[new se(t,n,`${n} is less than the minimum value ${r.minimum}`)]:`maximum`in r&&n>r.maximum?[new se(t,n,`${n} is greater than the maximum value ${r.maximum}`)]:[]:[new se(t,n,`number expected, ${i} found`)]}function Gr(e){let t=e.valueSpec,n=Br(e.value.type),r,i,a,o={},s=n!==`categorical`&&e.value.property===void 0,c=!s,l=ur(e.value.stops)===`array`&&ur(e.value.stops[0])===`array`&&ur(e.value.stops[0][0])===`object`,u=Hr({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if(n===`identity`)return[new se(e.key,e.value,`identity function may not have a "stops" property`)];let t=[],r=e.value;return t=t.concat(Ur({key:e.key,value:r,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:d})),ur(r)===`array`&&r.length===0&&t.push(new se(e.key,r,`array must have at least one stop`)),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return n===`identity`&&s&&u.push(new se(e.key,e.value,`missing required property "property"`)),n===`identity`||e.value.stops||u.push(new se(e.key,e.value,`missing required property "stops"`)),n===`exponential`&&e.valueSpec.expression&&!lr(e.valueSpec)&&u.push(new se(e.key,e.value,`exponential functions not supported`)),e.styleSpec.$version>=8&&(c&&!sr(e.valueSpec)?u.push(new se(e.key,e.value,`property functions not supported`)):s&&!cr(e.valueSpec)&&u.push(new se(e.key,e.value,`zoom functions not supported`))),n!==`categorical`&&!l||e.value.property!==void 0||u.push(new se(e.key,e.value,`"property" property is required`)),u;function d(e){let n=[],r=e.value,s=e.key;if(ur(r)!==`array`)return[new se(s,r,`array expected, ${ur(r)} found`)];if(r.length!==2)return[new se(s,r,`array length 2 expected, length ${r.length} found`)];if(l){if(ur(r[0])!==`object`)return[new se(s,r,`object expected, ${ur(r[0])} found`)];if(r[0].zoom===void 0)return[new se(s,r,`object stop key must have zoom`)];if(r[0].value===void 0)return[new se(s,r,`object stop key must have value`)];if(a&&a>Br(r[0].zoom))return[new se(s,r[0].zoom,`stop zoom values must appear in ascending order`)];Br(r[0].zoom)!==a&&(a=Br(r[0].zoom),i=void 0,o={}),n=n.concat(Hr({key:`${s}[0]`,value:r[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Wr,value:f}}))}else n=n.concat(f({key:`${s}[0]`,value:r[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},r));return br(Vr(r[1]))?n.concat([new se(`${s}[1]`,r[1],`expressions are not allowed in function stops.`)]):n.concat(e.validateSpec({key:`${s}[1]`,value:r[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function f(e,a){let s=ur(e.value),c=Br(e.value),l=e.value===null?a:e.value;if(r){if(s!==r)return[new se(e.key,l,`${s} stop domain type must match previous stop domain type ${r}`)]}else r=s;if(s!==`number`&&s!==`string`&&s!==`boolean`)return[new se(e.key,l,`stop domain value must be a number, string, or boolean`)];if(s!==`number`&&n!==`categorical`){let r=`number expected, ${s} found`;return sr(t)&&n===void 0&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new se(e.key,l,r)]}return n!==`categorical`||s!==`number`||isFinite(c)&&Math.floor(c)===c?n!==`categorical`&&s===`number`&&i!==void 0&&c<i?[new se(e.key,l,`stop domain values must appear in ascending order`)]:(i=c,n===`categorical`&&c in o?[new se(e.key,l,`stop domain values must be unique`)]:(o[c]=!0,[])):[new se(e.key,l,`integer expected, found ${c}`)]}}function Kr(e){let t=(e.expressionContext===`property`?wr:xr)(Vr(e.value),e.valueSpec);if(t.result===`error`)return t.value.map(t=>new se(`${e.key}${t.key}`,e.value,t.message));let n=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext===`property`&&e.propertyKey===`text-font`&&!n.outputDefined())return[new se(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if(e.expressionContext===`property`&&e.propertyType===`layout`&&!rr(n))return[new se(e.key,e.value,`"feature-state" data expressions are not supported with layout properties.`)];if(e.expressionContext===`filter`&&!rr(n))return[new se(e.key,e.value,`"feature-state" data expressions are not supported with filters.`)];if(e.expressionContext&&e.expressionContext.indexOf(`cluster`)===0){if(!ir(n,[`zoom`,`feature-state`]))return[new se(e.key,e.value,`"zoom" and "feature-state" expressions are not supported with cluster properties.`)];if(e.expressionContext===`cluster-initial`&&!nr(n))return[new se(e.key,e.value,`Feature data expressions are not supported with initial expression part of cluster properties.`)]}return[]}function qr(e){let t=e.key,n=e.value,r=e.valueSpec,i=[];return Array.isArray(r.values)?r.values.indexOf(Br(n))===-1&&i.push(new se(t,n,`expected one of [${r.values.join(`, `)}], ${JSON.stringify(n)} found`)):Object.keys(r.values).indexOf(Br(n))===-1&&i.push(new se(t,n,`expected one of [${Object.keys(r.values).join(`, `)}], ${JSON.stringify(n)} found`)),i}function Jr(e){return Dr(Vr(e.value))?Kr(ce({},e,{expressionContext:`filter`,valueSpec:{value:`boolean`}})):Yr(e)}function Yr(e){let t=e.value,n=e.key;if(ur(t)!==`array`)return[new se(n,t,`array expected, ${ur(t)} found`)];let r=e.styleSpec,i,a=[];if(t.length<1)return[new se(n,t,`filter array must have at least 1 element`)];switch(a=a.concat(qr({key:`${n}[0]`,value:t[0],valueSpec:r.filter_operator,style:e.style,styleSpec:e.styleSpec})),Br(t[0])){case`<`:case`<=`:case`>`:case`>=`:t.length>=2&&Br(t[1])===`$type`&&a.push(new se(n,t,`"$type" cannot be use with operator "${t[0]}"`));case`==`:case`!=`:t.length!==3&&a.push(new se(n,t,`filter array for operator "${t[0]}" must have 3 elements`));case`in`:case`!in`:t.length>=2&&(i=ur(t[1]),i!==`string`&&a.push(new se(`${n}[1]`,t[1],`string expected, ${i} found`)));for(let o=2;o<t.length;o++)i=ur(t[o]),Br(t[1])===`$type`?a=a.concat(qr({key:`${n}[${o}]`,value:t[o],valueSpec:r.geometry_type,style:e.style,styleSpec:e.styleSpec})):i!==`string`&&i!==`number`&&i!==`boolean`&&a.push(new se(`${n}[${o}]`,t[o],`string, number, or boolean expected, ${i} found`));break;case`any`:case`all`:case`none`:for(let r=1;r<t.length;r++)a=a.concat(Yr({key:`${n}[${r}]`,value:t[r],style:e.style,styleSpec:e.styleSpec}));break;case`has`:case`!has`:i=ur(t[1]),t.length===2?i!==`string`&&a.push(new se(`${n}[1]`,t[1],`string expected, ${i} found`)):a.push(new se(n,t,`filter array for "${t[0]}" operator must have 2 elements`))}return a}function Xr(e,t){let n=e.key,r=e.validateSpec,i=e.style,a=e.styleSpec,o=e.value,s=e.objectKey,c=a[`${t}_${e.layerType}`];if(!c)return[];let l=s.match(/^(.*)-transition$/);if(t===`paint`&&l&&c[l[1]]&&c[l[1]].transition)return r({key:n,value:o,valueSpec:a.transition,style:i,styleSpec:a});let u=e.valueSpec||c[s];if(!u)return[new se(n,o,`unknown property "${s}"`)];let d;if(ur(o)===`string`&&sr(u)&&!u.tokens&&(d=/^{([^}]+)}$/.exec(o)))return[new se(n,o,`"${s}" does not support interpolation syntax
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(d[1])} }\`.`)];let f=[];return e.layerType===`symbol`&&(s===`text-field`&&i&&!i.glyphs&&f.push(new se(n,o,`use of "text-field" requires a style "glyphs" property`)),s===`text-font`&&dr(Vr(o))&&Br(o.type)===`identity`&&f.push(new se(n,o,`"text-font" does not support identity functions`))),f.concat(r({key:e.key,value:o,valueSpec:u,style:i,styleSpec:a,expressionContext:`property`,propertyType:t,propertyKey:s}))}function Zr(e){return Xr(e,`paint`)}function Qr(e){return Xr(e,`layout`)}function $r(e){let t=[],n=e.value,r=e.key,i=e.style,a=e.styleSpec;n.type||n.ref||t.push(new se(r,n,`either "type" or "ref" is required`));let o=Br(n.type),s=Br(n.ref);if(n.id){let a=Br(n.id);for(let o=0;o<e.arrayIndex;o++){let e=i.layers[o];Br(e.id)===a&&t.push(new se(r,n.id,`duplicate layer id "${n.id}", previously used at line ${e.id.__line__}`))}}if(`ref`in n){let e;[`type`,`source`,`source-layer`,`filter`,`layout`].forEach(e=>{e in n&&t.push(new se(r,n[e],`"${e}" is prohibited for ref layers`))}),i.layers.forEach(t=>{Br(t.id)===s&&(e=t)}),e?e.ref?t.push(new se(r,n.ref,`ref cannot reference another ref layer`)):o=Br(e.type):t.push(new se(r,n.ref,`ref layer "${s}" not found`))}else if(o!==`background`)if(n.source){let e=i.sources&&i.sources[n.source],a=e&&Br(e.type);e?a===`vector`&&o===`raster`?t.push(new se(r,n.source,`layer "${n.id}" requires a raster source`)):a!==`raster-dem`&&o===`hillshade`?t.push(new se(r,n.source,`layer "${n.id}" requires a raster-dem source`)):a===`raster`&&o!==`raster`?t.push(new se(r,n.source,`layer "${n.id}" requires a vector source`)):a!==`vector`||n[`source-layer`]?a===`raster-dem`&&o!==`hillshade`?t.push(new se(r,n.source,`raster-dem source can only be used with layer type 'hillshade'.`)):o!==`line`||!n.paint||!n.paint[`line-gradient`]||a===`geojson`&&e.lineMetrics||t.push(new se(r,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new se(r,n,`layer "${n.id}" must specify a "source-layer"`)):t.push(new se(r,n.source,`source "${n.source}" not found`))}else t.push(new se(r,n,`missing required property "source"`));return t=t.concat(Hr({key:r,value:n,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:`${r}.type`,value:n.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:n,objectKey:`type`}),filter:Jr,layout:e=>Hr({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>Qr(ce({layerType:o},e))}}),paint:e=>Hr({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>Zr(ce({layerType:o},e))}})}})),t}function ei(e){let t=e.value,n=e.key,r=ur(t);return r===`string`?[]:[new se(n,t,`string expected, ${r} found`)]}let ti={promoteId:function({key:e,value:t}){if(ur(t)===`string`)return ei({key:e,value:t});{let n=[];for(let r in t)n.push(...ei({key:`${e}.${r}`,value:t[r]}));return n}}};function ni(e){let t=e.value,n=e.key,r=e.styleSpec,i=e.style,a=e.validateSpec;if(!t.type)return[new se(n,t,`"type" is required`)];let o=Br(t.type),s;switch(o){case`vector`:case`raster`:return s=Hr({key:n,value:t,valueSpec:r[`source_${o.replace(`-`,`_`)}`],style:e.style,styleSpec:r,objectElementValidators:ti,validateSpec:a}),s;case`raster-dem`:return s=function(e){let t=e.sourceName??``,n=e.value,r=e.styleSpec,i=r.source_raster_dem,a=e.style,o=[],s=ur(n);if(n===void 0)return o;if(s!==`object`)return o.push(new se(`source_raster_dem`,n,`object expected, ${s} found`)),o;let c=Br(n.encoding)===`custom`,l=[`redFactor`,`greenFactor`,`blueFactor`,`baseShift`],u=e.value.encoding?`"${e.value.encoding}"`:`Default`;for(let s in n)!c&&l.includes(s)?o.push(new se(s,n[s],`In "${t}": "${s}" is only valid when "encoding" is set to "custom". ${u} encoding found`)):i[s]?o=o.concat(e.validateSpec({key:s,value:n[s],valueSpec:i[s],validateSpec:e.validateSpec,style:a,styleSpec:r})):o.push(new se(s,n[s],`unknown property "${s}"`));return o}({sourceName:n,value:t,style:e.style,styleSpec:r,validateSpec:a}),s;case`geojson`:if(s=Hr({key:n,value:t,valueSpec:r.source_geojson,style:i,styleSpec:r,validateSpec:a,objectElementValidators:ti}),t.cluster)for(let e in t.clusterProperties){let[r,i]=t.clusterProperties[e],o=typeof r==`string`?[r,[`accumulated`],[`get`,e]]:r;s.push(...Kr({key:`${n}.${e}.map`,value:i,validateSpec:a,expressionContext:`cluster-map`})),s.push(...Kr({key:`${n}.${e}.reduce`,value:o,validateSpec:a,expressionContext:`cluster-reduce`}))}return s;case`video`:return Hr({key:n,value:t,valueSpec:r.source_video,style:i,validateSpec:a,styleSpec:r});case`image`:return Hr({key:n,value:t,valueSpec:r.source_image,style:i,validateSpec:a,styleSpec:r});case`canvas`:return[new se(n,null,`Please use runtime APIs to add canvas sources, rather than including them in stylesheets.`,`source.canvas`)];default:return qr({key:`${n}.type`,value:t.type,valueSpec:{values:[`vector`,`raster`,`raster-dem`,`geojson`,`video`,`image`]},style:i,validateSpec:a,styleSpec:r})}}function ri(e){let t=e.value,n=e.styleSpec,r=n.light,i=e.style,a=[],o=ur(t);if(t===void 0)return a;if(o!==`object`)return a=a.concat([new se(`light`,t,`object expected, ${o} found`)]),a;for(let o in t){let s=o.match(/^(.*)-transition$/);a=a.concat(s&&r[s[1]]&&r[s[1]].transition?e.validateSpec({key:o,value:t[o],valueSpec:n.transition,validateSpec:e.validateSpec,style:i,styleSpec:n}):r[o]?e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:i,styleSpec:n}):[new se(o,t[o],`unknown property "${o}"`)])}return a}function ii(e){let t=e.value,n=e.styleSpec,r=n.sky,i=e.style,a=ur(t);if(t===void 0)return[];if(a!==`object`)return[new se(`sky`,t,`object expected, ${a} found`)];let o=[];for(let a in t)o=o.concat(r[a]?e.validateSpec({key:a,value:t[a],valueSpec:r[a],style:i,styleSpec:n}):[new se(a,t[a],`unknown property "${a}"`)]);return o}function ai(e){let t=e.value,n=e.styleSpec,r=n.terrain,i=e.style,a=[],o=ur(t);if(t===void 0)return a;if(o!==`object`)return a=a.concat([new se(`terrain`,t,`object expected, ${o} found`)]),a;for(let o in t)a=a.concat(r[o]?e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:i,styleSpec:n}):[new se(o,t[o],`unknown property "${o}"`)]);return a}function oi(e){let t=[],n=e.value,r=e.key;if(Array.isArray(n)){let i=[],a=[];for(let o in n)n[o].id&&i.includes(n[o].id)&&t.push(new se(r,n,`all the sprites' ids must be unique, but ${n[o].id} is duplicated`)),i.push(n[o].id),n[o].url&&a.includes(n[o].url)&&t.push(new se(r,n,`all the sprites' URLs must be unique, but ${n[o].url} is duplicated`)),a.push(n[o].url),t=t.concat(Hr({key:`${r}[${o}]`,value:n[o],valueSpec:{id:{type:`string`,required:!0},url:{type:`string`,required:!0}},validateSpec:e.validateSpec}));return t}return ei({key:r,value:n})}let si={"*":()=>[],array:Ur,boolean:function(e){let t=e.value,n=e.key,r=ur(t);return r===`boolean`?[]:[new se(n,t,`boolean expected, ${r} found`)]},number:Wr,color:function(e){let t=e.key,n=e.value,r=ur(n);return r===`string`?Ye.parse(String(n))?[]:[new se(t,n,`color expected, "${n}" found`)]:[new se(t,n,`color expected, ${r} found`)]},constants:zr,enum:qr,filter:Jr,function:Gr,layer:$r,object:Hr,source:ni,light:ri,sky:ii,terrain:ai,projection:function(e){let t=e.value,n=e.styleSpec,r=n.projection,i=e.style,a=ur(t);if(t===void 0)return[];if(a!==`object`)return[new se(`projection`,t,`object expected, ${a} found`)];let o=[];for(let a in t)o=o.concat(r[a]?e.validateSpec({key:a,value:t[a],valueSpec:r[a],style:i,styleSpec:n}):[new se(a,t[a],`unknown property "${a}"`)]);return o},string:ei,formatted:function(e){return ei(e).length===0?[]:Kr(e)},resolvedImage:function(e){return ei(e).length===0?[]:Kr(e)},padding:function(e){let t=e.key,n=e.value;if(ur(n)===`array`){if(n.length<1||n.length>4)return[new se(t,n,`padding requires 1 to 4 values; ${n.length} values found`)];let r={type:`number`},i=[];for(let a=0;a<n.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:n[a],validateSpec:e.validateSpec,valueSpec:r}));return i}return Wr({key:t,value:n,valueSpec:{}})},variableAnchorOffsetCollection:function(e){let t=e.key,n=e.value,r=ur(n),i=e.styleSpec;if(r!==`array`||n.length<1||n.length%2!=0)return[new se(t,n,`variableAnchorOffsetCollection requires a non-empty array of even length`)];let a=[];for(let r=0;r<n.length;r+=2)a=a.concat(qr({key:`${t}[${r}]`,value:n[r],valueSpec:i.layout_symbol[`text-anchor`]})),a=a.concat(Ur({key:`${t}[${r+1}]`,value:n[r+1],valueSpec:{length:2,value:`number`},validateSpec:e.validateSpec,style:e.style,styleSpec:i}));return a},sprite:oi};function ci(e){let t=e.value,n=e.valueSpec,r=e.styleSpec;return e.validateSpec=ci,n.expression&&dr(Br(t))?Gr(e):n.expression&&br(Vr(t))?Kr(e):n.type&&si[n.type]?si[n.type](e):Hr(ce({},e,{valueSpec:n.type?r[n.type]:n}))}function li(e){let t=e.value,n=e.key,r=ei(e);return r.length||(t.indexOf(`{fontstack}`)===-1&&r.push(new se(n,t,`"glyphs" url must include a "{fontstack}" token`)),t.indexOf(`{range}`)===-1&&r.push(new se(n,t,`"glyphs" url must include a "{range}" token`))),r}function ui(e,t=J){let n=[];return n=n.concat(ci({key:``,value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:ci,objectElementValidators:{glyphs:li,"*":()=>[]}})),e.constants&&(n=n.concat(zr({key:`constants`,value:e.constants,style:e,styleSpec:t,validateSpec:ci}))),fi(n)}function di(e){return function(t){return e(f(d({},t),{validateSpec:ci}))}}function fi(e){return[].concat(e).sort((e,t)=>e.line-t.line)}function pi(e){return function(...t){return fi(e.apply(this,t))}}ui.source=pi(di(ni)),ui.sprite=pi(di(oi)),ui.glyphs=pi(di(li)),ui.light=pi(di(ri)),ui.sky=pi(di(ii)),ui.terrain=pi(di(ai)),ui.layer=pi(di($r)),ui.filter=pi(di(Jr)),ui.paintProperty=pi(di(Zr)),ui.layoutProperty=pi(di(Qr));let mi=ui,hi=mi.light,gi=mi.sky,_i=mi.paintProperty,vi=mi.layoutProperty;function yi(e,t){let n=!1;if(t&&t.length)for(let r of t)e.fire(new K(Error(r.message))),n=!0;return n}class bi{constructor(e,t,n){let r=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let i=new Int32Array(this.arrayBuffer);e=i[0],this.d=(t=i[1])+2*(n=i[2]);for(let e=0;e<this.d*this.d;e++){let t=i[3+e],n=i[3+e+1];r.push(t===n?null:i.subarray(t,n))}let a=i[3+r.length+1];this.keys=i.subarray(i[3+r.length],a),this.bboxes=i.subarray(a),this.insert=this._insertReadonly}else{this.d=t+2*n;for(let e=0;e<this.d*this.d;e++)r.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=n,this.scale=t/e,this.uid=0;let i=n/t*e;this.min=-i,this.max=e+i}insert(e,t,n,r,i){this._forEachCell(t,n,r,i,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)}_insertReadonly(){throw Error(`Cannot insert into a GridIndex created from an ArrayBuffer.`)}_insertCell(e,t,n,r,i,a){this.cells[i].push(a)}query(e,t,n,r,i){let a=this.min,o=this.max;if(e<=a&&t<=a&&o<=n&&o<=r&&!i)return Array.prototype.slice.call(this.keys);{let a=[];return this._forEachCell(e,t,n,r,this._queryCell,a,{},i),a}}_queryCell(e,t,n,r,i,a,o,s){let c=this.cells[i];if(c!==null){let i=this.keys,l=this.bboxes;for(let u=0;u<c.length;u++){let d=c[u];if(o[d]===void 0){let c=4*d;(s?s(l[c+0],l[c+1],l[c+2],l[c+3]):e<=l[c+2]&&t<=l[c+3]&&n>=l[c+0]&&r>=l[c+1])?(o[d]=!0,a.push(i[d])):o[d]=!1}}}}_forEachCell(e,t,n,r,i,a,o,s){let c=this._convertToCellCoord(e),l=this._convertToCellCoord(t),u=this._convertToCellCoord(n),d=this._convertToCellCoord(r);for(let f=c;f<=u;f++)for(let c=l;c<=d;c++){let l=this.d*c+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(c),this._convertFromCellCoord(f+1),this._convertFromCellCoord(c+1)))&&i.call(this,e,t,n,r,l,a,o,s))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,t=3+this.cells.length+1+1,n=0;for(let e=0;e<this.cells.length;e++)n+=this.cells[e].length;let r=new Int32Array(t+n+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;let i=t;for(let t=0;t<e.length;t++){let n=e[t];r[3+t]=i,r.set(n,i),i+=n.length}return r[3+e.length]=i,r.set(this.keys,i),i+=this.keys.length,r[3+e.length+1]=i,r.set(this.bboxes,i),i+=this.bboxes.length,r.buffer}static serialize(e,t){let n=e.toArrayBuffer();return t&&t.push(n),{buffer:n}}static deserialize(e){return new bi(e.buffer)}}let xi={};function Si(e,t,n={}){if(xi[e])throw Error(`${e} is already registered.`);Object.defineProperty(t,`_classRegistryKey`,{value:e,writeable:!1}),xi[e]={klass:t,omit:n.omit||[],shallow:n.shallow||[]}}Si(`Object`,Object),Si(`TransferableGridIndex`,bi),Si(`Color`,Ye),Si(`Error`,Error),Si(`AJAXError`,z),Si(`ResolvedImage`,nt),Si(`StylePropertyFunction`,Tr),Si(`StyleExpression`,yr,{omit:[`_evaluator`]}),Si(`ZoomDependentExpression`,Cr),Si(`ZoomConstantExpression`,Sr),Si(`CompoundExpression`,Xn,{omit:[`_evaluate`]});for(let e in Yn)Yn[e]._classRegistryKey||Si(`Expression_${e}`,Yn[e]);function Ci(e){return e&&typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name===`ArrayBuffer`)}function wi(e){return e.$name||e.constructor._classRegistryKey}function Ti(e){return!function(e){if(typeof e!=`object`||!e)return!1;let t=wi(e);return!(!t||t===`Object`)}(e)&&(e==null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||Ci(e)||k(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function Ei(e,t){if(Ti(e))return(Ci(e)||k(e))&&t&&t.push(e),ArrayBuffer.isView(e)&&t&&t.push(e.buffer),e instanceof ImageData&&t&&t.push(e.data.buffer),e;if(Array.isArray(e)){let n=[];for(let r of e)n.push(Ei(r,t));return n}if(typeof e!=`object`)throw Error(`can't serialize object of type `+typeof e);let n=wi(e);if(!n)throw Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!xi[n])throw Error(`${n} is not registered.`);let{klass:r}=xi[n],i=r.serialize?r.serialize(e,t):{};if(r.serialize){if(t&&i===t[t.length-1])throw Error(`statically serialized object won't survive transfer of $name property`)}else{for(let r in e){if(!e.hasOwnProperty(r)||xi[n].omit.indexOf(r)>=0)continue;let a=e[r];i[r]=xi[n].shallow.indexOf(r)>=0?a:Ei(a,t)}e instanceof Error&&(i.message=e.message)}if(i.$name)throw Error(`$name property is reserved for worker serialization logic.`);return n!==`Object`&&(i.$name=n),i}function Di(e){if(Ti(e))return e;if(Array.isArray(e))return e.map(Di);if(typeof e!=`object`)throw Error(`can't deserialize object of type `+typeof e);let t=wi(e)||`Object`;if(!xi[t])throw Error(`can't deserialize unregistered class ${t}`);let{klass:n}=xi[t];if(!n)throw Error(`can't deserialize unregistered class ${t}`);if(n.deserialize)return n.deserialize(e);let r=Object.create(n.prototype);for(let n of Object.keys(e)){if(n===`$name`)continue;let i=e[n];r[n]=xi[t].shallow.indexOf(n)>=0?i:Di(i)}return r}class Oi{constructor(){this.first=!0}update(e,t){let n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=n,!0))}}let ki={"Latin-1 Supplement":e=>e>=128&&e<=255,"Hangul Jamo":e=>e>=4352&&e<=4607,Khmer:e=>e>=6016&&e<=6143,"General Punctuation":e=>e>=8192&&e<=8303,"Letterlike Symbols":e=>e>=8448&&e<=8527,"Number Forms":e=>e>=8528&&e<=8591,"Miscellaneous Technical":e=>e>=8960&&e<=9215,"Control Pictures":e=>e>=9216&&e<=9279,"Optical Character Recognition":e=>e>=9280&&e<=9311,"Enclosed Alphanumerics":e=>e>=9312&&e<=9471,"Geometric Shapes":e=>e>=9632&&e<=9727,"Miscellaneous Symbols":e=>e>=9728&&e<=9983,"Miscellaneous Symbols and Arrows":e=>e>=11008&&e<=11263,"Ideographic Description Characters":e=>e>=12272&&e<=12287,"CJK Symbols and Punctuation":e=>e>=12288&&e<=12351,Katakana:e=>e>=12448&&e<=12543,Kanbun:e=>e>=12688&&e<=12703,"CJK Strokes":e=>e>=12736&&e<=12783,"Enclosed CJK Letters and Months":e=>e>=12800&&e<=13055,"CJK Compatibility":e=>e>=13056&&e<=13311,"Yijing Hexagram Symbols":e=>e>=19904&&e<=19967,"Private Use Area":e=>e>=57344&&e<=63743,"Vertical Forms":e=>e>=65040&&e<=65055,"CJK Compatibility Forms":e=>e>=65072&&e<=65103,"Small Form Variants":e=>e>=65104&&e<=65135,"Halfwidth and Fullwidth Forms":e=>e>=65280&&e<=65519};function Ai(e){for(let t of e)if(Ii(t.charCodeAt(0)))return!0;return!1}function ji(e){for(let t of e)if(!Pi(t.charCodeAt(0)))return!1;return!0}function Mi(e){let t=e.map(e=>{try{return RegExp(`\\p{sc=${e}}`,`u`).source}catch{return null}}).filter(e=>e);return new RegExp(t.join(`|`),`u`)}let Ni=Mi([`Arab`,`Dupl`,`Mong`,`Ougr`,`Syrc`]);function Pi(e){return!Ni.test(String.fromCodePoint(e))}let Fi=Mi([`Bopo`,`Hani`,`Hira`,`Kana`,`Kits`,`Nshu`,`Tang`,`Yiii`]);function Ii(e){return!(e!==746&&e!==747&&(e<4352||!(ki[`CJK Compatibility Forms`](e)&&!(e>=65097&&e<=65103)||ki[`CJK Compatibility`](e)||ki[`CJK Strokes`](e)||!(!ki[`CJK Symbols and Punctuation`](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||e===12336)||ki[`Enclosed CJK Letters and Months`](e)||ki[`Ideographic Description Characters`](e)||ki.Kanbun(e)||ki.Katakana(e)&&e!==12540||!(!ki[`Halfwidth and Fullwidth Forms`](e)||e===65288||e===65289||e===65293||e>=65306&&e<=65310||e===65339||e===65341||e===65343||e>=65371&&e<=65503||e===65507||e>=65512&&e<=65519)||!(!ki[`Small Form Variants`](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||ki[`Vertical Forms`](e)||ki[`Yijing Hexagram Symbols`](e)||RegExp(`\\p{sc=Cans}`,`u`).test(String.fromCodePoint(e))||RegExp(`\\p{sc=Hang}`,`u`).test(String.fromCodePoint(e))||Fi.test(String.fromCodePoint(e)))))}function Li(e){return!(Ii(e)||function(e){return!!(ki[`Latin-1 Supplement`](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||ki[`General Punctuation`](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||ki[`Letterlike Symbols`](e)||ki[`Number Forms`](e)||ki[`Miscellaneous Technical`](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||ki[`Control Pictures`](e)&&e!==9251||ki[`Optical Character Recognition`](e)||ki[`Enclosed Alphanumerics`](e)||ki[`Geometric Shapes`](e)||ki[`Miscellaneous Symbols`](e)&&!(e>=9754&&e<=9759)||ki[`Miscellaneous Symbols and Arrows`](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||ki[`CJK Symbols and Punctuation`](e)||ki.Katakana(e)||ki[`Private Use Area`](e)||ki[`CJK Compatibility Forms`](e)||ki[`Small Form Variants`](e)||ki[`Halfwidth and Fullwidth Forms`](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(e))}let Ri=Mi(`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`.split(`.`));function zi(e){return Ri.test(String.fromCodePoint(e))}function Bi(e,t){return!(!t&&zi(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||ki.Khmer(e))}function Vi(e){for(let t of e)if(zi(t.charCodeAt(0)))return!0;return!1}let Hi=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus=`unavailable`,this.pluginURL=null}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Ui{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Oi,this.transition={})}isSupportedScript(e){return function(e,t){for(let n of e)if(!Bi(n.charCodeAt(0),t))return!1;return!0}(e,Hi.getRTLTextPluginStatus()===`loaded`)}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,t=e-Math.floor(e),n=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*t}}}class Wi{constructor(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(dr(e))return new Tr(e,t);if(br(e)){let n=wr(e,t);if(n.result===`error`)throw Error(n.value.map(e=>`${e.key}: ${e.message}`).join(`, `));return n.value}{let n=e;return t.type===`color`&&typeof e==`string`?n=Ye.parse(e):t.type!==`padding`||typeof e!=`number`&&!Array.isArray(e)?t.type===`variableAnchorOffsetCollection`&&Array.isArray(e)&&(n=tt.parse(e)):n=$e.parse(e),{kind:`constant`,evaluate:()=>n}}}(t===void 0?e.specification.default:t,e.specification)}isDataDriven(){return this.expression.kind===`source`||this.expression.kind===`composite`}possiblyEvaluate(e,t,n){return this.property.possiblyEvaluate(this,e,t,n)}}class Gi{constructor(e){this.property=e,this.value=new Wi(e,void 0)}transitioned(e,t){return new qi(this.property,this.value,t,y({},e.transition,this.transition),e.now)}untransitioned(){return new qi(this.property,this.value,null,{},0)}}class Ki{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return C(this._values[e].value.value)}setValue(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Gi(this._values[e].property)),this._values[e].value=new Wi(this._values[e].property,t===null?void 0:C(t))}getTransition(e){return C(this._values[e].transition)}setTransition(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Gi(this._values[e].property)),this._values[e].transition=C(t)||void 0}serialize(){let e={};for(let t of Object.keys(this._values)){let n=this.getValue(t);n!==void 0&&(e[t]=n);let r=this.getTransition(t);r!==void 0&&(e[`${t}-transition`]=r)}return e}transitioned(e,t){let n=new Ji(this._properties);for(let r of Object.keys(this._values))n._values[r]=this._values[r].transitioned(e,t._values[r]);return n}untransitioned(){let e=new Ji(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class qi{constructor(e,t,n,r,i){this.property=e,this.value=t,this.begin=i+r.delay||0,this.end=this.begin+r.duration||0,e.specification.transition&&(r.delay||r.duration)&&(this.prior=n)}possiblyEvaluate(e,t,n){let r=e.now||0,i=this.value.possiblyEvaluate(e,t,n),a=this.prior;if(a){if(r>this.end||this.value.isDataDriven())return this.prior=null,i;if(r<this.begin)return a.possiblyEvaluate(e,t,n);{let o=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,n),i,function(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}(o))}}return i}}class Ji{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,n){let r=new Zi(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].possiblyEvaluate(e,t,n);return r}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Yi{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return C(this._values[e].value)}setValue(e,t){this._values[e]=new Wi(this._values[e].property,t===null?void 0:C(t))}serialize(){let e={};for(let t of Object.keys(this._values)){let n=this.getValue(t);n!==void 0&&(e[t]=n)}return e}possiblyEvaluate(e,t,n){let r=new Zi(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].possiblyEvaluate(e,t,n);return r}}class Xi{constructor(e,t,n){this.property=e,this.value=t,this.parameters=n}isConstant(){return this.value.kind===`constant`}constantOr(e){return this.value.kind===`constant`?this.value.value:e}evaluate(e,t,n,r){return this.property.evaluate(this.value,this.parameters,e,t,n,r)}}class Zi{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Qi{constructor(e){this.specification=e}possiblyEvaluate(e,t){if(e.isDataDriven())throw Error(`Value should not be data driven`);return e.expression.evaluate(t)}interpolate(e,t,n){let r=jt[this.specification.type];return r?r(e,t,n):e}}class $i{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,n,r){return new Xi(this,e.expression.kind===`constant`||e.expression.kind===`camera`?{kind:`constant`,value:e.expression.evaluate(t,null,{},n,r)}:e.expression,t)}interpolate(e,t,n){if(e.value.kind!==`constant`||t.value.kind!==`constant`)return e;if(e.value.value===void 0||t.value.value===void 0)return new Xi(this,{kind:`constant`,value:void 0},e.parameters);let r=jt[this.specification.type];if(r){let i=r(e.value.value,t.value.value,n);return new Xi(this,{kind:`constant`,value:i},e.parameters)}return e}evaluate(e,t,n,r,i,a){return e.kind===`constant`?e.value:e.evaluate(t,n,r,i,a)}}class ea extends $i{possiblyEvaluate(e,t,n,r){if(e.value===void 0)return new Xi(this,{kind:`constant`,value:void 0},t);if(e.expression.kind===`constant`){let i=e.expression.evaluate(t,null,{},n,r),a=e.property.specification.type===`resolvedImage`&&typeof i!=`string`?i.name:i,o=this._calculate(a,a,a,t);return new Xi(this,{kind:`constant`,value:o},t)}if(e.expression.kind===`camera`){let n=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new Xi(this,{kind:`constant`,value:n},t)}return new Xi(this,e.expression,t)}evaluate(e,t,n,r,i,a){if(e.kind===`source`){let o=e.evaluate(t,n,r,i,a);return this._calculate(o,o,o,t)}return e.kind===`composite`?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},n,r),e.evaluate({zoom:Math.floor(t.zoom)},n,r),e.evaluate({zoom:Math.floor(t.zoom)+1},n,r),t):e.value}_calculate(e,t,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}}interpolate(e){return e}}class ta{constructor(e){this.specification=e}possiblyEvaluate(e,t,n,r){if(e.value!==void 0){if(e.expression.kind===`constant`){let i=e.expression.evaluate(t,null,{},n,r);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new Ui(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Ui(Math.floor(t.zoom),t)),e.expression.evaluate(new Ui(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}}interpolate(e){return e}}class na{constructor(e){this.specification=e}possiblyEvaluate(e,t,n,r){return!!e.expression.evaluate(t,null,{},n,r)}interpolate(){return!1}}class ra{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let t in e){let n=e[t];n.specification.overridable&&this.overridableProperties.push(t);let r=this.defaultPropertyValues[t]=new Wi(n,void 0),i=this.defaultTransitionablePropertyValues[t]=new Gi(n);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=r.possiblyEvaluate({})}}}Si(`DataDrivenProperty`,$i),Si(`DataConstantProperty`,Qi),Si(`CrossFadedDataDrivenProperty`,ea),Si(`CrossFadedProperty`,ta),Si(`ColorRampProperty`,na);let ia=`-transition`;class aa extends q{constructor(e,t){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!==`custom`&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!==`background`&&(this.source=e.source,this.sourceLayer=e[`source-layer`],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new Yi(t.layout)),t.paint)){this._transitionablePaint=new Ki(t.paint);for(let t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(let t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Zi(t.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e===`visibility`?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t,n={}){t!=null&&this._validate(vi,`layers.${this.id}.layout.${e}`,e,t,n)||(e===`visibility`?this.visibility=t:this._unevaluatedLayout.setValue(e,t))}getPaintProperty(e){return e.endsWith(ia)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t,n={}){if(t!=null&&this._validate(_i,`layers.${this.id}.paint.${e}`,e,t,n))return!1;if(e.endsWith(ia))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{let n=this._transitionablePaint._values[e],r=n.property.specification[`property-type`]===`cross-faded-data-driven`,i=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let o=this._transitionablePaint._values[e].value;return o.isDataDriven()||i||r||this._handleOverridablePaintPropertyUpdate(e,a,o)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,n){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||this.visibility===`none`}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){let e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),S(e,(e,t)=>!(e===void 0||t===`layout`&&!Object.keys(e).length||t===`paint`&&!Object.keys(e).length))}_validate(e,t,n,r,i={}){return(!i||i.validate!==!1)&&yi(this,e.call(mi,{key:t,layerType:this.type,objectKey:n,value:r,styleSpec:J,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let t=this.paint.get(e);if(t instanceof Xi&&sr(t.property.specification)&&(t.value.kind===`source`||t.value.kind===`composite`)&&t.value.isStateDependent)return!0}return!1}}let oa={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class sa{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ca{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw Error(`_refreshViews() must be implemented by each concrete StructArray layout`)}}function la(e,t=1){let n=0,r=0;return{members:e.map(e=>{let i=oa[e.type].BYTES_PER_ELEMENT,a=n=ua(n,Math.max(t,i)),o=e.components||1;return r=Math.max(r,i),n+=i*o,{name:e.name,type:e.type,components:o,offset:a}}),size:ua(n,Math.max(r,t)),alignment:t}}function ua(e,t){return Math.ceil(e/t)*t}class da extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){let r=2*e;return this.int16[r+0]=t,this.int16[r+1]=n,e}}da.prototype.bytesPerElement=4,Si(`StructArrayLayout2i4`,da);class fa extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=3*e;return this.int16[i+0]=t,this.int16[i+1]=n,this.int16[i+2]=r,e}}fa.prototype.bytesPerElement=6,Si(`StructArrayLayout3i6`,fa);class pa extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){let a=4*e;return this.int16[a+0]=t,this.int16[a+1]=n,this.int16[a+2]=r,this.int16[a+3]=i,e}}pa.prototype.bytesPerElement=8,Si(`StructArrayLayout4i8`,pa);class ma extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}emplace(e,t,n,r,i,a,o){let s=6*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e}}ma.prototype.bytesPerElement=12,Si(`StructArrayLayout2i4i12`,ma);class ha extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}emplace(e,t,n,r,i,a,o){let s=4*e,c=8*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.uint8[c+4]=r,this.uint8[c+5]=i,this.uint8[c+6]=a,this.uint8[c+7]=o,e}}ha.prototype.bytesPerElement=8,Si(`StructArrayLayout2i4ub8`,ha);class ga extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){let r=2*e;return this.float32[r+0]=t,this.float32[r+1]=n,e}}ga.prototype.bytesPerElement=8,Si(`StructArrayLayout2f8`,ga);class _a extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a,o,s,c,l){let u=this.length;return this.resize(u+1),this.emplace(u,e,t,n,r,i,a,o,s,c,l)}emplace(e,t,n,r,i,a,o,s,c,l,u){let d=10*e;return this.uint16[d+0]=t,this.uint16[d+1]=n,this.uint16[d+2]=r,this.uint16[d+3]=i,this.uint16[d+4]=a,this.uint16[d+5]=o,this.uint16[d+6]=s,this.uint16[d+7]=c,this.uint16[d+8]=l,this.uint16[d+9]=u,e}}_a.prototype.bytesPerElement=20,Si(`StructArrayLayout10ui20`,_a);class va extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a,o,s,c,l,u,d){let f=this.length;return this.resize(f+1),this.emplace(f,e,t,n,r,i,a,o,s,c,l,u,d)}emplace(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=12*e;return this.int16[p+0]=t,this.int16[p+1]=n,this.int16[p+2]=r,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=c,this.int16[p+8]=l,this.int16[p+9]=u,this.int16[p+10]=d,this.int16[p+11]=f,e}}va.prototype.bytesPerElement=24,Si(`StructArrayLayout4i4ui4i24`,va);class ya extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=3*e;return this.float32[i+0]=t,this.float32[i+1]=n,this.float32[i+2]=r,e}}ya.prototype.bytesPerElement=12,Si(`StructArrayLayout3f12`,ya);class ba extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}ba.prototype.bytesPerElement=4,Si(`StructArrayLayout1ul4`,ba);class xa extends ca{_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(e,t,n,r,i,a,o,s,c){let l=this.length;return this.resize(l+1),this.emplace(l,e,t,n,r,i,a,o,s,c)}emplace(e,t,n,r,i,a,o,s,c,l){let u=10*e,d=5*e;return this.int16[u+0]=t,this.int16[u+1]=n,this.int16[u+2]=r,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[d+3]=s,this.uint16[u+8]=c,this.uint16[u+9]=l,e}}xa.prototype.bytesPerElement=20,Si(`StructArrayLayout6i1ul2ui20`,xa);class Sa extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}emplace(e,t,n,r,i,a,o){let s=6*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e}}Sa.prototype.bytesPerElement=12,Si(`StructArrayLayout2i2i2i12`,Sa);class Ca extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i)}emplace(e,t,n,r,i,a){let o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=n,this.float32[o+2]=r,this.int16[s+6]=i,this.int16[s+7]=a,e}}Ca.prototype.bytesPerElement=16,Si(`StructArrayLayout2f1f2i16`,Ca);class wa extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}emplace(e,t,n,r,i,a,o){let s=16*e,c=4*e,l=8*e;return this.uint8[s+0]=t,this.uint8[s+1]=n,this.float32[c+1]=r,this.float32[c+2]=i,this.int16[l+6]=a,this.int16[l+7]=o,e}}wa.prototype.bytesPerElement=16,Si(`StructArrayLayout2ub2f2i16`,wa);class Ta extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=n,this.uint16[i+2]=r,e}}Ta.prototype.bytesPerElement=6,Si(`StructArrayLayout3ui6`,Ta);class Ea extends ca{_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(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){let _=this.length;return this.resize(_+1),this.emplace(_,e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}emplace(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=24*e,y=12*e,b=48*e;return this.int16[v+0]=t,this.int16[v+1]=n,this.uint16[v+2]=r,this.uint16[v+3]=i,this.uint32[y+2]=a,this.uint32[y+3]=o,this.uint32[y+4]=s,this.uint16[v+10]=c,this.uint16[v+11]=l,this.uint16[v+12]=u,this.float32[y+7]=d,this.float32[y+8]=f,this.uint8[b+36]=p,this.uint8[b+37]=m,this.uint8[b+38]=h,this.uint32[y+10]=g,this.int16[v+22]=_,e}}Ea.prototype.bytesPerElement=48,Si(`StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48`,Ea);class Da extends ca{_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(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D){let O=this.length;return this.resize(O+1),this.emplace(O,e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D)}emplace(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O){let k=32*e,A=16*e;return this.int16[k+0]=t,this.int16[k+1]=n,this.int16[k+2]=r,this.int16[k+3]=i,this.int16[k+4]=a,this.int16[k+5]=o,this.int16[k+6]=s,this.int16[k+7]=c,this.uint16[k+8]=l,this.uint16[k+9]=u,this.uint16[k+10]=d,this.uint16[k+11]=f,this.uint16[k+12]=p,this.uint16[k+13]=m,this.uint16[k+14]=h,this.uint16[k+15]=g,this.uint16[k+16]=_,this.uint16[k+17]=v,this.uint16[k+18]=y,this.uint16[k+19]=b,this.uint16[k+20]=x,this.uint16[k+21]=S,this.uint16[k+22]=C,this.uint32[A+12]=w,this.float32[A+13]=T,this.float32[A+14]=E,this.uint16[k+30]=D,this.uint16[k+31]=O,e}}Da.prototype.bytesPerElement=64,Si(`StructArrayLayout8i15ui1ul2f2ui64`,Da);class Oa extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}Oa.prototype.bytesPerElement=4,Si(`StructArrayLayout1f4`,Oa);class ka extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=3*e;return this.uint16[6*e+0]=t,this.float32[i+1]=n,this.float32[i+2]=r,e}}ka.prototype.bytesPerElement=12,Si(`StructArrayLayout1ui2f12`,ka);class Aa extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=4*e;return this.uint32[2*e+0]=t,this.uint16[i+2]=n,this.uint16[i+3]=r,e}}Aa.prototype.bytesPerElement=8,Si(`StructArrayLayout1ul2ui8`,Aa);class ja extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){let r=2*e;return this.uint16[r+0]=t,this.uint16[r+1]=n,e}}ja.prototype.bytesPerElement=4,Si(`StructArrayLayout2ui4`,ja);class Ma extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}Ma.prototype.bytesPerElement=2,Si(`StructArrayLayout1ui2`,Ma);class Na extends ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){let a=4*e;return this.float32[a+0]=t,this.float32[a+1]=n,this.float32[a+2]=r,this.float32[a+3]=i,e}}Na.prototype.bytesPerElement=16,Si(`StructArrayLayout4f16`,Na);class Pa extends sa{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 a(this.anchorPointX,this.anchorPointY)}}Pa.prototype.size=20;class Fa extends xa{get(e){return new Pa(this,e)}}Si(`CollisionBoxArray`,Fa);class Ia extends sa{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(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Ia.prototype.size=48;class La extends Ea{get(e){return new Ia(this,e)}}Si(`PlacedSymbolArray`,La);class Ra extends sa{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(e){this._structArray.uint32[this._pos4+12]=e}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]}}Ra.prototype.size=64;class za extends Da{get(e){return new Ra(this,e)}}Si(`SymbolInstanceArray`,za);class Ba extends Oa{getoffsetX(e){return this.float32[1*e+0]}}Si(`GlyphOffsetArray`,Ba);class Va extends fa{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Si(`SymbolLineVertexArray`,Va);class Ha extends sa{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]}}Ha.prototype.size=12;class Ua extends ka{get(e){return new Ha(this,e)}}Si(`TextAnchorOffsetArray`,Ua);class Wa extends sa{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]}}Wa.prototype.size=8;class Ga extends Aa{get(e){return new Wa(this,e)}}Si(`FeatureIndexArray`,Ga);class Ka extends da{}class qa extends da{}class Ja extends da{}class Ya extends ma{}class Xa extends ha{}class Za extends ga{}class Qa extends _a{}class $a extends va{}class eo extends ya{}class to extends ba{}class no extends Sa{}class ro extends wa{}class io extends Ta{}class ao extends ja{}let{members:oo}=la([{name:`a_pos`,components:2,type:`Int16`}],4);class so{constructor(e=[]){this.segments=e}prepareSegment(e,t,n,r){let i=this.segments[this.segments.length-1];return e>so.MAX_VERTEX_ARRAY_LENGTH&&T(`Max vertices per segment is ${so.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!i||i.vertexLength+e>so.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==r)&&(i={vertexOffset:t.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},r!==void 0&&(i.sortKey=r),this.segments.push(i)),i}get(){return this.segments}destroy(){for(let e of this.segments)for(let t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,n,r){return new so([{vertexOffset:e,primitiveOffset:t,vertexLength:n,primitiveLength:r,vaos:{},sortKey:0}])}}function co(e,t){return 256*(e=_(Math.floor(e),0,255))+_(Math.floor(t),0,255)}so.MAX_VERTEX_ARRAY_LENGTH=2**16-1,Si(`SegmentVector`,so);let lo=la([{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 uo={exports:{}},fo={exports:{}};fo.exports=function(e,t){var n,r,i,a,o,s,c,l;for(r=e.length-(n=3&e.length),i=t,o=3432918353,s=461845907,l=0;l<r;)c=255&e.charCodeAt(l)|(255&e.charCodeAt(++l))<<8|(255&e.charCodeAt(++l))<<16|(255&e.charCodeAt(++l))<<24,++l,i=27492+(65535&(a=5*(65535&(i=(i^=c=(65535&(c=(c=(65535&c)*o+(((c>>>16)*o&65535)<<16)&4294967295)<<15|c>>>17))*s+(((c>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(c=0,n){case 3:c^=(255&e.charCodeAt(l+2))<<16;case 2:c^=(255&e.charCodeAt(l+1))<<8;case 1:i^=c=(65535&(c=(c=(65535&(c^=255&e.charCodeAt(l)))*o+(((c>>>16)*o&65535)<<16)&4294967295)<<15|c>>>17))*s+(((c>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};var po=fo.exports,mo={exports:{}};mo.exports=function(e,t){for(var n,r=e.length,i=t^r,a=0;r>=4;)n=1540483477*(65535&(n=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(n>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),r-=4,++a;switch(r){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};var ho=po,go=mo.exports;uo.exports=ho,uo.exports.murmur3=ho,uo.exports.murmur2=go;var _o=n(uo.exports);class vo{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,n,r){this.ids.push(yo(e)),this.positions.push(t,n,r)}getPositions(e){if(!this.indexed)throw Error(`Trying to get index, but feature positions are not indexed`);let t=yo(e),n=0,r=this.ids.length-1;for(;n<r;){let e=n+r>>1;this.ids[e]>=t?r=e:n=e+1}let i=[];for(;this.ids[n]===t;)i.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return i}static serialize(e,t){let n=new Float64Array(e.ids),r=new Uint32Array(e.positions);return bo(n,r,0,n.length-1),t&&t.push(n.buffer,r.buffer),{ids:n,positions:r}}static deserialize(e){let t=new vo;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}}function yo(e){let t=+e;return!isNaN(t)&&t<=2**53-1?t:_o(String(e))}function bo(e,t,n,r){for(;n<r;){let i=e[n+r>>1],a=n-1,o=r+1;for(;;){do a++;while(e[a]<i);do o--;while(e[o]>i);if(a>=o)break;xo(e,a,o),xo(t,3*a,3*o),xo(t,3*a+1,3*o+1),xo(t,3*a+2,3*o+2)}o-n<r-o?(bo(e,t,n,o),n=o+1):(bo(e,t,o+1,r),r=o)}}function xo(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}Si(`FeaturePositionMap`,vo);class So{constructor(e,t){this.gl=e.gl,this.location=t}}class Co extends So{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class wo extends So{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class To extends So{constructor(e,t){super(e,t),this.current=Ye.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}let Eo=new Float32Array(16);function Do(e){return[co(255*e.r,255*e.g),co(255*e.b,255*e.a)]}class Oo{constructor(e,t,n){this.value=e,this.uniformNames=t.map(e=>`u_${e}`),this.type=n}setUniform(e,t,n){e.set(n.constantOr(this.value))}getBinding(e,t,n){return this.type===`color`?new To(e,t):new Co(e,t)}}class ko{constructor(e,t){this.uniformNames=t.map(e=>`u_${e}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setUniform(e,t,n,r){let i=r===`u_pattern_to`?this.patternTo:r===`u_pattern_from`?this.patternFrom:r===`u_pixel_ratio_to`?this.pixelRatioTo:r===`u_pixel_ratio_from`?this.pixelRatioFrom:null;i&&e.set(i)}getBinding(e,t,n){return n.substr(0,9)===`u_pattern`?new wo(e,t):new Co(e,t)}}class Ao{constructor(e,t,n,r){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:`Float32`,components:n===`color`?2:1,offset:0})),this.paintVertexArray=new r}populatePaintArray(e,t,n,r,i){let a=this.paintVertexArray.length,o=this.expression.evaluate(new Ui(0),t,{},r,[],i);this.paintVertexArray.resize(e),this._setPaintValue(a,e,o)}updatePaintArray(e,t,n,r){let i=this.expression.evaluate({zoom:0},n,r);this._setPaintValue(e,t,i)}_setPaintValue(e,t,n){if(this.type===`color`){let r=Do(n);for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r[0],r[1])}else{for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class jo{constructor(e,t,n,r,i,a){this.expression=e,this.uniformNames=t.map(e=>`u_${e}_t`),this.type=n,this.useIntegerZoom=r,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:`Float32`,components:n===`color`?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,t,n,r,i){let a=this.expression.evaluate(new Ui(this.zoom),t,{},r,[],i),o=this.expression.evaluate(new Ui(this.zoom+1),t,{},r,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(s,e,a,o)}updatePaintArray(e,t,n,r){let i=this.expression.evaluate({zoom:this.zoom},n,r),a=this.expression.evaluate({zoom:this.zoom+1},n,r);this._setPaintValue(e,t,i,a)}_setPaintValue(e,t,n,r){if(this.type===`color`){let i=Do(n),a=Do(r);for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,i[0],i[1],a[0],a[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,n,r);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){let n=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,r=_(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);e.set(r)}getBinding(e,t,n){return new Co(e,t)}}class Mo{constructor(e,t,n,r,i,a){this.expression=e,this.type=t,this.useIntegerZoom=n,this.zoom=r,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i}populatePaintArray(e,t,n){let r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(r,e,t.patterns&&t.patterns[this.layerId],n)}updatePaintArray(e,t,n,r,i){this._setPaintValues(e,t,n.patterns&&n.patterns[this.layerId],i)}_setPaintValues(e,t,n,r){if(!r||!n)return;let{min:i,mid:a,max:o}=n,s=r[i],c=r[a],l=r[o];if(s&&c&&l)for(let n=e;n<t;n++)this.zoomInPaintVertexArray.emplace(n,c.tl[0],c.tl[1],c.br[0],c.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],c.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(n,c.tl[0],c.tl[1],c.br[0],c.br[1],l.tl[0],l.tl[1],l.br[0],l.br[1],c.pixelRatio,l.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,lo.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,lo.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class No{constructor(e,t,n){this.binders={},this._buffers=[];let r=[];for(let i in e.paint._values){if(!n(i))continue;let a=e.paint.get(i);if(!(a instanceof Xi&&sr(a.property.specification)))continue;let o=Fo(i,e.type),s=a.value,c=a.property.specification.type,l=a.property.useIntegerZoom,u=a.property.specification[`property-type`],d=u===`cross-faded`||u===`cross-faded-data-driven`;if(s.kind===`constant`)this.binders[i]=d?new ko(s.value,o):new Oo(s.value,o,c),r.push(`/u_${i}`);else if(s.kind===`source`||d){let n=Io(i,c,`source`);this.binders[i]=d?new Mo(s,c,l,t,n,e.id):new Ao(s,o,c,n),r.push(`/a_${i}`)}else{let e=Io(i,c,`composite`);this.binders[i]=new jo(s,o,c,l,t,e),r.push(`/z_${i}`)}}this.cacheKey=r.sort().join(``)}getMaxValue(e){let t=this.binders[e];return t instanceof Ao||t instanceof jo?t.maxValue:0}populatePaintArrays(e,t,n,r,i){for(let a in this.binders){let o=this.binders[a];(o instanceof Ao||o instanceof jo||o instanceof Mo)&&o.populatePaintArray(e,t,n,r,i)}}setConstantPatternPositions(e,t){for(let n in this.binders){let r=this.binders[n];r instanceof ko&&r.setConstantPatternPositions(e,t)}}updatePaintArrays(e,t,n,r,i){let a=!1;for(let o in e){let s=t.getPositions(o);for(let t of s){let s=n.feature(t.index);for(let n in this.binders){let c=this.binders[n];(c instanceof Ao||c instanceof jo||c instanceof Mo)&&c.expression.isStateDependent===!0&&(c.expression=r.paint.get(n).value,c.updatePaintArray(t.start,t.end,s,e[o],i),a=!0)}}}return a}defines(){let e=[];for(let t in this.binders){let n=this.binders[t];(n instanceof Oo||n instanceof ko)&&e.push(...n.uniformNames.map(e=>`#define HAS_UNIFORM_${e}`))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let n=this.binders[t];if(n instanceof Ao||n instanceof jo)for(let t=0;t<n.paintVertexAttributes.length;t++)e.push(n.paintVertexAttributes[t].name);else if(n instanceof Mo)for(let t=0;t<lo.members.length;t++)e.push(lo.members[t].name)}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let n=this.binders[t];if(n instanceof Oo||n instanceof ko||n instanceof jo)for(let t of n.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let n=[];for(let r in this.binders){let i=this.binders[r];if(i instanceof Oo||i instanceof ko||i instanceof jo){for(let a of i.uniformNames)if(t[a]){let o=i.getBinding(e,t[a],a);n.push({name:a,property:r,binding:o})}}}return n}setUniforms(e,t,n,r){for(let{name:e,property:i,binding:a}of t)this.binders[i].setUniform(a,r,n.get(i),e)}updatePaintBuffers(e){this._buffers=[];for(let t in this.binders){let n=this.binders[t];if(e&&n instanceof Mo){let t=e.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else (n instanceof Ao||n instanceof jo)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}}upload(e){for(let t in this.binders){let n=this.binders[t];(n instanceof Ao||n instanceof jo||n instanceof Mo)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof Ao||t instanceof jo||t instanceof Mo)&&t.destroy()}}}class Po{constructor(e,t,n=()=>!0){this.programConfigurations={};for(let r of e)this.programConfigurations[r.id]=new No(r,t,n);this.needsUpload=!1,this._featureMap=new vo,this._bufferOffset=0}populatePaintArrays(e,t,n,r,i,a){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(e,t,r,i,a);t.id!==void 0&&this._featureMap.add(t.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,n,r){for(let i of n)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(e,this._featureMap,t,i,r)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Fo(e,t){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`]}[e]||[e.replace(`${t}-`,``).replace(/-/g,`_`)]}function Io(e,t,n){let r={color:{source:ga,composite:Na},number:{source:Oa,composite:ga}},i=function(e){return{"line-pattern":{source:Qa,composite:Qa},"fill-pattern":{source:Qa,composite:Qa},"fill-extrusion-pattern":{source:Qa,composite:Qa}}[e]}(e);return i&&i[n]||r[t][n]}Si(`ConstantBinder`,Oo),Si(`CrossFadedConstantBinder`,ko),Si(`SourceExpressionBinder`,Ao),Si(`CrossFadedCompositeBinder`,Mo),Si(`CompositeExpressionBinder`,jo),Si(`ProgramConfiguration`,No,{omit:[`_buffers`]}),Si(`ProgramConfigurationSet`,Po);let Lo=8192,Ro=2**14-1,zo=-Ro-1;function Bo(e){let t=Lo/e.extent,n=e.loadGeometry();for(let e=0;e<n.length;e++){let r=n[e];for(let e=0;e<r.length;e++){let n=r[e],i=Math.round(n.x*t),a=Math.round(n.y*t);n.x=_(i,zo,Ro),n.y=_(a,zo,Ro),(i<n.x||i>n.x+1||a<n.y||a>n.y+1)&&T(`Geometry exceeds allowed extent, reduce your vector tile buffer size`)}}return n}function Vo(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Bo(e):[]}}function Ho(e,t,n,r,i){e.emplaceBack(2*t+(r+1)/2,2*n+(i+1)/2)}class Uo{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new qa,this.indexArray=new io,this.segments=new so,this.programConfigurations=new Po(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,n){let r=this.layers[0],i=[],a=null,o=!1;r.type===`circle`&&(a=r.layout.get(`circle-sort-key`),o=!a.isConstant());for(let{feature:t,id:r,index:s,sourceLayerIndex:c}of e){let e=this.layers[0]._featureFilter.needGeometry,l=Vo(t,e);if(!this.layers[0]._featureFilter.filter(new Ui(this.zoom),l,n))continue;let u=o?a.evaluate(l,{},n):void 0,d={id:r,properties:t.properties,type:t.type,sourceLayerIndex:c,index:s,geometry:e?l.geometry:Bo(t),patterns:{},sortKey:u};i.push(d)}o&&i.sort((e,t)=>e.sortKey-t.sortKey);for(let r of i){let{geometry:i,index:a,sourceLayerIndex:o}=r,s=e[a].feature;this.addFeature(r,i,a,n),t.featureIndex.insert(s,i,a,o,this.index)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,oo),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,n,r){for(let n of t)for(let t of n){let n=t.x,r=t.y;if(n<0||n>=Lo||r<0||r>=Lo)continue;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=i.vertexLength;Ho(this.layoutVertexArray,n,r,-1,-1),Ho(this.layoutVertexArray,n,r,1,-1),Ho(this.layoutVertexArray,n,r,1,1),Ho(this.layoutVertexArray,n,r,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+3,a+2),i.vertexLength+=4,i.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},r)}}function Wo(e,t){for(let n=0;n<e.length;n++)if($o(t,e[n]))return!0;for(let n=0;n<t.length;n++)if($o(e,t[n]))return!0;return!!Jo(e,t)}function Go(e,t,n){return!!$o(e,t)||!!Xo(t,e,n)}function Ko(e,t){if(e.length===1)return Qo(t,e[0]);for(let n=0;n<t.length;n++){let r=t[n];for(let t=0;t<r.length;t++)if($o(e,r[t]))return!0}for(let n=0;n<e.length;n++)if(Qo(t,e[n]))return!0;for(let n=0;n<t.length;n++)if(Jo(e,t[n]))return!0;return!1}function qo(e,t,n){if(e.length>1){if(Jo(e,t))return!0;for(let r=0;r<t.length;r++)if(Xo(t[r],e,n))return!0}for(let r=0;r<e.length;r++)if(Xo(e[r],t,n))return!0;return!1}function Jo(e,t){if(e.length===0||t.length===0)return!1;for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1];for(let e=0;e<t.length-1;e++)if(Yo(r,i,t[e],t[e+1]))return!0}return!1}function Yo(e,t,n,r){return E(e,n,r)!==E(t,n,r)&&E(e,t,n)!==E(e,t,r)}function Xo(e,t,n){let r=n*n;if(t.length===1)return e.distSqr(t[0])<r;for(let n=1;n<t.length;n++)if(Zo(e,t[n-1],t[n])<r)return!0;return!1}function Zo(e,t,n){let r=t.distSqr(n);if(r===0)return e.distSqr(t);let i=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/r;return e.distSqr(i<0?t:i>1?n:n.sub(t)._mult(i)._add(t))}function Qo(e,t){let n,r,i,a=!1;for(let o=0;o<e.length;o++){n=e[o];for(let e=0,o=n.length-1;e<n.length;o=e++)r=n[e],i=n[o],r.y>t.y!=i.y>t.y&&t.x<(i.x-r.x)*(t.y-r.y)/(i.y-r.y)+r.x&&(a=!a)}return a}function $o(e,t){let n=!1;for(let r=0,i=e.length-1;r<e.length;i=r++){let a=e[r],o=e[i];a.y>t.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(n=!n)}return n}function es(e,t,n){let r=n[0],i=n[2];if(e.x<r.x&&t.x<r.x||e.x>i.x&&t.x>i.x||e.y<r.y&&t.y<r.y||e.y>i.y&&t.y>i.y)return!1;let a=E(e,t,n[0]);return a!==E(e,t,n[1])||a!==E(e,t,n[2])||a!==E(e,t,n[3])}function ts(e,t,n){let r=t.paint.get(e).value;return r.kind===`constant`?r.value:n.programConfigurations.get(t.id).getMaxValue(e)}function ns(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function rs(e,t,n,r,i){if(!t[0]&&!t[1])return e;let o=a.convert(t)._mult(i);n===`viewport`&&o._rotate(-r);let s=[];for(let t=0;t<e.length;t++)s.push(e[t].sub(o));return s}let is,as;Si(`CircleBucket`,Uo,{omit:[`layers`]});var os={get paint(){return as||=new ra({"circle-radius":new $i(J.paint_circle[`circle-radius`]),"circle-color":new $i(J.paint_circle[`circle-color`]),"circle-blur":new $i(J.paint_circle[`circle-blur`]),"circle-opacity":new $i(J.paint_circle[`circle-opacity`]),"circle-translate":new Qi(J.paint_circle[`circle-translate`]),"circle-translate-anchor":new Qi(J.paint_circle[`circle-translate-anchor`]),"circle-pitch-scale":new Qi(J.paint_circle[`circle-pitch-scale`]),"circle-pitch-alignment":new Qi(J.paint_circle[`circle-pitch-alignment`]),"circle-stroke-width":new $i(J.paint_circle[`circle-stroke-width`]),"circle-stroke-color":new $i(J.paint_circle[`circle-stroke-color`]),"circle-stroke-opacity":new $i(J.paint_circle[`circle-stroke-opacity`])})},get layout(){return is||=new ra({"circle-sort-key":new $i(J.layout_circle[`circle-sort-key`])})}},ss=1e-6,cs=typeof Float32Array<`u`?Float32Array:Array;function ls(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function us(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=n[0],b=n[1],x=n[2],S=n[3];return e[0]=y*r+b*s+x*d+S*h,e[1]=y*i+b*c+x*f+S*g,e[2]=y*a+b*l+x*p+S*_,e[3]=y*o+b*u+x*m+S*v,e[4]=(y=n[4])*r+(b=n[5])*s+(x=n[6])*d+(S=n[7])*h,e[5]=y*i+b*c+x*f+S*g,e[6]=y*a+b*l+x*p+S*_,e[7]=y*o+b*u+x*m+S*v,e[8]=(y=n[8])*r+(b=n[9])*s+(x=n[10])*d+(S=n[11])*h,e[9]=y*i+b*c+x*f+S*g,e[10]=y*a+b*l+x*p+S*_,e[11]=y*o+b*u+x*m+S*v,e[12]=(y=n[12])*r+(b=n[13])*s+(x=n[14])*d+(S=n[15])*h,e[13]=y*i+b*c+x*f+S*g,e[14]=y*a+b*l+x*p+S*_,e[15]=y*o+b*u+x*m+S*v,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var ds,fs=us;function ps(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,e}ds=new cs(4),cs!=Float32Array&&(ds[0]=0,ds[1]=0,ds[2]=0,ds[3]=0);class ms extends aa{constructor(e){super(e,os)}createBucket(e){return new Uo(e)}queryRadius(e){let t=e;return ts(`circle-radius`,this,t)+ts(`circle-stroke-width`,this,t)+ns(this.paint.get(`circle-translate`))}queryIntersectsFeature(e,t,n,r,i,a,o,s){let c=rs(e,this.paint.get(`circle-translate`),this.paint.get(`circle-translate-anchor`),a.angle,o),l=this.paint.get(`circle-radius`).evaluate(t,n)+this.paint.get(`circle-stroke-width`).evaluate(t,n),u=this.paint.get(`circle-pitch-alignment`)===`map`,d=u?c:function(e,t){return e.map(e=>hs(e,t))}(c,s),f=u?l*o:l;for(let e of r)for(let t of e){let e=u?t:hs(t,s),n=f,r=ps([],[t.x,t.y,0,1],s);if(this.paint.get(`circle-pitch-scale`)===`viewport`&&this.paint.get(`circle-pitch-alignment`)===`map`?n*=r[3]/a.cameraToCenterDistance:this.paint.get(`circle-pitch-scale`)===`map`&&this.paint.get(`circle-pitch-alignment`)===`viewport`&&(n*=a.cameraToCenterDistance/r[3]),Go(d,e,n))return!0}return!1}}function hs(e,t){let n=ps([],[e.x,e.y,0,1],t);return new a(n[0]/n[3],n[1]/n[3])}class gs extends Uo{}let _s;Si(`HeatmapBucket`,gs,{omit:[`layers`]});var vs={get paint(){return _s||=new ra({"heatmap-radius":new $i(J.paint_heatmap[`heatmap-radius`]),"heatmap-weight":new $i(J.paint_heatmap[`heatmap-weight`]),"heatmap-intensity":new Qi(J.paint_heatmap[`heatmap-intensity`]),"heatmap-color":new na(J.paint_heatmap[`heatmap-color`]),"heatmap-opacity":new Qi(J.paint_heatmap[`heatmap-opacity`])})}};function ys(e,{width:t,height:n},r,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==t*n*r)throw RangeError(`mismatched image size. expected: ${i.length} but got: ${t*n*r}`)}else i=new Uint8Array(t*n*r);return e.width=t,e.height=n,e.data=i,e}function bs(e,{width:t,height:n},r){if(t===e.width&&n===e.height)return;let i=ys({},{width:t,height:n},r);xs(e,i,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,n)},r),e.width=t,e.height=n,e.data=i.data}function xs(e,t,n,r,i,a){if(i.width===0||i.height===0)return t;if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw RangeError(`out of range source coordinates for image copy`);if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw RangeError(`out of range destination coordinates for image copy`);let o=e.data,s=t.data;if(o===s)throw Error(`srcData equals dstData, so image is already copied`);for(let c=0;c<i.height;c++){let l=((n.y+c)*e.width+n.x)*a,u=((r.y+c)*t.width+r.x)*a;for(let e=0;e<i.width*a;e++)s[u+e]=o[l+e]}return t}class Ss{constructor(e,t){ys(this,e,1,t)}resize(e){bs(this,e,1)}clone(){return new Ss({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,n,r,i){xs(e,t,n,r,i,1)}}class Cs{constructor(e,t){ys(this,e,4,t)}resize(e){bs(this,e,4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Cs({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,n,r,i){xs(e,t,n,r,i,4)}}function ws(e){let t={},n=e.resolution||256,r=e.clips?e.clips.length:1,i=e.image||new Cs({width:n,height:r});if(Math.log(n)/Math.LN2%1!=0)throw Error(`width is not a power of 2 - ${n}`);let a=(n,r,a)=>{t[e.evaluationKey]=a;let o=e.expression.evaluate(t);i.data[n+r+0]=Math.floor(255*o.r/o.a),i.data[n+r+1]=Math.floor(255*o.g/o.a),i.data[n+r+2]=Math.floor(255*o.b/o.a),i.data[n+r+3]=Math.floor(255*o.a)};if(e.clips)for(let t=0,i=0;t<r;++t,i+=4*n)for(let r=0,o=0;r<n;r++,o+=4){let s=r/(n-1),{start:c,end:l}=e.clips[t];a(i,o,c*(1-s)+l*s)}else for(let e=0,t=0;e<n;e++,t+=4)a(0,t,e/(n-1));return i}Si(`AlphaImage`,Ss),Si(`RGBAImage`,Cs);let Ts=`big-fb`;class Es extends aa{createBucket(e){return new gs(e)}constructor(e){super(e,vs),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e===`heatmap-color`&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=ws({expression:this._transitionablePaint._values[`heatmap-color`].value.expression,evaluationKey:`heatmapDensity`,image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Ts)&&this.heatmapFbos.delete(Ts)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get(`heatmap-opacity`)!==0&&this.visibility!==`none`}}let Ds;var Os={get paint(){return Ds||=new ra({"hillshade-illumination-direction":new Qi(J.paint_hillshade[`hillshade-illumination-direction`]),"hillshade-illumination-anchor":new Qi(J.paint_hillshade[`hillshade-illumination-anchor`]),"hillshade-exaggeration":new Qi(J.paint_hillshade[`hillshade-exaggeration`]),"hillshade-shadow-color":new Qi(J.paint_hillshade[`hillshade-shadow-color`]),"hillshade-highlight-color":new Qi(J.paint_hillshade[`hillshade-highlight-color`]),"hillshade-accent-color":new Qi(J.paint_hillshade[`hillshade-accent-color`])})}};class ks extends aa{constructor(e){super(e,Os)}hasOffscreenPass(){return this.paint.get(`hillshade-exaggeration`)!==0&&this.visibility!==`none`}}let{members:As}=la([{name:`a_pos`,components:2,type:`Int16`}],4);function js(e,t,n=2){let r=t&&t.length,i=r?t[0]*n:e.length,a=Ms(e,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;let s,c,l;if(r&&(a=function(e,t,n,r){let i=[];for(let n=0,a=t.length;n<a;n++){let o=Ms(e,t[n]*r,n<a-1?t[n+1]*r:e.length,r,!1);o===o.next&&(o.steiner=!0),i.push(Us(o))}i.sort(zs);for(let e=0;e<i.length;e++)n=Bs(i[e],n);return n}(e,t,a,n)),e.length>80*n){s=1/0,c=1/0;let t=-1/0,r=-1/0;for(let a=n;a<i;a+=n){let n=e[a],i=e[a+1];n<s&&(s=n),i<c&&(c=i),n>t&&(t=n),i>r&&(r=i)}l=Math.max(t-s,r-c),l=l===0?0:32767/l}return Ps(a,o,n,s,c,l,0),o}function Ms(e,t,n,r,i){let a;if(i===function(e,t,n,r){let i=0;for(let a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,n,r)>0)for(let i=t;i<n;i+=r)a=$s(i/r|0,e[i],e[i+1],a);else for(let i=n-r;i>=t;i-=r)a=$s(i/r|0,e[i],e[i+1],a);return a&&qs(a,a.next)&&(ec(a),a=a.next),a}function Ns(e,t){if(!e)return e;t||=e;let n,r=e;do if(n=!1,r.steiner||!qs(r,r.next)&&Ks(r.prev,r,r.next)!==0)r=r.next;else{if(ec(r),r=t=r.prev,r===r.next)break;n=!0}while(n||r!==t);return t}function Ps(e,t,n,r,i,a,o){if(!e)return;!o&&a&&function(e,t,n,r){let i=e;do i.z===0&&(i.z=Hs(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n=1;do{let r,i=e;e=null;let a=null;for(t=0;i;){t++;let o=i,s=0;for(let e=0;e<n&&(s++,o=o.nextZ,o);e++);let c=n;for(;s>0||c>0&&o;)s!==0&&(c===0||!o||i.z<=o.z)?(r=i,i=i.nextZ,s--):(r=o,o=o.nextZ,c--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;i=o}a.nextZ=null,n*=2}while(t>1)}(i)}(e,r,i,a);let s=e;for(;e.prev!==e.next;){let c=e.prev,l=e.next;if(a?Is(e,r,i,a):Fs(e))t.push(c.i,e.i,l.i),ec(e),e=l.next,s=l.next;else if((e=l)===s){o?o===1?Ps(e=Ls(Ns(e),t),t,n,r,i,a,2):o===2&&Rs(e,t,n,r,i,a):Ps(Ns(e),t,n,r,i,a,1);break}}}function Fs(e){let t=e.prev,n=e,r=e.next;if(Ks(t,n,r)>=0)return!1;let i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=i<a?i<o?i:o:a<o?a:o,d=s<c?s<l?s:l:c<l?c:l,f=i>a?i>o?i:o:a>o?a:o,p=s>c?s>l?s:l:c>l?c:l,m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&Ws(i,s,a,c,o,l,m.x,m.y)&&Ks(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Is(e,t,n,r){let i=e.prev,a=e,o=e.next;if(Ks(i,a,o)>=0)return!1;let s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=s<c?s<l?s:l:c<l?c:l,m=u<d?u<f?u:f:d<f?d:f,h=s>c?s>l?s:l:c>l?c:l,g=u>d?u>f?u:f:d>f?d:f,_=Hs(p,m,t,n,r),v=Hs(h,g,t,n,r),y=e.prevZ,b=e.nextZ;for(;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&Ws(s,u,c,d,l,f,y.x,y.y)&&Ks(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&Ws(s,u,c,d,l,f,b.x,b.y)&&Ks(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&Ws(s,u,c,d,l,f,y.x,y.y)&&Ks(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&Ws(s,u,c,d,l,f,b.x,b.y)&&Ks(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Ls(e,t){let n=e;do{let r=n.prev,i=n.next.next;!qs(r,i)&&Js(r,n,n.next,i)&&Zs(r,i)&&Zs(i,r)&&(t.push(r.i,n.i,i.i),ec(n),ec(n.next),n=e=i),n=n.next}while(n!==e);return Ns(n)}function Rs(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&Gs(o,e)){let s=Qs(o,e);o=Ns(o,o.next),s=Ns(s,s.next),Ps(o,t,n,r,i,a,0),Ps(s,t,n,r,i,a,0);return}e=e.next}o=o.next}while(o!==e)}function zs(e,t){return e.x-t.x}function Bs(e,t){let n=function(e,t){let n=t,r=e.x,i=e.y,a,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>o&&(o=e,a=n.x<n.next.x?n:n.next,e===r))return a}n=n.next}while(n!==t);if(!a)return null;let s=a,c=a.x,l=a.y,u=1/0;n=a;do{if(r>=n.x&&n.x>=c&&r!==n.x&&Ws(i<l?r:o,i,c,l,i<l?o:r,i,n.x,n.y)){let t=Math.abs(i-n.y)/(r-n.x);Zs(n,e)&&(t<u||t===u&&(n.x>a.x||n.x===a.x&&Vs(a,n)))&&(a=n,u=t)}n=n.next}while(n!==s);return a}(e,t);if(!n)return t;let r=Qs(n,e);return Ns(r,r.next),Ns(n,n.next)}function Vs(e,t){return Ks(e.prev,e,t.prev)<0&&Ks(t.next,e,e.next)<0}function Hs(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Us(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function Ws(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function Gs(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Js(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Zs(e,t)&&Zs(t,e)&&function(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}(e,t)&&(Ks(e.prev,e,t.prev)||Ks(e,t.prev,t))||qs(e,t)&&Ks(e.prev,e,e.next)>0&&Ks(t.prev,t,t.next)>0)}function Ks(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function qs(e,t){return e.x===t.x&&e.y===t.y}function Js(e,t,n,r){let i=Xs(Ks(e,t,n)),a=Xs(Ks(e,t,r)),o=Xs(Ks(n,r,e)),s=Xs(Ks(n,r,t));return i!==a&&o!==s||!(i!==0||!Ys(e,n,t))||!(a!==0||!Ys(e,r,t))||!(o!==0||!Ys(n,e,r))||!(s!==0||!Ys(n,t,r))}function Ys(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Xs(e){return e>0?1:e<0?-1:0}function Zs(e,t){return Ks(e.prev,e,e.next)<0?Ks(e,t,e.next)>=0&&Ks(e,e.prev,t)>=0:Ks(e,t,e.prev)<0||Ks(e,e.next,t)<0}function Qs(e,t){let n=tc(e.i,e.x,e.y),r=tc(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function $s(e,t,n,r){let i=tc(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ec(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function tc(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function nc(e,t,n){let r=n.patternDependencies,i=!1;for(let n of t){let t=n.paint.get(`${e}-pattern`);t.isConstant()||(i=!0);let a=t.constantOr(null);a&&(i=!0,r[a.to]=!0,r[a.from]=!0)}return i}function rc(e,t,n,r,i){let a=i.patternDependencies;for(let o of t){let t=o.paint.get(`${e}-pattern`).value;if(t.kind!==`constant`){let e=t.evaluate({zoom:r-1},n,{},i.availableImages),s=t.evaluate({zoom:r},n,{},i.availableImages),c=t.evaluate({zoom:r+1},n,{},i.availableImages);e=e&&e.name?e.name:e,s=s&&s.name?s.name:s,c=c&&c.name?c.name:c,a[e]=!0,a[s]=!0,a[c]=!0,n.patterns[o.id]={min:e,mid:s,max:c}}}return n}class ic{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ja,this.indexArray=new io,this.indexArray2=new ao,this.programConfigurations=new Po(e.layers,e.zoom),this.segments=new so,this.segments2=new so,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,n){this.hasPattern=nc(`fill`,this.layers,t);let r=this.layers[0].layout.get(`fill-sort-key`),i=!r.isConstant(),a=[];for(let{feature:o,id:s,index:c,sourceLayerIndex:l}of e){let e=this.layers[0]._featureFilter.needGeometry,u=Vo(o,e);if(!this.layers[0]._featureFilter.filter(new Ui(this.zoom),u,n))continue;let d=i?r.evaluate(u,{},n,t.availableImages):void 0,f={id:s,properties:o.properties,type:o.type,sourceLayerIndex:l,index:c,geometry:e?u.geometry:Bo(o),patterns:{},sortKey:d};a.push(f)}i&&a.sort((e,t)=>e.sortKey-t.sortKey);for(let r of a){let{geometry:i,index:a,sourceLayerIndex:o}=r;if(this.hasPattern){let e=rc(`fill`,this.layers,r,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(r,i,a,n,{});t.featureIndex.insert(e[a].feature,i,a,o,this.index)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)}addFeatures(e,t,n){for(let e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,As),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),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(e,t,n,r,i){for(let e of bn(t,500)){let t=0;for(let n of e)t+=n.length;let n=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),r=n.vertexLength,i=[],a=[];for(let t of e){if(t.length===0)continue;t!==e[0]&&a.push(i.length/2);let n=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),r=n.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(r+t.length-1,r),i.push(t[0].x),i.push(t[0].y);for(let e=1;e<t.length;e++)this.layoutVertexArray.emplaceBack(t[e].x,t[e].y),this.indexArray2.emplaceBack(r+e-1,r+e),i.push(t[e].x),i.push(t[e].y);n.vertexLength+=t.length,n.primitiveLength+=t.length}let o=js(i,a);for(let e=0;e<o.length;e+=3)this.indexArray.emplaceBack(r+o[e],r+o[e+1],r+o[e+2]);n.vertexLength+=t,n.primitiveLength+=o.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,i,r)}}let ac,oc;Si(`FillBucket`,ic,{omit:[`layers`,`patternFeatures`]});var sc={get paint(){return oc||=new ra({"fill-antialias":new Qi(J.paint_fill[`fill-antialias`]),"fill-opacity":new $i(J.paint_fill[`fill-opacity`]),"fill-color":new $i(J.paint_fill[`fill-color`]),"fill-outline-color":new $i(J.paint_fill[`fill-outline-color`]),"fill-translate":new Qi(J.paint_fill[`fill-translate`]),"fill-translate-anchor":new Qi(J.paint_fill[`fill-translate-anchor`]),"fill-pattern":new ea(J.paint_fill[`fill-pattern`])})},get layout(){return ac||=new ra({"fill-sort-key":new $i(J.layout_fill[`fill-sort-key`])})}};class cc extends aa{constructor(e){super(e,sc)}recalculate(e,t){super.recalculate(e,t);let n=this.paint._values[`fill-outline-color`];n.value.kind===`constant`&&n.value.value===void 0&&(this.paint._values[`fill-outline-color`]=this.paint._values[`fill-color`])}createBucket(e){return new ic(e)}queryRadius(){return ns(this.paint.get(`fill-translate`))}queryIntersectsFeature(e,t,n,r,i,a,o){return Ko(rs(e,this.paint.get(`fill-translate`),this.paint.get(`fill-translate-anchor`),a.angle,o),r)}isTileClipped(){return!0}}let lc=la([{name:`a_pos`,components:2,type:`Int16`},{name:`a_normal_ed`,components:4,type:`Int16`}],4),uc=la([{name:`a_centroid`,components:2,type:`Int16`}],4),{members:dc}=lc;var fc={},pc=r,mc=hc;function hc(e,t,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=i,e.readFields(gc,this,t)}function gc(e,t,n){e==1?t.id=n.readVarint():e==2?function(e,t){for(var n=e.readVarint()+e.pos;e.pos<n;){var r=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[r]=i}}(n,t):e==3?t.type=n.readVarint():e==4&&(t._geometry=n.pos)}function _c(e){for(var t,n,r=0,i=0,a=e.length,o=a-1;i<a;o=i++)r+=((n=e[o]).x-(t=e[i]).x)*(t.y+n.y);return r}hc.types=[`Unknown`,`Point`,`LineString`,`Polygon`],hc.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,n=e.readVarint()+e.pos,r=1,i=0,a=0,o=0,s=[];e.pos<n;){if(i<=0){var c=e.readVarint();r=7&c,i=c>>3}if(i--,r===1||r===2)a+=e.readSVarint(),o+=e.readSVarint(),r===1&&(t&&s.push(t),t=[]),t.push(new pc(a,o));else{if(r!==7)throw Error(`unknown command `+r);t&&t.push(t[0].clone())}}return t&&s.push(t),s},hc.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,n=1,r=0,i=0,a=0,o=1/0,s=-1/0,c=1/0,l=-1/0;e.pos<t;){if(r<=0){var u=e.readVarint();n=7&u,r=u>>3}if(r--,n===1||n===2)(i+=e.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=e.readSVarint())<c&&(c=a),a>l&&(l=a);else if(n!==7)throw Error(`unknown command `+n)}return[o,c,s,l]},hc.prototype.toGeoJSON=function(e,t,n){var r,i,a=this.extent*2**n,o=this.extent*e,s=this.extent*t,c=this.loadGeometry(),l=hc.types[this.type];function u(e){for(var t=0;t<e.length;t++){var n=e[t];e[t]=[360*(n.x+o)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(n.y+s)/a)*Math.PI/180))-90]}}switch(this.type){case 1:var d=[];for(r=0;r<c.length;r++)d[r]=c[r][0];u(c=d);break;case 2:for(r=0;r<c.length;r++)u(c[r]);break;case 3:for(c=function(e){var t=e.length;if(t<=1)return[e];for(var n,r,i=[],a=0;a<t;a++){var o=_c(e[a]);o!==0&&(r===void 0&&(r=o<0),r===o<0?(n&&i.push(n),n=[e[a]]):n.push(e[a]))}return n&&i.push(n),i}(c),r=0;r<c.length;r++)for(i=0;i<c[r].length;i++)u(c[r][i])}c.length===1?c=c[0]:l=`Multi`+l;var f={type:`Feature`,geometry:{type:l,coordinates:c},properties:this.properties};return`id`in this&&(f.id=this.id),f};var vc=mc,yc=bc;function bc(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(xc,this,t),this.length=this._features.length}function xc(e,t,n){e===15?t.version=n.readVarint():e===1?t.name=n.readString():e===5?t.extent=n.readVarint():e===2?t._features.push(n.pos):e===3?t._keys.push(n.readString()):e===4&&t._values.push(function(e){for(var t=null,n=e.readVarint()+e.pos;e.pos<n;){var r=e.readVarint()>>3;t=r===1?e.readString():r===2?e.readFloat():r===3?e.readDouble():r===4?e.readVarint64():r===5?e.readVarint():r===6?e.readSVarint():r===7?e.readBoolean():null}return t}(n))}bc.prototype.feature=function(e){if(e<0||e>=this._features.length)throw Error(`feature index out of bounds`);this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new vc(this._pbf,t,this.extent,this._keys,this._values)};var Sc=yc;function Cc(e,t,n){if(e===3){var r=new Sc(n,n.readVarint()+n.pos);r.length&&(t[r.name]=r)}}fc.VectorTile=function(e,t){this.layers=e.readFields(Cc,{},t)},fc.VectorTileFeature=mc,fc.VectorTileLayer=yc;let wc=fc.VectorTileFeature.types,Tc=2**13;function Ec(e,t,n,r,i,a,o,s){e.emplaceBack(t,n,2*Math.floor(r*Tc)+o,i*Tc*2,a*Tc*2,Math.round(s))}class Dc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Ya,this.centroidVertexArray=new Ka,this.indexArray=new io,this.programConfigurations=new Po(e.layers,e.zoom),this.segments=new so,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,n){this.features=[],this.hasPattern=nc(`fill-extrusion`,this.layers,t);for(let{feature:r,id:i,index:a,sourceLayerIndex:o}of e){let e=this.layers[0]._featureFilter.needGeometry,s=Vo(r,e);if(!this.layers[0]._featureFilter.filter(new Ui(this.zoom),s,n))continue;let c={id:i,sourceLayerIndex:o,index:a,geometry:e?s.geometry:Bo(r),properties:r.properties,type:r.type,patterns:{}};this.hasPattern?this.features.push(rc(`fill-extrusion`,this.layers,c,this.zoom,t)):this.addFeature(c,c.geometry,a,n,{}),t.featureIndex.insert(r,c.geometry,a,o,this.index,!0)}}addFeatures(e,t,n){for(let e of this.features){let{geometry:r}=e;this.addFeature(e,r,e.index,t,n)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,dc),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,uc.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,n,r,i){for(let n of bn(t,500)){let t={x:0,y:0,vertexCount:0},r=0;for(let e of n)r+=e.length;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let e of n){if(e.length===0||kc(e))continue;let n=0;for(let r=0;r<e.length;r++){let a=e[r];if(r>=1){let o=e[r-1];if(!Oc(a,o)){i.vertexLength+4>so.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let e=a.sub(o)._perp()._unit(),r=o.dist(a);n+r>32768&&(n=0),Ec(this.layoutVertexArray,a.x,a.y,e.x,e.y,0,0,n),Ec(this.layoutVertexArray,a.x,a.y,e.x,e.y,0,1,n),t.x+=2*a.x,t.y+=2*a.y,t.vertexCount+=2,n+=r,Ec(this.layoutVertexArray,o.x,o.y,e.x,e.y,0,0,n),Ec(this.layoutVertexArray,o.x,o.y,e.x,e.y,0,1,n),t.x+=2*o.x,t.y+=2*o.y,t.vertexCount+=2;let s=i.vertexLength;this.indexArray.emplaceBack(s,s+2,s+1),this.indexArray.emplaceBack(s+1,s+2,s+3),i.vertexLength+=4,i.primitiveLength+=2}}}}if(i.vertexLength+r>so.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(r,this.layoutVertexArray,this.indexArray)),wc[e.type]!==`Polygon`)continue;let a=[],o=[],s=i.vertexLength;for(let e of n)if(e.length!==0){e!==n[0]&&o.push(a.length/2);for(let n=0;n<e.length;n++){let r=e[n];Ec(this.layoutVertexArray,r.x,r.y,0,0,1,1,0),t.x+=r.x,t.y+=r.y,t.vertexCount+=1,a.push(r.x),a.push(r.y)}}let c=js(a,o);for(let e=0;e<c.length;e+=3)this.indexArray.emplaceBack(s+c[e],s+c[e+2],s+c[e+1]);i.primitiveLength+=c.length/3,i.vertexLength+=r;for(let e=0;e<t.vertexCount;e++){let e=Math.floor(t.x/t.vertexCount),n=Math.floor(t.y/t.vertexCount);this.centroidVertexArray.emplaceBack(e,n)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,i,r)}}function Oc(e,t){return e.x===t.x&&(e.x<0||e.x>Lo)||e.y===t.y&&(e.y<0||e.y>Lo)}function kc(e){return e.every(e=>e.x<0)||e.every(e=>e.x>Lo)||e.every(e=>e.y<0)||e.every(e=>e.y>Lo)}let Ac;Si(`FillExtrusionBucket`,Dc,{omit:[`layers`,`features`]});var jc={get paint(){return Ac||=new ra({"fill-extrusion-opacity":new Qi(J[`paint_fill-extrusion`][`fill-extrusion-opacity`]),"fill-extrusion-color":new $i(J[`paint_fill-extrusion`][`fill-extrusion-color`]),"fill-extrusion-translate":new Qi(J[`paint_fill-extrusion`][`fill-extrusion-translate`]),"fill-extrusion-translate-anchor":new Qi(J[`paint_fill-extrusion`][`fill-extrusion-translate-anchor`]),"fill-extrusion-pattern":new ea(J[`paint_fill-extrusion`][`fill-extrusion-pattern`]),"fill-extrusion-height":new $i(J[`paint_fill-extrusion`][`fill-extrusion-height`]),"fill-extrusion-base":new $i(J[`paint_fill-extrusion`][`fill-extrusion-base`]),"fill-extrusion-vertical-gradient":new Qi(J[`paint_fill-extrusion`][`fill-extrusion-vertical-gradient`])})}};class Mc extends aa{constructor(e){super(e,jc)}createBucket(e){return new Dc(e)}queryRadius(){return ns(this.paint.get(`fill-extrusion-translate`))}is3D(){return!0}queryIntersectsFeature(e,t,n,r,i,o,s,c){let l=rs(e,this.paint.get(`fill-extrusion-translate`),this.paint.get(`fill-extrusion-translate-anchor`),o.angle,s),u=this.paint.get(`fill-extrusion-height`).evaluate(t,n),d=this.paint.get(`fill-extrusion-base`).evaluate(t,n),f=function(e,t,n,r){let i=[];for(let n of e){let e=[n.x,n.y,0,1];ps(e,e,t),i.push(new a(e[0]/e[3],e[1]/e[3]))}return i}(l,c),p=function(e,t,n,r){let i=[],o=[],s=r[8]*t,c=r[9]*t,l=r[10]*t,u=r[11]*t,d=r[8]*n,f=r[9]*n,p=r[10]*n,m=r[11]*n;for(let t of e){let e=[],n=[];for(let i of t){let t=i.x,o=i.y,h=r[0]*t+r[4]*o+r[12],g=r[1]*t+r[5]*o+r[13],_=r[2]*t+r[6]*o+r[14],v=r[3]*t+r[7]*o+r[15],y=_+l,b=v+u,x=h+d,S=g+f,C=_+p,w=v+m,T=new a((h+s)/b,(g+c)/b);T.z=y/b,e.push(T);let E=new a(x/w,S/w);E.z=C/w,n.push(E)}i.push(e),o.push(n)}return[i,o]}(r,d,u,c);return function(e,t,n){let r=1/0;Ko(n,t)&&(r=Pc(n,t[0]));for(let i=0;i<t.length;i++){let a=t[i],o=e[i];for(let e=0;e<a.length-1;e++){let t=a[e],i=[t,a[e+1],o[e+1],o[e],t];Wo(n,i)&&(r=Math.min(r,Pc(n,i)))}}return r!==1/0&&r}(p[0],p[1],f)}}function Nc(e,t){return e.x*t.x+e.y*t.y}function Pc(e,t){if(e.length===1){let n=0,r=t[n++],i;for(;!i||r.equals(i);)if(i=t[n++],!i)return 1/0;for(;n<t.length;n++){let a=t[n],o=e[0],s=i.sub(r),c=a.sub(r),l=o.sub(r),u=Nc(s,s),d=Nc(s,c),f=Nc(c,c),p=Nc(l,s),m=Nc(l,c),h=u*f-d*d,g=(f*p-d*m)/h,_=(u*m-d*p)/h,v=r.z*(1-g-_)+i.z*g+a.z*_;if(isFinite(v))return v}return 1/0}{let e=1/0;for(let n of t)e=Math.min(e,n.z);return e}}let{members:Fc}=la([{name:`a_pos_normal`,components:2,type:`Int16`},{name:`a_data`,components:4,type:`Uint8`}],4),{members:Ic}=la([{name:`a_uv_x`,components:1,type:`Float32`},{name:`a_split_index`,components:1,type:`Float32`}]),Lc=fc.VectorTileFeature.types,Rc=Math.cos(Math.PI/180*37.5),zc=2**14/.5;class Bc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(e=>{this.gradients[e.id]={}}),this.layoutVertexArray=new Xa,this.layoutVertexArray2=new Za,this.indexArray=new io,this.programConfigurations=new Po(e.layers,e.zoom),this.segments=new so,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,n){this.hasPattern=nc(`line`,this.layers,t);let r=this.layers[0].layout.get(`line-sort-key`),i=!r.isConstant(),a=[];for(let{feature:t,id:o,index:s,sourceLayerIndex:c}of e){let e=this.layers[0]._featureFilter.needGeometry,l=Vo(t,e);if(!this.layers[0]._featureFilter.filter(new Ui(this.zoom),l,n))continue;let u=i?r.evaluate(l,{},n):void 0,d={id:o,properties:t.properties,type:t.type,sourceLayerIndex:c,index:s,geometry:e?l.geometry:Bo(t),patterns:{},sortKey:u};a.push(d)}i&&a.sort((e,t)=>e.sortKey-t.sortKey);for(let r of a){let{geometry:i,index:a,sourceLayerIndex:o}=r;if(this.hasPattern){let e=rc(`line`,this.layers,r,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(r,i,a,n,{});t.featureIndex.insert(e[a].feature,i,a,o,this.index)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)}addFeatures(e,t,n){for(let e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Ic)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Fc),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,`mapbox_clip_start`)&&Object.prototype.hasOwnProperty.call(e.properties,`mapbox_clip_end`))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,n,r,i){let a=this.layers[0].layout,o=a.get(`line-join`).evaluate(e,{}),s=a.get(`line-cap`),c=a.get(`line-miter-limit`),l=a.get(`line-round-limit`);this.lineClips=this.lineFeatureClips(e);for(let n of t)this.addLine(n,e,o,s,c,l);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,i,r)}addLine(e,t,n,r,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let o=Lc[t.type]===`Polygon`,s=e.length;for(;s>=2&&e[s-1].equals(e[s-2]);)s--;let c=0;for(;c<s-1&&e[c].equals(e[c+1]);)c++;if(s<(o?3:2))return;n===`bevel`&&(i=1.05);let l=this.overscaling<=16?15*Lo/(512*this.overscaling):0,u=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray),d,f,p,m,h;this.e1=this.e2=-1,o&&(d=e[s-2],h=e[c].sub(d)._unit()._perp());for(let t=c;t<s;t++){if(p=t===s-1?o?e[c+1]:void 0:e[t+1],p&&e[t].equals(p))continue;h&&(m=h),d&&(f=d),d=e[t],h=p?p.sub(d)._unit()._perp():m,m||=h;let g=m.add(h);g.x===0&&g.y===0||g._unit();let _=m.x*h.x+m.y*h.y,v=g.x*h.x+g.y*h.y,y=v===0?1/0:1/v,b=2*Math.sqrt(2-2*v),x=v<Rc&&f&&p,S=m.x*h.y-m.y*h.x>0;if(x&&t>c){let e=d.dist(f);if(e>2*l){let t=d.sub(d.sub(f)._mult(l/e)._round());this.updateDistance(f,t),this.addCurrentVertex(t,m,0,0,u),f=t}}let C=f&&p,w=C?n:o?`butt`:r;if(C&&w===`round`&&(y<a?w=`miter`:y<=2&&(w=`fakeround`)),w===`miter`&&y>i&&(w=`bevel`),w===`bevel`&&(y>2&&(w=`flipbevel`),y<i&&(w=`miter`)),f&&this.updateDistance(f,d),w===`miter`)g._mult(y),this.addCurrentVertex(d,g,0,0,u);else if(w===`flipbevel`){if(y>100)g=h.mult(-1);else{let e=y*m.add(h).mag()/m.sub(h).mag();g._perp()._mult(e*(S?-1:1))}this.addCurrentVertex(d,g,0,0,u),this.addCurrentVertex(d,g.mult(-1),0,0,u)}else if(w===`bevel`||w===`fakeround`){let e=-Math.sqrt(y*y-1),t=S?e:0,n=S?0:e;if(f&&this.addCurrentVertex(d,m,t,n,u),w===`fakeround`){let e=Math.round(180*b/Math.PI/20);for(let t=1;t<e;t++){let n=t/e;if(n!==.5){let e=n-.5;n+=n*e*(n-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*e*e+(.848013+_*(.215638*_-1.06021)))}let r=h.sub(m)._mult(n)._add(m)._unit()._mult(S?-1:1);this.addHalfVertex(d,r.x,r.y,!1,S,0,u)}}p&&this.addCurrentVertex(d,h,-t,-n,u)}else if(w===`butt`)this.addCurrentVertex(d,g,0,0,u);else if(w===`square`){let e=f?1:-1;this.addCurrentVertex(d,g,e,e,u)}else w===`round`&&(f&&(this.addCurrentVertex(d,m,0,0,u),this.addCurrentVertex(d,m,1,1,u,!0)),p&&(this.addCurrentVertex(d,h,-1,-1,u,!0),this.addCurrentVertex(d,h,0,0,u)));if(x&&t<s-1){let e=d.dist(p);if(e>2*l){let t=d.add(p.sub(d)._mult(l/e)._round());this.updateDistance(d,t),this.addCurrentVertex(t,h,0,0,u),d=t}}}}addCurrentVertex(e,t,n,r,i,a=!1){let o=t.y*r-t.x,s=-t.y-t.x*r;this.addHalfVertex(e,t.x+t.y*n,t.y-t.x*n,a,!1,n,i),this.addHalfVertex(e,o,s,a,!0,-r,i),this.distance>zc/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,n,r,i,a))}addHalfVertex({x:e,y:t},n,r,i,a,o,s){let c=.5*(this.lineClips?this.scaledDistance*(zc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(i?1:0),(t<<1)+(a?1:0),Math.round(63*n)+128,Math.round(63*r)+128,1+(o===0?0:o<0?-1:1)|(63&c)<<2,c>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let l=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),s.primitiveLength++),a?this.e2=l:this.e1=l}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}let Vc,Hc;Si(`LineBucket`,Bc,{omit:[`layers`,`patternFeatures`]});var Uc={get paint(){return Hc||=new ra({"line-opacity":new $i(J.paint_line[`line-opacity`]),"line-color":new $i(J.paint_line[`line-color`]),"line-translate":new Qi(J.paint_line[`line-translate`]),"line-translate-anchor":new Qi(J.paint_line[`line-translate-anchor`]),"line-width":new $i(J.paint_line[`line-width`]),"line-gap-width":new $i(J.paint_line[`line-gap-width`]),"line-offset":new $i(J.paint_line[`line-offset`]),"line-blur":new $i(J.paint_line[`line-blur`]),"line-dasharray":new ta(J.paint_line[`line-dasharray`]),"line-pattern":new ea(J.paint_line[`line-pattern`]),"line-gradient":new na(J.paint_line[`line-gradient`])})},get layout(){return Vc||=new ra({"line-cap":new Qi(J.layout_line[`line-cap`]),"line-join":new $i(J.layout_line[`line-join`]),"line-miter-limit":new Qi(J.layout_line[`line-miter-limit`]),"line-round-limit":new Qi(J.layout_line[`line-round-limit`]),"line-sort-key":new $i(J.layout_line[`line-sort-key`])})}};class Wc extends $i{possiblyEvaluate(e,t){return t=new Ui(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,n,r){return t=y({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,n,r)}}let Gc;class Kc extends aa{constructor(e){super(e,Uc),this.gradientVersion=0,Gc||(Gc=new Wc(Uc.paint.properties[`line-width`].specification),Gc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e===`line-gradient`){let e=this.gradientExpression();this.stepInterpolant=!!function(e){return e._styleExpression!==void 0}(e)&&e._styleExpression.expression instanceof wt,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values[`line-gradient`].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values[`line-floorwidth`]=Gc.possiblyEvaluate(this._transitioningPaint._values[`line-width`].value,e)}createBucket(e){return new Bc(e)}queryRadius(e){let t=e,n=qc(ts(`line-width`,this,t),ts(`line-gap-width`,this,t)),r=ts(`line-offset`,this,t);return n/2+Math.abs(r)+ns(this.paint.get(`line-translate`))}queryIntersectsFeature(e,t,n,r,i,o,s){let c=rs(e,this.paint.get(`line-translate`),this.paint.get(`line-translate-anchor`),o.angle,s),l=s/2*qc(this.paint.get(`line-width`).evaluate(t,n),this.paint.get(`line-gap-width`).evaluate(t,n)),u=this.paint.get(`line-offset`).evaluate(t,n);return u&&(r=function(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=[];for(let e=0;e<i.length;e++){let n=i[e-1],r=i[e],s=i[e+1],c=e===0?new a(0,0):r.sub(n)._unit()._perp(),l=e===i.length-1?new a(0,0):s.sub(r)._unit()._perp(),u=c._add(l)._unit(),d=u.x*l.x+u.y*l.y;d!==0&&u._mult(1/d),o.push(u._mult(t)._add(r))}n.push(o)}return n}(r,u*s)),function(e,t,n){for(let r=0;r<t.length;r++){let i=t[r];if(e.length>=3){for(let t=0;t<i.length;t++)if($o(e,i[t]))return!0}if(qo(e,i,n))return!0}return!1}(c,r,l)}isTileClipped(){return!0}}function qc(e,t){return t>0?t+2*e:e}let Jc=la([{name:`a_pos_offset`,components:4,type:`Int16`},{name:`a_data`,components:4,type:`Uint16`},{name:`a_pixeloffset`,components:4,type:`Int16`}],4),Yc=la([{name:`a_projected_pos`,components:3,type:`Float32`}],4);la([{name:`a_fade_opacity`,components:1,type:`Uint32`}],4);let Xc=la([{name:`a_placed`,components:2,type:`Uint8`},{name:`a_shift`,components:2,type:`Float32`},{name:`a_box_real`,components:2,type:`Int16`}]);la([{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 Zc=la([{name:`a_pos`,components:2,type:`Int16`},{name:`a_anchor_pos`,components:2,type:`Int16`},{name:`a_extrude`,components:2,type:`Int16`}],4),Qc=la([{name:`a_pos`,components:2,type:`Float32`},{name:`a_radius`,components:1,type:`Float32`},{name:`a_flags`,components:2,type:`Int16`}],4);function $c(e,t,n){return e.sections.forEach(e=>{e.text=function(e,t,n){let r=t.layout.get(`text-transform`).evaluate(n,{});return r===`uppercase`?e=e.toLocaleUpperCase():r===`lowercase`&&(e=e.toLocaleLowerCase()),Hi.applyArabicShaping&&(e=Hi.applyArabicShaping(e)),e}(e.text,t,n)}),e}la([{name:`triangle`,components:3,type:`Uint16`}]),la([{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`}]),la([{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`}]),la([{type:`Float32`,name:`offsetX`}]),la([{type:`Int16`,name:`x`},{type:`Int16`,name:`y`},{type:`Int16`,name:`tileUnitDistanceFromAnchor`}]),la([{type:`Uint16`,name:`textAnchor`},{type:`Float32`,components:2,name:`textOffset`}]);let el={"!":`︕`,"#":``,$:``,"%":``,"&":``,"(":`︵`,")":`︶`,"*":``,"+":``,",":`︐`,"-":`︲`,".":`・`,"/":``,":":`︓`,";":`︔`,"<":`︿`,"=":``,">":`﹀`,"?":`︖`,"@":``,"[":`﹇`,"\\":``,"]":`﹈`,"^":``,_:`︳`,"`":``,"{":`︷`,"|":`―`,"}":`︸`,"~":``,"¢":`¢`,"£":`£`,"¥":`¥`,"¦":`¦`,"¬":`¬`,"¯":` ̄`,"":`︲`,"—":`︱`,"":`﹃`,"":`﹄`,"“":`﹁`,"”":`﹂`,"…":`︙`,"‧":`・`,"₩":`₩`,"、":`︑`,"。":`︒`,"〈":`︿`,"〉":`﹀`,"《":`︽`,"》":`︾`,"「":`﹁`,"」":`﹂`,"『":`﹃`,"』":`﹄`,"【":`︻`,"】":`︼`,"":`︹`,"":`︺`,"〖":`︗`,"〗":`︘`,"":`︕`,"":`︵`,"":`︶`,"":`︐`,"":`︲`,"":`・`,"":`︓`,"":`︔`,"":`︿`,"":`﹀`,"":`︖`,"":`﹇`,"":`﹈`,"_":`︳`,"":`︷`,"":`―`,"":`︸`,"⦅":`︵`,"⦆":`︶`,"。":`︒`,"「":`﹁`,"」":`﹂`};var tl=24,nl=al,rl=function(e,t,n,r,i){var a,o,s=8*i-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=256*o+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else{if(a===c)return o?NaN:1/0*(p?-1:1);o+=2**r,a-=l}return(p?-1:1)*o*2**(a-r)},il=function(e,t,n,r,i,a){var o,s,c,l=8*a-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),(t+=o+d>=1?f/c:f*2**(1-d))*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=255&s,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=255&o,p+=m,o/=256,l-=8);e[n+p-m]|=128*h};function al(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}al.Varint=0,al.Fixed64=1,al.Bytes=2,al.Fixed32=5;var ol=4294967296,sl=1/ol,cl=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`);function ll(e){return e.type===al.Bytes?e.readVarint()+e.pos:e.pos+1}function ul(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function dl(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function fl(e,t){for(var n=0;n<e.length;n++)t.writeVarint(e[n])}function pl(e,t){for(var n=0;n<e.length;n++)t.writeSVarint(e[n])}function ml(e,t){for(var n=0;n<e.length;n++)t.writeFloat(e[n])}function hl(e,t){for(var n=0;n<e.length;n++)t.writeDouble(e[n])}function _l(e,t){for(var n=0;n<e.length;n++)t.writeBoolean(e[n])}function vl(e,t){for(var n=0;n<e.length;n++)t.writeFixed32(e[n])}function yl(e,t){for(var n=0;n<e.length;n++)t.writeSFixed32(e[n])}function bl(e,t){for(var n=0;n<e.length;n++)t.writeFixed64(e[n])}function xl(e,t){for(var n=0;n<e.length;n++)t.writeSFixed64(e[n])}function Sl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function Cl(e,t,n){e[n]=t,e[n+1]=t>>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function wl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}al.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n||=this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,a=this.pos;this.type=7&r,e(i,t,this),this.pos===a&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Sl(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=wl(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Sl(this.buf,this.pos)+Sl(this.buf,this.pos+4)*ol;return this.pos+=8,e},readSFixed64:function(){var e=Sl(this.buf,this.pos)+wl(this.buf,this.pos+4)*ol;return this.pos+=8,e},readFloat:function(){var e=rl(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=rl(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,n,r=this.buf;return t=127&(n=r[this.pos++]),n<128?t:(t|=(127&(n=r[this.pos++]))<<7,n<128?t:(t|=(127&(n=r[this.pos++]))<<14,n<128?t:(t|=(127&(n=r[this.pos++]))<<21,n<128?t:function(e,t,n){var r,i,a=n.buf;if(r=(112&(i=a[n.pos++]))>>4,i<128||(r|=(127&(i=a[n.pos++]))<<3,i<128)||(r|=(127&(i=a[n.pos++]))<<10,i<128)||(r|=(127&(i=a[n.pos++]))<<17,i<128)||(r|=(127&(i=a[n.pos++]))<<24,i<128)||(r|=(1&(i=a[n.pos++]))<<31,i<128))return ul(e,r,t);throw Error(`Expected varint not more than 10 bytes`)}(t|=(15&(n=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&cl?function(e,t,n){return cl.decode(e.subarray(t,n))}(this.buf,t,e):function(e,t,n){for(var r=``,i=t;i<n;){var a,o,s,c=e[i],l=null,u=c>239?4:c>223?3:c>191?2:1;if(i+u>n)break;u===1?c<128&&(l=c):u===2?(192&(a=e[i+1]))==128&&(l=(31&c)<<6|63&a)<=127&&(l=null):u===3?(o=e[i+2],(192&(a=e[i+1]))==128&&(192&o)==128&&((l=(15&c)<<12|(63&a)<<6|63&o)<=2047||l>=55296&&l<=57343)&&(l=null)):u===4&&(o=e[i+2],s=e[i+3],(192&(a=e[i+1]))==128&&(192&o)==128&&(192&s)==128&&((l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||l>=1114112)&&(l=null)),l===null?(l=65533,u=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),i+=u}return r}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==al.Bytes)return e.push(this.readVarint(t));var n=ll(this);for(e||=[];this.pos<n;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==al.Bytes)return e.push(this.readSVarint());var t=ll(this);for(e||=[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==al.Bytes)return e.push(this.readBoolean());var t=ll(this);for(e||=[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==al.Bytes)return e.push(this.readFloat());var t=ll(this);for(e||=[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==al.Bytes)return e.push(this.readDouble());var t=ll(this);for(e||=[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==al.Bytes)return e.push(this.readFixed32());var t=ll(this);for(e||=[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==al.Bytes)return e.push(this.readSFixed32());var t=ll(this);for(e||=[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==al.Bytes)return e.push(this.readFixed64());var t=ll(this);for(e||=[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==al.Bytes)return e.push(this.readSFixed64());var t=ll(this);for(e||=[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===al.Varint)for(;this.buf[this.pos++]>127;);else if(t===al.Bytes)this.pos=this.readVarint()+this.pos;else if(t===al.Fixed32)this.pos+=4;else{if(t!==al.Fixed64)throw Error(`Unimplemented type: `+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var n=new Uint8Array(t);n.set(this.buf),this.buf=n,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Cl(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Cl(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Cl(this.buf,-1&e,this.pos),Cl(this.buf,Math.floor(e*sl),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Cl(this.buf,-1&e,this.pos),Cl(this.buf,Math.floor(e*sl),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw Error(`Given varint doesn't fit into 10 bytes`);t.realloc(10),function(e,t,n){n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,n.buf[n.pos]=127&(e>>>=7)}(n,0,t),function(e,t){var n=(7&e)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,n){for(var r,i,a=0;a<t.length;a++){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){r>56319||a+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):i=r;continue}if(r<56320){e[n++]=239,e[n++]=191,e[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&=(e[n++]=239,e[n++]=191,e[n++]=189,null);r<128?e[n++]=r:(r<2048?e[n++]=r>>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return n}(this.buf,e,this.pos);var n=this.pos-t;n>=128&&dl(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(e){this.realloc(4),il(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),il(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n<t;n++)this.buf[this.pos++]=e[n]},writeRawMessage:function(e,t){this.pos++;var n=this.pos;e(t,this);var r=this.pos-n;r>=128&&dl(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,n){this.writeTag(e,al.Bytes),this.writeRawMessage(t,n)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,fl,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,pl,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,_l,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,ml,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,hl,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,vl,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,yl,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,bl,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,xl,t)},writeBytesField:function(e,t){this.writeTag(e,al.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,al.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,al.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,al.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,al.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,al.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,al.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,al.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,al.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,al.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var Tl=n(nl);function El(e,t,n){e===1&&n.readMessage(Dl,t)}function Dl(e,t,n){if(e===3){let{id:e,bitmap:r,width:i,height:a,left:o,top:s,advance:c}=n.readMessage(Ol,{});t.push({id:e,bitmap:new Ss({width:i+6,height:a+6},r),metrics:{width:i,height:a,left:o,top:s,advance:c}})}}function Ol(e,t,n){e===1?t.id=n.readVarint():e===2?t.bitmap=n.readBytes():e===3?t.width=n.readVarint():e===4?t.height=n.readVarint():e===5?t.left=n.readSVarint():e===6?t.top=n.readSVarint():e===7&&(t.advance=n.readVarint())}function kl(e){let t=0,n=0;for(let r of e)t+=r.w*r.h,n=Math.max(n,r.w);e.sort((e,t)=>t.h-e.h);let r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),n),h:1/0}],i=0,a=0;for(let t of e)for(let e=r.length-1;e>=0;e--){let n=r[e];if(!(t.w>n.w||t.h>n.h)){if(t.x=n.x,t.y=n.y,a=Math.max(a,t.y+t.h),i=Math.max(i,t.x+t.w),t.w===n.w&&t.h===n.h){let t=r.pop();e<r.length&&(r[e]=t)}else t.h===n.h?(n.x+=t.w,n.w-=t.w):t.w===n.w?(n.y+=t.h,n.h-=t.h):(r.push({x:n.x+t.w,y:n.y,w:n.w-t.w,h:t.h}),n.y+=t.h,n.h-=t.h);break}}return{w:i,h:a,fill:t/(i*a)||0}}class Al{constructor(e,{pixelRatio:t,version:n,stretchX:r,stretchY:i,content:a,textFitWidth:o,textFitHeight:s}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=r,this.stretchY=i,this.content=a,this.version=n,this.textFitWidth=o,this.textFitHeight=s}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class jl{constructor(e,t){let n={},r={};this.haveRenderCallbacks=[];let i=[];this.addImages(e,n,i),this.addImages(t,r,i);let{w:a,h:o}=kl(i),s=new Cs({width:a||1,height:o||1});for(let t in e){let r=e[t],i=n[t].paddedRect;Cs.copy(r.data,s,{x:0,y:0},{x:i.x+1,y:i.y+1},r.data)}for(let e in t){let n=t[e],i=r[e].paddedRect,a=i.x+1,o=i.y+1,c=n.data.width,l=n.data.height;Cs.copy(n.data,s,{x:0,y:0},{x:a,y:o},n.data),Cs.copy(n.data,s,{x:0,y:l-1},{x:a,y:o-1},{width:c,height:1}),Cs.copy(n.data,s,{x:0,y:0},{x:a,y:o+l},{width:c,height:1}),Cs.copy(n.data,s,{x:c-1,y:0},{x:a-1,y:o},{width:1,height:l}),Cs.copy(n.data,s,{x:0,y:0},{x:a+c,y:o},{width:1,height:l})}this.image=s,this.iconPositions=n,this.patternPositions=r}addImages(e,t,n){for(let r in e){let i=e[r],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};n.push(a),t[r]=new Al(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(r)}}patchUpdatedImages(e,t){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),t),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),t)}patchUpdatedImage(e,t,n){if(!e||!t||e.version===t.version)return;e.version=t.version;let[r,i]=e.tl;n.update(t.data,void 0,{x:r,y:i})}}var Ml;Si(`ImagePosition`,Al),Si(`ImageAtlas`,jl),e.ah=void 0,(Ml=e.ah||={})[Ml.none=0]=`none`,Ml[Ml.horizontal=1]=`horizontal`,Ml[Ml.vertical=2]=`vertical`,Ml[Ml.horizontalOnly=3]=`horizontalOnly`;class Nl{constructor(){this.scale=1,this.fontStack=``,this.imageName=null}static forText(e,t){let n=new Nl;return n.scale=e||1,n.fontStack=t,n}static forImage(e){let t=new Nl;return t.imageName=e,t}}class Pl{constructor(){this.text=``,this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){let n=new Pl;for(let r=0;r<e.sections.length;r++){let i=e.sections[r];i.image?n.addImageSection(i):n.addTextSection(i,t)}return n}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=function(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n+1)||null,i=e.charCodeAt(n-1)||null;t+=r&&Li(r)&&!el[e[n+1]]||i&&Li(i)&&!el[e[n-1]]||!el[e[n]]?e[n]:el[e[n]]}return t}(this.text)}trim(){let e=0;for(let t=0;t<this.text.length&&Il[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let n=this.text.length-1;n>=0&&n>=e&&Il[this.text.charCodeAt(n)];n--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){let n=new Pl;return n.text=this.text.substring(e,t),n.sectionIndex=this.sectionIndex.slice(e,t),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,t)=>Math.max(e,this.sections[t].scale),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(Nl.forText(e.scale,e.fontStack||t));let n=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(n)}addImageSection(e){let t=e.image?e.image.name:``;if(t.length===0)return void T(`Can't add FormattedSection with an empty image.`);let n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCharCode(n),this.sections.push(Nl.forImage(t)),this.sectionIndex.push(this.sections.length-1)):T(`Reached maximum number of images 6401`)}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Fl(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=Pl.fromFeature(t,a),_;f===e.ah.vertical&&g.verticalizePunctuation();let{processBidirectionalText:v,processStyledBidirectionalText:y}=Hi;if(v&&g.sections.length===1){_=[];let e=v(g.toString(),Wl(g,u,o,n,i,m));for(let t of e){let e=new Pl;e.text=t,e.sections=g.sections;for(let n=0;n<t.length;n++)e.sectionIndex.push(0);_.push(e)}}else if(y){_=[];let e=y(g.text,g.sectionIndex,Wl(g,u,o,n,i,m));for(let t of e){let e=new Pl;e.text=t[0],e.sectionIndex=t[1],e.sections=g.sections,_.push(e)}}else _=function(e,t){let n=[],r=e.text,i=0;for(let r of t)n.push(e.substring(i,r)),i=r;return i<r.length&&n.push(e.substring(i,r.length)),n}(g,Wl(g,u,o,n,i,m));let b=[],x={positionedLines:b,text:g.toString(),top:d[1],bottom:d[1],left:d[0],right:d[0],writingMode:f,iconsInText:!1,verticalizable:!1};return function(t,n,r,i,a,o,s,c,l,u,d,f){let p=0,m=-17,h=0,g=0,_=c===`right`?1:c===`left`?0:.5,v=0;for(let s of a){s.trim();let a=s.getMaxScale(),c=(a-1)*tl,b={positionedGlyphs:[],lineOffset:0};t.positionedLines[v]=b;let x=b.positionedGlyphs,S=0;if(!s.length()){m+=o,++v;continue}for(let o=0;o<s.length();o++){let h=s.getSection(o),g=s.getSectionIndex(o),_=s.getCharCode(o),v=0,b=null,C=null,w=null,T=tl,E=!(l===e.ah.horizontal||!d&&!Ii(_)||d&&(Il[_]||(y=_,RegExp(`\\p{sc=Arab}`,`u`).test(String.fromCodePoint(y)))));if(h.imageName){let e=i[h.imageName];if(!e)continue;w=h.imageName,t.iconsInText=t.iconsInText||!0,C=e.paddedRect;let n=e.displaySize;h.scale=h.scale*tl/f,b={width:n[0],height:n[1],left:1,top:-3,advance:E?n[1]:n[0]},v=c+(tl-n[1]*h.scale),T=b.advance;let r=E?n[0]*h.scale-tl*a:n[1]*h.scale-tl*a;r>0&&r>S&&(S=r)}else{let e=r[h.fontStack],t=e&&e[_];if(t&&t.rect)C=t.rect,b=t.metrics;else{let e=n[h.fontStack],t=e&&e[_];if(!t)continue;b=t.metrics}v=(a-h.scale)*tl}E?(t.verticalizable=!0,x.push({glyph:_,imageName:w,x:p,y:m+v,vertical:E,scale:h.scale,fontStack:h.fontStack,sectionIndex:g,metrics:b,rect:C}),p+=T*h.scale+u):(x.push({glyph:_,imageName:w,x:p,y:m+v,vertical:E,scale:h.scale,fontStack:h.fontStack,sectionIndex:g,metrics:b,rect:C}),p+=b.advance*h.scale+u)}x.length!==0&&(h=Math.max(p-u,h),Kl(x,0,x.length-1,_,S)),p=0;let C=o*a+S;b.lineOffset=Math.max(S,c),m+=C,g=Math.max(C,g),++v}var y;let b=m- -17,{horizontalAlign:x,verticalAlign:S}=Gl(s);(function(e,t,n,r,i,a,o,s,c){let l=(t-n)*i,u=0;u=a===o?(-r*c+.5)*o:-s*r- -17;for(let t of e)for(let e of t.positionedGlyphs)e.x+=l,e.y+=u})(t.positionedLines,_,x,S,h,g,o,b,a.length),t.top+=-S*b,t.bottom=t.top+b,t.left+=-x*h,t.right=t.left+h}(x,n,r,i,_,s,c,l,f,u,p,h),!function(e){for(let t of e)if(t.positionedGlyphs.length!==0)return!1;return!0}(b)&&x}let Il={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ll={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},Rl={40:!0};function zl(e,t,n,r,i,a){if(t.imageName){let e=r[t.imageName];return e?e.displaySize[0]*t.scale*tl/a+i:0}{let r=n[t.fontStack],a=r&&r[e];return a?a.metrics.advance*t.scale+i:0}}function Bl(e,t,n,r){let i=(e-t)**2;return r?e<t?i/2:2*i:i+Math.abs(n)*n}function Vl(e,t,n){let r=0;return e===10&&(r-=1e4),n&&(r+=150),e!==40&&e!==65288||(r+=50),t!==41&&t!==65289||(r+=50),r}function Hl(e,t,n,r,i,a){let o=null,s=Bl(t,n,i,a);for(let e of r){let r=Bl(t-e.x,n,i,a)+e.badness;r<=s&&(o=e,s=r)}return{index:e,x:t,priorBreak:o,badness:s}}function Ul(e){return e?Ul(e.priorBreak).concat(e.index):[]}function Wl(e,t,n,r,i,a){if(!e)return[];let o=[],s=function(e,t,n,r,i,a){let o=0;for(let n=0;n<e.length();n++){let s=e.getSection(n);o+=zl(e.getCharCode(n),s,r,i,t,a)}return o/Math.max(1,Math.ceil(o/n))}(e,t,n,r,i,a),c=e.text.indexOf(``)>=0,l=0;for(let n=0;n<e.length();n++){let d=e.getSection(n),f=e.getCharCode(n);if(Il[f]||(l+=zl(f,d,r,i,t,a)),n<e.length()-1){let t=!((u=f)<11904)&&(!!ki[`CJK Compatibility Forms`](u)||!!ki[`CJK Compatibility`](u)||!!ki[`CJK Strokes`](u)||!!ki[`CJK Symbols and Punctuation`](u)||!!ki[`Enclosed CJK Letters and Months`](u)||!!ki[`Halfwidth and Fullwidth Forms`](u)||!!ki[`Ideographic Description Characters`](u)||!!ki[`Vertical Forms`](u)||Fi.test(String.fromCodePoint(u)));(Ll[f]||t||d.imageName||n!==e.length()-2&&Rl[e.getCharCode(n+1)])&&o.push(Hl(n+1,l,s,o,Vl(f,e.getCharCode(n+1),t&&c),!1))}}var u;return Ul(Hl(e.length(),l,s,o,0,!0))}function Gl(e){let t=.5,n=.5;switch(e){case`right`:case`top-right`:case`bottom-right`:t=1;break;case`left`:case`top-left`:case`bottom-left`:t=0}switch(e){case`bottom`:case`bottom-right`:case`bottom-left`:n=1;break;case`top`:case`top-right`:case`top-left`:n=0}return{horizontalAlign:t,verticalAlign:n}}function Kl(e,t,n,r,i){if(!r&&!i)return;let a=e[n],o=(e[n].x+a.metrics.advance*a.scale)*r;for(let r=t;r<=n;r++)e[r].x-=o,e[r].y+=i}function ql(e,t,n){let{horizontalAlign:r,verticalAlign:i}=Gl(n),a=t[0]-e.displaySize[0]*r,o=t[1]-e.displaySize[1]*i;return{image:e,top:o,bottom:o+e.displaySize[1],left:a,right:a+e.displaySize[0]}}function Jl(e){let t=e.left,n=e.top,r=e.right-t,i=e.bottom-n,a=e.image.textFitWidth??`stretchOrShrink`,o=e.image.textFitHeight??`stretchOrShrink`,s=(e.image.content[2]-e.image.content[0])/(e.image.content[3]-e.image.content[1]);if(o===`proportional`){if(a===`stretchOnly`&&r/i<s||a===`proportional`){let e=Math.ceil(i*s);t*=e/r,r=e}}else if(a===`proportional`&&o===`stretchOnly`&&s!==0&&r/i>s){let e=Math.ceil(r/s);n*=e/i,i=e}return{x1:t,y1:n,x2:t+r,y2:n+i}}function Yl(e,t,n,r,i,a){let o=e.image,s;if(o.content){let e=o.content,t=o.pixelRatio||1;s=[e[0]/t,e[1]/t,o.displaySize[0]-e[2]/t,o.displaySize[1]-e[3]/t]}let c=t.left*a,l=t.right*a,u,d,f,p;n===`width`||n===`both`?(p=i[0]+c-r[3],d=i[0]+l+r[1]):(p=i[0]+(c+l-o.displaySize[0])/2,d=p+o.displaySize[0]);let m=t.top*a,h=t.bottom*a;return n===`height`||n===`both`?(u=i[1]+m-r[0],f=i[1]+h+r[2]):(u=i[1]+(m+h-o.displaySize[1])/2,f=u+o.displaySize[1]),{image:o,top:u,right:d,bottom:f,left:p,collisionPadding:s}}let Xl=32640;function Zl(e,t){let{expression:n}=t;if(n.kind===`constant`)return{kind:`constant`,layoutSize:n.evaluate(new Ui(e+1))};if(n.kind===`source`)return{kind:`source`};{let{zoomStops:t,interpolationType:r}=n,i=0;for(;i<t.length&&t[i]<=e;)i++;i=Math.max(0,i-1);let a=i;for(;a<t.length&&t[a]<e+1;)a++;a=Math.min(t.length-1,a);let o=t[i],s=t[a];return n.kind===`composite`?{kind:`composite`,minZoom:o,maxZoom:s,interpolationType:r}:{kind:`camera`,minZoom:o,maxZoom:s,minSize:n.evaluate(new Ui(o)),maxSize:n.evaluate(new Ui(s)),interpolationType:r}}}function Ql(e,t,n){let r=`never`,i=e.get(t);return i?r=i:e.get(n)&&(r=`always`),r}let $l=fc.VectorTileFeature.types,eu=[{name:`a_fade_opacity`,components:1,type:`Uint8`,offset:0}];function tu(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=s?Math.min(Xl,Math.round(s[0])):0,m=s?Math.min(Xl,Math.round(s[1])):0;e.emplaceBack(t,n,Math.round(32*r),Math.round(32*i),a,o,(p<<1)+(c?1:0),m,16*l,16*u,256*d,256*f)}function nu(e,t,n){e.emplaceBack(t.x,t.y,n),e.emplaceBack(t.x,t.y,n),e.emplaceBack(t.x,t.y,n),e.emplaceBack(t.x,t.y,n)}function ru(e){for(let t of e.sections)if(Vi(t.text))return!0;return!1}class iu{constructor(e){this.layoutVertexArray=new $a,this.indexArray=new io,this.programConfigurations=e,this.segments=new so,this.dynamicLayoutVertexArray=new eo,this.opacityVertexArray=new to,this.hasVisibleVertices=!1,this.placedSymbolArray=new La}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,t,n,r){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Jc.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Yc.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,eu,!0),this.opacityVertexBuffer.itemSize=1),(n||r)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Si(`SymbolBuffers`,iu);class au{constructor(e,t,n){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new n,this.segments=new so,this.collisionVertexArray=new ro}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Xc.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Si(`CollisionBuffers`,au);class ou{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ls([]),this.placementViewportMatrix=ls([]);let n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Zl(this.zoom,n[`text-size`]),this.iconSizeData=Zl(this.zoom,n[`icon-size`]);let r=this.layers[0].layout,i=r.get(`symbol-sort-key`),a=r.get(`symbol-z-order`);this.canOverlap=Ql(r,`text-overlap`,`text-allow-overlap`)!==`never`||Ql(r,`icon-overlap`,`icon-allow-overlap`)!==`never`||r.get(`text-ignore-placement`)||r.get(`icon-ignore-placement`),this.sortFeaturesByKey=a!==`viewport-y`&&!i.isConstant(),this.sortFeaturesByY=(a===`viewport-y`||a===`auto`&&!this.sortFeaturesByKey)&&this.canOverlap,r.get(`symbol-placement`)===`point`&&(this.writingModes=r.get(`text-writing-mode`).map(t=>e.ah[t])),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.sourceID=t.sourceID}createArrays(){this.text=new iu(new Po(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new iu(new Po(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Ba,this.lineVertexArray=new Va,this.symbolInstances=new za,this.textAnchorOffsets=new Ua}calculateGlyphDependencies(e,t,n,r,i){for(let a=0;a<e.length;a++)if(t[e.charCodeAt(a)]=!0,(n||r)&&i){let n=el[e.charAt(a)];n&&(t[n.charCodeAt(0)]=!0)}}populate(t,n,r){let i=this.layers[0],a=i.layout,o=a.get(`text-font`),s=a.get(`text-field`),c=a.get(`icon-image`),l=(s.value.kind!==`constant`||s.value.value instanceof Qe&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(o.value.kind!==`constant`||o.value.value.length>0),u=c.value.kind!==`constant`||!!c.value.value||Object.keys(c.parameters).length>0,d=a.get(`symbol-sort-key`);if(this.features=[],!l&&!u)return;let f=n.iconDependencies,p=n.glyphDependencies,m=n.availableImages,h=new Ui(this.zoom);for(let{feature:n,id:s,index:c,sourceLayerIndex:g}of t){let t=i._featureFilter.needGeometry,_=Vo(n,t);if(!i._featureFilter.filter(h,_,r))continue;let v,y;if(t||(_.geometry=Bo(n)),l){let e=i.getValueAndResolveTokens(`text-field`,_,r,m),t=Qe.factory(e),n=this.hasRTLText=this.hasRTLText||ru(t);(!n||Hi.getRTLTextPluginStatus()===`unavailable`||n&&Hi.isParsed())&&(v=$c(t,i,_))}if(u){let e=i.getValueAndResolveTokens(`icon-image`,_,r,m);y=e instanceof nt?e:nt.fromString(e)}if(!v&&!y)continue;let b=this.sortFeaturesByKey?d.evaluate(_,{},r):void 0;if(this.features.push({id:s,text:v,icon:y,index:c,sourceLayerIndex:g,geometry:_.geometry,properties:n.properties,type:$l[n.type],sortKey:b}),y&&(f[y.name]=!0),v){let t=o.evaluate(_,{},r).join(`,`),n=a.get(`text-rotation-alignment`)!==`viewport`&&a.get(`symbol-placement`)!==`point`;this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(let e of v.sections)if(e.image)f[e.image.name]=!0;else{let r=Ai(v.toString()),i=e.fontStack||t,a=p[i]=p[i]||{};this.calculateGlyphDependencies(e.text,a,n,this.allowVerticalPlacement,r)}}}a.get(`symbol-placement`)===`line`&&(this.features=function(e){let t={},n={},r=[],i=0;function a(t){r.push(e[t]),i++}function o(e,t,i){let a=n[e];return delete n[e],n[t]=a,r[a].geometry[0].pop(),r[a].geometry[0]=r[a].geometry[0].concat(i[0]),a}function s(e,n,i){let a=t[n];return delete t[n],t[e]=a,r[a].geometry[0].shift(),r[a].geometry[0]=i[0].concat(r[a].geometry[0]),a}function c(e,t,n){let r=n?t[0][t[0].length-1]:t[0][0];return`${e}:${r.x}:${r.y}`}for(let l=0;l<e.length;l++){let u=e[l],d=u.geometry,f=u.text?u.text.toString():null;if(!f){a(l);continue}let p=c(f,d),m=c(f,d,!0);if(p in n&&m in t&&n[p]!==t[m]){let e=s(p,m,d),i=o(p,m,r[e].geometry);delete t[p],delete n[m],n[c(f,r[i].geometry,!0)]=i,r[e].geometry=null}else p in n?o(p,m,d):m in t?s(p,m,d):(a(l),t[p]=i-1,n[m]=i-1)}return r.filter(e=>e.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((e,t)=>e.sortKey-t.sortKey)}update(e,t,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,n),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,n))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,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(e,t){let n=this.lineVertexArray.length;if(e.segment!==void 0){let n=e.dist(t[e.segment+1]),r=e.dist(t[e.segment]),i={};for(let r=e.segment+1;r<t.length;r++)i[r]={x:t[r].x,y:t[r].y,tileUnitDistanceFromAnchor:n},r<t.length-1&&(n+=t[r+1].dist(t[r]));for(let n=e.segment||0;n>=0;n--)i[n]={x:t[n].x,y:t[n].y,tileUnitDistanceFromAnchor:r},n>0&&(r+=t[n-1].dist(t[n]));for(let e=0;e<t.length;e++){let t=i[e];this.lineVertexArray.emplaceBack(t.x,t.y,t.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(t,n,r,i,a,o,s,c,l,u,d,f){let p=t.indexArray,m=t.layoutVertexArray,h=t.segments.prepareSegment(4*n.length,m,p,this.canOverlap?o.sortKey:void 0),g=this.glyphOffsetArray.length,_=h.vertexLength,v=this.allowVerticalPlacement&&s===e.ah.vertical?Math.PI/2:0,y=o.text&&o.text.sections;for(let e=0;e<n.length;e++){let{tl:i,tr:a,bl:s,br:l,tex:u,pixelOffsetTL:d,pixelOffsetBR:g,minFontScaleX:_,minFontScaleY:b,glyphOffset:x,isSDF:S,sectionIndex:C}=n[e],w=h.vertexLength,T=x[1];tu(m,c.x,c.y,i.x,T+i.y,u.x,u.y,r,S,d.x,d.y,_,b),tu(m,c.x,c.y,a.x,T+a.y,u.x+u.w,u.y,r,S,g.x,d.y,_,b),tu(m,c.x,c.y,s.x,T+s.y,u.x,u.y+u.h,r,S,d.x,g.y,_,b),tu(m,c.x,c.y,l.x,T+l.y,u.x+u.w,u.y+u.h,r,S,g.x,g.y,_,b),nu(t.dynamicLayoutVertexArray,c,v),p.emplaceBack(w,w+1,w+2),p.emplaceBack(w+1,w+2,w+3),h.vertexLength+=4,h.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(x[0]),e!==n.length-1&&C===n[e+1].sectionIndex||t.programConfigurations.populatePaintArrays(m.length,o,o.index,{},f,y&&y[C])}t.placedSymbolArray.emplaceBack(c.x,c.y,g,this.glyphOffsetArray.length-g,_,l,u,c.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],s,0,!1,0,d)}_addCollisionDebugVertex(e,t,n,r,i,a){return t.emplaceBack(0,0),e.emplaceBack(n.x,n.y,r,i,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,n,r,i,o,s){let c=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=c.vertexLength,u=i.layoutVertexArray,d=i.collisionVertexArray,f=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,d,o,f,p,new a(e,t)),this._addCollisionDebugVertex(u,d,o,f,p,new a(n,t)),this._addCollisionDebugVertex(u,d,o,f,p,new a(n,r)),this._addCollisionDebugVertex(u,d,o,f,p,new a(e,r)),c.vertexLength+=4;let m=i.indexArray;m.emplaceBack(l,l+1),m.emplaceBack(l+1,l+2),m.emplaceBack(l+2,l+3),m.emplaceBack(l+3,l),c.primitiveLength+=4}addDebugCollisionBoxes(e,t,n,r){for(let i=e;i<t;i++){let e=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(e.x1,e.y1,e.x2,e.y2,r?this.textCollisionBox:this.iconCollisionBox,e.anchorPoint,n)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new au(no,Zc.members,ao),this.iconCollisionBox=new au(no,Zc.members,ao);for(let e=0;e<this.symbolInstances.length;e++){let t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,n,r,i,a,o,s,c){let l={};for(let r=t;r<n;r++){let t=e.get(r);l.textBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},l.textFeatureIndex=t.featureIndex;break}for(let t=r;t<i;t++){let n=e.get(t);l.verticalTextBox={x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,anchorPointX:n.anchorPointX,anchorPointY:n.anchorPointY},l.verticalTextFeatureIndex=n.featureIndex;break}for(let t=a;t<o;t++){let n=e.get(t);l.iconBox={x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,anchorPointX:n.anchorPointX,anchorPointY:n.anchorPointY},l.iconFeatureIndex=n.featureIndex;break}for(let t=s;t<c;t++){let n=e.get(t);l.verticalIconBox={x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,anchorPointX:n.anchorPointX,anchorPointY:n.anchorPointY},l.verticalIconFeatureIndex=n.featureIndex;break}return l}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let n=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.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(e,t){let n=e.placedSymbolArray.get(t),r=n.vertexStartIndex+4*n.numGlyphs;for(let t=n.vertexStartIndex;t<r;t+=4)e.indexArray.emplaceBack(t,t+1,t+2),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let t=Math.sin(e),n=Math.cos(e),r=[],i=[],a=[];for(let e=0;e<this.symbolInstances.length;++e){a.push(e);let o=this.symbolInstances.get(e);r.push(0|Math.round(t*o.anchorX+n*o.anchorY)),i.push(o.featureIndex)}return a.sort((e,t)=>r[e]-r[t]||i[t]-i[e]),a}addToSortKeyRanges(e,t){let n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===t?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex),[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex].forEach((e,t,n)=>{e>=0&&n.indexOf(e)===t&&this.addIndicesForPlacedSymbol(this.text,e)}),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 su,cu;Si(`SymbolBucket`,ou,{omit:[`layers`,`collisionBoxArray`,`features`,`compareText`]}),ou.MAX_GLYPHS=65535,ou.addDynamicAttributes=nu;var lu={get paint(){return cu||=new ra({"icon-opacity":new $i(J.paint_symbol[`icon-opacity`]),"icon-color":new $i(J.paint_symbol[`icon-color`]),"icon-halo-color":new $i(J.paint_symbol[`icon-halo-color`]),"icon-halo-width":new $i(J.paint_symbol[`icon-halo-width`]),"icon-halo-blur":new $i(J.paint_symbol[`icon-halo-blur`]),"icon-translate":new Qi(J.paint_symbol[`icon-translate`]),"icon-translate-anchor":new Qi(J.paint_symbol[`icon-translate-anchor`]),"text-opacity":new $i(J.paint_symbol[`text-opacity`]),"text-color":new $i(J.paint_symbol[`text-color`],{runtimeType:he,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new $i(J.paint_symbol[`text-halo-color`]),"text-halo-width":new $i(J.paint_symbol[`text-halo-width`]),"text-halo-blur":new $i(J.paint_symbol[`text-halo-blur`]),"text-translate":new Qi(J.paint_symbol[`text-translate`]),"text-translate-anchor":new Qi(J.paint_symbol[`text-translate-anchor`])})},get layout(){return su||=new ra({"symbol-placement":new Qi(J.layout_symbol[`symbol-placement`]),"symbol-spacing":new Qi(J.layout_symbol[`symbol-spacing`]),"symbol-avoid-edges":new Qi(J.layout_symbol[`symbol-avoid-edges`]),"symbol-sort-key":new $i(J.layout_symbol[`symbol-sort-key`]),"symbol-z-order":new Qi(J.layout_symbol[`symbol-z-order`]),"icon-allow-overlap":new Qi(J.layout_symbol[`icon-allow-overlap`]),"icon-overlap":new Qi(J.layout_symbol[`icon-overlap`]),"icon-ignore-placement":new Qi(J.layout_symbol[`icon-ignore-placement`]),"icon-optional":new Qi(J.layout_symbol[`icon-optional`]),"icon-rotation-alignment":new Qi(J.layout_symbol[`icon-rotation-alignment`]),"icon-size":new $i(J.layout_symbol[`icon-size`]),"icon-text-fit":new Qi(J.layout_symbol[`icon-text-fit`]),"icon-text-fit-padding":new Qi(J.layout_symbol[`icon-text-fit-padding`]),"icon-image":new $i(J.layout_symbol[`icon-image`]),"icon-rotate":new $i(J.layout_symbol[`icon-rotate`]),"icon-padding":new $i(J.layout_symbol[`icon-padding`]),"icon-keep-upright":new Qi(J.layout_symbol[`icon-keep-upright`]),"icon-offset":new $i(J.layout_symbol[`icon-offset`]),"icon-anchor":new $i(J.layout_symbol[`icon-anchor`]),"icon-pitch-alignment":new Qi(J.layout_symbol[`icon-pitch-alignment`]),"text-pitch-alignment":new Qi(J.layout_symbol[`text-pitch-alignment`]),"text-rotation-alignment":new Qi(J.layout_symbol[`text-rotation-alignment`]),"text-field":new $i(J.layout_symbol[`text-field`]),"text-font":new $i(J.layout_symbol[`text-font`]),"text-size":new $i(J.layout_symbol[`text-size`]),"text-max-width":new $i(J.layout_symbol[`text-max-width`]),"text-line-height":new Qi(J.layout_symbol[`text-line-height`]),"text-letter-spacing":new $i(J.layout_symbol[`text-letter-spacing`]),"text-justify":new $i(J.layout_symbol[`text-justify`]),"text-radial-offset":new $i(J.layout_symbol[`text-radial-offset`]),"text-variable-anchor":new Qi(J.layout_symbol[`text-variable-anchor`]),"text-variable-anchor-offset":new $i(J.layout_symbol[`text-variable-anchor-offset`]),"text-anchor":new $i(J.layout_symbol[`text-anchor`]),"text-max-angle":new Qi(J.layout_symbol[`text-max-angle`]),"text-writing-mode":new Qi(J.layout_symbol[`text-writing-mode`]),"text-rotate":new $i(J.layout_symbol[`text-rotate`]),"text-padding":new Qi(J.layout_symbol[`text-padding`]),"text-keep-upright":new Qi(J.layout_symbol[`text-keep-upright`]),"text-transform":new $i(J.layout_symbol[`text-transform`]),"text-offset":new $i(J.layout_symbol[`text-offset`]),"text-allow-overlap":new Qi(J.layout_symbol[`text-allow-overlap`]),"text-overlap":new Qi(J.layout_symbol[`text-overlap`]),"text-ignore-placement":new Qi(J.layout_symbol[`text-ignore-placement`]),"text-optional":new Qi(J.layout_symbol[`text-optional`])})}};class uu{constructor(e){if(e.property.overrides===void 0)throw Error(`overrides must be provided to instantiate FormatSectionOverride class`);this.type=e.property.overrides?e.property.overrides.runtimeType:de,this.defaultValue=e}evaluate(e){if(e.formattedSection){let t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Si(`FormatSectionOverride`,uu,{omit:[`defaultValue`]});class du extends aa{constructor(e){super(e,lu)}recalculate(e,t){if(super.recalculate(e,t),this.layout.get(`icon-rotation-alignment`)===`auto`&&(this.layout._values[`icon-rotation-alignment`]=this.layout.get(`symbol-placement`)===`point`?`viewport`:`map`),this.layout.get(`text-rotation-alignment`)===`auto`&&(this.layout._values[`text-rotation-alignment`]=this.layout.get(`symbol-placement`)===`point`?`viewport`:`map`),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 e=this.layout.get(`text-writing-mode`);if(e){let t=[];for(let n of e)t.indexOf(n)<0&&t.push(n);this.layout._values[`text-writing-mode`]=t}else this.layout._values[`text-writing-mode`]=[`horizontal`]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,n,r){let i=this.layout.get(e).evaluate(t,{},n,r),a=this._unevaluatedLayout._values[e];return a.isDataDriven()||br(a.value)||!i?i:function(e,t){return t.replace(/{([^{}]+)}/g,(t,n)=>e&&n in e?String(e[n]):``)}(t.properties,i)}createBucket(e){return new ou(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error(`Should take a different path in FeatureIndex`)}_setPaintOverrides(){for(let e of lu.paint.overridableProperties){if(!du.hasPaintOverride(this.layout,e))continue;let t=this.paint.get(e),n=new yr(new uu(t),t.property.specification),r=null;r=t.value.kind===`constant`||t.value.kind===`source`?new Sr(`source`,n):new Cr(`composite`,n,t.value.zoomStops),this.paint._values[e]=new Xi(t.property,r,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,n){return!(!this.layout||t.isDataDriven()||n.isDataDriven())&&du.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){let n=e.get(`text-field`),r=lu.paint.properties[t],i=!1,a=e=>{for(let t of e)if(r.overrides&&r.overrides.hasOverride(t))return void(i=!0)};if(n.value.kind===`constant`&&n.value.value instanceof Qe)a(n.value.value.sections);else if(n.value.kind===`source`){let e=t=>{i||(t instanceof st&&at(t.value)===ye?a(t.value.sections):t instanceof Kt?a(t.sections):t.eachChild(e))},t=n.value;t._styleExpression&&e(t._styleExpression.expression)}return i}}let fu;var pu={get paint(){return fu||=new ra({"background-color":new Qi(J.paint_background[`background-color`]),"background-pattern":new ta(J.paint_background[`background-pattern`]),"background-opacity":new Qi(J.paint_background[`background-opacity`])})}};class mu extends aa{constructor(e){super(e,pu)}}let hu;var gu={get paint(){return hu||=new ra({"raster-opacity":new Qi(J.paint_raster[`raster-opacity`]),"raster-hue-rotate":new Qi(J.paint_raster[`raster-hue-rotate`]),"raster-brightness-min":new Qi(J.paint_raster[`raster-brightness-min`]),"raster-brightness-max":new Qi(J.paint_raster[`raster-brightness-max`]),"raster-saturation":new Qi(J.paint_raster[`raster-saturation`]),"raster-contrast":new Qi(J.paint_raster[`raster-contrast`]),"raster-resampling":new Qi(J.paint_raster[`raster-resampling`]),"raster-fade-duration":new Qi(J.paint_raster[`raster-fade-duration`])})}};class _u extends aa{constructor(e){super(e,gu)}}class vu extends aa{constructor(e){super(e,{}),this.onAdd=e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},this.onRemove=e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode===`3d`}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error(`Custom layers cannot be serialized`)}}class yu{constructor(e){this._methodToThrottle=e,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 bu=6371008.8;class xu{constructor(e,t){if(isNaN(e)||isNaN(t))throw Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw Error(`Invalid LngLat latitude value: must be between -90 and 90`)}wrap(){return new xu(v(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let t=Math.PI/180,n=this.lat*t,r=e.lat*t,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return bu*Math.acos(Math.min(i,1))}static convert(e){if(e instanceof xu)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new xu(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e==`object`&&e)return new xu(Number(`lng`in e?e.lng:e.lon),Number(e.lat));throw 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 Su=2*Math.PI*bu;function Cu(e){return Su*Math.cos(e*Math.PI/180)}function wu(e){return(180+e)/360}function Tu(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Eu(e,t){return e/Cu(t)}function Du(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}class Ou{constructor(e,t,n=0){this.x=+e,this.y=+t,this.z=+n}static fromLngLat(e,t=0){let n=xu.convert(e);return new Ou(wu(n.lng),Tu(n.lat),Eu(t,n.lat))}toLngLat(){return new xu(360*this.x-180,Du(this.y))}toAltitude(){return this.z*Cu(Du(this.y))}meterInMercatorCoordinateUnits(){return 1/Su*(e=Du(this.y),1/Math.cos(e*Math.PI/180));var e}}function ku(e,t,n){var r=2*Math.PI*6378137/256/2**n;return[e*r-2*Math.PI*6378137/2,t*r-2*Math.PI*6378137/2]}class Au{constructor(e,t,n){if(!function(e,t,n){return!(e<0||e>25||n<0||n>=2**e||t<0||t>=2**e)}(e,t,n))throw Error(`x=${t}, y=${n}, z=${e} outside of bounds. 0<=x<${2**e}, 0<=y<${2**e} 0<=z<=25 `);this.z=e,this.x=t,this.y=n,this.key=Nu(0,e,e,t,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,n){let r=(a=this.y,o=this.z,s=ku(256*(i=this.x),256*(a=2**o-a-1),o),c=ku(256*(i+1),256*(a+1),o),s[0]+`,`+s[1]+`,`+c[0]+`,`+c[1]);var i,a,o,s,c;let l=function(e,t,n){let r,i=``;for(let a=e;a>0;a--)r=1<<a-1,i+=(t&r?1:0)+(n&r?2:0);return i}(this.z,this.x,this.y);return e[(this.x+this.y)%e.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(n===`tms`?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,t>1?`@2x`:``).replace(/{quadkey}/g,l).replace(/{bbox-epsg-3857}/g,r)}isChildOf(e){let t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){let t=2**this.z;return new a((e.x*t-this.x)*Lo,(e.y*t-this.y)*Lo)}toString(){return`${this.z}/${this.x}/${this.y}`}}class ju{constructor(e,t){this.wrap=e,this.canonical=t,this.key=Nu(e,t.z,t.z,t.x,t.y)}}class Mu{constructor(e,t,n,r,i){if(e<n)throw Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${n}`);this.overscaledZ=e,this.wrap=t,this.canonical=new Au(n,+r,+i),this.key=Nu(t,e,n,r,i)}clone(){return new Mu(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let t=this.canonical.z-e;return e>this.canonical.z?new Mu(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Mu(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let n=this.canonical.z-e;return e>this.canonical.z?Nu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Nu(this.wrap*+t,e,e,this.canonical.x>>n,this.canonical.y>>n)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let t=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new Mu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let t=this.canonical.z+1,n=2*this.canonical.x,r=2*this.canonical.y;return[new Mu(t,this.wrap,t,n,r),new Mu(t,this.wrap,t,n+1,r),new Mu(t,this.wrap,t,n,r+1),new Mu(t,this.wrap,t,n+1,r+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new Mu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Mu(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return 2**(this.overscaledZ-this.canonical.z)}toUnwrapped(){return new ju(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Ou(e.x-this.wrap,e.y))}}function Nu(e,t,n,r,i){(e*=2)<0&&(e=-1*e-1);let a=1<<n;return(a*a*e+a*i+r).toString(36)+n.toString(36)+t.toString(36)}Si(`CanonicalTileID`,Au),Si(`OverscaledTileID`,Mu,{omit:[`posMatrix`]});class Pu{constructor(e,t,n,r=1,i=1,a=1,o=0){if(this.uid=e,t.height!==t.width)throw RangeError(`DEM tiles must be square`);if(n&&![`mapbox`,`terrarium`,`custom`].includes(n))return void T(`"${n}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=t.height;let s=this.dim=t.height-2;switch(this.data=new Uint32Array(t.data.buffer),n){case`terrarium`:this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case`custom`:this.redFactor=r,this.greenFactor=i,this.blueFactor=a,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let e=0;e<s;e++)this.data[this._idx(-1,e)]=this.data[this._idx(0,e)],this.data[this._idx(s,e)]=this.data[this._idx(s-1,e)],this.data[this._idx(e,-1)]=this.data[this._idx(e,0)],this.data[this._idx(e,s)]=this.data[this._idx(e,s-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(s,-1)]=this.data[this._idx(s-1,0)],this.data[this._idx(-1,s)]=this.data[this._idx(0,s-1)],this.data[this._idx(s,s)]=this.data[this._idx(s-1,s-1)],this.min=2**53-1,this.max=-(2**53-1);for(let e=0;e<s;e++)for(let t=0;t<s;t++){let n=this.get(e,t);n>this.max&&(this.max=n),n<this.min&&(this.min=n)}}get(e,t){let n=new Uint8Array(this.data.buffer),r=4*this._idx(e,t);return this.unpack(n[r],n[r+1],n[r+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw RangeError(`out of range source coordinates for DEM data`);return(t+1)*this.stride+(e+1)}unpack(e,t,n){return e*this.redFactor+t*this.greenFactor+n*this.blueFactor-this.baseShift}getPixels(){return new Cs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,t,n){if(this.dim!==e.dim)throw Error(`dem dimension mismatch`);let r=t*this.dim,i=t*this.dim+this.dim,a=n*this.dim,o=n*this.dim+this.dim;switch(t){case-1:r=i-1;break;case 1:i=r+1}switch(n){case-1:a=o-1;break;case 1:o=a+1}let s=-t*this.dim,c=-n*this.dim;for(let t=a;t<o;t++)for(let n=r;n<i;n++)this.data[this._idx(n,t)]=e.data[this._idx(n+s,t+c)]}}Si(`DEMData`,Pu);class Fu{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let n=e[t];this._stringToNumber[n]=t,this._numberToString[t]=n}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Iu{constructor(e,t,n,r,i){this.type=`Feature`,this._vectorTileFeature=e,e._z=t,e._x=n,e._y=r,this.properties=e.properties,this.id=i}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(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let t in this)t!==`_geometry`&&t!==`_vectorTileFeature`&&(e[t]=this[t]);return e}}class Lu{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new bi(Lo,16,0),this.grid3D=new bi(Lo,16,0),this.featureIndexArray=new Ga,this.promoteId=t}insert(e,t,n,r,i,a){let o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,r,i);let s=a?this.grid3D:this.grid;for(let e=0;e<t.length;e++){let n=t[e],r=[1/0,1/0,-1/0,-1/0];for(let e=0;e<n.length;e++){let t=n[e];r[0]=Math.min(r[0],t.x),r[1]=Math.min(r[1],t.y),r[2]=Math.max(r[2],t.x),r[3]=Math.max(r[3],t.y)}r[0]<Lo&&r[1]<Lo&&r[2]>=0&&r[3]>=0&&s.insert(o,r[0],r[1],r[2],r[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new fc.VectorTile(new Tl(this.rawTileData)).layers,this.sourceLayerCoder=new Fu(this.vtLayers?Object.keys(this.vtLayers).sort():[`_geojsonTileLayer`])),this.vtLayers}query(e,t,n,r){this.loadVTLayers();let i=e.params||{},o=Lo/e.tileSize/e.scale,s=kr(i.filter),c=e.queryGeometry,l=e.queryPadding*o,u=zu(c),d=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),f=zu(e.cameraQueryGeometry),p=this.grid3D.query(f.minX-l,f.minY-l,f.maxX+l,f.maxY+l,(t,n,r,i)=>function(e,t,n,r,i){for(let a of e)if(t<=a.x&&n<=a.y&&r>=a.x&&i>=a.y)return!0;let o=[new a(t,n),new a(t,i),new a(r,i),new a(r,n)];if(e.length>2){for(let t of o)if($o(e,t))return!0}for(let t=0;t<e.length-1;t++)if(es(e[t],e[t+1],o))return!0;return!1}(e.cameraQueryGeometry,t-l,n-l,r+l,i+l));for(let e of p)d.push(e);d.sort(Bu);let m={},h;for(let a=0;a<d.length;a++){let l=d[a];if(l===h)continue;h=l;let u=this.featureIndexArray.get(l),f=null;this.loadMatchingFeature(m,u.bucketIndex,u.sourceLayerIndex,u.featureIndex,s,i.layers,i.availableImages,t,n,r,(t,n,r)=>(f||=Bo(t),n.queryIntersectsFeature(c,t,r,f,this.z,e.transform,o,e.pixelPosMatrix)))}return m}loadMatchingFeature(e,t,n,r,i,a,o,s,c,l,u){let d=this.bucketLayerIDs[t];if(a&&!function(e,t){for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>=0)return!0;return!1}(a,d))return;let f=this.sourceLayerCoder.decode(n),p=this.vtLayers[f].feature(r);if(i.needGeometry){let e=Vo(p,!0);if(!i.filter(new Ui(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!i.filter(new Ui(this.tileID.overscaledZ),p))return;let m=this.getId(p,f);for(let t=0;t<d.length;t++){let n=d[t];if(a&&a.indexOf(n)<0)continue;let i=s[n];if(!i)continue;let f={};m&&l&&(f=l.getState(i.sourceLayer||`_geojsonTileLayer`,m));let h=y({},c[n]);h.paint=Ru(h.paint,i.paint,p,f,o),h.layout=Ru(h.layout,i.layout,p,f,o);let g=!u||u(p,i,f);if(!g)continue;let _=new Iu(p,this.z,this.x,this.y,m);_.layer=h;let v=e[n];v===void 0&&(v=e[n]=[]),v.push({featureIndex:r,feature:_,intersectionZ:g})}}lookupSymbolFeatures(e,t,n,r,i,a,o,s){let c={};this.loadVTLayers();let l=kr(i);for(let i of e)this.loadMatchingFeature(c,n,r,i,l,a,o,s,t);return c}hasLayer(e){for(let t of this.bucketLayerIDs)for(let n of t)if(e===n)return!0;return!1}getId(e,t){let n=e.id;return this.promoteId&&(n=e.properties[typeof this.promoteId==`string`?this.promoteId:this.promoteId[t]],typeof n==`boolean`&&(n=Number(n))),n}}function Ru(e,t,n,r,i){return x(e,(e,a)=>{let o=t instanceof Zi?t.get(a):null;return o&&o.evaluate?o.evaluate(n,r,i):o})}function zu(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);return{minX:t,minY:n,maxX:r,maxY:i}}function Bu(e,t){return t-e}function Vu(e,t,n,r,i){let o=[];for(let s=0;s<e.length;s++){let c=e[s],l;for(let e=0;e<c.length-1;e++){let s=c[e],u=c[e+1];s.x<t&&u.x<t||(s.x<t?s=new a(t,s.y+(t-s.x)/(u.x-s.x)*(u.y-s.y))._round():u.x<t&&(u=new a(t,s.y+(t-s.x)/(u.x-s.x)*(u.y-s.y))._round()),s.y<n&&u.y<n||(s.y<n?s=new a(s.x+(n-s.y)/(u.y-s.y)*(u.x-s.x),n)._round():u.y<n&&(u=new a(s.x+(n-s.y)/(u.y-s.y)*(u.x-s.x),n)._round()),s.x>=r&&u.x>=r||(s.x>=r?s=new a(r,s.y+(r-s.x)/(u.x-s.x)*(u.y-s.y))._round():u.x>=r&&(u=new a(r,s.y+(r-s.x)/(u.x-s.x)*(u.y-s.y))._round()),s.y>=i&&u.y>=i||(s.y>=i?s=new a(s.x+(i-s.y)/(u.y-s.y)*(u.x-s.x),i)._round():u.y>=i&&(u=new a(s.x+(i-s.y)/(u.y-s.y)*(u.x-s.x),i)._round()),l&&s.equals(l[l.length-1])||(l=[s],o.push(l)),l.push(u)))))}}return o}Si(`FeatureIndex`,Lu,{omit:[`rawTileData`,`sourceLayerCoder`]});class Hu extends a{constructor(e,t,n,r){super(e,t),this.angle=n,r!==void 0&&(this.segment=r)}clone(){return new Hu(this.x,this.y,this.angle,this.segment)}}function Uu(e,t,n,r,i){if(t.segment===void 0||n===0)return!0;let a=t,o=t.segment+1,s=0;for(;s>-n/2;){if(o--,o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;let c=[],l=0;for(;s<n/2;){let t=e[o],n=e[o+1];if(!n)return!1;let a=e[o-1].angleTo(t)-t.angleTo(n);for(a=Math.abs((a+3*Math.PI)%(2*Math.PI)-Math.PI),c.push({distance:s,angleDelta:a}),l+=a;s-c[0].distance>r;)l-=c.shift().angleDelta;if(l>i)return!1;o++,s+=t.dist(n)}return!0}function Wu(e){let t=0;for(let n=0;n<e.length-1;n++)t+=e[n].dist(e[n+1]);return t}function Gu(e,t,n){return e?.6*t*n:0}function Ku(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function qu(e,t,n,r,i,a){let o=Gu(n,i,a),s=Ku(n,r)*a,c=0,l=Wu(e)/2;for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1],a=r.dist(i);if(c+a>l){let u=(l-c)/a,d=new Hu(jt.number(r.x,i.x,u),jt.number(r.y,i.y,u),i.angleTo(r),n);return d._round(),!o||Uu(e,d,s,o,t)?d:void 0}c+=a}}function Ju(e,t,n,r,i,a,o,s,c){let l=Gu(r,a,o),u=Ku(r,i),d=u*o,f=e[0].x===0||e[0].x===c||e[0].y===0||e[0].y===c;return t-d<t/4&&(t=d+t/4),Yu(e,f?t/2*s%t:(u/2+2*a)*o*s%t,t,l,n,d,f,!1,c)}function Yu(e,t,n,r,i,a,o,s,c){let l=a/2,u=Wu(e),d=0,f=t-n,p=[];for(let t=0;t<e.length-1;t++){let o=e[t],s=e[t+1],m=o.dist(s),h=s.angleTo(o);for(;f+n<d+m;){f+=n;let g=(f-d)/m,_=jt.number(o.x,s.x,g),v=jt.number(o.y,s.y,g);if(_>=0&&_<c&&v>=0&&v<c&&f-l>=0&&f+l<=u){let n=new Hu(_,v,h,t);n._round(),r&&!Uu(e,n,a,r,i)||p.push(n)}}d+=m}return s||p.length||o||(p=Yu(e,d/2,n,r,i,a,o,!0,c)),p}Si(`Anchor`,Hu);function Xu(e,t,n,r){let i=[],o=e.image,s=o.pixelRatio,c=o.paddedRect.w-2,l=o.paddedRect.h-2,u={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom},d=o.stretchX||[[0,c]],f=o.stretchY||[[0,l]],p=(e,t)=>e+t[1]-t[0],m=d.reduce(p,0),h=f.reduce(p,0),g=c-m,_=l-h,v=0,y=m,b=0,x=h,S=0,C=g,w=0,T=_;if(o.content&&r){let t=o.content,n=t[2]-t[0],r=t[3]-t[1];(o.textFitWidth||o.textFitHeight)&&(u=Jl(e)),v=Zu(d,0,t[0]),b=Zu(f,0,t[1]),y=Zu(d,t[0],t[2]),x=Zu(f,t[1],t[3]),S=t[0]-v,w=t[1]-b,C=n-y,T=r-x}let E=u.x1,D=u.y1,O=u.x2-E,k=u.y2-D,A=(e,r,i,c)=>{let l=$u(e.stretch-v,y,O,E),u=ed(e.fixed-S,C,e.stretch,m),d=$u(r.stretch-b,x,k,D),f=ed(r.fixed-w,T,r.stretch,h),p=$u(i.stretch-v,y,O,E),g=ed(i.fixed-S,C,i.stretch,m),_=$u(c.stretch-b,x,k,D),A=ed(c.fixed-w,T,c.stretch,h),j=new a(l,d),M=new a(p,d),N=new a(p,_),P=new a(l,_),F=new a(u/s,f/s),I=new a(g/s,A/s),L=t*Math.PI/180;if(L){let e=Math.sin(L),t=Math.cos(L),n=[t,-e,e,t];j._matMult(n),M._matMult(n),P._matMult(n),N._matMult(n)}let R=e.stretch+e.fixed,z=r.stretch+r.fixed;return{tl:j,tr:M,bl:P,br:N,tex:{x:o.paddedRect.x+1+R,y:o.paddedRect.y+1+z,w:i.stretch+i.fixed-R,h:c.stretch+c.fixed-z},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:F,pixelOffsetBR:I,minFontScaleX:C/s/O,minFontScaleY:T/s/k,isSDF:n}};if(r&&(o.stretchX||o.stretchY)){let e=Qu(d,g,m),t=Qu(f,_,h);for(let n=0;n<e.length-1;n++){let r=e[n],a=e[n+1];for(let e=0;e<t.length-1;e++)i.push(A(r,t[e],a,t[e+1]))}}else i.push(A({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:c+1},{fixed:0,stretch:l+1}));return i}function Zu(e,t,n){let r=0;for(let i of e)r+=Math.max(t,Math.min(n,i[1]))-Math.max(t,Math.min(n,i[0]));return r}function Qu(e,t,n){let r=[{fixed:-1,stretch:0}];for(let[t,n]of e){let e=r[r.length-1];r.push({fixed:t-e.stretch,stretch:e.stretch}),r.push({fixed:t-e.stretch,stretch:e.stretch+(n-t)})}return r.push({fixed:t+1,stretch:n}),r}function $u(e,t,n,r){return e/t*n+r}function ed(e,t,n,r){return e-t*n/r}class td{constructor(e,t,n,r,i,o,s,c,l,u){var d;if(this.boxStartIndex=e.length,l){let e=o.top,t=o.bottom,n=o.collisionPadding;n&&(e-=n[1],t+=n[3]);let r=t-e;r>0&&(r=Math.max(10,r),this.circleDiameter=r)}else{let l=(d=o.image)!=null&&d.content&&(o.image.textFitWidth||o.image.textFitHeight)?Jl(o):{x1:o.left,y1:o.top,x2:o.right,y2:o.bottom};l.y1=l.y1*s-c[0],l.y2=l.y2*s+c[2],l.x1=l.x1*s-c[3],l.x2=l.x2*s+c[1];let f=o.collisionPadding;if(f&&(l.x1-=f[0]*s,l.y1-=f[1]*s,l.x2+=f[2]*s,l.y2+=f[3]*s),u){let e=new a(l.x1,l.y1),t=new a(l.x2,l.y1),n=new a(l.x1,l.y2),r=new a(l.x2,l.y2),i=u*Math.PI/180;e._rotate(i),t._rotate(i),n._rotate(i),r._rotate(i),l.x1=Math.min(e.x,t.x,n.x,r.x),l.x2=Math.max(e.x,t.x,n.x,r.x),l.y1=Math.min(e.y,t.y,n.y,r.y),l.y2=Math.max(e.y,t.y,n.y,r.y)}e.emplaceBack(t.x,t.y,l.x1,l.y1,l.x2,l.y2,n,r,i)}this.boxEndIndex=e.length}}class nd{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:n}=this,r=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r}_down(e){let{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e<r;){let r=1+(e<<1),a=r+1;if(a<this.length&&n(t[a],t[r])<0&&(r=a),n(t[r],i)>=0)break;t[e]=t[r],e=r}t[e]=i}}function rd(e,t=1,n=!1){let r=1/0,i=1/0,o=-1/0,s=-1/0,c=e[0];for(let e=0;e<c.length;e++){let t=c[e];(!e||t.x<r)&&(r=t.x),(!e||t.y<i)&&(i=t.y),(!e||t.x>o)&&(o=t.x),(!e||t.y>s)&&(s=t.y)}let l=Math.min(o-r,s-i),u=l/2,d=new nd([],id);if(l===0)return new a(r,i);for(let t=r;t<o;t+=l)for(let n=i;n<s;n+=l)d.push(new ad(t+u,n+u,u,e));let f=function(e){let t=0,n=0,r=0,i=e[0];for(let e=0,a=i.length,o=a-1;e<a;o=e++){let a=i[e],s=i[o],c=a.x*s.y-s.x*a.y;n+=(a.x+s.x)*c,r+=(a.y+s.y)*c,t+=3*c}return new ad(n/t,r/t,0,e)}(e),p=d.length;for(;d.length;){let r=d.pop();(r.d>f.d||!f.d)&&(f=r,n&&console.log(`found best %d after %d probes`,Math.round(1e4*r.d)/1e4,p)),r.max-f.d<=t||(u=r.h/2,d.push(new ad(r.p.x-u,r.p.y-u,u,e)),d.push(new ad(r.p.x+u,r.p.y-u,u,e)),d.push(new ad(r.p.x-u,r.p.y+u,u,e)),d.push(new ad(r.p.x+u,r.p.y+u,u,e)),p+=4)}return n&&(console.log(`num probes: ${p}`),console.log(`best distance: ${f.d}`)),f.p}function id(e,t){return t.max-e.max}function ad(e,t,n,r){this.p=new a(e,t),this.h=n,this.d=function(e,t){let n=!1,r=1/0;for(let i=0;i<t.length;i++){let a=t[i];for(let t=0,i=a.length,o=i-1;t<i;o=t++){let i=a[t],s=a[o];i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n),r=Math.min(r,Zo(e,i,s))}}return(n?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}var od;e.aq=void 0,(od=e.aq||={})[od.center=1]=`center`,od[od.left=2]=`left`,od[od.right=3]=`right`,od[od.top=4]=`top`,od[od.bottom=5]=`bottom`,od[od[`top-left`]=6]=`top-left`,od[od[`top-right`]=7]=`top-right`,od[od[`bottom-left`]=8]=`bottom-left`,od[od[`bottom-right`]=9]=`bottom-right`;let sd=1/0;function cd(e,t){return t[1]===sd?function(e,t){let n=0,r=0;t<0&&(t=0);let i=t/Math.SQRT2;switch(e){case`top-right`:case`top-left`:r=i-7;break;case`bottom-right`:case`bottom-left`:r=-i+7;break;case`bottom`:r=-t+7;break;case`top`:r=t-7}switch(e){case`top-right`:case`bottom-right`:n=-i;break;case`top-left`:case`bottom-left`:n=i;break;case`left`:n=t;break;case`right`:n=-t}return[n,r]}(e,t[0]):function(e,t,n){let r=0,i=0;switch(t=Math.abs(t),n=Math.abs(n),e){case`top-right`:case`top-left`:case`top`:i=n-7;break;case`bottom-right`:case`bottom-left`:case`bottom`:i=-n+7}switch(e){case`top-right`:case`bottom-right`:case`right`:r=-t;break;case`top-left`:case`bottom-left`:case`left`:r=t}return[r,i]}(e,t[0],t[1])}function ld(e,t,n){let r=e.layout,i=r.get(`text-variable-anchor-offset`)?.evaluate(t,{},n);if(i){let e=i.values,t=[];for(let n=0;n<e.length;n+=2){let r=t[n]=e[n],i=e[n+1].map(e=>e*tl);r.startsWith(`top`)?i[1]-=7:r.startsWith(`bottom`)&&(i[1]+=7),t[n+1]=i}return new tt(t)}let a=r.get(`text-variable-anchor`);if(a){let i;i=e._unevaluatedLayout.getValue(`text-radial-offset`)===void 0?r.get(`text-offset`).evaluate(t,{},n).map(e=>e*tl):[r.get(`text-radial-offset`).evaluate(t,{},n)*tl,sd];let o=[];for(let e of a)o.push(e,cd(e,i));return new tt(o)}return null}function ud(e){switch(e){case`right`:case`top-right`:case`bottom-right`:return`right`;case`left`:case`top-left`:case`bottom-left`:return`left`}return`center`}function dd(t,n,r,i,a,o,s,c,l,u,d){let f=o.textMaxSize.evaluate(n,{});f===void 0&&(f=s);let p=t.layers[0].layout,m=p.get(`icon-offset`).evaluate(n,{},d),h=pd(r.horizontal),g=s/24,_=t.tilePixelRatio*g,v=t.tilePixelRatio*f/24,y=t.tilePixelRatio*c,b=t.tilePixelRatio*p.get(`symbol-spacing`),x=p.get(`text-padding`)*t.tilePixelRatio,S=function(e,t,n,r=1){let i=e.get(`icon-padding`).evaluate(t,{},n),a=i&&i.values;return[a[0]*r,a[1]*r,a[2]*r,a[3]*r]}(p,n,d,t.tilePixelRatio),C=p.get(`text-max-angle`)/180*Math.PI,w=p.get(`text-rotation-alignment`)!==`viewport`&&p.get(`symbol-placement`)!==`point`,E=p.get(`icon-rotation-alignment`)===`map`&&p.get(`symbol-placement`)!==`point`,D=p.get(`symbol-placement`),O=b/2,k=p.get(`icon-text-fit`),A;i&&k!==`none`&&(t.allowVerticalPlacement&&r.vertical&&(A=Yl(i,r.vertical,k,p.get(`icon-text-fit-padding`),m,g)),h&&(i=Yl(i,h,k,p.get(`icon-text-fit-padding`),m,g)));let j=(c,f)=>{f.x<0||f.x>=Lo||f.y<0||f.y>=Lo||function(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,E){let D=t.addToLineVertexArray(n,r),O,k,A,j,M=0,N=0,P=0,F=0,I=-1,L=-1,R={},z=_o(``);if(t.allowVerticalPlacement&&i.vertical){let e=c.layout.get(`text-rotate`).evaluate(x,{},w)+90;A=new td(l,n,u,d,f,i.vertical,p,m,h,e),s&&(j=new td(l,n,u,d,f,s,_,v,h,e))}if(a){let r=c.layout.get(`icon-rotate`).evaluate(x,{}),i=c.layout.get(`icon-text-fit`)!==`none`,o=Xu(a,r,C,i),p=s?Xu(s,r,C,i):void 0;k=new td(l,n,u,d,f,a,_,v,!1,r),M=4*o.length;let m=t.iconSizeData,h=null;m.kind===`source`?(h=[128*c.layout.get(`icon-size`).evaluate(x,{})],h[0]>Xl&&T(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):m.kind===`composite`&&(h=[128*S.compositeIconSizes[0].evaluate(x,{},w),128*S.compositeIconSizes[1].evaluate(x,{},w)],(h[0]>Xl||h[1]>Xl)&&T(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,o,h,b,y,x,e.ah.none,n,D.lineStartIndex,D.lineLength,-1,w),I=t.icon.placedSymbolArray.length-1,p&&(N=4*p.length,t.addSymbols(t.icon,p,h,b,y,x,e.ah.vertical,n,D.lineStartIndex,D.lineLength,-1,w),L=t.icon.placedSymbolArray.length-1)}let B=Object.keys(i.horizontal);for(let r of B){let a=i.horizontal[r];O||=(z=_o(a.text),new td(l,n,u,d,f,a,p,m,h,c.layout.get(`text-rotate`).evaluate(x,{},w)));let s=a.positionedLines.length===1;if(P+=fd(t,n,a,o,c,h,x,g,D,i.vertical?e.ah.horizontal:e.ah.horizontalOnly,s?B:[r],R,I,S,w),s)break}i.vertical&&(F+=fd(t,n,i.vertical,o,c,h,x,g,D,e.ah.vertical,[`vertical`],R,L,S,w));let V=O?O.boxStartIndex:t.collisionBoxArray.length,H=O?O.boxEndIndex:t.collisionBoxArray.length,U=A?A.boxStartIndex:t.collisionBoxArray.length,W=A?A.boxEndIndex:t.collisionBoxArray.length,G=k?k.boxStartIndex:t.collisionBoxArray.length,K=k?k.boxEndIndex:t.collisionBoxArray.length,q=j?j.boxStartIndex:t.collisionBoxArray.length,J=j?j.boxEndIndex:t.collisionBoxArray.length,Y=-1,X=(e,t)=>e&&e.circleDiameter?Math.max(e.circleDiameter,t):t;Y=X(O,Y),Y=X(A,Y),Y=X(k,Y),Y=X(j,Y);let Z=Y>-1?1:0;Z&&(Y*=E/tl),t.glyphOffsetArray.length>=ou.MAX_GLYPHS&&T(`Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907`),x.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey);let Q=ld(c,x,w),[ee,te]=function(t,n){let r=t.length,i=n?.values;if(i?.length>0)for(let n=0;n<i.length;n+=2){let r=i[n+1];t.emplaceBack(e.aq[i[n]],r[0],r[1])}return[r,t.length]}(t.textAnchorOffsets,Q);t.symbolInstances.emplaceBack(n.x,n.y,R.right>=0?R.right:-1,R.center>=0?R.center:-1,R.left>=0?R.left:-1,R.vertical||-1,I,L,z,V,H,U,W,G,K,q,J,u,P,F,M,N,Z,0,p,Y,ee,te)}(t,f,c,r,i,a,A,t.layers[0],t.collisionBoxArray,n.index,n.sourceLayerIndex,t.index,_,[x,x,x,x],w,l,y,S,E,m,n,o,u,d,s)};if(D===`line`)for(let e of Vu(n.geometry,0,0,Lo,Lo)){let n=Ju(e,b,C,r.vertical||h,i,24,v,t.overscaling,Lo);for(let r of n)h&&md(t,h.text,O,r)||j(e,r)}else if(D===`line-center`){for(let e of n.geometry)if(e.length>1){let t=qu(e,C,r.vertical||h,i,24,v);t&&j(e,t)}}else if(n.type===`Polygon`)for(let e of bn(n.geometry,0)){let t=rd(e,16);j(e[0],new Hu(t.x,t.y,0))}else if(n.type===`LineString`)for(let e of n.geometry)j(e,new Hu(e[0].x,e[0].y,0));else if(n.type===`Point`)for(let e of n.geometry)for(let t of e)j([t],new Hu(t.x,t.y,0))}function fd(e,t,n,r,i,o,s,c,l,u,d,f,p,m,h){let g=function(e,t,n,r,i,o,s,c){let l=r.layout.get(`text-rotate`).evaluate(o,{})*Math.PI/180,u=[];for(let e of t.positionedLines)for(let r of e.positionedGlyphs){if(!r.rect)continue;let o=r.rect||{},d=4,f=!0,p=1,m=0,h=(i||c)&&r.vertical,g=r.metrics.advance*r.scale/2;if(c&&t.verticalizable&&(m=e.lineOffset/2-(r.imageName?-(tl-r.metrics.width*r.scale)/2:(r.scale-1)*tl)),r.imageName){let e=s[r.imageName];f=e.sdf,p=e.pixelRatio,d=1/p}let _=i?[r.x+g,r.y]:[0,0],v=i?[0,0]:[r.x+g+n[0],r.y+n[1]-m],y=[0,0];h&&(y=v,v=[0,0]);let b=r.metrics.isDoubleResolution?2:1,x=(r.metrics.left-d)*r.scale-g+v[0],S=(-r.metrics.top-d)*r.scale+v[1],C=x+o.w/b*r.scale/p,w=S+o.h/b*r.scale/p,T=new a(x,S),E=new a(C,S),D=new a(x,w),O=new a(C,w);if(h){let e=new a(-g,g- -17),t=-Math.PI/2,n=tl/2-g,i=new a(22-n,-(r.imageName?n:0)),o=new a(...y);T._rotateAround(t,e)._add(i)._add(o),E._rotateAround(t,e)._add(i)._add(o),D._rotateAround(t,e)._add(i)._add(o),O._rotateAround(t,e)._add(i)._add(o)}if(l){let e=Math.sin(l),t=Math.cos(l),n=[t,-e,e,t];T._matMult(n),E._matMult(n),D._matMult(n),O._matMult(n)}let k=new a(0,0),A=new a(0,0);u.push({tl:T,tr:E,bl:D,br:O,tex:o,writingMode:t.writingMode,glyphOffset:_,sectionIndex:r.sectionIndex,isSDF:f,pixelOffsetTL:k,pixelOffsetBR:A,minFontScaleX:0,minFontScaleY:0})}return u}(0,n,c,i,o,s,r,e.allowVerticalPlacement),_=e.textSizeData,v=null;_.kind===`source`?(v=[128*i.layout.get(`text-size`).evaluate(s,{})],v[0]>Xl&&T(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):_.kind===`composite`&&(v=[128*m.compositeTextSizes[0].evaluate(s,{},h),128*m.compositeTextSizes[1].evaluate(s,{},h)],(v[0]>Xl||v[1]>Xl)&&T(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),e.addSymbols(e.text,g,v,c,o,s,u,t,l.lineStartIndex,l.lineLength,p,h);for(let t of d)f[t]=e.text.placedSymbolArray.length-1;return 4*g.length}function pd(e){for(let t in e)return e[t];return null}function md(e,t,n,r){let i=e.compareText;if(t in i){let e=i[t];for(let t=e.length-1;t>=0;t--)if(r.dist(e[t])<n)return!0}else i[t]=[];return i[t].push(r),!1}let hd=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class gd{static from(e){if(!(e instanceof ArrayBuffer))throw Error(`Data must be an instance of ArrayBuffer.`);let[t,n]=new Uint8Array(e,0,2);if(t!==219)throw Error(`Data does not appear to be in a KDBush format.`);let r=n>>4;if(r!==1)throw Error(`Got v${r} data when expected v1.`);let i=hd[15&n];if(!i)throw Error(`Unrecognized array type.`);let[a]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new gd(o,a,i,e)}constructor(e,t=64,n=Float64Array,r){if(isNaN(e)||e<0)throw Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let i=hd.indexOf(this.ArrayType),a=2*e*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(i<0)throw Error(`Unexpected typed array class: ${n}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+a+o+s),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return _d(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],c=[];for(;s.length;){let l=s.pop()||0,u=s.pop()||0,d=s.pop()||0;if(u-d<=o){for(let o=d;o<=u;o++){let s=a[2*o],l=a[2*o+1];s>=e&&s<=n&&l>=t&&l<=r&&c.push(i[o])}continue}let f=d+u>>1,p=a[2*f],m=a[2*f+1];p>=e&&p<=n&&m>=t&&m<=r&&c.push(i[f]),(l===0?e<=p:t<=m)&&(s.push(d),s.push(f-1),s.push(1-l)),(l===0?n>=p:r>=m)&&(s.push(f+1),s.push(u),s.push(1-l))}return c}within(e,t,n){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:r,coords:i,nodeSize:a}=this,o=[0,r.length-1,0],s=[],c=n*n;for(;o.length;){let l=o.pop()||0,u=o.pop()||0,d=o.pop()||0;if(u-d<=a){for(let n=d;n<=u;n++)xd(i[2*n],i[2*n+1],e,t)<=c&&s.push(r[n]);continue}let f=d+u>>1,p=i[2*f],m=i[2*f+1];xd(p,m,e,t)<=c&&s.push(r[f]),(l===0?e-n<=p:t-n<=m)&&(o.push(d),o.push(f-1),o.push(1-l)),(l===0?e+n>=p:t+n>=m)&&(o.push(f+1),o.push(u),o.push(1-l))}return s}}function _d(e,t,n,r,i,a){if(i-r<=n)return;let o=r+i>>1;vd(e,t,o,r,i,a),_d(e,t,n,r,o-1,1-a),_d(e,t,n,o+1,i,1-a)}function vd(e,t,n,r,i,a){for(;i>r;){if(i-r>600){let o=i-r+1,s=n-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1);vd(e,t,n,Math.max(r,Math.floor(n-s*l/o+u)),Math.min(i,Math.floor(n+(o-s)*l/o+u)),a)}let o=t[2*n+a],s=r,c=i;for(yd(e,t,r,n),t[2*i+a]>o&&yd(e,t,r,i);s<c;){for(yd(e,t,s,c),s++,c--;t[2*s+a]<o;)s++;for(;t[2*c+a]>o;)c--}t[2*r+a]===o?yd(e,t,r,c):(c++,yd(e,t,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}}function yd(e,t,n,r){bd(e,n,r),bd(t,2*n,2*r),bd(t,2*n+1,2*r+1)}function bd(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function xd(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}var Sd;e.bg=void 0,(Sd=e.bg||={}).create=`create`,Sd.load=`load`,Sd.fullLoad=`fullLoad`;let Cd=null,wd=[],Td=1e3/60,Ed=`loadTime`,Dd=`fullLoadTime`;e.$=class extends pa{},e.A=cs,e.B=gi,e.C=function(e){if(O==null){let t=e.navigator?e.navigator.userAgent:null;O=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match(`Safari`)&&!t.match(`Chrome`)))}return O},e.D=Qi,e.E=q,e.F=class{constructor(e,t){this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new yu(()=>this.process()),this.subscription=function(e,t,n,r){return e.addEventListener(t,n,!1),{unsubscribe:()=>{e.removeEventListener(t,n,!1)}}}(this.target,`message`,e=>this.receive(e)),this.globalScope=D(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}sendAsync(e,t){return new Promise((n,r)=>{let i=Math.round(0xde0b6b3a7640000*Math.random()).toString(36).substring(0,10);this.resolveRejects[i]={resolve:n,reject:r},t&&t.signal.addEventListener(`abort`,()=>{delete this.resolveRejects[i];let t={id:i,type:`<cancel>`,origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(t)},{once:!0});let a=[],o=Object.assign(Object.assign({},e),{id:i,sourceMapId:this.mapId,origin:location.origin,data:Ei(e.data,a)});this.target.postMessage(o,{transfer:a})})}receive(e){let t=e.data,n=t.id;if(!(t.origin!==`file://`&&location.origin!==`file://`&&t.origin!==`resource://android`&&location.origin!==`resource://android`&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type===`<cancel>`){delete this.tasks[n];let e=this.abortControllers[n];delete this.abortControllers[n],e&&e.abort();return}if(D(self)||t.mustQueue)return this.tasks[n]=t,this.taskQueue.push(n),void this.invoker.trigger();this.processTask(n,t)}}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}processTask(e,n){return t(this,void 0,void 0,function*(){if(n.type===`<response>`){let t=this.resolveRejects[e];delete this.resolveRejects[e],t&&(n.error?t.reject(Di(n.error)):t.resolve(Di(n.data)));return}if(!this.messageHandlers[n.type])return void this.completeTask(e,Error(`Could not find a registered handler for ${n.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(`, `)}`));let t=Di(n.data),r=new AbortController;this.abortControllers[e]=r;try{let i=yield this.messageHandlers[n.type](n.sourceMapId,t,r);this.completeTask(e,null,i)}catch(t){this.completeTask(e,t)}})}completeTask(e,t,n){let r=[];delete this.abortControllers[e];let i={id:e,type:`<response>`,sourceMapId:this.mapId,origin:location.origin,error:t?Ei(t):null,data:Ei(n,r)};this.target.postMessage(i,{transfer:r})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=R,e.H=function(){var e=new cs(16);return cs!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.I=Al,e.J=function(e,t,n){var r,i,a,o,s,c,l,u,d,f,p,m,h=n[0],g=n[1],_=n[2];return t===e?(e[12]=t[0]*h+t[4]*g+t[8]*_+t[12],e[13]=t[1]*h+t[5]*g+t[9]*_+t[13],e[14]=t[2]*h+t[6]*g+t[10]*_+t[14],e[15]=t[3]*h+t[7]*g+t[11]*_+t[15]):(i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],e[0]=r=t[0],e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=c,e[6]=l,e[7]=u,e[8]=d,e[9]=f,e[10]=p,e[11]=m,e[12]=r*h+s*g+d*_+t[12],e[13]=i*h+c*g+f*_+t[13],e[14]=a*h+l*g+p*_+t[14],e[15]=o*h+u*g+m*_+t[15]),e},e.K=function(e,t,n){var r=n[0],i=n[1],a=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.L=us,e.M=function(e,t){let n={};for(let r=0;r<t.length;r++){let i=t[r];i in e&&(n[i]=e[i])}return n},e.N=xu,e.O=wu,e.P=a,e.Q=Tu,e.R=Cs,e.S=Mu,e.T=Ki,e.U=p,e.V=m,e.W=j,e.X=Lo,e.Y=la,e.Z=Ou,e._=t,e.a=I,e.a$=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],d=e[9],f=e[10],p=e[11],m=e[12],h=e[13],g=e[14],_=e[15],v=t[0],y=t[1],b=t[2],x=t[3],S=t[4],C=t[5],w=t[6],T=t[7],E=t[8],D=t[9],O=t[10],k=t[11],A=t[12],j=t[13],M=t[14],N=t[15];return Math.abs(n-v)<=ss*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-y)<=ss*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-b)<=ss*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-x)<=ss*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-S)<=ss*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(s-C)<=ss*Math.max(1,Math.abs(s),Math.abs(C))&&Math.abs(c-w)<=ss*Math.max(1,Math.abs(c),Math.abs(w))&&Math.abs(l-T)<=ss*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(u-E)<=ss*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(d-D)<=ss*Math.max(1,Math.abs(d),Math.abs(D))&&Math.abs(f-O)<=ss*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(p-k)<=ss*Math.max(1,Math.abs(p),Math.abs(k))&&Math.abs(m-A)<=ss*Math.max(1,Math.abs(m),Math.abs(A))&&Math.abs(h-j)<=ss*Math.max(1,Math.abs(h),Math.abs(j))&&Math.abs(g-M)<=ss*Math.max(1,Math.abs(g),Math.abs(M))&&Math.abs(_-N)<=ss*Math.max(1,Math.abs(_),Math.abs(N))},e.a0=so,e.a1=Au,e.a2=se,e.a3=e=>{let t=window.document.createElement(`video`);return t.muted=!0,new Promise(n=>{t.onloadstart=()=>{n(t)};for(let n of e){let e=window.document.createElement(`source`);H(n)||(t.crossOrigin=`Anonymous`),e.src=n,t.appendChild(e)}})},e.a4=function(){return b++},e.a5=Fa,e.a6=ou,e.a7=kr,e.a8=Vo,e.a9=Iu,e.aA=function(e){if(e.type===`custom`)return new vu(e);switch(e.type){case`background`:return new mu(e);case`circle`:return new ms(e);case`fill`:return new cc(e);case`fill-extrusion`:return new Mc(e);case`heatmap`:return new Es(e);case`hillshade`:return new ks(e);case`line`:return new Kc(e);case`raster`:return new _u(e);case`symbol`:return new du(e)}},e.aB=C,e.aC=function(e,t){if(!e)return[{command:`setStyle`,args:[t]}];let n=[];try{if(!Z(e.version,t.version))return[{command:`setStyle`,args:[t]}];Z(e.center,t.center)||n.push({command:`setCenter`,args:[t.center]}),Z(e.zoom,t.zoom)||n.push({command:`setZoom`,args:[t.zoom]}),Z(e.bearing,t.bearing)||n.push({command:`setBearing`,args:[t.bearing]}),Z(e.pitch,t.pitch)||n.push({command:`setPitch`,args:[t.pitch]}),Z(e.sprite,t.sprite)||n.push({command:`setSprite`,args:[t.sprite]}),Z(e.glyphs,t.glyphs)||n.push({command:`setGlyphs`,args:[t.glyphs]}),Z(e.transition,t.transition)||n.push({command:`setTransition`,args:[t.transition]}),Z(e.light,t.light)||n.push({command:`setLight`,args:[t.light]}),Z(e.terrain,t.terrain)||n.push({command:`setTerrain`,args:[t.terrain]}),Z(e.sky,t.sky)||n.push({command:`setSky`,args:[t.sky]}),Z(e.projection,t.projection)||n.push({command:`setProjection`,args:[t.projection]});let r={},i=[];(function(e,t,n,r){let i;for(i in t||={},e||={})Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(t,i)||te(i,n,r));for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)?Z(e[i],t[i])||(e[i].type===`geojson`&&t[i].type===`geojson`&&re(e,t,i)?Q(n,{command:`setGeoJSONSourceData`,args:[i,t[i].data]}):ne(i,t,n,r)):ee(i,t,n))})(e.sources,t.sources,i,r);let a=[];e.layers&&e.layers.forEach(e=>{`source`in e&&r[e.source]?n.push({command:`removeLayer`,args:[e.id]}):a.push(e)}),n=n.concat(i),function(e,t,n){t||=[];let r=(e||=[]).map(ae),i=t.map(ae),a=e.reduce(oe,{}),o=t.reduce(oe,{}),s=r.slice(),c=Object.create(null),l,u,d,f,p;for(let e=0,t=0;e<r.length;e++)l=r[e],Object.prototype.hasOwnProperty.call(o,l)?t++:(Q(n,{command:`removeLayer`,args:[l]}),s.splice(s.indexOf(l,t),1));for(let e=0,t=0;e<i.length;e++)l=i[i.length-1-e],s[s.length-1-e]!==l&&(Object.prototype.hasOwnProperty.call(a,l)?(Q(n,{command:`removeLayer`,args:[l]}),s.splice(s.lastIndexOf(l,s.length-t),1)):t++,f=s[s.length-e],Q(n,{command:`addLayer`,args:[o[l],f]}),s.splice(s.length-e,0,l),c[l]=!0);for(let e=0;e<i.length;e++)if(l=i[e],u=a[l],d=o[l],!c[l]&&!Z(u,d))if(Z(u.source,d.source)&&Z(u[`source-layer`],d[`source-layer`])&&Z(u.type,d.type)){for(p in ie(u.layout,d.layout,n,l,null,`setLayoutProperty`),ie(u.paint,d.paint,n,l,null,`setPaintProperty`),Z(u.filter,d.filter)||Q(n,{command:`setFilter`,args:[l,d.filter]}),Z(u.minzoom,d.minzoom)&&Z(u.maxzoom,d.maxzoom)||Q(n,{command:`setLayerZoomRange`,args:[l,d.minzoom,d.maxzoom]}),u)Object.prototype.hasOwnProperty.call(u,p)&&p!==`layout`&&p!==`paint`&&p!==`filter`&&p!==`metadata`&&p!==`minzoom`&&p!==`maxzoom`&&(p.indexOf(`paint.`)===0?ie(u[p],d[p],n,l,p.slice(6),`setPaintProperty`):Z(u[p],d[p])||Q(n,{command:`setLayerProperty`,args:[l,p,d[p]]}));for(p in d)Object.prototype.hasOwnProperty.call(d,p)&&!Object.prototype.hasOwnProperty.call(u,p)&&p!==`layout`&&p!==`paint`&&p!==`filter`&&p!==`metadata`&&p!==`minzoom`&&p!==`maxzoom`&&(p.indexOf(`paint.`)===0?ie(u[p],d[p],n,l,p.slice(6),`setPaintProperty`):Z(u[p],d[p])||Q(n,{command:`setLayerProperty`,args:[l,p,d[p]]}))}else Q(n,{command:`removeLayer`,args:[l]}),f=s[s.lastIndexOf(l)+1],Q(n,{command:`addLayer`,args:[d,f]})}(a,t.layers,n)}catch(e){console.warn(`Unable to compute style diff:`,e),n=[{command:`setStyle`,args:[t]}]}return n},e.aD=function(e){let t=[],n=e.id;return n===void 0&&t.push({message:`layers.${n}: missing required property "id"`}),e.render===void 0&&t.push({message:`layers.${n}: missing required method "render"`}),e.renderingMode&&e.renderingMode!==`2d`&&e.renderingMode!==`3d`&&t.push({message:`layers.${n}: property "renderingMode" must be either "2d" or "3d"`}),t},e.aE=function e(t,n){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],n[r]))return!1;return!0}if(typeof t==`object`&&t&&n!==null){if(typeof n!=`object`||Object.keys(t).length!==Object.keys(n).length)return!1;for(let r in t)if(!e(t[r],n[r]))return!1;return!0}return t===n},e.aF=x,e.aG=S,e.aH=class extends So{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}},e.aI=Co,e.aJ=class extends So{constructor(e,t){super(e,t),this.current=Eo}set(e){if(e[12]!==this.current[12]||e[0]!==this.current[0])return this.current=e,void this.gl.uniformMatrix4fv(this.location,!1,e);for(let t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}}},e.aK=wo,e.aL=To,e.aM=Ye,e.aN=class extends So{constructor(e,t){super(e,t),this.current=[0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]||(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}},e.aO=class extends So{constructor(e,t){super(e,t),this.current=[0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]||(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}},e.aP=function(e,t,n,r,i,a,o){var s=1/(t-n),c=1/(r-i),l=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*c,e[14]=(o+a)*l,e[15]=1,e},e.aQ=fs,e.aR=class extends Ca{},e.aS=Qc,e.aT=class extends Ta{},e.aU=Ts,e.aV=function(e){return e<=1?1:2**Math.ceil(Math.log(e)/Math.LN2)},e.aW=ws,e.aX=Ka,e.aY=io,e.aZ=class extends Ma{},e.a_=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},e.aa=function(e){let t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(e,n,r,i)=>{let a=r||i;return t[n]=!a||a.toLowerCase(),``}),t[`max-age`]){let e=parseInt(t[`max-age`],10);isNaN(e)?delete t[`max-age`]:t[`max-age`]=e}return t},e.ab=function(e,t){let n=[];for(let r in e)r in t||n.push(r);return n},e.ac=_,e.ad=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[4],u=t[5],d=t[6],f=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+l*r,e[1]=o*i+u*r,e[2]=s*i+d*r,e[3]=c*i+f*r,e[4]=l*i-a*r,e[5]=u*i-o*r,e[6]=d*i-s*r,e[7]=f*i-c*r,e},e.ae=function(e){var t=new cs(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.af=ps,e.ag=function(e,t){let n=0,r=0;if(e.kind===`constant`)r=e.layoutSize;else if(e.kind!==`source`){let{interpolationType:i,minZoom:a,maxZoom:o}=e,s=i?_(Mt.interpolationFactor(i,t,a,o),0,1):0;e.kind===`camera`?r=jt.number(e.minSize,e.maxSize,s):n=s}return{uSizeT:n,uSize:r}},e.ai=function(e,{uSize:t,uSizeT:n},{lowerSize:r,upperSize:i}){return e.kind===`source`?r/128:e.kind===`composite`?jt.number(r/128,i/128,n):t},e.aj=nu,e.ak=function(e,t,n,r){let i=t.y-e.y,o=t.x-e.x,s=r.y-n.y,c=r.x-n.x,l=s*o-c*i;if(l===0)return null;let u=(c*(e.y-n.y)-s*(e.x-n.x))/l;return new a(e.x+u*o,e.y+u*i)},e.al=Vu,e.am=Wo,e.an=ls,e.ao=function(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);return[t,n,r,i]},e.ap=tl,e.ar=Ql,e.as=function(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14],_=t[15],v=n*s-r*o,y=n*c-i*o,b=n*l-a*o,x=r*c-i*s,S=r*l-a*s,C=i*l-a*c,w=u*h-d*m,T=u*g-f*m,E=u*_-p*m,D=d*g-f*h,O=d*_-p*h,k=f*_-p*g,A=v*k-y*O+b*D+x*E-S*T+C*w;return A?(e[0]=(s*k-c*O+l*D)*(A=1/A),e[1]=(i*O-r*k-a*D)*A,e[2]=(h*C-g*S+_*x)*A,e[3]=(f*S-d*C-p*x)*A,e[4]=(c*E-o*k-l*T)*A,e[5]=(n*k-i*E+a*T)*A,e[6]=(g*b-m*C-_*y)*A,e[7]=(u*C-f*b+p*y)*A,e[8]=(o*O-s*E+l*w)*A,e[9]=(r*E-n*O-a*w)*A,e[10]=(m*S-h*b+_*v)*A,e[11]=(d*b-u*S-p*v)*A,e[12]=(s*T-o*D-c*w)*A,e[13]=(n*D-r*T+i*w)*A,e[14]=(h*y-m*x-g*v)*A,e[15]=(u*x-d*y+f*v)*A,e):null},e.at=ud,e.au=Gl,e.av=gd,e.aw=function(){let e={},t=J.$version;for(let n in J.$root){let r=J.$root[n];if(r.required){let i=null;i=n===`version`?t:r.type===`array`?[]:{},i!=null&&(e[n]=i)}}return e},e.ax=Oi,e.ay=B,e.az=function(e){e=e.slice();let t=Object.create(null);for(let n=0;n<e.length;n++)t[e[n].id]=e[n];for(let n=0;n<e.length;n++)`ref`in e[n]&&(e[n]=X(e[n],t[e[n].ref]));return e},e.b=k,e.b0=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.b1=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e},e.b2=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},e.b3=v,e.b4=ju,e.b5=Eu,e.b6=function(e,t,n,r,i){var a,o=1/Math.tan(t/2);return e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(e[10]=(i+r)*(a=1/(r-i)),e[14]=2*i*r*a):(e[10]=-1,e[14]=-2*r),e},e.b7=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+l*r,e[5]=o*i+u*r,e[6]=s*i+d*r,e[7]=c*i+f*r,e[8]=l*i-a*r,e[9]=u*i-o*r,e[10]=d*i-s*r,e[11]=f*i-c*r,e},e.b8=h,e.b9=g,e.bA=nl,e.bB=function(e){return e.message===P},e.bC=xr,e.bD=Hi,e.ba=function(e){return e*Math.PI/180},e.bb=function(e,t){let{x:n,y:r}=Ou.fromLngLat(t);return!(e<0||e>25||r<0||r>=1||n<0||n>=1)},e.bc=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.bd=class extends fa{},e.be=bu,e.bf={mark(e){performance.mark(e)},frame(e){let t=e;Cd!=null&&wd.push(t-Cd),Cd=t},clearMetrics(){Cd=null,wd=[],performance.clearMeasures(Ed),performance.clearMeasures(Dd);for(let t in e.bg)performance.clearMarks(e.bg[t])},getPerformanceMetrics(){performance.measure(Ed,e.bg.create,e.bg.load),performance.measure(Dd,e.bg.create,e.bg.fullLoad);let t=performance.getEntriesByName(Ed)[0].duration,n=performance.getEntriesByName(Dd)[0].duration,r=wd.length,i=1/(wd.reduce((e,t)=>e+t,0)/r/1e3),a=wd.filter(e=>e>Td).reduce((e,t)=>e+(t-Td)/Td,0);return{loadTime:t,fullLoadTime:n,fps:i,percentDroppedFrames:a/(r+a)*100,totalFrames:r}}},e.bh=z,e.bi=function(e,t){I.REGISTERED_PROTOCOLS[e]=t},e.bj=function(e){delete I.REGISTERED_PROTOCOLS[e]},e.bk=function(e,t){let n={};for(let r=0;r<e.length;r++){let i=t&&t[e[r].id]||Rr(e[r]);t&&(t[e[r].id]=i);let a=n[i];a||=n[i]=[],a.push(e[r])}let r=[];for(let e in n)r.push(n[e]);return r},e.bl=Si,e.bm=Fu,e.bn=Lu,e.bo=jl,e.bp=function(t){t.bucket.createArrays(),t.bucket.tilePixelRatio=Lo/(512*t.bucket.overscaling),t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let n=t.bucket.layers[0],r=n.layout,i=n._unevaluatedLayout._values,a={layoutIconSize:i[`icon-size`].possiblyEvaluate(new Ui(t.bucket.zoom+1),t.canonical),layoutTextSize:i[`text-size`].possiblyEvaluate(new Ui(t.bucket.zoom+1),t.canonical),textMaxSize:i[`text-size`].possiblyEvaluate(new Ui(18))};if(t.bucket.textSizeData.kind===`composite`){let{minZoom:e,maxZoom:n}=t.bucket.textSizeData;a.compositeTextSizes=[i[`text-size`].possiblyEvaluate(new Ui(e),t.canonical),i[`text-size`].possiblyEvaluate(new Ui(n),t.canonical)]}if(t.bucket.iconSizeData.kind===`composite`){let{minZoom:e,maxZoom:n}=t.bucket.iconSizeData;a.compositeIconSizes=[i[`icon-size`].possiblyEvaluate(new Ui(e),t.canonical),i[`icon-size`].possiblyEvaluate(new Ui(n),t.canonical)]}let o=r.get(`text-line-height`)*tl,s=r.get(`text-rotation-alignment`)!==`viewport`&&r.get(`symbol-placement`)!==`point`,c=r.get(`text-keep-upright`),l=r.get(`text-size`);for(let i of t.bucket.features){let u=r.get(`text-font`).evaluate(i,{},t.canonical).join(`,`),d=l.evaluate(i,{},t.canonical),f=a.layoutTextSize.evaluate(i,{},t.canonical),p=a.layoutIconSize.evaluate(i,{},t.canonical),m={horizontal:{},vertical:void 0},h=i.text,g,_=[0,0];if(h){let a=h.toString(),l=r.get(`text-letter-spacing`).evaluate(i,{},t.canonical)*tl,p=ji(a)?l:0,g=r.get(`text-anchor`).evaluate(i,{},t.canonical),v=ld(n,i,t.canonical);if(!v){let e=r.get(`text-radial-offset`).evaluate(i,{},t.canonical);_=e?cd(g,[e*tl,sd]):r.get(`text-offset`).evaluate(i,{},t.canonical).map(e=>e*tl)}let y=s?`center`:r.get(`text-justify`).evaluate(i,{},t.canonical),b=r.get(`symbol-placement`)===`point`?r.get(`text-max-width`).evaluate(i,{},t.canonical)*tl:1/0,x=()=>{t.bucket.allowVerticalPlacement&&Ai(a)&&(m.vertical=Fl(h,t.glyphMap,t.glyphPositions,t.imagePositions,u,b,o,g,`left`,p,_,e.ah.vertical,!0,f,d))};if(!s&&v){let n=new Set;if(y===`auto`)for(let e=0;e<v.values.length;e+=2)n.add(ud(v.values[e]));else n.add(y);let r=!1;for(let i of n)if(!m.horizontal[i])if(r)m.horizontal[i]=m.horizontal[0];else{let n=Fl(h,t.glyphMap,t.glyphPositions,t.imagePositions,u,b,o,`center`,i,p,_,e.ah.horizontal,!1,f,d);n&&(m.horizontal[i]=n,r=n.positionedLines.length===1)}x()}else{y===`auto`&&(y=ud(g));let n=Fl(h,t.glyphMap,t.glyphPositions,t.imagePositions,u,b,o,g,y,p,_,e.ah.horizontal,!1,f,d);n&&(m.horizontal[y]=n),x(),Ai(a)&&s&&c&&(m.vertical=Fl(h,t.glyphMap,t.glyphPositions,t.imagePositions,u,b,o,g,y,p,_,e.ah.vertical,!1,f,d))}}let v=!1;if(i.icon&&i.icon.name){let e=t.imageMap[i.icon.name];e&&(g=ql(t.imagePositions[i.icon.name],r.get(`icon-offset`).evaluate(i,{},t.canonical),r.get(`icon-anchor`).evaluate(i,{},t.canonical)),v=!!e.sdf,t.bucket.sdfIcons===void 0?t.bucket.sdfIcons=v:t.bucket.sdfIcons!==v&&T(`Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer`),(e.pixelRatio!==t.bucket.pixelRatio||r.get(`icon-rotate`).constantOr(1)!==0)&&(t.bucket.iconsNeedLinear=!0))}let y=pd(m.horizontal)||m.vertical;t.bucket.iconsInText=!!y&&y.iconsInText,(y||g)&&dd(t.bucket,i,m,g,t.imageMap,a,f,p,_,v,t.canonical)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()},e.bq=Bc,e.br=ic,e.bs=Dc,e.bt=fc,e.bu=Tl,e.bv=class{constructor(e){this._marks={start:[e.url,`start`].join(`#`),end:[e.url,`end`].join(`#`),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return e.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}},e.bw=function(e,n,r,i,a){return t(this,void 0,void 0,function*(){if(m())try{return yield j(e,n,r,i,a)}catch{}return function(e,t,n,r,i){let a=e.width,o=e.height;M&&N||(M=new OffscreenCanvas(a,o),N=M.getContext(`2d`,{willReadFrequently:!0})),M.width=a,M.height=o,N.drawImage(e,0,0,a,o);let s=N.getImageData(t,n,r,i);return N.clearRect(0,0,a,o),s.data}(e,n,r,i,a)})},e.bx=Pu,e.by=n,e.bz=r,e.c=F,e.d=e=>t(void 0,void 0,void 0,function*(){if(e.byteLength===0)return createImageBitmap(new ImageData(1,1));let t=new Blob([new Uint8Array(e)],{type:`image/png`});try{return createImageBitmap(t)}catch(e){throw Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),e.e=y,e.f=e=>new Promise((t,n)=>{let r=new Image;r.onload=()=>{t(r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=A})},r.onerror=()=>n(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 i=new Blob([new Uint8Array(e)],{type:`image/png`});r.src=e.byteLength?URL.createObjectURL(i):A}),e.g=L,e.h=(e,t)=>V(y(e,{type:`json`}),t),e.i=D,e.j=K,e.k=G,e.l=(e,t)=>V(y(e,{type:`arrayBuffer`}),t),e.m=V,e.n=function(e){return new Tl(e).readFields(El,[])},e.o=Ss,e.p=kl,e.q=ra,e.r=hi,e.s=H,e.t=yi,e.u=mi,e.v=J,e.w=T,e.x=function([e,t,n]){return t+=90,t*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(t)*Math.sin(n),y:e*Math.sin(t)*Math.sin(n),z:e*Math.cos(n)}},e.y=jt,e.z=Ui}),n(`worker`,[`./shared`],function(e){class t{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(t,n){for(let n of t){this._layerConfigs[n.id]=n;let t=this._layers[n.id]=e.aA(n);t._featureFilter=e.a7(t.filter),this.keyCache[n.id]&&delete this.keyCache[n.id]}for(let e of n)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};let r=e.bk(Object.values(this._layerConfigs),this.keyCache);for(let e of r){let t=e.map(e=>this._layers[e.id]),n=t[0];if(n.visibility===`none`)continue;let r=n.source||``,i=this.familiesBySource[r];i||=this.familiesBySource[r]={};let a=n.sourceLayer||`_geojsonTileLayer`,o=i[a];o||=i[a]=[],o.push(t)}}}class n{constructor(t){let n={},r=[];for(let e in t){let i=t[e],a=n[e]={};for(let e in i){let t=i[+e];if(!t||t.bitmap.width===0||t.bitmap.height===0)continue;let n={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};r.push(n),a[e]={rect:n,metrics:t.metrics}}}let{w:i,h:a}=e.p(r),o=new e.o({width:i||1,height:a||1});for(let r in t){let i=t[r];for(let t in i){let a=i[+t];if(!a||a.bitmap.width===0||a.bitmap.height===0)continue;let s=n[r][t].rect;e.o.copy(a.bitmap,o,{x:0,y:0},{x:s.x+1,y:s.y+1},a.bitmap)}}this.image=o,this.positions=n}}e.bl(`GlyphAtlas`,n);class r{constructor(t){this.tileID=new e.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,r,a,o){return e._(this,void 0,void 0,function*(){this.status=`parsing`,this.data=t,this.collisionBoxArray=new e.a5;let s=new e.bm(Object.keys(t.layers).sort()),c=new e.bn(this.tileID,this.promoteId);c.bucketLayerIDs=[];let l={},u={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:a},d=r.familiesBySource[this.source];for(let n in d){let r=t.layers[n];if(!r)continue;r.version===1&&e.w(`Vector tile source "${this.source}" layer "${n}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let o=s.encode(n),f=[];for(let e=0;e<r.length;e++){let t=r.feature(e),i=c.getId(t,n);f.push({feature:t,id:i,index:e,sourceLayerIndex:o})}for(let t of d[n]){let n=t[0];n.source!==this.source&&e.w(`layer.source = ${n.source} does not equal this.source = ${this.source}`),n.minzoom&&this.zoom<Math.floor(n.minzoom)||n.maxzoom&&this.zoom>=n.maxzoom||n.visibility!==`none`&&(i(t,this.zoom,a),(l[n.id]=n.createBucket({index:c.bucketLayerIDs.length,layers:t,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:o,sourceID:this.source})).populate(f,u,this.tileID.canonical),c.bucketLayerIDs.push(t.map(e=>e.id)))}}let f=e.aF(u.glyphDependencies,e=>Object.keys(e).map(Number));this.inFlightDependencies.forEach(e=>e?.abort()),this.inFlightDependencies=[];let p=Promise.resolve({});if(Object.keys(f).length){let e=new AbortController;this.inFlightDependencies.push(e),p=o.sendAsync({type:`GG`,data:{stacks:f,source:this.source,tileID:this.tileID,type:`glyphs`}},e)}let m=Object.keys(u.iconDependencies),h=Promise.resolve({});if(m.length){let e=new AbortController;this.inFlightDependencies.push(e),h=o.sendAsync({type:`GI`,data:{icons:m,source:this.source,tileID:this.tileID,type:`icons`}},e)}let g=Object.keys(u.patternDependencies),_=Promise.resolve({});if(g.length){let e=new AbortController;this.inFlightDependencies.push(e),_=o.sendAsync({type:`GI`,data:{icons:g,source:this.source,tileID:this.tileID,type:`patterns`}},e)}let[v,y,b]=yield Promise.all([p,h,_]),x=new n(v),S=new e.bo(y,b);for(let t in l){let n=l[t];n instanceof e.a6?(i(n.layers,this.zoom,a),e.bp({bucket:n,glyphMap:v,glyphPositions:x.positions,imageMap:y,imagePositions:S.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):n.hasPattern&&(n instanceof e.bq||n instanceof e.br||n instanceof e.bs)&&(i(n.layers,this.zoom,a),n.addFeatures(u,this.tileID.canonical,S.patternPositions))}return this.status=`done`,{buckets:Object.values(l).filter(e=>!e.isEmpty()),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:x.image,imageAtlas:S,glyphMap:this.returnDependencies?v:null,iconMap:this.returnDependencies?y:null,glyphPositions:this.returnDependencies?x.positions:null}})}}function i(t,n,r){let i=new e.z(n);for(let e of t)e.recalculate(i,r)}class a{constructor(e,t,n){this.actor=e,this.layerIndex=t,this.availableImages=n,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(t,n){return e._(this,void 0,void 0,function*(){let r=yield e.l(t.request,n);try{return{vectorTile:new e.bt.VectorTile(new e.bu(r.data)),rawData:r.data,cacheControl:r.cacheControl,expires:r.expires}}catch(e){let n=new Uint8Array(r.data),i=`Unable to parse the tile at ${t.request.url}, `;throw i+=n[0]===31&&n[1]===139?`please make sure the data is not gzipped and that you have configured the relevant header in the server`:`got error: ${e.message}`,Error(i)}})}loadTile(t){return e._(this,void 0,void 0,function*(){let n=t.uid,i=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.bv(t.request),a=new r(t);this.loading[n]=a;let o=new AbortController;a.abort=o;try{let r=yield this.loadVectorTile(t,o);if(delete this.loading[n],!r)return null;let s=r.rawData,c={};r.expires&&(c.expires=r.expires),r.cacheControl&&(c.cacheControl=r.cacheControl);let l={};if(i){let e=i.finish();e&&(l.resourceTiming=JSON.parse(JSON.stringify(e)))}a.vectorTile=r.vectorTile;let u=a.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[n]=a,this.fetching[n]={rawTileData:s,cacheControl:c,resourceTiming:l};try{let t=yield u;return e.e({rawTileData:s.slice(0)},t,c,l)}finally{delete this.fetching[n]}}catch(e){throw delete this.loading[n],a.status=`done`,this.loaded[n]=a,e}})}reloadTile(t){return e._(this,void 0,void 0,function*(){let n=t.uid;if(!this.loaded||!this.loaded[n])throw Error(`Should not be trying to reload a tile that was never loaded or has been removed`);let r=this.loaded[n];if(r.showCollisionBoxes=t.showCollisionBoxes,r.status===`parsing`){let t=yield r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor),i;if(this.fetching[n]){let{rawTileData:r,cacheControl:a,resourceTiming:o}=this.fetching[n];delete this.fetching[n],i=e.e({rawTileData:r.slice(0)},t,a,o)}else i=t;return i}if(r.status===`done`&&r.vectorTile)return r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(t){return e._(this,void 0,void 0,function*(){let e=this.loading,n=t.uid;e&&e[n]&&e[n].abort&&(e[n].abort.abort(),delete e[n])})}removeTile(t){return e._(this,void 0,void 0,function*(){this.loaded&&this.loaded[t.uid]&&delete this.loaded[t.uid]})}}class o{constructor(){this.loaded={}}loadTile(t){return e._(this,void 0,void 0,function*(){let{uid:n,encoding:r,rawImageData:i,redFactor:a,greenFactor:o,blueFactor:s,baseShift:c}=t,l=i.width+2,u=i.height+2,d=e.b(i)?new e.R({width:l,height:u},yield e.bw(i,-1,-1,l,u)):i,f=new e.bx(n,d,r,a,o,s,c);return this.loaded=this.loaded||{},this.loaded[n]=f,f})}removeTile(e){let t=this.loaded,n=e.uid;t&&t[n]&&delete t[n]}}function s(e,t){if(e.length!==0){c(e[0],t);for(var n=1;n<e.length;n++)c(e[n],!t)}}function c(e,t){for(var n=0,r=0,i=0,a=e.length,o=a-1;i<a;o=i++){var s=(e[i][0]-e[o][0])*(e[o][1]+e[i][1]),c=n+s;r+=Math.abs(n)>=Math.abs(s)?n-c+s:s-c+n,n=c}n+r>=0!=!!t&&e.reverse()}var l=e.by(function e(t,n){var r,i=t&&t.type;if(i===`FeatureCollection`)for(r=0;r<t.features.length;r++)e(t.features[r],n);else if(i===`GeometryCollection`)for(r=0;r<t.geometries.length;r++)e(t.geometries[r],n);else if(i===`Feature`)e(t.geometry,n);else if(i===`Polygon`)s(t.coordinates,n);else if(i===`MultiPolygon`)for(r=0;r<t.coordinates.length;r++)s(t.coordinates[r],n);return t});let u=e.bt.VectorTileFeature.prototype.toGeoJSON;var d={exports:{}},f=e.bz,p=e.bt.VectorTileFeature,m=h;function h(e,t){this.options=t||{},this.features=e,this.length=e.length}function g(e,t){this.id=typeof e.id==`number`?e.id:void 0,this.type=e.type,this.rawGeometry=e.type===1?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}h.prototype.feature=function(e){return new g(this.features[e],this.options.extent)},g.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var n=e[t],r=[],i=0;i<n.length;i++)r.push(new f(n[i][0],n[i][1]));this.geometry.push(r)}return this.geometry},g.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,n=-1/0,r=1/0,i=-1/0,a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var c=o[s];t=Math.min(t,c.x),n=Math.max(n,c.x),r=Math.min(r,c.y),i=Math.max(i,c.y)}return[t,r,n,i]},g.prototype.toGeoJSON=p.prototype.toGeoJSON;var _=e.bA,v=m;function y(e){var t=new _;return function(e,t){for(var n in e.layers)t.writeMessage(3,b,e.layers[n])}(e,t),t.finish()}function b(e,t){var n;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||``),t.writeVarintField(5,e.extent||4096);var r={keys:[],values:[],keycache:{},valuecache:{}};for(n=0;n<e.length;n++)r.feature=e.feature(n),t.writeMessage(2,x,r);var i=r.keys;for(n=0;n<i.length;n++)t.writeStringField(3,i[n]);var a=r.values;for(n=0;n<a.length;n++)t.writeMessage(4,E,a[n])}function x(e,t){var n=e.feature;n.id!==void 0&&t.writeVarintField(1,n.id),t.writeMessage(2,S,e),t.writeVarintField(3,n.type),t.writeMessage(4,T,n)}function S(e,t){var n=e.feature,r=e.keys,i=e.values,a=e.keycache,o=e.valuecache;for(var s in n.properties){var c=n.properties[s],l=a[s];if(c!==null){l===void 0&&(r.push(s),a[s]=l=r.length-1),t.writeVarint(l);var u=typeof c;u!==`string`&&u!==`boolean`&&u!==`number`&&(c=JSON.stringify(c));var d=u+`:`+c,f=o[d];f===void 0&&(i.push(c),o[d]=f=i.length-1),t.writeVarint(f)}}}function C(e,t){return(t<<3)+(7&e)}function w(e){return e<<1^e>>31}function T(e,t){for(var n=e.loadGeometry(),r=e.type,i=0,a=0,o=n.length,s=0;s<o;s++){var c=n[s],l=1;r===1&&(l=c.length),t.writeVarint(C(1,l));for(var u=r===3?c.length-1:c.length,d=0;d<u;d++){d===1&&r!==1&&t.writeVarint(C(2,u-1));var f=c[d].x-i,p=c[d].y-a;t.writeVarint(w(f)),t.writeVarint(w(p)),i+=f,a+=p}r===3&&t.writeVarint(C(7,1))}}function E(e,t){var n=typeof e;n===`string`?t.writeStringField(1,e):n===`boolean`?t.writeBooleanField(7,e):n===`number`&&(e%1==0?e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e):t.writeDoubleField(3,e))}d.exports=y,d.exports.fromVectorTileJs=y,d.exports.fromGeojsonVt=function(e,t){t||={};var n={};for(var r in e)n[r]=new v(e[r].features,t),n[r].name=r,n[r].version=t.version,n[r].extent=t.extent;return y({layers:n})},d.exports.GeoJSONWrapper=v;var D=e.by(d.exports);let O={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},k=Math.fround||(A=new Float32Array(1),e=>(A[0]=+e,A[0]));var A;class j{constructor(e){this.options=Object.assign(Object.create(O),e),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:n,maxZoom:r}=this.options;t&&console.time(`total time`);let i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;let a=[];for(let t=0;t<e.length;t++){let n=e[t];if(!n.geometry)continue;let[r,i]=n.geometry.coordinates,o=k(P(r)),s=k(F(i));a.push(o,s,1/0,t,-1,1),this.options.reduce&&a.push(0)}let o=this.trees[r+1]=this._createTree(a);t&&console.timeEnd(i);for(let e=r;e>=n;e--){let n=+Date.now();o=this.trees[e]=this._createTree(this._cluster(o,e)),t&&console.log(`z%d: %d clusters in %dms`,e,o.numItems,+Date.now()-n)}return t&&console.timeEnd(`total time`),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){let e=this.getClusters([n,r,180,a],t),o=this.getClusters([-180,r,i,a],t);return e.concat(o)}let o=this.trees[this._limitZoom(t)],s=o.range(P(n),F(a),P(i),F(r)),c=o.data,l=[];for(let e of s){let t=this.stride*e;l.push(c[t+5]>1?M(c,t,this.clusterProps):this.points[c[t+3]])}return l}getChildren(e){let t=this._getOriginId(e),n=this._getOriginZoom(e),r=`No cluster with the specified id.`,i=this.trees[n];if(!i)throw Error(r);let a=i.data;if(t*this.stride>=a.length)throw Error(r);let o=this.options.radius/(this.options.extent*2**(n-1)),s=i.within(a[t*this.stride],a[t*this.stride+1],o),c=[];for(let t of s){let n=t*this.stride;a[n+4]===e&&c.push(a[n+5]>1?M(a,n,this.clusterProps):this.points[a[n+3]])}if(c.length===0)throw Error(r);return c}getLeaves(e,t,n){let r=[];return this._appendLeaves(r,e,t||=10,n||=0,0),r}getTile(e,t,n){let r=this.trees[this._limitZoom(e)],i=2**e,{extent:a,radius:o}=this.options,s=o/a,c=(n-s)/i,l=(n+1+s)/i,u={features:[]};return this._addTileFeatures(r.range((t-s)/i,c,(t+1+s)/i,l),r.data,t,n,i,u),t===0&&this._addTileFeatures(r.range(1-s/i,c,1,l),r.data,i,n,i,u),t===i-1&&this._addTileFeatures(r.range(0,c,s/i,l),r.data,-1,n,i,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let n=this.getChildren(e);if(t++,n.length!==1)break;e=n[0].properties.cluster_id}return t}_appendLeaves(e,t,n,r,i){let a=this.getChildren(t);for(let t of a){let a=t.properties;if(a&&a.cluster?i+a.point_count<=r?i+=a.point_count:i=this._appendLeaves(e,a.cluster_id,n,r,i):i<r?i++:e.push(t),e.length===n)break}return i}_createTree(t){let n=new e.av(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let e=0;e<t.length;e+=this.stride)n.add(t[e],t[e+1]);return n.finish(),n.data=t,n}_addTileFeatures(e,t,n,r,i,a){for(let o of e){let e=o*this.stride,s=t[e+5]>1,c,l,u;if(s)c=N(t,e,this.clusterProps),l=t[e],u=t[e+1];else{let n=this.points[t[e+3]];c=n.properties;let[r,i]=n.geometry.coordinates;l=P(r),u=F(i)}let d={type:1,geometry:[[Math.round(this.options.extent*(l*i-n)),Math.round(this.options.extent*(u*i-r))]],tags:c},f;f=s||this.options.generateId?t[e+3]:this.points[t[e+3]].id,f!==void 0&&(d.id=f),a.features.push(d)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:n,extent:r,reduce:i,minPoints:a}=this.options,o=n/(r*2**t),s=e.data,c=[],l=this.stride;for(let n=0;n<s.length;n+=l){if(s[n+2]<=t)continue;s[n+2]=t;let r=s[n],u=s[n+1],d=e.within(s[n],s[n+1],o),f=s[n+5],p=f;for(let e of d){let n=e*l;s[n+2]>t&&(p+=s[n+5])}if(p>f&&p>=a){let e,a=r*f,o=u*f,m=-1,h=((n/l|0)<<5)+(t+1)+this.points.length;for(let r of d){let c=r*l;if(s[c+2]<=t)continue;s[c+2]=t;let u=s[c+5];a+=s[c]*u,o+=s[c+1]*u,s[c+4]=h,i&&(e||(e=this._map(s,n,!0),m=this.clusterProps.length,this.clusterProps.push(e)),i(e,this._map(s,c)))}s[n+4]=h,c.push(a/p,o/p,1/0,h,-1,p),i&&c.push(m)}else{for(let e=0;e<l;e++)c.push(s[n+e]);if(p>1)for(let e of d){let n=e*l;if(!(s[n+2]<=t)){s[n+2]=t;for(let e=0;e<l;e++)c.push(s[n+e])}}}}return c}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,n){if(e[t+5]>1){let r=this.clusterProps[e[t+6]];return n?Object.assign({},r):r}let r=this.points[e[t+3]].properties,i=this.options.map(r);return n&&i===r?Object.assign({},i):i}}function M(e,t,n){return{type:`Feature`,id:e[t+3],properties:N(e,t,n),geometry:{type:`Point`,coordinates:[(r=e[t],360*(r-.5)),I(e[t+1])]}};var r}function N(e,t,n){let r=e[t+5],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?Math.round(r/100)/10+`k`:r,a=e[t+6],o=a===-1?{}:Object.assign({},n[a]);return Object.assign(o,{cluster:!0,cluster_id:e[t+3],point_count:r,point_count_abbreviated:i})}function P(e){return e/360+.5}function F(e){let t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function I(e){let t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function L(e,t,n,r){let i=r,a=t+(n-t>>1),o,s=n-t,c=e[t],l=e[t+1],u=e[n],d=e[n+1];for(let r=t+3;r<n;r+=3){let t=R(e[r],e[r+1],c,l,u,d);if(t>i)o=r,i=t;else if(t===i){let e=Math.abs(r-a);e<s&&(o=r,s=e)}}i>r&&(o-t>3&&L(e,t,o,r),e[o+2]=i,n-o>3&&L(e,o,n,r))}function R(e,t,n,r,i,a){let o=i-n,s=a-r;if(o!==0||s!==0){let c=((e-n)*o+(t-r)*s)/(o*o+s*s);c>1?(n=i,r=a):c>0&&(n+=o*c,r+=s*c)}return o=e-n,s=t-r,o*o+s*s}function z(e,t,n,r){let i={id:e??null,type:t,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(t===`Point`||t===`MultiPoint`||t===`LineString`)B(i,n);else if(t===`Polygon`)B(i,n[0]);else if(t===`MultiLineString`)for(let e of n)B(i,e);else if(t===`MultiPolygon`)for(let e of n)B(i,e[0]);return i}function B(e,t){for(let n=0;n<t.length;n+=3)e.minX=Math.min(e.minX,t[n]),e.minY=Math.min(e.minY,t[n+1]),e.maxX=Math.max(e.maxX,t[n]),e.maxY=Math.max(e.maxY,t[n+1])}function V(e,t,n,r){if(!t.geometry)return;let i=t.geometry.coordinates;if(i&&i.length===0)return;let a=t.geometry.type,o=(n.tolerance/((1<<n.maxZoom)*n.extent))**2,s=[],c=t.id;if(n.promoteId?c=t.properties[n.promoteId]:n.generateId&&(c=r||0),a===`Point`)H(i,s);else if(a===`MultiPoint`)for(let e of i)H(e,s);else if(a===`LineString`)U(i,s,o,!1);else if(a===`MultiLineString`){if(n.lineMetrics){for(let n of i)s=[],U(n,s,o,!1),e.push(z(c,`LineString`,s,t.properties));return}W(i,s,o,!1)}else if(a===`Polygon`)W(i,s,o,!0);else{if(a!==`MultiPolygon`){if(a===`GeometryCollection`){for(let i of t.geometry.geometries)V(e,{id:c,geometry:i,properties:t.properties},n,r);return}throw Error(`Input data is not a valid GeoJSON object.`)}for(let e of i){let t=[];W(e,t,o,!0),s.push(t)}}e.push(z(c,a,s,t.properties))}function H(e,t){t.push(G(e[0]),K(e[1]),0)}function U(e,t,n,r){let i,a,o=0;for(let n=0;n<e.length;n++){let s=G(e[n][0]),c=K(e[n][1]);t.push(s,c,0),n>0&&(o+=r?(i*c-s*a)/2:Math.sqrt((s-i)**2+(c-a)**2)),i=s,a=c}let s=t.length-3;t[2]=1,L(t,0,s,n),t[s+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function W(e,t,n,r){for(let i=0;i<e.length;i++){let a=[];U(e[i],a,n,r),t.push(a)}}function G(e){return e/360+.5}function K(e){let t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function q(e,t,n,r,i,a,o,s){if(r/=t,a>=(n/=t)&&o<r)return e;if(o<n||a>=r)return null;let c=[];for(let t of e){let e=t.geometry,a=t.type,o=i===0?t.minX:t.minY,l=i===0?t.maxX:t.maxY;if(o>=n&&l<r){c.push(t);continue}if(l<n||o>=r)continue;let u=[];if(a===`Point`||a===`MultiPoint`)J(e,u,n,r,i);else if(a===`LineString`)Y(e,u,n,r,i,!1,s.lineMetrics);else if(a===`MultiLineString`)Z(e,u,n,r,i,!1);else if(a===`Polygon`)Z(e,u,n,r,i,!0);else if(a===`MultiPolygon`)for(let t of e){let e=[];Z(t,e,n,r,i,!0),e.length&&u.push(e)}if(u.length){if(s.lineMetrics&&a===`LineString`){for(let e of u)c.push(z(t.id,a,e,t.tags));continue}a!==`LineString`&&a!==`MultiLineString`||(u.length===1?(a=`LineString`,u=u[0]):a=`MultiLineString`),a!==`Point`&&a!==`MultiPoint`||(a=u.length===3?`Point`:`MultiPoint`),c.push(z(t.id,a,u,t.tags))}}return c.length?c:null}function J(e,t,n,r,i){for(let a=0;a<e.length;a+=3){let o=e[a+i];o>=n&&o<=r&&Q(t,e[a],e[a+1],e[a+2])}}function Y(e,t,n,r,i,a,o){let s=X(e),c=i===0?ee:te,l,u,d=e.start;for(let f=0;f<e.length-3;f+=3){let p=e[f],m=e[f+1],h=e[f+2],g=e[f+3],_=e[f+4],v=i===0?p:m,y=i===0?g:_,b=!1;o&&(l=Math.sqrt((p-g)**2+(m-_)**2)),v<n?y>n&&(u=c(s,p,m,g,_,n),o&&(s.start=d+l*u)):v>r?y<r&&(u=c(s,p,m,g,_,r),o&&(s.start=d+l*u)):Q(s,p,m,h),y<n&&v>=n&&(u=c(s,p,m,g,_,n),b=!0),y>r&&v<=r&&(u=c(s,p,m,g,_,r),b=!0),!a&&b&&(o&&(s.end=d+l*u),t.push(s),s=X(e)),o&&(d+=l)}let f=e.length-3,p=e[f],m=e[f+1],h=i===0?p:m;h>=n&&h<=r&&Q(s,p,m,e[f+2]),f=s.length-3,a&&f>=3&&(s[f]!==s[0]||s[f+1]!==s[1])&&Q(s,s[0],s[1],s[2]),s.length&&t.push(s)}function X(e){let t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function Z(e,t,n,r,i,a){for(let o of e)Y(o,t,n,r,i,a,!1)}function Q(e,t,n,r){e.push(t,n,r)}function ee(e,t,n,r,i,a){let o=(a-t)/(r-t);return Q(e,a,n+(i-n)*o,1),o}function te(e,t,n,r,i,a){let o=(a-n)/(i-n);return Q(e,t+(r-t)*o,a,1),o}function ne(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=i.type,o;if(a===`Point`||a===`MultiPoint`||a===`LineString`)o=re(i.geometry,t);else if(a===`MultiLineString`||a===`Polygon`){o=[];for(let e of i.geometry)o.push(re(e,t))}else if(a===`MultiPolygon`){o=[];for(let e of i.geometry){let n=[];for(let r of e)n.push(re(r,t));o.push(n)}}n.push(z(i.id,a,o,i.tags))}return n}function re(e,t){let n=[];n.size=e.size,e.start!==void 0&&(n.start=e.start,n.end=e.end);for(let r=0;r<e.length;r+=3)n.push(e[r]+t,e[r+1],e[r+2]);return n}function ie(e,t){if(e.transformed)return e;let n=1<<e.z,r=e.x,i=e.y;for(let a of e.features){let e=a.geometry,o=a.type;if(a.geometry=[],o===1)for(let o=0;o<e.length;o+=2)a.geometry.push(ae(e[o],e[o+1],t,n,r,i));else for(let o=0;o<e.length;o++){let s=[];for(let a=0;a<e[o].length;a+=2)s.push(ae(e[o][a],e[o][a+1],t,n,r,i));a.geometry.push(s)}}return e.transformed=!0,e}function ae(e,t,n,r,i,a){return[Math.round(n*(e*r-i)),Math.round(n*(t*r-a))]}function oe(e,t,n,r,i){let a=t===i.maxZoom?0:i.tolerance/((1<<t)*i.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:e.length,source:null,x:n,y:r,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let t of e)se(o,t,a,i);return o}function se(e,t,n,r){let i=t.geometry,a=t.type,o=[];if(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),a===`Point`||a===`MultiPoint`)for(let t=0;t<i.length;t+=3)o.push(i[t],i[t+1]),e.numPoints++,e.numSimplified++;else if(a===`LineString`)ce(o,i,e,n,!1,!1);else if(a===`MultiLineString`||a===`Polygon`)for(let t=0;t<i.length;t++)ce(o,i[t],e,n,a===`Polygon`,t===0);else if(a===`MultiPolygon`)for(let t=0;t<i.length;t++){let r=i[t];for(let t=0;t<r.length;t++)ce(o,r[t],e,n,!0,t===0)}if(o.length){let n=t.tags||null;if(a===`LineString`&&r.lineMetrics){n={};for(let e in t.tags)n[e]=t.tags[e];n.mapbox_clip_start=i.start/i.size,n.mapbox_clip_end=i.end/i.size}let s={geometry:o,type:a===`Polygon`||a===`MultiPolygon`?3:a===`LineString`||a===`MultiLineString`?2:1,tags:n};t.id!==null&&(s.id=t.id),e.features.push(s)}}function ce(e,t,n,r,i,a){let o=r*r;if(r>0&&t.size<(i?o:r))return void(n.numPoints+=t.length/3);let s=[];for(let e=0;e<t.length;e+=3)(r===0||t[e+2]>o)&&(n.numSimplified++,s.push(t[e],t[e+1])),n.numPoints++;i&&function(e,t){let n=0;for(let t=0,r=e.length,i=r-2;t<r;i=t,t+=2)n+=(e[t]-e[i])*(e[t+1]+e[i+1]);if(n>0===t)for(let t=0,n=e.length;t<n/2;t+=2){let r=e[t],i=e[t+1];e[t]=e[n-2-t],e[t+1]=e[n-1-t],e[n-2-t]=r,e[n-1-t]=i}}(s,a),e.push(s)}let le={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class ue{constructor(e,t){let n=(t=this.options=function(e,t){for(let n in t)e[n]=t[n];return e}(Object.create(le),t)).debug;if(n&&console.time(`preprocess data`),t.maxZoom<0||t.maxZoom>24)throw Error(`maxZoom should be in the 0-24 range`);if(t.promoteId&&t.generateId)throw Error(`promoteId and generateId cannot be used together.`);let r=function(e,t){let n=[];if(e.type===`FeatureCollection`)for(let r=0;r<e.features.length;r++)V(n,e.features[r],t,r);else V(n,e.type===`Feature`?e:{geometry:e},t);return n}(e,t);this.tiles={},this.tileCoords=[],n&&(console.timeEnd(`preprocess data`),console.log(`index: maxZoom: %d, maxPoints: %d`,t.indexMaxZoom,t.indexMaxPoints),console.time(`generate tiles`),this.stats={},this.total=0),r=function(e,t){let n=t.buffer/t.extent,r=e,i=q(e,1,-1-n,n,0,-1,2,t),a=q(e,1,1-n,2+n,0,-1,2,t);return(i||a)&&(r=q(e,1,-n,1+n,0,-1,2,t)||[],i&&(r=ne(i,1).concat(r)),a&&(r=r.concat(ne(a,-1)))),r}(r,t),r.length&&this.splitTile(r,0,0,0),n&&(r.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(e,t,n,r,i,a,o){let s=[e,t,n,r],c=this.options,l=c.debug;for(;s.length;){r=s.pop(),n=s.pop(),t=s.pop(),e=s.pop();let u=1<<t,d=de(t,n,r),f=this.tiles[d];if(!f&&(l>1&&console.time(`creation`),f=this.tiles[d]=oe(e,t,n,r,c),this.tileCoords.push({z:t,x:n,y:r}),l)){l>1&&(console.log(`tile z%d-%d-%d (features: %d, points: %d, simplified: %d)`,t,n,r,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd(`creation`));let e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(f.source=e,i==null){if(t===c.indexMaxZoom||f.numPoints<=c.indexMaxPoints)continue}else{if(t===c.maxZoom||t===i)continue;if(i!=null){let e=i-t;if(n!==a>>e||r!==o>>e)continue}}if(f.source=null,e.length===0)continue;l>1&&console.time(`clipping`);let p=.5*c.buffer/c.extent,m=.5-p,h=.5+p,g=1+p,_=null,v=null,y=null,b=null,x=q(e,u,n-p,n+h,0,f.minX,f.maxX,c),S=q(e,u,n+m,n+g,0,f.minX,f.maxX,c);e=null,x&&=(_=q(x,u,r-p,r+h,1,f.minY,f.maxY,c),v=q(x,u,r+m,r+g,1,f.minY,f.maxY,c),null),S&&=(y=q(S,u,r-p,r+h,1,f.minY,f.maxY,c),b=q(S,u,r+m,r+g,1,f.minY,f.maxY,c),null),l>1&&console.timeEnd(`clipping`),s.push(_||[],t+1,2*n,2*r),s.push(v||[],t+1,2*n,2*r+1),s.push(y||[],t+1,2*n+1,2*r),s.push(b||[],t+1,2*n+1,2*r+1)}}getTile(e,t,n){e=+e,t=+t,n=+n;let{extent:r,debug:i}=this.options;if(e<0||e>24)return null;let a=1<<e,o=de(e,t=t+a&a-1,n);if(this.tiles[o])return ie(this.tiles[o],r);i>1&&console.log(`drilling down to z%d-%d-%d`,e,t,n);let s,c=e,l=t,u=n;for(;!s&&c>0;)c--,l>>=1,u>>=1,s=this.tiles[de(c,l,u)];return s&&s.source?(i>1&&(console.log(`found parent tile z%d-%d-%d`,c,l,u),console.time(`drilling down`)),this.splitTile(s.source,c,l,u,e,t,n),i>1&&console.timeEnd(`drilling down`),this.tiles[o]?ie(this.tiles[o],r):null):null}}function de(e,t,n){return 32*((1<<e)*n+t)+e}function fe(e,t){return t?e.properties[t]:e.id}function pe(e,t){if(e==null)return!0;if(e.type===`Feature`)return fe(e,t)!=null;if(e.type===`FeatureCollection`){let n=new Set;for(let r of e.features){let e=fe(r,t);if(e==null||n.has(e))return!1;n.add(e)}return!0}return!1}function me(e,t){let n=new Map;if(e!=null)if(e.type===`Feature`)n.set(fe(e,t),e);else for(let r of e.features)n.set(fe(r,t),r);return n}class he extends a{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(t,n){return e._(this,void 0,void 0,function*(){let n=t.tileID.canonical;if(!this._geoJSONIndex)throw Error(`Unable to parse the data into a cluster or geojson`);let r=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!r)return null;let i=new class{constructor(t){this.layers={_geojsonTileLayer:this},this.name=`_geojsonTileLayer`,this.extent=e.X,this.length=t.length,this._features=t}feature(t){return new class{constructor(t){this._feature=t,this.extent=e.X,this.type=t.type,this.properties=t.tags,`id`in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(this._feature.type===1){let t=[];for(let n of this._feature.geometry)t.push([new e.P(n[0],n[1])]);return t}{let t=[];for(let n of this._feature.geometry){let r=[];for(let t of n)r.push(new e.P(t[0],t[1]));t.push(r)}return t}}toGeoJSON(e,t,n){return u.call(this,e,t,n)}}(this._features[t])}}(r.features),a=D(i);return a.byteOffset===0&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),{vectorTile:i,rawData:a.buffer}})}loadData(t){return e._(this,void 0,void 0,function*(){var n;(n=this._pendingRequest)==null||n.abort();let r=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.bv(t.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(t,this._pendingRequest),this._geoJSONIndex=t.cluster?new j(function({superclusterOptions:t,clusterProperties:n}){if(!n||!t)return t;let r={},i={},a={accumulated:null,zoom:0},o={properties:null},s=Object.keys(n);for(let t of s){let[a,o]=n[t],s=e.bC(o),c=e.bC(typeof a==`string`?[a,[`accumulated`],[`get`,t]]:a);r[t]=s.value,i[t]=c.value}return t.map=e=>{o.properties=e;let t={};for(let e of s)t[e]=r[e].evaluate(a,o);return t},t.reduce=(e,t)=>{o.properties=t;for(let t of s)a.accumulated=e[t],e[t]=i[t].evaluate(a,o)},t}(t)).load((yield this._pendingData).features):(i=yield this._pendingData,new ue(i,t.geojsonVtOptions)),this.loaded={};let n={};if(r){let e=r.finish();e&&(n.resourceTiming={},n.resourceTiming[t.source]=JSON.parse(JSON.stringify(e)))}return n}catch(t){if(delete this._pendingRequest,e.bB(t))return{abandoned:!0};throw t}var i})}getData(){return e._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(e){let t=this.loaded;return t&&t[e.uid]?super.reloadTile(e):this.loadTile(e)}loadAndProcessGeoJSON(t,n){return e._(this,void 0,void 0,function*(){let r=yield this.loadGeoJSON(t,n);if(delete this._pendingRequest,typeof r!=`object`)throw Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`);if(l(r,!0),t.filter){let n=e.bC(t.filter,{type:`boolean`,"property-type":`data-driven`,overridable:!1,transition:!1});if(n.result===`error`)throw Error(n.value.map(e=>`${e.key}: ${e.message}`).join(`, `));r={type:`FeatureCollection`,features:r.features.filter(e=>n.value.evaluate({zoom:0},e))}}return r})}loadGeoJSON(t,n){return e._(this,void 0,void 0,function*(){let{promoteId:r}=t;if(t.request){let i=yield e.h(t.request,n);return this._dataUpdateable=pe(i.data,r)?me(i.data,r):void 0,i.data}if(typeof t.data==`string`)try{let e=JSON.parse(t.data);return this._dataUpdateable=pe(e,r)?me(e,r):void 0,e}catch{throw Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)}if(!t.dataDiff)throw Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw Error(`Cannot update existing geojson data in ${t.source}`);return function(e,t,n){if(t.removeAll&&e.clear(),t.remove)for(let n of t.remove)e.delete(n);if(t.add)for(let r of t.add){let t=fe(r,n);t!=null&&e.set(t,r)}if(t.update)for(let n of t.update){let t=e.get(n.id);if(t==null)continue;let r=!n.removeAllProperties&&(n.removeProperties?.length>0||n.addOrUpdateProperties?.length>0);if((n.newGeometry||n.removeAllProperties||r)&&(t=Object.assign({},t),e.set(n.id,t),r&&(t.properties=Object.assign({},t.properties))),n.newGeometry&&(t.geometry=n.newGeometry),n.removeAllProperties)t.properties={};else if(n.removeProperties?.length>0)for(let e of n.removeProperties)Object.prototype.hasOwnProperty.call(t.properties,e)&&delete t.properties[e];if(n.addOrUpdateProperties?.length>0)for(let{key:e,value:r}of n.addOrUpdateProperties)t.properties[e]=r}}(this._dataUpdateable,t.dataDiff,r),{type:`FeatureCollection`,features:Array.from(this._dataUpdateable.values())}})}removeSource(t){return e._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(e){return this._geoJSONIndex.getClusterExpansionZoom(e.clusterId)}getClusterChildren(e){return this._geoJSONIndex.getChildren(e.clusterId)}getClusterLeaves(e){return this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset)}}class ge{constructor(t){this.self=t,this.actor=new e.F(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(e,t)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=t},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=t=>{if(e.bD.isParsed())throw Error(`RTL text plugin already registered.`);e.bD.setMethods(t)},this.actor.registerMessageHandler(`LDT`,(e,t)=>this._getDEMWorkerSource(e,t.source).loadTile(t)),this.actor.registerMessageHandler(`RDT`,(t,n)=>e._(this,void 0,void 0,function*(){this._getDEMWorkerSource(t,n.source).removeTile(n)})),this.actor.registerMessageHandler(`GCEZ`,(t,n)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(t,n.type,n.source).getClusterExpansionZoom(n)})),this.actor.registerMessageHandler(`GCC`,(t,n)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(t,n.type,n.source).getClusterChildren(n)})),this.actor.registerMessageHandler(`GCL`,(t,n)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(t,n.type,n.source).getClusterLeaves(n)})),this.actor.registerMessageHandler(`LD`,(e,t)=>this._getWorkerSource(e,t.type,t.source).loadData(t)),this.actor.registerMessageHandler(`GD`,(e,t)=>this._getWorkerSource(e,t.type,t.source).getData()),this.actor.registerMessageHandler(`LT`,(e,t)=>this._getWorkerSource(e,t.type,t.source).loadTile(t)),this.actor.registerMessageHandler(`RT`,(e,t)=>this._getWorkerSource(e,t.type,t.source).reloadTile(t)),this.actor.registerMessageHandler(`AT`,(e,t)=>this._getWorkerSource(e,t.type,t.source).abortTile(t)),this.actor.registerMessageHandler(`RMT`,(e,t)=>this._getWorkerSource(e,t.type,t.source).removeTile(t)),this.actor.registerMessageHandler(`RS`,(t,n)=>e._(this,void 0,void 0,function*(){if(!this.workerSources[t]||!this.workerSources[t][n.type]||!this.workerSources[t][n.type][n.source])return;let e=this.workerSources[t][n.type][n.source];delete this.workerSources[t][n.type][n.source],e.removeSource!==void 0&&e.removeSource(n)})),this.actor.registerMessageHandler(`RM`,t=>e._(this,void 0,void 0,function*(){delete this.layerIndexes[t],delete this.availableImages[t],delete this.workerSources[t],delete this.demWorkerSources[t]})),this.actor.registerMessageHandler(`SR`,(t,n)=>e._(this,void 0,void 0,function*(){this.referrer=n})),this.actor.registerMessageHandler(`SRPS`,(e,t)=>this._syncRTLPluginState(e,t)),this.actor.registerMessageHandler(`IS`,(t,n)=>e._(this,void 0,void 0,function*(){this.self.importScripts(n)})),this.actor.registerMessageHandler(`SI`,(e,t)=>this._setImages(e,t)),this.actor.registerMessageHandler(`UL`,(t,n)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(t).update(n.layers,n.removedIds)})),this.actor.registerMessageHandler(`SL`,(t,n)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(t).replace(n)}))}_setImages(t,n){return e._(this,void 0,void 0,function*(){this.availableImages[t]=n;for(let e in this.workerSources[t]){let r=this.workerSources[t][e];for(let e in r)r[e].availableImages=n}})}_syncRTLPluginState(t,n){return e._(this,void 0,void 0,function*(){if(e.bD.isParsed())return e.bD.getState();if(n.pluginStatus!==`loading`)return e.bD.setState(n),n;let t=n.pluginURL;if(this.self.importScripts(t),e.bD.isParsed()){let n={pluginStatus:`loaded`,pluginURL:t};return e.bD.setState(n),n}throw e.bD.setState({pluginStatus:`error`,pluginURL:``}),Error(`RTL Text Plugin failed to import scripts from ${t}`)})}_getAvailableImages(e){let t=this.availableImages[e];return t||=[],t}_getLayerIndex(e){let n=this.layerIndexes[e];return n||=this.layerIndexes[e]=new t,n}_getWorkerSource(e,t,n){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][n]){let r={sendAsync:(t,n)=>(t.targetMapId=e,this.actor.sendAsync(t,n))};switch(t){case`vector`:this.workerSources[e][t][n]=new a(r,this._getLayerIndex(e),this._getAvailableImages(e));break;case`geojson`:this.workerSources[e][t][n]=new he(r,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][t][n]=new this.externalWorkerSourceTypes[t](r,this._getLayerIndex(e),this._getAvailableImages(e))}}return this.workerSources[e][t][n]}_getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new o),this.demWorkerSources[e][t]}}return e.i(self)&&(self.worker=new ge(self)),ge}),n(`index`,[`exports`,`./shared`],function(e,t){var n=`4.7.1`;let r,i,a={now:typeof performance<`u`&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:e=>new Promise((n,r)=>{let i=requestAnimationFrame(n);e.signal.addEventListener(`abort`,()=>{cancelAnimationFrame(i),r(t.c())})}),getImageData(e,t=0){return this.getImageCanvasContext(e).getImageData(-t,-t,e.width+2*t,e.height+2*t)},getImageCanvasContext(e){let t=window.document.createElement(`canvas`),n=t.getContext(`2d`,{willReadFrequently:!0});if(!n)throw Error(`failed to create canvas 2d context`);return t.width=e.width,t.height=e.height,n.drawImage(e,0,0,e.width,e.height),n},resolveURL:e=>(r||=document.createElement(`a`),r.href=e,r.href),hardwareConcurrency:typeof navigator<`u`&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(i??=matchMedia(`(prefers-reduced-motion: reduce)`),i.matches)}};class o{static testProp(e){if(!o.docStyle)return e[0];for(let t=0;t<e.length;t++)if(e[t]in o.docStyle)return e[t];return e[0]}static create(e,t,n){let r=window.document.createElement(e);return t!==void 0&&(r.className=t),n&&n.appendChild(r),r}static createNS(e,t){return window.document.createElementNS(e,t)}static disableDrag(){o.docStyle&&o.selectProp&&(o.userSelect=o.docStyle[o.selectProp],o.docStyle[o.selectProp]=`none`)}static enableDrag(){o.docStyle&&o.selectProp&&(o.docStyle[o.selectProp]=o.userSelect)}static setTransform(e,t){e.style[o.transformProp]=t}static addEventListener(e,t,n,r={}){e.addEventListener(t,n,`passive`in r?r:r.capture)}static removeEventListener(e,t,n,r={}){e.removeEventListener(t,n,`passive`in r?r:r.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener(`click`,o.suppressClickInternal,!0)}static suppressClick(){window.addEventListener(`click`,o.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener(`click`,o.suppressClickInternal,!0)},0)}static getScale(e){let t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}static getPoint(e,n,r){let i=n.boundingClientRect;return new t.P((r.clientX-i.left)/n.x-e.clientLeft,(r.clientY-i.top)/n.y-e.clientTop)}static mousePos(e,t){let n=o.getScale(e);return o.getPoint(e,n,t)}static touchPos(e,t){let n=[],r=o.getScale(e);for(let i=0;i<t.length;i++)n.push(o.getPoint(e,r,t[i]));return n}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}}o.docStyle=typeof window<`u`&&window.document&&window.document.documentElement.style,o.selectProp=o.testProp([`userSelect`,`MozUserSelect`,`WebkitUserSelect`,`msUserSelect`]),o.transformProp=o.testProp([`transform`,`WebkitTransform`]);let s={supported:!1,testSupport:function(e){!u&&l&&(d?f(e):c=e)}},c,l,u=!1,d=!1;function f(e){let t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,l),e.isContextLost())return;s.supported=!0}catch{}e.deleteTexture(t),u=!0}var p;typeof document<`u`&&(l=document.createElement(`img`),l.onload=()=>{c&&f(c),c=null,d=!0},l.onerror=()=>{u=!0,c=null},l.src=`data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=`),function(e){let n,r,i,a;e.resetRequestQueue=()=>{n=[],r=0,i=0,a={}},e.addThrottleControl=e=>{let t=i++;return a[t]=e,t},e.removeThrottleControl=e=>{delete a[e],c()},e.getImage=(e,r,i=!0)=>new Promise((a,o)=>{s.supported&&(e.headers||={},e.headers.accept=`image/webp,*/*`),t.e(e,{type:`image`}),n.push({abortController:r,requestParameters:e,supportImageRefresh:i,state:`queued`,onError:e=>{o(e)},onSuccess:e=>{a(e)}}),c()});let o=e=>t._(this,void 0,void 0,function*(){e.state=`running`;let{requestParameters:n,supportImageRefresh:i,onError:a,onSuccess:o,abortController:s}=e,u=i===!1&&!t.i(self)&&!t.g(n.url)&&(!n.headers||Object.keys(n.headers).reduce((e,t)=>e&&t===`accept`,!0));r++;let d=u?l(n,s):t.m(n,s);try{let n=yield d;delete e.abortController,e.state=`completed`,n.data instanceof HTMLImageElement||t.b(n.data)?o(n):n.data&&o({data:yield(f=n.data,typeof createImageBitmap==`function`?t.d(f):t.f(f)),cacheControl:n.cacheControl,expires:n.expires})}catch(t){delete e.abortController,a(t)}finally{r--,c()}var f}),c=()=>{let e=(()=>{for(let e of Object.keys(a))if(a[e]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let t=r;t<e&&n.length>0;t++){let e=n.shift();e.abortController.signal.aborted?t--:o(e)}},l=(e,n)=>new Promise((r,i)=>{let a=new Image,o=e.url,s=e.credentials;s&&s===`include`?a.crossOrigin=`use-credentials`:(s&&s===`same-origin`||!t.s(o))&&(a.crossOrigin=`anonymous`),n.signal.addEventListener(`abort`,()=>{a.src=``,i(t.c())}),a.fetchPriority=`high`,a.onload=()=>{a.onerror=a.onload=null,r({data:a})},a.onerror=()=>{a.onerror=a.onload=null,n.signal.aborted||i(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.`))},a.src=o})}(p||={}),p.resetRequestQueue();class m{constructor(e){this._transformRequestFn=e}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function h(e){var n=new t.A(3);return n[0]=e[0],n[1]=e[1],n[2]=e[2],n}var g,_=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e};g=new t.A(3),t.A!=Float32Array&&(g[0]=0,g[1]=0,g[2]=0);var v=function(e){var t=e[0],n=e[1];return t*t+n*n};function y(e){let t=[];if(typeof e==`string`)t.push({id:`default`,url:e});else if(e&&e.length>0){let n=[];for(let{id:r,url:i}of e){let e=`${r}${i}`;n.indexOf(e)===-1&&(n.push(e),t.push({id:r,url:i}))}}return t}function b(e,t,n){let r=e.split(`?`);return r[0]+=`${t}${n}`,r.join(`?`)}(function(){var e=new t.A(2);t.A!=Float32Array&&(e[0]=0,e[1]=0)})();class x{constructor(e,t,n,r){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this.update(t,r)}update(e,n,r){let{width:i,height:a}=e,o=!(this.size&&this.size[0]===i&&this.size[1]===a||r),{context:s}=this,{gl:c}=s;if(this.useMipmap=!!(n&&n.useMipmap),c.bindTexture(c.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===c.RGBA&&(!n||n.premultiply!==!1)),o)this.size=[i,a],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||t.b(e)?c.texImage2D(c.TEXTURE_2D,0,this.format,this.format,c.UNSIGNED_BYTE,e):c.texImage2D(c.TEXTURE_2D,0,this.format,i,a,0,this.format,c.UNSIGNED_BYTE,e.data);else{let{x:n,y:o}=r||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||t.b(e)?c.texSubImage2D(c.TEXTURE_2D,0,n,o,c.RGBA,c.UNSIGNED_BYTE,e):c.texSubImage2D(c.TEXTURE_2D,0,n,o,i,a,c.RGBA,c.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&c.generateMipmap(c.TEXTURE_2D)}bind(e,t,n){let{context:r}=this,{gl:i}=r;i.bindTexture(i.TEXTURE_2D,this.texture),n!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(n=i.LINEAR),e!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,n||e),this.filter=e),t!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t),this.wrap=t)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function S(e){let{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class C extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(let{ids:e,promiseResolve:t}of this.requestors)t(this._getImagesForIds(e));this.requestors=[]}}getImage(e){let n=this.images[e];if(n&&!n.data&&n.spriteData){let e=n.spriteData;n.data=new t.R({width:e.width,height:e.height},e.context.getImageData(e.x,e.y,e.width,e.height).data),n.spriteData=null}return n}addImage(e,t){if(this.images[e])throw Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,t)&&(this.images[e]=t)}_validate(e,n){let r=!0,i=n.data||n.spriteData;return this._validateStretch(n.stretchX,i&&i.width)||(this.fire(new t.j(Error(`Image "${e}" has invalid "stretchX" value`))),r=!1),this._validateStretch(n.stretchY,i&&i.height)||(this.fire(new t.j(Error(`Image "${e}" has invalid "stretchY" value`))),r=!1),this._validateContent(n.content,n)||(this.fire(new t.j(Error(`Image "${e}" has invalid "content" value`))),r=!1),r}_validateStretch(e,t){if(!e)return!0;let n=0;for(let r of e){if(r[0]<n||r[1]<r[0]||t<r[1])return!1;n=r[1]}return!0}_validateContent(e,t){if(!e)return!0;if(e.length!==4)return!1;let n=t.spriteData,r=n&&n.width||t.data.width,i=n&&n.height||t.data.height;return!(e[0]<0||r<e[0]||e[1]<0||i<e[1]||e[2]<0||r<e[2]||e[3]<0||i<e[3]||e[2]<e[0]||e[3]<e[1])}updateImage(e,t,n=!0){let r=this.getImage(e);if(n&&(r.data.width!==t.data.width||r.data.height!==t.data.height))throw Error(`size mismatch between old image (${r.data.width}x${r.data.height}) and new image (${t.data.width}x${t.data.height}).`);t.version=r.version+1,this.images[e]=t,this.updatedImages[e]=!0}removeImage(e){let t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e){return new Promise((t,n)=>{let r=!0;if(!this.isLoaded())for(let t of e)this.images[t]||(r=!1);this.isLoaded()||r?t(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:t})})}_getImagesForIds(e){let n={};for(let r of e){let e=this.getImage(r);e||=(this.fire(new t.k(`styleimagemissing`,{id:r})),this.getImage(r)),e?n[r]={data:e.data.clone(),pixelRatio:e.pixelRatio,sdf:e.sdf,version:e.version,stretchX:e.stretchX,stretchY:e.stretchY,content:e.content,textFitWidth:e.textFitWidth,textFitHeight:e.textFitHeight,hasRenderCallback:!!(e.userImage&&e.userImage.render)}:t.w(`Image "${r}" 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 n}getPixelSize(){let{width:e,height:t}=this.atlasImage;return{width:e,height:t}}getPattern(e){let n=this.patterns[e],r=this.getImage(e);if(!r)return null;if(n&&n.position.version===r.version)return n.position;if(n)n.position.version=r.version;else{let n={w:r.data.width+2,h:r.data.height+2,x:0,y:0},i=new t.I(n,r);this.patterns[e]={bin:n,position:i}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){let t=e.gl;this.atlasTexture?this.dirty&&=(this.atlasTexture.update(this.atlasImage),!1):this.atlasTexture=new x(e,this.atlasImage,t.RGBA),this.atlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE)}_updatePatternAtlas(){let e=[];for(let t in this.patterns)e.push(this.patterns[t].bin);let{w:n,h:r}=t.p(e),i=this.atlasImage;i.resize({width:n||1,height:r||1});for(let e in this.patterns){let{bin:n}=this.patterns[e],r=n.x+1,a=n.y+1,o=this.getImage(e).data,s=o.width,c=o.height;t.R.copy(o,i,{x:0,y:0},{x:r,y:a},{width:s,height:c}),t.R.copy(o,i,{x:0,y:c-1},{x:r,y:a-1},{width:s,height:1}),t.R.copy(o,i,{x:0,y:0},{x:r,y:a+c},{width:s,height:1}),t.R.copy(o,i,{x:s-1,y:0},{x:r-1,y:a},{width:1,height:c}),t.R.copy(o,i,{x:0,y:0},{x:r+s,y:a},{width:1,height:c})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(let n of e){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;let e=this.getImage(n);e||t.w(`Image with ID: "${n}" was not found`),S(e)&&this.updateImage(n,e)}}}let w=0x56bc75e2d63100000;function T(e,t,n,r,i,a,o,s,c){for(let l=t;l<t+r;l++)E(e,n*a+l,a,i,o,s,c);for(let l=n;l<n+i;l++)E(e,l*a+t,1,r,o,s,c)}function E(e,t,n,r,i,a,o){a[0]=0,o[0]=-w,o[1]=w,i[0]=e[t];for(let s=1,c=0,l=0;s<r;s++){i[s]=e[t+s*n];let r=s*s;do{let e=a[c];l=(i[s]-i[e]+r-e*e)/(s-e)/2}while(l<=o[c]&&--c>-1);c++,a[c]=s,o[c]=l,o[c+1]=w}for(let s=0,c=0;s<r;s++){for(;o[c+1]<s;)c++;let r=a[c],l=s-r;e[t+s*n]=i[r]+l*l}}class D{constructor(e,t){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={}}setURL(e){this.url=e}getGlyphs(e){return t._(this,void 0,void 0,function*(){let t=[];for(let n in e)for(let r of e[n])t.push(this._getAndCacheGlyphsPromise(n,r));let n=yield Promise.all(t),r={};for(let{stack:e,id:t,glyph:i}of n)r[e]||(r[e]={}),r[e][t]=i&&{id:i.id,bitmap:i.bitmap.clone(),metrics:i.metrics};return r})}_getAndCacheGlyphsPromise(e,n){return t._(this,void 0,void 0,function*(){let t=this.entries[e];t||=this.entries[e]={glyphs:{},requests:{},ranges:{}};let r=t.glyphs[n];if(r!==void 0)return{stack:e,id:n,glyph:r};if(r=this._tinySDF(t,e,n),r)return t.glyphs[n]=r,{stack:e,id:n,glyph:r};let i=Math.floor(n/256);if(256*i>65535)throw Error(`glyphs > 65535 not supported`);if(t.ranges[i])return{stack:e,id:n,glyph:r};if(!this.url)throw Error(`glyphsUrl is not set`);if(!t.requests[i]){let n=D.loadGlyphRange(e,i,this.url,this.requestManager);t.requests[i]=n}let a=yield t.requests[i];for(let e in a)this._doesCharSupportLocalGlyph(+e)||(t.glyphs[+e]=a[+e]);return t.ranges[i]=!0,{stack:e,id:n,glyph:a[n]||null}})}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&RegExp(`\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}`,`u`).test(String.fromCodePoint(e))}_tinySDF(e,n,r){let i=this.localIdeographFontFamily;if(!i||!this._doesCharSupportLocalGlyph(r))return;let a=e.tinySDF;if(!a){let t=`400`;/bold/i.test(n)?t=`900`:/medium/i.test(n)?t=`500`:/light/i.test(n)&&(t=`200`),a=e.tinySDF=new D.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:t})}let o=a.draw(String.fromCharCode(r));return{id:r,bitmap:new t.o({width:o.width||60,height:o.height||60},o.data),metrics:{width:o.glyphWidth/2||24,height:o.glyphHeight/2||24,left:o.glyphLeft/2+.5||0,top:o.glyphTop/2-27.5||-8,advance:o.glyphAdvance/2||24,isDoubleResolution:!0}}}}D.loadGlyphRange=function(e,n,r,i){return t._(this,void 0,void 0,function*(){let a=256*n,o=a+255,s=i.transformRequest(r.replace(`{fontstack}`,e).replace(`{range}`,`${a}-${o}`),`Glyphs`),c=yield t.l(s,new AbortController);if(!c||!c.data)throw Error(`Could not load glyph range. range: ${n}, ${a}-${o}`);let l={};for(let e of t.n(c.data))l[e.id]=e;return l})},D.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:n=8,cutoff:r=.25,fontFamily:i=`sans-serif`,fontWeight:a=`normal`,fontStyle:o=`normal`}={}){this.buffer=t,this.cutoff=r,this.radius=n;let s=this.size=e+4*t,c=this.ctx=this._createCanvas(s).getContext(`2d`,{willReadFrequently:!0});c.font=`${o} ${a} ${e}px ${i}`,c.textBaseline=`alphabetic`,c.textAlign=`left`,c.fillStyle=`black`,this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(e){let t=document.createElement(`canvas`);return t.width=t.height=e,t}draw(e){let{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:r,actualBoundingBoxLeft:i,actualBoundingBoxRight:a}=this.ctx.measureText(e),o=Math.ceil(n),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-i))),c=Math.min(this.size-this.buffer,o+Math.ceil(r)),l=s+2*this.buffer,u=c+2*this.buffer,d=Math.max(l*u,0),f=new Uint8ClampedArray(d),p={data:f,width:l,height:u,glyphWidth:s,glyphHeight:c,glyphTop:o,glyphLeft:0,glyphAdvance:t};if(s===0||c===0)return p;let{ctx:m,buffer:h,gridInner:g,gridOuter:_}=this;m.clearRect(h,h,s,c),m.fillText(e,h,h+o);let v=m.getImageData(h,h,s,c);_.fill(w,0,d),g.fill(0,0,d);for(let e=0;e<c;e++)for(let t=0;t<s;t++){let n=v.data[4*(e*s+t)+3]/255;if(n===0)continue;let r=(e+h)*l+t+h;if(n===1)_[r]=0,g[r]=w;else{let e=.5-n;_[r]=e>0?e*e:0,g[r]=e<0?e*e:0}}T(_,0,0,l,u,l,this.f,this.v,this.z),T(g,h,h,s,c,l,this.f,this.v,this.z);for(let e=0;e<d;e++){let t=Math.sqrt(_[e])-Math.sqrt(g[e]);f[e]=Math.round(255-255*(t/this.radius+this.cutoff))}return p}};class O{constructor(){this.specification=t.v.light.position}possiblyEvaluate(e,n){return t.x(e.expression.evaluate(n))}interpolate(e,n,r){return{x:t.y.number(e.x,n.x,r),y:t.y.number(e.y,n.y,r),z:t.y.number(e.z,n.z,r)}}}let k;class A extends t.E{constructor(e){super(),k||=new t.q({anchor:new t.D(t.v.light.anchor),position:new O,color:new t.D(t.v.light.color),intensity:new t.D(t.v.light.intensity)}),this._transitionable=new t.T(k),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,n={}){if(!this._validate(t.r,e,n))for(let t in e){let n=e[t];t.endsWith(`-transition`)?this._transitionable.setTransition(t.slice(0,-11),n):this._transitionable.setValue(t,n)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,n,r){return(!r||r.validate!==!1)&&t.t(this,e.call(t.u,{value:n,style:{glyphs:!0,sprite:!0},styleSpec:t.v}))}}let j=new t.q({"sky-color":new t.D(t.v.sky[`sky-color`]),"horizon-color":new t.D(t.v.sky[`horizon-color`]),"fog-color":new t.D(t.v.sky[`fog-color`]),"fog-ground-blend":new t.D(t.v.sky[`fog-ground-blend`]),"horizon-fog-blend":new t.D(t.v.sky[`horizon-fog-blend`]),"sky-horizon-blend":new t.D(t.v.sky[`sky-horizon-blend`]),"atmosphere-blend":new t.D(t.v.sky[`atmosphere-blend`])});class M extends t.E{constructor(e){super(),this._transitionable=new t.T(j),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new t.z(0))}setSky(e,n={}){if(!this._validate(t.B,e,n)){e||={"sky-color":`transparent`,"horizon-color":`transparent`,"fog-color":`transparent`,"fog-ground-blend":1,"atmosphere-blend":0};for(let t in e){let n=e[t];t.endsWith(`-transition`)?this._transitionable.setTransition(t.slice(0,-11),n):this._transitionable.setValue(t,n)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,n,r={}){return r?.validate!==!1&&t.t(this,e.call(t.u,t.e({value:n,style:{glyphs:!0,sprite:!0},styleSpec:t.v})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class N{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,t){let n=e.join(`,`)+String(t);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(e,t)),this.dashEntry[n]}getDashRanges(e,t,n){let r=[],i=e.length%2==1?-e[e.length-1]*n:0,a=e[0]*n,o=!0;r.push({left:i,right:a,isDash:o,zeroLength:e[0]===0});let s=e[0];for(let t=1;t<e.length;t++){o=!o;let c=e[t];i=s*n,s+=c,a=s*n,r.push({left:i,right:a,isDash:o,zeroLength:c===0})}return r}addRoundDash(e,t,n){let r=t/2;for(let t=-n;t<=n;t++){let i=this.width*(this.nextRow+n+t),a=0,o=e[a];for(let s=0;s<this.width;s++){s/o.right>1&&(o=e[++a]);let c=Math.abs(s-o.left),l=Math.abs(s-o.right),u=Math.min(c,l),d,f=t/n*(r+1);if(o.isDash){let e=r-Math.abs(f);d=Math.sqrt(u*u+e*e)}else d=r-Math.sqrt(u*u+f*f);this.data[i+s]=Math.max(0,Math.min(255,d+128))}}}addRegularDash(e){for(let t=e.length-1;t>=0;--t){let n=e[t],r=e[t+1];n.zeroLength?e.splice(t,1):r&&r.isDash===n.isDash&&(r.left=n.left,e.splice(t,1))}let t=e[0],n=e[e.length-1];t.isDash===n.isDash&&(t.left=n.left-this.width,n.right=t.right+this.width);let r=this.width*this.nextRow,i=0,a=e[i];for(let t=0;t<this.width;t++){t/a.right>1&&(a=e[++i]);let n=Math.abs(t-a.left),o=Math.abs(t-a.right),s=Math.min(n,o);this.data[r+t]=Math.max(0,Math.min(255,(a.isDash?s:-s)+128))}}addDash(e,n){let r=n?7:0,i=2*r+1;if(this.nextRow+i>this.height)return t.w(`LineAtlas out of space`),null;let a=0;for(let t=0;t<e.length;t++)a+=e[t];if(a!==0){let t=this.width/a,i=this.getDashRanges(e,this.width,t);n?this.addRoundDash(i,t,r):this.addRegularDash(i)}let o={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:a};return this.nextRow+=i,this.dirty=!0,o}bind(e){let t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))}}let P=`maplibre_preloaded_worker_pool`;class F{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<F.workerCount;)this.workers.push(new Worker(t.a.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.numActive()===0&&(this.workers.forEach(e=>{e.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[P]}numActive(){return Object.keys(this.active).length}}let I=Math.floor(a.hardwareConcurrency/2),L,R;function z(){return L||=new F,L}F.workerCount=t.C(globalThis)?Math.max(Math.min(I,3),1):1;class B{constructor(e,n){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=n;let r=this.workerPool.acquire(n);for(let e=0;e<r.length;e++){let i=new t.F(r[e],n);i.name=`Worker ${e}`,this.actors.push(i)}if(!this.actors.length)throw Error(`No actors found`)}broadcast(e,t){let n=[];for(let r of this.actors)n.push(r.sendAsync({type:e,data:t}));return Promise.all(n)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.actors.forEach(e=>{e.remove()}),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,t){for(let n of this.actors)n.registerMessageHandler(e,t)}}function V(){return R||(R=new B(z(),t.G),R.registerMessageHandler(`GR`,(e,n,r)=>t.m(n,r))),R}function H(e,n){let r=t.H();return t.J(r,r,[1,1,0]),t.K(r,r,[.5*e.width,.5*e.height,1]),t.L(r,r,e.calculatePosMatrix(n.toUnwrapped()))}function U(e,t,n,r,i,a){let o=function(e,t,n){if(e)for(let r of e){let e=t[r];if(e&&e.source===n&&e.type===`fill-extrusion`)return!0}else for(let e in t){let r=t[e];if(r.source===n&&r.type===`fill-extrusion`)return!0}return!1}(i&&i.layers,t,e.id),s=a.maxPitchScaleFactor(),c=e.tilesIn(r,s,o);c.sort(W);let l=[];for(let r of c)l.push({wrappedTileID:r.tileID.wrapped().key,queryResults:r.tile.queryRenderedFeatures(t,n,e._state,r.queryGeometry,r.cameraQueryGeometry,r.scale,i,a,s,H(e.transform,r.tileID))});let u=function(e){let t={},n={};for(let r of e){let e=r.queryResults,i=r.wrappedTileID,a=n[i]=n[i]||{};for(let n in e){let r=e[n],i=a[n]=a[n]||{},o=t[n]=t[n]||[];for(let e of r)i[e.featureIndex]||(i[e.featureIndex]=!0,o.push(e))}}return t}(l);for(let t in u)u[t].forEach(t=>{let n=t.feature,r=e.getFeatureState(n.layer[`source-layer`],n.id);n.source=n.layer.source,n.layer[`source-layer`]&&(n.sourceLayer=n.layer[`source-layer`]),n.state=r});return u}function W(e,t){let n=e.tileID,r=t.tileID;return n.overscaledZ-r.overscaledZ||n.canonical.y-r.canonical.y||n.wrap-r.wrap||n.canonical.x-r.canonical.x}function G(e,n,r){return t._(this,void 0,void 0,function*(){let i=e;if(e.url?i=(yield t.h(n.transformRequest(e.url,`Source`),r)).data:yield a.frameAsync(r),!i)return null;let o=t.M(t.e(i,e),[`tiles`,`minzoom`,`maxzoom`,`attribution`,`bounds`,`scheme`,`tileSize`,`encoding`]);return`vector_layers`in i&&i.vector_layers&&(o.vectorLayerIds=i.vector_layers.map(e=>e.id)),o})}class K{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof t.N?new t.N(e.lng,e.lat):t.N.convert(e),this}setSouthWest(e){return this._sw=e instanceof t.N?new t.N(e.lng,e.lat):t.N.convert(e),this}extend(e){let n=this._sw,r=this._ne,i,a;if(e instanceof t.N)i=e,a=e;else{if(!(e instanceof K))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(K.convert(e)):this.extend(t.N.convert(e)):e&&(`lng`in e||`lon`in e)&&`lat`in e?this.extend(t.N.convert(e)):this;if(i=e._sw,a=e._ne,!i||!a)return this}return n||r?(n.lng=Math.min(i.lng,n.lng),n.lat=Math.min(i.lat,n.lat),r.lng=Math.max(a.lng,r.lng),r.lat=Math.max(a.lat,r.lat)):(this._sw=new t.N(i.lng,i.lat),this._ne=new t.N(a.lng,a.lat)),this}getCenter(){return new t.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 t.N(this.getWest(),this.getNorth())}getSouthEast(){return new t.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(e){let{lng:n,lat:r}=t.N.convert(e),i=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&i}static convert(e){return e instanceof K?e:e&&new K(e)}static fromLngLat(e,n=0){let r=360*n/40075017,i=r/Math.cos(Math.PI/180*e.lat);return new K(new t.N(e.lng-i,e.lat-r),new t.N(e.lng+i,e.lat+r))}adjustAntiMeridian(){let e=new t.N(this._sw.lng,this._sw.lat),n=new t.N(this._ne.lng,this._ne.lat);return new K(e,e.lng>n.lng?new t.N(n.lng+360,n.lat):n)}}class q{constructor(e,t,n){this.bounds=K.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=n||24}validateBounds(e){return Array.isArray(e)&&e.length===4?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){let n=2**e.z,r=Math.floor(t.O(this.bounds.getWest())*n),i=Math.floor(t.Q(this.bounds.getNorth())*n),a=Math.ceil(t.O(this.bounds.getEast())*n),o=Math.ceil(t.Q(this.bounds.getSouth())*n);return e.x>=r&&e.x<a&&e.y>=i&&e.y<o}}class J extends t.E{constructor(e,n,r,i){if(super(),this.id=e,this.dispatcher=r,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.e(this,t.M(n,[`url`,`scheme`,`tileSize`,`promoteId`])),this._options=t.e({type:`vector`},n),this._collectResourceTiming=n.collectResourceTiming,this.tileSize!==512)throw Error(`vector tile sources must have a tileSize of 512`);this.setEventedParent(i)}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k(`dataloading`,{dataType:`source`})),this._tileJSONRequest=new AbortController;try{let e=yield G(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),e&&(t.e(this,e),e.bounds&&(this.tileBounds=new q(e.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k(`data`,{dataType:`source`,sourceDataType:`metadata`})),this.fire(new t.k(`data`,{dataType:`source`,sourceDataType:`content`})))}catch(e){this._tileJSONRequest=null,this.fire(new t.j(e))}})}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&=(this._tileJSONRequest.abort(),null)}serialize(){return t.e({},this._options)}loadTile(e){return t._(this,void 0,void 0,function*(){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n={request:this.map._requestManager.transformRequest(t,`Tile`),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};n.request.collectResourceTiming=this._collectResourceTiming;let r=`RT`;if(e.actor&&e.state!==`expired`){if(e.state===`loading`)return new Promise((t,n)=>{e.reloadPromise={resolve:t,reject:n}})}else e.actor=this.dispatcher.getActor(),r=`LT`;e.abortController=new AbortController;try{let t=yield e.actor.sendAsync({type:r,data:n},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,t)}catch(t){if(delete e.abortController,e.aborted)return;if(t&&t.status!==404)throw t;this._afterTileLoadWorkerResponse(e,null)}})}_afterTileLoadWorkerResponse(e,t){if(t&&t.resourceTiming&&(e.resourceTiming=t.resourceTiming),t&&this.map._refreshExpiredTiles&&e.setExpiryData(t),e.loadVectorData(t,this.map.painter),e.reloadPromise){let t=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(t.resolve).catch(t.reject)}}abortTile(e){return t._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:`AT`,data:{uid:e.uid,type:this.type,source:this.id}}))})}unloadTile(e){return t._(this,void 0,void 0,function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:`RMT`,data:{uid:e.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Y extends t.E{constructor(e,n,r,i){super(),this.id=e,this.dispatcher=r,this.setEventedParent(i),this.type=`raster`,this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme=`xyz`,this.tileSize=512,this._loaded=!1,this._options=t.e({type:`raster`},n),t.e(this,t.M(n,[`url`,`scheme`,`tileSize`]))}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k(`dataloading`,{dataType:`source`})),this._tileJSONRequest=new AbortController;try{let e=yield G(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,e&&(t.e(this,e),e.bounds&&(this.tileBounds=new q(e.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k(`data`,{dataType:`source`,sourceDataType:`metadata`})),this.fire(new t.k(`data`,{dataType:`source`,sourceDataType:`content`})))}catch(e){this._tileJSONRequest=null,this.fire(new t.j(e))}})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&=(this._tileJSONRequest.abort(),null)}setSourceProperty(e){this._tileJSONRequest&&=(this._tileJSONRequest.abort(),null),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return t.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return t._(this,void 0,void 0,function*(){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{let n=yield p.getImage(this.map._requestManager.transformRequest(t,`Tile`),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state=`unloaded`);if(n&&n.data){this.map._refreshExpiredTiles&&n.cacheControl&&n.expires&&e.setExpiryData({cacheControl:n.cacheControl,expires:n.expires});let t=this.map.painter.context,r=t.gl,i=n.data;e.texture=this.map.painter.getTileTexture(i.width),e.texture?e.texture.update(i,{useMipmap:!0}):(e.texture=new x(t,i,r.RGBA,{useMipmap:!0}),e.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_NEAREST)),e.state=`loaded`}}catch(t){if(delete e.abortController,e.aborted)e.state=`unloaded`;else if(t)throw e.state=`errored`,t}})}abortTile(e){return t._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)})}unloadTile(e){return t._(this,void 0,void 0,function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)})}hasTransition(){return!1}}class X extends Y{constructor(e,n,r,i){super(e,n,r,i),this.type=`raster-dem`,this.maxzoom=22,this._options=t.e({type:`raster-dem`},n),this.encoding=n.encoding||`mapbox`,this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(e){return t._(this,void 0,void 0,function*(){let n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r=this.map._requestManager.transformRequest(n,`Tile`);e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let n=yield p.getImage(r,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state=`unloaded`);if(n&&n.data){let r=n.data;this.map._refreshExpiredTiles&&n.cacheControl&&n.expires&&e.setExpiryData({cacheControl:n.cacheControl,expires:n.expires});let i=t.b(r)&&t.U()?r:yield this.readImageNow(r),a={type:this.type,uid:e.uid,source:this.id,rawImageData:i,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};(!e.actor||e.state===`expired`)&&(e.actor=this.dispatcher.getActor(),e.dem=yield e.actor.sendAsync({type:`LDT`,data:a}),e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state=`loaded`)}}catch(t){if(delete e.abortController,e.aborted)e.state=`unloaded`;else if(t)throw e.state=`errored`,t}})}readImageNow(e){return t._(this,void 0,void 0,function*(){if(typeof VideoFrame<`u`&&t.V()){let n=e.width+2,r=e.height+2;try{return new t.R({width:n,height:r},yield t.W(e,-1,-1,n,r))}catch{}}return a.getImageData(e,1)})}_getNeighboringTiles(e){let n=e.canonical,r=2**n.z,i=(n.x-1+r)%r,a=n.x===0?e.wrap-1:e.wrap,o=(n.x+1+r)%r,s=n.x+1===r?e.wrap+1:e.wrap,c={};return c[new t.S(e.overscaledZ,a,n.z,i,n.y).key]={backfilled:!1},c[new t.S(e.overscaledZ,s,n.z,o,n.y).key]={backfilled:!1},n.y>0&&(c[new t.S(e.overscaledZ,a,n.z,i,n.y-1).key]={backfilled:!1},c[new t.S(e.overscaledZ,e.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},c[new t.S(e.overscaledZ,s,n.z,o,n.y-1).key]={backfilled:!1}),n.y+1<r&&(c[new t.S(e.overscaledZ,a,n.z,i,n.y+1).key]={backfilled:!1},c[new t.S(e.overscaledZ,e.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},c[new t.S(e.overscaledZ,s,n.z,o,n.y+1).key]={backfilled:!1}),c}unloadTile(e){return t._(this,void 0,void 0,function*(){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state=`unloaded`,e.actor&&(yield e.actor.sendAsync({type:`RDT`,data:{type:this.type,uid:e.uid,source:this.id}}))})}}class Z extends t.E{constructor(e,n,r,i){super(),this.id=e,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=r.getActor(),this.setEventedParent(i),this._data=n.data,this._options=t.e({},n),this._collectResourceTiming=n.collectResourceTiming,n.maxzoom!==void 0&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;let a=t.X/this.tileSize;n.clusterMaxZoom!==void 0&&this.maxzoom<=n.clusterMaxZoom&&t.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${n.clusterMaxZoom}".`),this.workerOptions=t.e({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(n.buffer===void 0?128:n.buffer)*a,tolerance:(n.tolerance===void 0?.375:n.tolerance)*a,extent:t.X,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:n.clusterMaxZoom===void 0?this.maxzoom-1:n.clusterMaxZoom,minPoints:Math.max(2,n.clusterMinPoints||2),extent:t.X,radius:(n.clusterRadius||50)*a,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions),typeof this.promoteId==`string`&&(this.workerOptions.promoteId=this.promoteId)}load(){return t._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(e){return this._updateWorkerData(e),this}getData(){return t._(this,void 0,void 0,function*(){let e=t.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:`GD`,data:e})})}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(e.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=e.clusterRadius),e.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=e.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:`GCEZ`,data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:`GCC`,data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,t,n){return this.actor.sendAsync({type:`GCL`,data:{type:this.type,source:this.id,clusterId:e,limit:t,offset:n}})}_updateWorkerData(e){return t._(this,void 0,void 0,function*(){let n=t.e({type:this.type},this.workerOptions);e?n.dataDiff=e:typeof this._data==`string`?(n.request=this.map._requestManager.transformRequest(a.resolveURL(this._data),`Source`),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new t.k(`dataloading`,{dataType:`source`}));try{let e=yield this.actor.sendAsync({type:`LD`,data:n});if(this._pendingLoads--,this._removed||e.abandoned)return void this.fire(new t.k(`dataabort`,{dataType:`source`}));let r=null;e.resourceTiming&&e.resourceTiming[this.id]&&(r=e.resourceTiming[this.id].slice(0));let i={dataType:`source`};this._collectResourceTiming&&r&&r.length>0&&t.e(i,{resourceTiming:r}),this.fire(new t.k(`data`,Object.assign(Object.assign({},i),{sourceDataType:`metadata`}))),this.fire(new t.k(`data`,Object.assign(Object.assign({},i),{sourceDataType:`content`})))}catch(e){if(this._pendingLoads--,this._removed)return void this.fire(new t.k(`dataabort`,{dataType:`source`}));this.fire(new t.j(e))}})}loaded(){return this._pendingLoads===0}loadTile(e){return t._(this,void 0,void 0,function*(){let t=e.actor?`RT`:`LT`;e.actor=this.actor;let n={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.abortController=new AbortController;let r=yield this.actor.sendAsync({type:t,data:n},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(r,this.map.painter,t===`RT`)})}abortTile(e){return t._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0})}unloadTile(e){return t._(this,void 0,void 0,function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:`RMT`,data:{uid:e.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 t.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Q=t.Y([{name:`a_pos`,type:`Int16`,components:2},{name:`a_texture_pos`,type:`Int16`,components:2}]);class ee extends t.E{constructor(e,t,n,r){super(),this.id=e,this.dispatcher=n,this.coordinates=t.coordinates,this.type=`image`,this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=t}load(e){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k(`dataloading`,{dataType:`source`})),this.url=this.options.url,this._request=new AbortController;try{let t=yield p.getImage(this.map._requestManager.transformRequest(this.url,`Image`),this._request);this._request=null,this._loaded=!0,t&&t.data&&(this.image=t.data,e&&(this.coordinates=e),this._finishLoading())}catch(e){this._request=null,this._loaded=!0,this.fire(new t.j(e))}})}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&=(this._request.abort(),null),this.options.url=e.url,this.load(e.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.k(`data`,{dataType:`source`,sourceDataType:`metadata`})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&=(this._request.abort(),null)}setCoordinates(e){this.coordinates=e;let n=e.map(t.Z.fromLngLat);this.tileID=function(e){let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let t of e)n=Math.min(n,t.x),r=Math.min(r,t.y),i=Math.max(i,t.x),a=Math.max(a,t.y);let o=Math.max(i-n,a-r),s=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),c=2**s;return new t.a1(s,Math.floor((n+i)/2*c),Math.floor((r+a)/2*c))}(n),this.minzoom=this.maxzoom=this.tileID.z;let r=n.map(e=>this.tileID.getTilePoint(e)._round());return this._boundsArray=new t.$,this._boundsArray.emplaceBack(r[0].x,r[0].y,0,0),this._boundsArray.emplaceBack(r[1].x,r[1].y,t.X,0),this._boundsArray.emplaceBack(r[3].x,r[3].y,0,t.X),this._boundsArray.emplaceBack(r[2].x,r[2].y,t.X,t.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.k(`data`,{dataType:`source`,sourceDataType:`content`})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let e=this.map.painter.context,n=e.gl;this.boundsBuffer||=e.createVertexBuffer(this._boundsArray,Q.members),this.boundsSegments||=t.a0.simpleSegment(0,0,4,2),this.texture||(this.texture=new x(e,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let r=!1;for(let e in this.tiles){let t=this.tiles[e];t.state!==`loaded`&&(t.state=`loaded`,t.texture=this.texture,r=!0)}r&&this.fire(new t.k(`data`,{dataType:`source`,sourceDataType:`idle`,sourceId:this.id}))}loadTile(e){return t._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state=`errored`})}serialize(){return{type:`image`,url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class te extends ee{constructor(e,t,n,r){super(e,t,n,r),this.roundZoom=!0,this.type=`video`,this.options=t}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1;let e=this.options;this.urls=[];for(let t of e.urls)this.urls.push(this.map._requestManager.transformRequest(t,`Source`).url);try{let e=yield t.a3(this.urls);if(this._loaded=!0,!e)return;this.video=e,this.video.loop=!0,this.video.addEventListener(`playing`,()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(e){this.fire(new t.j(e))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){let n=this.video.seekable;e<n.start(0)||e>n.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,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 e=this.map.painter.context,n=e.gl;this.boundsBuffer||=e.createVertexBuffer(this._boundsArray,Q.members),this.boundsSegments||=t.a0.simpleSegment(0,0,4,2),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new x(e,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let r=!1;for(let e in this.tiles){let t=this.tiles[e];t.state!==`loaded`&&(t.state=`loaded`,t.texture=this.texture,r=!0)}r&&this.fire(new t.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 ne extends ee{constructor(e,n,r,i){super(e,n,r,i),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(e=>!Array.isArray(e)||e.length!==2||e.some(e=>typeof e!=`number`))||this.fire(new t.j(new t.a2(`sources.${e}`,null,`"coordinates" property must be an array of 4 longitude/latitude array pairs`))):this.fire(new t.j(new t.a2(`sources.${e}`,null,`missing required property "coordinates"`))),n.animate&&typeof n.animate!=`boolean`&&this.fire(new t.j(new t.a2(`sources.${e}`,null,`optional "animate" property must be a boolean value`))),n.canvas?typeof n.canvas==`string`||n.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${e}`,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.j(new t.a2(`sources.${e}`,null,`missing required property "canvas"`))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){return t._(this,void 0,void 0,function*(){this._loaded=!0,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 t.j(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(),!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let n=this.map.painter.context,r=n.gl;this.boundsBuffer||=n.createVertexBuffer(this._boundsArray,Q.members),this.boundsSegments||=t.a0.simpleSegment(0,0,4,2),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new x(n,this.canvas,r.RGBA,{premultiply:!0});let i=!1;for(let e in this.tiles){let t=this.tiles[e];t.state!==`loaded`&&(t.state=`loaded`,t.texture=this.texture,i=!0)}i&&this.fire(new t.k(`data`,{dataType:`source`,sourceDataType:`idle`,sourceId:this.id}))}serialize(){return{type:`canvas`,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}let re={},ie=e=>{switch(e){case`geojson`:return Z;case`image`:return ee;case`raster`:return Y;case`raster-dem`:return X;case`vector`:return J;case`video`:return te;case`canvas`:return ne}return re[e]},ae=`RTLPluginLoaded`;class oe extends t.E{constructor(){super(...arguments),this.status=`unavailable`,this.url=null,this.dispatcher=V()}_syncState(e){return this.status=e,this.dispatcher.broadcast(`SRPS`,{pluginStatus:e,pluginURL:this.url}).catch(e=>{throw this.status=`error`,e})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status=`unavailable`,this.url=null}setRTLTextPlugin(e){return t._(this,arguments,void 0,function*(e,t=!1){if(this.url)throw Error(`setRTLTextPlugin cannot be called multiple times.`);if(this.url=a.resolveURL(e),!this.url)throw Error(`requested url ${e} is invalid`);if(this.status===`unavailable`){if(!t)return this._requestImport();this.status=`deferred`,this._syncState(this.status)}else if(this.status===`requested`)return this._requestImport()})}_requestImport(){return t._(this,void 0,void 0,function*(){yield this._syncState(`loading`),this.status=`loaded`,this.fire(new t.k(ae))})}lazyLoad(){this.status===`unavailable`?this.status=`requested`:this.status===`deferred`&&this._requestImport()}}let se=null;function ce(){return se||=new oe,se}class le{constructor(e,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=t.a4(),this.uses=0,this.tileSize=n,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(e){let t=e+this.timeAdded;t<this.fadeEndTime||(this.fadeEndTime=t)}wasRequested(){return this.state===`errored`||this.state===`loaded`||this.state===`reloading`}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,n,r){if(this.hasData()&&this.unloadVectorData(),this.state=`loaded`,e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(e,t){let n={};if(!t)return n;for(let r of e){let e=r.layerIds.map(e=>t.getLayer(e)).filter(Boolean);if(e.length!==0){r.layers=e,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map(t=>e.filter(e=>e.id===t)[0]));for(let t of e)n[t.id]=r}}return n}(e.buckets,n.style),this.hasSymbolBuckets=!1;for(let e in this.buckets){let n=this.buckets[e];if(n instanceof t.a6){if(this.hasSymbolBuckets=!0,!r)break;n.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let e in this.buckets){let n=this.buckets[e];if(n instanceof t.a6&&n.hasRTLText){this.hasRTLText=!0,ce().lazyLoad();break}}this.queryPadding=0;for(let e in this.buckets){let t=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(e).queryRadius(t))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&=null,this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state=`unloaded`}getBucket(e){return this.buckets[e.id]}upload(e){for(let t in this.buckets){let n=this.buckets[t];n.uploadPending()&&n.upload(e)}let t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new x(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&=(this.glyphAtlasTexture=new x(e,this.glyphAtlasImage,t.ALPHA),null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,n,r,i,a,o,s,c,l){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:l,transform:s,params:o,queryPadding:this.queryPadding*c},e,t,n):{}}querySourceFeatures(e,n){let r=this.latestFeatureIndex;if(!r||!r.rawTileData)return;let i=r.loadVTLayers(),a=n&&n.sourceLayer?n.sourceLayer:``,o=i._geojsonTileLayer||i[a];if(!o)return;let s=t.a7(n&&n.filter),{z:c,x:l,y:u}=this.tileID.canonical,d={z:c,x:l,y:u};for(let n=0;n<o.length;n++){let i=o.feature(n);if(s.needGeometry){let e=t.a8(i,!0);if(!s.filter(new t.z(this.tileID.overscaledZ),e,this.tileID.canonical))continue}else if(!s.filter(new t.z(this.tileID.overscaledZ),i))continue;let f=r.getId(i,a),p=new t.a9(i,c,l,u,f);p.tile=d,e.push(p)}}hasData(){return this.state===`loaded`||this.state===`reloading`||this.state===`expired`}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){let n=this.expirationTime;if(e.cacheControl){let n=t.aa(e.cacheControl);n[`max-age`]&&(this.expirationTime=Date.now()+1e3*n[`max-age`])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){let e=Date.now(),t=!1;if(this.expirationTime>e)t=!1;else if(n)if(this.expirationTime<n)t=!0;else{let r=this.expirationTime-n;r?this.expirationTime=e+Math.max(r,3e4):t=!0}else t=!0;t?(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(),2**31-1)}setFeatureState(e,t){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0)return;let n=this.latestFeatureIndex.loadVTLayers();for(let r in this.buckets){if(!t.style.hasLayer(r))continue;let i=this.buckets[r],a=i.layers[0].sourceLayer||`_geojsonTileLayer`,o=n[a],s=e[a];if(!o||!s||Object.keys(s).length===0)continue;i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});let c=t&&t.style&&t.style.getLayer(r);c&&(this.queryPadding=Math.max(this.queryPadding,c.queryRadius(i)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<a.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=a.now()+e}setDependencies(e,t){let n={};for(let e of t)n[e]=!0;this.dependencies[e]=n}hasDependency(e,t){for(let n of e){let e=this.dependencies[n];if(e){for(let n of t)if(e[n])return!0}}return!1}}class ue{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(let e in this.data)for(let t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,n){let r=e.wrapped().key;this.data[r]===void 0&&(this.data[r]=[]);let i={value:t,timeout:void 0};if(n!==void 0&&(i.timeout=setTimeout(()=>{this.remove(e,i)},n)),this.data[r].push(i),this.order.push(r),this.order.length>this.max){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){let t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){let t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;let n=e.wrapped().key,r=t===void 0?0:this.data[n].indexOf(t),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(i.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){let t=[];for(let n in this.data)for(let r of this.data[n])e(r.value)||t.push(r);for(let e of t)this.remove(e.value.tileID,e)}}class de{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,n,r){let i=String(n);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][i]=this.stateChanges[e][i]||{},t.e(this.stateChanges[e][i],r),this.deletedStates[e]===null){this.deletedStates[e]={};for(let t in this.state[e])t!==i&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][i]===null){this.deletedStates[e][i]={};for(let t in this.state[e][i])r[t]||(this.deletedStates[e][i][t]=null)}else for(let t in r)this.deletedStates[e]&&this.deletedStates[e][i]&&this.deletedStates[e][i][t]===null&&delete this.deletedStates[e][i][t]}removeFeatureState(e,t,n){if(this.deletedStates[e]===null)return;let r=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},n&&t!==void 0)this.deletedStates[e][r]!==null&&(this.deletedStates[e][r]=this.deletedStates[e][r]||{},this.deletedStates[e][r][n]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][r])for(n in this.deletedStates[e][r]={},this.stateChanges[e][r])this.deletedStates[e][r][n]=null;else this.deletedStates[e][r]=null;else this.deletedStates[e]=null}getState(e,n){let r=String(n),i=t.e({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){let t=this.deletedStates[e][n];if(t===null)return{};for(let e in t)delete i[e]}return i}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(e,n){let r={};for(let e in this.stateChanges){this.state[e]=this.state[e]||{};let n={};for(let r in this.stateChanges[e])this.state[e][r]||(this.state[e][r]={}),t.e(this.state[e][r],this.stateChanges[e][r]),n[r]=this.state[e][r];r[e]=n}for(let e in this.deletedStates){this.state[e]=this.state[e]||{};let n={};if(this.deletedStates[e]===null)for(let t in this.state[e])n[t]={},this.state[e][t]={};else for(let t in this.deletedStates[e]){if(this.deletedStates[e][t]===null)this.state[e][t]={};else for(let n of Object.keys(this.deletedStates[e][t]))delete this.state[e][t][n];n[t]=this.state[e][t]}r[e]=r[e]||{},t.e(r[e],n)}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0)for(let t in e)e[t].setFeatureState(r,n)}}class fe extends t.E{constructor(e,t,n){super(),this.id=e,this.dispatcher=n,this.on(`data`,e=>this._dataHandler(e)),this.on(`dataloading`,()=>{this._sourceErrored=!1}),this.on(`error`,()=>{this._sourceErrored=this._source.loaded()}),this._source=((e,t,n,r)=>{let i=new(ie(t.type))(e,t,n,r);if(i.id!==e)throw Error(`Expected Source id to be ${e} instead of ${i.id}`);return i})(e,t,n,this),this._tiles={},this._cache=new ue(0,e=>this._unloadTile(e)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new de,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}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 e in this._tiles){let t=this._tiles[e];if(t.state!==`loaded`&&t.state!==`errored`)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,n,r){return t._(this,void 0,void 0,function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,n,r)}catch(n){e.state=`errored`,n.status===404?this.update(this.transform,this.terrain):this._source.fire(new t.j(n,{tile:e}))}})}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new t.k(`dataabort`,{tile:e,coord:e.tileID,dataType:`source`}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let t in this._tiles){let n=this._tiles[t];n.upload(e),n.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(pe).map(e=>e.key)}getRenderableIds(e){let n=[];for(let t in this._tiles)this._isIdRenderable(t,e)&&n.push(this._tiles[t]);return e?n.sort((e,n)=>{let r=e.tileID,i=n.tileID,a=new t.P(r.canonical.x,r.canonical.y)._rotate(this.transform.angle),o=new t.P(i.canonical.x,i.canonical.y)._rotate(this.transform.angle);return r.overscaledZ-i.overscaledZ||o.y-a.y||o.x-a.x}).map(e=>e.tileID.key):n.map(e=>e.tileID).sort(pe).map(e=>e.key)}hasRenderableParent(e){let t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let e in this._tiles)this._tiles[e].state!==`errored`&&this._reloadTile(e,`reloading`)}}_reloadTile(e,n){return t._(this,void 0,void 0,function*(){let t=this._tiles[e];t&&(t.state!==`loading`&&(t.state=n),yield this._loadTile(t,e,n))})}_tileLoaded(e,n,r){e.timeAdded=a.now(),r===`expired`&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(n,e),this.getSource().type===`raster-dem`&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new t.k(`data`,{dataType:`source`,tile:e,coord:e.tileID}))}_backfillDEM(e){let t=this.getRenderableIds();for(let r=0;r<t.length;r++){let i=t[r];if(e.neighboringTiles&&e.neighboringTiles[i]){let t=this.getTileByID(i);n(e,t),n(t,e)}}function n(e,t){e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0;let n=t.tileID.canonical.x-e.tileID.canonical.x,r=t.tileID.canonical.y-e.tileID.canonical.y,i=2**e.tileID.canonical.z,a=t.tileID.key;n===0&&r===0||Math.abs(r)>1||(Math.abs(n)>1&&(Math.abs(n+i)===1?n+=i:Math.abs(n-i)===1&&(n-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,n,r),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,n,r){for(let i in this._tiles){let a=this._tiles[i];if(r[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>n)continue;let o=a.tileID;for(;a&&a.tileID.overscaledZ>t+1;){let e=a.tileID.scaledTo(a.tileID.overscaledZ-1);a=this._tiles[e.key],a&&a.hasData()&&(o=e)}let s=o;for(;s.overscaledZ>t;)if(s=s.scaledTo(s.overscaledZ-1),e[s.key]){r[o.key]=o;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){let n=this._loadedParentTiles[e.key];return n&&n.tileID.overscaledZ>=t?n:null}for(let n=e.overscaledZ-1;n>=t;n--){let t=e.scaledTo(n),r=this._getLoadedTile(t);if(r)return r}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){let t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){let n=Math.ceil(e.width/this._source.tileSize)+1,r=Math.ceil(e.height/this._source.tileSize)+1,i=Math.floor(n*r*(this._maxTileCacheZoomLevels===null?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),a=typeof this._maxTileCacheSize==`number`?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(a)}handleWrapJump(e){let t=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,t){let e={};for(let n in this._tiles){let r=this._tiles[n];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+t),e[r.tileID.key]=r}this._tiles=e;for(let e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(let e in this._tiles)this._setTileReloadTimer(e,this._tiles[e])}}_updateCoveredAndRetainedTiles(e,t,n,r,i,o){let s={},c={},l=Object.keys(e),u=a.now();for(let n of l){let r=e[n],i=this._tiles[n];if(!i||i.fadeEndTime!==0&&i.fadeEndTime<=u)continue;let a=this.findLoadedParent(r,t),o=this.findLoadedSibling(r),l=a||o||null;l&&(this._addTile(l.tileID),s[l.tileID.key]=l.tileID),c[n]=r}this._retainLoadedChildren(c,r,n,e);for(let t in s)e[t]||(this._coveredTiles[t]=!0,e[t]=s[t]);if(o){let t={},n={};for(let e of i)this._tiles[e.key].hasData()?t[e.key]=e:n[e.key]=e;for(let r in n){let i=n[r].children(this._source.maxzoom);this._tiles[i[0].key]&&this._tiles[i[1].key]&&this._tiles[i[2].key]&&this._tiles[i[3].key]&&(t[i[0].key]=e[i[0].key]=i[0],t[i[1].key]=e[i[1].key]=i[1],t[i[2].key]=e[i[2].key]=i[2],t[i[3].key]=e[i[3].key]=i[3],delete n[r])}for(let r in n){let i=n[r],a=this.findLoadedParent(i,this._source.minzoom),o=this.findLoadedSibling(i),s=a||o||null;if(s){t[s.tileID.key]=e[s.tileID.key]=s.tileID;for(let e in t)t[e].isChildOf(s.tileID)&&delete t[e]}}for(let e in this._tiles)t[e]||(this._coveredTiles[e]=!0)}}update(e,n){if(!this._sourceLoaded||this._paused)return;let r;this.transform=e,this.terrain=n,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?r=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(e=>new t.S(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)):(r=e.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:n}),this._source.hasTile&&(r=r.filter(e=>this._source.hasTile(e)))):r=[];let i=e.coveringZoomLevel(this._source),a=Math.max(i-fe.maxOverzooming,this._source.minzoom),o=Math.max(i+fe.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let e={};for(let t of r)if(t.canonical.z>this._source.minzoom){let n=t.scaledTo(t.canonical.z-1);e[n.key]=n;let r=t.scaledTo(Math.max(this._source.minzoom,Math.min(t.canonical.z,5)));e[r.key]=r}r=r.concat(Object.values(e))}let s=r.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,s&&this.fire(new t.k(`data`,{sourceDataType:`idle`,dataType:`source`,sourceId:this.id}));let c=this._updateRetainedTiles(r,i);me(this._source.type)&&this._updateCoveredAndRetainedTiles(c,a,o,i,r,n);for(let e in c)this._tiles[e].clearFadeHold();let l=t.ab(this._tiles,c);for(let e of l){let t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(e)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,t){var n;let r={},i={},a=Math.max(t-fe.maxOverzooming,this._source.minzoom),o=Math.max(t+fe.maxUnderzooming,this._source.minzoom),s={};for(let n of e){let e=this._addTile(n);r[n.key]=n,e.hasData()||t<this._source.maxzoom&&(s[n.key]=n)}this._retainLoadedChildren(s,t,o,r);for(let o of e){let e=this._tiles[o.key];if(e.hasData())continue;if(t+1>this._source.maxzoom){let e=o.children(this._source.maxzoom)[0],t=this.getTile(e);if(t&&t.hasData()){r[e.key]=e;continue}}else{let e=o.children(this._source.maxzoom);if(r[e[0].key]&&r[e[1].key]&&r[e[2].key]&&r[e[3].key])continue}let s=e.wasRequested();for(let t=o.overscaledZ-1;t>=a;--t){let a=o.scaledTo(t);if(i[a.key])break;if(i[a.key]=!0,e=this.getTile(a),!e&&s&&(e=this._addTile(a)),e){let t=e.hasData();if((t||!((n=this.map)!=null&&n.cancelPendingTileRequestsWhileZooming)||s)&&(r[a.key]=a),s=e.wasRequested(),t)break}}}return r}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let e in this._tiles){let t=[],n,r=this._tiles[e].tileID;for(;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){n=this._loadedParentTiles[r.key];break}t.push(r.key);let e=r.scaledTo(r.overscaledZ-1);if(n=this._getLoadedTile(e),n)break;r=e}for(let e of t)this._loadedParentTiles[e]=n}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let e in this._tiles){let t=this._tiles[e].tileID,n=this._getLoadedTile(t);this._loadedSiblingTiles[t.key]=n}}_addTile(e){let n=this._tiles[e.key];if(n)return n;n=this._cache.getAndRemove(e),n&&(this._setTileReloadTimer(e.key,n),n.tileID=e,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,n)));let r=n;return n||(n=new le(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(n,e.key,n.state)),n.uses++,this._tiles[e.key]=n,r||this._source.fire(new t.k(`dataloading`,{tile:n,coord:n.tileID,dataType:`source`})),n}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);let n=t.getExpiryTimeout();n&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,`expired`),delete this._timers[e]},n))}_removeTile(e){let t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&t.state!==`reloading`?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}_dataHandler(e){let t=e.sourceDataType;e.dataType===`source`&&t===`metadata`&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&e.dataType===`source`&&t===`content`&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,n,r){let i=[],a=this.transform;if(!a)return i;let o=r?a.getCameraQueryGeometry(e):e,s=e.map(e=>a.pointCoordinate(e,this.terrain)),c=o.map(e=>a.pointCoordinate(e,this.terrain)),l=this.getIds(),u=1/0,d=1/0,f=-1/0,p=-1/0;for(let e of c)u=Math.min(u,e.x),d=Math.min(d,e.y),f=Math.max(f,e.x),p=Math.max(p,e.y);for(let e=0;e<l.length;e++){let r=this._tiles[l[e]];if(r.holdingForFade())continue;let o=r.tileID,m=2**(a.zoom-r.tileID.overscaledZ),h=n*r.queryPadding*t.X/r.tileSize/m,g=[o.getTilePoint(new t.Z(u,d)),o.getTilePoint(new t.Z(f,p))];if(g[0].x-h<t.X&&g[0].y-h<t.X&&g[1].x+h>=0&&g[1].y+h>=0){let e=s.map(e=>o.getTilePoint(e)),t=c.map(e=>o.getTilePoint(e));i.push({tile:r,tileID:o,queryGeometry:e,cameraQueryGeometry:t,scale:m})}}return i}getVisibleCoordinates(e){let t=this.getRenderableIds(e).map(e=>this._tiles[e].tileID);for(let e of t)e.posMatrix=this.transform.calculatePosMatrix(e.toUnwrapped());return t}hasTransition(){if(this._source.hasTransition())return!0;if(me(this._source.type)){let e=a.now();for(let t in this._tiles)if(this._tiles[t].fadeEndTime>=e)return!0}return!1}setFeatureState(e,t,n){this._state.updateState(e||=`_geojsonTileLayer`,t,n)}removeFeatureState(e,t,n){this._state.removeFeatureState(e||=`_geojsonTileLayer`,t,n)}getFeatureState(e,t){return this._state.getState(e||=`_geojsonTileLayer`,t)}setDependencies(e,t,n){let r=this._tiles[e];r&&r.setDependencies(t,n)}reloadTilesForDependencies(e,t){for(let n in this._tiles)this._tiles[n].hasDependency(e,t)&&this._reloadTile(n,`reloading`);this._cache.filter(n=>!n.hasDependency(e,t))}}function pe(e,t){let n=Math.abs(2*e.wrap)-+(e.wrap<0),r=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||r-n||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function me(e){return e===`raster`||e===`image`||e===`video`}fe.maxOverzooming=10,fe.maxUnderzooming=3;class he{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(this.points.length===1)return this.points[0];e=t.ac(e,0,1);let n=1,r=this._distances[n],i=e*this.paddedLength+this.padding;for(;r<i&&n<this._distances.length;)r=this._distances[++n];let a=n-1,o=this._distances[a],s=r-o,c=s>0?(i-o)/s:0;return this.points[a].mult(1-c).add(this.points[n].mult(c))}}function ge(e,t){let n=!0;return e===`always`||e!==`never`&&t!==`never`||(n=!1),n}class _e{constructor(e,t,n){let r=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/n),this.yCellCount=Math.ceil(t/n);for(let e=0;e<this.xCellCount*this.yCellCount;e++)r.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,n,r,i){this._forEachCell(t,n,r,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)}insertCircle(e,t,n,r){this._forEachCell(t-r,n-r,t+r,n+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(n),this.circles.push(r)}_insertBoxCell(e,t,n,r,i,a){this.boxCells[i].push(a)}_insertCircleCell(e,t,n,r,i,a){this.circleCells[i].push(a)}_query(e,t,n,r,i,a,o){if(n<0||e>this.width||r<0||t>this.height)return[];let s=[];if(e<=0&&t<=0&&this.width<=n&&this.height<=r){if(i)return[{key:null,x1:e,y1:t,x2:n,y2:r}];for(let e=0;e<this.boxKeys.length;e++)s.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){let t=this.circles[3*e],n=this.circles[3*e+1],r=this.circles[3*e+2];s.push({key:this.circleKeys[e],x1:t-r,y1:n-r,x2:t+r,y2:n+r})}}else this._forEachCell(e,t,n,r,this._queryCell,s,{hitTest:i,overlapMode:a,seenUids:{box:{},circle:{}}},o);return s}query(e,t,n,r){return this._query(e,t,n,r,!1,null)}hitTest(e,t,n,r,i,a){return this._query(e,t,n,r,!0,i,a).length>0}hitTestCircle(e,t,n,r,i){let a=e-n,o=e+n,s=t-n,c=t+n;if(o<0||a>this.width||c<0||s>this.height)return!1;let l=[];return this._forEachCell(a,s,o,c,this._queryCellCircle,l,{hitTest:!0,overlapMode:r,circle:{x:e,y:t,radius:n},seenUids:{box:{},circle:{}}},i),l.length>0}_queryCell(e,t,n,r,i,a,o,s){let{seenUids:c,hitTest:l,overlapMode:u}=o,d=this.boxCells[i];if(d!==null){let i=this.bboxes;for(let o of d)if(!c.box[o]){c.box[o]=!0;let d=4*o,f=this.boxKeys[o];if(e<=i[d+2]&&t<=i[d+3]&&n>=i[d+0]&&r>=i[d+1]&&(!s||s(f))&&(!l||!ge(u,f.overlapMode))&&(a.push({key:f,x1:i[d],y1:i[d+1],x2:i[d+2],y2:i[d+3]}),l))return!0}}let f=this.circleCells[i];if(f!==null){let i=this.circles;for(let o of f)if(!c.circle[o]){c.circle[o]=!0;let d=3*o,f=this.circleKeys[o];if(this._circleAndRectCollide(i[d],i[d+1],i[d+2],e,t,n,r)&&(!s||s(f))&&(!l||!ge(u,f.overlapMode))){let e=i[d],t=i[d+1],n=i[d+2];if(a.push({key:f,x1:e-n,y1:t-n,x2:e+n,y2:t+n}),l)return!0}}}return!1}_queryCellCircle(e,t,n,r,i,a,o,s){let{circle:c,seenUids:l,overlapMode:u}=o,d=this.boxCells[i];if(d!==null){let e=this.bboxes;for(let t of d)if(!l.box[t]){l.box[t]=!0;let n=4*t,r=this.boxKeys[t];if(this._circleAndRectCollide(c.x,c.y,c.radius,e[n+0],e[n+1],e[n+2],e[n+3])&&(!s||s(r))&&!ge(u,r.overlapMode))return a.push(!0),!0}}let f=this.circleCells[i];if(f!==null){let e=this.circles;for(let t of f)if(!l.circle[t]){l.circle[t]=!0;let n=3*t,r=this.circleKeys[t];if(this._circlesCollide(e[n],e[n+1],e[n+2],c.x,c.y,c.radius)&&(!s||s(r))&&!ge(u,r.overlapMode))return a.push(!0),!0}}}_forEachCell(e,t,n,r,i,a,o,s){let c=this._convertToXCellCoord(e),l=this._convertToYCellCoord(t),u=this._convertToXCellCoord(n),d=this._convertToYCellCoord(r);for(let f=c;f<=u;f++)for(let c=l;c<=d;c++)if(i.call(this,e,t,n,r,this.xCellCount*c+f,a,o,s))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,n,r,i,a){let o=r-e,s=i-t,c=n+a;return c*c>o*o+s*s}_circleAndRectCollide(e,t,n,r,i,a,o){let s=(a-r)/2,c=Math.abs(e-(r+s));if(c>s+n)return!1;let l=(o-i)/2,u=Math.abs(t-(i+l));if(u>l+n)return!1;if(c<=s||u<=l)return!0;let d=c-s,f=u-l;return d*d+f*f<=n*n}}function ve(e,n,r,i,a){let o=t.H();return n?(t.K(o,o,[1/a,1/a,1]),r||t.ad(o,o,i.angle)):t.L(o,i.labelPlaneMatrix,e),o}function ye(e,n,r,i,a){if(n){let n=t.ae(e);return t.K(n,n,[a,a,1]),r||t.ad(n,n,-i.angle),n}return i.glCoordMatrix}function be(e,n,r,i){let a;i?(a=[e,n,i(e,n),1],t.af(a,a,r)):(a=[e,n,0,1],Fe(a,a,r));let o=a[3];return{point:new t.P(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function xe(e,t){return .5+e/t*.5}function Se(e,t){return e.x>=-t[0]&&e.x<=t[0]&&e.y>=-t[1]&&e.y<=t[1]}function Ce(e,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=i?e.textSizeData:e.iconSizeData,_=t.ag(g,r.transform.zoom),v=[256/r.width*2+1,256/r.height*2+1],y=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;y.clear();let b=e.lineVertexArray,x=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,S=r.transform.width/r.transform.height,C=!1;for(let i=0;i<x.length;i++){let w=x.get(i);if(w.hidden||w.writingMode===t.ah.vertical&&!C){Pe(w.numGlyphs,y);continue}C=!1;let T=be(w.anchorX,w.anchorY,n,h);if(!Se(T.point,v)){Pe(w.numGlyphs,y);continue}let E=xe(r.transform.cameraToCenterDistance,T.signedDistanceFromCamera),D=t.ai(g,_,w),O=s?D/E:D*E,k={getElevation:h,labelPlaneMatrix:a,lineVertexArray:b,pitchWithMap:s,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:u,tileAnchorPoint:new t.P(w.anchorX,w.anchorY),unwrappedTileID:d,width:f,height:p,translation:m},A=Ee(k,w,O,!1,c,n,o,e.glyphOffsetArray,y,S,l);C=A.useVertical,(A.notEnoughRoom||C||A.needsFlipping&&Ee(k,w,O,!0,c,n,o,e.glyphOffsetArray,y,S,l).notEnoughRoom)&&Pe(w.numGlyphs,y)}i?e.text.dynamicLayoutVertexBuffer.updateData(y):e.icon.dynamicLayoutVertexBuffer.updateData(y)}function we(e,t,n,r,i,a,o,s){let c=a.glyphStartIndex+a.numGlyphs,l=a.lineStartIndex,u=a.lineStartIndex+a.lineLength,d=t.getoffsetX(a.glyphStartIndex),f=t.getoffsetX(c-1),p=Me(e*d,n,r,i,a.segment,l,u,s,o);if(!p)return null;let m=Me(e*f,n,r,i,a.segment,l,u,s,o);return m?s.projectionCache.anyProjectionOccluded?null:{first:p,last:m}:null}function Te(e,n,r,i){return e===t.ah.horizontal&&Math.abs(r.y-n.y)>Math.abs(r.x-n.x)*i?{useVertical:!0}:(e===t.ah.vertical?n.y<r.y:n.x>r.x)?{needsFlipping:!0}:null}function Ee(e,n,r,i,a,o,s,c,l,u,d){let f=r/24,p=n.lineOffsetX*f,m=n.lineOffsetY*f,h;if(n.numGlyphs>1){let t=n.glyphStartIndex+n.numGlyphs,r=n.lineStartIndex,o=n.lineStartIndex+n.lineLength,l=we(f,c,p,m,i,n,d,e);if(!l)return{notEnoughRoom:!0};let g=be(l.first.point.x,l.first.point.y,s,e.getElevation).point,_=be(l.last.point.x,l.last.point.y,s,e.getElevation).point;if(a&&!i){let e=Te(n.writingMode,g,_,u);if(e)return e}h=[l.first];for(let a=n.glyphStartIndex+1;a<t-1;a++)h.push(Me(f*c.getoffsetX(a),p,m,i,n.segment,r,o,e,d));h.push(l.last)}else{if(a&&!i){let r=be(e.tileAnchorPoint.x,e.tileAnchorPoint.y,o,e.getElevation).point,i=n.lineStartIndex+n.segment+1,a=new t.P(e.lineVertexArray.getx(i),e.lineVertexArray.gety(i)),s=be(a.x,a.y,o,e.getElevation),c=s.signedDistanceFromCamera>0?s.point:function(e,t,n,r,i,a){return De(e,t,n,1,i,a)}(e.tileAnchorPoint,a,r,0,o,e),l=Te(n.writingMode,r,c,u);if(l)return l}let r=Me(f*c.getoffsetX(n.glyphStartIndex),p,m,i,n.segment,n.lineStartIndex,n.lineStartIndex+n.lineLength,e,d);if(!r||e.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};h=[r]}for(let e of h)t.aj(l,e.point,e.angle);return{}}function De(e,t,n,r,i,a){let o=e.add(e.sub(t)._unit()),s=i===void 0?ke(o.x,o.y,a).point:be(o.x,o.y,i,a.getElevation).point,c=n.sub(s);return n.add(c._mult(r/c.mag()))}function Oe(e,n,r){let i=n.projectionCache;if(i.projections[e])return i.projections[e];let a=new t.P(n.lineVertexArray.getx(e),n.lineVertexArray.gety(e)),o=ke(a.x,a.y,n);if(o.signedDistanceFromCamera>0)return i.projections[e]=o.point,i.anyProjectionOccluded=i.anyProjectionOccluded||o.isOccluded,o.point;let s=e-r.direction;return function(e,t,n,r,i){return De(e,t,n,r,void 0,i)}(r.distanceFromAnchor===0?n.tileAnchorPoint:new t.P(n.lineVertexArray.getx(s),n.lineVertexArray.gety(s)),a,r.previousVertex,r.absOffsetX-r.distanceFromAnchor+1,n)}function ke(e,t,n){let r=e+n.translation[0],i=t+n.translation[1],a;return!n.pitchWithMap&&n.projection.useSpecialProjectionForSymbols?(a=n.projection.projectTileCoordinates(r,i,n.unwrappedTileID,n.getElevation),a.point.x=(.5*a.point.x+.5)*n.width,a.point.y=(.5*-a.point.y+.5)*n.height):(a=be(r,i,n.labelPlaneMatrix,n.getElevation),a.isOccluded=!1),a}function Ae(e,t,n){return e._unit()._perp()._mult(t*n)}function je(e,n,r,i,a,o,s,c,l){if(c.projectionCache.offsets[e])return c.projectionCache.offsets[e];let u=r.add(n);if(e+l.direction<i||e+l.direction>=a)return c.projectionCache.offsets[e]=u,u;let d=Oe(e+l.direction,c,l),f=Ae(d.sub(r),s,l.direction),p=r.add(f),m=d.add(f);return c.projectionCache.offsets[e]=t.ak(o,u,p,m)||u,c.projectionCache.offsets[e]}function Me(e,t,n,r,i,a,o,s,c){let l=r?e-t:e+t,u=l>0?1:-1,d=0;r&&(u*=-1,d=Math.PI),u<0&&(d+=Math.PI);let f,p=u>0?a+i:a+i+1;s.projectionCache.cachedAnchorPoint?f=s.projectionCache.cachedAnchorPoint:(f=ke(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=f);let m,h,g=f,_=f,v=0,y=0,b=Math.abs(l),x=[],S;for(;v+y<=b;){if(p+=u,p<a||p>=o)return null;v+=y,_=g,h=m;let e={absOffsetX:b,direction:u,distanceFromAnchor:v,previousVertex:_};if(g=Oe(p,s,e),n===0)x.push(_),S=g.sub(_);else{let t,r=g.sub(_);t=r.mag()===0?Ae(Oe(p+u,s,e).sub(g),n,u):Ae(r,n,u),h||=_.add(t),m=je(p,t,g,a,o,h,n,s,e),x.push(h),S=m.sub(h)}y=S.mag()}let C=S._mult((b-v)/y)._add(h||_),w=d+Math.atan2(g.y-_.y,g.x-_.x);return x.push(C),{point:C,angle:c?w:0,path:x}}let Ne=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Pe(e,t){for(let n=0;n<e;n++){let e=t.length;t.resize(e+4),t.float32.set(Ne,3*e)}}function Fe(e,t,n){let r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e[3]=n[3]*r+n[7]*i+n[15],e}class Ie{constructor(e,t,n=new _e(e.width+200,e.height+200,25),r=new _e(e.width+200,e.height+200,25)){this.transform=e,this.mapProjection=t,this.grid=n,this.ignoredGrid=r,this.pitchFactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+100,this.screenBottomBoundary=e.height+100,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,n,r,i,a,o,s,c,l,u){let d=e.anchorPointX+s[0],f=e.anchorPointY+s[1],p=this.projectAndGetPerspectiveRatio(r,d,f,i,l),m=n*p.perspectiveRatio,h;if(a||o)h=this._projectCollisionBox(e,m,r,i,a,o,s,p,l,u);else{let t=p.point.x+(u?u.x*m:0),n=p.point.y+(u?u.y*m:0);h={allPointsOccluded:!1,box:[t+e.x1*m,n+e.y1*m,t+e.x2*m,n+e.y2*m]}}let[g,_,v,y]=h.box;return this.mapProjection.useSpecialProjectionForSymbols&&(a?h.allPointsOccluded:this.mapProjection.isOccluded(d,f,i))||p.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(g,_,v,y)||t!==`always`&&this.grid.hitTest(g,_,v,y,t,c)?{box:[g,_,v,y],placeable:!1,offscreen:!1}:{box:[g,_,v,y],placeable:!0,offscreen:this.isOffscreen(g,_,v,y)}}placeCollisionCircles(e,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){let _=[],v=new t.P(n.anchorX,n.anchorY),y=this.getPerspectiveRatio(o,v.x,v.y,s,g),b=(d?a/y:a*y)/t.ap,x={getElevation:g,labelPlaneMatrix:c,lineVertexArray:r,pitchWithMap:d,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:v,unwrappedTileID:s,width:this.transform.width,height:this.transform.height,translation:h},S=we(b,i,n.lineOffsetX*b,n.lineOffsetY*b,!1,n,!1,x),C=!1,w=!1,T=!0;if(S){let n=.5*p*y+m,r=new t.P(-100,-100),i=new t.P(this.screenRightBoundary,this.screenBottomBoundary),a=new he,o=S.first,s=S.last,c=[];for(let e=o.path.length-1;e>=1;e--)c.push(o.path[e]);for(let e=1;e<s.path.length;e++)c.push(s.path[e]);let d=2.5*n;if(l){let e=this.projectPathToScreenSpace(c,x,l);c=e.some(e=>e.signedDistanceFromCamera<=0)?[]:e.map(e=>e.point)}let h=[];if(c.length>0){let e=c[0].clone(),n=c[0].clone();for(let t=1;t<c.length;t++)e.x=Math.min(e.x,c[t].x),e.y=Math.min(e.y,c[t].y),n.x=Math.max(n.x,c[t].x),n.y=Math.max(n.y,c[t].y);h=e.x>=r.x&&n.x<=i.x&&e.y>=r.y&&n.y<=i.y?[c]:n.x<r.x||e.x>i.x||n.y<r.y||e.y>i.y?[]:t.al([c],r.x,r.y,i.x,i.y)}for(let t of h){a.reset(t,.25*n);let r=0;r=a.length<=.5*n?1:Math.ceil(a.paddedLength/d)+1;for(let t=0;t<r;t++){let i=t/Math.max(r-1,1),o=a.lerp(i),s=o.x+100,c=o.y+100;_.push(s,c,n,0);let l=s-n,d=c-n,p=s+n,m=c+n;if(T&&=this.isOffscreen(l,d,p,m),w||=this.isInsideGrid(l,d,p,m),e!==`always`&&this.grid.hitTestCircle(s,c,n,e,f)&&(C=!0,!u))return{circles:[],offscreen:!1,collisionDetected:C}}}}return{circles:!u&&C||!w||y<this.perspectiveRatioCutoff?[]:_,offscreen:T,collisionDetected:C}}projectPathToScreenSpace(e,t,n){return e.map(e=>be(e.x,e.y,n,t.getElevation))}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let n=[],r=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of e){let e=new t.P(s.x+100,s.y+100);r=Math.min(r,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y),n.push(e)}let s=this.grid.query(r,i,a,o).concat(this.ignoredGrid.query(r,i,a,o)),c={},l={};for(let e of s){let r=e.key;if(c[r.bucketInstanceId]===void 0&&(c[r.bucketInstanceId]={}),c[r.bucketInstanceId][r.featureIndex])continue;let i=[new t.P(e.x1,e.y1),new t.P(e.x2,e.y1),new t.P(e.x2,e.y2),new t.P(e.x1,e.y2)];t.am(n,i)&&(c[r.bucketInstanceId][r.featureIndex]=!0,l[r.bucketInstanceId]===void 0&&(l[r.bucketInstanceId]=[]),l[r.bucketInstanceId].push(r.featureIndex))}return l}insertCollisionBox(e,t,n,r,i,a){(n?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:i,collisionGroupID:a,overlapMode:t},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,n,r,i,a){let o=n?this.ignoredGrid:this.grid,s={bucketInstanceId:r,featureIndex:i,collisionGroupID:a,overlapMode:t};for(let t=0;t<e.length;t+=4)o.insertCircle(s,e[t],e[t+1],e[t+2])}projectAndGetPerspectiveRatio(e,n,r,i,a){let o;a?(o=[n,r,a(n,r),1],t.af(o,o,e)):(o=[n,r,0,1],Fe(o,o,e));let s=o[3];return{point:new t.P((o[0]/s+1)/2*this.transform.width+100,(-o[1]/s+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s*.5,isOccluded:!1,signedDistanceFromCamera:s}}getPerspectiveRatio(e,t,n,r,i){let a=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(t,n,r,i):be(t,n,e,i);return .5+this.transform.cameraToCenterDistance/a.signedDistanceFromCamera*.5}isOffscreen(e,t,n,r){return n<100||e>=this.screenRightBoundary||r<100||t>this.screenBottomBoundary}isInsideGrid(e,t,n,r){return n>=0&&e<this.gridRightBoundary&&r>=0&&t<this.gridBottomBoundary}getViewportMatrix(){let e=t.an([]);return t.J(e,e,[-100,-100,0]),e}_projectCollisionBox(e,n,r,i,a,o,s,c,l,u){let d=new t.P(1,0),f=new t.P(0,1),p=new t.P(e.anchorPointX+s[0],e.anchorPointY+s[1]);if(o&&!a){let e=this.projectAndGetPerspectiveRatio(r,p.x+1,p.y,i,l).point.sub(c.point).unit(),n=Math.atan(e.y/e.x)+(e.x<0?Math.PI:0),a=Math.sin(n),o=Math.cos(n);d=new t.P(o,a),f=new t.P(-a,o)}else if(!o&&a){let e=-this.transform.angle,n=Math.sin(e),r=Math.cos(e);d=new t.P(r,n),f=new t.P(-n,r)}let m=c.point,h=n;a&&(m=p,h=2**-(this.transform.zoom-Math.floor(this.transform.zoom)),h*=this.mapProjection.getPitchedTextCorrection(this.transform,p,i),u||(h*=t.ac(.5+c.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),u&&(m=m.add(d.mult(u.x*h)).add(f.mult(u.y*h)));let g=e.x1*h,_=e.x2*h,v=(g+_)/2,y=e.y1*h,b=e.y2*h,x=(y+b)/2,S=[{offsetX:g,offsetY:y},{offsetX:v,offsetY:y},{offsetX:_,offsetY:y},{offsetX:_,offsetY:x},{offsetX:_,offsetY:b},{offsetX:v,offsetY:b},{offsetX:g,offsetY:b},{offsetX:g,offsetY:x}],C=[];for(let{offsetX:e,offsetY:n}of S)C.push(new t.P(m.x+d.x*e+f.x*n,m.y+d.y*e+f.y*n));let w=!1;if(a){let e=C.map(e=>this.projectAndGetPerspectiveRatio(r,e.x,e.y,i,l));w=e.some(e=>!e.isOccluded),C=e.map(e=>e.point)}else w=!0;return{box:t.ao(C),allPointsOccluded:!w}}}function Le(e,n,r){return n*(t.X/(e.tileSize*2**(r-e.tileID.overscaledZ)))}class Re{constructor(e,t,n,r){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):r&&n?1:0,this.placed=n}isHidden(){return this.opacity===0&&!this.placed}}class ze{constructor(e,t,n,r,i){this.text=new Re(e?e.text:null,t,n,i),this.icon=new Re(e?e.icon:null,t,r,i)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Be{constructor(e,t,n){this.text=e,this.icon=t,this.skipFade=n}}class Ve{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class He{constructor(e,t,n,r,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=n,this.bucketIndex=r,this.tileID=i}}class Ue{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){let t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function We(e,n,r,i,a){let{horizontalAlign:o,verticalAlign:s}=t.au(e);return new t.P(-(o-.5)*n+i[0]*a,-(s-.5)*r+i[1]*a)}class Ge{constructor(e,t,n,r,i,a){this.transform=e.clone(),this.terrain=n,this.collisionIndex=new Ie(this.transform,t),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=r,this.retainedQueryData={},this.collisionGroups=new Ue(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){let t=this.terrain;return t?(n,r)=>t.getElevation(e,n,r):null}getBucketParts(e,n,r,i){let a=r.getBucket(n),o=r.latestFeatureIndex;if(!a||!o||n.id!==a.layerIds[0])return;let s=r.collisionBoxArray,c=a.layers[0].layout,l=a.layers[0].paint,u=2**(this.transform.zoom-r.tileID.overscaledZ),d=r.tileSize/t.X,f=r.tileID.toUnwrapped(),p=this.transform.calculatePosMatrix(f),m=c.get(`text-pitch-alignment`)===`map`,h=c.get(`text-rotation-alignment`)===`map`,g=Le(r,1,this.transform.zoom),_=this.collisionIndex.mapProjection.translatePosition(this.transform,r,l.get(`text-translate`),l.get(`text-translate-anchor`)),v=this.collisionIndex.mapProjection.translatePosition(this.transform,r,l.get(`icon-translate`),l.get(`icon-translate-anchor`)),y=ve(p,m,h,this.transform,g),b=null;if(m){let e=ye(p,m,h,this.transform,g);b=t.L([],this.transform.labelPlaneMatrix,e)}this.retainedQueryData[a.bucketInstanceId]=new He(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,r.tileID);let x={bucket:a,layout:c,translationText:_,translationIcon:v,posMatrix:p,unwrappedTileID:f,textLabelPlaneMatrix:y,labelToScreenMatrix:b,scale:u,textPixelRatio:d,holdingForFade:r.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.ag(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(let t of a.sortKeyRanges){let{sortKey:n,symbolInstanceStart:r,symbolInstanceEnd:i}=t;e.push({sortKey:n,symbolInstanceStart:r,symbolInstanceEnd:i,parameters:x})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:x})}attemptAnchorPlacement(e,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y){let b=t.aq[e.textAnchor],x=[e.textOffset0,e.textOffset1],S=We(b,r,i,x,a),C=this.collisionIndex.placeCollisionBox(n,f,c,l,u,s,o,g,d.predicate,y,S);if((!v||this.collisionIndex.placeCollisionBox(v,f,c,l,u,s,o,_,d.predicate,y,S).placeable)&&C.placeable){let e;if(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(e=this.prevPlacement.variableOffsets[p.crossTileID].anchor),p.crossTileID===0)throw Error(`symbolInstance.crossTileID can't be 0`);return this.variableOffsets[p.crossTileID]={textOffset:x,width:r,height:i,anchor:b,textBoxScale:a,prevAnchor:e},this.markUsedJustification(m,b,p,h),m.allowVerticalPlacement&&(this.markUsedOrientation(m,h,p),this.placedOrientations[p.crossTileID]=h),{shift:S,placedGlyphBoxes:C}}}placeLayerBucketPart(e,n,r){let{bucket:i,layout:a,translationText:o,translationIcon:s,posMatrix:c,unwrappedTileID:l,textLabelPlaneMatrix:u,labelToScreenMatrix:d,textPixelRatio:f,holdingForFade:p,collisionBoxArray:m,partiallyEvaluatedTextSize:h,collisionGroup:g}=e.parameters,_=a.get(`text-optional`),v=a.get(`icon-optional`),y=t.ar(a,`text-overlap`,`text-allow-overlap`),b=y===`always`,x=t.ar(a,`icon-overlap`,`icon-allow-overlap`),S=x===`always`,C=a.get(`text-rotation-alignment`)===`map`,w=a.get(`text-pitch-alignment`)===`map`,T=a.get(`icon-text-fit`)!==`none`,E=a.get(`symbol-z-order`)===`viewport-y`,D=b&&(S||!i.hasIconData()||v),O=S&&(b||!i.hasTextData()||_);!i.collisionArrays&&m&&i.deserializeCollisionBoxes(m);let k=this._getTerrainElevationFunc(this.retainedQueryData[i.bucketInstanceId].tileID),A=(e,m,S)=>{if(n[e.crossTileID])return;if(p)return void(this.placements[e.crossTileID]=new Be(!1,!1,!1));let E=!1,A=!1,j=!0,M=null,N={box:null,placeable:!1,offscreen:null},P={box:null,placeable:!1,offscreen:null},F=null,I=null,L=null,R=0,z=0,B=0;m.textFeatureIndex?R=m.textFeatureIndex:e.useRuntimeCollisionCircles&&(R=e.featureIndex),m.verticalTextFeatureIndex&&(z=m.verticalTextFeatureIndex);let V=m.textBox;if(V){let n=n=>{let r=t.ah.horizontal;if(i.allowVerticalPlacement&&!n&&this.prevPlacement){let t=this.prevPlacement.placedOrientations[e.crossTileID];t&&(this.placedOrientations[e.crossTileID]=t,r=t,this.markUsedOrientation(i,r,e))}return r},a=(n,r)=>{if(i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&m.verticalTextBox){for(let e of i.writingModes)if(e===t.ah.vertical?(N=r(),P=N):N=n(),N&&N.placeable)break}else N=n()},u=e.textAnchorOffsetStartIndex,d=e.textAnchorOffsetEndIndex;if(d===u){let r=(t,n)=>{let r=this.collisionIndex.placeCollisionBox(t,y,f,c,l,w,C,o,g.predicate,k);return r&&r.placeable&&(this.markUsedOrientation(i,n,e),this.placedOrientations[e.crossTileID]=n),r};a(()=>r(V,t.ah.horizontal),()=>{let n=m.verticalTextBox;return i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&n?r(n,t.ah.vertical):{box:null,offscreen:null}}),n(N&&N.placeable)}else{let p=t.aq[this.prevPlacement?.variableOffsets[e.crossTileID]?.anchor],h=(n,a,m)=>{let h=n.x2-n.x1,_=n.y2-n.y1,v=e.textBoxScale,b=T&&x===`never`?a:null,S=null,D=y===`never`?1:2,O=`never`;p&&D++;for(let t=0;t<D;t++){for(let t=u;t<d;t++){let r=i.textAnchorOffsets.get(t);if(p&&r.textAnchor!==p)continue;let a=this.attemptAnchorPlacement(r,n,h,_,v,C,w,f,c,l,g,O,e,i,m,o,s,b,k);if(a&&(S=a.placedGlyphBoxes,S&&S.placeable))return E=!0,M=a.shift,S}p?p=null:O=y}return r&&!S&&(S={box:this.collisionIndex.placeCollisionBox(V,`always`,f,c,l,w,C,o,g.predicate,k,new t.P(0,0)).box,offscreen:!1,placeable:!1}),S};a(()=>h(V,m.iconBox,t.ah.horizontal),()=>{let n=m.verticalTextBox;return i.allowVerticalPlacement&&(!N||!N.placeable)&&e.numVerticalGlyphVertices>0&&n?h(n,m.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),N&&(E=N.placeable,j=N.offscreen);let _=n(N&&N.placeable);if(!E&&this.prevPlacement){let t=this.prevPlacement.variableOffsets[e.crossTileID];t&&(this.variableOffsets[e.crossTileID]=t,this.markUsedJustification(i,t.anchor,e,_))}}}if(F=N,E=F&&F.placeable,j=F&&F.offscreen,e.useRuntimeCollisionCircles){let n=i.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),s=t.ai(i.textSizeData,h,n),f=a.get(`text-padding`);I=this.collisionIndex.placeCollisionCircles(y,n,i.lineVertexArray,i.glyphOffsetArray,s,c,l,u,d,r,w,g.predicate,e.collisionCircleDiameter,f,o,k),I.circles.length&&I.collisionDetected&&!r&&t.w(`Collisions detected, but collision boxes are not shown`),E=b||I.circles.length>0&&!I.collisionDetected,j&&=I.offscreen}if(m.iconFeatureIndex&&(B=m.iconFeatureIndex),m.iconBox){let e=e=>this.collisionIndex.placeCollisionBox(e,x,f,c,l,w,C,s,g.predicate,k,T&&M?M:void 0);P&&P.placeable&&m.verticalIconBox?(L=e(m.verticalIconBox),A=L.placeable):(L=e(m.iconBox),A=L.placeable),j&&=L.offscreen}let H=_||e.numHorizontalGlyphVertices===0&&e.numVerticalGlyphVertices===0,U=v||e.numIconVertices===0;H||U?U?H||(A&&=E):E=A&&E:A=E=A&&E;let W=A&&L.placeable;if(E&&F.placeable&&this.collisionIndex.insertCollisionBox(F.box,y,a.get(`text-ignore-placement`),i.bucketInstanceId,P&&P.placeable&&z?z:R,g.ID),W&&this.collisionIndex.insertCollisionBox(L.box,x,a.get(`icon-ignore-placement`),i.bucketInstanceId,B,g.ID),I&&E&&this.collisionIndex.insertCollisionCircles(I.circles,y,a.get(`text-ignore-placement`),i.bucketInstanceId,R,g.ID),r&&this.storeCollisionData(i.bucketInstanceId,S,m,F,L,I),e.crossTileID===0)throw Error(`symbolInstance.crossTileID can't be 0`);if(i.bucketInstanceId===0)throw Error(`bucket.bucketInstanceId can't be 0`);this.placements[e.crossTileID]=new Be(E||D,A||O,j||i.justReloaded),n[e.crossTileID]=!0};if(E){if(e.symbolInstanceStart!==0)throw Error(`bucket.bucketInstanceId should be 0`);let t=i.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){let n=t[e];A(i.symbolInstances.get(n),i.collisionArrays[n],n)}}else for(let t=e.symbolInstanceStart;t<e.symbolInstanceEnd;t++)A(i.symbolInstances.get(t),i.collisionArrays[t],t);if(r&&i.bucketInstanceId in this.collisionCircleArrays){let e=this.collisionCircleArrays[i.bucketInstanceId];t.as(e.invProjMatrix,c),e.viewportMatrix=this.collisionIndex.getViewportMatrix()}i.justReloaded=!1}storeCollisionData(e,t,n,r,i,a){if(n.textBox||n.iconBox){let a,o;this.collisionBoxArrays.has(e)?a=this.collisionBoxArrays.get(e):(a=new Map,this.collisionBoxArrays.set(e,a)),a.has(t)?o=a.get(t):(o={text:null,icon:null},a.set(t,o)),n.textBox&&(o.text=r.box),n.iconBox&&(o.icon=i.box)}if(a){let t=this.collisionCircleArrays[e];t===void 0&&(t=this.collisionCircleArrays[e]=new Ve);for(let e=0;e<a.circles.length;e+=4)t.circles.push(a.circles[e+0]),t.circles.push(a.circles[e+1]),t.circles.push(a.circles[e+2]),t.circles.push(a.collisionDetected?1:0)}}markUsedJustification(e,n,r,i){let a;a=i===t.ah.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex}[t.at(n)];let o=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];for(let t of o)t>=0&&(e.text.placedSymbolArray.get(t).crossTileID=a>=0&&t!==a?0:r.crossTileID)}markUsedOrientation(e,n,r){let i=n===t.ah.horizontal||n===t.ah.horizontalOnly?n:0,a=n===t.ah.vertical?n:0,o=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];for(let t of o)e.text.placedSymbolArray.get(t).placedOrientation=i;r.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let t=this.prevPlacement,n=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;let r=t?t.symbolFadeChange(e):1,i=t?t.opacities:{},a=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(let e in this.placements){let t=this.placements[e],a=i[e];a?(this.opacities[e]=new ze(a,r,t.text,t.icon),n=n||t.text!==a.text.placed||t.icon!==a.icon.placed):(this.opacities[e]=new ze(null,r,t.text,t.icon,t.skipFade),n=n||t.text||t.icon)}for(let e in i){let t=i[e];if(!this.opacities[e]){let i=new ze(t,r,!1,!1);i.isHidden()||(this.opacities[e]=i,n=n||t.text.placed||t.icon.placed)}}for(let e in a)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=a[e]);for(let e in o)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=o[e]);if(t&&t.lastPlacementChangeTime===void 0)throw Error(`Last placement time for previous placement is not defined`);n?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!=`number`&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){let n={};for(let r of t){let t=r.getBucket(e);t&&r.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,r.tileID,n,r.collisionBoxArray)}}updateBucketOpacities(e,n,r,i){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();let a=e.layers[0],o=a.layout,s=new ze(null,0,!1,!1,!0),c=o.get(`text-allow-overlap`),l=o.get(`icon-allow-overlap`),u=a._unevaluatedLayout.hasValue(`text-variable-anchor`)||a._unevaluatedLayout.hasValue(`text-variable-anchor-offset`),d=o.get(`text-rotation-alignment`)===`map`,f=o.get(`text-pitch-alignment`)===`map`,p=o.get(`icon-text-fit`)!==`none`,m=new ze(null,0,c&&(l||!e.hasIconData()||o.get(`icon-optional`)),l&&(c||!e.hasTextData()||o.get(`text-optional`)),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);let h=(e,t,n)=>{for(let r=0;r<t/4;r++)e.opacityVertexArray.emplaceBack(n);e.hasVisibleVertices=e.hasVisibleVertices||n!==Qe},g=this.collisionBoxArrays.get(e.bucketInstanceId);for(let n=0;n<e.symbolInstances.length;n++){let i=e.symbolInstances.get(n),{numHorizontalGlyphVertices:a,numVerticalGlyphVertices:o,crossTileID:c}=i,l=this.opacities[c];r[c]?l=s:l||(l=m,this.opacities[c]=l),r[c]=!0;let _=i.numIconVertices>0,v=this.placedOrientations[i.crossTileID],y=v===t.ah.vertical,b=v===t.ah.horizontal||v===t.ah.horizontalOnly;if(a>0||o>0){let t=Ze(l.text);h(e.text,a,y?Qe:t),h(e.text,o,b?Qe:t);let n=l.text.isHidden();[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach(t=>{t>=0&&(e.text.placedSymbolArray.get(t).hidden=n||y?1:0)}),i.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=n||b?1:0);let r=this.variableOffsets[i.crossTileID];r&&this.markUsedJustification(e,r.anchor,i,v);let s=this.placedOrientations[i.crossTileID];s&&(this.markUsedJustification(e,`left`,i,s),this.markUsedOrientation(e,s,i))}if(_){let t=Ze(l.icon),n=!(p&&i.verticalPlacedIconSymbolIndex&&y);i.placedIconSymbolIndex>=0&&(h(e.icon,i.numIconVertices,n?t:Qe),e.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=l.icon.isHidden()),i.verticalPlacedIconSymbolIndex>=0&&(h(e.icon,i.numVerticalIconVertices,n?Qe:t),e.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=l.icon.isHidden())}let x=g&&g.has(n)?g.get(n):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let r=e.collisionArrays[n];if(r){let n=new t.P(0,0);if(r.textBox||r.verticalTextBox){let t=!0;if(u){let e=this.variableOffsets[c];e?(n=We(e.anchor,e.width,e.height,e.textOffset,e.textBoxScale),d&&n._rotate(f?this.transform.angle:-this.transform.angle)):t=!1}if(r.textBox||r.verticalTextBox){let i;r.textBox&&(i=y),r.verticalTextBox&&(i=b),Ke(e.textCollisionBox.collisionVertexArray,l.text.placed,!t||i,x.text,n.x,n.y)}}if(r.iconBox||r.verticalIconBox){let t=!!(!b&&r.verticalIconBox),i;r.iconBox&&(i=t),r.verticalIconBox&&(i=!t),Ke(e.iconCollisionBox.collisionVertexArray,l.icon.placed,i,x.icon,p?n.x:0,p?n.y:0)}}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);if(e.bucketInstanceId in this.collisionCircleArrays){let t=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=t.invProjMatrix,e.placementViewportMatrix=t.viewportMatrix,e.collisionCircleArray=t.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){let n=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*n>e}setStale(){this.stale=!0}}function Ke(e,t,n,r,i,a){r&&r.length!==0||(r=[0,0,0,0]);let o=r[0]-100,s=r[1]-100,c=r[2]-100,l=r[3]-100;e.emplaceBack(t?1:0,n?1:0,i||0,a||0,o,s),e.emplaceBack(t?1:0,n?1:0,i||0,a||0,c,s),e.emplaceBack(t?1:0,n?1:0,i||0,a||0,c,l),e.emplaceBack(t?1:0,n?1:0,i||0,a||0,o,l)}let qe=2**25,Je=2**24,Ye=2**17,Xe=2**16;function Ze(e){if(e.opacity===0&&!e.placed)return 0;if(e.opacity===1&&e.placed)return 4294967295;let t=e.placed?1:0,n=Math.floor(127*e.opacity);return n*qe+t*Je+n*Ye+t*Xe+n*512+t*256+n*2+t}let Qe=0;function $e(){return{isOccluded:(e,t,n)=>!1,getPitchedTextCorrection:(e,t,n)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(e,t,n,r){throw Error(`Not implemented.`)},translatePosition:(e,t,n,r)=>function(e,t,n,r,i=!1){if(!n[0]&&!n[1])return[0,0];let a=i?r===`map`?e.angle:0:r===`viewport`?-e.angle:0;if(a){let e=Math.sin(a),t=Math.cos(a);n=[n[0]*t-n[1]*e,n[0]*e+n[1]*t]}return[i?n[0]:Le(t,n[0],e.zoom),i?n[1]:Le(t,n[1],e.zoom)]}(e,t,n,r),getCircleRadiusCorrection:e=>1}}class et{constructor(e){this._sortAcrossTiles=e.layout.get(`symbol-z-order`)!==`viewport-y`&&!e.layout.get(`symbol-sort-key`).isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,n,r,i){let a=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(a,r,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,i())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort((e,t)=>e.sortKey-t.sortKey));this._currentPartIndex<a.length;)if(t.placeLayerBucketPart(a[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,i())return!0;return!1}}class tt{constructor(e,t,n,r,i,a,o,s){this.placement=new Ge(e,$e(),t,a,o,s),this._currentPlacementIndex=n.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=i,this._done=!1}isDone(){return this._done}continuePlacement(e,t,n){let r=a.now(),i=()=>!this._forceFullPlacement&&a.now()-r>2;for(;this._currentPlacementIndex>=0;){let r=t[e[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if(r.type===`symbol`&&(!r.minzoom||r.minzoom<=a)&&(!r.maxzoom||r.maxzoom>a)){if(this._inProgressLayer||=new et(r),this._inProgressLayer.continuePlacement(n[r.source],this.placement,this._showCollisionBoxes,r,i))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}let nt=512/t.X/2;class rt{constructor(e,n,r){this.tileID=e,this.bucketInstanceId=r,this._symbolsByKey={};let i=new Map;for(let e=0;e<n.length;e++){let t=n.get(e),r=t.key,a=i.get(r);a?a.push(t):i.set(r,[t])}for(let[e,n]of i){let r={positions:n.map(e=>({x:Math.floor(e.anchorX*nt),y:Math.floor(e.anchorY*nt)})),crossTileIDs:n.map(e=>e.crossTileID)};if(r.positions.length>128){let e=new t.av(r.positions.length,16,Uint16Array);for(let{x:t,y:n}of r.positions)e.add(t,n);e.finish(),delete r.positions,r.index=e}this._symbolsByKey[e]=r}}getScaledCoordinates(e,n){let{x:r,y:i,z:a}=this.tileID.canonical,{x:o,y:s,z:c}=n.canonical,l=nt/2**(c-a),u=(s*t.X+e.anchorY)*l,d=i*t.X*nt;return{x:Math.floor((o*t.X+e.anchorX)*l-r*t.X*nt),y:Math.floor(u-d)}}findMatches(e,t,n){let r=this.tileID.canonical.z<t.canonical.z?1:2**(this.tileID.canonical.z-t.canonical.z);for(let i=0;i<e.length;i++){let a=e.get(i);if(a.crossTileID)continue;let o=this._symbolsByKey[a.key];if(!o)continue;let s=this.getScaledCoordinates(a,t);if(o.index){let e=o.index.range(s.x-r,s.y-r,s.x+r,s.y+r).sort();for(let t of e){let e=o.crossTileIDs[t];if(!n[e]){n[e]=!0,a.crossTileID=e;break}}}else if(o.positions)for(let e=0;e<o.positions.length;e++){let t=o.positions[e],i=o.crossTileIDs[e];if(Math.abs(t.x-s.x)<=r&&Math.abs(t.y-s.y)<=r&&!n[i]){n[i]=!0,a.crossTileID=i;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:e})=>e)}}class it{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class at{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let t=Math.round((e-this.lng)/360);if(t!==0)for(let e in this.indexes){let n=this.indexes[e],r={};for(let e in n){let i=n[e];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),r[i.tileID.key]=i}this.indexes[e]=r}this.lng=e}addBucket(e,t,n){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;e<t.symbolInstances.length;e++)t.symbolInstances.get(e).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});let r=this.usedCrossTileIDs[e.overscaledZ];for(let n in this.indexes){let i=this.indexes[n];if(Number(n)>e.overscaledZ)for(let n in i){let a=i[n];a.tileID.isChildOf(e)&&a.findMatches(t.symbolInstances,e,r)}else{let a=i[e.scaledTo(Number(n)).key];a&&a.findMatches(t.symbolInstances,e,r)}}for(let e=0;e<t.symbolInstances.length;e++){let i=t.symbolInstances.get(e);i.crossTileID||(i.crossTileID=n.generate(),r[i.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new rt(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(let n of t.getCrossTileIDsLists())for(let t of n)delete this.usedCrossTileIDs[e][t]}removeStaleBuckets(e){let t=!1;for(let n in this.indexes){let r=this.indexes[n];for(let i in r)e[r[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,r[i]),delete r[i],t=!0)}return t}}class ot{constructor(){this.layerIndexes={},this.crossTileIDs=new it,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,n){let r=this.layerIndexes[e.id];r===void 0&&(r=this.layerIndexes[e.id]=new at);let i=!1,a={};r.handleWrapJump(n);for(let n of t){let t=n.getBucket(e);t&&e.id===t.layerIds[0]&&(t.bucketInstanceId||=++this.maxBucketInstanceId,r.addBucket(n.tileID,t,this.crossTileIDs)&&(i=!0),a[t.bucketInstanceId]=!0)}return r.removeStaleBuckets(a)&&(i=!0),i}pruneUnusedLayers(e){let t={};e.forEach(e=>{t[e]=!0});for(let e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}}let st=(e,n)=>t.t(e,n&&n.filter(e=>e.identifier!==`source.canvas`)),ct=t.aw();class lt extends t.E{constructor(e,n={}){super(),this._rtlPluginLoaded=()=>{for(let e in this.sourceCaches){let t=this.sourceCaches[e].getSource().type;t!==`vector`&&t!==`geojson`||this.sourceCaches[e].reload()}},this.map=e,this.dispatcher=new B(z(),e._getMapId()),this.dispatcher.registerMessageHandler(`GG`,(e,t)=>this.getGlyphs(e,t)),this.dispatcher.registerMessageHandler(`GI`,(e,t)=>this.getImages(e,t)),this.imageManager=new C,this.imageManager.setEventedParent(this),this.glyphManager=new D(e._requestManager,n.localIdeographFontFamily),this.lineAtlas=new N(256,512),this.crossTileSymbolIndex=new ot,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast(`SR`,t.ay()),ce().on(ae,this._rtlPluginLoaded),this.on(`data`,e=>{if(e.dataType!==`source`||e.sourceDataType!==`metadata`)return;let t=this.sourceCaches[e.sourceId];if(!t)return;let n=t.getSource();if(n&&n.vectorLayerIds)for(let e in this._layers){let t=this._layers[e];t.source===n.id&&this._validateLayer(t)}})}loadURL(e,n={},r){this.fire(new t.k(`dataloading`,{dataType:`style`})),n.validate=typeof n.validate!=`boolean`||n.validate;let i=this.map._requestManager.transformRequest(e,`Style`);this._loadStyleRequest=new AbortController;let a=this._loadStyleRequest;t.h(i,this._loadStyleRequest).then(e=>{this._loadStyleRequest=null,this._load(e.data,n,r)}).catch(e=>{this._loadStyleRequest=null,e&&!a.signal.aborted&&this.fire(new t.j(e))})}loadJSON(e,n={},r){this.fire(new t.k(`dataloading`,{dataType:`style`})),this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,n.validate=n.validate!==!1,this._load(e,n,r)}).catch(()=>{})}loadEmpty(){this.fire(new t.k(`dataloading`,{dataType:`style`})),this._load(ct,{validate:!1})}_load(e,n,r){let i=n.transformStyle?n.transformStyle(r,e):e;if(!n.validate||!st(this,t.u(i))){this._loaded=!0,this.stylesheet=i;for(let e in i.sources)this.addSource(e,i.sources[e],{validate:!1});i.sprite?this._loadSprite(i.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(i.glyphs),this._createLayers(),this.light=new A(this.stylesheet.light),this.sky=new M(this.stylesheet.sky),this.map.setTerrain(this.stylesheet.terrain??null),this.fire(new t.k(`data`,{dataType:`style`})),this.fire(new t.k(`style.load`))}}_createLayers(){let e=t.az(this.stylesheet.layers);this.dispatcher.broadcast(`SL`,e),this._order=e.map(e=>e.id),this._layers={},this._serializedLayers=null;for(let n of e){let e=t.aA(n);e.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=e}}_loadSprite(e,n=!1,r=void 0){let i;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(e,n,r,i){return t._(this,void 0,void 0,function*(){let o=y(e),s=r>1?`@2x`:``,c={},l={};for(let{id:e,url:r}of o){let a=n.transformRequest(b(r,s,`.json`),`SpriteJSON`);c[e]=t.h(a,i);let o=n.transformRequest(b(r,s,`.png`),`SpriteImage`);l[e]=p.getImage(o,i)}return yield Promise.all([...Object.values(c),...Object.values(l)]),function(e,n){return t._(this,void 0,void 0,function*(){let t={};for(let r in e){t[r]={};let i=a.getImageCanvasContext((yield n[r]).data),o=(yield e[r]).data;for(let e in o){let{width:n,height:a,x:s,y:c,sdf:l,pixelRatio:u,stretchX:d,stretchY:f,content:p,textFitWidth:m,textFitHeight:h}=o[e];t[r][e]={data:null,pixelRatio:u,sdf:l,stretchX:d,stretchY:f,content:p,textFitWidth:m,textFitHeight:h,spriteData:{width:n,height:a,x:s,y:c,context:i}}}}return t})}(c,l)})}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(e=>{if(this._spriteRequest=null,e)for(let t in e){this._spritesImagesIds[t]=[];let r=this._spritesImagesIds[t]?this._spritesImagesIds[t].filter(t=>!(t in e)):[];for(let e of r)this.imageManager.removeImage(e),this._changedImages[e]=!0;for(let r in e[t]){let i=t===`default`?r:`${t}:${r}`;this._spritesImagesIds[t].push(i),i in this.imageManager.images?this.imageManager.updateImage(i,e[t][r],!1):this.imageManager.addImage(i,e[t][r]),n&&(this._changedImages[i]=!0)}}}).catch(e=>{this._spriteRequest=null,i=e,this.fire(new t.j(i))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast(`SI`,this._availableImages),this.fire(new t.k(`data`,{dataType:`style`})),r&&r(i)})}_unloadSprite(){for(let e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast(`SI`,this._availableImages),this.fire(new t.k(`data`,{dataType:`style`}))}_validateLayer(e){let n=this.sourceCaches[e.source];if(!n)return;let r=e.sourceLayer;if(!r)return;let i=n.getSource();(i.type===`geojson`||i.vectorLayerIds&&i.vectorLayerIds.indexOf(r)===-1)&&this.fire(new t.j(Error(`Source layer "${r}" does not exist on source "${i.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e,n=!1){let r=this._serializedAllLayers();if(!e||e.length===0)return Object.values(n?t.aB(r):r);let i=[];for(let a of e)if(r[a]){let e=n?t.aB(r[a]):r[a];i.push(e)}return i}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};let t=Object.keys(this._layers);for(let n of t){let t=this._layers[n];t.type!==`custom`&&(e[n]=t.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(let e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw Error(`Style is not done loading.`)}update(e){if(!this._loaded)return;let n=this._changed;if(n){let t=Object.keys(this._updatedLayers),n=Object.keys(this._removedLayers);(t.length||n.length)&&this._updateWorkerLayers(t,n);for(let e in this._updatedSources){let t=this._updatedSources[e];if(t===`reload`)this._reloadSource(e);else{if(t!==`clear`)throw Error(`Invalid action ${t}`);this._clearSource(e)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let t in this._updatedPaintProps)this._layers[t].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}let r={};for(let e in this.sourceCaches){let t=this.sourceCaches[e];r[e]=t.used,t.used=!1}for(let t of this._order){let n=this._layers[t];n.recalculate(e,this._availableImages),!n.isHidden(e.zoom)&&n.source&&(this.sourceCaches[n.source].used=!0)}for(let e in r){let n=this.sourceCaches[e];!!r[e]!=!!n.used&&n.fire(new t.k(`data`,{sourceDataType:`visibility`,dataType:`source`,sourceId:e}))}this.light.recalculate(e),this.sky.recalculate(e),this.z=e.zoom,n&&this.fire(new t.k(`data`,{dataType:`style`}))}_updateTilesForChangedImages(){let e=Object.keys(this._changedImages);if(e.length){for(let t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies([`icons`,`patterns`],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies([`glyphs`],[``]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,t){this.dispatcher.broadcast(`UL`,{layers:this._serializeByIds(e,!1),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,n={}){var r;this._checkLoaded();let i=this.serialize();if(e=n.transformStyle?n.transformStyle(i,e):e,((r=n.validate)==null||r)&&st(this,t.u(e)))return!1;(e=t.aB(e)).layers=t.az(e.layers);let a=t.aC(i,e),o=this._getOperationsToPerform(a);if(o.unimplemented.length>0)throw Error(`Unimplemented: ${o.unimplemented.join(`, `)}.`);if(o.operations.length===0)return!1;for(let e of o.operations)e();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){let t=[],n=[];for(let r of e)switch(r.command){case`setCenter`:case`setZoom`:case`setBearing`:case`setPitch`:continue;case`addLayer`:t.push(()=>this.addLayer.apply(this,r.args));break;case`removeLayer`:t.push(()=>this.removeLayer.apply(this,r.args));break;case`setPaintProperty`:t.push(()=>this.setPaintProperty.apply(this,r.args));break;case`setLayoutProperty`:t.push(()=>this.setLayoutProperty.apply(this,r.args));break;case`setFilter`:t.push(()=>this.setFilter.apply(this,r.args));break;case`addSource`:t.push(()=>this.addSource.apply(this,r.args));break;case`removeSource`:t.push(()=>this.removeSource.apply(this,r.args));break;case`setLayerZoomRange`:t.push(()=>this.setLayerZoomRange.apply(this,r.args));break;case`setLight`:t.push(()=>this.setLight.apply(this,r.args));break;case`setGeoJSONSourceData`:t.push(()=>this.setGeoJSONSourceData.apply(this,r.args));break;case`setGlyphs`:t.push(()=>this.setGlyphs.apply(this,r.args));break;case`setSprite`:t.push(()=>this.setSprite.apply(this,r.args));break;case`setSky`:t.push(()=>this.setSky.apply(this,r.args));break;case`setTerrain`:t.push(()=>this.map.setTerrain.apply(this,r.args));break;case`setTransition`:t.push(()=>{});break;default:n.push(r.command)}return{operations:t,unimplemented:n}}addImage(e,n){if(this.getImage(e))return this.fire(new t.j(Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,n),this._afterImageUpdated(e)}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new t.j(Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast(`SI`,this._availableImages),this.fire(new t.k(`data`,{dataType:`style`}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,n,r={}){if(this._checkLoaded(),this.sourceCaches[e]!==void 0)throw Error(`Source "${e}" already exists.`);if(!n.type)throw Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(`, `)}.`);if([`vector`,`raster`,`geojson`,`video`,`image`].indexOf(n.type)>=0&&this._validate(t.u.source,`sources.${e}`,n,null,r))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);let i=this.sourceCaches[e]=new fe(e,n,this.dispatcher);i.style=this,i.setEventedParent(this,()=>({isSourceLoaded:i.loaded(),source:i.serialize(),sourceId:e})),i.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw Error(`There is no source with this ID`);for(let n in this._layers)if(this._layers[n].source===e)return this.fire(new t.j(Error(`Source "${e}" cannot be removed while layer "${n}" is using it.`)));let n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.k(`data`,{sourceDataType:`metadata`,dataType:`source`,sourceId:e})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,t){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw Error(`There is no source with this ID=${e}`);let n=this.sourceCaches[e].getSource();if(n.type!==`geojson`)throw Error(`geojsonSource.type is ${n.type}, which is !== 'geojson`);n.setData(t),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,n,r={}){this._checkLoaded();let i=e.id;if(this.getLayer(i))return void this.fire(new t.j(Error(`Layer "${i}" already exists on this map.`)));let a;if(e.type===`custom`){if(st(this,t.aD(e)))return;a=t.aA(e)}else{if(`source`in e&&typeof e.source==`object`&&(this.addSource(i,e.source),e=t.aB(e),e=t.e(e,{source:i})),this._validate(t.u.layer,`layers.${i}`,e,{arrayIndex:-1},r))return;a=t.aA(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}})}let o=n?this._order.indexOf(n):this._order.length;if(n&&o===-1)this.fire(new t.j(Error(`Cannot add layer "${i}" before non-existing layer "${n}".`)));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&a.type!==`custom`){let e=this._removedLayers[i];delete this._removedLayers[i],e.type===a.type?(this._updatedSources[a.source]=`reload`,this.sourceCaches[a.source].pause()):this._updatedSources[a.source]=`clear`}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}moveLayer(e,n){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new t.j(Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===n)return;let r=this._order.indexOf(e);this._order.splice(r,1);let i=n?this._order.indexOf(n):this._order.length;n&&i===-1?this.fire(new t.j(Error(`Cannot move layer "${e}" before non-existing layer "${n}".`))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();let n=this._layers[e];if(!n)return void this.fire(new t.j(Error(`Cannot remove non-existing layer "${e}".`)));n.setEventedParent(null);let r=this._order.indexOf(e);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=n,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],n.onRemove&&n.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,n,r){this._checkLoaded();let i=this.getLayer(e);i?i.minzoom===n&&i.maxzoom===r||(n!=null&&(i.minzoom=n),r!=null&&(i.maxzoom=r),this._updateLayer(i)):this.fire(new t.j(Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,n,r={}){this._checkLoaded();let i=this.getLayer(e);if(i){if(!t.aE(i.filter,n))return n==null?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.u.filter,`layers.${i.id}.filter`,n,null,r)||(i.filter=t.aB(n),this._updateLayer(i)))}else this.fire(new t.j(Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return t.aB(this.getLayer(e).filter)}setLayoutProperty(e,n,r,i={}){this._checkLoaded();let a=this.getLayer(e);a?t.aE(a.getLayoutProperty(n),r)||(a.setLayoutProperty(n,r,i),this._updateLayer(a)):this.fire(new t.j(Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,n){let r=this.getLayer(e);if(r)return r.getLayoutProperty(n);this.fire(new t.j(Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,n,r,i={}){this._checkLoaded();let a=this.getLayer(e);a?t.aE(a.getPaintProperty(n),r)||(a.setPaintProperty(n,r,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0,this._serializedLayers=null):this.fire(new t.j(Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,t){return this.getLayer(e).getPaintProperty(t)}setFeatureState(e,n){this._checkLoaded();let r=e.source,i=e.sourceLayer,a=this.sourceCaches[r];if(a===void 0)return void this.fire(new t.j(Error(`The source '${r}' does not exist in the map's style.`)));let o=a.getSource().type;o===`geojson`&&i?this.fire(new t.j(Error(`GeoJSON sources cannot have a sourceLayer parameter.`))):o!==`vector`||i?(e.id===void 0&&this.fire(new t.j(Error(`The feature id parameter must be provided.`))),a.setFeatureState(i,e.id,n)):this.fire(new t.j(Error(`The sourceLayer parameter must be provided for vector source types.`)))}removeFeatureState(e,n){this._checkLoaded();let r=e.source,i=this.sourceCaches[r];if(i===void 0)return void this.fire(new t.j(Error(`The source '${r}' does not exist in the map's style.`)));let a=i.getSource().type,o=a===`vector`?e.sourceLayer:void 0;a!==`vector`||o?n&&typeof e.id!=`string`&&typeof e.id!=`number`?this.fire(new t.j(Error(`A feature id is required to remove its specific state property.`))):i.removeFeatureState(o,e.id,n):this.fire(new t.j(Error(`The sourceLayer parameter must be provided for vector source types.`)))}getFeatureState(e){this._checkLoaded();let n=e.source,r=e.sourceLayer,i=this.sourceCaches[n];if(i!==void 0)return i.getSource().type!==`vector`||r?(e.id===void 0&&this.fire(new t.j(Error(`The feature id parameter must be provided.`))),i.getFeatureState(r,e.id)):void this.fire(new t.j(Error(`The sourceLayer parameter must be provided for vector source types.`)));this.fire(new t.j(Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let e=t.aF(this.sourceCaches,e=>e.serialize()),n=this._serializeByIds(this._order,!0),r=this.map.getTerrain()||void 0,i=this.stylesheet;return t.aG({version:i.version,name:i.name,metadata:i.metadata,light:i.light,sky:i.sky,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,transition:i.transition,sources:e,layers:n,terrain:r},e=>e!==void 0)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.sourceCaches[e.source].getSource().type!==`raster`&&(this._updatedSources[e.source]=`reload`,this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){let t=e=>this._layers[e].type===`fill-extrusion`,n={},r=[];for(let i=this._order.length-1;i>=0;i--){let a=this._order[i];if(t(a)){n[a]=i;for(let t of e){let e=t[a];if(e)for(let t of e)r.push(t)}}}r.sort((e,t)=>t.intersectionZ-e.intersectionZ);let i=[];for(let a=this._order.length-1;a>=0;a--){let o=this._order[a];if(t(o))for(let e=r.length-1;e>=0;e--){let t=r[e].feature;if(n[t.layer.id]<a)break;i.push(t),r.pop()}else for(let t of e){let e=t[o];if(e)for(let t of e)i.push(t.feature)}}return i}queryRenderedFeatures(e,n,r){n&&n.filter&&this._validate(t.u.filter,`queryRenderedFeatures.filter`,n.filter,null,n);let i={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new t.j(Error(`parameters.layers must be an Array.`))),[];for(let e of n.layers){let n=this._layers[e];if(!n)return this.fire(new t.j(Error(`The layer '${e}' does not exist in the map's style and cannot be queried for features.`))),[];i[n.source]=!0}}let a=[];n.availableImages=this._availableImages;let o=this._serializedAllLayers();for(let t in this.sourceCaches)n.layers&&!i[t]||a.push(U(this.sourceCaches[t],this._layers,o,e,n,r));return this.placement&&a.push(function(e,t,n,r,i,a,o){let s={},c=a.queryRenderedSymbols(r),l=[];for(let e of Object.keys(c).map(Number))l.push(o[e]);l.sort(W);for(let n of l){let r=n.featureIndex.lookupSymbolFeatures(c[n.bucketInstanceId],t,n.bucketIndex,n.sourceLayerIndex,i.filter,i.layers,i.availableImages,e);for(let e in r){let t=s[e]=s[e]||[],i=r[e];i.sort((e,t)=>{let r=n.featureSortOrder;if(r){let n=r.indexOf(e.featureIndex);return r.indexOf(t.featureIndex)-n}return t.featureIndex-e.featureIndex});for(let e of i)t.push(e)}}for(let t in s)s[t].forEach(r=>{let i=r.feature,a=n[e[t].source].getFeatureState(i.layer[`source-layer`],i.id);i.source=i.layer.source,i.layer[`source-layer`]&&(i.sourceLayer=i.layer[`source-layer`]),i.state=a});return s}(this._layers,o,this.sourceCaches,e,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(e,n){n&&n.filter&&this._validate(t.u.filter,`querySourceFeatures.filter`,n.filter,null,n);let r=this.sourceCaches[e];return r?function(e,t){let n=e.getRenderableIds().map(t=>e.getTileByID(t)),r=[],i={};for(let e=0;e<n.length;e++){let a=n[e],o=a.tileID.canonical.key;i[o]||(i[o]=!0,a.querySourceFeatures(r,t))}return r}(r,n):[]}getLight(){return this.light.getLight()}setLight(e,n={}){this._checkLoaded();let r=this.light.getLight(),i=!1;for(let n in e)if(!t.aE(e[n],r[n])){i=!0;break}if(!i)return;let o={now:a.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,n),this.light.updateTransitions(o)}getSky(){return this.stylesheet?.sky}setSky(e,n={}){let r=this.getSky(),i=!1;if(!e&&!r)return;if(e&&!r)i=!0;else if(!e&&r)i=!0;else for(let n in e)if(!t.aE(e[n],r[n])){i=!0;break}if(!i)return;let o={now:a.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,n),this.sky.updateTransitions(o)}_validate(e,n,r,i,a={}){return(!a||a.validate!==!1)&&st(this,e.call(t.u,t.e({key:n,style:this.serialize(),value:r,styleSpec:t.v},i)))}_remove(e=!0){this._frameRequest&&=(this._frameRequest.abort(),null),this._loadStyleRequest&&=(this._loadStyleRequest.abort(),null),this._spriteRequest&&=(this._spriteRequest.abort(),null),ce().off(ae,this._rtlPluginLoaded);for(let e in this._layers)this._layers[e].setEventedParent(null);for(let e in this.sourceCaches){let t=this.sourceCaches[e];t.setEventedParent(null),t.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast(`RM`,void 0),this.dispatcher.remove(e)}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(let t in this.sourceCaches)this.sourceCaches[t].update(e,this.map.terrain)}_generateCollisionBoxes(){for(let e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(e,t,n,r,i=!1){let o=!1,s=!1,c={};for(let t of this._order){let n=this._layers[t];if(n.type!==`symbol`)continue;if(!c[n.source]){let e=this.sourceCaches[n.source];c[n.source]=e.getRenderableIds(!0).map(t=>e.getTileByID(t)).sort((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1))}let r=this.crossTileSymbolIndex.addLayer(n,c[n.source],e.center.lng);o||=r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((i=i||this._layerOrderChanged||n===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.now(),e.zoom))&&(this.pauseablePlacement=new tt(e,this.map.terrain,this._order,i,t,n,r,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,c),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(let e of this._order){let t=this._layers[e];t.type===`symbol`&&this.placement.updateLayerOpacities(t,c[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.now())}_releaseSymbolFadeTiles(){for(let e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,n){return t._(this,void 0,void 0,function*(){let e=yield this.imageManager.getImages(n.icons);this._updateTilesForChangedImages();let t=this.sourceCaches[n.source];return t&&t.setDependencies(n.tileID.key,n.type,n.icons),e})}getGlyphs(e,n){return t._(this,void 0,void 0,function*(){let e=yield this.glyphManager.getGlyphs(n.stacks),t=this.sourceCaches[n.source];return t&&t.setDependencies(n.tileID.key,n.type,[``]),e})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,n={}){this._checkLoaded(),e&&this._validate(t.u.glyphs,`glyphs`,e,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,n,r={},i){this._checkLoaded();let a=[{id:e,url:n}],o=[...y(this.stylesheet.sprite),...a];this._validate(t.u.sprite,`sprite`,o,null,r)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,i))}removeSprite(e){this._checkLoaded();let n=y(this.stylesheet.sprite);if(n.find(t=>t.id===e)){if(this._spritesImagesIds[e])for(let t of this._spritesImagesIds[e])this.imageManager.removeImage(t),this._changedImages[t]=!0;n.splice(n.findIndex(t=>t.id===e),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast(`SI`,this._availableImages),this.fire(new t.k(`data`,{dataType:`style`}))}else this.fire(new t.j(Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return y(this.stylesheet.sprite)}setSprite(e,n={},r){this._checkLoaded(),e&&this._validate(t.u.sprite,`sprite`,e,null,n)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,r):(this._unloadSprite(),r&&r(null)))}}var ut=t.Y([{name:`a_pos`,type:`Int16`,components:2}]);let $={prelude:dt(`#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:dt(`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:dt(`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:dt(`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:dt(`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:dt(`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:dt(`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:dt(`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:dt(`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:dt(`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:dt(`#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:dt(`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:dt(`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:dt(`#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:dt(`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:dt(`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:dt(`#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:dt(`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:dt(`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:dt(`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:dt(`#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:dt(`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:dt(`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:dt(`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:dt(`#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:dt(`#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:dt(`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:dt(`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:dt(`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:dt(`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 dt(e,t){let n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=t.match(/attribute ([\w]+) ([\w]+)/g),i=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:e=e.replace(n,(e,t,n,r,i)=>(s[i]=!0,t===`define`?`
#ifndef HAS_UNIFORM_u_${i}
varying ${n} ${r} ${i};
#else
uniform ${n} ${r} u_${i};
#endif
`:`
#ifdef HAS_UNIFORM_u_${i}
${n} ${r} ${i} = u_${i};
#endif
`)),vertexSource:t=t.replace(n,(e,t,n,r,i)=>{let a=r===`float`?`vec2`:`vec4`,o=i.match(/color/)?`color`:a;return s[i]?t===`define`?`
#ifndef HAS_UNIFORM_u_${i}
uniform lowp float u_${i}_t;
attribute ${n} ${a} a_${i};
varying ${n} ${r} ${i};
#else
uniform ${n} ${r} u_${i};
#endif
`:o===`vec4`?`
#ifndef HAS_UNIFORM_u_${i}
${i} = a_${i};
#else
${n} ${r} ${i} = u_${i};
#endif
`:`
#ifndef HAS_UNIFORM_u_${i}
${i} = unpack_mix_${o}(a_${i}, u_${i}_t);
#else
${n} ${r} ${i} = u_${i};
#endif
`:t===`define`?`
#ifndef HAS_UNIFORM_u_${i}
uniform lowp float u_${i}_t;
attribute ${n} ${a} a_${i};
#else
uniform ${n} ${r} u_${i};
#endif
`:o===`vec4`?`
#ifndef HAS_UNIFORM_u_${i}
${n} ${r} ${i} = a_${i};
#else
${n} ${r} ${i} = u_${i};
#endif
`:`
#ifndef HAS_UNIFORM_u_${i}
${n} ${r} ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);
#else
${n} ${r} ${i} = u_${i};
#endif
`}),staticAttributes:r,staticUniforms:o}}class ft{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,n,r,i,a,o,s,c){this.context=e;let l=this.boundPaintVertexBuffers.length!==r.length;for(let e=0;!l&&e<r.length;e++)this.boundPaintVertexBuffers[e]!==r[e]&&(l=!0);!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==n||l||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==c?this.freshBind(t,n,r,i,a,o,s,c):(e.bindVertexArray.set(this.vao),o&&o.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind(),c&&c.bind())}freshBind(e,t,n,r,i,a,o,s){let c=e.numAttributes,l=this.context,u=l.gl;this.vao&&this.destroy(),this.vao=l.createVertexArray(),l.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=r,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o,this.boundDynamicVertexBuffer3=s,t.enableAttributes(u,e);for(let t of n)t.enableAttributes(u,e);a&&a.enableAttributes(u,e),o&&o.enableAttributes(u,e),s&&s.enableAttributes(u,e),t.bind(),t.setVertexAttribPointers(u,e,i);for(let t of n)t.bind(),t.setVertexAttribPointers(u,e,i);a&&(a.bind(),a.setVertexAttribPointers(u,e,i)),r&&r.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,e,i)),s&&(s.bind(),s.setVertexAttribPointers(u,e,i)),l.currentNumAttributes=c}destroy(){this.vao&&=(this.context.deleteVertexArray(this.vao),null)}}let pt=(e,n,r,i,a)=>({u_matrix:e,u_texture:0,u_ele_delta:n,u_fog_matrix:r,u_fog_color:i?i.properties.get(`fog-color`):t.aM.white,u_fog_ground_blend:i?i.properties.get(`fog-ground-blend`):1,u_fog_ground_blend_opacity:i?i.calculateFogBlendOpacity(a):0,u_horizon_color:i?i.properties.get(`horizon-color`):t.aM.white,u_horizon_fog_blend:i?i.properties.get(`horizon-fog-blend`):1});function mt(e){let t=[];for(let n=0;n<e.length;n++){if(e[n]===null)continue;let r=e[n].split(` `);t.push(r.pop())}return t}class ht{constructor(e,n,r,i,a,o){let s=e.gl;this.program=s.createProgram();let c=mt(n.staticAttributes),l=r?r.getBinderAttributes():[],u=c.concat(l),d=$.prelude.staticUniforms?mt($.prelude.staticUniforms):[],f=n.staticUniforms?mt(n.staticUniforms):[],p=r?r.getBinderUniforms():[],m=d.concat(f).concat(p),h=[];for(let e of m)h.indexOf(e)<0&&h.push(e);let g=r?r.defines():[];a&&g.push(`#define OVERDRAW_INSPECTOR;`),o&&g.push(`#define TERRAIN3D;`);let _=g.concat($.prelude.fragmentSource,n.fragmentSource).join(`
`),v=g.concat($.prelude.vertexSource,n.vertexSource).join(`
`),y=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(y,_),s.compileShader(y),!s.getShaderParameter(y,s.COMPILE_STATUS))throw Error(`Could not compile fragment shader: ${s.getShaderInfoLog(y)}`);s.attachShader(this.program,y);let b=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(b,v),s.compileShader(b),!s.getShaderParameter(b,s.COMPILE_STATUS))throw Error(`Could not compile vertex shader: ${s.getShaderInfoLog(b)}`);s.attachShader(this.program,b),this.attributes={};let x={};this.numAttributes=u.length;for(let e=0;e<this.numAttributes;e++)u[e]&&(s.bindAttribLocation(this.program,e,u[e]),this.attributes[u[e]]=e);if(s.linkProgram(this.program),!s.getProgramParameter(this.program,s.LINK_STATUS))throw Error(`Program failed to link: ${s.getProgramInfoLog(this.program)}`);s.deleteShader(b),s.deleteShader(y);for(let e=0;e<h.length;e++){let t=h[e];if(t&&!x[t]){let e=s.getUniformLocation(this.program,t);e&&(x[t]=e)}}this.fixedUniforms=i(e,x),this.terrainUniforms=((e,n)=>({u_depth:new t.aH(e,n.u_depth),u_terrain:new t.aH(e,n.u_terrain),u_terrain_dim:new t.aI(e,n.u_terrain_dim),u_terrain_matrix:new t.aJ(e,n.u_terrain_matrix),u_terrain_unpack:new t.aK(e,n.u_terrain_unpack),u_terrain_exaggeration:new t.aI(e,n.u_terrain_exaggeration)}))(e,x),this.binderUniforms=r?r.getUniforms(e,x):[]}draw(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(n),e.setStencilMode(r),e.setColorMode(i),e.setCullFace(a),s){e.activeTexture.set(v.TEXTURE2),v.bindTexture(v.TEXTURE_2D,s.depthTexture),e.activeTexture.set(v.TEXTURE3),v.bindTexture(v.TEXTURE_2D,s.texture);for(let e in this.terrainUniforms)this.terrainUniforms[e].set(s[e])}for(let e in this.fixedUniforms)this.fixedUniforms[e].set(o[e]);m&&m.setUniforms(e,this.binderUniforms,f,{zoom:p});let y=0;switch(t){case v.LINES:y=2;break;case v.TRIANGLES:y=3;break;case v.LINE_STRIP:y=1}for(let n of d.get()){let r=n.vaos||={};(r[c]||(r[c]=new ft)).bind(e,this,l,m?m.getPaintVertexBuffers():[],u,n.vertexOffset,h,g,_),v.drawElements(t,n.primitiveLength*y,v.UNSIGNED_SHORT,n.primitiveOffset*y*2)}}}function gt(e,t,n){let r=1/Le(n,1,t.transform.tileZoom),i=2**n.tileID.overscaledZ,a=n.tileSize*2**t.transform.tileZoom/i,o=a*(n.tileID.canonical.x+n.tileID.wrap*i),s=a*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[r,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}let _t=(e,n,r,i)=>{let a=n.style.light,o=a.properties.get(`position`),s=[o.x,o.y,o.z],c=function(){var e=new t.A(9);return t.A!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}();a.properties.get(`anchor`)===`viewport`&&function(e,t){var n=Math.sin(t),r=Math.cos(t);e[0]=r,e[1]=n,e[2]=0,e[3]=-n,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1}(c,-n.transform.angle),function(e,t,n){var r=t[0],i=t[1],a=t[2];e[0]=r*n[0]+i*n[3]+a*n[6],e[1]=r*n[1]+i*n[4]+a*n[7],e[2]=r*n[2]+i*n[5]+a*n[8]}(s,s,c);let l=a.properties.get(`color`);return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get(`intensity`),u_lightcolor:[l.r,l.g,l.b],u_vertical_gradient:+r,u_opacity:i}},vt=(e,n,r,i,a,o,s)=>t.e(_t(e,n,r,i),gt(o,n,s),{u_height_factor:-(2**a.overscaledZ)/s.tileSize/8}),yt=e=>({u_matrix:e}),bt=(e,n,r,i)=>t.e(yt(e),gt(r,n,i)),xt=(e,t)=>({u_matrix:e,u_world:t}),St=(e,n,r,i,a)=>t.e(bt(e,n,r,i),{u_world:a}),Ct=(e,t,n,r)=>{let i=e.transform,a,o;if(r.paint.get(`circle-pitch-alignment`)===`map`){let e=Le(n,1,i.zoom);a=!0,o=[e,e]}else a=!1,o=i.pixelsToGLUnits;return{u_camera_to_center_distance:i.cameraToCenterDistance,u_scale_with_map:+(r.paint.get(`circle-pitch-scale`)===`map`),u_matrix:e.translatePosMatrix(t.posMatrix,n,r.paint.get(`circle-translate`),r.paint.get(`circle-translate-anchor`)),u_pitch_with_map:+a,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:o}},wt=(e,t,n)=>({u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}),Tt=(e,t,n=1)=>({u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:n}),Et=e=>({u_matrix:e}),Dt=(e,t,n,r)=>({u_matrix:e,u_extrude_scale:Le(t,1,n),u_intensity:r}),Ot=(e,n,r,i)=>{let a=t.H();t.aP(a,0,e.width,e.height,0,0,1);let o=e.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:r,u_color_ramp:i,u_opacity:n.paint.get(`heatmap-opacity`)}};function kt(e,n){let r=2**n.canonical.z,i=n.canonical.y;return[new t.Z(0,i/r).toLngLat().lat,new t.Z(0,(i+1)/r).toLngLat().lat]}let At=(e,t,n,r)=>{let i=e.transform;return{u_matrix:Ft(e,t,n,r),u_ratio:1/Le(t,1,i.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},jt=(e,n,r,i,a)=>t.e(At(e,n,r,a),{u_image:0,u_image_height:i}),Mt=(e,t,n,r,i)=>{let a=e.transform,o=Pt(t,a);return{u_matrix:Ft(e,t,n,i),u_texsize:t.imageAtlasTexture.size,u_ratio:1/Le(t,1,a.zoom),u_device_pixel_ratio:e.pixelRatio,u_image:0,u_scale:[o,r.fromScale,r.toScale],u_fade:r.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Nt=(e,n,r,i,a,o)=>{let s=e.lineAtlas,c=Pt(n,e.transform),l=r.layout.get(`line-cap`)===`round`,u=s.getDash(i.from,l),d=s.getDash(i.to,l),f=u.width*a.fromScale,p=d.width*a.toScale;return t.e(At(e,n,r,o),{u_patternscale_a:[c/f,-u.height/2],u_patternscale_b:[c/p,-d.height/2],u_sdfgamma:s.width/(256*Math.min(f,p)*e.pixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:d.y,u_mix:a.t})};function Pt(e,t){return 1/Le(e,1,t.tileZoom)}function Ft(e,t,n,r){return e.translatePosMatrix(r?r.posMatrix:t.tileID.posMatrix,t,n.paint.get(`line-translate`),n.paint.get(`line-translate-anchor`))}let It=(e,t,n,r,i)=>{return{u_matrix:e,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*i.paint.get(`raster-opacity`),u_image0:0,u_image1:1,u_brightness_low:i.paint.get(`raster-brightness-min`),u_brightness_high:i.paint.get(`raster-brightness-max`),u_saturation_factor:(o=i.paint.get(`raster-saturation`),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get(`raster-contrast`),a>0?1/(1-a):1+a),u_spin_weights:Lt(i.paint.get(`raster-hue-rotate`))};var a,o};function Lt(e){e*=Math.PI/180;let t=Math.sin(e),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}let Rt=(e,t,n,r,i,a,o,s,c,l,u,d,f,p)=>{let m=o.transform;return{u_is_size_zoom_constant:+(e===`constant`||e===`source`),u_is_size_feature_constant:+(e===`constant`||e===`camera`),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:m.cameraToCenterDistance,u_pitch:m.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:m.width/m.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:c,u_coord_matrix:l,u_is_text:+d,u_pitch_with_map:+r,u_is_along_line:i,u_is_variable_anchor:a,u_texsize:f,u_texture:0,u_translation:u,u_pitched_scale:p}},zt=(e,n,r,i,a,o,s,c,l,u,d,f,p,m,h)=>{let g=s.transform;return t.e(Rt(e,n,r,i,a,o,s,c,l,u,d,f,p,h),{u_gamma_scale:i?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:+m})},Bt=(e,n,r,i,a,o,s,c,l,u,d,f,p,m)=>t.e(zt(e,n,r,i,a,o,s,c,l,u,d,!0,f,!0,m),{u_texsize_icon:p,u_texture_icon:1}),Vt=(e,t,n)=>({u_matrix:e,u_opacity:t,u_color:n}),Ht=(e,n,r,i,a,o)=>t.e(function(e,t,n,r){let i=n.imageManager.getPattern(e.from.toString()),a=n.imageManager.getPattern(e.to.toString()),{width:o,height:s}=n.imageManager.getPixelSize(),c=2**r.tileID.overscaledZ,l=r.tileSize*2**n.transform.tileZoom/c,u=l*(r.tileID.canonical.x+r.tileID.wrap*c),d=l*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[o,s],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/Le(r,1,n.transform.tileZoom),u_pixel_coord_upper:[u>>16,d>>16],u_pixel_coord_lower:[65535&u,65535&d]}}(i,o,r,a),{u_matrix:e,u_opacity:n}),Ut={fillExtrusion:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_lightpos:new t.aN(e,n.u_lightpos),u_lightintensity:new t.aI(e,n.u_lightintensity),u_lightcolor:new t.aN(e,n.u_lightcolor),u_vertical_gradient:new t.aI(e,n.u_vertical_gradient),u_opacity:new t.aI(e,n.u_opacity)}),fillExtrusionPattern:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_lightpos:new t.aN(e,n.u_lightpos),u_lightintensity:new t.aI(e,n.u_lightintensity),u_lightcolor:new t.aN(e,n.u_lightcolor),u_vertical_gradient:new t.aI(e,n.u_vertical_gradient),u_height_factor:new t.aI(e,n.u_height_factor),u_image:new t.aH(e,n.u_image),u_texsize:new t.aO(e,n.u_texsize),u_pixel_coord_upper:new t.aO(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,n.u_pixel_coord_lower),u_scale:new t.aN(e,n.u_scale),u_fade:new t.aI(e,n.u_fade),u_opacity:new t.aI(e,n.u_opacity)}),fill:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix)}),fillPattern:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_image:new t.aH(e,n.u_image),u_texsize:new t.aO(e,n.u_texsize),u_pixel_coord_upper:new t.aO(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,n.u_pixel_coord_lower),u_scale:new t.aN(e,n.u_scale),u_fade:new t.aI(e,n.u_fade)}),fillOutline:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_world:new t.aO(e,n.u_world)}),fillOutlinePattern:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_world:new t.aO(e,n.u_world),u_image:new t.aH(e,n.u_image),u_texsize:new t.aO(e,n.u_texsize),u_pixel_coord_upper:new t.aO(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,n.u_pixel_coord_lower),u_scale:new t.aN(e,n.u_scale),u_fade:new t.aI(e,n.u_fade)}),circle:(e,n)=>({u_camera_to_center_distance:new t.aI(e,n.u_camera_to_center_distance),u_scale_with_map:new t.aH(e,n.u_scale_with_map),u_pitch_with_map:new t.aH(e,n.u_pitch_with_map),u_extrude_scale:new t.aO(e,n.u_extrude_scale),u_device_pixel_ratio:new t.aI(e,n.u_device_pixel_ratio),u_matrix:new t.aJ(e,n.u_matrix)}),collisionBox:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_pixel_extrude_scale:new t.aO(e,n.u_pixel_extrude_scale)}),collisionCircle:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_inv_matrix:new t.aJ(e,n.u_inv_matrix),u_camera_to_center_distance:new t.aI(e,n.u_camera_to_center_distance),u_viewport_size:new t.aO(e,n.u_viewport_size)}),debug:(e,n)=>({u_color:new t.aL(e,n.u_color),u_matrix:new t.aJ(e,n.u_matrix),u_overlay:new t.aH(e,n.u_overlay),u_overlay_scale:new t.aI(e,n.u_overlay_scale)}),clippingMask:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix)}),heatmap:(e,n)=>({u_extrude_scale:new t.aI(e,n.u_extrude_scale),u_intensity:new t.aI(e,n.u_intensity),u_matrix:new t.aJ(e,n.u_matrix)}),heatmapTexture:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_world:new t.aO(e,n.u_world),u_image:new t.aH(e,n.u_image),u_color_ramp:new t.aH(e,n.u_color_ramp),u_opacity:new t.aI(e,n.u_opacity)}),hillshade:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_image:new t.aH(e,n.u_image),u_latrange:new t.aO(e,n.u_latrange),u_light:new t.aO(e,n.u_light),u_shadow:new t.aL(e,n.u_shadow),u_highlight:new t.aL(e,n.u_highlight),u_accent:new t.aL(e,n.u_accent)}),hillshadePrepare:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_image:new t.aH(e,n.u_image),u_dimension:new t.aO(e,n.u_dimension),u_zoom:new t.aI(e,n.u_zoom),u_unpack:new t.aK(e,n.u_unpack)}),line:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_ratio:new t.aI(e,n.u_ratio),u_device_pixel_ratio:new t.aI(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,n.u_units_to_pixels)}),lineGradient:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_ratio:new t.aI(e,n.u_ratio),u_device_pixel_ratio:new t.aI(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,n.u_units_to_pixels),u_image:new t.aH(e,n.u_image),u_image_height:new t.aI(e,n.u_image_height)}),linePattern:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_texsize:new t.aO(e,n.u_texsize),u_ratio:new t.aI(e,n.u_ratio),u_device_pixel_ratio:new t.aI(e,n.u_device_pixel_ratio),u_image:new t.aH(e,n.u_image),u_units_to_pixels:new t.aO(e,n.u_units_to_pixels),u_scale:new t.aN(e,n.u_scale),u_fade:new t.aI(e,n.u_fade)}),lineSDF:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_ratio:new t.aI(e,n.u_ratio),u_device_pixel_ratio:new t.aI(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,n.u_units_to_pixels),u_patternscale_a:new t.aO(e,n.u_patternscale_a),u_patternscale_b:new t.aO(e,n.u_patternscale_b),u_sdfgamma:new t.aI(e,n.u_sdfgamma),u_image:new t.aH(e,n.u_image),u_tex_y_a:new t.aI(e,n.u_tex_y_a),u_tex_y_b:new t.aI(e,n.u_tex_y_b),u_mix:new t.aI(e,n.u_mix)}),raster:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_tl_parent:new t.aO(e,n.u_tl_parent),u_scale_parent:new t.aI(e,n.u_scale_parent),u_buffer_scale:new t.aI(e,n.u_buffer_scale),u_fade_t:new t.aI(e,n.u_fade_t),u_opacity:new t.aI(e,n.u_opacity),u_image0:new t.aH(e,n.u_image0),u_image1:new t.aH(e,n.u_image1),u_brightness_low:new t.aI(e,n.u_brightness_low),u_brightness_high:new t.aI(e,n.u_brightness_high),u_saturation_factor:new t.aI(e,n.u_saturation_factor),u_contrast_factor:new t.aI(e,n.u_contrast_factor),u_spin_weights:new t.aN(e,n.u_spin_weights)}),symbolIcon:(e,n)=>({u_is_size_zoom_constant:new t.aH(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,n.u_is_size_feature_constant),u_size_t:new t.aI(e,n.u_size_t),u_size:new t.aI(e,n.u_size),u_camera_to_center_distance:new t.aI(e,n.u_camera_to_center_distance),u_pitch:new t.aI(e,n.u_pitch),u_rotate_symbol:new t.aH(e,n.u_rotate_symbol),u_aspect_ratio:new t.aI(e,n.u_aspect_ratio),u_fade_change:new t.aI(e,n.u_fade_change),u_matrix:new t.aJ(e,n.u_matrix),u_label_plane_matrix:new t.aJ(e,n.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,n.u_coord_matrix),u_is_text:new t.aH(e,n.u_is_text),u_pitch_with_map:new t.aH(e,n.u_pitch_with_map),u_is_along_line:new t.aH(e,n.u_is_along_line),u_is_variable_anchor:new t.aH(e,n.u_is_variable_anchor),u_texsize:new t.aO(e,n.u_texsize),u_texture:new t.aH(e,n.u_texture),u_translation:new t.aO(e,n.u_translation),u_pitched_scale:new t.aI(e,n.u_pitched_scale)}),symbolSDF:(e,n)=>({u_is_size_zoom_constant:new t.aH(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,n.u_is_size_feature_constant),u_size_t:new t.aI(e,n.u_size_t),u_size:new t.aI(e,n.u_size),u_camera_to_center_distance:new t.aI(e,n.u_camera_to_center_distance),u_pitch:new t.aI(e,n.u_pitch),u_rotate_symbol:new t.aH(e,n.u_rotate_symbol),u_aspect_ratio:new t.aI(e,n.u_aspect_ratio),u_fade_change:new t.aI(e,n.u_fade_change),u_matrix:new t.aJ(e,n.u_matrix),u_label_plane_matrix:new t.aJ(e,n.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,n.u_coord_matrix),u_is_text:new t.aH(e,n.u_is_text),u_pitch_with_map:new t.aH(e,n.u_pitch_with_map),u_is_along_line:new t.aH(e,n.u_is_along_line),u_is_variable_anchor:new t.aH(e,n.u_is_variable_anchor),u_texsize:new t.aO(e,n.u_texsize),u_texture:new t.aH(e,n.u_texture),u_gamma_scale:new t.aI(e,n.u_gamma_scale),u_device_pixel_ratio:new t.aI(e,n.u_device_pixel_ratio),u_is_halo:new t.aH(e,n.u_is_halo),u_translation:new t.aO(e,n.u_translation),u_pitched_scale:new t.aI(e,n.u_pitched_scale)}),symbolTextAndIcon:(e,n)=>({u_is_size_zoom_constant:new t.aH(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,n.u_is_size_feature_constant),u_size_t:new t.aI(e,n.u_size_t),u_size:new t.aI(e,n.u_size),u_camera_to_center_distance:new t.aI(e,n.u_camera_to_center_distance),u_pitch:new t.aI(e,n.u_pitch),u_rotate_symbol:new t.aH(e,n.u_rotate_symbol),u_aspect_ratio:new t.aI(e,n.u_aspect_ratio),u_fade_change:new t.aI(e,n.u_fade_change),u_matrix:new t.aJ(e,n.u_matrix),u_label_plane_matrix:new t.aJ(e,n.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,n.u_coord_matrix),u_is_text:new t.aH(e,n.u_is_text),u_pitch_with_map:new t.aH(e,n.u_pitch_with_map),u_is_along_line:new t.aH(e,n.u_is_along_line),u_is_variable_anchor:new t.aH(e,n.u_is_variable_anchor),u_texsize:new t.aO(e,n.u_texsize),u_texsize_icon:new t.aO(e,n.u_texsize_icon),u_texture:new t.aH(e,n.u_texture),u_texture_icon:new t.aH(e,n.u_texture_icon),u_gamma_scale:new t.aI(e,n.u_gamma_scale),u_device_pixel_ratio:new t.aI(e,n.u_device_pixel_ratio),u_is_halo:new t.aH(e,n.u_is_halo),u_translation:new t.aO(e,n.u_translation),u_pitched_scale:new t.aI(e,n.u_pitched_scale)}),background:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_opacity:new t.aI(e,n.u_opacity),u_color:new t.aL(e,n.u_color)}),backgroundPattern:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_opacity:new t.aI(e,n.u_opacity),u_image:new t.aH(e,n.u_image),u_pattern_tl_a:new t.aO(e,n.u_pattern_tl_a),u_pattern_br_a:new t.aO(e,n.u_pattern_br_a),u_pattern_tl_b:new t.aO(e,n.u_pattern_tl_b),u_pattern_br_b:new t.aO(e,n.u_pattern_br_b),u_texsize:new t.aO(e,n.u_texsize),u_mix:new t.aI(e,n.u_mix),u_pattern_size_a:new t.aO(e,n.u_pattern_size_a),u_pattern_size_b:new t.aO(e,n.u_pattern_size_b),u_scale_a:new t.aI(e,n.u_scale_a),u_scale_b:new t.aI(e,n.u_scale_b),u_pixel_coord_upper:new t.aO(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,n.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(e,n.u_tile_units_to_pixels)}),terrain:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_texture:new t.aH(e,n.u_texture),u_ele_delta:new t.aI(e,n.u_ele_delta),u_fog_matrix:new t.aJ(e,n.u_fog_matrix),u_fog_color:new t.aL(e,n.u_fog_color),u_fog_ground_blend:new t.aI(e,n.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(e,n.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(e,n.u_horizon_color),u_horizon_fog_blend:new t.aI(e,n.u_horizon_fog_blend)}),terrainDepth:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_ele_delta:new t.aI(e,n.u_ele_delta)}),terrainCoords:(e,n)=>({u_matrix:new t.aJ(e,n.u_matrix),u_texture:new t.aH(e,n.u_texture),u_terrain_coords_id:new t.aI(e,n.u_terrain_coords_id),u_ele_delta:new t.aI(e,n.u_ele_delta)}),sky:(e,n)=>({u_sky_color:new t.aL(e,n.u_sky_color),u_horizon_color:new t.aL(e,n.u_horizon_color),u_horizon:new t.aI(e,n.u_horizon),u_sky_horizon_blend:new t.aI(e,n.u_sky_horizon_blend)})};class Wt{constructor(e,t,n){this.context=e;let r=e.gl;this.buffer=r.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){let t=this.context.gl;if(!this.dynamicDraw)throw Error(`Attempted to update data while not in dynamic mode.`);this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Gt={Int8:`BYTE`,Uint8:`UNSIGNED_BYTE`,Int16:`SHORT`,Uint16:`UNSIGNED_SHORT`,Int32:`INT`,Uint32:`UNSIGNED_INT`,Float32:`FLOAT`};class Kt{constructor(e,t,n,r){this.length=t.length,this.attributes=n,this.itemSize=t.bytesPerElement,this.dynamicDraw=r,this.context=e;let i=e.gl;this.buffer=i.createBuffer(),e.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);let t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let n=0;n<this.attributes.length;n++){let r=t.attributes[this.attributes[n].name];r!==void 0&&e.enableVertexAttribArray(r)}}setVertexAttribPointers(e,t,n){for(let r=0;r<this.attributes.length;r++){let i=this.attributes[r],a=t.attributes[i.name];a!==void 0&&e.vertexAttribPointer(a,i.components,e[Gt[i.type]],!1,this.itemSize,i.offset+this.itemSize*(n||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let qt=new WeakMap;function Jt(e){if(qt.has(e))return qt.get(e);{let t=e.getParameter(e.VERSION)?.startsWith(`WebGL 2.0`);return qt.set(e,t),t}}class Yt{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Xt extends Yt{getDefault(){return t.aM.transparent}set(e){let t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Zt extends Yt{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class Qt extends Yt{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class $t extends Yt{getDefault(){return[!0,!0,!0,!0]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class en extends Yt{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class tn extends Yt{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class nn extends Yt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){let t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class rn extends Yt{getDefault(){let e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class an extends Yt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class on extends Yt{getDefault(){return[0,1]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class sn extends Yt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class cn extends Yt{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class ln extends Yt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class un extends Yt{getDefault(){let e=this.gl;return[e.ONE,e.ZERO]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class dn extends Yt{getDefault(){return t.aM.transparent}set(e){let t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class fn extends Yt{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class pn extends Yt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class mn extends Yt{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class hn extends Yt{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class gn extends Yt{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class _n extends Yt{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class vn extends Yt{getDefault(){let e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class yn extends Yt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class bn extends Yt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class xn extends Yt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class Sn extends Yt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Cn extends Yt{getDefault(){return null}set(e){let t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class wn extends Yt{getDefault(){return null}set(e){var t;if(e===this.current&&!this.dirty)return;let n=this.gl;Jt(n)?n.bindVertexArray(e):(t=n.getExtension(`OES_vertex_array_object`))==null||t.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class Tn extends Yt{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class En extends Yt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class Dn extends Yt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class On extends Yt{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class kn extends On{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class An extends On{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class jn extends On{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Mn{constructor(e,t,n,r,i){this.context=e,this.width=t,this.height=n;let a=e.gl,o=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new kn(e,o),r)this.depthAttachment=i?new jn(e,o):new An(e,o);else if(i)throw Error(`Stencil cannot be set without depth`);if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw Error(`Framebuffer is not complete`)}destroy(){let e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){let t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}}class Nn{constructor(e,t,n){this.blendFunction=e,this.blendColor=t,this.mask=n}}Nn.Replace=[1,0],Nn.disabled=new Nn(Nn.Replace,t.aM.transparent,[!1,!1,!1,!1]),Nn.unblended=new Nn(Nn.Replace,t.aM.transparent,[!0,!0,!0,!0]),Nn.alphaBlended=new Nn([1,771],t.aM.transparent,[!0,!0,!0,!0]);class Pn{constructor(e){if(this.gl=e,this.clearColor=new Xt(this),this.clearDepth=new Zt(this),this.clearStencil=new Qt(this),this.colorMask=new $t(this),this.depthMask=new en(this),this.stencilMask=new tn(this),this.stencilFunc=new nn(this),this.stencilOp=new rn(this),this.stencilTest=new an(this),this.depthRange=new on(this),this.depthTest=new sn(this),this.depthFunc=new cn(this),this.blend=new ln(this),this.blendFunc=new un(this),this.blendColor=new dn(this),this.blendEquation=new fn(this),this.cullFace=new pn(this),this.cullFaceSide=new mn(this),this.frontFace=new hn(this),this.program=new gn(this),this.activeTexture=new _n(this),this.viewport=new vn(this),this.bindFramebuffer=new yn(this),this.bindRenderbuffer=new bn(this),this.bindTexture=new xn(this),this.bindVertexBuffer=new Sn(this),this.bindElementBuffer=new Cn(this),this.bindVertexArray=new wn(this),this.pixelStoreUnpack=new Tn(this),this.pixelStoreUnpackPremultiplyAlpha=new En(this),this.pixelStoreUnpackFlipY=new Dn(this),this.extTextureFilterAnisotropic=e.getExtension(`EXT_texture_filter_anisotropic`)||e.getExtension(`MOZ_EXT_texture_filter_anisotropic`)||e.getExtension(`WEBKIT_EXT_texture_filter_anisotropic`),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),Jt(e)){this.HALF_FLOAT=e.HALF_FLOAT;let t=e.getExtension(`EXT_color_buffer_half_float`);this.RGBA16F=e.RGBA16F??t?.RGBA16F_EXT,this.RGB16F=e.RGB16F??t?.RGB16F_EXT,e.getExtension(`EXT_color_buffer_float`)}else e.getExtension(`EXT_color_buffer_half_float`),e.getExtension(`OES_texture_half_float_linear`),this.HALF_FLOAT=e.getExtension(`OES_texture_half_float`)?.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(e,t){return new Wt(this,e,t)}createVertexBuffer(e,t,n){return new Kt(this,e,t,n)}createRenderbuffer(e,t,n){let r=this.gl,i=r.createRenderbuffer();return this.bindRenderbuffer.set(i),r.renderbufferStorage(r.RENDERBUFFER,e,t,n),this.bindRenderbuffer.set(null),i}createFramebuffer(e,t,n,r){return new Mn(this,e,t,n,r)}clear({color:e,depth:t,stencil:n}){let r=this.gl,i=0;e&&(i|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),t!==void 0&&(i|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),n!==void 0&&(i|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(n),this.stencilMask.set(255)),r.clear(i)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){t.aE(e.blendFunction,Nn.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){return Jt(this.gl)?this.gl.createVertexArray():this.gl.getExtension(`OES_vertex_array_object`)?.createVertexArrayOES()}deleteVertexArray(e){return Jt(this.gl)?this.gl.deleteVertexArray(e):this.gl.getExtension(`OES_vertex_array_object`)?.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}class Fn{constructor(e,t,n){this.func=e,this.mask=t,this.range=n}}Fn.ReadOnly=!1,Fn.ReadWrite=!0,Fn.disabled=new Fn(519,Fn.ReadOnly,[0,1]);let In=7680;class Ln{constructor(e,t,n,r,i,a){this.test=e,this.ref=t,this.mask=n,this.fail=r,this.depthFail=i,this.pass=a}}Ln.disabled=new Ln({func:519,mask:0},0,0,In,In,In);class Rn{constructor(e,t,n){this.enable=e,this.mode=t,this.frontFace=n}}let zn;function Bn(e,n,r,i,a){let o=e.context,s=o.gl,c=e.useProgram(`collisionBox`),l=[],u=0,d=0;for(let p=0;p<i.length;p++){let m=i[p],h=n.getTile(m).getBucket(r);if(!h)continue;let g=a?h.textCollisionBox:h.iconCollisionBox,_=h.collisionCircleArray;if(_.length>0){let n=t.H();t.aQ(n,h.placementInvProjMatrix,e.transform.glCoordMatrix),t.aQ(n,n,h.placementViewportMatrix),l.push({circleArray:_,circleOffset:d,transform:m.posMatrix,invTransform:n,coord:m}),u+=_.length/4,d=u}g&&c.draw(o,s.LINES,Fn.disabled,Ln.disabled,e.colorModeForRenderPass(),Rn.disabled,{u_matrix:m.posMatrix,u_pixel_extrude_scale:[1/(f=e.transform).width,1/f.height]},e.style.map.terrain&&e.style.map.terrain.getTerrainData(m),r.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,null,e.transform.zoom,null,null,g.collisionVertexBuffer)}var f;if(!a||!l.length)return;let p=e.useProgram(`collisionCircle`),m=new t.aR;m.resize(4*u),m._trim();let h=0;for(let e of l)for(let t=0;t<e.circleArray.length/4;t++){let n=4*t,r=e.circleArray[n+0],i=e.circleArray[n+1],a=e.circleArray[n+2],o=e.circleArray[n+3];m.emplace(h++,r,i,a,o,0),m.emplace(h++,r,i,a,o,1),m.emplace(h++,r,i,a,o,2),m.emplace(h++,r,i,a,o,3)}(!zn||zn.length<2*u)&&(zn=function(e){let n=2*e,r=new t.aT;r.resize(n),r._trim();for(let e=0;e<n;e++){let t=6*e;r.uint16[t+0]=4*e+0,r.uint16[t+1]=4*e+1,r.uint16[t+2]=4*e+2,r.uint16[t+3]=4*e+2,r.uint16[t+4]=4*e+3,r.uint16[t+5]=4*e+0}return r}(u));let g=o.createIndexBuffer(zn,!0),_=o.createVertexBuffer(m,t.aS.members,!0);for(let n of l){let i=wt(n.transform,n.invTransform,e.transform);p.draw(o,s.TRIANGLES,Fn.disabled,Ln.disabled,e.colorModeForRenderPass(),Rn.disabled,i,e.style.map.terrain&&e.style.map.terrain.getTerrainData(n.coord),r.id,_,g,t.a0.simpleSegment(0,2*n.circleOffset,n.circleArray.length,n.circleArray.length/2),null,e.transform.zoom,null,null,null)}_.destroy(),g.destroy()}Rn.disabled=new Rn(!1,1029,2305),Rn.backCCW=new Rn(!0,1029,2305);let Vn=t.an(new Float32Array(16));function Hn(e,n,r,i,a,o){let{horizontalAlign:s,verticalAlign:c}=t.au(e);return new t.P((-(s-.5)*n/a+i[0])*o,(-(c-.5)*r/a+i[1])*o)}function Un(e,n,r,i,a,o){let s=n.tileAnchorPoint.add(new t.P(n.translation[0],n.translation[1]));if(n.pitchWithMap){let e=i.mult(o);r||(e=e.rotate(-a));let t=s.add(e);return be(t.x,t.y,n.labelPlaneMatrix,n.getElevation).point}if(r){let t=ke(n.tileAnchorPoint.x+1,n.tileAnchorPoint.y,n).point.sub(e),r=Math.atan(t.y/t.x)+(t.x<0?Math.PI:0);return e.add(i.rotate(r))}return e.add(i)}function Wn(e,n,r,i,a,o,s,c,l,u,d,f,p,m){let h=e.text.placedSymbolArray,g=e.text.dynamicLayoutVertexArray,_=e.icon.dynamicLayoutVertexArray,v={};g.clear();for(let _=0;_<h.length;_++){let y=h.get(_),b=y.hidden||!y.crossTileID||e.allowVerticalPlacement&&!y.placedOrientation?null:i[y.crossTileID];if(b){let i=new t.P(y.anchorX,y.anchorY),h={getElevation:m,width:a.width,height:a.height,labelPlaneMatrix:o,lineVertexArray:null,pitchWithMap:r,projection:d,projectionCache:null,tileAnchorPoint:i,translation:f,unwrappedTileID:p},_=r?be(i.x,i.y,s,m):ke(i.x,i.y,h),x=xe(a.cameraToCenterDistance,_.signedDistanceFromCamera),S=t.ai(e.textSizeData,l,y)*x/t.ap;r&&(S*=e.tilePixelRatio/c);let{width:C,height:w,anchor:T,textOffset:E,textBoxScale:D}=b,O=Hn(T,C,w,E,D,S),k=d.getPitchedTextCorrection(a,i.add(new t.P(f[0],f[1])),p),A=Un(_.point,h,n,O,a.angle,k),j=e.allowVerticalPlacement&&y.placedOrientation===t.ah.vertical?Math.PI/2:0;for(let e=0;e<y.numGlyphs;e++)t.aj(g,A,j);u&&y.associatedIconIndex>=0&&(v[y.associatedIconIndex]={shiftedAnchor:A,angle:j})}else Pe(y.numGlyphs,g)}if(u){_.clear();let n=e.icon.placedSymbolArray;for(let e=0;e<n.length;e++){let r=n.get(e);if(r.hidden)Pe(r.numGlyphs,_);else{let n=v[e];if(n)for(let e=0;e<r.numGlyphs;e++)t.aj(_,n.shiftedAnchor,n.angle);else Pe(r.numGlyphs,_)}}e.icon.dynamicLayoutVertexBuffer.updateData(_)}e.text.dynamicLayoutVertexBuffer.updateData(g)}function Gn(e,t,n){return n.iconsInText&&t?`symbolTextAndIcon`:e?`symbolSDF`:`symbolIcon`}function Kn(e,n,r,i,a,o,s,c,l,u,d,f){let p=e.context,m=p.gl,h=e.transform,g=$e(),_=c===`map`,v=l===`map`,y=c!==`viewport`&&r.layout.get(`symbol-placement`)!==`point`,b=_&&!v&&!y,x=!v&&y,S=!r.layout.get(`symbol-sort-key`).isConstant(),C=!1,w=e.depthModeForSublayer(0,Fn.ReadOnly),T=r._unevaluatedLayout.hasValue(`text-variable-anchor`)||r._unevaluatedLayout.hasValue(`text-variable-anchor-offset`),E=[],D=g.getCircleRadiusCorrection(h);for(let c of i){let i=n.getTile(c),l=i.getBucket(r);if(!l)continue;let d=a?l.text:l.icon;if(!d||!d.segments.get().length||!d.hasVisibleVertices)continue;let f=d.programConfigurations.get(r.id),p=a||l.sdfIcons,w=a?l.textSizeData:l.iconSizeData,O=v||h.pitch!==0,k=e.useProgram(Gn(p,a,l),f),A=t.ag(w,h.zoom),j=e.style.map.terrain&&e.style.map.terrain.getTerrainData(c),M,N,P,F,I=[0,0],L=null;if(a)N=i.glyphAtlasTexture,P=m.LINEAR,M=i.glyphAtlasTexture.size,l.iconsInText&&(I=i.imageAtlasTexture.size,L=i.imageAtlasTexture,F=O||e.options.rotating||e.options.zooming||w.kind===`composite`||w.kind===`camera`?m.LINEAR:m.NEAREST);else{let t=r.layout.get(`icon-size`).constantOr(0)!==1||l.iconsNeedLinear;N=i.imageAtlasTexture,P=p||e.options.rotating||e.options.zooming||t||O?m.LINEAR:m.NEAREST,M=i.imageAtlasTexture.size}let R=Le(i,1,e.transform.zoom),z=x?c.posMatrix:Vn,B=ve(z,v,_,e.transform,R),V=ye(z,v,_,e.transform,R),H=ye(c.posMatrix,v,_,e.transform,R),U=g.translatePosition(e.transform,i,o,s),W=T&&l.hasTextData(),G=r.layout.get(`icon-text-fit`)!==`none`&&W&&l.hasIconData();if(y){let t=e.style.map.terrain?(t,n)=>e.style.map.terrain.getElevation(c,t,n):null,n=r.layout.get(`text-rotation-alignment`)===`map`;Ce(l,c.posMatrix,e,a,B,H,v,u,n,g,c.toUnwrapped(),h.width,h.height,U,t)}let K=c.posMatrix,q=a&&T||G,J=y||q?Vn:B,Y=V,X=p&&r.paint.get(a?`text-halo-width`:`icon-halo-width`).constantOr(1)!==0,Z;Z=p?l.iconsInText?Bt(w.kind,A,b,v,y,q,e,K,J,Y,U,M,I,D):zt(w.kind,A,b,v,y,q,e,K,J,Y,U,a,M,!0,D):Rt(w.kind,A,b,v,y,q,e,K,J,Y,U,a,M,D);let Q={program:k,buffers:d,uniformValues:Z,atlasTexture:N,atlasTextureIcon:L,atlasInterpolation:P,atlasInterpolationIcon:F,isSDF:p,hasHalo:X};if(S&&l.canOverlap){C=!0;let e=d.segments.get();for(let n of e)E.push({segments:new t.a0([n]),sortKey:n.sortKey,state:Q,terrainData:j})}else E.push({segments:d.segments,sortKey:0,state:Q,terrainData:j})}C&&E.sort((e,t)=>e.sortKey-t.sortKey);for(let t of E){let n=t.state;if(p.activeTexture.set(m.TEXTURE0),n.atlasTexture.bind(n.atlasInterpolation,m.CLAMP_TO_EDGE),n.atlasTextureIcon&&(p.activeTexture.set(m.TEXTURE1),n.atlasTextureIcon&&n.atlasTextureIcon.bind(n.atlasInterpolationIcon,m.CLAMP_TO_EDGE)),n.isSDF){let i=n.uniformValues;n.hasHalo&&(i.u_is_halo=1,qn(n.buffers,t.segments,r,e,n.program,w,d,f,i,t.terrainData)),i.u_is_halo=0}qn(n.buffers,t.segments,r,e,n.program,w,d,f,n.uniformValues,t.terrainData)}}function qn(e,t,n,r,i,a,o,s,c,l){let u=r.context;i.draw(u,u.gl.TRIANGLES,a,o,s,Rn.disabled,c,l,n.id,e.layoutVertexBuffer,e.indexBuffer,t,n.paint,r.transform.zoom,e.programConfigurations.get(n.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function Jn(e,n,r,i){let a=e.context,o=a.gl,s=Ln.disabled,c=new Nn([o.ONE,o.ONE],t.aM.transparent,[!0,!0,!0,!0]),l=n.getBucket(r);if(!l)return;let u=i.key,d=r.heatmapFbos.get(u);d||(d=Xn(a,n.tileSize,n.tileSize),r.heatmapFbos.set(u,d)),a.bindFramebuffer.set(d.framebuffer),a.viewport.set([0,0,n.tileSize,n.tileSize]),a.clear({color:t.aM.transparent});let f=l.programConfigurations.get(r.id),p=e.useProgram(`heatmap`,f),m=e.style.map.terrain.getTerrainData(i);p.draw(a,o.TRIANGLES,Fn.disabled,s,c,Rn.disabled,Dt(i.posMatrix,n,e.transform.zoom,r.paint.get(`heatmap-intensity`)),m,r.id,l.layoutVertexBuffer,l.indexBuffer,l.segments,r.paint,e.transform.zoom,f)}function Yn(e,t,n){let r=e.context,i=r.gl;r.setColorMode(e.colorModeForRenderPass());let a=Zn(r,t),o=n.key,s=t.heatmapFbos.get(o);s&&(r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,s.colorAttachment.get()),r.activeTexture.set(i.TEXTURE1),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram(`heatmapTexture`).draw(r,i.TRIANGLES,Fn.disabled,Ln.disabled,e.colorModeForRenderPass(),Rn.disabled,Ot(e,t,0,1),null,t.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,t.paint,e.transform.zoom),s.destroy(),t.heatmapFbos.delete(o))}function Xn(e,t,n){let r=e.gl,i=r.createTexture();r.bindTexture(r.TEXTURE_2D,i),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR);let a=e.HALF_FLOAT??r.UNSIGNED_BYTE,o=e.RGBA16F??r.RGBA;r.texImage2D(r.TEXTURE_2D,0,o,t,n,0,r.RGBA,a,null);let s=e.createFramebuffer(t,n,!1,!1);return s.colorAttachment.set(i),s}function Zn(e,t){return t.colorRampTexture||=new x(e,t.colorRamp,e.gl.RGBA),t.colorRampTexture}function Qn(e,t,n,r,i){if(!n||!r||!r.imageAtlas)return;let a=r.imageAtlas.patternPositions,o=a[n.to.toString()],s=a[n.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){let e=i.getPaintProperty(t);o=a[e],s=a[e]}o&&s&&e.setConstantPatternPositions(o,s)}function $n(e,t,n,r,i,a,o){let s=e.context.gl,c=`fill-pattern`,l=n.paint.get(c),u=l&&l.constantOr(1),d=n.getCrossfadeParameters(),f,p,m,h,g;o?(p=u&&!n.getPaintProperty(`fill-outline-color`)?`fillOutlinePattern`:`fillOutline`,f=s.LINES):(p=u?`fillPattern`:`fill`,f=s.TRIANGLES);let _=l.constantOr(null);for(let l of r){let r=t.getTile(l);if(u&&!r.patternsLoaded())continue;let v=r.getBucket(n);if(!v)continue;let y=v.programConfigurations.get(n.id),b=e.useProgram(p,y),x=e.style.map.terrain&&e.style.map.terrain.getTerrainData(l);u&&(e.context.activeTexture.set(s.TEXTURE0),r.imageAtlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),y.updatePaintBuffers(d)),Qn(y,c,_,r,n);let S=x?l:null,C=e.translatePosMatrix(S?S.posMatrix:l.posMatrix,r,n.paint.get(`fill-translate`),n.paint.get(`fill-translate-anchor`));if(o){h=v.indexBuffer2,g=v.segments2;let t=[s.drawingBufferWidth,s.drawingBufferHeight];m=p===`fillOutlinePattern`&&u?St(C,e,d,r,t):xt(C,t)}else h=v.indexBuffer,g=v.segments,m=u?bt(C,e,d,r):yt(C);b.draw(e.context,f,i,e.stencilModeForClipping(l),a,Rn.disabled,m,x,n.id,v.layoutVertexBuffer,h,g,n.paint,e.transform.zoom,y)}}function er(e,t,n,r,i,a,o){let s=e.context,c=s.gl,l=`fill-extrusion-pattern`,u=n.paint.get(l),d=u.constantOr(1),f=n.getCrossfadeParameters(),p=n.paint.get(`fill-extrusion-opacity`),m=u.constantOr(null);for(let u of r){let r=t.getTile(u),h=r.getBucket(n);if(!h)continue;let g=e.style.map.terrain&&e.style.map.terrain.getTerrainData(u),_=h.programConfigurations.get(n.id),v=e.useProgram(d?`fillExtrusionPattern`:`fillExtrusion`,_);d&&(e.context.activeTexture.set(c.TEXTURE0),r.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),_.updatePaintBuffers(f)),Qn(_,l,m,r,n);let y=e.translatePosMatrix(u.posMatrix,r,n.paint.get(`fill-extrusion-translate`),n.paint.get(`fill-extrusion-translate-anchor`)),b=n.paint.get(`fill-extrusion-vertical-gradient`),x=d?vt(y,e,b,p,u,f,r):_t(y,e,b,p);v.draw(s,s.gl.TRIANGLES,i,a,o,Rn.backCCW,x,g,n.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,n.paint,e.transform.zoom,_,e.style.map.terrain&&h.centroidVertexBuffer)}}function tr(e,t,n,r,i,a,o){let s=e.context,c=s.gl,l=n.fbo;if(!l)return;let u=e.useProgram(`hillshade`),d=e.style.map.terrain&&e.style.map.terrain.getTerrainData(t);s.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,l.colorAttachment.get()),u.draw(s,c.TRIANGLES,i,a,o,Rn.disabled,((e,t,n,r)=>{let i=n.paint.get(`hillshade-shadow-color`),a=n.paint.get(`hillshade-highlight-color`),o=n.paint.get(`hillshade-accent-color`),s=n.paint.get(`hillshade-illumination-direction`)*(Math.PI/180);n.paint.get(`hillshade-illumination-anchor`)===`viewport`&&(s-=e.transform.angle);let c=!e.options.moving;return{u_matrix:r?r.posMatrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped(),c),u_image:0,u_latrange:kt(0,t.tileID),u_light:[n.paint.get(`hillshade-exaggeration`),s],u_shadow:i,u_highlight:a,u_accent:o}})(e,n,r,d?t:null),d,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}function nr(e,n,r,i,a,o){let s=e.context,c=s.gl,l=n.dem;if(l&&l.data){let u=l.dim,d=l.stride,f=l.getPixels();if(s.activeTexture.set(c.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||e.getTileTexture(d),n.demTexture){let e=n.demTexture;e.update(f,{premultiply:!1}),e.bind(c.NEAREST,c.CLAMP_TO_EDGE)}else n.demTexture=new x(s,f,c.RGBA,{premultiply:!1}),n.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);s.activeTexture.set(c.TEXTURE0);let p=n.fbo;if(!p){let e=new x(s,{width:u,height:u,data:null},c.RGBA);e.bind(c.LINEAR,c.CLAMP_TO_EDGE),p=n.fbo=s.createFramebuffer(u,u,!0,!1),p.colorAttachment.set(e.texture)}s.bindFramebuffer.set(p.framebuffer),s.viewport.set([0,0,u,u]),e.useProgram(`hillshadePrepare`).draw(s,c.TRIANGLES,i,a,o,Rn.disabled,((e,n)=>{let r=n.stride,i=t.H();return t.aP(i,0,t.X,-t.X,0,0,1),t.J(i,i,[0,-t.X,0]),{u_matrix:i,u_image:1,u_dimension:[r,r],u_zoom:e.overscaledZ,u_unpack:n.getUnpackVector()}})(n.tileID,l),null,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),n.needsHillshadePrepare=!1}}function rr(e,n,r,i,o,s){let c=i.paint.get(`raster-fade-duration`);if(!s&&c>0){let i=a.now(),s=(i-e.timeAdded)/c,l=n?(i-n.timeAdded)/c:-1,u=r.getSource(),d=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),f=!n||Math.abs(n.tileID.overscaledZ-d)>Math.abs(e.tileID.overscaledZ-d),p=f&&e.refreshedUponExpiration?1:t.ac(f?s:1-l,0,1);return e.refreshedUponExpiration&&s>=1&&(e.refreshedUponExpiration=!1),n?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}let ir=new t.aM(1,0,0,1),ar=new t.aM(0,1,0,1),or=new t.aM(0,0,1,1),sr=new t.aM(1,0,1,1),cr=new t.aM(0,1,1,1);function lr(e,t,n,r){dr(e,0,t+n/2,e.transform.width,n,r)}function ur(e,t,n,r){dr(e,t-n/2,0,n,e.transform.height,r)}function dr(e,t,n,r,i,a){let o=e.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(t*e.pixelRatio,n*e.pixelRatio,r*e.pixelRatio,i*e.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function fr(e,n,r){let i=e.context,a=i.gl,o=r.posMatrix,s=e.useProgram(`debug`),c=Fn.disabled,l=Ln.disabled,u=e.colorModeForRenderPass(),d=`$debug`,f=e.style.map.terrain&&e.style.map.terrain.getTerrainData(r);i.activeTexture.set(a.TEXTURE0);let p=n.getTileByID(r.key).latestRawTileData,m=Math.floor((p&&p.byteLength||0)/1024),h=n.getTile(r).tileSize,g=512/Math.min(h,512)*(r.overscaledZ/e.transform.zoom)*.5,_=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(_+=` => ${r.overscaledZ}`),function(e,t){e.initDebugOverlayCanvas();let n=e.debugOverlayCanvas,r=e.context.gl,i=e.debugOverlayCanvas.getContext(`2d`);i.clearRect(0,0,n.width,n.height),i.shadowColor=`white`,i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle=`white`,i.textBaseline=`top`,i.font=`bold 36px Open Sans, sans-serif`,i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(n),e.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(e,`${_} ${m}kB`),s.draw(i,a.TRIANGLES,c,l,Nn.alphaBlended,Rn.disabled,Tt(o,t.aM.transparent,g),null,d,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),s.draw(i,a.LINE_STRIP,c,l,u,Rn.disabled,Tt(o,t.aM.red),f,d,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function pr(e,t,n){let r=e.context,i=r.gl,a=e.colorModeForRenderPass(),o=new Fn(i.LEQUAL,Fn.ReadWrite,e.depthRangeFor3D),s=e.useProgram(`terrain`),c=t.getTerrainMesh();r.bindFramebuffer.set(null),r.viewport.set([0,0,e.width,e.height]);for(let l of n){let n=e.renderToTexture.getTexture(l),u=t.getTerrainData(l.tileID);r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,n.texture);let d=pt(e.transform.calculatePosMatrix(l.tileID.toUnwrapped()),t.getMeshFrameDelta(e.transform.zoom),e.transform.calculateFogMatrix(l.tileID.toUnwrapped()),e.style.sky,e.transform.pitch);s.draw(r,i.TRIANGLES,o,Ln.disabled,a,Rn.backCCW,d,u,`terrain`,c.vertexBuffer,c.indexBuffer,c.segments)}}class mr{constructor(e,t,n){this.vertexBuffer=e,this.indexBuffer=t,this.segments=n}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class hr{constructor(e,n){this.context=new Pn(e),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=fe.maxUnderzooming+fe.maxOverzooming+1,this.depthEpsilon=1/2**16,this.crossTileSymbolIndex=new ot}resize(e,t,n){if(this.width=Math.floor(e*n),this.height=Math.floor(t*n),this.pixelRatio=n,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let e of this.style._order)this.style._layers[e].resize()}setup(){let e=this.context,n=new t.aX;n.emplaceBack(0,0),n.emplaceBack(t.X,0),n.emplaceBack(0,t.X),n.emplaceBack(t.X,t.X),this.tileExtentBuffer=e.createVertexBuffer(n,ut.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);let r=new t.aX;r.emplaceBack(0,0),r.emplaceBack(t.X,0),r.emplaceBack(0,t.X),r.emplaceBack(t.X,t.X),this.debugBuffer=e.createVertexBuffer(r,ut.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);let i=new t.$;i.emplaceBack(0,0,0,0),i.emplaceBack(t.X,0,t.X,0),i.emplaceBack(0,t.X,0,t.X),i.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=e.createVertexBuffer(i,Q.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);let a=new t.aX;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(a,ut.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);let o=new t.aZ;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);let s=new t.aY;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);let c=this.context.gl;this.stencilClearMode=new Ln({func:c.ALWAYS,mask:0},0,255,c.ZERO,c.ZERO,c.ZERO)}clearStencil(){let e=this.context,n=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let r=t.H();t.aP(r,0,this.width,this.height,0,0,1),t.K(r,r,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram(`clippingMask`).draw(e,n.TRIANGLES,Fn.disabled,this.stencilClearMode,Nn.disabled,Rn.disabled,Et(r),null,`$clipping`,this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t||!t.length)return;this.currentStencilSource=e.source;let n=this.context,r=n.gl;this.nextStencilID+t.length>256&&this.clearStencil(),n.setColorMode(Nn.disabled),n.setDepthMode(Fn.disabled);let i=this.useProgram(`clippingMask`);this._tileClippingMaskIDs={};for(let e of t){let t=this._tileClippingMaskIDs[e.key]=this.nextStencilID++,a=this.style.map.terrain&&this.style.map.terrain.getTerrainData(e);i.draw(n,r.TRIANGLES,Fn.disabled,new Ln({func:r.ALWAYS,mask:0},t,255,r.KEEP,r.KEEP,r.REPLACE),Nn.disabled,Rn.disabled,Et(e.posMatrix),a,`$clipping`,this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,t=this.context.gl;return new Ln({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new Ln({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}stencilConfigForOverlap(e){let t=this.context.gl,n=e.sort((e,t)=>t.overscaledZ-e.overscaledZ),r=n[n.length-1].overscaledZ,i=n[0].overscaledZ-r+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();let e={};for(let n=0;n<i;n++)e[n+r]=new Ln({func:t.GEQUAL,mask:255},n+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=i,[e,n]}return[{[r]:Ln.disabled},n]}colorModeForRenderPass(){let e=this.context.gl;return this._showOverdrawInspector?new Nn([e.CONSTANT_COLOR,e.ONE],new t.aM(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass===`opaque`?Nn.unblended:Nn.alphaBlended}depthModeForSublayer(e,t,n){if(!this.opaquePassEnabledForLayer())return Fn.disabled;let r=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Fn(n||this.context.gl.LEQUAL,t,[r,r])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,n){this.style=e,this.options=n,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(a.now()),this.imageManager.beginFrame();let r=this.style._order,i=this.style.sourceCaches,o={},s={},c={};for(let e in i){let t=i[e];t.used&&t.prepare(this.context),o[e]=t.getVisibleCoordinates(),s[e]=o[e].slice().reverse(),c[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<r.length;e++)if(this.style._layers[r[e]].is3D()){this.opaquePassCutoff=e;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass=`offscreen`;for(let e of r){let t=this.style._layers[e];if(!t.hasOffscreenPass()||t.isHidden(this.transform.zoom))continue;let n=s[t.source];(t.type===`custom`||n.length)&&this.renderLayer(this,i[t.source],t,n)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?t.aM.black:t.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(e,n){let r=e.context,i=r.gl,a=((e,t,n)=>({u_sky_color:e.properties.get(`sky-color`),u_horizon_color:e.properties.get(`horizon-color`),u_horizon:(t.height/2+t.getHorizon())*n,u_sky_horizon_blend:e.properties.get(`sky-horizon-blend`)*t.height/2*n}))(n,e.style.map.transform,e.pixelRatio),o=new Fn(i.LEQUAL,Fn.ReadWrite,[0,1]),s=Ln.disabled,c=e.colorModeForRenderPass(),l=e.useProgram(`sky`);if(!n.mesh){let e=new t.aX;e.emplaceBack(-1,-1),e.emplaceBack(1,-1),e.emplaceBack(1,1),e.emplaceBack(-1,1);let i=new t.aY;i.emplaceBack(0,1,2),i.emplaceBack(0,2,3),n.mesh=new mr(r.createVertexBuffer(e,ut.members),r.createIndexBuffer(i),t.a0.simpleSegment(0,0,e.length,i.length))}l.draw(r,i.TRIANGLES,o,s,c,Rn.disabled,a,void 0,`sky`,n.mesh.vertexBuffer,n.mesh.indexBuffer,n.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass=`opaque`,this.currentLayer=r.length-1;this.currentLayer>=0;this.currentLayer--){let e=this.style._layers[r[this.currentLayer]],t=i[e.source],n=o[e.source];this._renderTileClippingMasks(e,n),this.renderLayer(this,t,e,n)}for(this.renderPass=`translucent`,this.currentLayer=0;this.currentLayer<r.length;this.currentLayer++){let e=this.style._layers[r[this.currentLayer]],t=i[e.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(e))continue;let n=(e.type===`symbol`?c:s)[e.source];this._renderTileClippingMasks(e,o[e.source]),this.renderLayer(this,t,e,n)}if(this.options.showTileBoundaries){let e=function(e,t){let n=null,r=Object.values(e._layers).flatMap(n=>n.source&&!n.isHidden(t)?[e.sourceCaches[n.source]]:[]),i=r.filter(e=>e.getSource().type===`vector`),a=r.filter(e=>e.getSource().type!==`vector`),o=e=>{(!n||n.getSource().maxzoom<e.getSource().maxzoom)&&(n=e)};return i.forEach(e=>o(e)),n||a.forEach(e=>o(e)),n}(this.style,this.transform.zoom);e&&function(e,t,n){for(let r=0;r<n.length;r++)fr(e,t,n[r])}(this,e,e.getVisibleCoordinates())}this.options.showPadding&&function(e){let t=e.transform.padding;lr(e,e.transform.height-(t.top||0),3,ir),lr(e,t.bottom||0,3,ar),ur(e,t.left||0,3,or),ur(e,e.transform.width-(t.right||0),3,sr);let n=e.transform.centerPoint;(function(e,t,n,r){dr(e,t-1,n-10,2,20,r),dr(e,t-10,n-1,20,2,r)})(e,n.x,e.transform.height-n.y,cr)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;let n=this.terrainFacilitator.matrix,r=this.transform.modelViewProjectionMatrix,i=this.terrainFacilitator.dirty;i||=e?!t.a_(n,r):!t.a$(n,r),i||=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0,i&&(t.b0(n,r),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(e,n){let r=e.context,i=r.gl,a=Nn.unblended,o=new Fn(i.LEQUAL,Fn.ReadWrite,[0,1]),s=n.getTerrainMesh(),c=n.sourceCache.getRenderableTiles(),l=e.useProgram(`terrainDepth`);r.bindFramebuffer.set(n.getFramebuffer(`depth`).framebuffer),r.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),r.clear({color:t.aM.transparent,depth:1});for(let t of c){let c=n.getTerrainData(t.tileID),u={u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped()),u_ele_delta:n.getMeshFrameDelta(e.transform.zoom)};l.draw(r,i.TRIANGLES,o,Ln.disabled,a,Rn.backCCW,u,c,`terrain`,s.vertexBuffer,s.indexBuffer,s.segments)}r.bindFramebuffer.set(null),r.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain),function(e,n){let r=e.context,i=r.gl,a=Nn.unblended,o=new Fn(i.LEQUAL,Fn.ReadWrite,[0,1]),s=n.getTerrainMesh(),c=n.getCoordsTexture(),l=n.sourceCache.getRenderableTiles(),u=e.useProgram(`terrainCoords`);r.bindFramebuffer.set(n.getFramebuffer(`coords`).framebuffer),r.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),r.clear({color:t.aM.transparent,depth:1}),n.coordsIndex=[];for(let t of l){let l=n.getTerrainData(t.tileID);r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,c.texture);let d={u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped()),u_terrain_coords_id:(255-n.coordsIndex.length)/255,u_texture:0,u_ele_delta:n.getMeshFrameDelta(e.transform.zoom)};u.draw(r,i.TRIANGLES,o,Ln.disabled,a,Rn.backCCW,d,l,`terrain`,s.vertexBuffer,s.indexBuffer,s.segments),n.coordsIndex.push(t.tileID.key)}r.bindFramebuffer.set(null),r.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain))}renderLayer(e,n,r,i){if(!r.isHidden(this.transform.zoom)&&(r.type===`background`||r.type===`custom`||(i||[]).length))switch(this.id=r.id,r.type){case`symbol`:(function(e,n,r,i,a){if(e.renderPass!==`translucent`)return;let o=Ln.disabled,s=e.colorModeForRenderPass();(r._unevaluatedLayout.hasValue(`text-variable-anchor`)||r._unevaluatedLayout.hasValue(`text-variable-anchor-offset`))&&function(e,n,r,i,a,o,s,c,l){let u=n.transform,d=$e(),f=a===`map`,p=o===`map`;for(let a of e){let e=i.getTile(a),o=e.getBucket(r);if(!o||!o.text||!o.text.segments.get().length)continue;let m=t.ag(o.textSizeData,u.zoom),h=Le(e,1,n.transform.zoom),g=ve(a.posMatrix,p,f,n.transform,h),_=r.layout.get(`icon-text-fit`)!==`none`&&o.hasIconData();if(m){let t=2**(u.zoom-e.tileID.overscaledZ),r=n.style.map.terrain?(e,t)=>n.style.map.terrain.getElevation(a,e,t):null,i=d.translatePosition(u,e,s,c);Wn(o,f,p,l,u,g,a.posMatrix,t,m,_,d,i,a.toUnwrapped(),r)}}}(i,e,r,n,r.layout.get(`text-rotation-alignment`),r.layout.get(`text-pitch-alignment`),r.paint.get(`text-translate`),r.paint.get(`text-translate-anchor`),a),r.paint.get(`icon-opacity`).constantOr(1)!==0&&Kn(e,n,r,i,!1,r.paint.get(`icon-translate`),r.paint.get(`icon-translate-anchor`),r.layout.get(`icon-rotation-alignment`),r.layout.get(`icon-pitch-alignment`),r.layout.get(`icon-keep-upright`),o,s),r.paint.get(`text-opacity`).constantOr(1)!==0&&Kn(e,n,r,i,!0,r.paint.get(`text-translate`),r.paint.get(`text-translate-anchor`),r.layout.get(`text-rotation-alignment`),r.layout.get(`text-pitch-alignment`),r.layout.get(`text-keep-upright`),o,s),n.map.showCollisionBoxes&&(Bn(e,n,r,i,!0),Bn(e,n,r,i,!1))})(e,n,r,i,this.style.placement.variableOffsets);break;case`circle`:(function(e,n,r,i){if(e.renderPass!==`translucent`)return;let a=r.paint.get(`circle-opacity`),o=r.paint.get(`circle-stroke-width`),s=r.paint.get(`circle-stroke-opacity`),c=!r.layout.get(`circle-sort-key`).isConstant();if(a.constantOr(1)===0&&(o.constantOr(1)===0||s.constantOr(1)===0))return;let l=e.context,u=l.gl,d=e.depthModeForSublayer(0,Fn.ReadOnly),f=Ln.disabled,p=e.colorModeForRenderPass(),m=[];for(let a=0;a<i.length;a++){let o=i[a],s=n.getTile(o),l=s.getBucket(r);if(!l)continue;let u=l.programConfigurations.get(r.id),d=e.useProgram(`circle`,u),f=l.layoutVertexBuffer,p=l.indexBuffer,h=e.style.map.terrain&&e.style.map.terrain.getTerrainData(o),g={programConfiguration:u,program:d,layoutVertexBuffer:f,indexBuffer:p,uniformValues:Ct(e,o,s,r),terrainData:h};if(c){let e=l.segments.get();for(let n of e)m.push({segments:new t.a0([n]),sortKey:n.sortKey,state:g})}else m.push({segments:l.segments,sortKey:0,state:g})}c&&m.sort((e,t)=>e.sortKey-t.sortKey);for(let t of m){let{programConfiguration:n,program:i,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:c}=t.state;i.draw(l,u.TRIANGLES,d,f,p,Rn.disabled,s,c,r.id,a,o,t.segments,r.paint,e.transform.zoom,n)}})(e,n,r,i);break;case`heatmap`:(function(e,n,r,i){if(r.paint.get(`heatmap-opacity`)===0)return;let a=e.context;if(e.style.map.terrain){for(let t of i){let i=n.getTile(t);n.hasRenderableParent(t)||(e.renderPass===`offscreen`?Jn(e,i,r,t):e.renderPass===`translucent`&&Yn(e,r,t))}a.viewport.set([0,0,e.width,e.height])}else e.renderPass===`offscreen`?function(e,n,r,i){let a=e.context,o=a.gl,s=Ln.disabled,c=new Nn([o.ONE,o.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(e,n,r){let i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,n.width/4,n.height/4]);let a=r.heatmapFbos.get(t.aU);a?(i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer)):(a=Xn(e,n.width/4,n.height/4),r.heatmapFbos.set(t.aU,a))})(a,e,r),a.clear({color:t.aM.transparent});for(let t=0;t<i.length;t++){let l=i[t];if(n.hasRenderableParent(l))continue;let u=n.getTile(l),d=u.getBucket(r);if(!d)continue;let f=d.programConfigurations.get(r.id),p=e.useProgram(`heatmap`,f),{zoom:m}=e.transform;p.draw(a,o.TRIANGLES,Fn.disabled,s,c,Rn.disabled,Dt(l.posMatrix,u,m,r.paint.get(`heatmap-intensity`)),null,r.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,r.paint,e.transform.zoom,f)}a.viewport.set([0,0,e.width,e.height])}(e,n,r,i):e.renderPass===`translucent`&&function(e,n){let r=e.context,i=r.gl;r.setColorMode(e.colorModeForRenderPass());let a=n.heatmapFbos.get(t.aU);a&&(r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),r.activeTexture.set(i.TEXTURE1),Zn(r,n).bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram(`heatmapTexture`).draw(r,i.TRIANGLES,Fn.disabled,Ln.disabled,e.colorModeForRenderPass(),Rn.disabled,Ot(e,n,0,1),null,n.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,n.paint,e.transform.zoom))}(e,r)})(e,n,r,i);break;case`line`:(function(e,n,r,i){if(e.renderPass!==`translucent`)return;let a=r.paint.get(`line-opacity`),o=r.paint.get(`line-width`);if(a.constantOr(1)===0||o.constantOr(1)===0)return;let s=e.depthModeForSublayer(0,Fn.ReadOnly),c=e.colorModeForRenderPass(),l=r.paint.get(`line-dasharray`),u=r.paint.get(`line-pattern`),d=u.constantOr(1),f=r.paint.get(`line-gradient`),p=r.getCrossfadeParameters(),m=d?`linePattern`:l?`lineSDF`:f?`lineGradient`:`line`,h=e.context,g=h.gl,_=!0;for(let a of i){let i=n.getTile(a);if(d&&!i.patternsLoaded())continue;let o=i.getBucket(r);if(!o)continue;let v=o.programConfigurations.get(r.id),y=e.context.program.get(),b=e.useProgram(m,v),S=_||b.program!==y,C=e.style.map.terrain&&e.style.map.terrain.getTerrainData(a),w=u.constantOr(null);if(w&&i.imageAtlas){let e=i.imageAtlas,t=e.patternPositions[w.to.toString()],n=e.patternPositions[w.from.toString()];t&&n&&v.setConstantPatternPositions(t,n)}let T=C?a:null,E=d?Mt(e,i,r,p,T):l?Nt(e,i,r,l,p,T):f?jt(e,i,r,o.lineClipsArray.length,T):At(e,i,r,T);if(d)h.activeTexture.set(g.TEXTURE0),i.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),v.updatePaintBuffers(p);else if(l&&(S||e.lineAtlas.dirty))h.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(h);else if(f){let i=o.gradients[r.id],s=i.texture;if(r.gradientVersion!==i.version){let c=256;if(r.stepInterpolant){let r=n.getSource().maxzoom,i=a.canonical.z===r?Math.ceil(1<<e.transform.maxZoom-a.canonical.z):1;c=t.ac(t.aV(o.maxLineLength/t.X*1024*i),256,h.maxTextureSize)}i.gradient=t.aW({expression:r.gradientExpression(),evaluationKey:`lineProgress`,resolution:c,image:i.gradient||void 0,clips:o.lineClipsArray}),i.texture?i.texture.update(i.gradient):i.texture=new x(h,i.gradient,g.RGBA),i.version=r.gradientVersion,s=i.texture}h.activeTexture.set(g.TEXTURE0),s.bind(r.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}b.draw(h,g.TRIANGLES,s,e.stencilModeForClipping(a),c,Rn.disabled,E,C,r.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,r.paint,e.transform.zoom,v,o.layoutVertexBuffer2),_=!1}})(e,n,r,i);break;case`fill`:(function(e,n,r,i){let a=r.paint.get(`fill-color`),o=r.paint.get(`fill-opacity`);if(o.constantOr(1)===0)return;let s=e.colorModeForRenderPass(),c=r.paint.get(`fill-pattern`),l=e.opaquePassEnabledForLayer()&&!c.constantOr(1)&&a.constantOr(t.aM.transparent).a===1&&o.constantOr(0)===1?`opaque`:`translucent`;e.renderPass===l&&$n(e,n,r,i,e.depthModeForSublayer(1,e.renderPass===`opaque`?Fn.ReadWrite:Fn.ReadOnly),s,!1),e.renderPass===`translucent`&&r.paint.get(`fill-antialias`)&&$n(e,n,r,i,e.depthModeForSublayer(r.getPaintProperty(`fill-outline-color`)?2:0,Fn.ReadOnly),s,!0)})(e,n,r,i);break;case`fill-extrusion`:(function(e,t,n,r){let i=n.paint.get(`fill-extrusion-opacity`);if(i!==0&&e.renderPass===`translucent`){let a=new Fn(e.context.gl.LEQUAL,Fn.ReadWrite,e.depthRangeFor3D);if(i!==1||n.paint.get(`fill-extrusion-pattern`).constantOr(1))er(e,t,n,r,a,Ln.disabled,Nn.disabled),er(e,t,n,r,a,e.stencilModeFor3D(),e.colorModeForRenderPass());else{let i=e.colorModeForRenderPass();er(e,t,n,r,a,Ln.disabled,i)}}})(e,n,r,i);break;case`hillshade`:(function(e,t,n,r){if(e.renderPass!==`offscreen`&&e.renderPass!==`translucent`)return;let i=e.context,a=e.depthModeForSublayer(0,Fn.ReadOnly),o=e.colorModeForRenderPass(),[s,c]=e.renderPass===`translucent`?e.stencilConfigForOverlap(r):[{},r];for(let r of c){let i=t.getTile(r);i.needsHillshadePrepare!==void 0&&i.needsHillshadePrepare&&e.renderPass===`offscreen`?nr(e,i,n,a,Ln.disabled,o):e.renderPass===`translucent`&&tr(e,r,i,n,a,s[r.overscaledZ],o)}i.viewport.set([0,0,e.width,e.height])})(e,n,r,i);break;case`raster`:(function(e,t,n,r){if(e.renderPass!==`translucent`||n.paint.get(`raster-opacity`)===0||!r.length)return;let i=e.context,a=i.gl,o=t.getSource(),s=e.useProgram(`raster`),c=e.colorModeForRenderPass(),[l,u]=o instanceof ee?[{},r]:e.stencilConfigForOverlap(r),d=u[u.length-1].overscaledZ,f=!e.options.moving;for(let r of u){let u=e.depthModeForSublayer(r.overscaledZ-d,n.paint.get(`raster-opacity`)===1?Fn.ReadWrite:Fn.ReadOnly,a.LESS),p=t.getTile(r);p.registerFadeDuration(n.paint.get(`raster-fade-duration`));let m=t.findLoadedParent(r,0),h=t.findLoadedSibling(r),g=rr(p,m||h||null,t,n,e.transform,e.style.map.terrain),_,v,y=n.paint.get(`raster-resampling`)===`nearest`?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),p.texture.bind(y,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),m?(m.texture.bind(y,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),_=2**(m.tileID.overscaledZ-p.tileID.overscaledZ),v=[p.tileID.canonical.x*_%1,p.tileID.canonical.y*_%1]):p.texture.bind(y,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),p.texture.useMipmap&&i.extTextureFilterAnisotropic&&e.transform.pitch>20&&a.texParameterf(a.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax);let b=e.style.map.terrain&&e.style.map.terrain.getTerrainData(r),x=b?r:null,S=It(x?x.posMatrix:e.transform.calculatePosMatrix(r.toUnwrapped(),f),v||[0,0],_||1,g,n);o instanceof ee?s.draw(i,a.TRIANGLES,u,Ln.disabled,c,Rn.disabled,S,b,n.id,o.boundsBuffer,e.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,u,l[r.overscaledZ],c,Rn.disabled,S,b,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}})(e,n,r,i);break;case`background`:(function(e,t,n,r){let i=n.paint.get(`background-color`),a=n.paint.get(`background-opacity`);if(a===0)return;let o=e.context,s=o.gl,c=e.transform,l=c.tileSize,u=n.paint.get(`background-pattern`);if(e.isPatternMissing(u))return;let d=!u&&i.a===1&&a===1&&e.opaquePassEnabledForLayer()?`opaque`:`translucent`;if(e.renderPass!==d)return;let f=Ln.disabled,p=e.depthModeForSublayer(0,d===`opaque`?Fn.ReadWrite:Fn.ReadOnly),m=e.colorModeForRenderPass(),h=e.useProgram(u?`backgroundPattern`:`background`),g=r||c.coveringTiles({tileSize:l,terrain:e.style.map.terrain});u&&(o.activeTexture.set(s.TEXTURE0),e.imageManager.bind(e.context));let _=n.getCrossfadeParameters();for(let t of g){let c=r?t.posMatrix:e.transform.calculatePosMatrix(t.toUnwrapped()),d=u?Ht(c,a,e,u,{tileID:t,tileSize:l},_):Vt(c,a,i),g=e.style.map.terrain&&e.style.map.terrain.getTerrainData(t);h.draw(o,s.TRIANGLES,p,f,m,Rn.disabled,d,g,n.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}})(e,0,r,i);break;case`custom`:(function(e,t,n){let r=e.context,i=n.implementation;if(e.renderPass===`offscreen`){let t=i.prerender;t&&(e.setCustomLayerDefaults(),r.setColorMode(e.colorModeForRenderPass()),t.call(i,r.gl,e.transform.customLayerMatrix()),r.setDirty(),e.setBaseState())}else if(e.renderPass===`translucent`){e.setCustomLayerDefaults(),r.setColorMode(e.colorModeForRenderPass()),r.setStencilMode(Ln.disabled);let t=i.renderingMode===`3d`?new Fn(e.context.gl.LEQUAL,Fn.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,Fn.ReadOnly);r.setDepthMode(t),i.render(r.gl,e.transform.customLayerMatrix(),{farZ:e.transform.farZ,nearZ:e.transform.nearZ,fov:e.transform._fov,modelViewProjectionMatrix:e.transform.modelViewProjectionMatrix,projectionMatrix:e.transform.projectionMatrix}),r.setDirty(),e.setBaseState(),r.bindFramebuffer.set(null)}})(e,0,r)}}translatePosMatrix(e,n,r,i,a){if(!r[0]&&!r[1])return e;let o=a?i===`map`?this.transform.angle:0:i===`viewport`?-this.transform.angle:0;if(o){let e=Math.sin(o),t=Math.cos(o);r=[r[0]*t-r[1]*e,r[0]*e+r[1]*t]}let s=[a?r[0]:Le(n,r[0],this.transform.zoom),a?r[1]:Le(n,r[1],this.transform.zoom),0],c=new Float32Array(16);return t.J(c,e,s),c}saveTileTexture(e){let t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){let t=this._tileTextures[e];return t&&t.length>0?t.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let t=this.imageManager.getPattern(e.from.toString()),n=this.imageManager.getPattern(e.to.toString());return!t||!n}useProgram(e,t){this.cache=this.cache||{};let n=e+(t?t.cacheKey:``)+(this._showOverdrawInspector?`/overdraw`:``)+(this.style.map.terrain?`/terrain`:``);return this.cache[n]||(this.cache[n]=new ht(this.context,$[e],t,Ut[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[n]}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 e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas??(this.debugOverlayCanvas=document.createElement(`canvas`),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new x(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:e,drawingBufferHeight:t}=this.context.gl;return this.width!==e||this.height!==t}}class gr{constructor(e,t){this.points=e,this.planes=t}static fromInvProjectionMatrix(e,n,r){let i=2**r,a=[[-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(r=>{let a=1/(r=t.af([],r,e))[3]/n*i;return t.b1(r,r,[a,a,1/r[3],a])});return new gr(a,[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(e=>{let t=function(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}([],function(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],c=n[2];return e[0]=i*c-a*s,e[1]=a*o-r*c,e[2]=r*s-i*o,e}([],_([],a[e[0]],a[e[1]]),_([],a[e[2]],a[e[1]]))),n=-((r=t)[0]*(i=a[e[1]])[0]+r[1]*i[1]+r[2]*i[2]);var r,i;return t.concat(n)}))}}class _r{constructor(e,t){this.min=e,this.max=t,this.center=function(e,t,n){return e[0]=.5*t[0],e[1]=.5*t[1],e[2]=.5*t[2],e}([],function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}([],this.min,this.max))}quadrant(e){let t=[e%2==0,e<2],n=h(this.min),r=h(this.max);for(let e=0;e<t.length;e++)n[e]=t[e]?this.min[e]:this.center[e],r[e]=t[e]?this.center[e]:this.max[e];return r[2]=this.max[2],new _r(n,r)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersects(e){let n=[[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]],r=!0;for(let i=0;i<e.planes.length;i++){let a=e.planes[i],o=0;for(let e=0;e<n.length;e++)t.b2(a,n[e])>=0&&o++;if(o===0)return 0;o!==n.length&&(r=!1)}if(r)return 2;for(let t=0;t<3;t++){let n=Number.MAX_VALUE,r=-Number.MAX_VALUE;for(let i=0;i<e.points.length;i++){let a=e.points[i][t]-this.min[t];n=Math.min(n,a),r=Math.max(r,a)}if(r<0||n>this.max[t]-this.min[t])return 0}return 1}}class vr{constructor(e=0,t=0,n=0,r=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(n)||n<0||isNaN(r)||r<0)throw Error(`Invalid value for edge-insets, top, bottom, left and right must all be numbers`);this.top=e,this.bottom=t,this.left=n,this.right=r}interpolate(e,n,r){return n.top!=null&&e.top!=null&&(this.top=t.y.number(e.top,n.top,r)),n.bottom!=null&&e.bottom!=null&&(this.bottom=t.y.number(e.bottom,n.bottom,r)),n.left!=null&&e.left!=null&&(this.left=t.y.number(e.left,n.left,r)),n.right!=null&&e.right!=null&&(this.right=t.y.number(e.right,n.right,r)),this}getCenter(e,n){let r=t.ac((this.left+e-this.right)/2,0,e),i=t.ac((this.top+n-this.bottom)/2,0,n);return new t.P(r,i)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new vr(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let yr=85.051129;class br{constructor(e,n,r,i,a){this.tileSize=512,this._renderWorldCopies=a===void 0||!!a,this._minZoom=e||0,this._maxZoom=n||22,this._minPitch=r??0,this._maxPitch=i??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new vr,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let e=new br(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.lngRange=e.lngRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.minElevationForCurrentTile=e.minElevationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){let n=-t.b3(e,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=function(){var e=new t.A(4);return t.A!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}(),function(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),c=Math.cos(n);e[0]=r*c+a*s,e[1]=i*c+o*s,e[2]=r*-s+a*c,e[3]=i*-s+o*c}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){let n=t.ac(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){let t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.tileZoom=Math.max(0,Math.floor(t)),this.scale=this.zoomScale(t),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,n){this._unmodified=!1,this._edgeInsets.interpolate(e,t,n),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){let t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}getVisibleUnwrappedCoordinates(e){let n=[new t.b4(0,e)];if(this._renderWorldCopies){let r=this.pointCoordinate(new t.P(0,0)),i=this.pointCoordinate(new t.P(this.width,0)),a=this.pointCoordinate(new t.P(this.width,this.height)),o=this.pointCoordinate(new t.P(0,this.height)),s=Math.floor(Math.min(r.x,i.x,a.x,o.x)),c=Math.floor(Math.max(r.x,i.x,a.x,o.x));for(let r=s-1;r<=c+1;r++)r!==0&&n.push(new t.b4(r,e))}return n}coveringTiles(e){let n=this.coveringZoomLevel(e),r=n;if(e.minzoom!==void 0&&n<e.minzoom)return[];e.maxzoom!==void 0&&n>e.maxzoom&&(n=e.maxzoom);let i=this.pointCoordinate(this.getCameraPoint()),a=t.Z.fromLngLat(this.center),o=2**n,s=[o*i.x,o*i.y,0],c=[o*a.x,o*a.y,0],l=gr.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,n),u=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(u=n);let d=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,f=e=>({aabb:new _r([e*o,0,0],[(e+1)*o,o,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),p=[],m=[],h=n,g=e.reparseOverscaled?r:n;if(this._renderWorldCopies)for(let e=1;e<=3;e++)p.push(f(-e)),p.push(f(e));for(p.push(f(0));p.length>0;){let n=p.pop(),r=n.x,i=n.y,a=n.fullyVisible;if(!a){let e=n.aabb.intersects(l);if(e===0)continue;a=e===2}let o=e.terrain?s:c,f=n.aabb.distanceX(o),_=n.aabb.distanceY(o),y=Math.max(Math.abs(f),Math.abs(_));if(n.zoom===h||y>d+(1<<h-n.zoom)-2&&n.zoom>=u){let e=h-n.zoom,a=s[0]-.5-(r<<e),o=s[1]-.5-(i<<e);m.push({tileID:new t.S(n.zoom===h?g:n.zoom,n.wrap,n.zoom,r,i),distanceSq:v([c[0]-.5-r,c[1]-.5-i]),tileDistanceToCamera:Math.sqrt(a*a+o*o)})}else for(let o=0;o<4;o++){let s=(r<<1)+o%2,c=(i<<1)+(o>>1),l=n.zoom+1,u=n.aabb.quadrant(o);if(e.terrain){let r=new t.S(l,n.wrap,l,s,c),i=e.terrain.getMinMaxElevation(r),a=i.minElevation??this.elevation,o=i.maxElevation??this.elevation;u=new _r([u.min[0],u.min[1],a],[u.max[0],u.max[1],o])}p.push({aabb:u,zoom:l,x:s,y:c,wrap:n.wrap,fullyVisible:a})}}return m.sort((e,t)=>e.distanceSq-t.distanceSq).map(e=>e.tileID)}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return 2**e}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){let n=t.ac(e.lat,-85.051129,yr);return new t.P(t.O(e.lng)*this.worldSize,t.Q(n)*this.worldSize)}unproject(e){return new t.Z(e.x/this.worldSize,e.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(e){let n=this.elevation,r=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,i=this.pointLocation(this.centerPoint,e),a=e.getElevationForLngLatZoom(i,this.tileZoom);if(!(this.elevation-a))return;let o=r+n-a,s=Math.cos(this._pitch)*this.cameraToCenterDistance/o/t.b5(1,i.lat),c=this.scaleZoom(s/this.tileSize);this._elevation=a,this._center=i,this.zoom=c}setLocationAtPoint(e,n){let r=this.pointCoordinate(n),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.Z(a.x-(r.x-i.x),a.y-(r.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,t){return t?this.coordinatePoint(this.locationCoordinate(e),t.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,t){return this.coordinateLocation(this.pointCoordinate(e,t))}locationCoordinate(e){return t.Z.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,n){if(n){let t=n.pointCoordinate(e);if(t!=null)return t}let r=[e.x,e.y,0,1],i=[e.x,e.y,1,1];t.af(r,r,this.pixelMatrixInverse),t.af(i,i,this.pixelMatrixInverse);let a=r[3],o=i[3],s=r[1]/a,c=i[1]/o,l=r[2]/a,u=i[2]/o,d=l===u?0:(0-l)/(u-l);return new t.Z(t.y.number(r[0]/a,i[0]/o,d)/this.worldSize,t.y.number(s,c,d)/this.worldSize)}coordinatePoint(e,n=0,r=this.pixelMatrix){let i=[e.x*this.worldSize,e.y*this.worldSize,n,1];return t.af(i,i,r),new t.P(i[0]/i[3],i[1]/i[3])}getBounds(){let e=Math.max(0,this.height/2-this.getHorizon());return new K().extend(this.pointLocation(new t.P(0,e))).extend(this.pointLocation(new t.P(this.width,e))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new K([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(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,yr])}calculateTileMatrix(e){let n=e.canonical,r=this.worldSize/this.zoomScale(n.z),i=n.x+2**n.z*e.wrap,a=t.an(new Float64Array(16));return t.J(a,a,[i*r,n.y*r,0]),t.K(a,a,[r/t.X,r/t.X,1]),a}calculatePosMatrix(e,n=!1){let r=e.key,i=n?this._alignedPosMatrixCache:this._posMatrixCache;if(i[r])return i[r];let a=this.calculateTileMatrix(e);return t.L(a,n?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,a),i[r]=new Float32Array(a),i[r]}calculateFogMatrix(e){let n=e.key,r=this._fogMatrixCache;if(r[n])return r[n];let i=this.calculateTileMatrix(e);return t.L(i,this.fogMatrix,i),r[n]=new Float32Array(i),r[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,n){n=t.ac(+n,this.minZoom,this.maxZoom);let r={center:new t.N(e.lng,e.lat),zoom:n},i=this.lngRange;if(!this._renderWorldCopies&&i===null){let e=179.9999999999;i=[-e,e]}let a=this.tileSize*this.zoomScale(r.zoom),o=0,s=a,c=0,l=a,u=0,d=0,{x:f,y:p}=this.size;if(this.latRange){let e=this.latRange;o=t.Q(e[1])*a,s=t.Q(e[0])*a,s-o<p&&(u=p/(s-o))}i&&(c=t.b3(t.O(i[0])*a,0,a),l=t.b3(t.O(i[1])*a,0,a),l<c&&(l+=a),l-c<f&&(d=f/(l-c)));let{x:m,y:h}=this.project.call({worldSize:a},e),g,_,v=Math.max(d||0,u||0);if(v){let e=new t.P(d?(l+c)/2:m,u?(s+o)/2:h);return r.center=this.unproject.call({worldSize:a},e).wrap(),r.zoom+=this.scaleZoom(v),r}if(this.latRange){let e=p/2;h-e<o&&(_=o+e),h+e>s&&(_=s-e)}if(i){let e=(c+l)/2,n=m;this._renderWorldCopies&&(n=t.b3(m,e-a/2,e+a/2));let r=f/2;n-r<c&&(g=c+r),n+r>l&&(g=l-r)}if(g!==void 0||_!==void 0){let e=new t.P(g??m,_??h);r.center=this.unproject.call({worldSize:a},e).wrap()}return r}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let e=this._unmodified,{center:t,zoom:n}=this.getConstrained(this.center,this.zoom);this.center=t,this.zoom=n,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;let e=this.centerOffset,n=this.point.x,r=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let i=t.an(new Float64Array(16));t.K(i,i,[this.width/2,-this.height/2,1]),t.J(i,i,[1,-1,0]),this.labelPlaneMatrix=i,i=t.an(new Float64Array(16)),t.K(i,i,[1,-1,1]),t.J(i,i,[-1,-1,0]),t.K(i,i,[2/this.width,2/this.height,1]),this.glCoordMatrix=i;let a=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),o=Math.min(this.elevation,this.minElevationForCurrentTile),s=a-o*this._pixelPerMeter/Math.cos(this._pitch),c=o<0?s:a,l=Math.PI/2+this._pitch,u=this._fov*(.5+e.y/this.height),d=Math.sin(u)*c/Math.sin(t.ac(Math.PI-l-u,.01,Math.PI-.01)),f=this.getHorizon(),p=2*Math.atan(f/this.cameraToCenterDistance)*(.5+e.y/(2*f)),m=Math.sin(p)*c/Math.sin(t.ac(Math.PI-l-p,.01,Math.PI-.01)),h=Math.min(d,m);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*h+c),this.nearZ=this.height/50,i=new Float64Array(16),t.b6(i,this._fov,this.width/this.height,this.nearZ,this.farZ),i[8]=2*-e.x/this.width,i[9]=2*e.y/this.height,this.projectionMatrix=t.ae(i),t.K(i,i,[1,-1,1]),t.J(i,i,[0,0,-this.cameraToCenterDistance]),t.b7(i,i,this._pitch),t.ad(i,i,this.angle),t.J(i,i,[-n,-r,0]),this.mercatorMatrix=t.K([],i,[this.worldSize,this.worldSize,this.worldSize]),t.K(i,i,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,i),t.J(i,i,[0,0,-this.elevation]),this.modelViewProjectionMatrix=i,this.invModelViewProjectionMatrix=t.as([],i),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,a,this.farZ),this.fogMatrix[8]=2*-e.x/this.width,this.fogMatrix[9]=2*e.y/this.height,t.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b7(this.fogMatrix,this.fogMatrix,this._pitch),t.ad(this.fogMatrix,this.fogMatrix,this.angle),t.J(this.fogMatrix,this.fogMatrix,[-n,-r,0]),t.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=t.L(new Float64Array(16),this.labelPlaneMatrix,i);let g=this.width%2/2,_=this.height%2/2,v=Math.cos(this.angle),y=Math.sin(this.angle),b=n-Math.round(n)+v*g+y*_,x=r-Math.round(r)+v*_+y*g,S=new Float64Array(i);if(t.J(S,S,[b>.5?b-1:b,x>.5?x-1:x,0]),this.alignedModelViewProjectionMatrix=S,i=t.as(new Float64Array(16),this.pixelMatrix),!i)throw Error(`failed to invert matrix`);this.pixelMatrixInverse=i,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let e=this.pointCoordinate(new t.P(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.af(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,e))}getCameraQueryGeometry(e){let n=this.getCameraPoint();if(e.length===1)return[e[0],n];{let r=n.x,i=n.y,a=n.x,o=n.y;for(let t of e)r=Math.min(r,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y);return[new t.P(r,i),new t.P(a,i),new t.P(a,o),new t.P(r,o),new t.P(r,i)]}}lngLatToCameraDepth(e,n){let r=this.locationCoordinate(e),i=[r.x*this.worldSize,r.y*this.worldSize,n,1];return t.af(i,i,this.modelViewProjectionMatrix),i[2]/i[3]}}function xr(e,t){let n,r=!1,i=null,a=null,o=()=>{i=null,r&&=(e.apply(a,n),i=setTimeout(o,t),!1)};return(...e)=>(r=!0,a=this,n=e,i||o(),i)}class Sr{constructor(e){this._getCurrentHash=()=>{let e=window.location.hash.replace(`#`,``);if(this._hashName){let t;return e.split(`&`).map(e=>e.split(`=`)).forEach(e=>{e[0]===this._hashName&&(t=e)}),(t&&t[1]||``).split(`/`)}return e.split(`/`)},this._onHashChange=()=>{let e=this._getCurrentHash();if(e.length>=3&&!e.some(e=>isNaN(e))){let t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let e=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,e)},this._removeHash=()=>{let e=this._getCurrentHash();if(e.length===0)return;let t=e.join(`/`),n=t;n.split(`&`).length>0&&(n=n.split(`&`)[0]),this._hashName&&(n=`${this._hashName}=${t}`);let r=window.location.hash.replace(n,``);r.startsWith(`#&`)?r=r.slice(0,1)+r.slice(2):r===`#`&&(r=``);let i=window.location.href.replace(/(#.+)?$/,r);i=i.replace(`&&`,`&`),window.history.replaceState(window.history.state,null,i)},this._updateHash=xr(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,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(e){let t=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,r=10**Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.round(t.lng*r)/r,a=Math.round(t.lat*r)/r,o=this._map.getBearing(),s=this._map.getPitch(),c=``;if(c+=e?`/${i}/${a}/${n}`:`${n}/${a}/${i}`,(o||s)&&(c+=`/`+Math.round(10*o)/10),s&&(c+=`/${Math.round(s)}`),this._hashName){let e=this._hashName,t=!1,n=window.location.hash.slice(1).split(`&`).map(n=>{let r=n.split(`=`)[0];return r===e?(t=!0,`${r}=${c}`):n}).filter(e=>e);return t||n.push(`${e}=${c}`),`#${n.join(`&`)}`}return`#${c}`}}let Cr={linearity:.3,easing:t.b8(0,0,.3,1)},wr=t.e({deceleration:2500,maxSpeed:1400},Cr),Tr=t.e({deceleration:20,maxSpeed:1400},Cr),Er=t.e({deceleration:1e3,maxSpeed:360},Cr),Dr=t.e({deceleration:1e3,maxSpeed:90},Cr);class Or{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.now(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=a.now();for(;e.length>0&&t-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let n={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:e}of this._inertiaBuffer)n.zoom+=e.zoomDelta||0,n.bearing+=e.bearingDelta||0,n.pitch+=e.pitchDelta||0,e.panDelta&&n.pan._add(e.panDelta),e.around&&(n.around=e.around),e.pinchAround&&(n.pinchAround=e.pinchAround);let r=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(n.pan.mag()){let a=Ar(n.pan.mag(),r,t.e({},wr,e||{}));i.offset=n.pan.mult(a.amount/n.pan.mag()),i.center=this._map.transform.center,kr(i,a)}if(n.zoom){let e=Ar(n.zoom,r,Tr);i.zoom=this._map.transform.zoom+e.amount,kr(i,e)}if(n.bearing){let e=Ar(n.bearing,r,Er);i.bearing=this._map.transform.bearing+t.ac(e.amount,-179,179),kr(i,e)}if(n.pitch){let e=Ar(n.pitch,r,Dr);i.pitch=this._map.transform.pitch+e.amount,kr(i,e)}if(i.zoom||i.bearing){let e=n.pinchAround===void 0?n.around:n.pinchAround;i.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),t.e(i,{noMoveStart:!0})}}function kr(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Ar(e,n,r){let{maxSpeed:i,linearity:a,deceleration:o}=r,s=t.ac(e*a/(n/1e3),-i,i),c=Math.abs(s)/(o*a);return{easing:r.easing,duration:1e3*c,amount:c/2*s}}class jr extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,r,i={}){let a=o.mousePos(n.getCanvas(),r),s=n.unproject(a);super(e,t.e({point:a,lngLat:s,originalEvent:r},i)),this._defaultPrevented=!1,this.target=n}}class Mr extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,r){let i=e===`touchend`?r.changedTouches:r.touches,a=o.touchPos(n.getCanvasContainer(),i),s=a.map(e=>n.unproject(e)),c=a.reduce((e,t,n,r)=>e.add(t.div(r.length)),new t.P(0,0));super(e,{points:a,point:c,lngLats:s,lngLat:n.unproject(c),originalEvent:r}),this._defaultPrevented=!1}}class Nr extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,n){super(e,{originalEvent:n}),this._defaultPrevented=!1}}class Pr{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new Nr(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new jr(e.type,this._map,e))}mouseup(e){this._map.fire(new jr(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new jr(e.type,this._map,e))}dblclick(e){return this._firePreventable(new jr(e.type,this._map,e))}mouseover(e){this._map.fire(new jr(e.type,this._map,e))}mouseout(e){this._map.fire(new jr(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Mr(e.type,this._map,e))}touchmove(e){this._map.fire(new Mr(e.type,this._map,e))}touchend(e){this._map.fire(new Mr(e.type,this._map,e))}touchcancel(e){this._map.fire(new Mr(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Fr{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new jr(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new jr(`contextmenu`,this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new jr(e.type,this._map,e)),this._map.listens(`contextmenu`)&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ir{constructor(e){this._map=e}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(e){return this.transform.pointLocation(t.P.convert(e),this._map.terrain)}}class Lr{constructor(e,t){this._map=e,this._tr=new Ir(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&e.button===0&&(o.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;let n=t;if(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)return;let r=this._startPos;this._lastPos=n,this._box||(this._box=o.create(`div`,`maplibregl-boxzoom`,this._container),this._container.classList.add(`maplibregl-crosshair`),this._fireEvent(`boxzoomstart`,e));let i=Math.min(r.x,n.x),a=Math.max(r.x,n.x),s=Math.min(r.y,n.y),c=Math.max(r.y,n.y);o.setTransform(this._box,`translate(${i}px,${s}px)`),this._box.style.width=a-i+`px`,this._box.style.height=c-s+`px`}mouseupWindow(e,n){if(!this._active||e.button!==0)return;let r=this._startPos,i=n;if(this.reset(),o.suppressClick(),r.x!==i.x||r.y!==i.y)return this._map.fire(new t.k(`boxzoomend`,{originalEvent:e})),{cameraAnimation:e=>e.fitScreenCoordinates(r,i,this._tr.bearing,{linear:!0})};this._fireEvent(`boxzoomcancel`,e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent(`boxzoomcancel`,e))}reset(){this._active=!1,this._container.classList.remove(`maplibregl-crosshair`),this._box&&=(o.remove(this._box),null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,n){return this._map.fire(new t.k(e,{originalEvent:n}))}}function Rr(e,t){if(e.length!==t.length)throw Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);let n={};for(let r=0;r<e.length;r++)n[e[r].identifier]=t[r];return n}class zr{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,n,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=function(e){let n=new t.P(0,0);for(let t of e)n._add(t);return n.div(e.length)}(n),this.touches=Rr(r,n)))}touchmove(e,t,n){if(this.aborted||!this.centroid)return;let r=Rr(n,t);for(let e in this.touches){let t=r[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,t,n){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){let e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class Br{constructor(e){this.singleTap=new zr(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,n){this.singleTap.touchstart(e,t,n)}touchmove(e,t,n){this.singleTap.touchmove(e,t,n)}touchend(e,t,n){let r=this.singleTap.touchend(e,t,n);if(r){let t=e.timeStamp-this.lastTime<500,n=!this.lastTap||this.lastTap.dist(r)<30;if(t&&n||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}class Vr{constructor(e){this._tr=new Ir(e),this._zoomIn=new Br({numTouches:1,numTaps:2}),this._zoomOut=new Br({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,n){this._zoomIn.touchstart(e,t,n),this._zoomOut.touchstart(e,t,n)}touchmove(e,t,n){this._zoomIn.touchmove(e,t,n),this._zoomOut.touchmove(e,t,n)}touchend(e,t,n){let r=this._zoomIn.touchend(e,t,n),i=this._zoomOut.touchend(e,t,n),a=this._tr;return r?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(r)},{originalEvent:e})}):i?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:a.zoom-1,around:a.unproject(i)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Hr{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){let t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=t.length?t[0]:t,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;let n=this._lastPoint;if(!n)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);let r=t.length?t[0]:t;return!this._moved&&r.dist(n)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=r,this._move(n,r))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&o.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let Ur={0:1,2:2};class Wr{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){this._eventButton=o.mouseButton(e)}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(e,t){let n=Ur[t];return e.buttons===void 0||(e.buttons&n)!==n}(e,this._eventButton)}isValidEndEvent(e){return o.mouseButton(e)===this._eventButton}}class Gr{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}let Kr=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=e=>{e.preventDefault()}},qr=({enable:e,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>new Hr({clickTolerance:t,move:(e,t)=>({bearingDelta:(t.x-e.x)*n}),moveStateManager:new Wr({checkCorrectEvent:e=>o.mouseButton(e)===0&&e.ctrlKey||o.mouseButton(e)===2}),enable:e,assignEvents:Kr}),Jr=({enable:e,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>new Hr({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:new Wr({checkCorrectEvent:e=>o.mouseButton(e)===0&&e.ctrlKey||o.mouseButton(e)===2}),enable:e,assignEvents:Kr});class Yr{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,t,n){return this._calculateTransform(e,t,n)}touchmove(e,t,n){if(this._active){if(!this._shouldBePrevented(n.length))return e.preventDefault(),this._calculateTransform(e,t,n);this._map.cooperativeGestures.notifyGestureBlocked(`touch_pan`,e)}}touchend(e,t,n){this._calculateTransform(e,t,n),this._active&&this._shouldBePrevented(n.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,n,r){r.length>0&&(this._active=!0);let i=Rr(r,n),a=new t.P(0,0),o=new t.P(0,0),s=0;for(let e in i){let t=i[e],n=this._touches[e];n&&(a._add(t),o._add(t.sub(n)),s++,i[e]=t)}if(this._touches=i,this._shouldBePrevented(s)||!o.mag())return;let c=o.div(s);return this._sum._add(c),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(s),panDelta:c}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Xr{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,n){if(!this._firstTwoTouches)return;e.preventDefault();let[r,i]=this._firstTwoTouches,a=Zr(n,t,r),o=Zr(n,t,i);if(!a||!o)return;let s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,e)}touchend(e,t,n){if(!this._firstTwoTouches)return;let[r,i]=this._firstTwoTouches,a=Zr(n,t,r),s=Zr(n,t,i);a&&s||(this._active&&o.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around===`center`}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Zr(e,t,n){for(let r=0;r<e.length;r++)if(e[r].identifier===n)return t[r]}function Qr(e,t){return Math.log(e/t)/Math.LN2}class $r extends Xr{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){let n=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(Qr(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Qr(this._distance,n),pinchAround:t}}}function ei(e,t){return 180*e.angleWith(t)/Math.PI}class ti extends Xr{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,n){let r=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ei(this._vector,r),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let t=25/(Math.PI*this._minDiameter)*360,n=ei(e,this._startVector);return Math.abs(n)<t}}function ni(e){return Math.abs(e.y)>Math.abs(e.x)}class ri extends Xr{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,n){super.touchstart(e,t,n),this._currentTouchCount=n.length}_start(e){this._lastPoints=e,ni(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,n){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let r=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(r,i,n.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(r.y+i.y)/2*-.5}):void 0}gestureBeginsVertically(e,t,n){if(this._valid!==void 0)return this._valid;let r=e.mag()>=2,i=t.mag()>=2;if(!r&&!i)return;if(!r||!i)return this._firstMove===void 0&&(this._firstMove=n),n-this._firstMove<100&&void 0;let a=e.y>0==t.y>0;return ni(e)&&ni(t)&&a}}let ii={panStep:100,bearingStep:15,pitchStep:10};class ai{constructor(e){this._tr=new Ir(e);let t=ii;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,n=0,r=0,i=0,a=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),i=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),i=1);break;case 38:e.shiftKey?r=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?r=-1:(e.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(n=0,r=0),{cameraAnimation:o=>{let s=this._tr;o.easeTo({duration:300,easeId:`keyboardHandler`,easing:oi,zoom:t?Math.round(s.zoom)+t*(e.shiftKey?2:1):s.zoom,bearing:s.bearing+n*this._bearingStep,pitch:s.pitch+r*this._pitchStep,offset:[-i*this._panStep,-a*this._panStep],center:s.center},{originalEvent:e})}}}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 oi(e){return e*(2-e)}let si=4.000244140625;class ci{constructor(e,t){this._onTimeout=e=>{this._type=`wheel`,this._delta-=this._lastValue,this._active||this._start(e)},this._map=e,this._tr=new Ir(e),this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around===`center`)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked(`wheel_zoom`,e);let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=a.now(),r=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,t!==0&&t%si==0?this._type=`wheel`:t!==0&&Math.abs(t)<4?this._type=`trackpad`:r>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(r*t)<200?`trackpad`:`wheel`,this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&=null,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let n=o.mousePos(this._map.getCanvas(),e),r=this._tr;this._around=n.y>r.transform.height/2-r.transform.getHorizon()?t.N.convert(this._aroundCenter?r.center:r.unproject(n)):t.N.convert(r.center),this._aroundPoint=r.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let e=this._tr.transform;if(this._delta!==0){let t=this._type===`wheel`&&Math.abs(this._delta)>si?this._wheelZoomRate:this._defaultZoomRate,n=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&n!==0&&(n=1/n);let r=typeof this._targetZoom==`number`?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(r*n))),this._type===`wheel`&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let n=typeof this._targetZoom==`number`?this._targetZoom:e.zoom,r=this._startZoom,i=this._easing,o,s=!1,c=a.now()-this._lastWheelEventTime;if(this._type===`wheel`&&r&&i&&c){let e=Math.min(c/200,1),a=i(e);o=t.y.number(r,n,a),e<1?this._frameId||=!0:s=!0}else o=n,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:o-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let n=t.b9;if(this._prevEase){let e=this._prevEase,r=(a.now()-e.start)/e.duration,i=e.easing(r+.01)-e.easing(r),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);n=t.b8(o,s,.25,1)}return this._prevEase={start:a.now(),duration:e,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class li{constructor(e,t){this._clickZoom=e,this._tapZoom=t}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 ui{constructor(e){this._tr=new Ir(e),this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class di{constructor(){this._tap=new Br({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(e,t,n){if(!this._swipePoint)if(this._tapTime){let r=t[0],i=e.timeStamp-this._tapTime<500,a=this._tapPoint.dist(r)<30;i&&a?n.length>0&&(this._swipePoint=r,this._swipeTouch=n[0].identifier):this.reset()}else this._tap.touchstart(e,t,n)}touchmove(e,t,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;let r=t[0],i=r.y-this._swipePoint.y;return this._swipePoint=r,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,n)}touchend(e,t,n){if(this._tapTime)this._swipePoint&&n.length===0&&this.reset();else{let r=this._tap.touchend(e,t,n);r&&(this._tapTime=e.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class fi{constructor(e,t,n){this._el=e,this._mousePan=t,this._touchPan=n}enable(e){this._inertiaOptions=e||{},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 pi{constructor(e,t,n){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=n}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 mi{constructor(e,t,n,r){this._el=e,this._touchZoom=t,this._touchRotate=n,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),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 hi{constructor(e,t){this._bypassKey=navigator.userAgent.indexOf(`Mac`)===-1?`ctrlKey`:`metaKey`,this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add(`maplibregl-cooperative-gestures`),this._container=o.create(`div`,`maplibregl-cooperative-gesture-screen`,e);let t=this._map._getUIString(`CooperativeGesturesHandler.WindowsHelpText`);this._bypassKey===`metaKey`&&(t=this._map._getUIString(`CooperativeGesturesHandler.MacHelpText`));let n=this._map._getUIString(`CooperativeGesturesHandler.MobileHelpText`),r=document.createElement(`div`);r.className=`maplibregl-desktop-message`,r.textContent=t,this._container.appendChild(r);let i=document.createElement(`div`);i.className=`maplibregl-mobile-message`,i.textContent=n,this._container.appendChild(i),this._container.setAttribute(`aria-hidden`,`true`)}_destroyUI(){this._container&&(o.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(e){return e[this._bypassKey]}notifyGestureBlocked(e,n){this._enabled&&(this._map.fire(new t.k(`cooperativegestureprevented`,{gestureType:e,originalEvent:n})),this._container.classList.add(`maplibregl-show`),setTimeout(()=>{this._container.classList.remove(`maplibregl-show`)},100))}}let gi=e=>e.zoom||e.drag||e.pitch||e.rotate;class _i extends t.k{}function vi(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class yi{constructor(e,t){this.handleWindowEvent=e=>{this.handleEvent(e,`${e.type}Window`)},this.handleEvent=(e,t)=>{if(e.type===`blur`)return void this.stop(!0);this._updatingCamera=!0;let n=e.type===`renderFrame`?void 0:e,r={needsRenderFrame:!1},i={},a={},s=e.touches,c=s?this._getMapTouches(s):void 0,l=c?o.touchPos(this._map.getCanvas(),c):o.mousePos(this._map.getCanvas(),e);for(let{handlerName:o,handler:s,allowed:u}of this._handlers){if(!s.isEnabled())continue;let d;this._blockedByActive(a,u,o)?s.reset():s[t||e.type]&&(d=s[t||e.type](e,l,c),this.mergeHandlerResult(r,i,d,o,n),d&&d.needsRenderFrame&&this._triggerRenderFrame()),(d||s.isActive())&&(a[o]=s)}let u={};for(let e in this._previousActiveHandlers)a[e]||(u[e]=n);this._previousActiveHandlers=a,(Object.keys(u).length||vi(r))&&(this._changes.push([r,i,u]),this._triggerRenderFrame()),(Object.keys(a).length||vi(r))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:d}=r;d&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],d(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Or(e),this._bearingSnap=t.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(t);let n=this._el;this._listeners=[[n,`touchstart`,{passive:!0}],[n,`touchmove`,{passive:!1}],[n,`touchend`,void 0],[n,`touchcancel`,void 0],[n,`mousedown`,void 0],[n,`mousemove`,void 0],[n,`mouseup`,void 0],[document,`mousemove`,{capture:!0}],[document,`mouseup`,void 0],[n,`mouseover`,void 0],[n,`mouseout`,void 0],[n,`dblclick`,void 0],[n,`click`,void 0],[n,`keydown`,{capture:!1}],[n,`keyup`,void 0],[n,`wheel`,{passive:!1}],[n,`contextmenu`,void 0],[window,`blur`,void 0]];for(let[e,t,n]of this._listeners)o.addEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,n)}destroy(){for(let[e,t,n]of this._listeners)o.removeEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(e){let t=this._map,n=t.getCanvasContainer();this._add(`mapEvent`,new Pr(t,e));let r=t.boxZoom=new Lr(t,e);this._add(`boxZoom`,r),e.interactive&&e.boxZoom&&r.enable();let i=t.cooperativeGestures=new hi(t,e.cooperativeGestures);this._add(`cooperativeGestures`,i),e.cooperativeGestures&&i.enable();let a=new Vr(t),s=new ui(t);t.doubleClickZoom=new li(s,a),this._add(`tapZoom`,a),this._add(`clickZoom`,s),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();let c=new di;this._add(`tapDragZoom`,c);let l=t.touchPitch=new ri(t);this._add(`touchPitch`,l),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);let u=qr(e),d=Jr(e);t.dragRotate=new pi(e,u,d),this._add(`mouseRotate`,u,[`mousePitch`]),this._add(`mousePitch`,d,[`mouseRotate`]),e.interactive&&e.dragRotate&&t.dragRotate.enable();let f=(({enable:e,clickTolerance:t})=>new Hr({clickTolerance:t,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:new Wr({checkCorrectEvent:e=>o.mouseButton(e)===0&&!e.ctrlKey}),enable:e,assignEvents:Kr}))(e),p=new Yr(e,t);t.dragPan=new fi(n,f,p),this._add(`mousePan`,f),this._add(`touchPan`,p,[`touchZoom`,`touchRotate`]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);let m=new ti,h=new $r;t.touchZoomRotate=new mi(n,h,m,c),this._add(`touchRotate`,m,[`touchPan`,`touchZoom`]),this._add(`touchZoom`,h,[`touchPan`,`touchRotate`]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate);let g=t.scrollZoom=new ci(t,()=>this._triggerRenderFrame());this._add(`scrollZoom`,g,[`mousePan`]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);let _=t.keyboard=new ai(t);this._add(`keyboard`,_),e.interactive&&e.keyboard&&t.keyboard.enable(),this._add(`blockableMapEvent`,new Fr(t))}_add(e,t,n){this._handlers.push({handlerName:e,handler:t,allowed:n}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(let{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!gi(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,n){for(let r in e)if(r!==n&&(!t||t.indexOf(r)<0))return!0;return!1}_getMapTouches(e){let t=[];for(let n of e)this._el.contains(n.target)&&t.push(n);return t}mergeHandlerResult(e,n,r,i,a){if(!r)return;t.e(e,r);let o={handlerName:i,originalEvent:r.originalEvent||a};r.zoomDelta!==void 0&&(n.zoom=o),r.panDelta!==void 0&&(n.drag=o),r.pitchDelta!==void 0&&(n.pitch=o),r.bearingDelta!==void 0&&(n.rotate=o)}_applyChanges(){let e={},n={},r={};for(let[i,a,o]of this._changes)i.panDelta&&(e.panDelta=(e.panDelta||new t.P(0,0))._add(i.panDelta)),i.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+i.pitchDelta),i.around!==void 0&&(e.around=i.around),i.pinchAround!==void 0&&(e.pinchAround=i.pinchAround),i.noInertia&&(e.noInertia=i.noInertia),t.e(n,a),t.e(r,o);this._updateMapTransform(e,n,r),this._changes=[]}_updateMapTransform(e,t,n){let r=this._map,i=r._getTransformForUpdate(),a=r.terrain;if(!(vi(e)||a&&this._terrainMovement))return this._fireEvents(t,n,!0);let{panDelta:o,zoomDelta:s,bearingDelta:c,pitchDelta:l,around:u,pinchAround:d}=e;d!==void 0&&(u=d),r._stop(!0),u||=r.transform.centerPoint;let f=i.pointLocation(o?u.sub(o):u);c&&(i.bearing+=c),l&&(i.pitch+=l),s&&(i.zoom+=s),a?this._terrainMovement||!t.drag&&!t.zoom?t.drag&&this._terrainMovement?i.center=i.pointLocation(i.centerPoint.sub(o)):i.setLocationAtPoint(f,u):(this._terrainMovement=!0,this._map._elevationFreeze=!0,i.setLocationAtPoint(f,u)):i.setLocationAtPoint(f,u),r._applyUpdatedTransform(i),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,n,!0)}_fireEvents(e,n,r){let i=gi(this._eventsInProgress),o=gi(e),s={};for(let t in e){let{originalEvent:n}=e[t];this._eventsInProgress[t]||(s[`${t}start`]=n),this._eventsInProgress[t]=e[t]}!i&&o&&this._fireEvent(`movestart`,o.originalEvent);for(let e in s)this._fireEvent(e,s[e]);o&&this._fireEvent(`move`,o.originalEvent);for(let t in e){let{originalEvent:n}=e[t];this._fireEvent(t,n)}let c={},l;for(let e in this._eventsInProgress){let{handlerName:t,originalEvent:r}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=n[t]||r,c[`${e}end`]=l)}for(let e in c)this._fireEvent(e,c[e]);let u=gi(this._eventsInProgress),d=(i||o)&&!u;if(d&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let e=this._map._getTransformForUpdate();e.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(e)}if(r&&d){this._updatingCamera=!0;let e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),n=e=>e!==0&&-this._bearingSnap<e&&e<this._bearingSnap;!e||!e.essential&&a.prefersReducedMotion?(this._map.fire(new t.k(`moveend`,{originalEvent:l})),n(this._map.getBearing())&&this._map.resetNorth()):(n(e.bearing||this._map.getBearing())&&(e.bearing=0),e.freezeElevation=!0,this._map.easeTo(e,{originalEvent:l})),this._updatingCamera=!1}}_fireEvent(e,n){this._map.fire(new t.k(e,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new _i(`renderFrame`,{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class bi extends t.E{constructor(e,t){super(),this._renderFrameCallback=()=>{let e=Math.min((a.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=t.bearingSnap,this.on(`moveend`,()=>{delete this._requestedCameraState})}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(e,n,r){return e=t.P.convert(e).mult(-1),this.panTo(this.transform.center,t.e({offset:e},n),r)}panTo(e,n,r){return this.easeTo(t.e({center:e},n),r)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,n,r){return this.easeTo(t.e({zoom:e},n),r)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,n,r){return this.easeTo(t.e({bearing:e},n),r)}resetNorth(e,n){return this.rotateTo(0,t.e({duration:1e3},e),n),this}resetNorthPitch(e,n){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},e),n),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}cameraForBounds(e,t){e=K.convert(e).adjustAntiMeridian();let n=t&&t.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),n,t)}_cameraForBoxAndBearing(e,n,r,i){let a={top:0,bottom:0,right:0,left:0};if(typeof(i=t.e({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding==`number`){let e=i.padding;i.padding={top:e,bottom:e,right:e,left:e}}i.padding=t.e(a,i.padding);let o=this.transform,s=o.padding,c=new K(e,n),l=o.project(c.getNorthWest()),u=o.project(c.getNorthEast()),d=o.project(c.getSouthEast()),f=o.project(c.getSouthWest()),p=t.ba(-r),m=l.rotate(p),h=u.rotate(p),g=d.rotate(p),_=f.rotate(p),v=new t.P(Math.max(m.x,h.x,_.x,g.x),Math.max(m.y,h.y,_.y,g.y)),y=new t.P(Math.min(m.x,h.x,_.x,g.x),Math.min(m.y,h.y,_.y,g.y)),b=v.sub(y),x=(o.width-(s.left+s.right+i.padding.left+i.padding.right))/b.x,S=(o.height-(s.top+s.bottom+i.padding.top+i.padding.bottom))/b.y;if(S<0||x<0)return void t.w(`Map cannot fit within canvas with the given bounds, padding, and/or offset.`);let C=Math.min(o.scaleZoom(o.scale*Math.min(x,S)),i.maxZoom),w=t.P.convert(i.offset),T=new t.P((i.padding.left-i.padding.right)/2,(i.padding.top-i.padding.bottom)/2).rotate(t.ba(r)),E=w.add(T).mult(o.scale/o.zoomScale(C));return{center:o.unproject(l.add(d).div(2).sub(E)),zoom:C,bearing:r}}fitBounds(e,t,n){return this._fitInternal(this.cameraForBounds(e,t),t,n)}fitScreenCoordinates(e,n,r,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.P.convert(e)),this.transform.pointLocation(t.P.convert(n)),r,i),i,a)}_fitInternal(e,n,r){return e?(delete(n=t.e(e,n)).padding,n.linear?this.easeTo(n,r):this.flyTo(n,r)):this}jumpTo(e,n){this.stop();let r=this._getTransformForUpdate(),i=!1,a=!1,o=!1;return`zoom`in e&&r.zoom!==+e.zoom&&(i=!0,r.zoom=+e.zoom),e.center!==void 0&&(r.center=t.N.convert(e.center)),`bearing`in e&&r.bearing!==+e.bearing&&(a=!0,r.bearing=+e.bearing),`pitch`in e&&r.pitch!==+e.pitch&&(o=!0,r.pitch=+e.pitch),e.padding==null||r.isPaddingEqual(e.padding)||(r.padding=e.padding),this._applyUpdatedTransform(r),this.fire(new t.k(`movestart`,n)).fire(new t.k(`move`,n)),i&&this.fire(new t.k(`zoomstart`,n)).fire(new t.k(`zoom`,n)).fire(new t.k(`zoomend`,n)),a&&this.fire(new t.k(`rotatestart`,n)).fire(new t.k(`rotate`,n)).fire(new t.k(`rotateend`,n)),o&&this.fire(new t.k(`pitchstart`,n)).fire(new t.k(`pitch`,n)).fire(new t.k(`pitchend`,n)),this.fire(new t.k(`moveend`,n))}calculateCameraOptionsFromTo(e,n,r,i=0){let a=t.Z.fromLngLat(e,n),o=t.Z.fromLngLat(r,i),s=o.x-a.x,c=o.y-a.y,l=o.z-a.z,u=Math.hypot(s,c,l);if(u===0)throw Error(`Can't calculate camera options with same From and To`);let d=Math.hypot(s,c),f=this.transform.scaleZoom(this.transform.cameraToCenterDistance/u/this.transform.tileSize),p=180*Math.atan2(s,-c)/Math.PI,m=180*Math.acos(d/u)/Math.PI;return m=l<0?90-m:90+m,{center:o.toLngLat(),zoom:f,pitch:m,bearing:p}}easeTo(e,n){this._stop(!1,e.easeId),((e=t.e({offset:[0,0],duration:500,easing:t.b9},e)).animate===!1||!e.essential&&a.prefersReducedMotion)&&(e.duration=0);let r=this._getTransformForUpdate(),i=r.zoom,o=r.bearing,s=r.pitch,c=r.padding,l=`bearing`in e?this._normalizeBearing(e.bearing,o):o,u=`pitch`in e?+e.pitch:s,d=`padding`in e?e.padding:r.padding,f=t.P.convert(e.offset),p=r.centerPoint.add(f),m=r.pointLocation(p),{center:h,zoom:g}=r.getConstrained(t.N.convert(e.center||m),e.zoom??i);this._normalizeCenter(h,r);let _=r.project(m),v=r.project(h).sub(_),y=r.zoomScale(g-i),b,x;e.around&&(b=t.N.convert(e.around),x=r.locationPoint(b));let S={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||g!==i,this._rotating=this._rotating||o!==l,this._pitching=this._pitching||u!==s,this._padding=!r.isPaddingEqual(d),this._easeId=e.easeId,this._prepareEase(n,e.noMoveStart,S),this.terrain&&this._prepareElevation(h),this._ease(a=>{if(this._zooming&&(r.zoom=t.y.number(i,g,a)),this._rotating&&(r.bearing=t.y.number(o,l,a)),this._pitching&&(r.pitch=t.y.number(s,u,a)),this._padding&&(r.interpolatePadding(c,d,a),p=r.centerPoint.add(f)),this.terrain&&!e.freezeElevation&&this._updateElevation(a),b)r.setLocationAtPoint(b,x);else{let e=r.zoomScale(r.zoom-i),t=(g>i?Math.min(2,y):Math.max(.5,y))**(1-a),n=r.unproject(_.add(v.mult(a*t)).mult(e));r.setLocationAtPoint(r.renderWorldCopies?n.wrap():n,p)}this._applyUpdatedTransform(r),this._fireMoveEvents(n)},t=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n,t)},e),this}_prepareEase(e,n,r={}){this._moving=!0,n||r.moving||this.fire(new t.k(`movestart`,e)),this._zooming&&!r.zooming&&this.fire(new t.k(`zoomstart`,e)),this._rotating&&!r.rotating&&this.fire(new t.k(`rotatestart`,e)),this._pitching&&!r.pitching&&this.fire(new t.k(`pitchstart`,e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&n!==this._elevationTarget){let t=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(t-(n-(t*e+this._elevationStart))/(1-e)),this._elevationTarget=n}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,e)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||=this.transform.clone(),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){let t=e.getCameraPosition(),n=this.terrain.getElevationForLngLatZoom(t.lngLat,e.zoom);if(t.altitude<n){let r=this.calculateCameraOptionsFromTo(t.lngLat,n,e.center,e.elevation);return{pitch:r.pitch,zoom:r.zoom}}return{}}_applyUpdatedTransform(e){let t=[];if(this.terrain&&t.push(e=>this._elevateCameraIfInsideTerrain(e)),this.transformCameraUpdate&&t.push(e=>this.transformCameraUpdate(e)),!t.length)return;let n=e.clone();for(let e of t){let t=n.clone(),{center:r,zoom:i,pitch:a,bearing:o,elevation:s}=e(t);r&&(t.center=r),i!==void 0&&(t.zoom=i),a!==void 0&&(t.pitch=a),o!==void 0&&(t.bearing=o),s!==void 0&&(t.elevation=s),n.apply(t)}this.transform.apply(n)}_fireMoveEvents(e){this.fire(new t.k(`move`,e)),this._zooming&&this.fire(new t.k(`zoom`,e)),this._rotating&&this.fire(new t.k(`rotate`,e)),this._pitching&&this.fire(new t.k(`pitch`,e))}_afterEase(e,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;let r=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,r&&this.fire(new t.k(`zoomend`,e)),i&&this.fire(new t.k(`rotateend`,e)),a&&this.fire(new t.k(`pitchend`,e)),this.fire(new t.k(`moveend`,e))}flyTo(e,n){if(!e.essential&&a.prefersReducedMotion){let r=t.M(e,[`center`,`zoom`,`bearing`,`pitch`,`around`]);return this.jumpTo(r,n)}this.stop(),e=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},e);let r=this._getTransformForUpdate(),i=r.zoom,o=r.bearing,s=r.pitch,c=r.padding,l=`bearing`in e?this._normalizeBearing(e.bearing,o):o,u=`pitch`in e?+e.pitch:s,d=`padding`in e?e.padding:r.padding,f=t.P.convert(e.offset),p=r.centerPoint.add(f),m=r.pointLocation(p),{center:h,zoom:g}=r.getConstrained(t.N.convert(e.center||m),e.zoom??i);this._normalizeCenter(h,r);let _=r.zoomScale(g-i),v=r.project(m),y=r.project(h).sub(v),b=e.curve,x=Math.max(r.width,r.height),S=x/_,C=y.mag();if(`minZoom`in e){let n=t.ac(Math.min(e.minZoom,i,g),r.minZoom,r.maxZoom),a=x/r.zoomScale(n-i);b=Math.sqrt(a/C*2)}let w=b*b;function T(e){let t=(S*S-x*x+(e?-1:1)*w*w*C*C)/(2*(e?S:x)*w*C);return Math.log(Math.sqrt(t*t+1)-t)}function E(e){return(Math.exp(e)-Math.exp(-e))/2}function D(e){return(Math.exp(e)+Math.exp(-e))/2}let O=T(!1),k=function(e){return D(O)/D(O+b*e)},A=function(e){return x*((D(O)*(E(t=O+b*e)/D(t))-E(O))/w)/C;var t},j=(T(!0)-O)/b;if(Math.abs(C)<1e-6||!isFinite(j)){if(Math.abs(x-S)<1e-6)return this.easeTo(e,n);let t=S<x?-1:1;j=Math.abs(Math.log(S/x))/b,A=()=>0,k=e=>Math.exp(t*b*e)}return e.duration=`duration`in e?+e.duration:1e3*j/(`screenSpeed`in e?+e.screenSpeed/b:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=o!==l,this._pitching=u!==s,this._padding=!r.isPaddingEqual(d),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(h),this._ease(a=>{let m=a*j,_=1/k(m);r.zoom=a===1?g:i+r.scaleZoom(_),this._rotating&&(r.bearing=t.y.number(o,l,a)),this._pitching&&(r.pitch=t.y.number(s,u,a)),this._padding&&(r.interpolatePadding(c,d,a),p=r.centerPoint.add(f)),this.terrain&&!e.freezeElevation&&this._updateElevation(a);let b=a===1?h:r.unproject(v.add(y.mult(A(m))).mult(_));r.setLocationAtPoint(r.renderWorldCopies?b.wrap():b,p),this._applyUpdatedTransform(r),this._fireMoveEvents(n)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){var n;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let e=this._onEaseEnd;delete this._onEaseEnd,e.call(this,t)}return e||(n=this.handlers)==null||n.stop(!1),this}_ease(e,t,n){n.animate===!1||n.duration===0?(e(1),t()):(this._easeStart=a.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,n){e=t.b3(e,-180,180);let r=Math.abs(e-n);return Math.abs(e-360-n)<r&&(e-=360),Math.abs(e+360-n)<r&&(e+=360),e}_normalizeCenter(e,t){if(!t.renderWorldCopies||t.lngRange)return;let n=e.lng-t.center.lng;e.lng+=n>180?-360:n<-180?360:0}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}let xi={compact:!0,customAttribution:`<a href="https://maplibre.org/" target="_blank">MapLibre</a>`};class Si{constructor(e=xi){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=e=>{!e||e.sourceDataType!==`metadata`&&e.sourceDataType!==`visibility`&&e.dataType!==`style`&&e.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=e}getDefaultPosition(){return`bottom-right`}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=o.create(`details`,`maplibregl-ctrl maplibregl-ctrl-attrib`),this._compactButton=o.create(`summary`,`maplibregl-ctrl-attrib-button`,this._container),this._compactButton.addEventListener(`click`,this._toggleAttribution),this._setElementTitle(this._compactButton,`ToggleAttribution`),this._innerContainer=o.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(){o.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(e,t){let n=this._map._getUIString(`AttributionControl.${t}`);e.title=n,e.setAttribute(`aria-label`,n)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(e=>typeof e==`string`?e:``)):typeof this.options.customAttribution==`string`&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}let t=this._map.style.sourceCaches;for(let n in t){let r=t[n];if(r.used||r.usedForTerrain){let t=r.getSource();t.attribution&&e.indexOf(t.attribution)<0&&e.push(t.attribution)}}e=e.filter(e=>String(e).trim()),e.sort((e,t)=>e.length-t.length),e=e.filter((t,n)=>{for(let r=n+1;r<e.length;r++)if(e[r].indexOf(t)>=0)return!1;return!0});let n=e.join(` | `);n!==this._attribHTML&&(this._attribHTML=n,e.length?(this._innerContainer.innerHTML=n,this._container.classList.remove(`maplibregl-attrib-empty`)):this._container.classList.add(`maplibregl-attrib-empty`),this._updateCompact(),this._editLink=null)}}class Ci{constructor(e={}){this._updateCompact=()=>{let e=this._container.children;if(e.length){let t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&t.classList.add(`maplibregl-compact`):t.classList.remove(`maplibregl-compact`)}},this.options=e}getDefaultPosition(){return`bottom-left`}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=o.create(`div`,`maplibregl-ctrl`);let t=o.create(`a`,`maplibregl-ctrl-logo`);return t.target=`_blank`,t.rel=`noopener nofollow`,t.href=`https://maplibre.org/`,t.setAttribute(`aria-label`,this._map._getUIString(`LogoControl.Title`)),t.setAttribute(`rel`,`noopener nofollow`),this._container.appendChild(t),this._container.style.display=`block`,this._map.on(`resize`,this._updateCompact),this._updateCompact(),this._container}onRemove(){o.remove(this._container),this._map.off(`resize`,this._updateCompact),this._map=void 0,this._compact=void 0}}class wi{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){let t=this._currentlyRunning,n=t?this._queue.concat(t):this._queue;for(let t of n)if(t.id===e)return void(t.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw Error(`Attempting to run(), but is already running.`);let t=this._currentlyRunning=this._queue;this._queue=[];for(let n of t)if(!n.cancelled&&(n.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ti=t.Y([{name:`a_pos3d`,type:`Int16`,components:3}]);class Ei extends t.E{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,n){this.sourceCache.update(e,n),this._renderableTilesKeys=[];let r={};for(let i of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))r[i.key]=!0,this._renderableTilesKeys.push(i.key),this._tiles[i.key]||(i.posMatrix=new Float64Array(16),t.aP(i.posMatrix,0,t.X,0,t.X,0,1),this._tiles[i.key]=new le(i,this.tileSize));for(let e in this._tiles)r[e]||delete this._tiles[e]}freeRtt(e){for(let t in this._tiles){let n=this._tiles[t];(!e||n.tileID.equals(e)||n.tileID.isChildOf(e)||e.isChildOf(n.tileID))&&(n.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){let n={};for(let r of this._renderableTilesKeys){let i=this._tiles[r].tileID;if(i.canonical.equals(e.canonical)){let i=e.clone();i.posMatrix=new Float64Array(16),t.aP(i.posMatrix,0,t.X,0,t.X,0,1),n[r]=i}else if(i.canonical.isChildOf(e.canonical)){let a=e.clone();a.posMatrix=new Float64Array(16);let o=i.canonical.z-e.canonical.z,s=i.canonical.x-(i.canonical.x>>o<<o),c=i.canonical.y-(i.canonical.y>>o<<o),l=t.X>>o;t.aP(a.posMatrix,0,l,0,l,0,1),t.J(a.posMatrix,a.posMatrix,[-s*l,-c*l,0]),n[r]=a}else if(e.canonical.isChildOf(i.canonical)){let a=e.clone();a.posMatrix=new Float64Array(16);let o=e.canonical.z-i.canonical.z,s=e.canonical.x-(e.canonical.x>>o<<o),c=e.canonical.y-(e.canonical.y>>o<<o),l=t.X>>o;t.aP(a.posMatrix,0,t.X,0,t.X,0,1),t.J(a.posMatrix,a.posMatrix,[s*l,c*l,0]),t.K(a.posMatrix,a.posMatrix,[1/2**o,1/2**o,0]),n[r]=a}}return n}getSourceTile(e,t){let n=this.sourceCache._source,r=e.overscaledZ-this.deltaZoom;if(r>n.maxzoom&&(r=n.maxzoom),r<n.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(r).key);let i=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!i||!i.dem)&&t)for(;r>=n.minzoom&&(!i||!i.dem);)i=this.sourceCache.getTileByID(e.scaledTo(r--).key);return i}tilesAfterTime(e=Date.now()){return Object.values(this._tiles).filter(t=>t.timeAdded>=e)}}class Di{constructor(e,t,n){this.painter=e,this.sourceCache=new Ei(t),this.options=n,this.exaggeration=typeof n.exaggeration==`number`?n.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,n,r,i=t.X){if(!(n>=0&&n<i&&r>=0&&r<i))return 0;let a=this.getTerrainData(e),o=a.tile?.dem;if(!o)return 0;let s=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e}([],[n/i*t.X,r/i*t.X],a.u_terrain_matrix),c=[s[0]*o.dim,s[1]*o.dim],l=Math.floor(c[0]),u=Math.floor(c[1]),d=c[0]-l,f=c[1]-u;return o.get(l,u)*(1-d)*(1-f)+o.get(l+1,u)*d*(1-f)+o.get(l,u+1)*(1-d)*f+o.get(l+1,u+1)*d*f}getElevationForLngLatZoom(e,n){if(!t.bb(n,e.wrap()))return 0;let{tileID:r,mercatorX:i,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(e,n);return this.getElevation(r,i%t.X,a%t.X,t.X)}getElevation(e,n,r,i=t.X){return this.getDEMElevation(e,n,r,i)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){let e=this.painter.context;this._emptyDepthTexture=new x(e,new t.R({width:1,height:1},new Uint8Array(4)),e.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new x(e,new t.R({width:1,height:1}),e.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=t.an([])}let n=this.sourceCache.getSourceTile(e,!0);if(n&&n.dem&&(!n.demTexture||n.needsTerrainPrepare)){let e=this.painter.context;n.demTexture=this.painter.getTileTexture(n.dem.stride),n.demTexture?n.demTexture.update(n.dem.getPixels(),{premultiply:!1}):n.demTexture=new x(e,n.dem.getPixels(),e.gl.RGBA,{premultiply:!1}),n.demTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),n.needsTerrainPrepare=!1}let r=n&&n+n.tileID.key+e.key;if(r&&!this._demMatrixCache[r]){let r=this.sourceCache.sourceCache._source.maxzoom,i=e.canonical.z-n.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=r?i=e.canonical.z-r:t.w(`cannot calculate elevation if elevation maxzoom > source.maxzoom`));let a=e.canonical.x-(e.canonical.x>>i<<i),o=e.canonical.y-(e.canonical.y>>i<<i),s=t.bc(new Float64Array(16),[1/(t.X<<i),1/(t.X<<i),0]);t.J(s,s,[a*t.X,o*t.X,0]),this._demMatrixCache[e.key]={matrix:s,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:n&&n.dem&&n.dem.dim||1,u_terrain_matrix:r?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:n&&n.dem&&n.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(n&&n.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:n}}getFramebuffer(e){let t=this.painter,n=t.width/devicePixelRatio,r=t.height/devicePixelRatio;return!this._fbo||this._fbo.width===n&&this._fbo.height===r||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new x(t.context,{width:n,height:r,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new x(t.context,{width:n,height:r,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=t.context.createFramebuffer(n,r,!0,!1),this._fbo.depthAttachment.set(t.context.createRenderbuffer(t.context.gl.DEPTH_COMPONENT16,n,r))),this._fbo.colorAttachment.set(e===`coords`?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let n=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let e=0,t=0;e<this._coordsTextureSize;e++)for(let r=0;r<this._coordsTextureSize;r++,t+=4)n[t+0]=255&r,n[t+1]=255&e,n[t+2]=r>>8<<4|e>>8,n[t+3]=0;let r=new x(e,new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),e.gl.RGBA,{premultiply:!1});return r.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=r,r}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);let n=new Uint8Array(4),r=this.painter.context,i=r.gl,a=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),o=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),s=Math.round(this.painter.height/devicePixelRatio);r.bindFramebuffer.set(this.getFramebuffer(`coords`).framebuffer),i.readPixels(a,s-o-1,1,1,i.RGBA,i.UNSIGNED_BYTE,n),r.bindFramebuffer.set(null);let c=n[0]+(n[2]>>4<<8),l=n[1]+((15&n[2])<<8),u=this.coordsIndex[255-n[3]],d=u&&this.sourceCache.getTileByID(u);if(!d)return null;let f=this._coordsTextureSize,p=(1<<d.tileID.canonical.z)*f;return new t.Z((d.tileID.canonical.x*f+c)/p+d.tileID.wrap,(d.tileID.canonical.y*f+l)/p,this.getElevation(d.tileID,c,l,f))}depthAtPoint(e){let t=new Uint8Array(4),n=this.painter.context,r=n.gl;return n.bindFramebuffer.set(this.getFramebuffer(`depth`).framebuffer),r.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,t),n.bindFramebuffer.set(null),(t[0]/16777216+t[1]/65536+t[2]/256+t[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let e=this.painter.context,n=new t.bd,r=new t.aY,i=this.meshSize,a=t.X/i,o=i*i;for(let e=0;e<=i;e++)for(let t=0;t<=i;t++)n.emplaceBack(t*a,e*a,0);for(let e=0;e<o;e+=i+1)for(let t=0;t<i;t++)r.emplaceBack(t+e,i+t+e+1,i+t+e+2),r.emplaceBack(t+e,i+t+e+2,t+e+1);let s=n.length,c=s+2*(i+1);for(let e of[0,1])for(let r=0;r<=i;r++)for(let i of[0,1])n.emplaceBack(r*a,e*t.X,i);for(let e=0;e<2*i;e+=2)r.emplaceBack(c+e,c+e+1,c+e+3),r.emplaceBack(c+e,c+e+3,c+e+2),r.emplaceBack(s+e,s+e+3,s+e+1),r.emplaceBack(s+e,s+e+2,s+e+3);let l=n.length,u=l+2*(i+1);for(let e of[0,1])for(let r=0;r<=i;r++)for(let i of[0,1])n.emplaceBack(e*t.X,r*a,i);for(let e=0;e<2*i;e+=2)r.emplaceBack(l+e,l+e+1,l+e+3),r.emplaceBack(l+e,l+e+3,l+e+2),r.emplaceBack(u+e,u+e+3,u+e+1),r.emplaceBack(u+e,u+e+2,u+e+3);return this._mesh=new mr(e.createVertexBuffer(n,Ti.members),e.createIndexBuffer(r),t.a0.simpleSegment(0,0,n.length,r.length)),this._mesh}getMeshFrameDelta(e){return 2*Math.PI*t.be/2**e/5}getMinTileElevationForLngLatZoom(e,t){let{tileID:n}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getMinMaxElevation(n).minElevation??0}getMinMaxElevation(e){let t=this.getTerrainData(e).tile,n={minElevation:null,maxElevation:null};return t&&t.dem&&(n.minElevation=t.dem.min*this.exaggeration,n.maxElevation=t.dem.max*this.exaggeration),n}_getOverscaledTileIDFromLngLatZoom(e,n){let r=t.Z.fromLngLat(e.wrap()),i=(1<<n)*t.X,a=r.x*i,o=r.y*i,s=Math.floor(a/t.X),c=Math.floor(o/t.X);return{tileID:new t.S(n,0,n,s,c),mercatorX:a,mercatorY:o}}}class Oi{constructor(e,t,n){this._context=e,this._size=t,this._tileSize=n,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){let t=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),n=new x(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return n.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),t.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),t.colorAttachment.set(n.texture),{id:e,fbo:t,texture:n,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(t=>e.id!==t),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(let e of this._recentlyUsed)if(!this._objects[e].inUse)return this._objects[e];if(this._objects.length>=this._size)throw Error(`No free RenderPool available, call freeAllObjects() required!`);let e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(let e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(e=>!e.inUse)===!1}}let ki={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Ai{constructor(e,t){this.painter=e,this.terrain=t,this.pool=new Oi(e.context,30,t.sourceCache.tileSize*t.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,t){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(n=>!e._layers[n].isHidden(t)),this._coordsDescendingInv={};for(let t in e.sourceCaches){this._coordsDescendingInv[t]={};let n=e.sourceCaches[t].getVisibleCoordinates();for(let e of n){let n=this.terrain.sourceCache.getTerrainCoords(e);for(let e in n)this._coordsDescendingInv[t][e]||(this._coordsDescendingInv[t][e]=[]),this._coordsDescendingInv[t][e].push(n[e])}}this._coordsDescendingInvStr={};for(let t of e._order){let n=e._layers[t],r=n.source;if(ki[n.type]&&!this._coordsDescendingInvStr[r]){this._coordsDescendingInvStr[r]={};for(let e in this._coordsDescendingInv[r])this._coordsDescendingInvStr[r][e]=this._coordsDescendingInv[r][e].map(e=>e.key).sort().join()}}for(let e of this._renderableTiles)for(let t in this._coordsDescendingInvStr){let n=this._coordsDescendingInvStr[t][e.tileID.key];n&&n!==e.rttCoords[t]&&(e.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;let n=e.type,r=this.painter,i=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(ki[n]&&(this._prevType&&ki[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(e.id),!i))return!0;if(ki[this._prevType]||ki[n]&&i){this._prevType=n;let e=this._stacks.length-1,i=this._stacks[e]||[];for(let n of this._renderableTiles){if(this.pool.isFull()&&(pr(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(n),n.rtt[e]){let t=this.pool.getObjectForId(n.rtt[e].id);if(t.stamp===n.rtt[e].stamp){this.pool.useObject(t);continue}}let a=this.pool.getOrCreateFreeObject();this.pool.useObject(a),this.pool.stampObject(a),n.rtt[e]={id:a.id,stamp:a.stamp},r.context.bindFramebuffer.set(a.fbo.framebuffer),r.context.clear({color:t.aM.transparent,stencil:0}),r.currentStencilSource=void 0;for(let e=0;e<i.length;e++){let t=r.style._layers[i[e]],o=t.source?this._coordsDescendingInv[t.source][n.tileID.key]:[n.tileID];r.context.viewport.set([0,0,a.fbo.width,a.fbo.height]),r._renderTileClippingMasks(t,o),r.renderLayer(r,r.style.sourceCaches[t.source],t,o),t.source&&(n.rttCoords[t.source]=this._coordsDescendingInvStr[t.source][n.tileID.key])}}return pr(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),ki[n]}return!1}}let ji={"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`},Mi=n,Ni={hash:!1,interactive:!0,bearingSnap:7,attributionControl:xi,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:t.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},Pi=e=>{e.touchstart=e.dragStart,e.touchmoveWindow=e.dragMove,e.touchend=e.dragEnd},Fi={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ii{constructor(e,n,r=!1){this.mousedown=e=>{this.startMouse(t.e({},e,{ctrlKey:!0,preventDefault:()=>e.preventDefault()}),o.mousePos(this.element,e)),o.addEventListener(window,`mousemove`,this.mousemove),o.addEventListener(window,`mouseup`,this.mouseup)},this.mousemove=e=>{this.moveMouse(e,o.mousePos(this.element,e))},this.mouseup=e=>{this.mouseRotate.dragEnd(e),this.mousePitch&&this.mousePitch.dragEnd(e),this.offTemp()},this.touchstart=e=>{e.targetTouches.length===1?(this._startPos=this._lastPos=o.touchPos(this.element,e.targetTouches)[0],this.startTouch(e,this._startPos),o.addEventListener(window,`touchmove`,this.touchmove,{passive:!1}),o.addEventListener(window,`touchend`,this.touchend)):this.reset()},this.touchmove=e=>{e.targetTouches.length===1?(this._lastPos=o.touchPos(this.element,e.targetTouches)[0],this.moveTouch(e,this._lastPos)):this.reset()},this.touchend=e=>{e.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 i=e.dragRotate._mouseRotate.getClickTolerance(),a=e.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=qr({clickTolerance:i,enable:!0}),this.touchRotate=(({enable:e,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>new Hr({clickTolerance:t,move:(e,t)=>({bearingDelta:(t.x-e.x)*n}),moveStateManager:new Gr,enable:e,assignEvents:Pi}))({clickTolerance:i,enable:!0}),this.map=e,r&&(this.mousePitch=Jr({clickTolerance:a,enable:!0}),this.touchPitch=(({enable:e,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>new Hr({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:new Gr,enable:e,assignEvents:Pi}))({clickTolerance:a,enable:!0})),o.addEventListener(n,`mousedown`,this.mousedown),o.addEventListener(n,`touchstart`,this.touchstart,{passive:!1}),o.addEventListener(n,`touchcancel`,this.reset)}startMouse(e,t){this.mouseRotate.dragStart(e,t),this.mousePitch&&this.mousePitch.dragStart(e,t),o.disableDrag()}startTouch(e,t){this.touchRotate.dragStart(e,t),this.touchPitch&&this.touchPitch.dragStart(e,t),o.disableDrag()}moveMouse(e,t){let n=this.map,{bearingDelta:r}=this.mouseRotate.dragMove(e,t)||{};if(r&&n.setBearing(n.getBearing()+r),this.mousePitch){let{pitchDelta:r}=this.mousePitch.dragMove(e,t)||{};r&&n.setPitch(n.getPitch()+r)}}moveTouch(e,t){let n=this.map,{bearingDelta:r}=this.touchRotate.dragMove(e,t)||{};if(r&&n.setBearing(n.getBearing()+r),this.touchPitch){let{pitchDelta:r}=this.touchPitch.dragMove(e,t)||{};r&&n.setPitch(n.getPitch()+r)}}off(){let e=this.element;o.removeEventListener(e,`mousedown`,this.mousedown),o.removeEventListener(e,`touchstart`,this.touchstart,{passive:!1}),o.removeEventListener(window,`touchmove`,this.touchmove,{passive:!1}),o.removeEventListener(window,`touchend`,this.touchend),o.removeEventListener(e,`touchcancel`,this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(window,`mousemove`,this.mousemove),o.removeEventListener(window,`mouseup`,this.mouseup),o.removeEventListener(window,`touchmove`,this.touchmove,{passive:!1}),o.removeEventListener(window,`touchend`,this.touchend)}}let Li;function Ri(e,n,r){let i=new t.N(e.lng,e.lat);if(e=new t.N(e.lng,e.lat),n){let i=new t.N(e.lng-360,e.lat),a=new t.N(e.lng+360,e.lat),o=r.locationPoint(e).distSqr(n);r.locationPoint(i).distSqr(n)<o?e=i:r.locationPoint(a).distSqr(n)<o&&(e=a)}for(;Math.abs(e.lng-r.center.lng)>180;){let t=r.locationPoint(e);if(t.x>=0&&t.y>=0&&t.x<=r.width&&t.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360}return e.lng!==i.lng&&r.locationPoint(e).y>r.height/2-r.getHorizon()?e:i}let zi={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 Bi(e,t,n){let r=e.classList;for(let e in zi)r.remove(`maplibregl-${n}-anchor-${e}`);r.add(`maplibregl-${n}-anchor-${t}`)}class Vi extends t.E{constructor(e){if(super(),this._onKeyPress=e=>{let t=e.code,n=e.charCode||e.keyCode;t!==`Space`&&t!==`Enter`&&n!==32&&n!==13||this.togglePopup()},this._onMapClick=e=>{let t=e.originalEvent.target,n=this._element;this._popup&&(t===n||n.contains(t))&&this.togglePopup()},this._update=e=>{if(!this._map)return;let t=this._map.loaded()&&!this._map.isMoving();(e?.type===`terrain`||e?.type===`render`&&!t)&&this._map.once(`render`,this._update),this._lngLat=this._map.transform.renderWorldCopies?Ri(this._lngLat,this._flatPos,this._map.transform):this._lngLat?.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 n=``;this._rotationAlignment===`viewport`||this._rotationAlignment===`auto`?n=`rotateZ(${this._rotation}deg)`:this._rotationAlignment===`map`&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let r=``;this._pitchAlignment===`viewport`||this._pitchAlignment===`auto`?r=`rotateX(0deg)`:this._pitchAlignment===`map`&&(r=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||e&&e.type!==`moveend`||(this._pos=this._pos.round()),o.setTransform(this._element,`${zi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${n}`),a.frameAsync(new AbortController).then(()=>{this._updateOpacity(e&&e.type===`moveend`)}).catch(()=>{})},this._onMove=e=>{if(!this._isDragging){let t=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=e.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.k(`dragstart`))),this.fire(new t.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 t.k(`dragend`)),this._state=`inactive`},this._addDragHandler=e=>{this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.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=e&&e.anchor||`center`,this._color=e&&e.color||`#3FB1CE`,this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state=`inactive`,this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||`auto`,this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!==`auto`?e.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(e?.opacity,e?.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=t.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create(`div`);let n=o.createNS(`http://www.w3.org/2000/svg`,`svg`);n.setAttributeNS(null,`display`,`block`),n.setAttributeNS(null,`height`,`41px`),n.setAttributeNS(null,`width`,`27px`),n.setAttributeNS(null,`viewBox`,`0 0 27 41`);let r=o.createNS(`http://www.w3.org/2000/svg`,`g`);r.setAttributeNS(null,`stroke`,`none`),r.setAttributeNS(null,`stroke-width`,`1`),r.setAttributeNS(null,`fill`,`none`),r.setAttributeNS(null,`fill-rule`,`evenodd`);let i=o.createNS(`http://www.w3.org/2000/svg`,`g`);i.setAttributeNS(null,`fill-rule`,`nonzero`);let a=o.createNS(`http://www.w3.org/2000/svg`,`g`);a.setAttributeNS(null,`transform`,`translate(3.0, 29.0)`),a.setAttributeNS(null,`fill`,`#000000`);for(let e of[{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`}]){let t=o.createNS(`http://www.w3.org/2000/svg`,`ellipse`);t.setAttributeNS(null,`opacity`,`0.04`),t.setAttributeNS(null,`cx`,`10.5`),t.setAttributeNS(null,`cy`,`5.80029008`),t.setAttributeNS(null,`rx`,e.rx),t.setAttributeNS(null,`ry`,e.ry),a.appendChild(t)}let s=o.createNS(`http://www.w3.org/2000/svg`,`g`);s.setAttributeNS(null,`fill`,this._color);let c=o.createNS(`http://www.w3.org/2000/svg`,`path`);c.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`),s.appendChild(c);let l=o.createNS(`http://www.w3.org/2000/svg`,`g`);l.setAttributeNS(null,`opacity`,`0.25`),l.setAttributeNS(null,`fill`,`#000000`);let u=o.createNS(`http://www.w3.org/2000/svg`,`path`);u.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`),l.appendChild(u);let d=o.createNS(`http://www.w3.org/2000/svg`,`g`);d.setAttributeNS(null,`transform`,`translate(6.0, 7.0)`),d.setAttributeNS(null,`fill`,`#FFFFFF`);let f=o.createNS(`http://www.w3.org/2000/svg`,`g`);f.setAttributeNS(null,`transform`,`translate(8.0, 8.0)`);let p=o.createNS(`http://www.w3.org/2000/svg`,`circle`);p.setAttributeNS(null,`fill`,`#000000`),p.setAttributeNS(null,`opacity`,`0.25`),p.setAttributeNS(null,`cx`,`5.5`),p.setAttributeNS(null,`cy`,`5.5`),p.setAttributeNS(null,`r`,`5.4999962`);let m=o.createNS(`http://www.w3.org/2000/svg`,`circle`);m.setAttributeNS(null,`fill`,`#FFFFFF`),m.setAttributeNS(null,`cx`,`5.5`),m.setAttributeNS(null,`cy`,`5.5`),m.setAttributeNS(null,`r`,`5.4999962`),f.appendChild(p),f.appendChild(m),i.appendChild(a),i.appendChild(s),i.appendChild(l),i.appendChild(d),i.appendChild(f),n.appendChild(i),n.setAttributeNS(null,`height`,41*this._scale+`px`),n.setAttributeNS(null,`width`,27*this._scale+`px`),this._element.appendChild(n),this._offset=t.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add(`maplibregl-marker`),this._element.addEventListener(`dragstart`,e=>{e.preventDefault()}),this._element.addEventListener(`mousedown`,e=>{e.preventDefault()}),Bi(this._element,this._anchor,`marker`),e&&e.className)for(let t of e.className.split(` `))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.setAttribute(`aria-label`,e._getUIString(`Marker.Title`)),e.getCanvasContainer().appendChild(this._element),e.on(`move`,this._update),e.on(`moveend`,this._update),e.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),o.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.N.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener(`keypress`,this._onKeyPress),this._originalTabIndex||this._element.removeAttribute(`tabindex`)),e){if(!(`offset`in e.options)){let t=13.5/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[t,-1*(24.6+t)],"bottom-right":[-t,-1*(24.6+t)],left:[13.5,-1*24.6],right:[-13.5,-1*24.6]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute(`tabindex`),this._originalTabIndex||this._element.setAttribute(`tabindex`,`0`),this._element.addEventListener(`keypress`,this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){let e=this._popup;return this._element.style.opacity===this._opacityWhenCovered||e&&(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map))),this}_updateOpacity(e=!1){var n,r;if(!((n=this._map)!=null&&n.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let i=this._map,a=i.terrain.depthAtPoint(this._pos),o=i.terrain.getElevationForLngLatZoom(this._lngLat,i.transform.tileZoom);if(i.transform.lngLatToCameraDepth(this._lngLat,o)-a<.006)return void(this._element.style.opacity=this._opacity);let s=-this._offset.y/i.transform._pixelPerMeter,c=Math.sin(i.getPitch()*Math.PI/180)*s,l=i.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),u=i.transform.lngLatToCameraDepth(this._lngLat,o+c)-l>.006;(r=this._popup)!=null&&r.isOpen()&&u&&this._popup.remove(),this._element.style.opacity=u?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=t.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(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(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||`auto`,this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!==`auto`?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return e===void 0&&t===void 0&&(this._opacity=`1`,this._opacityWhenCovered=`0.2`),e!==void 0&&(this._opacity=e),t!==void 0&&(this._opacityWhenCovered=t),this._map&&this._updateOpacity(!0),this}}let Hi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Ui=0,Wi=!1,Gi={maxWidth:100,unit:`metric`};function Ki(e,t,n){let r=n&&n.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),o=e.unproject([r,i]),s=a.distanceTo(o);if(n&&n.unit===`imperial`){let n=3.2808*s;n>5280?qi(t,r,n/5280,e._getUIString(`ScaleControl.Miles`)):qi(t,r,n,e._getUIString(`ScaleControl.Feet`))}else n&&n.unit===`nautical`?qi(t,r,s/1852,e._getUIString(`ScaleControl.NauticalMiles`)):s>=1e3?qi(t,r,s/1e3,e._getUIString(`ScaleControl.Kilometers`)):qi(t,r,s,e._getUIString(`ScaleControl.Meters`))}function qi(e,t,n,r){let i=function(e){let t=10**(`${Math.floor(e)}`.length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:n>=1?1:function(e){let t=10**Math.ceil(-Math.log(e)/Math.LN10);return Math.round(e*t)/t}(n),t*n}(n);e.style.width=i/n*t+`px`,e.innerHTML=`${i}&nbsp;${r}`}let Ji={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:``,maxWidth:`240px`,subpixelPositioning:!1},Yi=[`a[href]`,`[tabindex]:not([tabindex='-1'])`,`[contenteditable]:not([contenteditable='false'])`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`].join(`, `);function Xi(e){if(e){if(typeof e==`number`){let n=Math.round(Math.abs(e)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,e),"top-left":new t.P(n,n),"top-right":new t.P(-n,n),bottom:new t.P(0,-e),"bottom-left":new t.P(n,-n),"bottom-right":new t.P(-n,-n),left:new t.P(e,0),right:new t.P(-e,0)}}if(e instanceof t.P||Array.isArray(e)){let n=t.P.convert(e);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:t.P.convert(e.center||[0,0]),top:t.P.convert(e.top||[0,0]),"top-left":t.P.convert(e[`top-left`]||[0,0]),"top-right":t.P.convert(e[`top-right`]||[0,0]),bottom:t.P.convert(e.bottom||[0,0]),"bottom-left":t.P.convert(e[`bottom-left`]||[0,0]),"bottom-right":t.P.convert(e[`bottom-right`]||[0,0]),left:t.P.convert(e.left||[0,0]),right:t.P.convert(e.right||[0,0])}}return Xi(new t.P(0,0))}let Zi=n;e.AJAXError=t.bh,e.Evented=t.E,e.LngLat=t.N,e.MercatorCoordinate=t.Z,e.Point=t.P,e.addProtocol=t.bi,e.config=t.a,e.removeProtocol=t.bj,e.AttributionControl=Si,e.BoxZoomHandler=Lr,e.CanvasSource=ne,e.CooperativeGesturesHandler=hi,e.DoubleClickZoomHandler=li,e.DragPanHandler=fi,e.DragRotateHandler=pi,e.EdgeInsets=vr,e.FullscreenControl=class extends t.E{constructor(e={}){super(),this._onFullscreenChange=()=>{var e;let t=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;(e=t?.shadowRoot)!=null&&e.fullscreenElement;)t=t.shadowRoot.fullscreenElement;t===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,e&&e.container&&(e.container instanceof HTMLElement?this._container=e.container:t.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(e){return this._map=e,this._container||=this._map.getContainer(),this._controlContainer=o.create(`div`,`maplibregl-ctrl maplibregl-ctrl-group`),this._setupUI(),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let e=this._fullscreenButton=o.create(`button`,`maplibregl-ctrl-fullscreen`,this._controlContainer);o.create(`span`,`maplibregl-ctrl-icon`,e).setAttribute(`aria-hidden`,`true`),e.type=`button`,this._updateTitle(),this._fullscreenButton.addEventListener(`click`,this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let e=this._getTitle();this._fullscreenButton.setAttribute(`aria-label`,e),this._fullscreenButton.title=e}_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 t.k(`fullscreenstart`)),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.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()}},e.GeoJSONSource=Z,e.GeolocateControl=class extends t.E{constructor(e){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.k(`outofmaxbounds`,e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,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 Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!==`OFF`&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!==`ACTIVE_LOCK`||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove(`maplibregl-user-location-dot-stale`),this.fire(new t.k(`geolocate`,e)),this._finish()}},this._updateCamera=e=>{let n=new t.N(e.coords.longitude,e.coords.latitude),r=e.coords.accuracy,i=this._map.getBearing(),a=t.e({bearing:i},this.options.fitBoundsOptions),o=K.fromLngLat(n,r);this._map.fitBounds(o,a,{geolocateSource:!0})},this._updateMarker=e=>{if(e){let n=new t.N(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=e.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=e=>{if(this._map){if(this.options.trackUserLocation)if(e.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 e=this._map._getUIString(`GeolocateControl.LocationNotAvailable`);this._geolocateButton.title=e,this._geolocateButton.setAttribute(`aria-label`,e),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&Wi)return;this._setErrorState()}this._watchState!==`OFF`&&this.options.showUserLocation&&this._dotElement.classList.add(`maplibregl-user-location-dot-stale`),this.fire(new t.k(`error`,e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener(`contextmenu`,e=>e.preventDefault()),this._geolocateButton=o.create(`button`,`maplibregl-ctrl-geolocate`,this._container),o.create(`span`,`maplibregl-ctrl-icon`,this._geolocateButton).setAttribute(`aria-hidden`,`true`),this._geolocateButton.type=`button`,this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){t.w(`Geolocation support is not available so the GeolocateControl will be disabled.`);let e=this._map._getUIString(`GeolocateControl.LocationNotAvailable`);this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute(`aria-label`,e)}else{let e=this._map._getUIString(`GeolocateControl.FindMyLocation`);this._geolocateButton.disabled=!1,this._geolocateButton.title=e,this._geolocateButton.setAttribute(`aria-label`,e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute(`aria-pressed`,`false`),this._watchState=`OFF`),this.options.showUserLocation&&(this._dotElement=o.create(`div`,`maplibregl-user-location-dot`),this._userLocationDotMarker=new Vi({element:this._dotElement}),this._circleElement=o.create(`div`,`maplibregl-user-location-accuracy-circle`),this._accuracyCircleMarker=new Vi({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`,e=>{e.geolocateSource||this._watchState!==`ACTIVE_LOCK`||e.originalEvent&&e.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 t.k(`trackuserlocationend`)),this.fire(new t.k(`userlocationlostfocus`)))})}},this.options=t.e({},Hi,e)}onAdd(e){return this._map=e,this._container=o.create(`div`,`maplibregl-ctrl maplibregl-ctrl-group`),this._setupUI(),function(){return t._(this,arguments,void 0,function*(e=!1){if(Li!==void 0&&!e)return Li;if(window.navigator.permissions===void 0)return Li=!!window.navigator.geolocation,Li;try{Li=(yield window.navigator.permissions.query({name:`geolocation`})).state!==`denied`}catch{Li=!!window.navigator.geolocation}return Li})}().then(e=>this._finishSetupUI(e)),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(),o.remove(this._container),this._map.off(`zoom`,this._onZoom),this._map=void 0,Ui=0,Wi=!1}_isOutOfMapMaxBounds(e){let t=this._map.getMaxBounds(),n=e.coords;return t&&(n.longitude<t.getWest()||n.longitude>t.getEast()||n.latitude<t.getSouth()||n.latitude>t.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 Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let e=this._map.getBounds(),t=e.getSouthEast(),n=e.getNorthEast(),r=t.distanceTo(n),i=Math.ceil(this._accuracy/(r/this._map._container.clientHeight)*2);this._circleElement.style.width=`${i}px`,this._circleElement.style.height=`${i}px`}trigger(){if(!this._setup)return t.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 t.k(`trackuserlocationstart`));break;case`WAITING_ACTIVE`:case`ACTIVE_LOCK`:case`ACTIVE_ERROR`:case`BACKGROUND_ERROR`:Ui--,Wi=!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 t.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 t.k(`trackuserlocationstart`)),this.fire(new t.k(`userlocationfocus`));break;default:throw 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 Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState===`OFF`&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let e;this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-waiting`),this._geolocateButton.setAttribute(`aria-pressed`,`true`),Ui++,Ui>1?(e={maximumAge:6e5,timeout:0},Wi=!0):(e=this.options.positionOptions,Wi=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}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)}},e.Hash=Sr,e.ImageSource=ee,e.KeyboardHandler=ai,e.LngLatBounds=K,e.LogoControl=Ci,e.Map=class extends bi{constructor(e){t.bf.mark(t.bg.create);let n=Object.assign(Object.assign({},Ni),e);if(n.minZoom!=null&&n.maxZoom!=null&&n.minZoom>n.maxZoom)throw Error(`maxZoom must be greater than or equal to minZoom`);if(n.minPitch!=null&&n.maxPitch!=null&&n.minPitch>n.maxPitch)throw Error(`maxPitch must be greater than or equal to minPitch`);if(n.minPitch!=null&&n.minPitch<0)throw Error(`minPitch must be greater than or equal to 0`);if(n.maxPitch!=null&&n.maxPitch>85)throw Error(`maxPitch must be less than or equal to 85`);if(super(new br(n.minZoom,n.maxZoom,n.minPitch,n.maxPitch,n.renderWorldCopies),{bearingSnap:n.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new wi,this._controls=[],this._mapId=t.a4(),this._contextLost=e=>{e.preventDefault(),this._frameRequest&&=(this._frameRequest.abort(),null),this.fire(new t.k(`webglcontextlost`,{originalEvent:e}))},this._contextRestored=e=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k(`webglcontextrestored`,{originalEvent:e}))},this._onMapScroll=e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=n.interactive,this._maxTileCacheSize=n.maxTileCacheSize,this._maxTileCacheZoomLevels=n.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=n.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=n.preserveDrawingBuffer===!0,this._antialias=n.antialias===!0,this._trackResize=n.trackResize===!0,this._bearingSnap=n.bearingSnap,this._refreshExpiredTiles=n.refreshExpiredTiles===!0,this._fadeDuration=n.fadeDuration,this._crossSourceCollisions=n.crossSourceCollisions===!0,this._collectResourceTiming=n.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},ji),n.locale),this._clickTolerance=n.clickTolerance,this._overridePixelRatio=n.pixelRatio,this._maxCanvasSize=n.maxCanvasSize,this.transformCameraUpdate=n.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=n.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=p.addThrottleControl(()=>this.isMoving()),this._requestManager=new m(n.transformRequest),typeof n.container==`string`){if(this._container=document.getElementById(n.container),!this._container)throw Error(`Container '${n.container}' not found.`)}else{if(!(n.container instanceof HTMLElement))throw Error(`Invalid type: 'container' must be a String or HTMLElement.`);this._container=n.container}if(n.maxBounds&&this.setMaxBounds(n.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 e=!1,t=xr(e=>{this._trackResize&&!this._removed&&(this.resize(e),this.redraw())},50);this._resizeObserver=new ResizeObserver(n=>{e?t(n):e=!0}),this._resizeObserver.observe(this._container)}this.handlers=new yi(this,n),this._hash=n.hash&&new Sr(typeof n.hash==`string`&&n.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:n.center,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch}),n.bounds&&(this.resize(),this.fitBounds(n.bounds,t.e({},n.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=n.localIdeographFontFamily,this._validateStyle=n.validateStyle,n.style&&this.setStyle(n.style,{localIdeographFontFamily:n.localIdeographFontFamily}),n.attributionControl&&this.addControl(new Si(typeof n.attributionControl==`boolean`?void 0:n.attributionControl)),n.maplibreLogo&&this.addControl(new Ci,n.logoPosition),this.on(`style.load`,()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on(`data`,e=>{this._update(e.dataType===`style`),this.fire(new t.k(`${e.dataType}data`,e))}),this.on(`dataloading`,e=>{this.fire(new t.k(`${e.dataType}dataloading`,e))}),this.on(`dataabort`,e=>{this.fire(new t.k(`sourcedataabort`,e))})}_getMapId(){return this._mapId}addControl(e,n){if(n===void 0&&(n=e.getDefaultPosition?e.getDefaultPosition():`top-right`),!e||!e.onAdd)return this.fire(new t.j(Error(`Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.`)));let r=e.onAdd(this);this._controls.push(e);let i=this._controlPositions[n];return n.indexOf(`bottom`)===-1?i.appendChild(r):i.insertBefore(r,i.firstChild),this}removeControl(e){if(!e||!e.onRemove)return this.fire(new t.j(Error(`Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.`)));let n=this._controls.indexOf(e);return n>-1&&this._controls.splice(n,1),e.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}calculateCameraOptionsFromTo(e,t,n,r){return r==null&&this.terrain&&(r=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(e,t,n,r)}resize(e){var n;let r=this._containerDimensions(),i=r[0],a=r[1],o=this._getClampedPixelRatio(i,a);if(this._resizeCanvas(i,a,o),this.painter.resize(i,a,o),this.painter.overLimit()){let e=this.painter.context.gl;this._maxCanvasSize=[e.drawingBufferWidth,e.drawingBufferHeight];let t=this._getClampedPixelRatio(i,a);this._resizeCanvas(i,a,t),this.painter.resize(i,a,t)}this.transform.resize(i,a),(n=this._requestedCameraState)==null||n.resize(i,a);let s=!this._moving;return s&&(this.stop(),this.fire(new t.k(`movestart`,e)).fire(new t.k(`move`,e))),this.fire(new t.k(`resize`,e)),s&&this.fire(new t.k(`moveend`,e)),this}_getClampedPixelRatio(e,t){let{0:n,1:r}=this._maxCanvasSize,i=this.getPixelRatio(),a=e*i,o=t*i;return Math.min(a>n?n/a:1,o>r?r/o:1)*i}getPixelRatio(){return this._overridePixelRatio??devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){return this.transform.setMaxBounds(K.convert(e)),this._update()}setMinZoom(e){if((e??=-2)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw Error(`minZoom must be between -2 and the current maxZoom, inclusive`)}getMinZoom(){return this.transform.minZoom}setMaxZoom(e){if((e??=22)>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw Error(`maxZoom must be greater than the current minZoom`)}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e??=0)<0)throw Error(`minPitch must be greater than or equal to 0`);if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()<e&&this.setPitch(e),this;throw Error(`minPitch must be between 0 and the current maxPitch, inclusive`)}getMinPitch(){return this.transform.minPitch}setMaxPitch(e){if((e??=60)>85)throw Error(`maxPitch must be less than or equal to 85`);if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw Error(`maxPitch must be greater than the current minPitch`)}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this._update()}project(e){return this.transform.locationPoint(t.N.convert(e),this.style&&this.terrain)}unproject(e){return this.transform.pointLocation(t.P.convert(e),this.terrain)}isMoving(){return this._moving||this.handlers?.isMoving()}isZooming(){return this._zooming||this.handlers?.isZooming()}isRotating(){return this._rotating||this.handlers?.isRotating()}_createDelegatedListener(e,t,n){if(e===`mouseenter`||e===`mouseover`){let r=!1;return{layers:t,listener:n,delegates:{mousemove:i=>{let a=t.filter(e=>this.getLayer(e)),o=a.length===0?[]:this.queryRenderedFeatures(i.point,{layers:a});o.length?r||(r=!0,n.call(this,new jr(e,this,i.originalEvent,{features:o}))):r=!1},mouseout:()=>{r=!1}}}}if(e===`mouseleave`||e===`mouseout`){let r=!1;return{layers:t,listener:n,delegates:{mousemove:i=>{let a=t.filter(e=>this.getLayer(e));(a.length===0?[]:this.queryRenderedFeatures(i.point,{layers:a})).length?r=!0:r&&(r=!1,n.call(this,new jr(e,this,i.originalEvent)))},mouseout:t=>{r&&(r=!1,n.call(this,new jr(e,this,t.originalEvent)))}}}}{let r=e=>{let r=t.filter(e=>this.getLayer(e)),i=r.length===0?[]:this.queryRenderedFeatures(e.point,{layers:r});i.length&&(e.features=i,n.call(this,e),delete e.features)};return{layers:t,listener:n,delegates:{[e]:r}}}}_saveDelegatedListener(e,t){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(t)}_removeDelegatedListener(e,t,n){if(!this._delegatedListeners||!this._delegatedListeners[e])return;let r=this._delegatedListeners[e];for(let e=0;e<r.length;e++){let i=r[e];if(i.listener===n&&i.layers.length===t.length&&i.layers.every(e=>t.includes(e))){for(let e in i.delegates)this.off(e,i.delegates[e]);r.splice(e,1);return}}}on(e,t,n){if(n===void 0)return super.on(e,t);let r=this._createDelegatedListener(e,typeof t==`string`?[t]:t,n);this._saveDelegatedListener(e,r);for(let e in r.delegates)this.on(e,r.delegates[e]);return this}once(e,t,n){if(n===void 0)return super.once(e,t);let r=typeof t==`string`?[t]:t,i=this._createDelegatedListener(e,r,n);for(let t in i.delegates){let a=i.delegates[t];i.delegates[t]=(...t)=>{this._removeDelegatedListener(e,r,n),a(...t)}}this._saveDelegatedListener(e,i);for(let e in i.delegates)this.once(e,i.delegates[e]);return this}off(e,t,n){return n===void 0?super.off(e,t):(this._removeDelegatedListener(e,typeof t==`string`?[t]:t,n),this)}queryRenderedFeatures(e,n){if(!this.style)return[];let r,i=e instanceof t.P||Array.isArray(e),a=i?e:[[0,0],[this.transform.width,this.transform.height]];if(n=n||(i?{}:e)||{},a instanceof t.P||typeof a[0]==`number`)r=[t.P.convert(a)];else{let e=t.P.convert(a[0]),n=t.P.convert(a[1]);r=[e,new t.P(n.x,e.y),n,new t.P(e.x,n.y),e]}return this.style.queryRenderedFeatures(r,n,this.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,n){return(n=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},n)).diff!==!1&&n.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._updateStyle(e,n))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let t=this._locale[e];if(t==null)throw Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once(`style.load`,()=>this._updateStyle(e,t));let n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e?(this.style=new lt(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof e==`string`?this.style.loadURL(e,t,n):this.style.loadJSON(e,t,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new lt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,n){if(typeof e==`string`){let r=this._requestManager.transformRequest(e,`Style`);t.h(r,new AbortController).then(e=>{this._updateDiff(e.data,n)}).catch(e=>{e&&this.fire(new t.j(e))})}else typeof e==`object`&&this._updateDiff(e,n)}_updateDiff(e,n){try{this.style.setState(e,n)&&this._update(!0)}catch(r){t.w(`Unable to perform style diff: ${r.message||r.error||r}. Rebuilding the style from scratch.`),this._updateStyle(e,n)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w(`There is no style added to the map.`)}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){let n=this.style&&this.style.sourceCaches[e];if(n!==void 0)return n.loaded();this.fire(new t.j(Error(`There is no source with ID '${e}'`)))}setTerrain(e){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off(`data`,this._terrainDataCallback),e){let n=this.style.sourceCaches[e.source];if(!n)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);this.terrain===null&&n.reload();for(let n in this.style._layers){let r=this.style._layers[n];r.type===`hillshade`&&r.source===e.source&&t.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 Di(this.painter,n,e),this.painter.renderToTexture=new Ai(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=t=>{t.dataType===`style`?this.terrain.sourceCache.freeRtt():t.dataType===`source`&&t.tile&&(t.sourceId!==e.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(t.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 t.k(`terrain`,{terrain:e})),this}getTerrain(){return this.terrain?.options??null}areTilesLoaded(){let e=this.style&&this.style.sourceCaches;for(let t in e){let n=e[t]._tiles;for(let e in n){let t=n[e];if(t.state!==`loaded`&&t.state!==`errored`)return!1}}return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style.getSource(e)}addImage(e,n,r={}){let{pixelRatio:i=1,sdf:o=!1,stretchX:s,stretchY:c,content:l,textFitWidth:u,textFitHeight:d}=r;if(this._lazyInitEmptyStyle(),!(n instanceof HTMLImageElement||t.b(n))){if(n.width===void 0||n.height===void 0)return this.fire(new t.j(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:r,height:a,data:f}=n,p=n;return this.style.addImage(e,{data:new t.R({width:r,height:a},new Uint8Array(f)),pixelRatio:i,stretchX:s,stretchY:c,content:l,textFitWidth:u,textFitHeight:d,sdf:o,version:0,userImage:p}),p.onAdd&&p.onAdd(this,e),this}}{let{width:r,height:f,data:p}=a.getImageData(n);this.style.addImage(e,{data:new t.R({width:r,height:f},p),pixelRatio:i,stretchX:s,stretchY:c,content:l,textFitWidth:u,textFitHeight:d,sdf:o,version:0})}}updateImage(e,n){let r=this.style.getImage(e);if(!r)return this.fire(new t.j(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:i,height:o,data:s}=n instanceof HTMLImageElement||t.b(n)?a.getImageData(n):n;if(i===void 0||o===void 0)return this.fire(new t.j(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(i!==r.data.width||o!==r.data.height)return this.fire(new t.j(Error(`The width and height of the updated image must be that same as the previous version of the image`)));let c=!(n instanceof HTMLImageElement||t.b(n));return r.data.replace(s,c),this.style.updateImage(e,r),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new t.j(Error(`Missing required image id`))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(e){return p.getImage(this._requestManager.transformRequest(e,`Image`),new AbortController)}listImages(){return this.style.listImages()}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style.getLayer(e)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(e,t,n){return this.style.setLayerZoomRange(e,t,n),this._update(!0)}setFilter(e,t,n={}){return this.style.setFilter(e,t,n),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,n,r={}){return this.style.setPaintProperty(e,t,n,r),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,n,r={}){return this.style.setLayoutProperty(e,t,n,r),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(e,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,n,e=>{e||this._update(!0)}),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,e=>{e||this._update(!0)}),this}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(e){return this._lazyInitEmptyStyle(),this.style.setSky(e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_setupContainer(){let e=this._container;e.classList.add(`maplibregl-map`);let t=this._canvasContainer=o.create(`div`,`maplibregl-canvas-container`,e);this._interactive&&t.classList.add(`maplibregl-interactive`),this._canvas=o.create(`canvas`,`maplibregl-canvas`,t),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 n=this._containerDimensions(),r=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],r);let i=this._controlContainer=o.create(`div`,`maplibregl-control-container`,e),a=this._controlPositions={};[`top-left`,`top-right`,`bottom-left`,`bottom-right`].forEach(e=>{a[e]=o.create(`div`,`maplibregl-ctrl-${e} `,i)}),this._container.addEventListener(`scroll`,this._onMapScroll,!1)}_resizeCanvas(e,t,n){this._canvas.width=Math.floor(n*e),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let e={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},t=null;this._canvas.addEventListener(`webglcontextcreationerror`,n=>{t={requestedAttributes:e},n&&(t.statusMessage=n.statusMessage,t.type=n.type)},{once:!0});let n=this._canvas.getContext(`webgl2`,e)||this._canvas.getContext(`webgl`,e);if(!n){let e=`Failed to initialize WebGL`;throw t?(t.message=e,Error(JSON.stringify(t))):Error(e)}this.painter=new hr(n,this.transform),s.testSupport(n)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){let n=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let r=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let e=this.transform.zoom,i=a.now();this.style.zoomHistory.update(e,i);let o=new t.z(e,{now:i,fadeDuration:n,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),s=o.crossFadingFactor();s===1&&s===this._crossFadingFactor||(r=!0,this._crossFadingFactor=s),this.style.update(o)}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,n,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:n,showPadding:this.showPadding}),this.fire(new t.k(`render`)),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bf.mark(t.bg.load),this.fire(new t.k(`load`))),this.style&&(this.style.hasTransitions()||r)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let i=this._sourcesDirty||this._styleDirty||this._placementDirty;return i||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k(`idle`)),!this._loaded||this._fullyLoaded||i||(this._fullyLoaded=!0,t.bf.mark(t.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&=(this._frameRequest.abort(),null),this._render(0)),this}remove(){var e;this._hash&&this._hash.remove();for(let e of this._controls)e.onRemove(this);this._controls=[],this._frameRequest&&=(this._frameRequest.abort(),null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<`u`&&removeEventListener(`online`,this._onWindowOnline,!1),p.removeThrottleControl(this._imageQueueHandle),(e=this._resizeObserver)==null||e.disconnect();let n=this.painter.context.gl.getExtension(`WEBGL_lose_context`);n!=null&&n.loseContext&&n.loseContext(),this._canvas.removeEventListener(`webglcontextrestored`,this._contextRestored,!1),this._canvas.removeEventListener(`webglcontextlost`,this._contextLost,!1),o.remove(this._canvasContainer),o.remove(this._controlContainer),this._container.classList.remove(`maplibregl-map`),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k(`remove`))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then(e=>{t.bf.frame(e),this._frameRequest=null,this._render(e)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return Mi}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=jr,e.MapTouchEvent=Mr,e.MapWheelEvent=Nr,e.Marker=Vi,e.NavigationControl=class{constructor(e){this._updateZoomButtons=()=>{let e=this._map.getZoom(),t=e===this._map.getMaxZoom(),n=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute(`aria-disabled`,t.toString()),this._zoomOutButton.setAttribute(`aria-disabled`,n.toString())},this._rotateCompassArrow=()=>{let e=this.options.visualizePitch?`scale(${1/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=e},this._setButtonTitle=(e,t)=>{let n=this._map._getUIString(`NavigationControl.${t}`);e.title=n,e.setAttribute(`aria-label`,n)},this.options=t.e({},Fi,e),this._container=o.create(`div`,`maplibregl-ctrl maplibregl-ctrl-group`),this._container.addEventListener(`contextmenu`,e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton(`maplibregl-ctrl-zoom-in`,e=>this._map.zoomIn({},{originalEvent:e})),o.create(`span`,`maplibregl-ctrl-icon`,this._zoomInButton).setAttribute(`aria-hidden`,`true`),this._zoomOutButton=this._createButton(`maplibregl-ctrl-zoom-out`,e=>this._map.zoomOut({},{originalEvent:e})),o.create(`span`,`maplibregl-ctrl-icon`,this._zoomOutButton).setAttribute(`aria-hidden`,`true`)),this.options.showCompass&&(this._compass=this._createButton(`maplibregl-ctrl-compass`,e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=o.create(`span`,`maplibregl-ctrl-icon`,this._compass),this._compassIcon.setAttribute(`aria-hidden`,`true`))}onAdd(e){return this._map=e,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 Ii(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){o.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(e,t){let n=o.create(`button`,e,this._container);return n.type=`button`,n.addEventListener(`click`,t),n}},e.Popup=class extends t.E{constructor(e){super(),this.remove=()=>(this._content&&o.remove(this._content),this._container&&(o.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 t.k(`close`))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=o.create(`div`,`maplibregl-popup`,this._map.getContainer()),this._tip=o.create(`div`,`maplibregl-popup-tip`,this._container),this._container.appendChild(this._content),this.options.className)for(let e of this.options.className.split(` `))this._container.classList.add(e);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?Ri(this._lngLat,this._flatPos,this._map.transform):this._lngLat?.wrap(),this._trackPointer&&!e)return;let t=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationPoint(this._lngLat));let n=this.options.anchor,r=Xi(this.options.offset);if(!n){let e=this._container.offsetWidth,i=this._container.offsetHeight,a;a=t.y+r.bottom.y<i?[`top`]:t.y>this._map.transform.height-i?[`bottom`]:[],t.x<e/2?a.push(`left`):t.x>this._map.transform.width-e/2&&a.push(`right`),n=a.length===0?`bottom`:a.join(`-`)}let i=t.add(r[n]);this.options.subpixelPositioning||(i=i.round()),o.setTransform(this._container,`${zi[n]} translate(${i.x}px,${i.y}px)`),Bi(this._container,n,`popup`)},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(Ji),e)}addTo(e){return this._map&&this.remove(),this._map=e,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 t.k(`open`)),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.N.convert(e),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(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){let t=document.createDocumentFragment(),n=document.createElement(`body`),r;for(n.innerHTML=e;r=n.firstChild,r;)t.appendChild(r);return this.setDOMContent(t)}getMaxWidth(){return this._container?.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=o.create(`div`,`maplibregl-popup-content`,this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){return this._container&&this._container.classList.add(e),this}removeClassName(e){return this._container&&this._container.classList.remove(e),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}setSubpixelPositioning(e){this.options.subpixelPositioning=e}_createCloseButton(){this.options.closeButton&&(this._closeButton=o.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 e=this._container.querySelector(Yi);e&&e.focus()}},e.RasterDEMTileSource=X,e.RasterTileSource=Y,e.ScaleControl=class{constructor(e){this._onMove=()=>{Ki(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,Ki(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Gi),e)}getDefaultPosition(){return`bottom-left`}onAdd(e){return this._map=e,this._container=o.create(`div`,`maplibregl-ctrl maplibregl-ctrl-scale`,e.getContainer()),this._map.on(`move`,this._onMove),this._onMove(),this._container}onRemove(){o.remove(this._container),this._map.off(`move`,this._onMove),this._map=void 0}},e.ScrollZoomHandler=ci,e.Style=lt,e.TerrainControl=class{constructor(e){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=e}onAdd(e){return this._map=e,this._container=o.create(`div`,`maplibregl-ctrl maplibregl-ctrl-group`),this._terrainButton=o.create(`button`,`maplibregl-ctrl-terrain`,this._container),o.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(){o.remove(this._container),this._map.off(`terrain`,this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=ri,e.TwoFingersTouchRotateHandler=ti,e.TwoFingersTouchZoomHandler=$r,e.TwoFingersTouchZoomRotateHandler=mi,e.VectorTileSource=J,e.VideoSource=te,e.addSourceType=(e,n)=>t._(void 0,void 0,void 0,function*(){if(ie(e))throw Error(`A source type called "${e}" already exists.`);((e,t)=>{re[e]=t})(e,n)}),e.clearPrewarmedResources=function(){let e=L;e&&(e.isPreloaded()&&e.numActive()===1?(e.release(P),L=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()`))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return ce().getRTLTextPluginStatus()},e.getVersion=function(){return Zi},e.getWorkerCount=function(){return F.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(e){return V().broadcast(`IS`,e)},e.prewarm=function(){z().acquire(P)},e.setMaxParallelImageRequests=function(e){t.a.MAX_PARALLEL_IMAGE_REQUESTS=e},e.setRTLTextPlugin=function(e,t){return ce().setRTLTextPlugin(e,t)},e.setWorkerCount=function(e){F.workerCount=e},e.setWorkerUrl=function(e){t.a.WORKER_URL=e}}),e})}),Ix=h((e,t)=>{var n=$(),r=kt().sanitizeHTML,i=kx(),a=Cx();function o(e,t){this.subplot=e,this.uid=e.uid+`-`+t,this.index=t,this.idSource=`source-`+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;s.update=function(e){this.visible?this.needsNewImage(e)?this.updateImage(e):this.needsNewSource(e)?(this.removeLayer(),this.updateSource(e),this.updateLayer(e)):this.needsNewLayer(e)?this.updateLayer(e):this.updateStyle(e):(this.updateSource(e),this.updateLayer(e)),this.visible=c(e)},s.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&this.sourceType===`image`&&e.sourcetype===`image`&&(this.source!==e.source||JSON.stringify(this.coordinates)!==JSON.stringify(e.coordinates))},s.needsNewSource=function(e){return this.sourceType!==e.sourcetype||JSON.stringify(this.source)!==JSON.stringify(e.source)||this.layerType!==e.type},s.needsNewLayer=function(e){return this.layerType!==e.type||this.below!==this.subplot.belowLookup[`layout-`+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup[`layout-`+this.index]},s.updateImage=function(e){this.subplot.map.getSource(this.idSource).updateImage({url:e.source,coordinates:e.coordinates});var t=this.findFollowingMapLayerId(this.lookupBelow());t!==null&&this.subplot.map.moveLayer(this.idLayer,t)},s.updateSource=function(e){var t=this.subplot.map;if(t.getSource(this.idSource)&&t.removeSource(this.idSource),this.sourceType=e.sourcetype,this.source=e.source,c(e)){var n=u(e);t.addSource(this.idSource,n)}},s.findFollowingMapLayerId=function(e){if(e===`traces`)for(var t=this.subplot.getMapLayers(),n=0;n<t.length;n++){var r=t[n].id;if(typeof r==`string`&&r.indexOf(a.traceLayerPrefix)===0){e=r;break}}return e},s.updateLayer=function(e){var t=this.subplot,n=l(e),r=this.lookupBelow(),i=this.findFollowingMapLayerId(r);this.removeLayer(),c(e)&&t.addLayer({id:this.idLayer,source:this.idSource,"source-layer":e.sourcelayer||``,type:e.type,minzoom:e.minzoom,maxzoom:e.maxzoom,layout:n.layout,paint:n.paint},i),this.layerType=e.type,this.below=r},s.updateStyle=function(e){if(c(e)){var t=l(e);this.subplot.setOptions(this.idLayer,`setLayoutProperty`,t.layout),this.subplot.setOptions(this.idLayer,`setPaintProperty`,t.paint)}},s.removeLayer=function(){var e=this.subplot.map;e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer)},s.dispose=function(){var e=this.subplot.map;e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),e.getSource(this.idSource)&&e.removeSource(this.idSource)};function c(e){if(!e.visible)return!1;var t=e.source;if(Array.isArray(t)&&t.length>0){for(var r=0;r<t.length;r++)if(typeof t[r]!=`string`||t[r].length===0)return!1;return!0}return n.isPlainObject(t)||typeof t==`string`&&t.length>0}function l(e){var t={},r={};switch(e.type){case`circle`:n.extendFlat(r,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case`line`:n.extendFlat(r,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case`fill`:n.extendFlat(r,{"fill-color":e.color,"fill-outline-color":e.fill.outlinecolor,"fill-opacity":e.opacity});break;case`symbol`:var a=e.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(t,{"icon-image":a.icon+`-15`,"icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),n.extendFlat(r,{"icon-color":e.color,"text-color":a.textfont.color,"text-opacity":e.opacity});break;case`raster`:n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":e.opacity});break}return{layout:t,paint:r}}function u(e){var t=e.sourcetype,n=e.source,i={type:t},a;return t===`geojson`?a=`data`:t===`vector`?a=typeof n==`string`?`url`:`tiles`:t===`raster`?(a=`tiles`,i.tileSize=256):t===`image`&&(a=`url`,i.coordinates=e.coordinates),i[a]=n,e.sourceattribution&&(i.attribution=r(e.sourceattribution)),i}t.exports=function(e,t,n){var r=new o(e,t);return r.update(n),r}}),Lx=h((e,t)=>{var n=Fx(),r=$(),i=Pg(),a=Ke(),o=sn(),s=hn(),c=Ln(),l=Rn(),u=l.drawMode,d=l.selectMode,f=Ar().prepSelect,p=Ar().clearOutline,m=Ar().clearSelectionsCache,h=Ar().selectOnClick,g=Cx(),_=Ix();function v(e,t){this.id=t,this.gd=e;var n=e._fullLayout,r=e._context;this.container=n._glcontainer.node(),this.isStatic=r.staticPlot,this.uid=n._uid+`-`+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(n),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var y=v.prototype;y.plot=function(e,t,n){var r=this,i=r.map?new Promise(function(n,i){r.updateMap(e,t,n,i)}):new Promise(function(n,i){r.createMap(e,t,n,i)});n.push(i)},y.createMap=function(e,t,r,a){var o=this,s=t[o.id],c=o.styleObj=x(s.style),l=s.bounds,u=l?[[l.west,l.south],[l.east,l.north]]:null,d=o.map=new n.Map({container:o.div,style:c.style,center:C(s.center),zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,maxBounds:u,interactive:!o.isStatic,preserveDrawingBuffer:o.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new n.AttributionControl({compact:!0})),f={};d.on(`styleimagemissing`,function(e){var t=e.id;if(!f[t]&&t.includes(`-15`)){f[t]=!0;var n=new Image(15,15);n.onload=function(){d.addImage(t,n)},n.crossOrigin=`Anonymous`,n.src=`https://unpkg.com/maki@2.1.0/icons/`+t+`.svg`}}),d.setTransformRequest(function(e){return e=e.replace(`https://fonts.openmaptiles.org/Open Sans Extrabold`,`https://fonts.openmaptiles.org/Open Sans Extra Bold`),e=e.replace(`https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold`,`https://fonts.openmaptiles.org/Open Sans Extra Bold`),e=e.replace(`https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular`,`https://fonts.openmaptiles.org/Klokantech Noto Sans Regular`),{url:e}}),d._canvas.style.left=`0px`,d._canvas.style.top=`0px`,o.rejectOnError(a),o.isStatic||o.initFx(e,t);var p=[];p.push(new Promise(function(e){d.once(`load`,e)})),p=p.concat(i.fetchTraceGeoData(e)),Promise.all(p).then(function(){o.fillBelowLookup(e,t),o.updateData(e),o.updateLayout(t),o.resolveOnRender(r)}).catch(a)},y.updateMap=function(e,t,n,r){var a=this,o=a.map,s=t[this.id];a.rejectOnError(r);var c=[],l=x(s.style);JSON.stringify(a.styleObj)!==JSON.stringify(l)&&(a.styleObj=l,o.setStyle(l.style),a.traceHash={},c.push(new Promise(function(e){o.once(`styledata`,e)}))),c=c.concat(i.fetchTraceGeoData(e)),Promise.all(c).then(function(){a.fillBelowLookup(e,t),a.updateData(e),a.updateLayout(t),a.resolveOnRender(n)}).catch(r)},y.fillBelowLookup=function(e,t){var n=t[this.id].layers,r,i,a=this.belowLookup={},o=!1;for(r=0;r<e.length;r++){var s=e[r][0].trace,c=s._module;typeof s.below==`string`?i=s.below:c.getBelow&&(i=c.getBelow(s,this)),i===``&&(o=!0),a[`trace-`+s.uid]=i||``}for(r=0;r<n.length;r++){var l=n[r];i=typeof l.below==`string`?l.below:o?`traces`:``,a[`layout-`+r]=i}var u={},d,f;for(d in a)i=a[d],u[i]?u[i].push(d):u[i]=[d];for(i in u){var p=u[i];if(p.length>1)for(r=0;r<p.length;r++)d=p[r],d.indexOf(`trace-`)===0?(f=d.split(`trace-`)[1],this.traceHash[f]&&(this.traceHash[f].below=null)):d.indexOf(`layout-`)===0&&(f=d.split(`layout-`)[1],this.layerList[f]&&(this.layerList[f].below=null))}};var b={choroplethmap:0,densitymap:1,scattermap:2};y.updateData=function(e){var t=this.traceHash,n,r,i,a,o=e.slice().sort(function(e,t){return b[e[0].trace.type]-b[t[0].trace.type]});for(i=0;i<o.length;i++){var s=o[i];r=s[0].trace,n=t[r.uid];var c=!1;n&&(n.type===r.type?(n.update(s),c=!0):n.dispose()),!c&&r._module&&(t[r.uid]=r._module.plot(this,s))}var l=Object.keys(t);e:for(i=0;i<l.length;i++){var u=l[i];for(a=0;a<e.length;a++)if(r=e[a][0].trace,u===r.uid)continue e;n=t[u],n.dispose(),delete t[u]}},y.updateLayout=function(e){var t=this.map,n=e[this.id];!this.dragging&&!this.wheeling&&(t.setCenter(C(n.center)),t.setZoom(n.zoom),t.setBearing(n.bearing),t.setPitch(n.pitch)),this.updateLayers(e),this.updateFramework(e),this.updateFx(e),this.map.resize(),this.gd._context._scrollZoom.map?t.scrollZoom.enable():t.scrollZoom.disable()},y.resolveOnRender=function(e){var t=this.map;t.on(`render`,function n(){t.loaded()&&(t.off(`render`,n),setTimeout(e,10))})},y.rejectOnError=function(e){var t=this.map;function n(){e(Error(g.mapOnErrorMsg))}t.once(`error`,n),t.once(`style.error`,n),t.once(`source.error`,n),t.once(`tile.error`,n),t.once(`layer.error`,n)},y.createFramework=function(e){var t=this,n=t.div=document.createElement(`div`);n.id=t.uid,n.style.position=`absolute`,t.container.appendChild(n),t.xaxis={_id:`x`,c2p:function(e){return t.project(e).x}},t.yaxis={_id:`y`,c2p:function(e){return t.project(e).y}},t.updateFramework(e),t.mockAxis={type:`linear`,showexponent:`all`,exponentformat:`B`},o.setConvert(t.mockAxis,e)},y.initFx=function(e,t){var n=this,r=n.gd,i=n.map;i.on(`moveend`,function(e){if(n.map){var t=r._fullLayout;if(e.originalEvent||n.wheeling){var i=t[n.id];a.call(`_storeDirectGUIEdit`,r.layout,t._preGUI,n.getViewEdits(i));var o=n.getView();i._input.center=i.center=o.center,i._input.zoom=i.zoom=o.zoom,i._input.bearing=i.bearing=o.bearing,i._input.pitch=i.pitch=o.pitch,r.emit(`plotly_relayout`,n.getViewEditsWithDerived(o))}e.originalEvent&&e.originalEvent.type===`mouseup`?n.dragging=!1:n.wheeling&&=!1,t&&t._rehover&&t._rehover()}}),i.on(`wheel`,function(){n.wheeling=!0}),i.on(`mousemove`,function(e){var t=n.div.getBoundingClientRect(),a=[e.originalEvent.offsetX,e.originalEvent.offsetY];e.target.getBoundingClientRect=function(){return t},n.xaxis.p2c=function(){return i.unproject(a).lng},n.yaxis.p2c=function(){return i.unproject(a).lat},r._fullLayout._rehover=function(){r._fullLayout._hoversubplot===n.id&&r._fullLayout[n.id]&&c.hover(r,e,n.id)},c.hover(r,e,n.id),r._fullLayout._hoversubplot=n.id});function o(){c.loneUnhover(t._hoverlayer)}i.on(`dragstart`,function(){n.dragging=!0,o()}),i.on(`zoomstart`,o),i.on(`mouseout`,function(){r._fullLayout._hoversubplot=null});function s(){var e=n.getView();r.emit(`plotly_relayouting`,n.getViewEditsWithDerived(e))}i.on(`drag`,s),i.on(`zoom`,s),i.on(`dblclick`,function(){var e=r._fullLayout[n.id];a.call(`_storeDirectGUIEdit`,r.layout,r._fullLayout._preGUI,n.getViewEdits(e));var t=n.viewInitial;i.setCenter(C(t.center)),i.setZoom(t.zoom),i.setBearing(t.bearing),i.setPitch(t.pitch);var o=n.getView();e._input.center=e.center=o.center,e._input.zoom=e.zoom=o.zoom,e._input.bearing=e.bearing=o.bearing,e._input.pitch=e.pitch=o.pitch,r.emit(`plotly_doubleclick`,null),r.emit(`plotly_relayout`,n.getViewEditsWithDerived(o))}),n.clearOutline=function(){m(n.dragOptions),p(n.dragOptions.gd)},n.onClickInPanFn=function(e){return function(t){var i=r._fullLayout.clickmode;i.indexOf(`select`)>-1&&h(t.originalEvent,r,[n.xaxis],[n.yaxis],n.id,e),i.indexOf(`event`)>-1&&c.click(r,t.originalEvent)}}},y.updateFx=function(e){var t=this,n=t.map,i=t.gd;if(t.isStatic)return;function a(e){var n=t.map.unproject(e);return[n.lng,n.lat]}var o=e.dragmode,c=function(e,n){if(n.isRect){var r=e.range={};r[t.id]=[a([n.xmin,n.ymin]),a([n.xmax,n.ymax])]}else{var i=e.lassoPoints={};i[t.id]=n.map(a)}},l=t.dragOptions;t.dragOptions=r.extendDeep(l||{},{dragmode:e.dragmode,element:t.div,gd:i,plotinfo:{id:t.id,domain:e[t.id].domain,xaxis:t.xaxis,yaxis:t.yaxis,fillRangeItems:c},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),n.off(`click`,t.onClickInPanHandler),d(o)||u(o)?(n.dragPan.disable(),n.on(`zoomstart`,t.clearOutline),t.dragOptions.prepFn=function(e,n,r){f(e,n,r,t.dragOptions,o)},s.init(t.dragOptions)):(n.dragPan.enable(),n.off(`zoomstart`,t.clearOutline),t.div.onmousedown=null,t.div.ontouchstart=null,t.div.removeEventListener(`touchstart`,t.div._ontouchstart),t.onClickInPanHandler=t.onClickInPanFn(t.dragOptions),n.on(`click`,t.onClickInPanHandler))},y.updateFramework=function(e){var t=e[this.id].domain,n=e._size,r=this.div.style;r.width=n.w*(t.x[1]-t.x[0])+`px`,r.height=n.h*(t.y[1]-t.y[0])+`px`,r.left=n.l+t.x[0]*n.w+`px`,r.top=n.t+(1-t.y[1])*n.h+`px`,this.xaxis._offset=n.l+t.x[0]*n.w,this.xaxis._length=n.w*(t.x[1]-t.x[0]),this.yaxis._offset=n.t+(1-t.y[1])*n.h,this.yaxis._length=n.h*(t.y[1]-t.y[0])},y.updateLayers=function(e){var t=e[this.id].layers,n=this.layerList,r;if(t.length!==n.length){for(r=0;r<n.length;r++)n[r].dispose();for(n=this.layerList=[],r=0;r<t.length;r++)n.push(_(this,r,t[r]))}else for(r=0;r<t.length;r++)n[r].update(t[r])},y.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},y.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},y.setOptions=function(e,t,n){for(var r in n)this.map[t](e,r,n[r])},y.getMapLayers=function(){return this.map.getStyle().layers},y.addLayer=function(e,t){var n=this.map;if(typeof t==`string`){if(t===``){n.addLayer(e,t);return}for(var i=this.getMapLayers(),a=0;a<i.length;a++)if(t===i[a].id){n.addLayer(e,t);return}r.warn([`Trying to add layer with *below* value`,t,`referencing a layer that does not exist`,`or that does not yet exist.`].join(` `))}n.addLayer(e)},y.project=function(e){return this.map.project(new n.LngLat(e[0],e[1]))},y.getView=function(){var e=this.map,t=e.getCenter(),n={lon:t.lng,lat:t.lat},r=e.getCanvas(),i=parseInt(r.style.width),a=parseInt(r.style.height);return{center:n,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch(),_derived:{coordinates:[e.unproject([0,0]).toArray(),e.unproject([i,0]).toArray(),e.unproject([i,a]).toArray(),e.unproject([0,a]).toArray()]}}},y.getViewEdits=function(e){for(var t=this.id,n=[`center`,`zoom`,`bearing`,`pitch`],r={},i=0;i<n.length;i++){var a=n[i];r[t+`.`+a]=e[a]}return r},y.getViewEditsWithDerived=function(e){var t=this.id,n=this.getViewEdits(e);return n[t+`._derived`]=e._derived,n};function x(e){var t={};return r.isPlainObject(e)?(t.id=e.id,t.style=e):typeof e==`string`?(t.id=e,g.stylesMap[e]?t.style=g.stylesMap[e]:t.style=e):(t.id=g.styleValueDflt,t.style=S(g.styleValueDflt)),t.transition={duration:0,delay:0},t}function S(e){return g.styleUrlPrefix+e+`-`+g.styleUrlSuffix}function C(e){return[e.lon,e.lat]}t.exports=v}),Rx=h((e,t)=>{var n=$(),r=Ks(),i=Vt(),a=wx();t.exports=function(e,t,n){r(e,t,n,{type:`map`,attributes:a,handleDefaults:o,partition:`y`})};function o(e,t,n){n(`style`),n(`center.lon`),n(`center.lat`),n(`zoom`),n(`bearing`),n(`pitch`);var r=n(`bounds.west`),a=n(`bounds.east`),o=n(`bounds.south`),c=n(`bounds.north`);(r===void 0||a===void 0||o===void 0||c===void 0)&&delete t.bounds,i(e,t,{name:`layers`,handleItemDefaults:s}),t._input=e}function s(e,t){function r(r,i){return n.coerce(e,t,a.layers,r,i)}if(r(`visible`)){var i=r(`sourcetype`),o=i===`raster`||i===`image`;r(`source`),r(`sourceattribution`),i===`vector`&&r(`sourcelayer`),i===`image`&&r(`coordinates`);var s;o&&(s=`raster`);var c=r(`type`,s);o&&c!==`raster`&&(c=t.type=`raster`,n.log(`Source types *raster* and *image* must drawn *raster* layer type.`)),r(`below`),r(`color`),r(`opacity`),r(`minzoom`),r(`maxzoom`),c===`circle`&&r(`circle.radius`),c===`line`&&(r(`line.width`),r(`line.dash`)),c===`fill`&&r(`fill.outlinecolor`),c===`symbol`&&(r(`symbol.icon`),r(`symbol.iconsize`),r(`symbol.text`),n.coerceFont(r,`symbol.textfont`,void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),r(`symbol.textposition`),r(`symbol.placement`))}}}),zx=h(e=>{var t=$(),n=t.strTranslate,r=t.strScale,i=wt().getSubplotCalcData,a=Dt(),o=S(),s=tn(),c=kt(),l=Lx(),u=`map`;e.name=u,e.attr=`subplot`,e.idRoot=u,e.idRegex=e.attrRegex=t.counterRegex(u),e.attributes={subplot:{valType:`subplotid`,dflt:`map`,editType:`calc`}},e.layoutAttributes=wx(),e.supplyLayoutDefaults=Rx(),e.plot=function(e){for(var n=e._fullLayout,r=e.calcdata,a=n._subplots[u],o=0;o<a.length;o++){var s=a[o],c=i(r,u,s),d=n[s],f=d._subplot;f||(f=new l(e,s),n[s]._subplot=f),f.viewInitial||={center:t.extendFlat({},d.center),zoom:d.zoom,bearing:d.bearing,pitch:d.pitch},f.plot(c,n,e._promises)}},e.clean=function(e,t,n,r){for(var i=r._subplots[u]||[],a=0;a<i.length;a++){var o=i[a];!t[o]&&r[o]._subplot&&r[o]._subplot.destroy()}},e.toSVG=function(e){for(var t=e._fullLayout,i=t._subplots[u],l=t._size,d=0;d<i.length;d++){var f=t[i[d]],p=f.domain,m=f._subplot.toImage(`png`);t._glimages.append(`svg:image`).attr({xmlns:a.svg,"xlink:href":m,x:l.l+l.w*p.x[0],y:l.t+l.h*(1-p.y[1]),width:l.w*(p.x[1]-p.x[0]),height:l.h*(p.y[1]-p.y[0]),preserveAspectRatio:`none`});var h=o.select(f._subplot.div).select(`.maplibregl-ctrl-attrib`).text().replace(`Improve this map`,``),g=t._glimages.append(`g`),_=g.append(`text`);_.text(h).classed(`static-attribution`,!0).attr({"font-size":12,"font-family":`Arial`,color:`rgba(0, 0, 0, 0.75)`,"text-anchor":`end`,"data-unformatted":h});var v=s.bBox(_.node()),y=l.w*(p.x[1]-p.x[0]);if(v.width>y/2){var b=h.split(`|`).join(`<br>`);_.text(b).attr(`data-unformatted`,b).call(c.convertToTspans,e),v=s.bBox(_.node())}_.attr(`transform`,n(-3,-v.height+8)),g.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 x=1;v.width+6>y&&(x=y/(v.width+6));var S=[l.l+l.w*p.x[1],l.t+l.h*(1-p.y[0])];g.attr(`transform`,n(S[0],S[1])+r(x))}},e.updateFx=function(e){for(var t=e._fullLayout,n=t._subplots[u],r=0;r<n.length;r++)t[n[r]]._subplot.updateFx(t)}}),Bx=h((e,t)=>{t.exports={attributes:Tx(),supplyDefaults:Dx(),colorbar:gi(),formatLabels:Ox(),calc:Sg(),plot:jx(),hoverPoints:Mx().hoverPoints,eventData:Nx(),selectPoints:Px(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.update(t)},moduleType:`trace`,name:`scattermap`,basePlotModule:zx(),categories:[`map`,`gl`,`symbols`,`showLegend`,`scatter-like`],meta:{}}}),Vx=h((e,t)=>{t.exports=Bx()}),Hx=h((e,t)=>{var n=Xg(),r=Pt(),{hovertemplateAttrs:i,templatefallbackAttrs:a}=ze(),o=W(),s=z().extendFlat;t.exports=s({locations:{valType:`data_array`,editType:`calc`},z:{valType:`data_array`,editType:`calc`},geojson:{valType:`any`,editType:`calc`},featureidkey:s({},n.featureidkey,{}),below:{valType:`string`,editType:`plot`},text:n.text,hovertext:n.hovertext,marker:{line:{color:s({},n.marker.line.color,{editType:`plot`}),width:s({},n.marker.line.width,{editType:`plot`}),editType:`calc`},opacity:s({},n.marker.opacity,{editType:`plot`}),editType:`calc`},selected:{marker:{opacity:s({},n.selected.marker.opacity,{editType:`plot`}),editType:`plot`},editType:`plot`},unselected:{marker:{opacity:s({},n.unselected.marker.opacity,{editType:`plot`}),editType:`plot`},editType:`plot`},hoverinfo:n.hoverinfo,hovertemplate:i({},{keys:[`properties`]}),hovertemplatefallback:a(),showlegend:s({},o.showlegend,{dflt:!1})},r(``,{cLetter:`z`,editTypeOverride:`calc`}))}),Ux=h((e,t)=>{var n=$(),r=Gt(),i=Hx();t.exports=function(e,t,a,o){function s(r,a){return n.coerce(e,t,i,r,a)}var c=s(`locations`),l=s(`z`),u=s(`geojson`);if(!n.isArrayOrTypedArray(c)||!c.length||!n.isArrayOrTypedArray(l)||!l.length||!(typeof u==`string`&&u!==``||n.isPlainObject(u))){t.visible=!1;return}s(`featureidkey`),t._length=Math.min(c.length,l.length),s(`below`),s(`text`),s(`hovertext`),s(`hovertemplate`),s(`hovertemplatefallback`),s(`marker.line.width`)&&s(`marker.line.color`),s(`marker.opacity`),r(e,t,o,s,{prefix:``,cLetter:`z`}),n.coerceSelectionMarkerOpacity(t,s)}}),Wx=h((e,t)=>{var n=D(),r=$(),i=Yt(),a=tn(),o=Eg().makeBlank,s=Pg();function c(e){var t=e[0].trace,a=t.visible===!0&&t._length!==0,c={layout:{visibility:`none`},paint:{}},u={layout:{visibility:`none`},paint:{}},d=t._opts={fill:c,line:u,geojson:o()};if(!a)return d;var f=s.extractTraceFeature(e);if(!f)return d;var p=i.makeColorScaleFuncFromTrace(t),m=t.marker,h=m.line||{},g;r.isArrayOrTypedArray(m.opacity)&&(g=function(e){var t=e.mo;return n(t)?+r.constrain(t,0,1):0});var _;r.isArrayOrTypedArray(h.color)&&(_=function(e){return e.mlc});var v;r.isArrayOrTypedArray(h.width)&&(v=function(e){return e.mlw});for(var y=0;y<e.length;y++){var b=e[y],x=b.fOut;if(x){var S=x.properties;S.fc=p(b.z),g&&(S.mo=g(b)),_&&(S.mlc=_(b)),v&&(S.mlw=v(b)),b.ct=S.ct,b._polygons=s.feature2polygons(x)}}var C=g?{type:`identity`,property:`mo`}:m.opacity;return r.extendFlat(c.paint,{"fill-color":{type:`identity`,property:`fc`},"fill-opacity":C}),r.extendFlat(u.paint,{"line-color":_?{type:`identity`,property:`mlc`}:h.color,"line-width":v?{type:`identity`,property:`mlw`}:h.width,"line-opacity":C}),c.layout.visibility=`visible`,u.layout.visibility=`visible`,d.geojson={type:`FeatureCollection`,features:f},l(e),d}function l(e){var t=e[0].trace,n=t._opts,i;if(t.selectedpoints){for(var o=a.makeSelectedPointStyleFns(t),s=0;s<e.length;s++){var c=e[s];c.fOut&&(c.fOut.properties.mo2=o.selectedOpacityFn(c))}i={type:`identity`,property:`mo2`}}else i=r.isArrayOrTypedArray(t.marker.opacity)?{type:`identity`,property:`mo`}:t.marker.opacity;return r.extendFlat(n.fill.paint,{"fill-opacity":i}),r.extendFlat(n.line.paint,{"line-opacity":i}),n}t.exports={convert:c,convertOnSelect:l}}),Gx=h((e,t)=>{var n=Wx().convert,r=Wx().convertOnSelect,i=Cx().traceLayerPrefix;function a(e,t){this.type=`choroplethmap`,this.subplot=e,this.uid=t,this.sourceId=`source-`+t,this.layerList=[[`fill`,i+t+`-fill`],[`line`,i+t+`-line`]],this.below=null}var o=a.prototype;o.update=function(e){this._update(n(e)),e[0].trace._glTrace=this},o.updateOnSelect=function(e){this._update(r(e))},o._update=function(e){var t=this.subplot,n=this.layerList,r=t.belowLookup[`trace-`+this.uid];t.map.getSource(this.sourceId).setData(e.geojson),r!==this.below&&(this._removeLayers(),this._addLayers(e,r),this.below=r);for(var i=0;i<n.length;i++){var a=n[i],o=a[0],s=a[1],c=e[o];t.setOptions(s,`setLayoutProperty`,c.layout),c.layout.visibility===`visible`&&t.setOptions(s,`setPaintProperty`,c.paint)}},o._addLayers=function(e,t){for(var n=this.subplot,r=this.layerList,i=this.sourceId,a=0;a<r.length;a++){var o=r[a],s=o[0],c=e[s];n.addLayer({type:s,id:o[1],source:i,layout:c.layout,paint:c.paint},t)}},o._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,n=t.length-1;n>=0;n--)e.removeLayer(t[n][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var r=t[0].trace,i=new a(e,r.uid),o=i.sourceId,s=n(t),c=i.below=e.belowLookup[`trace-`+r.uid];return e.map.addSource(o,{type:`geojson`,data:s.geojson}),i._addLayers(s,c),t[0].trace._glTrace=i,i}}),Kx=h((e,t)=>{t.exports={attributes:Hx(),supplyDefaults:Ux(),colorbar:Uo(),calc:Qg(),plot:Gx(),hoverPoints:t_(),eventData:n_(),selectPoints:r_(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.updateOnSelect(t)},getBelow:function(e,t){for(var n=t.getMapLayers(),r=n.length-2;r>=0;r--){var i=n[r].id;if(typeof i==`string`&&i.indexOf(`water`)===0){for(var a=r+1;a<n.length;a++)if(i=n[a].id,typeof i==`string`&&i.indexOf(`plotly-`)===-1)return i}}},moduleType:`trace`,name:`choroplethmap`,basePlotModule:zx(),categories:[`map`,`gl`,`noOpacity`,`showLegend`],meta:{hr_name:`choropleth_map`}}}),qx=h((e,t)=>{t.exports=Kx()}),Jx=h((e,t)=>{var n=Pt(),{hovertemplateAttrs:r,templatefallbackAttrs:i}=ze(),a=W(),o=Tx(),s=z().extendFlat;t.exports=s({lon:o.lon,lat:o.lat,z:{valType:`data_array`,editType:`calc`},radius:{valType:`number`,editType:`plot`,arrayOk:!0,min:1,dflt:30},below:{valType:`string`,editType:`plot`},text:o.text,hovertext:o.hovertext,hoverinfo:s({},a.hoverinfo,{flags:[`lon`,`lat`,`z`,`text`,`name`]}),hovertemplate:r(),hovertemplatefallback:i(),showlegend:s({},a.showlegend,{dflt:!1})},n(``,{cLetter:`z`,editTypeOverride:`calc`}))}),Yx=h((e,t)=>{var n=$(),r=Gt(),i=Jx();t.exports=function(e,t,a,o){function s(r,a){return n.coerce(e,t,i,r,a)}var c=s(`lon`)||[],l=s(`lat`)||[],u=Math.min(c.length,l.length);if(!u){t.visible=!1;return}t._length=u,s(`z`),s(`radius`),s(`below`),s(`text`),s(`hovertext`),s(`hovertemplate`),s(`hovertemplatefallback`),r(e,t,o,s,{prefix:``,cLetter:`z`})}}),Xx=h((e,t)=>{var n=D(),r=$().isArrayOrTypedArray,i=O().BADNUM,a=Jt(),o=$()._;t.exports=function(e,t){for(var s=t._length,c=Array(s),l=t.z,u=r(l)&&l.length,d=0;d<s;d++){var f=c[d]={},p=t.lon[d],m=t.lat[d];if(f.lonlat=n(p)&&n(m)?[+p,+m]:[i,i],u){var h=l[d];f.z=n(h)?h:i}}return a(e,t,{vals:u?l:[0,1],containerStr:``,cLetter:`z`}),s&&(c[0].t={labels:{lat:o(e,`lat:`)+` `,lon:o(e,`lon:`)+` `}}),c}}),Zx=h((e,t)=>{var n=D(),r=$(),i=q(),a=Yt(),o=O().BADNUM,s=Eg().makeBlank;t.exports=function(e){var t=e[0].trace,c=t.visible===!0&&t._length!==0,l=t._opts={heatmap:{layout:{visibility:`none`},paint:{}},geojson:s()};if(!c)return l;var u=[],d,f=t.z,p=t.radius,m=r.isArrayOrTypedArray(f)&&f.length,h=r.isArrayOrTypedArray(p);for(d=0;d<e.length;d++){var g=e[d],_=g.lonlat;if(_[0]!==o){var v={};if(m){var y=g.z;v.z=y===o?0:y}h&&(v.r=n(p[d])&&p[d]>0?+p[d]:0),u.push({type:`Feature`,geometry:{type:`Point`,coordinates:_},properties:v})}}var b=a.extractOpts(t),x=b.reversescale?a.flipScale(b.colorscale):b.colorscale,S=x[0][1],C=[`interpolate`,[`linear`],[`heatmap-density`],0,i.opacity(S)<1?S:i.addOpacity(S,0)];for(d=1;d<x.length;d++)C.push(x[d][0],x[d][1]);var w=[`interpolate`,[`linear`],[`get`,`z`],b.min,0,b.max,1];return r.extendFlat(l.heatmap.paint,{"heatmap-weight":m?w:1/(b.max-b.min),"heatmap-color":C,"heatmap-radius":h?{type:`identity`,property:`r`}:t.radius,"heatmap-opacity":t.opacity}),l.geojson={type:`FeatureCollection`,features:u},l.heatmap.layout.visibility=`visible`,l}}),Qx=h((e,t)=>{var n=Zx(),r=Cx().traceLayerPrefix;function i(e,t){this.type=`densitymap`,this.subplot=e,this.uid=t,this.sourceId=`source-`+t,this.layerList=[[`heatmap`,r+t+`-heatmap`]],this.below=null}var a=i.prototype;a.update=function(e){var t=this.subplot,r=this.layerList,i=n(e),a=t.belowLookup[`trace-`+this.uid];t.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var o=0;o<r.length;o++){var s=r[o],c=s[0],l=s[1],u=i[c];t.setOptions(l,`setLayoutProperty`,u.layout),u.layout.visibility===`visible`&&t.setOptions(l,`setPaintProperty`,u.paint)}},a._addLayers=function(e,t){for(var n=this.subplot,r=this.layerList,i=this.sourceId,a=0;a<r.length;a++){var o=r[a],s=o[0],c=e[s];n.addLayer({type:s,id:o[1],source:i,layout:c.layout,paint:c.paint},t)}},a._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,n=t.length-1;n>=0;n--)e.removeLayer(t[n][1])},a.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var r=t[0].trace,a=new i(e,r.uid),o=a.sourceId,s=n(t),c=a.below=e.belowLookup[`trace-`+r.uid];return e.map.addSource(o,{type:`geojson`,data:s.geojson}),a._addLayers(s,c),a}}),$x=h((e,t)=>{var n=sn(),r=Mx().hoverPoints,i=Mx().getExtraText;t.exports=function(e,t,a){var o=r(e,t,a);if(o){var s=o[0],c=s.cd,l=c[0].trace,u=c[s.index];if(delete s.color,`z`in u){var d=s.subplot.mockAxis;s.z=u.z,s.zLabel=n.tickText(d,d.c2l(u.z),`hover`).text}return s.extraText=i(l,u,c[0].t.labels),[s]}}}),eS=h((e,t)=>{t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e.z=t.z,e}}),tS=h((e,t)=>{t.exports={attributes:Jx(),supplyDefaults:Yx(),colorbar:Uo(),formatLabels:Ox(),calc:Xx(),plot:Qx(),hoverPoints:$x(),eventData:eS(),getBelow:function(e,t){for(var n=t.getMapLayers(),r=0;r<n.length;r++){var i=n[r],a=i.id;if(i.type===`symbol`&&typeof a==`string`&&a.indexOf(`plotly-`)===-1)return a}},moduleType:`trace`,name:`densitymap`,basePlotModule:zx(),categories:[`map`,`gl`,`showLegend`],meta:{hr_name:`density_map`}}}),nS=h((e,t)=>{t.exports=tS()}),rS=h((e,t)=>{var n=B(),r=W(),i=K(),a=U(),o=Da().attributes,{hovertemplateAttrs:s,templatefallbackAttrs:c}=ze(),l=Pt(),u=yt().templatedArray,d=jt().descriptionOnlyNumbers,f=z().extendFlat,p=Ie().overrideAll;t.exports=p({hoverinfo:f({},r.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:a.hoverlabel,domain:o({name:`sankey`,trace:!0}),orientation:{valType:`enumerated`,values:[`v`,`h`],dflt:`h`},valueformat:{valType:`string`,dflt:`.3s`,description:d(`value`)},valuesuffix:{valType:`string`,dflt:``},arrangement:{valType:`enumerated`,values:[`snap`,`perpendicular`,`freeform`,`fixed`],dflt:`snap`},textfont:n({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:i.defaultLine,arrayOk:!0},width:{valType:`number`,min:0,dflt:.5,arrayOk:!0}},pad:{valType:`number`,arrayOk:!1,min:0,dflt:20},thickness:{valType:`number`,arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:`enumerated`,values:[`all`,`none`,`skip`],dflt:`all`},hoverlabel:a.hoverlabel,hovertemplate:s({},{keys:[`value`,`label`]}),hovertemplatefallback:c(),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:i.defaultLine,arrayOk:!0},width:{valType:`number`,min:0,dflt:0,arrayOk:!0}},source:{valType:`data_array`,dflt:[]},target:{valType:`data_array`,dflt:[]},value:{valType:`data_array`,dflt:[]},hoverinfo:{valType:`enumerated`,values:[`all`,`none`,`skip`],dflt:`all`},hoverlabel:a.hoverlabel,hovertemplate:s({},{keys:[`value`,`label`]}),hovertemplatefallback:c(),colorscales:u(`concentrationscales`,{editType:`calc`,label:{valType:`string`,editType:`calc`,dflt:``},cmax:{valType:`number`,editType:`calc`,dflt:1},cmin:{valType:`number`,editType:`calc`,dflt:0},colorscale:f(l().colorscale,{dflt:[[0,`white`],[1,`black`]]})})}},`calc`,`nested`)}),iS=h((e,t)=>{var n=$(),r=rS(),i=q(),a=R(),o=Da().defaults,s=An(),c=yt(),l=Vt();t.exports=function(e,t,d,f){function p(i,a){return n.coerce(e,t,r,i,a)}var m=n.extendDeep(f.hoverlabel,e.hoverlabel),h=e.node,g=c.newContainer(t,`node`);function _(e,t){return n.coerce(h,g,r.node,e,t)}_(`label`),_(`groups`),_(`x`),_(`y`),_(`pad`),_(`thickness`),_(`line.color`),_(`line.width`),_(`hoverinfo`,e.hoverinfo),s(h,g,_,m),_(`hovertemplate`),_(`align`);var v=f.colorway,y=function(e){return v[e%v.length]};_(`color`,g.label.map(function(e,t){return i.addOpacity(y(t),.8)})),_(`customdata`);var b=e.link||{},x=c.newContainer(t,`link`);function S(e,t){return n.coerce(b,x,r.link,e,t)}S(`label`),S(`arrowlen`),S(`source`),S(`target`),S(`value`),S(`line.color`),S(`line.width`),S(`hoverinfo`,e.hoverinfo),s(b,x,S,m),S(`hovertemplate`);var C=a(f.paper_bgcolor).getLuminance()<.333,w=S(`color`,C?`rgba(255, 255, 255, 0.6)`:`rgba(0, 0, 0, 0.2)`);function T(e){var t=a(e);if(!t.isValid())return e;var n=t.getAlpha();return n<=.8?t.setAlpha(n+.2):t=C?t.brighten():t.darken(),t.toRgbString()}S(`hovercolor`,Array.isArray(w)?w.map(T):T(w)),S(`customdata`),l(b,x,{name:`colorscales`,handleItemDefaults:u}),o(t,f,p),p(`orientation`),p(`valueformat`),p(`valuesuffix`);var E;g.x.length&&g.y.length&&(E=`freeform`),p(`arrangement`,E),n.coerceFont(p,`textfont`,f.font,{autoShadowDflt:!0}),t._length=null};function u(e,t){function i(i,a){return n.coerce(e,t,r.link.colorscales,i,a)}i(`label`),i(`cmin`),i(`cmax`),i(`colorscale`)}}),aS=h((e,t)=>{t.exports=n;function n(e){for(var t=e.length,n=Array(t),r=Array(t),i=Array(t),a=Array(t),o=Array(t),s=Array(t),c=0;c<t;++c)n[c]=-1,r[c]=0,i[c]=!1,a[c]=0,o[c]=-1,s[c]=[];var l=0,u=[],d=[];function f(t){var c=[t],f=[t];for(n[t]=r[t]=l,i[t]=!0,l+=1;f.length>0;){t=f[f.length-1];var p=e[t];if(a[t]<p.length){for(var m=a[t];m<p.length;++m){var h=p[m];if(n[h]<0){n[h]=r[h]=l,i[h]=!0,l+=1,c.push(h),f.push(h);break}else i[h]&&(r[t]=Math.min(r[t],r[h])|0);o[h]>=0&&s[t].push(o[h])}a[t]=m}else{if(r[t]===n[t]){for(var g=[],_=[],v=0,m=c.length-1;m>=0;--m){var y=c[m];if(i[y]=!1,g.push(y),_.push(s[y]),v+=s[y].length,o[y]=u.length,y===t){c.length=m;break}}u.push(g);for(var b=Array(v),m=0;m<_.length;m++)for(var x=0;x<_[m].length;x++)b[--v]=_[m][x];d.push(b)}f.pop()}}}for(var c=0;c<t;++c)n[c]<0&&f(c);for(var p,c=0;c<d.length;c++){var m=d[c];if(m.length!==0){m.sort(function(e,t){return e-t}),p=[m[0]];for(var h=1;h<m.length;h++)m[h]!==m[h-1]&&p.push(m[h]);d[c]=p}}return{components:u,adjacencyList:d}}}),oS=h((e,t)=>{var n=aS(),r=$(),i=lb().wrap,a=r.isArrayOrTypedArray,o=r.isIndex,s=Yt();function c(e){var t=e.node,n=e.link,i=[],c=a(n.color),u=a(n.hovercolor),d=a(n.customdata),f={},p={},m=n.colorscales.length,h;for(h=0;h<m;h++){var g=n.colorscales[h],_=s.extractScale(g,{cLetter:`c`}),v=s.makeColorScaleFunc(_);p[g.label]=v}var y=0;for(h=0;h<n.value.length;h++)n.source[h]>y&&(y=n.source[h]),n.target[h]>y&&(y=n.target[h]);var b=y+1;e.node._count=b;var x,S=e.node.groups,C={};for(h=0;h<S.length;h++){var w=S[h];for(x=0;x<w.length;x++){var T=w[x],E=b+h;C.hasOwnProperty(T)?r.warn(`Node `+T+` is already part of a group.`):C[T]=E}}var D={source:[],target:[]};for(h=0;h<n.value.length;h++){var O=n.value[h],k=n.source[h],A=n.target[h];if(O>0&&o(k,b)&&o(A,b)&&!(C.hasOwnProperty(k)&&C.hasOwnProperty(A)&&C[k]===C[A])){C.hasOwnProperty(A)&&(A=C[A]),C.hasOwnProperty(k)&&(k=C[k]),k=+k,A=+A,f[k]=f[A]=!0;var j=``;n.label&&n.label[h]&&(j=n.label[h]);var M=null;j&&p.hasOwnProperty(j)&&(M=p[j]),i.push({pointNumber:h,label:j,color:c?n.color[h]:n.color,hovercolor:u?n.hovercolor[h]:n.hovercolor,customdata:d?n.customdata[h]:n.customdata,concentrationscale:M,source:k,target:A,value:+O}),D.source.push(k),D.target.push(A)}}var N=b+S.length,P=a(t.color),F=a(t.customdata),I=[];for(h=0;h<N;h++)if(f[h]){var L=t.label[h];I.push({group:h>b-1,childrenNodes:[],pointNumber:h,label:L,color:P?t.color[h]:t.color,customdata:F?t.customdata[h]:t.customdata})}var R=!1;return l(N,D.source,D.target)&&(R=!0),{circular:R,links:i,nodes:I,groups:S,groupLookup:C}}function l(e,t,i){for(var a=r.init2dArray(e,0),o=0;o<Math.min(t.length,i.length);o++)if(r.isIndex(t[o],e)&&r.isIndex(i[o],e)){if(t[o]===i[o])return!0;a[t[o]].push(i[o])}return n(a).components.some(function(e){return e.length>1})}t.exports=function(e,t){var n=c(t);return i({circular:n.circular,_nodes:n.nodes,_links:n.links,_groups:n.groups,_groupLookup:n.groupLookup})}}),sS=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):(n||=self,r(n.d3=n.d3||{}))})(e,function(e){function t(e){var t=+this._x.call(null,e),r=+this._y.call(null,e);return n(this.cover(t,r),t,r,e)}function n(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a=e._root,o={data:r},s=e._x0,c=e._y0,l=e._x1,u=e._y1,d,f,p,m,h,g,_,v;if(!a)return e._root=o,e;for(;a.length;)if((h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f,i=a,!(a=a[_=g<<1|h]))return i[_]=o,e;if(p=+e._x.call(null,a.data),m=+e._y.call(null,a.data),t===p&&n===m)return o.next=a,i?i[_]=o:e._root=o,e;do i=i?i[_]=[,,,,]:e._root=[,,,,],(h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f;while((_=g<<1|h)==(v=(m>=f)<<1|p>=d));return i[v]=a,i[_]=o,e}function r(e){var t,r,i=e.length,a,o,s=Array(i),c=Array(i),l=1/0,u=1/0,d=-1/0,f=-1/0;for(r=0;r<i;++r)isNaN(a=+this._x.call(null,t=e[r]))||isNaN(o=+this._y.call(null,t))||(s[r]=a,c[r]=o,a<l&&(l=a),a>d&&(d=a),o<u&&(u=o),o>f&&(f=o));if(l>d||u>f)return this;for(this.cover(l,u).cover(d,f),r=0;r<i;++r)n(this,s[r],c[r],e[r]);return this}function i(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var o=i-n,s=this._root,c,l;n>e||e>=i||r>t||t>=a;)switch(l=(t<r)<<1|e<n,c=[,,,,],c[l]=s,s=c,o*=2,l){case 0:i=n+o,a=r+o;break;case 1:n=i-o,a=r+o;break;case 2:i=n+o,r=a-o;break;case 3:n=i-o,r=a-o;break}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this}function a(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function o(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function s(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function c(e,t,n){var r,i=this._x0,a=this._y0,o,c,l,u,d=this._x1,f=this._y1,p=[],m=this._root,h,g;for(m&&p.push(new s(m,i,a,d,f)),n==null?n=1/0:(i=e-n,a=t-n,d=e+n,f=t+n,n*=n);h=p.pop();)if(!(!(m=h.node)||(o=h.x0)>d||(c=h.y0)>f||(l=h.x1)<i||(u=h.y1)<a))if(m.length){var _=(o+l)/2,v=(c+u)/2;p.push(new s(m[3],_,v,l,u),new s(m[2],o,v,_,u),new s(m[1],_,c,l,v),new s(m[0],o,c,_,v)),(g=(t>=v)<<1|e>=_)&&(h=p[p.length-1],p[p.length-1]=p[p.length-1-g],p[p.length-1-g]=h)}else{var y=e-+this._x.call(null,m.data),b=t-+this._y.call(null,m.data),x=y*y+b*b;if(x<n){var S=Math.sqrt(n=x);i=e-S,a=t-S,d=e+S,f=t+S,r=m.data}}return r}function l(e){if(isNaN(u=+this._x.call(null,e))||isNaN(d=+this._y.call(null,e)))return this;var t,n=this._root,r,i,a,o=this._x0,s=this._y0,c=this._x1,l=this._y1,u,d,f,p,m,h,g,_;if(!n)return this;if(n.length)for(;;){if((m=u>=(f=(o+c)/2))?o=f:c=f,(h=d>=(p=(s+l)/2))?s=p:l=p,t=n,!(n=n[g=h<<1|m]))return this;if(!n.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(r=t,_=g)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):t?(a?t[g]=a:delete t[g],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[_]=n:this._root=n),this):(this._root=a,this)}function u(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function d(){return this._root}function f(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function p(e){var t=[],n,r=this._root,i,a,o,c,l;for(r&&t.push(new s(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,a=n.x0,o=n.y0,c=n.x1,l=n.y1)&&r.length){var u=(a+c)/2,d=(o+l)/2;(i=r[3])&&t.push(new s(i,u,d,c,l)),(i=r[2])&&t.push(new s(i,a,d,u,l)),(i=r[1])&&t.push(new s(i,u,o,c,d)),(i=r[0])&&t.push(new s(i,a,o,u,d))}return this}function m(e){var t=[],n=[],r;for(this._root&&t.push(new s(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var a,o=r.x0,c=r.y0,l=r.x1,u=r.y1,d=(o+l)/2,f=(c+u)/2;(a=i[0])&&t.push(new s(a,o,c,d,f)),(a=i[1])&&t.push(new s(a,d,c,l,f)),(a=i[2])&&t.push(new s(a,o,f,d,u)),(a=i[3])&&t.push(new s(a,d,f,l,u))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function h(e){return e[0]}function g(e){return arguments.length?(this._x=e,this):this._x}function _(e){return e[1]}function v(e){return arguments.length?(this._y=e,this):this._y}function y(e,t,n){var r=new b(t??h,n??_,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function b(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function x(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var S=y.prototype=b.prototype;S.copy=function(){var e=new b(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=x(t),e;for(n=[{source:t,target:e._root=[,,,,]}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=[,,,,]}):t.target[i]=x(r));return e},S.add=t,S.addAll=r,S.cover=i,S.data=a,S.extent=o,S.find=c,S.remove=l,S.removeAll=u,S.root=d,S.size=f,S.visit=p,S.visitAfter=m,S.x=g,S.y=v,e.quadtree=y,Object.defineProperty(e,`__esModule`,{value:!0})})}),cS=h((e,t)=>{(function(n,r){r(typeof e==`object`&&t!==void 0?e:n.d3=n.d3||{})})(e,function(e){var t=`$`;function n(){}n.prototype=r.prototype={constructor:n,has:function(e){return t+e in this},get:function(e){return this[t+e]},set:function(e,n){return this[t+e]=n,this},remove:function(e){var n=t+e;return n in this&&delete this[n]},clear:function(){for(var e in this)e[0]===t&&delete this[e]},keys:function(){var e=[];for(var n in this)n[0]===t&&e.push(n.slice(1));return e},values:function(){var e=[];for(var n in this)n[0]===t&&e.push(this[n]);return e},entries:function(){var e=[];for(var n in this)n[0]===t&&e.push({key:n.slice(1),value:this[n]});return e},size:function(){var e=0;for(var n in this)n[0]===t&&++e;return e},empty:function(){for(var e in this)if(e[0]===t)return!1;return!0},each:function(e){for(var n in this)n[0]===t&&e(this[n],n.slice(1),this)}};function r(e,t){var r=new n;if(e instanceof n)e.each(function(e,t){r.set(t,e)});else if(Array.isArray(e)){var i=-1,a=e.length,o;if(t==null)for(;++i<a;)r.set(i,e[i]);else for(;++i<a;)r.set(t(o=e[i],i,e),o)}else if(e)for(var s in e)r.set(s,e[s]);return r}function i(){var e=[],t=[],n,i,l;function u(t,a,o,s){if(a>=e.length)return n!=null&&t.sort(n),i==null?t:i(t);for(var c=-1,l=t.length,d=e[a++],f,p,m=r(),h,g=o();++c<l;)(h=m.get(f=d(p=t[c])+``))?h.push(p):m.set(f,[p]);return m.each(function(e,t){s(g,t,u(e,a,o,s))}),g}function d(n,r){if(++r>e.length)return n;var a,o=t[r-1];return i!=null&&r>=e.length?a=n.entries():(a=[],n.each(function(e,t){a.push({key:t,values:d(e,r)})})),o==null?a:a.sort(function(e,t){return o(e.key,t.key)})}return l={object:function(e){return u(e,0,a,o)},map:function(e){return u(e,0,s,c)},entries:function(e){return d(u(e,0,s,c),0)},key:function(t){return e.push(t),l},sortKeys:function(n){return t[e.length-1]=n,l},sortValues:function(e){return n=e,l},rollup:function(e){return i=e,l}}}function a(){return{}}function o(e,t,n){e[t]=n}function s(){return r()}function c(e,t,n){e.set(t,n)}function l(){}var u=r.prototype;l.prototype=d.prototype={constructor:l,has:u.has,add:function(e){return e+=``,this[t+e]=e,this},remove:u.remove,clear:u.clear,values:u.keys,size:u.size,empty:u.empty,each:u.each};function d(e,t){var n=new l;if(e instanceof l)e.each(function(e){n.add(e)});else if(e){var r=-1,i=e.length;if(t==null)for(;++r<i;)n.add(e[r]);else for(;++r<i;)n.add(t(e[r],r,e))}return n}function f(e){var t=[];for(var n in e)t.push(n);return t}function p(e){var t=[];for(var n in e)t.push(e[n]);return t}function m(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t}e.nest=i,e.set=d,e.map=r,e.keys=f,e.values=p,e.entries=m,Object.defineProperty(e,`__esModule`,{value:!0})})}),lS=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):(n||=self,r(n.d3=n.d3||{}))})(e,function(e){var t={value:function(){}};function n(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+``)||i in n||/[\s.]/.test(i))throw Error(`illegal type: `+i);n[i]=[]}return new r(n)}function r(e){this._=e}function i(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}r.prototype=n.prototype={constructor:r,on:function(e,t){var n=this._,r=i(e+``,n),s,c=-1,l=r.length;if(arguments.length<2){for(;++c<l;)if((s=(e=r[c]).type)&&(s=a(n[s],e.name)))return s;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++c<l;)if(s=(e=r[c]).type)n[s]=o(n[s],e.name,t);else if(t==null)for(s in n)n[s]=o(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new r(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function a(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function o(e,n,r){for(var i=0,a=e.length;i<a;++i)if(e[i].name===n){e[i]=t,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:n,value:r}),e}e.dispatch=n,Object.defineProperty(e,`__esModule`,{value:!0})})}),uS=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):(n||=self,r(n.d3=n.d3||{}))})(e,function(e){var t=0,n=0,r=0,i=1e3,a,o,s=0,c=0,l=0,u=typeof performance==`object`&&performance.now?performance:Date,d=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function f(){return c||=(d(p),u.now()+l)}function p(){c=0}function m(){this._call=this._time=this._next=null}m.prototype=h.prototype={constructor:m,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?f():+n)+(t==null?0:+t),!this._next&&o!==this&&(o?o._next=this:a=this,o=this),this._call=e,this._time=n,b()},stop:function(){this._call&&(this._call=null,this._time=1/0,b())}};function h(e,t,n){var r=new m;return r.restart(e,t,n),r}function g(){f(),++t;for(var e=a,n;e;)(n=c-e._time)>=0&&e._call.call(null,n),e=e._next;--t}function _(){c=(s=u.now())+l,t=n=0;try{g()}finally{t=0,y(),c=0}}function v(){var e=u.now(),t=e-s;t>i&&(l-=t,s=e)}function y(){for(var e,t=a,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:a=n);o=e,b(r)}function b(e){t||(n&&=clearTimeout(n),e-c>24?(e<1/0&&(n=setTimeout(_,e-u.now()-l)),r&&=clearInterval(r)):(r||=(s=u.now(),setInterval(v,i)),t=1,d(_)))}function x(e,t,n){var r=new m;return t=t==null?0:+t,r.restart(function(n){r.stop(),e(n+t)},t,n),r}function S(e,t,n){var r=new m,i=t;return t==null?(r.restart(e,t,n),r):(t=+t,n=n==null?f():+n,r.restart(function a(o){o+=i,r.restart(a,i+=t,n),e(o)},t,n),r)}e.interval=S,e.now=f,e.timeout=x,e.timer=h,e.timerFlush=g,Object.defineProperty(e,`__esModule`,{value:!0})})}),dS=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e,sS(),cS(),lS(),uS()):r(n.d3=n.d3||{},n.d3,n.d3,n.d3,n.d3)})(e,function(e,t,n,r,i){function a(e,t){var n;e??=0,t??=0;function r(){var r,i=n.length,a,o=0,s=0;for(r=0;r<i;++r)a=n[r],o+=a.x,s+=a.y;for(o=o/i-e,s=s/i-t,r=0;r<i;++r)a=n[r],a.x-=o,a.y-=s}return r.initialize=function(e){n=e},r.x=function(t){return arguments.length?(e=+t,r):e},r.y=function(e){return arguments.length?(t=+e,r):t},r}function o(e){return function(){return e}}function s(){return(Math.random()-.5)*1e-6}function c(e){return e.x+e.vx}function l(e){return e.y+e.vy}function u(e){var n,r,i=1,a=1;typeof e!=`function`&&(e=o(e==null?1:+e));function u(){for(var e,o=n.length,u,f,p,m,h,g,_=0;_<a;++_)for(u=t.quadtree(n,c,l).visitAfter(d),e=0;e<o;++e)f=n[e],h=r[f.index],g=h*h,p=f.x+f.vx,m=f.y+f.vy,u.visit(v);function v(e,t,n,r,a){var o=e.data,c=e.r,l=h+c;if(o){if(o.index>f.index){var u=p-o.x-o.vx,d=m-o.y-o.vy,_=u*u+d*d;_<l*l&&(u===0&&(u=s(),_+=u*u),d===0&&(d=s(),_+=d*d),_=(l-(_=Math.sqrt(_)))/_*i,f.vx+=(u*=_)*(l=(c*=c)/(g+c)),f.vy+=(d*=_)*l,o.vx-=u*(l=1-l),o.vy-=d*l)}return}return t>p+l||r<p-l||n>m+l||a<m-l}}function d(e){if(e.data)return e.r=r[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function f(){if(n){var t,i=n.length,a;for(r=Array(i),t=0;t<i;++t)a=n[t],r[a.index]=+e(a,t,n)}}return u.initialize=function(e){n=e,f()},u.iterations=function(e){return arguments.length?(a=+e,u):a},u.strength=function(e){return arguments.length?(i=+e,u):i},u.radius=function(t){return arguments.length?(e=typeof t==`function`?t:o(+t),f(),u):e},u}function d(e){return e.index}function f(e,t){var n=e.get(t);if(!n)throw Error(`missing: `+t);return n}function p(e){var t=d,r=h,i,a=o(30),c,l,u,p,m=1;e??=[];function h(e){return 1/Math.min(u[e.source.index],u[e.target.index])}function g(t){for(var n=0,r=e.length;n<m;++n)for(var a=0,o,l,u,d,f,h,g;a<r;++a)o=e[a],l=o.source,u=o.target,d=u.x+u.vx-l.x-l.vx||s(),f=u.y+u.vy-l.y-l.vy||s(),h=Math.sqrt(d*d+f*f),h=(h-c[a])/h*t*i[a],d*=h,f*=h,u.vx-=d*(g=p[a]),u.vy-=f*g,l.vx+=d*(g=1-g),l.vy+=f*g}function _(){if(l){var r,a=l.length,o=e.length,s=n.map(l,t),d;for(r=0,u=Array(a);r<o;++r)d=e[r],d.index=r,typeof d.source!=`object`&&(d.source=f(s,d.source)),typeof d.target!=`object`&&(d.target=f(s,d.target)),u[d.source.index]=(u[d.source.index]||0)+1,u[d.target.index]=(u[d.target.index]||0)+1;for(r=0,p=Array(o);r<o;++r)d=e[r],p[r]=u[d.source.index]/(u[d.source.index]+u[d.target.index]);i=Array(o),v(),c=Array(o),y()}}function v(){if(l)for(var t=0,n=e.length;t<n;++t)i[t]=+r(e[t],t,e)}function y(){if(l)for(var t=0,n=e.length;t<n;++t)c[t]=+a(e[t],t,e)}return g.initialize=function(e){l=e,_()},g.links=function(t){return arguments.length?(e=t,_(),g):e},g.id=function(e){return arguments.length?(t=e,g):t},g.iterations=function(e){return arguments.length?(m=+e,g):m},g.strength=function(e){return arguments.length?(r=typeof e==`function`?e:o(+e),v(),g):r},g.distance=function(e){return arguments.length?(a=typeof e==`function`?e:o(+e),y(),g):a},g}function m(e){return e.x}function h(e){return e.y}var g=10,_=Math.PI*(3-Math.sqrt(5));function v(e){var t,a=1,o=.001,s=1-o**(1/300),c=0,l=.6,u=n.map(),d=i.timer(p),f=r.dispatch(`tick`,`end`);e??=[];function p(){m(),f.call(`tick`,t),a<o&&(d.stop(),f.call(`end`,t))}function m(n){var r,i=e.length,o;n===void 0&&(n=1);for(var d=0;d<n;++d)for(a+=(c-a)*s,u.each(function(e){e(a)}),r=0;r<i;++r)o=e[r],o.fx==null?o.x+=o.vx*=l:(o.x=o.fx,o.vx=0),o.fy==null?o.y+=o.vy*=l:(o.y=o.fy,o.vy=0);return t}function h(){for(var t=0,n=e.length,r;t<n;++t){if(r=e[t],r.index=t,r.fx!=null&&(r.x=r.fx),r.fy!=null&&(r.y=r.fy),isNaN(r.x)||isNaN(r.y)){var i=g*Math.sqrt(t),a=t*_;r.x=i*Math.cos(a),r.y=i*Math.sin(a)}(isNaN(r.vx)||isNaN(r.vy))&&(r.vx=r.vy=0)}}function v(t){return t.initialize&&t.initialize(e),t}return h(),t={tick:m,restart:function(){return d.restart(p),t},stop:function(){return d.stop(),t},nodes:function(n){return arguments.length?(e=n,h(),u.each(v),t):e},alpha:function(e){return arguments.length?(a=+e,t):a},alphaMin:function(e){return arguments.length?(o=+e,t):o},alphaDecay:function(e){return arguments.length?(s=+e,t):+s},alphaTarget:function(e){return arguments.length?(c=+e,t):c},velocityDecay:function(e){return arguments.length?(l=1-e,t):1-l},force:function(e,n){return arguments.length>1?(n==null?u.remove(e):u.set(e,v(n)),t):u.get(e)},find:function(t,n,r){var i=0,a=e.length,o,s,c,l,u;for(r==null?r=1/0:r*=r,i=0;i<a;++i)l=e[i],o=t-l.x,s=n-l.y,c=o*o+s*s,c<r&&(u=l,r=c);return u},on:function(e,n){return arguments.length>1?(f.on(e,n),t):f.on(e)}}}function y(){var e,n,r,i=o(-30),a,c=1,l=1/0,u=.81;function d(i){var a,o=e.length,s=t.quadtree(e,m,h).visitAfter(p);for(r=i,a=0;a<o;++a)n=e[a],s.visit(g)}function f(){if(e){var t,n=e.length,r;for(a=Array(n),t=0;t<n;++t)r=e[t],a[r.index]=+i(r,t,e)}}function p(e){var t=0,n,r,i=0,o,s,c;if(e.length){for(o=s=c=0;c<4;++c)(n=e[c])&&(r=Math.abs(n.value))&&(t+=n.value,i+=r,o+=r*n.x,s+=r*n.y);e.x=o/i,e.y=s/i}else{n=e,n.x=n.data.x,n.y=n.data.y;do t+=a[n.data.index];while(n=n.next)}e.value=t}function g(e,t,i,o){if(!e.value)return!0;var d=e.x-n.x,f=e.y-n.y,p=o-t,m=d*d+f*f;if(p*p/u<m)return m<l&&(d===0&&(d=s(),m+=d*d),f===0&&(f=s(),m+=f*f),m<c&&(m=Math.sqrt(c*m)),n.vx+=d*e.value*r/m,n.vy+=f*e.value*r/m),!0;if(!(e.length||m>=l)){(e.data!==n||e.next)&&(d===0&&(d=s(),m+=d*d),f===0&&(f=s(),m+=f*f),m<c&&(m=Math.sqrt(c*m)));do e.data!==n&&(p=a[e.data.index]*r/m,n.vx+=d*p,n.vy+=f*p);while(e=e.next)}}return d.initialize=function(t){e=t,f()},d.strength=function(e){return arguments.length?(i=typeof e==`function`?e:o(+e),f(),d):i},d.distanceMin=function(e){return arguments.length?(c=e*e,d):Math.sqrt(c)},d.distanceMax=function(e){return arguments.length?(l=e*e,d):Math.sqrt(l)},d.theta=function(e){return arguments.length?(u=e*e,d):Math.sqrt(u)},d}function b(e,t,n){var r,i=o(.1),a,s;typeof e!=`function`&&(e=o(+e)),t??=0,n??=0;function c(e){for(var i=0,o=r.length;i<o;++i){var c=r[i],l=c.x-t||1e-6,u=c.y-n||1e-6,d=Math.sqrt(l*l+u*u),f=(s[i]-d)*a[i]*e/d;c.vx+=l*f,c.vy+=u*f}}function l(){if(r){var t,n=r.length;for(a=Array(n),s=Array(n),t=0;t<n;++t)s[t]=+e(r[t],t,r),a[t]=isNaN(s[t])?0:+i(r[t],t,r)}}return c.initialize=function(e){r=e,l()},c.strength=function(e){return arguments.length?(i=typeof e==`function`?e:o(+e),l(),c):i},c.radius=function(t){return arguments.length?(e=typeof t==`function`?t:o(+t),l(),c):e},c.x=function(e){return arguments.length?(t=+e,c):t},c.y=function(e){return arguments.length?(n=+e,c):n},c}function x(e){var t=o(.1),n,r,i;typeof e!=`function`&&(e=o(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vx+=(i[t]-o.x)*r[t]*e}function s(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,s()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:o(+e),s(),a):t},a.x=function(t){return arguments.length?(e=typeof t==`function`?t:o(+t),s(),a):e},a}function S(e){var t=o(.1),n,r,i;typeof e!=`function`&&(e=o(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vy+=(i[t]-o.y)*r[t]*e}function s(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,s()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:o(+e),s(),a):t},a.y=function(t){return arguments.length?(e=typeof t==`function`?t:o(+t),s(),a):e},a}e.forceCenter=a,e.forceCollide=u,e.forceLink=p,e.forceManyBody=y,e.forceRadial=b,e.forceSimulation=v,e.forceX=x,e.forceY=S,Object.defineProperty(e,`__esModule`,{value:!0})})}),fS=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):(n||=self,r(n.d3=n.d3||{}))})(e,function(e){var t=Math.PI,n=2*t,r=1e-6,i=n-r;function a(){this._x0=this._y0=this._x1=this._y1=null,this._=``}function o(){return new a}a.prototype=o.prototype={constructor:a,moveTo:function(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,n,i,a,o){e=+e,n=+n,i=+i,a=+a,o=+o;var s=this._x1,c=this._y1,l=i-e,u=a-n,d=s-e,f=c-n,p=d*d+f*f;if(o<0)throw Error(`negative radius: `+o);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=n);else if(p>r)if(!(Math.abs(f*l-u*d)>r)||!o)this._+=`L`+(this._x1=e)+`,`+(this._y1=n);else{var m=i-s,h=a-c,g=l*l+u*u,_=m*m+h*h,v=Math.sqrt(g),y=Math.sqrt(p),b=o*Math.tan((t-Math.acos((g+p-_)/(2*v*y)))/2),x=b/y,S=b/v;Math.abs(x-1)>r&&(this._+=`L`+(e+x*d)+`,`+(n+x*f)),this._+=`A`+o+`,`+o+`,0,0,`+ +(f*m>d*h)+`,`+(this._x1=e+S*l)+`,`+(this._y1=n+S*u)}},arc:function(e,a,o,s,c,l){e=+e,a=+a,o=+o,l=!!l;var u=o*Math.cos(s),d=o*Math.sin(s),f=e+u,p=a+d,m=1^l,h=l?s-c:c-s;if(o<0)throw Error(`negative radius: `+o);this._x1===null?this._+=`M`+f+`,`+p:(Math.abs(this._x1-f)>r||Math.abs(this._y1-p)>r)&&(this._+=`L`+f+`,`+p),o&&(h<0&&(h=h%n+n),h>i?this._+=`A`+o+`,`+o+`,0,1,`+m+`,`+(e-u)+`,`+(a-d)+`A`+o+`,`+o+`,0,1,`+m+`,`+(this._x1=f)+`,`+(this._y1=p):h>r&&(this._+=`A`+o+`,`+o+`,0,`+ +(h>=t)+`,`+m+`,`+(this._x1=e+o*Math.cos(c))+`,`+(this._y1=a+o*Math.sin(c))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}},e.path=o,Object.defineProperty(e,`__esModule`,{value:!0})})}),pS=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e,fS()):(n||=self,r(n.d3=n.d3||{},n.d3))})(e,function(e,t){function n(e){return function(){return e}}var r=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,s=Math.min,c=Math.sin,l=Math.sqrt,u=1e-12,d=Math.PI,f=d/2,p=2*d;function m(e){return e>1?0:e<-1?d:Math.acos(e)}function h(e){return e>=1?f:e<=-1?-f:Math.asin(e)}function g(e){return e.innerRadius}function _(e){return e.outerRadius}function v(e){return e.startAngle}function y(e){return e.endAngle}function b(e){return e&&e.padAngle}function x(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,d=o-i,f=s-a,p=f*c-d*l;if(!(p*p<u))return p=(d*(t-a)-f*(e-i))/p,[e+p*c,t+p*l]}function S(e,t,n,r,i,a,s){var c=e-n,u=t-r,d=(s?a:-a)/l(c*c+u*u),f=d*u,p=-d*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*l(o(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function C(){var e=g,o=_,C=n(0),w=null,T=v,E=y,D=b,O=null;function k(){var n,g,_=+e.apply(this,arguments),v=+o.apply(this,arguments),y=T.apply(this,arguments)-f,b=E.apply(this,arguments)-f,k=r(b-y),A=b>y;if(O||=n=t.path(),v<_&&(g=v,v=_,_=g),!(v>u))O.moveTo(0,0);else if(k>p-u)O.moveTo(v*a(y),v*c(y)),O.arc(0,0,v,y,b,!A),_>u&&(O.moveTo(_*a(b),_*c(b)),O.arc(0,0,_,b,y,A));else{var j=y,M=b,N=y,P=b,F=k,I=k,L=D.apply(this,arguments)/2,R=L>u&&(w?+w.apply(this,arguments):l(_*_+v*v)),z=s(r(v-_)/2,+C.apply(this,arguments)),B=z,V=z,H,U;if(R>u){var W=h(R/_*c(L)),G=h(R/v*c(L));(F-=W*2)>u?(W*=A?1:-1,N+=W,P-=W):(F=0,N=P=(y+b)/2),(I-=G*2)>u?(G*=A?1:-1,j+=G,M-=G):(I=0,j=M=(y+b)/2)}var K=v*a(j),q=v*c(j),J=_*a(P),Y=_*c(P);if(z>u){var X=v*a(M),Z=v*c(M),Q=_*a(N),ee=_*c(N),te;if(k<d&&(te=x(K,q,Q,ee,X,Z,J,Y))){var ne=K-te[0],re=q-te[1],ie=X-te[0],ae=Z-te[1],oe=1/c(m((ne*ie+re*ae)/(l(ne*ne+re*re)*l(ie*ie+ae*ae)))/2),se=l(te[0]*te[0]+te[1]*te[1]);B=s(z,(_-se)/(oe-1)),V=s(z,(v-se)/(oe+1))}}I>u?V>u?(H=S(Q,ee,K,q,v,V,A),U=S(X,Z,J,Y,v,V,A),O.moveTo(H.cx+H.x01,H.cy+H.y01),V<z?O.arc(H.cx,H.cy,V,i(H.y01,H.x01),i(U.y01,U.x01),!A):(O.arc(H.cx,H.cy,V,i(H.y01,H.x01),i(H.y11,H.x11),!A),O.arc(0,0,v,i(H.cy+H.y11,H.cx+H.x11),i(U.cy+U.y11,U.cx+U.x11),!A),O.arc(U.cx,U.cy,V,i(U.y11,U.x11),i(U.y01,U.x01),!A))):(O.moveTo(K,q),O.arc(0,0,v,j,M,!A)):O.moveTo(K,q),!(_>u)||!(F>u)?O.lineTo(J,Y):B>u?(H=S(J,Y,X,Z,_,-B,A),U=S(K,q,Q,ee,_,-B,A),O.lineTo(H.cx+H.x01,H.cy+H.y01),B<z?O.arc(H.cx,H.cy,B,i(H.y01,H.x01),i(U.y01,U.x01),!A):(O.arc(H.cx,H.cy,B,i(H.y01,H.x01),i(H.y11,H.x11),!A),O.arc(0,0,_,i(H.cy+H.y11,H.cx+H.x11),i(U.cy+U.y11,U.cx+U.x11),A),O.arc(U.cx,U.cy,B,i(U.y11,U.x11),i(U.y01,U.x01),!A))):O.arc(0,0,_,P,N,A)}if(O.closePath(),n)return O=null,n+``||null}return k.centroid=function(){var t=(+e.apply(this,arguments)+ +o.apply(this,arguments))/2,n=(+T.apply(this,arguments)+ +E.apply(this,arguments))/2-d/2;return[a(n)*t,c(n)*t]},k.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:n(+t),k):e},k.outerRadius=function(e){return arguments.length?(o=typeof e==`function`?e:n(+e),k):o},k.cornerRadius=function(e){return arguments.length?(C=typeof e==`function`?e:n(+e),k):C},k.padRadius=function(e){return arguments.length?(w=e==null?null:typeof e==`function`?e:n(+e),k):w},k.startAngle=function(e){return arguments.length?(T=typeof e==`function`?e:n(+e),k):T},k.endAngle=function(e){return arguments.length?(E=typeof e==`function`?e:n(+e),k):E},k.padAngle=function(e){return arguments.length?(D=typeof e==`function`?e:n(+e),k):D},k.context=function(e){return arguments.length?(O=e??null,k):O},k}function w(e){this._context=e}w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function T(e){return new w(e)}function E(e){return e[0]}function D(e){return e[1]}function O(){var e=E,r=D,i=n(!0),a=null,o=T,s=null;function c(n){var c,l=n.length,u,d=!1,f;for(a??(s=o(f=t.path())),c=0;c<=l;++c)!(c<l&&i(u=n[c],c,n))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(u,c,n),+r(u,c,n));if(f)return s=null,f+``||null}return c.x=function(t){return arguments.length?(e=typeof t==`function`?t:n(+t),c):e},c.y=function(e){return arguments.length?(r=typeof e==`function`?e:n(+e),c):r},c.defined=function(e){return arguments.length?(i=typeof e==`function`?e:n(!!e),c):i},c.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),c):o},c.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),c):a},c}function k(){var e=E,r=null,i=n(0),a=D,o=n(!0),s=null,c=T,l=null;function u(n){var u,d,f,p=n.length,m,h=!1,g,_=Array(p),v=Array(p);for(s??(l=c(g=t.path())),u=0;u<=p;++u){if(!(u<p&&o(m=n[u],u,n))===h)if(h=!h)d=u,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),f=u-1;f>=d;--f)l.point(_[f],v[f]);l.lineEnd(),l.areaEnd()}h&&(_[u]=+e(m,u,n),v[u]=+i(m,u,n),l.point(r?+r(m,u,n):_[u],a?+a(m,u,n):v[u]))}if(g)return l=null,g+``||null}function d(){return O().defined(o).curve(c).context(s)}return u.x=function(t){return arguments.length?(e=typeof t==`function`?t:n(+t),r=null,u):e},u.x0=function(t){return arguments.length?(e=typeof t==`function`?t:n(+t),u):e},u.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:n(+e),u):r},u.y=function(e){return arguments.length?(i=typeof e==`function`?e:n(+e),a=null,u):i},u.y0=function(e){return arguments.length?(i=typeof e==`function`?e:n(+e),u):i},u.y1=function(e){return arguments.length?(a=e==null?null:typeof e==`function`?e:n(+e),u):a},u.lineX0=u.lineY0=function(){return d().x(e).y(i)},u.lineY1=function(){return d().x(e).y(a)},u.lineX1=function(){return d().x(r).y(i)},u.defined=function(e){return arguments.length?(o=typeof e==`function`?e:n(!!e),u):o},u.curve=function(e){return arguments.length?(c=e,s!=null&&(l=c(s)),u):c},u.context=function(e){return arguments.length?(e==null?s=l=null:l=c(s=e),u):s},u}function A(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function j(e){return e}function M(){var e=j,t=A,r=null,i=n(0),a=n(p),o=n(0);function s(n){var s,c=n.length,l,u,d=0,f=Array(c),m=Array(c),h=+i.apply(this,arguments),g=Math.min(p,Math.max(-p,a.apply(this,arguments)-h)),_,v=Math.min(Math.abs(g)/c,o.apply(this,arguments)),y=v*(g<0?-1:1),b;for(s=0;s<c;++s)(b=m[f[s]=s]=+e(n[s],s,n))>0&&(d+=b);for(t==null?r!=null&&f.sort(function(e,t){return r(n[e],n[t])}):f.sort(function(e,n){return t(m[e],m[n])}),s=0,u=d?(g-c*y)/d:0;s<c;++s,h=_)l=f[s],b=m[l],_=h+(b>0?b*u:0)+y,m[l]={data:n[l],index:s,value:b,startAngle:h,endAngle:_,padAngle:v};return m}return s.value=function(t){return arguments.length?(e=typeof t==`function`?t:n(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,r=null,s):t},s.sort=function(e){return arguments.length?(r=e,t=null,s):r},s.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:n(+e),s):i},s.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:n(+e),s):a},s.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:n(+e),s):o},s}var N=F(T);function P(e){this._curve=e}P.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function F(e){function t(t){return new P(e(t))}return t._curve=e,t}function I(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(e){return arguments.length?t(F(e)):t()._curve},e}function L(){return I(O().curve(N))}function R(){var e=k().curve(N),t=e.curve,n=e.lineX0,r=e.lineX1,i=e.lineY0,a=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return I(n())},delete e.lineX0,e.lineEndAngle=function(){return I(r())},delete e.lineX1,e.lineInnerRadius=function(){return I(i())},delete e.lineY0,e.lineOuterRadius=function(){return I(a())},delete e.lineY1,e.curve=function(e){return arguments.length?t(F(e)):t()._curve},e}function z(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}var B=Array.prototype.slice;function V(e){return e.source}function H(e){return e.target}function U(e){var r=V,i=H,a=E,o=D,s=null;function c(){var n,c=B.call(arguments),l=r.apply(this,c),u=i.apply(this,c);if(s||=n=t.path(),e(s,+a.apply(this,(c[0]=l,c)),+o.apply(this,c),+a.apply(this,(c[0]=u,c)),+o.apply(this,c)),n)return s=null,n+``||null}return c.source=function(e){return arguments.length?(r=e,c):r},c.target=function(e){return arguments.length?(i=e,c):i},c.x=function(e){return arguments.length?(a=typeof e==`function`?e:n(+e),c):a},c.y=function(e){return arguments.length?(o=typeof e==`function`?e:n(+e),c):o},c.context=function(e){return arguments.length?(s=e??null,c):s},c}function W(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function G(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t,n=(n+i)/2,r,n,r,i)}function K(e,t,n,r,i){var a=z(t,n),o=z(t,n=(n+i)/2),s=z(r,n),c=z(r,i);e.moveTo(a[0],a[1]),e.bezierCurveTo(o[0],o[1],s[0],s[1],c[0],c[1])}function q(){return U(W)}function J(){return U(G)}function Y(){var e=U(K);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}var X={draw:function(e,t){var n=Math.sqrt(t/d);e.moveTo(n,0),e.arc(0,0,n,0,p)}},Z={draw:function(e,t){var n=Math.sqrt(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Q=Math.sqrt(1/3),ee=Q*2,te={draw:function(e,t){var n=Math.sqrt(t/ee),r=n*Q;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ne=.8908130915292852,re=Math.sin(d/10)/Math.sin(7*d/10),ie=Math.sin(p/10)*re,ae=-Math.cos(p/10)*re,oe={draw:function(e,t){var n=Math.sqrt(t*ne),r=ie*n,i=ae*n;e.moveTo(0,-n),e.lineTo(r,i);for(var a=1;a<5;++a){var o=p*a/5,s=Math.cos(o),c=Math.sin(o);e.lineTo(c*n,-s*n),e.lineTo(s*r-c*i,c*r+s*i)}e.closePath()}},se={draw:function(e,t){var n=Math.sqrt(t),r=-n/2;e.rect(r,r,n,n)}},ce=Math.sqrt(3),le={draw:function(e,t){var n=-Math.sqrt(t/(ce*3));e.moveTo(0,n*2),e.lineTo(-ce*n,-n),e.lineTo(ce*n,-n),e.closePath()}},ue=-.5,de=Math.sqrt(3)/2,fe=1/Math.sqrt(12),pe=(fe/2+1)*3,me={draw:function(e,t){var n=Math.sqrt(t/pe),r=n/2,i=n*fe,a=r,o=n*fe+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(ue*r-de*i,de*r+ue*i),e.lineTo(ue*a-de*o,de*a+ue*o),e.lineTo(ue*s-de*c,de*s+ue*c),e.lineTo(ue*r+de*i,ue*i-de*r),e.lineTo(ue*a+de*o,ue*o-de*a),e.lineTo(ue*s+de*c,ue*c-de*s),e.closePath()}},he=[X,Z,te,se,oe,le,me];function ge(){var e=n(X),r=n(64),i=null;function a(){var n;if(i||=n=t.path(),e.apply(this,arguments).draw(i,+r.apply(this,arguments)),n)return i=null,n+``||null}return a.type=function(t){return arguments.length?(e=typeof t==`function`?t:n(t),a):e},a.size=function(e){return arguments.length?(r=typeof e==`function`?e:n(+e),a):r},a.context=function(e){return arguments.length?(i=e??null,a):i},a}function _e(){}function ve(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function ye(e){this._context=e}ye.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:ve(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ve(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function be(e){return new ye(e)}function xe(e){this._context=e}xe.prototype={areaStart:_e,areaEnd:_e,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ve(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Se(e){return new xe(e)}function Ce(e){this._context=e}Ce.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ve(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function we(e){return new Ce(e)}function Te(e,t){this._basis=new ye(e),this._beta=t}Te.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var Ee=function e(t){function n(e){return t===1?new ye(e):new Te(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function De(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Oe(e,t){this._context=e,this._k=(1-t)/6}Oe.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:De(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:De(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ke=function e(t){function n(e){return new Oe(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Ae(e,t){this._context=e,this._k=(1-t)/6}Ae.prototype={areaStart:_e,areaEnd:_e,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:De(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var je=function e(t){function n(e){return new Ae(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Me(e,t){this._context=e,this._k=(1-t)/6}Me.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:De(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Ne=function e(t){function n(e){return new Me(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Pe(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>u){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>u){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,d=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/d,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/d}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function Fe(e,t){this._context=e,this._alpha=t}Fe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Pe(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Ie=function e(t){function n(e){return t?new Fe(e,t):new Oe(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Le(e,t){this._context=e,this._alpha=t}Le.prototype={areaStart:_e,areaEnd:_e,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Pe(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Re=function e(t){function n(e){return t?new Le(e,t):new Ae(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function ze(e,t){this._context=e,this._alpha=t}ze.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Pe(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Be=function e(t){function n(e){return t?new ze(e,t):new Me(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Ve(e){this._context=e}Ve.prototype={areaStart:_e,areaEnd:_e,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function He(e){return new Ve(e)}function Ue(e){return e<0?-1:1}function We(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Ue(a)+Ue(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Ge(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Ke(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function qe(e){this._context=e}qe.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:Ke(this,this._t0,Ge(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ke(this,Ge(this,n=We(this,e,t)),n);break;default:Ke(this,this._t0,n=We(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Je(e){this._context=new Ye(e)}(Je.prototype=Object.create(qe.prototype)).point=function(e,t){qe.prototype.point.call(this,t,e)};function Ye(e){this._context=e}Ye.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Xe(e){return new qe(e)}function Ze(e){return new Je(e)}function Qe(e){this._context=e}Qe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=$e(e),i=$e(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function $e(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function et(e){return new Qe(e)}function tt(e,t){this._context=e,this._t=t}tt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function nt(e){return new tt(e,.5)}function rt(e){return new tt(e,0)}function it(e){return new tt(e,1)}function at(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function ot(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function st(e,t){return e[t]}function ct(){var e=n([]),t=ot,r=at,i=st;function a(n){var a=e.apply(this,arguments),o,s=n.length,c=a.length,l=Array(c),u;for(o=0;o<c;++o){for(var d=a[o],f=l[o]=Array(s),p=0,m;p<s;++p)f[p]=m=[0,+i(n[p],d,p,n)],m.data=n[p];f.key=d}for(o=0,u=t(l);o<c;++o)l[u[o]].index=o;return r(l,u),l}return a.keys=function(t){return arguments.length?(e=typeof t==`function`?t:n(B.call(t)),a):e},a.value=function(e){return arguments.length?(i=typeof e==`function`?e:n(+e),a):i},a.order=function(e){return arguments.length?(t=e==null?ot:typeof e==`function`?e:n(B.call(e)),a):t},a.offset=function(e){return arguments.length?(r=e??at,a):r},a}function lt(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}at(e,t)}}function ut(e,t){if((c=e.length)>0)for(var n,r=0,i,a,o,s,c,l=e[t[0]].length;r<l;++r)for(o=s=0,n=0;n<c;++n)(a=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=o,i[1]=o+=a):a<0?(i[1]=s,i[0]=s+=a):(i[0]=0,i[1]=a)}function $(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}at(e,t)}}function dt(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,at(e,t)}}function ft(e){var t=e.map(pt);return ot(e).sort(function(e,n){return t[e]-t[n]})}function pt(e){for(var t=-1,n=0,r=e.length,i,a=-1/0;++t<r;)(i=+e[t][1])>a&&(a=i,n=t);return n}function mt(e){var t=e.map(ht);return ot(e).sort(function(e,n){return t[e]-t[n]})}function ht(e){for(var t=0,n=-1,r=e.length,i;++n<r;)(i=+e[n][1])&&(t+=i);return t}function gt(e){return mt(e).reverse()}function _t(e){var t=e.length,n,r,i=e.map(ht),a=ft(e),o=0,s=0,c=[],l=[];for(n=0;n<t;++n)r=a[n],o<s?(o+=i[r],c.push(r)):(s+=i[r],l.push(r));return l.reverse().concat(c)}function vt(e){return ot(e).reverse()}e.arc=C,e.area=k,e.areaRadial=R,e.curveBasis=be,e.curveBasisClosed=Se,e.curveBasisOpen=we,e.curveBundle=Ee,e.curveCardinal=ke,e.curveCardinalClosed=je,e.curveCardinalOpen=Ne,e.curveCatmullRom=Ie,e.curveCatmullRomClosed=Re,e.curveCatmullRomOpen=Be,e.curveLinear=T,e.curveLinearClosed=He,e.curveMonotoneX=Xe,e.curveMonotoneY=Ze,e.curveNatural=et,e.curveStep=nt,e.curveStepAfter=it,e.curveStepBefore=rt,e.line=O,e.lineRadial=L,e.linkHorizontal=q,e.linkRadial=Y,e.linkVertical=J,e.pie=M,e.pointRadial=z,e.radialArea=R,e.radialLine=L,e.stack=ct,e.stackOffsetDiverging=ut,e.stackOffsetExpand=lt,e.stackOffsetNone=at,e.stackOffsetSilhouette=$,e.stackOffsetWiggle=dt,e.stackOrderAppearance=ft,e.stackOrderAscending=mt,e.stackOrderDescending=gt,e.stackOrderInsideOut=_t,e.stackOrderNone=ot,e.stackOrderReverse=vt,e.symbol=ge,e.symbolCircle=X,e.symbolCross=Z,e.symbolDiamond=te,e.symbolSquare=se,e.symbolStar=oe,e.symbolTriangle=le,e.symbolWye=me,e.symbols=he,Object.defineProperty(e,`__esModule`,{value:!0})})}),mS=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e,Bg(),cS(),pS()):r(n.d3=n.d3||{},n.d3,n.d3,n.d3)})(e,function(e,t,n,r){function i(e){return e.target.depth}function a(e){return e.depth}function o(e,t){return t-1-e.height}function s(e,t){return e.sourceLinks.length?e.depth:t-1}function c(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?t.min(e.sourceLinks,i)-1:0}function l(e){return function(){return e}}function u(e,t){return f(e.source,t.source)||e.index-t.index}function d(e,t){return f(e.target,t.target)||e.index-t.index}function f(e,t){return e.y0-t.y0}function p(e){return e.value}function m(e){return(e.y0+e.y1)/2}function h(e){return m(e.source)*e.value}function g(e){return m(e.target)*e.value}function _(e){return e.index}function v(e){return e.nodes}function y(e){return e.links}function b(e,t){var n=e.get(t);if(!n)throw Error(`missing: `+t);return n}var x=function(){var e=0,r=0,i=1,a=1,o=24,c=8,x=_,S=s,C=v,w=y,T=32,E=2/3;function D(){var e={nodes:C.apply(null,arguments),links:w.apply(null,arguments)};return O(e),k(e),A(e),j(e,T),M(e),e}D.update=function(e){return M(e),e},D.nodeId=function(e){return arguments.length?(x=typeof e==`function`?e:l(e),D):x},D.nodeAlign=function(e){return arguments.length?(S=typeof e==`function`?e:l(e),D):S},D.nodeWidth=function(e){return arguments.length?(o=+e,D):o},D.nodePadding=function(e){return arguments.length?(c=+e,D):c},D.nodes=function(e){return arguments.length?(C=typeof e==`function`?e:l(e),D):C},D.links=function(e){return arguments.length?(w=typeof e==`function`?e:l(e),D):w},D.size=function(t){return arguments.length?(e=r=0,i=+t[0],a=+t[1],D):[i-e,a-r]},D.extent=function(t){return arguments.length?(e=+t[0][0],i=+t[1][0],r=+t[0][1],a=+t[1][1],D):[[e,r],[i,a]]},D.iterations=function(e){return arguments.length?(T=+e,D):T};function O(e){e.nodes.forEach(function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]});var t=n.map(e.nodes,x);e.links.forEach(function(e,n){e.index=n;var r=e.source,i=e.target;typeof r!=`object`&&(r=e.source=b(t,r)),typeof i!=`object`&&(i=e.target=b(t,i)),r.sourceLinks.push(e),i.targetLinks.push(e)})}function k(e){e.nodes.forEach(function(e){e.value=Math.max(t.sum(e.sourceLinks,p),t.sum(e.targetLinks,p))})}function A(t){var n,r,a;for(n=t.nodes,r=[],a=0;n.length;++a,n=r,r=[])n.forEach(function(e){e.depth=a,e.sourceLinks.forEach(function(e){r.indexOf(e.target)<0&&r.push(e.target)})});for(n=t.nodes,r=[],a=0;n.length;++a,n=r,r=[])n.forEach(function(e){e.height=a,e.targetLinks.forEach(function(e){r.indexOf(e.source)<0&&r.push(e.source)})});var s=(i-e-o)/(a-1);t.nodes.forEach(function(t){t.x1=(t.x0=e+Math.max(0,Math.min(a-1,Math.floor(S.call(null,t,a))))*s)+o})}function j(e){var i=n.nest().key(function(e){return e.x0}).sortKeys(t.ascending).entries(e.nodes).map(function(e){return e.values});l(),_();for(var o=1,s=T;s>0;--s)d(o*=.99),_(),u(o),_();function l(){var n=t.max(i,function(e){return e.length}),o=E*(a-r)/(n-1);c>o&&(c=o);var s=t.min(i,function(e){return(a-r-(e.length-1)*c)/t.sum(e,p)});i.forEach(function(e){e.forEach(function(e,t){e.y1=(e.y0=t)+e.value*s})}),e.links.forEach(function(e){e.width=e.value*s})}function u(e){i.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var r=(t.sum(n.targetLinks,h)/t.sum(n.targetLinks,p)-m(n))*e;n.y0+=r,n.y1+=r}})})}function d(e){i.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var r=(t.sum(n.sourceLinks,g)/t.sum(n.sourceLinks,p)-m(n))*e;n.y0+=r,n.y1+=r}})})}function _(){i.forEach(function(e){var t,n,i=r,o=e.length,s;for(e.sort(f),s=0;s<o;++s)t=e[s],n=i-t.y0,n>0&&(t.y0+=n,t.y1+=n),i=t.y1+c;if(n=i-c-a,n>0)for(i=t.y0-=n,t.y1-=n,s=o-2;s>=0;--s)t=e[s],n=t.y1+c-i,n>0&&(t.y0-=n,t.y1-=n),i=t.y0})}}function M(e){e.nodes.forEach(function(e){e.sourceLinks.sort(d),e.targetLinks.sort(u)}),e.nodes.forEach(function(e){var t=e.y0,n=t;e.sourceLinks.forEach(function(e){e.y0=t+e.width/2,t+=e.width}),e.targetLinks.forEach(function(e){e.y1=n+e.width/2,n+=e.width})})}return D};function S(e){return[e.source.x1,e.y0]}function C(e){return[e.target.x0,e.y1]}e.sankey=x,e.sankeyCenter=c,e.sankeyLeft=a,e.sankeyRight=o,e.sankeyJustify=s,e.sankeyLinkHorizontal=function(){return r.linkHorizontal().source(S).target(C)},Object.defineProperty(e,`__esModule`,{value:!0})})}),hS=h((e,t)=>{var n=aS();t.exports=function(e,t){var r=[],i=[],a=[],o={},s=[],c;function l(e){a[e]=!1,o.hasOwnProperty(e)&&Object.keys(o[e]).forEach(function(t){delete o[e][t],a[t]&&l(t)})}function u(e){var t=!1;i.push(e),a[e]=!0;var n,r;for(n=0;n<s[e].length;n++)r=s[e][n],r===c?(d(c,i),t=!0):a[r]||(t=u(r));if(t)l(e);else for(n=0;n<s[e].length;n++){r=s[e][n];var f=o[r];f||(f={},o[r]=f),f[r]=!0}return i.pop(),t}function d(e,n){var i=[].concat(n,e);t?t(u):r.push(i)}function f(t){for(var n=0;n<e.length;n++)n<t&&(e[n]=[]),e[n]=e[n].filter(function(e){return e>=t})}function p(t){f(t);for(var r=n(e).components.filter(function(e){return e.length>1}),i=1/0,a,o=0;o<r.length;o++)for(var s=0;s<r[o].length;s++)r[o][s]<i&&(i=r[o][s],a=o);var c=r[a];if(!c)return!1;var l=e.map(function(e,t){return c.indexOf(t)===-1?[]:e.filter(function(e){return c.indexOf(e)!==-1})});return{leastVertex:i,adjList:l}}c=0;for(var m=e.length;c<m;){var h=p(c);if(c=h.leastVertex,s=h.adjList,s){for(var g=0;g<s.length;g++)for(var _=0;_<s[g].length;_++){var v=s[g][_];a[+v]=!1,o[v]={}}u(c),c+=1}else c=m}if(!t)return r}}),gS=h((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e,Bg(),cS(),pS(),hS()):r(n.d3=n.d3||{},n.d3,n.d3,n.d3,null)})(e,function(e,t,n,r,i){i=i&&i.hasOwnProperty(`default`)?i.default:i;function a(e){return e.target.depth}function o(e){return e.depth}function s(e,t){return t-1-e.height}function c(e,t){return e.sourceLinks.length?e.depth:t-1}function l(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?t.min(e.sourceLinks,a)-1:0}function u(e){return function(){return e}}var d=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e};function f(e,t){return m(e.source,t.source)||e.index-t.index}function p(e,t){return m(e.target,t.target)||e.index-t.index}function m(e,t){return e.partOfCycle===t.partOfCycle?e.y0-t.y0:e.circularLinkType===`top`||t.circularLinkType===`bottom`?-1:1}function h(e){return e.value}function g(e){return(e.y0+e.y1)/2}function _(e){return g(e.source)}function v(e){return g(e.target)}function y(e){return e.index}function b(e){return e.nodes}function x(e){return e.links}function S(e,t){var n=e.get(t);if(!n)throw Error(`missing: `+t);return n}function C(e,t){return t(e)}var w=25,T=10,E=.3;function D(){var e=0,r=0,i=1,a=1,o=24,s,l=y,C=c,D=b,A=x,j=32,N=2,P,I=null;function L(){var e={nodes:D.apply(null,arguments),links:A.apply(null,arguments)};R(e),O(e,l,I),z(e),H(e),k(e,l),U(e,j,l),W(e);for(var t=4,n=0;n<t;n++)Y(e,a,l),X(e,a,l),K(e,r,a,l),Y(e,a,l),X(e,a,l);return te(e,r,a),F(e,N,a,l),e}L.nodeId=function(e){return arguments.length?(l=typeof e==`function`?e:u(e),L):l},L.nodeAlign=function(e){return arguments.length?(C=typeof e==`function`?e:u(e),L):C},L.nodeWidth=function(e){return arguments.length?(o=+e,L):o},L.nodePadding=function(e){return arguments.length?(s=+e,L):s},L.nodes=function(e){return arguments.length?(D=typeof e==`function`?e:u(e),L):D},L.links=function(e){return arguments.length?(A=typeof e==`function`?e:u(e),L):A},L.size=function(t){return arguments.length?(e=r=0,i=+t[0],a=+t[1],L):[i-e,a-r]},L.extent=function(t){return arguments.length?(e=+t[0][0],i=+t[1][0],r=+t[0][1],a=+t[1][1],L):[[e,r],[i,a]]},L.iterations=function(e){return arguments.length?(j=+e,L):j},L.circularLinkGap=function(e){return arguments.length?(N=+e,L):N},L.nodePaddingRatio=function(e){return arguments.length?(P=+e,L):P},L.sortNodes=function(e){return arguments.length?(I=e,L):I},L.update=function(e){return k(e,l),W(e),e.links.forEach(function(e){e.circular&&(e.circularLinkType=e.y0+e.y1<a?`top`:`bottom`,e.source.circularLinkType=e.circularLinkType,e.target.circularLinkType=e.circularLinkType)}),Y(e,a,l,!1),X(e,a,l),F(e,N,a,l),e};function R(e){e.nodes.forEach(function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]});var t=n.map(e.nodes,l);return e.links.forEach(function(e,n){e.index=n;var r=e.source,i=e.target;(r===void 0?`undefined`:d(r))!==`object`&&(r=e.source=S(t,r)),(i===void 0?`undefined`:d(i))!==`object`&&(i=e.target=S(t,i)),r.sourceLinks.push(e),i.targetLinks.push(e)}),e}function z(e){e.nodes.forEach(function(e){e.partOfCycle=!1,e.value=Math.max(t.sum(e.sourceLinks,h),t.sum(e.targetLinks,h)),e.sourceLinks.forEach(function(t){t.circular&&(e.partOfCycle=!0,e.circularLinkType=t.circularLinkType)}),e.targetLinks.forEach(function(t){t.circular&&(e.partOfCycle=!0,e.circularLinkType=t.circularLinkType)})})}function B(e){var n=0,r=0,i=0,a=0,o=t.max(e.nodes,function(e){return e.column});return e.links.forEach(function(e){e.circular&&(e.circularLinkType==`top`?n+=e.width:r+=e.width,e.target.column==0&&(a+=e.width),e.source.column==o&&(i+=e.width))}),n=n>0?n+w+T:n,r=r>0?r+w+T:r,i=i>0?i+w+T:i,a=a>0?a+w+T:a,{top:n,bottom:r,left:a,right:i}}function V(n,s){var c=t.max(n.nodes,function(e){return e.column}),l=i-e,u=a-r,d=l+s.right+s.left,f=u+s.top+s.bottom,p=l/d,m=u/f;return e=e*p+s.left,i=s.right==0?i:i*p,r=r*m+s.top,a*=m,n.nodes.forEach(function(t){t.x0=e+t.column*((i-e-o)/c),t.x1=t.x0+o}),m}function H(e){var t,n,r;for(t=e.nodes,n=[],r=0;t.length;++r,t=n,n=[])t.forEach(function(e){e.depth=r,e.sourceLinks.forEach(function(e){n.indexOf(e.target)<0&&!e.circular&&n.push(e.target)})});for(t=e.nodes,n=[],r=0;t.length;++r,t=n,n=[])t.forEach(function(e){e.height=r,e.targetLinks.forEach(function(e){n.indexOf(e.source)<0&&!e.circular&&n.push(e.source)})});e.nodes.forEach(function(e){e.column=Math.floor(C.call(null,e,r))})}function U(e,i,o){var c=n.nest().key(function(e){return e.column}).sortKeys(t.ascending).entries(e.nodes).map(function(e){return e.values});d(o),p();for(var l=1,u=i;u>0;--u)f(l*=.99,o),p();function d(n){if(P){var i=1/0;c.forEach(function(e){var t=a*P/(e.length+1);i=t<i?t:i}),s=i}var o=t.min(c,function(e){return(a-r-(e.length-1)*s)/t.sum(e,h)});o*=E,e.links.forEach(function(e){e.width=e.value*o});var l=B(e),u=V(e,l);o*=u,e.links.forEach(function(e){e.width=e.value*o}),c.forEach(function(e){var t=e.length;e.forEach(function(e,i){e.depth==c.length-1&&t==1||e.depth==0&&t==1?(e.y0=a/2-e.value*o,e.y1=e.y0+e.value*o):e.partOfCycle?M(e,n)==0?(e.y0=a/2+i,e.y1=e.y0+e.value*o):e.circularLinkType==`top`?(e.y0=r+i,e.y1=e.y0+e.value*o):(e.y0=a-e.value*o-i,e.y1=e.y0+e.value*o):l.top==0||l.bottom==0?(e.y0=(a-r)/t*i,e.y1=e.y0+e.value*o):(e.y0=(a-r)/2-t/2+i,e.y1=e.y0+e.value*o)})})}function f(e,n){var r=c.length;c.forEach(function(i){var o=i.length,s=i[0].depth;i.forEach(function(i){var c;if((i.sourceLinks.length||i.targetLinks.length)&&!(i.partOfCycle&&M(i,n)>0))if(s==0&&o==1)c=i.y1-i.y0,i.y0=a/2-c/2,i.y1=a/2+c/2;else if(s==r-1&&o==1)c=i.y1-i.y0,i.y0=a/2-c/2,i.y1=a/2+c/2;else{var l=0,u=t.mean(i.sourceLinks,v),d=t.mean(i.targetLinks,_);l=u&&d?(u+d)/2:u||d;var f=(l-g(i))*e;i.y0+=f,i.y1+=f}})})}function p(){c.forEach(function(e){var t,n,i=r,o=e.length,c;for(e.sort(m),c=0;c<o;++c)t=e[c],n=i-t.y0,n>0&&(t.y0+=n,t.y1+=n),i=t.y1+s;if(n=i-s-a,n>0)for(i=t.y0-=n,t.y1-=n,c=o-2;c>=0;--c)t=e[c],n=t.y1+s-i,n>0&&(t.y0-=n,t.y1-=n),i=t.y0})}}function W(e){e.nodes.forEach(function(e){e.sourceLinks.sort(p),e.targetLinks.sort(f)}),e.nodes.forEach(function(e){var t=e.y0,n=t,r=e.y1,i=r;e.sourceLinks.forEach(function(e){e.circular?(e.y0=r-e.width/2,r-=e.width):(e.y0=t+e.width/2,t+=e.width)}),e.targetLinks.forEach(function(e){e.circular?(e.y1=i-e.width/2,i-=e.width):(e.y1=n+e.width/2,n+=e.width)})})}return L}function O(e,t,n){var r=0;if(n===null){for(var a=[],o=0;o<e.links.length;o++){var s=e.links[o],c=s.source.index,l=s.target.index;a[c]||(a[c]=[]),a[l]||(a[l]=[]),a[c].indexOf(l)===-1&&a[c].push(l)}var u=i(a);u.sort(function(e,t){return e.length-t.length});var d={};for(o=0;o<u.length;o++){var f=u[o].slice(-2);d[f[0]]||(d[f[0]]={}),d[f[0]][f[1]]=!0}e.links.forEach(function(e){var t=e.target.index,n=e.source.index;t===n||d[n]&&d[n][t]?(e.circular=!0,e.circularLinkID=r,r+=1):e.circular=!1})}else e.links.forEach(function(e){e.source[n]<e.target[n]?e.circular=!1:(e.circular=!0,e.circularLinkID=r,r+=1)})}function k(e,t){var n=0,r=0;e.links.forEach(function(i){i.circular&&(i.source.circularLinkType||i.target.circularLinkType?i.circularLinkType=i.source.circularLinkType?i.source.circularLinkType:i.target.circularLinkType:i.circularLinkType=n<r?`top`:`bottom`,i.circularLinkType==`top`?n+=1:r+=1,e.nodes.forEach(function(e){(C(e,t)==C(i.source,t)||C(e,t)==C(i.target,t))&&(e.circularLinkType=i.circularLinkType)}))}),e.links.forEach(function(e){e.circular&&(e.source.circularLinkType==e.target.circularLinkType&&(e.circularLinkType=e.source.circularLinkType),ee(e,t)&&(e.circularLinkType=e.source.circularLinkType))})}function A(e){var t=Math.abs(e.y1-e.y0),n=Math.abs(e.target.x0-e.source.x1);return Math.atan(n/t)}function j(e,t){return e.source.column<t.target.column?!1:!(e.target.column>t.source.column)}function M(e,t){var n=0;e.sourceLinks.forEach(function(e){n=e.circular&&!ee(e,t)?n+1:n});var r=0;return e.targetLinks.forEach(function(e){r=e.circular&&!ee(e,t)?r+1:r}),n+r}function N(e){var t=e.source.sourceLinks,n=0;t.forEach(function(e){n=e.circular?n+1:n});var r=e.target.targetLinks,i=0;return r.forEach(function(e){i=e.circular?i+1:i}),!(n>1||i>1)}function P(e,t,n){return e.sort(L),e.forEach(function(r,i){var a=0;if(ee(r,n)&&N(r))r.circularPathData.verticalBuffer=a+r.width/2;else{for(var o=0;o<i;o++)if(j(e[i],e[o])){var s=e[o].circularPathData.verticalBuffer+e[o].width/2+t;a=s>a?s:a}r.circularPathData.verticalBuffer=a+r.width/2}}),e}function F(e,n,i,a){var o=5,s=t.min(e.links,function(e){return e.source.y0});e.links.forEach(function(e){e.circular&&(e.circularPathData={})}),P(e.links.filter(function(e){return e.circularLinkType==`top`}),n,a),P(e.links.filter(function(e){return e.circularLinkType==`bottom`}),n,a),e.links.forEach(function(t){if(t.circular){if(t.circularPathData.arcRadius=t.width+T,t.circularPathData.leftNodeBuffer=o,t.circularPathData.rightNodeBuffer=o,t.circularPathData.sourceWidth=t.source.x1-t.source.x0,t.circularPathData.sourceX=t.source.x0+t.circularPathData.sourceWidth,t.circularPathData.targetX=t.target.x0,t.circularPathData.sourceY=t.y0,t.circularPathData.targetY=t.y1,ee(t,a)&&N(t))t.circularPathData.leftSmallArcRadius=T+t.width/2,t.circularPathData.leftLargeArcRadius=T+t.width/2,t.circularPathData.rightSmallArcRadius=T+t.width/2,t.circularPathData.rightLargeArcRadius=T+t.width/2,t.circularLinkType==`bottom`?(t.circularPathData.verticalFullExtent=t.source.y1+w+t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius):(t.circularPathData.verticalFullExtent=t.source.y0-w-t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius);else{var c=t.source.column,l=t.circularLinkType,u=e.links.filter(function(e){return e.source.column==c&&e.circularLinkType==l});t.circularLinkType==`bottom`?u.sort(z):u.sort(R);var d=0;u.forEach(function(e,r){e.circularLinkID==t.circularLinkID&&(t.circularPathData.leftSmallArcRadius=T+t.width/2+d,t.circularPathData.leftLargeArcRadius=T+t.width/2+r*n+d),d+=e.width}),c=t.target.column,u=e.links.filter(function(e){return e.target.column==c&&e.circularLinkType==l}),t.circularLinkType==`bottom`?u.sort(V):u.sort(B),d=0,u.forEach(function(e,r){e.circularLinkID==t.circularLinkID&&(t.circularPathData.rightSmallArcRadius=T+t.width/2+d,t.circularPathData.rightLargeArcRadius=T+t.width/2+r*n+d),d+=e.width}),t.circularLinkType==`bottom`?(t.circularPathData.verticalFullExtent=Math.max(i,t.source.y1,t.target.y1)+w+t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius):(t.circularPathData.verticalFullExtent=s-w-t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius)}t.circularPathData.leftInnerExtent=t.circularPathData.sourceX+t.circularPathData.leftNodeBuffer,t.circularPathData.rightInnerExtent=t.circularPathData.targetX-t.circularPathData.rightNodeBuffer,t.circularPathData.leftFullExtent=t.circularPathData.sourceX+t.circularPathData.leftLargeArcRadius+t.circularPathData.leftNodeBuffer,t.circularPathData.rightFullExtent=t.circularPathData.targetX-t.circularPathData.rightLargeArcRadius-t.circularPathData.rightNodeBuffer}t.circular?t.path=I(t):t.path=r.linkHorizontal().source(function(e){return[e.source.x0+(e.source.x1-e.source.x0),e.y0]}).target(function(e){return[e.target.x0,e.y1]})(t)})}function I(e){var t=``;return t=e.circularLinkType==`top`?`M`+e.circularPathData.sourceX+` `+e.circularPathData.sourceY+` L`+e.circularPathData.leftInnerExtent+` `+e.circularPathData.sourceY+` A`+e.circularPathData.leftLargeArcRadius+` `+e.circularPathData.leftSmallArcRadius+` 0 0 0 `+e.circularPathData.leftFullExtent+` `+(e.circularPathData.sourceY-e.circularPathData.leftSmallArcRadius)+` L`+e.circularPathData.leftFullExtent+` `+e.circularPathData.verticalLeftInnerExtent+` A`+e.circularPathData.leftLargeArcRadius+` `+e.circularPathData.leftLargeArcRadius+` 0 0 0 `+e.circularPathData.leftInnerExtent+` `+e.circularPathData.verticalFullExtent+` L`+e.circularPathData.rightInnerExtent+` `+e.circularPathData.verticalFullExtent+` A`+e.circularPathData.rightLargeArcRadius+` `+e.circularPathData.rightLargeArcRadius+` 0 0 0 `+e.circularPathData.rightFullExtent+` `+e.circularPathData.verticalRightInnerExtent+` L`+e.circularPathData.rightFullExtent+` `+(e.circularPathData.targetY-e.circularPathData.rightSmallArcRadius)+` A`+e.circularPathData.rightLargeArcRadius+` `+e.circularPathData.rightSmallArcRadius+` 0 0 0 `+e.circularPathData.rightInnerExtent+` `+e.circularPathData.targetY+` L`+e.circularPathData.targetX+` `+e.circularPathData.targetY:`M`+e.circularPathData.sourceX+` `+e.circularPathData.sourceY+` L`+e.circularPathData.leftInnerExtent+` `+e.circularPathData.sourceY+` A`+e.circularPathData.leftLargeArcRadius+` `+e.circularPathData.leftSmallArcRadius+` 0 0 1 `+e.circularPathData.leftFullExtent+` `+(e.circularPathData.sourceY+e.circularPathData.leftSmallArcRadius)+` L`+e.circularPathData.leftFullExtent+` `+e.circularPathData.verticalLeftInnerExtent+` A`+e.circularPathData.leftLargeArcRadius+` `+e.circularPathData.leftLargeArcRadius+` 0 0 1 `+e.circularPathData.leftInnerExtent+` `+e.circularPathData.verticalFullExtent+` L`+e.circularPathData.rightInnerExtent+` `+e.circularPathData.verticalFullExtent+` A`+e.circularPathData.rightLargeArcRadius+` `+e.circularPathData.rightLargeArcRadius+` 0 0 1 `+e.circularPathData.rightFullExtent+` `+e.circularPathData.verticalRightInnerExtent+` L`+e.circularPathData.rightFullExtent+` `+(e.circularPathData.targetY+e.circularPathData.rightSmallArcRadius)+` A`+e.circularPathData.rightLargeArcRadius+` `+e.circularPathData.rightSmallArcRadius+` 0 0 1 `+e.circularPathData.rightInnerExtent+` `+e.circularPathData.targetY+` L`+e.circularPathData.targetX+` `+e.circularPathData.targetY,t}function L(e,t){return H(e)==H(t)?e.circularLinkType==`bottom`?z(e,t):R(e,t):H(t)-H(e)}function R(e,t){return e.y0-t.y0}function z(e,t){return t.y0-e.y0}function B(e,t){return e.y1-t.y1}function V(e,t){return t.y1-e.y1}function H(e){return e.target.column-e.source.column}function U(e){return e.target.x0-e.source.x1}function W(e,t){var n=A(e),r=U(t)/Math.tan(n);return Q(e)==`up`?e.y1+r:e.y1-r}function G(e,t){var n=A(e),r=U(t)/Math.tan(n);return Q(e)==`up`?e.y1-r:e.y1+r}function K(e,t,n,r){e.links.forEach(function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,c=o-a+1;for(s=1;a<=o;a++,s++)e.nodes.forEach(function(o){if(o.column==a){var l=s/(c+1),u=(1-l)**3,d=3*l*(1-l)**2,f=3*l**2*(1-l),p=l**3,m=u*i.y0+d*i.y0+f*i.y1+p*i.y1,h=m-i.width/2,g=m+i.width/2,_;h>o.y0&&h<o.y1?(_=o.y1-h+10,_=o.circularLinkType==`bottom`?_:-_,o=J(o,_,t,n),e.nodes.forEach(function(e){C(e,r)==C(o,r)||e.column!=o.column||q(o,e)&&J(e,_,t,n)})):(g>o.y0&&g<o.y1||h<o.y0&&g>o.y1)&&(_=g-o.y0+10,o=J(o,_,t,n),e.nodes.forEach(function(e){C(e,r)==C(o,r)||e.column!=o.column||e.y0<o.y1&&e.y1>o.y1&&J(e,_,t,n)}))}})}})}function q(e,t){return e.y0>t.y0&&e.y0<t.y1||e.y1>t.y0&&e.y1<t.y1?!0:e.y0<t.y0&&e.y1>t.y1}function J(e,t,n,r){return e.y0+t>=n&&e.y1+t<=r&&(e.y0+=t,e.y1+=t,e.targetLinks.forEach(function(e){e.y1+=t}),e.sourceLinks.forEach(function(e){e.y0+=t})),e}function Y(e,t,n,r){e.nodes.forEach(function(i){r&&i.y+(i.y1-i.y0)>t&&(i.y-=i.y+(i.y1-i.y0)-t);var a=e.links.filter(function(e){return C(e.source,n)==C(i,n)}),o=a.length;o>1&&a.sort(function(e,t){if(!e.circular&&!t.circular){if(e.target.column==t.target.column)return e.y1-t.y1;if(Z(e,t)){if(e.target.column>t.target.column){var n=G(t,e);return e.y1-n}if(t.target.column>e.target.column)return G(e,t)-t.y1}else return e.y1-t.y1}if(e.circular&&!t.circular)return e.circularLinkType==`top`?-1:1;if(t.circular&&!e.circular)return t.circularLinkType==`top`?1:-1;if(e.circular&&t.circular)return e.circularLinkType===t.circularLinkType&&e.circularLinkType==`top`?e.target.column===t.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:e.circularLinkType===t.circularLinkType&&e.circularLinkType==`bottom`?e.target.column===t.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:e.circularLinkType==`top`?-1:1});var s=i.y0;a.forEach(function(e){e.y0=s+e.width/2,s+=e.width}),a.forEach(function(e,t){if(e.circularLinkType==`bottom`){for(var n=t+1,r=0;n<o;n++)r+=a[n].width;e.y0=i.y1-r-e.width/2}})})}function X(e,t,n){e.nodes.forEach(function(t){var r=e.links.filter(function(e){return C(e.target,n)==C(t,n)}),i=r.length;i>1&&r.sort(function(e,t){if(!e.circular&&!t.circular){if(e.source.column==t.source.column)return e.y0-t.y0;if(Z(e,t)){if(t.source.column<e.source.column){var n=W(t,e);return e.y0-n}if(e.source.column<t.source.column)return W(e,t)-t.y0}else return e.y0-t.y0}if(e.circular&&!t.circular)return e.circularLinkType==`top`?-1:1;if(t.circular&&!e.circular)return t.circularLinkType==`top`?1:-1;if(e.circular&&t.circular)return e.circularLinkType===t.circularLinkType&&e.circularLinkType==`top`?e.source.column===t.source.column?e.source.y1-t.source.y1:e.source.column-t.source.column:e.circularLinkType===t.circularLinkType&&e.circularLinkType==`bottom`?e.source.column===t.source.column?e.source.y1-t.source.y1:t.source.column-e.source.column:e.circularLinkType==`top`?-1:1});var a=t.y0;r.forEach(function(e){e.y1=a+e.width/2,a+=e.width}),r.forEach(function(e,n){if(e.circularLinkType==`bottom`){for(var a=n+1,o=0;a<i;a++)o+=r[a].width;e.y1=t.y1-o-e.width/2}})})}function Z(e,t){return Q(e)==Q(t)}function Q(e){return e.y0-e.y1>0?`up`:`down`}function ee(e,t){return C(e.source,t)==C(e.target,t)}function te(e,n,r){var i=e.nodes,a=e.links,o=!1,s=!1;if(a.forEach(function(e){e.circularLinkType==`top`?o=!0:e.circularLinkType==`bottom`&&(s=!0)}),o==0||s==0){var c=t.min(i,function(e){return e.y0}),l=t.max(i,function(e){return e.y1})-c,u=(r-n)/l;i.forEach(function(e){var t=(e.y1-e.y0)*u;e.y0=(e.y0-c)*u,e.y1=e.y0+t}),a.forEach(function(e){e.y0=(e.y0-c)*u,e.y1=(e.y1-c)*u,e.width*=u})}}e.sankeyCircular=D,e.sankeyCenter=l,e.sankeyLeft=o,e.sankeyRight=s,e.sankeyJustify=c,Object.defineProperty(e,`__esModule`,{value:!0})})}),_S=h((e,t)=>{t.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`}}}),vS=h((e,t)=>{var n=dS(),r=(pm(),y(fm)).interpolateNumber,i=S(),a=mS(),o=gS(),s=_S(),c=R(),l=q(),u=tn(),d=$(),f=d.strTranslate,p=d.strRotate,m=lb(),h=m.keyFun,g=m.repeat,_=m.unwrap,v=kt(),b=Ke(),x=Ot(),C=x.CAP_SHIFT,w=x.LINE_SPACING,T=3;function E(e,t,n){var r=_(t),i=r.trace,l=i.domain,u=i.orientation===`h`,f=i.node.pad,p=i.node.thickness,m={justify:a.sankeyJustify,left:a.sankeyLeft,right:a.sankeyRight,center:a.sankeyCenter}[i.node.align],h=e.width*(l.x[1]-l.x[0]),g=e.height*(l.y[1]-l.y[0]),v=r._nodes,y=r._links,b=r.circular,x=b?o.sankeyCircular().circularLinkGap(0):a.sankey();x.iterations(s.sankeyIterations).size(u?[h,g]:[g,h]).nodeWidth(p).nodePadding(f).nodeId(function(e){return e.pointNumber}).nodeAlign(m).nodes(v).links(y);var S=x();x.nodePadding()<f&&d.warn(`node.pad was reduced to `,x.nodePadding(),` to fit within the figure.`);var C,w,T;for(var E in r._groupLookup){var D=parseInt(r._groupLookup[E]),O;for(C=0;C<S.nodes.length;C++)if(S.nodes[C].pointNumber===D){O=S.nodes[C];break}if(O){var k={pointNumber:parseInt(E),x0:O.x0,x1:O.x1,y0:O.y0,y1:O.y1,partOfGroup:!0,sourceLinks:[],targetLinks:[]};S.nodes.unshift(k),O.childrenNodes.unshift(k)}}function A(){for(C=0;C<S.nodes.length;C++){var e=S.nodes[C],t={},n,r;for(w=0;w<e.targetLinks.length;w++)r=e.targetLinks[w],n=r.source.pointNumber+`:`+r.target.pointNumber,t.hasOwnProperty(n)||(t[n]=[]),t[n].push(r);var i=Object.keys(t);for(w=0;w<i.length;w++){n=i[w];var a=t[n],o=0,s={};for(T=0;T<a.length;T++)r=a[T],s[r.label]||(s[r.label]=0),s[r.label]+=r.value,o+=r.value;for(T=0;T<a.length;T++)r=a[T],r.flow={value:o,labelConcentration:s[r.label]/o,concentration:r.value/o,links:a},r.concentrationscale&&(r.color=c(r.concentrationscale(r.flow.labelConcentration)))}var l=0;for(w=0;w<e.sourceLinks.length;w++)l+=e.sourceLinks[w].value;for(w=0;w<e.sourceLinks.length;w++)r=e.sourceLinks[w],r.concentrationOut=r.value/l;var u=0;for(w=0;w<e.targetLinks.length;w++)u+=e.targetLinks[w].value;for(w=0;w<e.targetLinks.length;w++)r=e.targetLinks[w],r.concenrationIn=r.value/u}}A();function j(e){e.forEach(function(e){var t,n,r=0,i=e.length,a;for(e.sort(function(e,t){return e.y0-t.y0}),a=0;a<i;++a)t=e[a],t.y0>=r||(n=r-t.y0,n>1e-6&&(t.y0+=n,t.y1+=n)),r=t.y1+f})}function M(e){var t=e.map(function(e,t){return{x0:e.x0,index:t}}).sort(function(e,t){return e.x0-t.x0}),n=[],r=-1,i,a=-1/0,o;for(C=0;C<t.length;C++){var s=e[t[C].index];s.x0>a+p&&(r+=1,i=s.x0),a=s.x0,n[r]||(n[r]=[]),n[r].push(s),o=i-s.x0,s.x0+=o,s.x1+=o}return n}if(i.node.x.length&&i.node.y.length){for(C=0;C<Math.min(i.node.x.length,i.node.y.length,S.nodes.length);C++)if(i.node.x[C]&&i.node.y[C]){var N=[i.node.x[C]*h,i.node.y[C]*g];S.nodes[C].x0=N[0]-p/2,S.nodes[C].x1=N[0]+p/2;var P=S.nodes[C].y1-S.nodes[C].y0;S.nodes[C].y0=N[1]-P/2,S.nodes[C].y1=N[1]+P/2}i.arrangement===`snap`&&(v=S.nodes,j(M(v))),x.update(S)}return{circular:b,key:n,trace:i,guid:d.randstr(),horizontal:u,width:h,height:g,nodePad:i.node.pad,nodeLineColor:i.node.line.color,nodeLineWidth:i.node.line.width,linkLineColor:i.link.line.color,linkLineWidth:i.link.line.width,linkArrowLength:i.link.arrowlen,valueFormat:i.valueformat,valueSuffix:i.valuesuffix,textFont:i.textfont,translateX:l.x[0]*e.width+e.margin.l,translateY:e.height-l.y[1]*e.height+e.margin.t,dragParallel:u?g:h,dragPerpendicular:u?h:g,arrangement:i.arrangement,sankey:x,graph:S,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function D(e,t,n){var r=c(t.color),i=c(t.hovercolor),a=t.source.label+`|`+t.target.label+`__`+n;return t.trace=e.trace,t.curveNumber=e.trace.index,{circular:e.circular,key:a,traceId:e.key,pointNumber:t.pointNumber,link:t,tinyColorHue:l.tinyRGB(r),tinyColorAlpha:r.getAlpha(),tinyColorHoverHue:l.tinyRGB(i),tinyColorHoverAlpha:i.getAlpha(),linkPath:k,linkLineColor:e.linkLineColor,linkLineWidth:e.linkLineWidth,linkArrowLength:e.linkArrowLength,valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,parent:e,interactionState:e.interactionState,flow:t.flow}}function O(e,t){var n=``,r=e.width/2,i=e.circularPathData,a=i.sourceX+i.verticalBuffer<i.targetX,o=i.rightFullExtent-i.rightLargeArcRadius-t<=i.leftFullExtent-r;return Math.abs(i.rightFullExtent-i.leftFullExtent-r),e.circularLinkType===`top`?(n=`M `+(i.targetX-t)+` `+(i.targetY+r)+` L `+(i.rightInnerExtent-t)+` `+(i.targetY+r)+`A `+(i.rightLargeArcRadius+r)+` `+(i.rightSmallArcRadius+r)+` 0 0 1 `+(i.rightFullExtent-r-t)+` `+(i.targetY-i.rightSmallArcRadius)+`L `+(i.rightFullExtent-r-t)+` `+i.verticalRightInnerExtent,a&&o?n+=` A `+(i.rightLargeArcRadius+r)+` `+(i.rightLargeArcRadius+r)+` 0 0 1 `+(i.rightFullExtent+r-t-(i.rightLargeArcRadius-r))+` `+(i.verticalRightInnerExtent-(i.rightLargeArcRadius+r))+` L `+(i.rightFullExtent+r-(i.rightLargeArcRadius-r)-t)+` `+(i.verticalRightInnerExtent-(i.rightLargeArcRadius+r))+` A `+(i.leftLargeArcRadius+r)+` `+(i.leftLargeArcRadius+r)+` 0 0 1 `+(i.leftFullExtent+r)+` `+i.verticalRightInnerExtent:a?n+=` A `+(i.rightLargeArcRadius-r)+` `+(i.rightLargeArcRadius-r)+` 0 0 0 `+(i.rightFullExtent-r-t-(i.rightLargeArcRadius-r))+` `+(i.verticalRightInnerExtent-(i.rightLargeArcRadius-r))+` L `+(i.leftFullExtent+r+(i.rightLargeArcRadius-r))+` `+(i.verticalRightInnerExtent-(i.rightLargeArcRadius-r))+` A `+(i.leftLargeArcRadius-r)+` `+(i.leftLargeArcRadius-r)+` 0 0 0 `+(i.leftFullExtent+r)+` `+i.verticalLeftInnerExtent:n+=` A `+(i.rightLargeArcRadius+r)+` `+(i.rightLargeArcRadius+r)+` 0 0 1 `+(i.rightInnerExtent-t)+` `+(i.verticalFullExtent-r)+` L `+i.leftInnerExtent+` `+(i.verticalFullExtent-r)+` A `+(i.leftLargeArcRadius+r)+` `+(i.leftLargeArcRadius+r)+` 0 0 1 `+(i.leftFullExtent+r)+` `+i.verticalLeftInnerExtent,n+=` L `+(i.leftFullExtent+r)+` `+(i.sourceY-i.leftSmallArcRadius)+` A `+(i.leftLargeArcRadius+r)+` `+(i.leftSmallArcRadius+r)+` 0 0 1 `+i.leftInnerExtent+` `+(i.sourceY+r)+` L `+i.sourceX+` `+(i.sourceY+r)+` L `+i.sourceX+` `+(i.sourceY-r)+` L `+i.leftInnerExtent+` `+(i.sourceY-r)+` A `+(i.leftLargeArcRadius-r)+` `+(i.leftSmallArcRadius-r)+` 0 0 0 `+(i.leftFullExtent-r)+` `+(i.sourceY-i.leftSmallArcRadius)+` L `+(i.leftFullExtent-r)+` `+i.verticalLeftInnerExtent,a&&o?n+=` A `+(i.leftLargeArcRadius+r)+` `+(i.leftSmallArcRadius+r)+` 0 0 0 `+(i.leftFullExtent-r)+` `+(i.verticalFullExtent+r)+`L`+(i.rightFullExtent+r-t)+` `+(i.verticalFullExtent+r)+` A `+(i.leftLargeArcRadius+r)+` `+(i.leftSmallArcRadius+r)+` 0 0 0 `+(i.rightFullExtent+r-t)+` `+i.verticalRightInnerExtent:a?n+=` A `+(i.leftLargeArcRadius+r)+` `+(i.leftSmallArcRadius+r)+` 0 0 1 `+(i.leftFullExtent+r)+` `+(i.verticalFullExtent-r)+` L `+(i.rightFullExtent-r-t)+` `+(i.verticalFullExtent-r)+` A `+(i.leftLargeArcRadius+r)+` `+(i.leftSmallArcRadius+r)+` 0 0 1 `+(i.rightFullExtent+r-t)+` `+i.verticalRightInnerExtent:n+=` A `+(i.leftLargeArcRadius-r)+` `+(i.leftLargeArcRadius-r)+` 0 0 0 `+i.leftInnerExtent+` `+(i.verticalFullExtent+r)+` L `+(i.rightInnerExtent-t)+` `+(i.verticalFullExtent+r)+` A `+(i.rightLargeArcRadius-r)+` `+(i.rightLargeArcRadius-r)+` 0 0 0 `+(i.rightFullExtent+r-t)+` `+i.verticalRightInnerExtent,n+=` L `+(i.rightFullExtent+r-t)+` `+(i.targetY-i.rightSmallArcRadius)+` A `+(i.rightLargeArcRadius-r)+` `+(i.rightSmallArcRadius-r)+` 0 0 0 `+(i.rightInnerExtent-t)+` `+(i.targetY-r)+` L `+(i.targetX-t)+` `+(i.targetY-r)+(t>0?` L `+i.targetX+` `+i.targetY:``)+`Z`):(n=`M `+(i.targetX-t)+` `+(i.targetY-r)+` L `+(i.rightInnerExtent-t)+` `+(i.targetY-r)+` A `+(i.rightLargeArcRadius+r)+` `+(i.rightSmallArcRadius+r)+` 0 0 0 `+(i.rightFullExtent-r-t)+` `+(i.targetY+i.rightSmallArcRadius)+` L `+(i.rightFullExtent-r-t)+` `+i.verticalRightInnerExtent,a&&o?n+=` A `+(i.rightLargeArcRadius+r)+` `+(i.rightLargeArcRadius+r)+` 0 0 0 `+(i.rightInnerExtent-r-t)+` `+(i.verticalFullExtent+r)+` L `+(i.rightFullExtent+r-t-(i.rightLargeArcRadius-r))+` `+(i.verticalFullExtent+r)+` A `+(i.rightLargeArcRadius+r)+` `+(i.rightLargeArcRadius+r)+` 0 0 0 `+(i.leftFullExtent+r)+` `+i.verticalLeftInnerExtent:a?n+=` A `+(i.rightLargeArcRadius-r)+` `+(i.rightSmallArcRadius-r)+` 0 0 1 `+(i.rightFullExtent-t-r-(i.rightLargeArcRadius-r))+` `+(i.verticalFullExtent-r)+` L `+(i.leftFullExtent+r+(i.rightLargeArcRadius-r))+` `+(i.verticalFullExtent-r)+` A `+(i.rightLargeArcRadius-r)+` `+(i.rightSmallArcRadius-r)+` 0 0 1 `+(i.leftFullExtent+r)+` `+i.verticalLeftInnerExtent:n+=` A `+(i.rightLargeArcRadius+r)+` `+(i.rightLargeArcRadius+r)+` 0 0 0 `+(i.rightInnerExtent-t)+` `+(i.verticalFullExtent+r)+` L `+i.leftInnerExtent+` `+(i.verticalFullExtent+r)+` A `+(i.leftLargeArcRadius+r)+` `+(i.leftLargeArcRadius+r)+` 0 0 0 `+(i.leftFullExtent+r)+` `+i.verticalLeftInnerExtent,n+=` L `+(i.leftFullExtent+r)+` `+(i.sourceY+i.leftSmallArcRadius)+` A `+(i.leftLargeArcRadius+r)+` `+(i.leftSmallArcRadius+r)+` 0 0 0 `+i.leftInnerExtent+` `+(i.sourceY-r)+` L `+i.sourceX+` `+(i.sourceY-r)+` L `+i.sourceX+` `+(i.sourceY+r)+` L `+i.leftInnerExtent+` `+(i.sourceY+r)+` A `+(i.leftLargeArcRadius-r)+` `+(i.leftSmallArcRadius-r)+` 0 0 1 `+(i.leftFullExtent-r)+` `+(i.sourceY+i.leftSmallArcRadius)+` L `+(i.leftFullExtent-r)+` `+i.verticalLeftInnerExtent,a&&o?n+=` A `+(i.rightLargeArcRadius-r)+` `+(i.rightSmallArcRadius-r)+` 0 0 1 `+(i.leftFullExtent-r-(i.rightLargeArcRadius-r))+` `+(i.verticalFullExtent-r)+` L `+(i.rightFullExtent+r-t+(i.rightLargeArcRadius-r))+` `+(i.verticalFullExtent-r)+` A `+(i.rightLargeArcRadius-r)+` `+(i.rightSmallArcRadius-r)+` 0 0 1 `+(i.rightFullExtent+r-t)+` `+i.verticalRightInnerExtent:a?n+=` A `+(i.rightLargeArcRadius+r)+` `+(i.rightLargeArcRadius+r)+` 0 0 0 `+(i.leftFullExtent+r)+` `+(i.verticalFullExtent+r)+` L `+(i.rightFullExtent-t-r)+` `+(i.verticalFullExtent+r)+` A `+(i.rightLargeArcRadius+r)+` `+(i.rightLargeArcRadius+r)+` 0 0 0 `+(i.rightFullExtent+r-t)+` `+i.verticalRightInnerExtent:n+=` A `+(i.leftLargeArcRadius-r)+` `+(i.leftLargeArcRadius-r)+` 0 0 1 `+i.leftInnerExtent+` `+(i.verticalFullExtent-r)+` L `+(i.rightInnerExtent-t)+` `+(i.verticalFullExtent-r)+` A `+(i.rightLargeArcRadius-r)+` `+(i.rightLargeArcRadius-r)+` 0 0 1 `+(i.rightFullExtent+r-t)+` `+i.verticalRightInnerExtent,n+=` L `+(i.rightFullExtent+r-t)+` `+(i.targetY+i.rightSmallArcRadius)+` A `+(i.rightLargeArcRadius-r)+` `+(i.rightSmallArcRadius-r)+` 0 0 1 `+(i.rightInnerExtent-t)+` `+(i.targetY+r)+` L `+(i.targetX-t)+` `+(i.targetY+r)+(t>0?` L `+i.targetX+` `+i.targetY:``)+`Z`),n}function k(){var e=.5;function t(t){var n=t.linkArrowLength;if(t.link.circular)return O(t.link,n);var i=Math.abs((t.link.target.x0-t.link.source.x1)/2);n>i&&(n=i);var a=t.link.source.x1,o=t.link.target.x0-n,s=r(a,o),c=s(e),l=s(1-e),u=t.link.y0-t.link.width/2,d=t.link.y0+t.link.width/2,f=t.link.y1-t.link.width/2,p=t.link.y1+t.link.width/2,m=`M`+a+`,`+u,h=`C`+c+`,`+u+` `+l+`,`+f+` `+o+`,`+f,g=`C`+l+`,`+p+` `+c+`,`+d+` `+a+`,`+d,_=n>0?`L`+(o+n)+`,`+(f+t.link.width/2):``;return _+=`L`+o+`,`+p,m+h+_+g+`Z`}return t}function A(e,t){var n=c(t.color),r=s.nodePadAcross,i=e.nodePad/2;t.dx=t.x1-t.x0,t.dy=t.y1-t.y0;var a=t.dx,o=Math.max(.5,t.dy),u=`node_`+t.pointNumber;return t.group&&(u=d.randstr()),t.trace=e.trace,t.curveNumber=e.trace.index,{index:t.pointNumber,key:u,partOfGroup:t.partOfGroup||!1,group:t.group,traceId:e.key,trace:e.trace,node:t,nodePad:e.nodePad,nodeLineColor:e.nodeLineColor,nodeLineWidth:e.nodeLineWidth,textFont:e.textFont,size:e.horizontal?e.height:e.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-r,zoneY:-i,zoneWidth:a+2*r,zoneHeight:o+2*i,labelY:e.horizontal?t.dy/2+1:t.dx/2+1,left:t.originalLayer===1,sizeAcross:e.width,forceLayouts:e.forceLayouts,horizontal:e.horizontal,darkBackground:n.getBrightness()<=128,tinyColorHue:l.tinyRGB(n),tinyColorAlpha:n.getAlpha(),valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,graph:e.graph,arrangement:e.arrangement,uniqueNodeLabelPathId:[e.guid,e.key,u].join(`_`),interactionState:e.interactionState,figure:e}}function j(e){e.attr(`transform`,function(e){return f(e.node.x0.toFixed(3),e.node.y0.toFixed(3))})}function M(e){e.call(j)}function N(e,t){e.call(M),t.attr(`d`,k())}function P(e){e.attr(`width`,function(e){return e.node.x1-e.node.x0}).attr(`height`,function(e){return e.visibleHeight})}function F(e){return e.link.width>1||e.linkLineWidth>0}function I(e){return f(e.translateX,e.translateY)+(e.horizontal?`matrix(1 0 0 1 0 0)`:`matrix(0 1 1 0 0 0)`)}function L(e,t,n){e.on(`.basic`,null).on(`mouseover.basic`,function(e){!e.interactionState.dragInProgress&&!e.partOfGroup&&(n.hover(this,e,t),e.interactionState.hovered=[this,e])}).on(`mousemove.basic`,function(e){!e.interactionState.dragInProgress&&!e.partOfGroup&&(n.follow(this,e),e.interactionState.hovered=[this,e])}).on(`mouseout.basic`,function(e){!e.interactionState.dragInProgress&&!e.partOfGroup&&(n.unhover(this,e,t),e.interactionState.hovered=!1)}).on(`click.basic`,function(e){e.interactionState.hovered&&(n.unhover(this,e,t),e.interactionState.hovered=!1),!e.interactionState.dragInProgress&&!e.partOfGroup&&n.select(this,e,t)})}function z(e,t,n,r){var a=i.behavior.drag().origin(function(e){return{x:e.node.x0+e.visibleWidth/2,y:e.node.y0+e.visibleHeight/2}}).on(`dragstart`,function(i){if(i.arrangement!==`fixed`&&(d.ensureSingle(r._fullLayout._infolayer,`g`,`dragcover`,function(e){r._fullLayout._dragCover=e}),d.raiseToTop(this),i.interactionState.dragInProgress=i.node,G(i.node),i.interactionState.hovered&&(n.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),i.arrangement===`snap`)){var a=i.traceId+`|`+i.key;i.forceLayouts[a]?i.forceLayouts[a].alpha(1):B(e,a,i,r),V(e,t,i,a,r)}}).on(`drag`,function(n){if(n.arrangement!==`fixed`){var r=i.event.x,a=i.event.y;n.arrangement===`snap`?(n.node.x0=r-n.visibleWidth/2,n.node.x1=r+n.visibleWidth/2,n.node.y0=a-n.visibleHeight/2,n.node.y1=a+n.visibleHeight/2):(n.arrangement===`freeform`&&(n.node.x0=r-n.visibleWidth/2,n.node.x1=r+n.visibleWidth/2),a=Math.max(0,Math.min(n.size-n.visibleHeight/2,a)),n.node.y0=a-n.visibleHeight/2,n.node.y1=a+n.visibleHeight/2),G(n.node),n.arrangement!==`snap`&&(n.sankey.update(n.graph),N(e.filter(K(n)),t))}}).on(`dragend`,function(e){if(e.arrangement!==`fixed`){e.interactionState.dragInProgress=!1;for(var t=0;t<e.node.childrenNodes.length;t++)e.node.childrenNodes[t].x=e.node.x,e.node.childrenNodes[t].y=e.node.y;e.arrangement!==`snap`&&U(e,r)}});e.on(`.drag`,null).call(a)}function B(e,t,r,i){J(r.graph.nodes);var a=r.graph.nodes.filter(function(e){return e.originalX===r.node.originalX}).filter(function(e){return!e.partOfGroup});r.forceLayouts[t]=n.forceSimulation(a).alphaDecay(0).force(`collide`,n.forceCollide().radius(function(e){return e.dy/2+r.nodePad/2}).strength(1).iterations(s.forceIterations)).force(`constrain`,H(e,t,a,r,i)).stop()}function V(e,t,n,r,i){window.requestAnimationFrame(function a(){var o;for(o=0;o<s.forceTicksPerFrame;o++)n.forceLayouts[r].tick();var c=n.graph.nodes;if(Y(c),n.sankey.update(n.graph),N(e.filter(K(n)),t),n.forceLayouts[r].alpha()>0)window.requestAnimationFrame(a);else{var l=n.node.originalX;n.node.x0=l-n.visibleWidth/2,n.node.x1=l+n.visibleWidth/2,U(n,i)}})}function H(e,t,n,r){return function(){for(var e=0,i=0;i<n.length;i++){var a=n[i];a===r.interactionState.dragInProgress?(a.x=a.lastDraggedX,a.y=a.lastDraggedY):(a.vx=(a.originalX-a.x)/s.forceTicksPerFrame,a.y=Math.min(r.size-a.dy/2,Math.max(a.dy/2,a.y))),e=Math.max(e,Math.abs(a.vx),Math.abs(a.vy))}!r.interactionState.dragInProgress&&e<.1&&r.forceLayouts[t].alpha()>0&&r.forceLayouts[t].alpha(0)}}function U(e,t){for(var n=[],r=[],i=0;i<e.graph.nodes.length;i++){var a=(e.graph.nodes[i].x0+e.graph.nodes[i].x1)/2,o=(e.graph.nodes[i].y0+e.graph.nodes[i].y1)/2;n.push(a/e.figure.width),r.push(o/e.figure.height)}b.call(`_guiRestyle`,t,{"node.x":[n],"node.y":[r]},e.trace.index).then(function(){t._fullLayout._dragCover&&t._fullLayout._dragCover.remove()})}function W(e){var t=[],n;for(n=0;n<e.length;n++)e[n].originalX=(e[n].x0+e[n].x1)/2,e[n].originalY=(e[n].y0+e[n].y1)/2,t.indexOf(e[n].originalX)===-1&&t.push(e[n].originalX);for(t.sort(function(e,t){return e-t}),n=0;n<e.length;n++)e[n].originalLayerIndex=t.indexOf(e[n].originalX),e[n].originalLayer=e[n].originalLayerIndex/(t.length-1)}function G(e){e.lastDraggedX=e.x0+e.dx/2,e.lastDraggedY=e.y0+e.dy/2}function K(e){return function(t){return t.node.originalX===e.node.originalX}}function J(e){for(var t=0;t<e.length;t++)e[t].y=(e[t].y0+e[t].y1)/2,e[t].x=(e[t].x0+e[t].x1)/2}function Y(e){for(var t=0;t<e.length;t++)e[t].y0=e[t].y-e[t].dy/2,e[t].y1=e[t].y0+e[t].dy,e[t].x0=e[t].x-e[t].dx/2,e[t].x1=e[t].x0+e[t].dx}t.exports=function(e,t,n,r,a){var o=e._context.staticPlot,m=!1;d.ensureSingle(e._fullLayout._infolayer,`g`,`first-render`,function(){m=!0});var y=e._fullLayout._dragCover,b=n.filter(function(e){return _(e).trace.visible}).map(E.bind(null,r)),x=t.selectAll(`.`+s.cn.sankey).data(b,h);x.exit().remove(),x.enter().append(`g`).classed(s.cn.sankey,!0).style(`box-sizing`,`content-box`).style(`position`,`absolute`).style(`left`,0).style(`shape-rendering`,`geometricPrecision`).style(`pointer-events`,o?`none`:`auto`).attr(`transform`,I),x.each(function(t,n){e._fullData[n]._sankey=t;var r=`bgsankey-`+t.trace.uid+`-`+n;d.ensureSingle(e._fullLayout._draggers,`rect`,r),e._fullData[n]._bgRect=i.select(`.`+r),e._fullData[n]._bgRect.style(`pointer-events`,o?`none`:`all`).attr(`width`,t.width).attr(`height`,t.height).attr(`x`,t.translateX).attr(`y`,t.translateY).classed(`bgsankey`,!0).style({fill:`transparent`,"stroke-width":0})}),x.transition().ease(s.ease).duration(s.duration).attr(`transform`,I);var S=x.selectAll(`.`+s.cn.sankeyLinks).data(g,h);S.enter().append(`g`).classed(s.cn.sankeyLinks,!0).style(`fill`,`none`);var O=S.selectAll(`.`+s.cn.sankeyLink).data(function(e){return e.graph.links.filter(function(e){return e.value}).map(D.bind(null,e))},h);O.enter().append(`path`).classed(s.cn.sankeyLink,!0).call(L,x,a.linkEvents),O.style(`stroke`,function(e){return F(e)?l.tinyRGB(c(e.linkLineColor)):e.tinyColorHue}).style(`stroke-opacity`,function(e){return F(e)?l.opacity(e.linkLineColor):e.tinyColorAlpha}).style(`fill`,function(e){return e.tinyColorHue}).style(`fill-opacity`,function(e){return e.tinyColorAlpha}).style(`stroke-width`,function(e){return F(e)?e.linkLineWidth:1}).attr(`d`,k()),O.style(`opacity`,function(){return e._context.staticPlot||m||y?1:0}).transition().ease(s.ease).duration(s.duration).style(`opacity`,1),O.exit().transition().ease(s.ease).duration(s.duration).style(`opacity`,0).remove();var M=x.selectAll(`.`+s.cn.sankeyNodeSet).data(g,h);M.enter().append(`g`).classed(s.cn.sankeyNodeSet,!0),M.style(`cursor`,function(e){switch(e.arrangement){case`fixed`:return`default`;case`perpendicular`:return`ns-resize`;default:return`move`}});var N=M.selectAll(`.`+s.cn.sankeyNode).data(function(e){var t=e.graph.nodes;return W(t),t.map(A.bind(null,e))},h);N.enter().append(`g`).classed(s.cn.sankeyNode,!0).call(j).style(`opacity`,function(t){return(e._context.staticPlot||m)&&!t.partOfGroup?1:0}),N.call(L,x,a.nodeEvents).call(z,O,a,e),N.transition().ease(s.ease).duration(s.duration).call(j).style(`opacity`,function(e){return e.partOfGroup?0:1}),N.exit().transition().ease(s.ease).duration(s.duration).style(`opacity`,0).remove();var R=N.selectAll(`.`+s.cn.nodeRect).data(g);R.enter().append(`rect`).classed(s.cn.nodeRect,!0).call(P),R.style(`stroke-width`,function(e){return e.nodeLineWidth}).style(`stroke`,function(e){return l.tinyRGB(c(e.nodeLineColor))}).style(`stroke-opacity`,function(e){return l.opacity(e.nodeLineColor)}).style(`fill`,function(e){return e.tinyColorHue}).style(`fill-opacity`,function(e){return e.tinyColorAlpha}),R.transition().ease(s.ease).duration(s.duration).call(P);var B=N.selectAll(`.`+s.cn.nodeLabel).data(g);B.enter().append(`text`).classed(s.cn.nodeLabel,!0).style(`cursor`,`default`),B.attr(`data-notex`,1).text(function(e){return e.node.label}).each(function(t){var n=i.select(this);u.font(n,t.textFont),v.convertToTspans(n,e)}).attr(`text-anchor`,function(e){return e.horizontal&&e.left?`end`:`start`}).attr(`transform`,function(e){var t=i.select(this),n=v.lineCount(t),r=e.textFont.size*((n-1)*w-C),a=e.nodeLineWidth/2+T,o=((e.horizontal?e.visibleHeight:e.visibleWidth)-r)/2;e.horizontal&&(e.left?a=-a:a+=e.visibleWidth);var s=e.horizontal?``:`scale(-1,1)`+p(90);return f(e.horizontal?a:o,e.horizontal?o:a)+s}),B.transition().ease(s.ease).duration(s.duration)}}),yS=h((e,t)=>{var n=S(),r=$(),i=r.numberFormat,a=vS(),o=Ln(),s=q(),c=_S().cn,l=r._;function u(e){return e!==``}function d(e,t){return e.filter(function(e){return e.key===t.traceId})}function f(e,t){n.select(e).select(`path`).style(`fill-opacity`,t),n.select(e).select(`rect`).style(`fill-opacity`,t)}function p(e){n.select(e).select(`text.name`).style(`fill`,`black`)}function m(e){return function(t){return e.node.sourceLinks.indexOf(t.link)!==-1||e.node.targetLinks.indexOf(t.link)!==-1}}function h(e){return function(t){return t.node.sourceLinks.indexOf(e.link)!==-1||t.node.targetLinks.indexOf(e.link)!==-1}}function g(e,t,n){t&&n&&d(n,t).selectAll(`.`+c.sankeyLink).filter(m(t)).call(v.bind(0,t,n,!1))}function _(e,t,n){t&&n&&d(n,t).selectAll(`.`+c.sankeyLink).filter(m(t)).call(y.bind(0,t,n,!1))}function v(e,t,n,r){r.style(`fill`,function(e){if(!e.link.concentrationscale)return e.tinyColorHoverHue}).style(`fill-opacity`,function(e){if(!e.link.concentrationscale)return e.tinyColorHoverAlpha}),r.each(function(n){var r=n.link.label;r!==``&&d(t,e).selectAll(`.`+c.sankeyLink).filter(function(e){return e.link.label===r}).style(`fill`,function(e){if(!e.link.concentrationscale)return e.tinyColorHoverHue}).style(`fill-opacity`,function(e){if(!e.link.concentrationscale)return e.tinyColorHoverAlpha})}),n&&d(t,e).selectAll(`.`+c.sankeyNode).filter(h(e)).call(g)}function y(e,t,n,r){r.style(`fill`,function(e){return e.tinyColorHue}).style(`fill-opacity`,function(e){return e.tinyColorAlpha}),r.each(function(n){var r=n.link.label;r!==``&&d(t,e).selectAll(`.`+c.sankeyLink).filter(function(e){return e.link.label===r}).style(`fill`,function(e){return e.tinyColorHue}).style(`fill-opacity`,function(e){return e.tinyColorAlpha})}),n&&d(t,e).selectAll(c.sankeyNode).filter(h(e)).call(_)}function b(e,t){var n=e.hoverlabel||{},i=r.nestedProperty(n,t).get();return Array.isArray(i)?!1:i}t.exports=function(e,t){for(var r=e._fullLayout,d=r._paper,m=r._size,h=0;h<e._fullData.length;h++)if(e._fullData[h].visible&&e._fullData[h].type===c.sankey&&!e._fullData[h]._viewInitial){var x=e._fullData[h].node;e._fullData[h]._viewInitial={node:{groups:x.groups.slice(),x:x.x.slice(),y:x.y.slice()}}}var S=function(t,r){var i=r.link;i.originalEvent=n.event,e._hoverdata=[i],o.click(e,{target:!0})},C=function(t,r,i){e._fullLayout.hovermode!==!1&&(n.select(t).call(v.bind(0,r,i,!0)),r.link.trace.link.hoverinfo!==`skip`&&(r.link.fullData=r.link.trace,e.emit(`plotly_hover`,{event:n.event,points:[r.link]})))},w=l(e,`source:`)+` `,T=l(e,`target:`)+` `,E=l(e,`concentration:`)+` `,D=l(e,`incoming flow count:`)+` `,O=l(e,`outgoing flow count:`)+` `;a(e,d,t,{width:m.w,height:m.h,margin:{t:m.t,r:m.r,b:m.b,l:m.l}},{linkEvents:{hover:C,follow:function(t,a){if(e._fullLayout.hovermode===!1)return;var c=a.link.trace.link;if(c.hoverinfo===`none`||c.hoverinfo===`skip`)return;var l=[];function d(e){var t,n;e.circular?(t=(e.circularPathData.leftInnerExtent+e.circularPathData.rightInnerExtent)/2,n=e.circularPathData.verticalFullExtent):(t=(e.source.x1+e.target.x0)/2,n=(e.y0+e.y1)/2);var r=[t,n];return e.trace.orientation===`v`&&r.reverse(),r[0]+=a.parent.translateX,r[1]+=a.parent.translateY,r}for(var m=0,h=0;h<a.flow.links.length;h++){var g=a.flow.links[h];if(!(e._fullLayout.hovermode===`closest`&&a.link.pointNumber!==g.pointNumber)){a.link.pointNumber===g.pointNumber&&(m=h),g.fullData=g.trace,c=a.link.trace.link;var _=d(g),v={valueLabel:i(a.valueFormat)(g.value)+a.valueSuffix};l.push({x:_[0],y:_[1],name:v.valueLabel,text:[g.label||``,w+g.source.label,T+g.target.label,g.concentrationscale?E+i(`%0.2f`)(g.flow.labelConcentration):``].filter(u).join(`<br>`),color:b(c,`bgcolor`)||s.addOpacity(g.color,1),borderColor:b(c,`bordercolor`),fontFamily:b(c,`font.family`),fontSize:b(c,`font.size`),fontColor:b(c,`font.color`),fontWeight:b(c,`font.weight`),fontStyle:b(c,`font.style`),fontVariant:b(c,`font.variant`),fontTextcase:b(c,`font.textcase`),fontLineposition:b(c,`font.lineposition`),fontShadow:b(c,`font.shadow`),nameLength:b(c,`namelength`),textAlign:b(c,`align`),idealAlign:n.event.x<_[0]?`right`:`left`,hovertemplate:c.hovertemplate,hovertemplateLabels:v,eventData:[g]})}}o.loneHover(l,{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e,anchorIndex:m}).each(function(){var e=this;a.link.concentrationscale||f(e,.65),p(e)})},unhover:function(t,i,a){e._fullLayout.hovermode!==!1&&(n.select(t).call(y.bind(0,i,a,!0)),i.link.trace.link.hoverinfo!==`skip`&&(i.link.fullData=i.link.trace,e.emit(`plotly_unhover`,{event:n.event,points:[i.link]})),o.loneUnhover(r._hoverlayer.node()))},select:S},nodeEvents:{hover:function(t,r,i){e._fullLayout.hovermode!==!1&&(n.select(t).call(g,r,i),r.node.trace.node.hoverinfo!==`skip`&&(r.node.fullData=r.node.trace,e.emit(`plotly_hover`,{event:n.event,points:[r.node]})))},follow:function(t,a){if(e._fullLayout.hovermode!==!1){var s=a.node.trace.node;if(!(s.hoverinfo===`none`||s.hoverinfo===`skip`)){var l=n.select(t).select(`.`+c.nodeRect),d=e._fullLayout._paperdiv.node().getBoundingClientRect(),m=l.node().getBoundingClientRect(),h=m.left-2-d.left,g=m.right+2-d.left,_=m.top+m.height/4-d.top,v={valueLabel:i(a.valueFormat)(a.node.value)+a.valueSuffix};a.node.fullData=a.node.trace,e._fullLayout._calcInverseTransform(e);var y=e._fullLayout._invScaleX,x=e._fullLayout._invScaleY,S=o.loneHover({x0:y*h,x1:y*g,y:x*_,name:i(a.valueFormat)(a.node.value)+a.valueSuffix,text:[a.node.label,D+a.node.targetLinks.length,O+a.node.sourceLinks.length].filter(u).join(`<br>`),color:b(s,`bgcolor`)||a.tinyColorHue,borderColor:b(s,`bordercolor`),fontFamily:b(s,`font.family`),fontSize:b(s,`font.size`),fontColor:b(s,`font.color`),fontWeight:b(s,`font.weight`),fontStyle:b(s,`font.style`),fontVariant:b(s,`font.variant`),fontTextcase:b(s,`font.textcase`),fontLineposition:b(s,`font.lineposition`),fontShadow:b(s,`font.shadow`),nameLength:b(s,`namelength`),textAlign:b(s,`align`),idealAlign:`left`,hovertemplate:s.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e});f(S,.85),p(S)}}},unhover:function(t,i,a){e._fullLayout.hovermode!==!1&&(n.select(t).call(_,i,a),i.node.trace.node.hoverinfo!==`skip`&&(i.node.fullData=i.node.trace,e.emit(`plotly_unhover`,{event:n.event,points:[i.node]})),o.loneUnhover(r._hoverlayer.node()))},select:function(t,r,i){var a=r.node;a.originalEvent=n.event,e._hoverdata=[a],n.select(t).call(_,r,i),o.click(e,{target:!0})}}})}}),bS=h(e=>{var t=Ie().overrideAll,n=wt().getModuleCalcData,r=yS(),i=H(),a=gn(),o=hn(),s=Ar().prepSelect,c=$(),l=Ke(),u=`sankey`;e.name=u,e.baseLayoutAttrOverrides=t({hoverlabel:i.hoverlabel},`plot`,`nested`),e.plot=function(t){var i=n(t.calcdata,u)[0];r(t,i),e.updateFx(t)},e.clean=function(e,t,n,r){var i=r._has&&r._has(u),a=t._has&&t._has(u);i&&!a&&(r._paperdiv.selectAll(`.sankey`).remove(),r._paperdiv.selectAll(`.bgsankey`).remove())},e.updateFx=function(e){for(var t=0;t<e._fullData.length;t++)d(e,t)};function d(e,t){var n=e._fullData[t],r=e._fullLayout,i=r.dragmode,u=r.dragmode===`pan`?`move`:`crosshair`,d=n._bgRect;if(d&&!(i===`pan`||i===`zoom`)){a(d,u);var f={_id:`x`,c2p:c.identity,_offset:n._sankey.translateX,_length:n._sankey.width},p={_id:`y`,c2p:c.identity,_offset:n._sankey.translateY,_length:n._sankey.height},m={gd:e,element:d.node(),plotinfo:{id:t,xaxis:f,yaxis:p,fillRangeItems:c.noop},subplot:t,xaxes:[f],yaxes:[p],doneFnCompleted:function(n){var r=e._fullData[t],i,a=r.node.groups.slice(),o=[];function s(e){for(var t=r._sankey.graph.nodes,n=0;n<t.length;n++)if(t[n].pointNumber===e)return t[n]}for(var c=0;c<n.length;c++){var u=s(n[c].pointNumber);if(u)if(u.group){for(var d=0;d<u.childrenNodes.length;d++)o.push(u.childrenNodes[d].pointNumber);a[u.pointNumber-r.node._count]=!1}else o.push(u.pointNumber)}i=a.filter(Boolean).concat([o]),l.call(`_guiRestyle`,e,{"node.groups":[i]},t)}};m.prepFn=function(e,t,n){s(e,t,n,m,i)},o.init(m)}}}),xS=h((e,t)=>{t.exports=function(e,t){for(var n=e.cd,r=[],i=n[0].trace,a=i._sankey.graph.nodes,o=0;o<a.length;o++){var s=a[o];if(!s.partOfGroup){var c=[(s.x0+s.x1)/2,(s.y0+s.y1)/2];i.orientation===`v`&&c.reverse(),t&&t.contains(c,!1,o,e)&&r.push({pointNumber:s.pointNumber})}}return r}}),SS=h((e,t)=>{t.exports={attributes:rS(),supplyDefaults:iS(),calc:oS(),plot:yS(),moduleType:`trace`,name:`sankey`,basePlotModule:bS(),selectPoints:xS(),categories:[`noOpacity`],meta:{}}}),CS=h((e,t)=>{t.exports=SS()}),wS=h(e=>{var t=Et();e.name=`indicator`,e.plot=function(n,r,i,a){t.plotBasePlot(e.name,n,r,i,a)},e.clean=function(n,r,i,a){t.cleanBasePlot(e.name,n,r,i,a)}}),TS=h((e,t)=>{var n=z().extendFlat,r=z().extendDeep,i=Ie().overrideAll,a=B(),o=K(),s=Da().attributes,c=Mt(),l=yt().templatedArray,u=Ec(),d=jt().descriptionOnlyNumbers,f=a({editType:`plot`,colorEditType:`plot`}),p={color:{valType:`color`,editType:`plot`},line:{color:{valType:`color`,dflt:o.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`},m={valType:`info_array`,items:[{valType:`number`,editType:`plot`},{valType:`number`,editType:`plot`}],editType:`plot`},h=l(`step`,r({},p,{range:m}));t.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:s({name:`indicator`,trace:!0,editType:`calc`}),title:{text:{valType:`string`,editType:`plot`},align:{valType:`enumerated`,values:[`left`,`center`,`right`],editType:`plot`},font:n({},f,{}),editType:`plot`},number:{valueformat:{valType:`string`,dflt:``,editType:`plot`,description:d(`value`)},font:n({},f,{}),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:d(`value`)},increasing:{symbol:{valType:`string`,dflt:u.INCREASING.SYMBOL,editType:`plot`},color:{valType:`color`,dflt:u.INCREASING.COLOR,editType:`plot`},editType:`plot`},decreasing:{symbol:{valType:`string`,dflt:u.DECREASING.SYMBOL,editType:`plot`},color:{valType:`color`,dflt:u.DECREASING.COLOR,editType:`plot`},editType:`plot`},font:n({},f,{}),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:r({},p,{color:{dflt:`green`}}),bgcolor:{valType:`color`,editType:`plot`},bordercolor:{valType:`color`,dflt:o.defaultLine,editType:`plot`},borderwidth:{valType:`number`,min:0,dflt:1,editType:`plot`},axis:i({range:m,visible:n({},c.visible,{dflt:!0}),tickmode:c.minor.tickmode,nticks:c.nticks,tick0:c.tick0,dtick:c.dtick,tickvals:c.tickvals,ticktext:c.ticktext,ticks:n({},c.ticks,{dflt:`outside`}),ticklen:c.ticklen,tickwidth:c.tickwidth,tickcolor:c.tickcolor,ticklabelstep:c.ticklabelstep,showticklabels:c.showticklabels,labelalias:c.labelalias,tickfont:a({}),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,editType:`plot`},`plot`),steps:h,threshold:{line:{color:n({},p.line.color,{}),width:n({},p.line.width,{dflt:1}),editType:`plot`},thickness:n({},p.thickness,{dflt:.85}),value:{valType:`number`,editType:`calc`,dflt:!1},editType:`plot`},editType:`plot`}}}),ES=h((e,t)=>{t.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}),DS=h((e,t)=>{var n=$(),r=TS(),i=Da().defaults,a=yt(),o=Vt(),s=ES(),c=Rt(),l=zt(),u=Ht(),d=Ut();function f(e,t,f,m){function h(i,a){return n.coerce(e,t,r,i,a)}i(t,m,h),h(`mode`),t._hasNumber=t.mode.indexOf(`number`)!==-1,t._hasDelta=t.mode.indexOf(`delta`)!==-1,t._hasGauge=t.mode.indexOf(`gauge`)!==-1;var g=h(`value`);t._range=[0,typeof g==`number`?1.5*g:1];var _=[,,],v;if(t._hasNumber){h(`number.valueformat`);var y=n.extendFlat({},m.font);y.size=void 0,n.coerceFont(h,`number.font`,y),t.number.font.size===void 0&&(t.number.font.size=s.defaultNumberFontSize,_[0]=!0),h(`number.prefix`),h(`number.suffix`),v=t.number.font.size}var b;if(t._hasDelta){var x=n.extendFlat({},m.font);x.size=void 0,n.coerceFont(h,`delta.font`,x),t.delta.font.size===void 0&&(t.delta.font.size=(t._hasNumber?.5:1)*(v||s.defaultNumberFontSize),_[1]=!0),h(`delta.reference`,t.value),h(`delta.relative`),h(`delta.valueformat`,t.delta.relative?`2%`:``),h(`delta.increasing.symbol`),h(`delta.increasing.color`),h(`delta.decreasing.symbol`),h(`delta.decreasing.color`),h(`delta.position`),h(`delta.prefix`),h(`delta.suffix`),b=t.delta.font.size}t._scaleNumbers=(!t._hasNumber||_[0])&&(!t._hasDelta||_[1])||!1;var S=n.extendFlat({},m.font);S.size=.25*(v||b||s.defaultNumberFontSize),n.coerceFont(h,`title.font`,S),h(`title.text`);var C,w,T,E;function D(e,t){return n.coerce(C,w,r.gauge,e,t)}function O(e,t){return n.coerce(T,E,r.gauge.axis,e,t)}if(t._hasGauge){C=e.gauge,C||={},w=a.newContainer(t,`gauge`),D(`shape`),(t._isBullet=t.gauge.shape===`bullet`)||h(`title.align`,`center`),(t._isAngular=t.gauge.shape===`angular`)||h(`align`,`center`),D(`bgcolor`,m.paper_bgcolor),D(`borderwidth`),D(`bordercolor`),D(`bar.color`),D(`bar.line.color`),D(`bar.line.width`),D(`bar.thickness`,s.valueThickness*(t.gauge.shape===`bullet`?.5:1)),o(C,w,{name:`steps`,handleItemDefaults:p}),D(`threshold.value`),D(`threshold.thickness`),D(`threshold.line.width`),D(`threshold.line.color`),T={},C&&(T=C.axis||{}),E=a.newContainer(w,`axis`),O(`visible`),t._range=O(`range`,t._range);var k={font:m.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};c(T,E,O,`linear`),d(T,E,O,`linear`,k),u(T,E,O,`linear`,k),l(T,E,O,k)}else h(`title.align`,`center`),h(`align`,`center`),t._isAngular=t._isBullet=!1;t._length=null}function p(e,t){function i(i,a){return n.coerce(e,t,r.gauge.steps,i,a)}i(`color`),i(`line.color`),i(`line.width`),i(`range`),i(`thickness`)}t.exports={supplyDefaults:f}}),OS=h((e,t)=>{function n(e,t){var n=[],r=t.value;typeof t._lastValue!=`number`&&(t._lastValue=t.value);var i=t._lastValue,a=i;return t._hasDelta&&typeof t.delta.reference==`number`&&(a=t.delta.reference),n[0]={y:r,lastY:i,delta:r-a,relativeDelta:(r-a)/a},n}t.exports={calc:n}}),kS=h((e,t)=>{var n=S(),r=(pm(),y(fm)).interpolate,i=(pm(),y(fm)).interpolateNumber,a=$(),o=a.strScale,s=a.strTranslate,c=a.rad2deg,l=Ot().MID_SHIFT,u=tn(),d=ES(),f=kt(),p=sn(),m=Ei(),h=Di(),g=Mt(),_=q(),v={left:`start`,center:`middle`,right:`end`},b={left:0,center:.5,right:1},x=/[yzafpnµmkMGTPEZY]/;function C(e){return e&&e.duration>0}t.exports=function(e,t,r,i){var o=e._fullLayout,c;C(r)&&i&&(c=i()),a.makeTraceGroups(o._indicatorlayer,t,`trace`).each(function(t){var i=t[0].trace,a=n.select(this),l=i._hasGauge,p=i._isAngular,m=i._isBullet,h=i.domain,g={w:o._size.w*(h.x[1]-h.x[0]),h:o._size.h*(h.y[1]-h.y[0]),l:o._size.l+o._size.w*h.x[0],r:o._size.r+o._size.w*(1-h.x[1]),t:o._size.t+o._size.h*(1-h.y[1]),b:o._size.b+o._size.h*h.y[0]},_=g.l+g.w/2,y=g.t+g.h/2,x=Math.min(g.w/2,g.h),S=d.innerRadius*x,C,D,O,k=i.align||`center`;if(D=y,!l)C=g.l+b[k]*g.w,O=function(e){return A(e,g.w,g.h)};else if(p&&(C=_,D=y+x/2,O=function(e){return j(e,.9*S)}),m){var M=d.bulletPadding,N=1-d.bulletNumberDomainSize+M;C=g.l+(N+(1-N)*b[k])*g.w,O=function(e){return A(e,(d.bulletNumberDomainSize-M)*g.w,g.h)}}E(e,a,t,{numbersX:C,numbersY:D,numbersScaler:O,transitionOpts:r,onComplete:c});var P,F;l&&(P={range:i.gauge.axis.range,color:i.gauge.bgcolor,line:{color:i.gauge.bordercolor,width:0},thickness:1},F={range:i.gauge.axis.range,color:`rgba(0, 0, 0, 0)`,line:{color:i.gauge.bordercolor,width:i.gauge.borderwidth},thickness:1});var I=a.selectAll(`g.angular`).data(p?t:[]);I.exit().remove();var L=a.selectAll(`g.angularaxis`).data(p?t:[]);L.exit().remove(),p&&T(e,a,t,{radius:x,innerRadius:S,gauge:I,layer:L,size:g,gaugeBg:P,gaugeOutline:F,transitionOpts:r,onComplete:c});var R=a.selectAll(`g.bullet`).data(m?t:[]);R.exit().remove();var z=a.selectAll(`g.bulletaxis`).data(m?t:[]);z.exit().remove(),m&&w(e,a,t,{gauge:R,layer:z,size:g,gaugeBg:P,gaugeOutline:F,transitionOpts:r,onComplete:c});var B=a.selectAll(`text.title`).data(t);B.exit().remove(),B.enter().append(`text`).classed(`title`,!0),B.attr(`text-anchor`,function(){return m?v.right:v[i.title.align]}).text(i.title.text).call(u.font,i.title.font).call(f.convertToTspans,e),B.attr(`transform`,function(){var e=g.l+g.w*b[i.title.align],t,n=d.titlePadding,r=u.bBox(B.node());return l?(p&&(t=i.gauge.axis.visible?u.bBox(L.node()).top-n-r.bottom:g.t+g.h/2-x/2-r.bottom-n),m&&(t=D-(r.top+r.bottom)/2,e=g.l-d.bulletPadding*g.w)):t=i._numbersTop-n-r.bottom,s(e,t)})})};function w(e,t,n,r){var i=n[0].trace,a=r.gauge,o=r.layer,c=r.gaugeBg,l=r.gaugeOutline,u=r.size,f=i.domain,m=r.transitionOpts,h=r.onComplete,g,v,y,b,x;a.enter().append(`g`).classed(`bullet`,!0),a.attr(`transform`,s(u.l,u.t)),o.enter().append(`g`).classed(`bulletaxis`,!0).classed(`crisp`,!0),o.selectAll(`g.xbulletaxistick,path,text`).remove();var S=u.h,w=i.gauge.bar.thickness*S,T=f.x[0],E=f.x[0]+(f.x[1]-f.x[0])*(i._hasNumber||i._hasDelta?1-d.bulletNumberDomainSize:1);g=k(e,i.gauge.axis),g._id=`xbulletaxis`,g.domain=[T,E],g.setScale(),v=p.calcTicks(g),y=p.makeTransTickFn(g),b=p.getTickSigns(g)[2],x=u.t+u.h,g.visible&&(p.drawTicks(e,g,{vals:g.ticks===`inside`?p.clipEnds(g,v):v,layer:o,path:p.makeTickPath(g,x,b),transFn:y}),p.drawLabels(e,g,{vals:v,layer:o,transFn:y,labelFns:p.makeLabelFns(g,x)}));function O(e){e.attr(`width`,function(e){return Math.max(0,g.c2p(e.range[1])-g.c2p(e.range[0]))}).attr(`x`,function(e){return g.c2p(e.range[0])}).attr(`y`,function(e){return .5*(1-e.thickness)*S}).attr(`height`,function(e){return e.thickness*S})}var A=[c].concat(i.gauge.steps),j=a.selectAll(`g.bg-bullet`).data(A);j.enter().append(`g`).classed(`bg-bullet`,!0).append(`rect`),j.select(`rect`).call(O).call(D),j.exit().remove();var M=a.selectAll(`g.value-bullet`).data([i.gauge.bar]);M.enter().append(`g`).classed(`value-bullet`,!0).append(`rect`),M.select(`rect`).attr(`height`,w).attr(`y`,(S-w)/2).call(D),C(m)?M.select(`rect`).transition().duration(m.duration).ease(m.easing).each(`end`,function(){h&&h()}).each(`interrupt`,function(){h&&h()}).attr(`width`,Math.max(0,g.c2p(Math.min(i.gauge.axis.range[1],n[0].y)))):M.select(`rect`).attr(`width`,typeof n[0].y==`number`?Math.max(0,g.c2p(Math.min(i.gauge.axis.range[1],n[0].y))):0),M.exit().remove();var N=n.filter(function(){return i.gauge.threshold.value||i.gauge.threshold.value===0}),P=a.selectAll(`g.threshold-bullet`).data(N);P.enter().append(`g`).classed(`threshold-bullet`,!0).append(`line`),P.select(`line`).attr(`x1`,g.c2p(i.gauge.threshold.value)).attr(`x2`,g.c2p(i.gauge.threshold.value)).attr(`y1`,(1-i.gauge.threshold.thickness)/2*S).attr(`y2`,(1-(1-i.gauge.threshold.thickness)/2)*S).call(_.stroke,i.gauge.threshold.line.color).style(`stroke-width`,i.gauge.threshold.line.width),P.exit().remove();var F=a.selectAll(`g.gauge-outline`).data([l]);F.enter().append(`g`).classed(`gauge-outline`,!0).append(`rect`),F.select(`rect`).call(O).call(D),F.exit().remove()}function T(e,t,r,i){var a=r[0].trace,o=i.size,u=i.radius,d=i.innerRadius,f=i.gaugeBg,m=i.gaugeOutline,h=[o.l+o.w/2,o.t+o.h/2+u/2],g=i.gauge,_=i.layer,v=i.transitionOpts,y=i.onComplete,b=Math.PI/2;function x(e){var t=a.gauge.axis.range[0],n=a.gauge.axis.range[1],r=(e-t)/(n-t)*Math.PI-b;return r<-b?-b:r>b?b:r}function S(e){return n.svg.arc().innerRadius((d+u)/2-e/2*(u-d)).outerRadius((d+u)/2+e/2*(u-d)).startAngle(-b)}function w(e){e.attr(`d`,function(e){return S(e.thickness).startAngle(x(e.range[0])).endAngle(x(e.range[1]))()})}var T,E,A,j;g.enter().append(`g`).classed(`angular`,!0),g.attr(`transform`,s(h[0],h[1])),_.enter().append(`g`).classed(`angularaxis`,!0).classed(`crisp`,!0),_.selectAll(`g.xangularaxistick,path,text`).remove(),T=k(e,a.gauge.axis),T.type=`linear`,T.range=a.gauge.axis.range,T._id=`xangularaxis`,T.ticklabeloverflow=`allow`,T.setScale();var M=function(e){return(T.range[0]-e.x)/(T.range[1]-T.range[0])*Math.PI+Math.PI},N={},P=p.makeLabelFns(T,0).labelStandoff;N.xFn=function(e){var t=M(e);return Math.cos(t)*P},N.yFn=function(e){var t=M(e),n=Math.sin(t)>0?.2:1;return-Math.sin(t)*(P+e.fontSize*n)+Math.abs(Math.cos(t))*(e.fontSize*l)},N.anchorFn=function(e){var t=M(e),n=Math.cos(t);return Math.abs(n)<.1?`middle`:n>0?`start`:`end`},N.heightFn=function(e,t,n){var r=M(e);return-.5*(1+Math.sin(r))*n};var F=function(e){return s(h[0]+u*Math.cos(e),h[1]-u*Math.sin(e))};A=function(e){return F(M(e))};var I=function(e){var t=M(e);return F(t)+`rotate(`+-c(t)+`)`};if(E=p.calcTicks(T),j=p.getTickSigns(T)[2],T.visible){j=T.ticks===`inside`?-1:1;var L=(T.linewidth||1)/2;p.drawTicks(e,T,{vals:E,layer:_,path:`M`+j*L+`,0h`+j*T.ticklen,transFn:I}),p.drawLabels(e,T,{vals:E,layer:_,transFn:A,labelFns:N})}var R=[f].concat(a.gauge.steps),z=g.selectAll(`g.bg-arc`).data(R);z.enter().append(`g`).classed(`bg-arc`,!0).append(`path`),z.select(`path`).call(w).call(D),z.exit().remove();var B=S(a.gauge.bar.thickness),V=g.selectAll(`g.value-arc`).data([a.gauge.bar]);V.enter().append(`g`).classed(`value-arc`,!0).append(`path`);var H=V.select(`path`);C(v)?(H.transition().duration(v.duration).ease(v.easing).each(`end`,function(){y&&y()}).each(`interrupt`,function(){y&&y()}).attrTween(`d`,O(B,x(r[0].lastY),x(r[0].y))),a._lastValue=r[0].y):H.attr(`d`,typeof r[0].y==`number`?B.endAngle(x(r[0].y)):`M0,0Z`),H.call(D),V.exit().remove(),R=[];var U=a.gauge.threshold.value;(U||U===0)&&R.push({range:[U,U],color:a.gauge.threshold.color,line:{color:a.gauge.threshold.line.color,width:a.gauge.threshold.line.width},thickness:a.gauge.threshold.thickness});var W=g.selectAll(`g.threshold-arc`).data(R);W.enter().append(`g`).classed(`threshold-arc`,!0).append(`path`),W.select(`path`).call(w).call(D),W.exit().remove();var G=g.selectAll(`g.gauge-outline`).data([m]);G.enter().append(`g`).classed(`gauge-outline`,!0).append(`path`),G.select(`path`).call(w).call(D),G.exit().remove()}function E(e,t,r,c){var l=r[0].trace,d=c.numbersX,m=c.numbersY,h=l.align||`center`,g=v[h],y=c.transitionOpts,S=c.onComplete,w=a.ensureSingle(t,`g`,`numbers`),T,E,D,O=[];l._hasNumber&&O.push(`number`),l._hasDelta&&(O.push(`delta`),l.delta.position===`left`&&O.reverse());var A=w.selectAll(`text`).data(O);A.enter().append(`text`),A.attr(`text-anchor`,function(){return g}).attr(`class`,function(e){return e}).attr(`x`,null).attr(`y`,null).attr(`dx`,null).attr(`dy`,null),A.exit().remove();function j(t,n,r,i){if(t.match(`s`)&&r>=0!=i>=0&&!n(r).slice(-1).match(x)&&!n(i).slice(-1).match(x)){var a=k(e,{tickformat:t.slice().replace(`s`,`f`).replace(/\d+/,function(e){return parseInt(e)-1})});return function(e){return Math.abs(e)<1?p.tickText(a,e).text:n(e)}}else return n}function P(){var t=k(e,{tickformat:l.number.valueformat},l._range);t.setScale(),p.prepTicks(t);var a=function(e){return p.tickText(t,e).text},o=l.number.suffix,s=l.number.prefix,c=w.select(`text.number`);function d(){var t=typeof r[0].y==`number`?s+a(r[0].y)+o:`-`;c.text(t).call(u.font,l.number.font).call(f.convertToTspans,e)}return C(y)?c.transition().duration(y.duration).ease(y.easing).each(`end`,function(){d(),S&&S()}).each(`interrupt`,function(){d(),S&&S()}).attrTween(`text`,function(){var e=n.select(this),t=i(r[0].lastY,r[0].y);l._lastValue=r[0].y;var c=j(l.number.valueformat,a,r[0].lastY,r[0].y);return function(n){e.text(s+c(t(n))+o)}}):d(),T=M(s+a(r[0].y)+o,l.number.font,g,e),c}function F(){var t=k(e,{tickformat:l.delta.valueformat},l._range);t.setScale(),p.prepTicks(t);var a=function(e){return p.tickText(t,e).text},o=l.delta.suffix,s=l.delta.prefix,c=function(e){return l.delta.relative?e.relativeDelta:e.delta},d=function(e,t){return e===0||typeof e!=`number`||isNaN(e)?`-`:(e>0?l.delta.increasing.symbol:l.delta.decreasing.symbol)+s+t(e)+o},m=function(e){return e.delta>=0?l.delta.increasing.color:l.delta.decreasing.color};l._deltaLastValue===void 0&&(l._deltaLastValue=c(r[0]));var h=w.select(`text.delta`);h.call(u.font,l.delta.font).call(_.fill,m({delta:l._deltaLastValue}));function v(){h.text(d(c(r[0]),a)).call(_.fill,m(r[0])).call(f.convertToTspans,e)}return C(y)?h.transition().duration(y.duration).ease(y.easing).tween(`text`,function(){var e=n.select(this),t=c(r[0]),o=l._deltaLastValue,s=j(l.delta.valueformat,a,o,t),u=i(o,t);return l._deltaLastValue=t,function(t){e.text(d(u(t),s)),e.call(_.fill,m({delta:u(t)}))}}).each(`end`,function(){v(),S&&S()}).each(`interrupt`,function(){v(),S&&S()}):v(),E=M(d(c(r[0]),a),l.delta.font,g,e),h}var I=l.mode+l.align,L;if(l._hasDelta&&(L=F(),I+=l.delta.position+l.delta.font.size+l.delta.font.family+l.delta.valueformat,I+=l.delta.increasing.symbol+l.delta.decreasing.symbol,D=E),l._hasNumber&&(P(),I+=l.number.font.size+l.number.font.family+l.number.valueformat+l.number.suffix+l.number.prefix,D=T),l._hasDelta&&l._hasNumber){var R=[(T.left+T.right)/2,(T.top+T.bottom)/2],z=[(E.left+E.right)/2,(E.top+E.bottom)/2],B,V,H=.75*l.delta.font.size;l.delta.position===`left`&&(B=N(l,`deltaPos`,0,-1*(T.width*b[l.align]+E.width*(1-b[l.align])+H),I,Math.min),V=R[1]-z[1],D={width:T.width+E.width+H,height:Math.max(T.height,E.height),left:E.left+B,right:T.right,top:Math.min(T.top,E.top+V),bottom:Math.max(T.bottom,E.bottom+V)}),l.delta.position===`right`&&(B=N(l,`deltaPos`,0,T.width*(1-b[l.align])+E.width*b[l.align]+H,I,Math.max),V=R[1]-z[1],D={width:T.width+E.width+H,height:Math.max(T.height,E.height),left:T.left,right:E.right+B,top:Math.min(T.top,E.top+V),bottom:Math.max(T.bottom,E.bottom+V)}),l.delta.position===`bottom`&&(B=null,V=E.height,D={width:Math.max(T.width,E.width),height:T.height+E.height,left:Math.min(T.left,E.left),right:Math.max(T.right,E.right),top:T.bottom-T.height,bottom:T.bottom+E.height}),l.delta.position===`top`&&(B=null,V=T.top,D={width:Math.max(T.width,E.width),height:T.height+E.height,left:Math.min(T.left,E.left),right:Math.max(T.right,E.right),top:T.bottom-T.height-E.height,bottom:T.bottom}),L.attr({dx:B,dy:V})}(l._hasNumber||l._hasDelta)&&w.attr(`transform`,function(){var e=c.numbersScaler(D);I+=e[2];var t=N(l,`numbersScale`,1,e[0],I,Math.min),n;l._scaleNumbers||(t=1),n=l._isAngular?m-t*D.bottom:m-t*(D.top+D.bottom)/2,l._numbersTop=t*D.top+n;var r=D[h];h===`center`&&(r=(D.left+D.right)/2);var i=d-t*r;return i=N(l,`numbersTranslate`,0,i,I,Math.max),s(i,n)+o(t)})}function D(e){e.each(function(e){_.stroke(n.select(this),e.line.color)}).each(function(e){_.fill(n.select(this),e.color)}).style(`stroke-width`,function(e){return e.line.width})}function O(e,t,n){return function(){var i=r(t,n);return function(t){return e.endAngle(i(t))()}}}function k(e,t,n){var r=e._fullLayout,i=a.extendFlat({type:`linear`,ticks:`outside`,range:n,showline:!0},t),o={type:`linear`,_id:`x`+t._id},s={letter:`x`,font:r.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function c(e,t){return a.coerce(i,o,g,e,t)}return m(i,o,c,s,r),h(i,o,c,s),o}function A(e,t,n){return[Math.min(t/e.width,n/e.height),e,t+`x`+n]}function j(e,t){return[t/Math.sqrt(e.width/2*(e.width/2)+e.height*e.height),e,t]}function M(e,t,r,i){var a=document.createElementNS(`http://www.w3.org/2000/svg`,`text`),o=n.select(a);return o.text(e).attr(`x`,0).attr(`y`,0).attr(`text-anchor`,r).attr(`data-unformatted`,e).call(f.convertToTspans,i).call(u.font,t),u.bBox(o.node())}function N(e,t,n,r,i,o){var s=`_cache`+t;e[s]&&e[s].key===i||(e[s]={key:i,value:n});var c=a.aggNums(o,null,[e[s].value,r],2);return e[s].value=c,c}}),AS=h((e,t)=>{t.exports={moduleType:`trace`,name:`indicator`,basePlotModule:wS(),categories:[`svg`,`noOpacity`,`noHover`],animatable:!0,attributes:TS(),supplyDefaults:DS().supplyDefaults,calc:OS().calc,plot:kS(),meta:{}}}),jS=h((e,t)=>{t.exports=AS()}),MS=h((e,t)=>{var n=Sr(),r=z().extendFlat,i=Ie().overrideAll,a=B(),o=Da().attributes,s=jt().descriptionOnlyNumbers;t.exports=i({domain:o({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:s(`cell value`)},prefix:{valType:`string`,arrayOk:!0,dflt:null},suffix:{valType:`string`,arrayOk:!0,dflt:null},height:{valType:`number`,dflt:28},align:r({},n.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:r({},a({arrayOk:!0}))},cells:{values:{valType:`data_array`,dflt:[]},format:{valType:`data_array`,dflt:[],description:s(`cell value`)},prefix:{valType:`string`,arrayOk:!0,dflt:null},suffix:{valType:`string`,arrayOk:!0,dflt:null},height:{valType:`number`,dflt:20},align:r({},n.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:r({},a({arrayOk:!0}))}},`calc`,`from-root`)}),NS=h((e,t)=>{var n=$(),r=MS(),i=Da().defaults;function a(e,t){for(var n=e.columnorder||[],r=e.header.values.length,i=n.slice(0,r),a=i.slice().sort(function(e,t){return e-t}),o=i.map(function(e){return a.indexOf(e)}),s=o.length;s<r;s++)o.push(s);t(`columnorder`,o)}t.exports=function(e,t,o,s){function c(i,a){return n.coerce(e,t,r,i,a)}i(t,s,c),c(`columnwidth`),c(`header.values`),c(`header.format`),c(`header.align`),c(`header.prefix`),c(`header.suffix`),c(`header.height`),c(`header.line.width`),c(`header.line.color`),c(`header.fill.color`),n.coerceFont(c,`header.font`,s.font),a(t,c),c(`cells.values`),c(`cells.format`),c(`cells.align`),c(`cells.prefix`),c(`cells.suffix`),c(`cells.height`),c(`cells.line.width`),c(`cells.line.color`),c(`cells.fill.color`),n.coerceFont(c,`cells.font`,s.font),t._length=null}}),PS=h((e,t)=>{var n=lb().wrap;t.exports=function(){return n({})}}),FS=h((e,t)=>{t.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`}}}),IS=h((e,t)=>{var n=FS(),r=z().extendFlat,i=D(),a=j().isTypedArray,o=j().isArrayOrTypedArray;t.exports=function(e,t){var a=l(t.cells.values),m=function(e){return e.slice(t.header.values.length,e.length)},h=l(t.header.values);h.length&&!h[0].length&&(h[0]=[``],h=l(h));var g=h.concat(m(a).map(function(){return u((h[0]||[``]).length)})),_=t.domain,v=Math.floor(e._fullLayout._size.w*(_.x[1]-_.x[0])),y=Math.floor(e._fullLayout._size.h*(_.y[1]-_.y[0])),b=t.header.values.length?g[0].map(function(){return t.header.height}):[n.emptyHeaderHeight],x=a.length?a[0].map(function(){return t.cells.height}):[],S=b.reduce(c,0),C=p(x,y-S+n.uplift),w=f(p(b,S),[]),T=f(C,w),E={},D=t._fullInput.columnorder;o(D)&&(D=Array.from(D)),D=D.concat(m(a.map(function(e,t){return t})));var O=g.map(function(e,n){var r=o(t.columnwidth)?t.columnwidth[Math.min(n,t.columnwidth.length-1)]:t.columnwidth;return i(r)?Number(r):1}),k=O.reduce(c,0);O=O.map(function(e){return e/k*v});var A=Math.max(s(t.header.line.width),s(t.cells.line.width)),j={key:t.uid+e._context.staticPlot,translateX:_.x[0]*e._fullLayout._size.w,translateY:e._fullLayout._size.h*(1-_.y[1]),size:e._fullLayout._size,width:v,maxLineWidth:A,height:y,columnOrder:D,groupHeight:y,rowBlocks:T,headerRowBlocks:w,scrollY:0,cells:r({},t.cells,{values:a}),headerCells:r({},t.header,{values:g}),gdColumns:g.map(function(e){return e[0]}),gdColumnsOriginalOrder:g.map(function(e){return e[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:g.map(function(e,t){return E[e]=(E[e]||0)+1,{key:e+`__`+E[e],label:e,specIndex:t,xIndex:D[t],xScale:d,x:void 0,calcdata:void 0,columnWidth:O[t]}})};return j.columns.forEach(function(e){e.calcdata=j,e.x=d(e)}),j};function s(e){if(o(e)){for(var t=0,n=0;n<e.length;n++)t=Math.max(t,s(e[n]));return t}return e}function c(e,t){return e+t}function l(e){var t=e.slice(),n=1/0,r=0,i;for(i=0;i<t.length;i++)a(t[i])?t[i]=Array.from(t[i]):o(t[i])||(t[i]=[t[i]]),n=Math.min(n,t[i].length),r=Math.max(r,t[i].length);if(n!==r)for(i=0;i<t.length;i++){var s=r-t[i].length;s&&(t[i]=t[i].concat(u(s)))}return t}function u(e){for(var t=Array(e),n=0;n<e;n++)t[n]=``;return t}function d(e){return e.calcdata.columns.reduce(function(t,n){return n.xIndex<e.xIndex?t+n.columnWidth:t},0)}function f(e,t){return Object.keys(e).map(function(n){return r({},e[n],{auxiliaryBlocks:t})})}function p(e,t){for(var n={},r,i=0,a=0,o=m(),s=0,c=0,l=0;l<e.length;l++)r=e[l],o.rows.push({rowIndex:l,rowHeight:r}),a+=r,(a>=t||l===e.length-1)&&(n[i]=o,o.key=c++,o.firstRowIndex=s,o.lastRowIndex=l,o=m(),i+=a,s=l+1,a=0);return n}function m(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}),LS=h(e=>{var t=z().extendFlat;e.splitToPanels=function(e){var n=[0,0],r=t({},e,{key:`header`,type:`header`,page:0,prevPages:n,currentRepaint:[null,null],dragHandle:!0,values:e.calcdata.headerCells.values[e.specIndex],rowBlocks:e.calcdata.headerRowBlocks,calcdata:t({},e.calcdata,{cells:e.calcdata.headerCells})});return[t({},e,{key:`cells1`,type:`cells`,page:0,prevPages:n,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),t({},e,{key:`cells2`,type:`cells`,page:1,prevPages:n,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),r]},e.splitToCells=function(e){var t=n(e);return(e.values||[]).slice(t[0],t[1]).map(function(n,r){return{keyWithinBlock:r+(typeof n==`string`&&n.match(/[<$&> ]/)?`_keybuster_`+Math.random():``),key:t[0]+r,column:e,calcdata:e.calcdata,page:e.page,rowBlocks:e.rowBlocks,value:n}})};function n(e){var t=e.rowBlocks[e.page],n=t?t.rows[0].rowIndex:0;return[n,t?n+t.rows.length:0]}}),RS=h((e,t)=>{var n=FS(),r=S(),i=$(),a=i.numberFormat,o=lb(),s=tn(),c=kt(),l=$().raiseToTop,u=$().strTranslate,d=$().cancelTransition,f=IS(),p=LS(),m=q();t.exports=function(e,t){var i=!e._context.staticPlot,a=e._fullLayout._paper.selectAll(`.`+n.cn.table).data(t.map(function(t){var n=o.unwrap(t).trace;return f(e,n)}),o.keyFun);a.exit().remove(),a.enter().append(`g`).classed(n.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`),a.attr(`width`,function(e){return e.width+e.size.l+e.size.r}).attr(`height`,function(e){return e.height+e.size.t+e.size.b}).attr(`transform`,function(e){return u(e.translateX,e.translateY)});var c=a.selectAll(`.`+n.cn.tableControlView).data(o.repeat,o.keyFun),m=c.enter().append(`g`).classed(n.cn.tableControlView,!0).style(`box-sizing`,`content-box`);if(i){var x=`onwheel`in document?`wheel`:`mousewheel`;m.on(`mousemove`,function(t){c.filter(function(e){return t===e}).call(y,e)}).on(x,function(t){t.scrollbarState.wheeling||(t.scrollbarState.wheeling=!0,V(e,c,null,t.scrollY+r.event.deltaY)(t)||(r.event.stopPropagation(),r.event.preventDefault()),t.scrollbarState.wheeling=!1)}).call(y,e,!0)}c.attr(`transform`,function(e){return u(e.size.l,e.size.t)});var S=c.selectAll(`.`+n.cn.scrollBackground).data(o.repeat,o.keyFun);S.enter().append(`rect`).classed(n.cn.scrollBackground,!0).attr(`fill`,`none`),S.attr(`width`,function(e){return e.width}).attr(`height`,function(e){return e.height}),c.each(function(t){s.setClipUrl(r.select(this),g(e,t),e)});var C=c.selectAll(`.`+n.cn.yColumn).data(function(e){return e.columns},o.keyFun);C.enter().append(`g`).classed(n.cn.yColumn,!0),C.exit().remove(),C.attr(`transform`,function(e){return u(e.x,0)}),i&&C.call(r.behavior.drag().origin(function(t){return F(r.select(this),t,-n.uplift),l(this),t.calcdata.columnDragInProgress=!0,y(c.filter(function(e){return t.calcdata.key===e.key}),e),t}).on(`drag`,function(e){var t=r.select(this),i=function(t){return(e===t?r.event.x:t.x)+t.columnWidth/2};e.x=Math.max(-n.overdrag,Math.min(e.calcdata.width+n.overdrag-e.columnWidth,r.event.x)),v(C).filter(function(t){return t.calcdata.key===e.calcdata.key}).sort(function(e,t){return i(e)-i(t)}).forEach(function(t,n){t.xIndex=n,t.x=e===t?t.x:t.xScale(t)}),C.filter(function(t){return e!==t}).transition().ease(n.transitionEase).duration(n.transitionDuration).attr(`transform`,function(e){return u(e.x,0)}),t.call(d).attr(`transform`,u(e.x,-n.uplift))}).on(`dragend`,function(t){var n=r.select(this),i=t.calcdata;t.x=t.xScale(t),t.calcdata.columnDragInProgress=!1,F(n,t,0),N(e,i,i.columns.map(function(e){return e.xIndex}))})),C.each(function(t){s.setClipUrl(r.select(this),_(e,t),e)});var w=C.selectAll(`.`+n.cn.columnBlock).data(p.splitToPanels,o.keyFun);w.enter().append(`g`).classed(n.cn.columnBlock,!0).attr(`id`,function(e){return e.key}),w.style(`cursor`,function(e){return e.dragHandle?`ew-resize`:e.calcdata.scrollbarState.barWiggleRoom?`ns-resize`:`default`});var T=w.filter(L),E=w.filter(I);i&&E.call(r.behavior.drag().origin(function(e){return r.event.stopPropagation(),e}).on(`drag`,V(e,c,-1)).on(`dragend`,function(){})),b(e,c,T,w),b(e,c,E,w);var D=c.selectAll(`.`+n.cn.scrollAreaClip).data(o.repeat,o.keyFun);D.enter().append(`clipPath`).classed(n.cn.scrollAreaClip,!0).attr(`id`,function(t){return g(e,t)});var O=D.selectAll(`.`+n.cn.scrollAreaClipRect).data(o.repeat,o.keyFun);O.enter().append(`rect`).classed(n.cn.scrollAreaClipRect,!0).attr(`x`,-n.overdrag).attr(`y`,-n.uplift).attr(`fill`,`none`),O.attr(`width`,function(e){return e.width+2*n.overdrag}).attr(`height`,function(e){return e.height+n.uplift}),C.selectAll(`.`+n.cn.columnBoundary).data(o.repeat,o.keyFun).enter().append(`g`).classed(n.cn.columnBoundary,!0);var k=C.selectAll(`.`+n.cn.columnBoundaryClippath).data(o.repeat,o.keyFun);k.enter().append(`clipPath`).classed(n.cn.columnBoundaryClippath,!0),k.attr(`id`,function(t){return _(e,t)});var A=k.selectAll(`.`+n.cn.columnBoundaryRect).data(o.repeat,o.keyFun);A.enter().append(`rect`).classed(n.cn.columnBoundaryRect,!0).attr(`fill`,`none`),A.attr(`width`,function(e){return e.columnWidth+2*h(e)}).attr(`height`,function(e){return e.calcdata.height+2*h(e)+n.uplift}).attr(`x`,function(e){return-h(e)}).attr(`y`,function(e){return-h(e)}),B(null,E,c)};function h(e){return Math.ceil(e.calcdata.maxLineWidth/2)}function g(e,t){return`clip`+e._fullLayout._uid+`_scrollAreaBottomClip_`+t.key}function _(e,t){return`clip`+e._fullLayout._uid+`_columnBoundaryClippath_`+t.calcdata.key+`_`+t.specIndex}function v(e){return[].concat.apply([],e.map(function(e){return e})).map(function(e){return e.__data__})}function y(e,t,i){function a(e){var t=e.rowBlocks;return J(t,t.length-1)+(t.length?Y(t[t.length-1],1/0):1)}var s=e.selectAll(`.`+n.cn.scrollbarKit).data(o.repeat,o.keyFun);s.enter().append(`g`).classed(n.cn.scrollbarKit,!0).style(`shape-rendering`,`geometricPrecision`),s.each(function(e){var t=e.scrollbarState;t.totalHeight=a(e),t.scrollableAreaHeight=e.groupHeight-R(e),t.currentlyVisibleHeight=Math.min(t.totalHeight,t.scrollableAreaHeight),t.ratio=t.currentlyVisibleHeight/t.totalHeight,t.barLength=Math.max(t.ratio*t.currentlyVisibleHeight,n.goldenRatio*n.scrollbarWidth),t.barWiggleRoom=t.currentlyVisibleHeight-t.barLength,t.wiggleRoom=Math.max(0,t.totalHeight-t.scrollableAreaHeight),t.topY=t.barWiggleRoom===0?0:e.scrollY/t.wiggleRoom*t.barWiggleRoom,t.bottomY=t.topY+t.barLength,t.dragMultiplier=t.wiggleRoom/t.barWiggleRoom}).attr(`transform`,function(e){return u(e.width+n.scrollbarWidth/2+n.scrollbarOffset,R(e))});var c=s.selectAll(`.`+n.cn.scrollbar).data(o.repeat,o.keyFun);c.enter().append(`g`).classed(n.cn.scrollbar,!0);var l=c.selectAll(`.`+n.cn.scrollbarSlider).data(o.repeat,o.keyFun);l.enter().append(`g`).classed(n.cn.scrollbarSlider,!0),l.attr(`transform`,function(e){return u(0,e.scrollbarState.topY||0)});var d=l.selectAll(`.`+n.cn.scrollbarGlyph).data(o.repeat,o.keyFun);d.enter().append(`line`).classed(n.cn.scrollbarGlyph,!0).attr(`stroke`,`black`).attr(`stroke-width`,n.scrollbarWidth).attr(`stroke-linecap`,`round`).attr(`y1`,n.scrollbarWidth/2),d.attr(`y2`,function(e){return e.scrollbarState.barLength-n.scrollbarWidth/2}).attr(`stroke-opacity`,function(e){return e.columnDragInProgress||!e.scrollbarState.barWiggleRoom||i?0:.4}),d.transition().delay(0).duration(0),d.transition().delay(n.scrollbarHideDelay).duration(n.scrollbarHideDuration).attr(`stroke-opacity`,0);var f=c.selectAll(`.`+n.cn.scrollbarCaptureZone).data(o.repeat,o.keyFun);f.enter().append(`line`).classed(n.cn.scrollbarCaptureZone,!0).attr(`stroke`,`white`).attr(`stroke-opacity`,.01).attr(`stroke-width`,n.scrollbarCaptureWidth).attr(`stroke-linecap`,`butt`).attr(`y1`,0).on(`mousedown`,function(n){var i=r.event.y,a=this.getBoundingClientRect(),o=n.scrollbarState,s=i-a.top,c=r.scale.linear().domain([0,o.scrollableAreaHeight]).range([0,o.totalHeight]).clamp(!0);o.topY<=s&&s<=o.bottomY||V(t,e,null,c(s-o.barLength/2))(n)}).call(r.behavior.drag().origin(function(e){return r.event.stopPropagation(),e.scrollbarState.scrollbarScrollInProgress=!0,e}).on(`drag`,V(t,e)).on(`dragend`,function(){})),f.attr(`y2`,function(e){return e.scrollbarState.scrollableAreaHeight}),t._context.staticPlot&&(d.remove(),f.remove())}function b(e,t,n,r){var i=C(x(n));D(i),k(w(i));var a=T(E(i));O(a),A(a,t,r,e),K(i)}function x(e){var t=e.selectAll(`.`+n.cn.columnCells).data(o.repeat,o.keyFun);return t.enter().append(`g`).classed(n.cn.columnCells,!0),t.exit().remove(),t}function C(e){var t=e.selectAll(`.`+n.cn.columnCell).data(p.splitToCells,function(e){return e.keyWithinBlock});return t.enter().append(`g`).classed(n.cn.columnCell,!0),t.exit().remove(),t}function w(e){var t=e.selectAll(`.`+n.cn.cellRect).data(o.repeat,function(e){return e.keyWithinBlock});return t.enter().append(`rect`).classed(n.cn.cellRect,!0),t}function T(e){var t=e.selectAll(`.`+n.cn.cellText).data(o.repeat,function(e){return e.keyWithinBlock});return t.enter().append(`text`).classed(n.cn.cellText,!0).style(`cursor`,function(){return`auto`}).on(`mousedown`,function(){r.event.stopPropagation()}),t}function E(e){var t=e.selectAll(`.`+n.cn.cellTextHolder).data(o.repeat,function(e){return e.keyWithinBlock});return t.enter().append(`g`).classed(n.cn.cellTextHolder,!0).style(`shape-rendering`,`geometricPrecision`),t}function D(e){e.each(function(e,t){var n=e.calcdata.cells.font,r=e.column.specIndex,i={size:P(n.size,r,t),color:P(n.color,r,t),family:P(n.family,r,t),weight:P(n.weight,r,t),style:P(n.style,r,t),variant:P(n.variant,r,t),textcase:P(n.textcase,r,t),lineposition:P(n.lineposition,r,t),shadow:P(n.shadow,r,t)};e.rowNumber=e.key,e.align=P(e.calcdata.cells.align,r,t),e.cellBorderWidth=P(e.calcdata.cells.line.width,r,t),e.font=i})}function O(e){e.each(function(e){s.font(r.select(this),e.font)})}function k(e){e.attr(`width`,function(e){return e.column.columnWidth}).attr(`stroke-width`,function(e){return e.cellBorderWidth}).each(function(e){var t=r.select(this);m.stroke(t,P(e.calcdata.cells.line.color,e.column.specIndex,e.rowNumber)),m.fill(t,P(e.calcdata.cells.fill.color,e.column.specIndex,e.rowNumber))})}function A(e,t,i,o){e.text(function(e){var t=e.column.specIndex,r=e.rowNumber,i=e.value,o=typeof i==`string`,s=o&&i.match(/<br>/i),c=!o||s;e.mayHaveMarkup=o&&i.match(/[<&>]/);var l=j(i);e.latex=l;var u=l?``:P(e.calcdata.cells.prefix,t,r)||``,d=l?``:P(e.calcdata.cells.suffix,t,r)||``,f=l?null:P(e.calcdata.cells.format,t,r)||null,p=u+(f?a(f)(e.value):e.value)+d,m;e.wrappingNeeded=!e.wrapped&&!c&&!l&&(m=M(p)),e.cellHeightMayIncrease=s||l||e.mayHaveMarkup||(m===void 0?M(p):m),e.needsConvertToTspans=e.mayHaveMarkup||e.wrappingNeeded||e.latex;var h;if(e.wrappingNeeded){var g=(n.wrapSplitCharacter===` `?p.replace(/<a href=/gi,`<a_href=`):p).split(n.wrapSplitCharacter),_=n.wrapSplitCharacter===` `?g.map(function(e){return e.replace(/<a_href=/gi,`<a href=`)}):g;e.fragments=_.map(function(e){return{text:e,width:null}}),e.fragments.push({fragment:n.wrapSpacer,width:null}),h=_.join(n.lineBreaker)+n.lineBreaker+n.wrapSpacer}else delete e.fragments,h=p;return h}).attr(`dy`,function(e){return e.needsConvertToTspans?0:`0.75em`}).each(function(e){var a=this,s=r.select(a),l=e.wrappingNeeded?U:W;e.needsConvertToTspans?c.convertToTspans(s,o,l(i,a,t,o,e)):r.select(a.parentNode).attr(`transform`,function(e){return u(G(e),n.cellPad)}).attr(`text-anchor`,function(e){return{left:`start`,center:`middle`,right:`end`}[e.align]})})}function j(e){return typeof e==`string`&&e.match(n.latexCheck)}function M(e){return e.indexOf(n.wrapSplitCharacter)!==-1}function N(e,t,n){var r=t.gdColumnsOriginalOrder;t.gdColumns.sort(function(e,t){return n[r.indexOf(e)]-n[r.indexOf(t)]}),t.columnorder=n,e.emit(`plotly_restyle`)}function P(e,t,n){if(i.isArrayOrTypedArray(e)){var r=e[Math.min(t,e.length-1)];return i.isArrayOrTypedArray(r)?r[Math.min(n,r.length-1)]:r}else return e}function F(e,t,r){e.transition().ease(n.releaseTransitionEase).duration(n.releaseTransitionDuration).attr(`transform`,u(t.x,r))}function I(e){return e.type===`cells`}function L(e){return e.type===`header`}function R(e){return(e.rowBlocks.length?e.rowBlocks[0].auxiliaryBlocks:[]).reduce(function(e,t){return e+Y(t,1/0)},0)}function z(e,t,n){for(var r=[],i=0,a=0;a<e.length;a++){for(var o=e[a],s=o.rows,c=0,l=0;l<s.length;l++)c+=s[l].rowHeight;o.allRowsHeight=c;var u=i+c,d=t,f=d+n;d<u&&f>i&&r.push(a),i+=c}return r}function B(e,t,n){var r=v(t)[0];if(r!==void 0){var i=r.rowBlocks,a=r.calcdata,o=J(i,i.length),s=r.calcdata.groupHeight-R(r),c=a.scrollY=Math.max(0,Math.min(o-s,a.scrollY)),l=z(i,c,s);l.length===1&&(l[0]===i.length-1?l.unshift(l[0]-1):l.push(l[0]+1)),l[0]%2&&l.reverse(),t.each(function(e,t){e.page=l[t],e.scrollY=c}),t.attr(`transform`,function(e){return u(0,J(e.rowBlocks,e.page)-e.scrollY)}),e&&(H(e,n,t,l,r.prevPages,r,0),H(e,n,t,l,r.prevPages,r,1),y(n,e))}}function V(e,t,i,a){return function(o){var s=o.calcdata?o.calcdata:o,c=t.filter(function(e){return s.key===e.key}),l=i||s.scrollbarState.dragMultiplier,u=s.scrollY;return s.scrollY=a===void 0?s.scrollY+l*r.event.dy:a,B(e,c.selectAll(`.`+n.cn.yColumn).selectAll(`.`+n.cn.columnBlock).filter(I),c),s.scrollY===u}}function H(e,t,n,r,i,a,o){r[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){b(e,t,n.filter(function(e,t){return t===o&&r[t]!==i[t]}),n),i[o]=r[o]}))}function U(e,t,i,a){return function(){var o=r.select(t.parentNode);o.each(function(e){var t=e.fragments;o.selectAll(`tspan.line`).each(function(e,n){t[n].width=this.getComputedTextLength()});var r=t[t.length-1].width,i=t.slice(0,-1),a=[],s,c,l=0,u=e.column.columnWidth-2*n.cellPad;for(e.value=``;i.length;)s=i.shift(),c=s.width+r,l+c>u&&(e.value+=a.join(n.wrapSpacer)+n.lineBreaker,a=[],l=0),a.push(s.text),l+=c;l&&(e.value+=a.join(n.wrapSpacer)),e.wrapped=!0}),o.selectAll(`tspan.line`).remove(),A(o.select(`.`+n.cn.cellText),i,e,a),r.select(t.parentNode.parentNode).call(K)}}function W(e,t,i,a,o){return function(){if(!o.settledY){var s=r.select(t.parentNode),c=Z(o),l=o.key-c.firstRowIndex,d=c.rows[l].rowHeight,f=o.cellHeightMayIncrease?t.parentNode.getBoundingClientRect().height+2*n.cellPad:d,p=Math.max(f,d);p-c.rows[l].rowHeight&&(c.rows[l].rowHeight=p,e.selectAll(`.`+n.cn.columnCell).call(K),B(null,e.filter(I),0),y(i,a,!0)),s.attr(`transform`,function(){var e=this,t=e.parentNode.getBoundingClientRect(),i=r.select(e.parentNode).select(`.`+n.cn.cellRect).node().getBoundingClientRect(),a=e.transform.baseVal.consolidate(),s=i.top-t.top+(a?a.matrix.f:n.cellPad);return u(G(o,r.select(e.parentNode).select(`.`+n.cn.cellTextHolder).node().getBoundingClientRect().width),s)}),o.settledY=!0}}}function G(e,t){switch(e.align){case`left`:return n.cellPad;case`right`:return e.column.columnWidth-(t||0)-n.cellPad;case`center`:return(e.column.columnWidth-(t||0))/2;default:return n.cellPad}}function K(e){e.attr(`transform`,function(e){var t=e.rowBlocks[0].auxiliaryBlocks.reduce(function(e,t){return e+Y(t,1/0)},0);return u(0,Y(Z(e),e.key)+t)}).selectAll(`.`+n.cn.cellRect).attr(`height`,function(e){return Q(Z(e),e.key).rowHeight})}function J(e,t){for(var n=0,r=t-1;r>=0;r--)n+=X(e[r]);return n}function Y(e,t){for(var n=0,r=0;r<e.rows.length&&e.rows[r].rowIndex<t;r++)n+=e.rows[r].rowHeight;return n}function X(e){var t=e.allRowsHeight;if(t!==void 0)return t;for(var n=0,r=0;r<e.rows.length;r++)n+=e.rows[r].rowHeight;return e.allRowsHeight=n,n}function Z(e){return e.rowBlocks[e.page]}function Q(e,t){return e.rows[t-e.firstRowIndex]}}),zS=h(e=>{var t=wt().getModuleCalcData,n=RS(),r=`table`;e.name=r,e.plot=function(e){var i=t(e.calcdata,r)[0];i.length&&n(e,i)},e.clean=function(e,t,n,i){var a=i._has&&i._has(r),o=t._has&&t._has(r);a&&!o&&i._paperdiv.selectAll(`.table`).remove()}}),BS=h((e,t)=>{t.exports={attributes:MS(),supplyDefaults:NS(),calc:PS(),plot:RS(),moduleType:`trace`,name:`table`,basePlotModule:zS(),categories:[`noOpacity`],meta:{}}}),VS=h((e,t)=>{t.exports=BS()}),HS=h((e,t)=>{var n=B(),r=K(),i=Mt(),a=jt().descriptionWithDates,o=Ie().overrideAll,s=Le().dash,c=z().extendFlat;t.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:n({editType:`calc`}),offset:{valType:`number`,dflt:10,editType:`calc`},editType:`calc`},type:{valType:`enumerated`,values:[`-`,`linear`,`date`,`category`],dflt:`-`,editType:`calc`},autotypenumbers:i.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:c({},i.labelalias,{editType:`calc`}),tickfont:n({editType:`calc`}),tickangle:{valType:`angle`,dflt:`auto`,editType:`calc`},tickprefix:{valType:`string`,dflt:``,editType:`calc`},showtickprefix:{valType:`enumerated`,values:[`all`,`first`,`last`,`none`],dflt:`all`,editType:`calc`},ticksuffix:{valType:`string`,dflt:``,editType:`calc`},showticksuffix:{valType:`enumerated`,values:[`all`,`first`,`last`,`none`],dflt:`all`,editType:`calc`},showexponent:{valType:`enumerated`,values:[`all`,`first`,`last`,`none`],dflt:`all`,editType:`calc`},exponentformat:{valType:`enumerated`,values:[`none`,`e`,`E`,`power`,`SI`,`B`,`SI extended`],dflt:`B`,editType:`calc`},minexponent:{valType:`number`,dflt:3,min:0,editType:`calc`},separatethousands:{valType:`boolean`,dflt:!1,editType:`calc`},tickformat:{valType:`string`,dflt:``,editType:`calc`,description:a(`tick label`)},tickformatstops:o(i.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:r.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:c({},s,{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:c({},s,{editType:`calc`}),minorgridcolor:{valType:`color`,dflt:r.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`}}),US=h((e,t)=>{var n=B(),r=HS(),i=K(),a=n({editType:`calc`}),o=Tr().zorder;a.family.dflt=`"Open Sans", verdana, arial, sans-serif`,a.size.dflt=12,a.color.dflt=i.defaultLine,t.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:r,baxis:r,font:a,color:{valType:`color`,dflt:i.defaultLine,editType:`plot`},zorder:o}}),WS=h((e,t)=>{var n=$().isArray1D;t.exports=function(e,t,r){var i=r(`x`),a=i&&i.length,o=r(`y`),s=o&&o.length;if(!a&&!s)return!1;if(t._cheater=!i,(!a||n(i))&&(!s||n(o))){var c=a?i.length:1/0;s&&(c=Math.min(c,o.length)),t.a&&t.a.length&&(c=Math.min(c,t.a.length)),t.b&&t.b.length&&(c=Math.min(c,t.b.length)),t._length=c}else t._length=null;return!0}}),GS=h((e,t)=>{var n=US(),r=q().addOpacity,i=Ke(),a=$(),o=Rt(),s=Ht(),c=Ut(),l=wi(),u=rn(),d=an();t.exports=function(e,t,d){var p=d.letter,m=d.font||{},h=n[p+`axis`];function g(n,r){return a.coerce(e,t,h,n,r)}function _(n,r){return a.coerce2(e,t,h,n,r)}d.name&&(t._name=d.name,t._id=d.name),g(`autotypenumbers`,d.autotypenumbersDflt);var v=g(`type`);v===`-`&&(d.data&&f(t,d.data),t.type===`-`?t.type=`linear`:v=e.type=t.type),g(`smoothing`),g(`cheatertype`),g(`showticklabels`),g(`labelprefix`,p+` = `),g(`labelsuffix`),g(`showtickprefix`),g(`showticksuffix`),g(`separatethousands`),g(`tickformat`),g(`exponentformat`),g(`minexponent`),g(`showexponent`),g(`categoryorder`),g(`tickmode`),g(`tickvals`),g(`ticktext`),g(`tick0`),g(`dtick`),t.tickmode===`array`&&(g(`arraytick0`),g(`arraydtick`)),g(`labelpadding`),t._hovertitle=p,v===`date`&&i.getComponentMethod(`calendars`,`handleDefaults`)(e,t,`calendar`,d.calendar),u(t,d.fullLayout),t.c2p=a.identity;var y=g(`color`,d.dfltColor),b=y===e.color?y:m.color;g(`title.text`)&&(a.coerceFont(g,`title.font`,m,{overrideDflt:{size:a.bigFont(m.size),color:b}}),g(`title.offset`)),g(`tickangle`),g(`autorange`,!t.isValidRange(e.range))&&g(`rangemode`),g(`range`),t.cleanRange(),g(`fixedrange`),o(e,t,g,v),c(e,t,g,v,d),s(e,t,g,v,d),l(e,t,g,{data:d.data,dataAttr:p});var x=_(`gridcolor`,r(y,.3)),S=_(`gridwidth`),C=_(`griddash`),w=g(`showgrid`);w||(delete t.gridcolor,delete t.gridwidth,delete t.griddash);var T=_(`startlinecolor`,y),E=_(`startlinewidth`,S);g(`startline`,t.showgrid||!!T||!!E)||(delete t.startlinecolor,delete t.startlinewidth);var D=_(`endlinecolor`,y),O=_(`endlinewidth`,S);return g(`endline`,t.showgrid||!!D||!!O)||(delete t.endlinecolor,delete t.endlinewidth),w?(g(`minorgridcount`),g(`minorgridwidth`,S),g(`minorgriddash`,C),g(`minorgridcolor`,r(x,.06)),t.minorgridcount||(delete t.minorgridwidth,delete t.minorgriddash,delete t.minorgridcolor)):(delete t.gridcolor,delete t.gridwidth,delete t.griddash),t.showticklabels===`none`&&(delete t.tickfont,delete t.tickangle,delete t.showexponent,delete t.exponentformat,delete t.minexponent,delete t.tickformat,delete t.showticksuffix,delete t.showtickprefix),t.showticksuffix||delete t.ticksuffix,t.showtickprefix||delete t.tickprefix,g(`tickmode`),t};function f(e,t){if(e.type===`-`){var n=e[e._id.charAt(0)+`calendar`];e.type=d(t,n,{autotypenumbers:e.autotypenumbers})}}}),KS=h((e,t)=>{var n=GS(),r=yt();t.exports=function(e,t,n,r,a){r(`a`)||(r(`da`),r(`a0`)),r(`b`)||(r(`db`),r(`b0`)),i(e,t,n,a)};function i(e,t,i,a){[`aaxis`,`baxis`].forEach(function(o){var s=o.charAt(0),c=e[o]||{},l=r.newContainer(t,o);n(c,l,{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,tickfont:`x`,id:s+`axis`,letter:s,font:t.font,name:o,data:e[s],calendar:t.calendar,dfltColor:a,bgColor:i.paper_bgcolor,autotypenumbersDflt:i.autotypenumbers,fullLayout:i}),l._categories=l._categories||[],!e[o]&&c.type!==`-`&&(e[o]={type:c.type})})}}),qS=h((e,t)=>{var n=$(),r=WS(),i=KS(),a=US(),o=K();t.exports=function(e,t,s,c){function l(r,i){return n.coerce(e,t,a,r,i)}t._clipPathId=`clip`+t.uid+`carpet`;var u=l(`color`,o.defaultLine);if(n.coerceFont(l,`font`,c.font),l(`carpet`),i(e,t,c,l,u),!t.a||!t.b){t.visible=!1;return}t.a.length<3&&(t.aaxis.smoothing=0),t.b.length<3&&(t.baxis.smoothing=0),r(e,t,l)||(t.visible=!1),t._cheater&&l(`cheaterslope`),l(`zorder`)}}),JS=h((e,t)=>{var n=$().isArrayOrTypedArray;t.exports=function(e,t,r){var i;for(n(e)?e.length>t.length&&(e=e.slice(0,t.length)):e=[],i=0;i<t.length;i++)e[i]=r(t[i]);return e}}),YS=h((e,t)=>{t.exports=function(e,t,n){if(e.length===0)return``;var r,i=[],a=n?3:1;for(r=0;r<e.length;r+=a)i.push(e[r]+`,`+t[r]),n&&r<e.length-a&&(i.push(`C`),i.push([e[r+1]+`,`+t[r+1],e[r+2]+`,`+t[r+2]+` `].join(` `)));return i.join(n?``:`L`)}}),XS=h((e,t)=>{t.exports=function(e,t,n,r,i,a){var o=i[0]*e.dpdx(t),s=i[1]*e.dpdy(n),c=1,l=1;if(a){var u=Math.sqrt(i[0]*i[0]+i[1]*i[1]),d=Math.sqrt(a[0]*a[0]+a[1]*a[1]),f=(i[0]*a[0]+i[1]*a[1])/u/d;l=Math.max(0,f)}var p=Math.atan2(s,o)*180/Math.PI;return p<-90?(p+=180,c=-c):p>90&&(p-=180,c=-c),{angle:p,flip:c,p:e.c2p(r,t,n),offsetMultplier:l}}}),ZS=h((e,t)=>{var n=S(),r=tn(),i=JS(),a=YS(),o=XS(),s=kt(),c=$(),l=c.strRotate,u=c.strTranslate,d=Ot();t.exports=function(e,t,r,i){var a=e._context.staticPlot,o=t.xaxis,s=t.yaxis,l=e._fullLayout._clips;c.makeTraceGroups(i,r,`trace`).each(function(t){var r=n.select(this),i=t[0],u=i.trace,d=u.aaxis,g=u.baxis,_=c.ensureSingle(r,`g`,`minorlayer`),v=c.ensureSingle(r,`g`,`majorlayer`),y=c.ensureSingle(r,`g`,`boundarylayer`),b=c.ensureSingle(r,`g`,`labellayer`);r.style(`opacity`,u.opacity),p(o,s,v,d,`a`,d._gridlines,!0,a),p(o,s,v,g,`b`,g._gridlines,!0,a),p(o,s,_,d,`a`,d._minorgridlines,!0,a),p(o,s,_,g,`b`,g._minorgridlines,!0,a),p(o,s,y,d,`a-boundary`,d._boundarylines,a),p(o,s,y,g,`b-boundary`,g._boundarylines,a),h(e,b,u,i,o,s,m(e,o,s,u,i,b,d._labels,`a-label`),m(e,o,s,u,i,b,g._labels,`b-label`)),f(u,i,l,o,s)})};function f(e,t,n,r,o){var s,l,u,d,f=n.select(`#`+e._clipPathId);f.size()||(f=n.append(`clipPath`).classed(`carpetclip`,!0));var p=c.ensureSingle(f,`path`,`carpetboundary`),m=t.clipsegments,h=[];for(d=0;d<m.length;d++)s=m[d],l=i([],s.x,r.c2p),u=i([],s.y,o.c2p),h.push(a(l,u,s.bicubic));var g=`M`+h.join(`L`)+`Z`;f.attr(`id`,e._clipPathId),p.attr(`d`,g)}function p(e,t,o,s,c,l,u){var d=`const-`+c+`-lines`,f=o.selectAll(`.`+d).data(l);f.enter().append(`path`).classed(d,!0).style(`vector-effect`,u?`none`:`non-scaling-stroke`),f.each(function(o){var s=o,c=s.x,l=s.y,u=`M`+a(i([],c,e.c2p),i([],l,t.c2p),s.smoothing);n.select(this).attr(`d`,u).style(`stroke-width`,s.width).style(`stroke`,s.color).style(`stroke-dasharray`,r.dashStyle(s.dash,s.width)).style(`fill`,`none`)}),f.exit().remove()}function m(e,t,i,a,c,d,f,p){var m=d.selectAll(`text.`+p).data(f);m.enter().append(`text`).classed(p,!0);var h=0,g={};return m.each(function(c,d){var f;if(c.axis.tickangle===`auto`)f=o(a,t,i,c.xy,c.dxy);else{var p=(c.axis.tickangle+180)*Math.PI/180;f=o(a,t,i,c.xy,[Math.cos(p),Math.sin(p)])}d||(g={angle:f.angle,flip:f.flip});var m=(c.endAnchor?-1:1)*f.flip,_=n.select(this).attr({"text-anchor":m>0?`start`:`end`,"data-notex":1}).call(r.font,c.font).text(c.text).call(s.convertToTspans,e),v=r.bBox(this);_.attr(`transform`,u(f.p[0],f.p[1])+l(f.angle)+u(c.axis.labelpadding*m,v.height*.3)),h=Math.max(h,v.width+c.axis.labelpadding)}),m.exit().remove(),g.maxExtent=h,g}function h(e,t,n,r,i,a,s,l){var u,d,f,p,m=c.aggNums(Math.min,null,n.a),h=c.aggNums(Math.max,null,n.a),g=c.aggNums(Math.min,null,n.b),_=c.aggNums(Math.max,null,n.b);u=.5*(m+h),d=g,f=n.ab2xy(u,d,!0),p=n.dxyda_rough(u,d),s.angle===void 0&&c.extendFlat(s,o(n,i,a,f,n.dxydb_rough(u,d))),v(e,t,n,r,f,p,n.aaxis,i,a,s,`a-title`),u=m,d=.5*(g+_),f=n.ab2xy(u,d,!0),p=n.dxydb_rough(u,d),l.angle===void 0&&c.extendFlat(l,o(n,i,a,f,n.dxyda_rough(u,d))),v(e,t,n,r,f,p,n.baxis,i,a,l,`b-title`)}var g=d.LINE_SPACING,_=(1-d.MID_SHIFT)/g+1;function v(e,t,i,a,c,d,f,p,m,h,v){var y=[];f.title.text&&y.push(f.title.text);var b=t.selectAll(`text.`+v).data(y),x=h.maxExtent;b.enter().append(`text`).classed(v,!0),b.each(function(){var t=o(i,p,m,c,d);[`start`,`both`].indexOf(f.showticklabels)===-1&&(x=0);var a=f.title.font.size;x+=a+f.title.offset;var v=(h.angle+(h.flip<0?180:0)-t.angle+450)%360,y=v>90&&v<270,b=n.select(this);b.text(f.title.text).call(s.convertToTspans,e),y&&(x=(-s.lineCount(b)+_)*g*a-x),b.attr(`transform`,u(t.p[0],t.p[1])+l(t.angle)+u(0,x)).attr(`text-anchor`,`middle`).call(r.font,f.title.font)}),b.exit().remove()}}),QS=h((e,t)=>{var n=$().isArrayOrTypedArray;t.exports=function(e,t,r){var i,a,o,s,c,l,u=[],d=n(e)?e.length:e,f=n(t)?t.length:t,p=n(e)?e:null,m=n(t)?t:null;p&&(o=(p.length-1)/(p[p.length-1]-p[0])/(d-1)),m&&(s=(m.length-1)/(m[m.length-1]-m[0])/(f-1));var h,g=1/0,_=-1/0;for(a=0;a<f;a++)for(u[a]=[],l=m?(m[a]-m[0])*s:a/(f-1),i=0;i<d;i++)c=p?(p[i]-p[0])*o:i/(d-1),h=c-l*r,g=Math.min(h,g),_=Math.max(h,_),u[a][i]=h;var v=1/(_-g),y=-g*v;for(a=0;a<f;a++)for(i=0;i<d;i++)u[a][i]=v*u[a][i]+y;return u}}),$S=h((e,t)=>{var n=$().isArrayOrTypedArray;t.exports=function(e){return r(e,0)};function r(e,t){if(!n(e)||t>=10)return null;for(var i=1/0,a=-1/0,o=e.length,s=0;s<o;s++){var c=e[s];if(n(c)){var l=r(c,t+1);l&&(i=Math.min(l[0],i),a=Math.max(l[1],a))}else i=Math.min(c,i),a=Math.max(c,a)}return[i,a]}}),eC=h((e,t)=>{var n=sn(),r=z().extendFlat;t.exports=function(e,t,i){var a,o,s,c,l,u,d,f,p,m,h,g,_,v,y=e[`_`+t],b=e[t+`axis`],x=b._gridlines=[],S=b._minorgridlines=[],C=b._boundarylines=[],w=e[`_`+i],T=e[i+`axis`];b.tickmode===`array`&&(b.tickvals=y.slice());var E=e._xctrl,D=e._yctrl,O=E[0].length,k=E.length,A=e._a.length,j=e._b.length;n.prepTicks(b),b.tickmode===`array`&&delete b.tickvals;var M=b.smoothing?3:1;function N(n){var r,a,o,s,c,l,u,d,p,m,h,g,_=[],v=[],y={};if(t===`b`)for(a=e.b2j(n),o=Math.floor(Math.max(0,Math.min(j-2,a))),s=a-o,y.length=j,y.crossLength=A,y.xy=function(t){return e.evalxy([],t,a)},y.dxy=function(t,n){return e.dxydi([],t,o,n,s)},r=0;r<A;r++)l=Math.min(A-2,r),u=r-l,d=e.evalxy([],r,a),T.smoothing&&r>0&&(p=e.dxydi([],r-1,o,0,s),_.push(c[0]+p[0]/3),v.push(c[1]+p[1]/3),m=e.dxydi([],r-1,o,1,s),_.push(d[0]-m[0]/3),v.push(d[1]-m[1]/3)),_.push(d[0]),v.push(d[1]),c=d;else for(r=e.a2i(n),l=Math.floor(Math.max(0,Math.min(A-2,r))),u=r-l,y.length=A,y.crossLength=j,y.xy=function(t){return e.evalxy([],r,t)},y.dxy=function(t,n){return e.dxydj([],l,t,u,n)},a=0;a<j;a++)o=Math.min(j-2,a),s=a-o,d=e.evalxy([],r,a),T.smoothing&&a>0&&(h=e.dxydj([],l,a-1,u,0),_.push(c[0]+h[0]/3),v.push(c[1]+h[1]/3),g=e.dxydj([],l,a-1,u,1),_.push(d[0]-g[0]/3),v.push(d[1]-g[1]/3)),_.push(d[0]),v.push(d[1]),c=d;return y.axisLetter=t,y.axis=b,y.crossAxis=T,y.value=n,y.constvar=i,y.index=f,y.x=_,y.y=v,y.smoothing=T.smoothing,y}function P(n){var r,a,o,s,c,l=[],u=[],d={};if(d.length=y.length,d.crossLength=w.length,t===`b`)for(o=Math.max(0,Math.min(j-2,n)),c=Math.min(1,Math.max(0,n-o)),d.xy=function(t){return e.evalxy([],t,n)},d.dxy=function(t,n){return e.dxydi([],t,o,n,c)},r=0;r<O;r++)l[r]=E[n*M][r],u[r]=D[n*M][r];else for(a=Math.max(0,Math.min(A-2,n)),s=Math.min(1,Math.max(0,n-a)),d.xy=function(t){return e.evalxy([],n,t)},d.dxy=function(t,n){return e.dxydj([],a,t,s,n)},r=0;r<k;r++)l[r]=E[r][n*M],u[r]=D[r][n*M];return d.axisLetter=t,d.axis=b,d.crossAxis=T,d.value=y[n],d.constvar=i,d.index=n,d.x=l,d.y=u,d.smoothing=T.smoothing,d}if(b.tickmode===`array`){for(c=5e-15,l=[Math.floor((y.length-1-b.arraytick0)/b.arraydtick*(1+c)),Math.ceil(-b.arraytick0/b.arraydtick/(1+c))].sort(function(e,t){return e-t}),u=l[0]-1,d=l[1]+1,f=u;f<d;f++)o=b.arraytick0+b.arraydtick*f,!(o<0||o>y.length-1)&&x.push(r(P(o),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(f=u;f<d;f++)if(s=b.arraytick0+b.arraydtick*f,h=Math.min(s+b.arraydtick,y.length-1),!(s<0||s>y.length-1)&&!(h<0||h>y.length-1))for(g=y[s],_=y[h],a=0;a<b.minorgridcount;a++)v=h-s,!(v<=0)&&(m=g+(_-g)*(a+1)/(b.minorgridcount+1)*(b.arraydtick/v),!(m<y[0]||m>y[y.length-1])&&S.push(r(N(m),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash})));b.startline&&C.push(r(P(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&C.push(r(P(y.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(c=5e-15,l=[Math.floor((y[y.length-1]-b.tick0)/b.dtick*(1+c)),Math.ceil((y[0]-b.tick0)/b.dtick/(1+c))].sort(function(e,t){return e-t}),u=l[0],d=l[1],f=u;f<=d;f++)p=b.tick0+b.dtick*f,x.push(r(N(p),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(f=u-1;f<d+1;f++)for(p=b.tick0+b.dtick*f,a=0;a<b.minorgridcount;a++)m=p+b.dtick*(a+1)/(b.minorgridcount+1),!(m<y[0]||m>y[y.length-1])&&S.push(r(N(m),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&C.push(r(N(y[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&C.push(r(N(y[y.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}}),tC=h((e,t)=>{var n=sn(),r=z().extendFlat;t.exports=function(e,t){var i,a,o,s,c,l=t._labels=[],u=t._gridlines;for(i=0;i<u.length;i++)c=u[i],[`start`,`both`].indexOf(t.showticklabels)!==-1&&(a=n.tickText(t,c.value),r(a,{prefix:o,suffix:s,endAnchor:!0,xy:c.xy(0),dxy:c.dxy(0,0),axis:c.axis,length:c.crossAxis.length,font:c.axis.tickfont,isFirst:i===0,isLast:i===u.length-1}),l.push(a)),[`end`,`both`].indexOf(t.showticklabels)!==-1&&(a=n.tickText(t,c.value),r(a,{endAnchor:!1,xy:c.xy(c.crossLength-1),dxy:c.dxy(c.crossLength-2,1),axis:c.axis,length:c.crossAxis.length,font:c.axis.tickfont,isFirst:i===0,isLast:i===u.length-1}),l.push(a))}}),nC=h((e,t)=>{t.exports=function(e,t,n,r){var i,a,o,s=[],c=!!n.smoothing,l=!!r.smoothing,u=e[0].length-1,d=e.length-1;for(i=0,a=[],o=[];i<=u;i++)a[i]=e[0][i],o[i]=t[0][i];for(s.push({x:a,y:o,bicubic:c}),i=0,a=[],o=[];i<=d;i++)a[i]=e[i][u],o[i]=t[i][u];for(s.push({x:a,y:o,bicubic:l}),i=u,a=[],o=[];i>=0;i--)a[u-i]=e[d][i],o[u-i]=t[d][i];for(s.push({x:a,y:o,bicubic:c}),i=d,a=[],o=[];i>=0;i--)a[d-i]=e[i][0],o[d-i]=t[i][0];return s.push({x:a,y:o,bicubic:l}),s}}),rC=h((e,t)=>{var n=$();t.exports=function(e,t,r){var i,a,o,s=[],c=[],l=e[0].length,u=e.length;function d(t,n){var r=0,i,a=0;return t>0&&(i=e[n][t-1])!==void 0&&(a++,r+=i),t<l-1&&(i=e[n][t+1])!==void 0&&(a++,r+=i),n>0&&(i=e[n-1][t])!==void 0&&(a++,r+=i),n<u-1&&(i=e[n+1][t])!==void 0&&(a++,r+=i),r/Math.max(1,a)}var f=0;for(i=0;i<l;i++)for(a=0;a<u;a++)e[a][i]===void 0&&(s.push(i),c.push(a),e[a][i]=d(i,a)),f=Math.max(f,Math.abs(e[a][i]));if(!s.length)return e;var p,m,h,g,_,v,y,b,x,S,C,w=1e-5,T=0,E=100,D=0,O=s.length;do{for(T=0,o=0;o<O;o++){i=s[o],a=c[o];var k=0,A=0,j,M,N,P,F,I;i===0?(F=Math.min(l-1,2),N=t[F],P=t[1],j=e[a][F],M=e[a][1],A+=M+(M-j)*(t[0]-P)/(P-N),k++):i===l-1&&(F=Math.max(0,l-3),N=t[F],P=t[l-2],j=e[a][F],M=e[a][l-2],A+=M+(M-j)*(t[l-1]-P)/(P-N),k++),(i===0||i===l-1)&&a>0&&a<u-1&&(p=r[a+1]-r[a],m=r[a]-r[a-1],A+=(m*e[a+1][i]+p*e[a-1][i])/(m+p),k++),a===0?(I=Math.min(u-1,2),N=r[I],P=r[1],j=e[I][i],M=e[1][i],A+=M+(M-j)*(r[0]-P)/(P-N),k++):a===u-1&&(I=Math.max(0,u-3),N=r[I],P=r[u-2],j=e[I][i],M=e[u-2][i],A+=M+(M-j)*(r[u-1]-P)/(P-N),k++),(a===0||a===u-1)&&i>0&&i<l-1&&(p=t[i+1]-t[i],m=t[i]-t[i-1],A+=(m*e[a][i+1]+p*e[a][i-1])/(m+p),k++),k?A/=k:(h=t[i+1]-t[i],g=t[i]-t[i-1],_=r[a+1]-r[a],v=r[a]-r[a-1],y=h*g*(h+g),b=_*v*(_+v),A=(y*(v*e[a+1][i]+_*e[a-1][i])+b*(g*e[a][i+1]+h*e[a][i-1]))/(b*(g+h)+y*(v+_))),x=A-e[a][i],S=x/f,T+=S*S,C=k?0:.85,e[a][i]+=x*(1+C)}T=Math.sqrt(T)}while(D++<E&&T>w);return n.log(`Smoother converged to`,T,`after`,D,`iterations`),e}}),iC=h((e,t)=>{t.exports={RELATIVE_CULL_TOLERANCE:1e-6}}),aC=h((e,t)=>{var n=.5;t.exports=function(e,t,r,i){var a=e[0]-t[0],o=e[1]-t[1],s=r[0]-t[0],c=r[1]-t[1],l=(a*a+o*o)**(n/2),u=(s*s+c*c)**(n/2),d=(u*u*a-l*l*s)*i,f=(u*u*o-l*l*c)*i,p=u*(l+u)*3,m=l*(l+u)*3;return[[t[0]+(p&&d/p),t[1]+(p&&f/p)],[t[0]-(m&&d/m),t[1]-(m&&f/m)]]}}),oC=h((e,t)=>{var n=aC(),r=$().ensureArray;function i(e,t,n){var r=-.5*n[0]+1.5*t[0],i=-.5*n[1]+1.5*t[1];return[(2*r+e[0])/3,(2*i+e[1])/3]}t.exports=function(e,t,a,o,s,c){var l,u,d,f,p,m,h,g,_,v,y=a[0].length,b=a.length,x=s?3*y-2:y,S=c?3*b-2:b;for(e=r(e,S),t=r(t,S),d=0;d<S;d++)e[d]=r(e[d],x),t[d]=r(t[d],x);for(u=0,f=0;u<b;u++,f+=c?3:1)for(p=e[f],m=t[f],h=a[u],g=o[u],l=0,d=0;l<y;l++,d+=s?3:1)p[d]=h[l],m[d]=g[l];if(s)for(u=0,f=0;u<b;u++,f+=c?3:1){for(l=1,d=3;l<y-1;l++,d+=3)_=n([a[u][l-1],o[u][l-1]],[a[u][l],o[u][l]],[a[u][l+1],o[u][l+1]],s),e[f][d-1]=_[0][0],t[f][d-1]=_[0][1],e[f][d+1]=_[1][0],t[f][d+1]=_[1][1];v=i([e[f][0],t[f][0]],[e[f][2],t[f][2]],[e[f][3],t[f][3]]),e[f][1]=v[0],t[f][1]=v[1],v=i([e[f][x-1],t[f][x-1]],[e[f][x-3],t[f][x-3]],[e[f][x-4],t[f][x-4]]),e[f][x-2]=v[0],t[f][x-2]=v[1]}if(c)for(d=0;d<x;d++){for(f=3;f<S-3;f+=3)_=n([e[f-3][d],t[f-3][d]],[e[f][d],t[f][d]],[e[f+3][d],t[f+3][d]],c),e[f-1][d]=_[0][0],t[f-1][d]=_[0][1],e[f+1][d]=_[1][0],t[f+1][d]=_[1][1];v=i([e[0][d],t[0][d]],[e[2][d],t[2][d]],[e[3][d],t[3][d]]),e[1][d]=v[0],t[1][d]=v[1],v=i([e[S-1][d],t[S-1][d]],[e[S-3][d],t[S-3][d]],[e[S-4][d],t[S-4][d]]),e[S-2][d]=v[0],t[S-2][d]=v[1]}if(s&&c)for(f=1;f<S;f+=(f+1)%3==0?2:1){for(d=3;d<x-3;d+=3)_=n([e[f][d-3],t[f][d-3]],[e[f][d],t[f][d]],[e[f][d+3],t[f][d+3]],s),e[f][d-1]=.5*(e[f][d-1]+_[0][0]),t[f][d-1]=.5*(t[f][d-1]+_[0][1]),e[f][d+1]=.5*(e[f][d+1]+_[1][0]),t[f][d+1]=.5*(t[f][d+1]+_[1][1]);v=i([e[f][0],t[f][0]],[e[f][2],t[f][2]],[e[f][3],t[f][3]]),e[f][1]=.5*(e[f][1]+v[0]),t[f][1]=.5*(t[f][1]+v[1]),v=i([e[f][x-1],t[f][x-1]],[e[f][x-3],t[f][x-3]],[e[f][x-4],t[f][x-4]]),e[f][x-2]=.5*(e[f][x-2]+v[0]),t[f][x-2]=.5*(t[f][x-2]+v[1])}return[e,t]}}),sC=h((e,t)=>{t.exports=function(e,t,n,r,i){var a=t-2,o=n-2;return r&&i?function(t,n,r){t||=[];var i,s,c,l,u,d,f=Math.max(0,Math.min(Math.floor(n),a)),p=Math.max(0,Math.min(Math.floor(r),o)),m=Math.max(0,Math.min(1,n-f)),h=Math.max(0,Math.min(1,r-p));f*=3,p*=3;var g=m*m,_=g*m,v=1-m,y=v*v,b=y*v,x=h*h,S=x*h,C=1-h,w=C*C,T=w*C;for(d=0;d<e.length;d++)u=e[d],i=b*u[p][f]+3*(y*m*u[p][f+1]+v*g*u[p][f+2])+_*u[p][f+3],s=b*u[p+1][f]+3*(y*m*u[p+1][f+1]+v*g*u[p+1][f+2])+_*u[p+1][f+3],c=b*u[p+2][f]+3*(y*m*u[p+2][f+1]+v*g*u[p+2][f+2])+_*u[p+2][f+3],l=b*u[p+3][f]+3*(y*m*u[p+3][f+1]+v*g*u[p+3][f+2])+_*u[p+3][f+3],t[d]=T*i+3*(w*h*s+C*x*c)+S*l;return t}:r?function(t,n,r){t||=[];var i=Math.max(0,Math.min(Math.floor(n),a)),s=Math.max(0,Math.min(Math.floor(r),o)),c=Math.max(0,Math.min(1,n-i)),l=Math.max(0,Math.min(1,r-s)),u,d,f,p,m,h;i*=3;var g=c*c,_=g*c,v=1-c,y=v*v,b=y*v,x=1-l;for(m=0;m<e.length;m++)h=e[m],u=x*h[s][i]+l*h[s+1][i],d=x*h[s][i+1]+l*h[s+1][i+1],f=x*h[s][i+2]+l*h[s+1][i+1],p=x*h[s][i+3]+l*h[s+1][i+1],t[m]=b*u+3*(y*c*d+v*g*f)+_*p;return t}:i?function(t,n,r){t||=[];var i=Math.max(0,Math.min(Math.floor(n),a)),s=Math.max(0,Math.min(Math.floor(r),o)),c=Math.max(0,Math.min(1,n-i)),l=Math.max(0,Math.min(1,r-s)),u,d,f,p,m,h;s*=3;var g=l*l,_=g*l,v=1-l,y=v*v,b=y*v,x=1-c;for(m=0;m<e.length;m++)h=e[m],u=x*h[s][i]+c*h[s][i+1],d=x*h[s+1][i]+c*h[s+1][i+1],f=x*h[s+2][i]+c*h[s+2][i+1],p=x*h[s+3][i]+c*h[s+3][i+1],t[m]=b*u+3*(y*l*d+v*g*f)+_*p;return t}:function(t,n,r){t||=[];var i=Math.max(0,Math.min(Math.floor(n),a)),s=Math.max(0,Math.min(Math.floor(r),o)),c=Math.max(0,Math.min(1,n-i)),l=Math.max(0,Math.min(1,r-s)),u,d,f,p,m=1-l,h=1-c;for(f=0;f<e.length;f++)p=e[f],u=h*p[s][i]+c*p[s][i+1],d=h*p[s+1][i]+c*p[s+1][i+1],t[f]=m*u+l*d;return t}}}),cC=h((e,t)=>{t.exports=function(e,t,n){return t&&n?function(t,n,r,i,a){t||=[];var o,s,c,l,u,d;n*=3,r*=3;var f=i*i,p=1-i,m=p*p,h=p*i*2,g=-3*m,_=3*(m-h),v=3*(h-f),y=3*f,b=a*a,x=b*a,S=1-a,C=S*S,w=C*S;for(d=0;d<e.length;d++)u=e[d],o=g*u[r][n]+_*u[r][n+1]+v*u[r][n+2]+y*u[r][n+3],s=g*u[r+1][n]+_*u[r+1][n+1]+v*u[r+1][n+2]+y*u[r+1][n+3],c=g*u[r+2][n]+_*u[r+2][n+1]+v*u[r+2][n+2]+y*u[r+2][n+3],l=g*u[r+3][n]+_*u[r+3][n+1]+v*u[r+3][n+2]+y*u[r+3][n+3],t[d]=w*o+3*(C*a*s+S*b*c)+x*l;return t}:t?function(t,n,r,i,a){t||=[];var o,s,c,l;n*=3;var u=i*i,d=1-i,f=d*d,p=d*i*2,m=-3*f,h=3*(f-p),g=3*(p-u),_=3*u,v=1-a;for(c=0;c<e.length;c++)l=e[c],o=m*l[r][n]+h*l[r][n+1]+g*l[r][n+2]+_*l[r][n+3],s=m*l[r+1][n]+h*l[r+1][n+1]+g*l[r+1][n+2]+_*l[r+1][n+3],t[c]=v*o+a*s;return t}:n?function(t,n,r,i,a){t||=[];var o,s,c,l,u,d;r*=3;var f=a*a,p=f*a,m=1-a,h=m*m,g=h*m;for(u=0;u<e.length;u++)d=e[u],o=d[r][n+1]-d[r][n],s=d[r+1][n+1]-d[r+1][n],c=d[r+2][n+1]-d[r+2][n],l=d[r+3][n+1]-d[r+3][n],t[u]=g*o+3*(h*a*s+m*f*c)+p*l;return t}:function(t,n,r,i,a){t||=[];var o,s,c,l,u=1-a;for(c=0;c<e.length;c++)l=e[c],o=l[r][n+1]-l[r][n],s=l[r+1][n+1]-l[r+1][n],t[c]=u*o+a*s;return t}}}),lC=h((e,t)=>{t.exports=function(e,t,n){return t&&n?function(t,n,r,i,a){t||=[];var o,s,c,l,u,d;n*=3,r*=3;var f=i*i,p=f*i,m=1-i,h=m*m,g=h*m,_=a*a,v=1-a,y=v*v,b=v*a*2,x=-3*y,S=3*(y-b),C=3*(b-_),w=3*_;for(d=0;d<e.length;d++)u=e[d],o=x*u[r][n]+S*u[r+1][n]+C*u[r+2][n]+w*u[r+3][n],s=x*u[r][n+1]+S*u[r+1][n+1]+C*u[r+2][n+1]+w*u[r+3][n+1],c=x*u[r][n+2]+S*u[r+1][n+2]+C*u[r+2][n+2]+w*u[r+3][n+2],l=x*u[r][n+3]+S*u[r+1][n+3]+C*u[r+2][n+3]+w*u[r+3][n+3],t[d]=g*o+3*(h*i*s+m*f*c)+p*l;return t}:t?function(t,n,r,i,a){t||=[];var o,s,c,l,u,d;n*=3;var f=a*a,p=f*a,m=1-a,h=m*m,g=h*m;for(u=0;u<e.length;u++)d=e[u],o=d[r+1][n]-d[r][n],s=d[r+1][n+1]-d[r][n+1],c=d[r+1][n+2]-d[r][n+2],l=d[r+1][n+3]-d[r][n+3],t[u]=g*o+3*(h*a*s+m*f*c)+p*l;return t}:n?function(t,n,r,i,a){t||=[];var o,s,c,l;r*=3;var u=1-i,d=a*a,f=1-a,p=f*f,m=f*a*2,h=-3*p,g=3*(p-m),_=3*(m-d),v=3*d;for(c=0;c<e.length;c++)l=e[c],o=h*l[r][n]+g*l[r+1][n]+_*l[r+2][n]+v*l[r+3][n],s=h*l[r][n+1]+g*l[r+1][n+1]+_*l[r+2][n+1]+v*l[r+3][n+1],t[c]=u*o+i*s;return t}:function(t,n,r,i,a){t||=[];var o,s,c,l,u=1-i;for(c=0;c<e.length;c++)l=e[c],o=l[r+1][n]-l[r][n],s=l[r+1][n+1]-l[r][n+1],t[c]=u*o+i*s;return t}}}),uC=h((e,t)=>{var n=iC(),r=Ye().findBin,i=oC(),a=sC(),o=cC(),s=lC();t.exports=function(e){var t=e._a,c=e._b,l=t.length,u=c.length,d=e.aaxis,f=e.baxis,p=t[0],m=t[l-1],h=c[0],g=c[u-1],_=t[t.length-1]-t[0],v=c[c.length-1]-c[0],y=_*n.RELATIVE_CULL_TOLERANCE,b=v*n.RELATIVE_CULL_TOLERANCE;p-=y,m+=y,h-=b,g+=b,e.isVisible=function(e,t){return e>p&&e<m&&t>h&&t<g},e.isOccluded=function(e,t){return e<p||e>m||t<h||t>g},e.setScale=function(){var t=e._x,n=e._y,r=i(e._xctrl,e._yctrl,t,n,d.smoothing,f.smoothing);e._xctrl=r[0],e._yctrl=r[1],e.evalxy=a([e._xctrl,e._yctrl],l,u,d.smoothing,f.smoothing),e.dxydi=o([e._xctrl,e._yctrl],d.smoothing,f.smoothing),e.dxydj=s([e._xctrl,e._yctrl],d.smoothing,f.smoothing)},e.i2a=function(e){var n=Math.max(0,Math.floor(e[0]),l-2),r=e[0]-n;return(1-r)*t[n]+r*t[n+1]},e.j2b=function(e){var t=Math.max(0,Math.floor(e[1]),l-2),n=e[1]-t;return(1-n)*c[t]+n*c[t+1]},e.ij2ab=function(t){return[e.i2a(t[0]),e.j2b(t[1])]},e.a2i=function(e){var n=Math.max(0,Math.min(r(e,t),l-2)),i=t[n],a=t[n+1];return Math.max(0,Math.min(l-1,n+(e-i)/(a-i)))},e.b2j=function(e){var t=Math.max(0,Math.min(r(e,c),u-2)),n=c[t],i=c[t+1];return Math.max(0,Math.min(u-1,t+(e-n)/(i-n)))},e.ab2ij=function(t){return[e.a2i(t[0]),e.b2j(t[1])]},e.i2c=function(t,n){return e.evalxy([],t,n)},e.ab2xy=function(n,r,i){if(!i&&(n<t[0]||n>t[l-1]|r<c[0]||r>c[u-1]))return[!1,!1];var a=e.a2i(n),o=e.b2j(r),s=e.evalxy([],a,o);if(i){var d=0,f=0,p=[],m,h,g,_;n<t[0]?(m=0,h=0,d=(n-t[0])/(t[1]-t[0])):n>t[l-1]?(m=l-2,h=1,d=(n-t[l-1])/(t[l-1]-t[l-2])):(m=Math.max(0,Math.min(l-2,Math.floor(a))),h=a-m),r<c[0]?(g=0,_=0,f=(r-c[0])/(c[1]-c[0])):r>c[u-1]?(g=u-2,_=1,f=(r-c[u-1])/(c[u-1]-c[u-2])):(g=Math.max(0,Math.min(u-2,Math.floor(o))),_=o-g),d&&(e.dxydi(p,m,g,h,_),s[0]+=p[0]*d,s[1]+=p[1]*d),f&&(e.dxydj(p,m,g,h,_),s[0]+=p[0]*f,s[1]+=p[1]*f)}return s},e.c2p=function(e,t,n){return[t.c2p(e[0]),n.c2p(e[1])]},e.p2x=function(e,t,n){return[t.p2c(e[0]),n.p2c(e[1])]},e.dadi=function(e){var n=Math.max(0,Math.min(t.length-2,e));return t[n+1]-t[n]},e.dbdj=function(e){var t=Math.max(0,Math.min(c.length-2,e));return c[t+1]-c[t]},e.dxyda=function(t,n,r,i){var a=e.dxydi(null,t,n,r,i),o=e.dadi(t,r);return[a[0]/o,a[1]/o]},e.dxydb=function(t,n,r,i){var a=e.dxydj(null,t,n,r,i),o=e.dbdj(n,i);return[a[0]/o,a[1]/o]},e.dxyda_rough=function(t,n,r){var i=_*(r||.1),a=e.ab2xy(t+i,n,!0),o=e.ab2xy(t-i,n,!0);return[(a[0]-o[0])*.5/i,(a[1]-o[1])*.5/i]},e.dxydb_rough=function(t,n,r){var i=v*(r||.1),a=e.ab2xy(t,n+i,!0),o=e.ab2xy(t,n-i,!0);return[(a[0]-o[0])*.5/i,(a[1]-o[1])*.5/i]},e.dpdx=function(e){return e._m},e.dpdy=function(e){return e._m}}}),dC=h((e,t)=>{var n=sn(),r=$().isArray1D,i=QS(),a=$S(),o=eC(),s=tC(),c=nC(),l=Fo(),u=rC(),d=Po(),f=uC();t.exports=function(e,t){var p=n.getFromId(e,t.xaxis),m=n.getFromId(e,t.yaxis),h=t.aaxis,g=t.baxis,_=t.x,v=t.y,y=[];_&&r(_)&&y.push(`x`),v&&r(v)&&y.push(`y`),y.length&&d(t,h,g,`a`,`b`,y);var b=t._a=t._a||t.a,x=t._b=t._b||t.b;_=t._x||t.x,v=t._y||t.y;var S={};t._cheater&&(_=i(h.cheatertype===`index`?b.length:b,g.cheatertype===`index`?x.length:x,t.cheaterslope)),t._x=_=l(_),t._y=v=l(v),u(_,b,x),u(v,b,x),f(t),t.setScale();var C=a(_),w=a(v),T=.5*(C[1]-C[0]),E=.5*(C[1]+C[0]),D=.5*(w[1]-w[0]),O=.5*(w[1]+w[0]),k=1.3;return C=[E-T*k,E+T*k],w=[O-D*k,O+D*k],t._extremes[p._id]=n.findExtremes(p,C,{padded:!0}),t._extremes[m._id]=n.findExtremes(m,w,{padded:!0}),o(t,`a`,`b`),o(t,`b`,`a`),s(t,h),s(t,g),S.clipsegments=c(t._xctrl,t._yctrl,h,g),S.x=_,S.y=v,S.a=b,S.b=x,[S]}}),fC=h((e,t)=>{t.exports={attributes:US(),supplyDefaults:qS(),plot:ZS(),calc:dC(),animatable:!0,isContainer:!0,moduleType:`trace`,name:`carpet`,basePlotModule:Ai(),categories:[`cartesian`,`svg`,`carpet`,`carpetAxis`,`notLegendIsolatable`,`noMultiCategory`,`noHover`,`noSortingByValue`],meta:{}}}),pC=h((e,t)=>{t.exports=fC()}),mC=h((e,t)=>{var n=wr(),r=Tr(),i=W(),{hovertemplateAttrs:a,texttemplateAttrs:o,templatefallbackAttrs:s}=ze(),c=Pt(),l=z().extendFlat,u=r.marker,d=r.line,f=u.line;t.exports={carpet:{valType:`string`,editType:`calc`},a:{valType:`data_array`,editType:`calc`},b:{valType:`data_array`,editType:`calc`},mode:l({},r.mode,{dflt:`markers`}),text:l({},r.text,{}),texttemplate:o({editType:`plot`},{keys:[`a`,`b`,`text`]}),texttemplatefallback:s({editType:`plot`}),hovertext:l({},r.hovertext,{}),line:{color:d.color,width:d.width,dash:d.dash,backoff:d.backoff,shape:l({},d.shape,{values:[`linear`,`spline`]}),smoothing:d.smoothing,editType:`calc`},connectgaps:r.connectgaps,fill:l({},r.fill,{values:[`none`,`toself`,`tonext`],dflt:`none`}),fillcolor:n(),marker:l({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,angle:u.angle,angleref:u.angleref,standoff:u.standoff,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:l({width:f.width,dash:f.dash,editType:`calc`},c(`marker.line`)),gradient:u.gradient,editType:`calc`},c(`marker`)),textfont:r.textfont,textposition:r.textposition,selected:r.selected,unselected:r.unselected,hoverinfo:l({},i.hoverinfo,{flags:[`a`,`b`,`text`,`name`]}),hoveron:r.hoveron,hovertemplate:a(),hovertemplatefallback:s(),zorder:r.zorder}}),hC=h((e,t)=>{var n=$(),r=Cr(),i=Xt(),a=Yr(),o=Xr(),s=Zr(),c=Qr(),l=$r(),u=mC();t.exports=function(e,t,d,f){function p(r,i){return n.coerce(e,t,u,r,i)}p(`carpet`),t.xaxis=`x`,t.yaxis=`y`;var m=p(`a`),h=p(`b`),g=Math.min(m.length,h.length);if(!g){t.visible=!1;return}t._length=g,p(`text`),p(`texttemplate`),p(`texttemplatefallback`),p(`hovertext`),p(`mode`,g<r.PTS_LINESONLY?`lines+markers`:`lines`),i.hasMarkers(t)&&a(e,t,d,f,p,{gradient:!0}),i.hasLines(t)&&(o(e,t,d,f,p,{backoff:!0}),s(e,t,p),p(`connectgaps`)),i.hasText(t)&&c(e,t,f,p);var _=[];(i.hasMarkers(t)||i.hasText(t))&&(p(`marker.maxdisplayed`),_.push(`points`)),p(`fill`),t.fill!==`none`&&(l(e,t,d,p),i.hasLines(t)||s(e,t,p)),(t.fill===`tonext`||t.fill===`toself`)&&_.push(`fills`),p(`hoveron`,_.join(`+`)||`points`)!==`fills`&&(p(`hovertemplate`),p(`hovertemplatefallback`)),p(`zorder`),n.coerceSelectionMarkerOpacity(t,p)}}),gC=h((e,t)=>{t.exports=function(e,t){var n={},r=t._carpet,i=r.ab2ij([e.a,e.b]),a=Math.floor(i[0]),o=i[0]-a,s=Math.floor(i[1]),c=i[1]-s;return n.yLabel=r.evalxy([],a,s,o,c)[1].toFixed(3),n}}),_C=h((e,t)=>{t.exports=function(e,t){for(var n=e._fullData.length,r,i=0;i<n;i++){var a=e._fullData[i];if(a.index!==t.index&&a.type===`carpet`&&(r||=a,a.carpet===t.carpet))return a}return r}}),vC=h((e,t)=>{var n=D(),r=ai(),i=oi(),a=si(),o=ci().calcMarkerSize,s=_C();t.exports=function(e,t){var c=t._carpetTrace=s(e,t);if(!(!c||!c.visible||c.visible===`legendonly`)){var l;t.xaxis=c.xaxis,t.yaxis=c.yaxis;var u=t._length,d=Array(u),f,p,m=!1;for(l=0;l<u;l++)if(f=t.a[l],p=t.b[l],n(f)&&n(p)){var h=c.ab2xy(+f,+p,!0),g=c.isVisible(+f,+p);g||(m=!0),d[l]={x:h[0],y:h[1],a:f,b:p,vis:g}}else d[l]={x:!1,y:!1};return t._needsCull=m,d[0].carpet=c,d[0].trace=t,o(t,u),r(e,t),i(d,t),a(d,t),d}}}),yC=h((e,t)=>{var n=hi(),r=sn(),i=tn();t.exports=function(e,t,a,o){var s,c,l,u=a[0][0].carpet,d=r.getFromId(e,u.xaxis||`x`),f=r.getFromId(e,u.yaxis||`y`),p={xaxis:d,yaxis:f,plot:t.plot};for(s=0;s<a.length;s++)c=a[s][0].trace,c._xA=d,c._yA=f;for(n(e,p,a,o),s=0;s<a.length;s++)c=a[s][0].trace,l=o.selectAll(`g.trace`+c.uid+` .js-line`),i.setClipUrl(l,a[s][0].carpet._clipPathId,e)}}),bC=h((e,t)=>{var n=bi(),r=$().fillText;t.exports=function(e,t,i,a){var o=n(e,t,i,a);if(!o||o[0].index===!1)return;var s=o[0];if(s.index===void 0){var c=1-s.y0/e.ya._length,l=e.xa._length,u=l*c/2,d=l-u;return s.x0=Math.max(Math.min(s.x0,d),u),s.x1=Math.max(Math.min(s.x1,d),u),o}var f=s.cd[s.index];s.a=f.a,s.b=f.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var p=s.trace,m=p._carpet;s.yLabel=p._module.formatLabels(f,p).yLabel,delete s.text;var h=[];function g(e,t){var n=e.labelprefix&&e.labelprefix.length>0?e.labelprefix.replace(/ = $/,``):e._hovertitle;h.push(n+`: `+t.toFixed(3)+e.labelsuffix)}if(!p.hovertemplate){var _=(f.hi||p.hoverinfo).split(`+`);_.indexOf(`all`)!==-1&&(_=[`a`,`b`,`text`]),_.indexOf(`a`)!==-1&&g(m.aaxis,f.a),_.indexOf(`b`)!==-1&&g(m.baxis,f.b),h.push(`y: `+s.yLabel),_.indexOf(`text`)!==-1&&r(f,p,h),s.extraText=h.join(`<br>`)}return o}}),xC=h((e,t)=>{t.exports=function(e,t,n,r,i){var a=r[i];return e.a=a.a,e.b=a.b,e.y=a.y,e}}),SC=h((e,t)=>{t.exports={attributes:mC(),supplyDefaults:hC(),colorbar:gi(),formatLabels:gC(),calc:vC(),plot:yC(),style:vi().style,styleOnSelect:vi().styleOnSelect,hoverPoints:bC(),selectPoints:xi(),eventData:xC(),moduleType:`trace`,name:`scattercarpet`,basePlotModule:Ai(),categories:[`svg`,`carpet`,`symbols`,`showLegend`,`carpetDependent`,`zoomScale`],meta:{}}}),CC=h((e,t)=>{t.exports=SC()}),wC=h((e,t)=>{var n=Co(),r=us(),i=Pt(),a=z().extendFlat,o=r.contours;t.exports=a({carpet:{valType:`string`,editType:`calc`},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:r.fillcolor,autocontour:r.autocontour,ncontours:r.ncontours,contours:{type:o.type,start:o.start,end:o.end,size:o.size,coloring:{valType:`enumerated`,values:[`fill`,`lines`,`none`],dflt:`fill`,editType:`calc`},showlines:o.showlines,showlabels:o.showlabels,labelfont:o.labelfont,labelformat:o.labelformat,operation:o.operation,value:o.value,editType:`calc`,impliedEdits:{autocontour:!1}},line:{color:r.line.color,width:r.line.width,dash:r.line.dash,smoothing:r.line.smoothing,editType:`plot`},zorder:r.zorder},i(``,{cLetter:`z`,autoColorDflt:!1}))}),TC=h((e,t)=>{var n=$(),r=wo(),i=wC(),a=Ns(),o=fs(),s=ms();t.exports=function(e,t,c,l){function u(r,a){return n.coerce(e,t,i,r,a)}function d(r){return n.coerce2(e,t,i,r)}if(u(`carpet`),e.a&&e.b){if(!r(e,t,u,l,`a`,`b`)){t.visible=!1;return}u(`text`),u(`contours.type`)===`constraint`?a(e,t,u,l,c,{hasHover:!1}):(o(e,t,u,d),s(e,t,u,l,{hasHover:!1}))}else t._defaultColor=c,t._length=null;u(`zorder`)}}),EC=h((e,t)=>{var n=Jt(),r=$(),i=Po(),a=Fo(),o=Io(),s=Lo(),c=Ro(),l=TC(),u=_C(),d=gs();t.exports=function(e,t){var n=t._carpetTrace=u(e,t);if(!(!n||!n.visible||n.visible===`legendonly`)){if(!t.a||!t.b){var r=e.data[n.index],i=e.data[t.index];i.a||=r.a,i.b||=r.b,l(i,t,t._defaultColor,e._fullLayout)}var a=f(e,t);return d(t,t._z),a}};function f(e,t){var l=t._carpetTrace,u=l.aaxis,d=l.baxis,f,p,m,h,g,_,v;u._minDtick=0,d._minDtick=0,r.isArray1D(t.z)&&i(t,u,d,`a`,`b`,[`z`]),f=t._a=t._a||t.a,h=t._b=t._b||t.b,f=f?u.makeCalcdata(t,`_a`):[],h=h?d.makeCalcdata(t,`_b`):[],p=t.a0||0,m=t.da||1,g=t.b0||0,_=t.db||1,v=t._z=a(t._z||t.z,t.transpose),t._emptypoints=s(v),o(v,t._emptypoints);var y=r.maxRowLength(v),b={a:c(t,t.xtype===`scaled`?``:f,p,m,y,u),b:c(t,t.ytype===`scaled`?``:h,g,_,v.length,d),z:v};return t.contours.type===`levels`&&t.contours.coloring!==`none`&&n(e,t,{vals:v,containerStr:``,cLetter:`z`}),[b]}}),DC=h((e,t)=>{var n=$().isArrayOrTypedArray;t.exports=function(e,t,r,i){var a,o,s,c,l,u,d,f,p,m,h,g,_,v=n(r)?`a`:`b`,y=(v===`a`?e.aaxis:e.baxis).smoothing,b=v===`a`?e.a2i:e.b2j,x=v===`a`?r:i,S=v===`a`?i:r,C=v===`a`?t.a.length:t.b.length,w=v===`a`?t.b.length:t.a.length,T=Math.floor(v===`a`?e.b2j(S):e.a2i(S)),E=v===`a`?function(t){return e.evalxy([],t,T)}:function(t){return e.evalxy([],T,t)};y&&(s=Math.max(0,Math.min(w-2,T)),c=T-s,o=v===`a`?function(t,n){return e.dxydi([],t,s,n,c)}:function(t,n){return e.dxydj([],s,t,c,n)});var D=b(x[0]),O=b(x[1]),k=D<O?1:-1,A=(O-D)*1e-8,j=k>0?Math.floor:Math.ceil,M=k>0?Math.ceil:Math.floor,N=k>0?Math.min:Math.max,P=k>0?Math.max:Math.min,F=j(D+A),I=M(O-A);d=E(D);var L=[[d]];for(a=F;a*k<I*k;a+=k)l=[],h=P(D,a),g=N(O,a+k),_=g-h,u=Math.max(0,Math.min(C-2,Math.floor(.5*(h+g)))),f=E(g),y&&(p=o(u,h-u),m=o(u,g-u),l.push([d[0]+p[0]/3*_,d[1]+p[1]/3*_]),l.push([f[0]-m[0]/3*_,f[1]-m[1]/3*_])),l.push(f),L.push(l),d=f;return L}}),OC=h((e,t)=>{var n=S(),r=JS(),i=YS(),a=tn(),o=$(),s=bs(),c=xs(),l=Es(),u=ys(),d=ws(),f=Cs(),p=Ts(),m=_C(),h=DC();t.exports=function(e,t,l,u){var p=t.xaxis,h=t.yaxis;o.makeTraceGroups(u,l,`contour`).each(function(o){var l=n.select(this),u=o[0],v=u.trace,y=v._carpetTrace=m(e,v),b=e.calcdata[y.index][0];if(!y.visible||y.visible===`legendonly`)return;var x=u.a,S=u.b,T=v.contours,E=f(T,t,u),D=T.type===`constraint`,O=T._operation,k=D?O===`=`?`lines`:`fill`:T.coloring;function A(e){var t=y.ab2xy(e[0],e[1],!0);return[p.c2p(t[0]),h.c2p(t[1])]}var j=[[x[0],S[S.length-1]],[x[x.length-1],S[S.length-1]],[x[x.length-1],S[0]],[x[0],S[0]]];s(E),c(E,(x[x.length-1]-x[0])*1e-8,(S[S.length-1]-S[0])*1e-8);var M=E;T.type===`constraint`&&(M=d(E,O)),g(E,A);var N,P,F,I,L=[];for(I=b.clipsegments.length-1;I>=0;I--)N=b.clipsegments[I],P=r([],N.x,p.c2p),F=r([],N.y,h.c2p),P.reverse(),F.reverse(),L.push(i(P,F,N.bicubic));var R=`M`+L.join(`L`)+`Z`;C(l,b.clipsegments,p,h,D,k),w(v,l,p,h,M,j,A,y,b,k,R),_(l,E,e,u,T,t,y),a.setClipUrl(l,y._clipPathId,e)})};function g(e,t){var n,r,i,a,o,s,c,l,u;for(n=0;n<e.length;n++){for(a=e[n],o=a.pedgepaths=[],s=a.ppaths=[],r=0;r<a.edgepaths.length;r++){for(u=a.edgepaths[r],c=[],i=0;i<u.length;i++)c[i]=t(u[i]);o.push(c)}for(r=0;r<a.paths.length;r++){for(u=a.paths[r],l=[],i=0;i<u.length;i++)l[i]=t(u[i]);s.push(l)}}}function _(e,t,r,i,s,c,d){var f=r._context.staticPlot,p=o.ensureSingle(e,`g`,`contourlines`),m=s.showlines!==!1,h=s.showlabels,g=m&&h,_=l.createLines(p,m||h,t,f),y=l.createLineClip(p,g,r,i.trace.uid),b=e.selectAll(`g.contourlabels`).data(h?[0]:[]);if(b.exit().remove(),b.enter().append(`g`).classed(`contourlabels`,!0),h){var x=c.xaxis,S=c.yaxis,C=x._length,w=S._length,T=[[[0,0],[C,0],[C,w],[0,w]]],E=[];o.clearLocationCache();var D=l.labelFormatter(r,i),O=a.tester.append(`text`).attr(`data-notex`,1).call(a.font,s.labelfont),k={left:0,right:C,center:C/2,top:0,bottom:w,middle:w/2},A=Math.sqrt(C*C+w*w),j=u.LABELDISTANCE*A/Math.max(1,t.length/u.LABELINCREASE);_.each(function(e){var t=l.calcTextOpts(e.level,D,O,r);n.select(this).selectAll(`path`).each(function(n){var r=this,i=o.getVisibleSegment(r,k,t.height/2);if(i&&(v(r,n,e,i,d,t.height),!(i.len<(t.width+t.height)*u.LABELMIN)))for(var a=Math.min(Math.ceil(i.len/j),u.LABELMAX),s=0;s<a;s++){var c=l.findBestTextLocation(r,i,t,E,k);if(!c)break;l.addLabelData(c,t,E,T)}})}),O.remove(),l.drawLabels(b,E,r,y,g?T:null)}h&&!m&&_.remove()}function v(e,t,n,r,i,a){for(var o,s=0;s<n.pedgepaths.length;s++)t===n.pedgepaths[s]&&(o=n.edgepaths[s]);if(!o)return;var c=i.a[0],l=i.a[i.a.length-1],u=i.b[0],d=i.b[i.b.length-1];function f(e,t){var n=0,r,o=.1;return(Math.abs(e[0]-c)<o||Math.abs(e[0]-l)<o)&&(r=b(i.dxydb_rough(e[0],e[1],o)),n=Math.max(n,a*x(t,r)/2)),(Math.abs(e[1]-u)<o||Math.abs(e[1]-d)<o)&&(r=b(i.dxyda_rough(e[0],e[1],o)),n=Math.max(n,a*x(t,r)/2)),n}var p=y(e,0,1),m=y(e,r.total,r.total-1),h=f(o[0],p),g=r.total-f(o[o.length-1],m);r.min<h&&(r.min=h),r.max>g&&(r.max=g),r.len=r.max-r.min}function y(e,t,n){var r=e.getPointAtLength(t),i=e.getPointAtLength(n),a=i.x-r.x,o=i.y-r.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function b(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}function x(e,t){var n=Math.abs(e[0]*t[0]+e[1]*t[1]);return Math.sqrt(1-n*n)/n}function C(e,t,n,a,s,c){var l,u,d,f,p=o.ensureSingle(e,`g`,`contourbg`).selectAll(`path`).data(c===`fill`&&!s?[0]:[]);p.enter().append(`path`),p.exit().remove();var m=[];for(f=0;f<t.length;f++)l=t[f],u=r([],l.x,n.c2p),d=r([],l.y,a.c2p),m.push(i(u,d,l.bicubic));p.attr(`d`,`M`+m.join(`L`)+`Z`).style(`stroke`,`none`)}function w(e,t,r,i,a,s,c,l,u,d,f){var m=d===`fill`;m&&p(a,e.contours);var h=o.ensureSingle(t,`g`,`contourfill`).selectAll(`path`).data(m?a:[]);h.enter().append(`path`),h.exit().remove(),h.each(function(t){var a=(t.prefixBoundary?f:``)+T(e,t,s,c,l,u,r,i);a?n.select(this).attr(`d`,a).style(`stroke`,`none`):n.select(this).remove()})}function T(e,t,n,r,i,s,c,l){var u,d=``,f=t.edgepaths.map(function(e,t){return t}),p=!0,m,g,_,v,y,b,x=Math.abs(n[0][0]-n[2][0])*1e-4,S=Math.abs(n[0][1]-n[2][1])*1e-4;function C(e){return Math.abs(e[1]-n[0][1])<S}function w(e){return Math.abs(e[1]-n[2][1])<S}function T(e){return Math.abs(e[0]-n[0][0])<x}function E(e){return Math.abs(e[0]-n[2][0])<x}function D(e,t){var n,r,a,o,u=``;for(C(e)&&!E(e)||w(e)&&!T(e)?(o=i.aaxis,a=h(i,s,[e[0],t[0]],.5*(e[1]+t[1]))):(o=i.baxis,a=h(i,s,.5*(e[0]+t[0]),[e[1],t[1]])),n=1;n<a.length;n++)for(u+=o.smoothing?`C`:`L`,r=0;r<a[n].length;r++){var d=a[n][r];u+=[c.c2p(d[0]),l.c2p(d[1])]+` `}return u}for(u=0,m=null;f.length;){var O=t.edgepaths[u][0];for(m&&(d+=D(m,O)),b=a.smoothopen(t.edgepaths[u].map(r),t.smoothing),d+=p?b:b.replace(/^M/,`L`),f.splice(f.indexOf(u),1),m=t.edgepaths[u][t.edgepaths[u].length-1],v=-1,_=0;_<4;_++){if(!m){o.log(`Missing end?`,u,t);break}for(C(m)&&!E(m)?g=n[1]:T(m)?g=n[0]:w(m)?g=n[3]:E(m)&&(g=n[2]),y=0;y<t.edgepaths.length;y++){var k=t.edgepaths[y][0];Math.abs(m[0]-g[0])<x?Math.abs(m[0]-k[0])<x&&(k[1]-m[1])*(g[1]-k[1])>=0&&(g=k,v=y):Math.abs(m[1]-g[1])<S?Math.abs(m[1]-k[1])<S&&(k[0]-m[0])*(g[0]-k[0])>=0&&(g=k,v=y):o.log(`endpt to newendpt is not vert. or horz.`,m,g,k)}if(v>=0)break;d+=D(m,g),m=g}if(v===t.edgepaths.length){o.log(`unclosed perimeter path`);break}u=v,p=f.indexOf(u)===-1,p&&(u=f[0],d+=D(m,g)+`Z`,m=null)}for(u=0;u<t.paths.length;u++)d+=a.smoothclosed(t.paths[u].map(r),t.smoothing);return d}}),kC=h((e,t)=>{t.exports={attributes:wC(),supplyDefaults:TC(),colorbar:ks(),calc:EC(),plot:OC(),style:Os(),moduleType:`trace`,name:`contourcarpet`,basePlotModule:Ai(),categories:[`cartesian`,`svg`,`carpet`,`contour`,`symbols`,`showLegend`,`hasLines`,`carpetDependent`,`noHover`,`noSortingByValue`],meta:{}}}),AC=h((e,t)=>{t.exports=kC()}),jC=h((e,t)=>{var n=$().extendFlat,r=Tr(),i=jt().axisHoverFormat,{hovertemplateAttrs:a,templatefallbackAttrs:o}=ze(),s=Le().dash,c=U(),l=Ec(),u=l.INCREASING.COLOR,d=l.DECREASING.COLOR,f=r.line;function p(e){return{line:{color:n({},f.color,{dflt:e}),width:f.width,dash:s,editType:`style`},editType:`style`}}t.exports={xperiod:r.xperiod,xperiod0:r.xperiod0,xperiodalignment:r.xperiodalignment,xhoverformat:i(`x`),yhoverformat:i(`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:n({},f.width,{}),dash:n({},s,{}),editType:`style`},increasing:p(u),decreasing:p(d),text:{valType:`string`,dflt:``,arrayOk:!0,editType:`calc`},hovertext:{valType:`string`,dflt:``,arrayOk:!0,editType:`calc`},hovertemplate:a({},{keys:[`open`,`high`,`low`,`close`]}),hovertemplatefallback:o(),tickwidth:{valType:`number`,min:0,max:.5,dflt:.3,editType:`calc`},hoverlabel:n({},c.hoverlabel,{split:{valType:`boolean`,dflt:!1,editType:`style`}}),zorder:r.zorder}}),MC=h((e,t)=>{var n=Ke(),r=$();t.exports=function(e,t,i,a){var o=i(`x`),s=i(`open`),c=i(`high`),l=i(`low`),u=i(`close`);if(i(`hoverlabel.split`),n.getComponentMethod(`calendars`,`handleTraceDefaults`)(e,t,[`x`],a),s&&c&&l&&u){var d=Math.min(s.length,c.length,l.length,u.length);return o&&(d=Math.min(d,r.minRowLength(o))),t._length=d,d}}}),NC=h((e,t)=>{var n=$(),r=MC(),i=qr(),a=jC();t.exports=function(e,t,s,c){function l(r,i){return n.coerce(e,t,a,r,i)}if(!r(e,t,l,c)){t.visible=!1;return}i(e,t,c,l,{x:!0}),l(`xhoverformat`),l(`yhoverformat`),l(`line.width`),l(`line.dash`),o(e,t,l,`increasing`),o(e,t,l,`decreasing`),l(`text`),l(`hovertext`),l(`hovertemplate`),l(`hovertemplatefallback`),l(`tickwidth`),c._requestRangeslider[t.xaxis]=!0,l(`zorder`)};function o(e,t,n,r){n(r+`.line.color`),n(r+`.line.width`,t.line.width),n(r+`.line.dash`,t.line.dash)}}),PC=h((e,t)=>{var n=$(),r=n._,i=sn(),a=ii(),o=O().BADNUM;function s(e,t){var r=i.getFromId(e,t.xaxis),a=i.getFromId(e,t.yaxis),o=u(e,r,t),s=t._minDiff;t._minDiff=null;var d=t._origX;t._origX=null;var f=t._xcalc;t._xcalc=null;var p=l(e,t,d,f,a,c);return t._extremes[r._id]=i.findExtremes(r,f,{vpad:s/2}),p.length?(n.extendFlat(p[0].t,{wHover:s/2,tickLen:o}),p):[{t:{empty:!0}}]}function c(e,t,n,r){return{o:e,h:t,l:n,c:r}}function l(e,t,a,s,c,l){for(var u=c.makeCalcdata(t,`open`),d=c.makeCalcdata(t,`high`),f=c.makeCalcdata(t,`low`),p=c.makeCalcdata(t,`close`),m=n.isArrayOrTypedArray(t.text),h=n.isArrayOrTypedArray(t.hovertext),g=!0,_=null,v=!!t.xperiodalignment,y=[],b=0;b<s.length;b++){var x=s[b],S=u[b],C=d[b],w=f[b],T=p[b];if(x!==o&&S!==o&&C!==o&&w!==o&&T!==o){T===S?_!==null&&T!==_&&(g=T>_):g=T>S,_=T;var E=l(S,C,w,T);E.pos=x,E.yc=(S+T)/2,E.i=b,E.dir=g?`increasing`:`decreasing`,E.x=E.pos,E.y=[w,C],v&&(E.orig_p=a[b]),m&&(E.tx=t.text[b]),h&&(E.htx=t.hovertext[b]),y.push(E)}else y.push({pos:x,empty:!0})}return t._extremes[c._id]=i.findExtremes(c,n.concat(f,d),{padded:!0}),y.length&&(y[0].t={labels:{open:r(e,`open:`)+` `,high:r(e,`high:`)+` `,low:r(e,`low:`)+` `,close:r(e,`close:`)+` `}}),y}function u(e,t,r){var i=r._minDiff;if(!i){var o=e._fullData,s=[];i=1/0;var c;for(c=0;c<o.length;c++){var l=o[c];if(l.type===`ohlc`&&l.visible===!0&&l.xaxis===t._id){s.push(l);var u=t.makeCalcdata(l,`x`);l._origX=u;var d=a(r,t,`x`,u).vals;l._xcalc=d;var f=n.distinctVals(d).minDiff;f&&isFinite(f)&&(i=Math.min(i,f))}}for(i===1/0&&(i=1),c=0;c<s.length;c++)s[c]._minDiff=i}return i*r.tickwidth}t.exports={calc:s,calcCommon:l}}),FC=h((e,t)=>{var n=S(),r=$();t.exports=function(e,t,i,a){var o=t.yaxis,s=t.xaxis,c=!!s.rangebreaks;r.makeTraceGroups(a,i,`trace ohlc`).each(function(e){var t=n.select(this),i=e[0],a=i.t;if(i.trace.visible!==!0||a.empty){t.remove();return}var l=a.tickLen,u=t.selectAll(`path`).data(r.identity);u.enter().append(`path`),u.exit().remove(),u.attr(`d`,function(e){if(e.empty)return`M0,0Z`;var t=s.c2p(e.pos-l,!0),n=s.c2p(e.pos+l,!0),r=c?(t+n)/2:s.c2p(e.pos,!0),i=o.c2p(e.o,!0),a=o.c2p(e.h,!0),u=o.c2p(e.l,!0),d=o.c2p(e.c,!0);return`M`+t+`,`+i+`H`+r+`M`+r+`,`+a+`V`+u+`M`+n+`,`+d+`H`+r})})}}),IC=h((e,t)=>{var n=S(),r=tn(),i=q();t.exports=function(e,t,a){var o=a||n.select(e).selectAll(`g.ohlclayer`).selectAll(`g.trace`);o.style(`opacity`,function(e){return e[0].trace.opacity}),o.each(function(e){var t=e[0].trace;n.select(this).selectAll(`path`).each(function(e){if(!e.empty){var a=t[e.dir].line;n.select(this).style(`fill`,`none`).call(i.stroke,a.color).call(r.dashLine,a.dash,a.width).style(`opacity`,t.selectedpoints&&!e.selected?.3:1)}})})}}),LC=h((e,t)=>{var n=sn(),r=$(),i=Ln(),a=q(),o=$().fillText,s=Ec(),c={increasing:s.INCREASING.SYMBOL,decreasing:s.DECREASING.SYMBOL};function l(e,t,n,r){return e.cd[0].trace.hoverlabel.split?d(e,t,n,r):f(e,t,n,r)}function u(e,t,n,r){var o=e.cd,s=e.xa,c=o[0].trace,l=o[0].t,u=c.type,d=u===`ohlc`?`l`:`min`,f=u===`ohlc`?`h`:`max`,p,m,h=l.bPos||0,g=function(e){return e.pos+h-t},_=l.bdPos||l.tickLen,v=l.wHover,y=Math.min(1,_/Math.abs(s.r2c(s.range[1])-s.r2c(s.range[0])));p=e.maxHoverDistance-y,m=e.maxSpikeDistance-y;function b(e){var t=g(e);return i.inbox(t-v,t+v,p)}function x(e){var t=e[d],r=e[f];return t===r||i.inbox(t-n,r-n,p)}function S(e){return(b(e)+x(e))/2}var C=i.getDistanceFunction(r,b,x,S);if(i.getClosest(o,C,e),e.index===!1)return null;var w=o[e.index];if(w.empty)return null;var T=c[w.dir],E=T.line.color;return a.opacity(E)&&T.line.width?e.color=E:e.color=T.fillcolor,e.x0=s.c2p(w.pos+h-_,!0),e.x1=s.c2p(w.pos+h+_,!0),e.xLabelVal=w.orig_p===void 0?w.pos:w.orig_p,e.spikeDistance=S(w)*m/p,e.xSpike=s.c2p(w.pos,!0),e}function d(e,t,i,a){var o=e.cd,s=e.ya,c=o[0].trace,l=o[0].t,d=[],f=u(e,t,i,a);if(!f)return[];var p=o[f.index].hi||c.hoverinfo||``;if(p===`none`||p===`skip`)return[];for(var m=[`high`,`open`,`close`,`low`],h={},g=0;g<m.length;g++){var _=m[g],v=c[_][f.index],y=s.c2p(v,!0),b;v in h?(b=h[v],b.yLabel+=`<br>`+l.labels[_]+n.hoverLabelText(s,v,c.yhoverformat)):(b=r.extendFlat({},f),b.y0=b.y1=y,b.yLabelVal=v,b.yLabel=l.labels[_]+n.hoverLabelText(s,v,c.yhoverformat),b.name=``,d.push(b),h[v]=b)}return d}function f(e,t,r,i){var a=e.cd,s=e.ya,l=a[0].trace,d=a[0].t,f=u(e,t,r,i);if(!f)return[];var p=a[f.index],m=f.index=p.i,h=p.dir;function g(e){return d.labels[e]+n.hoverLabelText(s,l[e][m],l.yhoverformat)}var _=p.hi||l.hoverinfo||``,v=_.split(`+`),y=_===`all`,b=y||v.indexOf(`y`)!==-1,x=y||v.indexOf(`text`)!==-1,S=b?[g(`open`),g(`high`),g(`low`),g(`close`)+` `+c[h]]:[];return x&&o(p,l,S),f.extraText=S.join(`<br>`),f.y0=f.y1=s.c2p(p.yc,!0),[f]}t.exports={hoverPoints:l,hoverSplit:d,hoverOnPoints:f}}),RC=h((e,t)=>{t.exports=function(e,t){var n=e.cd,r=e.xaxis,i=e.yaxis,a=[],o,s=n[0].t.bPos||0;if(t===!1)for(o=0;o<n.length;o++)n[o].selected=0;else for(o=0;o<n.length;o++){var c=n[o];t.contains([r.c2p(c.pos+s),i.c2p(c.yc)],null,c.i,e)?(a.push({pointNumber:c.i,x:r.c2d(c.pos),y:i.c2d(c.yc)}),c.selected=1):c.selected=0}return a}}),zC=h((e,t)=>{t.exports={moduleType:`trace`,name:`ohlc`,basePlotModule:Ai(),categories:[`cartesian`,`svg`,`showLegend`],meta:{},attributes:jC(),supplyDefaults:NC(),calc:PC().calc,plot:FC(),style:IC(),hoverPoints:LC().hoverPoints,selectPoints:RC()}}),BC=h((e,t)=>{t.exports=zC()}),VC=h((e,t)=>{var n=$().extendFlat,r=jt().axisHoverFormat,i=jC(),a=lo();function o(e){return{line:{color:n({},a.line.color,{dflt:e}),width:a.line.width,editType:`style`},fillcolor:a.fillcolor,editType:`style`}}t.exports={xperiod:i.xperiod,xperiod0:i.xperiod0,xperiodalignment:i.xperiodalignment,xhoverformat:r(`x`),yhoverformat:r(`y`),x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:n({},a.line.width,{}),editType:`style`},increasing:o(i.increasing.line.color.dflt),decreasing:o(i.decreasing.line.color.dflt),text:i.text,hovertext:i.hovertext,hovertemplate:i.hovertemplate,hovertemplatefallback:i.hovertemplatefallback,whiskerwidth:n({},a.whiskerwidth,{dflt:0}),hoverlabel:i.hoverlabel,zorder:a.zorder}}),HC=h((e,t)=>{var n=$(),r=q(),i=MC(),a=qr(),o=VC();t.exports=function(e,t,r,c){function l(r,i){return n.coerce(e,t,o,r,i)}if(!i(e,t,l,c)){t.visible=!1;return}a(e,t,c,l,{x:!0}),l(`xhoverformat`),l(`yhoverformat`),l(`line.width`),s(e,t,l,`increasing`),s(e,t,l,`decreasing`),l(`text`),l(`hovertext`),l(`hovertemplate`),l(`hovertemplatefallback`),l(`whiskerwidth`),c._requestRangeslider[t.xaxis]=!0,l(`zorder`)};function s(e,t,n,i){var a=n(i+`.line.color`);n(i+`.line.width`,t.line.width),n(i+`.fillcolor`,r.addOpacity(a,.5))}}),UC=h((e,t)=>{var n=$(),r=sn(),i=ii(),a=PC().calcCommon;t.exports=function(e,t){var s=e._fullLayout,c=r.getFromId(e,t.xaxis),l=r.getFromId(e,t.yaxis),u=c.makeCalcdata(t,`x`),d=i(t,c,`x`,u).vals,f=a(e,t,u,d,l,o);return f.length?(n.extendFlat(f[0].t,{num:s._numBoxes,dPos:n.distinctVals(d).minDiff/2,posLetter:`x`,valLetter:`y`}),s._numBoxes++,f):[{t:{empty:!0}}]};function o(e,t,n,r){return{min:n,q1:Math.min(e,r),med:r,q3:Math.max(e,r),max:t}}}),WC=h((e,t)=>{t.exports={moduleType:`trace`,name:`candlestick`,basePlotModule:Ai(),categories:[`cartesian`,`svg`,`showLegend`,`candlestick`,`boxLayout`],meta:{},attributes:VC(),layoutAttributes:uo(),supplyLayoutDefaults:po().supplyLayoutDefaults,crossTraceCalc:ho().crossTraceCalc,supplyDefaults:HC(),calc:UC(),plot:go().plot,layerName:`boxlayer`,style:_o().style,hoverPoints:LC().hoverPoints,selectPoints:RC()}}),GC=h((e,t)=>{t.exports=WC()}),KC=h((e,t)=>{var n=$(),r=rn(),i=n.deg2rad,a=n.rad2deg;t.exports=function(e,t,n){switch(r(e,n),e._id){case`x`:case`radialaxis`:o(e,t);break;case`angularaxis`:l(e,t);break}};function o(e,t){var n=t._subplot;e.setGeometry=function(){var t=e._rl[0],r=e._rl[1],i=n.innerRadius,a=(n.radius-i)/(r-t),o=i/a,s=t>r?function(e){return e<=0}:function(e){return e>=0};e.c2g=function(n){var r=e.c2l(n)-t;return(s(r)?r:0)+o},e.g2c=function(n){return e.l2c(n+t-o)},e.g2p=function(e){return e*a},e.c2p=function(t){return e.g2p(e.c2g(t))}}}function s(e,t){return t===`degrees`?i(e):e}function c(e,t){return t===`degrees`?a(e):e}function l(e,t){var r=e.type;if(r===`linear`){var o=e.d2c,l=e.c2d;e.d2c=function(e,t){return s(o(e),t)},e.c2d=function(e,t){return l(c(e,t))}}e.makeCalcdata=function(t,n){var r=t[n],i=t._length,a,o,s=function(n){return e.d2c(n,t.thetaunit)};if(r)for(a=Array(i),o=0;o<i;o++)a[o]=s(r[o]);else{var c=n+`0`,l=`d`+n,u=c in t?s(t[c]):0,d=t[l]?s(t[l]):(e.period||2*Math.PI)/i;for(a=Array(i),o=0;o<i;o++)a[o]=u+o*d}return a},e.setGeometry=function(){var o=t.sector,s=o.map(i),c={clockwise:-1,counterclockwise:1}[e.direction],l=i(e.rotation),u=function(e){return c*e+l},d=function(e){return(e-l)/c},f,p,m,h;switch(r){case`linear`:p=f=n.identity,h=i,m=a,e.range=n.isFullCircle(s)?[o[0],o[0]+360]:s.map(d).map(a);break;case`category`:var g=e._categories.length,_=e.period?Math.max(e.period,g):g;_===0&&(_=1),p=h=function(e){return e*2*Math.PI/_},f=m=function(e){return e*_/Math.PI/2},e.range=[0,_];break}e.c2g=function(e){return u(p(e))},e.g2c=function(e){return f(d(e))},e.t2g=function(e){return u(h(e))},e.g2t=function(e){return m(d(e))}}}}),qC=h((e,t)=>{t.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}}),JC=h((e,t)=>{var n=$(),r=_r().tester,i=n.findIndexOfMin,a=n.isAngleInsideSector,o=n.angleDelta,s=n.angleDist;function c(e,t,n,i,o){if(!a(t,i))return!1;var s,c;n[0]<n[1]?(s=n[0],c=n[1]):(s=n[1],c=n[0]);var l=r(p(s,i[0],i[1],o)),u=r(p(c,i[0],i[1],o)),d=[e*Math.cos(t),e*Math.sin(t)];return u.contains(d)&&!l.contains(d)}function l(e,t,n,r){var i,a,o=r[0],s=r[1],c=g(Math.sin(t)-Math.sin(e)),l=g(Math.cos(t)-Math.cos(e)),u=Math.tan(n),d=g(1/u),f=c/l,p=s-f*o;return d?c&&l?(i=p/(u-f),a=u*i):l?(i=s*d,a=s):(i=o,a=o*u):c&&l?(i=0,a=p):l?(i=0,a=s):i=a=NaN,[i,a]}function u(e,t,n,r){var i=-t*n,a=t*t+1,o=2*(t*i-n),s=i*i+n*n-e*e,c=Math.sqrt(o*o-4*a*s),l=(-o+c)/(2*a),u=(-o-c)/(2*a);return[[l,t*l+i+r],[u,t*u+i+r]]}function d(e,t){var n=t.length,r=Array(n+1),i;for(i=0;i<n;i++){var a=t[i];r[i]=[e*Math.cos(a),e*Math.sin(a)]}return r[i]=r[0].slice(),r}function f(e,t,r,o){var c=o.length,u=[],d,f;function p(t){return[e*Math.cos(t),e*Math.sin(t)]}function m(e,t,n){return l(e,t,n,p(e))}function h(e){return n.mod(e,c)}function g(e){return a(e,[t,r])}var _=i(o,function(e){return g(e)?s(e,t):1/0}),v=m(o[_],o[h(_-1)],t);for(u.push(v),d=_,f=0;f<c;d++,f++){var y=o[h(d)];if(!g(y))break;u.push(p(y))}var b=i(o,function(e){return g(e)?s(e,r):1/0}),x=m(o[b],o[h(b+1)],r);return u.push(x),u.push([0,0]),u.push(u[0].slice()),u}function p(e,t,r,i){return n.isFullCircle([t,r])?d(e,i):f(e,t,r,i)}function m(e,t,n,r){for(var i=1/0,a=1/0,o=p(e,t,n,r),s=0;s<o.length;s++){var c=o[s];i=Math.min(i,c[0]),a=Math.min(a,-c[1])}return[i,a]}function h(e,t){var r=i(t,function(t){var n=o(t,e);return n>0?n:1/0}),a=n.mod(r+1,t.length);return[t[r],t[a]]}function g(e){return Math.abs(e)>1e-10?e:0}function _(e,t,n){t||=0,n||=0;for(var r=e.length,i=Array(r),a=0;a<r;a++){var o=e[a];i[a]=[t+o[0],n-o[1]]}return i}function v(e,t,n,r,i,a){return`M`+_(p(e,t,n,r),i,a).join(`L`)}function y(e,t,n,r,i,a,o){var s,c;e<t?(s=e,c=t):(s=t,c=e);var l=_(p(s,n,r,i),a,o);return`M`+_(p(c,n,r,i),a,o).reverse().join(`L`)+`M`+l.join(`L`)}t.exports={isPtInsidePolygon:c,findPolygonOffset:m,findEnclosingVertexAngles:h,findIntersectionXY:l,findXYatLength:u,clampTiny:g,pathPolygon:v,pathPolygonAnnulus:y}}),YC=h((e,t)=>{function n(e){return e<0?-1:e>0?1:0}function r(e){var t=e[0],n=e[1];if(!isFinite(t)||!isFinite(n))return[1,0];var r=(t+1)*(t+1)+n*n;return[(t*t+n*n-1)/r,2*n/r]}function i(e,t){var n=t[0],r=t[1];return[n*e.radius+e.cx,-r*e.radius+e.cy]}function a(e,t){return t*e.radius}function o(e,t,n,o){var s=i(e,r([n,t])),c=s[0],l=s[1],u=i(e,r([o,t])),d=u[0],f=u[1];if(t===0)return[`M`+c+`,`+l,`L`+d+`,`+f].join(` `);var p=a(e,1/Math.abs(t));return[`M`+c+`,`+l,`A`+p+`,`+p+` 0 0,`+(t<0?1:0)+` `+d+`,`+f].join(` `)}function s(e,t,o,s){var c=a(e,1/(t+1)),l=i(e,r([t,o])),u=l[0],d=l[1],f=i(e,r([t,s])),p=f[0],m=f[1];if(n(o)!==n(s)){var h=i(e,r([t,0])),g=h[0],_=h[1];return[`M`+u+`,`+d,`A`+c+`,`+c+` 0 0,`+(0<o?0:1)+` `+g+`,`+_,`A`+c+`,`+c+` 0 0,`+(s<0?0:1)+p+`,`+m].join(` `)}return[`M`+u+`,`+d,`A`+c+`,`+c+` 0 0,`+(s<o?0:1)+` `+p+`,`+m].join(` `)}t.exports={smith:r,reactanceArc:o,resistanceArc:s,smithTransform:i}}),XC=h((e,t)=>{var n=S(),r=R(),i=Ke(),a=$(),o=a.strRotate,s=a.strTranslate,c=q(),l=tn(),u=Et(),d=sn(),f=rn(),p=KC(),m=on().doAutoRange,h=jr(),g=hn(),_=Ln(),v=nn(),y=Ar().prepSelect,b=Ar().selectOnClick,x=Ar().clearOutline,C=gn(),w=zn(),T=or().redrawReglTraces,E=Ot().MID_SHIFT,D=qC(),O=JC(),k=YC(),A=k.smith,j=k.reactanceArc,M=k.resistanceArc,N=k.smithTransform,P=a._,F=a.mod,I=a.deg2rad,L=a.rad2deg;function z(e,t,n){this.isSmith=n||!1,this.id=t,this.gd=e,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var r=e._fullLayout,i=`clip`+r._uid+t;this.clipIds.forTraces=i+`-for-traces`,this.clipPaths.forTraces=r._clips.append(`clipPath`).attr(`id`,this.clipIds.forTraces),this.clipPaths.forTraces.append(`path`),this.framework=r[`_`+(n?`smith`:`polar`)+`layer`].append(`g`).attr(`class`,t),this.getHole=function(e){return this.isSmith?0:e.hole},this.getSector=function(e){return this.isSmith?[0,360]:e.sector},this.getRadial=function(e){return this.isSmith?e.realaxis:e.radialaxis},this.getAngular=function(e){return this.isSmith?e.imaginaryaxis:e.angularaxis},n||(this.radialTickLayout=null,this.angularTickLayout=null)}var B=z.prototype;t.exports=function(e,t,n){return new z(e,t,n)},B.plot=function(e,t){for(var n=this,r=t[n.id],i=!1,a=0;a<e.length;a++)if(e[a][0].trace.cliponaxis===!1){i=!0;break}n._hasClipOnAxisFalse=i,n.updateLayers(t,r),n.updateLayout(t,r),u.generalUpdatePerTraceModule(n.gd,n,e,r),n.updateFx(t,r),n.isSmith&&(delete r.realaxis.range,delete r.imaginaryaxis.range)},B.updateLayers=function(e,t){var r=this,i=r.isSmith,a=r.layers,o=r.getRadial(t),s=r.getAngular(t),c=D.layerNames,l=c.indexOf(`frontplot`),u=c.slice(0,l),d=s.layer===`below traces`,f=o.layer===`below traces`;d&&u.push(`angular-line`),f&&u.push(`radial-line`),d&&u.push(`angular-axis`),f&&u.push(`radial-axis`),u.push(`frontplot`),d||u.push(`angular-line`),f||u.push(`radial-line`),d||u.push(`angular-axis`),f||u.push(`radial-axis`);var p=(i?`smith`:`polar`)+`sublayer`,m=r.framework.selectAll(`.`+p).data(u,String);m.enter().append(`g`).attr(`class`,function(e){return p+` `+e}).each(function(e){var t=a[e]=n.select(this);switch(e){case`frontplot`:i||t.append(`g`).classed(`barlayer`,!0),t.append(`g`).classed(`scatterlayer`,!0);break;case`backplot`:t.append(`g`).classed(`maplayer`,!0);break;case`plotbg`:a.bg=t.append(`path`);break;case`radial-grid`:t.style(`fill`,`none`);break;case`angular-grid`:t.style(`fill`,`none`);break;case`radial-line`:t.append(`line`).style(`fill`,`none`);break;case`angular-line`:t.append(`path`).style(`fill`,`none`);break}}),m.order()},B.updateLayout=function(e,t){var n=this,r=n.layers,i=e._size,a=n.getRadial(t),o=n.getAngular(t),u=t.domain.x,d=t.domain.y;n.xOffset=i.l+i.w*u[0],n.yOffset=i.t+i.h*(1-d[1]);var f=n.xLength=i.w*(u[1]-u[0]),p=n.yLength=i.h*(d[1]-d[0]),m=n.getSector(t);n.sectorInRad=m.map(I);var h=n.sectorBBox=H(m),g=h[2]-h[0],_=h[3]-h[1],v=p/f,y=Math.abs(_/g),b,x,S,C,w;v>y?(b=f,x=f*y,w=(p-x)/i.h/2,S=[u[0],u[1]],C=[d[0]+w,d[1]-w]):(b=p/y,x=p,w=(f-b)/i.w/2,S=[u[0]+w,u[1]-w],C=[d[0],d[1]]),n.xLength2=b,n.yLength2=x,n.xDomain2=S,n.yDomain2=C;var T=n.xOffset2=i.l+i.w*S[0],E=n.yOffset2=i.t+i.h*(1-C[1]),D=n.radius=b/g,O=n.innerRadius=n.getHole(t)*D,k=n.cx=T-D*h[0],A=n.cy=E+D*h[3],j=n.cxx=k-T,M=n.cyy=A-E,N=a.side,P;N===`counterclockwise`?(P=N,N=`top`):N===`clockwise`&&(P=N,N=`bottom`),n.radialAxis=n.mockAxis(e,t,a,{_id:`x`,side:N,_trueSide:P,domain:[O/i.w,D/i.w]}),n.angularAxis=n.mockAxis(e,t,o,{side:`right`,domain:[0,Math.PI],autorange:!1}),n.doAutoRange(e,t),n.updateAngularAxis(e,t),n.updateRadialAxis(e,t),n.updateRadialAxisTitle(e,t),n.xaxis=n.mockCartesianAxis(e,t,{_id:`x`,domain:S}),n.yaxis=n.mockCartesianAxis(e,t,{_id:`y`,domain:C});var F=n.pathSubplot();n.clipPaths.forTraces.select(`path`).attr(`d`,F).attr(`transform`,s(j,M)),r.frontplot.attr(`transform`,s(T,E)).call(l.setClipUrl,n._hasClipOnAxisFalse?null:n.clipIds.forTraces,n.gd),r.bg.attr(`d`,F).attr(`transform`,s(k,A)).call(c.fill,t.bgcolor)},B.mockAxis=function(e,t,n,r){var i=a.extendFlat({},n,r);return p(i,t,e),i},B.mockCartesianAxis=function(e,t,n){var r=this,i=r.isSmith,o=n._id,s=a.extendFlat({type:`linear`},n);f(s,e);var c={x:[0,2],y:[1,3]};return s.setRange=function(){var e=r.sectorBBox,n=c[o],i=r.radialAxis._rl,a=(i[1]-i[0])/(1-r.getHole(t));s.range=[e[n[0]]*a,e[n[1]]*a]},s.isPtWithinRange=o===`x`&&!i?function(e){return r.isPtInside(e)}:function(){return!0},s.setRange(),s.setScale(),s},B.doAutoRange=function(e,t){var n=this,r=n.gd,i=n.radialAxis,a=n.getRadial(t);m(r,i);var o=i.range;if(a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,`gregorian`),i.r2l(o[1],null,`gregorian`)],i.minallowed!==void 0){var s=i.r2l(i.minallowed);i._rl[0]>i._rl[1]?i._rl[1]=Math.max(i._rl[1],s):i._rl[0]=Math.max(i._rl[0],s)}if(i.maxallowed!==void 0){var c=i.r2l(i.maxallowed);i._rl[0]<i._rl[1]?i._rl[1]=Math.min(i._rl[1],c):i._rl[0]=Math.min(i._rl[0],c)}},B.updateRadialAxis=function(e,t){var n=this,r=n.gd,i=n.layers,l=n.radius,u=n.innerRadius,f=n.cx,p=n.cy,m=n.getRadial(t),h=F(n.getSector(t)[0],360),g=n.radialAxis,_=u<l,v=n.isSmith;v||(n.fillViewInitialKey(`radialaxis.angle`,m.angle),n.fillViewInitialKey(`radialaxis.range`,g.range.slice()),g.setGeometry()),g.tickangle===`auto`&&h>90&&h<=270&&(g.tickangle=180);var y=v?function(e){var t=N(n,A([e.x,0]));return s(t[0]-f,t[1]-p)}:function(e){return s(g.l2p(e.x)+u,0)},b=v?function(e){return M(n,e.x,-1/0,1/0)}:function(e){return n.pathArc(g.r2p(e.x)+u)},x=V(m);if(n.radialTickLayout!==x&&(i[`radial-axis`].selectAll(`.xtick`).remove(),n.radialTickLayout=x),_){g.setScale();var S=0,C=v?(g.tickvals||[]).filter(function(e){return e>=0}).map(function(e){return d.tickText(g,e,!0,!1)}):d.calcTicks(g),w=v?C:d.clipEnds(g,C),T=d.getTickSigns(g)[2];v&&((g.ticks===`top`&&g.side===`bottom`||g.ticks===`bottom`&&g.side===`top`)&&(T=-T),g.ticks===`top`&&g.side===`top`&&(S=-g.ticklen),g.ticks===`bottom`&&g.side===`bottom`&&(S=g.ticklen)),d.drawTicks(r,g,{vals:C,layer:i[`radial-axis`],path:d.makeTickPath(g,0,T),transFn:y,crisp:!1}),d.drawGrid(r,g,{vals:w,layer:i[`radial-grid`],path:b,transFn:a.noop,crisp:!1}),d.drawLabels(r,g,{vals:C,layer:i[`radial-axis`],transFn:y,labelFns:d.makeLabelFns(g,S)})}var E=n.radialAxisAngle=n.vangles?L(U(I(m.angle),n.vangles)):m.angle,D=s(f,p),O=D+o(-E);W(i[`radial-axis`],_&&(m.showticklabels||m.ticks),{transform:O}),W(i[`radial-grid`],_&&m.showgrid,{transform:v?``:D}),W(i[`radial-line`].select(`line`),_&&m.showline,{x1:v?-l:u,y1:0,x2:l,y2:0,transform:O}).attr(`stroke-width`,m.linewidth).call(c.stroke,m.linecolor)},B.updateRadialAxisTitle=function(e,t,n){if(!this.isSmith){var r=this,i=r.gd,a=r.radius,o=r.cx,s=r.cy,c=r.getRadial(t),u=r.id+`title`,d=0;if(c.title){var f=l.bBox(r.layers[`radial-axis`].node()).height,p=c.title.font.size,m=c.side;d=m===`top`?p:m===`counterclockwise`?-(f+p*.4):f+p*.8}var h=n===void 0?r.radialAxisAngle:n,g=I(h),_=Math.cos(g),y=Math.sin(g),b=o+a/2*_+d*y,x=s-a/2*y+d*_;r.layers[`radial-axis-title`]=v.draw(i,u,{propContainer:c,propName:r.id+`.radialaxis.title.text`,placeholder:P(i,`Click to enter radial axis title`),attributes:{x:b,y:x,"text-anchor":`middle`},transform:{rotate:-h}})}},B.updateAngularAxis=function(e,t){var n=this,r=n.gd,i=n.layers,l=n.radius,u=n.innerRadius,f=n.cx,p=n.cy,m=n.getAngular(t),h=n.angularAxis,g=n.isSmith;g||(n.fillViewInitialKey(`angularaxis.rotation`,m.rotation),h.setGeometry(),h.setScale());var _=g?function(e){var t=N(n,A([0,e.x]));return Math.atan2(t[0]-f,t[1]-p)-Math.PI/2}:function(e){return h.t2g(e.x)};h.type===`linear`&&h.thetaunit===`radians`&&(h.tick0=L(h.tick0),h.dtick=L(h.dtick));var v=function(e){return s(f+l*Math.cos(e),p-l*Math.sin(e))},y=g?function(e){var t=N(n,A([0,e.x]));return s(t[0],t[1])}:function(e){return v(_(e))},b=g?function(e){var t=N(n,A([0,e.x])),r=Math.atan2(t[0]-f,t[1]-p)-Math.PI/2;return s(t[0],t[1])+o(-L(r))}:function(e){var t=_(e);return v(t)+o(-L(t))},x=g?function(e){return j(n,e.x,0,1/0)}:function(e){var t=_(e),n=Math.cos(t),r=Math.sin(t);return`M`+[f+u*n,p-u*r]+`L`+[f+l*n,p-l*r]},S=d.makeLabelFns(h,0).labelStandoff,C={};C.xFn=function(e){var t=_(e);return Math.cos(t)*S},C.yFn=function(e){var t=_(e),n=Math.sin(t)>0?.2:1;return-Math.sin(t)*(S+e.fontSize*n)+Math.abs(Math.cos(t))*(e.fontSize*E)},C.anchorFn=function(e){var t=_(e),n=Math.cos(t);return Math.abs(n)<.1?`middle`:n>0?`start`:`end`},C.heightFn=function(e,t,n){var r=_(e);return-.5*(1+Math.sin(r))*n};var w=V(m);n.angularTickLayout!==w&&(i[`angular-axis`].selectAll(`.`+h._id+`tick`).remove(),n.angularTickLayout=w);var T=g?[1/0].concat(h.tickvals||[]).map(function(e){return d.tickText(h,e,!0,!1)}):d.calcTicks(h);g&&(T[0].text=`∞`,T[0].fontSize*=1.75);var D;if(t.gridshape===`linear`?(D=T.map(_),a.angleDelta(D[0],D[1])<0&&(D=D.slice().reverse())):D=null,n.vangles=D,h.type===`category`&&(T=T.filter(function(e){return a.isAngleInsideSector(_(e),n.sectorInRad)})),h.visible){var O=h.ticks===`inside`?-1:1,k=(h.linewidth||1)/2;d.drawTicks(r,h,{vals:T,layer:i[`angular-axis`],path:`M`+O*k+`,0h`+O*h.ticklen,transFn:b,crisp:!1}),d.drawGrid(r,h,{vals:T,layer:i[`angular-grid`],path:x,transFn:a.noop,crisp:!1}),d.drawLabels(r,h,{vals:T,layer:i[`angular-axis`],repositionOnUpdate:!0,transFn:y,labelFns:C})}W(i[`angular-line`].select(`path`),m.showline,{d:n.pathSubplot(),transform:s(f,p)}).attr(`stroke-width`,m.linewidth).call(c.stroke,m.linecolor)},B.updateFx=function(e,t){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(e),this.updateRadialDrag(e,t,0),this.updateRadialDrag(e,t,1)),this.updateHoverAndMainDrag(e))},B.updateHoverAndMainDrag=function(e){var t=this,o=t.isSmith,c=t.gd,l=t.layers,u=e._zoomlayer,d=D.MINZOOM,f=D.OFFEDGE,p=t.radius,m=t.innerRadius,v=t.cx,S=t.cy,C=t.cxx,w=t.cyy,T=t.sectorInRad,E=t.vangles,k=t.radialAxis,A=O.clampTiny,j=O.findXYatLength,M=O.findEnclosingVertexAngles,N=D.cornerHalfWidth,P=D.cornerLen/2,F,I,L=h.makeDragger(l,`path`,`maindrag`,e.dragmode===!1?`none`:`crosshair`);n.select(L).attr(`d`,t.pathSubplot()).attr(`transform`,s(v,S)),L.onmousemove=function(e){_.hover(c,e,t.id),c._fullLayout._lasthover=L,c._fullLayout._hoversubplot=t.id},L.onmouseout=function(e){c._dragging||g.unhover(c,e)};var R={element:L,gd:c,subplot:t.id,plotinfo:{id:t.id,xaxis:t.xaxis,yaxis:t.yaxis},xaxes:[t.xaxis],yaxes:[t.yaxis]},z,B,V,H,U,W,G,K,q;function J(e,t){return Math.sqrt(e*e+t*t)}function Y(e,t){return J(e-C,t-w)}function X(e,t){return Math.atan2(w-t,e-C)}function Z(e,t){return[e*Math.cos(t),e*Math.sin(-t)]}function Q(e,n){if(e===0)return t.pathSector(2*N);var r=P/e,i=n-r,a=n+r,o=Math.max(0,Math.min(e,p)),s=o-N,c=o+N;return`M`+Z(s,i)+`A`+[s,s]+` 0,0,0 `+Z(s,a)+`L`+Z(c,a)+`A`+[c,c]+` 0,0,1 `+Z(c,i)+`Z`}function ee(e,n,r){if(e===0)return t.pathSector(2*N);var i=Z(e,n),a=Z(e,r),o=A((i[0]+a[0])/2),s=A((i[1]+a[1])/2),c,l;if(o&&s){var u=s/o,d=-1/u,f=j(N,u,o,s);c=j(P,d,f[0][0],f[0][1]),l=j(P,d,f[1][0],f[1][1])}else{var p,m;s?(p=P,m=N):(p=N,m=P),c=[[o-p,s-m],[o+p,s-m]],l=[[o-p,s+m],[o+p,s+m]]}return`M`+c.join(`L`)+`L`+l.reverse().join(`L`)+`Z`}function te(){V=null,H=null,U=t.pathSubplot(),W=!1;var e=c._fullLayout[t.id];G=r(e.bgcolor).getLuminance(),K=h.makeZoombox(u,G,v,S,U),K.attr(`fill-rule`,`evenodd`),q=h.makeCorners(u,v,S),x(c)}function ne(e,t){return t=Math.max(Math.min(t,p),m),e<f?e=0:p-e<f?e=p:t<f?t=0:p-t<f&&(t=p),Math.abs(t-e)>d?(e<t?(V=e,H=t):(V=t,H=e),!0):(V=null,H=null,!1)}function re(e,t){e||=U,t||=`M0,0Z`,K.attr(`d`,e),q.attr(`d`,t),h.transitionZoombox(K,q,W,G),W=!0;var n={};ce(n),c.emit(`plotly_relayouting`,n)}function ie(e,n){e*=F,n*=I;var r=z+e,i=B+n,a=Y(z,B),o=Math.min(Y(r,i),p),s=X(z,B),c,l;ne(a,o)&&(c=U+t.pathSector(H),V&&(c+=t.pathSector(V)),l=Q(V,s)+Q(H,s)),re(c,l)}function ae(e,t,n,r){var i=O.findIntersectionXY(n,r,n,[e-C,w-t]);return J(i[0],i[1])}function oe(e,n){var r=z+e,i=B+n,a=X(z,B),o=X(r,i),s=M(a,E),c=M(o,E),l=ae(z,B,s[0],s[1]),u=Math.min(ae(r,i,c[0],c[1]),p),d,f;ne(l,u)&&(d=U+t.pathSector(H),V&&(d+=t.pathSector(V)),f=[ee(V,s[0],s[1]),ee(H,s[0],s[1])].join(` `)),re(d,f)}function se(){if(h.removeZoombox(c),!(V===null||H===null)){var e={};ce(e),h.showDoubleClickNotifier(c),i.call(`_guiRelayout`,c,e)}}function ce(e){var n=k._rl,r=(n[1]-n[0])/(1-m/p)/p,i=[n[0]+(V-m)*r,n[0]+(H-m)*r];e[t.id+`.radialaxis.range`]=i}function le(e,n){var r=c._fullLayout.clickmode;if(h.removeZoombox(c),e===2){var a={};for(var o in t.viewInitial)a[t.id+`.`+o]=t.viewInitial[o];c.emit(`plotly_doubleclick`,null),i.call(`_guiRelayout`,c,a)}r.indexOf(`select`)>-1&&e===1&&b(n,c,[t.xaxis],[t.yaxis],t.id,R),r.indexOf(`event`)>-1&&_.click(c,n,t.id)}R.prepFn=function(e,t,n){var r=c._fullLayout.dragmode,i=L.getBoundingClientRect();c._fullLayout._calcInverseTransform(c);var s=c._fullLayout._invTransform;F=c._fullLayout._invScaleX,I=c._fullLayout._invScaleY;var l=a.apply3DTransform(s)(t-i.left,n-i.top);if(z=l[0],B=l[1],E){var u=O.findPolygonOffset(p,T[0],T[1],E);z+=C+u[0],B+=w+u[1]}switch(r){case`zoom`:R.clickFn=le,o||(E?R.moveFn=oe:R.moveFn=ie,R.doneFn=se,te(e,t,n));break;case`select`:case`lasso`:y(e,t,n,R,r);break}},g.init(R)},B.updateRadialDrag=function(e,t,r){var c=this,l=c.gd,u=c.layers,d=c.radius,f=c.innerRadius,p=c.cx,m=c.cy,_=c.radialAxis,v=D.radialDragBoxSize,y=v/2;if(!_.visible)return;var b=I(c.radialAxisAngle),S=_._rl,C=S[0],E=S[1],O=S[r],k=.75*(S[1]-S[0])/(1-c.getHole(t))/d,A,j,M;r?(A=p+(d+y)*Math.cos(b),j=m-(d+y)*Math.sin(b),M=`radialdrag`):(A=p+(f-y)*Math.cos(b),j=m-(f-y)*Math.sin(b),M=`radialdrag-inner`);var N=h.makeRectDragger(u,M,`crosshair`,-y,-y,v,v),P={element:N,gd:l};e.dragmode===!1&&(P.dragmode=!1),W(n.select(N),_.visible&&f<d,{transform:s(A,j)});var F,R,z;function B(e,t){if(F)F(e,t);else{var n=[e,-t],r=[Math.cos(b),Math.sin(b)],i=Math.abs(a.dot(n,r)/Math.sqrt(a.dot(n,n)));isNaN(i)||(F=i<.5?G:K)}var o={};V(o),l.emit(`plotly_relayouting`,o)}function V(e){R===null?z!==null&&(e[c.id+`.radialaxis.range[`+r+`]`]=z):e[c.id+`.radialaxis.angle`]=R}function H(){R===null?z!==null&&i.call(`_guiRelayout`,l,c.id+`.radialaxis.range[`+r+`]`,z):i.call(`_guiRelayout`,l,c.id+`.radialaxis.angle`,R)}function G(e,t){if(r!==0){var n=A+e,i=j+t;R=Math.atan2(m-i,n-p),c.vangles&&(R=U(R,c.vangles)),R=L(R);var a=s(p,m)+o(-R);u[`radial-axis`].attr(`transform`,a),u[`radial-line`].select(`line`).attr(`transform`,a);var l=c.gd._fullLayout,d=l[c.id];c.updateRadialAxisTitle(l,d,R)}}function K(e,t){if(z=O-k*a.dot([e,-t],[Math.cos(b),Math.sin(b)]),k>0!=(r?z>C:z<E)){z=null;return}var n=l._fullLayout,o=n[c.id];_.range[r]=z,_._rl[r]=z,c.updateRadialAxis(n,o),c.xaxis.setRange(),c.xaxis.setScale(),c.yaxis.setRange(),c.yaxis.setScale();var s=!1;for(var u in c.traceHash){var d=c.traceHash[u],f=a.filterVisible(d);d[0][0].trace._module.plot(l,c,f,o),i.traceIs(u,`gl`)&&f.length&&(s=!0)}s&&(w(l),T(l))}P.prepFn=function(){F=null,R=null,z=null,P.moveFn=B,P.doneFn=H,x(l)},P.clampFn=function(e,t){return Math.sqrt(e*e+t*t)<D.MINDRAG&&(e=0,t=0),[e,t]},g.init(P)},B.updateAngularDrag=function(e){var t=this,r=t.gd,c=t.layers,u=t.radius,d=t.angularAxis,f=t.cx,p=t.cy,m=t.cxx,_=t.cyy,v=D.angularDragBoxSize,y=h.makeDragger(c,`path`,`angulardrag`,e.dragmode===!1?`none`:`move`),b={element:y,gd:r};e.dragmode===!1?b.dragmode=!1:n.select(y).attr(`d`,t.pathAnnulus(u,u+v)).attr(`transform`,s(f,p)).call(C,`move`);function S(e,t){return Math.atan2(_+v-t,e-m-v)}var E=c.frontplot.select(`.scatterlayer`).selectAll(`.trace`),O=E.selectAll(`.point`),k=E.selectAll(`.textpoint`),A,j,M,N,P,F;function I(u,h){var g=t.gd._fullLayout,v=g[t.id],y=L(S(A+u*e._invScaleX,j+h*e._invScaleY)-F);if(N=M+y,c.frontplot.attr(`transform`,s(t.xOffset2,t.yOffset2)+o([-y,m,_])),t.vangles){P=t.radialAxisAngle+y;var b=s(f,p)+o(-y),x=s(f,p)+o(-P);c.bg.attr(`transform`,b),c[`radial-grid`].attr(`transform`,b),c[`radial-axis`].attr(`transform`,x),c[`radial-line`].select(`line`).attr(`transform`,x),t.updateRadialAxisTitle(g,v,P)}else t.clipPaths.forTraces.select(`path`).attr(`transform`,s(m,_)+o(y));O.each(function(){var e=n.select(this),t=l.getTranslate(e);e.attr(`transform`,s(t.x,t.y)+o([y]))}),k.each(function(){var e=n.select(this),t=e.select(`text`),r=l.getTranslate(e);e.attr(`transform`,o([y,t.attr(`x`),t.attr(`y`)])+s(r.x,r.y))}),d.rotation=a.modHalf(N,360),t.updateAngularAxis(g,v),t._hasClipOnAxisFalse&&!a.isFullCircle(t.sectorInRad)&&E.call(l.hideOutsideRangePoints,t);var C=!1;for(var D in t.traceHash)if(i.traceIs(D,`gl`)){var I=t.traceHash[D],z=a.filterVisible(I);I[0][0].trace._module.plot(r,t,z,v),z.length&&(C=!0)}C&&(w(r),T(r));var B={};R(B),r.emit(`plotly_relayouting`,B)}function R(e){e[t.id+`.angularaxis.rotation`]=N,t.vangles&&(e[t.id+`.radialaxis.angle`]=P)}function z(){k.select(`text`).attr(`transform`,null);var e={};R(e),i.call(`_guiRelayout`,r,e)}b.prepFn=function(n,i,o){M=e[t.id].angularaxis.rotation;var s=y.getBoundingClientRect();A=i-s.left,j=o-s.top,r._fullLayout._calcInverseTransform(r);var c=a.apply3DTransform(e._invTransform)(A,j);A=c[0],j=c[1],F=S(A,j),b.moveFn=I,b.doneFn=z,x(r)},t.vangles&&!a.isFullCircle(t.sectorInRad)&&(b.prepFn=a.noop,C(n.select(y),null)),g.init(b)},B.isPtInside=function(e){if(this.isSmith)return!0;var t=this.sectorInRad,n=this.vangles,r=this.angularAxis.c2g(e.theta),i=this.radialAxis,o=i.c2l(e.r),s=i._rl;return(n?O.isPtInsidePolygon:a.isPtInsideSector)(o,r,s,t,n)},B.pathArc=function(e){var t=this.sectorInRad,n=this.vangles;return(n?O.pathPolygon:a.pathArc)(e,t[0],t[1],n)},B.pathSector=function(e){var t=this.sectorInRad,n=this.vangles;return(n?O.pathPolygon:a.pathSector)(e,t[0],t[1],n)},B.pathAnnulus=function(e,t){var n=this.sectorInRad,r=this.vangles;return(r?O.pathPolygonAnnulus:a.pathAnnulus)(e,t,n[0],n[1],r)},B.pathSubplot=function(){var e=this.innerRadius,t=this.radius;return e?this.pathAnnulus(e,t):this.pathSector(t)},B.fillViewInitialKey=function(e,t){e in this.viewInitial||(this.viewInitial[e]=t)};function V(e){var t=e.ticks+String(e.ticklen)+String(e.showticklabels);return`side`in e&&(t+=e.side),t}function H(e){var t=e[0],n=e[1]-t,r=F(t,360),i=r+n,a=Math.cos(I(r)),o=Math.sin(I(r)),s=Math.cos(I(i)),c=Math.sin(I(i)),l,u,d,f;return f=r<=90&&i>=90||r>90&&i>=450?1:o<=0&&c<=0?0:Math.max(o,c),l=r<=180&&i>=180||r>180&&i>=540?-1:a>=0&&s>=0?0:Math.min(a,s),u=r<=270&&i>=270||r>270&&i>=630?-1:o>=0&&c>=0?0:Math.min(o,c),d=i>=360?1:a<=0&&s<=0?0:Math.max(a,s),[l,u,d,f]}function U(e,t){return t[a.findIndexOfMin(t,function(t){return a.angleDist(e,t)})]}function W(e,t,n){return t?(e.attr(`display`,null),e.attr(n)):e&&e.attr(`display`,`none`),e}}),ZC=h((e,t)=>{var n=K(),r=Mt(),i=Da().attributes,a=$().extendFlat,o=Ie().overrideAll,s=o({color:r.color,showline:a({},r.showline,{dflt:!0}),linecolor:r.linecolor,linewidth:r.linewidth,showgrid:a({},r.showgrid,{dflt:!0}),gridcolor:r.gridcolor,gridwidth:r.gridwidth,griddash:r.griddash},`plot`,`from-root`),c=o({tickmode:r.minor.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:r.ticks,ticklen:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,ticklabelstep:r.ticklabelstep,showticklabels:r.showticklabels,labelalias:r.labelalias,minorloglabels:r.minorloglabels,showtickprefix:r.showtickprefix,tickprefix:r.tickprefix,showticksuffix:r.showticksuffix,ticksuffix:r.ticksuffix,showexponent:r.showexponent,exponentformat:r.exponentformat,minexponent:r.minexponent,separatethousands:r.separatethousands,tickfont:r.tickfont,tickangle:r.tickangle,tickformat:r.tickformat,tickformatstops:r.tickformatstops,layer:r.layer},`plot`,`from-root`),l={visible:a({},r.visible,{dflt:!0}),type:a({},r.type,{values:[`-`,`linear`,`log`,`date`,`category`]}),autotypenumbers:r.autotypenumbers,autorangeoptions:{minallowed:r.autorangeoptions.minallowed,maxallowed:r.autorangeoptions.maxallowed,clipmin:r.autorangeoptions.clipmin,clipmax:r.autorangeoptions.clipmax,include:r.autorangeoptions.include,editType:`plot`},autorange:a({},r.autorange,{editType:`plot`}),rangemode:{valType:`enumerated`,values:[`tozero`,`nonnegative`,`normal`],dflt:`tozero`,editType:`calc`},minallowed:a({},r.minallowed,{editType:`plot`}),maxallowed:a({},r.maxallowed,{editType:`plot`}),range:a({},r.range,{items:[{valType:`any`,editType:`plot`,impliedEdits:{"^autorange":!1}},{valType:`any`,editType:`plot`,impliedEdits:{"^autorange":!1}}],editType:`plot`}),categoryorder:r.categoryorder,categoryarray:r.categoryarray,angle:{valType:`angle`,editType:`plot`},autotickangles:r.autotickangles,side:{valType:`enumerated`,values:[`clockwise`,`counterclockwise`],dflt:`clockwise`,editType:`plot`},title:{text:a({},r.title.text,{editType:`plot`,dflt:``}),font:a({},r.title.font,{editType:`plot`}),editType:`plot`},hoverformat:r.hoverformat,uirevision:{valType:`any`,editType:`none`},editType:`calc`};a(l,s,c);var u={visible:a({},r.visible,{dflt:!0}),type:{valType:`enumerated`,values:[`-`,`linear`,`category`],dflt:`-`,editType:`calc`,_noTemplating:!0},autotypenumbers:r.autotypenumbers,categoryorder:r.categoryorder,categoryarray:r.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:r.hoverformat,uirevision:{valType:`any`,editType:`none`},editType:`calc`};a(u,s,c),t.exports={domain:i({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:n.background},radialaxis:l,angularaxis:u,gridshape:{valType:`enumerated`,values:[`circular`,`linear`],dflt:`circular`,editType:`plot`},uirevision:{valType:`any`,editType:`none`},editType:`calc`}}),QC=h((e,t)=>{var n=$(),r=q(),i=yt(),a=Ks(),o=wt().getSubplotData,s=Rt(),c=zt(),l=Ht(),u=Ut(),d=wi(),f=Ti(),p=cn(),m=an(),h=ZC(),g=KC(),_=qC(),v=_.axisNames;function y(e,t,a,m){var y=a(`bgcolor`);m.bgColor=r.combine(y,m.paper_bgcolor);var x=a(`sector`);a(`hole`);var S=o(m.fullData,_.name,m.id),C=m.layoutOut,w;function T(e,t){return a(w+`.`+e,t)}for(var E=0;E<v.length;E++){w=v[E],n.isPlainObject(e[w])||(e[w]={});var D=e[w],O=i.newContainer(t,w);O._id=O._name=w,O._attr=m.id+`.`+w,O._traceIndices=S.map(function(e){return e.index});var k=_.axisName2dataArray[w],A=b(D,O,T,S,k,m);d(D,O,T,{axData:S,dataAttr:k});var j=T(`visible`);switch(g(O,t,C),T(`uirevision`,t.uirevision),O._m=1,w){case`radialaxis`:T(`minallowed`),T(`maxallowed`);var M=T(`range`),N=O.getAutorangeDflt(M),P=T(`autorange`,N),F;M&&(M[0]===null&&M[1]===null||(M[0]===null||M[1]===null)&&(P===`reversed`||P===!0)||M[0]!==null&&(P===`min`||P===`max reversed`)||M[1]!==null&&(P===`max`||P===`min reversed`))&&(M=void 0,delete O.range,O.autorange=!0,F=!0),F||(N=O.getAutorangeDflt(M),P=T(`autorange`,N)),D.autorange=P,P&&(p(T,P,M),(A===`linear`||A===`-`)&&T(`rangemode`),O.isReversed()&&(O._m=-1)),O.cleanRange(`range`,{dfltRange:[0,1]});break;case`angularaxis`:if(A===`date`){n.log(`Polar plots do not support date angular axes yet.`);for(var I=0;I<S.length;I++)S[I].visible=!1;A=D.type=O.type=`linear`}T(A===`linear`?`thetaunit`:`period`),T(`rotation`,{counterclockwise:0,clockwise:90}[T(`direction`)]);break}if(u(D,O,T,O.type,{tickSuffixDflt:O.thetaunit===`degrees`?`°`:void 0}),j){var L,R,z,B,V,H,U,W,G,K,q=m.font||{};L=T(`color`),R=L===D.color?L:q.color,z=q.size,B=q.family,V=q.weight,H=q.style,U=q.variant,W=q.textcase,G=q.lineposition,K=q.shadow,s(D,O,T,O.type),l(D,O,T,O.type,{font:{weight:V,style:H,variant:U,textcase:W,lineposition:G,shadow:K,color:R,size:z,family:B},noAutotickangles:w===`angularaxis`,noTicklabelshift:!0,noTicklabelstandoff:!0}),c(D,O,T,{outerTicks:!0}),f(D,O,T,{dfltColor:L,bgColor:m.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:h[w]}),T(`layer`),w===`radialaxis`&&(T(`side`),T(`angle`,x[0]),T(`title.text`),n.coerceFont(T,`title.font`,{weight:V,style:H,variant:U,textcase:W,lineposition:G,shadow:K,color:R,size:n.bigFont(z),family:B}))}A!==`category`&&T(`hoverformat`),O._input=D}t.angularaxis.type===`category`&&a(`gridshape`)}function b(e,t,n,r,i,a){var o=n(`autotypenumbers`,a.autotypenumbersDflt);if(n(`type`)===`-`){for(var s,c=0;c<r.length;c++)if(r[c].visible){s=r[c];break}s&&s[i]&&(t.type=m(s[i],`gregorian`,{noMultiCategory:!0,autotypenumbers:o})),t.type===`-`?t.type=`linear`:e.type=t.type}return t.type}t.exports=function(e,t,n){a(e,t,n,{type:_.name,attributes:h,handleDefaults:y,font:t.font,autotypenumbersDflt:t.autotypenumbers,paper_bgcolor:t.paper_bgcolor,fullData:n,layoutOut:t})}}),$C=h((e,t)=>{var n=wt().getSubplotCalcData,r=$().counterRegex,i=XC(),a=qC(),o=a.attr,s=a.name,c=r(s),l={};l[o]={valType:`subplotid`,dflt:s,editType:`calc`};function u(e){for(var t=e._fullLayout,r=e.calcdata,a=t._subplots[s],o=0;o<a.length;o++){var c=a[o],l=n(r,s,c),u=t[c]._subplot;u||(u=i(e,c),t[c]._subplot=u),u.plot(l,t,e._promises)}}function d(e,t,n,r){for(var i=r._subplots[s]||[],a=r._has&&r._has(`gl`),o=t._has&&t._has(`gl`),c=a&&!o,l=0;l<i.length;l++){var u=i[l],d=r[u]._subplot;if(!t[u]&&d)for(var f in d.framework.remove(),d.layers[`radial-axis-title`].remove(),d.clipPaths)d.clipPaths[f].remove();c&&d._scene&&(d._scene.destroy(),d._scene=null)}}t.exports={attr:o,name:s,idRoot:s,idRegex:c,attrRegex:c,attributes:l,layoutAttributes:ZC(),supplyLayoutDefaults:QC(),plot:u,clean:d,toSVG:Ai().toSVG}}),ew=h((e,t)=>{var{hovertemplateAttrs:n,texttemplateAttrs:r,templatefallbackAttrs:i}=ze(),a=z().extendFlat,o=wr(),s=Tr(),c=W(),l=s.line;t.exports={mode:s.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:s.text,texttemplate:r({editType:`plot`},{keys:[`r`,`theta`,`text`]}),texttemplatefallback:i({editType:`plot`}),hovertext:s.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:a({},l.shape,{values:[`linear`,`spline`]}),smoothing:l.smoothing,editType:`calc`},connectgaps:s.connectgaps,marker:s.marker,cliponaxis:a({},s.cliponaxis,{dflt:!1}),textposition:s.textposition,textfont:s.textfont,fill:a({},s.fill,{values:[`none`,`toself`,`tonext`],dflt:`none`}),fillcolor:o(),hoverinfo:a({},c.hoverinfo,{flags:[`r`,`theta`,`text`,`name`]}),hoveron:s.hoveron,hovertemplate:n(),hovertemplatefallback:i(),selected:s.selected,unselected:s.unselected}}),tw=h((e,t)=>{var n=$(),r=Xt(),i=Yr(),a=Xr(),o=Zr(),s=Qr(),c=$r(),l=Cr().PTS_LINESONLY,u=ew();function d(e,t,d,p){function m(r,i){return n.coerce(e,t,u,r,i)}var h=f(e,t,p,m);if(!h){t.visible=!1;return}m(`thetaunit`),m(`mode`,h<l?`lines+markers`:`lines`),m(`text`),m(`hovertext`),t.hoveron!==`fills`&&(m(`hovertemplate`),m(`hovertemplatefallback`)),r.hasMarkers(t)&&i(e,t,d,p,m,{gradient:!0}),r.hasLines(t)&&(a(e,t,d,p,m,{backoff:!0}),o(e,t,m),m(`connectgaps`)),r.hasText(t)&&(m(`texttemplate`),m(`texttemplatefallback`),s(e,t,p,m));var g=[];(r.hasMarkers(t)||r.hasText(t))&&(m(`cliponaxis`),m(`marker.maxdisplayed`),g.push(`points`)),m(`fill`),t.fill!==`none`&&(c(e,t,d,m),r.hasLines(t)||o(e,t,m)),(t.fill===`tonext`||t.fill===`toself`)&&g.push(`fills`),m(`hoveron`,g.join(`+`)||`points`),n.coerceSelectionMarkerOpacity(t,m)}function f(e,t,r,i){var a=i(`r`),o=i(`theta`);n.isTypedArray(a)&&(t.r=a=Array.from(a)),n.isTypedArray(o)&&(t.theta=o=Array.from(o));var s;if(a)o?s=Math.min(a.length,o.length):(s=a.length,i(`theta0`),i(`dtheta`));else{if(!o)return 0;s=t.theta.length,i(`r0`),i(`dr`)}return t._length=s,s}t.exports={handleRThetaDefaults:f,supplyDefaults:d}}),nw=h((e,t)=>{var n=$(),r=sn();t.exports=function(e,t,i){var a={},o=i[t.subplot]._subplot,s,c;o?(s=o.radialAxis,c=o.angularAxis):(o=i[t.subplot],s=o.radialaxis,c=o.angularaxis);var l=s.c2l(e.r);a.rLabel=r.tickText(s,l,!0).text;var u=c.thetaunit===`degrees`?n.rad2deg(e.theta):e.theta;return a.thetaLabel=r.tickText(c,u,!0).text,a}}),rw=h((e,t)=>{var n=D(),r=O().BADNUM,i=sn(),a=ai(),o=oi(),s=si(),c=ci().calcMarkerSize;t.exports=function(e,t){for(var l=e._fullLayout,u=t.subplot,d=l[u].radialaxis,f=l[u].angularaxis,p=d.makeCalcdata(t,`r`),m=f.makeCalcdata(t,`theta`),h=t._length,g=Array(h),_=0;_<h;_++){var v=p[_],y=m[_],b=g[_]={};n(v)&&n(y)?(b.r=v,b.theta=y):b.r=r}var x=c(t,h);return t._extremes.x=i.findExtremes(d,p,{ppad:x}),a(e,t),o(g,t),s(g,t),g}}),iw=h((e,t)=>{var n=hi(),r=O().BADNUM;t.exports=function(e,t,i){for(var a=t.layers.frontplot.select(`g.scatterlayer`),o=t.xaxis,s=t.yaxis,c={xaxis:o,yaxis:s,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},l=t.radialAxis,u=t.angularAxis,d=0;d<i.length;d++)for(var f=i[d],p=0;p<f.length;p++){p===0&&(f[0].trace._xA=o,f[0].trace._yA=s);var m=f[p],h=m.r;if(h===r)m.x=m.y=r;else{var g=l.c2g(h),_=u.c2g(m.theta);m.x=g*Math.cos(_),m.y=g*Math.sin(_)}}n(e,c,i,a)}}),aw=h((e,t)=>{var n=bi();function r(e,t,r,a){var o=n(e,t,r,a);if(!(!o||o[0].index===!1)){var s=o[0];if(s.index===void 0)return o;var c=e.subplot,l=s.cd[s.index],u=s.trace;if(c.isPtInside(l))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(l,u,c,s),s.hovertemplate=u.hovertemplate,o}}function i(e,t,n,r){var i=n.radialAxis,a=n.angularAxis;i._hovertitle=`r`,a._hovertitle=`θ`;var o={};o[t.subplot]={_subplot:n};var s=t._module.formatLabels(e,t,o);r.rLabel=s.rLabel,r.thetaLabel=s.thetaLabel;var c=e.hi||t.hoverinfo,l=[];function u(e,t){l.push(e._hovertitle+`: `+t)}if(!t.hovertemplate){var d=c.split(`+`);d.indexOf(`all`)!==-1&&(d=[`r`,`theta`,`text`]),d.indexOf(`r`)!==-1&&u(i,r.rLabel),d.indexOf(`theta`)!==-1&&u(a,r.thetaLabel),d.indexOf(`text`)!==-1&&r.text&&(l.push(r.text),delete r.text),r.extraText=l.join(`<br>`)}}t.exports={hoverPoints:r,makeHoverPointText:i}}),ow=h((e,t)=>{t.exports={moduleType:`trace`,name:`scatterpolar`,basePlotModule:$C(),categories:[`polar`,`symbols`,`showLegend`,`scatter-like`],attributes:ew(),supplyDefaults:tw().supplyDefaults,colorbar:gi(),formatLabels:nw(),calc:rw(),plot:iw(),style:vi().style,styleOnSelect:vi().styleOnSelect,hoverPoints:aw().hoverPoints,selectPoints:xi(),meta:{}}}),sw=h((e,t)=>{t.exports=ow()}),cw=h((e,t)=>{var n=ew(),{cliponaxis:r,hoveron:i}=n,a=p(n,[`cliponaxis`,`hoveron`]),{connectgaps:o,line:{color:s,dash:c,width:l},fill:u,fillcolor:m,marker:h,textfont:g,textposition:_}=c_();t.exports=f(d({},a),{connectgaps:o,fill:u,fillcolor:m,line:{color:s,dash:c,editType:`calc`,width:l},marker:h,textfont:g,textposition:_})}),lw=h((e,t)=>{var n=$(),r=Xt(),i=tw().handleRThetaDefaults,a=Yr(),o=Xr(),s=Qr(),c=$r(),l=Cr().PTS_LINESONLY,u=cw();t.exports=function(e,t,d,f){function p(r,i){return n.coerce(e,t,u,r,i)}var m=i(e,t,f,p);if(!m){t.visible=!1;return}p(`thetaunit`),p(`mode`,m<l?`lines+markers`:`lines`),p(`text`),p(`hovertext`),t.hoveron!==`fills`&&(p(`hovertemplate`),p(`hovertemplatefallback`)),r.hasMarkers(t)&&a(e,t,d,f,p,{noAngleRef:!0,noLineDash:!0,noStandOff:!0}),r.hasLines(t)&&(o(e,t,d,f,p),p(`connectgaps`)),r.hasText(t)&&(p(`texttemplate`),p(`texttemplatefallback`),s(e,t,f,p,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0})),p(`fill`),t.fill!==`none`&&c(e,t,d,p),n.coerceSelectionMarkerOpacity(t,p)}}),uw=h((e,t)=>{var n=nw();t.exports=function(e,t,r){var i=e.i;return`r`in e||(e.r=t._r[i]),`theta`in e||(e.theta=t._theta[i]),n(e,t,r)}}),dw=h((e,t)=>{var n=ai(),r=ci().calcMarkerSize,i=j_(),a=sn(),o=s_().TOO_MANY_POINTS;t.exports=function(e,t){var s=e._fullLayout,c=t.subplot,l=s[c].radialaxis,u=s[c].angularaxis,d=t._r=l.makeCalcdata(t,`r`),f=t._theta=u.makeCalcdata(t,`theta`),p=t._length,m={};p<d.length&&(d=d.slice(0,p)),p<f.length&&(f=f.slice(0,p)),m.r=d,m.theta=f,n(e,t);var h=m.opts=i.style(e,t),g;return p<o?g=r(t,p):h.marker&&(g=2*(h.marker.sizeAvg||Math.max(h.marker.size,3))),t._extremes.x=a.findExtremes(l,d,{ppad:g}),[{x:!1,y:!1,t:m,trace:t}]}}),fw=h((e,t)=>{var n=o_(),r=aw().makeHoverPointText;function i(e,t,i,a){var o=e.cd[0].t,s=o.r,c=o.theta,l=n.hoverPoints(e,t,i,a);if(!(!l||l[0].index===!1)){var u=l[0];if(u.index===void 0)return l;var d=e.subplot,f=u.cd[u.index],p=u.trace;if(f.r=s[u.index],f.theta=c[u.index],d.isPtInside(f))return u.xLabelVal=void 0,u.yLabelVal=void 0,r(f,p,d,u),l}}t.exports={hoverPoints:i}}),pw=h((e,t)=>{t.exports={moduleType:`trace`,name:`scatterpolargl`,basePlotModule:$C(),categories:[`gl`,`regl`,`polar`,`symbols`,`showLegend`,`scatter-like`],attributes:cw(),supplyDefaults:lw(),colorbar:gi(),formatLabels:uw(),calc:dw(),hoverPoints:fw().hoverPoints,selectPoints:F_(),meta:{}}}),mw=h((e,t)=>{var n=x_(),r=D(),i=By(),a=M_(),o=j_(),s=$(),c=s_().TOO_MANY_POINTS,l={};t.exports=function(e,t,l){if(l.length){var u=t.radialAxis,d=t.angularAxis,f=a(e,t);return l.forEach(function(i){if(!(!i||!i[0]||!i[0].trace)){var a=i[0],l=a.trace,p=a.t,m=l._length,h=p.r,g=p.theta,_=p.opts,v,y=h.slice(),b=g.slice();for(v=0;v<h.length;v++)t.isPtInside({r:h[v],theta:g[v]})||(y[v]=NaN,b[v]=NaN);var x=Array(m*2),S=Array(m),C=Array(m);for(v=0;v<m;v++){var w=y[v],T,E;if(r(w)){var D=u.c2g(w),O=d.c2g(b[v],l.thetaunit);T=D*Math.cos(O),E=D*Math.sin(O)}else T=E=NaN;S[v]=x[v*2]=T,C[v]=x[v*2+1]=E}p.tree=n(x),_.marker&&m>=c&&(_.marker.cluster=p.tree),_.marker&&(_.markerSel.positions=_.markerUnsel.positions=_.marker.positions=x),_.line&&x.length>1&&s.extendFlat(_.line,o.linePositions(e,l,x)),_.text&&(s.extendFlat(_.text,{positions:x},o.textPosition(e,l,_.text,_.marker)),s.extendFlat(_.textSel,{positions:x},o.textPosition(e,l,_.text,_.markerSel)),s.extendFlat(_.textUnsel,{positions:x},o.textPosition(e,l,_.text,_.markerUnsel))),_.fill&&!f.fill2d&&(f.fill2d=!0),_.marker&&!f.scatter2d&&(f.scatter2d=!0),_.line&&!f.line2d&&(f.line2d=!0),_.text&&!f.glText&&(f.glText=!0),f.lineOptions.push(_.line),f.fillOptions.push(_.fill),f.markerOptions.push(_.marker),f.markerSelectedOptions.push(_.markerSel),f.markerUnselectedOptions.push(_.markerUnsel),f.textOptions.push(_.text),f.textSelectedOptions.push(_.textSel),f.textUnselectedOptions.push(_.textUnsel),f.selectBatch.push([]),f.unselectBatch.push([]),p.x=S,p.y=C,p.rawx=S,p.rawy=C,p.r=h,p.theta=g,p.positions=x,p._scene=f,p.index=f.count,f.count++}}),i(e,t,l)}},t.exports.reglPrecompiled=l}),hw=h((e,t)=>{var n=pw();n.plot=mw(),t.exports=n}),gw=h((e,t)=>{t.exports=hw()}),_w=h((e,t)=>{var{hovertemplateAttrs:n,templatefallbackAttrs:r}=ze(),i=z().extendFlat,a=ew(),o=qa();t.exports={r:a.r,theta:a.theta,r0:a.r0,dr:a.dr,theta0:a.theta0,dtheta:a.dtheta,thetaunit:a.thetaunit,base:i({},o.base,{}),offset:i({},o.offset,{}),width:i({},o.width,{}),text:i({},o.text,{}),hovertext:i({},o.hovertext,{}),marker:s(),hoverinfo:a.hoverinfo,hovertemplate:n(),hovertemplatefallback:r(),selected:o.selected,unselected:o.unselected};function s(){var e=i({},o.marker);return delete e.cornerradius,e}}),vw=h((e,t)=>{t.exports={barmode:{valType:`enumerated`,values:[`stack`,`overlay`],dflt:`stack`,editType:`calc`},bargap:{valType:`number`,dflt:.1,min:0,max:1,editType:`calc`}}}),yw=h((e,t)=>{var n=$(),r=tw().handleRThetaDefaults,i=Ya(),a=_w();t.exports=function(e,t,o,s){function c(r,i){return n.coerce(e,t,a,r,i)}if(!r(e,t,s,c)){t.visible=!1;return}c(`thetaunit`),c(`base`),c(`offset`),c(`width`),c(`text`),c(`hovertext`),c(`hovertemplate`),c(`hovertemplatefallback`),i(e,t,c,o,s),n.coerceSelectionMarkerOpacity(t,c)}}),bw=h((e,t)=>{var n=$(),r=vw();t.exports=function(e,t,i){var a={},o;function s(i,a){return n.coerce(e[o]||{},t[o],r,i,a)}for(var c=0;c<i.length;c++){var l=i[c];l.type===`barpolar`&&l.visible===!0&&(o=l.subplot,a[o]||(s(`barmode`),s(`bargap`),a[o]=1))}}}),xw=h((e,t)=>{var n=At().hasColorscale,r=Jt(),i=$().isArrayOrTypedArray,a=Qa(),o=di().setGroupPositions,s=si(),c=Ke().traceIs,l=$().extendFlat;function u(e,t){for(var o=e._fullLayout,c=t.subplot,l=o[c].radialaxis,u=o[c].angularaxis,d=l.makeCalcdata(t,`r`),f=u.makeCalcdata(t,`theta`),p=t._length,m=Array(p),h=d,g=f,_=0;_<p;_++)m[_]={p:g[_],s:h[_]};function v(e){var n=t[e];n!==void 0&&(t[`_`+e]=i(n)?u.makeCalcdata(t,e):u.d2c(n,t.thetaunit))}return u.type===`linear`&&(v(`width`),v(`offset`)),n(t,`marker`)&&r(e,t,{vals:t.marker.color,containerStr:`marker`,cLetter:`c`}),n(t,`marker.line`)&&r(e,t,{vals:t.marker.line.color,containerStr:`marker.line`,cLetter:`c`}),a(m,t),s(m,t),m}function d(e,t,n){for(var r=e.calcdata,i=[],a=0;a<r.length;a++){var s=r[a],u=s[0].trace;u.visible===!0&&c(u,`bar`)&&u.subplot===n&&i.push(s)}var d=l({},t.radialaxis,{_id:`x`}),f=t.angularaxis;o(e,f,d,i,{mode:t.barmode,norm:t.barnorm,gap:t.bargap,groupgap:t.bargroupgap})}t.exports={calc:u,crossTraceCalc:d}}),Sw=h((e,t)=>{var n=S(),r=D(),i=$(),a=tn(),o=JC();t.exports=function(e,t,o){var c=e._context.staticPlot,l=t.xaxis,u=t.yaxis,d=t.radialAxis,f=t.angularAxis,p=s(t),m=t.layers.frontplot.select(`g.barlayer`);i.makeTraceGroups(m,o,`trace bars`).each(function(){var o=n.select(this),s=i.ensureSingle(o,`g`,`points`).selectAll(`g.point`).data(i.identity);s.enter().append(`g`).style(`vector-effect`,c?`none`:`non-scaling-stroke`).style(`stroke-miterlimit`,2).classed(`point`,!0),s.exit().remove(),s.each(function(e){var t=n.select(this),a=e.rp0=d.c2p(e.s0),o=e.rp1=d.c2p(e.s1),s=e.thetag0=f.c2g(e.p0),c=e.thetag1=f.c2g(e.p1),m;if(!r(a)||!r(o)||!r(s)||!r(c)||a===o||s===c)m=`M0,0Z`;else{var h=d.c2g(e.s1),g=(s+c)/2;e.ct=[l.c2p(h*Math.cos(g)),u.c2p(h*Math.sin(g))],m=p(a,o,s,c)}i.ensureSingle(t,`path`).attr(`d`,m)}),a.setClipUrl(o,t._hasClipOnAxisFalse?t.clipIds.forTraces:null,e)})};function s(e){var t=e.cxx,n=e.cyy;return e.vangles?function(r,a,s,c){var l,u;i.angleDelta(s,c)>0?(l=s,u=c):(l=c,u=s);var d=o.findEnclosingVertexAngles(l,e.vangles)[0],f=o.findEnclosingVertexAngles(u,e.vangles)[1],p=[d,(l+u)/2,f];return o.pathPolygonAnnulus(r,a,l,u,p,t,n)}:function(e,r,a,o){return i.pathAnnulus(e,r,a,o,t,n)}}}),Cw=h((e,t)=>{var n=Ln(),r=$(),i=io().getTraceColor,a=r.fillText,o=aw().makeHoverPointText,s=JC().isPtInsidePolygon;t.exports=function(e,t,c){var l=e.cd,u=l[0].trace,d=e.subplot,f=d.radialAxis,p=d.angularAxis,m=d.vangles,h=m?s:r.isPtInsideSector,g=e.maxHoverDistance,_=p._period||2*Math.PI,v=Math.abs(f.g2p(Math.sqrt(t*t+c*c))),y=Math.atan2(c,t);if(f.range[0]>f.range[1]&&(y+=Math.PI),n.getClosest(l,function(e){return h(v,y,[e.rp0,e.rp1],[e.thetag0,e.thetag1],m)?g+Math.min(1,Math.abs(e.thetag1-e.thetag0)/_)-1+(e.rp1-v)/(e.rp1-e.rp0)-1:1/0},e),e.index!==!1){var b=l[e.index];e.x0=e.x1=b.ct[0],e.y0=e.y1=b.ct[1];var x=r.extendFlat({},b,{r:b.s,theta:b.p});return a(b,u,e),o(x,u,d,e),e.hovertemplate=u.hovertemplate,e.color=i(u,b),e.xLabelVal=e.yLabelVal=void 0,b.s<0&&(e.idealAlign=`left`),[e]}}}),ww=h((e,t)=>{t.exports={moduleType:`trace`,name:`barpolar`,basePlotModule:$C(),categories:[`polar`,`bar`,`showLegend`],attributes:_w(),layoutAttributes:vw(),supplyDefaults:yw(),supplyLayoutDefaults:bw(),calc:xw().calc,crossTraceCalc:xw().crossTraceCalc,plot:Sw(),colorbar:gi(),formatLabels:nw(),style:no().style,styleOnSelect:no().styleOnSelect,hoverPoints:Cw(),selectPoints:oo(),meta:{}}}),Tw=h((e,t)=>{t.exports=ww()}),Ew=h((e,t)=>{t.exports={attr:`subplot`,name:`smith`,axisNames:[`realaxis`,`imaginaryaxis`],axisName2dataArray:{imaginaryaxis:`imag`,realaxis:`real`}}}),Dw=h((e,t)=>{var n=K(),r=Mt(),i=Da().attributes,a=$().extendFlat,o=Ie().overrideAll,s=o({color:r.color,showline:a({},r.showline,{dflt:!0}),linecolor:r.linecolor,linewidth:r.linewidth,showgrid:a({},r.showgrid,{dflt:!0}),gridcolor:r.gridcolor,gridwidth:r.gridwidth,griddash:r.griddash},`plot`,`from-root`),c=o({ticklen:r.ticklen,tickwidth:a({},r.tickwidth,{dflt:2}),tickcolor:r.tickcolor,showticklabels:r.showticklabels,labelalias:r.labelalias,showtickprefix:r.showtickprefix,tickprefix:r.tickprefix,showticksuffix:r.showticksuffix,ticksuffix:r.ticksuffix,tickfont:r.tickfont,tickformat:r.tickformat,hoverformat:r.hoverformat,layer:r.layer},`plot`,`from-root`),l=a({visible:a({},r.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:`data_array`,editType:`plot`},tickangle:a({},r.tickangle,{dflt:90}),ticks:{valType:`enumerated`,values:[`top`,`bottom`,``],editType:`ticks`},side:{valType:`enumerated`,values:[`top`,`bottom`],dflt:`top`,editType:`plot`},editType:`calc`},s,c),u=a({visible:a({},r.visible,{dflt:!0}),tickvals:{valType:`data_array`,editType:`plot`},ticks:r.ticks,editType:`calc`},s,c);t.exports={domain:i({name:`smith`,editType:`plot`}),bgcolor:{valType:`color`,editType:`plot`,dflt:n.background},realaxis:l,imaginaryaxis:u,editType:`calc`}}),Ow=h((e,t)=>{var n=$(),r=q(),i=yt(),a=Ks(),o=wt().getSubplotData,s=Ut(),c=Ht(),l=Ti(),u=rn(),d=Dw(),f=Ew(),p=f.axisNames,m=g(function(e){return n.isTypedArray(e)&&(e=Array.from(e)),e.slice().reverse().map(function(e){return-e}).concat([0]).concat(e)},String);function h(e,t,a,h){var g=a(`bgcolor`);h.bgColor=r.combine(g,h.paper_bgcolor);var _=o(h.fullData,f.name,h.id),v=h.layoutOut,y;function b(e,t){return a(y+`.`+e,t)}for(var x=0;x<p.length;x++){y=p[x],n.isPlainObject(e[y])||(e[y]={});var S=e[y],C=i.newContainer(t,y);C._id=C._name=y,C._attr=h.id+`.`+y,C._traceIndices=_.map(function(e){return e.index});var w=b(`visible`);if(C.type=`linear`,u(C,v),s(S,C,b,C.type),w){var T=y===`realaxis`;T&&b(`side`),T?b(`tickvals`):b(`tickvals`,m(t.realaxis.tickvals||d.realaxis.tickvals.dflt)),n.isTypedArray(C.tickvals)&&(C.tickvals=Array.from(C.tickvals));var E,D,O,k,A=h.font||{};w&&(E=b(`color`),D=E===S.color?E:A.color,O=A.size,k=A.family),c(S,C,b,C.type,{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noAng:!T,noExp:!0,font:{color:D,size:O,family:k}}),n.coerce2(e,t,d,y+`.ticklen`),n.coerce2(e,t,d,y+`.tickwidth`),n.coerce2(e,t,d,y+`.tickcolor`,t.color),b(`ticks`)||(delete t[y].ticklen,delete t[y].tickwidth,delete t[y].tickcolor),l(S,C,b,{dfltColor:E,bgColor:h.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:d[y]}),b(`layer`)}b(`hoverformat`),delete C.type,C._input=S}}t.exports=function(e,t,n){a(e,t,n,{noUirevision:!0,type:f.name,attributes:d,handleDefaults:h,font:t.font,paper_bgcolor:t.paper_bgcolor,fullData:n,layoutOut:t})};function g(e,t){var n={};return function(r){var i=t?t(r):r;if(i in n)return n[i];var a=e(r);return n[i]=a,a}}}),kw=h((e,t)=>{var n=wt().getSubplotCalcData,r=$().counterRegex,i=XC(),a=Ew(),o=a.attr,s=a.name,c=r(s),l={};l[o]={valType:`subplotid`,dflt:s,editType:`calc`};function u(e){for(var t=e._fullLayout,r=e.calcdata,a=t._subplots[s],o=0;o<a.length;o++){var c=a[o],l=n(r,s,c),u=t[c]._subplot;u||(u=i(e,c,!0),t[c]._subplot=u),u.plot(l,t,e._promises)}}function d(e,t,n,r){for(var i=r._subplots[s]||[],a=0;a<i.length;a++){var o=i[a],c=r[o]._subplot;if(!t[o]&&c)for(var l in c.framework.remove(),c.clipPaths)c.clipPaths[l].remove()}}t.exports={attr:o,name:s,idRoot:s,idRegex:c,attrRegex:c,attributes:l,layoutAttributes:Dw(),supplyLayoutDefaults:Ow(),plot:u,clean:d,toSVG:Ai().toSVG}}),Aw=h((e,t)=>{var{hovertemplateAttrs:n,texttemplateAttrs:r,templatefallbackAttrs:i}=ze(),a=z().extendFlat,o=wr(),s=Tr(),c=W(),l=s.line;t.exports={mode:s.mode,real:{valType:`data_array`,editType:`calc+clearAxisTypes`},imag:{valType:`data_array`,editType:`calc+clearAxisTypes`},text:s.text,texttemplate:r({editType:`plot`},{keys:[`real`,`imag`,`text`]}),texttemplatefallback:i({editType:`plot`}),hovertext:s.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:a({},l.shape,{values:[`linear`,`spline`]}),smoothing:l.smoothing,editType:`calc`},connectgaps:s.connectgaps,marker:s.marker,cliponaxis:a({},s.cliponaxis,{dflt:!1}),textposition:s.textposition,textfont:s.textfont,fill:a({},s.fill,{values:[`none`,`toself`,`tonext`],dflt:`none`}),fillcolor:o(),hoverinfo:a({},c.hoverinfo,{flags:[`real`,`imag`,`text`,`name`]}),hoveron:s.hoveron,hovertemplate:n(),hovertemplatefallback:i(),selected:s.selected,unselected:s.unselected}}),jw=h((e,t)=>{var n=$(),r=Xt(),i=Yr(),a=Xr(),o=Zr(),s=Qr(),c=$r(),l=Cr().PTS_LINESONLY,u=Aw();t.exports=function(e,t,f,p){function m(r,i){return n.coerce(e,t,u,r,i)}var h=d(e,t,p,m);if(!h){t.visible=!1;return}m(`mode`,h<l?`lines+markers`:`lines`),m(`text`),m(`hovertext`),t.hoveron!==`fills`&&(m(`hovertemplate`),m(`hovertemplatefallback`)),r.hasMarkers(t)&&i(e,t,f,p,m,{gradient:!0}),r.hasLines(t)&&(a(e,t,f,p,m,{backoff:!0}),o(e,t,m),m(`connectgaps`)),r.hasText(t)&&(m(`texttemplate`),m(`texttemplatefallback`),s(e,t,p,m));var g=[];(r.hasMarkers(t)||r.hasText(t))&&(m(`cliponaxis`),m(`marker.maxdisplayed`),g.push(`points`)),m(`fill`),t.fill!==`none`&&(c(e,t,f,m),r.hasLines(t)||o(e,t,m)),(t.fill===`tonext`||t.fill===`toself`)&&g.push(`fills`),m(`hoveron`,g.join(`+`)||`points`),n.coerceSelectionMarkerOpacity(t,m)};function d(e,t,r,i){var a=i(`real`),o=i(`imag`),s;return a&&o&&(s=Math.min(a.length,o.length)),n.isTypedArray(a)&&(t.real=a=Array.from(a)),n.isTypedArray(o)&&(t.imag=o=Array.from(o)),t._length=s,s}}),Mw=h((e,t)=>{var n=sn();t.exports=function(e,t,r){var i={},a=r[t.subplot]._subplot;return i.realLabel=n.tickText(a.radialAxis,e.real,!0).text,i.imagLabel=n.tickText(a.angularAxis,e.imag,!0).text,i}}),Nw=h((e,t)=>{var n=D(),r=O().BADNUM,i=ai(),a=oi(),o=si(),s=ci().calcMarkerSize;t.exports=function(e,t){for(var c=e._fullLayout,l=t.subplot,u=c[l].realaxis,d=c[l].imaginaryaxis,f=u.makeCalcdata(t,`real`),p=d.makeCalcdata(t,`imag`),m=t._length,h=Array(m),g=0;g<m;g++){var _=f[g],v=p[g],y=h[g]={};n(_)&&n(v)?(y.real=_,y.imag=v):y.real=r}return s(t,m),i(e,t),a(h,t),o(h,t),h}}),Pw=h((e,t)=>{var n=hi(),r=O().BADNUM,i=YC().smith;t.exports=function(e,t,a){for(var o=t.layers.frontplot.select(`g.scatterlayer`),s=t.xaxis,c=t.yaxis,l={xaxis:s,yaxis:c,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},u=0;u<a.length;u++)for(var d=a[u],f=0;f<d.length;f++){f===0&&(d[0].trace._xA=s,d[0].trace._yA=c);var p=d[f],m=p.real;if(m===r)p.x=p.y=r;else{var h=i([m,p.imag]);p.x=h[0],p.y=h[1]}}n(e,l,a,o)}}),Fw=h((e,t)=>{var n=bi();function r(e,t,r,a){var o=n(e,t,r,a);if(!(!o||o[0].index===!1)){var s=o[0];if(s.index===void 0)return o;var c=e.subplot,l=s.cd[s.index],u=s.trace;if(c.isPtInside(l))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(l,u,c,s),s.hovertemplate=u.hovertemplate,o}}function i(e,t,n,r){var i=n.radialAxis,a=n.angularAxis;i._hovertitle=`real`,a._hovertitle=`imag`;var o={};o[t.subplot]={_subplot:n};var s=t._module.formatLabels(e,t,o);r.realLabel=s.realLabel,r.imagLabel=s.imagLabel;var c=e.hi||t.hoverinfo,l=[];function u(e,t){l.push(e._hovertitle+`: `+t)}if(!t.hovertemplate){var d=c.split(`+`);d.indexOf(`all`)!==-1&&(d=[`real`,`imag`,`text`]),d.indexOf(`real`)!==-1&&u(i,r.realLabel),d.indexOf(`imag`)!==-1&&u(a,r.imagLabel),d.indexOf(`text`)!==-1&&r.text&&(l.push(r.text),delete r.text),r.extraText=l.join(`<br>`)}}t.exports={hoverPoints:r,makeHoverPointText:i}}),Iw=h((e,t)=>{t.exports={moduleType:`trace`,name:`scattersmith`,basePlotModule:kw(),categories:[`smith`,`symbols`,`showLegend`,`scatter-like`],attributes:Aw(),supplyDefaults:jw(),colorbar:gi(),formatLabels:Mw(),calc:Nw(),plot:Pw(),style:vi().style,styleOnSelect:vi().styleOnSelect,hoverPoints:Fw().hoverPoints,selectPoints:xi(),meta:{}}}),Lw=h((e,t)=>{t.exports=Iw()}),Rw=h((e,t)=>{var n=R_();function r(){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={}}n(r.prototype,{instance:function(e,t){e=(e||`gregorian`).toLowerCase(),t||=``;var n=this._localCals[e+`-`+t];if(!n&&this.calendars[e]&&(n=new this.calendars[e](t),this._localCals[e+`-`+t]=n),!n)throw(this.local.invalidCalendar||this.regionalOptions[``].invalidCalendar).replace(/\{0\}/,e);return n},newDate:function(e,t,n,r,i){return r=(e!=null&&e.year?e.calendar():typeof r==`string`?this.instance(r,i):r)||this.instance(),r.newDate(e,t,n)},substituteDigits:function(e){return function(t){return(t+``).replace(/[0-9]/g,function(t){return e[t]})}},substituteChineseDigits:function(e,t){return function(n){for(var r=``,i=0;n>0;){var a=n%10;r=(a===0?``:e[a]+t[i])+r,i++,n=Math.floor(n/10)}return r.indexOf(e[1]+t[1])===0&&(r=r.substr(1)),r||e[0]}}});function i(e,t,n,r){if(this._calendar=e,this._year=t,this._month=n,this._day=r,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[``].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(e,t){return e=``+e,`000000`.substring(0,t-e.length)+e}n(i.prototype,{newDate:function(e,t,n){return this._calendar.newDate(e??this,t,n)},year:function(e){return arguments.length===0?this._year:this.set(e,`y`)},month:function(e){return arguments.length===0?this._month:this.set(e,`m`)},day:function(e){return arguments.length===0?this._day:this.set(e,`d`)},date:function(e,t,n){if(!this._calendar.isValid(e,t,n))throw(c.local.invalidDate||c.regionalOptions[``].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=n,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(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[``].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year===e._year?this._month===e._month?this._day-e._day:this.monthOfYear()-e.monthOfYear():this._year-e._year;return t===0?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?`-`:``)+a(Math.abs(this.year()),4)+`-`+a(this.month(),2)+`-`+a(this.day(),2)}});function o(){this.shortYearCutoff=`+10`}n(o.prototype,{_validateLevel:0,newDate:function(e,t,n){return e==null?this.today():(e.year&&(this._validate(e,t,n,c.local.invalidDate||c.regionalOptions[``].invalidDate),n=e.day(),t=e.month(),e=e.year()),new i(this,e,t,n))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[``].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[``].invalidYear);return(t.year()<0?`-`:``)+a(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[``].invalidYear),12},monthOfYear:function(e,t){var n=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[``].invalidMonth);return(n.month()+this.monthsInYear(n)-this.firstMonth)%this.monthsInYear(n)+this.minMonth},fromMonthOfYear:function(e,t){var n=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,n,this.minDay,c.local.invalidMonth||c.regionalOptions[``].invalidMonth),n},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[``].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,n){var r=this._validate(e,t,n,c.local.invalidDate||c.regionalOptions[``].invalidDate);return r.toJD()-this.newDate(r.year(),this.fromMonthOfYear(r.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,n){var r=this._validate(e,t,n,c.local.invalidDate||c.regionalOptions[``].invalidDate);return(Math.floor(this.toJD(r))+2)%this.daysInWeek()},extraInfo:function(e,t,n){return this._validate(e,t,n,c.local.invalidDate||c.regionalOptions[``].invalidDate),{}},add:function(e,t,n){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[``].invalidDate),this._correctAdd(e,this._add(e,t,n),t,n)},_add:function(e,t,n){if(this._validateLevel++,n===`d`||n===`w`){var r=e.toJD()+t*(n===`w`?this.daysInWeek():1),i=e.calendar().fromJD(r);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=e.year()+(n===`y`?t:0),o=e.monthOfYear()+(n===`m`?t:0),i=e.day();n===`y`?(e.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):n===`m`&&(function(e){for(;o<e.minMonth;)a--,o+=e.monthsInYear(a);for(var t=e.monthsInYear(a);o>t-1+e.minMonth;)a++,o-=t,t=e.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,n,r){if(!this.hasYearZero&&(r===`y`||r===`m`)&&(t[0]===0||e.year()>0!=t[0]>0)){var i={y:[1,1,`y`],m:[1,this.monthsInYear(-1),`m`],w:[this.daysInWeek(),this.daysInYear(-1),`d`],d:[1,this.daysInYear(-1),`d`]}[r],a=n<0?-1:1;t=this._add(e,n*i[0]+a*i[1],i[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,n){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[``].invalidDate);var r=n===`y`?t:e.year(),i=n===`m`?t:e.month(),a=n===`d`?t:e.day();return(n===`y`||n===`m`)&&(a=Math.min(a,this.daysInMonth(r,i))),e.date(r,i,a)},isValid:function(e,t,n){this._validateLevel++;var r=this.hasYearZero||e!==0;if(r){var i=this.newDate(e,t,this.minDay);r=t>=this.minMonth&&t-this.minMonth<this.monthsInYear(i)&&n>=this.minDay&&n-this.minDay<this.daysInMonth(i)}return this._validateLevel--,r},toJSDate:function(e,t,n){var r=this._validate(e,t,n,c.local.invalidDate||c.regionalOptions[``].invalidDate);return c.instance().fromJD(this.toJD(r)).toJSDate()},fromJSDate:function(e){return this.fromJD(c.instance().fromJSDate(e).toJD())},_validate:function(e,t,n,r){if(e.year){if(this._validateLevel===0&&this.name!==e.calendar().name)throw(c.local.differentCalendars||c.regionalOptions[``].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,e.calendar().local.name);return e}try{if(this._validateLevel++,this._validateLevel===1&&!this.isValid(e,t,n))throw r.replace(/\{0\}/,this.local.name);var i=this.newDate(e,t,n);return this._validateLevel--,i}catch(e){throw this._validateLevel--,e}}});function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[``]}s.prototype=new o,n(s.prototype,{name:`Gregorian`,jdEpoch:1721425.5,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(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[``].invalidYear),e=t.year()+(t.year()<0?1:0);return e%4==0&&(e%100!=0||e%400==0)},weekOfYear:function(e,t,n){var r=this.newDate(e,t,n);return r.add(4-(r.dayOfWeek()||7),`d`),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var n=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[``].invalidMonth);return this.daysPerMonth[n.month()-1]+(n.month()===2&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,n){return(this.dayOfWeek(e,t,n)||7)<6},toJD:function(e,t,n){var r=this._validate(e,t,n,c.local.invalidDate||c.regionalOptions[``].invalidDate);e=r.year(),t=r.month(),n=r.day(),e<0&&e++,t<3&&(t+=12,e--);var i=Math.floor(e/100),a=2-i+Math.floor(i/4);return Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+n+a-1524.5},fromJD:function(e){var t=Math.floor(e+.5),n=Math.floor((t-1867216.25)/36524.25);n=t+1+n-Math.floor(n/4);var r=n+1524,i=Math.floor((r-122.1)/365.25),a=Math.floor(365.25*i),o=Math.floor((r-a)/30.6001),s=r-a-Math.floor(o*30.6001),c=o-(o>13.5?13:1),l=i-(c>2.5?4716:4715);return l<=0&&l--,this.newDate(l,c,s)},toJSDate:function(e,t,n){var r=this._validate(e,t,n,c.local.invalidDate||c.regionalOptions[``].invalidDate),i=new Date(r.year(),r.month()-1,r.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new r;c.cdate=i,c.baseCalendar=o,c.calendars.gregorian=s}),zw=h(()=>{var e=R_(),t=Rw();e(t.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`}),t.local=t.regionalOptions[``],e(t.cdate.prototype,{formatDate:function(e,t){return typeof e!=`string`&&(t=e,e=``),this._calendar.formatDate(e||``,this,t)}}),e(t.baseCalendar.prototype,{UNIX_EPOCH:t.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:t.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(e,n,r){if(typeof e!=`string`&&(r=n,n=e,e=``),!n)return``;if(n.calendar()!==this)throw t.local.invalidFormat||t.regionalOptions[``].invalidFormat;e||=this.local.dateFormat,r||={};for(var i=r.dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,c=r.monthNames||this.local.monthNames,l=r.calculateWeek||this.local.calculateWeek,u=function(t,n){for(var r=1;b+r<e.length&&e.charAt(b+r)===t;)r++;return b+=r-1,Math.floor(r/(n||1))>1},d=function(e,t,n,r){var i=``+t;if(u(e,r))for(;i.length<n;)i=`0`+i;return i},f=function(e,t,n,r){return u(e)?r[t]:n[t]},p=this,m=function(e){return typeof o==`function`?o.call(p,e,u(`m`)):_(d(`m`,e.month(),2))},h=function(e,t){return t?typeof c==`function`?c.call(p,e):c[e.month()-p.minMonth]:typeof s==`function`?s.call(p,e):s[e.month()-p.minMonth]},g=this.local.digits,_=function(e){return r.localNumbers&&g?g(e):e},v=``,y=!1,b=0;b<e.length;b++)if(y)e.charAt(b)===`'`&&!u(`'`)?y=!1:v+=e.charAt(b);else switch(e.charAt(b)){case`d`:v+=_(d(`d`,n.day(),2));break;case`D`:v+=f(`D`,n.dayOfWeek(),i,a);break;case`o`:v+=d(`o`,n.dayOfYear(),3);break;case`w`:v+=d(`w`,n.weekOfYear(),2);break;case`m`:v+=m(n);break;case`M`:v+=h(n,u(`M`));break;case`y`:v+=u(`y`,2)?n.year():(n.year()%100<10?`0`:``)+n.year()%100;break;case`Y`:u(`Y`,2),v+=n.formatYear();break;case`J`:v+=n.toJD();break;case`@`:v+=(n.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case`!`:v+=(n.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case`'`:u(`'`)?v+=`'`:y=!0;break;default:v+=e.charAt(b)}return v},parseDate:function(e,n,r){if(n==null)throw t.local.invalidArguments||t.regionalOptions[``].invalidArguments;if(n=typeof n==`object`?n.toString():n+``,n===``)return null;e||=this.local.dateFormat,r||={};var i=r.shortYearCutoff||this.shortYearCutoff;i=typeof i==`string`?this.today().year()%100+parseInt(i,10):i;for(var a=r.dayNamesShort||this.local.dayNamesShort,o=r.dayNames||this.local.dayNames,s=r.parseMonth||this.local.parseMonth,c=r.monthNumbers||this.local.monthNumbers,l=r.monthNamesShort||this.local.monthNamesShort,u=r.monthNames||this.local.monthNames,d=-1,f=-1,p=-1,m=-1,h=-1,g=!1,_=!1,v=function(t,n){for(var r=1;E+r<e.length&&e.charAt(E+r)===t;)r++;return E+=r-1,Math.floor(r/(n||1))>1},y=function(e,r){var i=v(e,r),a=[2,3,i?4:2,i?4:2,10,11,20][`oyYJ@!`.indexOf(e)+1],o=RegExp(`^-?\\d{1,`+a+`}`),s=n.substring(T).match(o);if(!s)throw(t.local.missingNumberAt||t.regionalOptions[``].missingNumberAt).replace(/\{0\}/,T);return T+=s[0].length,parseInt(s[0],10)},b=this,x=function(){if(typeof c==`function`){v(`m`);var e=c.call(b,n.substring(T));return T+=e.length,e}return y(`m`)},S=function(e,r,i,a){for(var o=v(e,a)?i:r,s=0;s<o.length;s++)if(n.substr(T,o[s].length).toLowerCase()===o[s].toLowerCase())return T+=o[s].length,s+b.minMonth;throw(t.local.unknownNameAt||t.regionalOptions[``].unknownNameAt).replace(/\{0\}/,T)},C=function(){if(typeof u==`function`){var e=v(`M`)?u.call(b,n.substring(T)):l.call(b,n.substring(T));return T+=e.length,e}return S(`M`,l,u)},w=function(){if(n.charAt(T)!==e.charAt(E))throw(t.local.unexpectedLiteralAt||t.regionalOptions[``].unexpectedLiteralAt).replace(/\{0\}/,T);T++},T=0,E=0;E<e.length;E++)if(_)e.charAt(E)===`'`&&!v(`'`)?_=!1:w();else switch(e.charAt(E)){case`d`:m=y(`d`);break;case`D`:S(`D`,a,o);break;case`o`:h=y(`o`);break;case`w`:y(`w`);break;case`m`:p=x();break;case`M`:p=C();break;case`y`:var D=E;g=!v(`y`,2),E=D,f=y(`y`,2);break;case`Y`:f=y(`Y`,2);break;case`J`:d=y(`J`)+.5,n.charAt(T)===`.`&&(T++,y(`J`));break;case`@`:d=y(`@`)/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case`!`:d=y(`!`)/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case`*`:T=n.length;break;case`'`:v(`'`)?w():_=!0;break;default:w()}if(T<n.length)throw t.local.unexpectedText||t.regionalOptions[``].unexpectedText;if(f===-1?f=this.today().year():f<100&&g&&(f+=i===-1?1900:this.today().year()-this.today().year()%100-(f<=i?0:100)),typeof p==`string`&&(p=s.call(this,f,p)),h>-1){p=1,m=h;for(var O=this.daysInMonth(f,p);m>O;O=this.daysInMonth(f,p))p++,m-=O}return d>-1?this.fromJD(d):this.newDate(f,p,m)},determineDate:function(e,t,n,r,i){n&&typeof n!=`object`&&(i=r,r=n,n=null),typeof r!=`string`&&(i=r,r=``);var a=this;return t=t?t.newDate():null,e=e==null?t:typeof e==`string`?function(e){try{return a.parseDate(r,e,i)}catch{}e=e.toLowerCase();for(var t=(e.match(/^c/)&&n?n.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(e);s;)t.add(parseInt(s[1],10),s[2]||`d`),s=o.exec(e);return t}(e):typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?t:a.today().add(e,`d`):a.newDate(e),e}})}),Bw=h(()=>{var e=Rw(),t=R_(),n=e.instance();function r(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}r.prototype=new e.baseCalendar,t(r.prototype,{name:`Chinese`,jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:`Chinese`,epochs:[`BEC`,`EC`],monthNumbers:function(e,t){if(typeof e==`string`){var n=e.match(a);return n?n[0]:``}var r=this._validateYear(e),i=e.month(),o=``+this.toChineseMonth(r,i);return t&&o.length<2&&(o=`0`+o),this.isIntercalaryMonth(r,i)&&(o+=`i`),o},monthNames:function(e){if(typeof e==`string`){var t=e.match(o);return t?t[0]:``}var n=this._validateYear(e),r=e.month(),i=[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`][this.toChineseMonth(n,r)-1];return this.isIntercalaryMonth(n,r)&&(i=`闰`+i),i},monthNamesShort:function(e){if(typeof e==`string`){var t=e.match(s);return t?t[0]:``}var n=this._validateYear(e),r=e.month(),i=[`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`,`十`,`十一`,`十二`][this.toChineseMonth(n,r)-1];return this.isIntercalaryMonth(n,r)&&(i=`闰`+i),i},parseMonth:function(e,t){e=this._validateYear(e);var n=parseInt(t),r;if(isNaN(n))t[0]===`闰`&&(r=!0,t=t.substring(1)),t[t.length-1]===`月`&&(t=t.substring(0,t.length-1)),n=1+[`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`,`十`,`十一`,`十二`].indexOf(t);else{var i=t[t.length-1];r=i===`i`||i===`I`}return this.toMonthIndex(e,n,r)},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(e,t){if(e.year&&(e=e.year()),typeof e!=`number`||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(t,n,r){var i=this.intercalaryMonth(t);if(r&&n!==i||n<1||n>12)throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);var a;return a=i?!r&&n<=i?n-1:n:n-1,a},toChineseMonth:function(t,n){t.year&&(t=t.year(),n=t.month());var r=this.intercalaryMonth(t);if(n<0||n>(r?12:11))throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);var i;return i=r?n<r?n+1:n:n+1,i},intercalaryMonth:function(e){return e=this._validateYear(e),c[e-c[0]]>>13},isIntercalaryMonth:function(e,t){e.year&&(e=e.year(),t=e.month());var n=this.intercalaryMonth(e);return!!n&&n===t},leapYear:function(e){return this.intercalaryMonth(e)!==0},weekOfYear:function(t,r,i){var a=l[this._validateYear(t,e.local.invalidyear)-l[0]],o=a>>9&4095,s=a>>5&15,c=a&31,u=n.newDate(o,s,c);u.add(4-(u.dayOfWeek()||7),`d`);var d=this.toJD(t,r,i)-u.toJD();return 1+Math.floor(d/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(t,n){t.year&&(n=t.month(),t=t.year()),t=this._validateYear(t);var r=c[t-c[0]],i=r>>13?12:11;if(n>i)throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-n?30:29},weekDay:function(e,t,n){return(this.dayOfWeek(e,t,n)||7)<6},toJD:function(t,r,i){var a=this._validate(t,s,i,e.local.invalidDate);t=this._validateYear(a.year()),r=a.month(),i=a.day();var o=this.isIntercalaryMonth(t,r),s=this.toChineseMonth(t,r),c=d(t,s,i,o);return n.toJD(c.year,c.month,c.day)},fromJD:function(e){var t=n.fromJD(e),r=u(t.year(),t.month(),t.day()),i=this.toMonthIndex(r.year,r.month,r.isIntercalary);return this.newDate(r.year,i,r.day)},fromString:function(e){var t=e.match(i),n=this._validateYear(+t[1]),r=+t[2],a=!!t[3],o=this.toMonthIndex(n,r,a),s=+t[4];return this.newDate(n,o,s)},add:function(e,t,n){var i=e.year(),a=e.month(),o=this.isIntercalaryMonth(i,a),s=this.toChineseMonth(i,a),c=Object.getPrototypeOf(r.prototype).add.call(this,e,t,n);if(n===`y`){var l=c.year(),u=c.month(),d=this.isIntercalaryMonth(l,s),f=o&&d?this.toMonthIndex(l,s,!0):this.toMonthIndex(l,s,!1);f!==u&&c.month(f)}return c}});var i=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,a=/^\d?\d[iI]?/m,o=/^闰?十?[一二三四五六七八九]?月/m,s=/^闰?十?[一二三四五六七八九]?/m;e.calendars.chinese=r;var c=[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],l=[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 u(e,t,n,r){var i,a;if(typeof e==`object`)i=e,a=t||{};else{if(!(typeof e==`number`&&e>=1888&&e<=2111))throw Error(`Solar year outside range 1888-2111`);if(!(typeof t==`number`&&t>=1&&t<=12))throw Error(`Solar month outside range 1 - 12`);if(!(typeof n==`number`&&n>=1&&n<=31))throw Error(`Solar day outside range 1 - 31`);i={year:e,month:t,day:n},a=r||{}}var o=l[i.year-l[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=l[a.year-l[0]];var u=o>>9&4095,d=o>>5&15,f=o&31,p,m=new Date(u,d-1,f),h=new Date(i.year,i.month-1,i.day);p=Math.round((h-m)/(24*3600*1e3));var g=c[a.year-c[0]],_;for(_=0;_<13;_++){var v=g&1<<12-_?30:29;if(p<v)break;p-=v}var y=g>>13;return!y||_<y?(a.isIntercalary=!1,a.month=1+_):_===y?(a.isIntercalary=!0,a.month=_):(a.isIntercalary=!1,a.month=_),a.day=1+p,a}function d(e,t,n,r,i){var a,o;if(typeof e==`object`)o=e,a=t||{};else{if(!(typeof e==`number`&&e>=1888&&e<=2111))throw Error(`Lunar year outside range 1888-2111`);if(!(typeof t==`number`&&t>=1&&t<=12))throw Error(`Lunar month outside range 1 - 12`);if(!(typeof n==`number`&&n>=1&&n<=30))throw Error(`Lunar day outside range 1 - 30`);var s;typeof r==`object`?(s=!1,a=r):(s=!!r,a=i||{}),o={year:e,month:t,day:n,isIntercalary:s}}for(var u=o.day-1,d=c[o.year-c[0]],f=d>>13,p=f&&(o.month>f||o.isIntercalary)?o.month:o.month-1,m=0;m<p;m++){var h=d&1<<12-m?30:29;u+=h}var g=l[o.year-l[0]],_=g>>9&4095,v=g>>5&15,y=g&31,b=new Date(_,v-1,y+u);return a.year=b.getFullYear(),a.month=1+b.getMonth(),a.day=b.getDate(),a}}),Vw=h(()=>{var e=Rw(),t=R_();function n(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}n.prototype=new e.baseCalendar,t(n.prototype,{name:`Coptic`,jdEpoch:1825029.5,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(t){var n=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),t=n.year()+(n.year()<0?1:0);return t%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[``].invalidYear),13},weekOfYear:function(e,t,n){var r=this.newDate(e,t,n);return r.add(-r.dayOfWeek(),`d`),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(t,n){var r=this._validate(t,n,this.minDay,e.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===13&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,n){return(this.dayOfWeek(e,t,n)||7)<6},toJD:function(t,n,r){var i=this._validate(t,n,r,e.local.invalidDate);return t=i.year(),t<0&&t++,i.day()+(i.month()-1)*30+(t-1)*365+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,n=Math.floor((t-Math.floor((t+366)/1461))/365)+1;n<=0&&n--,t=Math.floor(e)+.5-this.newDate(n,1,1).toJD();var r=Math.floor(t/30)+1,i=t-(r-1)*30+1;return this.newDate(n,r,i)}}),e.calendars.coptic=n}),Hw=h(()=>{var e=Rw(),t=R_();function n(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}n.prototype=new e.baseCalendar,t(n.prototype,{name:`Discworld`,jdEpoch:1721425.5,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(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),!1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),13},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),400},weekOfYear:function(e,t,n){var r=this.newDate(e,t,n);return r.add(-r.dayOfWeek(),`d`),Math.floor((r.dayOfYear()-1)/8)+1},daysInMonth:function(t,n){var r=this._validate(t,n,this.minDay,e.local.invalidMonth);return this.daysPerMonth[r.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,n,r){return(this._validate(t,n,r,e.local.invalidDate).day()+1)%8},weekDay:function(e,t,n){var r=this.dayOfWeek(e,t,n);return r>=2&&r<=6},extraInfo:function(t,n,i){var a=this._validate(t,n,i,e.local.invalidDate);return{century:r[Math.floor((a.year()-1)/100)+1]||``}},toJD:function(t,n,r){var i=this._validate(t,n,r,e.local.invalidDate);return t=i.year()+(i.year()<0?1:0),n=i.month(),r=i.day(),r+(n>1?16:0)+(n>2?(n-2)*32:0)+(t-1)*400+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=(t-1)*400,e+=e>15?16:0;var n=Math.floor(e/32)+1,r=e-(n-1)*32+1;return this.newDate(t<=0?t-1:t,n,r)}});var r={20:`Fruitbat`,21:`Anchovy`};e.calendars.discworld=n}),Uw=h(()=>{var e=Rw(),t=R_();function n(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}n.prototype=new e.baseCalendar,t(n.prototype,{name:`Ethiopian`,jdEpoch:1724220.5,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(t){var n=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),t=n.year()+(n.year()<0?1:0);return t%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[``].invalidYear),13},weekOfYear:function(e,t,n){var r=this.newDate(e,t,n);return r.add(-r.dayOfWeek(),`d`),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(t,n){var r=this._validate(t,n,this.minDay,e.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===13&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,n){return(this.dayOfWeek(e,t,n)||7)<6},toJD:function(t,n,r){var i=this._validate(t,n,r,e.local.invalidDate);return t=i.year(),t<0&&t++,i.day()+(i.month()-1)*30+(t-1)*365+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,n=Math.floor((t-Math.floor((t+366)/1461))/365)+1;n<=0&&n--,t=Math.floor(e)+.5-this.newDate(n,1,1).toJD();var r=Math.floor(t/30)+1,i=t-(r-1)*30+1;return this.newDate(n,r,i)}}),e.calendars.ethiopian=n}),Ww=h(()=>{var e=Rw(),t=R_();function n(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}n.prototype=new e.baseCalendar,t(n.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(t){var n=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return this._leapYear(n.year())},_leapYear:function(e){return e=e<0?e+1:e,r(e*7+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(e,t,n){var r=this.newDate(e,t,n);return r.add(-r.dayOfWeek(),`d`),Math.floor((r.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year(),this.toJD(t===-1?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,n){return t.year&&(n=t.month(),t=t.year()),this._validate(t,n,this.minDay,e.local.invalidMonth),n===12&&this.leapYear(t)||n===8&&r(this.daysInYear(t),10)===5?30:n===9&&r(this.daysInYear(t),10)===3?29:this.daysPerMonth[n-1]},weekDay:function(e,t,n){return this.dayOfWeek(e,t,n)!==6},extraInfo:function(t,n,r){var i=this._validate(t,n,r,e.local.invalidDate);return{yearType:(this.leapYear(i)?`embolismic`:`common`)+` `+[`deficient`,`regular`,`complete`][this.daysInYear(i)%10-3]}},toJD:function(t,n,r){var i=this._validate(t,n,r,e.local.invalidDate);t=i.year(),n=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(n<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(var s=1;s<n;s++)o+=this.daysInMonth(t,s)}else for(var s=7;s<n;s++)o+=this.daysInMonth(t,s);return o},_delay1:function(e){var t=Math.floor((235*e-234)/19),n=12084+13753*t,i=t*29+Math.floor(n/25920);return r(3*(i+1),7)<3&&i++,i},_delay2:function(e){var t=this._delay1(e-1),n=this._delay1(e);return this._delay1(e+1)-n===356?2:n-t===382?1:0},fromJD:function(e){e=Math.floor(e)+.5;for(var t=Math.floor((e-this.jdEpoch)*98496/35975351)-1;e>=this.toJD(t===-1?1:t+1,7,1);)t++;for(var n=e<this.toJD(t,1,1)?7:1;e>this.toJD(t,n,this.daysInMonth(t,n));)n++;var r=e-this.toJD(t,n,1)+1;return this.newDate(t,n,r)}});function r(e,t){return e-t*Math.floor(e/t)}e.calendars.hebrew=n}),Gw=h(()=>{var e=Rw(),t=R_();function n(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}n.prototype=new e.baseCalendar,t(n.prototype,{name:`Islamic`,jdEpoch:1948439.5,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(t){return(this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year()*11+14)%30<11},weekOfYear:function(e,t,n){var r=this.newDate(e,t,n);return r.add(-r.dayOfWeek(),`d`),Math.floor((r.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(t,n){var r=this._validate(t,n,this.minDay,e.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===12&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,n){return this.dayOfWeek(e,t,n)!==5},toJD:function(t,n,r){var i=this._validate(t,n,r,e.local.invalidDate);return t=i.year(),n=i.month(),r=i.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var n=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),r=e-this.toJD(t,n,1)+1;return this.newDate(t,n,r)}}),e.calendars.islamic=n}),Kw=h(()=>{var e=Rw(),t=R_();function n(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}n.prototype=new e.baseCalendar,t(n.prototype,{name:`Julian`,jdEpoch:1721423.5,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(t){var n=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),t=n.year()<0?n.year()+1:n.year();return t%4==0},weekOfYear:function(e,t,n){var r=this.newDate(e,t,n);return r.add(4-(r.dayOfWeek()||7),`d`),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(t,n){var r=this._validate(t,n,this.minDay,e.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===2&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,n){return(this.dayOfWeek(e,t,n)||7)<6},toJD:function(t,n,r){var i=this._validate(t,n,r,e.local.invalidDate);return t=i.year(),n=i.month(),r=i.day(),t<0&&t++,n<=2&&(t--,n+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(n+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,n=Math.floor((t-122.1)/365.25),r=Math.floor(365.25*n),i=Math.floor((t-r)/30.6001),a=i-Math.floor(i<14?1:13),o=n-Math.floor(a>2?4716:4715),s=t-r-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),e.calendars.julian=n}),qw=h(()=>{var e=Rw(),t=R_();function n(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}n.prototype=new e.baseCalendar,t(n.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(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year();var n=Math.floor(t/400);t%=400,t+=t<0?400:0;var r=Math.floor(t/20);return n+`.`+r+`.`+t%20},forYear:function(e){if(e=e.split(`.`),e.length<3)throw`Invalid Mayan year`;for(var t=0,n=0;n<e.length;n++){var r=parseInt(e[n],10);if(Math.abs(r)>19||n>0&&r<0)throw`Invalid Mayan year`;t=t*20+r}return t},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),18},weekOfYear:function(t,n,r){return this._validate(t,n,r,e.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),360},daysInMonth:function(t,n){return this._validate(t,n,this.minDay,e.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,n,r){return this._validate(t,n,r,e.local.invalidDate).day()},weekDay:function(t,n,r){return this._validate(t,n,r,e.local.invalidDate),!0},extraInfo:function(t,n,r){var i=this._validate(t,n,r,e.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){e-=this.jdEpoch;var t=r(e+8+340,365);return[Math.floor(t/20)+1,r(t,20)]},_toTzolkin:function(e){return e-=this.jdEpoch,[i(e+20,20),i(e+4,13)]},toJD:function(t,n,r){var i=this._validate(t,n,r,e.local.invalidDate);return i.day()+i.month()*20+i.year()*360+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var n=Math.floor(e/20),r=e%20;return this.newDate(t,n,r)}});function r(e,t){return e-t*Math.floor(e/t)}function i(e,t){return r(e-1,t)+1}e.calendars.mayan=n}),Jw=h(()=>{var e=Rw(),t=R_();function n(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}n.prototype=new e.baseCalendar;var r=e.instance(`gregorian`);t(n.prototype,{name:`Nanakshahi`,jdEpoch:2257673.5,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(t){var n=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[``].invalidYear);return r.leapYear(n.year()+(n.year()<1?1:0)+1469)},weekOfYear:function(e,t,n){var r=this.newDate(e,t,n);return r.add(1-(r.dayOfWeek()||7),`d`),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(t,n){var r=this._validate(t,n,this.minDay,e.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===12&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,n){return(this.dayOfWeek(e,t,n)||7)<6},toJD:function(t,n,i){var a=this._validate(t,n,i,e.local.invalidMonth),t=a.year();t<0&&t++;for(var o=a.day(),s=1;s<a.month();s++)o+=this.daysPerMonth[s-1];return o+r.toJD(t+1468,3,13)},fromJD:function(e){e=Math.floor(e+.5);for(var t=Math.floor((e-(this.jdEpoch-1))/366);e>=this.toJD(t+1,1,1);)t++;for(var n=e-Math.floor(this.toJD(t,1,1)+.5)+1,r=1;n>this.daysInMonth(t,r);)n-=this.daysInMonth(t,r),r++;return this.newDate(t,r,n)}}),e.calendars.nanakshahi=n}),Yw=h(()=>{var e=Rw(),t=R_();function n(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}n.prototype=new e.baseCalendar,t(n.prototype,{name:`Nepali`,jdEpoch:1700709.5,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(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,n){var r=this.newDate(e,t,n);return r.add(-r.dayOfWeek(),`d`),Math.floor((r.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year(),this.NEPALI_CALENDAR_DATA[t]===void 0)return this.daysPerYear;for(var n=0,r=this.minMonth;r<=12;r++)n+=this.NEPALI_CALENDAR_DATA[t][r];return n},daysInMonth:function(t,n){return t.year&&(n=t.month(),t=t.year()),this._validate(t,n,this.minDay,e.local.invalidMonth),this.NEPALI_CALENDAR_DATA[t]===void 0?this.daysPerMonth[n-1]:this.NEPALI_CALENDAR_DATA[t][n]},weekDay:function(e,t,n){return this.dayOfWeek(e,t,n)!==6},toJD:function(t,n,r){var i=this._validate(t,n,r,e.local.invalidDate);t=i.year(),n=i.month(),r=i.day();var a=e.instance(),o=0,s=n,c=t;this._createMissingCalendarData(t);var l=t-(s>9||s===9&&r>=this.NEPALI_CALENDAR_DATA[c][0]?56:57);for(n!==9&&(o=r,s--);s!==9;)s<=0&&(s=12,c--),o+=this.NEPALI_CALENDAR_DATA[c][s],s--;return n===9?(o+=r-this.NEPALI_CALENDAR_DATA[c][0],o<0&&(o+=a.daysInYear(l))):o+=this.NEPALI_CALENDAR_DATA[c][9]-this.NEPALI_CALENDAR_DATA[c][0],a.newDate(l,1,1).add(o,`d`).toJD()},fromJD:function(t){var n=e.instance().fromJD(t),r=n.year(),i=n.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],c=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>c;)o++,o>12&&(o=1,a++),c+=this.NEPALI_CALENDAR_DATA[a][o];var l=this.NEPALI_CALENDAR_DATA[a][o]-(c-i);return this.newDate(a,o,l)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var n=e-1;n<e+2;n++)this.NEPALI_CALENDAR_DATA[n]===void 0&&(this.NEPALI_CALENDAR_DATA[n]=t)},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]}}),e.calendars.nepali=n}),Xw=h(()=>{var e=Rw(),t=R_();function n(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}function r(e){var t=e-475;e<0&&t++;var n=.242197,r=n*t,i=n*(t+1);return r-Math.floor(r)>i-Math.floor(i)}n.prototype=new e.baseCalendar,t(n.prototype,{name:`Persian`,jdEpoch:1948320.5,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(t){return r(this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year())},weekOfYear:function(e,t,n){var r=this.newDate(e,t,n);return r.add(-((r.dayOfWeek()+1)%7),`d`),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(t,n){var r=this._validate(t,n,this.minDay,e.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===12&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,n){return this.dayOfWeek(e,t,n)!==5},toJD:function(t,n,i){var a=this._validate(t,n,i,e.local.invalidDate);t=a.year(),n=a.month(),i=a.day();var o=0;if(t>0)for(var s=1;s<t;s++)r(s)&&o++;else if(t<0)for(var s=t;s<0;s++)r(s)&&o--;return i+(n<=7?(n-1)*31:(n-1)*30+6)+(t>0?t-1:t)*365+o+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=475+(e-this.toJD(475,1,1))/365.242197,n=Math.floor(t);n<=0&&n--,e>this.toJD(n,12,r(n)?30:29)&&(n++,n===0&&n++);var i=e-this.toJD(n,1,1)+1,a=Math.ceil(i<=186?i/31:(i-6)/30),o=e-this.toJD(n,a,1)+1;return this.newDate(n,a,o)}}),e.calendars.persian=n,e.calendars.jalali=n}),Zw=h(()=>{var e=Rw(),t=R_(),n=e.instance();function r(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}r.prototype=new e.baseCalendar,t(r.prototype,{name:`Taiwan`,jdEpoch:2419402.5,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 r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),t=this._t2gYear(r.year());return n.leapYear(t)},weekOfYear:function(t,r,i){var a=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),t=this._t2gYear(a.year());return n.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,n){var r=this._validate(t,n,this.minDay,e.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===2&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,n){return(this.dayOfWeek(e,t,n)||7)<6},toJD:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidDate),t=this._t2gYear(a.year());return n.toJD(t,a.month(),a.day())},fromJD:function(e){var t=n.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),e.calendars.taiwan=r}),Qw=h(()=>{var e=Rw(),t=R_(),n=e.instance();function r(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}r.prototype=new e.baseCalendar,t(r.prototype,{name:`Thai`,jdEpoch:1523098.5,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 r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),t=this._t2gYear(r.year());return n.leapYear(t)},weekOfYear:function(t,r,i){var a=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),t=this._t2gYear(a.year());return n.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,n){var r=this._validate(t,n,this.minDay,e.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===2&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,n){return(this.dayOfWeek(e,t,n)||7)<6},toJD:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidDate),t=this._t2gYear(a.year());return n.toJD(t,a.month(),a.day())},fromJD:function(e){var t=n.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),e.calendars.thai=r}),$w=h(()=>{var e=Rw(),t=R_();function n(e){this.local=this.regionalOptions[e||``]||this.regionalOptions[``]}n.prototype=new e.baseCalendar,t(n.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(t){var n=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return this.daysInYear(n.year())===355},weekOfYear:function(e,t,n){var r=this.newDate(e,t,n);return r.add(-r.dayOfWeek(),`d`),Math.floor((r.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,n=1;n<=12;n++)t+=this.daysInMonth(e,n);return t},daysInMonth:function(t,n){for(var i=this._validate(t,n,this.minDay,e.local.invalidMonth).toJD()-24e5+.5,a=0,o=0;o<r.length;o++){if(r[o]>i)return r[a]-r[a-1];a++}return 30},weekDay:function(e,t,n){return this.dayOfWeek(e,t,n)!==5},toJD:function(t,n,i){var a=this._validate(t,n,i,e.local.invalidDate),o=12*(a.year()-1)+a.month()-15292;return a.day()+r[o-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,n=0,i=0;i<r.length&&!(r[i]>t);i++)n++;var a=n+15292,o=Math.floor((a-1)/12),s=o+1,c=a-12*o,l=t-r[n-1]+1;return this.newDate(s,c,l)},isValid:function(t,n,r){var i=e.baseCalendar.prototype.isValid.apply(this,arguments);return i&&=(t=t.year==null?t:t.year,t>=1276&&t<=1500),i},_validate:function(t,n,r,i){var a=e.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),e.calendars.ummalqura=n;var r=[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]}),eT=h((e,t)=>{t.exports=Rw(),zw(),Bw(),Vw(),Hw(),Uw(),Ww(),Gw(),Kw(),qw(),Jw(),Yw(),Xw(),Zw(),Qw(),$w()}),tT=h((e,t)=>{var n=eT(),r=$(),i=O(),a=i.EPOCHJD,o=i.ONEDAY,s={valType:`enumerated`,values:r.sortObjectKeys(n.calendars),editType:`calc`,dflt:`gregorian`},c=function(e,t,n,i){var a={};return a[n]=s,r.coerce(e,t,a,n,i)},l=function(e,t,n,r){for(var i=0;i<n.length;i++)c(e,t,n[i]+`calendar`,r.calendar)},u={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`},d={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`},f={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`]},p=`##`,m={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:p,w:p,c:{0:`D M d %X yyyy`,"-":`D M d %X yyyy`},x:{0:`mm/dd/yyyy`,"-":`mm/dd/yyyy`}};function h(e,t,n){for(var r=Math.floor((t+.05)/o)+a,i=_(n).fromJD(r),s=0,c,l,u,d,f;(s=e.indexOf(`%`,s))!==-1;)c=e.charAt(s+1),c===`0`||c===`-`||c===`_`?(u=3,l=e.charAt(s+2),c===`_`&&(c=`-`)):(l=c,c=`0`,u=2),d=m[l],d?(f=d===p?p:i.formatDate(d[c]),e=e.slice(0,s)+f+e.slice(s+u),s+=f.length):s+=u;return e}var g={};function _(e){var t=g[e];return t||(t=g[e]=n.instance(e),t)}function v(e){return r.extendFlat({},s,{description:e})}function y(e){return"Sets the calendar system to use with `"+e+"` date data."}var b={xcalendar:v(y(`x`))},x=r.extendFlat({},b,{ycalendar:v(y(`y`))}),S=r.extendFlat({},x,{zcalendar:v(y(`z`))}),C=v(["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(` `));t.exports={moduleType:`component`,name:`calendars`,schema:{traces:{scatter:x,bar:x,box:x,heatmap:x,contour:x,histogram:x,histogram2d:x,histogram2dcontour:x,scatter3d:S,surface:S,mesh3d:S,scattergl:x,ohlc:b,candlestick:b},layout:{calendar:v([`Sets the default calendar system to use for interpreting and`,`displaying dates throughout the plot.`].join(` `))},subplots:{xaxis:{calendar:C},yaxis:{calendar:C},scene:{xaxis:{calendar:C},yaxis:{calendar:C},zaxis:{calendar:C}},polar:{radialaxis:{calendar:C}}}},layoutAttributes:s,handleDefaults:c,handleTraceDefaults:l,CANONICAL_SUNDAY:d,CANONICAL_TICK:u,DFLTRANGE:f,getCal:_,worldCalFmt:h}}),nT=h((e,t)=>{t.exports=tT()});return h((e,t)=>{var n=Ka();n.register([co(),So(),qo(),ns(),cs(),Ms(),Is(),Xs(),cc(),Sc(),Ic(),Xu(),sd(),bm(),Lm(),Ym(),ah(),Ih(),Hh(),Zh(),ng(),sg(),pg(),vg(),Yg(),a_(),Hy(),ob(),Mb(),Bb(),ax(),dx(),bx(),Vx(),qx(),nS(),CS(),jS(),VS(),pC(),CC(),AC(),BC(),GC(),sw(),gw(),Tw(),Lw(),nT()]),t.exports=n})()})();return window.Plotly=e,e})}));export{t};