2 lines
No EOL
4.6 MiB
2 lines
No EOL
4.6 MiB
/*! For license information please see 1.9daa5160b7fc741623bf.js.LICENSE.txt */
|
||
(self.webpackChunkjupyterlab_plotly=self.webpackChunkjupyterlab_plotly||[]).push([[1],[,,(e,t,r)=>{"use strict";r.r(t),r.d(t,{MIME_TYPE:()=>He,RenderedPlotly:()=>Ge,default:()=>Ze,rendererFactory:()=>We});var n,i,a,o,s,l,c=r(3),u=Object.create,h=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,d=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),y=(e,t,r)=>(r=null!=e?u(d(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of p(t))!m.call(e,r)&&undefined!==r&&h(e,r,{get:()=>t[r],enumerable:!(n=f(t,r))||n.enumerable});return e})(!t&&e&&e.__esModule?r:h(r,"default",{value:e,enumerable:!0}),e)),v=g(((e,t)=>{var n,i;n=e,i=function(e){function t(e,t){let r=0;for(let n of e)if(!1===t(n,r++))return!1;return!0}var r;e.ArrayExt=void 0,function(e){function t(e,t,r=0,n=-1){let i,a=e.length;if(0===a)return-1;r=r<0?Math.max(0,r+a):Math.min(r,a-1),i=(n=n<0?Math.max(0,n+a):Math.min(n,a-1))<r?n+1+(a-r):n-r+1;for(let n=0;n<i;++n){let i=(r+n)%a;if(e[i]===t)return i}return-1}function r(e,t,r=-1,n=0){let i,a=e.length;if(0===a)return-1;i=(r=r<0?Math.max(0,r+a):Math.min(r,a-1))<(n=n<0?Math.max(0,n+a):Math.min(n,a-1))?r+1+(a-n):r-n+1;for(let n=0;n<i;++n){let i=(r-n+a)%a;if(e[i]===t)return i}return-1}function n(e,t,r=0,n=-1){let i,a=e.length;if(0===a)return-1;r=r<0?Math.max(0,r+a):Math.min(r,a-1),i=(n=n<0?Math.max(0,n+a):Math.min(n,a-1))<r?n+1+(a-r):n-r+1;for(let n=0;n<i;++n){let i=(r+n)%a;if(t(e[i],i))return i}return-1}function i(e,t,r=-1,n=0){let i,a=e.length;if(0===a)return-1;i=(r=r<0?Math.max(0,r+a):Math.min(r,a-1))<(n=n<0?Math.max(0,n+a):Math.min(n,a-1))?r+1+(a-n):r-n+1;for(let n=0;n<i;++n){let i=(r-n+a)%a;if(t(e[i],i))return i}return-1}function a(e,t=0,r=-1){let n=e.length;if(!(n<=1))for(t=t<0?Math.max(0,t+n):Math.min(t,n-1),r=r<0?Math.max(0,r+n):Math.min(r,n-1);t<r;){let n=e[t],i=e[r];e[t++]=i,e[r--]=n}}function o(e,t){let r=e.length;if(t<0&&(t+=r),t<0||t>=r)return;let n=e[t];for(let n=t+1;n<r;++n)e[n-1]=e[n];return e.length=r-1,n}e.firstIndexOf=t,e.lastIndexOf=r,e.findFirstIndex=n,e.findLastIndex=i,e.findFirstValue=function(e,t,r=0,i=-1){let a=n(e,t,r,i);return-1!==a?e[a]:void 0},e.findLastValue=function(e,t,r=-1,n=0){let a=i(e,t,r,n);return-1!==a?e[a]:void 0},e.lowerBound=function(e,t,r,n=0,i=-1){let a=e.length;if(0===a)return 0;let o=n=n<0?Math.max(0,n+a):Math.min(n,a-1),s=(i=i<0?Math.max(0,i+a):Math.min(i,a-1))-n+1;for(;s>0;){let n=s>>1,i=o+n;r(e[i],t)<0?(o=i+1,s-=n+1):s=n}return o},e.upperBound=function(e,t,r,n=0,i=-1){let a=e.length;if(0===a)return 0;let o=n=n<0?Math.max(0,n+a):Math.min(n,a-1),s=(i=i<0?Math.max(0,i+a):Math.min(i,a-1))-n+1;for(;s>0;){let n=s>>1,i=o+n;r(e[i],t)>0?s=n:(o=i+1,s-=n+1)}return o},e.shallowEqual=function(e,t,r){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;++n)if(r?!r(e[n],t[n]):e[n]!==t[n])return!1;return!0},e.slice=function(e,t={}){let{start:r,stop:n,step:i}=t;if(void 0===i&&(i=1),0===i)throw new Error("Slice `step` cannot be zero.");let a,o=e.length;void 0===r?r=i<0?o-1:0:r<0?r=Math.max(r+o,i<0?-1:0):r>=o&&(r=i<0?o-1:o),void 0===n?n=i<0?-1:o:n<0?n=Math.max(n+o,i<0?-1:0):n>=o&&(n=i<0?o-1:o),a=i<0&&n>=r||i>0&&r>=n?0:i<0?Math.floor((n-r+1)/i+1):Math.floor((n-r-1)/i+1);let s=[];for(let t=0;t<a;++t)s[t]=e[r+t*i];return s},e.move=function(e,t,r){let n=e.length;if(n<=1||(t=t<0?Math.max(0,t+n):Math.min(t,n-1))===(r=r<0?Math.max(0,r+n):Math.min(r,n-1)))return;let i=e[t],a=t<r?1:-1;for(let n=t;n!==r;n+=a)e[n]=e[n+a];e[r]=i},e.reverse=a,e.rotate=function(e,t,r=0,n=-1){let i=e.length;if(i<=1||(r=r<0?Math.max(0,r+i):Math.min(r,i-1))>=(n=n<0?Math.max(0,n+i):Math.min(n,i-1)))return;let o=n-r+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let s=r+t;a(e,r,s-1),a(e,s,n),a(e,r,n)},e.fill=function(e,t,r=0,n=-1){let i,a=e.length;if(0!==a){r=r<0?Math.max(0,r+a):Math.min(r,a-1),i=(n=n<0?Math.max(0,n+a):Math.min(n,a-1))<r?n+1+(a-r):n-r+1;for(let n=0;n<i;++n)e[(r+n)%a]=t}},e.insert=function(e,t,r){let n=e.length;t=t<0?Math.max(0,t+n):Math.min(t,n);for(let r=n;r>t;--r)e[r]=e[r-1];e[t]=r},e.removeAt=o,e.removeFirstOf=function(e,r,n=0,i=-1){let a=t(e,r,n,i);return-1!==a&&o(e,a),a},e.removeLastOf=function(e,t,n=-1,i=0){let a=r(e,t,n,i);return-1!==a&&o(e,a),a},e.removeAllOf=function(e,t,r=0,n=-1){let i=e.length;if(0===i)return 0;r=r<0?Math.max(0,r+i):Math.min(r,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);let a=0;for(let o=0;o<i;++o)r<=n&&o>=r&&o<=n&&e[o]===t||n<r&&(o<=n||o>=r)&&e[o]===t?a++:a>0&&(e[o-a]=e[o]);return a>0&&(e.length=i-a),a},e.removeFirstWhere=function(e,t,r=0,i=-1){let a,s=n(e,t,r,i);return-1!==s&&(a=o(e,s)),{index:s,value:a}},e.removeLastWhere=function(e,t,r=-1,n=0){let a,s=i(e,t,r,n);return-1!==s&&(a=o(e,s)),{index:s,value:a}},e.removeAllWhere=function(e,t,r=0,n=-1){let i=e.length;if(0===i)return 0;r=r<0?Math.max(0,r+i):Math.min(r,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);let a=0;for(let o=0;o<i;++o)r<=n&&o>=r&&o<=n&&t(e[o],o)||n<r&&(o<=n||o>=r)&&t(e[o],o)?a++:a>0&&(e[o-a]=e[o]);return a>0&&(e.length=i-a),a}}(e.ArrayExt||(e.ArrayExt={})),(r||(r={})).rangeLength=function(e,t,r){return 0===r?1/0:e>t&&r>0||e<t&&r<0?0:Math.ceil((t-e)/r)},e.StringExt=void 0,function(e){function t(e,t,r=0){let n=new Array(t.length);for(let i=0,a=r,o=t.length;i<o;++i,++a){if(a=e.indexOf(t[i],a),-1===a)return null;n[i]=a}return n}e.findIndices=t,e.matchSumOfSquares=function(e,r,n=0){let i=t(e,r,n);if(!i)return null;let a=0;for(let e=0,t=i.length;e<t;++e){let t=i[e]-n;a+=t*t}return{score:a,indices:i}},e.matchSumOfDeltas=function(e,r,n=0){let i=t(e,r,n);if(!i)return null;let a=0,o=n-1;for(let e=0,t=i.length;e<t;++e){let t=i[e];a+=t-o-1,o=t}return{score:a,indices:i}},e.highlight=function(e,t,r){let n=[],i=0,a=0,o=t.length;for(;i<o;){let s=t[i],l=t[i];for(;++i<o&&t[i]===l+1;)l++;a<s&&n.push(e.slice(a,s)),s<l+1&&n.push(r(e.slice(s,l+1))),a=l+1}return a<e.length&&n.push(e.slice(a)),n},e.cmp=function(e,t){return e<t?-1:e>t?1:0}}(e.StringExt||(e.StringExt={})),e.chain=function*(...e){for(let t of e)yield*t},e.each=function(e,t){let r=0;for(let n of e)if(!1===t(n,r++))return},e.empty=function*(){},e.enumerate=function*(e,t=0){for(let r of e)yield[t++,r]},e.every=t,e.filter=function*(e,t){let r=0;for(let n of e)t(n,r++)&&(yield n)},e.find=function(e,t){let r=0;for(let n of e)if(t(n,r++))return n},e.findIndex=function(e,t){let r=0;for(let n of e)if(t(n,r++))return r-1;return-1},e.map=function*(e,t){let r=0;for(let n of e)yield t(n,r++)},e.max=function(e,t){let r;for(let n of e)void 0!==r?t(n,r)>0&&(r=n):r=n;return r},e.min=function(e,t){let r;for(let n of e)void 0!==r?t(n,r)<0&&(r=n):r=n;return r},e.minmax=function(e,t){let r,n,i=!0;for(let a of e)i?(r=a,n=a,i=!1):t(a,r)<0?r=a:t(a,n)>0&&(n=a);return i?void 0:[r,n]},e.once=function*(e){yield e},e.range=function*(e,t,n){void 0===t?(t=e,e=0,n=1):void 0===n&&(n=1);let i=r.rangeLength(e,t,n);for(let t=0;t<i;t++)yield e+n*t},e.reduce=function(e,t,r){let n=e[Symbol.iterator](),i=0,a=n.next();if(a.done&&void 0===r)throw new TypeError("Reduce of empty iterable with no initial value.");if(a.done)return r;let o,s,l=n.next();if(l.done&&void 0===r)return a.value;if(l.done)return t(r,a.value,i++);for(o=t(void 0===r?a.value:t(r,a.value,i++),l.value,i++);!(s=n.next()).done;)o=t(o,s.value,i++);return o},e.repeat=function*(e,t){for(;0<t--;)yield e},e.retro=function*(e){if("function"==typeof e.retro)yield*e.retro();else for(let t=e.length-1;t>-1;t--)yield e[t]},e.some=function(e,t){let r=0;for(let n of e)if(t(n,r++))return!0;return!1},e.stride=function*(e,t){let r=0;for(let n of e)r++%t==0&&(yield n)},e.take=function*(e,t){if(t<1)return;let r,n=e[Symbol.iterator]();for(;0<t--&&!(r=n.next()).done;)yield r.value},e.toArray=function(e){return Array.from(e)},e.toObject=function(e){let t={};for(let[r,n]of e)t[r]=n;return t},e.topologicSort=function(e){let t=[],r=new Set,n=new Map;for(let t of e)i(t);for(let[e]of n)a(e);return t;function i(e){let[t,r]=e,i=n.get(r);i?i.push(t):n.set(r,[t])}function a(e){if(r.has(e))return;r.add(e);let i=n.get(e);if(i)for(let e of i)a(e);t.push(e)}},e.zip=function*(...e){let r=e.map((e=>e[Symbol.iterator]())),n=r.map((e=>e.next()));for(;t(n,(e=>!e.done));n=r.map((e=>e.next())))yield n.map((e=>e.value))}},"object"==typeof e&&typeof t<"u"?i(e):"function"==typeof define&&r.amdO?define(["exports"],i):i((n=typeof globalThis<"u"?globalThis:n||self).lumino_algorithm={})})),x=g(((e,t)=>{var n,i;n=e,i=function(e,t){var r;function n(e){let t=0;for(let r=0,n=e.length;r<n;++r)r%4==0&&(t=4294967295*Math.random()>>>0),e[r]=255&t,t>>>=8}e.JSONExt=void 0,function(e){function t(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e}function r(e){return Array.isArray(e)}e.emptyObject=Object.freeze({}),e.emptyArray=Object.freeze([]),e.isPrimitive=t,e.isArray=r,e.isObject=function(e){return!t(e)&&!r(e)},e.deepEqual=function e(n,i){if(n===i)return!0;if(t(n)||t(i))return!1;let a=r(n),o=r(i);return a===o&&(a&&o?function(t,r){if(t===r)return!0;if(t.length!==r.length)return!1;for(let n=0,i=t.length;n<i;++n)if(!e(t[n],r[n]))return!1;return!0}(n,i):function(t,r){if(t===r)return!0;for(let e in t)if(void 0!==t[e]&&!(e in r))return!1;for(let e in r)if(void 0!==r[e]&&!(e in t))return!1;for(let n in t){let i=t[n],a=r[n];if(!(void 0===i&&void 0===a||void 0!==i&&void 0!==a&&e(i,a)))return!1}return!0}(n,i))},e.deepCopy=function e(n){return t(n)?n:r(n)?function(t){let r=new Array(t.length);for(let n=0,i=t.length;n<i;++n)r[n]=e(t[n]);return r}(n):function(t){let r={};for(let n in t){let i=t[n];void 0!==i&&(r[n]=e(i))}return r}(n)}}(e.JSONExt||(e.JSONExt={})),function(e){class r{constructor(e){var t,r,n,i;this._activated=!1,this._promise=null,this._service=null,this.id=e.id,this.description=null!==(t=e.description)&&void 0!==t?t:"",this.activate=e.activate,this.deactivate=null!==(r=e.deactivate)&&void 0!==r?r:null,this.provides=null!==(n=e.provides)&&void 0!==n?n:null,this.autoStart=null!==(i=e.autoStart)&&void 0!==i&&i,this.requires=e.requires?e.requires.slice():[],this.optional=e.optional?e.optional.slice():[]}get activated(){return this._activated}set activated(e){this._activated=e}get service(){return this._service}set service(e){this._service=e}get promise(){return this._promise}set promise(e){this._promise=e}}e.createPluginData=function(e){return new r(e)},e.ensureNoCycle=function(e,t,r){let n=[...e.requires,...e.optional],i=n=>{if(n===e.provides)return!0;let o=r.get(n);if(!o)return!1;let s=t.get(o),l=[...s.requires,...s.optional];return 0!==l.length&&(a.push(o),!!l.some(i)||(a.pop(),!1))};if(!e.provides||0===n.length)return;let a=[e.id];if(n.some(i))throw new ReferenceError(`Cycle detected: ${a.join(" -> ")}.`)},e.findDependents=function(e,r,n){let i=new Array,a=e=>{let t=r.get(e),a=[...t.requires,...t.optional];i.push(...a.reduce(((t,r)=>{let i=n.get(r);return i&&t.push([e,i]),t}),[]))};for(let e of r.keys())a(e);let o=i.filter((t=>t[1]===e)),s=0;for(;o.length>s;){let e=o.length,t=new Set(o.map((e=>e[0])));for(let e of t)i.filter((t=>t[1]===e)).forEach((e=>{o.includes(e)||o.push(e)}));s=e}let l=t.topologicSort(o),c=l.findIndex((t=>t===e));return-1===c?[e]:l.slice(0,c+1)},e.collectStartupPlugins=function(e,t){let r=new Set;for(let t of e.keys())!0===e.get(t).autoStart&&r.add(t);if(t.startPlugins)for(let e of t.startPlugins)r.add(e);if(t.ignorePlugins)for(let e of t.ignorePlugins)r.delete(e);return Array.from(r)}}(r||(r={})),e.Random=void 0,(e.Random||(e.Random={})).getRandomValues=(()=>{let e=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return e&&"function"==typeof e.getRandomValues?function(t){return e.getRandomValues(t)}:n})(),e.UUID=void 0,(e.UUID||(e.UUID={})).uuid4=function(e){let t=new Uint8Array(16),r=new Array(256);for(let e=0;e<16;++e)r[e]="0"+e.toString(16);for(let e=16;e<256;++e)r[e]=e.toString(16);return function(){return e(t),t[6]=64|15&t[6],t[8]=128|63&t[8],r[t[0]]+r[t[1]]+r[t[2]]+r[t[3]]+"-"+r[t[4]]+r[t[5]]+"-"+r[t[6]]+r[t[7]]+"-"+r[t[8]]+r[t[9]]+"-"+r[t[10]]+r[t[11]]+r[t[12]]+r[t[13]]+r[t[14]]+r[t[15]]}}(e.Random.getRandomValues),e.MimeData=class{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(e){return-1!==this._types.indexOf(e)}getData(e){let t=this._types.indexOf(e);return-1!==t?this._values[t]:void 0}setData(e,t){this.clearData(e),this._types.push(e),this._values.push(t)}clearData(e){let t=this._types.indexOf(e);-1!==t&&(this._types.splice(t,1),this._values.splice(t,1))}clear(){this._types.length=0,this._values.length=0}},e.PluginRegistry=class{constructor(e={}){this._application=null,this._validatePlugin=()=>!0,this._plugins=new Map,this._services=new Map,e.validatePlugin&&(console.info("Plugins may be rejected by the custom validation plugin method."),this._validatePlugin=e.validatePlugin)}get application(){return this._application}set application(e){if(null!==this._application)throw Error("PluginRegistry.application is already set. It cannot be overridden.");this._application=e}get deferredPlugins(){return Array.from(this._plugins).filter((([e,t])=>"defer"===t.autoStart)).map((([e,t])=>e))}getPluginDescription(e){var t,r;return null!==(r=null===(t=this._plugins.get(e))||void 0===t?void 0:t.description)&&void 0!==r?r:""}hasPlugin(e){return this._plugins.has(e)}isPluginActivated(e){var t,r;return null!==(r=null===(t=this._plugins.get(e))||void 0===t?void 0:t.activated)&&void 0!==r&&r}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(e){if(this._plugins.has(e.id))throw new TypeError(`Plugin '${e.id}' is already registered.`);if(!this._validatePlugin(e))throw new Error(`Plugin '${e.id}' is not valid.`);let t=r.createPluginData(e);r.ensureNoCycle(t,this._plugins,this._services),t.provides&&this._services.set(t.provides,t.id),this._plugins.set(t.id,t)}registerPlugins(e){for(let t of e)this.registerPlugin(t)}deregisterPlugin(e,t){let r=this._plugins.get(e);if(r){if(r.activated&&!t)throw new Error(`Plugin '${e}' is still active.`);this._plugins.delete(e)}}async activatePlugin(e){let t=this._plugins.get(e);if(!t)throw new ReferenceError(`Plugin '${e}' is not registered.`);if(t.activated)return;if(t.promise)return t.promise;let r=t.requires.map((e=>this.resolveRequiredService(e))),n=t.optional.map((e=>this.resolveOptionalService(e)));return t.promise=Promise.all([...r,...n]).then((e=>t.activate.apply(void 0,[this.application,...e]))).then((e=>{t.service=e,t.activated=!0,t.promise=null})).catch((e=>{throw t.promise=null,e})),t.promise}async activatePlugins(e,t={}){switch(e){case"defer":{let e=this.deferredPlugins.filter((e=>this._plugins.get(e).autoStart)).map((e=>this.activatePlugin(e)));await Promise.all(e);break}case"startUp":{let e=r.collectStartupPlugins(this._plugins,t).map((async e=>{try{return await this.activatePlugin(e)}catch(t){console.error(`Plugin '${e}' failed to activate.`,t)}}));await Promise.all(e);break}}}async deactivatePlugin(e){let t=this._plugins.get(e);if(!t)throw new ReferenceError(`Plugin '${e}' is not registered.`);if(!t.activated)return[];if(!t.deactivate)throw new TypeError(`Plugin '${e}'#deactivate() method missing`);let n=r.findDependents(e,this._plugins,this._services),i=n.map((e=>this._plugins.get(e)));for(let t of i)if(!t.deactivate)throw new TypeError(`Plugin ${t.id}#deactivate() method missing (depends on ${e})`);for(let e of i){let t=[...e.requires,...e.optional].map((e=>{let t=this._services.get(e);return t?this._plugins.get(t).service:null}));await e.deactivate(this.application,...t),e.service=null,e.activated=!1}return n.pop(),n}async resolveRequiredService(e){let t=this._services.get(e);if(!t)throw new TypeError(`No provider for: ${e.name}.`);let r=this._plugins.get(t);return r.activated||await this.activatePlugin(t),r.service}async resolveOptionalService(e){let t=this._services.get(e);if(!t)return null;let r=this._plugins.get(t);if(!r.activated)try{await this.activatePlugin(t)}catch(e){return console.error(e),null}return r.service}},e.PromiseDelegate=class{constructor(){this.promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}resolve(e){(0,this._resolve)(e)}reject(e){(0,this._reject)(e)}},e.Token=class{constructor(e,t){this.name=e,this.description=t??"",this._tokenStructuralPropertyT=null}}},"object"==typeof e&&typeof t<"u"?i(e,v()):"function"==typeof define&&r.amdO?define(["exports","@lumino/algorithm"],i):i((n=typeof globalThis<"u"?globalThis:n||self).lumino_coreutils={},n.lumino_algorithm)})),_=g(((e,t)=>{var r,n;r=typeof self<"u"?self:e,n=()=>{var e=(()=>{var e=Object.create,t=Object.defineProperty,r=Object.defineProperties,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,h=(e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,f=(e,t)=>{for(var r in t||(t={}))l.call(t,r)&&h(e,r,t[r]);if(o)for(var r of o(t))u.call(t,r)&&h(e,r,t[r]);return e},p=(e,t)=>r(e,i(t)),d=(e,t)=>function(){return e&&(t=(0,e[a(e)[0]])(e=0)),t},m=(e,t)=>function(){return t||(0,e[a(e)[0]])((t={exports:{}}).exports,t),t.exports},g=(e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})},y=(e,r,i,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let s of a(r))!l.call(e,s)&&s!==i&&t(e,s,{get:()=>r[s],enumerable:!(o=n(r,s))||o.enumerable});return e},v=e=>y(t({},"__esModule",{value:!0}),e),x=m({"src/version.js"(e){e.version="3.5.0"}}),_=m({"node_modules/native-promise-only/lib/npo.src.js"(e,t){var r,n;r="Promise",(n=typeof window<"u"?window:e)[r]=n[r]||function(){var e,t,r,n=Object.prototype.toString,i=typeof setImmediate<"u"?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},"x",{}),e=function(e,t,r,n){return Object.defineProperty(e,t,{value:r,writable:!0,configurable:!1!==n})}}catch{e=function(e,t,r){return e[t]=r,e}}function a(e,n){r.add(e,n),t||(t=i(r.drain))}function o(e){var t,r=typeof e;return null!=e&&("object"==r||"function"==r)&&(t=e.then),"function"==typeof t&&t}function s(){for(var e=0;e<this.chain.length;e++)l(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function l(e,t,r){var n,i;try{!1===t?r.reject(e.msg):(n=!0===t?e.msg:t.call(void 0,e.msg))===r.promise?r.reject(TypeError("Promise-chain cycle")):(i=o(n))?i.call(n,r.resolve,r.reject):r.resolve(n)}catch(e){r.reject(e)}}function c(e){var t,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(t=o(e))?a((function(){var n=new f(r);try{t.call(e,(function(){c.apply(n,arguments)}),(function(){u.apply(n,arguments)}))}catch(e){u.call(n,e)}})):(r.msg=e,r.state=1,r.chain.length>0&&a(s,r))}catch(e){u.call(new f(r),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 h(e,t,r,n){for(var i=0;i<t.length;i++)!function(i){e.resolve(t[i]).then((function(e){r(i,e)}),n)}(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 d(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var t=new p(this);this.then=function(e,r){var n={success:"function"!=typeof e||e,failure:"function"==typeof r&&r};return n.promise=new this.constructor((function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");n.resolve=e,n.reject=t})),t.chain.push(n),0!==t.state&&a(s,t),n.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,(function(e){c.call(t,e)}),(function(e){u.call(t,e)}))}catch(e){u.call(t,e)}}r=function(){var e,r,n;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,a){n=new i(t,a),r?r.next=n:e=n,r=n,n=void 0},drain:function(){var n=e;for(e=r=t=void 0;n;)n.fn.call(n.self),n=n.next}}}();var m=e({},"constructor",d,!1);return d.prototype=m,e(m,"__NPO__",0,!1),e(d,"resolve",(function(e){return e&&"object"==typeof e&&1===e.__NPO__?e:new this((function(t,r){if("function"!=typeof t||"function"!=typeof r)throw TypeError("Not a function");t(e)}))})),e(d,"reject",(function(e){return new this((function(t,r){if("function"!=typeof t||"function"!=typeof r)throw TypeError("Not a function");r(e)}))})),e(d,"all",(function(e){var t=this;return"[object Array]"!=n.call(e)?t.reject(TypeError("Not an array")):0===e.length?t.resolve([]):new t((function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");var i=e.length,a=Array(i),o=0;h(t,e,(function(e,t){a[e]=t,++o===i&&r(a)}),n)}))})),e(d,"race",(function(e){var t=this;return"[object Array]"!=n.call(e)?t.reject(TypeError("Not an array")):new t((function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");h(t,e,(function(e,t){r(t)}),n)}))})),d}(),typeof t<"u"&&t.exports&&(t.exports=n[r])}}),b=m({"node_modules/@plotly/d3/d3.js"(e,t){(function(){var e={version:"3.8.2"},r=[].slice,n=function(e){return r.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{n(i.documentElement.childNodes)[0].nodeType}catch{n=function(e){for(var t=e.length,r=new Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),i)try{i.createElement("DIV").style.setProperty("opacity",0,"")}catch{var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,h=u.setProperty;s.setAttribute=function(e,t){l.call(this,e,t+"")},s.setAttributeNS=function(e,t,r){c.call(this,e,t,r+"")},u.setProperty=function(e,t,r){h.call(this,e,t+"",r)}}function f(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function p(e){return null===e?NaN:+e}function d(e){return!isNaN(e)}function m(e){return{left:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}e.ascending=f,e.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},e.min=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=e[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=e[i])&&r>n&&(r=n)}else{for(;++i<a;)if(null!=(n=t.call(e,e[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=t.call(e,e[i],i))&&r>n&&(r=n)}return r},e.max=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=e[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=e[i])&&n>r&&(r=n)}else{for(;++i<a;)if(null!=(n=t.call(e,e[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=t.call(e,e[i],i))&&n>r&&(r=n)}return r},e.extent=function(e,t){var r,n,i,a=-1,o=e.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=e[a])&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=e[a])&&(r>n&&(r=n),i<n&&(i=n))}else{for(;++a<o;)if(null!=(n=t.call(e,e[a],a))&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=t.call(e,e[a],a))&&(r>n&&(r=n),i<n&&(i=n))}return[r,i]},e.sum=function(e,t){var r,n=0,i=e.length,a=-1;if(1===arguments.length)for(;++a<i;)d(r=+e[a])&&(n+=r);else for(;++a<i;)d(r=+t.call(e,e[a],a))&&(n+=r);return n},e.mean=function(e,t){var r,n=0,i=e.length,a=-1,o=i;if(1===arguments.length)for(;++a<i;)d(r=p(e[a]))?n+=r:--o;else for(;++a<i;)d(r=p(t.call(e,e[a],a)))?n+=r:--o;if(o)return n/o},e.quantile=function(e,t){var r=(e.length-1)*t+1,n=Math.floor(r),i=+e[n-1],a=r-n;return a?i+a*(e[n]-i):i},e.median=function(t,r){var n,i=[],a=t.length,o=-1;if(1===arguments.length)for(;++o<a;)d(n=p(t[o]))&&i.push(n);else for(;++o<a;)d(n=p(r.call(t,t[o],o)))&&i.push(n);if(i.length)return e.quantile(i.sort(f),.5)},e.variance=function(e,t){var r,n,i=e.length,a=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<i;)d(r=p(e[s]))&&(o+=(n=r-a)*(r-(a+=n/++l)));else for(;++s<i;)d(r=p(t.call(e,e[s],s)))&&(o+=(n=r-a)*(r-(a+=n/++l)));if(l>1)return o/(l-1)},e.deviation=function(){var t=e.variance.apply(this,arguments);return t&&Math.sqrt(t)};var g=m(f);function y(e){return e.length}e.bisectLeft=g.left,e.bisect=e.bisectRight=g.right,e.bisector=function(e){return m(1===e.length?function(t,r){return f(e(t),r)}:e)},e.shuffle=function(e,t,r){(a=arguments.length)<3&&(r=e.length,a<2&&(t=0));for(var n,i,a=r-t;a;)i=Math.random()*a--|0,n=e[a+t],e[a+t]=e[i+t],e[i+t]=n;return e},e.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},e.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],i=new Array(r<0?0:r);t<r;)i[t]=[n,n=e[++t]];return i},e.transpose=function(t){if(!(a=t.length))return[];for(var r=-1,n=e.min(t,y),i=new Array(n);++r<n;)for(var a,o=-1,s=i[r]=new Array(a);++o<a;)s[o]=t[o][r];return i},e.zip=function(){return e.transpose(arguments)},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t},e.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},e.entries=function(e){var t=[];for(var r in e)t.push({key:r,value:e[r]});return t},e.merge=function(e){for(var t,r,n,i=e.length,a=-1,o=0;++a<i;)o+=e[a].length;for(r=new Array(o);--i>=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r};var v=Math.abs;function x(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function _(){this._=Object.create(null)}function b(e){return"__proto__"==(e+="")||"\0"===e[0]?"\0"+e:e}function w(e){return"\0"===(e+="")[0]?e.slice(1):e}function T(e){return b(e)in this._}function k(e){return(e=b(e))in this._&&delete this._[e]}function A(){var e=[];for(var t in this._)e.push(w(t));return e}function M(){var e=0;for(var t in this._)++e;return e}function S(){for(var e in this._)return!1;return!0}function E(){this._=Object.create(null)}function C(e){return e}function I(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}function L(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var r=0,n=P.length;r<n;++r){var i=P[r]+t;if(i in e)return i}}e.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r==1/0)throw new Error("infinite range");var n,i=[],a=function(e){for(var t=1;e*t%1;)t*=10;return t}(v(r)),o=-1;if(e*=a,t*=a,(r*=a)<0)for(;(n=e+r*++o)>t;)i.push(n/a);else for(;(n=e+r*++o)<t;)i.push(n/a);return i},e.map=function(e,t){var r=new _;if(e instanceof _)e.forEach((function(e,t){r.set(e,t)}));else if(Array.isArray(e)){var n,i=-1,a=e.length;if(1===arguments.length)for(;++i<a;)r.set(i,e[i]);else for(;++i<a;)r.set(t.call(e,n=e[i],i),n)}else for(var o in e)r.set(o,e[o]);return r},x(_,{has:T,get:function(e){return this._[b(e)]},set:function(e,t){return this._[b(e)]=t},remove:k,keys:A,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:w(t),value:this._[t]});return e},size:M,empty:S,forEach:function(e){for(var t in this._)e.call(this,w(t),this._[t])}}),e.nest=function(){var t,r,n={},i=[],a=[];function o(e,a,s){if(s>=i.length)return r?r.call(n,a):t?a.sort(t):a;for(var l,c,u,h,f=-1,p=a.length,d=i[s++],m=new _;++f<p;)(h=m.get(l=d(c=a[f])))?h.push(c):m.set(l,[c]);return e?(c=e(),u=function(t,r){c.set(t,o(e,r,s))}):(c={},u=function(t,r){c[t]=o(e,r,s)}),m.forEach(u),c}function s(e,t){if(t>=i.length)return e;var r=[],n=a[t++];return e.forEach((function(e,n){r.push({key:e,values:s(n,t)})})),n?r.sort((function(e,t){return n(e.key,t.key)})):r}return n.map=function(e,t){return o(t,e,0)},n.entries=function(t){return s(o(e.map,t,0),0)},n.key=function(e){return i.push(e),n},n.sortKeys=function(e){return a[i.length-1]=e,n},n.sortValues=function(e){return t=e,n},n.rollup=function(e){return r=e,n},n},e.set=function(e){var t=new E;if(e)for(var r=0,n=e.length;r<n;++r)t.add(e[r]);return t},x(E,{has:T,add:function(e){return this._[b(e+="")]=!0,e},remove:k,values:A,size:M,empty:S,forEach:function(e){for(var t in this._)e.call(this,w(t))}}),e.behavior={},e.rebind=function(e,t){for(var r,n=1,i=arguments.length;++n<i;)e[r=arguments[n]]=I(e,t,t[r]);return e};var P=["webkit","ms","moz","Moz","o","O"];function z(){}function D(){}function O(e){var t=[],r=new _;function n(){for(var r,n=t,i=-1,a=n.length;++i<a;)(r=n[i].on)&&r.apply(this,arguments);return e}return n.on=function(n,i){var a,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,t=t.slice(0,a=t.indexOf(o)).concat(t.slice(a+1)),r.remove(n)),i&&t.push(r.set(n,{on:i})),e)},n}function R(){e.event.preventDefault()}function F(){for(var t,r=e.event;t=r.sourceEvent;)r=t;return r}function B(t){for(var r=new D,n=0,i=arguments.length;++n<i;)r[arguments[n]]=O(r);return r.of=function(n,i){return function(a){try{var o=a.sourceEvent=e.event;a.target=t,e.event=a,r[a.type].apply(n,i)}finally{e.event=o}}},r}e.dispatch=function(){for(var e=new D,t=-1,r=arguments.length;++t<r;)e[arguments[t]]=O(e);return e},D.prototype.on=function(e,t){var r=e.indexOf("."),n="";if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},e.event=null,e.requote=function(e){return e.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,N={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function U(e){return N(e,G),e}var V=function(e,t){return t.querySelector(e)},q=function(e,t){return t.querySelectorAll(e)},H=function(e,t){var r=e.matches||e[L(e,"matchesSelector")];return(H=function(e,t){return r.call(e,t)})(e,t)};"function"==typeof Sizzle&&(V=function(e,t){return Sizzle(e,t)[0]||null},q=Sizzle,H=Sizzle.matchesSelector),e.selection=function(){return e.select(i.documentElement)};var G=e.selection.prototype=[];function W(e){return"function"==typeof e?e:function(){return V(e,this)}}function Z(e){return"function"==typeof e?e:function(){return q(e,this)}}G.select=function(e){var t,r,n,i,a=[];e=W(e);for(var o=-1,s=this.length;++o<s;){a.push(t=[]),t.parentNode=(n=this[o]).parentNode;for(var l=-1,c=n.length;++l<c;)(i=n[l])?(t.push(r=e.call(i,i.__data__,l,o)),r&&"__data__"in i&&(r.__data__=i.__data__)):t.push(null)}return U(a)},G.selectAll=function(e){var t,r,i=[];e=Z(e);for(var a=-1,o=this.length;++a<o;)for(var s=this[a],l=-1,c=s.length;++l<c;)(r=s[l])&&(i.push(t=n(e.call(r,r.__data__,l,a))),t.parentNode=r);return U(i)};var Y="http://www.w3.org/1999/xhtml",X={svg:"http://www.w3.org/2000/svg",xhtml:Y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $(t,r){return t=e.ns.qualify(t),null==r?t.local?function(){this.removeAttributeNS(t.space,t.local)}:function(){this.removeAttribute(t)}:"function"==typeof r?t.local?function(){var e=r.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}:function(){var e=r.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}:t.local?function(){this.setAttributeNS(t.space,t.local,r)}:function(){this.setAttribute(t,r)}}function K(e){return e.trim().replace(/\s+/g," ")}function J(t){return new RegExp("(?:^|\\s+)"+e.requote(t)+"(?:\\s+|$)","g")}function Q(e){return(e+"").trim().split(/^|\s+/)}function ee(e,t){var r=(e=Q(e).map(te)).length;return"function"==typeof t?function(){for(var n=-1,i=t.apply(this,arguments);++n<r;)e[n](this,i)}:function(){for(var n=-1;++n<r;)e[n](this,t)}}function te(e){var t=J(e);return function(r,n){if(i=r.classList)return n?i.add(e):i.remove(e);var i=r.getAttribute("class")||"";n?(t.lastIndex=0,t.test(i)||r.setAttribute("class",K(i+" "+e))):r.setAttribute("class",K(i.replace(t," ")))}}function re(e,t,r){return null==t?function(){this.style.removeProperty(e)}:"function"==typeof t?function(){var n=t.apply(this,arguments);null==n?this.style.removeProperty(e):this.style.setProperty(e,n,r)}:function(){this.style.setProperty(e,t,r)}}function ne(e,t){return null==t?function(){delete this[e]}:"function"==typeof t?function(){var r=t.apply(this,arguments);null==r?delete this[e]:this[e]=r}:function(){this[e]=t}}function ie(t){return"function"==typeof t?t:(t=e.ns.qualify(t)).local?function(){return this.ownerDocument.createElementNS(t.space,t.local)}:function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Y&&e.documentElement.namespaceURI===Y?e.createElement(t):e.createElementNS(r,t)}}function ae(){var e=this.parentNode;e&&e.removeChild(this)}function oe(e){return{__data__:e}}function se(e){return function(){return H(this,e)}}function le(e){return arguments.length||(e=f),function(t,r){return t&&r?e(t.__data__,r.__data__):!t-!r}}function ce(e,t){for(var r=0,n=e.length;r<n;r++)for(var i,a=e[r],o=0,s=a.length;o<s;o++)(i=a[o])&&t(i,o,r);return e}function ue(e){return N(e,he),e}e.ns={prefix:X,qualify:function(e){var t=e.indexOf(":"),r=e;return t>=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),X.hasOwnProperty(r)?{space:X[r],local:e}:e}},G.attr=function(t,r){if(arguments.length<2){if("string"==typeof t){var n=this.node();return(t=e.ns.qualify(t)).local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(r in t)this.each($(r,t[r]));return this}return this.each($(t,r))},G.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var r=this.node(),n=(e=Q(e)).length,i=-1;if(t=r.classList){for(;++i<n;)if(!t.contains(e[i]))return!1}else for(t=r.getAttribute("class");++i<n;)if(!J(e[i]).test(t))return!1;return!0}for(t in e)this.each(ee(t,e[t]));return this}return this.each(ee(e,t))},G.style=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=""),e)this.each(re(r,e[r],t));return this}if(n<2){var i=this.node();return o(i).getComputedStyle(i,null).getPropertyValue(e)}r=""}return this.each(re(e,t,r))},G.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(ne(t,e[t]));return this}return this.each(ne(e,t))},G.text=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.textContent=t??""}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},G.html=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=t??""}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},G.append=function(e){return e=ie(e),this.select((function(){return this.appendChild(e.apply(this,arguments))}))},G.insert=function(e,t){return e=ie(e),t=W(t),this.select((function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)}))},G.remove=function(){return this.each(ae)},G.data=function(e,t){var r,n,i=-1,a=this.length;if(!arguments.length){for(e=new Array(a=(r=this[0]).length);++i<a;)(n=r[i])&&(e[i]=n.__data__);return e}function o(e,r){var n,i,a,o=e.length,u=r.length,h=Math.min(o,u),f=new Array(u),p=new Array(u),d=new Array(o);if(t){var m,g=new _,y=new Array(o);for(n=-1;++n<o;)(i=e[n])&&(g.has(m=t.call(i,i.__data__,n))?d[n]=i:g.set(m,i),y[n]=m);for(n=-1;++n<u;)(i=g.get(m=t.call(r,a=r[n],n)))?!0!==i&&(f[n]=i,i.__data__=a):p[n]=oe(a),g.set(m,!0);for(n=-1;++n<o;)n in y&&!0!==g.get(y[n])&&(d[n]=e[n])}else{for(n=-1;++n<h;)i=e[n],a=r[n],i?(i.__data__=a,f[n]=i):p[n]=oe(a);for(;n<u;++n)p[n]=oe(r[n]);for(;n<o;++n)d[n]=e[n]}p.update=f,p.parentNode=f.parentNode=d.parentNode=e.parentNode,s.push(p),l.push(f),c.push(d)}var s=ue([]),l=U([]),c=U([]);if("function"==typeof e)for(;++i<a;)o(r=this[i],e.call(r,r.parentNode.__data__,i));else for(;++i<a;)o(r=this[i],e);return l.enter=function(){return s},l.exit=function(){return c},l},G.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},G.filter=function(e){var t,r,n,i=[];"function"!=typeof e&&(e=se(e));for(var a=0,o=this.length;a<o;a++){i.push(t=[]),t.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&e.call(n,n.__data__,s,a)&&t.push(n)}return U(i)},G.order=function(){for(var e=-1,t=this.length;++e<t;)for(var r,n=this[e],i=n.length-1,a=n[i];--i>=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},G.sort=function(e){e=le.apply(this,arguments);for(var t=-1,r=this.length;++t<r;)this[t].sort(e);return this.order()},G.each=function(e){return ce(this,(function(t,r,n){e.call(t,t.__data__,r,n)}))},G.call=function(e){var t=n(arguments);return e.apply(t[0]=this,t),this},G.empty=function(){return!this.node()},G.node=function(){for(var e=0,t=this.length;e<t;e++)for(var r=this[e],n=0,i=r.length;n<i;n++){var a=r[n];if(a)return a}return null},G.size=function(){var e=0;return ce(this,(function(){++e})),e};var he=[];function fe(t,r,i){var a="__on"+t,o=t.indexOf("."),s=de;o>0&&(t=t.slice(0,o));var l=pe.get(t);function c(){var e=this[a];e&&(this.removeEventListener(t,e,e.$),delete this[a])}return l&&(t=l,s=me),o?r?function(){var e=s(r,n(arguments));c.call(this),this.addEventListener(t,this[a]=e,e.$=i),e._=r}:c:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+e.requote(t)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}e.selection.enter=ue,e.selection.enter.prototype=he,he.append=G.append,he.empty=G.empty,he.node=G.node,he.call=G.call,he.size=G.size,he.select=function(e){for(var t,r,n,i,a,o=[],s=-1,l=this.length;++s<l;){n=(i=this[s]).update,o.push(t=[]),t.parentNode=i.parentNode;for(var c=-1,u=i.length;++c<u;)(a=i[c])?(t.push(n[c]=r=e.call(i.parentNode,a.__data__,c,s)),r.__data__=a.__data__):t.push(null)}return U(o)},he.insert=function(e,t){return arguments.length<2&&(t=function(e){var t,r;return function(n,i,a){var o,s=e[a].update,l=s.length;for(a!=r&&(r=a,t=0),i>=t&&(t=i+1);!(o=s[t])&&++t<l;);return o}}(this)),G.insert.call(this,e,t)},e.select=function(e){var t;return"string"==typeof e?(t=[V(e,i)]).parentNode=i.documentElement:(t=[e]).parentNode=a(e),U([t])},e.selectAll=function(e){var t;return"string"==typeof e?(t=n(q(e,i))).parentNode=i.documentElement:(t=n(e)).parentNode=null,U([t])},G.on=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=!1),e)this.each(fe(r,e[r],t));return this}if(n<2)return(n=this.node()["__on"+e])&&n._;r=!1}return this.each(fe(e,t,r))};var pe=e.map({mouseenter:"mouseover",mouseleave:"mouseout"});function de(t,r){return function(n){var i=e.event;e.event=n,r[0]=this.__data__;try{t.apply(this,r)}finally{e.event=i}}}function me(e,t){var r=de(e,t);return function(e){var t=this,n=e.relatedTarget;(!n||n!==t&&!(8&n.compareDocumentPosition(t)))&&r.call(t,e)}}i&&pe.forEach((function(e){"on"+e in i&&pe.remove(e)}));var ge,ye=0;function ve(t){var r=".dragsuppress-"+ ++ye,n="click"+r,i=e.select(o(t)).on("touchmove"+r,R).on("dragstart"+r,R).on("selectstart"+r,R);if(null==ge&&(ge=!("onselectstart"in t)&&L(t.style,"userSelect")),ge){var s=a(t).style,l=s[ge];s[ge]="none"}return function(e){if(i.on(r,null),ge&&(s[ge]=l),e){var t=function(){i.on(n,null)};i.on(n,(function(){R(),t()}),!0),setTimeout(t,0)}}}e.mouse=function(e){return _e(e,F())};var xe=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function _e(t,r){r.changedTouches&&(r=r.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(xe<0){var a=o(t);if(a.scrollX||a.scrollY){var s=(n=e.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();xe=!(s.f||s.e),n.remove()}}return xe?(i.x=r.pageX,i.y=r.pageY):(i.x=r.clientX,i.y=r.clientY),[(i=i.matrixTransform(t.getScreenCTM().inverse())).x,i.y]}var l=t.getBoundingClientRect();return[r.clientX-l.left-t.clientLeft,r.clientY-l.top-t.clientTop]}function be(){return e.event.changedTouches[0].identifier}e.touch=function(e,t,r){if(arguments.length<3&&(r=t,t=F().changedTouches),t)for(var n,i=0,a=t.length;i<a;++i)if((n=t[i]).identifier===r)return _e(e,n)},e.behavior.drag=function(){var t=B(a,"drag","dragstart","dragend"),r=null,n=s(z,e.mouse,o,"mousemove","mouseup"),i=s(be,e.touch,C,"touchmove","touchend");function a(){this.on("mousedown.drag",n).on("touchstart.drag",i)}function s(n,i,a,o,s){return function(){var l,c=this,u=e.event.target.correspondingElement||e.event.target,h=c.parentNode,f=t.of(c,arguments),p=0,d=n(),m=".drag"+(null==d?"":"-"+d),g=e.select(a(u)).on(o+m,(function(){var e,t,r=i(h,d);r&&(e=r[0]-v[0],t=r[1]-v[1],p|=e|t,v=r,f({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:e,dy:t}))})).on(s+m,(function(){i(h,d)&&(g.on(o+m,null).on(s+m,null),y(p),f({type:"dragend"}))})),y=ve(u),v=i(h,d);l=r?[(l=r.apply(c,arguments)).x-v[0],l.y-v[1]]:[0,0],f({type:"dragstart"})}}return a.origin=function(e){return arguments.length?(r=e,a):r},e.rebind(a,t,"on")},e.touches=function(e,t){return arguments.length<2&&(t=F().touches),t?n(t).map((function(t){var r=_e(e,t);return r.identifier=t.identifier,r})):[]};var we=1e-6,Te=Math.PI,ke=2*Te,Ae=ke-we,Me=Te/2,Se=Te/180,Ee=180/Te;function Ce(e,t,r){return(t[0]-e[0])*(r[1]-e[1])-(t[1]-e[1])*(r[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}var Pe=Math.SQRT2;e.interpolateZoom=function(e,t){var r,n,i=e[0],a=e[1],o=e[2],s=t[0],l=t[1],c=t[2],u=s-i,h=l-a,f=u*u+h*h;if(f<1e-12)n=Math.log(c/o)/Pe,r=function(e){return[i+e*u,a+e*h,o*Math.exp(Pe*e*n)]};else{var p=Math.sqrt(f),d=(c*c-o*o+4*f)/(2*o*2*p),m=(c*c-o*o-4*f)/(2*c*2*p),g=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(m*m+1)-m);n=(y-g)/Pe,r=function(e){var t=e*n,r=Le(g),s=o/(2*p)*(r*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(Pe*t+g)-function(e){return((e=Math.exp(e))-1/e)/2}(g));return[i+s*u,a+s*h,o*r/Le(Pe*t+g)]}}return r.duration=1e3*n,r},e.behavior.zoom=function(){var t,r,n,a,s,l,c,u,h,f={x:0,y:0,k:1},p=[960,500],d=Oe,m=250,g=0,y="mousedown.zoom",v="mousemove.zoom",x="mouseup.zoom",_="touchstart.zoom",b=B(w,"zoomstart","zoom","zoomend");function w(e){e.on(y,L).on(De+".zoom",z).on("dblclick.zoom",D).on(_,P)}function T(e){return[(e[0]-f.x)/f.k,(e[1]-f.y)/f.k]}function k(e){f.k=Math.max(d[0],Math.min(d[1],e))}function A(e,t){t=function(e){return[e[0]*f.k+f.x,e[1]*f.k+f.y]}(t),f.x+=e[0]-t[0],f.y+=e[1]-t[1]}function M(t,n,i,a){t.__chart__={x:f.x,y:f.y,k:f.k},k(Math.pow(2,a)),A(r=n,i),t=e.select(t),m>0&&(t=t.transition().duration(m)),t.call(w.event)}function S(){c&&c.domain(l.range().map((function(e){return(e-f.x)/f.k})).map(l.invert)),h&&h.domain(u.range().map((function(e){return(e-f.y)/f.k})).map(u.invert))}function E(e){g++||e({type:"zoomstart"})}function C(e){S(),e({type:"zoom",scale:f.k,translate:[f.x,f.y]})}function I(e){--g||(e({type:"zoomend"}),r=null)}function L(){var t=this,r=b.of(t,arguments),n=0,i=e.select(o(t)).on(v,(function(){n=1,A(e.mouse(t),a),C(r)})).on(x,(function(){i.on(v,null).on(x,null),s(n),I(r)})),a=T(e.mouse(t)),s=ve(t);Wi.call(t),E(r)}function P(){var t,r=this,n=b.of(r,arguments),i={},a=0,o=".zoom-"+e.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],h=e.select(r),p=ve(r);function d(){var n=e.touches(r);return t=f.k,n.forEach((function(e){e.identifier in i&&(i[e.identifier]=T(e))})),n}function m(){var t=e.event.target;e.select(t).on(l,g).on(c,v),u.push(t);for(var n=e.event.changedTouches,o=0,h=n.length;o<h;++o)i[n[o].identifier]=null;var p=d(),m=Date.now();if(1===p.length){if(m-s<500){var y=p[0];M(r,y,i[y.identifier],Math.floor(Math.log(f.k)/Math.LN2)+1),R()}s=m}else if(p.length>1){y=p[0];var x=p[1],_=y[0]-x[0],b=y[1]-x[1];a=_*_+b*b}}function g(){var o,l,c,u,h=e.touches(r);Wi.call(r);for(var f=0,p=h.length;f<p;++f,u=null)if(c=h[f],u=i[c.identifier]){if(l)break;o=c,l=u}if(u){var d=(d=c[0]-o[0])*d+(d=c[1]-o[1])*d,m=a&&Math.sqrt(d/a);o=[(o[0]+c[0])/2,(o[1]+c[1])/2],l=[(l[0]+u[0])/2,(l[1]+u[1])/2],k(m*t)}s=null,A(o,l),C(n)}function v(){if(e.event.touches.length){for(var t=e.event.changedTouches,r=0,a=t.length;r<a;++r)delete i[t[r].identifier];for(var s in i)return void d()}e.selectAll(u).on(o,null),h.on(y,L).on(_,P),p(),I(n)}m(),E(n),h.on(y,null).on(_,m)}function z(){var i=b.of(this,arguments);a?clearTimeout(a):(Wi.call(this),t=T(r=n||e.mouse(this)),E(i)),a=setTimeout((function(){a=null,I(i)}),50),R(),k(Math.pow(2,.002*ze())*f.k),A(r,t),C(i)}function D(){var t=e.mouse(this),r=Math.log(f.k)/Math.LN2;M(this,t,T(t),e.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return De||(De="onwheel"in i?(ze=function(){return-e.event.deltaY*(e.event.deltaMode?120:1)},"wheel"):"onmousewheel"in i?(ze=function(){return e.event.wheelDelta},"mousewheel"):(ze=function(){return-e.event.detail},"MozMousePixelScroll")),w.event=function(t){t.each((function(){var t=b.of(this,arguments),n=f;Xi?e.select(this).transition().each("start.zoom",(function(){f=this.__chart__||{x:0,y:0,k:1},E(t)})).tween("zoom:zoom",(function(){var i=p[0],a=p[1],o=r?r[0]:i/2,s=r?r[1]:a/2,l=e.interpolateZoom([(o-f.x)/f.k,(s-f.y)/f.k,i/f.k],[(o-n.x)/n.k,(s-n.y)/n.k,i/n.k]);return function(e){var r=l(e),n=i/r[2];this.__chart__=f={x:o-r[0]*n,y:s-r[1]*n,k:n},C(t)}})).each("interrupt.zoom",(function(){I(t)})).each("end.zoom",(function(){I(t)})):(this.__chart__=f,E(t),C(t),I(t))}))},w.translate=function(e){return arguments.length?(f={x:+e[0],y:+e[1],k:f.k},S(),w):[f.x,f.y]},w.scale=function(e){return arguments.length?(f={x:f.x,y:f.y,k:null},k(+e),S(),w):f.k},w.scaleExtent=function(e){return arguments.length?(d=null==e?Oe:[+e[0],+e[1]],w):d},w.center=function(e){return arguments.length?(n=e&&[+e[0],+e[1]],w):n},w.size=function(e){return arguments.length?(p=e&&[+e[0],+e[1]],w):p},w.duration=function(e){return arguments.length?(m=+e,w):m},w.x=function(e){return arguments.length?(c=e,l=e.copy(),f={x:0,y:0,k:1},w):c},w.y=function(e){return arguments.length?(h=e,u=e.copy(),f={x:0,y:0,k:1},w):h},e.rebind(w,b,"on")};var ze,De,Oe=[0,1/0];function Re(){}function Fe(e,t,r){return this instanceof Fe?(this.h=+e,this.s=+t,void(this.l=+r)):arguments.length<2?e instanceof Fe?new Fe(e.h,e.s,e.l):it(""+e,at,Fe):new Fe(e,t,r)}e.color=Re,Re.prototype.toString=function(){return this.rgb()+""},e.hsl=Fe;var Be=Fe.prototype=new Re;function je(e,t,r){var n,i;function a(e){return Math.round(255*function(e){return e>360?e-=360:e<0&&(e+=360),e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+t):r+t-r*t),new Qe(a(e+120),a(e),a(e-120))}function Ne(t,r,n){return this instanceof Ne?(this.h=+t,this.c=+r,void(this.l=+n)):arguments.length<2?t instanceof Ne?new Ne(t.h,t.c,t.l):function(e,t,r){return e>0?new Ne(Math.atan2(r,t)*Ee,Math.sqrt(t*t+r*r),e):new Ne(NaN,NaN,e)}(t instanceof qe?t.l:(t=ot((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Ne(t,r,n)}Be.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Fe(this.h,this.s,this.l/e)},Be.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Fe(this.h,this.s,e*this.l)},Be.rgb=function(){return je(this.h,this.s,this.l)},e.hcl=Ne;var Ue=Ne.prototype=new Re;function Ve(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new qe(r,Math.cos(e*=Se)*t,Math.sin(e)*t)}function qe(e,t,r){return this instanceof qe?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof qe?new qe(e.l,e.a,e.b):e instanceof Ne?Ve(e.h,e.c,e.l):ot((e=Qe(e)).r,e.g,e.b):new qe(e,t,r)}Ue.brighter=function(e){return new Ne(this.h,this.c,Math.min(100,this.l+He*(arguments.length?e:1)))},Ue.darker=function(e){return new Ne(this.h,this.c,Math.max(0,this.l-He*(arguments.length?e:1)))},Ue.rgb=function(){return Ve(this.h,this.c,this.l).rgb()},e.lab=qe;var He=18,Ge=.95047,We=1,Ze=1.08883,Ye=qe.prototype=new Re;function Xe(e,t,r){var n=(e+16)/116,i=n+t/500,a=n-r/200;return new Qe(Je(3.2404542*(i=$e(i)*Ge)-1.5371385*(n=$e(n)*We)-.4985314*(a=$e(a)*Ze)),Je(-.969266*i+1.8760108*n+.041556*a),Je(.0556434*i-.2040259*n+1.0572252*a))}function $e(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function Ke(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function Je(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function Qe(e,t,r){return this instanceof Qe?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof Qe?new Qe(e.r,e.g,e.b):it(""+e,Qe,je):new Qe(e,t,r)}function et(e){return new Qe(e>>16,e>>8&255,255&e)}function tt(e){return et(e)+""}Ye.brighter=function(e){return new qe(Math.min(100,this.l+He*(arguments.length?e:1)),this.a,this.b)},Ye.darker=function(e){return new qe(Math.max(0,this.l-He*(arguments.length?e:1)),this.a,this.b)},Ye.rgb=function(){return Xe(this.l,this.a,this.b)},e.rgb=Qe;var rt=Qe.prototype=new Re;function nt(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function it(e,t,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(lt(i[0]),lt(i[1]),lt(i[2]))}return(a=ct.get(e))?t(a.r,a.g,a.b):(null!=e&&"#"===e.charAt(0)&&!isNaN(a=parseInt(e.slice(1),16))&&(4===e.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===e.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),t(o,s,l))}function at(e,t,r){var n,i,a=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=e==o?(t-r)/s+(t<r?6:0):t==o?(r-e)/s+2:(e-t)/s+4,n*=60):(n=NaN,i=l>0&&l<1?0:n),new Fe(n,i,l)}function ot(e,t,r){var n=Ke((.4124564*(e=st(e))+.3575761*(t=st(t))+.1804375*(r=st(r)))/Ge),i=Ke((.2126729*e+.7151522*t+.072175*r)/We);return qe(116*i-16,500*(n-i),200*(i-Ke((.0193339*e+.119192*t+.9503041*r)/Ze)))}function st(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function lt(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}rt.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,i=30;return t||r||n?(t&&t<i&&(t=i),r&&r<i&&(r=i),n&&n<i&&(n=i),new Qe(Math.min(255,t/e),Math.min(255,r/e),Math.min(255,n/e))):new Qe(i,i,i)},rt.darker=function(e){return new Qe((e=Math.pow(.7,arguments.length?e:1))*this.r,e*this.g,e*this.b)},rt.hsl=function(){return at(this.r,this.g,this.b)},rt.toString=function(){return"#"+nt(this.r)+nt(this.g)+nt(this.b)};var ct=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});function ut(e){return"function"==typeof e?e:function(){return e}}function ht(e){return function(t,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),ft(t,r,e,n)}}function ft(t,r,i,a){var o={},s=e.dispatch("beforesend","progress","load","error"),l={},c=new XMLHttpRequest,u=null;function h(){var e,t=c.status;if(!t&&function(e){var t=e.responseType;return t&&"text"!==t?e.response:e.responseText}(c)||t>=200&&t<300||304===t){try{e=i.call(o,c)}catch(e){return void s.error.call(o,e)}s.load.call(o,e)}else s.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(t)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=h:c.onreadystatechange=function(){c.readyState>3&&h()},c.onprogress=function(t){var r=e.event;e.event=t;try{s.progress.call(o,c)}finally{e.event=r}},o.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?l[e]:(null==t?delete l[e]:l[e]=t+"",o)},o.mimeType=function(e){return arguments.length?(r=null==e?null:e+"",o):r},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(n(arguments)))}})),o.send=function(e,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),c.open(e,t,!0),null!=r&&!("accept"in l)&&(l.accept=r+",*/*"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on("error",i).on("load",(function(e){i(null,e)})),s.beforesend.call(o,c),c.send(n??null),o},o.abort=function(){return c.abort(),o},e.rebind(o,s,"on"),null==a?o:o.get(function(e){return 1===e.length?function(t,r){e(null==t?r:null)}:e}(a))}ct.forEach((function(e,t){ct.set(e,et(t))})),e.functor=ut,e.xhr=ht(C),e.dsv=function(e,t){var r=new RegExp('["'+e+"\n]"),n=e.charCodeAt(0);function i(e,r,n){arguments.length<3&&(n=r,r=null);var i=ft(e,t,null==r?a:o(r),n);return i.row=function(e){return arguments.length?i.response(null==(r=e)?a:o(e)):r},i}function a(e){return i.parse(e.responseText)}function o(e){return function(t){return i.parse(t.responseText,e)}}function s(t){return t.map(l).join(e)}function l(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return i.parse=function(e,t){var r;return i.parseRows(e,(function(e,n){if(r)return r(e,n-1);var i=function(t){for(var r={},n=e.length,i=0;i<n;++i)r[e[i]]=t[i];return r};r=t?function(e,r){return t(i(e),r)}:i}))},i.parseRows=function(e,t){var r,i,a={},o={},s=[],l=e.length,c=0,u=0;function h(){if(c>=l)return o;if(i)return i=!1,a;var t=c;if(34===e.charCodeAt(t)){for(var r=t;r++<l;)if(34===e.charCodeAt(r)){if(34!==e.charCodeAt(r+1))break;++r}return c=r+2,13===(s=e.charCodeAt(r+1))?(i=!0,10===e.charCodeAt(r+2)&&++c):10===s&&(i=!0),e.slice(t+1,r).replace(/""/g,'"')}for(;c<l;){var s,u=1;if(10===(s=e.charCodeAt(c++)))i=!0;else if(13===s)i=!0,10===e.charCodeAt(c)&&(++c,++u);else if(s!==n)continue;return e.slice(t,c-u)}return e.slice(t)}for(;(r=h())!==o;){for(var f=[];r!==a&&r!==o;)f.push(r),r=h();t&&null==(f=t(f,u++))||s.push(f)}return s},i.format=function(t){if(Array.isArray(t[0]))return i.formatRows(t);var r=new E,n=[];return t.forEach((function(e){for(var t in e)r.has(t)||n.push(r.add(t))})),[n.map(l).join(e)].concat(t.map((function(t){return n.map((function(e){return l(t[e])})).join(e)}))).join("\n")},i.formatRows=function(e){return e.map(s).join("\n")},i},e.csv=e.dsv(",","text/csv"),e.tsv=e.dsv("\t","text/tab-separated-values");var pt,dt,mt,gt,yt=this[L(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};function vt(e,t,r){var n=arguments.length;n<2&&(t=0),n<3&&(r=Date.now());var i={c:e,t:r+t,n:null};return dt?dt.n=i:pt=i,dt=i,mt||(gt=clearTimeout(gt),mt=1,yt(xt)),i}function xt(){var e=_t(),t=bt()-e;t>24?(isFinite(t)&&(clearTimeout(gt),gt=setTimeout(xt,t)),mt=0):(mt=1,yt(xt))}function _t(){for(var e=Date.now(),t=pt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function bt(){for(var e,t=pt,r=1/0;t;)t.c?(t.t<r&&(r=t.t),t=(e=t).n):t=e?e.n=t.n:pt=t.n;return dt=e,r}function wt(e){return e[0]}function Tt(e){return e[1]}function kt(e){for(var t=e.length,r=[0,1],n=2,i=2;i<t;i++){for(;n>1&&Ce(e[r[n-2]],e[r[n-1]],e[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function At(e,t){return e[0]-t[0]||e[1]-t[1]}e.timer=function(){vt.apply(this,arguments)},e.timer.flush=function(){_t(),bt()},e.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},e.geom={},e.geom.hull=function(e){var t=wt,r=Tt;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,i=ut(t),a=ut(r),o=e.length,s=[],l=[];for(n=0;n<o;n++)s.push([+i.call(this,e[n],n),+a.call(this,e[n],n),n]);for(s.sort(At),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var c=kt(s),u=kt(l),h=u[0]===c[0],f=u[u.length-1]===c[c.length-1],p=[];for(n=c.length-1;n>=0;--n)p.push(e[s[c[n]][2]]);for(n=+h;n<u.length-f;++n)p.push(e[s[u[n]][2]]);return p}return n.x=function(e){return arguments.length?(t=e,n):t},n.y=function(e){return arguments.length?(r=e,n):r},n},e.geom.polygon=function(e){return N(e,Mt),e};var Mt=e.geom.polygon.prototype=[];function St(e,t,r){return(r[0]-t[0])*(e[1]-t[1])<(r[1]-t[1])*(e[0]-t[0])}function Et(e,t,r,n){var i=e[0],a=r[0],o=t[0]-i,s=n[0]-a,l=e[1],c=r[1],u=t[1]-l,h=n[1]-c,f=(s*(l-c)-h*(i-a))/(h*o-s*u);return[i+f*o,l+f*u]}function Ct(e){var t=e[0],r=e[e.length-1];return!(t[0]-r[0]||t[1]-r[1])}Mt.area=function(){for(var e,t=-1,r=this.length,n=this[r-1],i=0;++t<r;)e=n,n=this[t],i+=e[1]*n[0]-e[0]*n[1];return.5*i},Mt.centroid=function(e){var t,r,n=-1,i=this.length,a=0,o=0,s=this[i-1];for(arguments.length||(e=-1/(6*this.area()));++n<i;)t=s,s=this[n],r=t[0]*s[1]-s[0]*t[1],a+=(t[0]+s[0])*r,o+=(t[1]+s[1])*r;return[a*e,o*e]},Mt.clip=function(e){for(var t,r,n,i,a,o,s=Ct(e),l=-1,c=this.length-Ct(this),u=this[c-1];++l<c;){for(t=e.slice(),e.length=0,i=this[l],a=t[(n=t.length-s)-1],r=-1;++r<n;)St(o=t[r],u,i)?(St(a,u,i)||e.push(Et(a,o,u,i)),e.push(o)):St(a,u,i)&&e.push(Et(a,o,u,i)),a=o;s&&e.push(e[0]),u=i}return e};var It,Lt,Pt,zt,Dt,Ot=[],Rt=[];function Ft(){rr(this),this.edge=this.site=this.circle=null}function Bt(e){var t=Ot.pop()||new Ft;return t.site=e,t}function jt(e){Yt(e),Pt.remove(e),Ot.push(e),rr(e)}function Nt(e){var t=e.circle,r=t.x,n=t.cy,i={x:r,y:n},a=e.P,o=e.N,s=[e];jt(e);for(var l=a;l.circle&&v(r-l.circle.x)<we&&v(n-l.circle.cy)<we;)a=l.P,s.unshift(l),jt(l),l=a;s.unshift(l),Yt(l);for(var c=o;c.circle&&v(r-c.circle.x)<we&&v(n-c.circle.cy)<we;)o=c.N,s.push(c),jt(c),c=o;s.push(c),Yt(c);var u,h=s.length;for(u=1;u<h;++u)c=s[u],l=s[u-1],Qt(c.edge,l.site,c.site,i);l=s[0],(c=s[h-1]).edge=Kt(l.site,c.site,null,i),Zt(l),Zt(c)}function Ut(e){for(var t,r,n,i,a=e.x,o=e.y,s=Pt._;s;)if((n=Vt(s,o)-a)>we)s=s.L;else{if(!((i=a-qt(s,o))>we)){n>-we?(t=s.P,r=s):i>-we?(t=s,r=s.N):t=r=s;break}if(!s.R){t=s;break}s=s.R}var l=Bt(e);if(Pt.insert(t,l),t||r){if(t===r)return Yt(t),r=Bt(t.site),Pt.insert(l,r),l.edge=r.edge=Kt(t.site,l.site),Zt(t),void Zt(r);if(!r)return void(l.edge=Kt(t.site,l.site));Yt(t),Yt(r);var c=t.site,u=c.x,h=c.y,f=e.x-u,p=e.y-h,d=r.site,m=d.x-u,g=d.y-h,y=2*(f*g-p*m),v=f*f+p*p,x=m*m+g*g,_={x:(g*v-p*x)/y+u,y:(f*x-m*v)/y+h};Qt(r.edge,c,d,_),l.edge=Kt(c,e,null,_),r.edge=Kt(e,d,null,_),Zt(t),Zt(r)}}function Vt(e,t){var r=e.site,n=r.x,i=r.y,a=i-t;if(!a)return n;var o=e.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-t;if(!c)return s;var u=s-n,h=1/a-1/c,f=u/c;return h?(-f+Math.sqrt(f*f-2*h*(u*u/(-2*c)-l+c/2+i-a/2)))/h+n:(n+s)/2}function qt(e,t){var r=e.N;if(r)return Vt(r,t);var n=e.site;return n.y===t?n.x:1/0}function Ht(e){this.site=e,this.edges=[]}function Gt(e,t){return t.angle-e.angle}function Wt(){rr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Zt(e){var t=e.P,r=e.N;if(t&&r){var n=t.site,i=e.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,c=n.y-s,u=a.x-o,h=2*(l*(g=a.y-s)-c*u);if(!(h>=-1e-12)){var f=l*l+c*c,p=u*u+g*g,d=(g*f-c*p)/h,m=(l*p-u*f)/h,g=m+s,y=Rt.pop()||new Wt;y.arc=e,y.site=i,y.x=d+o,y.y=g+Math.sqrt(d*d+m*m),y.cy=g,e.circle=y;for(var v=null,x=Dt._;x;)if(y.y<x.y||y.y===x.y&&y.x<=x.x){if(!x.L){v=x.P;break}x=x.L}else{if(!x.R){v=x;break}x=x.R}Dt.insert(v,y),v||(zt=y)}}}}function Yt(e){var t=e.circle;t&&(t.P||(zt=t.N),Dt.remove(t),Rt.push(t),rr(t),e.circle=null)}function Xt(e,t){var r=e.b;if(r)return!0;var n,i,a=e.a,o=t[0][0],s=t[1][0],l=t[0][1],c=t[1][1],u=e.l,h=e.r,f=u.x,p=u.y,d=h.x,m=h.y,g=(f+d)/2,y=(p+m)/2;if(m===p){if(g<o||g>=s)return;if(f>d){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y<l)return}else a={x:g,y:c};r={x:g,y:l}}}else if(i=y-(n=(f-d)/(m-p))*g,n<-1||n>1)if(f>d){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y<l)return}else a={x:(c-i)/n,y:c};r={x:(l-i)/n,y:l}}else if(p<m){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x<o)return}else a={x:s,y:n*s+i};r={x:o,y:n*o+i}}return e.a=a,e.b=r,!0}function $t(e,t){this.l=e,this.r=t,this.a=this.b=null}function Kt(e,t,r,n){var i=new $t(e,t);return It.push(i),r&&Qt(i,e,t,r),n&&Qt(i,t,e,n),Lt[e.i].edges.push(new er(i,e,t)),Lt[t.i].edges.push(new er(i,t,e)),i}function Jt(e,t,r){var n=new $t(e,null);return n.a=t,n.b=r,It.push(n),n}function Qt(e,t,r,n){e.a||e.b?e.l===r?e.b=n:e.a=n:(e.a=n,e.l=t,e.r=r)}function er(e,t,r){var n=e.a,i=e.b;this.edge=e,this.site=t,this.angle=r?Math.atan2(r.y-t.y,r.x-t.x):e.l===t?Math.atan2(i.x-n.x,n.y-i.y):Math.atan2(n.x-i.x,i.y-n.y)}function tr(){this._=null}function rr(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function nr(e,t){var r=t,n=t.R,i=r.U;i?i.L===r?i.L=n:i.R=n:e._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function ir(e,t){var r=t,n=t.L,i=r.U;i?i.L===r?i.L=n:i.R=n:e._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function ar(e){for(;e.L;)e=e.L;return e}function or(e,t){var r,n,i,a=e.sort(sr).pop();for(It=[],Lt=new Array(e.length),Pt=new tr,Dt=new tr;;)if(i=zt,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))(a.x!==r||a.y!==n)&&(Lt[a.i]=new Ht(a),Ut(a),r=a.x,n=a.y),a=e.pop();else{if(!i)break;Nt(i.arc)}t&&(function(e){for(var t,r=It,n=function(e,t,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,c=o.y,u=0,h=1,f=s.x-l,p=s.y-c;if(a=e-l,f||!(a>0)){if(a/=f,f<0){if(a<u)return;a<h&&(h=a)}else if(f>0){if(a>h)return;a>u&&(u=a)}if(a=r-l,f||!(a<0)){if(a/=f,f<0){if(a>h)return;a>u&&(u=a)}else if(f>0){if(a<u)return;a<h&&(h=a)}if(a=t-c,p||!(a>0)){if(a/=p,p<0){if(a<u)return;a<h&&(h=a)}else if(p>0){if(a>h)return;a>u&&(u=a)}if(a=n-c,p||!(a<0)){if(a/=p,p<0){if(a>h)return;a>u&&(u=a)}else if(p>0){if(a<u)return;a<h&&(h=a)}return u>0&&(i.a={x:l+u*f,y:c+u*p}),h<1&&(i.b={x:l+h*f,y:c+h*p}),i}}}}}}(e[0][0],e[0][1],e[1][0],e[1][1]),i=r.length;i--;)(!Xt(t=r[i],e)||!n(t)||v(t.a.x-t.b.x)<we&&v(t.a.y-t.b.y)<we)&&(t.a=t.b=null,r.splice(i,1))}(t),function(e){for(var t,r,n,i,a,o,s,l,c,u,h=e[0][0],f=e[1][0],p=e[0][1],d=e[1][1],m=Lt,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;o<l;)n=(u=s[o].end()).x,i=u.y,t=(c=s[++o%l].start()).x,r=c.y,(v(n-t)>we||v(i-r)>we)&&(s.splice(o,0,new er(Jt(a.site,u,v(n-h)<we&&d-i>we?{x:h,y:v(t-h)<we?r:d}:v(i-d)<we&&f-n>we?{x:v(r-d)<we?t:f,y:d}:v(n-f)<we&&i-p>we?{x:f,y:v(t-f)<we?r:p}:v(i-p)<we&&n-h>we?{x:v(r-p)<we?t:h,y:p}:null),a.site,null)),++l)}(t));var o={cells:Lt,edges:It};return Pt=Dt=It=Lt=null,o}function sr(e,t){return t.y-e.y||t.x-e.x}Ht.prototype.prepare=function(){for(var e,t=this.edges,r=t.length;r--;)(!(e=t[r].edge).b||!e.a)&&t.splice(r,1);return t.sort(Gt),t.length},er.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}},tr.prototype={insert:function(e,t){var r,n,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;r=e}else this._?(e=ar(this._),t.P=null,t.N=e,e.P=e.L=t,r=e):(t.P=t.N=null,this._=t,r=null);for(t.L=t.R=null,t.U=r,t.C=!0,e=t;r&&r.C;)r===(n=r.U).L?(i=n.R)&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.R&&(nr(this,r),r=(e=r).U),r.C=!1,n.C=!0,ir(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.L&&(ir(this,r),r=(e=r).U),r.C=!1,n.C=!0,nr(this,n)),r=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,r,n,i=e.U,a=e.L,o=e.R;if(r=a?o?ar(o):a:o,i?i.L===e?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=e.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=e.U,e=r.R,i.L=e,r.R=o,o.U=r):(r.U=i,i=r,e=r.R)):(n=e.C,e=r),e&&(e.U=i),!n){if(e&&e.C)return void(e.C=!1);do{if(e===this._)break;if(e===i.L){if((t=i.R).C&&(t.C=!1,i.C=!0,nr(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){(!t.R||!t.R.C)&&(t.L.C=!1,t.C=!0,ir(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,nr(this,i),e=this._;break}}else if((t=i.L).C&&(t.C=!1,i.C=!0,ir(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){(!t.L||!t.L.C)&&(t.R.C=!1,t.C=!0,nr(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,ir(this,i),e=this._;break}t.C=!0,e=i,i=i.U}while(!e.C);e&&(e.C=!1)}}},e.geom.voronoi=function(e){var t=wt,r=Tt,n=t,i=r,a=lr;if(e)return o(e);function o(e){var t=new Array(e.length),r=a[0][0],n=a[0][1],i=a[1][0],o=a[1][1];return or(s(e),a).cells.forEach((function(a,s){var l=a.edges,c=a.site;(t[s]=l.length?l.map((function(e){var t=e.start();return[t.x,t.y]})):c.x>=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=e[s]})),t}function s(e){return e.map((function(e,t){return{x:Math.round(n(e,t)/we)*we,y:Math.round(i(e,t)/we)*we,i:t}}))}return o.links=function(e){return or(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 or(s(e)).cells.forEach((function(r,n){for(var i,a=r.site,o=r.edges.sort(Gt),s=-1,l=o.length,c=o[l-1].edge,u=c.l===a?c.r:c.l;++s<l;)i=u,u=(c=o[s].edge).l===a?c.r:c.l,n<i.i&&n<u.i&&cr(a,i,u)<0&&t.push([e[n],e[i.i],e[u.i]])})),t},o.x=function(e){return arguments.length?(n=ut(t=e),o):t},o.y=function(e){return arguments.length?(i=ut(r=e),o):r},o.clipExtent=function(e){return arguments.length?(a=e??lr,o):a===lr?null:a},o.size=function(e){return arguments.length?o.clipExtent(e&&[[0,0],e]):a===lr?null:a&&a[1]},o};var lr=[[-1e6,-1e6],[1e6,1e6]];function cr(e,t,r){return(e.x-r.x)*(t.y-e.y)-(e.x-t.x)*(r.y-e.y)}function ur(e){return e.x}function hr(e){return e.y}function fr(e,t,r,n,i,a){if(!e(t,r,n,i,a)){var o=.5*(r+i),s=.5*(n+a),l=t.nodes;l[0]&&fr(e,l[0],r,n,o,s),l[1]&&fr(e,l[1],o,n,i,s),l[2]&&fr(e,l[2],r,s,o,a),l[3]&&fr(e,l[3],o,s,i,a)}}function pr(t,r){t=e.rgb(t),r=e.rgb(r);var n=t.r,i=t.g,a=t.b,o=r.r-n,s=r.g-i,l=r.b-a;return function(e){return"#"+nt(Math.round(n+o*e))+nt(Math.round(i+s*e))+nt(Math.round(a+l*e))}}function dr(e,t){var r,n={},i={};for(r in e)r in t?n[r]=xr(e[r],t[r]):i[r]=e[r];for(r in t)r in e||(i[r]=t[r]);return function(e){for(r in n)i[r]=n[r](e);return i}}function mr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function gr(e,t){var r,n,i,a=yr.lastIndex=vr.lastIndex=0,o=-1,s=[],l=[];for(e+="",t+="";(r=yr.exec(e))&&(n=vr.exec(t));)(i=n.index)>a&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:mr(r,n)})),a=vr.lastIndex;return a<t.length&&(i=t.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(t=l[0].x,function(e){return t(e)+""}):function(){return t}:(t=l.length,function(e){for(var r,n=0;n<t;++n)s[(r=l[n]).i]=r.x(e);return s.join("")})}e.geom.delaunay=function(t){return e.geom.voronoi().triangles(t)},e.geom.quadtree=function(e,t,r,n,i){var a,o=wt,s=Tt;if(a=arguments.length)return o=ur,s=hr,3===a&&(i=r,n=t,r=t=0),l(e);function l(e){var l,c,u,h,f,p,d,m,g,y=ut(o),x=ut(s);if(null!=t)p=t,d=r,m=n,g=i;else if(m=g=-(p=d=1/0),c=[],u=[],f=e.length,a)for(h=0;h<f;++h)(l=e[h]).x<p&&(p=l.x),l.y<d&&(d=l.y),l.x>m&&(m=l.x),l.y>g&&(g=l.y),c.push(l.x),u.push(l.y);else for(h=0;h<f;++h){var _=+y(l=e[h],h),b=+x(l,h);_<p&&(p=_),b<d&&(d=b),_>m&&(m=_),b>g&&(g=b),c.push(_),u.push(b)}var w=m-p,T=g-d;function k(e,t,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(e.leaf){var l=e.x,c=e.y;if(null!=l)if(v(l-r)+v(c-n)<.01)A(e,t,r,n,i,a,o,s);else{var u=e.point;e.x=e.y=e.point=null,A(e,u,l,c,i,a,o,s),A(e,t,r,n,i,a,o,s)}else e.x=r,e.y=n,e.point=t}else A(e,t,r,n,i,a,o,s)}function A(e,t,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,h=n>=c,f=h<<1|u;e.leaf=!1,u?i=l:o=l,h?a=c:s=c,k(e=e.nodes[f]||(e.nodes[f]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,r,n,i,a,o,s)}w>T?g=d+w:m=p+T;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){k(M,e,+y(e,++h),+x(e,h),p,d,m,g)},visit:function(e){fr(e,M,p,d,m,g)},find:function(e){return function(e,t,r,n,i,a,o){var s,l=1/0;return function e(c,u,h,f,p){if(!(u>a||h>o||f<n||p<i)){if(d=c.point){var d,m=t-c.x,g=r-c.y,y=m*m+g*g;if(y<l){var v=Math.sqrt(l=y);n=t-v,i=r-v,a=t+v,o=r+v,s=d}}for(var x=c.nodes,_=.5*(u+f),b=.5*(h+p),w=(r>=b)<<1|t>=_,T=w+4;w<T;++w)if(c=x[3&w])switch(3&w){case 0:e(c,u,h,_,b);break;case 1:e(c,_,h,f,b);break;case 2:e(c,u,b,_,p);break;case 3:e(c,_,b,f,p)}}}(e,n,i,a,o),s}(M,e[0],e[1],p,d,m,g)}};if(h=-1,null==t){for(;++h<f;)k(M,e[h],c[h],u[h],p,d,m,g);--h}else e.forEach(M.add);return c=u=e=l=null,M}return l.x=function(e){return arguments.length?(o=e,l):o},l.y=function(e){return arguments.length?(s=e,l):s},l.extent=function(e){return arguments.length?(null==e?t=r=n=i=null:(t=+e[0][0],r=+e[0][1],n=+e[1][0],i=+e[1][1]),l):null==t?null:[[t,r],[n,i]]},l.size=function(e){return arguments.length?(null==e?t=r=n=i=null:(t=r=0,n=+e[0],i=+e[1]),l):null==t?null:[n-t,i-r]},l},e.interpolateRgb=pr,e.interpolateObject=dr,e.interpolateNumber=mr,e.interpolateString=gr;var yr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vr=new RegExp(yr.source,"g");function xr(t,r){for(var n,i=e.interpolators.length;--i>=0&&!(n=e.interpolators[i](t,r)););return n}function _r(e,t){var r,n=[],i=[],a=e.length,o=t.length,s=Math.min(e.length,t.length);for(r=0;r<s;++r)n.push(xr(e[r],t[r]));for(;r<a;++r)i[r]=e[r];for(;r<o;++r)i[r]=t[r];return function(e){for(r=0;r<s;++r)i[r]=n[r](e);return i}}e.interpolate=xr,e.interpolators=[function(e,t){var r=typeof t;return("string"===r?ct.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?pr:gr:t instanceof Re?pr:Array.isArray(t)?_r:"object"===r&&isNaN(t)?dr:mr)(e,t)}],e.interpolateArray=_r;var br=function(){return C},wr=e.map({linear:br,poly:function(e){return function(t){return Math.pow(t,e)}},quad:function(){return Mr},cubic:function(){return Sr},sin:function(){return Cr},exp:function(){return Ir},circle:function(){return Lr},elastic:function(e,t){var r;return arguments.length<2&&(t=.45),arguments.length?r=t/ke*Math.asin(1/e):(e=1,r=t/4),function(n){return 1+e*Math.pow(2,-10*n)*Math.sin((n-r)*ke/t)}},back:function(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}},bounce:function(){return Pr}}),Tr=e.map({in:C,out:kr,"in-out":Ar,"out-in":function(e){return Ar(kr(e))}});function kr(e){return function(t){return 1-e(1-t)}}function Ar(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function Mr(e){return e*e}function Sr(e){return e*e*e}function Er(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Cr(e){return 1-Math.cos(e*Me)}function Ir(e){return Math.pow(2,10*(e-1))}function Lr(e){return 1-Math.sqrt(1-e*e)}function Pr(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}function zr(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function Dr(e){var t=[e.a,e.b],r=[e.c,e.d],n=Rr(t),i=Or(t,r),a=Rr(function(e,t,r){return e[0]+=r*t[0],e[1]+=r*t[1],e}(r,t,-i))||0;t[0]*r[1]<r[0]*t[1]&&(t[0]*=-1,t[1]*=-1,n*=-1,i*=-1),this.rotate=(n?Math.atan2(t[1],t[0]):Math.atan2(-r[0],r[1]))*Ee,this.translate=[e.e,e.f],this.scale=[n,a],this.skew=a?Math.atan2(i,a)*Ee:0}function Or(e,t){return e[0]*t[0]+e[1]*t[1]}function Rr(e){var t=Math.sqrt(Or(e,e));return t&&(e[0]/=t,e[1]/=t),t}e.ease=function(e){var t=e.indexOf("-"),n=t>=0?e.slice(0,t):e,i=t>=0?e.slice(t+1):"in";return n=wr.get(n)||br,function(e){return function(t){return t<=0?0:t>=1?1:e(t)}}((i=Tr.get(i)||C)(n.apply(null,r.call(arguments,1))))},e.interpolateHcl=function(t,r){t=e.hcl(t),r=e.hcl(r);var n=t.h,i=t.c,a=t.l,o=r.h-n,s=r.c-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.c:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(e){return Ve(n+o*e,i+s*e,a+l*e)+""}},e.interpolateHsl=function(t,r){t=e.hsl(t),r=e.hsl(r);var n=t.h,i=t.s,a=t.l,o=r.h-n,s=r.s-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.s:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(e){return je(n+o*e,i+s*e,a+l*e)+""}},e.interpolateLab=function(t,r){t=e.lab(t),r=e.lab(r);var n=t.l,i=t.a,a=t.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(e){return Xe(n+o*e,i+s*e,a+l*e)+""}},e.interpolateRound=zr,e.transform=function(t){var r=i.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(e){if(null!=e){r.setAttribute("transform",e);var t=r.transform.baseVal.consolidate()}return new Dr(t?t.matrix:Fr)})(t)},Dr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Fr={a:1,b:0,c:0,d:1,e:0,f:0};function Br(e){return e.length?e.pop()+",":""}function jr(t,r){var n=[],i=[];return t=e.transform(t),r=e.transform(r),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:mr(e[0],t[0])},{i:i-2,x:mr(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(t.translate,r.translate,n,i),function(e,t,r,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:r.push(Br(r)+"rotate(",null,")")-2,x:mr(e,t)})):t&&r.push(Br(r)+"rotate("+t+")")}(t.rotate,r.rotate,n,i),function(e,t,r,n){e!==t?n.push({i:r.push(Br(r)+"skewX(",null,")")-2,x:mr(e,t)}):t&&r.push(Br(r)+"skewX("+t+")")}(t.skew,r.skew,n,i),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push(Br(r)+"scale(",null,",",null,")");n.push({i:i-4,x:mr(e[0],t[0])},{i:i-2,x:mr(e[1],t[1])})}else(1!==t[0]||1!==t[1])&&r.push(Br(r)+"scale("+t+")")}(t.scale,r.scale,n,i),t=r=null,function(e){for(var t,r=-1,a=i.length;++r<a;)n[(t=i[r]).i]=t.x(e);return n.join("")}}function Nr(e,t){return t=(t-=e=+e)||1/t,function(r){return(r-e)/t}}function Ur(e,t){return t=(t-=e=+e)||1/t,function(r){return Math.max(0,Math.min(1,(r-e)/t))}}function Vr(e){for(var t=e.source,r=e.target,n=function(e,t){if(e===t)return e;for(var r=qr(e),n=qr(t),i=r.pop(),a=n.pop(),o=null;i===a;)o=i,i=r.pop(),a=n.pop();return o}(t,r),i=[t];t!==n;)t=t.parent,i.push(t);for(var a=i.length;r!==n;)i.splice(a,0,r),r=r.parent;return i}function qr(e){for(var t=[],r=e.parent;null!=r;)t.push(e),e=r,r=r.parent;return t.push(e),t}function Hr(e){e.fixed|=2}function Gr(e){e.fixed&=-7}function Wr(e){e.fixed|=4,e.px=e.x,e.py=e.y}function Zr(e){e.fixed&=-5}function Yr(e,t,r){var n=0,i=0;if(e.charge=0,!e.leaf)for(var a,o=e.nodes,s=o.length,l=-1;++l<s;)null!=(a=o[l])&&(Yr(a,t,r),e.charge+=a.charge,n+=a.charge*a.cx,i+=a.charge*a.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var c=t*r[e.point.index];e.charge+=e.pointCharge=c,n+=c*e.point.x,i+=c*e.point.y}e.cx=n/e.charge,e.cy=i/e.charge}e.interpolateTransform=jr,e.layout={},e.layout.bundle=function(){return function(e){for(var t=[],r=-1,n=e.length;++r<n;)t.push(Vr(e[r]));return t}},e.layout.chord=function(){var t,r,n,i,a,o,s,l={},c=0;function u(){var l,u,f,p,d,m={},g=[],y=e.range(i),v=[];for(t=[],r=[],l=0,p=-1;++p<i;){for(u=0,d=-1;++d<i;)u+=n[p][d];g.push(u),v.push(e.range(i)),l+=u}for(a&&y.sort((function(e,t){return a(g[e],g[t])})),o&&v.forEach((function(e,t){e.sort((function(e,r){return o(n[t][e],n[t][r])}))})),l=(ke-c*i)/l,u=0,p=-1;++p<i;){for(f=u,d=-1;++d<i;){var x=y[p],_=v[x][d],b=n[x][_],w=u,T=u+=b*l;m[x+"-"+_]={index:x,subindex:_,startAngle:w,endAngle:T,value:b}}r[x]={index:x,startAngle:f,endAngle:u,value:g[x]},u+=c}for(p=-1;++p<i;)for(d=p-1;++d<i;){var k=m[p+"-"+d],A=m[d+"-"+p];(k.value||A.value)&&t.push(k.value<A.value?{source:A,target:k}:{source:k,target:A})}s&&h()}function h(){t.sort((function(e,t){return s((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)}))}return l.matrix=function(e){return arguments.length?(i=(n=e)&&n.length,t=r=null,l):n},l.padding=function(e){return arguments.length?(c=e,t=r=null,l):c},l.sortGroups=function(e){return arguments.length?(a=e,t=r=null,l):a},l.sortSubgroups=function(e){return arguments.length?(o=e,t=null,l):o},l.sortChords=function(e){return arguments.length?(s=e,t&&h(),l):s},l.chords=function(){return t||u(),t},l.groups=function(){return r||u(),r},l},e.layout.force=function(){var t,r,n,i,a,o,s={},l=e.dispatch("start","tick","end"),c=[1,1],u=.9,h=Xr,f=$r,p=-30,d=Kr,m=.1,g=.64,y=[],v=[];function x(e){return function(t,r,n,i){if(t.point!==e){var a=t.cx-e.x,o=t.cy-e.y,s=i-r,l=a*a+o*o;if(s*s/g<l){if(l<d){var c=t.charge/l;e.px-=a*c,e.py-=o*c}return!0}t.point&&l&&l<d&&(c=t.pointCharge/l,e.px-=a*c,e.py-=o*c)}return!t.charge}}function _(t){t.px=e.event.x,t.py=e.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return t=null,l.end({type:"end",alpha:n=0}),!0;var r,s,h,f,d,g,_,b,w,T=y.length,k=v.length;for(s=0;s<k;++s)f=(h=v[s]).source,(g=(b=(d=h.target).x-f.x)*b+(w=d.y-f.y)*w)&&(b*=g=n*a[s]*((g=Math.sqrt(g))-i[s])/g,w*=g,d.x-=b*(_=f.weight+d.weight?f.weight/(f.weight+d.weight):.5),d.y-=w*_,f.x+=b*(_=1-_),f.y+=w*_);if((_=n*m)&&(b=c[0]/2,w=c[1]/2,s=-1,_))for(;++s<T;)(h=y[s]).x+=(b-h.x)*_,h.y+=(w-h.y)*_;if(p)for(Yr(r=e.geom.quadtree(y),n,o),s=-1;++s<T;)(h=y[s]).fixed||r.visit(x(h));for(s=-1;++s<T;)(h=y[s]).fixed?(h.x=h.px,h.y=h.py):(h.x-=(h.px-(h.px=h.x))*u,h.y-=(h.py-(h.py=h.y))*u);l.tick({type:"tick",alpha:n})},s.nodes=function(e){return arguments.length?(y=e,s):y},s.links=function(e){return arguments.length?(v=e,s):v},s.size=function(e){return arguments.length?(c=e,s):c},s.linkDistance=function(e){return arguments.length?(h="function"==typeof e?e:+e,s):h},s.distance=s.linkDistance,s.linkStrength=function(e){return arguments.length?(f="function"==typeof e?e:+e,s):f},s.friction=function(e){return arguments.length?(u=+e,s):u},s.charge=function(e){return arguments.length?(p="function"==typeof e?e:+e,s):p},s.chargeDistance=function(e){return arguments.length?(d=e*e,s):Math.sqrt(d)},s.gravity=function(e){return arguments.length?(m=+e,s):m},s.theta=function(e){return arguments.length?(g=e*e,s):Math.sqrt(g)},s.alpha=function(e){return arguments.length?(e=+e,n?e>0?n=e:(t.c=null,t.t=NaN,t=null,l.end({type:"end",alpha:n=0})):e>0&&(l.start({type:"start",alpha:n=e}),t=vt(s.tick)),s):n},s.start=function(){var e,t,r,n=y.length,l=v.length,u=c[0],d=c[1];for(e=0;e<n;++e)(r=y[e]).index=e,r.weight=0;for(e=0;e<l;++e)"number"==typeof(r=v[e]).source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(e=0;e<n;++e)r=y[e],isNaN(r.x)&&(r.x=m("x",u)),isNaN(r.y)&&(r.y=m("y",d)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof h)for(e=0;e<l;++e)i[e]=+h.call(this,v[e],e);else for(e=0;e<l;++e)i[e]=h;if(a=[],"function"==typeof f)for(e=0;e<l;++e)a[e]=+f.call(this,v[e],e);else for(e=0;e<l;++e)a[e]=f;if(o=[],"function"==typeof p)for(e=0;e<n;++e)o[e]=+p.call(this,y[e],e);else for(e=0;e<n;++e)o[e]=p;function m(r,i){if(!t){for(t=new Array(n),c=0;c<n;++c)t[c]=[];for(c=0;c<l;++c){var a=v[c];t[a.source.index].push(a.target),t[a.target.index].push(a.source)}}for(var o,s=t[e],c=-1,u=s.length;++c<u;)if(!isNaN(o=s[c][r]))return o;return Math.random()*i}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=e.behavior.drag().origin(C).on("dragstart.force",Hr).on("drag.force",_).on("dragend.force",Gr)),!arguments.length)return r;this.on("mouseover.force",Wr).on("mouseout.force",Zr).call(r)},e.rebind(s,l,"on")};var Xr=20,$r=1,Kr=1/0;function Jr(t,r){return e.rebind(t,r,"sort","children","value"),t.nodes=t,t.links=an,t}function Qr(e,t){for(var r=[e];null!=(e=r.pop());)if(t(e),(i=e.children)&&(n=i.length))for(var n,i;--n>=0;)r.push(i[n])}function en(e,t){for(var r=[e],n=[];null!=(e=r.pop());)if(n.push(e),(a=e.children)&&(i=a.length))for(var i,a,o=-1;++o<i;)r.push(a[o]);for(;null!=(e=n.pop());)t(e)}function tn(e){return e.children}function rn(e){return e.value}function nn(e,t){return t.value-e.value}function an(t){return e.merge(t.map((function(e){return(e.children||[]).map((function(t){return{source:e,target:t}}))})))}e.layout.hierarchy=function(){var e=nn,t=tn,r=rn;function n(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(c=t.call(n,a,a.depth))&&(l=c.length)){for(var l,c,u;--l>=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return en(i,(function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)})),s}return n.sort=function(t){return arguments.length?(e=t,n):e},n.children=function(e){return arguments.length?(t=e,n):t},n.value=function(e){return arguments.length?(r=e,n):r},n.revalue=function(e){return r&&(Qr(e,(function(e){e.children&&(e.value=0)})),en(e,(function(e){var t;e.children||(e.value=+r.call(n,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},n},e.layout.partition=function(){var t=e.layout.hierarchy(),r=[1,1];function n(e,t,r,i){var a=e.children;if(e.x=t,e.y=e.depth*i,e.dx=r,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(r=e.value?r/e.value:0;++c<o;)n(s=a[c],t,l=s.value*r,i),t+=l}}function i(e){var t=e.children,r=0;if(t&&(n=t.length))for(var n,a=-1;++a<n;)r=Math.max(r,i(t[a]));return 1+r}function a(e,a){var o=t.call(this,e,a);return n(o[0],0,r[0],r[1]/i(o[0])),o}return a.size=function(e){return arguments.length?(r=e,a):r},Jr(a,t)},e.layout.pie=function(){var t=Number,r=on,n=0,i=ke,a=0;function o(s){var l,c=s.length,u=s.map((function(e,r){return+t.call(o,e,r)})),h=+("function"==typeof n?n.apply(this,arguments):n),f=("function"==typeof i?i.apply(this,arguments):i)-h,p=Math.min(Math.abs(f)/c,+("function"==typeof a?a.apply(this,arguments):a)),d=p*(f<0?-1:1),m=e.sum(u),g=m?(f-c*d)/m:0,y=e.range(c),v=[];return null!=r&&y.sort(r===on?function(e,t){return u[t]-u[e]}:function(e,t){return r(s[e],s[t])}),y.forEach((function(e){v[e]={data:s[e],value:l=u[e],startAngle:h,endAngle:h+=l*g+d,padAngle:p}})),v}return o.value=function(e){return arguments.length?(t=e,o):t},o.sort=function(e){return arguments.length?(r=e,o):r},o.startAngle=function(e){return arguments.length?(n=e,o):n},o.endAngle=function(e){return arguments.length?(i=e,o):i},o.padAngle=function(e){return arguments.length?(a=e,o):a},o};var on={};function sn(e){return e.x}function ln(e){return e.y}function cn(e,t,r){e.y0=t,e.y=r}e.layout.stack=function(){var t=C,r=fn,n=pn,i=cn,a=sn,o=ln;function s(l,c){if(!(p=l.length))return l;var u=l.map((function(e,r){return t.call(s,e,r)})),h=u.map((function(e){return e.map((function(e,t){return[a.call(s,e,t),o.call(s,e,t)]}))})),f=r.call(s,h,c);u=e.permute(u,f),h=e.permute(h,f);var p,d,m,g,y=n.call(s,h,c),v=u[0].length;for(m=0;m<v;++m)for(i.call(s,u[0][m],g=y[m],h[0][m][1]),d=1;d<p;++d)i.call(s,u[d][m],g+=h[d-1][m][1],h[d][m][1]);return l}return s.values=function(e){return arguments.length?(t=e,s):t},s.order=function(e){return arguments.length?(r="function"==typeof e?e:un.get(e)||fn,s):r},s.offset=function(e){return arguments.length?(n="function"==typeof e?e:hn.get(e)||pn,s):n},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};var un=e.map({"inside-out":function(t){var r,n,i=t.length,a=t.map(dn),o=t.map(mn),s=e.range(i).sort((function(e,t){return a[e]-a[t]})),l=0,c=0,u=[],h=[];for(r=0;r<i;++r)n=s[r],l<c?(l+=o[n],u.push(n)):(c+=o[n],h.push(n));return h.reverse().concat(u)},reverse:function(t){return e.range(t.length).reverse()},default:fn}),hn=e.map({silhouette:function(e){var t,r,n,i=e.length,a=e[0].length,o=[],s=0,l=[];for(r=0;r<a;++r){for(t=0,n=0;t<i;t++)n+=e[t][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<a;++r)l[r]=(s-o[r])/2;return l},wiggle:function(e){var t,r,n,i,a,o,s,l,c,u=e.length,h=e[0],f=h.length,p=[];for(p[0]=l=c=0,r=1;r<f;++r){for(t=0,i=0;t<u;++t)i+=e[t][r][1];for(t=0,a=0,s=h[r][0]-h[r-1][0];t<u;++t){for(n=0,o=(e[t][r][1]-e[t][r-1][1])/(2*s);n<t;++n)o+=(e[n][r][1]-e[n][r-1][1])/s;a+=o*e[t][r][1]}p[r]=l-=i?a/i*s:0,l<c&&(c=l)}for(r=0;r<f;++r)p[r]-=c;return p},expand:function(e){var t,r,n,i=e.length,a=e[0].length,o=1/i,s=[];for(r=0;r<a;++r){for(t=0,n=0;t<i;t++)n+=e[t][r][1];if(n)for(t=0;t<i;t++)e[t][r][1]/=n;else for(t=0;t<i;t++)e[t][r][1]=o}for(r=0;r<a;++r)s[r]=0;return s},zero:pn});function fn(t){return e.range(t.length)}function pn(e){for(var t=-1,r=e[0].length,n=[];++t<r;)n[t]=0;return n}function dn(e){for(var t,r=1,n=0,i=e[0][1],a=e.length;r<a;++r)(t=e[r][1])>i&&(n=r,i=t);return n}function mn(e){return e.reduce(gn,0)}function gn(e,t){return e+t[1]}function yn(e,t){return vn(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function vn(e,t){for(var r=-1,n=+e[0],i=(e[1]-n)/t,a=[];++r<=t;)a[r]=i*r+n;return a}function xn(t){return[e.min(t),e.max(t)]}function _n(e,t){return e.value-t.value}function bn(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function wn(e,t){e._pack_next=t,t._pack_prev=e}function Tn(e,t){var r=t.x-e.x,n=t.y-e.y,i=e.r+t.r;return.999*i*i>r*r+n*n}function kn(e){if((t=e.children)&&(l=t.length)){var t,r,n,i,a,o,s,l,c=1/0,u=-1/0,h=1/0,f=-1/0;if(t.forEach(An),(r=t[0]).x=-r.r,r.y=0,x(r),l>1&&((n=t[1]).x=n.r,n.y=0,x(n),l>2))for(En(r,n,i=t[2]),x(i),bn(r,i),r._pack_prev=i,bn(i,n),n=r._pack_next,a=3;a<l;a++){En(r,n,i=t[a]);var p=0,d=1,m=1;for(o=n._pack_next;o!==n;o=o._pack_next,d++)if(Tn(o,i)){p=1;break}if(1==p)for(s=r._pack_prev;s!==o._pack_prev&&!Tn(s,i);s=s._pack_prev,m++);p?(d<m||d==m&&n.r<r.r?wn(r,n=o):wn(r=s,n),a--):(bn(r,i),n=i,x(i))}var g=(c+u)/2,y=(h+f)/2,v=0;for(a=0;a<l;a++)(i=t[a]).x-=g,i.y-=y,v=Math.max(v,i.r+Math.sqrt(i.x*i.x+i.y*i.y));e.r=v,t.forEach(Mn)}function x(e){c=Math.min(e.x-e.r,c),u=Math.max(e.x+e.r,u),h=Math.min(e.y-e.r,h),f=Math.max(e.y+e.r,f)}}function An(e){e._pack_next=e._pack_prev=e}function Mn(e){delete e._pack_next,delete e._pack_prev}function Sn(e,t,r,n){var i=e.children;if(e.x=t+=n*e.x,e.y=r+=n*e.y,e.r*=n,i)for(var a=-1,o=i.length;++a<o;)Sn(i[a],t,r,n)}function En(e,t,r){var n=e.r+r.r,i=t.x-e.x,a=t.y-e.y;if(n&&(i||a)){var o=t.r+r.r,s=i*i+a*a,l=.5+((n*=n)-(o*=o))/(2*s),c=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=e.x+l*i+c*a,r.y=e.y+l*a-c*i}else r.x=e.x+n,r.y=e.y}function Cn(e,t){return e.parent==t.parent?1:2}function In(e){var t=e.children;return t.length?t[0]:e.t}function Ln(e){var t,r=e.children;return(t=r.length)?r[t-1]:e.t}function Pn(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function zn(e,t,r){return e.a.parent===t.parent?e.a:r}function Dn(e){var t=e.children;return t&&t.length?Dn(t[0]):e}function On(e){var t,r=e.children;return r&&(t=r.length)?On(r[t-1]):e}function Rn(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function Fn(e,t){var r=e.x+t[3],n=e.y+t[0],i=e.dx-t[1]-t[3],a=e.dy-t[0]-t[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function Bn(e){var t=e[0],r=e[e.length-1];return t<r?[t,r]:[r,t]}function jn(e){return e.rangeExtent?e.rangeExtent():Bn(e.range())}function Nn(e,t,r,n){var i=r(e[0],e[1]),a=n(t[0],t[1]);return function(e){return a(i(e))}}function Un(e,t){var r,n=0,i=e.length-1,a=e[n],o=e[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),e[n]=t.floor(a),e[i]=t.ceil(o),e}function Vn(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:qn}e.layout.histogram=function(){var t=!0,r=Number,n=xn,i=yn;function a(a,o){for(var s,l,c=[],u=a.map(r,this),h=n.call(this,u,o),f=i.call(this,h,u,o),p=(o=-1,u.length),d=f.length-1,m=t?1:1/p;++o<d;)(s=c[o]=[]).dx=f[o+1]-(s.x=f[o]),s.y=0;if(d>0)for(o=-1;++o<p;)(l=u[o])>=h[0]&&l<=h[1]&&((s=c[e.bisect(f,l,1,d)-1]).y+=m,s.push(a[o]));return c}return a.value=function(e){return arguments.length?(r=e,a):r},a.range=function(e){return arguments.length?(n=ut(e),a):n},a.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return vn(t,e)}:ut(e),a):i},a.frequency=function(e){return arguments.length?(t=!!e,a):t},a},e.layout.pack=function(){var t,r=e.layout.hierarchy().sort(_n),n=0,i=[1,1];function a(e,a){var o=r.call(this,e,a),s=o[0],l=i[0],c=i[1],u=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(s.x=s.y=0,en(s,(function(e){e.r=+u(e.value)})),en(s,kn),n){var h=n*(t?1:Math.max(2*s.r/l,2*s.r/c))/2;en(s,(function(e){e.r+=h})),en(s,kn),en(s,(function(e){e.r-=h}))}return Sn(s,l/2,c/2,t?1:1/Math.max(2*s.r/l,2*s.r/c)),o}return a.size=function(e){return arguments.length?(i=e,a):i},a.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,a):t},a.padding=function(e){return arguments.length?(n=+e,a):n},Jr(a,r)},e.layout.tree=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Cn,n=[1,1],i=null;function a(e,a){var c=t.call(this,e,a),u=c[0],h=function(e){for(var t,r={A:null,children:[e]},n=[r];null!=(t=n.pop());)for(var i,a=t.children,o=0,s=a.length;o<s;++o)n.push((a[o]=i={_:a[o],parent:t,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}(u);if(en(h,o),h.parent.m=-h.z,Qr(h,s),i)Qr(u,l);else{var f=u,p=u,d=u;Qr(u,(function(e){e.x<f.x&&(f=e),e.x>p.x&&(p=e),e.depth>d.depth&&(d=e)}));var m=r(f,p)/2-f.x,g=n[0]/(p.x+r(p,f)/2+m),y=n[1]/(d.depth||1);Qr(u,(function(e){e.x=(e.x+m)*g,e.y=e.depth*y}))}return c}function o(e){var t=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(t.length){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var a=(t[0].z+t[t.length-1].z)/2;i?(e.z=i.z+r(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+r(e._,i._));e.parent.A=function(e,t,n){if(t){for(var i,a=e,o=e,s=t,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,f=l.m;s=Ln(s),a=In(a),s&&a;)l=In(l),(o=Ln(o)).a=e,(i=s.z+h-a.z-c+r(s._,a._))>0&&(Pn(zn(s,e,n),e,i),c+=i,u+=i),h+=s.m,c+=a.m,f+=l.m,u+=o.m;s&&!Ln(o)&&(o.t=s,o.m+=h-u),a&&!In(l)&&(l.t=a,l.m+=c-f,n=e)}return n}(e,i,e.parent.A||n[0])}function s(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=n[0],e.y=e.depth*n[1]}return a.separation=function(e){return arguments.length?(r=e,a):r},a.size=function(e){return arguments.length?(i=null==(n=e)?l:null,a):i?null:n},a.nodeSize=function(e){return arguments.length?(i=null==(n=e)?null:l,a):i?n:null},Jr(a,t)},e.layout.cluster=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Cn,n=[1,1],i=!1;function a(a,o){var s,l=t.call(this,a,o),c=l[0],u=0;en(c,(function(t){var n=t.children;n&&n.length?(t.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(n),t.y=function(t){return 1+e.max(t,(function(e){return e.y}))}(n)):(t.x=s?u+=r(t,s):0,t.y=0,s=t)}));var h=Dn(c),f=On(c),p=h.x-r(h,f)/2,d=f.x+r(f,h)/2;return en(c,i?function(e){e.x=(e.x-c.x)*n[0],e.y=(c.y-e.y)*n[1]}:function(e){e.x=(e.x-p)/(d-p)*n[0],e.y=(1-(c.y?e.y/c.y:1))*n[1]}),l}return a.separation=function(e){return arguments.length?(r=e,a):r},a.size=function(e){return arguments.length?(i=null==(n=e),a):i?null:n},a.nodeSize=function(e){return arguments.length?(i=null!=(n=e),a):i?n:null},Jr(a,t)},e.layout.treemap=function(){var t,r=e.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=Rn,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(e,t){for(var r,n,i=-1,a=e.length;++i<a;)n=(r=e[i]).value*(t<0?0:t),r.area=isNaN(n)||n<=0?0:n}function h(e){var t=e.children;if(t&&t.length){var r,n,i,a=o(e),s=[],c=t.slice(),f=1/0,m="slice"===l?a.dx:"dice"===l?a.dy:"slice-dice"===l?1&e.depth?a.dy:a.dx:Math.min(a.dx,a.dy);for(u(c,a.dx*a.dy/e.value),s.area=0;(i=c.length)>0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,m))<=f?(c.pop(),f=n):(s.area-=s.pop().area,d(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,f=1/0);s.length&&(d(s,m,a,!0),s.length=s.area=0),t.forEach(h)}}function f(e){var t=e.children;if(t&&t.length){var r,n=o(e),i=t.slice(),a=[];for(u(i,n.dx*n.dy/e.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);t.forEach(f)}}function p(e,t){for(var r,n=e.area,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 t*=t,(n*=n)?Math.max(t*i*c/n,n/(t*a*c)):1/0}function d(e,t,r,i){var a,o=-1,s=e.length,l=r.x,c=r.y,u=t?n(e.area/t):0;if(t==r.dx){for((i||u>r.dy)&&(u=r.dy);++o<s;)(a=e[o]).x=l,a.y=c,a.dy=u,l+=a.dx=Math.min(r.x+r.dx-l,u?n(a.area/u):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=u,r.dy-=u}else{for((i||u>r.dx)&&(u=r.dx);++o<s;)(a=e[o]).x=l,a.y=c,a.dx=u,c+=a.dy=Math.min(r.y+r.dy-c,u?n(a.area/u):0);a.z=!1,a.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function m(e){var n=t||r(e),a=n[0];return a.x=a.y=0,a.value?(a.dx=i[0],a.dy=i[1]):a.dx=a.dy=0,t&&r.revalue(a),u([a],a.dx*a.dy/a.value),(t?f:h)(a),s&&(t=n),n}return m.size=function(e){return arguments.length?(i=e,m):i},m.padding=function(e){return arguments.length?(o=null==(a=e)?Rn:"function"==(t=typeof e)?function(t){var r=e.call(m,t,t.depth);return null==r?Rn(t):Fn(t,"number"==typeof r?[r,r,r,r]:r)}:("number"===t&&(e=[e,e,e,e]),function(t){return Fn(t,e)}),m):a;var t},m.round=function(e){return arguments.length?(n=e?Math.round:Number,m):n!=Number},m.sticky=function(e){return arguments.length?(s=e,t=null,m):s},m.ratio=function(e){return arguments.length?(c=e,m):c},m.mode=function(e){return arguments.length?(l=e+"",m):l},Jr(m,r)},e.random={normal:function(e,t){var r=arguments.length;return r<2&&(t=1),r<1&&(e=0),function(){var r,n,i;do{i=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!i||i>1);return e+t*r*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 r=e.random.irwinHall(t);return function(){return r()/t}},irwinHall:function(e){return function(){for(var t=0,r=0;r<e;r++)t+=Math.random();return t}}},e.scale={};var qn={floor:C,ceil:C};function Hn(t,r,n,i){var a=[],o=[],s=0,l=Math.min(t.length,r.length)-1;for(t[l]<t[0]&&(t=t.slice().reverse(),r=r.slice().reverse());++s<=l;)a.push(n(t[s-1],t[s])),o.push(i(r[s-1],r[s]));return function(r){var n=e.bisect(t,r,1,l)-1;return o[n](a[n](r))}}function Gn(e,t,r,n){var i,a;function o(){var o=Math.min(e.length,t.length)>2?Hn:Nn,l=n?Ur:Nr;return i=o(e,t,l,r),a=o(t,e,l,xr),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(zr)},s.clamp=function(e){return arguments.length?(n=e,o()):n},s.interpolate=function(e){return arguments.length?(r=e,o()):r},s.ticks=function(t){return Xn(e,t)},s.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},s.nice=function(t){return Zn(e,t),o()},s.copy=function(){return Gn(e,t,r,n)},o()}function Wn(t,r){return e.rebind(t,r,"range","rangeRound","interpolate","clamp")}function Zn(e,t){return Un(e,Vn(Yn(e,t)[2])),Un(e,Vn(Yn(e,t)[2])),e}function Yn(e,t){null==t&&(t=10);var r=Bn(e),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/t)/Math.LN10)),a=t/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function Xn(t,r){return e.range.apply(e,Yn(t,r))}function $n(e,t,r,n){function i(e){return(r?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function a(e){return r?Math.pow(t,e):-Math.pow(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?(r=t[0]>=0,e.domain((n=t.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(t=+r,e.domain(n.map(i)),o):t},o.nice=function(){var t=Un(n.map(i),r?Math:Kn);return e.domain(t),n=t.map(a),o},o.ticks=function(){var e=Bn(n),o=[],s=e[0],l=e[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),h=t%1?2:t;if(isFinite(u-c)){if(r){for(;c<u;c++)for(var f=1;f<h;f++)o.push(a(c)*f);o.push(a(c))}else for(o.push(a(c));c++<u;)for(f=h-1;f>0;f--)o.push(a(c)*f);for(c=0;o[c]<s;c++);for(u=o.length;o[u-1]>l;u--);o=o.slice(c,u)}return o},o.copy=function(){return $n(e.copy(),t,r,n)},Wn(o,e)}e.scale.linear=function(){return Gn([0,1],[0,1],xr,!1)},e.scale.log=function(){return $n(e.scale.linear().domain([0,1]),10,!0,[1,10])};var Kn={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function Jn(e,t,r){var n=Qn(t),i=Qn(1/t);function a(t){return e(n(t))}return a.invert=function(t){return i(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain((r=t.map(Number)).map(n)),a):r},a.ticks=function(e){return Xn(r,e)},a.tickFormat=function(e,t){return d3_scale_linearTickFormat(r,e,t)},a.nice=function(e){return a.domain(Zn(r,e))},a.exponent=function(o){return arguments.length?(n=Qn(t=o),i=Qn(1/t),e.domain(r.map(n)),a):t},a.copy=function(){return Jn(e.copy(),t,r)},Wn(a,e)}function Qn(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ei(t,r){var n,i,a;function o(e){return i[((n.get(e)||("range"===r.t?n.set(e,t.push(e)):NaN))-1)%i.length]}function s(r,n){return e.range(t.length).map((function(e){return r+n*e}))}return o.domain=function(e){if(!arguments.length)return t;t=[],n=new _;for(var i,a=-1,s=e.length;++a<s;)n.has(i=e[a])||n.set(i,t.push(i));return o[r.t].apply(o,r.a)},o.range=function(e){return arguments.length?(i=e,a=0,r={t:"range",a:arguments},o):i},o.rangePoints=function(e,n){arguments.length<2&&(n=0);var l=e[0],c=e[1],u=t.length<2?(l=(l+c)/2,0):(c-l)/(t.length-1+n);return i=s(l+u*n/2,u),a=0,r={t:"rangePoints",a:arguments},o},o.rangeRoundPoints=function(e,n){arguments.length<2&&(n=0);var l=e[0],c=e[1],u=t.length<2?(l=c=Math.round((l+c)/2),0):(c-l)/(t.length-1+n)|0;return i=s(l+Math.round(u*n/2+(c-l-(t.length-1+n)*u)/2),u),a=0,r={t:"rangeRoundPoints",a:arguments},o},o.rangeBands=function(e,n,l){arguments.length<2&&(n=0),arguments.length<3&&(l=n);var c=e[1]<e[0],u=e[c-0],h=(e[1-c]-u)/(t.length-n+2*l);return i=s(u+h*l,h),c&&i.reverse(),a=h*(1-n),r={t:"rangeBands",a:arguments},o},o.rangeRoundBands=function(e,n,l){arguments.length<2&&(n=0),arguments.length<3&&(l=n);var c=e[1]<e[0],u=e[c-0],h=e[1-c],f=Math.floor((h-u)/(t.length-n+2*l));return i=s(u+Math.round((h-u-(t.length-n)*f)/2),f),c&&i.reverse(),a=Math.round(f*(1-n)),r={t:"rangeRoundBands",a:arguments},o},o.rangeBand=function(){return a},o.rangeExtent=function(){return Bn(r.a[0])},o.copy=function(){return ei(t,r)},o.domain(t)}e.scale.pow=function(){return Jn(e.scale.linear(),1,[0,1])},e.scale.sqrt=function(){return e.scale.pow().exponent(.5)},e.scale.ordinal=function(){return ei([],{t:"range",a:[[]]})},e.scale.category10=function(){return e.scale.ordinal().range(ti)},e.scale.category20=function(){return e.scale.ordinal().range(ri)},e.scale.category20b=function(){return e.scale.ordinal().range(ni)},e.scale.category20c=function(){return e.scale.ordinal().range(ii)};var ti=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(tt),ri=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(tt),ni=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(tt),ii=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(tt);function ai(t,r){var n;function i(){var i=0,o=r.length;for(n=[];++i<o;)n[i-1]=e.quantile(t,i/o);return a}function a(t){if(!isNaN(t=+t))return r[e.bisect(n,t)]}return a.domain=function(e){return arguments.length?(t=e.map(p).filter(d).sort(f),i()):t},a.range=function(e){return arguments.length?(r=e,i()):r},a.quantiles=function(){return n},a.invertExtent=function(e){return(e=r.indexOf(e))<0?[NaN,NaN]:[e>0?n[e-1]:t[0],e<n.length?n[e]:t[t.length-1]]},a.copy=function(){return ai(t,r)},i()}function oi(e,t,r){var n,i;function a(t){return r[Math.max(0,Math.min(i,Math.floor(n*(t-e))))]}function o(){return n=r.length/(t-e),i=r.length-1,a}return a.domain=function(r){return arguments.length?(e=+r[0],t=+r[r.length-1],o()):[e,t]},a.range=function(e){return arguments.length?(r=e,o()):r},a.invertExtent=function(t){return[t=(t=r.indexOf(t))<0?NaN:t/n+e,t+1/n]},a.copy=function(){return oi(e,t,r)},o()}function si(t,r){function n(n){if(n<=n)return r[e.bisect(t,n)]}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(e){return arguments.length?(r=e,n):r},n.invertExtent=function(e){return e=r.indexOf(e),[t[e-1],t[e]]},n.copy=function(){return si(t,r)},n}function li(e){function t(e){return+e}return t.invert=t,t.domain=t.range=function(r){return arguments.length?(e=r.map(t),t):e},t.ticks=function(t){return Xn(e,t)},t.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},t.copy=function(){return li(e)},t}function ci(){return 0}e.scale.quantile=function(){return ai([],[])},e.scale.quantize=function(){return oi(0,1,[0,1])},e.scale.threshold=function(){return si([.5],[0,1])},e.scale.identity=function(){return li([0,1])},e.svg={},e.svg.arc=function(){var e=hi,t=fi,r=ci,n=ui,i=pi,a=di,o=mi;function s(){var s=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+t.apply(this,arguments)),u=i.apply(this,arguments)-Me,h=a.apply(this,arguments)-Me,f=Math.abs(h-u),p=u>h?0:1;if(c<s&&(d=c,c=s,s=d),f>=Ae)return l(c,p)+(s?l(s,1-p):"")+"Z";var d,m,g,y,v,x,_,b,w,T,k,A,M=0,S=0,E=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=n===ui?Math.sqrt(s*s+c*c):+n.apply(this,arguments),p||(S*=-1),c&&(S=Ie(g/c*Math.sin(y))),s&&(M=Ie(g/s*Math.sin(y)))),c){v=c*Math.cos(u+S),x=c*Math.sin(u+S),_=c*Math.cos(h-S),b=c*Math.sin(h-S);var C=Math.abs(h-u-2*S)<=Te?0:1;if(S&&gi(v,x,_,b)===p^C){var I=(u+h)/2;v=c*Math.cos(I),x=c*Math.sin(I),_=b=null}}else v=x=0;if(s){w=s*Math.cos(h-M),T=s*Math.sin(h-M),k=s*Math.cos(u+M),A=s*Math.sin(u+M);var L=Math.abs(u-h+2*M)<=Te?0:1;if(M&&gi(w,T,k,A)===1-p^L){var P=(u+h)/2;w=s*Math.cos(P),T=s*Math.sin(P),k=A=null}}else w=T=0;if(f>we&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s<c^p?0:1;var z=d,D=d;if(f<Te){var O=null==k?[w,T]:null==_?[v,x]:Et([v,x],[k,A],[_,b],[w,T]),R=v-O[0],F=x-O[1],B=_-O[0],j=b-O[1],N=1/Math.sin(Math.acos((R*B+F*j)/(Math.sqrt(R*R+F*F)*Math.sqrt(B*B+j*j)))/2),U=Math.sqrt(O[0]*O[0]+O[1]*O[1]);D=Math.min(d,(s-U)/(N-1)),z=Math.min(d,(c-U)/(N+1))}if(null!=_){var V=yi(null==k?[w,T]:[k,A],[v,x],c,z,p),q=yi([_,b],[w,T],c,z,p);d===z?E.push("M",V[0],"A",z,",",z," 0 0,",m," ",V[1],"A",c,",",c," 0 ",1-p^gi(V[1][0],V[1][1],q[1][0],q[1][1]),",",p," ",q[1],"A",z,",",z," 0 0,",m," ",q[0]):E.push("M",V[0],"A",z,",",z," 0 1,",m," ",q[0])}else E.push("M",v,",",x);if(null!=k){var H=yi([v,x],[k,A],s,-D,p),G=yi([w,T],null==_?[v,x]:[_,b],s,-D,p);d===D?E.push("L",G[0],"A",D,",",D," 0 0,",m," ",G[1],"A",s,",",s," 0 ",p^gi(G[1][0],G[1][1],H[1][0],H[1][1]),",",1-p," ",H[1],"A",D,",",D," 0 0,",m," ",H[0]):E.push("L",G[0],"A",D,",",D," 0 0,",m," ",H[0])}else E.push("L",w,",",T)}else E.push("M",v,",",x),null!=_&&E.push("A",c,",",c," 0 ",C,",",p," ",_,",",b),E.push("L",w,",",T),null!=k&&E.push("A",s,",",s," 0 ",L,",",1-p," ",k,",",A);return E.push("Z"),E.join("")}function l(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=ut(t),s):e},s.outerRadius=function(e){return arguments.length?(t=ut(e),s):t},s.cornerRadius=function(e){return arguments.length?(r=ut(e),s):r},s.padRadius=function(e){return arguments.length?(n=e==ui?ui:ut(e),s):n},s.startAngle=function(e){return arguments.length?(i=ut(e),s):i},s.endAngle=function(e){return arguments.length?(a=ut(e),s):a},s.padAngle=function(e){return arguments.length?(o=ut(e),s):o},s.centroid=function(){var r=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,n=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Me;return[Math.cos(n)*r,Math.sin(n)*r]},s};var ui="auto";function hi(e){return e.innerRadius}function fi(e){return e.outerRadius}function pi(e){return e.startAngle}function di(e){return e.endAngle}function mi(e){return e&&e.padAngle}function gi(e,t,r,n){return(e-r)*t-(t-n)*e>0?0:1}function yi(e,t,r,n,i){var a=e[0]-t[0],o=e[1]-t[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,c=-s*a,u=e[0]+l,h=e[1]+c,f=t[0]+l,p=t[1]+c,d=(u+f)/2,m=(h+p)/2,g=f-u,y=p-h,v=g*g+y*y,x=r-n,_=u*p-f*h,b=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*v-_*_)),w=(_*y-g*b)/v,T=(-_*g-y*b)/v,k=(_*y+g*b)/v,A=(-_*g+y*b)/v,M=w-d,S=T-m,E=k-d,C=A-m;return M*M+S*S>E*E+C*C&&(w=k,T=A),[[w-l,T-c],[w*r/x,T*r/x]]}function vi(){return!0}function xi(e){var t=wt,r=Tt,n=vi,i=bi,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,h=a.length,f=ut(t),p=ut(r);function d(){l.push("M",i(e(c),o))}for(;++u<h;)n.call(this,s=a[u],u)?c.push([+f.call(this,s,u),+p.call(this,s,u)]):c.length&&(d(),c=[]);return c.length&&d(),l.length?l.join(""):null}return s.x=function(e){return arguments.length?(t=e,s):t},s.y=function(e){return arguments.length?(r=e,s):r},s.defined=function(e){return arguments.length?(n=e,s):n},s.interpolate=function(e){return arguments.length?(a="function"==typeof e?i=e:(i=_i.get(e)||bi).key,s):a},s.tension=function(e){return arguments.length?(o=e,s):o},s}e.svg.line=function(){return xi(C)};var _i=e.map({linear:bi,"linear-closed":wi,step:function(e){for(var t=0,r=e.length,n=e[0],i=[n[0],",",n[1]];++t<r;)i.push("H",(n[0]+(n=e[t])[0])/2,"V",n[1]);return r>1&&i.push("H",n[0]),i.join("")},"step-before":Ti,"step-after":ki,basis:Si,"basis-open":function(e){if(e.length<4)return bi(e);for(var t,r=[],n=-1,i=e.length,a=[0],o=[0];++n<3;)t=e[n],a.push(t[0]),o.push(t[1]);for(r.push(Ei(Li,a)+","+Ei(Li,o)),--n;++n<i;)t=e[n],a.shift(),a.push(t[0]),o.shift(),o.push(t[1]),Pi(r,a,o);return r.join("")},"basis-closed":function(e){for(var t,r,n=-1,i=e.length,a=i+4,o=[],s=[];++n<4;)r=e[n%i],o.push(r[0]),s.push(r[1]);for(t=[Ei(Li,o),",",Ei(Li,s)],--n;++n<a;)r=e[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),Pi(t,o,s);return t.join("")},bundle:function(e,t){var r=e.length-1;if(r)for(var n,i,a=e[0][0],o=e[0][1],s=e[r][0]-a,l=e[r][1]-o,c=-1;++c<=r;)i=c/r,(n=e[c])[0]=t*n[0]+(1-t)*(a+i*s),n[1]=t*n[1]+(1-t)*(o+i*l);return Si(e)},cardinal:function(e,t){return e.length<3?bi(e):e[0]+Ai(e,Mi(e,t))},"cardinal-open":function(e,t){return e.length<4?bi(e):e[1]+Ai(e.slice(1,-1),Mi(e,t))},"cardinal-closed":function(e,t){return e.length<3?wi(e):e[0]+Ai((e.push(e[0]),e),Mi([e[e.length-2]].concat(e,[e[1]]),t))},monotone:function(e){return e.length<3?bi(e):e[0]+Ai(e,function(e){for(var t,r,n,i,a=[],o=function(e){for(var t=0,r=e.length-1,n=[],i=e[0],a=e[1],o=n[0]=zi(i,a);++t<r;)n[t]=(o+(o=zi(i=a,a=e[t+1])))/2;return n[t]=o,n}(e),s=-1,l=e.length-1;++s<l;)t=zi(e[s],e[s+1]),v(t)<we?o[s]=o[s+1]=0:(i=(r=o[s]/t)*r+(n=o[s+1]/t)*n)>9&&(i=3*t/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(e[Math.min(l,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(e))}});function bi(e){return e.length>1?e.join("L"):e+"Z"}function wi(e){return e.join("L")+"Z"}function Ti(e){for(var t=0,r=e.length,n=e[0],i=[n[0],",",n[1]];++t<r;)i.push("V",(n=e[t])[1],"H",n[0]);return i.join("")}function ki(e){for(var t=0,r=e.length,n=e[0],i=[n[0],",",n[1]];++t<r;)i.push("H",(n=e[t])[0],"V",n[1]);return i.join("")}function Ai(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return bi(e);var r=e.length!=t.length,n="",i=e[0],a=e[1],o=t[0],s=o,l=1;if(r&&(n+="Q"+(a[0]-2*o[0]/3)+","+(a[1]-2*o[1]/3)+","+a[0]+","+a[1],i=e[1],l=2),t.length>1){s=t[1],a=e[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var c=2;c<t.length;c++,l++)a=e[l],s=t[c],n+="S"+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1]}if(r){var u=e[l];n+="Q"+(a[0]+2*s[0]/3)+","+(a[1]+2*s[1]/3)+","+u[0]+","+u[1]}return n}function Mi(e,t){for(var r,n=[],i=(1-t)/2,a=e[0],o=e[1],s=1,l=e.length;++s<l;)r=a,a=o,o=e[s],n.push([i*(o[0]-r[0]),i*(o[1]-r[1])]);return n}function Si(e){if(e.length<3)return bi(e);var t=1,r=e.length,n=e[0],i=n[0],a=n[1],o=[i,i,i,(n=e[1])[0]],s=[a,a,a,n[1]],l=[i,",",a,"L",Ei(Li,o),",",Ei(Li,s)];for(e.push(e[r-1]);++t<=r;)n=e[t],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),Pi(l,o,s);return e.pop(),l.push("L",n),l.join("")}function Ei(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}_i.forEach((function(e,t){t.key=e,t.closed=/-closed$/.test(e)}));var Ci=[0,2/3,1/3,0],Ii=[0,1/3,2/3,0],Li=[0,1/6,2/3,1/6];function Pi(e,t,r){e.push("C",Ei(Ci,t),",",Ei(Ci,r),",",Ei(Ii,t),",",Ei(Ii,r),",",Ei(Li,t),",",Ei(Li,r))}function zi(e,t){return(t[1]-e[1])/(t[0]-e[0])}function Di(e){for(var t,r,n,i=-1,a=e.length;++i<a;)r=(t=e[i])[0],n=t[1]-Me,t[0]=r*Math.cos(n),t[1]=r*Math.sin(n);return e}function Oi(e){var t=wt,r=wt,n=0,i=Tt,a=vi,o=bi,s=o.key,l=o,c="L",u=.7;function h(s){var h,f,p,d=[],m=[],g=[],y=-1,v=s.length,x=ut(t),_=ut(n),b=t===r?function(){return f}:ut(r),w=n===i?function(){return p}:ut(i);function T(){d.push("M",o(e(g),u),c,l(e(m.reverse()),u),"Z")}for(;++y<v;)a.call(this,h=s[y],y)?(m.push([f=+x.call(this,h,y),p=+_.call(this,h,y)]),g.push([+b.call(this,h,y),+w.call(this,h,y)])):m.length&&(T(),m=[],g=[]);return m.length&&T(),d.length?d.join(""):null}return h.x=function(e){return arguments.length?(t=r=e,h):r},h.x0=function(e){return arguments.length?(t=e,h):t},h.x1=function(e){return arguments.length?(r=e,h):r},h.y=function(e){return arguments.length?(n=i=e,h):i},h.y0=function(e){return arguments.length?(n=e,h):n},h.y1=function(e){return arguments.length?(i=e,h):i},h.defined=function(e){return arguments.length?(a=e,h):a},h.interpolate=function(e){return arguments.length?(s="function"==typeof e?o=e:(o=_i.get(e)||bi).key,l=o.reverse||o,c=o.closed?"M":"L",h):s},h.tension=function(e){return arguments.length?(u=e,h):u},h}function Ri(e){return e.source}function Fi(e){return e.target}function Bi(e){return e.radius}function ji(e){return[e.x,e.y]}function Ni(){return 64}function Ui(){return"circle"}function Vi(e){var t=Math.sqrt(e/Te);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}e.svg.line.radial=function(){var e=xi(Di);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},Ti.reverse=ki,ki.reverse=Ti,e.svg.area=function(){return Oi(C)},e.svg.area.radial=function(){var e=Oi(Di);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},e.svg.chord=function(){var e=Ri,t=Fi,r=Bi,n=pi,i=di;function a(r,n){var i=o(this,e,r,n),a=o(this,t,r,n);return"M"+i.p0+s(i.r,i.p1,i.a1-i.a0)+(function(e,t){return e.a0==t.a0&&e.a1==t.a1}(i,a)?l(i.r,i.p1,i.r,i.p0):l(i.r,i.p1,a.r,a.p0)+s(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),l=r.call(e,s,o),c=n.call(e,s,o)-Me,u=i.call(e,s,o)-Me;return{r:l,a0:c,a1:u,p0:[l*Math.cos(c),l*Math.sin(c)],p1:[l*Math.cos(u),l*Math.sin(u)]}}function s(e,t,r){return"A"+e+","+e+" 0 "+ +(r>Te)+",1 "+t}function l(e,t,r,n){return"Q 0,0 "+n}return a.radius=function(e){return arguments.length?(r=ut(e),a):r},a.source=function(t){return arguments.length?(e=ut(t),a):e},a.target=function(e){return arguments.length?(t=ut(e),a):t},a.startAngle=function(e){return arguments.length?(n=ut(e),a):n},a.endAngle=function(e){return arguments.length?(i=ut(e),a):i},a},e.svg.diagonal=function(){var e=Ri,t=Fi,r=ji;function n(n,i){var a=e.call(this,n,i),o=t.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(t){return arguments.length?(e=ut(t),n):e},n.target=function(e){return arguments.length?(t=ut(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),r=ji,n=t.projection;return t.projection=function(e){return arguments.length?n(function(e){return function(){var t=e.apply(this,arguments),r=t[0],n=t[1]-Me;return[r*Math.cos(n),r*Math.sin(n)]}}(r=e)):r},t},e.svg.symbol=function(){var e=Ui,t=Ni;function r(r,n){return(qi.get(e.call(this,r,n))||Vi)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=ut(t),r):e},r.size=function(e){return arguments.length?(t=ut(e),r):t},r};var qi=e.map({circle:Vi,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*Gi)),r=t*Gi;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",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/Hi),r=t*Hi/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Hi),r=t*Hi/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});e.svg.symbolTypes=qi.keys();var Hi=Math.sqrt(3),Gi=Math.tan(30*Se);G.transition=function(e){for(var t,r,n=Xi||++Ji,i=ta(e),a=[],o=$i||{time:Date.now(),ease:Er,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(t=[]);for(var c=this[s],u=-1,h=c.length;++u<h;)(r=c[u])&&ra(r,u,i,n,o),t.push(r)}return Yi(a,i,n)},G.interrupt=function(e){return this.each(null==e?Wi:Zi(ta(e)))};var Wi=Zi(ta());function Zi(e){return function(){var t,r,n;(t=this[e])&&(n=t[r=t.active])&&(n.timer.c=null,n.timer.t=NaN,--t.count?delete t[r]:delete this[e],t.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Yi(e,t,r){return N(e,Ki),e.namespace=t,e.id=r,e}var Xi,$i,Ki=[],Ji=0;function Qi(e,t,r,n){var i=e.id,a=e.namespace;return ce(e,"function"==typeof r?function(e,o,s){e[a][i].tween.set(t,n(r.call(e,e.__data__,o,s)))}:(r=n(r),function(e){e[a][i].tween.set(t,r)}))}function ea(e){return null==e&&(e=""),function(){this.textContent=e}}function ta(e){return null==e?"__transition__":"__transition_"+e+"__"}function ra(e,t,r,n,i){var a,o,s,l,c,u=e[r]||(e[r]={active:0,count:0}),h=u[n];function f(r){var i=u.active,f=u[i];for(var d in f&&(f.timer.c=null,f.timer.t=NaN,--u.count,delete u[i],f.event&&f.event.interrupt.call(e,e.__data__,f.index)),u)if(+d<n){var m=u[d];m.timer.c=null,m.timer.t=NaN,--u.count,delete u[d]}o.c=p,vt((function(){return o.c&&p(r||1)&&(o.c=null,o.t=NaN),1}),0,a),u.active=n,h.event&&h.event.start.call(e,e.__data__,t),c=[],h.tween.forEach((function(r,n){(n=n.call(e,e.__data__,t))&&c.push(n)})),l=h.ease,s=h.duration}function p(i){for(var a=i/s,o=l(a),f=c.length;f>0;)c[--f].call(e,o);if(a>=1)return h.event&&h.event.end.call(e,e.__data__,t),--u.count?delete u[n]:delete e[r],1}h||(a=i.time,o=vt((function(e){var t=h.delay;if(o.t=t+a,t<=e)return f(e-t);o.c=f}),0,a),h=u[n]={tween:new _,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++u.count)}Ki.call=G.call,Ki.empty=G.empty,Ki.node=G.node,Ki.size=G.size,e.transition=function(t,r){return t&&t.transition?Xi?t.transition(r):t:e.selection().transition(t)},e.transition.prototype=Ki,Ki.select=function(e){var t,r,n,i=this.id,a=this.namespace,o=[];e=W(e);for(var s=-1,l=this.length;++s<l;){o.push(t=[]);for(var c=this[s],u=-1,h=c.length;++u<h;)(n=c[u])&&(r=e.call(n,n.__data__,u,s))?("__data__"in n&&(r.__data__=n.__data__),ra(r,u,a,i,n[a][i]),t.push(r)):t.push(null)}return Yi(o,a,i)},Ki.selectAll=function(e){var t,r,n,i,a,o=this.id,s=this.namespace,l=[];e=Z(e);for(var c=-1,u=this.length;++c<u;)for(var h=this[c],f=-1,p=h.length;++f<p;)if(n=h[f]){a=n[s][o],r=e.call(n,n.__data__,f,c),l.push(t=[]);for(var d=-1,m=r.length;++d<m;)(i=r[d])&&ra(i,d,s,o,a),t.push(i)}return Yi(l,s,o)},Ki.filter=function(e){var t,r,n=[];"function"!=typeof e&&(e=se(e));for(var i=0,a=this.length;i<a;i++){n.push(t=[]);for(var o,s=0,l=(o=this[i]).length;s<l;s++)(r=o[s])&&e.call(r,r.__data__,s,i)&&t.push(r)}return Yi(n,this.namespace,this.id)},Ki.tween=function(e,t){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(e):ce(this,null==t?function(t){t[n][r].tween.remove(e)}:function(i){i[n][r].tween.set(e,t)})},Ki.attr=function(t,r){if(arguments.length<2){for(r in t)this.attr(r,t[r]);return this}var n="transform"==t?jr:xr,i=e.ns.qualify(t);function a(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}return Qi(this,"attr."+t,r,i.local?function(e){return null==e?o:(e+="",function(){var t,r=this.getAttributeNS(i.space,i.local);return r!==e&&(t=n(r,e),function(e){this.setAttributeNS(i.space,i.local,t(e))})})}:function(e){return null==e?a:(e+="",function(){var t,r=this.getAttribute(i);return r!==e&&(t=n(r,e),function(e){this.setAttribute(i,t(e))})})})},Ki.attrTween=function(t,r){var n=e.ns.qualify(t);return this.tween("attr."+t,n.local?function(e,t){var i=r.call(this,e,t,this.getAttributeNS(n.space,n.local));return i&&function(e){this.setAttributeNS(n.space,n.local,i(e))}}:function(e,t){var i=r.call(this,e,t,this.getAttribute(n));return i&&function(e){this.setAttribute(n,i(e))}})},Ki.style=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=""),e)this.style(r,e[r],t);return this}r=""}function i(){this.style.removeProperty(e)}return Qi(this,"style."+e,t,(function(t){return null==t?i:(t+="",function(){var n,i=o(this).getComputedStyle(this,null).getPropertyValue(e);return i!==t&&(n=xr(i,t),function(t){this.style.setProperty(e,n(t),r)})})}))},Ki.styleTween=function(e,t,r){return arguments.length<3&&(r=""),this.tween("style."+e,(function(n,i){var a=t.call(this,n,i,o(this).getComputedStyle(this,null).getPropertyValue(e));return a&&function(t){this.style.setProperty(e,a(t),r)}}))},Ki.text=function(e){return Qi(this,"text",e,ea)},Ki.remove=function(){var e=this.namespace;return this.each("end.transition",(function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)}))},Ki.ease=function(t){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!=typeof t&&(t=e.ease.apply(e,arguments)),ce(this,(function(e){e[n][r].ease=t})))},Ki.delay=function(e){var t=this.id,r=this.namespace;return arguments.length<1?this.node()[r][t].delay:ce(this,"function"==typeof e?function(n,i,a){n[r][t].delay=+e.call(n,n.__data__,i,a)}:(e=+e,function(n){n[r][t].delay=e}))},Ki.duration=function(e){var t=this.id,r=this.namespace;return arguments.length<1?this.node()[r][t].duration:ce(this,"function"==typeof e?function(n,i,a){n[r][t].duration=Math.max(1,e.call(n,n.__data__,i,a))}:(e=Math.max(1,e),function(n){n[r][t].duration=e}))},Ki.each=function(t,r){var n=this.id,i=this.namespace;if(arguments.length<2){var a=$i,o=Xi;try{Xi=n,ce(this,(function(e,r,a){$i=e[i][n],t.call(e,e.__data__,r,a)}))}finally{$i=a,Xi=o}}else ce(this,(function(a){var o=a[i][n];(o.event||(o.event=e.dispatch("start","end","interrupt"))).on(t,r)}));return this},Ki.transition=function(){for(var e,t,r,n=this.id,i=++Ji,a=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(e=[]);for(var c,u=0,h=(c=this[s]).length;u<h;u++)(t=c[u])&&ra(t,u,a,i,{time:(r=t[a][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),e.push(t)}return Yi(o,a,i)},e.svg.axis=function(){var t,r=e.scale.linear(),i=na,a=6,o=6,s=3,l=[10],c=null;function u(n){n.each((function(){var n,u=e.select(this),h=this.__chart__||r,f=this.__chart__=r.copy(),p=c??(f.ticks?f.ticks.apply(f,l):f.domain()),d=t??(f.tickFormat?f.tickFormat.apply(f,l):C),m=u.selectAll(".tick").data(p,f),g=m.enter().insert("g",".domain").attr("class","tick").style("opacity",we),y=e.transition(m.exit()).style("opacity",we).remove(),v=e.transition(m.order()).style("opacity",1),x=Math.max(a,0)+s,_=jn(f),b=u.selectAll(".domain").data([0]),w=(b.enter().append("path").attr("class","domain"),e.transition(b));g.append("line"),g.append("text");var T,k,A,M,S=g.select("line"),E=v.select("line"),I=m.select("text").text(d),L=g.select("text"),P=v.select("text"),z="top"===i||"left"===i?-1:1;if("bottom"===i||"top"===i?(n=aa,T="x",A="y",k="x2",M="y2",I.attr("dy",z<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+_[0]+","+z*o+"V0H"+_[1]+"V"+z*o)):(n=oa,T="y",A="x",k="y2",M="x2",I.attr("dy",".32em").style("text-anchor",z<0?"end":"start"),w.attr("d","M"+z*o+","+_[0]+"H0V"+_[1]+"H"+z*o)),S.attr(M,z*a),L.attr(A,z*x),E.attr(k,0).attr(M,z*a),P.attr(T,0).attr(A,z*x),f.rangeBand){var D=f,O=D.rangeBand()/2;h=f=function(e){return D(e)+O}}else h.rangeBand?h=f:y.call(n,f,h);g.call(n,h,f),v.call(n,f,f)}))}return u.scale=function(e){return arguments.length?(r=e,u):r},u.orient=function(e){return arguments.length?(i=e in ia?e+"":na,u):i},u.ticks=function(){return arguments.length?(l=n(arguments),u):l},u.tickValues=function(e){return arguments.length?(c=e,u):c},u.tickFormat=function(e){return arguments.length?(t=e,u):t},u.tickSize=function(e){var t=arguments.length;return t?(a=+e,o=+arguments[t-1],u):a},u.innerTickSize=function(e){return arguments.length?(a=+e,u):a},u.outerTickSize=function(e){return arguments.length?(o=+e,u):o},u.tickPadding=function(e){return arguments.length?(s=+e,u):s},u.tickSubdivide=function(){return arguments.length&&u},u};var na="bottom",ia={top:1,right:1,bottom:1,left:1};function aa(e,t,r){e.attr("transform",(function(e){var n=t(e);return"translate("+(isFinite(n)?n:r(e))+",0)"}))}function oa(e,t,r){e.attr("transform",(function(e){var n=t(e);return"translate(0,"+(isFinite(n)?n:r(e))+")"}))}e.svg.brush=function(){var t,r,n=B(f,"brushstart","brush","brushend"),i=null,a=null,s=[0,0],l=[0,0],c=!0,u=!0,h=la[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),r=t.selectAll(".background").data([0]);r.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 n=t.selectAll(".resize").data(h,C);n.exit().remove(),n.enter().append("g").attr("class",(function(e){return"resize "+e})).style("cursor",(function(e){return sa[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"),n.style("display",f.empty()?"none":null);var o,s=e.transition(t),l=e.transition(r);i&&(o=jn(i),l.attr("x",o[0]).attr("width",o[1]-o[0]),d(s)),a&&(o=jn(a),l.attr("y",o[0]).attr("height",o[1]-o[0]),m(s)),p(s)}))}function p(e){e.selectAll(".resize").attr("transform",(function(e){return"translate("+s[+/e$/.test(e)]+","+l[+/^s/.test(e)]+")"}))}function d(e){e.select(".extent").attr("x",s[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function m(e){e.select(".extent").attr("y",l[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var h,g,y=this,v=e.select(e.event.target),x=n.of(y,arguments),_=e.select(y),b=v.datum(),w=!/^(n|s)$/.test(b)&&i,T=!/^(e|w)$/.test(b)&&a,k=v.classed("extent"),A=ve(y),M=e.mouse(y),S=e.select(o(y)).on("keydown.brush",(function(){32==e.event.keyCode&&(k||(h=null,M[0]-=s[1],M[1]-=l[1],k=2),R())})).on("keyup.brush",(function(){32==e.event.keyCode&&2==k&&(M[0]+=s[1],M[1]+=l[1],k=0,R())}));if(e.event.changedTouches?S.on("touchmove.brush",I).on("touchend.brush",P):S.on("mousemove.brush",I).on("mouseup.brush",P),_.interrupt().selectAll("*").interrupt(),k)M[0]=s[0]-M[0],M[1]=l[0]-M[1];else if(b){var E=+/w$/.test(b),C=+/^n/.test(b);g=[s[1-E]-M[0],l[1-C]-M[1]],M[0]=s[E],M[1]=l[C]}else e.event.altKey&&(h=M.slice());function I(){var t=e.mouse(y),r=!1;g&&(t[0]+=g[0],t[1]+=g[1]),k||(e.event.altKey?(h||(h=[(s[0]+s[1])/2,(l[0]+l[1])/2]),M[0]=s[+(t[0]<h[0])],M[1]=l[+(t[1]<h[1])]):h=null),w&&L(t,i,0)&&(d(_),r=!0),T&&L(t,a,1)&&(m(_),r=!0),r&&(p(_),x({type:"brush",mode:k?"move":"resize"}))}function L(e,n,i){var a,o,f=jn(n),p=f[0],d=f[1],m=M[i],g=i?l:s,y=g[1]-g[0];if(k&&(p-=m,d-=y+m),a=(i?u:c)?Math.max(p,Math.min(d,e[i])):e[i],k?o=(a+=m)+y:(h&&(m=Math.max(p,Math.min(d,2*h[i]-a))),m<a?(o=a,a=m):o=m),g[0]!=a||g[1]!=o)return i?r=null:t=null,g[0]=a,g[1]=o,!0}function P(){I(),_.style("pointer-events","all").selectAll(".resize").style("display",f.empty()?"none":null),e.select("body").style("cursor",null),S.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),A(),x({type:"brushend"})}_.style("pointer-events","none").selectAll(".resize").style("display",null),e.select("body").style("cursor",v.style("cursor")),x({type:"brushstart"}),I()}return f.event=function(i){i.each((function(){var i=n.of(this,arguments),a={x:s,y:l,i:t,j:r},o=this.__chart__||a;this.__chart__=a,Xi?e.select(this).transition().each("start.brush",(function(){t=o.i,r=o.j,s=o.x,l=o.y,i({type:"brushstart"})})).tween("brush:brush",(function(){var e=_r(s,a.x),n=_r(l,a.y);return t=r=null,function(t){s=a.x=e(t),l=a.y=n(t),i({type:"brush",mode:"resize"})}})).each("end.brush",(function(){t=a.i,r=a.j,i({type:"brush",mode:"resize"}),i({type:"brushend"})})):(i({type:"brushstart"}),i({type:"brush",mode:"resize"}),i({type:"brushend"}))}))},f.x=function(e){return arguments.length?(h=la[!(i=e)<<1|!a],f):i},f.y=function(e){return arguments.length?(h=la[!i<<1|!(a=e)],f):a},f.clamp=function(e){return arguments.length?(i&&a?(c=!!e[0],u=!!e[1]):i?c=!!e:a&&(u=!!e),f):i&&a?[c,u]:i?c:a?u:null},f.extent=function(e){var n,o,c,u,h;return arguments.length?(i&&(n=e[0],o=e[1],a&&(n=n[0],o=o[0]),t=[n,o],i.invert&&(n=i(n),o=i(o)),o<n&&(h=n,n=o,o=h),(n!=s[0]||o!=s[1])&&(s=[n,o])),a&&(c=e[0],u=e[1],i&&(c=c[1],u=u[1]),r=[c,u],a.invert&&(c=a(c),u=a(u)),u<c&&(h=c,c=u,u=h),(c!=l[0]||u!=l[1])&&(l=[c,u])),f):(i&&(t?(n=t[0],o=t[1]):(n=s[0],o=s[1],i.invert&&(n=i.invert(n),o=i.invert(o)),o<n&&(h=n,n=o,o=h))),a&&(r?(c=r[0],u=r[1]):(c=l[0],u=l[1],a.invert&&(c=a.invert(c),u=a.invert(u)),u<c&&(h=c,c=u,u=h))),i&&a?[[n,c],[o,u]]:i?[n,o]:a&&[c,u])},f.clear=function(){return f.empty()||(s=[0,0],l=[0,0],t=r=null),f},f.empty=function(){return!!i&&s[0]==s[1]||!!a&&l[0]==l[1]},e.rebind(f,n,"on")};var sa={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},la=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];function ca(e){return JSON.parse(e.responseText)}function ua(e){var t=i.createRange();return t.selectNode(i.body),t.createContextualFragment(e.responseText)}e.text=ht((function(e){return e.responseText})),e.json=function(e,t){return ft(e,"application/json",ca,t)},e.html=function(e,t){return ft(e,"text/html",ua,t)},e.xml=ht((function(e){return e.responseXML})),"object"==typeof t&&t.exports?t.exports=e:this.d3=e}).apply(self)}}),w=m({"node_modules/d3-time/dist/d3-time.js"(e,t){var r,n;r=e,n=function(e){var t=new Date,r=new Date;function n(e,i,a,o){function s(t){return e(t=0===arguments.length?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),r=s.ceil(e);return e-t<r-e?t:r},s.offset=function(e,t){return i(e=new Date(+e),null==t?1:Math.floor(t)),e},s.range=function(t,r,n){var a,o=[];if(t=s.ceil(t),n=null==n?1:Math.floor(n),!(t<r&&n>0))return o;do{o.push(a=new Date(+t)),i(t,n),e(t)}while(a<t&&t<r);return o},s.filter=function(t){return n((function(r){if(r>=r)for(;e(r),!t(r);)r.setTime(r-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;i(e,-1),!t(e););else for(;--r>=0;)for(;i(e,1),!t(e););}))},a&&(s.count=function(n,i){return t.setTime(+n),r.setTime(+i),e(t),e(r),Math.floor(a(t,r))},s.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?s.filter(o?function(t){return o(t)%e==0}:function(t){return s.count(0,t)%e==0}):s:null}),s}var i=n((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?e>1?n((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):i:null};var a=i.range,o=1e3,s=6e4,l=36e5,c=864e5,u=6048e5,h=n((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=h.range,p=n((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()})),d=p.range,m=n((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*o-e.getMinutes()*s)}),(function(e,t){e.setTime(+e+t*l)}),(function(e,t){return(t-e)/l}),(function(e){return e.getHours()})),g=m.range,y=n((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)/c}),(function(e){return e.getDate()-1})),v=y.range;function x(e){return n((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*s)/u}))}var _=x(0),b=x(1),w=x(2),T=x(3),k=x(4),A=x(5),M=x(6),S=_.range,E=b.range,C=w.range,I=T.range,L=k.range,P=A.range,z=M.range,D=n((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()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),O=D.range,R=n((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()}));R.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,r){t.setFullYear(t.getFullYear()+r*e)})):null};var F=R.range,B=n((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()})),j=B.range,N=n((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*l)}),(function(e,t){return(t-e)/l}),(function(e){return e.getUTCHours()})),U=N.range,V=n((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/c}),(function(e){return e.getUTCDate()-1})),q=V.range;function H(e){return n((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/u}))}var G=H(0),W=H(1),Z=H(2),Y=H(3),X=H(4),$=H(5),K=H(6),J=G.range,Q=W.range,ee=Z.range,te=Y.range,re=X.range,ne=$.range,ie=K.range,ae=n((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()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),oe=ae.range,se=n((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()}));se.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null};var le=se.range;e.timeDay=y,e.timeDays=v,e.timeFriday=A,e.timeFridays=P,e.timeHour=m,e.timeHours=g,e.timeInterval=n,e.timeMillisecond=i,e.timeMilliseconds=a,e.timeMinute=p,e.timeMinutes=d,e.timeMonday=b,e.timeMondays=E,e.timeMonth=D,e.timeMonths=O,e.timeSaturday=M,e.timeSaturdays=z,e.timeSecond=h,e.timeSeconds=f,e.timeSunday=_,e.timeSundays=S,e.timeThursday=k,e.timeThursdays=L,e.timeTuesday=w,e.timeTuesdays=C,e.timeWednesday=T,e.timeWednesdays=I,e.timeWeek=_,e.timeWeeks=S,e.timeYear=R,e.timeYears=F,e.utcDay=V,e.utcDays=q,e.utcFriday=$,e.utcFridays=ne,e.utcHour=N,e.utcHours=U,e.utcMillisecond=i,e.utcMilliseconds=a,e.utcMinute=B,e.utcMinutes=j,e.utcMonday=W,e.utcMondays=Q,e.utcMonth=ae,e.utcMonths=oe,e.utcSaturday=K,e.utcSaturdays=ie,e.utcSecond=h,e.utcSeconds=f,e.utcSunday=G,e.utcSundays=J,e.utcThursday=X,e.utcThursdays=re,e.utcTuesday=Z,e.utcTuesdays=ee,e.utcWednesday=Y,e.utcWednesdays=te,e.utcWeek=G,e.utcWeeks=J,e.utcYear=se,e.utcYears=le,Object.defineProperty(e,"__esModule",{value:!0})},n("object"==typeof e&&typeof t<"u"?e:(r=r||self).d3=r.d3||{})}}),T=m({"node_modules/d3-time-format/dist/d3-time-format.js"(e,t){var r,n;r=e,n=function(e,t){function r(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 n(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,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function a(e){var a=e.dateTime,o=e.date,l=e.time,c=e.periods,u=e.days,h=e.shortDays,f=e.months,ve=e.shortMonths,xe=p(c),_e=d(c),be=p(u),we=d(u),Te=p(h),ke=d(h),Ae=p(f),Me=d(f),Se=p(ve),Ee=d(ve),Ce={a:function(e){return h[e.getDay()]},A:function(e){return u[e.getDay()]},b:function(e){return ve[e.getMonth()]},B:function(e){return f[e.getMonth()]},c:null,d:O,e:O,f:N,H:R,I:F,j:B,L:j,m:U,M:V,p:function(e){return c[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:ge,s:ye,S:q,u:H,U:G,V:W,w:Z,W:Y,x:null,X:null,y:X,Y:$,Z:K,"%":me},Ie={a:function(e){return h[e.getUTCDay()]},A:function(e){return u[e.getUTCDay()]},b:function(e){return ve[e.getUTCMonth()]},B:function(e){return f[e.getUTCMonth()]},c:null,d:J,e:J,f:ne,H:Q,I:ee,j:te,L:re,m:ie,M:ae,p:function(e){return c[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:ge,s:ye,S:oe,u:se,U:le,V:ce,w:ue,W:he,x:null,X:null,y:fe,Y:pe,Z:de,"%":me},Le={a:function(e,t,r){var n=Te.exec(t.slice(r));return n?(e.w=ke[n[0].toLowerCase()],r+n[0].length):-1},A:function(e,t,r){var n=be.exec(t.slice(r));return n?(e.w=we[n[0].toLowerCase()],r+n[0].length):-1},b:function(e,t,r){var n=Se.exec(t.slice(r));return n?(e.m=Ee[n[0].toLowerCase()],r+n[0].length):-1},B:function(e,t,r){var n=Ae.exec(t.slice(r));return n?(e.m=Me[n[0].toLowerCase()],r+n[0].length):-1},c:function(e,t,r){return De(e,a,t,r)},d:A,e:A,f:L,H:S,I:S,j:M,L:I,m:k,M:E,p:function(e,t,r){var n=xe.exec(t.slice(r));return n?(e.p=_e[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:z,s:D,S:C,u:g,U:y,V:v,w:m,W:x,x:function(e,t,r){return De(e,o,t,r)},X:function(e,t,r){return De(e,l,t,r)},y:b,Y:_,Z:w,"%":P};function Pe(e,t){return function(r){var n,i,a,o=[],l=-1,c=0,u=e.length;for(r instanceof Date||(r=new Date(+r));++l<u;)37===e.charCodeAt(l)&&(o.push(e.slice(c,l)),null!=(i=s[n=e.charAt(++l)])?n=e.charAt(++l):i="e"===n?" ":"0",(a=t[n])&&(n=a(r,i)),o.push(n),c=l+1);return o.push(e.slice(c,l)),o.join("")}}function ze(e,a){return function(o){var s,l,c=i(1900,void 0,1);if(De(c,e,o+="",0)!=o.length)return null;if("Q"in c)return new Date(c.Q);if("s"in c)return new Date(1e3*c.s+("L"in c?c.L:0));if(a&&!("Z"in c)&&(c.Z=0),"p"in c&&(c.H=c.H%12+12*c.p),void 0===c.m&&(c.m="q"in c?c.q:0),"V"in c){if(c.V<1||c.V>53)return null;"w"in c||(c.w=1),"Z"in c?(l=(s=n(i(c.y,0,1))).getUTCDay(),s=l>4||0===l?t.utcMonday.ceil(s):t.utcMonday(s),s=t.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(i(c.y,0,1))).getDay(),s=l>4||0===l?t.timeMonday.ceil(s):t.timeMonday(s),s=t.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),l="Z"in c?n(i(c.y,0,1)).getUTCDay():r(i(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function De(e,t,r,n){for(var i,a,o=0,l=t.length,c=r.length;o<l;){if(n>=c)return-1;if(37===(i=t.charCodeAt(o++))){if(i=t.charAt(o++),!(a=Le[i in s?t.charAt(o++):i])||(n=a(e,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Ce.x=Pe(o,Ce),Ce.X=Pe(l,Ce),Ce.c=Pe(a,Ce),Ie.x=Pe(o,Ie),Ie.X=Pe(l,Ie),Ie.c=Pe(a,Ie),{format:function(e){var t=Pe(e+="",Ce);return t.toString=function(){return e},t},parse:function(e){var t=ze(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=Pe(e+="",Ie);return t.toString=function(){return e},t},utcParse:function(e){var t=ze(e+="",!0);return t.toString=function(){return e},t}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function h(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(t)+i:i)}function f(e){return e.replace(u,"\\$&")}function p(e){return new RegExp("^(?:"+e.map(f).join("|")+")","i")}function d(e){for(var t={},r=-1,n=e.length;++r<n;)t[e[r].toLowerCase()]=r;return t}function m(e,t,r){var n=l.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function g(e,t,r){var n=l.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function y(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function v(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function x(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function _(e,t,r){var n=l.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function b(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function w(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(e,t,r){var n=l.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function k(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function A(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function M(e,t,r){var n=l.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function S(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function E(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function C(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function I(e,t,r){var n=l.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function L(e,t,r){var n=l.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function P(e,t,r){var n=c.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function z(e,t,r){var n=l.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function D(e,t,r){var n=l.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function O(e,t){return h(e.getDate(),t,2)}function R(e,t){return h(e.getHours(),t,2)}function F(e,t){return h(e.getHours()%12||12,t,2)}function B(e,r){return h(1+t.timeDay.count(t.timeYear(e),e),r,3)}function j(e,t){return h(e.getMilliseconds(),t,3)}function N(e,t){return j(e,t)+"000"}function U(e,t){return h(e.getMonth()+1,t,2)}function V(e,t){return h(e.getMinutes(),t,2)}function q(e,t){return h(e.getSeconds(),t,2)}function H(e){var t=e.getDay();return 0===t?7:t}function G(e,r){return h(t.timeSunday.count(t.timeYear(e)-1,e),r,2)}function W(e,r){var n=e.getDay();return e=n>=4||0===n?t.timeThursday(e):t.timeThursday.ceil(e),h(t.timeThursday.count(t.timeYear(e),e)+(4===t.timeYear(e).getDay()),r,2)}function Z(e){return e.getDay()}function Y(e,r){return h(t.timeMonday.count(t.timeYear(e)-1,e),r,2)}function X(e,t){return h(e.getFullYear()%100,t,2)}function $(e,t){return h(e.getFullYear()%1e4,t,4)}function K(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+h(t/60|0,"0",2)+h(t%60,"0",2)}function J(e,t){return h(e.getUTCDate(),t,2)}function Q(e,t){return h(e.getUTCHours(),t,2)}function ee(e,t){return h(e.getUTCHours()%12||12,t,2)}function te(e,r){return h(1+t.utcDay.count(t.utcYear(e),e),r,3)}function re(e,t){return h(e.getUTCMilliseconds(),t,3)}function ne(e,t){return re(e,t)+"000"}function ie(e,t){return h(e.getUTCMonth()+1,t,2)}function ae(e,t){return h(e.getUTCMinutes(),t,2)}function oe(e,t){return h(e.getUTCSeconds(),t,2)}function se(e){var t=e.getUTCDay();return 0===t?7:t}function le(e,r){return h(t.utcSunday.count(t.utcYear(e)-1,e),r,2)}function ce(e,r){var n=e.getUTCDay();return e=n>=4||0===n?t.utcThursday(e):t.utcThursday.ceil(e),h(t.utcThursday.count(t.utcYear(e),e)+(4===t.utcYear(e).getUTCDay()),r,2)}function ue(e){return e.getUTCDay()}function he(e,r){return h(t.utcMonday.count(t.utcYear(e)-1,e),r,2)}function fe(e,t){return h(e.getUTCFullYear()%100,t,2)}function pe(e,t){return h(e.getUTCFullYear()%1e4,t,4)}function de(){return"+0000"}function me(){return"%"}function ge(e){return+e}function ye(e){return Math.floor(+e/1e3)}function ve(t){return o=a(t),e.timeFormat=o.format,e.timeParse=o.parse,e.utcFormat=o.utcFormat,e.utcParse=o.utcParse,o}ve({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"]});var xe="%Y-%m-%dT%H:%M:%S.%LZ",_e=Date.prototype.toISOString?function(e){return e.toISOString()}:e.utcFormat(xe),be=+new Date("2000-01-01T00:00:00.000Z")?function(e){var t=new Date(e);return isNaN(t)?null:t}:e.utcParse(xe);e.isoFormat=_e,e.isoParse=be,e.timeFormatDefaultLocale=ve,e.timeFormatLocale=a,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&typeof t<"u"?n(e,w()):n((r=r||self).d3=r.d3||{},r.d3)}}),k=m({"node_modules/d3-format/dist/d3-format.js"(e,t){var r,n;r=e,n=function(e){function t(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function r(e){return(e=t(Math.abs(e)))?e[1]:NaN}var n,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(e){if(!(t=i.exec(e)))throw new Error("invalid format: "+e);var t;return new o({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function o(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function s(e,r){var n=t(e,r);if(!n)return e+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},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 s(100*e,t)},r:s,s:function(e,r){var i=t(e,r);if(!i)return e+"";var a=i[0],o=i[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+t(e,Math.max(0,r+s-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function c(e){return e}var u,h=Array.prototype.map,f=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function p(e){var t=void 0===e.grouping||void 0===e.thousands?c:function(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}(h.call(e.grouping,Number),e.thousands+""),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",u=void 0===e.numerals?c:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(h.call(e.numerals,String)),p=void 0===e.percent?"%":e.percent+"",d=void 0===e.minus?"-":e.minus+"",m=void 0===e.nan?"NaN":e.nan+"";function g(e){var r=(e=a(e)).fill,c=e.align,h=e.sign,g=e.symbol,y=e.zero,v=e.width,x=e.comma,_=e.precision,b=e.trim,w=e.type;"n"===w?(x=!0,w="g"):l[w]||(void 0===_&&(_=12),b=!0,w="g"),(y||"0"===r&&"="===c)&&(y=!0,r="0",c="=");var T="$"===g?i:"#"===g&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",k="$"===g?o:/[%p]/.test(w)?p:"",A=l[w],M=/[defgprs%]/.test(w);function S(e){var i,a,o,l=T,p=k;if("c"===w)p=A(e)+p,e="";else{var g=(e=+e)<0||1/e<0;if(e=isNaN(e)?m:A(Math.abs(e),_),b&&(e=function(e){e:for(var t,r=e.length,n=1,i=-1;n<r;++n)switch(e[n]){case".":i=t=n;break;case"0":0===i&&(i=n),t=n;break;default:if(!+e[n])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),g&&0==+e&&"+"!==h&&(g=!1),l=(g?"("===h?h:d:"-"===h||"("===h?"":h)+l,p=("s"===w?f[8+n/3]:"")+p+(g&&"("===h?")":""),M)for(i=-1,a=e.length;++i<a;)if(48>(o=e.charCodeAt(i))||o>57){p=(46===o?s+e.slice(i+1):e.slice(i))+p,e=e.slice(0,i);break}}x&&!y&&(e=t(e,1/0));var S=l.length+e.length+p.length,E=S<v?new Array(v-S+1).join(r):"";switch(x&&y&&(e=t(E+e,E.length?v-p.length:1/0),E=""),c){case"<":e=l+e+p+E;break;case"=":e=l+E+e+p;break;case"^":e=E.slice(0,S=E.length>>1)+l+e+p+E.slice(S);break;default:e=E+l+e+p}return u(e)}return _=void 0===_?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),S.toString=function(){return e+""},S}return{format:g,formatPrefix:function(e,t){var n=g(((e=a(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(r(t)/3))),o=Math.pow(10,-i),s=f[8+i/3];return function(e){return n(o*e)+s}}}}function d(t){return u=p(t),e.format=u.format,e.formatPrefix=u.formatPrefix,u}d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),e.FormatSpecifier=o,e.formatDefaultLocale=d,e.formatLocale=p,e.formatSpecifier=a,e.precisionFixed=function(e){return Math.max(0,-r(Math.abs(e)))},e.precisionPrefix=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(t)/3)))-r(Math.abs(e)))},e.precisionRound=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,r(t)-r(e))+1},Object.defineProperty(e,"__esModule",{value:!0})},n("object"==typeof e&&typeof t<"u"?e:(r=typeof globalThis<"u"?globalThis:r||self).d3=r.d3||{})}}),A=m({"node_modules/is-string-blank/index.js"(e,t){t.exports=function(e){for(var t,r=e.length,n=0;n<r;n++)if(((t=e.charCodeAt(n))<9||t>13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}}}),M=m({"node_modules/fast-isnumeric/index.js"(e,t){var r=A();t.exports=function(e){var t=typeof e;if("string"===t){var n=e;if(0==(e=+e)&&r(n))return!1}else if("number"!==t)return!1;return e-e<1}}}),S=m({"src/constants/numerical.js"(e,t){t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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:"−"}}}),E=m({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(e,t){var r,n;r=e,n=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=typeof Uint8Array>"u"?[]:new Uint8Array(256),n=0;n<64;n++)r[t.charCodeAt(n)]=n;e.decode=function(e){var t,n,i,a,o,s=.75*e.length,l=e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var u=new ArrayBuffer(s),h=new Uint8Array(u);for(t=0;t<l;t+=4)n=r[e.charCodeAt(t)],i=r[e.charCodeAt(t+1)],a=r[e.charCodeAt(t+2)],o=r[e.charCodeAt(t+3)],h[c++]=n<<2|i>>4,h[c++]=(15&i)<<4|a>>2,h[c++]=(3&a)<<6|63&o;return u},e.encode=function(e){var r,n=new Uint8Array(e),i=n.length,a="";for(r=0;r<i;r+=3)a+=t[n[r]>>2],a+=t[(3&n[r])<<4|n[r+1]>>4],a+=t[(15&n[r+1])<<2|n[r+2]>>6],a+=t[63&n[r+2]];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})},n("object"==typeof e&&typeof t<"u"?e:(r=typeof globalThis<"u"?globalThis:r||self)["base64-arraybuffer"]={})}}),C=m({"src/lib/is_plain_object.js"(e,t){t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}}}),I=m({"src/lib/array.js"(e){var t=E().decode,r=C(),n=Array.isArray,i=ArrayBuffer,a=DataView;function o(e){return i.isView(e)&&!(e instanceof a)}function s(e){return n(e)||o(e)}e.isTypedArray=o,e.isArrayOrTypedArray=s,e.isArray1D=function(e){return!s(e[0])},e.ensureArray=function(e,t){return n(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};function c(e){return e.constructor===ArrayBuffer}function u(e,t,r){if(s(e)){if(s(e[0])){for(var n=r,i=0;i<e.length;i++)n=t(n,e[i].length);return n}return e.length}return 0}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,e.isArrayBuffer=c,e.decodeTypedArraySpec=function(e){var r=[],n=function(e){return{bdata:e.bdata,dtype:e.dtype,shape:e.shape}}(e),i=n.dtype,a=l[i];if(!a)throw new Error('Error in dtype: "'+i+'"');var o=a.BYTES_PER_ELEMENT,s=n.bdata;c(s)||(s=t(s));var u=void 0===n.shape?[s.byteLength/o]:(""+n.shape).split(",");u.reverse();var h,f,p=u.length,d=+u[0],m=o*d,g=0;if(1===p)r=new a(s);else if(2===p)for(h=+u[1],f=0;f<h;f++)r[f]=new a(s,g,d),g+=m;else{if(3!==p)throw new Error("ndim: "+p+'is not supported with the shape:"'+n.shape+'"');h=+u[1];for(var y=+u[2],v=0;v<y;v++)for(r[v]=[],f=0;f<h;f++)r[v][f]=new a(s,g,d),g+=m}return r.bdata=n.bdata,r.dtype=n.dtype,r.shape=u.reverse().join(","),e._inputArray=r,r},e.isTypedArraySpec=function(e){return r(e)&&e.hasOwnProperty("dtype")&&"string"==typeof e.dtype&&e.hasOwnProperty("bdata")&&("string"==typeof e.bdata||c(e.bdata))&&(void 0===e.shape||e.hasOwnProperty("shape")&&("string"==typeof e.shape||"number"==typeof e.shape))},e.concat=function(){var e,t,r,i,a,o,s,l,c=[],u=!0,h=0;for(r=0;r<arguments.length;r++)(o=(i=arguments[r]).length)&&(t?c.push(i):(t=i,a=o),n(i)?e=!1:(u=!1,h?e!==i.constructor&&(e=!1):e=i.constructor),h+=o);if(!h)return[];if(!c.length)return t;if(u)return t.concat.apply(t,c);if(e){for((s=new e(h)).set(t),r=0;r<c.length;r++)i=c[r],s.set(i,a),a+=i.length;return s}for(s=new Array(h),l=0;l<t.length;l++)s[l]=t[l];for(r=0;r<c.length;r++){for(i=c[r],l=0;l<i.length;l++)s[a+l]=i[l];a+=l}return s},e.maxRowLength=function(e){return u(e,Math.max,0)},e.minRowLength=function(e){return u(e,Math.min,1/0)}}}),L=m({"src/lib/nested_property.js"(e,t){var r=M(),n=I().isArrayOrTypedArray;function i(e,t){return function(r){var a,o,s,l,c,u=e;for(l=0;l<t.length-1;l++){if(-1===(a=t[l])){for(o=!0,s=[],c=0;c<u.length;c++)s[c]=i(u[c],t.slice(l+1))(r),s[c]!==s[0]&&(o=!1);return o?s[0]:s}if("number"==typeof a&&!n(u)||"object"!=typeof(u=u[a])||null===u)return}if("object"==typeof u&&null!==u&&(s=u[t[l]],r||null!==s))return s}}t.exports=function(e,t){if(r(t))t=String(t);else if("string"!=typeof t||"[-1]"===t.slice(-4))throw"bad property string";var n,a,o,l,c=t.split(".");for(l=0;l<c.length;l++)if("__"===String(c[l]).slice(0,2))throw"bad property string";for(l=0;l<c.length;){if(n=String(c[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(n[1])c[l]=n[1];else{if(0!==l)throw"bad property string";c.splice(0,1)}for(a=n[2].slice(1,-1).split("]["),o=0;o<a.length;o++)l++,c.splice(l,0,Number(a[o]))}l++}return"object"!=typeof e?function(e,t,r){return{set:function(){throw"bad container"},get:function(){},astr:t,parts:r,obj:e}}(e,t,c):{set:s(e,c,t),get:i(e,c),astr:t,parts:c,obj:e}};var a=/(^|\.)args\[/;function o(e,t){return void 0===e||null===e&&!t.match(a)}function s(e,t,r){return function(i){var a,s,h=e,f="",p=[[e,f]],d=o(i,r);for(s=0;s<t.length-1;s++){if("number"==typeof(a=t[s])&&!n(h))throw"array index but container is not an array";if(-1===a){if(d=!c(h,t.slice(s+1),i,r))break;return}if(!u(h,a,t[s+1],d))break;if("object"!=typeof(h=h[a])||null===h)throw"container is not an object";f=l(f,a),p.push([h,f])}if(d){if(s===t.length-1&&(delete h[t[s]],Array.isArray(h)&&+t[s]==h.length-1))for(;h.length&&void 0===h[h.length-1];)h.pop()}else h[t[s]]=i}}function l(e,t){var n=t;return r(t)?n="["+t+"]":e&&(n="."+t),e+n}function c(e,t,r,i){var a,l=n(r),c=!0,h=r,f=i.replace("-1",0),p=!l&&o(r,f),d=t[0];for(a=0;a<e.length;a++)f=i.replace("-1",a),l&&(p=o(h=r[a%r.length],f)),p&&(c=!1),u(e,a,d,p)&&s(e[a],t,i.replace("-1",a))(h);return c}function u(e,t,r,n){if(void 0===e[t]){if(n)return!1;e[t]="number"==typeof r?[]:{}}return!0}}}),P=m({"src/lib/keyed_container.js"(e,t){var r=L(),n=/^\w*$/;t.exports=function(e,t,i,a){i=i||"name",a=a||"value";var o,s,l,c={};t&&t.length?(l=r(e,t),s=l.get()):s=e,t=t||"";var u={};if(s)for(o=0;o<s.length;o++)u[s[o][i]]=o;var h=n.test(a),f={set:function(e,t){var n=null===t?4:0;if(!s){if(!l||4===n)return;s=[],l.set(s)}var o=u[e];if(void 0===o){if(4===n)return;n|=3,o=s.length,u[e]=o}else t!==(h?s[o][a]:r(s[o],a).get())&&(n|=2);var p=s[o]=s[o]||{};return p[i]=e,h?p[a]=t:r(p,a).set(t),null!==t&&(n&=-5),c[o]=c[o]|n,f},get:function(e){if(s){var t=u[e];if(void 0!==t)return h?s[t][a]:r(s[t],a).get()}},rename:function(e,t){var r=u[e];return void 0===r||(c[r]=1|c[r],u[t]=r,delete u[e],s[r][i]=t),f},remove:function(e){var t=u[e];if(void 0===t)return f;var n=s[t];if(Object.keys(n).length>2)return c[t]=2|c[t],f.set(e,null);if(h){for(o=t;o<s.length;o++)c[o]=3|c[o];for(o=t;o<s.length;o++)u[s[o][i]]--;s.splice(t,1),delete u[e]}else r(n,a).set(null),c[t]=6|c[t];return f},constructUpdate:function(){for(var e,n,o={},l=Object.keys(c),u=0;u<l.length;u++)n=l[u],e=t+"["+n+"]",s[n]?(1&c[n]&&(o[e+"."+i]=s[n][i]),2&c[n]&&(o[e+"."+a]=h?4&c[n]?null:s[n][a]:4&c[n]?null:r(s[n],a).get())):o[e]=null;return o}};return f}}}),z=m({"src/lib/relative_attr.js"(e,t){var r=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,n=/^[^\.\[\]]+$/;t.exports=function(e,t){for(;t;){var i=e.match(r);if(i)e=i[1];else{if(!e.match(n))throw new Error("bad relativeAttr call:"+[e,t]);e=""}if("^"!==t.charAt(0))break;t=t.slice(1)}return e&&"["!==t.charAt(0)?e+"."+t:e+t}}}),D=m({"src/lib/to_log_range.js"(e,t){var r=M();t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var n=Math.log(Math.min(t[0],t[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),n}}}),O=m({"src/lib/relink_private.js"(e,t){var r=I().isArrayOrTypedArray,n=C();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)||"function"==typeof o){if(a in t)continue;t[a]=o}else if(r(o)&&r(s)&&n(o[0])){if("customdata"===a||"ids"===a)continue;for(var l=Math.min(o.length,s.length),c=0;c<l;c++)s[c]!==o[c]&&n(o[c])&&n(s[c])&&e(s[c],o[c])}else n(o)&&n(s)&&(e(s,o),Object.keys(s).length||delete t[a])}}}}),R=m({"src/lib/mod.js"(e,t){t.exports={mod:function(e,t){var r=e%t;return r<0?r+t:r},modHalf:function(e,t){return Math.abs(e)>t/2?e-Math.round(e/t)*t:e}}}}),F=m({"node_modules/tinycolor2/tinycolor.js"(e,t){!function(e){var r=/^\s+/,n=/\s+$/,i=0,a=e.round,o=e.min,s=e.max,l=e.random;function c(t,l){if(l=l||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,l);var u=function(t){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,h=!1,f=!1;return"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,i=!1;if(S[e])e=S[e],i=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=N.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=N.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=N.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=N.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=N.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=N.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=N.hex8.exec(e))?{r:P(t[1]),g:P(t[2]),b:P(t[3]),a:R(t[4]),format:i?"name":"hex8"}:(t=N.hex6.exec(e))?{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:i?"name":"hex"}:(t=N.hex4.exec(e))?{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:R(t[4]+""+t[4]),format:i?"name":"hex8"}:!!(t=N.hex3.exec(e))&&{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:i?"name":"hex"}}(t)),"object"==typeof t&&(U(t.r)&&U(t.g)&&U(t.b)?(i=function(e,t,r){return{r:255*I(e,255),g:255*I(t,255),b:255*I(r,255)}}(t.r,t.g,t.b),h=!0,f="%"===String(t.r).substr(-1)?"prgb":"rgb"):U(t.h)&&U(t.s)&&U(t.v)?(l=D(t.s),c=D(t.v),i=function(t,r,n){t=6*I(t,360),r=I(r,100),n=I(n,100);var i=e.floor(t),a=t-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(t.h,l,c),h=!0,f="hsv"):U(t.h)&&U(t.s)&&U(t.l)&&(l=D(t.s),u=D(t.l),i=function(e,t,r){var n,i,a;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=I(e,360),t=I(t,100),r=I(r,100),0===t)n=i=a=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=o(l,s,e+1/3),i=o(l,s,e),a=o(l,s,e-1/3)}return{r:255*n,g:255*i,b:255*a}}(t.h,l,u),h=!0,f="hsl"),t.hasOwnProperty("a")&&(a=t.a)),a=C(a),{ok:h,format:t.format||f,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.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=u.ok,this._tc_id=i++}function u(e,t,r){e=I(e,255),t=I(t,255),r=I(r,255);var n,i,a=s(e,t,r),l=o(e,t,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:i,l:c}}function h(e,t,r){e=I(e,255),t=I(t,255),r=I(r,255);var n,i,a=s(e,t,r),l=o(e,t,r),c=a,u=a-l;if(i=0===a?0:u/a,a==l)n=0;else{switch(a){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:i,v:c}}function f(e,t,r,n){var i=[z(a(e).toString(16)),z(a(t).toString(16)),z(a(r).toString(16))];return n&&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 p(e,t,r,n){return[z(O(n)),z(a(e).toString(16)),z(a(t).toString(16)),z(a(r).toString(16))].join("")}function d(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s-=t/100,r.s=L(r.s),c(r)}function m(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s+=t/100,r.s=L(r.s),c(r)}function g(e){return c(e).desaturate(100)}function y(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l+=t/100,r.l=L(r.l),c(r)}function v(e,t){t=0===t?0:t||10;var r=c(e).toRgb();return r.r=s(0,o(255,r.r-a(-t/100*255))),r.g=s(0,o(255,r.g-a(-t/100*255))),r.b=s(0,o(255,r.b-a(-t/100*255))),c(r)}function x(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l-=t/100,r.l=L(r.l),c(r)}function _(e,t){var r=c(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,c(r)}function b(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function w(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+120)%360,s:t.s,l:t.l}),c({h:(r+240)%360,s:t.s,l:t.l})]}function T(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+90)%360,s:t.s,l:t.l}),c({h:(r+180)%360,s:t.s,l:t.l}),c({h:(r+270)%360,s:t.s,l:t.l})]}function k(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+72)%360,s:t.s,l:t.l}),c({h:(r+216)%360,s:t.s,l:t.l})]}function A(e,t,r){t=t||6,r=r||30;var n=c(e).toHsl(),i=360/r,a=[c(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(c(n));return a}function M(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/t;t--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%1;return o}c.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(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,i=this.toRgb();return t=i.r/255,r=i.g/255,n=i.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=a(100*this._a)/100,this},toHsv:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=h(this._r,this._g,this._b),t=a(360*e.h),r=a(100*e.s),n=a(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=a(360*e.h),r=a(100*e.s),n=a(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return f(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,i){var o=[z(a(e).toString(16)),z(a(t).toString(16)),z(a(r).toString(16)),z(O(n))];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("")}(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 1==this._a?"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(100*I(this._r,255))+"%",g:a(100*I(this._g,255))+"%",b:a(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*I(this._r,255))+"%, "+a(100*I(this._g,255))+"%, "+a(100*I(this._b,255))+"%)":"rgba("+a(100*I(this._r,255))+"%, "+a(100*I(this._g,255))+"%, "+a(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=c(e);r="#"+p(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(_,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(b,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:D(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),i=c(t).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(t,r){var n=c(t),i=c(r);return(e.max(n.getLuminance(),i.getLuminance())+.05)/(e.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,i,a=c.readability(e,t);switch(i=!1,n=function(e){var t,r;return"AA"!==(t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==t&&(t="AA"),"small"!==(r=(e.size||"small").toLowerCase())&&"large"!==r&&(r="small"),{level:t,size:r}}(r),n.level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(e,t,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;u<t.length;u++)(n=c.readability(e,t[u]))>l&&(l=n,s=c(t[u]));return c.isReadable(e,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var S=c.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"},E=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(S);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function I(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,s(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function L(e){return o(1,s(0,e))}function P(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function D(e){return e<=1&&(e=100*e+"%"),e}function O(t){return e.round(255*parseFloat(t)).toString(16)}function R(e){return P(e)/255}var F,B,j,N=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",j="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+j),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 U(e){return!!N.CSS_UNIT.exec(e)}typeof t<"u"&&t.exports?t.exports=c:window.tinycolor=c}(Math)}}),B=m({"src/lib/extend.js"(e){var t=C(),r=Array.isArray;function n(e,i,a,o){var s,l,c,u,h,f,p,d=e[0],m=e.length;if(2===m&&r(d)&&r(e[1])&&0===d.length){if(p=function(e,t){var r,n;for(r=0;r<e.length;r++){if(null!==(n=e[r])&&"object"==typeof n)return!1;void 0!==n&&(t[r]=n)}return!0}(e[1],d),p)return d;d.splice(0,d.length)}for(var g=1;g<m;g++)for(l in s=e[g])c=d[l],u=s[l],o&&r(u)?d[l]=u:i&&u&&(t(u)||(h=r(u)))?(h?(h=!1,f=c&&r(c)?c:[]):f=c&&t(c)?c:{},d[l]=n([f,u],i,a,o)):(typeof u<"u"||a)&&(d[l]=u);return d}e.extendFlat=function(){return n(arguments,!1,!1,!1)},e.extendDeep=function(){return n(arguments,!0,!1,!1)},e.extendDeepAll=function(){return n(arguments,!0,!0,!1)},e.extendDeepNoArrays=function(){return n(arguments,!0,!1,!0)}}}),j=m({"src/plots/font_attributes.js"(e,t){t.exports=function(e){var t=e.variantValues,r=e.editType,n=e.colorEditType;void 0===n&&(n=r);var i={editType:r,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:r},size:{valType:"number",min:1,editType:r},color:{valType:"color",editType:n},weight:i,style:{editType:r,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:e.noFontVariant?void 0:{editType:r,valType:"enumerated",values:t||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:e.noFontTextcase?void 0:{editType:r,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:e.noFontLineposition?void 0:{editType:r,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:e.noFontShadow?void 0:{editType:r,valType:"string",dflt:e.autoShadowDflt?"auto":"none"},editType:r};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}}}),N=m({"src/components/fx/constants.js"(e,t){t.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}}),U=m({"src/components/fx/layout_attributes.js"(e,t){var r=N(),n=j(),i=n({editType:"none"});i.family.dflt=r.HOVERFONT,i.size.dflt=r.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:n({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"}}}}),V=m({"src/components/fx/attributes.js"(e,t){var r=j(),n=U().hoverlabel,i=B().extendFlat;t.exports={hoverlabel:{bgcolor:i({},n.bgcolor,{arrayOk:!0}),bordercolor:i({},n.bordercolor,{arrayOk:!0}),font:r({arrayOk:!0,editType:"none"}),align:i({},n.align,{arrayOk:!0}),namelength:i({},n.namelength,{arrayOk:!0}),showarrow:i({},n.showarrow),editType:"none"}}}}),q=m({"src/plots/attributes.js"(e,t){var r=j(),n=V();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:r({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:n.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"}}}}),H=m({"src/components/colorscale/scales.js"(e,t){var r=F(),n={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=n.RdBu;function a(e){var t=0;if(!Array.isArray(e)||e.length<2||!e[0]||!e[e.length-1]||0!=+e[0][0]||1!=+e[e.length-1][0])return!1;for(var n=0;n<e.length;n++){var i=e[n];if(2!==i.length||+i[0]<t||!r(i[1]).isValid())return!1;t=+i[0]}return!0}t.exports={scales:n,defaultScale:i,get:function(e,t){if(t||(t=i),!e)return t;function r(){try{e=n[e]||JSON.parse(e)}catch{e=t}}return"string"==typeof e&&(r(),"string"==typeof e&&r()),a(e)?e:t},isValid:function(e){return void 0!==n[e]||a(e)}}}}),G=m({"src/components/color/attributes.js"(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}}),W=m({"src/components/color/index.js"(e,t){var r=F(),n=M(),i=I().isTypedArray,a=t.exports={},o=G();a.defaults=o.defaults;var s=a.defaultLine=o.defaultLine;a.lightLine=o.lightLine;var l=a.background=o.background;function c(e){if(n(e)||"string"!=typeof e)return e;var t=e.trim();if("rgb"!==t.slice(0,3))return e;var r=t.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return e;var i=r[1].trim().split(/\s*[\s,]\s*/),a="a"===t.charAt(3)&&4===i.length;if(!a&&3!==i.length)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(3===o)i[o]>1&&(i[o]=1);else if(i[o]>=1)return e}var s=Math.round(255*i[0])+", "+Math.round(255*i[1])+", "+Math.round(255*i[2]);return a?"rgba("+s+", "+i[3]+")":"rgb("+s+")"}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(r(e))},a.opacity=function(e){return e?r(e).getAlpha():0},a.addOpacity=function(e,t){var n=r(e).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+t+")"},a.combine=function(e,t){var n=r(e).toRgb();if(1===n.a)return r(e).toRgbString();var i=r(t||l).toRgb(),a=1===i.a?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},o={r:a.r*(1-n.a)+n.r*n.a,g:a.g*(1-n.a)+n.g*n.a,b:a.b*(1-n.a)+n.b*n.a};return r(o).toRgbString()},a.interpolate=function(e,t,n){var i=r(e).toRgb(),a=r(t).toRgb(),o={r:n*i.r+(1-n)*a.r,g:n*i.g+(1-n)*a.g,b:n*i.b+(1-n)*a.b};return r(o).toRgbString()},a.contrast=function(e,t,n){var i=r(e);return 1!==i.getAlpha()&&(i=r(a.combine(e,l))),(i.isDark()?t?i.lighten(t):l:n?i.darken(n):s).toString()},a.stroke=function(e,t){var n=r(t);e.style({stroke:a.tinyRGB(n),"stroke-opacity":n.getAlpha()})},a.fill=function(e,t){var n=r(t);e.style({fill:a.tinyRGB(n),"fill-opacity":n.getAlpha()})},a.clean=function(e){if(e&&"object"==typeof e){var t,r,n,o,s=Object.keys(e);for(t=0;t<s.length;t++)if(o=e[n=s[t]],"color"===n.slice(-5))if(Array.isArray(o))for(r=0;r<o.length;r++)o[r]=c(o[r]);else e[n]=c(o);else if("colorscale"===n.slice(-10)&&Array.isArray(o))for(r=0;r<o.length;r++)Array.isArray(o[r])&&(o[r][1]=c(o[r][1]));else if(Array.isArray(o)){var l=o[0];if(!Array.isArray(l)&&l&&"object"==typeof l)for(r=0;r<o.length;r++)a.clean(o[r])}else o&&"object"==typeof o&&!i(o)&&a.clean(o)}}}}),Z=m({"src/constants/interactions.js"(e,t){t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),Y=m({"src/lib/regex.js"(e){e.counter=function(e,t,r,n){var i=(t||"")+(r?"":"$"),a=!1===n?"":"^";return"xy"===e?new RegExp(a+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+i):new RegExp(a+e+"([2-9]|[1-9][0-9]+)?"+i)}}}),X=m({"src/lib/coerce.js"(e){var t=M(),r=F(),n=B().extendFlat,i=q(),a=H(),o=W(),s=Z().DESELECTDIM,l=L(),c=Y().counter,u=R().modHalf,h=I().isArrayOrTypedArray,f=I().isTypedArraySpec,p=I().decodeTypedArraySpec;function d(t,r){var n=e.valObjectMeta[r.valType];if(r.arrayOk&&h(t))return!0;if(n.validateFunction)return n.validateFunction(t,r);var i={},a=i,o={set:function(e){a=e}};return n.coerceFunction(t,o,i,r),a!==i}e.valObjectMeta={data_array:{coerceFunction:function(e,t,r){t.set(h(e)?e:f(e)?p(e):r)}},enumerated:{coerceFunction:function(e,t,r,n){n.coerceNumber&&(e=+e),-1===n.values.indexOf(e)?t.set(r):t.set(e)},validateFunction:function(e,t){t.coerceNumber&&(e=+e);for(var r=t.values,n=0;n<r.length;n++){var i=String(r[n]);if("/"===i.charAt(0)&&"/"===i.charAt(i.length-1)){if(new RegExp(i.slice(1,-1)).test(e))return!0}else if(e===r[n])return!0}return!1}},boolean:{coerceFunction:function(e,t,r,n){let i=e=>!0===e||!1===e;i(e)||n.arrayOk&&Array.isArray(e)&&e.length>0&&e.every(i)?t.set(e):t.set(r)}},number:{coerceFunction:function(e,r,n,i){f(e)&&(e=p(e)),!t(e)||void 0!==i.min&&e<i.min||void 0!==i.max&&e>i.max?r.set(n):r.set(+e)}},integer:{coerceFunction:function(e,r,n,i){-1===(i.extras||[]).indexOf(e)?(f(e)&&(e=p(e)),e%1||!t(e)||void 0!==i.min&&e<i.min||void 0!==i.max&&e>i.max?r.set(n):r.set(+e)):r.set(e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var i="number"==typeof e;!0!==n.strict&&i?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,n){f(e)&&(e=p(e)),r(e).isValid()?t.set(e):t.set(n)}},colorlist:{coerceFunction:function(e,t,n){Array.isArray(e)&&e.length&&e.every((function(e){return r(e).isValid()}))?t.set(e):t.set(n)}},colorscale:{coerceFunction:function(e,t,r){t.set(a.get(e,r))}},angle:{coerceFunction:function(e,r,n){f(e)&&(e=p(e)),"auto"===e?r.set("auto"):t(e)?r.set(u(+e,360)):r.set(n)}},subplotid:{coerceFunction:function(e,t,r,n){var i=n.regex||c(r);let a=e=>"string"==typeof e&&i.test(e);a(e)||n.arrayOk&&h(e)&&e.length>0&&e.every(a)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if(-1===(n.extras||[]).indexOf(e))if("string"==typeof e){for(var i=e.split("+"),a=0;a<i.length;){var o=i[a];-1===n.flags.indexOf(o)||i.indexOf(o)<a?i.splice(a,1):a++}i.length?t.set(i.join("+")):t.set(r)}else t.set(r);else t.set(e)}},any:{coerceFunction:function(e,t,r){void 0===e?t.set(r):t.set(f(e)?p(e):e)}},info_array:{coerceFunction:function(t,r,n,i){function a(t,r,n){var i,a={set:function(e){i=e}};return void 0===n&&(n=r.dflt),e.valObjectMeta[r.valType].coerceFunction(t,a,n,r),i}if(f(t)&&(t=p(t)),h(t)){var o,s,l,c,u,d,m=2===i.dimensions||"1-2"===i.dimensions&&Array.isArray(t)&&h(t[0]),g=i.items,y=[],v=Array.isArray(g),x=v&&m&&h(g[0]),_=m&&v&&!x,b=v&&!_?g.length:t.length;if(n=Array.isArray(n)?n:[],m)for(o=0;o<b;o++)for(y[o]=[],l=h(t[o])?t[o]:[],u=_?g.length:v?g[o].length:l.length,s=0;s<u;s++)c=_?g[s]:v?g[o][s]:g,void 0!==(d=a(l[s],c,(n[o]||[])[s]))&&(y[o][s]=d);else for(o=0;o<b;o++)void 0!==(d=a(t[o],v?g[o]:g,n[o]))&&(y[o]=d);r.set(y)}else r.set(n)},validateFunction:function(e,t){if(!h(e))return!1;var r=t.items,n=Array.isArray(r),i=2===t.dimensions;if(!t.freeLength&&e.length!==r.length)return!1;for(var a=0;a<e.length;a++)if(i){if(!h(e[a])||!t.freeLength&&e[a].length!==r[a].length)return!1;for(var o=0;o<e[a].length;o++)if(!d(e[a][o],n?r[a][o]:r))return!1}else if(!d(e[a],n?r[a]:r))return!1;return!0}}},e.coerce=function(t,r,n,i,a){var o=l(n,i).get(),s=l(t,i),c=l(r,i),u=s.get(),m=r._template;if(void 0===u&&m&&(u=l(m,i).get(),m=0),void 0===a&&(a=o.dflt),o.arrayOk){if(h(u))return c.set(u),u;if(f(u))return u=p(u),c.set(u),u}var g=e.valObjectMeta[o.valType].coerceFunction;g(u,c,a,o);var y=c.get();return m&&y===a&&!d(u,o)&&(g(u=l(m,i).get(),c,a,o),y=c.get()),y},e.coerce2=function(t,r,n,i,a){var o=l(t,i),s=e.coerce(t,r,n,i,a);return null!=o.get()&&s},e.coerceFont=function(e,t,r,i){i||(i={}),r=n({},r);var a={family:e(t+".family",(r=n(r,i.overrideDflt||{})).family),size:e(t+".size",r.size),color:e(t+".color",r.color),weight:e(t+".weight",r.weight),style:e(t+".style",r.style)};if(i.noFontVariant||(a.variant=e(t+".variant",r.variant)),i.noFontLineposition||(a.lineposition=e(t+".lineposition",r.lineposition)),i.noFontTextcase||(a.textcase=e(t+".textcase",r.textcase)),!i.noFontShadow){var o=r.shadow;"none"===o&&i.autoShadowDflt&&(o="auto"),a.shadow=e(t+".shadow",o)}return a},e.coercePattern=function(e,t,r,n){var i,a=e(t+".shape");if(a||(i=e(t+".path")),a||i){a&&e(t+".solidity"),e(t+".size");var s="overlay"===e(t+".fillmode");if(!n){var l=e(t+".bgcolor",s?r:void 0);e(t+".fgcolor",s?o.contrast(l):r)}e(t+".fgopacity",s?.5:1)}},e.coerceHoverinfo=function(t,r,n){var a,o=r._module.attributes,s=o.hoverinfo?o:i,l=s.hoverinfo;if(1===n._dataLength){var c="all"===l.dflt?l.flags.slice():l.dflt.split("+");c.splice(c.indexOf("name"),1),a=c.join("+")}return e.coerce(t,r,s,"hoverinfo",a)},e.coerceSelectionMarkerOpacity=function(e,t){if(e.marker){var r,n,i=e.marker.opacity;void 0!==i&&(!h(i)&&!e.selected&&!e.unselected&&(r=i,n=s*i),t("selected.marker.opacity",r),t("unselected.marker.opacity",n))}},e.validate=d}}),$=m({"src/plot_api/plot_config.js"(e,t){var r={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:{}}},n={};(function e(t,r){for(var n in t){var i=t[n];i.valType?r[n]=i.dflt:(r[n]||(r[n]={}),e(i,r[n]))}})(r,n),t.exports={configAttributes:r,dfltConfig:n}}}),K=m({"src/lib/notifier.js"(e,t){var r=b(),n=M(),i=[];t.exports=function(e,t,a){var o;if(!1!==(null==(o=a?._context)?void 0:o.displayNotifier)&&-1===i.indexOf(e)){i.push(e);var s=1e3;n(t)?s=t:"long"===t&&(s=3e3);var l=r.select("body").selectAll(".plotly-notifier").data([0]);l.enter().append("div").classed("plotly-notifier",!0),l.selectAll(".notifier-note").data(i).enter().append("div").classed("notifier-note",!0).style("opacity",0).each((function(e){var n=r.select(this);n.append("button").classed("notifier-close",!0).html("×").on("click",(function(){n.transition().call(c)}));for(var i=n.append("p"),a=e.split(/<br\s*\/?>/g),o=0;o<a.length;o++)o&&i.append("br"),i.append("span").text(a[o]);"stick"===t?n.transition().duration(350).style("opacity",1):n.transition().duration(700).style("opacity",1).transition().delay(s).call(c)}))}function c(e){e.duration(700).style("opacity",0).each("end",(function(e){var t=i.indexOf(e);-1!==t&&i.splice(t,1),r.select(this).remove()}))}}}}),J=m({"src/lib/loggers.js"(e,t){var r=$().dfltConfig,n=K(),i=t.exports={};i.log=function(){var e;if(r.logging>1){var t=["LOG:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);console.trace.apply(console,t)}if(r.notifyOnLogging>1){var i=[];for(e=0;e<arguments.length;e++)i.push(arguments[e]);n(i.join("<br>"),"long")}},i.warn=function(){var e;if(r.logging>0){var t=["WARN:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);console.trace.apply(console,t)}if(r.notifyOnLogging>0){var i=[];for(e=0;e<arguments.length;e++)i.push(arguments[e]);n(i.join("<br>"),"stick")}},i.error=function(){var e;if(r.logging>0){var t=["ERROR:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);console.error.apply(console,t)}if(r.notifyOnLogging>0){var i=[];for(e=0;e<arguments.length;e++)i.push(arguments[e]);n(i.join("<br>"),"stick")}}}}),Q=m({"src/lib/noop.js"(e,t){t.exports=function(){}}}),ee=m({"src/lib/push_unique.js"(e,t){t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;n<e.length;n++)if(e[n]instanceof RegExp&&e[n].toString()===r)return e;e.push(t)}else(t||0===t)&&-1===e.indexOf(t)&&e.push(t);return e}}}),te=m({"node_modules/gl-mat4/create.js"(e,t){t.exports=function(){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}}}),re=m({"node_modules/gl-mat4/clone.js"(e,t){t.exports=function(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}}}),ne=m({"node_modules/gl-mat4/copy.js"(e,t){t.exports=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}}}),ie=m({"node_modules/gl-mat4/identity.js"(e,t){t.exports=function(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}}}),ae=m({"node_modules/gl-mat4/transpose.js"(e,t){t.exports=function(e,t){if(e===t){var r=t[1],n=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]=r,e[6]=t[9],e[7]=t[13],e[8]=n,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}}}),oe=m({"node_modules/gl-mat4/invert.js"(e,t){t.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],p=t[11],d=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*o,x=r*l-i*o,_=r*c-a*o,b=n*l-i*s,w=n*c-a*s,T=i*c-a*l,k=u*m-h*d,A=u*g-f*d,M=u*y-p*d,S=h*g-f*m,E=h*y-p*m,C=f*y-p*g,I=v*C-x*E+_*S+b*M-w*A+T*k;return I?(I=1/I,e[0]=(s*C-l*E+c*S)*I,e[1]=(i*E-n*C-a*S)*I,e[2]=(m*T-g*w+y*b)*I,e[3]=(f*w-h*T-p*b)*I,e[4]=(l*M-o*C-c*A)*I,e[5]=(r*C-i*M+a*A)*I,e[6]=(g*_-d*T-y*x)*I,e[7]=(u*T-f*_+p*x)*I,e[8]=(o*E-s*M+c*k)*I,e[9]=(n*M-r*E-a*k)*I,e[10]=(d*w-m*_+y*v)*I,e[11]=(h*_-u*w-p*v)*I,e[12]=(s*A-o*S-l*k)*I,e[13]=(r*S-n*A+i*k)*I,e[14]=(m*x-d*b-g*v)*I,e[15]=(u*b-h*x+f*v)*I,e):null}}}),se=m({"node_modules/gl-mat4/adjoint.js"(e,t){t.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],p=t[11],d=t[12],m=t[13],g=t[14],y=t[15];return e[0]=s*(f*y-p*g)-h*(l*y-c*g)+m*(l*p-c*f),e[1]=-(n*(f*y-p*g)-h*(i*y-a*g)+m*(i*p-a*f)),e[2]=n*(l*y-c*g)-s*(i*y-a*g)+m*(i*c-a*l),e[3]=-(n*(l*p-c*f)-s*(i*p-a*f)+h*(i*c-a*l)),e[4]=-(o*(f*y-p*g)-u*(l*y-c*g)+d*(l*p-c*f)),e[5]=r*(f*y-p*g)-u*(i*y-a*g)+d*(i*p-a*f),e[6]=-(r*(l*y-c*g)-o*(i*y-a*g)+d*(i*c-a*l)),e[7]=r*(l*p-c*f)-o*(i*p-a*f)+u*(i*c-a*l),e[8]=o*(h*y-p*m)-u*(s*y-c*m)+d*(s*p-c*h),e[9]=-(r*(h*y-p*m)-u*(n*y-a*m)+d*(n*p-a*h)),e[10]=r*(s*y-c*m)-o*(n*y-a*m)+d*(n*c-a*s),e[11]=-(r*(s*p-c*h)-o*(n*p-a*h)+u*(n*c-a*s)),e[12]=-(o*(h*g-f*m)-u*(s*g-l*m)+d*(s*f-l*h)),e[13]=r*(h*g-f*m)-u*(n*g-i*m)+d*(n*f-i*h),e[14]=-(r*(s*g-l*m)-o*(n*g-i*m)+d*(n*l-i*s)),e[15]=r*(s*f-l*h)-o*(n*f-i*h)+u*(n*l-i*s),e}}}),le=m({"node_modules/gl-mat4/determinant.js"(e,t){t.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],f=e[11],p=e[12],d=e[13],m=e[14],g=e[15];return(t*o-r*a)*(h*g-f*m)-(t*s-n*a)*(u*g-f*d)+(t*l-i*a)*(u*m-h*d)+(r*s-n*o)*(c*g-f*p)-(r*l-i*o)*(c*m-h*p)+(n*l-i*s)*(c*d-u*p)}}}),ce=m({"node_modules/gl-mat4/multiply.js"(e,t){t.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],f=t[9],p=t[10],d=t[11],m=t[12],g=t[13],y=t[14],v=t[15],x=r[0],_=r[1],b=r[2],w=r[3];return e[0]=x*n+_*s+b*h+w*m,e[1]=x*i+_*l+b*f+w*g,e[2]=x*a+_*c+b*p+w*y,e[3]=x*o+_*u+b*d+w*v,x=r[4],_=r[5],b=r[6],w=r[7],e[4]=x*n+_*s+b*h+w*m,e[5]=x*i+_*l+b*f+w*g,e[6]=x*a+_*c+b*p+w*y,e[7]=x*o+_*u+b*d+w*v,x=r[8],_=r[9],b=r[10],w=r[11],e[8]=x*n+_*s+b*h+w*m,e[9]=x*i+_*l+b*f+w*g,e[10]=x*a+_*c+b*p+w*y,e[11]=x*o+_*u+b*d+w*v,x=r[12],_=r[13],b=r[14],w=r[15],e[12]=x*n+_*s+b*h+w*m,e[13]=x*i+_*l+b*f+w*g,e[14]=x*a+_*c+b*p+w*y,e[15]=x*o+_*u+b*d+w*v,e}}}),ue=m({"node_modules/gl-mat4/translate.js"(e,t){t.exports=function(e,t,r){var n,i,a,o,s,l,c,u,h,f,p,d,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],f=t[9],p=t[10],d=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=f,e[10]=p,e[11]=d,e[12]=n*m+s*g+h*y+t[12],e[13]=i*m+l*g+f*y+t[13],e[14]=a*m+c*g+p*y+t[14],e[15]=o*m+u*g+d*y+t[15]),e}}}),he=m({"node_modules/gl-mat4/scale.js"(e,t){t.exports=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,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}}}),fe=m({"node_modules/gl-mat4/rotate.js"(e,t){t.exports=function(e,t,r,n){var i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E=n[0],C=n[1],I=n[2],L=Math.sqrt(E*E+C*C+I*I);return Math.abs(L)<1e-6?null:(E*=L=1/L,C*=L,I*=L,i=Math.sin(r),o=1-(a=Math.cos(r)),s=t[0],l=t[1],c=t[2],u=t[3],h=t[4],f=t[5],p=t[6],d=t[7],m=t[8],g=t[9],y=t[10],v=t[11],x=E*E*o+a,_=C*E*o+I*i,b=I*E*o-C*i,w=E*C*o-I*i,T=C*C*o+a,k=I*C*o+E*i,A=E*I*o+C*i,M=C*I*o-E*i,S=I*I*o+a,e[0]=s*x+h*_+m*b,e[1]=l*x+f*_+g*b,e[2]=c*x+p*_+y*b,e[3]=u*x+d*_+v*b,e[4]=s*w+h*T+m*k,e[5]=l*w+f*T+g*k,e[6]=c*w+p*T+y*k,e[7]=u*w+d*T+v*k,e[8]=s*A+h*M+m*S,e[9]=l*A+f*M+g*S,e[10]=c*A+p*M+y*S,e[11]=u*A+d*M+v*S,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}}}),pe=m({"node_modules/gl-mat4/rotateX.js"(e,t){t.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=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+c*n,e[5]=o*i+u*n,e[6]=s*i+h*n,e[7]=l*i+f*n,e[8]=c*i-a*n,e[9]=u*i-o*n,e[10]=h*i-s*n,e[11]=f*i-l*n,e}}}),de=m({"node_modules/gl-mat4/rotateY.js"(e,t){t.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],c=t[8],u=t[9],h=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-c*n,e[1]=o*i-u*n,e[2]=s*i-h*n,e[3]=l*i-f*n,e[8]=a*n+c*i,e[9]=o*n+u*i,e[10]=s*n+h*i,e[11]=l*n+f*i,e}}}),me=m({"node_modules/gl-mat4/rotateZ.js"(e,t){t.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],c=t[4],u=t[5],h=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+c*n,e[1]=o*i+u*n,e[2]=s*i+h*n,e[3]=l*i+f*n,e[4]=c*i-a*n,e[5]=u*i-o*n,e[6]=h*i-s*n,e[7]=f*i-l*n,e}}}),ge=m({"node_modules/gl-mat4/fromRotation.js"(e,t){t.exports=function(e,t,r){var n,i,a,o=r[0],s=r[1],l=r[2],c=Math.sqrt(o*o+s*s+l*l);return Math.abs(c)<1e-6?null:(o*=c=1/c,s*=c,l*=c,n=Math.sin(t),a=1-(i=Math.cos(t)),e[0]=o*o*a+i,e[1]=s*o*a+l*n,e[2]=l*o*a-s*n,e[3]=0,e[4]=o*s*a-l*n,e[5]=s*s*a+i,e[6]=l*s*a+o*n,e[7]=0,e[8]=o*l*a+s*n,e[9]=s*l*a-o*n,e[10]=l*l*a+i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}}}),ye=m({"node_modules/gl-mat4/fromRotationTranslation.js"(e,t){t.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,l=i+i,c=a+a,u=n*s,h=n*l,f=n*c,p=i*l,d=i*c,m=a*c,g=o*s,y=o*l,v=o*c;return e[0]=1-(p+m),e[1]=h+v,e[2]=f-y,e[3]=0,e[4]=h-v,e[5]=1-(u+m),e[6]=d+g,e[7]=0,e[8]=f+y,e[9]=d-g,e[10]=1-(u+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}}}),ve=m({"node_modules/gl-mat4/fromScaling.js"(e,t){t.exports=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}}}),xe=m({"node_modules/gl-mat4/fromTranslation.js"(e,t){t.exports=function(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}}}),_e=m({"node_modules/gl-mat4/fromXRotation.js"(e,t){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),be=m({"node_modules/gl-mat4/fromYRotation.js"(e,t){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),we=m({"node_modules/gl-mat4/fromZRotation.js"(e,t){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,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=m({"node_modules/gl-mat4/fromQuat.js"(e,t){t.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,h=n*s,f=i*o,p=i*s,d=i*l,m=a*o,g=a*s,y=a*l;return e[0]=1-h-d,e[1]=u+y,e[2]=f-g,e[3]=0,e[4]=u-y,e[5]=1-c-d,e[6]=p+m,e[7]=0,e[8]=f+g,e[9]=p-m,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),ke=m({"node_modules/gl-mat4/frustum.js"(e,t){t.exports=function(e,t,r,n,i,a,o){var s=1/(r-t),l=1/(i-n),c=1/(a-o);return e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*l,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0,e}}}),Ae=m({"node_modules/gl-mat4/perspective.js"(e,t){t.exports=function(e,t,r,n,i){var a=1/Math.tan(t/2),o=1/(n-i);return e[0]=a/r,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+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*n*o,e[15]=0,e}}}),Me=m({"node_modules/gl-mat4/perspectiveFromFieldOfView.js"(e,t){t.exports=function(e,t,r,n){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),l=2/(o+s),c=2/(i+a);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(o-s)*l*.5,e[9]=(i-a)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}}}),Se=m({"node_modules/gl-mat4/ortho.js"(e,t){t.exports=function(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*c,e[15]=1,e}}}),Ee=m({"node_modules/gl-mat4/lookAt.js"(e,t){var r=ie();t.exports=function(e,t,n,i){var a,o,s,l,c,u,h,f,p,d,m=t[0],g=t[1],y=t[2],v=i[0],x=i[1],_=i[2],b=n[0],w=n[1],T=n[2];return Math.abs(m-b)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-T)<1e-6?r(e):(h=m-b,f=g-w,p=y-T,a=x*(p*=d=1/Math.sqrt(h*h+f*f+p*p))-_*(f*=d),o=_*(h*=d)-v*p,s=v*f-x*h,(d=Math.sqrt(a*a+o*o+s*s))?(a*=d=1/d,o*=d,s*=d):(a=0,o=0,s=0),l=f*s-p*o,c=p*a-h*s,u=h*o-f*a,(d=Math.sqrt(l*l+c*c+u*u))?(l*=d=1/d,c*=d,u*=d):(l=0,c=0,u=0),e[0]=a,e[1]=l,e[2]=h,e[3]=0,e[4]=o,e[5]=c,e[6]=f,e[7]=0,e[8]=s,e[9]=u,e[10]=p,e[11]=0,e[12]=-(a*m+o*g+s*y),e[13]=-(l*m+c*g+u*y),e[14]=-(h*m+f*g+p*y),e[15]=1,e)}}}),Ce=m({"node_modules/gl-mat4/str.js"(e,t){t.exports=function(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]+")"}}}),Ie=m({"node_modules/gl-mat4/index.js"(e,t){t.exports={create:te(),clone:re(),copy:ne(),identity:ie(),transpose:ae(),invert:oe(),adjoint:se(),determinant:le(),multiply:ce(),translate:ue(),scale:he(),rotate:fe(),rotateX:pe(),rotateY:de(),rotateZ:me(),fromRotation:ge(),fromRotationTranslation:ye(),fromScaling:ve(),fromTranslation:xe(),fromXRotation:_e(),fromYRotation:be(),fromZRotation:we(),fromQuat:Te(),frustum:ke(),perspective:Ae(),perspectiveFromFieldOfView:Me(),ortho:Se(),lookAt:Ee(),str:Ce()}}}),Le=m({"src/lib/matrix.js"(e){var t=Ie();e.init2dArray=function(e,t){for(var r=new Array(e),n=0;n<e;n++)r[n]=new Array(t);return r},e.transposeRagged=function(e){var t,r,n=0,i=e.length;for(t=0;t<i;t++)n=Math.max(n,e[t].length);var a=new Array(n);for(t=0;t<n;t++)for(a[t]=new Array(i),r=0;r<i;r++)a[t][r]=e[r][t];return a},e.dot=function(t,r){if(!t.length||!r.length||t.length!==r.length)return null;var n,i,a=t.length;if(t[0].length)for(n=new Array(a),i=0;i<a;i++)n[i]=e.dot(t[i],r);else if(r[0].length){var o=e.transposeRagged(r);for(n=new Array(o.length),i=0;i<o.length;i++)n[i]=e.dot(t,o[i])}else for(n=0,i=0;i<a;i++)n+=t[i]*r[i];return n},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,r,n){return e.dot(e.dot(e.translationMatrix(r,n),e.rotationMatrix(t)),e.translationMatrix(-r,-n))},e.apply3DTransform=function(t){return function(){var r=arguments,n=1===arguments.length?r[0]:[r[0],r[1],r[2]||0];return e.dot(t,[n[0],n[1],n[2],1]).slice(0,3)}},e.apply2DTransform=function(t){return function(){var r=arguments;3===r.length&&(r=r[0]);var n=1===arguments.length?r[0]:[r[0],r[1]];return e.dot(t,[n[0],n[1],1]).slice(0,2)}},e.apply2DTransform2=function(t){var r=e.apply2DTransform(t);return function(e){return r(e.slice(0,2)).concat(r(e.slice(2,4)))}},e.convertCssMatrix=function(e){if(e){var t=e.length;if(16===t)return e;if(6===t)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 r=[];return t.invert(r,e),[[r[0],r[1],r[2],r[3]],[r[4],r[5],r[6],r[7]],[r[8],r[9],r[10],r[11]],[r[12],r[13],r[14],r[15]]]}}}),Pe=m({"src/lib/dom.js"(e,t){var r=b(),n=J(),i=Le(),a=Ie();function o(e){var t=e&&e.parentNode;t&&t.removeChild(e)}function s(e,t,r){var i="plotly.js-style-"+e,a=document.getElementById(i);if(!a||!a.matches(".no-inline-styles")){a||((a=document.createElement("style")).setAttribute("id",i),a.appendChild(document.createTextNode("")),document.head.appendChild(a));var o=a.sheet;o?o.insertRule?o.insertRule(t+"{"+r+"}",0):o.addRule?o.addRule(t,r,0):n.warn("addStyleRule failed"):n.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function l(e){var t=window.getComputedStyle(e,null),r=t.getPropertyValue("-webkit-transform")||t.getPropertyValue("-moz-transform")||t.getPropertyValue("-ms-transform")||t.getPropertyValue("-o-transform")||t.getPropertyValue("transform");return"none"===r?null:r.replace("matrix","").replace("3d","").slice(1,-1).split(",").map((function(e){return+e}))}function c(e){for(var t=[];u(e);)t.push(e),e=e.parentNode,"function"==typeof ShadowRoot&&e instanceof ShadowRoot&&(e=e.host);return t}function u(e){return e&&(e instanceof Element||e instanceof HTMLElement)}t.exports={getGraphDiv:function(e){var t;if("string"==typeof e){if(null===(t=document.getElementById(e)))throw new Error("No DOM element with id '"+e+"' exists on the page.");return t}if(null==e)throw new Error("DOM element provided is null or undefined");return e},isPlotDiv:function(e){var t=r.select(e);return t.node()instanceof HTMLElement&&t.size()&&t.classed("js-plotly-plot")},removeElement:o,addStyleRule:function(e,t){s("global",e,t)},addRelatedStyleRule:s,deleteRelatedStyleRule:function(e){var t="plotly.js-style-"+e,r=document.getElementById(t);r&&o(r)},setStyleOnHover:function(e,t,r,n,i,a){var o=n.split(":"),s=i.split(":"),l="data-btn-style-event-added";a||(a=document),a.querySelectorAll(e).forEach((function(e){e.getAttribute(l)||(e.addEventListener("mouseenter",(function(){var e=this.querySelector(r);e&&(e.style[o[0]]=o[1])})),e.addEventListener("mouseleave",(function(){var e=this.querySelector(r);e&&(t&&this.matches(t)?e.style[o[0]]=o[1]:e.style[s[0]]=s[1])})),e.setAttribute(l,!0))}))},getFullTransformMatrix:function(e){var t=c(e),r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return t.forEach((function(e){var t=l(e);if(t){var n=i.convertCssMatrix(t);r=a.multiply(r,r,n)}})),r},getElementTransformMatrix:l,getElementAndAncestors:c,equalDomRects:function(e,t){return e&&t&&e.top===t.top&&e.left===t.left&&e.right===t.right&&e.bottom===t.bottom}}}}),ze=m({"src/plots/animation_attributes.js"(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"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}}}),De=m({"src/plot_api/edit_types.js"(e,t){var r=B().extendFlat,n=C(),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");function l(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!1;return t}function c(e,t,i){var a=r({},e);for(var o in a){var s=a[o];n(s)&&(a[o]=u(s,t,0,o))}return"from-root"===i&&(a.editType=t),a}function u(e,t,n,i){if(e.valType){var a=r({},e);if(a.editType=t,Array.isArray(e.items)){a.items=new Array(e.items.length);for(var o=0;o<e.items.length;o++)a.items[o]=u(e.items[o],t)}return a}return c(e,t,"_"===i.charAt(0)?"nested":"from-root")}t.exports={traces:i,layout:a,traceFlags:function(){return l(o)},layoutFlags:function(){return l(s)},update:function(e,t){var r=t.editType;if(r&&"none"!==r)for(var n=r.split("+"),i=0;i<n.length;i++)e[n[i]]=!0},overrideAll:c}}}),Oe=m({"src/components/drawing/attributes.js"(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=m({"src/constants/docs.js"(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"}}}),Fe=m({"src/plots/template_attributes.js"(e){var{DATE_FORMAT_LINK:t,FORMAT_LINK:r}=Re(),n=["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(" ");e.templateFormatStringDescription=function({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}".',r,"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.",n].join(" ")},e.hovertemplateAttrs=({editType:e="none",arrayOk:t}={},r={})=>f({valType:"string",dflt:"",editType:e},!1!==t?{arrayOk:!0}:{}),e.texttemplateAttrs=({editType:e="calc",arrayOk:t}={},r={})=>f({valType:"string",dflt:"",editType:e},!1!==t?{arrayOk:!0}:{}),e.shapeTexttemplateAttrs=({editType:e="arraydraw",newshape:t}={},r={})=>({valType:"string",dflt:"",editType:e}),e.templatefallbackAttrs=({editType:e="none"}={})=>({valType:"any",dflt:"-",editType:e})}}),Be=m({"src/components/shapes/label_texttemplate.js"(e,t){function r(e,t){return t?t.d2l(e):e}function n(e,t){return t?t.l2d(e):e}function i(e){return e.x0shift||0}function a(e){return e.x1shift||0}function o(e){return e.y0shift||0}function s(e){return e.y1shift||0}function l(e,t){return r(e.x1,t)+a(e)-r(e.x0,t)-i(e)}function c(e,t,n){return r(e.y1,n)+s(e)-r(e.y0,n)-o(e)}t.exports={x0:function(e){return e.x0},x1:function(e){return e.x1},y0:function(e){return e.y0},y1:function(e){return e.y1},slope:function(e,t,r){return"line"!==e.type?void 0:c(e,0,r)/l(e,t)},dx:l,dy:c,width:function(e,t){return Math.abs(l(e,t))},height:function(e,t,r){return Math.abs(c(e,0,r))},length:function(e,t,r){return"line"!==e.type?void 0:Math.sqrt(Math.pow(l(e,t),2)+Math.pow(c(e,0,r),2))},xcenter:function(e,t){return n((r(e.x1,t)+a(e)+r(e.x0,t)+i(e))/2,t)},ycenter:function(e,t,i){return n((r(e.y1,i)+s(e)+r(e.y0,i)+o(e))/2,i)},simpleXVariables:["x0","x1","y0","y1","dy","height","ycenter"],simpleYVariables:["x0","x1","y0","y1","dx","width","xcenter"]}}}),je=m({"src/components/shapes/draw_newshape/attributes.js"(e,t){var r=De().overrideAll,n=q(),i=j(),a=Oe().dash,o=B().extendFlat,{shapeTexttemplateAttrs:s,templatefallbackAttrs:l}=Fe(),c=Be();t.exports=r({newshape:{visible:o({},n.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:o({},n.legend,{}),legendgroup:o({},n.legendgroup,{}),legendgrouptitle:{text:o({},n.legendgrouptitle.text,{}),font:i({})},legendrank:o({},n.legendrank,{}),legendwidth:o({},n.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({},n.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:s({newshape:!0},{keys:Object.keys(c)}),texttemplatefallback:l({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")}}),Ne=m({"src/components/selections/draw_newselection/attributes.js"(e,t){var r=Oe().dash,n=B().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:n({},r,{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=m({"src/plots/pad_attributes.js"(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}}}}),Ve=m({"src/plots/layout_attributes.js"(e,t){var r=j(),n=ze(),i=G(),a=je(),o=Ne(),s=Ue(),l=B().extendFlat,c=r({editType:"calc"});c.family.dflt='"Open Sans", verdana, arial, sans-serif',c.size.dflt=12,c.color.dflt=i.defaultLine,t.exports={font:c,title:{text:{valType:"string",editType:"layoutstyle"},font:r({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:r({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:l(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:l({},n.transition,{editType:"none"})}}}),qe=m({"node_modules/maplibre-gl/dist/maplibre-gl.css"(){!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)}}()}}),He=m({"src/registry.js"(e){var t=J(),r=Q(),n=ee(),i=C(),a=Pe().addStyleRule,o=B(),s=q(),l=Ve(),c=o.extendFlat,u=o.extendDeepAll;function h(r){var n=r.name,i=r.categories,o=r.meta;if(e.modules[n])t.log("Type "+n+" already registered");else{e.subplotsRegistry[r.basePlotModule.name]||function(r){var n=r.name;if(e.subplotsRegistry[n])t.log("Plot type "+n+" already registered.");else for(var i in m(r),e.subplotsRegistry[n]=r,e.componentsRegistry)y(i,r.name)}(r.basePlotModule);for(var s={},l=0;l<i.length;l++)s[i[l]]=!0,e.allCategories[i[l]]=!0;for(var u in e.modules[n]={_module:r,categories:s},o&&Object.keys(o).length&&(e.modules[n].meta=o),e.allTypes.push(n),e.componentsRegistry)g(u,n);r.layoutAttributes&&c(e.traceLayoutAttributes,r.layoutAttributes);var h=r.basePlotModule,f=h.name;if("mapbox"===f){var p=h.constants.styleRules;for(var d in p)a(".js-plotly-plot .plotly .mapboxgl-"+d,p[d])}"map"===f&&qe(),("geo"===f||"mapbox"===f||"map"===f)&&void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}})}}function f(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");var r=t.name;for(var i in e.componentsRegistry[r]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&n(e.layoutArrayContainers,r),m(t)),e.modules)g(r,i);for(var a in e.subplotsRegistry)y(r,a);t.schema&&t.schema.layout&&u(l,t.schema.layout)}function p(e){if("string"!=typeof e.name)throw new Error("Transform module *name* must be a string.");var r="Transform module "+e.name,n="function"==typeof e.transform,a="function"==typeof e.calcTransform;if(!n&&!a)throw new Error(r+" is missing a *transform* or *calcTransform* method.");n&&a&&t.log([r+" 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(r+" registered without an *attributes* object."),"function"!=typeof e.supplyDefaults&&t.log(r+" registered without a *supplyDefaults* method.")}function d(t){var r=t.name,n=r.split("-")[0],i=t.dictionary,a=t.format,o=i&&Object.keys(i).length,s=a&&Object.keys(a).length,l=e.localeRegistry,c=l[r];if(c||(l[r]=c={}),n!==r){var u=l[n];u||(l[n]=u={}),o&&u.dictionary===c.dictionary&&(u.dictionary=i),s&&u.format===c.format&&(u.format=a)}o&&(c.dictionary=i),s&&(c.format=a)}function m(t){if(t.layoutAttributes){var r=t.layoutAttributes._arrayAttrRegexps;if(r)for(var i=0;i<r.length;i++)n(e.layoutArrayRegexes,r[i])}}function g(t,r){var n=e.componentsRegistry[t].schema;if(n&&n.traces){var i=n.traces[r];i&&u(e.modules[r]._module.attributes,i)}}function y(t,r){var n=e.componentsRegistry[t].schema;if(n&&n.subplots){var i=e.subplotsRegistry[r],a=i.layoutAttributes,o="subplot"===i.attr?i.name:i.attr;Array.isArray(o)&&(o=o[0]);var s=n.subplots[o];a&&s&&u(a,s)}}function v(e){return"object"==typeof e&&(e=e.type),e}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)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var r=0;r<t.length;r++){var n=t[r];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":h(n);break;case"transform":p(n);break;case"component":f(n);break;case"locale":d(n);break;case"apiMethod":var i=n.name;e.apiMethodRegistry[i]=n.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},e.getModule=function(t){var r=e.modules[v(t)];return!!r&&r._module},e.traceIs=function(r,n){if("various"===(r=v(r)))return!1;var i=e.modules[r];return i||(r&&t.log("Unrecognized trace type "+r+"."),i=e.modules[s.type.dflt]),!!i.categories[n]},e.getComponentMethod=function(t,n){var i=e.componentsRegistry[t];return i&&i[n]||r},e.call=function(){var t=arguments[0],r=[].slice.call(arguments,1);return e.apiMethodRegistry[t].apply(null,r)}}}),Ge=m({"src/lib/dates.js"(e){var t,r,n=T().timeFormat,i=M(),a=J(),o=R().mod,s=S(),l=s.BADNUM,c=s.ONEDAY,u=s.ONEHOUR,h=s.ONEMIN,f=s.ONESEC,p=s.EPOCHJD,d=He(),m=T().utcFormat,g=/^\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,y=/^\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,v=(new Date).getFullYear()-70;function x(e){return e&&d.componentsRegistry.calendars&&"string"==typeof e&&"gregorian"!==e}function _(e,t){return String(e+Math.pow(10,t)).slice(1)}e.dateTick0=function(t,r){var n=function(e,t){return x(e)?t?d.getComponentMethod("calendars","CANONICAL_SUNDAY")[e]:d.getComponentMethod("calendars","CANONICAL_TICK")[e]:t?"2000-01-02":"2000-01-01"}(t,!!r);if(r<2)return n;var i=e.dateTime2ms(n,t);return i+=c*(r-1),e.ms2DateTime(i,0,t)},e.dfltRange=function(e){return x(e)?d.getComponentMethod("calendars","DFLTRANGE")[e]:["2000-01-01","2001-01-01"]},e.isJSDate=function(e){return"object"==typeof e&&null!==e&&"function"==typeof e.getTime},e.dateTime2ms=function(n,i){if(e.isJSDate(n)){var a=n.getTimezoneOffset()*h,s=(n.getUTCMinutes()-n.getMinutes())*h+(n.getUTCSeconds()-n.getSeconds())*f+(n.getUTCMilliseconds()-n.getMilliseconds());if(s){var m=3*h;a=a-m/2+o(s-a+m/2,m)}return(n=Number(n)-a)>=t&&n<=r?n:l}if("string"!=typeof n&&"number"!=typeof n)return l;n=String(n);var _=x(i),b=n.charAt(0);_&&("G"===b||"g"===b)&&(n=n.slice(1),i="");var w=_&&"chinese"===i.slice(0,7),T=n.match(w?y:g);if(!T)return l;var k=T[1],A=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),C=Number(T[11]||0);if(_){if(2===k.length)return l;var I;k=Number(k);try{var L=d.getComponentMethod("calendars","getCal")(i);if(w){var P="i"===A.charAt(A.length-1);A=parseInt(A,10),I=L.newDate(k,L.toMonthIndex(k,A,P),M)}else I=L.newDate(k,Number(A),M)}catch{return l}return I?(I.toJD()-p)*c+S*u+E*h+C*f:l}k=2===k.length?(Number(k)+2e3-v)%100+v:Number(k),A-=1;var z=new Date(Date.UTC(2e3,A,M,S,E));return z.setUTCFullYear(k),z.getUTCMonth()!==A||z.getUTCDate()!==M?l:z.getTime()+C*f},t=e.MIN_MS=e.dateTime2ms("-9999"),r=e.MAX_MS=e.dateTime2ms("9999-12-31 23:59:59.9999"),e.isDateTime=function(t,r){return e.dateTime2ms(t,r)!==l};var b=90*c,w=3*u,k=5*h;function A(e,t,r,n,i){if((t||r||n||i)&&(e+=" "+_(t,2)+":"+_(r,2),(n||i)&&(e+=":"+_(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;e+="."+_(i,a)}return e}e.ms2DateTime=function(e,n,i){if("number"!=typeof e||!(e>=t&&e<=r))return l;n||(n=0);var a,s,g,y,v,_,T=Math.floor(10*o(e+.05,1)),M=Math.round(e-T/10);if(x(i)){var S=Math.floor(M/c)+p,E=Math.floor(o(e,c));try{a=d.getComponentMethod("calendars","getCal")(i).fromJD(S).formatDate("yyyy-mm-dd")}catch{a=m("G%Y-%m-%d")(new Date(M))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.slice(1);else for(;a.length<10;)a="0"+a;s=n<b?Math.floor(E/u):0,g=n<b?Math.floor(E%u/h):0,y=n<w?Math.floor(E%h/f):0,v=n<k?E%f*10+T:0}else _=new Date(M),a=m("%Y-%m-%d")(_),s=n<b?_.getUTCHours():0,g=n<b?_.getUTCMinutes():0,y=n<w?_.getUTCSeconds():0,v=n<k?10*_.getUTCMilliseconds()+T:0;return A(a,s,g,y,v)},e.ms2DateTimeLocal=function(e){if(!(e>=t+c&&e<=r-c))return l;var i=Math.floor(10*o(e+.05,1)),a=new Date(Math.round(e-i/10));return A(n("%Y-%m-%d")(a),a.getHours(),a.getMinutes(),a.getSeconds(),10*a.getUTCMilliseconds()+i)},e.cleanDate=function(t,r,n){if(t===l)return r;if(e.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(x(n))return a.error("JS Dates and milliseconds are incompatible with world calendars",t),r;if(!(t=e.ms2DateTimeLocal(+t))&&void 0!==r)return r}else if(!e.isDateTime(t,n))return a.error("unrecognized date",t),r;return t};var E=/%\d?f/g,C=/%h/g,I={1:"1",2:"1",3:"2",4:"2"};function L(e,t,r,n){e=e.replace(E,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).slice(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(t+.05));if(e=e.replace(C,(function(){return I[r("%q")(i)]})),x(n))try{e=d.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch{return"Invalid"}return r(e)(i)}var P=[59,59.9,59.99,59.999,59.9999];e.formatDate=function(e,t,r,n,a,s){if(a=x(a)&&a,!t)if("y"===r)t=s.year;else if("m"===r)t=s.month;else{if("d"!==r)return function(e,t){var r=o(e+.05,c),n=_(Math.floor(r/u),2)+":"+_(o(Math.floor(r/h),60),2);if("M"!==t){i(t)||(t=0);var a=(100+Math.min(o(e/f,60),P[t])).toFixed(t).slice(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+L(s.dayMonthYear,e,n,a);t=s.dayMonth+"\n"+s.year}return L(t,e,n,a)};var z=3*c;e.incrementMonth=function(e,t,r){r=x(r)&&r;var n=o(e,c);if(e=Math.round(e-n),r)try{var i=Math.round(e/c)+p,s=d.getComponentMethod("calendars","getCal")(r),l=s.fromJD(i);return t%12?s.add(l,t,"m"):s.add(l,t/12,"y"),(l.toJD()-p)*c+n}catch{a.error("invalid ms "+e+" in calendar "+r)}var u=new Date(e+z);return u.setUTCMonth(u.getUTCMonth()+t)+n-z},e.findExactDates=function(e,t){for(var r,n,a=0,o=0,s=0,l=0,u=x(t)&&d.getComponentMethod("calendars","getCal")(t),h=0;h<e.length;h++)if(n=e[h],i(n)){if(!(n%c))if(u)try{1===(r=u.fromJD(n/c+p)).day()?1===r.month()?a++:o++:s++}catch{}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?a++:o++:s++}else l++;s+=o+=a;var f=e.length-l;return{exactYears:a/f,exactMonths:o/f,exactDays:s/f}}}}),We=m({"src/lib/identity.js"(e,t){t.exports=function(e){return e}}}),Ze=m({"src/lib/search.js"(e){var t=M(),r=J(),n=We(),i=S().BADNUM,a=1e-9;function o(e,t){return e<t}function s(e,t){return e<=t}function l(e,t){return e>t}function c(e,t){return e>=t}e.findBin=function(e,n,i){if(t(n.start))return i?Math.ceil((e-n.start)/n.size-a)-1:Math.floor((e-n.start)/n.size+a);var u,h,f=0,p=n.length,d=0,m=p>1?(n[p-1]-n[0])/(p-1):1;for(h=m>=0?i?o:s:i?c:l,e+=m*a*(i?-1:1)*(m>=0?1:-1);f<p&&d++<100;)h(n[u=Math.floor((f+p)/2)],e)?f=u+1:p=u;return d>90&&r.log("Long binary search..."),f-1},e.sorterAsc=function(e,t){return e-t},e.sorterDes=function(e,t){return t-e},e.distinctVals=function(t){var r,n=t.slice();for(n.sort(e.sorterAsc),r=n.length-1;r>-1&&n[r]===i;r--);for(var a,o=n[r]-n[0]||1,s=o/(r||1)/1e4,l=[],c=0;c<=r;c++){var u=n[c],h=u-a;void 0===a?(l.push(u),a=u):h>s&&(o=Math.min(o,h),l.push(u),a=u)}return{vals:l,minDiff:o}},e.roundUp=function(e,t,r){for(var n,i=0,a=t.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i<a&&o++<100;)t[n=c((i+a)/2)]<=e?i=n+s:a=n-l;return t[i]},e.sort=function(e,t){for(var r=0,n=0,i=1;i<e.length;i++){var a=t(e[i],e[i-1]);if(a<0?r=1:a>0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},e.findIndexOfMin=function(e,t){t=t||n;for(var r,i=1/0,a=0;a<e.length;a++){var o=t(e[a]);o<i&&(i=o,r=a)}return r}}}),Ye=m({"src/lib/sort_object_keys.js"(e,t){t.exports=function(e){return Object.keys(e).sort()}}}),Xe=m({"src/lib/stats.js"(e){var t=M(),r=I().isArrayOrTypedArray;e.aggNums=function(n,i,a,o){var s,l;if((!o||o>a.length)&&(o=a.length),t(i)||(i=!1),r(a[0])){for(l=new Array(o),s=0;s<o;s++)l[s]=e.aggNums(n,i,a[s]);a=l}for(s=0;s<o;s++)t(i)?t(a[s])&&(i=n(+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,r){return r||(r=e.len(t)),e.aggNums((function(e,t){return e+t}),0,t)/r},e.geometricMean=function(t,r){return r||(r=e.len(t)),Math.pow(e.aggNums((function(e,t){return e*t}),1,t),1/r)},e.midRange=function(t){if(void 0!==t&&0!==t.length)return(e.aggNums(Math.max,null,t)+e.aggNums(Math.min,null,t))/2},e.variance=function(r,n,i){return n||(n=e.len(r)),t(i)||(i=e.mean(r,n)),e.aggNums((function(e,t){return e+Math.pow(t-i,2)}),0,r)/n},e.stdev=function(t,r,n){return Math.sqrt(e.variance(t,r,n))},e.median=function(t){var r=t.slice().sort();return e.interp(r,.5)},e.interp=function(e,r){if(!t(r))throw"n should be a finite number";if((r=r*e.length-.5)<0)return e[0];if(r>e.length-1)return e[e.length-1];var n=r%1;return n*e[Math.ceil(r)]+(1-n)*e[Math.floor(r)]}}}),$e=m({"src/lib/angles.js"(e,t){var r=R(),n=r.mod,i=r.modHalf,a=Math.PI,o=2*a;function s(e){return Math.abs(e[1]-e[0])>o-1e-14}function l(e,t){return i(t-e,o)}function c(e,t){if(s(t))return!0;var r,i;t[0]<t[1]?(r=t[0],i=t[1]):(r=t[1],i=t[0]),(r=n(r,o))>(i=n(i,o))&&(i+=o);var a=n(e,o),l=a+o;return a>=r&&a<=i||l>=r&&l<=i}function u(e,t,r,n,i,l,c){i=i||0,l=l||0;var u,h,f,p,d,m=s([r,n]);function g(e,t){return[e*Math.cos(t)+i,l-e*Math.sin(t)]}m?(u=0,h=a,f=o):r<n?(u=r,f=n):(u=n,f=r),e<t?(p=e,d=t):(p=t,d=e);var y,v=Math.abs(f-u)<=a?0:1;function x(e,t,r){return"A"+[e,e]+" "+[0,v,r]+" "+g(e,t)}return m?y=null===p?"M"+g(d,u)+x(d,h,0)+x(d,f,0)+"Z":"M"+g(p,u)+x(p,h,0)+x(p,f,0)+"ZM"+g(d,u)+x(d,h,1)+x(d,f,1)+"Z":null===p?(y="M"+g(d,u)+x(d,f,0),c&&(y+="L0,0Z")):y="M"+g(p,u)+"L"+g(d,u)+x(d,f,0)+"L"+g(p,f)+x(p,u,1)+"Z",y}t.exports={deg2rad:function(e){return e/180*a},rad2deg:function(e){return e/a*180},angleDelta:l,angleDist:function(e,t){return Math.abs(l(e,t))},isFullCircle:s,isAngleInsideSector:c,isPtInsideSector:function(e,t,r,n){return!!c(t,n)&&(r[0]<r[1]?(i=r[0],a=r[1]):(i=r[1],a=r[0]),e>=i&&e<=a);var i,a},pathArc:function(e,t,r,n,i){return u(null,e,t,r,n,i,0)},pathSector:function(e,t,r,n,i){return u(null,e,t,r,n,i,1)},pathAnnulus:function(e,t,r,n,i,a){return u(e,t,r,n,i,a,1)}}}}),Ke=m({"src/lib/anchor_utils.js"(e){e.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},e.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},e.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},e.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},e.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},e.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}}}),Je=m({"src/lib/geometry2d.js"(e){var t,r,n,i=R().mod;function a(e,t,r,n,i,a,o,s){var l=r-e,c=i-e,u=o-i,h=n-t,f=a-t,p=s-a,d=l*p-u*h;if(0===d)return null;var m=(c*p-u*f)/d,g=(c*h-l*f)/d;return g<0||g>1||m<0||m>1?null:{x:e+l*m,y:t+h*m}}function o(e,t,r,n,i){var a=n*e+i*t;if(a<0)return n*n+i*i;if(a>r){var o=n-e,s=i-t;return o*o+s*s}var l=n*t-i*e;return l*l/r}e.segmentsIntersect=a,e.segmentDistance=function(e,t,r,n,i,s,l,c){if(a(e,t,r,n,i,s,l,c))return 0;var u=r-e,h=n-t,f=l-i,p=c-s,d=u*u+h*h,m=f*f+p*p,g=Math.min(o(u,h,d,i-e,s-t),o(u,h,d,l-e,c-t),o(f,p,m,e-i,t-s),o(f,p,m,r-i,n-s));return Math.sqrt(g)},e.getTextLocation=function(e,a,o,s){if((e!==r||s!==n)&&(t={},r=e,n=s),t[o])return t[o];var l=e.getPointAtLength(i(o-s/2,a)),c=e.getPointAtLength(i(o+s/2,a)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=e.getPointAtLength(i(o,a)),f={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};return t[o]=f,f},e.clearLocationCache=function(){r=null},e.getVisibleSegment=function(e,t,r){var n,i,a=t.left,o=t.right,s=t.top,l=t.bottom,c=0,u=e.getTotalLength(),h=u;function f(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(i=r);var c=r.x<a?a-r.x:r.x>o?r.x-o:0,h=r.y<s?s-r.y:r.y>l?r.y-l:0;return Math.sqrt(c*c+h*h)}for(var p=f(c);p;){if((c+=p+r)>h)return;p=f(c)}for(p=f(h);p;){if(c>(h-=p+r))return;p=f(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},e.findPointOnPath=function(e,t,r,n){for(var i,a,o,s=(n=n||{}).pathLength||e.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(s)[r]?-1:1,h=0,f=0,p=s;h<c;){if(i=(f+p)/2,o=(a=e.getPointAtLength(i))[r]-t,Math.abs(o)<l)return a;u*o>0?p=i:f=i,h++}return a}}}),Qe=m({"src/lib/throttle.js"(e){var t={};function r(e){e&&null!==e.timer&&(clearTimeout(e.timer),e.timer=null)}e.throttle=function(e,n,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}}function l(){i(),a.ts=Date.now(),a.onDone&&(a.onDone(),a.onDone=null)}r(a),o>a.ts+n?l():a.timer=setTimeout((function(){l(),a.timer=null}),n)},e.done=function(e){var r=t[e];return r&&r.timer?new Promise((function(e){var t=r.onDone;r.onDone=function(){t&&t(),e(),r.onDone=null}})):Promise.resolve()},e.clear=function(n){if(n)r(t[n]),delete t[n];else for(var i in t)e.clear(i)}}}),et=m({"src/lib/clear_responsive.js"(e,t){t.exports=function(e){e._responsiveChartHandler&&(window.removeEventListener("resize",e._responsiveChartHandler),delete e._responsiveChartHandler)}}}),tt=m({"node_modules/is-mobile/index.js"(e,t){t.exports=a,t.exports.isMobile=a,t.exports.default=a;var r=/(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/,i=/android|ipad|playbook|silk/i;function a(e){e||(e={});let t=e.ua;if(!t&&typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"!=typeof t)return!1;let a=r.test(t)&&!n.test(t)||!!e.tablet&&i.test(t);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==t.indexOf("Macintosh")&&-1!==t.indexOf("Safari")&&(a=!0),a}}}),rt=m({"src/lib/preserve_drawing_buffer.js"(e,t){var r=M(),n=tt();t.exports=function(e){var t,i;if(e&&e.hasOwnProperty("userAgent")?t=e.userAgent:(typeof navigator<"u"&&(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),t=i),"string"!=typeof t)return!0;var a=n({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!a)for(var o=t.split(" "),s=1;s<o.length;s++)if(-1!==o[s].indexOf("Safari"))for(var l=s-1;l>-1;l--){var c=o[l];if("Version/"===c.slice(0,8)){var u=c.slice(8).split(".")[0];if(r(u)&&(u=+u),u>=13)return!0}}return a}}}),nt=m({"src/lib/make_trace_groups.js"(e,t){var r=b();t.exports=function(e,t,n){var i=e.selectAll("g."+n.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",n),i.order();var a=e.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(e){e[0][a]=r.select(this)})),i}}}),it=m({"src/lib/localize.js"(e,t){var r=He();t.exports=function(e,t){for(var n=e._context.locale,i=0;i<2;i++){for(var a=e._context.locales,o=0;o<2;o++){var s=(a[n]||{}).dictionary;if(s){var l=s[t];if(l)return l}a=r.localeRegistry}var c=n.split("-")[0];if(c===n)break;n=c}return t}}}),at=m({"src/lib/filter_unique.js"(e,t){t.exports=function(e){for(var t={},r=[],n=0,i=0;i<e.length;i++){var a=e[i];1!==t[a]&&(t[a]=1,r[n++]=a)}return r}}}),ot=m({"src/lib/filter_visible.js"(e,t){function r(e){return!0===e.visible}function n(e){var t=e[0].trace;return!0===t.visible&&0!==t._length}t.exports=function(e){for(var t=(s=e,Array.isArray(s)&&Array.isArray(s[0])&&s[0][0]&&s[0][0].trace?n:r),i=[],a=0;a<e.length;a++){var o=e[a];t(o)&&i.push(o)}var s;return i}}}),st=m({"src/lib/increment.js"(e,t){t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,i=String(n).length;if(i>16){var a=String(t).length;if(i>=String(e).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}}}),lt=m({"src/lib/clean_number.js"(e,t){var r=M(),n=S().BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;t.exports=function(e){return"string"==typeof e&&(e=e.replace(i,"")),r(e)?Number(e):n}}}),ct=m({"src/lib/index.js"(e,t){var r=b(),n=T().utcFormat,i=k().format,a=M(),o=S(),s=o.FP_SAFE,l=-s,c=o.BADNUM,u=t.exports={};u.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var h={};u.warnBadFormat=function(e){var t=String(e);h[t]||(h[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=L(),u.keyedContainer=P(),u.relativeAttr=z(),u.isPlainObject=C(),u.toLogRange=D(),u.relinkPrivateKeys=O();var d=I();u.isArrayBuffer=d.isArrayBuffer,u.isTypedArray=d.isTypedArray,u.isArrayOrTypedArray=d.isArrayOrTypedArray,u.isArray1D=d.isArray1D,u.ensureArray=d.ensureArray,u.concat=d.concat,u.maxRowLength=d.maxRowLength,u.minRowLength=d.minRowLength;var m=R();u.mod=m.mod,u.modHalf=m.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 y=Ge();u.dateTime2ms=y.dateTime2ms,u.isDateTime=y.isDateTime,u.ms2DateTime=y.ms2DateTime,u.ms2DateTimeLocal=y.ms2DateTimeLocal,u.cleanDate=y.cleanDate,u.isJSDate=y.isJSDate,u.formatDate=y.formatDate,u.incrementMonth=y.incrementMonth,u.dateTick0=y.dateTick0,u.dfltRange=y.dfltRange,u.findExactDates=y.findExactDates,u.MIN_MS=y.MIN_MS,u.MAX_MS=y.MAX_MS;var v=Ze();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=Ye();var x=Xe();u.aggNums=x.aggNums,u.len=x.len,u.mean=x.mean,u.geometricMean=x.geometricMean,u.median=x.median,u.midRange=x.midRange,u.variance=x.variance,u.stdev=x.stdev,u.interp=x.interp;var _=Le();u.init2dArray=_.init2dArray,u.transposeRagged=_.transposeRagged,u.dot=_.dot,u.translationMatrix=_.translationMatrix,u.rotationMatrix=_.rotationMatrix,u.rotationXYMatrix=_.rotationXYMatrix,u.apply3DTransform=_.apply3DTransform,u.apply2DTransform=_.apply2DTransform,u.apply2DTransform2=_.apply2DTransform2,u.convertCssMatrix=_.convertCssMatrix,u.inverseTransformMatrix=_.inverseTransformMatrix;var w=$e();u.deg2rad=w.deg2rad,u.rad2deg=w.rad2deg,u.angleDelta=w.angleDelta,u.angleDist=w.angleDist,u.isFullCircle=w.isFullCircle,u.isAngleInsideSector=w.isAngleInsideSector,u.isPtInsideSector=w.isPtInsideSector,u.pathArc=w.pathArc,u.pathSector=w.pathSector,u.pathAnnulus=w.pathAnnulus;var A=Ke();u.isLeftAnchor=A.isLeftAnchor,u.isCenterAnchor=A.isCenterAnchor,u.isRightAnchor=A.isRightAnchor,u.isTopAnchor=A.isTopAnchor,u.isMiddleAnchor=A.isMiddleAnchor,u.isBottomAnchor=A.isBottomAnchor;var E=Je();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 F=B();u.extendFlat=F.extendFlat,u.extendDeep=F.extendDeep,u.extendDeepAll=F.extendDeepAll,u.extendDeepNoArrays=F.extendDeepNoArrays;var j=J();u.log=j.log,u.warn=j.warn,u.error=j.error;var N=Y();u.counterRegex=N.counter;var U=Qe();u.throttle=U.throttle,u.throttleDone=U.done,u.clearThrottle=U.clear;var V=Pe();function q(e){var t={};for(var r in e)for(var n=e[r],i=0;i<n.length;i++)t[n[i]]=+r;return t}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=et(),u.preserveDrawingBuffer=rt(),u.makeTraceGroups=nt(),u._=it(),u.notifier=K(),u.filterUnique=at(),u.filterVisible=ot(),u.pushUnique=ee(),u.increment=st(),u.cleanNumber=lt(),u.ensureNumber=function(e){return a(e)?(e=Number(e))>s||e<l?c:e:c},u.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&a(e)&&e>=0&&e%1==0},u.noop=Q(),u.identity=We(),u.repeat=function(e,t){for(var r=new Array(t),n=0;n<t;n++)r[n]=e;return r},u.swapAttrs=function(e,t,r,n){r||(r="x"),n||(n="y");for(var i=0;i<t.length;i++){var a=t[i],o=u.nestedProperty(e,a.replace("?",r)),s=u.nestedProperty(e,a.replace("?",n)),l=o.get();o.set(s.get()),s.set(l)}},u.raiseToTop=function(e){e.parentNode.appendChild(e)},u.cancelTransition=function(e){return e.transition().duration(0)},u.constrain=function(e,t,r){return t>r?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},u.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},u.simpleMap=function(e,t,r,n,i){for(var a=e.length,o=new Array(a),s=0;s<a;s++)o[s]=t(e[s],r,n,i);return o},u.randstr=function e(t,r,n,i){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var a,o,s=Math.log(Math.pow(2,r))/Math.log(n),l="";for(a=2;s===1/0;a*=2)s=Math.log(Math.pow(2,r/a))/Math.log(n)*a;var c=s-Math.floor(s);for(a=0;a<Math.floor(s);a++)l=Math.floor(Math.random()*n).toString(n)+l;c&&(o=Math.pow(n,c),l=Math.floor(Math.random()*o).toString(n)+l);var h=parseInt(l,n);return t&&t[l]||h!==1/0&&h>=Math.pow(2,r)?i>10?(u.warn("randstr failed uniqueness"),l):e(t,r,n,(i||0)+1):l},u.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},u.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,i,a,o=e.length,s=2*o,l=2*t-1,c=new Array(l),u=new Array(o);for(r=0;r<l;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/t))/(2*t);for(r=0;r<o;r++){for(a=0,n=0;n<l;n++)(i=r+n+1-t)<-o?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=e[i]*c[n];u[r]=a}return u},u.syncOrAsync=function(e,t,r){var n;function i(){return u.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(i);return r&&r(t)},u.stripTrailingSlash=function(e){return"/"===e.slice(-1)?e.slice(0,-1):e},u.noneOrAll=function(e,t,r){if(e){var n,i=!1,a=!0;for(n=0;n<r.length;n++)null!=e[r[n]]?i=!0:a=!1;if(i&&!a)for(n=0;n<r.length;n++)e[r[n]]=t[r[n]]}},u.mergeArray=function(e,t,r,n){var i="function"==typeof n;if(u.isArrayOrTypedArray(e))for(var a=Math.min(e.length,t.length),o=0;o<a;o++){var s=e[o];t[o][r]=i?n(s):s}},u.mergeArrayCastPositive=function(e,t,r){return u.mergeArray(e,t,r,(function(e){var t=+e;return isFinite(t)&&t>0?t:0}))},u.fillArray=function(e,t,r,n){if(n=n||u.identity,u.isArrayOrTypedArray(e))for(var i=0;i<t.length;i++)t[i][r]=n(e[i])},u.castOption=function(e,t,r,n){n=n||u.identity;var i=u.nestedProperty(e,r).get();return u.isArrayOrTypedArray(i)?Array.isArray(t)&&u.isArrayOrTypedArray(i[t[0]])?n(i[t[0]][t[1]]):n(i[t]):i},u.extractOption=function(e,t,r,n){if(r in e)return e[r];var i=u.nestedProperty(t,n).get();return Array.isArray(i)?void 0:i},u.tagSelected=function(e,t,r){var n,i,a=t.selectedpoints,o=t._indexToPoints;o&&(n=q(o));for(var s=0;s<a.length;s++){var l=a[s];if(u.isIndex(l)||u.isArrayOrTypedArray(l)&&u.isIndex(l[0])&&u.isIndex(l[1])){var c=n?n[l]:l,h=r?r[c]:c;void 0!==(i=h)&&i<e.length&&(e[h].selected=1)}}},u.selIndices2selPoints=function(e){var t=e.selectedpoints,r=e._indexToPoints;if(r){for(var n=q(r),i=[],a=0;a<t.length;a++){var o=t[a];if(u.isIndex(o)){var s=n[o];u.isIndex(s)&&i.push(s)}}return i}return t},u.getTargetArray=function(e,t){var r=t.target;if("string"==typeof r&&r){var n=u.nestedProperty(e,r).get();return!!u.isArrayOrTypedArray(n)&&n}return!!u.isArrayOrTypedArray(r)&&r},u.minExtend=function e(t,r,n){var i={};"object"!=typeof r&&(r={});var a,o,s,l="pieLike"===n?-1:3,c=Object.keys(t);for(a=0;a<c.length;a++)s=t[o=c[a]],"_"!==o.charAt(0)&&"function"!=typeof s&&("module"===o?i[o]=s:Array.isArray(s)?i[o]="colorscale"===o||-1===l?s.slice():s.slice(0,l):u.isTypedArray(s)?i[o]=-1===l?s.subarray():s.subarray(0,l):i[o]=s&&"object"==typeof s?e(t[o],r[o],n):s);for(c=Object.keys(r),a=0;a<c.length;a++)("object"!=typeof(s=r[o=c[a]])||!(o in i)||"object"!=typeof i[o])&&(i[o]=s);return i},u.titleCase=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},u.containsAny=function(e,t){for(var r=0;r<t.length;r++)if(-1!==e.indexOf(t[r]))return!0;return!1};var H=/Version\/[\d\.]+.*Safari/;u.isSafari=function(){return H.test(window.navigator.userAgent)};var G=/iPad|iPhone|iPod/;u.isIOS=function(){return G.test(window.navigator.userAgent)};var W=/Macintosh.+AppleWebKit.+Gecko\)$/;u.isMacWKWebView=()=>W.test(window.navigator.userAgent);var Z=/Firefox\/(\d+)\.\d+/;u.getFirefoxVersion=function(){var e=Z.exec(window.navigator.userAgent);if(e&&2===e.length){var t=parseInt(e[1]);if(!isNaN(t))return t}return null},u.isD3Selection=function(e){return e instanceof r.selection},u.ensureSingle=function(e,t,r,n){var i=e.select(t+(r?"."+r:""));if(i.size())return i;var a=e.append(t);return r&&a.classed(r,!0),n&&a.call(n),a},u.ensureSingleById=function(e,t,r,n){var i=e.select(t+"#"+r);if(i.size())return i;var a=e.append(t).attr("id",r);return n&&a.call(n),a},u.objectFromPath=function(e,t){for(var r,n=e.split("."),i=r={},a=0;a<n.length;a++){var o=n[a],s=null,l=n[a].match(/(.*)\[([0-9]+)\]/);l?(o=l[1],s=l[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 $=/^([^\[\.]+)\.(.+)?/,te=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function re(e){return"__"===e.slice(0,2)}u.expandObjectPaths=function(e){var t,r,n,i,a,o,s;if("object"==typeof e&&!Array.isArray(e))for(r in e)if(e.hasOwnProperty(r))if(t=r.match($)){if(i=e[r],re(n=t[1]))continue;delete e[r],e[n]=u.extendDeepNoArrays(e[n]||{},u.objectFromPath(r,u.expandObjectPaths(i))[n])}else if(t=r.match(te)){if(i=e[r],re(n=t[1]))continue;if(a=parseInt(t[2]),delete e[r],e[n]=e[n]||[],"."===t[3])s=t[4],o=e[n][a]=e[n][a]||{},u.extendDeepNoArrays(o,u.objectFromPath(s,u.expandObjectPaths(i)));else{if(re(n))continue;e[n][a]=u.expandObjectPaths(i)}}else{if(re(r))continue;e[r]=u.expandObjectPaths(e[r])}return e},u.numSeparate=function(e,t,r){if(r||(r=!1),"string"!=typeof t||0===t.length)throw new Error("Separator string required for formatting!");"number"==typeof e&&(e=String(e));var n=/(\d+)(\d{3})/,i=t.charAt(0),a=t.charAt(1),o=e.split("."),s=o[0],l=o.length>1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},u.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var ne=/^\w*$/;u.templateString=function(e,t){var r={};return e.replace(u.TEMPLATE_STRING_REGEX,(function(e,n){var i;return ne.test(n)?i=t[n]:(r[n]=r[n]||u.nestedProperty(t,n).get,i=r[n](!0)),void 0!==i?i:""}))};var ie={max:10,count:0,name:"hovertemplate"};u.hovertemplateString=e=>ce(p(f({},e),{opts:ie}));var ae={max:10,count:0,name:"texttemplate"};u.texttemplateString=e=>ce(p(f({},e),{opts:ae}));var oe=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,se={max:10,count:0,name:"texttemplate",parseMultDiv:!0};u.texttemplateStringForShapes=e=>ce(p(f({},e),{opts:se}));var le=/^[:|\|]/;function ce({data:e=[],locale:t,fallback:r,labels:i={},opts:a,template:o}){return o.replace(u.TEMPLATE_STRING_REGEX,((o,s,l)=>{let c=["xother","yother"].includes(s),h=["_xother","_yother"].includes(s),f=["_xother_","_yother_"].includes(s),p=["xother_","yother_"].includes(s),d=c||h||p||f;(h||f)&&(s=s.substring(1)),(p||f)&&(s=s.substring(0,s.length-1));let m,g=null,y=null;if(a.parseMultDiv){var v=function(e){var t=e.match(oe);return t?{key:t[1],op:t[2],number:Number(t[3])}:{key:e,op:null,number:null}}(s);s=v.key,g=v.op,y=v.number}if(d){if(void 0===i[s])return"";m=i[s]}else for(let t of e)if(t){if(t.hasOwnProperty(s)){m=t[s];break}if(ne.test(s)||(m=u.nestedProperty(t,s).get(!0)),void 0!==m)break}if(void 0===m){let{count:e,max:t,name:n}=a,i=!1===r?o:r;return e<t&&u.warn([`Variable '${s}' in ${n} could not be found!`,"Please verify that the template is correct.",`Using value: '${i}'.`].join(" ")),e===t&&u.warn(`Too many '${n}' warnings - additional warnings will be suppressed.`),a.count++,i}if("*"===g&&(m*=y),"/"===g&&(m/=y),l){var x;if(":"===l[0]&&(x=t?t.numberFormat:u.numberFormat,""!==m&&(m=x(l.replace(le,""))(m))),"|"===l[0]){x=t?t.timeFormat:n;var _=u.dateTime2ms(m);m=u.formatDate(_,l.replace(le,""),!1,x)}}else{var b=s+"Label";i.hasOwnProperty(b)&&(m=i[b])}return d&&(m="("+m+")",(h||f)&&(m=" "+m),(p||f)&&(m+=" ")),m}))}u.subplotSort=function(e,t){for(var r=Math.min(e.length,t.length)+1,n=0,i=0,a=0;a<r;a++){var o=e.charCodeAt(a)||0,s=t.charCodeAt(a)||0,l=o>=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var ue=2e9;u.seedPseudoRandom=function(){ue=2e9},u.pseudoRandom=function(){var e=ue;return ue=(69069*ue+1)%4294967296,Math.abs(ue-e)<429496729?u.pseudoRandom():ue/4294967296},u.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},i=u.extractOption(e,t,"htx","hovertext");if(u.isValidTextValue(i))return n(i);var a=u.extractOption(e,t,"tx","text");return u.isValidTextValue(a)?n(a):void 0},u.isValidTextValue=function(e){return e||0===e},u.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n<t;n++)-1!==r.indexOf(".")&&(r=(r=r.replace("0%","%")).replace(".%","%"));return r},u.isHidden=function(e){var t=window.getComputedStyle(e).display;return!t||"none"===t},u.strTranslate=function(e,t){return e||t?"translate("+e+","+t+")":""},u.strRotate=function(e){return e?"rotate("+e+")":""},u.strScale=function(e){return 1!==e?"scale("+e+")":""},u.getTextTransform=function(e){var t=e.noCenter,r=e.textX,n=e.textY,i=e.targetX,a=e.targetY,o=e.anchorX||0,s=e.anchorY||0,l=e.rotate,c=e.scale;return c?c>1&&(c=1):c=0,u.strTranslate(i-c*(r+o),a-c*(n+s))+u.strScale(c)+(l?"rotate("+l+(t?"":" "+r+" "+n)+")":"")},u.setTransormAndDisplay=function(e,t){e.attr("transform",u.getTextTransform(t)),e.style("display",t.scale?null:"none")},u.ensureUniformFontSize=function(e,t){var r=u.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},u.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},u.bigFont=function(e){return Math.round(1.2*e)};var he=u.getFirefoxVersion(),fe=null!==he&&he<86;u.getPositionFromD3Event=function(){return fe?[r.event.layerX,r.event.layerY]:[r.event.offsetX,r.event.offsetY]}}}),ut=m({"build/plotcss.js"(){var e,t,r=ct(),n={"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(t in n)e=t.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),r.addStyleRule(e,n[t])}}),ht=m({"node_modules/is-browser/client.js"(e,t){t.exports=!0}}),ft=m({"node_modules/has-hover/index.js"(e,t){var r,n=ht();r="function"==typeof window.matchMedia?!window.matchMedia("(hover: none)").matches:n,t.exports=r}}),pt=m({"node_modules/events/events.js"(e,t){var r,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,a,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,a,o;if(l(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"==typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):m(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){n.once&&e.removeEventListener(t,i),r(a)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var c=l.length,u=m(l,c);for(r=0;r<c;++r)i(u[r],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return l(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,a,o;if(l(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return p(this,e,!0)},o.prototype.rawListeners=function(e){return p(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}}}),dt=m({"src/lib/events.js"(e,t){var r=pt().EventEmitter,n={init:function(e){if(e._ev instanceof r)return e;var t=new r,n=new r;return e._ev=t,e._internalEv=n,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=n.on.bind(n),e._internalOnce=n.once.bind(n),e._removeInternalListener=n.removeListener.bind(n),e._removeAllInternalListeners=n.removeAllListeners.bind(n),e.emit=function(e,r){t.emit(e,r),n.emit(e,r)},"function"==typeof e.addEventListener&&e.addEventListener("wheel",(()=>{}),{passive:!0}),e},triggerHandler:function(e,t,r){var n=e._ev;if(n){var i=n._events[t];if(i){var a;for(i=Array.isArray(i)?i:[i],a=0;a<i.length-1;a++)o(i[a]);return o(i[a])}}function o(e){return e.listener?(n.removeListener(t,e.listener),e.fired?void 0:(e.fired=!0,e.listener.apply(n,[r]))):e.apply(n,[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}};t.exports=n}}),mt=m({"src/lib/queue.js"(e,t){var r=ct(),n=$().dfltConfig,i={add:function(e,t,r,i,a){var o,s;e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},s=e.undoQueue.index,e.autoplay?e.undoQueue.inSequence||(e.autoplay=!1):(!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(r),o.redo.calls.push(i),o.redo.args.push(a)),e.undoQueue.queue.length>n.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r<t.undo.calls.length;r++)i.plotDo(e,t.undo.calls[r],t.undo.args[r]);e.undoQueue.inSequence=!1,e.autoplay=!1}},redo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index>=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r<t.redo.calls.length;r++)i.plotDo(e,t.redo.calls[r],t.redo.args[r]);e.undoQueue.inSequence=!1,e.autoplay=!1,e.undoQueue.index++}},plotDo:function(e,t,n){e.autoplay=!0,n=function(e,t){for(var n,i=[],a=0;a<t.length;a++)n=t[a],i[a]=n===e?n:"object"==typeof n?Array.isArray(n)?r.extendDeep([],n):r.extendDeepAll({},n):n;return i}(e,n),t.apply(null,n)}};t.exports=i}}),gt=m({"src/plots/frame_attributes.js"(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"}}}}),yt=m({"src/plot_api/plot_schema.js"(e){var t=He(),r=ct(),n=q(),i=Ve(),a=gt(),o=ze(),s=$().configAttributes,l=De(),c=r.extendDeepAll,u=r.isPlainObject,h=r.isArrayOrTypedArray,f=r.nestedProperty,p=r.valObjectMeta,d="_isSubplotObj",m="_isLinkedToArray",g="_deprecated",y=[d,m,"_arrayAttrRegexps",g];function v(e,t,r){if(!e)return!1;if(e._isLinkedToArray)if(x(t[r]))r++;else if(r<t.length)return!1;for(;r<t.length;r++){var n=e[t[r]];if(!u(n))break;if(e=n,r===t.length-1)break;if(e._isLinkedToArray){if(!x(t[++r]))return!1}else if("info_array"===e.valType){var i=t[++r];if(!x(i))return!1;var a=e.items;if(Array.isArray(a)){if(i>=a.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];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 _(){var e,r,n={};for(e in c(n,i),t.subplotsRegistry)if((r=t.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(r.attr))for(var a=0;a<r.attr.length;a++)T(n,r,r.attr[a]);else T(n,r,"subplot"===r.attr?r.name:r.attr);for(e in t.componentsRegistry){var o=(r=t.componentsRegistry[e]).schema;if(o&&(o.subplots||o.layout)){var s=o.subplots;if(s&&s.xaxis&&!s.yaxis)for(var l in s.xaxis)delete n.yaxis[l];delete n.xaxis.shift,delete n.xaxis.autoshift}else"colorscale"===r.name?c(n,r.layoutAttributes):r.layoutAttributes&&k(n,r.layoutAttributes,r.name)}return{layoutAttributes:w(n)}}function b(){var e={frames:c({},a)};return w(e),e.frames}function w(t){return function(t){e.crawl(t,(function(t,r,n){e.isValObject(t)?(!0===t.arrayOk||"data_array"===t.valType)&&(n[r+"src"]={valType:"string",editType:"none"}):u(t)&&(t.role="object")}))}(t),function(t){e.crawl(t,(function(e,t,r){if(e){var n=e[m];n&&(delete e[m],r[t]={items:{}},r[t].items[n]=e,r[t].role="object")}}))}(t),function(e){!function e(t){for(var r in t)if(u(t[r]))e(t[r]);else if(Array.isArray(t[r]))for(var n=0;n<t[r].length;n++)e(t[r][n]);else t[r]instanceof RegExp&&(t[r]=t[r].toString())}(e)}(t),t}function T(e,t,r){var n=f(e,r),i=c({},t.layoutAttributes);i[d]=!0,n.set(i)}function k(e,t,r){var n=f(e,r);n.set(c(n.get()||{},t))}e.IS_SUBPLOT_OBJ=d,e.IS_LINKED_TO_ARRAY=m,e.DEPRECATED=g,e.UNDERSCORE_ATTRS=y,e.get=function(){var r={};return t.allTypes.forEach((function(i){r[i]=function(r){var i,a;a=(i=t.modules[r]._module).basePlotModule;var o={type:null},s=c({},n),l=c({},i.attributes);e.crawl(l,(function(e,t,r,n,i){f(s,i).set(void 0),void 0===e&&f(l,i).set(void 0)})),c(o,s),t.traceIs(r,"noOpacity")&&delete o.opacity,t.traceIs(r,"showLegend")||(delete o.showlegend,delete o.legendgroup),t.traceIs(r,"noHover")&&(delete o.hoverinfo,delete o.hoverlabel),i.selectPoints||delete o.selectedpoints,c(o,l),a.attributes&&c(o,a.attributes),o.type=r;var u={meta:i.meta||{},categories:i.categories||{},animatable:!!i.animatable,type:r,attributes:w(o)};if(i.layoutAttributes){var h={};c(h,i.layoutAttributes),u.layoutAttributes=w(h)}return i.animatable||e.crawl(u,(function(t){e.isValObject(t)&&"anim"in t&&delete t.anim})),u}(i)})),{defs:{valObjects:p,metaKeys:y.concat(["description","role","editType","impliedEdits"]),editType:{traces:l.traces,layout:l.layout},impliedEdits:{}},traces:r,layout:_(),frames:b(),animation:w(o),config:w(s)}},e.crawl=function(t,r,n,i){var a=n||0;i=i||"",Object.keys(t).forEach((function(n){var o=t[n];if(-1===y.indexOf(n)){var s=(i?i+".":"")+n;r(o,n,t,a,s),!e.isValObject(o)&&u(o)&&"impliedEdits"!==n&&e.crawl(o,r,a+1,s)}}))},e.isValObject=function(e){return e&&void 0!==e.valType},e.findArrayAttributes=function(t){var r,i,a=[],o=[],s=[];function l(e,t,n,i){o=o.slice(0,i).concat([t]),s=s.slice(0,i).concat([e&&e._isLinkedToArray]),e&&("data_array"===e.valType||!0===e.arrayOk)&&("colorbar"!==o[i-1]||"ticktext"!==t&&"tickvals"!==t)&&c(r,0,"")}function c(e,t,r){var n=e[o[t]],l=r+o[t];if(t===o.length-1)h(n)&&a.push(i+l);else if(s[t]){if(Array.isArray(n))for(var f=0;f<n.length;f++)u(n[f])&&c(n[f],t+1,l+"["+f+"].")}else u(n)&&c(n,t+1,l+".")}return r=t,i="",e.crawl(n,l),t._module&&t._module.attributes&&e.crawl(t._module.attributes,l),a},e.getTraceValObject=function(e,r){var i,a,o=r[0],s=e._module;if(s||(s=(t.modules[e.type||n.type.dflt]||{})._module),!s)return!1;if(!(a=(i=s.attributes)&&i[o])){var l=s.basePlotModule;l&&l.attributes&&(a=l.attributes[o])}return a||(a=n[o]),v(a,r,1)},e.getLayoutValObject=function(e,r){var n=function(e,r){var n,a,o,s,l=e._basePlotModules;if(l){var c;for(n=0;n<l.length;n++){if((o=l[n]).attrRegex&&o.attrRegex.test(r)){if(o.layoutAttrOverrides)return o.layoutAttrOverrides;!c&&o.layoutAttributes&&(c=o.layoutAttributes)}var u=o.baseLayoutAttrOverrides;if(u&&r in u)return u[r]}if(c)return c}var h=e._modules;if(h)for(n=0;n<h.length;n++)if((s=h[n].layoutAttributes)&&r in s)return s[r];for(a in t.componentsRegistry){if("colorscale"===(o=t.componentsRegistry[a]).name&&0===r.indexOf("coloraxis"))return o.layoutAttributes[r];if(!o.schema&&r===o.name)return o.layoutAttributes}return r in i&&i[r]}(e,r[0]);return v(n,r,1)}}}),vt=m({"src/plot_api/plot_template.js"(e){var t=ct(),r=q(),n="templateitemname",i={name:{valType:"string",editType:"none"}};function a(e){return e&&"string"==typeof e}function o(e){var r=e.length-1;return"s"!==e.charAt(r)&&t.warn("bad argument to arrayDefaultKey: "+e),e.slice(0,-1)+"defaults"}i[n]={valType:"string",editType:"calc"},e.templatedArray=function(e,t){return t._isLinkedToArray=e,t.name=i.name,t[n]=i[n],t},e.traceTemplater=function(e){var n,i,a={};for(n in e)i=e[n],Array.isArray(i)&&i.length&&(a[n]=0);return{newTrace:function(o){var s={type:n=t.coerce(o,{},r,"type"),_template:null};if(n in a){i=e[n];var l=a[n]%i.length;a[n]++,s._template=i[l]}return s}}},e.newContainer=function(e,r,n){var i=e._template,a=i&&(i[r]||n&&i[n]);return t.isPlainObject(a)||(a=null),e[r]={_template:a}},e.arrayTemplater=function(e,t,r){var i=e._template,s=i&&i[o(t)],l=i&&i[t];(!Array.isArray(l)||!l.length)&&(l=[]);var c={};return{newItem:function(e){var t={name:e.name,_input:e},i=t[n]=e[n];if(!a(i))return t._template=s,t;for(var o=0;o<l.length;o++){var u=l[o];if(u.name===i)return c[i]=1,t._template=u,t}return t[r]=e[r]||!1,t._template=!1,t},defaultItems:function(){for(var e=[],t=0;t<l.length;t++){var r=l[t],i=r.name;if(a(i)&&!c[i]){var o={_template:r,name:i,_input:{_templateitemname:i}};o[n]=r[n],e.push(o),c[i]=1}}return e}}},e.arrayDefaultKey=o,e.arrayEditor=function(e,r,i){var a=(t.nestedProperty(e,r).get()||[]).length,o=i._index,s=o>=a&&(i._input||{})._templateitemname;s&&(o=a);var l,c=r+"["+o+"]";function u(){l={},s&&(l[c]={},l[c][n]=s)}function h(e,r){s?t.nestedProperty(l[c],e).set(r):l[c+"."+e]=r}function f(){var e=l;return u(),e}return u(),{modifyBase:function(e,t){l[e]=t},modifyItem:h,getUpdateObj:f,applyUpdate:function(r,n){r&&h(r,n);var i=f();for(var a in i)t.nestedProperty(e,a).set(i[a])}}}}}),xt=m({"src/plots/cartesian/constants.js"(e,t){var r=Y().counter;t.exports={idRegex:{x:r("x","( domain)?"),y:r("y","( domain)?")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("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"}}}),_t=m({"src/plots/cartesian/axis_ids.js"(e){var t=He(),r=xt();function n(e,t){if(t&&t.length)for(var r=0;r<t.length;r++)if(t[r][e])return!0;return!1}e.id2name=function(e){if("string"==typeof e&&e.match(r.AX_ID_PATTERN)){var t=e.split(" ")[0].slice(1);return"1"===t&&(t=""),e.charAt(0)+"axis"+t}},e.name2id=function(e){if(e.match(r.AX_NAME_PATTERN)){var t=e.slice(5);return"1"===t&&(t=""),e.charAt(0)+t}},e.cleanId=function(e,t,n){var i=/( domain)$/.test(e);if("string"==typeof e&&e.match(r.AX_ID_PATTERN)&&(!t||e.charAt(0)===t)&&(!i||n)){var a=e.split(" ")[0].slice(1).replace(/^0+/,"");return"1"===a&&(a=""),e.charAt(0)+a+(i&&n?" domain":"")}},e.list=function(t,r,n){var i=t._fullLayout;if(!i)return[];var a,o=e.listIds(t,r),s=new Array(o.length);for(a=0;a<o.length;a++){var l=o[a];s[a]=i[l.charAt(0)+"axis"+l.slice(1)]}if(!n){var c=i._subplots.gl3d||[];for(a=0;a<c.length;a++){var u=i[c[a]];r?s.push(u[r+"axis"]):s.push(u.xaxis,u.yaxis,u.zaxis)}}return s},e.listIds=function(e,t){var r=e._fullLayout;if(!r)return[];var n=r._subplots;return t?n[t+"axis"]:n.xaxis.concat(n.yaxis)},e.getFromId=function(t,r,n){var i=t._fullLayout;return r=void 0===r||"string"!=typeof r?r:r.replace(" domain",""),"x"===n?r=r.replace(/y[0-9]*/,""):"y"===n&&(r=r.replace(/x[0-9]*/,"")),i[e.id2name(r)]},e.getFromTrace=function(r,n,i){var a=r._fullLayout,o=null;if(t.traceIs(n,"gl3d")){var s=n.scene;"scene"===s.slice(0,5)&&(o=a[s][i+"axis"])}else o=e.getFromId(r,n[i+"axis"]||i);return o},e.idSort=function(e,t){var r=e.charAt(0),n=t.charAt(0);return r!==n?r>n?1:-1:+(e.slice(1)||1)-+(t.slice(1)||1)},e.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},e.isLinked=function(e,t){return n(t,e._axisMatchGroups)||n(t,e._axisConstraintGroups)}}}),bt=m({"src/components/shapes/handle_outline.js"(e,t){t.exports={clearOutlineControllers:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".outline-controllers").remove()},clearOutline:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".select-outline").remove(),e._fullLayout._outlining=!1}}}}),wt=m({"src/traces/scatter/layout_attributes.js"(e,t){t.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}}),Tt=m({"src/plots/get_data.js"(e){var t=He();xt().SUBPLOT_PATTERN,e.getSubplotCalcData=function(e,r,n){var i=t.subplotsRegistry[r];if(!i)return[];for(var a=i.attr,o=[],s=0;s<e.length;s++){var l=e[s];l[0].trace[a]===n&&o.push(l)}return o},e.getModuleCalcData=function(e,r,n){var i,a=[],o=[];if(!(i="string"==typeof r?t.getModule(r).plot:"function"==typeof r?r:r.plot))return[a,e];for(var s=n,l=0;l<e.length;l++){var c=e[l],u=c[0].trace,h=void 0!==u.zorder;!0!==u.visible||0===u._length||(!u._module||u._module.plot!==i||h&&u.zorder!==s?o.push(c):a.push(c))}return[a,o]},e.getSubplotData=function(e,r,n){if(!t.subplotsRegistry[r])return[];for(var i,a=t.subplotsRegistry[r].attr,o=[],s=0;s<e.length;s++)(i=e[s])[a]===n&&o.push(i);return o}}}),kt=m({"src/plots/command.js"(e){var t=He(),r=ct();function n(e,t,n){var i,a,o,s=!1;if("data"===t.type)i=e._fullData[null!==t.traces?t.traces[0]:0];else{if("layout"!==t.type)return!1;i=e._fullLayout}return a=r.nestedProperty(i,t.prop).get(),(o=n[t.type]=n[t.type]||{}).hasOwnProperty(t.prop)&&o[t.prop]!==a&&(s=!0),o[t.prop]=a,{changed:s,value:a}}function i(e,t){var n=[],i=t[0],a={};if("string"==typeof i)a[i]=t[1];else{if(!r.isPlainObject(i))return n;a=i}return o(a,(function(e,t,r){n.push({type:"layout",prop:e,value:r})}),"",0),n}function a(e,t){var n,i,a,s,l=[];if(i=t[0],a=t[1],n=t[2],s={},"string"==typeof i)s[i]=a;else{if(!r.isPlainObject(i))return l;s=i,void 0===n&&(n=a)}return void 0===n&&(n=null),o(s,(function(t,r,i){var a,o;if(Array.isArray(i)){o=i.slice();var s=Math.min(o.length,e.data.length);n&&(s=Math.min(s,n.length)),a=[];for(var c=0;c<s;c++)a[c]=n?n[c]:c}else o=i,a=n?n.slice():null;if(null===a)Array.isArray(o)&&(o=o[0]);else if(Array.isArray(a)){if(!Array.isArray(o)){var u=o;o=[];for(var h=0;h<a.length;h++)o[h]=u}o.length=Math.min(a.length,o.length)}l.push({type:"data",prop:t,traces:a,value:o})}),"",0),l}function o(e,t,n,i){Object.keys(e).forEach((function(a){var s=e[a];if("_"!==a[0]){var l=n+(i>0?".":"")+a;r.isPlainObject(s)?o(s,t,l,i+1):t(l,a,s)}}))}e.manageCommandObserver=function(t,i,a,o){var s={},l=!0;i&&i._commandObserver&&(s=i._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=e.hasSimpleAPICommandBindings(t,a,s.lookupTable);if(i&&i._commandObserver){if(c)return s;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,s}if(c){n(t,c,s.cache),s.check=function(){if(l){var e=n(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.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"],h=0;h<u.length;h++)t._internalOn(u[h],s.check);s.remove=function(){for(var e=0;e<u.length;e++)t._removeInternalListener(u[e],s.check)}}else r.log("Unable to automatically bind plot updates to API command"),s.lookupTable={},s.remove=function(){};return s.disable=function(){l=!1},s.enable=function(){l=!0},i&&(i._commandObserver=s),s},e.hasSimpleAPICommandBindings=function(t,r,n){var i,a,o=r.length;for(i=0;i<o;i++){var s,l=r[i],c=l.method,u=l.args;if(Array.isArray(u)||(u=[]),!c)return!1;var h=e.computeAPICommandBindings(t,c,u);if(1!==h.length)return!1;if(a){if((s=h[0]).type!==a.type||s.prop!==a.prop)return!1;if(Array.isArray(a.traces)){if(!Array.isArray(s.traces))return!1;s.traces.sort();for(var f=0;f<a.traces.length;f++)if(a.traces[f]!==s.traces[f])return!1}else if(s.prop!==a.prop)return!1}else a=h[0],Array.isArray(a.traces)&&a.traces.sort();var p=(s=h[0]).value;if(Array.isArray(p)){if(1!==p.length)return!1;p=p[0]}n&&(n[p]=i)}return a},e.executeAPICommand=function(e,n,i){if("skip"===n)return Promise.resolve();var a=t.apiMethodRegistry[n],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 r.warn("API call to Plotly."+n+" rejected.",e),Promise.reject(e)}))},e.computeAPICommandBindings=function(e,t,r){var n;switch(Array.isArray(r)||(r=[]),t){case"restyle":n=a(e,r);break;case"relayout":n=i(0,r);break;case"update":n=a(e,[r[0],r[2]]).concat(i(0,[r[1]]));break;case"animate":n=function(e,t){return Array.isArray(t[0])&&1===t[0].length&&-1!==["string","number"].indexOf(typeof t[0][0])?[{type:"layout",prop:"_currentFrame",value:t[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}}}),At=m({"src/plots/plots.js"(e,t){var r=b(),n=T().timeFormatLocale,i=k().formatLocale,a=M(),o=E(),s=He(),l=yt(),c=vt(),u=ct(),h=W(),f=S().BADNUM,p=_t(),d=bt().clearOutline,m=wt(),g=ze(),y=gt(),v=Tt().getModuleCalcData,x=u.relinkPrivateKeys,_=u._,w=t.exports={};u.extendFlat(w,s),w.attributes=q(),w.attributes.type.values=w.allTypes,w.fontAttrs=j(),w.layoutAttributes=Ve();var A=kt();w.executeAPICommand=A.executeAPICommand,w.computeAPICommandBindings=A.computeAPICommandBindings,w.manageCommandObserver=A.manageCommandObserver,w.hasSimpleAPICommandBindings=A.hasSimpleAPICommandBindings,w.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(w.previousPromises(e)))}),300)}))},w.resize=function(e){e=u.getGraphDiv(e);var t,r=new Promise((function(r,n){(!e||u.isHidden(e))&&n(new Error("Resize must be passed a displayed plot div element.")),e._redrawTimer&&clearTimeout(e._redrawTimer),e._resolveResize&&(t=e._resolveResize),e._resolveResize=r,e._redrawTimer=setTimeout((function(){if(!e.layout||e.layout.width&&e.layout.height||u.isHidden(e))r(e);else{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===r&&(delete e._resolveResize,r(e))}))}}),100)}));return t&&t(r),r},w.previousPromises=function(e){if((e._promises||[]).length)return Promise.all(e._promises).then((function(){e._promises=[]}))},w.addLinks=function(e){if(e._context.showLink||e._context.showSources){var t=e._fullLayout,n=u.ensureSingle(t._paper,"text","js-plot-link-container",(function(e){e.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:h.defaultLine,"pointer-events":"all"}).each((function(){var e=r.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=n.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),n.attr(a);var o=n.select(".js-link-to-tool"),s=n.select(".js-link-spacer"),l=n.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" »");if(e._context.sendData)r.on("click",(function(){w.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(e,o),s.text(o.text()&&l.text()?" - ":"")}},w.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var n=r.select(e).append("div").attr("id","hiddenform").style("display","none"),i=n.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=w.graphJson(e,!1,"keepdata"),i.node().submit(),n.remove(),e.emit("plotly_afterexport"),!1}};var C=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],I=["year","month","dayMonth","dayMonthYear"];function L(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,i={};function a(e){for(var r=!0,a=0;a<t.length;a++){var o=t[a];i[o]||(e[o]?i[o]=e[o]:r=!1)}r&&(n=!0)}for(var o=0;o<2;o++){for(var l=e._context.locales,c=0;c<2;c++){var u=(l[r]||{}).format;if(u&&(a(u),n))break;l=s.localeRegistry}var h=r.split("-")[0];if(n||h===r)break;r=h}return n||a(s.localeRegistry.en.format),i}function P(e,t){var r={_fullLayout:t},n="x"===e._id.charAt(0),i=e._mainAxis._anchorAxis,a="",o="",s="";if(i&&(s=i._mainAxis._id,a=n?e._id+s:s+e._id),!a||!t._plots[a]){a="";for(var l=e._counterAxes,c=0;c<l.length;c++){var u=l[c],h=n?e._id+u:u+e._id;o||(o=h);var f=p.getFromId(r,u);if(s&&f.overlaying===s){a=h;break}}}return a||o}function z(e){return"string"==typeof e&&"px"===e.slice(-2)&&parseFloat(e)}function D(e){var t=e.margin;if(!e._size){var r=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)};r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b}e._pushmargin||(e._pushmargin={}),e._pushmarginIds||(e._pushmarginIds={}),e._reservedMargin||(e._reservedMargin={})}w.supplyDefaults=function(e,t){var r=t&&t.skipUpdateCalc,a=e._fullLayout||{};if(a._skipDefaults)delete a._skipDefaults;else{var o,l=e._fullLayout={},c=e.layout||{},h=e._fullData||[],f=e._fullData=[],p=e.data||[],m=e.calcdata||[],g=e._context||{};e._transitionData||w.createTransitionData(e),l._dfltTitle={plot:_(e,"Click to enter Plot title"),subtitle:_(e,"Click to enter Plot subtitle"),x:_(e,"Click to enter X axis title"),y:_(e,"Click to enter Y axis title"),colorbar:_(e,"Click to enter Colorscale title"),annotation:_(e,"new text")},l._traceWord=_(e,"trace");var y=L(e,C);if(l._mapboxAccessToken=g.mapboxAccessToken,a._initialAutoSizeIsDone){var v=a.width,b=a.height;w.supplyLayoutGlobalDefaults(c,l,y),c.width||(l.width=v),c.height||(l.height=b),w.sanitizeMargins(l)}else{w.supplyLayoutGlobalDefaults(c,l,y);var T=!c.width||!c.height,k=l.autosize,A=g.autosizable;T&&(k||A)?w.plotAutoSize(e,c,l):T&&w.sanitizeMargins(l),!k&&T&&(c.width=l.width,c.height=l.height)}l._d3locale=function(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:n(e).utcFormat}}(y,l.separators),l._extraFormat=L(e,I),l._initialAutoSizeIsDone=!0,l._dataLength=p.length,l._modules=[],l._visibleModules=[],l._basePlotModules=[];var M=l._subplots=function(){var e,t,r=s.collectableSubplotTypes,n={};if(!r){r=[];var i=s.subplotsRegistry;for(var a in i){var o=i[a].attr;if(o&&(r.push(a),Array.isArray(o)))for(t=0;t<o.length;t++)u.pushUnique(r,o[t])}}for(e=0;e<r.length;e++)n[r[e]]=[];return n}(),S=l._splomAxes={x:{},y:{}},E=l._splomSubplots={};l._splomGridDflt={},l._scatterStackOpts={},l._firstScatter={},l._alignmentOpts={},l._colorAxes={},l._requestRangeslider={},l._traceUids=function(e,t){var r,n,i=t.length,a=[];for(r=0;r<e.length;r++){var o=e[r]._fullInput;o!==n&&a.push(o),n=o}var s=a.length,l=new Array(i),c={};function h(e,t){l[t]=e,c[e]=1}function f(e,t){if(e&&"string"==typeof e&&!c[e])return h(e,t),!0}for(r=0;r<i;r++){var p=t[r].uid;"number"==typeof p&&(p=String(p)),!f(p,r)&&(r<s&&f(a[r].uid,r)||h(u.randstr(c),r))}return l}(h,p),w.supplyDataDefaults(p,f,c,l);var P=Object.keys(S.x),z=Object.keys(S.y);if(P.length>1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o<P.length;o++)u.pushUnique(M.xaxis,P[o]);for(o=0;o<z.length;o++)u.pushUnique(M.yaxis,z[o]);for(var O in E)u.pushUnique(M.cartesian,O)}if(l._has=w._hasPlotType.bind(l),h.length===f.length)for(o=0;o<f.length;o++)x(f[o],h[o]);w.supplyLayoutModuleDefaults(c,l,f,e._transitionData);var R=l._visibleModules,F=[];for(o=0;o<R.length;o++){var B=R[o].crossTraceDefaults;B&&u.pushUnique(F,B)}for(o=0;o<F.length;o++)F[o](f,l);l._hasOnlyLargeSploms=1===l._basePlotModules.length&&"splom"===l._basePlotModules[0].name&&P.length>15&&z.length>15&&0===l.shapes.length&&0===l.images.length,w.linkSubplots(f,l,h,a),w.cleanPlot(f,l,h,a);var j=!(!a._has||!a._has("cartesian")),N=!(!l._has||!l._has("cartesian"));j&&!N?a._bgLayer.remove():N&&!j&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!e._dragging&&d({_fullLayout:a}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var i=0;i<e.length;i++){var a=e[i];a.meta?n[a.index]=a._meta={meta:a.meta}:t.meta&&(a._meta={meta:t.meta}),t.meta&&(a._meta.layout={meta:t.meta})}n.length&&(r||(r=t._meta={}),r.data=n)}(f,l),x(l,a),s.getComponentMethod("colorscale","crossTraceDefaults")(f,l),l._preGUI||(l._preGUI={}),l._tracePreGUI||(l._tracePreGUI={});var U,V=l._tracePreGUI,q={};for(U in V)q[U]="old";for(o=0;o<f.length;o++)q[U=f[o]._fullInput.uid]||(V[U]={}),q[U]="new";for(U in q)"old"===q[U]&&delete V[U];D(l),s.getComponentMethod("rangeslider","makeData")(l),!r&&m.length===f.length&&w.supplyDefaultsUpdateCalc(m,f)}},w.supplyDefaultsUpdateCalc=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=(e[r]||[])[0];if(i&&i.trace){var a=i.trace;if(a._hasCalcTransform){var o,s,l,c=a._arrayAttrs;for(o=0;o<c.length;o++)s=c[o],l=u.nestedProperty(a,s).get().slice(),u.nestedProperty(n,s).set(l)}i.trace=n}}},w.createTransitionData=function(e){e._transitionData||(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=[])},w._hasPlotType=function(e){var t,r=this._basePlotModules||[];for(t=0;t<r.length;t++)if(r[t].name===e)return!0;var n=this._modules||[];for(t=0;t<n.length;t++){var i=n[t].name;if(i===e)return!0;var a=s.modules[i];if(a&&a.categories[e])return!0}return!1},w.cleanPlot=function(e,t,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i<o.length;i++){var s=o[i];s.clean&&s.clean(e,t,r,n)}var l=n._has&&n._has("gl"),c=t._has&&t._has("gl");l&&!c&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var u=!!n._infolayer;e:for(i=0;i<r.length;i++){var h=r[i].uid;for(a=0;a<e.length;a++)if(h===e[a].uid)continue e;u&&n._infolayer.select(".cb"+h).remove()}},w.linkSubplots=function(e,t,r,n){var i,a,o=n._plots||{},l=t._plots={},c={_fullData:e,_fullLayout:t},h=t._subplots.cartesian||[];for(i=0;i<h.length;i++){var f,d=h[i],m=o[d],g=p.getFromId(c,d,"x"),y=p.getFromId(c,d,"y");for(m?f=l[d]=m:(f=l[d]={}).id=d,g._counterAxes.push(y._id),y._counterAxes.push(g._id),g._subplotsWith.push(d),y._subplotsWith.push(d),f.xaxis=g,f.yaxis=y,f._hasClipOnAxisFalse=!1,a=0;a<e.length;a++){var v=e[a];if(v.xaxis===f.xaxis._id&&v.yaxis===f.yaxis._id&&!1===v.cliponaxis){f._hasClipOnAxisFalse=!0;break}}}var x,_=p.list(c,null,!0);for(i=0;i<_.length;i++){var b=null;(x=_[i]).overlaying&&(b=p.getFromId(c,x.overlaying))&&b.overlaying&&(x.overlaying=!1,b=null),x._mainAxis=b||x,b&&(x.domain=b.domain.slice()),x._anchorAxis="free"===x.anchor?null:p.getFromId(c,x.anchor)}for(i=0;i<_.length;i++)if((x=_[i])._counterAxes.sort(p.idSort),x._subplotsWith.sort(u.subplotSort),x._mainSubplot=P(x,t),x._counterAxes.length&&(x.spikemode&&-1!==x.spikemode.indexOf("across")||x.automargin&&x.mirror&&"free"!==x.anchor||s.getComponentMethod("rangeslider","isVisible")(x))){var w=1,T=0;for(a=0;a<x._counterAxes.length;a++){var k=p.getFromId(c,x._counterAxes[a]);w=Math.min(w,k.domain[0]),T=Math.max(T,k.domain[1])}w<T&&(x._counterDomainMin=w,x._counterDomainMax=T)}},w.clearExpandedTraceDefaultColors=function(e){var t,r,n;for(r=[],(t=e._module._colorAttrs)||(e._module._colorAttrs=t=[],l.crawl(e._module.attributes,(function(e,n,i,a){r[a]=n,r.length=a+1,"color"===e.valType&&void 0===e.dflt&&t.push(r.join("."))}))),n=0;n<t.length;n++)u.nestedProperty(e,"_input."+t[n]).get()||u.nestedProperty(e,t[n]).set(null)},w.supplyDataDefaults=function(e,t,r,n){var i,a,o,l=n._modules,h=n._visibleModules,f=n._basePlotModules,p=0;function d(e){t.push(e);var r=e._module;r&&(u.pushUnique(l,r),!0===e.visible&&u.pushUnique(h,r),u.pushUnique(f,e._module.basePlotModule),!1!==e._input.visible&&p++)}n._transformModules=[];var m={},g=[],y=(r.template||{}).data||{},v=c.traceTemplater(y);for(i=0;i<e.length;i++)o=e[i],(a=v.newTrace(o)).uid=n._traceUids[i],w.supplyTraceDefaults(o,a,p,n,i),a.index=i,a._input=o,a._fullInput=a,d(a),s.traceIs(a,"carpetAxis")&&(m[a.carpet]=a),s.traceIs(a,"carpetDependent")&&g.push(i);for(i=0;i<g.length;i++)if((a=t[g[i]]).visible){var x=m[a.carpet];if(a._carpet=x,!x||!x.visible){a.visible=!1;continue}a.xaxis=x.xaxis,a.yaxis=x.yaxis}},w.supplyAnimationDefaults=function(e){e=e||{};var t,r={};function n(t,n){return u.coerce(e||{},r,g,t,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(e.frame))for(r.frame=[],t=0;t<e.frame.length;t++)r.frame[t]=w.supplyAnimationFrameDefaults(e.frame[t]||{});else r.frame=w.supplyAnimationFrameDefaults(e.frame||{});if(Array.isArray(e.transition))for(r.transition=[],t=0;t<e.transition.length;t++)r.transition[t]=w.supplyAnimationTransitionDefaults(e.transition[t]||{});else r.transition=w.supplyAnimationTransitionDefaults(e.transition||{});return r},w.supplyAnimationFrameDefaults=function(e){var t={};function r(r,n){return u.coerce(e||{},t,g.frame,r,n)}return r("duration"),r("redraw"),t},w.supplyAnimationTransitionDefaults=function(e){var t={};function r(r,n){return u.coerce(e||{},t,g.transition,r,n)}return r("duration"),r("easing"),t},w.supplyFrameDefaults=function(e){var t={};function r(r,n){return u.coerce(e,t,y,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),t},w.supplyTraceDefaults=function(e,t,r,n,i){var a,o=n.colorway||h.defaults,l=o[r%o.length];function c(r,n){return u.coerce(e,t,w.attributes,r,n)}var f=c("visible");c("type"),c("name",n._traceWord+" "+i),c("uirevision",n.uirevision);var p=w.getModule(t);if(t._module=p,p){var d=p.basePlotModule,m=d.attr,g=d.attributes;if(m&&g){var y=n._subplots,v="";if(Array.isArray(m))for(a=0;a<m.length;a++){var x=m[a],_=u.coerce(e,t,g,x);y[x]&&u.pushUnique(y[x],_),v+=_}else v=u.coerce(e,t,g,m);y[d.name]&&u.pushUnique(y[d.name],v)}}if(f&&(c("customdata"),c("ids"),c("meta"),s.traceIs(t,"showLegend")?(u.coerce(e,t,p.attributes.showlegend?p.attributes:w.attributes,"showlegend"),u.coerce(e,t,p.attributes.legend?p.attributes:w.attributes,"legend"),c("legendwidth"),c("legendgroup"),c("legendgrouptitle.text"),c("legendrank"),t._dfltShowLegend=!0):t._dfltShowLegend=!1,p&&p.supplyDefaults(e,t,l,n),s.traceIs(t,"noOpacity")||c("opacity"),s.traceIs(t,"notLegendIsolatable")&&(t.visible=!!t.visible),s.traceIs(t,"noHover")||(t.hovertemplate||u.coerceHoverinfo(e,t,n),"parcats"!==t.type&&s.getComponentMethod("fx","supplyDefaults")(e,t,l,n)),p&&p.selectPoints)){var b=c("selectedpoints");u.isTypedArray(b)&&(t.selectedpoints=Array.from(b))}return t},w.supplyLayoutGlobalDefaults=function(e,t,r){function n(r,n){return u.coerce(e,t,w.layoutAttributes,r,n)}var i=e.template;u.isPlainObject(i)&&(t.template=i,t._template=i.layout,t._dataTemplate=i.data),n("autotypenumbers");var a=u.coerceFont(n,"font"),o=a.size;u.coerceFont(n,"title.font",a,{overrideDflt:{size:Math.round(1.4*o)}}),n("title.text",t._dfltTitle.plot),n("title.xref");var l=n("title.yref");n("title.pad.t"),n("title.pad.r"),n("title.pad.b"),n("title.pad.l");var c=n("title.automargin");n("title.x"),n("title.xanchor"),n("title.y"),n("title.yanchor"),n("title.subtitle.text",t._dfltTitle.subtitle),u.coerceFont(n,"title.subtitle.font",a,{overrideDflt:{size:Math.round(.7*t.title.font.size)}}),c&&("paper"===l&&(0!==t.title.y&&(t.title.y=1),"auto"===t.title.yanchor&&(t.title.yanchor=0===t.title.y?"top":"bottom")),"container"===l&&("auto"===t.title.y&&(t.title.y=1),"auto"===t.title.yanchor&&(t.title.yanchor=t.title.y<.5?"bottom":"top"))),n("uniformtext.mode")&&n("uniformtext.minsize"),n("autosize",!(e.width&&e.height)),n("width"),n("height"),n("minreducedwidth"),n("minreducedheight"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),e.width&&e.height&&w.sanitizeMargins(t),s.getComponentMethod("grid","sizeDefaults")(e,t),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision");var h=n("uirevision");n("editrevision",h),n("selectionrevision",h),s.getComponentMethod("modebar","supplyLayoutDefaults")(e,t),s.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(e,t,n),s.getComponentMethod("selections","supplyDrawNewSelectionDefaults")(e,t,n),n("meta"),u.isPlainObject(e.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),s.getComponentMethod("calendars","handleDefaults")(e,t,"calendar"),s.getComponentMethod("fx","supplyLayoutGlobalDefaults")(e,t,n),u.coerce(e,t,m,"scattermode")},w.plotAutoSize=function(e,t,r){var n,i,o=e._context||{},s=o.frameMargins,l=u.isPlotDiv(e);if(l&&e.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else{var c=l?window.getComputedStyle(e):{};if(n=z(c.width)||z(c.maxWidth)||r.width,i=z(c.height)||z(c.maxHeight)||r.height,a(s)&&s>0){var h=1-2*s;n=Math.round(h*n),i=Math.round(h*i)}}var f=w.layoutAttributes.width.min,p=w.layoutAttributes.height.min;n<f&&(n=f),i<p&&(i=p);var d=!t.width&&Math.abs(r.width-n)>1,m=!t.height&&Math.abs(r.height-i)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),w.sanitizeMargins(r)},w.supplyLayoutModuleDefaults=function(e,t,r,n){var i,a,o,l=s.componentsRegistry,c=t._basePlotModules,h=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(e,t);for(var f in c.length||c.push(h),t._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(e,t),h.finalizeSubplots(e,t)),t._subplots)t._subplots[f].sort(u.subplotSort);for(a=0;a<c.length;a++)(o=c[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(e,t,r);var p=t._modules;for(a=0;a<p.length;a++)(o=p[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(e,t,r);var d=t._transformModules;for(a=0;a<d.length;a++)(o=d[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(e,t,r,n);for(i in l)(o=l[i]).supplyLayoutDefaults&&o.supplyLayoutDefaults(e,t,r)},w.purge=function(e){var t=e._fullLayout||{};void 0!==t._glcontainer&&(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()},w.style=function(e){var t,r=e._fullLayout._visibleModules,n=[];for(t=0;t<r.length;t++){var i=r[t];i.style&&u.pushUnique(n,i.style)}for(t=0;t<n.length;t++)n[t](e)},w.sanitizeMargins=function(e){if(e&&e.margin){var t,r=e.width,n=e.height,i=e.margin,a=r-(i.l+i.r),o=n-(i.t+i.b);a<0&&(t=(r-1)/(i.l+i.r),i.l=Math.floor(t*i.l),i.r=Math.floor(t*i.r)),o<0&&(t=(n-1)/(i.t+i.b),i.t=Math.floor(t*i.t),i.b=Math.floor(t*i.b))}},w.clearAutoMarginIds=function(e){e._fullLayout._pushmarginIds={}},w.allowAutoMargin=function(e,t){e._fullLayout._pushmarginIds[t]=1},w.autoMargin=function(e,t,r){var n=e._fullLayout,i=n.width,a=n.height,o=n.margin,s=n.minreducedwidth,l=n.minreducedheight,c=u.constrain(i-o.l-o.r,2,s),h=u.constrain(a-o.t-o.b,2,l),f=Math.max(0,i-c),p=Math.max(0,a-h),d=n._pushmargin,m=n._pushmarginIds;if(!1!==o.autoexpand){if(r){var g=r.pad;if(void 0===g&&(g=Math.min(12,o.l,o.r,o.t,o.b)),f){var y=(r.l+r.r)/f;y>1&&(r.l/=y,r.r/=y)}if(p){var v=(r.t+r.b)/p;v>1&&(r.t/=v,r.b/=v)}var x=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,T=void 0!==r.yb?r.yb:r.y;d[t]={l:{val:x,size:r.l+g},r:{val:_,size:r.r+g},b:{val:T,size:r.b+g},t:{val:b,size:r.t+g}},m[t]=1}else delete d[t],delete m[t];if(!n._replotting)return w.doAutoMargin(e)}},w.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),D(t);var i=t._size,o=t.margin,l={t:0,b:0,l:0,r:0},c=u.extendFlat({},i),h=o.l,f=o.r,d=o.t,m=o.b,g=t._pushmargin,y=t._pushmarginIds,v=t.minreducedwidth,x=t.minreducedheight;if(!1!==o.autoexpand){for(var _ in g)y[_]||delete g[_];var b=e._fullLayout._reservedMargin;for(var T in b)for(var k in b[T]){var A=b[T][k];l[k]=Math.max(l[k],A)}for(var M in g.base={l:{val:0,size:h},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:m}},l){var S=0;for(var E in g)"base"!==E&&a(g[E][M].size)&&(S=g[E][M].size>S?g[E][M].size:S);var C=Math.max(0,o[M]-S);l[M]=Math.max(0,l[M]-C)}for(var I in g){var L=g[I].l||{},P=g[I].b||{},z=L.val,O=L.size,R=P.val,F=P.size,B=r-l.r-l.l,j=n-l.t-l.b;for(var N in g){if(a(O)&&g[N].r){var U=g[N].r.val,V=g[N].r.size;if(U>z){var q=(O*U+(V-B)*z)/(U-z),H=(V*(1-z)+(O-B)*(1-U))/(U-z);q+H>h+f&&(h=q,f=H)}}if(a(F)&&g[N].t){var G=g[N].t.val,W=g[N].t.size;if(G>R){var Z=(F*G+(W-j)*R)/(G-R),Y=(W*(1-R)+(F-j)*(1-G))/(G-R);Z+Y>m+d&&(m=Z,d=Y)}}}}}var X=u.constrain(r-o.l-o.r,2,v),$=u.constrain(n-o.t-o.b,2,x),K=Math.max(0,r-X),J=Math.max(0,n-$);if(K){var Q=(h+f)/K;Q>1&&(h/=Q,f/=Q)}if(J){var ee=(m+d)/J;ee>1&&(m/=ee,d/=ee)}if(i.l=Math.round(h)+l.l,i.r=Math.round(f)+l.r,i.t=Math.round(d)+l.t,i.b=Math.round(m)+l.b,i.p=Math.round(o.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!t._replotting&&(w.didMarginChange(c,i)||function(e){if("_redrawFromAutoMarginCount"in e._fullLayout)return!1;var t=p.list(e,"",!0);for(var r in t)if(t[r].autoshift||t[r].shift)return!0;return!1}(e))){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var te=3*(1+Object.keys(y).length);if(t._redrawFromAutoMarginCount<te)return s.call("_doPlot",e);t._size=c,u.warn("Too many auto-margin redraws.")}!function(e){var t=p.list(e,"",!0);["_adjustTickLabelsOverflow","_hideCounterAxisInsideTickLabels"].forEach((function(e){for(var r=0;r<t.length;r++){var n=t[r][e];n&&n()}}))}(e)};var O=["l","r","t","b","p","w","h"];function R(e,t,r){var n=!1,i=[w.previousPromises,function(){if(e._transitionData)return e._transitioning=!1,function(e){var t=Promise.resolve();if(!e)return t;for(;e.length;)t=t.then(e.shift());return t}(e._transitionData._interruptCallbacks)},r.prepareFn,w.rehover,w.reselect,function(){return e.emit("plotly_transitioning",[]),new Promise((function(i){e._transitioning=!0,t.duration>0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.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++,!n&&o===a&&function(t){e._transitionData&&(function(e){if(e)for(;e.length;)e.shift()}(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t))}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,e);return(!a||!a.then)&&(a=Promise.resolve()),a.then((function(){return e}))}w.didMarginChange=function(e,t){for(var r=0;r<O.length;r++){var n=O[r],i=e[n],o=t[n];if(!a(i)||Math.abs(o-i)>1)return!0}return!1},w.graphJson=function(e,t,r,n,i,a){(i&&t&&!e._fullData||i&&!t&&!e._fullLayout)&&w.supplyDefaults(e);var s=i?e._fullData:e.data,l=i?e._fullLayout:e.layout,c=(e._transitionData||{})._frames;function h(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,i={};return Object.keys(e).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0))){if("function"==typeof e[a])return void(t&&(i[a]="_function"));if("keepdata"===r){if("src"===a.slice(-3))return}else if("keepstream"===r){if("string"==typeof(n=e[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[a+"src"])&&n.indexOf(":")>0)return;i[a]=h(e[a],t)}})),i}var a=Array.isArray(e),s=u.isTypedArray(e);if((a||s)&&e.dtype&&e.shape){var l=e.bdata;return h({dtype:e.dtype,shape:e.shape,bdata:u.isArrayBuffer(l)?o.encode(l):l},t)}return a?e.map((function(e){return h(e,t)})):s?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var f={data:(s||[]).map((function(e){var r=h(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=h(l),i)){var p=l._size;f.layout.computed={margin:{b:p.b,l:p.l,r:p.r,t:p.t}}}return c&&(f.frames=h(c)),a&&(f.config=h(e._context,!0)),"object"===n?f:JSON.stringify(f)},w.modifyFrames=function(e,t){var r,n,i,a=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r<t.length;r++)switch(n=t[r],n.type){case"replace":i=n.value;var s=(a[n.index]||{}).name,l=i.name;a[n.index]=o[l]=i,l!==s&&(delete o[s],o[l]=i);break;case"insert":o[(i=n.value).name]=i,a.splice(n.index,0,i);break;case"delete":delete o[(i=a[n.index]).name],a.splice(n.index,1)}return Promise.resolve()},w.computeFrame=function(e,t){var r,n,i,a,o=e._transitionData._frameHash;if(!t)throw new Error("computeFrame must be given a string frame name");var s=o[t.toString()];if(!s)return!1;for(var l=[s],c=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&-1===c.indexOf(s.name);)l.push(s),c.push(s.name);for(var u={};s=l.pop();)if(s.layout&&(u.layout=w.extendLayout(u.layout,s.layout)),s.data){if(u.data||(u.data=[]),!(n=s.traces))for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<s.data.length;r++)null!=(i=n[r])&&(-1===(a=u.traces.indexOf(i))&&(a=u.data.length,u.traces[a]=i),u.data[a]=w.extendTrace(u.data[a],s.data[r]))}return u},w.recomputeFrameHash=function(e){for(var t=e._transitionData._frameHash={},r=e._transitionData._frames,n=0;n<r.length;n++){var i=r[n];i&&i.name&&(t[i.name]=i)}},w.extendObjectWithContainers=function(e,t,r){var n,i,a,o,s,l,c,h=u.extendDeepNoArrays({},t||{}),f=u.expandObjectPaths(h),p={};if(r&&r.length)for(a=0;a<r.length;a++)void 0===(i=(n=u.nestedProperty(f,r[a])).get())?u.nestedProperty(p,r[a]).set(null):(n.set(null),u.nestedProperty(p,r[a]).set(i));if(e=u.extendDeepNoArrays(e||{},f),r&&r.length)for(a=0;a<r.length;a++)if(l=u.nestedProperty(p,r[a]).get()){for(c=(s=u.nestedProperty(e,r[a])).get(),Array.isArray(c)||(c=[],s.set(c)),o=0;o<l.length;o++){var d=l[o];c[o]=null===d?null:w.extendObjectWithContainers(c[o],d)}s.set(c)}return e},w.dataArrayContainers=["transforms","dimensions"],w.layoutArrayContainers=s.layoutArrayContainers,w.extendTrace=function(e,t){return w.extendObjectWithContainers(e,t,w.dataArrayContainers)},w.extendLayout=function(e,t){return w.extendObjectWithContainers(e,t,w.layoutArrayContainers)},w.transition=function(e,t,r,n,i,a){var o={redraw:i.redraw},s={},l=[];return o.prepareFn=function(){for(var i=Array.isArray(t)?t.length:0,a=n.slice(0,i),o=0;o<a.length;o++){var c=a[o],h=e._fullData[c]._module;if(h){if(h.animatable){var f=h.basePlotModule.name;s[f]||(s[f]=[]),s[f].push(c)}e.data[a[o]]=w.extendTrace(e.data[a[o]],t[o])}}var p=u.expandObjectPaths(u.extendDeepNoArrays({},r)),d=/^[xy]axis[0-9]*$/;for(var m in p)d.test(m)&&delete p[m].range;w.extendLayout(e.layout,p),delete e.calcdata,w.supplyDefaults(e),w.doCalcdata(e);var g=u.expandObjectPaths(r);if(g){var y=e._fullLayout._plots;for(var v in y){var x=y[v],_=x.xaxis,b=x.yaxis,T=_.range.slice(),k=b.range.slice(),A=null,M=null,S=null,E=null;Array.isArray(g[_._name+".range"])?A=g[_._name+".range"].slice():Array.isArray((g[_._name]||{}).range)&&(A=g[_._name].range.slice()),Array.isArray(g[b._name+".range"])?M=g[b._name+".range"].slice():Array.isArray((g[b._name]||{}).range)&&(M=g[b._name].range.slice()),T&&A&&(_.r2l(T[0])!==_.r2l(A[0])||_.r2l(T[1])!==_.r2l(A[1]))&&(S={xr0:T,xr1:A}),k&&M&&(b.r2l(k[0])!==b.r2l(M[0])||b.r2l(k[1])!==b.r2l(M[1]))&&(E={yr0:k,yr1:M}),(S||E)&&l.push(u.extendFlat({plotinfo:x},S,E))}}return Promise.resolve()},o.runFn=function(t){var n,i,o=e._fullLayout._basePlotModules,c=l.length;if(r)for(i=0;i<o.length;i++)o[i].transitionAxes&&o[i].transitionAxes(e,l,a,t);for(var h in c?((n=u.extendFlat({},a)).duration=0,delete s.cartesian):n=a,s){var f=s[h];e._fullData[f[0]]._module.basePlotModule.plot(e,f,n,t)}},R(e,a,o)},w.transitionFromReact=function(e,t,r,n){var i=e._fullLayout,a=i.transition,o={},s=[];return o.prepareFn=function(){var e=i._plots;for(var a in o.redraw=!1,"some"===t.anim&&(o.redraw=!0),"some"===r.anim&&(o.redraw=!0),e){var l=e[a],c=l.xaxis,h=l.yaxis,f=n[c._name].range.slice(),p=n[h._name].range.slice(),d=c.range.slice(),m=h.range.slice();c.setScale(),h.setScale();var g=null,y=null;(c.r2l(f[0])!==c.r2l(d[0])||c.r2l(f[1])!==c.r2l(d[1]))&&(g={xr0:f,xr1:d}),(h.r2l(p[0])!==h.r2l(m[0])||h.r2l(p[1])!==h.r2l(m[1]))&&(y={yr0:p,yr1:m}),(g||y)&&s.push(u.extendFlat({plotinfo:l},g,y))}return Promise.resolve()},o.runFn=function(r){for(var n,i,o,l=e._fullData,c=e._fullLayout._basePlotModules,h=[],f=0;f<l.length;f++)h.push(f);function p(){if(e._fullLayout)for(var t=0;t<c.length;t++)c[t].transitionAxes&&c[t].transitionAxes(e,s,n,r)}function d(){if(e._fullLayout)for(var t=0;t<c.length;t++)c[t].plot(e,o,i,r)}s.length&&t.anim?"traces first"===a.ordering?(n=u.extendFlat({},a,{duration:0}),o=h,i=a,setTimeout(p,a.duration),d()):(n=a,o=null,i=u.extendFlat({},a,{duration:0}),setTimeout(d,n.duration),p()):s.length?(n=a,p()):t.anim&&(o=h,i=a,d())},R(e,a,o)},w.doCalcdata=function(e,t){var r,n,i,a,o=p.list(e),c=e._fullData,h=e._fullLayout,d=new Array(c.length),m=(e.calcdata||[]).slice();for(e.calcdata=d,h._numBoxes=0,h._numViolins=0,h._violinScaleGroupStats={},e._hmpixcount=0,e._hmlumcount=0,h._piecolormap={},h._sunburstcolormap={},h._treemapcolormap={},h._iciclecolormap={},h._funnelareacolormap={},i=0;i<c.length;i++)if(Array.isArray(t)&&-1===t.indexOf(i)){d[i]=m[i];continue}for(i=0;i<c.length;i++)(r=c[i])._arrayAttrs=l.findArrayAttributes(r),r._extremes={};var g=h._subplots.polar||[];for(i=0;i<g.length;i++)o.push(h[g[i]].radialaxis,h[g[i]].angularaxis);for(var y in h._colorAxes){var v=h[y];!1!==v.cauto&&(delete v.cmin,delete v.cmax)}var x=!1;function _(t){if(r=c[t],n=r._module,!0===r.visible&&r.transforms){if(n&&n.calc){var i=n.calc(e,r);i[0]&&i[0].t&&i[0].t._scene&&delete i[0].t._scene.dirty}for(a=0;a<r.transforms.length;a++){var o=r.transforms[a];(n=transformsRegistry[o.type])&&n.calcTransform&&(r._hasCalcTransform=!0,x=!0,n.calcTransform(e,r,o))}}}function b(t,i){if(r=c[t],!!(n=r._module).isContainer===i){var o=[];if(!0===r.visible&&0!==r._length){delete r._indexToPoints;var s=r.transforms||[];for(a=s.length-1;a>=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}(!Array.isArray(o)||!o[0])&&(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,d[t]=o}}for(B(o,c,h),i=0;i<c.length;i++)b(i,!0);for(i=0;i<c.length;i++)_(i);for(x&&B(o,c,h),i=0;i<c.length;i++)b(i,!0);for(i=0;i<c.length;i++)b(i,!1);N(e);var w=function(e,t){var r,n,i,a,o,l=[];function c(e,r,n){var i=r._id.charAt(0);if("histogram2dcontour"===e){var a=r._counterAxes[0],o=p.getFromId(t,a),s="x"===i||"x"===a&&"category"===o.type,l="y"===i||"y"===a&&"category"===o.type;return function(e,t){return 0===e||0===t||s&&e===n[t].length-1||l&&t===n.length-1?-1:("y"===i?t:e)-1}}return function(e,t){return"y"===i?t:e}}var h={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 d(e,t){return t[1]-e[1]}for(r=0;r<e.length;r++){var m=e[r];if("category"===m.type){var g=m.categoryorder.match(F);if(g){var y=g[1],v=g[2],x=m._id.charAt(0),_="x"===x,b=[];for(n=0;n<m._categories.length;n++)b.push([m._categories[n],[]]);for(n=0;n<m._traceIndices.length;n++){var w=m._traceIndices[n],T=t._fullData[w];if(!0===T.visible){var k=T.type;s.traceIs(T,"histogram")&&(delete T._xautoBinFinished,delete T._yautoBinFinished);var A="splom"===k,M="scattergl"===k,S=t.calcdata[w];for(i=0;i<S.length;i++){var E,C,I=S[i];if(A){var L=T._axesDim[m._id];if(!_){var P=T._diag[L][0];P&&(m=t._fullLayout[p.id2name(P)])}var z=I.trace.dimensions[L].values;for(a=0;a<z.length;a++)for(E=m._categoriesMap[z[a]],o=0;o<I.trace.dimensions.length;o++)if(o!==L){var D=I.trace.dimensions[o];b[E][1].push(D.values[a])}}else if(M){for(a=0;a<I.t.x.length;a++)_?(E=I.t.x[a],C=I.t.y[a]):(E=I.t.y[a],C=I.t.x[a]),b[E][1].push(C);I.t&&I.t._scene&&delete I.t._scene.dirty}else if(I.hasOwnProperty("z")){C=I.z;var O=c(T.type,m,C);for(a=0;a<C.length;a++)for(o=0;o<C[a].length;o++)(E=O(o,a))+1&&b[E][1].push(C[a][o])}else for(void 0===(E=I.p)&&(E=I[x]),void 0===(C=I.s)&&(C=I.v),void 0===C&&(C=_?I.y:I.x),Array.isArray(C)||(C=void 0===C?[]:[C]),a=0;a<C.length;a++)b[E][1].push(C[a])}}}m._categoriesValue=b;var R=[];for(n=0;n<b.length;n++)R.push([b[n][0],h[y](b[n][1])]);R.sort("descending"===v?d:f),m._categoriesAggregatedValue=R,m._initialCategories=R.map((function(e){return e[0]})),l=l.concat(m.sortByInitialCategories())}}}return l}(o,e);if(w.length){for(h._numBoxes=0,h._numViolins=0,i=0;i<w.length;i++)b(w[i],!0);for(i=0;i<w.length;i++)b(w[i],!1);N(e)}s.getComponentMethod("fx","calc")(e),s.getComponentMethod("errorbars","calc")(e)};var F=/(total|sum|min|max|mean|geometric mean|median) (ascending|descending)/;function B(e,t,r){var n={};function i(e){e.clearCalc(),"multicategory"===e.type&&e.setupMultiCategory(t),n[e._id]=1}u.simpleMap(e,i);for(var a=r._axisMatchGroups||[],o=0;o<a.length;o++)for(var s in a[o])n[s]||i(r[p.id2name(s)])}function N(e){var t,r,n,i=e._fullLayout,a=i._visibleModules,o={};for(r=0;r<a.length;r++){var s=a[r],l=s.crossTraceCalc;if(l){var c=s.basePlotModule.name;o[c]?u.pushUnique(o[c],l):o[c]=[l]}}for(n in o){var h=o[n],f=i._subplots[n];if(Array.isArray(f))for(t=0;t<f.length;t++){var p=f[t],d="cartesian"===n?i._plots[p]:i[p];for(r=0;r<h.length;r++)h[r](e,d,p)}else for(r=0;r<h.length;r++)h[r](e)}}w.rehover=function(e){e._fullLayout._rehover&&e._fullLayout._rehover()},w.redrag=function(e){e._fullLayout._redrag&&e._fullLayout._redrag()},w.reselect=function(e){var t=e._fullLayout,r=(e.layout||{}).selections,n=t._previousSelections;t._previousSelections=r;var i=t._reselect||JSON.stringify(r)!==JSON.stringify(n);s.getComponentMethod("selections","reselect")(e,i)},w.generalUpdatePerTraceModule=function(e,t,r,n){var i,a=t.traceHash,o={};for(i=0;i<r.length;i++){var s=r[i],l=s[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(s))}for(var c in a)if(!o[c]){var h=a[c][0];h[0].trace.visible=!1,o[c]=[h]}for(var f in o){var p=o[f];p[0][0].trace._module.plot(e,t,u.filterVisible(p),n)}t.traceHash=o},w.plotBasePlot=function(e,t,r,n,i){var a=s.getModule(e),o=v(t.calcdata,a)[0];a.plot(t,o,n,i)},w.cleanBasePlot=function(e,t,r,n,i){var a=i._has&&i._has(e),o=r._has&&r._has(e);a&&!o&&i["_"+e+"layer"].selectAll("g.trace").remove()}}}),Mt=m({"src/constants/xmlns_namespaces.js"(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}}}),St=m({"src/constants/alignment.js"(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"}}}}),Et=m({"src/lib/svg_text_utils.js"(e){var t=b(),r=ct(),n=r.strTranslate,i=Mt(),a=St().LINE_SPACING,o=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;e.convertToTspans=function(d,b,M){var S=d.text(),I=!d.attr("data-notex")&&b&&b._context.typesetMath&&typeof MathJax<"u"&&S.match(o),L=t.select(d.node().parentNode);if(!L.empty()){var P=d.attr("class")?d.attr("class").split(" ")[0]:"text";return P+="-math",L.selectAll("svg."+P).remove(),L.selectAll("g."+P+"-group").remove(),d.style("display",null).attr({"data-unformatted":S,"data-math":"N"}),I?(b&&b._promises||[]).push(new Promise((function(e){d.style("display","none");var i=parseInt(d.node().style.fontSize,10),a={fontSize:i};!function(e,n,i){var a=parseInt((MathJax.version||"").split(".")[0]);if(2===a||3===a){var o,u,h,f,p=function(){var i="math-output-"+r.randstr({},64);f=t.select("body").append("div").attr({id:i}).style({visibility:"hidden",position:"absolute","font-size":n.fontSize+"px"}).text(function(e){return e.replace(s,"\\lt ").replace(l,"\\gt ")}(e));var o=f.node();return 2===a?MathJax.Hub.Typeset(o):MathJax.typeset([o])},d=function(){var n=f.select(2===a?".MathJax_SVG":".MathJax"),o=!n.empty()&&f.select("svg").node();if(o){var s,l=o.getBoundingClientRect();s=2===a?t.select("body").select("#MathJax_SVG_glyphs"):n.select("defs"),i(n,s,l)}else r.log("There was an error in the tex syntax.",e),i();f.remove()};2===a?MathJax.Hub.Queue((function(){return u=r.extendDeepAll({},MathJax.Hub.config),h=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:c},displayAlign:"left"})}),(function(){if("SVG"!==(o=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),p,d,(function(){if("SVG"!==o)return MathJax.Hub.setRenderer(o)}),(function(){return void 0!==h&&(MathJax.Hub.processSectionDelay=h),MathJax.Hub.Config(u)})):3===a&&(u=r.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=c,"svg"!==(o=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){p(),d(),"svg"!==o&&(MathJax.config.startup.output=o),MathJax.config=u})))}else r.warn("No MathJax version:",MathJax.version)}(I[2],a,(function(t,r,a){L.selectAll("svg."+P).remove(),L.selectAll("g."+P+"-group").remove();var o=t&&t.select("svg");if(!o||!o.node())return z(),void e();var s=L.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":S,"data-math":"Y"});s.node().appendChild(o.node()),r&&r.node()&&o.node().insertBefore(r.node().cloneNode(!0),o.node().firstChild);var l=a.width,c=a.height;o.attr({class:P,height:c,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=d.node().style.fill||"black",h=o.select("g");h.attr({fill:u,stroke:u});var f=h.node().getBoundingClientRect(),p=f.width,m=f.height;(p>l||m>c)&&(o.style("overflow","hidden"),p=(f=o.node().getBoundingClientRect()).width,m=f.height);var g=+d.attr("x"),y=+d.attr("y"),v=-(i||d.node().getBoundingClientRect().height)/4;if("y"===P[0])s.attr({transform:"rotate("+[-90,g,y]+")"+n(-p/2,v-m/2)});else if("l"===P[0])y=v-m/2;else if("a"===P[0]&&0!==P.indexOf("atitle"))g=0,y=v;else{var x=d.attr("text-anchor");g-=p*("middle"===x?.5:"end"===x?1:0),y=y+v-m/2}o.attr({x:g,y}),M&&M.call(d,s),e(s)}))}))):z(),d}function z(){L.empty()||(P=d.attr("class")+"-math",L.select("svg."+P).remove()),d.text("").style("white-space","pre");var n=function(e,n){n=n.replace(m," ");var o,s=!1,l=[],c=-1;function d(){c++;var r=document.createElementNS(i.svg,"tspan");t.select(r).attr({class:"line",dy:c*a+"em"}),e.appendChild(r),o=r;var n=l;if(l=[{node:r}],n.length>1)for(var s=1;s<n.length;s++)b(n[s])}function b(e){var r,n=e.type,a={};if("a"===n){r="a";var s=e.target,c=e.href,u=e.popup;c&&(a={"xlink:xlink:show":"_blank"===s||"_"!==s.charAt(0)?"new":"replace",target:s,"xlink:xlink:href":c},u&&(a.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+u+'");return false;'))}else r="tspan";e.style&&(a.style=e.style);var d=document.createElementNS(i.svg,r);if("sup"===n||"sub"===n){M(o,p),o.appendChild(d);var m=document.createElementNS(i.svg,"tspan");M(m,p),t.select(m).attr("dy",f[n]),a.dy=h[n],o.appendChild(d),o.appendChild(m)}else o.appendChild(d);t.select(d).attr(a),o=e.node=d,l.push(e)}function M(e,t){e.appendChild(document.createTextNode(t))}function S(e){if(1!==l.length){var t=l.pop();e!==t.type&&r.log("Start tag <"+t.type+"> doesnt match end tag <"+e+">. Pretending it did match.",n),o=l[l.length-1].node}else r.log("Ignoring unexpected end tag </"+e+">.",n)}v.test(n)?d():(o=e,l=[{node:e}]);for(var I=n.split(g),L=0;L<I.length;L++){var P=I[L],z=P.match(y),D=z&&z[2].toLowerCase(),O=u[D];if("br"===D)d();else if(void 0===O)M(o,E(P));else if(z[1])S(D);else{var R=z[4],F={type:D},B=k(R,x);if(B?(B=B.replace(A,"$1 fill:"),O&&(B+=";"+O)):O&&(B=O),B&&(F.style=B),"a"===D){s=!0;var j=k(R,_);if(j){var N=C(j);N&&(F.href=N,F.target=k(R,w)||"_blank",F.popup=k(R,T))}}b(F)}}return s}(d.node(),S);n&&d.style("pointer-events","all"),e.positionText(d),M&&M.call(d)}};var s=/(<|<|<)/g,l=/(>|>|>)/g,c=[["$","$"],["\\(","\\)"]],u={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"},h={sub:"0.3em",sup:"-0.6em"},f={sub:"-0.21em",sup:"0.42em"},p="",d=["http:","https:","mailto:","",void 0,":"],m=e.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,v=/<br(\s+.*)?>/i;e.BR_TAG_ALL=/<br(\s+.*)?>/gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&E(n)}var A=/(^|;)\s*color:/;e.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],i=e.split(g),a=[],o="",s=0,l=0;l<i.length;l++){var c=i[l],u=c.match(y),h=u&&u[2].toLowerCase();if(h)-1!==n.indexOf(h)&&(a.push(c),o=h);else{var f=c.length;if(s+f<r)a.push(c),s+=f;else if(s<r){var p=r-s;o&&("br"!==o||p<=3||f<=3)&&a.pop(),r>3?a.push(c.slice(0,Math.max(0,p-3))+"..."):a.push(c.slice(0,p));break}o=""}}return a.join("")};var M={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(e){return e.replace(S,(function(e,t){var r;return r="#"===t.charAt(0)?function(e){if(!(e>1114111)){var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}}("x"===t.charAt(1)?parseInt(t.slice(2),16):parseInt(t.slice(1),10)):M[t],r||e}))}function C(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var i=r.protocol,a=n.protocol;return-1!==d.indexOf(i)&&-1!==d.indexOf(a)?t:""}function I(e,t,n){var i,a,o,s=n.horizontalAlign,l=n.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-i.height}:"middle"===l?function(){return c.top+(c.height-i.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-i.width}:"center"===s?function(){return c.left+(c.width-i.width)/2}:function(){return c.left},function(){i=this.node().getBoundingClientRect();var e=o()-u.left,t=a()-u.top,s=n.gd||{};if(n.gd){s._fullLayout._calcInverseTransform(s);var l=r.apply3DTransform(s._fullLayout._invTransform)(e,t);e=l[0],t=l[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}e.convertEntities=E,e.sanitizeHTML=function(e){e=e.replace(m," ");for(var r=document.createElement("p"),n=r,i=[],a=e.split(g),o=0;o<a.length;o++){var s=a[o],l=s.match(y),c=l&&l[2].toLowerCase();if(c in u)if(l[1])i.length&&(n=i.pop());else{var h=l[4],f=k(h,x),p=f?{style:f}:{};if("a"===c){var d=k(h,_);if(d){var v=C(d);if(v){p.href=v;var b=k(h,w);b&&(p.target=b)}}}var T=document.createElement(c);n.appendChild(T),t.select(T).attr(p),n=T,i.push(T)}else n.appendChild(document.createTextNode(E(s)))}return r.innerHTML},e.lineCount=function(e){return e.selectAll("tspan.line").size()||1},e.positionText=function(e,r,n){return e.each((function(){var e=t.select(this);function i(t,r){return void 0===r?null===(r=e.attr(t))&&(e.attr(t,0),r=0):e.attr(t,r),r}var a=i("x",r),o=i("y",n);"text"===this.nodeName&&e.selectAll("tspan.line").attr({x:a,y:o})}))};var L="1px ";e.makeTextShadow=function(e){return L+L+L+e+", -"+L+"-"+L+L+e+", "+L+"-"+L+L+e+", -"+L+L+L+e},e.makeEditable=function(e,r){var n=r.gd,i=r.delegate,a=t.dispatch("edit","input","cancel"),o=i||e;if(e.style({"pointer-events":i?"none":"all"}),1!==e.size())throw new Error("boo");function s(){(function(){var i=t.select(n).select(".svg-container"),o=i.append("div"),s=e.node().style,c=parseFloat(s.fontSize||12),u=r.text;void 0===u&&(u=e.attr("data-unformatted")),o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":c,color:r.fill||s.fill||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(u).call(I(e,i,r)).on("blur",(function(){n._editing=!1,e.text(this.textContent).style({opacity:1});var r,i=t.select(this).attr("class");(r=i?"."+i.split(" ")[0]+"-math-group":"[class*=-math-group]")&&t.select(e.node().parentNode).select(r).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;n._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(){27===t.event.which?(n._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(I(e,i,r)))})).on("keydown",(function(){13===t.event.which&&this.blur()})).call(l)})(),e.style({opacity:0});var i,s=o.attr("class");(i=s?"."+s.split(" ")[0]+"-math-group":"[class*=-math-group]")&&t.select(e.node().parentNode).select(i).style({opacity:0})}function l(e){var t=e.node(),r=document.createRange();r.selectNodeContents(t);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),t.focus()}return r.immediate?s():o.on("click",s),t.rebind(e,a,"on")}}}),Ct=m({"src/components/colorscale/helpers.js"(e,t){var r=b(),n=F(),i=M(),a=ct(),o=W(),s=H().isValid,l=["showscale","autocolorscale","colorscale","reversescale","colorbar"],c=["min","max","mid","auto"];function u(e){var t,r,n,i=e._colorAx,a=i||e,o={};for(r=0;r<l.length;r++)o[n=l[r]]=a[n];if(i)for(t="c",r=0;r<c.length;r++)o[n=c[r]]=a["c"+n];else{var s;for(r=0;r<c.length;r++)((s="c"+(n=c[r]))in a||(s="z"+n)in a)&&(o[n]=a[s]);t=s.charAt(0)}return o._sync=function(e,r){var n=-1!==c.indexOf(e)?t+e:e;a[n]=a["_"+n]=r},o}function h(e){for(var t=u(e),r=t.min,n=t.max,i=t.reversescale?f(t.colorscale):t.colorscale,a=i.length,o=new Array(a),s=new Array(a),l=0;l<a;l++){var c=i[l];o[l]=r+c[0]*(n-r),s[l]=c[1]}return{domain:o,range:s}}function f(e){for(var t=e.length,r=new Array(t),n=t-1,i=0;n>=0;n--,i++){var a=e[n];r[i]=[1-a[0],a[1]]}return r}function p(e,t){t=t||{};for(var a=e.domain,s=e.range,l=s.length,c=new Array(l),u=0;u<l;u++){var h=n(s[u]).toRgb();c[u]=[h.r,h.g,h.b,h.a]}var f,p=r.scale.linear().domain(a).range(c).clamp(!0),m=t.noNumericCheck,g=t.returnArray;return(f=m&&g?p:m?function(e){return d(p(e))}:g?function(e){return i(e)?p(e):n(e).isValid()?e:o.defaultLine}:function(e){return i(e)?d(p(e)):n(e).isValid()?e:o.defaultLine}).domain=p.domain,f.range=function(){return s},f}function d(e){var t={r:e[0],g:e[1],b:e[2],a:e[3]};return n(t).toRgbString()}t.exports={hasColorscale:function(e,t,r){var n=t?a.nestedProperty(e,t).get()||{}:e,o=n[r||"color"];o&&o._inputArray&&(o=o._inputArray);var l=!1;if(a.isArrayOrTypedArray(o))for(var c=0;c<o.length;c++)if(i(o[c])){l=!0;break}return a.isPlainObject(n)&&(l||!0===n.showscale||i(n.cmin)&&i(n.cmax)||s(n.colorscale)||a.isPlainObject(n.colorbar))},extractOpts:u,extractScale:h,flipScale:f,makeColorScaleFunc:p,makeColorScaleFuncFromTrace:function(e,t){return p(h(e),t)}}}}),It=m({"src/plots/cartesian/axis_format_attributes.js"(e,t){var r=Re(),n=r.FORMAT_LINK,i=r.DATE_FORMAT_LINK;function a(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: "+n+"."].join(" ")}function o(e,t){return a(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:function(e,t){return{valType:"string",dflt:"",editType:"none",description:(t?a:o)("hover text",e)+["By default the values are formatted using "+(t?"generic number format":"`"+e+"axis.hoverformat`")+"."].join(" ")}},descriptionOnlyNumbers:a,descriptionWithDates:o}}}),Lt=m({"src/plots/cartesian/layout_attributes.js"(e,t){var r=j(),n=G(),i=Oe().dash,a=B().extendFlat,o=vt().templatedArray,s=(Fe().templateFormatStringDescription,It().descriptionWithDates),l=S().ONEDAY,c=xt(),u=c.HOUR_PATTERN,h=c.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 d(e){return{valType:"integer",min:0,dflt:e?5:0,editType:"ticks"}}var m={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},g={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},y={valType:"data_array",editType:"ticks"},v={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function x(e){var t={valType:"number",min:0,editType:"ticks"};return e||(t.dflt=5),t}function _(e){var t={valType:"number",min:0,editType:"ticks"};return e||(t.dflt=1),t}var b={valType:"color",dflt:n.defaultLine,editType:"ticks"},w={valType:"color",dflt:n.lightLine,editType:"ticks"};function T(e){var t={valType:"number",min:0,editType:"ticks"};return e||(t.dflt=1),t}var k=a({},i,{editType:"ticks"}),A={valType:"boolean",editType:"ticks"};t.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:n.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:r({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:[c.idRegex.x.toString(),c.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:[c.idRegex.x.toString(),c.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:[h,u,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:l},editType:"calc"}),tickmode:p,nticks:d(),tick0:m,dtick:g,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:y,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:x(),tickwidth:_(),tickcolor:b,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},labelalias:{valType:"any",dflt:!1,editType:"ticks"},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:a({},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:r({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:n.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:A,gridcolor:w,gridwidth:T(),griddash:k,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:n.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:n.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"plot"},minor:{tickmode:f,nticks:d("minor"),tick0:m,dtick:g,tickvals:y,ticks:v,ticklen:x("minor"),tickwidth:_("minor"),tickcolor:b,gridcolor:w,gridwidth:T("minor"),griddash:k,showgrid:A,editType:"ticks"},minorloglabels:{valType:"enumerated",values:["small digits","complete","none"],dflt:"small digits",editType:"calc"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},autoshift:{valType:"boolean",dflt:!1,editType:"plot"},shift:{valType:"number",editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),Pt=m({"src/components/colorbar/attributes.js"(e,t){var r=Lt(),n=j(),i=B().extendFlat,a=De().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:r.linecolor,outlinewidth:r.linewidth,bordercolor:r.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:r.minor.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:i({},r.ticks,{dflt:""}),ticklabeloverflow:i({},r.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:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,ticklabelstep:r.ticklabelstep,showticklabels:r.showticklabels,labelalias:r.labelalias,tickfont:n({}),tickangle:r.tickangle,tickformat:r.tickformat,tickformatstops:r.tickformatstops,tickprefix:r.tickprefix,showtickprefix:r.showtickprefix,ticksuffix:r.ticksuffix,showticksuffix:r.showticksuffix,separatethousands:r.separatethousands,exponentformat:r.exponentformat,minexponent:r.minexponent,showexponent:r.showexponent,title:{text:{valType:"string"},font:n({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")}}),zt=m({"src/components/colorscale/attributes.js"(e,t){var r=Pt(),n=Y().counter,i=Ye(),a=H().scales;function o(e){return"`"+e+"`"}i(a),t.exports=function(e,t){e=e||"";var i,s=(t=t||{}).cLetter||"c",l=("onlyIfNumerical"in t&&t.onlyIfNumerical,"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===s,u="string"==typeof t.colorscaleDflt?a[t.colorscaleDflt]:null,h=t.editTypeOverride||"",f=e?e+".":"";"colorAttr"in t?(i=t.colorAttr,t.colorAttr):o(f+(i={z:"z",c:"color"}[s]));var p=s+"auto",d=s+"min",m=s+"max",g=s+"mid",y=(o(f+p),o(f+d),o(f+m),{});y[d]=y[m]=void 0;var v={};v[p]=!1;var x={};return"color"===i&&(x.color={valType:"color",arrayOk:!0,editType:h||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:y},x[d]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:v},x[m]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:v},x[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:y},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=r),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:n("coloraxis"),dflt:null,editType:"calc"}),x}}}),Dt=m({"src/components/colorscale/layout_attributes.js"(e,t){var r=B().extendFlat,n=zt(),i=H().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:r({_isSubplotObj:!0,editType:"calc"},n("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}}}),Ot=m({"src/components/colorbar/has_colorbar.js"(e,t){var r=ct();t.exports=function(e){return r.isPlainObject(e.colorbar)}}}),Rt=m({"src/plots/cartesian/clean_ticks.js"(e){var t=M(),r=ct(),n=S(),i=n.ONEDAY,a=n.ONEWEEK;e.dtick=function(e,r){var n="log"===r,a="date"===r,o="category"===r,s=a?i:1;if(!e)return s;if(t(e))return(e=Number(e))<=0?s:o?Math.max(1,Math.round(e)):a?Math.max(.1,e):e;if("string"!=typeof e||!a&&!n)return s;var l=e.charAt(0),c=e.slice(1);return(c=t(c)?Number(c):0)<=0||!(a&&"M"===l&&c===Math.round(c)||n&&"L"===l||n&&"D"===l&&(1===c||2===c))?s:e},e.tick0=function(e,n,i,o){return"date"===n?r.cleanDate(e,r.dateTick0(i,o%a==0?1:0)):"D1"!==o&&"D2"!==o?t(e)?Number(e):0:void 0}}}),Ft=m({"src/plots/cartesian/tick_value_defaults.js"(e,t){var r=Rt(),n=ct().isArrayOrTypedArray,i=I().isTypedArraySpec,a=I().decodeTypedArraySpec;t.exports=function(e,t,o,s,l){l||(l={});var c=l.isMinor,u=c?e.minor||{}:e,h=c?t.minor:t,f=c?"minor.":"";function p(e){var t=u[e];return i(t)&&(t=a(t)),void 0!==t?t:(h._template||{})[e]}var d=p("tick0"),m=p("dtick"),g=p("tickvals"),y=o(f+"tickmode",n(g)?"array":m?"linear":"auto");if("auto"===y||"sync"===y)o(f+"nticks");else if("linear"===y){var v=h.dtick=r.dtick(m,s);h.tick0=r.tick0(d,s,t.calendar,v)}else"multicategory"!==s&&(void 0===o(f+"tickvals")?h.tickmode="auto":c||o("ticktext"))}}}),Bt=m({"src/plots/cartesian/tick_mark_defaults.js"(e,t){var r=ct(),n=Lt();t.exports=function(e,t,i,a){var o=a.isMinor,s=o?e.minor||{}:e,l=o?t.minor:t,c=o?n.minor:n,u=o?"minor.":"",h=r.coerce2(s,l,c,"ticklen",o?.6*(t.ticklen||5):void 0),f=r.coerce2(s,l,c,"tickwidth",o?t.tickwidth||1:void 0),p=r.coerce2(s,l,c,"tickcolor",(o?t.tickcolor:void 0)||l.color);i(u+"ticks",!o&&a.outerTicks||h||f||p?"outside":"")||(delete l.ticklen,delete l.tickwidth,delete l.tickcolor)}}}),jt=m({"src/plots/cartesian/show_dflt.js"(e,t){t.exports=function(e){var t=["showexponent","showtickprefix","showticksuffix"].filter((function(t){return void 0!==e[t]}));if(t.every((function(r){return e[r]===e[t[0]]}))||1===t.length)return e[t[0]]}}}),Nt=m({"src/plots/array_container_defaults.js"(e,t){var r=ct(),n=vt();t.exports=function(e,t,i){var a,o,s=i.name,l=i.inclusionAttr||"visible",c=t[s],u=r.isArrayOrTypedArray(e[s])?e[s]:[],h=t[s]=[],f=n.arrayTemplater(t,s,l);for(a=0;a<u.length;a++){var p=u[a];r.isPlainObject(p)?o=f.newItem(p):(o=f.newItem({}))[l]=!1,o._index=a,!1!==o[l]&&i.handleItemDefaults(p,o,t,i),h.push(o)}var d=f.defaultItems();for(a=0;a<d.length;a++)(o=d[a])._index=h.length,i.handleItemDefaults({},o,t,i,{}),h.push(o);if(r.isArrayOrTypedArray(c)){var m=Math.min(c.length,h.length);for(a=0;a<m;a++)r.relinkPrivateKeys(h[a],c[a])}return h}}}),Ut=m({"src/plots/cartesian/tick_label_defaults.js"(e,t){var r=ct(),n=W().contrast,i=Lt(),a=jt(),o=Nt();function s(e,t){function n(n,a){return r.coerce(e,t,i.tickformatstops,n,a)}n("enabled")&&(n("dtickrange"),n("value"))}t.exports=function(e,t,l,c,u){u||(u={});var h=l("labelalias");r.isPlainObject(h)||delete t.labelalias;var f=a(e);if(l("showticklabels")){u.noTicklabelshift||l("ticklabelshift"),u.noTicklabelstandoff||l("ticklabelstandoff");var p=u.font||{},d=t.color,m=-1!==(t.ticklabelposition||"").indexOf("inside")?n(u.bgColor):d&&d!==i.color.dflt?d:p.color;if(r.coerceFont(l,"tickfont",p,{overrideDflt:{color:m}}),!u.noTicklabelstep&&"multicategory"!==c&&"log"!==c&&l("ticklabelstep"),!u.noAng){var g=l("tickangle");!u.noAutotickangles&&"auto"===g&&l("autotickangles")}if("category"!==c){var y=l("tickformat");o(e,t,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:s}),t.tickformatstops.length||delete t.tickformatstops,!u.noExp&&!y&&"date"!==c&&(l("showexponent",f),l("exponentformat"),l("minexponent"),l("separatethousands"))}!u.noMinorloglabels&&"log"===c&&l("minorloglabels")}}}}),Vt=m({"src/plots/cartesian/prefix_suffix_defaults.js"(e,t){var r=jt();t.exports=function(e,t,n,i,a){a||(a={});var o=a.tickSuffixDflt,s=r(e);n("tickprefix")&&n("showtickprefix",s),n("ticksuffix",o)&&n("showticksuffix",s)}}}),qt=m({"src/components/colorbar/defaults.js"(e,t){var r=ct(),n=vt(),i=Ft(),a=Bt(),o=Ut(),s=Vt(),l=Pt();t.exports=function(e,t,c){var u=n.newContainer(t,"colorbar"),h=e.colorbar||{};function f(e,t){return r.coerce(h,u,l,e,t)}var p=c.margin||{t:0,b:0,l:0,r:0},d=c.width-p.l-p.r,m=c.height-p.t-p.b,g="v"===f("orientation"),y=f("thicknessmode");f("thickness","fraction"===y?30/(g?d:m):30);var v=f("lenmode");f("len","fraction"===v?1:g?m:d);var x,_,b,w="paper"===f("yref"),T="paper"===f("xref"),k="left";g?(b="middle",k=T?"left":"right",x=T?1.02:1,_=.5):(b=w?"bottom":"top",k="center",x=.5,_=w?1.02:1),r.coerce(h,u,{x:{valType:"number",min:T?-2:0,max:T?3:1,dflt:x}},"x"),r.coerce(h,u,{y:{valType:"number",min:w?-2:0,max:w?3:1,dflt:_}},"y"),f("xanchor",k),f("xpad"),f("yanchor",b),f("ypad"),r.noneOrAll(h,u,["x","y"]),f("outlinecolor"),f("outlinewidth"),f("bordercolor"),f("borderwidth"),f("bgcolor");var A=r.coerce(h,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",-1!==A.indexOf("inside")?"hide past domain":"hide past div"),i(h,u,f,"linear");var M=c.font,S={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:M};-1!==A.indexOf("inside")&&(S.bgColor="black"),s(h,u,f,"linear",S),o(h,u,f,"linear",S),a(h,u,f,"linear",S),f("title.text",c._dfltTitle.colorbar);var E=u.showticklabels?u.tickfont:M,C=r.extendFlat({},M,{family:E.family,size:r.bigFont(E.size)});r.coerceFont(f,"title.font",C),f("title.side",g?"top":"right")}}}),Ht=m({"src/components/colorscale/defaults.js"(e,t){var r=M(),n=ct(),i=Ot(),a=qt(),o=H().isValid,s=He().traceIs;function l(e,t){var r=t.slice(0,t.length-1);return t?n.nestedProperty(e,r).get()||{}:e}t.exports=function e(t,c,u,h,f){var p=f.prefix,d=f.cLetter,m="_module"in c,g=l(t,p),y=l(c,p),v=l(c._template||{},p)||{},x=function(){return delete t.coloraxis,delete c.coloraxis,e(t,c,u,h,f)};if(m){var _=u._colorAxes||{},b=h(p+"coloraxis");if(b){var w=s(c,"contour")&&n.nestedProperty(c,"contours.coloring").get()||"heatmap",T=_[b];return void(T?(T[2].push(x),T[0]!==w&&(T[0]=!1,n.warn(["Ignoring coloraxis:",b,"setting","as it is linked to incompatible colorscales."].join(" ")))):_[b]=[w,c,[x]])}}var k=g[d+"min"],A=g[d+"max"],M=r(k)&&r(A)&&k<A;h(p+d+"auto",!M)?h(p+d+"mid"):(h(p+d+"min"),h(p+d+"max"));var S,E,C=g.colorscale,I=v.colorscale;void 0!==C&&(S=!o(C)),void 0!==I&&(S=!o(I)),h(p+"autocolorscale",S),h(p+"colorscale"),h(p+"reversescale"),"marker.line."!==p&&(p&&m&&(E=i(g)),h(p+"showscale",E)&&(p&&v&&(y._template=v),a(g,y,u)))}}}),Gt=m({"src/components/colorscale/layout_defaults.js"(e,t){var r=ct(),n=vt(),i=Dt(),a=Ht();t.exports=function(e,t){function o(n,a){return r.coerce(e,t,i,n,a)}o("colorscale.sequential"),o("colorscale.sequentialminus"),o("colorscale.diverging");var s,l,c=t._colorAxes;function u(e,t){return r.coerce(s,l,i.coloraxis,e,t)}for(var h in c){var f=c[h];if(f[0])s=e[h]||{},(l=n.newContainer(t,h,"coloraxis"))._name=h,a(s,l,t,u,{prefix:"",cLetter:"c"});else{for(var p=0;p<f[2].length;p++)f[2][p]();delete t._colorAxes[h]}}}}}),Wt=m({"src/components/colorscale/cross_trace_defaults.js"(e,t){var r=ct(),n=Ct().hasColorscale,i=Ct().extractOpts;t.exports=function(e,t){function a(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,n){var o=n.container?r.nestedProperty(e,n.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&a(o,n.min),(l||void 0===s.max)&&a(o,n.max),s.autocolorscale&&a(o,"colorscale")}}for(var s=0;s<e.length;s++){var l=e[s],c=l._module.colorbar;if(c)if(Array.isArray(c))for(var u=0;u<c.length;u++)o(l,c[u]);else o(l,c);n(l,"marker.line")&&o(l,{container:"marker.line",min:"cmin",max:"cmax"})}for(var h in t._colorAxes)o(t[h],{min:"cmin",max:"cmax"})}}}),Zt=m({"src/components/colorscale/calc.js"(e,t){var r=M(),n=ct(),i=Ct().extractOpts;t.exports=function(e,t,a){var o,s=e._fullLayout,l=a.vals,c=a.containerStr,u=c?n.nestedProperty(t,c).get():t,h=i(u),f=!1!==h.auto,p=h.min,d=h.max,m=h.mid,g=function(){return n.aggNums(Math.min,null,l)},y=function(){return n.aggNums(Math.max,null,l)};void 0===p?p=g():f&&(p=u._colorAx&&r(p)?Math.min(p,g()):g()),void 0===d?d=y():f&&(d=u._colorAx&&r(d)?Math.max(d,y()):y()),f&&void 0!==m&&(d-m>m-p?p=m-(d-m):d-m<m-p&&(d=m+(m-p))),p===d&&(p-=.5,d+=.5),h._sync("min",p),h._sync("max",d),h.autocolorscale&&(o=p*d<0?s.colorscale.diverging:p>=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",o))}}}),Yt=m({"src/components/colorscale/index.js"(e,t){var r=H(),n=Ct();t.exports={moduleType:"component",name:"colorscale",attributes:zt(),layoutAttributes:Dt(),supplyLayoutDefaults:Gt(),handleDefaults:Ht(),crossTraceDefaults:Wt(),calc:Zt(),scales:r.scales,defaultScale:r.defaultScale,getScale:r.get,isValidScale:r.isValid,hasColorscale:n.hasColorscale,extractOpts:n.extractOpts,extractScale:n.extractScale,flipScale:n.flipScale,makeColorScaleFunc:n.makeColorScaleFunc,makeColorScaleFuncFromTrace:n.makeColorScaleFuncFromTrace}}}),Xt=m({"src/traces/scatter/subtypes.js"(e,t){var r=ct(),n=I().isTypedArraySpec;t.exports={hasLines:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("lines")},hasMarkers:function(e){return e.visible&&(e.mode&&-1!==e.mode.indexOf("markers")||"splom"===e.type)},hasText:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("text")},isBubble:function(e){var t=e.marker;return r.isPlainObject(t)&&(r.isArrayOrTypedArray(t.size)||n(t.size))}}}}),$t=m({"src/traces/scatter/make_bubble_size_func.js"(e,t){var r=M();t.exports=function(e,t){t||(t=2);var n=e.marker,i=n.sizeref||1,a=n.sizemin||0,o="area"===n.sizemode?function(e){return Math.sqrt(e/i)}:function(e){return e/i};return function(e){var n=o(e/t);return r(n)&&n>0?Math.max(n,a):0}}}}),Kt=m({"src/components/fx/helpers.js"(e){var t=ct();e.getSubplot=function(e){return e.subplot||e.xaxis+e.yaxis||e.geo},e.isTraceInSubplots=function(t,r){if("splom"===t.type){for(var n=t.xaxes||[],i=t.yaxes||[],a=0;a<n.length;a++)for(var o=0;o<i.length;o++)if(-1!==r.indexOf(n[a]+i[o]))return!0;return!1}return-1!==r.indexOf(e.getSubplot(t))},e.flat=function(e,t){for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=t;return r},e.p2c=function(e,t){for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=e[n].p2c(t);return r},e.getDistanceFunction=function(t,r,n,i){return"closest"===t?i||e.quadrature(r,n):"x"===t.charAt(0)?r:n},e.getClosest=function(e,t,r){if(!1!==r.index)r.index>=0&&r.index<e.length?r.distance=0:r.index=!1;else for(var n=1/0,i=e.length,a=0;a<i;a++)(n=t(e[a]))<=r.distance&&(r.index=a,r.distance=n);return r},e.inbox=function(e,t,r){return e*t<0||0===e?r:1/0},e.quadrature=function(e,t){return function(r){var n=e(r),i=t(r);return Math.sqrt(n*n+i*i)}},e.makeEventData=function(t,r,n){var i="index"in t?t.index:t.pointNumber,a={data:r._input,fullData:r,curveNumber:r.index,pointNumber:i};if(r._indexToPoints){var o=r._indexToPoints[i];1===o.length?a.pointIndex=o[0]:a.pointIndices=o}else a.pointIndex=i;return r._module.eventData?a=r._module.eventData(a,t,r,n,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),void 0!==t.zLabelVal&&(a.z=t.zLabelVal)),e.appendArrayPointValue(a,r,i),a},e.appendArrayPointValue=function(e,r,a){var o=r._arrayAttrs;if(o)for(var s=0;s<o.length;s++){var l=o[s],c=n(l);if(void 0===e[c]){var u=i(t.nestedProperty(r,l).get(),a);void 0!==u&&(e[c]=u)}}},e.appendArrayMultiPointValues=function(e,r,a){var o=r._arrayAttrs;if(o)for(var s=0;s<o.length;s++){var l=o[s],c=n(l);if(void 0===e[c]){for(var u=t.nestedProperty(r,l).get(),h=new Array(a.length),f=0;f<a.length;f++)h[f]=i(u,a[f]);e[c]=h}}};var r={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function n(e){return r[e]||e}function i(e,r){return Array.isArray(r)?t.isArrayOrTypedArray(e)&&t.isArrayOrTypedArray(e[r[0]])?e[r[0]][r[1]]:void 0:e[r]}var a={x:!0,y:!0},o={"x unified":!0,"y unified":!0};e.isUnifiedHover=function(e){return"string"==typeof e&&!!o[e]},e.isXYhover=function(e){return"string"==typeof e&&!!a[e]}}}),Jt=m({"node_modules/parse-svg-path/index.js"(e,t){t.exports=function(e){var t=[];return e.replace(n,(function(e,n,a){var o=n.toLowerCase();for(a=function(e){var t=e.match(i);return t?t.map(Number):[]}(a),"m"==o&&a.length>2&&(t.push([n].concat(a.splice(0,2))),o="l",n="m"==n?"l":"L");;){if(a.length==r[o])return a.unshift(n),t.push(a);if(a.length<r[o])throw new Error("malformed path data");t.push([n].concat(a.splice(0,r[o])))}})),t};var r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=/([astvzqmhlc])([^astvzqmhlc]*)/gi,i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi}}),Qt=m({"src/components/drawing/symbol_defs.js"(e,t){var r,n,i,a,o=Jt(),s=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},l="M0,0Z",c=Math.sqrt(2),u=Math.sqrt(3),h=Math.PI,f=Math.cos,p=Math.sin;function d(e){return null===e}function m(e,t,s){if(!(e&&e%360!=0||t))return s;if(i===e&&a===t&&r===s)return n;function l(e,r){var n=f(e),i=p(e),a=r[0],o=r[1]+(t||0);return[a*n-o*i,a*i+o*n]}i=e,a=t,r=s;for(var c=e/180*h,u=0,d=0,m=o(s),g="",y=0;y<m.length;y++){var v=m[y],x=v[0],_=u,b=d;if("M"===x||"L"===x)u=+v[1],d=+v[2];else if("m"===x||"l"===x)u+=+v[1],d+=+v[2];else if("H"===x)u=+v[1];else if("h"===x)u+=+v[1];else if("V"===x)d=+v[1];else if("v"===x)d+=+v[1];else if("A"===x){u=+v[1],d=+v[2];var w=l(c,[+v[6],+v[7]]);v[6]=w[0],v[7]=w[1],v[3]=+v[3]+e}("H"===x||"V"===x)&&(x="L"),("h"===x||"v"===x)&&(x="l"),("m"===x||"l"===x)&&(u-=_,d-=b);var T=l(c,[u,d]);("H"===x||"V"===x)&&(x="L"),("M"===x||"L"===x||"m"===x||"l"===x)&&(v[1]=T[0],v[2]=T[1]),v[0]=x,g+=v[0]+v.slice(1).join(",")}return n=g,g}t.exports={circle:{n:0,f:function(e,t,r){if(d(t))return l;var n=s(e,2),i="M"+n+",0A"+n+","+n+" 0 1,1 0,-"+n+"A"+n+","+n+" 0 0,1 "+n+",0Z";return r?m(t,r,i):i}},square:{n:1,f:function(e,t,r){if(d(t))return l;var n=s(e,2);return m(t,r,"M"+n+","+n+"H-"+n+"V-"+n+"H"+n+"Z")}},diamond:{n:2,f:function(e,t,r){if(d(t))return l;var n=s(1.3*e,2);return m(t,r,"M"+n+",0L0,"+n+"L-"+n+",0L0,-"+n+"Z")}},cross:{n:3,f:function(e,t,r){if(d(t))return l;var n=s(.4*e,2),i=s(1.2*e,2);return m(t,r,"M"+i+","+n+"H"+n+"V"+i+"H-"+n+"V"+n+"H-"+i+"V-"+n+"H-"+n+"V-"+i+"H"+n+"V-"+n+"H"+i+"Z")}},x:{n:4,f:function(e,t,r){if(d(t))return l;var n=s(.8*e/c,2),i="l"+n+","+n,a="l"+n+",-"+n,o="l-"+n+",-"+n,u="l-"+n+","+n;return m(t,r,"M0,"+n+i+a+o+a+o+u+o+u+i+u+i+"Z")}},"triangle-up":{n:5,f:function(e,t,r){if(d(t))return l;var n=s(2*e/u,2);return m(t,r,"M-"+n+","+s(e/2,2)+"H"+n+"L0,-"+s(e,2)+"Z")}},"triangle-down":{n:6,f:function(e,t,r){if(d(t))return l;var n=s(2*e/u,2);return m(t,r,"M-"+n+",-"+s(e/2,2)+"H"+n+"L0,"+s(e,2)+"Z")}},"triangle-left":{n:7,f:function(e,t,r){if(d(t))return l;var n=s(2*e/u,2);return m(t,r,"M"+s(e/2,2)+",-"+n+"V"+n+"L-"+s(e,2)+",0Z")}},"triangle-right":{n:8,f:function(e,t,r){if(d(t))return l;var n=s(2*e/u,2);return m(t,r,"M-"+s(e/2,2)+",-"+n+"V"+n+"L"+s(e,2)+",0Z")}},"triangle-ne":{n:9,f:function(e,t,r){if(d(t))return l;var n=s(.6*e,2),i=s(1.2*e,2);return m(t,r,"M-"+i+",-"+n+"H"+n+"V"+i+"Z")}},"triangle-se":{n:10,f:function(e,t,r){if(d(t))return l;var n=s(.6*e,2),i=s(1.2*e,2);return m(t,r,"M"+n+",-"+i+"V"+n+"H-"+i+"Z")}},"triangle-sw":{n:11,f:function(e,t,r){if(d(t))return l;var n=s(.6*e,2),i=s(1.2*e,2);return m(t,r,"M"+i+","+n+"H-"+n+"V-"+i+"Z")}},"triangle-nw":{n:12,f:function(e,t,r){if(d(t))return l;var n=s(.6*e,2),i=s(1.2*e,2);return m(t,r,"M-"+n+","+i+"V-"+n+"H"+i+"Z")}},pentagon:{n:13,f:function(e,t,r){if(d(t))return l;var n=s(.951*e,2),i=s(.588*e,2),a=s(-e,2),o=s(-.309*e,2);return m(t,r,"M"+n+","+o+"L"+i+","+s(.809*e,2)+"H-"+i+"L-"+n+","+o+"L0,"+a+"Z")}},hexagon:{n:14,f:function(e,t,r){if(d(t))return l;var n=s(e,2),i=s(e/2,2),a=s(e*u/2,2);return m(t,r,"M"+a+",-"+i+"V"+i+"L0,"+n+"L-"+a+","+i+"V-"+i+"L0,-"+n+"Z")}},hexagon2:{n:15,f:function(e,t,r){if(d(t))return l;var n=s(e,2),i=s(e/2,2),a=s(e*u/2,2);return m(t,r,"M-"+i+","+a+"H"+i+"L"+n+",0L"+i+",-"+a+"H-"+i+"L-"+n+",0Z")}},octagon:{n:16,f:function(e,t,r){if(d(t))return l;var n=s(.924*e,2),i=s(.383*e,2);return m(t,r,"M-"+i+",-"+n+"H"+i+"L"+n+",-"+i+"V"+i+"L"+i+","+n+"H-"+i+"L-"+n+","+i+"V-"+i+"Z")}},star:{n:17,f:function(e,t,r){if(d(t))return l;var n=1.4*e,i=s(.225*n,2),a=s(.951*n,2),o=s(.363*n,2),c=s(.588*n,2),u=s(-n,2),h=s(-.309*n,2),f=s(.118*n,2),p=s(.809*n,2);return m(t,r,"M"+i+","+h+"H"+a+"L"+o+","+f+"L"+c+","+p+"L0,"+s(.382*n,2)+"L-"+c+","+p+"L-"+o+","+f+"L-"+a+","+h+"H-"+i+"L0,"+u+"Z")}},hexagram:{n:18,f:function(e,t,r){if(d(t))return l;var n=s(.66*e,2),i=s(.38*e,2),a=s(.76*e,2);return m(t,r,"M-"+a+",0l-"+i+",-"+n+"h"+a+"l"+i+",-"+n+"l"+i+","+n+"h"+a+"l-"+i+","+n+"l"+i+","+n+"h-"+a+"l-"+i+","+n+"l-"+i+",-"+n+"h-"+a+"Z")}},"star-triangle-up":{n:19,f:function(e,t,r){if(d(t))return l;var n=s(e*u*.8,2),i=s(.8*e,2),a=s(1.6*e,2),o=s(4*e,2),c="A "+o+","+o+" 0 0 1 ";return m(t,r,"M-"+n+","+i+c+n+","+i+c+"0,-"+a+c+"-"+n+","+i+"Z")}},"star-triangle-down":{n:20,f:function(e,t,r){if(d(t))return l;var n=s(e*u*.8,2),i=s(.8*e,2),a=s(1.6*e,2),o=s(4*e,2),c="A "+o+","+o+" 0 0 1 ";return m(t,r,"M"+n+",-"+i+c+"-"+n+",-"+i+c+"0,"+a+c+n+",-"+i+"Z")}},"star-square":{n:21,f:function(e,t,r){if(d(t))return l;var n=s(1.1*e,2),i=s(2*e,2),a="A "+i+","+i+" 0 0 1 ";return m(t,r,"M-"+n+",-"+n+a+"-"+n+","+n+a+n+","+n+a+n+",-"+n+a+"-"+n+",-"+n+"Z")}},"star-diamond":{n:22,f:function(e,t,r){if(d(t))return l;var n=s(1.4*e,2),i=s(1.9*e,2),a="A "+i+","+i+" 0 0 1 ";return m(t,r,"M-"+n+",0"+a+"0,"+n+a+n+",0"+a+"0,-"+n+a+"-"+n+",0Z")}},"diamond-tall":{n:23,f:function(e,t,r){if(d(t))return l;var n=s(.7*e,2),i=s(1.4*e,2);return m(t,r,"M0,"+i+"L"+n+",0L0,-"+i+"L-"+n+",0Z")}},"diamond-wide":{n:24,f:function(e,t,r){if(d(t))return l;var n=s(1.4*e,2),i=s(.7*e,2);return m(t,r,"M0,"+i+"L"+n+",0L0,-"+i+"L-"+n+",0Z")}},hourglass:{n:25,f:function(e,t,r){if(d(t))return l;var n=s(e,2);return m(t,r,"M"+n+","+n+"H-"+n+"L"+n+",-"+n+"H-"+n+"Z")},noDot:!0},bowtie:{n:26,f:function(e,t,r){if(d(t))return l;var n=s(e,2);return m(t,r,"M"+n+","+n+"V-"+n+"L-"+n+","+n+"V-"+n+"Z")},noDot:!0},"circle-cross":{n:27,f:function(e,t,r){if(d(t))return l;var n=s(e,2);return m(t,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n+"M"+n+",0A"+n+","+n+" 0 1,1 0,-"+n+"A"+n+","+n+" 0 0,1 "+n+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e,t,r){if(d(t))return l;var n=s(e,2),i=s(e/c,2);return m(t,r,"M"+i+","+i+"L-"+i+",-"+i+"M"+i+",-"+i+"L-"+i+","+i+"M"+n+",0A"+n+","+n+" 0 1,1 0,-"+n+"A"+n+","+n+" 0 0,1 "+n+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e,t,r){if(d(t))return l;var n=s(e,2);return m(t,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n+"M"+n+","+n+"H-"+n+"V-"+n+"H"+n+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e,t,r){if(d(t))return l;var n=s(e,2);return m(t,r,"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n+"M"+n+","+n+"H-"+n+"V-"+n+"H"+n+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e,t,r){if(d(t))return l;var n=s(1.3*e,2);return m(t,r,"M"+n+",0L0,"+n+"L-"+n+",0L0,-"+n+"ZM0,-"+n+"V"+n+"M-"+n+",0H"+n)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e,t,r){if(d(t))return l;var n=s(1.3*e,2),i=s(.65*e,2);return m(t,r,"M"+n+",0L0,"+n+"L-"+n+",0L0,-"+n+"ZM-"+i+",-"+i+"L"+i+","+i+"M-"+i+","+i+"L"+i+",-"+i)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e,t,r){if(d(t))return l;var n=s(1.4*e,2);return m(t,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e,t,r){if(d(t))return l;var n=s(e,2);return m(t,r,"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e,t,r){if(d(t))return l;var n=s(1.2*e,2),i=s(.85*e,2);return m(t,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n+"M"+i+","+i+"L-"+i+",-"+i+"M"+i+",-"+i+"L-"+i+","+i)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e,t,r){if(d(t))return l;var n=s(e/2,2),i=s(e,2);return m(t,r,"M"+n+","+i+"V-"+i+"M"+(n-i)+",-"+i+"V"+i+"M"+i+","+n+"H-"+i+"M-"+i+","+(n-i)+"H"+i)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e,t,r){if(d(t))return l;var n=s(1.2*e,2),i=s(1.6*e,2),a=s(.8*e,2);return m(t,r,"M-"+n+","+a+"L0,0M"+n+","+a+"L0,0M0,-"+i+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e,t,r){if(d(t))return l;var n=s(1.2*e,2),i=s(1.6*e,2),a=s(.8*e,2);return m(t,r,"M-"+n+",-"+a+"L0,0M"+n+",-"+a+"L0,0M0,"+i+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e,t,r){if(d(t))return l;var n=s(1.2*e,2),i=s(1.6*e,2),a=s(.8*e,2);return m(t,r,"M"+a+","+n+"L0,0M"+a+",-"+n+"L0,0M-"+i+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e,t,r){if(d(t))return l;var n=s(1.2*e,2),i=s(1.6*e,2),a=s(.8*e,2);return m(t,r,"M-"+a+","+n+"L0,0M-"+a+",-"+n+"L0,0M"+i+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e,t,r){if(d(t))return l;var n=s(1.4*e,2);return m(t,r,"M"+n+",0H-"+n)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e,t,r){if(d(t))return l;var n=s(1.4*e,2);return m(t,r,"M0,"+n+"V-"+n)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e,t,r){if(d(t))return l;var n=s(e,2);return m(t,r,"M"+n+",-"+n+"L-"+n+","+n)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e,t,r){if(d(t))return l;var n=s(e,2);return m(t,r,"M"+n+","+n+"L-"+n+",-"+n)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(e,t,r){if(d(t))return l;var n=s(e,2);return m(t,r,"M0,0L-"+n+","+s(2*e,2)+"H"+n+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(e,t,r){if(d(t))return l;var n=s(e,2);return m(t,r,"M0,0L-"+n+",-"+s(2*e,2)+"H"+n+"Z")},noDot:!0},"arrow-left":{n:47,f:function(e,t,r){if(d(t))return l;var n=s(2*e,2),i=s(e,2);return m(t,r,"M0,0L"+n+",-"+i+"V"+i+"Z")},noDot:!0},"arrow-right":{n:48,f:function(e,t,r){if(d(t))return l;var n=s(2*e,2),i=s(e,2);return m(t,r,"M0,0L-"+n+",-"+i+"V"+i+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(e,t,r){if(d(t))return l;var n=s(e,2);return m(t,r,"M-"+n+",0H"+n+"M0,0L-"+n+","+s(2*e,2)+"H"+n+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e,t,r){if(d(t))return l;var n=s(e,2);return m(t,r,"M-"+n+",0H"+n+"M0,0L-"+n+",-"+s(2*e,2)+"H"+n+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e,t,r){if(d(t))return l;var n=s(2*e,2),i=s(e,2);return m(t,r,"M0,-"+i+"V"+i+"M0,0L"+n+",-"+i+"V"+i+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e,t,r){if(d(t))return l;var n=s(2*e,2),i=s(e,2);return m(t,r,"M0,-"+i+"V"+i+"M0,0L-"+n+",-"+i+"V"+i+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(e,t,r){if(d(t))return l;var n=h/2.5,i=2*e*f(n),a=2*e*p(n);return m(t,r,"M0,0L"+-i+","+a+"L"+i+","+a+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(e,t,r){if(d(t))return l;var n=h/4,i=2*e*f(n),a=2*e*p(n);return m(t,r,"M0,0L"+-i+","+a+"A "+2*e+","+2*e+" 0 0 1 "+i+","+a+"Z")},backoff:.4,noDot:!0}}}}),er=m({"src/components/drawing/index.js"(e,t){var r=b(),n=ct(),i=n.numberFormat,a=M(),o=F(),s=He(),l=W(),c=Yt(),u=n.strTranslate,h=Et(),f=Mt(),p=St().LINE_SPACING,d=Z().DESELECTDIM,m=Xt(),g=$t(),y=Kt().appendArrayPointValue,v=t.exports={};function x(e){return"none"===e?void 0:e}v.font=function(e,t){var r=t.variant,n=t.style,i=t.weight,a=t.color,o=t.size,s=t.family,c=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(l.fill,a),i&&e.style("font-weight",i),n&&e.style("font-style",n),r&&e.style("font-variant",r),f&&e.style("text-transform",x(function(e){return _[e]}(f))),c&&e.style("text-shadow","auto"===c?h.makeTextShadow(l.contrast(a)):x(c)),u&&e.style("text-decoration-line",x(function(e){return e.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}(u)))};var _={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function w(e,t,r,n){var i=t.fillpattern,a=t.fillgradient,o=v.getPatternAttr,s=i&&(o(i.shape,0,"")||o(i.path,0,""));if(s){var c=o(i.bgcolor,0,null),u=o(i.fgcolor,0,null),h=i.fgopacity,f=o(i.size,0,8),p=o(i.solidity,0,.3),d=t.uid;v.pattern(e,"point",r,d,s,f,p,void 0,i.fillmode,c,u,h)}else if(a&&"none"!==a.type){var m,g,y=a.type,x="scatterfill-"+t.uid;n&&(x="legendfill-"+t.uid),n||void 0===a.start&&void 0===a.stop?("horizontal"===y&&(y+="reversed"),e.call(v.gradient,r,x,y,a.colorscale,"fill")):("horizontal"===y?(m={x:a.start,y:0},g={x:a.stop,y:0}):"vertical"===y&&(m={x:0,y:a.start},g={x:0,y:a.stop}),m.x=t._xA.c2p(void 0===m.x?t._extremes.x.min[0].val:m.x,!0),m.y=t._yA.c2p(void 0===m.y?t._extremes.y.min[0].val:m.y,!0),g.x=t._xA.c2p(void 0===g.x?t._extremes.x.max[0].val:g.x,!0),g.y=t._yA.c2p(void 0===g.y?t._extremes.y.max[0].val:g.y,!0),e.call(C,r,x,"linear",a.colorscale,"fill",m,g,!0,!1))}else t.fillcolor&&e.call(l.fill,t.fillcolor)}v.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},v.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},v.setRect=function(e,t,r,n,i){e.call(v.setPosition,t,r).call(v.setSize,n,i)},v.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),o=n.c2p(e.y);return!!(a(i)&&a(o)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",o):t.attr("transform",u(i,o)),!0)},v.translatePoints=function(e,t,n){e.each((function(e){var i=r.select(this);v.translatePoint(e,i,t,n)}))},v.hideOutsideRangePoint=function(e,t,r,n,i,a){t.attr("display",r.isPtWithinRange(e,i)&&n.isPtWithinRange(e,a)?null:"none")},v.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var n=t.xaxis,i=t.yaxis;e.each((function(t){var a=t[0].trace,o=a.xcalendar,l=a.ycalendar,c=s.traceIs(a,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){v.hideOutsideRangePoint(e,r.select(this),n,i,o,l)}))}))}},v.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},v.singleLineStyle=function(e,t,r,n,i){t.style("fill","none");var a=(((e||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";l.stroke(t,n||a.color),v.dashLine(t,s,o)},v.lineGroupStyle=function(e,t,n,i){e.style("fill","none").each((function(e){var a=(((e||[])[0]||{}).trace||{}).line||{},o=t||a.width||0,s=i||a.dash||"";r.select(this).call(l.stroke,n||a.color).call(v.dashLine,s,o)}))},v.dashLine=function(e,t,r){r=+r||0,t=v.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},v.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},v.singleFillStyle=function(e,t){var n=r.select(e.node());w(e,((n.data()[0]||[])[0]||{}).trace||{},t,!1)},v.fillGroupStyle=function(e,t,n){e.style("stroke-width",0).each((function(e){var i=r.select(this);e[0].trace&&w(i,e[0].trace,t,n)}))};var T=Qt();v.symbolNames=[],v.symbolFuncs=[],v.symbolBackOffs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(T).forEach((function(e){var t=T[e],r=t.n;v.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),v.symbolNames[r]=e,v.symbolFuncs[r]=t.f,v.symbolBackOffs[r]=t.backoff||0,t.needLine&&(v.symbolNeedLines[r]=!0),t.noDot?v.symbolNoDot[r]=!0:v.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(v.symbolNoFill[r]=!0)}));var k=v.symbolNames.length;function A(e,t,r,n){var i=e%100;return v.symbolFuncs[i](t,r,n)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}v.symbolNumber=function(e){if(a(e))e=+e;else if("string"==typeof e){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))>=0&&(e+=t)}return e%100>=k||e>=400?0:Math.floor(Math.max(e,0))};var S=i("~f"),E={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}};function C(e,t,i,a,s,c,u,h,f,p){var d,m=s.length;"linear"===a?d={node:"linearGradient",attrs:{x1:u.x,y1:u.y,x2:h.x,y2:h.y,gradientUnits:f?"userSpaceOnUse":"objectBoundingBox"},reversed:p}:"radial"===a&&(d={node:"radialGradient",reversed:p});for(var g=new Array(m),y=0;y<m;y++)d.reversed?g[m-1-y]=[S(100*(1-s[y][0])),s[y][1]]:g[y]=[S(100*s[y][0]),s[y][1]];var v=t._fullLayout,x="g"+v._uid+"-"+i,_=v._defs.select(".gradients").selectAll("#"+x).data([a+g.join(";")],n.identity);_.exit().remove(),_.enter().append(d.node).each((function(){var e=r.select(this);d.attrs&&e.attr(d.attrs),e.attr("id",x);var t=e.selectAll("stop").data(g);t.exit().remove(),t.enter().append("stop"),t.each((function(e){var t=o(e[1]);r.select(this).attr({offset:e[0]+"%","stop-color":l.tinyRGB(t),"stop-opacity":t.getAlpha()})}))})),e.style(c,G(x,t)).style(c+"-opacity",null),e.classed("gradient_filled",!0)}v.gradient=function(e,t,r,n,i,a){var o=E[n];return C(e,t,r,o.type,i,a,o.start,o.stop,!1,o.reversed)},v.pattern=function(e,t,i,a,s,c,u,h,f,p,d,m){var g="legend"===t;h&&("overlay"===f?(p=h,d=l.contrast(p)):(p=void 0,d=h));var y,v,x,_,b,w,T,k,A,M=i._fullLayout,S="p"+M._uid+"-"+a,E={},C=o(d),I=l.tinyRGB(C),L=m*C.getAlpha();switch(s){case"/":y=c*Math.sqrt(2),v=c*Math.sqrt(2),w="path",E={d:x="M-"+y/4+","+v/4+"l"+y/2+",-"+v/2+"M0,"+v+"L"+y+",0M"+y/4*3+","+v/4*5+"l"+y/2+",-"+v/2,opacity:L,stroke:I,"stroke-width":(_=u*c)+"px"};break;case"\\":y=c*Math.sqrt(2),v=c*Math.sqrt(2),w="path",E={d:x="M"+y/4*3+",-"+v/4+"l"+y/2+","+v/2+"M0,0L"+y+","+v+"M-"+y/4+","+v/4*3+"l"+y/2+","+v/2,opacity:L,stroke:I,"stroke-width":(_=u*c)+"px"};break;case"x":y=c*Math.sqrt(2),v=c*Math.sqrt(2),x="M-"+y/4+","+v/4+"l"+y/2+",-"+v/2+"M0,"+v+"L"+y+",0M"+y/4*3+","+v/4*5+"l"+y/2+",-"+v/2+"M"+y/4*3+",-"+v/4+"l"+y/2+","+v/2+"M0,0L"+y+","+v+"M-"+y/4+","+v/4*3+"l"+y/2+","+v/2,_=c-c*Math.sqrt(1-u),w="path",E={d:x,opacity:L,stroke:I,"stroke-width":_+"px"};break;case"|":w="path",w="path",E={d:x="M"+(y=c)/2+",0L"+y/2+","+(v=c),opacity:L,stroke:I,"stroke-width":(_=u*c)+"px"};break;case"-":w="path",w="path",E={d:x="M0,"+(v=c)/2+"L"+(y=c)+","+v/2,opacity:L,stroke:I,"stroke-width":(_=u*c)+"px"};break;case"+":w="path",x="M"+(y=c)/2+",0L"+y/2+","+(v=c)+"M0,"+v/2+"L"+y+","+v/2,_=c-c*Math.sqrt(1-u),w="path",E={d:x,opacity:L,stroke:I,"stroke-width":_+"px"};break;case".":y=c,v=c,u<Math.PI/4?b=Math.sqrt(u*c*c/Math.PI):(T=u,k=Math.PI/4,b=(A=c/2)+(c/Math.sqrt(2)-A)*(T-k)/(1-k)),w="circle",E={cx:y/2,cy:v/2,r:b,opacity:L,fill:I};break;default:y=c,v=c,w="path",E={d:s,opacity:L,fill:I}}var P=[s||"noSh",p||"noBg",d||"noFg",c,u].join(";"),z=M._defs.select(".patterns").selectAll("#"+S).data([P],n.identity);z.exit().remove(),z.enter().append("pattern").each((function(){var e=r.select(this);if(e.attr({id:S,width:y+"px",height:v+"px",patternUnits:"userSpaceOnUse",patternTransform:g?"scale(0.8)":""}),p){var t=o(p),n=l.tinyRGB(t),i=t.getAlpha(),a=e.selectAll("rect").data([0]);a.exit().remove(),a.enter().append("rect").attr({width:y+"px",height:v+"px",fill:n,"fill-opacity":i})}var s=e.selectAll(w).data([0]);s.exit().remove(),s.enter().append(w).attr(E)})),e.style("fill",G(S,i)).style("fill-opacity",null),e.classed("pattern_filled",!0)},v.initGradients=function(e){var t=e._fullLayout;n.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),r.select(e).selectAll(".gradient_filled").classed("gradient_filled",!1)},v.initPatterns=function(e){var t=e._fullLayout;n.ensureSingle(t._defs,"g","patterns").selectAll("pattern").remove(),r.select(e).selectAll(".pattern_filled").classed("pattern_filled",!1)},v.getPatternAttr=function(e,t,r){return e&&n.isArrayOrTypedArray(e)?t<e.length?e[t]:r:e},v.pointStyle=function(e,t,n,i){if(e.size()){var a=v.makePointStyleFns(t);e.each((function(e){v.singlePointStyle(e,r.select(this),t,a,n,i)}))}},v.singlePointStyle=function(e,t,r,i,a,o){var s=r.marker,c=s.line;if(o&&o.i>=0&&void 0===e.i&&(e.i=o.i),t.style("opacity",i.selectedOpacityFn?i.selectedOpacityFn(e):void 0===e.mo?s.opacity:e.mo),i.ms2mrc){var u;u="various"===e.ms||"various"===s.size?3:i.ms2mrc(e.ms),e.mrc=u,i.selectedSizeFn&&(u=e.mrc=i.selectedSizeFn(e));var h=v.symbolNumber(e.mx||s.symbol)||0;e.om=h%200>=100;var f=se(e,r),p=$(e,r);t.attr("d",A(h,u,f,p))}var d,m,g,y=!1;if(e.so)g=c.outlierwidth,m=c.outliercolor,d=s.outliercolor;else{var x=(c||{}).width;g=(e.mlw+1||x+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,m="mlc"in e?e.mlcc=i.lineScale(e.mlc):n.isArrayOrTypedArray(c.color)?l.defaultLine:c.color,n.isArrayOrTypedArray(s.color)&&(d=l.defaultLine,y=!0),d="mc"in e?e.mcc=i.markerScale(e.mc):s.color||s.colors||"rgba(0,0,0,0)",i.selectedColorFn&&(d=i.selectedColorFn(e))}let _=e.mld||(c||{}).dash;if(_&&v.dashLine(t,_,g),e.om)t.call(l.stroke,d).style({"stroke-width":(g||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:g)+"px");var b=s.gradient,w=e.mgt;w?y=!0:w=b&&b.type,n.isArrayOrTypedArray(w)&&(w=w[0],E[w]||(w=0));var T=s.pattern,k=v.getPatternAttr,M=T&&(k(T.shape,e.i,"")||k(T.path,e.i,""));if(w&&"none"!==w){var S=e.mgc;S?y=!0:S=b.color;var C=r.uid;y&&(C+="-"+e.i),v.gradient(t,a,C,w,[[0,S],[1,d]],"fill")}else if(M){var I=!1,L=T.fgcolor;!L&&o&&o.color&&(L=o.color,I=!0);var P=k(L,e.i,o&&o.color||null),z=k(T.bgcolor,e.i,null),D=T.fgopacity,O=k(T.size,e.i,8),R=k(T.solidity,e.i,.3);I=I||e.mcc||n.isArrayOrTypedArray(T.shape)||n.isArrayOrTypedArray(T.path)||n.isArrayOrTypedArray(T.bgcolor)||n.isArrayOrTypedArray(T.fgcolor)||n.isArrayOrTypedArray(T.size)||n.isArrayOrTypedArray(T.solidity);var F=r.uid;I&&(F+="-"+e.i),v.pattern(t,"point",a,F,M,O,R,e.mcc,T.fillmode,z,P,D)}else n.isArrayOrTypedArray(d)?l.fill(t,d[e.i]):l.fill(t,d);g&&l.stroke(t,m)}},v.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=v.tryColorscale(r,""),t.lineScale=v.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=m.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&n.extendFlat(t,v.makeSelectedPointStyleFns(e)),t},v.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},i=e.unselected||{},a=e.marker||{},o=r.marker||{},l=i.marker||{},c=a.opacity,u=o.opacity,h=l.opacity,f=void 0!==u,p=void 0!==h;(n.isArrayOrTypedArray(c)||f||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?f?u:t:p?h:d*t});var m=a.color,g=o.color,y=l.color;(g||y)&&(t.selectedColorFn=function(e){var t=e.mcc||m;return e.selected?g||t:y||t});var v=a.size,x=o.size,_=l.size,b=void 0!==x,w=void 0!==_;return s.traceIs(e,"symbols")&&(b||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||v/2;return e.selected?b?x/2:t:w?_/2:t}),t},v.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,c=a.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,d))},t},v.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var n=v.makeSelectedPointStyleFns(t),i=t.marker||{},a=[];n.selectedOpacityFn&&a.push((function(e,t){e.style("opacity",n.selectedOpacityFn(t))})),n.selectedColorFn&&a.push((function(e,t){l.fill(e,n.selectedColorFn(t))})),n.selectedSizeFn&&a.push((function(e,r){var a=r.mx||i.symbol||0,o=n.selectedSizeFn(r);e.attr("d",A(v.symbolNumber(a),o,se(r,t),$(r,t))),r.mrc2=o})),a.length&&e.each((function(e){for(var t=r.select(this),n=0;n<a.length;n++)a[n](t,e)}))}},v.tryColorscale=function(e,t){var r=t?n.nestedProperty(e,t).get():e;if(r){var i=r.color;if((r.colorscale||r._colorAx)&&n.isArrayOrTypedArray(i))return c.makeColorScaleFuncFromTrace(r)}return n.identity};var I,L,P={start:1,end:-1,middle:0,bottom:1,top:-1};function z(e,t,n,i,a){var o=r.select(e.node().parentNode),s=-1!==t.indexOf("top")?"top":-1!==t.indexOf("bottom")?"bottom":"middle",l=-1!==t.indexOf("left")?"end":-1!==t.indexOf("right")?"start":"middle",c=i?i/.8+1:0,f=(h.lineCount(e)-1)*p+1,d=P[l]*c,m=.75*n+P[s]*c+(P[s]-1)*f*n/2;e.attr("text-anchor",l),a||o.attr("transform",u(d,m))}function D(e,t){var r=e.ts||t.textfont.size;return a(r)&&r>0?r:0}function O(e,t,r){return r&&(e=V(e)),t?B(e[1]):R(e[0])}function R(e){var t=r.round(e,2);return I=t,t}function B(e){var t=r.round(e,2);return L=t,t}function j(e,t,r,n){var i=e[0]-t[0],a=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,f=3*c*(l+c),p=3*l*(l+c);return[[R(t[0]+(f&&u/f)),B(t[1]+(f&&h/f))],[R(t[0]-(p&&u/p)),B(t[1]-(p&&h/p))]]}v.textPointStyle=function(e,t,i){if(e.size()){var a;if(t.selectedpoints){var o=v.makeSelectedTextStyleFns(t);a=o.selectedTextColorFn}var s=t.texttemplate,l=i._fullLayout;e.each((function(e){var o=r.select(this),c=s?n.extractOption(e,t,"txt","texttemplate"):n.extractOption(e,t,"tx","text");if(c||0===c){if(s){var u=t._module.formatLabels,f=u?u(e,t,l):{},p={};y(p,t,e.i),c=n.texttemplateString({data:[p,e,t._meta],fallback:t.texttemplatefallback,labels:f,locale:l._d3locale,template:c})}var d=e.tp||t.textposition,m=D(e,t),g=a?a(e):e.tc||t.textfont.color;o.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:m,color:g}).text(c).call(h.convertToTspans,i).call(z,d,m,e.mrc)}else o.remove()}))}},v.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var n=v.makeSelectedTextStyleFns(t);e.each((function(e){var i=r.select(this),a=n.selectedTextColorFn(e),o=e.tp||t.textposition,c=D(e,t);l.fill(i,a);var u=s.traceIs(t,"bar-like");z(i,o,c,e.mrc2||e.mrc,u)}))}},v.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],i=[];for(r=1;r<e.length-1;r++)i.push(j(e[r-1],e[r],e[r+1],t));for(n+="Q"+i[0][0]+" "+e[1],r=2;r<e.length-1;r++)n+="C"+i[r-2][1]+" "+i[r-1][0]+" "+e[r];return n+"Q"+i[e.length-3][1]+" "+e[e.length-1]},v.smoothclosed=function(e,t){if(e.length<3)return"M"+e.join("L")+"Z";var r,n="M"+e[0],i=e.length-1,a=[j(e[i],e[0],e[1],t)];for(r=1;r<i;r++)a.push(j(e[r-1],e[r],e[r+1],t));for(a.push(j(e[i-1],e[i],e[0],t)),r=1;r<=i;r++)n+="C"+a[r-1][1]+" "+a[r][0]+" "+e[r];return n+"C"+a[i][1]+" "+a[0][0]+" "+e[0]+"Z"};var N={hv:function(e,t,r){return"H"+R(t[0])+"V"+O(t,1,r)},vh:function(e,t,r){return"V"+B(t[1])+"H"+O(t,0,r)},hvh:function(e,t,r){return"H"+R((e[0]+t[0])/2)+"V"+B(t[1])+"H"+O(t,0,r)},vhv:function(e,t,r){return"V"+B((e[1]+t[1])/2)+"H"+R(t[0])+"V"+O(t,1,r)}},U=function(e,t,r){return"L"+O(t,0,r)+","+O(t,1,r)};function V(e,t){var r=e.backoff,i=e.trace,a=e.d,o=e.i;if(r&&i&&i.marker&&i.marker.angle%360==0&&i.line&&"spline"!==i.line.shape){var s=n.isArrayOrTypedArray(r),l=e,c=t?t[0]:I||0,u=t?t[1]:L||0,h=l[0],f=l[1],p=h-c,d=f-u,m=Math.atan2(d,p),g=s?r[o]:r;if("auto"===g){var y=l.i;"scatter"===i.type&&y--;var x=l.marker,_=x.symbol;n.isArrayOrTypedArray(_)&&(_=_[y]);var b=x.size;n.isArrayOrTypedArray(b)&&(b=b[y]),g=x?v.symbolBackOffs[v.symbolNumber(_)]*b:0,g+=v.getMarkerStandoff(a[y],i)||0}var w=h-g*Math.cos(m),T=f-g*Math.sin(m);(w<=h&&w>=c||w>=h&&w<=c)&&(T<=f&&T>=u||T>=f&&T<=u)&&(e=[w,T])}return e}v.steps=function(e){var t=N[e]||U;return function(e){for(var r="M"+R(e[0][0])+","+B(e[0][1]),n=e.length,i=1;i<n;i++)r+=t(e[i-1],e[i],i===n-1);return r}},v.applyBackoff=V,v.makeTester=function(){var e=n.ensureSingleById(r.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=n.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 q=0;function H(e){var t=e.getAttribute("data-unformatted");if(null!==t)return t+e.getAttribute("data-math")+e.getAttribute("text-anchor")+e.getAttribute("style")}function G(e,t){if(!e)return null;var r=t._context,n=r._exportedPlot?"":r._baseUrl||"";return n?"url('"+n+"#"+e+"')":"url(#"+e+")"}v.bBox=function(e,t,i){var a,o,s;if(i||(i=H(e)),i){if(a=v.savedBBoxes[i])return n.extendFlat({},a)}else if(1===e.childNodes.length){var l=e.childNodes[0];if(i=H(l)){var c=+l.getAttribute("x")||0,u=+l.getAttribute("y")||0,f=l.getAttribute("transform");if(!f){var p=v.bBox(l,!1,i);return c&&(p.left+=c,p.right+=c),u&&(p.top+=u,p.bottom+=u),p}if(i+="~"+c+"~"+u+"~"+f,a=v.savedBBoxes[i])return n.extendFlat({},a)}}t?o=e:(s=v.tester.node(),o=e.cloneNode(!0),s.appendChild(o)),r.select(o).attr("transform",null).call(h.positionText,0,0);var d=o.getBoundingClientRect(),m=v.testref.node().getBoundingClientRect();t||s.removeChild(o);var g={height:d.height,width:d.width,left:d.left-m.left,top:d.top-m.top,right:d.right-m.left,bottom:d.bottom-m.top};return q>=1e4&&(v.savedBBoxes={},q=0),i&&(v.savedBBoxes[i]=g),q++,n.extendFlat({},g)},v.setClipUrl=function(e,t,r){e.attr("clip-path",G(t,r))},v.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},v.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",i=e.attr?"attr":"setAttribute",a=e[n]("transform")||"";return t=t||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=u(t,r)).trim(),e[i]("transform",a),a},v.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},v.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",i=e.attr?"attr":"setAttribute",a=e[n]("transform")||"";return t=t||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+t+","+r+")").trim(),e[i]("transform",a),a};var Y=/\s*sc.*/;v.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(Y,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var X=/translate\([^)]*\)\s*$/;function $(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}v.setTextPointsScale=function(e,t,n){e&&e.each((function(){var e,i=r.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(X);e=1===t&&1===n?[]:[u(o,s),"scale("+t+","+n+")",u(-o,-s)],l&&e.push(l),i.attr("transform",e.join(""))}}))},v.getMarkerStandoff=$;var K,J,Q,ee,te,re,ne=Math.atan2,ie=Math.cos,ae=Math.sin;function oe(e,t){var r=t[0],n=t[1];return[r*ie(e)-n*ae(e),r*ae(e)+n*ie(e)]}function se(e,t){var r=e.ma;void 0===r&&(!(r=t.marker.angle)||n.isArrayOrTypedArray(r))&&(r=0);var i,o,s=t.marker.angleref;if("previous"===s||"north"===s){if(t._geo){var l=t._geo.project(e.lonlat);i=l[0],o=l[1]}else{var c=t._xA,u=t._yA;if(!c||!u)return 90;i=c.c2p(e.x),o=u.c2p(e.y)}if(t._geo){var h,f=e.lonlat[0],p=e.lonlat[1],d=t._geo.project([f,p+1e-5]),m=t._geo.project([f+1e-5,p]),g=ne(m[1]-o,m[0]-i),y=ne(d[1]-o,d[0]-i);if("north"===s)h=r/180*Math.PI;else if("previous"===s){var v=f/180*Math.PI,x=p/180*Math.PI,_=K/180*Math.PI,b=J/180*Math.PI,w=_-v,T=ie(b)*ae(w),k=ae(b)*ie(x)-ie(b)*ae(x)*ie(w);h=-ne(T,k)-Math.PI,K=f,J=p}var A=oe(g,[ie(h),0]),M=oe(y,[ae(h),0]);r=ne(A[1]+M[1],A[0]+M[0])/Math.PI*180,"previous"===s&&(re!==t.uid||e.i!==te+1)&&(r=null)}if("previous"===s&&!t._geo)if(re===t.uid&&e.i===te+1&&a(i)&&a(o)){var S=i-Q,E=o-ee,C=t.line&&t.line.shape||"",I=C.slice(C.length-1);"h"===I&&(E=0),"v"===I&&(S=0),r+=ne(E,S)/Math.PI*180+90}else r=null}return Q=i,ee=o,te=e.i,re=t.uid,r}v.getMarkerAngle=se}}),tr=m({"src/components/titles/index.js"(e,t){var r=b(),n=M(),i=At(),a=He(),o=ct(),s=o.strTranslate,l=er(),c=W(),u=Et(),h=Z(),f=St().OPPOSITE_SIDE,p=/ [XY][0-9]* /;t.exports={draw:function(e,t,d){var m,g=e._fullLayout,y=d.propContainer,v=d.propName,x=d.placeholder,_=d.traceIndex,b=d.avoid||{},w=d.attributes,T=d.transform,k=d.containerGroup,A=1,M=y.title,S=(M&&M.text?M.text:"").trim(),E=!1,C=M&&M.font?M.font:{},I=C.family,L=C.size,P=C.color,z=C.weight,D=C.style,O=C.variant,R=C.textcase,F=C.lineposition,B=C.shadow,j=!!d.subtitlePropName,N=d.subtitlePlaceholder,U=(y.title||{}).subtitle||{text:"",font:{}},V=(U.text||"").trim(),q=!1,H=1,G=U.font,W=G.family,Z=G.size,Y=G.color,X=G.weight,$=G.style,K=G.variant,J=G.textcase,Q=G.lineposition,ee=G.shadow;"title.text"===v?m="titleText":-1!==v.indexOf("axis")?m="axisTitleText":-1!==v.indexOf("colorbar")&&(m="colorbarTitleText");var te=e._context.edits[m];function re(e,t){return void 0!==e&&void 0!==t&&e.replace(p," % ")===t.replace(p," % ")}""===S?A=0:re(S,x)&&(te||(S=""),A=.2,E=!0),j&&(""===V?H=0:re(V,N)&&(te||(V=""),H=.2,q=!0)),d._meta?S=o.templateString(S,d._meta):g._meta&&(S=o.templateString(S,g._meta));var ne,ie=S||V||te;k||(k=o.ensureSingle(g._infolayer,"g","g-"+t),ne=g._hColorbarMoveTitle);var ae=k.selectAll("text."+t).data(ie?[0]:[]);ae.enter().append("text"),ae.text(S).attr("class",t),ae.exit().remove();var oe=null,se=t+"-subtitle",le=V||te;if(j&&((oe=k.selectAll("text."+se).data(le?[0]:[])).enter().append("text"),oe.text(V).attr("class",se),oe.exit().remove()),!ie)return k;function ce(e,t){o.syncOrAsync([ue,he],{title:e,subtitle:t})}function ue(n){var a,h=n.title,f=n.subtitle;if(!T&&ne&&(T={}),T?(a="",T.rotate&&(a+="rotate("+[T.rotate,w.x,w.y]+")"),(T.offset||ne)&&(a+=s(0,(T.offset||0)-(ne||0)))):a=null,h.attr("transform",a),h.style("opacity",A*c.opacity(P)).call(l.font,{color:c.rgb(P),size:r.round(L,2),family:I,weight:z,style:D,variant:O,textcase:R,shadow:B,lineposition:F}).attr(w).call(u.convertToTspans,e,(function(e){if(e){var t=r.select(e.node().parentNode).select("."+se);if(!t.empty()){var n=e.node().getBBox();if(n.height){var i=n.y+n.height+1.6*Z;t.attr("y",i)}}}})),f&&!f.empty()){var p=k.select("."+t+"-math-group"),d=h.node().getBBox(),m=p.node()?p.node().getBBox():void 0,g=m?m.y+m.height+1.6*Z:d.y+d.height+1.6*Z,y=o.extendFlat({},w,{y:g});f.attr("transform",a),f.style("opacity",H*c.opacity(Y)).call(l.font,{color:c.rgb(Y),size:r.round(Z,2),family:W,weight:X,style:$,variant:K,textcase:J,shadow:ee,lineposition:Q}).attr(y).call(u.convertToTspans,e)}return i.previousPromises(e)}function he(t){var i=t.title,a=r.select(i.node().parentNode);if(b&&b.selection&&b.side&&S){a.attr("transform",null);var c=f[b.side],u="left"===b.side||"top"===b.side?-1:1,h=n(b.pad)?b.pad:2,p=l.bBox(a.node()),d={t:0,b:0,l:0,r:0},m=e._fullLayout._reservedMargin;for(var v in m)for(var x in m[v]){var _=m[v][x];d[x]=Math.max(d[x],_)}var w={left:d.l,top:d.t,right:g.width-d.r,bottom:g.height-d.b},T=b.maxShift||u*(w[b.side]-p[b.side]),k=0;if(T<0)k=T;else{var A=b.offsetLeft||0,M=b.offsetTop||0;p.left-=A,p.right-=A,p.top-=M,p.bottom-=M,b.selection.each((function(){var e=l.bBox(this);o.bBoxIntersect(p,e,h)&&(k=Math.max(k,u*(e[b.side]-p[c])+h))})),k=Math.min(T,k),y._titleScoot=Math.abs(k)}if(k>0||T<0){var E={left:[-k,0],right:[k,0],top:[0,-k],bottom:[0,k]}[b.side];a.attr("transform",s(E[0],E[1]))}}}function fe(e,t){e.text(t).on("mouseover.opacity",(function(){r.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){r.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))}if(ae.call(ce,oe),te&&(S?ae.on(".opacity",null):(fe(ae,x),E=!0),ae.call(u.makeEditable,{gd:e}).on("edit",(function(t){void 0!==_?a.call("_guiRestyle",e,v,t,_):a.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ce)})).on("input",(function(e){this.text(e||" ").call(u.positionText,w.x,w.y)})),j)){if(j&&!S){var pe=ae.node().getBBox(),de=pe.y+pe.height+1.6*Z;oe.attr("y",de)}V?oe.on(".opacity",null):(fe(oe,N),q=!0),oe.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(ce)})).on("input",(function(e){this.text(e||" ").call(u.positionText,oe.attr("x"),oe.attr("y"))}))}return ae.classed("js-placeholder",E),oe&&!oe.empty()&&oe.classed("js-placeholder",q),k},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}}}),rr=m({"src/plots/cartesian/set_convert.js"(e,t){var r=b(),n=T().utcFormat,i=ct(),a=i.numberFormat,o=M(),s=i.cleanNumber,l=i.ms2DateTime,c=i.dateTime2ms,u=i.ensureNumber,h=i.isArrayOrTypedArray,f=S(),p=f.FP_SAFE,d=f.BADNUM,m=f.LOG_CLIP,g=f.ONEWEEK,y=f.ONEDAY,v=f.ONEHOUR,x=f.ONEMIN,_=f.ONESEC,w=_t(),k=xt(),A=k.HOUR_PATTERN,E=k.WEEKDAY_PATTERN;function C(e){return Math.pow(10,e)}function I(e){return null!=e}t.exports=function(e,t){t=t||{};var f=e._id||"x",b=f.charAt(0);function T(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],i=e.range[1];return.5*(n+i-2*m*Math.abs(n-i))}return d}function M(t,r,n,a){if((a||{}).msUTC&&o(t))return+t;var s=c(t,n||e.calendar);if(s===d){if(!o(t))return d;t=+t;var l=Math.floor(10*i.mod(t+.05,1)),u=Math.round(t-l/10);s=c(new Date(u))+l/10}return s}function S(t,r,n){return l(t,r,n||e.calendar)}function L(t){return e._categories[Math.round(t)]}function P(t){if(I(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return d}function z(t){if(e._categoriesMap)return e._categoriesMap[t]}function D(e){var t=z(e);return void 0!==t?t:o(e)?+e:void 0}function O(e){return o(e)?+e:z(e)}function R(e,t,n){return r.round(n+t*e,2)}function F(e,t,r){return(e-r)/t}var B=function(t){return o(t)?R(t,e._m,e._b):d},j=function(t){return F(t,e._m,e._b)};if(e.rangebreaks){var N="y"===b;B=function(t){if(!o(t))return d;var r=e._rangebreaks.length;if(!r)return R(t,e._m,e._b);var n=N;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,a=i*t,s=0,l=0;l<r;l++){var c=i*e._rangebreaks[l].min,u=i*e._rangebreaks[l].max;if(a<c)break;if(!(a>u)){s=a<(c+u)/2?l:l+1;break}s=l+1}var h=e._B[s]||0;return isFinite(h)?R(t,e._m2,h):0},j=function(t){var r=e._rangebreaks.length;if(!r)return F(t,e._m,e._b);for(var n=0,i=0;i<r&&!(t<e._rangebreaks[i].pmin);i++)t>e._rangebreaks[i].pmax&&(n=i+1);return F(t,e._m2,e._B[n])}}e.c2l="log"===e.type?T:u,e.l2c="log"===e.type?C:u,e.l2p=B,e.p2l=j,e.c2p="log"===e.type?function(e,t){return B(T(e,t))}:B,e.p2c="log"===e.type?function(e){return C(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(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=j,e.cleanPos=u):"log"===e.type?(e.d2r=e.d2l=function(e,t){return T(s(e),t)},e.r2d=e.r2c=function(e){return C(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=u,e.c2r=T,e.l2d=C,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return C(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=u):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=M,e.c2d=e.c2r=e.l2d=e.l2r=S,e.d2p=e.r2p=function(t,r,n){return e.l2p(M(t,0,n))},e.p2d=e.p2r=function(e,t,r){return S(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,d,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=P,e.r2d=e.c2d=e.l2d=L,e.d2r=e.d2l_noadd=D,e.r2c=function(t){var r=O(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=u,e.r2l=O,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return L(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:u(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=L,e.d2r=e.d2l_noadd=D,e.r2c=function(t){var r=D(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=z,e.l2r=e.c2r=u,e.r2l=D,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return L(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:u(e)},e.setupMultiCategory=function(r){var n,a,o=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var l in s)if(l!==f){var c=t[w.id2name(l)];o=o.concat(c._traceIndices)}var u=[[0,{}],[0,{}]],p=[];for(n=0;n<o.length;n++){var d=r[o[n]];if(b in d){var m=d[b],g=d._length||i.minRowLength(m);if(h(m[0])&&h(m[1]))for(a=0;a<g;a++){var y=m[0][a],v=m[1][a];I(y)&&I(v)&&(p.push([y,v]),y in u[0][1]||(u[0][1][y]=u[0][0]++),v in u[1][1]||(u[1][1][v]=u[1][0]++))}}}for(p.sort((function(e,t){var r=u[0][1],n=r[e[0]]-r[t[0]];if(n)return n;var i=u[1][1];return i[e[1]]-i[t[1]]})),n=0;n<p.length;n++)P(p[n])}),e.fraction2r=function(t){var r=e.r2l(e.range[0]),n=e.r2l(e.range[1]);return e.l2r(r+t*(n-r))},e.r2fraction=function(t){var r=e.r2l(e.range[0]),n=e.r2l(e.range[1]);return(e.r2l(t)-r)/(n-r)},e.limitRange=function(t){var r=e.minallowed,n=e.maxallowed;if(void 0!==r||void 0!==n){t||(t="range");var a=i.nestedProperty(e,t).get(),o=i.simpleMap(a,e.r2l),s=o[1]<o[0];s&&o.reverse();var l=i.simpleMap([r,n],e.r2l);if(void 0!==r&&o[0]<l[0]&&(a[s?1:0]=r),void 0!==n&&o[1]>l[1]&&(a[s?0:1]=n),a[0]===a[1]){var c=e.l2r(r),u=e.l2r(n);if(void 0!==r){var h=c+1;void 0!==n&&(h=Math.min(h,u)),a[s?1:0]=h}if(void 0!==n){var f=u+1;void 0!==r&&(f=Math.max(f,c)),a[s?0:1]=f}}}},e.cleanRange=function(t,r){e._cleanRange(t,r),e.limitRange(t)},e._cleanRange=function(t,r){r||(r={}),t||(t="range");var n,a,s=i.nestedProperty(e,t).get();if(a=(a="date"===e.type?i.dfltRange(e.calendar):"y"===b?k.DFLTRANGEY:"realaxis"===e._name?[0,1]:r.dfltRange||k.DFLTRANGEX).slice(),("tozero"===e.rangemode||"nonnegative"===e.rangemode)&&(a[0]=0),s&&2===s.length){var l=null===s[0],c=null===s[1];for("date"===e.type&&!e.autorange&&(s[0]=i.cleanDate(s[0],d,e.calendar),s[1]=i.cleanDate(s[1],d,e.calendar)),n=0;n<2;n++)if("date"===e.type){if(!i.isDateTime(s[n],e.calendar)){e[t]=a;break}if(e.r2l(s[0])===e.r2l(s[1])){var u=i.constrain(e.r2l(s[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);s[0]=e.l2r(u-1e3),s[1]=e.l2r(u+1e3);break}}else{if(!o(s[n])){if(l||c||!o(s[1-n])){e[t]=a;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-p?s[n]=-p:s[n]>p&&(s[n]=p),s[0]===s[1]){var h=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=h,s[1]+=h}}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var i=w.getFromId({_fullLayout:t},e.overlaying);e.domain=i.domain}var a=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(a);var s,l,c=e.r2l(e[a][0],o),u=e.r2l(e[a][1],o),h="y"===b;if(h?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(s=0;s<e._rangebreaks.length;s++)l=e._rangebreaks[s],e._lBreaks+=Math.abs(l.max-l.min);var f=h;c>u&&(f=!f),f&&e._rangebreaks.reverse();var p=f?-1:1;for(e._m2=p*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(h?u:c)),s=0;s<e._rangebreaks.length;s++)l=e._rangebreaks[s],e._B.push(e._B[e._B.length-1]-p*e._m2*(l.max-l.min));for(s=0;s<e._rangebreaks.length;s++)(l=e._rangebreaks[s]).pmin=B(l.min),l.pmax=B(l.max)}if(!isFinite(e._m)||!isFinite(e._b)||e._length<0)throw t._replotting=!1,new Error("Something went wrong with axis scaling")},e.maskBreaks=function(t){var r,n,a,o,l,c=e.rangebreaks||[];c._cachedPatterns||(c._cachedPatterns=c.map((function(t){return t.enabled&&t.bounds?i.simpleMap(t.bounds,t.pattern?s:e.d2c):null}))),c._cachedValues||(c._cachedValues=c.map((function(t){return t.enabled&&t.values?i.simpleMap(t.values,e.d2c).sort(i.sorterAsc):null})));for(var u=0;u<c.length;u++){var h=c[u];if(h.enabled)if(h.bounds){var f=h.pattern;switch(n=(r=c._cachedPatterns[u])[0],a=r[1],f){case E:o=(l=new Date(t)).getUTCDay(),n>a&&(a+=7,o<n&&(o+=7));break;case A:o=(l=new Date(t)).getUTCHours()+(l.getUTCMinutes()/60+l.getUTCSeconds()/3600+l.getUTCMilliseconds()/36e5),n>a&&(a+=24,o<n&&(o+=24));break;case"":o=t}if(o>=n&&o<a)return d}else for(var p=c._cachedValues[u],m=0;m<p.length;m++)if(a=(n=p[m])+h.dvalue,t>=n&&t<a)return d}return t},e.locateBreaks=function(t,r){var n,a,o,l,c=[];if(!e.rangebreaks)return c;var u=e.rangebreaks.slice().sort((function(e,t){return e.pattern===E&&t.pattern===A?-1:t.pattern===E&&e.pattern===A?1:0})),h=function(e,n){if((e=i.constrain(e,t,r))!==(n=i.constrain(n,t,r))){for(var a=!0,o=0;o<c.length;o++){var s=c[o];e<s.max&&n>=s.min&&(e<s.min&&(s.min=e),n>s.max&&(s.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;n<u.length;n++){var f=u[n];if(f.enabled)if(f.bounds){var p=t,d=r;f.pattern&&(p=Math.floor(p)),o=(a=i.simpleMap(f.bounds,f.pattern?s:e.r2l))[0],l=a[1];var m,b,w=new Date(p);switch(f.pattern){case E:b=g,m=(l-o+(l<o?7:0))*y,p+=o*y-(w.getUTCDay()*y+w.getUTCHours()*v+w.getUTCMinutes()*x+w.getUTCSeconds()*_+w.getUTCMilliseconds());break;case A:b=y,m=(l-o+(l<o?24:0))*v,p+=o*v-(w.getUTCHours()*v+w.getUTCMinutes()*x+w.getUTCSeconds()*_+w.getUTCMilliseconds());break;default:p=Math.min(a[0],a[1]),m=b=(d=Math.max(a[0],a[1]))-p}for(var T=p;T<d;T+=b)h(T,T+m)}else for(var k=i.simpleMap(f.values,e.d2c),M=0;M<k.length;M++)h(o=k[M],l=o+f.dvalue)}return c.sort((function(e,t){return e.min-t.min})),c},e.makeCalcdata=function(t,r,n){var a,o,s,l,c=e.type,u="date"===c&&t[r+"calendar"];if(r in t){if(a=t[r],l=t._length||i.minRowLength(a),i.isTypedArray(a)&&("linear"===c||"log"===c)){if(l===a.length)return a;if(a.subarray)return a.subarray(0,l)}if("multicategory"===c)return function(e,t){for(var r=new Array(t),n=0;n<t;n++){var i=(e[0]||[])[n],a=(e[1]||[])[n];r[n]=z([i,a])}return r}(a,l);for(o=new Array(l),s=0;s<l;s++)o[s]=e.d2c(a[s],0,u,n)}else{var h=r+"0"in t?e.d2c(t[r+"0"],0,u):0,f=t["d"+r]?Number(t["d"+r]):1;for(a=t[{x:"y",y:"x"}[r]],l=t._length||a.length,o=new Array(l),s=0;s<l;s++)o[s]=h+s*f}if(e.rangebreaks)for(s=0;s<l;s++)o[s]=e.maskBreaks(o[s]);return o},e.isValidRange=function(t,r){return Array.isArray(t)&&2===t.length&&(r&&null===t[0]||o(e.r2l(t[0])))&&(r&&null===t[1]||o(e.r2l(t[1])))},e.getAutorangeDflt=function(t,r){var n=!e.isValidRange(t,"nullOk");return n&&r&&r.reverseDflt?n="reversed":t&&(null===t[0]&&null===t[1]?n=!0:null===t[0]&&null!==t[1]?n="min":null!==t[0]&&null===t[1]&&(n="max")),n},e.isReversed=function(){var t=e.autorange;return"reversed"===t||"min reversed"===t||"max reversed"===t},e.isPtWithinRange=function(t,r){var n=e.c2l(t[b],null,r),i=e.r2l(e.range[0]),a=e.r2l(e.range[1]);return i<a?i<=n&&n<=a:a<=n&&n<=i},e._emptyCategories=function(){e._categories=[],e._categoriesMap={}},e.clearCalc=function(){var r=e._matchGroup;if(r){var n=null,i=null;for(var a in r){var o=t[w.id2name(a)];if(o._categories){n=o._categories,i=o._categoriesMap;break}}n&&i?(e._categories=n,e._categoriesMap=i):e._emptyCategories()}else e._emptyCategories();if(e._initialCategories)for(var s=0;s<e._initialCategories.length;s++)P(e._initialCategories[s])},e.sortByInitialCategories=function(){var r=[];if(e._emptyCategories(),e._initialCategories)for(var n=0;n<e._initialCategories.length;n++)P(e._initialCategories[n]);r=r.concat(e._traceIndices);var i=e._matchGroup;for(var a in i)if(f!==a){var o=t[w.id2name(a)];o._categories=e._categories,o._categoriesMap=e._categoriesMap,r=r.concat(o._traceIndices)}return r};var U=t._d3locale;"date"===e.type&&(e._dateFormat=U?U.timeFormat:n,e._extraFormat=t._extraFormat),e._separators=t.separators,e._numFormat=U?U.numberFormat:a,delete e._minDtick,delete e._forceTick0}}}),nr=m({"src/plots/cartesian/axis_autotype.js"(e,t){var r=M(),n=ct(),i=S().BADNUM,a=n.isArrayOrTypedArray,o=n.isDateTime,s=n.cleanNumber,l=Math.round;function c(e,t){return t?r(e):"number"==typeof e}function u(e){return Math.max(1,(e-1)/1e3)}t.exports=function(e,t,n){var h,f=e,p=n.noMultiCategory;if(a(f)&&!f.length)return"-";if(!p&&a((h=f)[0])&&a(h[1]))return"multicategory";if(p&&Array.isArray(f[0])){for(var d=[],m=0;m<f.length;m++)if(a(f[m]))for(var g=0;g<f[m].length;g++)d.push(f[m][g]);f=d}if(function(e,t){for(var n=e.length,i=u(n),a=0,s=0,c={},h=0;h<n;h+=i){var f=e[l(h)],p=String(f);c[p]||(c[p]=1,o(f,t)&&a++,r(f)&&s++)}return a>2*s}(f,t))return"date";var y="strict"!==n.autotypenumbers;return function(e,t){for(var r=e.length,n=u(r),a=0,o=0,c={},h=0;h<r;h+=n){var f=e[l(h)],p=String(f);if(!c[p]){c[p]=1;var d=typeof f;"boolean"===d?o++:(t?s(f)!==i:"number"===d)?a++:"string"===d&&o++}}return o>2*a}(f,y)?"category":function(e,t){for(var r=e.length,n=0;n<r;n++)if(c(e[n],t))return!0;return!1}(f,y)?"linear":"-"}}}),ir=m({"src/plots/cartesian/autorange.js"(e,t){var r=b(),n=M(),i=ct(),a=S().FP_SAFE,o=He(),s=er(),l=_t(),c=l.getFromId,u=l.isLinked;function h(e,t){var r,n,a=[],o=e._fullLayout,s=p(o,t,0),l=p(o,t,1),c=d(e,t),u=c.min,h=c.max;if(0===u.length||0===h.length)return i.simpleMap(t.range,t.r2l);var m=u[0].val,g=h[0].val;for(r=1;r<u.length&&m===g;r++)m=Math.min(m,u[r].val);for(r=1;r<h.length&&m===g;r++)g=Math.max(g,h[r].val);var y=t.autorange,v="reversed"===y||"min reversed"===y||"max reversed"===y;if(!v&&t.range){var x=i.simpleMap(t.range,t.r2l);v=x[1]<x[0]}"reversed"===t.autorange&&(t.autorange=!0);var _,b,w,k,A,M,S=t.rangemode,E="tozero"===S,C="nonnegative"===S,I=t._length,L=I/10,P=0;for(r=0;r<u.length;r++)for(_=u[r],n=0;n<h.length;n++)(M=(b=h[n]).val-_.val-f(t,_.val,b.val))>0&&((A=I-s(_)-l(b))>L?M/A>P&&(w=_,k=b,P=M/A):M/I>P&&(w={val:_.val,nopad:1},k={val:b.val,nopad:1},P=M/I));if(m===g){var z=m-1,D=m+1;if(E)if(0===m)a=[0,1];else{var O=(m>0?h:u).reduce((function(e,t){return Math.max(e,l(t))}),0),R=m/(1-Math.min(.5,O/I));a=m>0?[0,R]:[R,0]}else a=C?[Math.max(0,z),Math.max(1,D)]:[z,D]}else E?(w.val>=0&&(w={val:0,nopad:1}),k.val<=0&&(k={val:0,nopad:1})):C&&(w.val-P*s(w)<0&&(w={val:0,nopad:1}),k.val<=0&&(k={val:1,nopad:1})),P=(k.val-w.val-f(t,_.val,b.val))/(I-s(w)-l(k)),a=[w.val-P*s(w),k.val+P*l(k)];return a=T(a,t),t.limitRange&&t.limitRange(),v&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function f(e,t,r){var n=0;if(e.rangebreaks)for(var i=e.locateBreaks(t,r),a=0;a<i.length;a++){var o=i[a];n+=o.max-o.min}return n}function p(e,t,n){var a=.05*t._length,o=t._anchorAxis||{};if(-1!==(t.ticklabelposition||"").indexOf("inside")||-1!==(o.ticklabelposition||"").indexOf("inside")){var l=t.isReversed();if(!l){var c=i.simpleMap(t.range,t.r2l);l=c[1]<c[0]}l&&(n=!n)}var h=0;return u(e,t._id)||(h=function(e,t,n){var a=0,o="x"===t._id.charAt(0);for(var l in e._plots){var c=e._plots[l];if(t._id===c.xaxis._id||t._id===c.yaxis._id){var u=(o?c.yaxis:c.xaxis)||{};if(-1!==(u.ticklabelposition||"").indexOf("inside")&&(!n&&("left"===u.side||"bottom"===u.side)||n&&("top"===u.side||"right"===u.side))){if(u._vals){var h=i.deg2rad(u._tickAngles[u._id+"tick"]||0),f=Math.abs(Math.cos(h)),p=Math.abs(Math.sin(h));if(!u._vals[0].bb){var d=u._id+"tick";u._selections[d].each((function(e){var t=r.select(this);t.select(".text-math-group").empty()&&(e.bb=s.bBox(t.node()))}))}for(var m=0;m<u._vals.length;m++){var g=u._vals[m].bb;if(g){var y=6+g.width,v=6+g.height;a=Math.max(a,o?Math.max(y*f,v*p):Math.max(v*f,y*p))}}}"inside"===u.ticks&&"inside"===u.ticklabelposition&&(a+=u.ticklen||0)}}}return a}(e,t,n)),a=Math.max(h,a),"domain"===t.constrain&&t._inputDomain&&(a*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(e){return e.nopad?0:e.pad+(e.extrapad?a:h)}}function d(e,t,r){var n,i,a,o=t._id,s=e._fullData,l=e._fullLayout,u=[],h=[];function f(e,t){for(n=0;n<t.length;n++){var r=e[t[n]],s=(r._extremes||{})[o];if(!0===r.visible&&s){for(i=0;i<s.min.length;i++)a=s.min[i],m(u,a.val,a.pad,{extrapad:a.extrapad});for(i=0;i<s.max.length;i++)a=s.max[i],g(h,a.val,a.pad,{extrapad:a.extrapad})}}}if(f(s,t._traceIndices),f(l.annotations||[],t._annIndices||[]),f(l.shapes||[],t._shapeIndices||[]),t._matchGroup&&!r)for(var p in t._matchGroup)if(p!==t._id){var y=c(e,p),v=d(e,y,!0),x=t._length/y._length;for(i=0;i<v.min.length;i++)a=v.min[i],m(u,a.val,a.pad*x,{extrapad:a.extrapad});for(i=0;i<v.max.length;i++)a=v.max[i],g(h,a.val,a.pad*x,{extrapad:a.extrapad})}return{min:u,max:h}}function m(e,t,r,n){y(e,t,r,n,x)}function g(e,t,r,n){y(e,t,r,n,_)}function y(e,t,r,n,i){for(var a=n.tozero,o=n.extrapad,s=!0,l=0;l<e.length&&s;l++){var c=e[l];if(i(c.val,t)&&c.pad>=r&&(c.extrapad||!o)){s=!1;break}i(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(l,1),l--)}if(s){var u=a&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function v(e){return n(e)&&Math.abs(e)<a}function x(e,t){return e<=t}function _(e,t){return e>=t}function w(e,t,r){return void 0===t||void 0===r||(t=e.d2l(t))<e.d2l(r)}function T(e,t){if(!t||!t.autorangeoptions)return e;var r=e[0],n=e[1],a=t.autorangeoptions.include;if(void 0!==a){var o=t.d2l(r),s=t.d2l(n);i.isArrayOrTypedArray(a)||(a=[a]);for(var l=0;l<a.length;l++){var c=t.d2l(a[l]);o>=c&&(o=c,r=c),s<=c&&(s=c,n=c)}}return r=function(e,t){var r=t.autorangeoptions;return r&&void 0!==r.minallowed&&w(t,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&w(t,r.clipmin,r.clipmax)?Math.max(e,t.d2l(r.clipmin)):e}(r,t),n=function(e,t){var r=t.autorangeoptions;return r&&void 0!==r.maxallowed&&w(t,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&w(t,r.clipmin,r.clipmax)?Math.min(e,t.d2l(r.clipmax)):e}(n,t),[r,n]}t.exports={applyAutorangeOptions:T,getAutoRange:h,makePadFn:p,doAutoRange:function(e,t,r){if(t.setScale(),t.autorange){t.range=r?r.slice():h(e,t),t._r=t.range.slice(),t._rl=i.simpleMap(t._r,t.r2l);var n=t._input,a={};a[t._attr+".range"]=t.range,a[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,a),n.range=t.range.slice(),n.autorange=t.autorange}var s=t._anchorAxis;if(s&&s.rangeslider){var l=s.rangeslider[t._name];l&&"auto"===l.rangemode&&(l.range=h(e,t)),s._input.rangeslider[t._name]=i.extendFlat({},l)}},findExtremes:function(e,t,r){r||(r={}),e._m||e.setScale();var i,o,s,l,c,u,h,f,p,d=[],y=[],x=t.length,_=r.padded||!1,b=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,T=!1,k=r.vpadLinearized||!1;function A(e){if(Array.isArray(e))return T=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var M=A((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=A(r.vpadplus||r.vpad),C=A(r.vpadminus||r.vpad);if(!T){if(f=1/0,p=-1/0,w)for(i=0;i<x;i++)(o=t[i])<f&&o>0&&(f=o),o>p&&o<a&&(p=o);else for(i=0;i<x;i++)(o=t[i])<f&&o>-a&&(f=o),o>p&&o<a&&(p=o);t=[f,p],x=2}var I={tozero:b,extrapad:_};function L(r){s=t[r],n(s)&&(u=M(r),h=S(r),k?(l=e.c2l(s)-C(r),c=e.c2l(s)+E(r)):(f=s-C(r),p=s+E(r),w&&f<p/10&&(f=p/10),l=e.c2l(f),c=e.c2l(p)),b&&(l=Math.min(0,l),c=Math.max(0,c)),v(l)&&m(d,l,h,I),v(c)&&g(y,c,u,I))}var P=Math.min(6,x);for(i=0;i<P;i++)L(i);for(i=x-1;i>=P;i--)L(i);return{min:d,max:y,opts:r}},concatExtremes:d}}}),ar=m({"src/plots/cartesian/axes.js"(e,t){var r=b(),n=M(),i=At(),a=He(),o=ct(),s=o.strTranslate,l=Et(),c=tr(),u=W(),h=er(),f=Lt(),p=Rt(),d=(xt(),S()),m=d.ONEMAXYEAR,g=d.ONEAVGYEAR,y=d.ONEMINYEAR,v=d.ONEMAXQUARTER,x=d.ONEAVGQUARTER,_=d.ONEMINQUARTER,w=d.ONEMAXMONTH,T=d.ONEAVGMONTH,k=d.ONEMINMONTH,A=d.ONEWEEK,E=d.ONEDAY,C=E/2,I=d.ONEHOUR,L=d.ONEMIN,P=d.ONESEC,z=d.ONEMILLI,D=d.ONEMICROSEC,O=d.MINUS_SIGN,R=d.BADNUM,F={K:"zeroline"},B={K:"gridline",L:"path"},j={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},U={K:"tick",L:"text"},V={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},q=St(),H=q.MID_SHIFT,G=q.CAP_SHIFT,Z=q.LINE_SPACING,Y=q.OPPOSITE_SIDE,X=t.exports={};X.setConvert=rr();var $=nr(),K=_t(),J=K.idSort,Q=K.isLinked;X.id2name=K.id2name,X.name2id=K.name2id,X.cleanId=K.cleanId,X.list=K.list,X.listIds=K.listIds,X.getFromId=K.getFromId,X.getFromTrace=K.getFromTrace;var ee=ir();function te(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}X.getAutoRange=ee.getAutoRange,X.findExtremes=ee.findExtremes,X.coerceRef=function(e,t,r,n,i,a){var s=n.charAt(n.length-1),l=r._fullLayout._subplots[s+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},o.coerce(e,t,u,c)},X.coerceRefArray=function(e,t,r,n,i,a,s){let l=n.charAt(n.length-1);var c=r._fullLayout._subplots[l+"axis"];let u=n+"ref";var h=e[u];i||(i=c[0]||("string"==typeof a?a:a[0])),c=(c=c.concat(c.map((e=>e+" domain")))).concat(a||[]),h.length>s?(o.warn("Array attribute "+u+" has more entries than expected, truncating to "+s),h=h.slice(0,s)):h.length<s&&(o.warn("Array attribute "+u+" has fewer entries than expected, extending with default value"),h=h.concat(Array(s-h.length).fill(i)));for(var f=0;f<h.length;f++)h[f]=K.cleanId(h[f],l,!0)||h[f],c.includes(h[f])||(h[f]=i);return t[u]=h,h},X.getRefType=function(e){return void 0===e?e:Array.isArray(e)?"array":"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},X.coercePosition=function(e,t,r,n,i,a){var s,l;if("range"!==X.getRefType(n))s=o.ensureNumber,l=r(i,a);else{var c=X.getFromId(t,n);l=r(i,a=c.fraction2r(a)),s=c.cleanPos}e[i]=s(l)},X.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?o.ensureNumber:X.getFromId(t,r).cleanPos)(e)},X.redrawComponents=function(e,t){t=t||X.listIds(e);var r=e._fullLayout;function n(n,i,o,s){for(var l=a.getComponentMethod(n,i),c={},u=0;u<t.length;u++)for(var h=r[X.id2name(t[u])][o],f=0;f<h.length;f++){var p=h[f];if(!c[p]&&(l(e,p),c[p]=1,s))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0),n("selections","drawOne","_selectionIndices")};var re=X.getDataConversions=function(e,t,r,n){var i,a="x"===r||"y"===r||"z"===r?r:n;if(o.isArrayOrTypedArray(a)){if(i={type:$(n,void 0,{autotypenumbers:e._fullLayout.autotypenumbers}),_categories:[]},X.setConvert(i),"category"===i.type)for(var s=0;s<n.length;s++)i.d2c(n[s])}else i=X.getFromTrace(e,t,a);return i?{d2c:i.d2c,c2d:i.c2d}:"ids"===a?{d2c:ie,c2d:ie}:{d2c:ne,c2d:ne}};function ne(e){return+e}function ie(e){return String(e)}function ae(e,t){return Math.abs((e/t+.5)%1-.5)<.001}function oe(e,t){return Math.abs(e/t-1)<.001}function se(e){return+e.substring(1)}function le(e,t){return e.rangebreaks&&(t=t.filter((function(t){return e.maskBreaks(t.x)!==R}))),t}function ce(e){var t=e._mainAxis,r=[];if(t._vals)for(var n=0;n<t._vals.length;n++)if(!t._vals[n].noTick){var i=t.l2p(t._vals[n].x),a=e.p2l(i),o=X.tickText(e,a);t._vals[n].minor&&(o.minor=!0,o.text=""),r.push(o)}return le(e,r)}function ue(e,t){var r=te(o.simpleMap(e.range,e.r2l)),n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),a="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var s=[],l=0;l<=1;l++)if((void 0===t||!(t&&l||!1===t&&!l))&&(!l||e.minor)){var c=l?e.minor.tickvals:e.tickvals,u=l?[]:e.ticktext;if(c){o.isArrayOrTypedArray(u)||(u=[]);for(var h=0;h<c.length;h++){var f=a(c[h]);if(f>n&&f<i){var p=X.tickText(e,f,!1,String(u[h]));l&&(p.minor=!0,p.text=""),s.push(p)}}}}return le(e,s)}X.getDataToCoordFunc=function(e,t,r,n){return re(e,t,r,n).d2c},X.counterLetter=function(e){var t=e.charAt(0);return"x"===t?"y":"y"===t?"x":void 0},X.minDtick=function(e,t,r,n){-1===["log","category","multicategory"].indexOf(e.type)&&n?void 0===e._minDtick?(e._minDtick=t,e._forceTick0=r):e._minDtick&&((e._minDtick/t+1e-6)%1<2e-6&&((r-e._forceTick0)/t%1+1.000001)%1<2e-6?(e._minDtick=t,e._forceTick0=r):((t/e._minDtick+1e-6)%1>2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},X.saveRangeInitial=function(e,t){for(var r=X.list(e,"",!0),n=!1,i=0;i<r.length;i++){var a=r[i],o=void 0===a._rangeInitial0&&void 0===a._rangeInitial1,s=o||a.range[0]!==a._rangeInitial0||a.range[1]!==a._rangeInitial1,l=a.autorange;(o&&!0!==l||t&&s)&&(a._rangeInitial0="min"===l||"max reversed"===l?void 0:a.range[0],a._rangeInitial1="max"===l||"min reversed"===l?void 0:a.range[1],a._autorangeInitial=l,n=!0)}return n},X.saveShowSpikeInitial=function(e,t){for(var r=X.list(e,"",!0),n=!1,i="on",a=0;a<r.length;a++){var o=r[a],s=void 0===o._showSpikeInitial,l=s||o.showspikes!==o._showspikes;(s||t&&l)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"===i&&!o.showspikes&&(i="off")}return e._fullLayout._cartesianSpikesEnabled=i,n},X.autoBin=function(e,t,r,i,a,s){var l,c=o.aggNums(Math.min,null,e),u=o.aggNums(Math.max,null,e);if("category"===t.type||"multicategory"===t.type)return{start:c-.5,end:u+.5,size:Math.max(1,Math.round(s)||1),_dataSpan:u-c};if(a||(a=t.calendar),l="log"===t.type?{type:"linear",range:[c,u]}:{type:t.type,range:o.simpleMap([c,u],t.c2r,0,a),calendar:a},X.setConvert(l),s=s&&p.dtick(s,l.type))l.dtick=s,l.tick0=p.tick0(void 0,l.type,a);else{var h;if(r)h=(u-c)/r;else{var f=o.distinctVals(e),d=Math.pow(10,Math.floor(Math.log(f.minDiff)/Math.LN10)),m=d*o.roundUp(f.minDiff/d,[.9,1.9,4.9,9.9],!0);h=Math.max(m,2*o.stdev(e)/Math.pow(e.length,i?.25:.4)),n(h)||(h=1)}X.autoTicks(l,h)}var g,y=l.dtick,v=X.tickIncrement(X.tickFirst(l),y,"reverse",a);if("number"==typeof y)v=function(e,t,r,i,a){var o=0,s=0,l=0,c=0;function u(t){return(1+100*(t-e)/r.dtick)%100<2}for(var h=0;h<t.length;h++)t[h]%1==0?l++:n(t[h])||c++,u(t[h])&&o++,u(t[h]+r.dtick/2)&&s++;var f=t.length-c;if(l===f&&"date"!==r.type)r.dtick<1?e=i-.5*r.dtick:(e-=.5)+r.dtick<i&&(e+=r.dtick);else if(s<.1*f&&(o>.3*f||u(i)||u(a))){var p=r.dtick/2;e+=e+p<i?p:-p}return e}(v,e,l,c,u),g=v+(1+Math.floor((u-v)/y))*y;else for("M"===l.dtick.charAt(0)&&(v=function(e,t,r,n,i){var a=o.findExactDates(t,i);if(a.exactDays>.8){var s=Number(r.slice(1));a.exactYears>.8&&s%12==0?e=X.tickIncrement(e,"M6","reverse")+1.5*E:a.exactMonths>.8?e=X.tickIncrement(e,"M1","reverse")+15.5*E:e-=C;var l=X.tickIncrement(e,r);if(l<=n)return l}return e}(v,e,y,c,a)),g=v;g<=u;)g=X.tickIncrement(g,y,!1,a);return{start:t.c2r(v,0,a),end:t.c2r(g,0,a),size:y,_dataSpan:u-c}},X.prepMinorTicks=function(e,t,r){if(!t.minor.dtick){delete e.dtick;var i,a=t.dtick&&n(t._tmin);if(a){var s=X.tickIncrement(t._tmin,t.dtick,!0);i=[t._tmin,.99*s+.01*t._tmin]}else{var l=o.simpleMap(t.range,t.r2l);i=[l[0],.8*l[0]+.2*l[1]]}if(e.range=o.simpleMap(i,t.l2r),e._isMinor=!0,X.prepTicks(e,r),a){var c=n(t.dtick),u=n(e.dtick),h=c?t.dtick:+t.dtick.substring(1),f=u?e.dtick:+e.dtick.substring(1);c&&u?ae(h,f)?h===2*A&&f===2*E&&(e.dtick=A):h===2*A&&f===3*E?e.dtick=A:h!==A||(t._input.minor||{}).nticks?oe(h/f,2.5)?e.dtick=h/2:e.dtick=h:e.dtick=E:"M"===String(t.dtick).charAt(0)?u?e.dtick="M1":ae(h,f)?h>=12&&2===f&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?ae(h,f)||(e.dtick=oe(h/f,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}void 0===t.minor._tick0Init&&(e.tick0=t.tick0)},X.prepTicks=function(e,t){var r=o.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var i,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(i=e.tickfont?o.bigFont(e.tickfont.size||12):15,a=e._length/i):(i="y"===e._id.charAt(0)?40:80,a=o.constrain(e._length/i,4,9)+1),"radialaxis"===e._name&&(a*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(a*=100),e._roughDTick=Math.abs(r[1]-r[0])/a,X.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(n(e.dtick)||"M"!==e.dtick.charAt(0))}var i=r(),a=X.getTickFormat(e);if(a){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(t=I,o&&!i&&e.dtick<I&&(e.dtick=I)):/%p/.test(a)?(t=C,o&&!i&&e.dtick<C&&(e.dtick=C)):/%[Aadejuwx]/.test(a)?(t=E,o&&!i&&e.dtick<E&&(e.dtick=E)):/%[UVW]/.test(a)?(t=A,o&&!i&&e.dtick<A&&(e.dtick=A)):/%[Bbm]/.test(a)?(t=T,o&&(i?se(e.dtick)<1:e.dtick<k)&&(e.dtick="M1")):/%[q]/.test(a)?(t=x,o&&(i?se(e.dtick)<3:e.dtick<_)&&(e.dtick="M3")):/%[Yy]/.test(a)&&(t=g,o&&(i?se(e.dtick)<12:e.dtick<y)&&(e.dtick="M12")))}(i=r())&&e.tick0===e._dowTick0&&(e.tick0=e._rawTick0),e._definedDelta=t}(e),e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),xe(e)},X.calcTicks=function(e,t){for(var r=e.type,i=e.calendar,a=e.ticklabelstep,s="period"===e.ticklabelmode,l=e.range[0]>e.range[1],c=!e.ticklabelindex||o.isArrayOrTypedArray(e.ticklabelindex)?e.ticklabelindex:[e.ticklabelindex],u=o.simpleMap(e.range,e.r2l,void 0,void 0,t),h=u[1]<u[0],f=Math.min(u[0],u[1]),p=Math.max(u[0],u[1]),d=Math.max(1e3,e._length||0),b=[],M=[],S=[],O=[],F=[],B=e.minor&&(e.minor.ticks||e.minor.showgrid),j=1;j>=(B?0:1);j--){var N=!j;j?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var U=j?e:o.extendFlat({},e,e.minor);if(N?X.prepMinorTicks(U,e,t):X.prepTicks(U,t),"array"!==U.tickmode)if("sync"!==U.tickmode){var V=te(u),q=V[0],H=V[1],G=n(U.dtick),W="log"===r&&!(G||"L"===U.dtick.charAt(0)),Z=X.tickFirst(U,t);if(j){if(e._tmin=Z,Z<q!==h)break;("category"===r||"multicategory"===r)&&(H=h?Math.max(-.5,H):Math.min(e._categories.length-.5,H))}var Y,$,K=null,J=Z;j&&(G?$=e.dtick:"date"===r?"string"==typeof e.dtick&&"M"===e.dtick.charAt(0)&&($=T*e.dtick.substring(1)):$=e._roughDTick,Y=Math.round((e.r2l(J)-e.r2l(e.tick0))/$)-1);var Q=U.dtick;for(U.rangebreaks&&U._tick0Init!==U.tick0&&(J=Ue(J,e),h||(J=X.tickIncrement(J,Q,!h,i))),j&&s&&(J=X.tickIncrement(J,Q,!h,i),Y--);h?J>=H:J<=H;J=X.tickIncrement(J,Q,h,i)){if(j&&Y++,U.rangebreaks&&!h){if(J<q)continue;if(U.maskBreaks(J)===R&&Ue(J,U)>=p)break}if(S.length>d||J===K)break;K=J;var ee={value:J};j?(W&&J!==(0|J)&&(ee.simpleLabel=!0),a>1&&Y%a&&(ee.skipLabel=!0),S.push(ee)):(ee.minor=!0,O.push(ee))}}else S=[],b=ce(e);else j?(S=[],b=ue(e,!N)):(O=[],M=ue(e,!N))}var re;if(!O||O.length<2?c=!1:function(e,t){return/%f/.test(t)?e>=D:/%L/.test(t)?e>=z:/%[SX]/.test(t)?e>=P:/%M/.test(t)?e>=L:/%[HI]/.test(t)?e>=I:/%p/.test(t)?e>=C:/%[Aadejuwx]/.test(t)?e>=E:/%[UVW]/.test(t)?e>=A:/%[Bbm]/.test(t)?e>=k:/%[q]/.test(t)?e>=_:!/%[Yy]/.test(t)||e>=y}((O[1].value-O[0].value)*(l?-1:1),e.tickformat)||(c=!1),c){var ne=S.concat(O);s&&S.length&&(ne=ne.slice(1)),(ne=ne.sort((function(e,t){return e.value-t.value})).filter((function(e,t,r){return 0===t||e.value!==r[t-1].value}))).map((function(e,t){return void 0!==e.minor||e.skipLabel?null:t})).filter((function(e){return null!==e})).forEach((function(e){c.map((function(t){var r=e+t;r>=0&&r<ne.length&&o.pushUnique(F,ne[r])}))}))}else F=S;if(B&&!("inside"===e.minor.ticks&&"outside"===e.ticks||"outside"===e.minor.ticks&&"inside"===e.ticks)){for(var ie=S.map((function(e){return e.value})),ae=[],oe=0;oe<O.length;oe++){var se=O[oe],le=se.value;if(-1===ie.indexOf(le)){for(var he=!1,fe=0;!he&&fe<S.length;fe++)1e7+S[fe].value===1e7+le&&(he=!0);he||ae.push(se)}}O=ae}if(s&&function(e,t,r){for(var n=0;n<e.length;n++){var i=e[n].value,a=n,o=n+1;n<e.length-1?(a=n,o=n+1):n>0?(a=n-1,o=n):(a=n,o=n);var s,l=e[a].value,c=e[o].value,u=Math.abs(c-l),h=r||u,f=0;h>=y?f=u>=y&&u<=m?u:g:r===x&&h>=_?f=u>=_&&u<=v?u:x:h>=k?f=u>=k&&u<=w?u:T:r===A&&h>=A?f=A:h>=E?f=E:r===C&&h>=C?f=C:r===I&&h>=I&&(f=I),f>=u&&(f=u,s=!0);var p=i+f;if(t.rangebreaks&&f>0){for(var d=0,b=0;b<84;b++){var M=(b+.5)/84;t.maskBreaks(i*(1-M)+M*p)!==R&&d++}(f*=d/84)||(e[n].drop=!0),s&&u>A&&(f=u)}(f>0||0===n)&&(e[n].periodX=i+f/2)}}(F,e,e._definedDelta),e.rangebreaks){var pe="y"===e._id.charAt(0),de=1;"auto"===e.tickmode&&(de=e.tickfont?e.tickfont.size:12);var me=NaN;for(re=S.length-1;re>-1;re--)if(S[re].drop)S.splice(re,1);else{S[re].value=Ue(S[re].value,e);var ge=e.c2p(S[re].value);(pe?me>ge-de:me<ge+de)?S.splice(h?re+1:re,1):me=ge}}Ne(e)&&360===Math.abs(u[1]-u[0])&&S.pop(),e._tmax=(S[S.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;var ye,ve,xe=function(t){t.text="",e._prevDateHead=ye};function _e(e,t){var r=X.tickText(e,t.value,!1,t.simpleLabel),n=t.periodX;return void 0!==n&&(r.periodX=n,(n>p||n<f)&&(n>p&&(r.periodX=p),n<f&&(r.periodX=f),xe(r))),r}for(S=S.concat(O),re=0;re<S.length;re++){var be=S[re].minor,we=S[re].value;be?((ve=c&&-1!==F.indexOf(S[re])?_e(e,S[re]):{x:we}).minor=!0,M.push(ve)):(ye=e._prevDateHead,ve=_e(e,S[re]),(S[re].skipLabel||c&&-1===F.indexOf(S[re]))&&xe(ve),b.push(ve))}return b=b.concat(M),e._inCalcTicks=!1,s&&b.length&&(b[0].noTick=!0),b};var he=[2,5,10],fe=[1,2,3,6,12],pe=[1,2,5,10,15,30],de=[1,2,3,7,14],me=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],ge=[-.301,0,.301,.699,1],ye=[15,30,45,90,180];function ve(e,t,r){return t*o.roundUp(e/t,r)}function xe(e){var t=e.dtick;if(e._tickexponent=0,!n(t)&&"string"!=typeof t&&(t=1),("category"===e.type||"multicategory"===e.type)&&(e._tickround=null),"date"===e.type){var r=e.r2l(e.tick0),i=e.l2r(r).replace(/(^-|i)/g,""),a=i.length;if("M"===String(t).charAt(0))a>10||"01-01"!==i.slice(5)?e._tickround="d":e._tickround=+t.slice(1)%12==0?"y":"m";else if(t>=E&&a<=10||t>=15*E)e._tickround="d";else if(t>=L&&a<=16||t>=I)e._tickround="M";else if(t>=P&&a<=19||t>=L)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(a,o)-20,e._tickround<0&&(e._tickround=4)}}else if(n(t)||"L"===t.charAt(0)){var s=e.range.map(e.r2d||Number);n(t)||(t=Number(t.slice(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(Te(e.exponentformat)&&"SI extended"!==e.exponentformat&&!ke(c)||Te(e.exponentformat)&&"SI extended"===e.exponentformat&&!Ae(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function _e(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontTextcase:n.textcase,fontLineposition:n.lineposition,fontShadow:n.shadow,fontColor:n.color}}X.autoTicks=function(e,t,r){var i;function a(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=o.dateTick0(e.calendar,0);var s=2*t;if(s>g)t/=g,i=a(10),e.dtick="M"+12*ve(t,i,he);else if(s>T)t/=T,e.dtick="M"+ve(t,1,fe);else if(s>E){if(e.dtick=ve(t,E,e._hasDayOfWeekBreaks?[1,2,7,14]:de),!r){var l=X.getTickFormat(e),c="period"===e.ticklabelmode;c&&(e._rawTick0=e.tick0),/%[uVW]/.test(l)?e.tick0=o.dateTick0(e.calendar,2):e.tick0=o.dateTick0(e.calendar,1),c&&(e._dowTick0=e.tick0)}}else s>I?e.dtick=ve(t,I,fe):s>L?e.dtick=ve(t,L,pe):s>P?e.dtick=ve(t,P,pe):(i=a(10),e.dtick=ve(t,i,he))}else if("log"===e.type){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 h=1.5*Math.abs((u[1]-u[0])/t);t=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/h,i=a(10),e.dtick="L"+ve(t,i,he)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):Ne(e)?(e.tick0=0,i=1,e.dtick=ve(t,i,ye)):(e.tick0=0,i=a(10),e.dtick=ve(t,i,he));if(0===e.dtick&&(e.dtick=1),!n(e.dtick)&&"string"!=typeof e.dtick){var f=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(f)}},X.tickIncrement=function(e,t,i,a){var s=i?-1:1;if(n(t))return o.increment(e,s*t);var l=t.charAt(0),c=s*Number(t.slice(1));if("M"===l)return o.incrementMonth(e,c,a);if("L"===l)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===l){var u="D2"===t?ge:me,h=e+.01*s,f=o.roundUp(o.mod(h,1),u,i);return Math.floor(h)+Math.log(r.round(Math.pow(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],l=s?Math.floor:Math.ceil,c=te(a)[0],u=e.dtick,h=i(e.tick0);if(n(u)){var f=l((c-h)/u)*u+h;return("category"===e.type||"multicategory"===e.type)&&(f=o.constrain(f,0,e._categories.length-1)),f}var p=u.charAt(0),d=Number(u.slice(1));if("M"===p){for(var m,g,y,v=0,x=h;v<10;){if(((m=X.tickIncrement(x,u,s,e.calendar))-c)*(x-c)<=0)return s?Math.min(x,m):Math.max(x,m);g=(c-(x+m)/2)/(m-x),y=p+(Math.abs(Math.round(g))||1)*d,x=X.tickIncrement(x,y,g<0?!s:s,e.calendar),v++}return o.error("tickFirst did not converge",e),x}if("L"===p)return Math.log(l((Math.pow(10,c)-h)/d)*d+h)/Math.LN10;if("D"===p){var _="D2"===u?ge:me,b=o.roundUp(o.mod(c,1),_,s);return Math.floor(c)+Math.log(r.round(Math.pow(10,b),1))/Math.LN10}throw"unrecognized dtick "+String(u)},X.tickText=function(e,t,r,i){var a,s=_e(e,t),l="array"===e.tickmode,c=r||l,u=e.type,h="category"===u?e.d2l_noadd:e.d2l,f=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};if(l&&o.isArrayOrTypedArray(e.ticktext)){var p=o.simpleMap(e.range,e.r2l),d=(Math.abs(p[1]-p[0])-(e._lBreaks||0))/1e4;for(a=0;a<e.ticktext.length&&!(Math.abs(t-h(e.tickvals[a]))<d);a++);if(a<e.ticktext.length)return s.text=String(e.ticktext[a]),s.xbnd=[f(s.x-.5),f(s.x+e.dtick-.5)],s}function m(n){if(void 0===n)return!0;if(r)return"none"===n;var i={first:e._tmin,last:e._tmax}[n];return"all"!==n&&t!==i}var g=r?"never":"none"!==e.exponentformat&&m(e.showexponent)?"hide":"";if("date"===u?function(e,t,r,i){var a=e._tickround,s=r&&e.hoverformat||X.getTickFormat(e);(i=!s&&i)&&(a=n(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var l,c=o.formatDate(t.x,s,a,e._dateFormat,e.calendar,e._extraFormat),u=c.indexOf("\n");if(-1!==u&&(l=c.slice(u+1),c=c.slice(0,u)),i&&(void 0===l||"00:00:00"!==c&&"00:00"!==c?8===c.length&&(c=c.replace(/:00$/,"")):(c=l,l="")),l)if(r)"d"===a?c+=", "+l:c=l+(c?", "+c:"");else if(e._inCalcTicks&&e._prevDateHead===l){var h=Ve(e),f=e._trueSide||e.side;(!h&&"top"===f||h&&"bottom"===f)&&(c+="<br> ")}else e._prevDateHead=l,c+="<br>"+l;t.text=c}(e,s,r,c):"log"===u?function(e,t,r,i,a){var s=e.dtick,l=t.x,c=e.tickformat,u="string"==typeof s&&s.charAt(0);if("never"===a&&(a=""),i&&"L"!==u&&(s="L3",u="L"),c||"L"===u)t.text=Me(Math.pow(10,l),e,a,i);else if(n(s)||"D"===u&&("complete"===e.minorloglabels||o.mod(l+.01,1)<.1)){"complete"===e.minorloglabels&&!(o.mod(l+.01,1)<.1)&&(t.fontSize*=.75);var h=Math.pow(10,l).toExponential(0).split("e"),f=+h[1],p=Math.abs(f),d=e.exponentformat;"power"===d||Te(d)&&"SI extended"!==d&&ke(f)||Te(d)&&"SI extended"===d&&Ae(f)?(t.text=h[0],p>0&&(t.text+="x10"),"1x10"===t.text&&(t.text="10"),0!==f&&1!==f&&(t.text+="<sup>"+(f>0?"":O)+p+"</sup>"),t.fontSize*=1.25):("e"===d||"E"===d)&&p>2?t.text=h[0]+d+(f>0?"+":O)+p:(t.text=Me(Math.pow(10,l),e,"","fakehover"),"D1"===s&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(s);t.text="none"===e.minorloglabels?"":String(Math.round(Math.pow(10,o.mod(l,1)))),t.fontSize*=.75}if("D1"===e.dtick){var m=String(t.text).charAt(0);("0"===m||"1"===m)&&("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(l<0?.5:.25)))}}(e,s,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r=""),t.text=String(r)}(e,s):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),i=e._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?t.text=o+" - "+a:(t.text=a,t.text2=o)}(e,s,r):Ne(e)?function(e,t,r,n,i){if("radians"!==e.thetaunit||r)t.text=Me(t.x,e,i,n);else{var a=t.x/180;if(0===a)t.text="0";else{var s=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,i=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(s[1]>=100)t.text=Me(o.deg2rad(t.x),e,i,n);else{var l=t.x<0;1===s[1]?1===s[0]?t.text="π":t.text=s[0]+"π":t.text=["<sup>",s[0],"</sup>","⁄","<sub>",s[1],"</sub>","π"].join(""),l&&(t.text=O+t.text)}}}}(e,s,r,c,g):function(e,t,r,n,i){"never"===i?i="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(i="hide"),t.text=Me(t.x,e,i,n)}(e,s,0,c,g),i||(e.tickprefix&&!m(e.showtickprefix)&&(s.text=e.tickprefix+s.text),e.ticksuffix&&!m(e.showticksuffix)&&(s.text+=e.ticksuffix)),e.labelalias&&e.labelalias.hasOwnProperty(s.text)){var y=e.labelalias[s.text];"string"==typeof y&&(s.text=y)}return("boundaries"===e.tickson||e.showdividers)&&(s.xbnd=[f(s.x-.5),f(s.x+e.dtick-.5)]),s},X.hoverLabelText=function(e,t,r){r&&(e=o.extendFlat({},e,{hoverformat:r}));var n=o.isArrayOrTypedArray(t)?t[0]:t,i=o.isArrayOrTypedArray(t)?t[1]:void 0;if(void 0!==i&&i!==n)return X.hoverLabelText(e,n,r)+" - "+X.hoverLabelText(e,i,r);var a="log"===e.type&&n<=0,s=X.tickText(e,e.c2l(a?-n:n),"hover").text;return a?0===n?"0":O+s:s};var be=["f","p","n","μ","m","","k","M","G","T"],we=["q","r","y","z","a",...be,"P","E","Z","Y","R","Q"],Te=e=>["SI","SI extended","B"].includes(e);function ke(e){return e>14||e<-15}function Ae(e){return e>32||e<-30}function Me(e,t,r,i){var a=e<0,s=t._tickround,l=r||t.exponentformat||"B",c=t._tickexponent,u=X.getTickFormat(t),h=t.separatethousands;if(i){var f={exponentformat:l,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:n(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};xe(f),s=(Number(f._tickround)||0)+4,c=f._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,O);var p,d=Math.pow(10,-s)/2;if("none"===l&&(c=0),(e=Math.abs(e))<d)e="0",a=!1;else{if(e+=d,c&&(e*=Math.pow(10,-c),s+=c),0===s)e=String(Math.floor(e));else if(s<0){e=(e=String(Math.round(e))).slice(0,Math.max(0,e.length+s));for(var m=s;m<0;m++)e+="0"}else{var g=(e=String(e)).indexOf(".")+1;g&&(e=e.slice(0,g+s).replace(/\.?0+$/,""))}e=o.numSeparate(e,t._separators,h)}return c&&"hide"!==l&&(function(e,t){return!!Te(t)&&!!("SI extended"===t&&Ae(e)||"SI extended"!==t&&ke(e))}(c,l)&&(l="power"),p=c<0?O+-c:"power"!==l?"+"+c:String(c),"e"===l||"E"===l?e+=l+p:"power"===l?e+="×10<sup>"+p+"</sup>":"B"===l&&9===c?e+="B":Te(l)&&(e+="SI extended"===l?we[c/3+10]:be[c/3+5])),a?O+e:e}function Se(e,t){if(e){var r=Object.keys(V).reduce((function(e,r){return-1!==t.indexOf(r)&&V[r].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){r[t]||(1===t.length?e[t]=0:delete e[t])}))}}function Ee(e,t){for(var r=[],n={},i=0;i<t.length;i++){var a=t[i];n[a.text2]?n[a.text2].push(a.x):n[a.text2]=[a.x]}for(var s in n)r.push(_e(e,o.interp(n[s],.5),s));return r}function Ce(e){return void 0!==e.periodX?e.periodX:e.x}function Ie(e){return[e.text,e.x,e.axInfo,e.font,e.fontSize,e.fontColor].join("_")}function Le(e){var t=e.title.font.size,r=(e.title.text.match(l.BR_TAG_ALL)||[]).length;return e.title.hasOwnProperty("standoff")?t*(G+r*Z):r?t*(r+1)*Z:t}function Pe(e,t){var r=e.l2p(t);return r>1&&r<e._length-1}function ze(e){var t=r.select(e),n=t.select(".text-math-group");return n.empty()?t.select("text"):n}function De(e){return e._id+".automargin"}function Oe(e){return De(e)+".mirror"}function Re(e){return e._id+".rangeslider"}function Fe(e,t){for(var r=0;r<t.length;r++)-1===e.indexOf(t[r])&&e.push(t[r])}function Be(e,t,r){var n,i,a=[],s=[],l=e.layout;for(n=0;n<t.length;n++)a.push(X.getFromId(e,t[n]));for(n=0;n<r.length;n++)s.push(X.getFromId(e,r[n]));var c=Object.keys(f),u=["anchor","domain","overlaying","position","side","tickangle","editType"],h=["linear","log"];for(n=0;n<c.length;n++){var p=c[n],d=a[0][p],m=s[0][p],g=!0,y=!1,v=!1;if("_"!==p.charAt(0)&&"function"!=typeof d&&-1===u.indexOf(p)){for(i=1;i<a.length&&g;i++){var x=a[i][p];"type"===p&&-1!==h.indexOf(d)&&-1!==h.indexOf(x)&&d!==x?y=!0:x!==d&&(g=!1)}for(i=1;i<s.length&&g;i++){var _=s[i][p];"type"===p&&-1!==h.indexOf(m)&&-1!==h.indexOf(_)&&m!==_?v=!0:s[i][p]!==m&&(g=!1)}g&&(y&&(l[a[0]._name].type="linear"),v&&(l[s[0]._name].type="linear"),je(l,p,a,s,e._fullLayout._dfltTitle))}}for(n=0;n<e._fullLayout.annotations.length;n++){var b=e._fullLayout.annotations[n];-1!==t.indexOf(b.xref)&&-1!==r.indexOf(b.yref)&&o.swapAttrs(l.annotations[n],["?"])}}function je(e,t,r,n,i){var a,s=o.nestedProperty,l=s(e[r[0]._name],t).get(),c=s(e[n[0]._name],t).get();for("title"===t&&(l&&l.text===i.x&&(l.text=i.y),c&&c.text===i.y&&(c.text=i.x)),a=0;a<r.length;a++)s(e,r[a]._name+"."+t).set(c);for(a=0;a<n.length;a++)s(e,n[a]._name+"."+t).set(l)}function Ne(e){return"angularaxis"===e._id}function Ue(e,t){for(var r=t._rangebreaks.length,n=0;n<r;n++){var i=t._rangebreaks[n];if(e>=i.min&&e<i.max)return i.max}return e}function Ve(e){return-1!==(e.ticklabelposition||"").indexOf("inside")}function qe(e,t){Ve(e._anchorAxis||{})&&e._hideCounterAxisInsideTickLabels&&e._hideCounterAxisInsideTickLabels(t)}function Ge(e,t,r,n){var i,a="free"===e.anchor||void 0!==e.overlaying&&!1!==e.overlaying?e.overlaying:e._id;i=n?"right"===e.side?t:-t:t,a in r||(r[a]={}),e.side in r[a]||(r[a][e.side]=0),r[a][e.side]+=i}X.getTickFormat=function(e){var t,r,n,i,a,o,s,l;function c(e){return"string"!=typeof e?e:Number(e.replace("M",""))*T}function u(e,t){var r=["L","D"];if(typeof e==typeof t){if("number"==typeof e)return e-t;var n=r.indexOf(e.charAt(0)),i=r.indexOf(t.charAt(0));return n===i?Number(e.replace(/(L|D)/g,""))-Number(t.replace(/(L|D)/g,"")):n-i}return"number"==typeof e?1:-1}function h(e,t){var r=null===t[0],n=null===t[1],i=u(e,t[0])>=0,a=u(e,t[1])<=0;return(r||i)&&(n||a)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t<e.tickformatstops.length;t++)if((n=e.tickformatstops[t]).enabled&&(i=e.dtick,o=void 0,void 0,void 0,o=c||function(e){return e},s=(a=n.dtickrange)[0],l=a[1],(!s&&"number"!=typeof s||o(s)<=o(i))&&(!l&&"number"!=typeof l||o(l)>=o(i)))){r=n;break}break;case"log":for(t=0;t<e.tickformatstops.length;t++)if((n=e.tickformatstops[t]).enabled&&h(e.dtick,n.dtickrange)){r=n;break}}return r?r.value:e.tickformat},X.getSubplots=function(e,t){var r=e._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),i=t?X.findSubplotsWithAxis(n,t):n;return i.sort((function(e,t){var r=e.slice(1).split("y"),n=t.slice(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]})),i},X.findSubplotsWithAxis=function(e,t){for(var r=new RegExp("x"===t._id.charAt(0)?"^"+t._id+"y":t._id+"$"),n=[],i=0;i<e.length;i++){var a=e[i];r.test(a)&&n.push(a)}return n},X.makeClipPaths=function(e){var t=e._fullLayout;if(!t._hasOnlyLargeSploms){var n,i,a={_offset:0,_length:t.width,_id:""},o={_offset:0,_length:t.height,_id:""},s=X.list(e,"x",!0),l=X.list(e,"y",!0),c=[];for(n=0;n<s.length;n++)for(c.push({x:s[n],y:o}),i=0;i<l.length;i++)0===n&&c.push({x:a,y:l[i]}),c.push({x:s[n],y:l[i]});var u=t._clips.selectAll(".axesclip").data(c,(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){r.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,r){var n=e._fullLayout;"redraw"===t&&n._paper.selectAll("g.subplot").each((function(e){var t=e[0],r=n._plots[t];if(r){var i=r.xaxis,a=r.yaxis;r.xaxislayer.selectAll("."+i._id+"tick").remove(),r.yaxislayer.selectAll("."+a._id+"tick").remove(),r.xaxislayer.selectAll("."+i._id+"tick2").remove(),r.yaxislayer.selectAll("."+a._id+"tick2").remove(),r.xaxislayer.selectAll("."+i._id+"divider").remove(),r.yaxislayer.selectAll("."+a._id+"divider").remove(),r.minorGridlayer&&r.minorGridlayer.selectAll("path").remove(),r.gridlayer&&r.gridlayer.selectAll("path").remove(),r.zerolinelayer&&r.zerolinelayer.selectAll("path").remove(),r.zerolinelayerAbove&&r.zerolinelayerAbove.selectAll("path").remove(),n._infolayer.select(".g-"+i._id+"title").remove(),n._infolayer.select(".g-"+a._id+"title").remove()}}));var i=t&&"redraw"!==t?t:X.listIds(e),a=X.list(e).filter((function(e){return e.autoshift})).map((function(e){return e.overlaying}));i.map((function(t){var r=X.getFromId(e,t);if("sync"===r.tickmode&&r.overlaying){var n=i.findIndex((function(e){return e===r.overlaying}));n>=0&&i.unshift(i.splice(n,1).shift())}}));var s={false:{left:0,right:0}};return o.syncOrAsync(i.map((function(t){return function(){if(t){var n=X.getFromId(e,t);r||(r={}),r.axShifts=s,r.overlayingShiftedAx=a;var i=X.drawOne(e,n,r);return n._shiftPusher&&Ge(n,n._fullDepth||0,s,!0),n._r=n.range.slice(),n._rl=o.simpleMap(n._r,n.r2l),i}}})))},X.drawOne=function(e,t,r){var n,s,f,p=(r=r||{}).axShifts||{},d=r.overlayingShiftedAx||[];t.setScale();var m=e._fullLayout,g=t._id,y=g.charAt(0),v=X.counterLetter(g),x=m._plots[t._mainSubplot],_="above traces"===t.zerolinelayer;if(x){if(t._shiftPusher=t.autoshift||-1!==d.indexOf(t._id)||-1!==d.indexOf(t.overlaying),t._shiftPusher&"free"===t.anchor){var b=t.linewidth/2||0;"inside"===t.ticks&&(b+=t.ticklen),Ge(t,b,p,!0),Ge(t,t.shift||0,p,!1)}(!0!==r.skipTitle||void 0===t._shift)&&(t._shift=function(e,t){return e.autoshift?t[e.overlaying][e.side]:e.shift||0}(t,p));var w=x[y+"axislayer"],T=t._mainLinePosition,k=T+=t._shift,A=t._mainMirrorPosition,M=t._vals=X.calcTicks(t),S=[t.mirror,k,A].join("_");for(n=0;n<M.length;n++)M[n].axInfo=S;t._selections={},t._tickAngles&&(t._prevTickAngles=t._tickAngles),t._tickAngles={},t._depth=null;var E={};if(t.visible){var C,I,L=X.makeTransTickFn(t),P=X.makeTransTickLabelFn(t),z="inside"===t.ticks,D="outside"===t.ticks;if("boundaries"===t.tickson){var O=function(e,t){var r,n=[],i=function(e,t){var r=e.xbnd[t];null!==r&&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}(0,M);I=X.clipEnds(t,O),C=z?I:O}else I=X.clipEnds(t,M),C=z&&"period"!==t.ticklabelmode?I:M;var R=t._gridVals=I,F=function(e,t){var r,n,i=[],a=t.length&&t[t.length-1].x<t[0].x,s=function(e,t){var r=e.xbnd[t];null!==r&&i.push(o.extendFlat({},e,{x:r}))};if(e.showdividers&&t.length){for(r=0;r<t.length;r++){var l=t[r];l.text2!==n&&s(l,a?1:0),n=l.text2}s(t[r-1],a?0:1)}return i}(t,M);if(!m._hasOnlyLargeSploms){var B=t._subplotsWith,j={};for(n=0;n<B.length;n++){s=B[n];var N=(f=m._plots[s])[v+"axis"],U=N._mainAxis._id;if(!j[U]){j[U]=1;var V="x"===y?"M0,"+N._offset+"v"+N._length:"M"+N._offset+",0h"+N._length;X.drawGrid(e,t,{vals:R,counterAxis:N,layer:f.gridlayer.select("."+g),minorLayer:f.minorGridlayer.select("."+g),path:V,transFn:L}),X.drawZeroLine(e,t,{counterAxis:N,layer:_?f.zerolinelayerAbove:f.zerolinelayer,path:V,transFn:L})}}}var q,W=X.getTickSigns(t),$=X.getTickSigns(t,"minor");if(t.ticks||t.minor&&t.minor.ticks){var K,J,Q,ee,te=X.makeTickPath(t,k,W[2]),re=X.makeTickPath(t,k,$[2],{minor:!0});if(t._anchorAxis&&t.mirror&&!0!==t.mirror?(K=X.makeTickPath(t,A,W[3]),J=X.makeTickPath(t,A,$[3],{minor:!0}),Q=te+K,ee=re+J):(K="",J="",Q=te,ee=re),t.showdividers&&D&&"boundaries"===t.tickson){var ne={};for(n=0;n<F.length;n++)ne[F[n].x]=1;q=function(e){return ne[e.x]?K:Q}}else q=function(e){return e.minor?ee:Q}}if(X.drawTicks(e,t,{vals:C,layer:w,path:q,transFn:L}),"allticks"===t.mirror){var ie=Object.keys(t._linepositions||{});for(n=0;n<ie.length;n++){s=ie[n],f=m._plots[s];var ae=t._linepositions[s]||[],oe=ae[0],se=ae[1],le=ae[2],ce=X.makeTickPath(t,oe,le?W[0]:$[0],{minor:le})+X.makeTickPath(t,se,le?W[1]:$[1],{minor:le});X.drawTicks(e,t,{vals:C,layer:f[y+"axislayer"],path:ce,transFn:L})}}var ue=[];if(ue.push((function(){return X.drawLabels(e,t,{vals:M,layer:w,plotinfo:f,transFn:P,labelFns:X.makeLabelFns(t,k)})})),"multicategory"===t.type){var he={x:2,y:10}[y];ue.push((function(){var r={x:"height",y:"width"}[y],n=pe()[r]+he+(t._tickAngles[g+"tick"]?t.tickfont.size*Z:0);return X.drawLabels(e,t,{vals:Ee(t,M),layer:w,cls:g+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:L,labelFns:X.makeLabelFns(t,k+n*W[4])})})),ue.push((function(){return t._depth=W[4]*(pe("tick2")[t.side]-k),function(e,t,r){var n=t._id+"divider",i=r.vals,a=r.layer.selectAll("path."+n).data(i,Ie);a.exit().remove(),a.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(u.stroke,t.dividercolor).style("stroke-width",h.crispRound(e,t.dividerwidth,1)+"px"),a.attr("transform",r.transFn).attr("d",r.path)}(e,t,{vals:F,layer:w,path:X.makeTickPath(t,k,W[4],{len:t._depth}),transFn:L})}))}else t.title.hasOwnProperty("standoff")&&ue.push((function(){t._depth=W[4]*(pe()[t.side]-k)}));var fe=a.getComponentMethod("rangeslider","isVisible")(t);return!r.skipTitle&&!(fe&&"bottom"===t.side)&&ue.push((function(){return function(e,t){var r,n=e._fullLayout,i=t._id,a=i.charAt(0),o=t.title.font.size,s=(t.title.text.match(l.BR_TAG_ALL)||[]).length;if(t.title.hasOwnProperty("standoff"))"bottom"===t.side||"right"===t.side?r=t._depth+t.title.standoff+o*G:("top"===t.side||"left"===t.side)&&(r=t._depth+t.title.standoff+o*(H+s*Z));else{var u=Ve(t);if("multicategory"===t.type)r=t._depth;else{var f=1.5*o;u&&(f=.5*o,"outside"===t.ticks&&(f+=t.ticklen)),r=10+f+(t.linewidth?t.linewidth-1:0)}u||(r+="x"===a?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var p,d,m,g,y=X.getPxPosition(e,t);if("x"===a?(d=t._offset+t._length/2,m="top"===t.side?y-r:y+r):(m=t._offset+t._length/2,d="right"===t.side?y+r:y-r,p={rotate:"-90",offset:0}),"multicategory"!==t.type){var v=t._selections[t._id+"tick"];if(g={selection:v,side:t.side},v&&v.node()&&v.node().parentNode){var x=h.getTranslate(v.node().parentNode);g.offsetLeft=x.x,g.offsetTop=x.y}t.title.hasOwnProperty("standoff")&&(g.pad=0)}return t._titleStandoff=r,c.draw(e,i+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[a],avoid:g,transform:p,attributes:{x:d,y:m,"text-anchor":"middle"}})}(e,t)})),ue.push((function(){var r,n,o,s,l=t.side.charAt(0),c=Y[t.side].charAt(0),u=X.getPxPosition(e,t),h=D?t.ticklen:0;(t.automargin||fe||t._shiftPusher)&&("multicategory"===t.type?r=pe("tick2"):(r=pe(),"x"===y&&"b"===l&&(t._depth=Math.max(r.width>0?r.bottom-u:0,h))));var f=0,p=0;if(t._shiftPusher&&(f=Math.max(h,r.height>0?"l"===l?u-r.left:r.right-u:0),t.title.text!==m._dfltTitle[y]&&(p=(t._titleStandoff||0)+(t._titleScoot||0),"l"===l&&(p+=Le(t))),t._fullDepth=Math.max(f,p)),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1],g="number"==typeof t._shift?t._shift:0;if("x"===y){if("b"===l?n[l]=t._depth:(n[l]=t._depth=Math.max(r.width>0?u-r.top:0,h),d.reverse()),r.width>0){var x=r.right-(t._offset+t._length);x>0&&(n.xr=1,n.r=x);var _=t._offset-r.left;_>0&&(n.xl=0,n.l=_)}}else if("l"===l?(t._depth=Math.max(r.height>0?u-r.left:0,h),n[l]=t._depth-g):(t._depth=Math.max(r.height>0?r.right-u:0,h),n[l]=t._depth+g,d.reverse()),r.height>0){var b=r.bottom-(t._offset+t._length);b>0&&(n.yb=0,n.b=b);var w=t._offset-r.top;w>0&&(n.yt=1,n.t=w)}n[v]="free"===t.anchor?t.position:t._anchorAxis.domain[d[0]],t.title.text!==m._dfltTitle[y]&&(n[l]+=Le(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((o={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(o[c]+=h),!0===t.mirror||"ticks"===t.mirror?o[v]=t._anchorAxis.domain[d[1]]:("all"===t.mirror||"allticks"===t.mirror)&&(o[v]=[t._counterDomainMin,t._counterDomainMax][d[1]]))}fe&&(s=a.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"==typeof t.automargin&&(Se(n,t.automargin),Se(o,t.automargin)),i.autoMargin(e,De(t),n),i.autoMargin(e,Oe(t),o),i.autoMargin(e,Re(t),s)})),o.syncOrAsync(ue)}}function pe(e){var r=g+(e||"tick");return E[r]||(E[r]=function(e,t,r){var n,i,a,o;if(e._selections[t].size())n=1/0,i=-1/0,a=1/0,o=-1/0,e._selections[t].each((function(){var e=ze(this);if("none"!==e.node().style.display){var t=h.bBox(e.node().parentNode);n=Math.min(n,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,r);n=i=s.yFn({dx:0,dy:0,fontSize:0}),a=o=s.xFn({dx:0,dy:0,fontSize:0})}return{top:n,bottom:i,left:a,right:o,height:i-n,width:o-a}}(t,r,k)),E[r]}},X.getTickSigns=function(e,t){var r=e._id.charAt(0),n={x:"top",y:"right"}[r],i=e.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)==("x"===r)&&(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"x"===e._id.charAt(0)?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=function(e){var t=e.ticklabelposition||"",r=e.tickson||"",n=function(e){return-1!==t.indexOf(e)},i=n("top"),a=n("left"),o=n("right"),s=n("bottom"),l=n("inside"),c="boundaries"!==r&&(s||a||i||o);if(!c&&!l)return[0,0];var u=e.side,h=c?(e.tickwidth||0)/2:0,f=3,p=e.tickfont?e.tickfont.size:12;return(s||i)&&(h+=p*G,f+=(e.linewidth||0)/2),(a||o)&&(h+=(e.linewidth||0)/2,f+=3),l&&"top"===u&&(f-=p*(1-G)),(a||i)&&(h=-h),("bottom"===u||"right"===u)&&(f=-f),[c?h:0,l?f:0]}(e),r=e.ticklabelshift||0,n=e.ticklabelstandoff||0,i=t[0],a=t[1],o=e.range[0]>e.range[1],l=e.ticklabelposition&&-1!==e.ticklabelposition.indexOf("inside"),c=!l;if(r&&(r*=o?-1:1),n){var u=e.side;n*=l&&("top"===u||"left"===u)||c&&("bottom"===u||"right"===u)?1:-1}return"x"===e._id.charAt(0)?function(t){return s(i+e._offset+e.l2p(Ce(t))+r,a+n)}:function(t){return s(a+n,i+e._offset+e.l2p(Ce(t))+r)}},X.makeTickPath=function(e,t,r,n){n||(n={});var i=n.minor;if(i&&!e.minor)return"";var a=void 0!==n.len?n.len:i?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),s=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+s*r)+"v"+a*r:"M"+(t+s*r)+",0h"+a*r},X.makeLabelFns=function(e,t,r){var i=e.ticklabelposition||"",a=e.tickson||"",s=function(e){return-1!==i.indexOf(e)},l=s("top"),c=s("left"),u=s("right"),h=s("bottom"),f="boundaries"!==a&&(h||c||l||u),p=s("inside"),d="inside"===i&&"inside"===e.ticks||!p&&"outside"===e.ticks&&"boundaries"!==a,m=0,g=0,y=d?e.ticklen:0;if(p?y*=-1:f&&(y=0),d&&(m+=y,r)){var v=o.deg2rad(r);m=y*Math.cos(v)+1,g=y*Math.sin(v)}e.showticklabels&&(d||e.showline)&&(m+=.2*e.tickfont.size);var x,_,b,w,T,k={labelStandoff:m+=(e.linewidth||1)/2*(p?-1:1),labelShift:g},A=0,M=e.side,S=e._id.charAt(0),E=e.tickangle;if("x"===S)w=(T=!p&&"bottom"===M||p&&"top"===M)?1:-1,p&&(w*=-1),x=g*w,_=t+m*w,b=T?1:-.2,90===Math.abs(E)&&(p?b+=H:b=-90===E&&"bottom"===M?G:90===E&&"top"===M?H:.5,A=H/2*(E/90)),k.xFn=function(e){return e.dx+x+A*e.fontSize},k.yFn=function(e){return e.dy+_+e.fontSize*b},k.anchorFn=function(e,t){if(f){if(c)return"end";if(u)return"start"}return n(t)&&0!==t&&180!==t?t*w<0!==p?"end":"start":"middle"},k.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==p?-n:0};else if("y"===S){if(w=(T=!p&&"left"===M||p&&"right"===M)?1:-1,p&&(w*=-1),x=m,_=g*w,b=0,!p&&90===Math.abs(E)&&(b=-90===E&&"left"===M||90===E&&"right"===M?G:.5),p){var C=n(E)?+E:0;if(0!==C){var I=o.deg2rad(C);A=Math.abs(Math.sin(I))*G*w,b=0}}k.xFn=function(e){return e.dx+t-(x+e.fontSize*b)*w+A*e.fontSize},k.yFn=function(e){return e.dy+_+e.fontSize*H},k.anchorFn=function(e,t){return n(t)&&90===Math.abs(t)?"middle":T?"end":"start"},k.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return k},X.drawTicks=function(e,t,n){n=n||{};var i=t._id+"tick",a=[].concat(t.minor&&t.minor.ticks?n.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?n.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=n.layer.selectAll("path."+i).data(a,Ie);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==n.crisp).each((function(e){return u.stroke(r.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",n.path).style("display",null),qe(t,[N]),o.attr("transform",n.transFn)},X.drawGrid=function(e,t,n){if(n=n||{},"sync"!==t.tickmode){var i=t._id+"grid",a=t.minor&&t.minor.showgrid,o=a?n.vals.filter((function(e){return e.minor})):[],s=t.showgrid?n.vals.filter((function(e){return!e.minor})):[],l=n.counterAxis;if(l&&X.shouldShowZeroLine(e,t,l))for(var c="array"===t.tickmode,f=0;f<s.length;f++){var p=s[f].x;if(c?!p:Math.abs(p)<t.dtick/100){if(s=s.slice(0,f).concat(s.slice(f+1)),!c)break;f--}}t._gw=h.crispRound(e,t.gridwidth,1);for(var d=a?h.crispRound(e,t.minor.gridwidth,1):0,m=n.layer,g=n.minorLayer,y=1;y>=0;y--){var v=y?m:g;if(v){var x=v.selectAll("path."+i).data(y?s:o,Ie);x.exit().remove(),x.enter().append("path").classed(i,1).classed("crisp",!1!==n.crisp),x.attr("transform",n.transFn).attr("d",n.path).each((function(e){return u.stroke(r.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return h.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?d:t._gw)+"px"})).style("display",null),"function"==typeof n.path&&x.attr("d",n.path)}}qe(t,[B,j])}},X.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",i=X.shouldShowZeroLine(e,t,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:t._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return J(e.id,t.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,t.zerolinecolor||u.defaultLine).style("stroke-width",h.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),qe(t,[F])},X.drawLabels=function(e,t,i){i=i||{};var a=e._fullLayout,c=t._id,u="above traces"===t.zerolinelayer,f=i.cls||c+"tick",p=i.vals.filter((function(e){return e.text})),d=i.labelFns,m=i.secondary?0:t.tickangle,g=(t._prevTickAngles||{})[f],y=i.layer.selectAll("g."+f).data(t.showticklabels?p:[],Ie),v=[];function x(e,a){e.each((function(e){var o=r.select(this),c=o.select(".text-math-group"),u=d.anchorFn(e,a),f=i.transFn.call(o.node(),e)+(n(a)&&0!=+a?" rotate("+a+","+d.xFn(e)+","+(d.yFn(e)-e.fontSize/2)+")":""),p=l.lineCount(o),m=Z*e.fontSize,g=d.heightFn(e,n(a)?+a:0,(p-1)*m);if(g&&(f+=s(0,g)),c.empty()){var y=o.select("text");y.attr({transform:f,"text-anchor":u}),y.style("display",null),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var v=h.bBox(c.node()).width*{end:-.5,start:.5}[u];c.attr("transform",f+s(v,0))}}))}y.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(t){var n=r.select(this),i=e._promises.length;n.call(l.positionText,d.xFn(t),d.yFn(t)).call(h.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(l.convertToTspans,e),e._promises[i]?v.push(e._promises.pop().then((function(){x(n,m)}))):x(n,m)})),qe(t,[U]),y.exit().remove(),i.repositionOnUpdate&&y.each((function(e){r.select(this).select("text").call(l.positionText,d.xFn(e),d.yFn(e))})),t._adjustTickLabelsOverflow=function(){var n=t.ticklabeloverflow;if(n&&"allow"!==n){var i=-1!==n.indexOf("hide"),s="x"===t._id.charAt(0),l=0,c=s?e._fullLayout.width:e._fullLayout.height;if(-1!==n.indexOf("domain")){var u=o.simpleMap(t.range,t.r2l);l=t.l2p(u[0])+t._offset,c=t.l2p(u[1])+t._offset}var f=Math.min(l,c),p=Math.max(l,c),d=t.side,m=1/0,g=-1/0;for(var v in y.each((function(e){var n=r.select(this);if(n.select(".text-math-group").empty()){var a=h.bBox(n.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 l=n.select("text");o?i&&l.style("display","none"):"none"!==l.node().style.display&&(l.style("display",null),m="bottom"===d||"right"===d?Math.min(m,s?a.top:a.left):-1/0,g="top"===d||"left"===d?Math.max(g,s?a.bottom:a.right):1/0)}})),a._plots){var x=a._plots[v];if(t._id===x.xaxis._id||t._id===x.yaxis._id){var _=s?x.yaxis:x.xaxis;_&&(_["_visibleLabelMin_"+t._id]=m,_["_visibleLabelMax_"+t._id]=g)}}}},t._hideCounterAxisInsideTickLabels=function(e){var n="x"===t._id.charAt(0),i=[];for(var o in a._plots){var s=a._plots[o];t._id!==s.xaxis._id&&t._id!==s.yaxis._id||i.push(n?s.yaxis:s.xaxis)}i.forEach((function(n,i){n&&Ve(n)&&(e||[F,j,B,N,U]).forEach((function(e){var o="tick"===e.K&&"text"===e.L&&"period"===t.ticklabelmode,s=a._plots[t._mainSubplot];(e.K===F.K?(u?s.zerolinelayerAbove:s.zerolinelayer).selectAll("."+t._id+"zl"):e.K===j.K?s.minorGridlayer.selectAll("."+t._id):e.K===B.K?s.gridlayer.selectAll("."+t._id):s[t._id.charAt(0)+"axislayer"]).each((function(){var a=r.select(this);e.L&&(a=a.selectAll(e.L)),a.each((function(a){var s=t.l2p(o?Ce(a):a.x)+t._offset,l=r.select(this);s<t["_visibleLabelMax_"+n._id]&&s>t["_visibleLabelMin_"+n._id]?l.style("display","none"):"tick"===e.K&&!i&&"none"!==l.node().style.display&&l.style("display",null)}))}))}))}))},x(y,g+1?g:m);var _=null;t._selections&&(t._selections[f]=y);var b=[function(){return v.length&&Promise.all(v)}];t.automargin&&a._redrawFromAutoMarginCount&&90===g?(_=g,b.push((function(){x(y,g)}))):b.push((function(){if(x(y,m),p.length&&t.autotickangles&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){_=t.autotickangles[0];var e,r=0,n=[],a=1;y.each((function(e){r=Math.max(r,e.fontSize);var i=t.l2p(e.x),o=ze(this),s=h.bBox(o.node());a=Math.max(a,l.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=("boundaries"===t.tickson||t.showdividers)&&!i.secondary,c=p.length,u=Math.abs((p[c-1].x-p[0].x)*t._m)/(c-1),f=s?u/2:u,d=s?t.ticklen:1.25*r*a,g=f/Math.sqrt(Math.pow(f,2)+Math.pow(d,2)),v=t.autotickangles.map((function(e){return e*Math.PI/180})),b=v.find((function(e){return Math.abs(Math.cos(e))<=g}));void 0===b&&(b=v.reduce((function(e,t){return Math.abs(Math.cos(e))<Math.abs(Math.cos(t))?e:t}),v[0]));var w=b*(180/Math.PI);if(s){var T=2;for(t.ticks&&(T+=t.tickwidth/2),e=0;e<n.length;e++){var k=p[e].xbnd,A=n[e];if(null!==k[0]&&A.left-t.l2p(k[0])<T||null!==k[1]&&t.l2p(k[1])-A.right<T){_=w;break}}}else{var M=t.ticklabelposition||"",S=t.tickson||"",E=function(e){return-1!==M.indexOf(e)},C=E("top"),I=E("left"),L=E("right"),P=E("bottom"),z="boundaries"!==S&&(P||I||C||L)?(t.tickwidth||0)+6:0;for(e=0;e<n.length-1;e++)if(o.bBoxIntersect(n[e],n[e+1],z)){_=w;break}}_&&x(y,_)}})),t._tickAngles&&b.push((function(){t._tickAngles[f]=null===_?n(m)?m:0:_}));var w=function(){var e=0,r=0;return y.each((function(n,i){var a,o=ze(this);o.select(".text-math-group").empty()&&(t._vals[i]&&(a=t._vals[i].bb||h.bBox(o.node()),t._vals[i].bb=a),e=Math.max(e,a.width),r=Math.max(r,a.height))})),{labelsMaxW:e,labelsMaxH:r}},T=t._anchorAxis;if(T&&(T.autorange||T.insiderange)&&Ve(t)&&!Q(a,t._id)&&(a._insideTickLabelsUpdaterange||(a._insideTickLabelsUpdaterange={}),T.autorange&&(a._insideTickLabelsUpdaterange[T._name+".autorange"]=T.autorange,b.push(w)),T.insiderange)){var k=w(),A="y"===t._id.charAt(0)?k.labelsMaxW:k.labelsMaxH;A+=6,"inside"===t.ticklabelposition&&(A+=t.ticklen||0);var M="right"===t.side||"top"===t.side?1:-1,S=1===M?1:0,E=1===M?0:1,C=[];C[E]=T.range[E];var I=T.range,L=T.r2p(I[S]),P=T.r2p(I[E]),z=a._insideTickLabelsUpdaterange[T._name+".range"];if(z){var D=T.r2p(z[S]),O=T.r2p(z[E]),R=M*("y"===t._id.charAt(0)?1:-1);R*L<R*D&&(L=D,C[S]=I[S]=z[S]),R*P>R*O&&(P=O,C[E]=I[E]=z[E])}var V=Math.abs(P-L);V-A>0?A*=1+A/(V-=A):A=0,"y"!==t._id.charAt(0)&&(A=-A),C[S]=T.p2r(T.r2p(I[S])+M*A),"min"===T.autorange||"max reversed"===T.autorange?(C[0]=null,T._rangeInitial0=void 0,T._rangeInitial1=void 0):("max"===T.autorange||"min reversed"===T.autorange)&&(C[1]=null,T._rangeInitial0=void 0,T._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[T._name+".range"]=C}var q=o.syncOrAsync(b);return q&&q.then&&e._promises.push(q),q},X.getPxPosition=function(e,t){var r,n=e._fullLayout._size,i=t._id.charAt(0),a=t.side;return"free"!==t.anchor?r=t._anchorAxis:"x"===i?r={_offset:n.t+(1-(t.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(t.position||0)*n.w+t._shift,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0},X.shouldShowZeroLine=function(e,t,r){var n=o.simpleMap(t.range,t.r2l);return n[0]*n[1]<=0&&t.zeroline&&("linear"===t.type||"-"===t.type)&&!(t.rangebreaks&&t.maskBreaks(0)===R)&&(Pe(t,0)||!function(e,t,r,n){var i=r._mainAxis;if(i){var a=e._fullLayout,o=t._id.charAt(0),s=X.counterLetter(t._id),l=t._offset+(Math.abs(n[0])<Math.abs(n[1])==("x"===o)?0:t._length),c=a._plots[r._mainSubplot];if(!(c.mainplotinfo||c).overlays.length)return p(r);for(var u=X.list(e,s),h=0;h<u.length;h++){var f=u[h];if(f._mainAxis===i&&p(f))return!0}}function p(e){if(!e.showline||!e.linewidth)return!1;var r=Math.max((e.linewidth+t.zerolinewidth)/2,1);function n(e){return"number"==typeof e&&Math.abs(e-l)<r}if(n(e._mainLinePosition)||n(e._mainMirrorPosition))return!0;var i=e._linepositions||{};for(var a in i)if(n(i[a][0])||n(i[a][1]))return!0}}(e,t,r,n)||function(e,t){for(var r=e._fullData,n=t._mainSubplot,i=t._id.charAt(0),o=0;o<r.length;o++){var s=r[o];if(!0===s.visible&&s.xaxis+s.yaxis===n&&(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}(e,t))},X.clipEnds=function(e,t){return t.filter((function(t){return Pe(e,t.x)}))},X.allowAutoMargin=function(e){for(var t=X.list(e,"",!0),r=0;r<t.length;r++){var n=t[r];n.automargin&&(i.allowAutoMargin(e,De(n)),n.mirror&&i.allowAutoMargin(e,Oe(n))),a.getComponentMethod("rangeslider","isVisible")(n)&&i.allowAutoMargin(e,Re(n))}},X.swap=function(e,t){for(var r=function(e,t){var r,n,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(n=0;n<i.length;n++)(-1!==i[n].x.indexOf(o)||-1!==i[n].y.indexOf(s))&&a.push(n);if(!a.length){i.push({x:[o],y:[s]});continue}var l,c=i[a[0]];if(a.length>1)for(n=1;n<a.length;n++)l=i[a[n]],Fe(c.x,l.x),Fe(c.y,l.y);Fe(c.x,[o]),Fe(c.y,[s])}}return i}(e,t),n=0;n<r.length;n++)Be(e,r[n].x,r[n].y)}}}),or=m({"src/plots/cartesian/autorange_options_defaults.js"(e,t){t.exports=function(e,t,r){var n,i;if(r){var a="reversed"===t||"min reversed"===t||"max reversed"===t;n=r[a?1:0],i=r[a?0:1]}var o=e("autorangeoptions.minallowed",null===i?n:void 0),s=e("autorangeoptions.maxallowed",null===n?i:void 0);void 0===o&&e("autorangeoptions.clipmin"),void 0===s&&e("autorangeoptions.clipmax"),e("autorangeoptions.include")}}}),sr=m({"src/plots/cartesian/range_defaults.js"(e,t){var r=or();t.exports=function(e,t,n,i){var a=t._template||{},o=t.type||a.type||"-";n("minallowed"),n("maxallowed");var s,l=n("range");l||!i.noInsiderange&&"log"!==o&&((s=n("insiderange"))&&(null===s[0]||null===s[1])&&(t.insiderange=!1,s=void 0),s&&(l=n("range",s)));var c,u=t.getAutorangeDflt(l,i),h=n("autorange",u);l&&(null===l[0]&&null===l[1]||(null===l[0]||null===l[1])&&("reversed"===h||!0===h)||null!==l[0]&&("min"===h||"max reversed"===h)||null!==l[1]&&("max"===h||"min reversed"===h))&&(l=void 0,delete t.range,t.autorange=!0,c=!0),c||(h=n("autorange",u=t.getAutorangeDflt(l,i))),h&&(r(n,h,l),("linear"===o||"-"===o)&&n("rangemode")),t.cleanRange()}}}),lr=m({"node_modules/mouse-event-offset/index.js"(e,t){var r={left:0,top:0};t.exports=function(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=function(e){return e===window||e===document||e===document.body?r:e.getBoundingClientRect()}(t);return n[0]=i-o.left,n[1]=a-o.top,n}}}),cr=m({"node_modules/has-passive-events/index.js"(e,t){var r=ht();t.exports=r&&function(){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}()}}),ur=m({"src/components/dragelement/align.js"(e,t){t.exports=function(e,t,r,n,i){var a=(e-r)/(n-r),o=a+t/(n-r),s=(a+o)/2;return"left"===i||"bottom"===i?a:"center"===i||"middle"===i?s:"right"===i||"top"===i?o:a<2/3-s?a:o>4/3-s?o:s}}}),hr=m({"src/components/dragelement/cursor.js"(e,t){var r=ct(),n=[["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="left"===i?0:"center"===i?1:"right"===i?2:r.constrain(Math.floor(3*e),0,2),t="bottom"===a?0:"middle"===a?1:"top"===a?2:r.constrain(Math.floor(3*t),0,2),n[t][e]}}}),fr=m({"src/components/dragelement/unhover.js"(e,t){var r=dt(),n=Qe(),i=Pe().getGraphDiv,a=N(),o=t.exports={};o.wrapped=function(e,t,r){(e=i(e))._fullLayout&&n.clear(e._fullLayout._uid+a.HOVERID),o.raw(e,t,r)},o.raw=function(e,t){var n=e._fullLayout,i=e._hoverdata;t||(t={}),(!t.target||e._dragged||!1!==r.triggerHandler(e,"plotly_beforehover",t))&&(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&i&&e.emit("plotly_unhover",{event:t,points:i}))}}}),pr=m({"src/components/dragelement/index.js"(e,t){var r=lr(),n=ft(),i=cr(),a=ct().removeElement,o=xt(),s=t.exports={};s.align=ur(),s.getCursor=hr();var l=fr();function c(){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}function u(e){return r(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=l.wrapped,s.unhoverRaw=l.raw,s.init=function(e){var t,r,l,h,f,p,d,m,g=e.gd,y=1,v=g._context.doubleClickDelay,x=e.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=b,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=b,x.addEventListener("touchstart",b,{passive:!1})):x.ontouchstart=b;var _=e.clampFn||function(e,t,r){return Math.abs(e)<r&&(e=0),Math.abs(t)<r&&(t=0),[e,t]};function b(i){g._dragged=!1,g._dragging=!0;var a=u(i);t=a[0],r=a[1],d=i.target,p=i,m=2===i.buttons||i.ctrlKey,typeof i.clientX>"u"&&typeof i.clientY>"u"&&(i.clientX=t,i.clientY=r),(l=(new Date).getTime())-g._mouseDownTime<v?y+=1:(y=1,g._mouseDownTime=l),e.prepFn&&e.prepFn(i,t,r),n&&!m?(f=c()).style.cursor=window.getComputedStyle(x).cursor:n||(f=document,h=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(x).cursor),document.addEventListener("mouseup",T),document.addEventListener("touchend",T),!1!==e.dragmode&&(i.preventDefault(),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w,{passive:!1}))}function w(n){n.preventDefault();var i=u(n),a=e.minDrag||o.MINDRAG,l=_(i[0]-t,i[1]-r,a),c=l[0],h=l[1];(c||h)&&(g._dragged=!0,s.unhover(g,n)),g._dragged&&e.moveFn&&!m&&(g._dragdata={element:x,dx:c,dy:h},e.moveFn(c,h))}function T(t){var r;delete g._dragdata,!1!==e.dragmode&&(t.preventDefault(),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)),document.removeEventListener("mouseup",T),document.removeEventListener("touchend",T),n?a(f):h&&(f.documentElement.style.cursor=h,h=null),g._dragging?(g._dragging=!1,(new Date).getTime()-g._mouseDownTime>v&&(y=Math.max(y-1,1)),g._dragged?e.doneFn&&e.doneFn():(p.target===d?r=p:(r={target:d,srcElement:d,toElement:d},Object.keys(p).concat(Object.keys(p.__proto__)).forEach((e=>{var t=p[e];!r[e]&&"function"!=typeof t&&(r[e]=t)}))),e.clickFn&&e.clickFn(y,r),m||d.dispatchEvent(new MouseEvent("click",t))),g._dragging=!1,g._dragged=!1):g._dragged=!1}},s.coverSlip=c}}),dr=m({"src/lib/setcursor.js"(e,t){t.exports=function(e,t){(e.attr("class")||"").split(" ").forEach((function(t){0===t.indexOf("cursor-")&&e.classed(t,!1)})),t&&e.classed("cursor-"+t,!0)}}}),mr=m({"src/lib/override_cursor.js"(e,t){var r=dr(),n="data-savedcursor";t.exports=function(e,t){var i=e.attr(n);if(t){if(!i){for(var a=(e.attr("class")||"").split(" "),o=0;o<a.length;o++){var s=a[o];0===s.indexOf("cursor-")&&e.attr(n,s.slice(7)).classed(s,!1)}e.attr(n)||e.attr(n,"!!")}r(e,t)}else i&&(e.attr(n,null),"!!"===i?r(e):r(e,i))}}}),gr=m({"src/components/legend/attributes.js"(e,t){var r=j(),n=G();t.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"legend"},maxheight:{valType:"number",min:0,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:r({editType:"legend"}),grouptitlefont:r({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:r({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}}}),yr=m({"src/components/legend/helpers.js"(e){e.isGrouped=function(e){return-1!==(e.traceorder||"").indexOf("grouped")},e.isVertical=function(e){return"h"!==e.orientation},e.isReversed=function(e){return-1!==(e.traceorder||"").indexOf("reversed")},e.getId=function(e){return e._id||"legend"}}}),vr=m({"src/components/legend/defaults.js"(e,t){var r=He(),n=ct(),i=vt(),a=q(),o=gr(),s=Ve(),l=yr();function c(e,t,c,u,h){var f=t[e]||{},p=i.newContainer(c,e);function d(e,t){return n.coerce(f,p,o,e,t)}var m=n.coerceFont(d,"font",c.font);if(d("bgcolor",c.paper_bgcolor),d("bordercolor"),d("visible")){var g,y=function(e,t){var r=g._input,i=g;return n.coerce(r,i,a,e,t)},v=c.font||{},x=n.coerceFont(d,"grouptitlefont",v,{overrideDflt:{size:Math.round(1.1*v.size)}}),_=0,b=!1,w="normal",T=(c.shapes||[]).filter((function(e){return e.showlegend}));u.filter(R).forEach((function(t){t.visible&&_++;for(var r=0;r<t._length;r++)((Array.isArray(t.legend)?t.legend[r]:t.legend)||"legend")===e&&((Array.isArray(t.showlegend)?t.showlegend[r]:t.showlegend)||t._dfltShowLegend)&&(b=!0,_++);if("legend"===e&&t._length>t.legend.length)for(var n=t.legend.length;n<t._length;n++)b=!0,_++}));for(var k=u.concat(T).filter((function(t){return!R(g)&&e===(t.legend||"legend")})),A=0;A<k.length;A++)if((g=k[A]).visible){var M=g._isShape;(g.showlegend||g._dfltShowLegend&&!(g._module&&g._module.attributes&&g._module.attributes.showlegend&&!1===g._module.attributes.showlegend.dflt))&&(_++,g.showlegend&&(b=!0,(!M&&r.traceIs(g,"pie-like")||!0===g._input.showlegend)&&_++),n.coerceFont(y,"legendgrouptitle.font",x)),(!M&&r.traceIs(g,"bar")&&"stack"===c.barmode||-1!==["tonextx","tonexty"].indexOf(g.fill))&&(w=l.isGrouped({traceorder:w})?"grouped+reversed":"reversed"),void 0!==g.legendgroup&&""!==g.legendgroup&&(w=l.isReversed({traceorder:w})?"reversed+grouped":"grouped")}var S=n.coerce(t,c,s,"showlegend",c.showlegend||b&&_>("legend"===e?1:0));if(!1===S&&(c[e]=void 0),(!1!==S||f.uirevision)&&(d("uirevision",c.uirevision),!1!==S)){d("borderwidth");var E,C,I,L="h"===d("orientation"),P="paper"===d("yref"),z="paper"===d("xref"),D="left";if(L?(E=0,r.getComponentMethod("rangeslider","isVisible")(t.xaxis)?P?(C=1.1,I="bottom"):(C=1,I="top"):P?(C=-.1,I="top"):(C=0,I="bottom")):(C=1,I="auto",z?E=1.02:(E=1,D="right")),n.coerce(f,p,{x:{valType:"number",editType:"legend",min:z?-2:0,max:z?3:1,dflt:E}},"x"),n.coerce(f,p,{y:{valType:"number",editType:"legend",min:P?-2:0,max:P?3:1,dflt:C}},"y"),d("traceorder",w),l.isGrouped(c[e])&&d("tracegroupgap"),d("entrywidth"),d("entrywidthmode"),d("indentation"),d("itemsizing"),d("itemwidth"),d("itemclick"),d("itemdoubleclick"),d("groupclick"),d("xanchor",D),d("yanchor",I),d("maxheight"),d("valign"),n.noneOrAll(f,p,["x","y"]),d("title.text")){d("title.side",L?"left":"top");var O=n.extendFlat({},m,{size:n.bigFont(m.size)});n.coerceFont(d,"title.font",O);let e=h>1;d("titleclick",!!e&&"toggle"),d("titledoubleclick",!!e&&"toggleothers")}}}function R(e){return r.traceIs(e,"pie-like")&&null!=e._length&&(Array.isArray(e.legend)||Array.isArray(e.showlegend))}}t.exports=function(e,t,r){var i,a=r.slice(),o=t.shapes;if(o)for(i=0;i<o.length;i++){var s=o[i];if(s.showlegend){var l={_input:s._input,visible:s.visible,showlegend:s.showlegend,legend:s.legend};a.push(l)}}var u=["legend"];for(i=0;i<a.length;i++)Array.isArray(a[i].legend)?u=u.concat(a[i].legend):n.pushUnique(u,a[i].legend);for(t._legends=[],i=0;i<u.length;i++){var h=u[i];c(h,e,t,a,u.length),t[h]&&(t[h]._id=h),t._legends.push(h)}}}}),xr=m({"src/components/legend/handle_click.js"(e){var t=He(),r=ct(),n=r.pushUnique,i=yr(),a=!0;e.handleItemClick=function(e,i,o,s){var l=i._fullLayout;if(!i._dragged&&!i._editing){var c=e.data()[0][0];if(!c.groupTitle||!c.noClick){var u=o.groupclick;"toggle"===s&&"toggleothers"===o.itemdoubleclick&&a&&i.data&&i._context.showTips&&(r.notifier(r._(i,"Double-click on legend to isolate one trace"),"long",i),a=!1);var h="togglegroup"===u,f=l.hiddenlabels?l.hiddenlabels.slice():[],p=i._fullData,d=(l.shapes||[]).filter((function(e){return e.showlegend})),m=p.concat(d),g=c.trace;g._isShape&&(g=g._fullInput);var y,v,x,_,b,w=g.legendgroup,T={},k=[],A=[],M=[],S=(l.shapes||[]).map((function(e){return e._input})),E=!1,C=g.legend,I=g._fullInput;if(I&&I._isShape||!t.traceIs(g,"pie-like")){var L,P=w&&w.length,z=[];if(P)for(y=0;y<m.length;y++)(L=m[y]).visible&&L.legendgroup===w&&z.push(y);if("toggle"===s){var D;switch(g.visible){case!0:D="legendonly";break;case!1:D=!1;break;case"legendonly":D=!0}if(P)if(h)for(y=0;y<m.length;y++){var O=m[y];!1!==O.visible&&O.legendgroup===w&&J(O,D)}else J(g,D);else J(g,D)}else if("toggleothers"===s){var R,F,B,j,N,U=!0;for(y=0;y<m.length;y++)if(R=(N=m[y])===g,B=!0!==N.showlegend,!(R||B||(F=P&&N.legendgroup===w,F||N.legend!==C||!0!==N.visible||t.traceIs(N,"notLegendIsolatable")))){U=!1;break}for(y=0;y<m.length;y++)if(!1!==(N=m[y]).visible&&N.legend===C&&!t.traceIs(N,"notLegendIsolatable"))switch(g.visible){case"legendonly":J(N,!0);break;case!0:j=!!U||"legendonly",R=N===g,B=!0!==N.showlegend&&!N.legendgroup,J(N,!(!(F=R||P&&N.legendgroup===w)&&!B)||j)}}for(y=0;y<A.length;y++)if(x=A[y]){var V=x.constructUpdate(),q=Object.keys(V);for(v=0;v<q.length;v++)_=q[v],(T[_]=T[_]||[])[M[y]]=V[_]}for(b=Object.keys(T),y=0;y<b.length;y++)for(_=b[y],v=0;v<k.length;v++)T[_].hasOwnProperty(v)||(T[_][v]=void 0);E?t.call("_guiUpdate",i,T,{shapes:S},k):t.call("_guiRestyle",i,T,k)}else{var H=c.label,G=f.indexOf(H);if("toggle"===s)-1===G?f.push(H):f.splice(G,1);else if("toggleothers"===s){var W=-1!==G,Z=[];for(y=0;y<i.calcdata.length;y++){var Y=i.calcdata[y];for(v=0;v<Y.length;v++){var X=Y[v].label;C===Y[0].trace.legend&&H!==X&&(-1===f.indexOf(X)&&(W=!0),n(f,X),Z.push(X))}}if(!W)for(var $=0;$<Z.length;$++){var K=f.indexOf(Z[$]);-1!==K&&f.splice(K,1)}}t.call("_guiRelayout",i,"hiddenlabels",f)}}}function J(e,t){if(!c.groupTitle||h){var r=e._fullInput||e,n=r._isShape,i=r.index;void 0===i&&(i=r._index);var a=!1!==r.visible&&t;n?function(e,t){S[e].visible=t,E=!0}(i,a):function(e,t){var r=k.indexOf(e),n=T.visible;n||(n=T.visible=[]),-1===k.indexOf(e)&&(k.push(e),r=k.length-1),n[r]=t}(i,a)}}},e.handleTitleClick=function(e,r,n){let a=e._fullLayout,o=e._fullData,s=i.getId(r),l=(a.shapes||[]).filter((function(e){return e.showlegend})),c=o.concat(l);function u(e){return(e.legend||"legend")===s}var h,f;"toggle"===n?(h=!c.some((function(e){return u(e)&&!0===e.visible})),f=!1):(h=!0,f=!c.some((function(e){return!u(e)&&!0===e.visible&&!1!==e.showlegend})));let p={visible:[]},d=[],m=(a.shapes||[]).map((function(e){return e._input}));for(var g=!1,y=0;y<c.length;y++){let e=c[y],t=u(e);if(!t){let t=!0!==e.showlegend&&!e.legendgroup;if("toggle"===n||t)continue}let r=!!(t?h:f)||"legendonly";!1!==e.visible&&e.visible!==r&&(e._isShape?(m[e._index].visible=r,g=!0):(d.push(e.index),p.visible.push(r)))}g?t.call("_guiUpdate",e,p,{shapes:m},d):d.length&&t.call("_guiRestyle",e,p,d)}}}),_r=m({"src/components/legend/constants.js"(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}}}),br=m({"src/components/legend/get_legend_data.js"(e,t){var r=He(),n=yr();t.exports=function(e,t,i){var a,o,s=t._inHover,l=n.isGrouped(t),c=n.isReversed(t),u={},h=[],f=!1,p={},d=0,m=0;function g(e,r,a){if(!1!==t.visible&&(!i||e===t._id))if(""!==r&&n.isGrouped(t))-1===h.indexOf(r)?(h.push(r),f=!0,u[r]=[a]):u[r].push(a);else{var o="~~i"+d;h.push(o),u[o]=[a],d++}}for(a=0;a<e.length;a++){var y=e[a],v=y[0],x=v.trace,_=x.legend,b=x.legendgroup;if(s||x.visible&&x.showlegend)if(r.traceIs(x,"pie-like")){var w=Array.isArray(x.legend),T=Array.isArray(x.showlegend);for(p[b]||(p[b]={}),o=0;o<y.length;o++)if(!T||!1!==x.showlegend[y[o].i]){w&&(_=x.legend[y[o].i]||"legend");var k=y[o].label;p[b][k]||(g(_,b,{label:k,color:y[o].color,i:y[o].i,trace:x,pts:y[o].pts}),p[b][k]=!0,m=Math.max(m,(k||"").length))}}else g(_,b,v),m=Math.max(m,(x.name||"").length)}if(!h.length)return[];var A=!f||!l,M=[];for(a=0;a<h.length;a++){var S=u[h[a]];A?M.push(S[0]):M.push(S)}for(A&&(M=[M]),a=0;a<M.length;a++){var E=1/0;for(o=0;o<M[a].length;o++){var C=M[a][o].trace.legendrank;E>C&&(E=C)}M[a][0]._groupMinRank=E,M[a][0]._preGroupSort=a}var I=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(M.forEach((function(e,t){e[0]._preGroupSort=t})),M.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),a=0;a<M.length;a++){M[a].forEach((function(e,t){e._preSort=t})),M[a].sort(I);var L=M[a][0].trace,P=null;for(o=0;o<M[a].length;o++){var z=M[a][o].trace.legendgrouptitle;if(z&&z.text){P=z,s&&(z.font=t._groupTitleFont);break}}if(c&&M[a].reverse(),P){var D=!1;for(o=0;o<M[a].length;o++)if(r.traceIs(M[a][o].trace,"pie-like")){D=!0;break}M[a].unshift({i:-1,groupTitle:P,noClick:D,trace:{showlegend:L.showlegend,legendgroup:L.legendgroup,legend:L.legend,visible:"toggleitem"===t.groupclick||L.visible}})}for(o=0;o<M[a].length;o++)M[a][o]=[M[a][o]]}return t._lgroupsLength=M.length,t._maxNameLength=m,M}}}),wr=m({"src/traces/pie/helpers.js"(e){var t=ct();function r(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}e.formatPiePercent=function(e,n){var i=r((100*e).toPrecision(3));return t.numSeparate(i,n)+"%"},e.formatPieValue=function(e,n){var i=r(e.toPrecision(10));return t.numSeparate(i,n)},e.getFirstFilled=function(e,r){if(t.isArrayOrTypedArray(e))for(var n=0;n<r.length;n++){var i=e[r[n]];if(i||0===i||""===i)return i}},e.castOption=function(r,n){return t.isArrayOrTypedArray(r)?e.getFirstFilled(r,n):r||void 0},e.getRotationAngle=function(e){return("auto"===e?0:e)*Math.PI/180}}}),Tr=m({"src/traces/pie/fill_one.js"(e,t){var r=er(),n=W();t.exports=function(e,t,i,a){var o=i.marker.pattern;o&&o.shape?r.pointStyle(e,i,a,t):n.fill(e,t.color)}}}),kr=m({"src/traces/pie/style_one.js"(e,t){var r=W(),n=wr().castOption,i=Tr();t.exports=function(e,t,a,o){var s=a.marker.line,l=n(s.color,t.pts)||r.defaultLine,c=n(s.width,t.pts)||0;e.call(i,t,a,o).style("stroke-width",c).call(r.stroke,l)}}}),Ar=m({"src/components/legend/style.js"(e,t){var r=b(),n=He(),i=ct(),a=i.strTranslate,o=er(),s=W(),l=Ct().extractOpts,c=Xt(),u=kr(),h=wr().castOption,f=_r();function p(e,t){return(t?"radial":"horizontal")+(e?"":"reversed")}function d(e){var t=e[0].trace,r=t.contours,n=c.hasLines(t),i=c.hasMarkers(t),a=t.visible&&t.fill&&"none"!==t.fill,o=!1,s=!1;if(r){var l=r.coloring;"lines"===l?o=!0:n="none"===l||"heatmap"===l||r.showlines,"constraint"===r.type?a="="!==r._operation:("fill"===l||"heatmap"===l)&&(s=!0)}return{showMarker:i,showLine:n,showFill:a,showGradientLine:o,showGradientFill:s,anyLine:n||o,anyFill:a||s}}function m(e,t,r){return e&&i.isArrayOrTypedArray(e)?t:e>r?r:e}t.exports=function(e,t,g){var y=t._fullLayout;g||(g=y.legend);var v="constant"===g.itemsizing,x=g.itemwidth,_=(x+2*f.itemGap)/2,b=a(_,0),w=function(e,t,r,n){var i;if(e+1)i=e;else{if(!(t&&t.width>0))return 0;i=t.width}return v?n:Math.min(i,r)};function T(e,i,a){var c=e[0].trace,u=c.marker||{},h=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?c.visible&&c.type===a:n.traceIs(c,"bar"),d=r.select(i).select("g.legendpoints").selectAll("path.legend"+a).data(p?[e]:[]);d.enter().append("path").classed("legend"+a,!0).attr("d",f).attr("transform",b),d.exit().remove(),d.each((function(e){var n=r.select(this),i=e[0],a=w(i.mlw,u.line,5,2);n.style("stroke-width",a+"px");var f=i.mcc;if(!g._inHover&&"mc"in i){var p=l(u),d=p.mid;void 0===d&&(d=(p.max+p.min)/2),f=o.tryColorscale(u,"")(d)}var y=f||i.mc||u.color,v=u.pattern,x=o.getPatternAttr,_=v&&(x(v.shape,0,"")||x(v.path,0,""));if(_){var b=x(v.bgcolor,0,null),T=x(v.fgcolor,0,null),k=v.fgopacity,A=m(v.size,8,10),M=m(v.solidity,.5,1),S="legend-"+c.uid;n.call(o.pattern,"legend",t,S,_,A,M,f,v.fillmode,b,T,k)}else n.call(s.fill,y);a&&s.stroke(n,i.mlc||h.color)}))}function k(e,a,o){var s=e[0],l=s.trace,c=o?l.visible&&l.type===o:n.traceIs(l,o),f=r.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(c?[e]:[]);if(f.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),f.exit().remove(),f.size()){var p=l.marker||{},d=w(h(p.line.width,s.pts),p.line,5,2),m="pieLike",g=i.minExtend(l,{marker:{line:{width:d}}},m),y=i.minExtend(s,{trace:g},m);u(f,y,g,t)}}e.each((function(e){var t=r.select(this),n=i.ensureSingle(t,"g","layers");n.style("opacity",e[0].trace.opacity);var o=g.indentation,s=g.valign,l=e[0].lineHeight,c=e[0].height;if("middle"===s&&0===o||!l||!c)n.attr("transform",null);else{var u={top:1,bottom:-1}[s]*(.5*(l-c+3))||0,h=g.indentation;n.attr("transform",a(h,u))}n.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),n.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=n.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((function(e){var n,a=e[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],n=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":c=[["M-6,-6V6H6V-6Z"]],n=!0;break;case"densitymapbox":case"densitymap":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],n="radial";break;case"cone":c=[["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"]],n=!1;break;case"streamtube":c=[["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"]],n=!1;break;case"surface":c=[["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"]],n=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],n=!1}var u=r.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,c){var u,h=r.select(this),f=l(a),d=f.colorscale,m=f.reversescale;if(d){if(!n){var g=d.length;u=0===c?d[m?g-1:0][1]:1===c?d[m?0:g-1][1]:d[Math.floor((g-1)/2)][1]}}else{var y=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(y)?y[c]||y[0]:y}h.attr("d",e[0]),u?h.call(s.fill,u):h.call((function(e){if(e.size()){var r="legendfill-"+a.uid;o.gradient(e,t,r,p(m,"radial"===n),d,"fill")}}))}))})).each((function(e){var t=e[0].trace,n="waterfall"===t.type;if(e[0]._distinct&&n){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,T(e,this,"waterfall")}var a=[];t.visible&&n&&(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=r.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",b).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var n=r.select(this),i=t[e[0]].marker,a=w(void 0,i.line,5,2);n.attr("d",e[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&n.call(s.stroke,i.line.color)}))})).each((function(e){T(e,this,"funnel")})).each((function(e){T(e,this)})).each((function(e){var a=e[0].trace,l=r.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.visible&&n.traceIs(a,"box-violin")?[e]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),l.exit().remove(),l.each((function(){var e=r.select(this);if("all"!==a.boxpoints&&"all"!==a.points||0!==s.opacity(a.fillcolor)||0!==s.opacity((a.line||{}).color)){var n=w(void 0,a.line,5,2);e.style("stroke-width",n+"px").call(s.fill,a.fillcolor),n&&s.stroke(e,a.line.color)}else{var c=i.minExtend(a,{marker:{size:v?12:i.constrain(a.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,c,t)}}))})).each((function(e){k(e,this,"funnelarea")})).each((function(e){k(e,this,"pie")})).each((function(e){var n,a,s=d(e),u=s.showFill,h=s.showLine,f=s.showGradientLine,m=s.showGradientFill,g=s.anyFill,y=s.anyLine,v=e[0],_=v.trace,b=l(_),T=b.colorscale,k=b.reversescale,A=c.hasMarkers(_)||!g?"M5,0":y?"M5,-2":"M5,-3",M=r.select(this),S=M.select(".legendfill").selectAll("path").data(u||m?[e]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h"+x+"v6h-"+x+"z").call((function(e){if(e.size())if(u)o.fillGroupStyle(e,t,!0);else{var r="legendfill-"+_.uid;o.gradient(e,t,r,p(k),T,"fill")}})),h||f){var E=w(void 0,_.line,10,5);a=i.minExtend(_,{line:{width:E}}),n=[i.minExtend(v,{trace:a})]}var C=M.select(".legendlines").selectAll("path").data(h||f?[n]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",A+(f?"l"+x+",0.0001":"h"+x)).call(h?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+_.uid;o.lineGroupStyle(e),o.gradient(e,t,r,p(k),T,"stroke")}})})).each((function(e){var n,a,s=d(e),l=s.anyFill,u=s.anyLine,h=s.showLine,f=s.showMarker,p=e[0],m=p.trace,g=!f&&!u&&!l&&c.hasText(m);function y(e,t,r,n){var a=i.nestedProperty(m,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(o<r[0])return r[0];if(o>r[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(f||g||h){var _={},w={};if(f){_.mc=y("marker.color",x),_.mx=y("marker.symbol",x),_.mo=y("marker.opacity",i.mean,[.2,1]),_.mlc=y("marker.line.color",x),_.mlw=y("marker.line.width",i.mean,[0,5],2),_.mld=m._isShape?"solid":y("marker.line.dash",x),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=y("marker.size",i.mean,[2,16],12);_.ms=T,w.marker.size=T}h&&(w.line={width:y("line.width",x,[0,10],5)}),g&&(_.tx="Aa",_.tp=y("textposition",x),_.ts=10,_.tc=y("textfont.color",x),_.tf=y("textfont.family",x),_.tw=y("textfont.weight",x),_.ty=y("textfont.style",x),_.tv=y("textfont.variant",x),_.tC=y("textfont.textcase",x),_.tE=y("textfont.lineposition",x),_.tS=y("textfont.shadow",x)),n=[i.minExtend(p,_)],(a=i.minExtend(m,w)).selectedpoints=null,a.texttemplate=null}var k=r.select(this).select("g.legendpoints"),A=k.selectAll("path.scatterpts").data(f?n:[]);A.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),A.exit().remove(),A.call(o.pointStyle,a,t),f&&(n[0].mrc=3);var M=k.selectAll("g.pointtext").data(g?n:[]);M.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),M.exit().remove(),M.selectAll("text").call(o.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);n.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",b).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(e,n){var i=r.select(this),a=t[n?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)}))})).each((function(e){var t=e[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);n.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",b).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(e,n){var i=r.select(this),a=t[n?"increasing":"decreasing"],l=w(void 0,a.line,5,2);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)}))}))}}}),Mr=m({"src/components/legend/draw.js"(e,t){var r=b(),n=ct(),i=At(),a=He(),o=dt(),s=pr(),l=er(),c=W(),u=Et(),h=xr().handleItemClick,f=xr().handleTitleClick,p=_r(),d=St(),m=d.LINE_SPACING,g=d.FROM_TL,y=d.FROM_BR,v=br(),x=Ar(),_=yr(),w=/^legend[0-9]*$/;function T(e,t){var h,d,b=t||{},w=e._fullLayout,T=_.getId(b),S=b._inHover;if(S?(d=b.layer,h="hover"):(d=w._infolayer,h=T),d){var P;if(h+=w._uid,e._legendMouseDownTime||(e._legendMouseDownTime=0),S){if(!b.entries)return;P=v(b.entries,b)}else{for(var z=(e.calcdata||[]).slice(),D=w.shapes,O=0;O<D.length;O++){var R=D[O];if(R.showlegend){var F={_isShape:!0,_fullInput:R,index:R._index,name:R.name||R.label.text||"shape "+R._index,legend:R.legend,legendgroup:R.legendgroup,legendgrouptitle:R.legendgrouptitle,legendrank:R.legendrank,legendwidth:R.legendwidth,showlegend:R.showlegend,visible:R.visible,opacity:R.opacity,mode:"line"===R.type?"lines":"markers",line:R.line,marker:{line:R.line,color:R.fillcolor,size:12,symbol:"rect"===R.type?"square":"circle"===R.type?"circle":"hexagon2"}};z.push([{trace:F}])}}P=w.showlegend&&v(z,b,w._legends.length>1)}var B=w.hiddenlabels||[];if(!(S||w.showlegend&&P.length))return d.selectAll("."+T).remove(),w._topdefs.select("#"+h).remove(),i.autoMargin(e,T);var j=n.ensureSingle(d,"g",T,(function(e){S||e.attr("pointer-events","all")})),N=n.ensureSingleById(w._topdefs,"clipPath",h,(function(e){e.append("rect")})),U=n.ensureSingle(j,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));U.call(c.stroke,b.bordercolor).call(c.fill,b.bgcolor).style("stroke-width",b.borderwidth+"px");var V,q=n.ensureSingle(j,"g","scrollbox"),H=b.title;b._titleWidth=0,b._titleHeight=0,H.text?((V=n.ensureSingle(q,"text",T+"titletext")).attr("text-anchor","start").call(l.font,H.font).text(H.text),C(V,q,e,b,1),!S&&(b.titleclick||b.titledoubleclick)&&function(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 l=t._context.doubleClickDelay;var u,h=1;let p=n.ensureSingle(e,"rect",s+"titletoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(c.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(p.on("mousedown",(function(){(u=(new Date).getTime())-t._legendMouseDownTime<l?h+=1:(h=1,t._legendMouseDownTime=u)})),p.on("mouseup",(function(){if(t._dragged||t._editing)return;(new Date).getTime()-t._legendMouseDownTime>l&&(h=Math.max(h-1,1));let e={event:r.event,legendId:s,data:t.data,layout:t.layout,fullData:t._fullData,fullLayout:t._fullLayout};if(1===h&&i.titleclick){if(!1===o.triggerHandler(t,"plotly_legendtitleclick",e))return;i._titleClickTimeout=setTimeout((function(){t._fullLayout&&f(t,i,i.titleclick)}),l)}else 2===h&&(i._titleClickTimeout&&clearTimeout(i._titleClickTimeout),t._legendMouseDownTime=0,!1!==o.triggerHandler(t,"plotly_legendtitledoubleclick",e)&&i.titledoubleclick&&f(t,i,i.titledoubleclick))})))}(q,e,b,T)):(q.selectAll("."+T+"titletext").remove(),q.selectAll("."+T+"titletoggle").remove());var G=n.ensureSingle(j,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(c.fill,p.scrollBarColor)})),W=q.selectAll("g.groups").data(P);W.enter().append("g").attr("class","groups"),W.exit().remove();var Z=W.selectAll("g.traces").data(n.identity);Z.enter().append("g").attr("class","traces"),Z.exit().remove(),Z.style("opacity",(function(t){let r=t[0],n=r.trace;if(r.groupTitle){let t=n.legendgroup,r=(w.shapes||[]).filter((function(e){return e.showlegend}));return e._fullData.concat(r).some((function(e){return e.legendgroup===t&&(e.legend||"legend")===T&&!0===e.visible}))?1:.5}return a.traceIs(n,"pie-like")?-1!==B.indexOf(t[0].label)?.5:1:"legendonly"===n.visible?.5:1})).each((function(){r.select(this).call(M,e,b)})).call(x,e,b).each((function(t){S||t[0].groupTitle&&"toggleitem"===b.groupclick||r.select(this).call(E,e,T)})),n.syncOrAsync([i.previousPromises,function(){return function(e,t,n,i,a){var o=e._fullLayout,s=_.getId(i);i||(i=o[s]);var c=o._size,h=_.isVertical(i),f=_.isGrouped(i),d="fraction"===i.entrywidthmode,g=i.borderwidth,y=2*g,v=p.itemGap,x=i.indentation+i.itemwidth+2*v,b=2*(g+v),w=L(i),T=i.y<0||0===i.y&&"top"===w,A=i.y>1||1===i.y&&"bottom"===w,M=i.tracegroupgap,S={};let{orientation:E,yref:C}=i,{maxheight:P}=i,z=T||A||"v"!==E||"paper"!==C;P||(P=z?.5:1);let D=z?o.height:c.h;i._maxHeight=Math.max(P>1?P:P*D,30);var O=0;i._width=0,i._height=0;var R=function(e){var t=0,r=0,n=e.title.side;return n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight)),[t,r]}(i);if(h)n.each((function(e){var t=e[0].height;l.setTranslate(this,g+R[0],g+R[1]+i._height+t/2+v),i._height+=t,i._width=Math.max(i._width,e[0].width)})),O=x+i._width,i._width+=v+x+y,i._height+=b,f&&(t.each((function(e,t){l.setTranslate(this,0,t*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var F=I(i),B=i.x<0||0===i.x&&"right"===F,j=i.x>1||1===i.x&&"left"===F,N=A||T,U=o.width/2;i._maxWidth=Math.max(B?N&&"left"===F?c.l+c.w:U:j?N&&"right"===F?c.r+c.w:U:c.w,2*x);var V=0,q=0;n.each((function(e){var t=k(e,i,x);V=Math.max(V,t),q+=t})),O=null;var H=0;if(f){var G=0,W=0,Z=0;t.each((function(){var e=0,t=0;r.select(this).selectAll("g.traces").each((function(r){var n=k(r,i,x),a=r[0].height;l.setTranslate(this,R[0],R[1]+g+v+a/2+t),t+=a,e=Math.max(e,n),S[r[0].trace.legendgroup]=e}));var n=e+v;W>0&&n+g+W>i._maxWidth?(H=Math.max(H,W),W=0,Z+=G+M,G=t):G=Math.max(G,t),l.setTranslate(this,W,Z),W+=n})),i._width=Math.max(H,W)+g,i._height=Z+G+b}else{var Y=n.size(),X=q+y+(Y-1)*v<i._maxWidth,$=0,K=0,J=0,Q=0;n.each((function(e){var t=e[0].height,r=k(e,i,x),n=X?r:V;d||(n+=v),n+g+K-v>=i._maxWidth&&(H=Math.max(H,Q),K=0,J+=$,i._height+=$,$=0),l.setTranslate(this,R[0]+g+K,R[1]+g+J+t/2+v),Q=K+r+v,K+=n,$=Math.max($,t)})),X?(i._width=K+y,i._height=$+b):(i._width=Math.max(H,Q)+y,i._height+=$+b)}}i._width=Math.ceil(Math.max(i._width+R[0],i._titleWidth+2*(g+p.titlePad))),i._height=Math.ceil(Math.max(i._height+R[1],i._titleHeight+2*(g+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var ee=e._context.edits,te=ee.legendText||ee.legendPosition;n.each((function(e){var t=r.select(this).select("."+s+"toggle"),n=e[0].height,a=e[0].trace.legendgroup,o=k(e,i,x);f&&""!==a&&(o=S[a]);var c=te?x:O||o;!h&&!d&&(c+=v/2),l.setRect(t,0,-n/2,c,n)}));var re=a.select("."+s+"titletext");re.node()&&function(e,t,r){if("top center"===t.title.side||"top right"===t.title.side){var n=t.title.font.size*m,i=0,a=e.node(),o=l.bBox(a).width;"top center"===t.title.side?i=.5*(t._width-2*r-2*p.titlePad-o):"top right"===t.title.side&&(i=t._width-2*r-2*p.titlePad-o),u.positionText(e,r+p.titlePad+i,r+n)}}(re,i,g);var ne=a.select("."+s+"titletoggle");if(ne.size()&&re.node()){var ie=re.attr("x")||0,ae=p.titlePad;l.setRect(ne,ie-ae,g,i._titleWidth+2*ae,i._titleHeight+2*ae)}}(e,W,Z,b,q)},function(){var t,o,c,u,f=w._size,m=b.borderwidth,v="paper"===b.xref,x="paper"===b.yref;if(H.text){let t=(w.shapes||[]).filter((function(e){return e.showlegend})),r=e._fullData.concat(t).some((function(e){let t=e.legend||"legend";return(Array.isArray(t)?t.includes(T):t===T)&&!0===e.visible}));V.style("opacity",r?1:.5)}if(!S){var _,k;_=v?f.l+f.w*b.x-g[I(b)]*b._width:w.width*b.x-g[I(b)]*b._width,k=x?f.t+f.h*(1-b.y)-g[L(b)]*b._effHeight:w.height*(1-b.y)-g[L(b)]*b._effHeight;var M=function(e,t,r,n){var a=e._fullLayout,o=a[t],s=I(o),l=L(o),c="paper"===o.xref,u="paper"===o.yref;e._fullLayout._reservedMargin[t]={};var h=o.y<.5?"b":"t",f=o.x<.5?"l":"r",p={r:a.width-r,l:r+o._width,b:a.height-n,t:n+o._effHeight};if(c&&u)return i.autoMargin(e,t,{x:o.x,y:o.y,l:o._width*g[s],r:o._width*y[s],b:o._effHeight*y[l],t:o._effHeight*g[l]});c?e._fullLayout._reservedMargin[t][h]=p[h]:u||"v"===o.orientation?e._fullLayout._reservedMargin[t][f]=p[f]:e._fullLayout._reservedMargin[t][h]=p[h]}(e,T,_,k);if(M)return;if(w.margin.autoexpand){var E=_,C=k;_=v?n.constrain(_,0,w.width-b._width):E,k=x?n.constrain(k,0,w.height-b._effHeight):C,_!==E&&n.log("Constrain "+T+".x to make legend fit inside graph"),k!==C&&n.log("Constrain "+T+".y to make legend fit inside graph")}l.setTranslate(j,_,k)}if(G.on(".drag",null),j.on("wheel",null),S||b._height<=b._maxHeight||e._context.staticPlot){var P=b._effHeight;S&&(P=b._height),U.attr({width:b._width-m,height:P-m,x:m/2,y:m/2}),l.setTranslate(q,0,0),N.select("rect").attr({width:b._width-2*m,height:P-2*m,x:m,y:m}),l.setClipUrl(q,h,e),l.setRect(G,0,0,0,0),delete b._scrollY}else{var z=Math.max(p.scrollBarMinHeight,b._effHeight*b._effHeight/b._height),D=b._effHeight-z-2*p.scrollBarMargin,O=b._height-b._effHeight,R=D/O,F=Math.min(b._scrollY||0,O);U.attr({width:b._width-2*m+p.scrollBarWidth+p.scrollBarMargin,height:b._effHeight-m,x:m/2,y:m/2}),N.select("rect").attr({width:b._width-2*m+p.scrollBarWidth+p.scrollBarMargin,height:b._effHeight-2*m,x:m,y:m+F}),l.setClipUrl(q,h,e),$(F,z,R),j.on("wheel",(function(){$(F=n.constrain(b._scrollY+r.event.deltaY/O*D,0,O),z,R),0!==F&&F!==O&&r.event.preventDefault()}));var B,W,Z,Y=r.behavior.drag().on("dragstart",(function(){var e=r.event.sourceEvent;B="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,Z=F})).on("drag",(function(){var e=r.event.sourceEvent;2===e.buttons||e.ctrlKey||(W="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,F=function(e,t,r){var i=(r-t)/R+e;return n.constrain(i,0,O)}(Z,B,W),$(F,z,R))}));G.call(Y);var X=r.behavior.drag().on("dragstart",(function(){var e=r.event.sourceEvent;"touchstart"===e.type&&(B=e.changedTouches[0].clientY,Z=F)})).on("drag",(function(){var e=r.event.sourceEvent;"touchmove"===e.type&&(W=e.changedTouches[0].clientY,F=function(e,t,r){var i=(t-r)/R+e;return n.constrain(i,0,O)}(Z,B,W),$(F,z,R))}));q.call(X)}function $(t,r,n){b._scrollY=e._fullLayout[T]._scrollY=t,l.setTranslate(q,0,-t),l.setRect(G,b._width,p.scrollBarMargin+t*n,p.scrollBarWidth,r),N.select("rect").attr("y",m+t)}e._context.edits.legendPosition&&(j.classed("cursor-move",!0),s.init({element:j.node(),gd:e,prepFn:function(e){if(e.target!==G.node()){var t=l.getTranslate(j);c=t.x,u=t.y}},moveFn:function(e,r){if(void 0!==c&&void 0!==u){var n=c+e,i=u+r;l.setTranslate(j,n,i),t=s.align(n,b._width,f.l,f.l+f.w,b.xanchor),o=s.align(i+b._height,-b._height,f.t+f.h,f.t,b.yanchor)}},doneFn:function(){if(void 0!==t&&void 0!==o){var r={};r[T+".x"]=t,r[T+".y"]=o,a.call("_guiRelayout",e,r)}},clickFn:function(t,r){var n=d.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return r.clientX>=e.left&&r.clientX<=e.right&&r.clientY>=e.top&&r.clientY<=e.bottom}));n.size()>0&&A(e,b,n,t,r)}}))}],e)}}function k(e,t,r){var n=e[0],i=n.width,a=t.entrywidthmode,o=n.trace.legendwidth||t.entrywidth;return"fraction"===a?t._maxWidth*o:r+(o||i)}function A(e,t,r,n,i){var s=e._fullLayout,l=r.data()[0][0].trace,c=t.itemclick,u=t.itemdoubleclick,f={event:i,node:r.node(),curveNumber:l.index,expandedIndex:l.index,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:s};l._group&&(f.group=l._group),a.traceIs(l,"pie-like")&&(f.label=r.datum()[0].label);var p=o.triggerHandler(e,"plotly_legendclick",f);if(1===n){if(!1===p)return;t._clickTimeout=setTimeout((function(){e._fullLayout&&c&&h(r,e,t,c)}),e._context.doubleClickDelay)}else 2===n&&(t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==o.triggerHandler(e,"plotly_legenddoubleclick",f)&&!1!==p&&u&&h(r,e,t,u))}function M(e,t,r){var i,o,s=_.getId(r),c=e.data()[0][0],h=c.trace,f=a.traceIs(h,"pie-like"),d=!r._inHover&&t._context.edits.legendText&&!f,m=r._maxNameLength;c.groupTitle?(i=c.groupTitle.text,o=c.groupTitle.font):(o=r.font,r.entries?i=c.text:(i=f?c.label:h.name,h._meta&&(i=n.templateString(i,h._meta))));var g=n.ensureSingle(e,"text",s+"text");g.attr("text-anchor","start").call(l.font,o).text(d?S(i,m):i);var y=r.indentation+r.itemwidth+2*p.itemGap;u.positionText(g,y,0),d?g.call(u.makeEditable,{gd:t,text:i}).call(C,e,t,r).on("edit",(function(n){this.text(S(n,m)).call(C,e,t,r);var i=c.trace._fullInput||{},o={};return o.name=n,i._isShape?a.call("_guiRelayout",t,"shapes["+h.index+"].name",o.name):a.call("_guiRestyle",t,o,h.index)})):C(g,e,t,r)}function S(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function E(e,t,i){var a,o=t._context.doubleClickDelay,s=1,l=n.ensureSingle(e,"rect",i+"toggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(c.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(a=(new Date).getTime())-t._legendMouseDownTime<o?s+=1:(s=1,t._legendMouseDownTime=a)})),l.on("mouseup",(function(){if(!t._dragged&&!t._editing){var n=t._fullLayout[i];(new Date).getTime()-t._legendMouseDownTime>o&&(s=Math.max(s-1,1)),A(t,n,e,s,r.event)}})))}function C(e,t,r,n,i){n._inHover&&e.attr("data-notex",!0),u.convertToTspans(e,r,(function(){!function(e,t,r,n){var i=e.data()[0][0],a=i&&i.trace.showlegend;if(Array.isArray(a)&&(a=!1!==a[i.i]),r._inHover||!i||a){var o=e.select("g[class*=math-group]"),s=o.node(),c=_.getId(r);r||(r=t._fullLayout[c]);var h,f,d=r.borderwidth,g=(1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*m;if(s){var y=l.bBox(s);h=y.height,f=y.width,1===n?l.setTranslate(o,d,d+.75*h):l.setTranslate(o,0,.25*h)}else{var v="."+c+(1===n?"title":"")+"text",x=e.select(v),b=u.lineCount(x),w=x.node();if(h=g*b,f=w?l.bBox(w).width:0,1===n)"left"===r.title.side&&(f+=2*p.itemGap),u.positionText(x,d+p.titlePad,d+g);else{var T=2*p.itemGap+r.indentation+r.itemwidth;i.groupTitle&&(T=p.itemGap,f-=r.indentation+r.itemwidth),u.positionText(x,T,-g*((b-1)/2-.3))}}1===n?(r._titleWidth=f,r._titleHeight=h):(i.lineHeight=g,i.height=Math.max(h,16)+3,i.width=f)}else e.remove()}(t,r,n,i)}))}function I(e){return n.isRightAnchor(e)?"right":n.isCenterAnchor(e)?"center":"left"}function L(e){return n.isBottomAnchor(e)?"bottom":n.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){if(t)T(e,t);else{var n=e._fullLayout,i=n._legends;n._infolayer.selectAll('[class^="legend"]').each((function(){var e=r.select(this),t=e.attr("class").split(" ")[0];t.match(w)&&-1===i.indexOf(t)&&e.remove()}));for(var a=0;a<i.length;a++){var o=i[a];T(e,e._fullLayout[o])}}}}}),Sr=m({"src/components/fx/hover.js"(e){var t=b(),r=M(),n=F(),i=ct(),a=i.pushUnique,o=i.strTranslate,s=i.strRotate,l=dt(),c=Et(),u=mr(),h=er(),f=W(),p=pr(),d=ar(),m=xt().zindexSeparator,g=He(),y=Kt(),v=N(),x=vr(),_=Mr(),w=v.YANGLE,T=Math.PI*w/180,k=1/Math.sin(T),A=Math.cos(T),S=Math.sin(T),E=v.HOVERARROWSIZE,C=v.HOVERTEXTPAD,I={box:!0,ohlc:!0,violin:!0,candlestick:!0},L={scatter:!0,scattergl:!0,splom:!0};function P(e,t){return e.distance-t.distance}function z(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(",")}e.hover=function(e,n,o,s){e=i.getGraphDiv(e);var c=n.target;i.throttle(e._fullLayout._uid+v.HOVERID,v.HOVERMINTIME,(function(){!function(e,n,o,s,c){o||(o="xy"),"string"==typeof o&&(o=o.split(m)[0]);var h,v,x,_=Array.isArray(o)?o:[o],b=e._fullLayout,w=b.hoversubplots,T=b._plots||[],A=T[o],M=b._has("cartesian"),S=n.hovermode||b.hovermode,C="x"===(S||"").charAt(0),D="y"===(S||"").charAt(0);if(M&&(C||D)&&"axis"===w)for(var R=_.length,F=0;F<R;F++)if(T[h=_[F]]){v=d.getFromId(e,h,"x"),x=d.getFromId(e,h,"y");var N=(C?v:x)._subplotsWith;if(N&&N.length)for(var H=0;H<N.length;H++)a(_,N[H])}if(A&&"single"!==w){var W=A.overlays.map((function(e){return e.id}));_=_.concat(W)}for(var X=_.length,$=new Array(X),K=new Array(X),J=!1,Q=0;Q<X;Q++)if(T[h=_[Q]])J=!0,$[Q]=T[h].xaxis,K[Q]=T[h].yaxis;else{if(!b[h]||!b[h]._subplot)return void i.warn("Unrecognized subplot: "+h);var ee=b[h]._subplot;$[Q]=ee.xaxis,K[Q]=ee.yaxis}if(S&&!J&&(S="closest"),-1===["x","y","closest","x unified","y unified"].indexOf(S)||!e.calcdata||e.querySelector(".zoombox")||e._dragging)return p.unhoverRaw(e,n);var te=b.hoverdistance;-1===te&&(te=1/0);var re=b.spikedistance;-1===re&&(re=1/0);var ne,ie,ae,oe,se,le,ce,ue,he,fe,pe,de,me,ge=[],ye=[],ve={hLinePoint:null,vLinePoint:null},xe=!1;if(Array.isArray(n))for(S="array",ae=0;ae<n.length;ae++)(se=e.calcdata[n[ae].curveNumber||0])&&(le=se[0].trace,"skip"!==se[0].trace.hoverinfo&&(ye.push(se),"h"===le.orientation&&(xe=!0)));else{var _e,be,we=e.calcdata.slice();for(we.sort((function(e,t){return(e[0].trace.zorder||0)-(t[0].trace.zorder||0)})),oe=0;oe<we.length;oe++)se=we[oe],"skip"!==(le=se[0].trace).hoverinfo&&y.isTraceInSubplots(le,_)&&(ye.push(se),"h"===le.orientation&&(xe=!0));if(c){if(!1===l.triggerHandler(e,"plotly_beforehover",n))return;var Te=c.getBoundingClientRect();_e=n.clientX-Te.left,be=n.clientY-Te.top,b._calcInverseTransform(e);var ke=i.apply3DTransform(b._invTransform)(_e,be);if(_e=ke[0],be=ke[1],_e<0||_e>$[0]._length||be<0||be>K[0]._length)return p.unhoverRaw(e,n)}else _e="xpx"in n?n.xpx:$[0]._length/2,be="ypx"in n?n.ypx:K[0]._length/2;if(n.pointerX=_e+$[0]._offset,n.pointerY=be+K[0]._offset,ne="xval"in n?y.flat(_,n.xval):y.p2c($,_e),ie="yval"in n?y.flat(_,n.yval):y.p2c(K,be),!r(ne[0])||!r(ie[0]))return i.warn("Fx.hover failed",n,e),p.unhoverRaw(e,n)}b.clickanywhere&&(e._hoverXVals=ne,e._hoverYVals=ie,e._hoverXAxes=$,e._hoverYAxes=K);var Ae=1/0;function Me(t,a){for(oe=0;oe<ye.length;oe++)if((se=ye[oe])&&se[0]&&se[0].trace&&!0===(le=se[0].trace).visible&&0!==le._length&&-1===["carpet","contourcarpet"].indexOf(le._module.name)){if(he=S,y.isUnifiedHover(he)&&(he=he.charAt(0)),"splom"===le.type?ce=_[ue=0]:(ce=y.getSubplot(le),ue=_.indexOf(ce)),de={cd:se,trace:le,xa:$[ue],ya:K[ue],maxHoverDistance:te,maxSpikeDistance:re,index:!1,distance:Math.min(Ae,te),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:f.defaultLine,name:le.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},b[ce]&&(de.subplot=b[ce]._subplot),b._splomScenes&&b._splomScenes[le.uid]&&(de.scene=b._splomScenes[le.uid]),"array"===he){var o=n[oe];"pointNumber"in o?(de.index=o.pointNumber,he="closest"):(he="","xval"in o&&(fe=o.xval,he="x"),"yval"in o&&(pe=o.yval,he=he?"closest":"y"))}else void 0!==t&&void 0!==a?(fe=t,pe=a):(fe=ne[ue],pe=ie[ue]);if(me=ge.length,0!==te)if(le._module&&le._module.hoverPoints){var s=le._module.hoverPoints(de,fe,pe,he,{finiteRange:!0,hoverLayer:b._hoverlayer,hoversubplots:w,gd:e});if(s)for(var l,c=0;c<s.length;c++)l=s[c],r(l.x0)&&r(l.y0)&&ge.push(U(l,S))}else i.log("Unrecognized trace type in hover:",le);if("closest"===S&&ge.length>me&&(ge.splice(0,me),Ae=ge[0].distance),M&&0!==re&&0===ge.length){de.distance=re,de.index=!1;var u=le._module.hoverPoints(de,fe,pe,"closest",{hoverLayer:b._hoverlayer});if(u&&(u=u.filter((function(e){return e.spikeDistance<=re}))),u&&u.length){var h,p=u.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(p.length){var d=p[0];r(d.x0)&&r(d.y0)&&(h=Ee(d),(!ve.vLinePoint||ve.vLinePoint.spikeDistance>h.spikeDistance)&&(ve.vLinePoint=h))}var m=u.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(m.length){var g=m[0];r(g.x0)&&r(g.y0)&&(h=Ee(g),(!ve.hLinePoint||ve.hLinePoint.spikeDistance>h.spikeDistance)&&(ve.hLinePoint=h))}}}}}function Se(e,t,r){for(var n,i=null,a=1/0,o=0;o<e.length;o++)v&&v._id!==e[o].xa._id||x&&x._id!==e[o].ya._id||(n=e[o].spikeDistance,r&&0===o&&(n=-1/0),n<=a&&n<=t&&(i=e[o],a=n));return i}function Ee(e){return e?{xa:e.xa,ya:e.ya,x:void 0!==e.xSpike?e.xSpike:(e.x0+e.x1)/2,y:void 0!==e.ySpike?e.ySpike:(e.y0+e.y1)/2,distance:e.distance,spikeDistance:e.spikeDistance,curveNumber:e.trace.index,color:e.color,pointNumber:e.index}:null}Me();var Ce={fullLayout:b,container:b._hoverlayer,event:n},Ie=e._spikepoints,Le={vLinePoint:ve.vLinePoint,hLinePoint:ve.hLinePoint};e._spikepoints=Le;var Pe=function(){var e=ge.filter((function(e){return v&&v._id===e.xa._id&&x&&x._id===e.ya._id})),t=ge.filter((function(e){return!(v&&v._id===e.xa._id&&x&&x._id===e.ya._id)}));e.sort(P),t.sort(P),ge=function(e,t){for(var r=t.charAt(0),n=[],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[r+"period"]?i.push(s):n.push(s)}return n.concat(i).concat(a)}(ge=e.concat(t),S)};Pe();var ze=S.charAt(0),De=("x"===ze||"y"===ze)&&ge[0]&&L[ge[0].trace.type];if(M&&0!==re&&0!==ge.length){var Oe=Se(ge.filter((function(e){return e.ya.showspikes})),re,De);ve.hLinePoint=Ee(Oe);var Re=Se(ge.filter((function(e){return e.xa.showspikes})),re,De);ve.vLinePoint=Ee(Re)}if(0===ge.length){var Fe=p.unhoverRaw(e,n);if(M&&(null!==ve.hLinePoint||null!==ve.vLinePoint)&&q(Ie)&&V(e,ve,Ce),b.hoveranywhere&&!s&&c){var Be=e._hoverdata;Be&&Be.length&&(e.emit("plotly_unhover",{event:n,points:Be}),e._hoverdata=[]),ft([])}return Fe}if(M&&q(Ie)&&V(e,ve,Ce),y.isXYhover(he)&&0!==ge[0].length&&"splom"!==ge[0].trace.type){var je=ge[0],Ne=(ge=I[je.trace.type]?ge.filter((e=>e.trace.index===je.trace.index)):[je]).length;Me(G("x",je,b),G("y",je,b));var Ue,Ve=[],qe={},He=0,Ge=function(e){var t=I[e.trace.type]?z(e):e.trace.index;if(qe[t]){var r=qe[t]-1,n=Ve[r];r>0&&Math.abs(e.distance)<Math.abs(n.distance)&&(Ve[r]=e)}else He++,qe[t]=He,Ve.push(e)};for(Ue=0;Ue<Ne;Ue++)Ge(ge[Ue]);for(Ue=ge.length-1;Ue>Ne-1;Ue--)Ge(ge[Ue]);ge=Ve,Pe()}var We=e._hoverdata,Ze=[],Ye=Z(e),Xe=Y(e);for(let e of ge){var $e=y.makeEventData(e,e.trace,e.cd);if(!1!==e.hovertemplate){var Ke=!1;e.cd[e.index]&&e.cd[e.index].ht&&(Ke=e.cd[e.index].ht),e.hovertemplate=Ke||e.trace.hovertemplate||!1}if(e.xa&&e.ya){var Je=e.x0+e.xa._offset,Qe=e.x1+e.xa._offset,et=e.y0+e.ya._offset,tt=e.y1+e.ya._offset,rt=Math.min(Je,Qe),nt=Math.max(Je,Qe),it=Math.min(et,tt),at=Math.max(et,tt);$e.bbox={x0:rt+Xe,x1:nt+Xe,y0:it+Ye,y1:at+Ye},$e.xPixel=(Je+Qe)/2,$e.yPixel=(et+tt)/2}e.eventData=[$e],Ze.push($e)}e._hoverdata=Ze;var ot="y"===S&&(ye.length>1||ge.length>1)||"closest"===S&&xe&&ge.length>1,st=f.combine(b.plot_bgcolor||f.background,b.paper_bgcolor),lt=O(ge,{gd:e,hovermode:S,rotateLabels:ot,bgColor:st,container:b._hoverlayer,outerContainer:b._paper.node(),commonLabelOpts:b.hoverlabel,hoverdistance:b.hoverdistance}),ct=lt.hoverLabels;if(y.isUnifiedHover(S)||(function(e,t,r,n){var i,a,o,s,l,c,u,h=t?"xa":"ya",f=t?"ya":"xa",p=0,d=1,m=e.size(),g=new Array(m),y=0,v=n.minX,x=n.maxX,_=n.minY,b=n.maxY,w=function(e){return e*r._invScaleX},T=function(e){return e*r._invScaleY};function A(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,o=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=o;i=!1}if(i){var n=0;for(s=0;s<e.length;s++)(c=e[s]).pos+c.dp+c.size>t.pmax&&n++;for(s=e.length-1;s>=0&&!(n<=0);s--)(c=e[s]).pos>t.pmax-1&&(c.del=!0,n--);for(s=0;s<e.length&&!(n<=0);s++)if((c=e[s]).pos<t.pmin+1)for(c.del=!0,n--,o=2*c.size,l=e.length-1;l>=0;l--)e[l].dp-=o;for(s=e.length-1;s>=0&&!(n<=0);s--)(c=e[s]).pos+c.dp+c.size>t.pmax&&(c.del=!0,n--)}}}for(e.each((function(e){var n=e[h],i=e[f],a="x"===n._id.charAt(0),o=n.range;0===y&&o&&o[0]>o[1]!==a&&(d=-1);var s=0,l=a?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var c,u,p=B(e,t),m=e.anchor,A="end"===m?-1:1;if("middle"===m)u=(c=e.crossPos+(a?T(p.y-e.by/2):w(e.bx/2+e.tx2width/2)))+(a?T(e.by):w(e.bx));else if(a)u=(c=e.crossPos+T(E+p.y)-T(e.by/2-E))+T(e.by);else{var M=w(A*E+p.x),S=M+w(A*e.bx);c=e.crossPos+Math.min(M,S),u=e.crossPos+Math.max(M,S)}a?void 0!==_&&void 0!==b&&Math.min(u,b)-Math.max(c,_)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==v&&void 0!==x&&Math.min(u,x)-Math.max(c,v)>1&&("top"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}g[y++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?k:1)/2,pmin:s,pmax:l}]})),g.sort((function(e,t){return e[0].posref-t[0].posref||d*(t[0].traceIndex-e[0].traceIndex)}));!i&&p<=m;){for(p++,i=!0,s=0;s<g.length-1;){var M=g[s],S=g[s+1],C=M[M.length-1],I=S[0];if((a=C.pos+C.dp+C.size-I.pos-I.dp+I.size)>.01){for(l=S.length-1;l>=0;l--)S[l].dp+=a;for(M.push.apply(M,S),g.splice(s+1,1),u=0,l=M.length-1;l>=0;l--)u+=M[l].dp;for(o=u/M.length,l=M.length-1;l>=0;l--)M[l].dp-=o;i=!1}else s++}g.forEach(A)}for(s=g.length-1;s>=0;s--){var L=g[s];for(l=L.length-1;l>=0;l--){var P=L[l],z=P.datum;z.offset=P.dp,z.del=P.del}}}(ct,ot,b,lt.commonLabelBoundingBox),j(ct,ot,b._invScaleX,b._invScaleY)),c&&c.tagName){var ut=g.getComponentMethod("annotations","hasClickToShow")(e,Ze);u(t.select(c),ut?"pointer":"")}var ht=function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=e._hoverdata[n];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}(e,0,We);function ft(t){e.emit("plotly_hover",{event:n,points:t,xaxes:$,yaxes:K,xvals:ne,yvals:ie})}c&&!s&&(ht||b.hoveranywhere)&&(We&&ht&&e.emit("plotly_unhover",{event:n,points:We}),ft(e._hoverdata))}(e,n,o,s,c)}))},e.loneHover=function(e,r){var n=!0;Array.isArray(e)||(n=!1,e=[e]);var i=r.gd,a=Z(i),o=Y(i),s=!1,l=O(e.map((function(e){var t=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,s=e._y0||e.y0||e.y||0,l=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(t,n),h=Math.max(t,n),p=Math.min(s,l),d=Math.max(s,l),m=e.trace;if(g.traceIs(m,"gl3d")){var y=i._fullLayout[m.scene]._scene.container,v=y.offsetLeft,x=y.offsetTop;u+=v,h+=v,p+=x,d+=x}c.bbox={x0:u+o,x1:h+o,y0:p+a,y1:d+a},c.xPixel=(t+n)/2,c.yPixel=(s+l)/2,r.inOut_bbox&&r.inOut_bbox.push(c.bbox)}else c=!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:c}})),{gd:i,hovermode:"closest",rotateLabels:s,bgColor:r.bgColor||f.background,container:t.select(r.container),outerContainer:r.outerContainer||r.container}).hoverLabels,c=0,u=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,t){var n=e.y0-e.by/2;e.offset=n-5<c?c-n+5:0,c=n+e.by+e.offset,t===r.anchorIndex&&(u=e.offset)})).each((function(e){e.offset-=u})),j(l,s,i._fullLayout._invScaleX,i._fullLayout._invScaleY),n?l:l.node()};var D=/<extra>([\s\S]*)<\/extra>/;function O(e,r){var n=r.gd,a=n._fullLayout,l=r.hovermode,u=r.rotateLabels,p=r.bgColor,d=r.container,m=r.outerContainer,b=r.commonLabelOpts||{};if(0===e.length)return[[]];var T=r.fontFamily||v.HOVERFONT,k=r.fontSize||v.HOVERFONTSIZE,A=r.fontWeight||a.font.weight,M=r.fontStyle||a.font.style,S=r.fontVariant||a.font.variant,I=r.fontTextcase||a.font.textcase,L=r.fontLineposition||a.font.lineposition,P=r.fontShadow||a.font.shadow,D=e[0],O=D.xa,F=D.ya,B=l.charAt(0),j=B+"Label",N=D[j];if(void 0===N&&"multicategory"===O.type)for(var U=0;U<e.length&&void 0===(N=e[U][j]);U++);var V=X(n,m),q=V.top,H=V.width,G=V.height,W=void 0!==N&&D.distance<=r.hoverdistance&&("x"===l||"y"===l);if(W){var Z,Y,$=!0;for(Z=0;Z<e.length;Z++)if($&&void 0===e[Z].zLabel&&($=!1),Y=e[Z].hoverinfo||e[Z].trace.hoverinfo){var K=Array.isArray(Y)?Y:Y.split("+");if(-1===K.indexOf("all")&&-1===K.indexOf(l)){W=!1;break}}$&&(W=!1)}var J=d.selectAll("g.axistext").data(W?[0]:[]);J.enter().append("g").classed("axistext",!0),J.exit().remove();var Q={minX:0,maxX:0,minY:0,maxY:0};if(J.each((function(){var e=t.select(this),r=i.ensureSingle(e,"path","",(function(e){e.style({"stroke-width":"1px"})})),s=i.ensureSingle(e,"text","",(function(e){e.attr("data-notex",1)})),u=b.bgcolor||f.defaultLine,p=b.bordercolor||f.contrast(u),d=f.contrast(u),m=b.font,g={weight:m.weight||A,style:m.style||M,variant:m.variant||S,textcase:m.textcase||I,lineposition:m.lineposition||L,shadow:m.shadow||P,family:m.family||T,size:m.size||k,color:m.color||d};r.style({fill:u,stroke:p}),s.text(N).call(h.font,g).call(c.positionText,0,0).call(c.convertToTspans,n),e.attr("transform","");var y,v,x=X(n,s.node());if("x"===l){var _="top"===O.side?"-":"";s.attr("text-anchor","middle").call(c.positionText,0,"top"===O.side?q-x.bottom-E-C:q-x.top+E+C),y=O._offset+(D.x0+D.x1)/2,v=F._offset+("top"===O.side?0:F._length);var w=x.width/2+C,z=y;y<w?z=w:y>a.width-w&&(z=a.width-w),r.attr("d","M"+(y-z)+",0L"+(y-z+E)+","+_+E+"H"+w+"v"+_+(2*C+x.height)+"H"+-w+"V"+_+E+"H"+(y-z-E)+"Z"),y=z,Q.minX=y-w,Q.maxX=y+w,"top"===O.side?(Q.minY=v-(2*C+x.height),Q.maxY=v-C):(Q.minY=v+C,Q.maxY=v+(2*C+x.height))}else{var R,B,j;"right"===F.side?(R="start",B=1,j="",y=O._offset+O._length):(R="end",B=-1,j="-",y=O._offset),v=F._offset+(D.y0+D.y1)/2,s.attr("text-anchor",R),r.attr("d","M0,0L"+j+E+","+E+"V"+(C+x.height/2)+"h"+j+(2*C+x.width)+"V-"+(C+x.height/2)+"H"+j+E+"V-"+E+"Z"),Q.minY=v-(C+x.height/2),Q.maxY=v+(C+x.height/2),"right"===F.side?(Q.minX=y+E,Q.maxX=y+E+(2*C+x.width)):(Q.minX=y-E-(2*C+x.width),Q.maxX=y-E);var U,V=x.height/2,H=q-x.top-V,G="clip"+a._uid+"commonlabel"+F._id;if(y<x.width+2*C+E){U="M-"+(E+C)+"-"+V+"h-"+(x.width-C)+"V"+V+"h"+(x.width-C)+"Z";var W=x.width-y+C;c.positionText(s,W,H),"end"===R&&s.selectAll("tspan").each((function(){var e=t.select(this),r=h.tester.append("text").text(e.text()).call(h.font,g),i=X(n,r.node());Math.round(i.width)<Math.round(x.width)&&e.attr("x",W-i.width),r.remove()}))}else c.positionText(s,B*(C+E),H),U=null;var Z=a._topclips.selectAll("#"+G).data(U?[0]:[]);Z.enter().append("clipPath").attr("id",G).append("path"),Z.exit().remove(),Z.select("path").attr("d",U),h.setClipUrl(s,U?G:null,n)}e.attr("transform",o(y,v))})),y.isUnifiedHover(l)){d.selectAll("g.hovertext").remove();let t=e.filter((e=>"none"!==e.hoverinfo));if(0===t.length)return[];var ee=a.hoverlabel,te=ee.font,re=t[0],ne=(("x unified"===l?re.xa:re.ya).unifiedhovertitle||{}).text,ie={showlegend:!0,legend:{title:{text:ne?i.hovertemplateString({data:"x unified"===l?[{xa:re.xa,x:re.xVal}]:[{ya:re.ya,y:re.yVal}],fallback:re.trace.hovertemplatefallback,locale:a._d3locale,template:ne}):N,font:te},font:te,bgcolor:ee.bgcolor,bordercolor:ee.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:a.legend?a.legend.traceorder:void 0,orientation:"v"}},ae={font:te};x(ie,ae,n._fullData);var oe=ae.legend;oe.entries=[];for(var se=0;se<t.length;se++){var le=t[se];if("none"!==le.hoverinfo){var ce=R(le,!0,l,a,N),ue=ce[0],he=ce[1];le.name=he,le.text=""!==he?he+" : "+ue:ue;var fe=le.cd[le.index];fe&&(fe.mc&&(le.mc=fe.mc),fe.mcc&&(le.mc=fe.mcc),fe.mlc&&(le.mlc=fe.mlc),fe.mlcc&&(le.mlc=fe.mlcc),fe.mlw&&(le.mlw=fe.mlw),fe.mrc&&(le.mrc=fe.mrc),fe.dir&&(le.dir=fe.dir)),le._distinct=!0,oe.entries.push([le])}}oe.entries.sort((function(e,t){return e[0].trace.index-t[0].trace.index})),oe.layer=d,oe._inHover=!0,oe._groupTitleFont=ee.grouptitlefont,_(n,oe);var pe,de,me,ge,ye=d.select("g.legend"),ve=X(n,ye.node()),xe=ve.width+2*C,_e=ve.height+2*C,be=t[0],we=(be.x0+be.x1)/2,Te=(be.y0+be.y1)/2,ke=!(g.traceIs(be.trace,"bar-like")||g.traceIs(be.trace,"box-violin"));"y"===B?ke?(de=Te-C,pe=Te+C):(de=Math.min.apply(null,t.map((function(e){return Math.min(e.y0,e.y1)}))),pe=Math.max.apply(null,t.map((function(e){return Math.max(e.y0,e.y1)})))):de=pe=i.mean(t.map((function(e){return(e.y0+e.y1)/2})))-_e/2,"x"===B?ke?(me=we+C,ge=we-C):(me=Math.max.apply(null,t.map((function(e){return Math.max(e.x0,e.x1)}))),ge=Math.min.apply(null,t.map((function(e){return Math.min(e.x0,e.x1)})))):me=ge=i.mean(t.map((function(e){return(e.x0+e.x1)/2})))-xe/2;var Ae,Me,Se=O._offset,Ee=F._offset;return ge+=Se-xe,de+=Ee-_e,Ae=(me+=Se)+xe<H&&me>=0?me:ge+xe<H&&ge>=0?ge:Se+xe<H?Se:me-we<we-ge+xe?H-xe:0,Ae+=C,Me=(pe+=Ee)+_e<G&&pe>=0?pe:de+_e<G&&de>=0?de:Ee+_e<G?Ee:pe-Te<Te-de+_e?G-_e:0,Me+=C,ye.attr("transform",o(Ae-1,Me-1)),ye}var Ce=d.selectAll("g.hovertext").data(e,(function(e){return z(e)}));return Ce.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(h.font,{weight:A,style:M,variant:S,textcase:I,lineposition:L,shadow:P,family:T,size:k})})),Ce.exit().remove(),Ce.each((function(e){var r=t.select(this).attr("transform",""),i=e.color;Array.isArray(i)&&(i=i[e.eventData[0].pointNumber]);var d=e.bgcolor||i,m=f.combine(f.opacity(d)?d:f.defaultLine,p),g=f.combine(f.opacity(i)?i:f.defaultLine,p),y=e.borderColor||f.contrast(m),v=R(e,W,l,a,N,r),x=v[0],_=v[1],b=r.select("text.nums").call(h.font,{family:e.fontFamily||T,size:e.fontSize||k,color:e.fontColor||y,weight:e.fontWeight||A,style:e.fontStyle||M,variant:e.fontVariant||S,textcase:e.fontTextcase||I,lineposition:e.fontLineposition||L,shadow:e.fontShadow||P}).text(x).attr("data-notex",1).call(c.positionText,0,0).call(c.convertToTspans,n),z=r.select("text.name"),D=0,O=0;if(_&&_!==x){z.call(h.font,{family:e.fontFamily||T,size:e.fontSize||k,color:g,weight:e.fontWeight||A,style:e.fontStyle||M,variant:e.fontVariant||S,textcase:e.fontTextcase||I,lineposition:e.fontLineposition||L,shadow:e.fontShadow||P}).text(_).attr("data-notex",1).call(c.positionText,0,0).call(c.convertToTspans,n);var F=X(n,z.node());D=F.width+2*C,O=F.height+2*C}else z.remove(),r.select("rect").remove();r.select("path").style({fill:m,stroke:y});var B=e.xa._offset+(e.x0+e.x1)/2,j=e.ya._offset+(e.y0+e.y1)/2,U=Math.abs(e.x1-e.x0),V=Math.abs(e.y1-e.y0),Z=X(n,b.node()),Y=Z.width/a._invScaleX,$=Z.height/a._invScaleY;e.ty0=(q-Z.top)/a._invScaleY,e.bx=Y+2*C,e.by=Math.max($+2*C,O),e.anchor="start",e.txwidth=Y,e.tx2width=D,e.offset=0;var K,J,Q=(Y+E+C+D)*a._invScaleX;if(u)e.pos=B,K=j+V/2+Q<=G,J=j-V/2-Q>=0,"top"!==e.idealAlign&&K||!J?K?(j+=V/2,e.anchor="start"):e.anchor="middle":(j-=V/2,e.anchor="end"),e.crossPos=j;else{if(e.pos=j,K=B+U/2+Q<=H,J=B-U/2-Q>=0,"left"!==e.idealAlign&&K||!J)if(K)B+=U/2,e.anchor="start";else{e.anchor="middle";var ee=Q/2,te=B+ee-H,re=B-ee;te>0&&(B-=te),re<0&&(B+=-re)}else B-=U/2,e.anchor="end";e.crossPos=B}b.attr("text-anchor",e.anchor),D&&z.attr("text-anchor",e.anchor),r.attr("transform",o(B,j)+(u?s(w):""))})),{hoverLabels:Ce,commonLabelBoundingBox:Q}}function R(e,t,r,n,a,o){var s,l,c="",u="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=i.templateString(e.name,e.trace._meta)),c=H(e.name,e.nameLength));var h=r.charAt(0),f="x"===h?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(u+="x: "+e.xLabel+"<br>"),void 0!==e.yLabel&&(u+="y: "+e.yLabel+"<br>"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&"choroplethmap"!==e.trace.type&&(u+=(u?"z: ":"")+e.zLabel)):t&&e[h+"Label"]===a?u=e[f+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(u=e.yLabel):u=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",(e.text||0===e.text)&&!Array.isArray(e.text)&&(u+=(u?"<br>":"")+e.text),void 0!==e.extraText&&(u+=(u?"<br>":"")+e.extraText),o&&""===u&&!e.hovertemplate&&(""===c&&o.remove(),u=c),null!=(l=null==(s=e.trace)?void 0:s.hoverlabel)&&l.split&&(e.hovertemplate="");let{hovertemplate:p=!1}=e;if(p){let t=e.hovertemplateLabels||e;e[h+"Label"]!==a&&(t[h+"other"]=t[h+"Val"],t[h+"otherLabel"]=t[h+"Label"]),u=(u=i.hovertemplateString({data:[e.eventData[0]||{},e.trace._meta],fallback:e.trace.hovertemplatefallback,labels:t,locale:n._d3locale,template:p})).replace(D,((t,r)=>(c=H(r,e.nameLength),"")))}return[u,c]}function B(e,t){var r=0,n=e.offset;return t&&(n*=-S,r=e.offset*A),{x:r,y:n}}function j(e,r,n,i){var a=function(e){return e*n},o=function(e){return e*i};e.each((function(e){var n=t.select(this);if(e.del)return n.remove();var i,s=n.select("text.nums"),l=e.anchor,u="end"===l?-1:1,f=function(e){var t={start:1,end:-1,middle:0}[e.anchor],r=t*(E+C),n=r+t*(e.txwidth+C);return"middle"===e.anchor&&(r-=e.tx2width/2,n+=e.txwidth/2+C),{alignShift:t,textShiftX:r,text2ShiftX:n}}(e),p=B(e,r),d=p.x,m=p.y,g="middle"===l,y=!("hoverlabel"in e.trace)||e.trace.hoverlabel.showarrow;i=g?"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":y?"M0,0L"+a(u*E+d)+","+o(E+m)+"v"+o(e.by/2-E)+"h"+a(u*e.bx)+"v-"+o(e.by)+"H"+a(u*E+d)+"V"+o(m-E)+"Z":"M"+a(u*E+d)+","+o(m-e.by/2)+"h"+a(u*e.bx)+"v"+o(e.by)+"h"+a(-u*e.bx)+"Z",n.select("path").attr("d",i);var v=d+f.textShiftX,x=m+e.ty0-e.by/2+C,_=e.textAlign||"auto";"auto"!==_&&("left"===_&&"start"!==l?(s.attr("text-anchor","start"),v=g?-e.bx/2-e.tx2width/2+C:-e.bx-C):"right"===_&&"end"!==l&&(s.attr("text-anchor","end"),v=g?e.bx/2-e.tx2width/2-C:e.bx+C)),s.call(c.positionText,a(v),o(x)),e.tx2width&&(n.select("text.name").call(c.positionText,a(f.text2ShiftX+f.alignShift*C+d),o(m+e.ty0-e.by/2+C)),n.select("rect").call(h.setRect,a(f.text2ShiftX+(f.alignShift-1)*e.tx2width/2+d),o(m-e.by/2-1),a(e.tx2width),o(e.by+2)))}))}function U(e,t){var n=e.index,a=e.trace||{},o=e.cd[0],s=e.cd[n]||{};function l(e){return e||r(e)&&0===e}var c=Array.isArray(n)?function(e,t){var r=i.castOption(o,n,e);return l(r)?r:i.extractOption({},a,"",t)}:function(e,t){return i.extractOption(s,a,e,t)};function u(t,r,n){var i=c(r,n);l(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="y"===t||"closest"===t&&"h"===a.orientation?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),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:d.hoverLabelText(e.xa,e.xLabelVal,a.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:d.hoverLabelText(e.ya,e.yLabelVal,a.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var h=d.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+h+" / -"+d.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" ± "+h,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var f=d.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+f+" / -"+d.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" ± "+f,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function V(e,t,r){var i,a,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!t.hLinePoint,p=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),p||u){var m=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,y,v=t.hLinePoint;i=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(g=c.pointerX,y=c.pointerY):(g=i._offset+v.x,y=a._offset+v.y);var x,_,b=n.readability(v.color,m)<1.5?f.contrast(m):v.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||b,A=d.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=A,_=g),-1!==w.indexOf("across")){var M=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(M=Math.min(M,a.position),S=Math.max(S,a.position)),x=l.l+M*l.w,_=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:_,y1:y,y2:y,"stroke-width":T,stroke:k,"stroke-dasharray":h.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:_,y1:y,y2:y,"stroke-width":T+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==a.side?T:-T),cy:y,r:T,fill:k}).classed("spikeline",!0)}if(p){var E,C,I=t.vLinePoint;i=I&&I.xa,a=I&&I.ya,"cursor"===i.spikesnap?(E=c.pointerX,C=c.pointerY):(E=i._offset+I.x,C=a._offset+I.y);var L,P,z=n.readability(I.color,m)<1.5?f.contrast(m):I.color,D=i.spikemode,O=i.spikethickness,R=i.spikecolor||z,F=d.getPxPosition(e,i);if(-1!==D.indexOf("toaxis")||-1!==D.indexOf("across")){if(-1!==D.indexOf("toaxis")&&(L=F,P=C),-1!==D.indexOf("across")){var B=i._counterDomainMin,j=i._counterDomainMax;"free"===i.anchor&&(B=Math.min(B,i.position),j=Math.max(j,i.position)),L=l.t+(1-j)*l.h,P=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:P,"stroke-width":O,stroke:R,"stroke-dasharray":h.dashStyle(i.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:P,"stroke-width":O+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==D.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==i.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function q(e,t){return!t||t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint}function H(e,t){return c.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function G(e,t,r){var n=t[e+"a"],i=t[e+"Val"],a=t.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var s=t.cd[t.index],l=s[e+"Start"];void 0===l&&(l=s[e]);var c=s[e+"End"];void 0===c&&(c=s[e]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"===r.boxmode||"group"===r.violinmode)&&(i+=a.t.dPos),i}var Z=e=>e.offsetTop+e.clientTop,Y=e=>e.offsetLeft+e.clientLeft;function X(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.left,o=n.top,s=a+n.width,l=o+n.height,c=i.apply3DTransform(r._invTransform)(a,o),u=i.apply3DTransform(r._invTransform)(s,l),h=c[0],f=c[1],p=u[0],d=u[1];return{x:h,y:f,width:p-h,height:d-f,top:Math.min(f,d),left:Math.min(h,p),right:Math.max(h,p),bottom:Math.max(f,d)}}}}),Er=m({"src/components/fx/hoverlabel_defaults.js"(e,t){var r=ct(),n=W(),i=Kt().isUnifiedHover;t.exports=function(e,t,a,o){o=o||{};var s=t.legend;function l(e){o.font[e]||(o.font[e]=s?t.legend.font[e]:t.font[e])}t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),l("weight"),l("style"),l("variant"),s?(o.bgcolor||(o.bgcolor=n.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(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),r.coerceFont(a,"hoverlabel.font",o.font),a("hoverlabel.align",o.align)}}}),Cr=m({"src/components/fx/layout_global_defaults.js"(e,t){var r=ct(),n=Er(),i=U();t.exports=function(e,t){n(e,t,(function(n,a){return r.coerce(e,t,i,n,a)}))}}}),Ir=m({"src/components/fx/defaults.js"(e,t){var r=ct(),n=V(),i=Er();t.exports=function(e,t,a,o){var s=r.extendFlat({},o.hoverlabel);t.hovertemplate&&(s.namelength=-1),i(e,t,(function(i,a){return r.coerce(e,t,n,i,a)}),s)}}}),Lr=m({"src/components/fx/hovermode_defaults.js"(e,t){var r=ct(),n=U();t.exports=function(e,t){function i(i,a){return void 0!==t[i]?t[i]:r.coerce(e,t,n,i,a)}return i("clickmode"),i("hoversubplots"),i("hoveranywhere"),i("clickanywhere"),i("hovermode")}}}),Pr=m({"src/components/fx/layout_defaults.js"(e,t){var r=ct(),n=U(),i=Lr(),a=Er();t.exports=function(e,t){function o(i,a){return r.coerce(e,t,n,i,a)}i(e,t)&&(o("hoverdistance"),o("spikedistance")),"select"===o("dragmode")&&o("selectdirection");var s=t._has("mapbox"),l=t._has("map"),c=t._has("geo"),u=t._basePlotModules.length;"zoom"===t.dragmode&&((s||l||c)&&1===u||(s||l)&&c&&2===u)&&(t.dragmode="pan"),a(e,t,o),r.coerceFont(o,"hoverlabel.grouptitlefont",t.hoverlabel.font)}}}),zr=m({"src/components/fx/calc.js"(e,t){var r=ct(),n=He();function i(e,t,n,i){i=i||r.identity,Array.isArray(e)&&(t[0][n]=i(e))}t.exports=function(e){var t=e.calcdata,a=e._fullLayout;function o(e){return function(t){return r.coerceHoverinfo({hoverinfo:t},{_module:e._module},a)}}for(var s=0;s<t.length;s++){var l=t[s],c=l[0].trace;if(!n.traceIs(c,"pie-like")){var u=n.traceIs(c,"2dMap")?i:r.fillArray;u(c.hoverinfo,l,"hi",o(c)),c.hovertemplate&&u(c.hovertemplate,l,"ht"),c.hoverlabel&&(u(c.hoverlabel.bgcolor,l,"hbg"),u(c.hoverlabel.bordercolor,l,"hbc"),u(c.hoverlabel.font.size,l,"hts"),u(c.hoverlabel.font.color,l,"htc"),u(c.hoverlabel.font.family,l,"htf"),u(c.hoverlabel.font.weight,l,"htw"),u(c.hoverlabel.font.style,l,"hty"),u(c.hoverlabel.font.variant,l,"htv"),u(c.hoverlabel.namelength,l,"hnl"),u(c.hoverlabel.align,l,"hta"),u(c.hoverlabel.showarrow,l,"htsa"))}}}}}),Dr=m({"src/components/fx/click.js"(e,t){var r=He(),n=Sr().hover;t.exports=function(e,t,i){var a=r.getComponentMethod("annotations","onClick")(e,e._hoverdata),o=e._fullLayout;function s(){var r={points:e._hoverdata,event:t};null!=r.xaxes||(r.xaxes=e._hoverXAxes),null!=r.yaxes||(r.yaxes=e._hoverYAxes),null!=r.xvals||(r.xvals=e._hoverXVals),null!=r.yvals||(r.yvals=e._hoverYVals),e.emit("plotly_click",r)}void 0!==i&&n(e,t,i,!0),(e._hoverdata||o.clickanywhere)&&t&&t.target&&(e._hoverdata||(e._hoverdata=[]),a&&a.then?a.then(s):s(),t.stopImmediatePropagation&&t.stopImmediatePropagation())}}}),Or=m({"src/components/fx/index.js"(e,t){var r=b(),n=ct(),i=pr(),a=Kt(),o=U(),s=Sr();t.exports={moduleType:"component",name:"fx",constants:N(),schema:{layout:o},attributes:V(),layoutAttributes:o,supplyLayoutGlobalDefaults:Cr(),supplyDefaults:Ir(),supplyLayoutDefaults:Pr(),calc:zr(),getDistanceFunction:a.getDistanceFunction,getClosest:a.getClosest,inbox:a.inbox,quadrature:a.quadrature,appendArrayPointValue:a.appendArrayPointValue,castHoverOption:function(e,t,r){return n.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return n.castOption(e,r,"hoverinfo",(function(r){return n.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=n.isD3Selection(e)?e:r.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:Dr()}}}),Rr=m({"src/components/dragelement/helpers.js"(e){e.selectMode=function(e){return"lasso"===e||"select"===e},e.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},e.openMode=function(e){return"drawline"===e||"drawopenpath"===e},e.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},e.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},e.selectingOrDrawing=function(t){return e.freeMode(t)||e.rectMode(t)}}}),Fr=m({"src/lib/clear_gl_canvases.js"(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})}))}}}),Br=m({"src/fonts/ploticon.js"(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("")}}}}),jr=m({"src/components/shapes/draw_newshape/constants.js"(e,t){t.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),Nr=m({"src/components/selections/helpers.js"(e,t){var r=ct().strTranslate;function n(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)}}t.exports={p2r:n,r2p:function(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)}},axValue:function(e){var t="y"===e._id.charAt(0)?1:0;return function(r){return n(e,r[t])}},getTransform:function(e){return r(e.xaxis._offset,e.yaxis._offset)}}}}),Ur=m({"src/components/shapes/draw_newshape/helpers.js"(e){var t=Jt(),r=jr(),n=r.CIRCLE_SIDES,i=r.SQRT2,a=Nr(),o=a.p2r,s=a.r2p,l=[0,3,4,5,6,1,2],c=[0,3,4,1,2];function u(e,t){return Math.abs(e-t)<=1e-6}function h(e,t){var r=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(r*r+n*n)}e.writePaths=function(e){var t=e.length;if(!t)return"M0,0Z";for(var r="",n=0;n<t;n++)for(var i=e[n].length,a=0;a<i;a++){var o=e[n][a][0];if("Z"===o)r+="Z";else for(var s=e[n][a].length,u=0;u<s;u++){var h=u;"Q"===o||"S"===o?h=c[u]:"C"===o&&(h=l[u]),r+=e[n][a][h],u>0&&u<s-1&&(r+=",")}}return r},e.readPaths=function(e,r,i,a){var l,c,u,h=t(e),f=[],p=-1,d=0,m=0,g=function(){c=d,u=m};g();for(var y=0;y<h.length;y++){var v,x,_,b,w=[],T=h[y][0],k=T;switch(T){case"M":f[++p]=[],d=+h[y][1],m=+h[y][2],w.push([k,d,m]),g();break;case"Q":case"S":v=+h[y][1],_=+h[y][2],d=+h[y][3],m=+h[y][4],w.push([k,d,m,v,_]);break;case"C":v=+h[y][1],_=+h[y][2],x=+h[y][3],b=+h[y][4],d=+h[y][5],m=+h[y][6],w.push([k,d,m,v,_,x,b]);break;case"T":case"L":d=+h[y][1],m=+h[y][2],w.push([k,d,m]);break;case"H":k="L",d=+h[y][1],w.push([k,d,m]);break;case"V":k="L",m=+h[y][1],w.push([k,d,m]);break;case"A":k="L";var A=+h[y][1],M=+h[y][2];+h[y][4]||(A=-A,M=-M);var S=d-A,E=m;for(l=1;l<=n/2;l++){var C=2*Math.PI*l/n;w.push([k,S+A*Math.cos(C),E+M*Math.sin(C)])}break;case"Z":(d!==c||m!==u)&&(d=c,m=u,w.push([k,d,m]))}for(var I=(i||{}).domain,L=r._fullLayout._size,P=i&&"pixel"===i.xsizemode,z=i&&"pixel"===i.ysizemode,D=!1===a,O=0;O<w.length;O++){for(l=0;l+2<7;l+=2){var R=w[O][l+1],F=w[O][l+2];void 0===R||void 0===F||(d=R,m=F,i&&(i.xaxis&&i.xaxis.p2r?(D&&(R-=i.xaxis._offset),R=P?s(i.xaxis,i.xanchor)+R:o(i.xaxis,R)):(D&&(R-=L.l),I?R=I.x[0]+R/L.w:R/=L.w),i.yaxis&&i.yaxis.p2r?(D&&(F-=i.yaxis._offset),F=z?s(i.yaxis,i.yanchor)-F:o(i.yaxis,F)):(D&&(F-=L.t),F=I?I.y[1]-F/L.h:1-F/L.h)),w[O][l+1]=R,w[O][l+2]=F)}f[p].push(w[O].slice())}}return f},e.pointsOnRectangle=function(e){if(5!==e.length)return!1;for(var t=1;t<3;t++){if(!u(e[0][t]-e[1][t],e[3][t]-e[2][t]))return!1;if(!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])||!(h(e[0],e[1])*h(e[0],e[3])))},e.pointsOnEllipse=function(e){var t=e.length;if(t!==n+1)return!1;t=n;for(var r=0;r<t;r++){var i=(2*t-r)%t,a=(t/2+i)%t,o=(t/2+r)%t;if(!u(h(e[r],e[o]),h(e[i],e[a])))return!1}return!0},e.handleEllipse=function(t,r,a){if(!t)return[r,a];var o=e.ellipseOver({x0:r[0],y0:r[1],x1:a[0],y1:a[1]}),s=(o.x1+o.x0)/2,l=(o.y1+o.y0)/2,c=(o.x1-o.x0)/2,u=(o.y1-o.y0)/2;c||(c=u/=i),u||(u=c/=i);for(var h=[],f=0;f<n;f++){var p=2*f*Math.PI/n;h.push([s+c*Math.cos(p),l+u*Math.sin(p)])}return h},e.ellipseOver=function(e){var t=e.x0,r=e.y0,n=e.x1,a=e.y1,o=n-t,s=a-r,l=((t-=o)+n)/2,c=((r-=s)+a)/2;return{x0:l-(o*=i),y0:c-(s*=i),x1:l+o,y1:c+s}},e.fixDatesForPaths=function(e,t,r){var n="date"===t.type,i="date"===r.type;if(!n&&!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)n&&(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}}}),Vr=m({"src/components/shapes/draw_newshape/newshapes.js"(e,t){var r=_t(),n=Rr(),i=n.drawMode,a=n.openMode,o=jr(),s=o.i000,l=o.i090,c=o.i180,u=o.i270,h=o.cos45,f=o.sin45,p=Nr(),d=p.p2r,m=p.r2p,g=bt().clearOutline,y=Ur(),v=y.readPaths,x=y.writePaths,_=y.ellipseOver,b=y.fixDatesForPaths;function w(e,t,r){var n,i=e[0][0],o=t.gd,p=i.getAttribute("d"),g=o._fullLayout.newshape,y=t.plotinfo,w=t.isActiveShape,T=y.xaxis,k=y.yaxis,A=!!y.domain||!y.xaxis,M=!!y.domain||!y.yaxis,S=a(r),E=v(p,o,y,w),C={editable:!0,visible:g.visible,name:g.name,showlegend:g.showlegend,legend:g.legend,legendwidth:g.legendwidth,legendgroup:g.legendgroup,legendgrouptitle:{text:g.legendgrouptitle.text,font:g.legendgrouptitle.font},legendrank:g.legendrank,label:g.label,xref:A?"paper":T._id,yref:M?"paper":k._id,layer:g.layer,opacity:g.opacity,line:{color:g.line.color,width:g.line.width,dash:g.line.dash}};if(S||(C.fillcolor=g.fillcolor,C.fillrule=g.fillrule),1===E.length&&(n=E[0]),n&&5===n.length&&"drawrect"===r)C.type="rect",C.x0=n[0][1],C.y0=n[0][2],C.x1=n[2][1],C.y1=n[2][2];else if(n&&"drawline"===r)C.type="line",C.x0=n[0][1],C.y0=n[0][2],C.x1=n[1][1],C.y1=n[1][2];else if(n&&"drawcircle"===r){C.type="circle";var I=n[s][1],L=n[l][1],P=n[c][1],z=n[u][1],D=n[s][2],O=n[l][2],R=n[c][2],F=n[u][2],B=y.xaxis&&("date"===y.xaxis.type||"log"===y.xaxis.type),j=y.yaxis&&("date"===y.yaxis.type||"log"===y.yaxis.type);B&&(I=m(y.xaxis,I),L=m(y.xaxis,L),P=m(y.xaxis,P),z=m(y.xaxis,z)),j&&(D=m(y.yaxis,D),O=m(y.yaxis,O),R=m(y.yaxis,R),F=m(y.yaxis,F));var N=(L+z)/2,U=(D+R)/2,V=_({x0:N,y0:U,x1:N+(z-L+P-I)/2*h,y1:U+(F-O+R-D)/2*f});B&&(V.x0=d(y.xaxis,V.x0),V.x1=d(y.xaxis,V.x1)),j&&(V.y0=d(y.yaxis,V.y0),V.y1=d(y.yaxis,V.y1)),C.x0=V.x0,C.y0=V.y0,C.x1=V.x1,C.y1=V.y1}else C.type="path",T&&k&&b(E,T,k),C.path=x(E),n=null;return C}t.exports={newShapes:function(e,t){if(e.length&&e[0][0]){var n=t.gd,a=t.isActiveShape,o=t.dragmode,s=(n.layout||{}).shapes||[];if(!i(o)&&void 0!==a){var l=n._fullLayout._activeShapeIndex;if(l<s.length)switch(n._fullLayout.shapes[l].type){case"rect":o="drawrect";break;case"circle":o="drawcircle";break;case"line":o="drawline";break;case"path":var c=s[l].path||"";o="Z"===c[c.length-1]?"drawclosedpath":"drawopenpath"}}var u=w(e,t,o);g(n);for(var h=t.editHelpers,f=(h||{}).modifyItem,p=[],d=0;d<s.length;d++){var m=n._fullLayout.shapes[d];if(p[d]=m._input,void 0!==a&&d===n._fullLayout._activeShapeIndex){var y=u;switch(m.type){case"line":case"rect":case"circle":var v=r.getFromId(n,m.xref);"x"===m.xref.charAt(0)&&v.type.includes("category")?(f("x0",y.x0-(m.x0shift||0)),f("x1",y.x1-(m.x1shift||0))):(f("x0",y.x0),f("x1",y.x1));var x=r.getFromId(n,m.yref);"y"===m.yref.charAt(0)&&x.type.includes("category")?(f("y0",y.y0-(m.y0shift||0)),f("y1",y.y1-(m.y1shift||0))):(f("y0",y.y0),f("y1",y.y1));break;case"path":f("path",y.path)}}}return void 0===a?(p.push(u),p):h?h.getUpdateObj():{}}},createShapeObj:w}}}),qr=m({"src/components/selections/draw_newselection/newselections.js"(e,t){var r=Rr().selectMode,n=bt().clearOutline,i=Ur(),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 l=i.getAttribute("d"),c=t.gd,u=c._fullLayout.newselection,h=t.plotinfo,f=h.xaxis,p=h.yaxis,d=t.isActiveSelection,m=t.dragmode,g=(c.layout||{}).selections||[];if(!r(m)&&void 0!==d){var y=c._fullLayout._activeSelectionIndex;if(y<g.length)switch(c._fullLayout.selections[y].type){case"rect":m="select";break;case"path":m="lasso"}}var v,x=a(l,c,h,d),_={xref:f._id,yref:p._id,opacity:u.opacity,line:{color:u.line.color,width:u.line.width,dash:u.line.dash}};1===x.length&&(v=x[0]),v&&5===v.length&&"select"===m?(_.type="rect",_.x0=v[0][1],_.y0=v[0][2],_.x1=v[2][1],_.y1=v[2][2]):(_.type="path",f&&p&&s(x,f,p),_.path=o(x),v=null),n(c);for(var b=t.editHelpers,w=(b||{}).modifyItem,T=[],k=0;k<g.length;k++){var A=c._fullLayout.selections[k];if(A){if(T[k]=A._input,void 0!==d&&k===c._fullLayout._activeSelectionIndex){var M=_;switch(A.type){case"rect":w("x0",M.x0),w("x1",M.x1),w("y0",M.y0),w("y1",M.y1);break;case"path":w("path",M.path)}}}else T[k]=A}return void 0===d?(T.push(_),T):b?b.getUpdateObj():{}}}}}}),Hr=m({"src/components/shapes/constants.js"(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}}}}),Gr=m({"src/components/shapes/helpers.js"(e){var t=Hr(),r=ct(),n=ar();function i(e,t){var r=0;return(t=t||0)&&e&&("category"===e.type||"multicategory"===e.type)&&(r=(e.r2p(1)-e.r2p(0))*t),r}e.rangeToShapePosition=function(e){return"log"===e.type?e.r2d:function(e){return e}},e.shapePositionToRange=function(e){return"log"===e.type?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,n,i){var a=[];return e.match(t.segmentRE).forEach((function(e){var o=n[e.charAt(0)].drawn;if(void 0!==o){var s=e.slice(1).match(t.paramRE);if(s&&!(s.length<o)){var l=s[o],c=i?l:r.cleanNumber(l);a.push(c)}}})),a},e.countDefiningCoords=function(e,r,n){if("path"!==e)return 2;if(!r)return 0;let i=r.match(t.segmentRE);if(!i)return 0;let a="x"===n?t.paramIsX:t.paramIsY;return i.reduce(((e,t)=>{let r=t.charAt(0);return e+(void 0!==a[r].drawn?1:0)}),0)},e.getDataToPixel=function(t,r,n,a,o){var s,l=t._fullLayout._size;if(r)if("domain"===o)s=function(e){return r._length*(a?1-e:e)+r._offset};else{var c=e.shapePositionToRange(r);s=function(e){var t=i(r,n);return r._offset+r.r2p(c(e,!0))+t},"date"===r.type&&(s=e.decodeDate(s))}else s=a?function(e){return l.t+l.h*(1-e)}:function(e){return l.l+l.w*e};return s},e.getPixelToData=function(t,r,n,i){var a,o=t._fullLayout._size;if(r)if("domain"===i)a=function(e){var t=(e-r._offset)/r._length;return n?1-t:t};else{var s=e.rangeToShapePosition(r);a=function(e){return s(r.p2r(e-r._offset))}}else a=n?function(e){return 1-(e-o.t)/o.h}:function(e){return(e-o.l)/o.w};return a},e.roundPositionForSharpStrokeRendering=function(e,t){var r=1===Math.round(t%2),n=Math.round(e);return r?n+.5:n},e.makeShapesOptionsAndPlotinfo=function(e,t){var r=e._fullLayout.shapes[t]||{},n=e._fullLayout._plots[r.xref+r.yref];return n?n._hadPlotinfo=!0:(n={},r.xref&&"paper"!==r.xref&&(n.xaxis=e._fullLayout[r.xref+"axis"]),r.yref&&"paper"!==r.yref&&(n.yaxis=e._fullLayout[r.yref+"axis"])),n.xsizemode=r.xsizemode,n.ysizemode=r.ysizemode,n.xanchor=r.xanchor,n.yanchor=r.yanchor,{options:r,plotinfo:n}},e.makeSelectionsOptionsAndPlotinfo=function(e,t){var r=e._fullLayout.selections[t]||{},n=e._fullLayout._plots[r.xref+r.yref];return n?n._hadPlotinfo=!0:(n={},r.xref&&(n.xaxis=e._fullLayout[r.xref+"axis"]),r.yref&&(n.yaxis=e._fullLayout[r.yref+"axis"])),{options:r,plotinfo:n}},e.getPathString=function(a,o){let s=o.type,l=n.getRefType(o.xref),c=n.getRefType(o.yref),u=a._fullLayout._size;var h,f,p,d,m,g,y,v,x,_,b,w;function T(t,r,n,i){var a;if(t)if("domain"===r)a=i?function(e){return t._offset+t._length*(1-e)}:function(e){return t._offset+t._length*e};else{let r=e.shapePositionToRange(t);a=function(e){return t._offset+t.r2p(r(e,!0))},"path"===n&&"date"===t.type&&(a=e.decodeDate(a))}else a=i?function(e){return u.t+u.h*(1-e)}:function(e){return u.l+u.w*e};return a}if("array"===l?(y=[],h=o.xref.map((function(e){return n.getFromId(a,e)})),y=o.xref.map((function(e,t){return T(h[t],n.getRefType(e),s,!1)}))):y=T(h=n.getFromId(a,o.xref),l,s,!1),"array"===c?(v=[],f=o.yref.map((function(e){return n.getFromId(a,e)})),v=o.yref.map((function(e,t){return T(f[t],n.getRefType(e),s,!0)}))):v=T(f=n.getFromId(a,o.yref),c,s,!0),"path"===s)return function(e,n,i){let a=e.path,o=e.xsizemode,s=e.ysizemode,l=e.xanchor,c=e.yanchor,u=Array.isArray(e.xref),h=Array.isArray(e.yref);var f=0,p=0;return a.replace(t.segmentRE,(function(e){var a=0,d=e.charAt(0),m=t.paramIsX[d],g=t.paramIsY[d],y=t.numParams[d];let v=void 0!==m.drawn,x=void 0!==g.drawn,_=u?n[f]:n,b=h?i[p]:i;var w=e.slice(1).replace(t.paramRE,(function(e){return m[a]?e="pixel"===o?_(l)+Number(e):_(e):g[a]&&(e="pixel"===s?b(c)-Number(e):b(e)),++a>y&&(e="X"),e}));return a>y&&(w=w.replace(/[\s,]*X.*/,""),r.log("Ignoring extra params in segment "+e)),v&&f++,x&&p++,d+w}))}(o,y,v);if("array"===l)p=i(h[0],o.x0shift),d=i(h[1],o.x1shift),x=y[0](o.x0)+p,_=y[1](o.x1)+d;else if(p=i(h,o.x0shift),d=i(h,o.x1shift),"pixel"===o.xsizemode){let e=y(o.xanchor);x=e+o.x0+p,_=e+o.x1+d}else x=y(o.x0)+p,_=y(o.x1)+d;if("array"===c)m=i(f[0],o.y0shift),g=i(f[1],o.y1shift),b=v[0](o.y0)+m,w=v[1](o.y1)+g;else if(m=i(f,o.y0shift),g=i(f,o.y1shift),"pixel"===o.ysizemode){let e=v(o.yanchor);b=e-o.y0+m,w=e-o.y1+g}else b=v(o.y0)+m,w=v(o.y1)+g;if("line"===s)return"M"+x+","+b+"L"+_+","+w;if("rect"===s)return"M"+x+","+b+"H"+_+"V"+w+"H"+x+"Z";var k=(x+_)/2,A=(b+w)/2,M=Math.abs(k-x),S=Math.abs(A-b),E="A"+M+","+S,C=k+M+","+A;return"M"+C+E+" 0 1,1 "+k+","+(A-S)+E+" 0 0,1 "+C+"Z"}}}),Wr=m({"src/components/shapes/display_labels.js"(e,t){var r=ct(),n=ar(),i=Et(),a=er(),o=Ur().readPaths,s=Gr(),l=s.getPathString,c=Be(),u=St().FROM_TL;t.exports=function(e,t,h,f){if(f.selectAll(".shape-label").remove(),h.label.text||h.label.texttemplate){var p;if(h.label.texttemplate){var d={};if("path"!==h.type){var m=n.getFromId(e,h.xref),g=n.getFromId(e,h.yref);let t=Array.isArray(h.xref),r=Array.isArray(h.yref);for(var y in c){var v="function"==typeof c[y],x=!t||c.simpleXVariables.includes(y),_=!r||c.simpleYVariables.includes(y);if(v&&x&&_){var b=c[y](h,m,g);void 0!==b&&(d[y]=b)}}}p=r.texttemplateStringForShapes({data:[d],fallback:h.label.texttemplatefallback,locale:e._fullLayout._d3locale,template:h.label.texttemplate})}else p=h.label.text;var w,T,k,A,M={"data-index":t},S=h.label.font,E=f.append("g").attr(M).classed("shape-label",!0).append("text").attr({"data-notex":1}).classed("shape-label-text",!0).text(p);if(h.path){var C=l(e,h),I=o(C,e);w=1/0,k=1/0,T=-1/0,A=-1/0;for(var L=0;L<I.length;L++)for(var P=0;P<I[L].length;P++)for(var z=I[L][P],D=1;D<z.length;D+=2){var O=z[D],R=z[D+1];w=Math.min(w,O),T=Math.max(T,O),k=Math.min(k,R),A=Math.max(A,R)}}else{let t=Array.isArray(h.xref),r=Array.isArray(h.yref),i=n.getFromId(e,t?h.xref[0]:h.xref),a=n.getFromId(e,t?h.xref[1]:h.xref),o=n.getFromId(e,r?h.yref[0]:h.yref),l=n.getFromId(e,r?h.yref[1]:h.yref),c=n.getRefType(t?h.xref[0]:h.xref),u=n.getRefType(t?h.xref[1]:h.xref),f=n.getRefType(r?h.yref[0]:h.yref),p=n.getRefType(r?h.yref[1]:h.yref),d=function(t,r,n,i){return s.getDataToPixel(e,n,r,!1,i)(t)},m=function(t,r,n,i){return s.getDataToPixel(e,n,r,!0,i)(t)};w=d(h.x0,h.x0shift,i,c),T=d(h.x1,h.x1shift,a,u),k=m(h.y0,h.y0shift,o,f),A=m(h.y1,h.y1shift,l,p)}var F=h.label.textangle;"auto"===F&&(F="line"===h.type?function(e,t,r,n){var i,a;return a=Math.abs(r-e),i=r>=e?t-n:n-t,-180/Math.PI*Math.atan2(i,a)}(w,k,T,A):0),E.call((function(t){return t.call(a.font,S).attr({}),i.convertToTspans(t,e),t}));var B=function(e,t,r,n,i,a,o){var s,l,c,h,f=i.label.textposition,p=i.label.textangle,d=i.label.padding,m=i.type,g=Math.PI/180*a,y=Math.sin(g),v=Math.cos(g),x=i.label.xanchor,_=i.label.yanchor;if("line"===m){"start"===f?(s=e,l=t):"end"===f?(s=r,l=n):(s=(e+r)/2,l=(t+n)/2),"auto"===x&&(x="start"===f?"auto"===p?r>e?"left":r<e?"right":"center":r>e?"right":r<e?"left":"center":"end"===f?"auto"===p?r>e?"right":r<e?"left":"center":r>e?"left":r<e?"right":"center":"center");var b={bottom:-1,middle:0,top:1};if("auto"===p){var w=b[_];c=-d*y*w,h=d*v*w}else c=d*{left:1,center:0,right:-1}[x],h=d*b[_];s+=c,l+=h}else c=d+3,-1!==f.indexOf("right")?(s=Math.max(e,r)-c,"auto"===x&&(x="right")):-1!==f.indexOf("left")?(s=Math.min(e,r)+c,"auto"===x&&(x="left")):(s=(e+r)/2,"auto"===x&&(x="center")),l=-1!==f.indexOf("top")?Math.min(t,n):-1!==f.indexOf("bottom")?Math.max(t,n):(t+n)/2,h=d,"bottom"===_?l-=h:"top"===_&&(l+=h);var T=u[_],k=i.label.font.size,A=o.height;return{textx:s+(A*T-k)*y,texty:l+-(A*T-k)*v,xanchor:x}}(w,k,T,A,h,F,a.bBox(E.node())),j=B.textx,N=B.texty,U=B.xanchor;E.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[U],y:N,x:j,transform:"rotate("+F+","+j+","+N+")"}).call(i.positionText,j,N)}}}}),Zr=m({"src/components/shapes/display_outlines.js"(e,t){var r=ct().strTranslate,n=pr(),i=Rr(),a=i.drawMode,o=i.selectMode,s=He(),l=W(),c=jr(),u=c.i000,h=c.i090,f=c.i180,p=c.i270,d=bt().clearOutlineControllers,m=Ur(),g=m.pointsOnRectangle,y=m.pointsOnEllipse,v=m.writePaths,x=Vr().newShapes,_=Vr().createShapeObj,b=qr(),w=Wr();function T(e,t){var r,n,i,a=e[t][1],o=e[t][2],s=e.length;return n=e[r=(t+1)%s][1],i=e[r][2],n===a&&i===o&&(n=e[r=(t+2)%s][1],i=e[r][2]),[r,n,i]}t.exports=function e(t,i,c,m){m||(m=0);var k=c.gd;function A(){e(t,i,c,m++),(y(t[0])||c.hasText)&&M({redrawing:!0})}function M(e){var t={};void 0!==c.isActiveShape&&(c.isActiveShape=!1,t=x(i,c)),void 0!==c.isActiveSelection&&(c.isActiveSelection=!1,t=b(i,c),k._fullLayout._reselect=!0),Object.keys(t).length&&s.call((e||{}).redrawing?"relayout":"_guiRelayout",k,t)}var S,E,C,I,L,P=k._fullLayout._zoomlayer,z=c.dragmode,D=a(z),O=o(z);if((D||O)&&(k._fullLayout._outlining=!0),d(k),i.attr("d",v(t)),m||!c.isActiveShape&&!c.isActiveSelection||(L=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];e[r]=[];for(var i=0;i<n.length;i++){e[r][i]=[];for(var a=0;a<n[i].length;a++)e[r][i][a]=n[i][a]}}return e}([],t),function(e){S=[];for(var i=0;i<t.length;i++){var a=t[i],o=g(a),s=!o&&y(a);S[i]=[];for(var d=a.length,m=0;m<d;m++)if("Z"!==a[m][0]&&(!s||m===u||m===h||m===f||m===p)){var v,x=o&&c.isActiveSelection;x&&(v=T(a,m));var _=a[m][1],b=a[m][2],w=e.append(x?"rect":"circle").attr("data-i",i).attr("data-j",m).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,"shape-rendering":"crispEdges"});if(x){var A=v[1]-_,M=v[2]-b,E=M?5:Math.max(Math.min(25,Math.abs(A)-5),5),C=A?5:Math.max(Math.min(25,Math.abs(M)-5),5);w.classed(M?"cursor-ew-resize":"cursor-ns-resize",!0).attr("width",E).attr("height",C).attr("x",_-E/2).attr("y",b-C/2).attr("transform",r(A/2,M/2))}else w.classed("cursor-grab",!0).attr("r",5).attr("cx",_).attr("cy",b);S[i][m]={element:w.node(),gd:k,prepFn:B,doneFn:N,clickFn:U},n.init(S[i][m])}}}(P.append("g").attr("class","outline-controllers")),function(){if(E=[],t.length){E[0]={element:i[0][0],gd:k,prepFn:q,doneFn:H,clickFn:G},n.init(E[0])}}()),D&&c.hasText){var R=P.select(".label-temp"),F=_(i,c,c.dragmode);w(k,"label-temp",F,R)}function B(e){C=+e.srcElement.getAttribute("data-i"),I=+e.srcElement.getAttribute("data-j"),S[C][I].moveFn=j}function j(e,r){if(t.length){var n=L[C][I][1],i=L[C][I][2],a=t[C],o=a.length;if(g(a)){var s=e,l=r;c.isActiveSelection&&(T(a,I)[1]===a[I][1]?l=0:s=0);for(var u=0;u<o;u++)if(u!==I){var h=a[u];h[1]===a[I][1]&&(h[1]=n+s),h[2]===a[I][2]&&(h[2]=i+l)}if(a[I][1]=n+s,a[I][2]=i+l,!g(a))for(var f=0;f<o;f++)for(var p=0;p<a[f].length;p++)a[f][p]=L[C][f][p]}else a[I][1]=n+e,a[I][2]=i+r;A()}}function N(){M()}function U(e,r){if(2===e){C=+r.srcElement.getAttribute("data-i"),I=+r.srcElement.getAttribute("data-j");var n=t[C];!g(n)&&!y(n)&&function(){if(t.length&&t[C]&&t[C].length){for(var e=[],r=0;r<t[C].length;r++)r!==I&&e.push(t[C][r]);e.length>1&&(2!==e.length||"Z"!==e[1][0])&&(0===I&&(e[0][0]="M"),t[C]=e,A(),M())}}()}}function V(e,r){(function(e,r){if(t.length)for(var n=0;n<t.length;n++)for(var i=0;i<t[n].length;i++)for(var a=0;a+2<t[n][i].length;a+=2)t[n][i][a+1]=L[n][i][a+1]+e,t[n][i][a+2]=L[n][i][a+2]+r})(e,r),A()}function q(e){(C=+e.srcElement.getAttribute("data-i"))||(C=0),E[C].moveFn=V}function H(){M()}function G(e){2===e&&function(e){if(o(e._fullLayout.dragmode)){d(e);var t=e._fullLayout._activeSelectionIndex,r=(e.layout||{}).selections||[];if(t<r.length){for(var n=[],i=0;i<r.length;i++)i!==t&&n.push(r[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:n})}}}(k)}}}}),Yr=m({"src/components/shapes/draw.js"(e,t){var r=b(),n=He(),i=ct(),a=ar(),o=Ur().readPaths,s=Zr(),l=Wr(),c=bt().clearOutlineControllers,u=W(),h=er(),f=vt().arrayEditor,p=pr(),d=dr(),m=Hr(),g=Gr(),y=g.getPathString;function v(e){var t=e._fullLayout;for(var r in t._shapeUpperLayer.selectAll("path").remove(),t._shapeLowerLayer.selectAll("path").remove(),t._shapeUpperLayer.selectAll("text").remove(),t._shapeLowerLayer.selectAll("text").remove(),t._plots){var n=t._plots[r].shapelayer;n&&(n.selectAll("path").remove(),n.selectAll("text").remove())}for(var i=0;i<t.shapes.length;i++)!0===t.shapes[i].visible&&w(e,i)}function x(e){return!!e._fullLayout._outlining}function _(e){return!e._context.edits.shapePosition}function w(e,t){e._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+t+'"]').remove();var c=g.makeShapesOptionsAndPlotinfo(e,t),b=c.options,w=c.plotinfo;if(!b._input||!0!==b.visible)return;let M=Array.isArray(b.xref)||Array.isArray(b.yref);function S(c){var M=y(e,b),S={"data-index":t,"fill-rule":b.fillrule,d:M},E=b.opacity,C=b.fillcolor,I=b.line.width?b.line.color:"rgba(0,0,0,0)",L=b.line.width,P=b.line.dash;!L&&!0===b.editable&&(L=5,P="solid");var z="Z"!==M[M.length-1],D=_(e)&&b.editable&&e._fullLayout._activeShapeIndex===t;D&&(C=z?"rgba(0,0,0,0)":e._fullLayout.activeshape.fillcolor,E=e._fullLayout.activeshape.opacity);var O,R=c.append("g").classed("shape-group",!0).attr({"data-index":t}),F=R.append("path").attr(S).style("opacity",E).call(u.stroke,I).call(u.fill,C).call(h.dashLine,P,L);if(T(R,e,b),l(e,t,b,R),(D||e._context.edits.shapePosition)&&(O=f(e.layout,"shapes",b)),D){F.style({cursor:"move"});var B={element:F.node(),plotinfo:w,gd:e,editHelpers:O,hasText:b.label.text||b.label.texttemplate,isActiveShape:!0},j=o(M,e);s(j,F,B)}else e._context.edits.shapePosition?function(e,t,o,s,c,u){var f,v,_,b,w,A,M,S,E,C,I,L,P,z,D,O,R="pixel"===o.xsizemode,F="pixel"===o.ysizemode,B="line"===o.type,j="path"===o.type,N=u.modifyItem,U=r.select(t.node().parentNode),V=a.getFromId(e,o.xref),q=a.getRefType(o.xref),H=a.getFromId(e,o.yref),G=a.getRefType(o.yref),W=o.x0shift,Z=o.x1shift,Y=o.y0shift,X=o.y1shift,$=function(t,r){return g.getDataToPixel(e,V,r,!1,q)(t)},K=function(t,r){return g.getDataToPixel(e,H,r,!0,G)(t)},J=g.getPixelToData(e,V,!1,q),Q=g.getPixelToData(e,H,!0,G),ee=B?function(){var e=10,r=Math.max(o.line.width,e),n=c.append("g").attr("data-index",s).attr("drag-helper",!0);n.append("path").attr("d",t.attr("d")).style({cursor:"move","stroke-width":r,"stroke-opacity":"0"});var i={"fill-opacity":"0"},a=Math.max(r/2,e);return n.append("circle").attr({"data-line-point":"start-point",cx:R?$(o.xanchor)+o.x0:$(o.x0,W),cy:F?K(o.yanchor)-o.y0:K(o.y0,Y),r:a}).style(i).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:R?$(o.xanchor)+o.x1:$(o.x1,Z),cy:F?K(o.yanchor)-o.y1:K(o.y1,X),r:a}).style(i).classed("cursor-grab",!0),n}():t,te={element:ee.node(),gd:e,prepFn:function(r){x(e)||(R&&(w=$(o.xanchor)),F&&(A=K(o.yanchor)),"path"===o.type?D=o.path:(f=R?o.x0:$(o.x0),v=F?o.y0:K(o.y0),_=R?o.x1:$(o.x1),b=F?o.y1:K(o.y1)),f<_?(E=f,P="x0",C=_,z="x1"):(E=_,P="x1",C=f,z="x0"),!F&&v<b||F&&v>b?(M=v,I="y0",S=b,L="y1"):(M=b,I="y1",S=v,L="y0"),re(r),ae(c,o),function(e,t,r){var n=t.xref,i=t.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"!==n&&!o.autorange&&(l+=n),"paper"!==i&&!s.autorange&&(l+=i),h.setClipUrl(e,l?"clip"+r._fullLayout._uid+l:null,r)}(t,o,e),te.moveFn="move"===O?ne:ie,te.altKey=r.altKey)},doneFn:function(){x(e)||(d(t),oe(c),T(t,e,o),n.call("_guiRelayout",e,u.getUpdateObj()))},clickFn:function(){x(e)||oe(c)}};function re(r){if(x(e))O=null;else if(B)O="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=te.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!j&&i>10&&a>10&&!r.shiftKey?p.getCursor(o/i,1-s/a):"move";d(t,l),O=l.split("-")[0]}}function ne(r,n){if("path"===o.type){var i=function(e){return e},a=i,u=i;R?N("xanchor",o.xanchor=J(w+r)):(a=function(e){return J($(e)+r)},V&&"date"===V.type&&(a=g.encodeDate(a))),F?N("yanchor",o.yanchor=Q(A+n)):(u=function(e){return Q(K(e)+n)},H&&"date"===H.type&&(u=g.encodeDate(u))),N("path",o.path=k(D,a,u))}else R?N("xanchor",o.xanchor=J(w+r)):(N("x0",o.x0=J(f+r)),N("x1",o.x1=J(_+r))),F?N("yanchor",o.yanchor=Q(A+n)):(N("y0",o.y0=Q(v+n)),N("y1",o.y1=Q(b+n)));t.attr("d",y(e,o)),ae(c,o),l(e,s,o,U)}function ie(r,n){if(j){var i=function(e){return e},a=i,u=i;R?N("xanchor",o.xanchor=J(w+r)):(a=function(e){return J($(e)+r)},V&&"date"===V.type&&(a=g.encodeDate(a))),F?N("yanchor",o.yanchor=Q(A+n)):(u=function(e){return Q(K(e)+n)},H&&"date"===H.type&&(u=g.encodeDate(u))),N("path",o.path=k(D,a,u))}else if(B){if("resize-over-start-point"===O){var h=f+r,p=F?v-n:v+n;N("x0",o.x0=R?h:J(h)),N("y0",o.y0=F?p:Q(p))}else if("resize-over-end-point"===O){var d=_+r,m=F?b-n:b+n;N("x1",o.x1=R?d:J(d)),N("y1",o.y1=F?m:Q(m))}}else{var x=function(e){return-1!==O.indexOf(e)},T=x("n"),q=x("s"),G=x("w"),W=x("e"),Z=T?M+n:M,Y=q?S+n:S,X=G?E+r:E,ee=W?C+r:C;F&&(T&&(Z=M-n),q&&(Y=S-n)),(!F&&Y-Z>10||F&&Z-Y>10)&&(N(I,o[I]=F?Z:Q(Z)),N(L,o[L]=F?Y:Q(Y))),ee-X>10&&(N(P,o[P]=R?X:J(X)),N(z,o[z]=R?ee:J(ee)))}t.attr("d",y(e,o)),ae(c,o),l(e,s,o,U)}function ae(e,t){(R||F)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=$(R?t.xanchor:i.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,m.paramIsX))),o=K(F?t.yanchor:i.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,m.paramIsY)));if(a=g.roundPositionForSharpStrokeRendering(a,1),o=g.roundPositionForSharpStrokeRendering(o,1),R&&F){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(R){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function oe(e){e.selectAll(".visual-cue").remove()}p.init(te),ee.node().onmousemove=re}(e,F,b,t,c,O):!0===b.editable&&F.style("pointer-events",z||u.opacity(C)*E<=.5?"stroke":"all");F.node().addEventListener("click",(function(){return function(e,t){if(_(e)){var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void A(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=A,v(e)}}}(e,F)}))}"above"===b.layer?S(e._fullLayout._shapeUpperLayer):b.xref.includes("paper")||b.yref.includes("paper")?S(e._fullLayout._shapeLowerLayer):"between"!==b.layer||M?w._hadPlotinfo?S((w.mainplotinfo||w).shapelayer):S(e._fullLayout._shapeLowerLayer):S(w.shapelayerBetween)}function T(e,t,r){let n=r.xref,o=r.yref;if(Array.isArray(n)||Array.isArray(o)){let s="clip"+t._fullLayout._uid+"shape"+r._index,l=function(e,t,r){let n=e._fullLayout._size;function i(t,r){let i=(Array.isArray(t)?t:[t]).map((t=>a.getFromId(e,t))).filter(Boolean);if(!i.length)return r?[n.t,n.t+n.h]:[n.l,n.l+n.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(r,!0);return{x:o[0],y:s[0],width:o[1]-o[0],height:s[1]-s[0]}}(t,n,o);i.ensureSingleById(t._fullLayout._clips,"clipPath",s,(function(e){e.append("rect")})).select("rect").attr(l),h.setClipUrl(e,s,t)}else{let r=(n+o).replace(/paper/g,"").replace(/[xyz][0-9]* *domain/g,"");h.setClipUrl(e,r?"clip"+t._fullLayout._uid+r:null,t)}}function k(e,t,r){return e.replace(m.segmentRE,(function(e){var n=0,i=e.charAt(0),a=m.paramIsX[i],o=m.paramIsY[i],s=m.numParams[i];return i+e.slice(1).replace(m.paramRE,(function(e){return n>=s||(a[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function A(e){_(e)&&e._fullLayout._activeShapeIndex>=0&&(c(e),delete e._fullLayout._activeShapeIndex,v(e))}t.exports={draw:v,drawOne:w,eraseActiveShape:function(e){if(_(e)){c(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t<r.length){for(var i=[],a=0;a<r.length;a++)a!==t&&i.push(r[a]);return delete e._fullLayout._activeShapeIndex,n.call("_guiRelayout",e,{shapes:i})}}},drawLabel:l}}}),Xr=m({"src/components/modebar/buttons.js"(e,t){var r=He(),n=At(),i=_t(),a=Br(),o=Yr().eraseActiveShape,s=ct(),l=s._,c=t.exports={};function u(e,t){var n,a,o=t.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},h=i.list(e,null,!0),f=c._cartesianSpikesEnabled;if("zoom"===s){var p,d="in"===l?.5:2,m=(1+d)/2,g=(1-d)/2;for(a=0;a<h.length;a++)if(("none"===(n=h[a]).modebardisable||-1===n.modebardisable.indexOf("auto"===l||"reset"===l?"autoscale":"zoominout"))&&!n.fixedrange)if(p=n._name,"auto"===l)u[p+".autorange"]=!0;else if("reset"===l)void 0===n._rangeInitial0&&void 0===n._rangeInitial1?u[p+".autorange"]=!0:void 0===n._rangeInitial0?(u[p+".autorange"]=n._autorangeInitial,u[p+".range"]=[null,n._rangeInitial1]):void 0===n._rangeInitial1?(u[p+".range"]=[n._rangeInitial0,null],u[p+".autorange"]=n._autorangeInitial):u[p+".range"]=[n._rangeInitial0,n._rangeInitial1],void 0!==n._showSpikeInitial&&(u[p+".showspikes"]=n._showSpikeInitial,"on"===f&&!n._showSpikeInitial&&(f="off"));else{var y=[n.r2l(n.range[0]),n.r2l(n.range[1])],v=[m*y[0]+g*y[1],m*y[1]+g*y[0]];u[p+".range[0]"]=n.l2r(v[0]),u[p+".range[1]"]=n.l2r(v[1])}}else"hovermode"===s&&("x"===l||"y"===l)&&(l=c._isHoriz?"y":"x",o.setAttribute("data-val",l)),u[s]=l;c._cartesianSpikesEnabled=f,r.call("_guiRelayout",e,u)}function h(e,t){for(var n=t.currentTarget,i=n.getAttribute("data-attr"),a=n.getAttribute("data-val")||!0,o=e._fullLayout._subplots.gl3d||[],s={},l=i.split("."),c=0;c<o.length;c++)s[o[c]+"."+l[1]]=a;var u="pan"===a?a:"zoom";s.dragmode=u,r.call("_guiRelayout",e,s)}function f(e,t){for(var n=t.currentTarget.getAttribute("data-attr"),i="resetLastSave"===n,a="resetDefault"===n,o=e._fullLayout,s=o._subplots.gl3d||[],l={},c=0;c<s.length;c++){var u,h=s[c],f=h+".camera",p=h+".aspectratio",d=h+".aspectmode",m=o[h]._scene;i?(l[f+".up"]=m.viewInitial.up,l[f+".eye"]=m.viewInitial.eye,l[f+".center"]=m.viewInitial.center,u=!0):a&&(l[f+".up"]=null,l[f+".eye"]=null,l[f+".center"]=null,u=!0),u&&(l[p+".x"]=m.viewInitial.aspectratio.x,l[p+".y"]=m.viewInitial.aspectratio.y,l[p+".z"]=m.viewInitial.aspectratio.z,l[d]=m.viewInitial.aspectmode)}r.call("_guiRelayout",e,l)}function p(e,t){var r=t.currentTarget,n=r._previousVal,i=e._fullLayout,a=i._subplots.gl3d||[],o=["xaxis","yaxis","zaxis"],s={},l={};if(n)l=n,r._previousVal=null;else{for(var c=0;c<a.length;c++){var u=a[c],h=i[u],f=u+".hovermode";s[f]=h.hovermode,l[f]=!1;for(var p=0;p<3;p++){var d=o[p],m=u+"."+d+".showspikes";l[m]=!1,s[m]=h[d].showspikes}}r._previousVal=s}return l}function d(e,t){for(var n=t.currentTarget,i=n.getAttribute("data-attr"),a=n.getAttribute("data-val")||!0,o=e._fullLayout,s=o._subplots.geo||[],l=0;l<s.length;l++){var c=s[l],u=o[c];if("zoom"===i){var h=u.projection.scale,f="in"===a?2*h:.5*h;r.call("_guiRelayout",e,c+".projection.scale",f)}}"reset"===i&&_(e,"geo")}function m(e){var t=e._fullLayout;return!t.hovermode&&(t._has("cartesian")?t._isHoriz?"y":"x":"closest")}function g(e){var t=m(e);r.call("_guiRelayout",e,"hovermode",t)}function y(e,t){x(e,t,"mapbox")}function v(e,t){x(e,t,"map")}function x(e,t,n){for(var i=t.currentTarget.getAttribute("data-val"),a=e._fullLayout,o=a._subplots[n]||[],s={},l=0;l<o.length;l++){var c=o[l],u=a[c].zoom,h="in"===i?1.05*u:u/1.05;s[c+".zoom"]=h}r.call("_guiRelayout",e,s)}function _(e,t){for(var n=e._fullLayout,i=n._subplots[t]||[],a={},o=0;o<i.length;o++)for(var s=i[o],l=n[s]._subplot.viewInitial,c=Object.keys(l),u=0;u<c.length;u++){var h=c[u];a[s+"."+h]=l[h]}r.call("_guiRelayout",e,a)}c.toImage={name:"toImage",title:function(e){var t=(e._context.toImageButtonOptions||{}).format||"png";return l(e,"png"===t?"Download plot as a PNG":"Download plot")},icon:a.camera,click:function(e){var t=e._context.toImageButtonOptions,n={format:t.format||"png"};s.notifier(l(e,"Taking snapshot - this may take a few seconds"),"long",e),["filename","width","height","scale"].forEach((function(e){e in t&&(n[e]=t[e])})),r.call("downloadImage",e,n).then((function(t){s.notifier(l(e,"Snapshot succeeded")+" - "+t,"long",e)})).catch((function(){s.notifier(l(e,"Sorry, there was a problem downloading your snapshot!"),"long",e)}))}},c.sendDataToCloud={name:"sendDataToCloud",title:function(e){return l(e,"Edit in Chart Studio")},icon:a.disk,click:function(e){n.sendDataToCloud(e)}},c.editInChartStudio={name:"editInChartStudio",title:function(e){return l(e,"Edit in Chart Studio")},icon:a.pencil,click:function(e){n.sendDataToCloud(e)}},c.zoom2d={name:"zoom2d",_cat:"zoom",title:function(e){return l(e,"Zoom")},attr:"dragmode",val:"zoom",icon:a.zoombox,click:u},c.pan2d={name:"pan2d",_cat:"pan",title:function(e){return l(e,"Pan")},attr:"dragmode",val:"pan",icon:a.pan,click:u},c.select2d={name:"select2d",_cat:"select",title:function(e){return l(e,"Box Select")},attr:"dragmode",val:"select",icon:a.selectbox,click:u},c.lasso2d={name:"lasso2d",_cat:"lasso",title:function(e){return l(e,"Lasso Select")},attr:"dragmode",val:"lasso",icon:a.lasso,click:u},c.drawclosedpath={name:"drawclosedpath",title:function(e){return l(e,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:a.drawclosedpath,click:u},c.drawopenpath={name:"drawopenpath",title:function(e){return l(e,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:a.drawopenpath,click:u},c.drawline={name:"drawline",title:function(e){return l(e,"Draw line")},attr:"dragmode",val:"drawline",icon:a.drawline,click:u},c.drawrect={name:"drawrect",title:function(e){return l(e,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:a.drawrect,click:u},c.drawcircle={name:"drawcircle",title:function(e){return l(e,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:a.drawcircle,click:u},c.eraseshape={name:"eraseshape",title:function(e){return l(e,"Erase active shape")},icon:a.eraseshape,click:o},c.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(e){return l(e,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:u},c.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(e){return l(e,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:u},c.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(e){return l(e,"Autoscale")},attr:"zoom",val:"auto",icon:a.autoscale,click:u},c.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(e){return l(e,"Reset axes")},attr:"zoom",val:"reset",icon:a.home,click:u},c.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(e){return l(e,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:a.tooltip_basic,gravity:"ne",click:u},c.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(e){return l(e,"Compare data on hover")},attr:"hovermode",val:function(e){return e._fullLayout._isHoriz?"y":"x"},icon:a.tooltip_compare,gravity:"ne",click:u},c.zoom3d={name:"zoom3d",_cat:"zoom",title:function(e){return l(e,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:a.zoombox,click:h},c.pan3d={name:"pan3d",_cat:"pan",title:function(e){return l(e,"Pan")},attr:"scene.dragmode",val:"pan",icon:a.pan,click:h},c.orbitRotation={name:"orbitRotation",title:function(e){return l(e,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:a["3d_rotate"],click:h},c.tableRotation={name:"tableRotation",title:function(e){return l(e,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:a["z-axis"],click:h},c.resetCameraDefault3d={name:"resetCameraDefault3d",_cat:"resetCameraDefault",title:function(e){return l(e,"Reset camera to default")},attr:"resetDefault",icon:a.home,click:f},c.resetCameraLastSave3d={name:"resetCameraLastSave3d",_cat:"resetCameraLastSave",title:function(e){return l(e,"Reset camera to last save")},attr:"resetLastSave",icon:a.movie,click:f},c.hoverClosest3d={name:"hoverClosest3d",_cat:"hoverclosest",title:function(e){return l(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:a.tooltip_basic,gravity:"ne",click:function(e,t){var n=p(e,t);r.call("_guiRelayout",e,n)}},c.zoomInGeo={name:"zoomInGeo",_cat:"zoomin",title:function(e){return l(e,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:d},c.zoomOutGeo={name:"zoomOutGeo",_cat:"zoomout",title:function(e){return l(e,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:d},c.resetGeo={name:"resetGeo",_cat:"reset",title:function(e){return l(e,"Reset")},attr:"reset",val:null,icon:a.autoscale,click:d},c.hoverClosestGeo={name:"hoverClosestGeo",_cat:"hoverclosest",title:function(e){return l(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:a.tooltip_basic,gravity:"ne",click:g},c.hoverClosestPie={name:"hoverClosestPie",_cat:"hoverclosest",title:function(e){return l(e,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:a.tooltip_basic,gravity:"ne",click:g},c.resetViewSankey={name:"resetSankeyGroup",title:function(e){return l(e,"Reset view")},icon:a.home,click:function(e){for(var t={"node.groups":[],"node.x":[],"node.y":[]},n=0;n<e._fullData.length;n++){var i=e._fullData[n]._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())}r.call("restyle",e,t)}},c.toggleHover={name:"toggleHover",title:function(e){return l(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:a.tooltip_basic,gravity:"ne",click:function(e,t){var n=p(e,t);n.hovermode=m(e),r.call("_guiRelayout",e,n)}},c.resetViews={name:"resetViews",title:function(e){return l(e,"Reset views")},icon:a.home,click:function(e,t){var r=t.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),u(e,t),r.setAttribute("data-attr","resetLastSave"),f(e,t),_(e,"geo"),_(e,"mapbox"),_(e,"map")}},c.toggleSpikelines={name:"toggleSpikelines",title:function(e){return l(e,"Toggle Spike Lines")},icon:a.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(e){var t=e._fullLayout,n=t._cartesianSpikesEnabled;t._cartesianSpikesEnabled="on"===n?"off":"on",r.call("_guiRelayout",e,function(e){for(var t="on"===e._fullLayout._cartesianSpikesEnabled,r=i.list(e,null,!0),n={},a=0;a<r.length;a++){var o=r[a];n[o._name+".showspikes"]=!!t||o._showSpikeInitial}return n}(e))}},c.resetViewMapbox={name:"resetViewMapbox",_cat:"resetView",title:function(e){return l(e,"Reset view")},attr:"reset",icon:a.home,click:function(e){_(e,"mapbox")}},c.resetViewMap={name:"resetViewMap",_cat:"resetView",title:function(e){return l(e,"Reset view")},attr:"reset",icon:a.home,click:function(e){_(e,"map")}},c.zoomInMapbox={name:"zoomInMapbox",_cat:"zoomin",title:function(e){return l(e,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:y},c.zoomInMap={name:"zoomInMap",_cat:"zoomin",title:function(e){return l(e,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:v},c.zoomOutMapbox={name:"zoomOutMapbox",_cat:"zoomout",title:function(e){return l(e,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:y},c.zoomOutMap={name:"zoomOutMap",_cat:"zoomout",title:function(e){return l(e,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:v}}}),$r=m({"src/components/modebar/constants.js"(e,t){var r=Xr(),n=Object.keys(r),i=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],a=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(i),o=[];n.forEach((function(e){!function(e){if(-1===a.indexOf(e._cat||e.name)){var t=e.name,r=(e._cat||e.name).toLowerCase();-1===o.indexOf(t)&&o.push(t),-1===o.indexOf(r)&&o.push(r)}}(r[e])})),o.sort(),t.exports={DRAW_MODES:i,backButtons:a,foreButtons:o}}}),Kr=m({"src/components/modebar/attributes.js"(e,t){$r(),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"}}}}),Jr=m({"src/components/modebar/defaults.js"(e,t){var r=ct(),n=W(),i=vt(),a=Kr();t.exports=function(e,t){var o=e.modebar||{},s=i.newContainer(t,"modebar");function l(e,t){return r.coerce(o,s,a,e,t)}l("orientation"),l("bgcolor",n.addOpacity(t.paper_bgcolor,.5));var c=n.contrast(n.rgb(t.modebar.bgcolor));l("color",n.addOpacity(c,.3)),l("activecolor",n.addOpacity(c,.7)),l("uirevision",t.uirevision),l("add"),l("remove")}}}),Qr=m({"src/components/modebar/modebar.js"(e,t){var r=b(),n=M(),i=ct(),a=Br(),o=x().version,s=new DOMParser;function l(e){this.container=e.container,this.element=document.createElement("div"),this.update(e.graphInfo,e.buttons),this.container.appendChild(this.element)}var c=l.prototype;c.update=function(e,t){this.graphInfo=e;var r=this.graphInfo._context,n=this.graphInfo._fullLayout,a="modebar-"+n._uid;this.element.setAttribute("id",a),this.element.setAttribute("role","toolbar"),this._uid=a,this.element.className="modebar modebar--custom","hover"===r.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===n.modebar.orientation&&(this.element.className+=" vertical",t=t.reverse());var o=n.modebar,s="#"+a+" .modebar-group";document.querySelectorAll(s).forEach((function(e){e.style.backgroundColor=o.bgcolor}));var l=!this.hasButtons(t),c=this.hasLogo!==r.displaylogo,u=this.locale!==r.locale;if(this.locale=r.locale,(l||c||u)&&(this.removeAllButtons(),this.updateButtons(t),r.watermark||r.displaylogo)){var h=this.getLogo();r.watermark&&(h.className=h.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(h,this.element.childNodes[0]):this.element.appendChild(h),this.hasLogo=!0}this.updateActiveButton(),i.setStyleOnHover("#"+a+" .modebar-btn",".active",".icon path","fill: "+o.activecolor,"fill: "+o.color,this.element)},c.updateButtons=function(e){var t=this;this.buttons=e,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach((function(e){var r=t.createGroup();e.forEach((function(e){var n=e.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==t.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");t.buttonsNames.push(n);var i=t.createButton(e);t.buttonElements.push(i),r.appendChild(i)})),t.element.appendChild(r)}))},c.createGroup=function(){var e=document.createElement("div");e.className="modebar-group";var t=this.graphInfo._fullLayout.modebar;return e.style.backgroundColor=t.bgcolor,e},c.createButton=function(e){var t=this,n=document.createElement("button");n.setAttribute("type","button"),n.setAttribute("rel","tooltip"),n.className="modebar-btn";var i=e.title;void 0===i?i=e.name:"function"==typeof i&&(i=i(this.graphInfo)),(i||0===i)&&(n.setAttribute("data-title",i),n.setAttribute("aria-label",i)),void 0!==e.attr&&n.setAttribute("data-attr",e.attr);var o=e.val;if(void 0!==o&&("function"==typeof o&&(o=o(this.graphInfo)),n.setAttribute("data-val",o)),"function"!=typeof e.click)throw new Error("must provide button 'click' function in button config");n.addEventListener("click",(function(r){e.click(t.graphInfo,r),t.updateActiveButton(r.currentTarget)})),n.setAttribute("data-toggle",e.toggle||!1),e.toggle&&r.select(n).classed("active",!0);var s=e.icon;return"function"==typeof s?n.appendChild(s()):n.appendChild(this.createIcon(s||a.question)),n.setAttribute("data-gravity",e.gravity||"n"),n},c.createIcon=function(e){var t,r=n(e.height)?Number(e.height):e.ascent-e.descent,i="http://www.w3.org/2000/svg";if(e.path){(t=document.createElementNS(i,"svg")).setAttribute("viewBox",[0,0,e.width,r].join(" ")),t.setAttribute("class","icon");var a=document.createElementNS(i,"path");a.setAttribute("d",e.path),e.transform?a.setAttribute("transform",e.transform):void 0!==e.ascent&&a.setAttribute("transform","matrix(1 0 0 -1 0 "+e.ascent+")"),t.appendChild(a)}return e.svg&&(t=s.parseFromString(e.svg,"application/xml").childNodes[0]),t.setAttribute("height","1em"),t.setAttribute("width","1em"),t},c.updateActiveButton=function(e){var t=this.graphInfo._fullLayout,n=void 0!==e?e.getAttribute("data-attr"):null;this.buttonElements.forEach((function(e){var a=e.getAttribute("data-val")||!0,o=e.getAttribute("data-attr"),s="true"===e.getAttribute("data-toggle"),l=r.select(e),c=function(e,r){var n=t.modebar,i=e.querySelector(".icon path");i&&(r||e.matches(":hover")?i.style.fill=n.activecolor:i.style.fill=n.color)};if(s){if(o===n){var u=!l.classed("active");l.classed("active",u),c(e,u)}}else{var h=null===o?o:i.nestedProperty(t,o).get();l.classed("active",h===a),c(e,h===a)}}))},c.hasButtons=function(e){var t=this.buttons;if(!t||e.length!==t.length)return!1;for(var r=0;r<e.length;++r){if(e[r].length!==t[r].length)return!1;for(var n=0;n<e[r].length;n++)if(e[r][n].name!==t[r][n].name)return!1}return!0},c.getLogo=function(){var e=this.createGroup(),t=document.createElement("a");return t.href="https://plotly.com/",t.target="_blank",t.setAttribute("data-title",function(e){return e+" (v"+o+")"}(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},c.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},c.destroy=function(){i.removeElement(this.container.querySelector(".modebar"))},t.exports=function(e,t){var n=e._fullLayout,i=new l({graphInfo:e,container:n._modebardiv.node(),buttons:t});return n._privateplot&&r.select(i.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),i}}}),en=m({"src/components/modebar/manage.js"(e,t){var r=_t(),n=Xt(),i=He(),a=Kt().isUnifiedHover,o=Qr(),s=Xr(),l=$r().DRAW_MODES,c=ct().extendDeep;t.exports=function(e){var t=e._fullLayout,u=e._context,h=t._modeBar;if(u.displayModeBar||u.watermark){if(!Array.isArray(u.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(u.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var f,p=u.modeBarButtons;f=Array.isArray(p)&&p.length?function(e){for(var t=c([],e),r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;i++){var a=n[i];if("string"==typeof a){if(void 0===s[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[r][i]=s[a]}}return t}(p):!u.displayModeBar&&u.watermark?[]:function(e){var t=e._fullLayout,o=e._fullData,c=e._context;function u(e,t){if("string"==typeof t){if(t.toLowerCase()===e.toLowerCase())return!0}else{var r=t.name,n=t._cat||t.name;if(r===e||n===e.toLowerCase())return!0}return!1}var h=t.modebar.add;"string"==typeof h&&(h=[h]);var f=t.modebar.remove;"string"==typeof f&&(f=[f]);var p=c.modeBarButtonsToAdd.concat(h.filter((function(e){for(var t=0;t<c.modeBarButtonsToRemove.length;t++)if(u(e,c.modeBarButtonsToRemove[t]))return!1;return!0}))),d=c.modeBarButtonsToRemove.concat(f.filter((function(e){for(var t=0;t<c.modeBarButtonsToAdd.length;t++)if(u(e,c.modeBarButtonsToAdd[t]))return!1;return!0}))),m=t._has("cartesian"),g=t._has("gl3d"),y=t._has("geo"),v=t._has("pie"),x=t._has("funnelarea"),_=t._has("ternary"),b=t._has("mapbox"),w=t._has("map"),T=t._has("polar"),k=t._has("smith"),A=t._has("sankey"),M=function(e){for(var t=r.list({_fullLayout:e},null,!0),n=0;n<t.length;n++){var i=t[n].modebardisable;if(!t[n].fixedrange&&"autoscale+zoominout"!==i&&"zoominout+autoscale"!==i)return!1}return!0}(t),S=a(t.hovermode),E=[];function C(e){if(e.length){for(var t=[],r=0;r<e.length;r++){for(var n=e[r],i=s[n],a=i.name.toLowerCase(),o=(i._cat||i.name).toLowerCase(),l=!1,c=0;c<d.length;c++){var u=d[c].toLowerCase();if(u===a||u===o){l=!0;break}}l||t.push(s[n])}E.push(t)}}var I=["toImage"];c.showEditInChartStudio?I.push("editInChartStudio"):c.showSendToCloud&&I.push("sendDataToCloud"),C(I);var L=[],P=[],z=[],D=[];(m||v||x||_)+y+g+b+w+T+k>1?(P=["toggleHover"],z=["resetViews"]):y?(L=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],z=["resetGeo"]):g?(P=["hoverClosest3d"],z=["resetCameraDefault3d","resetCameraLastSave3d"]):b?(L=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],z=["resetViewMapbox"]):w?(L=["zoomInMap","zoomOutMap"],P=["toggleHover"],z=["resetViewMap"]):v?P=["hoverClosestPie"]:A?(P=["hoverClosestCartesian","hoverCompareCartesian"],z=["resetViewSankey"]):P=["toggleHover"],m&&P.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(e){for(var t=0;t<e.length;t++)if(!i.traceIs(e[t],"noHover"))return!1;return!0}(o)||S)&&(P=[]),m&&!M&&(L=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==z[0]&&(z=["resetScale2d"])),g?D=["zoom3d","pan3d","orbitRotation","tableRotation"]:m&&!M||_?D=["zoom2d","pan2d"]:b||w||y?D=["pan2d"]:T&&(D=["zoom2d"]),function(e){for(var t=!1,r=0;r<e.length&&!t;r++){var a=e[r];!a._module||!a._module.selectPoints||(i.traceIs(a,"scatter-like")?(n.hasMarkers(a)||n.hasText(a))&&(t=!0):i.traceIs(a,"box-violin")?("all"===a.boxpoints||"all"===a.points)&&(t=!0):t=!0)}return t}(o)&&D.push("select2d","lasso2d");var O=[],R=function(e){-1===O.indexOf(e)&&-1!==P.indexOf(e)&&O.push(e)};if(Array.isArray(p)){for(var F=[],B=0;B<p.length;B++){var j=p[B];"string"==typeof j?(j=j.toLowerCase(),-1!==l.indexOf(j)?(t._has("mapbox")||t._has("map")||t._has("cartesian"))&&D.push(j):"togglespikelines"===j?R("toggleSpikelines"):"togglehover"===j?R("toggleHover"):"hovercompare"===j?R("hoverCompareCartesian"):"hoverclosest"===j?(R("hoverClosestCartesian"),R("hoverClosestGeo"),R("hoverClosest3d"),R("hoverClosestPie")):"v1hovermode"===j&&(R("hoverClosestCartesian"),R("hoverCompareCartesian"),R("hoverClosestGeo"),R("hoverClosest3d"),R("hoverClosestPie"))):F.push(j)}p=F}return C(D),C(L.concat(z)),C(O),function(e,t){if(t.length)if(Array.isArray(t[0]))for(var r=0;r<t.length;r++)e.push(t[r]);else e.push(t);return e}(E,p)}(e),h?h.update(e,f):t._modeBar=o(e,f)}else h&&(h.destroy(),delete t._modeBar)}}}),tn=m({"src/components/modebar/index.js"(e,t){t.exports={moduleType:"component",name:"modebar",layoutAttributes:Kr(),supplyLayoutDefaults:Jr(),manage:en()}}}),rn=m({"src/plots/cartesian/scale_zoom.js"(e,t){var r=St().FROM_BL;t.exports=function(e,t,n){void 0===n&&(n=r[e.constraintoward||"center"]);var i=[e.r2l(e.range[0]),e.r2l(e.range[1])],a=i[0]+(i[1]-i[0])*n;e.range=e._input.range=[e.l2r(a+(i[0]-a)*t),e.l2r(a+(i[1]-a)*t)],e.setScale()}}}),nn=m({"src/plots/cartesian/constraints.js"(e){var t=ct(),r=ir(),n=_t().id2name,i=Lt(),a=rn(),o=rr(),s=S().ALMOST_EQUAL,l=St().FROM_BL;function c(e,r,a){var o=a.axIds,s=a.layoutOut,l=a.hasImage,c=s._axisConstraintGroups,p=s._axisMatchGroups,d=r._id,m=d.charAt(0),g=((s._splomAxes||{})[m]||{})[d]||{},y=r._id,v="x"===y.charAt(0);function x(n,a){return t.coerce(e,r,i,n,a)}r._matchGroup=null,r._constraintGroup=null,x("constrain",l?"domain":"range"),t.coerce(e,r,{constraintoward:{valType:"enumerated",values:v?["left","center","right"]:["bottom","middle","top"],dflt:v?"center":"middle"}},"constraintoward");var _,b,w=r.type,T=[];for(_=0;_<o.length;_++)(b=o[_])!==y&&s[n(b)].type===w&&T.push(b);var k=h(c,y);if(k){var A=[];for(_=0;_<T.length;_++)k[b=T[_]]||A.push(b);T=A}var M,S,E=T.length;E&&(e.matches||g.matches)&&(M=t.coerce(e,r,{matches:{valType:"enumerated",values:T,dflt:-1!==T.indexOf(g.matches)?g.matches:void 0}},"matches"));var C=l&&!v?r.anchor:void 0;if(E&&!M&&(e.scaleanchor||C)&&(S=t.coerce(e,r,{scaleanchor:{valType:"enumerated",values:T.concat([!1])}},"scaleanchor",C)),M){r._matchGroup=f(p,y,M,1);var I=s[n(M)],L=u(s,r)/u(s,I);v!==("x"===M.charAt(0))&&(L=(v?"x":"y")+L),f(c,y,M,L)}else e.matches&&-1!==o.indexOf(e.matches)&&t.warn("ignored "+r._name+'.matches: "'+e.matches+'" to avoid an infinite loop');if(S){var P=x("scaleratio");P||(P=r.scaleratio=1),f(c,y,S,P)}else e.scaleanchor&&-1!==o.indexOf(e.scaleanchor)&&t.warn("ignored "+r._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 r=t.domain;return r||(r=e[n(t.overlaying)].domain),r[1]-r[0]}function h(e,t){for(var r=0;r<e.length;r++)if(e[r][t])return e[r];return null}function f(e,t,r,n){var i,a,o,s,l,c=h(e,t);null===c?((c={})[t]=1,l=e.length,e.push(c)):l=e.indexOf(c);var u=Object.keys(c);for(i=0;i<e.length;i++)if(o=e[i],i!==l&&o[r]){var f=o[r];for(a=0;a<u.length;a++)o[s=u[a]]=p(f,p(n,c[s]));return void e.splice(l,1)}if(1!==n)for(a=0;a<u.length;a++){var d=u[a];c[d]=p(n,c[d])}c[r]=1}function p(e,t){var r,n,i="",a="";"string"==typeof e&&(r=(i=e.match(/^[xy]*/)[0]).length,e=+e.slice(r)),"string"==typeof t&&(n=(a=t.match(/^[xy]*/)[0]).length,t=+t.slice(n));var o=e*t;return r||n?r&&n&&i.charAt(0)!==a.charAt(0)?r===n?o:(r>n?i.slice(n):a.slice(r))+o:i+a+e*t:o}function d(e,t){for(var r=t._size,n=r.h/r.w,i={},a=Object.keys(e),o=0;o<a.length;o++){var s=a[o],l=e[s];if("string"==typeof l){var c=l.match(/^[xy]*/)[0],u=c.length;l=+l.slice(u);for(var h="y"===c.charAt(0)?n:1/n,f=0;f<u;f++)l*=h}i[s]=l}return i}function m(e,t){var r=e._inputDomain,n=l[e.constraintoward],i=r[0]+(r[1]-r[0])*n;e.domain=e._input.domain=[i+(r[0]-i)/t,i+(r[1]-i)/t],e.setScale()}e.handleDefaults=function(e,r,i){var a,s,l,u,h,f,p,d,m=i.axIds,g=i.axHasImage,y=r._axisConstraintGroups=[],v=r._axisMatchGroups=[];for(a=0;a<m.length;a++)c(h=e[u=n(m[a])],f=r[u],{axIds:m,layoutOut:r,hasImage:g[u]});function x(e,t){for(a=0;a<e.length;a++)for(l in s=e[a])r[n(l)][t]=s}for(x(v,"_matchGroup"),a=0;a<y.length;a++)for(l in s=y[a])if((f=r[n(l)]).fixedrange){for(var _ in s){var b=n(_);!1===(e[b]||{}).fixedrange&&t.warn("fixedrange was specified as false for axis "+b+" but was overridden because another axis in its constraint group has fixedrange true"),r[b].fixedrange=!0}break}for(a=0;a<y.length;){for(l in s=y[a]){(f=r[n(l)])._matchGroup&&Object.keys(f._matchGroup).length===Object.keys(s).length&&(y.splice(a,1),a--);break}a++}x(y,"_constraintGroup");var w=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],T=!1,k=!1;function A(){d=f[p],"rangebreaks"===p&&(k=f._hasDayOfWeekBreaks)}for(a=0;a<v.length;a++){s=v[a];for(var M=0;M<w.length;M++){var S;for(l in p=w[M],d=null,s)if(h=e[u=n(l)],f=r[u],p in f){if(!f.matches&&(S=f,p in h)){A();break}null===d&&p in h&&A()}if("range"===p&&d&&h.range&&2===h.range.length&&null!==h.range[0]&&null!==h.range[1]&&(T=!0),"autorange"===p&&null===d&&T&&(d=!1),null===d&&p in S&&(d=S[p]),null!==d)for(l in s)(f=r[n(l)])[p]="range"===p?d.slice():d,"rangebreaks"===p&&(f._hasDayOfWeekBreaks=k,o(f,r))}}},e.enforce=function(e){var t,i,o,l,c,u,h,f,p=e._fullLayout,g=p._axisConstraintGroups||[];for(t=0;t<g.length;t++){o=d(g[t],p);var y=Object.keys(o),v=1/0,x=0,_=1/0,b={},w={},T=!1;for(i=0;i<y.length;i++)w[l=y[i]]=c=p[n(l)],c._inputDomain?c.domain=c._inputDomain.slice():c._inputDomain=c.domain.slice(),c._inputRange||(c._inputRange=c.range.slice()),c.setScale(),b[l]=u=Math.abs(c._m)/o[l],v=Math.min(v,u),("domain"===c.constrain||!c._constraintShrinkable)&&(_=Math.min(_,u)),delete c._constraintShrinkable,x=Math.max(x,u),"domain"===c.constrain&&(T=!0);if(!(v>s*x)||T)for(i=0;i<y.length;i++)if(u=b[l=y[i]],h=(c=w[l]).constrain,u!==_||"domain"===h)if(f=u/_,"range"===h)a(c,f);else{var k=c._inputDomain,A=(c.domain[1]-c.domain[0])/(k[1]-k[0]),M=(c.r2l(c.range[1])-c.r2l(c.range[0]))/(c.r2l(c._inputRange[1])-c.r2l(c._inputRange[0]));if((f/=A)*M<1){c.domain=c._input.domain=k.slice(),a(c,f);continue}if(M<1&&(c.range=c._input.range=c._inputRange.slice(),f*=M),c.autorange){var S=c.r2l(c.range[0]),E=c.r2l(c.range[1]),C=(S+E)/2,I=C,L=C,P=Math.abs(E-C),z=C-P*f*1.0001,D=C+P*f*1.0001,O=r.makePadFn(p,c,0),R=r.makePadFn(p,c,1);m(c,f);var F,B,j=Math.abs(c._m),N=r.concatExtremes(e,c),U=N.min,V=N.max;for(B=0;B<U.length;B++)(F=U[B].val-O(U[B])/j)>z&&F<I&&(I=F);for(B=0;B<V.length;B++)(F=V[B].val+R(V[B])/j)<D&&F>L&&(L=F);f/=(L-I)/(2*P),I=c.l2r(I),L=c.l2r(L),c.range=c._input.range=S<E?[I,L]:[L,I]}m(c,f)}}},e.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n<r.length;n++)if(r[n][t])return"g"+n;return t},e.clean=function(e,t){if(t._inputDomain){for(var r=!1,n=t._id,i=e._fullLayout._axisConstraintGroups,a=0;a<i.length;a++)if(i[a][n]){r=!0;break}(!r||"domain"!==t.constrain)&&(t._input.domain=t.domain=t._inputDomain,delete t._inputDomain)}}}}),an=m({"src/plot_api/subroutines.js"(e){var t=b(),r=He(),n=At(),i=ct(),a=Et(),o=Fr(),s=W(),l=er(),c=tr(),u=tn(),h=ar(),f=St(),p=nn(),d=p.enforce,m=p.clean,g=ir().doAutoRange,y="start",v=xt().zindexSeparator;function x(e,t,r){for(var n=0;n<r.length;n++){var i=r[n][0],a=r[n][1];if(!(i[0]>=e[1]||i[1]<=e[0])&&a[0]<t[1]&&a[1]>t[0])return!0}return!1}function _(r){var a,o,c,p,d,m,g=r._fullLayout,y=g._size,_=y.p,b=h.list(r,"",!0);if(g._paperdiv.style({width:r._context.responsive&&g.autosize&&!r._context._hasZeroWidth&&!r.layout.width?"100%":g.width+"px",height:r._context.responsive&&g.autosize&&!r._context._hasZeroHeight&&!r.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(l.setSize,g.width,g.height),r._context.setBackground(r,g.paper_bgcolor),e.drawMainTitle(r),u.manage(r),!g._has("cartesian"))return n.previousPromises(r);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-_-n:t._offset+t._length+_+n:y.t+y.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+_+n:t._offset-_-n:y.l+y.w*(e.position||0)+n%1}for(a=0;a<b.length;a++){var A=(p=b[a])._anchorAxis;p._linepositions={},p._lw=l.crispRound(r,p.linewidth,1),p._mainLinePosition=T(p,A,p.side),p._mainMirrorPosition=p.mirror&&A?T(p,A,f.OPPOSITE_SIDE[p.side]):null}var M=[],S=[],E=[],C=1===s.opacity(g.paper_bgcolor)&&1===s.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(o in g._plots)if((c=g._plots[o]).mainplot)c.bg&&c.bg.remove(),c.bg=void 0;else{var I=c.xaxis.domain,L=c.yaxis.domain,P=c.plotgroup;if(x(I,L,E)&&-1===o.indexOf(v)){var z=P.node(),D=c.bg=i.ensureSingle(P,"rect","bg");z.insertBefore(D.node(),z.childNodes[0]),S.push(o)}else P.select("rect.bg").remove(),E.push([I,L]),C||(M.push(o),S.push(o))}var O,R,F,B,j,N,U,V,q,H,G,W,Z,Y=g._bgLayer.selectAll(".bg").data(M);for(Y.enter().append("rect").classed("bg",!0),Y.exit().remove(),Y.each((function(e){g._plots[e].bg=t.select(this)})),a=0;a<S.length;a++)c=g._plots[S[a]],d=c.xaxis,m=c.yaxis,c.bg&&void 0!==d._offset&&void 0!==m._offset&&c.bg.call(l.setRect,d._offset-_,m._offset-_,d._length+2*_,m._length+2*_).call(s.fill,g.plot_bgcolor).style("stroke-width",0);if(!g._hasOnlyLargeSploms)for(o in g._plots){c=g._plots[o],d=c.xaxis,m=c.yaxis;var X,$,K=c.clipId="clip"+g._uid+o+"plot",J=i.ensureSingleById(g._clips,"clipPath",K,(function(e){e.classed("plotclip",!0).append("rect")}));c.clipRect=J.select("rect").attr({width:d._length,height:m._length}),l.setTranslate(c.plot,d._offset,m._offset),c._hasClipOnAxisFalse?(X=null,$=K):(X=K,$=null),l.setClipUrl(c.plot,X,r),c.layerClipId=$}function Q(e){return"M"+O+","+e+"H"+R}function ee(e){return"M"+d._offset+","+e+"h"+d._length}function te(e){return"M"+e+","+V+"V"+U}function re(e){return void 0!==m._shift&&(e+=m._shift),"M"+e+","+m._offset+"v"+m._length}function ne(e,t,r){if(!e.showline||o!==e._mainSubplot)return"";if(!e._anchorAxis)return r(e._mainLinePosition);var n=t(e._mainLinePosition);return e.mirror&&(n+=t(e._mainMirrorPosition)),n}for(o in g._plots){c=g._plots[o],d=c.xaxis,m=c.yaxis;var ie="M0,0";w(d,o)&&(j=k(d,"left",m,b),O=d._offset-(j?_+j:0),N=k(d,"right",m,b),R=d._offset+d._length+(N?_+N:0),F=T(d,m,"bottom"),B=T(d,m,"top"),(Z=!d._anchorAxis||o!==d._mainSubplot)&&("allticks"===d.mirror||"all"===d.mirror)&&(d._linepositions[o]=[F,B]),ie=ne(d,Q,ee),Z&&d.showline&&("all"===d.mirror||"allticks"===d.mirror)&&(ie+=Q(F)+Q(B)),c.xlines.style("stroke-width",d._lw+"px").call(s.stroke,d.showline?d.linecolor:"rgba(0,0,0,0)")),c.xlines.attr("d",ie);var ae="M0,0";w(m,o)&&(G=k(m,"bottom",d,b),U=m._offset+m._length+(G?_:0),W=k(m,"top",d,b),V=m._offset-(W?_:0),q=T(m,d,"left"),H=T(m,d,"right"),(Z=!m._anchorAxis||o!==m._mainSubplot)&&("allticks"===m.mirror||"all"===m.mirror)&&(m._linepositions[o]=[q,H]),ae=ne(m,te,re),Z&&m.showline&&("all"===m.mirror||"allticks"===m.mirror)&&(ae+=te(q)+te(H)),c.ylines.style("stroke-width",m._lw+"px").call(s.stroke,m.showline?m.linecolor:"rgba(0,0,0,0)")),c.ylines.attr("d",ae)}return h.makeClipPaths(r),n.previousPromises(r)}function w(e,t){return(e.ticks||e.showline)&&(t===e._mainSubplot||"all"===e.mirror||"allticks"===e.mirror)}function T(e,t,r){if(!r.showline||!r._lw)return!1;if("all"===r.mirror||"allticks"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var i=f.FROM_BL[t];return r.side===t?n.domain[i]===e.domain[i]:r.mirror&&n.domain[1-i]===e.domain[1-i]}function k(e,t,r,n){if(T(e,t,r))return r._lw;for(var i=0;i<n.length;i++){var a=n[i];if(a._mainAxis===r._mainAxis&&T(e,t,a))return a._lw}return 0}function A(e){return"top"===e?f.CAP_SHIFT+.3+"em":"bottom"===e?"-0.3em":f.MID_SHIFT+"em"}e.layoutStyles=function(e){return i.syncOrAsync([n.doAutoMargin,_],e)},e.drawMainTitle=function(e){var r=e._fullLayout.title,o=e._fullLayout,s=function(e){var t=e.title,r="middle";return i.isRightAnchor(t)?r="end":i.isLeftAnchor(t)&&(r=y),r}(o),u=function(e){var t=e.title,r="0em";return i.isTopAnchor(t)?r=f.CAP_SHIFT+"em":i.isMiddleAnchor(t)&&(r=f.MID_SHIFT+"em"),r}(o),h=function(e,t){var r=e.title,n=e._size,i=0;return"0em"!==t&&t?t===f.CAP_SHIFT+"em"&&(i=r.pad.t):i=-r.pad.b,"auto"===r.y?n.t/2:"paper"===r.yref?n.t+n.h-n.h*r.y+i:e.height-e.height*r.y+i}(o,u),p=function(e,t){var r=e.title,n=e._size,i=0;return"paper"===(t===y?i=r.pad.l:"end"===t&&(i=-r.pad.r),r.xref)?n.l+n.w*r.x+i:e.width*r.x+i}(o,s);if(c.draw(e,"gtitle",{propContainer:o,propName:"title.text",subtitlePropName:"title.subtitle.text",placeholder:o._dfltTitle.plot,subtitlePlaceholder:o._dfltTitle.subtitle,attributes:{x:p,y:h,"text-anchor":s,dy:u}}),r.text&&r.automargin){var d=t.select(e).selectAll(".gtitle"),m=l.bBox(t.select(e).selectAll(".g-gtitle").node()).height,g=function(e,t,r){var n=t.y,i=t.yanchor,a=n>.5?"t":"b",o=e._fullLayout.margin[a],s=0;return"paper"===t.yref?s=r+t.pad.t+t.pad.b:"container"===t.yref&&(s=function(e,t,r,n,i){var a=0;return"middle"===r&&(a+=i/2),"t"===e?("top"===r&&(a+=i),a+=n-t*n):("bottom"===r&&(a+=i),a+=t*n),a}(a,n,i,e._fullLayout.height,r)+t.pad.t+t.pad.b),s>o?s:0}(e,r,m);if(g>0){(function(e,t,r,a){var o="title.automargin",s=e._fullLayout.title,l=s.y>.5?"t":"b",c={x:s.x,y:s.y,t:0,b:0},u={};"paper"===s.yref&&function(e,t,r,n,a){var o="paper"===t.yref?e._fullLayout._size.h:e._fullLayout.height,s=i.isTopAnchor(t)?n:n-a,l="b"===r?o-s:s;return!(i.isTopAnchor(t)&&"t"===r||i.isBottomAnchor(t)&&"b"===r)&&l<a}(e,s,l,t,a)?c[l]=r:"container"===s.yref&&(u[l]=r,e._fullLayout._reservedMargin[o]=u),n.allowAutoMargin(e,o),n.autoMargin(e,o,c)})(e,h,g,m),d.attr({x:p,y:h,"text-anchor":s,dy:A(r.yanchor)}).call(a.positionText,p,h);var v=(r.text.match(a.BR_TAG_ALL)||[]).length;if(v){var x=f.LINE_SPACING*v+f.MID_SHIFT;0===r.y&&(x=-x),d.selectAll(".line").each((function(){var e=+this.getAttribute("dy").slice(0,-2)-x+"em";this.setAttribute("dy",e)}))}var _=t.select(e).selectAll(".gtitle-subtitle");if(_.node()){var b=d.node().getBBox(),w=b.y+b.height+c.SUBTITLE_PADDING_EM*r.subtitle.font.size;_.attr({x:p,y:w,"text-anchor":s,dy:A(r.yanchor)}).call(a.positionText,p,w)}}}},e.doTraceStyle=function(t){var i,a=t.calcdata,s=[];for(i=0;i<a.length;i++){var l=a[i],c=l[0]||{},u=c.trace||{},h=u._module||{},f=h.arraysToCalcdata;f&&f(l,u);var p=h.editStyle;p&&s.push({fn:p,cd0:c})}if(s.length){for(i=0;i<s.length;i++){var d=s[i];d.fn(t,d.cd0)}o(t),e.redrawReglTraces(t)}return n.style(t),r.getComponentMethod("legend","draw")(t),n.previousPromises(t)},e.doColorBars=function(e){return r.getComponentMethod("colorbar","draw")(e),n.previousPromises(e)},e.layoutReplot=function(e){var t=e.layout;return e.layout=void 0,r.call("_doPlot",e,"",t)},e.doLegend=function(e){return r.getComponentMethod("legend","draw")(e),n.previousPromises(e)},e.doTicksRelayout=function(t){return h.draw(t,"redraw"),t._fullLayout._hasOnlyLargeSploms&&(r.subplotsRegistry.splom.updateGrid(t),o(t),e.redrawReglTraces(t)),e.drawMainTitle(t),n.previousPromises(t)},e.doModeBar=function(e){var t=e._fullLayout;u.manage(e);for(var r=0;r<t._basePlotModules.length;r++){var i=t._basePlotModules[r].updateFx;i&&i(e)}return n.previousPromises(e)},e.doCamera=function(e){for(var t=e._fullLayout,r=t._subplots.gl3d,n=0;n<r.length;n++){var i=t[r[n]];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),n.style(t),r.getComponentMethod("selections","draw")(t),r.getComponentMethod("shapes","draw")(t),r.getComponentMethod("annotations","draw")(t),r.getComponentMethod("images","draw")(t),i._replotting=!1,n.previousPromises(t)},e.redrawReglTraces=function(e){var t=e._fullLayout;if(t._has("regl")){var r,n,a=e._fullData,o=[],s=[];for(t._hasOnlyLargeSploms&&t._splomGrid.draw(),r=0;r<a.length;r++){var l=a[r];!0===l.visible&&0!==l._length&&("splom"===l.type?t._splomScenes[l.uid].draw():"scattergl"===l.type?i.pushUnique(o,l.xaxis+l.yaxis):"scatterpolargl"===l.type&&i.pushUnique(s,l.subplot))}for(r=0;r<o.length;r++)(n=t._plots[o[r]])._scene&&n._scene.draw();for(r=0;r<s.length;r++)(n=t[s[r]]._subplot)._scene&&n._scene.draw()}},e.doAutoRangeAndConstraints=function(e){for(var t,r=h.list(e,"",!0),n={},i=0;i<r.length;i++)if(!n[(t=r[i])._id]){n[t._id]=1,m(e,t),g(e,t);var a=t._matchGroup;if(a)for(var o in a){var s=h.getFromId(e,o);g(e,s,t.range),n[o]=1}}d(e)},e.finalDraw=function(e){r.getComponentMethod("rangeslider","draw")(e),r.getComponentMethod("rangeselector","draw")(e)},e.drawMarginPushers=function(e){r.getComponentMethod("legend","draw")(e),r.getComponentMethod("rangeselector","draw")(e),r.getComponentMethod("sliders","draw")(e),r.getComponentMethod("updatemenus","draw")(e),r.getComponentMethod("colorbar","draw")(e)}}}),on=m({"src/components/selections/draw.js"(e,t){var r=Ur().readPaths,n=Zr(),i=bt().clearOutlineControllers,a=W(),o=er(),s=vt().arrayEditor,l=Gr(),c=l.getPathString;function u(e){var t=e._fullLayout;for(var r in i(e),t._selectionLayer.selectAll("path").remove(),t._plots){var n=t._plots[r].selectionLayer;n&&n.selectAll("path").remove()}for(var a=0;a<t.selections.length;a++)f(e,a)}function h(e){return e._context.editSelection}function f(e,t){e._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="'+t+'"]').remove();var i=l.makeSelectionsOptionsAndPlotinfo(e,t),f=i.options,m=i.plotinfo;f._input&&function(i){var l=c(e,f),g={"data-index":t,"fill-rule":"evenodd",d:l},y=f.opacity,v="rgba(0,0,0,0)",x=f.line.color||a.contrast(e._fullLayout.plot_bgcolor),_=f.line.width,b=f.line.dash;_||(_=5,b="solid");var w=h(e)&&e._fullLayout._activeSelectionIndex===t;w&&(v=e._fullLayout.activeselection.fillcolor,y=e._fullLayout.activeselection.opacity);for(var T=[],k=1;k>=0;k--){var A=i.append("path").attr(g).style("opacity",k?.1:y).call(a.stroke,x).call(a.fill,v).call(o.dashLine,k?"solid":b,k?4+_:_);if(p(A,e,f),w){var M=s(e.layout,"selections",f);A.style({cursor:"move"});var S={element:A.node(),plotinfo:m,gd:e,editHelpers:M,isActiveSelection:!0},E=r(l,e);n(E,A,S)}else A.style("pointer-events",k?"all":"none");T[k]=A}var C=T[0];T[1].node().addEventListener("click",(function(){return function(e,t){if(h(e)){var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeSelectionIndex)return void d(e);e._fullLayout._activeSelectionIndex=r,e._fullLayout._deactivateSelection=d,u(e)}}}(e,C)}))}(e._fullLayout._selectionLayer)}function p(e,t,r){var n=r.xref+r.yref;o.setClipUrl(e,"clip"+t._fullLayout._uid+n,t)}function d(e){h(e)&&e._fullLayout._activeSelectionIndex>=0&&(i(e),delete e._fullLayout._activeSelectionIndex,u(e))}t.exports={draw:u,drawOne:f,activateLastSelection:function(e){if(h(e)){var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=d,u(e)}}}}}),sn=m({"node_modules/polybooljs/lib/build-log.js"(e,t){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}}}),ln=m({"node_modules/polybooljs/lib/epsilon.js"(e,t){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=t[0];return(o-i)*(t[1]-a)-(s-a)*(l-i)>=-e},pointBetween:function(t,r,n){var i=t[1]-r[1],a=n[0]-r[0],o=t[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l<e||l-(a*a+s*s)>-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])<e},pointsSameY:function(t,r){return Math.abs(t[1]-r[1])<e},pointsSame:function(e,r){return t.pointsSameX(e,r)&&t.pointsSameY(e,r)},pointsCompare:function(e,r){return t.pointsSameX(e,r)?t.pointsSameY(e,r)?0:e[1]<r[1]?-1:1:e[0]<r[0]?-1:1},pointsCollinear:function(t,r,n){var i=t[0]-r[0],a=t[1]-r[1],o=r[0]-n[0],s=r[1]-n[1];return Math.abs(i*s-o*a)<e},linesIntersect:function(t,r,n,i){var a=r[0]-t[0],o=r[1]-t[1],s=i[0]-n[0],l=i[1]-n[1],c=a*l-o*s;if(Math.abs(c)<e)return!1;var u=t[0]-n[0],h=t[1]-n[1],f=(s*h-l*u)/c,p=(a*h-o*u)/c,d={alongA:0,alongB:0,pt:[t[0]+f*a,t[1]+f*o]};return d.alongA=f<=-e?-2:f<e?-1:f-1<=-e?0:f-1<e?1:2,d.alongB=p<=-e?-2:p<e?-1:p-1<=-e?0:p-1<e?1:2,d},pointInsideRegion:function(t,r){for(var n=t[0],i=t[1],a=r[r.length-1][0],o=r[r.length-1][1],s=!1,l=0;l<r.length;l++){var c=r[l][0],u=r[l][1];u-i>e!=o-i>e&&(a-c)*(i-u)/(o-u)+c-n>e&&(s=!s),a=c,o=u}return s}};return t}}}),cn=m({"node_modules/polybooljs/lib/linked-list.js"(e,t){t.exports={create:function(){var e={root:{root:!0,next:null},exists:function(t){return!(null===t||t===e.root)},isEmpty:function(){return null===e.root.next},getHead:function(){return e.root.next},insertBefore:function(t,r){for(var n=e.root,i=e.root.next;null!==i;){if(r(i))return t.prev=i.prev,t.next=i,i.prev.next=t,void(i.prev=t);n=i,i=i.next}n.next=t,t.prev=n,t.next=null},findTransition:function(t){for(var r=e.root,n=e.root.next;null!==n&&!t(n);)r=n,n=n.next;return{before:r===e.root?null:r,after:n,insert:function(e){return e.prev=r,e.next=n,r.next=e,null!==n&&(n.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}}}}),un=m({"node_modules/polybooljs/lib/intersecter.js"(e,t){var r=cn();t.exports=function(e,t,n){function i(e,t){return{id:n?n.segmentId():-1,start:e,end:t,myFill:{above:null,below:null},otherFill:null}}function a(e,t,r){return{id:n?n.segmentId():-1,start:e,end:t,myFill:{above:r.myFill.above,below:r.myFill.below},otherFill:null}}var o=r.create();function s(e,r){o.insertBefore(e,(function(n){var i=function(e,r,n,i,a,o){var s=t.pointsCompare(r,a);return 0!==s?s:t.pointsSame(n,o)?0:e!==i?e?1:-1:t.pointAboveOrOnLine(n,i?a:o,i?o:a)?1:-1}(e.isStart,e.pt,r,n.isStart,n.pt,n.other.pt);return i<0}))}function l(e,t){var n=function(e,t){var n=r.node({isStart:!0,pt:e.start,seg:e,primary:t,other:null,status:null});return s(n,e.end),n}(e,t);return function(e,t,n){var i=r.node({isStart:!1,pt:t.end,seg:t,primary:n,other:e,status:null});e.other=i,s(i,e.pt)}(n,e,t),n}function c(e,t){var r=a(t,e.seg.end,e.seg);return function(e,t){n&&n.segmentChop(e.seg,t),e.other.remove(),e.seg.end=t,e.other.pt=t,s(e.other,e.pt)}(e,t),l(r,e.primary)}function u(i,a){var s=r.create();function l(e){return s.findTransition((function(r){var n=function(e,r){var n=e.seg.start,i=e.seg.end,a=r.seg.start,o=r.seg.end;return t.pointsCollinear(n,a,o)?t.pointsCollinear(i,a,o)||t.pointAboveOrOnLine(i,a,o)?1:-1:t.pointAboveOrOnLine(n,a,o)?1:-1}(e,r.ev);return n>0}))}function u(e,r){var i=e.seg,a=r.seg,o=i.start,s=i.end,l=a.start,u=a.end;n&&n.checkIntersection(i,a);var h=t.linesIntersect(o,s,l,u);if(!1===h){if(!t.pointsCollinear(o,s,l)||t.pointsSame(o,u)||t.pointsSame(s,l))return!1;var f=t.pointsSame(o,l),p=t.pointsSame(s,u);if(f&&p)return r;var d=!f&&t.pointBetween(o,l,u),m=!p&&t.pointBetween(s,l,u);if(f)return m?c(r,s):c(e,u),r;d&&(p||(m?c(r,s):c(e,u)),c(r,o))}else 0===h.alongA&&(-1===h.alongB?c(e,l):0===h.alongB?c(e,h.pt):1===h.alongB&&c(e,u)),0===h.alongB&&(-1===h.alongA?c(r,o):0===h.alongA?c(r,h.pt):1===h.alongA&&c(r,s));return!1}for(var h=[];!o.isEmpty();){var f=o.getHead();if(n&&n.vert(f.pt[0]),f.isStart){let t=function(){if(d){var e=u(f,d);if(e)return e}return!!m&&u(f,m)};n&&n.segmentNew(f.seg,f.primary);var p=l(f),d=p.before?p.before.ev:null,m=p.after?p.after.ev:null;n&&n.tempStatus(f.seg,!!d&&d.seg,!!m&&m.seg);var g,y=t();if(y&&(e?(g=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above):y.seg.otherFill=f.seg.myFill,n&&n.segmentUpdate(y.seg),f.other.remove(),f.remove()),o.getHead()!==f){n&&n.rewind(f.seg);continue}if(e)g=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:i,f.seg.myFill.above=g?!f.seg.myFill.below:f.seg.myFill.below;else if(null===f.seg.otherFill){var v;v=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?a:i,f.seg.otherFill={above:v,below:v}}n&&n.status(f.seg,!!d&&d.seg,!!m&&m.seg),f.other.status=p.insert(r.node({ev:f}))}else{var x=f.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),n&&n.statusRemove(x.ev.seg),x.remove(),!f.primary){var _=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=_}h.push(f.seg)}o.getHead().remove()}return n&&n.done(),h}return e?{addRegion:function(e){for(var r,n=e[e.length-1],a=0;a<e.length;a++){r=n,n=e[a];var o=t.pointsCompare(r,n);0!==o&&l(i(o<0?r:n,o<0?n:r),!0)}},calculate:function(e){return u(e,!1)}}:{calculate:function(e,t,r,n){return e.forEach((function(e){l(a(e.start,e.end,e),!0)})),r.forEach((function(e){l(a(e.start,e.end,e),!1)})),u(t,n)}}}}}),hn=m({"node_modules/polybooljs/lib/segment-chainer.js"(e,t){t.exports=function(e,t,r){var n=[],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");else{r&&r.chainStart(e);for(var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},c=s,u=0;u<n.length;u++){var h=(g=n[u])[0],f=(g[1],g[g.length-1]);if(g[g.length-2],t.pointsSame(h,a)){if(k(u,!0,!0))break}else if(t.pointsSame(h,o)){if(k(u,!0,!1))break}else if(t.pointsSame(f,a)){if(k(u,!1,!0))break}else if(t.pointsSame(f,o)&&k(u,!1,!1))break}if(c===s)return n.push([a,o]),void(r&&r.chainNew(a,o));if(c===l){r&&r.chainMatch(s.index);var p=s.index,d=s.matches_pt1?o:a,m=s.matches_head,g=n[p],y=m?g[0]:g[g.length-1],v=m?g[1]:g[g.length-2],x=m?g[g.length-1]:g[0],_=m?g[g.length-2]:g[1];return t.pointsCollinear(v,y,d)&&(m?(r&&r.chainRemoveHead(s.index,d),g.shift()):(r&&r.chainRemoveTail(s.index,d),g.pop()),y=v),t.pointsSame(x,d)?(n.splice(p,1),t.pointsCollinear(_,x,y)&&(m?(r&&r.chainRemoveTail(s.index,y),g.pop()):(r&&r.chainRemoveHead(s.index,y),g.shift())),r&&r.chainClose(s.index),void i.push(g)):void(m?(r&&r.chainAddHead(s.index,d),g.unshift(d)):(r&&r.chainAddTail(s.index,d),g.push(d)))}var b=s.index,w=l.index;r&&r.chainConnect(b,w);var T=n[b].length<n[w].length;s.matches_head?l.matches_head?T?(A(b),M(b,w)):(A(w),M(w,b)):M(w,b):l.matches_head?M(b,w):T?(A(b),M(w,b)):(A(w),M(b,w))}function k(e,t,r){return c.index=e,c.matches_head=t,c.matches_pt1=r,c===s?(c=l,!1):(c=null,!0)}function A(e){r&&r.chainReverse(e),n[e].reverse()}function M(e,i){var a=n[e],o=n[i],s=a[a.length-1],l=a[a.length-2],c=o[0],u=o[1];t.pointsCollinear(l,s,c)&&(r&&r.chainRemoveTail(e,s),a.pop(),s=l),t.pointsCollinear(s,c,u)&&(r&&r.chainRemoveHead(i,c),o.shift()),r&&r.chainJoin(e,i),n[e]=a.concat(o),n.splice(i,1)}})),i}}}),fn=m({"node_modules/polybooljs/lib/segment-selector.js"(e,t){function r(e,t,r){var n=[];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);0!==t[i]&&n.push({id:r?r.segmentId():-1,start:e.start,end:e.end,myFill:{above:1===t[i],below:2===t[i]},otherFill:null})})),r&&r.selected(n),n}var n={union:function(e,t){return r(e,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],t)},intersect:function(e,t){return r(e,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],t)},difference:function(e,t){return r(e,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],t)},differenceRev:function(e,t){return r(e,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],t)},xor:function(e,t){return r(e,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],t)}};t.exports=n}}),pn=m({"node_modules/polybooljs/lib/geojson.js"(e,t){var r={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),i=1;i<t.length;i++)n=e.selectDifference(e.combine(n,r(t[i])));return n}if("Polygon"===t.type)return e.polygon(r(t.coordinates));if("MultiPolygon"===t.type){for(var n=e.segments({inverted:!1,regions:[]}),i=0;i<t.coordinates.length;i++)n=e.selectUnion(e.combine(n,r(t.coordinates[i])));return e.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(e,t,r){function n(e,r){return t.pointInsideRegion([.5*(e[0][0]+e[1][0]),.5*(e[0][1]+e[1][1])],r)}function i(e){return{region:e,children:[]}}r=e.polygon(e.segments(r));var a=i(null);function o(e,t){for(var r=0;r<e.children.length;r++)if(n(t,(s=e.children[r]).region))return void o(s,t);var a=i(t);for(r=0;r<e.children.length;r++){var s;n((s=e.children[r]).region,t)&&(a.children.push(s),e.children.splice(r,1),r--)}e.children.push(a)}for(var s=0;s<r.regions.length;s++){var l=r.regions[s];l.length<3||o(a,l)}function c(e,t){for(var r=0,n=e[e.length-1][0],i=e[e.length-1][1],a=[],o=0;o<e.length;o++){var s=e[o][0],l=e[o][1];a.push([s,l]),r+=l*n-s*i,n=s,i=l}return r<0!==t&&a.reverse(),a.push([a[0][0],a[0][1]]),a}var u=[];function h(e){var t=[c(e.region,!1)];u.push(t);for(var r=0;r<e.children.length;r++)t.push(f(e.children[r]))}function f(e){for(var t=0;t<e.children.length;t++)h(e.children[t]);return c(e.region,!0)}for(s=0;s<a.children.length;s++)h(a.children[s]);return u.length<=0?{type:"Polygon",coordinates:[]}:1==u.length?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}};t.exports=r}}),dn=m({"node_modules/polybooljs/index.js"(e,t){var r,n=sn(),i=ln(),a=un(),o=hn(),s=fn(),l=pn(),c=!1,u=i();function h(e,t,n){var i=r.segments(e),a=r.segments(t),o=n(r.combine(i,a));return r.polygon(o)}r={buildLog:function(e){return!0===e?c=n():!1===e&&(c=!1),!1!==c&&c.list},epsilon:function(e){return u.epsilon(e)},segments:function(e){var t=a(!0,u,c);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:a(!1,u,c).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:s.union(e.combined,c),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:s.intersect(e.combined,c),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:s.difference(e.combined,c),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:s.differenceRev(e.combined,c),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:s.xor(e.combined,c),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:o(e.segments,u,c),inverted:e.inverted}},polygonFromGeoJSON:function(e){return l.toPolygon(r,e)},polygonToGeoJSON:function(e){return l.fromPolygon(r,u,e)},union:function(e,t){return h(e,t,r.selectUnion)},intersect:function(e,t){return h(e,t,r.selectIntersect)},difference:function(e,t){return h(e,t,r.selectDifference)},differenceRev:function(e,t){return h(e,t,r.selectDifferenceRev)},xor:function(e,t){return h(e,t,r.selectXor)}},"object"==typeof window&&(window.PolyBool=r),t.exports=r}}),mn=m({"node_modules/point-in-polygon/nested.js"(e,t){t.exports=function(e,t,r,n){var i=e[0],a=e[1],o=!1;void 0===r&&(r=0),void 0===n&&(n=t.length);for(var s=n-r,l=0,c=s-1;l<s;c=l++){var u=t[l+r][0],h=t[l+r][1],f=t[c+r][0],p=t[c+r][1];h>a!=p>a&&i<(f-u)*(a-h)/(p-h)+u&&(o=!o)}return o}}}),gn=m({"src/lib/polygon.js"(e,t){var r=Le().dot,n=S().BADNUM,i=t.exports={};i.tester=function(e){var t,r=e.slice(),i=r[0][0],a=i,o=r[0][1],s=o;for((r[r.length-1][0]!==r[0][0]||r[r.length-1][1]!==r[0][1])&&r.push(r[0]),t=1;t<r.length;t++)i=Math.min(i,r[t][0]),a=Math.max(a,r[t][0]),o=Math.min(o,r[t][1]),s=Math.max(s,r[t][1]);var l,c=!1;5===r.length&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(c=!0,l=function(e){return e[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(c=!0,l=function(e){return e[1]===r[0][1]}));var u=!0,h=r[0];for(t=1;t<r.length;t++)if(h[0]!==r[t][0]||h[1]!==r[t][1]){u=!1;break}return{xmin:i,xmax:a,ymin:o,ymax:s,pts:r,contains:c?function(e,t){var r=e[0],c=e[1];return!(r===n||r<i||r>a||c===n||c<o||c>s||t&&l(e))}:function(e,t){var l=e[0],c=e[1];if(l===n||l<i||l>a||c===n||c<o||c>s)return!1;var u,h,f,p,d,m=r.length,g=r[0][0],y=r[0][1],v=0;for(u=1;u<m;u++)if(h=g,f=y,g=r[u][0],y=r[u][1],!(l<(p=Math.min(h,g))||l>Math.max(h,g)||c>Math.max(f,y)))if(c<Math.min(f,y))l!==p&&v++;else{if(c===(d=g===h?c:f+(l-h)*(y-f)/(g-h)))return!(1===u&&t);c<=d&&l!==p&&v++}return v%2==1},isRect:c,degenerate:u}},i.isSegmentBent=function(e,t,n,i){var a,o,s,l=e[t],c=[e[n][0]-l[0],e[n][1]-l[1]],u=r(c,c),h=Math.sqrt(u),f=[-c[1]/h,c[0]/h];for(a=t+1;a<n;a++)if(o=[e[a][0]-l[0],e[a][1]-l[1]],(s=r(o,c))<0||s>u||Math.abs(r(o,f))>i)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var s=r.length,l=n;r.splice(a+1);for(var c=l+1;c<e.length;c++)(c===e.length-1||i.isSegmentBent(e,l,c+1,t))&&(r.push(e[c]),r.length<s-2&&(n=c,a=r.length-1),l=c)}return e.length>1&&o(e.pop()),{addPt:o,raw:e,filtered:r}}}}),yn=m({"src/components/selections/constants.js"(e,t){t.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),vn=m({"src/components/selections/select.js"(e,t){var r=dn(),n=mn(),i=He(),a=er().dashStyle,o=W(),s=Or(),l=Kt().makeEventData,c=Rr(),u=c.freeMode,h=c.rectMode,f=c.drawMode,p=c.openMode,d=c.selectMode,m=Gr(),g=Hr(),y=Zr(),v=bt().clearOutline,x=Ur(),_=x.handleEllipse,b=x.readPaths,w=Vr().newShapes,T=qr(),k=on().activateLastSelection,A=ct(),M=A.sorterAsc,S=gn(),E=Qe(),C=_t().getFromId,I=Fr(),L=an().redrawReglTraces,P=yn(),z=P.MINSELECT,D=S.filter,O=S.tester,R=Nr(),F=R.p2r,B=R.axValue,j=R.getTransform;function N(e){return void 0!==e.subplot}function U(e,t,r,n,i,a,o){var s,l,c,u,h,f,d,m,g,v=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,_=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(v)){G(e,t,a);var b=function(e,t){var r,n,i=e[0],a=-1,o=[];for(n=0;n<t.length;n++)if(r=t[n],i.fullData.index===r.cd[0].trace.index){if(!0===i.hoverOnBox)break;void 0!==i.pointNumber?a=i.pointNumber:void 0!==i.binNumber&&(a=i.binNumber,o=i.pointNumbers);break}return{pointNumber:a,pointNumbers:o,searchInfo:r}}(v,s=X(t,r,n,i));if(b.pointNumbers.length>0?function(e,t){var r,n,i,a=[];for(i=0;i<e.length;i++)(r=e[i]).cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&a.push(r);if(1===a.length&&a[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(i=0;i<t.pointNumbers.length;i++)if(n.selectedpoints.indexOf(t.pointNumbers[i])<0)return!1;return!0}return!1}(s,b):function(e){var t,r,n=0;for(r=0;r<e.length;r++)if((t=e[r].cd[0].trace).selectedpoints&&(t.selectedpoints.length>1||(n+=t.selectedpoints.length)>1))return!1;return 1===n}(s)&&(f=K(b))){for(o&&o.remove(),g=0;g<s.length;g++)(l=s[g])._module.selectPoints(l,!1);J(t,s),Z(a),x&&fe(t)}else{for(d=e.shiftKey&&(void 0!==f?f:K(b)),c=function(e,t,r){return{pointNumber:e,searchInfo:t,subtract:!!r}}(b.pointNumber,b.searchInfo,d),u=H(a.selectionDefs.concat([c])),g=0;g<s.length;g++)if(h=ee(s[g]._module.selectPoints(s[g],u),s[g]),_.length)for(var w=0;w<h.length;w++)_.push(h[w]);else _=h;if(J(t,s,m={points:_}),c&&a&&a.selectionDefs.push(c),o){var T=a.mergedPolygons,k=p(a.dragmode);y(te(T,k),o,a)}x&&he(t,m)}}}function V(e){return"pointNumber"in e&&"searchInfo"in e}function q(e){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(t,r,n,i){var a=e.searchInfo.cd[0].trace.index;return i.cd[0].trace.index===a&&n===e.pointNumber},isRect:!1,degenerate:!1,subtract:!!e.subtract}}function H(e){if(e.length){for(var t=[],r=V(e[0])?0:e[0][0][0],n=r,i=V(e[0])?0:e[0][0][1],a=i,o=0;o<e.length;o++)if(V(e[o]))t.push(q(e[o]));else{var s=O(e[o]);s.subtract=!!e[o].subtract,t.push(s),r=Math.min(r,s.xmin),n=Math.max(n,s.xmax),i=Math.min(i,s.ymin),a=Math.max(a,s.ymax)}return{xmin:r,xmax:n,ymin:i,ymax:a,pts:[],contains:function(e,r,n,i){for(var a=!1,o=0;o<t.length;o++)t[o].contains(e,r,n,i)&&(a=!t[o].subtract);return a},isRect:!1,degenerate:!1}}}function G(e,t,r){var n=t._fullLayout,i=r.plotinfo,a=r.dragmode,o=n._lastSelectedSubplot&&n._lastSelectedSubplot===i.id,s=(e.shiftKey||e.altKey)&&!(f(a)&&p(a));o&&s&&i.selection&&i.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=i.selection.selectionDefs,r.mergedPolygons=i.selection.mergedPolygons):(!s||!i.selection)&&Z(r),o||(v(t),n._lastSelectedSubplot=i.id)}function Z(e,t){var r=e.dragmode,n=e.plotinfo,a=e.gd;(function(e){return e._fullLayout._activeShapeIndex>=0})(a)&&a._fullLayout._deactivateShape(a),function(e){return e._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,s=f(r),l=d(r);if(s||l){var c,u,h=o.selectAll(".select-outline-"+n.id);h&&a._fullLayout._outlining&&(s&&(c=w(h,e)),c&&i.call("_guiRelayout",a,{shapes:c}),l&&!N(e)&&(u=T(h,e)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){t&&k(a)}))),a._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=e.selectionDefs=[],n.selection.mergedPolygons=e.mergedPolygons=[]}function Y(e){return e._id}function X(e,t,r,n){if(!e.calcdata)return[];var i,a,o,s=[],l=t.map(Y),c=r.map(Y);for(o=0;o<e.calcdata.length;o++)if(!0===(a=(i=e.calcdata[o])[0].trace).visible&&a._module&&a._module.selectPoints)if(!N({subplot:n})||a.subplot!==n&&a.geo!==n)if("splom"===a.type){if(a._xaxes[l[0]]&&a._yaxes[c[0]]){var u=$(a._module,i,t[0],r[0]);u.scene=e._fullLayout._splomScenes[a.uid],s.push(u)}}else if("sankey"===a.type){var h=$(a._module,i,t[0],r[0]);s.push(h)}else{if(!(-1!==l.indexOf(a.xaxis)||a._xA&&a._xA.overlaying)||!(-1!==c.indexOf(a.yaxis)||a._yA&&a._yA.overlaying))continue;s.push($(a._module,i,C(e,a.xaxis),C(e,a.yaxis)))}else s.push($(a._module,i,t[0],r[0]));return s}function $(e,t,r,n){return{_module:e,cd:t,xaxis:r,yaxis:n}}function K(e){var t=e.searchInfo.cd[0].trace,r=e.pointNumber,n=e.pointNumbers,i=n.length>0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(i)>-1}function J(e,t,r){var n,a;for(n=0;n<t.length;n++){var o=t[n].cd[0].trace._fullInput,s=e._fullLayout._tracePreGUI[o.uid]||{};void 0===s.selectedpoints&&(s.selectedpoints=o._input.selectedpoints||null)}if(r){var l=r.points||[];for(n=0;n<t.length;n++)(a=t[n].cd[0].trace)._input.selectedpoints=a._fullInput.selectedpoints=[],a._fullInput!==a&&(a.selectedpoints=[]);for(var c=0;c<l.length;c++){var u=l[c],h=u.data,f=u.fullData,p=u.pointIndex,d=u.pointIndices;d?([].push.apply(h.selectedpoints,d),a._fullInput!==a&&[].push.apply(f.selectedpoints,d)):(h.selectedpoints.push(p),a._fullInput!==a&&f.selectedpoints.push(p))}}else for(n=0;n<t.length;n++)delete(a=t[n].cd[0].trace).selectedpoints,delete a._input.selectedpoints,a._fullInput!==a&&delete a._fullInput.selectedpoints;!function(e,t){for(var r=!1,n=0;n<t.length;n++){var a=t[n],o=a.cd;i.traceIs(o[0].trace,"regl")&&(r=!0);var s=a._module,l=s.styleOnSelect||s.style;l&&(l(e,o,o[0].node3),o[0].nodeRangePlot3&&l(e,o,o[0].nodeRangePlot3))}r&&(I(e),L(e))}(e,t)}function Q(e,t,n){for(var i=(n?r.difference:r.union)({regions:e},{regions:[t]}).regions.reverse(),a=0;a<i.length;a++){var o=i[a];o.subtract=se(o,i.slice(0,a))}return i}function ee(e,t){if(Array.isArray(e))for(var r=t.cd,n=t.cd[0].trace,i=0;i<e.length;i++)e[i]=l(e[i],n,r);return e}function te(e,t){for(var r=[],n=0;n<e.length;n++){r[n]=[];for(var i=0;i<e[n].length;i++){r[n][i]=[],r[n][i][0]=i?"L":"M";for(var a=0;a<e[n][i].length;a++)r[n][i].push(e[n][i][a])}t||r[n].push(["Z",r[n][0][1],r[n][0][2]])}return r}function re(e,t){for(var r,n,i=[],a=[],o=0;o<t.length;o++){var s=t[o];n=s._module.selectPoints(s,e),a.push(n),r=ee(n,s),i=i.concat(r)}return i}function ne(e,t,r,n,i){var a,o,s,l=!!n;i&&(a=i.plotinfo,o=i.xaxes[0]._id,s=i.yaxes[0]._id);var c=[],u=[],h=oe(e),p=e._fullLayout;if(a){var m=p._zoomlayer,g=p.dragmode,y=f(g),v=d(g);if(y||v){var x=C(e,o,"x"),_=C(e,s,"y");if(x&&_){var w=m.selectAll(".select-outline-"+a.id);if(w&&e._fullLayout._outlining&&w.length){for(var T=w[0][0].getAttribute("d"),k=b(T,e,a),A=[],M=0;M<k.length;M++){for(var S=k[M],E=[],I=0;I<S.length;I++)E.push([le(x,S[I][1]),le(_,S[I][2])]);E.xref=o,E.yref=s,E.subtract=se(E,A),A.push(E)}h=h.concat(A)}}}}var L=o&&s?[o+s]:p._subplots.cartesian;!function(e){var t=e.calcdata;if(t)for(var r=0;r<t.length;r++){var n=t[r][0].trace,i=e._fullLayout._splomScenes;if(i){var a=i[n.uid];a&&(a.selectBatch=[])}}}(e);for(var P={},z=0;z<L.length;z++){var D=L[z],O=D.indexOf("y"),R=D.slice(0,O),F=D.slice(O),B=o&&s?r:void 0;if(B=ae(h,R,F,B)){var j=n;if(!l){var N=C(e,R,"x"),U=C(e,F,"y");j=X(e,[N],[U],D);for(var V=0;V<j.length;V++){var q=j[V],H=q.cd[0],G=H.trace;if("scattergl"===q._module.name&&!H.t.xpx){var W=G.x,Z=G.y,Y=G._length;H.t.xpx=[],H.t.ypx=[];for(var $=0;$<Y;$++)H.t.xpx[$]=N.c2p(W[$]),H.t.ypx[$]=U.c2p(Z[$])}"splom"===q._module.name&&(P[G.uid]||(P[G.uid]=!0))}}var K=re(B,j);c=c.concat(K),u=u.concat(j)}}var Q={points:c};J(e,u,Q);var ee=p.clickmode.indexOf("event")>-1&&t;if(!a&&t){var te=oe(e,!0);if(te.length){var ne=te[0].xref,pe=te[0].yref;if(ne&&pe){var de=ce(te);ue([C(e,ne,"x"),C(e,pe,"y")])(Q,de)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ee&&he(e,Q),p._reselect=!1}if(!a&&p._deselect){var me=p._deselect;(function(e,t,r){for(var n=0;n<r.length;n++){var i=r[n];if(i.xaxis&&i.xaxis._id===e&&i.yaxis&&i.yaxis._id===t)return!0}return!1})(o=me.xref,s=me.yref,u)||ie(e,o,s,n),ee&&(Q.points.length?he(e,Q):fe(e)),p._deselect=!1}return{eventData:Q,selectionTesters:r}}function ie(e,t,r,n){n=X(e,[C(e,t,"x")],[C(e,r,"y")],t+r);for(var i=0;i<n.length;i++){var a=n[i];a._module.selectPoints(a,!1)}J(e,n)}function ae(e,t,r,n){for(var i,a=0;a<e.length;a++){var o=e[a];t===o.xref&&r===o.yref&&(i?n=H(i=Q(i,o,!!o.subtract)):(i=[o],n=O(o)))}return n}function oe(e,t){for(var r=[],n=e._fullLayout,i=n.selections,a=i.length,o=0;o<a;o++)if(!t||o===n._activeSelectionIndex){var s=i[o];if(s){var l,c,u,h,f,p=s.xref,d=s.yref,y=C(e,p,"x"),v=C(e,d,"y");if("rect"===s.type){f=[];var x=le(y,s.x0),_=le(y,s.x1),b=le(v,s.y0),w=le(v,s.y1);f=[[x,b],[x,w],[_,w],[_,b]],l=Math.min(x,_),c=Math.max(x,_),u=Math.min(b,w),h=Math.max(b,w),f.xmin=l,f.xmax=c,f.ymin=u,f.ymax=h,f.xref=p,f.yref=d,f.subtract=!1,f.isRect=!0,r.push(f)}else if("path"===s.type)for(var T=s.path.split("Z"),k=[],A=0;A<T.length;A++){var M=T[A];if(M){M+="Z";var S=m.extractPathCoords(M,g.paramIsX,"raw"),E=m.extractPathCoords(M,g.paramIsY,"raw");l=1/0,c=-1/0,u=1/0,h=-1/0,f=[];for(var I=0;I<S.length;I++){var L=le(y,S[I]),P=le(v,E[I]);f.push([L,P]),l=Math.min(L,l),c=Math.max(L,c),u=Math.min(P,u),h=Math.max(P,h)}f.xmin=l,f.xmax=c,f.ymin=u,f.ymax=h,f.xref=p,f.yref=d,f.subtract=se(f,k),k.push(f),r.push(f)}}}}return r}function se(e,t){for(var r=!1,i=0;i<t.length;i++)for(var a=t[i],o=0;o<e.length;o++)if(n(e[o],a)){r=!r;break}return r}function le(e,t){return"date"===e.type&&(t=t.replace("_"," ")),"log"===e.type?e.c2p(t):e.r2p(t,null,e.calendar)}function ce(e){for(var t=e.length,r=[],n=0;n<t;n++){var i=e[n];r=(r=r.concat(i)).concat([i[0]])}return function(e){return e.isRect=5===e.length&&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}(r)}function ue(e){return function(t,r){for(var n,i,a=0;a<e.length;a++){var o=e[a],s=o._id,l=s.charAt(0);if(r.isRect){n||(n={});var c=r[l+"min"],u=r[l+"max"];void 0!==c&&void 0!==u&&(n[s]=[F(o,c),F(o,u)].sort(M))}else i||(i={}),i[s]=r.map(B(o))}n&&(t.range=n),i&&(t.lassoPoints=i)}}function he(e,t){t&&(t.selections=(e.layout||{}).selections||[]),e.emit("plotly_selected",t)}function fe(e){e.emit("plotly_deselect",null)}t.exports={reselect:ne,prepSelect:function(e,t,r,n,l){var c=!N(n),m=u(l),g=h(l),v=p(l),x=f(l),b=d(l),w="drawcircle"===l,T="drawline"===l||w,k=n.gd,M=k._fullLayout,S=b&&"immediate"===M.newselection.mode&&c,C=M._zoomlayer,I=n.element.getBoundingClientRect(),L=n.plotinfo,R=j(L),F=t-I.left,B=r-I.top;M._calcInverseTransform(k);var V=A.apply3DTransform(M._invTransform)(F,B);F=V[0],B=V[1];var q,W,Y,$,K,ee,ae,oe=M._invScaleX,se=M._invScaleY,le=F,pe=B,de="M"+F+","+B,me=n.xaxes[0],ge=n.yaxes[0],ye=me._length,ve=ge._length,xe=e.altKey&&!(f(l)&&v);G(e,k,n),m&&(q=D([[F,B]],P.BENDPX));var _e=C.selectAll("path.select-outline-"+L.id).data([1]),be=x?M.newshape:M.newselection;x&&(n.hasText=be.label.text||be.label.texttemplate);var we=x&&!v?be.fillcolor:"rgba(0,0,0,0)",Te=be.line.color||(c?o.contrast(k._fullLayout.plot_bgcolor):"#7f7f7f");_e.enter().append("path").attr("class","select-outline select-outline-"+L.id).style({opacity:x?be.opacity/2:1,"stroke-dasharray":a(be.line.dash,be.line.width),"stroke-width":be.line.width+"px","shape-rendering":"crispEdges"}).call(o.stroke,Te).call(o.fill,we).attr("fill-rule","evenodd").classed("cursor-move",!!x).attr("transform",R).attr("d",de+"Z");var ke=C.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform",R).attr("d","M0,0Z");if(x&&n.hasText){var Ae=C.select(".label-temp");Ae.empty()&&(Ae=C.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Me=M._uid+P.SELECTID,Se=[],Ee=X(k,n.xaxes,n.yaxes,n.subplot);S&&!e.shiftKey&&(n._clearSubplotSelections=function(){if(c){var e=me._id,t=ge._id;ie(k,e,t,Ee);for(var r=(k.layout||{}).selections||[],n=[],a=!1,o=0;o<r.length;o++){var s=M.selections[o];s&&s.xref===e&&s.yref===t?a=!0:n.push(r[o])}a&&(k._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",k,{selections:n}))}});var Ce=function(e){return e.plotinfo.fillRangeItems||ue(e.xaxes.concat(e.yaxes))}(n);n.moveFn=function(e,t){n._clearSubplotSelections&&(n._clearSubplotSelections(),n._clearSubplotSelections=void 0),le=Math.max(0,Math.min(ye,oe*e+F)),pe=Math.max(0,Math.min(ve,se*t+B));var r=Math.abs(le-F),i=Math.abs(pe-B);if(g){var a,o,s;if(b){var l=M.selectdirection;switch(a="any"===l?i<Math.min(.6*r,z)?"h":r<Math.min(.6*i,z)?"v":"d":l){case"h":o=w?ve/2:0,s=ve;break;case"v":o=w?ye/2:0,s=ye}}if(x)switch(M.newshape.drawdirection){case"vertical":a="h",o=w?ve/2:0,s=ve;break;case"horizontal":a="v",o=w?ye/2:0,s=ye;break;case"ortho":r<i?(a="h",o=B,s=pe):(a="v",o=F,s=le);break;default:a="d"}"h"===a?(($=T?_(w,[le,o],[le,s]):[[F,o],[F,s],[le,s],[le,o]]).xmin=T?le:Math.min(F,le),$.xmax=T?le:Math.max(F,le),$.ymin=Math.min(o,s),$.ymax=Math.max(o,s),ke.attr("d","M"+$.xmin+","+(B-z)+"h-4v"+2*z+"h4ZM"+($.xmax-1)+","+(B-z)+"h4v"+2*z+"h-4Z")):"v"===a?(($=T?_(w,[o,pe],[s,pe]):[[o,B],[o,pe],[s,pe],[s,B]]).xmin=Math.min(o,s),$.xmax=Math.max(o,s),$.ymin=T?pe:Math.min(B,pe),$.ymax=T?pe:Math.max(B,pe),ke.attr("d","M"+(F-z)+","+$.ymin+"v-4h"+2*z+"v4ZM"+(F-z)+","+($.ymax-1)+"v4h"+2*z+"v-4Z")):"d"===a&&(($=T?_(w,[F,B],[le,pe]):[[F,B],[F,pe],[le,pe],[le,B]]).xmin=Math.min(F,le),$.xmax=Math.max(F,le),$.ymin=Math.min(B,pe),$.ymax=Math.max(B,pe),ke.attr("d","M0,0Z"))}else m&&(q.addPt([le,pe]),$=q.filtered);if(n.selectionDefs&&n.selectionDefs.length?(Y=Q(n.mergedPolygons,$,xe),$.subtract=xe,W=H(n.selectionDefs.concat([$]))):(Y=[$],W=O($)),y(te(Y,v),_e,n),b){var c,u=ne(k,!1),h=u.eventData?u.eventData.points.slice():[];u=ne(k,!1,W,Ee,n),W=u.selectionTesters,ae=u.eventData,c=q?q.filtered:ce(Y),E.throttle(Me,P.SELECTDELAY,(function(){for(var e=(Se=re(W,Ee)).slice(),t=0;t<h.length;t++){for(var r=h[t],n=!1,i=0;i<e.length;i++)if(e[i].curveNumber===r.curveNumber&&e[i].pointNumber===r.pointNumber){n=!0;break}n||e.push(r)}e.length&&(ae||(ae={}),ae.points=e),Ce(ae,c),function(e,t){e.emit("plotly_selecting",t)}(k,ae)}))}},n.clickFn=function(e,t){if(ke.remove(),k._fullLayout._activeShapeIndex>=0)k._fullLayout._deactivateShape(k);else if(!x){var r=M.clickmode;E.done(Me).then((function(){if(E.clear(Me),2===e){for(_e.remove(),K=0;K<Ee.length;K++)(ee=Ee[K])._module.selectPoints(ee,!1);if(J(k,Ee),Z(n),fe(k),Ee.length){var a=Ee[0].xaxis,o=Ee[0].yaxis;if(a&&o){for(var l=[],c=k._fullLayout.selections,u=0;u<c.length;u++){var h=c[u];h&&(h.xref!==a._id||h.yref!==o._id)&&l.push(h)}l.length<c.length&&(k._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",k,{selections:l}))}}}else r.indexOf("select")>-1&&U(t,k,n.xaxes,n.yaxes,n.subplot,n,_e),"event"===r&&he(k,void 0);s.click(k,t,L.id)})).catch(A.error)}},n.doneFn=function(){ke.remove(),E.done(Me).then((function(){E.clear(Me),!S&&$&&n.selectionDefs&&($.subtract=xe,n.selectionDefs.push($),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Y)),(S||x)&&Z(n,S),n.doneFnCompleted&&n.doneFnCompleted(Se),b&&he(k,ae)})).catch(A.error)}},clearOutline:v,clearSelectionsCache:Z,selectOnClick:U}}}),xn=m({"src/components/annotations/arrow_paths.js"(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}]}}),_n=m({"src/constants/axis_placeable_objects.js"(e,t){t.exports={axisRefDescription:function(e,t,r){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,"("+r+"). 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",r,"of the domain of the","second",e,"axis."].join(" ")}}}}),bn=m({"src/components/annotations/attributes.js"(e,t){var r=xn(),n=j(),i=xt(),a=vt().templatedArray;_n(),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:n({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:r.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:r.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:n({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}}),wn=m({"src/traces/scatter/constants.js"(e,t){t.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}}),Tn=m({"src/traces/scatter/fillcolor_attribute.js"(e,t){t.exports=function(e){return{valType:"color",editType:"style",anim:!0}}}}),kn=m({"src/traces/scatter/attributes.js"(e,t){var r=It().axisHoverFormat,{hovertemplateAttrs:n,texttemplateAttrs:i,templatefallbackAttrs:a}=Fe(),o=zt(),s=j(),l=Oe().dash,c=Oe().pattern,u=er(),h=wn(),f=B().extendFlat,p=Tn();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:{valType:"any",dflt:0,editType:"calc"},yperiod:{valType:"any",dflt:0,editType:"calc"},xperiod0:{valType:"any",editType:"calc"},yperiod0:{valType:"any",editType:"calc"},xperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},yperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},xhoverformat:r("x"),yhoverformat:r("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:n({},{keys:h.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({},l,{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:c,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({},l,{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"}}}}),An=m({"src/components/selections/attributes.js"(e,t){var r=bn(),n=kn().line,i=Oe().dash,a=B().extendFlat,o=De().overrideAll,s=vt().templatedArray;_n(),t.exports=o(s("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:a({},r.xref,{}),yref:a({},r.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:n.color,width:a({},n.width,{min:1,dflt:1}),dash:a({},i,{dflt:"dot"})}}),"arraydraw","from-root")}}),Mn=m({"src/components/selections/defaults.js"(e,t){var r=ct(),n=ar(),i=Nt(),a=An(),o=Gr();function s(e,t,i){function s(n,i){return r.coerce(e,t,a,n,i)}var l=s("path"),c="path"!==s("type",l?"path":"rect");c&&delete t.path,s("opacity"),s("line.color"),s("line.width"),s("line.dash");for(var u=["x","y"],h=0;h<2;h++){var f,p,d,m=u[h],g={_fullLayout:i},y=n.coerceRef(e,t,g,m);if((f=n.getFromId(g,y))._selectionIndices.push(t._index),d=o.rangeToShapePosition(f),p=o.shapePositionToRange(f),c){var v=m+"0",x=m+"1",_=e[v],b=e[x];e[v]=p(e[v],!0),e[x]=p(e[x],!0),n.coercePosition(t,g,s,y,v),n.coercePosition(t,g,s,y,x);var w=t[v],T=t[x];void 0!==w&&void 0!==T&&(t[v]=d(w),t[x]=d(T),e[v]=_,e[x]=b)}}c&&r.noneOrAll(e,t,["x0","x1","y0","y1"])}t.exports=function(e,t){i(e,t,{name:"selections",handleItemDefaults:s});for(var r=t.selections,n=0;n<r.length;n++){var a=r[n];a&&void 0===a.path&&(void 0===a.x0||void 0===a.x1||void 0===a.y0||void 0===a.y1)&&(t.selections[n]=null)}}}}),Sn=m({"src/components/selections/draw_newselection/defaults.js"(e,t){t.exports=function(e,t,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}}}),En=m({"src/plots/cartesian/include_components.js"(e,t){var r=He(),n=ct(),i=_t();t.exports=function(e){return function(t,a){var o=t[e];if(Array.isArray(o))for(var s=r.subplotsRegistry.cartesian,l=s.idRegex,c=a._subplots,u=c.xaxis,h=c.yaxis,f=c.cartesian,p=a._has("cartesian"),d=0;d<o.length;d++){var m=o[d];if(n.isPlainObject(m)){var g=i.cleanId(m.xref,"x",!1),y=i.cleanId(m.yref,"y",!1),v=l.x.test(g),x=l.y.test(y);if(v||x){p||n.pushUnique(a._basePlotModules,s);var _=!1;v&&-1===u.indexOf(g)&&(u.push(g),_=!0),x&&-1===h.indexOf(y)&&(h.push(y),_=!0),_&&v&&x&&f.push(g+y)}}}}}}}),Cn=m({"src/components/selections/index.js"(e,t){var r=on(),n=vn();t.exports={moduleType:"component",name:"selections",layoutAttributes:An(),supplyLayoutDefaults:Mn(),supplyDrawNewSelectionDefaults:Sn(),includeBasePlot:En()("selections"),draw:r.draw,drawOne:r.drawOne,reselect:n.reselect,prepSelect:n.prepSelect,clearOutline:n.clearOutline,clearSelectionsCache:n.clearSelectionsCache,selectOnClick:n.selectOnClick}}}),In=m({"src/plots/cartesian/dragbox.js"(e,t){var r=b(),n=ct(),i=n.numberFormat,a=F(),o=cr(),s=He(),l=n.strTranslate,c=Et(),u=W(),h=er(),f=Or(),p=ar(),d=dr(),m=pr(),g=Rr(),y=g.selectingOrDrawing,v=g.freeMode,x=St().FROM_TL,_=Fr(),w=an().redrawReglTraces,T=At(),k=_t().getFromId,A=Cn().prepSelect,M=Cn().clearOutline,S=Cn().selectOnClick,E=rn(),C=xt(),I=C.MINDRAG,L=C.MINZOOM,P=!0;function z(e,t,r,i){var a=n.ensureSingle(e.draglayer,t,r,(function(t){t.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",e.id)}));return a.call(d,i),a.node()}function D(e,t,n,i,a,o,s){var l=z(e,"rect",t,n);return r.select(l).call(h.setRect,i,a,o,s),l}function O(e,t){for(var r=0;r<e.length;r++)if(!e[r].fixedrange)return t;return""}function R(e,t,r,n,i){for(var a=0;a<e.length;a++){var o=e[a];if(!o.fixedrange)if(o.rangebreaks){var s="y"===o._id.charAt(0),l=s?1-t:t,c=s?1-r:r;n[o._name+".range[0]"]=o.l2r(o.p2l(l*o._length)),n[o._name+".range[1]"]=o.l2r(o.p2l(c*o._length))}else{var u=o._rl[0],h=o._rl[1]-u;n[o._name+".range[0]"]=o.l2r(u+h*t),n[o._name+".range[1]"]=o.l2r(u+h*r)}}if(i&&i.length){var f=(t+(1-r))/2;R(i,f,1-f,n,[])}}function B(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(!n.fixedrange){if(n.rangebreaks){var i=n._length,a=(n.p2l(0+t)-n.p2l(0)+(n.p2l(i+t)-n.p2l(i)))/2;n.range=[n.l2r(n._rl[0]-a),n.l2r(n._rl[1]-a)]}else n.range=[n.l2r(n._rl[0]-t/n._m),n.l2r(n._rl[1]-t/n._m)];n.limitRange&&n.limitRange()}}}function j(e){return 1-(e>=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function N(e,t,r,n,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",l(r,n)).attr("d",i+"Z")}function U(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(t,r)).attr("d","M0,0Z")}function V(e,t,r,n,i,a){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),q(e,t,i,a)}function q(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function H(e){r.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function G(e){P&&e.data&&e._context.showTips&&(n.notifier(n._(e,"Double-click to zoom back out"),"long",e),P=!1)}function Z(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,L)/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 Y(e,t,r,i,a){for(var o,s,l,c,u=!1,h={},f={},p=(a||{}).xaHash,d=(a||{}).yaHash,m=0;m<t.length;m++){var g=t[m];for(o in r)if(g[o]){for(l in g)(!a||!p[l]&&!d[l])&&!("x"===l.charAt(0)?r:i)[l]&&(h[l]=o);for(s in i)(!a||!p[s]&&!d[s])&&g[s]&&(u=!0)}for(s in i)if(g[s])for(c in g)(!a||!p[c]&&!d[c])&&!("x"===c.charAt(0)?r:i)[c]&&(f[c]=s)}u&&(n.extendFlat(h,f),f={});var y={},v=[];for(l in h){var x=k(e,l);v.push(x),y[x._id]=x}var _={},b=[];for(c in f){var w=k(e,c);b.push(w),_[w._id]=w}return{xaHash:y,yaHash:_,xaxes:v,yaxes:b,xLinks:h,yLinks:f,isSubplotConstrained:u}}function X(e,t){if(o){var r=void 0!==e.onwheel?"wheel":"mousewheel";e._onwheel&&e.removeEventListener(r,e._onwheel),e._onwheel=t,e.addEventListener(r,t,{passive:!1})}else void 0!==e.onwheel?e.onwheel=t:void 0!==e.onmousewheel?e.onmousewheel=t:e.isAddedWheelEvent||(e.isAddedWheelEvent=!0,e.addEventListener("wheel",t,{passive:!1}))}function $(e){var t=[];for(var r in e)t.push(e[r]);return t}t.exports={makeDragBox:function(e,t,o,l,u,d,g,b){var P,z,F,q,W,K,J,Q,ee,te,re,ne,ie,ae,oe,se,le,ce,ue,he,fe,pe,de,me=e._fullLayout._zoomlayer,ge=g+b==="nsew",ye=1===(g+b).length;function ve(){if(P=t.xaxis,z=t.yaxis,ee=P._length,te=z._length,J=P._offset,Q=z._offset,(F={})[P._id]=P,(q={})[z._id]=z,g&&b)for(var r=t.overlays,n=0;n<r.length;n++){var i=r[n].xaxis;F[i._id]=i;var a=r[n].yaxis;q[a._id]=a}W=$(F),K=$(q),ie=O(W,b),ae=O(K,g),oe=!ae&&!ie,ne=Y(e,e._fullLayout._axisMatchGroups,F,q);var o=(re=Y(e,e._fullLayout._axisConstraintGroups,F,q,ne)).isSubplotConstrained||ne.isSubplotConstrained;se=b||o,le=g||o;var s=e._fullLayout;ce=s._has("scattergl"),ue=s._has("splom"),he=s._has("svg")}o+=t.yaxis._shift,ve();var xe=function(e,t,r){return e?"nsew"===e?r?"":"pan"===t?"move":"crosshair":e.toLowerCase()+"-resize":"pointer"}(ae+ie,e._fullLayout.dragmode,ge),_e=D(t,g+b+"drag",xe,o,l,u,d);if(oe&&!ge)return _e.onmousedown=null,_e.style.pointerEvents="none",_e;var be,we,Te,ke,Ae,Me,Se,Ee,Ce,Ie,Le={element:_e,gd:e,plotinfo:t};function Pe(){Le.plotinfo.selection=!1,M(e)}function ze(n,a){var o=Le.gd;if(o._fullLayout._activeShapeIndex>=0)o._fullLayout._deactivateShape(o);else{var l=o._fullLayout.clickmode;if(H(o),2===n&&!ye&&function(){if(!e._transitioningWithDuration){var t=e._context.doubleClick,r=[];ie&&(r=r.concat(W)),ae&&(r=r.concat(K)),ne.xaxes&&(r=r.concat(ne.xaxes)),ne.yaxes&&(r=r.concat(ne.yaxes));var n,i,a={};if("reset+autosize"===t)for(t="autosize",i=0;i<r.length;i++){var o=(n=r[i])._rangeInitial0,l=n._rangeInitial1,c=void 0!==o||void 0!==l;if(c&&(void 0!==o&&o!==n.range[0]||void 0!==l&&l!==n.range[1])||!c&&!0!==n.autorange){t="reset";break}}if("autosize"===t)for(i=0;i<r.length;i++)(n=r[i]).fixedrange||(a[n._name+".autorange"]=!0);else if("reset"===t)for((ie||re.isSubplotConstrained)&&(r=r.concat(re.xaxes)),ae&&!re.isSubplotConstrained&&(r=r.concat(re.yaxes)),re.isSubplotConstrained&&(ie?ae||(r=r.concat(K)):r=r.concat(W)),i=0;i<r.length;i++)if(!(n=r[i]).fixedrange){var u=n._name,h=n._autorangeInitial;void 0===n._rangeInitial0&&void 0===n._rangeInitial1?a[u+".autorange"]=!0:void 0===n._rangeInitial0?(a[u+".autorange"]=h,a[u+".range"]=[null,n._rangeInitial1]):void 0===n._rangeInitial1?(a[u+".range"]=[n._rangeInitial0,null],a[u+".autorange"]=h):a[u+".range"]=[n._rangeInitial0,n._rangeInitial1]}e.emit("plotly_doubleclick",null),s.call("_guiRelayout",e,a)}}(),ge)l.indexOf("select")>-1&&S(a,o,W,K,t.id,Le),l.indexOf("event")>-1&&f.click(o,a,t.id);else if(1===n&&ye){var u=g?z:P,h="s"===g||"w"===b?0:1,p=u._name+".range["+h+"]",d=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(u,h),m="left",y="middle";if(u.fixedrange)return;g?(y="n"===g?"top":"bottom","right"===u.side&&(m="right")):"e"===b&&(m="right"),o._context.showAxisRangeEntryBoxes&&r.select(_e).call(c.makeEditable,{gd:o,immediate:!0,background:o._fullLayout.paper_bgcolor,text:String(d),fill:u.tickfont?u.tickfont.color:"#444",horizontalAlign:m,verticalAlign:y}).on("edit",(function(e){var t=u.d2r(e);void 0!==t&&s.call("_guiRelayout",o,p,t)}))}}}function De(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+be)),i=Math.max(0,Math.min(te,de*r+we)),a=Math.abs(n-be),o=Math.abs(i-we);function s(){Se="",Te.r=Te.l,Te.t=Te.b,Ce.attr("d","M0,0Z")}if(Te.l=Math.min(be,n),Te.r=Math.max(be,n),Te.t=Math.min(we,i),Te.b=Math.max(we,i),re.isSubplotConstrained)a>L||o>L?(Se="xy",a/ee>o/te?(o=a*te/ee,we>i?Te.t=we-o:Te.b=we+o):(a=o*ee/te,be>n?Te.l=be-a:Te.r=be+a),Ce.attr("d",Z(Te))):s();else if(ne.isSubplotConstrained)if(a>L||o>L){Se="xy";var l=Math.min(Te.l/ee,(te-Te.b)/te),c=Math.max(Te.r/ee,(te-Te.t)/te);Te.l=l*ee,Te.r=c*ee,Te.b=(1-l)*te,Te.t=(1-c)*te,Ce.attr("d",Z(Te))}else s();else!ae||o<Math.min(Math.max(.6*a,I),L)?a<I||!ie?s():(Te.t=0,Te.b=te,Se="x",Ce.attr("d",function(e,t){return"M"+(e.l-.5)+","+(t-L-.5)+"h-3v"+(2*L+1)+"h3ZM"+(e.r+.5)+","+(t-L-.5)+"h3v"+(2*L+1)+"h-3Z"}(Te,we))):!ie||a<Math.min(.6*o,L)?(Te.l=0,Te.r=ee,Se="y",Ce.attr("d",function(e,t){return"M"+(t-L-.5)+","+(e.t-.5)+"v-3h"+(2*L+1)+"v3ZM"+(t-L-.5)+","+(e.b+.5)+"v3h"+(2*L+1)+"v-3Z"}(Te,be))):(Se="xy",Ce.attr("d",Z(Te)));Te.w=Te.r-Te.l,Te.h=Te.b-Te.t,Se&&(Ie=!0),e._dragged=Ie,V(Ee,Ce,Te,Ae,Me,ke),Oe(),e.emit("plotly_relayouting",fe),Me=!0}function Oe(){fe={},("xy"===Se||"x"===Se)&&(R(W,Te.l/ee,Te.r/ee,fe,re.xaxes),Ve("x",fe)),("xy"===Se||"y"===Se)&&(R(K,(te-Te.b)/te,(te-Te.t)/te,fe,re.yaxes),Ve("y",fe))}function Re(){Oe(),H(e),He(),G(e)}Le.prepFn=function(t,r,i){var o=Le.dragmode,s=e._fullLayout.dragmode;s!==o&&(Le.dragmode=s),ve(),pe=e._fullLayout._invScaleX,de=e._fullLayout._invScaleY,oe||(ge?t.shiftKey?"pan"===s?s="zoom":y(s)||(s="pan"):t.ctrlKey&&(s="pan"):s="pan"),v(s)?Le.minDrag=1:Le.minDrag=void 0,y(s)?(Le.xaxes=W,Le.yaxes=K,A(t,r,i,Le,s)):(Le.clickFn=ze,y(o)&&Pe(),oe||("zoom"===s?(Le.moveFn=De,Le.doneFn=Re,Le.minDrag=1,function(t,r,i){var o=_e.getBoundingClientRect();be=r-o.left,we=i-o.top,e._fullLayout._calcInverseTransform(e);var s=n.apply3DTransform(e._fullLayout._invTransform)(be,we);be=s[0],we=s[1],Te={l:be,r:be,w:0,t:we,b:we,h:0},ke=e._hmpixcount?e._hmlumcount/e._hmpixcount:a(e._fullLayout.plot_bgcolor).getLuminance(),Me=!1,Se="xy",Ie=!1,Ee=N(me,ke,J,Q,Ae="M0,0H"+ee+"V"+te+"H0V0"),Ce=U(me,J,Q)}(0,r,i)):"pan"===s&&(Le.moveFn=Ue,Le.doneFn=He))),e._fullLayout._redrag=function(){var t=e._dragdata;if(t&&t.element===_e){var r=e._fullLayout.dragmode;y(r)||(ve(),Ge([0,0,ee,te]),Le.moveFn(t.dx,t.dy))}}},m.init(Le);var Fe=[0,0,ee,te],Be=null,je=C.REDRAWDELAY,Ne=t.mainplot?e._fullLayout._plots[t.mainplot]:t;function Ue(t,r){if(t*=pe,r*=de,!e._transitioningWithDuration){if(e._fullLayout._replotting=!0,"ew"===ie||"ns"===ae){var n=ie?-t:0,i=ae?-r:0;if(ne.isSubplotConstrained){if(ie&&ae){var a=(t/ee-r/te)/2;n=-(t=a*ee),i=-(r=-a*te)}ae?n=-i*ee/te:i=-n*te/ee}return ie&&(B(W,t),Ve("x")),ae&&(B(K,r),Ve("y")),Ge([n,i,ee,te]),qe(),void e.emit("plotly_relayouting",fe)}var o,s,l="w"===ie==("n"===ae)?1:-1;if(ie&&ae&&(re.isSubplotConstrained||ne.isSubplotConstrained)){var c=(t/ee+l*r/te)/2;t=c*ee,r=l*c*te}if("w"===ie?t=p(W,0,t):"e"===ie?t=p(W,1,-t):ie||(t=0),"n"===ae?r=p(K,1,r):"s"===ae?r=p(K,0,-r):ae||(r=0),o="w"===ie?t:0,s="n"===ae?r:0,re.isSubplotConstrained&&!ne.isSubplotConstrained||ne.isSubplotConstrained&&ie&&ae&&l>0){var u;if(ne.isSubplotConstrained||!ie&&1===ae.length){for(u=0;u<W.length;u++)W[u].range=W[u]._r.slice(),E(W[u],1-r/te);o=(t=r*ee/te)/2}if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;u<K.length;u++)K[u].range=K[u]._r.slice(),E(K[u],1-t/ee);s=(r=t*te/ee)/2}}(!ne.isSubplotConstrained||!ae)&&Ve("x"),(!ne.isSubplotConstrained||!ie)&&Ve("y");var h=ee-t,f=te-r;ne.isSubplotConstrained&&!(ie&&ae)&&(ie?(s=o?0:t*te/ee,f=h*te/ee):(o=s?0:r*ee/te,h=f*ee/te)),Ge([o,s,h,f]),qe(),e.emit("plotly_relayouting",fe)}function p(e,t,r){for(var n,i,a=1-t,o=0;o<e.length;o++){var s=e[o];if(!s.fixedrange){n=s,i=s._rl[a]+(s._rl[t]-s._rl[a])/j(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[t]=l)}}return n._length*(n._rl[t]-i)/(n._rl[t]-n._rl[a])}}function Ve(e,t){for(var r=ne.isSubplotConstrained?{x:K,y:W}[e]:ne[e+"axes"],n=ne.isSubplotConstrained?{x:W,y:K}[e]:[],i=0;i<r.length;i++){var a=r[i],o=a._id,s=ne.xLinks[o]||ne.yLinks[o],l=n[0]||F[s]||q[s];l&&(t?(t[a._name+".range[0]"]=t[l._name+".range[0]"],t[a._name+".range[1]"]=t[l._name+".range[1]"]):a.range=l.range.slice())}}function qe(){var r,n=[];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&&"sync"===a.tickmode&&n.push(a._id)}}for(se&&(i(W),i(re.xaxes),i(ne.xaxes),a(t.overlays,"xaxis")),le&&(i(K),i(re.yaxes),i(ne.yaxes),a(t.overlays,"yaxis")),fe={},r=0;r<n.length;r++){var o=n[r],s=k(e,o);p.drawOne(e,s,{skipTitle:!0}),fe[s._name+".range[0]"]=s.range[0],fe[s._name+".range[1]"]=s.range[1]}p.redrawComponents(e,n)}function He(){Ge([0,0,ee,te]),n.syncOrAsync([T.previousPromises,function(){e._fullLayout._replotting=!1,s.call("_guiRelayout",e,fe)}],e)}function Ge(t){var r,i,a,o,l=e._fullLayout,c=l._plots,u=l._subplots.cartesian;if(ue&&s.subplotsRegistry.splom.drag(e),ce)for(r=0;r<u.length;r++)if(a=(i=c[u[r]]).xaxis,o=i.yaxis,i._scene){a.limitRange&&a.limitRange(),o.limitRange&&o.limitRange();var f=n.simpleMap(a.range,a.r2l),p=n.simpleMap(o.range,o.r2l);i._scene.update({range:[f[0],p[0],f[1],p[1]]})}if((ue||ce)&&(_(e),w(e)),he){var d=t[2]/P._length,m=t[3]/z._length;for(r=0;r<u.length;r++){a=(i=c[u[r]]).xaxis,o=i.yaxis;var y,v,x,T,k=(se||ne.isSubplotConstrained)&&!a.fixedrange&&F[a._id],A=(le||ne.isSubplotConstrained)&&!o.fixedrange&&q[o._id];if(k?(y=d,x=b||ne.isSubplotConstrained?t[0]:Ye(a,y)):ne.xaHash[a._id]?(y=d,x=t[0]*a._length/P._length):ne.yaHash[a._id]?(y=m,x="ns"===ae?-t[1]*a._length/z._length:Ye(a,y,{n:"top",s:"bottom"}[ae])):x=Ze(a,y=We(a,d,m)),y>1&&(void 0!==a.maxallowed&&se===(a.range[0]<a.range[1]?"e":"w")||void 0!==a.minallowed&&se===(a.range[0]<a.range[1]?"w":"e"))&&(y=1,x=0),A?(v=m,T=g||ne.isSubplotConstrained?t[1]:Ye(o,v)):ne.yaHash[o._id]?(v=m,T=t[1]*o._length/z._length):ne.xaHash[o._id]?(v=d,T="ew"===ie?-t[0]*o._length/P._length:Ye(o,v,{e:"right",w:"left"}[ie])):T=Ze(o,v=We(o,d,m)),v>1&&(void 0!==o.maxallowed&&le===(o.range[0]<o.range[1]?"n":"s")||void 0!==o.minallowed&&le===(o.range[0]<o.range[1]?"s":"n"))&&(v=1,T=0),y||v){y||(y=1),v||(v=1);var M=a._offset-x/y,S=o._offset-T/v;i.clipRect.call(h.setTranslate,x,T).call(h.setScale,y,v),i.plot.call(h.setTranslate,M,S).call(h.setScale,1/y,1/v),(y!==i.xScaleFactor||v!==i.yScaleFactor)&&(h.setPointGroupScale(i.zoomScalePts,y,v),h.setTextPointsScale(i.zoomScaleTxt,y,v)),h.hideOutsideRangePoints(i.clipOnAxisFalseTraces,i),i.xScaleFactor=y,i.yScaleFactor=v}}}}function We(e,t,r){return e.fixedrange?0:se&&re.xaHash[e._id]?t:le&&(re.isSubplotConstrained?re.xaHash:re.yaHash)[e._id]?r:0}function Ze(e,t){return t?(e.range=e._r.slice(),E(e,t),Ye(e,t)):0}function Ye(e,t,r){return e._length*(1-t)*x[r||e.constraintoward||"middle"]}return g.length*b.length!=1&&X(_e,(function(t){if(e._context._scrollZoom.cartesian||e._fullLayout._enablescrollzoom){if(Pe(),e._transitioningWithDuration)return t.preventDefault(),void t.stopPropagation();ve(),clearTimeout(Be);var r=-t.deltaY;if(isFinite(r)||(r=t.wheelDelta/10),isFinite(r)){var i,a=Math.exp(-Math.min(Math.max(r,-20),20)/200),o=Ne.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(t.clientX-o.left)/o.width,l=(o.bottom-t.clientY)/o.height;if(se){for(b||(s=.5),i=0;i<W.length;i++)c(W[i],s,a);Ve("x"),Fe[2]*=a,Fe[0]+=Fe[2]*s*(1/a-1)}if(le){for(g||(l=.5),i=0;i<K.length;i++)c(K[i],l,a);Ve("y"),Fe[3]*=a,Fe[1]+=Fe[3]*(1-l)*(1/a-1)}Ge(Fe),qe(),e.emit("plotly_relayouting",fe),Be=setTimeout((function(){e._fullLayout&&(Fe=[0,0,ee,te],He())}),je),t.preventDefault()}else n.log("Did not find wheel motion attributes: ",t)}function c(e,t,r){if(!e.fixedrange){var i=n.simpleMap(e.range,e.r2l),a=i[0]+(i[1]-i[0])*t;e.range=i.map((function(t){return e.l2r(a+(t-a)*r)}))}}})),_e},makeDragger:z,makeRectDragger:D,makeZoombox:N,makeCorners:U,updateZoombox:V,xyCorners:Z,transitionZoombox:q,removeZoombox:H,showDoubleClickNotifier:G,attachWheelEventHandler:X}}}),Ln=m({"src/plots/cartesian/graph_interact.js"(e){var t=b(),r=Or(),n=pr(),i=dr(),a=In().makeDragBox,o=xt().DRAGGERSIZE;e.initInteractions=function(i){var s=i._fullLayout;if(i._context.staticPlot)t.select(i).selectAll(".drag").remove();else 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 r=e.split("y"),n=t.split("y");return r[0]===n[0]?Number(r[1]||1)-Number(n[1]||1):Number(r[0]||1)-Number(n[0]||1)}return s._plots[e].mainplot?1:-1})).forEach((function(e){var t=s._plots[e],l=t.xaxis,c=t.yaxis;if(!t.mainplot){var u=a(i,t,l._offset,c._offset,l._length,c._length,"ns","ew");u.onmousemove=function(t){i._fullLayout._rehover=function(){i._fullLayout._hoversubplot===e&&i._fullLayout._plots[e]&&r.hover(i,t,e)},r.hover(i,t,e),i._fullLayout._lasthover=u,i._fullLayout._hoversubplot=e},u.onmouseout=function(e){i._dragging||(i._fullLayout._hoversubplot=null,n.unhover(i,e))},i._context.showAxisDragHandles&&(a(i,t,l._offset-o,c._offset-o,o,o,"n","w"),a(i,t,l._offset+l._length,c._offset-o,o,o,"n","e"),a(i,t,l._offset-o,c._offset+c._length,o,o,"s","w"),a(i,t,l._offset+l._length,c._offset+c._length,o,o,"s","e"))}if(i._context.showAxisDragHandles){if(e===l._mainSubplot){var h=l._mainLinePosition;"top"===l.side&&(h-=o),a(i,t,l._offset+.1*l._length,h,.8*l._length,o,"","ew"),a(i,t,l._offset,h,.1*l._length,o,"","w"),a(i,t,l._offset+.9*l._length,h,.1*l._length,o,"","e")}if(e===c._mainSubplot){var f=c._mainLinePosition;"right"!==c.side&&(f-=o),a(i,t,f,c._offset+.1*c._length,o,.8*c._length,"ns",""),a(i,t,f,c._offset+.9*c._length,o,.1*c._length,"s",""),a(i,t,f,c._offset,o,.1*c._length,"n","")}}}));var l=s._hoverlayer.node();l.onmousemove=function(e){e.target=i._fullLayout._lasthover,r.hover(i,e,s._hoversubplot)},l.onclick=function(e){e.target=i._fullLayout._lasthover,r.click(i,e)},l.onmousedown=function(e){i._fullLayout._lasthover.onmousedown(e)},e.updateFx(i)}},e.updateFx=function(e){var t=e._fullLayout,r="pan"===t.dragmode?"move":"crosshair";i(t._draggers,r)}}}),Pn=m({"src/plot_api/container_array_match.js"(e,t){var r=He();t.exports=function(e){for(var t,n,i=r.layoutArrayContainers,a=r.layoutArrayRegexes,o=e.split("[")[0],s=0;s<a.length;s++)if((n=e.match(a[s]))&&0===n.index){t=n[0];break}if(t||(t=i[i.indexOf(o)]),!t)return!1;var l=e.slice(t.length);return l?!!(n=l.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:t,index:Number(n[1]),property:n[3]||""}:{array:t,index:"",property:""}}}}),zn=m({"src/plot_api/manage_arrays.js"(e){var t=C(),r=Q(),n=J(),i=Ze().sorterAsc,a=He();e.containerArrayMatch=Pn();var o=e.isAddVal=function(e){return"add"===e||t(e)},s=e.isRemoveVal=function(e){return null===e||"remove"===e};e.applyContainerArrayChanges=function(e,t,l,c,u){var h=t.astr,f=a.getComponentMethod(h,"supplyLayoutDefaults"),p=a.getComponentMethod(h,"draw"),d=a.getComponentMethod(h,"drawOne"),m=c.replot||c.recalc||f===r||p===r,g=e.layout,y=e._fullLayout;if(l[""]){Object.keys(l).length>1&&n.warn("Full array edits are incompatible with other edits",h);var v=l[""][""];if(s(v))t.set(null);else{if(!Array.isArray(v))return n.warn("Unrecognized full array edit value",h,v),!0;t.set(v)}return!m&&(f(g,y),p(e),!0)}var x,_,b,w,T,k,A,M,S=Object.keys(l).map(Number).sort(i),E=t.get(),C=E||[],I=u(y,h).get(),L=[],P=-1,z=C.length;for(x=0;x<S.length;x++)if(w=l[b=S[x]],T=Object.keys(w),k=w[""],A=o(k),b<0||b>C.length-(A?0:1))n.warn("index out of range",h,b);else if(void 0!==k)T.length>1&&n.warn("Insertion & removal are incompatible with edits to the same index.",h,b),s(k)?L.push(b):A?("add"===k&&(k={}),C.splice(b,0,k),I&&I.splice(b,0,{})):n.warn("Unrecognized full object edit value",h,b,k),-1===P&&(P=b);else for(_=0;_<T.length;_++)M=h+"["+b+"].",u(C[b],T[_],M).set(w[T[_]]);for(x=L.length-1;x>=0;x--)C.splice(L[x],1),I&&I.splice(L[x],1);if(C.length?E||t.set(C):t.set(null),m)return!1;if(f(g,y),d!==r){var D;if(-1===P)D=S;else{for(z=Math.max(C.length,z),D=[],x=0;x<S.length&&!((b=S[x])>=P);x++)D.push(b);for(x=P;x<z;x++)D.push(x)}for(x=0;x<D.length;x++)d(e,D[x])}else p(e);return!0}}}),Dn=m({"src/plot_api/helpers.js"(e){var t=M(),r=He(),n=ct(),i=At(),a=_t(),o=W(),s=a.cleanId,l=a.getFromTrace,c=r.traceIs,u=["x","y","z"];function h(e,t,r=!1){var n=e[t],i=t.charAt(0);r&&Array.isArray(n)||n&&"paper"!==n&&(e[t]=s(n,i,!0))}function f(e){if(!n.isPlainObject(e))return!1;var t=e.name;return delete e.name,delete e.showlegend,("string"==typeof t||"number"==typeof t)&&String(t)}function p(e,t,r,n){if(r&&!n)return e;if(n&&!r||!e.trim())return t;if(!t.trim())return e;var i,a=Math.min(e.length,t.length);for(i=0;i<a&&e.charAt(i)===t.charAt(i);i++);return e.slice(0,i).trim()}function d(e){var t="middle",r="center";return"string"==typeof e&&(-1!==e.indexOf("top")?t="top":-1!==e.indexOf("bottom")&&(t="bottom"),-1!==e.indexOf("left")?r="left":-1!==e.indexOf("right")&&(r="right")),t+" "+r}function m(e,t){return t in e&&"object"==typeof e[t]&&0===Object.keys(e[t]).length}e.clearPromiseQueue=function(e){Array.isArray(e._promises)&&e._promises.length>0&&n.log("Clearing previous rejected promises from queue."),e._promises=[]},e.cleanLayout=function(t){var r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(i.subplotsRegistry.cartesian||{}).attrRegex,l=((i.subplotsRegistry.polar||{}).attrRegex,(i.subplotsRegistry.ternary||{}).attrRegex,(i.subplotsRegistry.gl3d||{}).attrRegex,Object.keys(t));for(r=0;r<l.length;r++){var c=l[r];if(a&&a.test(c)){var u=t[c];u.anchor&&"free"!==u.anchor&&(u.anchor=s(u.anchor)),u.overlaying&&(u.overlaying=s(u.overlaying)),u.type||(u.isdate?u.type="date":u.islog?u.type="log":!1===u.isdate&&!1===u.islog&&(u.type="linear")),("withzero"===u.autorange||"tozero"===u.autorange)&&(u.autorange=!0,u.rangemode="tozero"),u.insiderange&&delete u.range,delete u.islog,delete u.isdate,delete u.categories,m(u,"domain")&&delete u.domain}}var f=Array.isArray(t.annotations)?t.annotations.length:0;for(r=0;r<f;r++){var p=t.annotations[r];n.isPlainObject(p)&&(h(p,"xref"),h(p,"yref"))}var d=Array.isArray(t.shapes)?t.shapes.length:0;for(r=0;r<d;r++){var g=t.shapes[r];n.isPlainObject(g)&&(h(g,"xref",!0),h(g,"yref",!0))}var y=Array.isArray(t.images)?t.images.length:0;for(r=0;r<y;r++){var v=t.images[r];n.isPlainObject(v)&&(h(v,"xref"),h(v,"yref"))}var x=t.legend;return x&&(x.x>3?(x.x=1.02,x.xanchor="left"):x.x<-2&&(x.x=-.02,x.xanchor="right"),x.y>3?(x.y=1.02,x.yanchor="bottom"):x.y<-2&&(x.y=-.02,x.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),o.clean(t),t.template&&t.template.layout&&e.cleanLayout(t.template.layout),t},e.cleanData=function(t){for(var a=0;a<t.length;a++){var l,u=t[a];if("histogramy"===u.type&&"xbins"in u&&!("ybins"in u)&&(u.ybins=u.xbins,delete u.xbins),"histogramy"===u.type&&e.swapXYData(u),("histogramx"===u.type||"histogramy"===u.type)&&(u.type="histogram"),"scl"in u&&!("colorscale"in u)&&(u.colorscale=u.scl,delete u.scl),"reversescl"in u&&!("reversescale"in u)&&(u.reversescale=u.reversescl,delete u.reversescl),u.xaxis&&(u.xaxis=s(u.xaxis,"x")),u.yaxis&&(u.yaxis=s(u.yaxis,"y")),c(u,"gl3d")&&u.scene&&(u.scene=i.subplotsRegistry.gl3d.cleanId(u.scene)),!c(u,"pie-like")&&!c(u,"bar-like"))if(Array.isArray(u.textposition))for(l=0;l<u.textposition.length;l++)u.textposition[l]=d(u.textposition[l]);else u.textposition&&(u.textposition=d(u.textposition));var h=r.getModule(u);if(h&&h.colorbar){var g=h.colorbar.container,y=g?u[g]:u;y&&y.colorscale&&("YIGnBu"===y.colorscale&&(y.colorscale="YlGnBu"),"YIOrRd"===y.colorscale&&(y.colorscale="YlOrRd"))}if("surface"===u.type&&n.isPlainObject(u.contours)){var v=["x","y","z"];for(l=0;l<v.length;l++){var x=u.contours[v[l]];n.isPlainObject(x)&&(x.highlightColor&&(x.highlightcolor=x.highlightColor,delete x.highlightColor),x.highlightWidth&&(x.highlightwidth=x.highlightWidth,delete x.highlightWidth))}}if("candlestick"===u.type||"ohlc"===u.type){var _=!1!==(u.increasing||{}).showlegend,b=!1!==(u.decreasing||{}).showlegend,w=f(u.increasing),T=f(u.decreasing);if(!1!==w&&!1!==T){var k=p(w,T,_,b);k&&(u.name=k)}else(w||T)&&!u.name&&(u.name=w||T)}m(u,"line")&&delete u.line,"marker"in u&&(m(u.marker,"line")&&delete u.marker.line,m(u,"marker")&&delete u.marker),o.clean(u),u.autobinx&&(delete u.autobinx,delete u.xbins),u.autobiny&&(delete u.autobiny,delete u.ybins)}},e.swapXYData=function(e){var t;if(n.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 r=e.error_y,i="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);n.swapAttrs(e,["error_?.copy_ystyle"]),i&&n.swapAttrs(e,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof e.hoverinfo){var a=e.hoverinfo.split("+");for(t=0;t<a.length;t++)"x"===a[t]?a[t]="y":"y"===a[t]&&(a[t]="x");e.hoverinfo=a.join("+")}},e.coerceTraceIndices=function(e,r){if(t(r))return[r];if(!Array.isArray(r)||!r.length)return e.data.map((function(e,t){return t}));if(Array.isArray(r)){for(var i=[],a=0;a<r.length;a++)n.isIndex(r[a],e.data.length)?i.push(r[a]):n.warn("trace index (",r[a],") is not a number or is out of bounds");return i}return r},e.manageArrayContainers=function(e,r,i){var a=e.obj,o=e.parts,s=o.length,l=o[s-1],c=t(l);if(c&&null===r){var u=o.slice(0,s-1).join(".");n.nestedProperty(a,u).get().splice(l,1)}else c&&void 0===e.get()&&void 0===e.get()&&(i[e.astr]=null),e.set(r)};var g=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function y(e){var t=e.search(g);if(t>0)return e.slice(0,t)}e.hasParent=function(e,t){for(var r=y(t);r;){if(r in e)return!0;r=y(r)}return!1},e.clearAxisTypes=function(e,t,r){for(var i=0;i<t.length;i++)for(var a=e._fullData[i],o=0;o<3;o++){var s=l(e,a,u[o]);if(s&&"log"!==s.type){var c=s._name,h=s._id.slice(1);if("scene"===h.slice(0,5)){if(void 0!==r[h])continue;c=h+"."+c}var f=c+".type";void 0===r[c]&&void 0===r[f]&&n.nestedProperty(e.layout,f).set(null)}}};var v=(e,t)=>{let r=(...e)=>e.every((e=>n.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 n=0;n<e.length;n++){let i=e[n],a=t[n];if(!(i===a||r(i,a)&&v(i,a)))return!1}return!0}if([e,t].every((e=>n.isPlainObject(e)))){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){if(n.startsWith("_"))continue;let i=e[n],a=t[n];if(!(i===a||r(i,a)&&v(i,a)))return!1}return!0}return!1};e.collectionsAreEqual=v}}),On=m({"src/plot_api/plot_api.js"(e){var t=b(),r=M(),n=ft(),i=ct(),a=i.nestedProperty,o=dt(),s=mt(),l=He(),c=yt(),u=At(),h=ar(),f=sr(),p=Lt(),d=er(),m=W(),g=Ln().initInteractions,y=Mt(),v=Cn().clearOutline,x=$().dfltConfig,_=zn(),w=Dn(),T=an(),k=De(),A=xt().AX_NAME_PATTERN,S=0;function E(e){var t=e._fullLayout;t._redrawFromAutoMarginCount?t._redrawFromAutoMarginCount--:e.emit("plotly_afterplot")}function C(e,t){try{e._fullLayout._paper.style("background",t)}catch(e){i.error(e)}}function I(e,t){C(e,m.combine(t,"white"))}function L(e,r){if(!e._context){e._context=i.extendDeep({},x);var a=t.select("base");e._context._baseUrl=a.size()&&a.attr("href")?window.location.href.split("#")[0]:""}var o,s,l,c=e._context;if(r){for(s=Object.keys(r),o=0;o<s.length;o++)"editable"!==(l=s[o])&&"edits"!==l&&l in c&&("setBackground"===l&&"opaque"===r[l]?c[l]=I:c[l]=r[l]);var u=r.editable;if(void 0!==u)for(c.editable=u,s=Object.keys(c.edits),o=0;o<s.length;o++)c.edits[s[o]]=u;if(r.edits)for(s=Object.keys(r.edits),o=0;o<s.length;o++)(l=s[o])in c.edits&&(c.edits[l]=r.edits[l]);c._exportedPlot=r._exportedPlot}c.staticPlot&&(c.editable=!1,c.edits={},c.autosizable=!1,c.scrollZoom=!1,c.doubleClick=!1,c.showTips=!1,c.showLink=!1,c.displayModeBar=!1),"hover"===c.displayModeBar&&!n&&(c.displayModeBar=!0),("transparent"===c.setBackground||"function"!=typeof c.setBackground)&&(c.setBackground=C),c._hasZeroHeight=c._hasZeroHeight||0===e.clientHeight,c._hasZeroWidth=c._hasZeroWidth||0===e.clientWidth;var h=c.scrollZoom,f=c._scrollZoom={};if(!0===h)f.cartesian=1,f.gl3d=1,f.geo=1,f.mapbox=1,f.map=1;else if("string"==typeof h){var p=h.split("+");for(o=0;o<p.length;o++)f[p[o]]=1}else!1!==h&&(f.gl3d=1,f.geo=1,f.mapbox=1,f.map=1)}function P(e,t){var r,n,i=t+1,a=[];for(r=0;r<e.length;r++)(n=e[r])<0?a.push(i+n):a.push(n);return a}function z(e,t,r){var n,i;for(n=0;n<t.length;n++){if((i=t[n])!==parseInt(i,10))throw new Error("all values in "+r+" must be integers");if(i>=e.data.length||i<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(i,n+1)>-1||i>=0&&t.indexOf(-e.data.length+i)>-1||i<0&&t.indexOf(e.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function D(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(typeof t>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),z(e,t,"currentIndices"),typeof r<"u"&&!Array.isArray(r)&&(r=[r]),typeof r<"u"&&z(e,r,"newIndices"),typeof r<"u"&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(e,t,n,o,s){!function(e,t,r,n){var a=i.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!i.isPlainObject(t))throw new Error("update must be a key:value object");if(typeof r>"u")throw new Error("indices must be an integer or array of integers");for(var o in z(e,r,"indices"),t){if(!Array.isArray(t[o])||t[o].length!==r.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(a&&(!(o in n)||!Array.isArray(n[o])||n[o].length!==t[o].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}(e,t,n,o);for(var l=function(e,t,n,o){var s,l,c,u,h,f=i.isPlainObject(o),p=[];for(var d in Array.isArray(n)||(n=[n]),n=P(n,e.data.length-1),t)for(var m=0;m<n.length;m++){if(s=e.data[n[m]],l=(c=a(s,d)).get(),u=t[d][m],!i.isArrayOrTypedArray(u))throw new Error("attribute: "+d+" index: "+m+" must be an array");if(!i.isArrayOrTypedArray(l))throw new Error("cannot extend missing or non-array attribute: "+d);if(l.constructor!==u.constructor)throw new Error("cannot extend array with an array of a different type: "+d);h=f?o[d][m]:o,r(h)||(h=-1),p.push({prop:c,target:l,insert:u,maxp:Math.floor(h)})}return p}(e,t,n,o),c={},u={},h=0;h<l.length;h++){var f=l[h].prop,p=l[h].maxp,d=s(l[h].target,l[h].insert,p);f.set(d[0]),Array.isArray(c[f.astr])||(c[f.astr]=[]),c[f.astr].push(d[1]),Array.isArray(u[f.astr])||(u[f.astr]=[]),u[f.astr].push(l[h].target.length)}return{update:c,maxPoints:u}}function R(e,t){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}function F(t,r,n,a){t=i.getGraphDiv(t),w.clearPromiseQueue(t);var o={};if("string"==typeof r)o[r]=n;else{if(!i.isPlainObject(r))return i.warn("Restyle fail.",r,n,a),Promise.reject();o=i.extendFlat({},r),void 0===a&&(a=n)}Object.keys(o).length&&(t.changed=!0);var l=w.coerceTraceIndices(t,a),c=U(t,o,l),h=c.flags;h.calc&&(t.calcdata=void 0),h.clearAxisTypes&&w.clearAxisTypes(t,l,{});var f=[];h.fullReplot?f.push(e._doPlot):(f.push(u.previousPromises),u.supplyDefaults(t),h.markerSize&&(u.doCalcdata(t),H(f)),h.style&&f.push(T.doTraceStyle),h.colorbars&&f.push(T.doColorBars),f.push(E)),f.push(u.rehover,u.redrag,u.reselect),s.add(t,F,[t,c.undoit,c.traces],F,[t,c.redoit,c.traces]);var p=i.syncOrAsync(f,t);return(!p||!p.then)&&(p=Promise.resolve()),p.then((function(){return t.emit("plotly_restyle",c.eventData),t}))}function B(e){return void 0===e?null:e}function j(e,t){return t?function(t,r,n){var i=a(t,r),o=i.set;return i.set=function(t){N((n||"")+r,i.get(),t,e),o(t)},i}:a}function N(e,t,r,n){if(Array.isArray(t)||Array.isArray(r))for(var a=Array.isArray(t)?t:[],o=Array.isArray(r)?r:[],s=Math.max(a.length,o.length),l=0;l<s;l++)N(e+"["+l+"]",a[l],o[l],n);else if(i.isPlainObject(t)||i.isPlainObject(r)){var c=i.isPlainObject(t)?t:{},u=i.isPlainObject(r)?r:{},h=i.extendFlat({},c,u);for(var f in h)N(e+"."+f,c[f],u[f],n)}else void 0===n[e]&&(n[e]=B(t))}function U(e,t,r){var n,o,s=e._fullLayout,f=e._fullData,p=e.data,d=s._guiEditing,m=j(s._preGUI,d),g=i.extendDeepAll({},t),y=k.traceFlags(),v={},x={};function _(){return r.map((function(){}))}function b(e){var t=h.id2name(e);-1===o.indexOf(t)&&o.push(t)}function T(e){return"LAYOUT"+e+".autorange"}function A(e){return"LAYOUT"+e+".range"}function M(e){for(var t=e;t<f.length;t++)if(f[t]._input===p[e])return f[t]}function S(n,i,a){if(Array.isArray(n))n.forEach((function(e){S(e,i,a)}));else if(!(n in t)&&!w.hasParent(t,n)){var o;if("LAYOUT"===n.slice(0,6))o=m(e.layout,n.replace("LAYOUT",""));else{var l=r[a];o=j(s._tracePreGUI[M(l)._fullInput.uid],d)(p[l],n)}n in x||(x[n]=_()),void 0===x[n][a]&&(x[n][a]=B(o.get())),void 0!==i&&o.set(i)}}function E(e){return function(t){return f[t][e]}}function C(e){return function(t,n){return!1===t?f[r[n]][e]:null}}for(var I in t){if(w.hasParent(t,I))throw new Error("cannot set "+I+" and a parent attribute simultaneously");var L,P,z,D,O,R,F=t[I];if(("autobinx"===I||"autobiny"===I)&&(I=I.charAt(I.length-1)+"bins",F=Array.isArray(F)?F.map(C(I)):!1===F?r.map(E(I)):null),v[I]=F,"LAYOUT"!==I.slice(0,6)){for(x[I]=_(),n=0;n<r.length;n++)if(L=p[r[n]],P=M(r[n]),D=(z=j(s._tracePreGUI[P._fullInput.uid],d)(L,I)).get(),void 0!==(O=Array.isArray(F)?F[n%F.length]:F)){var N=z.parts[z.parts.length-1],U=I.slice(0,I.length-N.length-1),V=U?U+".":"",q=U?a(P,U).get():P;if((R=c.getTraceValObject(P,z.parts))&&R.impliedEdits&&null!==O)for(var H in R.impliedEdits)S(i.relativeAttr(I,H),R.impliedEdits[H],n);else if("thicknessmode"!==N&&"lenmode"!==N||D===O||"fraction"!==O&&"pixels"!==O||!q){if("type"===I&&("pie"===O!=("pie"===D)||"funnelarea"===O!=("funnelarea"===D))){var G="x",W="y";("bar"===O||"bar"===D)&&"h"===L.orientation&&(G="y",W="x"),i.swapAttrs(L,["?","?src"],"labels",G),i.swapAttrs(L,["d?","?0"],"label",G),i.swapAttrs(L,["?","?src"],"values",W),"pie"===D||"funnelarea"===D?(a(L,"marker.color").set(a(L,"marker.colors").get()),s._pielayer.selectAll("g.trace").remove()):l.traceIs(L,"cartesian")&&a(L,"marker.colors").set(a(L,"marker.color").get())}}else{var Z=s._size,Y=q.orient,X="top"===Y||"bottom"===Y;if("thicknessmode"===N){var $=X?Z.h:Z.w;S(V+"thickness",q.thickness*("fraction"===O?1/$:$),n)}else{var K=X?Z.w:Z.h;S(V+"len",q.len*("fraction"===O?1/K:K),n)}}if(x[I][n]=B(D),-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(I)){if("orientation"===I){z.set(O);var J=L.x&&!L.y?"h":"v";if((z.get()||J)===P.orientation)continue}else"orientationaxes"===I&&(L.orientation={v:"h",h:"v"}[P.orientation]);w.swapXYData(L),y.calc=y.clearAxisTypes=!0}else-1!==u.dataArrayContainers.indexOf(z.parts[0])?(w.manageArrayContainers(z,O,x),y.calc=!0):(R?R.arrayOk&&!l.traceIs(P,"regl")&&(i.isArrayOrTypedArray(O)||i.isArrayOrTypedArray(D))?y.calc=!0:k.update(y,R):y.calc=!0,z.set(O))}if(-1!==["swapxyaxes","orientationaxes"].indexOf(I)&&h.swap(e,r),"orientationaxes"===I){var Q=a(e.layout,"hovermode"),ee=Q.get();"x"===ee?Q.set("y"):"y"===ee?Q.set("x"):"x unified"===ee?Q.set("y unified"):"y unified"===ee&&Q.set("x unified")}if(-1!==["orientation","type"].indexOf(I)){for(o=[],n=0;n<r.length;n++){var te=p[r[n]];l.traceIs(te,"cartesian")&&(b(te.xaxis||"x"),b(te.yaxis||"y"))}S(o.map(T),!0,0),S(o.map(A),[0,1],0)}}else z=m(e.layout,I.replace("LAYOUT","")),x[I]=[B(z.get())],z.set(Array.isArray(F)?F[0]:F),y.calc=!0}return(y.calc||y.plot)&&(y.fullReplot=!0),{flags:y,undoit:x,redoit:v,traces:r,eventData:i.extendDeepNoArrays([],[g,r])}}function V(e,t,r){e=i.getGraphDiv(e),w.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!i.isPlainObject(t))return i.warn("Relayout fail.",t,r),Promise.reject();n=i.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=X(e,n),o=a.flags;o.calc&&(e.calcdata=void 0);var l=[u.previousPromises];o.layoutReplot?l.push(T.layoutReplot):Object.keys(n).length&&(q(e,o,a)||u.supplyDefaults(e),o.legend&&l.push(T.doLegend),o.layoutstyle&&l.push(T.layoutStyles),o.axrange&&H(l,a.rangesAltered),o.ticks&&l.push(T.doTicksRelayout),o.modebar&&l.push(T.doModeBar),o.camera&&l.push(T.doCamera),o.colorbars&&l.push(T.doColorBars),l.push(E)),l.push(u.rehover,u.redrag,u.reselect),s.add(e,V,[e,a.undoit],V,[e,a.redoit]);var c=i.syncOrAsync(l,e);return(!c||!c.then)&&(c=Promise.resolve(e)),c.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function q(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;var o,s,l=function(e,t){return i.coerce(o,s,p,e,t)},c={};for(var u in r.rangesAltered){var d=h.id2name(u);if(o=e.layout[d],s=n[d],f(o,s,l,c),s._matchGroup)for(var m in s._matchGroup)if(m!==u){var g=n[h.id2name(m)];g.autorange=s.autorange,g.range=s.range.slice(),g._input.range=s.range.slice()}}return!0}function H(e,t){var r=t?function(e){var r=[];for(var n in t){var i=h.getFromId(e,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)t[a]||r.push(a)}return h.draw(e,r,{skipTitle:!0})}:function(e){return h.draw(e,"redraw")};e.push(v,T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}var G=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Z=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function X(e,t){var r,n,o,s=e.layout,u=e._fullLayout,f=u._guiEditing,p=j(u._preGUI,f),d=Object.keys(t),m=h.list(e),g=i.extendDeepAll({},t),y={};for(d=Object.keys(t),n=0;n<d.length;n++)if(0===d[n].indexOf("allaxes")){for(o=0;o<m.length;o++){var v=m[o]._id.slice(1),x=-1!==v.indexOf("scene")?v+".":"",b=d[n].replace("allaxes",x+m[o]._name);t[b]||(t[b]=t[d[n]])}delete t[d[n]]}var T=k.layoutFlags(),M={},S={};function E(e,r){if(Array.isArray(e))e.forEach((function(e){E(e,r)}));else if(!(e in t)&&!w.hasParent(t,e)){var n=p(s,e);e in S||(S[e]=B(n.get())),void 0!==r&&n.set(r)}}var C,I={};function L(e){var t=h.name2id(e.split(".")[0]);return I[t]=1,t}for(var P in t){if(w.hasParent(t,P))throw new Error("cannot set "+P+" and a parent attribute simultaneously");for(var z=p(s,P),D=t[P],O=z.parts.length-1;O>0&&"string"!=typeof z.parts[O];)O--;var R=z.parts[O],F=z.parts[O-1]+"."+R,N=z.parts.slice(0,O).join("."),U=a(e.layout,N).get(),V=a(u,N).get(),q=z.get();if(void 0!==D){M[P]=D,S[P]="reverse"===R?D:B(q);var H=c.getLayoutValObject(u,z.parts);if(H&&H.impliedEdits&&null!==D)for(var W in H.impliedEdits)E(i.relativeAttr(P,W),H.impliedEdits[W]);if(-1!==["width","height"].indexOf(P))if(D){E("autosize",null);var X="height"===P?"width":"height";E(X,u[X])}else u[P]=e._initialAutoSize[P];else if("autosize"===P)E("width",D?null:u.width),E("height",D?null:u.height);else if(F.match(G))L(F),a(u,N+"._inputRange").set(null);else if(F.match(Z)){L(F),a(u,N+"._inputRange").set(null);var $=a(u,N).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(Y)&&a(u,N+"._inputDomain").set(null);if("type"===R){C=U;var J="linear"===V.type&&"log"===D,Q="log"===V.type&&"linear"===D;if(J||Q){if(C&&C.range)if(V.autorange)J&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var ee=C.range[0],te=C.range[1];J?(ee<=0&&te<=0&&E(N+".autorange",!0),ee<=0?ee=te/1e6:te<=0&&(te=ee/1e6),E(N+".range[0]",Math.log(ee)/Math.LN10),E(N+".range[1]",Math.log(te)/Math.LN10)):(E(N+".range[0]",Math.pow(10,ee)),E(N+".range[1]",Math.pow(10,te)))}else E(N+".autorange",!0);Array.isArray(u._subplots.polar)&&u._subplots.polar.length&&u[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete u[z.parts[0]]._subplot.viewInitial["radialaxis.range"],l.getComponentMethod("annotations","convertCoords")(e,V,D,E),l.getComponentMethod("images","convertCoords")(e,V,D,E)}else E(N+".autorange",!0),E(N+".range",null);a(u,N+"._inputRange").set(null)}else if(R.match(A)){var re=a(u,P).get(),ne=(D||{}).type;(!ne||"-"===ne)&&(ne="linear"),l.getComponentMethod("annotations","convertCoords")(e,re,ne,E),l.getComponentMethod("images","convertCoords")(e,re,ne,E)}var ie=_.containerArrayMatch(P);if(ie){r=ie.array,n=ie.index;var ae=ie.property,oe=H||{editType:"calc"};""!==n&&""===ae&&(_.isAddVal(D)?S[P]=null:_.isRemoveVal(D)?S[P]=(a(s,r).get()||[])[n]:i.warn("unrecognized full object value",t)),k.update(T,oe),y[r]||(y[r]={});var se=y[r][n];se||(se=y[r][n]={}),se[ae]=D,delete t[P]}else"reverse"===R?(U.range?U.range.reverse():(E(N+".autorange",!0),U.range=[1,0]),V.autorange?T.calc=!0:T.plot=!0):("dragmode"===P&&(!1===D&&!1!==q||!1!==D&&!1===q)||u._has("scatter-like")&&u._has("regl")&&"dragmode"===P&&("lasso"===D||"select"===D)&&"lasso"!==q&&"select"!==q?T.plot=!0:H?k.update(T,H):T.calc=!0,z.set(D))}}for(r in y)_.applyContainerArrayChanges(e,p(s,r),y[r],T,p)||(T.plot=!0);for(var le in I){var ce=(C=h.getFromId(e,le))&&C._constraintGroup;if(ce)for(var ue in T.calc=!0,ce)I[ue]||(h.getFromId(e,ue)._constraintShrinkable=!0)}(K(e)||t.height||t.width)&&(T.plot=!0);var he=u.shapes;for(n=0;n<he.length;n++)if(he[n].showlegend){T.calc=!0;break}return(T.plot||T.calc)&&(T.layoutReplot=!0),{flags:T,rangesAltered:I,undoit:S,redoit:M,eventData:g}}function K(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&u.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function J(t,r,n,a){t=i.getGraphDiv(t),w.clearPromiseQueue(t),i.isPlainObject(r)||(r={}),i.isPlainObject(n)||(n={}),Object.keys(r).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var o=w.coerceTraceIndices(t,a),l=U(t,i.extendFlat({},r),o),c=l.flags,h=X(t,i.extendFlat({},n)),f=h.flags;(c.calc||f.calc)&&(t.calcdata=void 0),c.clearAxisTypes&&w.clearAxisTypes(t,o,n);var p=[];f.layoutReplot?p.push(T.layoutReplot):c.fullReplot?p.push(e._doPlot):(p.push(u.previousPromises),q(t,f,h)||u.supplyDefaults(t),c.style&&p.push(T.doTraceStyle),(c.colorbars||f.colorbars)&&p.push(T.doColorBars),f.legend&&p.push(T.doLegend),f.layoutstyle&&p.push(T.layoutStyles),f.axrange&&H(p,h.rangesAltered),f.ticks&&p.push(T.doTicksRelayout),f.modebar&&p.push(T.doModeBar),f.camera&&p.push(T.doCamera),p.push(E)),p.push(u.rehover,u.redrag,u.reselect),s.add(t,J,[t,l.undoit,h.undoit,l.traces],J,[t,l.redoit,h.redoit,l.traces]);var d=i.syncOrAsync(p,t);return(!d||!d.then)&&(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:l.eventData,layout:h.eventData}),t}))}function Q(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var ee=[{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"}],te=[{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 re(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=e.match(n.pattern);if(i){var a=i[1]||"";return{head:a,tail:e.slice(a.length+1),attr:n.attr}}}}function ne(e,t){var r=a(t,e).get();if(void 0!==r)return r;var n=e.split(".");for(n.pop();n.length>1;)if(n.pop(),void 0!==(r=a(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ie(e,t){for(var r=0;r<t.length;r++)if(t[r]._fullInput.uid===e)return r;return-1}function ae(e,t,r){for(var n=0;n<t.length;n++)if(t[n].uid===e)return n;return!t[r]||t[r].uid?-1:r}function oe(e,t){var r=i.isPlainObject(e),n=Array.isArray(e);return r||n?(r&&i.isPlainObject(t)||n&&Array.isArray(t))&&JSON.stringify(e)===JSON.stringify(t):e===t}function se(e,t,r,n){var a,o,s,l=n.getValObject,c=n.flags,u=n.immutable,h=n.inArray,f=n.arrayIndex;function p(){var e=a.editType;h&&-1!==e.indexOf("arraydraw")?i.pushUnique(c.arrays[h],f):(k.update(c,a),"none"!==e&&c.nChanges++,n.transition&&a.anim&&c.nChangesAnim++,(G.test(s)||Z.test(s))&&(c.rangesAltered[r[0]]=1),"datarevision"===o&&(c.newDataRevision=1))}function d(e){return"data_array"===e.valType||e.arrayOk}for(o in e){if(c.calc&&!n.transition)return;var m=e[o],g=t[o],y=r.concat(o);if(s=y.join("."),"_"!==o.charAt(0)&&"function"!=typeof m&&m!==g){if(("tick0"===o||"dtick"===o)&&"geo"!==r[0]){var v=t.tickmode;if("auto"===v||"array"===v||!v)continue}if(("range"!==o||!t.autorange)&&("zmin"!==o&&"zmax"!==o||"contourcarpet"!==t.type)&&(a=l(y))&&(!a._compareAsJSON||JSON.stringify(m)!==JSON.stringify(g))){var x,_=a.valType,b=d(a),w=Array.isArray(m),T=Array.isArray(g);if(w&&T){var A="_input_"+o,M=e[A],S=t[A];if(Array.isArray(M)&&M===S)continue}if(void 0===g)b&&w?c.calc=!0:p();else if(a._isLinkedToArray){var E=[],C=!1;h||(c.arrays[o]=E);var I=Math.min(m.length,g.length),L=Math.max(m.length,g.length);if(I!==L){if("arraydraw"!==a.editType){p();continue}C=!0}for(x=0;x<I;x++)se(m[x],g[x],y.concat(x),i.extendFlat({inArray:o,arrayIndex:x},n));if(C)for(x=I;x<L;x++)E.push(x)}else!_&&i.isPlainObject(m)?se(m,g,y,n):b?w&&T?(u&&(c.calc=!0),(u||n.newDataRevision)&&p()):w!==T?c.calc=!0:p():w&&T?(m.length!==g.length||String(m)!==String(g))&&p():p()}}}for(o in t)if(!(o in e)&&"_"!==o.charAt(0)&&"function"!=typeof t[o]){if(d(a=l(r.concat(o)))&&Array.isArray(t[o]))return void(c.calc=!0);p()}}function le(e){var t=e._fullLayout,r=e.getBoundingClientRect();if(!i.equalDomRects(r,t._lastBBox)){var n=t._invTransform=i.inverseTransformMatrix(i.getFullTransformMatrix(e));t._invScaleX=Math.sqrt(n[0][0]*n[0][0]+n[0][1]*n[0][1]+n[0][2]*n[0][2]),t._invScaleY=Math.sqrt(n[1][0]*n[1][0]+n[1][1]*n[1][1]+n[1][2]*n[1][2]),t._lastBBox=r}}e.animate=function(e,t,r){if(e=i.getGraphDiv(e),!i.isPlotDiv(e))throw new 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 n=e._transitionData;n._frameQueue||(n._frameQueue=[]);var a=(r=u.supplyAnimationDefaults(r)).transition,o=r.frame;function s(e){return Array.isArray(a)?e>=a.length?a[0]:a[e]:a}function l(e){return Array.isArray(o)?e>=o.length?o[0]:o[e]:o}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(o,h){var f=0;function p(e){return Array.isArray(a)?f>=a.length?e.transitionOpts=a[f]:e.transitionOpts=a[0]:e.transitionOpts=a,f++,e}var d,m,g=[],y=null==t,v=Array.isArray(t);if(y||v||!i.isPlainObject(t)){if(y||-1!==["string","number"].indexOf(typeof t))for(d=0;d<n._frames.length;d++)(m=n._frames[d])&&(y||String(m.group)===String(t))&&g.push({type:"byname",name:String(m.name),data:p({name:m.name})});else if(v)for(d=0;d<t.length;d++){var x=t[d];-1!==["number","string"].indexOf(typeof x)?(x=String(x),g.push({type:"byname",name:x,data:p({name:x})})):i.isPlainObject(x)&&g.push({type:"object",data:p(i.extendFlat({},x))})}}else g.push({type:"object",data:p(i.extendFlat({},t))});for(d=0;d<g.length;d++)if("byname"===(m=g[d]).type&&!n._frameHash[m.data.name])return i.warn('animate failure: frame not found: "'+m.data.name+'"'),void h();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var t=n._frameQueue.pop();t.onInterrupt&&t.onInterrupt()}e.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&g.reverse();var _=e._fullLayout._currentFrame;if(_&&r.fromcurrent){var b=-1;for(d=0;d<g.length;d++)if("byname"===(m=g[d]).type&&m.name===_){b=d;break}if(b>0&&b<g.length-1){var T=[];for(d=0;d<g.length;d++)m=g[d],("byname"!==g[d].type||d>b)&&T.push(m);g=T}}g.length>0?function(t){if(0!==t.length){for(var i=0;i<t.length;i++){var a;a="byname"===t[i].type?u.computeFrame(e,t[i].name):t[i].data;var f=l(i),p=s(i);p.duration=Math.min(p.duration,f.duration);var d={frame:a,name:t[i].name,frameOpts:f,transitionOpts:p};i===t.length-1&&(d.onComplete=c(o,2),d.onInterrupt=h),n._frameQueue.push(d)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||function(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,u.transition(e,t.frame.data,t.frame.layout,w.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};t()}()}}(g):(e.emit("plotly_animated"),o())}))},e.addFrames=function(e,t,r){if(e=i.getGraphDiv(e),null==t)return Promise.resolve();if(!i.isPlotDiv(e))throw new 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 n,a,o,l,c=e._transitionData._frames,h=e._transitionData._frameHash;if(!Array.isArray(t))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+t);var f=c.length+2*t.length,p=[],d={};for(n=t.length-1;n>=0;n--)if(i.isPlainObject(t[n])){var m=t[n].name,g=(h[m]||d[m]||{}).name,y=t[n].name,v=h[g]||d[g];g&&y&&"number"==typeof y&&v&&S<5&&(S++,i.warn('addFrames: overwriting frame "'+(h[g]||d[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.'),5===S&&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.")),d[m]={name:m},p.push({frame:u.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index<t.index?1:0}));var x=[],_=[],b=c.length;for(n=p.length-1;n>=0;n--){if("number"==typeof(a=p[n].frame).name&&i.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;h[a.name="frame "+e._transitionData._counter++];);if(h[a.name]){for(o=0;o<c.length&&(c[o]||{}).name!==a.name;o++);x.push({type:"replace",index:o,value:a}),_.unshift({type:"replace",index:o,value:c[o]})}else l=Math.max(0,Math.min(p[n].index,b)),x.push({type:"insert",index:l,value:a}),_.unshift({type:"delete",index:l}),b++}var w=u.modifyFrames,T=u.modifyFrames,k=[e,_],A=[e,x];return s&&s.add(e,w,k,T,A),u.modifyFrames(e,x)},e.deleteFrames=function(e,t){if(e=i.getGraphDiv(e),!i.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e);var r,n,a=e._transitionData._frames,o=[],l=[];if(!t)for(t=[],r=0;r<a.length;r++)t.push(r);for((t=t.slice()).sort(),r=t.length-1;r>=0;r--)n=t[r],o.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var c=u.modifyFrames,h=u.modifyFrames,f=[e,l],p=[e,o];return s&&s.add(e,c,f,h,p),u.modifyFrames(e,o)},e.addTraces=function t(r,n,a){r=i.getGraphDiv(r);var o,l,c=[],u=e.deleteTraces,h=t,f=[r,c],p=[r,n];for(function(e,t,r){var n,i;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(typeof t>"u")throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n<t.length;n++)if("object"!=typeof(i=t[n])||Array.isArray(i)||null===i)throw new Error("all values in traces array must be non-array objects");if(typeof r<"u"&&!Array.isArray(r)&&(r=[r]),typeof r<"u"&&r.length!==t.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(r,n,a),Array.isArray(n)||(n=[n]),n=n.map((function(e){return i.extendFlat({},e)})),w.cleanData(n),o=0;o<n.length;o++)r.data.push(n[o]);for(o=0;o<n.length;o++)c.push(-n.length+o);if(typeof a>"u")return l=e.redraw(r),s.add(r,u,f,h,p),l;Array.isArray(a)||(a=[a]);try{D(r,c,a)}catch(e){throw r.data.splice(r.data.length-n.length,n.length),e}return s.startSequence(r),s.add(r,u,f,h,p),l=e.moveTraces(r,c,a),s.stopSequence(r),l},e.deleteTraces=function t(r,n){r=i.getGraphDiv(r);var a,o,l=[],c=e.addTraces,u=t,h=[r,l,n],f=[r,n];if(typeof n>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),z(r,n,"indices"),(n=P(n,r.data.length-1)).sort(i.sorterDes),a=0;a<n.length;a+=1)o=r.data.splice(n[a],1)[0],l.push(o);var p=e.redraw(r);return s.add(r,c,h,u,f),p},e.extendTraces=function t(r,n,a,o){var l=O(r=i.getGraphDiv(r),n,a,o,(function(e,t,r){var n,a;if(i.isTypedArray(e))if(r<0){var o=new e.constructor(0),s=R(e,t);r<0?(n=s,a=o):(n=o,a=s)}else if(n=new e.constructor(r),a=new e.constructor(e.length+t.length-r),r===t.length)n.set(t),a.set(e);else if(r<t.length){var l=t.length-r;n.set(t.subarray(l)),a.set(e),a.set(t.subarray(0,l),e.length)}else{var c=r-t.length,u=e.length-c;n.set(e.subarray(u)),n.set(t,c),a.set(e.subarray(0,u))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]})),c=e.redraw(r),u=[r,l.update,a,l.maxPoints];return s.add(r,e.prependTraces,u,t,arguments),c},e.moveTraces=function t(r,n,a){var o,l=[],c=[],u=t,h=t,f=[r=i.getGraphDiv(r),a,n],p=[r,n,a];if(D(r,n,a),n=Array.isArray(n)?n:[n],typeof a>"u")for(a=[],o=0;o<n.length;o++)a.push(-n.length+o);for(a=Array.isArray(a)?a:[a],n=P(n,r.data.length-1),a=P(a,r.data.length-1),o=0;o<r.data.length;o++)-1===n.indexOf(o)&&l.push(r.data[o]);for(o=0;o<n.length;o++)c.push({newIndex:a[o],trace:r.data[n[o]]});for(c.sort((function(e,t){return e.newIndex-t.newIndex})),o=0;o<c.length;o+=1)l.splice(c[o].newIndex,0,c[o].trace);r.data=l;var d=e.redraw(r);return s.add(r,u,f,h,p),d},e.prependTraces=function t(r,n,a,o){var l=O(r=i.getGraphDiv(r),n,a,o,(function(e,t,r){var n,a;if(i.isTypedArray(e))if(r<=0){var o=new e.constructor(0),s=R(t,e);r<0?(n=s,a=o):(n=o,a=s)}else if(n=new e.constructor(r),a=new e.constructor(e.length+t.length-r),r===t.length)n.set(t),a.set(e);else if(r<t.length){var l=t.length-r;n.set(t.subarray(0,l)),a.set(t.subarray(l)),a.set(e,l)}else{var c=r-t.length;n.set(t),n.set(e.subarray(0,c),t.length),a.set(e.subarray(c))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]})),c=e.redraw(r),u=[r,l.update,a,l.maxPoints];return s.add(r,e.extendTraces,u,t,arguments),c},e.newPlot=function(t,r,n,a){return t=i.getGraphDiv(t),u.cleanPlot([],{},t._fullData||[],t._fullLayout||{}),u.purge(t),e._doPlot(t,r,n,a)},e._doPlot=function(r,n,a,s){var c;if(r=i.getGraphDiv(r),o.init(r),i.isPlainObject(n)){var f=n;n=f.data,a=f.layout,s=f.config,c=f.frames}if(!1===o.triggerHandler(r,"plotly_beforeplot",[n,a,s]))return Promise.reject();!n&&!a&&!i.isPlotDiv(r)&&i.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",r),L(r,s),a||(a={}),t.select(r).classed("js-plotly-plot",!0),d.makeTester(),Array.isArray(r._promises)||(r._promises=[]);var p=0===(r.data||[]).length&&Array.isArray(n);Array.isArray(n)&&(w.cleanData(n),p?r.data=n:r.data.push.apply(r.data,n),r.empty=!1),(!r.layout||p)&&(r.layout=w.cleanLayout(a)),u.supplyDefaults(r);var m=r._fullLayout,v=m._has("cartesian");m._replotting=!0,(p||m._shouldCreateBgLayer)&&(function(e){var r=t.select(e),n=e._fullLayout;if(n._calcInverseTransform=le,n._calcInverseTransform(e),n._container=r.selectAll(".plot-container").data([0]),n._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),n._paperdiv=n._container.selectAll(".svg-container").data([0]),n._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),n._glcontainer=n._paperdiv.selectAll(".gl-container").data([{}]),n._glcontainer.enter().append("div").classed("gl-container",!0),n._paperdiv.selectAll(".main-svg").remove(),n._paperdiv.select(".modebar-container").remove(),n._paper=n._paperdiv.insert("svg",":first-child").classed("main-svg",!0),n._toppaper=n._paperdiv.append("svg").classed("main-svg",!0),n._modebardiv=n._paperdiv.append("div"),delete n._modeBar,n._hoverpaper=n._paperdiv.append("svg").classed("main-svg",!0),!n._uid){var a={};t.selectAll("defs").each((function(){this.id&&(a[this.id.split("-")[1]]=1)})),n._uid=i.randstr(a)}n._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),n._defs=n._paper.append("defs").attr("id","defs-"+n._uid),n._clips=n._defs.append("g").classed("clips",!0),n._topdefs=n._toppaper.append("defs").attr("id","topdefs-"+n._uid),n._topclips=n._topdefs.append("g").classed("clips",!0),n._bgLayer=n._paper.append("g").classed("bglayer",!0),n._draggers=n._paper.append("g").classed("draglayer",!0);var o=n._paper.append("g").classed("layer-below",!0);n._imageLowerLayer=o.append("g").classed("imagelayer",!0),n._shapeLowerLayer=o.append("g").classed("shapelayer",!0),n._cartesianlayer=n._paper.append("g").classed("cartesianlayer",!0),n._polarlayer=n._paper.append("g").classed("polarlayer",!0),n._smithlayer=n._paper.append("g").classed("smithlayer",!0),n._ternarylayer=n._paper.append("g").classed("ternarylayer",!0),n._geolayer=n._paper.append("g").classed("geolayer",!0),n._funnelarealayer=n._paper.append("g").classed("funnelarealayer",!0),n._pielayer=n._paper.append("g").classed("pielayer",!0),n._iciclelayer=n._paper.append("g").classed("iciclelayer",!0),n._treemaplayer=n._paper.append("g").classed("treemaplayer",!0),n._sunburstlayer=n._paper.append("g").classed("sunburstlayer",!0),n._indicatorlayer=n._toppaper.append("g").classed("indicatorlayer",!0),n._glimages=n._paper.append("g").classed("glimages",!0);var s=n._toppaper.append("g").classed("layer-above",!0);n._imageUpperLayer=s.append("g").classed("imagelayer",!0),n._shapeUpperLayer=s.append("g").classed("shapelayer",!0),n._selectionLayer=n._toppaper.append("g").classed("selectionlayer",!0),n._infolayer=n._toppaper.append("g").classed("infolayer",!0),n._menulayer=n._toppaper.append("g").classed("menulayer",!0),n._zoomlayer=n._toppaper.append("g").classed("zoomlayer",!0),n._hoverlayer=n._hoverpaper.append("g").classed("hoverlayer",!0),n._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),e.emit("plotly_framework")}(r),m._shouldCreateBgLayer&&delete m._shouldCreateBgLayer),d.initGradients(r),d.initPatterns(r),p&&h.saveShowSpikeInitial(r);var x=!r.calcdata||r.calcdata.length!==(r._fullData||[]).length;x&&u.doCalcdata(r);for(var _=0;_<r.calcdata.length;_++)r.calcdata[_][0].trace=r._fullData[_];r._context.responsive?r._responsiveChartHandler||(r._responsiveChartHandler=function(){i.isHidden(r)||u.resize(r)},window.addEventListener("resize",r._responsiveChartHandler)):i.clearResponsive(r);var b=i.extendFlat({},m._size),k=0;function A(){if(u.clearAutoMarginIds(r),T.drawMarginPushers(r),h.allowAutoMargin(r),r._fullLayout.title.text&&r._fullLayout.title.automargin&&u.allowAutoMargin(r,"title.automargin"),m._has("pie"))for(var e=r._fullData,t=0;t<e.length;t++){var n=e[t];"pie"===n.type&&n.automargin&&u.allowAutoMargin(r,"pie."+n.uid+".automargin")}return u.doAutoMargin(r),u.previousPromises(r)}function M(){r._transitioning||(T.doAutoRangeAndConstraints(r),p&&h.saveRangeInitial(r),l.getComponentMethod("rangeslider","calcAutorange")(r))}var S=[u.previousPromises,function(){if(c)return e.addFrames(r,c)},function e(){for(var t=m._basePlotModules,n=0;n<t.length;n++)t[n].drawFramework&&t[n].drawFramework(r);!m._glcanvas&&m._has("gl")&&(m._glcanvas=m._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})),m._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 a=r._context.plotGlPixelRatio;if(m._glcanvas){m._glcanvas.attr("width",m.width*a).attr("height",m.height*a).style("width",m.width+"px").style("height",m.height+"px");var o=m._glcanvas.data()[0].regl;if(o&&(Math.floor(m.width*a)!==o._gl.drawingBufferWidth||Math.floor(m.height*a)!==o._gl.drawingBufferHeight)){var s="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(!k)return i.log(s+" Clearing graph and plotting again."),u.cleanPlot([],{},r._fullData,m),u.supplyDefaults(r),m=r._fullLayout,u.doCalcdata(r),k++,e();i.error(s)}}return"h"===m.modebar.orientation?m._modebardiv.style("height",null).style("width","100%"):m._modebardiv.style("width",null).style("height",m.height+"px"),u.previousPromises(r)},A,function(){if(u.didMarginChange(b,m._size))return i.syncOrAsync([A,T.layoutStyles],r)}];v&&S.push((function(){if(x)return i.syncOrAsync([l.getComponentMethod("shapes","calcAutorange"),l.getComponentMethod("annotations","calcAutorange"),M],r);M()})),S.push(T.layoutStyles),v&&S.push((function(){return h.draw(r,p?"":"redraw")}),(function(e){var t=e._fullLayout._insideTickLabelsUpdaterange;if(t)return e._fullLayout._insideTickLabelsUpdaterange=void 0,V(e,t).then((function(){h.saveRangeInitial(e,!0)}))})),S.push(T.drawData,T.finalDraw,g,u.addLinks,u.rehover,u.redrag,u.reselect,u.doAutoMargin,u.previousPromises);var C=i.syncOrAsync(S,r);return(!C||!C.then)&&(C=Promise.resolve()),C.then((function(){return E(r),r}))},e.purge=function(e){var t=(e=i.getGraphDiv(e))._fullLayout||{},r=e._fullData||[];return u.cleanPlot([],{},r,t),u.purge(e),o.purge(e),t._container&&t._container.remove(),delete e._context,e},e.react=function(t,r,n,o){var s,h;t=i.getGraphDiv(t),w.clearPromiseQueue(t);var f=t._fullData,p=t._fullLayout;if(i.isPlotDiv(t)&&f&&p){if(i.isPlainObject(r)){var d=r;r=d.data,n=d.layout,o=d.config,s=d.frames}var m=!1;if(o){let e=i.extendDeepAll({},t._context);t._context=void 0,L(t,o),m=!w.collectionsAreEqual(e,t._context)}if(m){let i=t._ev.eventNames().map((e=>[e,t._ev.listeners(e)]));h=e.newPlot(t,r,n,o).then((()=>{for(let[e,r]of i)r.forEach((r=>t.on(e,r)));return e.react(t,r,n,o)}))}else{t.data=r||[],w.cleanData(t.data),t.layout=n||{},w.cleanLayout(t.layout),function(e,t,r,n){var o,s,l,c,u,h,f,p,d,m,g=n._preGUI,y=[],v={},x={};for(o in g){if(u=re(o,ee)){if(d=u.head,m=u.tail,s=u.attr||d+".uirevision",(c=(l=a(n,s).get())&&ne(s,t))&&c===l){if(null===(h=g[o])&&(h=void 0),oe(p=(f=a(t,o)).get(),h)){void 0===p&&"autorange"===m&&y.push(d),f.set(B(a(n,o).get()));continue}if("autorange"===m||"range["===m.slice(0,6)){var _=g[d+".range[0]"],b=g[d+".range[1]"],w=g[d+".autorange"];if(w||null===w&&null===_&&null===b){if(!(d in v)){var T=a(t,d).get();v[d]=T&&(T.autorange||!1!==T.autorange&&(!T.range||2!==T.range.length))}if(v[d]){f.set(B(a(n,o).get()));continue}}}}}else i.warn("unrecognized GUI edit: "+o);delete g[o],u&&"range["===u.tail.slice(0,6)&&(x[u.head]=1)}for(var k=0;k<y.length;k++){var A=y[k];if(x[A]){var M=a(t,A).get();M&&delete M.autorange}}var S=n._tracePreGUI;for(var E in S){var C,I=S[E],L=null;for(o in I){if(!L){var P=ie(E,r);if(P<0){delete S[E];break}var z=ae(E,e,(C=r[P]._fullInput).index);if(z<0){delete S[E];break}L=e[z]}if(u=re(o,te)){if(u.attr?c=(l=a(n,u.attr).get())&&ne(u.attr,t):(l=C.uirevision,void 0===(c=L.uirevision)&&(c=t.uirevision)),c&&c===l&&(null===(h=I[o])&&(h=void 0),oe(p=(f=a(L,o)).get(),h))){f.set(B(a(C,o).get()));continue}}else i.warn("unrecognized GUI edit: "+o+" in trace uid "+E);delete I[o]}}}(t.data,t.layout,f,p),u.supplyDefaults(t,{skipUpdateCalc:!0});var g=t._fullData,y=t._fullLayout,v=void 0===y.datarevision,x=y.transition,_=function(e,t,r,n,i){var a=k.layoutFlags();for(var o in a.arrays={},a.rangesAltered={},a.nChanges=0,a.nChangesAnim=0,r)if((o.startsWith("xaxis")||o.startsWith("yaxis"))&&t[o]){var s=r[o].domain,l=t[o].domain,u=t[o]._inputDomain;t[o]._inputDomain&&(s[0]===u[0]&&s[1]===u[1]?r[o].domain=t[o].domain:(s[0]!==l[0]||s[1]!==l[1])&&(r[o]._inputDomain=null))}var h={getValObject:function(e){return c.getLayoutValObject(r,e)},flags:a,immutable:n,transition:i,gd:e};return se(t,r,[],h),(a.plot||a.calc)&&(a.layoutReplot=!0),i&&a.nChanges&&a.nChangesAnim&&(a.anim=a.nChanges===a.nChangesAnim?"all":"some"),a}(t,p,y,v,x),b=_.newDataRevision,A=function(e,t,r,n,i,a){var o=t.length===r.length;if(!i&&!o)return{fullReplot:!0,calc:!0};var s,l,u=k.traceFlags();u.arrays={},u.nChanges=0,u.nChangesAnim=0;var h={getValObject:function(e){var t=c.getTraceValObject(l,e);return!l._module.animatable&&t.anim&&(t.anim=!1),t},flags:u,immutable:n,transition:i,newDataRevision:a,gd:e},f={};for(s=0;s<t.length;s++)if(r[s]){if(f[(l=r[s]._fullInput).uid])continue;f[l.uid]=1,se(t[s]._fullInput,l,[],h)}return(u.calc||u.plot)&&(u.fullReplot=!0),i&&u.nChanges&&u.nChangesAnim&&(u.anim=u.nChanges===u.nChangesAnim&&o?"all":"some"),u}(t,f,g,v,x,b);if(K(t)&&(_.layoutReplot=!0),A.calc||_.calc){t.calcdata=void 0;for(var M=Object.getOwnPropertyNames(y),S=0;S<M.length;S++){var C=M[S],I=C.substring(0,5);if("xaxis"===I||"yaxis"===I){var P=y[C]._emptyCategories;P&&P()}}}else u.supplyDefaultsUpdateCalc(t.calcdata,g);var z=[];if(s&&(t._transitionData={},u.createTransitionData(t),z.push((function(){return e.addFrames(t,s)}))),y.transition&&(A.anim||_.anim))_.ticks&&z.push(T.doTicksRelayout),u.doCalcdata(t),T.doAutoRangeAndConstraints(t),z.push((function(){return u.transitionFromReact(t,A,_,p)}));else if(A.fullReplot||_.layoutReplot)t._fullLayout._skipDefaults=!0,z.push(e._doPlot);else{for(var D in _.arrays){var O=_.arrays[D];if(O.length){var R=l.getComponentMethod(D,"drawOne");if(R!==i.noop)for(var F=0;F<O.length;F++)R(t,O[F]);else{var j=l.getComponentMethod(D,"draw");if(j===i.noop)throw new Error("cannot draw components: "+D);j(t)}}}z.push(u.previousPromises),A.style&&z.push(T.doTraceStyle),(A.colorbars||_.colorbars)&&z.push(T.doColorBars),_.legend&&z.push(T.doLegend),_.layoutstyle&&z.push(T.layoutStyles),_.axrange&&H(z),_.ticks&&z.push(T.doTicksRelayout),_.modebar&&z.push(T.doModeBar),_.camera&&z.push(T.doCamera),z.push(E)}z.push(u.rehover,u.redrag,u.reselect),(!(h=i.syncOrAsync(z,t))||!h.then)&&(h=Promise.resolve(t))}}else h=e.newPlot(t,r,n,o);return h.then((()=>(m||t.emit("plotly_react",{config:o,data:r,layout:n}),t)))},e.redraw=function(t){if(t=i.getGraphDiv(t),!i.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return w.cleanData(t.data),w.cleanLayout(t.layout),t.calcdata=void 0,e._doPlot(t).then((function(){return t.emit("plotly_redraw"),t}))},e.relayout=V,e.restyle=F,e.setPlotConfig=function(e){return i.extendFlat(x,e)},e.update=J,e._guiRelayout=Q(V),e._guiRestyle=Q(F),e._guiUpdate=Q(J),e._storeDirectGUIEdit=function(e,t,r){for(var n in r)N(n,a(e,n).get(),r[n],t)}}}),Rn=m({"src/snapshot/helpers.js"(e){var t=He();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 r=window.URL||window.webkitURL;e.createObjectURL=function(e){return r.createObjectURL(e)},e.revokeObjectURL=function(e){return r.revokeObjectURL(e)},e.createBlob=function(e,t){if("svg"===t)return new window.Blob([e],{type:"image/svg+xml;charset=utf-8"});if("full-json"===t)return new window.Blob([e],{type:"application/json;charset=utf-8"});var r=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i<t;i++)n[i]=e.charCodeAt(i);return r}(window.atob(e));return new window.Blob([r],{type:"image/"+t})},e.octetStream=function(e){document.location.href="data:application/octet-stream"+e},e.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/}}),Fn=m({"src/snapshot/tosvg.js"(e,t){var r=b(),n=(ct(),er()),i=W(),a=(Mt(),/"/g),o="TOBESTRIPPED",s=new RegExp('("'+o+")|("+o+'")',"g");t.exports=function(e,t,l){var c,u=e._fullLayout,h=u._paper,f=u._toppaper,p=u.width,d=u.height;h.insert("rect",":first-child").call(n.setRect,0,0,p,d).call(i.fill,u.paper_bgcolor);var m=u._basePlotModules||[];for(c=0;c<m.length;c++){var g=m[c];g.toSVG&&g.toSVG(e)}if(f){var y=f.node().childNodes,v=Array.prototype.slice.call(y);for(c=0;c<v.length;c++){var x=v[c];x.childNodes.length&&h.node().appendChild(x)}}u._draggers&&u._draggers.remove(),h.node().style.background="",h.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each((function(){var e=r.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){e.style({visibility:null,display:null});var t=this.style.fontFamily;t&&-1!==t.indexOf('"')&&e.style("font-family",t.replace(a,o));var n=this.style.fontWeight;n&&("normal"===n||"400"===n)&&e.style("font-weight",void 0);var i=this.style.fontStyle;i&&"normal"===i&&e.style("font-style",void 0);var s=this.style.fontVariant;s&&"normal"===s&&e.style("font-variant",void 0)}else e.remove()})),h.selectAll(".gradient_filled,.pattern_filled").each((function(){var e=r.select(this),t=this.style.fill;t&&-1!==t.indexOf("url(")&&e.style("fill",t.replace(a,o));var n=this.style.stroke;n&&-1!==n.indexOf("url(")&&e.style("stroke",n.replace(a,o))})),("pdf"===t||"eps"===t)&&h.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),"svg"===t&&l&&(h.attr("width",l*p),h.attr("height",l*d),h.attr("viewBox","0 0 "+p+" "+d));var _=(new window.XMLSerializer).serializeToString(h.node());return _=function(e){var t=r.select("body").append("div").style({display:"none"}).html(""),n=e.replace(/(&[^;]*;)/gi,(function(e){return"<"===e?"<":"&rt;"===e?">":-1!==e.indexOf("<")||-1!==e.indexOf(">")?"":t.html(e).text()}));return t.remove(),n}(_),(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(s,"'")}}}),Bn=m({"src/snapshot/svgtoimg.js"(e,t){var r=ct(),n=pt().EventEmitter,i=Rn();t.exports=function(e){var t=e.emitter||new n,a=new Promise((function(n,a){var o,s,l=window.Image,c=e.svg,u=e.format||"png",h=e.canvas,f=e.scale||1,p=e.width||300,d=e.height||150,m=f*p,g=f*d,y=h.getContext("2d",{willReadFrequently:!0}),v=new l;"svg"===u||r.isSafari()?s=i.encodeSVG(c):(o=i.createBlob(c,"svg"),s=i.createObjectURL(o)),h.width=m,h.height=g,v.onload=function(){var r;switch(o=null,i.revokeObjectURL(s),"svg"!==u&&y.drawImage(v,0,0,m,g),u){case"jpeg":r=h.toDataURL("image/jpeg");break;case"png":r=h.toDataURL("image/png");break;case"webp":r=h.toDataURL("image/webp");break;case"svg":r=s;break;default:var l="Image format is not jpeg, png, svg or webp.";if(a(new Error(l)),!e.promise)return t.emit("error",l)}n(r),e.promise||t.emit("success",r)},v.onerror=function(r){if(o=null,i.revokeObjectURL(s),a(r),!e.promise)return t.emit("error",r)},v.src=s}));return e.promise?a:t}}}),jn=m({"src/plot_api/to_image.js"(e,t){var r=M(),n=On(),i=At(),a=ct(),o=Rn(),s=Fn(),l=Bn(),c=x().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}};t.exports=function(e,t){var h,f,p,d;function m(e){return!(e in t)||a.validate(t[e],u[e])}if(t=t||{},a.isPlainObject(e)?(h=e.data||[],f=e.layout||{},p=e.config||{},d={}):(e=a.getGraphDiv(e),h=a.extendDeep([],e.data),f=a.extendDeep({},e.layout),p=e._context,d=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+a.join2(u.format.values,", "," or ")+".");var g={};function y(e,r){return a.coerce(t,g,u,e,r)}var v=y("format"),x=y("width"),_=y("height"),b=y("scale"),w=y("setBackground"),T=y("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=a.extendFlat({},f);x?A.width=x:null===t.width&&r(d.width)&&(A.width=d.width),_?A.height=_:null===t.height&&r(d.height)&&(A.height=d.height);var M=a.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=o.getRedrawFunc(k);function E(){return new Promise((function(e){setTimeout(e,o.getDelay(k._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(k,v,b),u=k._fullLayout.width,h=k._fullLayout.height;function f(){n.purge(k),document.body.removeChild(k)}if("full-json"===v){var p=i.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=c,p=JSON.stringify(p),f(),e(T?p:o.encodeJSON(p))}if(f(),"svg"===v)return e(T?r:o.encodeSVG(r));var d=document.createElement("canvas");d.id=a.randstr(),l({format:v,width:u,height:h,scale:b,canvas:d,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){n.newPlot(k,h,A,M).then(S).then(E).then(C).then((function(t){e(function(e){return T?e.replace(o.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}}}),Nn=m({"src/plot_api/validate.js"(e,t){var r=ct(),n=At(),i=yt(),a=$().dfltConfig,o=r.isPlainObject,s=Array.isArray,l=r.isArrayOrTypedArray;function c(e,t,n,i,a,u){u=u||[];for(var h=Object.keys(e),m=0;m<h.length;m++){var g=h[m],y=u.slice();y.push(g);var v=e[g],x=t[g],_=d(n,g),b=(_||{}).valType,w="info_array"===b,T="colorscale"===b,k=(_||{}).items;if(p(n,g))if(o(v)&&o(x)&&"any"!==b)c(v,x,_,i,a,y);else if(w&&s(v)){v.length>x.length&&i.push(f("unused",a,y.concat(x.length)));var A,M,S,E,C,I=x.length,L=Array.isArray(k);if(L&&(I=Math.min(I,k.length)),2===_.dimensions)for(M=0;M<I;M++)if(s(v[M])){v[M].length>x[M].length&&i.push(f("unused",a,y.concat(M,x[M].length)));var P=x[M].length;for(A=0;A<(L?Math.min(P,k[M].length):P);A++)S=L?k[M][A]:k,E=v[M][A],C=x[M][A],r.validate(E,S)?C!==E&&C!==+E&&i.push(f("dynamic",a,y.concat(M,A),E,C)):i.push(f("value",a,y.concat(M,A),E))}else i.push(f("array",a,y.concat(M),v[M]));else for(M=0;M<I;M++)S=L?k[M]:k,E=v[M],C=x[M],r.validate(E,S)?C!==E&&C!==+E&&i.push(f("dynamic",a,y.concat(M),E,C)):i.push(f("value",a,y.concat(M),E))}else if(_.items&&!w&&s(v)){var z,D,O=k[Object.keys(k)[0]],R=[];for(z=0;z<x.length;z++){var F=x[z]._index||z;if((D=y.slice()).push(F),o(v[F])&&o(x[z])){R.push(F);var B=v[F],j=x[z];o(B)&&!1!==B.visible&&!1===j.visible?i.push(f("invisible",a,D)):c(B,j,O,i,a,D)}}for(z=0;z<v.length;z++)(D=y.slice()).push(z),o(v[z])?-1===R.indexOf(z)&&i.push(f("unused",a,D)):i.push(f("object",a,D,v[z]))}else!o(v)&&o(x)?i.push(f("object",a,y,v)):l(v)||!l(x)||w||T?g in t?r.validate(v,_)?"enumerated"===_.valType&&(_.coerceNumber&&v!==+x||!l(v)&&v!==x||String(v)!==String(x))&&i.push(f("dynamic",a,y,v,x)):i.push(f("value",a,y,v)):i.push(f("unused",a,y,v)):i.push(f("array",a,y,v));else i.push(f("schema",a,y))}return i}t.exports=function(e,t){void 0===e&&(e=[]),void 0===t&&(t={});var l,u,h=i.get(),p=[],d={_context:r.extendFlat({},a)};s(e)?(d.data=r.extendDeep([],e),l=e):(d.data=[],l=[],p.push(f("array","data"))),o(t)?(d.layout=r.extendDeep({},t),u=t):(d.layout={},u={},arguments.length>1&&p.push(f("object","layout"))),n.supplyDefaults(d);for(var m=d._fullData,g=l.length,y=0;y<g;y++){var v=l[y],x=["data",y];if(o(v)){var _=m[y],b=_.type,w=h.traces[b].attributes;w.type={valType:"enumerated",values:[b]},!1===_.visible&&!1!==v.visible&&p.push(f("invisible",x)),c(v,_,w,p,x)}else p.push(f("object",x))}var T=d._fullLayout,k=function(e,t){for(var n=e.layout.layoutAttributes,i=0;i<t.length;i++){var a=t[i],o=e.traces[a.type],s=o.layoutAttributes;s&&(a.subplot?r.extendFlat(n[o.attributes.subplot.dflt],s):r.extendFlat(n,s))}return n}(h,m);return c(u,T,k,p,"layout"),0===p.length?void 0:p};var u={object:function(e,t){return("layout"===e&&""===t?"The layout argument":"data"===e[0]&&""===t?"Trace "+e[1]+" in the data argument":h(e)+"key "+t)+" must be linked to an object container"},array:function(e,t){return("data"===e?"The data argument":h(e)+"key "+t)+" must be linked to an array container"},schema:function(e,t){return h(e)+"key "+t+" is not part of the schema"},unused:function(e,t,r){var n=o(r)?"container":"key";return h(e)+n+" "+t+" did not get coerced"},dynamic:function(e,t,r,n){return[h(e)+"key",t,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(e,t){return(t?h(e)+"item "+t:"Trace "+e[1])+" got defaulted to be not visible"},value:function(e,t,r){return[h(e)+"key "+t,"is set to an invalid value ("+r+")"].join(" ")}};function h(e){return s(e)?"In data trace "+e[1]+", ":"In "+e+", "}function f(e,t,n,i,a){var o,l;n=n||"",s(t)?(o=t[0],l=t[1]):(o=t,l=null);var c=function(e){if(!s(e))return String(e);for(var t="",r=0;r<e.length;r++){var n=e[r];"number"==typeof n?t=t.slice(0,-1)+"["+n+"]":t+=n,r<e.length-1&&(t+=".")}return t}(n),h=u[e](t,c,i,a);return r.log(h),{code:e,container:o,trace:l,path:n,astr:c,msg:h}}function p(e,t){var r=g(t),n=r.keyMinusId,i=r.id;return!!(n in e&&e[n]._isSubplotObj&&i)||t in e}function d(e,t){return t in e?e[t]:e[g(t).keyMinusId]}var m=r.counterRegex("([a-z]+)");function g(e){var t=e.match(m);return{keyMinusId:t&&t[1],id:t&&t[2]}}}}),Un=m({"src/snapshot/filesaver.js"(e,t){var r=ct(),n=Rn();t.exports=function(e,t,i){var a=document.createElement("a"),o="download"in a;return new Promise((function(s,l){var c,u;if(o)return c=n.createBlob(e,i),u=n.createObjectURL(c),a.href=u,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),n.revokeObjectURL(u),c=null,s(t);if(r.isSafari()){var h="svg"===i?",":";base64,";return n.octetStream(h+encodeURIComponent(e)),s(t)}l(new Error("download error"))}))}}}),Vn=m({"src/snapshot/download.js"(e,t){var r=ct(),n=jn(),i=Un();Rn(),t.exports=function(e,t){var a;return r.isPlainObject(e)||(a=r.getGraphDiv(e)),(t=t||{}).format=t.format||"png",t.width=t.width||null,t.height=t.height||null,t.imageDataOnly=!0,new Promise((function(r,o){a&&a._snapshotInProgress&&o(new Error("Snapshotting already in progress.")),a&&(a._snapshotInProgress=!0);var s=n(e,t),l=t.filename||e.fn||"newplot";l+="."+t.format.replace("-","."),s.then((function(e){return a&&(a._snapshotInProgress=!1),i(e,l,t.format)})).then((function(e){r(e)})).catch((function(e){a&&(a._snapshotInProgress=!1),o(e)}))}))}}}),qn=m({"src/plot_api/template_api.js"(e){var t=ct(),r=t.isPlainObject,n=yt(),i=At(),a=q(),o=vt(),s=$().dfltConfig;function l(e,n){e=t.extendDeep({},e);var i,a,s=Object.keys(e).sort();function u(t,n,i){if(r(n)&&r(t))l(t,n);else if(Array.isArray(n)&&Array.isArray(t)){var s=o.arrayTemplater({_template:e},i);for(a=0;a<n.length;a++){var c=n[a],u=s.newItem(c)._template;u&&l(u,c)}var h=s.defaultItems();for(a=0;a<h.length;a++)n.push(h[a]._template);for(a=0;a<n.length;a++)delete n[a].templateitemname}}for(i=0;i<s.length;i++){var h=s[i],f=e[h];if(h in n?u(f,n[h],h):n[h]=f,c(h)===h)for(var p in n){var d=c(p);p!==d&&d===h&&!(p in e)&&u(f,n[p],h)}}}function c(e){return e.replace(/[0-9]+$/,"")}function u(e,n,i,a,s){var l=s&&i(s);for(var h in e){var f=e[h],d=p(e,h,a),m=p(e,h,s),g=i(m);if(!g){var y=c(h);y!==h&&(g=i(m=p(e,y,s)))}if(!(l&&l===g||!g||g._noTemplating||"data_array"===g.valType||g.arrayOk&&Array.isArray(f)))if(!g.valType&&r(f))u(f,n,i,d,m);else if(g._isLinkedToArray&&Array.isArray(f))for(var v=!1,x=0,_={},b=0;b<f.length;b++){var w=f[b];if(r(w)){var T=w.name;if(T)_[T]||(u(w,n,i,p(f,x,d),p(f,x,m)),x++,_[T]=1);else if(!v){var k=p(e,o.arrayDefaultKey(h),a),A=p(f,x,d);u(w,n,i,A,p(f,x,m));var M=t.nestedProperty(n,A);t.nestedProperty(n,k).set(M.get()),M.set(null),v=!0}}}else t.nestedProperty(n,d).set(f)}}function h(e,r){return n.getLayoutValObject(e,t.nestedProperty({},r).parts)}function f(e,r){return n.getTraceValObject(e,t.nestedProperty({},r).parts)}function p(e,t,r){return r?Array.isArray(e)?r+"["+t+"]":r+"."+t:t}function d(e){for(var t=0;t<e.length;t++)if(r(e[t]))return!0}function m(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."}return e.msg=t,e}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 n=e.data||[],o=e.layout||{};o._basePlotModules=e._fullLayout._basePlotModules,o._modules=e._fullLayout._modules;var c={data:{},layout:{}};n.forEach((function(e){var r={};u(e,r,f.bind(null,e));var n=t.coerce(e,{},a,"type"),i=c.data[n];i||(i=c.data[n]=[]),i.push(r)})),u(o,c.layout,h.bind(null,o)),delete c.layout.template;var p=o.template;if(r(p)){var d,m,g,y,v,x,_=p.layout;r(_)&&l(_,c.layout);var b=p.data;if(r(b)){for(m in c.data)if(g=b[m],Array.isArray(g)){for(x=(v=c.data[m]).length,y=g.length,d=0;d<x;d++)l(g[d%y],v[d]);for(d=x;d<y;d++)v.push(t.extendDeep({},g[d]))}for(m in b)m in c.data||(c.data[m]=t.extendDeep([],b[m]))}}return c},e.validateTemplate=function(e,n){var a=t.extendDeep({},{_context:s,data:e.data,layout:e.layout}),o=a.layout||{};r(n)||(n=o.template||{});var l=n.layout,u=n.data,h=[];a.layout=o,a.layout.template=n,i.supplyDefaults(a);var f=a._fullLayout,g=a._fullData,y={};if(r(l)?(function e(t,n){for(var i in t)if("_"!==i.charAt(0)&&r(t[i])){var a,o=c(i),s=[];for(a=0;a<n.length;a++)s.push(p(t,i,n[a])),o!==i&&s.push(p(t,o,n[a]));for(a=0;a<s.length;a++)y[s[a]]=1;e(t[i],s)}}(f,["layout"]),function e(t,n){for(var i in t)if(-1===i.indexOf("defaults")&&r(t[i])){var a=p(t,i,n);y[a]?e(t[i],a):h.push({code:"unused",path:a})}}(l,"layout")):h.push({code:"layout"}),r(u)){for(var v,x={},_=0;_<g.length;_++){var b=g[_];x[v=b.type]=(x[v]||0)+1,b._fullInput._template||h.push({code:"missing",index:b.index,traceType:v})}for(v in u){var w=u[v].length,T=x[v]||0;w>T?h.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&h.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else h.push({code:"data"});if(function e(t,n){for(var i in t)if("_"!==i.charAt(0)){var a=t[i],o=p(t,i,n);r(a)?(Array.isArray(t)&&!1===a._template&&a.templateitemname&&h.push({code:"missing",path:o,templateitemname:a.templateitemname}),e(a,o)):Array.isArray(a)&&d(a)&&e(a,o)}}({data:g,layout:f},""),h.length)return h.map(m)}}}),Hn=m({"src/plot_api/index.js"(e){var t=On();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 r=Pe().getGraphDiv,n=Yr().eraseActiveShape;e.deleteActiveShape=function(e){return n(r(e))},e.toImage=jn(),e.validate=Nn(),e.downloadImage=Vn();var i=qn();e.makeTemplate=i.makeTemplate,e.validateTemplate=i.validateTemplate}}),Gn=m({"src/traces/scatter/xy_defaults.js"(e,t){var r=ct(),n=He();t.exports=function(e,t,i,a){var o,s=a("x"),l=a("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],i),s){var c=r.minRowLength(s);l?o=Math.min(c,r.minRowLength(l)):(o=c,a("y0"),a("dy"))}else{if(!l)return 0;o=r.minRowLength(l),a("x0"),a("dx")}return t._length=o,o}}}),Wn=m({"src/traces/scatter/period_defaults.js"(e,t){var r=ct().dateTick0,n=S().ONEWEEK;function i(e,t){return r(t,e%n==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,t.ycalendar)),n("yperiodalignment"))}}}}),Zn=m({"src/traces/scatter/stack_defaults.js"(e,t){var r=["orientation","groupnorm","stackgaps"];t.exports=function(e,t,n,i){var a=n._scatterStackOpts,o=i("stackgroup");if(o){var s=t.xaxis+t.yaxis,l=a[s];l||(l=a[s]={});var c=l[o],u=!1;c?c.traces.push(t):(c=l[o]={traceIndices:[],traces:[t]},u=!0);for(var h={orientation:t.x&&!t.y?"h":"v"},f=0;f<r.length;f++){var p=r[f],d=p+"Found";if(!c[d]){var m=void 0!==e[p],g="orientation"===p;if((m||u)&&(c[p]=i(p,h[p]),g&&(c.fillDflt="h"===c[p]?"tonextx":"tonexty"),m&&(c[d]=!0,!u&&(delete c.traces[0][p],g))))for(var y=0;y<c.traces.length-1;y++){var v=c.traces[y];v._input.fill!==v.fill&&(v.fill=c.fillDflt)}}}return c}}}}),Yn=m({"src/traces/scatter/marker_defaults.js"(e,t){var r=W(),n=Ct().hasColorscale,i=Ht(),a=Xt();t.exports=function(e,t,o,s,l,c={}){var u=a.isBubble(e),h=(e.line||{}).color;h&&(o=h),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),c.noAngle||(l("marker.angle"),c.noAngleRef||l("marker.angleref"),c.noStandOff||l("marker.standoff")),l("marker.color",o),n(e,"marker")&&i(e,t,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&t.marker.color!==h?h:u?r.background:r.defaultLine),n(e,"marker.line")&&i(e,t,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0),c.noLineDash||l("marker.line.dash")),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}}),Xn=m({"src/traces/scatter/line_defaults.js"(e,t){var r=ct().isArrayOrTypedArray,n=Ct().hasColorscale,i=Ht();t.exports=function(e,t,a,o,s,l){l||(l={});var c=(e.marker||{}).color;c&&c._inputArray&&(c=c._inputArray),s("line.color",a),n(e,"line")?i(e,t,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!r(c)&&c||a),s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}}}),$n=m({"src/traces/scatter/line_shape_defaults.js"(e,t){t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}}}),Kn=m({"src/traces/scatter/text_defaults.js"(e,t){var r=ct();t.exports=function(e,t,n,i,a){a=a||{},i("textposition"),r.coerceFont(i,"textfont",a.font||n.font,a),a.noSelect||(i("selected.textfont.color"),i("unselected.textfont.color"))}}}),Jn=m({"src/traces/scatter/fillcolor_defaults.js"(e,t){var r=W(),n=ct().isArrayOrTypedArray;t.exports=function(e,t,i,a,o){o||(o={});var s,l=!1;if(t.marker){var c=t.marker.color,u=(t.marker.line||{}).color;c&&!n(c)?l=c:u&&!n(u)&&(l=u)}if(o.moduleHasFillgradient&&"none"!==a("fillgradient.type")){a("fillgradient.start"),a("fillgradient.stop");var h=a("fillgradient.colorscale");h&&(s=function(e){for(var t=r.interpolate(e[0][1],e[1][1],.5),n=2;n<e.length;n++){var i=r.interpolate(e[n-1][1],e[n][1],.5);t=r.interpolate(t,i,e[n-1][0]/e[n][0])}return t}(h))}a("fillcolor",r.addOpacity((t.line||{}).color||l||s||i,.5))}}}),Qn=m({"src/traces/scatter/defaults.js"(e,t){var r=ct(),n=He(),i=kn(),a=wn(),o=Xt(),s=Gn(),l=Wn(),c=Zn(),u=Yn(),h=Xn(),f=$n(),p=Kn(),d=Jn(),m=ct().coercePattern;t.exports=function(e,t,g,y){function v(n,a){return r.coerce(e,t,i,n,a)}var x=s(e,t,y,v);if(x||(t.visible=!1),t.visible){l(e,t,y,v),v("xhoverformat"),v("yhoverformat"),v("zorder");var _=c(e,t,y,v);"group"===y.scattermode&&void 0===t.orientation&&v("orientation","v");var b=!_&&x<a.PTS_LINESONLY?"lines+markers":"lines";v("text"),v("hovertext"),v("mode",b),o.hasMarkers(t)&&u(e,t,g,y,v,{gradient:!0}),o.hasLines(t)&&(h(e,t,g,y,v,{backoff:!0}),f(e,t,v),v("connectgaps"),v("line.simplify")),o.hasText(t)&&(v("texttemplate"),v("texttemplatefallback"),p(e,t,y,v));var w=[];(o.hasMarkers(t)||o.hasText(t))&&(v("cliponaxis"),v("marker.maxdisplayed"),w.push("points")),v("fill",_?_.fillDflt:"none"),"none"!==t.fill&&(d(e,t,g,v,{moduleHasFillgradient:!0}),o.hasLines(t)||f(e,t,v),m(v,"fillpattern",t.fillcolor,!1));var T=(t.line||{}).color,k=(t.marker||{}).color;("tonext"===t.fill||"toself"===t.fill)&&w.push("fills"),v("hoveron",w.join("+")||"points"),"fills"!==t.hoveron&&(v("hovertemplate"),v("hovertemplatefallback"));var A=n.getComponentMethod("errorbars","supplyDefaults");A(e,t,T||k||g,{axis:"y"}),A(e,t,T||k||g,{axis:"x",inherit:"y"}),r.coerceSelectionMarkerOpacity(t,v)}}}}),ei=m({"src/traces/scatter/grouping_defaults.js"(e,t){var r=nn().getAxisGroup;t.exports=function(e,t,n,i,a){var o=t.orientation,s=t[{v:"x",h:"y"}[o]+"axis"],l=r(n,s)+o,c=n._alignmentOpts||{},u=i("alignmentgroup"),h=c[l];h||(h=c[l]={});var f=h[u];f?f.traces.push(t):f=h[u]={traces:[t],alignmentIndex:Object.keys(h).length,offsetGroups:{}};var p=i("offsetgroup")||"",d=f.offsetGroups,m=d[p];t._offsetIndex=0,("group"!==a||p)&&(m||(m=d[p]={offsetIndex:Object.keys(d).length}),t._offsetIndex=m.offsetIndex)}}}),ti=m({"src/traces/scatter/cross_trace_defaults.js"(e,t){var r=ct(),n=ei(),i=kn();t.exports=function(e,t){var a,o,s,l=t.scattermode;function c(e){return r.coerce(o._input,o,i,e)}if("group"===t.scattermode)for(s=0;s<e.length;s++)"scatter"===(o=e[s]).type&&(a=o._input,n(a,o,t,c,l));for(s=0;s<e.length;s++){var u=e[s];if("scatter"===u.type){var h=u.fill;if("none"!==h&&"toself"!==h&&(u.opacity=void 0,"tonexty"===h||"tonextx"===h))for(var f=s-1;f>=0;f--){var p=e[f];if("scatter"===p.type&&p.xaxis===u.xaxis&&p.yaxis===u.yaxis){p.opacity=void 0;break}}}}}}}),ri=m({"src/traces/scatter/layout_defaults.js"(e,t){var r=ct(),n=wt();t.exports=function(e,t){var i,a="group"===t.barmode;"group"===t.scattermode&&(i=a?t.bargap:.2,r.coerce(e,t,n,"scattergap",i))}}}),ni=m({"src/plots/cartesian/align_period.js"(e,t){var r=M(),n=ct(),i=n.dateTime2ms,a=n.incrementMonth,o=S().ONEAVGMONTH;t.exports=function(e,t,n,s){if("date"!==t.type)return{vals:s};var l=e[n+"periodalignment"];if(!l)return{vals:s};var c,u=e[n+"period"];if(r(u)){if((u=+u)<=0)return{vals:s}}else if("string"==typeof u&&"M"===u.charAt(0)){var h=+u.substring(1);if(!(h>0&&Math.round(h)===h))return{vals:s};c=h}for(var f=t.calendar,p="start"===l,d="end"===l,m=e[n+"period0"],g=i(m,f)||0,y=[],v=[],x=[],_=s.length,b=0;b<_;b++){var w,T,k,A=s[b];if(c){for(w=Math.round((A-g)/(c*o)),k=a(g,c*w,f);k>A;)k=a(k,-c,f);for(;k<=A;)k=a(k,c,f);T=a(k,-c,f)}else{for(k=g+(w=Math.round((A-g)/u))*u;k>A;)k-=u;for(;k<=A;)k+=u;T=k-u}y[b]=p?T:d?k:(T+k)/2,v[b]=T,x[b]=k}return{vals:y,starts:v,ends:x}}}}),ii=m({"src/traces/scatter/colorscale_calc.js"(e,t){var r=Ct().hasColorscale,n=Zt(),i=Xt();t.exports=function(e,t){i.hasLines(t)&&r(t,"line")&&n(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(t)&&(r(t,"marker")&&n(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),r(t,"marker.line")&&n(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),ai=m({"src/traces/scatter/arrays_to_calcdata.js"(e,t){var r=ct();t.exports=function(e,t){for(var n=0;n<e.length;n++)e[n].i=n;r.mergeArray(t.text,e,"tx"),r.mergeArray(t.texttemplate,e,"txt"),r.mergeArray(t.hovertext,e,"htx"),r.mergeArray(t.customdata,e,"data"),r.mergeArray(t.textposition,e,"tp"),t.textfont&&(r.mergeArrayCastPositive(t.textfont.size,e,"ts"),r.mergeArray(t.textfont.color,e,"tc"),r.mergeArray(t.textfont.family,e,"tf"),r.mergeArray(t.textfont.weight,e,"tw"),r.mergeArray(t.textfont.style,e,"ty"),r.mergeArray(t.textfont.variant,e,"tv"),r.mergeArray(t.textfont.textcase,e,"tC"),r.mergeArray(t.textfont.lineposition,e,"tE"),r.mergeArray(t.textfont.shadow,e,"tS"));var i=t.marker;if(i){r.mergeArrayCastPositive(i.size,e,"ms"),r.mergeArrayCastPositive(i.opacity,e,"mo"),r.mergeArray(i.symbol,e,"mx"),r.mergeArray(i.angle,e,"ma"),r.mergeArray(i.standoff,e,"mf"),r.mergeArray(i.color,e,"mc");var a=i.line;i.line&&(r.mergeArray(a.color,e,"mlc"),r.mergeArrayCastPositive(a.width,e,"mlw"),r.mergeArray(a.dash,e,"mld"));var o=i.gradient;o&&"none"!==o.type&&(r.mergeArray(o.type,e,"mgt"),r.mergeArray(o.color,e,"mgc"))}}}}),oi=m({"src/traces/scatter/calc_selection.js"(e,t){var r=ct();t.exports=function(e,t){r.isArrayOrTypedArray(t.selectedpoints)&&r.tagSelected(e,t)}}}),si=m({"src/traces/scatter/calc.js"(e,t){var r=M(),n=ct(),i=ar(),a=ni(),o=S().BADNUM,s=Xt(),l=ii(),c=ai(),u=oi();function h(e,t,r,n,a,o,l){var c=t._length,u=e._fullLayout,h=r._id,f=n._id,p=u._firstScatter[d(t)]===t.uid,g=(m(t,u,r,n)||{}).orientation,y=t.fill;r._minDtick=0,n._minDtick=0;var v={padded:!0},x={padded:!0};l&&(v.ppad=x.ppad=l);var _=c<2||a[0]!==a[c-1]||o[0]!==o[c-1];_&&("tozerox"===y||"tonextx"===y&&(p||"h"===g))?v.tozero=!0:!(t.error_y||{}).visible&&("tonexty"===y||"tozeroy"===y||!s.hasMarkers(t)&&!s.hasText(t))&&(v.padded=!1,v.ppad=0),_&&("tozeroy"===y||"tonexty"===y&&(p||"v"===g))?x.tozero=!0:("tonextx"===y||"tozerox"===y)&&(x.padded=!1),h&&(t._extremes[h]=i.findExtremes(r,a,v)),f&&(t._extremes[f]=i.findExtremes(n,o,x))}function f(e,t){if(s.hasMarkers(e)){var r,a=e.marker,o=1.6*(e.marker.sizeref||1);if(r="area"===e.marker.sizemode?function(e){return Math.max(Math.sqrt((e||0)/o),3)}:function(e){return Math.max((e||0)/o,3)},n.isArrayOrTypedArray(a.size)){var l={type:"linear"};i.setConvert(l);for(var c=l.makeCalcdata(e.marker,"size"),u=new Array(t),h=0;h<t;h++)u[h]=r(c[h]);return u}return r(a.size)}}function p(e,t){var r=d(t),n=e._firstScatter;n[r]||(n[r]=t.uid)}function d(e){var t=e.stackgroup;return e.xaxis+e.yaxis+e.type+(t?"-"+t:"")}function m(e,t,r,n){var i=e.stackgroup;if(i){var a=t._scatterStackOpts[r._id+n._id][i],o="v"===a.orientation?n:r;if("linear"===o.type||"log"===o.type)return a}}t.exports={calc:function(e,t){var s,d,g,y,v,x,_=e._fullLayout,b=t._xA=i.getFromId(e,t.xaxis||"x","x"),w=t._yA=i.getFromId(e,t.yaxis||"y","y"),T=b.makeCalcdata(t,"x"),k=w.makeCalcdata(t,"y"),A=a(t,b,"x",T),M=a(t,w,"y",k),S=A.vals,E=M.vals,C=t._length,I=new Array(C),L=t.ids,P=m(t,_,b,w),z=!1;p(_,t);var D,O="x",R="y";P?(n.pushUnique(P.traceIndices,t.index),(s="v"===P.orientation)?(R="s",D="x"):(O="s",D="y"),v="interpolate"===P.stackgaps):h(e,t,b,w,S,E,f(t,C));var F=!!t.xperiodalignment,B=!!t.yperiodalignment;for(d=0;d<C;d++){var j=I[d]={},N=r(S[d]),U=r(E[d]);N&&U?(j[O]=S[d],j[R]=E[d],F&&(j.orig_x=T[d],j.xEnd=A.ends[d],j.xStart=A.starts[d]),B&&(j.orig_y=k[d],j.yEnd=M.ends[d],j.yStart=M.starts[d])):P&&(s?N:U)?(j[D]=s?S[d]:E[d],j.gap=!0,v?(j.s=o,z=!0):j.s=0):j[O]=j[R]=o,L&&(j.id=String(L[d]))}if(c(I,t),l(e,t),u(I,t),P){for(d=0;d<I.length;)I[d][D]===o?I.splice(d,1):d++;if(n.sort(I,(function(e,t){return e[D]-t[D]||e.i-t.i})),z){for(d=0;d<I.length-1&&I[d].gap;)d++;for((x=I[d].s)||(x=I[d].s=0),g=0;g<d;g++)I[g].s=x;for(y=I.length-1;y>d&&I[y].gap;)y--;for(x=I[y].s,g=I.length-1;g>y;g--)I[g].s=x;for(;d<y;)if(I[++d].gap){for(g=d+1;I[g].gap;)g++;for(var V=I[d-1][D],q=I[d-1].s,H=(I[g].s-q)/(I[g][D]-V);d<g;)I[d].s=q+(I[d][D]-V)*H,d++}}}return I},calcMarkerSize:f,calcAxisExpansion:h,setFirstScatter:p,getStackOpts:m}}}),li=m({"src/traces/bar/sieve.js"(e,t){t.exports=n;var r=ct().distinctVals;function n(e,t){this.traces=e,this.sepNegVal=t.sepNegVal,this.overlapNoMerge=t.overlapNoMerge;for(var n=1/0,i=t.posAxis._id.charAt(0),a=[],o=0;o<e.length;o++){for(var s=e[o],l=0;l<s.length;l++){var c=s[l],u=c.p;void 0===u&&(u=c[i]),void 0!==u&&a.push(u)}s[0]&&s[0].width1&&(n=Math.min(s[0].width1,n))}this.positions=a;var h=r(a);this.distinctPositions=h.vals,1===h.vals.length&&n!==1/0?this.minDiff=n:this.minDiff=Math.min(h.minDiff,n);var f=(t.posAxis||{}).type;("category"===f||"multicategory"===f)&&(this.minDiff=1),this.binWidth=this.minDiff,this.bins={}}n.prototype.put=function(e,t,r){var n=this.getLabel(e,t,r),i=this.bins[n]||0;return this.bins[n]=i+r,i},n.prototype.get=function(e,t,r){var n=this.getLabel(e,t,r);return this.bins[n]||0},n.prototype.getLabel=function(e,t,r){return(r<0&&this.sepNegVal?"v":"^")+(this.overlapNoMerge?e:Math.round(e/this.binWidth))+"g"+t}}}),ci=m({"src/traces/bar/constants.js"(e,t){t.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}}),ui=m({"src/traces/bar/cross_trace_calc.js"(e,t){var r=M(),{isArrayOrTypedArray:n}=ct(),{BADNUM:i}=S(),a=He(),o=ar(),{getAxisGroup:s}=nn(),l=li(),{TEXTPAD:c}=ci(),{LINE_SPACING:u}=St(),{BR_TAG_ALL:h}=Et();function f(e,t,a,s,c){if(s.length){var u,h,f,m;switch(function(e,t){var i,a;for(i=0;i<t.length;i++){var o,s=t[i],l=s[0].trace,c="funnel"===l.type?l._base:l.base,u="h"===l.orientation?l.xcalendar:l.ycalendar,h="category"===e.type||"multicategory"===e.type?function(){return null}:e.d2c;if(n(c)){for(a=0;a<Math.min(c.length,s.length);a++)o=h(c[a],0,u),r(o)?(s[a].b=+o,s[a].hasB=1):s[a].b=0;for(;a<s.length;a++)s[a].b=0}else{o=h(c,0,u);var f=r(o);for(o=f?o:0,a=0;a<s.length;a++)s[a].b=o,f&&(s[a].hasB=1)}}}(a,s),c.mode){case"overlay":p(e,t,a,s,c);break;case"group":for(u=[],h=[],f=0;f<s.length;f++)void 0===(m=s[f])[0].trace.offset?h.push(m):u.push(m);h.length&&function(e,t,r,n,a){var o=new l(n,{posAxis:t,sepNegVal:!1,overlapNoMerge:!a.norm});d(e,t,o,a),function(e,t){for(var r=e.traces,n=0;n<r.length;n++){var a=r[n],o=a[0].trace,s=a[0].t.offsetindex;if(void 0===o.base)for(var c=new l([a],{posAxis:t,sepNegVal:!0,overlapNoMerge:!0}),u=0;u<a.length;u++){var h=a[u];if(h.p!==i){var f=c.put(h.p,s,h.b+h.s);f&&(h.b=f)}}}}(o,t),a.norm?(y(o),v(r,o,a)):g(r,o)}(e,t,a,h,c),u.length&&p(e,t,a,u,c);break;case"stack":case"relative":for(u=[],h=[],f=0;f<s.length;f++)void 0===(m=s[f])[0].trace.base?h.push(m):u.push(m);(function(e){if(!(e.length<2)){var t,n,i,a,o,s;for(t=0;t<e.length&&void 0===(a=(n=e[t][0].trace).marker?n.marker.cornerradius:void 0);t++);if(void 0!==a)for(o=r(a)?+a:+a.slice(0,-1),s=r(a)?"px":"%",t=0;t<e.length;t++)(i=e[t][0].t).cornerradiusvalue=o,i.cornerradiusform=s}})(h),h.length&&function(e,t,r,n,a){var s=new l(n,{posAxis:t,sepNegVal:"relative"===a.mode,overlapNoMerge:!(a.norm||"stack"===a.mode||"relative"===a.mode)});d(e,t,s,a),function(e,t,r){var n,a,s,l,c,u,h,f=_(e),p=t.traces;for(l=0;l<p.length;l++)if("funnel"===(a=(n=p[l])[0].trace).type)for(h=n[0].t.offsetindex,c=0;c<n.length;c++)(u=n[c]).s!==i&&t.put(u.p,h,-.5*u.s);for(l=0;l<p.length;l++){s="funnel"===(a=(n=p[l])[0].trace).type,h="barpolar"===a.type?0:n[0].t.offsetindex;var d=[];for(c=0;c<n.length;c++)if((u=n[c]).s!==i){var m;m=s?u.s:u.s+u.b;var g=t.put(u.p,h,m),y=g+m;u.b=g,u[f]=y,r.norm||(d.push(y),u.hasB&&d.push(g))}if(!r.norm){let{ppadminus:t,ppadplus:r}=x(a,n);a._extremes[e._id]=o.findExtremes(e,d,{tozero:!0,padded:!0,ppadplus:r,ppadminus:t})}}}(r,s,a);for(var c=0;c<n.length;c++)for(var u=n[c],h=u[0].t.offsetindex,f=0;f<u.length;f++){var p=u[f];p.s!==i&&p.b+p.s===s.get(p.p,h,p.s)&&(p._outmost=!0)}a.norm&&v(r,s,a)}(e,t,a,h,c),u.length&&p(e,t,a,u,c)}(function(e){var t,n,i,a,o,s,l;for(t=0;t<e.length;t++)i=(n=e[t])[0].trace,void 0===(a=n[0].t).cornerradiusvalue&&void 0!==(o=i.marker?i.marker.cornerradius:void 0)&&(s=r(o)?+o:+o.slice(0,-1),l=r(o)?"px":"%",a.cornerradiusvalue=s,a.cornerradiusform=l)})(s),function(e,t){var i,a,o,s=_(t),l={},c=1/0,u=-1/0;for(i=0;i<e.length;i++)for(o=e[i],a=0;a<o.length;a++){var h=o[a].p;r(h)&&(c=Math.min(c,h),u=Math.max(u,h))}var f=1e4/(u-c),p=l.round=function(e){return String(Math.round(f*(e-c)))},d={},m={},g=e.some((function(e){var t=e[0].trace;return"marker"in t&&t.marker.cornerradius}));for(i=0;i<e.length;i++){(o=e[i])[0].t.extents=l;var y=o[0].t.poffset,v=n(y);for(a=0;a<o.length;a++){var x=o[a],b=x[s]-x.w/2;if(r(b)){var w=x[s]+x.w/2,T=p(x.p);l[T]?l[T]=[Math.min(b,l[T][0]),Math.max(w,l[T][1])]:l[T]=[b,w]}if(x.p0=x.p+(v?y[a]:y),x.p1=x.p0+x.w,x.s0=x.b,x.s1=x.s0+x.s,g){var k=Math.min(x.s0,x.s1)||0,A=Math.max(x.s0,x.s1)||0,M=x[s];d[M]=M in d?Math.min(d[M],k):k,m[M]=M in m?Math.max(m[M],A):A}}}g&&function(e,t,r,n){for(var i=_(n),a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var l=o[s],c=l[i];l._sMin=t[c],l._sMax=r[c]}}(e,d,m,t)}(s,t)}}function p(e,t,r,n,i){for(var a=0;a<n.length;a++){var o=n[a],s=new l([o],{posAxis:t,sepNegVal:!1,overlapNoMerge:!i.norm});d(e,t,s,i),i.norm?(y(s),v(r,s,i)):g(r,s)}}function d(e,t,i,a){var o,l,c,u,h=e._fullLayout,f=i.positions,p=i.distinctPositions,d=i.minDiff,g=i.traces,y=g.length,v=f.length!==p.length,x=d*(1-a.gap);if("angularaxis"===t._id)c=-(l=(o=x)*(1-(a.groupgap||0)))/2;else{var b=s(h,t._id)+g[0][0].trace.orientation;u=h._alignmentOpts[b]||{}}for(var w=0;w<y;w++){var T=g[w],k=T[0].trace;if("angularaxis"!==t._id){var A=u[k.alignmentgroup]||{},M=Object.keys(A.offsetGroups||{}).length;l=(o=M?x/M:v?x/y:x)*(1-(a.groupgap||0)),c=M?((2*k._offsetIndex+1-M)*o-l)/2:v?((2*w+1-y)*o-l)/2:-l/2}var S=T[0].t;S.barwidth=l,S.offsetindex=k._offsetIndex||0,S.poffset=c,S.bargroupwidth=x,S.bardelta=d}i.binWidth=g[0][0].t.barwidth/100,function(e){var t,i,a=e.traces;for(t=0;t<a.length;t++){var o,s=a[t],l=s[0],c=l.trace,u=l.t,h=c._offset||c.offset,f=u.poffset;if(n(h)){for(o=Array.prototype.slice.call(h,0,s.length),i=0;i<o.length;i++)r(o[i])||(o[i]=f);for(i=o.length;i<s.length;i++)o.push(f);u.poffset=o}else void 0!==h&&(u.poffset=h);var p=c._width||c.width,d=u.barwidth;if(n(p)){var m=Array.prototype.slice.call(p,0,s.length);for(i=0;i<m.length;i++)r(m[i])||(m[i]=d);for(i=m.length;i<s.length;i++)m.push(d);if(u.barwidth=m,void 0===h){for(o=[],i=0;i<s.length;i++)o.push(f+(d-m[i])/2);u.poffset=o}}else void 0!==p&&(u.barwidth=p,void 0===h&&(u.poffset=f+(d-p)/2))}}(i),function(e,t){for(var r=t.traces,i=_(e),a=0;a<r.length;a++)for(var o=r[a],s=o[0].t,l=s.poffset,c=n(l),u=s.barwidth,h=n(u),f=0;f<o.length;f++){var p=o[f],d=p.w=h?u[f]:u;void 0===p.p&&(p.p=p[i],p["orig_"+i]=p[i]);var m=(c?l[f]:l)+d/2;p[i]=p.p+m}}(t,i),"angularaxis"===t._id?m(t,i):m(t,i,v)}function m(e,t,r){var i=t.traces,a=t.minDiff/2;o.minDtick(e,t.minDiff,t.distinctPositions[0],r);for(var s=0;s<i.length;s++){var l,c,u,h,f=i[s],p=f[0],d=p.trace,m=[];for(h=0;h<f.length;h++)c=(l=f[h]).p-a,u=l.p+a,m.push(c,u);if(d.width||d.offset){var g=p.t,y=g.poffset,v=g.barwidth,x=n(y),_=n(v);for(h=0;h<f.length;h++){l=f[h];var b=x?y[h]:y,w=_?v[h]:v;u=(c=l.p+b)+w,m.push(c,u)}}d._extremes[e._id]=o.findExtremes(e,m,{padded:!1})}}function g(e,t){for(var r=t.traces,n=_(e),i=0;i<r.length;i++){for(var a=r[i],s=a[0].trace,l="scatter"===s.type,c="v"===s.orientation,u=[],h=!1,f=0;f<a.length;f++){var p=a[f],d=l?0:p.b,m=l?c?p.y:p.x:d+p.s;p[n]=m,u.push(m),p.hasB&&u.push(d),(!p.hasB||!p.b)&&(h=!0)}let{ppadminus:t,ppadplus:g}=x(s,a);s._extremes[e._id]=o.findExtremes(e,u,{tozero:h,padded:!0,ppadplus:g,ppadminus:t})}}function y(e){for(var t=e.traces,r=0;r<t.length;r++)for(var n=t[r],a=n[0].t.offsetindex,o=0;o<n.length;o++){var s=n[o];s.s!==i&&e.put(s.p,a,s.b+s.s)}}function v(e,t,n){var a=t.traces,s=_(e),l="fraction"===n.norm?1:100,c=l/1e9,u=e.l2c(e.c2l(0)),h="stack"===n.mode?l:u;function f(t){return r(e.c2l(t))&&(t<u-c||t>h+c||!r(u))}for(var p=0;p<a.length;p++){for(var d=a[p],m=d[0].t.offsetindex,g=d[0].trace,y=[],v=!1,b=!1,w=0;w<d.length;w++){var T=d[w];if(T.s!==i){var k=Math.abs(l/t.get(T.p,m,T.s));T.b*=k,T.s*=k;var A=T.b,M=A+T.s;T[s]=M,y.push(M),b=b||f(M),T.hasB&&(y.push(A),b=b||f(A)),(!T.hasB||!T.b)&&(v=!0)}}let{ppadminus:r,ppadplus:n}=x(g,d);g._extremes[e._id]=o.findExtremes(e,y,{tozero:v,padded:b,ppadplus:n,ppadminus:r})}}function x(e,t){if("v"===e.orientation&&(e.text||e.texttemplate)&&"outside"===e.textposition&&("auto"===e.textangle||0===e.textangle)){let i=function(e){return e&&"string"==typeof e?(e.match(h)||[]).length+1:0};var r;r=e.texttemplate?i(e.texttemplate):n(e.text)?Math.max(...e.text.map((e=>i(e)))):i(e.text);let a=e.outsidetextfont.size*u*r+c;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 _(e){return e._id.charAt(0)}t.exports={crossTraceCalc:function(e,t){for(var r=t.xaxis,n=t.yaxis,i=e._fullLayout,o=e._fullData,s=e.calcdata,l=[],c=[],u=0;u<o.length;u++){var h=o[u];if(!0===h.visible&&a.traceIs(h,"bar")&&h.xaxis===r._id&&h.yaxis===n._id&&("h"===h.orientation?l.push(s[u]):c.push(s[u]),h._computePh))for(var p=e.calcdata[u],d=0;d<p.length;d++)"function"==typeof p[d].ph0&&(p[d].ph0=p[d].ph0()),"function"==typeof p[d].ph1&&(p[d].ph1=p[d].ph1())}var m={xCat:"category"===r.type||"multicategory"===r.type,yCat:"category"===n.type||"multicategory"===n.type,mode:i.barmode,norm:i.barnorm,gap:i.bargap,groupgap:i.bargroupgap};f(e,r,n,c,m),f(e,n,r,l,m)},setGroupPositions:f}}}),hi=m({"src/traces/scatter/cross_trace_calc.js"(e,t){var r=si(),n=ui().setGroupPositions;function i(e,t,r,n,i,a,o){i[n]=!0;var s={i:null,gap:!0,s:0};if(s[o]=r,e.splice(t,0,s),t&&r===e[t-1][o]){var l=e[t-1];s.s=l.s,s.i=l.i,s.gap=l.gap}else a&&(s.s=function(e,t,r,n){var i=e[t-1],a=e[t+1];return a?i?i.s+(a.s-i.s)*(r-i[n])/(a[n]-i[n]):a.s:i.s}(e,t,r,o));t||(e[0].t=e[1].t,e[0].trace=e[1].trace,delete e[1].t,delete e[1].trace)}t.exports=function(e,t){"group"===e._fullLayout.scattermode&&function(e,t){for(var r=t.xaxis,i=t.yaxis,a=e._fullLayout,o=e._fullData,s=e.calcdata,l=[],c=[],u=0;u<o.length;u++){var h=o[u];!0===h.visible&&"scatter"===h.type&&h.xaxis===r._id&&h.yaxis===i._id&&("h"===h.orientation?l.push(s[u]):"v"===h.orientation&&c.push(s[u]))}var f={mode:a.scattermode,gap:a.scattergap};n(e,r,i,c,f),n(e,i,r,l,f)}(e,t);var a=t.xaxis,o=t.yaxis,s=a._id+o._id,l=e._fullLayout._scatterStackOpts[s];if(l){var c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k=e.calcdata;for(var A in l){var M=(v=l[A]).traceIndices;if(M.length){for(x="interpolate"===v.stackgaps,_=v.groupnorm,"v"===v.orientation?(b="x",w="y"):(b="y",w="x"),T=new Array(M.length),c=0;c<T.length;c++)T[c]=!1;d=k[M[0]];var S=new Array(d.length);for(c=0;c<d.length;c++)S[c]=d[c][b];for(c=1;c<M.length;c++){for(p=k[M[c]],u=h=0;u<p.length;u++){for(m=p[u][b];m>S[h]&&h<S.length;h++)i(p,u,S[h],c,T,x,b),u++;if(m!==S[h]){for(f=0;f<c;f++)i(k[M[f]],h,m,f,T,x,b);S.splice(h,0,m)}h++}for(;h<S.length;h++)i(p,u,S[h],c,T,x,b),u++}var E=S.length;for(u=0;u<d.length;u++){for(g=d[u][w]=d[u].s,c=1;c<M.length;c++)(p=k[M[c]])[0].trace._rawLength=p[0].trace._length,p[0].trace._length=E,g+=p[u].s,p[u][w]=g;if(_)for(y=("fraction"===_?g:g/100)||1,c=0;c<M.length;c++){var C=k[M[c]][u];C[w]/=y,C.sNorm=C.s/y}}for(c=0;c<M.length;c++){var I=(p=k[M[c]])[0].trace,L=r.calcMarkerSize(I,I._rawLength),P=Array.isArray(L);if(L&&T[c]||P){var z=L;for(L=new Array(E),u=0;u<E;u++)L[u]=p[u].gap?0:P?z[p[u].i]:z}var D=new Array(E),O=new Array(E);for(u=0;u<E;u++)D[u]=p[u].x,O[u]=p[u].y;r.calcAxisExpansion(e,I,a,o,D,O,L),p[0].t.orientation=v.orientation}}}}}}}),fi=m({"src/traces/scatter/line_points.js"(e,t){var r=er(),n=S(),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=ct(),c=l.segmentsIntersect,u=l.constrain,h=wn();t.exports=function(e,t){var n,a,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E=t.trace||{},C=t.xaxis,I=t.yaxis,L="log"===C.type,P="log"===I.type,z=C._length,D=I._length,O=t.backoff,R=E.marker,F=t.connectGaps,B=t.baseTolerance,j=t.shape,N="linear"===j,U=E.fill&&"none"!==E.fill,V=[],q=h.minTolerance,H=e.length,G=new Array(H),W=0;function Z(r){var n=e[r];if(!n)return!1;var a=t.linearized?C.l2p(n.x):C.c2p(n.x),l=t.linearized?I.l2p(n.y):I.c2p(n.y);if(a===i){if(L&&(a=C.c2p(n.x,!0)),a===i)return!1;P&&l===i&&(a*=Math.abs(C._m*D*(C._m>0?o:s)/(I._m*z*(I._m>0?o:s)))),a*=1e3}if(l===i){if(P&&(l=I.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function Y(e,t,r,n){var i=r-e,a=n-t,o=.5-e,s=.5-t,l=i*i+a*a,c=i*o+a*s;if(c>0&&c<l){var u=o*a-s*i;if(u*u<l)return!0}}function X(e,t){var r=e[0]/z,n=e[1]/D,i=Math.max(0,-r,r-1,-n,n-1);return i&&void 0!==M&&Y(r,n,M,S)&&(i=0),i&&t&&Y(r,n,t[0]/z,t[1]/D)&&(i=0),(1+h.toleranceGrowth*i)*B}function $(e,t){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)}var K,J,Q,ee,te,re,ne,ie=h.maxScreensAway,ae=-z*ie,oe=z*(1+ie),se=-D*ie,le=D*(1+ie),ce=[[ae,se,oe,se],[oe,se,oe,le],[oe,le,ae,le],[ae,le,ae,se]];function ue(e){if(e[0]<ae||e[0]>oe||e[1]<se||e[1]>le)return[u(e[0],ae,oe),u(e[1],se,le)]}function he(e,t){if(e[0]===t[0]&&(e[0]===ae||e[0]===oe)||e[1]===t[1]&&(e[1]===se||e[1]===le))return!0}function fe(e,t,r){return function(n,i){var a=ue(n),o=ue(i),s=[];if(a&&o&&he(a,o))return s;a&&s.push(a),o&&s.push(o);var c=2*l.constrain((n[e]+i[e])/2,t,r)-((a||n)[e]+(o||i)[e]);return c&&((a&&o?c>0==a[e]>o[e]?a:o:a||o)[e]+=c),s}}function pe(e){var t=e[0],r=e[1],n=t===G[W-1][0],i=r===G[W-1][1];if(!n||!i)if(W>1){var a=t===G[W-2][0],o=r===G[W-2][1];n&&(t===ae||t===oe)&&a?o?W--:G[W-1]=e:i&&(r===se||r===le)&&o?a?W--:G[W-1]=e:G[W++]=e}else G[W++]=e}function de(e){G[W-1][0]!==e[0]&&G[W-1][1]!==e[1]&&pe([Q,ee]),pe(e),te=null,Q=ee=0}"linear"===j||"spline"===j?ne=function(e,t){for(var r=[],n=0,i=0;i<4;i++){var a=ce[i],o=c(e[0],e[1],t[0],t[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&$(o,e)<$(r[0],e)?r.unshift(o):r.push(o),n++)}return r}:"hv"===j||"vh"===j?ne=function(e,t){var r=[],n=ue(e),i=ue(t);return n&&i&&he(n,i)||(n&&r.push(n),i&&r.push(i)),r}:"hvh"===j?ne=fe(0,ae,oe):"vhv"===j&&(ne=fe(1,se,le));var me=l.isArrayOrTypedArray(R);function ge(t){if(t&&O&&(t.i=n,t.d=e,t.trace=E,t.marker=me?R[t.i]:R,t.backoff=O),M=t[0]/z,S=t[1]/D,K=t[0]<ae?ae:t[0]>oe?oe:0,J=t[1]<se?se:t[1]>le?le:0,K||J){if(W)if(te){var r=ne(te,t);r.length>1&&(de(r[0]),G[W++]=r[1])}else re=ne(G[W-1],t)[0],G[W++]=re;else G[W++]=[K||t[0],J||t[1]];var i=G[W-1];K&&J&&(i[0]!==K||i[1]!==J)?(te&&(Q!==K&&ee!==J?pe(Q&&ee?function(e,t){var r=t[0]-e[0],n=(t[1]-e[1])/r;return(e[1]*t[0]-t[1]*e[0])/r>0?[n>0?ae:oe,le]:[n>0?oe:ae,se]}(te,t):[Q||K,ee||J]):Q&&ee&&pe([Q,ee])),pe([K,J])):Q-K&&ee-J&&pe([K||Q,J||ee]),te=t,Q=K,ee=J}else te&&de(ne(te,t)[0]),G[W++]=t}for(n=0;n<H;n++)if(a=Z(n)){for(W=0,te=null,ge(a),n++;n<H;n++){if(!(p=Z(n))){if(F)continue;break}if(N&&t.simplify){var ye=Z(n+1);if(x=$(p,a),U&&(0===W||W===H-1)||!(x<X(p,ye)*q)){for(y=[(p[0]-a[0])/x,(p[1]-a[1])/x],d=a,_=x,b=T=k=0,g=!1,f=p,n++;n<e.length;n++){if(m=ye,ye=Z(n+1),!m){if(F)continue;break}if(A=(v=[m[0]-a[0],m[1]-a[1]])[0]*y[1]-v[1]*y[0],T=Math.min(T,A),(k=Math.max(k,A))-T>X(m,ye))break;f=m,(w=v[0]*y[0]+v[1]*y[1])>_?(_=w,p=m,g=!1):w<b&&(b=w,d=m,g=!0)}if(g?(ge(p),f!==d&&ge(d)):(d!==a&&ge(d),f!==p&&ge(p)),ge(f),n>=e.length||!m)break;ge(m),a=m}}else ge(p)}te&&pe([Q||te[0],ee||te[1]]),V.push(G.slice(0,W))}var ve=j.slice(j.length-1);if(O&&"h"!==ve&&"v"!==ve){for(var xe=!1,_e=-1,be=[],we=0;we<V.length;we++)for(var Te=0;Te<V[we].length-1;Te++){var ke=V[we][Te],Ae=V[we][Te+1],Me=r.applyBackoff(Ae,ke);(Me[0]!==Ae[0]||Me[1]!==Ae[1])&&(xe=!0),be[_e+1]||(be[++_e]=[ke,[Me[0],Me[1]]])}return xe?be:V}return V}}}),pi=m({"src/traces/scatter/link_traces.js"(e,t){var r={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,n){var i,a,o,s,l,c={},u=!1,h=-1,f=0,p=-1;for(a=0;a<n.length;a++)(o=(i=n[a][0].trace).stackgroup||"")?o in c?l=c[o]:(l=c[o]=f,f++):i.fill in r&&p>=0?l=p:(l=p=f,f++),l<h&&(u=!0),i._groupIndex=h=l;var d=n.slice();u&&d.sort((function(e,t){var r=e[0].trace,n=t[0].trace;return r._groupIndex-n._groupIndex||r.index-n.index}));var m={};for(a=0;a<d.length;a++)o=(i=d[a][0].trace).stackgroup||"",!0===i.visible?(i._nexttrace=null,i.fill in r&&(s=m[o],i._prevtrace=s||null,s&&(s._nexttrace=i)),i._ownfill=i.fill&&("tozero"===i.fill.slice(0,6)||"toself"===i.fill||"to"===i.fill.slice(0,2)&&!i._prevtrace),m[o]=i):i._prevtrace=i._nexttrace=i._ownfill=null;return d}}}),di=m({"src/traces/scatter/plot.js"(e,t){var r=b(),n=He(),i=ct(),a=i.ensureSingle,o=i.identity,s=er(),l=Xt(),c=fi(),u=pi(),h=gn().tester;function f(e,t,u,f,p,d,m){var g,y=e._context.staticPlot;!function(e,t,n,a,o){var s=n.xaxis,c=n.yaxis,u=r.extent(i.simpleMap(s.range,s.r2c)),h=r.extent(i.simpleMap(c.range,c.r2c)),f=a[0].trace;if(l.hasMarkers(f)){var p=f.marker.maxdisplayed;if(0!==p){var d=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=h[0]&&e.y<=h[1]})),m=Math.ceil(d.length/p),g=0;o.forEach((function(e,r){var n=e[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<t&&g++}));var y=Math.round(g*m/3+Math.floor(g/3)*m/7.1);a.forEach((function(e){delete e.vis})),d.forEach((function(e,t){0===Math.round((t+y)%m)&&(e.vis=!0)}))}}}(0,t,u,f,p);var v=!!m&&m.duration>0;function x(e){return v?e.transition():e}var _=u.xaxis,b=u.yaxis,w=f[0].trace,T=w.line,k=r.select(d),A=a(k,"g","errorbars"),M=a(k,"g","lines"),S=a(k,"g","points"),E=a(k,"g","text");if(n.getComponentMethod("errorbars","plot")(e,A,u,m),!0===w.visible){x(k).style("opacity",w.opacity);var C,I,L,P,z=w.fill.charAt(w.fill.length-1);"x"!==z&&"y"!==z&&(z=""),"y"===z?(L=1,P=b.c2p(0,!0)):"x"===z&&(L=0,P=_.c2p(0,!0)),f[0][u.isRangePlot?"nodeRangePlot3":"node3"]=k;var D="",O=[],R=w._prevtrace,F=null,B=null;R&&(D=R._prevRevpath||"",I=R._nextFill,O=R._ownPolygons,F=R._fillsegments,B=R._fillElement);var j,N,U,V,q,H,G,W,Z="",Y="",X=[];w._polygons=[];var $=[],K=[],J=i.noop;if(C=w._ownFill,l.hasLines(w)||"none"!==w.fill){I&&I.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(T.shape)?(U=s.steps(T.shape),V=s.steps(T.shape.split("").reverse().join(""))):U=V="spline"===T.shape?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),T.smoothing):s.smoothopen(e,T.smoothing)}:function(e){return"M"+e.join("L")},q=function(e){return V(e.reverse())},K=c(f,{xaxis:_,yaxis:b,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,backoff:T.backoff,simplify:T.simplify,fill:w.fill}),$=new Array(K.length);var Q=0;for(g=0;g<K.length;g++){var ee,te=K[g];ee&&z?ee.push.apply(ee,te):(ee=te.slice(),$[Q]=ee,Q++)}w._fillElement=null,w._fillExclusionElement=B,w._fillsegments=$.slice(0,Q),$=w._fillsegments,K.length&&(H=K[0][0].slice(),W=(G=K[K.length-1])[G.length-1].slice()),J=function(e){return function(t){if(j=U(t),N=q(t),Z?z?(Z+="L"+j.slice(1),Y=N+"L"+Y.slice(1)):(Z+="Z"+j,Y=N+"Z"+Y):(Z=j,Y=N),l.hasLines(w)){var n=r.select(this);if(n.datum(f),e)x(n.style("opacity",0).attr("d",j).call(s.lineGroupStyle)).style("opacity",1);else{var i=x(n);i.attr("d",j),s.singleLineStyle(f,i)}}}}}var re=M.selectAll(".js-line").data(K);x(re.exit()).style("opacity",0).remove(),re.each(J(!1)),re.enter().append("path").classed("js-line",!0).style("vector-effect",y?"none":"non-scaling-stroke").call(s.lineGroupStyle).each(J(!0)),s.setClipUrl(re,u.layerClipId,e);var ne=function(){var e=new Array($.length);for(g=0;g<$.length;g++)e[g]=h($[g]);return e},ie=function(e){var t,r;if(e&&0!==e.length){for(t=new Array(e.length-1+$.length),r=0;r<e.length-1;r++)t[r]=h(e[r]);var n=e[e.length-1].slice();for(n.reverse(),r=0;r<$.length;r++)t[e.length-1+r]=h($[r].concat(n))}else for(t=new Array($.length),r=0;r<$.length;r++){var i=$[r][0].slice(),a=$[r][$[r].length-1].slice();i[L]=a[L]=P;var o=[a,i].concat($[r]);t[r]=h(o)}return t};K.length?(C?(C.datum(f),H&&W&&(z?(H[L]=W[L]=P,x(C).attr("d","M"+W+"L"+H+"L"+Z.slice(1)).call(s.singleFillStyle,e),X=ie(null)):(x(C).attr("d",Z+"Z").call(s.singleFillStyle,e),X=ne())),w._polygons=X,w._fillElement=C):I&&("tonext"===w.fill.slice(0,6)&&Z&&D?("tonext"===w.fill?(x(I).attr("d",Z+"Z"+D+"Z").call(s.singleFillStyle,e),X=ne(),w._polygons=X.concat(O)):(x(I).attr("d",Z+"L"+D.slice(1)+"Z").call(s.singleFillStyle,e),X=ie(F),w._polygons=X),w._fillElement=I):oe(I)),w._prevRevpath=Y):(C?oe(C):I&&oe(I),w._prevRevpath=null),w._ownPolygons=X,S.datum(f),E.datum(f),function(t,n,i){var a,c=i[0].trace,h=l.hasMarkers(c),f=l.hasText(c),p=function(e){if(e.ids)return ue}(c),d=he,m=he;if(h||f){var g=o,y=c.stackgroup,w=y&&"infer zero"===e._fullLayout._scatterStackOpts[_._id+b._id][y].stackgaps;c.marker.maxdisplayed||c._needsCull?g=w?le:se:y&&!w&&(g=ce),h&&(d=g),f&&(m=g)}var T,k=(a=t.selectAll("path.point").data(d,p)).enter().append("path").classed("point",!0);v&&k.call(s.pointStyle,c,e).call(s.translatePoints,_,b).style("opacity",0).transition().style("opacity",1),a.order(),h&&(T=s.makePointStyleFns(c)),a.each((function(t){var n=r.select(this),i=x(n);s.translatePoint(t,i,_,b)?(s.singlePointStyle(t,i,c,T,e),u.layerClipId&&s.hideOutsideRangePoint(t,i,_,b,c.xcalendar,c.ycalendar),c.customdata&&n.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),v?a.exit().transition().style("opacity",0).remove():a.exit().remove(),(a=n.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),a.order(),a.each((function(e){var t=r.select(this),n=x(t.select("text"));s.translatePoint(e,n,_,b)?u.layerClipId&&s.hideOutsideRangePoint(e,t,_,b,c.xcalendar,c.ycalendar):t.remove()})),a.selectAll("text").call(s.textPointStyle,c,e).each((function(e){var t=_.c2p(e.x),n=b.c2p(e.y);r.select(this).selectAll("tspan.line").each((function(){x(r.select(this)).attr({x:t,y:n})}))})),a.exit().remove()}(S,E,f);var ae=!1===w.cliponaxis?null:u.layerClipId;s.setClipUrl(S,ae,e),s.setClipUrl(E,ae,e)}function oe(e){x(e).attr("d","M0,0Z")}function se(e){return e.filter((function(e){return!e.gap&&e.vis}))}function le(e){return e.filter((function(e){return e.vis}))}function ce(e){return e.filter((function(e){return!e.gap}))}function ue(e){return e.id}function he(){return!1}}t.exports=function(e,t,n,i,l,c){var h,p,d=!l,m=!!l&&l.duration>0,g=u(e,t,n);(h=i.selectAll("g.trace").data(g,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),h.order(),function(e,t,n){t.each((function(t){var i=a(r.select(this),"g","fills");s.setClipUrl(i,n.layerClipId,e);var l=t[0].trace;l._ownFill=null,l._nextFill=null;var c=[];l._ownfill&&c.push("_ownFill"),l._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,o);u.enter().append("g"),u.exit().remove(),u.order().each((function(e){l[e]=a(r.select(this),"path","js-fill")}))}))}(e,h,t),m?(c&&(p=c()),r.transition().duration(l.duration).ease(l.easing).each("end",(function(){p&&p()})).each("interrupt",(function(){p&&p()})).each((function(){i.selectAll("g.trace").each((function(r,n){f(e,n,t,r,g,this,l)}))}))):h.each((function(r,n){f(e,n,t,r,g,this,l)})),d&&h.exit().remove(),i.selectAll("path:not([d])").remove()}}}),mi=m({"src/traces/scatter/marker_colorbar.js"(e,t){t.exports={container:"marker",min:"cmin",max:"cmax"}}}),gi=m({"src/traces/scatter/format_labels.js"(e,t){var r=ar();t.exports=function(e,t,n){var i={},a={_fullLayout:n},o=r.getFromTrace(a,t,"x"),s=r.getFromTrace(a,t,"y"),l=e.orig_x;void 0===l&&(l=e.x);var c=e.orig_y;return void 0===c&&(c=e.y),i.xLabel=r.tickText(o,o.c2l(l),!0).text,i.yLabel=r.tickText(s,s.c2l(c),!0).text,i}}}),yi=m({"src/traces/scatter/style.js"(e,t){var r=b(),n=er(),i=He();function a(e,t,r){n.pointStyle(e.selectAll("path.point"),t,r)}function o(e,t,r){n.textPointStyle(e.selectAll("text"),t,r)}t.exports={style:function(e){var t=r.select(e).selectAll("g.trace.scatter");t.style("opacity",(function(e){return e[0].trace.opacity})),t.selectAll("g.points").each((function(t){a(r.select(this),t.trace||t[0].trace,e)})),t.selectAll("g.text").each((function(t){o(r.select(this),t.trace||t[0].trace,e)})),t.selectAll("g.trace path.js-line").call(n.lineGroupStyle),t.selectAll("g.trace path.js-fill").call(n.fillGroupStyle,e,!1),i.getComponentMethod("errorbars","style")(t)},stylePoints:a,styleText:o,styleOnSelect:function(e,t,r){var i=t[0].trace;i.selectedpoints?(n.selectedPointStyle(r.selectAll("path.point"),i),n.selectedTextStyle(r.selectAll("text"),i)):(a(r,i,e),o(r,i,e))}}}}),vi=m({"src/traces/scatter/get_trace_color.js"(e,t){var r=W(),n=Xt();t.exports=function(e,t){var i,a;if("lines"===e.mode)return(i=e.line.color)&&r.opacity(i)?i:e.fillcolor;if("none"===e.mode)return e.fill?e.fillcolor:"";var o=t.mcc||(e.marker||{}).color,s=t.mlcc||((e.marker||{}).line||{}).color;return(a=o&&r.opacity(o)?o:s&&r.opacity(s)&&(t.mlw||((e.marker||{}).line||{}).width)?s:"")?r.opacity(a)<.3?r.addOpacity(a,.3):a:(i=(e.line||{}).color)&&r.opacity(i)&&n.hasLines(e)&&e.line.width?i:e.fillcolor}}}),xi=m({"src/traces/scatter/hover.js"(e,t){var r=ct(),n=Or(),i=He(),a=vi(),o=W(),s=r.fillText;t.exports=function(e,t,l,c){var u=e.cd,h=u[0].trace,f=e.xa,p=e.ya,d=f.c2p(t),m=p.c2p(l),g=[d,m],y=h.hoveron||"",v=-1!==h.mode.indexOf("markers")?3:.5,x=!!h.xperiodalignment,_=!!h.yperiodalignment;if(-1!==y.indexOf("points")){var b=function(e){var t=Math.max(v,e.mrc||0),r=f.c2p(e.x)-d,n=p.c2p(e.y)-m;return Math.max(Math.sqrt(r*r+n*n)-t,1-v/t)},w=n.getDistanceFunction(c,(function(e){if(x){var t=f.c2p(e.xStart),r=f.c2p(e.xEnd);return d>=Math.min(t,r)&&d<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(f.c2p(e.x)-d);return a<n?i*a/n:a-n+i}),(function(e){if(_){var t=p.c2p(e.yStart),r=p.c2p(e.yEnd);return m>=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(p.c2p(e.y)-m);return a<n?i*a/n:a-n+i}),b);if(n.getClosest(u,w,e),!1!==e.index){var T=u[e.index],k=f.c2p(T.x,!0),A=p.c2p(T.y,!0),M=T.mrc||1;e.index=T.i;var S=u[0].t.orientation,E=S&&(T.sNorm||T.s),C="h"===S?E:void 0!==T.orig_x?T.orig_x:T.x,I="v"===S?E:void 0!==T.orig_y?T.orig_y:T.y;return r.extendFlat(e,{color:a(h,T),x0:k-M,x1:k+M,xLabelVal:C,y0:A-M,y1:A+M,yLabelVal:I,spikeDistance:b(T),hovertemplate:h.hovertemplate}),s(T,h,e),i.getComponentMethod("errorbars","hoverInfo")(T,h,e),[e]}}function L(e){if(!e)return!1;var t=e.node();try{var r=new DOMPoint(g[0],g[1]);return t.isPointInFill(r)}catch{var n=t.ownerSVGElement.createSVGPoint();return n.x=g[0],n.y=g[1],t.isPointInFill(n)}}if(-1!==y.indexOf("fills")&&h._fillElement&&L(h._fillElement)&&!L(h._fillExclusionElement)){var P=function(e){var t,r,n,i,a,o,s,l,c,u=[],h=1/0,d=-1/0,m=1/0,y=-1/0;for(t=0;t<e.length;t++){var v=e[t];v.contains(g)&&(u.push(v),m=Math.min(m,v.ymin),y=Math.max(y,v.ymax))}if(0===u.length)return null;for(r=((m=Math.max(m,0))+(y=Math.min(y,p._length)))/2,t=0;t<u.length;t++)for(i=u[t].pts,n=1;n<i.length;n++)(l=i[n-1][1])>r!=(c=i[n][1])>=r&&(o=i[n-1][0],s=i[n][0],c-l&&(a=o+(s-o)*(r-l)/(c-l),h=Math.min(h,a),d=Math.max(d,a)));return{x0:h=Math.max(h,0),x1:d=Math.min(d,f._length),y0:r,y1:r}}(h._polygons);null===P&&(P={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var z=o.defaultLine;return o.opacity(h.fillcolor)?z=h.fillcolor:o.opacity((h.line||{}).color)&&(z=h.line.color),r.extendFlat(e,{distance:e.maxHoverDistance,x0:P.x0,x1:P.x1,y0:P.y0,y1:P.y1,color:z,hovertemplate:!1}),delete e.index,h.text&&!r.isArrayOrTypedArray(h.text)?e.text=String(h.text):e.text=h.name,[e]}}}}),_i=m({"src/traces/scatter/select.js"(e,t){var r=Xt();t.exports=function(e,t){var n,i,a,o,s=e.cd,l=e.xaxis,c=e.yaxis,u=[],h=s[0].trace;if(!r.hasMarkers(h)&&!r.hasText(h))return[];if(!1===t)for(n=0;n<s.length;n++)s[n].selected=0;else for(n=0;n<s.length;n++)i=s[n],a=l.c2p(i.x),o=c.c2p(i.y),null!==i.i&&t.contains([a,o],!1,n,e)?(u.push({pointNumber:i.i,x:l.c2d(i.x),y:c.c2d(i.y)}),i.selected=1):i.selected=0;return u}}}),bi=m({"src/plots/cartesian/attributes.js"(e,t){t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}}),wi=m({"src/plots/cartesian/type_defaults.js"(e,t){var r=He().traceIs,n=nr();function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function a(e,t){var n=i(e),a=r(e,"box-violin"),o=r(e._fullInput||{},"candlestick");return a&&!o&&t===n&&void 0===e[n]&&void 0===e[n+"0"]}t.exports=function(e,t,o,s){o("autotypenumbers",s.autotypenumbersDflt),"-"===o("type",(s.splomStash||{}).type)&&(function(e,t){if("-"===e.type){var o,s=e._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(e,t,r){for(var n=0;n<e.length;n++){var i=e[n];if("splom"===i.type&&i._length>0&&(i["_"+r+"axes"]||{})[t])return i;if((i[r+"axis"]||r)===t){if(a(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(t,s,l);if(c){if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=l+"calendar",h=c[u],f={noMultiCategory:!r(c,"cartesian")||r(c,"noMultiCategory")};if("box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0),f.autotypenumbers=e.autotypenumbers,a(c,l)){var p=i(c),d=[];for(o=0;o<t.length;o++){var m=t[o];!r(m,"box-violin")||(m[l+"axis"]||l)!==s||(void 0!==m[p]?d.push(m[p][0]):void 0!==m.name?d.push(m.name):d.push("text"),m[u]!==h&&(h=void 0))}e.type=n(d,h,f)}else if("splom"===c.type){var g=c.dimensions[c._axesDim[s]];g.visible&&(e.type=n(g.values,h,f))}else e.type=n(c[l]||[c[l+"0"]],h,f)}}}(t,s.data),"-"===t.type?t.type="linear":e.type=t.type)}}}),Ti=m({"src/plots/cartesian/category_order_defaults.js"(e,t){var r=I().isTypedArraySpec;t.exports=function(e,t,n,i){if("category"===t.type){var a,o=e.categoryarray,s=Array.isArray(o)&&o.length>0||r(o);s&&(a="array");var l,c=n("categoryorder",a);"array"===c&&(l=n("categoryarray")),!s&&"array"===c&&(c=t.categoryorder="trace"),"trace"===c?t._initialCategories=[]:"array"===c?t._initialCategories=l.slice():(l=function(e,t){var r,n,i,a=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;n<t.data.length;n++){var s=t.data[n];s[a+"axis"]===e._id&&r.push(s)}for(n=0;n<r.length;n++){var l=r[n][a];for(i=0;i<l.length;i++){var c=l[i];null!=c&&(o[c]=1)}}return Object.keys(o)}(t,i).sort(),"category ascending"===c?t._initialCategories=l:"category descending"===c&&(t._initialCategories=l.reverse()))}}}}),ki=m({"src/plots/cartesian/line_grid_defaults.js"(e,t){var r=F().mix,n=G(),i=ct();t.exports=function(e,t,a,o){var s=(o=o||{}).dfltColor;function l(r,n){return i.coerce2(e,t,o.attributes,r,n)}var c=l("linecolor",s),u=l("linewidth");a("showline",o.showLine||!!c||!!u)||(delete t.linecolor,delete t.linewidth);var h=l("gridcolor",r(s,o.bgColor,o.blend||n.lightFraction).toRgbString()),f=l("gridwidth"),p=l("griddash");if(a("showgrid",o.showGrid||!!h||!!f||!!p)||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),o.hasMinor){var d=l("minor.gridcolor",r(t.gridcolor,o.bgColor,67).toRgbString()),m=l("minor.gridwidth",t.gridwidth||1),g=l("minor.griddash",t.griddash||"solid");a("minor.showgrid",!!d||!!m||!!g)||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!o.noZeroLine){l("zerolinelayer");var y=l("zerolinecolor",s),v=l("zerolinewidth");a("zeroline",o.showGrid||!!y||!!v)||(delete t.zerolinelayer,delete t.zerolinecolor,delete t.zerolinewidth)}}}}),Ai=m({"src/plots/cartesian/axis_defaults.js"(e,t){var r=M(),n=He(),i=ct(),a=vt(),o=Nt(),s=Lt(),l=Ft(),c=Bt(),u=Ut(),h=Vt(),f=Ti(),p=ki(),d=sr(),m=rr(),g=xt().WEEKDAY_PATTERN,y=xt().HOUR_PATTERN;function v(e,t,n){function a(r,n){return i.coerce(e,t,s.rangebreaks,r,n)}if(a("enabled")){var o=a("bounds");if(o&&o.length>=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=_(o[l])){u=g;break}var h=a("pattern",u);if(h===g)for(l=0;l<2;l++)(c=_(o[l]))&&(t.bounds[l]=o[l]=c-1);if(h)for(l=0;l<2;l++)switch(c=o[l],h){case g:if(!r(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[l]=o[l]=c;break;case y:if(!r(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[l]=o[l]=c}if(!1===n.autorange){var f=n.range;if(f[0]<f[1]){if(o[0]<f[0]&&o[1]>f[1])return void(t.enabled=!1)}else if(o[0]>f[0]&&o[1]<f[1])return void(t.enabled=!1)}}else{var p=a("values");if(!p||!p.length)return void(t.enabled=!1);a("dvalue")}}}t.exports=function(e,t,r,y,x){var _,b=y.letter,w=y.font||{},T=y.splomStash||{},k=r("visible",!y.visibleDflt),A=t._template||{},M=t.type||A.type||"-";"date"===M&&(n.getComponentMethod("calendars","handleDefaults")(e,t,"calendar",y.calendar),y.noTicklabelmode||(_=r("ticklabelmode"))),!y.noTicklabelindex&&("date"===M||"linear"===M)&&r("ticklabelindex");var S="";(!y.noTicklabelposition||"multicategory"===M)&&(S=i.coerce(e,t,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:"period"===_?["outside","inside"]:"x"===b?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),y.noTicklabeloverflow||r("ticklabeloverflow",-1!==S.indexOf("inside")?"hide past domain":"category"===M||"multicategory"===M?"allow":"hide past div"),m(t,x),d(e,t,r,y),f(e,t,r,y),y.noHover||("category"!==M&&r("hoverformat"),y.noUnifiedhovertitle||r("unifiedhovertitle.text"));var E=r("color"),C=E!==s.color.dflt?E:w.color,I=T.label||x._dfltTitle[b];if(h(e,t,r,M,y),!k)return t;r("title.text",I),i.coerceFont(r,"title.font",w,{overrideDflt:{size:i.bigFont(w.size),color:C}}),l(e,t,r,M);var L=y.hasMinor;if(L&&(a.newContainer(t,"minor"),l(e,t,r,M,{isMinor:!0})),u(e,t,r,M,y),c(e,t,r,y),L){var P=y.isMinor;y.isMinor=!0,c(e,t,r,y),y.isMinor=P}p(e,t,r,{dfltColor:E,bgColor:y.bgColor,showGrid:y.showGrid,hasMinor:L,attributes:s}),L&&!t.minor.ticks&&!t.minor.showgrid&&delete t.minor,(t.showline||t.ticks)&&r("mirror");var z="multicategory"===M;if(!y.noTickson&&("category"===M||z)&&(t.ticks||t.showgrid)&&(z?(r("tickson","boundaries"),delete t.ticklabelposition):r("tickson")),z&&r("showdividers")&&(r("dividercolor"),r("dividerwidth")),"date"===M)if(o(e,t,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:v}),t.rangebreaks.length){for(var D=0;D<t.rangebreaks.length;D++)if(t.rangebreaks[D].pattern===g){t._hasDayOfWeekBreaks=!0;break}if(m(t,x),x._has("scattergl")||x._has("splom"))for(var O=0;O<y.data.length;O++){var R=y.data[O];("scattergl"===R.type||"splom"===R.type)&&(R.visible=!1,i.warn(R.type+" traces do not work on axes with rangebreaks. Setting trace "+R.index+" to `visible: false`."))}}else delete t.rangebreaks;return t};var x={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function _(e){if("string"==typeof e)return x[e.slice(0,3).toLowerCase()]}}}),Mi=m({"src/plots/cartesian/position_defaults.js"(e,t){var r=M(),n=ct();t.exports=function(e,t,i,a){var o,s,l,c,u,h,f=a.counterAxes||[],p=a.overlayableAxes||[],d=a.letter,m=a.grid,g=a.overlayingDomain;m&&(s=m._domains[d][m._axisMap[t._id]],o=m._anchors[t._id],s&&(l=m[d+"side"].split(" ")[0],c=m.domain[d]["right"===l||"top"===l?1:0])),s=s||[0,1],o=o||(r(e.position)?"free":f[0]||"free"),l=l||("x"===d?"bottom":"left"),c=c||0,u=0,h=!1;var y=n.coerce(e,t,{anchor:{valType:"enumerated",values:["free"].concat(f),dflt:o}},"anchor"),v=n.coerce(e,t,{side:{valType:"enumerated",values:"x"===d?["bottom","top"]:["left","right"],dflt:l}},"side");"free"===y&&("y"===d&&(i("autoshift")&&(c="left"===v?g[0]:g[1],h=!t.automargin||t.automargin,u="left"===v?-3:3),i("shift",u)),i("position",c)),i("automargin",h);var x=!1;if(p.length&&(x=n.coerce(e,t,{overlaying:{valType:"enumerated",values:[!1].concat(p),dflt:!1}},"overlaying")),!x){var _=i("domain",s);_[0]>_[1]-1/4096&&(t.domain=s),n.noneOrAll(e.domain,t.domain,s),"sync"===t.tickmode&&(t.tickmode="auto")}return i("layer"),t}}}),Si=m({"src/plots/cartesian/layout_defaults.js"(e,t){var r=ct(),n=W(),i=Kt().isUnifiedHover,a=Lr(),o=vt(),s=Ve(),l=Lt(),c=wi(),u=Ai(),h=nn(),f=Mi(),p=_t(),d=p.id2name,m=p.name2id,g=xt().AX_ID_PATTERN,y=He(),v=y.traceIs,x=y.getComponentMethod;function _(e,t,r){Array.isArray(e[t])?e[t].push(r):e[t]=[r]}t.exports=function(e,t,y){var b,w,T=t.autotypenumbers,k={},A={},M={},S={},E={},C={},I={},L={},P={},z={};for(b=0;b<y.length;b++){var D=y[b];if(v(D,"cartesian")){var O,R;if(D.xaxis)O=d(D.xaxis),_(k,O,D);else if(D.xaxes)for(w=0;w<D.xaxes.length;w++)_(k,d(D.xaxes[w]),D);if(D.yaxis)R=d(D.yaxis),_(k,R,D);else if(D.yaxes)for(w=0;w<D.yaxes.length;w++)_(k,d(D.yaxes[w]),D);"funnel"===D.type?"h"===D.orientation?(O&&(A[O]=!0),R&&(I[R]=!0)):R&&(M[R]=!0):"image"===D.type?(R&&(L[R]=!0),O&&(L[O]=!0)):(R&&(E[R]=!0,C[R]=!0),(!v(D,"carpet")||"carpet"===D.type&&!D._cheater)&&O&&(S[O]=!0)),"carpet"===D.type&&D._cheater&&O&&(A[O]=!0),v(D,"2dMap")&&(P[O]=!0,P[R]=!0),v(D,"oriented")&&(z["h"===D.orientation?R:O]=!0)}}var F=t._subplots,B=F.xaxis,j=F.yaxis,N=r.simpleMap(B,d),U=r.simpleMap(j,d),V=N.concat(U),q=n.background;B.length&&j.length&&(q=r.coerce(e,t,s,"plot_bgcolor"));var H,G,W,Z,Y,X=n.combine(q,t.paper_bgcolor);function $(){var e=k[H]||[];Y._traceIndices=e.map((function(e){return e.index})),Y._annIndices=[],Y._shapeIndices=[],Y._selectionIndices=[],Y._imgIndices=[],Y._subplotsWith=[],Y._counterAxes=[],Y._name=Y._attr=H,Y._id=G}function K(e,t){return r.coerce(Z,Y,l,e,t)}function J(e,t){return r.coerce2(Z,Y,l,e,t)}function Q(e){return"x"===e?j:B}function ee(t,r){for(var n="x"===t?N:U,i=[],a=0;a<n.length;a++){var o=n[a];o!==r&&!(e[o]||{}).overlaying&&i.push(m(o))}return i}var te={x:Q("x"),y:Q("y")},re=te.x.concat(te.y),ne={},ie=[];function ae(){var e=Z.matches;g.test(e)&&-1===re.indexOf(e)&&(ne[e]=Z.type,ie=Object.keys(ne))}var oe=a(e,t),se=i(oe);for(b=0;b<V.length;b++){H=V[b],G=m(H),W=H.charAt(0),r.isPlainObject(e[H])||(e[H]={}),Z=e[H],Y=o.newContainer(t,H,W+"axis"),$();var le="x"===W&&!S[H]&&A[H]||"y"===W&&!E[H]&&M[H],ce="y"===W&&(!C[H]&&I[H]||L[H]),ue={hasMinor:!0,letter:W,font:t.font,outerTicks:P[H],showGrid:!z[H],data:k[H]||[],bgColor:X,calendar:t.calendar,automargin:!0,visibleDflt:le,reverseDflt:ce,autotypenumbersDflt:T,splomStash:((t._splomAxes||{})[W]||{})[G],noAutotickangles:"y"===W};K("uirevision",t.uirevision),c(Z,Y,K,ue),u(Z,Y,K,ue,t);var he=se&&W===oe.charAt(0),fe=J("spikecolor",se?Y.color:void 0),pe=J("spikethickness",se?1.5:void 0),de=J("spikedash",se?"dot":void 0),me=J("spikemode",se?"across":void 0),ge=J("spikesnap");K("showspikes",!!(he||fe||pe||de||me||ge))||(delete Y.spikecolor,delete Y.spikethickness,delete Y.spikedash,delete Y.spikemode,delete Y.spikesnap);var ye=d(Z.overlaying),ve=[0,1];if(void 0!==t[ye]){var xe=d(t[ye].anchor);void 0!==t[xe]&&(ve=t[xe].domain)}f(Z,Y,K,{letter:W,counterAxes:te[W],overlayableAxes:ee(W,H),grid:t.grid,overlayingDomain:ve}),K("title.standoff"),ae(),Y._input=Z}for(b=0;b<ie.length;){G=ie[b++],W=(H=d(G)).charAt(0),r.isPlainObject(e[H])||(e[H]={}),Z=e[H],Y=o.newContainer(t,H,W+"axis"),$();var _e={letter:W,font:t.font,outerTicks:P[H],showGrid:!z[H],data:[],bgColor:X,calendar:t.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:T,splomStash:((t._splomAxes||{})[W]||{})[G]};K("uirevision",t.uirevision),Y.type=ne[G]||"linear",u(Z,Y,K,_e,t),f(Z,Y,K,{letter:W,counterAxes:te[W],overlayableAxes:ee(W,H),grid:t.grid}),K("fixedrange"),K("modebardisable"),ae(),Y._input=Z}var be=x("rangeslider","handleDefaults"),we=x("rangeselector","handleDefaults");for(b=0;b<N.length;b++)H=N[b],Z=e[H],Y=t[H],be(e,t,H),"date"===Y.type&&we(Z,Y,t,U,Y.calendar),K("fixedrange"),K("modebardisable");for(b=0;b<U.length;b++){H=U[b],Z=e[H],Y=t[H];var Te=t[d(Y.anchor)];K("fixedrange",x("rangeslider","isVisible")(Te)),K("modebardisable")}h.handleDefaults(e,t,{axIds:re.concat(ie).sort(p.idSort),axHasImage:L})}}}),Ei=m({"src/plots/cartesian/transition_axes.js"(e,t){var r=b(),n=He(),i=ct(),a=er(),o=ar();t.exports=function(e,t,s,l){var c=e._fullLayout;if(0!==t.length){var u;l&&(u=l());var h,f,p,d=r.ease(s.easing);return e._transitionData._interruptCallbacks.push((function(){return window.cancelAnimationFrame(p),p=null,function(){for(var r={},i=0;i<t.length;i++){var a=t[i],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr0&&(r[o._name+".range"]=a.xr0.slice()),a.yr0&&(r[s._name+".range"]=a.yr0.slice())}return n.call("relayout",e,r).then((function(){for(var e=0;e<t.length;e++)m(t[e].plotinfo)}))}()})),h=Date.now(),p=window.requestAnimationFrame((function r(){f=Date.now();for(var i=Math.min(1,(f-h)/s.duration),a=d(i),o=0;o<t.length;o++)g(t[o],a);f-h>s.duration?(function(){for(var r={},i=0;i<t.length;i++){var a=t[i],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr1&&(r[o._name+".range"]=a.xr1.slice()),a.yr1&&(r[s._name+".range"]=a.yr1.slice())}u&&u(),n.call("relayout",e,r).then((function(){for(var e=0;e<t.length;e++)m(t[e].plotinfo)}))}(),p=window.cancelAnimationFrame(r)):p=window.requestAnimationFrame(r)})),Promise.resolve()}function m(e){var t=e.xaxis,r=e.yaxis;c._defs.select("#"+e.clipId+"> rect").call(a.setTranslate,0,0).call(a.setScale,1,1),e.plot.call(a.setTranslate,t._offset,r._offset).call(a.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,e)}function g(t,r){var n=t.plotinfo,s=n.xaxis,l=n.yaxis,c=s._length,u=l._length,h=!!t.xr1,f=!!t.yr1,p=[];if(h){var d=i.simpleMap(t.xr0,s.r2l),m=i.simpleMap(t.xr1,s.r2l),g=d[1]-d[0],y=m[1]-m[0];p[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*c,p[2]=c*(1-r+r*y/g),s.range[0]=s.l2r(d[0]*(1-r)+r*m[0]),s.range[1]=s.l2r(d[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(f){var v=i.simpleMap(t.yr0,l.r2l),x=i.simpleMap(t.yr1,l.r2l),_=v[1]-v[0],b=x[1]-x[0];p[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,p[3]=u*(1-r+r*b/_),l.range[0]=s.l2r(v[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;o.drawOne(e,s,{skipTitle:!0}),o.drawOne(e,l,{skipTitle:!0}),o.redrawComponents(e,[s._id,l._id]);var w=h?c/p[2]:1,T=f?u/p[3]:1,k=h?p[0]:0,A=f?p[1]:0,M=h?p[0]/p[2]*c:0,S=f?p[1]/p[3]*u:0,E=s._offset-M,C=l._offset-S;n.clipRect.call(a.setTranslate,k,A).call(a.setScale,1/w,1/T),n.plot.call(a.setTranslate,E,C).call(a.setScale,w,T),a.setPointGroupScale(n.zoomScalePts,1/w,1/T),a.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}o.redrawComponents(e)}}}),Ci=m({"src/plots/cartesian/index.js"(e){var t=b(),r=He(),n=ct(),i=At(),a=er(),o=Tt().getModuleCalcData,s=_t(),l=xt(),c=Mt(),u=n.ensureSingle;function h(e,t,r){return n.ensureSingle(e,t,r,(function(e){e.datum(r)}))}var f=l.zindexSeparator;function p(e,n,i,s,c){for(var u,h,f,p=l.traceLayerClasses,d=e._fullLayout,m=d._zindices,g=d._modules,y=[],v=[],x=0;x<m.length;x++)for(var _=m[x],b=0;b<g.length;b++){var w=(u=g[b]).name,T=r.modules[w].categories;if(T.svg){var k=u.layerName||w+"layer",A=k+(x?Number(x)+1:""),M=u.plot;f=(h=o(i,M,_))[0],i=h[1],f.length&&y.push({i:p.indexOf(k),zindex:x,className:A,plotMethod:M,cdModule:f}),T.zoomScale&&v.push("."+A)}}y.sort((function(e,t){return(e.zindex||0)-(t.zindex||0)||e.i-t.i}));var S=n.plot.selectAll("g.mlayer").data(y,(function(e){return e.className}));if(S.enter().append("g").attr("class",(function(e){return e.className})).classed("mlayer",!0).classed("rangeplot",n.isRangePlot),S.exit().remove(),S.order(),S.each((function(r){var i=t.select(this),o=r.className;r.plotMethod(e,n,r.cdModule,i,s,c),-1===l.clipOnAxisFalseQuery.indexOf("."+o)&&a.setClipUrl(i,n.layerClipId,e)})),d._has("scattergl")&&(u=r.getModule("scattergl"),f=o(i,u)[0],u.plot(e,n,f)),!e._context.staticPlot&&(n._hasClipOnAxisFalse&&(n.clipOnAxisFalseTraces=n.plot.selectAll(l.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),v.length)){var E=n.plot.selectAll(v.join(",")).selectAll(".trace");n.zoomScalePts=E.selectAll("path.point"),n.zoomScaleTxt=E.selectAll(".textpoint")}}function d(e,t){var r=e._fullLayout,n=t.plotgroup,i=t.id,a=-1!==i.indexOf(f),o=l.layerValue2layerClass[t.xaxis.layer],c=l.layerValue2layerClass[t.yaxis.layer],p=r._hasOnlyLargeSploms,d=r._zindices.length>1,m=t.mainplotinfo;if(!t.mainplot||d)if(p)t.xlines=u(n,"path","xlines-above"),t.ylines=u(n,"path","ylines-above"),t.xaxislayer=u(n,"g","xaxislayer-above"),t.yaxislayer=u(n,"g","yaxislayer-above");else{if(!a){var g=u(n,"g","layer-subplot");t.shapelayer=u(g,"g","shapelayer"),t.imagelayer=u(g,"g","imagelayer"),m&&d?(t.minorGridlayer=m.minorGridlayer,t.gridlayer=m.gridlayer,t.zerolinelayer=m.zerolinelayer):(t.minorGridlayer=u(n,"g","minor-gridlayer"),t.gridlayer=u(n,"g","gridlayer"),t.zerolinelayer=u(n,"g","zerolinelayer"));var y=u(n,"g","layer-between");t.shapelayerBetween=u(y,"g","shapelayer"),t.imagelayerBetween=u(y,"g","imagelayer"),u(n,"path","xlines-below"),u(n,"path","ylines-below"),t.overlinesBelow=u(n,"g","overlines-below"),u(n,"g","xaxislayer-below"),u(n,"g","yaxislayer-below"),t.overaxesBelow=u(n,"g","overaxes-below")}t.overplot=u(n,"g","overplot"),t.plot=u(t.overplot,"g",i),t.zerolinelayerAbove=m&&d?m.zerolinelayerAbove:u(n,"g","zerolinelayer-above"),a||(t.xlines=u(n,"path","xlines-above"),t.ylines=u(n,"path","ylines-above"),t.overlinesAbove=u(n,"g","overlines-above"),u(n,"g","xaxislayer-above"),u(n,"g","yaxislayer-above"),t.overaxesAbove=u(n,"g","overaxes-above"),t.xlines=n.select(".xlines-"+o),t.ylines=n.select(".ylines-"+c),t.xaxislayer=n.select(".xaxislayer-"+o),t.yaxislayer=n.select(".yaxislayer-"+c))}else{var v=m.plotgroup,x=i+"-x",_=i+"-y";t.minorGridlayer=m.minorGridlayer,t.gridlayer=m.gridlayer,t.zerolinelayer=m.zerolinelayer,t.zerolinelayerAbove=m.zerolinelayerAbove,u(m.overlinesBelow,"path",x),u(m.overlinesBelow,"path",_),u(m.overaxesBelow,"g",x),u(m.overaxesBelow,"g",_),t.plot=u(m.overplot,"g",i),u(m.overlinesAbove,"path",x),u(m.overlinesAbove,"path",_),u(m.overaxesAbove,"g",x),u(m.overaxesAbove,"g",_),t.xlines=v.select(".overlines-"+o).select("."+x),t.ylines=v.select(".overlines-"+c).select("."+_),t.xaxislayer=v.select(".overaxes-"+o).select("."+x),t.yaxislayer=v.select(".overaxes-"+c).select("."+_)}a||(p||(h(t.minorGridlayer,"g",t.xaxis._id),h(t.minorGridlayer,"g",t.yaxis._id),t.minorGridlayer.selectAll("g").map((function(e){return e[0]})).sort(s.idSort),h(t.gridlayer,"g",t.xaxis._id),h(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 m(e,r){if(e){var n={};for(var i in e.each((function(e){var i=e[0];t.select(this).remove(),g(i,r),n[i]=!0})),r._plots)for(var a=r._plots[i].overlays||[],o=0;o<a.length;o++){var s=a[o];n[s.id]&&s.plot.selectAll(".trace").remove()}}}function g(e,t){t._draggers.selectAll("g."+e).remove(),t._defs.select("#clip"+t._uid+e+"plot").remove()}e.name="cartesian",e.attr=["xaxis","yaxis"],e.idRoot=["x","y"],e.idRegex=l.idRegex,e.attrRegex=l.attrRegex,e.attributes=bi(),e.layoutAttributes=Lt(),e.supplyLayoutDefaults=Si(),e.transitionAxes=Ei(),e.finalizeSubplots=function(e,t){var r,i,a,o=t._subplots,c=o.xaxis,u=o.yaxis,h=o.cartesian,f=h,p={},d={};for(r=0;r<f.length;r++){var m=f[r].split("y");p[m[0]]=1,d["y"+m[1]]=1}for(r=0;r<c.length;r++)p[i=c[r]]||(a=(e[s.id2name(i)]||{}).anchor,l.idRegex.y.test(a)||(a="y"),h.push(i+a),f.push(i+a),d[a]||(d[a]=1,n.pushUnique(u,a)));for(r=0;r<u.length;r++)d[a=u[r]]||(i=(e[s.id2name(a)]||{}).anchor,l.idRegex.x.test(i)||(i="x"),h.push(i+a),f.push(i+a),p[i]||(p[i]=1,n.pushUnique(c,i)));if(!f.length){for(var g in i="",a="",e)l.attrRegex.test(g)&&("x"===g.charAt(0)?(!i||+g.slice(5)<+i.slice(5))&&(i=g):(!a||+g.slice(5)<+a.slice(5))&&(a=g));i=i?s.name2id(i):"x",a=a?s.name2id(a):"y",c.push(i),u.push(a),h.push(i+a)}},e.plot=function(e,t,r,i){var a,o=e._fullLayout,s=o._subplots.cartesian,l=e.calcdata;if(!Array.isArray(t))for(t=[],a=0;a<l.length;a++)t.push(a);for(var c=o._zindices,u=0;u<c.length;u++){var h=c[u];for(a=0;a<s.length;a++){var d=s[a],m=o._plots[d];if(u>0){var g=m.id;if(-1!==g.indexOf(f))continue;g+=f+(u+1),m=n.extendFlat({},m,{id:g,plot:o._cartesianlayer.selectAll(".subplot").select("."+g)})}for(var y,v=[],x=0;x<l.length;x++){var _=l[x],b=_[0].trace;h===(b.zorder||0)&&b.xaxis+b.yaxis===d&&((-1!==t.indexOf(b.index)||b.carpet)&&(y&&y[0].trace.xaxis+y[0].trace.yaxis===d&&-1!==["tonextx","tonexty","tonext"].indexOf(b.fill)&&-1===v.indexOf(y)&&v.push(y),v.push(_)),y=_)}p(e,m,v,r,i)}}},e.clean=function(e,t,r,n){var i,a,o,l=n._plots||{},c=t._plots||{},u=n._subplots||{};if(n._hasOnlyLargeSploms&&!t._hasOnlyLargeSploms)for(o in l)(i=l[o]).plotgroup&&i.plotgroup.remove();var h=n._has&&n._has("gl"),p=t._has&&t._has("gl");if(h&&!p)for(o in l)(i=l[o])._scene&&i._scene.destroy();if(u.xaxis&&u.yaxis){var d=s.listIds({_fullLayout:n});for(a=0;a<d.length;a++){var y=d[a];t[s.id2name(y)]||n._infolayer.selectAll(".g-"+y+"title").remove()}}var v=n._has&&n._has("cartesian"),x=t._has&&t._has("cartesian");if(v&&!x)m(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups,delete n._axisMatchGroups;else if(u.cartesian)for(a=0;a<u.cartesian.length;a++){var _=u.cartesian[a];if(-1===_.indexOf(f)&&!c[_]){var b="."+_+",."+_+"-x,."+_+"-y";n._cartesianlayer.selectAll(b).remove(),g(_,n)}}},e.drawFramework=function(e){var r,i=e._fullLayout,a=e.calcdata,o={};for(r=0;r<a.length;r++){var s=a[r][0],l=s.trace.zorder||0;o[l]||(o[l]=[]),o[l].push(s)}var c=Object.keys(o).map(Number).sort(n.sorterAsc);c.length||(c=[0]),i._zindices=c;var h=function(e){var t,r,n,i,a,o,s=e._fullLayout,l=s._zindices.length,c=s._subplots.cartesian,u=c.length,h=[],p=[];for(t=0;t<u;t++){n=c[t],a=(i=s._plots[n]).xaxis,o=i.yaxis;var d=a._mainAxis,m=o._mainAxis,g=d._id+m._id,y=s._plots[g];i.overlays=[],g!==n&&y?(i.mainplot=g,i.mainplotinfo=y,p.push(n)):(i.mainplot=void 0,i.mainplotinfo=void 0,h.push(n))}for(t=0;t<p.length;t++)n=p[t],(i=s._plots[n]).mainplotinfo.overlays.push(i);var v=h.concat(p),x=[];for(t=0;t<u;t++){n=v[t],a=(i=s._plots[n]).xaxis,o=i.yaxis;for(var _=[],b=1;b<=l;b++){var w="";for(b>1&&(w+=f+b),_.push(n+w),r=0;r<i.overlays.length;r++)_.push(i.overlays[r].id+w)}_=_.concat([a.layer,o.layer,a.overlaying||"",o.overlaying||""]),x.push(_)}return x}(e),p=h.length,g=[];for(r=0;r<p;r++)g[r]=h[r].slice();for(var y=1;y<c.length;y++){var v=[];for(r=0;r<p;r++)v[r]=h[r].slice(),v[r][0]+=f+(y+1);g=g.concat(v)}var x=i._cartesianlayer.selectAll(".subplot").data(g,String);x.enter().append("g").attr("class",(function(e){return"subplot "+e[0]})),x.order(),x.exit().call(m,i),x.each((function(r){var a=r[0],o=a.indexOf(f),s=-1!==o,l=s?a.slice(0,o):a,c=i._plots[a];c||(c=n.extendFlat({},i._plots[l]))&&(c.id=a,i._plots[a]=c,i._subplots.cartesian.push(a)),c&&(c.plotgroup=t.select(this),d(e,c),s||(c.draglayer=u(i._draggers,"g",a)))}))},e.rangePlot=function(e,t,r){d(e,t),p(e,t,r),i.style(e)},e.toSVG=function(e){var r=e._fullLayout._glimages,n=t.select(e).selectAll(".svg-container");n.filter((function(e,t){return t===n.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var e=this,t=e.toDataURL("image/png");r.append("svg:image").attr({xmlns:c.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:e.style.width,height:e.style.height})}))},e.updateFx=Ln().updateFx}}),Ii=m({"src/traces/scatter/index.js"(e,t){var r=Xt();t.exports={hasLines:r.hasLines,hasMarkers:r.hasMarkers,hasText:r.hasText,isBubble:r.isBubble,attributes:kn(),layoutAttributes:wt(),supplyDefaults:Qn(),crossTraceDefaults:ti(),supplyLayoutDefaults:ri(),calc:si().calc,crossTraceCalc:hi(),arraysToCalcdata:ai(),plot:di(),colorbar:mi(),formatLabels:gi(),style:yi().style,styleOnSelect:yi().styleOnSelect,hoverPoints:xi(),selectPoints:_i(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Ci(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}}),Li=m({"src/components/annotations/draw_arrow_head.js"(e,t){var r=b(),n=W(),i=xn(),a=ct(),o=a.strScale,s=a.strRotate,l=a.strTranslate;t.exports=function(e,t,a){var c,u,h,f,p=e.node(),d=i[a.arrowhead||0],m=i[a.startarrowhead||0],g=(a.arrowwidth||1)*(a.arrowsize||1),y=(a.arrowwidth||1)*(a.startarrowsize||1),v=t.indexOf("start")>=0,x=t.indexOf("end")>=0,_=d.backoff*g+a.standoff,b=m.backoff*y+a.startstandoff;if("line"===p.nodeName){c={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=c.x-u.x,T=c.y-u.y;if(f=(h=Math.atan2(T,w))+Math.PI,_&&b&&_+b>Math.sqrt(w*w+T*T))return void D();if(_){if(_*_>w*w+T*T)return void D();var k=_*Math.cos(h),A=_*Math.sin(h);u.x+=k,u.y+=A,e.attr({x2:u.x,y2:u.y})}if(b){if(b*b>w*w+T*T)return void D();var M=b*Math.cos(h),S=b*Math.sin(h);c.x-=M,c.y-=S,e.attr({x1:c.x,y1:c.y})}}else if("path"===p.nodeName){var E=p.getTotalLength(),C="";if(E<_+b)return void D();var I=p.getPointAtLength(0),L=p.getPointAtLength(.1);h=Math.atan2(I.y-L.y,I.x-L.x),c=p.getPointAtLength(Math.min(b,E)),C="0px,"+b+"px,";var P=p.getPointAtLength(E),z=p.getPointAtLength(E-.1);f=Math.atan2(P.y-z.y,P.x-z.x),u=p.getPointAtLength(Math.max(0,E-_)),C+=E-(C?b+_:_)+"px,"+E+"px",e.style("stroke-dasharray",C)}function D(){e.style("stroke-dasharray","0px,100px")}function O(t,i,c,u){t.path&&(t.noRotate&&(c=0),r.select(p.parentNode).append("path").attr({class:e.attr("class"),d:t.path,transform:l(i.x,i.y)+s(180*c/Math.PI)+o(u)}).style({fill:n.rgb(a.arrowcolor),"stroke-width":0}))}v&&O(m,c,h,y),x&&O(d,u,f,g)}}}),Pi=m({"src/components/annotations/draw.js"(e,t){var r=b(),n=He(),i=At(),a=ct(),o=a.strTranslate,s=ar(),l=W(),c=er(),u=Or(),h=Et(),f=dr(),p=pr(),d=vt().arrayEditor,m=Li();function g(e,t){var r=e._fullLayout.annotations[t]||{},n=s.getFromId(e,r.xref),i=s.getFromId(e,r.yref);n&&n.setScale(),i&&i.setScale(),v(e,r,t,!1,n,i)}function y(e,t,r,n,i){var a=i[r],o=i[r+"ref"],l=-1!==r.indexOf("y"),c="domain"===s.getRefType(o),u=l?n.h:n.w;return e?c?a+(l?-t:t)/e._length:e.p2r(e.r2p(a)+t):a+(l?-t:t)/u}function v(e,t,i,g,v,x){var _,b,w=e._fullLayout,T=e._fullLayout._size,k=e._context.edits;g?(_="annotation-"+g,b=g+".annotations"):(_="annotation",b="annotations");var A=d(e.layout,b,t),M=A.modifyBase,S=A.modifyItem,E=A.getUpdateObj;w._infolayer.selectAll("."+_+'[data-index="'+i+'"]').remove();var C="clip"+w._uid+"_ann"+i;if(t._input&&!1!==t.visible){var I={x:{},y:{}},L=+t.textangle||0,P=w._infolayer.append("g").classed(_,!0).attr("data-index",String(i)).style("opacity",t.opacity),z=P.append("g").classed("annotation-text-g",!0),D=k[t.showarrow?"annotationTail":"annotationPosition"],O=t.captureevents||k.annotationText||D,R=z.append("g").style("pointer-events",O?"all":null).call(f,"pointer").on("click",(function(){e._dragging=!1,e.emit("plotly_clickannotation",W(r.event))}));t.hovertext&&R.on("mouseover",(function(){var r=t.hoverlabel,n=r.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:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontShadow:n.fontShadow,fontLineposition:n.fontLineposition,fontTextcase:n.fontTextcase},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:e})})).on("mouseout",(function(){u.loneUnhover(w._hoverlayer.node())}));var F=t.borderwidth,B=t.borderpad,j=F+B,N=R.append("rect").attr("class","bg").style("stroke-width",F+"px").call(l.stroke,t.bordercolor).call(l.fill,t.bgcolor),U=t.width||t.height,V=w._topclips.selectAll("#"+C).data(U?[0]:[]);V.enter().append("clipPath").classed("annclip",!0).attr("id",C).append("rect"),V.exit().remove();var q=t.font,H=w._meta?a.templateString(t.text,w._meta):t.text,G=R.append("text").classed("annotation-text",!0).text(H);k.annotationText?G.call(h.makeEditable,{delegate:R,gd:e}).call(Z).on("edit",(function(r){t.text=r,this.call(Z),S("text",r),v&&v.autorange&&M(v._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0),n.call("_guiRelayout",e,E())})):G.call(Z)}else r.selectAll("#"+C).remove();function W(e){var r={index:i,annotation:t._input,fullAnnotation:t,event:e};return g&&(r.subplotId=g),r}function Z(r){return r.call(c.font,q).attr({"text-anchor":{left:"start",right:"end"}[t.align]||"middle"}),h.convertToTspans(r,e,Y),r}function Y(){var r=G.selectAll("a");1===r.size()&&r.text()===G.text()&&R.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(N.node());var i=R.select(".annotation-text-math-group"),u=!i.empty(),d=c.bBox((u?i:G).node()),_=d.width,b=d.height,A=t.width||_,O=t.height||b,B=Math.round(A+2*j),q=Math.round(O+2*j);function H(e,t){return"auto"===t&&(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 Z=!1,Y=["x","y"],X=0;X<Y.length;X++){var $,K,J,Q,ee,te=Y[X],re=t[te+"ref"]||te,ne=t["a"+te+"ref"],ie={x:v,y:x}[te],ae=(L+("x"===te?0:-90))*Math.PI/180,oe=B*Math.cos(ae),se=q*Math.sin(ae),le=Math.abs(oe)+Math.abs(se),ce=t[te+"anchor"],ue=t[te+"shift"]*("x"===te?1:-1),he=I[te],fe=s.getRefType(re);if(ie&&"domain"!==fe){var pe=ie.r2fraction(t[te]);(pe<0||pe>1)&&(ne===re?((pe=ie.r2fraction(t["a"+te]))<0||pe>1)&&(Z=!0):Z=!0),$=ie._offset+ie.r2p(t[te]),Q=.5}else{var de="domain"===fe;"x"===te?(J=t[te],$=de?ie._offset+ie._length*J:$=T.l+T.w*J):(J=1-t[te],$=de?ie._offset+ie._length*J:$=T.t+T.h*J),Q=t.showarrow?.5:J}if(t.showarrow){he.head=$;var me=t["a"+te];if(ee=oe*H(.5,t.xanchor)-se*H(.5,t.yanchor),ne===re){var ge=s.getRefType(ne);"domain"===ge?("y"===te&&(me=1-me),he.tail=ie._offset+ie._length*me):"paper"===ge?"y"===te?(me=1-me,he.tail=T.t+T.h*me):he.tail=T.l+T.w*me:he.tail=ie._offset+ie.r2p(me),K=ee}else he.tail=$+me,K=ee+me;he.text=he.tail+ee;var ye=w["x"===te?"width":"height"];if("paper"===re&&(he.head=a.constrain(he.head,1,ye-1)),"pixel"===ne){var ve=-Math.max(he.tail-3,he.text),xe=Math.min(he.tail+3,he.text)-ye;ve>0?(he.tail+=ve,he.text+=ve):xe>0&&(he.tail-=xe,he.text-=xe)}he.tail+=ue,he.head+=ue}else K=ee=le*H(Q,ce),he.text=$+ee;he.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=le/2+K,t["_"+te+"padminus"]=le/2-K,t["_"+te+"size"]=le,t["_"+te+"shift"]=ee}if(Z)R.remove();else{var _e=0,be=0;if("left"!==t.align&&(_e=(A-_)*("center"===t.align?.5:1)),"top"!==t.valign&&(be=(O-b)*("middle"===t.valign?.5:1)),u)i.select("svg").attr({x:j+_e-1,y:j+be}).call(c.setClipUrl,U?C:null,e);else{var we=j+be-d.top,Te=j+_e-d.left;G.call(h.positionText,Te,we).call(c.setClipUrl,U?C:null,e)}V.select("rect").call(c.setRect,j,j,A,O),N.call(c.setRect,F/2,F/2,B-F,q-F),R.call(c.setTranslate,Math.round(I.x.text-B/2),Math.round(I.y.text-q/2)),z.attr({transform:"rotate("+L+","+I.x.text+","+I.y.text+")"});var ke,Ae=function(r,i){P.selectAll(".annotation-arrow-g").remove();var s=I.x.head,u=I.y.head,h=I.x.tail+r,f=I.y.tail+i,d=I.x.text+r,_=I.y.text+i,b=a.rotationXYMatrix(L,d,_),w=a.apply2DTransform(b),A=a.apply2DTransform2(b),C=+N.attr("width"),D=+N.attr("height"),O=d-.5*C,F=O+C,B=_-.5*D,j=B+D,U=[[O,B,O,j],[O,j,F,j],[F,j,F,B],[F,B,O,B]].map(A);if(!U.reduce((function(e,t){return e^!!a.segmentsIntersect(s,u,s+1e6,u+1e6,t[0],t[1],t[2],t[3])}),!1)){U.forEach((function(e){var t=a.segmentsIntersect(h,f,s,u,e[0],e[1],e[2],e[3]);t&&(h=t.x,f=t.y)}));var V=t.arrowwidth,q=t.arrowcolor,H=t.arrowside,G=P.append("g").style({opacity:l.opacity(q)}).classed("annotation-arrow-g",!0),W=G.append("path").attr("d","M"+h+","+f+"L"+s+","+u).style("stroke-width",V+"px").call(l.stroke,l.rgb(q));if(m(W,H,t),k.annotationPosition&&W.node().parentNode&&!g){var Z=s,Y=u;if(t.standoff){var X=Math.sqrt(Math.pow(s-h,2)+Math.pow(u-f,2));Z+=t.standoff*(h-s)/X,Y+=t.standoff*(f-u)/X}var $,K,J=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-Z)+","+(f-Y),transform:o(Z,Y)}).style("stroke-width",V+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");p.init({element:J.node(),gd:e,prepFn:function(){var e=c.getTranslate(R);$=e.x,K=e.y,v&&v.autorange&&M(v._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0)},moveFn:function(e,r){var n=w($,K),i=n[0]+e,a=n[1]+r;R.call(c.setTranslate,i,a),S("x",y(v,e,"x",T,t)),S("y",y(x,r,"y",T,t)),t.axref===t.xref&&S("ax",y(v,e,"ax",T,t)),t.ayref===t.yref&&S("ay",y(x,r,"ay",T,t)),G.attr("transform",o(e,r)),z.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){n.call("_guiRelayout",e,E());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};t.showarrow&&Ae(0,0),D&&p.init({element:R.node(),gd:e,prepFn:function(){ke=z.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?S("ax",y(v,e,"ax",T,t)):S("ax",t.ax+e),t.ayref===t.yref?S("ay",y(x,r,"ay",T.w,t)):S("ay",t.ay+r),Ae(e,r);else{if(g)return;var i,a;if(v)i=y(v,e,"x",T,t);else{var s=t._xsize/T.w,l=t.x+(t._xshift-t.xshift)/T.w-s/2;i=p.align(l+e/T.w,s,0,1,t.xanchor)}if(x)a=y(x,r,"y",T,t);else{var c=t._ysize/T.h,u=t.y-(t._yshift+t.yshift)/T.h-c/2;a=p.align(u-r/T.h,c,0,1,t.yanchor)}S("x",i),S("y",a),(!v||!x)&&(n=p.getCursor(v?.5:i,x?.5:a,t.xanchor,t.yanchor))}z.attr({transform:o(e,r)+ke}),f(R,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",W(n))},doneFn:function(){f(R),n.call("_guiRelayout",e,E());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r<t.annotations.length;r++)t.annotations[r].visible&&g(e,r);return i.previousPromises(e)},drawOne:g,drawRaw:v}}}),zi=m({"src/components/annotations/click.js"(e,t){var r=ct(),n=He(),i=vt().arrayEditor;function a(e,t){var r,n,i,a,s,l,c,u=e._fullLayout.annotations,h=[],f=[],p=[],d=(t||[]).length;for(r=0;r<u.length;r++)if(a=(i=u[r]).clicktoshow){for(n=0;n<d;n++)if(l=(s=t[n]).xaxis,c=s.yaxis,l._id===i.xref&&c._id===i.yref&&l.d2r(s.x)===o(i._xclick,l)&&c.d2r(s.y)===o(i._yclick,c)){(i.visible?"onout"===a?f:p:h).push(r);break}n===d&&i.visible&&"onout"===a&&f.push(r)}return{on:h,off:f,explicitOff:p}}function o(e,t){return"log"===t.type?t.l2r(e):t.d2r(e)}t.exports={hasClickToShow:function(e,t){var r=a(e,t);return r.on.length>0||r.explicitOff.length>0},onClick:function(e,t){var o,s,l=a(e,t),c=l.on,u=l.off.concat(l.explicitOff),h={},f=e._fullLayout.annotations;if(c.length||u.length){for(o=0;o<c.length;o++)(s=i(e.layout,"annotations",f[c[o]])).modifyItem("visible",!0),r.extendFlat(h,s.getUpdateObj());for(o=0;o<u.length;o++)(s=i(e.layout,"annotations",f[u[o]])).modifyItem("visible",!1),r.extendFlat(h,s.getUpdateObj());return n.call("update",e,{},h)}}}}}),Di=m({"src/components/annotations/common_defaults.js"(e,t){var r=ct(),n=W();t.exports=function(e,t,i,a){a("opacity");var o=a("bgcolor"),s=a("bordercolor"),l=n.opacity(s);a("borderpad");var c=a("borderwidth"),u=a("showarrow");if(a("text",u?" ":i._dfltTitle.annotation),a("textangle"),r.coerceFont(a,"font",i.font),a("width"),a("align"),a("height")&&a("valign"),u){var h,f,p=a("arrowside");-1!==p.indexOf("end")&&(h=a("arrowhead"),f=a("arrowsize")),-1!==p.indexOf("start")&&(a("startarrowhead",h),a("startarrowsize",f)),a("arrowcolor",l?t.bordercolor:n.defaultLine),a("arrowwidth",2*(l&&c||1)),a("standoff"),a("startstandoff")}var d=a("hovertext"),m=i.hoverlabel||{};if(d){var g=a("hoverlabel.bgcolor",m.bgcolor||(n.opacity(o)?n.rgb(o):n.defaultLine)),y=a("hoverlabel.bordercolor",m.bordercolor||n.contrast(g)),v=r.extendFlat({},m.font);v.color||(v.color=y),r.coerceFont(a,"hoverlabel.font",v)}a("captureevents",!!d)}}}),Oi=m({"src/components/annotations/defaults.js"(e,t){var r=ct(),n=ar(),i=Nt(),a=Di(),o=bn();function s(e,t,i){function s(n,i){return r.coerce(e,t,o,n,i)}var l=s("visible"),c=s("clicktoshow");if(l||c){a(e,t,i,s);for(var u=t.showarrow,h=["x","y"],f=[-10,-30],p={_fullLayout:i},d=0;d<2;d++){var m=h[d],g=n.coerceRef(e,t,p,m,"","paper");if("paper"!==g&&n.getFromId(p,g)._annIndices.push(t._index),n.coercePosition(t,p,s,g,m,.5),u){var y="a"+m,v=n.coerceRef(e,t,p,y,"pixel",["pixel","paper"]);"pixel"!==v&&v!==g&&(v=t[y]="pixel");var x="pixel"===v?f[d]:.4;n.coercePosition(t,p,s,v,y,x)}s(m+"anchor"),s(m+"shift")}if(r.noneOrAll(e,t,["x","y"]),u&&r.noneOrAll(e,t,["ax","ay"]),c){var _=s("xclick"),b=s("yclick");t._xclick=void 0===_?t.x:n.cleanPosition(_,p,t.xref),t._yclick=void 0===b?t.y:n.cleanPosition(b,p,t.yref)}}}t.exports=function(e,t){i(e,t,{name:"annotations",handleItemDefaults:s})}}}),Ri=m({"src/components/annotations/calc_autorange.js"(e,t){var r=ct(),n=ar(),i=Pi().draw;function a(e){var t=e._fullLayout;r.filterVisible(t.annotations).forEach((function(t){var r=n.getFromId(e,t.xref),i=n.getFromId(e,t.yref),a=n.getRefType(t.xref),s=n.getRefType(t.yref);t._extremes={},"range"===a&&o(t,r),"range"===s&&o(t,i)}))}function o(e,t){var r,i=t._id,a=i.charAt(0),o=e[a],s=e["a"+a],l=e[a+"ref"],c=e["a"+a+"ref"],u=e["_"+a+"padplus"],h=e["_"+a+"padminus"],f={x:1,y:-1}[a]*e[a+"shift"],p=3*e.arrowsize*e.arrowwidth||0,d=p+f,m=p-f,g=3*e.startarrowsize*e.arrowwidth||0,y=g+f,v=g-f;if(c===l){var x=n.findExtremes(t,[t.r2c(o)],{ppadplus:d,ppadminus:m}),_=n.findExtremes(t,[t.r2c(s)],{ppadplus:Math.max(u,y),ppadminus:Math.max(h,v)});r={min:[x.min[0],_.min[0]],max:[x.max[0],_.max[0]]}}else y=s?y+s:y,v=s?v-s:v,r=n.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,d,y),ppadminus:Math.max(h,m,v)});e._extremes[i]=r}t.exports=function(e){var t=e._fullLayout;if(r.filterVisible(t.annotations).length&&e._fullData.length)return r.syncOrAsync([i,a],e)}}}),Fi=m({"src/components/annotations/convert_coords.js"(e,t){var r=M(),n=D();t.exports=function(e,t,i,a){t=t||{};var o="log"===i&&"linear"===t.type,s="linear"===i&&"log"===t.type;if(o||s)for(var l,c,u=e._fullLayout.annotations,h=t._id.charAt(0),f=0;f<u.length;f++)l=u[f],c="annotations["+f+"].",l[h+"ref"]===t._id&&p(h),l["a"+h+"ref"]===t._id&&p("a"+h);function p(e){var i=l[e],s=null;s=o?n(i,t.range):Math.pow(10,i),r(s)||(s=null),a(c+e,s)}}}}),Bi=m({"src/components/annotations/index.js"(e,t){var r=Pi(),n=zi();t.exports={moduleType:"component",name:"annotations",layoutAttributes:bn(),supplyLayoutDefaults:Oi(),includeBasePlot:En()("annotations"),calcAutorange:Ri(),draw:r.draw,drawOne:r.drawOne,drawRaw:r.drawRaw,hasClickToShow:n.hasClickToShow,onClick:n.onClick,convertCoords:Fi()}}}),ji=m({"src/components/annotations3d/attributes.js"(e,t){var r=bn(),n=De().overrideAll,i=vt().templatedArray;t.exports=n(i("annotation",{visible:r.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:r.xanchor,xshift:r.xshift,yanchor:r.yanchor,yshift:r.yshift,text:r.text,textangle:r.textangle,font:r.font,width:r.width,height:r.height,opacity:r.opacity,align:r.align,valign:r.valign,bgcolor:r.bgcolor,bordercolor:r.bordercolor,borderpad:r.borderpad,borderwidth:r.borderwidth,showarrow:r.showarrow,arrowcolor:r.arrowcolor,arrowhead:r.arrowhead,startarrowhead:r.startarrowhead,arrowside:r.arrowside,arrowsize:r.arrowsize,startarrowsize:r.startarrowsize,arrowwidth:r.arrowwidth,standoff:r.standoff,startstandoff:r.startstandoff,hovertext:r.hovertext,hoverlabel:r.hoverlabel,captureevents:r.captureevents}),"calc","from-root")}}),Ni=m({"src/components/annotations3d/defaults.js"(e,t){var r=ct(),n=ar(),i=Nt(),a=Di(),o=ji();function s(e,t,i,s){function l(n,i){return r.coerce(e,t,o,n,i)}function c(e){var r=e+"axis",a={_fullLayout:{}};return a._fullLayout[r]=i[r],n.coercePosition(t,a,l,e,e,.5)}l("visible")&&(a(e,t,s.fullLayout,l),c("x"),c("y"),c("z"),r.noneOrAll(e,t,["x","y","z"]),t.xref="x",t.yref="y",t.zref="z",l("xanchor"),l("yanchor"),l("xshift"),l("yshift"),t.showarrow&&(t.axref="pixel",t.ayref="pixel",l("ax",-10),l("ay",-30),r.noneOrAll(e,t,["ax","ay"])))}t.exports=function(e,t,r){i(e,t,{name:"annotations",handleItemDefaults:s,fullLayout:r.fullLayout})}}}),Ui=m({"src/components/annotations3d/convert.js"(e,t){var r=ct(),n=ar();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={},r.extendFlat(e._xa,o),n.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={},r.extendFlat(e._ya,o),n.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])}}t.exports=function(e){for(var t=e.fullSceneLayout.annotations,r=0;r<t.length;r++)i(t[r],e);e.fullLayout._infolayer.selectAll(".annotation-"+e.id).remove()}}}),Vi=m({"src/plots/gl3d/project.js"(e,t){function r(e,t){var r,n,i=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)i[n]+=e[4*r+n]*t[r];return i}t.exports=function(e,t){return r(e.projection,r(e.view,r(e.model,[t[0],t[1],t[2],1])))}}}),qi=m({"src/components/annotations3d/draw.js"(e,t){var r=Pi().drawRaw,n=Vi(),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 l=o[s],c=!1,u=0;u<3;u++){var h=i[u],f=l[h],p=t[h+"axis"].r2fraction(f);if(p<0||p>1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+s+'"]').remove():(l._pdata=n(e.glplot.cameraParams,[t.xaxis.r2l(l.x)*a[0],t.yaxis.r2l(l.y)*a[1],t.zaxis.r2l(l.z)*a[2]]),r(e.graphDiv,l,s,e.id,l._xa,l._ya))}}}}),Hi=m({"src/components/annotations3d/index.js"(e,t){var r=He(),n=ct();t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:ji()}}},layoutAttributes:ji(),handleDefaults:Ni(),includeBasePlot:function(e,t){var i=r.subplotsRegistry.gl3d;if(i)for(var a=i.attrRegex,o=Object.keys(e),s=0;s<o.length;s++){var l=o[s];a.test(l)&&(e[l].annotations||[]).length&&(n.pushUnique(t._basePlotModules,i),n.pushUnique(t._subplots.gl3d,l))}},convert:Ui(),draw:qi()}}}),Gi=m({"src/components/shapes/attributes.js"(e,t){xt();var r=j(),n=kn().line,i=Oe().dash,a=B().extendFlat,o=vt().templatedArray,s=(_n(),q()),l=bn(),{shapeTexttemplateAttrs:c,templatefallbackAttrs:u}=Fe(),h=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:r({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({},l.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({},l.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({},n.color,{editType:"arraydraw"}),width:a({},n.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:c({},{keys:Object.keys(h)}),texttemplatefallback:u({editType:"arraydraw"}),font:r({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"})}}),Wi=m({"src/components/shapes/defaults.js"(e,t){var r=ct(),n=ar(),i=Nt(),a=Gi(),o=Gr();function s(e,t,i){function s(n,i){return r.coerce(e,t,a,n,i)}if(t._isShape=!0,!s("visible"))return;s("showlegend")&&(s("legend"),s("legendwidth"),s("legendgroup"),s("legendgrouptitle.text"),r.coerceFont(s,"legendgrouptitle.font"),s("legendrank"));var l=s("path"),c=s("type",l?"path":"rect"),u="path"!==c;u&&delete t.path,s("editable"),s("layer"),s("opacity"),s("fillcolor"),s("fillrule"),s("line.width")&&(s("line.color"),s("line.dash"));var h=s("xsizemode"),f=s("ysizemode");let p=[.25,.75],d=[0,10];["x","y"].forEach((a=>{var m,g,y,v,x=a+"anchor",_="x"===a?h:f,b={_fullLayout:i};let w=e[a+"ref"];if(Array.isArray(w)&&w.length>0){let r=o.countDefiningCoords(c,l,a);v=n.coerceRefArray(e,t,b,a,void 0,"paper",r),t["_"+a+"refArray"]=!0}else v=n.coerceRef(e,t,b,a,void 0,"paper");if(Array.isArray(v))v.forEach((function(e){"range"===n.getRefType(e)&&(m=n.getFromId(b,e))&&-1===m._shapeIndices.indexOf(t._index)&&m._shapeIndices.push(t._index)})),u&&[0,1].forEach((function(i){let l=v[i];"range"===n.getRefType(l)?(m=n.getFromId(b,l),g=o.shapePositionToRange(m),y=o.rangeToShapePosition(m),("category"===m.type||"multicategory"===m.type)&&s(a+i+"shift")):g=y=r.identity;let c=a+i,u=e[c];if(e[c]=g(e[c],!0),"pixel"===_?s(c,d[i]):n.coercePosition(t,b,s,l,c,p[i]),t[c]=y(t[c]),e[c]=u,0===i&&"pixel"===_){let r=e[x];e[x]=g(e[x],!0),n.coercePosition(t,b,s,l,x,.25),t[x]=y(t[x]),e[x]=r}}));else{if("range"===n.getRefType(v)?((m=n.getFromId(b,v))._shapeIndices.push(t._index),y=o.rangeToShapePosition(m),g=o.shapePositionToRange(m),u&&("category"===m.type||"multicategory"===m.type)&&(s(a+"0shift"),s(a+"1shift"))):g=y=r.identity,u){let r=a+"0",i=a+"1",o=e[r],l=e[i];e[r]=g(e[r],!0),e[i]=g(e[i],!0),"pixel"===_?(s(r,d[0]),s(i,d[1])):(n.coercePosition(t,b,s,v,r,p[0]),n.coercePosition(t,b,s,v,i,p[1])),t[r]=y(t[r]),t[i]=y(t[i]),e[r]=o,e[i]=l}if("pixel"===_){let r=e[x];e[x]=g(e[x],!0),n.coercePosition(t,b,s,v,x,.25),t[x]=y(t[x]),e[x]=r}}})),u&&r.noneOrAll(e,t,["x0","x1","y0","y1"]);var m,g,y="line"===c;if(u&&(m=s("label.texttemplate"),s("label.texttemplatefallback")),m||(g=s("label.text")),g||m){s("label.textangle");var v=s("label.textposition",y?"middle":"middle center");s("label.xanchor"),s("label.yanchor",function(e,t){return e?"bottom":-1!==t.indexOf("top")?"top":-1!==t.indexOf("bottom")?"bottom":"middle"}(y,v)),s("label.padding"),r.coerceFont(s,"label.font",i.font)}}t.exports=function(e,t){i(e,t,{name:"shapes",handleItemDefaults:s})}}}),Zi=m({"src/components/shapes/draw_newshape/defaults.js"(e,t){var r=W(),n=ct();t.exports=function(e,t,i){if(i("newshape.visible"),i("newshape.name"),i("newshape.showlegend"),i("newshape.legend"),i("newshape.legendwidth"),i("newshape.legendgroup"),i("newshape.legendgrouptitle.text"),n.coerceFont(i,"newshape.legendgrouptitle.font"),i("newshape.legendrank"),i("newshape.drawdirection"),i("newshape.layer"),i("newshape.fillcolor"),i("newshape.fillrule"),i("newshape.opacity"),i("newshape.line.width")){var a=(e||{}).plot_bgcolor||"#FFF";i("newshape.line.color",r.contrast(a)),i("newshape.line.dash")}var o="drawline"===e.dragmode,s=i("newshape.label.text"),l=i("newshape.label.texttemplate");if(i("newshape.label.texttemplatefallback"),s||l){i("newshape.label.textangle");var c=i("newshape.label.textposition",o?"middle":"middle center");i("newshape.label.xanchor"),i("newshape.label.yanchor",function(e,t){return e?"bottom":-1!==t.indexOf("top")?"top":-1!==t.indexOf("bottom")?"bottom":"middle"}(o,c)),i("newshape.label.padding"),n.coerceFont(i,"newshape.label.font",t.font)}i("activeshape.fillcolor"),i("activeshape.opacity")}}}),Yi=m({"src/components/shapes/calc_autorange.js"(e,t){var r=ct(),n=ar(),i=Hr(),a=Gr();function o(e,t,r){let o=t[r+"ref"],s="x"===r?i.paramIsX:i.paramIsY;function l(e,t){"paper"===e||"domain"===n.getRefType(e)||(c[e]||(c[e]=[]),c[e].push(t))}let c={};if("path"===t.type&&t.path){let e=t.path.match(i.segmentRE)||[];for(var u=0,h=0;h<e.length;h++){let t=e[h],r=s[t.charAt(0)].drawn;if(void 0===r)continue;let n=t.slice(1).match(i.paramRE);n&&n.length>r&&(l(o[u],n[r]),u++)}}else l(o[0],t[r+"0"]),l(o[1],t[r+"1"]);let f={};for(let t in c){let r=n.getFromId(e,t);if(r){var p="category"===r.type||"multicategory"===r.type?r.r2c:r.d2c;"date"===r.type&&(p=a.decodeDate(p)),f[r._id]=c[t].map(p)}}return f}function s(e){return c(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function l(e){return c(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function c(e,t,n,o,s,l){var c=e/2,u=l;if("pixel"===t){var h=s?a.extractPathCoords(s,l?i.paramIsY:i.paramIsX):[n,o],f=r.aggNums(Math.max,null,h),p=r.aggNums(Math.min,null,h),d=p<0?Math.abs(p)+c:c,m=f>0?f+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function u(e,t,r){var n,o,s="x"===e._id.charAt(0)?"x":"y",l="category"===e.type||"multicategory"===e.type,c=0,u=0,h=l?e.r2c:e.d2c;if("scaled"===t[s+"sizemode"]?(n=t[s+"0"],o=t[s+"1"],l&&(c=t[s+"0shift"],u=t[s+"1shift"])):(n=t[s+"anchor"],o=t[s+"anchor"]),void 0!==n)return[h(n)+c,h(o)+u];if(t.path){var f,p,d,m,g=1/0,y=-1/0,v=t.path.match(i.segmentRE);for("date"===e.type&&(h=a.decodeDate(h)),f=0;f<v.length;f++)void 0!==(p=r[v[f].charAt(0)].drawn)&&(d=v[f].slice(1).match(i.paramRE))&&!(d.length<p)&&((m=h(d[p]))<g&&(g=m),m>y&&(y=m));if(y>=g)return[g,y]}}t.exports=function(e){var t=e._fullLayout,a=r.filterVisible(t.shapes);if(a.length&&e._fullData.length)for(var c=0;c<a.length;c++){var h=a[c];h._extremes={};var f,p,d=n.getRefType(h.xref),m=n.getRefType(h.yref);if("array"===d){let t=o(e,h,"x");Object.entries(t).forEach((([t,r])=>{f=n.getFromId(e,t),h._extremes[f._id]=n.findExtremes(f,r,s(h))}))}else"paper"!==h.xref&&"domain"!==d&&(p=u(f=n.getFromId(e,h.xref),h,i.paramIsX))&&(h._extremes[f._id]=n.findExtremes(f,p,s(h)));if("array"===m){let t=o(e,h,"y");Object.entries(t).forEach((([t,r])=>{f=n.getFromId(e,t),h._extremes[f._id]=n.findExtremes(f,r,l(h))}))}else"paper"!==h.yref&&"domain"!==m&&(p=u(f=n.getFromId(e,h.yref),h,i.paramIsY))&&(h._extremes[f._id]=n.findExtremes(f,p,l(h)))}}}}),Xi=m({"src/components/shapes/index.js"(e,t){var r=Yr();t.exports={moduleType:"component",name:"shapes",layoutAttributes:Gi(),supplyLayoutDefaults:Wi(),supplyDrawNewShapeDefaults:Zi(),includeBasePlot:En()("shapes"),calcAutorange:Yi(),draw:r.draw,drawOne:r.drawOne}}}),$i=m({"src/components/images/attributes.js"(e,t){var r=xt(),n=vt().templatedArray;_n(),t.exports=n("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",r.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",r.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),Ki=m({"src/components/images/defaults.js"(e,t){var r=ct(),n=ar(),i=Nt(),a=$i();function o(e,t,i){function o(n,i){return r.coerce(e,t,a,n,i)}var s=o("source");if(!o("visible",!!s))return t;o("layer"),o("xanchor"),o("yanchor"),o("sizex"),o("sizey"),o("sizing"),o("opacity");for(var l={_fullLayout:i},c=["x","y"],u=0;u<2;u++){var h=c[u],f=n.coerceRef(e,t,l,h,"paper",void 0);"paper"!==f&&n.getFromId(l,f)._imgIndices.push(t._index),n.coercePosition(t,l,o,f,h,0)}return t}t.exports=function(e,t){i(e,t,{name:"images",handleItemDefaults:o})}}}),Ji=m({"src/components/images/draw.js"(e,t){var r=b(),n=er(),i=ar(),a=_t(),o=Mt();t.exports=function(e){var t,s,l=e._fullLayout,c=[],u={},h=[];for(s=0;s<l.images.length;s++){var f=l.images[s];if(f.visible)if("below"===f.layer&&"paper"!==f.xref&&"paper"!==f.yref){t=a.ref2id(f.xref)+a.ref2id(f.yref);var p=l._plots[t];if(!p){h.push(f);continue}p.mainplot&&(t=p.mainplot.id),u[t]||(u[t]=[]),u[t].push(f)}else"above"===f.layer?c.push(f):h.push(f)}var d={left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},m={top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}};function g(t){var n=r.select(this);if(this._imgSrc!==t.source)if(n.attr("xmlns",o.svg),!e._context.staticPlot||t.source&&"data:"===t.source.slice(0,5))n.attr("xlink:href",t.source),this._imgSrc=t.source;else{var i=new Promise(function(e){var r=new Image;function i(){n.remove(),e()}this.img=r,r.setAttribute("crossOrigin","anonymous"),r.onerror=i,r.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 r=t.toDataURL("image/png");n.attr("xlink:href",r),e()},n.on("error",i),r.src=t.source,this._imgSrc=t.source}.bind(this));e._promises.push(i)}}function y(t){var a,o,s=r.select(this),c=i.getFromId(e,t.xref),u=i.getFromId(e,t.yref),h="domain"===i.getRefType(t.xref),f="domain"===i.getRefType(t.yref),p=l._size;a=void 0!==c?"string"==typeof t.xref&&h?c._length*t.sizex:Math.abs(c.l2p(t.sizex)-c.l2p(0)):t.sizex*p.w,o=void 0!==u?"string"==typeof t.yref&&f?u._length*t.sizey:Math.abs(u.l2p(t.sizey)-u.l2p(0)):t.sizey*p.h;var g,y,v=a*d[t.xanchor].offset,x=o*m[t.yanchor].offset,_=d[t.xanchor].sizing+m[t.yanchor].sizing;switch(g=void 0!==c?"string"==typeof t.xref&&h?c._length*t.x+c._offset:c.r2p(t.x)+c._offset:t.x*p.w+p.l,g+=v,y=void 0!==u?"string"==typeof t.yref&&f?u._length*(1-t.y)+u._offset:u.r2p(t.y)+u._offset:p.h-t.y*p.h+p.t,y+=x,t.sizing){case"fill":_+=" slice";break;case"stretch":_="none"}s.attr({x:g,y,width:a,height:o,preserveAspectRatio:_,opacity:t.opacity});var b=(c&&"domain"!==i.getRefType(t.xref)?c._id:"")+(u&&"domain"!==i.getRefType(t.yref)?u._id:"");n.setClipUrl(s,b?"clip"+l._uid+b:null,e)}function v(e){return[e.xref,e.x,e.sizex,e.yref,e.y,e.sizey].join("_")}function x(e,t){return e._index-t._index}var _=l._imageLowerLayer.selectAll("image").data(h,v),b=l._imageUpperLayer.selectAll("image").data(c,v);_.enter().append("image"),b.enter().append("image"),_.exit().remove(),b.exit().remove(),_.each((function(e){g.bind(this)(e),y.bind(this)(e)})),b.each((function(e){g.bind(this)(e),y.bind(this)(e)})),_.sort(x),b.sort(x);var w=Object.keys(l._plots);for(s=0;s<w.length;s++){t=w[s];var T=l._plots[t];if(T.imagelayer){var k=T.imagelayer.selectAll("image").data(u[t]||[],v);k.enter().append("image"),k.exit().remove(),k.each((function(e){g.bind(this)(e),y.bind(this)(e)})),k.sort(x)}}}}}),Qi=m({"src/components/images/convert_coords.js"(e,t){var r=M(),n=D();t.exports=function(e,t,i,a){t=t||{};var o="log"===i&&"linear"===t.type,s="linear"===i&&"log"===t.type;if(o||s)for(var l,c,u=e._fullLayout.images,h=t._id.charAt(0),f=0;f<u.length;f++)if(c="images["+f+"].",(l=u[f])[h+"ref"]===t._id){var p=l[h],d=l["size"+h],m=null,g=null;if(o){m=n(p,t.range);var y=d/Math.pow(10,m)/2;g=2*Math.log(y+Math.sqrt(1+y*y))/Math.LN10}else g=(m=Math.pow(10,p))*(Math.pow(10,d/2)-Math.pow(10,-d/2));r(m)?r(g)||(g=null):(m=null,g=null),a(c+h,m),a(c+"size"+h,g)}}}}),ea=m({"src/components/images/index.js"(e,t){t.exports={moduleType:"component",name:"images",layoutAttributes:$i(),supplyLayoutDefaults:Ki(),includeBasePlot:En()("images"),draw:Ji(),convertCoords:Qi()}}}),ta=m({"src/components/updatemenus/constants.js"(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=m({"src/components/updatemenus/attributes.js"(e,t){var r=j(),n=G(),i=B().extendFlat,a=De().overrideAll,o=Ue(),s=vt().templatedArray,l=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}});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:l,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:r({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:n.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")}}),na=m({"src/components/updatemenus/defaults.js"(e,t){var r=ct(),n=Nt(),i=ra(),a=ta().name,o=i.buttons;function s(e,t,a){function o(n,a){return r.coerce(e,t,i,n,a)}o("visible",n(e,t,{name:"buttons",handleItemDefaults:l}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),r.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),r.coerceFont(o,"font",a.font),o("bgcolor",a.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function l(e,t){function n(n,i){return r.coerce(e,t,o,n,i)}n("visible","skip"===e.method||Array.isArray(e.args))&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}t.exports=function(e,t){n(e,t,{name:a,handleItemDefaults:s})}}}),ia=m({"src/components/updatemenus/scrollbox.js"(e,t){t.exports=o;var r=b(),n=W(),i=er(),a=ct();function o(e,t,r){this.gd=e,this.container=t,this.id=r,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,l=s.width,c=s.height;this.position=e;var u,h,f,p,d=this.position.l,m=this.position.w,g=this.position.t,y=this.position.h,v=this.position.direction,x="down"===v,_="left"===v,b="up"===v,w=m,T=y;!x&&!_&&!("right"===v)&&!b&&(this.position.direction="down",x=!0),x||b?(h=(u=d)+w,x?(f=g,T=(p=Math.min(f+T,c))-f):T=(p=g+T)-(f=Math.max(p-T,0))):(p=(f=g)+T,_?w=(h=d+w)-(u=Math.max(h-w,0)):(u=d,w=(h=Math.min(u+w,l))-u)),this._box={l:u,t:f,w,h:T};var k=m>w,A=o.barLength+2*o.barPad,M=o.barWidth+2*o.barPad,S=d,E=g+y;E+M>c&&(E=c-M);var C=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(n.fill,o.barColor),k?(this.hbar=C.attr({rx:o.barRadius,ry:o.barRadius,x:S,y:E,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=y>T,L=o.barWidth+2*o.barPad,P=o.barLength+2*o.barPad,z=d+m,D=g;z+L>l&&(z=l-L);var O=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(n.fill,o.barColor),I?(this.vbar=O.attr({rx:o.barRadius,ry:o.barRadius,x:z,y:D,width:L,height:P}),this._vbarYMin=D+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=I?h+L+.5:h+.5,j=f-.5,N=k?p+M+.5:p+.5,U=s._topdefs.selectAll("#"+R).data(k||I?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||I?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(N)-Math.floor(j)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||I){var V=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault(),r.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),I&&this.vbar.on(".drag",null).call(q)}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-=r.event.dx),this.vbar&&(t-=r.event.dy),this.setTranslate(e,t)},o.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=r.event.deltaY),this.vbar&&(t+=r.event.deltaY),this.setTranslate(e,t)},o.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var n=e+this._hbarXMin,i=n+this._hbarTranslateMax;e=(a.constrain(r.event.x,n,i)-n)/(i-n)*(this.position.w-this._box.w)}if(this.vbar){var o=t+this._vbarYMin,s=o+this._vbarTranslateMax;t=(a.constrain(r.event.y,o,s)-o)/(s-o)*(this.position.h-this._box.h)}this.setTranslate(e,t)},o.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=a.constrain(e||0,0,r),t=a.constrain(t||0,0,n),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/r;this.hbar.call(i.setTranslate,e+o*this._hbarTranslateMax,t)}if(this.vbar){var s=t/n;this.vbar.call(i.setTranslate,e,t+s*this._vbarTranslateMax)}}}}),aa=m({"src/components/updatemenus/draw.js"(e,t){var r=b(),n=At(),i=W(),a=er(),o=ct(),s=Et(),l=vt().arrayEditor,c=St().LINE_SPACING,u=ta(),h=ia();function f(e){return e._index}function p(e,t){return+e.attr(u.menuIndexAttrName)===t._index}function d(e,t,r,n,i,a,o,s){t.active=o,l(e.layout,u.name,t).applyUpdate("active",o),"buttons"===t.type?g(e,n,null,null,t):"dropdown"===t.type&&(i.attr(u.menuIndexAttrName,"-1"),m(e,n,i,a,t),s||g(e,n,i,a,t))}function m(e,t,r,n,i){var s=o.ensureSingle(t,"g",u.headerClassName,(function(e){e.style("pointer-events","all")})),l=i._dims,c=i.active,h=i.buttons[c]||u.blankHeaderOpts,f={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};s.call(y,i,h,e).call(M,i,f,d),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:l.headerWidth-u.arrowOffsetX+i.pad.l,y:l.headerHeight/2+u.textOffsetY+i.pad.t}),s.on("click",(function(){r.call(S,String(p(r,i)?-1:i._index)),g(e,t,r,n,i)})),s.on("mouseover",(function(){s.call(w)})),s.on("mouseout",(function(){s.call(T,i)})),a.setTranslate(t,l.lx,l.ly)}function g(e,t,i,a,s){i||(i=t).attr("pointer-events","all");var l=function(e){return-1==+e.attr(u.menuIndexAttrName)}(i)&&"buttons"!==s.type?[]:s.buttons,c="dropdown"===s.type?u.dropdownButtonClassName:u.buttonClassName,h=i.selectAll("g."+c).data(o.filterVisible(l)),f=h.enter().append("g").classed(c,!0),p=h.exit();"dropdown"===s.type?(f.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var m=0,g=0,v=s._dims,x=-1!==["up","down"].indexOf(s.direction);"dropdown"===s.type&&(x?g=v.headerHeight+u.gapButtonHeader:m=v.headerWidth+u.gapButtonHeader),"dropdown"===s.type&&"up"===s.direction&&(g=-u.gapButtonHeader+u.gapButton-v.openHeight),"dropdown"===s.type&&"left"===s.direction&&(m=-u.gapButtonHeader+u.gapButton-v.openWidth);var b={x:v.lx+m+s.pad.l,y:v.ly+g+s.pad.t,yPad:u.gapButton,xPad:u.gapButton,index:0},k={l:b.x+s.borderwidth,t:b.y+s.borderwidth};h.each((function(o,l){var c=r.select(this);c.call(y,s,o,e).call(M,s,b),c.on("click",(function(){r.event.defaultPrevented||(o.execute&&(o.args2&&s.active===l?(d(e,s,0,t,i,a,-1),n.executeAPICommand(e,o.method,o.args2)):(d(e,s,0,t,i,a,l),n.executeAPICommand(e,o.method,o.args))),e.emit("plotly_buttonclicked",{menu:s,button:o,active:s.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,s),h.call(_,s)}))})),h.call(_,s),x?(k.w=Math.max(v.openWidth,v.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(v.openHeight,v.headerHeight)),k.direction=s.direction,a&&(h.size()?function(e,t,r,n,i,a){var o,s,l,c=i.direction,h="up"===c||"down"===c,f=i._dims,p=i.active;if(h)for(s=0,l=0;l<p;l++)s+=f.heights[l]+u.gapButton;else for(o=0,l=0;l<p;l++)o+=f.widths[l]+u.gapButton;n.enable(a,o,s),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1"),n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}(0,0,0,a,s,k):function(e){var t=!!e.hbar,r=!!e.vbar;t&&e.hbar.transition().attr("opacity","0").each("end",(function(){t=!1,r||e.disable()})),r&&e.vbar.transition().attr("opacity","0").each("end",(function(){r=!1,t||e.disable()}))}(a))}function y(e,t,r,n){e.call(v,t).call(x,t,r,n)}function v(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 x(e,t,r,n){var i=o.ensureSingle(e,"text",u.itemTextClassName,(function(e){e.attr({"text-anchor":"start","data-notex":1})})),l=r.label,c=n._fullLayout._meta;c&&(l=o.templateString(l,c)),i.call(a.font,t.font).text(l).call(s.convertToTspans,n)}function _(e,t){var n=t.active;e.each((function(e,a){var o=r.select(this);a===n&&t.showactive&&o.select("rect."+u.itemRectClassName).call(i.fill,u.activeColor)}))}function w(e){e.select("rect."+u.itemRectClassName).call(i.fill,u.hoverColor)}function T(e,t){e.select("rect."+u.itemRectClassName).call(i.fill,t.bgcolor)}function k(e,t){var i=t._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},l=a.tester.selectAll("g."+u.dropdownButtonClassName).data(o.filterVisible(t.buttons));l.enter().append("g").classed(u.dropdownButtonClassName,!0);var h=-1!==["up","down"].indexOf(t.direction);l.each((function(n,o){var l=r.select(this);l.call(y,t,n,e);var f=l.select("."+u.itemTextClassName),p=f.node()&&a.bBox(f.node()).width,d=Math.max(p+u.textPadX,u.minWidth),m=t.font.size*c,g=s.lineCount(f),v=Math.max(m*g,u.minHeight)+u.textOffsetY;v=Math.ceil(v),d=Math.ceil(d),i.widths[o]=d,i.heights[o]=v,i.height1=Math.max(i.height1,v),i.width1=Math.max(i.width1,d),h?(i.totalWidth=Math.max(i.totalWidth,d),i.openWidth=i.totalWidth,i.totalHeight+=v+u.gapButton,i.openHeight+=v+u.gapButton):(i.totalWidth+=d+u.gapButton,i.openWidth+=d+u.gapButton,i.totalHeight=Math.max(i.totalHeight,v),i.openHeight=i.totalHeight)})),h?i.totalHeight-=u.gapButton:i.totalWidth-=u.gapButton,i.headerWidth=i.width1+u.arrowPadX,i.headerHeight=i.height1,"dropdown"===t.type&&(h?(i.width1+=u.arrowPadX,i.totalHeight=i.height1):i.totalWidth=i.width1,i.totalWidth+=u.arrowPadX),l.remove();var f=i.totalWidth+t.pad.l+t.pad.r,p=i.totalHeight+t.pad.t+t.pad.b,d=e._fullLayout._size;i.lx=d.l+d.w*t.x,i.ly=d.t+d.h*(1-t.y);var m="left";o.isRightAnchor(t)&&(i.lx-=f,m="right"),o.isCenterAnchor(t)&&(i.lx-=f/2,m="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),n.autoMargin(e,A(t),{x:t.x,y:t.y,l:f*({right:1,center:.5}[m]||0),r:f*({left:1,center:.5}[m]||0),b:p*({top:1,middle:.5}[g]||0),t:p*({bottom:1,middle:.5}[g]||0)})}function A(e){return u.autoMarginIdRoot+e._index}function M(e,t,r,n){n=n||{};var i=e.select("."+u.itemRectClassName),o=e.select("."+u.itemTextClassName),l=t.borderwidth,h=r.index,f=t._dims;a.setTranslate(e,l+r.x,l+r.y);var p=-1!==["up","down"].indexOf(t.direction),d=n.height||(p?f.heights[h]:f.height1);i.attr({x:0,y:0,width:n.width||(p?f.width1:f.widths[h]),height:d});var m=t.font.size*c,g=(s.lineCount(o)-1)*m/2;s.positionText(o,u.textOffsetX,d/2-g+u.textOffsetY),p?r.y+=f.heights[h]+r.yPad:r.x+=f.widths[h]+r.xPad,r.index++}function S(e,t){e.attr(u.menuIndexAttrName,t||"-1").selectAll("g."+u.dropdownButtonClassName).remove()}t.exports=function(e){var t=e._fullLayout,i=o.filterVisible(t[u.name]);function a(t){n.autoMargin(e,A(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(){r.select(this).selectAll("g."+u.headerGroupClassName).each(a)})).remove(),0!==i.length){var l=s.selectAll("g."+u.headerGroupClassName).data(i,f);l.enter().append("g").classed(u.headerGroupClassName,!0);for(var c=o.ensureSingle(s,"g",u.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),y=0;y<i.length;y++){var v=i[y];k(e,v)}var x="updatemenus"+t._uid,_=new h(e,c,x);l.enter().size()&&(c.node().parentNode.appendChild(c.node()),c.call(S)),l.exit().each((function(e){c.call(S),a(e)})).remove(),l.each((function(t){var i=r.select(this),a="dropdown"===t.type?c:null;n.manageCommandObserver(e,t,t.buttons,(function(r){d(e,t,t.buttons[r.index],i,a,_,r.index,!0)})),"dropdown"===t.type?(m(e,i,c,_,t),p(c,t)&&g(e,i,c,_,t)):g(e,i,null,null,t)}))}}}}),oa=m({"src/components/updatemenus/index.js"(e,t){var r=ta();t.exports={moduleType:"component",name:r.name,layoutAttributes:ra(),supplyLayoutDefaults:na(),draw:aa()}}}),sa=m({"src/components/sliders/constants.js"(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=m({"src/components/sliders/attributes.js"(e,t){var r=j(),n=Ue(),i=B().extendDeepAll,a=De().overrideAll,o=ze(),s=vt().templatedArray,l=sa(),c=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}});t.exports=a(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,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(n({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:r({})},font:r({}),activebgcolor:{valType:"color",dflt:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}}),"arraydraw","from-root")}}),ca=m({"src/components/sliders/defaults.js"(e,t){var r=ct(),n=Nt(),i=la(),a=sa().name,o=i.steps;function s(e,t,a){function o(n,a){return r.coerce(e,t,i,n,a)}for(var s=n(e,t,{name:"steps",handleItemDefaults:l}),c=0,u=0;u<s.length;u++)s[u].visible&&c++;if(c<2?t.visible=!1:o("visible")){t._stepCount=c;var h=t._visibleSteps=r.filterVisible(s);(s[o("active")]||{}).visible||(t.active=h[0]._index),o("x"),o("y"),r.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"),r.coerceFont(o,"font",a.font),o("currentvalue.visible")&&(o("currentvalue.xanchor"),o("currentvalue.prefix"),o("currentvalue.suffix"),o("currentvalue.offset"),r.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 l(e,t){function n(n,i){return r.coerce(e,t,o,n,i)}if("skip"===e.method||Array.isArray(e.args)?n("visible"):t.visible=!1){n("method"),n("args");var i=n("label","step-"+t._index);n("value",i),n("execute")}}t.exports=function(e,t){n(e,t,{name:a,handleItemDefaults:s})}}}),ua=m({"src/components/sliders/draw.js"(e,t){var r=b(),n=At(),i=W(),a=er(),o=ct(),s=o.strTranslate,l=Et(),c=vt().arrayEditor,u=sa(),h=St(),f=h.LINE_SPACING,p=h.FROM_TL,d=h.FROM_BR;function m(e){return u.autoMarginIdRoot+e._index}function g(e){return e._index}function y(e,t){var i=a.tester.selectAll("g."+u.labelGroupClass).data(t._visibleSteps);i.enter().append("g").classed(u.labelGroupClass,!0);var s=0,c=0;i.each((function(e){var n=_(r.select(this),{step:e},t).node();if(n){var i=a.bBox(n);c=Math.max(c,i.height),s=Math.max(s,i.width)}})),i.remove();var h=t._dims={};h.inputAreaWidth=Math.max(u.railWidth,u.gripHeight);var f=e._fullLayout._size;h.lx=f.l+f.w*t.x,h.ly=f.t+f.h*(1-t.y),"fraction"===t.lenmode?h.outerLength=Math.round(f.w*t.len):h.outerLength=t.len,h.inputAreaStart=0,h.inputAreaLength=Math.round(h.outerLength-t.pad.l-t.pad.r);var g=(h.inputAreaLength-2*u.stepInset)/(t._stepCount-1),y=s+u.labelPadding;if(h.labelStride=Math.max(1,Math.ceil(y/g)),h.labelHeight=c,h.currentValueMaxWidth=0,h.currentValueHeight=0,h.currentValueTotalHeight=0,h.currentValueMaxLines=1,t.currentvalue.visible){var x=a.tester.append("g");i.each((function(e){var r=v(x,t,e.label),n=r.node()&&a.bBox(r.node())||{width:0,height:0},i=l.lineCount(r);h.currentValueMaxWidth=Math.max(h.currentValueMaxWidth,Math.ceil(n.width)),h.currentValueHeight=Math.max(h.currentValueHeight,Math.ceil(n.height)),h.currentValueMaxLines=Math.max(h.currentValueMaxLines,i)})),h.currentValueTotalHeight=h.currentValueHeight+t.currentvalue.offset,x.remove()}h.height=h.currentValueTotalHeight+u.tickOffset+t.ticklen+u.labelOffset+h.labelHeight+t.pad.t+t.pad.b;var b="left";o.isRightAnchor(t)&&(h.lx-=h.outerLength,b="right"),o.isCenterAnchor(t)&&(h.lx-=h.outerLength/2,b="center");var w="top";o.isBottomAnchor(t)&&(h.ly-=h.height,w="bottom"),o.isMiddleAnchor(t)&&(h.ly-=h.height/2,w="middle"),h.outerLength=Math.ceil(h.outerLength),h.height=Math.ceil(h.height),h.lx=Math.round(h.lx),h.ly=Math.round(h.ly);var T={y:t.y,b:h.height*d[w],t:h.height*p[w]};"fraction"===t.lenmode?(T.l=0,T.xl=t.x-t.len*p[b],T.r=0,T.xr=t.x+t.len*d[b]):(T.x=t.x,T.l=h.outerLength*p[b],T.r=h.outerLength*d[b]),n.autoMargin(e,m(t),T)}function v(e,t,r){if(t.currentvalue.visible){var n,i,s=t._dims;switch(t.currentvalue.xanchor){case"right":n=s.inputAreaLength-u.currentValueInset-s.currentValueMaxWidth,i="left";break;case"center":n=.5*s.inputAreaLength,i="middle";break;default:n=u.currentValueInset,i="left"}var c=o.ensureSingle(e,"text",u.labelClass,(function(e){e.attr({"text-anchor":i,"data-notex":1})})),h=t.currentvalue.prefix?t.currentvalue.prefix:"";if("string"==typeof r)h+=r;else{var p=t.steps[t.active].label,d=t._gd._fullLayout._meta;d&&(p=o.templateString(p,d)),h+=p}t.currentvalue.suffix&&(h+=t.currentvalue.suffix),c.call(a.font,t.currentvalue.font).text(h).call(l.convertToTspans,t._gd);var m=l.lineCount(c),g=(s.currentValueMaxLines+1-m)*t.currentvalue.font.size*f;return l.positionText(c,n,g),c}}function x(e,t,r){o.ensureSingle(e,"rect",u.gripRectClass,(function(n){n.call(A,t,e,r).style("pointer-events","all")})).attr({width:u.gripWidth,height:u.gripHeight,rx:u.gripRadius,ry:u.gripRadius}).call(i.stroke,r.bordercolor).call(i.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function _(e,t,r){var n=o.ensureSingle(e,"text",u.labelClass,(function(e){e.attr({"text-anchor":"middle","data-notex":1})})),i=t.step.label,s=r._gd._fullLayout._meta;return s&&(i=o.templateString(i,s)),n.call(a.font,r.font).text(i).call(l.convertToTspans,r._gd),n}function w(e,t){var n=o.ensureSingle(e,"g",u.labelsClass),i=t._dims,s=n.selectAll("g."+u.labelGroupClass).data(i.labelSteps);s.enter().append("g").classed(u.labelGroupClass,!0),s.exit().remove(),s.each((function(e){var n=r.select(this);n.call(_,e,t),a.setTranslate(n,E(t,e.fraction),u.tickOffset+t.ticklen+t.font.size*f+u.labelOffset+i.currentValueTotalHeight)}))}function T(e,t,r,n,i){var a=Math.round(n*(r._stepCount-1)),o=r._visibleSteps[a]._index;o!==r.active&&k(e,t,r,o,!0,i)}function k(e,t,r,i,a,o){var s=r.active;r.active=i,c(e.layout,u.name,r).applyUpdate("active",i);var l=r.steps[r.active];t.call(S,r,o),t.call(v,r),e.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(t._nextMethod?(t._nextMethod.step=l,t._nextMethod.doCallback=a,t._nextMethod.doTransition=o):(t._nextMethod={step:l,doCallback:a,doTransition:o},t._nextMethodRaf=window.requestAnimationFrame((function(){var r=t._nextMethod.step;r.method&&(r.execute&&n.executeAPICommand(e,r.method,r.args),t._nextMethod=null,t._nextMethodRaf=null)}))))}function A(e,t,n){if(!t._context.staticPlot){var a=n.node(),o=r.select(t);e.on("mousedown",l),e.on("touchstart",l)}function s(){return n.data()[0]}function l(){var e=s();t.emit("plotly_sliderstart",{slider:e});var l=n.select("."+u.gripRectClass);r.event.stopPropagation(),r.event.preventDefault(),l.call(i.fill,e.activebgcolor);var c=C(e,r.mouse(a)[0]);function h(){var e=s(),i=C(e,r.mouse(a)[0]);T(t,n,e,i,!1)}function f(){var e=s();e._dragging=!1,l.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]})}T(t,n,e,c,!0),e._dragging=!0,o.on("mousemove",h),o.on("touchmove",h),o.on("mouseup",f),o.on("touchend",f)}}function M(e,t){var n=e.selectAll("rect."+u.tickRectClass).data(t._visibleSteps),o=t._dims;n.enter().append("rect").classed(u.tickRectClass,!0),n.exit().remove(),n.attr({width:t.tickwidth+"px","shape-rendering":"crispEdges"}),n.each((function(e,n){var s=n%o.labelStride==0,l=r.select(this);l.attr({height:s?t.ticklen:t.minorticklen}).call(i.fill,t.tickcolor),a.setTranslate(l,E(t,n/(t._stepCount-1))-.5*t.tickwidth,(s?u.tickOffset:u.minorTickOffset)+o.currentValueTotalHeight)}))}function S(e,t,r){for(var n=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=E(t,i/(t._stepCount-1));if(!t._invokingCommand){var l=n;r&&t.transition.duration>0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*u.gripWidth,t._dims.currentValueTotalHeight))}}function E(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function C(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function I(e,t,r){var n=r._dims,s=o.ensureSingle(e,"rect",u.railTouchRectClass,(function(n){n.call(A,t,e,r).style("pointer-events","all")}));s.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),a.setTranslate(s,0,n.currentValueTotalHeight)}function L(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,s=o.ensureSingle(e,"rect",u.railRectClass);s.attr({width:n,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,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._context.staticPlot,i=e._fullLayout,o=function(e,t){for(var r=e[u.name],n=[],i=0;i<r.length;i++){var a=r[i];a.visible&&(a._gd=t,n.push(a))}return n}(i,e),s=i._infolayer.selectAll("g."+u.containerClassName).data(o.length>0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),n.autoMargin(e,m(t))}if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor",t?null:"ew-resize"),s.exit().each((function(){r.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==o.length){var c=s.selectAll("g."+u.groupClassName).data(o,g);c.enter().append("g").classed(u.groupClassName,!0),c.exit().each(l).remove();for(var h=0;h<o.length;h++){var f=o[h];y(e,f)}c.each((function(t){var i=r.select(this);(function(e){var t=e._dims;t.labelSteps=[];for(var r=e._stepCount,n=0;n<r;n+=t.labelStride)t.labelSteps.push({fraction:n/(r-1),step:e._visibleSteps[n]})})(t),n.manageCommandObserver(e,t,t._visibleSteps,(function(t){var r=i.data()[0];r.active!==t.index&&(r._dragging||k(e,i,r,t.index,!1,!0))})),function(e,t,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index),t.call(v,r).call(L,r).call(w,r).call(M,r).call(I,e,r).call(x,e,r);var n=r._dims;a.setTranslate(t,n.lx+r.pad.l,n.ly+r.pad.t),t.call(S,r,!1),t.call(v,r)}(e,r.select(this),t)}))}}}}),ha=m({"src/components/sliders/index.js"(e,t){var r=sa();t.exports={moduleType:"component",name:r.name,layoutAttributes:la(),supplyLayoutDefaults:ca(),draw:ua()}}}),fa=m({"src/components/rangeslider/attributes.js"(e,t){var r=G();t.exports={bgcolor:{valType:"color",dflt:r.background,editType:"plot"},bordercolor:{valType:"color",dflt:r.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"}}}),pa=m({"src/components/rangeslider/oppaxis_attributes.js"(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"}}}),da=m({"src/components/rangeslider/constants.js"(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}}}),ma=m({"src/components/rangeslider/helpers.js"(e){var t=_t(),r=Et(),n=da(),i=St().LINE_SPACING,a=n.name;function o(e){var t=e&&e[a];return t&&t.visible}e.isVisible=o,e.makeData=function(e){for(var r=t.list({_fullLayout:e},"x",!0),n=e.margin,i=[],s=0;s<r.length;s++){var l=r[s];if(o(l)){i.push(l);var c=l[a];c._id=a+l._id,c._height=(e.height-n.b-n.t)*c.thickness,c._offsetShift=Math.floor(c.borderwidth/2)}}e._rangeSliderData=i},e.autoMarginOpts=function(e,t){var o=e._fullLayout,s=t[a],l=t._id.charAt(0),c=0,u=0;return"bottom"===t.side&&(c=t._depth,t.title.text!==o._dfltTitle[l])&&(u=1.5*t.title.font.size+10+s._offsetShift,u+=(t.title.text.match(r.BR_TAG_ALL)||[]).length*t.title.font.size*i),{x:0,y:t._counterDomainMin,l:0,r:0,t:0,b:s._height+c+Math.max(o.margin.b,u),pad:n.extraPad+2*s._offsetShift}}}}),ga=m({"src/components/rangeslider/defaults.js"(e,t){var r=ct(),n=vt(),i=_t(),a=fa(),o=pa();t.exports=function(e,t,s){var l=e[s],c=t[s];if(l.rangeslider||t._requestRangeslider[c._id]){r.isPlainObject(l.rangeslider)||(l.rangeslider={});var u,h,f=l.rangeslider,p=n.newContainer(c,"rangeslider");if(b("visible")){b("bgcolor",t.plot_bgcolor),b("bordercolor"),b("borderwidth"),b("thickness"),b("autorange",!c.isValidRange(f.range)),b("range");var d=t._subplots;if(d)for(var m=d.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)})),g=r.simpleMap(m,i.id2name),y=0;y<g.length;y++){var v=g[y];u=f[v]||{},h=n.newContainer(p,v,"yaxis");var x,_=t[v];u.range&&_.isValidRange(u.range)&&(x="fixed"),"match"!==w("rangemode",x)&&w("range",_.range.slice())}p._input=f}}function b(e,t){return r.coerce(f,p,a,e,t)}function w(e,t){return r.coerce(u,h,o,e,t)}}}}),ya=m({"src/components/rangeslider/calc_autorange.js"(e,t){var r=_t().list,n=ir().getAutoRange,i=da();t.exports=function(e){for(var t=r(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=n(e,o))}}}}),va=m({"src/components/rangeslider/draw.js"(e,t){var r=b(),n=He(),i=At(),a=ct(),o=a.strTranslate,s=er(),l=W(),c=tr(),u=Ci(),h=_t(),f=pr(),p=dr(),d=da();function m(e){return"number"==typeof e.clientX?e.clientX:e.touches&&e.touches.length>0?e.touches[0].clientX:0}function g(e,t,r,n){var i=a.ensureSingle(e,"rect",d.bgClassName,(function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),c=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,u=-n._offsetShift,h=s.crispRound(t,n.borderwidth);i.attr({width:n._width+c,height:n._height+c,transform:o(u,u),"stroke-width":h}).call(l.stroke,n.bordercolor).call(l.fill,n.bgcolor)}function y(e,t,r,n){var i=t._fullLayout;a.ensureSingleById(i._topdefs,"clipPath",n._clipId,(function(e){e.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function v(e,t,n,o){var l,c=t.calcdata,f=e.selectAll("g."+d.rangePlotClassName).data(n._subplotsWith,a.identity);f.enter().append("g").attr("class",(function(e){return d.rangePlotClassName+" "+e})).call(s.setClipUrl,o._clipId,t),f.order(),f.exit().remove(),f.each((function(e,a){var s=r.select(this),f=0===a,p=h.getFromId(t,e,"y"),d=p._name,m=o[d],g={data:[],layout:{xaxis:{type:n.type,domain:[0,1],range:o.range.slice(),calendar:n.calendar},width:o._width,height:o._height,margin:{t:0,b:0,l:0,r:0}},_context:t._context};n.rangebreaks&&(g.layout.xaxis.rangebreaks=n.rangebreaks),g.layout[d]={type:p.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():p.range.slice(),calendar:p.calendar},p.rangebreaks&&(g.layout[d].rangebreaks=p.rangebreaks),i.supplyDefaults(g);var y=g._fullLayout.xaxis,v=g._fullLayout[d];y.clearCalc(),y.setScale(),v.clearCalc(),v.setScale();var x={id:e,plotgroup:s,xaxis:y,yaxis:v,isRangePlot:!0};f?l=x:(x.mainplot="xy",x.mainplotinfo=l),u.rangePlot(t,x,function(e,t){for(var r=[],n=0;n<e.length;n++){var i=e[n],a=i[0].trace;a.xaxis+a.yaxis===t&&r.push(i)}return r}(c,e))}))}function x(e,t,r,n,i){a.ensureSingle(e,"rect",d.maskMinClassName,(function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(l.fill,d.maskColor),a.ensureSingle(e,"rect",d.maskMaxClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(l.fill,d.maskColor),"match"!==i.rangemode&&(a.ensureSingle(e,"rect",d.maskMinOppAxisClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).call(l.fill,d.maskOppAxisColor),a.ensureSingle(e,"rect",d.maskMaxOppAxisClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).style("border-top",d.maskOppBorder).call(l.fill,d.maskOppAxisColor))}function _(e,t,r,n){t._context.staticPlot||a.ensureSingle(e,"rect",d.slideBoxClassName,(function(e){e.attr({y:0,cursor:d.slideBoxCursor,"shape-rendering":"crispEdges"})})).attr({height:n._height,fill:d.slideBoxFill})}function w(e,t,r,n){var i=a.ensureSingle(e,"g",d.grabberMinClassName),o=a.ensureSingle(e,"g",d.grabberMaxClassName),s={x:0,width:d.handleWidth,rx:d.handleRadius,fill:l.background,stroke:l.defaultLine,"stroke-width":d.handleStrokeWidth,"shape-rendering":"crispEdges"},c={y:Math.round(n._height/4),height:Math.round(n._height/2)};a.ensureSingle(i,"rect",d.handleMinClassName,(function(e){e.attr(s)})).attr(c),a.ensureSingle(o,"rect",d.handleMaxClassName,(function(e){e.attr(s)})).attr(c);var u={width:d.grabAreaWidth,x:0,y:0,fill:d.grabAreaFill,cursor:t._context.staticPlot?void 0:d.grabAreaCursor};a.ensureSingle(i,"rect",d.grabAreaMinClassName,(function(e){e.attr(u)})).attr("height",n._height),a.ensureSingle(o,"rect",d.grabAreaMaxClassName,(function(e){e.attr(u)})).attr("height",n._height)}t.exports=function(e){for(var t=e._fullLayout,i=t._rangeSliderData,s=0;s<i.length;s++){var l=i[s][d.name];l._clipId=l._id+"-"+t._uid}var u=t._infolayer.selectAll("g."+d.containerClassName).data(i,(function(e){return e._name}));u.exit().each((function(e){var r=e[d.name];t._topdefs.select("#"+r._clipId).remove()})).remove(),0!==i.length&&(u.enter().append("g").classed(d.containerClassName,!0).attr("pointer-events","all"),u.each((function(i){var s=r.select(this),l=i[d.name],u=t[h.id2name(i.anchor)],b=l[h.id2name(i.anchor)];if(l.range){var T,k=a.simpleMap(l.range,i.r2l),A=a.simpleMap(i.range,i.r2l);T=A[0]<A[1]?[Math.min(k[0],A[0]),Math.max(k[1],A[1])]:[Math.max(k[0],A[0]),Math.min(k[1],A[1])],l.range=l._input.range=a.simpleMap(T,i.l2r)}i.cleanRange("rangeslider.range");var M=t._size,S=i.domain;l._width=M.w*(S[1]-S[0]);var E=Math.round(M.l+M.w*S[0]),C=Math.round(M.t+M.h*(1-i._counterDomainMin)+("bottom"===i.side?i._depth:0)+l._offsetShift+d.extraPad);s.attr("transform",o(E,C)),l._rl=a.simpleMap(l.range,i.r2l);var I=l._rl[0],L=l._rl[1],P=L-I;if(l.p2d=function(e){return e/l._width*P+I},l.d2p=function(e){return(e-I)/P*l._width},i.rangebreaks){var z=i.locateBreaks(I,L);if(z.length){var D,O,R=0;for(D=0;D<z.length;D++)R+=(O=z[D]).max-O.min;var F=l._width/(L-I-R),B=[-F*I];for(D=0;D<z.length;D++)O=z[D],B.push(B[B.length-1]-F*(O.max-O.min));for(l.d2p=function(e){for(var t=B[0],r=0;r<z.length;r++){var n=z[r];if(e>=n.max)t=B[r+1];else if(e<n.min)break}return t+F*e},D=0;D<z.length;D++)(O=z[D]).pmin=l.d2p(O.min),O.pmax=l.d2p(O.max);l.p2d=function(e){for(var t=B[0],r=0;r<z.length;r++){var n=z[r];if(e>=n.pmax)t=B[r+1];else if(e<n.pmin)break}return(e-t)/F}}}if("match"!==b.rangemode){var j=u.r2l(b.range[0]),N=u.r2l(b.range[1])-j;l.d2pOppAxis=function(e){return(e-j)/N*l._height}}s.call(g,e,i,l).call(y,e,i,l).call(v,e,i,l).call(x,e,i,l,b).call(_,e,i,l).call(w,e,i,l),function(e,t,i,o){if(!t._context.staticPlot){var s=e.select("rect."+d.slideBoxClassName).node(),l=e.select("rect."+d.grabAreaMinClassName).node(),c=e.select("rect."+d.grabAreaMaxClassName).node();e.on("mousedown",u),e.on("touchstart",u)}function u(){var u=r.event,h=u.target,d=m(u),g=d-e.node().getBoundingClientRect().left,y=o.d2p(i._rl[0]),v=o.d2p(i._rl[1]),x=f.coverSlip();function _(e){var u,f,_,b=+m(e)-d;switch(h){case s:if(_="ew-resize",y+b>i._length||v+b<0)return;u=y+b,f=v+b;break;case l:if(_="col-resize",y+b>i._length)return;u=y+b,f=v;break;case c:if(_="col-resize",v+b<0)return;u=y,f=v+b;break;default:_="ew-resize",u=g,f=g+b}if(f<u){var w=f;f=u,u=w}o._pixelMin=u,o._pixelMax=f,p(r.select(x),_),function(e,t,r,i){function o(e){return r.l2r(a.constrain(e,i._rl[0],i._rl[1]))}var s=o(i.p2d(i._pixelMin)),l=o(i.p2d(i._pixelMax));window.requestAnimationFrame((function(){n.call("_guiRelayout",t,r._name+".range",[s,l])}))}(0,t,i,o)}function b(){x.removeEventListener("mousemove",_),x.removeEventListener("mouseup",b),this.removeEventListener("touchmove",_),this.removeEventListener("touchend",b),a.removeElement(x)}this.addEventListener("touchmove",_),this.addEventListener("touchend",b),x.addEventListener("mousemove",_),x.addEventListener("mouseup",b)}}(s,e,i,l),function(e,t,r,n,i,s){var l=d.handleWidth/2;function c(e){return a.constrain(e,0,n._width)}function u(e){return a.constrain(e,0,n._height)}function h(e){return a.constrain(e,-l,n._width+l)}var f=c(n.d2p(r._rl[0])),p=c(n.d2p(r._rl[1]));if(e.select("rect."+d.slideBoxClassName).attr("x",f).attr("width",p-f),e.select("rect."+d.maskMinClassName).attr("width",f),e.select("rect."+d.maskMaxClassName).attr("x",p).attr("width",n._width-p),"match"!==s.rangemode){var m=n._height-u(n.d2pOppAxis(i._rl[1])),g=n._height-u(n.d2pOppAxis(i._rl[0]));e.select("rect."+d.maskMinOppAxisClassName).attr("x",f).attr("height",m).attr("width",p-f),e.select("rect."+d.maskMaxOppAxisClassName).attr("x",f).attr("y",g).attr("height",n._height-g).attr("width",p-f),e.select("rect."+d.slideBoxClassName).attr("y",m).attr("height",g-m)}var y=.5,v=Math.round(h(f-l))-y,x=Math.round(h(p-l))+y;e.select("g."+d.grabberMinClassName).attr("transform",o(v,y)),e.select("g."+d.grabberMaxClassName).attr("transform",o(x,y))}(s,0,i,l,u,b),"bottom"===i.side&&c.draw(e,i._id+"title",{propContainer:i,propName:i._name+".title.text",placeholder:t._dfltTitle.x,attributes:{x:i._offset+i._length/2,y:C+l._height+l._offsetShift+10+1.5*i.title.font.size,"text-anchor":"middle"}})})))}}}),xa=m({"src/components/rangeslider/index.js"(e,t){var r=ct(),n=fa(),i=pa(),a=ma();t.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:r.extendFlat({},n,{yaxis:i})}}},layoutAttributes:fa(),handleDefaults:ga(),calcAutorange:ya(),draw:va(),isVisible:a.isVisible,makeData:a.makeData,autoMarginOpts:a.autoMarginOpts}}}),_a=m({"src/components/rangeselector/attributes.js"(e,t){var r=j(),n=G(),i=(0,vt().templatedArray)("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"});t.exports={visible:{valType:"boolean",editType:"plot"},buttons:i,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:r({editType:"plot"}),bgcolor:{valType:"color",dflt:n.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}}}),ba=m({"src/components/rangeselector/constants.js"(e,t){t.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}}),wa=m({"src/components/rangeselector/defaults.js"(e,t){var r=ct(),n=W(),i=vt(),a=Nt(),o=_a(),s=ba();function l(e,t,n,i){var a=i.calendar;function s(n,i){return r.coerce(e,t,o.buttons,n,i)}if(s("visible")){var l=s("step");"all"!==l&&(!a||"gregorian"===a||"month"!==l&&"year"!==l?s("stepmode"):t.stepmode="backward",s("count")),s("label")}}t.exports=function(e,t,c,u,h){var f=e.rangeselector||{},p=i.newContainer(t,"rangeselector");function d(e,t){return r.coerce(f,p,o,e,t)}if(d("visible",a(f,p,{name:"buttons",handleItemDefaults:l,calendar:h}).length>0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),i=0,a=0;a<n.length;a++){var o=t[n[a]].domain;o&&(i=Math.max(o[1],i))}return[e.domain[0],i+s.yPad]}(t,c,u);d("x",m[0]),d("y",m[1]),r.noneOrAll(e,t,["x","y"]),d("xanchor"),d("yanchor"),r.coerceFont(d,"font",c.font);var g=d("bgcolor");d("activecolor",n.contrast(g,s.lightAmount,s.darkAmount)),d("bordercolor"),d("borderwidth")}}}}),Ta=m({"src/components/rangeselector/get_update_object.js"(e,t){var r=w(),n=ct().titleCase;t.exports=function(e,t){var i=e._name,a={};if("all"===t.step)a[i+".autorange"]=!0;else{var o=function(e,t){var i,a=e.range,o=new Date(e.r2l(a[1])),s=t.step,l=r["utc"+n(s)],c=t.count;switch(t.stepmode){case"backward":i=e.l2r(+l.offset(o,-c));break;case"todate":var u=l.offset(o,-c);i=e.l2r(+l.ceil(u))}return[i,a[1]]}(e,t);a[i+".range[0]"]=o[0],a[i+".range[1]"]=o[1]}return a}}}),ka=m({"src/components/rangeselector/draw.js"(e,t){var r=b(),n=He(),i=At(),a=W(),o=er(),s=ct(),l=s.strTranslate,c=Et(),u=_t(),h=St(),f=h.LINE_SPACING,p=h.FROM_TL,d=h.FROM_BR,m=ba(),g=Ta();function y(e){return e._id}function v(e,t,r){var n=s.ensureSingle(e,"rect","selector-rect",(function(e){e.attr("shape-rendering","crispEdges")}));n.attr({rx:m.rx,ry:m.ry}),n.call(a.stroke,t.bordercolor).call(a.fill,function(e,t){return t._isActive||t._isHovered?e.activecolor:e.bgcolor}(t,r)).style("stroke-width",t.borderwidth+"px")}function x(e,t,r,n){s.ensureSingle(e,"text","selector-text",(function(e){e.attr("text-anchor","middle")})).call(o.font,t.font).text(function(e,t){return e.label?t?s.templateString(e.label,t):e.label:"all"===e.step?"all":e.count+e.step.charAt(0)}(r,n._fullLayout._meta)).call((function(e){c.convertToTspans(e,n)}))}t.exports=function(e){var t=e._fullLayout._infolayer.selectAll(".rangeselector").data(function(e){for(var t=u.list(e,"x",!0),r=[],n=0;n<t.length;n++){var i=t[n];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}(e),y);t.enter().append("g").classed("rangeselector",!0),t.exit().remove(),t.style({cursor:"pointer","pointer-events":"all"}),t.each((function(t){var a=r.select(this),u=t,h=u.rangeselector,y=a.selectAll("g.button").data(s.filterVisible(h.buttons));y.enter().append("g").classed("button",!0),y.exit().remove(),y.each((function(t){var i=r.select(this),a=g(u,t);t._isActive=function(e,t,r){if("all"===t.step)return!0===e.autorange;var n=Object.keys(r);return e.range[0]===r[n[0]]&&e.range[1]===r[n[1]]}(u,t,a),i.call(v,h,t),i.call(x,h,t,e),i.on("click",(function(){e._dragged||n.call("_guiRelayout",e,a)})),i.on("mouseover",(function(){t._isHovered=!0,i.call(v,h,t)})),i.on("mouseout",(function(){t._isHovered=!1,i.call(v,h,t)}))})),function(e,t,n,a,u){var h=0,g=0,y=n.borderwidth;t.each((function(){var e=r.select(this).select(".selector-text"),t=n.font.size*f,i=Math.max(t*c.lineCount(e),16)+3;g=Math.max(g,i)})),t.each((function(){var e=r.select(this),t=e.select(".selector-rect"),i=e.select(".selector-text"),a=i.node()&&o.bBox(i.node()).width,s=n.font.size*f,u=c.lineCount(i),p=Math.max(a+10,m.minButtonWidth);e.attr("transform",l(y+h,y)),t.attr({x:0,y:0,width:p,height:g}),c.positionText(i,p/2,g/2-(u-1)*s/2+3),h+=p+5}));var v=e._fullLayout._size,x=v.l+v.w*n.x,_=v.t+v.h*(1-n.y),b="left";s.isRightAnchor(n)&&(x-=h,b="right"),s.isCenterAnchor(n)&&(x-=h/2,b="center");var w="top";s.isBottomAnchor(n)&&(_-=g,w="bottom"),s.isMiddleAnchor(n)&&(_-=g/2,w="middle"),h=Math.ceil(h),g=Math.ceil(g),x=Math.round(x),_=Math.round(_),i.autoMargin(e,a+"-range-selector",{x:n.x,y:n.y,l:h*p[b],r:h*d[b],b:g*d[w],t:g*p[w]}),u.attr("transform",l(x,_))}(e,y,h,u._name,a)}))}}}),Aa=m({"src/components/rangeselector/index.js"(e,t){t.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:_a()}}},layoutAttributes:_a(),handleDefaults:wa(),draw:ka()}}}),Ma=m({"src/plots/domain.js"(e){var t=B().extendFlat;e.attributes=function(e,r){r=r||{};var n={valType:"info_array",editType:(e=e||{}).editType,items:[{valType:"number",min:0,max:1,editType:e.editType},{valType:"number",min:0,max:1,editType:e.editType}],dflt:[0,1]},i=(e.name&&e.name,e.trace,r.description&&r.description,{x:t({},n,{}),y:t({},n,{}),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,r,n){var i=n&&n.x||[0,1],a=n&&n.y||[0,1],o=t.grid;if(o){var s=r("domain.column");void 0!==s&&(s<o.columns?i=o._domains.x[s]:delete e.domain.column);var l=r("domain.row");void 0!==l&&(l<o.rows?a=o._domains.y[l]:delete e.domain.row)}var c=r("domain.x",i),u=r("domain.y",a);c[0]<c[1]||(e.domain.x=i.slice()),u[0]<u[1]||(e.domain.y=a.slice())}}}),Sa=m({"src/components/grid/index.js"(e,t){var r=ct(),n=Y().counter,i=Ma().attributes,a=xt().idRegex,o=vt(),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:[n("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 l(e,t,r){var n=t[r+"axes"],i=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function c(e,t,r,n,i,a){var o=t(e+"gap",r),s=t("domain."+e);t(e+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),h=u*(1-o),f=0;f<i;f++){var p=c+u*f;l[a?i-1-f:f]=[p,p+h]}return l}function u(e,t,r,n,i){var a,o=new Array(r);function s(e,r){-1!==t.indexOf(r)&&void 0===n[r]?(o[e]=r,n[r]=e):o[e]=""}if(Array.isArray(e))for(a=0;a<r;a++)s(a,e[a]);else for(s(0,i),a=1;a<r;a++)s(a,i+(a+1));return o}t.exports={moduleType:"component",name:"grid",schema:{layout:{grid:s}},layoutAttributes:s,sizeDefaults:function(e,t){var n=e.grid||{},i=l(t,n,"x"),a=l(t,n,"y");if(e.grid||i||a){var u,h,f=Array.isArray(n.subplots)&&Array.isArray(n.subplots[0]),p=Array.isArray(i),d=Array.isArray(a),m=p&&i!==n.xaxes&&d&&a!==n.yaxes;f?(u=n.subplots.length,h=n.subplots[0].length):(d&&(u=a.length),p&&(h=i.length));var g=o.newContainer(t,"grid"),y=k("rows",u),v=k("columns",h);if(y*v>1){f||p||d||"independent"===k("pattern")&&(f=!0),g._hasSubplotGrid=f;var x,_,b="top to bottom"===k("roworder"),w=f?.2:.1,T=f?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,_=t._splomGridDflt.yside),g._domains={x:c("x",k,w,x,v),y:c("y",k,T,_,y,b)}}else delete t.grid}function k(e,t){return r.coerce(n,g,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,i,a,o,s,c,h,f=e.grid||{},p=t._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(d){var x=f.subplots||[];c=r.subplots=new Array(m);var _=1;for(n=0;n<m;n++){var b=c[n]=new Array(g),w=x[n]||[];for(i=0;i<g;i++)if(y?(s=1===_?"xy":"x"+_+"y"+_,_++):s=w[i],b[i]="",-1!==p.cartesian.indexOf(s)){if(h=s.indexOf("y"),a=s.slice(0,h),o=s.slice(h),void 0!==v[a]&&v[a]!==i||void 0!==v[o]&&v[o]!==n)continue;b[i]=s,v[a]=i,v[o]=n}}}else{var T=l(t,f,"x"),k=l(t,f,"y");r.xaxes=u(T,p.xaxis,g,v,"x"),r.yaxes=u(k,p.yaxis,m,v,"y")}var A=r._anchors={},M="top to bottom"===r.roworder;for(var S in v){var E,C,I,L=S.charAt(0),P=r[L+"side"];if(P.length<8)A[S]="free";else if("x"===L){if("t"===P.charAt(0)===M?(E=0,C=1,I=m):(E=m-1,C=-1,I=-1),d){var z=v[S];for(n=E;n!==I;n+=C)if((s=c[n][z])&&(h=s.indexOf("y"),s.slice(0,h)===S)){A[S]=s.slice(h);break}}else for(n=E;n!==I;n+=C)if(o=r.yaxes[n],-1!==p.cartesian.indexOf(S+o)){A[S]=o;break}}else if("l"===P.charAt(0)?(E=0,C=1,I=g):(E=g-1,C=-1,I=-1),d){var D=v[S];for(n=E;n!==I;n+=C)if((s=c[D][n])&&(h=s.indexOf("y"),s.slice(h)===S)){A[S]=s.slice(0,h);break}}else for(n=E;n!==I;n+=C)if(a=r.xaxes[n],-1!==p.cartesian.indexOf(a+S)){A[S]=a;break}}}}}}}),Ea=m({"src/components/errorbars/attributes.js"(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"}}}),Ca=m({"src/components/errorbars/defaults.js"(e,t){var r=M(),n=He(),i=ct(),a=vt(),o=Ea();t.exports=function(e,t,s,l){var c="error_"+l.axis,u=a.newContainer(t,c),h=e[c]||{};function f(e,t){return i.coerce(h,u,o,e,t)}if(!1!==f("visible",void 0!==h.array||void 0!==h.value||"sqrt"===h.type)){var p=f("type","array"in h?"data":"percent"),d=!0;"sqrt"!==p&&(d=f("symmetric",!(("data"===p?"arrayminus":"valueminus")in h))),"data"===p?(f("array"),f("traceref"),d||(f("arrayminus"),f("tracerefminus"))):("percent"===p||"constant"===p)&&(f("value"),d||f("valueminus"));var m="copy_"+l.inherit+"style";l.inherit&&(t["error_"+l.inherit]||{}).visible&&f(m,!(h.color||r(h.thickness)||r(h.width))),(!l.inherit||!u[m])&&(f("color",s),f("thickness"),f("width",n.traceIs(t,"gl3d")?0:4))}}}}),Ia=m({"src/components/errorbars/compute_error.js"(e,t){function r(e,t){return"percent"===e?function(e){return Math.abs(e*t/100)}:"constant"===e?function(){return Math.abs(t)}:"sqrt"===e?function(e){return Math.sqrt(Math.abs(e))}:void 0}t.exports=function(e){var t=e.type,n=e.symmetric;if("data"===t){var i=e.array||[];if(n)return function(e,t){var r=+i[t];return[r,r]};var a=e.arrayminus||[];return function(e,t){var r=+i[t],n=+a[t];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=r(t,e.value),s=r(t,e.valueminus);return n||void 0===e.valueminus?function(e){var t=o(e);return[t,t]}:function(e){return[s(e),o(e)]}}}}),La=m({"src/components/errorbars/calc.js"(e,t){var r=M(),n=He(),i=ar(),a=ct(),o=Ia();function s(e,t,n,s){var l=t["error_"+s]||{},c=[];if(l.visible&&-1!==["linear","log"].indexOf(n.type)){for(var u=o(l),h=0;h<e.length;h++){var f=e[h],p=f.i;if(void 0===p)p=h;else if(null===p)continue;var d=f[s];if(r(n.c2l(d))){var m=u(d,p);if(r(m[0])&&r(m[1])){var g=f[s+"s"]=d-m[0],y=f[s+"h"]=d+m[1];c.push(g,y)}}}var v=n._id,x=t._extremes[v],_=i.findExtremes(n,c,a.extendFlat({tozero:x.opts.tozero},{padded:!0}));x.min=x.min.concat(_.min),x.max=x.max.concat(_.max)}}t.exports=function(e){for(var t=e.calcdata,r=0;r<t.length;r++){var a=t[r],o=a[0].trace;if(!0===o.visible&&n.traceIs(o,"errorBarsOK")){var l=i.getFromId(e,o.xaxis),c=i.getFromId(e,o.yaxis);s(a,o,l,"x"),s(a,o,c,"y")}}}}}),Pa=m({"src/components/errorbars/plot.js"(e,t){var r=b(),n=M(),i=er(),a=Xt();t.exports=function(e,t,o,s){var l=o.xaxis,c=o.yaxis,u=s&&s.duration>0,h=e._context.staticPlot;t.each((function(t){var f,p=t[0].trace,d=p.error_x||{},m=p.error_y||{};p.ids&&(f=function(e){return e.id});var g=a.hasMarkers(p)&&p.marker.maxdisplayed>0;!m.visible&&!d.visible&&(t=[]);var y=r.select(this).selectAll("g.errorbar").data(t,f);if(y.exit().remove(),t.length){d.visible||y.selectAll("path.xerror").remove(),m.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var v=y.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(y,o.layerClipId,e),y.each((function(e){var t=r.select(this),i=function(e,t,r){var i={x:t.c2p(e.x),y:r.c2p(e.y)};return void 0!==e.yh&&(i.yh=r.c2p(e.yh),i.ys=r.c2p(e.ys),n(i.ys)||(i.noYS=!0,i.ys=r.c2p(e.ys,!0))),void 0!==e.xh&&(i.xh=t.c2p(e.xh),i.xs=t.c2p(e.xs),n(i.xs)||(i.noXS=!0,i.xs=t.c2p(e.xs,!0))),i}(e,l,c);if(!g||e.vis){var a,o=t.select("path.yerror");if(m.visible&&n(i.x)&&n(i.yh)&&n(i.ys)){var f=m.width;a="M"+(i.x-f)+","+i.yh+"h"+2*f+"m-"+f+",0V"+i.ys,i.noYS||(a+="m-"+f+",0h"+2*f),o.size()?u&&(o=o.transition().duration(s.duration).ease(s.easing)):o=t.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("yerror",!0),o.attr("d",a)}else o.remove();var p=t.select("path.xerror");if(d.visible&&n(i.y)&&n(i.xh)&&n(i.xs)){var y=(d.copy_ystyle?m:d).width;a="M"+i.xh+","+(i.y-y)+"v"+2*y+"m0,-"+y+"H"+i.xs,i.noXS||(a+="m0,-"+y+"v"+2*y),p.size()?u&&(p=p.transition().duration(s.duration).ease(s.easing)):p=t.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("xerror",!0),p.attr("d",a)}else p.remove()}}))}}))}}}),za=m({"src/components/errorbars/style.js"(e,t){var r=b(),n=W();t.exports=function(e){e.each((function(e){var t=e[0].trace,i=t.error_y||{},a=t.error_x||{},o=r.select(this);o.selectAll("path.yerror").style("stroke-width",i.thickness+"px").call(n.stroke,i.color),a.copy_ystyle&&(a=i),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(n.stroke,a.color)}))}}}),Da=m({"src/components/errorbars/index.js"(e,t){var r=ct(),n=De().overrideAll,i=Ea(),a={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i)};delete a.error_x.copy_zstyle,delete a.error_y.copy_zstyle,delete a.error_y.copy_ystyle;var o={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i),error_z:r.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:n(o,"calc","nested"),scattergl:n(a,"calc","nested")}},supplyDefaults:Ca(),calc:La(),makeComputeError:Ia(),plot:Pa(),style:za(),hoverInfo:function(e,t,r){(t.error_y||{}).visible&&(r.yerr=e.yh-e.y,t.error_y.symmetric||(r.yerrneg=e.y-e.ys)),(t.error_x||{}).visible&&(r.xerr=e.xh-e.x,t.error_x.symmetric||(r.xerrneg=e.x-e.xs))}}}}),Oa=m({"src/components/colorbar/constants.js"(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"}}}}),Ra=m({"src/components/colorbar/draw.js"(e,t){var r=b(),n=F(),i=At(),a=He(),o=ar(),s=pr(),l=ct(),c=l.strTranslate,u=B().extendFlat,h=dr(),f=er(),p=W(),d=tr(),m=Et(),g=Ct().flipScale,y=Ai(),v=Mi(),x=Lt(),_=St(),w=_.LINE_SPACING,T=_.FROM_TL,k=_.FROM_BR,A=Oa().cn;t.exports={draw:function(e){var t=e._fullLayout._infolayer.selectAll("g."+A.colorbar).data(function(e){var t,r,n,i,a=e._fullLayout,o=e.calcdata,s=[];function l(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 c(){"function"==typeof i.calc?i.calc(e,n,t):(t._fillgradient=r.reversescale?g(r.colorscale):r.colorscale,t._zrange=[r[i.min],r[i.max]])}for(var h=0;h<o.length;h++){var f=o[h];if((n=f[0].trace)._module){var p=n._module.colorbar;if(!0===n.visible&&p)for(var d=Array.isArray(p),m=d?p:[p],y=0;y<m.length;y++){var v=(i=m[y]).container;(r=v?n[v]:n)&&r.showscale&&((t=l(r.colorbar))._id="cb"+n.uid+(d&&v?"-"+v:""),t._traceIndex=n.index,t._propPrefix=(v?v+".":"")+"colorbar.",t._meta=n._meta,c(),s.push(t))}}}for(var x in a._colorAxes)if((r=a[x]).showscale){var _=a._colorAxes[x];(t=l(r.colorbar))._id="cb"+x,t._propPrefix=x+".colorbar.",t._meta=a._meta,i={min:"cmin",max:"cmax"},"heatmap"!==_[0]&&(n=_[1],i.calc=n._module.colorbar.calc),c(),s.push(t)}return s}(e),(function(e){return e._id}));t.enter().append("g").attr("class",(function(e){return e._id})).classed(A.colorbar,!0),t.each((function(t){var g=r.select(this);l.ensureSingle(g,"rect",A.cbbg),l.ensureSingle(g,"g",A.cbfills),l.ensureSingle(g,"g",A.cblines),l.ensureSingle(g,"g",A.cbaxis,(function(e){e.classed(A.crisp,!0)})),l.ensureSingle(g,"g",A.cbtitleunshift,(function(e){e.append("g").classed(A.cbtitle,!0)})),l.ensureSingle(g,"rect",A.cboutline);var _=function(e,t,a){var s="v"===t.orientation,h=t.len,g=t.lenmode,_=t.thickness,b=t.thicknessmode,M=t.outlinewidth,S=t.borderwidth,E=t.bgcolor,C=t.xanchor,I=t.yanchor,L=t.xpad,P=t.ypad,z=t.x,D=s?t.y:1-t.y,O="paper"===t.yref,R="paper"===t.xref,F=a._fullLayout,B=F._size,j=t._fillcolor,N=t._line,U=t.title,V=U.side,q=t._zrange||r.extent(("function"==typeof j?j:N.color).domain()),H="function"==typeof N.color?N.color:function(){return N.color},G="function"==typeof j?j:function(){return j},W=t._levels,Z=function(e,t,r){var n,i,a=t._levels,o=[],s=[],l=a.end+a.size/100,c=a.size,u=1.001*r[0]-.001*r[1],h=1.001*r[1]-.001*r[0];for(i=0;i<1e5&&(n=a.start+i*c,!(c>0?n>=l:n<=l));i++)n>u&&n<h&&o.push(n);if(t._fillgradient)s=[0];else if("function"==typeof t._fillcolor){var f=t._filllevels;if(f)for(l=f.end+f.size/100,c=f.size,i=0;i<1e5&&(n=f.start+i*c,!(c>0?n>=l:n<=l));i++)n>r[0]&&n<r[1]&&s.push(n);else s=o.map((function(e){return e-a.size/2})),s.push(s[s.length-1]+a.size)}else t._fillcolor&&"string"==typeof t._fillcolor&&(s=[0]);return a.size<0&&(o.reverse(),s.reverse()),{line:o,fill:s}}(0,t,q),Y=Z.fill,X=Z.line,$=Math.round(_*("fraction"===b?s?B.w:B.h:1)),K=$/(s?B.w:B.h),J=Math.round(h*("fraction"===g?s?B.h:B.w:1)),Q=J/(s?B.h:B.w),ee=R?B.w:a._fullLayout.width,te=O?B.h:a._fullLayout.height,re=Math.round(s?z*ee+L:D*te+P),ne={center:.5,right:1}[C]||0,ie={top:1,middle:.5}[I]||0,ae=s?z-ne*K:D-ie*K,oe=s?D-ie*Q:z-ne*Q,se=Math.round(s?te*(1-oe):ee*oe);t._lenFrac=Q,t._thickFrac=K,t._uFrac=ae,t._vFrac=oe;var le=t._axis=function(e,t,r){var n=e._fullLayout,i="v"===t.orientation,a={type:"linear",range:r,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},c={letter:o,font:n.font,noAutotickangles:"y"===o,noHover:!0,noTickson:!0,noTicklabelmode:!0,noInsideRange:!0,calendar:n.calendar};function u(e,t){return l.coerce(a,s,x,e,t)}return y(a,s,u,c,n),v(a,s,u,c),s}(a,t,q);le.position=K+(s?z+L/B.w:D+P/B.h);var ce=-1!==["top","bottom"].indexOf(V);if(s&&ce&&(le.title.side=V,le.titlex=z+L/B.w,le.titley=oe+("top"===U.side?Q-P/B.h:P/B.h)),!s&&!ce&&(le.title.side=V,le.titley=D+P/B.h,le.titlex=oe+L/B.w),N.color&&"auto"===t.tickmode){le.tickmode="linear",le.tick0=W.start;var ue=W.size,he=l.constrain(J/50,4,15)+1,fe=(q[1]-q[0])/((t.nticks||he)*ue);if(fe>1){var pe=Math.pow(10,Math.floor(Math.log(fe)/Math.LN10));ue*=pe*l.roundUp(fe/pe,[2,5,10]),(Math.abs(W.start)/W.size+1e-6)%1<2e-6&&(le.tick0=0)}le.dtick=ue}le.domain=s?[oe+P/B.h,oe+Q-P/B.h]:[oe+L/B.w,oe+Q-L/B.w],le.setScale(),e.attr("transform",c(Math.round(B.l),Math.round(B.t)));var de,me=e.select("."+A.cbtitleunshift).attr("transform",c(-Math.round(B.l),-Math.round(B.t))),ge=le.ticklabelposition,ye=le.title.font.size,ve=e.select("."+A.cbaxis),xe=0,_e=0;function be(r,n){var i={propContainer:le,propName:t._propPrefix+"title.text",traceIndex:t._traceIndex,_meta:t._meta,placeholder:F._dfltTitle.colorbar,containerGroup:e.select("."+A.cbtitle)},o="h"===r.charAt(0)?r.slice(1):"h"+r;e.selectAll("."+o+",."+o+"-math-group").remove(),d.draw(a,r,u(i,n||{}))}return l.syncOrAsync([i.previousPromises,function(){var e,t;(s&&ce||!s&&!ce)&&("top"===V&&(e=L+B.l+ee*z,t=P+B.t+te*(1-oe-Q)+3+.75*ye),"bottom"===V&&(e=L+B.l+ee*z,t=P+B.t+te*(1-oe)-3-.25*ye),"right"===V&&(t=P+B.t+te*D+3+.75*ye,e=L+B.l+ee*oe),be(le._id+"title",{attributes:{x:e,y:t,"text-anchor":s?"start":"middle"}}))},function(){if(!s&&!ce||s&&ce){var i,u=e.select("."+A.cbtitle),h=u.select("text"),p=[-M/2,M/2],d=u.select(".h"+le._id+"title-math-group").node(),g=15.6;if(h.node()&&(g=parseInt(h.node().style.fontSize,10)*w),d?(i=f.bBox(d),_e=i.width,(xe=i.height)>g&&(p[1]-=(xe-g)/2)):h.node()&&!h.classed(A.jsPlaceholder)&&(i=f.bBox(h.node()),_e=i.width,xe=i.height),s){if(xe){if(xe+=5,"top"===V)le.domain[1]-=xe/B.h,p[1]*=-1;else{le.domain[0]+=xe/B.h;var y=m.lineCount(h);p[1]+=(1-y)*g}u.attr("transform",c(p[0],p[1])),le.setScale()}}else _e&&("right"===V&&(le.domain[0]+=(_e+ye/2)/B.w),u.attr("transform",c(p[0],p[1])),le.setScale())}e.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",s?c(0,Math.round(B.h*(1-le.domain[1]))):c(Math.round(B.w*le.domain[0]),0)),ve.attr("transform",s?c(0,Math.round(-B.t)):c(Math.round(-B.l),0));var v=e.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(Y);v.enter().append("rect").classed(A.cbfill,!0).attr("style",""),v.exit().remove();var x=q.map(le.c2p).map(Math.round).sort((function(e,t){return e-t}));v.each((function(e,i){var o=[0===i?q[0]:(Y[i]+Y[i-1])/2,i===Y.length-1?q[1]:(Y[i]+Y[i+1])/2].map(le.c2p).map(Math.round);s&&(o[1]=l.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]));var c=r.select(this).attr(s?"x":"y",re).attr(s?"y":"x",r.min(o)).attr(s?"width":"height",Math.max($,2)).attr(s?"height":"width",Math.max(r.max(o)-r.min(o),2));if(t._fillgradient)f.gradient(c,a,t._id,s?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var u=G(e).replace("e-","");c.attr("fill",n(u).toHexString())}}));var _=e.select("."+A.cblines).selectAll("path."+A.cbline).data(N.color&&N.width?X:[]);_.enter().append("path").classed(A.cbline,!0),_.exit().remove(),_.each((function(e){var t=re,n=Math.round(le.c2p(e))+N.width/2%1;r.select(this).attr("d","M"+(s?t+","+n:n+","+t)+(s?"h":"v")+$).call(f.lineGroupStyle,N.width,H(e),N.dash)})),ve.selectAll("g."+le._id+"tick,path").remove();var b=re+$+(M||0)/2-("outside"===t.ticks?1:0),T=o.calcTicks(le),k=o.getTickSigns(le)[2];return o.drawTicks(a,le,{vals:"inside"===le.ticks?o.clipEnds(le,T):T,layer:ve,path:o.makeTickPath(le,b,k),transFn:o.makeTransTickFn(le)}),o.drawLabels(a,le,{vals:T,layer:ve,transFn:o.makeTransTickLabelFn(le),labelFns:o.makeLabelFns(le,b)})},function(){if(s&&!ce||!s&&ce){var e,n,i=le.position||0,o=le._offset+le._length/2;if("right"===V)n=o,e=B.l+ee*i+10+ye*(le.showticklabels?1:.5);else if(e=o,"bottom"===V&&(n=B.t+te*i+10+(-1===ge.indexOf("inside")?le.tickfont.size:0)+("inside"!==le.ticks&&t.ticklen||0)),"top"===V){var l=U.text.split("<br>").length;n=B.t+te*i+10-$-w*ye*l}be((s?"h":"v")+le._id+"title",{avoid:{selection:r.select(a).selectAll("g."+le._id+"tick"),side:V,offsetTop:s?0:B.t,offsetLeft:s?B.l:0,maxShift:s?F.width:F.height},attributes:{x:e,y:n,"text-anchor":"middle"},transform:{rotate:s?-90:0,offset:0}})}},i.previousPromises,function(){var r,o=$+M/2;-1===ge.indexOf("inside")&&(r=f.bBox(ve.node()),o+=s?r.width:r.height),de=me.select("text");var l=0,u=s&&"top"===V,d=!s&&"right"===V,m=0;if(de.node()&&!de.classed(A.jsPlaceholder)){var y,v=me.select(".h"+le._id+"title-math-group").node();v&&(s&&ce||!s&&!ce)?(l=(r=f.bBox(v)).width,y=r.height):(l=(r=f.bBox(me.node())).right-B.l-(s?re:se),y=r.bottom-B.t-(s?se:re),!s&&"top"===V&&(o+=r.height,m=r.height)),d&&(de.attr("transform",c(l/2+ye/2,0)),l*=2),o=Math.max(o,s?l:y)}var x=2*(s?L:P)+o+S+M/2,w=0;!s&&U.text&&"bottom"===I&&D<=0&&(x+=w=x/2,m+=w),F._hColorbarMoveTitle=w,F._hColorbarMoveCBTitle=m;var j=S+M,N=(s?re:se)-j/2-(s?L:0),q=(s?se:re)-(s?J:P+m-w);e.select("."+A.cbbg).attr("x",N).attr("y",q).attr(s?"width":"height",Math.max(x-w,2)).attr(s?"height":"width",Math.max(J+j,2)).call(p.fill,E).call(p.stroke,t.bordercolor).style("stroke-width",S);var H=d?Math.max(l-10,0):0;e.selectAll("."+A.cboutline).attr("x",(s?re:se+L)+H).attr("y",(s?se+P-J:re)+(u?xe:0)).attr(s?"width":"height",Math.max($,2)).attr(s?"height":"width",Math.max(J-(s?2*P+xe:2*L+H),2)).call(p.stroke,t.outlinecolor).style({fill:"none","stroke-width":M});var G=s?ne*x:0,W=s?0:(1-ie)*x-m;if(G=R?B.l-G:-G,W=O?B.t-W:-W,e.attr("transform",c(G,W)),!s&&(S||n(E).getAlpha()&&!n.equals(F.paper_bgcolor,E))){var Z=ve.selectAll("text"),Y=Z[0].length,X=e.select("."+A.cbbg).node(),K=f.bBox(X),Q=f.getTranslate(e);Z.each((function(e,t){var r=Y-1;if(0===t||t===r){var n,i=f.bBox(this),a=f.getTranslate(this);if(t===r){var o=i.right+a.x;(n=K.right+Q.x+se-S-2+z-o)>0&&(n=0)}else if(0===t){var s=i.left+a.x;(n=K.left+Q.x+se+S+2-s)<0&&(n=0)}n&&(Y<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var ee={},te=T[C],ae=k[C],oe=T[I],ue=k[I],he=x-$;s?("pixels"===g?(ee.y=D,ee.t=J*oe,ee.b=J*ue):(ee.t=ee.b=0,ee.yt=D+h*oe,ee.yb=D-h*ue),"pixels"===b?(ee.x=z,ee.l=x*te,ee.r=x*ae):(ee.l=he*te,ee.r=he*ae,ee.xl=z-_*te,ee.xr=z+_*ae)):("pixels"===g?(ee.x=z,ee.l=J*te,ee.r=J*ae):(ee.l=ee.r=0,ee.xl=z+h*te,ee.xr=z-h*ae),"pixels"===b?(ee.y=1-D,ee.t=x*oe,ee.b=x*ue):(ee.t=he*oe,ee.b=he*ue,ee.yt=D-_*oe,ee.yb=D+_*ue));var fe=t.y<.5?"b":"t",pe=t.x<.5?"l":"r";a._fullLayout._reservedMargin[t._id]={};var _e={r:F.width-N-G,l:N+ee.r,b:F.height-q-W,t:q+ee.b};R&&O?i.autoMargin(a,t._id,ee):R?a._fullLayout._reservedMargin[t._id][fe]=_e[fe]:O||s?a._fullLayout._reservedMargin[t._id][pe]=_e[pe]:a._fullLayout._reservedMargin[t._id][fe]=_e[fe]}],a)}(g,t,e);_&&_.then&&(e._promises||[]).push(_),e._context.edits.colorbarPosition&&function(e,t,r){var n,i,o,l="v"===t.orientation,u=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),h(e)},moveFn:function(r,a){e.attr("transform",n+c(r,a)),i=s.align((l?t._uFrac:t._vFrac)+r/u.w,l?t._thickFrac:t._lenFrac,0,1,t.xanchor),o=s.align((l?t._vFrac:1-t._uFrac)-a/u.h,l?t._lenFrac:t._thickFrac,0,1,t.yanchor);var f=s.getCursor(i,o,t.xanchor,t.yanchor);h(e,f)},doneFn:function(){if(h(e),void 0!==i&&void 0!==o){var n={};n[t._propPrefix+"x"]=i,n[t._propPrefix+"y"]=o,void 0!==t._traceIndex?a.call("_guiRestyle",r,n,t._traceIndex):a.call("_guiRelayout",r,n)}}})}(g,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}}}),Fa=m({"src/components/colorbar/index.js"(e,t){t.exports={moduleType:"component",name:"colorbar",attributes:Pt(),supplyDefaults:qt(),draw:Ra().draw,hasColorbar:Ot()}}}),Ba=m({"src/components/legend/index.js"(e,t){t.exports={moduleType:"component",name:"legend",layoutAttributes:gr(),supplyLayoutDefaults:vr(),draw:Mr(),style:Ar()}}}),ja=m({"src/locale-en.js"(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"}}}}),Na=m({"src/locale-en-us.js"(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"}}}}),Ua=m({"src/snapshot/cloneplot.js"(e,t){var r=He(),n=ct(),i=n.extendFlat,a=n.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}t.exports=function(e,t){var n,s,l=e.data,c=e.layout,u=a([],l),h=a({},c,o(t.tileClass)),f=e._context||{};if(t.width&&(h.width=t.width),t.height&&(h.height=t.height),"thumbnail"===t.tileClass||"themes__thumb"===t.tileClass){h.annotations=[];var p=Object.keys(h);for(n=0;n<p.length;n++)s=p[n],["xaxis","yaxis","zaxis"].indexOf(s.slice(0,5))>-1&&(h[p[n]].title={text:""});for(n=0;n<u.length;n++){var d=u[n];d.showscale=!1,d.marker&&(d.marker.showscale=!1),r.traceIs(d,"pie-like")&&(d.textposition="none")}}if(Array.isArray(t.annotations))for(n=0;n<t.annotations.length;n++)h.annotations.push(t.annotations[n]);var m=Object.keys(h).filter((function(e){return e.match(/^scene\d*$/)}));if(m.length){var g={};for("thumbnail"===t.tileClass&&(g={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),n=0;n<m.length;n++){var y=h[m[n]];y.xaxis||(y.xaxis={}),y.yaxis||(y.yaxis={}),y.zaxis||(y.zaxis={}),i(y.xaxis,g),i(y.yaxis,g),i(y.zaxis,g),y._scene=null}}var v=document.createElement("div");t.tileClass&&(v.className=t.tileClass);var x={gd:v,td:v,layout:h,data:u,config:{staticPlot:void 0===t.staticPlot||t.staticPlot,plotGlPixelRatio:void 0===t.plotGlPixelRatio?2:t.plotGlPixelRatio,displaylogo:t.displaylogo||!1,showLink:t.showLink||!1,showTips:t.showTips||!1,mapboxAccessToken:f.mapboxAccessToken}};return"transparent"!==t.setBackground&&(x.config.setBackground=t.setBackground||"opaque"),x.gd.defaultLayout=o(t.tileClass),x}}}),Va=m({"src/snapshot/toimage.js"(e,t){var r=pt().EventEmitter,n=He(),i=ct(),a=Rn(),o=Ua(),s=Fn(),l=Bn();t.exports=function(e,t){var c=new r,u=o(e,{format:"png"}),h=u.gd;h.style.position="absolute",h.style.left="-5000px",document.body.appendChild(h);var f=a.getRedrawFunc(h);return n.call("_doPlot",h,u.data,u.layout,u.config).then(f).then((function(){var e=a.getDelay(h._fullLayout);setTimeout((function(){var e=s(h),r=document.createElement("canvas");r.id=i.randstr(),(c=l({format:t.format,width:h._fullLayout.width,height:h._fullLayout.height,canvas:r,emitter:c,svg:e})).clean=function(){h&&document.body.removeChild(h)}}),e)})).catch((function(e){c.emit("error",e)})),c}}}),qa=m({"src/snapshot/index.js"(e,t){var r=Rn(),n={getDelay:r.getDelay,getRedrawFunc:r.getRedrawFunc,clone:Ua(),toSVG:Fn(),svgToImg:Bn(),toImage:Va(),downloadImage:Vn()};t.exports=n}}),Ha=m({"src/core.js"(e){e.version=x().version,_(),ut();var t,r,n=He(),i=e.register=n.register,a=Hn(),o=Object.keys(a);for(r=0;r<o.length;r++)"_"!==(t=o[r]).charAt(0)&&(e[t]=a[t]),i({moduleType:"apiMethod",name:t,fn:a[t]});i(Ii()),i([Bi(),Hi(),Cn(),Xi(),ea(),oa(),ha(),xa(),Aa(),Sa(),Da(),Yt(),Fa(),Ba(),Or(),tn()]),i([ja(),Na()]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(i(window.PlotlyLocales),delete window.PlotlyLocales),e.Icons=Br();var s=Or(),l=At();e.Plots={resize:l.resize,graphJson:l.graphJson,sendDataToCloud:l.sendDataToCloud},e.Fx={hover:s.hover,unhover:s.unhover,loneHover:s.loneHover,loneUnhover:s.loneUnhover},e.Snapshot=qa(),e.PlotSchema=yt()}}),Ga=m({"lib/core.js"(e,t){t.exports=Ha()}}),Wa=m({"src/traces/bar/attributes.js"(e,t){var r=kn(),n=It().axisHoverFormat,{hovertemplateAttrs:i,texttemplateAttrs:a,templatefallbackAttrs:o}=Fe(),s=zt(),l=j(),c=ci(),u=Oe().pattern,h=B().extendFlat,f=l({editType:"calc",arrayOk:!0,colorEditType:"style"}),p=h({},r.marker.line.width,{dflt:0}),d=h({width:p,editType:"calc"},s("marker.line")),m=h({line:d,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:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:n("x"),yhoverformat:n("y"),text:r.text,texttemplate:a({editType:"plot"},{keys:c.eventDataKeys}),texttemplatefallback:o({editType:"plot"}),hovertext:r.hovertext,hovertemplate:i({},{keys:c.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:h({},f,{}),insidetextfont:h({},f,{}),outsidetextfont:h({},f,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:h({},r.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:r.offsetgroup,alignmentgroup:r.alignmentgroup,selected:{marker:{opacity:r.selected.marker.opacity,color:r.selected.marker.color,editType:"style"},textfont:r.selected.textfont,editType:"style"},unselected:{marker:{opacity:r.unselected.marker.opacity,color:r.unselected.marker.color,editType:"style"},textfont:r.unselected.textfont,editType:"style"},zorder:r.zorder}}}),Za=m({"src/traces/bar/layout_attributes.js"(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=m({"src/traces/bar/style_defaults.js"(e,t){var r=W(),n=Ct().hasColorscale,i=Ht(),a=ct().coercePattern;t.exports=function(e,t,o,s,l){var c=o("marker.color",s),u=n(e,"marker");u&&i(e,t,l,o,{prefix:"marker.",cLetter:"c"}),o("marker.line.color",r.defaultLine),n(e,"marker.line")&&i(e,t,l,o,{prefix:"marker.line.",cLetter:"c"}),o("marker.line.width"),o("marker.opacity"),a(o,"marker.pattern",c,u),o("selected.marker.color"),o("unselected.marker.color")}}}),Xa=m({"src/traces/bar/defaults.js"(e,t){var r=M(),n=ct(),i=W(),a=He(),o=Gn(),s=Wn(),l=Ya(),c=ei(),u=Wa(),h=n.coerceFont;function f(e){if(r(e)){if((e=+e)>=0)return e}else if("string"==typeof e&&"%"===(e=e.trim()).slice(-1)&&r(e.slice(0,-1))&&(e=+e.slice(0,-1))>=0)return e+"%"}function p(e,t,r,i,a,o){var s=!1!==(o=o||{}).moduleHasSelected,l=!1!==o.moduleHasUnselected,c=!1!==o.moduleHasConstrain,u=!1!==o.moduleHasCliponaxis,f=!1!==o.moduleHasTextangle,p=!1!==o.moduleHasInsideanchor,d=!!o.hasPathbar,m=Array.isArray(a)||"auto"===a,g=m||"inside"===a,y=m||"outside"===a;if(g||y){var v=h(i,"textfont",r.font),x=n.extendFlat({},v),_=!(e.textfont&&e.textfont.color);if(_&&delete x.color,h(i,"insidetextfont",x),d){var b=n.extendFlat({},v);_&&delete b.color,h(i,"pathbar.textfont",b)}y&&h(i,"outsidetextfont",v),s&&i("selected.textfont.color"),l&&i("unselected.textfont.color"),c&&i("constraintext"),u&&i("cliponaxis"),f&&i("textangle"),i("texttemplate"),i("texttemplatefallback")}g&&p&&i("insidetextanchor")}t.exports={supplyDefaults:function(e,t,r,c){function h(r,i){return n.coerce(e,t,u,r,i)}if(o(e,t,c,h)){s(e,t,c,h),h("xhoverformat"),h("yhoverformat"),h("zorder"),h("orientation",t.x&&!t.y?"h":"v"),h("base"),h("offset"),h("width"),h("text"),h("hovertext"),h("hovertemplate"),h("hovertemplatefallback");var f=h("textposition");p(e,0,c,h,f,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(e,t,h,r,c);var d=(t.marker.line||{}).color,m=a.getComponentMethod("errorbars","supplyDefaults");m(e,t,d||i.defaultLine,{axis:"y"}),m(e,t,d||i.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(t,h)}else t.visible=!1},crossTraceDefaults:function(e,t){var r,i;function a(e,t){return n.coerce(i._input,i,u,e,t)}for(var o=0;o<e.length;o++)if("bar"===(i=e[o]).type){r=i._input;var s=a("marker.cornerradius",t.barcornerradius);i.marker&&(i.marker.cornerradius=f(s)),c(r,i,t,a,t.barmode)}},handleText:p,validateCornerradius:f}}}),$a=m({"src/traces/bar/layout_defaults.js"(e,t){var r=He(),n=ar(),i=ct(),a=Za(),o=Xa().validateCornerradius;t.exports=function(e,t,s){function l(r,n){return i.coerce(e,t,a,r,n)}for(var c=!1,u=!1,h=!1,f={},p=l("barmode"),d="group"===p,m=0;m<s.length;m++){var g=s[m];if(r.traceIs(g,"bar")&&g.visible){c=!0;var y=g.xaxis+g.yaxis;d?(f[y]&&(h=!0),f[y]=!0):(y+=g._input.offsetgroup,f.length>0&&!f[y]&&(h=!0),f[y]=!0),g.visible&&"histogram"===g.type&&"category"!==n.getFromId({_fullLayout:t},g["v"===g.orientation?"xaxis":"yaxis"]).type&&(u=!0)}}if(c){"overlay"!==p&&l("barnorm"),l("bargap",u&&!h?0:.2),l("bargroupgap");var v=l("barcornerradius");t.barcornerradius=o(v)}else delete t.barmode}}}),Ka=m({"src/traces/bar/arrays_to_calcdata.js"(e,t){var r=ct();t.exports=function(e,t){for(var n=0;n<e.length;n++)e[n].i=n;r.mergeArray(t.text,e,"tx"),r.mergeArray(t.hovertext,e,"htx");var i=t.marker;if(i){r.mergeArray(i.opacity,e,"mo",!0),r.mergeArray(i.color,e,"mc");var a=i.line;a&&(r.mergeArray(a.color,e,"mlc"),r.mergeArrayCastPositive(a.width,e,"mlw"))}}}}),Ja=m({"src/traces/bar/calc.js"(e,t){var r=ar(),n=ni(),i=Ct().hasColorscale,a=Zt(),o=Ka(),s=oi();t.exports=function(e,t){var l,c,u,h,f,p,d=r.getFromId(e,t.xaxis||"x"),m=r.getFromId(e,t.yaxis||"y"),g={msUTC:!(!t.base&&0!==t.base)};"h"===t.orientation?(l=d.makeCalcdata(t,"x",g),u=m.makeCalcdata(t,"y"),h=n(t,m,"y",u),f=!!t.yperiodalignment,p="y"):(l=m.makeCalcdata(t,"y",g),u=d.makeCalcdata(t,"x"),h=n(t,d,"x",u),f=!!t.xperiodalignment,p="x"),c=h.vals;for(var y=Math.min(c.length,l.length),v=new Array(y),x=0;x<y;x++)v[x]={p:c[x],s:l[x]},f&&(v[x].orig_p=u[x],v[x][p+"End"]=h.ends[x],v[x][p+"Start"]=h.starts[x]),t.ids&&(v[x].id=String(t.ids[x]));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}}}),Qa=m({"src/traces/bar/uniform_text.js"(e,t){var r=b(),n=ct();function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o<a,r[n]=r[n]||1/0,t.hide||(r[n]=Math.min(r[n],Math.max(o,a)))}},clearMinTextSize:function(e,t){t[i(e)]=void 0},resizeText:function(e,t,i){var a=e._fullLayout,o=a["_"+i+"Text_minsize"];if(o){var s,l="hide"===a.uniformtext.mode;switch(i){case"funnelarea":case"pie":case"sunburst":s="g.slice";break;case"treemap":case"icicle":s="g.slice, g.pathbar";break;default:s="g.points > g.point"}t.selectAll(s).each((function(e){var t=e.transform;if(t){t.scale=l&&t.hide?0:o/t.fontSize;var i=r.select(this).select("text");n.setTransormAndDisplay(i,t)}}))}}}}}),eo=m({"src/traces/bar/helpers.js"(e){var t=M(),r=F(),n=ct().isArrayOrTypedArray;e.coerceString=function(e,t,r){if("string"==typeof t){if(t||!e.noBlank)return t}else if(("number"==typeof t||!0===t)&&!e.strict)return String(t);return void 0!==r?r:e.dflt},e.coerceNumber=function(e,r,n){if(t(r)){r=+r;var i=e.min,a=e.max;if(!(void 0!==i&&r<i||void 0!==a&&r>a))return r}return void 0!==n?n:e.dflt},e.coerceColor=function(e,t,n){return r(t).isValid()?t:void 0!==n?n:e.dflt},e.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},e.getValue=function(e,t){var r;return n(e)?t<e.length&&(r=e[t]):r=e,r},e.getLineWidth=function(e,t){return 0<t.mlw?t.mlw:n(e.marker.line.width)?0:e.marker.line.width}}}),to=m({"src/traces/bar/style.js"(e,t){var r=b(),n=W(),i=er(),a=ct(),o=He(),s=Qa().resizeText,l=Wa(),c=l.textfont,u=l.insidetextfont,h=l.outsidetextfont,f=eo();function p(e,t,r){i.pointStyle(e.selectAll("path"),t,r),d(e,t,r)}function d(e,t,n){e.selectAll("text").each((function(e){var o=r.select(this),s=a.ensureUniformFontSize(n,m(o,e,t,n));i.font(o,s)}))}function m(e,t,r,n){var i=n._fullLayout.font,a=r.textfont;if(e.classed("bartext-inside")){var o=_(t,r);a=y(r,t.i,i,o)}else e.classed("bartext-outside")&&(a=v(r,t.i,i));return a}function g(e,t,r){return x(c,e.textfont,t,r)}function y(e,t,r,i){var a=g(e,t,r);return(void 0===e._input.textfont||void 0===e._input.textfont.color||Array.isArray(e.textfont.color)&&void 0===e.textfont.color[t])&&(a={color:n.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}),x(u,e.insidetextfont,t,a)}function v(e,t,r){var n=g(e,t,r);return x(h,e.outsidetextfont,t,n)}function x(e,t,r,n){t=t||{};var i=f.getValue(t.family,r),a=f.getValue(t.size,r),o=f.getValue(t.color,r),s=f.getValue(t.weight,r),l=f.getValue(t.style,r),c=f.getValue(t.variant,r),u=f.getValue(t.textcase,r),h=f.getValue(t.lineposition,r),p=f.getValue(t.shadow,r);return{family:f.coerceString(e.family,i,n.family),size:f.coerceNumber(e.size,a,n.size),color:f.coerceColor(e.color,o,n.color),weight:f.coerceString(e.weight,s,n.weight),style:f.coerceString(e.style,l,n.style),variant:f.coerceString(e.variant,c,n.variant),textcase:f.coerceString(e.variant,u,n.textcase),lineposition:f.coerceString(e.variant,h,n.lineposition),shadow:f.coerceString(e.variant,p,n.shadow)}}function _(e,t){return"waterfall"===t.type?t[e.dir].marker.color:e.mcc||e.mc||t.marker.color}t.exports={style:function(e){var t=r.select(e).selectAll('g[class^="barlayer"]').selectAll("g.trace");s(e,t,"bar");var n=t.size(),i=e._fullLayout;t.style("opacity",(function(e){return e[0].trace.opacity})).each((function(e){("stack"===i.barmode&&n>1||0===i.bargap&&0===i.bargroupgap&&!e[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){p(r.select(this),t[0].trace,e)})),o.getComponentMethod("errorbars","style")(t)},styleTextPoints:d,styleOnSelect:function(e,t,n){var s=t[0].trace;s.selectedpoints?function(e,t,n){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,n){e.each((function(e){var o,s=r.select(this);if(e.selected){o=a.ensureUniformFontSize(n,m(s,e,t,n));var l=t.selected.textfont&&t.selected.textfont.color;l&&(o.color=l),i.font(s,o)}else i.selectedTextStyle(s,t)}))}(e.selectAll("text"),t,n)}(n,s,e):(p(n,s,e),o.getComponentMethod("errorbars","style")(n))},getInsideTextFont:y,getOutsideTextFont:v,getBarColor:_,resizeText:s}}}),ro=m({"src/traces/bar/plot.js"(e,t){var r=b(),n=M(),i=ct(),a=Et(),o=W(),s=er(),l=He(),c=ar().tickText,u=Qa(),h=u.recordMinTextSize,f=u.clearMinTextSize,p=to(),d=eo(),m=ci(),g=Wa(),y=g.text,v=g.textposition,x=Kt().appendArrayPointValue,_=m.TEXTPAD;function w(e){return e.id}function T(e){return(e>0)-(e<0)}function k(e,t){return e<t?1:-1}function A(e,t,r,n){var i;return!t.uniformtext.mode&&S(r)?(n&&(i=n()),e.transition().duration(r.duration).ease(r.easing).each("end",(function(){i&&i()})).each("interrupt",(function(){i&&i()}))):e}function S(e){return e&&e.duration>0}function E(e,t,r,n,i){return!(e<0||t<0)&&(r<=e&&n<=t||r<=t&&n<=e||(i?e>=r*(t/n):t>=n*(e/r)))}function C(e){return"auto"===e?0:e}function I(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:e.width*i+e.height*n,y:e.width*n+e.height*i}}function L(e,t,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor,u="end"===c,h="start"===c,f=((a.leftToRight||0)+1)/2,p=1-f,d=a.hasB,m=a.r,g=a.overhead,y=i.width,v=i.height,x=Math.abs(t-e),b=Math.abs(n-r),w=x>2*_&&b>2*_?_:0;x-=2*w,b-=2*w;var T=C(l);"auto"===l&&!(y<=x&&v<=b)&&(y>x||v>b)&&(!(y>b||v>x)||y<v!=x<b)&&(T+=90);var A,M,S=I(i,T);if(m&&m-g>_){var E=function(e,t,r,n,i,a,o,s,l){var c,u,h,f,p=Math.max(0,Math.abs(t-e)-2*_),d=Math.max(0,Math.abs(n-r)-2*_),m=a-_,g=o?m-Math.sqrt(m*m-(m-o)*(m-o)):m,y=l?2*m:s?m-o:2*g,v=l?2*m:s?2*g:m-o;return i.y/i.x>=d/(p-y)?f=d/i.y:i.y/i.x<=(d-v)/p?f=p/i.x:!l&&s?(c=i.x*i.x+i.y*i.y/4,h=(p-m)*(p-m)+(d/2-m)*(d/2-m)-m*m,f=(-(u=-2*i.x*(p-m)-i.y*(d/2-m))+Math.sqrt(u*u-4*c*h))/(2*c)):l?(c=(i.x*i.x+i.y*i.y)/4,h=(p/2-m)*(p/2-m)+(d/2-m)*(d/2-m)-m*m,f=(-(u=-i.x*(p/2-m)-i.y*(d/2-m))+Math.sqrt(u*u-4*c*h))/(2*c)):(c=i.x*i.x/4+i.y*i.y,h=(p/2-m)*(p/2-m)+(d-m)*(d-m)-m*m,f=(-(u=-i.x*(p/2-m)-2*i.y*(d-m))+Math.sqrt(u*u-4*c*h))/(2*c)),{scale:f=Math.min(1,f),pad:s?Math.max(0,m-Math.sqrt(Math.max(0,m*m-(m-(d-i.y*f)/2)*(m-(d-i.y*f)/2)))-o):Math.max(0,m-Math.sqrt(Math.max(0,m*m-(m-(p-i.x*f)/2)*(m-(p-i.x*f)/2)))-o)}}(e,t,r,n,S,m,g,o,d);A=E.scale,M=E.pad}else A=1,s&&(A=Math.min(1,x/S.x,b/S.y)),M=0;var L=i.left*p+i.right*f,P=(i.top+i.bottom)/2,z=(e+_)*p+(t-_)*f,D=(r+n)/2,O=0,R=0;if(h||u){var F=(o?S.x:S.y)/2;m&&(u||d)&&(w+=M);var B=o?k(e,t):k(r,n);o?h?(z=e+B*w,O=-B*F):(z=t-B*w,O=B*F):h?(D=r+B*w,R=-B*F):(D=n-B*w,R=B*F)}return{textX:L,textY:P,targetX:z,targetY:D,anchorX:O,anchorY:R,scale:A,rotate:T}}t.exports={plot:function(e,t,u,m,g,b){var M=t.xaxis,P=t.yaxis,z=e._fullLayout,D=e._context.staticPlot;g||(g={mode:z.barmode,norm:z.barmode,gap:z.bargap,groupgap:z.bargroupgap},f("bar",z));var O=i.makeTraceGroups(m,u,"trace bars").each((function(l){var u=r.select(this),f=l[0].trace,m=l[0].t,O="waterfall"===f.type,R="funnel"===f.type,F="histogram"===f.type,B="bar"===f.type,j=B||R,N=0;O&&f.connector.visible&&"between"===f.connector.mode&&(N=f.connector.line.width/2);var U="h"===f.orientation,V=S(g),q=i.ensureSingle(u,"g","points"),H=function(e){if(e.ids)return w}(f),G=q.selectAll("g.point").data(i.identity,H);G.enter().append("g").classed("point",!0),G.exit().remove(),G.each((function(u,w){var S,O,R=r.select(this),q=function(e,t,r,n){var i=[],a=[],o=n?t:r,s=n?r: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),n?[i,a]:[a,i]}(u,M,P,U),H=q[0][0],G=q[0][1],W=q[1][0],Z=q[1][1],Y=0==(U?G-H:Z-W);if(Y&&j&&d.getLineWidth(f,u)&&(Y=!1),Y||(Y=!(n(H)&&n(G)&&n(W)&&n(Z))),u.isBlank=Y,Y&&(U?G=H:Z=W),N&&!Y&&(U?(H-=k(H,G)*N,G+=k(H,G)*N):(W-=k(W,Z)*N,Z+=k(W,Z)*N)),"waterfall"===f.type){if(!Y){var X=f[u.dir].marker;S=X.line.width,O=X.color}}else S=d.getLineWidth(f,u),O=u.mc||f.marker.color;function $(e){var t=r.round(S/2%1,2);return 0===g.gap&&0===g.groupgap?r.round(Math.round(e)-t,2):e}var K=o.opacity(O)<1||S>.01?$:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?$(e):e>t?Math.ceil(e):Math.floor(e)};e._context.staticPlot||(H=K(H,G,U),G=K(G,H,U),W=K(W,Z,!U),Z=K(Z,W,!U));var J,Q=U?M.c2p:P.c2p;J=u.s0>0?u._sMax:u.s0<0?u._sMin:u.s1>0?u._sMax:u._sMin;var ee,te,re=B||F?function(e,t){if(!e)return 0;var r,n=Math.abs(U?Z-W:G-H),i=Math.abs(U?G-H:Z-W),a=K(Math.abs(Q(J,!0)-Q(0,!0))),o=u.hasB?Math.min(n/2,i/2):Math.min(n/2,a);return r="%"===t?n*(Math.min(50,e)/100):e,K(Math.max(Math.min(r,o),0))}(m.cornerradiusvalue,m.cornerradiusform):0,ne="M"+H+","+W+"V"+Z+"H"+G+"V"+W+"Z",ie=0;if(re&&u.s){var ae=0===T(u.s0)||T(u.s)===T(u.s0)?u.s1:u.s0;if((ie=K(u.hasB?0:Math.abs(Q(J,!0)-Q(ae,!0))))<re){var oe=k(H,G),se=k(W,Z),le=oe===-se?1:0;if(U)if(u.hasB)ee="M"+(H+re*oe)+","+W+"A "+re+","+re+" 0 0 "+le+" "+H+","+(W+re*se)+"V"+(Z-re*se)+"A "+re+","+re+" 0 0 "+le+" "+(H+re*oe)+","+Z+"H"+(G-re*oe)+"A "+re+","+re+" 0 0 "+le+" "+G+","+(Z-re*se)+"V"+(W+re*se)+"A "+re+","+re+" 0 0 "+le+" "+(G-re*oe)+","+W+"Z";else{var ce=(te=Math.abs(G-H)+ie)<re?re-Math.sqrt(te*(2*re-te)):0,ue=ie>0?Math.sqrt(ie*(2*re-ie)):0,he=oe>0?Math.max:Math.min;ee="M"+H+","+W+"V"+(Z-ce*se)+"H"+he(G-(re-ie)*oe,H)+"A "+re+","+re+" 0 0 "+le+" "+G+","+(Z-re*se-ue)+"V"+(W+re*se+ue)+"A "+re+","+re+" 0 0 "+le+" "+he(G-(re-ie)*oe,H)+","+(W+ce*se)+"Z"}else if(u.hasB)ee="M"+(H+re*oe)+","+W+"A "+re+","+re+" 0 0 "+le+" "+H+","+(W+re*se)+"V"+(Z-re*se)+"A "+re+","+re+" 0 0 "+le+" "+(H+re*oe)+","+Z+"H"+(G-re*oe)+"A "+re+","+re+" 0 0 "+le+" "+G+","+(Z-re*se)+"V"+(W+re*se)+"A "+re+","+re+" 0 0 "+le+" "+(G-re*oe)+","+W+"Z";else{var fe=(te=Math.abs(Z-W)+ie)<re?re-Math.sqrt(te*(2*re-te)):0,pe=ie>0?Math.sqrt(ie*(2*re-ie)):0,de=se>0?Math.max:Math.min;ee="M"+(H+fe*oe)+","+W+"V"+de(Z-(re-ie)*se,W)+"A "+re+","+re+" 0 0 "+le+" "+(H+re*oe-pe)+","+Z+"H"+(G-re*oe+pe)+"A "+re+","+re+" 0 0 "+le+" "+(G-fe*oe)+","+de(Z-(re-ie)*se,W)+"V"+W+"Z"}}else ee=ne}else ee=ne;var me=A(i.ensureSingle(R,"path"),z,g,b);if(me.style("vector-effect",D?"none":"non-scaling-stroke").attr("d",isNaN((G-H)*(Z-W))||Y&&e._context.staticPlot?"M0,0Z":ee).call(s.setClipUrl,t.layerClipId,e),!z.uniformtext.mode&&V){var ge=s.makePointStyleFns(f);s.singlePointStyle(u,me,f,ge,e)}(function(e,t,r,n,o,l,u,f,m,g,b,w,T){var M,S=t.xaxis,P=t.yaxis,z=e._fullLayout;function D(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+M,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(a.convertToTspans,e)}var O=n[0].trace,R="h"===O.orientation,F=function(e,t,r,n,a){var o,s=t[0].trace;return o=s.texttemplate?function(e,t,r,n,a){var o=t[0].trace,s=i.castOption(o,r,"texttemplate");if(!s)return"";var l,u,h,f,p="histogram"===o.type,d="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;function y(e){return c(f,f.c2l(e),!0).text}g?(l="y",u=a,h="x",f=n):(l="x",u=n,h="y",f=a);var v=t[r],_={};_.label=v.p,_.labelLabel=_[l+"Label"]=function(e){return c(u,u.c2l(e),!0).text}(v.p);var b=i.castOption(o,v.i,"text");(0===b||b)&&(_.text=b),_.value=v.s,_.valueLabel=_[h+"Label"]=y(v.s);var w={};x(w,o,v.i),(p||void 0===w.x)&&(w.x=g?_.value:_.label),(p||void 0===w.y)&&(w.y=g?_.label:_.value),(p||void 0===w.xLabel)&&(w.xLabel=g?_.valueLabel:_.labelLabel),(p||void 0===w.yLabel)&&(w.yLabel=g?_.labelLabel:_.valueLabel),d&&(_.delta=+v.rawS||v.s,_.deltaLabel=y(_.delta),_.final=v.v,_.finalLabel=y(_.final),_.initial=_.final-_.delta,_.initialLabel=y(_.initial)),m&&(_.value=v.s,_.valueLabel=y(_.value),_.percentInitial=v.begR,_.percentInitialLabel=i.formatPercent(v.begR),_.percentPrevious=v.difR,_.percentPreviousLabel=i.formatPercent(v.difR),_.percentTotal=v.sumR,_.percenTotalLabel=i.formatPercent(v.sumR));var T=i.castOption(o,v.i,"customdata");return T&&(_.customdata=T),i.texttemplateString({data:[w,_,o._meta],fallback:o.texttemplatefallback,labels:_,locale:e._d3locale,template:s})}(e,t,r,n,a):s.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,s="waterfall"===a.type,l="funnel"===a.type;function u(e){return c(o?r:n,+e,!0).text}var h,f=a.textinfo,p=e[t],d=f.split("+"),m=[],g=function(e){return-1!==d.indexOf(e)};if(g("label")&&m.push(function(e){return c(o?n:r,e,!0).text}(e[t].p)),g("text")&&(0===(h=i.castOption(a,p.i,"text"))||h)&&m.push(h),s){var y=+p.rawS||p.s,v=p.v,x=v-y;g("initial")&&m.push(u(x)),g("delta")&&m.push(u(y)),g("final")&&m.push(u(v))}if(l){g("value")&&m.push(u(p.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var b=_>1;g("percent initial")&&(h=i.formatPercent(p.begR),b&&(h+=" of initial"),m.push(h)),g("percent previous")&&(h=i.formatPercent(p.difR),b&&(h+=" of previous"),m.push(h)),g("percent total")&&(h=i.formatPercent(p.sumR),b&&(h+=" of total"),m.push(h))}return m.join("<br>")}(t,r,n,a):d.getValue(s.text,r),d.coerceString(y,o)}(z,n,o,S,P);M=function(e,t){var r=d.getValue(e.textposition,t);return d.coerceEnumerated(v,r)}(O,o);var B="stack"===w.mode||"relative"===w.mode,j=n[o],N=!B||j._outmost,U=j.hasB,V=g&&g-b>_;if(F&&"none"!==M&&(!j.isBlank&&l!==u&&f!==m||"auto"!==M&&"inside"!==M)){var q=z.font,H=p.getBarColor(n[o],O),G=p.getInsideTextFont(O,o,q,H),W=p.getOutsideTextFont(O,o,q),Z=O.insidetextanchor||"end",Y=r.datum();R?"log"===S.type&&Y.s0<=0&&(l=S.range[0]<S.range[1]?0:S._length):"log"===P.type&&Y.s0<=0&&(f=P.range[0]<P.range[1]?P._length:0);var X,$,K,J,Q,ee=Math.abs(u-l),te=Math.abs(m-f),re=ee-2*_,ne=te-2*_;if("outside"===M&&!N&&!j.hasB&&(M="inside"),"auto"===M)if(N){M="inside",X=D(r,F,Q=i.ensureUniformFontSize(e,G)),K=($=s.bBox(X.node())).width,J=$.height;var ie,ae=K>0&&J>0;ie=V?U?E(re-2*g,ne,K,J,R)||E(re,ne-2*g,K,J,R):R?E(re-(g-b),ne,K,J,R)||E(re,ne-2*(g-b),K,J,R):E(re,ne-(g-b),K,J,R)||E(re-2*(g-b),ne,K,J,R):E(re,ne,K,J,R),ae&&ie?M="inside":(M="outside",X.remove(),X=null)}else M="inside";if(!X){var oe=(X=D(r,F,Q=i.ensureUniformFontSize(e,"outside"===M?W:G))).attr("transform");if(X.attr("transform",""),K=($=s.bBox(X.node())).width,J=$.height,X.attr("transform",oe),K<=0||J<=0)return void X.remove()}var se,le=O.textangle;"outside"===M?se=function(e,t,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,h=i.height,f=Math.abs(t-e),p=Math.abs(n-r);o=s?p>2*_?_:0:f>2*_?_:0;var d=1;l&&(d=s?Math.min(1,p/h):Math.min(1,f/u));var m=C(c),g=I(i,m),y=(s?g.x:g.y)/2,v=(i.left+i.right)/2,x=(i.top+i.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,A=0,M=s?k(t,e):k(r,n);return s?(b=t-M*o,T=M*y):(w=n+M*o,A=-M*y),{textX:v,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:A,scale:d,rotate:m}}(l,u,f,m,$,{isHorizontal:R,constrained:"both"===O.constraintext||"outside"===O.constraintext,angle:le}):se=L(l,u,f,m,$,{isHorizontal:R,constrained:"both"===O.constraintext||"inside"===O.constraintext,angle:le,anchor:Z,hasB:U,r:g,overhead:b}),se.fontSize=Q.size,h("histogram"===O.type?"bar":O.type,se,z),j.transform=se;var ce=A(X,z,w,T);i.setTransormAndDisplay(ce,se)}else r.select("text").remove()})(e,t,R,l,w,H,G,W,Z,re,ie,g,b),t.layerClipId&&s.hideOutsideRangePoint(u,R.select("text"),M,P,f.xcalendar,f.ycalendar)}));var W=!1===f.cliponaxis;s.setClipUrl(u,W?null:t.layerClipId,e)}));l.getComponentMethod("errorbars","plot")(e,O,t,g)},toMoveInsideBar:L}}}),no=m({"src/traces/bar/hover.js"(e,t){var r=Or(),n=He(),i=W(),a=ct().fillText,o=eo().getLineWidth,s=ar().hoverLabelText,l=S().BADNUM;function c(e,t,n,i,o){var c,u,h,f,p,d,m,g=e.cd,y=g[0].trace,v=g[0].t,x="closest"===i,_="waterfall"===y.type,b=e.maxHoverDistance,w=e.maxSpikeDistance;"h"===y.orientation?(c=n,u=t,h="y",f="x",p=D,d=P):(c=t,u=n,h="x",f="y",d=D,p=P);var T=y[h+"period"],k=x||T;function A(e){return S(e,-1)}function M(e){return S(e,1)}function S(e,t){var r=e.w;return e[h]+t*r/2}function E(e){return e[h+"End"]-e[h+"Start"]}var C=x?A:T?function(e){return e.p-E(e)/2}:function(e){return Math.min(A(e),e.p-v.bardelta/2)},I=x?M:T?function(e){return e.p+E(e)/2}:function(e){return Math.max(M(e),e.p+v.bardelta/2)};function L(e,t,n){return o.finiteRange&&(n=0),r.inbox(e-c,t-c,n+Math.min(1,Math.abs(t-e)/m)-1)}function P(e){return L(C(e),I(e),b)}function z(e){var t=e[f];if(_){var r=Math.abs(e.rawS)||0;u>0?t+=r:u<0&&(t-=r)}return t}function D(e){var t=u,n=e.b,i=z(e);return r.inbox(n-t,i-t,b+(i-t)/(i-n)-1)}var O=e[h+"a"],R=e[f+"a"];m=Math.abs(O.r2c(O.range[1])-O.r2c(O.range[0]));var F,B,j,N,U=r.getDistanceFunction(i,p,d,(function(e){return(p(e)+d(e))/2}));if(r.getClosest(g,U,e),!1!==e.index&&g[e.index].p!==l){k||(C=function(e){return Math.min(A(e),e.p-v.bargroupwidth/2)},I=function(e){return Math.max(M(e),e.p+v.bargroupwidth/2)});var V=g[e.index],q=y.base?V.b+V.s:V.s;e[f+"0"]=e[f+"1"]=R.c2p(V[f],!0),e[f+"LabelVal"]=q;var H=v.extents[v.extents.round(V.p)];e[h+"0"]=O.c2p(x?C(V):H[0],!0),e[h+"1"]=O.c2p(x?I(V):H[1],!0);var G=void 0!==V.orig_p;return e[h+"LabelVal"]=G?V.orig_p:V.p,e.labelLabel=s(O,e[h+"LabelVal"],y[h+"hoverformat"]),e.valueLabel=s(R,e[f+"LabelVal"],y[f+"hoverformat"]),e.baseLabel=s(R,V.b,y[f+"hoverformat"]),e.spikeDistance=(B=u,j=(F=V).b,N=z(F),(r.inbox(j-B,N-B,w+(N-B)/(N-j)-1)+function(e){return L(A(e),M(e),w)}(V))/2),e[h+"Spike"]=O.c2p(V.p,!0),a(V,y,e),e.hovertemplate=y.hovertemplate,e}}function u(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=o(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,i,a){var o=c(e,t,r,i,a);if(o){var s=o.cd,l=s[0].trace,h=s[o.index];return o.color=u(l,h),n.getComponentMethod("errorbars","hoverInfo")(h,l,o),[o]}},hoverOnBars:c,getTraceColor:u}}}),io=m({"src/traces/bar/event_data.js"(e,t){t.exports=function(e,t,r){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),"h"===r.orientation?(e.label=e.y,e.value=e.x):(e.label=e.x,e.value=e.y),e}}}),ao=m({"src/traces/bar/select.js"(e,t){function r(e,t,r,n,i){var a=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),s=r.c2p(n?e.p0:e.s0,!0),l=r.c2p(n?e.p1:e.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}t.exports=function(e,t){var n,i=e.cd,a=e.xaxis,o=e.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===t)for(n=0;n<i.length;n++)i[n].selected=0;else for(n=0;n<i.length;n++){var h=i[n],f="ct"in h?h.ct:r(h,a,o,c,l);t.contains(f,!1,n,e)?(u.push({pointNumber:n,x:a.c2d(h.x),y:o.c2d(h.y)}),h.selected=1):h.selected=0}return u}}}),oo=m({"src/traces/bar/index.js"(e,t){t.exports={attributes:Wa(),layoutAttributes:Za(),supplyDefaults:Xa().supplyDefaults,crossTraceDefaults:Xa().crossTraceDefaults,supplyLayoutDefaults:$a(),calc:Ja(),crossTraceCalc:ui().crossTraceCalc,colorbar:mi(),arraysToCalcdata:Ka(),plot:ro().plot,style:to().style,styleOnSelect:to().styleOnSelect,hoverPoints:no().hoverPoints,eventData:io(),selectPoints:ao(),moduleType:"trace",name:"bar",basePlotModule:Ci(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}}),so=m({"lib/bar.js"(e,t){t.exports=oo()}}),lo=m({"src/traces/box/attributes.js"(e,t){var r=Tn(),n=kn(),i=Wa(),a=G(),o=It().axisHoverFormat,{hovertemplateAttrs:s,templatefallbackAttrs:l}=Fe(),c=B().extendFlat,u=n.marker,h=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:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.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:c({},u.symbol,{arrayOk:!1,editType:"plot"}),opacity:c({},u.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:c({},u.angle,{arrayOk:!1,editType:"calc"}),size:c({},u.size,{arrayOk:!1,editType:"calc"}),color:c({},u.color,{arrayOk:!1,editType:"style"}),line:{color:c({},h.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:c({},h.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:r(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:c({},n.text,{}),hovertext:c({},n.hovertext,{}),hovertemplate:s({}),hovertemplatefallback:l(),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:n.zorder}}}),co=m({"src/traces/box/layout_attributes.js"(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"}}}}),uo=m({"src/traces/box/defaults.js"(e,t){var r=ct(),n=He(),i=W(),a=Wn(),o=ei(),s=nr(),l=lo();function c(e,t,i,a){function o(e){var t=0;return e&&e.length&&(t+=1,r.isArrayOrTypedArray(e[0])&&e[0].length&&(t+=1)),t}function c(t){return r.validate(e[t],l[t])}var u,h=i("y"),f=i("x");if("box"===t.type){var p=i("q1"),d=i("median"),m=i("q3");t._hasPreCompStats=p&&p.length&&d&&d.length&&m&&m.length,u=Math.min(r.minRowLength(p),r.minRowLength(d),r.minRowLength(m))}var g,y,v=o(h),x=o(f),_=v&&r.minRowLength(h),b=x&&r.minRowLength(f),w=a.calendar,T={autotypenumbers:a.autotypenumbers};if(t._hasPreCompStats)switch(String(x)+String(v)){case"00":var k=c("x0")||c("dx");g=!c("y0")&&!c("dy")||k?"v":"h",y=u;break;case"10":g="v",y=Math.min(u,b);break;case"20":g="h",y=Math.min(u,f.length);break;case"01":g="h",y=Math.min(u,_);break;case"02":g="v",y=Math.min(u,h.length);break;case"12":g="v",y=Math.min(u,b,h.length);break;case"21":g="h",y=Math.min(u,f.length,_);break;case"11":y=0;break;case"22":var A,M=!1;for(A=0;A<f.length;A++)if("category"===s(f[A],w,T)){M=!0;break}if(M)g="v",y=Math.min(u,b,h.length);else{for(A=0;A<h.length;A++)if("category"===s(h[A],w,T)){M=!0;break}M?(g="h",y=Math.min(u,f.length,_)):(g="v",y=Math.min(u,b,h.length))}}else v>0?(g="v",y=x>0?Math.min(b,_):Math.min(_)):x>0?(g="h",y=Math.min(b)):y=0;if(y){t._length=y;var S=i("orientation",g);t._hasPreCompStats?"v"===S&&0===x?(i("x0",0),i("dx",1)):"h"===S&&0===v&&(i("y0",0),i("dy",1)):"v"===S&&0===x?i("x0"):"h"===S&&0===v&&i("y0"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],a)}else t.visible=!1}function u(e,t,n,i){var a=i.prefix,o=r.coerce2(e,t,l,"marker.outliercolor"),s=n("marker.line.outliercolor"),c="outliers";t._hasPreCompStats?c="all":(o||s)&&(c="suspectedoutliers");var u=n(a+"points",c);u?(n("jitter","all"===u?.3:0),n("pointpos","all"===u?-1.5:0),n("marker.symbol"),n("marker.opacity"),n("marker.size"),n("marker.angle"),n("marker.color",t.line.color),n("marker.line.color"),n("marker.line.width"),"suspectedoutliers"===u&&(n("marker.line.outliercolor",t.marker.color),n("marker.line.outlierwidth")),n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size"),n("text"),n("hovertext")):delete t.marker;var h=n("hoveron");("all"===h||-1!==h.indexOf("points"))&&(n("hovertemplate"),n("hovertemplatefallback")),r.coerceSelectionMarkerOpacity(t,n)}t.exports={supplyDefaults:function(e,t,n,o){function s(n,i){return r.coerce(e,t,l,n,i)}if(c(e,t,s,o),!1!==t.visible){a(e,t,o,s),s("xhoverformat"),s("yhoverformat");var h=t._hasPreCompStats;h&&(s("lowerfence"),s("upperfence")),s("line.color",(e.marker||{}).color||n),s("line.width"),s("fillcolor",i.addOpacity(t.line.color,.5));var f=!1;if(h){var p=s("mean"),d=s("sd");p&&p.length&&(f=!0,d&&d.length&&(f="sd"))}s("whiskerwidth");var m,g=s("sizemode");"quartiles"===g&&(m=s("boxmean",f)),s("showwhiskers","quartiles"===g),("sd"===g||"sd"===m)&&s("sdmultiple"),s("width"),s("quartilemethod");var y=!1;if(h){var v=s("notchspan");v&&v.length&&(y=!0)}else r.validate(e.notchwidth,l.notchwidth)&&(y=!0);s("notched",y)&&s("notchwidth"),u(e,t,s,{prefix:"box"}),s("zorder")}},crossTraceDefaults:function(e,t){var n,i;function a(e){return r.coerce(i._input,i,l,e)}for(var s=0;s<e.length;s++){var c=(i=e[s]).type;if("box"===c||"violin"===c){n=i._input;var u=t[c+"mode"];"group"===u&&o(n,i,t,a,u)}}},handleSampleDefaults:c,handlePointsDefaults:u}}}),ho=m({"src/traces/box/layout_defaults.js"(e,t){var r=He(),n=ct(),i=co();function a(e,t,n,i,a){for(var o=a+"Layout",s=!1,l=0;l<n.length;l++){var c=n[l];if(r.traceIs(c,o)){s=!0;break}}s&&(i(a+"mode"),i(a+"gap"),i(a+"groupgap"))}t.exports={supplyLayoutDefaults:function(e,t,r){a(0,0,r,(function(r,a){return n.coerce(e,t,i,r,a)}),"box")},_supply:a}}}),fo=m({"src/traces/box/calc.js"(e,t){var r=M(),n=ar(),i=ni(),a=ct(),o=S().BADNUM,s=a._;t.exports=function(e,t){var l,y,v,x,_,b,w,T=e._fullLayout,k=n.getFromId(e,t.xaxis||"x"),A=n.getFromId(e,t.yaxis||"y"),M=[],S="violin"===t.type?"_numViolins":"_numBoxes";"h"===t.orientation?(v=k,x="x",_=A,b="y",w=!!t.yperiodalignment):(v=A,x="y",_=k,b="x",w=!!t.xperiodalignment);var E,C,I,L,P,z,D=function(e,t,n,o){var s,l=t+"0"in e;if(t in e||l&&"d"+t in e){var c=n.makeCalcdata(e,t);return[i(e,n,t,c).vals,c]}s=l?e[t+"0"]:"name"in e&&("category"===n.type||r(e.name)&&-1!==["linear","log"].indexOf(n.type)||a.isDateTime(e.name)&&"date"===n.type)?e.name:o;for(var u="multicategory"===n.type?n.r2c_just_indices(s):n.d2c(s,0,e[t+"calendar"]),h=e._length,f=new Array(h),p=0;p<h;p++)f[p]=u;return[f]}(t,b,_,T[S]),O=D[0],R=D[1],F=a.distinctVals(O,_),B=F.vals,j=F.minDiff/2,N="all"===(t.boxpoints||t.points)?a.identity:function(e){return e.v<E.lf||e.v>E.uf};if(t._hasPreCompStats){var U=t[x],V=function(e){return v.d2c((t[e]||[])[l])},q=1/0,H=-1/0;for(l=0;l<t._length;l++){var G=O[l];if(r(G)){if((E={}).pos=E[b]=G,w&&R&&(E.orig_p=R[l]),E.q1=V("q1"),E.med=V("median"),E.q3=V("q3"),C=[],U&&a.isArrayOrTypedArray(U[l]))for(y=0;y<U[l].length;y++)(z=v.d2c(U[l][y]))!==o&&(c(P={v:z,i:[l,y]},t,[l,y]),C.push(P));if(E.pts=C.sort(u),L=(I=E[x]=C.map(h)).length,E.med!==o&&E.q1!==o&&E.q3!==o&&E.med>=E.q1&&E.q3>=E.med){var W=V("lowerfence");E.lf=W!==o&&W<=E.q1?W:f(E,I,L);var Z=V("upperfence");E.uf=Z!==o&&Z>=E.q3?Z:p(E,I,L);var Y=V("mean");E.mean=Y!==o?Y:L?a.mean(I,L):(E.q1+E.q3)/2;var X=V("sd");E.sd=Y!==o&&X>=0?X:L?a.stdev(I,L,E.mean):E.q3-E.q1,E.lo=d(E),E.uo=m(E);var $=V("notchspan");$=$!==o&&$>0?$:g(E,L),E.ln=E.med-$,E.un=E.med+$;var K=E.lf,J=E.uf;t.boxpoints&&I.length&&(K=Math.min(K,I[0]),J=Math.max(J,I[L-1])),t.notched&&(K=Math.min(K,E.ln),J=Math.max(J,E.un)),E.min=K,E.max=J}else{var Q;a.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join("\n")),Q=E.med!==o?E.med:E.q1!==o?E.q3!==o?(E.q1+E.q3)/2:E.q1:E.q3!==o?E.q3:0,E.med=Q,E.q1=E.q3=Q,E.lf=E.uf=Q,E.mean=E.sd=Q,E.ln=E.un=Q,E.min=E.max=Q}q=Math.min(q,E.min),H=Math.max(H,E.max),E.pts2=C.filter(N),M.push(E)}}t._extremes[v._id]=n.findExtremes(v,[q,H],{padded:!0})}else{var ee=v.makeCalcdata(t,x),te=function(e,t){for(var r=e.length,n=new Array(r+1),i=0;i<r;i++)n[i]=e[i]-t;return n[r]=e[r-1]+t,n}(B,j),re=B.length,ne=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=[];return t}(re);for(l=0;l<t._length;l++)if(z=ee[l],r(z)){var ie=a.findBin(O[l],te);ie>=0&&ie<re&&(c(P={v:z,i:l},t,l),ne[ie].push(P))}var ae=1/0,oe=-1/0,se=t.quartilemethod,le="exclusive"===se,ce="inclusive"===se;for(l=0;l<re;l++)if(ne[l].length>0){var ue,he;(E={}).pos=E[b]=B[l],C=E.pts=ne[l].sort(u),L=(I=E[x]=C.map(h)).length,E.min=I[0],E.max=I[L-1],E.mean=a.mean(I,L),E.sd=a.stdev(I,L,E.mean)*t.sdmultiple,E.med=a.interp(I,.5),L%2&&(le||ce)?(le?(ue=I.slice(0,L/2),he=I.slice(L/2+1)):ce&&(ue=I.slice(0,L/2+1),he=I.slice(L/2)),E.q1=a.interp(ue,.5),E.q3=a.interp(he,.5)):(E.q1=a.interp(I,.25),E.q3=a.interp(I,.75)),E.lf=f(E,I,L),E.uf=p(E,I,L),E.lo=d(E),E.uo=m(E);var fe=g(E,L);E.ln=E.med-fe,E.un=E.med+fe,ae=Math.min(ae,E.ln),oe=Math.max(oe,E.un),E.pts2=C.filter(N),M.push(E)}t.notched&&a.isTypedArray(ee)&&(ee=Array.from(ee)),t._extremes[v._id]=n.findExtremes(v,t.notched?ee.concat([ae,oe]):ee,{padded:!0})}return function(e,t){if(a.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r<e.length;r++){for(var n=e[r].pts||[],i={},o=0;o<n.length;o++)i[n[o].i]=o;a.tagSelected(n,t,i)}}(M,t),M.length>0?(M[0].t={num:T[S],dPos:j,posLetter:b,valLetter:x,labels:{med:s(e,"median:"),min:s(e,"min:"),q1:s(e,"q1:"),q3:s(e,"q3:"),max:s(e,"max:"),mean:"sd"===t.boxmean||"sd"===t.sizemode?s(e,"mean ± σ:").replace("σ",1===t.sdmultiple?"σ":t.sdmultiple+"σ"):s(e,"mean:"),lf:s(e,"lower fence:"),uf:s(e,"upper fence:")}},T[S]++,M):[{t:{empty:!0}}]};var l={text:"tx",hovertext:"htx"};function c(e,t,r){for(var n in l)a.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?a.isArrayOrTypedArray(t[n][r[0]])&&(e[l[n]]=t[n][r[0]][r[1]]):e[l[n]]=t[n][r])}function u(e,t){return e.v-t.v}function h(e){return e.v}function f(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(a.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function p(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(a.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function d(e){return 4*e.q1-3*e.q3}function m(e){return 4*e.q3-3*e.q1}function g(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}}}),po=m({"src/traces/box/cross_trace_calc.js"(e,t){var r=ar(),n=ct(),i=nn().getAxisGroup,a=["v","h"];function o(e,t,a,o){var s,l,c,u=t.calcdata,h=t._fullLayout,f=o._id,p=f.charAt(0),d=[],m=0;for(s=0;s<a.length;s++)for(c=u[a[s]],l=0;l<c.length;l++)d.push(o.c2l(c[l].pos,!0)),m+=(c[l].pts2||[]).length;if(d.length){var g=n.distinctVals(d);("category"===o.type||"multicategory"===o.type)&&(g.minDiff=1);var y=g.minDiff/2;r.minDtick(o,g.minDiff,g.vals[0],!0);var v=h["violin"===e?"_numViolins":"_numBoxes"],x="group"===h[e+"mode"]&&v>1,_=1-h[e+"gap"],b=1-h[e+"groupgap"];for(s=0;s<a.length;s++){var w,T,k,A,M=(c=u[a[s]])[0].trace,S=c[0].t,E=M.width,C=M.side;if(E)w=T=A=E/2,k=0;else if(w=y,x){var I=i(h,o._id)+M.orientation,L=(h._alignmentOpts[I]||{})[M.alignmentgroup]||{},P=Object.keys(L.offsetGroups||{}).length,z=P||v;T=w*_*b/z,k=2*w*(((P?M._offsetIndex:S.num)+.5)/z-.5)*_,A=w*_/z}else T=w*_*b,k=0,A=w;S.dPos=w,S.bPos=k,S.bdPos=T,S.wHover=A;var D,O,R,F,B,j,N,U,V=k+T,q=!!E;if("positive"===C?(D=w*(E?1:.5),R=V,O=R=k):"negative"===C?(D=R=k,O=w*(E?1:.5),F=V):(D=O=w,R=F=V),(M.boxpoints||M.points)&&m>0){var H=M.pointpos,G=M.jitter,W=M.marker.size/2,Z=0;H+G>=0&&((Z=V*(H+G))>D?(q=!0,N=W,B=Z):Z>R&&(N=W,B=D)),Z<=D&&(B=D);var Y=0;H-G<=0&&((Y=-V*(H-G))>O?(q=!0,U=W,j=Y):Y>F&&(U=W,j=O)),Y<=O&&(j=O)}else B=D,j=O;var X=new Array(c.length);for(l=0;l<c.length;l++)X[l]=c[l].pos;M._extremes[f]=r.findExtremes(o,X,{padded:q,vpadminus:j,vpadplus:B,vpadLinearized:!0,ppadminus:{x:U,y:N}[p],ppadplus:{x:N,y:U}[p]})}}}t.exports={crossTraceCalc:function(e,t){for(var r=e.calcdata,n=t.xaxis,i=t.yaxis,s=0;s<a.length;s++){for(var l=a[s],c="h"===l?i:n,u=[],h=0;h<r.length;h++){var f=r[h],p=f[0].t,d=f[0].trace;!0===d.visible&&("box"===d.type||"candlestick"===d.type)&&!p.empty&&(d.orientation||"v")===l&&d.xaxis===n._id&&d.yaxis===i._id&&u.push(h)}o("box",e,u,c)}},setPositionOffset:o}}}),mo=m({"src/traces/box/plot.js"(e,t){var r=b(),n=ct(),i=er();function a(e,t,i,a,o){var s,l,c="h"===i.orientation,u=t.val,h=t.pos,f=!!h.rangebreaks,p=a.bPos,d=a.wdPos||0,m=a.bPosPxOffset||0,g=i.whiskerwidth||0,y=!1!==i.showwhiskers,v=i.notched||!1,x=v?1-2*i.notchwidth:1;Array.isArray(a.bdPos)?(s=a.bdPos[0],l=a.bdPos[1]):(s=a.bdPos,l=a.bdPos);var _=e.selectAll("path.box").data("violin"!==i.type||i.box.visible?n.identity:[]);_.enter().append("path").style("vector-effect",o?"none":"non-scaling-stroke").attr("class","box"),_.exit().remove(),_.each((function(e){if(e.empty)return r.select(this).attr("d","M0,0Z");var t=h.c2l(e.pos+p,!0),a=h.l2p(t-s)+m,o=h.l2p(t+l)+m,_=f?(a+o)/2:h.l2p(t)+m,b=i.whiskerwidth,w=f?a*b+(1-b)*_:h.l2p(t-d)+m,T=f?o*b+(1-b)*_:h.l2p(t+d)+m,k=h.l2p(t-s*x)+m,A=h.l2p(t+l*x)+m,M="sd"===i.sizemode,S=u.c2p(M?e.mean-e.sd:e.q1,!0),E=M?u.c2p(e.mean+e.sd,!0):u.c2p(e.q3,!0),C=n.constrain(M?u.c2p(e.mean,!0):u.c2p(e.med,!0),Math.min(S,E)+1,Math.max(S,E)-1),I=void 0===e.lf||!1===i.boxpoints||M,L=u.c2p(I?e.min:e.lf,!0),P=u.c2p(I?e.max:e.uf,!0),z=u.c2p(e.ln,!0),D=u.c2p(e.un,!0);c?r.select(this).attr("d","M"+C+","+k+"V"+A+"M"+S+","+a+"V"+o+(v?"H"+z+"L"+C+","+A+"L"+D+","+o:"")+"H"+E+"V"+a+(v?"H"+D+"L"+C+","+k+"L"+z+","+a:"")+"Z"+(y?"M"+S+","+_+"H"+L+"M"+E+","+_+"H"+P+(0===g?"":"M"+L+","+w+"V"+T+"M"+P+","+w+"V"+T):"")):r.select(this).attr("d","M"+k+","+C+"H"+A+"M"+a+","+S+"H"+o+(v?"V"+z+"L"+A+","+C+"L"+o+","+D:"")+"V"+E+"H"+a+(v?"V"+D+"L"+k+","+C+"L"+a+","+z:"")+"Z"+(y?"M"+_+","+S+"V"+L+"M"+_+","+E+"V"+P+(0===g?"":"M"+w+","+L+"H"+T+"M"+w+","+P+"H"+T):""))}))}function o(e,t,r,a){var o=t.x,s=t.y,l=a.bdPos,c=a.bPos,u=r.boxpoints||r.points;n.seedPseudoRandom();var h=e.selectAll("g.points").data(u?function(e){return e.forEach((function(e){e.t=a,e.trace=r})),e}:[]);h.enter().append("g").attr("class","points"),h.exit().remove();var f=h.selectAll("path").data((function(e){var t,i,a=e.pts2,o=Math.max((e.max-e.min)/10,e.q3-e.q1),s=1e-9*o,h=.01*o,f=[],p=0;if(r.jitter){if(0===o)for(p=1,f=new Array(a.length),t=0;t<a.length;t++)f[t]=1;else for(t=0;t<a.length;t++){var d=Math.max(0,t-5),m=a[d].v,g=Math.min(a.length-1,t+5),y=a[g].v;"all"!==u&&(a[t].v<e.lf?y=Math.min(y,e.lf):m=Math.max(m,e.uf));var v=Math.sqrt(h*(g-d)/(y-m+s))||0;v=n.constrain(Math.abs(v),0,1),f.push(v),p=Math.max(v,p)}i=2*r.jitter/(p||1)}for(t=0;t<a.length;t++){var x=a[t],_=x.v,b=r.jitter?i*f[t]*(n.pseudoRandom()-.5):0,w=e.pos+c+l*(r.pointpos+b);"h"===r.orientation?(x.y=w,x.x=_):(x.x=w,x.y=_),"suspectedoutliers"===u&&_<e.uo&&_>e.lo&&(x.so=!0)}return a}));f.enter().append("path").classed("point",!0),f.exit().remove(),f.call(i.translatePoints,o,s)}function s(e,t,i,a){var o,s,l=t.val,c=t.pos,u=!!c.rangebreaks,h=a.bPos,f=a.bPosPxOffset||0,p=i.boxmean||(i.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var d=e.selectAll("path.mean").data("box"===i.type&&i.boxmean||"violin"===i.type&&i.box.visible&&i.meanline.visible?n.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each((function(e){var t=c.c2l(e.pos+h,!0),n=c.l2p(t-o)+f,a=c.l2p(t+s)+f,d=u?(n+a)/2:c.l2p(t)+f,m=l.c2p(e.mean,!0),g=l.c2p(e.mean-e.sd,!0),y=l.c2p(e.mean+e.sd,!0);"h"===i.orientation?r.select(this).attr("d","M"+m+","+n+"V"+a+("sd"===p?"m0,0L"+g+","+d+"L"+m+","+n+"L"+y+","+d+"Z":"")):r.select(this).attr("d","M"+n+","+m+"H"+a+("sd"===p?"m0,0L"+d+","+g+"L"+n+","+m+"L"+d+","+y+"Z":""))}))}t.exports={plot:function(e,t,i,l){var c=e._context.staticPlot,u=t.xaxis,h=t.yaxis;n.makeTraceGroups(l,i,"trace boxes").each((function(e){var t,n,i=r.select(this),l=e[0],f=l.t,p=l.trace;f.wdPos=f.bdPos*p.whiskerwidth,!0!==p.visible||f.empty?i.remove():("h"===p.orientation?(t=h,n=u):(t=u,n=h),a(i,{pos:t,val:n},p,f,c),o(i,{x:u,y:h},p,f),s(i,{pos:t,val:n},p,f))}))},plotBoxAndWhiskers:a,plotPoints:o,plotBoxMean:s}}}),go=m({"src/traces/box/style.js"(e,t){var r=b(),n=W(),i=er();t.exports={style:function(e,t,a){var o=a||r.select(e).selectAll("g.trace.boxes");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(t){var a=r.select(this),o=t[0].trace,s=o.line.width;function l(e,t,r,i){e.style("stroke-width",t+"px").call(n.stroke,r).call(n.fill,i)}var c=a.selectAll("path.box");if("candlestick"===o.type)c.each((function(e){if(!e.empty){var t=r.select(this),n=o[e.dir];l(t,n.line.width,n.line.color,n.fillcolor),t.style("opacity",o.selectedpoints&&!e.selected?.3:1)}}));else{l(c,s,o.line.color,o.fillcolor),a.selectAll("path.mean").style({"stroke-width":s,"stroke-dasharray":2*s+"px,"+s+"px"}).call(n.stroke,o.line.color);var u=a.selectAll("path.point");i.pointStyle(u,o,e)}}))},styleOnSelect:function(e,t,r){var n=t[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,e)}}}}),yo=m({"src/traces/box/hover.js"(e,t){var r=ar(),n=ct(),i=Or(),a=W(),o=n.fillText;function s(e,t,o,s){var l,c,u,h,f,p,d,m,g,y,v,x,_,b,w=e.cd,T=e.xa,k=e.ya,A=w[0].trace,M=w[0].t,S="violin"===A.type,E=M.bdPos,C=M.wHover,I=function(e){return u.c2l(e.pos)+M.bPos-u.c2l(p)};S&&"both"!==A.side?("positive"===A.side&&(g=function(e){var t=I(e);return i.inbox(t,t+C,y)},x=E,_=0),"negative"===A.side&&(g=function(e){var t=I(e);return i.inbox(t-C,t,y)},x=0,_=E)):(g=function(e){var t=I(e);return i.inbox(t-C,t+C,y)},x=_=E),b=S?function(e){return i.inbox(e.span[0]-f,e.span[1]-f,y)}:function(e){return i.inbox(e.min-f,e.max-f,y)},"h"===A.orientation?(f=t,p=o,d=b,m=g,l="y",u=k,c="x",h=T):(f=o,p=t,d=g,m=b,l="x",u=T,c="y",h=k);var L=Math.min(1,E/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function P(e){return(d(e)+m(e))/2}y=e.maxHoverDistance-L,v=e.maxSpikeDistance-L;var z=i.getDistanceFunction(s,d,m,P);if(i.getClosest(w,z,e),!1===e.index)return[];var D=w[e.index],O=A.line.color,R=(A.marker||{}).color;a.opacity(O)&&A.line.width?e.color=O:a.opacity(R)&&A.boxpoints?e.color=R:e.color=A.fillcolor,e[l+"0"]=u.c2p(D.pos+M.bPos-_,!0),e[l+"1"]=u.c2p(D.pos+M.bPos+x,!0),e[l+"LabelVal"]=void 0!==D.orig_p?D.orig_p:D.pos;var F=l+"Spike";e.spikeDistance=P(D)*v/y,e[F]=u.c2p(D.pos,!0);var B=A.boxmean||"sd"===A.sizemode||(A.meanline||{}).visible,j=A.boxpoints||A.points,N=j&&B?["max","uf","q3","med","mean","q1","lf","min"]:j&&!B?["max","uf","q3","med","q1","lf","min"]:!j&&B?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],U=h.range[1]<h.range[0];A.orientation===(U?"v":"h")&&N.reverse();for(var V=e.spikeDistance,q=e[F],H=[],G=0;G<N.length;G++){var W=N[G];if(W in D){var Z=D[W],Y=h.c2p(Z,!0),X=n.extendFlat({},e);X.attr=W,X[c+"0"]=X[c+"1"]=Y,X[c+"LabelVal"]=Z,X[c+"Label"]=(M.labels?M.labels[W]+" ":"")+r.hoverLabelText(h,Z,A[c+"hoverformat"]),X.hoverOnBox=!0,"mean"===W&&"sd"in D&&("sd"===A.boxmean||"sd"===A.sizemode)&&(X[c+"err"]=D.sd),X.hovertemplate=!1,H.push(X)}}e.name="",e.spikeDistance=void 0,e[F]=void 0;for(var $=0;$<H.length;$++)"med"!==H[$].attr?(H[$].name="",H[$].spikeDistance=void 0,H[$][F]=void 0):(H[$].spikeDistance=V,H[$][F]=q);return H}function l(e,t,r){for(var a,s,l,c=e.cd,u=e.xa,h=e.ya,f=c[0].trace,p=u.c2p(t),d=h.c2p(r),m=i.quadrature((function(e){var t=Math.max(3,e.mrc||0);return Math.max(Math.abs(u.c2p(e.x)-p)-t,1-3/t)}),(function(e){var t=Math.max(3,e.mrc||0);return Math.max(Math.abs(h.c2p(e.y)-d)-t,1-3/t)})),g=!1,y=0;y<c.length;y++){s=c[y];for(var v=0;v<(s.pts||[]).length;v++){var x=m(l=s.pts[v]);x<=e.distance&&(e.distance=x,g=[y,v])}}if(!g)return!1;l=(s=c[g[0]]).pts[g[1]];var _=u.c2p(l.x,!0),b=h.c2p(l.y,!0),w=l.mrc||1;a=n.extendFlat({},e,{index:l.i,color:(f.marker||{}).color,name:f.name,x0:_-w,x1:_+w,y0:b-w,y1:b+w,spikeDistance:e.distance,hovertemplate:f.hovertemplate});var T,k=s.orig_p,A=void 0!==k?k:s.pos;return"h"===f.orientation?(T=h,a.xLabelVal=l.x,a.yLabelVal=A):(T=u,a.xLabelVal=A,a.yLabelVal=l.y),a[T._id.charAt(0)+"Spike"]=T.c2p(s.pos,!0),o(l,f,a),a}t.exports={hoverPoints:function(e,t,r,n){var i,a=e.cd[0].trace.hoveron,o=[];return-1!==a.indexOf("boxes")&&(o=o.concat(s(e,t,r,n))),-1!==a.indexOf("points")&&(i=l(e,t,r)),"closest"===n?i?[i]:o:(i&&o.push(i),o)},hoverOnBoxes:s,hoverOnPoints:l}}}),vo=m({"src/traces/box/event_data.js"(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}}}),xo=m({"src/traces/box/select.js"(e,t){t.exports=function(e,t){var r,n,i=e.cd,a=e.xaxis,o=e.yaxis,s=[];if(!1===t)for(r=0;r<i.length;r++)for(n=0;n<(i[r].pts||[]).length;n++)i[r].pts[n].selected=0;else for(r=0;r<i.length;r++)for(n=0;n<(i[r].pts||[]).length;n++){var l=i[r].pts[n],c=a.c2p(l.x),u=o.c2p(l.y);t.contains([c,u],null,l.i,e)?(s.push({pointNumber:l.i,x:a.c2d(l.x),y:o.c2d(l.y)}),l.selected=1):l.selected=0}return s}}}),_o=m({"src/traces/box/index.js"(e,t){t.exports={attributes:lo(),layoutAttributes:co(),supplyDefaults:uo().supplyDefaults,crossTraceDefaults:uo().crossTraceDefaults,supplyLayoutDefaults:ho().supplyLayoutDefaults,calc:fo(),crossTraceCalc:po().crossTraceCalc,plot:mo().plot,style:go().style,styleOnSelect:go().styleOnSelect,hoverPoints:yo().hoverPoints,eventData:vo(),selectPoints:xo(),moduleType:"trace",name:"box",basePlotModule:Ci(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}}),bo=m({"lib/box.js"(e,t){t.exports=_o()}}),wo=m({"src/traces/heatmap/attributes.js"(e,t){var r=zt(),{extendFlat:n}=B(),i=q(),{axisHoverFormat:a}=It(),o=j(),{hovertemplateAttrs:s,templatefallbackAttrs:l,texttemplateAttrs:c}=Fe(),u=kn();t.exports=n({z:{valType:"data_array",editType:"calc"},x:n({},u.x,{impliedEdits:{xtype:"array"}}),x0:n({},u.x0,{impliedEdits:{xtype:"scaled"}}),dx:n({},u.dx,{impliedEdits:{xtype:"scaled"}}),y:n({},u.y,{impliedEdits:{ytype:"array"}}),y0:n({},u.y0,{impliedEdits:{ytype:"scaled"}}),dy:n({},u.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:n({},u.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:n({},u.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:n({},u.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:n({},u.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:n({},u.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:n({},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:l(),texttemplate:c({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),texttemplatefallback:l({editType:"plot"}),textfont:o({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:n({},i.showlegend,{dflt:!1}),zorder:u.zorder},r("",{cLetter:"z",autoColorDflt:!1}))}}),To=m({"src/traces/heatmap/xyz_defaults.js"(e,t){var r=M(),n=ct(),i=He();function a(e,t){var r=t(e);return"scaled"===(r?t(e+"type","array"):"scaled")&&(t(e+"0"),t("d"+e)),r}t.exports=function(e,t,o,s,l,c){var u,h,f=o("z");if(l=l||"x",c=c||"y",void 0===f||!f.length)return 0;if(n.isArray1D(f)){u=o(l),h=o(c);var p=n.minRowLength(u),d=n.minRowLength(h);if(0===p||0===d)return 0;t._length=Math.min(p,d,f.length)}else{if(u=a(l,o),h=a(c,o),!function(e){for(var t,i=!0,a=!1,o=!1,s=0;s<e.length;s++){if(t=e[s],!n.isArrayOrTypedArray(t)){i=!1;break}t.length>0&&(a=!0);for(var l=0;l<t.length;l++)if(r(t[l])){o=!0;break}}return i&&a&&o}(f))return 0;o("transpose"),t._length=null}return i.getComponentMethod("calendars","handleTraceDefaults")(e,t,[l,c],s),!0}}}),ko=m({"src/traces/heatmap/label_defaults.js"(e,t){var r=ct();t.exports=function(e,t){e("texttemplate"),e("texttemplatefallback");var n=r.extendFlat({},t.font,{color:"auto",size:"auto"});r.coerceFont(e,"textfont",n)}}}),Ao=m({"src/traces/heatmap/style_defaults.js"(e,t){t.exports=function(e,t,r){!1===r("zsmooth")&&(r("xgap"),r("ygap")),r("zhoverformat")}}}),Mo=m({"src/traces/heatmap/defaults.js"(e,t){var r=ct(),n=To(),i=ko(),a=Wn(),o=Ao(),s=Ht(),l=wo();t.exports=function(e,t,c,u){function h(n,i){return r.coerce(e,t,l,n,i)}n(e,t,h,u)?(a(e,t,u,h),h("xhoverformat"),h("yhoverformat"),h("text"),h("hovertext"),h("hovertemplate"),h("hovertemplatefallback"),i(h,u),o(e,t,h,u),h("hoverongaps"),h("connectgaps",r.isArray1D(t.z)&&!1!==t.zsmooth),s(e,t,u,h,{prefix:"",cLetter:"z"}),h("zorder")):t.visible=!1}}}),So=m({"src/traces/histogram/bin_functions.js"(e,t){var r=M();t.exports={count:function(e,t,r){return r[e]++,1},sum:function(e,t,n,i){var a=i[t];return r(a)?(a=Number(a),n[e]+=a,a):0},avg:function(e,t,n,i,a){var o=i[t];return r(o)&&(o=Number(o),n[e]+=o,a[e]++),0},min:function(e,t,n,i){var a=i[t];if(r(a)){if(a=Number(a),!r(n[e]))return n[e]=a,a;if(n[e]>a){var o=a-n[e];return n[e]=a,o}}return 0},max:function(e,t,n,i){var a=i[t];if(r(a)){if(a=Number(a),!r(n[e]))return n[e]=a,a;if(n[e]<a){var o=a-n[e];return n[e]=a,o}}return 0}}}}),Eo=m({"src/traces/histogram/norm_functions.js"(e,t){t.exports={percent:function(e,t){for(var r=e.length,n=100/t,i=0;i<r;i++)e[i]*=n},probability:function(e,t){for(var r=e.length,n=0;n<r;n++)e[n]/=t},density:function(e,t,r,n){var i=e.length;n=n||1;for(var a=0;a<i;a++)e[a]*=r[a]*n},"probability density":function(e,t,r,n){var i=e.length;n&&(t/=n);for(var a=0;a<i;a++)e[a]*=r[a]/t}}}}),Co=m({"src/traces/histogram/average.js"(e,t){t.exports=function(e,t){for(var r=e.length,n=0,i=0;i<r;i++)t[i]?(e[i]/=t[i],n+=e[i]):e[i]=null;return n}}}),Io=m({"src/traces/histogram/bin_label_vals.js"(e,t){var r=S(),n=r.ONEAVGYEAR,i=r.ONEAVGMONTH,a=r.ONEDAY,o=r.ONEHOUR,s=r.ONEMIN,l=r.ONESEC,c=ar().tickIncrement;function u(e,t,r,n){if(e*t<=0)return 1/0;for(var i=Math.abs(t-e),a="date"===r.type,o=h(i,a),s=0;s<10;s++){var l=h(80*o,a);if(o===l)break;if(!f(l,e,t,a,r,n))break;o=l}return o}function h(e,t){return t&&e>l?e>a?e>1.1*n?n:e>1.1*i?i:a:e>o?o:e>s?s:l:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function f(e,t,r,i,o,s){if(i&&e>a){var l=p(t,o,s),c=p(r,o,s),u=e===n?0:1;return l[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function p(e,t,r){var i=t.c2d(e,n,r).split("-");return""===i[0]&&(i.unshift(),i[0]="-"+i[0]),i}t.exports=function(e,t,r,i,o){var s,l,h=-1.1*t,f=-.1*t,p=e-f,d=r[0],m=r[1],g=Math.min(u(d+f,d+p,i,o),u(m+f,m+p,i,o)),y=Math.min(u(d+h,d+f,i,o),u(m+h,m+f,i,o));if(g>y&&y<Math.abs(m-d)/4e3?(s=g,l=!1):(s=Math.min(g,y),l=!0),"date"===i.type&&s>a){var v=s===n?1:6,x=s===n?"M12":"M1";return function(t,r){var a=i.c2d(t,n,o),s=a.indexOf("-",v);s>0&&(a=a.slice(0,s));var u=i.d2c(a,0,o);if(u<t){var h=c(u,x,!1,o);(u+h)/2<t+e&&(u=h)}return r&&l?c(u,x,!0,o):u}}return function(t,r){var n=s*Math.round(t/s);return n+s/10<t&&n+.9*s<t+e&&(n+=s),r&&l&&(n-=s),n}}}}),Lo=m({"src/traces/histogram/calc.js"(e,t){var r=M(),n=ct(),i=He(),a=ar(),{hasColorscale:o}=Ct(),s=Zt(),l=Ka(),c=So(),u=Eo(),h=Co(),f=Io();function p(e,t,o,s,l){var c,u,h,f,d,m,g,y=s+"bins",v=e._fullLayout,x=t["_"+s+"bingroup"],_=v._histogramBinOpts[x],b="overlay"===v.barmode,w=function(e){return o.r2c(e,0,f)},T=function(e){return o.c2r(e,0,f)},k="date"===o.type?function(e){return e||0===e?n.cleanDate(e,null,f):null}:function(e){return r(e)?Number(e):null};function A(e,t,r){t[e+"Found"]?(t[e]=k(t[e]),null===t[e]&&(t[e]=r[e])):(m[e]=t[e]=r[e],n.nestedProperty(u[0],y+"."+e).set(r[e]))}if(t["_"+s+"autoBinFinished"])delete t["_"+s+"autoBinFinished"];else{u=_.traces;var M=[],S=!0,E=!1,C=!1;for(c=0;c<u.length;c++)if((h=u[c]).visible){var I=_.dirs[c];d=h["_"+I+"pos0"]=o.makeCalcdata(h,I),M=n.concat(M,d),delete h["_"+s+"autoBinFinished"],!0===t.visible&&(S?S=!1:(delete h._autoBin,h["_"+s+"autoBinFinished"]=1),i.traceIs(h,"2dMap")&&(E=!0),"histogram2dcontour"===h.type&&(C=!0))}f=u[0][s+"calendar"];var L=a.autoBin(M,o,_.nbins,E,f,_.sizeFound&&_.size),P=u[0]._autoBin={};if(m=P[_.dirs[0]]={},C&&(_.size||(L.start=T(a.tickIncrement(w(L.start),L.size,!0,f))),void 0===_.end&&(L.end=T(a.tickIncrement(w(L.end),L.size,!1,f)))),b&&!i.traceIs(t,"2dMap")&&0===L._dataSpan&&"category"!==o.type&&"multicategory"!==o.type&&""===t.bingroup&&typeof t.xbins>"u"){if(l)return[L,d,!0];L=function(e,t,r,i,a){var o,s,l,c=e._fullLayout,u=function(e,t){for(var r=t.xaxis,n=t.yaxis,i=t.orientation,a=[],o=e._fullData,s=0;s<o.length;s++){var l=o[s];"histogram"===l.type&&!0===l.visible&&l.orientation===i&&l.xaxis===r&&l.yaxis===n&&a.push(l)}return a}(e,t),h=!1,f=1/0,d=[t];for(o=0;o<u.length;o++)if((s=u[o])===t)h=!0;else if(h){var m=p(e,s,r,i,!0),g=m[0],y=m[2];s["_"+i+"autoBinFinished"]=1,s["_"+i+"pos0"]=m[1],y?d.push(s):f=Math.min(f,g.size)}else l=c._histogramBinOpts[s["_"+i+"bingroup"]],f=Math.min(f,l.size||s[a].size);var v=new Array(d.length);for(o=0;o<d.length;o++)for(var x=d[o]["_"+i+"pos0"],_=0;_<x.length;_++)if(void 0!==x[_]){v[o]=x[_];break}for(isFinite(f)||(f=n.distinctVals(v).minDiff),o=0;o<d.length;o++){var b=(s=d[o])[i+"calendar"],w={start:r.c2r(v[o]-f/2,0,b),end:r.c2r(v[o]+f/2,0,b),size:f};s._input[a]=s[a]=w,(l=c._histogramBinOpts[s["_"+i+"bingroup"]])&&n.extendFlat(l,w)}return t[a]}(e,t,o,s,y)}(g=h.cumulative||{}).enabled&&"include"!==g.currentbin&&("decreasing"===g.direction?L.start=T(a.tickIncrement(w(L.start),L.size,!0,f)):L.end=T(a.tickIncrement(w(L.end),L.size,!1,f))),_.size=L.size,_.sizeFound||(m.size=L.size,n.nestedProperty(u[0],y+".size").set(L.size)),A("start",_,L),A("end",_,L)}d=t["_"+s+"pos0"],delete t["_"+s+"pos0"];var z=t._input[y]||{},D=n.extendFlat({},_),O=_.start,R=o.r2l(z.start),F=void 0!==R;if((_.startFound||F)&&R!==o.r2l(O)){var B=F?R:n.aggNums(Math.min,null,d),j={type:"category"===o.type||"multicategory"===o.type?"linear":o.type,r2l:o.r2l,dtick:_.size,tick0:O,calendar:f,range:[B,a.tickIncrement(B,_.size,!1,f)].map(o.l2r)},N=a.tickFirst(j);N>o.r2l(B)&&(N=a.tickIncrement(N,_.size,!0,f)),D.start=o.l2r(N),F||n.nestedProperty(t,y+".start").set(D.start)}var U=_.end,V=o.r2l(z.end),q=void 0!==V;if((_.endFound||q)&&V!==o.r2l(U)){var H=q?V:n.aggNums(Math.max,null,d);D.end=o.l2r(H),q||n.nestedProperty(t,y+".start").set(D.end)}var G="autobin"+s;return!1===t._input[G]&&(t._input[y]=n.extendFlat({},t[y]||{}),delete t._input[G],delete t[G]),[D,d]}t.exports={calc:function(e,t){var i,d,m,g,y=[],v=[],x="h"===t.orientation,_=a.getFromId(e,x?t.yaxis:t.xaxis),b=x?"y":"x",w={x:"y",y:"x"}[b],T=t[b+"calendar"],k=t.cumulative,A=p(e,t,_,b),M=A[0],S=A[1],E="string"==typeof M.size,C=[],I=E?C:M,L=[],P=[],z=[],D=0,O=t.histnorm,R=t.histfunc,F=-1!==O.indexOf("density");k.enabled&&F&&(O=O.replace(/ ?density$/,""),F=!1);var B,j="max"===R||"min"===R?null:0,N=c.count,U=u[O],V=!1,q=function(e){return _.r2c(e,0,T)};for(n.isArrayOrTypedArray(t[w])&&"count"!==R&&(B=t[w],V="avg"===R,N=c[R]),i=q(M.start),m=q(M.end)+(i-a.tickIncrement(i,M.size,!1,T))/1e6;i<m&&y.length<1e6&&(d=a.tickIncrement(i,M.size,!1,T),y.push((i+d)/2),v.push(j),z.push([]),C.push(i),F&&L.push(1/(d-i)),V&&P.push(0),!(d<=i));)i=d;C.push(i),!E&&"date"===_.type&&(I={start:q(I.start),end:q(I.end),size:I.size}),e._fullLayout._roundFnOpts||(e._fullLayout._roundFnOpts={});var H=t["_"+b+"bingroup"],G={leftGap:1/0,rightGap:1/0};H&&(e._fullLayout._roundFnOpts[H]||(e._fullLayout._roundFnOpts[H]=G),G=e._fullLayout._roundFnOpts[H]);var W,Z=v.length,Y=!0,X=G.leftGap,$=G.rightGap,K={};for(i=0;i<S.length;i++){var J=S[i];(g=n.findBin(J,I))>=0&&g<Z&&(D+=N(g,i,v,B,P),Y&&z[g].length&&J!==S[z[g][0]]&&(Y=!1),z[g].push(i),K[i]=g,X=Math.min(X,J-C[g]),$=Math.min($,C[g+1]-J))}G.leftGap=X,G.rightGap=$,Y||(W=function(t,r){return function(){var n=e._fullLayout._roundFnOpts[H];return f(n.leftGap,n.rightGap,C,_,T)(t,r)}}),V&&(D=h(v,P)),U&&U(v,D,L),k.enabled&&function(e,t,r){var n,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("half"===r)if("increasing"===t)for(o(0),n=1;n<e.length;n++)s(n);else for(o(e.length-1),n=e.length-2;n>=0;n--)s(n);else if("increasing"===t){for(n=1;n<e.length;n++)e[n]+=e[n-1];"exclude"===r&&(e.unshift(0),e.pop())}else{for(n=e.length-2;n>=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(v,k.direction,k.currentbin);var Q=Math.min(y.length,v.length),ee=[],te=0,re=Q-1;for(i=0;i<Q;i++)if(v[i]){te=i;break}for(i=Q-1;i>=te;i--)if(v[i]){re=i;break}for(i=te;i<=re;i++)if(r(y[i])&&r(v[i])){var ne={p:y[i],s:v[i],b:0};k.enabled||(ne.pts=z[i],Y?ne.ph0=ne.ph1=z[i].length?S[z[i][0]]:y[i]:(t._computePh=!0,ne.ph0=W(C[i]),ne.ph1=W(C[i+1],!0))),ee.push(ne)}return 1===ee.length&&(ee[0].width1=a.tickIncrement(ee[0].p,M.size,!1,T)-ee[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"}),l(ee,t),n.isArrayOrTypedArray(t.selectedpoints)&&n.tagSelected(ee,t,K),ee},calcAllAutoBins:p}}}),Po=m({"src/traces/histogram2d/calc.js"(e,t){var r=ct(),n=ar(),i=So(),a=Eo(),o=Co(),s=Io(),l=Lo().calcAllAutoBins;function c(e,t,r,n){var i,a=new Array(e);if(n)for(i=0;i<e;i++)a[i]=1/(t[i+1]-t[i]);else{var o=1/r;for(i=0;i<e;i++)a[i]=o}return a}function u(e,t){return{start:e(t.start),end:e(t.end),size:t.size}}function h(e,t,r,n,i,a){var o,l=e.length-1,c=new Array(l),u=s(r,n,e,i,a);for(o=0;o<l;o++){var h=(t||[])[o];c[o]=void 0===h?[u(e[o]),u(e[o+1],!0)]:[h,h]}return c}t.exports=function(e,t){var s,f,p,d,m=n.getFromId(e,t.xaxis),g=n.getFromId(e,t.yaxis),y=t.xcalendar,v=t.ycalendar,x=function(e){return m.r2c(e,0,y)},_=function(e){return g.r2c(e,0,v)},b=l(e,t,m,"x"),w=b[0],T=b[1],k=l(e,t,g,"y"),A=k[0],M=k[1],S=t._length;T.length>S&&T.splice(S,T.length-S),M.length>S&&M.splice(S,M.length-S);var E=[],C=[],I=[],L="string"==typeof w.size,P="string"==typeof A.size,z=[],D=[],O=L?z:w,R=P?D:A,F=0,B=[],j=[],N=t.histnorm,U=t.histfunc,V=-1!==N.indexOf("density"),q="max"===U||"min"===U?null:0,H=i.count,G=a[N],W=!1,Z=[],Y=[],X="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";X&&"count"!==U&&(W="avg"===U,H=i[U]);var $=w.size,K=x(w.start),J=x(w.end)+(K-n.tickIncrement(K,$,!1,y))/1e6;for(s=K;s<J;s=n.tickIncrement(s,$,!1,y))C.push(q),z.push(s),W&&I.push(0);z.push(s);var Q,ee=C.length,te=(s-K)/ee,re=(Q=K+te/2,m.c2r(Q,0,y)),ne=A.size,ie=_(A.start),ae=_(A.end)+(ie-n.tickIncrement(ie,ne,!1,v))/1e6;for(s=ie;s<ae;s=n.tickIncrement(s,ne,!1,v)){E.push(C.slice()),D.push(s);var oe=new Array(ee);for(f=0;f<ee;f++)oe[f]=[];j.push(oe),W&&B.push(I.slice())}D.push(s);var se=E.length,le=(s-ie)/se,ce=function(e){return g.c2r(e,0,v)}(ie+le/2);V&&(Z=c(C.length,O,te,L),Y=c(E.length,R,le,P)),!L&&"date"===m.type&&(O=u(x,O)),!P&&"date"===g.type&&(R=u(_,R));var ue=!0,he=!0,fe=new Array(ee),pe=new Array(se),de=1/0,me=1/0,ge=1/0,ye=1/0;for(s=0;s<S;s++){var ve=T[s],xe=M[s];p=r.findBin(ve,O),d=r.findBin(xe,R),p>=0&&p<ee&&d>=0&&d<se&&(F+=H(p,s,E[d],X,B[d]),j[d][p].push(s),ue&&(void 0===fe[p]?fe[p]=ve:fe[p]!==ve&&(ue=!1)),he&&(void 0===pe[d]?pe[d]=xe:pe[d]!==xe&&(he=!1)),de=Math.min(de,ve-z[p]),me=Math.min(me,z[p+1]-ve),ge=Math.min(ge,xe-D[d]),ye=Math.min(ye,D[d+1]-xe))}if(W)for(d=0;d<se;d++)F+=o(E[d],B[d]);if(G)for(d=0;d<se;d++)G(E[d],F,Z,Y[d]);return{x:T,xRanges:h(z,ue&&fe,de,me,m,y),x0:re,dx:te,y:M,yRanges:h(D,he&&pe,ge,ye,g,v),y0:ce,dy:le,z:E,pts:j}}}}),zo=m({"src/traces/heatmap/convert_column_xyz.js"(e,t){var r=ct(),n=S().BADNUM,i=ni();t.exports=function(e,t,a,o,s,l){var c=e._length,u=t.makeCalcdata(e,o),h=a.makeCalcdata(e,s);u=i(e,t,o,u).vals,h=i(e,a,s,h).vals;var f,p,d,m,g=e.text,y=void 0!==g&&r.isArray1D(g),v=e.hovertext,x=void 0!==v&&r.isArray1D(v),_=r.distinctVals(u),b=_.vals,w=r.distinctVals(h),T=w.vals,k=[],A=T.length,M=b.length;for(f=0;f<l.length;f++)k[f]=r.init2dArray(A,M);y&&(d=r.init2dArray(A,M)),x&&(m=r.init2dArray(A,M));var S=r.init2dArray(A,M);for(f=0;f<c;f++)if(u[f]!==n&&h[f]!==n){var E=r.findBin(u[f]+_.minDiff/2,b),C=r.findBin(h[f]+w.minDiff/2,T);for(p=0;p<l.length;p++){var I=e[l[p]];k[p][C][E]=I[f],S[C][E]=f}y&&(d[C][E]=g[f]),x&&(m[C][E]=v[f])}for(e["_"+o]=b,e["_"+s]=T,p=0;p<l.length;p++)e["_"+l[p]]=k[p];y&&(e._text=d),x&&(e._hovertext=m),t&&"category"===t.type&&(e["_"+o+"CategoryMap"]=b.map((function(e){return t._categories[e]}))),a&&"category"===a.type&&(e["_"+s+"CategoryMap"]=T.map((function(e){return a._categories[e]}))),e._after2before=S}}}),Do=m({"src/traces/heatmap/clean_2d_array.js"(e,t){var r=M(),n=ct(),i=S().BADNUM;t.exports=function(e,t,a,o){var s,l,c,u,h,f;function p(e){if(r(e))return+e}if(t&&t.transpose){for(s=0,h=0;h<e.length;h++)s=Math.max(s,e[h].length);if(0===s)return!1;c=function(e){return e.length},u=function(e,t,r){return(e[r]||[])[t]}}else s=e.length,c=function(e,t){return e[t].length},u=function(e,t,r){return(e[t]||[])[r]};function d(e){if(t&&"carpet"!==t.type&&"contourcarpet"!==t.type&&e&&"category"===e.type&&t["_"+e._id.charAt(0)].length){var r=e._id.charAt(0),a={},o=t["_"+r+"CategoryMap"]||t[r];for(h=0;h<o.length;h++)a[o[h]]=h;return function(t){var r=a[e._categories[t]];return r+1?r:i}}return n.identity}var m=d(a),g=d(o);o&&"category"===o.type&&(s=o._categories.length);var y,v,x,_=new Array(s);for(h=0;h<s;h++)for(l=a&&"category"===a.type?a._categories.length:c(e,h),_[h]=new Array(l),f=0;f<l;f++)_[h][f]=p((y=e,v=g(h),x=m(f),v===i||x===i?i:u(y,v,x)));return _}}}),Oo=m({"src/traces/heatmap/interp2d.js"(e,t){var r=ct(),n=[[-1,0],[1,0],[0,-1],[0,1]];function i(e,t,r){var i,a,o,s,l,c,u,h,f,p,d,m,g,y=0;for(s=0;s<t.length;s++){for(a=(i=t[s])[0],o=i[1],d=e[a][o],p=0,f=0,l=0;l<4;l++)(u=e[a+(c=n[l])[0]])&&void 0!==(h=u[o+c[1]])&&(0===p?m=g=h:(m=Math.min(m,h),g=Math.max(g,h)),f++,p+=h);if(0===f)throw"iterateInterp2d order is wrong: no defined neighbors";e[a][o]=p/f,void 0===d?f<4&&(y=1):(e[a][o]=(1+r)*e[a][o]-r*d,g>m&&(y=Math.max(y,Math.abs(e[a][o]-d)/(g-m))))}return y}t.exports=function(e,t){var n,a,o=1;for(i(e,t),n=0;n<t.length&&!(t[n][2]<4);n++);for(t=t.slice(n),n=0;n<100&&o>.01;n++)o=i(e,t,(a=o,.5-.25*Math.min(1,.5*a)));return o>.01&&r.log("interp2d didn't converge quickly",o),e}}}),Ro=m({"src/traces/heatmap/find_empties.js"(e,t){var r=ct().maxRowLength;t.exports=function(e){var t,n,i,a,o,s,l,c,u=[],h={},f=[],p=e[0],d=[],m=[0,0,0],g=r(e);for(n=0;n<e.length;n++)for(t=d,d=p,p=e[n+1]||[],i=0;i<g;i++)void 0===d[i]&&((s=(void 0!==d[i-1]?1:0)+(void 0!==d[i+1]?1:0)+(void 0!==t[i]?1:0)+(void 0!==p[i]?1:0))?(0===n&&s++,0===i&&s++,n===e.length-1&&s++,i===d.length-1&&s++,s<4&&(h[[n,i]]=[n,i,s]),u.push([n,i,s])):f.push([n,i]));for(;f.length;){for(l={},c=!1,o=f.length-1;o>=0;o--)(s=((h[[(n=(a=f[o])[0])-1,i=a[1]]]||m)[2]+(h[[n+1,i]]||m)[2]+(h[[n,i-1]]||m)[2]+(h[[n,i+1]]||m)[2])/20)&&(l[a]=[n,i,s],f.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],u.push(l[a])}return u.sort((function(e,t){return t[2]-e[2]}))}}}),Fo=m({"src/traces/heatmap/make_bound_array.js"(e,t){var r=He(),n=ct().isArrayOrTypedArray;t.exports=function(e,t,i,a,o,s){var l,c,u,h=[],f=r.traceIs(e,"contour"),p=r.traceIs(e,"histogram");if(n(t)&&t.length>1&&!p&&"category"!==s.type){var d=t.length;if(!(d<=o))return f?t.slice(0,o):t.slice(0,o+1);if(f)h=Array.from(t).slice(0,o);else if(1===o)h="log"===s.type?[.5*t[0],2*t[0]]:[t[0]-.5,t[0]+.5];else if("log"===s.type){for(h=[Math.pow(t[0],1.5)/Math.pow(t[1],.5)],u=1;u<d;u++)h.push(Math.sqrt(t[u-1]*t[u]));h.push(Math.pow(t[d-1],1.5)/Math.pow(t[d-2],.5))}else{for(h=[1.5*t[0]-.5*t[1]],u=1;u<d;u++)h.push(.5*(t[u-1]+t[u]));h.push(1.5*t[d-1]-.5*t[d-2])}if(d<o){var m,g=h[h.length-1];if("log"===s.type)for(m=g/h[h.length-2],u=d;u<o;u++)g*=m,h.push(g);else for(m=g-h[h.length-2],u=d;u<o;u++)g+=m,h.push(g)}}else{var y=e[s._id.charAt(0)+"calendar"];for(l=p?s.r2c(i,0,y):n(t)&&1===t.length?t[0]:void 0===i?0:("log"===s.type?s.d2c:s.r2c)(i,0,y),c=a||1,u=f?0:-.5;u<o;u++)h.push(l+c*u)}return h}}}),Bo=m({"src/traces/heatmap/calc.js"(e,t){var r=He(),n=ct(),i=ar(),a=ni(),o=Po(),s=Zt(),l=zo(),c=Do(),u=Oo(),h=Ro(),f=Fo(),p=S().BADNUM;function d(e){for(var t=[],r=e.length,n=0;n<r;n++){var i=e[n];i!==p&&t.push(i)}return t}t.exports=function(e,t){var m,g,y,v,x,_,b,w,T,k,A,M=i.getFromId(e,t.xaxis||"x"),S=i.getFromId(e,t.yaxis||"y"),E=r.traceIs(t,"contour"),C=r.traceIs(t,"histogram"),I=E?"best":t.zsmooth;if(M._minDtick=0,S._minDtick=0,C)v=(A=o(e,t)).orig_x,m=A.x,g=A.x0,y=A.dx,w=A.orig_y,x=A.y,_=A.y0,b=A.dy,T=A.z;else{var L=t.z;n.isArray1D(L)?(l(t,M,S,"x","y",["z"]),m=t._x,x=t._y,L=t._z):(v=t.x?M.makeCalcdata(t,"x"):[],w=t.y?S.makeCalcdata(t,"y"):[],m=a(t,M,"x",v).vals,x=a(t,S,"y",w).vals,t._x=m,t._y=x),g=t.x0,y=t.dx,_=t.y0,b=t.dy,T=c(L,t,M,S)}function P(e){I=t._input.zsmooth=t.zsmooth=!1,n.warn('cannot use zsmooth: "fast": '+e)}function z(e){if(e.length>1){var t=(e[e.length-1]-e[0])/(e.length-1),r=Math.abs(t/100);for(k=0;k<e.length-1;k++)if(Math.abs(e[k+1]-e[k]-t)>r)return!1}return!0}(M.rangebreaks||S.rangebreaks)&&(T=function(e,t,r){for(var n=[],i=-1,a=0;a<r.length;a++)if(t[a]!==p){n[++i]=[];for(var o=0;o<r[a].length;o++)e[o]!==p&&n[i].push(r[a][o])}return n}(m,x,T),C||(m=d(m),x=d(x),t._x=m,t._y=x)),!C&&(E||t.connectgaps)&&(t._emptypoints=h(T),u(T,t._emptypoints)),t._islinear=!1,"log"===M.type||"log"===S.type?"fast"===I&&P("log axis found"):z(m)?z(x)?t._islinear=!0:"fast"===I&&P("y scale is not linear"):"fast"===I&&P("x scale is not linear");var D=n.maxRowLength(T),O="scaled"===t.xtype?"":m,R=f(t,O,g,y,D,M),F="scaled"===t.ytype?"":x,B=f(t,F,_,b,T.length,S);t._extremes[M._id]=i.findExtremes(M,R),t._extremes[S._id]=i.findExtremes(S,B);var j={x:R,y:B,z:T,text:t._text||t.text,hovertext:t._hovertext||t.hovertext};if(t.xperiodalignment&&v&&(j.orig_x=v),t.yperiodalignment&&w&&(j.orig_y=w),O&&O.length===R.length-1&&(j.xCenter=O),F&&F.length===B.length-1&&(j.yCenter=F),C&&(j.xRanges=A.xRanges,j.yRanges=A.yRanges,j.pts=A.pts),E||s(e,t,{vals:T,cLetter:"z"}),E&&t.contours&&"heatmap"===t.contours.coloring){var N={type:"contour"===t.type?"heatmap":"histogram2d",xcalendar:t.xcalendar,ycalendar:t.ycalendar};j.xfill=f(N,O,g,y,D,M),j.yfill=f(N,F,_,b,T.length,S)}return[j]}}}),jo=m({"src/constants/pixelated_image.js"(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("")}}),No=m({"src/lib/supports_pixelated_image.js"(e,t){var r=jo(),n=er(),i=ct(),a=null;t.exports=function(){if(null!==a)return a;a=!1;var e=i.isSafari()||i.isMacWKWebView()||i.isIOS();if(window.navigator.userAgent&&!e){var t=Array.from(r.CSS_DECLARATIONS).reverse(),o=window.CSS&&window.CSS.supports||window.supportsCSS;if("function"==typeof o)a=t.some((function(e){return o.apply(null,e)}));else{var s=n.tester.append("image").attr("style",r.STYLE),l=window.getComputedStyle(s.node()).imageRendering;a=t.some((function(e){var t=e[1];return l===t||l===t.toLowerCase()})),s.remove()}}return a}}}),Uo=m({"src/traces/heatmap/plot.js"(e,t){var r=b(),n=F(),i=He(),a=er(),o=ar(),s=ct(),l=Et(),c=gi(),u=W(),h=Yt().extractOpts,f=Yt().makeColorScaleFuncFromTrace,p=Mt(),d=St().LINE_SPACING,m=No(),g=jo().STYLE,y="heatmap-label";function v(e){return e.selectAll("g."+y)}function x(e){v(e).remove()}function _(e,t){var r=t.length-2,n=s.constrain(s.findBin(e,t),0,r),i=t[n],a=t[n+1],o=s.constrain(n+(e-i)/(a-i)-.5,0,r),l=Math.round(o),c=Math.abs(o-l);return o&&o!==r&&c?{bin0:l,frac:c,bin1:Math.round(l+c/(o-l))}:{bin0:l,bin1:l,frac:0}}function w(e,t){var r=t.length-1,n=s.constrain(s.findBin(e,t),0,r),i=t[n],a=(e-i)/(t[n+1]-i)||0;return a<=0?{bin0:n,bin1:n,frac:0}:a<.5?{bin0:n,bin1:n+1,frac:a}:{bin0:n+1,bin1:n,frac:1-a}}function T(e,t,r){e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=Math.round(255*r[3])}t.exports=function(e,t,b,k){var A=t.xaxis,M=t.yaxis;s.makeTraceGroups(k,b,"hm").each((function(t){var b,k,S,E,C,I,L,P,z=r.select(this),D=t[0],O=D.trace,R=O.xgap||0,F=O.ygap||0,B=D.z,j=D.x,N=D.y,U=D.xCenter,V=D.yCenter,q=i.traceIs(O,"contour"),H=q?"best":O.zsmooth,G=B.length,W=s.maxRowLength(B),Z=!1,Y=!1;for(I=0;void 0===b&&I<j.length-1;)b=A.c2p(j[I]),I++;for(I=j.length-1;void 0===k&&I>0;)k=A.c2p(j[I]),I--;for(k<b&&(S=k,k=b,b=S,Z=!0),I=0;void 0===E&&I<N.length-1;)E=M.c2p(N[I]),I++;for(I=N.length-1;void 0===C&&I>0;)C=M.c2p(N[I]),I--;C<E&&(S=E,E=C,C=S,Y=!0),q&&(U=j,V=N,j=D.xfill,N=D.yfill);var X="default";if(H?X="best"===H?"smooth":"fast":O._islinear&&0===R&&0===F&&m()&&(X="fast"),"fast"!==X){var $="best"===H?0:.5;b=Math.max(-$*A._length,b),k=Math.min((1+$)*A._length,k),E=Math.max(-$*M._length,E),C=Math.min((1+$)*M._length,C)}var K,J,Q=Math.round(k-b),ee=Math.round(C-E);if(b>=A._length||k<=0||E>=M._length||C<=0)return z.selectAll("image").data([]).exit().remove(),void x(z);"fast"===X?(K=W,J=G):(K=Q,J=ee);var te=document.createElement("canvas");te.width=K,te.height=J;var re,ne,ie=te.getContext("2d",{willReadFrequently:!0}),ae=f(O,{noNumericCheck:!0,returnArray:!0});"fast"===X?(re=Z?function(e){return W-1-e}:s.identity,ne=Y?function(e){return G-1-e}:s.identity):(re=function(e){return s.constrain(Math.round(A.c2p(j[e])-b),0,Q)},ne=function(e){return s.constrain(Math.round(M.c2p(N[e])-E),0,ee)});var oe,se,le,ce,ue=ne(0),he=[ue,ue],fe=Z?0:1,pe=Y?0:1,de=0,me=0,ge=0,ye=0;function ve(e,t){if(void 0!==e){var r=ae(e);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),de+=t,me+=r[0]*t,ge+=r[1]*t,ye+=r[2]*t,r}return[0,0,0,0]}function xe(e,t,r,n){var i=e[r.bin0];if(void 0===i)return ve(void 0,1);var a,o=e[r.bin1],s=t[r.bin0],l=t[r.bin1],c=o-i||0,u=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,ve(i+r.frac*c+n.frac*(u+r.frac*a))}if("default"!==X){var _e,be=0;try{_e=new Uint8Array(K*J*4)}catch{_e=new Array(K*J*4)}if("smooth"===X){var we,Te,ke,Ae=U||j,Me=V||N,Se=new Array(Ae.length),Ee=new Array(Me.length),Ce=new Array(Q),Ie=U?w:_,Le=V?w:_;for(I=0;I<Ae.length;I++)Se[I]=Math.round(A.c2p(Ae[I])-b);for(I=0;I<Me.length;I++)Ee[I]=Math.round(M.c2p(Me[I])-E);for(I=0;I<Q;I++)Ce[I]=Ie(I,Se);for(L=0;L<ee;L++)for(Te=B[(we=Le(L,Ee)).bin0],ke=B[we.bin1],I=0;I<Q;I++,be+=4)T(_e,be,ce=xe(Te,ke,Ce[I],we))}else for(L=0;L<G;L++)for(le=B[L],he=ne(L),I=0;I<W;I++)ce=ve(le[I],1),T(_e,be=4*(he*W+re(I)),ce);var Pe=ie.createImageData(K,J);try{Pe.data.set(_e)}catch{var ze=Pe.data,De=ze.length;for(L=0;L<De;L++)ze[L]=_e[L]}ie.putImageData(Pe,0,0)}else{var Oe=Math.floor(R/2),Re=Math.floor(F/2);for(L=0;L<G;L++)if(le=B[L],he.reverse(),he[pe]=ne(L+1),he[0]!==he[1]&&void 0!==he[0]&&void 0!==he[1])for(oe=[se=re(0),se],I=0;I<W;I++)oe.reverse(),oe[fe]=re(I+1),oe[0]!==oe[1]&&void 0!==oe[0]&&void 0!==oe[1]&&(ce=ve(le[I],(oe[1]-oe[0])*(he[1]-he[0])),ie.fillStyle="rgba("+ce.join(",")+")",ie.fillRect(oe[0]+Oe,he[0]+Re,oe[1]-oe[0]-R,he[1]-he[0]-F))}me=Math.round(me/de),ge=Math.round(ge/de),ye=Math.round(ye/de);var Fe=n("rgb("+me+","+ge+","+ye+")");e._hmpixcount=(e._hmpixcount||0)+de,e._hmlumcount=(e._hmlumcount||0)+de*Fe.getLuminance();var Be=z.selectAll("image").data(t);Be.enter().append("svg:image").attr({xmlns:p.svg,preserveAspectRatio:"none"}),Be.attr({height:ee,width:Q,x:b,y:E,"xlink:href":te.toDataURL("image/png")}),"fast"===X&&!H&&Be.attr("style",g),x(z);var je=O.texttemplate;if(je){var Ne=h(O),Ue={type:"linear",range:[Ne.min,Ne.max],_separators:A._separators,_numFormat:A._numFormat},Ve="histogram2dcontour"===O.type,qe="contour"===O.type,He=qe?G-1:G,Ge=qe?1:0,We=qe?W-1:W,Ze=[];for(I=qe?1:0;I<He;I++){var Ye;if(qe)Ye=D.y[I];else if(Ve){if(0===I||I===G-1)continue;Ye=D.y[I]}else if(D.yCenter)Ye=D.yCenter[I];else{if(I+1===G&&void 0===D.y[I+1])continue;Ye=(D.y[I]+D.y[I+1])/2}var Xe=Math.round(M.c2p(Ye));if(!(0>Xe||Xe>M._length))for(L=Ge;L<We;L++){var $e;if(qe)$e=D.x[L];else if(Ve){if(0===L||L===W-1)continue;$e=D.x[L]}else if(D.xCenter)$e=D.xCenter[L];else{if(L+1===W&&void 0===D.x[L+1])continue;$e=(D.x[L]+D.x[L+1])/2}var Ke=Math.round(A.c2p($e));if(!(0>Ke||Ke>A._length)){var Je=c({x:$e,y:Ye},O,e._fullLayout);Je.x=$e,Je.y=Ye;var Qe=D.z[I][L];void 0===Qe?(Je.z="",Je.zLabel=""):(Je.z=Qe,Je.zLabel=o.tickText(Ue,Qe,"hover").text);var et=D.text&&D.text[I]&&D.text[I][L];(void 0===et||!1===et)&&(et=""),Je.text=et;var tt=s.texttemplateString({data:[Je,O._meta],fallback:O.texttemplatefallback,labels:Je,locale:e._fullLayout._d3locale,template:je});if(tt){var rt=tt.split("<br>"),nt=rt.length,it=0;for(P=0;P<nt;P++)it=Math.max(it,rt[P].length);Ze.push({l:nt,c:it,t:tt,x:Ke,y:Xe,z:Qe})}}}}var at=O.textfont,ot=at.size,st=e._fullLayout.font.size;if(!ot||"auto"===ot){var lt=1/0,ct=1/0,ut=0,ht=0;for(P=0;P<Ze.length;P++){var ft=Ze[P];if(ut=Math.max(ut,ft.l),ht=Math.max(ht,ft.c),P<Ze.length-1){var pt=Ze[P+1],dt=Math.abs(pt.x-ft.x),mt=Math.abs(pt.y-ft.y);dt&&(lt=Math.min(lt,dt)),mt&&(ct=Math.min(ct,mt))}}isFinite(lt)&&isFinite(ct)?(lt-=R,ct-=F,lt/=ht,ct/=ut,lt/=d/2,ct/=d,ot=Math.min(Math.floor(lt),Math.floor(ct),st)):ot=st}if(ot<=0||!isFinite(ot))return;v(z).data(Ze).enter().append("g").classed(y,1).append("text").attr("text-anchor","middle").each((function(t){var n=r.select(this),i=at.color;(!i||"auto"===i)&&(i=u.contrast(void 0===t.z?e._fullLayout.plot_bgcolor:"rgba("+ae(t.z).join()+")")),n.attr("data-notex",1).call(l.positionText,function(e){return e.x}(t),function(e){return e.y-ot*(e.l*d/2-1)}(t)).call(a.font,{family:at.family,size:ot,color:i,weight:at.weight,style:at.style,variant:at.variant,textcase:at.textcase,lineposition:at.lineposition,shadow:at.shadow}).text(t.t).call(l.convertToTspans,e)}))}}))}}}),Vo=m({"src/traces/heatmap/colorbar.js"(e,t){t.exports={min:"zmin",max:"zmax"}}}),qo=m({"src/traces/heatmap/style.js"(e,t){var r=b();t.exports=function(e){r.select(e).selectAll(".hm image").style("opacity",(function(e){return e.trace.opacity}))}}}),Ho=m({"src/traces/heatmap/hover.js"(e,t){var r=Or(),n=ct(),i=n.isArrayOrTypedArray,a=ar(),o=Yt().extractOpts;t.exports=function(e,t,s,l,c){c||(c={});var u,h,f,p,d=c.isContour,m=e.cd[0],g=m.trace,y=e.xa,v=e.ya,x=m.x,_=m.y,b=m.z,w=m.xCenter,T=m.yCenter,k=m.zmask,A=g.zhoverformat,M=x,S=_;if(!1!==e.index){try{f=Math.round(e.index[1]),p=Math.round(e.index[0])}catch{return void n.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index)}if(f<0||f>=b[0].length||p<0||p>b.length)return}else{if(r.inbox(t-x[0],t-x[x.length-1],0)>0||r.inbox(s-_[0],s-_[_.length-1],0)>0)return;if(d){var E;for(M=[2*x[0]-x[1]],E=1;E<x.length;E++)M.push((x[E]+x[E-1])/2);for(M.push([2*x[x.length-1]-x[x.length-2]]),S=[2*_[0]-_[1]],E=1;E<_.length;E++)S.push((_[E]+_[E-1])/2);S.push([2*_[_.length-1]-_[_.length-2]])}f=Math.max(0,Math.min(M.length-2,n.findBin(t,M))),p=Math.max(0,Math.min(S.length-2,n.findBin(s,S)))}var C,I,L=y.c2p(x[f]),P=y.c2p(x[f+1]),z=v.c2p(_[p]),D=v.c2p(_[p+1]);d?(C=m.orig_x||x,I=m.orig_y||_,P=L,u=C[f],D=z,h=I[p]):(C=m.orig_x||w||x,I=m.orig_y||T||_,u=w?C[f]:(C[f]+C[f+1])/2,h=T?I[p]:(I[p]+I[p+1])/2,y&&"category"===y.type&&(u=x[f]),v&&"category"===v.type&&(h=_[p]),g.zsmooth&&(L=P=y.c2p(u),z=D=v.c2p(h)));var O=b[p][f];if(k&&!k[p][f]&&(O=void 0),void 0!==O||g.hoverongaps){var R;i(m.hovertext)&&i(m.hovertext[p])?R=m.hovertext[p][f]:i(m.text)&&i(m.text[p])&&(R=m.text[p][f]);var F=o(g),B={type:"linear",range:[F.min,F.max],hoverformat:A,_separators:y._separators,_numFormat:y._numFormat},j=a.tickText(B,O,"hover").text;return[n.extendFlat(e,{index:g._after2before?g._after2before[p][f]:[p,f],distance:e.maxHoverDistance,spikeDistance:e.maxSpikeDistance,x0:L,x1:P,y0:z,y1:D,xLabelVal:u,yLabelVal:h,zLabelVal:O,zLabel:j,text:R})]}}}}),Go=m({"src/traces/heatmap/index.js"(e,t){t.exports={attributes:wo(),supplyDefaults:Mo(),calc:Bo(),plot:Uo(),colorbar:Vo(),style:qo(),hoverPoints:Ho(),moduleType:"trace",name:"heatmap",basePlotModule:Ci(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}}),Wo=m({"lib/heatmap.js"(e,t){t.exports=Go()}}),Zo=m({"src/traces/histogram/bin_attributes.js"(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=m({"src/traces/histogram/constants.js"(e,t){t.exports={eventDataKeys:["binNumber"]}}}),Xo=m({"src/traces/histogram/attributes.js"(e,t){var r=Wa(),n=It().axisHoverFormat,{hovertemplateAttrs:i,texttemplateAttrs:a,templatefallbackAttrs:o}=Fe(),s=j(),l=Zo(),c=Yo(),u=B().extendFlat;t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:n("x"),yhoverformat:n("y"),text:u({},r.text,{}),hovertext:u({},r.hovertext,{}),orientation:r.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:l("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:l("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:c.eventDataKeys}),hovertemplatefallback:o(),texttemplate:a({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),texttemplatefallback:o({editType:"plot"}),textposition:u({},r.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:r.insidetextanchor,textangle:r.textangle,cliponaxis:r.cliponaxis,constraintext:r.constraintext,marker:r.marker,offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,selected:r.selected,unselected:r.unselected,zorder:r.zorder}}}),$o=m({"src/traces/histogram/defaults.js"(e,t){var r=He(),n=ct(),i=W(),a=Xa().handleText,o=Ya(),s=Xo();t.exports=function(e,t,l,c){function u(r,i){return n.coerce(e,t,s,r,i)}var h=u("x"),f=u("y");u("cumulative.enabled")&&(u("cumulative.direction"),u("cumulative.currentbin")),u("text");var p=u("textposition");a(e,t,c,u,p,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),u("hovertext"),u("hovertemplate"),u("hovertemplatefallback"),u("xhoverformat"),u("yhoverformat");var d=u("orientation",f&&!h?"h":"v"),m="v"===d?"x":"y",g="v"===d?"y":"x",y=h&&f?Math.min(n.minRowLength(h)&&n.minRowLength(f)):n.minRowLength(t[m]||[]);if(y){t._length=y,r.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],c),t[g]&&u("histfunc"),u("histnorm"),u("autobin"+m),o(e,t,u,l,c),n.coerceSelectionMarkerOpacity(t,u);var v=(t.marker.line||{}).color,x=r.getComponentMethod("errorbars","supplyDefaults");x(e,t,v||i.defaultLine,{axis:"y"}),x(e,t,v||i.defaultLine,{axis:"x",inherit:"y"}),u("zorder")}else t.visible=!1}}}),Ko=m({"src/traces/histogram/cross_trace_defaults.js"(e,t){var r=ct(),n=_t(),i=He().traceIs,a=ei(),o=Xa().validateCornerradius,s=r.nestedProperty,l=nn().getAxisGroup,c=[{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 h,f,p,d,m,g,y,v=t._histogramBinOpts={},x=[],_={},b=[];function w(e,t){return r.coerce(h._input,h,h._module.attributes,e,t)}function T(e){return"v"===e.orientation?"x":"y"}function k(e,i,a){var o=e.uid+"__"+a;i||(i=o);var s=function(e,r){return n.getFromTrace({_fullLayout:t},e,r).type}(e,a),l=e[a+"calendar"]||"",c=v[i],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(a)):(i=o,s!==c.axType&&r.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&r.warn(["Attempted to group the bins of trace",e.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(v[i]={traces:[e],dirs:[a],axType:s,calendar:e[a+"calendar"]||""}),e["_"+a+"bingroup"]=i}for(m=0;m<e.length;m++)if(h=e[m],i(h,"histogram")){if(x.push(h),delete h._xautoBinFinished,delete h._yautoBinFinished,"histogram"===h.type){var A=w("marker.cornerradius",t.barcornerradius);h.marker&&(h.marker.cornerradius=o(A))}i(h,"2dMap")||a(h._input,h,t,w,t.barmode)}var M=t._alignmentOpts||{};for(m=0;m<x.length;m++){if(h=x[m],p="",!i(h,"2dMap")){if(d=T(h),"group"===t.barmode&&h.alignmentgroup){var S=h[d+"axis"],E=l(t,S)+h.orientation;(M[E]||{})[h.alignmentgroup]&&(p=E)}!p&&"overlay"!==t.barmode&&(p=l(t,h.xaxis)+l(t,h.yaxis)+T(h))}p?(_[p]||(_[p]=[]),_[p].push(h)):b.push(h)}for(p in _)if(1!==(f=_[p]).length){var C=!1;for(f.length&&(h=f[0],C=w("bingroup")),p=C||p,m=0;m<f.length;m++){var I=(h=f[m])._input.bingroup;I&&I!==p&&r.warn(["Trace",h.index,"must match","within bingroup",p+".","Ignoring its bingroup:",I,"setting."].join(" ")),h.bingroup=p,k(h,p,T(h))}}else b.push(f[0]);for(m=0;m<b.length;m++){h=b[m];var L=w("bingroup");if(i(h,"2dMap"))for(y=0;y<2;y++){var P=w((d=u[y])+"bingroup",L?L+"__"+d:null);k(h,P,d)}else k(h,L,T(h))}for(p in v){var z=v[p];for(f=z.traces,g=0;g<c.length;g++){var D,O,R=c[g],F=R.name;if("nbins"!==F||!z.sizeFound){for(m=0;m<f.length;m++){if(h=f[m],d=z.dirs[m],D=R.aStr[d],void 0!==s(h._input,D).get()){z[F]=w(D),z[F+"Found"]=!0;break}(O=(h._autoBin||{})[d]||{})[F]&&s(h,D).set(O[F])}if("start"===F||"end"===F)for(;m<f.length;m++)(h=f[m])["_"+d+"bingroup"]&&w(D,(O=(h._autoBin||{})[d]||{})[F]);"nbins"===F&&!z.sizeFound&&!z.nbinsFound&&(h=f[0],z[F]=w(D))}}}}}}),Jo=m({"src/traces/histogram/hover.js"(e,t){var r=no().hoverPoints,n=ar().hoverLabelText;t.exports=function(e,t,i,a,o){var s=r(e,t,i,a,o);if(s){var l=(e=s[0]).cd[e.index],c=e.cd[0].trace;if(!c.cumulative.enabled){var u="h"===c.orientation?"y":"x";e[u+"Label"]=n(e[u+"a"],[l.ph0,l.ph1],c[u+"hoverformat"])}return s}}}}),Qo=m({"src/traces/histogram/event_data.js"(e,t){t.exports=function(e,t,r,n,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),!(r.cumulative||{}).enabled){var a,o=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;if(e.pointNumbers=o,e.binNumber=e.pointNumber,delete e.pointNumber,delete e.pointIndex,r._indexToPoints){a=[];for(var s=0;s<o.length;s++)a=a.concat(r._indexToPoints[o[s]])}else a=o;e.pointIndices=a}return e}}}),es=m({"src/traces/histogram/index.js"(e,t){t.exports={attributes:Xo(),layoutAttributes:Za(),supplyDefaults:$o(),crossTraceDefaults:Ko(),supplyLayoutDefaults:$a(),calc:Lo().calc,crossTraceCalc:ui().crossTraceCalc,plot:ro().plot,layerName:"barlayer",style:to().style,styleOnSelect:to().styleOnSelect,colorbar:mi(),hoverPoints:Jo(),selectPoints:ao(),eventData:Qo(),moduleType:"trace",name:"histogram",basePlotModule:Ci(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}}),ts=m({"lib/histogram.js"(e,t){t.exports=es()}}),rs=m({"src/traces/histogram2d/attributes.js"(e,t){var r=Xo(),n=Zo(),i=wo(),a=q(),o=It().axisHoverFormat,{hovertemplateAttrs:s,texttemplateAttrs:l,templatefallbackAttrs:c}=Fe(),u=zt(),h=B().extendFlat;t.exports=h({x:r.x,y:r.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:r.histnorm,histfunc:r.histfunc,nbinsx:r.nbinsx,xbins:n("x"),nbinsy:r.nbinsy,ybins:n("y"),autobinx:r.autobinx,autobiny:r.autobiny,bingroup:h({},r.bingroup,{}),xbingroup:h({},r.bingroup,{}),ybingroup:h({},r.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:c(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["z"]}),texttemplatefallback:c({editType:"plot"}),textfont:i.textfont,showlegend:h({},a.showlegend,{dflt:!1})},u("",{cLetter:"z",autoColorDflt:!1}))}}),ns=m({"src/traces/histogram2d/sample_defaults.js"(e,t){var r=He(),n=ct();t.exports=function(e,t,i,a){var o=i("x"),s=i("y"),l=n.minRowLength(o),c=n.minRowLength(s);l&&c?(t._length=Math.min(l,c),r.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],a),(i("z")||i("marker.color"))&&i("histfunc"),i("histnorm"),i("autobinx"),i("autobiny")):t.visible=!1}}}),is=m({"src/traces/histogram2d/defaults.js"(e,t){var r=ct(),n=ns(),i=Ao(),a=Ht(),o=ko(),s=rs();t.exports=function(e,t,l,c){function u(n,i){return r.coerce(e,t,s,n,i)}n(e,t,u,c),!1!==t.visible&&(i(e,t,u,c),a(e,t,c,u,{prefix:"",cLetter:"z"}),u("hovertemplate"),u("hovertemplatefallback"),o(u,c),u("xhoverformat"),u("yhoverformat"))}}}),as=m({"src/traces/histogram2d/hover.js"(e,t){var r=Ho(),n=ar().hoverLabelText;t.exports=function(e,t,i,a,o){var s=r(e,t,i,a,o);if(s){var l=(e=s[0]).index,c=l[0],u=l[1],h=e.cd[0],f=h.trace,p=h.xRanges[u],d=h.yRanges[c];return e.xLabel=n(e.xa,[p[0],p[1]],f.xhoverformat),e.yLabel=n(e.ya,[d[0],d[1]],f.yhoverformat),s}}}}),os=m({"src/traces/histogram2d/index.js"(e,t){t.exports={attributes:rs(),supplyDefaults:is(),crossTraceDefaults:Ko(),calc:Bo(),plot:Uo(),layerName:"heatmaplayer",colorbar:Vo(),style:qo(),hoverPoints:as(),eventData:Qo(),moduleType:"trace",name:"histogram2d",basePlotModule:Ci(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}}),ss=m({"lib/histogram2d.js"(e,t){t.exports=os()}}),ls=m({"src/constants/filter_ops.js"(e,t){t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),cs=m({"src/traces/contour/attributes.js"(e,t){var r=wo(),n=kn(),i=It(),a=i.axisHoverFormat,o=i.descriptionOnlyNumbers,s=zt(),l=Oe().dash,c=j(),u=B().extendFlat,h=ls(),f=h.COMPARISON_OPS2,p=h.INTERVAL_OPS,d=n.line;t.exports=u({z:r.z,x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,text:r.text,hovertext:r.hovertext,transpose:r.transpose,xtype:r.xtype,ytype:r.ytype,xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,hovertemplatefallback:r.hovertemplatefallback,texttemplate:u({},r.texttemplate,{}),texttemplatefallback:r.texttemplatefallback,textfont:u({},r.textfont,{}),hoverongaps:r.hoverongaps,connectgaps:u({},r.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:c({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:o("contour label")},operation:{valType:"enumerated",values:[].concat(f).concat(p),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:u({},d.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:l,smoothing:u({},d.smoothing,{}),editType:"plot"},zorder:n.zorder},s("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),us=m({"src/traces/histogram2dcontour/attributes.js"(e,t){var r=rs(),n=cs(),i=zt(),a=It().axisHoverFormat,o=B().extendFlat;t.exports=o({x:r.x,y:r.y,z:r.z,marker:r.marker,histnorm:r.histnorm,histfunc:r.histfunc,nbinsx:r.nbinsx,xbins:r.xbins,nbinsy:r.nbinsy,ybins:r.ybins,autobinx:r.autobinx,autobiny:r.autobiny,bingroup:r.bingroup,xbingroup:r.xbingroup,ybingroup:r.ybingroup,autocontour:n.autocontour,ncontours:n.ncontours,contours:n.contours,line:{color:n.line.color,width:o({},n.line.width,{dflt:.5}),dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,hovertemplatefallback:r.hovertemplatefallback,texttemplate:n.texttemplate,texttemplatefallback:n.texttemplatefallback,textfont:n.textfont},i("",{cLetter:"z",editTypeOverride:"calc"}))}}),hs=m({"src/traces/contour/contours_defaults.js"(e,t){t.exports=function(e,t,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");((o?t.autocontour=!0:r("autocontour",!1))||!s)&&r("ncontours")}}}),fs=m({"src/traces/contour/label_defaults.js"(e,t){var r=ct();t.exports=function(e,t,n,i){if(i||(i={}),e("contours.showlabels")){var a=t.font;r.coerceFont(e,"contours.labelfont",a,{overrideDflt:{color:n}}),e("contours.labelformat")}!1!==i.hasHover&&e("zhoverformat")}}}),ps=m({"src/traces/contour/style_defaults.js"(e,t){var r=Ht(),n=fs();t.exports=function(e,t,i,a,o){var s,l=i("contours.coloring"),c="";"fill"===l&&(s=i("contours.showlines")),!1!==s&&("lines"!==l&&(c=i("line.color","#000")),i("line.width",.5),i("line.dash")),"none"!==l&&(!0!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,r(e,t,a,i,{prefix:"",cLetter:"z"})),i("line.smoothing"),n(i,a,c,o)}}}),ds=m({"src/traces/histogram2dcontour/defaults.js"(e,t){var r=ct(),n=ns(),i=hs(),a=ps(),o=ko(),s=us();t.exports=function(e,t,l,c){function u(n,i){return r.coerce(e,t,s,n,i)}n(e,t,u,c),!1!==t.visible&&(i(e,t,u,(function(n){return r.coerce2(e,t,s,n)})),a(e,t,u,c),u("xhoverformat"),u("yhoverformat"),u("hovertemplate"),u("hovertemplatefallback"),t.contours&&"heatmap"===t.contours.coloring&&o(u,c))}}}),ms=m({"src/traces/contour/set_contours.js"(e,t){var r=ar(),n=ct();function i(e,t,n){var i={type:"linear",range:[e,t]};return r.autoTicks(i,(t-e)/(n||15)),i}t.exports=function(e,t){var a=e.contours;if(e.autocontour){var o=e.zmin,s=e.zmax;(e.zauto||void 0===o)&&(o=n.aggNums(Math.min,null,t)),(e.zauto||void 0===s)&&(s=n.aggNums(Math.max,null,t));var l=i(o,s,e.ncontours);a.size=l.dtick,a.start=r.tickFirst(l),l.range.reverse(),a.end=r.tickFirst(l),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={}),n.extendFlat(e._input.contours,{start:a.start,end:a.end,size:a.size}),e._input.autocontour=!0}else if("constraint"!==a.type){var c,u=a.start,h=a.end,f=e._input.contours;u>h&&(a.start=f.start=h,h=a.end=f.end=u,u=a.start),a.size>0||(c=u===h?1:i(u,h,e.ncontours).dtick,f.size=a.size=c)}}}}),gs=m({"src/traces/contour/end_plus.js"(e,t){t.exports=function(e){return e.end+e.size/1e6}}}),ys=m({"src/traces/contour/calc.js"(e,t){var r=Yt(),n=Bo(),i=ms(),a=gs();t.exports=function(e,t){var o=n(e,t),s=o[0].z;i(t,s);var l,c=t.contours,u=r.extractOpts(t);if("heatmap"===c.coloring&&u.auto&&!1===t.autocontour){var h=c.start,f=a(c),p=c.size||1,d=Math.floor((f-h)/p)+1;isFinite(p)||(p=1,d=1);var m=h-p/2;l=[m,m+d*p]}else l=s;return r.calc(e,t,{vals:l,cLetter:"z"}),o}}}),vs=m({"src/traces/contour/constants.js"(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}}}}),xs=m({"src/traces/contour/make_crossings.js"(e,t){var r=vs();function n(e,t){var r=(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 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}t.exports=function(e){var t,i,a,o,s,l,c,u,h,f=e[0].z,p=f.length,d=f[0].length,m=2===p||2===d;for(i=0;i<p-1;i++)for(o=[],0===i&&(o=o.concat(r.BOTTOMSTART)),i===p-2&&(o=o.concat(r.TOPSTART)),t=0;t<d-1;t++)for(a=o.slice(),0===t&&(a=a.concat(r.LEFTSTART)),t===d-2&&(a=a.concat(r.RIGHTSTART)),s=t+","+i,l=[[f[i][t],f[i][t+1]],[f[i+1][t],f[i+1][t+1]]],h=0;h<e.length;h++)(c=n((u=e[h]).level,l))&&(u.crossings[s]=c,-1!==a.indexOf(c)&&(u.starts.push([t,i]),m&&-1!==a.indexOf(c,a.indexOf(c)+1)&&u.starts.push([t,i])))}}}),_s=m({"src/traces/contour/find_all_paths.js"(e,t){var r=ct(),n=vs();function i(e,t,r,n){return Math.abs(e[0]-t[0])<r&&Math.abs(e[1]-t[1])<n}function a(e,t){var r=e[2]-t[2],n=e[3]-t[3];return Math.sqrt(r*r+n*n)}function o(e,t,o,l,c){var u,h=t.join(","),f=e.crossings[h],p=function(e,t,r){var i=0,a=0;return e>20&&t?208===e||1114===e?i=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==n.BOTTOMSTART.indexOf(e)?a=1:-1!==n.LEFTSTART.indexOf(e)?i=1:-1!==n.TOPSTART.indexOf(e)?a=-1:i=-1,[i,a]}(f,o,t),d=[s(e,t,[-p[0],-p[1]])],m=e.z.length,g=e.z[0].length,y=t.slice(),v=p.slice();for(u=0;u<1e4;u++){if(f>20?(f=n.CHOOSESADDLE[f][(p[0]||p[1])<0?0:1],e.crossings[h]=n.SADDLEREMAINDER[f]):delete e.crossings[h],!(p=n.NEWDELTA[f])){r.log("Found bad marching index:",f,t,e.level);break}d.push(s(e,t,p)),t[0]+=p[0],t[1]+=p[1],h=t.join(","),i(d[d.length-1],d[d.length-2],l,c)&&d.pop();var x=p[0]&&(t[0]<0||t[0]>g-2)||p[1]&&(t[1]<0||t[1]>m-2);if(t[0]===y[0]&&t[1]===y[1]&&p[0]===v[0]&&p[1]===v[1]||o&&x)break;f=e.crossings[h]}1e4===u&&r.log("Infinite loop in contour?");var _,b,w,T,k,A,M,S,E,C,I,L=i(d[0],d[d.length-1],l,c),P=0,z=.2*e.smoothing,D=[],O=0;for(u=1;u<d.length;u++)P+=M=a(d[u],d[u-1]),D.push(M);var R=P/D.length*z;function F(e){return d[e%d.length]}for(u=d.length-2;u>=O;u--)if((_=D[u])<R){for(w=0,b=u-1;b>=O&&_+D[b]<R;b--)_+=D[b];if(L&&u===d.length-2)for(w=0;w<b&&_+D[w]<R;w++)_+=D[w];k=u-b+w+1,A=Math.floor((u+b+w+2)/2),T=L||u!==d.length-2?L||-1!==b?k%2?F(A):[(F(A)[0]+F(A+1)[0])/2,(F(A)[1]+F(A+1)[1])/2]:d[0]:d[d.length-1],d.splice(b+1,u-b+1,T),u=b+1,w&&(O=w),L&&(u===d.length-2?d[w]=d[d.length-1]:0===u&&(d[d.length-1]=d[0]))}for(d.splice(0,O),u=0;u<d.length;u++)d[u].length=2;if(!(d.length<2))if(L)d.pop(),e.paths.push(d);else{o||r.log("Unclosed interior contour?",e.level,y.join(","),d.join("L"));var B=!1;for(S=0;S<e.edgepaths.length;S++)if(C=e.edgepaths[S],!B&&i(C[0],d[d.length-1],l,c)){d.pop(),B=!0;var j=!1;for(E=0;E<e.edgepaths.length;E++)if(i((I=e.edgepaths[E])[I.length-1],d[0],l,c)){j=!0,d.shift(),e.edgepaths.splice(S,1),E===S?e.paths.push(d.concat(I)):(E>S&&E--,e.edgepaths[E]=I.concat(d,C));break}j||(e.edgepaths[S]=d.concat(C))}for(S=0;S<e.edgepaths.length&&!B;S++)i((C=e.edgepaths[S])[C.length-1],d[0],l,c)&&(d.shift(),e.edgepaths[S]=C.concat(d),B=!0);B||e.edgepaths.push(d)}}function s(e,t,r){var n=t[0]+Math.max(r[0],0),i=t[1]+Math.max(r[1],0),a=e.z[i][n],o=e.xaxis,s=e.yaxis;if(r[1]){var l=(e.level-a)/(e.z[i][n+1]-a),c=(1!==l?(1-l)*o.c2l(e.x[n]):0)+(0!==l?l*o.c2l(e.x[n+1]):0);return[o.c2p(o.l2c(c),!0),s.c2p(e.y[i],!0),n+l,i]}var u=(e.level-a)/(e.z[i+1][n]-a),h=(1!==u?(1-u)*s.c2l(e.y[i]):0)+(0!==u?u*s.c2l(e.y[i+1]):0);return[o.c2p(e.x[n],!0),s.c2p(s.l2c(h),!0),n,i+u]}t.exports=function(e,t,n){var i,a,s,l;for(t=t||.01,n=n||.01,a=0;a<e.length;a++){for(s=e[a],l=0;l<s.starts.length;l++)o(s,s.starts[l],"edge",t,n);for(i=0;Object.keys(s.crossings).length&&i<1e4;)i++,o(s,Object.keys(s.crossings)[0].split(",").map(Number),void 0,t,n);1e4===i&&r.log("Infinite loop in contour?")}}}}),bs=m({"src/traces/contour/constraint_mapping.js"(e,t){var r=ls(),n=M();function i(e,t){var i,a=Array.isArray(t);function o(e){return n(e)?+e:null}return-1!==r.COMPARISON_OPS2.indexOf(e)?i=o(a?t[0]:t):-1!==r.INTERVAL_OPS.indexOf(e)?i=a?[o(t[0]),o(t[1])]:[o(t),o(t)]:-1!==r.SET_OPS.indexOf(e)&&(i=a?t.map(o):[o(t)]),i}function a(e){return function(t){t=i(e,t);var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return{start:r,end:n,size:n-r}}}function o(e){return function(t){return{start:t=i(e,t),end:1/0,size:1/0}}}t.exports={"[]":a("[]"),"][":a("]["),">":o(">"),"<":o("<"),"=":o("=")}}}),ws=m({"src/traces/contour/empty_pathinfo.js"(e,t){var r=ct(),n=bs(),i=gs();t.exports=function(e,t,a){for(var o="constraint"===e.type?n[e._operation](e.value):e,s=o.size,l=[],c=i(o),u=a.trace._carpetTrace,h=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<c;f+=s)if(l.push(r.extendFlat({level:f,crossings:{},starts:[],edgepaths:[],paths:[],z:a.z,smoothing:a.trace.line.smoothing},h)),l.length>1e3){r.warn("Too many contours, clipping at 1000",e);break}return l}}}),Ts=m({"src/traces/contour/convert_to_constraints.js"(e,t){var r=ct();function n(e){return r.extendFlat({},e,{edgepaths:r.extendDeep([],e.edgepaths),paths:r.extendDeep([],e.paths),starts:r.extendDeep([],e.starts)})}t.exports=function(e,t){var i,a,o,s=function(e){return e.reverse()},l=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&r.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 c=s;s=l,l=c;case"[]":for(2!==e.length&&r.warn("Contour data invalid for the specified inequality range operation."),a=n(e[0]),o=n(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(l(o.edgepaths.shift()));for(;o.paths.length;)a.paths.push(l(o.paths.shift()));for(;o.starts.length;)a.starts.push(l(o.starts.shift()));return[a]}}}}),ks=m({"src/traces/contour/close_boundaries.js"(e,t){t.exports=function(e,t){var r,n=e[0],i=n.z;switch(t.type){case"levels":var a=Math.min(i[0][0],i[0][1]);for(r=0;r<e.length;r++){var o=e[r];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,l=n.y.length,c=-1/0,u=1/0;for(r=0;r<l;r++)u=Math.min(u,i[r][0]),u=Math.min(u,i[r][s-1]),c=Math.max(c,i[r][0]),c=Math.max(c,i[r][s-1]);for(r=1;r<s-1;r++)u=Math.min(u,i[0][r]),u=Math.min(u,i[l-1][r]),c=Math.max(c,i[0][r]),c=Math.max(c,i[l-1][r]);var h,f,p=t.value;switch(t._operation){case">":p>c&&(n.prefixBoundary=!0);break;case"<":(p<u||n.starts.length&&p===u)&&(n.prefixBoundary=!0);break;case"[]":h=Math.min(p[0],p[1]),((f=Math.max(p[0],p[1]))<u||h>c||n.starts.length&&f===u)&&(n.prefixBoundary=!0);break;case"][":h=Math.min(p[0],p[1]),f=Math.max(p[0],p[1]),h<u&&f>c&&(n.prefixBoundary=!0)}}}}}),As=m({"src/traces/contour/plot.js"(e){var t=b(),r=ct(),n=er(),i=Yt(),a=Et(),o=ar(),s=rr(),l=Uo(),c=xs(),u=_s(),h=ws(),f=Ts(),p=ks(),d=vs(),m=d.LABELOPTIMIZER;function g(e,t){var i,a,o,s,l,c,u,h="",f=0,p=e.edgepaths.map((function(e,t){return t})),d=!0;function m(e){return Math.abs(e[1]-t[2][1])<.01}function g(e){return Math.abs(e[0]-t[0][0])<.01}function y(e){return Math.abs(e[0]-t[2][0])<.01}for(;p.length;){for(c=n.smoothopen(e.edgepaths[f],e.smoothing),h+=d?c:c.replace(/^M/,"L"),p.splice(p.indexOf(f),1),i=e.edgepaths[f][e.edgepaths[f].length-1],s=-1,o=0;o<4;o++){if(!i){r.log("Missing end?",f,e);break}for(u=i,Math.abs(u[1]-t[0][1])<.01&&!y(i)?a=t[1]:g(i)?a=t[0]:m(i)?a=t[3]:y(i)&&(a=t[2]),l=0;l<e.edgepaths.length;l++){var v=e.edgepaths[l][0];Math.abs(i[0]-a[0])<.01?Math.abs(i[0]-v[0])<.01&&(v[1]-i[1])*(a[1]-v[1])>=0&&(a=v,s=l):Math.abs(i[1]-a[1])<.01?Math.abs(i[1]-v[1])<.01&&(v[0]-i[0])*(a[0]-v[0])>=0&&(a=v,s=l):r.log("endpt to newendpt is not vert. or horz.",i,a,v)}if(i=a,s>=0)break;h+="L"+a}if(s===e.edgepaths.length){r.log("unclosed perimeter path");break}f=s,(d=-1===p.indexOf(f))&&(f=p[0],h+="Z")}for(f=0;f<e.paths.length;f++)h+=n.smoothclosed(e.paths[f],e.smoothing);return h}function y(e,t,n,i){var a=t.width/2,o=t.height/2,s=e.x,l=e.y,c=e.theta,u=Math.cos(c)*a,h=Math.sin(c)*a,f=(s>i.center?i.right-s:s-i.left)/(u+Math.abs(Math.sin(c)*o)),p=(l>i.middle?i.bottom-l:l-i.top)/(Math.abs(h)+Math.cos(c)*o);if(f<1||p<1)return 1/0;var d=m.EDGECOST*(1/(f-1)+1/(p-1));d+=m.ANGLECOST*c*c;for(var g=s-u,y=l-h,v=s+u,x=l+h,_=0;_<n.length;_++){var b=n[_],w=Math.cos(b.theta)*b.width/2,T=Math.sin(b.theta)*b.width/2,k=2*r.segmentDistance(g,y,v,x,b.x-w,b.y-T,b.x+w,b.y+T)/(t.height+b.height),A=b.level===t.level,M=A?m.SAMELEVELDISTANCE:1;if(k<=M)return 1/0;d+=m.NEIGHBORCOST*(A?m.SAMELEVELFACTOR:1)/(k-M)}return d}function v(e){var t,r,n=e.trace._emptypoints,i=[],a=e.z.length,o=e.z[0].length,s=[];for(t=0;t<o;t++)s.push(1);for(t=0;t<a;t++)i.push(s.slice());for(t=0;t<n.length;t++)i[(r=n[t])[0]][r[1]]=0;return e.zmask=i,i}e.plot=function(i,a,o,s){var m=a.xaxis,y=a.yaxis;r.makeTraceGroups(s,o,"contour").each((function(o){var s=t.select(this),x=o[0],_=x.trace,b=x.x,w=x.y,T=_.contours,k=h(T,a,x),A=r.ensureSingle(s,"g","heatmapcoloring"),M=[];"heatmap"===T.coloring&&(M=[o]),l(i,a,M,A),c(k),u(k);var S=m.c2p(b[0],!0),E=m.c2p(b[b.length-1],!0),C=y.c2p(w[0],!0),I=y.c2p(w[w.length-1],!0),L=[[S,I],[E,I],[E,C],[S,C]],P=k;"constraint"===T.type&&(P=f(k,T._operation)),function(e,t,n){var i=r.ensureSingle(e,"g","contourbg").selectAll("path").data("fill"===n.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+t.join("L")+"Z").style("stroke","none")}(s,L,T),function(e,n,i,a){var o="fill"===a.coloring||"constraint"===a.type&&"="!==a._operation,s="M"+i.join("L")+"Z";o&&p(n,a);var l=r.ensureSingle(e,"g","contourfill").selectAll("path").data(o?n:[]);l.enter().append("path"),l.exit().remove(),l.each((function(e){var r=(e.prefixBoundary?s:"")+g(e,i);r?t.select(this).attr("d",r).style("stroke","none"):t.select(this).remove()}))}(s,P,L,T),function(i,a,o,s,l){var c=o._context.staticPlot,u=r.ensureSingle(i,"g","contourlines"),h=!1!==l.showlines,f=l.showlabels,p=h&&f,m=e.createLines(u,h||f,a,c),g=e.createLineClip(u,p,o,s.trace.uid),y=i.selectAll("g.contourlabels").data(f?[0]:[]);if(y.exit().remove(),y.enter().append("g").classed("contourlabels",!0),f){var v=[],x=[];r.clearLocationCache();var _=e.labelFormatter(o,s),b=n.tester.append("text").attr("data-notex",1).call(n.font,l.labelfont),w=a[0].xaxis,T=a[0].yaxis,k=w._length,A=T._length,M=w.range,S=T.range,E=r.aggNums(Math.min,null,s.x),C=r.aggNums(Math.max,null,s.x),I=r.aggNums(Math.min,null,s.y),L=r.aggNums(Math.max,null,s.y),P=Math.max(w.c2p(E,!0),0),z=Math.min(w.c2p(C,!0),k),D=Math.max(T.c2p(L,!0),0),O=Math.min(T.c2p(I,!0),A),R={};M[0]<M[1]?(R.left=P,R.right=z):(R.left=z,R.right=P),S[0]<S[1]?(R.top=D,R.bottom=O):(R.top=O,R.bottom=D),R.middle=(R.top+R.bottom)/2,R.center=(R.left+R.right)/2,v.push([[R.left,R.top],[R.right,R.top],[R.right,R.bottom],[R.left,R.bottom]]);var F=Math.sqrt(k*k+A*A),B=d.LABELDISTANCE*F/Math.max(1,a.length/d.LABELINCREASE);m.each((function(n){var i=e.calcTextOpts(n.level,_,b,o);t.select(this).selectAll("path").each((function(){var t=r.getVisibleSegment(this,R,i.height/2);if(t&&!(t.len<(i.width+i.height)*d.LABELMIN))for(var n=Math.min(Math.ceil(t.len/B),d.LABELMAX),a=0;a<n;a++){var o=e.findBestTextLocation(this,t,i,x,R);if(!o)break;e.addLabelData(o,i,x,v)}}))})),b.remove(),e.drawLabels(y,x,o,g,p?v:null)}f&&!h&&m.remove()}(s,k,i,x,T),function(e,t,i,a,o){var s=a.trace,l=i._fullLayout._clips,h="clip"+s.uid,f=l.selectAll("#"+h).data(s.connectgaps?[]:[0]);if(f.enter().append("clipPath").classed("contourclip",!0).attr("id",h),f.exit().remove(),!1===s.connectgaps){var d={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:t.xaxis,yaxis:t.yaxis,x:a.x,y:a.y,z:v(a),smoothing:0};c([d]),u([d]),p([d],{type:"levels"}),r.ensureSingle(f,"path","").attr("d",(d.prefixBoundary?"M"+o.join("L")+"Z":"")+g(d,o))}else h=null;n.setClipUrl(e,h,i)}(s,a,i,x,L)}))},e.createLines=function(e,t,r,i){var a=r[0].smoothing,o=e.selectAll("g.contourlevel").data(t?r:[]);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 n.smoothopen(e,a)})).style("stroke-miterlimit",1).style("vector-effect",i?"none":"non-scaling-stroke");var l=o.selectAll("path.closedline").data((function(e){return e.ppaths||e.paths}));l.exit().remove(),l.enter().append("path").classed("closedline",!0),l.attr("d",(function(e){return n.smoothclosed(e,a)})).style("stroke-miterlimit",1).style("vector-effect",i?"none":"non-scaling-stroke")}return o},e.createLineClip=function(e,t,r,i){var a=t?"clipline"+i:null,o=r._fullLayout._clips.selectAll("#"+a).data(t?[0]:[]);return o.exit().remove(),o.enter().append("clipPath").classed("contourlineclip",!0).attr("id",a),n.setClipUrl(e,a,r),o},e.labelFormatter=function(e,t){var n=e._fullLayout,a=t.trace,l=a.contours,c={type:"linear",_id:"ycontour",showexponent:"all",exponentformat:"B"};if(l.labelformat)c.tickformat=l.labelformat,s(c,n);else{var u=i.extractOpts(a);if(u&&u.colorbar&&u.colorbar._axis)c=u.colorbar._axis;else{if("constraint"===l.type){var h=l.value;r.isArrayOrTypedArray(h)?c.range=[h[0],h[h.length-1]]:c.range=[h,h]}else c.range=[l.start,l.end],c.nticks=(l.end-l.start)/l.size;c.range[0]===c.range[1]&&(c.range[1]+=c.range[0]||1),c.nticks||(c.nticks=1e3),s(c,n),o.prepTicks(c),c._tmin=null,c._tmax=null}}return function(e){return o.tickText(c,e).text}},e.calcTextOpts=function(e,t,r,i){var o=t(e);r.text(o).call(a.convertToTspans,i);var s=r.node(),l=n.bBox(s,!0);return{text:o,width:l.width,height:l.height,fontSize:+s.style["font-size"].replace("px",""),level:e,dy:(l.top+l.bottom)/2}},e.findBestTextLocation=function(e,t,n,i,a){var o,s,l,c,u,h=n.width;t.isClosed?(s=t.len/m.INITIALSEARCHPOINTS,o=t.min+s/2,l=t.max):(s=(t.len-h)/(m.INITIALSEARCHPOINTS+1),o=t.min+s+h/2,l=t.max-(s+h)/2);for(var f=1/0,p=0;p<m.ITERATIONS;p++){for(var d=o;d<l;d+=s){var g=r.getTextLocation(e,t.total,d,h),v=y(g,n,i,a);v<f&&(f=v,u=g,c=d)}if(f>2*m.MAXCOST)break;p&&(s/=2),l=(o=c-s/2)+1.5*s}if(f<=m.MAXCOST)return u},e.addLabelData=function(e,t,r,n){var i=t.fontSize,a=t.width+i/3,o=Math.max(0,t.height-i/3),s=e.x,l=e.y,c=e.theta,u=Math.sin(c),h=Math.cos(c),f=function(e,t){return[s+e*h-t*u,l+e*u+t*h]},p=[f(-a/2,-o/2),f(-a/2,o/2),f(a/2,o/2),f(a/2,-o/2)];r.push({text:t.text,x:s,y:l,dy:t.dy,theta:c,level:t.level,width:a,height:o}),n.push(p)},e.drawLabels=function(e,n,i,o,s){var l=e.selectAll("text").data(n,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var r=e.x+Math.sin(e.theta)*e.dy,n=e.y-Math.cos(e.theta)*e.dy;t.select(this).text(e.text).attr({x:r,y:n,transform:"rotate("+180*e.theta/Math.PI+" "+r+" "+n+")"}).call(a.convertToTspans,i)})),s){for(var c="",u=0;u<s.length;u++)c+="M"+s[u].join("L")+"Z";r.ensureSingle(o,"path","").attr("d",c)}}}}),Ms=m({"src/traces/contour/make_color_map.js"(e,t){var r=b(),n=Yt(),i=gs();t.exports=function(e){var t=e.contours,a=t.start,o=i(t),s=t.size||1,l=Math.floor((o-a)/s)+1,c="lines"===t.coloring?0:1,u=n.extractOpts(e);isFinite(s)||(s=1,l=1);var h,f,p=u.reversescale?n.flipScale(u.colorscale):u.colorscale,d=p.length,m=new Array(d),g=new Array(d),y=u.min,v=u.max;if("heatmap"===t.coloring){for(f=0;f<d;f++)h=p[f],m[f]=h[0]*(v-y)+y,g[f]=h[1];var x=r.extent([y,v,t.start,t.start+s*(l-1)]),_=x[y<v?0:1],b=x[y<v?1:0];_!==y&&(m.splice(0,0,_),g.splice(0,0,g[0])),b!==v&&(m.push(b),g.push(g[g.length-1]))}else{var w=e._input&&"number"==typeof e._input.zmin&&"number"==typeof e._input.zmax;for(w&&(a<=y||o>=v)&&(a<=y&&(a=y),o>=v&&(o=v),l=Math.floor((o-a)/s)+1,c=0),f=0;f<d;f++)h=p[f],m[f]=(h[0]*(l+c-1)-c/2)*s+a,g[f]=h[1];(w||e.autocontour)&&(m[0]>y&&(m.unshift(y),g.unshift(g[0])),m[m.length-1]<v&&(m.push(v),g.push(g[g.length-1])))}return n.makeColorScaleFunc({domain:m,range:g},{noNumericCheck:!0})}}}),Ss=m({"src/traces/contour/style.js"(e,t){var r=b(),n=er(),i=qo(),a=Ms();t.exports=function(e){var t=r.select(e).selectAll("g.contour");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(e){var t=r.select(this),i=e[0].trace,o=i.contours,s=i.line,l=o.size||1,c=o.start,u="constraint"===o.type,h=!u&&"lines"===o.coloring,f=!u&&"fill"===o.coloring,p=h||f?a(i):null;t.selectAll("g.contourlevel").each((function(e){r.select(this).selectAll("path").call(n.lineGroupStyle,s.width,h?p(e.level):s.color,s.dash)}));var d=o.labelfont;if(t.selectAll("g.contourlabels text").each((function(e){n.font(r.select(this),{weight:d.weight,style:d.style,variant:d.variant,textcase:d.textcase,lineposition:d.lineposition,shadow:d.shadow,family:d.family,size:d.size,color:d.color||(h?p(e.level):s.color)})})),u)t.selectAll("g.contourfill path").style("fill",i.fillcolor);else if(f){var m;t.selectAll("g.contourfill path").style("fill",(function(e){return void 0===m&&(m=e.level),p(e.level+.5*l)})),void 0===m&&(m=c),t.selectAll("g.contourbg path").style("fill",p(m-.5*l))}})),i(e)}}}),Es=m({"src/traces/contour/colorbar.js"(e,t){var r=Yt(),n=Ms(),i=gs();t.exports={min:"zmin",max:"zmax",calc:function(e,t,a){var o=t.contours,s=t.line,l=o.size||1,c=o.coloring,u=n(t,{isColorbar:!0});if("heatmap"===c){var h=r.extractOpts(t);a._fillgradient=h.reversescale?r.flipScale(h.colorscale):h.colorscale,a._zrange=[h.min,h.max]}else"fill"===c&&(a._fillcolor=u);a._line={color:"lines"===c?u:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},a._levels={start:o.start,end:i(o),size:l}}}}}),Cs=m({"src/traces/contour/hover.js"(e,t){var r=W(),n=Ho();t.exports=function(e,t,i,a,o){o||(o={}),o.isContour=!0;var s=n(e,t,i,a,o);return s&&s.forEach((function(e){var t=e.trace;"constraint"===t.contours.type&&(t.fillcolor&&r.opacity(t.fillcolor)?e.color=r.addOpacity(t.fillcolor,1):t.contours.showlines&&r.opacity(t.line.color)&&(e.color=r.addOpacity(t.line.color,1)))})),s}}}),Is=m({"src/traces/histogram2dcontour/index.js"(e,t){t.exports={attributes:us(),supplyDefaults:ds(),crossTraceDefaults:Ko(),calc:ys(),plot:As().plot,layerName:"contourlayer",style:Ss(),colorbar:Es(),hoverPoints:Cs(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Ci(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}}),Ls=m({"lib/histogram2dcontour.js"(e,t){t.exports=Is()}}),Ps=m({"src/traces/contour/constraint_defaults.js"(e,t){var r=M(),n=fs(),i=W(),a=i.addOpacity,o=i.opacity,s=ls(),l=ct().isArrayOrTypedArray,c=s.CONSTRAINT_REDUCTION,u=s.COMPARISON_OPS2;t.exports=function(e,t,i,s,h,f){var p,d,m,g=t.contours,y=i("contours.operation");g._operation=c[y],function(e,t){var n;-1===u.indexOf(t.operation)?(e("contours.value",[0,1]),l(t.value)?t.value.length>2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(n=parseFloat(t.value[0]),t.value=[n,n+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:r(t.value)&&(n=parseFloat(t.value),t.value=[n,n+1])):(e("contours.value",0),r(t.value)||(l(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(i,g),"="===y?p=g.showlines=!0:(p=i("contours.showlines"),m=i("fillcolor",a((e.line||{}).color||h,.5))),p&&(d=i("line.color",m&&o(m)?a(t.fillcolor,1):h),i("line.width",2),i("line.dash")),i("line.smoothing"),n(i,s,d,f)}}}),zs=m({"src/traces/contour/defaults.js"(e,t){var r=ct(),n=To(),i=Wn(),a=Ps(),o=hs(),s=ps(),l=ko(),c=cs();t.exports=function(e,t,u,h){function f(n,i){return r.coerce(e,t,c,n,i)}if(n(e,t,f,h)){i(e,t,h,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hoverongaps"),f("hovertemplate"),f("hovertemplatefallback");var p="constraint"===f("contours.type");f("connectgaps",r.isArray1D(t.z)),p?a(e,t,f,h,u):(o(e,t,f,(function(n){return r.coerce2(e,t,c,n)})),s(e,t,f,h)),t.contours&&"heatmap"===t.contours.coloring&&l(f,h),f("zorder")}else t.visible=!1}}}),Ds=m({"src/traces/contour/index.js"(e,t){t.exports={attributes:cs(),supplyDefaults:zs(),calc:ys(),plot:As().plot,style:Ss(),colorbar:Es(),hoverPoints:Cs(),moduleType:"trace",name:"contour",basePlotModule:Ci(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),Os=m({"lib/contour.js"(e,t){t.exports=Ds()}}),Rs=m({"src/traces/scatterternary/attributes.js"(e,t){var{hovertemplateAttrs:r,texttemplateAttrs:n,templatefallbackAttrs:i}=Fe(),a=Tn(),o=kn(),s=q(),l=zt(),c=Oe().dash,u=B().extendFlat,h=o.marker,f=o.line,p=h.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:n({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:i({editType:"plot"}),hovertext:u({},o.hovertext,{}),line:{color:f.color,width:f.width,dash:c,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:h.symbol,opacity:h.opacity,angle:h.angle,angleref:h.angleref,standoff:h.standoff,maxdisplayed:h.maxdisplayed,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,line:u({width:p.width,dash:p.dash,editType:"calc"},l("marker.line")),gradient:h.gradient,editType:"calc"},l("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:r(),hovertemplatefallback:i()}}}),Fs=m({"src/traces/scatterternary/defaults.js"(e,t){var r=ct(),n=wn(),i=Xt(),a=Yn(),o=Xn(),s=$n(),l=Kn(),c=Jn(),u=Rs();t.exports=function(e,t,h,f){function p(n,i){return r.coerce(e,t,u,n,i)}var d,m=p("a"),g=p("b"),y=p("c");if(m?(d=m.length,g?(d=Math.min(d,g.length),y&&(d=Math.min(d,y.length))):d=y?Math.min(d,y.length):0):g&&y&&(d=Math.min(g.length,y.length)),d){t._length=d,p("sum"),p("text"),p("hovertext"),"fills"!==t.hoveron&&(p("hovertemplate"),p("hovertemplatefallback")),p("mode",d<n.PTS_LINESONLY?"lines+markers":"lines"),i.hasMarkers(t)&&a(e,t,h,f,p,{gradient:!0}),i.hasLines(t)&&(o(e,t,h,f,p,{backoff:!0}),s(e,t,p),p("connectgaps")),i.hasText(t)&&(p("texttemplate"),p("texttemplatefallback"),l(e,t,f,p));var v=[];(i.hasMarkers(t)||i.hasText(t))&&(p("cliponaxis"),p("marker.maxdisplayed"),v.push("points")),p("fill"),"none"!==t.fill&&(c(e,t,h,p),i.hasLines(t)||s(e,t,p)),("tonext"===t.fill||"toself"===t.fill)&&v.push("fills"),p("hoveron",v.join("+")||"points"),r.coerceSelectionMarkerOpacity(t,p)}else t.visible=!1}}}),Bs=m({"src/traces/scatterternary/format_labels.js"(e,t){var r=ar();t.exports=function(e,t,n){var i={},a=n[t.subplot]._subplot;return i.aLabel=r.tickText(a.aaxis,e.a,!0).text,i.bLabel=r.tickText(a.baxis,e.b,!0).text,i.cLabel=r.tickText(a.caxis,e.c,!0).text,i}}}),js=m({"src/traces/scatterternary/calc.js"(e,t){var r=M(),n=ii(),i=ai(),a=oi(),o=si().calcMarkerSize,s=["a","b","c"],l={a:["b","c"],b:["a","c"],c:["a","b"]};t.exports=function(e,t){var c,u,h,f,p,d,m=e._fullLayout[t.subplot].sum,g=t.sum||m,y={a:t.a,b:t.b,c:t.c},v=t.ids;for(c=0;c<s.length;c++)if(!y[h=s[c]]){for(p=y[l[h][0]],d=y[l[h][1]],f=new Array(p.length),u=0;u<p.length;u++)f[u]=g-p[u]-d[u];y[h]=f}var x,_,b,w,T,k,A=t._length,M=new Array(A);for(c=0;c<A;c++)x=y.a[c],_=y.b[c],b=y.c[c],r(x)&&r(_)&&r(b)?(1!=(w=m/((x=+x)+(_=+_)+(b=+b)))&&(x*=w,_*=w,b*=w),k=x,T=b-_,M[c]={x:T,y:k,a:x,b:_,c:b},v&&(M[c].id=v[c])):M[c]={x:!1,y:!1};return o(t,A),n(e,t),i(M,t),a(M,t),M}}}),Ns=m({"src/traces/scatterternary/plot.js"(e,t){var r=di();t.exports=function(e,t,n){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},l=t.layers.frontplot.select("g.scatterlayer"),c=0;c<n.length;c++){var u=n[c];u.length&&(u[0].trace._xA=a,u[0].trace._yA=o)}r(e,s,n,l)}}}),Us=m({"src/traces/scatterternary/hover.js"(e,t){var r=xi();t.exports=function(e,t,n,i){var a=r(e,t,n,i);if(a&&!1!==a[0].index){var o=a[0];if(void 0===o.index){var s=1-o.y0/e.ya._length,l=e.xa._length,c=l*s/2,u=l-c;return o.x0=Math.max(Math.min(o.x0,u),c),o.x1=Math.max(Math.min(o.x1,u),c),a}var h=o.cd[o.index],f=o.trace,p=o.subplot;o.a=h.a,o.b=h.b,o.c=h.c,o.xLabelVal=void 0,o.yLabelVal=void 0;var d={};d[f.subplot]={_subplot:p};var m=f._module.formatLabels(h,f,d);o.aLabel=m.aLabel,o.bLabel=m.bLabel,o.cLabel=m.cLabel;var g=h.hi||f.hoverinfo,y=[];if(!f.hovertemplate){var v=g.split("+");-1!==v.indexOf("all")&&(v=["a","b","c"]),-1!==v.indexOf("a")&&x(p.aaxis,o.aLabel),-1!==v.indexOf("b")&&x(p.baxis,o.bLabel),-1!==v.indexOf("c")&&x(p.caxis,o.cLabel)}return o.extraText=y.join("<br>"),o.hovertemplate=f.hovertemplate,a}function x(e,t){y.push(e._hovertitle+": "+t)}}}}),Vs=m({"src/traces/scatterternary/event_data.js"(e,t){t.exports=function(e,t,r,n,i){if(t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),n[i]){var a=n[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}}}),qs=m({"src/plots/ternary/ternary.js"(e,t){var r=b(),n=F(),i=He(),a=ct(),o=a.strTranslate,s=a._,l=W(),c=er(),u=rr(),h=B().extendFlat,f=At(),p=ar(),d=pr(),m=Or(),g=Rr(),y=g.freeMode,v=g.rectMode,x=tr(),_=Cn().prepSelect,w=Cn().selectOnClick,T=Cn().clearOutline,k=Cn().clearSelectionsCache,A=xt();function M(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=M;var S=M.prototype;S.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},S.plot=function(e,t){var r=this,n=t[r.id],i=t._size;r._hasClipOnAxisFalse=!1;for(var a=0;a<e.length;a++)if(!1===e[a][0].trace.cliponaxis){r._hasClipOnAxisFalse=!0;break}r.updateLayers(n),r.adjustLayout(n,i),f.generalUpdatePerTraceModule(r.graphDiv,r,e,n),r.layers.plotbg.select("path").call(l.fill,n.bgcolor)},S.makeFramework=function(e){var t=this,r=t.graphDiv,n=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(n),c.setClipUrl(t.layers.backplot,i,r),c.setClipUrl(t.layers.grids,i,r)},S.updateFx=function(e){e._ternarylayer.selectAll("g.toplevel").style("cursor","pan"===e.dragmode?"move":"crosshair")},S.updateLayers=function(e){var t=this.layers,n=["draglayer","plotbg","backplot","grids"];"below traces"===e.aaxis.layer&&n.push("aaxis","aline"),"below traces"===e.baxis.layer&&n.push("baxis","bline"),"below traces"===e.caxis.layer&&n.push("caxis","cline"),n.push("frontplot"),"above traces"===e.aaxis.layer&&n.push("aaxis","aline"),"above traces"===e.baxis.layer&&n.push("baxis","bline"),"above traces"===e.caxis.layer&&n.push("caxis","cline");var i=this.plotContainer.selectAll("g.toplevel").data(n,String),a=["agrid","bgrid","cgrid"];i.enter().append("g").attr("class",(function(e){return"toplevel "+e})).each((function(e){var n=r.select(this);t[e]=n,"frontplot"===e?n.append("g").classed("scatterlayer",!0):"backplot"===e?n.append("g").classed("maplayer",!0):"plotbg"===e?n.append("path").attr("d","M0,0Z"):"aline"===e||"bline"===e||"cline"===e?n.append("path"):"grids"===e&&a.forEach((function(e){t[e]=n.append("g").classed("grid "+e,!0)}))})),i.order()};var E=Math.sqrt(4/3);S.adjustLayout=function(e,t){var r,n,i,a,s,f,p=this,d=e.domain,m=(d.x[0]+d.x[1])/2,g=(d.y[0]+d.y[1])/2,y=d.x[1]-d.x[0],v=d.y[1]-d.y[0],x=y*t.w,_=v*t.h,b=e.sum,w=e.aaxis.min,T=e.baxis.min,k=e.caxis.min;x>E*_?i=(a=_)*E:a=(i=x)/E,s=y*i/x,f=v*a/_,r=t.l+t.w*m-i/2,n=t.t+t.h*(1-g)-a/2,p.x0=r,p.y0=n,p.w=i,p.h=a,p.sum=b,p.xaxis={type:"linear",range:[w+2*k-b,b-w-2*T],domain:[m-s/2,m+s/2],_id:"x"},u(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(e){return e.a>=p.aaxis.range[0]&&e.a<=p.aaxis.range[1]&&e.b>=p.baxis.range[1]&&e.b<=p.baxis.range[0]&&e.c>=p.caxis.range[1]&&e.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,b-T-k],domain:[g-f/2,g+f/2],_id:"y"},u(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var A=p.yaxis.domain[0],M=p.aaxis=h({},e.aaxis,{range:[w,b-T-k],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[A,A+f*E],anchor:"free",position:0,_id:"y",_length:i});u(M,p.graphDiv._fullLayout),M.setScale();var S=p.baxis=h({},e.baxis,{range:[b-w-k,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});u(S,p.graphDiv._fullLayout),S.setScale();var C=p.caxis=h({},e.caxis,{range:[b-w-T,k],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[A,A+f*E],anchor:"free",position:0,_id:"y",_length:i});u(C,p.graphDiv._fullLayout),C.setScale();var I="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDef.select("path").attr("d",I),p.layers.plotbg.select("path").attr("d",I);var L="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDefRelative.select("path").attr("d",L);var P=o(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",P),p.clipDefRelative.select("path").attr("transform",null);var z=o(r-S._offset,n+a);p.layers.baxis.attr("transform",z),p.layers.bgrid.attr("transform",z);var D=o(r+i/2,n)+"rotate(30)"+o(0,-M._offset);p.layers.aaxis.attr("transform",D),p.layers.agrid.attr("transform",D);var O=o(r+i/2,n)+"rotate(-30)"+o(0,-C._offset);p.layers.caxis.attr("transform",O),p.layers.cgrid.attr("transform",O),p.drawAxes(!0),p.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(l.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(l.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",C.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(l.stroke,C.linecolor||"#000").style("stroke-width",(C.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),c.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},S.drawAxes=function(e){var t=this,r=t.graphDiv,n=t.id.slice(7)+"title",i=t.layers,a=t.aaxis,o=t.baxis,l=t.caxis;if(t.drawAx(a),t.drawAx(o),t.drawAx(l),e){var c=Math.max(a.showticklabels?a.tickfont.size/2:0,(l.showticklabels?.75*l.tickfont.size:0)+("outside"===l.ticks?.87*l.ticklen:0)),u=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;i["a-title"]=x.draw(r,"a"+n,{propContainer:a,propName:t.id+".aaxis.title.text",placeholder:s(r,"Click to enter Component A title"),attributes:{x:t.x0+t.w/2,y:t.y0-a.title.font.size/3-c,"text-anchor":"middle"}}),i["b-title"]=x.draw(r,"b"+n,{propContainer:o,propName:t.id+".baxis.title.text",placeholder:s(r,"Click to enter Component B title"),attributes:{x:t.x0-u,y:t.y0+t.h+.83*o.title.font.size+u,"text-anchor":"middle"}}),i["c-title"]=x.draw(r,"c"+n,{propContainer:l,propName:t.id+".caxis.title.text",placeholder:s(r,"Click to enter Component C title"),attributes:{x:t.x0+t.w+u,y:t.y0+t.h+.83*l.title.font.size+u,"text-anchor":"middle"}})}},S.drawAx=function(e){var t=this,r=t.graphDiv,n=e._name,i=n.charAt(0),o=e._id,s=t.layers[n],l=i+"tickLayout",c=function(e){return e.ticks+String(e.ticklen)+String(e.showticklabels)}(e);t[l]!==c&&(s.selectAll("."+o+"tick").remove(),t[l]=c),e.setScale();var u=p.calcTicks(e),h=p.clipEnds(e,u),f=p.makeTransTickFn(e),d=p.getTickSigns(e)[2],m=a.deg2rad(30),g=d*(e.linewidth||1)/2,y=d*e.ticklen,v=t.w,x=t.h,_="b"===i?"M0,"+g+"l"+Math.sin(m)*y+","+Math.cos(m)*y:"M"+g+",0l"+Math.cos(m)*y+","+-Math.sin(m)*y,b={a:"M0,0l"+x+",-"+v/2,b:"M0,0l-"+v/2+",-"+x,c:"M0,0l-"+x+","+v/2}[i];p.drawTicks(r,e,{vals:"inside"===e.ticks?h:u,layer:s,path:_,transFn:f,crisp:!1}),p.drawGrid(r,e,{vals:h,layer:t.layers[i+"grid"],path:b,transFn:f,crisp:!1}),p.drawLabels(r,e,{vals:u,layer:s,transFn:f,labelFns:p.makeLabelFns(e,0,30)})};var C=A.MINZOOM/2+.87,I="m-0.87,.5h"+C+"v3h-"+(C+5.2)+"l"+(C/2+2.6)+",-"+(.87*C+4.5)+"l2.6,1.5l-"+C/2+","+.87*C+"Z",L="m0.87,.5h-"+C+"v3h"+(C+5.2)+"l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-2.6,1.5l"+C/2+","+.87*C+"Z",P="m0,1l"+C/2+","+.87*C+"l2.6,-1.5l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-"+(C/2+2.6)+","+(.87*C+4.5)+"l2.6,1.5l"+C/2+",-"+.87*C+"Z",z=!0;function D(e){r.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearOutline=function(){k(this.dragOptions),T(this.dragOptions.gd)},S.initInteractions=function(){var e,t,r,u,h,f,p,g,x,b,T,k,M=this,S=M.layers.plotbg.select("path").node(),C=M.graphDiv,O=C._fullLayout._zoomlayer;function R(e){var t={};return t[M.id+".aaxis.min"]=e.a,t[M.id+".baxis.min"]=e.b,t[M.id+".caxis.min"]=e.c,t}function F(e,t){var r=C._fullLayout.clickmode;D(C),2===e&&(C.emit("plotly_doubleclick",null),i.call("_guiRelayout",C,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&w(t,C,[M.xaxis],[M.yaxis],M.id,M.dragOptions),r.indexOf("event")>-1&&m.click(C,t,M.id)}function B(e,t){return 1-t/M.h}function j(e,t){return 1-(e+(M.h-t)/Math.sqrt(3))/M.w}function N(e,t){return(e-(M.h-t)/Math.sqrt(3))/M.w}function U(n,i){var a=r+n*e,o=u+i*t,s=Math.max(0,Math.min(1,B(0,u),B(0,o))),l=Math.max(0,Math.min(1,j(r,u),j(a,o))),c=Math.max(0,Math.min(1,N(r,u),N(a,o))),d=(s/2+c)*M.w,m=(1-s/2-l)*M.w,y=(d+m)/2,v=m-d,_=(1-s)*M.h,w=_-v/E;v<A.MINZOOM?(p=h,T.attr("d",x),k.attr("d","M0,0Z")):(p={a:h.a+s*f,b:h.b+l*f,c:h.c+c*f},T.attr("d",x+"M"+d+","+_+"H"+m+"L"+y+","+w+"L"+d+","+_+"Z"),k.attr("d","M"+r+","+u+"m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2ZM"+d+","+_+I+"M"+m+","+_+L+"M"+y+","+w+P)),b||(T.transition().style("fill",g>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),b=!0),C.emit("plotly_relayouting",R(p))}function V(){D(C),p!==h&&(i.call("_guiRelayout",C,R(p)),z&&C.data&&C._context.showTips&&(a.notifier(s(C,"Double-click to zoom back out"),"long",C),z=!1))}function q(e,t){var r=e/M.xaxis._m,n=t/M.yaxis._m,i=[(p={a:h.a-n,b:h.b+(r+n)/2,c:h.c-(r-n)/2}).a,p.b,p.c].sort(a.sorterAsc),s=i.indexOf(p.a),l=i.indexOf(p.b),u=i.indexOf(p.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),p={a:i[s],b:i[l],c:i[u]},t=(h.a-p.a)*M.yaxis._m,e=(h.c-p.c-h.b+p.b)*M.xaxis._m);var f=o(M.x0+e,M.y0+t);M.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",f);var d=o(-e,-t);M.clipDefRelative.select("path").attr("transform",d),M.aaxis.range=[p.a,M.sum-p.b-p.c],M.baxis.range=[M.sum-p.a-p.c,p.b],M.caxis.range=[M.sum-p.a-p.b,p.c],M.drawAxes(!1),M._hasClipOnAxisFalse&&M.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,M),C.emit("plotly_relayouting",R(p))}function H(){i.call("_guiRelayout",C,R(p))}this.dragOptions={element:S,gd:C,plotinfo:{id:M.id,domain:C._fullLayout[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis},subplot:M.id,prepFn:function(i,s,c){M.dragOptions.xaxes=[M.xaxis],M.dragOptions.yaxes=[M.yaxis],e=C._fullLayout._invScaleX,t=C._fullLayout._invScaleY;var d=M.dragOptions.dragmode=C._fullLayout.dragmode;y(d)?M.dragOptions.minDrag=1:M.dragOptions.minDrag=void 0,"zoom"===d?(M.dragOptions.moveFn=U,M.dragOptions.clickFn=F,M.dragOptions.doneFn=V,function(e,t,i){var s=S.getBoundingClientRect();r=t-s.left,u=i-s.top,C._fullLayout._calcInverseTransform(C);var c=C._fullLayout._invTransform,d=a.apply3DTransform(c)(r,u);r=d[0],u=d[1],h={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=h,f=M.aaxis.range[1]-h.a,g=n(M.graphDiv._fullLayout[M.id].bgcolor).getLuminance(),x="M0,"+M.h+"L"+M.w/2+", 0L"+M.w+","+M.h+"Z",b=!1,T=O.append("path").attr("class","zoombox").attr("transform",o(M.x0,M.y0)).style({fill:g>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",x),k=O.append("path").attr("class","zoombox-corners").attr("transform",o(M.x0,M.y0)).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),M.clearOutline(C)}(0,s,c)):"pan"===d?(M.dragOptions.moveFn=q,M.dragOptions.clickFn=F,M.dragOptions.doneFn=H,h={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=h,M.clearOutline(C)):(v(d)||y(d))&&_(i,s,c,M.dragOptions,d)}},S.onmousemove=function(e){m.hover(C,e,M.id),C._fullLayout._lasthover=S,C._fullLayout._hoversubplot=M.id},S.onmouseout=function(e){C._dragging||d.unhover(C,e)},d.init(this.dragOptions)}}}),Hs=m({"src/plots/ternary/layout_attributes.js"(e,t){var r=G(),n=Ma().attributes,i=Lt(),a=De().overrideAll,o=B().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}},l=t.exports=a({domain:n({name:"ternary"}),bgcolor:{valType:"color",dflt:r.background},sum:{valType:"number",dflt:1,min:0},aaxis:s,baxis:s,caxis:s},"plot","from-root");l.uirevision={valType:"any",editType:"none"},l.aaxis.uirevision=l.baxis.uirevision=l.caxis.uirevision={valType:"any",editType:"none"}}}),Gs=m({"src/plots/subplot_defaults.js"(e,t){var r=ct(),n=vt(),i=Ma().defaults;t.exports=function(e,t,a,o){var s,l,c=o.type,u=o.attributes,h=o.handleDefaults,f=o.partition||"x",p=t._subplots[c],d=p.length,m=d&&p[0].replace(/\d+$/,"");function g(e,t){return r.coerce(s,l,u,e,t)}for(var y=0;y<d;y++){var v=p[y];s=e[v]?e[v]:e[v]={},l=n.newContainer(t,v,m),o.noUirevision||g("uirevision",t.uirevision);var x={};x[f]=[y/d,(y+1)/d],i(l,t,g,x),o.id=v,h(s,l,g,o)}}}}),Ws=m({"src/plots/ternary/layout_defaults.js"(e,t){var r=W(),n=vt(),i=ct(),a=Gs(),o=Ut(),s=Vt(),l=Bt(),c=Ft(),u=ki(),h=Hs(),f=["aaxis","baxis","caxis"];function p(e,t,i,a){var o=i("bgcolor"),s=i("sum");a.bgColor=r.combine(o,a.paper_bgcolor);for(var l,c,u,h=0;h<f.length;h++)c=e[l=f[h]]||{},(u=n.newContainer(t,l))._name=l,d(c,u,a,t);var p=t.aaxis,m=t.baxis,g=t.caxis;p.min+m.min+g.min>=s&&(p.min=0,m.min=0,g.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function d(e,t,r,n){var a=h[t._name];function f(r,n){return i.coerce(e,t,a,r,n)}f("uirevision",n.uirevision),t.type="linear";var p=f("color"),d=p!==a.color.dflt?p:r.font.color,m=t._name.charAt(0).toUpperCase(),g="Component "+m,y=f("title.text",g);t._hovertitle=y===g?y:m,i.coerceFont(f,"title.font",r.font,{overrideDflt:{size:i.bigFont(r.font.size),color:d}}),f("min"),c(e,t,f,"linear"),s(e,t,f,"linear"),o(e,t,f,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),l(e,t,f,{outerTicks:!0}),f("showticklabels")&&(i.coerceFont(f,"tickfont",r.font,{overrideDflt:{color:d}}),f("tickangle"),f("tickformat")),u(e,t,f,{dfltColor:p,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),f("hoverformat"),f("layer")}t.exports=function(e,t,r){a(e,t,r,{type:"ternary",attributes:h,handleDefaults:p,font:t.font,paper_bgcolor:t.paper_bgcolor})}}}),Zs=m({"src/plots/ternary/index.js"(e){var t=qs(),r=Tt().getSubplotCalcData,n=ct().counterRegex,i="ternary";e.name=i;var a=e.attr="subplot";e.idRoot=i,e.idRegex=e.attrRegex=n(i),(e.attributes={})[a]={valType:"subplotid",dflt:"ternary",editType:"calc"},e.layoutAttributes=Hs(),e.supplyLayoutDefaults=Ws(),e.plot=function(e){for(var n=e._fullLayout,a=e.calcdata,o=n._subplots[i],s=0;s<o.length;s++){var l=o[s],c=r(a,i,l),u=n[l]._subplot;u||(u=new t({id:l,graphDiv:e,container:n._ternarylayer.node()},n),n[l]._subplot=u),u.plot(c,n,e._promises)}},e.clean=function(e,t,r,n){for(var a=n._subplots[i]||[],o=0;o<a.length;o++){var s=a[o],l=n[s]._subplot;!t[s]&&l&&(l.plotContainer.remove(),l.clipDef.remove(),l.clipDefRelative.remove(),l.layers["a-title"].remove(),l.layers["b-title"].remove(),l.layers["c-title"].remove())}},e.updateFx=function(e){var t=e._fullLayout;t._ternarylayer.selectAll("g.toplevel").style("cursor","pan"===t.dragmode?"move":"crosshair")}}}),Ys=m({"src/traces/scatterternary/index.js"(e,t){t.exports={attributes:Rs(),supplyDefaults:Fs(),colorbar:mi(),formatLabels:Bs(),calc:js(),plot:Ns(),style:yi().style,styleOnSelect:yi().styleOnSelect,hoverPoints:Us(),selectPoints:_i(),eventData:Vs(),moduleType:"trace",name:"scatterternary",basePlotModule:Zs(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}}),Xs=m({"lib/scatterternary.js"(e,t){t.exports=Ys()}}),$s=m({"src/traces/violin/attributes.js"(e,t){var r=lo(),n=B().extendFlat,i=It().axisHoverFormat;t.exports={y:r.y,x:r.x,x0:r.x0,y0:r.y0,xhoverformat:i("x"),yhoverformat:i("y"),name:n({},r.name,{}),orientation:n({},r.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:r.fillcolor,points:n({},r.boxpoints,{}),jitter:n({},r.jitter,{}),pointpos:n({},r.pointpos,{}),width:n({},r.width,{}),marker:r.marker,text:r.text,hovertext:r.hovertext,hovertemplate:r.hovertemplate,hovertemplatefallback:r.hovertemplatefallback,quartilemethod:r.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:r.offsetgroup,alignmentgroup:r.alignmentgroup,selected:r.selected,unselected:r.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:r.zorder}}}),Ks=m({"src/traces/violin/layout_attributes.js"(e,t){var r=co(),n=ct().extendFlat;t.exports={violinmode:n({},r.boxmode,{}),violingap:n({},r.boxgap,{}),violingroupgap:n({},r.boxgroupgap,{})}}}),Js=m({"src/traces/violin/defaults.js"(e,t){var r=ct(),n=W(),i=uo(),a=$s();t.exports=function(e,t,o,s){function l(n,i){return r.coerce(e,t,a,n,i)}function c(n,i){return r.coerce2(e,t,a,n,i)}if(i.handleSampleDefaults(e,t,l,s),!1!==t.visible){l("bandwidth"),l("side"),l("width")||(l("scalegroup",t.name),l("scalemode"));var u,h=l("span");Array.isArray(h)&&(u="manual"),l("spanmode",u);var f=l("line.color",(e.marker||{}).color||o),p=l("line.width"),d=l("fillcolor",n.addOpacity(t.line.color,.5));i.handlePointsDefaults(e,t,l,{prefix:""});var m=c("box.width"),g=c("box.fillcolor",d),y=c("box.line.color",f),v=c("box.line.width",p);l("box.visible",!!(m||g||y||v))||(t.box={visible:!1});var x=c("meanline.color",f),_=c("meanline.width",p);l("meanline.visible",!(!x&&!_))||(t.meanline={visible:!1}),l("quartilemethod"),l("zorder")}}}}),Qs=m({"src/traces/violin/layout_defaults.js"(e,t){var r=ct(),n=Ks(),i=ho();t.exports=function(e,t,a){i._supply(e,t,a,(function(i,a){return r.coerce(e,t,n,i,a)}),"violin")}}}),el=m({"src/traces/violin/helpers.js"(e){var t=ct(),r=function(e){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*e*e)};e.makeKDE=function(e,t,n){var i=n.length,a=r,o=e.bandwidth,s=1/(i*o);return function(e){for(var t=0,r=0;r<i;r++)t+=a((e-n[r])/o);return s*t}},e.getPositionOnKdePath=function(e,r,n){var i,a;"h"===r.orientation?(i="y",a="x"):(i="x",a="y");var o=t.findPointOnPath(e.path,n,a,{pathLength:e.pathLength}),s=e.posCenterPx,l=o[i];return[l,"both"===r.side?2*s-l:s]},e.getKdeValue=function(t,r,n){var i=t.pts.map(e.extractVal);return e.makeKDE(t,r,i)(n)/t.posDensityScale},e.extractVal=function(e){return e.v}}}),tl=m({"src/traces/violin/calc.js"(e,t){var r=ct(),n=ar(),i=fo(),a=el(),o=S().BADNUM;function s(e,t,n){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=n.length,o=r.stdev(n,a-1,t.mean);return Math.max(function(e,t,r){return 1.059*Math.min(t,r/1.349)*Math.pow(e,-.2)}(a,o,t.q3-t.q1),i/100)}function l(e,t,r,i){var a,s=e.spanmode,l=e.span||[],c=[t.min,t.max],u=[t.min-2*i,t.max+2*i];function h(n){var i=l[n],a="multicategory"===r.type?r.r2c(i):r.d2c(i,0,e[t.valLetter+"calendar"]);return a===o?u[n]:a}var f={type:"linear",range:a="soft"===s?u:"hard"===s?c:[h(0),h(1)]};return n.setConvert(f),f.cleanRange(),a}t.exports=function(e,t){var o=i(e,t);if(o[0].t.empty)return o;for(var c=e._fullLayout,u=n.getFromId(e,t["h"===t.orientation?"xaxis":"yaxis"]),h=1/0,f=-1/0,p=0,d=0,m=0;m<o.length;m++){var g=o[m],y=g.pts.map(a.extractVal),v=g.bandwidth=s(t,g,y),x=g.span=l(t,g,u,v);if(g.min===g.max&&0===v)x=g.span=[g.min,g.max],g.density=[{v:1,t:x[0]}],g.bandwidth=v,p=Math.max(p,1);else{var _=x[1]-x[0],b=Math.ceil(_/(v/3)),w=_/b;if(!isFinite(w)||!isFinite(b))return r.error("Something went wrong with computing the violin span"),o[0].t.empty=!0,o;var T=a.makeKDE(g,t,y);g.density=new Array(b+1);for(var k=0;k<g.density.length;k++){var A=x[0]+k*w,M=T(A);g.density[k]={v:M,t:A},p=Math.max(p,M)}}d=Math.max(d,y.length),h=Math.min(h,x[0]),f=Math.max(f,x[1])}var S=n.findExtremes(u,[h,f],{padded:!0});if(t._extremes[u._id]=S,t.width)o[0].t.maxKDE=p;else{var E=c._violinScaleGroupStats,C=t.scalegroup,I=E[C];I?(I.maxKDE=Math.max(I.maxKDE,p),I.maxCount=Math.max(I.maxCount,d)):E[C]={maxKDE:p,maxCount:d}}return o[0].t.labels.kde=r._(e,"kde:"),o}}}),rl=m({"src/traces/violin/cross_trace_calc.js"(e,t){var r=po().setPositionOffset,n=["v","h"];t.exports=function(e,t){for(var i=e.calcdata,a=t.xaxis,o=t.yaxis,s=0;s<n.length;s++){for(var l=n[s],c="h"===l?o:a,u=[],h=0;h<i.length;h++){var f=i[h],p=f[0].t,d=f[0].trace;!0===d.visible&&"violin"===d.type&&!p.empty&&d.orientation===l&&d.xaxis===a._id&&d.yaxis===o._id&&u.push(h)}r("violin",e,u,c)}}}}),nl=m({"src/traces/violin/plot.js"(e,t){var r=b(),n=ct(),i=er(),a=mo(),o=fi(),s=el();t.exports=function(e,t,l,c){var u=e._context.staticPlot,h=e._fullLayout,f=t.xaxis,p=t.yaxis;function d(e,t){var r=o(e,{xaxis:f,yaxis:p,trace:t,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return i.smoothopen(r[0],1)}n.makeTraceGroups(c,l,"trace violins").each((function(e){var i=r.select(this),o=e[0],l=o.t,c=o.trace;if(!0!==c.visible||l.empty)i.remove();else{var m=l.bPos,g=l.bdPos,y=t[l.valLetter+"axis"],v=t[l.posLetter+"axis"],x="both"===c.side,_=x||"positive"===c.side,b=x||"negative"===c.side,w=i.selectAll("path.violin").data(n.identity);w.enter().append("path").style("vector-effect",u?"none":"non-scaling-stroke").attr("class","violin"),w.exit().remove(),w.each((function(e){var t,n,i,a,o,s,u,f,p=r.select(this),w=e.density,T=w.length,k=v.c2l(e.pos+m,!0),A=v.l2p(k);if(c.width)t=l.maxKDE/g;else{var M=h._violinScaleGroupStats[c.scalegroup];t="count"===c.scalemode?M.maxKDE/g*(M.maxCount/e.pts.length):M.maxKDE/g}if(_){for(u=new Array(T),o=0;o<T;o++)(f=u[o]={})[l.posLetter]=k+w[o].v/t,f[l.valLetter]=y.c2l(w[o].t,!0);n=d(u,c)}if(b){for(u=new Array(T),s=0,o=T-1;s<T;s++,o--)(f=u[s]={})[l.posLetter]=k-w[o].v/t,f[l.valLetter]=y.c2l(w[o].t,!0);i=d(u,c)}if(x)a=n+"L"+i.slice(1)+"Z";else{var S=[A,y.c2p(w[0].t)],E=[A,y.c2p(w[T-1].t)];"h"===c.orientation&&(S.reverse(),E.reverse()),a=_?"M"+S+"L"+n.slice(1)+"L"+E:"M"+E+"L"+i.slice(1)+"L"+S}p.attr("d",a),e.posCenterPx=A,e.posDensityScale=t*g,e.path=p.node(),e.pathLength=e.path.getTotalLength()/(x?2:1)}));var T,k,A,M=c.box,S=M.width,E=(M.line||{}).width;x?(T=g*S,k=0):_?(T=[0,g*S/2],k=E*{x:1,y:-1}[l.posLetter]):(T=[g*S/2,0],k=E*{x:-1,y:1}[l.posLetter]),a.plotBoxAndWhiskers(i,{pos:v,val:y},c,{bPos:m,bdPos:T,bPosPxOffset:k}),a.plotBoxMean(i,{pos:v,val:y},c,{bPos:m,bdPos:T,bPosPxOffset:k}),!c.box.visible&&c.meanline.visible&&(A=n.identity);var C=i.selectAll("path.meanline").data(A||[]);C.enter().append("path").attr("class","meanline").style("fill","none").style("vector-effect",u?"none":"non-scaling-stroke"),C.exit().remove(),C.each((function(e){var t=y.c2p(e.mean,!0),n=s.getPositionOnKdePath(e,c,t);r.select(this).attr("d","h"===c.orientation?"M"+t+","+n[0]+"V"+n[1]:"M"+n[0]+","+t+"H"+n[1])})),a.plotPoints(i,{x:f,y:p},c,l)}}))}}}),il=m({"src/traces/violin/style.js"(e,t){var r=b(),n=W(),i=yi().stylePoints;t.exports=function(e){var t=r.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=r.select(this),s=a.box||{},l=s.line||{},c=a.meanline||{},u=c.width;o.selectAll("path.violin").style("stroke-width",a.line.width+"px").call(n.stroke,a.line.color).call(n.fill,a.fillcolor),o.selectAll("path.box").style("stroke-width",l.width+"px").call(n.stroke,l.color).call(n.fill,s.fillcolor);var h={"stroke-width":u+"px","stroke-dasharray":2*u+"px,"+u+"px"};o.selectAll("path.mean").style(h).call(n.stroke,c.color),o.selectAll("path.meanline").style(h).call(n.stroke,c.color),i(o,a,e)}))}}}),al=m({"src/traces/violin/hover.js"(e,t){var r=W(),n=ct(),i=ar(),a=yo(),o=el();t.exports=function(e,t,s,l,c){c||(c={});var u,h,f=c.hoverLayer,p=e.cd,d=p[0].trace,m=d.hoveron,g=-1!==m.indexOf("violins"),y=-1!==m.indexOf("kde"),v=[];if(g||y){var x=a.hoverOnBoxes(e,t,s,l);if(y&&x.length>0){var _,b,w,T,k,A=e.xa,M=e.ya;"h"===d.orientation?(k=t,_="y",w=M,b="x",T=A):(k=s,_="x",w=A,b="y",T=M);var S=p[e.index];if(k>=S.span[0]&&k<=S.span[1]){var E=n.extendFlat({},e),C=T.c2p(k,!0),I=o.getKdeValue(S,d,k),L=o.getPositionOnKdePath(S,d,C),P=w._offset,z=w._length;E[_+"0"]=L[0],E[_+"1"]=L[1],E[b+"0"]=E[b+"1"]=C,E[b+"Label"]=b+": "+i.hoverLabelText(T,k,d[b+"hoverformat"])+", "+p[0].t.labels.kde+" "+I.toFixed(3);for(var D=0,O=0;O<x.length;O++)if("med"===x[O].attr){D=O;break}E.spikeDistance=x[D].spikeDistance;var R=_+"Spike";E[R]=x[D][R],x[D].spikeDistance=void 0,x[D][R]=void 0,E.hovertemplate=!1,v.push(E),(h={})[_+"1"]=n.constrain(P+L[0],P,P+z),h[_+"2"]=n.constrain(P+L[1],P,P+z),h[b+"1"]=h[b+"2"]=T._offset+C}}g&&(v=v.concat(x))}-1!==m.indexOf("points")&&(u=a.hoverOnPoints(e,t,s));var F=f.selectAll(".violinline-"+d.uid).data(h?[0]:[]);return F.enter().append("line").classed("violinline-"+d.uid,!0).attr("stroke-width",1.5),F.exit().remove(),F.attr(h).call(r.stroke,e.color),"closest"===l?u?[u]:v:(u&&v.push(u),v)}}}),ol=m({"src/traces/violin/index.js"(e,t){t.exports={attributes:$s(),layoutAttributes:Ks(),supplyDefaults:Js(),crossTraceDefaults:uo().crossTraceDefaults,supplyLayoutDefaults:Qs(),calc:tl(),crossTraceCalc:rl(),plot:nl(),style:il(),styleOnSelect:yi().styleOnSelect,hoverPoints:al(),selectPoints:xo(),moduleType:"trace",name:"violin",basePlotModule:Ci(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}}),sl=m({"lib/violin.js"(e,t){t.exports=ol()}}),ll=m({"src/traces/funnel/constants.js"(e,t){t.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}}),cl=m({"src/traces/funnel/attributes.js"(e,t){var r,n=Wa(),i=kn().line,a=q(),o=It().axisHoverFormat,{hovertemplateAttrs:s,texttemplateAttrs:l,templatefallbackAttrs:c}=Fe(),u=ll(),h=B().extendFlat,f=W();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:o("x"),yhoverformat:o("y"),hovertext:n.hovertext,hovertemplate:s({},{keys:u.eventDataKeys}),hovertemplatefallback:c(),hoverinfo:h({},a.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:l({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),texttemplatefallback:c({editType:"plot"}),text:n.text,textposition:n.textposition,insidetextanchor:h({},n.insidetextanchor,{dflt:"middle"}),textangle:h({},n.textangle,{dflt:0}),textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:n.outsidetextfont,constraintext:n.constraintext,cliponaxis:n.cliponaxis,orientation:h({},n.orientation,{}),offset:h({},n.offset,{arrayOk:!1}),width:h({},n.width,{arrayOk:!1}),marker:(r=h({},n.marker),delete r.pattern,delete r.cornerradius,r),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:h({},i.color,{dflt:f.defaultLine}),width:h({},i.width,{dflt:0,editType:"plot"}),dash:i.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,zorder:n.zorder}}}),ul=m({"src/traces/funnel/layout_attributes.js"(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"}}}}),hl=m({"src/traces/funnel/defaults.js"(e,t){var r=ct(),n=ei(),i=Xa().handleText,a=Gn(),o=Wn(),s=cl(),l=W();t.exports={supplyDefaults:function(e,t,n,c){function u(n,i){return r.coerce(e,t,s,n,i)}if(a(e,t,c,u)){o(e,t,c,u),u("xhoverformat"),u("yhoverformat"),u("orientation",t.y&&!t.x?"v":"h"),u("offset"),u("width");var h=u("text");u("hovertext"),u("hovertemplate"),u("hovertemplatefallback");var f=u("textposition");i(e,t,c,u,f,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==t.textposition&&!t.texttemplate&&u("textinfo",r.isArrayOrTypedArray(h)?"text+value":"value");var p=u("marker.color",n);u("marker.line.color",l.defaultLine),u("marker.line.width"),u("connector.visible")&&(u("connector.fillcolor",function(e){var t=r.isArrayOrTypedArray(e)?"#000":e;return l.addOpacity(t,.5*l.opacity(t))}(p)),u("connector.line.width")&&(u("connector.line.color"),u("connector.line.dash"))),u("zorder")}else t.visible=!1},crossTraceDefaults:function(e,t){var i,a;function o(e){return r.coerce(a._input,a,s,e)}for(var l=0;l<e.length;l++)"funnel"===(a=e[l]).type&&(i=a._input,n(i,a,t,o,t.funnelmode))}}}}),fl=m({"src/traces/funnel/layout_defaults.js"(e,t){var r=ct(),n=ul();t.exports=function(e,t,i){var a=!1;function o(i,a){return r.coerce(e,t,n,i,a)}for(var s=0;s<i.length;s++){var l=i[s];if(l.visible&&"funnel"===l.type){a=!0;break}}a&&(o("funnelmode"),o("funnelgap",.2),o("funnelgroupgap"))}}}),pl=m({"src/traces/funnel/arrays_to_calcdata.js"(e,t){var r=ct();t.exports=function(e,t){for(var n=0;n<e.length;n++)e[n].i=n;r.mergeArray(t.text,e,"tx"),r.mergeArray(t.hovertext,e,"htx");var i=t.marker;if(i){r.mergeArray(i.opacity,e,"mo"),r.mergeArray(i.color,e,"mc");var a=i.line;a&&(r.mergeArray(a.color,e,"mlc"),r.mergeArrayCastPositive(a.width,e,"mlw"))}}}}),dl=m({"src/traces/funnel/calc.js"(e,t){var r=ar(),n=ni(),i=pl(),a=oi(),o=S().BADNUM;function s(e){return e===o?0:e}t.exports=function(e,t){var l,c,u,h,f,p,d,m,g=r.getFromId(e,t.xaxis||"x"),y=r.getFromId(e,t.yaxis||"y");"h"===t.orientation?(l=g.makeCalcdata(t,"x"),u=y.makeCalcdata(t,"y"),h=n(t,y,"y",u),f=!!t.yperiodalignment,p="y"):(l=y.makeCalcdata(t,"y"),u=g.makeCalcdata(t,"x"),h=n(t,g,"x",u),f=!!t.xperiodalignment,p="x"),c=h.vals;var v,x=Math.min(c.length,l.length),_=new Array(x);for(t._base=[],d=0;d<x;d++){l[d]<0&&(l[d]=o);var b=!1;l[d]!==o&&d+1<x&&l[d+1]!==o&&(b=!0),m=_[d]={p:c[d],s:l[d],cNext:b},t._base[d]=-.5*m.s,f&&(_[d].orig_p=u[d],_[d][p+"End"]=h.ends[d],_[d][p+"Start"]=h.starts[d]),t.ids&&(m.id=String(t.ids[d])),0===d&&(_[0].vTotal=0),_[0].vTotal+=s(m.s),m.begR=s(m.s)/s(_[0].s)}for(d=0;d<x;d++)(m=_[d]).s!==o&&(m.sumR=m.s/_[0].vTotal,m.difR=void 0!==v?m.s/v:1,v=m.s);return i(_,t),a(_,t),_}}}),ml=m({"src/traces/funnel/cross_trace_calc.js"(e,t){var r=ui().setGroupPositions;t.exports=function(e,t){var n,i,a=e._fullLayout,o=e._fullData,s=e.calcdata,l=t.xaxis,c=t.yaxis,u=[],h=[],f=[];for(i=0;i<o.length;i++){var p=o[i],d="h"===p.orientation;!0===p.visible&&p.xaxis===l._id&&p.yaxis===c._id&&"funnel"===p.type&&(n=s[i],d?f.push(n):h.push(n),u.push(n))}var m={mode:a.funnelmode,norm:a.funnelnorm,gap:a.funnelgap,groupgap:a.funnelgroupgap};for(r(e,l,c,h,m),r(e,c,l,f,m),i=0;i<u.length;i++){n=u[i];for(var g=0;g<n.length;g++)g+1<n.length&&(n[g].nextP0=n[g+1].p0,n[g].nextS0=n[g+1].s0,n[g].nextP1=n[g+1].p1,n[g].nextS1=n[g+1].s1)}}}}),yl=m({"src/traces/funnel/plot.js"(e,t){var r=b(),n=ct(),i=er(),a=S().BADNUM,o=ro(),s=Qa().clearMinTextSize;function l(e,t,r,n){var i=[],a=[],o=n?t:r,s=n?r: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),n?[i,a]:[a,i]}t.exports=function(e,t,c,u){var h=e._fullLayout;s("funnel",h),function(e,t,o,s){var c=t.xaxis,u=t.yaxis;n.makeTraceGroups(s,o,"trace bars").each((function(o){var s=r.select(this),h=o[0].trace,f=n.ensureSingle(s,"g","regions");if(h.connector&&h.connector.visible){var p="h"===h.orientation,d=f.selectAll("g.region").data(n.identity);d.enter().append("g").classed("region",!0),d.exit().remove();var m=d.size();d.each((function(o,s){if(s===m-1||o.cNext){var h=l(o,c,u,p),f=h[0],d=h[1],g="";f[0]!==a&&d[0]!==a&&f[1]!==a&&d[1]!==a&&f[2]!==a&&d[2]!==a&&f[3]!==a&&d[3]!==a&&(g+=p?"M"+f[0]+","+d[1]+"L"+f[2]+","+d[2]+"H"+f[3]+"L"+f[1]+","+d[1]+"Z":"M"+f[1]+","+d[1]+"L"+f[2]+","+d[3]+"V"+d[2]+"L"+f[1]+","+d[0]+"Z"),""===g&&(g="M0,0Z"),n.ensureSingle(r.select(this),"path").attr("d",g).call(i.setClipUrl,t.layerClipId,e)}}))}else f.remove()}))}(e,t,c,u),function(e,t,a,o){var s=t.xaxis,c=t.yaxis;n.makeTraceGroups(o,a,"trace bars").each((function(a){var o=r.select(this),u=a[0].trace,h=n.ensureSingle(o,"g","lines");if(u.connector&&u.connector.visible&&u.connector.line.width){var f="h"===u.orientation,p=h.selectAll("g.line").data(n.identity);p.enter().append("g").classed("line",!0),p.exit().remove();var d=p.size();p.each((function(a,o){if(o===d-1||a.cNext){var u=l(a,s,c,f),h=u[0],p=u[1],m="";void 0!==h[3]&&void 0!==p[3]&&(f?(m+="M"+h[0]+","+p[1]+"L"+h[2]+","+p[2],m+="M"+h[1]+","+p[1]+"L"+h[3]+","+p[2]):(m+="M"+h[1]+","+p[1]+"L"+h[2]+","+p[3],m+="M"+h[1]+","+p[0]+"L"+h[2]+","+p[2])),""===m&&(m="M0,0Z"),n.ensureSingle(r.select(this),"path").attr("d",m).call(i.setClipUrl,t.layerClipId,e)}}))}else h.remove()}))}(e,t,c,u),o.plot(e,t,c,u,{mode:h.funnelmode,norm:h.funnelmode,gap:h.funnelgap,groupgap:h.funnelgroupgap})}}}),vl=m({"src/traces/funnel/style.js"(e,t){var r=b(),n=er(),i=W(),a=Z().DESELECTDIM,o=to(),s=Qa().resizeText,l=o.styleTextPoints;t.exports={style:function(e,t,o){var c=o||r.select(e).selectAll('g[class^="funnellayer"]').selectAll("g.trace");s(e,c,"funnel"),c.style("opacity",(function(e){return e[0].trace.opacity})),c.each((function(t){var o=r.select(this),s=t[0].trace;o.selectAll(".point > path").each((function(e){if(!e.isBlank){var t=s.marker;r.select(this).call(i.fill,e.mc||t.color).call(i.stroke,e.mlc||t.line.color).call(n.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",s.selectedpoints&&!e.selected?a:1)}})),l(o,s,e),o.selectAll(".regions").each((function(){r.select(this).selectAll("path").style("stroke-width",0).call(i.fill,s.connector.fillcolor)})),o.selectAll(".lines").each((function(){var e=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}}}),xl=m({"src/traces/funnel/hover.js"(e,t){var r=W().opacity,n=no().hoverOnBars,i=ct().formatPercent;t.exports=function(e,t,a,o,s){var l=n(e,t,a,o,s);if(l){var c=l.cd,u=c[0].trace,h="h"===u.orientation,f=c[l.index];l[(h?"x":"y")+"LabelVal"]=f.s,l.percentInitial=f.begR,l.percentInitialLabel=i(f.begR,1),l.percentPrevious=f.difR,l.percentPreviousLabel=i(f.difR,1),l.percentTotal=f.sumR,l.percentTotalLabel=i(f.sumR,1);var p=f.hi||u.hoverinfo,d=[];if(p&&"none"!==p&&"skip"!==p){var m="all"===p,g=p.split("+"),y=function(e){return m||-1!==g.indexOf(e)};y("percent initial")&&d.push(l.percentInitialLabel+" of initial"),y("percent previous")&&d.push(l.percentPreviousLabel+" of previous"),y("percent total")&&d.push(l.percentTotalLabel+" of total")}return l.extraText=d.join("<br>"),l.color=function(e,t){var n=e.marker,i=t.mc||n.color,a=t.mlc||n.line.color,o=t.mlw||n.line.width;return r(i)?i:r(a)&&o?a:void 0}(u,f),[l]}}}}),_l=m({"src/traces/funnel/event_data.js"(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}}}),bl=m({"src/traces/funnel/index.js"(e,t){t.exports={attributes:cl(),layoutAttributes:ul(),supplyDefaults:hl().supplyDefaults,crossTraceDefaults:hl().crossTraceDefaults,supplyLayoutDefaults:fl(),calc:dl(),crossTraceCalc:ml(),plot:yl(),style:vl().style,hoverPoints:xl(),eventData:_l(),selectPoints:ao(),moduleType:"trace",name:"funnel",basePlotModule:Ci(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),wl=m({"lib/funnel.js"(e,t){t.exports=bl()}}),Tl=m({"src/traces/waterfall/constants.js"(e,t){t.exports={eventDataKeys:["initial","delta","final"]}}}),kl=m({"src/traces/waterfall/attributes.js"(e,t){var r=Wa(),n=kn().line,i=q(),a=It().axisHoverFormat,{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:l}=Fe(),c=Tl(),u=B().extendFlat,h=W();function f(e){return{marker:{color:u({},r.marker.color,{arrayOk:!1,editType:"style"}),line:{color:u({},r.marker.line.color,{arrayOk:!1,editType:"style"}),width:u({},r.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:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),hovertext:r.hovertext,hovertemplate:o({},{keys:c.eventDataKeys}),hovertemplatefallback:l(),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:c.eventDataKeys.concat(["label"])}),texttemplatefallback:l({editType:"plot"}),text:r.text,textposition:r.textposition,insidetextanchor:r.insidetextanchor,textangle:r.textangle,textfont:r.textfont,insidetextfont:r.insidetextfont,outsidetextfont:r.outsidetextfont,constraintext:r.constraintext,cliponaxis:r.cliponaxis,orientation:r.orientation,offset:r.offset,width:r.width,increasing:f(),decreasing:f(),totals:f(),connector:{line:{color:u({},n.color,{dflt:h.defaultLine}),width:u({},n.width,{editType:"plot"}),dash:n.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,zorder:r.zorder}}}),Al=m({"src/traces/waterfall/layout_attributes.js"(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"}}}}),Ml=m({"src/constants/delta.js"(e,t){t.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),Sl=m({"src/traces/waterfall/defaults.js"(e,t){var r=ct(),n=ei(),i=Xa().handleText,a=Gn(),o=Wn(),s=kl(),l=W(),c=Ml(),u=c.INCREASING.COLOR,h=c.DECREASING.COLOR;function f(e,t,r){e(t+".marker.color",r),e(t+".marker.line.color",l.defaultLine),e(t+".marker.line.width")}t.exports={supplyDefaults:function(e,t,n,l){function c(n,i){return r.coerce(e,t,s,n,i)}if(a(e,t,l,c)){o(e,t,l,c),c("xhoverformat"),c("yhoverformat"),c("measure"),c("orientation",t.x&&!t.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback");var p=c("textposition");i(e,t,l,c,p,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==t.textposition&&(c("texttemplate"),c("texttemplatefallback"),t.texttemplate||c("textinfo")),f(c,"increasing",u),f(c,"decreasing",h),f(c,"totals","#4499FF"),c("connector.visible")&&(c("connector.mode"),c("connector.line.width")&&(c("connector.line.color"),c("connector.line.dash"))),c("zorder")}else t.visible=!1},crossTraceDefaults:function(e,t){var i,a;function o(e){return r.coerce(a._input,a,s,e)}if("group"===t.waterfallmode)for(var l=0;l<e.length;l++)i=(a=e[l])._input,n(i,a,t,o,t.waterfallmode)}}}}),El=m({"src/traces/waterfall/layout_defaults.js"(e,t){var r=ct(),n=Al();t.exports=function(e,t,i){var a=!1;function o(i,a){return r.coerce(e,t,n,i,a)}for(var s=0;s<i.length;s++){var l=i[s];if(l.visible&&"waterfall"===l.type){a=!0;break}}a&&(o("waterfallmode"),o("waterfallgap",.2),o("waterfallgroupgap"))}}}),Cl=m({"src/traces/waterfall/calc.js"(e,t){var r=ar(),n=ni(),i=ct().mergeArray,a=oi(),o=S().BADNUM;function s(e){return"a"===e||"absolute"===e}function l(e){return"t"===e||"total"===e}t.exports=function(e,t){var c,u,h,f,p,d,m=r.getFromId(e,t.xaxis||"x"),g=r.getFromId(e,t.yaxis||"y");"h"===t.orientation?(c=m.makeCalcdata(t,"x"),h=g.makeCalcdata(t,"y"),f=n(t,g,"y",h),p=!!t.yperiodalignment,d="y"):(c=g.makeCalcdata(t,"y"),h=m.makeCalcdata(t,"x"),f=n(t,m,"x",h),p=!!t.xperiodalignment,d="x"),u=f.vals;for(var y,v=Math.min(u.length,c.length),x=new Array(v),_=0,b=!1,w=0;w<v;w++){var T=c[w]||0,k=!1;(c[w]!==o||l(t.measure[w])||s(t.measure[w]))&&w+1<v&&(c[w+1]!==o||l(t.measure[w+1])||s(t.measure[w+1]))&&(k=!0);var A=x[w]={i:w,p:u[w],s:T,rawS:T,cNext:k};s(t.measure[w])?(_=A.s,A.isSum=!0,A.dir="totals",A.s=_):l(t.measure[w])?(A.isSum=!0,A.dir="totals",A.s=_):(A.isSum=!1,A.dir=A.rawS<0?"decreasing":"increasing",y=A.s,A.s=_+y,_+=y),"totals"===A.dir&&(b=!0),p&&(x[w].orig_p=h[w],x[w][d+"End"]=f.ends[w],x[w][d+"Start"]=f.starts[w]),t.ids&&(A.id=String(t.ids[w])),A.v=(t.base||0)+_}return x.length&&(x[0].hasTotals=b),i(t.text,x,"tx"),i(t.hovertext,x,"htx"),a(x,t),x}}}),Il=m({"src/traces/waterfall/cross_trace_calc.js"(e,t){var r=ui().setGroupPositions;t.exports=function(e,t){var n,i,a=e._fullLayout,o=e._fullData,s=e.calcdata,l=t.xaxis,c=t.yaxis,u=[],h=[],f=[];for(i=0;i<o.length;i++){var p=o[i];!0===p.visible&&p.xaxis===l._id&&p.yaxis===c._id&&"waterfall"===p.type&&(n=s[i],"h"===p.orientation?f.push(n):h.push(n),u.push(n))}var d={mode:a.waterfallmode,norm:a.waterfallnorm,gap:a.waterfallgap,groupgap:a.waterfallgroupgap};for(r(e,l,c,h,d),r(e,c,l,f,d),i=0;i<u.length;i++){n=u[i];for(var m=0;m<n.length;m++){var g=n[m];!1===g.isSum&&(g.s0+=0===m?0:n[m-1].s),m+1<n.length&&(n[m].nextP0=n[m+1].p0,n[m].nextS0=n[m+1].s0)}}}}}),Ll=m({"src/traces/waterfall/plot.js"(e,t){var r=b(),n=ct(),i=er(),a=S().BADNUM,o=ro(),s=Qa().clearMinTextSize;t.exports=function(e,t,l,c){var u=e._fullLayout;s("waterfall",u),o.plot(e,t,l,c,{mode:u.waterfallmode,norm:u.waterfallmode,gap:u.waterfallgap,groupgap:u.waterfallgroupgap}),function(e,t,o,s){var l=t.xaxis,c=t.yaxis;n.makeTraceGroups(s,o,"trace bars").each((function(o){var s=r.select(this),u=o[0].trace,h=n.ensureSingle(s,"g","lines");if(u.connector&&u.connector.visible){var f="h"===u.orientation,p=u.connector.mode,d=h.selectAll("g.line").data(n.identity);d.enter().append("g").classed("line",!0),d.exit().remove();var m=d.size();d.each((function(o,s){if(s===m-1||o.cNext){var u=function(e,t,r,n){var i=[],a=[],o=n?t:r,s=n?r: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),n?[i,a]:[a,i]}(o,l,c,f),h=u[0],d=u[1],g="";h[0]!==a&&d[0]!==a&&h[1]!==a&&d[1]!==a&&("spanning"===p&&!o.isSum&&s>0&&(g+=f?"M"+h[0]+","+d[1]+"V"+d[0]:"M"+h[1]+","+d[0]+"H"+h[0]),"between"!==p&&(o.isSum||s<m-1)&&(g+=f?"M"+h[1]+","+d[0]+"V"+d[1]:"M"+h[0]+","+d[1]+"H"+h[1]),h[2]!==a&&d[2]!==a&&(g+=f?"M"+h[1]+","+d[1]+"V"+d[2]:"M"+h[1]+","+d[1]+"H"+h[2])),""===g&&(g="M0,0Z"),n.ensureSingle(r.select(this),"path").attr("d",g).call(i.setClipUrl,t.layerClipId,e)}}))}else h.remove()}))}(e,t,l,c)}}}),Pl=m({"src/traces/waterfall/style.js"(e,t){var r=b(),n=er(),i=W(),a=Z().DESELECTDIM,o=to(),s=Qa().resizeText,l=o.styleTextPoints;t.exports={style:function(e,t,o){var c=o||r.select(e).selectAll('g[class^="waterfalllayer"]').selectAll("g.trace");s(e,c,"waterfall"),c.style("opacity",(function(e){return e[0].trace.opacity})),c.each((function(t){var o=r.select(this),s=t[0].trace;o.selectAll(".point > path").each((function(e){if(!e.isBlank){var t=s[e.dir].marker;r.select(this).call(i.fill,t.color).call(i.stroke,t.line.color).call(n.dashLine,t.line.dash,t.line.width).style("opacity",s.selectedpoints&&!e.selected?a:1)}})),l(o,s,e),o.selectAll(".lines").each((function(){var e=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}}}),zl=m({"src/traces/waterfall/hover.js"(e,t){var r=ar().hoverLabelText,n=W().opacity,i=no().hoverOnBars,a=Ml(),o=a.INCREASING.SYMBOL,s=a.DECREASING.SYMBOL;t.exports=function(e,t,a,l,c){var u=i(e,t,a,l,c);if(u){var h=u.cd,f=h[0].trace,p="h"===f.orientation,d=p?"x":"y",m=p?e.xa:e.ya,g=h[u.index],y=g.isSum?g.b+g.s:g.rawS;u.initial=g.b+g.s-y,u.delta=y,u.final=u.initial+u.delta;var v=k(Math.abs(u.delta));u.deltaLabel=y<0?"("+v+")":v,u.finalLabel=k(u.final),u.initialLabel=k(u.initial);var x=g.hi||f.hoverinfo,_=[];if(x&&"none"!==x&&"skip"!==x){var b="all"===x,w=x.split("+"),T=function(e){return b||-1!==w.indexOf(e)};g.isSum||(T("final")&&(p?!T("x"):!T("y"))&&_.push(u.finalLabel),T("delta")&&(y<0?_.push(u.deltaLabel+" "+s):_.push(u.deltaLabel+" "+o)),T("initial")&&_.push("Initial: "+u.initialLabel))}return _.length&&(u.extraText=_.join("<br>")),u.color=function(e,t){var r=e[t.dir].marker,i=r.color,a=r.line.color,o=r.line.width;return n(i)?i:n(a)&&o?a:void 0}(f,g),[u]}function k(e){return r(m,e,f[d+"hoverformat"])}}}}),Dl=m({"src/traces/waterfall/event_data.js"(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}}}),Ol=m({"src/traces/waterfall/index.js"(e,t){t.exports={attributes:kl(),layoutAttributes:Al(),supplyDefaults:Sl().supplyDefaults,crossTraceDefaults:Sl().crossTraceDefaults,supplyLayoutDefaults:El(),calc:Cl(),crossTraceCalc:Il(),plot:Ll(),style:Pl().style,hoverPoints:zl(),eventData:Dl(),selectPoints:ao(),moduleType:"trace",name:"waterfall",basePlotModule:Ci(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),Rl=m({"lib/waterfall.js"(e,t){t.exports=Ol()}}),Fl=m({"src/traces/image/constants.js"(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[1]+"%",t[2]=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[1]+"%",t[2]=t[2]+"%",t},suffix:["°","%","%",""]}}}}}),Bl=m({"src/traces/image/attributes.js"(e,t){var r,n,i=q(),a=kn().zorder,{hovertemplateAttrs:o,templatefallbackAttrs:s}=Fe(),l=B().extendFlat,c=Fl().colormodel,u=["rgb","rgba","rgba256","hsl","hsla"],h=[],f=[];for(n=0;n<u.length;n++)r=c[u[n]],h.push("For the `"+u[n]+"` colormodel, it is ["+(r.zminDflt||r.min).join(", ")+"]."),f.push("For the `"+u[n]+"` colormodel, it is ["+(r.zmaxDflt||r.max).join(", ")+"].");t.exports=l({source:{valType:"string",editType:"calc"},z:{valType:"data_array",editType:"calc"},colormodel:{valType:"enumerated",values:u,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:l({},i.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:o({},{keys:["z","color","colormodel"]}),hovertemplatefallback:s(),zorder:a})}}),jl=m({"src/traces/image/defaults.js"(e,t){var r=ct(),n=Bl(),i=Fl(),a=Rn().IMAGE_URL_PREFIX;t.exports=function(e,t){function o(i,a){return r.coerce(e,t,n,i,a)}o("source"),t.source&&!t.source.match(a)&&delete t.source,t._hasSource=!!t.source;var s,l=o("z");t._hasZ=!(void 0===l||!l.length||!l[0]||!l[0].length),t._hasZ||t._hasSource?(o("x0"),o("y0"),o("dx"),o("dy"),t._hasZ?(o("colormodel","rgb"),o("zmin",(s=i.colormodel[t.colormodel]).zminDflt||s.min),o("zmax",s.zmaxDflt||s.max)):t._hasSource&&(t.colormodel="rgba256",s=i.colormodel[t.colormodel],t.zmin=s.zminDflt,t.zmax=s.zmaxDflt),o("zsmooth"),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback"),t._length=null,o("zorder")):t.visible=!1}}}),Nl=m({"node_modules/inherits/inherits_browser.js"(e,t){"function"==typeof Object.create?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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}}}),Ul=m({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js"(e,t){t.exports=pt().EventEmitter}}),Vl=m({"node_modules/base64-js/index.js"(e){e.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},e.toByteArray=function(e){var t,r,a=o(e),s=a[0],l=a[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,l)),u=0,h=l>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},e.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,c=n-i;s<c;s+=o)a.push(l(e,s,s+o>c?c:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};var t,r=[],n=[],i=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0;t<64;++t)r[t]=a[t],n[a.charCodeAt(t)]=t;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function l(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),i.push(s(n));return i.join("")}n[45]=62,n[95]=63}}),ql=m({"node_modules/ieee754/index.js"(e){e.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+e[t+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},e.write=function(e,t,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=t<0||0===t&&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*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+p]=255&o,p+=d,o/=256,c-=8);e[r+p-d]|=128*m}}}),Hl=m({"node_modules/buffer/index.js"(e){var t=Vl(),r=ql(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},e.INSPECT_MAX_BYTES=50;var i=2147483647;function a(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=0|p(e,t),n=a(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){let t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return u(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);let i=function(e){if(o.isBuffer(e)){let t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?a(0):u(e):"Buffer"===e.type&&Array.isArray(e.data)?u(e.data):void 0}(e);if(i)return i;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),a(e<0?0:0|f(e))}function u(e){let t=e.length<0?0:0|f(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,o.prototype),n}function f(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function p(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:H(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return E(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return M(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){let a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let n=-1;for(a=r;a<s;a++)if(c(e,a)===c(t,-1===n?0:a-n)){if(-1===n&&(n=a),a-n+1===l)return n*o}else-1!==n&&(a-=a-n),n=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){let r=!0;for(let n=0;n<l;n++)if(c(e,a+n)!==c(t,n)){r=!1;break}if(r)return a}return-1}function v(e,t,r,n){r=Number(r)||0;let i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;let a,o=t.length;for(n>o/2&&(n=o/2),a=0;a<n;++a){let n=parseInt(t.substr(2*a,2),16);if(Y(n))return a;e[r+a]=n}return a}function x(e,t,r,n){return W(H(t,e.length-r),e,r,n)}function _(e,t,r,n){return W(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function b(e,t,r,n){return W(G(t),e,r,n)}function w(e,t,r,n){return W(function(e,t){let r,n,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function T(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function k(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,s,l;switch(o){case 1:t<128&&(a=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(a=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return function(e){let t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}e.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&"function"==typeof console.error&&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."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(Z(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.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}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(Z(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!o.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},o.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},o.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},o.prototype.toString=function(){let e=this.length;return 0===e?"":0===arguments.length?k(this,0,e):d.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){let t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(Z(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),l=Math.min(a,s),c=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<l;++e)if(c[e]!==u[e]){a=c[e],s=u[e];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}let i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return b(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function M(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function S(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function E(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=X[e[n]];return i}function C(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function I(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function P(e,t,r,n,i){N(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function z(e,t,r,n,i){N(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function D(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,n,i,a){return t=+t,n>>>=0,a||D(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function R(e,t,n,i,a){return t=+t,n>>>=0,a||D(e,0,n,8),r.write(e,t,n,i,52,8),n+8}o.prototype.slice=function(e,t){let r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);let n=this[e],i=1,a=0;for(;++a<t&&(i*=256);)n+=this[e+a]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=$((function(e){U(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&V(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),o.prototype.readBigUInt64BE=$((function(e){U(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&V(e,this.length-8);let n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);let n=this[e],i=1,a=0;for(;++a<t&&(i*=256);)n+=this[e+a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);let n=t,i=1,a=this[e+--n];for(;n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||I(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||I(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=$((function(e){U(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&V(e,this.length-8);let n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),o.prototype.readBigInt64BE=$((function(e){U(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&V(e,this.length-8);let n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),o.prototype.readFloatLE=function(e,t){return e>>>=0,t||I(e,4,this.length),r.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||I(e,4,this.length),r.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||I(e,8,this.length),r.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||I(e,8,this.length),r.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigUInt64LE=$((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=$((function(e,t=0){return z(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=0,a=1,o=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=r-1,a=1,o=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(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]=255&e,t+4},o.prototype.writeBigInt64LE=$((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=$((function(e,t=0){return z(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return R(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return R(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&0!==n&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let a=o.isBuffer(e)?e:o.from(e,n),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%s]}return this};var F={};function B(e,t,r){F[e]=class extends r{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}`}}}function j(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function N(e,t,r,n,i,a){if(e>r||e<t){let n,i="bigint"==typeof t?"n":"";throw n=a>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(a+1)}${i}`:`>= -(2${i} ** ${8*(a+1)-1}${i}) and < 2 ** ${8*(a+1)-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new F.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){U(t,"offset"),(void 0===e[t]||void 0===e[t+r])&&V(t,e.length-(r+1))}(n,i,a)}function U(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){throw Math.floor(e)!==e?(U(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new F.ERR_BUFFER_OUT_OF_BOUNDS:new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=j(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);var q=/[^+/0-9A-Za-z-_]/g;function H(e,t){t=t||1/0;let r,n=e.length,i=null,a=[];for(let o=0;o<n;++o){if(r=e.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function G(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}var X=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function $(e){return typeof BigInt>"u"?K:e}function K(){throw new Error("BigInt not supported")}}}),Gl=m({"node_modules/has-symbols/shams.js"(e,t){t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0}}}),Wl=m({"node_modules/has-tostringtag/shams.js"(e,t){var r=Gl();t.exports=function(){return r()&&!!Symbol.toStringTag}}}),Zl=m({"node_modules/es-object-atoms/index.js"(e,t){t.exports=Object}}),Yl=m({"node_modules/es-errors/index.js"(e,t){t.exports=Error}}),Xl=m({"node_modules/es-errors/eval.js"(e,t){t.exports=EvalError}}),$l=m({"node_modules/es-errors/range.js"(e,t){t.exports=RangeError}}),Kl=m({"node_modules/es-errors/ref.js"(e,t){t.exports=ReferenceError}}),Jl=m({"node_modules/es-errors/syntax.js"(e,t){t.exports=SyntaxError}}),Ql=m({"node_modules/es-errors/type.js"(e,t){t.exports=TypeError}}),ec=m({"node_modules/es-errors/uri.js"(e,t){t.exports=URIError}}),tc=m({"node_modules/math-intrinsics/abs.js"(e,t){t.exports=Math.abs}}),rc=m({"node_modules/math-intrinsics/floor.js"(e,t){t.exports=Math.floor}}),nc=m({"node_modules/math-intrinsics/max.js"(e,t){t.exports=Math.max}}),ic=m({"node_modules/math-intrinsics/min.js"(e,t){t.exports=Math.min}}),ac=m({"node_modules/math-intrinsics/pow.js"(e,t){t.exports=Math.pow}}),oc=m({"node_modules/math-intrinsics/round.js"(e,t){t.exports=Math.round}}),sc=m({"node_modules/math-intrinsics/isNaN.js"(e,t){t.exports=Number.isNaN||function(e){return e!=e}}}),lc=m({"node_modules/math-intrinsics/sign.js"(e,t){var r=sc();t.exports=function(e){return r(e)||0===e?e:e<0?-1:1}}}),cc=m({"node_modules/gopd/gOPD.js"(e,t){t.exports=Object.getOwnPropertyDescriptor}}),uc=m({"node_modules/gopd/index.js"(e,t){var r=cc();if(r)try{r([],"length")}catch{r=null}t.exports=r}}),hc=m({"node_modules/es-define-property/index.js"(e,t){var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}t.exports=r}}),fc=m({"node_modules/has-symbols/index.js"(e,t){var r=typeof Symbol<"u"&&Symbol,n=Gl();t.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&n()}}}),pc=m({"node_modules/get-proto/Reflect.getPrototypeOf.js"(e,t){t.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}}),dc=m({"node_modules/get-proto/Object.getPrototypeOf.js"(e,t){var r=Zl();t.exports=r.getPrototypeOf||null}}),mc=m({"node_modules/function-bind/implementation.js"(e,t){var r=Object.prototype.toString,n=Math.max,i=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};t.exports=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==r.apply(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var a,o=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),s=n(0,t.length-o.length),l=[],c=0;c<s;c++)l[c]="$"+c;if(a=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(l)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof a){var r=t.apply(this,i(o,arguments));return Object(r)===r?r:this}return t.apply(e,i(o,arguments))})),t.prototype){var u=function(){};u.prototype=t.prototype,a.prototype=new u,u.prototype=null}return a}}}),gc=m({"node_modules/function-bind/index.js"(e,t){var r=mc();t.exports=Function.prototype.bind||r}}),yc=m({"node_modules/call-bind-apply-helpers/functionCall.js"(e,t){t.exports=Function.prototype.call}}),vc=m({"node_modules/call-bind-apply-helpers/functionApply.js"(e,t){t.exports=Function.prototype.apply}}),xc=m({"node_modules/call-bind-apply-helpers/reflectApply.js"(e,t){t.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}}),_c=m({"node_modules/call-bind-apply-helpers/actualApply.js"(e,t){var r=gc(),n=vc(),i=yc(),a=xc();t.exports=a||r.call(i,n)}}),bc=m({"node_modules/call-bind-apply-helpers/index.js"(e,t){var r=gc(),n=Ql(),i=yc(),a=_c();t.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new n("a function is required");return a(r,i,e)}}}),wc=m({"node_modules/dunder-proto/get.js"(e,t){var r,n=bc(),i=uc();try{r=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!r&&i&&i(Object.prototype,"__proto__"),o=Object,s=o.getPrototypeOf;t.exports=a&&"function"==typeof a.get?n([a.get]):"function"==typeof s&&function(e){return s(null==e?e:o(e))}}}),Tc=m({"node_modules/get-proto/index.js"(e,t){var r=pc(),n=dc(),i=wc();t.exports=r?function(e){return r(e)}:n?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return n(e)}:i?function(e){return i(e)}:null}}),kc=m({"node_modules/hasown/index.js"(e,t){var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,i=gc();t.exports=i.call(r,n)}}),Ac=m({"node_modules/get-intrinsic/index.js"(e,t){var r,n=Zl(),i=Yl(),a=Xl(),o=$l(),s=Kl(),l=Jl(),c=Ql(),u=ec(),h=tc(),f=rc(),p=nc(),d=ic(),m=ac(),g=oc(),y=lc(),v=Function,x=function(e){try{return v('"use strict"; return ('+e+").constructor;")()}catch{}},_=uc(),b=hc(),w=function(){throw new c},T=_?function(){try{return w}catch{try{return _(arguments,"callee").get}catch{return w}}}():w,k=fc()(),A=Tc(),M=dc(),S=pc(),E=vc(),C=yc(),I={},L=typeof Uint8Array>"u"||!A?r:A(Uint8Array),P={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":k&&A?A([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":I,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&A?A(A([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!k||!A?r:A((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!k||!A?r:A((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&A?A(""[Symbol.iterator]()):r,"%Symbol%":k?Symbol:r,"%SyntaxError%":l,"%ThrowTypeError%":T,"%TypedArray%":L,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":C,"%Function.prototype.apply%":E,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":M,"%Math.abs%":h,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":d,"%Math.pow%":m,"%Math.round%":g,"%Math.sign%":y,"%Reflect.getPrototypeOf%":S};if(A)try{null.error}catch(e){z=A(A(e)),P["%Error.prototype%"]=z}var z,D=function e(t){var r;if("%AsyncFunction%"===t)r=x("async function () {}");else if("%GeneratorFunction%"===t)r=x("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=x("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&A&&(r=A(i.prototype))}return P[t]=r,r},O={__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"]},R=gc(),F=kc(),B=R.call(C,Array.prototype.concat),j=R.call(E,Array.prototype.splice),N=R.call(C,String.prototype.replace),U=R.call(C,String.prototype.slice),V=R.call(C,RegExp.prototype.exec),q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,G=function(e,t){var r,n=e;if(F(O,n)&&(n="%"+(r=O[n])[0]+"%"),F(P,n)){var i=P[n];if(i===I&&(i=D(n)),typeof i>"u"&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new l("intrinsic "+e+" does not exist!")};t.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===V(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=U(e,0,1),r=U(e,-1);if("%"===t&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return N(e,q,(function(e,t,r,i){n[n.length]=r?N(i,H,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=G("%"+n+"%",t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(n=u[0],j(r,B([0,1],u)));for(var h=1,f=!0;h<r.length;h+=1){var p=r[h],d=U(p,0,1),m=U(p,-1);if(('"'===d||"'"===d||"`"===d||'"'===m||"'"===m||"`"===m)&&d!==m)throw new l("property names with quotes must have matching quotes");if(("constructor"===p||!f)&&(s=!0),F(P,a="%"+(n+="."+p)+"%"))o=P[a];else if(null!=o){if(!(p in o)){if(!t)throw new c("base intrinsic for "+e+" exists, but the property is not available.");return}if(_&&h+1>=r.length){var g=_(o,p);o=(f=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[p]}else f=F(o,p),o=o[p];f&&!s&&(P[a]=o)}}return o}}}),Mc=m({"node_modules/define-data-property/index.js"(e,t){var r=hc(),n=Jl(),i=Ql(),a=uc();t.exports=function(e,t,o){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],h=!!a&&a(e,t);if(r)r(e,t,{configurable:null===c&&h?h.configurable:!c,enumerable:null===s&&h?h.enumerable:!s,value:o,writable:null===l&&h?h.writable:!l});else{if(!u&&(s||l||c))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=o}}}}),Sc=m({"node_modules/has-property-descriptors/index.js"(e,t){var r=hc(),n=function(){return!!r};n.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch{return!0}},t.exports=n}}),Ec=m({"node_modules/set-function-length/index.js"(e,t){var r=Ac(),n=Mc(),i=Sc()(),a=uc(),o=Ql(),s=r("%Math.floor%");t.exports=function(e,t){if("function"!=typeof e)throw new o("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||s(t)!==t)throw new o("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],l=!0,c=!0;if("length"in e&&a){var u=a(e,"length");u&&!u.configurable&&(l=!1),u&&!u.writable&&(c=!1)}return(l||c||!r)&&(i?n(e,"length",t,!0,!0):n(e,"length",t)),e}}}),Cc=m({"node_modules/call-bind/index.js"(e,t){var r=gc(),n=Ac(),i=Ec(),a=Ql(),o=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||r.call(s,o),c=hc(),u=n("%Math.max%");t.exports=function(e){if("function"!=typeof e)throw new a("a function is required");var t=l(r,s,arguments);return i(t,1+u(0,e.length-(arguments.length-1)),!0)};var h=function(){return l(r,o,arguments)};c?c(t.exports,"apply",{value:h}):t.exports.apply=h}}),Ic=m({"node_modules/call-bind/callBound.js"(e,t){var r=Ac(),n=Cc(),i=n(r("String.prototype.indexOf"));t.exports=function(e,t){var a=r(e,!!t);return"function"==typeof a&&i(e,".prototype.")>-1?n(a):a}}}),Lc=m({"node_modules/is-arguments/index.js"(e,t){var r=Wl()(),n=Ic()("Object.prototype.toString"),i=function(e){return!(r&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===n(e)},a=function(e){return!!i(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==n(e)&&"[object Function]"===n(e.callee)},o=function(){return i(arguments)}();i.isLegacyArguments=a,t.exports=o?i:a}}),Pc=m({"node_modules/is-generator-function/index.js"(e,t){var r,n=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,o=Wl()(),s=Object.getPrototypeOf;t.exports=function(e){if("function"!=typeof e)return!1;if(a.test(i.call(e)))return!0;if(!o)return"[object GeneratorFunction]"===n.call(e);if(!s)return!1;if(typeof r>"u"){var t=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch{}}();r=!!t&&s(t)}return s(e)===r}}}),zc=m({"node_modules/is-callable/index.js"(e,t){var r,n,i=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},a((function(){throw 42}),null,r)}catch(e){e!==n&&(a=null)}else a=null;var o,s=/^\s*class\b/,l=function(e){try{var t=i.call(e);return s.test(t)}catch{return!1}},c=function(e){try{return!l(e)&&(i.call(e),!0)}catch{return!1}},u=Object.prototype.toString,h="function"==typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),p=function(){return!1};"object"==typeof document&&(o=document.all,u.call(o)===u.call(document.all)&&(p=function(e){if((f||!e)&&(typeof e>"u"||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch{}return!1})),t.exports=a?function(e){if(p(e))return!0;if(!e||"function"!=typeof e&&"object"!=typeof e)return!1;try{a(e,null,r)}catch(e){if(e!==n)return!1}return!l(e)&&c(e)}:function(e){if(p(e))return!0;if(!e||"function"!=typeof e&&"object"!=typeof e)return!1;if(h)return c(e);if(l(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&c(e)}}}),Dc=m({"node_modules/for-each/index.js"(e,t){var r=zc(),n=Object.prototype.toString,i=Object.prototype.hasOwnProperty;t.exports=function(e,t,a){if(!r(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=a),"[object Array]"===n.call(e)?function(e,t,r){for(var n=0,a=e.length;n<a;n++)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,o):"string"==typeof e?function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,o):function(e,t,r){for(var n in e)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,o)}}}),Oc=m({"node_modules/available-typed-arrays/index.js"(e,t){var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n=typeof globalThis>"u"?window:globalThis;t.exports=function(){for(var e=[],t=0;t<r.length;t++)"function"==typeof n[r[t]]&&(e[e.length]=r[t]);return e}}}),Rc=m({"node_modules/which-typed-array/index.js"(e,t){var r=Dc(),n=Oc(),i=Cc(),a=Ic(),o=uc(),s=a("Object.prototype.toString"),l=Wl()(),c=typeof globalThis>"u"?window:globalThis,u=n(),h=a("String.prototype.slice"),f=Object.getPrototypeOf,p=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},d={__proto__:null};r(u,l&&o&&f?function(e){var t=new c[e];if(Symbol.toStringTag in t){var r=f(t),n=o(r,Symbol.toStringTag);if(!n){var a=f(r);n=o(a,Symbol.toStringTag)}d["$"+e]=i(n.get)}}:function(e){var t=new c[e],r=t.slice||t.set;r&&(d["$"+e]=i(r))}),t.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!l){var t=h(s(e),8,-1);return p(u,t)>-1?t:"Object"===t&&function(e){var t=!1;return r(d,(function(r,n){if(!t)try{r(e),t=h(n,1)}catch{}})),t}(e)}return o?function(e){var t=!1;return r(d,(function(r,n){if(!t)try{"$"+r(e)===n&&(t=h(n,1))}catch{}})),t}(e):null}}}),Fc=m({"node_modules/is-typed-array/index.js"(e,t){var r=Dc(),n=Oc(),i=Ic(),a=i("Object.prototype.toString"),o=Wl()(),s=uc(),l=typeof globalThis>"u"?window:globalThis,c=n(),u=i("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},h=i("String.prototype.slice"),f={},p=Object.getPrototypeOf;o&&s&&p&&r(c,(function(e){var t=new l[e];if(Symbol.toStringTag in t){var r=p(t),n=s(r,Symbol.toStringTag);if(!n){var i=p(r);n=s(i,Symbol.toStringTag)}f[e]=n.get}})),t.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!o||!(Symbol.toStringTag in e)){var t=h(a(e),8,-1);return u(c,t)>-1}return!!s&&function(e){var t=!1;return r(f,(function(r,n){if(!t)try{t=r.call(e)===n}catch{}})),t}(e)}}}),Bc=m({"node_modules/util/support/types.js"(e){var t=Lc(),r=Pc(),n=Rc(),i=Fc();function a(e){return e.call.bind(e)}var o,s,l=typeof BigInt<"u",c=typeof Symbol<"u",u=a(Object.prototype.toString),h=a(Number.prototype.valueOf),f=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);function d(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch{return!1}}function m(e){return"[object Map]"===u(e)}function g(e){return"[object Set]"===u(e)}function y(e){return"[object WeakMap]"===u(e)}function v(e){return"[object WeakSet]"===u(e)}function x(e){return"[object ArrayBuffer]"===u(e)}function _(e){return!(typeof ArrayBuffer>"u")&&(x.working?x(e):e instanceof ArrayBuffer)}function b(e){return"[object DataView]"===u(e)}function w(e){return!(typeof DataView>"u")&&(b.working?b(e):e instanceof DataView)}l&&(o=a(BigInt.prototype.valueOf)),c&&(s=a(Symbol.prototype.valueOf)),e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=i,e.isPromise=function(e){return typeof Promise<"u"&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},e.isArrayBufferView=function(e){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(e):i(e)||w(e)},e.isUint8Array=function(e){return"Uint8Array"===n(e)},e.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===n(e)},e.isUint16Array=function(e){return"Uint16Array"===n(e)},e.isUint32Array=function(e){return"Uint32Array"===n(e)},e.isInt8Array=function(e){return"Int8Array"===n(e)},e.isInt16Array=function(e){return"Int16Array"===n(e)},e.isInt32Array=function(e){return"Int32Array"===n(e)},e.isFloat32Array=function(e){return"Float32Array"===n(e)},e.isFloat64Array=function(e){return"Float64Array"===n(e)},e.isBigInt64Array=function(e){return"BigInt64Array"===n(e)},e.isBigUint64Array=function(e){return"BigUint64Array"===n(e)},m.working=typeof Map<"u"&&m(new Map),e.isMap=function(e){return!(typeof Map>"u")&&(m.working?m(e):e instanceof Map)},g.working=typeof Set<"u"&&g(new Set),e.isSet=function(e){return!(typeof Set>"u")&&(g.working?g(e):e instanceof Set)},y.working=typeof WeakMap<"u"&&y(new WeakMap),e.isWeakMap=function(e){return!(typeof WeakMap>"u")&&(y.working?y(e):e instanceof WeakMap)},v.working=typeof WeakSet<"u"&&v(new WeakSet),e.isWeakSet=function(e){return v(e)},x.working=typeof ArrayBuffer<"u"&&x(new ArrayBuffer),e.isArrayBuffer=_,b.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&b(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=w;var T=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function k(e){return"[object SharedArrayBuffer]"===u(e)}function A(e){return!(typeof T>"u")&&(typeof k.working>"u"&&(k.working=k(new T)),k.working?k(e):e instanceof T)}function M(e){return d(e,h)}function S(e){return d(e,f)}function E(e){return d(e,p)}function C(e){return l&&d(e,o)}function I(e){return c&&d(e,s)}e.isSharedArrayBuffer=A,e.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},e.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},e.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},e.isGeneratorObject=function(e){return"[object Generator]"===u(e)},e.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},e.isNumberObject=M,e.isStringObject=S,e.isBooleanObject=E,e.isBigIntObject=C,e.isSymbolObject=I,e.isBoxedPrimitive=function(e){return M(e)||S(e)||E(e)||C(e)||I(e)},e.isAnyArrayBuffer=function(e){return typeof Uint8Array<"u"&&(_(e)||A(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))}}),jc=m({"node_modules/util/support/isBufferBrowser.js"(e,t){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}}}),Nc=m({"(disabled):node_modules/util/util.js"(e){var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},r=/%[sdj%]/g;e.format=function(e){if(!y(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(o(arguments[n]));return t.join(" ")}n=1;for(var i=arguments,a=i.length,s=String(e).replace(r,(function(e){if("%%"===e)return"%";if(n>=a)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch{return"[Circular]"}default:return e}})),l=i[n];n<a;l=i[++n])m(l)||!_(l)?s+=" "+l:s+=" "+o(l);return s},e.deprecate=function(t,r){if(typeof c<"u"&&!0===c.noDeprecation)return t;if(typeof c>"u")return function(){return e.deprecate(t,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(c.throwDeprecation)throw new Error(r);c.traceDeprecation?console.trace(r):console.error(r),n=!0}return t.apply(this,arguments)}};var n,i={},a=/^$/;function o(t,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&e._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),u(n,t,n.depth)}function s(e,t){var r=o.styles[t];return r?"["+o.colors[r][0]+"m"+e+"["+o.colors[r][1]+"m":e}function l(e,t){return e}function u(t,r,n){if(t.customInspect&&r&&T(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return y(i)||(i=u(t,i,n)),i}var a=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(t,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(r)),w(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(r);if(0===o.length){if(T(r)){var l=r.name?": "+r.name:"";return t.stylize("[Function"+l+"]","special")}if(x(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return t.stylize(Date.prototype.toString.call(r),"date");if(w(r))return h(r)}var c,_="",k=!1,A=["{","}"];return p(r)&&(k=!0,A=["[","]"]),T(r)&&(_=" [Function"+(r.name?": "+r.name:"")+"]"),x(r)&&(_=" "+RegExp.prototype.toString.call(r)),b(r)&&(_=" "+Date.prototype.toUTCString.call(r)),w(r)&&(_=" "+h(r)),0!==o.length||k&&0!=r.length?n<0?x(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=k?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o<s;++o)S(t,String(o))?a.push(f(e,t,r,n,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(f(e,t,r,n,i,!0))})),a}(t,r,n,s,o):o.map((function(e){return f(t,r,n,s,e,k)})),t.seen.pop(),function(e,t,r){var n=e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);return n>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,_,A)):A[0]+_+A[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),S(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=m(r)?u(e,l.value,null):u(e,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),v(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).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 p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function x(e){return _(e)&&"[object RegExp]"===k(e)}function _(e){return"object"==typeof e&&null!==e}function b(e){return _(e)&&"[object Date]"===k(e)}function w(e){return _(e)&&("[object Error]"===k(e)||e instanceof Error)}function T(e){return"function"==typeof e}function k(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),e.debuglog=function(t){if(t=t.toUpperCase(),!i[t])if(a.test(t)){var r=c.pid;i[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else i[t]=function(){};return i[t]},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"},e.types=Bc(),e.isArray=p,e.isBoolean=d,e.isNull=m,e.isNullOrUndefined=function(e){return null==e},e.isNumber=g,e.isString=y,e.isSymbol=function(e){return"symbol"==typeof e},e.isUndefined=v,e.isRegExp=x,e.types.isRegExp=x,e.isObject=_,e.isDate=b,e.types.isDate=b,e.isError=w,e.types.isNativeError=w,e.isFunction=T,e.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||typeof e>"u"},e.isBuffer=jc();var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.log=function(){var t,r;console.log("%s - %s",(r=[A((t=new Date).getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":"),[t.getDate(),M[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=Nl(),e._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var E=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function C(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}e.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(E&&e[E]){var r;if("function"!=typeof(r=e[E]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,E,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),E&&Object.defineProperty(r,E,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,t(e))},e.promisify.custom=E,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var n=t.pop();if("function"!=typeof n)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return n.apply(i,arguments)};e.apply(this,t).then((function(e){c.nextTick(a.bind(null,null,e))}),(function(e){c.nextTick(C.bind(null,e,a))}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,t(e)),r}}}),Uc=m({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(e,t){function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=Hl().Buffer,o=Nc().inspect,s=o&&o.custom||"inspect";function l(e,t,r){a.prototype.copy.call(e,t,r)}t.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}return function(e,t){t&&i(e.prototype,t)}(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};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?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(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t=a.allocUnsafe(e>>>0),r=this.head,n=0;r;)l(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,a=e>i.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0==(e-=a)){a===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:s,value:function(e,t){return o(this,function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){n(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}]),e}()}}),Vc=m({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(e,t){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var a=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,c.nextTick(i,this,e)):c.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?a._writableState?a._writableState.errorEmitted?c.nextTick(n,a):(a._writableState.errorEmitted=!0,c.nextTick(r,a,e)):c.nextTick(r,a,e):t?(c.nextTick(n,a),t(e)):c.nextTick(n,a)})),this)},undestroy:function(){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)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}}),qc=m({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(e,t){var r={};function n(e,t,n){n||(n=Error);var i=function(e){function r(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(r,e),r}(n);i.prototype.name=n.name,i.prototype.code=e,r[e]=i}function i(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,a;if("string"==typeof t&&function(e,t){return e.substr(0,4)===t}(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))a="The ".concat(e," ").concat(n," ").concat(i(t,"type"));else{var o=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+1>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";a='The "'.concat(e,'" ').concat(o," ").concat(n," ").concat(i(t,"type"))}return a+". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r}}),Hc=m({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(e,t){var r=qc().codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}}}),Gc=m({"node_modules/util-deprecate/browser.js"(e,t){function r(e){try{if(!window.localStorage)return!1}catch{return!1}var t=window.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}}),Wc=m({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(e,t){function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var r=e.entry;for(e.entry=null;r;){var n=r.callback;t.pendingcb--,n(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}var n;t.exports=k,k.WritableState=T;var i,a={deprecate:Gc()},o=Ul(),s=Hl().Buffer,l=window.Uint8Array||function(){},u=Vc(),h=Hc().getHighWaterMark,f=qc().codes,p=f.ERR_INVALID_ARG_TYPE,d=f.ERR_METHOD_NOT_IMPLEMENTED,m=f.ERR_MULTIPLE_CALLBACK,g=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,x=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,b=u.errorOrDestroy;function w(){}function T(e,t,i){n=n||Zc(),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(c.nextTick(i,n),c.nextTick(I,e,t),e._writableState.errorEmitted=!0,b(e,n)):(i(n),e._writableState.errorEmitted=!0,b(e,n),I(e,t))}(e,r,n,t,i);else{var a=E(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&S(e,r),n?c.nextTick(M,e,r,a,i):M(e,r,a,i)}}(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=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function k(e){var t=this instanceof(n=n||Zc());if(!t&&!i.call(k,this))return new k(e);this._writableState=new T(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function A(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function M(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),I(e,t)}function S(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,a=new Array(i),o=t.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)a[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;a.allBuffers=l,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 r(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,h=n.callback;if(A(e,t,!1,t.objectMode?1:c.length,c,u,h),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function C(e,t){e._final((function(r){t.pendingcb--,r&&b(e,r),t.prefinished=!0,e.emit("prefinish"),I(e,t)}))}function I(e,t){var r=E(t);if(r&&(function(e,t){!t.prefinished&&!t.finalCalled&&("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,c.nextTick(C,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}Nl()(k,o),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return!!i.call(this,e)||this===k&&e&&e._writableState instanceof T}})):i=function(e){return e instanceof this},k.prototype.pipe=function(){b(this,new g)},k.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&function(e){return s.isBuffer(e)||e instanceof l}(e);return a&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=w),n.ending?function(e,t){var r=new x;b(e,r),c.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var i;return null===r?i=new v:"string"!=typeof r&&!t.objectMode&&(i=new p("chunk",["string","Buffer"],r)),!i||(b(e,i),c.nextTick(n,i),!1)}(this,n,e,r))&&(n.pendingcb++,i=function(e,t,r,n,i,a){if(!r){var o=function(e,t,r){return!e.objectMode&&!1!==e.decodeStrings&&"string"==typeof t&&(t=s.from(t,r)),t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var l=t.objectMode?1:n.length;t.length+=l;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,l,n,i,a);return c}(this,n,a,e,t,r)),i},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&S(this,e))},k.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new d("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,I(e,t),r&&(t.finished?c.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=u.destroy,k.prototype._undestroy=u.undestroy,k.prototype._destroy=function(e,t){t(e)}}}),Zc=m({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js"(e,t){var r=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=l;var n,i,a,o=Qc(),s=Wc();for(Nl()(l,o),n=r(s.prototype),a=0;a<n.length;a++)i=n[a],l.prototype[i]||(l.prototype[i]=s.prototype[i]);function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||c.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}}),Yc=m({"node_modules/safe-buffer/index.js"(e,t){var r=Hl(),n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=a),a.prototype=Object.create(n.prototype),i(n,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}}),Xc=m({"node_modules/stream-browserify/node_modules/string_decoder/lib/string_decoder.js"(e){var t=Yc().Buffer,r=t.isEncoding||function(e){switch((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 n(e){var n;switch(this.encoding=function(e){var n=function(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}}(e);if("string"!=typeof n&&(t.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return n||e}(e),this.encoding){case"utf16le":this.text=o,this.end=s,n=4;break;case"utf8":this.fillLast=a,n=4;break;case"base64":this.text=l,this.end=c,n=3;break;default:return this.write=u,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}function i(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"<22>";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"<22>";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"<22>"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function o(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}e.StringDecoder=n,n.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},n.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"<22>":t},n.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var a=i(t[n]);return a>=0?(a>0&&(e.lastNeed=a-1),a):--n<r||-2===a?0:(a=i(t[n]))>=0?(a>0&&(e.lastNeed=a-2),a):--n<r||-2===a?0:(a=i(t[n]))>=0?(a>0&&(2===a?a=0:e.lastNeed=a-3),a):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},n.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}}}),$c=m({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(e,t){var r=qc().codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function e(t,i,a){if("function"==typeof i)return e(t,null,i);i||(i={}),a=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(a||n);var o=i.readable||!1!==i.readable&&t.readable,s=i.writable||!1!==i.writable&&t.writable,l=function(){t.writable||u()},c=t._writableState&&t._writableState.finished,u=function(){s=!1,c=!0,o||a.call(t)},h=t._readableState&&t._readableState.endEmitted,f=function(){o=!1,h=!0,s||a.call(t)},p=function(e){a.call(t,e)},d=function(){var e;return o&&!h?((!t._readableState||!t._readableState.ended)&&(e=new r),a.call(t,e)):s&&!c?((!t._writableState||!t._writableState.ended)&&(e=new r),a.call(t,e)):void 0},m=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",d),t.req?m():t.on("request",m)):s&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",f),t.on("finish",u),!1!==i.error&&t.on("error",p),t.on("close",d),function(){t.removeListener("complete",u),t.removeListener("abort",d),t.removeListener("request",m),t.req&&t.req.removeListener("finish",u),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",u),t.removeListener("end",f),t.removeListener("error",p),t.removeListener("close",d)}}}}),Kc=m({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(e,t){var r;function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=$c(),a=Symbol("lastResolve"),o=Symbol("lastReject"),s=Symbol("error"),l=Symbol("ended"),u=Symbol("lastPromise"),h=Symbol("handlePromise"),f=Symbol("stream");function p(e,t){return{value:e,done:t}}function d(e){var t=e[a];if(null!==t){var r=e[f].read();null!==r&&(e[u]=null,e[a]=null,e[o]=null,t(p(r,!1)))}}function m(e){c.nextTick(d,e)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((n(r={get stream(){return this[f]},next:function(){var e=this,t=this[s];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(p(void 0,!0));if(this[f].destroyed)return new Promise((function(t,r){c.nextTick((function(){e[s]?r(e[s]):t(p(void 0,!0))}))}));var r,n=this[u];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[l]?r(p(void 0,!0)):t[h](r,n)}),n)}}(n,this));else{var i=this[f].read();if(null!==i)return Promise.resolve(p(i,!1));r=new Promise(this[h])}return this[u]=r,r}},Symbol.asyncIterator,(function(){return this})),n(r,"return",(function(){var e=this;return new Promise((function(t,r){e[f].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),r),g);t.exports=function(e){var t,r=Object.create(y,(n(t={},f,{value:e,writable:!0}),n(t,a,{value:null,writable:!0}),n(t,o,{value:null,writable:!0}),n(t,s,{value:null,writable:!0}),n(t,l,{value:e._readableState.endEmitted,writable:!0}),n(t,h,{value:function(e,t){var n=r[f].read();n?(r[u]=null,r[a]=null,r[o]=null,e(p(n,!1))):(r[a]=e,r[o]=t)},writable:!0}),t));return r[u]=null,i(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[o];return null!==t&&(r[u]=null,r[a]=null,r[o]=null,t(e)),void(r[s]=e)}var n=r[a];null!==n&&(r[u]=null,r[a]=null,r[o]=null,n(p(void 0,!0))),r[l]=!0})),e.on("readable",m.bind(null,r)),r}}}),Jc=m({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/from-browser.js"(e,t){t.exports=function(){throw new Error("Readable.from is not available in the browser")}}}),Qc=m({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js"(e,t){var r;t.exports=k,k.ReadableState=T,pt().EventEmitter;var n,i=function(e,t){return e.listeners(t).length},a=Ul(),o=Hl().Buffer,s=window.Uint8Array||function(){},l=Nc();n=l&&l.debuglog?l.debuglog("stream"):function(){};var u,h,f,p=Uc(),d=Vc(),m=Hc().getHighWaterMark,g=qc().codes,y=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,x=g.ERR_METHOD_NOT_IMPLEMENTED,_=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;Nl()(k,a);var b=d.errorOrDestroy,w=["error","close","destroy","pause","resume"];function T(e,t,n){r=r||Zc(),e=e||{},"boolean"!=typeof n&&(n=t instanceof r),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",n),this.buffer=new p,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=!1!==e.emitClose,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&&(u||(u=Xc().StringDecoder),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function k(e){if(r=r||Zc(),!(this instanceof k))return new k(e);var t=this instanceof r;this._readableState=new T(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function A(e,t,r,i,a){n("readableAddChunk",t);var l,c=e._readableState;if(null===t)c.reading=!1,function(e,t){if(n("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?C(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,I(e)))}}(e,c);else if(a||(l=function(e,t){var r;return!function(e){return o.isBuffer(e)||e instanceof s}(t)&&"string"!=typeof t&&void 0!==t&&!e.objectMode&&(r=new y("chunk",["string","Buffer","Uint8Array"],t)),r}(c,t)),l)b(e,l);else if(c.objectMode||t&&t.length>0)if("string"!=typeof t&&!c.objectMode&&Object.getPrototypeOf(t)!==o.prototype&&(t=function(e){return o.from(e)}(t)),i)c.endEmitted?b(e,new _):M(e,c,t,!0);else if(c.ended)b(e,new v);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(t=c.decoder.write(t),c.objectMode||0!==t.length?M(e,c,t,!1):L(e,c)):M(e,c,t,!1)}else i||(c.reading=!1,L(e,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function M(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&C(e)),L(e,t)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=d.destroy,k.prototype._undestroy=d.undestroy,k.prototype._destroy=function(e,t){t(e)},k.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=o.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},k.prototype.unshift=function(e){return A(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){u||(u=Xc().StringDecoder);var t=new u(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var S=1073741824;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=S?e=S:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function C(e){var t=e._readableState;n("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(n("emitReadable",t.flowing),t.emittedReadable=!0,c.nextTick(I,e))}function I(e){var t=e._readableState;n("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,R(e)}function L(e,t){t.readingMore||(t.readingMore=!0,c.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(n("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}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 D(e){n("readable nexttick read 0"),e.read(0)}function O(e,t){n("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(n("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function B(e){var t=e._readableState;n("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,c.nextTick(j,t,e))}function j(e,t){if(n("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function N(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}k.prototype.read=function(e){n("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return n("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):C(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&B(this),null;var i,a=t.needReadable;return n("need readable",a),(0===t.length||t.length-e<t.highWaterMark)&&n("length less than watermark",a=!0),t.ended||t.reading?n("reading or ended",a=!1):a&&(n("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(i=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&B(this)),null!==i&&this.emit("data",i),i},k.prototype._read=function(e){b(this,new x("_read()"))},k.prototype.pipe=function(e,t){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,t);var o=t&&!1===t.end||e===c.stdout||e===c.stderr?m:s;function s(){n("onend"),e.end()}a.endEmitted?c.nextTick(o):r.once("end",o),e.on("unpipe",(function t(i,o){n("onunpipe"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,n("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",l),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",m),r.removeListener("data",h),u=!0,a.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&l())}));var l=function(e){return function(){var t=e._readableState;n("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,R(e))}}(r);e.on("drain",l);var u=!1;function h(t){n("ondata");var i=e.write(t);n("dest.write",i),!1===i&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==N(a.pipes,e))&&!u&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),r.pause())}function f(t){n("onerror",t),m(),e.removeListener("error",f),0===i(e,"error")&&b(e,t)}function p(){e.removeListener("finish",d),m()}function d(){n("onfinish"),e.removeListener("close",p),m()}function m(){n("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",p),e.once("finish",d),e.emit("pipe",r),a.flowing||(n("pipe resume"),r.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=N(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},k.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,n("on readable",i.length,i.reading),i.length?C(this):i.reading||c.nextTick(D,this)),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&c.nextTick(z,this),r},k.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&c.nextTick(z,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(n("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,c.nextTick(O,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var a in e.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(a){n("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a||!(r.objectMode||a&&a.length)||t.push(a)||(i=!0,e.pause())})),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var o=0;o<w.length;o++)e.on(w[o],this.emit.bind(this,w[o]));return this._read=function(t){n("wrapped _read",t),i&&(i=!1,e.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=Kc()),h(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=F,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(e,t){return void 0===f&&(f=Jc()),f(k,e,t)})}}),eu=m({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js"(e,t){t.exports=c;var r=qc().codes,n=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=r.ERR_TRANSFORM_WITH_LENGTH_0,s=Zc();function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);s.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",u)}function u(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new o;if(e._transformState.transforming)throw new a;return e.push(null)}Nl()(c,s),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new n("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){s.prototype._destroy.call(this,e,(function(e){t(e)}))}}}),tu=m({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js"(e,t){t.exports=n;var r=eu();function n(e){if(!(this instanceof n))return new n(e);r.call(this,e)}Nl()(n,r),n.prototype._transform=function(e,t,r){r(null,e)}}}),ru=m({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/pipeline.js"(e,t){var r,n=qc().codes,i=n.ERR_MISSING_ARGS,a=n.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function s(e){e()}function l(e,t){return e.pipe(t)}t.exports=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var c=function(e){return e.length&&"function"==typeof e[e.length-1]?e.pop():o}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new i("streams");var u,h=t.map((function(e,n){var i=n<t.length-1;return function(e,t,n,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var o=!1;e.on("close",(function(){o=!0})),void 0===r&&(r=$c()),r(e,{readable:t,writable:n},(function(e){if(e)return i(e);o=!0,i()}));var s=!1;return function(t){if(!o&&!s){if(s=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e))return e.abort();if("function"==typeof e.destroy)return e.destroy();i(t||new a("pipe"))}}}(e,i,n>0,(function(e){u||(u=e),e&&h.forEach(s),!i&&(h.forEach(s),c(u))}))}));return t.reduce(l)}}}),nu=m({"node_modules/stream-browserify/index.js"(e,t){t.exports=n;var r=pt().EventEmitter;function n(){r.call(this)}Nl()(n,r),n.Readable=Qc(),n.Writable=Wc(),n.Duplex=Zc(),n.Transform=eu(),n.PassThrough=tu(),n.finished=$c(),n.pipeline=ru(),n.Stream=n,n.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",a),!e._isStdio&&(!t||!1!==t.end)&&(n.on("end",s),n.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(u(),0===r.listenerCount(this,"error"))throw e}function u(){n.removeListener("data",i),e.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",l),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),e.removeListener("close",u)}return n.on("error",c),e.on("error",c),n.on("end",u),n.on("close",u),e.on("close",u),e.emit("pipe",n),e}}}),iu=m({"node_modules/util/util.js"(e){var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},r=/%[sdj%]/g;e.format=function(e){if(!y(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(o(arguments[n]));return t.join(" ")}n=1;for(var i=arguments,a=i.length,s=String(e).replace(r,(function(e){if("%%"===e)return"%";if(n>=a)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch{return"[Circular]"}default:return e}})),l=i[n];n<a;l=i[++n])m(l)||!_(l)?s+=" "+l:s+=" "+o(l);return s},e.deprecate=function(t,r){if(typeof c<"u"&&!0===c.noDeprecation)return t;if(typeof c>"u")return function(){return e.deprecate(t,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(c.throwDeprecation)throw new Error(r);c.traceDeprecation?console.trace(r):console.error(r),n=!0}return t.apply(this,arguments)}};var n,i={},a=/^$/;function o(t,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&e._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),u(n,t,n.depth)}function s(e,t){var r=o.styles[t];return r?"["+o.colors[r][0]+"m"+e+"["+o.colors[r][1]+"m":e}function l(e,t){return e}function u(t,r,n){if(t.customInspect&&r&&T(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return y(i)||(i=u(t,i,n)),i}var a=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(t,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(r)),w(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(r);if(0===o.length){if(T(r)){var l=r.name?": "+r.name:"";return t.stylize("[Function"+l+"]","special")}if(x(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return t.stylize(Date.prototype.toString.call(r),"date");if(w(r))return h(r)}var c,_="",k=!1,A=["{","}"];return p(r)&&(k=!0,A=["[","]"]),T(r)&&(_=" [Function"+(r.name?": "+r.name:"")+"]"),x(r)&&(_=" "+RegExp.prototype.toString.call(r)),b(r)&&(_=" "+Date.prototype.toUTCString.call(r)),w(r)&&(_=" "+h(r)),0!==o.length||k&&0!=r.length?n<0?x(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=k?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o<s;++o)S(t,String(o))?a.push(f(e,t,r,n,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(f(e,t,r,n,i,!0))})),a}(t,r,n,s,o):o.map((function(e){return f(t,r,n,s,e,k)})),t.seen.pop(),function(e,t,r){var n=e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);return n>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,_,A)):A[0]+_+A[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),S(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=m(r)?u(e,l.value,null):u(e,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),v(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).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 p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function x(e){return _(e)&&"[object RegExp]"===k(e)}function _(e){return"object"==typeof e&&null!==e}function b(e){return _(e)&&"[object Date]"===k(e)}function w(e){return _(e)&&("[object Error]"===k(e)||e instanceof Error)}function T(e){return"function"==typeof e}function k(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),e.debuglog=function(t){if(t=t.toUpperCase(),!i[t])if(a.test(t)){var r=c.pid;i[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else i[t]=function(){};return i[t]},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"},e.types=Bc(),e.isArray=p,e.isBoolean=d,e.isNull=m,e.isNullOrUndefined=function(e){return null==e},e.isNumber=g,e.isString=y,e.isSymbol=function(e){return"symbol"==typeof e},e.isUndefined=v,e.isRegExp=x,e.types.isRegExp=x,e.isObject=_,e.isDate=b,e.types.isDate=b,e.isError=w,e.types.isNativeError=w,e.isFunction=T,e.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||typeof e>"u"},e.isBuffer=jc();var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.log=function(){var t,r;console.log("%s - %s",(r=[A((t=new Date).getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":"),[t.getDate(),M[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=Nl(),e._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var E=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function C(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}e.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(E&&e[E]){var r;if("function"!=typeof(r=e[E]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,E,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),E&&Object.defineProperty(r,E,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,t(e))},e.promisify.custom=E,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var n=t.pop();if("function"!=typeof n)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return n.apply(i,arguments)};e.apply(this,t).then((function(e){c.nextTick(a.bind(null,null,e))}),(function(e){c.nextTick(C.bind(null,e,a))}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,t(e)),r}}}),au=m({"node_modules/assert/build/internal/errors.js"(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){return(n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var a,o,s={};function l(e,t,a){a||(a=Error);var o=function(a){!function(e,t){if("function"!=typeof t&&null!==t)throw new 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&&n(e,t)}(s,a);var o=function(e){var t=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,a=i(e);if(t){var o=i(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}(s);function s(r,n,i){var a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),a=o.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i)),a.code=e,a}return function(e){return Object.defineProperty(e,"prototype",{writable:!1}),e}(s)}(a);s[e]=o}function c(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",(function(e,t,n){var i,o;if(void 0===a&&(a=wu()),a("string"==typeof e,"'name' must be a string"),"string"==typeof t&&function(e,t){return e.substr(0,4)===t}(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))o="The ".concat(e," ").concat(i," ").concat(c(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+1>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";o='The "'.concat(e,'" ').concat(s," ").concat(i," ").concat(c(t,"type"))}return o+". Received type ".concat(r(n))}),TypeError),l("ERR_INVALID_ARG_VALUE",(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===o&&(o=iu());var n=o.inspect(t);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(r,". Received ").concat(n)}),TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",(function(e,t,n){var i;return i=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(r(n)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),l("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];void 0===a&&(a=wu()),a(t.length>0,"At least one arg needs to be specified");var n="The ",i=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),i){case 1:n+="".concat(t[0]," argument");break;case 2:n+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:n+=t.slice(0,i-1).join(", "),n+=", and ".concat(t[i-1]," arguments")}return"".concat(n," must be specified")}),TypeError),t.exports.codes=s}}),ou=m({"node_modules/assert/build/internal/assert/assertion_error.js"(e,t){function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function o(e){var t=function(e){if("object"!==m(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===m(t)?t:String(t)}function s(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return h(e,arguments,d(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,e)},u(e)}function h(e,t,r){return(h=f()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&p(i,r.prototype),i}).apply(null,arguments)}function f(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function p(e,t){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var g=iu().inspect,y=au().codes.ERR_INVALID_ARG_TYPE;function v(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var x="",_="",b="",w="",T={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:"};function k(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function A(e){return g(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var M=function(e,t){!function(e,t){if("function"!=typeof t&&null!==t)throw new 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&&p(e,t)}(i,e);var r=function(e){var t=f();return function(){var r,n=d(e);if(t){var i=d(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return s(this,r)}}(i);function i(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),"object"!==m(e)||null===e)throw new y("options","Object",e);var n=e.message,a=e.operator,o=e.stackStartFn,u=e.actual,h=e.expected,f=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=n)t=r.call(this,String(n));else if(c.stderr&&c.stderr.isTTY&&(c.stderr&&c.stderr.getColorDepth&&1!==c.stderr.getColorDepth()?(x="[34m",_="[32m",w="[39m",b="[31m"):(x="",_="",w="",b="")),"object"===m(u)&&null!==u&&"object"===m(h)&&null!==h&&"stack"in u&&u instanceof Error&&"stack"in h&&h instanceof Error&&(u=k(u),h=k(h)),"deepStrictEqual"===a||"strictEqual"===a)t=r.call(this,function(e,t,r){var n="",i="",a=0,o="",s=!1,l=A(e),u=l.split("\n"),h=A(t).split("\n"),f=0,p="";if("strictEqual"===r&&"object"===m(e)&&"object"===m(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===h.length&&u[0]!==h[0]){var d=u[0].length+h[0].length;if(d<=10){if(!("object"===m(e)&&null!==e||"object"===m(t)&&null!==t||0===e&&0===t))return"".concat(T[r],"\n\n")+"".concat(u[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&d<(c.stderr&&c.stderr.isTTY?c.stderr.columns:80)){for(;u[0][f]===h[0][f];)f++;f>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",f),"^"),f=0)}}for(var g=u[u.length-1],y=h[h.length-1];g===y&&(f++<2?o="\n ".concat(g).concat(o):n=g,u.pop(),h.pop(),0!==u.length&&0!==h.length);)g=u[u.length-1],y=h[h.length-1];var k=Math.max(u.length,h.length);if(0===k){var M=l.split("\n");if(M.length>30)for(M[26]="".concat(x,"...").concat(w);M.length>27;)M.pop();return"".concat(T.notIdentical,"\n\n").concat(M.join("\n"),"\n")}f>3&&(o="\n".concat(x,"...").concat(w).concat(o),s=!0),""!==n&&(o="\n ".concat(n).concat(o),n="");var S=0,E=T[r]+"\n".concat(_,"+ actual").concat(w," ").concat(b,"- expected").concat(w),C=" ".concat(x,"...").concat(w," Lines skipped");for(f=0;f<k;f++){var I=f-a;if(u.length<f+1)I>1&&f>2&&(I>4?(i+="\n".concat(x,"...").concat(w),s=!0):I>3&&(i+="\n ".concat(h[f-2]),S++),i+="\n ".concat(h[f-1]),S++),a=f,n+="\n".concat(b,"-").concat(w," ").concat(h[f]),S++;else if(h.length<f+1)I>1&&f>2&&(I>4?(i+="\n".concat(x,"...").concat(w),s=!0):I>3&&(i+="\n ".concat(u[f-2]),S++),i+="\n ".concat(u[f-1]),S++),a=f,i+="\n".concat(_,"+").concat(w," ").concat(u[f]),S++;else{var L=h[f],P=u[f],z=P!==L&&(!v(P,",")||P.slice(0,-1)!==L);z&&v(L,",")&&L.slice(0,-1)===P&&(z=!1,P+=","),z?(I>1&&f>2&&(I>4?(i+="\n".concat(x,"...").concat(w),s=!0):I>3&&(i+="\n ".concat(u[f-2]),S++),i+="\n ".concat(u[f-1]),S++),a=f,i+="\n".concat(_,"+").concat(w," ").concat(P),n+="\n".concat(b,"-").concat(w," ").concat(L),S+=2):(i+=n,n="",(1===I||0===f)&&(i+="\n ".concat(P),S++))}if(S>20&&f<k-2)return"".concat(E).concat(C,"\n").concat(i,"\n").concat(x,"...").concat(w).concat(n,"\n")+"".concat(x,"...").concat(w)}return"".concat(E).concat(s?C:"","\n").concat(i).concat(n).concat(o).concat(p)}(u,h,a));else if("notDeepStrictEqual"===a||"notStrictEqual"===a){var p=T[a],d=A(u).split("\n");if("notStrictEqual"===a&&"object"===m(u)&&null!==u&&(p=T.notStrictEqualObject),d.length>30)for(d[26]="".concat(x,"...").concat(w);d.length>27;)d.pop();t=1===d.length?r.call(this,"".concat(p," ").concat(d[0])):r.call(this,"".concat(p,"\n\n").concat(d.join("\n"),"\n"))}else{var g=A(u),M="",S=T[a];"notDeepEqual"===a||"notEqual"===a?(g="".concat(T[a],"\n\n").concat(g)).length>1024&&(g="".concat(g.slice(0,1021),"...")):(M="".concat(A(h)),g.length>512&&(g="".concat(g.slice(0,509),"...")),M.length>512&&(M="".concat(M.slice(0,509),"...")),"deepEqual"===a||"equal"===a?g="".concat(S,"\n\n").concat(g,"\n\nshould equal\n\n"):M=" ".concat(a," ").concat(M)),t=r.call(this,"".concat(g).concat(M))}return Error.stackTraceLimit=f,t.generatedMessage=!n,Object.defineProperty(l(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=u,t.expected=h,t.operator=a,Error.captureStackTrace&&Error.captureStackTrace(l(t),o),t.stack,t.name="AssertionError",s(t)}return function(e,t){t&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1})}(i,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return g(this,n(n({},t),{},{customInspect:!1,depth:0}))}}]),i}(u(Error),g.custom);t.exports=M}}),su=m({"node_modules/object-keys/isArguments.js"(e,t){var r=Object.prototype.toString;t.exports=function(e){var t=r.call(e),n="[object Arguments]"===t;return n||(n="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===r.call(e.callee)),n}}}),lu=m({"node_modules/object-keys/implementation.js"(e,t){var r,n,i,a,o,s,l,c,u,h,f,p;Object.keys||(n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=su(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),l=o.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(e){var t=e.constructor;return t&&t.prototype===e},h={$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(!h["$"+e]&&n.call(window,e)&&null!==window[e]&&"object"==typeof window[e])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}},r=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===i.call(e),o=a(e),u=t&&"[object String]"===i.call(e),h=[];if(!t&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var f=l&&r;if(u&&e.length>0&&!n.call(e,0))for(var d=0;d<e.length;++d)h.push(String(d));if(o&&e.length>0)for(var m=0;m<e.length;++m)h.push(String(m));else for(var g in e)(!f||"prototype"!==g)&&n.call(e,g)&&h.push(String(g));if(s)for(var y=p(e),v=0;v<c.length;++v)(!y||"constructor"!==c[v])&&n.call(e,c[v])&&h.push(c[v]);return h}),t.exports=r}}),cu=m({"node_modules/object-keys/index.js"(e,t){var r=Array.prototype.slice,n=su(),i=Object.keys,a=i?function(e){return i(e)}:lu(),o=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return n(e)?o(r.call(e)):o(e)})}else Object.keys=a;return Object.keys||a},t.exports=a}}),uu=m({"node_modules/object.assign/implementation.js"(e,t){var r=cu(),n=Gl()(),i=Ic(),a=Object,o=i("Array.prototype.push"),s=i("Object.prototype.propertyIsEnumerable"),l=n?Object.getOwnPropertySymbols:null;t.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var i=a(e);if(1===arguments.length)return i;for(var c=1;c<arguments.length;++c){var u=a(arguments[c]),h=r(u),f=n&&(Object.getOwnPropertySymbols||l);if(f)for(var p=f(u),d=0;d<p.length;++d){var m=p[d];s(u,m)&&o(h,m)}for(var g=0;g<h.length;++g){var y=h[g];if(s(u,y)){var v=u[y];i[y]=v}}}return i}}}),hu=m({"node_modules/object.assign/polyfill.js"(e,t){var r=uu();t.exports=function(){return!Object.assign||function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var i=Object.assign({},r),a="";for(var o in i)a+=o;return e!==a}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch{return"y"===e[1]}return!1}()?r:Object.assign}}}),fu=m({"node_modules/object-is/implementation.js"(e,t){var r=function(e){return e!=e};t.exports=function(e,t){return 0===e&&0===t?1/e==1/t:!!(e===t||r(e)&&r(t))}}}),pu=m({"node_modules/object-is/polyfill.js"(e,t){var r=fu();t.exports=function(){return"function"==typeof Object.is?Object.is:r}}}),du=m({"node_modules/define-properties/index.js"(e,t){var r=cu(),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,o=Object.defineProperty,s=Sc()(),l=o&&s,c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if(!function(e){return"function"==typeof e&&"[object Function]"===i.call(e)}(n)||!n())return;l?o(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r},u=function(e,t){var i=arguments.length>2?arguments[2]:{},o=r(t);n&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)c(e,o[s],t[o[s]],i[o[s]])};u.supportsDescriptors=!!l,t.exports=u}}),mu=m({"node_modules/object-is/shim.js"(e,t){var r=pu(),n=du();t.exports=function(){var e=r();return n(Object,{is:e},{is:function(){return Object.is!==e}}),e}}}),gu=m({"node_modules/object-is/index.js"(e,t){var r=du(),n=Cc(),i=fu(),a=pu(),o=mu(),s=n(a(),Object);r(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s}}),yu=m({"node_modules/is-nan/implementation.js"(e,t){t.exports=function(e){return e!=e}}}),vu=m({"node_modules/is-nan/polyfill.js"(e,t){var r=yu();t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:r}}}),xu=m({"node_modules/is-nan/shim.js"(e,t){var r=du(),n=vu();t.exports=function(){var e=n();return r(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}}}),_u=m({"node_modules/is-nan/index.js"(e,t){var r=Cc(),n=du(),i=yu(),a=vu(),o=xu(),s=r(a(),Number);n(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s}}),bu=m({"node_modules/assert/build/internal/util/comparisons.js"(e,t){function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=void 0!==/a/g.flags,o=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},s=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},l=Object.is?Object.is:gu(),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},u=Number.isNaN?Number.isNaN:_u();function h(e){return e.call.bind(e)}var f=h(Object.prototype.hasOwnProperty),p=h(Object.prototype.propertyIsEnumerable),d=h(Object.prototype.toString),m=iu().types,g=m.isAnyArrayBuffer,y=m.isArrayBufferView,v=m.isDate,x=m.isMap,_=m.isRegExp,b=m.isSet,w=m.isNativeError,T=m.isBoxedPrimitive,k=m.isNumberObject,A=m.isStringObject,M=m.isBooleanObject,S=m.isBigIntObject,E=m.isSymbolObject,C=m.isFloat32Array,I=m.isFloat64Array;function L(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function P(e){return Object.keys(e).filter(L).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function z(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function D(e,t,r,n){if(e===t)return 0!==e||!r||l(e,t);if(r){if("object"!==i(e))return"number"==typeof e&&u(e)&&u(t);if("object"!==i(t)||null===e||null===t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var o=d(e);if(o!==d(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var s=P(e),c=P(t);return s.length===c.length&&R(e,t,r,n,1,s)}if("[object Object]"===o&&(!x(e)&&x(t)||!b(e)&&b(t)))return!1;if(v(e)){if(!v(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(_(e)){if(!_(t)||!function(e,t){return a?e.source===t.source&&e.flags===t.flags:RegExp.prototype.toString.call(e)===RegExp.prototype.toString.call(t)}(e,t))return!1}else if(w(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(y(e)){if(r||!C(e)&&!I(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===z(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var h=P(e),f=P(t);return h.length===f.length&&R(e,t,r,n,0,h)}if(b(e))return!(!b(t)||e.size!==t.size)&&R(e,t,r,n,2);if(x(e))return!(!x(t)||e.size!==t.size)&&R(e,t,r,n,3);if(g(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===z(new Uint8Array(e),new Uint8Array(t))}(e,t))return!1}else if(T(e)&&!function(e,t){return k(e)?k(t)&&l(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):A(e)?A(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):M(e)?M(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):S(e)?S(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):E(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return R(e,t,r,n,0)}function O(e,t){return t.filter((function(t){return p(e,t)}))}function R(e,t,n,a,l,u){if(5===arguments.length){u=Object.keys(e);var h=Object.keys(t);if(u.length!==h.length)return!1}for(var d=0;d<u.length;d++)if(!f(t,u[d]))return!1;if(n&&5===arguments.length){var m=c(e);if(0!==m.length){var g=0;for(d=0;d<m.length;d++){var y=m[d];if(p(e,y)){if(!p(t,y))return!1;u.push(y),g++}else if(p(t,y))return!1}var v=c(t);if(m.length!==v.length&&O(t,v).length!==g)return!1}else{var x=c(t);if(0!==x.length&&0!==O(t,x).length)return!1}}if(0===u.length&&(0===l||1===l&&0===e.length||0===e.size))return!0;if(void 0===a)a={val1:new Map,val2:new Map,position:0};else{var _=a.val1.get(e);if(void 0!==_){var b=a.val2.get(t);if(void 0!==b)return _===b}a.position++}a.val1.set(e,a.position),a.val2.set(t,a.position);var w=function(e,t,n,a,l,c){var u=0;if(2===c){if(!function(e,t,r,n){for(var a=null,s=o(e),l=0;l<s.length;l++){var c=s[l];if("object"===i(c)&&null!==c)null===a&&(a=new Set),a.add(c);else if(!t.has(c)){if(r||!j(e,t,c))return!1;null===a&&(a=new Set),a.add(c)}}if(null!==a){for(var u=o(t),h=0;h<u.length;h++){var f=u[h];if("object"===i(f)&&null!==f){if(!F(a,f,r,n))return!1}else if(!r&&!e.has(f)&&!F(a,f,r,n))return!1}return 0===a.size}return!0}(e,t,n,l))return!1}else if(3===c){if(!function(e,t,n,a){for(var o=null,l=s(e),c=0;c<l.length;c++){var u=r(l[c],2),h=u[0],f=u[1];if("object"===i(h)&&null!==h)null===o&&(o=new Set),o.add(h);else{var p=t.get(h);if(void 0===p&&!t.has(h)||!D(f,p,n,a)){if(n||!N(e,t,h,f,a))return!1;null===o&&(o=new Set),o.add(h)}}}if(null!==o){for(var d=s(t),m=0;m<d.length;m++){var g=r(d[m],2),y=g[0],v=g[1];if("object"===i(y)&&null!==y){if(!U(o,e,y,v,n,a))return!1}else if(!(n||e.has(y)&&D(e.get(y),v,!1,a)||U(o,e,y,v,!1,a)))return!1}return 0===o.size}return!0}(e,t,n,l))return!1}else if(1===c)for(;u<e.length;u++){if(!f(e,u)){if(f(t,u))return!1;for(var h=Object.keys(e);u<h.length;u++){var p=h[u];if(!f(t,p)||!D(e[p],t[p],n,l))return!1}return h.length===Object.keys(t).length}if(!f(t,u)||!D(e[u],t[u],n,l))return!1}for(u=0;u<a.length;u++){var d=a[u];if(!D(e[d],t[d],n,l))return!1}return!0}(e,t,n,u,a,l);return a.val1.delete(e),a.val2.delete(t),w}function F(e,t,r,n){for(var i=o(e),a=0;a<i.length;a++){var s=i[a];if(D(t,s,r,n))return e.delete(s),!0}return!1}function B(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(u(e))return!1}return!0}function j(e,t,r){var n=B(r);return n??(t.has(n)&&!e.has(n))}function N(e,t,r,n,i){var a=B(r);if(null!=a)return a;var o=t.get(a);return!(void 0===o&&!t.has(a)||!D(n,o,!1,i))&&!e.has(a)&&D(n,o,!1,i)}function U(e,t,r,n,i,a){for(var s=o(e),l=0;l<s.length;l++){var c=s[l];if(D(r,c,i,a)&&D(n,t.get(c),i,a))return e.delete(c),!0}return!1}t.exports={isDeepEqual:function(e,t){return D(e,t,!1)},isDeepStrictEqual:function(e,t){return D(e,t,!0)}}}}),wu=m({"node_modules/assert/build/assert.js"(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n,i,a=au().codes,o=a.ERR_AMBIGUOUS_ARGUMENT,s=a.ERR_INVALID_ARG_TYPE,l=a.ERR_INVALID_ARG_VALUE,u=a.ERR_INVALID_RETURN_VALUE,h=a.ERR_MISSING_ARGS,f=ou(),p=iu().inspect,d=iu().types,m=d.isPromise,g=d.isRegExp,y=hu()(),v=pu()(),x=Ic()("RegExp.prototype.test");function _(){var e=bu();n=e.isDeepEqual,i=e.isDeepStrictEqual}var b=!1,w=t.exports=M,T={};function k(e){throw e.message instanceof Error?e.message:new f(e)}function A(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var a=new f({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw a.generatedMessage=i,a}}function M(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];A.apply(void 0,[M,t.length].concat(t))}w.fail=function e(t,r,n,i,a){var o,s=arguments.length;if(0===s?o="Failed":1===s?(n=t,t=void 0):(!1===b&&(b=!0,(c.emitWarning?c.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")),2===s&&(i="!=")),n instanceof Error)throw n;var l={actual:t,expected:r,operator:void 0===i?"fail":i,stackStartFn:a||e};void 0!==n&&(l.message=n);var u=new f(l);throw o&&(u.message=o,u.generatedMessage=!0),u},w.AssertionError=f,w.ok=M,w.equal=function e(t,r,n){if(arguments.length<2)throw new h("actual","expected");t!=r&&k({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},w.notEqual=function e(t,r,n){if(arguments.length<2)throw new h("actual","expected");t==r&&k({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},w.deepEqual=function e(t,r,i){if(arguments.length<2)throw new h("actual","expected");void 0===n&&_(),n(t,r)||k({actual:t,expected:r,message:i,operator:"deepEqual",stackStartFn:e})},w.notDeepEqual=function e(t,r,i){if(arguments.length<2)throw new h("actual","expected");void 0===n&&_(),n(t,r)&&k({actual:t,expected:r,message:i,operator:"notDeepEqual",stackStartFn:e})},w.deepStrictEqual=function e(t,r,a){if(arguments.length<2)throw new h("actual","expected");void 0===n&&_(),i(t,r)||k({actual:t,expected:r,message:a,operator:"deepStrictEqual",stackStartFn:e})},w.notDeepStrictEqual=function e(t,r,a){if(arguments.length<2)throw new h("actual","expected");void 0===n&&_(),i(t,r)&&k({actual:t,expected:r,message:a,operator:"notDeepStrictEqual",stackStartFn:e})},w.strictEqual=function e(t,r,n){if(arguments.length<2)throw new h("actual","expected");v(t,r)||k({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},w.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new h("actual","expected");v(t,r)&&k({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var S,E=(S=function e(t,r,n){var i=this;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&g(t[e])&&x(t[e],n[e])?i[e]=n[e]:i[e]=t[e])}))},Object.defineProperty(S,"prototype",{writable:!1}),S);function C(e,t,a,o){if("function"!=typeof t){if(g(t))return x(t,e);if(2===arguments.length)throw new s("expected",["Function","RegExp"],t);if("object"!==r(e)||null===e){var c=new f({actual:e,expected:t,message:a,operator:"deepStrictEqual",stackStartFn:o});throw c.operator=o.name,c}var u=Object.keys(t);if(t instanceof Error)u.push("name","message");else if(0===u.length)throw new l("error",t,"may not be an empty object");return void 0===n&&_(),u.forEach((function(r){"string"==typeof e[r]&&g(t[r])&&x(t[r],e[r])||function(e,t,r,n,a,o){if(!(r in e)||!i(e[r],t[r])){if(!n){var s=new E(e,a),l=new E(t,a,e),c=new f({actual:s,expected:l,operator:"deepStrictEqual",stackStartFn:o});throw c.actual=e,c.expected=t,c.operator=o.name,c}k({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}(e,t,r,a,u,o)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function I(e){if("function"!=typeof e)throw new s("fn","Function",e);try{e()}catch(e){return e}return T}function L(e){return m(e)||null!==e&&"object"===r(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function P(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!L(t=e()))throw new u("instance of Promise","promiseFn",t)}else{if(!L(e))throw new s("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return T})).catch((function(e){return e}))}))}function z(e,t,n,i){if("string"==typeof n){if(4===arguments.length)throw new s("error",["Object","Error","Function","RegExp"],n);if("object"===r(t)&&null!==t){if(t.message===n)throw new o("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===n)throw new o("error/message",'The error "'.concat(t,'" is identical to the message.'));i=n,n=void 0}else if(null!=n&&"object"!==r(n)&&"function"!=typeof n)throw new s("error",["Object","Error","Function","RegExp"],n);if(t===T){var a="";n&&n.name&&(a+=" (".concat(n.name,")")),a+=i?": ".concat(i):".";var l="rejects"===e.name?"rejection":"exception";k({actual:void 0,expected:n,operator:e.name,message:"Missing expected ".concat(l).concat(a),stackStartFn:e})}if(n&&!C(t,n,i,e))throw t}function D(e,t,r,n){if(t!==T){if("string"==typeof r&&(n=r,r=void 0),!r||C(t,r)){var i=n?": ".concat(n):".",a="doesNotReject"===e.name?"rejection":"exception";k({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(a).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function O(e,t,n,i,a){if(!g(t))throw new s("regexp","RegExp",t);var o="match"===a;if("string"!=typeof e||x(t,e)!==o){if(n instanceof Error)throw n;var l=!n;n=n||("string"!=typeof e?'The "string" argument must be of type string. Received type '+"".concat(r(e)," (").concat(p(e),")"):(o?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(p(t),". Input:\n\n").concat(p(e),"\n"));var c=new f({actual:e,expected:t,message:n,operator:a,stackStartFn:i});throw c.generatedMessage=l,c}}function R(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];A.apply(void 0,[R,t.length].concat(t))}w.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];z.apply(void 0,[e,I(t)].concat(n))},w.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return P(t).then((function(t){return z.apply(void 0,[e,t].concat(n))}))},w.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];D.apply(void 0,[e,I(t)].concat(n))},w.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return P(t).then((function(t){return D.apply(void 0,[e,t].concat(n))}))},w.ifError=function e(t){if(null!=t){var n="ifError got unwanted exception: ";"object"===r(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?n+=t.constructor.name:n+=t.message:n+=p(t);var i=new f({actual:t,expected:null,operator:"ifError",message:n,stackStartFn:e}),a=t.stack;if("string"==typeof a){var o=a.split("\n");o.shift();for(var s=i.stack.split("\n"),l=0;l<o.length;l++){var c=s.indexOf(o[l]);if(-1!==c){s=s.slice(0,c);break}}i.stack="".concat(s.join("\n"),"\n").concat(o.join("\n"))}throw i}},w.match=function e(t,r,n){O(t,r,n,e,"match")},w.doesNotMatch=function e(t,r,n){O(t,r,n,e,"doesNotMatch")},w.strict=y(R,w,{equal:w.strictEqual,deepEqual:w.deepStrictEqual,notEqual:w.notStrictEqual,notDeepEqual:w.notDeepStrictEqual}),w.strict.strict=w.strict}}),Tu=m({"node_modules/stream-parser/node_modules/ms/index.js"(e,t){var r=1e3,n=60*r,i=60*n,a=24*i;function o(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}t.exports=function(e,t){t=t||{};var s=typeof e;if("string"===s&&e.length>0)return function(e){if(!((e=String(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 o=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"days":case"day":case"d":return o*a;case"hours":case"hour":case"hrs":case"hr":case"h":return o*i;case"minutes":case"minute":case"mins":case"min":case"m":return o*n;case"seconds":case"second":case"secs":case"sec":case"s":return o*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(e);if("number"===s&&!1===isNaN(e))return t.long?function(e){return o(e,a,"day")||o(e,i,"hour")||o(e,n,"minute")||o(e,r,"second")||e+" ms"}(e):function(e){return e>=a?Math.round(e/a)+"d":e>=i?Math.round(e/i)+"h":e>=n?Math.round(e/n)+"m":e>=r?Math.round(e/r)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}}),ku=m({"node_modules/stream-parser/node_modules/debug/src/debug.js"(e,t){var r;function n(t){function n(){if(n.enabled){var t=n,i=+new Date,a=i-(r||i);t.diff=a,t.prev=r,t.curr=i,r=i;for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];o[0]=e.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var l=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,(function(r,n){if("%%"===r)return r;l++;var i=e.formatters[n];if("function"==typeof i){var a=o[l];r=i.call(t,a),o.splice(l,1),l--}return r})),e.formatArgs.call(t,o),(n.log||e.log||console.log.bind(console)).apply(t,o)}}return n.namespace=t,n.enabled=e.enabled(t),n.useColors=e.useColors(),n.color=function(t){var r,n=0;for(r in t)n=(n<<5)-n+t.charCodeAt(r),n|=0;return e.colors[Math.abs(n)%e.colors.length]}(t),"function"==typeof e.init&&e.init(n),n}(e=t.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},e.disable=function(){e.enable("")},e.enable=function(t){e.save(t),e.names=[],e.skips=[];for(var r=("string"==typeof t?t:"").split(/[\s,]+/),n=r.length,i=0;i<n;i++)r[i]&&("-"===(t=r[i].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){var r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=Tu(),e.names=[],e.skips=[],e.formatters={}}}),Au=m({"node_modules/stream-parser/node_modules/debug/src/browser.js"(e,t){function r(){var t;try{t=e.storage.debug}catch{}return!t&&typeof c<"u"&&"env"in c&&(t=c.env.DEBUG),t}(e=t.exports=ku()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),r){var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var i=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(a=i))})),t.splice(a,0,n)}},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch{}},e.load=r,e.useColors=function(){return!!(typeof window<"u"&&window.process&&"renderer"===window.process.type)||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.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:function(){try{return window.localStorage}catch{}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},e.enable(r())}}),Mu=m({"node_modules/stream-parser/index.js"(e,t){var r=wu(),n=Au()("stream-parser");function i(e){n("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=-1,e._parserCallback=null,"function"==typeof e.push&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function a(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||i(this),n("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=0}function o(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||i(this),n("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=1}function s(e,t){r(!this._parserCallback,'There is already a "callback" set!'),r(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||i(this),n("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=2}function l(e,t,r){this._parserInit||i(this),n("write(%o bytes)",e.length),"function"==typeof t&&(r=t),h(this,e,null,r)}function c(e,t,r){this._parserInit||i(this),n("transform(%o bytes)",e.length),"function"!=typeof t&&(t=this._parserOutput),h(this,e,t,r)}function u(e,t,r,i){if(e._parserBytesLeft-=t.length,n("%o bytes left for stream piece",e._parserBytesLeft),0===e._parserState?(e._parserBuffers.push(t),e._parserBuffered+=t.length):2===e._parserState&&r(t),0!==e._parserBytesLeft)return i;var a=e._parserCallback;if(a&&0===e._parserState&&e._parserBuffers.length>1&&(t=Buffer.concat(e._parserBuffers,e._parserBuffered)),0!==e._parserState&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=-1,e._parserBuffers.splice(0),a){var o=[];t&&o.push(t),r&&o.push(r);var s=a.length>o.length;s&&o.push(f(i));var l=a.apply(e,o);if(!s||i===l)return i}}t.exports=function(e){var t=e&&"function"==typeof e._transform,r=e&&"function"==typeof e._write;if(!t&&!r)throw new Error("must pass a Writable or Transform stream in");n("extending Parser into stream"),e._bytes=a,e._skipBytes=o,t&&(e._passthrough=s),t?e._transform=c:e._write=l};var h=f((function e(t,r,n,i){return t._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=t._parserBytesLeft?function(){return u(t,r,n,i)}:function(){var a=r.slice(0,t._parserBytesLeft);return u(t,a,n,(function(o){return o?i(o):r.length>a.length?function(){return e(t,r.slice(a.length),n,i)}:void 0}))}}));function f(e){return function(){for(var t=e.apply(this,arguments);"function"==typeof t;)t=t();return t}}}}),Su=m({"node_modules/probe-image-size/lib/common.js"(e){var t=nu().Transform,r=Mu();function n(){t.call(this,{readableObjectMode:!0})}function i(e,t,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name=this.constructor.name,this.message=e,t&&(this.code=t),r&&(this.statusCode=r)}n.prototype=Object.create(t.prototype),n.prototype.constructor=n,r(n.prototype),e.ParserStream=n,e.sliceEq=function(e,t,r){for(var n=t,i=0;i<r.length;)if(e[n++]!==r[i++])return!1;return!0},e.str2arr=function(e,t){var r=[],n=0;if(t&&"hex"===t)for(;n<e.length;)r.push(parseInt(e.slice(n,n+2),16)),n+=2;else for(;n<e.length;n++)r.push(255&e.charCodeAt(n));return r},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|16777216*e[t+3]},e.readUInt32BE=function(e,t){return e[t+3]|e[t+2]<<8|e[t+1]<<16|16777216*e[t]},i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,e.ProbeError=i}}),Eu=m({"node_modules/probe-image-size/lib/miaf_utils.js"(e,t){var r=Su().readUInt16BE,n=Su().readUInt32BE;function i(e,t){if(e.length<4+t)return null;var r=n(e,t);return e.length<r+t||r<8?null:{boxtype:String.fromCharCode.apply(null,e.slice(t+4,t+8)),data:e.slice(t+8,t+r),end:t+r}}function a(e,t){for(var r=0;;){var a=i(e,r);if(!a)break;switch(a.boxtype){case"ispe":t.sizes.push({width:n(a.data,4),height:n(a.data,8)});break;case"irot":t.transforms.push({type:"irot",value:3&a.data[0]});break;case"imir":t.transforms.push({type:"imir",value:1&a.data[0]})}r=a.end}}function o(e,t,r){for(var n=0,i=0;i<r;i++)n=256*n+(e[t+i]||0);return n}function s(e,t){for(var n=e[4]>>4&15,i=15&e[4],a=e[5]>>4&15,s=r(e,6),l=8,c=0;c<s;c++){var u=r(e,l),h=r(e,l+=2),f=o(e,l+=2,a),p=r(e,l+=a);if(l+=2,0===h&&1===p){var d=o(e,l,n),m=o(e,l+n,i);t.item_loc[u]={length:m,offset:d+f}}l+=p*(n+i)}}function l(e,t){for(var n=r(e,4),a=6,o=0;o<n;o++){var s=i(e,a);if(!s)break;if("infe"===s.boxtype){for(var l=r(s.data,4),c="",u=8;u<s.data.length&&s.data[u];u++)c+=String.fromCharCode(s.data[u]);t.item_inf[c]=l}a=s.end}}function c(e,t){for(var r=0;;){var n=i(e,r);if(!n)break;"ipco"===n.boxtype&&a(n.data,t),r=n.end}}t.exports.unbox=i,t.exports.readSizeFromMeta=function(e){var t={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(function(e,t){for(var r=4;;){var n=i(e,r);if(!n)break;"iprp"===n.boxtype&&c(n.data,t),"iloc"===n.boxtype&&s(n.data,t),"iinf"===n.boxtype&&l(n.data,t),r=n.end}}(e,t),t.sizes.length){var r=function(e){var t=e.reduce((function(e,t){return e.width>t.width||e.width===t.width&&e.height>t.height?e:t})),r=e.reduce((function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t}));return t.width>r.height||t.width===r.height&&t.height>r.width?t:r}(t.sizes),n=1;t.transforms.forEach((function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===e.type&&(n=0===e.value?r[n]:t[n=t[n=r[n]]]),"irot"===e.type)for(var i=0;i<e.value;i++)n=t[n]}));var a=null;return t.item_inf.Exif&&(a=t.item_loc[t.item_inf.Exif]),{width:r.width,height:r.height,orientation:t.transforms.length?n:null,variants:t.sizes,exif_location:a}}},t.exports.getMimeType=function(e){var t=String.fromCharCode.apply(null,e.slice(0,4)),r={};r[t]=!0;for(var n=8;n<e.length;n+=4)r[String.fromCharCode.apply(null,e.slice(n,n+4))]=!0;if(r.mif1||r.msf1||r.miaf)return"avif"===t||"avis"===t||"avio"===t?{type:"avif",mime:"image/avif"}:"heic"===t||"heix"===t?{type:"heic",mime:"image/heic"}:"hevc"===t||"hevx"===t?{type:"heic",mime:"image/heic-sequence"}:r.avif||r.avis?{type:"avif",mime:"image/avif"}:r.heic||r.heix||r.hevc||r.hevx||r.heis?r.msf1?{type:"heif",mime:"image/heif-sequence"}:{type:"heif",mime:"image/heif"}:{type:"avif",mime:"image/avif"}}}}),Cu=m({"node_modules/probe-image-size/lib/exif_utils.js"(e,t){function r(e,t){var r=new Error(e);return r.code=t,r}function n(e){try{return decodeURIComponent(escape(e))}catch{return e}}function i(e,t,n){this.input=e.subarray(t,n),this.start=t;var i=String.fromCharCode.apply(null,this.input.subarray(0,4));if("II*\0"!==i&&"MM\0*"!==i)throw r("invalid TIFF signature","EBADDATA");this.big_endian="M"===i[0]}i.prototype.each=function(e){this.aborted=!1;var t=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:t}];this.ifds_to_read.length>0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}},i.prototype.read_uint16=function(e){var t=this.input;if(e+2>t.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?256*t[e]+t[e+1]:t[e]+256*t[e+1]},i.prototype.read_uint32=function(e){var t=this.input;if(e+4>t.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?16777216*t[e]+65536*t[e+1]+256*t[e+2]+t[e+3]:t[e]+256*t[e+1]+65536*t[e+2]+16777216*t[e+3]},i.prototype.is_subifd_link=function(e,t){return 0===e&&34665===t||0===e&&34853===t||34665===e&&40965===t},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 r;switch(e){case 1:case 2:return this.input[t];case 6:return(r=this.input[t])|33554430*(128&r);case 3:return this.read_uint16(t);case 8:return(r=this.read_uint16(t))|131070*(32768&r);case 4:return this.read_uint32(t);case 9:return 0|this.read_uint32(t);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),l=this.read_uint16(t+2),c=this.read_uint32(t+4),u=this.exif_format_length(l),h=c*u,f=h<=4?t+8:this.read_uint32(t+8),p=!1;if(f+h>this.input.length)throw r("unexpected EOF","EBADDATA");for(var d=[],m=f,g=0;g<c;g++,m+=u){var y=this.exif_format_read(l,m);if(null===y){d=null;break}d.push(y)}if(Array.isArray(d)&&2===l&&(d=n(String.fromCharCode.apply(null,d)))&&"\0"===d[d.length-1]&&(d=d.slice(0,-1)),this.is_subifd_link(e,s)&&Array.isArray(d)&&Number.isInteger(d[0])&&d[0]>0&&(this.ifds_to_read.push({id:s,offset:d[0]}),p=!0),!1===i({is_big_endian:this.big_endian,ifd:e,tag:s,format:l,count:c,entry_offset:t+this.start,data_length:h,data_offset:f+this.start,value:d,is_subifd_link:p}))return void(this.aborted=!0);t+=12}0===e&&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(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t=e.value[0],!1})),t}catch{return-1}}}}),Iu=m({"node_modules/probe-image-size/lib/parse_sync/avif.js"(e,t){var r=Su().str2arr,n=Su().sliceEq,i=Su().readUInt32BE,a=Eu(),o=Cu(),s=r("ftyp");t.exports=function(e){if(n(e,4,s)){var t=a.unbox(e,0);if(t){var r=a.getMimeType(t.data);if(r){for(var l,c=t.end;;){var u=a.unbox(e,c);if(!u)break;if(c=u.end,"mdat"===u.boxtype)return;if("meta"===u.boxtype){l=u.data;break}}if(l){var h=a.readSizeFromMeta(l);if(h){var f={width:h.width,height:h.height,type:r.type,mime:r.mime,wUnits:"px",hUnits:"px"};if(h.variants.length>1&&(f.variants=h.variants),h.orientation&&(f.orientation=h.orientation),h.exif_location&&h.exif_location.offset+h.exif_location.length<=e.length){var p=i(e,h.exif_location.offset),d=e.slice(h.exif_location.offset+p+4,h.exif_location.offset+h.exif_location.length),m=o.get_orientation(d);m>0&&(f.orientation=m)}return f}}}}}}}}),Lu=m({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(e,t){var r=Su().str2arr,n=Su().sliceEq,i=Su().readUInt16LE,a=r("BM");t.exports=function(e){if(!(e.length<26)&&n(e,0,a))return{width:i(e,18),height:i(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),Pu=m({"node_modules/probe-image-size/lib/parse_sync/gif.js"(e,t){var r=Su().str2arr,n=Su().sliceEq,i=Su().readUInt16LE,a=r("GIF87a"),o=r("GIF89a");t.exports=function(e){if(!(e.length<10)&&(n(e,0,a)||n(e,0,o)))return{width:i(e,6),height:i(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),zu=m({"node_modules/probe-image-size/lib/parse_sync/ico.js"(e,t){var r=Su().readUInt16LE;t.exports=function(e){var t=r(e,0),n=r(e,2),i=r(e,4);if(0===t&&1===n&&i){for(var a=[],o={width:0,height:0},s=0;s<i;s++){var l=e[6+16*s]||256,c=e[6+16*s+1]||256,u={width:l,height:c};a.push(u),(l>o.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),Du=m({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(e,t){var r=Su().readUInt16BE,n=Su().str2arr,i=Su().sliceEq,a=Cu(),o=n("Exif\0\0");t.exports=function(e){if(!(e.length<2)&&255===e[0]&&216===e[1]&&255===e[2])for(var t=2;;){for(;;){if(e.length-t<2)return;if(255===e[t++])break}for(var n,s=e[t++];255===s;)s=e[t++];if(208<=s&&s<=217||1===s)n=0;else{if(!(192<=s&&s<=254))return;if(e.length-t<2)return;n=r(e,t)-2,t+=2}if(217===s||218===s)return;var l;if(225===s&&n>=10&&i(e,t,o)&&(l=a.get_orientation(e.slice(t+6,t+n))),n>=5&&192<=s&&s<=207&&196!==s&&200!==s&&204!==s){if(e.length-t<n)return;var c={width:r(e,t+3),height:r(e,t+1),type:"jpg",mime:"image/jpeg",wUnits:"px",hUnits:"px"};return l>0&&(c.orientation=l),c}t+=n}}}}),Ou=m({"node_modules/probe-image-size/lib/parse_sync/png.js"(e,t){var r=Su().str2arr,n=Su().sliceEq,i=Su().readUInt32BE,a=r("PNG\r\n\n"),o=r("IHDR");t.exports=function(e){if(!(e.length<24)&&n(e,0,a)&&n(e,12,o))return{width:i(e,16),height:i(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),Ru=m({"node_modules/probe-image-size/lib/parse_sync/psd.js"(e,t){var r=Su().str2arr,n=Su().sliceEq,i=Su().readUInt32BE,a=r("8BPS\0");t.exports=function(e){if(!(e.length<22)&&n(e,0,a))return{width:i(e,18),height:i(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),Fu=m({"node_modules/probe-image-size/lib/parse_sync/svg.js"(e,t){function r(e){return 32===e||9===e||13===e||10===e}function n(e){return"number"==typeof e&&isFinite(e)&&e>0}var i=/<[-_.:a-zA-Z0-9][^>]*>/,a=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,s=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(e){return c.test(e)?e.match(c)[0]:"px"}t.exports=function(e){if(function(e){var t=0,n=e.length;for(239===e[0]&&187===e[1]&&191===e[2]&&(t=3);t<n&&r(e[t]);)t++;return t!==n&&60===e[t]}(e)){for(var t="",c=0;c<e.length;c++)t+=String.fromCharCode(e[c]);var h=(t.match(i)||[""])[0];if(a.test(h)){var f=function(e){var t=e.match(o),r=e.match(s),n=e.match(l);return{width:t&&(t[1]||t[2]),height:r&&(r[1]||r[2]),viewbox:n&&(n[1]||n[2])}}(h),p=parseFloat(f.width),d=parseFloat(f.height);if(f.width&&f.height)return n(p)&&n(d)?{width:p,height:d,type:"svg",mime:"image/svg+xml",wUnits:u(f.width),hUnits:u(f.height)}:void 0;var m=(f.viewbox||"").split(" "),g={width:m[2],height:m[3]},y=parseFloat(g.width),v=parseFloat(g.height);if(n(y)&&n(v)&&u(g.width)===u(g.height)){var x=y/v;return f.width?n(p)?{width:p,height:p/x,type:"svg",mime:"image/svg+xml",wUnits:u(f.width),hUnits:u(f.width)}:void 0:f.height?n(d)?{width:d*x,height:d,type:"svg",mime:"image/svg+xml",wUnits:u(f.height),hUnits:u(f.height)}:void 0:{width:y,height:v,type:"svg",mime:"image/svg+xml",wUnits:u(g.width),hUnits:u(g.height)}}}}}}}),Bu=m({"node_modules/probe-image-size/lib/parse_sync/tiff.js"(e,t){var r=Su().str2arr,n=Su().sliceEq,i=Su().readUInt16LE,a=Su().readUInt16BE,o=Su().readUInt32LE,s=Su().readUInt32BE,l=r("II*\0"),c=r("MM\0*");function u(e,t,r){return r?a(e,t):i(e,t)}function h(e,t,r){return r?s(e,t):o(e,t)}function f(e,t,r){var n=u(e,t+2,r);return 1!==h(e,t+4,r)||3!==n&&4!==n?null:3===n?u(e,t+8,r):h(e,t+8,r)}t.exports=function(e){if(!(e.length<8)&&(n(e,0,l)||n(e,0,c))){var t=77===e[0],r=h(e,4,t)-8;if(!(r<0)){var i=r+8;if(!(e.length-i<2)){var a=12*u(e,i+0,t);if(!(a<=0||(i+=2,e.length-i<a))){var o,s,p,d;for(o=0;o<a;o+=12)256===(d=u(e,i+o,t))?s=f(e,i+o,t):257===d&&(p=f(e,i+o,t));if(s&&p)return{width:s,height:p,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}}}}}}}}),ju=m({"node_modules/probe-image-size/lib/parse_sync/webp.js"(e,t){var r=Su().str2arr,n=Su().sliceEq,i=Su().readUInt16LE,a=Su().readUInt32LE,o=Cu(),s=r("RIFF"),l=r("WEBP");function c(e,t){if(157===e[t+3]&&1===e[t+4]&&42===e[t+5])return{width:16383&i(e,t+6),height:16383&i(e,t+8),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function u(e,t){if(47===e[t]){var r=a(e,t+1);return{width:1+(16383&r),height:1+(r>>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function h(e,t){return{width:1+(e[t+6]<<16|e[t+5]<<8|e[t+4]),height:1+(e[t+9]<<t|e[t+8]<<8|e[t+7]),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}t.exports=function(e){if(!(e.length<16)&&(n(e,0,s)||n(e,8,l))){var t=12,r=null,i=0,f=a(e,4)+8;if(!(f>e.length)){for(;t+8<f;)if(0!==e[t]){var p=String.fromCharCode.apply(null,e.slice(t,t+4)),d=a(e,t+4);"VP8 "===p&&d>=10?r=r||c(e,t+8):"VP8L"===p&&d>=9?r=r||u(e,t+8):"VP8X"===p&&d>=10?r=r||h(e,t+8):"EXIF"===p&&(i=o.get_orientation(e.slice(t+8,t+8+d)),t=1/0),t+=8+d}else t++;if(r)return i>0&&(r.orientation=i),r}}}}}),Nu=m({"node_modules/probe-image-size/lib/parsers_sync.js"(e,t){t.exports={avif:Iu(),bmp:Lu(),gif:Pu(),ico:zu(),jpeg:Du(),png:Ou(),psd:Ru(),svg:Fu(),tiff:Bu(),webp:ju()}}}),Uu=m({"node_modules/probe-image-size/sync.js"(e,t){var r=Nu();t.exports=function(e){return function(e){for(var t=Object.keys(r),n=0;n<t.length;n++){var i=r[t[n]](e);if(i)return i}return null}(e)},t.exports.parsers=r}}),Vu=m({"src/traces/image/helpers.js"(e){var t=Uu(),r=Rn().IMAGE_URL_PREFIX,n=Hl().Buffer;e.getImageSize=function(e){var i=e.replace(r,""),a=new n(i,"base64");return t(a)}}}),qu=m({"src/traces/image/calc.js"(e,t){var r=ct(),n=Fl(),i=M(),a=ar(),o=ct().maxRowLength,s=Vu().getImageSize;function l(e,t,n,i){return function(a){return r.constrain((a-e)*t,n,i)}}function c(e,t){return function(n){return r.constrain(n,e,t)}}t.exports=function(e,t){var r,u;if(t._hasZ)r=t.z.length,u=o(t.z);else if(t._hasSource){var h=s(t.source);r=h.height,u=h.width}var f,p=a.getFromId(e,t.xaxis||"x"),d=a.getFromId(e,t.yaxis||"y"),m=p.d2c(t.x0)-t.dx/2,g=d.d2c(t.y0)-t.dy/2,y=[m,m+u*t.dx],v=[g,g+r*t.dy];if(p&&"log"===p.type)for(f=0;f<u;f++)y.push(m+f*t.dx);if(d&&"log"===d.type)for(f=0;f<r;f++)v.push(g+f*t.dy);return t._extremes[p._id]=a.findExtremes(p,y),t._extremes[d._id]=a.findExtremes(d,v),t._scaler=function(e){var t=n.colormodel[e.colormodel],r=(t.colormodel||e.colormodel).length;e._sArray=[];for(var a=0;a<r;a++)t.min[a]!==e.zmin[a]||t.max[a]!==e.zmax[a]?e._sArray.push(l(e.zmin[a],(t.max[a]-t.min[a])/(e.zmax[a]-e.zmin[a]),t.min[a],t.max[a])):e._sArray.push(c(t.min[a],t.max[a]));return function(t){for(var n=t.slice(0,r),a=0;a<r;a++){var o=n[a];if(!i(o))return!1;n[a]=e._sArray[a](o)}return n}}(t),[{x0:m,y0:g,z:t.z,w:u,h:r}]}}}),Hu=m({"src/traces/image/plot.js"(e,t){var r=b(),n=ct(),i=n.strTranslate,a=Mt(),o=Fl(),s=No(),l=jo().STYLE;t.exports=function(e,t,c,u){var h=t.xaxis,f=t.yaxis,p=!e._context._exportedPlot&&s();n.makeTraceGroups(u,c,"im").each((function(t){var s=r.select(this),c=t[0],u=c.trace,d=("fast"===u.zsmooth||!1===u.zsmooth&&p)&&!u._hasZ&&u._hasSource&&"linear"===h.type&&"linear"===f.type;u._realImage=d;var m,g,y,v,x,_,b=c.z,w=c.x0,T=c.y0,k=c.w,A=c.h,M=u.dx,S=u.dy;for(_=0;void 0===m&&_<k;)m=h.c2p(w+_*M),_++;for(_=k;void 0===g&&_>0;)g=h.c2p(w+_*M),_--;for(_=0;void 0===v&&_<A;)v=f.c2p(T+_*S),_++;for(_=A;void 0===x&&_>0;)x=f.c2p(T+_*S),_--;if(g<m&&(y=g,g=m,m=y),x<v&&(y=v,v=x,x=y),!d){m=Math.max(-.5*h._length,m),g=Math.min(1.5*h._length,g),v=Math.max(-.5*f._length,v),x=Math.min(1.5*f._length,x)}var E=Math.round(g-m),C=Math.round(x-v);if(E<=0||C<=0)s.selectAll("image").data([]).exit().remove();else{var I=s.selectAll("image").data([t]);I.enter().append("svg:image").attr({xmlns:a.svg,preserveAspectRatio:"none"}),I.exit().remove();var L=!1===u.zsmooth?l:"";if(d){var P=n.simpleMap(h.range,h.r2l),z=n.simpleMap(f.range,f.r2l),D=P[1]<P[0],O=z[1]>z[0];if(D||O){var R=m+E/2,F=v+C/2;L+="transform:"+i(R+"px",F+"px")+"scale("+(D?-1:1)+","+(O?-1:1)+")"+i(-R+"px",-F+"px")+";"}}I.attr("style",L);var B=new Promise((function(e){if(u._hasZ)e();else if(u._hasSource)if(u._canvas&&u._canvas.el.width===k&&u._canvas.el.height===A&&u._canvas.source===u.source)e();else{var t=document.createElement("canvas");t.width=k,t.height=A;var r=t.getContext("2d",{willReadFrequently:!0});u._image=u._image||new Image;var n=u._image;n.onload=function(){r.drawImage(n,0,0),u._canvas={el:t,source:u.source},e()},n.setAttribute("src",u.source)}})).then((function(){var e;if(u._hasZ)e=j((function(e,t){var r=b[t][e];return n.isTypedArray(r)&&(r=Array.from(r)),r})).toDataURL("image/png");else if(u._hasSource)if(d)e=u.source;else{var t=u._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,k,A).data;e=j((function(e,r){var n=4*(r*k+e);return[t[n],t[n+1],t[n+2],t[n+3]]})).toDataURL("image/png")}I.attr({"xlink:href":e,height:C,width:E,x:m,y:v})}));e._promises.push(B)}function j(e){var t=document.createElement("canvas");t.width=E,t.height=C;var r,i=t.getContext("2d",{willReadFrequently:!0}),a=function(e){return n.constrain(Math.round(h.c2p(w+e*M)-m),0,E)},s=function(e){return n.constrain(Math.round(f.c2p(T+e*S)-v),0,C)},l=o.colormodel[u.colormodel],p=l.colormodel||u.colormodel,d=l.fmt;for(_=0;_<c.w;_++){var g=a(_),y=a(_+1);if(y!==g&&!isNaN(y)&&!isNaN(g))for(var x=0;x<c.h;x++){var b=s(x),k=s(x+1);k===b||isNaN(k)||isNaN(b)||!e(_,x)||(r=u._scaler(e(_,x)),i.fillStyle=r?p+"("+d(r).join(",")+")":"rgba(0,0,0,0)",i.fillRect(g,b,y-g,k-b))}}return t}}))}}}),Gu=m({"src/traces/image/style.js"(e,t){var r=b();t.exports=function(e){r.select(e).selectAll(".im image").style("opacity",(function(e){return e[0].trace.opacity}))}}}),Wu=m({"src/traces/image/hover.js"(e,t){var r=Or(),n=ct(),i=n.isArrayOrTypedArray,a=Fl();t.exports=function(e,t,o){var s=e.cd[0],l=s.trace,c=e.xa,u=e.ya;if(!(r.inbox(t-s.x0,t-(s.x0+s.w*l.dx),0)>0||r.inbox(o-s.y0,o-(s.y0+s.h*l.dy),0)>0)){var h,f=Math.floor((t-s.x0)/l.dx),p=Math.floor(Math.abs(o-s.y0)/l.dy);if(l._hasZ?h=s.z[p][f]:l._hasSource&&(h=l._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,p,1,1).data),h){var d,m=s.hi||l.hoverinfo;if(m){var g=m.split("+");-1!==g.indexOf("all")&&(g=["color"]),-1!==g.indexOf("color")&&(d=!0)}var y,v=a.colormodel[l.colormodel],x=v.colormodel||l.colormodel,_=x.length,b=l._scaler(h),w=v.suffix,T=[];(l.hovertemplate||d)&&(T.push("["+[b[0]+w[0],b[1]+w[1],b[2]+w[2]].join(", ")),4===_&&T.push(", "+b[3]+w[3]),T.push("]"),T=T.join(""),e.extraText=x.toUpperCase()+": "+T),i(l.hovertext)&&i(l.hovertext[p])?y=l.hovertext[p][f]:i(l.text)&&i(l.text[p])&&(y=l.text[p][f]);var k=u.c2p(s.y0+(p+.5)*l.dy),A=s.x0+(f+.5)*l.dx,M=s.y0+(p+.5)*l.dy,S="["+h.slice(0,l.colormodel.length).join(", ")+"]";return[n.extendFlat(e,{index:[p,f],x0:c.c2p(s.x0+f*l.dx),x1:c.c2p(s.x0+(f+1)*l.dx),y0:k,y1:k,color:b,xVal:A,xLabelVal:A,yVal:M,yLabelVal:M,zLabelVal:S,text:y,hovertemplateLabels:{zLabel:S,colorLabel:T,"color[0]Label":b[0]+w[0],"color[1]Label":b[1]+w[1],"color[2]Label":b[2]+w[2],"color[3]Label":b[3]+w[3]}})]}}}}}),Zu=m({"src/traces/image/event_data.js"(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||(e.z=t.color),e}}}),Yu=m({"src/traces/image/index.js"(e,t){t.exports={attributes:Bl(),supplyDefaults:jl(),calc:qu(),plot:Hu(),style:Gu(),hoverPoints:Wu(),eventData:Zu(),moduleType:"trace",name:"image",basePlotModule:Ci(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),Xu=m({"lib/image.js"(e,t){t.exports=Yu()}}),$u=m({"src/traces/pie/attributes.js"(e,t){var r=q(),n=Ma().attributes,i=j(),a=G(),{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:l}=Fe(),c=B().extendFlat,u=Oe().pattern,h=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:c({},r.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:l(),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:l({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:c({},h,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:c({},h,{}),outsidetextfont:c({},h,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:c({},r.showlegend,{arrayOk:!0}),legend:c({},r.legend,{arrayOk:!0}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:c({},h,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:n({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"}}}}),Ku=m({"src/traces/pie/defaults.js"(e,t){var r=M(),n=ct(),i=$u(),a=Ma().defaults,o=Xa().handleText,s=ct().coercePattern;function l(e,t){var i=n.isArrayOrTypedArray(e),a=n.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,l=0;l<o;l++){var c=t[l];if(r(c)&&c>0){s=!0;break}}s||(o=0)}return{hasLabels:i,hasValues:a,len:o}}function c(e,t,r,n,i){n("marker.line.width")&&n("marker.line.color",i?void 0:r.paper_bgcolor);var a=n("marker.colors");s(n,"marker.pattern",a),e.marker&&!t.marker.pattern.fgcolor&&(t.marker.pattern.fgcolor=e.marker.colors),t.marker.pattern.bgcolor||(t.marker.pattern.bgcolor=r.paper_bgcolor)}t.exports={handleLabelsAndValues:l,handleMarkerDefaults:c,supplyDefaults:function(e,t,r,s){function u(r,a){return n.coerce(e,t,i,r,a)}var h=l(u("labels"),u("values")),f=h.len;if(t._hasLabels=h.hasLabels,t._hasValues=h.hasValues,!t._hasLabels&&t._hasValues&&(u("label0"),u("dlabel")),f){t._length=f,c(e,t,s,u,!0),u("scalegroup");var p,d=u("text"),m=u("texttemplate");if(u("texttemplatefallback"),m||(p=u("textinfo",n.isArrayOrTypedArray(d)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),u("hovertemplatefallback"),m||p&&"none"!==p){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)||"auto"===g||"outside"===g)&&u("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&u("insidetextorientation")}else"none"===p&&u("textposition","none");a(t,s,u);var y=u("hole");if(u("title.text")){var v=u("title.position",y?"middle center":"top center");!y&&"middle center"===v&&(t.title.position="top center"),n.coerceFont(u,"title.font",s.font)}u("sort"),u("direction"),u("rotation"),u("pull")}else t.visible=!1}}}}),Ju=m({"src/traces/pie/layout_attributes.js"(e,t){t.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Qu=m({"src/traces/pie/layout_defaults.js"(e,t){var r=ct(),n=Ju();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("hiddenlabels"),i("piecolorway",t.colorway),i("extendpiecolors")}}}),eh=m({"src/traces/pie/calc.js"(e,t){var r=M(),n=F(),i=W(),a={};function o(e){return function(t,r){return!(!t||(t=n(t),!t.isValid()))&&(t=i.addOpacity(t,t.getAlpha()),e[r]||(e[r]=t),t)}}function s(e,t){var r,i=JSON.stringify(e),a=t[i];if(!a){for(a=e.slice(),r=0;r<e.length;r++)a.push(n(e[r]).lighten(20).toHexString());for(r=0;r<e.length;r++)a.push(n(e[r]).darken(20).toHexString());t[i]=a}return a}t.exports={calc:function(e,t){var n,i,a=[],s=e._fullLayout,l=s.hiddenlabels||[],c=t.labels,u=t.marker.colors||[],h=t.values,f=t._length,p=t._hasValues&&f;if(t.dlabel)for(c=new Array(f),n=0;n<f;n++)c[n]=String(t.label0+n*t.dlabel);var d={},m=o(s["_"+t.type+"colormap"]),g=0,y=!1;for(n=0;n<f;n++){var v,x,_;if(p){if(v=h[n],!r(v))continue;v=+v}else v=1;(void 0===(x=c[n])||""===x)&&(x=n);var b=d[x=String(x)];void 0===b?(d[x]=a.length,(_=-1!==l.indexOf(x))||(g+=v),a.push({v,label:x,color:m(u[n],x),i:n,pts:[n],hidden:_})):(y=!0,(i=a[b]).v+=v,i.pts.push(n),i.hidden||(g+=v),!1===i.color&&u[n]&&(i.color=m(u[n],x)))}return a=a.filter((function(e){return e.v>=0})),("funnelarea"===t.type?y:t.sort)&&a.sort((function(e,t){return t.v-e.v})),a[0]&&(a[0].vTotal=g),a},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,i=e.calcdata,o=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(o=s(o,a));for(var c=0,u=0;u<i.length;u++){var h=i[u];if(h[0].trace.type===r)for(var f=0;f<h.length;f++){var p=h[f];!1===p.color&&(l[p.label]?p.color=l[p.label]:(l[p.label]=p.color=o[c%o.length],c++))}}},makePullColorFn:o,generateExtendedColors:s}}}),th=m({"src/traces/pie/event_data.js"(e,t){var r=Kt().appendArrayMultiPointValues;t.exports=function(e,t){var n={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 1===e.pts.length&&(n.pointNumber=n.i=e.pts[0]),r(n,t,e.pts),"funnelarea"===t.type&&(delete n.v,delete n.i),n}}}),rh=m({"src/traces/pie/plot.js"(e,t){var r=b(),n=At(),i=Or(),a=W(),o=er(),s=ct(),l=s.strScale,c=s.strTranslate,u=Et(),h=Qa(),f=h.recordMinTextSize,p=h.clearMinTextSize,d=ci().TEXTPAD,m=wr(),g=th(),y=ct().isValidTextValue;function v(e,t,n){var a=n[0],o=a.cx,l=a.cy,c=a.trace,u="funnelarea"===c.type;"_hasHoverLabel"in c||(c._hasHoverLabel=!1),"_hasHoverEvent"in c||(c._hasHoverEvent=!1),e.on("mouseover",(function(e){var n=t._fullLayout,h=t._fullData[c.index];if(!t._dragging&&!1!==n.hovermode){var f=h.hoverinfo;if(Array.isArray(f)&&(f=i.castHoverinfo({hoverinfo:[m.castOption(f,e.pts)],_module:c._module},n,0)),"all"===f&&(f="label+text+value+percent+name"),h.hovertemplate||"none"!==f&&"skip"!==f&&f){var p=e.rInscribed||0,d=o+e.pxmid[0]*(1-p),y=l+e.pxmid[1]*(1-p),v=n.separators,x=[];if(f&&-1!==f.indexOf("label")&&x.push(e.label),e.text=m.castOption(h.hovertext||h.text,e.pts),f&&-1!==f.indexOf("text")){var _=e.text;s.isValidTextValue(_)&&x.push(_)}e.value=e.v,e.valueLabel=m.formatPieValue(e.v,v),f&&-1!==f.indexOf("value")&&x.push(e.valueLabel),e.percent=e.v/a.vTotal,e.percentLabel=m.formatPiePercent(e.percent,v),f&&-1!==f.indexOf("percent")&&x.push(e.percentLabel);var b=h.hoverlabel,w=b.font,T=[];i.loneHover({trace:c,x0:d-p*a.r,x1:d+p*a.r,y,_x0:u?o+e.TL[0]:d-p*a.r,_x1:u?o+e.TR[0]:d+p*a.r,_y0:u?l+e.TL[1]:y-p*a.r,_y1:u?l+e.BL[1]:y+p*a.r,text:x.join("<br>"),name:h.hovertemplate||-1!==f.indexOf("name")?h.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:m.castOption(b.bgcolor,e.pts)||e.color,borderColor:m.castOption(b.bordercolor,e.pts),fontFamily:m.castOption(w.family,e.pts),fontSize:m.castOption(w.size,e.pts),fontColor:m.castOption(w.color,e.pts),nameLength:m.castOption(b.namelength,e.pts),textAlign:m.castOption(b.align,e.pts),hovertemplate:m.castOption(h.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,h)]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,h)],event:r.event})}})),e.on("mouseout",(function(e){var n=t._fullLayout,a=t._fullData[c.index],o=r.select(this).datum();c._hasHoverEvent&&(e.originalEvent=r.event,t.emit("plotly_unhover",{points:[g(o,a)],event:r.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(n._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var n=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===n.hovermode||(t._hoverdata=[g(e,a)],i.click(t,r.event))}))}function x(e,t,r){var n=m.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=m.castOption(e._input.textfont.color,t.pts));var i=m.castOption(e.insidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,o=m.castOption(e.insidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size,s=m.castOption(e.insidetextfont.weight,t.pts)||m.castOption(e.textfont.weight,t.pts)||r.weight,l=m.castOption(e.insidetextfont.style,t.pts)||m.castOption(e.textfont.style,t.pts)||r.style,c=m.castOption(e.insidetextfont.variant,t.pts)||m.castOption(e.textfont.variant,t.pts)||r.variant,u=m.castOption(e.insidetextfont.textcase,t.pts)||m.castOption(e.textfont.textcase,t.pts)||r.textcase,h=m.castOption(e.insidetextfont.lineposition,t.pts)||m.castOption(e.textfont.lineposition,t.pts)||r.lineposition,f=m.castOption(e.insidetextfont.shadow,t.pts)||m.castOption(e.textfont.shadow,t.pts)||r.shadow;return{color:n||a.contrast(t.color),family:i,size:o,weight:s,style:l,variant:c,textcase:u,lineposition:h,shadow:f}}function _(e,t){for(var r,n,i=0;i<e.length;i++)if((n=(r=e[i][0]).trace).title.text){var a=n.title.text;n._meta&&(a=s.templateString(a,n._meta));var l=o.tester.append("text").attr("data-notex",1).text(a).call(o.font,n.title.font).call(u.convertToTspans,t),c=o.bBox(l.node(),!0);r.titleBox={width:c.width,height:c.height},l.remove()}}function w(e,t,r){var n=r.r||t.rpx1,i=t.rInscribed;if(t.startangle===t.stopangle)return{rCenter:1-i,scale:0,rotate:0,textPosAngle:0};var a,o=t.ring,s=1===o&&Math.abs(t.startangle-t.stopangle)===2*Math.PI,l=t.halfangle,c=t.midangle,u=r.trace.insidetextorientation,h="horizontal"===u,f="tangential"===u,p="radial"===u,d="auto"===u,m=[];if(!d){var g,y=function(r,i){if(function(e,t){var r=e.startangle,n=e.stopangle;return r>t&&t>n||r<t&&t<n}(t,r)){var s=Math.abs(r-t.startangle),l=Math.abs(r-t.stopangle),c=s<l?s:l;(a="tan"===i?k(e,n,o,c,0):T(e,n,o,c,Math.PI/2)).textPosAngle=r,m.push(a)}};if(h||f){for(g=4;g>=-4;g-=2)y(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)y(Math.PI*(g+1),"tan")}if(h||p){for(g=4;g>=-4;g-=2)y(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)y(Math.PI*(g+.5),"rad")}}if(s||d||h){var v=Math.sqrt(e.width*e.width+e.height*e.height);if((a={scale:i*n*2/v,rCenter:1-i,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,a.scale>=1)return a;m.push(a)}(d||p)&&((a=T(e,n,o,l,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(a)),(d||f)&&((a=k(e,n,o,l,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(a));for(var x=0,_=0,b=0;b<m.length;b++){var w=m[b].scale;if(_<w&&(_=w,x=b),!d&&_>=1)break}return m[x]}function T(e,t,r,n,i){t=Math.max(0,t-2*d);var a=e.width/e.height,o=S(a,n,t,r);return{scale:2*o/e.height,rCenter:A(a,o/t),rotate:M(i)}}function k(e,t,r,n,i){t=Math.max(0,t-2*d);var a=e.height/e.width,o=S(a,n,t,r);return{scale:2*o/e.width,rCenter:A(a,o/t),rotate:M(i+Math.PI/2)}}function A(e,t){return Math.cos(t)-e*t}function M(e){return(180/Math.PI*e+720)%180-90}function S(e,t,r,n){var i=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(e*e+n/2)+e))}function E(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function C(e,t){var r=t.pxmid[0],n=t.pxmid[1],i=e.width/2,a=e.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function I(e,t){var r,n,i,a=e.trace,o={x:e.cx,y:e.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=P(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*e.r,s.ty-=e.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*e.r);var l=function(e,t){return e/(void 0===t?1:t)}(e.r,e.trace.aspectratio),c=t.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(c+=l,o.x-=(1+i)*l,s.tx+=e.titleBox.width/2):-1!==a.title.position.indexOf("center")?c*=2:-1!==a.title.position.indexOf("right")&&(c+=l,o.x+=(1+i)*l,s.tx-=e.titleBox.width/2),r=c/e.titleBox.width,n=L(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function L(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function P(e){var t,r=e.pull;if(!r)return 0;if(s.isArrayOrTypedArray(r))for(r=0,t=0;t<e.pull.length;t++)e.pull[t]>r&&(r=e.pull[t]);return r}function z(e,t){for(var r=[],n=0;n<e.length;n++){var i=e[n][0],a=i.trace,o=a.domain,s=t.w*(o.x[1]-o.x[0]),l=t.h*(o.y[1]-o.y[0]);a.title.text&&"middle center"!==a.title.position&&(l-=L(i,t));var c=s/2,u=l/2;"funnelarea"===a.type&&!a.scalegroup&&(u/=a.aspectratio),i.r=Math.min(c,u)/(1+P(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])-l/2,a.title.text&&-1!==a.title.position.indexOf("bottom")&&(i.cy-=L(i,t)),a.scalegroup&&-1===r.indexOf(a.scalegroup)&&r.push(a.scalegroup)}!function(e,t){for(var r,n,i,a=0;a<t.length;a++){var o=1/0,s=t[a];for(n=0;n<e.length;n++)if((i=(r=e[n][0]).trace).scalegroup===s){var l;if("pie"===i.type)l=r.r*r.r;else if("funnelarea"===i.type){var c,u;i.aspectratio>1?u=(c=r.r)/i.aspectratio:c=(u=r.r)*i.aspectratio,l=(c*=(1+i.baseratio)/2)*u}o=Math.min(o,l/r.vTotal)}for(n=0;n<e.length;n++)if((i=(r=e[n][0]).trace).scalegroup===s){var h=o*r.vTotal;"funnelarea"===i.type&&(h/=(1+i.baseratio)/2,h/=i.aspectratio),r.r=Math.sqrt(h)}}}(e,r)}function D(e,t){return[e*Math.sin(t),-e*Math.cos(t)]}function O(e,t,r){var n,i=e._fullLayout,a=r.trace,o=a.texttemplate,l=a.textinfo;if(!o&&l&&"none"!==l){var c,u=l.split("+"),h=function(e){return-1!==u.indexOf(e)},f=h("label"),p=h("text"),d=h("value"),g=h("percent"),v=i.separators;if(c=f?[t.label]:[],p){var x=m.getFirstFilled(a.text,t.pts);y(x)&&c.push(x)}d&&c.push(m.formatPieValue(t.v,v)),g&&c.push(m.formatPiePercent(t.v/r.vTotal,v)),t.text=c.join("<br>")}if(o){var _=s.castOption(a,t.i,"texttemplate");if(_){var b={label:(n=t).label,value:n.v,valueLabel:m.formatPieValue(n.v,i.separators),percent:n.v/r.vTotal,percentLabel:m.formatPiePercent(n.v/r.vTotal,i.separators),color:n.color,text:n.text,customdata:s.castOption(a,n.i,"customdata")},w=m.getFirstFilled(a.text,t.pts);(y(w)||""===w)&&(b.text=w),t.text=s.texttemplateString({data:[b,a._meta],fallback:a.texttemplatefallback,labels:b,locale:e._fullLayout._d3locale,template:_})}else t.text=""}}function R(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=a*n-o*i,e.textY=a*i+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var i=e._context.staticPlot,h=e._fullLayout,d=h._size;p("pie",h),_(t,e),z(t,d);var g=s.makeTraceGroups(h._pielayer,t,"trace").each((function(t){var p=r.select(this),g=t[0],y=g.trace;(function(e){var t,r,n,i=e[0],a=i.r,o=i.trace,s=m.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;t<e.length&&e[t].hidden;t++);if(t===e.length)return;s+=l*e[t].v,l*=-1,c="px1",u="px0"}for(n=D(a,s),t=0;t<e.length;t++)!(r=e[t]).hidden&&(r[c]=n,r.startangle=s,s+=l*r.v/2,r.pxmid=D(a,s),r.midangle=s,n=D(a,s+=l*r.v/2),r.stopangle=s,r[u]=n,r.largeArc=r.v>i.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=E(r,i))})(t),p.attr("stroke-linejoin","round"),p.each((function(){var _=r.select(this).selectAll("g.slice").data(t);_.enter().append("g").classed("slice",!0),_.exit().remove();var b=[[[],[]],[[],[]]],T=!1;_.each((function(n,a){if(n.hidden)r.select(this).selectAll("path,g").remove();else{n.pointNumber=n.i,n.curveNumber=y.index,b[n.pxmid[1]<0?0:1][n.pxmid[0]<0?0:1].push(n);var l=g.cx,c=g.cy,p=r.select(this),d=p.selectAll("path.surface").data([n]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":i?"none":"all"}),p.call(v,e,t),y.pull){var _=+m.castOption(y.pull,n.pts)||0;_>0&&(l+=_*n.pxmid[0],c+=_*n.pxmid[1])}n.cxFinal=l,n.cyFinal=c;var k=y.hole;if(n.v===g.vTotal){var A="M"+(l+n.px0[0])+","+(c+n.px0[1])+L(n.px0,n.pxmid,!0,1)+L(n.pxmid,n.px0,!0,1)+"Z";k?d.attr("d","M"+(l+k*n.px0[0])+","+(c+k*n.px0[1])+L(n.px0,n.pxmid,!1,k)+L(n.pxmid,n.px0,!1,k)+"Z"+A):d.attr("d",A)}else{var M=L(n.px0,n.px1,!0,1);if(k){var S=1-k;d.attr("d","M"+(l+k*n.px1[0])+","+(c+k*n.px1[1])+L(n.px1,n.px0,!1,k)+"l"+S*n.px0[0]+","+S*n.px0[1]+M+"Z")}else d.attr("d","M"+l+","+c+"l"+n.px0[0]+","+n.px0[1]+M+"Z")}O(e,n,g);var E=m.castOption(y.textposition,n.pts),I=p.selectAll("g.slicetext").data(n.text&&"none"!==E?[0]:[]);I.enter().append("g").classed("slicetext",!0),I.exit().remove(),I.each((function(){var i=s.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),p=s.ensureUniformFontSize(e,"outside"===E?function(e,t,r){return{color:m.castOption(e.outsidetextfont.color,t.pts)||m.castOption(e.textfont.color,t.pts)||r.color,family:m.castOption(e.outsidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,size:m.castOption(e.outsidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size,weight:m.castOption(e.outsidetextfont.weight,t.pts)||m.castOption(e.textfont.weight,t.pts)||r.weight,style:m.castOption(e.outsidetextfont.style,t.pts)||m.castOption(e.textfont.style,t.pts)||r.style,variant:m.castOption(e.outsidetextfont.variant,t.pts)||m.castOption(e.textfont.variant,t.pts)||r.variant,textcase:m.castOption(e.outsidetextfont.textcase,t.pts)||m.castOption(e.textfont.textcase,t.pts)||r.textcase,lineposition:m.castOption(e.outsidetextfont.lineposition,t.pts)||m.castOption(e.textfont.lineposition,t.pts)||r.lineposition,shadow:m.castOption(e.outsidetextfont.shadow,t.pts)||m.castOption(e.textfont.shadow,t.pts)||r.shadow}}(y,n,h.font):x(y,n,h.font));i.text(n.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,p).call(u.convertToTspans,e);var d,v=o.bBox(i.node());if("outside"===E)d=C(v,n);else if(d=w(v,n,g),"auto"===E&&d.scale<1){var _=s.ensureUniformFontSize(e,y.outsidetextfont);i.call(o.font,_),d=C(v=o.bBox(i.node()),n)}var b=d.textPosAngle,k=void 0===b?n.pxmid:D(g.r,b);if(d.targetX=l+k[0]*d.rCenter+(d.x||0),d.targetY=c+k[1]*d.rCenter+(d.y||0),R(d,v),d.outside){var A=d.targetY;n.yLabelMin=A-v.height/2,n.yLabelMid=A,n.yLabelMax=A+v.height/2,n.labelExtraX=0,n.labelExtraY=0,T=!0}d.fontSize=p.size,f(y.type,d,h),t[a].transform=d,s.setTransormAndDisplay(i,d)}))}function L(e,t,r,i){var a=i*(t[0]-e[0]),o=i*(t[1]-e[1]);return"a"+i*g.r+","+i*g.r+" 0 "+n.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var k=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(k.enter().append("g").classed("titletext",!0),k.exit().remove(),k.each((function(){var t,n=s.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),i=y.title.text;y._meta&&(i=s.templateString(i,y._meta)),n.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(o.font,y.title.font).call(u.convertToTspans,e),t="middle center"===y.title.position?function(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}}(g):I(g,d),n.attr("transform",c(t.x,t.y)+l(Math.min(1,t.scale))+c(t.tx,t.ty))})),T&&function(e,t){var r,n,i,a,o,l,c,u,h,f,p,d,g;function y(e,t){return e.pxmid[1]-t.pxmid[1]}function v(e,t){return t.pxmid[1]-e.pxmid[1]}function x(e,r){r||(r={});var i,u,h,p,d=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?e.yLabelMin:e.yLabelMax,y=n?e.yLabelMax:e.yLabelMin,v=e.cyFinal+o(e.px0[1],e.px1[1]),x=d-g;if(x*c>0&&(e.labelExtraY=x),s.isArrayOrTypedArray(t.pull))for(u=0;u<f.length;u++)!((h=f[u])===e||(m.castOption(t.pull,e.pts)||0)>=(m.castOption(t.pull,h.pts)||0))&&((e.pxmid[1]-h.pxmid[1])*c>0?(x=h.cyFinal+o(h.px0[1],h.px1[1])-g-e.labelExtraY)*c>0&&(e.labelExtraY+=x):(y+e.labelExtraY-v)*c>0&&(i=3*l*Math.abs(u-f.indexOf(e)),(p=h.cxFinal+a(h.px0[0],h.px1[0])+i-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=p)))}for(n=0;n<2;n++)for(i=n?y:v,o=n?Math.max:Math.min,c=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,l=r?1:-1,(u=e[n][r]).sort(i),h=e[1-n][r],f=h.concat(u),d=[],p=0;p<u.length;p++)void 0!==u[p].yLabelMid&&d.push(u[p]);for(g=!1,p=0;n&&p<h.length;p++)if(void 0!==h[p].yLabelMid){g=h[p];break}for(p=0;p<d.length;p++){var _=p&&d[p-1];g&&!p&&(_=g),x(d[p],_)}}}(b,y),function(e,t){e.each((function(e){var n=r.select(this);if(e.labelExtraX||e.labelExtraY){var i=n.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],l="M"+o+","+(e.cyFinal+e.pxmid[1]),c=(e.yLabelMax-e.yLabelMin)*(e.pxmid[0]<0?-1:1)/4;if(e.labelExtraX){var u=e.labelExtraX*e.pxmid[1]/e.pxmid[0],h=e.yLabelMid+e.labelExtraY-(e.cyFinal+e.pxmid[1]);Math.abs(u)>Math.abs(h)?l+="l"+h*e.pxmid[0]/e.pxmid[1]+","+h+"H"+(o+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(h-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(n,"path","textline").call(a.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else n.select("path.textline").remove()}))}(_,y),T&&y.automargin){var A=o.bBox(p.node()),M=y.domain,S=d.w*(M.x[1]-M.x[0]),E=d.h*(M.y[1]-M.y[0]),L=(.5*S-g.r)/d.w,P=(.5*E-g.r)/d.h;n.autoMargin(e,"pie."+y.uid+".automargin",{xl:M.x[0]-L,xr:M.x[1]+L,yb:M.y[0]-P,yt:M.y[1]+P,l:Math.max(g.cx-g.r-A.left,0),r:Math.max(A.right-(g.cx+g.r),0),b:Math.max(A.bottom-(g.cy+g.r),0),t:Math.max(g.cy-g.r-A.top,0),pad:5})}}))}));setTimeout((function(){g.selectAll("tspan").each((function(){var e=r.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:O,transformInsideText:w,determineInsideTextFont:x,positionTitleOutside:I,prerenderTitles:_,layoutAreas:z,attachFxHandlers:v,computeTransform:R}}}),nh=m({"src/traces/pie/style.js"(e,t){var r=b(),n=kr(),i=Qa().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=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(t){r.select(this).call(n,t,i,e)}))}))}}}),ih=m({"src/traces/pie/base_plot.js"(e){var t=At();e.name="pie",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),ah=m({"src/traces/pie/index.js"(e,t){t.exports={attributes:$u(),supplyDefaults:Ku().supplyDefaults,supplyLayoutDefaults:Qu(),layoutAttributes:Ju(),calc:eh().calc,crossTraceCalc:eh().crossTraceCalc,plot:rh().plot,style:nh(),styleOne:kr(),moduleType:"trace",name:"pie",basePlotModule:ih(),categories:["pie-like","pie","showLegend"],meta:{}}}}),oh=m({"lib/pie.js"(e,t){t.exports=ah()}}),sh=m({"src/traces/sunburst/base_plot.js"(e){var t=At();e.name="sunburst",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),lh=m({"src/traces/sunburst/constants.js"(e,t){t.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),ch=m({"src/traces/sunburst/attributes.js"(e,t){var r=q(),{hovertemplateAttrs:n,texttemplateAttrs:i,templatefallbackAttrs:a}=Fe(),o=zt(),s=Ma().attributes,l=$u(),c=lh(),u=B().extendFlat,h=Oe().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({},l.marker.line.color,{dflt:null}),width:u({},l.marker.line.width,{dflt:1}),editType:"calc"},pattern:h,editType:"calc"},o("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:l.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:c.eventDataKeys.concat(["label","value"])}),texttemplatefallback:a({editType:"plot"}),hovertext:l.hovertext,hoverinfo:u({},r.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:n({},{keys:c.eventDataKeys}),hovertemplatefallback:a(),textfont:l.textfont,insidetextorientation:l.insidetextorientation,insidetextfont:l.insidetextfont,outsidetextfont:u({},l.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:l.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:s({name:"sunburst",trace:!0,editType:"calc"})}}}),uh=m({"src/traces/sunburst/layout_attributes.js"(e,t){t.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),hh=m({"src/traces/sunburst/defaults.js"(e,t){var r=ct(),n=ch(),i=Ma().defaults,a=Xa().handleText,o=Ku().handleMarkerDefaults,s=Yt(),l=s.hasColorscale,c=s.handleDefaults;t.exports=function(e,t,s,u){function h(i,a){return r.coerce(e,t,n,i,a)}var f=h("labels"),p=h("parents");if(f&&f.length&&p&&p.length){var d=h("values");d&&d.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),o(e,t,u,h);var m=t._hasColorscale=l(e,"marker","colors")||(e.marker||{}).coloraxis;m&&c(e,t,u,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",m?1:.7);var g=h("text");h("texttemplate"),h("texttemplatefallback"),t.texttemplate||h("textinfo",r.isArrayOrTypedArray(g)?"text+label":"label"),h("hovertext"),h("hovertemplate"),h("hovertemplatefallback"),a(e,t,u,h,"auto",{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("insidetextorientation"),h("sort"),h("rotation"),h("root.color"),i(t,u,h),t._length=null}else t.visible=!1}}}),fh=m({"src/traces/sunburst/layout_defaults.js"(e,t){var r=ct(),n=uh();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("sunburstcolorway",t.colorway),i("extendsunburstcolors")}}}),ph=m({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(e,t){var r,n;r=e,n=function(e){function t(e,t){return e.parent===t.parent?1:2}function r(e,t){return e+t.x}function n(e,t){return Math.max(e,t.y)}function i(e){var t=0,r=e.children,n=r&&r.length;if(n)for(;--n>=0;)t+=r[n].value;else t=1;e.value=t}function a(e,t){var r,n,i,a,s,u=new c(e),h=+e.value&&(u.value=e.value),f=[u];for(null==t&&(t=o);r=f.pop();)if(h&&(r.value=+r.data.value),(i=t(r.data))&&(s=i.length))for(r.children=new Array(s),a=s-1;a>=0;--a)f.push(n=r.children[a]=new c(i[a])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(e){return e.children}function s(e){e.data=e.data.data}function l(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function c(e){this.data=e,this.depth=this.height=0,this.parent=null}c.prototype=a.prototype={constructor:c,count:function(){return this.eachAfter(i)},each:function(e){var t,r,n,i,a=this,o=[a];do{for(t=o.reverse(),o=[];a=t.pop();)if(e(a),r=a.children)for(n=0,i=r.length;n<i;++n)o.push(r[n])}while(o.length);return this},eachAfter:function(e){for(var t,r,n,i=this,a=[i],o=[];i=a.pop();)if(o.push(i),t=i.children)for(r=0,n=t.length;r<n;++r)a.push(t[r]);for(;i=o.pop();)e(i);return this},eachBefore:function(e){for(var t,r,n=this,i=[n];n=i.pop();)if(e(n),t=n.children)for(r=t.length-1;r>=0;--r)i.push(t[r]);return this},sum:function(e){return this.eachAfter((function(t){for(var r=+e(t.data)||0,n=t.children,i=n&&n.length;--i>=0;)r+=n[i].value;t.value=r}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),i=null;for(e=r.pop(),t=n.pop();e===t;)i=e,e=r.pop(),t=n.pop();return i}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var i=n.length;e!==r;)n.splice(i,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(r){r!==e&&t.push({source:r.parent,target:r})})),t},copy:function(){return a(this).eachBefore(s)}};var u=Array.prototype.slice;function h(e){for(var t,r,n=0,i=(e=function(e){for(var t,r,n=e.length;n;)r=Math.random()*n--|0,t=e[n],e[n]=e[r],e[r]=t;return e}(u.call(e))).length,a=[];n<i;)t=e[n],r&&d(r,t)?++n:(r=g(a=f(a,t)),n=0);return r}function f(e,t){var r,n;if(m(t,e))return[t];for(r=0;r<e.length;++r)if(p(t,e[r])&&m(y(e[r],t),e))return[e[r],t];for(r=0;r<e.length-1;++r)for(n=r+1;n<e.length;++n)if(p(y(e[r],e[n]),t)&&p(y(e[r],t),e[n])&&p(y(e[n],t),e[r])&&m(v(e[r],e[n],t),e))return[e[r],e[n],t];throw new Error}function p(e,t){var r=e.r-t.r,n=t.x-e.x,i=t.y-e.y;return r<0||r*r<n*n+i*i}function d(e,t){var r=e.r-t.r+1e-6,n=t.x-e.x,i=t.y-e.y;return r>0&&r*r>n*n+i*i}function m(e,t){for(var r=0;r<t.length;++r)if(!d(e,t[r]))return!1;return!0}function g(e){switch(e.length){case 1:return function(e){return{x:e.x,y:e.y,r:e.r}}(e[0]);case 2:return y(e[0],e[1]);case 3:return v(e[0],e[1],e[2])}}function y(e,t){var r=e.x,n=e.y,i=e.r,a=t.x,o=t.y,s=t.r,l=a-r,c=o-n,u=s-i,h=Math.sqrt(l*l+c*c);return{x:(r+a+l/h*u)/2,y:(n+o+c/h*u)/2,r:(h+i+s)/2}}function v(e,t,r){var n=e.x,i=e.y,a=e.r,o=t.x,s=t.y,l=t.r,c=r.x,u=r.y,h=r.r,f=n-o,p=n-c,d=i-s,m=i-u,g=l-a,y=h-a,v=n*n+i*i-a*a,x=v-o*o-s*s+l*l,_=v-c*c-u*u+h*h,b=p*d-f*m,w=(d*_-m*x)/(2*b)-n,T=(m*g-d*y)/b,k=(p*x-f*_)/(2*b)-i,A=(f*y-p*g)/b,M=T*T+A*A-1,S=2*(a+w*T+k*A),E=w*w+k*k-a*a,C=-(M?(S+Math.sqrt(S*S-4*M*E))/(2*M):E/S);return{x:n+w+T*C,y:i+k+A*C,r:C}}function x(e,t,r){var n,i,a,o,s=e.x-t.x,l=e.y-t.y,c=s*s+l*l;c?(i=t.r+r.r,i*=i,o=e.r+r.r,i>(o*=o)?(n=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-n*n)),r.x=e.x-n*s-a*l,r.y=e.y-n*l+a*s):(n=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-n*n)),r.x=t.x+n*s-a*l,r.y=t.y+n*l+a*s)):(r.x=t.x+r.r,r.y=t.y)}function _(e,t){var r=e.r+t.r-1e-6,n=t.x-e.x,i=t.y-e.y;return r>0&&r*r>n*n+i*i}function b(e){var t=e._,r=e.next._,n=t.r+r.r,i=(t.x*r.r+r.x*t.r)/n,a=(t.y*r.r+r.y*t.r)/n;return i*i+a*a}function w(e){this._=e,this.next=null,this.previous=null}function T(e){if(!(i=e.length))return 0;var t,r,n,i,a,o,s,l,c,u,f;if((t=e[0]).x=0,t.y=0,!(i>1))return t.r;if(r=e[1],t.x=-r.r,r.x=t.r,r.y=0,!(i>2))return t.r+r.r;x(r,t,n=e[2]),t=new w(t),r=new w(r),n=new w(n),t.next=n.previous=r,r.next=t.previous=n,n.next=r.previous=t;e:for(s=3;s<i;++s){x(t._,r._,n=e[s]),n=new w(n),l=r.next,c=t.previous,u=r._.r,f=t._.r;do{if(u<=f){if(_(l._,n._)){r=l,t.next=r,r.previous=t,--s;continue e}u+=l._.r,l=l.next}else{if(_(c._,n._)){(t=c).next=r,r.previous=t,--s;continue e}f+=c._.r,c=c.previous}}while(l!==c.next);for(n.previous=t,n.next=r,t.next=r.previous=r=n,a=b(t);(n=n.next)!==r;)(o=b(n))<a&&(t=n,a=o);r=t.next}for(t=[r._],n=r;(n=n.next)!==r;)t.push(n._);for(n=h(t),s=0;s<i;++s)(t=e[s]).x-=n.x,t.y-=n.y;return n.r}function k(e){if("function"!=typeof e)throw new Error;return e}function A(){return 0}function M(e){return function(){return e}}function S(e){return Math.sqrt(e.value)}function E(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function C(e,t){return function(r){if(n=r.children){var n,i,a,o=n.length,s=e(r)*t||0;if(s)for(i=0;i<o;++i)n[i].r+=s;if(a=T(n),s)for(i=0;i<o;++i)n[i].r-=s;r.r=a+s}}}function I(e){return function(t){var r=t.parent;t.r*=e,r&&(t.x=r.x+e*t.x,t.y=r.y+e*t.y)}}function L(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 P(e,t,r,n,i){for(var a,o=e.children,s=-1,l=o.length,c=e.value&&(n-t)/e.value;++s<l;)(a=o[s]).y0=r,a.y1=i,a.x0=t,a.x1=t+=a.value*c}var z={depth:-1},D={};function O(e){return e.id}function R(e){return e.parentId}function F(e,t){return e.parent===t.parent?1:2}function B(e){var t=e.children;return t?t[0]:e.t}function j(e){var t=e.children;return t?t[t.length-1]:e.t}function N(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function U(e,t,r){return e.a.parent===t.parent?e.a:r}function V(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}function q(e,t,r,n,i){for(var a,o=e.children,s=-1,l=o.length,c=e.value&&(i-r)/e.value;++s<l;)(a=o[s]).x0=t,a.x1=n,a.y0=r,a.y1=r+=a.value*c}V.prototype=Object.create(c.prototype);var H=(1+Math.sqrt(5))/2;function G(e,t,r,n,i,a){for(var o,s,l,c,u,h,f,p,d,m,g,y=[],v=t.children,x=0,_=0,b=v.length,w=t.value;x<b;){l=i-r,c=a-n;do{u=v[_++].value}while(!u&&_<b);for(h=f=u,g=u*u*(m=Math.max(c/l,l/c)/(w*e)),d=Math.max(f/g,g/h);_<b;++_){if(u+=s=v[_].value,s<h&&(h=s),s>f&&(f=s),g=u*u*m,(p=Math.max(f/g,g/h))>d){u-=s;break}d=p}y.push(o={value:u,dice:l<c,children:v.slice(x,_)}),o.dice?P(o,r,n,i,w?n+=c*u/w:a):q(o,r,n,w?r+=l*u/w:i,a),w-=u,x=_}return y}var W=function e(t){function r(e,r,n,i,a){G(t,e,r,n,i,a)}return r.ratio=function(t){return e((t=+t)>1?t:1)},r}(H),Z=function e(t){function r(e,r,n,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,l,c,u,h=-1,f=o.length,p=e.value;++h<f;){for(l=(s=o[h]).children,c=s.value=0,u=l.length;c<u;++c)s.value+=l[c].value;s.dice?P(s,r,n,i,n+=(a-n)*s.value/p):q(s,r,n,r+=(i-r)*s.value/p,a),p-=s.value}else e._squarify=o=G(t,e,r,n,i,a),o.ratio=t}return r.ratio=function(t){return e((t=+t)>1?t:1)},r}(H);e.cluster=function(){var e=t,i=1,a=1,o=!1;function s(t){var s,l=0;t.eachAfter((function(t){var i=t.children;i?(t.x=function(e){return e.reduce(r,0)/e.length}(i),t.y=function(e){return 1+e.reduce(n,0)}(i)):(t.x=s?l+=e(t,s):0,t.y=0,s=t)}));var c=function(e){for(var t;t=e.children;)e=t[0];return e}(t),u=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(t),h=c.x-e(c,u)/2,f=u.x+e(u,c)/2;return t.eachAfter(o?function(e){e.x=(e.x-t.x)*i,e.y=(t.y-e.y)*a}:function(e){e.x=(e.x-h)/(f-h)*i,e.y=(1-(t.y?e.y/t.y:1))*a})}return s.separation=function(t){return arguments.length?(e=t,s):e},s.size=function(e){return arguments.length?(o=!1,i=+e[0],a=+e[1],s):o?null:[i,a]},s.nodeSize=function(e){return arguments.length?(o=!0,i=+e[0],a=+e[1],s):o?[i,a]:null},s},e.hierarchy=a,e.pack=function(){var e=null,t=1,r=1,n=A;function i(i){return i.x=t/2,i.y=r/2,e?i.eachBefore(E(e)).eachAfter(C(n,.5)).eachBefore(I(1)):i.eachBefore(E(S)).eachAfter(C(A,1)).eachAfter(C(n,i.r/Math.min(t,r))).eachBefore(I(Math.min(t,r)/(2*i.r))),i}return i.radius=function(t){return arguments.length?(e=function(e){return null==e?null:k(e)}(t),i):e},i.size=function(e){return arguments.length?(t=+e[0],r=+e[1],i):[t,r]},i.padding=function(e){return arguments.length?(n="function"==typeof e?e:M(+e),i):n},i},e.packEnclose=h,e.packSiblings=function(e){return T(e),e},e.partition=function(){var e=1,t=1,r=0,n=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=e,i.y1=t/a,i.eachBefore(function(e,t){return function(n){n.children&&P(n,n.x0,e*(n.depth+1)/t,n.x1,e*(n.depth+2)/t);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o<i&&(i=o=(i+o)/2),s<a&&(a=s=(a+s)/2),n.x0=i,n.y0=a,n.x1=o,n.y1=s}}(t,a)),n&&i.eachBefore(L),i}return i.round=function(e){return arguments.length?(n=!!e,i):n},i.size=function(r){return arguments.length?(e=+r[0],t=+r[1],i):[e,t]},i.padding=function(e){return arguments.length?(r=+e,i):r},i},e.stratify=function(){var e=O,t=R;function r(r){var n,i,a,o,s,u,h,f=r.length,p=new Array(f),d={};for(i=0;i<f;++i)n=r[i],s=p[i]=new c(n),null!=(u=e(n,i,r))&&(u+="")&&(d[h="$"+(s.id=u)]=h in d?D:s);for(i=0;i<f;++i)if(s=p[i],null!=(u=t(r[i],i,r))&&(u+="")){if(!(o=d["$"+u]))throw new Error("missing: "+u);if(o===D)throw new Error("ambiguous: "+u);o.children?o.children.push(s):o.children=[s],s.parent=o}else{if(a)throw new Error("multiple roots");a=s}if(!a)throw new Error("no root");if(a.parent=z,a.eachBefore((function(e){e.depth=e.parent.depth+1,--f})).eachBefore(l),a.parent=null,f>0)throw new Error("cycle");return a}return r.id=function(t){return arguments.length?(e=k(t),r):e},r.parentId=function(e){return arguments.length?(t=k(e),r):t},r},e.tree=function(){var e=F,t=1,r=1,n=null;function i(i){var l=function(e){for(var t,r,n,i,a,o=new V(e,0),s=[o];t=s.pop();)if(n=t._.children)for(t.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=t.children[i]=new V(n[i],i)),r.parent=t;return(o.parent=new V(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var c=i,u=i,h=i;i.eachBefore((function(e){e.x<c.x&&(c=e),e.x>u.x&&(u=e),e.depth>h.depth&&(h=e)}));var f=c===u?1:e(c,u)/2,p=f-c.x,d=t/(u.x+f+p),m=r/(h.depth||1);i.eachBefore((function(e){e.x=(e.x+p)*d,e.y=e.depth*m}))}return i}function a(t){var r=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(r){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(t);var a=(r[0].z+r[r.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=function(t,r,n){if(r){for(var i,a=t,o=t,s=r,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,f=l.m;s=j(s),a=B(a),s&&a;)l=B(l),(o=j(o)).a=t,(i=s.z+h-a.z-c+e(s._,a._))>0&&(N(U(s,t,n),t,i),c+=i,u+=i),h+=s.m,c+=a.m,f+=l.m,u+=o.m;s&&!j(o)&&(o.t=s,o.m+=h-u),a&&!B(l)&&(l.t=a,l.m+=c-f,n=t)}return n}(t,i,t.parent.A||n[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*r}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],i):n?null:[t,r]},i.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],i):n?[t,r]:null},i},e.treemap=function(){var e=W,t=!1,r=1,n=1,i=[0],a=A,o=A,s=A,l=A,c=A;function u(e){return e.x0=e.y0=0,e.x1=r,e.y1=n,e.eachBefore(h),i=[0],t&&e.eachBefore(L),e}function h(t){var r=i[t.depth],n=t.x0+r,u=t.y0+r,h=t.x1-r,f=t.y1-r;h<n&&(n=h=(n+h)/2),f<u&&(u=f=(u+f)/2),t.x0=n,t.y0=u,t.x1=h,t.y1=f,t.children&&(r=i[t.depth+1]=a(t)/2,n+=c(t)-r,u+=o(t)-r,(h-=s(t)-r)<n&&(n=h=(n+h)/2),(f-=l(t)-r)<u&&(u=f=(u+f)/2),e(t,n,u,h,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(r=+e[0],n=+e[1],u):[r,n]},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="function"==typeof e?e:M(+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="function"==typeof e?e:M(+e),u):o},u.paddingRight=function(e){return arguments.length?(s="function"==typeof e?e:M(+e),u):s},u.paddingBottom=function(e){return arguments.length?(l="function"==typeof e?e:M(+e),u):l},u.paddingLeft=function(e){return arguments.length?(c="function"==typeof e?e:M(+e),u):c},u},e.treemapBinary=function(e,t,r,n,i){var a,o,s=e.children,l=s.length,c=new Array(l+1);for(c[0]=o=a=0;a<l;++a)c[a+1]=o+=s[a].value;!function e(t,r,n,i,a,o,l){if(t>=r-1){var u=s[t];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}for(var h=c[t],f=n/2+h,p=t+1,d=r-1;p<d;){var m=p+d>>>1;c[m]<f?p=m+1:d=m}f-c[p-1]<c[p]-f&&t+1<p&&--p;var g=c[p]-h,y=n-g;if(o-i>l-a){var v=(i*y+o*g)/n;e(t,p,g,i,a,v,l),e(p,r,y,v,a,o,l)}else{var x=(a*y+l*g)/n;e(t,p,g,i,a,o,x),e(p,r,y,i,x,o,l)}}(0,l,e.value,t,r,n,i)},e.treemapDice=P,e.treemapResquarify=Z,e.treemapSlice=q,e.treemapSliceDice=function(e,t,r,n,i){(1&e.depth?q:P)(e,t,r,n,i)},e.treemapSquarify=W,Object.defineProperty(e,"__esModule",{value:!0})},n("object"==typeof e&&typeof t<"u"?e:(r=r||self).d3=r.d3||{})}}),dh=m({"src/traces/sunburst/calc.js"(e){var t=ph(),r=M(),n=ct(),i=Yt().makeColorScaleFuncFromTrace,a=eh().makePullColorFn,o=eh().generateExtendedColors,s=Yt().calc,l=S().ALMOST_EQUAL,c={},u={},h={};function f(e,t,r){var n=0,i=e.children;if(i){for(var a=i.length,o=0;o<a;o++)n+=f(i[o],t,r);r.branches&&n++}else r.leaves&&n++;return e.value=e.data.data.value=n,t._values||(t._values=[]),t._values[e.data.data.i]=n,n}e.calc=function(e,o){var c,u,h,p,d,m,g=e._fullLayout,y=o.ids,v=n.isArrayOrTypedArray(y),x=o.labels,_=o.parents,b=o.values,w=n.isArrayOrTypedArray(b),T=[],k={},A={},M=function(e){return e||"number"==typeof e},S=function(e){return!w||r(b[e])&&b[e]>=0};v?(c=Math.min(y.length,_.length),u=function(e){return M(y[e])&&S(e)},h=function(e){return String(y[e])}):(c=Math.min(x.length,_.length),u=function(e){return M(x[e])&&S(e)},h=function(e){return String(x[e])}),w&&(c=Math.min(c,b.length));for(var E=0;E<c;E++)if(u(E)){var C=h(E),I=M(_[E])?String(_[E]):"",L={i:E,id:C,pid:I,label:M(x[E])?String(x[E]):""};w&&(L.v=+b[E]),T.push(L),d=C,k[p=I]?k[p].push(d):k[p]=[d],A[d]=1}if(k[""]){if(k[""].length>1){for(var P=n.randstr(),z=0;z<T.length;z++)""===T[z].pid&&(T[z].pid=P);T.unshift({hasMultipleRoots:!0,id:P,pid:"",label:""})}}else{var D,O=[];for(D in k)A[D]||O.push(D);if(1!==O.length)return n.warn(["Multiple implied roots, cannot build",o.type,"hierarchy of",o.name+".","These roots include:",O.join(", ")].join(" "));D=O[0],T.unshift({hasImpliedRoot:!0,id:D,pid:"",label:D})}try{m=t.stratify().id((function(e){return e.id})).parentId((function(e){return e.pid}))(T)}catch(p){return n.warn(["Failed to build",o.type,"hierarchy of",o.name+".","Error:",p.message].join(" "))}var R=t.hierarchy(m),F=!1;if(w)switch(o.branchvalues){case"remainder":R.sum((function(e){return e.data.v}));break;case"total":R.each((function(e){var t=e.data.data,r=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)&&(r=i),r<i*l)return F=!0,n.warn(["Total value for node",e.data.data.id,"of",o.name,"is smaller than the sum of its children.","\nparent value =",r,"\nchildren sum =",i].join(" "))}e.value=r}))}else f(R,o,{branches:-1!==o.count.indexOf("branches"),leaves:-1!==o.count.indexOf("leaves")});if(!F){o.sort&&R.sort((function(e,t){return t.value-e.value}));var B,j,N=o.marker.colors||[],U=!!N.length;return o._hasColorscale?(U||(N=w?o.values:o._values),s(e,o,{vals:N,containerStr:"marker",cLetter:"c"}),j=i(o.marker)):B=a(g["_"+o.type+"colormap"]),R.each((function(e){var t=e.data.data;t.color=o._hasColorscale?j(N[t.i]):B(N[t.i],t.id)})),T[0].hierarchy=R,T}},e._runCrossTraceCalc=function(e,t){var r=t._fullLayout,n=t.calcdata,i=r[e+"colorway"],a=r["_"+e+"colormap"];r["extend"+e+"colors"]&&(i=o(i,"icicle"===e?h:"treemap"===e?u:c));var s,l=0;function f(e){var t=e.data.data,r=t.id;!1===t.color&&(a[r]?t.color=a[r]:e.parent?e.parent.parent?t.color=e.parent.data.data.color:(a[r]=t.color=i[l%i.length],l++):t.color=s)}for(var p=0;p<n.length;p++){var d=n[p][0];d.trace.type===e&&d.hierarchy&&(s=d.trace.root.color,d.hierarchy.each(f))}},e.crossTraceCalc=function(t){return e._runCrossTraceCalc("sunburst",t)}}});function mh(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function gh(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}var yh=d({"node_modules/d3-color/src/define.js"(){}});function vh(){}function xh(){return this.rgb().formatHex()}function _h(){return this.rgb().formatHex8()}function bh(){return Rh(this).formatHsl()}function wh(){return this.rgb().formatRgb()}function Th(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Zh.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?kh(t):3===r?new Eh(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?Ah(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?Ah(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Yh.exec(e))?new Eh(t[1],t[2],t[3],1):(t=Xh.exec(e))?new Eh(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=$h.exec(e))?Ah(t[1],t[2],t[3],t[4]):(t=Kh.exec(e))?Ah(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Jh.exec(e))?Oh(t[1],t[2]/100,t[3]/100,1):(t=Qh.exec(e))?Oh(t[1],t[2]/100,t[3]/100,t[4]):ef.hasOwnProperty(e)?kh(ef[e]):"transparent"===e?new Eh(NaN,NaN,NaN,0):null}function kh(e){return new Eh(e>>16&255,e>>8&255,255&e,1)}function Ah(e,t,r,n){return n<=0&&(e=t=r=NaN),new Eh(e,t,r,n)}function Mh(e){return e instanceof vh||(e=Th(e)),e?new Eh((e=e.rgb()).r,e.g,e.b,e.opacity):new Eh}function Sh(e,t,r,n){return 1===arguments.length?Mh(e):new Eh(e,t,r,n??1)}function Eh(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function Ch(){return`#${Dh(this.r)}${Dh(this.g)}${Dh(this.b)}`}function Ih(){return`#${Dh(this.r)}${Dh(this.g)}${Dh(this.b)}${Dh(255*(isNaN(this.opacity)?1:this.opacity))}`}function Lh(){let e=Ph(this.opacity);return`${1===e?"rgb(":"rgba("}${zh(this.r)}, ${zh(this.g)}, ${zh(this.b)}${1===e?")":`, ${e})`}`}function Ph(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zh(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Dh(e){return((e=zh(e))<16?"0":"")+e.toString(16)}function Oh(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Bh(e,t,r,n)}function Rh(e){if(e instanceof Bh)return new Bh(e.h,e.s,e.l,e.opacity);if(e instanceof vh||(e=Th(e)),!e)return new Bh;if(e instanceof Bh)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(o=t===a?(r-n)/s+6*(r<n):r===a?(n-t)/s+2:(t-r)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new Bh(o,s,l,e.opacity)}function Fh(e,t,r,n){return 1===arguments.length?Rh(e):new Bh(e,t,r,n??1)}function Bh(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function jh(e){return(e=(e||0)%360)<0?e+360:e}function Nh(e){return Math.max(0,Math.min(1,e||0))}function Uh(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}var Vh,qh,Hh,Gh,Wh,Zh,Yh,Xh,$h,Kh,Jh,Qh,ef,tf,rf,nf=d({"node_modules/d3-color/src/color.js"(){yh(),qh=1/(Vh=.7),Hh="\\s*([+-]?\\d+)\\s*",Gh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Wh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zh=/^#([0-9a-f]{3,8})$/,Yh=new RegExp(`^rgb\\(${Hh},${Hh},${Hh}\\)$`),Xh=new RegExp(`^rgb\\(${Wh},${Wh},${Wh}\\)$`),$h=new RegExp(`^rgba\\(${Hh},${Hh},${Hh},${Gh}\\)$`),Kh=new RegExp(`^rgba\\(${Wh},${Wh},${Wh},${Gh}\\)$`),Jh=new RegExp(`^hsl\\(${Gh},${Wh},${Wh}\\)$`),Qh=new RegExp(`^hsla\\(${Gh},${Wh},${Wh},${Gh}\\)$`),ef={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},mh(vh,Th,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xh,formatHex:xh,formatHex8:_h,formatHsl:bh,formatRgb:wh,toString:wh}),mh(Eh,Sh,gh(vh,{brighter(e){return e=null==e?qh:Math.pow(qh,e),new Eh(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Vh:Math.pow(Vh,e),new Eh(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Eh(zh(this.r),zh(this.g),zh(this.b),Ph(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:Ch,formatHex:Ch,formatHex8:Ih,formatRgb:Lh,toString:Lh})),mh(Bh,Fh,gh(vh,{brighter(e){return e=null==e?qh:Math.pow(qh,e),new Bh(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Vh:Math.pow(Vh,e),new Bh(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Eh(Uh(e>=240?e-240:e+120,i,n),Uh(e,i,n),Uh(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Bh(jh(this.h),Nh(this.s),Nh(this.l),Ph(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=Ph(this.opacity);return`${1===e?"hsl(":"hsla("}${jh(this.h)}, ${100*Nh(this.s)}%, ${100*Nh(this.l)}%${1===e?")":`, ${e})`}`}}))}}),af=d({"node_modules/d3-color/src/math.js"(){tf=Math.PI/180,rf=180/Math.PI}});function of(e){if(e instanceof lf)return new lf(e.l,e.a,e.b,e.opacity);if(e instanceof df)return mf(e);e instanceof Eh||(e=Mh(e));var t,r,n=ff(e.r),i=ff(e.g),a=ff(e.b),o=cf((.2225045*n+.7168786*i+.0606169*a)/yf);return n===i&&i===a?t=r=o:(t=cf((.4360747*n+.3850649*i+.1430804*a)/gf),r=cf((.0139322*n+.0971045*i+.7141733*a)/vf)),new lf(116*o-16,500*(t-o),200*(o-r),e.opacity)}function sf(e,t,r,n){return 1===arguments.length?of(e):new lf(e,t,r,n??1)}function lf(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function cf(e){return e>wf?Math.pow(e,.3333333333333333):e/bf+xf}function uf(e){return e>_f?e*e*e:bf*(e-xf)}function hf(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055)}function ff(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function pf(e,t,r,n){return 1===arguments.length?function(e){if(e instanceof df)return new df(e.h,e.c,e.l,e.opacity);if(e instanceof lf||(e=of(e)),0===e.a&&0===e.b)return new df(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*rf;return new df(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new df(e,t,r,n??1)}function df(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function mf(e){if(isNaN(e.h))return new lf(e.l,0,0,e.opacity);var t=e.h*tf;return new lf(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}var gf,yf,vf,xf,_f,bf,wf,Tf=d({"node_modules/d3-color/src/lab.js"(){yh(),nf(),af(),gf=.96422,yf=1,vf=.82521,xf=4/29,bf=3*(_f=6/29)*_f,wf=_f*_f*_f,mh(lf,sf,gh(vh,{brighter(e){return new lf(this.l+18*(e??1),this.a,this.b,this.opacity)},darker(e){return new lf(this.l-18*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return new Eh(hf(3.1338561*(t=gf*uf(t))-1.6168667*(e=yf*uf(e))-.4906146*(r=vf*uf(r))),hf(-.9787684*t+1.9161415*e+.033454*r),hf(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),mh(df,pf,gh(vh,{brighter(e){return new df(this.h,this.c,this.l+18*(e??1),this.opacity)},darker(e){return new df(this.h,this.c,this.l-18*(e??1),this.opacity)},rgb(){return mf(this).rgb()}}))}});function kf(e,t,r,n){return 1===arguments.length?function(e){if(e instanceof Af)return new Af(e.h,e.s,e.l,e.opacity);e instanceof Eh||(e=Mh(e));var t=e.r/255,r=e.g/255,n=e.b/255,i=(Pf*n+If*t-Lf*r)/(Pf+If-Lf),a=n-i,o=(Cf*(r-i)-Sf*a)/Ef,s=Math.sqrt(o*o+a*a)/(Cf*i*(1-i)),l=s?Math.atan2(o,a)*rf-120:NaN;return new Af(l<0?l+360:l,s,i,e.opacity)}(e):new Af(e,t,r,n??1)}function Af(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}var Mf,Sf,Ef,Cf,If,Lf,Pf,zf=d({"node_modules/d3-color/src/cubehelix.js"(){yh(),nf(),af(),If=(Cf=1.97294)*(Ef=-.90649),Lf=Cf*(Mf=1.78277),Pf=Mf*(Sf=-.29227)-Ef*-.14861,mh(Af,kf,gh(vh,{brighter(e){return e=null==e?qh:Math.pow(qh,e),new Af(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Vh:Math.pow(Vh,e),new Af(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*tf,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),i=Math.sin(e);return new Eh(255*(t+r*(-.14861*n+Mf*i)),255*(t+r*(Sf*n+Ef*i)),255*(t+r*(Cf*n)),this.opacity)}}))}}),Df=d({"node_modules/d3-color/src/index.js"(){nf(),Tf(),zf()}});function Of(e,t,r,n,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*r+(1+3*e+3*a-3*o)*n+o*i)/6}function Rf(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],a=e[n+1],o=n>0?e[n-1]:2*i-a,s=n<t-1?e[n+2]:2*a-i;return Of((r-n/t)*t,o,i,a,s)}}var Ff=d({"node_modules/d3-interpolate/src/basis.js"(){}});function Bf(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],a=e[n%t],o=e[(n+1)%t],s=e[(n+2)%t];return Of((r-n/t)*t,i,a,o,s)}}var jf,Nf=d({"node_modules/d3-interpolate/src/basisClosed.js"(){Ff()}}),Uf=d({"node_modules/d3-interpolate/src/constant.js"(){jf=e=>()=>e}});function Vf(e,t){return function(r){return e+r*t}}function qf(e,t){var r=t-e;return r?Vf(e,r>180||r<-180?r-360*Math.round(r/360):r):jf(isNaN(e)?t:e)}function Hf(e,t){var r=t-e;return r?Vf(e,r):jf(isNaN(e)?t:e)}var Gf=d({"node_modules/d3-interpolate/src/color.js"(){Uf()}});function Wf(e){return function(t){var r,n,i=t.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;r<i;++r)n=Sh(t[r]),a[r]=n.r||0,o[r]=n.g||0,s[r]=n.b||0;return a=e(a),o=e(o),s=e(s),n.opacity=1,function(e){return n.r=a(e),n.g=o(e),n.b=s(e),n+""}}}var Zf,Yf,Xf,$f=d({"node_modules/d3-interpolate/src/rgb.js"(){Df(),Ff(),Nf(),Gf(),Zf=function e(t){var r=function(e){return 1==(e=+e)?Hf:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):jf(isNaN(t)?r:t)}}(t);function n(e,t){var n=r((e=Sh(e)).r,(t=Sh(t)).r),i=r(e.g,t.g),a=r(e.b,t.b),o=Hf(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+""}}return n.gamma=e,n}(1),Yf=Wf(Rf),Xf=Wf(Bf)}});function Kf(e,t){t||(t=[]);var r,n=e?Math.min(t.length,e.length):0,i=t.slice();return function(a){for(r=0;r<n;++r)i[r]=e[r]*(1-a)+t[r]*a;return i}}function Jf(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var Qf=d({"node_modules/d3-interpolate/src/numberArray.js"(){}});function ep(e,t){return(Jf(t)?Kf:tp)(e,t)}function tp(e,t){var r,n=t?t.length:0,i=e?Math.min(n,e.length):0,a=new Array(i),o=new Array(n);for(r=0;r<i;++r)a[r]=pp(e[r],t[r]);for(;r<n;++r)o[r]=t[r];return function(e){for(r=0;r<i;++r)o[r]=a[r](e);return o}}var rp=d({"node_modules/d3-interpolate/src/array.js"(){dp(),Qf()}});function np(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}var ip=d({"node_modules/d3-interpolate/src/date.js"(){}});function ap(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var op=d({"node_modules/d3-interpolate/src/number.js"(){}});function sp(e,t){var r,n={},i={};for(r in(null===e||"object"!=typeof e)&&(e={}),(null===t||"object"!=typeof t)&&(t={}),t)r in e?n[r]=pp(e[r],t[r]):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}var lp=d({"node_modules/d3-interpolate/src/object.js"(){dp()}});function cp(e,t){var r,n,i,a=up.lastIndex=hp.lastIndex=0,o=-1,s=[],l=[];for(e+="",t+="";(r=up.exec(e))&&(n=hp.exec(t));)(i=n.index)>a&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:ap(r,n)})),a=hp.lastIndex;return a<t.length&&(i=t.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var r,n=0;n<t;++n)s[(r=l[n]).i]=r.x(e);return s.join("")})}var up,hp,fp=d({"node_modules/d3-interpolate/src/string.js"(){op(),up=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hp=new RegExp(up.source,"g")}});function pp(e,t){var r,n=typeof t;return null==t||"boolean"===n?jf(t):("number"===n?ap:"string"===n?(r=Th(t))?(t=r,Zf):cp:t instanceof Th?Zf:t instanceof Date?np:Jf(t)?Kf:Array.isArray(t)?tp:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?sp:ap)(e,t)}var dp=d({"node_modules/d3-interpolate/src/value.js"(){Df(),$f(),rp(),ip(),op(),lp(),fp(),Uf(),Qf()}});function mp(e){var t=e.length;return function(r){return e[Math.max(0,Math.min(t-1,Math.floor(r*t)))]}}var gp=d({"node_modules/d3-interpolate/src/discrete.js"(){}});function yp(e,t){var r=qf(+e,+t);return function(e){var t=r(e);return t-360*Math.floor(t/360)}}var vp=d({"node_modules/d3-interpolate/src/hue.js"(){Gf()}});function xp(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var _p=d({"node_modules/d3-interpolate/src/round.js"(){}});function bp(e,t,r,n,i,a){var o,s,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*r+t*n)&&(r-=e*l,n-=t*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),e*n<t*r&&(e=-e,t=-t,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*wp,skewX:Math.atan(l)*wp,scaleX:o,scaleY:s}}var wp,Tp,kp=d({"node_modules/d3-interpolate/src/transform/decompose.js"(){wp=180/Math.PI,Tp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}}});function Ap(e){let t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Tp:bp(t.a,t.b,t.c,t.d,t.e,t.f)}function Mp(e){return null!=e&&(Sp||(Sp=document.createElementNS("http://www.w3.org/2000/svg","g")),Sp.setAttribute("transform",e),e=Sp.transform.baseVal.consolidate())?bp((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):Tp}var Sp,Ep=d({"node_modules/d3-interpolate/src/transform/parse.js"(){kp()}});function Cp(e,t,r,n){function i(e){return e.length?e.pop()+" ":""}return function(a,o){var s=[],l=[];return a=e(a),o=e(o),function(e,n,i,a,o,s){if(e!==i||n!==a){var l=o.push("translate(",null,t,null,r);s.push({i:l-4,x:ap(e,i)},{i:l-2,x:ap(n,a)})}else(i||a)&&o.push("translate("+i+t+a+r)}(a.translateX,a.translateY,o.translateX,o.translateY,s,l),function(e,t,r,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:ap(e,t)})):t&&r.push(i(r)+"rotate("+t+n)}(a.rotate,o.rotate,s,l),function(e,t,r,a){e!==t?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:ap(e,t)}):t&&r.push(i(r)+"skewX("+t+n)}(a.skewX,o.skewX,s,l),function(e,t,r,n,a,o){if(e!==r||t!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:ap(e,r)},{i:s-2,x:ap(t,n)})}else(1!==r||1!==n)&&a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(e){for(var t,r=-1,n=l.length;++r<n;)s[(t=l[r]).i]=t.x(e);return s.join("")}}}var Ip,Lp,Pp=d({"node_modules/d3-interpolate/src/transform/index.js"(){op(),Ep(),Ip=Cp(Ap,"px, ","px)","deg)"),Lp=Cp(Mp,", ",")",")")}});function zp(e){return((e=Math.exp(e))+1/e)/2}var Dp,Op=d({"node_modules/d3-interpolate/src/zoom.js"(){Dp=function e(t,r,n){function i(e,i){var a,o,s=e[0],l=e[1],c=e[2],u=i[0],h=i[1],f=i[2],p=u-s,d=h-l,m=p*p+d*d;if(m<1e-12)o=Math.log(f/c)/t,a=function(e){return[s+e*p,l+e*d,c*Math.exp(t*e*o)]};else{var g=Math.sqrt(m),y=(f*f-c*c+n*m)/(2*c*r*g),v=(f*f-c*c-n*m)/(2*f*r*g),x=Math.log(Math.sqrt(y*y+1)-y),_=Math.log(Math.sqrt(v*v+1)-v);o=(_-x)/t,a=function(e){var n=e*o,i=zp(x),a=c/(r*g)*(i*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(t*n+x)-function(e){return((e=Math.exp(e))-1/e)/2}(x));return[s+a*p,l+a*d,c*i/zp(t*n+x)]}}return a.duration=1e3*o*t/Math.SQRT2,a}return i.rho=function(t){var r=Math.max(.001,+t),n=r*r;return e(r,n,n*n)},i}(Math.SQRT2,2,4)}});function Rp(e){return function(t,r){var n=e((t=Fh(t)).h,(r=Fh(r)).h),i=Hf(t.s,r.s),a=Hf(t.l,r.l),o=Hf(t.opacity,r.opacity);return function(e){return t.h=n(e),t.s=i(e),t.l=a(e),t.opacity=o(e),t+""}}}var Fp,Bp,jp=d({"node_modules/d3-interpolate/src/hsl.js"(){Df(),Gf(),Fp=Rp(qf),Bp=Rp(Hf)}});function Np(e,t){var r=Hf((e=sf(e)).l,(t=sf(t)).l),n=Hf(e.a,t.a),i=Hf(e.b,t.b),a=Hf(e.opacity,t.opacity);return function(t){return e.l=r(t),e.a=n(t),e.b=i(t),e.opacity=a(t),e+""}}var Up=d({"node_modules/d3-interpolate/src/lab.js"(){Df(),Gf()}});function Vp(e){return function(t,r){var n=e((t=pf(t)).h,(r=pf(r)).h),i=Hf(t.c,r.c),a=Hf(t.l,r.l),o=Hf(t.opacity,r.opacity);return function(e){return t.h=n(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+""}}}var qp,Hp,Gp=d({"node_modules/d3-interpolate/src/hcl.js"(){Df(),Gf(),qp=Vp(qf),Hp=Vp(Hf)}});function Wp(e){return function t(r){function n(t,n){var i=e((t=kf(t)).h,(n=kf(n)).h),a=Hf(t.s,n.s),o=Hf(t.l,n.l),s=Hf(t.opacity,n.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(Math.pow(e,r)),t.opacity=s(e),t+""}}return r=+r,n.gamma=t,n}(1)}var Zp,Yp,Xp=d({"node_modules/d3-interpolate/src/cubehelix.js"(){Df(),Gf(),Zp=Wp(qf),Yp=Wp(Hf)}});function $p(e,t){void 0===t&&(t=e,e=pp);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return function(e){var t=Math.max(0,Math.min(n-1,Math.floor(e*=n)));return a[t](e-t)}}var Kp=d({"node_modules/d3-interpolate/src/piecewise.js"(){dp()}});function Jp(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e(n/(t-1));return r}var Qp=d({"node_modules/d3-interpolate/src/quantize.js"(){}}),ed={};g(ed,{interpolate:()=>pp,interpolateArray:()=>ep,interpolateBasis:()=>Rf,interpolateBasisClosed:()=>Bf,interpolateCubehelix:()=>Zp,interpolateCubehelixLong:()=>Yp,interpolateDate:()=>np,interpolateDiscrete:()=>mp,interpolateHcl:()=>qp,interpolateHclLong:()=>Hp,interpolateHsl:()=>Fp,interpolateHslLong:()=>Bp,interpolateHue:()=>yp,interpolateLab:()=>Np,interpolateNumber:()=>ap,interpolateNumberArray:()=>Kf,interpolateObject:()=>sp,interpolateRgb:()=>Zf,interpolateRgbBasis:()=>Yf,interpolateRgbBasisClosed:()=>Xf,interpolateRound:()=>xp,interpolateString:()=>cp,interpolateTransformCss:()=>Ip,interpolateTransformSvg:()=>Lp,interpolateZoom:()=>Dp,piecewise:()=>$p,quantize:()=>Jp});var td=d({"node_modules/d3-interpolate/src/index.js"(){dp(),rp(),Ff(),Nf(),ip(),gp(),vp(),op(),Qf(),lp(),_p(),fp(),Pp(),Op(),$f(),jp(),Up(),Gp(),Xp(),Kp(),Qp()}}),rd=m({"src/traces/sunburst/fill_one.js"(e,t){var r=er(),n=W();t.exports=function(e,t,i,a,o){var s=t.data.data,l=s.i,c=o||s.color;if(l>=0){t.i=s.i;var u=i.marker;u.pattern?(!u.colors||!u.pattern.shape)&&(u.color=c,t.color=c):(u.color=c,t.color=c),r.pointStyle(e,i,a,t)}else n.fill(e,c)}}}),nd=m({"src/traces/sunburst/style.js"(e,t){var r=b(),n=W(),i=ct(),a=Qa().resizeText,o=rd();function s(e,t,r,a){var s=t.data.data,l=!t.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;e.call(o,t,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}t.exports={style:function(e){var t=e._fullLayout._sunburstlayer.selectAll(".trace");a(e,t,"sunburst"),t.each((function(t){var n=r.select(this),i=t[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(t){r.select(this).call(s,t,i,e)}))}))},styleOne:s}}}),id=m({"src/traces/sunburst/helpers.js"(e){var t=ct(),r=W(),n=dr(),i=wr();function a(e){return e.data.data.pid}e.findEntryWithLevel=function(t,r){var n;return r&&t.eachAfter((function(t){if(e.getPtId(t)===r)return n=t.copy()})),n||t},e.findEntryWithChild=function(t,r){var n;return t.eachAfter((function(t){for(var i=t.children||[],a=0;a<i.length;a++){var o=i[a];if(e.getPtId(o)===r)return n=t.copy()}})),n||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""===a(e)},e.setSliceCursor=function(t,r,i){var a=i.isTransitioning;if(!a){var o=t.datum();a=i.hideOnRoot&&e.isHierarchyRoot(o)||i.hideOnLeaves&&e.isLeaf(o)}n(t,a?null:"pointer")},e.getInsideTextFontKey=function(e,r,n,i,a){var o=(a||{}).onPathbar?"pathbar.textfont":"insidetextfont",s=n.data.data.i;return t.castOption(r,s,o+"."+e)||t.castOption(r,s,"textfont."+e)||i.size},e.getOutsideTextFontKey=function(e,r,n,i){var a=n.data.data.i;return t.castOption(r,a,"outsidetextfont."+e)||t.castOption(r,a,"textfont."+e)||i.size},e.isOutsideText=function(t,r){return!t._hasColorscale&&e.isHierarchyRoot(r)},e.determineTextFont=function(n,i,a,o){return e.isOutsideText(n,i)?function(t,r,n){return{color:e.getOutsideTextFontKey("color",t,r,n),family:e.getOutsideTextFontKey("family",t,r,n),size:e.getOutsideTextFontKey("size",t,r,n),weight:e.getOutsideTextFontKey("weight",t,r,n),style:e.getOutsideTextFontKey("style",t,r,n),variant:e.getOutsideTextFontKey("variant",t,r,n),textcase:e.getOutsideTextFontKey("textcase",t,r,n),lineposition:e.getOutsideTextFontKey("lineposition",t,r,n),shadow:e.getOutsideTextFontKey("shadow",t,r,n)}}(n,i,a):function(n,i,a,o){var s=(o||{}).onPathbar,l=i.data.data,c=l.i,u=t.castOption(n,c,(s?"pathbar.textfont":"insidetextfont")+".color");return!u&&n._input.textfont&&(u=t.castOption(n._input,c,"textfont.color")),{color:u||r.contrast(l.color),family:e.getInsideTextFontKey("family",n,i,a,o),size:e.getInsideTextFontKey("size",n,i,a,o),weight:e.getInsideTextFontKey("weight",n,i,a,o),style:e.getInsideTextFontKey("style",n,i,a,o),variant:e.getInsideTextFontKey("variant",n,i,a,o),textcase:e.getInsideTextFontKey("textcase",n,i,a,o),lineposition:e.getInsideTextFontKey("lineposition",n,i,a,o),shadow:e.getInsideTextFontKey("shadow",n,i,a,o)}}(n,i,a,o)},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,r){return!(e.isLeaf(t)||t.depth===r._maxDepth-1)},e.getParent=function(t,r){return e.findEntryWithLevel(t,a(r))},e.listPath=function(t,r){var n=t.parent;if(!n)return[];var i=r?[n.data[r]]:[n];return e.listPath(n,r).concat(i)},e.getPath=function(t){return e.listPath(t,"label").join("/")+"/"},e.formatValue=i.formatPieValue,e.formatPercent=function(e,r){var n=t.formatPercent(e,0);return"0%"===n&&(n=i.formatPiePercent(e,r)),n}}}),ad=m({"src/traces/sunburst/fx.js"(e,t){var r=b(),n=He(),i=Kt().appendArrayPointValue,a=Or(),o=ct(),s=dt(),l=id(),c=wr().formatPieValue;function u(e,t,r){for(var n=e.data.data,a={curveNumber:t.index,pointNumber:n.i,data:t._input,fullData:t},o=0;o<r.length;o++){var s=r[o];s in e&&(a[s]=e[s])}return"parentString"in e&&!l.isHierarchyRoot(e)&&(a.parent=e.parentString),i(a,t,n.i),a}t.exports=function(e,t,i,h,f){var p=h[0],d=p.trace,m=p.hierarchy,g="sunburst"===d.type,y="treemap"===d.type||"icicle"===d.type;"_hasHoverLabel"in d||(d._hasHoverLabel=!1),"_hasHoverEvent"in d||(d._hasHoverEvent=!1),e.on("mouseover",(function(n){var s=i._fullLayout;if(!i._dragging&&!1!==s.hovermode){var h,v=i._fullData[d.index],x=n.data.data,_=x.i,b=l.isHierarchyRoot(n),w=l.getParent(m,n),T=l.getValue(n),k=function(e){return o.castOption(v,_,e)},A=k("hovertemplate"),M=a.castHoverinfo(v,s,_),S=s.separators;if(A||M&&"none"!==M&&"skip"!==M){var E,C;g&&(E=p.cx+n.pxmid[0]*(1-n.rInscribed),C=p.cy+n.pxmid[1]*(1-n.rInscribed)),y&&(E=n._hoverX,C=n._hoverY);var I={},L=[],P=[],z=function(e){return-1!==L.indexOf(e)};M&&(L="all"===M?v._module.attributes.hoverinfo.flags:M.split("+")),I.label=x.label,z("label")&&I.label&&P.push(I.label),x.hasOwnProperty("v")&&(I.value=x.v,I.valueLabel=c(I.value,S),z("value")&&P.push(I.valueLabel)),I.currentPath=n.currentPath=l.getPath(n.data),z("current path")&&!b&&P.push(I.currentPath);var D,O=[],R=function(){-1===O.indexOf(D)&&(P.push(D),O.push(D))};I.percentParent=n.percentParent=T/l.getValue(w),I.parent=n.parentString=l.getPtLabel(w),z("percent parent")&&(D=l.formatPercent(I.percentParent,S)+" of "+I.parent,R()),I.percentEntry=n.percentEntry=T/l.getValue(t),I.entry=n.entry=l.getPtLabel(t),z("percent entry")&&!b&&!n.onPathbar&&(D=l.formatPercent(I.percentEntry,S)+" of "+I.entry,R()),I.percentRoot=n.percentRoot=T/l.getValue(m),I.root=n.root=l.getPtLabel(m),z("percent root")&&!b&&(D=l.formatPercent(I.percentRoot,S)+" of "+I.root,R()),I.text=k("hovertext")||k("text"),z("text")&&(D=I.text,o.isValidTextValue(D)&&P.push(D)),h=[u(n,v,f.eventDataKeys)];var F={trace:v,y:C,_x0:n._x0,_x1:n._x1,_y0:n._y0,_y1:n._y1,text:P.join("<br>"),name:A||z("name")?v.name:void 0,color:k("hoverlabel.bgcolor")||x.color,borderColor:k("hoverlabel.bordercolor"),fontFamily:k("hoverlabel.font.family"),fontSize:k("hoverlabel.font.size"),fontColor:k("hoverlabel.font.color"),fontWeight:k("hoverlabel.font.weight"),fontStyle:k("hoverlabel.font.style"),fontVariant:k("hoverlabel.font.variant"),nameLength:k("hoverlabel.namelength"),textAlign:k("hoverlabel.align"),hovertemplate:A,hovertemplateLabels:I,eventData:h};g&&(F.x0=E-n.rInscribed*n.rpx1,F.x1=E+n.rInscribed*n.rpx1,F.idealAlign=n.pxmid[0]<0?"left":"right"),y&&(F.x=E,F.idealAlign=E<0?"left":"right");var B=[];a.loneHover(F,{container:s._hoverlayer.node(),outerContainer:s._paper.node(),gd:i,inOut_bbox:B}),h[0].bbox=B[0],d._hasHoverLabel=!0}if(y){var j=e.select("path.surface");f.styleOne(j,n,v,i,{hovered:!0})}d._hasHoverEvent=!0,i.emit("plotly_hover",{points:h||[u(n,v,f.eventDataKeys)],event:r.event})}})),e.on("mouseout",(function(t){var n=i._fullLayout,o=i._fullData[d.index],s=r.select(this).datum();if(d._hasHoverEvent&&(t.originalEvent=r.event,i.emit("plotly_unhover",{points:[u(s,o,f.eventDataKeys)],event:r.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(a.loneUnhover(n._hoverlayer.node()),d._hasHoverLabel=!1),y){var l=e.select("path.surface");f.styleOne(l,s,o,i,{hovered:!1})}})),e.on("click",(function(e){var t=i._fullLayout,o=i._fullData[d.index],c=g&&(l.isHierarchyRoot(e)||l.isLeaf(e)),h=l.getPtId(e),p=l.isEntry(e)?l.findEntryWithChild(m,h):l.findEntryWithLevel(m,h),y=l.getPtId(p),v={points:[u(e,o,f.eventDataKeys)],event:r.event};c||(v.nextLevel=y);var x=s.triggerHandler(i,"plotly_"+d.type+"click",v);if(!1!==x&&t.hovermode&&(i._hoverdata=[u(e,o,f.eventDataKeys)],a.click(i,r.event)),!c&&!1!==x&&!i._dragging&&!i._transitioning){n.call("_storeDirectGUIEdit",o,t._tracePreGUI[o.uid],{level:o.level});var _={data:[{level:y}],traces:[d.index]},b={frame:{redraw:!1,duration:f.transitionTime},transition:{duration:f.transitionTime,easing:f.transitionEasing},mode:"immediate",fromcurrent:!0};a.loneUnhover(t._hoverlayer.node()),n.call("animate",i,_,b)}}))}}}),od=m({"src/traces/sunburst/plot.js"(e){var t=b(),r=ph(),n=(td(),v(ed)).interpolate,i=er(),a=ct(),o=Et(),s=Qa(),l=s.recordMinTextSize,c=s.clearMinTextSize,u=rh(),h=wr().getRotationAngle,f=u.computeTransform,p=u.transformInsideText,d=nd().styleOne,m=to().resizeText,g=ad(),y=lh(),x=id();function _(s,c,u,m){var v=s._context.staticPlot,_=s._fullLayout,b=!_.uniformtext.mode&&x.hasTransition(m),T=t.select(u).selectAll("g.slice"),k=c[0],A=k.trace,M=k.hierarchy,S=x.findEntryWithLevel(M,A.level),E=x.getMaxDepth(A),C=_._size,I=A.domain,L=C.w*(I.x[1]-I.x[0]),P=C.h*(I.y[1]-I.y[0]),z=.5*Math.min(L,P),D=k.cx=C.l+C.w*(I.x[1]+I.x[0])/2,O=k.cy=C.t+C.h*(1-I.y[0])-P/2;if(!S)return T.remove();var R=null,F={};b&&T.each((function(e){F[x.getPtId(e)]={rpx0:e.rpx0,rpx1:e.rpx1,x0:e.x0,x1:e.x1,transform:e.transform},!R&&x.isEntry(e)&&(R=e)}));var B=function(e){return r.partition().size([2*Math.PI,e.height+1])(e)}(S).descendants(),j=S.height+1,N=0,U=E;k.hasMultipleRoots&&x.isHierarchyRoot(S)&&(B=B.slice(1),j-=1,N=1,U+=1),B=B.filter((function(e){return e.y1<=U}));var V=h(A.rotation);V&&B.forEach((function(e){e.x0+=V,e.x1+=V}));var q=Math.min(j,E),H=function(e){return(e-N)/q*z},G=function(e,t){return[e*Math.cos(t),-e*Math.sin(t)]},W=function(e){return a.pathAnnulus(e.rpx0,e.rpx1,e.x0,e.x1,D,O)},Z=function(e){return D+w(e)[0]*(e.transform.rCenter||0)+(e.transform.x||0)},Y=function(e){return O+w(e)[1]*(e.transform.rCenter||0)+(e.transform.y||0)};(T=T.data(B,x.getPtId)).enter().append("g").classed("slice",!0),b?T.exit().transition().each((function(){var e=t.select(this);e.select("path.surface").transition().attrTween("d",(function(e){var t=function(e){var t,r=x.getPtId(e),i=F[r],a=F[x.getPtId(S)];if(a){var o=(e.x1>a.x1?2*Math.PI:0)+V;t=e.rpx1<a.rpx1?{x0:e.x0,x1:e.x1,rpx0:0,rpx1:0}:{x0:o,x1:o,rpx0:e.rpx0,rpx1:e.rpx1}}else{var s,l=x.getPtId(e.parent);T.each((function(e){if(x.getPtId(e)===l)return s=e}));var c,u=s.children;u.forEach((function(e,t){if(x.getPtId(e)===r)return c=t}));var h=u.length,f=n(s.x0,s.x1);t={rpx0:z,rpx1:z,x0:f(c/h),x1:f((c+1)/h)}}return n(i,t)}(e);return function(e){return W(t(e))}})),e.select("g.slicetext").attr("opacity",0)})).remove():T.exit().remove(),T.order();var X=null;if(b&&R){var $=x.getPtId(R);T.each((function(e){null===X&&x.getPtId(e)===$&&(X=e.x1)}))}var K=T;function J(e){var t=e.parent,r=F[x.getPtId(t)],i={};if(r){var a=t.children,o=a.indexOf(e),s=a.length,l=n(r.x0,r.x1);i.x0=l(o/s),i.x1=l(o/s)}else i.x0=i.x1=0;return i}b&&(K=K.transition().each("end",(function(){var e=t.select(this);x.setSliceCursor(e,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})}))),K.each((function(r){var u=t.select(this),h=a.ensureSingle(u,"path","surface",(function(e){e.style("pointer-events",v?"none":"all")}));r.rpx0=H(r.y0),r.rpx1=H(r.y1),r.xmid=(r.x0+r.x1)/2,r.pxmid=G(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=function(e){return 0===e.rpx0&&a.isFullCircle([e.x0,e.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2))}(r),b?h.transition().attrTween("d",(function(e){var t=function(e){var t,r=F[x.getPtId(e)],i={x0:e.x0,x1:e.x1,rpx0:e.rpx0,rpx1:e.rpx1};if(r)t=r;else if(R)if(e.parent)if(X){var o=(e.x1>X?2*Math.PI:0)+V;t={x0:o,x1:o}}else t={rpx0:z,rpx1:z},a.extendFlat(t,J(e));else t={rpx0:0,rpx1:0};else t={x0:V,x1:V};return n(t,i)}(e);return function(e){return W(t(e))}})):h.attr("d",W),u.call(g,S,s,c,{eventDataKeys:y.eventDataKeys,transitionTime:y.CLICK_TRANSITION_TIME,transitionEasing:y.CLICK_TRANSITION_EASING}).call(x.setSliceCursor,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:s._transitioning}),h.call(d,r,A,s);var m=a.ensureSingle(u,"g","slicetext"),w=a.ensureSingle(m,"text","",(function(e){e.attr("data-notex",1)})),T=a.ensureUniformFontSize(s,x.determineTextFont(A,r,_.font));w.text(e.formatSliceLabel(r,S,A,c,_)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,T).call(o.convertToTspans,s);var M=i.bBox(w.node());r.transform=p(M,r,k),r.transform.targetX=Z(r),r.transform.targetY=Y(r);var E=function(e,t){var r=e.transform;return f(r,t),r.fontSize=T.size,l(A.type,r,_),a.getTextTransform(r)};b?w.transition().attrTween("transform",(function(e){var t=function(e){var t,r=F[x.getPtId(e)],i=e.transform;if(r)t=r;else if(t={rpx1:e.rpx1,transform:{textPosAngle:i.textPosAngle,scale:0,rotate:i.rotate,rCenter:i.rCenter,x:i.x,y:i.y}},R)if(e.parent)if(X){var o=e.x1>X?2*Math.PI:0;t.x0=t.x1=o}else a.extendFlat(t,J(e));else t.x0=t.x1=V;else t.x0=t.x1=V;var s=n(t.transform.textPosAngle,e.transform.textPosAngle),c=n(t.rpx1,e.rpx1),u=n(t.x0,e.x0),h=n(t.x1,e.x1),f=n(t.transform.scale,i.scale),p=n(t.transform.rotate,i.rotate),d=0===i.rCenter?3:0===t.transform.rCenter?1/3:1,m=n(t.transform.rCenter,i.rCenter);return function(e){var t=c(e),r=u(e),n=h(e),a=function(e){return m(Math.pow(e,d))}(e),o={pxmid:G(t,(r+n)/2),rpx1:t,transform:{textPosAngle:s(e),rCenter:a,x:i.x,y:i.y}};return l(A.type,i,_),{transform:{targetX:Z(o),targetY:Y(o),scale:f(e),rotate:p(e),rCenter:a}}}}(e);return function(e){return E(t(e),M)}})):w.attr("transform",E(r,M))}))}function w(e){return function(e,t){return[e*Math.sin(t),-e*Math.cos(t)]}(e.rpx1,e.transform.textPosAngle)}e.plot=function(e,r,n,i){var a,o,s=e._fullLayout,l=s._sunburstlayer,u=!n,h=!s.uniformtext.mode&&x.hasTransition(n);c("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(r,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),h?(i&&(o=i()),t.transition().duration(n.duration).ease(n.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(t){_(e,t,this,n)}))}))):(a.each((function(t){_(e,t,this,n)})),s.uniformtext.mode&&m(e,s._sunburstlayer.selectAll(".trace"),"sunburst")),u&&a.exit().remove()},e.formatSliceLabel=function(e,t,r,n,i){var o=r.texttemplate,s=r.textinfo;if(!(o||s&&"none"!==s))return"";var l=i.separators,c=n[0],u=e.data.data,h=c.hierarchy,f=x.isHierarchyRoot(e),p=x.getParent(h,e),d=x.getValue(e);if(!o){var m,g=s.split("+"),y=function(e){return-1!==g.indexOf(e)},v=[];if(y("label")&&u.label&&v.push(u.label),u.hasOwnProperty("v")&&y("value")&&v.push(x.formatValue(u.v,l)),!f){y("current path")&&v.push(x.getPath(e.data));var _=0;y("percent parent")&&_++,y("percent entry")&&_++,y("percent root")&&_++;var b=_>1;if(_){var w,T=function(e){m=x.formatPercent(w,l),b&&(m+=" of "+e),v.push(m)};y("percent parent")&&!f&&(w=d/x.getValue(p),T("parent")),y("percent entry")&&(w=d/x.getValue(t),T("entry")),y("percent root")&&(w=d/x.getValue(h),T("root"))}}return y("text")&&(m=a.castOption(r,u.i,"text"),a.isValidTextValue(m)&&v.push(m)),v.join("<br>")}var k=a.castOption(r,u.i,"texttemplate");if(!k)return"";var A={};u.label&&(A.label=u.label),u.hasOwnProperty("v")&&(A.value=u.v,A.valueLabel=x.formatValue(u.v,l)),A.currentPath=x.getPath(e.data),f||(A.percentParent=d/x.getValue(p),A.percentParentLabel=x.formatPercent(A.percentParent,l),A.parent=x.getPtLabel(p)),A.percentEntry=d/x.getValue(t),A.percentEntryLabel=x.formatPercent(A.percentEntry,l),A.entry=x.getPtLabel(t),A.percentRoot=d/x.getValue(h),A.percentRootLabel=x.formatPercent(A.percentRoot,l),A.root=x.getPtLabel(h),u.hasOwnProperty("color")&&(A.color=u.color);var M=a.castOption(r,u.i,"text");return(a.isValidTextValue(M)||""===M)&&(A.text=M),A.customdata=a.castOption(r,u.i,"customdata"),a.texttemplateString({data:[A,r._meta],fallback:r.texttemplatefallback,labels:A,locale:i._d3locale,template:k})}}}),sd=m({"src/traces/sunburst/index.js"(e,t){t.exports={moduleType:"trace",name:"sunburst",basePlotModule:sh(),categories:[],animatable:!0,attributes:ch(),layoutAttributes:uh(),supplyDefaults:hh(),supplyLayoutDefaults:fh(),calc:dh().calc,crossTraceCalc:dh().crossTraceCalc,plot:od().plot,style:nd().style,colorbar:mi(),meta:{}}}}),ld=m({"lib/sunburst.js"(e,t){t.exports=sd()}}),cd=m({"src/traces/treemap/base_plot.js"(e){var t=At();e.name="treemap",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),ud=m({"src/traces/treemap/constants.js"(e,t){t.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),hd=m({"src/traces/treemap/attributes.js"(e,t){var{hovertemplateAttrs:r,texttemplateAttrs:n,templatefallbackAttrs:i}=Fe(),a=zt(),o=Ma().attributes,s=$u(),l=ch(),c=ud(),u=B().extendFlat,h=Oe().pattern;t.exports={labels:l.labels,parents:l.parents,values:l.values,branchvalues:l.branchvalues,count:l.count,level:l.level,maxdepth:l.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:l.marker.colors,pattern:h,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:l.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:l.textinfo,texttemplate:n({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),texttemplatefallback:i({editType:"plot"}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:r({},{keys:c.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:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}}}),fd=m({"src/traces/treemap/layout_attributes.js"(e,t){t.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),pd=m({"src/traces/treemap/defaults.js"(e,t){var r=ct(),n=hd(),i=W(),a=Ma().defaults,o=Xa().handleText,s=ci().TEXTPAD,l=Ku().handleMarkerDefaults,c=Yt(),u=c.hasColorscale,h=c.handleDefaults;t.exports=function(e,t,c,f){function p(i,a){return r.coerce(e,t,n,i,a)}var d=p("labels"),m=p("parents");if(d&&d.length&&m&&m.length){var g=p("values");g&&g.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),"squarify"===p("tiling.packing")&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var y=p("text");p("texttemplate"),p("texttemplatefallback"),t.texttemplate||p("textinfo",r.isArrayOrTypedArray(y)?"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 x=-1!==t.textposition.indexOf("bottom");l(e,t,f,p),(t._hasColorscale=u(e,"marker","colors")||(e.marker||{}).coloraxis)?h(e,t,f,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(t.marker.colors||[]).length);var _=2*t.textfont.size;p("marker.pad.t",x?_/4:_),p("marker.pad.l",_/4),p("marker.pad.r",_/4),p("marker.pad.b",x?_:_/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}else t.visible=!1}}}),dd=m({"src/traces/treemap/layout_defaults.js"(e,t){var r=ct(),n=fd();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("treemapcolorway",t.colorway),i("extendtreemapcolors")}}}),md=m({"src/traces/treemap/calc.js"(e){var t=dh();e.calc=function(e,r){return t.calc(e,r)},e.crossTraceCalc=function(e){return t._runCrossTraceCalc("treemap",e)}}}),gd=m({"src/traces/treemap/flip_tree.js"(e,t){t.exports=function e(t,r,n){var i;n.swapXY&&(i=t.x0,t.x0=t.y0,t.y0=i,i=t.x1,t.x1=t.y1,t.y1=i),n.flipX&&(i=t.x0,t.x0=r[0]-t.x1,t.x1=r[0]-i),n.flipY&&(i=t.y0,t.y0=r[1]-t.y1,t.y1=r[1]-i);var a=t.children;if(a)for(var o=0;o<a.length;o++)e(a[o],r,n)}}}),yd=m({"src/traces/treemap/partition.js"(e,t){var r=ph(),n=gd();t.exports=function(e,t,i){var a,o=i.flipX,s=i.flipY,l="dice-slice"===i.packing,c=i.pad[s?"bottom":"top"],u=i.pad[o?"right":"left"],h=i.pad[o?"left":"right"],f=i.pad[s?"top":"bottom"];l&&(a=u,u=c,c=a,a=h,h=f,f=a);var p=r.treemap().tile(function(e,t){switch(e){case"squarify":return r.treemapSquarify.ratio(t);case"binary":return r.treemapBinary;case"dice":return r.treemapDice;case"slice":return r.treemapSlice;default:return r.treemapSliceDice}}(i.packing,i.squarifyratio)).paddingInner(i.pad.inner).paddingLeft(u).paddingRight(h).paddingTop(c).paddingBottom(f).size(l?[t[1],t[0]]:t)(e);return(l||o||s)&&n(p,t,{swapXY:l,flipX:o,flipY:s}),p}}}),vd=m({"src/traces/treemap/style.js"(e,t){var r=b(),n=W(),i=ct(),a=id(),o=Qa().resizeText,s=rd();function l(e,t,r,o,l){var c,u,h=(l||{}).hovered,f=t.data.data,p=f.i,d=f.color,m=a.isHierarchyRoot(t),g=1;if(h)c=r._hovered.marker.line.color,u=r._hovered.marker.line.width;else if(m&&d===r.root.color)g=100,c="rgba(0,0,0,0)",u=0;else if(c=i.castOption(r,p,"marker.line.color")||n.defaultLine,u=i.castOption(r,p,"marker.line.width")||0,!r._hasColorscale&&!t.onPathbar){var y=r.marker.depthfade;if(y){var v,x=n.combine(n.addOpacity(r._backgroundColor,.75),d);if(!0===y){var _=a.getMaxDepth(r);v=isFinite(_)?a.isLeaf(t)?0:r._maxVisibleLayers-(t.data.depth-r._entryDepth):t.data.height+1}else v=t.data.depth-r._entryDepth,r._atRootLevel||v++;if(v>0)for(var b=0;b<v;b++){var w=.5*b/v;d=n.combine(n.addOpacity(x,w),d)}}}e.call(s,t,r,o,d).style("stroke-width",u).call(n.stroke,c).style("opacity",g)}t.exports={style:function(e){var t=e._fullLayout._treemaplayer.selectAll(".trace");o(e,t,"treemap"),t.each((function(t){var n=r.select(this),i=t[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(t){r.select(this).call(l,t,i,e,{hovered:!1})}))}))},styleOne:l}}}),xd=m({"src/traces/treemap/draw_ancestors.js"(e,t){var r=b(),n=ct(),i=er(),a=Et(),o=yd(),s=vd().styleOne,l=ud(),c=id(),u=ad(),h=!0;t.exports=function(e,t,f,p,d){var m=d.barDifY,g=d.width,y=d.height,v=d.viewX,x=d.viewY,_=d.pathSlice,b=d.toMoveInsideSlice,w=d.strTransform,T=d.hasTransition,k=d.handleSlicesExit,A=d.makeUpdateSliceInterpolator,M=d.makeUpdateTextInterpolator,S={},E=e._context.staticPlot,C=e._fullLayout,I=t[0],L=I.trace,P=I.hierarchy,z=g/L._entryDepth,D=c.listPath(f.data,"id"),O=o(P.copy(),[g,y],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(O=O.filter((function(e){var t=D.indexOf(e.data.id);return-1!==t&&(e.x0=z*t,e.x1=z*(t+1),e.y0=m,e.y1=m+y,e.onPathbar=!0,!0)}))).reverse(),(p=p.data(O,c.getPtId)).enter().append("g").classed("pathbar",!0),k(p,h,S,[g,y],_),p.order();var R=p;T&&(R=R.transition().each("end",(function(){var t=r.select(this);c.setSliceCursor(t,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),R.each((function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-Math.min(g,y)/2),o._hoverY=x(o.y1-y/2);var p=r.select(this),d=n.ensureSingle(p,"path","surface",(function(e){e.style("pointer-events",E?"none":"all")}));T?d.transition().attrTween("d",(function(e){var t=A(e,h,S,[g,y]);return function(e){return _(t(e))}})):d.attr("d",_),p.call(u,f,e,t,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:e._transitioning}),d.call(s,o,L,e,{hovered:!1}),o._text=(c.getPtLabel(o)||"").split("<br>").join(" ")||"";var m=n.ensureSingle(p,"g","slicetext"),k=n.ensureSingle(m,"text","",(function(e){e.attr("data-notex",1)})),I=n.ensureUniformFontSize(e,c.determineTextFont(L,o,C.font,{onPathbar:!0}));k.text(o._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,I).call(a.convertToTspans,e),o.textBB=i.bBox(k.node()),o.transform=b(o,{fontSize:I.size,onPathbar:!0}),o.transform.fontSize=I.size,T?k.transition().attrTween("transform",(function(e){var t=M(e,h,S,[g,y]);return function(e){return w(t(e))}})):k.attr("transform",w(o))}))}}}),_d=m({"src/traces/treemap/plot_one.js"(e,t){var r=b(),n=(td(),v(ed)).interpolate,i=id(),a=ct(),o=ci().TEXTPAD,s=ro().toMoveInsideBar,l=Qa().recordMinTextSize,c=ud(),u=xd();function h(e){return i.isHierarchyRoot(e)?"":i.getPtId(e)}t.exports=function(e,t,f,p,d){var m=e._fullLayout,g=t[0],y=g.trace,v="icicle"===y.type,x=g.hierarchy,_=i.findEntryWithLevel(x,y.level),b=r.select(f),w=b.selectAll("g.pathbar"),T=b.selectAll("g.slice");if(!_)return w.remove(),void T.remove();var k=i.isHierarchyRoot(_),A=!m.uniformtext.mode&&i.hasTransition(p),M=i.getMaxDepth(y),S=m._size,E=y.domain,C=S.w*(E.x[1]-E.x[0]),I=S.h*(E.y[1]-E.y[0]),L=C,P=y.pathbar.thickness,z=y.marker.line.width+c.gapWithPathbar,D=y.pathbar.visible?y.pathbar.side.indexOf("bottom")>-1?I+z:-(P+z):0,O={x0:L,x1:L,y0:D,y1:D+P},R=function(e,t,r){var n=y.tiling.pad,i=function(e){return e-n<=t.x0},a=function(e){return e+n>=t.x1},o=function(e){return e-n<=t.y0},s=function(e){return e+n>=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-n)?0:a(e.x0-n)?r[0]:e.x0,x1:i(e.x1+n)?0:a(e.x1+n)?r[0]:e.x1,y0:o(e.y0-n)?0:s(e.y0-n)?r[1]:e.y0,y1:o(e.y1+n)?0:s(e.y1+n)?r[1]:e.y1}},F=null,B={},j={},N=null,U=function(e,t){return t?B[h(e)]:j[h(e)]};g.hasMultipleRoots&&k&&M++,y._maxDepth=M,y._backgroundColor=m.paper_bgcolor,y._entryDepth=_.data.depth,y._atRootLevel=k;var V=-C/2+S.l+S.w*(E.x[1]+E.x[0])/2,q=-I/2+S.t+S.h*(1-(E.y[1]+E.y[0])/2),H=function(e){return V+e},G=function(e){return q+e},W=G(0),Z=H(0),Y=function(e){return Z+e},X=function(e){return W+e};function $(e,t){return e+","+t}var K=Y(0),J=function(e){e.x=Math.max(K,e.x)},Q=y.pathbar.edgeshape,ee=y[v?"tiling":"marker"].pad,te=function(e){return-1!==y.textposition.indexOf(e)},re=te("top"),ne=te("left"),ie=te("right"),ae=te("bottom"),oe=function(e,t){var r=e.x0,n=e.x1,i=e.y0,a=e.y1,c=e.textBB,u=re||t.isHeader&&!ae?"start":ae?"end":"middle",h=te("right"),f=te("left")||t.onPathbar?-1:h?1:0;if(t.isHeader){if((r+=(v?ee:ee.l)-o)>=(n-=(v?ee:ee.r)-o)){var p=(r+n)/2;r=p,n=p}var d;ae?i<(d=a-(v?ee:ee.b))&&d<a&&(i=d):i<(d=i+(v?ee:ee.t))&&d<a&&(a=d)}var g=s(r,n,i,a,c,{isHorizontal:!1,constrained:!0,angle:0,anchor:u,leftToRight:f});return g.fontSize=t.fontSize,g.targetX=H(g.targetX),g.targetY=G(g.targetY),isNaN(g.targetX)||isNaN(g.targetY)?{}:(r!==n&&i!==a&&l(y.type,g,m),{scale:g.scale,rotate:g.rotate,textX:g.textX,textY:g.textY,anchorX:g.anchorX,anchorY:g.anchorY,targetX:g.targetX,targetY:g.targetY})},se=function(e,t){for(var r,n=0,i=e;!r&&n<M;)n++,(i=i.parent)?r=U(i,t):n=M;return r||{}},le=function(e,t,r,i,o){var s,l=U(e,t);if(l)s=l;else if(t)s=O;else if(F)if(e.parent){var c=N||r;c&&!t?s=R(e,c,i):(s={},a.extendFlat(s,se(e,t)))}else s=a.extendFlat({},e),v&&("h"===o.orientation?o.flipX?s.x0=e.x1:s.x1=0:o.flipY?s.y0=e.y1:s.y1=0);else s={};return n(s,{x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})},ce=function(e,t,r,o){var s=U(e,t),c={},u=function(e,t,r,n){if(t)return B[h(x)]||O;var i=j[y.level]||r;return function(e){return e.data.depth-_.data.depth<M}(e)?R(e,i,n):{}}(e,t,r,o);a.extendFlat(c,{transform:oe({x0:u.x0,x1:u.x1,y0:u.y0,y1:u.y1,textBB:e.textBB,_text:e._text},{isHeader:i.isHeader(e,y)})}),s?c=s:e.parent&&a.extendFlat(c,se(e,t));var f=e.transform;return e.x0!==e.x1&&e.y0!==e.y1&&l(y.type,f,m),n(c,{transform:{scale:f.scale,rotate:f.rotate,textX:f.textX,textY:f.textY,anchorX:f.anchorX,anchorY:f.anchorY,targetX:f.targetX,targetY:f.targetY}})},ue=function(e,t,i,a,o){var s=a[0],l=a[1];A?e.exit().transition().each((function(){var e=r.select(this);e.select("path.surface").transition().attrTween("d",(function(e){var r=function(e,t,r,i){var a,o=U(e,t);if(t)a=O;else{var s=U(_,t);a=s?R(e,s,i):{}}return n(o,a)}(e,t,0,[s,l]);return function(e){return o(r(e))}})),e.select("g.slicetext").attr("opacity",0)})).remove():e.exit().remove()},he=function(e){var t=e.transform;return e.x0!==e.x1&&e.y0!==e.y1&&l(y.type,t,m),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})};A&&(w.each((function(e){B[h(e)]={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1},e.transform&&(B[h(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})})),T.each((function(e){j[h(e)]={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1},e.transform&&(j[h(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}),!F&&i.isEntry(e)&&(F=e)}))),N=d(e,t,_,T,{width:C,height:I,viewX:H,viewY:G,pathSlice:function(e){var t=H(e.x0),r=H(e.x1),n=G(e.y0),i=G(e.y1),a=r-t,o=i-n;if(!a||!o)return"";var s=y.marker.cornerradius||0,l=Math.min(s,a/2,o/2);l&&e.data&&e.data.data&&e.data.data.label&&(re&&(l=Math.min(l,ee.t)),ne&&(l=Math.min(l,ee.l)),ie&&(l=Math.min(l,ee.r)),ae&&(l=Math.min(l,ee.b)));var c=function(e,t){return l?"a"+$(l,l)+" 0 0 1 "+$(e,t):""};return"M"+$(t,n+l)+c(l,-l)+"L"+$(r-l,n)+c(l,l)+"L"+$(r,i-l)+c(-l,l)+"L"+$(t+l,i)+c(-l,-l)+"Z"},toMoveInsideSlice:oe,prevEntry:F,makeUpdateSliceInterpolator:le,makeUpdateTextInterpolator:ce,handleSlicesExit:ue,hasTransition:A,strTransform:he}),y.pathbar.visible?u(e,t,_,w,{barDifY:D,width:L,height:P,viewX:Y,viewY:X,pathSlice:function(e){var t=Y(Math.max(Math.min(e.x0,e.x0),0)),r=Y(Math.min(Math.max(e.x1,e.x1),L)),n=X(e.y0),i=X(e.y1),a=P/2,o={},s={};o.x=t,s.x=r,o.y=s.y=(n+i)/2;var l={x:t,y:n},c={x:r,y:n},u={x:r,y:i},h={x:t,y:i};return">"===Q?(l.x-=a,c.x-=a,u.x-=a,h.x-=a):"/"===Q?(u.x-=a,h.x-=a,o.x-=a/2,s.x-=a/2):"\\"===Q?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===Q&&(o.x-=a,s.x-=a),J(l),J(h),J(o),J(c),J(u),J(s),"M"+$(l.x,l.y)+"L"+$(c.x,c.y)+"L"+$(s.x,s.y)+"L"+$(u.x,u.y)+"L"+$(h.x,h.y)+"L"+$(o.x,o.y)+"Z"},toMoveInsideSlice:oe,makeUpdateSliceInterpolator:le,makeUpdateTextInterpolator:ce,handleSlicesExit:ue,hasTransition:A,strTransform:he}):w.remove()}}}),bd=m({"src/traces/treemap/draw.js"(e,t){var r=b(),n=id(),i=Qa().clearMinTextSize,a=to().resizeText,o=_d();t.exports=function(e,t,s,l,c){var u,h,f=c.type,p=c.drawDescendants,d=e._fullLayout,m=d["_"+f+"layer"],g=!s;i(f,d),(u=m.selectAll("g.trace."+f).data(t,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(f,!0),u.order(),!d.uniformtext.mode&&n.hasTransition(s)?(l&&(h=l()),r.transition().duration(s.duration).ease(s.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){m.selectAll("g.trace").each((function(t){o(e,t,this,s,p)}))}))):(u.each((function(t){o(e,t,this,s,p)})),d.uniformtext.mode&&a(e,m.selectAll(".trace"),f)),g&&u.exit().remove()}}}),wd=m({"src/traces/treemap/draw_descendants.js"(e,t){var r=b(),n=ct(),i=er(),a=Et(),o=yd(),s=vd().styleOne,l=ud(),c=id(),u=ad(),h=od().formatSliceLabel,f=!1;t.exports=function(e,t,p,d,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,_=m.pathSlice,b=m.toMoveInsideSlice,w=m.strTransform,T=m.hasTransition,k=m.handleSlicesExit,A=m.makeUpdateSliceInterpolator,M=m.makeUpdateTextInterpolator,S=m.prevEntry,E=e._context.staticPlot,C=e._fullLayout,I=t[0].trace,L=-1!==I.textposition.indexOf("left"),P=-1!==I.textposition.indexOf("right"),z=-1!==I.textposition.indexOf("bottom"),D=!z&&!I.marker.pad.t||z&&!I.marker.pad.b,O=o(p,[g,y],{packing:I.tiling.packing,squarifyratio:I.tiling.squarifyratio,flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1,pad:{inner:I.tiling.pad,top:I.marker.pad.t,left:I.marker.pad.l,right:I.marker.pad.r,bottom:I.marker.pad.b}}).descendants(),R=1/0,F=-1/0;O.forEach((function(e){var t=e.depth;t>=I._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(R=Math.min(R,t),F=Math.max(F,t))})),d=d.data(O,c.getPtId),I._maxVisibleLayers=isFinite(F)?F-R+1:0,d.enter().append("g").classed("slice",!0),k(d,f,{},[g,y],_),d.order();var B=null;if(T&&S){var j=c.getPtId(S);d.each((function(e){null===B&&c.getPtId(e)===j&&(B={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var N=function(){return B||{x0:0,x1:g,y0:0,y1:y}},U=d;return T&&(U=U.transition().each("end",(function(){var t=r.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),U.each((function(o){var d=c.isHeader(o,I);o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-I.marker.pad.r),o._hoverY=x(z?o.y1-I.marker.pad.b/2:o.y0+I.marker.pad.t/2);var m=r.select(this),k=n.ensureSingle(m,"path","surface",(function(e){e.style("pointer-events",E?"none":"all")}));T?k.transition().attrTween("d",(function(e){var t=A(e,f,N(),[g,y]);return function(e){return _(t(e))}})):k.attr("d",_),m.call(u,p,e,t,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),k.call(s,o,I,e,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=d?D?"":c.getPtLabel(o)||"":h(o,p,I,t,C)||"";var S=n.ensureSingle(m,"g","slicetext"),O=n.ensureSingle(S,"text","",(function(e){e.attr("data-notex",1)})),R=n.ensureUniformFontSize(e,c.determineTextFont(I,o,C.font)),F=o._text||" ",B=d&&-1===F.indexOf("<br>");O.text(F).classed("slicetext",!0).attr("text-anchor",P?"end":L||B?"start":"middle").call(i.font,R).call(a.convertToTspans,e),o.textBB=i.bBox(O.node()),o.transform=b(o,{fontSize:R.size,isHeader:d}),o.transform.fontSize=R.size,T?O.transition().attrTween("transform",(function(e){var t=M(e,f,N(),[g,y]);return function(e){return w(t(e))}})):O.attr("transform",w(o))})),B}}}),Td=m({"src/traces/treemap/plot.js"(e,t){var r=bd(),n=wd();t.exports=function(e,t,i,a){return r(e,t,i,a,{type:"treemap",drawDescendants:n})}}}),kd=m({"src/traces/treemap/index.js"(e,t){t.exports={moduleType:"trace",name:"treemap",basePlotModule:cd(),categories:[],animatable:!0,attributes:hd(),layoutAttributes:fd(),supplyDefaults:pd(),supplyLayoutDefaults:dd(),calc:md().calc,crossTraceCalc:md().crossTraceCalc,plot:Td(),style:vd().style,colorbar:mi(),meta:{}}}}),Ad=m({"lib/treemap.js"(e,t){t.exports=kd()}}),Md=m({"src/traces/icicle/base_plot.js"(e){var t=At();e.name="icicle",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),Sd=m({"src/traces/icicle/attributes.js"(e,t){var{hovertemplateAttrs:r,texttemplateAttrs:n,templatefallbackAttrs:i}=Fe(),a=zt(),o=Ma().attributes,s=$u(),l=ch(),c=hd(),u=ud(),h=B().extendFlat,f=Oe().pattern;t.exports={labels:l.labels,parents:l.parents,values:l.values,branchvalues:l.branchvalues,count:l.count,level:l.level,maxdepth:l.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:c.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:h({colors:l.marker.colors,line:l.marker.line,pattern:f,editType:"calc"},a("marker",{colorAttr:"colors",anim:!1})),leaf:l.leaf,pathbar:c.pathbar,text:s.text,textinfo:l.textinfo,texttemplate:n({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),texttemplatefallback:i({editType:"plot"}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:r({},{keys:u.eventDataKeys}),hovertemplatefallback:i(),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:c.outsidetextfont,textposition:c.textposition,sort:s.sort,root:l.root,domain:o({name:"icicle",trace:!0,editType:"calc"})}}}),Ed=m({"src/traces/icicle/layout_attributes.js"(e,t){t.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Cd=m({"src/traces/icicle/defaults.js"(e,t){var r=ct(),n=Sd(),i=W(),a=Ma().defaults,o=Xa().handleText,s=ci().TEXTPAD,l=Ku().handleMarkerDefaults,c=Yt(),u=c.hasColorscale,h=c.handleDefaults;t.exports=function(e,t,c,f){function p(i,a){return r.coerce(e,t,n,i,a)}var d=p("labels"),m=p("parents");if(d&&d.length&&m&&m.length){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 y=p("text");p("texttemplate"),p("texttemplatefallback"),t.texttemplate||p("textinfo",r.isArrayOrTypedArray(y)?"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"),l(e,t,f,p);var x=t._hasColorscale=u(e,"marker","colors")||(e.marker||{}).coloraxis;x&&h(e,t,f,p,{prefix:"marker.",cLetter:"c"}),p("leaf.opacity",x?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}else t.visible=!1}}}),Id=m({"src/traces/icicle/layout_defaults.js"(e,t){var r=ct(),n=Ed();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("iciclecolorway",t.colorway),i("extendiciclecolors")}}}),Ld=m({"src/traces/icicle/calc.js"(e){var t=dh();e.calc=function(e,r){return t.calc(e,r)},e.crossTraceCalc=function(e){return t._runCrossTraceCalc("icicle",e)}}}),Pd=m({"src/traces/icicle/partition.js"(e,t){var r=ph(),n=gd();t.exports=function(e,t,i){var a=i.flipX,o=i.flipY,s="h"===i.orientation,l=i.maxDepth,c=t[0],u=t[1];l&&(c=(e.height+1)*t[0]/Math.min(e.height+1,l),u=(e.height+1)*t[1]/Math.min(e.height+1,l));var h=r.partition().padding(i.pad.inner).size(s?[t[1],c]:[t[0],u])(e);return(s||a||o)&&n(h,t,{swapXY:s,flipX:a,flipY:o}),h}}}),zd=m({"src/traces/icicle/style.js"(e,t){var r=b(),n=W(),i=ct(),a=Qa().resizeText,o=rd();function s(e,t,r,a){var s=t.data.data,l=!t.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;e.call(o,t,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}t.exports={style:function(e){var t=e._fullLayout._iciclelayer.selectAll(".trace");a(e,t,"icicle"),t.each((function(t){var n=r.select(this),i=t[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(t){r.select(this).call(s,t,i,e)}))}))},styleOne:s}}}),Dd=m({"src/traces/icicle/draw_descendants.js"(e,t){var r=b(),n=ct(),i=er(),a=Et(),o=Pd(),s=zd().styleOne,l=ud(),c=id(),u=ad(),h=od().formatSliceLabel,f=!1;t.exports=function(e,t,p,d,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,_=m.pathSlice,b=m.toMoveInsideSlice,w=m.strTransform,T=m.hasTransition,k=m.handleSlicesExit,A=m.makeUpdateSliceInterpolator,M=m.makeUpdateTextInterpolator,S=m.prevEntry,E=e._context.staticPlot,C=e._fullLayout,I=t[0].trace,L=-1!==I.textposition.indexOf("left"),P=-1!==I.textposition.indexOf("right"),z=-1!==I.textposition.indexOf("bottom"),D=o(p,[g,y],{flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1,orientation:I.tiling.orientation,pad:{inner:I.tiling.pad},maxDepth:I._maxDepth}).descendants(),O=1/0,R=-1/0;D.forEach((function(e){var t=e.depth;t>=I._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(O=Math.min(O,t),R=Math.max(R,t))})),d=d.data(D,c.getPtId),I._maxVisibleLayers=isFinite(R)?R-O+1:0,d.enter().append("g").classed("slice",!0),k(d,f,{},[g,y],_),d.order();var F=null;if(T&&S){var B=c.getPtId(S);d.each((function(e){null===F&&c.getPtId(e)===B&&(F={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var j=function(){return F||{x0:0,x1:g,y0:0,y1:y}},N=d;return T&&(N=N.transition().each("end",(function(){var t=r.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-I.tiling.pad),o._hoverY=x(z?o.y1-I.tiling.pad/2:o.y0+I.tiling.pad/2);var d=r.select(this),m=n.ensureSingle(d,"path","surface",(function(e){e.style("pointer-events",E?"none":"all")}));T?m.transition().attrTween("d",(function(e){var t=A(e,f,j(),[g,y],{orientation:I.tiling.orientation,flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1});return function(e){return _(t(e))}})):m.attr("d",_),d.call(u,p,e,t,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),m.call(s,o,I,e,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=h(o,p,I,t,C)||"";var k=n.ensureSingle(d,"g","slicetext"),S=n.ensureSingle(k,"text","",(function(e){e.attr("data-notex",1)})),D=n.ensureUniformFontSize(e,c.determineTextFont(I,o,C.font));S.text(o._text||" ").classed("slicetext",!0).attr("text-anchor",P?"end":L?"start":"middle").call(i.font,D).call(a.convertToTspans,e),o.textBB=i.bBox(S.node()),o.transform=b(o,{fontSize:D.size}),o.transform.fontSize=D.size,T?S.transition().attrTween("transform",(function(e){var t=M(e,f,j(),[g,y]);return function(e){return w(t(e))}})):S.attr("transform",w(o))})),F}}}),Od=m({"src/traces/icicle/plot.js"(e,t){var r=bd(),n=Dd();t.exports=function(e,t,i,a){return r(e,t,i,a,{type:"icicle",drawDescendants:n})}}}),Rd=m({"src/traces/icicle/index.js"(e,t){t.exports={moduleType:"trace",name:"icicle",basePlotModule:Md(),categories:[],animatable:!0,attributes:Sd(),layoutAttributes:Ed(),supplyDefaults:Cd(),supplyLayoutDefaults:Id(),calc:Ld().calc,crossTraceCalc:Ld().crossTraceCalc,plot:Od(),style:zd().style,colorbar:mi(),meta:{}}}}),Fd=m({"lib/icicle.js"(e,t){t.exports=Rd()}}),Bd=m({"src/traces/funnelarea/base_plot.js"(e){var t=At();e.name="funnelarea",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),jd=m({"src/traces/funnelarea/attributes.js"(e,t){var r=$u(),n=q(),i=Ma().attributes,{hovertemplateAttrs:a,texttemplateAttrs:o,templatefallbackAttrs:s}=Fe(),l=B().extendFlat;t.exports={labels:r.labels,label0:r.label0,dlabel:r.dlabel,values:r.values,marker:{colors:r.marker.colors,line:{color:l({},r.marker.line.color,{dflt:null}),width:l({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:r.marker.pattern,editType:"calc"},text:r.text,hovertext:r.hovertext,scalegroup:l({},r.scalegroup,{}),textinfo:l({},r.textinfo,{flags:["label","text","value","percent"]}),texttemplate:o({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:s({editType:"plot"}),hoverinfo:l({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:a({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:s(),textposition:l({},r.textposition,{values:["inside","none"],dflt:"inside"}),textfont:r.textfont,insidetextfont:r.insidetextfont,title:{text:r.title.text,font:r.title.font,position:l({},r.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"}}}}),Nd=m({"src/traces/funnelarea/layout_attributes.js"(e,t){var r=Ju().hiddenlabels;t.exports={hiddenlabels:r,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Ud=m({"src/traces/funnelarea/defaults.js"(e,t){var r=ct(),n=jd(),i=Ma().defaults,a=Xa().handleText,o=Ku().handleLabelsAndValues,s=Ku().handleMarkerDefaults;t.exports=function(e,t,l,c){function u(i,a){return r.coerce(e,t,n,i,a)}var h=u("labels"),f=u("values"),p=o(h,f),d=p.len;if(t._hasLabels=p.hasLabels,t._hasValues=p.hasValues,!t._hasLabels&&t._hasValues&&(u("label0"),u("dlabel")),d){t._length=d,s(e,t,c,u),u("scalegroup");var m,g=u("text"),y=u("texttemplate");if(u("texttemplatefallback"),y||(m=u("textinfo",Array.isArray(g)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),u("hovertemplatefallback"),y||m&&"none"!==m){var v=u("textposition");a(e,t,c,u,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else"none"===m&&u("textposition","none");i(t,c,u),u("title.text")&&(u("title.position"),r.coerceFont(u,"title.font",c.font)),u("aspectratio"),u("baseratio")}else t.visible=!1}}}),Vd=m({"src/traces/funnelarea/layout_defaults.js"(e,t){var r=ct(),n=Nd();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("hiddenlabels"),i("funnelareacolorway",t.colorway),i("extendfunnelareacolors")}}}),qd=m({"src/traces/funnelarea/calc.js"(e,t){var r=eh();t.exports={calc:function(e,t){return r.calc(e,t)},crossTraceCalc:function(e){r.crossTraceCalc(e,{type:"funnelarea"})}}}}),Hd=m({"src/traces/funnelarea/plot.js"(e,t){var r=b(),n=er(),i=ct(),a=i.strScale,o=i.strTranslate,s=Et(),l=ro().toMoveInsideBar,c=Qa(),u=c.recordMinTextSize,h=c.clearMinTextSize,f=wr(),p=rh(),d=p.attachFxHandlers,m=p.determineInsideTextFont,g=p.layoutAreas,y=p.prerenderTitles,v=p.positionTitleOutside,x=p.formatSliceLabel;function _(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}function w(e,t){return[.5*(e[0]+t[0]),.5*(e[1]+t[1])]}t.exports=function(e,t){var c=e._context.staticPlot,p=e._fullLayout;h("funnelarea",p),y(t,e),g(t,p._size),i.makeTraceGroups(p._funnelarealayer,t,"trace").each((function(t){var h=r.select(this),g=t[0],y=g.trace;(function(e){if(e.length){var t=e[0],r=t.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),c=t.vTotal,u=c,h=c*l/(1-l)/c,f=[];for(f.push(S()),o=e.length-1;o>-1;o--)if(!(s=e[o]).hidden){var p=s.v/u;h+=p,f.push(S())}var d=1/0,m=-1/0;for(o=0;o<f.length;o++)a=f[o],d=Math.min(d,a[1]),m=Math.max(m,a[1]);for(o=0;o<f.length;o++)f[o][1]-=(m+d)/2;var g=f[f.length-1][0],y=t.r,v=(m-d)/2,x=y/g,_=y/v*n;for(t.r=_*v,o=0;o<f.length;o++)f[o][0]*=x,f[o][1]*=_;var b=[-(a=f[0])[0],a[1]],T=[a[0],a[1]],k=0;for(o=e.length-1;o>-1;o--)if(!(s=e[o]).hidden){var A=f[k+=1][0],M=f[k][1];s.TL=[-A,M],s.TR=[A,M],s.BL=b,s.BR=T,s.pxmid=w(s.TR,s.BR),b=s.TL,T=s.TR}}function S(){var e=function(){var e=Math.sqrt(h);return{x:e,y:-e}}();return[e.x,e.y]}})(t),h.each((function(){var h=r.select(this).selectAll("g.slice").data(t);h.enter().append("g").classed("slice",!0),h.exit().remove(),h.each((function(a,o){if(a.hidden)r.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=y.index;var h=g.cx,v=g.cy,b=r.select(this),w=b.selectAll("path.surface").data([a]);w.enter().append("path").classed("surface",!0).style({"pointer-events":c?"none":"all"}),b.call(d,e,t);var T="M"+(h+a.TR[0])+","+(v+a.TR[1])+_(a.TR,a.BR)+_(a.BR,a.BL)+_(a.BL,a.TL)+"Z";w.attr("d",T),x(e,a,g);var k=f.castOption(y.textposition,a.pts),A=b.selectAll("g.slicetext").data(a.text&&"none"!==k?[0]:[]);A.enter().append("g").classed("slicetext",!0),A.exit().remove(),A.each((function(){var c=i.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),f=i.ensureUniformFontSize(e,m(y,a,p.font));c.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(n.font,f).call(s.convertToTspans,e);var d,g,x,_=n.bBox(c.node()),b=Math.min(a.BL[1],a.BR[1])+v,w=Math.max(a.TL[1],a.TR[1])+v;g=Math.max(a.TL[0],a.BL[0])+h,x=Math.min(a.TR[0],a.BR[0])+h,(d=l(g,x,b,w,_,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=f.size,u(y.type,d,p),t[o].transform=d,i.setTransormAndDisplay(c,d)}))}}));var b=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);b.enter().append("g").classed("titletext",!0),b.exit().remove(),b.each((function(){var t=i.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),l=y.title.text;y._meta&&(l=i.templateString(l,y._meta)),t.text(l).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(n.font,y.title.font).call(s.convertToTspans,e);var c=v(g,p._size);t.attr("transform",o(c.x,c.y)+a(Math.min(1,c.scale))+o(c.tx,c.ty))}))}))}))}}}),Gd=m({"src/traces/funnelarea/style.js"(e,t){var r=b(),n=kr(),i=Qa().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=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(t){r.select(this).call(n,t,i,e)}))}))}}}),Wd=m({"src/traces/funnelarea/index.js"(e,t){t.exports={moduleType:"trace",name:"funnelarea",basePlotModule:Bd(),categories:["pie-like","funnelarea","showLegend"],attributes:jd(),layoutAttributes:Nd(),supplyDefaults:Ud(),supplyLayoutDefaults:Vd(),calc:qd().calc,crossTraceCalc:qd().crossTraceCalc,plot:Hd(),style:Gd(),styleOne:kr(),meta:{}}}}),Zd=m({"lib/funnelarea.js"(e,t){t.exports=Wd()}}),Yd=m({"stackgl_modules/index.js"(e,t){!function(){var e={1964:function(e,t,r){e.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(7507),a=r(3778),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;var s=2147483647;function l(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|g(e,t),n=l(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(V(e,Uint8Array)){var t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(e));if(V(e,ArrayBuffer)||e&&V(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(V(e,SharedArrayBuffer)||e&&V(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return c.from(i,t,r);var a=function(e){if(c.isBuffer(e)){var t=0|m(e.length),r=l(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||q(e.length)?l(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(a)return a;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(e))}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return h(e),l(e<0?0:0|m(e))}function p(e){for(var t=e.length<0?0:0|m(e.length),r=l(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function m(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||V(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+n(e));var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(e).length;default:if(a)return i?-1:j(e).length;t=(""+t).toLowerCase(),a=!0}}function y(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return M(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function x(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:_(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):_(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,r,n,i){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var u=-1;for(a=r;a<s;a++)if(c(e,a)===c(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===l)return u*o}else-1!==u&&(a-=a-u),u=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){for(var h=!0,f=0;f<l;f++)if(c(e,a+f)!==c(t,f)){h=!1;break}if(h)return a}return-1}function b(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(q(s))return o;e[r+o]=s}return o}function w(e,t,r,n){return U(j(t,e.length-r),e,r,n)}function T(e,t,r,n){return U(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return U(N(t),e,r,n)}function A(e,t,r,n){return U(function(e,t){for(var r,n,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function M(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,o,s,l,c=e[i],u=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=r)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(a=e[i+1]))&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=h}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=E));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&"function"==typeof console.error&&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."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?l(e):void 0!==t?"string"==typeof r?l(e).fill(t,r):l(e).fill(t):l(e)}(e,t,r)},c.allocUnsafe=function(e){return f(e)},c.allocUnsafeSlow=function(e){return f(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(V(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),V(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.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}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=c.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(V(a,Uint8Array))i+a.length>n.length?c.from(a).copy(n,i):Uint8Array.prototype.set.call(n,a,i);else{if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},c.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):y.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,a){if(V(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+n(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),t<0||r>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=r)return 0;if(i>=a)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(i>>>=0),s=(r>>>=0)-(t>>>=0),l=Math.min(o,s),u=this.slice(i,a),h=e.slice(t,r),f=0;f<l;++f)if(u[f]!==h[f]){o=u[f],s=h[f];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return x(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return x(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function C(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function I(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function L(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=H[e[a]];return i}function P(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function z(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function O(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,r,n,i){return t=+t,r>>>=0,i||O(e,0,r,4),a.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,i){return t=+t,r>>>=0,i||O(e,0,r,8),a.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||z(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||z(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||z(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||z(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||z(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||z(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||z(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||z(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.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},c.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]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||z(e,4,this.length),a.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||z(e,4,this.length),a.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||z(e,8,this.length),a.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||z(e,8,this.length),a.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);D(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<r&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);D(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(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]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&0!==n&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var o=c.isBuffer(e)?e:c.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<r-t;++a)this[a+t]=o[a%s]}return this};var B=/[^+/0-9A-Za-z-_]/g;function j(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function N(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function V(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function q(e){return e!=e}var H=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+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,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(e){e||(e={});var i=e.ua;if(!i&&typeof navigator<"u"&&(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!=typeof i)return!1;var a=t.test(i)&&!r.test(i)||!!e.tablet&&n.test(i);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},6296:function(e,t,r){e.exports=function(e){var t=(e=e||{}).eye||[0,0,1],r=e.center||[0,0,0],s=e.up||[0,1,0],l=e.distanceLimits||[0,1/0],c=e.mode||"turntable",u=n(),h=i(),f=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,t,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,t,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,t,r,s),new o({turntable:u,orbit:h,matrix:f},c)};var n=r(7261),i=r(9977),a=r(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",this._active=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,r=0;r<t.length;++r)t[r].flush(e)},s.idle=function(e){for(var t=this._controllerList,r=0;r<t.length;++r)t[r].idle(e)},s.lookAt=function(e,t,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].lookAt(e,t,r,n)},s.rotate=function(e,t,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].rotate(e,t,r,n)},s.pan=function(e,t,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].pan(e,t,r,n)},s.translate=function(e,t,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].translate(e,t,r,n)},s.setMatrix=function(e,t){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setMatrix(e,t)},s.setDistanceLimits=function(e,t){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setDistanceLimits(e,t)},s.setDistance=function(e,t){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].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 r=this._active,n=this._controllerList[t],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,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}},7169:function(e,t,r){var n=typeof WeakMap>"u"?r(1538):WeakMap,i=r(2762),a=r(8116),o=new n;e.exports=function(e){var t=o.get(e),r=t&&(t._triangleBuffer.handle||t._triangleBuffer.buffer);if(!r||!e.isBuffer(r)){var n=i(e,new Float32Array([-1,-1,-1,4,4,-1]));(t=a(e,[{buffer:n,type:e.FLOAT,size:2}]))._triangleBuffer=n,o.set(e,t)}t.bind(),e.drawArrays(e.TRIANGLES,0,3),t.unbind()}},1085:function(e,t,r){var n=r(1371);e.exports=function(e,t,r){t="number"==typeof t?t:1,r=r||": ";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 n(o,a-s)+r+e})).join("\n")}},3952:function(e,t,r){e.exports=function(e){var t=e.length;if(0===t)return[];if(1===t)return[0];for(var r=e[0].length,n=[e[0]],a=[0],o=1;o<t;++o)if(n.push(e[o]),i(n,r)){if(a.push(o),a.length===r+1)return a}else n.pop();return a};var n=r(3250);function i(e,t){for(var r=new Array(t+1),i=0;i<e.length;++i)r[i]=e[i];for(i=0;i<=e.length;++i){for(var a=e.length;a<=t;++a){for(var o=new Array(t),s=0;s<t;++s)o[s]=Math.pow(a+1-i,s);r[a]=o}if(n.apply(void 0,r))return!0}return!1}},5995:function(e,t,r){e.exports=function(e,t){return n(t).filter((function(r){for(var n=new Array(r.length),a=0;a<r.length;++a)n[a]=t[r[a]];return i(n)*e<1}))};var n=r(7642),i=r(6037)},3502:function(e,t,r){e.exports=function(e,t){return i(n(e,t))};var n=r(5995),i=r(9127)},6468:function(e){e.exports=function(e){return atob(e)}},2642:function(e,t,r){e.exports=function(e,t){for(var r=t.length,a=new Array(r+1),o=0;o<r;++o){for(var s=new Array(r+1),l=0;l<=r;++l)s[l]=e[l][o];a[o]=s}for(a[r]=new Array(r+1),o=0;o<=r;++o)a[r][o]=1;var c=new Array(r+1);for(o=0;o<r;++o)c[o]=t[o];c[r]=1;var u=n(a,c),h=i(u[r+1]);0===h&&(h=1);var f=new Array(r+1);for(o=0;o<=r;++o)f[o]=i(u[o])/h;return f};var n=r(727);function i(e){for(var t=0,r=0;r<e.length;++r)t+=e[r];return t}},7507:function(e,t){t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=s(e),o=a[0],l=a[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,l)),u=0,h=l>0?o-4:o;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,l=n-i;s<l;s+=o)a.push(c(e,s,s+o>l?l:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),i.push(l(n));return i.join("")}n[45]=62,n[95]=63},3865:function(e,t,r){var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]).add(t[0].mul(e[1])),e[1].mul(t[1]))}},1318:function(e){e.exports=function(e,t){return e[0].mul(t[1]).cmp(t[0].mul(e[1]))}},8697:function(e,t,r){var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]),e[1].mul(t[0]))}},7842:function(e,t,r){var n=r(6330),i=r(1533),a=r(2651),o=r(6768),s=r(869),l=r(8697);e.exports=function e(t,r){if(n(t))return r?l(t,e(r)):[t[0].clone(),t[1].clone()];var c,u,h=0;if(i(t))c=t.clone();else if("string"==typeof t)c=o(t);else{if(0===t)return[a(0),a(1)];if(t===Math.floor(t))c=a(t);else{for(;t!==Math.floor(t);)t*=Math.pow(2,256),h-=256;c=a(t)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(i(r))u=r.clone();else if("string"==typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),h+=256;u=a(r)}else u=a(1);return h>0?c=c.ushln(h):h<0&&(u=u.ushln(-h)),s(c,u)}},6330:function(e,t,r){var n=r(1533);e.exports=function(e){return Array.isArray(e)&&2===e.length&&n(e[0])&&n(e[1])}},5716:function(e,t,r){var n=r(6859);e.exports=function(e){return e.cmp(new n(0))}},1369:function(e,t,r){var n=r(5716);e.exports=function(e){var t=e.length,r=e.words,i=0;if(1===t)i=r[0];else if(2===t)i=r[0]+67108864*r[1];else for(var a=0;a<t;a++)i+=r[a]*Math.pow(67108864,a);return n(e)*i}},4025:function(e,t,r){var n=r(2361),i=r(8828).countTrailingZeros;e.exports=function(e){var t=i(n.lo(e));if(t<32)return t;var r=i(n.hi(e));return r>20?52:r+32}},1533:function(e,t,r){r(6859),e.exports=function(e){return e&&"object"==typeof e&&!!e.words}},2651:function(e,t,r){var n=r(6859),i=r(2361);e.exports=function(e){var t=i.exponent(e);return t<52?new n(e):new n(e*Math.pow(2,52-t)).ushln(t-52)}},869:function(e,t,r){var n=r(2651),i=r(5716);e.exports=function(e,t){var r=i(e),a=i(t);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(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,r){var n=r(6859);e.exports=function(e){return new n(e)}},6504:function(e,t,r){var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[0]),e[1].mul(t[1]))}},7721:function(e,t,r){var n=r(5716);e.exports=function(e){return n(e[0])*n(e[1])}},5572:function(e,t,r){var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]).sub(e[1].mul(t[0])),e[1].mul(t[1]))}},946:function(e,t,r){var n=r(1369),i=r(4025);e.exports=function(e){var t=e[0],r=e[1];if(0===t.cmpn(0))return 0;var a=t.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=t.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(f=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53,f=n(l.ushln(h).divRound(r));return h<1023?c*f*Math.pow(2,-h):c*(f*=Math.pow(2,-1023))*Math.pow(2,1023-h)}},2478:function(e){function t(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function r(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(e,t,r,n,i,a){return"function"==typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}e.exports={ge:function(e,r,n,i,a){return o(e,r,n,i,a,t)},gt:function(e,t,n,i,a){return o(e,t,n,i,a,r)},lt:function(e,t,r,i,a){return o(e,t,r,i,a,n)},le:function(e,t,r,n,a){return o(e,t,r,n,a,i)},eq:function(e,t,r,n,i){return o(e,t,r,n,i,a)}}},8828:function(e,t){function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;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,r;return t=(e>65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>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 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,1+((e|=e>>>8)|e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);(function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<<i&255}})(n),t.reverse=function(e){return n[255&e]<<24|n[e>>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},6859:function(e,t,r){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o=typeof window<"u"&&typeof window.Buffer<"u"?window.Buffer:r(7790).Buffer}catch{}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o<a;o++){var s=e.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof 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,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)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)>=26&&(s-=26,a++);else if("le"===r)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)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=l(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=l(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,u=r;u<s;u+=n)l=c(e,u,u+n,t),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==o){var h=1;for(l=c(e,u,e.length,t),u=0;u<o;u++)h*=t;this.imuln(h),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},a.prototype.copy=function(e){e.words=new 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&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[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"],h=[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];function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var u=l>>>26,h=67108863&l,f=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=f;p++){var d=c-p|0;u+=(o=(i=0|e.words[d])*(a=0|t.words[p])+h)/67108864|0,h=67108863&o}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==a||o!==this.length-1?u[6-l.length]+l+r:l+r}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],p=f[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(e);r=(d=d.idivn(p)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(typeof o<"u"),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===t,c=new e(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s<a;s++)c[s]=0}else{for(s=0;s<a-i;s++)c[s]=0;for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[a-s-1]=o}return c},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},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 n(!(this.negative|e.negative)),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){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return n(!(this.negative|e.negative)),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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return n(!(this.negative|e.negative)),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){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(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(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o<n.length;o++)a=(t=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<r.length;o++)a=(t=(0|r.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&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)};var d=function(e,t,r){var n,i,a,o=e.words,s=t.words,l=r.words,c=0,u=0|o[0],h=8191&u,f=u>>>13,p=0|o[1],d=8191&p,m=p>>>13,g=0|o[2],y=8191&g,v=g>>>13,x=0|o[3],_=8191&x,b=x>>>13,w=0|o[4],T=8191&w,k=w>>>13,A=0|o[5],M=8191&A,S=A>>>13,E=0|o[6],C=8191&E,I=E>>>13,L=0|o[7],P=8191&L,z=L>>>13,D=0|o[8],O=8191&D,R=D>>>13,F=0|o[9],B=8191&F,j=F>>>13,N=0|s[0],U=8191&N,V=N>>>13,q=0|s[1],H=8191&q,G=q>>>13,W=0|s[2],Z=8191&W,Y=W>>>13,X=0|s[3],$=8191&X,K=X>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],le=8191&se,ce=se>>>13,ue=0|s[8],he=8191&ue,fe=ue>>>13,pe=0|s[9],de=8191&pe,me=pe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,U)|0))<<13)|0;c=((a=Math.imul(f,V))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(d,U),i=(i=Math.imul(d,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var ye=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,H)|0))<<13)|0;c=((a=a+Math.imul(f,G)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,V))+Math.imul(v,U)|0,a=Math.imul(v,V),n=n+Math.imul(d,H)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var ve=(c+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,Z)|0))<<13)|0;c=((a=a+Math.imul(f,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,V))+Math.imul(b,U)|0,a=Math.imul(b,V),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,G)|0,n=n+Math.imul(d,Z)|0,i=(i=i+Math.imul(d,Y)|0)+Math.imul(m,Z)|0,a=a+Math.imul(m,Y)|0;var xe=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(f,$)|0))<<13)|0;c=((a=a+Math.imul(f,K)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(b,H)|0,a=a+Math.imul(b,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,Z)|0,a=a+Math.imul(v,Y)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,K)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,K)|0;var _e=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(f,Q)|0))<<13)|0;c=((a=a+Math.imul(f,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(b,Z)|0,a=a+Math.imul(b,Y)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,K)|0,n=n+Math.imul(d,Q)|0,i=(i=i+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var be=(c+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((a=a+Math.imul(f,ne)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,V))+Math.imul(I,U)|0,a=Math.imul(I,V),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(k,Z)|0,a=a+Math.imul(k,Y)|0,n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,K)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,K)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,ee)|0,n=n+Math.imul(d,re)|0,i=(i=i+Math.imul(d,ne)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ne)|0;var we=(c+(n=n+Math.imul(h,ae)|0)|0)+((8191&(i=(i=i+Math.imul(h,oe)|0)+Math.imul(f,ae)|0))<<13)|0;c=((a=a+Math.imul(f,oe)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(P,U),i=(i=Math.imul(P,V))+Math.imul(z,U)|0,a=Math.imul(z,V),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,H)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(S,Z)|0,a=a+Math.imul(S,Y)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(v,re)|0,a=a+Math.imul(v,ne)|0,n=n+Math.imul(d,ae)|0,i=(i=i+Math.imul(d,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var Te=(c+(n=n+Math.imul(h,le)|0)|0)+((8191&(i=(i=i+Math.imul(h,ce)|0)+Math.imul(f,le)|0))<<13)|0;c=((a=a+Math.imul(f,ce)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(z,H)|0,a=a+Math.imul(z,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(I,Z)|0,a=a+Math.imul(I,Y)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ne)|0,n=n+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(v,ae)|0,a=a+Math.imul(v,oe)|0,n=n+Math.imul(d,le)|0,i=(i=i+Math.imul(d,ce)|0)+Math.imul(m,le)|0,a=a+Math.imul(m,ce)|0;var ke=(c+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,fe)|0)+Math.imul(f,he)|0))<<13)|0;c=((a=a+Math.imul(f,fe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(z,Z)|0,a=a+Math.imul(z,Y)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,K)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(_,ae)|0,i=(i=i+Math.imul(_,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,n=n+Math.imul(y,le)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(v,le)|0,a=a+Math.imul(v,ce)|0,n=n+Math.imul(d,he)|0,i=(i=i+Math.imul(d,fe)|0)+Math.imul(m,he)|0,a=a+Math.imul(m,fe)|0;var Ae=(c+(n=n+Math.imul(h,de)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(f,de)|0))<<13)|0;c=((a=a+Math.imul(f,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,G))+Math.imul(j,H)|0,a=Math.imul(j,G),n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(R,Z)|0,a=a+Math.imul(R,Y)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,K)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Q)|0,a=a+Math.imul(I,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ne)|0,n=n+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,oe)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,oe)|0,n=n+Math.imul(_,le)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(b,le)|0,a=a+Math.imul(b,ce)|0,n=n+Math.imul(y,he)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(v,he)|0,a=a+Math.imul(v,fe)|0;var Me=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;c=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,Y))+Math.imul(j,Z)|0,a=Math.imul(j,Y),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,a=a+Math.imul(I,ne)|0,n=n+Math.imul(M,ae)|0,i=(i=i+Math.imul(M,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(T,le)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(k,le)|0,a=a+Math.imul(k,ce)|0,n=n+Math.imul(_,he)|0,i=(i=i+Math.imul(_,fe)|0)+Math.imul(b,he)|0,a=a+Math.imul(b,fe)|0;var Se=(c+(n=n+Math.imul(y,de)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(v,de)|0))<<13)|0;c=((a=a+Math.imul(v,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,K))+Math.imul(j,$)|0,a=Math.imul(j,K),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ne)|0,n=n+Math.imul(C,ae)|0,i=(i=i+Math.imul(C,oe)|0)+Math.imul(I,ae)|0,a=a+Math.imul(I,oe)|0,n=n+Math.imul(M,le)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(S,le)|0,a=a+Math.imul(S,ce)|0,n=n+Math.imul(T,he)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(k,he)|0,a=a+Math.imul(k,fe)|0;var Ee=(c+(n=n+Math.imul(_,de)|0)|0)+((8191&(i=(i=i+Math.imul(_,me)|0)+Math.imul(b,de)|0))<<13)|0;c=((a=a+Math.imul(b,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,Q),i=(i=Math.imul(B,ee))+Math.imul(j,Q)|0,a=Math.imul(j,ee),n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(R,re)|0,a=a+Math.imul(R,ne)|0,n=n+Math.imul(P,ae)|0,i=(i=i+Math.imul(P,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,n=n+Math.imul(C,le)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(I,le)|0,a=a+Math.imul(I,ce)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(S,he)|0,a=a+Math.imul(S,fe)|0;var Ce=(c+(n=n+Math.imul(T,de)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(k,de)|0))<<13)|0;c=((a=a+Math.imul(k,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(j,re)|0,a=Math.imul(j,ne),n=n+Math.imul(O,ae)|0,i=(i=i+Math.imul(O,oe)|0)+Math.imul(R,ae)|0,a=a+Math.imul(R,oe)|0,n=n+Math.imul(P,le)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(z,le)|0,a=a+Math.imul(z,ce)|0,n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(I,he)|0,a=a+Math.imul(I,fe)|0;var Ie=(c+(n=n+Math.imul(M,de)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(S,de)|0))<<13)|0;c=((a=a+Math.imul(S,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,ae),i=(i=Math.imul(B,oe))+Math.imul(j,ae)|0,a=Math.imul(j,oe),n=n+Math.imul(O,le)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(R,le)|0,a=a+Math.imul(R,ce)|0,n=n+Math.imul(P,he)|0,i=(i=i+Math.imul(P,fe)|0)+Math.imul(z,he)|0,a=a+Math.imul(z,fe)|0;var Le=(c+(n=n+Math.imul(C,de)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,de)|0))<<13)|0;c=((a=a+Math.imul(I,me)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,n=Math.imul(B,le),i=(i=Math.imul(B,ce))+Math.imul(j,le)|0,a=Math.imul(j,ce),n=n+Math.imul(O,he)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(R,he)|0,a=a+Math.imul(R,fe)|0;var Pe=(c+(n=n+Math.imul(P,de)|0)|0)+((8191&(i=(i=i+Math.imul(P,me)|0)+Math.imul(z,de)|0))<<13)|0;c=((a=a+Math.imul(z,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,he),i=(i=Math.imul(B,fe))+Math.imul(j,he)|0,a=Math.imul(j,fe);var ze=(c+(n=n+Math.imul(O,de)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(R,de)|0))<<13)|0;c=((a=a+Math.imul(R,me)|0)+(i>>>13)|0)+(ze>>>26)|0,ze&=67108863;var De=(c+(n=Math.imul(B,de))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(j,de)|0))<<13)|0;return c=((a=Math.imul(j,me))+(i>>>13)|0)+(De>>>26)|0,De&=67108863,l[0]=ge,l[1]=ye,l[2]=ve,l[3]=xe,l[4]=_e,l[5]=be,l[6]=we,l[7]=Te,l[8]=ke,l[9]=Ae,l[10]=Me,l[11]=Se,l[12]=Ee,l[13]=Ce,l[14]=Ie,l[15]=Le,l[16]=Pe,l[17]=ze,l[18]=De,0!==c&&(l[19]=c,r.length++),r};function m(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(d=p),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):n<63?p(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,l=Math.min(a,t.length-1),c=Math.max(0,a-e.length+1);c<=l;c++){var u=a-c,h=(0|e.words[u])*(0|t.words[c]),f=67108863&h;s=67108863&(f=f+s|0),i+=(o=(o=o+(h/67108864|0)|0)+(f>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):m(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o<a;o++)n[o]=t[e[o]],i[o]=r[e[o]]},g.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var h=l,f=c,p=0;p<o;p++){var d=r[u+p],m=n[u+p],g=r[u+p+o],y=n[u+p+o],v=h*g-f*y;y=h*y+f*g,g=v,r[u+p]=d+g,n[u+p]=m+y,r[u+p+o]=d-g,n[u+p+o]=m-y,p!==s&&(v=l*h-c*f,f=l*f+c*h,h=v)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var a=0,o=0;o<t;o++)a+=0|e[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<i;++o)r[o]=0;n(0===a),n(!(-8192&a))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),l=new Array(n),c=new Array(n),u=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,c,n),this.transform(o,a,s,l,n,i),this.transform(c,a,u,h,n,i);for(var p=0;p<n;p++){var d=s[p]*u[p]-l[p]*h[p];l[p]=s[p]*h[p]+l[p]*u[p],s[p]=d}return this.conjugate(s,l,n),this.transform(s,l,f,a,n,i),this.conjugate(f,a,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),m(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this.length=0===e?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=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,l=(0|this.words[t])-s<<r;this.words[t]=l|o,o=s>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,l=r;if(i-=o,i=Math.max(0,i),l){for(var c=0;c<o;c++)l.words[c]=this.words[c];l.length=o}if(0!==o)if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},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){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},a.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return 0===this.length&&(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 n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},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(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&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]-=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,r){var i,a=e.length+r;this._expand(a);var o,s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var l=(0|e.words[i])*t;s=((o-=67108863&l)>>26)-(l/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==t){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var u=n.clone()._ishlnsubmul(i,1,l);0===u.negative&&(n=u,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):this.negative&e.negative?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{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);var i,o,s},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 r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=t.clone();!t.isZero();){for(var f=0,p=1;!(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var d=0,m=1;!(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(h)),s.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(l)):(r.isub(t),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t,r=this,i=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var o=new a(1),s=new a(0),l=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var c=0,u=1;!(r.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,f=1;!(i.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);r.cmp(i)>=0?(r.isub(i),o.isub(s)):(i.isub(r),s.isub(o))}return(t=0===r.cmpn(1)?o:s).cmpn(0)<0&&t.iadd(e),t},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},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-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},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 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new T(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(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 v(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()}function x(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(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)}v.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(x,v),x.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&r)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&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,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(_,v),i(b,v),i(w,v),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new x;else if("p224"===e)t=new _;else if("p192"===e)t=new b;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return y[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(!(e.negative|t.negative),"red works only with positives"),n(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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),d=o;0!==p.cmp(s);){for(var m=p,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<d);var y=this.pow(h,new a(1).iushln(d-g-1));f=f.redMul(y),h=y.redSqr(),p=p.redMul(h),d=g}return f},T.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},T.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],o=0,s=0,l=t.bitLength()%26;for(0===l&&(l=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],u=l-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4==++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},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 k(e)},i(k,T),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).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)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).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)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6204:function(e){e.exports=function(e){var t,r,n,i=e.length,a=0;for(t=0;t<i;++t)a+=e[t].length;var o=new Array(a),s=0;for(t=0;t<i;++t){var l=e[t],c=l.length;for(r=0;r<c;++r){var u=o[s++]=new Array(c-1),h=0;for(n=0;n<c;++n)n!==r&&(u[h++]=l[n]);if(1&r){var f=u[1];u[1]=u[0],u[0]=f}}}return o}},6867:function(e,t,r){e.exports=function(e,t,r){switch(arguments.length){case 1:return function(e){return n=[],c(e,e,u,!0),n}(e);case 2:return"function"==typeof t?c(e,e,t,!0):function(e,t){return n=[],c(e,t,u,!1),n}(e,t);case 3:return c(e,t,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var n,i=r(1888),a=r(855),o=r(7150);function s(e,t){for(var r=0;r<e;++r)if(!(t[r]<=t[r+e]))return!0;return!1}function l(e,t,r,n){for(var i=0,a=0,o=0,l=e.length;o<l;++o){var c=e[o];if(!s(t,c)){for(var u=0;u<2*t;++u)r[i++]=c[u];n[a++]=o}}return a}function c(e,t,r,n){var s=e.length,c=t.length;if(!(s<=0||c<=0)){var u=e[0].length>>>1;if(!(u<=0)){var h,f=i.mallocDouble(2*u*s),p=i.mallocInt32(s);if((s=l(e,u,f,p))>0){if(1===u&&n)a.init(s),h=a.sweepComplete(u,r,0,s,f,p,0,s,f,p);else{var d=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(t,u,d,m))>0&&(a.init(s+c),h=1===u?a.sweepBipartite(u,r,0,s,f,p,0,c,d,m):o(u,r,n,s,f,p,c,d,m),i.free(d),i.free(m))}i.free(f),i.free(p)}return h}}}function u(e,t){n.push([e,t])}},2455:function(e,t){function r(e){return e?function(e,t,r,n,i,a,o,s,l,c,u){return i-n>l-s?function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,f=n,p=h*n;f<i;++f,p+=h){var d=a[t+p],m=a[t+p+e],g=o[f];e:for(var y=s,v=h*s;y<l;++y,v+=h){var x=c[t+v],_=c[t+v+e],b=u[y];if(!(_<d||m<x)){for(var w=t+1;w<e;++w){var T=a[w+p],k=a[w+e+p],A=c[w+v],M=c[w+e+v];if(k<A||M<T)continue e}var S=r(g,b);if(void 0!==S)return S}}}}(e,t,r,n,i,a,o,s,l,c,u):function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,f=s,p=h*s;f<l;++f,p+=h){var d=c[t+p],m=c[t+p+e],g=u[f];e:for(var y=n,v=h*n;y<i;++y,v+=h){var x=a[t+v],_=a[t+v+e],b=o[y];if(!(m<x||_<d)){for(var w=t+1;w<e;++w){var T=a[w+v],k=a[w+e+v],A=c[w+p],M=c[w+e+p];if(k<A||M<T)continue e}var S=r(b,g);if(void 0!==S)return S}}}}(e,t,r,n,i,a,o,s,l,c,u)}:function(e,t,r,n,i,a,o,s,l,c,u,h){return a-i>c-l?n?function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,f=n,p=h*n;f<i;++f,p+=h){var d=a[t+p],m=a[t+p+e],g=o[f];e:for(var y=s,v=h*s;y<l;++y,v+=h){var x=c[t+v],_=u[y];if(!(x<=d||m<x)){for(var b=t+1;b<e;++b){var w=a[b+p],T=a[b+e+p],k=c[b+v],A=c[b+e+v];if(T<k||A<w)continue e}var M=r(_,g);if(void 0!==M)return M}}}}(e,t,r,i,a,o,s,l,c,u,h):function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,f=n,p=h*n;f<i;++f,p+=h){var d=a[t+p],m=a[t+p+e],g=o[f];e:for(var y=s,v=h*s;y<l;++y,v+=h){var x=c[t+v],_=u[y];if(!(x<d||m<x)){for(var b=t+1;b<e;++b){var w=a[b+p],T=a[b+e+p],k=c[b+v],A=c[b+e+v];if(T<k||A<w)continue e}var M=r(g,_);if(void 0!==M)return M}}}}(e,t,r,i,a,o,s,l,c,u,h):n?function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,f=s,p=h*s;f<l;++f,p+=h){var d=c[t+p],m=u[f];e:for(var g=n,y=h*n;g<i;++g,y+=h){var v=a[t+y],x=a[t+y+e],_=o[g];if(!(d<=v||x<d)){for(var b=t+1;b<e;++b){var w=a[b+y],T=a[b+e+y],k=c[b+p],A=c[b+e+p];if(T<k||A<w)continue e}var M=r(m,_);if(void 0!==M)return M}}}}(e,t,r,i,a,o,s,l,c,u,h):function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,f=s,p=h*s;f<l;++f,p+=h){var d=c[t+p],m=u[f];e:for(var g=n,y=h*n;g<i;++g,y+=h){var v=a[t+y],x=a[t+y+e],_=o[g];if(!(d<v||x<d)){for(var b=t+1;b<e;++b){var w=a[b+y],T=a[b+e+y],k=c[b+p],A=c[b+e+p];if(T<k||A<w)continue e}var M=r(_,m);if(void 0!==M)return M}}}}(e,t,r,i,a,o,s,l,c,u,h)}}t.partial=r(!1),t.full=r(!0)},7150:function(e,t,r){e.exports=function(e,t,r,a,u,S,E,C,I){!function(e,t){var r=8*i.log2(t+1)*(e+1)|0,a=i.nextPow2(_*r);w.length<a&&(n.free(w),w=n.mallocInt32(a));var o=i.nextPow2(b*r);T.length<o&&(n.free(T),T=n.mallocDouble(o))}(e,a+E);var L,P=0,z=2*e;for(k(P++,0,0,a,0,E,r?16:0,-1/0,1/0),r||k(P++,0,0,E,0,a,1,-1/0,1/0);P>0;){var D=(P-=1)*_,O=w[D],R=w[D+1],F=w[D+2],B=w[D+3],j=w[D+4],N=w[D+5],U=P*b,V=T[U],q=T[U+1],H=1&N,G=!!(16&N),W=u,Z=S,Y=C,X=I;if(H&&(W=C,Z=I,Y=u,X=S),!(2&N&&(F=g(e,O,R,F,W,Z,q),R>=F)||4&N&&(R=y(e,O,R,F,W,Z,V),R>=F))){var $=F-R,K=j-B;if(G){if(e*$*($+K)<p){if(void 0!==(L=l.scanComplete(e,O,t,R,F,W,Z,B,j,Y,X)))return L;continue}}else{if(e*Math.min($,K)<h){if(void 0!==(L=o(e,O,t,H,R,F,W,Z,B,j,Y,X)))return L;continue}if(e*$*K<f){if(void 0!==(L=l.scanBipartite(e,O,t,H,R,F,W,Z,B,j,Y,X)))return L;continue}}var J=d(e,O,R,F,W,Z,V,q);if(R<J)if(e*(J-R)<h){if(void 0!==(L=s(e,O+1,t,R,J,W,Z,B,j,Y,X)))return L}else if(O===e-2){if(void 0!==(L=H?l.sweepBipartite(e,t,B,j,Y,X,R,J,W,Z):l.sweepBipartite(e,t,R,J,W,Z,B,j,Y,X)))return L}else k(P++,O+1,R,J,B,j,H,-1/0,1/0),k(P++,O+1,B,j,R,J,1^H,-1/0,1/0);if(J<F){var Q=c(e,O,B,j,Y,X),ee=Y[z*Q+O],te=m(e,O,Q,j,Y,X,ee);if(te<j&&k(P++,O,J,F,te,j,(4|H)+(G?16:0),ee,q),B<Q&&k(P++,O,J,F,B,Q,(2|H)+(G?16:0),V,ee),Q+1===te){if(void 0!==(L=G?M(e,O,t,J,F,W,Z,Q,Y,X[Q]):A(e,O,t,H,J,F,W,Z,Q,Y,X[Q])))return L}else if(Q<te){var re;if(G){if(J<(re=v(e,O,J,F,W,Z,ee))){var ne=m(e,O,J,re,W,Z,ee);if(O===e-2){if(J<ne&&void 0!==(L=l.sweepComplete(e,t,J,ne,W,Z,Q,te,Y,X))||ne<re&&void 0!==(L=l.sweepBipartite(e,t,ne,re,W,Z,Q,te,Y,X)))return L}else J<ne&&k(P++,O+1,J,ne,Q,te,16,-1/0,1/0),ne<re&&(k(P++,O+1,ne,re,Q,te,0,-1/0,1/0),k(P++,O+1,Q,te,ne,re,1,-1/0,1/0))}}else J<(re=H?x(e,O,J,F,W,Z,ee):v(e,O,J,F,W,Z,ee))&&(O===e-2?L=H?l.sweepBipartite(e,t,Q,te,Y,X,J,re,W,Z):l.sweepBipartite(e,t,J,re,W,Z,Q,te,Y,X):(k(P++,O+1,J,re,Q,te,H,-1/0,1/0),k(P++,O+1,Q,te,J,re,1^H,-1/0,1/0)))}}}}};var n=r(1888),i=r(8828),a=r(2455),o=a.partial,s=a.full,l=r(855),c=r(3545),u=r(8105),h=128,f=1<<22,p=1<<22,d=u("!(lo>=p0)&&!(p1>=hi)"),m=u("lo===p0"),g=u("lo<p0"),y=u("hi<=p0"),v=u("lo<=p0&&p0<=hi"),x=u("lo<p0&&p0<=hi"),_=6,b=2,w=n.mallocInt32(1024),T=n.mallocDouble(1024);function k(e,t,r,n,i,a,o,s,l){var c=_*e;w[c]=t,w[c+1]=r,w[c+2]=n,w[c+3]=i,w[c+4]=a,w[c+5]=o;var u=b*e;T[u]=s,T[u+1]=l}function A(e,t,r,n,i,a,o,s,l,c,u){var h=2*e,f=l*h,p=c[f+t];e:for(var d=i,m=i*h;d<a;++d,m+=h){var g=o[m+t],y=o[m+t+e];if(!(p<g||y<p||n&&p===g)){for(var v=s[d],x=t+1;x<e;++x){g=o[m+x],y=o[m+x+e];var _=c[f+x],b=c[f+x+e];if(y<_||b<g)continue e}var w;if(void 0!==(w=n?r(u,v):r(v,u)))return w}}}function M(e,t,r,n,i,a,o,s,l,c){var u=2*e,h=s*u,f=l[h+t];e:for(var p=n,d=n*u;p<i;++p,d+=u){var m=o[p];if(m!==c){var g=a[d+t],y=a[d+t+e];if(!(f<g||y<f)){for(var v=t+1;v<e;++v){g=a[d+v],y=a[d+v+e];var x=l[h+v],_=l[h+v+e];if(y<x||_<g)continue e}var b=r(m,c);if(void 0!==b)return b}}}}},3545:function(e,t,r){e.exports=function(e,t,r,o,s,l){if(o<=r+1)return r;for(var c=r,u=o,h=o+r>>>1,f=2*e,p=h,d=s[f*h+t];c<u;){if(u-c<i){a(e,t,c,u,s,l),d=s[f*h+t];break}var m=u-c,g=Math.random()*m+c|0,y=s[f*g+t],v=Math.random()*m+c|0,x=s[f*v+t],_=Math.random()*m+c|0,b=s[f*_+t];y<=x?b>=x?(p=v,d=x):y>=b?(p=g,d=y):(p=_,d=b):x>=b?(p=v,d=x):b>=y?(p=g,d=y):(p=_,d=b);for(var w=f*(u-1),T=f*p,k=0;k<f;++k,++w,++T){var A=s[w];s[w]=s[T],s[T]=A}var M=l[u-1];for(l[u-1]=l[p],l[p]=M,w=f*(u-1),T=f*(p=n(e,t,c,u-1,s,l,d)),k=0;k<f;++k,++w,++T)A=s[w],s[w]=s[T],s[T]=A;if(M=l[u-1],l[u-1]=l[p],l[p]=M,h<p){for(u=p-1;c<u&&s[f*(u-1)+t]===d;)u-=1;u+=1}else{if(!(p<h))break;for(c=p+1;c<u&&s[f*c+t]===d;)c+=1}}return n(e,t,r,h,s,l,s[f*h+t])};var n=r(8105)("lo<p0"),i=8;function a(e,t,r,n,i,a){for(var o=2*e,s=o*(r+1)+t,l=r+1;l<n;++l,s+=o)for(var c=i[s],u=l,h=o*(l-1);u>r&&i[h+t]>c;--u,h-=o){for(var f=h,p=h+o,d=0;d<o;++d,++f,++p){var m=i[f];i[f]=i[p],i[p]=m}var g=a[u];a[u]=a[u-1],a[u-1]=g}}},8105:function(e){e.exports=function(e){return t[e]};var t={"lo===p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=t,f=r;n>f;++f,l+=s)if(i[l+h]===o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"lo<p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=t,f=r;n>f;++f,l+=s)if(i[l+h]<o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"lo<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=e+t,f=r;n>f;++f,l+=s)if(i[l+h]<=o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"hi<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=e+t,f=r;n>f;++f,l+=s)if(i[l+h]<=o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"lo<p0&&p0<=hi":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=t,f=e+t,p=r;n>p;++p,l+=s){var d=i[l+h],m=i[l+f];if(d<o&&o<=m)if(u===p)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[p];a[p]=a[u],a[u++]=v}}return u},"lo<=p0&&p0<=hi":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=t,f=e+t,p=r;n>p;++p,l+=s){var d=i[l+h],m=i[l+f];if(d<=o&&o<=m)if(u===p)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[p];a[p]=a[u],a[u++]=v}}return u},"!(lo>=p0)&&!(p1>=hi)":function(e,t,r,n,i,a,o,s){for(var l=2*e,c=l*r,u=c,h=r,f=t,p=e+t,d=r;n>d;++d,c+=l){var m=i[c+f],g=i[c+p];if(!(m>=o||s>=g))if(h===d)h+=1,u+=l;else{for(var y=0;l>y;++y){var v=i[c+y];i[c+y]=i[u],i[u++]=v}var x=a[d];a[d]=a[h],a[h++]=x}}return h}}},4192:function(e){e.exports=function(e,n){n<=4*t?r(0,n-1,e):c(0,n-1,e)};var t=32;function r(e,t,r){for(var n=2*(e+1),i=e+1;i<=t;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >e;){var c=r[l-2],u=r[l-1];if(c<a)break;if(c===a&&u<o)break;r[l]=c,r[l+1]=u,l-=2}r[l]=a,r[l+1]=o}}function n(e,t,r){t*=2;var n=r[e*=2],i=r[e+1];r[e]=r[t],r[e+1]=r[t+1],r[t]=n,r[t+1]=i}function i(e,t,r){t*=2,r[e*=2]=r[t],r[e+1]=r[t+1]}function a(e,t,r,n){t*=2,r*=2;var i=n[e*=2],a=n[e+1];n[e]=n[t],n[e+1]=n[t+1],n[t]=n[r],n[t+1]=n[r+1],n[r]=i,n[r+1]=a}function o(e,t,r,n,i){t*=2,i[e*=2]=i[t],i[t]=r,i[e+1]=i[t+1],i[t+1]=n}function s(e,t,r){t*=2;var n=r[e*=2],i=r[t];return!(n<i)&&(n!==i||r[e+1]>r[t+1])}function l(e,t,r,n){var i=n[e*=2];return i<t||i===t&&n[e+1]<r}function c(e,u,h){var f=(u-e+1)/6|0,p=e+f,d=u-f,m=e+u>>1,g=m-f,y=m+f,v=p,x=g,_=m,b=y,w=d,T=e+1,k=u-1,A=0;s(v,x,h)&&(A=v,v=x,x=A),s(b,w,h)&&(A=b,b=w,w=A),s(v,_,h)&&(A=v,v=_,_=A),s(x,_,h)&&(A=x,x=_,_=A),s(v,b,h)&&(A=v,v=b,b=A),s(_,b,h)&&(A=_,_=b,b=A),s(x,w,h)&&(A=x,x=w,w=A),s(x,_,h)&&(A=x,x=_,_=A),s(b,w,h)&&(A=b,b=w,w=A);for(var M=h[2*x],S=h[2*x+1],E=h[2*b],C=h[2*b+1],I=2*v,L=2*_,P=2*w,z=2*p,D=2*m,O=2*d,R=0;R<2;++R){var F=h[I+R],B=h[L+R],j=h[P+R];h[z+R]=F,h[D+R]=B,h[O+R]=j}i(g,e,h),i(y,u,h);for(var N=T;N<=k;++N)if(l(N,M,S,h))N!==T&&n(N,T,h),++T;else if(!l(N,E,C,h))for(;;){if(l(k,E,C,h)){l(k,M,S,h)?(a(N,T,k,h),++T,--k):(n(N,k,h),--k);break}if(--k<N)break}o(e,T-1,M,S,h),o(u,k+1,E,C,h),T-2-e<=t?r(e,T-2,h):c(e,T-2,h),u-(k+2)<=t?r(k+2,u,h):c(k+2,u,h),k-T<=t?r(T,k,h):c(T,k,h)}},855:function(e,t,r){e.exports={init:function(e){var t=i.nextPow2(e);l.length<t&&(n.free(l),l=n.mallocInt32(t)),c.length<t&&(n.free(c),c=n.mallocInt32(t)),u.length<t&&(n.free(u),u=n.mallocInt32(t)),h.length<t&&(n.free(h),h=n.mallocInt32(t)),f.length<t&&(n.free(f),f=n.mallocInt32(t)),p.length<t&&(n.free(p),p=n.mallocInt32(t));var r=8*t;d.length<r&&(n.free(d),d=n.mallocDouble(r))},sweepBipartite:function(e,t,r,n,i,s,f,p,y,v){for(var x=0,_=2*e,b=e-1,w=_-1,T=r;T<n;++T){var k=s[T],A=_*T;d[x++]=i[A+b],d[x++]=-(k+1),d[x++]=i[A+w],d[x++]=k}for(T=f;T<p;++T){k=v[T]+o;var M=_*T;d[x++]=y[M+b],d[x++]=-k,d[x++]=y[M+w],d[x++]=k}var S=x>>>1;a(d,S);var E=0,C=0;for(T=0;T<S;++T){var I=0|d[2*T+1];if(I>=o)m(u,h,C--,I=I-o|0);else if(I>=0)m(l,c,E--,I);else if(I<=-o){I=-I-o|0;for(var L=0;L<E;++L)if(void 0!==(P=t(l[L],I)))return P;g(u,h,C++,I)}else{for(I=-I-1|0,L=0;L<C;++L){var P;if(void 0!==(P=t(I,u[L])))return P}g(l,c,E++,I)}}},sweepComplete:function(e,t,r,n,i,o,s,y,v,x){for(var _=0,b=2*e,w=e-1,T=b-1,k=r;k<n;++k){var A=o[k]+1<<1,M=b*k;d[_++]=i[M+w],d[_++]=-A,d[_++]=i[M+T],d[_++]=A}for(k=s;k<y;++k){A=x[k]+1<<1;var S=b*k;d[_++]=v[S+w],d[_++]=1|-A,d[_++]=v[S+T],d[_++]=1|A}var E=_>>>1;a(d,E);var C=0,I=0,L=0;for(k=0;k<E;++k){var P=0|d[2*k+1],z=1&P;if(k<E-1&&P>>1==d[2*k+3]>>1&&(z=2,k+=1),P<0){for(var D=-(P>>1)-1,O=0;O<L;++O)if(void 0!==(R=t(f[O],D)))return R;if(0!==z)for(O=0;O<C;++O)if(void 0!==(R=t(l[O],D)))return R;if(1!==z)for(O=0;O<I;++O){var R;if(void 0!==(R=t(u[O],D)))return R}0===z?g(l,c,C++,D):1===z?g(u,h,I++,D):2===z&&g(f,p,L++,D)}else D=(P>>1)-1,0===z?m(l,c,C--,D):1===z?m(u,h,I--,D):2===z&&m(f,p,L--,D)}},scanBipartite:function(e,t,r,n,i,s,u,h,f,p,y,v){var x=0,_=2*e,b=t,w=t+e,T=1,k=1;n?k=o:T=o;for(var A=i;A<s;++A){var M=A+T,S=_*A;d[x++]=u[S+b],d[x++]=-M,d[x++]=u[S+w],d[x++]=M}for(A=f;A<p;++A){M=A+k;var E=_*A;d[x++]=y[E+b],d[x++]=-M}var C=x>>>1;a(d,C);var I=0;for(A=0;A<C;++A){var L=0|d[2*A+1];if(L<0){var P=!1;if((M=-L)>=o?(P=!n,M-=o):(P=!!n,M-=1),P)g(l,c,I++,M);else{var z=v[M],D=_*M,O=y[D+t+1],R=y[D+t+1+e];e:for(var F=0;F<I;++F){var B=l[F],j=_*B;if(!(R<u[j+t+1]||u[j+t+1+e]<O)){for(var N=t+2;N<e;++N)if(y[D+N+e]<u[j+N]||u[j+N+e]<y[D+N])continue e;var U,V=h[B];if(void 0!==(U=n?r(z,V):r(V,z)))return U}}}}else m(l,c,I--,L-T)}},scanComplete:function(e,t,r,n,i,s,c,u,h,f,p){for(var m=0,g=2*e,y=t,v=t+e,x=n;x<i;++x){var _=x+o,b=g*x;d[m++]=s[b+y],d[m++]=-_,d[m++]=s[b+v],d[m++]=_}for(x=u;x<h;++x){_=x+1;var w=g*x;d[m++]=f[w+y],d[m++]=-_}var T=m>>>1;a(d,T);var k=0;for(x=0;x<T;++x){var A=0|d[2*x+1];if(A<0)if((_=-A)>=o)l[k++]=_-o;else{var M=p[_-=1],S=g*_,E=f[S+t+1],C=f[S+t+1+e];e:for(var I=0;I<k;++I){var L=l[I],P=c[L];if(P===M)break;var z=g*L;if(!(C<s[z+t+1]||s[z+t+1+e]<E)){for(var D=t+2;D<e;++D)if(f[S+D+e]<s[z+D]||s[z+D+e]<f[S+D])continue e;var O=r(P,M);if(void 0!==O)return O}}}else{for(_=A-o,I=k-1;I>=0;--I)if(l[I]===_){for(D=I+1;D<k;++D)l[D-1]=l[D];break}--k}}}};var n=r(1888),i=r(8828),a=r(4192),o=1<<28,s=1024,l=n.mallocInt32(s),c=n.mallocInt32(s),u=n.mallocInt32(s),h=n.mallocInt32(s),f=n.mallocInt32(s),p=n.mallocInt32(s),d=n.mallocDouble(8*s);function m(e,t,r,n){var i=t[n],a=e[r-1];e[i]=a,t[a]=i}function g(e,t,r,n){e[r]=n,t[n]=r}},2538:function(e,t,r){var n=r(8902),i=r(5542),a=r(2272),o=r(5023);function s(e){return[Math.min(e[0],e[1]),Math.max(e[0],e[1])]}function l(e,t){return e[0]-t[0]||e[1]-t[1]}function c(e,t,r){return t in e?e[t]:r}e.exports=function(e,t,r){Array.isArray(t)?(r=r||{},t=t||[]):(r=t||{},t=[]);var u=!!c(r,"delaunay",!0),h=!!c(r,"interior",!0),f=!!c(r,"exterior",!0),p=!!c(r,"infinity",!1);if(!h&&!f||0===e.length)return[];var d=n(e,t);if(u||h!==f||p){for(var m=i(e.length,function(e){return e.map(s).sort(l)}(t)),g=0;g<d.length;++g){var y=d[g];m.addTriangle(y[0],y[1],y[2])}return u&&a(e,m),f?h?p?o(m,0,p):m.cells():o(m,1,p):o(m,-1)}return d}},2272:function(e,t,r){var n=r(2646)[4];function i(e,t,r,i,a,o){var s=t.opposite(i,a);if(!(s<0)){if(a<i){var l=i;i=a,a=l,l=o,o=s,s=l}t.isConstraint(i,a)||n(e[i],e[a],e[o],e[s])<0&&r.push(i,a)}}r(2478),e.exports=function(e,t){for(var r=[],a=e.length,o=t.stars,s=0;s<a;++s)for(var l=o[s],c=1;c<l.length;c+=2)if(!((p=l[c])<s||t.isConstraint(s,p))){for(var u=l[c-1],h=-1,f=1;f<l.length;f+=2)if(l[f-1]===p){h=l[f];break}h<0||n(e[s],e[p],e[u],e[h])<0&&r.push(s,p)}for(;r.length>0;){for(var p=r.pop(),d=(u=-1,h=-1,l=o[s=r.pop()],1);d<l.length;d+=2){var m=l[d-1],g=l[d];m===p?h=g:g===p&&(u=m)}u<0||h<0||n(e[s],e[p],e[u],e[h])>=0||(t.flip(s,p),i(e,t,r,u,s,h),i(e,t,r,s,h,u),i(e,t,r,h,p,u),i(e,t,r,p,u,h))}}},5023:function(e,t,r){var n,i=r(2478);function a(e,t,r,n,i,a,o){this.cells=e,this.neighbor=t,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function o(e,t){return e[0]-t[0]||e[1]-t[1]||e[2]-t[2]}e.exports=function(e,t,r){var n=function(e,t){for(var r=e.cells(),n=r.length,i=0;i<n;++i){var s=(y=r[i])[0],l=y[1],c=y[2];l<c?l<s&&(y[0]=l,y[1]=c,y[2]=s):c<s&&(y[0]=c,y[1]=s,y[2]=l)}r.sort(o);var u=new Array(n);for(i=0;i<u.length;++i)u[i]=0;var h=[],f=[],p=new Array(3*n),d=new Array(3*n),m=null;t&&(m=[]);var g=new a(r,p,d,u,h,f,m);for(i=0;i<n;++i)for(var y=r[i],v=0;v<3;++v){s=y[v],l=y[(v+1)%3];var x=p[3*i+v]=g.locate(l,s,e.opposite(l,s)),_=d[3*i+v]=e.isConstraint(s,l);x<0&&(_?f.push(i):(h.push(i),u[i]=1),t&&m.push([l,s,-1]))}return g}(e,r);if(0===t)return r?n.cells.concat(n.boundary):n.cells;for(var i=1,s=n.active,l=n.next,c=n.flags,u=n.cells,h=n.constraint,f=n.neighbor;s.length>0||l.length>0;){for(;s.length>0;){var p=s.pop();if(c[p]!==-i){c[p]=i,u[p];for(var d=0;d<3;++d){var m=f[3*p+d];m>=0&&0===c[m]&&(h[3*p+d]?l.push(m):(s.push(m),c[m]=i))}}}var g=l;l=s,s=g,l.length=0,i=-i}var y=function(e,t,r){for(var n=0,i=0;i<e.length;++i)t[i]===r&&(e[n++]=e[i]);return e.length=n,e}(u,c,t);return r?y.concat(n.boundary):y},a.prototype.locate=(n=[0,0,0],function(e,t,r){var a=e,s=t,l=r;return t<r?t<e&&(a=t,s=r,l=e):r<e&&(a=r,s=e,l=t),a<0?-1:(n[0]=a,n[1]=s,n[2]=l,i.eq(this.cells,n,o))})},8902:function(e,t,r){var n=r(2478),i=r(3250)[3];function a(e,t,r,n,i){this.a=e,this.b=t,this.idx=r,this.lowerIds=n,this.upperIds=i}function o(e,t,r,n){this.a=e,this.b=t,this.type=r,this.idx=n}function s(e,t){var r=e.a[0]-t.a[0]||e.a[1]-t.a[1]||e.type-t.type;return r||0!==e.type&&(r=i(e.a,e.b,t.b))?r:e.idx-t.idx}function l(e,t){return i(e.a,e.b,t)}function c(e,t,r,a,o){for(var s=n.lt(t,a,l),c=n.gt(t,a,l),u=s;u<c;++u){for(var h=t[u],f=h.lowerIds,p=f.length;p>1&&i(r[f[p-2]],r[f[p-1]],a)>0;)e.push([f[p-1],f[p-2],o]),p-=1;f.length=p,f.push(o);var d=h.upperIds;for(p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)<0;)e.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function u(e,t){return(e.a[0]<t.a[0]?i(e.a,e.b,t.a):i(t.b,t.a,e.a))||(t.b[0]<e.b[0]?i(e.a,e.b,t.b):i(t.b,t.a,e.b))||e.idx-t.idx}function h(e,t,r){var i=n.le(e,r,u),o=e[i],s=o.upperIds,l=s[s.length-1];o.upperIds=[l],e.splice(i+1,0,new a(r.a,r.b,r.idx,[l],s))}function f(e,t,r){var i=r.a;r.a=r.b,r.b=i;var a=n.eq(e,r,u),o=e[a];e[a-1].upperIds=o.upperIds,e.splice(a,1)}e.exports=function(e,t){for(var r=e.length,n=t.length,i=[],l=0;l<r;++l)i.push(new o(e[l],null,0,l));for(l=0;l<n;++l){var u=t[l],p=e[u[0]],d=e[u[1]];p[0]<d[0]?i.push(new o(p,d,2,l),new o(d,p,1,l)):p[0]>d[0]&&i.push(new o(d,p,2,l),new o(p,d,1,l))}i.sort(s);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([m,1],[m,0],-1,[],[],[],[])],y=[],v=(l=0,i.length);l<v;++l){var x=i[l],_=x.type;0===_?c(y,g,e,x.a,x.idx):2===_?h(g,0,x):f(g,0,x)}return y}},5542:function(e,t,r){var n=r(2478);function i(e,t){this.stars=e,this.edges=t}e.exports=function(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=[];return new i(r,t)};var a=i.prototype;function o(e,t,r){for(var n=1,i=e.length;n<i;n+=2)if(e[n-1]===t&&e[n]===r)return e[n-1]=e[i-2],e[n]=e[i-1],void(e.length=i-2)}a.isConstraint=function(){var e=[0,0];function t(e,t){return e[0]-t[0]||e[1]-t[1]}return function(r,i){return e[0]=Math.min(r,i),e[1]=Math.max(r,i),n.eq(this.edges,e,t)>=0}}(),a.removeTriangle=function(e,t,r){var n=this.stars;o(n[e],t,r),o(n[t],r,e),o(n[r],e,t)},a.addTriangle=function(e,t,r){var n=this.stars;n[e].push(t,r),n[t].push(r,e),n[r].push(e,t)},a.opposite=function(e,t){for(var r=this.stars[t],n=1,i=r.length;n<i;n+=2)if(r[n]===e)return r[n-1];return-1},a.flip=function(e,t){var r=this.opposite(e,t),n=this.opposite(t,e);this.removeTriangle(e,t,r),this.removeTriangle(t,e,n),this.addTriangle(e,n,r),this.addTriangle(t,r,n)},a.edges=function(){for(var e=this.stars,t=[],r=0,n=e.length;r<n;++r)for(var i=e[r],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=[],r=0,n=e.length;r<n;++r)for(var i=e[r],a=0,o=i.length;a<o;a+=2){var s=i[a],l=i[a+1];r<Math.min(s,l)&&t.push([r,s,l])}return t}},2419:function(e){e.exports=function(e){for(var t=1,r=1;r<e.length;++r)for(var n=0;n<r;++n)if(e[r]<e[n])t=-t;else if(e[n]===e[r])return 0;return t}},3628:function(e,t,r){var n=r(1338),i=r(727);function a(e,t){for(var r=0,n=e.length,i=0;i<n;++i)r+=e[i]*t[i];return r}function o(e){var t=e.length;if(0===t)return[];e[0].length;var r=n([e.length+1,e.length+1],1),o=n([e.length+1],1);r[t][t]=0;for(var s=0;s<t;++s){for(var l=0;l<=s;++l)r[l][s]=r[s][l]=2*a(e[s],e[l]);o[s]=a(e[s],e[s])}var c=i(r,o),u=0,h=c[t+1];for(s=0;s<h.length;++s)u+=h[s];var f=new Array(t);for(s=0;s<t;++s){h=c[s];var p=0;for(l=0;l<h.length;++l)p+=h[l];f[s]=p/u}return f}function s(e){if(0===e.length)return[];for(var t=e[0].length,r=n([t]),i=o(e),a=0;a<e.length;++a)for(var s=0;s<t;++s)r[s]+=e[a][s]*i[a];return r}s.barycenetric=o,e.exports=s},6037:function(e,t,r){e.exports=function(e){for(var t=n(e),r=0,i=0;i<e.length;++i)for(var a=e[i],o=0;o<t.length;++o)r+=Math.pow(a[o]-t[o],2);return Math.sqrt(r/e.length)};var n=r(3628)},332:function(e,t,r){e.exports=function(e,t,r){var n;if(r){n=t;for(var i=new Array(t.length),a=0;a<t.length;++a){var o=t[a];i[a]=[o[0],o[1],r[a]]}t=i}for(var s=function(e,t,r){var n=d(e,[],p(e));return y(t,n,r),!!n}(e,t,!!r);v(e,t,!!r);)s=!0;if(r&&s)for(n.length=0,r.length=0,a=0;a<t.length;++a)o=t[a],n.push([o[0],o[1]]),r.push(o[2]);return s};var n=r(1755),i=r(6867),a=r(1125),o=r(7842),s=r(1318),l=r(946),c=r(5838),u=r(1278),h=r(3637);function f(e){var t=l(e);return[u(t,-1/0),u(t,1/0)]}function p(e){for(var t=new Array(e.length),r=0;r<e.length;++r){var n=e[r];t[r]=[u(n[0],-1/0),u(n[1],-1/0),u(n[0],1/0),u(n[1],1/0)]}return t}function d(e,t,r){for(var a=t.length,o=new n(a),s=[],l=0;l<t.length;++l){var c=t[l],h=f(c[0]),p=f(c[1]);s.push([u(h[0],-1/0),u(p[0],-1/0),u(h[1],1/0),u(p[1],1/0)])}i(s,(function(e,t){o.link(e,t)}));var d=!0,m=new Array(a);for(l=0;l<a;++l)(y=o.find(l))!==l&&(d=!1,e[y]=[Math.min(e[l][0],e[y][0]),Math.min(e[l][1],e[y][1])]);if(d)return null;var g=0;for(l=0;l<a;++l){var y;(y=o.find(l))===l?(m[l]=g,e[g++]=e[l]):m[l]=-1}for(e.length=g,l=0;l<a;++l)m[l]<0&&(m[l]=m[o.find(l)]);return m}function m(e,t){return e[0]-t[0]||e[1]-t[1]}function g(e,t){return e[0]-t[0]||e[1]-t[1]||(e[2]<t[2]?-1:e[2]>t[2]?1:0)}function y(e,t,r){if(0!==e.length){if(t)for(var n=0;n<e.length;++n){var i=t[(o=e[n])[0]],a=t[o[1]];o[0]=Math.min(i,a),o[1]=Math.max(i,a)}else for(n=0;n<e.length;++n){var o;i=(o=e[n])[0],a=o[1],o[0]=Math.min(i,a),o[1]=Math.max(i,a)}r?e.sort(g):e.sort(m);var s=1;for(n=1;n<e.length;++n){var l=e[n-1],c=e[n];c[0]===l[0]&&c[1]===l[1]&&(!r||c[2]===l[2])||(e[s++]=c)}e.length=s}}function v(e,t,r){var n=function(e,t){for(var r=new Array(t.length),n=0;n<t.length;++n){var i=t[n],a=e[i[0]],o=e[i[1]];r[n]=[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 r}(e,t),f=function(e,t,r){var n=[];return i(r,(function(r,i){var o=t[r],s=t[i];if(o[0]!==s[0]&&o[0]!==s[1]&&o[1]!==s[0]&&o[1]!==s[1]){var l=e[o[0]],c=e[o[1]],u=e[s[0]],h=e[s[1]];a(l,c,u,h)&&n.push([r,i])}})),n}(e,t,n),m=function(e,t,r,n){var o=[];return i(r,n,(function(r,n){var i=t[r];if(i[0]!==n&&i[1]!==n){var s=e[n],l=e[i[0]],c=e[i[1]];a(l,c,s,s)&&o.push([r,n])}})),o}(e,t,n,p(e)),g=function(e,t,r,n,i){var a,u,f=e.map((function(e){return[o(e[0]),o(e[1])]}));for(a=0;a<r.length;++a){var p=r[a];u=p[0];var d=p[1],m=t[u],g=t[d],y=h(c(e[m[0]]),c(e[m[1]]),c(e[g[0]]),c(e[g[1]]));if(y){var v=e.length;e.push([l(y[0]),l(y[1])]),f.push(y),n.push([u,v],[d,v])}}for(n.sort((function(e,t){if(e[0]!==t[0])return e[0]-t[0];var r=f[e[1]],n=f[t[1]];return s(r[0],n[0])||s(r[1],n[1])})),a=n.length-1;a>=0;--a){var x=t[u=(S=n[a])[0]],_=x[0],b=x[1],w=e[_],T=e[b];if((w[0]-T[0]||w[1]-T[1])<0){var k=_;_=b,b=k}x[0]=_;var A,M=x[1]=S[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===u;){var S,E=(S=n[--a])[1];i?t.push([M,E,A]):t.push([M,E]),M=E}i?t.push([M,b,A]):t.push([M,b])}return f}(e,t,f,m,r),v=d(e,g);return y(t,v,r),!!v||f.length>0||m.length>0}},3637:function(e,t,r){e.exports=function(e,t,r,n){var a=s(t,e),h=s(n,r),f=u(a,h);if(0===o(f))return null;var p=u(h,s(e,r)),d=i(p,f),m=c(a,d);return l(e,m)};var n=r(6504),i=r(8697),a=r(5572),o=r(7721),s=r(544),l=r(2653),c=r(8987);function u(e,t){return a(n(e[0],t[1]),n(e[1],t[0]))}},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,r){var n=r(3642),i=r(395);function a(e){return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function o(e){for(var t,r="#",n=0;n<3;++n)r+=("00"+(t=(t=e[n]).toString(16))).substr(t.length);return r}function s(e){return"rgba("+e.join(",")+")"}e.exports=function(e){var t,r,l,c,u,h,f,p,d,m;if(e||(e={}),p=(e.nshades||72)-1,f=e.format||"hex",(h=e.colormap)||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!n[h])throw Error(h+" not a supported colorscale");u=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);u=h.slice()}if(u.length>p+1)throw new Error(h+" map requires nshades to be at least size "+u.length);d=Array.isArray(e.alpha)?2!==e.alpha.length?[1,1]:e.alpha.slice():"number"==typeof e.alpha?[e.alpha,e.alpha]:[1,1],t=u.map((function(e){return Math.round(e.index*p)})),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var g=u.map((function(e,t){var r=u[t].index,n=u[t].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n})),y=[];for(m=0;m<t.length-1;++m){c=t[m+1]-t[m],r=g[m],l=g[m+1];for(var v=0;v<c;v++){var x=v/c;y.push([Math.round(i(r[0],l[0],x)),Math.round(i(r[1],l[1],x)),Math.round(i(r[2],l[2],x)),i(r[3],l[3],x)])}}return y.push(u[u.length-1].rgb.concat(d[1])),"hex"===f?y=y.map(o):"rgbaString"===f?y=y.map(s):"float"===f&&(y=y.map(a)),y}},3140:function(e,t,r){e.exports=function(e,t,r,a){var o=n(t,r,a);if(0===o){var s=i(n(e,t,r)),c=i(n(e,t,a));if(s===c){if(0===s){var u=l(e,t,r);return u===l(e,t,a)?0:u?1:-1}return 0}return 0===c?s>0||l(e,t,a)?-1:1:0===s?c>0||l(e,t,r)?1:-1:i(c-s)}var h=n(e,t,r);return h>0?o>0&&n(e,t,a)>0?1:-1:h<0?o>0||n(e,t,a)>0?1:-1:n(e,t,a)>0||l(e,t,r)?1:-1};var n=r(3250),i=r(8572),a=r(9362),o=r(5382),s=r(8210);function l(e,t,r){var n=a(e[0],-t[0]),i=a(e[1],-t[1]),l=a(r[0],-t[0]),c=a(r[1],-t[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},8572:function(e){e.exports=function(e){return e<0?-1:e>0?1:0}},8507:function(e){e.exports=function(e,n){var i=e.length,a=e.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return e[0]-n[0];case 2:return e[0]+e[1]-n[0]-n[1]||t(e[0],e[1])-t(n[0],n[1]);case 3:var o=e[0]+e[1],s=n[0]+n[1];if(a=o+e[2]-(s+n[2]))return a;var l=t(e[0],e[1]),c=t(n[0],n[1]);return t(l,e[2])-t(c,n[2])||t(l+e[2],o)-t(c+n[2],s);case 4:var u=e[0],h=e[1],f=e[2],p=e[3],d=n[0],m=n[1],g=n[2],y=n[3];return u+h+f+p-(d+m+g+y)||t(u,h,f,p)-t(d,m,g,y,d)||t(u+h,u+f,u+p,h+f,h+p,f+p)-t(d+m,d+g,d+y,m+g,m+y,g+y)||t(u+h+f,u+h+p,u+f+p,h+f+p)-t(d+m+g,d+m+y,d+g+y,m+g+y);default:for(var v=e.slice().sort(r),x=n.slice().sort(r),_=0;_<i;++_)if(a=v[_]-x[_])return a;return 0}};var t=Math.min;function r(e,t){return e-t}},3788:function(e,t,r){var n=r(8507),i=r(2419);e.exports=function(e,t){return n(e,t)||i(e)-i(t)}},7352:function(e,t,r){var n=r(5721),i=r(4750),a=r(2690);e.exports=function(e){var t=e.length;if(0===t)return[];if(1===t)return[[0]];var r=e[0].length;return 0===r?[]:1===r?n(e):2===r?i(e):a(e,r)}},5721:function(e){e.exports=function(e){for(var t=0,r=0,n=1;n<e.length;++n)e[n][0]<e[t][0]&&(t=n),e[n][0]>e[r][0]&&(r=n);return t<r?[[t],[r]]:t>r?[[r],[t]]:[[t]]}},4750:function(e,t,r){e.exports=function(e){var t=n(e),r=t.length;if(r<=2)return[];for(var i=new Array(r),a=t[r-1],o=0;o<r;++o){var s=t[o];i[o]=[a,s],a=s}return i};var n=r(3090)},2690:function(e,t,r){e.exports=function(e,t){try{return n(e,!0)}catch{var r=i(e);if(r.length<=t)return[];var a=function(e,t){for(var r=e.length,n=new Array(r),i=0;i<t.length;++i)n[i]=e[t[i]];var a=t.length;for(i=0;i<r;++i)t.indexOf(i)<0&&(n[a++]=e[i]);return n}(e,r);return function(e,t){for(var r=e.length,n=t.length,i=0;i<r;++i)for(var a=e[i],o=0;o<a.length;++o){var s=a[o];if(s<n)a[o]=t[s];else{s-=n;for(var l=0;l<n;++l)s>=t[l]&&(s+=1);a[o]=s}}return e}(n(a,!0),r)}};var n=r(8954),i=r(3952)},4769:function(e){e.exports=function(e,t,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,h=s*(3-2*i),f=s*o;if(e.length){a||(a=new Array(e.length));for(var p=e.length-1;p>=0;--p)a[p]=c*e[p]+u*t[p]+h*r[p]+f*n[p];return a}return c*e+u*t+h*r+f*n},e.exports.derivative=function(e,t,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(e.length){a||(a=new Array(e.length));for(var u=e.length-1;u>=0;--u)a[u]=o*e[u]+s*t[u]+l*r[u]+c*n[u];return a}return o*e+s*t+l*r[u]+c*n}},7642:function(e,t,r){var n=r(8954),i=r(1682);function a(e,t){this.point=e,this.index=t}function o(e,t){for(var r=e.point,n=t.point,i=r.length,a=0;a<i;++a){var o=n[a]-r[a];if(o)return o}return 0}e.exports=function(e,t){var r=e.length;if(0===r)return[];var s=e[0].length;if(s<1)return[];if(1===s)return function(e,t,r){if(1===e)return r?[[-1,0]]:[];var n=t.map((function(e,t){return[e[0],t]}));n.sort((function(e,t){return e[0]-t[0]}));for(var i=new Array(e-1),a=1;a<e;++a){var o=n[a-1],s=n[a];i[a-1]=[o[1],s[1]]}return r&&i.push([-1,i[0][1]],[i[e-1][1],-1]),i}(r,e,t);for(var l=new Array(r),c=1,u=0;u<r;++u){for(var h=e[u],f=new Array(s+1),p=0,d=0;d<s;++d){var m=h[d];f[d]=m,p+=m*m}f[s]=p,l[u]=new a(f,u),c=Math.max(p,c)}i(l,o),r=l.length;var g=new Array(r+s+1),y=new Array(r+s+1),v=(s+1)*(s+1)*c,x=new Array(s+1);for(u=0;u<=s;++u)x[u]=0;for(x[s]=v,g[0]=x.slice(),y[0]=-1,u=0;u<=s;++u)(f=x.slice())[u]=1,g[u+1]=f,y[u+1]=-1;for(u=0;u<r;++u){var _=l[u];g[u+s+1]=_.point,y[u+s+1]=_.index}var b=n(g,!1);if(b=t?b.filter((function(e){for(var t=0,r=0;r<=s;++r){var n=y[e[r]];if(n<0&&++t>=2)return!1;e[r]=n}return!0})):b.filter((function(e){for(var t=0;t<=s;++t){var r=y[e[t]];if(r<0)return!1;e[t]=r}return!0})),1&s)for(u=0;u<b.length;++u)f=(_=b[u])[0],_[0]=_[1],_[1]=f;return b}},2361:function(e){var t=!1;if(typeof Float64Array<"u"){var r=new Float64Array(1),n=new Uint32Array(r.buffer);if(r[0]=1,t=!0,1072693248===n[1]){let t=function(e,t){return n[0]=e,n[1]=t,r[0]},i=function(e){return r[0]=e,n[0]},a=function(e){return r[0]=e,n[1]};e.exports=function(e){return r[0]=e,[n[0],n[1]]},e.exports.pack=t,e.exports.lo=i,e.exports.hi=a}else if(1072693248===n[0]){let t=function(e,t){return n[1]=e,n[0]=t,r[0]},i=function(e){return r[0]=e,n[1]},a=function(e){return r[0]=e,n[0]};e.exports=function(e){return r[0]=e,[n[1],n[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)},r=function(e){return i.writeDoubleLE(e,0,!0),i.readUInt32LE(0,!0)},n=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=r,e.exports.hi=n}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 r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1048576),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}},1338:function(e){function t(e,r,n){var i=0|e[n];if(i<=0)return[];var a,o=new Array(i);if(n===e.length-1)for(a=0;a<i;++a)o[a]=r;else for(a=0;a<i;++a)o[a]=t(e,r,n+1);return o}e.exports=function(e,r){switch(typeof r>"u"&&(r=0),typeof e){case"number":if(e>0)return function(e,t){var r,n;for(r=new Array(e),n=0;n<e;++n)r[n]=t;return r}(0|e,r);break;case"object":if("number"==typeof e.length)return t(e,r,0)}return[]}},3134:function(e,t,r){e.exports=function(e,t){var r=e.length;if("number"!=typeof t){t=0;for(var i=0;i<r;++i){var a=e[i];t=Math.max(t,a[0],a[1])}t=1+(0|t)}t|=0;var o=new Array(t);for(i=0;i<t;++i)o[i]=[];for(i=0;i<r;++i)o[(a=e[i])[0]].push(a[1]),o[a[1]].push(a[0]);for(var s=0;s<t;++s)n(o[s],(function(e,t){return e-t}));return o};var n=r(1682)},5033:function(e){e.exports=function(e,t,r){var n=t||0,i=r||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]],[n*e[12]+e[8],n*e[13]+e[9],n*e[14]+e[10],n*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,r){e.exports=function(e,t,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:return"number"==typeof e?new o(n=l(e),n,0):new o(e,l(e.length),0);case 2:var n;if("number"==typeof t)return new o(e,n=l(e.length),+t);r=0;case 3:if(e.length!==t.length)throw new Error("state and velocity lengths must match");return new o(e,t,r)}};var n=r(4769),i=r(2478);function a(e,t,r){return Math.min(t,Math.max(e,r))}function o(e,t,r){this.dimension=e.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n<this.dimension;++n)this.bounds[0][n]=-1/0,this.bounds[1][n]=1/0;this._state=e.slice().reverse(),this._velocity=t.slice().reverse(),this._time=[r],this._scratch=[e.slice(),e.slice(),e.slice(),e.slice(),e.slice()]}var s=o.prototype;function l(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=0;return t}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,r=t.length,o=i.le(t,e),s=this._scratch[0],l=this._state,c=this._velocity,u=this.dimension,h=this.bounds;if(o<0)for(var f=u-1,p=0;p<u;++p,--f)s[p]=l[f];else if(o>=r-1){f=l.length-1;var d=e-t[r-1];for(p=0;p<u;++p,--f)s[p]=l[f]+d*c[f]}else{f=u*(o+1)-1;var m=t[o],g=t[o+1]-m||1,y=this._scratch[1],v=this._scratch[2],x=this._scratch[3],_=this._scratch[4],b=!0;for(p=0;p<u;++p,--f)y[p]=l[f],x[p]=c[f]*g,v[p]=l[f+u],_[p]=c[f+u]*g,b=b&&y[p]===v[p]&&x[p]===_[p]&&0===x[p];if(b)for(p=0;p<u;++p)s[p]=y[p];else n(y,x,v,_,(e-m)/g,s)}var w=h[0],T=h[1];for(p=0;p<u;++p)s[p]=a(w[p],T[p],s[p]);return s},s.dcurve=function(e){var t=this._time,r=t.length,a=i.le(t,e),o=this._scratch[0],s=this._state,l=this._velocity,c=this.dimension;if(a>=r-1)for(var u=s.length-1,h=(t[r-1],0);h<c;++h,--u)o[h]=l[u];else{u=c*(a+1)-1;var f=t[a],p=t[a+1]-f||1,d=this._scratch[1],m=this._scratch[2],g=this._scratch[3],y=this._scratch[4],v=!0;for(h=0;h<c;++h,--u)d[h]=s[u],g[h]=l[u]*p,m[h]=s[u+c],y[h]=l[u+c]*p,v=v&&d[h]===m[h]&&g[h]===y[h]&&0===g[h];if(v)for(h=0;h<c;++h)o[h]=0;else for(n.derivative(d,g,m,y,(e-f)/p,o),h=0;h<c;++h)o[h]/=p}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,r=this.dimension-1;r>=0;--r)if(e[--t])return!1;return!0},s.jump=function(e){var t=this.lastT(),r=this.dimension;if(!(e<t||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1];this._time.push(t,e);for(var u=0;u<2;++u)for(var h=0;h<r;++h)n.push(n[o++]),i.push(0);for(this._time.push(e),h=r;h>0;--h)n.push(a(l[h-1],c[h-1],arguments[h])),i.push(0)}},s.push=function(e){var t=this.lastT(),r=this.dimension;if(!(e<t||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=e-t,l=this.bounds,c=l[0],u=l[1],h=s>1e-6?1/s:0;this._time.push(e);for(var f=r;f>0;--f){var p=a(c[f-1],u[f-1],arguments[f]);n.push(p),i.push((p-n[o++])*h)}}},s.set=function(e){var t=this.dimension;if(!(e<this.lastT()||arguments.length!==t+1)){var r=this._state,n=this._velocity,i=this.bounds,o=i[0],s=i[1];this._time.push(e);for(var l=t;l>0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(e){var t=this.lastT(),r=this.dimension;if(!(e<=t||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=e-t,h=u>1e-6?1/u:0;this._time.push(e);for(var f=r;f>0;--f){var p=arguments[f];n.push(a(l[f-1],c[f-1],n[o++]+p)),i.push(p*h)}}},s.idle=function(e){var t=this.lastT();if(!(e<t)){var r=this.dimension,n=this._state,i=this._velocity,o=n.length-r,s=this.bounds,l=s[0],c=s[1],u=e-t;this._time.push(e);for(var h=r-1;h>=0;--h)n.push(a(l[h],c[h],n[o]+u*i[o])),i.push(0),o+=1}}},3840:function(e){function t(e,t,r,n,i,a){this._color=e,this.key=t,this.value=r,this.left=n,this.right=i,this._count=a}function r(e){return new t(e._color,e.key,e.value,e.left,e.right,e._count)}function n(e,r){return new t(e,r.key,r.value,r.left,r.right,r._count)}function i(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function a(e,t){this._compare=e,this.root=t}e.exports=function(e){return new a(e||p,null)};var o=a.prototype;function s(e,t){var r;return t.left&&(r=s(e,t.left))?r:(r=e(t.key,t.value))||(t.right?s(e,t.right):void 0)}function l(e,t,r,n){if(t(e,n.key)<=0){var i;if(n.left&&(i=l(e,t,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(e,t,r,n.right)}function c(e,t,r,n,i){var a,o=r(e,i.key),s=r(t,i.key);return o<=0&&(i.left&&(a=c(e,t,r,n,i.left))||s>0&&(a=n(i.key,i.value)))?a:s>0&&i.right?c(e,t,r,n,i.right):void 0}function u(e,t){this.tree=e,this._stack=t}Object.defineProperty(o,"keys",{get:function(){var e=[];return this.forEach((function(t,r){e.push(t)})),e}}),Object.defineProperty(o,"values",{get:function(){var e=[];return this.forEach((function(t,r){e.push(r)})),e}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(e,r){for(var o=this._compare,s=this.root,l=[],c=[];s;){var u=o(e,s.key);l.push(s),c.push(u),s=u<=0?s.left:s.right}l.push(new t(0,e,r,null,null,1));for(var h=l.length-2;h>=0;--h)s=l[h],c[h]<=0?l[h]=new t(s._color,s.key,s.value,l[h+1],s.right,s._count+1):l[h]=new t(s._color,s.key,s.value,s.left,l[h+1],s._count+1);for(h=l.length-1;h>1;--h){var f=l[h-1];if(s=l[h],1===f._color||1===s._color)break;var p=l[h-2];if(p.left===f)if(f.left===s){if(!(d=p.right)||0!==d._color){p._color=0,p.left=f.right,f._color=1,f.right=p,l[h-2]=f,l[h-1]=s,i(p),i(f),h>=3&&((m=l[h-3]).left===p?m.left=f:m.right=f);break}f._color=1,p.right=n(1,d),p._color=0,h-=1}else{if(!(d=p.right)||0!==d._color){f.right=s.left,p._color=0,p.left=s.right,s._color=1,s.left=f,s.right=p,l[h-2]=s,l[h-1]=f,i(p),i(f),i(s),h>=3&&((m=l[h-3]).left===p?m.left=s:m.right=s);break}f._color=1,p.right=n(1,d),p._color=0,h-=1}else if(f.right===s){if(!(d=p.left)||0!==d._color){p._color=0,p.right=f.left,f._color=1,f.left=p,l[h-2]=f,l[h-1]=s,i(p),i(f),h>=3&&((m=l[h-3]).right===p?m.right=f:m.left=f);break}f._color=1,p.left=n(1,d),p._color=0,h-=1}else{var d;if(!(d=p.left)||0!==d._color){var m;f.left=s.right,p._color=0,p.right=s.left,s._color=1,s.right=f,s.left=p,l[h-2]=s,l[h-1]=f,i(p),i(f),i(s),h>=3&&((m=l[h-3]).right===p?m.right=s:m.left=s);break}f._color=1,p.left=n(1,d),p._color=0,h-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(e,t,r){if(this.root)switch(arguments.length){case 1:return s(e,this.root);case 2:return l(t,this._compare,e,this.root);case 3:return this._compare(t,r)>=0?void 0:c(t,r,this._compare,e,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.left;return new u(this,e)}}),Object.defineProperty(o,"end",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.right;return new u(this,e)}}),o.at=function(e){if(e<0)return new u(this,[]);for(var t=this.root,r=[];;){if(r.push(t),t.left){if(e<t.left._count){t=t.left;continue}e-=t.left._count}if(!e)return new u(this,r);if(e-=1,!t.right)break;if(e>=t.right._count)break;t=t.right}return new u(this,[])},o.ge=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.gt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.lt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.le=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.find=function(e){for(var t=this._compare,r=this.root,n=[];r;){var i=t(e,r.key);if(n.push(r),0===i)return new u(this,n);r=i<=0?r.left:r.right}return new u(this,[])},o.remove=function(e){var t=this.find(e);return t?t.remove():this},o.get=function(e){for(var t=this._compare,r=this.root;r;){var n=t(e,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=u.prototype;function f(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 p(e,t){return e<t?-1:e>t?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new u(this.tree,this._stack.slice())},h.remove=function(){var e=this._stack;if(0===e.length)return this.tree;var o=new Array(e.length),s=e[e.length-1];o[o.length-1]=new t(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=e.length-2;l>=0;--l)(s=e[l]).left===e[l+1]?o[l]=new t(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var c=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var u=o[c-1];for(o.push(new t(s._color,u.key,u.value,s.left,s.right,s._count)),o[c-1].key=s.key,o[c-1].value=s.value,l=o.length-2;l>=c;--l)s=o[l],o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);o[c-1].left=o[c]}if(0===(s=o[o.length-1])._color){var h=o[o.length-2];for(h.left===s?h.left=null:h.right===s&&(h.right=null),o.pop(),l=0;l<o.length;++l)o[l]._count--;return new a(this.tree._compare,o[0])}if(s.left||s.right){for(s.left?f(s,s.left):s.right&&f(s,s.right),s._color=1,l=0;l<o.length-1;++l)o[l]._count--;return new a(this.tree._compare,o[0])}if(1===o.length)return new a(this.tree._compare,null);for(l=0;l<o.length;++l)o[l]._count--;var p=o[o.length-2];return function(e){for(var t,a,o,s,l=e.length-1;l>=0;--l){if(t=e[l],0===l)return void(t._color=1);if((a=e[l-1]).left===t){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,t._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((c=e[l-2]).left===a?c.left=o:c.right=o),void(e[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((c=e[l-2]).left===a?c.left=s:c.right=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=e[l-2]).left===a?c.left=o:c.right=o),e[l-1]=o,e[l]=a,l+1<e.length?e[l+1]=t:e.push(t),l+=2}else{if((o=a.left).left&&0===o.left._color)return s=(o=a.left=r(o)).left=r(o.left),a.left=o.right,o.right=a,o.left=s,o._color=a._color,t._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((c=e[l-2]).right===a?c.right=o:c.left=o),void(e[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((c=e[l-2]).right===a?c.right=s:c.left=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var c;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=e[l-2]).right===a?c.right=o:c.left=o),e[l-1]=o,e[l]=a,l+1<e.length?e[l+1]=t:e.push(t),l+=2}}}(o),p.left===s?p.left=null:p.right=null,new a(this.tree._compare,o[0])},Object.defineProperty(h,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var e=0,t=this._stack;if(0===t.length){var r=this.tree.root;return r?r._count:0}t[t.length-1].left&&(e=t[t.length-1].left._count);for(var n=t.length-2;n>=0;--n)t[n+1]===t[n].right&&(++e,t[n].left&&(e+=t[n].left._count));return e},enumerable:!0}),h.next=function(){var e=this._stack;if(0!==e.length){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(h,"hasNext",{get:function(){var e=this._stack;if(0===e.length)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}}),h.update=function(e){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new t(i._color,i.key,e,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new t(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new t(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},h.prev=function(){var e=this._stack;if(0!==e.length){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(h,"hasPrev",{get:function(){var e=this._stack;if(0===e.length)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}})},3837:function(e,t,r){e.exports=function(e,t){var r=new p(e);return r.update(t),r};var n=r(4935),i=r(501),a=r(5304),o=r(6429),s=r(6444),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=ArrayBuffer,u=DataView;function h(e){return Array.isArray(e)||function(e){return c.isView(e)&&!(e instanceof u)}(e)}function f(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function p(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 d=p.prototype;function m(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}d.update=function(e){function t(t,r,n){if(n in e){var i,a=e[n],o=this[n];(t?h(a)&&h(a[0]):h(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}e=e||{};var r,a=t.bind(this,!1,Number),o=t.bind(this,!1,Boolean),l=t.bind(this,!1,String),c=t.bind(this,!0,(function(e){if(h(e)){if(3===e.length)return[+e[0],+e[1],+e[2],1];if(4===e.length)return[+e[0],+e[1],+e[2],+e[3]]}return[0,0,0,1]})),u=!1,f=!1;if("bounds"in e)for(var p=e.bounds,d=0;d<2;++d)for(var m=0;m<3;++m)p[d][m]!==this.bounds[d][m]&&(f=!0),this.bounds[d][m]=p[d][m];if("ticks"in e)for(r=e.ticks,u=!0,this.autoTicks=!1,d=0;d<3;++d)this.tickSpacing[d]=0;else a("tickSpacing")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&("ticks"in e||"tickSpacing"in e||(this.autoTicks=!0),f=!0,u=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(d=0;d<3;++d)r[d].sort((function(e,t){return e.x-t.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(u=!0),l("tickFontStyle")&&(u=!0),l("tickFontWeight")&&(u=!0),l("tickFontVariant")&&(u=!0),a("tickSize"),a("tickAngle"),a("tickPad"),c("tickColor");var g=l("labels");l("labelFont")&&(g=!0),l("labelFontStyle")&&(g=!0),l("labelFontWeight")&&(g=!0),l("labelFontVariant")&&(g=!0),o("labelEnable"),a("labelSize"),a("labelPad"),c("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),c("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),c("lineTickColor"),o("gridEnable"),a("gridWidth"),c("gridColor"),o("zeroEnable"),c("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),c("backgroundColor");var y=[{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,y,this.ticks,v):this._text=n(this.gl,this.bounds,this.labels,y,this.ticks,v),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var g=[new m,new m,new m];function y(e,t,r,n,i){for(var a=e.primalOffset,o=e.primalMinor,s=e.mirrorOffset,l=e.mirrorMinor,c=n[t],u=0;u<3;++u)if(t!==u){var h=a,f=s,p=o,d=l;c&1<<u&&(h=s,f=a,p=l,d=o),h[u]=r[0][u],f[u]=r[1][u],i[u]>0?(p[u]=-1,d[u]=0):(p[u]=0,d[u]=1)}}var v=[0,0,0],x={model:l,view:l,projection:l,_ortho:!1};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(e){};var _=[0,0,0],b=[0,0,0],w=[0,0,0];d.draw=function(e){e=e||x;for(var t=this.gl,r=e.model||l,n=e.view||l,i=e.projection||l,a=this.bounds,s=e._ortho||!1,c=o(r,n,i,a,s),u=c.cubeEdges,h=c.axis,p=n[12],d=n[13],m=n[14],T=n[15],k=(s?2:1)*this.pixelRatio*(i[3]*p+i[7]*d+i[11]*m+i[15]*T)/t.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=u[A],this.lastCubeProps.axis[A]=h[A];var M=g;for(A=0;A<3;++A)y(g[A],A,this.bounds,u,h);t=this.gl;var S,E,C,I,L,P,z,D,O,R,F,B,j=v;for(A=0;A<3;++A)this.backgroundEnable[A]?j[A]=h[A]:j[A]=0;for(this._background.draw(r,n,i,a,j,this.backgroundColor),this._lines.bind(r,n,i,this),A=0;A<3;++A){var N=[0,0,0];h[A]>0?N[A]=a[1][A]:N[A]=a[0][A];for(var U=0;U<2;++U){var V=(A+1+U)%3,q=(A+1+(1^U))%3;this.gridEnable[V]&&this._lines.drawGrid(V,q,this.bounds,N,this.gridColor[V],this.gridWidth[V]*this.pixelRatio)}for(U=0;U<2;++U)V=(A+1+U)%3,q=(A+1+(1^U))%3,this.zeroEnable[q]&&Math.min(a[0][q],a[1][q])<=0&&Math.max(a[0][q],a[1][q])>=0&&this._lines.drawZero(V,q,this.bounds,N,this.zeroLineColor[q],this.zeroLineWidth[q]*this.pixelRatio)}for(A=0;A<3;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);var H=f(_,M[A].primalMinor),G=f(b,M[A].mirrorMinor),W=this.lineTickLength;for(U=0;U<3;++U){var Z=k/r[5*U];H[U]*=W[U]*Z,G[U]*=W[U]*Z}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,M[A].primalOffset,H,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,M[A].mirrorOffset,G,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}function Y(e){(C=[0,0,0])[e]=1}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),A=0;A<3;++A){var X=M[A].primalMinor,$=M[A].mirrorMinor,K=f(w,M[A].primalOffset);for(U=0;U<3;++U)this.lineTickEnable[A]&&(K[U]+=k*X[U]*Math.max(this.lineTickLength[U],0)/r[5*U]);var J=[0,0,0];if(J[A]=1,this.tickEnable[A]){for(-3600===this.tickAngle[A]?(this.tickAngle[A]=0,this.tickAlign[A]="auto"):this.tickAlign[A]=-1,E=1,"auto"===(S=[this.tickAlign[A],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),C=[0,0,0],P=$,void 0,void 0,void 0,void 0,void 0,void 0,D=((I=A)+2)%3,O=(L=X)[z=(I+1)%3],R=L[D],F=P[z],B=P[D],O>0&&B>0||O>0&&B<0||O<0&&B>0||O<0&&B<0?Y(z):(R>0&&F>0||R>0&&F<0||R<0&&F>0||R<0&&F<0)&&Y(D),U=0;U<3;++U)K[U]+=k*X[U]*this.tickPad[U]/r[5*U];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],K,this.tickColor[A],J,C,S)}if(this.labelEnable[A]){for(E=0,C=[0,0,0],this.labels[A].length>4&&(Y(A),E=1),"auto"===(S=[this.labelAlign[A],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),U=0;U<3;++U)K[U]+=k*X[U]*this.labelPad[U]/r[5*U];K[A]+=.5*(a[0][A]+a[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],K,this.labelColor[A],[0,0,0],C,S)}}this._text.unbind()},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304:function(e,t,r){e.exports=function(e){for(var t=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,h=[0,0,0],f=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=p,f[l]=p;for(var d=-1;d<=1;d+=2){h[c]=d;for(var m=-1;m<=1;m+=2)h[u]=m,t.push(h[0],h[1],h[2],f[0],f[1],f[2]),s+=1}var g=c;c=u,u=g}var y=n(e,new Float32Array(t)),v=n(e,new Uint16Array(r),e.ELEMENT_ARRAY_BUFFER),x=i(e,[{buffer:y,type:e.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:e.FLOAT,size:3,offset:12,stride:24}],v),_=a(e);return _.attributes.position.location=0,_.attributes.normal.location=1,new o(e,y,x,_)};var n=r(2762),i=r(8116),a=r(1879).bg;function o(e,t,r,n){this.gl=e,this.buffer=t,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(e,t,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:e,view:t,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(e,t,r){e.exports=function(e,t,r,a,p){i(s,t,e),i(s,r,s);for(var v=0,x=0;x<2;++x){u[2]=a[x][2];for(var _=0;_<2;++_){u[1]=a[_][1];for(var b=0;b<2;++b)u[0]=a[b][0],f(l[v],u,s),v+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],k=0;k<3;++k)c[x][k]=l[x][k]/T;p&&(c[x][2]*=-1),T<0&&(w<0||c[x][2]<c[w][2])&&(w=x)}if(w<0){w=0;for(var A=0;A<3;++A){for(var M=(A+2)%3,S=(A+1)%3,E=-1,C=-1,I=0;I<2;++I){var L=(z=I<<A)+(I<<M)+(1-I<<S),P=z+(1-I<<M)+(I<<S);o(c[z],c[L],c[P],h)<0||(I?E=1:C=1)}if(E<0||C<0)C>E&&(w|=1<<A);else{for(I=0;I<2;++I){L=(z=I<<A)+(I<<M)+(1-I<<S),P=z+(1-I<<M)+(I<<S);var z,D=d([l[z],l[L],l[P],l[z+(1<<M)+(1<<S)]]);I?E=D:C=D}C>E&&(w|=1<<A)}}}var O=7^w,R=-1;for(x=0;x<8;++x)x===w||x===O||(R<0||c[R][1]>c[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x)(j=R^1<<x)!==w&&j!==O&&(F<0&&(F=j),(S=c[j])[0]<c[F][0]&&(F=j));var B=-1;for(x=0;x<3;++x){var j;(j=R^1<<x)!==w&&j!==O&&j!==F&&(B<0&&(B=j),(S=c[j])[0]>c[B][0]&&(B=j))}var N=m;N[0]=N[1]=N[2]=0,N[n.log2(F^R)]=R&F,N[n.log2(R^B)]=R&B;var U=7^B;U===w||U===O?(U=7^F,N[n.log2(B^U)]=U&B):N[n.log2(F^U)]=U&F;var V=g,q=w;for(A=0;A<3;++A)V[A]=q&1<<A?-1:1;return y};var n=r(8828),i=r(6760),a=r(5202),o=r(3250),s=new Array(16),l=new Array(8),c=new Array(8),u=new Array(3),h=[0,0,0];function f(e,t,r){for(var n=0;n<4;++n){e[n]=r[12+n];for(var i=0;i<3;++i)e[n]+=t[i]*r[4*i+n]}}!function(){for(var e=0;e<8;++e)l[e]=[1,1,1,1],c[e]=[1,1,1]}();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 d(e){for(var t=0;t<p.length;++t)if((e=a.positive(e,p[t])).length<3)return 0;var r=e[0],n=r[0]/r[3],i=r[1]/r[3],o=0;for(t=1;t+1<e.length;++t){var s=e[t],l=e[t+1],c=s[0]/s[3]-n,u=s[1]/s[3]-i,h=l[0]/l[3]-n,f=l[1]/l[3]-i;o+=Math.abs(c*f-u*h)}return o}var m=[1,1,1],g=[0,0,0],y={cubeEdges:m,axis:g}},501:function(e,t,r){e.exports=function(e,t,r){var o=[],s=[0,0,0],l=[0,0,0],c=[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 h=0;h<3;++h){for(var f=o.length/3|0,d=0;d<r[h].length;++d){var m=+r[h][d].x;o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var g=o.length/3|0;s[h]=f,l[h]=g-f,f=o.length/3|0;for(var y=0;y<r[h].length;++y)m=+r[h][y].x,o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1);g=o.length/3|0,c[h]=f,u[h]=g-f}var v=n(e,new Float32Array(o)),x=i(e,[{buffer:v,type:e.FLOAT,size:3,stride:0,offset:0}]),_=a(e);return _.attributes.position.location=0,new p(e,v,x,_,l,s,u,c)};var n=r(2762),i=r(8116),a=r(1879).n,o=[0,0,0],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[1,1];function h(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,r,n,i,a,o,s){this.gl=e,this.vertBuffer=t,this.vao=r,this.shader=n,this.tickCount=i,this.tickOffset=a,this.gridCount=o,this.gridOffset=s}var d=p.prototype;d.bind=function(e,t,r){this.shader.bind(),this.shader.uniforms.model=e,this.shader.uniforms.view=t,this.shader.uniforms.projection=r,u[0]=this.gl.drawingBufferWidth,u[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=u,this.vao.bind()},d.unbind=function(){this.vao.unbind()},d.drawAxisLine=function(e,t,r,n,i){var a=h(s);this.shader.uniforms.majorAxis=s,a[e]=t[1][e]-t[0][e],this.shader.uniforms.minorAxis=a;var o,u=f(c,r);u[e]+=t[0][e],this.shader.uniforms.offset=u,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=n,(o=h(l))[(e+2)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6),(o=h(l))[(e+1)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6)},d.drawAxisTicks=function(e,t,r,n,i){if(this.tickCount[e]){var a=h(o);a[e]=1,this.shader.uniforms.majorAxis=a,this.shader.uniforms.offset=t,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=n,this.shader.uniforms.lineWidth=i;var s=h(l);s[e]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[e],this.tickOffset[e])}},d.drawGrid=function(e,t,r,n,i,a){if(this.gridCount[e]){var u=h(s);u[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=u;var p=f(c,n);p[t]+=r[0][t],this.shader.uniforms.offset=p;var d=h(o);d[e]=1,this.shader.uniforms.majorAxis=d;var m=h(l);m[e]=1,this.shader.uniforms.screenAxis=m,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,this.gridCount[e],this.gridOffset[e])}},d.drawZero=function(e,t,r,n,i,a){var o=h(s);this.shader.uniforms.majorAxis=o,o[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=o;var u=f(c,n);u[e]+=r[0][e],this.shader.uniforms.offset=u;var p=h(l);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)},d.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},1879:function(e,t,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\nuniform float lineWidth;\nuniform vec2 screenShape;\n\nvec3 project(vec3 p) {\n vec4 pp = projection * (view * (model * vec4(p, 1.0)));\n return pp.xyz / max(pp.w, 0.0001);\n}\n\nvoid main() {\n vec3 major = position.x * majorAxis;\n vec3 minor = position.y * minorAxis;\n\n vec3 vPosition = major + minor + offset;\n vec3 pPosition = project(vPosition);\n vec3 offset = project(vPosition + screenAxis * position.z);\n\n vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\n\n gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);t.n=function(e){return i(e,a,o,null,[{name:"position",type:"vec3"}])};var s=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, axis, alignDir, alignOpt;\nuniform float scale, angle, pixelScale;\nuniform vec2 resolution;\n\nvec3 project(vec3 p) {\n vec4 pp = projection * (view * (model * vec4(p, 1.0)));\n return pp.xyz / max(pp.w, 0.0001);\n}\n\nfloat computeViewAngle(vec3 a, vec3 b) {\n vec3 A = project(a);\n vec3 B = project(b);\n\n return atan(\n (B.y - A.y) * resolution.y,\n (B.x - A.x) * resolution.x\n );\n}\n\nconst float PI = 3.141592;\nconst float TWO_PI = 2.0 * PI;\nconst float HALF_PI = 0.5 * PI;\nconst float ONE_AND_HALF_PI = 1.5 * PI;\n\nint option = int(floor(alignOpt.x + 0.001));\nfloat hv_ratio = alignOpt.y;\nbool enableAlign = (alignOpt.z != 0.0);\n\nfloat mod_angle(float a) {\n return mod(a, PI);\n}\n\nfloat positive_angle(float a) {\n return mod_angle((a < 0.0) ?\n a + TWO_PI :\n a\n );\n}\n\nfloat look_upwards(float a) {\n float b = positive_angle(a);\n return ((b > HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}\n"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);t.Q=function(e){return i(e,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * (view * (model * vec4(nPosition, 1.0)));\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}\n"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);t.bg=function(e){return i(e,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(e,t,r){e.exports=function(e,t,r,a,s,l){var c=n(e),h=i(e,[{buffer:c,size:3}]),f=o(e);f.attributes.position.location=0;var p=new u(e,f,c,h);return p.update(t,r,a,s,l),p};var n=r(2762),i=r(8116),a=r(4359),o=r(1879).Q,s=window||c.global||{},l=s.__TEXT_CACHE||{};function u(e,t,r,n){this.gl=e,this.shader=t,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}s.__TEXT_CACHE={};var h=u.prototype,f=[0,0];h.bind=function(e,t,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=e,i.view=t,i.projection=r,i.pixelScale=n,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},h.unbind=function(){this.vao.unbind()},h.update=function(e,t,r,n,i){var o=[];function s(e,t,r,n,i,s){var c=[r.style,r.weight,r.variant,r.family].join("_"),u=l[c];u||(u=l[c]={});var h=u[t];h||(h=u[t]=function(e,t){try{return a(e,t)}catch(t){return console.warn('error vectorizing text:"'+e+'" error:',t),{cells:[],positions:[]}}}(t,{triangles:!0,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,p=h.positions,d=h.cells,m=0,g=d.length;m<g;++m)for(var y=d[m],v=2;v>=0;--v){var x=p[y[v]];o.push(f*x[0],-f*x[1],e)}}for(var c=[0,0,0],u=[0,0,0],h=[0,0,0],f=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){h[d]=o.length/3|0,s(.5*(e[0][d]+e[1][d]),t[d],r[d],12,1.25,p),f[d]=(o.length/3|0)-h[d],c[d]=o.length/3|0;for(var m=0;m<n[d].length;++m)if(n[d][m].text){var g={family:n[d][m].font||i[d].family,style:i[d].fontStyle||i[d].style,weight:i[d].fontWeight||i[d].weight,variant:i[d].fontVariant||i[d].variant};s(n[d][m].x,n[d][m].text,g,n[d][m].fontSize||12,1.25,p)}u[d]=(o.length/3|0)-c[d]}this.buffer.update(o),this.tickOffset=c,this.tickCount=u,this.labelOffset=h,this.labelCount=f},h.drawTicks=function(e,t,r,n,i,a,o,s){this.tickCount[e]&&(this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=t,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[e],this.tickOffset[e]))},h.drawLabel=function(e,t,r,n,i,a,o,s){this.labelCount[e]&&(this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=t,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.labelCount[e],this.labelOffset[e]))},h.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}},6444:function(e,t){function r(e,t){var r=e+"",n=r.indexOf("."),i=0;n>=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(e*t*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var h=""+c;h.length<i;)h="0"+h;return u+"."+h}return u}t.create=function(e,t){for(var n=[],i=0;i<3;++i){for(var a=[],o=(e[0][i],e[1][i],0);o*t[i]<=e[1][i];++o)a.push({x:o*t[i],text:r(t[i],o)});for(o=-1;o*t[i]>=e[0][i];--o)a.push({x:o*t[i],text:r(t[i],o)});n.push(a)}return n},t.equal=function(e,t){for(var r=0;r<3;++r){if(e[r].length!==t[r].length)return!1;for(var n=0;n<e[r].length;++n){var i=e[r][n],a=t[r][n];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,r){e.exports=function(e,t,r,l,h){var f=t.model||c,p=t.view||c,y=t.projection||c,v=t._ortho||!1,x=e.bounds,_=(h=h||a(f,p,y,x,v)).axis;o(u,p,f),o(u,y,u);for(var b=m,w=0;w<3;++w)b[w].lo=1/0,b[w].hi=-1/0,b[w].pixelsPerDataUnit=1/0;var T=n(s(u,u));s(u,u);for(var k=0;k<3;++k){var A=(k+1)%3,M=(k+2)%3,S=g;e:for(w=0;w<2;++w){var E=[];if(_[k]<0!=!!w){S[k]=x[w][k];for(var C=0;C<2;++C){S[A]=x[C^w][A];for(var I=0;I<2;++I)S[M]=x[I^C^w][M],E.push(S.slice())}var L=v?5:4;for(C=L;C===L;++C){if(0===E.length)continue e;E=i.positive(E,T[C])}for(C=0;C<E.length;++C){M=E[C];var P=d(g,u,M,r,l);for(I=0;I<3;++I)b[I].lo=Math.min(b[I].lo,M[I]),b[I].hi=Math.max(b[I].hi,M[I]),I!==k&&(b[I].pixelsPerDataUnit=Math.min(b[I].pixelsPerDataUnit,Math.abs(P[I])))}}}}return b};var n=r(5033),i=r(5202),a=r(6429),o=r(6760),s=r(5665),l=r(5352),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),u=new Float32Array(16);function h(e,t,r){this.lo=e,this.hi=t,this.pixelsPerDataUnit=r}var f=[0,0,0,1],p=[0,0,0,1];function d(e,t,r,n,i){for(var a=0;a<3;++a){for(var o=f,s=p,c=0;c<3;++c)s[c]=o[c]=r[c];s[3]=o[3]=1,s[a]+=1,l(s,s,t),s[3]<0&&(e[a]=1/0),o[a]-=1,l(o,o,t),o[3]<0&&(e[a]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,h=(o[1]/o[3]-s[1]/s[3])*i;e[a]=.25*Math.sqrt(u*u+h*h)}return e}var m=[new h(1/0,-1/0,1/0),new h(1/0,-1/0,1/0),new h(1/0,-1/0,1/0)],g=[0,0,0]},2762:function(e,t,r){var n=r(1888),i=r(5298),a=r(9618),o=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(e,t,r,n,i){this.gl=e,this.type=t,this.handle=r,this.length=n,this.usage=i}var l=s.prototype;function c(e,t,r,n,i,a){var o=i.length*i.BYTES_PER_ELEMENT;if(a<0)return e.bufferData(t,i,n),o;if(o+a>r)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return e.bufferSubData(t,a,i),r}function u(e,t){for(var r=n.malloc(e.length,t),i=e.length,a=0;a<i;++a)r[a]=e[a];return r}l.bind=function(){this.gl.bindBuffer(this.type,this.handle)},l.unbind=function(){this.gl.bindBuffer(this.type,null)},l.dispose=function(){this.gl.deleteBuffer(this.handle)},l.update=function(e,t){if("number"!=typeof t&&(t=-1),this.bind(),"object"==typeof e&&typeof e.shape<"u"){var r=e.dtype;if(o.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER&&(r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16"),r===e.dtype&&function(e,t){for(var r=1,n=t.length-1;n>=0;--n){if(t[n]!==r)return!1;r*=e[n]}return!0}(e.shape,e.stride))0===e.offset&&e.data.length===e.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,e.data,t):this.length=c(this.gl,this.type,this.length,this.usage,e.data.subarray(e.offset,e.shape[0]),t);else{var s=n.malloc(e.size,r),l=a(s,e.shape);i.assign(l,e),this.length=c(this.gl,this.type,this.length,this.usage,t<0?s:s.subarray(0,e.size),t),n.free(s)}}else if(Array.isArray(e)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(e,"uint16"):u(e,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,t<0?h:h.subarray(0,e.length),t),n.free(h)}else if("object"==typeof e&&"number"==typeof e.length)this.length=c(this.gl,this.type,this.length,this.usage,e,t);else{if("number"!=typeof e&&void 0!==e)throw new Error("gl-buffer: Invalid data type");if(t>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(e|=0)<=0&&(e=1),this.gl.bufferData(this.type,0|e,this.usage),this.length=e}},e.exports=function(e,t,r,n){if(r=r||e.ARRAY_BUFFER,n=n||e.DYNAMIC_DRAW,r!==e.ARRAY_BUFFER&&r!==e.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==e.DYNAMIC_DRAW&&n!==e.STATIC_DRAW&&n!==e.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=e.createBuffer(),a=new s(e,r,i,0,n);return a.update(t),a}},6405:function(e,t,r){var n=r(2931);e.exports=function(e,t){var r=e.positions,i=e.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:e.vertexIntensityBounds,vectors:[],cells:[],coneOffset:e.coneOffset,colormap:e.colormap};if(0===e.positions.length)return t&&(t[0]=[0,0,0],t[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,h=1/0,f=-1/0,p=null,d=null,m=[],g=1/0,y=!1,v="raw"===e.coneSizemode,x=0;x<r.length;x++){var _=r[x];s=Math.min(_[0],s),l=Math.max(_[0],l),c=Math.min(_[1],c),u=Math.max(_[1],u),h=Math.min(_[2],h),f=Math.max(_[2],f);var b=i[x];if(n.length(b)>o&&(o=n.length(b)),x&&!v){var w=2*n.distance(p,_)/(n.length(d)+n.length(b));w?(g=Math.min(g,w),y=!1):y=!0}y||(p=_,d=b),m.push(b)}var T=[s,c,h],k=[l,u,f];t&&(t[0]=T,t[1]=k),0===o&&(o=1);var A=1/o;isFinite(g)||(g=1),a.vectorScale=g;var M=e.coneSize||(v?1:.5);e.absoluteConeSize&&(M=e.absoluteConeSize*A),a.coneScale=M,x=0;for(var S=0;x<r.length;x++)for(var E=(_=r[x])[0],C=_[1],I=_[2],L=m[x],P=n.length(L)*A,z=0;z<8;z++){a.positions.push([E,C,I,S++]),a.positions.push([E,C,I,S++]),a.positions.push([E,C,I,S++]),a.positions.push([E,C,I,S++]),a.positions.push([E,C,I,S++]),a.positions.push([E,C,I,S++]),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vertexIntensity.push(P,P,P),a.vertexIntensity.push(P,P,P);var D=a.positions.length;a.cells.push([D-6,D-5,D-4],[D-3,D-2,D-1])}return a};var i=r(614);e.exports.createMesh=r(9060),e.exports.createConeMesh=function(t,r){return e.exports.createMesh(t,r,{shaders:i,traceType:"cone"})}},9060:function(e,t,r){var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(6760),l=r(7608),c=r(9618),u=r(6729),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function f(e,t,r,n,i,a,o,s,l,c,u){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=r,this.pickShader=n,this.trianglePositions=i,this.triangleVectors=a,this.triangleColors=s,this.triangleUVs=l,this.triangleIds=o,this.triangleVAO=c,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=h,this._view=h,this._projection=h,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},p.update=function(e){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),void 0!==e.tubeScale&&(this.tubeScale=e.tubeScale),void 0!==e.vectorScale&&(this.vectorScale=e.vectorScale),void 0!==e.coneScale&&(this.coneScale=e.coneScale),void 0!==e.coneOffset&&(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(function(e){for(var t=u({colormap:e,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=t[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return c(r,[256,256,4],[4,0,1])}(e.colormap)),this.texture.generateMipmap());var r=e.cells,n=e.positions,i=e.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],h=[];this.cells=r,this.positions=n,this.vectors=i;var f=e.meshColor||[1,1,1,1],p=e.vertexIntensity,d=1/0,m=-1/0;if(p)if(e.vertexIntensityBounds)d=+e.vertexIntensityBounds[0],m=+e.vertexIntensityBounds[1];else for(var g=0;g<p.length;++g){var y=p[g];d=Math.min(d,y),m=Math.max(m,y)}else for(g=0;g<n.length;++g)y=n[g][2],d=Math.min(d,y),m=Math.max(m,y);for(this.intensity=p||function(e){for(var t=e.length,r=new Array(t),n=0;n<t;++n)r[n]=e[n][2];return r}(n),this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=0;g<n.length;++g)for(var v=n[g],x=0;x<3;++x)isNaN(v[x])||!isFinite(v[x])||(this.bounds[0][x]=Math.min(this.bounds[0][x],v[x]),this.bounds[1][x]=Math.max(this.bounds[1][x],v[x]));var _=0;e:for(g=0;g<r.length;++g){var b=r[g];if(3===b.length){for(x=0;x<3;++x){v=n[T=b[x]];for(var w=0;w<3;++w)if(isNaN(v[w])||!isFinite(v[w]))continue e}for(x=0;x<3;++x){var T;v=n[T=b[2-x]],a.push(v[0],v[1],v[2],v[3]);var k=i[T];o.push(k[0],k[1],k[2],k[3]||0);var A,M=f;3===M.length?s.push(M[0],M[1],M[2],1):s.push(M[0],M[1],M[2],M[3]),A=p?[(p[T]-d)/(m-d),0]:[(v[2]-d)/(m-d),0],l.push(A[0],A[1]),h.push(g)}_+=1}}this.triangleCount=_,this.trianglePositions.update(a),this.triangleVectors.update(o),this.triangleColors.update(s),this.triangleUVs.update(l),this.triangleIds.update(new Uint32Array(h))}},p.drawTransparent=p.draw=function(e){e=e||{};for(var t=this.gl,r=e.model||h,n=e.view||h,i=e.projection||h,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 c={model:r,view:n,projection:i,inverseModel:h.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};c.inverseModel=l(c.inverseModel,c.model),t.disable(t.CULL_FACE),this.texture.bind(0);var u=new Array(16);for(s(u,c.view,c.model),s(u,c.projection,u),l(u,u),o=0;o<3;++o)c.eyePosition[o]=u[12+o]/u[15];var f=u[15];for(o=0;o<3;++o)f+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var p=u[12+o],d=0;d<3;++d)p+=u[4*d+o]*this.lightPosition[d];c.lightPosition[o]=p/f}if(this.triangleCount>0){var m=this.triShader;m.bind(),m.uniforms=c,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||h,n=e.view||h,i=e.projection||h,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(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),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],r=this.cells[t],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[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()},e.exports=function(e,t,r){var s=r.shaders;1===arguments.length&&(e=(t=e).gl);var l=function(e,t){var r=n(e,t.meshShader.vertex,t.meshShader.fragment,null,t.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(e,s),u=function(e,t){var r=n(e,t.pickShader.vertex,t.pickShader.fragment,null,t.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(e,s),h=o(e,c(new Uint8Array([255,255,255,255]),[1,1,4]));h.generateMipmap(),h.minFilter=e.LINEAR_MIPMAP_LINEAR,h.magFilter=e.LINEAR;var p=i(e),d=i(e),m=i(e),g=i(e),y=i(e),v=new f(e,h,l,u,p,d,y,m,g,a(e,[{buffer:p,type:e.FLOAT,size:4},{buffer:y,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:e.FLOAT,size:4},{buffer:g,type:e.FLOAT,size:2},{buffer:d,type:e.FLOAT,size:4}]),r.traceType||"cone");return v.update(t),v}},614:function(e,t,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // 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).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // 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).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * (view * conePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);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,r){var n=r(737);e.exports=function(e){return n[e]}},9165:function(e,t,r){e.exports=function(e){var t=e.gl,r=n(t),o=i(t,[{buffer:r,type:t.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:t.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:t.FLOAT,size:3,offset:28,stride:40}]),l=a(t);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(t,r,o,l);return c.update(e),c};var n=r(2762),i=r(8116),a=r(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,r,n){this.gl=e,this.shader=n,this.buffer=t,this.vao=r,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 l=s.prototype;function c(e,t){for(var r=0;r<3;++r)e[0][r]=Math.min(e[0][r],t[r]),e[1][r]=Math.max(e[1][r],t[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(e){var t=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=e.view||o,i=r.projection=e.projection||o;r.model=e.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=(e._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/t.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)t.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*u,this.lineCount[h]&&t.drawArrays(t.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var u=function(){for(var e=new Array(3),t=0;t<3;++t){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+t)%3]=i,r.push(a)}e[t]=r}return e}();function h(e,t,r,n){for(var i=u[n],a=0;a<i.length;++a){var o=i[a];e.push(t[0],t[1],t[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return i.length}l.update=function(e){"lineWidth"in(e=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]],r=e.position,n=e.error;if(Array.isArray(t[0])||(t=[t,t,t]),r&&n){var i=[],a=r.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 l=0;l<a;++l){for(var u=r[l],f=0;f<3;++f)if(isNaN(u[f])||!isFinite(u[f]))continue e;var p,d=n[l],m=t[s];Array.isArray(m[0])&&(m=t[l]),3===m.length?m=[m[0],m[1],m[2],1]:4===m.length&&(m=[m[0],m[1],m[2],m[3]],!this.hasAlpha&&m[3]<1&&(this.hasAlpha=!0)),isNaN(d[0][s])||isNaN(d[1][s])||(d[0][s]<0&&((p=u.slice())[s]+=d[0][s],i.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,p[0],p[1],p[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,p),o+=2+h(i,p,m,s)),d[1][s]>0&&((p=u.slice())[s]+=d[1][s],i.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,p[0],p[1],p[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,p),o+=2+h(i,p,m,s)))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436:function(e,t,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * (view * worldPosition);\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);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,r){var n=r(7766);e.exports=function(e,t,r,n){i||(i=e.FRAMEBUFFER_UNSUPPORTED,a=e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=e.getExtension("WEBGL_draw_buffers");if(!l&&c&&function(e,t){var r=e.getParameter(t.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;a<n;++a)i[a]=e.COLOR_ATTACHMENT0+a;for(a=n;a<r;++a)i[a]=e.NONE;l[n]=i}}(e,c),Array.isArray(t)&&(n=r,r=0|t[1],t=0|t[0]),"number"!=typeof t)throw new Error("gl-fbo: Missing shape parameter");var u=e.getParameter(e.MAX_RENDERBUFFER_SIZE);if(t<0||t>u||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(n=n||{})){if((h=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>e.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var f=e.UNSIGNED_BYTE,p=e.getExtension("OES_texture_float");if(n.float&&h>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");f=e.FLOAT}else n.preferFloat&&h>0&&p&&(f=e.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new d(e,t,r,f,h,m,g,c)};var i,a,o,s,l=null;function c(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 h(e){switch(e){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function f(e,t,r,i,a,o){if(!i)return null;var s=n(e,t,r,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 p(e,t,r,n,i){var a=e.createRenderbuffer();return e.bindRenderbuffer(e.RENDERBUFFER,a),e.renderbufferStorage(e.RENDERBUFFER,n,t,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,i,e.RENDERBUFFER,a),a}function d(e,t,r,n,i,a,o,s){this.gl=e,this._shape=[0|t,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var d=0;d<i;++d)this.color[d]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=a,this._useStencil=o;var m=this,g=[0|t,0|r];Object.defineProperties(g,{0:{get:function(){return m._shape[0]},set:function(e){return m.width=e}},1:{get:function(){return m._shape[1]},set:function(e){return m.height=e}}}),this._shapeVector=g,function(e){var t=c(e.gl),r=e.gl,n=e.handle=r.createFramebuffer(),i=e._shape[0],a=e._shape[1],o=e.color.length,s=e._ext,d=e._useStencil,m=e._useDepth,g=e._colorType;r.bindFramebuffer(r.FRAMEBUFFER,n);for(var y=0;y<o;++y)e.color[y]=f(r,i,a,g,r.RGBA,r.COLOR_ATTACHMENT0+y);0===o?(e._color_rb=p(r,i,a,r.RGBA4,r.COLOR_ATTACHMENT0),s&&s.drawBuffersWEBGL(l[0])):o>1&&s.drawBuffersWEBGL(l[o]);var v=r.getExtension("WEBGL_depth_texture");v?d?e.depth=f(r,i,a,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(e.depth=f(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&d?e._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?e._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(e._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(e._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(e.handle),e.handle=null,e.depth&&(e.depth.dispose(),e.depth=null),e._depth_rb&&(r.deleteRenderbuffer(e._depth_rb),e._depth_rb=null),y=0;y<e.color.length;++y)e.color[y].dispose(),e.color[y]=null;e._color_rb&&(r.deleteRenderbuffer(e._color_rb),e._color_rb=null),u(r,t),h(x)}u(r,t)}(this)}var m=d.prototype;function g(e,t,r){if(e._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(e._shape[0]!==t||e._shape[1]!==r){var n=e.gl,i=n.getParameter(n.MAX_RENDERBUFFER_SIZE);if(t<0||t>i||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");e._shape[0]=t,e._shape[1]=r;for(var a=c(n),o=0;o<e.color.length;++o)e.color[o].shape=e._shape;e._color_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,e._color_rb),n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,e._shape[0],e._shape[1])),e.depth&&(e.depth.shape=e._shape),e._depth_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,e._depth_rb),e._useDepth&&e._useStencil?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e._shape[0],e._shape[1]):e._useDepth?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,e._shape[0],e._shape[1]):e._useStencil&&n.renderbufferStorage(n.RENDERBUFFER,n.STENCIL_INDEX,e._shape[0],e._shape[1])),n.bindFramebuffer(n.FRAMEBUFFER,e.handle);var s=n.checkFramebufferStatus(n.FRAMEBUFFER);s!==n.FRAMEBUFFER_COMPLETE&&(e.dispose(),u(n,a),h(s)),u(n,a)}}Object.defineProperties(m,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(e){if(Array.isArray(e)||(e=[0|e,0|e]),2!==e.length)throw new Error("gl-fbo: Shape vector must be length 2");var t=0|e[0],r=0|e[1];return g(this,t,r),[t,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(e){return g(this,e|=0,this._shape[1]),e},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(e){return e|=0,g(this,this._shape[0],e),e},enumerable:!1}}),m.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])}},m.dispose=function(){if(!this._destroyed){this._destroyed=!0;var e=this.gl;e.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(e.deleteRenderbuffer(this._depth_rb),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),this._color_rb=null)}}},2992:function(e,t,r){var n=r(3387).sprintf,i=r(5171),a=r(1848),o=r(1085);e.exports=function(e,t,r){var s=a(t)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===i.FRAGMENT_SHADER?"fragment":"vertex");for(var c=n("Error compiling %s shader %s:\n",l,s),u=n("%s%s",c,e),h=e.split("\n"),f={},p=0;p<h.length;p++){var d=h[p];if(""!==d&&"\0"!==d){var m=parseInt(d.split(":")[2]);if(isNaN(m))throw new Error(n("Could not parse error: %s",d));f[m]=d}}var g=o(t).split("\n");for(p=0;p<g.length;p++)if((f[p+3]||f[p+2]||f[p+1])&&(c+=g[p]+"\n",f[p+1])){var y=f[p+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),c+=n("^^^ %s\n\n",y)}return{long:c.trim(),short:u.trim()}}},7319:function(e,t,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, nextPosition;\nattribute float arcLength, lineWidth;\nattribute vec4 color;\n\nuniform vec2 screenShape;\nuniform float pixelRatio;\nuniform mat4 model, view, projection;\n\nvarying vec4 fragColor;\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n vec4 startPoint = project(position);\n vec4 endPoint = project(nextPosition);\n\n vec2 A = startPoint.xy / startPoint.w;\n vec2 B = endPoint.xy / endPoint.w;\n\n float clipAngle = atan(\n (B.y - A.y) * screenShape.y,\n (B.x - A.x) * screenShape.x\n );\n\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(\n sin(clipAngle),\n -cos(clipAngle)\n ) / screenShape;\n\n gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);\n\n worldPosition = position;\n pixelArcLength = arcLength;\n fragColor = color;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{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,l)},t.createPickShader=function(e){return i(e,a,s,null,l)}},5714:function(e,t,r){e.exports=function(e){var t=e.gl||e.scene&&e.scene.gl,r=h(t);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=f(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=n(t),l=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}]),u=c(new Array(1024),[256,1,4]),p=0;p<1024;++p)u.data[p]=255;var d=a(t,u);d.wrap=t.REPEAT;var m=new y(t,r,o,s,l,d);return m.update(e),m};var n=r(2762),i=r(8116),a=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(2478),c=r(9618),u=r(7319),h=u.createShader,f=u.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(e,t){for(var r=0,n=0;n<3;++n){var i=e[n]-t[n];r+=i*i}return Math.sqrt(r)}function m(e){for(var t=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)t[0][r]=Math.max(e[0][r],t[0][r]),t[1][r]=Math.min(e[1][r],t[1][r]);return t}function g(e,t,r,n){this.arcLength=e,this.position=t,this.index=r,this.dataCoordinate=n}function y(e,t,r,n,i,a){this.gl=e,this.shader=t,this.pickShader=r,this.buffer=n,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 v=y.prototype;v.isTransparent=function(){return this.hasAlpha},v.isOpaque=function(){return!this.hasAlpha},v.pickSlots=1,v.setPickBase=function(e){this.pickId=e},v.drawTransparent=v.draw=function(e){if(this.vertexCount){var t=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:e.model||p,view:e.view||p,projection:e.projection||p,clipBounds:m(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},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.drawPick=function(e){if(this.vertexCount){var t=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:e.model||p,view:e.view||p,projection:e.projection||p,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.update=function(e){var t,r;this.dirty=!0;var n=!!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,u=0,h=[[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 y,v,x,_=f[t-1],b=f[t];for(a.push(s),o.push(_.slice()),r=0;r<3;++r){if(isNaN(_[r])||isNaN(b[r])||!isFinite(_[r])||!isFinite(b[r])){if(!n&&i.length>0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,g=!0}continue e}h[0][r]=Math.min(h[0][r],_[r],b[r]),h[1][r]=Math.max(h[1][r],_[r],b[r])}Array.isArray(p[0])?(y=p.length>t-1?p[t-1]:p.length>0?p[p.length-1]:[0,0,0,1],v=p.length>t?p[t]:p.length>0?p[p.length-1]:[0,0,0,1]):y=v=p,3===y.length&&(y=[y[0],y[1],y[2],1]),3===v.length&&(v=[v[0],v[1],v[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),x=Array.isArray(m)?m.length>t-1?m[t-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var T=s;if(s+=d(_,b),g){for(r=0;r<2;++r)i.push(_[0],_[1],_[2],b[0],b[1],b[2],T,x,y[0],y[1],y[2],y[3]);u+=2,g=!1}i.push(_[0],_[1],_[2],b[0],b[1],b[2],T,x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],T,-x,y[0],y[1],y[2],y[3],b[0],b[1],b[2],_[0],_[1],_[2],s,-x,v[0],v[1],v[2],v[3],b[0],b[1],b[2],_[0],_[1],_[2],s,x,v[0],v[1],v[2],v[3]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(f[f.length-1].slice()),this.bounds=h,this.vertexCount=u,this.points=o,this.arcLength=a,"dashes"in e){var k=e.dashes.slice();for(k.unshift(0),t=1;t<k.length;++t)k[t]=k[t-1]+k[t];var A=c(new Array(1024),[256,1,4]);for(t=0;t<256;++t){for(r=0;r<4;++r)A.set(t,0,r,0);1&l.le(k,k[k.length-1]*t/255)?A.set(t,0,0,0):A.set(t,0,0,255)}this.texture.setPixels(A)}},v.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},v.pick=function(e){if(!e||e.id!==this.pickId)return null;var t=function(e,t,r){return o[0]=0,o[1]=r,o[2]=t,o[3]=e,s[0]}(e.value[0],e.value[1],e.value[2]),r=l.le(this.arcLength,t);if(r<0)return null;if(r===this.arcLength.length-1)return new g(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],i=this.points[Math.min(r+1,this.points.length-1)],a=(t-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),c=1-a,u=[0,0,0],h=0;h<3;++h)u[h]=c*n[h]+a*i[h];var f=Math.min(a<.5?r:r+1,this.points.length-1);return new g(t,u,f,this.points[f])}},1903:function(e){e.exports=function(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=function(){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=function(e){var t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],f=e[11],p=e[12],d=e[13],m=e[14],g=e[15];return(t*o-r*a)*(h*g-f*m)-(t*s-n*a)*(u*g-f*d)+(t*l-i*a)*(u*m-h*d)+(r*s-n*o)*(c*g-f*p)-(r*l-i*o)*(c*m-h*p)+(n*l-i*s)*(c*d-u*p)}},7399:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,h=n*s,f=i*o,p=i*s,d=i*l,m=a*o,g=a*s,y=a*l;return e[0]=1-h-d,e[1]=u+y,e[2]=f-g,e[3]=0,e[4]=u-y,e[5]=1-c-d,e[6]=p+m,e[7]=0,e[8]=f+g,e[9]=p-m,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},6743:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,l=i+i,c=a+a,u=n*s,h=n*l,f=n*c,p=i*l,d=i*c,m=a*c,g=o*s,y=o*l,v=o*c;return e[0]=1-(p+m),e[1]=h+v,e[2]=f-y,e[3]=0,e[4]=h-v,e[5]=1-(u+m),e[6]=d+g,e[7]=0,e[8]=f+y,e[9]=d-g,e[10]=1-(u+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}},7894:function(e){e.exports=function(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=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],p=t[11],d=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*o,x=r*l-i*o,_=r*c-a*o,b=n*l-i*s,w=n*c-a*s,T=i*c-a*l,k=u*m-h*d,A=u*g-f*d,M=u*y-p*d,S=h*g-f*m,E=h*y-p*m,C=f*y-p*g,I=v*C-x*E+_*S+b*M-w*A+T*k;return I?(I=1/I,e[0]=(s*C-l*E+c*S)*I,e[1]=(i*E-n*C-a*S)*I,e[2]=(m*T-g*w+y*b)*I,e[3]=(f*w-h*T-p*b)*I,e[4]=(l*M-o*C-c*A)*I,e[5]=(r*C-i*M+a*A)*I,e[6]=(g*_-d*T-y*x)*I,e[7]=(u*T-f*_+p*x)*I,e[8]=(o*E-s*M+c*k)*I,e[9]=(n*M-r*E-a*k)*I,e[10]=(d*w-m*_+y*v)*I,e[11]=(h*_-u*w-p*v)*I,e[12]=(s*A-o*S-l*k)*I,e[13]=(r*S-n*A+i*k)*I,e[14]=(m*x-d*b-g*v)*I,e[15]=(u*b-h*x+f*v)*I,e):null}},6582:function(e,t,r){var n=r(7894);e.exports=function(e,t,r,i){var a,o,s,l,c,u,h,f,p,d,m=t[0],g=t[1],y=t[2],v=i[0],x=i[1],_=i[2],b=r[0],w=r[1],T=r[2];return Math.abs(m-b)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-T)<1e-6?n(e):(h=m-b,f=g-w,p=y-T,a=x*(p*=d=1/Math.sqrt(h*h+f*f+p*p))-_*(f*=d),o=_*(h*=d)-v*p,s=v*f-x*h,(d=Math.sqrt(a*a+o*o+s*s))?(a*=d=1/d,o*=d,s*=d):(a=0,o=0,s=0),l=f*s-p*o,c=p*a-h*s,u=h*o-f*a,(d=Math.sqrt(l*l+c*c+u*u))?(l*=d=1/d,c*=d,u*=d):(l=0,c=0,u=0),e[0]=a,e[1]=l,e[2]=h,e[3]=0,e[4]=o,e[5]=c,e[6]=f,e[7]=0,e[8]=s,e[9]=u,e[10]=p,e[11]=0,e[12]=-(a*m+o*g+s*y),e[13]=-(l*m+c*g+u*y),e[14]=-(h*m+f*g+p*y),e[15]=1,e)}},6760:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],f=t[9],p=t[10],d=t[11],m=t[12],g=t[13],y=t[14],v=t[15],x=r[0],_=r[1],b=r[2],w=r[3];return e[0]=x*n+_*s+b*h+w*m,e[1]=x*i+_*l+b*f+w*g,e[2]=x*a+_*c+b*p+w*y,e[3]=x*o+_*u+b*d+w*v,x=r[4],_=r[5],b=r[6],w=r[7],e[4]=x*n+_*s+b*h+w*m,e[5]=x*i+_*l+b*f+w*g,e[6]=x*a+_*c+b*p+w*y,e[7]=x*o+_*u+b*d+w*v,x=r[8],_=r[9],b=r[10],w=r[11],e[8]=x*n+_*s+b*h+w*m,e[9]=x*i+_*l+b*f+w*g,e[10]=x*a+_*c+b*p+w*y,e[11]=x*o+_*u+b*d+w*v,x=r[12],_=r[13],b=r[14],w=r[15],e[12]=x*n+_*s+b*h+w*m,e[13]=x*i+_*l+b*f+w*g,e[14]=x*a+_*c+b*p+w*y,e[15]=x*o+_*u+b*d+w*v,e}},4040:function(e){e.exports=function(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*c,e[15]=1,e}},4772:function(e){e.exports=function(e,t,r,n,i){var a=1/Math.tan(t/2),o=1/(n-i);return e[0]=a/r,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+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*n*o,e[15]=0,e}},6079:function(e){e.exports=function(e,t,r,n){var i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E=n[0],C=n[1],I=n[2],L=Math.sqrt(E*E+C*C+I*I);return Math.abs(L)<1e-6?null:(E*=L=1/L,C*=L,I*=L,i=Math.sin(r),o=1-(a=Math.cos(r)),s=t[0],l=t[1],c=t[2],u=t[3],h=t[4],f=t[5],p=t[6],d=t[7],m=t[8],g=t[9],y=t[10],v=t[11],x=E*E*o+a,_=C*E*o+I*i,b=I*E*o-C*i,w=E*C*o-I*i,T=C*C*o+a,k=I*C*o+E*i,A=E*I*o+C*i,M=C*I*o-E*i,S=I*I*o+a,e[0]=s*x+h*_+m*b,e[1]=l*x+f*_+g*b,e[2]=c*x+p*_+y*b,e[3]=u*x+d*_+v*b,e[4]=s*w+h*T+m*k,e[5]=l*w+f*T+g*k,e[6]=c*w+p*T+y*k,e[7]=u*w+d*T+v*k,e[8]=s*A+h*M+m*S,e[9]=l*A+f*M+g*S,e[10]=c*A+p*M+y*S,e[11]=u*A+d*M+v*S,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}},5567:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=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+c*n,e[5]=o*i+u*n,e[6]=s*i+h*n,e[7]=l*i+f*n,e[8]=c*i-a*n,e[9]=u*i-o*n,e[10]=h*i-s*n,e[11]=f*i-l*n,e}},2408:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],c=t[8],u=t[9],h=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-c*n,e[1]=o*i-u*n,e[2]=s*i-h*n,e[3]=l*i-f*n,e[8]=a*n+c*i,e[9]=o*n+u*i,e[10]=s*n+h*i,e[11]=l*n+f*i,e}},7089:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],c=t[4],u=t[5],h=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+c*n,e[1]=o*i+u*n,e[2]=s*i+h*n,e[3]=l*i+f*n,e[4]=c*i-a*n,e[5]=u*i-o*n,e[6]=h*i-s*n,e[7]=f*i-l*n,e}},2504:function(e){e.exports=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,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=function(e,t,r){var n,i,a,o,s,l,c,u,h,f,p,d,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],f=t[9],p=t[10],d=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=f,e[10]=p,e[11]=d,e[12]=n*m+s*g+h*y+t[12],e[13]=i*m+l*g+f*y+t[13],e[14]=a*m+c*g+p*y+t[14],e[15]=o*m+u*g+d*y+t[15]),e}},5665:function(e){e.exports=function(e,t){if(e===t){var r=t[1],n=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]=r,e[6]=t[9],e[7]=t[13],e[8]=n,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,r){var n=r(2642),i=r(9346);function a(e,t){for(var r=[0,0,0,0],n=0;n<4;++n)for(var i=0;i<4;++i)r[i]+=e[4*n+i]*t[n];return r}function o(e,t,r,n,i){for(var o=a(n,a(r,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){for(var r=[0,0,0],n=0;n<e.length;++n)for(var i=e[n],a=t[n],o=0;o<3;++o)r[o]+=a*i[o];return r}e.exports=function(e,t,r,a,l,c){if(1===e.length)return[0,e[0].slice()];for(var u=new Array(e.length),h=0;h<e.length;++h)u[h]=o(e[h],r,a,l,c);var f=0,p=1/0;for(h=0;h<u.length;++h){for(var d=0,m=0;m<2;++m)d+=Math.pow(u[h][m]-t[m],2);d<p&&(p=d,f=h)}var g=function(e,t){if(2===e.length){for(var r=0,a=0,o=0;o<2;++o)r+=Math.pow(t[o]-e[0][o],2),a+=Math.pow(t[o]-e[1][o],2);return(r=Math.sqrt(r))+(a=Math.sqrt(a))<1e-6?[1,0]:[a/(r+a),r/(a+r)]}if(3===e.length){var s=[0,0];return i(e[0],e[1],e[2],t,s),n(e,s)}return[]}(u,t),y=0;for(h=0;h<3;++h){if(g[h]<-.001||g[h]>1.0001)return null;y+=g[h]}return Math.abs(y-1)>.001?null:[f,s(e,g),g]}},840:function(e,t,r){var n=r(3236),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_id = id;\n f_position = position;\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);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:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:u,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:f,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},7201:function(e,t,r){var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(8406),l=r(6760),c=r(7608),u=r(9618),h=r(6729),f=r(7765),p=r(1888),d=r(840),m=r(7626),g=d.meshShader,y=d.wireShader,v=d.pointShader,x=d.pickShader,_=d.pointPickShader,b=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(e,t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,T,k,A,M,S){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=c,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=g,this.edgeUVs=y,this.edgeIds=m,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=x,this.pointColors=b,this.pointUVs=T,this.pointSizes=k,this.pointIds=_,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=S,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 k=T.prototype;function A(e,t){if(!t||!t.length)return 1;for(var r=0;r<t.length;++r){if(t.length<2)return 1;if(t[r][0]===e)return t[r][1];if(t[r][0]>e&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}k.isOpaque=function(){return!this.hasAlpha},k.isTransparent=function(){return this.hasAlpha},k.pickSlots=1,k.setPickBase=function(e){this.pickId=e},k.highlight=function(e){if(e&&this.contourEnable){for(var t=f(this.cells,this.intensity,e.intensity),r=t.cells,n=t.vertexIds,i=t.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l<a;++l)for(var c=r[l],u=0;u<2;++u){var h=c[0];2===c.length&&(h=c[u]);for(var d=n[h][0],m=n[h][1],g=i[h],y=1-g,v=this.positions[d],x=this.positions[m],_=0;_<3;++_)o[s++]=g*v[_]+y*x[_]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),p.free(o)}else this.contourCount=0},k.update=function(e){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=o(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(function(e,t){for(var r=h({colormap:e,nshades:256,format:"rgba"}),n=new Uint8Array(1024),i=0;i<256;++i){for(var a=r[i],o=0;o<3;++o)n[4*i+o]=a[o];n[4*i+3]=t?255*A(i/255,t):255*a[3]}return u(n,[256,256,4],[4,0,1])}(e.colormap,this.opacityscale)),this.texture.generateMipmap());var r=e.cells,n=e.positions;if(n&&r){var i=[],a=[],l=[],c=[],f=[],p=[],d=[],m=[],g=[],y=[],v=[],x=[],_=[],b=[];this.cells=r,this.positions=n;var w=e.vertexNormals,T=e.cellNormals,k=void 0===e.vertexNormalsEpsilon?1e-6:e.vertexNormalsEpsilon,M=void 0===e.faceNormalsEpsilon?1e-6:e.faceNormalsEpsilon;e.useFacetNormals&&!T&&(T=s.faceNormals(r,n,M)),!T&&!w&&(w=s.vertexNormals(r,n,k));var S=e.vertexColors,E=e.cellColors,C=e.meshColor||[1,1,1,1],I=e.vertexUVs,L=e.vertexIntensity,P=e.cellUVs,z=e.cellIntensity,D=1/0,O=-1/0;if(!I&&!P)if(L)if(e.vertexIntensityBounds)D=+e.vertexIntensityBounds[0],O=+e.vertexIntensityBounds[1];else for(var R=0;R<L.length;++R){var F=L[R];D=Math.min(D,F),O=Math.max(O,F)}else if(z)if(e.cellIntensityBounds)D=+e.cellIntensityBounds[0],O=+e.cellIntensityBounds[1];else for(R=0;R<z.length;++R)F=z[R],D=Math.min(D,F),O=Math.max(O,F);else for(R=0;R<n.length;++R)F=n[R][2],D=Math.min(D,F),O=Math.max(O,F);this.intensity=L||z||function(e){for(var t=e.length,r=new Array(t),n=0;n<t;++n)r[n]=e[n][2];return r}(n),this.pickVertex=!(z||E);var B=e.pointSizes,j=e.pointSize||1;for(this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],R=0;R<n.length;++R)for(var N=n[R],U=0;U<3;++U)isNaN(N[U])||!isFinite(N[U])||(this.bounds[0][U]=Math.min(this.bounds[0][U],N[U]),this.bounds[1][U]=Math.max(this.bounds[1][U],N[U]));var V=0,q=0,H=0;e:for(R=0;R<r.length;++R){var G=r[R];switch(G.length){case 1:for(N=n[Z=G[0]],U=0;U<3;++U)if(isNaN(N[U])||!isFinite(N[U]))continue e;y.push(N[0],N[1],N[2]),Y=S?S[Z]:E?E[R]:C,this.opacityscale&&L?a.push(Y[0],Y[1],Y[2],this.opacity*A((L[Z]-D)/(O-D),this.opacityscale)):3===Y.length?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)),X=I?I[Z]:L?[(L[Z]-D)/(O-D),0]:P?P[R]:z?[(z[R]-D)/(O-D),0]:[(N[2]-D)/(O-D),0],x.push(X[0],X[1]),B?_.push(B[Z]):_.push(j),b.push(R),H+=1;break;case 2:for(U=0;U<2;++U){N=n[Z=G[U]];for(var W=0;W<3;++W)if(isNaN(N[W])||!isFinite(N[W]))continue e}for(U=0;U<2;++U)N=n[Z=G[U]],p.push(N[0],N[1],N[2]),Y=S?S[Z]:E?E[R]:C,this.opacityscale&&L?a.push(Y[0],Y[1],Y[2],this.opacity*A((L[Z]-D)/(O-D),this.opacityscale)):3===Y.length?d.push(Y[0],Y[1],Y[2],this.opacity):(d.push(Y[0],Y[1],Y[2],Y[3]*this.opacity),Y[3]<1&&(this.hasAlpha=!0)),X=I?I[Z]:L?[(L[Z]-D)/(O-D),0]:P?P[R]:z?[(z[R]-D)/(O-D),0]:[(N[2]-D)/(O-D),0],m.push(X[0],X[1]),g.push(R);q+=1;break;case 3:for(U=0;U<3;++U)for(N=n[Z=G[U]],W=0;W<3;++W)if(isNaN(N[W])||!isFinite(N[W]))continue e;for(U=0;U<3;++U){var Z,Y,X,$;N=n[Z=G[2-U]],i.push(N[0],N[1],N[2]),(Y=S?S[Z]:E?E[R]:C)?this.opacityscale&&L?a.push(Y[0],Y[1],Y[2],this.opacity*A((L[Z]-D)/(O-D),this.opacityscale)):3===Y.length?a.push(Y[0],Y[1],Y[2],this.opacity):(a.push(Y[0],Y[1],Y[2],Y[3]*this.opacity),Y[3]<1&&(this.hasAlpha=!0)):a.push(.5,.5,.5,1),X=I?I[Z]:L?[(L[Z]-D)/(O-D),0]:P?P[R]:z?[(z[R]-D)/(O-D),0]:[(N[2]-D)/(O-D),0],c.push(X[0],X[1]),$=w?w[Z]:T[R],l.push($[0],$[1],$[2]),f.push(R)}V+=1}}this.pointCount=H,this.edgeCount=q,this.triangleCount=V,this.pointPositions.update(y),this.pointColors.update(v),this.pointUVs.update(x),this.pointSizes.update(_),this.pointIds.update(new Uint32Array(b)),this.edgePositions.update(p),this.edgeColors.update(d),this.edgeUVs.update(m),this.edgeIds.update(new Uint32Array(g)),this.trianglePositions.update(i),this.triangleColors.update(a),this.triangleUVs.update(c),this.triangleNormals.update(l),this.triangleIds.update(new Uint32Array(f))}},k.drawTransparent=k.draw=function(e){e=e||{};for(var t=this.gl,r=e.model||w,n=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:r,view:n,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=c(s.inverseModel,s.model),t.disable(t.CULL_FACE),this.texture.bind(0);var u,h=new Array(16);for(l(h,s.view,s.model),l(h,s.projection,h),c(h,h),o=0;o<3;++o)s.eyePosition[o]=h[12+o]/h[15];var f=h[15];for(o=0;o<3;++o)f+=this.lightPosition[o]*h[4*o+3];for(o=0;o<3;++o){for(var p=h[12+o],d=0;d<3;++d)p+=h[4*d+o]*this.lightPosition[d];s.lightPosition[o]=p/f}this.triangleCount>0&&((u=this.triShader).bind(),u.uniforms=s,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((u=this.lineShader).bind(),u.uniforms=s,this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((u=this.pointShader).bind(),u.uniforms=s,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((u=this.contourShader).bind(),u.uniforms=s,this.contourVAO.bind(),t.drawArrays(t.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||w,n=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(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.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],r=this.cells[t],n=this.positions,i=new Array(r.length),a=0;a<r.length;++a)i[a]=n[r[a]];var o=e.coord[0],s=e.coord[1];if(!this.pickVertex){var l=this.positions[r[0]],c=this.positions[r[1]],u=this.positions[r[2]],h=[(l[0]+c[0]+u[0])/3,(l[1]+c[1]+u[1])/3,(l[2]+c[2]+u[2])/3];return{_cellCenter:!0,position:[o,s],index:t,cell:r,cellId:t,intensity:this.intensity[t],dataCoordinate:h}}var f=m(i,[o*this.pixelRatio,this._resolution[1]-s*this.pixelRatio],this._model,this._view,this._projection,this._resolution);if(!f)return null;var p=f[2],d=0;for(a=0;a<r.length;++a)d+=p[a]*this.intensity[r[a]];return{position:f[1],index:r[f[0]],cell:r,cellId:t,intensity:d,dataCoordinate:this.positions[r[f[0]]]}},k.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()},e.exports=function(e,t){if(1===arguments.length&&(e=(t=e).gl),!(e.getExtension("OES_standard_derivatives")||e.getExtension("MOZ_OES_standard_derivatives")||e.getExtension("WEBKIT_OES_standard_derivatives")))throw new Error("derivatives not supported");var r=function(e){var t=n(e,g.vertex,g.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t.attributes.normal.location=4,t}(e),s=function(e){var t=n(e,y.vertex,y.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t}(e),l=function(e){var t=n(e,v.vertex,v.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t.attributes.pointSize.location=4,t}(e),c=function(e){var t=n(e,x.vertex,x.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t}(e),h=function(e){var t=n(e,_.vertex,_.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t.attributes.pointSize.location=4,t}(e),f=function(e){var t=n(e,b.vertex,b.fragment);return t.attributes.position.location=0,t}(e),p=o(e,u(new Uint8Array([255,255,255,255]),[1,1,4]));p.generateMipmap(),p.minFilter=e.LINEAR_MIPMAP_LINEAR,p.magFilter=e.LINEAR;var d=i(e),m=i(e),w=i(e),k=i(e),A=i(e),M=a(e,[{buffer:d,type:e.FLOAT,size:3},{buffer:A,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:e.FLOAT,size:4},{buffer:w,type:e.FLOAT,size:2},{buffer:k,type:e.FLOAT,size:3}]),S=i(e),E=i(e),C=i(e),I=i(e),L=a(e,[{buffer:S,type:e.FLOAT,size:3},{buffer:I,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:E,type:e.FLOAT,size:4},{buffer:C,type:e.FLOAT,size:2}]),P=i(e),z=i(e),D=i(e),O=i(e),R=i(e),F=a(e,[{buffer:P,type:e.FLOAT,size:3},{buffer:R,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:z,type:e.FLOAT,size:4},{buffer:D,type:e.FLOAT,size:2},{buffer:O,type:e.FLOAT,size:1}]),B=i(e),j=new T(e,p,r,s,l,c,h,f,d,A,m,w,k,M,S,I,E,C,L,P,R,z,D,O,F,B,a(e,[{buffer:B,type:e.FLOAT,size:3}]));return j.update(t),j}},4437:function(e,t,r){e.exports=function(e,t){e=e||document.body;var r=[.01,1/0];"distanceLimits"in(t=t||{})&&(r[0]=t.distanceLimits[0],r[1]=t.distanceLimits[1]),"zoomMin"in t&&(r[0]=t.zoomMin),"zoomMax"in t&&(r[1]=t.zoomMax);var c=i({center:t.center||[0,0,0],up:t.up||[0,1,0],eye:t.eye||[0,0,10],mode:t.mode||"orbit",distanceLimits:r}),u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0,f=e.clientWidth,p=e.clientHeight,d={keyBindingMode:"rotate",enableWheel:!0,view:c,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:c.modes,_ortho:t._ortho||t.projection&&"orthographic"===t.projection.type||!1,tick:function(){var t=n(),r=this.delay,i=t-2*r;c.idle(t-r),c.recalcMatrix(i),c.flush(t-(100+2*r));for(var a=!0,o=c.computedMatrix,s=0;s<16;++s)a=a&&u[s]===o[s],u[s]=o[s];var l=e.clientWidth===f&&e.clientHeight===p;return f=e.clientWidth,p=e.clientHeight,a?!l:(h=Math.exp(c.computedRadius[0]),!0)},lookAt:function(e,t,r){c.lookAt(c.lastT(),e,t,r)},rotate:function(e,t,r){c.rotate(c.lastT(),e,t,r)},pan:function(e,t,r){c.pan(c.lastT(),e,t,r)},translate:function(e,t,r){c.translate(c.lastT(),e,t,r)}};return Object.defineProperties(d,{matrix:{get:function(){return c.computedMatrix},set:function(e){return c.setMatrix(c.lastT(),e),c.computedMatrix},enumerable:!0},mode:{get:function(){return c.getMode()},set:function(e){var t=c.computedUp.slice(),r=c.computedEye.slice(),i=c.computedCenter.slice();if(c.setMode(e),"turntable"===e){var a=n();c._active.lookAt(a,r,i,t),c._active.lookAt(a+500,r,i,[0,0,1]),c._active.flush(a)}return c.getMode()},enumerable:!0},center:{get:function(){return c.computedCenter},set:function(e){return c.lookAt(c.lastT(),null,e),c.computedCenter},enumerable:!0},eye:{get:function(){return c.computedEye},set:function(e){return c.lookAt(c.lastT(),e),c.computedEye},enumerable:!0},up:{get:function(){return c.computedUp},set:function(e){return c.lookAt(c.lastT(),null,null,e),c.computedUp},enumerable:!0},distance:{get:function(){return h},set:function(e){return c.setDistance(c.lastT(),e),e},enumerable:!0},distanceLimits:{get:function(){return c.getDistanceLimits(r)},set:function(e){return c.setDistanceLimits(e),e},enumerable:!0}}),e.addEventListener("contextmenu",(function(e){return e.preventDefault(),!1})),d._lastX=-1,d._lastY=-1,d._lastMods={shift:!1,control:!1,alt:!1,meta:!1},d.enableMouseListeners=function(){function t(t,r,i,a){var o=d.keyBindingMode;if(!1!==o){var s="rotate"===o,l="pan"===o,u="zoom"===o,f=!!a.control,p=!!a.alt,m=!!a.shift,g=!!(1&t),y=!!(2&t),v=!!(4&t),x=1/e.clientHeight,_=x*(r-d._lastX),b=x*(i-d._lastY),w=d.flipX?1:-1,T=d.flipY?1:-1,k=Math.PI*d.rotateSpeed,A=n();if(-1!==d._lastX&&-1!==d._lastY&&((s&&g&&!f&&!p&&!m||g&&!f&&!p&&m)&&c.rotate(A,w*k*_,-T*k*b,0),(l&&g&&!f&&!p&&!m||y||g&&f&&!p&&!m)&&c.pan(A,-d.translateSpeed*_*h,d.translateSpeed*b*h,0),u&&g&&!f&&!p&&!m||v||g&&!f&&p&&!m)){var M=-d.zoomSpeed*b/window.innerHeight*(A-c.lastT())*100;c.pan(A,0,0,h*(Math.exp(M)-1))}return d._lastX=r,d._lastY=i,d._lastMods=a,!0}}d.mouseListener=a(e,t),e.addEventListener("touchstart",(function(r){var n=s(r.changedTouches[0],e);t(0,n[0],n[1],d._lastMods),t(1,n[0],n[1],d._lastMods)}),!!l&&{passive:!0}),e.addEventListener("touchmove",(function(r){var n=s(r.changedTouches[0],e);t(1,n[0],n[1],d._lastMods),r.preventDefault()}),!!l&&{passive:!1}),e.addEventListener("touchend",(function(e){t(0,d._lastX,d._lastY,d._lastMods)}),!!l&&{passive:!0}),d.wheelListener=o(e,(function(e,t){if(!1!==d.keyBindingMode&&d.enableWheel){var r=d.flipX?1:-1,i=d.flipY?1:-1,a=n();if(Math.abs(e)>Math.abs(t))c.rotate(a,0,0,-e*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*i*t/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,h*(Math.exp(o)-1))}}}),!0)},d.enableMouseListeners(),d};var n=r(3025),i=r(6296),a=r(351),o=r(8512),s=r(24),l=r(7520)},799:function(e,t,r){var n=r(3236),i=r(9405),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(e){return i(e,a,o,null,[{name:"position",type:"vec2"}])}},4100:function(e,t,r){var n=r(4437),i=r(3837),a=r(5445),o=r(4449),s=r(3589),l=r(2260),c=r(7169),u=r(351),h=r(4772),f=r(4040),p=r(799),d=r(9216)({tablet:!0,featureDetect:!0});function m(){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){var t=Math.round(Math.log(Math.abs(e))/Math.log(10));if(t<0){var r=Math.round(Math.pow(10,-t));return Math.ceil(e*r)/r}return t>0?(r=Math.round(Math.pow(10,t)),Math.ceil(e/r)*r):Math.ceil(e)}function y(e){return"boolean"!=typeof e||e}e.exports={createScene:function(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 r=e.gl;if(r||(e.glOptions&&(d=!!e.glOptions.preserveDrawingBuffer),r=function(e,t){var r=null;try{(r=e.getContext("webgl",t))||(r=e.getContext("experimental-webgl",t))}catch{return null}return r}(t,e.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d})),!r)throw new Error("webgl not supported");var v=e.bounds||[[-10,-10,-10],[10,10,10]],x=new m,_=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),b=p(r),w=e.cameraObject&&!0===e.cameraObject._ortho||e.camera.projection&&"orthographic"===e.camera.projection.type||!1,T={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:w},k=e.axes||{},A=i(r,k);A.enable=!k.disable;var M=e.spikes||{},S=o(r,M),E=[],C=[],I=[],L=[],P=!0,z=!0,D={view:null,projection:new Array(16),model:new Array(16),_ortho:!1},O=(z=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),R=e.cameraObject||n(t,T),F={gl:r,contextLost:!1,pixelRatio:e.pixelRatio||1,canvas:t,selection:x,camera:R,axes:A,axesPixels:null,spikes:S,bounds:v,objects:E,shape:O,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:y(e.autoResize),autoBounds:y(e.autoBounds),autoScale:!!e.autoScale,autoCenter:y(e.autoCenter),clipToBounds:y(e.clipToBounds),snapToData:!!e.snapToData,onselect:e.onselect||null,onrender:e.onrender||null,onclick:e.onclick||null,cameraParams:D,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,z=!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)}},B=[r.drawingBufferWidth/F.pixelRatio|0,r.drawingBufferHeight/F.pixelRatio|0];function j(){if(!F._stopped&&F.autoResize){var e=t.parentNode,r=1,n=1;e&&e!==document.body?(r=e.clientWidth,n=e.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*F.pixelRatio),a=0|Math.ceil(n*F.pixelRatio);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=r+"px",o.height=n+"px",P=!0}}}function N(){for(var e=E.length,t=L.length,n=0;n<t;++n)I[n]=0;e:for(n=0;n<e;++n){var i=E[n],a=i.pickSlots;if(a){for(var o=0;o<t;++o)if(I[o]+a<255){C[n]=o,i.setPickBase(I[o]+1),I[o]+=a;continue e}var l=s(r,O);C[n]=t,L.push(l),I.push(a),i.setPickBase(1),t+=1}else C[n]=-1}for(;t>0&&0===I[t-1];)I.pop(),L.pop().dispose()}function U(){if(F.contextLost)return!0;r.isContextLost()&&(F.contextLost=!0,F.mouseListener.enabled=!1,F.selection.object=null,F.oncontextloss&&F.oncontextloss())}F.autoResize&&j(),window.addEventListener("resize",j),F.update=function(e){F._stopped||(e=e||{},P=!0,z=!0)},F.add=function(e){F._stopped||(e.axes=A,E.push(e),C.push(-1),P=!0,z=!0,N())},F.remove=function(e){if(!F._stopped){var t=E.indexOf(e);t<0||(E.splice(t,1),C.pop(),P=!0,z=!0,N())}},F.dispose=function(){if(!F._stopped&&(F._stopped=!0,window.removeEventListener("resize",j),t.removeEventListener("webglcontextlost",U),F.mouseListener.enabled=!1,!F.contextLost)){A.dispose(),S.dispose();for(var e=0;e<E.length;++e)E[e].dispose();for(_.dispose(),e=0;e<L.length;++e)L[e].dispose();b.dispose(),r=null,A=null,S=null,E=[]}},F._mouseRotating=!1,F._prevButtons=0,F.enableMouseListeners=function(){F.mouseListener=u(t,(function(e,t,r){if(!F._stopped){var n=L.length,i=E.length,a=x.object;x.distance=1/0,x.mouse[0]=t,x.mouse[1]=r,x.object=null,x.screen=null,x.dataCoordinate=x.dataPosition=null;var o=!1;if(e&&F._prevButtons)F._mouseRotating=!0;else{F._mouseRotating&&(z=!0),F._mouseRotating=!1;for(var s=0;s<n;++s){var l=L[s].query(t,B[1]-r-1,F.pickRadius);if(l){if(l.distance>x.distance)continue;for(var c=0;c<i;++c){var u=E[c];if(C[c]===s){var h=u.pick(l);h&&(x.buttons=e,x.screen=l.coord,x.distance=l.distance,x.object=u,x.index=h.distance,x.dataPosition=h.position,x.dataCoordinate=h.dataCoordinate,x.data=h,o=!0)}}}}}a&&a!==x.object&&(a.highlight&&a.highlight(null),P=!0),x.object&&(x.object.highlight&&x.object.highlight(x.data),P=!0),(o=o||x.object!==a)&&F.onselect&&F.onselect(x),1&e&&!(1&F._prevButtons)&&F.onclick&&F.onclick(x),F._prevButtons=e}}))},t.addEventListener("webglcontextlost",U);var V=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],q=[V[0].slice(),V[1].slice()];function H(){if(!U()){j();var e=F.camera.tick();D.view=F.camera.matrix,P=P||e,z=z||e,A.pixelRatio=F.pixelRatio,S.pixelRatio=F.pixelRatio;var t=E.length,n=V[0],i=V[1];n[0]=n[1]=n[2]=1/0,i[0]=i[1]=i[2]=-1/0;for(var o=0;o<t;++o){(I=E[o]).pixelRatio=F.pixelRatio,I.axes=F.axes,P=P||!!I.dirty,z=z||!!I.dirty;var s=I.bounds;if(s)for(var l=s[0],u=s[1],p=0;p<3;++p)n[p]=Math.min(n[p],l[p]),i[p]=Math.max(i[p],u[p])}var d=F.bounds;if(F.autoBounds)for(p=0;p<3;++p){if(i[p]<n[p])n[p]=-1,i[p]=1;else{n[p]===i[p]&&(n[p]-=1,i[p]+=1);var m=.05*(i[p]-n[p]);n[p]=n[p]-m,i[p]=i[p]+m}d[0][p]=n[p],d[1][p]=i[p]}var y=!1;for(p=0;p<3;++p)y=y||q[0][p]!==d[0][p]||q[1][p]!==d[1][p],q[0][p]=d[0][p],q[1][p]=d[1][p];if(z=z||y,P=P||y){if(y){var v=[0,0,0];for(o=0;o<3;++o)v[o]=g((d[1][o]-d[0][o])/10);A.autoTicks?A.update({bounds:d,tickSpacing:v}):A.update({bounds:d})}var T=r.drawingBufferWidth,k=r.drawingBufferHeight;for(O[0]=T,O[1]=k,B[0]=0|Math.max(T/F.pixelRatio,1),B[1]=0|Math.max(k/F.pixelRatio,1),function(e,t){var r=e.bounds,n=e.cameraParams,i=n.projection,a=n.model,o=e.gl.drawingBufferWidth,s=e.gl.drawingBufferHeight,l=e.zNear,c=e.zFar,u=e.fovy,p=o/s;t?(f(i,-p,p,-1,1,l,c),n._ortho=!0):(h(i,u,p,l,c),n._ortho=!1);for(var d=0;d<16;++d)a[d]=0;a[15]=1;var m=0;for(d=0;d<3;++d)m=Math.max(m,r[1][d]-r[0][d]);for(d=0;d<3;++d)e.autoScale?a[5*d]=e.aspect[d]/(r[1][d]-r[0][d]):a[5*d]=1/m,e.autoCenter&&(a[12+d]=.5*-a[5*d]*(r[0][d]+r[1][d]))}(F,w),o=0;o<t;++o)(I=E[o]).axesBounds=d,F.clipToBounds&&(I.clipBounds=d);x.object&&(F.snapToData?S.position=x.dataCoordinate:S.position=x.dataPosition,S.bounds=d),z&&(z=!1,function(){if(!U()){r.colorMask(!0,!0,!0,!0),r.depthMask(!0),r.disable(r.BLEND),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL);for(var e=E.length,t=L.length,n=0;n<t;++n){var i=L[n];i.shape=B,i.begin();for(var a=0;a<e;++a)if(C[a]===n){var o=E[a];o.drawPick&&(o.pixelRatio=1,o.drawPick(D))}i.end()}}}()),F.axesPixels=a(F.axes,D,T,k),F.onrender&&F.onrender(),r.bindFramebuffer(r.FRAMEBUFFER,null),r.viewport(0,0,T,k),F.clearRGBA(),r.depthMask(!0),r.colorMask(!0,!0,!0,!0),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL),r.disable(r.BLEND),r.disable(r.CULL_FACE);var M=!1;for(A.enable&&(M=M||A.isTransparent(),A.draw(D)),S.axes=A,x.object&&S.draw(D),r.disable(r.CULL_FACE),o=0;o<t;++o)(I=E[o]).axes=A,I.pixelRatio=F.pixelRatio,I.isOpaque&&I.isOpaque()&&I.draw(D),I.isTransparent&&I.isTransparent()&&(M=!0);if(M){for(_.shape=O,_.bind(),r.clear(r.DEPTH_BUFFER_BIT),r.colorMask(!1,!1,!1,!1),r.depthMask(!0),r.depthFunc(r.LESS),A.enable&&A.isTransparent()&&A.drawTransparent(D),o=0;o<t;++o)(I=E[o]).isOpaque&&I.isOpaque()&&I.draw(D);for(r.enable(r.BLEND),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.colorMask(!0,!0,!0,!0),r.depthMask(!1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),A.isTransparent()&&A.drawTransparent(D),o=0;o<t;++o){var I;(I=E[o]).isTransparent&&I.isTransparent()&&I.drawTransparent(D)}r.bindFramebuffer(r.FRAMEBUFFER,null),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.disable(r.DEPTH_TEST),b.bind(),_.color[0].bind(0),b.uniforms.accumBuffer=0,c(r),r.disable(r.BLEND)}for(P=!1,o=0;o<t;++o)E[o].dirty=!1}}}return F.enableMouseListeners(),function e(){F._stopped||F.contextLost||(H(),requestAnimationFrame(e))}(),F.redraw=function(){F._stopped||(P=!0,H())},F},createCamera:n}},783:function(e){e.exports=function(e,t,r,n){var i,a,o,s,l,c=t[0],u=t[1],h=t[2],f=t[3],p=r[0],d=r[1],m=r[2],g=r[3];return(a=c*p+u*d+h*m+f*g)<0&&(a=-a,p=-p,d=-d,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),e[0]=s*c+l*p,e[1]=s*u+l*d,e[2]=s*h+l*m,e[3]=s*f+l*g,e}},5964:function(e){e.exports=function(e){return e||0===e?e.toString():""}},9366:function(e,t,r){var n=r(4359);e.exports=function(e,t,r){var a=[t.style,t.weight,t.variant,t.family].join("_"),o=i[a];if(o||(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},triangles:!0},l=n(e,s);s.triangles=!1;var c,u,h=n(e,s);if(r&&1!==r){for(c=0;c<l.positions.length;++c)for(u=0;u<l.positions[c].length;++u)l.positions[c][u]/=r;for(c=0;c<h.positions.length;++c)for(u=0;u<h.positions[c].length;++u)h.positions[c][u]/=r}var f=[[1/0,1/0],[-1/0,-1/0]],p=h.positions.length;for(c=0;c<p;++c){var d=h.positions[c];for(u=0;u<2;++u)f[0][u]=Math.min(f[0][u],d[u]),f[1][u]=Math.max(f[1][u],d[u])}return o[e]=[l,h,f]};var i={}},1283:function(e,t,r){var n=r(9405),i=r(3236),a=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * (view * (model * vec4(position, 1)));\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1)));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:a,fragment:l,attributes:u},f={vertex:o,fragment:l,attributes:u},p={vertex:s,fragment:l,attributes:u},d={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};function y(e,t){var r=n(e,t),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}t.createPerspective=function(e){return y(e,h)},t.createOrtho=function(e){return y(e,f)},t.createProject=function(e){return y(e,p)},t.createPickPerspective=function(e){return y(e,d)},t.createPickOrtho=function(e){return y(e,m)},t.createPickProject=function(e){return y(e,g)}},8418:function(e,t,r){var n=r(5219),i=r(2762),a=r(8116),o=r(1888),s=r(6760),l=r(1283),c=r(9366),u=r(5964),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],f=ArrayBuffer,p=DataView;function d(e){return Array.isArray(e)||function(e){return f.isView(e)&&!(e instanceof p)}(e)}function m(e,t){var r=e[0],n=e[1],i=e[2],a=e[3];return e[0]=t[0]*r+t[4]*n+t[8]*i+t[12]*a,e[1]=t[1]*r+t[5]*n+t[9]*i+t[13]*a,e[2]=t[2]*r+t[6]*n+t[10]*i+t[14]*a,e[3]=t[3]*r+t[7]*n+t[11]*i+t[15]*a,e}function g(e,t,r,n){return m(n,n),m(n,n),m(n,n)}function y(e,t){this.index=e,this.dataCoordinate=this.position=t}function v(e){return!0===e||e>1?1:e}function x(e,t,r,n,i,a,o,s,l,c,u,h){this.gl=e,this.pixelRatio=1,this.shader=t,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,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=c,this.pickOrthoShader=u,this.pickProjectShader=h,this.points=[],this._selectResult=new y(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}e.exports=function(e){var t=e.gl,r=l.createPerspective(t),n=l.createOrtho(t),o=l.createProject(t),s=l.createPickPerspective(t),c=l.createPickOrtho(t),u=l.createPickProject(t),h=i(t),f=i(t),p=i(t),d=i(t),m=new x(t,r,n,o,h,f,p,d,a(t,[{buffer:h,size:3,type:t.FLOAT},{buffer:f,size:4,type:t.FLOAT},{buffer:p,size:2,type:t.FLOAT},{buffer:d,size:4,type:t.UNSIGNED_BYTE,normalized:!0}]),s,c,u);return m.update(e),m};var _=x.prototype;_.pickSlots=1,_.setPickBase=function(e){this.pickId=e},_.isTransparent=function(){if(this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&this.projectHasAlpha)return!0;return!1},_.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 b=[0,0],w=[0,0,0],T=[0,0,0],k=[0,0,0,1],A=[0,0,0,1],M=h.slice(),S=[0,0,0],E=[[0,0,0],[0,0,0]];function C(e){return e[0]=e[1]=e[2]=0,e}function I(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=1,e}function L(e,t,r,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[r]=n,e}var P=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function z(e,t,r,n,i,a,o){var l=r.gl;if((a===r.projectHasAlpha||o)&&function(e,t,r,n){var i,a=t.axesProject,o=t.gl,l=e.uniforms,c=r.model||h,u=r.view||h,f=r.projection||h,p=t.axesBounds,d=function(e){for(var t=E,r=0;r<2;++r)for(var n=0;n<3;++n)t[r][n]=Math.max(Math.min(e[r][n],1e8),-1e8);return t}(t.clipBounds);i=t.axes&&t.axes.lastCubeProps?t.axes.lastCubeProps.axis:[1,1,1],b[0]=2/o.drawingBufferWidth,b[1]=2/o.drawingBufferHeight,e.bind(),l.view=u,l.projection=f,l.screenSize=b,l.highlightId=t.highlightId,l.highlightScale=t.highlightScale,l.clipBounds=d,l.pickGroup=t.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(a[m]){l.scale=t.projectScale[m],l.opacity=t.projectOpacity[m];for(var y=M,v=0;v<16;++v)y[v]=0;for(v=0;v<4;++v)y[5*v]=1;y[5*m]=0,i[m]<0?y[12+m]=p[0][m]:y[12+m]=p[1][m],s(y,c,y),l.model=y;var x=(m+1)%3,_=(m+2)%3,P=C(w),z=C(T);P[x]=1,z[_]=1;var D=g(0,0,0,I(k,P)),O=g(0,0,0,I(A,z));if(Math.abs(D[1])>Math.abs(O[1])){var R=D;D=O,O=R,R=P,P=z,z=R;var F=x;x=_,_=F}D[0]<0&&(P[x]=-1),O[1]>0&&(z[_]=-1);var B=0,j=0;for(v=0;v<4;++v)B+=Math.pow(c[4*x+v],2),j+=Math.pow(c[4*_+v],2);P[x]/=Math.sqrt(B),z[_]/=Math.sqrt(j),l.axes[0]=P,l.axes[1]=z,l.fragClipBounds[0]=L(S,d[0],m,-1e8),l.fragClipBounds[1]=L(S,d[1],m,1e8),t.vao.bind(),t.vao.draw(o.TRIANGLES,t.vertexCount),t.lineWidth>0&&(o.lineWidth(t.lineWidth*n),t.vao.draw(o.LINES,t.lineVertexCount,t.vertexCount)),t.vao.unbind()}}(t,r,n,i),a===r.hasAlpha||o){e.bind();var c=e.uniforms;c.model=n.model||h,c.view=n.view||h,c.projection=n.projection||h,b[0]=2/l.drawingBufferWidth,b[1]=2/l.drawingBufferHeight,c.screenSize=b,c.highlightId=r.highlightId,c.highlightScale=r.highlightScale,c.fragClipBounds=P,c.clipBounds=r.axes.bounds,c.opacity=r.opacity,c.pickGroup=r.pickId/255,c.pixelRatio=i,r.vao.bind(),r.vao.draw(l.TRIANGLES,r.vertexCount),r.lineWidth>0&&(l.lineWidth(r.lineWidth*i),r.vao.draw(l.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function D(e,t,r,i){var a;a=d(e)?t<e.length?e[t]:void 0:e,a=u(a);var o=!0;n(a)&&(a="▼",o=!1),r||(r={});var s=r.family;d(s)&&(s=s[t]),s||(s="normal");var l=r.weight;d(l)&&(l=l[t]),l||(l="normal");var h=r.style;d(h)&&(h=h[t]),h||(h="normal");var f=r.variant;d(f)&&(f=f[t]),f||(f="normal");var p=c(a,{family:s,weight:l,style:h,variant:f},i);return{mesh:(p=c(a,r,i))[0],lines:p[1],bounds:p[2],visible:o}}_.draw=function(e){z(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,e,this.pixelRatio,!1,!1)},_.drawTransparent=function(e){z(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,e,this.pixelRatio,!0,!1)},_.drawPick=function(e){z(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,e,1,!0,!0)},_.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 r=this.points[t],n=this._selectResult;n.index=t;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(e){if(e){var t=e.index,r=255&t,n=t>>8&255,i=t>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(e){if("perspective"in(e=e||{})&&(this.useOrtho=!e.perspective),"orthographic"in e&&(this.useOrtho=!!e.orthographic),"lineWidth"in e&&(this.lineWidth=e.lineWidth),"project"in e)if(d(e.project))this.axesProject=e.project;else{var t=!!e.project;this.axesProject=[t,t,t]}if("projectScale"in e)if(d(e.projectScale))this.projectScale=e.projectScale.slice();else{var r=+e.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in e){d(e.projectOpacity)?this.projectOpacity=e.projectOpacity.slice():(r=+e.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=v(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in e&&(this.opacity=v(e.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=e.position,l={family:e.font||"normal",style:e.fontStyle||"normal",weight:e.fontWeight||"normal",variant:e.fontVariant||"normal"},c=e.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else for(i=[],a=[],n=0;n<c.length;++n)i[n]=c[n][0],a[n]=c[n][1];var u=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0],f=e.glyph,p=e.color,m=e.size,g=e.angle,y=e.lineColor,x=-1,_=0,b=0,w=0;if(s.length){w=s.length;e:for(n=0;n<w;++n){for(var T=s[n],k=0;k<3;++k)if(isNaN(T[k])||!isFinite(T[k]))continue e;var A=(N=D(f,n,l,this.pixelRatio)).mesh,M=N.lines,S=N.bounds;_+=3*A.cells.length,b+=2*M.edges.length}}var E=_+b,C=o.mallocFloat(3*E),I=o.mallocFloat(4*E),L=o.mallocFloat(2*E),P=o.mallocUint32(E);if(E>0){var z=0,O=_,R=[0,0,0,1],F=[0,0,0,1],B=d(p)&&d(p[0]),j=d(y)&&d(y[0]);e:for(n=0;n<w;++n){for(x+=1,T=s[n],k=0;k<3;++k){if(isNaN(T[k])||!isFinite(T[k]))continue e;h[k]=Math.max(h[k],T[k]),u[k]=Math.min(u[k],T[k])}A=(N=D(f,n,l,this.pixelRatio)).mesh,M=N.lines,S=N.bounds;var N,U=N.visible;if(U)if(d(p)){if(3===(V=B?n<p.length?p[n]:[0,0,0,0]:p).length){for(k=0;k<3;++k)R[k]=V[k];R[3]=1}else if(4===V.length){for(k=0;k<4;++k)R[k]=V[k];!this.hasAlpha&&V[3]<1&&(this.hasAlpha=!0)}}else R[0]=R[1]=R[2]=0,R[3]=1;else R=[1,1,1,0];if(U)if(d(y)){var V;if(3===(V=j?n<y.length?y[n]:[0,0,0,0]:y).length){for(k=0;k<3;++k)F[k]=V[k];F[k]=1}else if(4===V.length){for(k=0;k<4;++k)F[k]=V[k];!this.hasAlpha&&V[3]<1&&(this.hasAlpha=!0)}}else F[0]=F[1]=F[2]=0,F[3]=1;else F=[1,1,1,0];var q=.5;U?d(m)?q=n<m.length?+m[n]:12:m?q=+m:this.useOrtho&&(q=12):q=0;var H=0;d(g)?H=n<g.length?+g[n]:0:g&&(H=+g);var G=Math.cos(H),W=Math.sin(H);for(T=s[n],k=0;k<3;++k)h[k]=Math.max(h[k],T[k]),u[k]=Math.min(u[k],T[k]);var Z=i,Y=a;Z=0,d(i)?Z=n<i.length?i[n]:0:i&&(Z=i),Y=0,d(a)?Y=n<a.length?a[n]:0:a&&(Y=a);var X=[Z*=Z>0?1-S[0][0]:Z<0?1+S[1][0]:1,Y*=Y>0?1-S[0][1]:Y<0?1+S[1][1]:1],$=A.cells||[],K=A.positions||[];for(k=0;k<$.length;++k)for(var J=$[k],Q=0;Q<3;++Q){for(var ee=0;ee<3;++ee)C[3*z+ee]=T[ee];for(ee=0;ee<4;++ee)I[4*z+ee]=R[ee];P[z]=x;var te=K[J[Q]];L[2*z]=q*(G*te[0]-W*te[1]+X[0]),L[2*z+1]=q*(W*te[0]+G*te[1]+X[1]),z+=1}for($=M.edges,K=M.positions,k=0;k<$.length;++k)for(J=$[k],Q=0;Q<2;++Q){for(ee=0;ee<3;++ee)C[3*O+ee]=T[ee];for(ee=0;ee<4;++ee)I[4*O+ee]=F[ee];P[O]=x,te=K[J[Q]],L[2*O]=q*(G*te[0]-W*te[1]+X[0]),L[2*O+1]=q*(W*te[0]+G*te[1]+X[1]),O+=1}}}this.bounds=[u,h],this.points=s,this.pointCount=s.length,this.vertexCount=_,this.lineVertexCount=b,this.pointBuffer.update(C),this.colorBuffer.update(I),this.glyphBuffer.update(L),this.idBuffer.update(P),o.free(C),o.free(I),o.free(L),o.free(P)},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},3589:function(e,t,r){e.exports=function(e,t){var r=t[0],a=t[1];return new l(e,n(e,r,a,{}),i.mallocUint8(r*a*4))};var n=r(2260),i=r(1888),a=r(9618),o=r(8828).nextPow2;function s(e,t,r,n,i){this.coord=[e,t],this.id=r,this.value=n,this.distance=i}function l(e,t,r){this.gl=e,this.fbo=t,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(t.bind(),e.readPixels(0,0,t.shape[0],t.shape[1],e.RGBA,e.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var c=l.prototype;Object.defineProperty(c,"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],r=this.fbo.shape[1];if(r*t*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*t*4)),a=0;a<r*t*4;++a)n[a]=255}return e}}}),c.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))},c.end=function(){var e=this.gl;e&&(e.bindFramebuffer(e.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},c.query=function(e,t,r){if(!this.gl)return null;var n=this.fbo.shape.slice();e|=0,t|=0,"number"!=typeof r&&(r=1);var i=0|Math.min(Math.max(e-r,0),n[0]),o=0|Math.min(Math.max(e+r,0),n[0]),l=0|Math.min(Math.max(t-r,0),n[1]),c=0|Math.min(Math.max(t+r,0),n[1]);if(o<=i||c<=l)return null;var u=[o-i,c-l],h=a(this.buffer,[u[0],u[1],4],[4,4*n[0],1],4*(i+n[0]*l)),f=function(e,t,r){for(var n=1e8,i=-1,a=-1,o=e.shape[0],s=e.shape[1],l=0;l<o;l++)for(var c=0;c<s;c++){var u=e.get(l,c,0),h=e.get(l,c,1),f=e.get(l,c,2),p=e.get(l,c,3);if(u<255||h<255||f<255||p<255){var d=t-l,m=r-c,g=d*d+m*m;g<n&&(n=g,i=l,a=c)}}return[i,a,n]}(h.hi(u[0],u[1],1),r,r),p=f[0],d=f[1];return p<0||Math.pow(this.radius,2)<f[2]?null:new s(p+i|0,d+l|0,h.get(p,d,0),[h.get(p,d,1),h.get(p,d,2),h.get(p,d,3)],Math.sqrt(f[2]))},c.dispose=function(){this.gl&&(this.fbo.dispose(),i.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},9405:function(e,t,r){var n=r(3327),i=r(8731),a=r(216),o=r(5091),s=r(2145),l=r(8866);function c(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=c.prototype;function h(e,t){return e.name<t.name?-1:1}u.bind=function(){this.program||this._relink();var e,t=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(t>r)for(e=r;e<t;e++)this.gl.enableVertexAttribArray(e);else if(r>t)for(e=t;e<r;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},u.update=function(e,t,r,c){if(!t||1===arguments.length){var u=e;e=u.vertex,t=u.fragment,r=u.uniforms,c=u.attributes}var f=this,p=f.gl,d=f._vref;f._vref=o.shader(p,p.VERTEX_SHADER,e),d&&d.dispose(),f.vertShader=f._vref.shader;var m=this._fref;if(f._fref=o.shader(p,p.FRAGMENT_SHADER,t),m&&m.dispose(),f.fragShader=f._fref.shader,!r||!c){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 y=p.getProgramInfoLog(g);throw new l(y,"Error linking program:"+y)}r=r||s.uniforms(p,g),c=c||s.attributes(p,g),p.deleteProgram(g)}(c=c.slice()).sort(h);var v,x=[],_=[],b=[];for(v=0;v<c.length;++v){var w=c[v];if(w.type.indexOf("mat")>=0){for(var T=0|w.type.charAt(w.type.length-1),k=new Array(T),A=0;A<T;++A)k[A]=b.length,_.push(w.name+"["+A+"]"),"number"==typeof w.location?b.push(w.location+A):Array.isArray(w.location)&&w.location.length===T&&"number"==typeof w.location[A]?b.push(0|w.location[A]):b.push(-1);x.push({name:w.name,type:w.type,locations:k})}else x.push({name:w.name,type:w.type,locations:[b.length]}),_.push(w.name),"number"==typeof w.location?b.push(0|w.location):b.push(-1)}var M=0;for(v=0;v<b.length;++v)if(b[v]<0){for(;b.indexOf(M)>=0;)M+=1;b[v]=M}var S=new Array(r.length);function E(){f.program=o.program(p,f._vref,f._fref,_,b);for(var e=0;e<r.length;++e)S[e]=p.getUniformLocation(f.program,r[e].name)}E(),f._relink=E,f.types={uniforms:a(r),attributes:a(c)},f.attributes=i(p,f,x,b),Object.defineProperty(f,"uniforms",n(p,f,r,S))},e.exports=function(e,t,r,n,i){var a=new c(e);return a.update(t,r,n,i),a}},8866:function(e){function t(e,t,r){this.shortMessage=t||"",this.longMessage=r||"",this.rawError=e||"",this.message="gl-shader: "+(t||e||"")+(r?"\n"+r:""),this.stack=(new Error).stack}t.prototype=new Error,t.prototype.name="GLError",t.prototype.constructor=t,e.exports=t},8731:function(e,t,r){e.exports=function(e,t,r,i){for(var a={},o=0,c=r.length;o<c;++o){var u=r[o],h=u.name,f=u.type,p=u.locations;switch(f){case"bool":case"int":case"float":s(e,t,p[0],i,1,a,h);break;default:if(f.indexOf("vec")>=0){if((d=f.charCodeAt(f.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);s(e,t,p[0],i,d,a,h)}else{if(!(f.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+h+": "+f);var d;if((d=f.charCodeAt(f.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);l(e,t,p,i,d,a,h)}}}return a};var n=r(8866);function i(e,t,r,n,i,a){this._gl=e,this._wrapper=t,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(e,t,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,e||a.FLOAT,!!t,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(e,t,r,n){return this._constFunc(this._locations[this._index],e,t,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(e){return e!==this._locations[this._index]&&(this._locations[this._index]=0|e,this._wrapper.program=null),0|e}});var o=[function(e,t,r){return void 0===r.length?e.vertexAttrib1f(t,r):e.vertexAttrib1fv(t,r)},function(e,t,r,n){return void 0===r.length?e.vertexAttrib2f(t,r,n):e.vertexAttrib2fv(t,r)},function(e,t,r,n,i){return void 0===r.length?e.vertexAttrib3f(t,r,n,i):e.vertexAttrib3fv(t,r)},function(e,t,r,n,i,a){return void 0===r.length?e.vertexAttrib4f(t,r,n,i,a):e.vertexAttrib4fv(t,r)}];function s(e,t,r,n,a,s,l){var c=o[a],u=new i(e,t,r,n,a,c);Object.defineProperty(s,l,{set:function(t){return e.disableVertexAttribArray(n[r]),c(e,n[r],t),t},get:function(){return u},enumerable:!0})}function l(e,t,r,n,i,a,o){for(var l=new Array(i),c=new Array(i),u=0;u<i;++u)s(e,t,r[u],n,i,l,u),c[u]=l[u];Object.defineProperty(l,"location",{set:function(e){if(Array.isArray(e))for(var t=0;t<i;++t)c[t].location=e[t];else for(t=0;t<i;++t)c[t].location=e+t;return e},get:function(){for(var e=new Array(i),t=0;t<i;++t)e[t]=n[r[t]];return e},enumerable:!0}),l.pointer=function(t,a,o,s){t=t||e.FLOAT,a=!!a,o=o||i*i,s=s||0;for(var l=0;l<i;++l){var c=n[r[l]];e.vertexAttribPointer(c,i,t,a,o,s+l*i),e.enableVertexAttribArray(c)}};var h=new Array(i),f=e["vertexAttrib"+i+"fv"];Object.defineProperty(a,o,{set:function(t){for(var a=0;a<i;++a){var o=n[r[a]];if(e.disableVertexAttribArray(o),Array.isArray(t[0]))f.call(e,o,t[a]);else{for(var s=0;s<i;++s)h[s]=t[i*a+s];f.call(e,o,h)}}return t},get:function(){return l},enumerable:!0})}},3327:function(e,t,r){var n=r(216),i=r(8866);function a(e){return function(){return e}}function o(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=t;return r}e.exports=function(e,t,r,s){function l(e){return function(t,r,n){return t.getUniform(r.program,n[e])}}function c(t){return function(n){for(var a=u("",t),o=0;o<a.length;++o){var l=a[o],c=l[0],h=l[1];if(s[h]){var f=n;if("string"==typeof c&&(0===c.indexOf(".")||0===c.indexOf("["))){var p=c;if(0===c.indexOf(".")&&(p=c.slice(1)),p.indexOf("]")===p.length-1){var d=p.indexOf("["),m=p.slice(0,d),g=p.slice(d+1,p.length-1);f=m?n[m][g]:n[g]}else f=n[p]}var y,v=r[h].type;switch(v){case"bool":case"int":case"sampler2D":case"samplerCube":e.uniform1i(s[h],f);break;case"float":e.uniform1f(s[h],f);break;default:var x=v.indexOf("vec");if(!(0<=x&&x<=1&&v.length===4+x)){if(0===v.indexOf("mat")&&4===v.length){if((y=v.charCodeAt(v.length-1)-48)<2||y>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+v);e["uniformMatrix"+y+"fv"](s[h],!1,f);break}throw new i("","Unknown uniform data type for "+name+": "+v)}if((y=v.charCodeAt(v.length-1)-48)<2||y>4)throw new i("","Invalid data type");switch(v.charAt(0)){case"b":case"i":e["uniform"+y+"iv"](s[h],f);break;case"v":e["uniform"+y+"fv"](s[h],f);break;default:throw new i("","Unrecognized data type for vector "+name+": "+v)}}}}}}function u(e,t){if("object"!=typeof t)return[[e,t]];var r=[];for(var n in t){var i=t[n],a=e;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,u(a,i)):r.push([a,i])}return r}function h(e,t,n){if("object"==typeof n){var u=f(n);Object.defineProperty(e,t,{get:a(u),set:c(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(e,t,{get:l(n),set:c(n),enumerable:!0,configurable:!1}):e[t]=function(e){switch(e){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var t=e.indexOf("vec");if(0<=t&&t<=1&&e.length===4+t){if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===e.charAt(0)?o(r,!1):o(r,0)}if(0===e.indexOf("mat")&&4===e.length){var r;if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+e);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+e)}}(r[n].type)}function f(e){var t;if(Array.isArray(e)){t=new Array(e.length);for(var r=0;r<e.length;++r)h(t,r,e[r])}else for(var n in t={},e)h(t,n,e[n]);return t}var p=n(r,!0);return{get:a(f(p)),set:c(p),enumerable:!0,configurable:!0}}},216:function(e){e.exports=function(e,t){for(var r={},n=0;n<e.length;++n)for(var i=e[n].name.split("."),a=r,o=0;o<i.length;++o){var s=i[o].split("[");if(s.length>1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l<s.length;++l){var c=parseInt(s[l]);l<s.length-1||o<i.length-1?(c in a||(l<s.length-1?a[c]=[]:a[c]={}),a=a[c]):a[c]=t?n:e[n].type}}else o<i.length-1?(s[0]in a||(a[s[0]]={}),a=a[s[0]]):a[s[0]]=t?n:e[n].type}return r}},2145:function(e,t){t.uniforms=function(e,t){for(var r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=[],a=0;a<r;++a){var o=e.getActiveUniform(t,a);if(o){var s=i(e,o.type);if(o.size>1)for(var l=0;l<o.size;++l)n.push({name:o.name.replace("[0]","["+l+"]"),type:s});else n.push({name:o.name,type:s})}}return n},t.attributes=function(e,t){for(var r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=[],a=0;a<r;++a){var o=e.getActiveAttrib(t,a);o&&n.push({name:o.name,type:i(e,o.type)})}return n};var r={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},n=null;function i(e,t){if(!n){var i=Object.keys(r);n={};for(var a=0;a<i.length;++a){var o=i[a];n[e[o]]=r[o]}}return n[t]}},5091:function(e,t,r){t.shader=function(e,t,r){return u(e).getShaderReference(t,r)},t.program=function(e,t,r,n,i){return u(e).getProgram(t,r,n,i)};var n=r(8866),i=r(2992),a=new(typeof WeakMap>"u"?r(606):WeakMap),o=0;function s(e,t,r,n,i,a,o){this.id=e,this.src=t,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function l(e){this.gl=e,this.shaders=[{},{}],this.programs={}}s.prototype.dispose=function(){if(0==--this.count){for(var e=this.cache,t=e.gl,r=this.programs,n=0,i=r.length;n<i;++n){var a=e.programs[r[n]];a&&(delete e.programs[n],t.deleteProgram(a))}t.deleteShader(this.shader),delete e.shaders[this.type===t.FRAGMENT_SHADER|0][this.src]}};var c=l.prototype;function u(e){var t=a.get(e);return t||(t=new l(e),a.set(e,t)),t}c.getShaderReference=function(e,t){var r=this.gl,a=this.shaders[e===r.FRAGMENT_SHADER|0],l=a[t];if(l&&r.isShader(l.shader))l.count+=1;else{var c=function(e,t,r){var a=e.createShader(t);if(e.shaderSource(a,r),e.compileShader(a),!e.getShaderParameter(a,e.COMPILE_STATUS)){var o=e.getShaderInfoLog(a);try{var s=i(o,r,t)}catch(e){throw console.warn("Failed to format compiler error: "+e),new n(o,"Error compiling shader:\n"+o)}throw new n(o,s.short,s.long)}return a}(r,e,t);l=a[t]=new s(o++,t,e,c,[],1,this)}return l},c.getProgram=function(e,t,r,i){var a=[e.id,t.id,r.join(":"),i.join(":")].join("@"),o=this.programs[a];return(!o||!this.gl.isProgram(o))&&(this.programs[a]=o=function(e,t,r,i,a){var o=e.createProgram();e.attachShader(o,t),e.attachShader(o,r);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 l=e.getProgramInfoLog(o);throw new n(l,"Error linking program: "+l)}return o}(this.gl,e.shader,t.shader,r,i),e.programs.push(a),t.programs.push(a)),o}},1493:function(e,t,r){var n=r(3236),i=r(9405),a=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * (view * (model * vec4(vertexPosition, 1.0)));\n vec2 clipOffset = (projection * (view * (model * vec4(color, 0.0)))).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}"]);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,r){var n=r(2762),i=r(8116),a=r(1493);e.exports=function(e,t){var r=[];function o(e,t,n,i,a,o){var s=[e,t,n,0,0,0,1];s[i+3]=1,s[i]=a,r.push.apply(r,s),s[6]=-1,r.push.apply(r,s),s[i]=o,r.push.apply(r,s),r.push.apply(r,s),s[6]=1,r.push.apply(r,s),s[i]=a,r.push.apply(r,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 l=n(e,r),c=i(e,[{type:e.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:e.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:e.FLOAT,buffer:l,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 h=new s(e,l,c,u);return h.update(t),h};var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,r,n){this.gl=e,this.buffer=t,this.vao=r,this.shader=n,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 l=s.prototype,c=[0,0,0],u=[0,0,0],h=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(e){},l.draw=function(e){var t=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=e.model||o,s=e.view||o,l=e.projection||o;this.axes&&(i=this.axes.lastCubeProps.axis);for(var f=c,p=u,d=0;d<3;++d)i&&i[d]<0?(f[d]=this.bounds[0][d],p[d]=this.bounds[1][d]):(f[d]=this.bounds[1][d],p[d]=this.bounds[0][d]);for(h[0]=t.drawingBufferWidth,h[1]=t.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=s,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,f,p],n.uniforms.colors=this.colors,n.uniforms.screenShape=h,d=0;d<3;++d)n.uniforms.lineWidth=this.lineWidth[d]*this.pixelRatio,this.enabled[d]&&(r.draw(t.TRIANGLES,6,6*d),this.drawSides[d]&&r.draw(t.TRIANGLES,12,18+12*d));r.unbind()},l.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))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6740:function(e,t,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // 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).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // 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).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * (view * tubePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);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,r){var n=r(2931),i=r(9970),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(e,t){var r,n=e.length;for(r=0;r<n;r++){var i=e[r];if(i===t)return r;if(i>t)return r-1}return r},s=function(e,t,r){return e<t?t:e>r?r:e},l=function(e){var t=1/0;e.sort((function(e,t){return e-t}));for(var r=e.length,n=1;n<r;n++){var i=Math.abs(e[n]-e[n-1]);i<t&&(t=i)}return t};e.exports=function(e,t){var r=e.startingPositions,c=e.maxLength||1e3,u=e.tubeSize||1,h=e.absoluteTubeSize,f=e.gridFill||"+x+y+z",p={};-1!==f.indexOf("-x")&&(p.reversedX=!0),-1!==f.indexOf("-y")&&(p.reversedY=!0),-1!==f.indexOf("-z")&&(p.reversedZ=!0),p.filled=a.indexOf(f.replace(/-/g,"").replace(/\+/g,""));var d,m,g,y,v=e.getVelocity||function(t){return function(e,t,r){var i=t.vectors,a=t.meshgrid,l=e[0],c=e[1],u=e[2],h=a[0].length,f=a[1].length,p=a[2].length,d=o(a[0],l),m=o(a[1],c),g=o(a[2],u),y=d+1,v=m+1,x=g+1;if(d=s(d,0,h-1),y=s(y,0,h-1),m=s(m,0,f-1),v=s(v,0,f-1),g=s(g,0,p-1),x=s(x,0,p-1),d<0||m<0||g<0||y>h-1||v>f-1||x>p-1)return n.create();var _,b,w,T,k,A,M=a[0][d],S=a[0][y],E=a[1][m],C=a[1][v],I=a[2][g],L=(l-M)/(S-M),P=(c-E)/(C-E),z=(u-I)/(a[2][x]-I);switch(isFinite(L)||(L=.5),isFinite(P)||(P=.5),isFinite(z)||(z=.5),r.reversedX&&(d=h-1-d,y=h-1-y),r.reversedY&&(m=f-1-m,v=f-1-v),r.reversedZ&&(g=p-1-g,x=p-1-x),r.filled){case 5:k=g,A=x,w=m*p,T=v*p,_=d*p*f,b=y*p*f;break;case 4:k=g,A=x,_=d*p,b=y*p,w=m*p*h,T=v*p*h;break;case 3:w=m,T=v,k=g*f,A=x*f,_=d*f*p,b=y*f*p;break;case 2:w=m,T=v,_=d*f,b=y*f,k=g*f*h,A=x*f*h;break;case 1:_=d,b=y,k=g*h,A=x*h,w=m*h*p,T=v*h*p;break;default:_=d,b=y,w=m*h,T=v*h,k=g*h*f,A=x*h*f}var D=i[_+w+k],O=i[_+w+A],R=i[_+T+k],F=i[_+T+A],B=i[b+w+k],j=i[b+w+A],N=i[b+T+k],U=i[b+T+A],V=n.create(),q=n.create(),H=n.create(),G=n.create();n.lerp(V,D,B,L),n.lerp(q,O,j,L),n.lerp(H,R,N,L),n.lerp(G,F,U,L);var W=n.create(),Z=n.create();n.lerp(W,V,H,P),n.lerp(Z,q,G,P);var Y=n.create();return n.lerp(Y,W,Z,z),Y}(t,e,p)},x=e.getDivergence||function(e,t){var r=n.create(),i=1e-4;n.add(r,e,[i,0,0]);var a=v(r);n.subtract(a,a,t),n.scale(a,a,1/i),n.add(r,e,[0,i,0]);var o=v(r);n.subtract(o,o,t),n.scale(o,o,1/i),n.add(r,e,[0,0,i]);var s=v(r);return n.subtract(s,s,t),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},_=[],b=t[0][0],w=t[0][1],T=t[0][2],k=t[1][0],A=t[1][1],M=t[1][2],S=10*n.distance(t[0],t[1])/c,E=S*S,C=1,I=0,L=r.length;L>1&&(C=function(e){for(var t=[],r=[],n=[],i={},a={},o={},s=e.length,c=0;c<s;c++){var u=e[c],h=u[0],f=u[1],p=u[2];i[h]||(t.push(h),i[h]=!0),a[f]||(r.push(f),a[f]=!0),o[p]||(n.push(p),o[p]=!0)}var d=l(t),m=l(r),g=l(n),y=Math.min(d,m,g);return isFinite(y)?y:1}(r));for(var P=0;P<L;P++){var z=n.create();n.copy(z,r[P]);var D=[z],O=[],R=v(z),F=z;O.push(R);var B=[],j=x(z,R),N=n.length(j);isFinite(N)&&N>I&&(I=N),B.push(N),_.push({points:D,velocities:O,divergences:B});for(var U=0;U<100*c&&D.length<c&&(void 0,void 0,void 0,m=(d=z)[0],g=d[1],y=d[2],!(m<b||m>k||g<w||g>A||y<T||y>M));){U++;var V=n.clone(R),q=n.squaredLength(V);if(0===q)break;q>E&&n.scale(V,V,S/Math.sqrt(q)),n.add(V,V,z),R=v(V),n.squaredDistance(F,V)-E>-1e-4*E&&(D.push(V),F=V,O.push(R),j=x(V,R),N=n.length(j),isFinite(N)&&N>I&&(I=N),B.push(N)),z=V}}var H=function(e,t,r,a){for(var o=0,s=0;s<e.length;s++)for(var l=e[s].velocities,c=0;c<l.length;c++)o=Math.max(o,n.length(l[c]));var u=e.map((function(e){return function(e,t,r,a){for(var o=e.points,s=e.velocities,l=e.divergences,c=[],u=[],h=[],f=[],p=[],d=[],m=0,g=0,y=i.create(),v=i.create(),x=0;x<o.length;x++){var _=o[x],b=s[x],w=l[x];0===t&&(w=.05*r),g=n.length(b)/a,y=i.create(),n.copy(y,b),y[3]=w;for(var T=0;T<8;T++)p[T]=[_[0],_[1],_[2],T];if(f.length>0)for(T=0;T<8;T++){var k=(T+1)%8;c.push(f[T],p[T],p[k],p[k],f[k],f[T]),h.push(v,y,y,y,v,v),d.push(m,g,g,g,m,m);var A=c.length;u.push([A-6,A-5,A-4],[A-3,A-2,A-1])}var M=f;f=p,p=M;var S=v;v=y,y=S;var E=m;m=g,g=E}return{positions:c,cells:u,vectors:h,vertexIntensity:d}}(e,r,a,o)})),h=[],f=[],p=[],d=[];for(s=0;s<u.length;s++){var m=u[s],g=h.length;for(h=h.concat(m.positions),p=p.concat(m.vectors),d=d.concat(m.vertexIntensity),c=0;c<m.cells.length;c++){var y=m.cells[c],v=[];f.push(v);for(var x=0;x<y.length;x++)v.push(y[x]+g)}}return{positions:h,cells:f,vectors:p,vertexIntensity:d,colormap:t}}(_,e.colormap,I,C);return h?H.tubeScale=h:(0===I&&(I=1),H.tubeScale=.5*u*C/I),H};var c=r(6740),u=r(6405).createMesh;e.exports.createTubeMesh=function(e,t){return u(e,t,{shaders:c,traceType:"streamtube"})}},990:function(e,t,r){var n=r(9405),i=r(3236),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0);\n vec4 clipPosition = projection * (view * worldPosition);\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color — in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * (view * worldPosition);\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);t.createShader=function(e){var t=n(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=n(e,a,l,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=n(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=n(e,s,l,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,r){e.exports=function(e){var t=e.gl,r=v(t),n=_(t),s=x(t),l=b(t),c=i(t),u=a(t,[{buffer:c,size:4,stride:w,offset:0},{buffer:c,size:3,stride:w,offset:16},{buffer:c,size:3,stride:w,offset:28}]),h=i(t),f=a(t,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),p=i(t),d=a(t,[{buffer:p,size:2,type:t.FLOAT}]),m=o(t,1,S,t.RGBA,t.UNSIGNED_BYTE);m.minFilter=t.LINEAR,m.magFilter=t.LINEAR;var g=new E(t,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,h,f,p,d,[0,0,0]),y={levels:[[],[],[]]};for(var T in e)y[T]=e[T];return y.colormap=y.colormap||"jet",g.update(y),g};var n=r(8828),i=r(2762),a=r(8116),o=r(7766),s=r(1888),l=r(6729),c=r(5298),u=r(9994),h=r(9618),f=r(3711),p=r(6760),d=r(7608),m=r(2478),g=r(6199),y=r(990),v=y.createShader,x=y.createContourShader,_=y.createPickShader,b=y.createPickContourShader,w=40,T=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],A=[[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 M(e,t,r,n,i){this.position=e,this.index=t,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var e=0;e<3;++e){var t=A[e],r=(e+2)%3;t[(e+1)%3+0]=1,t[r+3]=1,t[e+6]=1}}();var S=256;function E(e,t,r,n,i,a,o,l,c,u,f,p,d,m,g){this.gl=e,this.shape=t,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=f,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new M([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=m,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=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(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 C=E.prototype;C.genColormap=function(e,t){var r=!1,n=u([l({colormap:e,nshades:S,format:"rgba"}).map((function(e,n){var i=t?function(e,t){if(!t||!t.length)return 1;for(var r=0;r<t.length;++r){if(t.length<2)return 1;if(t[r][0]===e)return t[r][1];if(t[r][0]>e&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}(n/255,t):e[3];return i<1&&(r=!0),[e[0],e[1],e[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},C.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},C.isOpaque=function(){return!this.isTransparent()},C.pickSlots=1,C.setPickBase=function(e){this.pickId=e};var I=[0,0,0],L={showSurface:!1,showContour:!1,projections:[T.slice(),T.slice(),T.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function P(e,t){var r,n,i,a=t.axes&&t.axes.lastCubeProps.axis||I,o=t.showSurface,s=t.showContour;for(r=0;r<3;++r)for(o=o||t.surfaceProject[r],n=0;n<3;++n)s=s||t.contourProject[r][n];for(r=0;r<3;++r){var l=L.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=t.axesBounds[+(a[r]>0)][r],p(l,e.model,l);var c=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=e.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var z={model:T,view:T,projection:T,inverseModel:T.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},D=T.slice(),O=[1,0,0,0,1,0,0,0,1];function R(e,t){e=e||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=z;n.model=e.model||T,n.view=e.view||T,n.projection=e.projection||T,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=O,n.vertexColor=this.vertexColor;var s=D;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=P(n,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.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(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var f=this._contourVAO;for(f.bind(),i=0;i<3;++i)for(h.uniforms.permutation=A[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o<this.contourLevels[i].length;++o)o===this.highlightLevel[i]?(h.uniforms.contourColor=this.highlightColor[i],h.uniforms.contourTint=this.highlightTint[i]):(0===o||o-1===this.highlightLevel[i])&&(h.uniforms.contourColor=this.contourColor[i],h.uniforms.contourTint=this.contourTint[i]),this._contourCounts[i][o]&&(h.uniforms.height=this.contourLevels[i][o],f.draw(r.LINES,this._contourCounts[i][o],this._contourOffsets[i][o]));for(i=0;i<3;++i)for(h.uniforms.model=u.projections[i],h.uniforms.clipBounds=u.clipBounds[i],o=0;o<3;++o)if(this.contourProject[i][o]){h.uniforms.permutation=A[o],r.lineWidth(this.contourWidth[o]*this.pixelRatio);for(var m=0;m<this.contourLevels[o].length;++m)m===this.highlightLevel[o]?(h.uniforms.contourColor=this.highlightColor[o],h.uniforms.contourTint=this.highlightTint[o]):(0===m||m-1===this.highlightLevel[o])&&(h.uniforms.contourColor=this.contourColor[o],h.uniforms.contourTint=this.contourTint[o]),this._contourCounts[o][m]&&(h.uniforms.height=this.contourLevels[o][m],f.draw(r.LINES,this._contourCounts[o][m],this._contourOffsets[o][m]))}for(f.unbind(),(f=this._dynamicVAO).bind(),i=0;i<3;++i)if(0!==this._dynamicCounts[i])for(h.uniforms.model=n.model,h.uniforms.clipBounds=n.clipBounds,h.uniforms.permutation=A[i],r.lineWidth(this.dynamicWidth[i]*this.pixelRatio),h.uniforms.contourColor=this.dynamicColor[i],h.uniforms.contourTint=this.dynamicTint[i],h.uniforms.height=this.dynamicLevel[i],f.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),o=0;o<3;++o)this.contourProject[o][i]&&(h.uniforms.model=u.projections[o],h.uniforms.clipBounds=u.clipBounds[o],f.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));f.unbind()}}C.draw=function(e){return R.call(this,e,!1)},C.drawTransparent=function(e){return R.call(this,e,!0)};var F={model:T,view:T,projection:T,inverseModel:T,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]};function B(e,t){return Array.isArray(e)?[t(e[0]),t(e[1]),t(e[2])]:[t(e),t(e),t(e)]}function j(e){return Array.isArray(e)?3===e.length?[e[0],e[1],e[2],1]:[e[0],e[1],e[2],e[3]]:[0,0,0,1]}function N(e){if(Array.isArray(e)){if(Array.isArray(e))return[j(e[0]),j(e[1]),j(e[2])];var t=j(e);return[t.slice(),t.slice(),t.slice()]}}C.drawPick=function(e){e=e||{};var t=this.gl;t.disable(t.CULL_FACE);var r=F;r.model=e.model||T,r.view=e.view||T,r.projection=e.projection||T,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.objectOffset=this.objectOffset,r.permutation=O;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var o=P(r,this);if(o.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(t.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=o.projections[n],this._pickShader.uniforms.clipBounds=o.clipBounds[n],this._vao.draw(t.TRIANGLES,this._vertexCount));this._vao.unbind()}if(o.showContour){var s=this._contourPickShader;s.bind(),s.uniforms=r;var l=this._contourVAO;for(l.bind(),a=0;a<3;++a)for(t.lineWidth(this.contourWidth[a]*this.pixelRatio),s.uniforms.permutation=A[a],n=0;n<this.contourLevels[a].length;++n)this._contourCounts[a][n]&&(s.uniforms.height=this.contourLevels[a][n],l.draw(t.LINES,this._contourCounts[a][n],this._contourOffsets[a][n]));for(n=0;n<3;++n)for(s.uniforms.model=o.projections[n],s.uniforms.clipBounds=o.clipBounds[n],a=0;a<3;++a)if(this.contourProject[n][a]){s.uniforms.permutation=A[a],t.lineWidth(this.contourWidth[a]*this.pixelRatio);for(var c=0;c<this.contourLevels[a].length;++c)this._contourCounts[a][c]&&(s.uniforms.height=this.contourLevels[a][c],l.draw(t.LINES,this._contourCounts[a][c],this._contourOffsets[a][c]))}l.unbind()}},C.pick=function(e){if(!e||e.id!==this.pickId)return null;var t=this._field[2].shape,r=this._pickResult,n=t[0]*(e.value[0]+(e.value[2]>>4)/16)/255,i=Math.floor(n),a=n-i,o=t[1]*(e.value[1]+(15&e.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?a:1-a,f=0;f<2;++f)for(var p=i+u,d=s+f,g=h*(f?l:1-l),y=0;y<3;++y)c[y]+=this._field[y].get(p,d)*g;for(var v=this._pickResult.level,x=0;x<3;++x)if(v[x]=m.le(this.contourLevels[x],c[x]),v[x]<0)this.contourLevels[x].length>0&&(v[x]=0);else if(v[x]<this.contourLevels[x].length-1){var _=this.contourLevels[x][v[x]],b=this.contourLevels[x][v[x]+1];Math.abs(_-c[x])>Math.abs(b-c[x])&&(v[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/t[0],r.uv[1]=o/t[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},C.padField=function(e,t){var r=t.shape.slice(),n=e.shape.slice();c.assign(e.lo(1,1).hi(r[0],r[1]),t),c.assign(e.lo(1).hi(r[0],1),t.hi(r[0],1)),c.assign(e.lo(1,n[1]-1).hi(r[0],1),t.lo(0,r[1]-1).hi(r[0],1)),c.assign(e.lo(0,1).hi(1,r[1]),t.hi(1)),c.assign(e.lo(n[0]-1,1).hi(1,r[1]),t.lo(r[0]-1)),e.set(0,0,t.get(0,0)),e.set(0,n[1]-1,t.get(0,r[1]-1)),e.set(n[0]-1,0,t.get(r[0]-1,0)),e.set(n[0]-1,n[1]-1,t.get(r[0]-1,r[1]-1))},C.update=function(e){e=e||{},this.objectOffset=e.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in e&&(this.contourWidth=B(e.contourWidth,Number)),"showContour"in e&&(this.showContour=B(e.showContour,Boolean)),"showSurface"in e&&(this.showSurface=!!e.showSurface),"contourTint"in e&&(this.contourTint=B(e.contourTint,Boolean)),"contourColor"in e&&(this.contourColor=N(e.contourColor)),"contourProject"in e&&(this.contourProject=B(e.contourProject,(function(e){return B(e,Boolean)}))),"surfaceProject"in e&&(this.surfaceProject=e.surfaceProject),"dynamicColor"in e&&(this.dynamicColor=N(e.dynamicColor)),"dynamicTint"in e&&(this.dynamicTint=B(e.dynamicTint,Number)),"dynamicWidth"in e&&(this.dynamicWidth=B(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,r=!1;if(t||(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(n.nextPow2(i))),this._field[2]=h(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]=h(this._field[o].data,[a[0]+2,a[1]+2]);if(e.coords){var l=e.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=l[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(e.ticks){var u=e.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=u[o];if((Array.isArray(p)||p.length)&&(p=h(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var d=h(p.data,a);d.stride[o]=p.stride[0],d.stride[1^o]=0,this.padField(this._field[o],d)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2],m,0)}this._field[0].set(0,0,0);for(var y=0;y<a[0];++y)this._field[0].set(y+1,0,y);for(this._field[0].set(a[0]+1,0,a[0]-1),this._field[1].set(0,0,0),y=0;y<a[1];++y)this._field[1].set(0,y+1,y);this._field[1].set(0,a[1]+1,a[1]-1)}var v=this._field,x=h(s.mallocFloat(3*v[2].size*2),[3,a[0]+2,a[1]+2,2]);for(o=0;o<3;++o)g(x.pick(o),v[o],"mirror");var _=h(s.mallocFloat(3*v[2].size),[a[0]+2,a[1]+2,3]);for(o=0;o<a[0]+2;++o)for(y=0;y<a[1]+2;++y){var b=x.get(0,o,y,0),w=x.get(0,o,y,1),T=x.get(1,o,y,0),A=x.get(1,o,y,1),M=x.get(2,o,y,0),S=x.get(2,o,y,1),E=T*S-A*M,C=M*w-S*b,I=b*A-w*T,L=Math.sqrt(E*E+C*C+I*I);L<1e-8?(L=Math.max(Math.abs(E),Math.abs(C),Math.abs(I)))<1e-8?(I=1,C=E=0,L=1):L=1/L:L=1/Math.sqrt(L),_.set(o,y,0,E*L),_.set(o,y,1,C*L),_.set(o,y,2,I*L)}s.free(x.data);var P=[1/0,1/0,1/0],z=[-1/0,-1/0,-1/0],D=1/0,O=-1/0,R=(a[0]-1)*(a[1]-1)*6,F=s.mallocFloat(n.nextPow2(10*R)),j=0,U=0;for(o=0;o<a[0]-1;++o)e:for(y=0;y<a[1]-1;++y){for(var V=0;V<2;++V)for(var q=0;q<2;++q)for(var H=0;H<3;++H){var G=this._field[H].get(1+o+V,1+y+q);if(isNaN(G)||!isFinite(G))continue e}for(H=0;H<6;++H){var W=o+k[H][0],Z=y+k[H][1],Y=this._field[0].get(W+1,Z+1),X=this._field[1].get(W+1,Z+1);G=this._field[2].get(W+1,Z+1),E=_.get(W+1,Z+1,0),C=_.get(W+1,Z+1,1),I=_.get(W+1,Z+1,2),e.intensity&&($=e.intensity.get(W,Z));var $=e.intensity?e.intensity.get(W,Z):G+this.objectOffset[2];F[j++]=W,F[j++]=Z,F[j++]=Y,F[j++]=X,F[j++]=G,F[j++]=0,F[j++]=$,F[j++]=E,F[j++]=C,F[j++]=I,P[0]=Math.min(P[0],Y+this.objectOffset[0]),P[1]=Math.min(P[1],X+this.objectOffset[1]),P[2]=Math.min(P[2],G+this.objectOffset[2]),D=Math.min(D,$),z[0]=Math.max(z[0],Y+this.objectOffset[0]),z[1]=Math.max(z[1],X+this.objectOffset[1]),z[2]=Math.max(z[2],G+this.objectOffset[2]),O=Math.max(O,$),U+=1}}for(e.intensityBounds&&(D=+e.intensityBounds[0],O=+e.intensityBounds[1]),o=6;o<j;o+=10)F[o]=(F[o]-D)/(O-D);this._vertexCount=U,this._coordinateBuffer.update(F.subarray(0,j)),s.freeFloat(F),s.free(_.data),this.bounds=[P,z],this.intensity=e.intensity||this._field[2],(this.intensityBounds[0]!==D||this.intensityBounds[1]!==O)&&(r=!0),this.intensityBounds=[D,O]}if("levels"in e){var K=e.levels;for(K=Array.isArray(K[0])?K.slice():[[],[],K],o=0;o<3;++o)K[o]=K[o].slice(),K[o].sort((function(e,t){return e-t}));for(o=0;o<3;++o)for(y=0;y<K[o].length;++y)K[o][y]-=this.objectOffset[o];e:for(o=0;o<3;++o){if(K[o].length!==this.contourLevels[o].length){r=!0;break}for(y=0;y<K[o].length;++y)if(K[o][y]!==this.contourLevels[o][y]){r=!0;break e}}this.contourLevels=K}if(r){v=this._field,a=this.shape;for(var J=[],Q=0;Q<3;++Q){var ee=this.contourLevels[Q],te=[],re=[],ne=[0,0,0];for(o=0;o<ee.length;++o){var ie=f(this._field[Q],ee[o]);te.push(J.length/5|0),U=0;e:for(y=0;y<ie.cells.length;++y){var ae=ie.cells[y];for(H=0;H<2;++H){var oe=ie.positions[ae[H]],se=oe[0],le=0|Math.floor(se),ce=se-le,ue=oe[1],he=0|Math.floor(ue),fe=ue-he,pe=!1;t:for(var de=0;de<3;++de){ne[de]=0;var me=(Q+de+1)%3;for(V=0;V<2;++V){var ge=V?ce:1-ce;for(W=0|Math.min(Math.max(le+V,0),a[0]),q=0;q<2;++q){var ye=q?fe:1-fe;if(Z=0|Math.min(Math.max(he+q,0),a[1]),G=de<2?this._field[me].get(W,Z):(this.intensity.get(W,Z)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(G)||isNaN(G)){pe=!0;break t}var ve=ge*ye;ne[de]+=ve*G}}}if(pe){if(H>0){for(var xe=0;xe<5;++xe)J.pop();U-=1}continue e}J.push(ne[0],ne[1],oe[0],oe[1],ne[2]),U+=1}}re.push(U)}this._contourOffsets[Q]=te,this._contourCounts[Q]=re}var _e=s.mallocFloat(J.length);for(o=0;o<J.length;++o)_e[o]=J[o];this._contourBuffer.update(_e),s.freeFloat(_e)}},C.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)},C.highlight=function(e){var t,r;if(!e)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(t=0;t<3;++t)this.enableHighlight[t]?this.highlightLevel[t]=e.level[t]:this.highlightLevel[t]=-1;for(r=this.snapToData?e.dataCoordinate:e.position,t=0;t<3;++t)r[t]-=this.objectOffset[t];if(this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,a=s.mallocFloat(12*i[0]*i[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var l=(o+1)%3,c=(o+2)%3,u=this._field[o],h=this._field[l],p=this._field[c],d=f(u,r[o]),m=d.cells,g=d.positions;for(this._dynamicOffsets[o]=n,t=0;t<m.length;++t)for(var y=m[t],v=0;v<2;++v){var x=g[y[v]],_=+x[0],b=0|_,w=0|Math.min(b+1,i[0]),T=_-b,k=1-T,A=+x[1],M=0|A,S=0|Math.min(M+1,i[1]),E=A-M,C=1-E,I=k*C,L=k*E,P=T*C,z=T*E,D=I*h.get(b,M)+L*h.get(b,S)+P*h.get(w,M)+z*h.get(w,S),O=I*p.get(b,M)+L*p.get(b,S)+P*p.get(w,M)+z*p.get(w,S);if(isNaN(D)||isNaN(O)){v&&(n-=1);break}a[2*n+0]=D,a[2*n+1]=O,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(a.subarray(0,2*n)),s.freeFloat(a)}}},7766:function(e,t,r){var n=r(9618),i=r(5298),a=r(1888);e.exports=function(e){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(o||function(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],l=[e.REPEAT,e.CLAMP_TO_EDGE,e.MIRRORED_REPEAT]}(e),"number"==typeof arguments[1])return g(e,arguments[1],arguments[2],arguments[3]||e.RGBA,arguments[4]||e.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return g(e,0|arguments[1][0],0|arguments[1][1],arguments[2]||e.RGBA,arguments[3]||e.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var t=arguments[1],r=c(t)?t:t.raw;if(r)return function(e,t,r,n,i,a){var o=m(e);return e.texImage2D(e.TEXTURE_2D,0,i,i,a,t),new f(e,o,r,n,i,a)}(e,r,0|t.width,0|t.height,arguments[2]||e.RGBA,arguments[3]||e.UNSIGNED_BYTE);if(t.shape&&t.data&&t.stride)return function(e,t){var r=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 new Error("gl-texture2d: Invalid texture size");var l=d(o,t.stride.slice()),c=0;"float32"===r?c=e.FLOAT:"float64"===r?(c=e.FLOAT,l=!1,r="float32"):"uint8"===r?c=e.UNSIGNED_BYTE:(c=e.UNSIGNED_BYTE,l=!1,r="uint8");var h=0;if(2===o.length)h=e.LUMINANCE,o=[o[0],o[1],1],t=n(t.data,o,[t.stride[0],t.stride[1],1],t.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])h=e.ALPHA;else if(2===o[2])h=e.LUMINANCE_ALPHA;else if(3===o[2])h=e.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");h=e.RGBA}}c===e.FLOAT&&!e.getExtension("OES_texture_float")&&(c=e.UNSIGNED_BYTE,l=!1);var p,g,y=t.size;if(l)p=0===t.offset&&t.data.length===y?t.data:t.data.subarray(t.offset,t.offset+y);else{var v=[o[2],o[2]*o[0],1];g=a.malloc(y,r);var x=n(g,o,v,0);"float32"!==r&&"float64"!==r||c!==e.UNSIGNED_BYTE?i.assign(x,t):u(x,t),p=g.subarray(0,y)}var _=m(e);return e.texImage2D(e.TEXTURE_2D,0,h,o[0],o[1],0,h,c,p),l||a.free(g),new f(e,_,o[0],o[1],h,c)}(e,t)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(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 u=function(e,t){i.muls(e,t,255)};function h(e,t,r){var n=e.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(t<0||t>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return e._shape=[t,r],e.bind(),n.texImage2D(n.TEXTURE_2D,0,e.format,t,r,0,e.format,e.type,null),e._mipLevels=[0],e}function f(e,t,r,n,i,a){this.gl=e,this.handle=t,this.format=i,this.type=a,this._shape=[r,n],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 l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{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=l}var p=f.prototype;function d(e,t){return 3===e.length?1===t[2]&&t[1]===e[0]*e[2]&&t[0]===e[2]:1===t[0]&&t[1]===e[0]}function m(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 g(e,t,r,n,i){var a=e.getParameter(e.MAX_TEXTURE_SIZE);if(t<0||t>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===e.FLOAT&&!e.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=m(e);return e.texImage2D(e.TEXTURE_2D,0,n,t,r,0,n,i,null),new f(e,o,t,r,n,i)}Object.defineProperties(p,{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 new 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 new 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=0|Math.max(e,1),t!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(e){if(this.bind(),l.indexOf(e)<0)throw new 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(),l.indexOf(e)<0)throw new 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]),2!==e.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var t=0;t<2;++t)if(l.indexOf(e[t])<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);this._wrapS=e[0],this._wrapT=e[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),e}},shape:{get:function(){return this._shapeVector},set:function(e){if(Array.isArray(e)){if(2!==e.length)throw new Error("gl-texture2d: Invalid texture shape")}else e=[0|e,0|e];return h(this,0|e[0],0|e[1]),[0|e[0],0|e[1]]}},width:{get:function(){return this._shape[0]},set:function(e){return h(this,e|=0,this._shape[1]),e}},height:{get:function(){return this._shape[1]},set:function(e){return e|=0,h(this,this._shape[0],e),e}}}),p.bind=function(e){var t=this.gl;return void 0!==e&&t.activeTexture(t.TEXTURE0+(0|e)),t.bindTexture(t.TEXTURE_2D,this.handle),void 0!==e?0|e:t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.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)},p.setPixels=function(e,t,r,o){var s=this.gl;this.bind(),Array.isArray(t)?(o=r,r=0|t[1],t=0|t[0]):(t=t||0,r=r||0),o=o||0;var l=c(e)?e:e.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,t,r,this.format,this.type,l);else{if(!(e.shape&&e.stride&&e.data))throw new Error("gl-texture2d: Unsupported data type");if(e.shape.length<2||t+e.shape[1]>this._shape[1]>>>o||r+e.shape[0]>this._shape[0]>>>o||t<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(e,t,r,o,s,l,c,h){var f=h.dtype,p=h.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var m=0,g=0,y=d(p,h.stride.slice());if("float32"===f?m=e.FLOAT:"float64"===f?(m=e.FLOAT,y=!1,f="float32"):"uint8"===f?m=e.UNSIGNED_BYTE:(m=e.UNSIGNED_BYTE,y=!1,f="uint8"),2===p.length)g=e.LUMINANCE,p=[p[0],p[1],1],h=n(h.data,p,[h.stride[0],h.stride[1],1],h.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])g=e.ALPHA;else if(2===p[2])g=e.LUMINANCE_ALPHA;else if(3===p[2])g=e.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=e.RGBA}p[2]}if((g===e.LUMINANCE||g===e.ALPHA)&&(s===e.LUMINANCE||s===e.ALPHA)&&(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var v=h.size,x=c.indexOf(o)<0;if(x&&c.push(o),m===l&&y)0===h.offset&&h.data.length===v?x?e.texImage2D(e.TEXTURE_2D,o,s,p[0],p[1],0,s,l,h.data):e.texSubImage2D(e.TEXTURE_2D,o,t,r,p[0],p[1],s,l,h.data):x?e.texImage2D(e.TEXTURE_2D,o,s,p[0],p[1],0,s,l,h.data.subarray(h.offset,h.offset+v)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,p[0],p[1],s,l,h.data.subarray(h.offset,h.offset+v));else{var _;_=l===e.FLOAT?a.mallocFloat32(v):a.mallocUint8(v);var b=n(_,p,[p[2],p[2]*p[0],1]);m===e.FLOAT&&l===e.UNSIGNED_BYTE?u(b,h):i.assign(b,h),x?e.texImage2D(e.TEXTURE_2D,o,s,p[0],p[1],0,s,l,_.subarray(0,v)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,p[0],p[1],s,l,_.subarray(0,v)),l===e.FLOAT?a.freeFloat32(_):a.freeUint8(_)}}(s,t,r,o,this.format,this.type,this._mipLevels,e)}}},1433:function(e){e.exports=function(e,t,r){t?t.bind():e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null);var n=0|e.getParameter(e.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i<r.length;++i){var a=r[i];if(a.buffer){var o=a.buffer,s=a.size||4,l=a.type||e.FLOAT,c=!!a.normalized,u=a.stride||0,h=a.offset||0;o.bind(),e.enableVertexAttribArray(i),e.vertexAttribPointer(i,s,l,c,u,h)}else{if("number"==typeof a)e.vertexAttrib1f(i,a);else if(1===a.length)e.vertexAttrib1f(i,a[0]);else if(2===a.length)e.vertexAttrib2f(i,a[0],a[1]);else if(3===a.length)e.vertexAttrib3f(i,a[0],a[1],a[2]);else{if(4!==a.length)throw new Error("gl-vao: Invalid vertex attribute");e.vertexAttrib4f(i,a[0],a[1],a[2],a[3])}e.disableVertexAttribArray(i)}}for(;i<n;++i)e.disableVertexAttribArray(i)}else for(e.bindBuffer(e.ARRAY_BUFFER,null),i=0;i<n;++i)e.disableVertexAttribArray(i)}},870:function(e,t,r){var n=r(1433);function i(e){this.gl=e,this._elements=null,this._attributes=null,this._elementsType=e.UNSIGNED_SHORT}i.prototype.bind=function(){n(this.gl,this._elements,this._attributes)},i.prototype.update=function(e,t,r){this._elements=t,this._attributes=e,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.dispose=function(){},i.prototype.unbind=function(){},i.prototype.draw=function(e,t,r){r=r||0;var n=this.gl;this._elements?n.drawElements(e,t,this._elementsType,r):n.drawArrays(e,r,t)},e.exports=function(e){return new i(e)}},7518:function(e,t,r){var n=r(1433);function i(e,t,r,n,i,a){this.location=e,this.dimension=t,this.a=r,this.b=n,this.c=i,this.d=a}function a(e,t,r){this.gl=e,this._ext=t,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=e.UNSIGNED_SHORT}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)}},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,r){if(this.bind(),n(this.gl,t,e),this.unbind(),this._attribs.length=0,e)for(var a=0;a<e.length;++a){var o=e[a];"number"==typeof o?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=r||this.gl.UNSIGNED_SHORT},a.prototype.draw=function(e,t,r){r=r||0;var n=this.gl;this._useElements?n.drawElements(e,t,this._elementsType,r):n.drawArrays(e,r,t)},e.exports=function(e,t){return new a(e,t,t.createVertexArrayOES())}},8116:function(e,t,r){var n=r(7518),i=r(870);function a(e){this.bindVertexArrayOES=e.bindVertexArray.bind(e),this.createVertexArrayOES=e.createVertexArray.bind(e),this.deleteVertexArrayOES=e.deleteVertexArray.bind(e)}e.exports=function(e,t,r,o){var s,l=e.createVertexArray?new a(e):e.getExtension("OES_vertex_array_object");return(s=l?n(e,l):i(e)).update(t,r,o),s}},5632:function(e){e.exports=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}},8192:function(e,t,r){e.exports=function(e,t){var r=n(e[0],e[1],e[2]),o=n(t[0],t[1],t[2]);i(r,r),i(o,o);var s=a(r,o);return s>1?0:Math.acos(s)};var n=r(2825),i=r(3536),a=r(244)},9226:function(e){e.exports=function(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=function(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=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},1091:function(e){e.exports=function(){var e=new Float32Array(3);return e[0]=0,e[1]=0,e[2]=0,e}},5911:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e}},5455:function(e,t,r){e.exports=r(7056)},7056:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}},4008:function(e,t,r){e.exports=r(6690)},6690:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}},244:function(e){e.exports=function(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,r){e.exports=function(e,t){var r=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(2613)},9265:function(e){e.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}},2681:function(e){e.exports=function(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,r){e.exports=function(e,t,r,i,a,o){var s,l;for(t||(t=3),r||(r=0),l=i?Math.min(i*t+r,e.length):e.length,s=r;s<l;s+=t)n[0]=e[s],n[1]=e[s+1],n[2]=e[s+2],a(n,n,o),e[s]=n[0],e[s+1]=n[1],e[s+2]=n[2];return e};var n=r(1091)()},2825:function(e){e.exports=function(e,t,r){var n=new Float32Array(3);return n[0]=e,n[1]=t,n[2]=r,n}},2931:function(e,t,r){e.exports={EPSILON:r(2613),create:r(1091),clone:r(3126),angle:r(8192),fromValues:r(2825),copy:r(3990),set:r(1463),equals:r(9922),exactEquals:r(9265),add:r(5632),subtract:r(6843),sub:r(2229),multiply:r(5847),mul:r(4505),divide:r(6690),div:r(4008),min:r(8107),max:r(7417),floor:r(2681),ceil:r(9226),round:r(2447),scale:r(6621),scaleAndAdd:r(8489),distance:r(7056),dist:r(5455),squaredDistance:r(2953),sqrDist:r(6141),length:r(1387),len:r(868),squaredLength:r(3066),sqrLen:r(5486),negate:r(5093),inverse:r(811),normalize:r(3536),dot:r(244),cross:r(5911),lerp:r(6658),random:r(7636),transformMat4:r(5673),transformMat3:r(492),transformQuat:r(264),rotateX:r(6894),rotateY:r(109),rotateZ:r(8692),forEach:r(5137)}},811:function(e){e.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}},868:function(e,t,r){e.exports=r(1387)},1387:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}},6658:function(e){e.exports=function(e,t,r,n){var i=t[0],a=t[1],o=t[2];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e}},7417:function(e){e.exports=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}},8107:function(e){e.exports=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}},4505:function(e,t,r){e.exports=r(5847)},5847:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}},5093:function(e){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}},3536:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+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=function(e,t){t=t||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}},6894:function(e){e.exports=function(e,t,r,n){var i=r[1],a=r[2],o=t[1]-i,s=t[2]-a,l=Math.sin(n),c=Math.cos(n);return e[0]=t[0],e[1]=i+o*c-s*l,e[2]=a+o*l+s*c,e}},109:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[2],o=t[0]-i,s=t[2]-a,l=Math.sin(n),c=Math.cos(n);return e[0]=i+s*l+o*c,e[1]=t[1],e[2]=a+s*c-o*l,e}},8692:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[1],o=t[0]-i,s=t[1]-a,l=Math.sin(n),c=Math.cos(n);return e[0]=i+o*c-s*l,e[1]=a+o*l+s*c,e[2]=t[2],e}},2447:function(e){e.exports=function(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=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}},8489:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}},1463:function(e){e.exports=function(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}},6141:function(e,t,r){e.exports=r(2953)},5486:function(e,t,r){e.exports=r(3066)},2953:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}},3066:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}},2229:function(e,t,r){e.exports=r(6843)},6843:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}},492:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}},5673:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}},264:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,p=-o*n-s*i-l*a;return e[0]=u*c+p*-o+h*-l-f*-s,e[1]=h*c+p*-s+f*-o-u*-l,e[2]=f*c+p*-l+u*-s-h*-o,e}},4361:function(e){e.exports=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}},2335:function(e){e.exports=function(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=function(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=function(){var e=new Float32Array(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}},4691:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},1373:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}},3750:function(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}},3390:function(e){e.exports=function(e,t,r,n){var i=new Float32Array(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i}},9970:function(e,t,r){e.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(e){e.exports=function(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=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}},2573:function(e){e.exports=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}},160:function(e){e.exports=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}},2334:function(e){e.exports=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}},3576:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}},1498:function(e){e.exports=function(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=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o),e}},9131:function(e,t,r){var n=r(5177),i=r(9288);e.exports=function(e,t){return t=t||1,e[0]=Math.random(),e[1]=Math.random(),e[2]=Math.random(),e[3]=Math.random(),n(e,e),i(e,e,t),e}},9288:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}},4844:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e}},4578:function(e){e.exports=function(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}},7960:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return r*r+n*n+i*i+a*a}},483:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}},6860:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}},5352:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}},4041:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,p=-o*n-s*i-l*a;return e[0]=u*c+p*-o+h*-l-f*-s,e[1]=h*c+p*-s+f*-o-u*-l,e[2]=f*c+p*-l+u*-s-h*-o,e[3]=t[3],e}},1848:function(e,t,r){var n=r(4905),i=r(6468);e.exports=function(e){for(var t=Array.isArray(e)?e:n(e),r=0;r<t.length;r++){var a=t[r];if("preprocessor"===a.type){var o=a.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(o&&o[2]){var s=o[1],l=o[2];return(s?i(l):l).trim()}}}}},5874:function(e,t,r){e.exports=function(e){var t,r,T,k=0,A=0,M=l,S=[],E=[],C=1,I=0,L=0,P=!1,z=!1,D="",O=a,R=n;"300 es"===(e=e||{}).version&&(O=s,R=o);var F={},B={};for(k=0;k<O.length;k++)F[O[k]]=!0;for(k=0;k<R.length;k++)B[R[k]]=!0;return function(e){return E=[],null!==e?function(e){k=0,e.toString&&(e=e.toString()),D+=e.replace(/\r\n/g,"\n"),T=D.length;for(var n;t=D[k],k<T;){switch(n=k,M){case u:k="/"===t&&"*"===r?(S.push(t),j(S.join("")),M=l,k+1):(S.push(t),r=t,k+1);break;case h:case f:k=N();break;case p:k=U();break;case d:k="."===t||/[eE]/.test(t)?(S.push(t),M=m,r=t,k+1):"x"===t&&1===S.length&&"0"===S[0]?(M=b,S.push(t),r=t,k+1):/[^\d]/.test(t)?(j(S.join("")),M=l,k):(S.push(t),r=t,k+1);break;case b:k=/[^a-fA-F0-9]/.test(t)?(j(S.join("")),M=l,k):(S.push(t),r=t,k+1);break;case m:"f"===t&&(S.push(t),r=t,k+=1),k=/[eE]/.test(t)||("-"===t||"+"===t)&&/[eE]/.test(r)?(S.push(t),r=t,k+1):/[^\d]/.test(t)?(j(S.join("")),M=l,k):(S.push(t),r=t,k+1);break;case c:k=q();break;case x:k=/[^\s]/g.test(t)?(j(S.join("")),M=l,k):(S.push(t),r=t,k+1);break;case l:S=S.length?[]:S,k="/"===r&&"*"===t?(L=A+k-1,M=u,r=t,k+1):"/"===r&&"/"===t?(L=A+k-1,M=h,r=t,k+1):"#"===t?(M=f,L=A+k,k):/\s/.test(t)?(M=x,L=A+k,k):(P=/\d/.test(t),z=/[^\w_]/.test(t),L=A+k,M=P?d:z?p:c,k)}n!==k&&("\n"===D[n]?(I=0,++C):++I)}return A+=k,D=D.slice(k),E}(e):(S.length&&j(S.join("")),M=_,j("(eof)"),E)};function j(e){e.length&&E.push({type:w[M],data:e,position:L,line:C,column:I})}function N(){return"\r"!==t&&"\n"!==t||"\\"===r?(S.push(t),r=t,k+1):(j(S.join("")),M=l,k)}function U(){if("."===r&&/\d/.test(t))return M=m,k;if("/"===r&&"*"===t)return M=u,k;if("/"===r&&"/"===t)return M=h,k;if("."===t&&S.length){for(;V(S););return M=m,k}if(";"===t||")"===t||"("===t){if(S.length)for(;V(S););return j(t),M=l,k+1}var e=2===S.length&&"="!==t;if(/[\w_\d\s]/.test(t)||e){for(;V(S););return M=l,k}return S.push(t),r=t,k+1}function V(e){for(var t,r,n=0;;){if(t=i.indexOf(e.slice(0,e.length+n).join("")),r=i[t],-1===t){if(n--+e.length>0)continue;r=e.slice(0,1).join("")}return j(r),L+=r.length,(S=S.slice(r.length)).length}}function q(){if(/[^\d\w_]/.test(t)){var e=S.join("");return M=B[e]?v:F[e]?y:g,j(S.join("")),M=l,k}return S.push(t),r=t,k+1}};var n=r(620),i=r(7827),a=r(6852),o=r(7932),s=r(3508),l=999,c=9999,u=0,h=1,f=2,p=3,d=4,m=5,g=6,y=7,v=8,x=9,_=10,b=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(e,t,r){var n=r(6852);n=n.slice().filter((function(e){return!/^(gl\_|texture)/.test(e)})),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(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"]},7932:function(e,t,r){var n=r(620);e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(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"]},7827:function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(e,t,r){var n=r(5874);e.exports=function(e,t){var r=n(t),i=[];return(i=i.concat(r(e))).concat(r(null))}},3236:function(e){e.exports=function(e){"string"==typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n<e.length-1;n++)r.push(e[n],t[n]||"");return r.push(e[n]),r.join("")}},7520:function(e,t,r){var n=r(9507);e.exports=n&&function(){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}()},3778:function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+e[t+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=t<0||0===t&&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*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+p]=255&o,p+=d,o/=256,c-=8);e[r+p-d]|=128*m}},8954:function(e,t,r){e.exports=function(e,t){var r=e.length;if(0===r)throw new Error("Must have at least d+1 points");var i=e[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=e.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var h=new a(l,new Array(i+1),!1),f=h.adjacent,p=new Array(i+2);for(u=0;u<=i;++u){for(var d=l.slice(),m=0;m<=i;++m)m===u&&(d[m]=-1);var g=d[0];d[0]=d[1],d[1]=g;var y=new a(d,new Array(i+1),!0);f[u]=y,p[u]=y}for(p[i+1]=h,u=0;u<=i;++u){d=f[u].vertices;var v=f[u].adjacent;for(m=0;m<=i;++m){var x=d[m];if(x<0)v[m]=h;else for(var _=0;_<=i;++_)f[_].vertices.indexOf(x)<0&&(v[m]=f[_])}}var b=new c(i,o,p),w=!!t;for(u=i+1;u<r;++u)b.insert(e[u],w);return b.boundary()};var n=r(3250),i=r(6803).Fw;function a(e,t,r){this.vertices=e,this.adjacent=t,this.boundary=r,this.lastVisited=-1}function o(e,t,r){this.vertices=e,this.cell=t,this.index=r}function s(e,t){return i(e.vertices,t.vertices)}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};var l=[];function c(e,t,r){this.dimension=e,this.vertices=t,this.simplices=r,this.interior=r.filter((function(e){return!e.boundary})),this.tuple=new Array(e+1);for(var i=0;i<=e;++i)this.tuple[i]=this.vertices[i];var a=l[e];a||(a=l[e]=function(e){var t=n[e+1];return t||(t=n),function(e){return function(){var t=this.tuple;return e.apply(this,t)}}(t)}(e)),this.orient=a}var u=c.prototype;u.handleBoundaryDegeneracy=function(e,t){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[e];for(e.lastVisited=-n;o.length>0;)for(var s=(e=o.pop()).adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var f=u[h];i[h]=f<0?t:a[f]}var p=this.orient();if(p>0)return c;c.lastVisited=-n,0===p&&o.push(c)}}return null},u.walk=function(e,t){var r=this.vertices.length-1,n=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 l=s.vertices,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];for(s.lastVisited=r,u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var f=a[u];a[u]=e;var p=this.orient();if(a[u]=f,p<0){s=h;continue e}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(e,t){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[t];t.lastVisited=r,t.vertices[t.vertices.indexOf(-1)]=r,t.boundary=!1,c.push(t);for(var f=[];h.length>0;){var p=(t=h.pop()).vertices,d=t.adjacent,m=p.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var y=d[g];if(y.boundary&&!(y.lastVisited>=r)){var v=y.vertices;if(y.lastVisited!==-r){for(var x=0,_=0;_<=n;++_)v[_]<0?(x=_,l[_]=e):l[_]=i[v[_]];if(this.orient()>0){v[x]=r,y.boundary=!1,c.push(y),h.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var b=y.adjacent,w=p.slice(),T=d.slice(),k=new a(w,T,!0);u.push(k);var A=b.indexOf(t);if(!(A<0))for(b[A]=k,T[m]=y,w[g]=-1,T[g]=t,d[g]=k,k.flip(),_=0;_<=n;++_){var M=w[_];if(!(M<0||M===r)){for(var S=new Array(n-1),E=0,C=0;C<=n;++C){var I=w[C];I<0||C===_||(S[E++]=I)}f.push(new o(S,k,_))}}}}}for(f.sort(s),g=0;g+1<f.length;g+=2){var L=f[g],P=f[g+1],z=L.index,D=P.index;z<0||D<0||(L.cell.adjacent[L.index]=P.cell,P.cell.adjacent[P.index]=L.cell)}},u.insert=function(e,t){var r=this.vertices;r.push(e);var n=this.walk(e,t);if(n){for(var i=this.dimension,a=this.tuple,o=0;o<=i;++o){var s=n.vertices[o];a[o]=s<0?e:r[s]}var l=this.orient(a);l<0||0===l&&!(n=this.handleBoundaryDegeneracy(n,e))||this.addPeaks(e,n)}},u.boundary=function(){for(var e=this.dimension,t=[],r=this.simplices,n=r.length,i=0;i<n;++i){var a=r[i];if(a.boundary){for(var o=new Array(e),s=a.vertices,l=0,c=0,u=0;u<=e;++u)s[u]>=0?o[l++]=s[u]:c=1&u;if(c===(1&e)){var h=o[0];o[0]=o[1],o[1]=h}t.push(o)}}return t}},3352:function(e,t,r){var n=r(2478);function i(e,t,r,n,i){this.mid=e,this.left=t,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(t?t.count:0)+(r?r.count:0)+n.length}e.exports=function(e){return e&&0!==e.length?new y(g(e)):new y(null)};var a=i.prototype;function o(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 s(e,t){var r=g(t);e.mid=r.mid,e.left=r.left,e.right=r.right,e.leftPoints=r.leftPoints,e.rightPoints=r.rightPoints,e.count=r.count}function l(e,t){var r=e.intervals([]);r.push(t),s(e,r)}function c(e,t){var r=e.intervals([]),n=r.indexOf(t);return n<0?0:(r.splice(n,1),s(e,r),1)}function u(e,t,r){for(var n=0;n<e.length&&e[n][0]<=t;++n){var i=r(e[n]);if(i)return i}}function h(e,t,r){for(var n=e.length-1;n>=0&&e[n][1]>=t;--n){var i=r(e[n]);if(i)return i}}function f(e,t){for(var r=0;r<e.length;++r){var n=t(e[r]);if(n)return n}}function p(e,t){return e-t}function d(e,t){return e[0]-t[0]||e[1]-t[1]}function m(e,t){return e[1]-t[1]||e[0]-t[0]}function g(e){if(0===e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e[r][0],e[r][1]);t.sort(p);var n=t[t.length>>1],a=[],o=[],s=[];for(r=0;r<e.length;++r){var l=e[r];l[1]<n?a.push(l):n<l[0]?o.push(l):s.push(l)}var c=s,u=s.slice();return c.sort(d),u.sort(m),new i(n,g(a),g(o),c,u)}function y(e){this.root=e}a.intervals=function(e){return e.push.apply(e,this.leftPoints),this.left&&this.left.intervals(e),this.right&&this.right.intervals(e),e},a.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)?l(this,e):this.left.insert(e):this.left=g([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?l(this,e):this.right.insert(e):this.right=g([e]);else{var r=n.ge(this.leftPoints,e,d),i=n.ge(this.rightPoints,e,m);this.leftPoints.splice(r,0,e),this.rightPoints.splice(i,0,e)}},a.remove=function(e){var t=this.count-this.leftPoints;if(e[1]<this.mid)return this.left?4*(this.right?this.right.count:0)>3*(t-1)?c(this,e):2===(s=this.left.remove(e))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(e[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(t-1)?c(this,e):2===(s=this.right.remove(e))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===e?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===e){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,e,d);a<this.leftPoints.length&&this.leftPoints[a][0]===e[0];++a)if(this.leftPoints[a]===e)for(this.count-=1,this.leftPoints.splice(a,1),s=n.ge(this.rightPoints,e,m);s<this.rightPoints.length&&this.rightPoints[s][1]===e[1];++s)if(this.rightPoints[s]===e)return this.rightPoints.splice(s,1),1;return 0},a.queryPoint=function(e,t){return e<this.mid?this.left&&(r=this.left.queryPoint(e,t))?r:u(this.leftPoints,e,t):e>this.mid?this.right&&(r=this.right.queryPoint(e,t))?r:h(this.rightPoints,e,t):f(this.leftPoints,t);var r},a.queryInterval=function(e,t,r){var n;return e<this.mid&&this.left&&(n=this.left.queryInterval(e,t,r))||t>this.mid&&this.right&&(n=this.right.queryInterval(e,t,r))?n:t<this.mid?u(this.leftPoints,t,r):e>this.mid?h(this.rightPoints,e,r):f(this.leftPoints,r)};var v=y.prototype;v.insert=function(e){this.root?this.root.insert(e):this.root=new i(e[0],null,null,[e],[e])},v.remove=function(e){if(this.root){var t=this.root.remove(e);return 2===t&&(this.root=null),0!==t}return!1},v.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)},v.queryInterval=function(e,t,r){if(e<=t&&this.root)return this.root.queryInterval(e,t,r)},Object.defineProperty(v,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(v,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},9507:function(e){e.exports=!0},7163:function(e){function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},5219:function(e){e.exports=function(e){for(var t,r=e.length,n=0;n<r;n++)if(((t=e.charCodeAt(n))<9||t>13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},395:function(e){e.exports=function(e,t,r){return e*(1-r)+t*r}},2652:function(e,t,r){var n=r(4335),i=r(6864),a=r(1903),o=r(9921),s=r(7608),l=r(5665),c={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},u=i(),h=i(),f=[0,0,0,0],p=[[0,0,0],[0,0,0],[0,0,0]],d=[0,0,0];function m(e,t,r,n,i){e[0]=t[0]*n+r[0]*i,e[1]=t[1]*n+r[1]*i,e[2]=t[2]*n+r[2]*i}e.exports=function(e,t,r,i,g,y){if(t||(t=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),g||(g=[0,0,0,1]),y||(y=[0,0,0,1]),!n(u,e)||(a(h,u),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(o(h)<1e-8)))return!1;var v=u[3],x=u[7],_=u[11],b=u[12],w=u[13],T=u[14],k=u[15];if(0!==v||0!==x||0!==_){if(f[0]=v,f[1]=x,f[2]=_,f[3]=k,!s(h,h))return!1;l(h,h),function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o}(g,f,h)}else g[0]=g[1]=g[2]=0,g[3]=1;if(t[0]=b,t[1]=w,t[2]=T,function(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]}(p,u),r[0]=c.length(p[0]),c.normalize(p[0],p[0]),i[0]=c.dot(p[0],p[1]),m(p[1],p[1],p[0],1,-i[0]),r[1]=c.length(p[1]),c.normalize(p[1],p[1]),i[0]/=r[1],i[1]=c.dot(p[0],p[2]),m(p[2],p[2],p[0],1,-i[1]),i[2]=c.dot(p[1],p[2]),m(p[2],p[2],p[1],1,-i[2]),r[2]=c.length(p[2]),c.normalize(p[2],p[2]),i[1]/=r[2],i[2]/=r[2],c.cross(d,p[1],p[2]),c.dot(p[0],d)<0)for(var A=0;A<3;A++)r[A]*=-1,p[A][0]*=-1,p[A][1]*=-1,p[A][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}},4335:function(e){e.exports=function(e,t){var r=t[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)e[i]=t[i]*n;return!0}},7442:function(e,t,r){var n=r(6658),i=r(7182),a=r(2652),o=r(9921),s=r(8648),l=h(),c=h(),u=h();function h(){return{translate:f(),scale:f(1),skew:f(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function f(e){return[e||0,e||0,e||0]}e.exports=function(e,t,r,h){if(0===o(t)||0===o(r))return!1;var f=a(t,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!f||!p||(n(u.translate,l.translate,c.translate,h),n(u.skew,l.skew,c.skew,h),n(u.scale,l.scale,c.scale,h),n(u.perspective,l.perspective,c.perspective,h),s(u.quaternion,l.quaternion,c.quaternion,h),i(e,u.translate,u.scale,u.skew,u.perspective,u.quaternion),0))}},7182:function(e,t,r){var n={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},i=(n.create(),n.create());e.exports=function(e,t,r,a,o,s){return n.identity(e),n.fromRotationTranslation(e,s,t),e[3]=o[0],e[7]=o[1],e[11]=o[2],e[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(e,e,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(e,e,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(e,e,i)),n.scale(e,e,r),e}},1811:function(e,t,r){var n=r(2478),i=r(7442),a=r(7608),o=r(5567),s=r(2408),l=r(7089),c=r(6582),u=r(7656),h=(r(2504),r(3536)),f=[0,0,0];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]}e.exports=function(e){return new p((e=e||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var d=p.prototype;d.recalcMatrix=function(e){var t=this._time,r=n.le(t,e),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===t.length-1)for(var l=16*r,c=0;c<16;++c)o[c]=s[l++];else{var u=t[r+1]-t[r],f=(l=16*r,this.prevMatrix),p=!0;for(c=0;c<16;++c)f[c]=s[l++];var d=this.nextMatrix;for(c=0;c<16;++c)d[c]=s[l++],p=p&&f[c]===d[c];if(u<1e-6||p)for(c=0;c<16;++c)o[c]=f[c];else i(o,f,d,(e-t[r])/u)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],h(m,m);var g=this.computedInverse;a(g,o);var y=this.computedEye,v=g[15];y[0]=g[12]/v,y[1]=g[13]/v,y[2]=g[14]/v;var x=this.computedCenter,_=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=y[c]-o[2+4*c]*_}},d.idle=function(e){if(!(e<this.lastT())){for(var t=this._components,r=t.length-16,n=0;n<16;++n)t.push(t[r++]);this._time.push(e)}},d.flush=function(e){var t=n.gt(this._time,e)-2;t<0||(this._time.splice(0,t),this._components.splice(0,16*t))},d.lastT=function(){return this._time[this._time.length-1]},d.lookAt=function(e,t,r,n){this.recalcMatrix(e),t=t||this.computedEye,r=r||f,n=n||this.computedUp,this.setMatrix(e,c(this.computedMatrix,t,r,n));for(var i=0,a=0;a<3;++a)i+=Math.pow(r[a]-t[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},d.rotate=function(e,t,r,n){this.recalcMatrix(e);var i=this.computedInverse;t&&s(i,i,t),r&&o(i,i,r),n&&l(i,i,n),this.setMatrix(e,a(this.computedMatrix,i))};var m=[0,0,0];d.pan=function(e,t,r,n){m[0]=-(t||0),m[1]=-(r||0),m[2]=-(n||0),this.recalcMatrix(e);var i=this.computedInverse;u(i,i,m),this.setMatrix(e,a(i,i))},d.translate=function(e,t,r,n){m[0]=t||0,m[1]=r||0,m[2]=n||0,this.recalcMatrix(e);var i=this.computedMatrix;u(i,i,m),this.setMatrix(e,i)},d.setMatrix=function(e,t){if(!(e<this.lastT())){this._time.push(e);for(var r=0;r<16;++r)this._components.push(t[r])}},d.setDistance=function(e,t){this.computedRadius[0]=t},d.setDistanceLimits=function(e,t){var r=this._limits;r[0]=e,r[1]=t},d.getDistanceLimits=function(e){var t=this._limits;return e?(e[0]=t[0],e[1]=t[1],e):t}},3090:function(e,t,r){e.exports=function(e){var t=e.length;if(t<3){for(var r=new Array(t),i=0;i<t;++i)r[i]=i;return 2===t&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]?[0]:r}var a=new Array(t);for(i=0;i<t;++i)a[i]=i;a.sort((function(t,r){return e[t][0]-e[r][0]||e[t][1]-e[r][1]}));var o=[a[0],a[1]],s=[a[0],a[1]];for(i=2;i<t;++i){for(var l=a[i],c=e[l],u=o.length;u>1&&n(e[o[u-2]],e[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(e[s[u-2]],e[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var h=0,f=(i=0,o.length);i<f;++i)r[h++]=o[i];for(var p=s.length-2;p>0;--p)r[h++]=s[p];return r};var n=r(3250)[3]},351:function(e,t,r){e.exports=function(e,t){t||(t=e,e=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function c(e,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||c!==i||u!==a||l(s))&&(r=0|e,i=c||0,a=u||0,t&&t(r,i,a,o))}function u(e){c(0,e)}function h(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function f(e){l(e)&&t&&t(r,i,a,o)}function p(e){0===n.buttons(e)?c(0,e):c(r,e)}function d(e){c(r|n.buttons(e),e)}function m(e){c(r&~n.buttons(e),e)}function g(){s||(s=!0,e.addEventListener("mousemove",p),e.addEventListener("mousedown",d),e.addEventListener("mouseup",m),e.addEventListener("mouseleave",u),e.addEventListener("mouseenter",u),e.addEventListener("mouseout",u),e.addEventListener("mouseover",u),e.addEventListener("blur",h),e.addEventListener("keyup",f),e.addEventListener("keydown",f),e.addEventListener("keypress",f),e!==window&&(window.addEventListener("blur",h),window.addEventListener("keyup",f),window.addEventListener("keydown",f),window.addEventListener("keypress",f)))}g();var y={element:e};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(t){t?g():s&&(s=!1,e.removeEventListener("mousemove",p),e.removeEventListener("mousedown",d),e.removeEventListener("mouseup",m),e.removeEventListener("mouseleave",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseout",u),e.removeEventListener("mouseover",u),e.removeEventListener("blur",h),e.removeEventListener("keyup",f),e.removeEventListener("keydown",f),e.removeEventListener("keypress",f),e!==window&&(window.removeEventListener("blur",h),window.removeEventListener("keyup",f),window.removeEventListener("keydown",f),window.removeEventListener("keypress",f)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(4687)},24:function(e){var t={left:0,top:0};e.exports=function(e,r,n){r=r||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var i=e.clientX||0,a=e.clientY||0,o=function(e){return e===window||e===document||e===document.body?t:e.getBoundingClientRect()}(r);return n[0]=i-o.left,n[1]=a-o.top,n}},4687:function(e,t){function r(e){return e.target||e.srcElement||window}t.buttons=function(e){if("object"==typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<<t-1}else if("button"in e){var t;if(1===(t=e.button))return 4;if(2===t)return 2;if(t>=0)return 1<<t}}return 0},t.element=r,t.x=function(e){if("object"==typeof e){if("offsetX"in e)return e.offsetX;var t=r(e).getBoundingClientRect();return e.clientX-t.left}return 0},t.y=function(e){if("object"==typeof e){if("offsetY"in e)return e.offsetY;var t=r(e).getBoundingClientRect();return e.clientY-t.top}return 0}},8512:function(e,t,r){var n=r(665);e.exports=function(e,t,r){"function"==typeof e&&(r=!!t,t=e,e=window);var i=n("ex",e),a=function(e){r&&e.preventDefault();var n=e.deltaX||0,a=e.deltaY||0,o=e.deltaZ||0,s=1;switch(e.deltaMode){case 1:s=i;break;case 2:s=window.innerHeight}if(a*=s,o*=s,(n*=s)||a||o)return t(n,a,o,e)};return e.addEventListener("wheel",a),a}},2640:function(e,t,r){var n=r(1888);e.exports=function(e){function t(e){throw new Error("ndarray-extract-contour: "+e)}"object"!=typeof e&&t("Must specify arguments");var r=e.order;Array.isArray(r)||t("Must specify order");var a=e.arrayArguments||1;a<1&&t("Must have at least one array argument"),(e.scalarArguments||0)<0&&t("Scalar arg count must be > 0"),"function"!=typeof e.vertex&&t("Must specify vertex creation function"),"function"!=typeof e.cell&&t("Must specify cell creation function"),"function"!=typeof e.phase&&t("Must specify phase function");for(var o=e.getters||[],s=new Array(a),l=0;l<a;++l)o.indexOf(l)>=0?s[l]=!0:s[l]=!1;return function(e,t,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(e,t,r,n.mallocUint32,n.freeUint32)}(e.vertex,e.cell,e.phase,0,r,s)};var i={"false,0,1":function(e,t,r,n,i){return function(a,o,s,l){var c,u=0|a.shape[0],h=0|a.shape[1],f=a.data,p=0|a.offset,d=0|a.stride[0],m=0|a.stride[1],g=p,y=0|-d,v=0,x=0|-m,_=0,b=-d-m|0,w=0,T=0|d,k=m-d*u|0,A=0,M=0,S=0,E=2*u|0,C=n(E),I=n(E),L=0,P=0,z=-1,D=-1,O=0,R=0|-u,F=0|u,B=0,j=-u-1|0,N=u-1|0,U=0,V=0,q=0;for(A=0;A<u;++A)C[L++]=r(f[g],o,s,l),g+=T;if(g+=k,h>0){if(M=1,C[L++]=r(f[g],o,s,l),g+=T,u>0)for(A=1,c=f[g],P=C[L]=r(c,o,s,l),O=C[L+z],B=C[L+R],U=C[L+j],(P!==O||P!==B||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],e(A,M,c,v,_,w,P,O,B,U,o,s,l),V=I[L]=S++),L+=1,g+=T,A=2;A<u;++A)c=f[g],P=C[L]=r(c,o,s,l),O=C[L+z],B=C[L+R],U=C[L+j],(P!==O||P!==B||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],e(A,M,c,v,_,w,P,O,B,U,o,s,l),V=I[L]=S++,U!==O&&t(I[L+z],V,w,v,U,O,o,s,l)),L+=1,g+=T;for(g+=k,L=0,q=z,z=D,D=q,q=R,R=F,F=q,q=j,j=N,N=q,M=2;M<h;++M){if(C[L++]=r(f[g],o,s,l),g+=T,u>0)for(A=1,c=f[g],P=C[L]=r(c,o,s,l),O=C[L+z],B=C[L+R],U=C[L+j],(P!==O||P!==B||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],e(A,M,c,v,_,w,P,O,B,U,o,s,l),V=I[L]=S++,U!==B&&t(I[L+R],V,_,w,B,U,o,s,l)),L+=1,g+=T,A=2;A<u;++A)c=f[g],P=C[L]=r(c,o,s,l),O=C[L+z],B=C[L+R],U=C[L+j],(P!==O||P!==B||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],e(A,M,c,v,_,w,P,O,B,U,o,s,l),V=I[L]=S++,U!==B&&t(I[L+R],V,_,w,B,U,o,s,l),U!==O&&t(I[L+z],V,w,v,U,O,o,s,l)),L+=1,g+=T;1&M&&(L=0),q=z,z=D,D=q,q=R,R=F,F=q,q=j,j=N,N=q,g+=k}}i(I),i(C)}},"false,1,0":function(e,t,r,n,i){return function(a,o,s,l){var c,u=0|a.shape[0],h=0|a.shape[1],f=a.data,p=0|a.offset,d=0|a.stride[0],m=0|a.stride[1],g=p,y=0|-d,v=0,x=0|-m,_=0,b=-d-m|0,w=0,T=0|m,k=d-m*h|0,A=0,M=0,S=0,E=2*h|0,C=n(E),I=n(E),L=0,P=0,z=-1,D=-1,O=0,R=0|-h,F=0|h,B=0,j=-h-1|0,N=h-1|0,U=0,V=0,q=0;for(M=0;M<h;++M)C[L++]=r(f[g],o,s,l),g+=T;if(g+=k,u>0){if(A=1,C[L++]=r(f[g],o,s,l),g+=T,h>0)for(M=1,c=f[g],P=C[L]=r(c,o,s,l),B=C[L+R],O=C[L+z],U=C[L+j],(P!==B||P!==O||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],e(A,M,c,v,_,w,P,B,O,U,o,s,l),V=I[L]=S++),L+=1,g+=T,M=2;M<h;++M)c=f[g],P=C[L]=r(c,o,s,l),B=C[L+R],O=C[L+z],U=C[L+j],(P!==B||P!==O||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],e(A,M,c,v,_,w,P,B,O,U,o,s,l),V=I[L]=S++,U!==O&&t(I[L+z],V,_,w,O,U,o,s,l)),L+=1,g+=T;for(g+=k,L=0,q=R,R=F,F=q,q=z,z=D,D=q,q=j,j=N,N=q,A=2;A<u;++A){if(C[L++]=r(f[g],o,s,l),g+=T,h>0)for(M=1,c=f[g],P=C[L]=r(c,o,s,l),B=C[L+R],O=C[L+z],U=C[L+j],(P!==B||P!==O||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],e(A,M,c,v,_,w,P,B,O,U,o,s,l),V=I[L]=S++,U!==B&&t(I[L+R],V,w,v,U,B,o,s,l)),L+=1,g+=T,M=2;M<h;++M)c=f[g],P=C[L]=r(c,o,s,l),B=C[L+R],O=C[L+z],U=C[L+j],(P!==B||P!==O||P!==U)&&(v=f[g+y],_=f[g+x],w=f[g+b],e(A,M,c,v,_,w,P,B,O,U,o,s,l),V=I[L]=S++,U!==O&&t(I[L+z],V,_,w,O,U,o,s,l),U!==B&&t(I[L+R],V,w,v,U,B,o,s,l)),L+=1,g+=T;1&A&&(L=0),q=R,R=F,F=q,q=z,z=D,D=q,q=j,j=N,N=q,g+=k}}i(I),i(C)}}}},6199:function(e,t,r){var n=r(1338),i={zero:function(e,t,r,n){var i=e[0];n|=0;var a=0,o=r[0];for(a=0;a<i;++a)t[n]=0,n+=o},fdTemplate1:function(e,t,r,n,i,a,o){var s=e[0],l=r[0],c=-1*l,u=l;n|=0,o|=0;var h=0,f=l,p=a[0];for(h=0;h<s;++h)i[o]=.5*(t[n+c]-t[n+u]),n+=f,o+=p},fdTemplate2:function(e,t,r,n,i,a,o,s,l,c){var u=e[0],h=e[1],f=r[0],p=r[1],d=a[0],m=a[1],g=l[0],y=l[1],v=-1*f,x=f,_=-1*p,b=p;n|=0,o|=0,c|=0;var w=0,T=0,k=p,A=f-h*p,M=m,S=d-h*m,E=y,C=g-h*y;for(T=0;T<u;++T){for(w=0;w<h;++w)i[o]=.5*(t[n+v]-t[n+x]),s[c]=.5*(t[n+_]-t[n+b]),n+=k,o+=M,c+=E;n+=A,o+=S,c+=C}}},a={cdiff:function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),f=t[h];return f||(t[h]=f=e([a,o,s,l,c,u])),f(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}},zero:function(e){var t={};return function(r){var n=r.dtype,i=r.order,a=[n,i.join()].join(),o=t[a];return o||(t[a]=o=e([n,i])),o(r.shape.slice(0),r.data,r.stride,0|r.offset)}},fdTemplate1:function(e){var t={};return function(r,n){var i=r.dtype,a=r.order,o=n.dtype,s=n.order,l=[i,a.join(),o,s.join()].join(),c=t[l];return c||(t[l]=c=e([i,a,o,s])),c(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset)}},fdTemplate2:function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),f=t[h];return f||(t[h]=f=e([a,o,s,l,c,u])),f(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}}};function o(e){return(0,a[e.funcName])(s.bind(void 0,e))}function s(e){return i[e.funcName]}function l(e){return o({funcName:e.funcName})}var c={},u={},h=l({funcName:"cdiff"}),f=l({funcName:"zero"});function p(e){return e in c?c[e]:c[e]=l({funcName:"fdTemplate"+e})}function d(e,t,r,n){return function(e,i){var a=i.shape.slice();return a[0]>2&&a[1]>2&&n(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&&(r(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&&(r(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&&(r(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&&(r(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}}e.exports=function(e,t,r){if(Array.isArray(r)||(r=n(t.dimension,"string"==typeof r?r:"clamp")),0===t.size)return e;if(0===t.dimension)return e.set(0),e;var i=function(e){var t=e.join();if(a=u[t])return a;for(var r=e.length,n=[h,f],i=1;i<=r;++i)n.push(p(i));var a=d.apply(void 0,n);return u[t]=a,a}(r);return i(e,t)}},4317:function(e){function t(e,t){var r=Math.floor(t),n=t-r,i=0<=r&&r<e.shape[0],a=0<=r+1&&r+1<e.shape[0];return(1-n)*(i?+e.get(r):0)+n*(a?+e.get(r+1):0)}function r(e,t,r){var n=Math.floor(t),i=t-n,a=0<=n&&n<e.shape[0],o=0<=n+1&&n+1<e.shape[0],s=Math.floor(r),l=r-s,c=0<=s&&s<e.shape[1],u=0<=s+1&&s+1<e.shape[1],h=a&&c?e.get(n,s):0,f=a&&u?e.get(n,s+1):0;return(1-l)*((1-i)*h+i*(o&&c?e.get(n+1,s):0))+l*((1-i)*f+i*(o&&u?e.get(n+1,s+1):0))}function n(e,t,r,n){var i=Math.floor(t),a=t-i,o=0<=i&&i<e.shape[0],s=0<=i+1&&i+1<e.shape[0],l=Math.floor(r),c=r-l,u=0<=l&&l<e.shape[1],h=0<=l+1&&l+1<e.shape[1],f=Math.floor(n),p=n-f,d=0<=f&&f<e.shape[2],m=0<=f+1&&f+1<e.shape[2],g=o&&u&&d?e.get(i,l,f):0,y=o&&h&&d?e.get(i,l+1,f):0,v=s&&u&&d?e.get(i+1,l,f):0,x=s&&h&&d?e.get(i+1,l+1,f):0,_=o&&u&&m?e.get(i,l,f+1):0,b=o&&h&&m?e.get(i,l+1,f+1):0;return(1-p)*((1-c)*((1-a)*g+a*v)+c*((1-a)*y+a*x))+p*((1-c)*((1-a)*_+a*(s&&u&&m?e.get(i+1,l,f+1):0))+c*((1-a)*b+a*(s&&h&&m?e.get(i+1,l+1,f+1):0)))}function i(e){var t,r,n=0|e.shape.length,i=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n);for(t=0;t<n;++t)r=+arguments[t+1],i[t]=Math.floor(r),a[t]=r-i[t],o[t]=0<=i[t]&&i[t]<e.shape[t],s[t]=0<=i[t]+1&&i[t]+1<e.shape[t];var l,c,u,h=0;e:for(t=0;t<1<<n;++t){for(c=1,u=e.offset,l=0;l<n;++l)if(t&1<<l){if(!s[l])continue e;c*=a[l],u+=e.stride[l]*(i[l]+1)}else{if(!o[l])continue e;c*=1-a[l],u+=e.stride[l]*i[l]}h+=c*e.data[u]}return h}e.exports=function(e,a,o,s){switch(e.shape.length){case 0:return 0;case 1:return t(e,a);case 2:return r(e,a,o);case 3:return n(e,a,o,s);default:return i.apply(void 0,arguments)}},e.exports.d1=t,e.exports.d2=r,e.exports.d3=n},5298:function(e,t){var r={"float64,2,1,0":function(){return function(e,t,r,n,i){var a=e[0],o=e[1],s=e[2],l=r[0],c=r[1],u=r[2];n|=0;var h=0,f=0,p=0,d=u,m=c-s*u,g=l-o*c;for(p=0;p<a;++p){for(f=0;f<o;++f){for(h=0;h<s;++h)t[n]/=i,n+=d;n+=m}n+=g}}},"uint8,2,0,1,float64,2,1,0":function(){return function(e,t,r,n,i,a,o,s){for(var l=e[0],c=e[1],u=e[2],h=r[0],f=r[1],p=r[2],d=a[0],m=a[1],g=a[2],y=n|=0,v=o|=0,x=0|e[0];x>0;){x<64?(l=x,x=0):(l=64,x-=64);for(var _=0|e[1];_>0;){_<64?(c=_,_=0):(c=64,_-=64),n=y+x*h+_*f,o=v+x*d+_*m;var b=0,w=0,T=0,k=p,A=h-u*p,M=f-l*h,S=g,E=d-u*g,C=m-l*d;for(T=0;T<c;++T){for(w=0;w<l;++w){for(b=0;b<u;++b)t[n]=i[o]*s,n+=k,o+=S;n+=A,o+=E}n+=M,o+=C}}}}},"float32,1,0,float32,1,0":function(){return function(e,t,r,n,i,a,o){var s=e[0],l=e[1],c=r[0],u=r[1],h=a[0],f=a[1];n|=0,o|=0;var p=0,d=0,m=u,g=c-l*u,y=f,v=h-l*f;for(d=0;d<s;++d){for(p=0;p<l;++p)t[n]=i[o],n+=m,o+=y;n+=g,o+=v}}},"float32,1,0,float32,0,1":function(){return function(e,t,r,n,i,a,o){for(var s=e[0],l=e[1],c=r[0],u=r[1],h=a[0],f=a[1],p=n|=0,d=o|=0,m=0|e[1];m>0;){m<64?(l=m,m=0):(l=64,m-=64);for(var g=0|e[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=p+m*u+g*c,o=d+m*f+g*h;var y=0,v=0,x=u,_=c-l*u,b=f,w=h-l*f;for(v=0;v<s;++v){for(y=0;y<l;++y)t[n]=i[o],n+=x,o+=b;n+=_,o+=w}}}}},"uint8,2,0,1,uint8,1,2,0":function(){return function(e,t,r,n,i,a,o){for(var s=e[0],l=e[1],c=e[2],u=r[0],h=r[1],f=r[2],p=a[0],d=a[1],m=a[2],g=n|=0,y=o|=0,v=0|e[2];v>0;){v<64?(c=v,v=0):(c=64,v-=64);for(var x=0|e[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var _=0|e[1];_>0;){_<64?(l=_,_=0):(l=64,_-=64),n=g+v*f+x*u+_*h,o=y+v*m+x*p+_*d;var b=0,w=0,T=0,k=f,A=u-c*f,M=h-s*u,S=m,E=p-c*m,C=d-s*p;for(T=0;T<l;++T){for(w=0;w<s;++w){for(b=0;b<c;++b)t[n]=i[o],n+=k,o+=S;n+=A,o+=E}n+=M,o+=C}}}}}},"uint8,2,0,1,array,2,0,1":function(){return function(e,t,r,n,i,a,o){var s=e[0],l=e[1],c=e[2],u=r[0],h=r[1],f=r[2],p=a[0],d=a[1],m=a[2];n|=0,o|=0;var g=0,y=0,v=0,x=f,_=u-c*f,b=h-s*u,w=m,T=p-c*m,k=d-s*p;for(v=0;v<l;++v){for(y=0;y<s;++y){for(g=0;g<c;++g)t[n]=i[o],n+=x,o+=w;n+=_,o+=T}n+=b,o+=k}}}},n=function(e,t){var n=t.join(",");return(0,r[n])()},i={mul:function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),f=t[h];return f||(t[h]=f=e([a,o,s,l,c,u])),f(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}},muls:function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=[a,o.join(),s,l.join()].join(),u=t[c];return u||(t[c]=u=e([a,o,s,l])),u(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i)}},mulseq:function(e){var t={};return function(r,n){var i=r.dtype,a=r.order,o=[i,a.join()].join(),s=t[o];return s||(t[o]=s=e([i,a])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}},div:function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),f=t[h];return f||(t[h]=f=e([a,o,s,l,c,u])),f(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}},divs:function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=[a,o.join(),s,l.join()].join(),u=t[c];return u||(t[c]=u=e([a,o,s,l])),u(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i)}},divseq:function(e){var t={};return function(r,n){var i=r.dtype,a=r.order,o=[i,a.join()].join(),s=t[o];return s||(t[o]=s=e([i,a])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}},assign:function(e){var t={};return function(r,n){var i=r.dtype,a=r.order,o=n.dtype,s=n.order,l=[i,a.join(),o,s.join()].join(),c=t[l];return c||(t[l]=c=e([i,a,o,s])),c(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset)}}};function a(e){return function(e){return(0,i[e.funcName])(n.bind(void 0,e))}({funcName:e.funcName})}var o={mul:"*",div:"/"};(function(){for(var e in o)t[e]=a({funcName:e}),t[e+"s"]=a({funcName:e+"s"}),t[e+"seq"]=a({funcName:e+"seq"})})(),t.assign=a({funcName:"assign"})},9994:function(e,t,r){var n=r(9618),i=r(8277);e.exports=function(e,t){for(var r=[],a=e,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(t||(t=n(new Float64Array(o),r)),i(t,e),t)}},8277:function(e){var t,r,n=function(){return function(e,t,r,n,i){var a=e[0],o=e[1],s=e[2],l=r[0],c=r[1],u=r[2],h=[0,0,0];n|=0;var f=0,p=0,d=0,m=u,g=c-s*u,y=l-o*c;for(d=0;d<a;++d){for(p=0;p<o;++p){for(f=0;f<s;++f){var v,x=i;for(v=0;v<h.length-1;++v)x=x[h[v]];t[n]=x[h[h.length-1]],n+=m,++h[2]}n+=g,h[2]-=s,++h[1]}n+=y,h[1]-=o,++h[0]}}};e.exports=(t=n.bind(void 0,{funcName:"convert"}),r={},function(e,n){var i=e.dtype,a=e.order,o=[i,a.join()].join(),s=r[o];return s||(r[o]=s=t([i,a])),s(e.shape.slice(0),e.data,e.stride,0|e.offset,n)})},7640:function(e,t,r){var n=r(1888);function i(e){return"uint32"===e?[n.mallocUint32,n.freeUint32]:null}var a={"uint32,1,0":function(e,t){return function(r,n,i,a,o,s,l,c,u,h,f){var p,d,m,g,y,v,x,_,b=r*o+a,w=e(c);for(p=r+1;p<=n;++p){for(d=p,m=b+=o,y=0,v=b,g=0;g<c;++g)w[y++]=i[v],v+=u;e:for(;d-- >r;){y=0,v=m-o;t:for(g=0;g<c;++g){if((x=i[v])<(_=w[y]))break e;if(x>_)break t;v+=h,y+=f}for(y=m,v=m-o,g=0;g<c;++g)i[y]=i[v],y+=u,v+=u;m-=o}for(y=m,v=0,g=0;g<c;++g)i[y]=w[v++],y+=u}t(w)}}},o={"uint32,1,0":function(e,t,r){return function n(i,a,o,s,l,c,u,h,f,p,d){var m,g,y,v,x,_,b,w,T,k,A,M,S,E,C,I,L,P,z,D,O,R,F,B,j,N=(a-i+1)/6|0,U=i+N,V=a-N,q=i+a>>1,H=q-N,G=q+N,W=U,Z=H,Y=q,X=G,$=V,K=i+1,J=a-1,Q=!0,ee=0,te=0,re=0,ne=h,ie=t(ne),ae=t(ne);A=l*W,M=l*Z,j=s;e:for(k=0;k<h;++k){if(w=M+j,(re=o[b=A+j]-o[w])>0){g=W,W=Z,Z=g;break e}if(re<0)break e;j+=p}A=l*X,M=l*$,j=s;e:for(k=0;k<h;++k){if(w=M+j,(re=o[b=A+j]-o[w])>0){g=X,X=$,$=g;break e}if(re<0)break e;j+=p}A=l*W,M=l*Y,j=s;e:for(k=0;k<h;++k){if(w=M+j,(re=o[b=A+j]-o[w])>0){g=W,W=Y,Y=g;break e}if(re<0)break e;j+=p}A=l*Z,M=l*Y,j=s;e:for(k=0;k<h;++k){if(w=M+j,(re=o[b=A+j]-o[w])>0){g=Z,Z=Y,Y=g;break e}if(re<0)break e;j+=p}A=l*W,M=l*X,j=s;e:for(k=0;k<h;++k){if(w=M+j,(re=o[b=A+j]-o[w])>0){g=W,W=X,X=g;break e}if(re<0)break e;j+=p}A=l*Y,M=l*X,j=s;e:for(k=0;k<h;++k){if(w=M+j,(re=o[b=A+j]-o[w])>0){g=Y,Y=X,X=g;break e}if(re<0)break e;j+=p}A=l*Z,M=l*$,j=s;e:for(k=0;k<h;++k){if(w=M+j,(re=o[b=A+j]-o[w])>0){g=Z,Z=$,$=g;break e}if(re<0)break e;j+=p}A=l*Z,M=l*Y,j=s;e:for(k=0;k<h;++k){if(w=M+j,(re=o[b=A+j]-o[w])>0){g=Z,Z=Y,Y=g;break e}if(re<0)break e;j+=p}A=l*X,M=l*$,j=s;e:for(k=0;k<h;++k){if(w=M+j,(re=o[b=A+j]-o[w])>0){g=X,X=$,$=g;break e}if(re<0)break e;j+=p}for(A=l*W,M=l*Z,S=l*Y,E=l*X,C=l*$,I=l*U,L=l*q,P=l*V,B=0,j=s,k=0;k<h;++k)b=A+j,w=M+j,T=S+j,z=E+j,D=C+j,O=I+j,R=L+j,F=P+j,ie[B]=o[w],ae[B]=o[z],Q=Q&&ie[B]===ae[B],y=o[b],v=o[T],x=o[D],o[O]=y,o[R]=v,o[F]=x,++B,j+=f;for(A=l*H,M=l*i,j=s,k=0;k<h;++k)w=M+j,o[b=A+j]=o[w],j+=f;for(A=l*G,M=l*a,j=s,k=0;k<h;++k)w=M+j,o[b=A+j]=o[w],j+=f;if(Q)for(_=K;_<=J;++_){for(b=s+_*l,B=0,k=0;k<h&&0==(re=o[b]-ie[B]);++k)B+=d,b+=p;if(0!==re)if(re<0){if(_!==K)for(A=l*_,M=l*K,j=s,k=0;k<h;++k)w=M+j,m=o[b=A+j],o[b]=o[w],o[w]=m,j+=f;++K}else for(;;){for(b=s+J*l,B=0,k=0;k<h&&0==(re=o[b]-ie[B]);++k)B+=d,b+=p;if(!(re>0)){if(re<0){for(A=l*_,M=l*K,S=l*J,j=s,k=0;k<h;++k)w=M+j,T=S+j,m=o[b=A+j],o[b]=o[w],o[w]=o[T],o[T]=m,j+=f;++K,--J;break}for(A=l*_,M=l*J,j=s,k=0;k<h;++k)w=M+j,m=o[b=A+j],o[b]=o[w],o[w]=m,j+=f;--J;break}J--}}else for(_=K;_<=J;++_){for(b=s+_*l,B=0,k=0;k<h&&0==(ee=o[b]-ie[B]);++k)B+=d,b+=p;if(ee<0){if(_!==K)for(A=l*_,M=l*K,j=s,k=0;k<h;++k)w=M+j,m=o[b=A+j],o[b]=o[w],o[w]=m,j+=f;++K}else{for(b=s+_*l,B=0,k=0;k<h&&0==(te=o[b]-ae[B]);++k)B+=d,b+=p;if(te>0)for(;;){for(b=s+J*l,B=0,k=0;k<h&&0==(re=o[b]-ae[B]);++k)B+=d,b+=p;if(!(re>0)){for(b=s+J*l,B=0,k=0;k<h&&0==(re=o[b]-ie[B]);++k)B+=d,b+=p;if(re<0){for(A=l*_,M=l*K,S=l*J,j=s,k=0;k<h;++k)w=M+j,T=S+j,m=o[b=A+j],o[b]=o[w],o[w]=o[T],o[T]=m,j+=f;++K,--J}else{for(A=l*_,M=l*J,j=s,k=0;k<h;++k)w=M+j,m=o[b=A+j],o[b]=o[w],o[w]=m,j+=f;--J}break}if(--J<_)break}}}for(A=l*i,M=l*(K-1),B=0,j=s,k=0;k<h;++k)w=M+j,o[b=A+j]=o[w],o[w]=ie[B],++B,j+=f;for(A=l*a,M=l*(J+1),B=0,j=s,k=0;k<h;++k)w=M+j,o[b=A+j]=o[w],o[w]=ae[B],++B,j+=f;if(K-2-i<=32?e(i,K-2,o,s,l,c,u,h,f,p,d):n(i,K-2,o,s,l,c,u,h,f,p,d),a-(J+2)<=32?e(J+2,a,o,s,l,c,u,h,f,p,d):n(J+2,a,o,s,l,c,u,h,f,p,d),Q)return r(ie),void r(ae);if(K<U&&J>V){e:for(;;){for(b=s+K*l,B=0,j=s,k=0;k<h;++k){if(o[b]!==ie[B])break e;++B,b+=f}++K}e:for(;;){for(b=s+J*l,B=0,j=s,k=0;k<h;++k){if(o[b]!==ae[B])break e;++B,b+=f}--J}for(_=K;_<=J;++_){for(b=s+_*l,B=0,k=0;k<h&&0==(ee=o[b]-ie[B]);++k)B+=d,b+=p;if(0===ee){if(_!==K)for(A=l*_,M=l*K,j=s,k=0;k<h;++k)w=M+j,m=o[b=A+j],o[b]=o[w],o[w]=m,j+=f;++K}else{for(b=s+_*l,B=0,k=0;k<h&&0==(te=o[b]-ae[B]);++k)B+=d,b+=p;if(0===te)for(;;){for(b=s+J*l,B=0,k=0;k<h&&0==(re=o[b]-ae[B]);++k)B+=d,b+=p;if(0!==re){for(b=s+J*l,B=0,k=0;k<h&&0==(re=o[b]-ie[B]);++k)B+=d,b+=p;if(re<0){for(A=l*_,M=l*K,S=l*J,j=s,k=0;k<h;++k)w=M+j,T=S+j,m=o[b=A+j],o[b]=o[w],o[w]=o[T],o[T]=m,j+=f;++K,--J}else{for(A=l*_,M=l*J,j=s,k=0;k<h;++k)w=M+j,m=o[b=A+j],o[b]=o[w],o[w]=m,j+=f;--J}break}if(--J<_)break}}}}r(ie),r(ae),J-K<=32?e(K,J,o,s,l,c,u,h,f,p,d):n(K,J,o,s,l,c,u,h,f,p,d)}}},s={"uint32,1,0":function(e,t){return function(r){var n=r.data,i=0|r.offset,a=r.shape,o=r.stride,s=0|o[0],l=0|a[0],c=0|o[1],u=0|a[1],h=c,f=c;l<=32?e(0,l-1,n,i,s,c,l,u,h,f,1):t(0,l-1,n,i,s,c,l,u,h,f,1)}}};e.exports=function(e,t){var r=[t,e].join(","),n=s[r],l=function(e,t){var r=i(t),n=[t,e].join(","),o=a[n];return r?o(r[0],r[1]):o()}(e,t),c=function(e,t,r){var n=i(t),a=[t,e].join(","),s=o[a];return e.length>1&&n?s(r,n[0],n[1]):s(r)}(e,t,l);return n(l,c)}},446:function(e,t,r){var n=r(7640),i={};e.exports=function(e){var t=e.order,r=e.dtype,a=[t,r].join(":"),o=i[a];return o||(i[a]=o=n(t,r)),o(e),e}},9618:function(e,t,r){var n=r(7163),i=typeof Float64Array<"u";function a(e,t){return e[0]-t[0]}function o(){var e,t=this.stride,r=new Array(t.length);for(e=0;e<r.length;++e)r[e]=[Math.abs(t[e]),e];r.sort(a);var n=new Array(r.length);for(e=0;e<n.length;++e)n[e]=r[e][1];return n}var s={T:function(e){function t(e){this.data=e}var r=t.prototype;return r.dtype=e,r.index=function(){return-1},r.size=0,r.dimension=-1,r.shape=r.stride=r.order=[],r.lo=r.hi=r.transpose=r.step=function(){return new t(this.data)},r.get=r.set=function(){},r.pick=function(){return null},function(e){return new t(e)}},0:function(e,t){function r(e,t){this.data=e,this.offset=t}var n=r.prototype;return n.dtype=e,n.index=function(){return this.offset},n.dimension=0,n.size=1,n.shape=n.stride=n.order=[],n.lo=n.hi=n.transpose=n.step=function(){return new r(this.data,this.offset)},n.pick=function(){return t(this.data)},n.valueOf=n.get=function(){return"generic"===e?this.data.get(this.offset):this.data[this.offset]},n.set=function(t){return"generic"===e?this.data.set(this.offset,t):this.data[this.offset]=t},function(e,t,n,i){return new r(e,i)}},1:function(e,t,r){function n(e,t,r,n){this.data=e,this.shape=[t],this.stride=[r],this.offset=0|n}var i=n.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,r){return"generic"===e?this.data.set(this.offset+this.stride[0]*t,r):this.data[this.offset+this.stride[0]*t]=r},i.get=function(t){return"generic"===e?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 n(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,this.stride[0],this.offset)},i.lo=function(e){var t=this.offset,r=0,i=this.shape[0],a=this.stride[0];return"number"==typeof e&&e>=0&&(t+=a*(r=0|e),i-=r),new n(this.data,i,a,t)},i.step=function(e){var t=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"==typeof e&&((a=0|e)<0?(i+=r*(t-1),t=o(-t/a)):t=o(t/a),r*=a),new n(this.data,t,r,i)},i.transpose=function(e){e=void 0===e?0:0|e;var t=this.shape,r=this.stride;return new n(this.data,t[e],r[e],this.offset)},i.pick=function(e){var r=[],n=[],i=this.offset;return"number"==typeof e&&e>=0?i=i+this.stride[0]*e|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,t[r.length+1])(this.data,r,n,i)},function(e,t,r,i){return new n(e,t[0],r[0],i)}},2:function(e,t,r){function n(e,t,r,n,i,a){this.data=e,this.shape=[t,r],this.stride=[n,i],this.offset=0|a}var i=n.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,r,n){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]=n},i.get=function(t,r){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]},i.index=function(e,t){return this.offset+this.stride[0]*e+this.stride[1]*t},i.hi=function(e,t){return new n(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,"number"!=typeof t||t<0?this.shape[1]:0|t,this.stride[0],this.stride[1],this.offset)},i.lo=function(e,t){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof e&&e>=0&&(r+=s*(i=0|e),a-=i),"number"==typeof t&&t>=0&&(r+=l*(i=0|t),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(e,t){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,c=Math.ceil;return"number"==typeof e&&((l=0|e)<0?(s+=a*(r-1),r=c(-r/l)):r=c(r/l),a*=l),"number"==typeof t&&((l=0|t)<0?(s+=o*(i-1),i=c(-i/l)):i=c(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(e,t){e=void 0===e?0:0|e,t=void 0===t?1:0|t;var r=this.shape,i=this.stride;return new n(this.data,r[e],r[t],i[e],i[t],this.offset)},i.pick=function(e,r){var n=[],i=[],a=this.offset;return"number"==typeof e&&e>=0?a=a+this.stride[0]*e|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"==typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,t[n.length+1])(this.data,n,i,a)},function(e,t,r,i){return new n(e,t[0],t[1],r[0],r[1],i)}},3:function(e,t,r){function n(e,t,r,n,i,a,o,s){this.data=e,this.shape=[t,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.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]),r=Math.abs(this.stride[2]);return e>t?t>r?[2,1,0]:e>r?[1,2,0]:[1,0,2]:e>r?[2,0,1]:r>t?[0,1,2]:[0,2,1]}}),i.set=function(t,r,n,i){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(t,r,n){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]},i.index=function(e,t,r){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r},i.hi=function(e,t,r){return new n(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,"number"!=typeof t||t<0?this.shape[1]:0|t,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(e,t,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.stride[0],u=this.stride[1],h=this.stride[2];return"number"==typeof e&&e>=0&&(i+=c*(a=0|e),o-=a),"number"==typeof t&&t>=0&&(i+=u*(a=0|t),s-=a),"number"==typeof r&&r>=0&&(i+=h*(a=0|r),l-=a),new n(this.data,o,s,l,c,u,h,i)},i.step=function(e,t,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],c=this.stride[2],u=this.offset,h=0,f=Math.ceil;return"number"==typeof e&&((h=0|e)<0?(u+=s*(i-1),i=f(-i/h)):i=f(i/h),s*=h),"number"==typeof t&&((h=0|t)<0?(u+=l*(a-1),a=f(-a/h)):a=f(a/h),l*=h),"number"==typeof r&&((h=0|r)<0?(u+=c*(o-1),o=f(-o/h)):o=f(o/h),c*=h),new n(this.data,i,a,o,s,l,c,u)},i.transpose=function(e,t,r){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[e],i[t],i[r],a[e],a[t],a[r],this.offset)},i.pick=function(e,r,n){var i=[],a=[],o=this.offset;return"number"==typeof e&&e>=0?o=o+this.stride[0]*e|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"==typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,t[i.length+1])(this.data,i,a,o)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],r[0],r[1],r[2],i)}},4:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,c){this.data=e,this.shape=[t,r,n,i],this.stride=[a,o,s,l],this.offset=0|c}var i=n.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:r}),i.set=function(t,r,n,i,a){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(t,r,n,i){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(e,t,r,n){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n},i.hi=function(e,t,r,i){return new n(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,"number"!=typeof t||t<0?this.shape[1]:0|t,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(e,t,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],c=this.shape[2],u=this.shape[3],h=this.stride[0],f=this.stride[1],p=this.stride[2],d=this.stride[3];return"number"==typeof e&&e>=0&&(a+=h*(o=0|e),s-=o),"number"==typeof t&&t>=0&&(a+=f*(o=0|t),l-=o),"number"==typeof r&&r>=0&&(a+=p*(o=0|r),c-=o),"number"==typeof i&&i>=0&&(a+=d*(o=0|i),u-=o),new n(this.data,s,l,c,u,h,f,p,d,a)},i.step=function(e,t,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],c=this.stride[0],u=this.stride[1],h=this.stride[2],f=this.stride[3],p=this.offset,d=0,m=Math.ceil;return"number"==typeof e&&((d=0|e)<0?(p+=c*(a-1),a=m(-a/d)):a=m(a/d),c*=d),"number"==typeof t&&((d=0|t)<0?(p+=u*(o-1),o=m(-o/d)):o=m(o/d),u*=d),"number"==typeof r&&((d=0|r)<0?(p+=h*(s-1),s=m(-s/d)):s=m(s/d),h*=d),"number"==typeof i&&((d=0|i)<0?(p+=f*(l-1),l=m(-l/d)):l=m(l/d),f*=d),new n(this.data,a,o,s,l,c,u,h,f,p)},i.transpose=function(e,t,r,i){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[e],a[t],a[r],a[i],o[e],o[t],o[r],o[i],this.offset)},i.pick=function(e,r,n,i){var a=[],o=[],s=this.offset;return"number"==typeof e&&e>=0?s=s+this.stride[0]*e|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"==typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,t[a.length+1])(this.data,a,o,s)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],r[0],r[1],r[2],r[3],i)}},5:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,c,u,h){this.data=e,this.shape=[t,r,n,i,a],this.stride=[o,s,l,c,u],this.offset=0|h}var i=n.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:r}),i.set=function(t,r,n,i,a,o){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(t,r,n,i,a){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(e,t,r,n,i){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(e,t,r,i,a){return new n(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,"number"!=typeof t||t<0?this.shape[1]:0|t,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,"number"!=typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(e,t,r,i,a){var o=this.offset,s=0,l=this.shape[0],c=this.shape[1],u=this.shape[2],h=this.shape[3],f=this.shape[4],p=this.stride[0],d=this.stride[1],m=this.stride[2],g=this.stride[3],y=this.stride[4];return"number"==typeof e&&e>=0&&(o+=p*(s=0|e),l-=s),"number"==typeof t&&t>=0&&(o+=d*(s=0|t),c-=s),"number"==typeof r&&r>=0&&(o+=m*(s=0|r),u-=s),"number"==typeof i&&i>=0&&(o+=g*(s=0|i),h-=s),"number"==typeof a&&a>=0&&(o+=y*(s=0|a),f-=s),new n(this.data,l,c,u,h,f,p,d,m,g,y,o)},i.step=function(e,t,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.shape[3],u=this.shape[4],h=this.stride[0],f=this.stride[1],p=this.stride[2],d=this.stride[3],m=this.stride[4],g=this.offset,y=0,v=Math.ceil;return"number"==typeof e&&((y=0|e)<0?(g+=h*(o-1),o=v(-o/y)):o=v(o/y),h*=y),"number"==typeof t&&((y=0|t)<0?(g+=f*(s-1),s=v(-s/y)):s=v(s/y),f*=y),"number"==typeof r&&((y=0|r)<0?(g+=p*(l-1),l=v(-l/y)):l=v(l/y),p*=y),"number"==typeof i&&((y=0|i)<0?(g+=d*(c-1),c=v(-c/y)):c=v(c/y),d*=y),"number"==typeof a&&((y=0|a)<0?(g+=m*(u-1),u=v(-u/y)):u=v(u/y),m*=y),new n(this.data,o,s,l,c,u,h,f,p,d,m,g)},i.transpose=function(e,t,r,i,a){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[e],o[t],o[r],o[i],o[a],s[e],s[t],s[r],s[i],s[a],this.offset)},i.pick=function(e,r,n,i,a){var o=[],s=[],l=this.offset;return"number"==typeof e&&e>=0?l=l+this.stride[0]*e|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,t[o.length+1])(this.data,o,s,l)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],t[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(e,t){var r=-1===t?"T":String(t),n=s[r];return-1===t?n(e):0===t?n(e,c[e][0]):n(e,c[e],o)}var c={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};e.exports=function(e,t,r,a){if(void 0===e)return(0,c.array[0])([]);"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var o=t.length;if(void 0===r){r=new Array(o);for(var s=o-1,u=1;s>=0;--s)r[s]=u,u*=t[s]}if(void 0===a)for(a=0,s=0;s<o;++s)r[s]<0&&(a-=(t[s]-1)*r[s]);for(var h=function(e){if(n(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"}(e),f=c[h];f.length<=o+1;)f.push(l(h,f.length-1));return(0,f[o+1])(e,t,r,a)}},1278:function(e,t,r){var n=r(2361),i=Math.pow(2,-1074),a=-1>>>0;e.exports=function(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(0===e)return t<0?-i:i;var r=n.hi(e),o=n.lo(e);return t>e==e>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},8406:function(e,t){t.vertexNormals=function(e,t,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;o<n;++o)i[o]=[0,0,0];for(o=0;o<e.length;++o)for(var s=e[o],l=0,c=s[s.length-1],u=s[0],h=0;h<s.length;++h){l=c,c=u,u=s[(h+1)%s.length];for(var f=t[l],p=t[c],d=t[u],m=new Array(3),g=0,y=new Array(3),v=0,x=0;x<3;++x)m[x]=f[x]-p[x],g+=m[x]*m[x],y[x]=d[x]-p[x],v+=y[x]*y[x];if(g*v>a){var _=i[c],b=1/Math.sqrt(g*v);for(x=0;x<3;++x){var w=(x+1)%3,T=(x+2)%3;_[x]+=b*(y[w]*m[T]-y[T]*m[w])}}}for(o=0;o<n;++o){_=i[o];var k=0;for(x=0;x<3;++x)k+=_[x]*_[x];if(k>a)for(b=1/Math.sqrt(k),x=0;x<3;++x)_[x]*=b;else for(x=0;x<3;++x)_[x]=0}return i},t.faceNormals=function(e,t,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;o<n;++o){for(var s=e[o],l=new Array(3),c=0;c<3;++c)l[c]=t[s[c]];var u=new Array(3),h=new Array(3);for(c=0;c<3;++c)u[c]=l[1][c]-l[0][c],h[c]=l[2][c]-l[0][c];var f=new Array(3),p=0;for(c=0;c<3;++c){var d=(c+1)%3,m=(c+2)%3;f[c]=u[d]*h[m]-u[m]*h[d],p+=f[c]*f[c]}for(p=p>a?1/Math.sqrt(p):0,c=0;c<3;++c)f[c]*=p;i[o]=f}return i}},4081:function(e){e.exports=function(e,t,r,n,i,a,o,s,l,c){var u=t+a+c;if(h>0){var h=Math.sqrt(u+1);e[0]=.5*(o-l)/h,e[1]=.5*(s-n)/h,e[2]=.5*(r-a)/h,e[3]=.5*h}else{var f=Math.max(t,a,c);h=Math.sqrt(2*f-u+1),t>=f?(e[0]=.5*h,e[1]=.5*(i+r)/h,e[2]=.5*(s+n)/h,e[3]=.5*(o-l)/h):a>=f?(e[0]=.5*(r+i)/h,e[1]=.5*h,e[2]=.5*(l+o)/h,e[3]=.5*(s-n)/h):(e[0]=.5*(n+s)/h,e[1]=.5*(o+l)/h,e[2]=.5*h,e[3]=.5*(r-i)/h)}return e}},9977:function(e,t,r){e.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.rotation||[0,0,0,1],n=e.radius||1;t=[].slice.call(t,0,3),u(r=[].slice.call(r,0,4),r);var i=new h(r,t,Math.log(n));return i.setDistanceLimits(e.zoomMin,e.zoomMax),("eye"in e||"up"in e)&&i.lookAt(0,e.eye,e.center,e.up),i};var n=r(9215),i=r(6582),a=r(7399),o=r(7608),s=r(4081);function l(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function c(e,t,r,n){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2)+Math.pow(n,2))}function u(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=c(r,n,i,a);o>1e-6?(e[0]=r/o,e[1]=n/o,e[2]=i/o,e[3]=a/o):(e[0]=e[1]=e[2]=0,e[3]=1)}function h(e,t,r){this.radius=n([r]),this.center=n(t),this.rotation=n(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=h.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 r=this.computedMatrix;a(r,t);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var c=0,h=0;h<3;++h)c+=r[l+4*h]*i[h];r[12+l]=-c}},f.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r},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,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],h=i[4],f=i[8],p=u*a+h*o+f*s,d=l(u-=a*p,h-=o*p,f-=s*p);u/=d,h/=d,f/=d;var m=i[2],g=i[6],y=i[10],v=m*a+g*o+y*s,x=m*u+g*h+y*f,_=l(m-=v*a+x*u,g-=v*o+x*h,y-=v*s+x*f);m/=_,g/=_,y/=_;var b=u*t+a*r,w=h*t+o*r,T=f*t+s*r;this.center.move(e,b,w,T);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+n),this.radius.set(e,Math.log(k))},f.rotate=function(e,t,r,n){this.recalcMatrix(e),t=t||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],u=i[1],h=i[5],f=i[9],p=i[2],d=i[6],m=i[10],g=t*a+r*u,y=t*o+r*h,v=t*s+r*f,x=-(d*v-m*y),_=-(m*g-p*v),b=-(p*y-d*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(_,2)-Math.pow(b,2))),T=c(x,_,b,w);T>1e-6?(x/=T,_/=T,b/=T,w/=T):(x=_=b=0,w=1);var k=this.computedRotation,A=k[0],M=k[1],S=k[2],E=k[3],C=A*w+E*x+M*b-S*_,I=M*w+E*_+S*x-A*b,L=S*w+E*b+A*_-M*x,P=E*w-A*x-M*_-S*b;if(n){x=p,_=d,b=m;var z=Math.sin(n)/l(x,_,b);x*=z,_*=z,b*=z,P=P*(w=Math.cos(t))-(C=C*w+P*x+I*b-L*_)*x-(I=I*w+P*_+L*x-C*b)*_-(L=L*w+P*b+C*_-I*x)*b}var D=c(C,I,L,P);D>1e-6?(C/=D,I/=D,L/=D,P/=D):(C=I=L=0,P=1),this.rotation.set(e,C,I,L,P)},f.lookAt=function(e,t,r,n){this.recalcMatrix(e),r=r||this.computedCenter,t=t||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,t,r,n);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 l=0,c=0;c<3;++c)l+=Math.pow(r[c]-t[c],2);this.radius.set(e,.5*Math.log(Math.max(l,1e-6))),this.center.set(e,r[0],r[1],r[2])},f.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},f.setMatrix=function(e,t){var r=this.computedRotation;s(r,t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]),u(r,r),this.rotation.set(e,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,t);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,c=n[14]/i;this.recalcMatrix(e);var h=Math.exp(this.computedRadius[0]);this.center.set(e,a-n[2]*h,l-n[6]*h,c-n[10]*h),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(),r=e.center;r&&this.center.set(t,r[0],r[1],r[2]);var n=e.rotation;n&&this.rotation.set(t,n[0],n[1],n[2],n[3]);var i=e.distance;i&&i>0&&this.radius.set(t,Math.log(i)),this.setDistanceLimits(e.zoomMin,e.zoomMax)}},1371:function(e,t,r){var n=r(3233);e.exports=function(e,t,r){return n(r=typeof r<"u"?r+"":" ",t)+e}},3202:function(e){e.exports=function(e,t){t||(t=[0,""]),e=String(e);var r=parseFloat(e,10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}},3088:function(e,t,r){e.exports=function(e,t){for(var r=0|t.length,i=e.length,a=[new Array(r),new Array(r)],o=0;o<r;++o)a[0][o]=[],a[1][o]=[];for(o=0;o<i;++o){var s=e[o];a[0][s[0]].push(s),a[1][s[1]].push(s)}var l,c=[];for(o=0;o<r;++o)a[0][o].length+a[1][o].length===0&&c.push([o]);function u(e,t){var r=a[t][e[t]];r.splice(r.indexOf(e),1)}function h(e,r,i){for(var o,s,l,c=0;c<2;++c)if(a[c][r].length>0){o=a[c][r][0],l=c;break}s=o[1^l];for(var h=0;h<2;++h)for(var f=a[h][r],p=0;p<f.length;++p){var d=f[p],m=d[1^h];n(t[e],t[r],t[s],t[m])>0&&(o=d,s=m,l=h)}return i||o&&u(o,l),s}function f(e,r){var i=a[r][e][0],o=[e];u(i,r);for(var s=i[1^r];;){for(;s!==e;)o.push(s),s=h(o[o.length-2],s,!1);if(a[0][e].length+a[1][e].length===0)break;var l=o[o.length-1],c=e,f=o[1],p=h(l,c,!0);if(n(t[l],t[c],t[f],t[p])<0)break;o.push(e),s=h(l,c)}return o}for(o=0;o<r;++o)for(var p=0;p<2;++p){for(var d=[];a[p][o].length>0;){a[0][o].length;var m=f(o,p);(l=m)[1]===l[l.length-1]?d.push.apply(d,m):(d.length>0&&c.push(d),d=m)}d.length>0&&c.push(d)}return c};var n=r(3140)},5609:function(e,t,r){e.exports=function(e,t){for(var r=n(e,t.length),i=new Array(t.length),a=new Array(t.length),o=[],s=0;s<t.length;++s){var l=r[s].length;a[s]=l,i[s]=!0,l<=1&&o.push(s)}for(;o.length>0;){i[p=o.pop()]=!1;var c=r[p];for(s=0;s<c.length;++s){var u=c[s];0==--a[u]&&o.push(u)}}var h=new Array(t.length),f=[];for(s=0;s<t.length;++s)if(i[s]){var p=f.length;h[s]=p,f.push(t[s])}else h[s]=-1;var d=[];for(s=0;s<e.length;++s){var m=e[s];i[m[0]]&&i[m[1]]&&d.push([h[m[0]],h[m[1]]])}return[d,f]};var n=r(3134)},2095:function(e,t,r){e.exports=function(e,t){var r=c(e,t);e=r[0];for(var h=(t=r[1]).length,f=(e.length,n(e,t.length)),p=0;p<h;++p)if(f[p].length%2==1)throw new Error("planar-graph-to-polyline: graph must be manifold");var d=i(e,t),m=(d=d.filter((function(e){for(var r=e.length,n=[0],i=0;i<r;++i){var a=t[e[i]],l=t[e[(i+1)%r]],c=o(-a[0],a[1]),u=o(-a[0],l[1]),h=o(l[0],a[1]),f=o(l[0],l[1]);n=s(n,s(s(c,u),s(h,f)))}return n[n.length-1]>0}))).length,g=new Array(m),y=new Array(m);for(p=0;p<m;++p){g[p]=p;var v=new Array(m),x=d[p].map((function(e){return t[e]})),_=a([x]),b=0;e:for(var w=0;w<m;++w)if(v[w]=0,p!==w){for(var T=(q=d[w]).length,k=0;k<T;++k){var A=_(t[q[k]]);if(0!==A){A<0&&(v[w]=1,b+=1);continue e}}v[w]=1,b+=1}y[p]=[b,p,v]}for(y.sort((function(e,t){return t[0]-e[0]})),p=0;p<m;++p){var M=(v=y[p])[1],S=v[2];for(w=0;w<m;++w)S[w]&&(g[w]=M)}var E=function(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=[];return t}(m);for(p=0;p<m;++p)E[p].push(g[p]),E[g[p]].push(p);var C={},I=u(h,!1);for(p=0;p<m;++p)for(T=(q=d[p]).length,w=0;w<T;++w){var L=q[w],P=q[(w+1)%T],z=Math.min(L,P)+":"+Math.max(L,P);if(z in C){var D=C[z];E[D].push(p),E[p].push(D),I[L]=I[P]=!0}else C[z]=p}function O(e){for(var t=e.length,r=0;r<t;++r)if(!I[e[r]])return!1;return!0}var R=[],F=u(m,-1);for(p=0;p<m;++p)g[p]!==p||O(d[p])?F[p]=-1:(R.push(p),F[p]=0);for(r=[];R.length>0;){var B=R.pop(),j=E[B];l(j,(function(e,t){return e-t}));var N,U=j.length,V=F[B];for(0===V&&(N=[q=d[B]]),p=0;p<U;++p){var q,H=j[p];F[H]>=0||(F[H]=1^V,R.push(H),0!==V)||O(q=d[H])||(q.reverse(),N.push(q))}0===V&&r.push(N)}return r};var n=r(3134),i=r(3088),a=r(5085),o=r(5250),s=r(8210),l=r(1682),c=r(5609);function u(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=t;return r}},5085:function(e,t,r){e.exports=function(e){for(var t=e.length,r=[],a=[],s=0;s<t;++s)for(var u=e[s],h=u.length,f=h-1,p=0;p<h;f=p++){var d=u[f],m=u[p];d[0]===m[0]?a.push([d,m]):r.push([d,m])}if(0===r.length)return 0===a.length?c:function(e){return function(t){return e(t[0],t[1])?0:1}}(l(a));var g=i(r),y=function(e,t){return function(r){var i=o.le(t,r[0]);if(i<0)return 1;var a=e[i];if(!a){if(!(i>0&&t[i]===r[0]))return 1;a=e[i-1]}for(var s=1;a;){var l=a.key,c=n(r,l[0],l[1]);if(l[0][0]<l[1][0])if(c<0)a=a.left;else{if(!(c>0))return 0;s=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<0))return 0;s=1,a=a.right}}return s}}(g.slabs,g.coordinates);return 0===a.length?y:function(e,t){return function(r){return e(r[0],r[1])?0:t(r)}}(l(a),y)};var n=r(3250)[3],i=r(4209),a=r(3352),o=r(2478);function s(){return!0}function l(e){for(var t={},r=0;r<e.length;++r){var n=e[r],i=n[0][0],o=n[0][1],l=n[1][1],c=[Math.min(o,l),Math.max(o,l)];i in t?t[i].push(c):t[i]=[c]}var u={},h=Object.keys(t);for(r=0;r<h.length;++r){var f=t[h[r]];u[h[r]]=a(f)}return function(e){return function(t,r){var n=e[t];return!!n&&!!n.queryPoint(r,s)}}(u)}function c(e){return 1}},9346:function(e){var t=new Float64Array(4),r=new Float64Array(4),n=new Float64Array(4);e.exports=function(e,i,a,o,s){t.length<o.length&&(t=new Float64Array(o.length),r=new Float64Array(o.length),n=new Float64Array(o.length));for(var l=0;l<o.length;++l)t[l]=e[l]-o[l],r[l]=i[l]-e[l],n[l]=a[l]-e[l];var c=0,u=0,h=0,f=0,p=0,d=0;for(l=0;l<o.length;++l){var m=r[l],g=n[l],y=t[l];c+=m*m,u+=m*g,h+=g*g,f+=y*m,p+=y*g,d+=y*y}var v,x,_,b,w,T=Math.abs(c*h-u*u),k=u*p-h*f,A=u*f-c*p;if(k+A<=T)if(k<0)A<0&&f<0?(A=0,-f>=c?(k=1,v=c+2*f+d):v=f*(k=-f/c)+d):(k=0,p>=0?(A=0,v=d):-p>=h?(A=1,v=h+2*p+d):v=p*(A=-p/h)+d);else if(A<0)A=0,f>=0?(k=0,v=d):-f>=c?(k=1,v=c+2*f+d):v=f*(k=-f/c)+d;else{var M=1/T;v=(k*=M)*(c*k+u*(A*=M)+2*f)+A*(u*k+h*A+2*p)+d}else k<0?(_=h+p)>(x=u+f)?(b=_-x)>=(w=c-2*u+h)?(k=1,A=0,v=c+2*f+d):v=(k=b/w)*(c*k+u*(A=1-k)+2*f)+A*(u*k+h*A+2*p)+d:(k=0,_<=0?(A=1,v=h+2*p+d):p>=0?(A=0,v=d):v=p*(A=-p/h)+d):A<0?(_=c+f)>(x=u+p)?(b=_-x)>=(w=c-2*u+h)?(A=1,k=0,v=h+2*p+d):v=(k=1-(A=b/w))*(c*k+u*A+2*f)+A*(u*k+h*A+2*p)+d:(A=0,_<=0?(k=1,v=c+2*f+d):f>=0?(k=0,v=d):v=f*(k=-f/c)+d):(b=h+p-u-f)<=0?(k=0,A=1,v=h+2*p+d):b>=(w=c-2*u+h)?(k=1,A=0,v=c+2*f+d):v=(k=b/w)*(c*k+u*(A=1-k)+2*f)+A*(u*k+h*A+2*p)+d;var S=1-k-A;for(l=0;l<o.length;++l)s[l]=S*e[l]+k*i[l]+A*a[l];return v<0?0:v}},8648:function(e,t,r){e.exports=r(783)},2653:function(e,t,r){var n=r(3865);e.exports=function(e,t){for(var r=e.length,i=new Array(r),a=0;a<r;++a)i[a]=n(e[a],t[a]);return i}},5838:function(e,t,r){e.exports=function(e){for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=n(e[r]);return t};var n=r(7842)},8987:function(e,t,r){var n=r(7842),i=r(6504);e.exports=function(e,t){for(var r=n(t),a=e.length,o=new Array(a),s=0;s<a;++s)o[s]=i(e[s],r);return o}},544:function(e,t,r){var n=r(5572);e.exports=function(e,t){for(var r=e.length,i=new Array(r),a=0;a<r;++a)i[a]=n(e[a],t[a]);return i}},5771:function(e,t,r){var n=r(8507),i=r(3788),a=r(2419);e.exports=function(e){e.sort(i);for(var t=e.length,r=0,o=0;o<t;++o){var s=e[o],l=a(s);if(0!==l){if(r>0){var c=e[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}e[r++]=s}}return e.length=r,e}},3233:function(e){var t,r="";e.exports=function(e,n){if("string"!=typeof e)throw new TypeError("expected a string");if(1===n)return e;if(2===n)return e+e;var i=e.length*n;if(t!==e||typeof t>"u")t=e,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=e),n>>=1,e+=e;return r=(r+=e).substr(0,i)}},3025:function(e,t,r){e.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(e){e.exports=function(e){for(var t=e.length,r=e[e.length-1],n=t,i=t-2;i>=0;--i){var a=r;(l=(s=e[i])-((r=a+s)-a))&&(e[--n]=r,r=l)}var o=0;for(i=n;i<t;++i){var s,l;(l=(s=r)-((r=(a=e[i])+s)-a))&&(e[o++]=l)}return e[o++]=r,e.length=o,e}},2962:function(e,t,r){var n=r(5250),i=r(8210),a=r(3012),o=r(7004);function s(e,t,r,n){return function(t){return n(e(r(t[0][0],t[1][1]),r(-t[0][1],t[1][0])))}}function l(e,t,r,n){return function(i){return n(e(t(e(r(i[1][1],i[2][2]),r(-i[1][2],i[2][1])),i[0][0]),e(t(e(r(i[1][0],i[2][2]),r(-i[1][2],i[2][0])),-i[0][1]),t(e(r(i[1][0],i[2][1]),r(-i[1][1],i[2][0])),i[0][2]))))}}function c(e,t,r,n){return function(i){return n(e(e(t(e(t(e(r(i[2][2],i[3][3]),r(-i[2][3],i[3][2])),i[1][1]),e(t(e(r(i[2][1],i[3][3]),r(-i[2][3],i[3][1])),-i[1][2]),t(e(r(i[2][1],i[3][2]),r(-i[2][2],i[3][1])),i[1][3]))),i[0][0]),t(e(t(e(r(i[2][2],i[3][3]),r(-i[2][3],i[3][2])),i[1][0]),e(t(e(r(i[2][0],i[3][3]),r(-i[2][3],i[3][0])),-i[1][2]),t(e(r(i[2][0],i[3][2]),r(-i[2][2],i[3][0])),i[1][3]))),-i[0][1])),e(t(e(t(e(r(i[2][1],i[3][3]),r(-i[2][3],i[3][1])),i[1][0]),e(t(e(r(i[2][0],i[3][3]),r(-i[2][3],i[3][0])),-i[1][1]),t(e(r(i[2][0],i[3][1]),r(-i[2][1],i[3][0])),i[1][3]))),i[0][2]),t(e(t(e(r(i[2][1],i[3][2]),r(-i[2][2],i[3][1])),i[1][0]),e(t(e(r(i[2][0],i[3][2]),r(-i[2][2],i[3][0])),-i[1][1]),t(e(r(i[2][0],i[3][1]),r(-i[2][1],i[3][0])),i[1][2]))),-i[0][3]))))}}function u(e,t,r,n){return function(i){return n(e(e(t(e(e(t(e(t(e(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][2]),e(t(e(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),-i[2][3]),t(e(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][4]))),i[1][1]),t(e(t(e(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][1]),e(t(e(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][3]),t(e(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][4]))),-i[1][2])),e(t(e(t(e(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][1]),e(t(e(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][2]),t(e(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][4]))),i[1][3]),t(e(t(e(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][1]),e(t(e(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),-i[2][2]),t(e(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][3]))),-i[1][4]))),i[0][0]),t(e(e(t(e(t(e(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][2]),e(t(e(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),-i[2][3]),t(e(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][4]))),i[1][0]),t(e(t(e(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][0]),e(t(e(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][3]),t(e(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),i[2][4]))),-i[1][2])),e(t(e(t(e(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][0]),e(t(e(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][2]),t(e(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][4]))),i[1][3]),t(e(t(e(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][0]),e(t(e(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][2]),t(e(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][3]))),-i[1][4]))),-i[0][1])),e(t(e(e(t(e(t(e(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][1]),e(t(e(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][3]),t(e(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][4]))),i[1][0]),t(e(t(e(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][0]),e(t(e(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][3]),t(e(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),i[2][4]))),-i[1][1])),e(t(e(t(e(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),i[2][0]),e(t(e(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][1]),t(e(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][4]))),i[1][3]),t(e(t(e(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][0]),e(t(e(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][1]),t(e(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][3]))),-i[1][4]))),i[0][2]),e(t(e(e(t(e(t(e(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][1]),e(t(e(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][2]),t(e(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][4]))),i[1][0]),t(e(t(e(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][0]),e(t(e(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][2]),t(e(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][4]))),-i[1][1])),e(t(e(t(e(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),i[2][0]),e(t(e(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][1]),t(e(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][4]))),i[1][2]),t(e(t(e(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][0]),e(t(e(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),-i[2][1]),t(e(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][2]))),-i[1][4]))),-i[0][3]),t(e(e(t(e(t(e(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][1]),e(t(e(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),-i[2][2]),t(e(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][3]))),i[1][0]),t(e(t(e(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][0]),e(t(e(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][2]),t(e(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][3]))),-i[1][1])),e(t(e(t(e(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][0]),e(t(e(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][1]),t(e(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][3]))),i[1][2]),t(e(t(e(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][0]),e(t(e(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),-i[2][1]),t(e(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][2]))),-i[1][3]))),i[0][4])))))}}function h(e){return(2===e?s:3===e?l:4===e?c:5===e?u:void 0)(i,a,n,o)}var f=[function(){return[0]},function(e){return[e[0][0]]}];function p(e,t,r,n,i,a,o,s){return function(l){switch(l.length){case 0:return e(l);case 1:return t(l);case 2:return r(l);case 3:return n(l);case 4:return i(l);case 5:return a(l)}var c=o[l.length];return c||(c=o[l.length]=s(l.length)),c(l)}}!function(){for(;f.length<6;)f.push(h(f.length));e.exports=p.apply(void 0,f.concat([f,h]));for(var t=0;t<f.length;++t)e.exports[t]=f[t]}()},1944:function(e,t,r){var n=r(5250),i=r(8210);e.exports=function(e,t){for(var r=n(e[0],t[0]),a=1;a<e.length;++a)r=i(r,n(e[a],t[a]));return r}},2646:function(e,t,r){var n=r(5250),i=r(8210),a=r(8545),o=r(3012);function s(e){return(3===e?l:4===e?c:5===e?u:h)(i,a,n,o)}function l(e,t,r,n){return function(i,a,o){var s=r(i[0],i[0]),l=n(s,a[0]),c=n(s,o[0]),u=r(a[0],a[0]),h=n(u,i[0]),f=n(u,o[0]),p=r(o[0],o[0]),d=n(p,i[0]),m=n(p,a[0]),g=e(t(m,f),t(h,l)),y=t(d,c),v=t(g,y);return v[v.length-1]}}function c(e,t,r,n){return function(i,a,o,s){var l=e(r(i[0],i[0]),r(i[1],i[1])),c=n(l,a[0]),u=n(l,o[0]),h=n(l,s[0]),f=e(r(a[0],a[0]),r(a[1],a[1])),p=n(f,i[0]),d=n(f,o[0]),m=n(f,s[0]),g=e(r(o[0],o[0]),r(o[1],o[1])),y=n(g,i[0]),v=n(g,a[0]),x=n(g,s[0]),_=e(r(s[0],s[0]),r(s[1],s[1])),b=n(_,i[0]),w=n(_,a[0]),T=n(_,o[0]),k=e(e(n(t(T,x),a[1]),e(n(t(w,m),-o[1]),n(t(v,d),s[1]))),e(n(t(w,m),i[1]),e(n(t(b,h),-a[1]),n(t(p,c),s[1])))),A=e(e(n(t(T,x),i[1]),e(n(t(b,h),-o[1]),n(t(y,u),s[1]))),e(n(t(v,d),i[1]),e(n(t(y,u),-a[1]),n(t(p,c),o[1])))),M=t(k,A);return M[M.length-1]}}function u(e,t,r,n){return function(i,a,o,s,l){var c=e(r(i[0],i[0]),e(r(i[1],i[1]),r(i[2],i[2]))),u=n(c,a[0]),h=n(c,o[0]),f=n(c,s[0]),p=n(c,l[0]),d=e(r(a[0],a[0]),e(r(a[1],a[1]),r(a[2],a[2]))),m=n(d,i[0]),g=n(d,o[0]),y=n(d,s[0]),v=n(d,l[0]),x=e(r(o[0],o[0]),e(r(o[1],o[1]),r(o[2],o[2]))),_=n(x,i[0]),b=n(x,a[0]),w=n(x,s[0]),T=n(x,l[0]),k=e(r(s[0],s[0]),e(r(s[1],s[1]),r(s[2],s[2]))),A=n(k,i[0]),M=n(k,a[0]),S=n(k,o[0]),E=n(k,l[0]),C=e(r(l[0],l[0]),e(r(l[1],l[1]),r(l[2],l[2]))),I=n(C,i[0]),L=n(C,a[0]),P=n(C,o[0]),z=n(C,s[0]),D=e(e(e(n(e(n(t(z,E),o[1]),e(n(t(P,T),-s[1]),n(t(S,w),l[1]))),a[2]),e(n(e(n(t(z,E),a[1]),e(n(t(L,v),-s[1]),n(t(M,y),l[1]))),-o[2]),n(e(n(t(P,T),a[1]),e(n(t(L,v),-o[1]),n(t(b,g),l[1]))),s[2]))),e(n(e(n(t(S,w),a[1]),e(n(t(M,y),-o[1]),n(t(b,g),s[1]))),-l[2]),e(n(e(n(t(z,E),a[1]),e(n(t(L,v),-s[1]),n(t(M,y),l[1]))),i[2]),n(e(n(t(z,E),i[1]),e(n(t(I,p),-s[1]),n(t(A,f),l[1]))),-a[2])))),e(e(n(e(n(t(L,v),i[1]),e(n(t(I,p),-a[1]),n(t(m,u),l[1]))),s[2]),e(n(e(n(t(M,y),i[1]),e(n(t(A,f),-a[1]),n(t(m,u),s[1]))),-l[2]),n(e(n(t(S,w),a[1]),e(n(t(M,y),-o[1]),n(t(b,g),s[1]))),i[2]))),e(n(e(n(t(S,w),i[1]),e(n(t(A,f),-o[1]),n(t(_,h),s[1]))),-a[2]),e(n(e(n(t(M,y),i[1]),e(n(t(A,f),-a[1]),n(t(m,u),s[1]))),o[2]),n(e(n(t(b,g),i[1]),e(n(t(_,h),-a[1]),n(t(m,u),o[1]))),-s[2]))))),O=e(e(e(n(e(n(t(z,E),o[1]),e(n(t(P,T),-s[1]),n(t(S,w),l[1]))),i[2]),n(e(n(t(z,E),i[1]),e(n(t(I,p),-s[1]),n(t(A,f),l[1]))),-o[2])),e(n(e(n(t(P,T),i[1]),e(n(t(I,p),-o[1]),n(t(_,h),l[1]))),s[2]),n(e(n(t(S,w),i[1]),e(n(t(A,f),-o[1]),n(t(_,h),s[1]))),-l[2]))),e(e(n(e(n(t(P,T),a[1]),e(n(t(L,v),-o[1]),n(t(b,g),l[1]))),i[2]),n(e(n(t(P,T),i[1]),e(n(t(I,p),-o[1]),n(t(_,h),l[1]))),-a[2])),e(n(e(n(t(L,v),i[1]),e(n(t(I,p),-a[1]),n(t(m,u),l[1]))),o[2]),n(e(n(t(b,g),i[1]),e(n(t(_,h),-a[1]),n(t(m,u),o[1]))),-l[2])))),R=t(D,O);return R[R.length-1]}}function h(e,t,r,n){return function(i,a,o,s,l,c){var u=e(e(r(i[0],i[0]),r(i[1],i[1])),e(r(i[2],i[2]),r(i[3],i[3]))),h=n(u,a[0]),f=n(u,o[0]),p=n(u,s[0]),d=n(u,l[0]),m=n(u,c[0]),g=e(e(r(a[0],a[0]),r(a[1],a[1])),e(r(a[2],a[2]),r(a[3],a[3]))),y=n(g,i[0]),v=n(g,o[0]),x=n(g,s[0]),_=n(g,l[0]),b=n(g,c[0]),w=e(e(r(o[0],o[0]),r(o[1],o[1])),e(r(o[2],o[2]),r(o[3],o[3]))),T=n(w,i[0]),k=n(w,a[0]),A=n(w,s[0]),M=n(w,l[0]),S=n(w,c[0]),E=e(e(r(s[0],s[0]),r(s[1],s[1])),e(r(s[2],s[2]),r(s[3],s[3]))),C=n(E,i[0]),I=n(E,a[0]),L=n(E,o[0]),P=n(E,l[0]),z=n(E,c[0]),D=e(e(r(l[0],l[0]),r(l[1],l[1])),e(r(l[2],l[2]),r(l[3],l[3]))),O=n(D,i[0]),R=n(D,a[0]),F=n(D,o[0]),B=n(D,s[0]),j=n(D,c[0]),N=e(e(r(c[0],c[0]),r(c[1],c[1])),e(r(c[2],c[2]),r(c[3],c[3]))),U=n(N,i[0]),V=n(N,a[0]),q=n(N,o[0]),H=n(N,s[0]),G=n(N,l[0]),W=e(e(e(n(e(e(n(e(n(t(G,j),s[1]),e(n(t(H,z),-l[1]),n(t(B,P),c[1]))),o[2]),n(e(n(t(G,j),o[1]),e(n(t(q,S),-l[1]),n(t(F,M),c[1]))),-s[2])),e(n(e(n(t(H,z),o[1]),e(n(t(q,S),-s[1]),n(t(L,A),c[1]))),l[2]),n(e(n(t(B,P),o[1]),e(n(t(F,M),-s[1]),n(t(L,A),l[1]))),-c[2]))),a[3]),e(n(e(e(n(e(n(t(G,j),s[1]),e(n(t(H,z),-l[1]),n(t(B,P),c[1]))),a[2]),n(e(n(t(G,j),a[1]),e(n(t(V,b),-l[1]),n(t(R,_),c[1]))),-s[2])),e(n(e(n(t(H,z),a[1]),e(n(t(V,b),-s[1]),n(t(I,x),c[1]))),l[2]),n(e(n(t(B,P),a[1]),e(n(t(R,_),-s[1]),n(t(I,x),l[1]))),-c[2]))),-o[3]),n(e(e(n(e(n(t(G,j),o[1]),e(n(t(q,S),-l[1]),n(t(F,M),c[1]))),a[2]),n(e(n(t(G,j),a[1]),e(n(t(V,b),-l[1]),n(t(R,_),c[1]))),-o[2])),e(n(e(n(t(q,S),a[1]),e(n(t(V,b),-o[1]),n(t(k,v),c[1]))),l[2]),n(e(n(t(F,M),a[1]),e(n(t(R,_),-o[1]),n(t(k,v),l[1]))),-c[2]))),s[3]))),e(e(n(e(e(n(e(n(t(H,z),o[1]),e(n(t(q,S),-s[1]),n(t(L,A),c[1]))),a[2]),n(e(n(t(H,z),a[1]),e(n(t(V,b),-s[1]),n(t(I,x),c[1]))),-o[2])),e(n(e(n(t(q,S),a[1]),e(n(t(V,b),-o[1]),n(t(k,v),c[1]))),s[2]),n(e(n(t(L,A),a[1]),e(n(t(I,x),-o[1]),n(t(k,v),s[1]))),-c[2]))),-l[3]),n(e(e(n(e(n(t(B,P),o[1]),e(n(t(F,M),-s[1]),n(t(L,A),l[1]))),a[2]),n(e(n(t(B,P),a[1]),e(n(t(R,_),-s[1]),n(t(I,x),l[1]))),-o[2])),e(n(e(n(t(F,M),a[1]),e(n(t(R,_),-o[1]),n(t(k,v),l[1]))),s[2]),n(e(n(t(L,A),a[1]),e(n(t(I,x),-o[1]),n(t(k,v),s[1]))),-l[2]))),c[3])),e(n(e(e(n(e(n(t(G,j),s[1]),e(n(t(H,z),-l[1]),n(t(B,P),c[1]))),a[2]),n(e(n(t(G,j),a[1]),e(n(t(V,b),-l[1]),n(t(R,_),c[1]))),-s[2])),e(n(e(n(t(H,z),a[1]),e(n(t(V,b),-s[1]),n(t(I,x),c[1]))),l[2]),n(e(n(t(B,P),a[1]),e(n(t(R,_),-s[1]),n(t(I,x),l[1]))),-c[2]))),i[3]),n(e(e(n(e(n(t(G,j),s[1]),e(n(t(H,z),-l[1]),n(t(B,P),c[1]))),i[2]),n(e(n(t(G,j),i[1]),e(n(t(U,m),-l[1]),n(t(O,d),c[1]))),-s[2])),e(n(e(n(t(H,z),i[1]),e(n(t(U,m),-s[1]),n(t(C,p),c[1]))),l[2]),n(e(n(t(B,P),i[1]),e(n(t(O,d),-s[1]),n(t(C,p),l[1]))),-c[2]))),-a[3])))),e(e(e(n(e(e(n(e(n(t(G,j),a[1]),e(n(t(V,b),-l[1]),n(t(R,_),c[1]))),i[2]),n(e(n(t(G,j),i[1]),e(n(t(U,m),-l[1]),n(t(O,d),c[1]))),-a[2])),e(n(e(n(t(V,b),i[1]),e(n(t(U,m),-a[1]),n(t(y,h),c[1]))),l[2]),n(e(n(t(R,_),i[1]),e(n(t(O,d),-a[1]),n(t(y,h),l[1]))),-c[2]))),s[3]),n(e(e(n(e(n(t(H,z),a[1]),e(n(t(V,b),-s[1]),n(t(I,x),c[1]))),i[2]),n(e(n(t(H,z),i[1]),e(n(t(U,m),-s[1]),n(t(C,p),c[1]))),-a[2])),e(n(e(n(t(V,b),i[1]),e(n(t(U,m),-a[1]),n(t(y,h),c[1]))),s[2]),n(e(n(t(I,x),i[1]),e(n(t(C,p),-a[1]),n(t(y,h),s[1]))),-c[2]))),-l[3])),e(n(e(e(n(e(n(t(B,P),a[1]),e(n(t(R,_),-s[1]),n(t(I,x),l[1]))),i[2]),n(e(n(t(B,P),i[1]),e(n(t(O,d),-s[1]),n(t(C,p),l[1]))),-a[2])),e(n(e(n(t(R,_),i[1]),e(n(t(O,d),-a[1]),n(t(y,h),l[1]))),s[2]),n(e(n(t(I,x),i[1]),e(n(t(C,p),-a[1]),n(t(y,h),s[1]))),-l[2]))),c[3]),n(e(e(n(e(n(t(H,z),o[1]),e(n(t(q,S),-s[1]),n(t(L,A),c[1]))),a[2]),n(e(n(t(H,z),a[1]),e(n(t(V,b),-s[1]),n(t(I,x),c[1]))),-o[2])),e(n(e(n(t(q,S),a[1]),e(n(t(V,b),-o[1]),n(t(k,v),c[1]))),s[2]),n(e(n(t(L,A),a[1]),e(n(t(I,x),-o[1]),n(t(k,v),s[1]))),-c[2]))),i[3]))),e(e(n(e(e(n(e(n(t(H,z),o[1]),e(n(t(q,S),-s[1]),n(t(L,A),c[1]))),i[2]),n(e(n(t(H,z),i[1]),e(n(t(U,m),-s[1]),n(t(C,p),c[1]))),-o[2])),e(n(e(n(t(q,S),i[1]),e(n(t(U,m),-o[1]),n(t(T,f),c[1]))),s[2]),n(e(n(t(L,A),i[1]),e(n(t(C,p),-o[1]),n(t(T,f),s[1]))),-c[2]))),-a[3]),n(e(e(n(e(n(t(H,z),a[1]),e(n(t(V,b),-s[1]),n(t(I,x),c[1]))),i[2]),n(e(n(t(H,z),i[1]),e(n(t(U,m),-s[1]),n(t(C,p),c[1]))),-a[2])),e(n(e(n(t(V,b),i[1]),e(n(t(U,m),-a[1]),n(t(y,h),c[1]))),s[2]),n(e(n(t(I,x),i[1]),e(n(t(C,p),-a[1]),n(t(y,h),s[1]))),-c[2]))),o[3])),e(n(e(e(n(e(n(t(q,S),a[1]),e(n(t(V,b),-o[1]),n(t(k,v),c[1]))),i[2]),n(e(n(t(q,S),i[1]),e(n(t(U,m),-o[1]),n(t(T,f),c[1]))),-a[2])),e(n(e(n(t(V,b),i[1]),e(n(t(U,m),-a[1]),n(t(y,h),c[1]))),o[2]),n(e(n(t(k,v),i[1]),e(n(t(T,f),-a[1]),n(t(y,h),o[1]))),-c[2]))),-s[3]),n(e(e(n(e(n(t(L,A),a[1]),e(n(t(I,x),-o[1]),n(t(k,v),s[1]))),i[2]),n(e(n(t(L,A),i[1]),e(n(t(C,p),-o[1]),n(t(T,f),s[1]))),-a[2])),e(n(e(n(t(I,x),i[1]),e(n(t(C,p),-a[1]),n(t(y,h),s[1]))),o[2]),n(e(n(t(k,v),i[1]),e(n(t(T,f),-a[1]),n(t(y,h),o[1]))),-s[2]))),c[3]))))),Z=e(e(e(n(e(e(n(e(n(t(G,j),s[1]),e(n(t(H,z),-l[1]),n(t(B,P),c[1]))),o[2]),n(e(n(t(G,j),o[1]),e(n(t(q,S),-l[1]),n(t(F,M),c[1]))),-s[2])),e(n(e(n(t(H,z),o[1]),e(n(t(q,S),-s[1]),n(t(L,A),c[1]))),l[2]),n(e(n(t(B,P),o[1]),e(n(t(F,M),-s[1]),n(t(L,A),l[1]))),-c[2]))),i[3]),e(n(e(e(n(e(n(t(G,j),s[1]),e(n(t(H,z),-l[1]),n(t(B,P),c[1]))),i[2]),n(e(n(t(G,j),i[1]),e(n(t(U,m),-l[1]),n(t(O,d),c[1]))),-s[2])),e(n(e(n(t(H,z),i[1]),e(n(t(U,m),-s[1]),n(t(C,p),c[1]))),l[2]),n(e(n(t(B,P),i[1]),e(n(t(O,d),-s[1]),n(t(C,p),l[1]))),-c[2]))),-o[3]),n(e(e(n(e(n(t(G,j),o[1]),e(n(t(q,S),-l[1]),n(t(F,M),c[1]))),i[2]),n(e(n(t(G,j),i[1]),e(n(t(U,m),-l[1]),n(t(O,d),c[1]))),-o[2])),e(n(e(n(t(q,S),i[1]),e(n(t(U,m),-o[1]),n(t(T,f),c[1]))),l[2]),n(e(n(t(F,M),i[1]),e(n(t(O,d),-o[1]),n(t(T,f),l[1]))),-c[2]))),s[3]))),e(e(n(e(e(n(e(n(t(H,z),o[1]),e(n(t(q,S),-s[1]),n(t(L,A),c[1]))),i[2]),n(e(n(t(H,z),i[1]),e(n(t(U,m),-s[1]),n(t(C,p),c[1]))),-o[2])),e(n(e(n(t(q,S),i[1]),e(n(t(U,m),-o[1]),n(t(T,f),c[1]))),s[2]),n(e(n(t(L,A),i[1]),e(n(t(C,p),-o[1]),n(t(T,f),s[1]))),-c[2]))),-l[3]),n(e(e(n(e(n(t(B,P),o[1]),e(n(t(F,M),-s[1]),n(t(L,A),l[1]))),i[2]),n(e(n(t(B,P),i[1]),e(n(t(O,d),-s[1]),n(t(C,p),l[1]))),-o[2])),e(n(e(n(t(F,M),i[1]),e(n(t(O,d),-o[1]),n(t(T,f),l[1]))),s[2]),n(e(n(t(L,A),i[1]),e(n(t(C,p),-o[1]),n(t(T,f),s[1]))),-l[2]))),c[3])),e(n(e(e(n(e(n(t(G,j),o[1]),e(n(t(q,S),-l[1]),n(t(F,M),c[1]))),a[2]),n(e(n(t(G,j),a[1]),e(n(t(V,b),-l[1]),n(t(R,_),c[1]))),-o[2])),e(n(e(n(t(q,S),a[1]),e(n(t(V,b),-o[1]),n(t(k,v),c[1]))),l[2]),n(e(n(t(F,M),a[1]),e(n(t(R,_),-o[1]),n(t(k,v),l[1]))),-c[2]))),i[3]),n(e(e(n(e(n(t(G,j),o[1]),e(n(t(q,S),-l[1]),n(t(F,M),c[1]))),i[2]),n(e(n(t(G,j),i[1]),e(n(t(U,m),-l[1]),n(t(O,d),c[1]))),-o[2])),e(n(e(n(t(q,S),i[1]),e(n(t(U,m),-o[1]),n(t(T,f),c[1]))),l[2]),n(e(n(t(F,M),i[1]),e(n(t(O,d),-o[1]),n(t(T,f),l[1]))),-c[2]))),-a[3])))),e(e(e(n(e(e(n(e(n(t(G,j),a[1]),e(n(t(V,b),-l[1]),n(t(R,_),c[1]))),i[2]),n(e(n(t(G,j),i[1]),e(n(t(U,m),-l[1]),n(t(O,d),c[1]))),-a[2])),e(n(e(n(t(V,b),i[1]),e(n(t(U,m),-a[1]),n(t(y,h),c[1]))),l[2]),n(e(n(t(R,_),i[1]),e(n(t(O,d),-a[1]),n(t(y,h),l[1]))),-c[2]))),o[3]),n(e(e(n(e(n(t(q,S),a[1]),e(n(t(V,b),-o[1]),n(t(k,v),c[1]))),i[2]),n(e(n(t(q,S),i[1]),e(n(t(U,m),-o[1]),n(t(T,f),c[1]))),-a[2])),e(n(e(n(t(V,b),i[1]),e(n(t(U,m),-a[1]),n(t(y,h),c[1]))),o[2]),n(e(n(t(k,v),i[1]),e(n(t(T,f),-a[1]),n(t(y,h),o[1]))),-c[2]))),-l[3])),e(n(e(e(n(e(n(t(F,M),a[1]),e(n(t(R,_),-o[1]),n(t(k,v),l[1]))),i[2]),n(e(n(t(F,M),i[1]),e(n(t(O,d),-o[1]),n(t(T,f),l[1]))),-a[2])),e(n(e(n(t(R,_),i[1]),e(n(t(O,d),-a[1]),n(t(y,h),l[1]))),o[2]),n(e(n(t(k,v),i[1]),e(n(t(T,f),-a[1]),n(t(y,h),o[1]))),-l[2]))),c[3]),n(e(e(n(e(n(t(B,P),o[1]),e(n(t(F,M),-s[1]),n(t(L,A),l[1]))),a[2]),n(e(n(t(B,P),a[1]),e(n(t(R,_),-s[1]),n(t(I,x),l[1]))),-o[2])),e(n(e(n(t(F,M),a[1]),e(n(t(R,_),-o[1]),n(t(k,v),l[1]))),s[2]),n(e(n(t(L,A),a[1]),e(n(t(I,x),-o[1]),n(t(k,v),s[1]))),-l[2]))),i[3]))),e(e(n(e(e(n(e(n(t(B,P),o[1]),e(n(t(F,M),-s[1]),n(t(L,A),l[1]))),i[2]),n(e(n(t(B,P),i[1]),e(n(t(O,d),-s[1]),n(t(C,p),l[1]))),-o[2])),e(n(e(n(t(F,M),i[1]),e(n(t(O,d),-o[1]),n(t(T,f),l[1]))),s[2]),n(e(n(t(L,A),i[1]),e(n(t(C,p),-o[1]),n(t(T,f),s[1]))),-l[2]))),-a[3]),n(e(e(n(e(n(t(B,P),a[1]),e(n(t(R,_),-s[1]),n(t(I,x),l[1]))),i[2]),n(e(n(t(B,P),i[1]),e(n(t(O,d),-s[1]),n(t(C,p),l[1]))),-a[2])),e(n(e(n(t(R,_),i[1]),e(n(t(O,d),-a[1]),n(t(y,h),l[1]))),s[2]),n(e(n(t(I,x),i[1]),e(n(t(C,p),-a[1]),n(t(y,h),s[1]))),-l[2]))),o[3])),e(n(e(e(n(e(n(t(F,M),a[1]),e(n(t(R,_),-o[1]),n(t(k,v),l[1]))),i[2]),n(e(n(t(F,M),i[1]),e(n(t(O,d),-o[1]),n(t(T,f),l[1]))),-a[2])),e(n(e(n(t(R,_),i[1]),e(n(t(O,d),-a[1]),n(t(y,h),l[1]))),o[2]),n(e(n(t(k,v),i[1]),e(n(t(T,f),-a[1]),n(t(y,h),o[1]))),-l[2]))),-s[3]),n(e(e(n(e(n(t(L,A),a[1]),e(n(t(I,x),-o[1]),n(t(k,v),s[1]))),i[2]),n(e(n(t(L,A),i[1]),e(n(t(C,p),-o[1]),n(t(T,f),s[1]))),-a[2])),e(n(e(n(t(I,x),i[1]),e(n(t(C,p),-a[1]),n(t(y,h),s[1]))),o[2]),n(e(n(t(k,v),i[1]),e(n(t(T,f),-a[1]),n(t(y,h),o[1]))),-s[2]))),l[3]))))),Y=t(W,Z);return Y[Y.length-1]}}var f=[function(){return 0},function(){return 0},function(){return 0}];function p(e){var t=f[e.length];return t||(t=f[e.length]=s(e.length)),t.apply(void 0,e)}function d(e,t,r,n,i,a,o,s){return function(t,r,l,c,u,h){switch(arguments.length){case 0:case 1:return 0;case 2:return n(t,r);case 3:return i(t,r,l);case 4:return a(t,r,l,c);case 5:return o(t,r,l,c,u);case 6:return s(t,r,l,c,u,h)}for(var f=new Array(arguments.length),p=0;p<arguments.length;++p)f[p]=arguments[p];return e(f)}}!function(){for(;f.length<=6;)f.push(s(f.length));e.exports=d.apply(void 0,[p].concat(f));for(var t=0;t<=6;++t)e.exports[t]=f[t]}()},727:function(e,t,r){var n=r(2962);function i(e){return(2===e?a:3===e?o:4===e?s:5===e?l:c)(e<6?n[e]:n)}function a(e){return function(t,r){return[e([[+r[0],+t[0][1]],[+r[1],+t[1][1]]]),e([[+t[0][0],+r[0]],[+t[1][0],+r[1]]]),e(t)]}}function o(e){return function(t,r){return[e([[+r[0],+t[0][1],+t[0][2]],[+r[1],+t[1][1],+t[1][2]],[+r[2],+t[2][1],+t[2][2]]]),e([[+t[0][0],+r[0],+t[0][2]],[+t[1][0],+r[1],+t[1][2]],[+t[2][0],+r[2],+t[2][2]]]),e([[+t[0][0],+t[0][1],+r[0]],[+t[1][0],+t[1][1],+r[1]],[+t[2][0],+t[2][1],+r[2]]]),e(t)]}}function s(e){return function(t,r){return[e([[+r[0],+t[0][1],+t[0][2],+t[0][3]],[+r[1],+t[1][1],+t[1][2],+t[1][3]],[+r[2],+t[2][1],+t[2][2],+t[2][3]],[+r[3],+t[3][1],+t[3][2],+t[3][3]]]),e([[+t[0][0],+r[0],+t[0][2],+t[0][3]],[+t[1][0],+r[1],+t[1][2],+t[1][3]],[+t[2][0],+r[2],+t[2][2],+t[2][3]],[+t[3][0],+r[3],+t[3][2],+t[3][3]]]),e([[+t[0][0],+t[0][1],+r[0],+t[0][3]],[+t[1][0],+t[1][1],+r[1],+t[1][3]],[+t[2][0],+t[2][1],+r[2],+t[2][3]],[+t[3][0],+t[3][1],+r[3],+t[3][3]]]),e([[+t[0][0],+t[0][1],+t[0][2],+r[0]],[+t[1][0],+t[1][1],+t[1][2],+r[1]],[+t[2][0],+t[2][1],+t[2][2],+r[2]],[+t[3][0],+t[3][1],+t[3][2],+r[3]]]),e(t)]}}function l(e){return function(t,r){return[e([[+r[0],+t[0][1],+t[0][2],+t[0][3],+t[0][4]],[+r[1],+t[1][1],+t[1][2],+t[1][3],+t[1][4]],[+r[2],+t[2][1],+t[2][2],+t[2][3],+t[2][4]],[+r[3],+t[3][1],+t[3][2],+t[3][3],+t[3][4]],[+r[4],+t[4][1],+t[4][2],+t[4][3],+t[4][4]]]),e([[+t[0][0],+r[0],+t[0][2],+t[0][3],+t[0][4]],[+t[1][0],+r[1],+t[1][2],+t[1][3],+t[1][4]],[+t[2][0],+r[2],+t[2][2],+t[2][3],+t[2][4]],[+t[3][0],+r[3],+t[3][2],+t[3][3],+t[3][4]],[+t[4][0],+r[4],+t[4][2],+t[4][3],+t[4][4]]]),e([[+t[0][0],+t[0][1],+r[0],+t[0][3],+t[0][4]],[+t[1][0],+t[1][1],+r[1],+t[1][3],+t[1][4]],[+t[2][0],+t[2][1],+r[2],+t[2][3],+t[2][4]],[+t[3][0],+t[3][1],+r[3],+t[3][3],+t[3][4]],[+t[4][0],+t[4][1],+r[4],+t[4][3],+t[4][4]]]),e([[+t[0][0],+t[0][1],+t[0][2],+r[0],+t[0][4]],[+t[1][0],+t[1][1],+t[1][2],+r[1],+t[1][4]],[+t[2][0],+t[2][1],+t[2][2],+r[2],+t[2][4]],[+t[3][0],+t[3][1],+t[3][2],+r[3],+t[3][4]],[+t[4][0],+t[4][1],+t[4][2],+r[4],+t[4][4]]]),e([[+t[0][0],+t[0][1],+t[0][2],+t[0][3],+r[0]],[+t[1][0],+t[1][1],+t[1][2],+t[1][3],+r[1]],[+t[2][0],+t[2][1],+t[2][2],+t[2][3],+r[2]],[+t[3][0],+t[3][1],+t[3][2],+t[3][3],+r[3]],[+t[4][0],+t[4][1],+t[4][2],+t[4][3],+r[4]]]),e(t)]}}function c(e){return function(t,r){return[e([[+r[0],+t[0][1],+t[0][2],+t[0][3],+t[0][4],+t[0][5]],[+r[1],+t[1][1],+t[1][2],+t[1][3],+t[1][4],+t[1][5]],[+r[2],+t[2][1],+t[2][2],+t[2][3],+t[2][4],+t[2][5]],[+r[3],+t[3][1],+t[3][2],+t[3][3],+t[3][4],+t[3][5]],[+r[4],+t[4][1],+t[4][2],+t[4][3],+t[4][4],+t[4][5]],[+r[5],+t[5][1],+t[5][2],+t[5][3],+t[5][4],+t[5][5]]]),e([[+t[0][0],+r[0],+t[0][2],+t[0][3],+t[0][4],+t[0][5]],[+t[1][0],+r[1],+t[1][2],+t[1][3],+t[1][4],+t[1][5]],[+t[2][0],+r[2],+t[2][2],+t[2][3],+t[2][4],+t[2][5]],[+t[3][0],+r[3],+t[3][2],+t[3][3],+t[3][4],+t[3][5]],[+t[4][0],+r[4],+t[4][2],+t[4][3],+t[4][4],+t[4][5]],[+t[5][0],+r[5],+t[5][2],+t[5][3],+t[5][4],+t[5][5]]]),e([[+t[0][0],+t[0][1],+r[0],+t[0][3],+t[0][4],+t[0][5]],[+t[1][0],+t[1][1],+r[1],+t[1][3],+t[1][4],+t[1][5]],[+t[2][0],+t[2][1],+r[2],+t[2][3],+t[2][4],+t[2][5]],[+t[3][0],+t[3][1],+r[3],+t[3][3],+t[3][4],+t[3][5]],[+t[4][0],+t[4][1],+r[4],+t[4][3],+t[4][4],+t[4][5]],[+t[5][0],+t[5][1],+r[5],+t[5][3],+t[5][4],+t[5][5]]]),e([[+t[0][0],+t[0][1],+t[0][2],+r[0],+t[0][4],+t[0][5]],[+t[1][0],+t[1][1],+t[1][2],+r[1],+t[1][4],+t[1][5]],[+t[2][0],+t[2][1],+t[2][2],+r[2],+t[2][4],+t[2][5]],[+t[3][0],+t[3][1],+t[3][2],+r[3],+t[3][4],+t[3][5]],[+t[4][0],+t[4][1],+t[4][2],+r[4],+t[4][4],+t[4][5]],[+t[5][0],+t[5][1],+t[5][2],+r[5],+t[5][4],+t[5][5]]]),e([[+t[0][0],+t[0][1],+t[0][2],+t[0][3],+r[0],+t[0][5]],[+t[1][0],+t[1][1],+t[1][2],+t[1][3],+r[1],+t[1][5]],[+t[2][0],+t[2][1],+t[2][2],+t[2][3],+r[2],+t[2][5]],[+t[3][0],+t[3][1],+t[3][2],+t[3][3],+r[3],+t[3][5]],[+t[4][0],+t[4][1],+t[4][2],+t[4][3],+r[4],+t[4][5]],[+t[5][0],+t[5][1],+t[5][2],+t[5][3],+r[5],+t[5][5]]]),e([[+t[0][0],+t[0][1],+t[0][2],+t[0][3],+t[0][4],+r[0]],[+t[1][0],+t[1][1],+t[1][2],+t[1][3],+t[1][4],+r[1]],[+t[2][0],+t[2][1],+t[2][2],+t[2][3],+t[2][4],+r[2]],[+t[3][0],+t[3][1],+t[3][2],+t[3][3],+t[3][4],+r[3]],[+t[4][0],+t[4][1],+t[4][2],+t[4][3],+t[4][4],+r[4]],[+t[5][0],+t[5][1],+t[5][2],+t[5][3],+t[5][4],+r[5]]]),e(t)]}}var u=[function(){return[[0]]},function(e,t){return[[t[0]],[e[0][0]]]}];function h(e,t,r,n,i,a,o,s){return function(l,c){switch(l.length){case 0:return e(l,c);case 1:return t(l,c);case 2:return r(l,c);case 3:return n(l,c);case 4:return i(l,c);case 5:return a(l,c)}var u=o[l.length];return u||(u=o[l.length]=s(l.length)),u(l,c)}}!function(){for(;u.length<6;)u.push(i(u.length));e.exports=h.apply(void 0,u.concat([u,i]));for(var t=0;t<6;++t)e.exports[t]=u[t]}()},3250:function(e,t,r){var n=r(5250),i=r(8210),a=r(3012),o=r(8545),s=11102230246251565e-32,l=(3+16*s)*s,c=(7+56*s)*s;function u(e,t,r,n){return function(r,i,a){var o=e(e(t(i[1],a[0]),t(-a[1],i[0])),e(t(r[1],i[0]),t(-i[1],r[0]))),s=e(t(r[1],a[0]),t(-a[1],r[0])),l=n(o,s);return l[l.length-1]}}function h(e,t,r,n){return function(i,a,o,s){var l=e(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),a[2]),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]))),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),s[2])))),c=e(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),s[2]))),e(r(e(t(a[1],o[0]),t(-o[1],a[0])),i[2]),e(r(e(t(i[1],o[0]),t(-o[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),o[2])))),u=n(l,c);return u[u.length-1]}}function f(e,t,r,n){return function(i,a,o,s,l){var c=e(e(e(r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),o[2]),e(r(e(t(o[1],l[0]),t(-l[1],o[0])),-s[2]),r(e(t(o[1],s[0]),t(-s[1],o[0])),l[2]))),a[3]),e(r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),r(e(t(a[1],s[0]),t(-s[1],a[0])),l[2]))),-o[3]),r(e(r(e(t(o[1],l[0]),t(-l[1],o[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),s[3]))),e(r(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),a[2]),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]))),-l[3]),e(r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),r(e(t(a[1],s[0]),t(-s[1],a[0])),l[2]))),i[3]),r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-s[2]),r(e(t(i[1],s[0]),t(-s[1],i[0])),l[2]))),-a[3])))),e(e(r(e(r(e(t(a[1],l[0]),t(-l[1],a[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),l[2]))),s[3]),e(r(e(r(e(t(a[1],s[0]),t(-s[1],a[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),s[2]))),-l[3]),r(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),a[2]),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]))),i[3]))),e(r(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),s[2]))),-a[3]),e(r(e(r(e(t(a[1],s[0]),t(-s[1],a[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),s[2]))),o[3]),r(e(r(e(t(a[1],o[0]),t(-o[1],a[0])),i[2]),e(r(e(t(i[1],o[0]),t(-o[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),o[2]))),-s[3]))))),u=e(e(e(r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),o[2]),e(r(e(t(o[1],l[0]),t(-l[1],o[0])),-s[2]),r(e(t(o[1],s[0]),t(-s[1],o[0])),l[2]))),i[3]),r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-s[2]),r(e(t(i[1],s[0]),t(-s[1],i[0])),l[2]))),-o[3])),e(r(e(r(e(t(o[1],l[0]),t(-l[1],o[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),l[2]))),s[3]),r(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),s[2]))),-l[3]))),e(e(r(e(r(e(t(o[1],l[0]),t(-l[1],o[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),i[3]),r(e(r(e(t(o[1],l[0]),t(-l[1],o[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),l[2]))),-a[3])),e(r(e(r(e(t(a[1],l[0]),t(-l[1],a[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),l[2]))),o[3]),r(e(r(e(t(a[1],o[0]),t(-o[1],a[0])),i[2]),e(r(e(t(i[1],o[0]),t(-o[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),o[2]))),-l[3])))),h=n(c,u);return h[h.length-1]}}function p(e){return(3===e?u:4===e?h:f)(i,n,a,o)}var d=p(3),m=p(4),g=[function(){return 0},function(){return 0},function(e,t){return t[0]-e[0]},function(e,t,r){var n,i=(e[1]-r[1])*(t[0]-r[0]),a=(e[0]-r[0])*(t[1]-r[1]),o=i-a;if(i>0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=l*n;return o>=s||o<=-s?o:d(e,t,r)},function(e,t,r,n){var i=e[0]-n[0],a=t[0]-n[0],o=r[0]-n[0],s=e[1]-n[1],l=t[1]-n[1],u=r[1]-n[1],h=e[2]-n[2],f=t[2]-n[2],p=r[2]-n[2],d=a*u,g=o*l,y=o*s,v=i*u,x=i*l,_=a*s,b=h*(d-g)+f*(y-v)+p*(x-_),w=(Math.abs(d)+Math.abs(g))*Math.abs(h)+(Math.abs(y)+Math.abs(v))*Math.abs(f)+(Math.abs(x)+Math.abs(_))*Math.abs(p),T=c*w;return b>T||-b>T?b:m(e,t,r,n)}];function y(e){var t=g[e.length];return t||(t=g[e.length]=p(e.length)),t.apply(void 0,e)}function v(e,t,r,n,i,a,o){return function(t,r,s,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return n(t,r);case 3:return i(t,r,s);case 4:return a(t,r,s,l);case 5:return o(t,r,s,l,c)}for(var u=new Array(arguments.length),h=0;h<arguments.length;++h)u[h]=arguments[h];return e(u)}}!function(){for(;g.length<=5;)g.push(p(g.length));e.exports=v.apply(void 0,[y].concat(g));for(var t=0;t<=5;++t)e.exports[t]=g[t]}()},5382:function(e,t,r){var n=r(8210),i=r(3012);e.exports=function(e,t){if(1===e.length)return i(t,e[0]);if(1===t.length)return i(e,t[0]);if(0===e.length||0===t.length)return[0];var r=[0];if(e.length<t.length)for(var a=0;a<e.length;++a)r=n(r,i(t,e[a]));else for(a=0;a<t.length;++a)r=n(r,i(e,t[a]));return r}},3012:function(e,t,r){var n=r(5250),i=r(9362);e.exports=function(e,t){var r=e.length;if(1===r){var a=n(e[0],t);return a[0]?a:[a[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],c=0;n(e[0],t,s),s[0]&&(o[c++]=s[0]);for(var u=1;u<r;++u){n(e[u],t,l);var h=s[1];i(h,l[0],s),s[0]&&(o[c++]=s[0]);var f=l[1],p=s[1],d=f+p,m=p-(d-f);s[1]=d,m&&(o[c++]=m)}return s[1]&&(o[c++]=s[1]),0===c&&(o[c++]=0),o.length=c,o}},1125:function(e,t,r){e.exports=function(e,t,r,i){var a=n(e,r,i),o=n(t,r,i);if(a>0&&o>0||a<0&&o<0)return!1;var s=n(r,e,t),l=n(i,e,t);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(e,t,r,n){for(var i=0;i<2;++i){var a=e[i],o=t[i],s=Math.min(a,o),l=Math.max(a,o),c=r[i],u=n[i],h=Math.min(c,u);if(Math.max(c,u)<s||l<h)return!1}return!0}(e,t,r,i))};var n=r(3250)[3]},8545:function(e){e.exports=function(e,t){var r=0|e.length,n=0|t.length;if(1===r&&1===n)return function(e,t){var r=e+t,n=r-e,i=e-(r-n)+(t-n);return i?[i,r]:[r]}(e[0],-t[0]);var i,a,o=new Array(r+n),s=0,l=0,c=0,u=Math.abs,h=e[l],f=u(h),p=-t[c],d=u(p);f<d?(a=h,(l+=1)<r&&(f=u(h=e[l]))):(a=p,(c+=1)<n&&(d=u(p=-t[c]))),l<r&&f<d||c>=n?(i=h,(l+=1)<r&&(f=u(h=e[l]))):(i=p,(c+=1)<n&&(d=u(p=-t[c])));for(var m,g,y=i+a,v=y-i,x=a-v,_=x,b=y;l<r&&c<n;)f<d?(i=h,(l+=1)<r&&(f=u(h=e[l]))):(i=p,(c+=1)<n&&(d=u(p=-t[c]))),(x=(a=_)-(v=(y=i+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m;for(;l<r;)(x=(a=_)-(v=(y=(i=h)+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m,(l+=1)<r&&(h=e[l]);for(;c<n;)(x=(a=_)-(v=(y=(i=p)+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m,(c+=1)<n&&(p=-t[c]);return _&&(o[s++]=_),b&&(o[s++]=b),s||(o[s++]=0),o.length=s,o}},8210:function(e){e.exports=function(e,t){var r=0|e.length,n=0|t.length;if(1===r&&1===n)return function(e,t){var r=e+t,n=r-e,i=e-(r-n)+(t-n);return i?[i,r]:[r]}(e[0],t[0]);var i,a,o=new Array(r+n),s=0,l=0,c=0,u=Math.abs,h=e[l],f=u(h),p=t[c],d=u(p);f<d?(a=h,(l+=1)<r&&(f=u(h=e[l]))):(a=p,(c+=1)<n&&(d=u(p=t[c]))),l<r&&f<d||c>=n?(i=h,(l+=1)<r&&(f=u(h=e[l]))):(i=p,(c+=1)<n&&(d=u(p=t[c])));for(var m,g,y=i+a,v=y-i,x=a-v,_=x,b=y;l<r&&c<n;)f<d?(i=h,(l+=1)<r&&(f=u(h=e[l]))):(i=p,(c+=1)<n&&(d=u(p=t[c]))),(x=(a=_)-(v=(y=i+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m;for(;l<r;)(x=(a=_)-(v=(y=(i=h)+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m,(l+=1)<r&&(h=e[l]);for(;c<n;)(x=(a=_)-(v=(y=(i=p)+a)-i))&&(o[s++]=x),_=b-((m=b+y)-(g=m-b))+(y-g),b=m,(c+=1)<n&&(p=t[c]);return _&&(o[s++]=_),b&&(o[s++]=b),s||(o[s++]=0),o.length=s,o}},9127:function(e,t,r){e.exports=function(e){return i(n(e))};var n=r(6204),i=r(5771)},7765:function(e,t,r){e.exports=function(e,t,r,s){if(r=r||0,typeof s>"u"&&(s=function(e){for(var t=e.length,r=0,n=0;n<t;++n)r=0|Math.max(r,e[n].length);return r-1}(e)),0===e.length||s<1)return{cells:[],vertexIds:[],vertexWeights:[]};var l=function(e,t){for(var r=e.length,n=i.mallocUint8(r),a=0;a<r;++a)n[a]=e[a]<t|0;return n}(t,+r),c=function(e,t){for(var r=e.length,o=t*(t+1)/2*r|0,s=i.mallocUint32(2*o),l=0,c=0;c<r;++c)for(var u=e[c],h=(t=u.length,0);h<t;++h)for(var f=0;f<h;++f){var p=u[f],d=u[h];s[l++]=0|Math.min(p,d),s[l++]=0|Math.max(p,d)}a(n(s,[l/2|0,2]));var m=2;for(c=2;c<l;c+=2)s[c-2]===s[c]&&s[c-1]===s[c+1]||(s[m++]=s[c],s[m++]=s[c+1]);return n(s,[m/2|0,2])}(e,s),u=function(e,t,r,a){for(var o=e.data,s=e.shape[0],l=i.mallocDouble(s),c=0,u=0;u<s;++u){var h=o[2*u],f=o[2*u+1];if(r[h]!==r[f]){var p=t[h],d=t[f];o[2*c]=h,o[2*c+1]=f,l[c++]=(d-a)/(d-p)}}return e.shape[0]=c,n(l,[c])}(c,t,l,+r),h=function(e,t){var r=i.mallocInt32(2*t),n=e.shape[0],a=e.data;r[0]=0;for(var o=0,s=0;s<n;++s){var l=a[2*s];if(l!==o){for(r[2*o+1]=s;++o<l;)r[2*o]=s,r[2*o+1]=s;r[2*o]=s}}for(r[2*o+1]=n;++o<t;)r[2*o]=r[2*o+1]=n;return r}(c,0|t.length),f=o(s)(e,c.data,h,l),p=function(e){for(var t=0|e.shape[0],r=e.data,n=new Array(t),i=0;i<t;++i)n[i]=[r[2*i],r[2*i+1]];return n}(c),d=[].slice.call(u.data,0,u.shape[0]);return i.free(l),i.free(c.data),i.free(u.data),i.free(h),{cells:f,vertexIds:p,vertexWeights:d}};var n=r(9618),i=r(1888),a=r(446),o=r(1570)},1570:function(e){e.exports=function(e){return t[e]()};var t=[function(){return function(e,t,r,n){for(var i=e.length,a=0;a<i;++a)e[a].length;return[]}},function(){function e(e,t,r,n){for(var i=0|Math.min(r,n),a=0|Math.max(r,n),o=e[2*i],s=e[2*i+1];o<s;){var l=o+s>>1,c=t[2*l+1];if(c===a)return l;a<c?s=l:o=l+1}return o}return function(t,r,n,i){for(var a=t.length,o=[],s=0;s<a;++s){var l=t[s];if(2===l.length){var c=(0|i[l[0]])+(i[l[1]]<<1);if(0===c||3===c)continue;switch(c){case 0:case 3:break;case 1:o.push([e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0])])}}}return o}},function(){function e(e,t,r,n){for(var i=0|Math.min(r,n),a=0|Math.max(r,n),o=e[2*i],s=e[2*i+1];o<s;){var l=o+s>>1,c=t[2*l+1];if(c===a)return l;a<c?s=l:o=l+1}return o}return function(t,r,n,i){for(var a=t.length,o=[],s=0;s<a;++s){var l=t[s],c=l.length;if(3===c){if(0==(u=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2))||7===u)continue;switch(u){case 0:case 7:break;case 1:o.push([e(n,r,l[0],l[2]),e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0]),e(n,r,l[1],l[2])]);break;case 3:o.push([e(n,r,l[0],l[2]),e(n,r,l[1],l[2])]);break;case 4:o.push([e(n,r,l[2],l[1]),e(n,r,l[2],l[0])]);break;case 5:o.push([e(n,r,l[2],l[1]),e(n,r,l[0],l[1])]);break;case 6:o.push([e(n,r,l[1],l[0]),e(n,r,l[2],l[0])])}}else if(2===c){var u;if(0==(u=(0|i[l[0]])+(i[l[1]]<<1))||3===u)continue;switch(u){case 0:case 3:break;case 1:o.push([e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0])])}}}return o}},function(){function e(e,t,r,n){for(var i=0|Math.min(r,n),a=0|Math.max(r,n),o=e[2*i],s=e[2*i+1];o<s;){var l=o+s>>1,c=t[2*l+1];if(c===a)return l;a<c?s=l:o=l+1}return o}return function(t,r,n,i){for(var a=t.length,o=[],s=0;s<a;++s){var l=t[s],c=l.length;if(4===c){if(0==(u=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2)+(i[l[3]]<<3))||15===u)continue;switch(u){case 0:case 15:break;case 1:o.push([e(n,r,l[0],l[1]),e(n,r,l[0],l[2]),e(n,r,l[0],l[3])]);break;case 2:o.push([e(n,r,l[1],l[2]),e(n,r,l[1],l[0]),e(n,r,l[1],l[3])]);break;case 3:o.push([e(n,r,l[1],l[2]),e(n,r,l[0],l[2]),e(n,r,l[0],l[3])],[e(n,r,l[1],l[3]),e(n,r,l[1],l[2]),e(n,r,l[0],l[3])]);break;case 4:o.push([e(n,r,l[2],l[0]),e(n,r,l[2],l[1]),e(n,r,l[2],l[3])]);break;case 5:o.push([e(n,r,l[0],l[1]),e(n,r,l[2],l[1]),e(n,r,l[0],l[3])],[e(n,r,l[2],l[1]),e(n,r,l[2],l[3]),e(n,r,l[0],l[3])]);break;case 6:o.push([e(n,r,l[2],l[0]),e(n,r,l[1],l[0]),e(n,r,l[1],l[3])],[e(n,r,l[2],l[3]),e(n,r,l[2],l[0]),e(n,r,l[1],l[3])]);break;case 7:o.push([e(n,r,l[0],l[3]),e(n,r,l[1],l[3]),e(n,r,l[2],l[3])]);break;case 8:o.push([e(n,r,l[3],l[1]),e(n,r,l[3],l[0]),e(n,r,l[3],l[2])]);break;case 9:o.push([e(n,r,l[3],l[1]),e(n,r,l[0],l[1]),e(n,r,l[0],l[2])],[e(n,r,l[3],l[2]),e(n,r,l[3],l[1]),e(n,r,l[0],l[2])]);break;case 10:o.push([e(n,r,l[1],l[0]),e(n,r,l[3],l[0]),e(n,r,l[1],l[2])],[e(n,r,l[3],l[0]),e(n,r,l[3],l[2]),e(n,r,l[1],l[2])]);break;case 11:o.push([e(n,r,l[1],l[2]),e(n,r,l[0],l[2]),e(n,r,l[3],l[2])]);break;case 12:o.push([e(n,r,l[3],l[0]),e(n,r,l[2],l[0]),e(n,r,l[2],l[1])],[e(n,r,l[3],l[1]),e(n,r,l[3],l[0]),e(n,r,l[2],l[1])]);break;case 13:o.push([e(n,r,l[0],l[1]),e(n,r,l[2],l[1]),e(n,r,l[3],l[1])]);break;case 14:o.push([e(n,r,l[2],l[0]),e(n,r,l[1],l[0]),e(n,r,l[3],l[0])])}}else if(3===c){if(0==(u=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2))||7===u)continue;switch(u){case 0:case 7:break;case 1:o.push([e(n,r,l[0],l[2]),e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0]),e(n,r,l[1],l[2])]);break;case 3:o.push([e(n,r,l[0],l[2]),e(n,r,l[1],l[2])]);break;case 4:o.push([e(n,r,l[2],l[1]),e(n,r,l[2],l[0])]);break;case 5:o.push([e(n,r,l[2],l[1]),e(n,r,l[0],l[1])]);break;case 6:o.push([e(n,r,l[1],l[0]),e(n,r,l[2],l[0])])}}else if(2===c){var u;if(0==(u=(0|i[l[0]])+(i[l[1]]<<1))||3===u)continue;switch(u){case 0:case 3:break;case 1:o.push([e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0])])}}}return o}}]},6803:function(e,t,r){r(8828),r(1755),t.Fw=function(e,t){var r=e.length,n=e.length-t.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return e[0]-t[0];case 2:return(s=e[0]+e[1]-t[0]-t[1])||i(e[0],e[1])-i(t[0],t[1]);case 3:var a=e[0]+e[1],o=t[0]+t[1];if(s=a+e[2]-(o+t[2]))return s;var s,l=i(e[0],e[1]),c=i(t[0],t[1]);return(s=i(l,e[2])-i(c,t[2]))||i(l+e[2],a)-i(c+t[2],o);default:var u=e.slice(0);u.sort();var h=t.slice(0);h.sort();for(var f=0;f<r;++f)if(n=u[f]-h[f])return n;return 0}}},3105:function(e,t){function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;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,r;return t=(e>65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>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 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,1+((e|=e>>>8)|e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);(function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<<i&255}})(n),t.reverse=function(e){return n[255&e]<<24|n[e>>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},2014:function(e,t,r){var n=r(3105),i=r(4623);function a(e,t){var r=e.length,n=e.length-t.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return e[0]-t[0];case 2:return(s=e[0]+e[1]-t[0]-t[1])||i(e[0],e[1])-i(t[0],t[1]);case 3:var a=e[0]+e[1],o=t[0]+t[1];if(s=a+e[2]-(o+t[2]))return s;var s,l=i(e[0],e[1]),c=i(t[0],t[1]);return(s=i(l,e[2])-i(c,t[2]))||i(l+e[2],a)-i(c+t[2],o);default:var u=e.slice(0);u.sort();var h=t.slice(0);h.sort();for(var f=0;f<r;++f)if(n=u[f]-h[f])return n;return 0}}function o(e,t){return a(e[0],t[0])}function s(e,t){if(t){for(var r=e.length,n=new Array(r),i=0;i<r;++i)n[i]=[e[i],t[i]];for(n.sort(o),i=0;i<r;++i)e[i]=n[i][0],t[i]=n[i][1];return e}return e.sort(a),e}function l(e){if(0===e.length)return[];for(var t=1,r=e.length,n=1;n<r;++n){var i=e[n];if(a(i,e[n-1])){if(n===t){t++;continue}e[t++]=i}}return e.length=t,e}function c(e,t){for(var r=0,n=e.length-1,i=-1;r<=n;){var o=r+n>>1,s=a(e[o],t);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function u(e,t){for(var r=new Array(e.length),i=0,o=r.length;i<o;++i)r[i]=[];for(var s=[],l=(i=0,t.length);i<l;++i)for(var u=t[i],h=u.length,f=1,p=1<<h;f<p;++f){s.length=n.popCount(f);for(var d=0,m=0;m<h;++m)f&1<<m&&(s[d++]=u[m]);var g=c(e,s);if(!(g<0))for(;r[g++].push(i),!(g>=e.length||0!==a(e[g],s)););}return r}function h(e,t){if(t<0)return[];for(var r=[],i=(1<<t+1)-1,a=0;a<e.length;++a)for(var o=e[a],l=i;l<1<<o.length;l=n.nextCombination(l)){for(var c=new Array(t+1),u=0,h=0;h<o.length;++h)l&1<<h&&(c[u++]=o[h]);r.push(c)}return s(r)}t.dimension=function(e){for(var t=0,r=Math.max,n=0,i=e.length;n<i;++n)t=r(t,e[n].length);return t-1},t.countVertices=function(e){for(var t=-1,r=Math.max,n=0,i=e.length;n<i;++n)for(var a=e[n],o=0,s=a.length;o<s;++o)t=r(t,a[o]);return t+1},t.cloneCells=function(e){for(var t=new Array(e.length),r=0,n=e.length;r<n;++r)t[r]=e[r].slice(0);return t},t.compareCells=a,t.normalize=s,t.unique=l,t.findCell=c,t.incidence=u,t.dual=function(e,t){if(!t)return u(l(h(e,0)),e);for(var r=new Array(t),n=0;n<t;++n)r[n]=[];n=0;for(var i=e.length;n<i;++n)for(var a=e[n],o=0,s=a.length;o<s;++o)r[a[o]].push(n);return r},t.explode=function(e){for(var t=[],r=0,n=e.length;r<n;++r)for(var i=e[r],a=0|i.length,o=1,l=1<<a;o<l;++o){for(var c=[],u=0;u<a;++u)o>>>u&1&&c.push(i[u]);t.push(c)}return s(t)},t.skeleton=h,t.boundary=function(e){for(var t=[],r=0,n=e.length;r<n;++r)for(var i=e[r],a=0,o=i.length;a<o;++a){for(var l=new Array(i.length-1),c=0,u=0;c<o;++c)c!==a&&(l[u++]=i[c]);t.push(l)}return s(t)},t.connectedComponents=function(e,t){return t?function(e,t){for(var r=new i(t),n=0;n<e.length;++n)for(var a=e[n],o=0;o<a.length;++o)for(var s=o+1;s<a.length;++s)r.link(a[o],a[s]);var l=[],c=r.ranks;for(n=0;n<c.length;++n)c[n]=-1;for(n=0;n<e.length;++n){var u=r.find(e[n][0]);c[u]<0?(c[u]=l.length,l.push([e[n].slice(0)])):l[c[u]].push(e[n].slice(0))}return l}(e,t):function(e){for(var t=l(s(h(e,0))),r=new i(t.length),n=0;n<e.length;++n)for(var a=e[n],o=0;o<a.length;++o)for(var u=c(t,[a[o]]),f=o+1;f<a.length;++f)r.link(u,c(t,[a[f]]));var p=[],d=r.ranks;for(n=0;n<d.length;++n)d[n]=-1;for(n=0;n<e.length;++n){var m=r.find(c(t,[e[n][0]]));d[m]<0?(d[m]=p.length,p.push([e[n].slice(0)])):p[d[m]].push(e[n].slice(0))}return p}(e)}},4623:function(e){function t(e){this.roots=new Array(e),this.ranks=new Array(e);for(var t=0;t<e;++t)this.roots[t]=t,this.ranks[t]=0}e.exports=t,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 r=t[e];t[e]=t[r],e=r}return e},t.prototype.link=function(e,t){var r=this.find(e),n=this.find(t);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},5878:function(e,t,r){e.exports=function(e,t,r){for(var a=t.length,o=e.length,s=new Array(a),l=new Array(a),c=new Array(a),u=new Array(a),h=0;h<a;++h)s[h]=l[h]=-1,c[h]=1/0,u[h]=!1;for(h=0;h<o;++h){var f=e[h];if(2!==f.length)throw new Error("Input must be a graph");var p=f[1],d=f[0];-1!==l[d]?l[d]=-2:l[d]=p,-1!==s[p]?s[p]=-2:s[p]=d}function m(e){if(u[e])return 1/0;var r=s[e],i=l[e];return r<0||i<0?1/0:function(e,t,r){return Math.abs(n(e,t,r))/Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}(t[e],t[r],t[i])}function g(e,t){var r=k[e],n=k[t];k[e]=n,k[t]=r,A[r]=t,A[n]=e}function y(e){return c[k[e]]}function v(e){return 1&e?e-1>>1:(e>>1)-1}function x(e){for(var t=y(e);;){var r=t,n=2*e+1,i=2*(e+1),a=e;if(n<M){var o=y(n);o<r&&(a=n,r=o)}if(i<M&&y(i)<r&&(a=i),a===e)return e;g(e,a),e=a}}function _(e){for(var t=y(e);e>0;){var r=v(e);if(!(r>=0&&t<y(r)))return e;g(e,r),e=r}}function b(){if(M>0){var e=k[0];return g(0,M-1),M-=1,x(0),e}return-1}function w(e,t){var r=k[e];return c[r]===t?e:(c[r]=-1/0,_(e),b(),c[r]=t,_((M+=1)-1))}function T(e){if(!u[e]){u[e]=!0;var t=s[e],r=l[e];s[r]>=0&&(s[r]=t),l[t]>=0&&(l[t]=r),A[t]>=0&&w(A[t],m(t)),A[r]>=0&&w(A[r],m(r))}}var k=[],A=new Array(a);for(h=0;h<a;++h)(c[h]=m(h))<1/0?(A[h]=k.length,k.push(h)):A[h]=-1;var M=k.length;for(h=M>>1;h>=0;--h)x(h);for(;;){var S=b();if(S<0||c[S]>r)break;T(S)}var E=[];for(h=0;h<a;++h)u[h]||(A[h]=E.length,E.push(t[h].slice()));function C(e,t){if(e[t]<0)return t;var r=t,n=t;do{var i=e[n];if(!u[n]||i<0||i===n||(i=e[n=i],!u[n]||i<0||i===n))break;n=i,r=e[r]}while(r!==n);for(var a=t;a!==n;a=e[a])e[a]=n;return n}E.length;var I=[];return e.forEach((function(e){var t=C(s,e[0]),r=C(l,e[1]);if(t>=0&&r>=0&&t!==r){var n=A[t],i=A[r];n!==i&&I.push([n,i])}})),i.unique(i.normalize(I)),{positions:E,edges:I}};var n=r(3250),i=r(2014)},1303:function(e,t,r){e.exports=function(e,t){var r,a,o,s;if(t[0][0]<t[1][0])r=t[0],a=t[1];else{if(!(t[0][0]>t[1][0]))return i(t,e);r=t[1],a=t[0]}if(e[0][0]<e[1][0])o=e[0],s=e[1];else{if(!(e[0][0]>e[1][0]))return-i(e,t);o=e[1],s=e[0]}var l=n(r,a,s),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var n=r(3250);function i(e,t){var r,i,a,o;if(t[0][0]<t[1][0])r=t[0],i=t[1];else{if(!(t[0][0]>t[1][0])){var s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]),c=Math.min(t[0][1],t[1][1]),u=Math.max(t[0][1],t[1][1]);return l<c?l-c:s>u?s-u:l-u}r=t[1],i=t[0]}e[0][1]<e[1][1]?(a=e[0],o=e[1]):(a=e[1],o=e[0]);var h=n(i,r,a);return h||(h=n(i,r,o))?h:o-i}},4209:function(e,t,r){e.exports=function(e){for(var t=e.length,r=2*t,n=new Array(r),a=0;a<t;++a){var l=e[a],c=l[0][0]<l[1][0];n[2*a]=new h(l[0][0],l,c,a),n[2*a+1]=new h(l[1][0],l,!c,a)}n.sort((function(e,t){var r=e.x-t.x;return r||(r=e.create-t.create)?r:Math.min(e.segment[0][1],e.segment[1][1])-Math.min(t.segment[0][1],t.segment[1][1])}));var f=i(o),p=[],d=[],m=[];for(a=0;a<r;){for(var g=n[a].x,y=[];a<r;){var v=n[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]?(y.push(new u(v.segment[0][1],v.index,!0,!0)),y.push(new u(v.segment[1][1],v.index,!1,!1))):(y.push(new u(v.segment[1][1],v.index,!0,!1)),y.push(new u(v.segment[0][1],v.index,!1,!0)))):f=v.create?f.insert(v.segment,v.index):f.remove(v.segment)}p.push(f.root),d.push(g),m.push(y)}return new s(p,d,m)};var n=r(2478),i=r(3840),a=r(3250),o=r(1303);function s(e,t,r){this.slabs=e,this.coordinates=t,this.horizontal=r}function l(e,t){return e.y-t}function c(e,t){for(var r=null;e;){var n,i,o=e.key;o[0][0]<o[1][0]?(n=o[0],i=o[1]):(n=o[1],i=o[0]);var s=a(n,i,t);if(s<0)e=e.left;else if(s>0)if(t[0]!==o[1][0])r=e,e=e.right;else{if(l=c(e.right,t))return l;e=e.left}else{if(t[0]!==o[1][0])return e;var l;if(l=c(e.right,t))return l;e=e.left}}return r}function u(e,t,r,n){this.y=e,this.index=t,this.start=r,this.closed=n}function h(e,t,r,n){this.x=e,this.segment=t,this.create=r,this.index=n}s.prototype.castUp=function(e){var t=n.le(this.coordinates,e[0]);if(t<0)return-1;this.slabs[t];var r=c(this.slabs[t],e),i=-1;if(r&&(i=r.value),this.coordinates[t]===e[0]){var s=null;if(r&&(s=r.key),t>0){var u=c(this.slabs[t-1],e);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var h=this.horizontal[t];if(h.length>0){var f=n.ge(h,e[1],l);if(f<h.length){var p=h[f];if(e[1]===p.y){if(p.closed)return p.index;for(;f<h.length-1&&h[f+1].y===e[1];)if((p=h[f+=1]).closed)return p.index;if(p.y===e[1]&&!p.start){if((f+=1)>=h.length)return i;p=h[f]}}if(p.start)if(s){var d=a(s[0],s[1],[e[0],p.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(i=p.index)}else i=p.index;else p.y!==e[1]&&(i=p.index)}}}return i}},5202:function(e,t,r){var n=r(1944),i=r(8210);function a(e,t){var r=i(n(e,t),[t[t.length-1]]);return r[r.length-1]}function o(e,t,r,n){var i=-t/(n-t);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=e.length,s=new Array(o),l=0;l<o;++l)s[l]=i*e[l]+a*r[l];return s}e.exports=function(e,t){for(var r=[],n=[],i=a(e[e.length-1],t),s=e[e.length-1],l=e[0],c=0;c<e.length;++c,s=l){var u=a(l=e[c],t);if(i<0&&u>0||i>0&&u<0){var h=o(s,u,l,i);r.push(h),n.push(h.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},e.exports.positive=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l<e.length;++l,i=s){var c=a(s=e[l],t);(n<0&&c>0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},e.exports.negative=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l<e.length;++l,i=s){var c=a(s=e[l],t);(n<0&&c>0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},3387:function(e,t,r){var n;!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 function(e,t){var r,n,o,s,l,c,u,h,f,p=1,d=e.length,m="";for(n=0;n<d;n++)if("string"==typeof e[n])m+=e[n];else if("object"==typeof e[n]){if((s=e[n]).keys)for(r=t[p],o=0;o<s.keys.length;o++){if(null==r)throw new Error(a('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[o],s.keys[o-1]));r=r[s.keys[o]]}else r=s.param_no?t[s.param_no]:t[p++];if(i.not_type.test(s.type)&&i.not_primitive.test(s.type)&&r instanceof Function&&(r=r()),i.numeric_arg.test(s.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(a("[sprintf] expecting number but found %T",r));switch(i.number.test(s.type)&&(h=r>=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=r:(!i.number.test(s.type)||h&&!s.sign?f="":(f=h?"+":"-",r=r.toString().replace(i.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(f+r).length,l=s.width&&u>0?c.repeat(u):"",m+=s.align?f+r+l:"0"===c?f+l+r:l+f+r)}return m}(function(e){if(s[e])return s[e];for(var t,r=e,n=[],a=0;r;){if(null!==(t=i.text.exec(r)))n.push(t[0]);else if(null!==(t=i.modulo.exec(r)))n.push("%");else{if(null===(t=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){a|=1;var o=[],l=t[2],c=[];if(null===(c=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=i.key_access.exec(l)))o.push(c[1]);else{if(null===(c=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(c[1])}t[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return s[e]=n}(e),arguments)}function o(e,t){return a.apply(null,[e].concat(t||[]))}var s=Object.create(null);t.sprintf=a,t.vsprintf=o,typeof window<"u"&&(window.sprintf=a,window.vsprintf=o,void 0!==(n=function(){return{sprintf:a,vsprintf:o}}.call(t,r,t,e))&&(e.exports=n))}()},3711:function(e,t,r){e.exports=function(e,t){if(e.dimension<=0)return{positions:[],cells:[]};if(1===e.dimension)return function(e,t){for(var r=i(e,t),n=r.length,a=new Array(n),o=new Array(n),s=0;s<n;++s)a[s]=[r[s]],o[s]=[s];return{positions:a,cells:o}}(e,t);var r=e.order.join()+"-"+e.dtype,s=o[r];return t=+t||0,s||(s=o[r]=function(e,t){var r=e.length+"d",i=a[r];if(i)return i(n,e,t)}(e.order,e.dtype)),s(e,t)};var n=r(2640),i=r(781),a={"2d":function(e,t,r){var n=e({order:t,scalarArguments:3,getters:"generic"===r?[0]:void 0,phase:function(e,t,r,n){return e>n|0},vertex:function(e,t,r,n,i,a,o,s,l,c,u,h,f){var p=(0|o)+(s<<1)+(l<<2)+(c<<3)|0;if(0!==p&&15!==p)switch(p){case 0:case 15:u.push([e-.5,t-.5]);break;case 1:u.push([e-.25-.25*(n+r-2*f)/(r-n),t-.25-.25*(i+r-2*f)/(r-i)]);break;case 2:u.push([e-.75-.25*(-n-r+2*f)/(n-r),t-.25-.25*(a+n-2*f)/(n-a)]);break;case 3:u.push([e-.5,t-.5-.5*(i+r+a+n-4*f)/(r-i+n-a)]);break;case 4:u.push([e-.25-.25*(a+i-2*f)/(i-a),t-.75-.25*(-i-r+2*f)/(i-r)]);break;case 5:u.push([e-.5-.5*(n+r+a+i-4*f)/(r-n+i-a),t-.5]);break;case 6:u.push([e-.5-.25*(-n-r+a+i)/(n-r+i-a),t-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:u.push([e-.75-.25*(a+i-2*f)/(i-a),t-.75-.25*(a+n-2*f)/(n-a)]);break;case 8:u.push([e-.75-.25*(-a-i+2*f)/(a-i),t-.75-.25*(-a-n+2*f)/(a-n)]);break;case 9:u.push([e-.5-.25*(n+r+-a-i)/(r-n+a-i),t-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:u.push([e-.5-.5*(-n-r-a-i+4*f)/(n-r+a-i),t-.5]);break;case 11:u.push([e-.25-.25*(-a-i+2*f)/(a-i),t-.75-.25*(i+r-2*f)/(r-i)]);break;case 12:u.push([e-.5,t-.5-.5*(-i-r-a-n+4*f)/(i-r+a-n)]);break;case 13:u.push([e-.75-.25*(n+r-2*f)/(r-n),t-.25-.25*(-a-n+2*f)/(a-n)]);break;case 14:u.push([e-.25-.25*(-n-r+2*f)/(n-r),t-.25-.25*(-i-r+2*f)/(i-r)])}},cell:function(e,t,r,n,i,a,o,s,l){i?s.push([e,t]):s.push([t,e])}});return function(e,t){var r=[],i=[];return n(e,r,i,t),{positions:r,cells:i}}}},o={}},665:function(e,t,r){var n=r(3202);e.exports=o;var i=96;function a(e,t){var r=n(getComputedStyle(e).getPropertyValue(t));return r[0]*o(r[1],e)}function o(e,t){switch(t=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 function(e,t){var r=document.createElement("div");r.style["font-size"]="128"+e,t.appendChild(r);var n=a(r,"font-size")/128;return t.removeChild(r),n}(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,r){e.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.up||[0,1,0],n=e.right||h(r),i=e.radius||1,a=e.theta||0,u=e.phi||0;if(t=[].slice.call(t,0,3),r=[].slice.call(r,0,3),s(r,r),n=[].slice.call(n,0,3),s(n,n),"eye"in e){var p=e.eye,d=[p[0]-t[0],p[1]-t[1],p[2]-t[2]];o(n,d,r),c(n[0],n[1],n[2])<1e-6?n=h(r):s(n,n),i=c(d[0],d[1],d[2]);var m=l(r,d)/i,g=l(n,d)/i;u=Math.acos(m),a=Math.acos(g)}return i=Math.log(i),new f(e.zoomMin,e.zoomMax,t,r,n,i,a,u)};var n=r(9215),i=r(7608),a=r(6079),o=r(5911),s=r(3536),l=r(244);function c(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function u(e){return Math.min(1,Math.max(-1,e))}function h(e){var t=Math.abs(e[0]),r=Math.abs(e[1]),n=Math.abs(e[2]),i=[0,0,0];t>Math.max(r,n)?i[2]=1:r>Math.max(t,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=e[l]*e[l],o+=i[l]*e[l];for(l=0;l<3;++l)i[l]-=o/a*e[l];return s(i,i),i}function f(e,t,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),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=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.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,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=t[a]*r[a],n+=t[a]*t[a];var l=Math.sqrt(n),u=0;for(a=0;a<3;++a)r[a]-=t[a]*i/n,u+=r[a]*r[a],t[a]/=l;var h=Math.sqrt(u);for(a=0;a<3;++a)r[a]/=h;var f=this.computedToward;o(f,t,r),s(f,f);var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(d),y=Math.sin(d),v=Math.cos(m),x=Math.sin(m),_=this.computedCenter,b=g*v,w=y*v,T=x,k=-g*x,A=-y*x,M=v,S=this.computedEye,E=this.computedMatrix;for(a=0;a<3;++a){var C=b*r[a]+w*f[a]+T*t[a];E[4*a+1]=k*r[a]+A*f[a]+M*t[a],E[4*a+2]=C,E[4*a+3]=0}var I=E[1],L=E[5],P=E[9],z=E[2],D=E[6],O=E[10],R=L*O-P*D,F=P*z-I*O,B=I*D-L*z,j=c(R,F,B);for(R/=j,F/=j,B/=j,E[0]=R,E[4]=F,E[8]=B,a=0;a<3;++a)S[a]=_[a]+E[2+4*a]*p;for(a=0;a<3;++a){u=0;for(var N=0;N<3;++N)u+=E[a+4*N]*S[N];E[12+a]=-u}E[15]=1},p.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r};var d=[0,0,0];p.rotate=function(e,t,r,n){if(this.angle.move(e,t,r),n){this.recalcMatrix(e);var i=this.computedMatrix;d[0]=i[2],d[1]=i[6],d[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];for(a(i,i,n,d),c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+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,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],h=i[4],f=i[8],p=u*a+h*o+f*s,d=c(u-=a*p,h-=o*p,f-=s*p),m=(u/=d)*t+a*r,g=(h/=d)*t+o*r,y=(f/=d)*t+s*r;this.center.move(e,m,g,y);var v=Math.exp(this.computedRadius[0]);v=Math.max(1e-4,v+n),this.radius.set(e,Math.log(v))},p.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},p.setMatrix=function(e,t,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;t||(this.recalcMatrix(e),t=this.computedMatrix);var s=t[a],l=t[a+4],h=t[a+8];if(n){var f=Math.abs(s),p=Math.abs(l),d=Math.abs(h),m=Math.max(f,p,d);f===m?(s=s<0?-1:1,l=h=0):d===m?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var g=c(s,l,h);s/=g,l/=g,h/=g}var y,v,x=t[o],_=t[o+4],b=t[o+8],w=x*s+_*l+b*h,T=c(x-=s*w,_-=l*w,b-=h*w),k=l*(b/=T)-h*(_/=T),A=h*(x/=T)-s*b,M=s*_-l*x,S=c(k,A,M);if(k/=S,A/=S,M/=S,this.center.jump(e,H,G,W),this.radius.idle(e),this.up.jump(e,s,l,h),this.right.jump(e,x,_,b),2===a){var E=t[1],C=t[5],I=t[9],L=E*x+C*_+I*b,P=E*k+C*A+I*M;y=R<0?-Math.PI/2:Math.PI/2,v=Math.atan2(P,L)}else{var z=t[2],D=t[6],O=t[10],R=z*s+D*l+O*h,F=z*x+D*_+O*b,B=z*k+D*A+O*M;y=Math.asin(u(R)),v=Math.atan2(B,F)}this.angle.jump(e,v,y),this.recalcMatrix(e);var j=t[2],N=t[6],U=t[10],V=this.computedMatrix;i(V,t);var q=V[15],H=V[12]/q,G=V[13]/q,W=V[14]/q,Z=Math.exp(this.computedRadius[0]);this.center.jump(e,H-j*Z,G-N*Z,W-U*Z)},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,r,n){this.recalcMatrix(e),t=t||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=c(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=t[0]-r[0],h=t[1]-r[1],f=t[2]-r[2],p=c(l,h,f);if(!(p<1e-6)){l/=p,h/=p,f/=p;var d=this.computedRight,m=d[0],g=d[1],y=d[2],v=i*m+a*g+o*y,x=c(m-=v*i,g-=v*a,y-=v*o);if(!(x<.01&&(m=a*f-o*h,g=o*l-i*f,y=i*h-a*l,x=c(m,g,y),x<1e-6))){m/=x,g/=x,y/=x,this.up.set(e,i,a,o),this.right.set(e,m,g,y),this.center.set(e,r[0],r[1],r[2]),this.radius.set(e,Math.log(p));var _=a*y-o*g,b=o*m-i*y,w=i*g-a*m,T=c(_,b,w),k=i*l+a*h+o*f,A=m*l+g*h+y*f,M=(_/=T)*l+(b/=T)*h+(w/=T)*f,S=Math.asin(u(k)),E=Math.atan2(M,A),C=this.angle._state,I=C[C.length-1],L=C[C.length-2];I%=2*Math.PI;var P=Math.abs(I+2*Math.PI-E),z=Math.abs(I-E),D=Math.abs(I-2*Math.PI-E);P<z&&(I+=2*Math.PI),D<z&&(I-=2*Math.PI),this.angle.jump(this.angle.lastT(),I,L),this.angle.set(e,E,S)}}}}},5250:function(e){e.exports=function(e,r,n){var i=e*r,a=t*e,o=a-(a-e),s=e-o,l=t*r,c=l-(l-r),u=r-c,h=s*u-(i-o*c-s*c-o*u);return n?(n[0]=h,n[1]=i,n):[h,i]};var t=+(Math.pow(2,27)+1)},9362:function(e){e.exports=function(e,t,r){var n=e+t,i=n-e,a=t-i,o=e-(n-i);return r?(r[0]=o+a,r[1]=n,r):[o+a,n]}},1888:function(e,t,r){var n=r(8828),i=r(1338),a=r(4793).hp;r.g.__TYPEDARRAY_POOL||(r.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",l=typeof BigInt64Array<"u",c=r.g.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=i([32,0])),c.BIGUINT64||(c.BIGUINT64=i([32,0])),c.BIGINT64||(c.BIGINT64=i([32,0])),c.BUFFER||(c.BUFFER=i([32,0]));var u=c.DATA,h=c.BUFFER;function f(e){if(e){var t=e.length||e.byteLength,r=n.log2(t);u[r].push(e)}}function p(e){e=n.nextPow2(e);var t=n.log2(e),r=u[t];return r.length>0?r.pop():new ArrayBuffer(e)}function d(e){return new Uint8Array(p(e),0,e)}function m(e){return new Uint16Array(p(2*e),0,e)}function g(e){return new Uint32Array(p(4*e),0,e)}function y(e){return new Int8Array(p(e),0,e)}function v(e){return new Int16Array(p(2*e),0,e)}function x(e){return new Int32Array(p(4*e),0,e)}function _(e){return new Float32Array(p(4*e),0,e)}function b(e){return new Float64Array(p(8*e),0,e)}function w(e){return o?new Uint8ClampedArray(p(e),0,e):d(e)}function T(e){return s?new BigUint64Array(p(8*e),0,e):null}function k(e){return l?new BigInt64Array(p(8*e),0,e):null}function A(e){return new DataView(p(e),0,e)}function M(e){e=n.nextPow2(e);var t=n.log2(e),r=h[t];return r.length>0?r.pop():new a(e)}t.free=function(e){if(a.isBuffer(e))h[n.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|n.log2(t);u[r].push(e)}},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=function(e){f(e.buffer)},t.freeArrayBuffer=f,t.freeBuffer=function(e){h[n.log2(e.length)].push(e)},t.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return p(e);switch(t){case"uint8":return d(e);case"uint16":return m(e);case"uint32":return g(e);case"int8":return y(e);case"int16":return v(e);case"int32":return x(e);case"float":case"float32":return _(e);case"double":case"float64":return b(e);case"uint8_clamped":return w(e);case"bigint64":return k(e);case"biguint64":return T(e);case"buffer":return M(e);case"data":case"dataview":return A(e);default:return null}return null},t.mallocArrayBuffer=p,t.mallocUint8=d,t.mallocUint16=m,t.mallocUint32=g,t.mallocInt8=y,t.mallocInt16=v,t.mallocInt32=x,t.mallocFloat32=t.mallocFloat=_,t.mallocFloat64=t.mallocDouble=b,t.mallocUint8Clamped=w,t.mallocBigUint64=T,t.mallocBigInt64=k,t.mallocDataView=A,t.mallocBuffer=M,t.clearCache=function(){for(var e=0;e<32;++e)c.UINT8[e].length=0,c.UINT16[e].length=0,c.UINT32[e].length=0,c.INT8[e].length=0,c.INT16[e].length=0,c.INT32[e].length=0,c.FLOAT[e].length=0,c.DOUBLE[e].length=0,c.BIGUINT64[e].length=0,c.BIGINT64[e].length=0,c.UINT8C[e].length=0,u[e].length=0,h[e].length=0}},1755:function(e){function t(e){this.roots=new Array(e),this.ranks=new Array(e);for(var t=0;t<e;++t)this.roots[t]=t,this.ranks[t]=0}e.exports=t;var r=t.prototype;Object.defineProperty(r,"length",{get:function(){return this.roots.length}}),r.makeSet=function(){var e=this.roots.length;return this.roots.push(e),this.ranks.push(0),e},r.find=function(e){for(var t=e,r=this.roots;r[e]!==e;)e=r[e];for(;r[t]!==e;){var n=r[t];r[t]=e,t=n}return e},r.link=function(e,t){var r=this.find(e),n=this.find(t);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},1682:function(e){e.exports=function(e,t,r){return 0===e.length?e:t?(r||e.sort(t),function(e,t){for(var r=1,n=e.length,i=e[0],a=e[0],o=1;o<n;++o)if(a=i,t(i=e[o],a)){if(o===r){r++;continue}e[r++]=i}return e.length=r,e}(e,t)):(r||e.sort(),function(e){for(var t=1,r=e.length,n=e[0],i=e[0],a=1;a<r;++a,i=n)if(i=n,(n=e[a])!==i){if(a===t){t++;continue}e[t++]=n}return e.length=t,e}(e))}},4359:function(e,t,r){e.exports=function(e,t){return("object"!=typeof t||null===t)&&(t={}),n(e,t.canvas||i,t.context||a,t)};var n=r(7718),i=null,a=null;typeof document<"u"&&((i=document.createElement("canvas")).width=8192,i.height=1024,a=i.getContext("2d"))},7718:function(e,t,r){e.exports=function(e,t,r,n){var a=64,o=1.25,s={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};return n&&(n.size&&n.size>0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(e){return e})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",b(function(e,t,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\<br\>/g,"\n"):r.replace(/\<br\>/g," ");var s="",l=[];for(I=0;I<r.length;++I)l[I]=s;!0===o.bolds&&(l=x(c,u,r,l)),!0===o.italics&&(l=x(h,f,r,l)),!0===o.superscripts&&(l=x(p,m,r,l)),!0===o.subscripts&&(l=x(g,v,r,l));var _=[],b="";for(I=0;I<r.length;++I)null!==l[I]&&(b+=r[I],_.push(l[I]));var w=b.split("\n"),T=w.length,k=Math.round(a*n),A=n,M=2*n,S=0,E=T*k+M;e.height<E&&(e.height=E),t.fillStyle="#000",t.fillRect(0,0,e.width,e.height),t.fillStyle="#fff";var C,I,L,P,z,D=0,O="";function R(){if(""!==O){var e=t.measureText(O).width;t.fillText(O,A+L,M+P),L+=e}}function F(){return Math.round(z)+"px "}function B(e,r){var n=""+t.font;if(!0===o.subscripts){var i=e.indexOf(y),a=r.indexOf(y),s=i>-1?parseInt(e[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),z*=Math.pow(.75,l-s),n=n.replace("?px ",F())),P+=.25*k*(l-s)}if(!0===o.superscripts){var c=e.indexOf(d),h=r.indexOf(d),p=c>-1?parseInt(e[1+c]):0,m=h>-1?parseInt(r[1+h]):0;p!==m&&(n=n.replace(F(),"?px "),z*=Math.pow(.75,m-p),n=n.replace("?px ",F())),P-=.25*k*(m-p)}if(!0===o.bolds){var g=e.indexOf(u)>-1,v=r.indexOf(u)>-1;!g&&v&&(n=x?n.replace("italic ","italic bold "):"bold "+n),g&&!v&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=e.indexOf(f)>-1,_=r.indexOf(f)>-1;!x&&_&&(n="italic "+n),x&&!_&&(n=n.replace("italic ",""))}t.font=n}for(C=0;C<T;++C){var j=w[C]+"\n";for(L=0,P=C*k,z=n,O="",I=0;I<j.length;++I){var N=I+D<_.length?_[I+D]:_[_.length-1];s===N?O+=j[I]:(R(),O=j[I],void 0!==N&&(B(s,N),s=N))}R(),D+=j.length;var U=0|Math.round(L+2*A);S<U&&(S=U)}var V=S,q=M+k*T;return i(t.getImageData(0,0,V,q).data,[q,V,4]).pick(-1,-1,0).transpose(1,0)}(t,r,e,a,o,s),n,a)},e.exports.processPixels=b;var n=r(3711),i=r(9618),a=r(5878),o=r(332),s=r(2538),l=r(2095),c="b",u="b|",h="i",f="i|",p="sup",d="+",m="+1",g="sub",y="-",v="-1";function x(e,t,r,n){for(var i="<"+e+">",a="</"+e+">",o=i.length,s=a.length,l=t[0]===d||t[0]===y,c=0,u=-s;c>-1&&!(-1===(c=r.indexOf(i,c))||(u=r.indexOf(a,c+o),-1===u)||u<=c);){for(var h=c;h<u+s;++h)if(h<c+o||h>=u)n[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==n[h]){var f=n[h].indexOf(t[0]);-1===f?n[h]+=t:l&&(n[h]=n[h].substr(0,f+1)+(1+parseInt(n[h][f+1]))+n[h].substr(f+2))}var p=c+o,m=r.substr(p,u-p).indexOf(i);c=-1!==m?m:u+s}return n}function _(e,t,r,i){var c=function(e,t){var r=n(e,128);return t?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(e,i),u=function(e,t,r){for(var n=t.textAlign||"start",i=t.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=e.length,l=0;l<s;++l)for(var c=e[l],u=0;u<2;++u)a[u]=0|Math.min(a[u],c[u]),o[u]=0|Math.max(o[u],c[u]);var h=0;switch(n){case"center":h=-.5*(a[0]+o[0]);break;case"right":case"end":h=-o[0];break;case"left":case"start":h=-a[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}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*r;break;case"bottom":f=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+i+"'")}var p=1/r;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]+h),p*(e[1]+f)]}))}(c.positions,t,r),h=c.edges,f="ccw"===t.orientation;if(o(u,h),t.polygons||t.polygon||t.polyline){for(var p=l(h,u),d=new Array(p.length),m=0;m<p.length;++m){for(var g=p[m],y=new Array(g.length),v=0;v<g.length;++v){for(var x=g[v],_=new Array(x.length),b=0;b<x.length;++b)_[b]=u[x[b]].slice();f&&_.reverse(),y[v]=_}d[m]=y}return d}return t.triangles||t.triangulate||t.triangle?{cells:s(u,h,{delaunay:!1,exterior:!1,interior:!0}),positions:u}:{edges:h,positions:u}}function b(e,t,r){try{return _(e,t,r,!0)}catch{}try{return _(e,t,r,!1)}catch{}return t.polygons||t.polyline||t.polygon?[]:t.triangles||t.triangulate||t.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}},1538:function(e){!function(){if(!(typeof ses<"u"&&ses.ok)||ses.ok()){typeof ses<"u"&&(ses.weakMapPermitHostObjects=g);var t=!1;if("function"==typeof WeakMap){var r=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var n=new r,i=Object.freeze({});if(n.set(i,1),1===n.get(i))return void(e.exports=WeakMap);t=!0}}Object.prototype.hasOwnProperty;var a=Object.getOwnPropertyNames,o=Object.defineProperty,s=Object.isExtensible,l="weakmap:",c=l+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var u=new ArrayBuffer(25),h=new Uint8Array(u);crypto.getRandomValues(h),c=l+"rand:"+Array.prototype.map.call(h,(function(e){return(e%36).toString(36)})).join("")+"___"}if(o(Object,"getOwnPropertyNames",{value:function(e){return a(e).filter(y)}}),"getPropertyNames"in Object){var f=Object.getPropertyNames;o(Object,"getPropertyNames",{value:function(e){return f(e).filter(y)}})}!function(){var e=Object.freeze;o(Object,"freeze",{value:function(t){return v(t),e(t)}});var t=Object.seal;o(Object,"seal",{value:function(e){return v(e),t(e)}});var r=Object.preventExtensions;o(Object,"preventExtensions",{value:function(e){return v(e),r(e)}})}();var p=!1,d=0,m=function(){this instanceof m||_();var e=[],t=[],r=d++;return Object.create(m.prototype,{get___:{value:x((function(n,i){var a,o=v(n);return o?r in o?o[r]:i:(a=e.indexOf(n))>=0?t[a]:i}))},has___:{value:x((function(t){var n=v(t);return n?r in n:e.indexOf(t)>=0}))},set___:{value:x((function(n,i){var a,o=v(n);return o?o[r]=i:(a=e.indexOf(n))>=0?t[a]=i:(a=e.length,t[a]=i,e[a]=n),this}))},delete___:{value:x((function(n){var i,a,o=v(n);return o?r in o&&delete o[r]:!((i=e.indexOf(n))<0||(a=e.length-1,e[i]=void 0,t[i]=t[a],e[i]=e[a],e.length=a,t.length=a,0))}))}})};m.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}}),"function"==typeof r?function(){function n(){this instanceof m||_();var e,n=new r,i=void 0,a=!1;return e=t?function(e,t){return n.set(e,t),n.has(e)||(i||(i=new m),i.set(e,t)),this}:function(e,t){if(a)try{n.set(e,t)}catch{i||(i=new m),i.set___(e,t)}else n.set(e,t);return this},Object.create(m.prototype,{get___:{value:x((function(e,t){return i?n.has(e)?n.get(e):i.get___(e,t):n.get(e,t)}))},has___:{value:x((function(e){return n.has(e)||!!i&&i.has___(e)}))},set___:{value:x(e)},delete___:{value:x((function(e){var t=!!n.delete(e);return i&&i.delete___(e)||t}))},permitHostObjects___:{value:x((function(e){if(e!==g)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}t&&typeof Proxy<"u"&&(Proxy=void 0),n.prototype=m.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),e.exports=m)}function g(e){e.permitHostObjects___&&e.permitHostObjects___(g)}function y(e){return!(e.substr(0,8)==l&&"___"===e.substr(e.length-3))}function v(e){if(e!==Object(e))throw new TypeError("Not an object: "+e);var t=e[c];if(t&&t.key===e)return t;if(s(e)){t={key:e};try{return o(e,c,{value:t,writable:!1,enumerable:!1,configurable:!1}),t}catch{return}}}function x(e){return e.prototype=null,Object.freeze(e)}function _(){!p&&typeof console<"u"&&(p=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236:function(e,t,r){var n=r(8284);e.exports=function(){var e={};return function(t){if(("object"!=typeof t||null===t)&&"function"!=typeof t)throw new Error("Weakmap-shim: Key must be object");var r=t.valueOf(e);return r&&r.identity===e?r:n(t,e)}}},8284:function(e){e.exports=function(e,t){var r={identity:t},n=e.valueOf;return Object.defineProperty(e,"valueOf",{value:function(e){return e!==t?n.apply(this,arguments):r},writable:!0}),r}},606:function(e,t,r){var n=r(236);e.exports=function(){var e=n();return{get:function(t,r){var n=e(t);return n.hasOwnProperty("value")?n.value:r},set:function(t,r){return e(t).value=r,this},has:function(t){return"value"in e(t)},delete:function(t){return delete e(t).value}}}},3349:function(e){var t,r,n=function(){return function(e,t,r,n,i,a){var o=e[0],s=r[0],l=[0],c=s;n|=0;var u=0,h=s;for(u=0;u<o;++u){var f=t[n]-a,p=t[n+c]-a;f>=0!=p>=0&&i.push(l[0]+.5+.5*(f+p)/(f-p)),n+=h,++l[0]}}};e.exports=(t=n.bind(void 0,{funcName:"zeroCrossings"}),r={},function(e,n,i){var a=e.dtype,o=e.order,s=[a,o.join()].join(),l=r[s];return l||(r[s]=l=t([a,o])),l(e.shape.slice(0),e.data,e.stride,0|e.offset,n,i)})},781:function(e,t,r){e.exports=function(e,t){var r=[];return t=+t||0,n(e.hi(e.shape[0]-1),r,t),r};var n=r(3349)},7790:function(){}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var a=r[t]={id:t,loaded:!1,exports:{}};return e[t].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch{if("object"==typeof window)return window}}(),n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var i=n(1964);t.exports=i}()}}),Xd=m({"node_modules/color-name/index.js"(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]}}}),$d=m({"node_modules/color-normalize/node_modules/color-parse/index.js"(e,t){var r=Xd();t.exports=function(e){var t,i,a=[],o=1;if("string"==typeof e)if(e=e.toLowerCase(),r[e])a=r[e].slice(),i="rgb";else if("transparent"===e)o=0,i="rgb",a=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var s=e.slice(1);o=1,(u=s.length)<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===u&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===u&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var l=t[1],c="rgb"===l;i=s=l.replace(/a$/,"");var u="cmyk"===s?4:"gray"===s?1:3;a=t[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(e,t){if(/%$/.test(e))return t===u?parseFloat(e)/100:"rgb"===s?255*parseFloat(e)/100:parseFloat(e);if("h"===s[t]){if(/deg$/.test(e))return parseFloat(e);if(void 0!==n[e])return n[e]}return parseFloat(e)})),l===s&&a.push(1),o=c||void 0===a[u]?1:a[u],a=a.slice(0,u)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(a=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),i=e.match(/([a-z])/gi).join("").toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(a=[e[0],e[1],e[2]],i="rgb",o=4===e.length?e[3]:1):e instanceof Object&&(null!=e.r||null!=e.red||null!=e.R?(i="rgb",a=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(i="hsl",a=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),o=e.a||e.alpha||e.opacity||1,null!=e.opacity&&(o/=100)):(i="rgb",a=[e>>>16,(65280&e)>>>8,255&e]);return{space:i,values:a,alpha:o}};var n={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Kd=m({"node_modules/color-normalize/node_modules/color-rgba/index.js"(e,t){var r=$d();t.exports=function(e){Array.isArray(e)&&e.raw&&(e=String.raw.apply(null,arguments));var t,n=r(e);if(!n.space)return[];var i=[0,0,0],a="h"===n.space[0]?[360,100,100]:[255,255,255];return(t=Array(3))[0]=Math.min(Math.max(n.values[0],i[0]),a[0]),t[1]=Math.min(Math.max(n.values[1],i[1]),a[1]),t[2]=Math.min(Math.max(n.values[2],i[2]),a[2]),"h"===n.space[0]&&(t=function(e){var t,r,n,i,a,o=e[0]/360,s=e[1]/100,l=e[2]/100,c=0;if(0===s)return[a=255*l,a,a];for(t=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];c<3;)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,i[c++]=255*a;return i}(t)),t.push(Math.min(Math.max(n.alpha,0),1)),t}}}),Jd=m({"node_modules/clamp/index.js"(e,t){t.exports=function(e,t,r){return t<r?e<t?t:e>r?r:e:e<r?r:e>t?t:e}}}),Qd=m({"node_modules/dtype/index.js"(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}}}}),em=m({"node_modules/color-normalize/index.js"(e,t){var r=Kd(),n=Jd(),i=Qd();t.exports=function(e,t){("float"===t||!t)&&(t="array"),"uint"===t&&(t="uint8"),"uint_clamped"===t&&(t="uint8_clamped");var a,o=new(i(t))(4),s="uint8"!==t&&"uint8_clamped"!==t;return(!e.length||"string"==typeof e)&&((e=r(e))[0]/=255,e[1]/=255,e[2]/=255),(a=e)instanceof Uint8Array||a instanceof Uint8ClampedArray||Array.isArray(a)&&(a[0]>1||0===a[0])&&(a[1]>1||0===a[1])&&(a[2]>1||0===a[2])&&(!a[3]||a[3]>1)?(o[0]=e[0],o[1]=e[1],o[2]=e[2],o[3]=null!=e[3]?e[3]:255,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]=null!=e[3]?e[3]:1):(o[0]=n(Math.floor(255*e[0]),0,255),o[1]=n(Math.floor(255*e[1]),0,255),o[2]=n(Math.floor(255*e[2]),0,255),o[3]=null==e[3]?255:n(Math.floor(255*e[3]),0,255)),o)}}}),tm=m({"src/lib/str2rgbarray.js"(e,t){var r=em();t.exports=function(e){return e?r(e):[0,0,0,1]}}}),rm=m({"src/lib/gl_format_color.js"(e,t){var r=M(),n=F(),i=em(),a=Yt(),o=G().defaultLine,s=I().isArrayOrTypedArray,l=i(o);function c(e,t){var r=e;return r[3]*=t,r}function u(e){if(r(e))return l;var t=i(e);return t.length?t:l}function h(e){return r(e)?e:1}t.exports={formatColor:function(e,t,r){var n=e.color;n&&n._inputArray&&(n=n._inputArray);var o,f,p,d,m,g=s(n),y=s(t),v=a.extractOpts(e),x=[];if(o=void 0!==v.colorscale?a.makeColorScaleFuncFromTrace(e):u,f=g?function(e,t){return void 0===e[t]?l:i(o(e[t]))}:u,p=y?function(e,t){return void 0===e[t]?1:h(e[t])}:h,g||y)for(var _=0;_<r;_++)d=f(n,_),m=p(t,_),x[_]=c(d,m);else x=c(i(n),t);return x},parseColorScale:function(e){var t=a.extractOpts(e),r=t.colorscale;return t.reversescale&&(r=a.flipScale(t.colorscale)),r.map((function(e){var t=e[0],r=n(e[1]).toRgb();return{index:t,rgb:[r.r,r.g,r.b,r.a]}}))}}}}),nm=m({"src/constants/gl3d_dashes.js"(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]}}}),im=m({"src/constants/gl3d_markers.js"(e,t){t.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}}}),am=m({"src/traces/scatter3d/calc_errors.js"(e,t){var r=He();function n(e,t,n,i){if(!t||!t.visible)return null;for(var a=r.getComponentMethod("errorbars","makeComputeError")(t),o=new Array(e.length),s=0;s<e.length;s++){var l=a(+e[s],s);if("log"===i.type){var c=i.c2l(e[s]),u=e[s]-l[0],h=e[s]+l[1];if(o[s]=[(i.c2l(u,!0)-c)*n,(i.c2l(h,!0)-c)*n],u>0){var f=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=f),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,f)}}else o[s]=[-l[0]*n,l[1]*n]}return o}t.exports=function(e,t,r){var i=[n(e.x,e.error_x,t[0],r.xaxis),n(e.y,e.error_y,t[1],r.yaxis),n(e.z,e.error_z,t[2],r.zaxis)],a=function(e){for(var t=0;t<e.length;t++)if(e[t])return e[t].length;return 0}(i);if(0===a)return null;for(var o=new Array(a),s=0;s<a;s++){for(var l=[[0,0,0],[0,0,0]],c=0;c<3;c++)if(i[c])for(var u=0;u<2;u++)l[u][c]=i[c][s][u];o[s]=l}return o}}}),om=m({"src/traces/scatter3d/convert.js"(e,t){var r=Yd().gl_line3d,n=Yd().gl_scatter3d,i=Yd().gl_error3d,a=Yd().gl_mesh3d,o=Yd().delaunay_triangulate,s=ct(),l=tm(),c=rm().formatColor,u=$t(),h=nm(),f=im(),p=ar(),d=Kt().appendArrayPointValue,m=am();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 y=g.prototype;function v(e){return null==e?0:e.indexOf("left")>-1?-1:e.indexOf("right")>-1?1:0}function x(e){return null==e?0:e.indexOf("top")>-1?-1:e.indexOf("bottom")>-1?1:0}function _(e,t){return t(4*e)}function b(e){return f[e]}function w(e,t,r,n,i){var a=null;if(s.isArrayOrTypedArray(e)){a=[];for(var o=0;o<t;o++)void 0===e[o]?a[o]=n:a[o]=r(e[o],i)}else a=r(e,s.identity);return a}function T(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(255*e)}))+")"}return null}function k(e){return s.isArrayOrTypedArray(e)?4===e.length&&"number"==typeof e[0]?T(e):e.map(T):null}y.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]||0===this.textLabels[t])&&(e.textLabel=this.textLabels[t]):e.textLabel=this.textLabels),e.traceCoordinate=[this.data.x[t],this.data.y[t],this.data.z[t]],!0}},y.update=function(e){var t,f,g,y,T=this.scene.glplot.gl,A=h.solid;this.data=e;var M=function(e,t){var r,n,i,a,o,h,f=[],g=e.fullSceneLayout,y=e.dataScale,T=g.xaxis,k=g.yaxis,A=g.zaxis,M=t.marker,S=t.line,E=t.x||[],C=t.y||[],I=t.z||[],L=E.length,P=t.xcalendar,z=t.ycalendar,D=t.zcalendar;for(o=0;o<L;o++)r=T.d2l(E[o],0,P)*y[0],n=k.d2l(C[o],0,z)*y[1],i=A.d2l(I[o],0,D)*y[2],f[o]=[r,n,i];if(Array.isArray(t.text))h=t.text;else if(s.isTypedArray(t.text))h=Array.from(t.text);else if(void 0!==t.text)for(h=new Array(L),o=0;o<L;o++)h[o]=t.text;function O(e,t){var r=g[e];return p.tickText(r,r.d2l(t),!0).text}var R=t.texttemplate;if(R){var F=e.fullLayout._d3locale,B=Array.isArray(R),j=B?Math.min(R.length,L):L,N=B?function(e){return R[e]}:function(){return R};for(h=new Array(j),o=0;o<j;o++){var U={x:E[o],y:C[o],z:I[o]},V={xLabel:O("xaxis",E[o]),yLabel:O("yaxis",C[o]),zLabel:O("zaxis",I[o])},q={};d(q,t,o),h[o]=s.texttemplateString({data:[q,U,t._meta],fallback:t.texttemplatefallback,labels:V,locale:F,template:N(o)})}}if(a={position:f,mode:t.mode,text:h},"line"in t&&(a.lineColor=c(S,1,L),a.lineWidth=S.width,a.lineDashes=S.dash),"marker"in t){var H=u(t);a.scatterColor=c(M,1,L),a.scatterSize=w(M.size,L,_,20,H),a.scatterMarker=w(M.symbol,L,b,"●"),a.scatterLineWidth=M.line.width,a.scatterLineColor=c(M.line,1,L),a.scatterAngle=0}"textposition"in t&&(a.textOffset=function(e){var t=[0,0];if(Array.isArray(e))for(var r=0;r<e.length;r++)t[r]=[0,0],e[r]&&(t[r][0]=v(e[r]),t[r][1]=x(e[r]));else t[0]=v(e),t[1]=x(e);return t}(t.textposition),a.textColor=c(t.textfont,1,L),a.textSize=w(t.textfont.size,L,s.identity,12),a.textFontFamily=t.textfont.family,a.textFontWeight=t.textfont.weight,a.textFontStyle=t.textfont.style,a.textFontVariant=t.textfont.variant,a.textAngle=0);var G=["x","y","z"];for(a.project=[!1,!1,!1],a.projectScale=[1,1,1],a.projectOpacity=[1,1,1],o=0;o<3;++o){var W=t.projection[G[o]];(a.project[o]=W.show)&&(a.projectOpacity[o]=W.opacity,a.projectScale[o]=W.scale)}a.errorBounds=m(t,y,g);var Z=function(e){for(var t=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[1,1,1],i=0;i<3;i++){var a=e[i];a&&!1!==a.copy_zstyle&&!1!==e[2].visible&&(a=e[2]),a&&a.visible&&(t[i]=a.width/2,r[i]=l(a.color),n[i]=a.thickness)}return{capSize:t,color:r,lineWidth:n}}([t.error_x,t.error_y,t.error_z]);return a.errorColor=Z.color,a.errorLineWidth=Z.lineWidth,a.errorCapSize=Z.capSize,a.delaunayAxis=t.surfaceaxis,a.delaunayColor=l(t.surfacecolor),a}(this.scene,e);"mode"in M&&(this.mode=M.mode),"lineDashes"in M&&M.lineDashes in h&&(A=h[M.lineDashes]),this.color=k(M.scatterColor)||k(M.lineColor),this.dataPoints=M.position,t={gl:this.scene.glplot.gl,position:M.position,color:M.lineColor,lineWidth:M.lineWidth||1,dashes:A[0],dashScale:A[1],opacity:e.opacity,connectGaps:e.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(t):(this.linePlot=r(t),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var S=e.opacity;if(e.marker&&void 0!==e.marker.opacity&&(S*=e.marker.opacity),f={gl:this.scene.glplot.gl,position:M.position,color:M.scatterColor,size:M.scatterSize,glyph:M.scatterMarker,opacity:S,orthographic:!0,lineWidth:M.scatterLineWidth,lineColor:M.scatterLineColor,project:M.project,projectScale:M.projectScale,projectOpacity:M.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(f):(this.scatterPlot=n(f),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),y={gl:this.scene.glplot.gl,position:M.position,glyph:M.text,color:M.textColor,size:M.textSize,angle:M.textAngle,alignment:M.textOffset,font:M.textFontFamily,fontWeight:M.textFontWeight,fontStyle:M.textFontStyle,fontVariant:M.textFontVariant,orthographic:!0,lineWidth:0,project:!1,opacity:e.opacity},this.textLabels=e.hovertext||e.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(y):(this.textMarkers=n(y),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),g={gl:this.scene.glplot.gl,position:M.position,color:M.errorColor,error:M.errorBounds,lineWidth:M.errorLineWidth,capSize:M.errorCapSize,opacity:e.opacity},this.errorBars?M.errorBounds?this.errorBars.update(g):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):M.errorBounds&&(this.errorBars=i(g),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),M.delaunayAxis>=0){var E=function(e,t,r){var n,i=(r+1)%3,a=(r+2)%3,s=[],l=[];for(n=0;n<e.length;++n){var c=e[n];isNaN(c[i])||!isFinite(c[i])||isNaN(c[a])||!isFinite(c[a])||(s.push([c[i],c[a]]),l.push(n))}var u=o(s);for(n=0;n<u.length;++n)for(var h=u[n],f=0;f<h.length;++f)h[f]=l[h[f]];return{positions:e,cells:u,meshColor:t}}(M.position,M.delaunayColor,M.delaunayAxis);E.opacity=e.opacity,this.delaunayMesh?this.delaunayMesh.update(E):(E.gl=T,this.delaunayMesh=a(E),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},y.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())},t.exports=function(e,t){var r=new g(e,t.uid);return r.update(t),r}}}),sm=m({"src/traces/scatter3d/attributes.js"(e,t){var r=kn(),n=j(),i=zt(),a=It().axisHoverFormat,{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:l}=Fe(),c=q(),u=nm(),h=im(),f=B().extendFlat,p=De().overrideAll,d=Ye(),m=r.line,g=r.marker,y=g.line,v=f({width:m.width,dash:{valType:"enumerated",values:d(u),dflt:"solid"}},i("line")),x=t.exports=p({x:r.x,y:r.y,z:{valType:"data_array"},text:f({},r.text,{}),texttemplate:s(),texttemplatefallback:l({editType:"calc"}),hovertext:f({},r.hovertext,{}),hovertemplate:o(),hovertemplatefallback:l(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),mode:f({},r.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},y:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},z:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}},connectgaps:r.connectgaps,line:v,marker:f({symbol:{valType:"enumerated",values:d(h),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({},y.width,{arrayOk:!1})},i("marker.line"))},i("marker")),textposition:f({},r.textposition,{dflt:"top center"}),textfont:n({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:c.opacity,hoverinfo:f({},c.hoverinfo)},"calc","nested");x.x.editType=x.y.editType=x.z.editType="calc+clearAxisTypes"}}),lm=m({"src/traces/scatter3d/defaults.js"(e,t){var r=He(),n=ct(),i=Xt(),a=Yn(),o=Xn(),s=Kn(),l=sm();t.exports=function(e,t,c,u){function h(r,i){return n.coerce(e,t,l,r,i)}var f=function(e,t,n,i){var a=0,o=n("x"),s=n("y"),l=n("z");return r.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],i),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),t._length=t._xlength=t._ylength=t._zlength=a),a}(e,t,h,u);if(f){h("text"),h("hovertext"),h("hovertemplate"),h("hovertemplatefallback"),h("xhoverformat"),h("yhoverformat"),h("zhoverformat"),h("mode"),i.hasMarkers(t)&&a(e,t,c,u,h,{noAngle:!0,noLineDash:!0,noSelect:!0}),i.hasLines(t)&&(h("connectgaps"),o(e,t,c,u,h)),i.hasText(t)&&(h("texttemplate"),h("texttemplatefallback"),s(e,t,u,h,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var p=(t.line||{}).color,d=(t.marker||{}).color;h("surfaceaxis")>=0&&h("surfacecolor",p||d);for(var m=["x","y","z"],g=0;g<3;++g){var y="projection."+m[g];h(y+".show")&&(h(y+".opacity"),h(y+".scale"))}var v=r.getComponentMethod("errorbars","supplyDefaults");v(e,t,p||d||c,{axis:"z"}),v(e,t,p||d||c,{axis:"y",inherit:"z"}),v(e,t,p||d||c,{axis:"x",inherit:"z"})}else t.visible=!1}}}),cm=m({"src/traces/scatter3d/calc.js"(e,t){var r=ai(),n=ii();t.exports=function(e,t){var i=[{x:!1,y:!1,trace:t,t:{}}];return r(i,t),n(e,t),i}}}),um=m({"node_modules/get-canvas-context/index.js"(e,t){t.exports=function(e,t){if("string"!=typeof e)throw new TypeError("must specify type string");if(t=t||{},typeof document>"u"&&!t.canvas)return null;var r=t.canvas||document.createElement("canvas");"number"==typeof t.width&&(r.width=t.width),"number"==typeof t.height&&(r.height=t.height);var n,i=t;try{var a=[e];0===e.indexOf("webgl")&&a.push("experimental-"+e);for(var o=0;o<a.length;o++)if(n=r.getContext(a[o],i))return n}catch{n=null}return n||null}}}),hm=m({"node_modules/webgl-context/index.js"(e,t){var r=um();t.exports=function(e){return r("webgl",e)}}}),fm=m({"src/lib/show_no_webgl_msg.js"(e,t){var r=W(),n=function(){};t.exports=function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=n);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=r.defaults[0],i.style.position="absolute",i.style.left=i.style.top="0px",i.style.width=i.style.height="100%",i.style["background-color"]=r.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}}}),pm=m({"src/plots/gl3d/layout/convert.js"(e,t){var r=tm(),n=ct(),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()}a.prototype.merge=function(e,t){for(var a=this,o=0;o<3;++o){var s=t[i[o]];s.visible?(a.labels[o]=e._meta?n.templateString(s.title.text,e._meta):s.title.text,"font"in s.title&&(s.title.font.color&&(a.labelColor[o]=r(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]=r(s.linecolor)),"linewidth"in s&&(a.lineWidth[o]=s.linewidth),"showgrid"in s&&(a.gridEnable[o]=s.showgrid),"gridcolor"in s&&(a.gridColor[o]=r(s.gridcolor)),"gridwidth"in s&&(a.gridWidth[o]=s.gridwidth),"log"===s.type?a.zeroEnable[o]=!1:"zeroline"in s&&(a.zeroEnable[o]=s.zeroline),"zerolinecolor"in s&&(a.zeroLineColor[o]=r(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]=r(s.tickcolor)),"tickwidth"in s&&(a.lineTickWidth[o]=s.tickwidth),"tickangle"in s&&(a.tickAngle[o]="auto"===s.tickangle?-3600:Math.PI*-s.tickangle/180),"showticklabels"in s&&(a.tickEnable[o]=s.showticklabels),"tickfont"in s&&(s.tickfont.color&&(a.tickColor[o]=r(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?-1!==["ticks","all","allticks"].indexOf(s.mirror)?(a.lineTickMirror[o]=!0,a.lineMirror[o]=!0):!0===s.mirror?(a.lineTickMirror[o]=!1,a.lineMirror[o]=!0):(a.lineTickMirror[o]=!1,a.lineMirror[o]=!1):a.lineMirror[o]=!1,"showbackground"in s&&!1!==s.showbackground?(a.backgroundEnable[o]=!0,a.backgroundColor[o]=r(s.backgroundcolor)):a.backgroundEnable[o]=!1):(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)}},t.exports=function(e,t){var r=new a;return r.merge(e,t),r}}}),dm=m({"src/plots/gl3d/layout/spikes.js"(e,t){var r=tm(),n=["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]}i.prototype.merge=function(e){for(var t=0;t<3;++t){var i=e[n[t]];i.visible?(this.enabled[t]=i.showspikes,this.colors[t]=r(i.spikecolor),this.drawSides[t]=i.spikesides,this.lineWidth[t]=i.spikethickness):(this.enabled[t]=!1,this.drawSides[t]=!1)}},t.exports=function(e){var t=new i;return t.merge(e),t}}}),mm=m({"src/plots/gl3d/layout/tick_marks.js"(e,t){t.exports=function(e){for(var t=e.axesOptions,o=e.glplot.axesPixels,s=e.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[i[c]];if(u._length=(o[c].hi-o[c].lo)*o[c].pixelsPerDataUnit/e.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=o[c].lo/e.dataScale[c],u.range[1]=o[c].hi/e.dataScale[c],u._m=1/(e.dataScale[c]*o[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var h=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var f=u.nticks||n.constrain(u._length/40,4,9);r.autoTicks(u,Math.abs(u.range[1]-u.range[0])/f)}for(var p=r.calcTicks(u,{msUTC:!0}),d=0;d<p.length;++d)p[d].x=p[d].x*e.dataScale[c],"date"===u.type&&(p[d].text=p[d].text.replace(/\<br\>/g," "));l[c]=p,u.tickmode=h}}for(t.ticks=l,c=0;c<3;++c)for(a[c]=.5*(e.glplot.bounds[0][c]+e.glplot.bounds[1][c]),d=0;d<2;++d)t.bounds[d][c]=e.glplot.bounds[d][c];e.contourLevels=function(e){for(var t=new Array(3),r=0;r<3;++r){for(var n=e[r],i=new Array(n.length),a=0;a<n.length;++a)i[a]=n[a].x;t[r]=i}return t}(l)};var r=ar(),n=ct(),i=["xaxis","yaxis","zaxis"],a=[0,0,0]}}),gm=m({"src/plots/gl3d/scene.js"(e,t){var r,n,i=Yd().gl_plot3d,a=i.createCamera,o=i.createScene,s=hm(),l=cr(),c=He(),u=ct(),h=u.preserveDrawingBuffer(),f=ar(),p=Or(),d=tm(),m=fm(),g=Vi(),y=pm(),v=dm(),x=mm(),_=ir().applyAutorangeOptions,b=!1;function w(e,t){var r=document.createElement("div"),n=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",r.appendChild(i),this.svgContainer=i,r.id=e.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=t,this.id=e.id||"scene",this.fullSceneLayout=t[this.id],this.plotArgs=[[],{},{}],this.axesOptions=y(t,t[this.id]),this.spikeOptions=v(t[this.id]),this.container=r,this.staticMode=!!e.staticPlot,this.pixelRatio=this.pixelRatio||e.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=c.getComponentMethod("annotations3d","convert"),this.drawAnnotations=c.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var T=w.prototype;T.prepareOptions=function(){var e=this,t={canvas:e.canvas,gl:e.gl,glOptions:{preserveDrawingBuffer:h,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(!(n||(r=document.createElement("canvas"),n=s({canvas:r,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}))))throw new Error("error creating static canvas/context for image server");t.gl=n,t.canvas=r}return t};var k=!0;T.tryCreatePlot=function(){var e=this,t=e.prepareOptions(),r=!0;try{e.glplot=o(t)}catch{if(e.staticMode||!k||h)r=!1;else{u.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{h=t.glOptions.preserveDrawingBuffer=!0,e.glplot=o(t)}catch{h=t.glOptions.preserveDrawingBuffer=!1,r=!1}}}return k=!1,r},T.initializeGLCamera=function(){var e=this,t=e.fullSceneLayout.camera,r="orthographic"===t.projection.type;e.camera=a(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:r,zoomMin:.01,zoomMax:100,mode:"orbit"})},T.initializeGLPlot=function(){var e=this;if(e.initializeGLCamera(),!e.tryCreatePlot())return m(e);e.traces={},e.make4thDimension();var t=e.graphDiv,r=t.layout,n=function(){var t={};return e.isCameraChanged(r)&&(t[e.id+".camera"]=e.getCamera()),e.isAspectChanged(r)&&(t[e.id+".aspectratio"]=e.glplot.getAspectratio(),"manual"!==r[e.id].aspectmode&&(e.fullSceneLayout.aspectmode=r[e.id].aspectmode=t[e.id+".aspectmode"]="manual")),t},i=function(e){if(!1!==e.fullSceneLayout.dragmode){var t=n();e.saveLayout(r),e.graphDiv.emit("plotly_relayout",t)}};return e.glplot.canvas&&(e.glplot.canvas.addEventListener("mouseup",(function(){i(e)})),e.glplot.canvas.addEventListener("touchstart",(function(){b=!0})),e.glplot.canvas.addEventListener("wheel",(function(r){if(t._context._scrollZoom.gl3d){if(e.camera._ortho){var n=r.deltaX>r.deltaY?1.1:.9090909090909091,a=e.glplot.getAspectratio();e.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(e)}}),!!l&&{passive:!1}),e.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==e.fullSceneLayout.dragmode&&0!==e.camera.mouseListener.buttons){var t=n();e.graphDiv.emit("plotly_relayouting",t)}})),e.staticMode||e.glplot.canvas.addEventListener("webglcontextlost",(function(r){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:r,layer:e.id})}),!1)),e.glplot.oncontextloss=function(){e.recoverContext()},e.glplot.onrender=function(){e.render()},!0},T.render=function(){var e,t=this,r=t.graphDiv,n=t.svgContainer,i=t.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(t),t.glplot.axes.update(t.axesOptions);for(var c=Object.keys(t.traces),h=null,d=t.glplot.selection,m=0;m<c.length;++m)"skip"!==(e=t.traces[c[m]]).data.hoverinfo&&e.handlePick(d)&&(h=e),e.setContourLevels&&e.setContourLevels();function y(e,r,n){var i=t.fullSceneLayout[e+"axis"];return"log"!==i.type&&(r=i.d2l(r)),f.hoverLabelText(i,r,n)}if(null!==h){var v=g(t.glplot.cameraParams,d.dataCoordinate);e=h.data;var _=r._fullData[e.index],w=d.index,T={xLabel:y("x",d.traceCoordinate[0],e.xhoverformat),yLabel:y("y",d.traceCoordinate[1],e.yhoverformat),zLabel:y("z",d.traceCoordinate[2],e.zhoverformat)},k=p.castHoverinfo(_,t.fullLayout,w),A=(k||"").split("+"),M=k&&"all"===k;!_.hovertemplate&&!M&&(-1===A.indexOf("x")&&(T.xLabel=void 0),-1===A.indexOf("y")&&(T.yLabel=void 0),-1===A.indexOf("z")&&(T.zLabel=void 0),-1===A.indexOf("text")&&(d.textLabel=void 0),-1===A.indexOf("name")&&(h.name=void 0));var S,E=[];"cone"===e.type||"streamtube"===e.type?(T.uLabel=y("x",d.traceCoordinate[3],e.uhoverformat),(M||-1!==A.indexOf("u"))&&E.push("u: "+T.uLabel),T.vLabel=y("y",d.traceCoordinate[4],e.vhoverformat),(M||-1!==A.indexOf("v"))&&E.push("v: "+T.vLabel),T.wLabel=y("z",d.traceCoordinate[5],e.whoverformat),(M||-1!==A.indexOf("w"))&&E.push("w: "+T.wLabel),T.normLabel=d.traceCoordinate[6].toPrecision(3),(M||-1!==A.indexOf("norm"))&&E.push("norm: "+T.normLabel),"streamtube"===e.type&&(T.divergenceLabel=d.traceCoordinate[7].toPrecision(3),(M||-1!==A.indexOf("divergence"))&&E.push("divergence: "+T.divergenceLabel)),d.textLabel&&E.push(d.textLabel),S=E.join("<br>")):"isosurface"===e.type||"volume"===e.type?(T.valueLabel=f.hoverLabelText(t._mockAxis,t._mockAxis.d2l(d.traceCoordinate[3]),e.valuehoverformat),E.push("value: "+T.valueLabel),d.textLabel&&E.push(d.textLabel),S=E.join("<br>")):S=d.textLabel;var C={x:d.traceCoordinate[0],y:d.traceCoordinate[1],z:d.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:w};p.appendArrayPointValue(C,_,w),e._module.eventData&&(C=_._module.eventData(C,d,_,{},w));var I={points:[C]};if(t.fullSceneLayout.hovermode){var L=[];p.loneHover({trace:_,x:(.5+.5*v[0]/v[3])*s,y:(.5-.5*v[1]/v[3])*l,xLabel:T.xLabel,yLabel:T.yLabel,zLabel:T.zLabel,text:S,name:h.name,color:p.castHoverOption(_,w,"bgcolor")||h.color,borderColor:p.castHoverOption(_,w,"bordercolor"),fontFamily:p.castHoverOption(_,w,"font.family"),fontSize:p.castHoverOption(_,w,"font.size"),fontColor:p.castHoverOption(_,w,"font.color"),nameLength:p.castHoverOption(_,w,"namelength"),textAlign:p.castHoverOption(_,w,"align"),hovertemplate:u.castOption(_,w,"hovertemplate"),hovertemplateLabels:u.extendFlat({},C,T),eventData:[C]},{container:n,gd:r,inOut_bbox:L}),C.bbox=L[0]}d.distance<5&&(d.buttons||b)?r.emit("plotly_click",I):r.emit("plotly_hover",I),this.oldEventData=I}else p.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;t.drawAnnotations(t)},T.recoverContext=function(){var e=this;e.glplot.dispose();var t=function(){e.glplot.gl.isContextLost()?requestAnimationFrame(t):e.initializeGLPlot()?e.plot.apply(e,e.plotArgs):u.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(t)};var A=["xaxis","yaxis","zaxis"];function M(e,t,r){for(var n=e.fullSceneLayout,i=0;i<3;i++){var a=A[i],o=a.charAt(0),s=n[a],l=t[o],c=t[o+"calendar"],h=t["_"+o+"length"];if(u.isArrayOrTypedArray(l))for(var f,p=0;p<(h||l.length);p++)if(u.isArrayOrTypedArray(l[p]))for(var d=0;d<l[p].length;++d)f=s.d2l(l[p][d],0,c),!isNaN(f)&&isFinite(f)&&(r[0][i]=Math.min(r[0][i],f),r[1][i]=Math.max(r[1][i],f));else f=s.d2l(l[p],0,c),!isNaN(f)&&isFinite(f)&&(r[0][i]=Math.min(r[0][i],f),r[1][i]=Math.max(r[1][i],f));else r[0][i]=Math.min(r[0][i],0),r[1][i]=Math.max(r[1][i],h-1)}}T.plot=function(e,t,r){var n=this;if(n.plotArgs=[e,t,r],!n.glplot.contextLost){var i,a,o,s,l,c,u=t[n.id],h=r[n.id];n.fullLayout=t,n.fullSceneLayout=u,n.axesOptions.merge(t,u),n.spikeOptions.merge(u),n.setViewport(u),n.updateFx(u.dragmode,u.hovermode),n.camera.enableWheel=n.graphDiv._context._scrollZoom.gl3d,n.glplot.setClearColor(d(u.bgcolor)),n.setConvert(l),e?Array.isArray(e)||(e=[e]):e=[];var f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(o=0;o<e.length;++o)!0===(i=e[o]).visible&&0!==i._length&&M(this,i,f);!function(e,t){for(var r=e.fullSceneLayout,n=r.annotations||[],i=0;i<3;i++)for(var a=A[i],o=a.charAt(0),s=r[a],l=0;l<n.length;l++){var c=n[l];if(c.visible){var u=s.r2l(c[o]);!isNaN(u)&&isFinite(u)&&(t[0][i]=Math.min(t[0][i],u),t[1][i]=Math.max(t[1][i],u))}}}(this,f);var p=[1,1,1];for(s=0;s<3;++s)f[1][s]===f[0][s]?p[s]=1:p[s]=1/(f[1][s]-f[0][s]);for(n.dataScale=p,n.convertAnnotations(this),o=0;o<e.length;++o)!0===(i=e[o]).visible&&0!==i._length&&((a=n.traces[i.uid])?a.data.type===i.type?a.update(i):(a.dispose(),a=i._module.plot(this,i),n.traces[i.uid]=a):(a=i._module.plot(this,i),n.traces[i.uid]=a),a.name=i.name);var m=Object.keys(n.traces);e:for(o=0;o<m.length;++o){for(s=0;s<e.length;++s)if(e[s].uid===m[o]&&!0===e[s].visible&&0!==e[s]._length)continue e;(a=n.traces[m[o]]).dispose(),delete n.traces[m[o]]}n.glplot.objects.sort((function(e,t){return e._trace.data.index-t._trace.data.index}));var g=[[0,0,0],[0,0,0]],y=[],v={};for(o=0;o<3;++o){var x;if((c=(l=u[A[o]]).type)in v?(v[c].acc*=p[o],v[c].count+=1):v[c]={acc:p[o],count:1},l.autorange){g[0][o]=1/0,g[1][o]=-1/0;var b=n.glplot.objects,w=n.fullSceneLayout.annotations||[],T=l._name.charAt(0);for(s=0;s<b.length;s++){var k=b[s],S=k.bounds,E=k._trace.data._pad||0;"ErrorBars"===k.constructor.name&&l._lowerLogErrorBound?g[0][o]=Math.min(g[0][o],l._lowerLogErrorBound):g[0][o]=Math.min(g[0][o],S[0][o]/p[o]-E),g[1][o]=Math.max(g[1][o],S[1][o]/p[o]+E)}for(s=0;s<w.length;s++){var C=w[s];if(C.visible){var I=l.r2l(C[T]);g[0][o]=Math.min(g[0][o],I),g[1][o]=Math.max(g[1][o],I)}}if("rangemode"in l&&"tozero"===l.rangemode&&(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 L=g[1][o]-g[0][o];g[0][o]-=L/32,g[1][o]+=L/32}if(x=[g[0][o],g[1][o]],x=_(x,l),g[0][o]=x[0],g[1][o]=x[1],l.isReversed()){var P=g[0][o];g[0][o]=g[1][o],g[1][o]=P}}else x=l.range,g[0][o]=l.r2l(x[0]),g[1][o]=l.r2l(x[1]);g[0][o]===g[1][o]&&(g[0][o]-=1,g[1][o]+=1),y[o]=g[1][o]-g[0][o],l.range=[g[0][o],g[1][o]],l.limitRange(),n.glplot.setBounds(o,{min:l.range[0]*p[o],max:l.range[1]*p[o]})}var z,D=u.aspectmode;if("cube"===D)z=[1,1,1];else if("manual"===D){var O=u.aspectratio;z=[O.x,O.y,O.z]}else{if("auto"!==D&&"data"!==D)throw new Error("scene.js aspectRatio was not one of the enumerated types");var R=[1,1,1];for(o=0;o<3;++o){var F=v[c=(l=u[A[o]]).type];R[o]=Math.pow(F.acc,1/F.count)/p[o]}z="data"===D||Math.max.apply(null,R)/Math.min.apply(null,R)<=4?R:[1,1,1]}u.aspectratio.x=h.aspectratio.x=z[0],u.aspectratio.y=h.aspectratio.y=z[1],u.aspectratio.z=h.aspectratio.z=z[2],n.glplot.setAspectratio(u.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=u.aspectmode);var B=u.domain||null,j=t._size||null;if(B&&j){var N=n.container.style;N.position="absolute",N.left=j.l+B.x[0]*j.w+"px",N.top=j.t+(1-B.y[1])*j.h+"px",N.width=j.w*(B.x[1]-B.x[0])+"px",N.height=j.h*(B.y[1]-B.y[0])+"px"}n.glplot.redraw()}},T.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),e.glplot=null)},T.getCamera=function(){var e=this;return e.camera.view.recalcMatrix(e.camera.view.lastT()),function(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:!0===e._ortho?"orthographic":"perspective"}}}(e.camera)},T.setViewport=function(e){var t=this,r=e.camera;t.camera.lookAt.apply(this,function(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]]}(r)),t.glplot.setAspectratio(e.aspectratio),"orthographic"===r.projection.type!==t.camera._ortho&&(t.glplot.redraw(),t.glplot.clearRGBA(),t.glplot.dispose(),t.initializeGLPlot())},T.isCameraChanged=function(e){var t,r,n,i,a,o,s=this.getCamera(),l=u.nestedProperty(e,this.id+".camera").get(),c=!1;if(void 0===l)c=!0;else{for(var h=0;h<3;h++)for(var f=0;f<3;f++)if(t=s,i=f,void 0,void 0,o=["x","y","z"],!(r=l)[(a=["up","center","eye"])[n=h]]||t[a[n]][o[i]]!==r[a[n]][o[i]]){c=!0;break}(!l.projection||s.projection&&s.projection.type!==l.projection.type)&&(c=!0)}return c},T.isAspectChanged=function(e){var t=this.glplot.getAspectratio(),r=u.nestedProperty(e,this.id+".aspectratio").get();return void 0===r||r.x!==t.x||r.y!==t.y||r.z!==t.z},T.saveLayout=function(e){var t,r,n,i,a,o,s=this,l=s.fullLayout,h=s.isCameraChanged(e),f=s.isAspectChanged(e),p=h||f;if(p){var d={};h&&(t=s.getCamera(),n=(r=u.nestedProperty(e,s.id+".camera")).get(),d[s.id+".camera"]=n),f&&(i=s.glplot.getAspectratio(),o=(a=u.nestedProperty(e,s.id+".aspectratio")).get(),d[s.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",e,l._preGUI,d),h&&(r.set(t),u.nestedProperty(l,s.id+".camera").set(t)),f&&(a.set(i),u.nestedProperty(l,s.id+".aspectratio").set(i),s.glplot.redraw())}return p},T.updateFx=function(e,t){var r=this,n=r.camera;if(n)if("orbit"===e)n.mode="orbit",n.keyBindingMode="rotate";else if("turntable"===e){n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate";var i=r.graphDiv,a=i._fullLayout,o=r.fullSceneLayout.camera,s=o.up.x,l=o.up.y,h=o.up.z;if(h/Math.sqrt(s*s+l*l+h*h)<.999){var f=r.id+".camera.up",p={x:0,y:0,z:1},d={};d[f]=p;var m=i.layout;c.call("_storeDirectGUIEdit",m,a._preGUI,d),o.up=p,u.nestedProperty(m,f).set(p)}}else n.keyBindingMode=e;r.fullSceneLayout.hovermode=t},T.toImage=function(e){var t=this;e||(e="png"),t.staticMode&&t.container.appendChild(r),t.glplot.redraw();var n=t.glplot.gl,i=n.drawingBufferWidth,a=n.drawingBufferHeight;n.bindFramebuffer(n.FRAMEBUFFER,null);var o=new Uint8Array(i*a*4);n.readPixels(0,0,i,a,n.RGBA,n.UNSIGNED_BYTE,o),function(e,t,r){for(var n=0,i=r-1;n<i;++n,--i)for(var a=0;a<t;++a)for(var o=0;o<4;++o){var s=4*(t*n+a)+o,l=4*(t*i+a)+o,c=e[s];e[s]=e[l],e[l]=c}}(o,i,a),function(e,t,r){for(var n=0;n<r;++n)for(var i=0;i<t;++i){var a=4*(t*n+i),o=e[a+3];if(o>0)for(var s=255/o,l=0;l<3;++l)e[a+l]=Math.min(s*e[a+l],255)}}(o,i,a);var s=document.createElement("canvas");s.width=i,s.height=a;var l,c=s.getContext("2d",{willReadFrequently:!0}),u=c.createImageData(i,a);switch(u.data.set(o),c.putImageData(u,0,0),e){case"jpeg":l=s.toDataURL("image/jpeg");break;case"webp":l=s.toDataURL("image/webp");break;default:l=s.toDataURL("image/png")}return t.staticMode&&t.container.removeChild(r),l},T.setConvert=function(){for(var e=0;e<3;e++){var t=this.fullSceneLayout[A[e]];f.setConvert(t,this.fullLayout),t.setScale=u.noop}},T.make4thDimension=function(){var e=this,t=e.graphDiv._fullLayout;e._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(e._mockAxis,t)},t.exports=w}}),ym=m({"src/plots/gl3d/layout/attributes.js"(e,t){t.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),vm=m({"src/plots/gl3d/layout/axis_attributes.js"(e,t){var r=W(),n=Lt(),i=B().extendFlat,a=De().overrideAll;t.exports=a({visible:n.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:r.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:n.color,categoryorder:n.categoryorder,categoryarray:n.categoryarray,title:{text:n.title.text,font:n.title.font},type:i({},n.type,{values:["-","linear","log","date","category"]}),autotypenumbers:n.autotypenumbers,autorange:n.autorange,autorangeoptions:{minallowed:n.autorangeoptions.minallowed,maxallowed:n.autorangeoptions.maxallowed,clipmin:n.autorangeoptions.clipmin,clipmax:n.autorangeoptions.clipmax,include:n.autorangeoptions.include,editType:"plot"},rangemode:n.rangemode,minallowed:n.minallowed,maxallowed:n.maxallowed,range:i({},n.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,mirror:n.mirror,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,tickfont:n.tickfont,tickangle:n.tickangle,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickformat:n.tickformat,tickformatstops:n.tickformatstops,hoverformat:n.hoverformat,showline:n.showline,linecolor:n.linecolor,linewidth:n.linewidth,showgrid:n.showgrid,gridcolor:i({},n.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:n.gridwidth,zeroline:n.zeroline,zerolinecolor:n.zerolinecolor,zerolinewidth:n.zerolinewidth},"plot","from-root")}}),xm=m({"src/plots/gl3d/layout/layout_attributes.js"(e,t){var r=vm(),n=Ma().attributes,i=B().extendFlat,a=ct().counterRegex;function o(e,t,r){return{x:{valType:"number",dflt:e,editType:"camera"},y:{valType:"number",dflt:t,editType:"camera"},z:{valType:"number",dflt:r,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:n({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:r,yaxis:r,zaxis:r,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"}}}),_m=m({"src/plots/gl3d/layout/axis_defaults.js"(e,t){var r=F().mix,n=ct(),i=vt(),a=vm(),o=wi(),s=Ai(),l=["xaxis","yaxis","zaxis"],c=13600/187;t.exports=function(e,t,u){var h,f;function p(e,t){return n.coerce(h,f,a,e,t)}for(var d=0;d<l.length;d++){var m=l[d];h=e[m]||{},(f=i.newContainer(t,m))._id=m[0]+u.scene,f._name=m,o(h,f,p,u),s(h,f,p,{font:u.font,letter:m[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",r(f.color,u.bgColor,c).toRgbString()),p("title.text",m[0]),f.setScale=n.noop,p("showspikes")&&(p("spikesides"),p("spikethickness"),p("spikecolor",f.color)),p("showaxeslabels"),p("showbackground")&&p("backgroundcolor")}}}}),bm=m({"src/plots/gl3d/layout/defaults.js"(e,t){var r=ct(),n=W(),i=He(),a=Gs(),o=_m(),s=xm(),l=Tt().getSubplotData,c="gl3d";function u(e,t,r,a){for(var s=r("bgcolor"),u=n.combine(s,a.paper_bgcolor),h=["up","center","eye"],f=0;f<h.length;f++)r("camera."+h[f]+".x"),r("camera."+h[f]+".y"),r("camera."+h[f]+".z");r("camera.projection.type");var p=!!r("aspectratio.x")&&!!r("aspectratio.y")&&!!r("aspectratio.z"),d=r("aspectmode",p?"manual":"auto");p||(e.aspectratio=t.aspectratio={x:1,y:1,z:1},"manual"===d&&(t.aspectmode="auto"),e.aspectmode=t.aspectmode);var m=l(a.fullData,c,a.id);o(e,t,{font:a.font,scene:a.id,data:m,bgColor:u,calendar:a.calendar,autotypenumbersDflt:a.autotypenumbersDflt,fullLayout:a.fullLayout}),i.getComponentMethod("annotations3d","handleDefaults")(e,t,a);var g=a.getDfltFromLayout("dragmode");if(!1!==g&&!g)if(g="orbit",e.camera&&e.camera.up){var y=e.camera.up.x,v=e.camera.up.y,x=e.camera.up.z;0!==x&&(!y||!v||!x||x/Math.sqrt(y*y+v*v+x*x)>.999)&&(g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",a.getDfltFromLayout("hovermode"))}t.exports=function(e,t,n){var i=t._basePlotModules.length>1;a(e,t,n,{type:c,attributes:s,handleDefaults:u,fullLayout:t,font:t.font,fullData:n,getDfltFromLayout:function(t){if(!i&&r.validate(e[t],s[t]))return e[t]},autotypenumbersDflt:t.autotypenumbers,paper_bgcolor:t.paper_bgcolor,calendar:t.calendar})}}}),wm=m({"src/plots/gl3d/index.js"(e){var t=De().overrideAll,r=U(),n=gm(),i=Tt().getSubplotData,a=ct(),o=Mt(),s="gl3d",l="scene";e.name=s,e.attr=l,e.idRoot=l,e.idRegex=e.attrRegex=a.counterRegex("scene"),e.attributes=ym(),e.layoutAttributes=xm(),e.baseLayoutAttrOverrides=t({hoverlabel:r.hoverlabel},"plot","nested"),e.supplyLayoutDefaults=bm(),e.plot=function(e){for(var t=e._fullLayout,r=e._fullData,a=t._subplots[s],o=0;o<a.length;o++){var l=a[o],c=i(r,s,l),u=t[l],h=u.camera,f=u._scene;f||(f=new n({id:l,graphDiv:e,container:e.querySelector(".gl-container"),staticPlot:e._context.staticPlot,plotGlPixelRatio:e._context.plotGlPixelRatio,camera:h},t),u._scene=f),f.viewInitial||(f.viewInitial={up:{x:h.up.x,y:h.up.y,z:h.up.z},eye:{x:h.eye.x,y:h.eye.y,z:h.eye.z},center:{x:h.center.x,y:h.center.y,z:h.center.z}}),f.plot(c,t,e.layout)}},e.clean=function(e,t,r,n){for(var i=n._subplots[s]||[],a=0;a<i.length;a++){var o=i[a];!t[o]&&n[o]._scene&&(n[o]._scene.destroy(),n._infolayer&&n._infolayer.selectAll(".annotation-"+o).remove())}},e.toSVG=function(e){for(var t=e._fullLayout,r=t._subplots[s],n=t._size,i=0;i<r.length;i++){var a=t[r[i]],l=a.domain,c=a._scene,u=c.toImage("png");t._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":u,x:n.l+n.w*l.x[0],y:n.t+n.h*(1-l.y[1]),width:n.w*(l.x[1]-l.x[0]),height:n.h*(l.y[1]-l.y[0]),preserveAspectRatio:"none"}),c.destroy()}},e.cleanId=function(e){if(e.match(/^scene[0-9]*$/)){var t=e.slice(5);return"1"===t&&(t=""),l+t}},e.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots[s],n=0;n<r.length;n++)t[r[n]]._scene.updateFx(t.dragmode,t.hovermode)}}}),Tm=m({"src/traces/scatter3d/index.js"(e,t){t.exports={plot:om(),attributes:sm(),markerSymbols:im(),supplyDefaults:lm(),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:cm(),moduleType:"trace",name:"scatter3d",basePlotModule:wm(),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}}}),km=m({"lib/scatter3d.js"(e,t){t.exports=Tm()}}),Am=m({"src/traces/surface/attributes.js"(e,t){var r=W(),n=zt(),i=It().axisHoverFormat,{hovertemplateAttrs:a,templatefallbackAttrs:o}=Fe(),s=q(),l=B().extendFlat,c=De().overrideAll;function u(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:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:r.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:r.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var h=t.exports=c(l({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"}},n("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},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:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");h.x.editType=h.y.editType=h.z.editType="calc+clearAxisTypes"}}),Mm=m({"src/traces/surface/defaults.js"(e,t){var r=He(),n=ct(),i=Ht(),a=Am();function o(e,t,r,n){var i=n("opacityscale");"max"===i?t.opacityscale=[[0,.1],[1,1]]:"min"===i?t.opacityscale=[[0,1],[1,.1]]:"extremes"===i?t.opacityscale=function(){for(var e=[],t=0;t<32;t++){var r=t/31,n=.1+.9*(1-Math.pow(Math.sin(1*r*Math.PI),2));e.push([r,Math.max(0,Math.min(1,n))])}return e}():function(e){var t=0;if(!Array.isArray(e)||e.length<2||!e[0]||!e[e.length-1]||0!=+e[0][0]||1!=+e[e.length-1][0])return!1;for(var r=0;r<e.length;r++){var n=e[r];if(2!==n.length||+n[0]<t)return!1;t=+n[0]}return!0}(i)||(t.opacityscale=void 0)}t.exports={supplyDefaults:function(e,t,s,l){var c,u;function h(r,i){return n.coerce(e,t,a,r,i)}var f=h("x"),p=h("y"),d=h("z");if(!d||!d.length||f&&f.length<1||p&&p.length<1)t.visible=!1;else{t._xlength=Array.isArray(f)&&n.isArrayOrTypedArray(f[0])?d.length:d[0].length,t._ylength=d.length,r.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],l),h("text"),h("hovertext"),h("hovertemplate"),h("hovertemplatefallback"),h("xhoverformat"),h("yhoverformat"),h("zhoverformat"),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","connectgaps","opacity"].forEach((function(e){h(e)})),h("surfacecolor");var m=["x","y","z"];for(c=0;c<3;++c){var g="contours."+m[c],y=h(g+".show"),v=h(g+".highlight");if(y||v)for(u=0;u<3;++u)h(g+".project."+m[u]);y&&(h(g+".color"),h(g+".width"),h(g+".usecolormap")),v&&(h(g+".highlightcolor"),h(g+".highlightwidth")),h(g+".start"),h(g+".end"),h(g+".size")}i(e,t,l,h,{prefix:"",cLetter:"c"}),o(0,t,0,h),t._length=null}},opacityscaleDefaults:o}}}),Sm=m({"src/traces/surface/calc.js"(e,t){var r=Zt();t.exports=function(e,t){t.surfacecolor?r(e,t,{vals:t.surfacecolor,containerStr:"",cLetter:"c"}):r(e,t,{vals:t.z,containerStr:"",cLetter:"c"})}}}),Em=m({"src/traces/surface/convert.js"(e,t){var r=Yd().gl_surface3d,n=Yd().ndarray,i=Yd().ndarray_linear_interpolate.d2,a=Oo(),o=Ro(),s=ct().isArrayOrTypedArray,l=rm().parseColorScale,c=tm(),u=Yt().extractOpts;function h(e,t,r){this.scene=e,this.uid=r,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=h.prototype;f.getXat=function(e,t,r,n){var i=s(this.data.x)?s(this.data.x[0])?this.data.x[t][e]:this.data.x[e]:e;return void 0===r?i:n.d2l(i,0,r)},f.getYat=function(e,t,r,n){var i=s(this.data.y)?s(this.data.y[0])?this.data.y[t][e]:this.data.y[t]:t;return void 0===r?i:n.d2l(i,0,r)},f.getZat=function(e,t,r,n){var i=this.data.z[t][e];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[t][e]),void 0===r?i:n.d2l(i,0,r)},f.handlePick=function(e){if(e.object===this.surface){var t=(e.data.index[0]-1)/this.dataScaleX-1,r=(e.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(t),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);e.index=[n,i],e.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],e.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++)null!=e.dataCoordinate[a]&&(e.dataCoordinate[a]*=this.scene.dataScale[a]);var o=this.data.hovertext||this.data.text;return s(o)&&o[i]&&void 0!==o[i][n]?e.textLabel=o[i][n]:e.textLabel=o||"",e.data.dataCoordinate=e.dataCoordinate.slice(),this.surface.highlight(e.data),this.scene.glplot.spikes.position=e.dataCoordinate,!0}};var p=[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 d(e,t){if(e<t)return 0;for(var r=0;0===Math.floor(e%t);)e/=t,r++;return r}function m(e){for(var t=[],r=0;r<p.length;r++){var n=p[r];t.push(d(e,n))}return t}function g(e){for(var t=m(e),r=e,n=0;n<p.length;n++)if(t[n]>0){r=p[n];break}return r}function y(e,t){if(!(e<1||t<1)){for(var r=m(e),n=m(t),i=1,a=0;a<p.length;a++)i*=Math.pow(p[a],Math.max(r[a],n[a]));return i}}f.calcXnums=function(e){var t,r=[];for(t=1;t<e;t++){var n=this.getXat(t-1,0),i=this.getXat(t,0);r[t-1]=i!==n&&null!=n&&null!=i?Math.abs(i-n):0}var a=0;for(t=1;t<e;t++)a+=r[t-1];for(t=1;t<e;t++)0===r[t-1]?r[t-1]=1:r[t-1]=Math.round(a/r[t-1]);return r},f.calcYnums=function(e){var t,r=[];for(t=1;t<e;t++){var n=this.getYat(0,t-1),i=this.getYat(0,t);r[t-1]=i!==n&&null!=n&&null!=i?Math.abs(i-n):0}var a=0;for(t=1;t<e;t++)a+=r[t-1];for(t=1;t<e;t++)0===r[t-1]?r[t-1]=1:r[t-1]=Math.round(a/r[t-1]);return r};var v=[1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,1260],x=v[9],_=v[13];function b(e,t,r){var n=r[8]+r[2]*t[0]+r[5]*t[1];return e[0]=(r[6]+r[0]*t[0]+r[3]*t[1])/n,e[1]=(r[7]+r[1]*t[0]+r[4]*t[1])/n,e}function w(e,t,r){return function(e,t,r,n){for(var a=[0,0],o=e.shape[0],s=e.shape[1],l=0;l<o;l++)for(var c=0;c<s;c++)r(a,[l,c],n),e.set(l,c,i(t,a[0],a[1]))}(e,t,b,r),e}function T(e,t){for(var r=!1,n=0;n<e.length;n++)if(t===e[n]){r=!0;break}!1===r&&e.push(t)}f.estimateScale=function(e,t){for(var r=1+function(e){if(0!==e.length){for(var t=1,r=0;r<e.length;r++)t=y(t,e[r]);return t}}(0===t?this.calcXnums(e):this.calcYnums(e));r<x;)r*=2;for(;r>_;)r--,r/=g(r),++r<x&&(r=_);var n=Math.round(r/e);return n>1?n:1},f.refineCoords=function(e){for(var t=this.dataScaleX,r=this.dataScaleY,i=e[0].shape[0],a=e[0].shape[1],o=0|Math.floor(e[0].shape[0]*t+1),s=0|Math.floor(e[0].shape[1]*r+1),l=1+i+1,c=1+a+1,u=n(new Float32Array(l*c),[l,c]),h=[1/t,0,0,0,1/r,0,0,0,1],f=0;f<e.length;++f){this.surface.padField(u,e[f]);var p=n(new Float32Array(o*s),[o,s]);w(p,u,h),e[f]=p}},f.setContourLevels=function(){var e,t,r,n=[[],[],[]],i=[!1,!1,!1],a=!1;for(e=0;e<3;++e)if(this.showContour[e]&&(a=!0,this.contourSize[e]>0&&null!==this.contourStart[e]&&null!==this.contourEnd[e]&&this.contourEnd[e]>this.contourStart[e]))for(i[e]=!0,t=this.contourStart[e];t<this.contourEnd[e];t+=this.contourSize[e])r=t*this.scene.dataScale[e],T(n[e],r);if(a){var o=[[],[],[]];for(e=0;e<3;++e)this.showContour[e]&&(o[e]=i[e]?n[e]:this.scene.contourLevels[e]);this.surface.update({levels:o})}},f.update=function(e){var t=this.scene,r=t.fullSceneLayout,i=this.surface,s=l(e),h=t.dataScale,f=e.z[0].length,p=e._ylength,d=t.contourLevels;this.data=e;var m,g,y,v,x=[];for(m=0;m<3;m++)for(x[m]=[],g=0;g<f;g++)x[m][g]=[];for(g=0;g<f;g++)for(y=0;y<p;y++)x[0][g][y]=this.getXat(g,y,e.xcalendar,r.xaxis),x[1][g][y]=this.getYat(g,y,e.ycalendar,r.yaxis),x[2][g][y]=this.getZat(g,y,e.zcalendar,r.zaxis);if(e.connectgaps)for(e._emptypoints=o(x[2]),a(x[2],e._emptypoints),e._interpolatedZ=[],g=0;g<f;g++)for(e._interpolatedZ[g]=[],y=0;y<p;y++)e._interpolatedZ[g][y]=x[2][g][y];for(m=0;m<3;m++)for(g=0;g<f;g++)for(y=0;y<p;y++)null==(v=x[m][g][y])?x[m][g][y]=NaN:v=x[m][g][y]*=h[m];for(m=0;m<3;m++)for(g=0;g<f;g++)for(y=0;y<p;y++)null!=(v=x[m][g][y])&&(this.minValues[m]>v&&(this.minValues[m]=v),this.maxValues[m]<v&&(this.maxValues[m]=v));for(m=0;m<3;m++)this.objectOffset[m]=.5*(this.minValues[m]+this.maxValues[m]);for(m=0;m<3;m++)for(g=0;g<f;g++)for(y=0;y<p;y++)null!=(v=x[m][g][y])&&(x[m][g][y]-=this.objectOffset[m]);var b=[n(new Float32Array(f*p),[f,p]),n(new Float32Array(f*p),[f,p]),n(new Float32Array(f*p),[f,p])];for(m=0;m<3;m++)for(g=0;g<f;g++)for(y=0;y<p;y++)b[m].set(g,y,x[m][g][y]);x=[];var w={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},T=u(e);if(w.intensityBounds=[T.min,T.max],e.surfacecolor){var k=n(new Float32Array(f*p),[f,p]);for(g=0;g<f;g++)for(y=0;y<p;y++)k.set(g,y,e.surfacecolor[y][g]);b.push(k)}else w.intensityBounds[0]*=h[2],w.intensityBounds[1]*=h[2];(_<b[0].shape[0]||_<b[0].shape[1])&&(this.refineData=!1),!0===this.refineData&&(this.dataScaleX=this.estimateScale(b[0].shape[0],0),this.dataScaleY=this.estimateScale(b[0].shape[1],1),(1!==this.dataScaleX||1!==this.dataScaleY)&&this.refineCoords(b)),e.surfacecolor&&(w.intensity=b.pop());var A=[!0,!0,!0],M=["x","y","z"];for(m=0;m<3;++m){var S=e.contours[M[m]];A[m]=S.highlight,w.showContour[m]=S.show||S.highlight,w.showContour[m]&&(w.contourProject[m]=[S.project.x,S.project.y,S.project.z],S.show?(this.showContour[m]=!0,w.levels[m]=d[m],i.highlightColor[m]=w.contourColor[m]=c(S.color),S.usecolormap?i.highlightTint[m]=w.contourTint[m]=0:i.highlightTint[m]=w.contourTint[m]=1,w.contourWidth[m]=S.width,this.contourStart[m]=S.start,this.contourEnd[m]=S.end,this.contourSize[m]=S.size):(this.showContour[m]=!1,this.contourStart[m]=null,this.contourEnd[m]=null,this.contourSize[m]=0),S.highlight&&(w.dynamicColor[m]=c(S.highlightcolor),w.dynamicWidth[m]=S.highlightwidth))}(function(e){var t=e[0].rgb,r=e[e.length-1].rgb;return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]&&t[3]===r[3]})(s)&&(w.vertexColor=!0),w.objectOffset=this.objectOffset,w.coords=b,i.update(w),i.visible=e.visible,i.enableDynamic=A,i.enableHighlight=A,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()},t.exports=function(e,t){var n=e.glplot.gl,i=r({gl:n}),a=new h(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}}),Cm=m({"src/traces/surface/index.js"(e,t){t.exports={attributes:Am(),supplyDefaults:Mm().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:Sm(),plot:Em(),moduleType:"trace",name:"surface",basePlotModule:wm(),categories:["gl3d","2dMap","showLegend"],meta:{}}}}),Im=m({"lib/surface.js"(e,t){t.exports=Cm()}}),Lm=m({"src/traces/mesh3d/attributes.js"(e,t){var r=zt(),n=It().axisHoverFormat,{hovertemplateAttrs:i,templatefallbackAttrs:a}=Fe(),o=Am(),s=q(),l=B().extendFlat;t.exports=l({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:n("x"),yhoverformat:n("y"),zhoverformat:n("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"}},r("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({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:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})}}),Pm=m({"src/traces/isosurface/attributes.js"(e,t){var r=zt(),n=It().axisHoverFormat,{hovertemplateAttrs:i,templatefallbackAttrs:a}=Fe(),o=Lm(),s=q(),l=B().extendFlat,c=De().overrideAll,u=t.exports=c(l({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:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:i(),hovertemplatefallback:a(),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),valuehoverformat:n("value",1),showlegend:l({},s.showlegend,{dflt:!1})},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes"}}),zm=m({"src/traces/isosurface/defaults.js"(e,t){var r=ct(),n=He(),i=Pm(),a=Ht();function o(e,t,r,i,o){var s=o("isomin"),l=o("isomax");null!=l&&null!=s&&s>l&&(t.isomin=null,t.isomax=null);var c=o("x"),u=o("y"),h=o("z"),f=o("value");c&&c.length&&u&&u.length&&h&&h.length&&f&&f.length?(n.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 r="slices."+e;o(r+".show")&&(o(r+".fill"),o(r+".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.visible=!1}t.exports={supplyDefaults:function(e,t,n,a){o(e,t,0,a,(function(n,a){return r.coerce(e,t,i,n,a)}))},supplyIsoDefaults:o}}}),Dm=m({"src/traces/streamtube/calc.js"(e,t){var r=ct(),n=Zt();function i(e){var t,n,i,o,s,l,c,u,h,f,p,d,m=e._x,g=e._y,y=e._z,v=e._len,x=-1/0,_=1/0,b=-1/0,w=1/0,T=-1/0,k=1/0,A="";for(v&&(c=m[0],h=g[0],p=y[0]),v>1&&(u=m[v-1],f=g[v-1],d=y[v-1]),t=0;t<v;t++)x=Math.max(x,m[t]),_=Math.min(_,m[t]),b=Math.max(b,g[t]),w=Math.min(w,g[t]),T=Math.max(T,y[t]),k=Math.min(k,y[t]),!o&&m[t]!==c&&(o=!0,A+="x"),!s&&g[t]!==h&&(s=!0,A+="y"),!l&&y[t]!==p&&(l=!0,A+="z");o||(A+="x"),s||(A+="y"),l||(A+="z");var M=a(e._x),S=a(e._y),E=a(e._z);A=(A=(A=A.replace("x",(c>u?"-":"+")+"x")).replace("y",(h>f?"-":"+")+"y")).replace("z",(p>d?"-":"+")+"z");var C=function(){v=0,M=[],S=[],E=[]};(!v||v<M.length*S.length*E.length)&&C();var I=function(e){return"x"===e?m:"y"===e?g:y},L=function(e){return"x"===e?M:"y"===e?S:E},P=function(e){return e[v-1]<e[0]?-1:1},z=I(A[1]),D=I(A[3]),O=I(A[5]),R=L(A[1]).length,F=L(A[3]).length,B=L(A[5]).length,j=!1,N=function(e,t,r){return R*(F*e+t)+r},U=P(I(A[1])),V=P(I(A[3])),q=P(I(A[5]));for(t=0;t<B-1;t++){for(n=0;n<F-1;n++){for(i=0;i<R-1;i++){var H=N(t,n,i),G=N(t,n,i+1),W=N(t,n+1,i),Z=N(t+1,n,i);if(z[H]*U<z[G]*U&&D[H]*V<D[W]*V&&O[H]*q<O[Z]*q||(j=!0),j)break}if(j)break}if(j)break}return j&&(r.warn("Encountered arbitrary coordinates! Unable to input data grid."),C()),{xMin:_,yMin:w,zMin:k,xMax:x,yMax:b,zMax:T,Xs:M,Ys:S,Zs:E,len:v,fill:A}}function a(e){return r.distinctVals(e).vals}function o(e,t){if(void 0===t&&(t=e.length),r.isTypedArray(e))return e.subarray(0,t);for(var n=[],i=0;i<t;i++)n[i]=+e[i];return n}t.exports={calc:function(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=o(t.u,t._len),t._v=o(t.v,t._len),t._w=o(t.w,t._len),t._x=o(t.x,t._len),t._y=o(t.y,t._len),t._z=o(t.z,t._len);var r=i(t);t._gridFill=r.fill,t._Xs=r.Xs,t._Ys=r.Ys,t._Zs=r.Zs,t._len=r.len;var a,s,l,c=0;t.starts&&(a=o(t.starts.x||[]),s=o(t.starts.y||[]),l=o(t.starts.z||[]),c=Math.min(a.length,s.length,l.length)),t._startsX=a||[],t._startsY=s||[],t._startsZ=l||[];var u,h=0,f=1/0;for(u=0;u<t._len;u++){var p=t._u[u],d=t._v[u],m=t._w[u],g=Math.sqrt(p*p+d*d+m*m);h=Math.max(h,g),f=Math.min(f,g)}for(n(e,t,{vals:[f,h],containerStr:"",cLetter:"c"}),u=0;u<c;u++){var y=a[u];r.xMax=Math.max(r.xMax,y),r.xMin=Math.min(r.xMin,y);var v=s[u];r.yMax=Math.max(r.yMax,v),r.yMin=Math.min(r.yMin,v);var x=l[u];r.zMax=Math.max(r.zMax,x),r.zMin=Math.min(r.zMin,x)}t._slen=c,t._normMax=h,t._xbnds=[r.xMin,r.xMax],t._ybnds=[r.yMin,r.yMax],t._zbnds=[r.zMin,r.zMax]},filter:o,processGrid:i}}}),Om=m({"src/traces/isosurface/calc.js"(e,t){var r=Zt(),n=Dm().processGrid,i=Dm().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=n(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,l=0;l<t._len;l++){var c=t._value[l];o=Math.min(o,c),s=Math.max(s,c)}t._minValues=o,t._maxValues=s,t._vMin=void 0===t.isomin||null===t.isomin?o:t.isomin,t._vMax=void 0===t.isomax||null===t.isomax?s:t.isomax,r(e,t,{vals:[t._vMin,t._vMax],containerStr:"",cLetter:"c"})}}}),Rm=m({"src/plots/gl3d/zip3.js"(e,t){t.exports=function(e,t,r,n){n=n||e.length;for(var i=new Array(n),a=0;a<n;a++)i[a]=[e[a],t[a],r[a]];return i}}}),Fm=m({"src/traces/isosurface/convert.js"(e,t){var r=Yd().gl_mesh3d,n=rm().parseColorScale,i=ct().isArrayOrTypedArray,a=tm(),o=Yt().extractOpts,s=Rm(),l=function(e,t){for(var r=t.length-1;r>0;r--){var n=Math.min(t[r],t[r-1]),i=Math.max(t[r],t[r-1]);if(i>n&&n<e&&e<=i)return{id:r,distRatio:(i-e)/(i-n)}}return{id:0,distRatio:0}};function c(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.data=null,this.showContour=!1}var u=c.prototype;u.handlePick=function(e){if(e.object===this.mesh){var t=e.data.index,r=this.data._meshX[t],n=this.data._meshY[t],a=this.data._meshZ[t],o=this.data._Ys.length,s=this.data._Zs.length,c=l(r,this.data._Xs).id,u=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,f=e.index=h+s*u+s*o*c;e.traceCoordinate=[this.data._meshX[f],this.data._meshY[f],this.data._meshZ[f],this.data._value[f]];var p=this.data.hovertext||this.data.text;return i(p)&&void 0!==p[f]?e.textLabel=p[f]:p&&(e.textLabel=p),!0}},u.update=function(e){var t=this.scene,r=t.fullSceneLayout;function i(e,t,r,n){return t.map((function(t){return e.d2l(t,0,n)*r}))}this.data=f(e);var l={positions:s(i(r.xaxis,e._meshX,t.dataScale[0],e.xcalendar),i(r.yaxis,e._meshY,t.dataScale[1],e.ycalendar),i(r.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},c=o(e);l.vertexIntensity=e._meshIntensity,l.vertexIntensityBounds=[c.min,c.max],l.colormap=n(e),this.mesh.update(l)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};var h=["xyz","xzy","yxz","yzx","zxy","zyx"];function f(e){e._meshI=[],e._meshJ=[],e._meshK=[];var t,r,n,i,a,o,s,c=e.surface.show,u=e.spaceframe.show,f=e.surface.fill,p=e.spaceframe.fill,d=!1,m=!1,g=0,y=e._Xs,v=e._Ys,x=e._Zs,_=y.length,b=v.length,w=x.length,T=h.indexOf(e._gridFill.replace(/-/g,"").replace(/\+/g,"")),k=function(e,t,r){switch(T){case 5:return r+w*t+w*b*e;case 4:return r+w*e+w*_*t;case 3:return t+b*r+b*w*e;case 2:return t+b*e+b*_*r;case 1:return e+_*r+_*w*t;default:return e+_*t+_*b*r}},A=e._minValues,M=e._maxValues,S=e._vMin,E=e._vMax;function C(e,t,s){for(var l=o.length,c=r;c<l;c++)if(e===n[c]&&t===i[c]&&s===a[c])return c;return-1}function I(){r=t}function L(){n=[],i=[],a=[],o=[],t=0,I()}function P(e,r,s,l){return n.push(e),i.push(r),a.push(s),o.push(l),++t-1}function z(t,r,n){return e._meshI.push(t),e._meshJ.push(r),e._meshK.push(n),++g-1}function D(e,t,r){for(var n=[],i=0;i<e.length;i++)n[i]=e[i]*(1-r)+r*t[i];return n}function O(e){s=e}function R(e,t){return"all"===e||null===e||e.indexOf(t)>-1}function F(e,t){return null===e?t:e}function B(e,t,r){I();var n=[t],i=[r];if(s>=1)n=[t],i=[r];else if(s>0){var a=function(e,t){var r=e[0],n=e[1],i=e[2],a=function(e,t,r){for(var n=[],i=0;i<e.length;i++)n[i]=(e[i]+t[i]+r[i])/3;return n}(r,n,i),o=Math.sqrt(1-s),l=D(a,r,o),c=D(a,n,o),u=D(a,i,o),h=t[0],f=t[1],p=t[2];return{xyzv:[[r,n,c],[c,l,r],[n,i,u],[u,c,n],[i,r,l],[l,u,i]],abc:[[h,f,-1],[-1,-1,h],[f,p,-1],[-1,-1,f],[p,h,-1],[-1,-1,p]]}}(t,r);n=a.xyzv,i=a.abc}for(var o=0;o<n.length;o++){t=n[o],r=i[o];for(var l=[],c=0;c<3;c++){var u=t[c][0],h=t[c][1],f=t[c][2],p=t[c][3],d=r[c]>-1?r[c]:C(u,h,f);l[c]=d>-1?d:P(u,h,f,F(e,p))}z(l[0],l[1],l[2])}}function j(e,t,r,n){var i=e[3];i<r&&(i=r),i>n&&(i=n);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 N(e,t,r){return e>=t&&e<=r}function U(e){var t=.001*(E-S);return e>=S-t&&e<=E+t}function V(t){for(var r=[],n=0;n<4;n++){var i=t[n];r.push([e._x[i],e._y[i],e._z[i],e._value[i]])}return r}function q(e,t,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[N(t[0][3],n,i),N(t[1][3],n,i),N(t[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(e,t,r){return U(t[0][3])&&U(t[1][3])&&U(t[2][3])?(B(e,t,r),!0):a<3&&q(e,t,r,S,E,++a)};if(s[0]&&s[1]&&s[2])return l(e,t,r)||o;var c=!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]],h=t[a[1]],f=t[a[2]],p=j(f,u,n,i),d=j(f,h,n,i);o=l(e,[d,p,u],[-1,-1,r[a[0]]])||o,o=l(e,[u,h,d],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[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]],h=t[a[1]],f=t[a[2]],p=j(h,u,n,i),d=j(f,u,n,i);o=l(e,[d,p,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function H(e,t,r,n){var i=!1,a=V(t),o=[N(a[0][3],r,n),N(a[1][3],r,n),N(a[2][3],r,n),N(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(e,t,r){var n=function(n,i,a){B(e,[t[n],t[i],t[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(e,a,t)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]];if(m)i=B(e,[c,u,h],[t[l[0]],t[l[1]],t[l[2]]])||i;else{var p=j(f,c,r,n),d=j(f,u,r,n),g=j(f,h,r,n);i=B(null,[p,d,g],[-1,-1,-1])||i}s=!0}})),s||([[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(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]],p=j(h,c,r,n),d=j(h,u,r,n),g=j(f,u,r,n),y=j(f,c,r,n);m?(i=B(e,[c,y,p],[t[l[0]],-1,-1])||i,i=B(e,[u,d,g],[t[l[1]],-1,-1])||i):i=function(e,t,r){var n=function(e,n,i){B(null,[t[e],t[n],t[i]],[r[e],r[n],r[i]])};n(0,1,2),n(2,3,0)}(0,[p,d,g,y],[-1,-1,-1,-1])||i,s=!0}})),s)||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]],p=j(u,c,r,n),d=j(h,c,r,n),g=j(f,c,r,n);m?(i=B(e,[c,p,d],[t[l[0]],-1,-1])||i,i=B(e,[c,d,g],[t[l[0]],-1,-1])||i,i=B(e,[c,g,p],[t[l[0]],-1,-1])||i):i=B(null,[p,d,g],[-1,-1,-1])||i,s=!0}})),i}function G(e,t,r,n,i,a,o,s,l,c,u){var h=!1;return d&&(R(e,"A")&&(h=H(null,[t,r,n,a],c,u)||h),R(e,"B")&&(h=H(null,[r,n,i,l],c,u)||h),R(e,"C")&&(h=H(null,[r,a,o,l],c,u)||h),R(e,"D")&&(h=H(null,[n,a,s,l],c,u)||h),R(e,"E")&&(h=H(null,[r,n,a,l],c,u)||h)),m&&(h=H(e,[r,n,a,l],c,u)||h),h}function W(e,t,r,n,i,a,o,s){return[!0===s[0]||q(e,V([t,r,n]),[t,r,n],a,o),!0===s[1]||q(e,V([n,i,t]),[n,i,t],a,o)]}function Z(e,t,r,n,i,a,o,s,l){return s?W(e,t,r,i,n,a,o,l):W(e,r,i,n,t,a,o,l)}function Y(e,t,r,n,i,a,o){var s,l,c,u,h=!1,f=function(){h=q(e,[s,l,c],[-1,-1,-1],i,a)||h,h=q(e,[c,u,s],[-1,-1,-1],i,a)||h},p=o[0],d=o[1],m=o[2];return p&&(s=D(V([k(t,r-0,n-0)])[0],V([k(t-1,r-0,n-0)])[0],p),l=D(V([k(t,r-0,n-1)])[0],V([k(t-1,r-0,n-1)])[0],p),c=D(V([k(t,r-1,n-1)])[0],V([k(t-1,r-1,n-1)])[0],p),u=D(V([k(t,r-1,n-0)])[0],V([k(t-1,r-1,n-0)])[0],p),f()),d&&(s=D(V([k(t-0,r,n-0)])[0],V([k(t-0,r-1,n-0)])[0],d),l=D(V([k(t-0,r,n-1)])[0],V([k(t-0,r-1,n-1)])[0],d),c=D(V([k(t-1,r,n-1)])[0],V([k(t-1,r-1,n-1)])[0],d),u=D(V([k(t-1,r,n-0)])[0],V([k(t-1,r-1,n-0)])[0],d),f()),m&&(s=D(V([k(t-0,r-0,n)])[0],V([k(t-0,r-0,n-1)])[0],m),l=D(V([k(t-0,r-1,n)])[0],V([k(t-0,r-1,n-1)])[0],m),c=D(V([k(t-1,r-1,n)])[0],V([k(t-1,r-1,n-1)])[0],m),u=D(V([k(t-1,r-0,n)])[0],V([k(t-1,r-0,n-1)])[0],m),f()),h}function X(e,t,r,n,i,a,o,s,l,c,u,h){var f=e;return h?(d&&"even"===e&&(f=null),G(f,t,r,n,i,a,o,s,l,c,u)):(d&&"odd"===e&&(f=null),G(f,l,s,o,a,i,n,r,t,c,u))}function $(e,t,r,n,i){for(var a=[],o=0,s=0;s<t.length;s++)for(var l=t[s],c=1;c<w;c++)for(var u=1;u<b;u++)a.push(Z(e,k(l,u-1,c-1),k(l,u-1,c),k(l,u,c-1),k(l,u,c),r,n,(l+u+c)%2,i&&i[o]?i[o]:[])),o++;return a}function K(e,t,r,n,i){for(var a=[],o=0,s=0;s<t.length;s++)for(var l=t[s],c=1;c<_;c++)for(var u=1;u<w;u++)a.push(Z(e,k(c-1,l,u-1),k(c,l,u-1),k(c-1,l,u),k(c,l,u),r,n,(c+l+u)%2,i&&i[o]?i[o]:[])),o++;return a}function J(e,t,r,n,i){for(var a=[],o=0,s=0;s<t.length;s++)for(var l=t[s],c=1;c<b;c++)for(var u=1;u<_;u++)a.push(Z(e,k(u-1,c-1,l),k(u-1,c,l),k(u,c-1,l),k(u,c,l),r,n,(u+c+l)%2,i&&i[o]?i[o]:[])),o++;return a}function Q(e,t,r){for(var n=1;n<w;n++)for(var i=1;i<b;i++)for(var a=1;a<_;a++)X(e,k(a-1,i-1,n-1),k(a-1,i-1,n),k(a-1,i,n-1),k(a-1,i,n),k(a,i-1,n-1),k(a,i-1,n),k(a,i,n-1),k(a,i,n),t,r,(a+i+n)%2)}function ee(e,t,r){d=!0,Q(e,t,r),d=!1}function te(e,t,r,n,i,a){for(var o=[],s=0,l=0;l<t.length;l++)for(var c=t[l],u=1;u<w;u++)for(var h=1;h<b;h++)o.push(Y(e,c,h,u,r,n,i[l],a&&a[s]&&a[s])),s++;return o}function re(e,t,r,n,i,a){for(var o=[],s=0,l=0;l<t.length;l++)for(var c=t[l],u=1;u<_;u++)for(var h=1;h<w;h++)o.push(Y(e,u,c,h,r,n,i[l],a&&a[s]&&a[s])),s++;return o}function ne(e,t,r,n,i,a){for(var o=[],s=0,l=0;l<t.length;l++)for(var c=t[l],u=1;u<b;u++)for(var h=1;h<_;h++)o.push(Y(e,h,u,c,r,n,i[l],a&&a[s]&&a[s])),s++;return o}function ie(e,t){for(var r=[],n=e;n<t;n++)r.push(n);return r}return function(){L(),function(){for(var t=0;t<_;t++)for(var r=0;r<b;r++)for(var n=0;n<w;n++){var i=k(t,r,n);P(e._x[i],e._y[i],e._z[i],e._value[i])}}();var t=null;if(u&&p&&(O(p),function(e,t,r){m=!0,Q(null,t,r),m=!1}(0,S,E)),c&&f){O(f);for(var r=e.surface.pattern,s=e.surface.count,h=0;h<s;h++){var d=1===s?.5:h/(s-1),T=(1-d)*S+d*E,C=Math.abs(T-A)>Math.abs(T-M)?[A,T]:[T,M];ee(r,C[0],C[1])}}var I=[[Math.min(S,M),Math.max(S,M)],[Math.min(A,E),Math.max(A,E)]];["x","y","z"].forEach((function(r){for(var n=[],i=0;i<I.length;i++){var a=0,o=I[i][0],s=I[i][1],c=e.slices[r];if(c.show&&c.fill){O(c.fill);var u=[],h=[],f=[];if(c.locations.length)for(var p=0;p<c.locations.length;p++){var d=l(c.locations[p],"x"===r?y:"y"===r?v:x);0===d.distRatio?u.push(d.id):d.id>0&&(h.push(d.id),"x"===r?f.push([d.distRatio,0,0]):"y"===r?f.push([0,d.distRatio,0]):f.push([0,0,d.distRatio]))}else u=ie(1,"x"===r?_-1:"y"===r?b-1:w-1);h.length>0&&(n[a]="x"===r?te(t,h,o,s,f,n[a]):"y"===r?re(t,h,o,s,f,n[a]):ne(t,h,o,s,f,n[a]),a++),u.length>0&&(n[a]="x"===r?$(t,u,o,s,n[a]):"y"===r?K(t,u,o,s,n[a]):J(t,u,o,s,n[a]),a++)}var m=e.caps[r];m.show&&m.fill&&(O(m.fill),n[a]="x"===r?$(t,[0,_-1],o,s,n[a]):"y"===r?K(t,[0,b-1],o,s,n[a]):J(t,[0,w-1],o,s,n[a]),a++)}})),0===g&&L(),e._meshX=n,e._meshY=i,e._meshZ=a,e._meshIntensity=o,e._Xs=y,e._Ys=v,e._Zs=x}(),e}t.exports={findNearestOnAxis:l,generateIsoMeshes:f,createIsosurfaceTrace:function(e,t){var n=e.glplot.gl,i=r({gl:n}),a=new c(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}}}),Bm=m({"src/traces/isosurface/index.js"(e,t){t.exports={attributes:Pm(),supplyDefaults:zm().supplyDefaults,calc:Om(),colorbar:{min:"cmin",max:"cmax"},plot:Fm().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:wm(),categories:["gl3d","showLegend"],meta:{}}}}),jm=m({"lib/isosurface.js"(e,t){t.exports=Bm()}}),Nm=m({"src/traces/volume/attributes.js"(e,t){var r=zt(),n=Pm(),i=Am(),a=q(),o=B().extendFlat,s=De().overrideAll,l=t.exports=s(o({x:n.x,y:n.y,z:n.z,value:n.value,isomin:n.isomin,isomax:n.isomax,surface:n.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:n.slices,caps:n.caps,text:n.text,hovertext:n.hovertext,xhoverformat:n.xhoverformat,yhoverformat:n.yhoverformat,zhoverformat:n.zhoverformat,valuehoverformat:n.valuehoverformat,hovertemplate:n.hovertemplate,hovertemplatefallback:n.hovertemplatefallback},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:n.colorbar,opacity:n.opacity,opacityscale:i.opacityscale,lightposition:n.lightposition,lighting:n.lighting,flatshading:n.flatshading,contour:n.contour,hoverinfo:o({},a.hoverinfo),showlegend:o({},a.showlegend,{dflt:!1})}),"calc","nested");l.x.editType=l.y.editType=l.z.editType=l.value.editType="calc+clearAxisTypes"}}),Um=m({"src/traces/volume/defaults.js"(e,t){var r=ct(),n=Nm(),i=zm().supplyIsoDefaults,a=Mm().opacityscaleDefaults;t.exports=function(e,t,o,s){function l(i,a){return r.coerce(e,t,n,i,a)}i(e,t,o,s,l),a(e,t,s,l)}}}),Vm=m({"src/traces/volume/convert.js"(e,t){var r=Yd().gl_mesh3d,n=rm().parseColorScale,i=ct().isArrayOrTypedArray,a=tm(),o=Yt().extractOpts,s=Rm(),l=Fm().findNearestOnAxis,c=Fm().generateIsoMeshes;function u(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.data=null,this.showContour=!1}var h=u.prototype;h.handlePick=function(e){if(e.object===this.mesh){var t=e.data.index,r=this.data._meshX[t],n=this.data._meshY[t],a=this.data._meshZ[t],o=this.data._Ys.length,s=this.data._Zs.length,c=l(r,this.data._Xs).id,u=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,f=e.index=h+s*u+s*o*c;e.traceCoordinate=[this.data._meshX[f],this.data._meshY[f],this.data._meshZ[f],this.data._value[f]];var p=this.data.hovertext||this.data.text;return i(p)&&void 0!==p[f]?e.textLabel=p[f]:p&&(e.textLabel=p),!0}},h.update=function(e){var t=this.scene,r=t.fullSceneLayout;function i(e,t,r,n){return t.map((function(t){return e.d2l(t,0,n)*r}))}this.data=c(e);var l={positions:s(i(r.xaxis,e._meshX,t.dataScale[0],e.xcalendar),i(r.yaxis,e._meshY,t.dataScale[1],e.ycalendar),i(r.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);l.vertexIntensity=e._meshIntensity,l.vertexIntensityBounds=[u.min,u.max],l.colormap=n(e),this.mesh.update(l)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},t.exports=function(e,t){var n=e.glplot.gl,i=r({gl:n}),a=new u(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}}),qm=m({"src/traces/volume/index.js"(e,t){t.exports={attributes:Nm(),supplyDefaults:Um(),calc:Om(),colorbar:{min:"cmin",max:"cmax"},plot:Vm(),moduleType:"trace",name:"volume",basePlotModule:wm(),categories:["gl3d","showLegend"],meta:{}}}}),Hm=m({"lib/volume.js"(e,t){t.exports=qm()}}),Gm=m({"src/traces/mesh3d/defaults.js"(e,t){var r=He(),n=ct(),i=Ht(),a=Lm();t.exports=function(e,t,o,s){function l(r,i){return n.coerce(e,t,a,r,i)}function c(e){var t=e.map((function(e){var t=l(e);return t&&n.isArrayOrTypedArray(t)?t:null}));return t.every((function(e){return e&&e.length===t[0].length}))&&t}c(["x","y","z"])?(c(["i","j","k"]),(!t.i||t.j&&t.k)&&(!t.j||t.k&&t.i)&&(!t.k||t.i&&t.j)?(r.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){l(e)})),l("contour.show")&&(l("contour.color"),l("contour.width")),"intensity"in e?(l("intensity"),l("intensitymode"),i(e,t,s,l,{prefix:"",cLetter:"c"})):(t.showscale=!1,"facecolor"in e?l("facecolor"):"vertexcolor"in e?l("vertexcolor"):l("color",o)),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),t._length=null):t.visible=!1):t.visible=!1}}}),Wm=m({"src/traces/mesh3d/calc.js"(e,t){var r=Zt();t.exports=function(e,t){t.intensity&&r(e,t,{vals:t.intensity,containerStr:"",cLetter:"c"})}}}),Zm=m({"src/traces/mesh3d/convert.js"(e,t){var r=Yd().gl_mesh3d,n=Yd().delaunay_triangulate,i=Yd().alpha_shape,a=Yd().convex_hull,o=rm().parseColorScale,s=ct().isArrayOrTypedArray,l=tm(),c=Yt().extractOpts,u=Rm();function h(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var f=h.prototype;function p(e){for(var t=[],r=e.length,n=0;n<r;n++)t[n]=l(e[n]);return t}function d(e,t,r,n){for(var i=[],a=t.length,o=0;o<a;o++)i[o]=e.d2l(t[o],0,n)*r;return i}function m(e){for(var t=[],r=e.length,n=0;n<r;n++)t[n]=Math.round(e[n]);return t}function g(e,t){for(var r=e.length,n=0;n<r;n++)if(e[n]<=-.5||e[n]>=t-.5)return!1;return!0}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 r=this.data.hovertext||this.data.text;return s(r)&&void 0!==r[t]?e.textLabel=r[t]:r&&(e.textLabel=r),!0}},f.update=function(e){var t=this.scene,r=t.fullSceneLayout;this.data=e;var s,h=e.x.length,f=u(d(r.xaxis,e.x,t.dataScale[0],e.xcalendar),d(r.yaxis,e.y,t.dataScale[1],e.ycalendar),d(r.zaxis,e.z,t.dataScale[2],e.zcalendar));if(e.i&&e.j&&e.k){if(e.i.length!==e.j.length||e.j.length!==e.k.length||!g(e.i,h)||!g(e.j,h)||!g(e.k,h))return;s=u(m(e.i),m(e.j),m(e.k))}else s=0===e.alphahull?a(f):e.alphahull>0?i(e.alphahull,f):function(e,t){for(var r=["x","y","z"].indexOf(e),i=[],a=t.length,o=0;o<a;o++)i[o]=[t[o][(r+1)%3],t[o][(r+2)%3]];return n(i)}(e.delaunayaxis,f);var y={positions:f,cells:s,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:l(e.contour.color).slice(0,3),contourWidth:e.contour.width,useFacetNormals:e.flatshading};if(e.intensity){var v=c(e);this.color="#fff";var x=e.intensitymode;y[x+"Intensity"]=e.intensity,y[x+"IntensityBounds"]=[v.min,v.max],y.colormap=o(e)}else e.vertexcolor?(this.color=e.vertexcolor[0],y.vertexColors=p(e.vertexcolor)):e.facecolor?(this.color=e.facecolor[0],y.cellColors=p(e.facecolor)):(this.color=e.color,y.meshColor=l(e.color));this.mesh.update(y)},f.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},t.exports=function(e,t){var n=e.glplot.gl,i=r({gl:n}),a=new h(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}}),Ym=m({"src/traces/mesh3d/index.js"(e,t){t.exports={attributes:Lm(),supplyDefaults:Gm(),calc:Wm(),colorbar:{min:"cmin",max:"cmax"},plot:Zm(),moduleType:"trace",name:"mesh3d",basePlotModule:wm(),categories:["gl3d","showLegend"],meta:{}}}}),Xm=m({"lib/mesh3d.js"(e,t){t.exports=Ym()}}),$m=m({"src/traces/cone/attributes.js"(e,t){var r=zt(),n=It().axisHoverFormat,{hovertemplateAttrs:i,templatefallbackAttrs:a}=Fe(),o=Lm(),s=q(),l=B().extendFlat,c={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:n("u",1),vhoverformat:n("v",1),whoverformat:n("w",1),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,r("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(e){c[e]=o[e]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),t.exports=c}}),Km=m({"src/traces/cone/defaults.js"(e,t){var r=ct(),n=Ht(),i=$m();t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}var l=s("u"),c=s("v"),u=s("w"),h=s("x"),f=s("y"),p=s("z");if(l&&l.length&&c&&c.length&&u&&u.length&&h&&h.length&&f&&f.length&&p&&p.length){var d=s("sizemode");s("sizeref","raw"===d?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"),n(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}else t.visible=!1}}}),Jm=m({"src/traces/cone/calc.js"(e,t){var r=Zt();t.exports=function(e,t){for(var n=t.u,i=t.v,a=t.w,o=Math.min(t.x.length,t.y.length,t.z.length,n.length,i.length,a.length),s=-1/0,l=1/0,c=0;c<o;c++){var u=n[c],h=i[c],f=a[c],p=Math.sqrt(u*u+h*h+f*f);s=Math.max(s,p),l=Math.min(l,p)}t._len=o,t._normMax=s,r(e,t,{vals:[l,s],containerStr:"",cLetter:"c"})}}}),Qm=m({"src/traces/cone/convert.js"(e,t){var r=Yd().gl_cone3d,n=Yd().gl_cone3d.createConeMesh,i=ct().simpleMap,a=rm().parseColorScale,o=Yt().extractOpts,s=ct().isArrayOrTypedArray,l=Rm();function c(e,t){this.scene=e,this.uid=t,this.mesh=null,this.data=null}var u=c.prototype;u.handlePick=function(e){if(e.object===this.mesh){var t=e.index=e.data.index,r=this.data.x[t],n=this.data.y[t],i=this.data.z[t],a=this.data.u[t],o=this.data.v[t],l=this.data.w[t];e.traceCoordinate=[r,n,i,a,o,l,Math.sqrt(a*a+o*o+l*l)];var c=this.data.hovertext||this.data.text;return s(c)&&void 0!==c[t]?e.textLabel=c[t]:c&&(e.textLabel=c),!0}};var h={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 d(e,t){var n=e.fullSceneLayout,s=e.dataScale,c={};function u(e,t){var r=n[t],a=s[h[t]];return i(e,(function(e){return r.d2l(e)*a}))}c.vectors=l(u(t.u,"xaxis"),u(t.v,"yaxis"),u(t.w,"zaxis"),t._len),c.positions=l(u(t.x,"xaxis"),u(t.y,"yaxis"),u(t.z,"zaxis"),t._len);var d=o(t);c.colormap=a(t),c.vertexIntensityBounds=[d.min/t._normMax,d.max/t._normMax],c.coneOffset=f[t.anchor];var m=t.sizemode;"scaled"===m?c.coneSize=t.sizeref||.5:"absolute"===m?c.coneSize=t.sizeref&&t._normMax?t.sizeref/t._normMax:.5:"raw"===m&&(c.coneSize=t.sizeref),c.coneSizemode=m;var g=r(c),y=t.lightposition;return g.lightPosition=[y.x,y.y,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=d(this.scene,e);this.mesh.update(t)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},t.exports=function(e,t){var r=e.glplot.gl,i=d(e,t),a=n(r,i),o=new c(e,t.uid);return o.mesh=a,o.data=t,a._trace=o,e.glplot.add(a),o}}}),eg=m({"src/traces/cone/index.js"(e,t){t.exports={moduleType:"trace",name:"cone",basePlotModule:wm(),categories:["gl3d","showLegend"],attributes:$m(),supplyDefaults:Km(),colorbar:{min:"cmin",max:"cmax"},calc:Jm(),plot:Qm(),eventData:function(e,t){return e.norm=t.traceCoordinate[6],e},meta:{}}}}),tg=m({"lib/cone.js"(e,t){t.exports=eg()}}),rg=m({"src/traces/streamtube/attributes.js"(e,t){var r=zt(),n=It().axisHoverFormat,{hovertemplateAttrs:i,templatefallbackAttrs:a}=Fe(),o=Lm(),s=q(),l=B().extendFlat,c={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:n("u",1),vhoverformat:n("v",1),whoverformat:n("w",1),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,r("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(e){c[e]=o[e]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),t.exports=c}}),ng=m({"src/traces/streamtube/defaults.js"(e,t){var r=ct(),n=Ht(),i=rg();t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}var l=s("u"),c=s("v"),u=s("w"),h=s("x"),f=s("y"),p=s("z");l&&l.length&&c&&c.length&&u&&u.length&&h&&h.length&&f&&f.length&&p&&p.length?(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"),n(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):t.visible=!1}}}),ig=m({"src/traces/streamtube/convert.js"(e,t){var r=Yd().gl_streamtube3d,n=r.createTubeMesh,i=ct(),a=rm().parseColorScale,o=Yt().extractOpts,s=Rm(),l={xaxis:0,yaxis:1,zaxis:2};function c(e,t){this.scene=e,this.uid=t,this.mesh=null,this.data=null}var u=c.prototype;function h(e){var t=e.length;return t>2?e.slice(1,t-1):2===t?[(e[0]+e[1])/2]:e}function f(e){var t=e.length;return 1===t?[.5,.5]:[e[1]-e[0],e[t-1]-e[t-2]]}function p(e,t){var n=e.fullSceneLayout,c=e.dataScale,u=t._len,p={};function d(e,t){var r=n[t],a=c[l[t]];return i.simpleMap(e,(function(e){return r.d2l(e)*a}))}if(p.vectors=s(d(t._u,"xaxis"),d(t._v,"yaxis"),d(t._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=d(t._Xs,"xaxis"),g=d(t._Ys,"yaxis"),y=d(t._Zs,"zaxis");if(p.meshgrid=[m,g,y],p.gridFill=t._gridFill,t._slen)p.startingPositions=s(d(t._startsX,"xaxis"),d(t._startsY,"yaxis"),d(t._startsZ,"zaxis"));else{for(var v=g[0],x=h(m),_=h(y),b=new Array(x.length*_.length),w=0,T=0;T<x.length;T++)for(var k=0;k<_.length;k++)b[w++]=[x[T],v,_[k]];p.startingPositions=b}p.colormap=a(t),p.tubeSize=t.sizeref,p.maxLength=t.maxdisplayed;var A=d(t._xbnds,"xaxis"),M=d(t._ybnds,"yaxis"),S=d(t._zbnds,"zaxis"),E=f(m),C=f(g),I=f(y),L=[[A[0]-E[0],M[0]-C[0],S[0]-I[0]],[A[1]+E[1],M[1]+C[1],S[1]+I[1]]],P=r(p,L),z=o(t);P.vertexIntensityBounds=[z.min/t._normMax,z.max/t._normMax];var D=t.lightposition;return P.lightPosition=[D.x,D.y,D.z],P.ambient=t.lighting.ambient,P.diffuse=t.lighting.diffuse,P.specular=t.lighting.specular,P.roughness=t.lighting.roughness,P.fresnel=t.lighting.fresnel,P.opacity=t.opacity,t._pad=P.tubeScale*t.sizeref*2,P}u.handlePick=function(e){var t=this.scene.fullSceneLayout,r=this.scene.dataScale;function n(e,n){var i=t[n],a=r[l[n]];return i.l2c(e)/a}if(e.object===this.mesh){var i=e.data.position,a=e.data.velocity;return e.traceCoordinate=[n(i[0],"xaxis"),n(i[1],"yaxis"),n(i[2],"zaxis"),n(a[0],"xaxis"),n(a[1],"yaxis"),n(a[2],"zaxis"),e.data.intensity*this.data._normMax,e.data.divergence],e.textLabel=this.data.hovertext||this.data.text,!0}},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()},t.exports=function(e,t){var r=e.glplot.gl,i=p(e,t),a=n(r,i),o=new c(e,t.uid);return o.mesh=a,o.data=t,a._trace=o,e.glplot.add(a),o}}}),ag=m({"src/traces/streamtube/index.js"(e,t){t.exports={moduleType:"trace",name:"streamtube",basePlotModule:wm(),categories:["gl3d","showLegend"],attributes:rg(),supplyDefaults:ng(),colorbar:{min:"cmin",max:"cmax"},calc:Dm().calc,plot:ig(),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:{}}}}),og=m({"lib/streamtube.js"(e,t){t.exports=ag()}}),sg=m({"src/traces/scattergeo/attributes.js"(e,t){var{hovertemplateAttrs:r,texttemplateAttrs:n,templatefallbackAttrs:i}=Fe(),a=Tn(),o=kn(),s=q(),l=zt(),c=Oe().dash,u=B().extendFlat,h=De().overrideAll,f=o.marker,p=o.line,d=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=h({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:n({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:c},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:d.width,dash:d.dash},l("marker.line")),gradient:f.gradient},l("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:r(),hovertemplatefallback:i()},"calc","nested")}}),lg=m({"src/traces/scattergeo/defaults.js"(e,t){var r=ct(),n=Xt(),i=Yn(),a=Xn(),o=Kn(),s=Jn(),l=sg(),c=["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,h){function f(n,i){return r.coerce(e,t,l,n,i)}var p,d=f("locations");if(d&&d.length){var m,g=f("geojson");("string"==typeof g&&""!==g||r.isPlainObject(g))&&(m="geojson-id");var y=f("locationmode",m);"country names"===y&&r.warn(c),"geojson-id"===y&&f("featureidkey"),p=d.length}else{var v=f("lon")||[],x=f("lat")||[];p=Math.min(v.length,x.length)}p?(t._length=p,f("text"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("mode"),n.hasMarkers(t)&&i(e,t,u,h,f,{gradient:!0}),n.hasLines(t)&&(a(e,t,u,h,f),f("connectgaps")),n.hasText(t)&&(f("texttemplate"),f("texttemplatefallback"),o(e,t,h,f)),f("fill"),"none"!==t.fill&&s(e,t,u,f),r.coerceSelectionMarkerOpacity(t,f)):t.visible=!1}}}),cg=m({"src/traces/scattergeo/format_labels.js"(e,t){var r=ar();t.exports=function(e,t,n){var i={},a=n[t.geo]._subplot.mockAxis,o=e.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),ug=m({"src/traces/scattergeo/calc.js"(e,t){var r=M(),n=S().BADNUM,i=ii(),a=ai(),o=oi(),s=ct().isArrayOrTypedArray,l=ct()._;function c(e){return e&&"string"==typeof e}t.exports=function(e,t){var u,h=s(t.locations),f=h?t.locations.length:t._length,p=new Array(f);u=t.geojson?function(e){return c(e)||r(e)}:c;for(var d=0;d<f;d++){var m=p[d]={};if(h){var g=t.locations[d];m.loc=u(g)?g:null}else{var y=t.lon[d],v=t.lat[d];r(y)&&r(v)?m.lonlat=[+y,+v]:m.lonlat=[n,n]}}return a(p,t),i(e,t),o(p,t),f&&(p[0].t={labels:{lat:l(e,"lat:")+" ",lon:l(e,"lon:")+" "}}),p}}}),hg=m({"src/plots/geo/constants.js"(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"}}}),fg=m({"node_modules/topojson-client/dist/topojson-client.js"(e,t){var r,n;r=e,n=function(e){function t(e){return e}function r(e){if(null==e)return t;var r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],s=e.translate[1];return function(e,t){t||(r=n=0);var l=2,c=e.length,u=new Array(c);for(u[0]=(r+=e[0])*i+o,u[1]=(n+=e[1])*a+s;l<c;)u[l]=e[l],++l;return u}}function n(e){var t,n=r(e.transform),i=1/0,a=i,o=-i,s=-i;function l(e){(e=n(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 c(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"Point":l(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(l)}}for(t in e.arcs.forEach((function(e){for(var t,r=-1,l=e.length;++r<l;)(t=n(e[r],r))[0]<i&&(i=t[0]),t[0]>o&&(o=t[0]),t[1]<a&&(a=t[1]),t[1]>s&&(s=t[1])})),e.objects)c(e.objects[t]);return[i,a,o,s]}function i(e,t){var r=t.id,n=t.bbox,i=null==t.properties?{}:t.properties,o=a(e,t);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(e,t){var n=r(e.transform),i=e.arcs;function a(e,t){t.length&&t.pop();for(var r=i[e<0?~e:e],a=0,o=r.length;a<o;++a)t.push(n(r[a],a));e<0&&function(e,t){for(var r,n=e.length,i=n-t;i<--n;)r=e[i],e[i++]=e[n],e[n]=r}(t,o)}function o(e){return n(e)}function s(e){for(var t=[],r=0,n=e.length;r<n;++r)a(e[r],t);return t.length<2&&t.push(t[0]),t}function l(e){for(var t=s(e);t.length<4;)t.push(t[0]);return t}function c(e){return e.map(l)}return function e(t){var r,n=t.type;switch(n){case"GeometryCollection":return{type:n,geometries:t.geometries.map(e)};case"Point":r=o(t.coordinates);break;case"MultiPoint":r=t.coordinates.map(o);break;case"LineString":r=s(t.arcs);break;case"MultiLineString":r=t.arcs.map(s);break;case"Polygon":r=c(t.arcs);break;case"MultiPolygon":r=t.arcs.map(c);break;default:return null}return{type:n,coordinates:r}}(t)}function o(e,t){var r={},n={},i={},a=[],o=-1;function s(e,t){for(var n in e){var i=e[n];delete t[i.start],delete i.start,delete i.end,i.forEach((function(e){r[e<0?~e:e]=1})),a.push(i)}}return t.forEach((function(r,n){var i,a=e.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=t[++o],t[o]=r,t[n]=i)})),t.forEach((function(t){var r,a,o=function(t){var r,n=e.arcs[t<0?~t:t],i=n[0];return e.transform?(r=[0,0],n.forEach((function(e){r[0]+=e[0],r[1]+=e[1]}))):r=n[n.length-1],t<0?[r,i]:[i,r]}(t),s=o[0],l=o[1];if(r=i[s])if(delete i[r.end],r.push(t),r.end=l,a=n[l]){delete n[a.start];var c=a===r?r:r.concat(a);n[c.start=r.start]=i[c.end=a.end]=c}else n[r.start]=i[r.end]=r;else if(r=n[l])if(delete n[r.start],r.unshift(t),r.start=s,a=i[s]){delete i[a.end];var u=a===r?r:a.concat(r);n[u.start=a.start]=i[u.end=r.end]=u}else n[r.start]=i[r.end]=r;else n[(r=[t]).start=s]=i[r.end=l]=r})),s(i,n),s(n,i),t.forEach((function(e){r[e<0?~e:e]||a.push([e])})),a}function s(e,t,r){var n,i,a;if(arguments.length>1)n=function(e,t,r){var n,i=[],a=[];function o(e){var t=e<0?~e:e;(a[t]||(a[t]=[])).push({i:e,g:n})}function s(e){e.forEach(o)}function l(e){e.forEach(s)}return function e(t){switch(n=t,t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":l(t.arcs);break;case"MultiPolygon":!function(e){e.forEach(l)}(t.arcs)}}(t),a.forEach(null==r?function(e){i.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&i.push(e[0].i)}),i}(0,t,r);else for(i=0,n=new Array(a=e.arcs.length);i<a;++i)n[i]=i;return{type:"MultiLineString",arcs:o(e,n)}}function l(e,t){var r={},n=[],i=[];function s(e){e.forEach((function(t){t.forEach((function(t){(r[t=t<0?~t:t]||(r[t]=[])).push(e)}))})),n.push(e)}function l(t){return function(e){for(var t,r=-1,n=e.length,i=e[n-1],a=0;++r<n;)t=i,i=e[r],a+=t[0]*i[1]-t[1]*i[0];return Math.abs(a)}(a(e,{type:"Polygon",arcs:[t]}).coordinates[0])}return t.forEach((function e(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"Polygon":s(t.arcs);break;case"MultiPolygon":t.arcs.forEach(s)}})),n.forEach((function(e){if(!e._){var t=[],n=[e];for(e._=1,i.push(t);e=n.pop();)t.push(e),e.forEach((function(e){e.forEach((function(e){r[e<0?~e:e].forEach((function(e){e._||(e._=1,n.push(e))}))}))}))}})),n.forEach((function(e){delete e._})),{type:"MultiPolygon",arcs:i.map((function(t){var n,i=[];if(t.forEach((function(e){e.forEach((function(e){e.forEach((function(e){r[e<0?~e:e].length<2&&i.push(e)}))}))})),(n=(i=o(e,i)).length)>1)for(var a,s,c=1,u=l(i[0]);c<n;++c)(a=l(i[c]))>u&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(e){return e.length>0}))}}function c(e,t){for(var r=0,n=e.length;r<n;){var i=r+n>>>1;e[i]<t?r=i+1:n=i}return r}function u(e){if(null==e)return t;var r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],s=e.translate[1];return function(e,t){t||(r=n=0);var l=2,c=e.length,u=new Array(c),h=Math.round((e[0]-o)/i),f=Math.round((e[1]-s)/a);for(u[0]=h-r,r=h,u[1]=f-n,n=f;l<c;)u[l]=e[l],++l;return u}}e.bbox=n,e.feature=function(e,t){return"string"==typeof t&&(t=e.objects[t]),"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return i(e,t)}))}:i(e,t)},e.merge=function(e){return a(e,l.apply(this,arguments))},e.mergeArcs=l,e.mesh=function(e){return a(e,s.apply(this,arguments))},e.meshArcs=s,e.neighbors=function(e){var t={},r=e.map((function(){return[]}));function n(e,r){e.forEach((function(e){e<0&&(e=~e);var n=t[e];n?n.push(r):t[e]=[r]}))}function i(e,t){e.forEach((function(e){n(e,t)}))}var a={LineString:n,MultiLineString:i,Polygon:i,MultiPolygon:function(e,t){e.forEach((function(e){i(e,t)}))}};for(var o in e.forEach((function e(t,r){"GeometryCollection"===t.type?t.geometries.forEach((function(t){e(t,r)})):t.type in a&&a[t.type](t.arcs,r)})),t)for(var s=t[o],l=s.length,u=0;u<l;++u)for(var h=u+1;h<l;++h){var f,p=s[u],d=s[h];(f=r[p])[o=c(f,d)]!==d&&f.splice(o,0,d),(f=r[d])[o=c(f,p)]!==p&&f.splice(o,0,p)}return r},e.quantize=function(e,t){if(e.transform)throw new Error("already quantized");if(t&&t.scale)l=e.bbox;else{if(!((r=Math.floor(t))>=2))throw new Error("n must be ≥2");var r,i=(l=e.bbox||n(e))[0],a=l[1],o=l[2],s=l[3];t={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,h=u(t),f=e.objects,p={};function d(e){return h(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:d(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(d)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(c in f)p[c]=m(f[c]);return{type:"Topology",bbox:l,transform:t,objects:p,arcs:e.arcs.map((function(e){var t,r=0,n=1,i=e.length,a=new Array(i);for(a[0]=h(e[0],0);++r<i;)((t=h(e[r],r))[0]||t[1])&&(a[n++]=t);return 1===n&&(a[n++]=[0,0]),a.length=n,a}))}},e.transform=r,e.untransform=u,Object.defineProperty(e,"__esModule",{value:!0})},n("object"==typeof e&&typeof t<"u"?e:(r=r||self).topojson=r.topojson||{})}}),pg=m({"src/lib/topojson_utils.js"(e,t){var r=t.exports={},n=hg().locationmodeToLayer,i=fg().feature;r.getTopojsonName=function(e){return[e.scope.replace(/ /g,"-"),"_",e.resolution.toString(),"m"].join("")},r.getTopojsonPath=function(e,t){return`${e+=e.endsWith("/")?"":"/"}${t}.json`},r.getTopojsonFeatures=function(e,t){var r=n[e.locationmode],a=t.objects[r];return i(t,a).features}}}),dg=m({"src/lib/geojson_utils.js"(e){var t=S().BADNUM;e.calcTraceToLineCoords=function(e){for(var r=e[0].trace.connectgaps,n=[],i=[],a=0;a<e.length;a++){var o=e[a].lonlat;o[0]!==t?i.push(o):!r&&i.length>0&&(n.push(i),i=[])}return i.length>0&&n.push(i),n},e.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},e.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=[e[r]];return{type:"MultiPolygon",coordinates:t}},e.makeBlank=function(){return{type:"Point",coordinates:[]}}}}),mg=m({"node_modules/country-regex/index.js"(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"}}}),gg=m({"node_modules/@turf/helpers/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=6371008.8,r={centimeters:100*t,centimetres:100*t,degrees:360/(2*Math.PI),feet:3.28084*t,inches:39.37*t,kilometers:t/1e3,kilometres:t/1e3,meters:t,metres:t,miles:t/1609.344,millimeters:1e3*t,millimetres:1e3*t,nauticalmiles:t/1852,radians:1,yards:1.0936*t},n={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,r={}){let n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function a(e,t,r={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!m(e[0])||!m(e[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:e},t,r)}function o(e,t,r={}){for(let t of e){if(t.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(t[t.length-1].length!==t[0].length)throw new 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 new Error("First and last Position are not equivalent.")}return i({type:"Polygon",coordinates:e},t,r)}function s(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return i({type:"LineString",coordinates:e},t,r)}function l(e,t={}){let r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function c(e,t,r={}){return i({type:"MultiLineString",coordinates:e},t,r)}function u(e,t,r={}){return i({type:"MultiPoint",coordinates:e},t,r)}function h(e,t,r={}){return i({type:"MultiPolygon",coordinates:e},t,r)}function f(e,t="kilometers"){let n=r[t];if(!n)throw new Error(t+" units is invalid");return e*n}function p(e,t="kilometers"){let n=r[t];if(!n)throw new Error(t+" units is invalid");return e/n}function d(e){return e%(2*Math.PI)*180/Math.PI}function m(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}e.areaFactors=n,e.azimuthToBearing=function(e){return(e%=360)>180?e-360:e<-180?e+360:e},e.bearingToAzimuth=function(e){let t=e%360;return t<0&&(t+=360),t},e.convertArea=function(e,t="meters",r="kilometers"){if(!(e>=0))throw new Error("area must be a positive number");let i=n[t];if(!i)throw new Error("invalid original units");let a=n[r];if(!a)throw new Error("invalid final units");return e/i*a},e.convertLength=function(e,t="kilometers",r="kilometers"){if(!(e>=0))throw new Error("length must be a positive number");return f(p(e,t),r)},e.degreesToRadians=function(e){return e%360*Math.PI/180},e.earthRadius=t,e.factors=r,e.feature=i,e.featureCollection=l,e.geometry=function(e,t,r={}){switch(e){case"Point":return a(t).geometry;case"LineString":return s(t).geometry;case"Polygon":return o(t).geometry;case"MultiPoint":return u(t).geometry;case"MultiLineString":return c(t).geometry;case"MultiPolygon":return h(t).geometry;default:throw new Error(e+" is invalid")}},e.geometryCollection=function(e,t,r={}){return i({type:"GeometryCollection",geometries:e},t,r)},e.isNumber=m,e.isObject=function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)},e.lengthToDegrees=function(e,t){return d(p(e,t))},e.lengthToRadians=p,e.lineString=s,e.lineStrings=function(e,t,r={}){return l(e.map((e=>s(e,t))),r)},e.multiLineString=c,e.multiPoint=u,e.multiPolygon=h,e.point=a,e.points=function(e,t,r={}){return l(e.map((e=>a(e,t))),r)},e.polygon=o,e.polygons=function(e,t,r={}){return l(e.map((e=>o(e,t))),r)},e.radiansToDegrees=d,e.radiansToLength=f,e.round=function(e,t=0){if(t&&!(t>=0))throw new Error("precision must be a positive number");let r=Math.pow(10,t||0);return Math.round(e*r)/r},e.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((e=>{if(!m(e))throw new Error("bbox must only contain numbers")}))},e.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}}}),yg=m({"node_modules/@turf/meta/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=gg();function r(e,t,n){if(null!==e)for(var i,a,o,s,l,c,u,h,f=0,p=0,d=e.type,m="FeatureCollection"===d,g="Feature"===d,y=m?e.features.length:1,v=0;v<y;v++){l=(h=!!(u=m?e.features[v].geometry:g?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var x=0;x<l;x++){var _=0,b=0;if(null!==(s=h?u.geometries[x]:u)){c=s.coordinates;var w=s.type;switch(f=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===t(c,p,v,_,b))return!1;p++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(!1===t(c[i],p,v,_,b))return!1;p++,"MultiPoint"===w&&_++}"LineString"===w&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(a=0;a<c[i].length-f;a++){if(!1===t(c[i][a],p,v,_,b))return!1;p++}"MultiLineString"===w&&_++,"Polygon"===w&&b++}"Polygon"===w&&_++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(b=0,a=0;a<c[i].length;a++){for(o=0;o<c[i][a].length-f;o++){if(!1===t(c[i][a][o],p,v,_,b))return!1;p++}b++}_++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(!1===r(s.geometries[i],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function n(e,t){var r;switch(e.type){case"FeatureCollection":for(r=0;r<e.features.length&&!1!==t(e.features[r].properties,r);r++);break;case"Feature":t(e.properties,0)}}function i(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var r=0;r<e.features.length&&!1!==t(e.features[r],r);r++);}function a(e,t){var r,n,i,a,o,s,l,c,u,h,f=0,p="FeatureCollection"===e.type,d="Feature"===e.type,m=p?e.features.length:1;for(r=0;r<m;r++){for(s=p?e.features[r].geometry:d?e.geometry:e,c=p?e.features[r].properties:d?e.properties:{},u=p?e.features[r].bbox:d?e.bbox:void 0,h=p?e.features[r].id:d?e.id:void 0,o=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<o;i++)if(null!==(a=l?s.geometries[i]:s))switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(a,f,c,u,h))return!1;break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===t(a.geometries[n],f,c,u,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,f,c,u,h))return!1;f++}}function o(e,r){a(e,(function(e,n,i,a,o){var s,l=null===e?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==r(t.feature.call(void 0,e,i,{bbox:a,id:o}),n,0)&&void 0}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var c=0;c<e.coordinates.length;c++){var u={type:s,coordinates:e.coordinates[c]};if(!1===r(t.feature.call(void 0,u,i),n,c))return!1}}))}function s(e,n){o(e,(function(e,i,a){var o=0;if(e.geometry){var s=e.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var l,c=0,u=0,h=0;if(!1===r(e,(function(r,s,f,p,d){if(void 0===l||i>c||p>u||d>h)return l=r,c=i,u=p,h=d,void(o=0);var m=t.lineString.call(void 0,[l,r],e.properties);if(!1===n(m,i,a,d,o))return!1;o++,l=r})))return!1}}}))}function l(e,r){if(!e)throw new Error("geojson is required");o(e,(function(e,n,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===r(e,n,i,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===r(t.lineString.call(void 0,o[s],e.properties),n,i,s))return!1}}}))}e.coordAll=function(e){var t=[];return r(e,(function(e){t.push(e)})),t},e.coordEach=r,e.coordReduce=function(e,t,n,i){var a=n;return r(e,(function(e,r,i,o,s){a=0===r&&void 0===n?e:t(a,e,r,i,o,s)}),i),a},e.featureEach=i,e.featureReduce=function(e,t,r){var n=r;return i(e,(function(e,i){n=0===i&&void 0===r?e:t(n,e,i)})),n},e.findPoint=function(e,r){if(r=r||{},!t.isObject.call(void 0,r))throw new Error("options is invalid");var n,i=r.featureIndex||0,a=r.multiFeatureIndex||0,o=r.geometryIndex||0,s=r.coordIndex||0,l=r.properties;switch(e.type){case"FeatureCollection":i<0&&(i=e.features.length+i),l=l||e.features[i].properties,n=e.features[i].geometry;break;case"Feature":l=l||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var c=n.coordinates;switch(n.type){case"Point":return t.point.call(void 0,c,l,r);case"MultiPoint":return a<0&&(a=c.length+a),t.point.call(void 0,c[a],l,r);case"LineString":return s<0&&(s=c.length+s),t.point.call(void 0,c[s],l,r);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),t.point.call(void 0,c[o][s],l,r);case"MultiLineString":return a<0&&(a=c.length+a),s<0&&(s=c[a].length+s),t.point.call(void 0,c[a][s],l,r);case"MultiPolygon":return a<0&&(a=c.length+a),o<0&&(o=c[a].length+o),s<0&&(s=c[a][o].length-s),t.point.call(void 0,c[a][o][s],l,r)}throw new Error("geojson is invalid")},e.findSegment=function(e,r){if(r=r||{},!t.isObject.call(void 0,r))throw new Error("options is invalid");var n,i=r.featureIndex||0,a=r.multiFeatureIndex||0,o=r.geometryIndex||0,s=r.segmentIndex||0,l=r.properties;switch(e.type){case"FeatureCollection":i<0&&(i=e.features.length+i),l=l||e.features[i].properties,n=e.features[i].geometry;break;case"Feature":l=l||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var c=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),t.lineString.call(void 0,[c[s],c[s+1]],l,r);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),t.lineString.call(void 0,[c[o][s],c[o][s+1]],l,r);case"MultiLineString":return a<0&&(a=c.length+a),s<0&&(s=c[a].length+s-1),t.lineString.call(void 0,[c[a][s],c[a][s+1]],l,r);case"MultiPolygon":return a<0&&(a=c.length+a),o<0&&(o=c[a].length+o),s<0&&(s=c[a][o].length-s-1),t.lineString.call(void 0,[c[a][o][s],c[a][o][s+1]],l,r)}throw new Error("geojson is invalid")},e.flattenEach=o,e.flattenReduce=function(e,t,r){var n=r;return o(e,(function(e,i,a){n=0===i&&0===a&&void 0===r?e:t(n,e,i,a)})),n},e.geomEach=a,e.geomReduce=function(e,t,r){var n=r;return a(e,(function(e,i,a,o,s){n=0===i&&void 0===r?e:t(n,e,i,a,o,s)})),n},e.lineEach=l,e.lineReduce=function(e,t,r){var n=r;return l(e,(function(e,i,a,o){n=0===i&&void 0===r?e:t(n,e,i,a,o)})),n},e.propEach=n,e.propReduce=function(e,t,r){var i=r;return n(e,(function(e,n){i=0===n&&void 0===r?e:t(i,e,n)})),i},e.segmentEach=s,e.segmentReduce=function(e,t,r){var n=r,i=!1;return s(e,(function(e,a,o,s,l){n=!1===i&&void 0===r?e:t(n,e,a,o,s,l),i=!0})),n}}}),vg=m({"node_modules/@turf/area/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=gg(),r=yg();function n(e){return r.geomReduce.call(void 0,e,((e,t)=>e+function(e){let t,r=0;switch(e.type){case"Polygon":return i(e.coordinates);case"MultiPolygon":for(t=0;t<e.coordinates.length;t++)r+=i(e.coordinates[t]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(t)),0)}function i(e){let t=0;if(e&&e.length>0){t+=Math.abs(s(e[0]));for(let r=1;r<e.length;r++)t-=Math.abs(s(e[r]))}return t}var a=t.earthRadius*t.earthRadius/2,o=Math.PI/180;function s(e){let t=e.length-1;if(t<=2)return 0;let r=0,n=0;for(;n<t;){let i=e[n],a=e[n+1===t?0:n+1],s=e[n+2>=t?(n+2)%t:n+2],l=i[0]*o,c=a[1]*o;r+=(s[0]*o-l)*Math.sin(c),n++}return r*a}var l=n;e.area=n,e.default=l}}),xg=m({"node_modules/@turf/centroid/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=gg(),r=yg();function n(e,n={}){let i=0,a=0,o=0;return r.coordEach.call(void 0,e,(function(e){i+=e[0],a+=e[1],o++}),!0),t.point.call(void 0,[i/o,a/o],n.properties)}var i=n;e.centroid=n,e.default=i}}),_g=m({"node_modules/@turf/bbox/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=yg();function r(e,r={}){if(null!=e.bbox&&!0!==r.recompute)return e.bbox;let n=[1/0,1/0,-1/0,-1/0];return t.coordEach.call(void 0,e,(e=>{n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])})),n}var n=r;e.bbox=r,e.default=n}}),bg=m({"src/lib/usa_location_names.js"(e,t){var r={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"},n=new Set(Object.values(r));t.exports={usaLocationAbbreviations:n,usaLocationList:r}}}),wg=m({"src/lib/geo_location_utils.js"(e,t){var r=b(),n=mg(),{area:i}=vg(),{centroid:a}=xg(),{bbox:o}=_g(),s=We(),l=J(),c=C(),u=L(),h=gn(),{usaLocationAbbreviations:f,usaLocationList:p}=bg(),d=Object.keys(n),m={"ISO-3":s,"USA-states":function(e){return e=e.trim(),(f.has(e.toUpperCase())?e.toUpperCase():p[e.toLowerCase()])||(l.log("Unrecognized US location: "+e+"."),!1)},"country names":function(e){for(var t=0;t<d.length;t++){var r=d[t];if(new RegExp(n[r]).test(e.trim().toLowerCase()))return r}return l.log("Unrecognized country name: "+e+"."),!1}};function g(e){var t=e.geojson,r=window.PlotlyGeoAssets||{},n="string"==typeof t?r[t]:t;return c(n)?n:(l.error("Oops ... something went wrong when fetching "+t),!1)}t.exports={locationToFeature:function(e,t,r){var n;if(!t||"string"!=typeof t)return!1;let i=m[e](t);if(i){let t;if("USA-states"===e){t=[];for(let e of r)"USA"===(null==(n=e?.properties)?void 0:n.gu)&&t.push(e)}else t=r;for(let e of t)if(e.id===i)return e;l.log(`Location with id ${i} does not have a matching topojson feature at this resolution.`)}return!1},feature2polygons:function(e){var t,r,n,i,a=e.geometry,o=a.coordinates,s=e.id,l=[];function c(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(t="RUS"===s||"FJI"===s?function(e){var t;if(null===c(e))t=e;else for(t=new Array(e.length),i=0;i<e.length;i++)t[i]=[e[i][0]<0?e[i][0]+360:e[i][0],e[i][1]];l.push(h.tester(t))}:"ATA"===s?function(e){var t=c(e);if(null===t)return l.push(h.tester(e));var r=new Array(e.length+1),n=0;for(i=0;i<e.length;i++)i>t?r[n++]=[e[i][0]+360,e[i][1]]:i===t?(r[n++]=e[i],r[n++]=[e[i][0],-90]):r[n++]=e[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(e){l.push(h.tester(e))},a.type){case"MultiPolygon":for(r=0;r<o.length;r++)for(n=0;n<o[r].length;n++)t(o[r][n]);break;case"Polygon":for(r=0;r<o.length;r++)t(o[r])}return l},getTraceGeojson:g,extractTraceFeature:function(e){var t=e[0].trace,r=g(t);if(!r)return!1;var n,o={},s=[];for(n=0;n<t._length;n++){var c=e[n];(c.loc||0===c.loc)&&(o[c.loc]=c)}function h(e){var r=u(e,t.featureidkey||"id").get(),n=o[r];if(n){var c=e.geometry;if("Polygon"===c.type||"MultiPolygon"===c.type){var h={type:"Feature",id:r,geometry:c,properties:{}};h.geometry.coordinates.length>0?h.properties.ct=function(e){var t,r=e.geometry;if("MultiPolygon"===r.type)for(var n=r.coordinates,o=0,s=0;s<n.length;s++){var l={type:"Polygon",coordinates:n[s]},c=i(l);c>o&&(o=c,t=l)}else t=r;return a(t).geometry.coordinates}(h):h.properties.ct=[NaN,NaN],n.fIn=e,n.fOut=h,s.push(h)}else l.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete o[r]}switch(r.type){case"FeatureCollection":var f=r.features;for(n=0;n<f.length;n++)h(f[n]);break;case"Feature":h(r);break;default:return l.warn(["Invalid GeoJSON type",(r.type||"none")+".","Traces with locationmode *geojson-id* only support","*FeatureCollection* and *Feature* types."].join(" ")),!1}for(var p in o)l.log(["Location *"+p+"*","does not have a matching feature with id-key","*"+t.featureidkey+"*."].join(" "));return s},fetchTraceGeoData:function(e){var t=window.PlotlyGeoAssets||{},n=[];function i(e){return new Promise((function(n,i){r.json(e,(function(r,a){if(r){delete t[e];var o=404===r.status?'GeoJSON at URL "'+e+'" does not exist.':"Unexpected error while fetching from "+e;return i(new Error(o))}return t[e]=a,n(a)}))}))}function a(e){return new Promise((function(r,n){var i=0,a=setInterval((function(){return t[e]&&"pending"!==t[e]?(clearInterval(a),r(t[e])):i>100?(clearInterval(a),n("Unexpected error while fetching from "+e)):void i++}),50)}))}for(var o=0;o<e.length;o++){var s=e[o][0].trace.geojson;"string"==typeof s&&(t[s]?"pending"===t[s]&&n.push(a(s)):(t[s]="pending",n.push(i(s))))}return n},computeBbox:function(e){return o(e)}}}}),Tg=m({"src/traces/scattergeo/style.js"(e,t){var r=b(),n=er(),i=W(),a=yi(),o=a.stylePoints,s=a.styleText;t.exports=function(e,t){t&&function(e,t){var a=t[0].trace,l=t[0].node3;l.style("opacity",t[0].trace.opacity),o(l,a,e),s(l,a,e),l.selectAll("path.js-line").style("fill","none").each((function(e){var t=r.select(this),a=e.trace,o=a.line||{};t.call(i.stroke,o.color).call(n.dashLine,o.dash||"",o.width||0),"none"!==a.fill&&t.call(i.fill,a.fillcolor)}))}(e,t)}}}),kg=m({"src/traces/scattergeo/plot.js"(e,t){var r=b(),n=ct(),i=pg().getTopojsonFeatures,a=dg(),o=wg(),s=ir().findExtremes,l=S().BADNUM,c=si().calcMarkerSize,u=Xt(),h=Tg();t.exports={calcGeoJSON:function(e,t){var r,a,u=e[0].trace,h=t[u.geo],f=h._subplot,p=u._length;if(n.isArrayOrTypedArray(u.locations)){var d=u.locationmode,m="geojson-id"===d?o.extractTraceFeature(e):i(u,f.topojson);for(r=0;r<p;r++){a=e[r];var g="geojson-id"===d?a.fOut:o.locationToFeature(d,a.loc,m);a.lonlat=g?g.properties.ct:[l,l]}}var y,v,x={padded:!0};if("geojson"===h.fitbounds&&"geojson-id"===u.locationmode){var _=o.computeBbox(o.getTraceGeojson(u));y=[_[0],_[2]],v=[_[1],_[3]]}else{for(y=new Array(p),v=new Array(p),r=0;r<p;r++)a=e[r],y[r]=a.lonlat[0],v[r]=a.lonlat[1];x.ppad=c(u,p)}u._extremes.lon=s(h.lonaxis._ax,y,x),u._extremes.lat=s(h.lataxis._ax,v,x)},plot:function(e,t,i){var o=t.layers.frontplot.select(".scatterlayer"),s=n.makeTraceGroups(o,i,"trace scattergeo");function c(e,t){e.lonlat[0]===l&&r.select(t).remove()}s.selectAll("*").remove(),s.each((function(t){var i=r.select(this),o=t[0].trace;if(u.hasLines(o)||"none"!==o.fill){var s=a.calcTraceToLineCoords(t),l="none"!==o.fill?a.makePolygon(s):a.makeLine(s);i.selectAll("path.js-line").data([{geojson:l,trace:o}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}u.hasMarkers(o)&&i.selectAll("path.point").data(n.identity).enter().append("path").classed("point",!0).each((function(e){c(e,this)})),u.hasText(o)&&i.selectAll("g").data(n.identity).enter().append("g").append("text").each((function(e){c(e,this)})),h(e,t)}))}}}}),Ag=m({"src/traces/scattergeo/hover.js"(e,t){var r=Or(),n=S().BADNUM,i=vi(),a=ct().fillText,o=sg();t.exports=function(e,t,s){var l=e.cd,c=l[0].trace,u=e.xa,h=e.ya,f=e.subplot,p=f.projection.isLonLatOverEdges,d=f.project;if(r.getClosest(l,(function(e){var r=e.lonlat;if(r[0]===n||p(r))return 1/0;var i=d(r),a=d([t,s]),o=Math.abs(i[0]-a[0]),l=Math.abs(i[1]-a[1]),c=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(o*o+l*l)-c,1-3/c)}),e),!1!==e.index){var m=l[e.index],g=m.lonlat,y=[u.c2p(g),h.c2p(g)],v=m.mrc||1;e.x0=y[0]-v,e.x1=y[0]+v,e.y0=y[1]-v,e.y1=y[1]+v,e.loc=m.loc,e.lon=g[0],e.lat=g[1];var x={};x[c.geo]={_subplot:f};var _=c._module.formatLabels(m,c,x);return e.lonLabel=_.lonLabel,e.latLabel=_.latLabel,e.color=i(c,m),e.extraText=function(e,t,r,n){if(!e.hovertemplate){var i=t.hi||e.hoverinfo,s="all"===i?o.hoverinfo.flags:i.split("+"),l=-1!==s.indexOf("location")&&Array.isArray(e.locations),c=-1!==s.indexOf("lon"),u=-1!==s.indexOf("lat"),h=-1!==s.indexOf("text"),f=[];return l?f.push(t.loc):c&&u?f.push("("+p(r.latLabel)+", "+p(r.lonLabel)+")"):c?f.push(n.lon+p(r.lonLabel)):u&&f.push(n.lat+p(r.latLabel)),h&&a(t,e,f),f.join("<br>")}function p(e){return e+"°"}}(c,m,e,l[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}}}}),Mg=m({"src/traces/scattergeo/event_data.js"(e,t){t.exports=function(e,t,r,n,i){e.lon=t.lon,e.lat=t.lat,e.location=t.loc?t.loc:null;var a=n[i];return a.fIn&&a.fIn.properties&&(e.properties=a.fIn.properties),e}}}),Sg=m({"src/traces/scattergeo/select.js"(e,t){var r=Xt(),n=S().BADNUM;t.exports=function(e,t){var i,a,o,s,l,c=e.cd,u=e.xaxis,h=e.yaxis,f=[],p=c[0].trace;if(!r.hasMarkers(p)&&!r.hasText(p))return[];if(!1===t)for(l=0;l<c.length;l++)c[l].selected=0;else for(l=0;l<c.length;l++)(a=(i=c[l]).lonlat)[0]!==n&&(o=u.c2p(a),s=h.c2p(a),t.contains([o,s],null,l,e)?(f.push({pointNumber:l,lon:a[0],lat:a[1]}),i.selected=1):i.selected=0);return f}}}),Eg=m({"node_modules/d3-array/dist/d3-array.js"(e,t){var r;r=e,function(e){function t(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function r(e){return 1===e.length&&(e=function(e){return function(r,n){return t(e(r),n)}}(e)),{left:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}var n=r(t),i=n.right,a=n.left;function o(e,t){return[e,t]}function s(e){return null===e?NaN:+e}function l(e,t){var r,n,i=e.length,a=0,o=-1,l=0,c=0;if(null==t)for(;++o<i;)isNaN(r=s(e[o]))||(c+=(n=r-l)*(r-(l+=n/++a)));else for(;++o<i;)isNaN(r=s(t(e[o],o,e)))||(c+=(n=r-l)*(r-(l+=n/++a)));if(a>1)return c/(a-1)}function c(e,t){var r=l(e,t);return r&&Math.sqrt(r)}function u(e,t){var r,n,i,a=e.length,o=-1;if(null==t){for(;++o<a;)if(null!=(r=e[o])&&r>=r)for(n=i=r;++o<a;)null!=(r=e[o])&&(n>r&&(n=r),i<r&&(i=r))}else for(;++o<a;)if(null!=(r=t(e[o],o,e))&&r>=r)for(n=i=r;++o<a;)null!=(r=t(e[o],o,e))&&(n>r&&(n=r),i<r&&(i=r));return[n,i]}var h=Array.prototype,f=h.slice,p=h.map;function d(e){return function(){return e}}function m(e){return e}function g(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((t-e)/r)),a=new Array(i);++n<i;)a[n]=e+n*r;return a}var y=Math.sqrt(50),v=Math.sqrt(10),x=Math.sqrt(2);function _(e,t,r){var n=(t-e)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),a=n/Math.pow(10,i);return i>=0?(a>=y?10:a>=v?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=y?10:a>=v?5:a>=x?2:1)}function b(e,t,r){var n=Math.abs(t-e)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=y?i*=10:a>=v?i*=5:a>=x&&(i*=2),t<e?-i:i}function w(e){return Math.ceil(Math.log(e.length)/Math.LN2)+1}function T(e,t,r){if(null==r&&(r=s),n=e.length){if((t=+t)<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e);return o+(+r(e[a+1],a+1,e)-o)*(i-a)}}function k(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a<i;)if(null!=(r=e[a])&&r>=r)for(n=r;++a<i;)null!=(r=e[a])&&n>r&&(n=r)}else for(;++a<i;)if(null!=(r=t(e[a],a,e))&&r>=r)for(n=r;++a<i;)null!=(r=t(e[a],a,e))&&n>r&&(n=r);return n}function A(e){if(!(i=e.length))return[];for(var t=-1,r=k(e,M),n=new Array(r);++t<r;)for(var i,a=-1,o=n[t]=new Array(i);++a<i;)o[a]=e[a][t];return n}function M(e){return e.length}e.bisect=i,e.bisectRight=i,e.bisectLeft=a,e.ascending=t,e.bisector=r,e.cross=function(e,t,r){var n,i,a,s,l=e.length,c=t.length,u=new Array(l*c);for(null==r&&(r=o),n=a=0;n<l;++n)for(s=e[n],i=0;i<c;++i,++a)u[a]=r(s,t[i]);return u},e.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},e.deviation=c,e.extent=u,e.histogram=function(){var e=m,t=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;a<s;++a)l[a]=e(n[a],a,n);var c=t(l),u=c[0],h=c[1],f=r(l,u,h);Array.isArray(f)||(f=b(u,h,f),f=g(Math.ceil(u/f)*f,h,f));for(var p=f.length;f[0]<=u;)f.shift(),--p;for(;f[p-1]>h;)f.pop(),--p;var d,m=new Array(p+1);for(a=0;a<=p;++a)(d=m[a]=[]).x0=a>0?f[a-1]:u,d.x1=a<p?f[a]:h;for(a=0;a<s;++a)u<=(o=l[a])&&o<=h&&m[i(f,o,0,p)].push(n[a]);return m}return n.value=function(t){return arguments.length?(e="function"==typeof t?t:d(t),n):e},n.domain=function(e){return arguments.length?(t="function"==typeof e?e:d([e[0],e[1]]),n):t},n.thresholds=function(e){return arguments.length?(r="function"==typeof e?e:Array.isArray(e)?d(f.call(e)):d(e),n):r},n},e.thresholdFreedmanDiaconis=function(e,r,n){return e=p.call(e,s).sort(t),Math.ceil((n-r)/(2*(T(e,.75)-T(e,.25))*Math.pow(e.length,-1/3)))},e.thresholdScott=function(e,t,r){return Math.ceil((r-t)/(3.5*c(e)*Math.pow(e.length,-1/3)))},e.thresholdSturges=w,e.max=function(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a<i;)if(null!=(r=e[a])&&r>=r)for(n=r;++a<i;)null!=(r=e[a])&&r>n&&(n=r)}else for(;++a<i;)if(null!=(r=t(e[a],a,e))&&r>=r)for(n=r;++a<i;)null!=(r=t(e[a],a,e))&&r>n&&(n=r);return n},e.mean=function(e,t){var r,n=e.length,i=n,a=-1,o=0;if(null==t)for(;++a<n;)isNaN(r=s(e[a]))?--i:o+=r;else for(;++a<n;)isNaN(r=s(t(e[a],a,e)))?--i:o+=r;if(i)return o/i},e.median=function(e,r){var n,i=e.length,a=-1,o=[];if(null==r)for(;++a<i;)isNaN(n=s(e[a]))||o.push(n);else for(;++a<i;)isNaN(n=s(r(e[a],a,e)))||o.push(n);return T(o.sort(t),.5)},e.merge=function(e){for(var t,r,n,i=e.length,a=-1,o=0;++a<i;)o+=e[a].length;for(r=new Array(o);--i>=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r},e.min=k,e.pairs=function(e,t){null==t&&(t=o);for(var r=0,n=e.length-1,i=e[0],a=new Array(n<0?0:n);r<n;)a[r]=t(i,i=e[++r]);return a},e.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},e.quantile=T,e.range=g,e.scan=function(e,r){if(n=e.length){var n,i,a=0,o=0,s=e[o];for(null==r&&(r=t);++a<n;)(r(i=e[a],s)<0||0!==r(s,s))&&(s=i,o=a);if(0===r(s,s))return o}},e.shuffle=function(e,t,r){for(var n,i,a=(r??e.length)-(t=null==t?0:+t);a;)i=Math.random()*a--|0,n=e[a+t],e[a+t]=e[i+t],e[i+t]=n;return e},e.sum=function(e,t){var r,n=e.length,i=-1,a=0;if(null==t)for(;++i<n;)(r=+e[i])&&(a+=r);else for(;++i<n;)(r=+t(e[i],i,e))&&(a+=r);return a},e.ticks=function(e,t,r){var n,i,a,o,s=-1;if(r=+r,(e=+e)==(t=+t)&&r>0)return[e];if((n=t<e)&&(i=e,e=t,t=i),0===(o=_(e,t,r))||!isFinite(o))return[];if(o>0)for(e=Math.ceil(e/o),t=Math.floor(t/o),a=new Array(i=Math.ceil(t-e+1));++s<i;)a[s]=(e+s)*o;else for(e=Math.floor(e*o),t=Math.ceil(t*o),a=new Array(i=Math.ceil(e-t+1));++s<i;)a[s]=(e-s)/o;return n&&a.reverse(),a},e.tickIncrement=_,e.tickStep=b,e.transpose=A,e.variance=l,e.zip=function(){return A(arguments)},Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof e&&typeof t<"u"?e:r.d3=r.d3||{})}}),Cg=m({"node_modules/d3-geo/dist/d3-geo.js"(e,t){var r,n;r=e,n=function(e,t){function r(){return new n}function n(){this.reset()}n.prototype={constructor:n,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 n;function a(e,t,r){var n=e.s=t+r,i=n-t,a=n-i;e.t=t-a+(r-i)}var o=1e-6,s=1e-12,l=Math.PI,c=l/2,u=l/4,h=2*l,f=180/l,p=l/180,d=Math.abs,m=Math.atan,g=Math.atan2,y=Math.cos,v=Math.ceil,x=Math.exp,_=Math.log,b=Math.pow,w=Math.sin,T=Math.sign||function(e){return e>0?1:e<0?-1:0},k=Math.sqrt,A=Math.tan;function M(e){return e>1?0:e<-1?l:Math.acos(e)}function S(e){return e>1?c:e<-1?-c:Math.asin(e)}function E(e){return(e=w(e/2))*e}function C(){}function I(e,t){e&&P.hasOwnProperty(e.type)&&P[e.type](e,t)}var L={Feature:function(e,t){I(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,i=r.length;++n<i;)I(r[n].geometry,t)}},P={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 r=e.coordinates,n=-1,i=r.length;++n<i;)e=r[n],t.point(e[0],e[1],e[2])},LineString:function(e,t){z(e.coordinates,t,0)},MultiLineString:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)z(r[n],t,0)},Polygon:function(e,t){D(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)D(r[n],t)},GeometryCollection:function(e,t){for(var r=e.geometries,n=-1,i=r.length;++n<i;)I(r[n],t)}};function z(e,t,r){var n,i=-1,a=e.length-r;for(t.lineStart();++i<a;)n=e[i],t.point(n[0],n[1],n[2]);t.lineEnd()}function D(e,t){var r=-1,n=e.length;for(t.polygonStart();++r<n;)z(e[r],t,1);t.polygonEnd()}function O(e,t){e&&L.hasOwnProperty(e.type)?L[e.type](e,t):I(e,t)}var R,F,B,j,N,U=r(),V=r(),q={point:C,lineStart:C,lineEnd:C,polygonStart:function(){U.reset(),q.lineStart=H,q.lineEnd=G},polygonEnd:function(){var e=+U;V.add(e<0?h+e:e),this.lineStart=this.lineEnd=this.point=C},sphere:function(){V.add(h)}};function H(){q.point=W}function G(){Z(R,F)}function W(e,t){q.point=Z,R=e,F=t,B=e*=p,j=y(t=(t*=p)/2+u),N=w(t)}function Z(e,t){var r=(e*=p)-B,n=r>=0?1:-1,i=n*r,a=y(t=(t*=p)/2+u),o=w(t),s=N*o,l=j*a+s*y(i),c=s*n*w(i);U.add(g(c,l)),B=e,j=a,N=o}function Y(e){return[g(e[1],e[0]),S(e[2])]}function X(e){var t=e[0],r=e[1],n=y(r);return[n*y(t),n*w(t),w(r)]}function $(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function K(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 J(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Q(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function ee(e){var t=k(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var te,re,ne,ie,ae,oe,se,le,ce,ue,he=r(),fe={point:pe,lineStart:me,lineEnd:ge,polygonStart:function(){fe.point=ye,fe.lineStart=ve,fe.lineEnd=xe,he.reset(),q.polygonStart()},polygonEnd:function(){q.polygonEnd(),fe.point=pe,fe.lineStart=me,fe.lineEnd=ge,U<0?(te=-(ne=180),re=-(ie=90)):he>o?ie=90:he<-o&&(re=-90),ue[0]=te,ue[1]=ne},sphere:function(){te=-(ne=180),re=-(ie=90)}};function pe(e,t){ce.push(ue=[te=e,ne=e]),t<re&&(re=t),t>ie&&(ie=t)}function de(e,t){var r=X([e*p,t*p]);if(le){var n=K(le,r),i=K([n[1],-n[0],0],n);ee(i),i=Y(i);var a,o=e-ae,s=o>0?1:-1,l=i[0]*f*s,c=d(o)>180;c^(s*ae<l&&l<s*e)?(a=i[1]*f)>ie&&(ie=a):c^(s*ae<(l=(l+360)%360-180)&&l<s*e)?(a=-i[1]*f)<re&&(re=a):(t<re&&(re=t),t>ie&&(ie=t)),c?e<ae?_e(te,e)>_e(te,ne)&&(ne=e):_e(e,ne)>_e(te,ne)&&(te=e):ne>=te?(e<te&&(te=e),e>ne&&(ne=e)):e>ae?_e(te,e)>_e(te,ne)&&(ne=e):_e(e,ne)>_e(te,ne)&&(te=e)}else ce.push(ue=[te=e,ne=e]);t<re&&(re=t),t>ie&&(ie=t),le=r,ae=e}function me(){fe.point=de}function ge(){ue[0]=te,ue[1]=ne,fe.point=pe,le=null}function ye(e,t){if(le){var r=e-ae;he.add(d(r)>180?r+(r>0?360:-360):r)}else oe=e,se=t;q.point(e,t),de(e,t)}function ve(){q.lineStart()}function xe(){ye(oe,se),q.lineEnd(),d(he)>o&&(te=-(ne=180)),ue[0]=te,ue[1]=ne,le=null}function _e(e,t){return(t-=e)<0?t+360:t}function be(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}var Te,ke,Ae,Me,Se,Ee,Ce,Ie,Le,Pe,ze,De,Oe,Re,Fe,Be,je={sphere:C,point:Ne,lineStart:Ve,lineEnd:Ge,polygonStart:function(){je.lineStart=We,je.lineEnd=Ze},polygonEnd:function(){je.lineStart=Ve,je.lineEnd=Ge}};function Ne(e,t){e*=p;var r=y(t*=p);Ue(r*y(e),r*w(e),w(t))}function Ue(e,t,r){++Te,Ae+=(e-Ae)/Te,Me+=(t-Me)/Te,Se+=(r-Se)/Te}function Ve(){je.point=qe}function qe(e,t){e*=p;var r=y(t*=p);Re=r*y(e),Fe=r*w(e),Be=w(t),je.point=He,Ue(Re,Fe,Be)}function He(e,t){e*=p;var r=y(t*=p),n=r*y(e),i=r*w(e),a=w(t),o=g(k((o=Fe*a-Be*i)*o+(o=Be*n-Re*a)*o+(o=Re*i-Fe*n)*o),Re*n+Fe*i+Be*a);ke+=o,Ee+=o*(Re+(Re=n)),Ce+=o*(Fe+(Fe=i)),Ie+=o*(Be+(Be=a)),Ue(Re,Fe,Be)}function Ge(){je.point=Ne}function We(){je.point=Ye}function Ze(){Xe(De,Oe),je.point=Ne}function Ye(e,t){De=e,Oe=t,e*=p,t*=p,je.point=Xe;var r=y(t);Re=r*y(e),Fe=r*w(e),Be=w(t),Ue(Re,Fe,Be)}function Xe(e,t){e*=p;var r=y(t*=p),n=r*y(e),i=r*w(e),a=w(t),o=Fe*a-Be*i,s=Be*n-Re*a,l=Re*i-Fe*n,c=k(o*o+s*s+l*l),u=S(c),h=c&&-u/c;Le+=h*o,Pe+=h*s,ze+=h*l,ke+=u,Ee+=u*(Re+(Re=n)),Ce+=u*(Fe+(Fe=i)),Ie+=u*(Be+(Be=a)),Ue(Re,Fe,Be)}function $e(e){return function(){return e}}function Ke(e,t){function r(r,n){return r=e(r,n),t(r[0],r[1])}return e.invert&&t.invert&&(r.invert=function(r,n){return(r=t.invert(r,n))&&e.invert(r[0],r[1])}),r}function Je(e,t){return[d(e)>l?e+Math.round(-e/h)*h:e,t]}function Qe(e,t,r){return(e%=h)?t||r?Ke(tt(e),rt(t,r)):tt(e):t||r?rt(t,r):Je}function et(e){return function(t,r){return[(t+=e)>l?t-h:t<-l?t+h:t,r]}}function tt(e){var t=et(e);return t.invert=et(-e),t}function rt(e,t){var r=y(e),n=w(e),i=y(t),a=w(t);function o(e,t){var o=y(t),s=y(e)*o,l=w(e)*o,c=w(t),u=c*r+s*n;return[g(l*i-u*a,s*r-c*n),S(u*i+l*a)]}return o.invert=function(e,t){var o=y(t),s=y(e)*o,l=w(e)*o,c=w(t),u=c*i-l*a;return[g(l*i+c*a,s*r+u*n),S(u*r-s*n)]},o}function nt(e){function t(t){return(t=e(t[0]*p,t[1]*p))[0]*=f,t[1]*=f,t}return e=Qe(e[0]*p,e[1]*p,e.length>2?e[2]*p:0),t.invert=function(t){return(t=e.invert(t[0]*p,t[1]*p))[0]*=f,t[1]*=f,t},t}function it(e,t,r,n,i,a){if(r){var o=y(t),s=w(t),l=n*r;null==i?(i=t+n*h,a=t-l/2):(i=at(o,i),a=at(o,a),(n>0?i<a:i>a)&&(i+=n*h));for(var c,u=i;n>0?u>a:u<a;u-=l)c=Y([o,-s*y(u),-s*w(u)]),e.point(c[0],c[1])}}function at(e,t){(t=X(t))[0]-=e,ee(t);var r=M(-t[1]);return((-t[2]<0?-r:r)+h-o)%h}function ot(){var e,t=[];return{point:function(t,r,n){e.push([t,r,n])},lineStart:function(){t.push(e=[])},lineEnd:C,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],e=null,r}}}function st(e,t){return d(e[0]-t[0])<o&&d(e[1]-t[1])<o}function lt(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function ct(e,t,r,n,i){var a,s,l=[],c=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,r,n=e[0],s=e[t];if(st(n,s)){if(!n[2]&&!s[2]){for(i.lineStart(),a=0;a<t;++a)i.point((n=e[a])[0],n[1]);return void i.lineEnd()}s[0]+=2*o}l.push(r=new lt(n,e,null,!0)),c.push(r.o=new lt(n,null,r,!1)),l.push(r=new lt(s,e,null,!1)),c.push(r.o=new lt(s,null,r,!0))}})),l.length){for(c.sort(t),ut(l),ut(c),a=0,s=c.length;a<s;++a)c[a].e=r=!r;for(var u,h,f=l[0];;){for(var p=f,d=!0;p.v;)if((p=p.n)===f)return;u=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(a=0,s=u.length;a<s;++a)i.point((h=u[a])[0],h[1]);else n(p.x,p.n.x,1,i);p=p.n}else{if(d)for(u=p.p.z,a=u.length-1;a>=0;--a)i.point((h=u[a])[0],h[1]);else n(p.x,p.p.x,-1,i);p=p.p}u=(p=p.o).z,d=!d}while(!p.v);i.lineEnd()}}}function ut(e){if(t=e.length){for(var t,r,n=0,i=e[0];++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}Je.invert=Je;var ht=r();function ft(e){return d(e[0])<=l?e[0]:T(e[0])*((d(e[0])+l)%h-l)}function pt(e,t){var r=ft(t),n=t[1],i=w(n),a=[w(r),-y(r),0],s=0,f=0;ht.reset(),1===i?n=c+o:-1===i&&(n=-c-o);for(var p=0,d=e.length;p<d;++p)if(v=(m=e[p]).length)for(var m,v,x=m[v-1],_=ft(x),b=x[1]/2+u,T=w(b),k=y(b),A=0;A<v;++A,_=E,T=I,k=L,x=M){var M=m[A],E=ft(M),C=M[1]/2+u,I=w(C),L=y(C),P=E-_,z=P>=0?1:-1,D=z*P,O=D>l,R=T*I;if(ht.add(g(R*z*w(D),k*L+R*y(D))),s+=O?P+z*h:P,O^_>=r^E>=r){var F=K(X(x),X(M));ee(F);var B=K(a,F);ee(B);var j=(O^P>=0?-1:1)*S(B[2]);(n>j||n===j&&(F[0]||F[1]))&&(f+=O^P>=0?1:-1)}}return(s<-o||s<o&&ht<-o)^1&f}function dt(e,r,n,i){return function(a){var o,s,l,c=r(a),u=ot(),h=r(u),f=!1,p={point:d,lineStart:g,lineEnd:y,polygonStart:function(){p.point=v,p.lineStart=x,p.lineEnd=_,s=[],o=[]},polygonEnd:function(){p.point=d,p.lineStart=g,p.lineEnd=y,s=t.merge(s);var e=pt(o,i);s.length?(f||(a.polygonStart(),f=!0),ct(s,gt,e,n,a)):e&&(f||(a.polygonStart(),f=!0),a.lineStart(),n(null,null,1,a),a.lineEnd()),f&&(a.polygonEnd(),f=!1),s=o=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}};function d(t,r){e(t,r)&&a.point(t,r)}function m(e,t){c.point(e,t)}function g(){p.point=m,c.lineStart()}function y(){p.point=d,c.lineEnd()}function v(e,t){l.push([e,t]),h.point(e,t)}function x(){h.lineStart(),l=[]}function _(){v(l[0][0],l[0][1]),h.lineEnd();var e,t,r,n,i=h.clean(),c=u.result(),p=c.length;if(l.pop(),o.push(l),l=null,p){if(1&i){if((t=(r=c[0]).length-1)>0){for(f||(a.polygonStart(),f=!0),a.lineStart(),e=0;e<t;++e)a.point((n=r[e])[0],n[1]);a.lineEnd()}return}p>1&&2&i&&c.push(c.pop().concat(c.shift())),s.push(c.filter(mt))}}return p}}function mt(e){return e.length>1}function gt(e,t){return((e=e.x)[0]<0?e[1]-c-o:c-e[1])-((t=t.x)[0]<0?t[1]-c-o:c-t[1])}var yt=dt((function(){return!0}),(function(e){var t,r=NaN,n=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(a,s){var u=a>0?l:-l,h=d(a-r);d(h-l)<o?(e.point(r,n=(n+s)/2>0?c:-c),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(u,n),e.point(a,n),t=0):i!==u&&h>=l&&(d(r-i)<o&&(r-=i*o),d(a-u)<o&&(a-=u*o),n=function(e,t,r,n){var i,a,s=w(e-r);return d(s)>o?m((w(t)*(a=y(n))*w(r)-w(n)*(i=y(t))*w(e))/(i*a*s)):(t+n)/2}(r,n,a,s),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(u,n),t=0),e.point(r=a,n=s),i=u},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}}),(function(e,t,r,n){var i;if(null==e)i=r*c,n.point(-l,i),n.point(0,i),n.point(l,i),n.point(l,0),n.point(l,-i),n.point(0,-i),n.point(-l,-i),n.point(-l,0),n.point(-l,i);else if(d(e[0]-t[0])>o){var a=e[0]<t[0]?l:-l;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(t[0],t[1])}),[-l,-c]);function vt(e){var t=y(e),r=6*p,n=t>0,i=d(t)>o;function a(e,r){return y(e)*y(r)>t}function s(e,r,n){var i=[1,0,0],a=K(X(e),X(r)),s=$(a,a),c=a[0],u=s-c*c;if(!u)return!n&&e;var h=t*s/u,f=-t*c/u,p=K(i,a),m=Q(i,h);J(m,Q(a,f));var g=p,y=$(m,g),v=$(g,g),x=y*y-v*($(m,m)-1);if(!(x<0)){var _=k(x),b=Q(g,(-y-_)/v);if(J(b,m),b=Y(b),!n)return b;var w,T=e[0],A=r[0],M=e[1],S=r[1];A<T&&(w=T,T=A,A=w);var E=A-T,C=d(E-l)<o;if(!C&&S<M&&(w=M,M=S,S=w),C||E<o?C?M+S>0^b[1]<(d(b[0]-T)<o?M:S):M<=b[1]&&b[1]<=S:E>l^(T<=b[0]&&b[0]<=A)){var I=Q(g,(-y+_)/v);return J(I,m),[b,Y(I)]}}}function c(t,r){var i=n?e:l-e,a=0;return t<-i?a|=1:t>i&&(a|=2),r<-i?a|=4:r>i&&(a|=8),a}return dt(a,(function(e){var t,r,o,u,h;return{lineStart:function(){u=o=!1,h=1},point:function(f,p){var d,m=[f,p],g=a(f,p),y=n?g?0:c(f,p):g?c(f+(f<0?l:-l),p):0;if(!t&&(u=o=g)&&e.lineStart(),g!==o&&(!(d=s(t,m))||st(t,d)||st(m,d))&&(m[2]=1),g!==o)h=0,g?(e.lineStart(),d=s(m,t),e.point(d[0],d[1])):(d=s(t,m),e.point(d[0],d[1],2),e.lineEnd()),t=d;else if(i&&t&&n^g){var v;!(y&r)&&(v=s(m,t,!0))&&(h=0,n?(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||!st(t,m))&&e.point(m[0],m[1]),t=m,o=g,r=y},lineEnd:function(){o&&e.lineEnd(),t=null},clean:function(){return h|(u&&o)<<1}}}),(function(t,n,i,a){it(a,e,r,i,t,n)}),n?[0,-e]:[-l,e-l])}var xt=1e9,_t=-xt;function bt(e,r,n,i){function a(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function s(t,a,o,s){var c=0,h=0;if(null==t||(c=l(t,o))!==(h=l(a,o))||u(t,a)<0^o>0)do{s.point(0===c||3===c?e:n,c>1?i:r)}while((c=(c+o+4)%4)!==h);else s.point(a[0],a[1])}function l(t,i){return d(t[0]-e)<o?i>0?0:3:d(t[0]-n)<o?i>0?2:1:d(t[1]-r)<o?i>0?1:0:i>0?3:2}function c(e,t){return u(e.x,t.x)}function u(e,t){var r=l(e,1),n=l(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}return function(o){var l,u,h,f,p,d,m,g,y,v,x,_=o,b=ot(),w={point:T,lineStart:function(){w.point=k,u&&u.push(h=[]),v=!0,y=!1,m=g=NaN},lineEnd:function(){l&&(k(f,p),d&&y&&b.rejoin(),l.push(b.result())),w.point=T,y&&_.lineEnd()},polygonStart:function(){_=b,l=[],u=[],x=!0},polygonEnd:function(){var r=function(){for(var t=0,r=0,n=u.length;r<n;++r)for(var a,o,s=u[r],l=1,c=s.length,h=s[0],f=h[0],p=h[1];l<c;++l)a=f,o=p,f=(h=s[l])[0],p=h[1],o<=i?p>i&&(f-a)*(i-o)>(p-o)*(e-a)&&++t:p<=i&&(f-a)*(i-o)<(p-o)*(e-a)&&--t;return t}(),n=x&&r,a=(l=t.merge(l)).length;(n||a)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),a&&ct(l,c,r,s,o),o.polygonEnd()),_=o,l=u=h=null}};function T(e,t){a(e,t)&&_.point(e,t)}function k(t,o){var s=a(t,o);if(u&&h.push([t,o]),v)f=t,p=o,d=s,v=!1,s&&(_.lineStart(),_.point(t,o));else if(s&&y)_.point(t,o);else{var l=[m=Math.max(_t,Math.min(xt,m)),g=Math.max(_t,Math.min(xt,g))],c=[t=Math.max(_t,Math.min(xt,t)),o=Math.max(_t,Math.min(xt,o))];!function(e,t,r,n,i,a){var o,s=e[0],l=e[1],c=0,u=1,h=t[0]-s,f=t[1]-l;if(o=r-s,h||!(o>0)){if(o/=h,h<0){if(o<c)return;o<u&&(u=o)}else if(h>0){if(o>u)return;o>c&&(c=o)}if(o=i-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o<c)return;o<u&&(u=o)}if(o=n-l,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<u&&(u=o)}else if(f>0){if(o>u)return;o>c&&(c=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<u&&(u=o)}return c>0&&(e[0]=s+c*h,e[1]=l+c*f),u<1&&(t[0]=s+u*h,t[1]=l+u*f),!0}}}}}(l,c,e,r,n,i)?s&&(_.lineStart(),_.point(t,o),x=!1):(y||(_.lineStart(),_.point(l[0],l[1])),_.point(c[0],c[1]),s||_.lineEnd(),x=!1)}m=t,g=o,y=s}return w}}var wt,Tt,kt,At=r(),Mt={sphere:C,point:C,lineStart:function(){Mt.point=Et,Mt.lineEnd=St},lineEnd:C,polygonStart:C,polygonEnd:C};function St(){Mt.point=Mt.lineEnd=C}function Et(e,t){wt=e*=p,Tt=w(t*=p),kt=y(t),Mt.point=Ct}function Ct(e,t){e*=p;var r=w(t*=p),n=y(t),i=d(e-wt),a=y(i),o=n*w(i),s=kt*r-Tt*n*a,l=Tt*r+kt*n*a;At.add(g(k(o*o+s*s),l)),wt=e,Tt=r,kt=n}function It(e){return At.reset(),O(e,Mt),+At}var Lt=[null,null],Pt={type:"LineString",coordinates:Lt};function zt(e,t){return Lt[0]=e,Lt[1]=t,It(Pt)}var Dt={Feature:function(e,t){return Rt(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,i=r.length;++n<i;)if(Rt(r[n].geometry,t))return!0;return!1}},Ot={Sphere:function(){return!0},Point:function(e,t){return Ft(e.coordinates,t)},MultiPoint:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)if(Ft(r[n],t))return!0;return!1},LineString:function(e,t){return Bt(e.coordinates,t)},MultiLineString:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)if(Bt(r[n],t))return!0;return!1},Polygon:function(e,t){return jt(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)if(jt(r[n],t))return!0;return!1},GeometryCollection:function(e,t){for(var r=e.geometries,n=-1,i=r.length;++n<i;)if(Rt(r[n],t))return!0;return!1}};function Rt(e,t){return!(!e||!Ot.hasOwnProperty(e.type))&&Ot[e.type](e,t)}function Ft(e,t){return 0===zt(e,t)}function Bt(e,t){for(var r,n,i,a=0,o=e.length;a<o;a++){if(0===(n=zt(e[a],t))||a>0&&(i=zt(e[a],e[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))<s*i)return!0;r=n}return!1}function jt(e,t){return!!pt(e.map(Nt),Ut(t))}function Nt(e){return(e=e.map(Ut)).pop(),e}function Ut(e){return[e[0]*p,e[1]*p]}function Vt(e,r,n){var i=t.range(e,r-o,n).concat(r);return function(e){return i.map((function(t){return[e,t]}))}}function qt(e,r,n){var i=t.range(e,r-o,n).concat(r);return function(e){return i.map((function(t){return[t,e]}))}}function Ht(){var e,r,n,i,a,s,l,c,u,h,f,p,m=10,g=m,y=90,x=360,_=2.5;function b(){return{type:"MultiLineString",coordinates:w()}}function w(){return t.range(v(i/y)*y,n,y).map(f).concat(t.range(v(c/x)*x,l,x).map(p)).concat(t.range(v(r/m)*m,e,m).filter((function(e){return d(e%y)>o})).map(u)).concat(t.range(v(s/g)*g,a,g).filter((function(e){return d(e%x)>o})).map(h))}return b.lines=function(){return w().map((function(e){return{type:"LineString",coordinates:e}}))},b.outline=function(){return{type:"Polygon",coordinates:[f(i).concat(p(l).slice(1),f(n).reverse().slice(1),p(c).reverse().slice(1))]}},b.extent=function(e){return arguments.length?b.extentMajor(e).extentMinor(e):b.extentMinor()},b.extentMajor=function(e){return arguments.length?(i=+e[0][0],n=+e[1][0],c=+e[0][1],l=+e[1][1],i>n&&(e=i,i=n,n=e),c>l&&(e=c,c=l,l=e),b.precision(_)):[[i,c],[n,l]]},b.extentMinor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],s=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),s>a&&(t=s,s=a,a=t),b.precision(_)):[[r,s],[e,a]]},b.step=function(e){return arguments.length?b.stepMajor(e).stepMinor(e):b.stepMinor()},b.stepMajor=function(e){return arguments.length?(y=+e[0],x=+e[1],b):[y,x]},b.stepMinor=function(e){return arguments.length?(m=+e[0],g=+e[1],b):[m,g]},b.precision=function(t){return arguments.length?(_=+t,u=Vt(s,a,90),h=qt(r,e,_),f=Vt(c,l,90),p=qt(i,n,_),b):_},b.extentMajor([[-180,-90+o],[180,90-o]]).extentMinor([[-180,-80-o],[180,80+o]])}function Gt(e){return e}var Wt,Zt,Yt,Xt,$t=r(),Kt=r(),Jt={point:C,lineStart:C,lineEnd:C,polygonStart:function(){Jt.lineStart=Qt,Jt.lineEnd=rr},polygonEnd:function(){Jt.lineStart=Jt.lineEnd=Jt.point=C,$t.add(d(Kt)),Kt.reset()},result:function(){var e=$t/2;return $t.reset(),e}};function Qt(){Jt.point=er}function er(e,t){Jt.point=tr,Wt=Yt=e,Zt=Xt=t}function tr(e,t){Kt.add(Xt*e-Yt*t),Yt=e,Xt=t}function rr(){tr(Wt,Zt)}var nr,ir,ar,or,sr=1/0,lr=sr,cr=-sr,ur=cr,hr={point:function(e,t){e<sr&&(sr=e),e>cr&&(cr=e),t<lr&&(lr=t),t>ur&&(ur=t)},lineStart:C,lineEnd:C,polygonStart:C,polygonEnd:C,result:function(){var e=[[sr,lr],[cr,ur]];return cr=ur=-(lr=sr=1/0),e}},fr=0,pr=0,dr=0,mr=0,gr=0,yr=0,vr=0,xr=0,_r=0,br={point:wr,lineStart:Tr,lineEnd:Mr,polygonStart:function(){br.lineStart=Sr,br.lineEnd=Er},polygonEnd:function(){br.point=wr,br.lineStart=Tr,br.lineEnd=Mr},result:function(){var e=_r?[vr/_r,xr/_r]:yr?[mr/yr,gr/yr]:dr?[fr/dr,pr/dr]:[NaN,NaN];return fr=pr=dr=mr=gr=yr=vr=xr=_r=0,e}};function wr(e,t){fr+=e,pr+=t,++dr}function Tr(){br.point=kr}function kr(e,t){br.point=Ar,wr(ar=e,or=t)}function Ar(e,t){var r=e-ar,n=t-or,i=k(r*r+n*n);mr+=i*(ar+e)/2,gr+=i*(or+t)/2,yr+=i,wr(ar=e,or=t)}function Mr(){br.point=wr}function Sr(){br.point=Cr}function Er(){Ir(nr,ir)}function Cr(e,t){br.point=Ir,wr(nr=ar=e,ir=or=t)}function Ir(e,t){var r=e-ar,n=t-or,i=k(r*r+n*n);mr+=i*(ar+e)/2,gr+=i*(or+t)/2,yr+=i,vr+=(i=or*e-ar*t)*(ar+e),xr+=i*(or+t),_r+=3*i,wr(ar=e,or=t)}function Lr(e){this._context=e}Lr.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,h)}},result:C};var Pr,zr,Dr,Or,Rr,Fr=r(),Br={point:C,lineStart:function(){Br.point=jr},lineEnd:function(){Pr&&Nr(zr,Dr),Br.point=C},polygonStart:function(){Pr=!0},polygonEnd:function(){Pr=null},result:function(){var e=+Fr;return Fr.reset(),e}};function jr(e,t){Br.point=Nr,zr=Or=e,Dr=Rr=t}function Nr(e,t){Or-=e,Rr-=t,Fr.add(k(Or*Or+Rr*Rr)),Or=e,Rr=t}function Ur(){this._string=[]}function Vr(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function qr(e){return function(t){var r=new Hr;for(var n in e)r[n]=e[n];return r.stream=t,r}}function Hr(){}function Gr(e,t,r){var n=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=n&&e.clipExtent(null),O(r,e.stream(hr)),t(hr.result()),null!=n&&e.clipExtent(n),e}function Wr(e,t,r){return Gr(e,(function(r){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),o=+t[0][0]+(n-a*(r[1][0]+r[0][0]))/2,s=+t[0][1]+(i-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,s])}),r)}function Zr(e,t,r){return Wr(e,[[0,0],t],r)}function Yr(e,t,r){return Gr(e,(function(r){var n=+t,i=n/(r[1][0]-r[0][0]),a=(n-i*(r[1][0]+r[0][0]))/2,o=-i*r[0][1];e.scale(150*i).translate([a,o])}),r)}function Xr(e,t,r){return Gr(e,(function(r){var n=+t,i=n/(r[1][1]-r[0][1]),a=-i*r[0][0],o=(n-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([a,o])}),r)}Ur.prototype={_radius:4.5,_circle:Vr(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(){0===this._line&&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:null==this._circle&&(this._circle=Vr(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}return null}},Hr.prototype={constructor:Hr,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var $r=y(30*p);function Kr(e,t){return+t?function(e,t){function r(n,i,a,s,l,c,u,h,f,p,m,y,v,x){var _=u-n,b=h-i,w=_*_+b*b;if(w>4*t&&v--){var T=s+p,A=l+m,M=c+y,E=k(T*T+A*A+M*M),C=S(M/=E),I=d(d(M)-1)<o||d(a-f)<o?(a+f)/2:g(A,T),L=e(I,C),P=L[0],z=L[1],D=P-n,O=z-i,R=b*D-_*O;(R*R/w>t||d((_*D+b*O)/w-.5)>.3||s*p+l*m+c*y<$r)&&(r(n,i,a,s,l,c,P,z,I,T/=E,A/=E,M,v,x),x.point(P,z),r(P,z,I,T,A,M,u,h,f,p,m,y,v,x))}}return function(t){var n,i,a,o,s,l,c,u,h,f,p,d,m={point:g,lineStart:y,lineEnd:x,polygonStart:function(){t.polygonStart(),m.lineStart=_},polygonEnd:function(){t.polygonEnd(),m.lineStart=y}};function g(r,n){r=e(r,n),t.point(r[0],r[1])}function y(){u=NaN,m.point=v,t.lineStart()}function v(n,i){var a=X([n,i]),o=e(n,i);r(u,h,c,f,p,d,u=o[0],h=o[1],c=n,f=a[0],p=a[1],d=a[2],16,t),t.point(u,h)}function x(){m.point=g,t.lineEnd()}function _(){y(),m.point=b,m.lineEnd=w}function b(e,t){v(n=e,t),i=u,a=h,o=f,s=p,l=d,m.point=v}function w(){r(u,h,c,f,p,d,i,a,n,o,s,l,16,t),m.lineEnd=x,x()}return m}}(e,t):function(e){return qr({point:function(t,r){t=e(t,r),this.stream.point(t[0],t[1])}})}(e)}var Jr=qr({point:function(e,t){this.stream.point(e*p,t*p)}});function Qr(e,t,r,n,i){function a(a,o){return[t+e*(a*=n),r-e*(o*=i)]}return a.invert=function(a,o){return[(a-t)/e*n,(r-o)/e*i]},a}function en(e,t,r,n,i,a){var o=y(a),s=w(a),l=o*e,c=s*e,u=o/e,h=s/e,f=(s*r-o*t)/e,p=(s*t+o*r)/e;function d(e,a){return[l*(e*=n)-c*(a*=i)+t,r-c*e-l*a]}return d.invert=function(e,t){return[n*(u*e-h*t+f),i*(p-h*e-u*t)]},d}function tn(e){return rn((function(){return e}))()}function rn(e){var t,r,n,i,a,o,s,l,c,u,h=150,d=480,m=250,g=0,y=0,v=0,x=0,_=0,b=0,w=1,T=1,A=null,M=yt,S=null,E=Gt,C=.5;function I(e){return l(e[0]*p,e[1]*p)}function L(e){return(e=l.invert(e[0],e[1]))&&[e[0]*f,e[1]*f]}function P(){var e=en(h,0,0,w,T,b).apply(null,t(g,y)),n=(b?en:Qr)(h,d-e[0],m-e[1],w,T,b);return r=Qe(v,x,_),s=Ke(t,n),l=Ke(r,s),o=Kr(s,C),z()}function z(){return c=u=null,I}return I.stream=function(e){return c&&u===e?c:c=Jr(function(e){return qr({point:function(t,r){var n=e(t,r);return this.stream.point(n[0],n[1])}})}(r)(M(o(E(u=e)))))},I.preclip=function(e){return arguments.length?(M=e,A=void 0,z()):M},I.postclip=function(e){return arguments.length?(E=e,S=n=i=a=null,z()):E},I.clipAngle=function(e){return arguments.length?(M=+e?vt(A=e*p):(A=null,yt),z()):A*f},I.clipExtent=function(e){return arguments.length?(E=null==e?(S=n=i=a=null,Gt):bt(S=+e[0][0],n=+e[0][1],i=+e[1][0],a=+e[1][1]),z()):null==S?null:[[S,n],[i,a]]},I.scale=function(e){return arguments.length?(h=+e,P()):h},I.translate=function(e){return arguments.length?(d=+e[0],m=+e[1],P()):[d,m]},I.center=function(e){return arguments.length?(g=e[0]%360*p,y=e[1]%360*p,P()):[g*f,y*f]},I.rotate=function(e){return arguments.length?(v=e[0]%360*p,x=e[1]%360*p,_=e.length>2?e[2]%360*p:0,P()):[v*f,x*f,_*f]},I.angle=function(e){return arguments.length?(b=e%360*p,P()):b*f},I.reflectX=function(e){return arguments.length?(w=e?-1:1,P()):w<0},I.reflectY=function(e){return arguments.length?(T=e?-1:1,P()):T<0},I.precision=function(e){return arguments.length?(o=Kr(s,C=e*e),z()):k(C)},I.fitExtent=function(e,t){return Wr(I,e,t)},I.fitSize=function(e,t){return Zr(I,e,t)},I.fitWidth=function(e,t){return Yr(I,e,t)},I.fitHeight=function(e,t){return Xr(I,e,t)},function(){return t=e.apply(this,arguments),I.invert=t.invert&&L,P()}}function nn(e){var t=0,r=l/3,n=rn(e),i=n(t,r);return i.parallels=function(e){return arguments.length?n(t=e[0]*p,r=e[1]*p):[t*f,r*f]},i}function an(e,t){var r=w(e),n=(r+w(t))/2;if(d(n)<o)return function(e){var t=y(e);function r(e,r){return[e*t,w(r)/t]}return r.invert=function(e,r){return[e/t,S(r*t)]},r}(e);var i=1+r*(2*n-r),a=k(i)/n;function s(e,t){var r=k(i-2*n*w(t))/n;return[r*w(e*=n),a-r*y(e)]}return s.invert=function(e,t){var r=a-t,o=g(e,d(r))*T(r);return r*n<0&&(o-=l*T(e)*T(r)),[o/n,S((i-(e*e+r*r)*n*n)/(2*n))]},s}function on(){return nn(an).scale(155.424).center([0,33.6442])}function sn(){return on().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function ln(e){return function(t,r){var n=y(t),i=y(r),a=e(n*i);return[a*i*w(t),a*w(r)]}}function cn(e){return function(t,r){var n=k(t*t+r*r),i=e(n),a=w(i),o=y(i);return[g(t*a,n*o),S(n&&r*a/n)]}}var un=ln((function(e){return k(2/(1+e))}));un.invert=cn((function(e){return 2*S(e/2)}));var hn=ln((function(e){return(e=M(e))&&e/w(e)}));function fn(e,t){return[e,_(A((c+t)/2))]}function pn(e){var t,r,n,i=tn(e),a=i.center,o=i.scale,s=i.translate,c=i.clipExtent,u=null;function h(){var a=l*o(),s=i(nt(i.rotate()).invert([0,0]));return c(null==u?[[s[0]-a,s[1]-a],[s[0]+a,s[1]+a]]:e===fn?[[Math.max(s[0]-a,u),t],[Math.min(s[0]+a,r),n]]:[[u,Math.max(s[1]-a,t)],[r,Math.min(s[1]+a,n)]])}return i.scale=function(e){return arguments.length?(o(e),h()):o()},i.translate=function(e){return arguments.length?(s(e),h()):s()},i.center=function(e){return arguments.length?(a(e),h()):a()},i.clipExtent=function(e){return arguments.length?(null==e?u=t=r=n=null:(u=+e[0][0],t=+e[0][1],r=+e[1][0],n=+e[1][1]),h()):null==u?null:[[u,t],[r,n]]},h()}function dn(e){return A((c+e)/2)}function mn(e,t){var r=y(e),n=e===t?w(e):_(r/y(t))/_(dn(t)/dn(e)),i=r*b(dn(e),n)/n;if(!n)return fn;function a(e,t){i>0?t<-c+o&&(t=-c+o):t>c-o&&(t=c-o);var r=i/b(dn(t),n);return[r*w(n*e),i-r*y(n*e)]}return a.invert=function(e,t){var r=i-t,a=T(n)*k(e*e+r*r),o=g(e,d(r))*T(r);return r*n<0&&(o-=l*T(e)*T(r)),[o/n,2*m(b(i/a,1/n))-c]},a}function gn(e,t){return[e,t]}function yn(e,t){var r=y(e),n=e===t?w(e):(r-y(t))/(t-e),i=r/n+e;if(d(n)<o)return gn;function a(e,t){var r=i-t,a=n*e;return[r*w(a),i-r*y(a)]}return a.invert=function(e,t){var r=i-t,a=g(e,d(r))*T(r);return r*n<0&&(a-=l*T(e)*T(r)),[a/n,i-T(n)*k(e*e+r*r)]},a}hn.invert=cn((function(e){return e})),fn.invert=function(e,t){return[e,2*m(x(t))-c]},gn.invert=gn;var vn=1.340264,xn=-.081106,_n=893e-6,bn=.003796,wn=k(3)/2;function Tn(e,t){var r=S(wn*w(t)),n=r*r,i=n*n*n;return[e*y(r)/(wn*(vn+3*xn*n+i*(7*_n+9*bn*n))),r*(vn+xn*n+i*(_n+bn*n))]}function kn(e,t){var r=y(t),n=y(e)*r;return[r*w(e)/n,w(t)/n]}function An(e,t){var r=t*t,n=r*r;return[e*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),t*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function Mn(e,t){return[y(t)*w(e),w(t)]}function Sn(e,t){var r=y(t),n=1+y(e)*r;return[r*w(e)/n,w(t)/n]}function En(e,t){return[_(A((c+t)/2)),-e]}Tn.invert=function(e,t){for(var r,n=t,i=n*n,a=i*i*i,o=0;o<12&&(a=(i=(n-=r=(n*(vn+xn*i+a*(_n+bn*i))-t)/(vn+3*xn*i+a*(7*_n+9*bn*i)))*n)*i*i,!(d(r)<s));++o);return[wn*e*(vn+3*xn*i+a*(7*_n+9*bn*i))/y(n),S(w(n)/wn)]},kn.invert=cn(m),An.invert=function(e,t){var r,n=t,i=25;do{var a=n*n,s=a*a;n-=r=(n*(1.007226+a*(.015085+s*(.028874*a-.044475-.005916*s)))-t)/(1.007226+a*(.045255+s*(.259866*a-.311325-.005916*11*s)))}while(d(r)>o&&--i>0);return[e/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},Mn.invert=cn(S),Sn.invert=cn((function(e){return 2*m(e)})),En.invert=function(e,t){return[-t,2*m(x(e))-c]},e.geoAlbers=sn,e.geoAlbersUsa=function(){var e,t,r,n,i,a,s=sn(),l=on().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=on().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,t){a=[e,t]}};function h(e){var t=e[0],o=e[1];return a=null,r.point(t,o),a||(n.point(t,o),a)||(i.point(t,o),a)}function f(){return e=t=null,h}return h.invert=function(e){var t=s.scale(),r=s.translate(),n=(e[0]-r[0])/t,i=(e[1]-r[1])/t;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?l:i>=.166&&i<.234&&n>=-.214&&n<-.115?c:s).invert(e)},h.stream=function(r){return e&&t===r?e:e=function(e){var t=e.length;return{point:function(r,n){for(var i=-1;++i<t;)e[i].point(r,n)},sphere:function(){for(var r=-1;++r<t;)e[r].sphere()},lineStart:function(){for(var r=-1;++r<t;)e[r].lineStart()},lineEnd:function(){for(var r=-1;++r<t;)e[r].lineEnd()},polygonStart:function(){for(var r=-1;++r<t;)e[r].polygonStart()},polygonEnd:function(){for(var r=-1;++r<t;)e[r].polygonEnd()}}}([s.stream(t=r),l.stream(r),c.stream(r)])},h.precision=function(e){return arguments.length?(s.precision(e),l.precision(e),c.precision(e),f()):s.precision()},h.scale=function(e){return arguments.length?(s.scale(e),l.scale(.35*e),c.scale(e),h.translate(s.translate())):s.scale()},h.translate=function(e){if(!arguments.length)return s.translate();var t=s.scale(),a=+e[0],h=+e[1];return r=s.translate(e).clipExtent([[a-.455*t,h-.238*t],[a+.455*t,h+.238*t]]).stream(u),n=l.translate([a-.307*t,h+.201*t]).clipExtent([[a-.425*t+o,h+.12*t+o],[a-.214*t-o,h+.234*t-o]]).stream(u),i=c.translate([a-.205*t,h+.212*t]).clipExtent([[a-.214*t+o,h+.166*t+o],[a-.115*t-o,h+.234*t-o]]).stream(u),f()},h.fitExtent=function(e,t){return Wr(h,e,t)},h.fitSize=function(e,t){return Zr(h,e,t)},h.fitWidth=function(e,t){return Yr(h,e,t)},h.fitHeight=function(e,t){return Xr(h,e,t)},h.scale(1070)},e.geoArea=function(e){return V.reset(),O(e,q),2*V},e.geoAzimuthalEqualArea=function(){return tn(un).scale(124.75).clipAngle(179.999)},e.geoAzimuthalEqualAreaRaw=un,e.geoAzimuthalEquidistant=function(){return tn(hn).scale(79.4188).clipAngle(179.999)},e.geoAzimuthalEquidistantRaw=hn,e.geoBounds=function(e){var t,r,n,i,a,o,s;if(ie=ne=-(te=re=1/0),ce=[],O(e,fe),r=ce.length){for(ce.sort(be),t=1,a=[n=ce[0]];t<r;++t)we(n,(i=ce[t])[0])||we(n,i[1])?(_e(n[0],i[1])>_e(n[0],n[1])&&(n[1]=i[1]),_e(i[0],n[1])>_e(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,t=0,n=a[r=a.length-1];t<=r;n=i,++t)i=a[t],(s=_e(n[1],i[0]))>o&&(o=s,te=i[0],ne=n[1])}return ce=ue=null,te===1/0||re===1/0?[[NaN,NaN],[NaN,NaN]]:[[te,re],[ne,ie]]},e.geoCentroid=function(e){Te=ke=Ae=Me=Se=Ee=Ce=Ie=Le=Pe=ze=0,O(e,je);var t=Le,r=Pe,n=ze,i=t*t+r*r+n*n;return i<s&&(t=Ee,r=Ce,n=Ie,ke<o&&(t=Ae,r=Me,n=Se),(i=t*t+r*r+n*n)<s)?[NaN,NaN]:[g(r,t)*f,S(n/k(i))*f]},e.geoCircle=function(){var e,t,r=$e([0,0]),n=$e(90),i=$e(6),a={point:function(r,n){e.push(r=t(r,n)),r[0]*=f,r[1]*=f}};function o(){var o=r.apply(this,arguments),s=n.apply(this,arguments)*p,l=i.apply(this,arguments)*p;return e=[],t=Qe(-o[0]*p,-o[1]*p,0).invert,it(a,s,l,1),o={type:"Polygon",coordinates:[e]},e=t=null,o}return o.center=function(e){return arguments.length?(r="function"==typeof e?e:$e([+e[0],+e[1]]),o):r},o.radius=function(e){return arguments.length?(n="function"==typeof e?e:$e(+e),o):n},o.precision=function(e){return arguments.length?(i="function"==typeof e?e:$e(+e),o):i},o},e.geoClipAntimeridian=yt,e.geoClipCircle=vt,e.geoClipExtent=function(){var e,t,r,n=0,i=0,a=960,o=500;return r={stream:function(r){return e&&t===r?e:e=bt(n,i,a,o)(t=r)},extent:function(s){return arguments.length?(n=+s[0][0],i=+s[0][1],a=+s[1][0],o=+s[1][1],e=t=null,r):[[n,i],[a,o]]}}},e.geoClipRectangle=bt,e.geoConicConformal=function(){return nn(mn).scale(109.5).parallels([30,30])},e.geoConicConformalRaw=mn,e.geoConicEqualArea=on,e.geoConicEqualAreaRaw=an,e.geoConicEquidistant=function(){return nn(yn).scale(131.154).center([0,13.9389])},e.geoConicEquidistantRaw=yn,e.geoContains=function(e,t){return(e&&Dt.hasOwnProperty(e.type)?Dt[e.type]:Rt)(e,t)},e.geoDistance=zt,e.geoEqualEarth=function(){return tn(Tn).scale(177.158)},e.geoEqualEarthRaw=Tn,e.geoEquirectangular=function(){return tn(gn).scale(152.63)},e.geoEquirectangularRaw=gn,e.geoGnomonic=function(){return tn(kn).scale(144.049).clipAngle(60)},e.geoGnomonicRaw=kn,e.geoGraticule=Ht,e.geoGraticule10=function(){return Ht()()},e.geoIdentity=function(){var e,t,r,n,i,a,o,s=1,l=0,c=0,u=1,h=1,d=0,m=null,g=1,v=1,x=qr({point:function(e,t){var r=T([e,t]);this.stream.point(r[0],r[1])}}),_=Gt;function b(){return g=s*u,v=s*h,a=o=null,T}function T(r){var n=r[0]*g,i=r[1]*v;if(d){var a=i*e-n*t;n=n*e+i*t,i=a}return[n+l,i+c]}return T.invert=function(r){var n=r[0]-l,i=r[1]-c;if(d){var a=i*e+n*t;n=n*e-i*t,i=a}return[n/g,i/v]},T.stream=function(e){return a&&o===e?a:a=x(_(o=e))},T.postclip=function(e){return arguments.length?(_=e,m=r=n=i=null,b()):_},T.clipExtent=function(e){return arguments.length?(_=null==e?(m=r=n=i=null,Gt):bt(m=+e[0][0],r=+e[0][1],n=+e[1][0],i=+e[1][1]),b()):null==m?null:[[m,r],[n,i]]},T.scale=function(e){return arguments.length?(s=+e,b()):s},T.translate=function(e){return arguments.length?(l=+e[0],c=+e[1],b()):[l,c]},T.angle=function(r){return arguments.length?(t=w(d=r%360*p),e=y(d),b()):d*f},T.reflectX=function(e){return arguments.length?(u=e?-1:1,b()):u<0},T.reflectY=function(e){return arguments.length?(h=e?-1:1,b()):h<0},T.fitExtent=function(e,t){return Wr(T,e,t)},T.fitSize=function(e,t){return Zr(T,e,t)},T.fitWidth=function(e,t){return Yr(T,e,t)},T.fitHeight=function(e,t){return Xr(T,e,t)},T},e.geoInterpolate=function(e,t){var r=e[0]*p,n=e[1]*p,i=t[0]*p,a=t[1]*p,o=y(n),s=w(n),l=y(a),c=w(a),u=o*y(r),h=o*w(r),d=l*y(i),m=l*w(i),v=2*S(k(E(a-n)+o*l*E(i-r))),x=w(v),_=v?function(e){var t=w(e*=v)/x,r=w(v-e)/x,n=r*u+t*d,i=r*h+t*m,a=r*s+t*c;return[g(i,n)*f,g(a,k(n*n+i*i))*f]}:function(){return[r*f,n*f]};return _.distance=v,_},e.geoLength=It,e.geoMercator=function(){return pn(fn).scale(961/h)},e.geoMercatorRaw=fn,e.geoNaturalEarth1=function(){return tn(An).scale(175.295)},e.geoNaturalEarth1Raw=An,e.geoOrthographic=function(){return tn(Mn).scale(249.5).clipAngle(90+o)},e.geoOrthographicRaw=Mn,e.geoPath=function(e,t){var r,n,i=4.5;function a(e){return e&&("function"==typeof i&&n.pointRadius(+i.apply(this,arguments)),O(e,r(n))),n.result()}return a.area=function(e){return O(e,r(Jt)),Jt.result()},a.measure=function(e){return O(e,r(Br)),Br.result()},a.bounds=function(e){return O(e,r(hr)),hr.result()},a.centroid=function(e){return O(e,r(br)),br.result()},a.projection=function(t){return arguments.length?(r=null==t?(e=null,Gt):(e=t).stream,a):e},a.context=function(e){return arguments.length?(n=null==e?(t=null,new Ur):new Lr(t=e),"function"!=typeof i&&n.pointRadius(i),a):t},a.pointRadius=function(e){return arguments.length?(i="function"==typeof e?e:(n.pointRadius(+e),+e),a):i},a.projection(e).context(t)},e.geoProjection=tn,e.geoProjectionMutator=rn,e.geoRotation=nt,e.geoStereographic=function(){return tn(Sn).scale(250).clipAngle(142)},e.geoStereographicRaw=Sn,e.geoStream=O,e.geoTransform=function(e){return{stream:qr(e)}},e.geoTransverseMercator=function(){var e=pn(En),t=e.center,r=e.rotate;return e.center=function(e){return arguments.length?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return arguments.length?r([e[0],e[1],e.length>2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90]).scale(159.155)},e.geoTransverseMercatorRaw=En,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&typeof t<"u"?n(e,Eg()):n((r=r||self).d3=r.d3||{},r.d3)}}),Ig=m({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(e,t){var r,n;r=e,n=function(e,t,r){var n=Math.abs,i=Math.atan,a=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,c=Math.log,u=Math.max,h=Math.min,f=Math.pow,p=Math.round,d=Math.sign||function(e){return e>0?1:e<0?-1:0},m=Math.sin,g=Math.tan,y=1e-6,v=1e-12,x=Math.PI,_=x/2,b=x/4,w=Math.SQRT1_2,T=I(2),k=I(x),A=2*x,M=180/x,S=x/180;function E(e){return e>1?_:e<-1?-_:Math.asin(e)}function C(e){return e>1?0:e<-1?x:Math.acos(e)}function I(e){return e>0?Math.sqrt(e):0}function L(e){return(s(e)-s(-e))/2}function P(e){return(s(e)+s(-e))/2}function z(e){var t=g(e/2),r=2*c(o(e/2))/(t*t);function i(e,t){var n=o(e),i=o(t),a=m(t),s=i*n,l=-((1-s?c((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*i*m(e),l*a]}return i.invert=function(t,i){var s,l=I(t*t+i*i),u=-e/2,h=50;if(!l)return[0,0];do{var f=u/2,p=o(f),d=m(f),g=d/p,v=-c(n(p));u-=s=(2/g*v-r*g-l)/(-v/(d*d)+1-r/(2*p*p))*(p<0?.7:1)}while(n(s)>y&&--h>0);var x=m(u);return[a(t*x,l*o(u)),E(i*x/l)]},i}function D(e,t){var r=o(t),n=function(e){return e?e/Math.sin(e):1}(C(r*o(e/=2)));return[2*r*m(e)*n,m(t)*n]}function O(e){var t=m(e),r=o(e),i=e>=0?1:-1,s=g(i*e),l=(1+t-r)/2;function c(e,n){var c=o(n),u=o(e/=2);return[(1+c)*m(e),(i*n>-a(u,s)-.001?0:10*-i)+l+m(n)*r-(1+c)*t*u]}return c.invert=function(e,c){var u=0,h=0,f=50;do{var p=o(u),d=m(u),g=o(h),v=m(h),x=1+g,_=x*d-e,b=l+v*r-x*t*p-c,w=x*p/2,T=-d*v,k=t*x*d/2,A=r*g+t*p*v,M=T*k-A*w,S=(b*T-_*A)/M/2,E=(_*k-b*w)/M;n(E)>2&&(E/=2),u-=S,h-=E}while((n(S)>y||n(E)>y)&&--f>0);return i*h>-a(o(u),s)-.001?[2*u,h]:null},c}function R(e,t){var r=g(t/2),n=I(1-r*r),i=1+n*o(e/=2),a=m(e)*n/i,s=r/i,l=a*a,c=s*s;return[4/3*a*(3+l-3*c),4/3*s*(3+3*l-c)]}D.invert=function(e,t){if(!(e*e+4*t*t>x*x+y)){var r=e,i=t,a=25;do{var s,l=m(r),c=m(r/2),u=o(r/2),h=m(i),f=o(i),p=m(2*i),d=h*h,g=f*f,v=c*c,_=1-g*u*u,b=_?C(f*u)*I(s=1/_):s=0,w=2*b*f*c-e,T=b*h-t,k=s*(g*v+b*f*u*d),A=s*(.5*l*p-2*b*h*c),M=.25*s*(p*c-b*h*g*l),S=s*(d*u+b*v*f),E=A*M-S*k;if(!E)break;var L=(T*A-w*S)/E,P=(w*M-T*k)/E;r-=L,i-=P}while((n(L)>y||n(P)>y)&&--a>0);return[r,i]}},R.invert=function(e,t){if(t*=3/8,!(e*=3/8)&&n(t)>1)return null;var r=1+e*e+t*t,i=I((r-I(r*r-4*t*t))/2),s=E(i)/3,l=i?function(e){return c(e+I(e*e-1))}(n(t/i))/3:function(e){return c(e+I(e*e+1))}(n(e))/3,u=o(s),h=P(l),f=h*h-u*u;return[2*d(e)*a(L(l)*u,.25-f),2*d(t)*a(h*m(s),.25+f)]};var F=I(8),B=c(1+T);function j(e,t){var r=n(t);return r<b?[e,c(g(b+t/2))]:[e*o(r)*(2*T-1/m(r)),d(t)*(2*T*(r-b)-c(g(r/2)))]}function N(e){var r=2*x/e;function s(e,i){var s=t.geoAzimuthalEquidistantRaw(e,i);if(n(e)>_){var l=a(s[1],s[0]),c=I(s[0]*s[0]+s[1]*s[1]),u=r*p((l-_)/r)+_,h=a(m(l-=u),2-o(l));l=u+E(x/c*m(h))-h,s[0]=c*o(l),s[1]=c*m(l)}return s}return s.invert=function(e,n){var s=I(e*e+n*n);if(s>_){var l=a(n,e),c=r*p((l-_)/r)+_,u=l>c?-1:1,h=s*o(c-l),f=1/g(u*C((h-x)/I(x*(x-2*h)+s*s)));l=c+2*i((f+u*I(f*f-3))/3),e=s*o(l),n=s*m(l)}return t.geoAzimuthalEquidistantRaw.invert(e,n)},s}function U(e,r){if(arguments.length<2&&(r=e),1===r)return t.geoAzimuthalEqualAreaRaw;if(r===1/0)return V;function n(n,i){var a=t.geoAzimuthalEqualAreaRaw(n/r,i);return a[0]*=e,a}return n.invert=function(n,i){var a=t.geoAzimuthalEqualAreaRaw.invert(n/e,i);return a[0]*=r,a},n}function V(e,t){return[e*o(t)/o(t/=2),2*m(t)]}function q(e,t,r){var i,a,o,s=100;r=void 0===r?0:+r,t=+t;do{(a=e(r))===(o=e(r+y))&&(o=a+y),r-=i=-1*y*(a-t)/(a-o)}while(s-- >0&&n(i)>y);return s<0?NaN:r}function H(e,t,r){return void 0===t&&(t=40),void 0===r&&(r=v),function(i,a,o,s){var l,c,u;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var h=0;h<t;h++){var f=e(o,s),p=f[0]-i,d=f[1]-a;if(n(p)<r&&n(d)<r)break;var m=p*p+d*d;if(m>l)o-=c/=2,s-=u/=2;else{l=m;var g=(o>0?-1:1)*r,y=(s>0?-1:1)*r,v=e(o+g,s),x=e(o,s+y),_=(v[0]-f[0])/g,b=(v[1]-f[1])/g,w=(x[0]-f[0])/y,T=(x[1]-f[1])/y,k=T*_-b*w,A=(n(k)<.5?.5:1)/k;if(o+=c=(d*w-p*T)*A,s+=u=(p*b-d*_)*A,n(c)<r&&n(u)<r)break}}return[o,s]}}function G(){var e=U(1.68,2);function t(t,r){if(t+r<-1.4){var n=(t-r+1.6)*(t+r+1.4)/8;t+=n,r-=.8*n*m(r+x/2)}var i=e(t,r),a=(1-o(t*r))/12;return i[1]<0&&(i[0]*=1+a),i[1]>0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return t.invert=H(t),t}function W(e,t){var r,i=e*m(t),a=30;do{t-=r=(t+m(t)-i)/(1+o(t))}while(n(r)>y&&--a>0);return t/2}function Z(e,t,r){function n(n,i){return[e*n*o(i=W(r,i)),t*m(i)]}return n.invert=function(n,i){return i=E(i/t),[n/(e*o(i)),E((2*i+m(2*i))/r)]},n}j.invert=function(e,t){if((a=n(t))<B)return[e,2*i(s(t))-_];var r,a,l=b,u=25;do{var h=o(l/2),f=g(l/2);l-=r=(F*(l-b)-c(f)-a)/(F-h*h/(2*f))}while(n(r)>v&&--u>0);return[e/(o(l)*(F-1/m(l))),d(t)*l]},V.invert=function(e,t){var r=2*E(t/2);return[e*o(r/2)/o(r),r]};var Y=Z(T/_,T,x),X=2.00276,$=1.11072;function K(e,t){var r=W(x,t);return[X*e/(1/o(t)+$/o(r)),(t+T*m(r))/X]}function J(e){var r=0,n=t.geoProjectionMutator(e),i=n(r);return i.parallel=function(e){return arguments.length?n(r=e*S):r*M},i}function Q(e,t){return[e*o(t),t]}function ee(e){if(!e)return Q;var t=1/g(e);function r(r,n){var i=t+e-n,a=i&&r*o(n)/i;return[i*m(a),t-i*o(a)]}return r.invert=function(r,n){var i=I(r*r+(n=t-n)*n),s=t+e-i;return[i/o(s)*a(r,n),s]},r}function te(e){function t(t,r){var n=_-r,i=n&&t*e*m(n)/n;return[n*m(i)/e,_-n*o(i)]}return t.invert=function(t,r){var n=t*e,i=_-r,o=I(n*n+i*i),s=a(n,i);return[(o?o/m(o):1)*s/e,_-o]},t}K.invert=function(e,t){var r,i,a=X*t,s=t<0?-b:b,l=25;do{i=a-T*m(s),s-=r=(m(2*s)+2*s-x*m(i))/(2*o(2*s)+2+x*o(i)*T*o(s))}while(n(r)>y&&--l>0);return i=a-T*m(s),[e*(1/o(i)+$/o(s))/X,i]},Q.invert=function(e,t){return[e/o(t),t]};var re=Z(1,4/x,x);function ne(e,t,r,i,s,l){var c,u=o(l);if(n(e)>1||n(l)>1)c=C(r*s+t*i*u);else{var h=m(e/2),f=m(l/2);c=2*E(I(h*h+t*i*f*f))}return n(c)>y?[c,a(i*m(l),t*s-r*i*u)]:[0,0]}function ie(e,t,r){return C((e*e+t*t-r*r)/(2*e*t))}function ae(e){return e-2*x*l((e+x)/(2*x))}function oe(e,t,r){for(var n,i=[[e[0],e[1],m(e[1]),o(e[1])],[t[0],t[1],m(t[1]),o(t[1])],[r[0],r[1],m(r[1]),o(r[1])]],a=i[2],s=0;s<3;++s,a=n)n=i[s],a.v=ne(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=ie(i[0].v[0],i[2].v[0],i[1].v[0]),c=ie(i[0].v[0],i[1].v[0],i[2].v[0]),u=x-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var h=[i[2].point[0]=i[0].point[0]+i[2].v[0]*o(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*m(l))];return function(e,t){var r,n=m(t),a=o(t),s=new Array(3);for(r=0;r<3;++r){var l=i[r];if(s[r]=ne(t-l[1],l[3],l[2],a,n,e-l[0]),!s[r][0])return l.point;s[r][1]=ae(s[r][1]-l.v[1])}var f=h.slice();for(r=0;r<3;++r){var p=2==r?0:r+1,d=ie(i[r].v[0],s[r][0],s[p][0]);s[r][1]<0&&(d=-d),r?1==r?(d=c-d,f[0]-=s[r][0]*o(d),f[1]-=s[r][0]*m(d)):(d=u-d,f[0]+=s[r][0]*o(d),f[1]+=s[r][0]*m(d)):(f[0]+=s[r][0]*o(d),f[1]-=s[r][0]*m(d))}return f[0]/=3,f[1]/=3,f}}function se(e){return e[0]*=S,e[1]*=S,e}function le(e,r,n){var i=t.geoCentroid({type:"MultiPoint",coordinates:[e,r,n]}),a=[-i[0],-i[1]],o=t.geoRotation(a),s=oe(se(o(e)),se(o(r)),se(o(n)));s.invert=H(s);var l=t.geoProjection(s).rotate(a),c=l.center;return delete l.rotate,l.center=function(e){return arguments.length?c(o(e)):o.invert(c())},l.clipAngle(90)}function ce(e,t){var r=I(1-m(t));return[2/k*e*r,k*(1-r)]}function ue(e){var t=g(e);function r(e,r){return[e,(e?e/m(e):1)*(m(r)*o(e)-t*o(r))]}return r.invert=t?function(e,r){e&&(r*=m(e)/e);var n=o(e);return[e,2*a(I(n*n+t*t-r*r)-n,t-r)]}:function(e,t){return[e,E(e?t*g(e)/e:t)]},r}ce.invert=function(e,t){var r=(r=t/k-1)*r;return[r>0?e*I(x/r)/2:0,E(1-r)]};var he=I(3);function fe(e,t){return[he*e*(2*o(2*t/3)-1)/k,he*k*m(t/3)]}function pe(e){var t=o(e);function r(e,r){return[e*t,m(r)/t]}return r.invert=function(e,r){return[e/t,E(r*t)]},r}function de(e){var t=o(e);function r(e,r){return[e*t,(1+t)*g(r/2)]}return r.invert=function(e,r){return[e/t,2*i(r/(1+t))]},r}function me(e,t){var r=I(8/(3*x));return[r*e*(1-n(t)/x),r*t]}function ge(e,t){var r=I(4-3*m(n(t)));return[2/I(6*x)*e*r,d(t)*I(2*x/3)*(2-r)]}function ye(e,t){var r=I(x*(4+x));return[2/r*e*(1+I(1-4*t*t/(x*x))),4/r*t]}function ve(e,t){var r=(2+_)*m(t);t/=2;for(var i=0,a=1/0;i<10&&n(a)>y;i++){var s=o(t);t-=a=(t+m(t)*(s+2)-r)/(2*s*(1+s))}return[2/I(x*(4+x))*e*(1+o(t)),2*I(x/(4+x))*m(t)]}function xe(e,t){return[e*(1+o(t))/I(2+x),2*t/I(2+x)]}function _e(e,t){for(var r=(1+_)*m(t),i=0,a=1/0;i<10&&n(a)>y;i++)t-=a=(t+m(t)-r)/(1+o(t));return r=I(2+x),[e*(1+o(t))/r,2*t/r]}fe.invert=function(e,t){var r=3*E(t/(he*k));return[k*e/(he*(2*o(2*r/3)-1)),r]},me.invert=function(e,t){var r=I(8/(3*x)),i=t/r;return[e/(r*(1-n(i)/x)),i]},ge.invert=function(e,t){var r=2-n(t)/I(2*x/3);return[e*I(6*x)/(2*r),d(t)*E((4-r*r)/3)]},ye.invert=function(e,t){var r=I(x*(4+x))/2;return[e*r/(1+I(1-t*t*(4+x)/(4*x))),t*r/2]},ve.invert=function(e,t){var r=t*I((4+x)/x)/2,n=E(r),i=o(n);return[e/(2/I(x*(4+x))*(1+i)),E((n+r*(i+2))/(2+_))]},xe.invert=function(e,t){var r=I(2+x),n=t*r/2;return[r*e/(1+o(n)),n]},_e.invert=function(e,t){var r=1+_,n=I(r/2);return[2*e*n/(1+o(t*=n)),E((t+m(t))/r)]};var be=3+2*T;function we(e,t){var r=m(e/=2),n=o(e),a=I(o(t)),s=o(t/=2),l=m(t)/(s+T*n*a),u=I(2/(1+l*l)),h=I((T*s+(n+r)*a)/(T*s+(n-r)*a));return[be*(u*(h-1/h)-2*c(h)),be*(u*l*(h+1/h)-2*i(l))]}we.invert=function(e,t){if(!(r=R.invert(e/1.2,1.065*t)))return null;var r,a=r[0],s=r[1],l=20;e/=be,t/=be;do{var f=a/2,p=s/2,d=m(f),g=o(f),v=m(p),x=o(p),b=o(s),k=I(b),A=v/(x+T*g*k),M=A*A,S=I(2/(1+M)),E=(T*x+(g+d)*k)/(T*x+(g-d)*k),C=I(E),L=C-1/C,P=C+1/C,z=S*L-2*c(C)-e,D=S*A*P-2*i(A)-t,O=v&&w*k*d*M/v,F=(T*g*x+k)/(2*(x+T*g*k)*(x+T*g*k)*k),B=-.5*A*S*S*S,j=B*O,N=B*F,U=(U=2*x+T*k*(g-d))*U*C,V=(T*g*x*k+b)/U,q=-T*d*v/(k*U),H=L*j-2*V/C+S*(V+V/E),G=L*N-2*q/C+S*(q+q/E),W=A*P*j-2*O/(1+M)+S*P*O+S*A*(V-V/E),Z=A*P*N-2*F/(1+M)+S*P*F+S*A*(q-q/E),Y=G*W-Z*H;if(!Y)break;var X=(D*G-z*Z)/Y,$=(z*W-D*H)/Y;a-=X,s=u(-_,h(_,s-$))}while((n(X)>y||n($)>y)&&--l>0);return n(n(s)-_)<y?[0,s]:l&&[a,s]};var Te=o(35*S);function ke(e,t){var r=g(t/2);return[e*Te*I(1-r*r),(1+Te)*r]}function Ae(e,t){var r=t/2,n=o(r);return[2*e/k*o(t)*n*n,k*g(r)]}function Me(e){var t=1-e,r=i(x,0)[0]-i(-x,0)[0],n=I(2*(i(0,_)[1]-i(0,-_)[1])/r);function i(r,n){var i=o(n),a=m(n);return[i/(t+e*i)*r,t*n+e*a]}function a(e,t){var r=i(e,t);return[r[0]*n,r[1]/n]}function s(e){return a(0,e)[1]}return a.invert=function(r,i){var a=q(s,i);return[r/n*(e+t/o(a)),a]},a}function Se(e){return[e[0]/2,E(g(e[1]/2*S))*M]}function Ee(e){return[2*e[0],2*i(m(e[1]*S))*M]}function Ce(e,r){var i=2*x/r,s=e*e;function l(r,l){var c=t.geoAzimuthalEquidistantRaw(r,l),u=c[0],h=c[1],f=u*u+h*h;if(f>s){var d=I(f),g=a(h,u),v=i*p(g/i),b=g-v,w=e*o(b),T=(e*m(b)-b*m(w))/(_-w),k=Ie(b,T),A=(x-e)/Le(k,w,x);u=d;var M,S=50;do{u-=M=(e+Le(k,w,u)*A-d)/(k(u)*A)}while(n(M)>y&&--S>0);h=b*m(u),u<_&&(h-=T*(u-_));var E=m(v),C=o(v);c[0]=u*C-h*E,c[1]=u*E+h*C}return c}return l.invert=function(r,l){var c=r*r+l*l;if(c>s){var u=I(c),h=a(l,r),f=i*p(h/i),d=h-f;r=u*o(d),l=u*m(d);for(var g=r-_,y=m(r),b=l/y,w=r<_?1/0:0,T=10;;){var k=e*m(b),A=e*o(b),M=m(A),S=_-A,E=(k-b*M)/S,C=Ie(b,E);if(n(w)<v||! --T)break;b-=w=(b*y-E*g-l)/(y-2*g*(S*(A+b*k*o(A)-M)-k*(k-b*M))/(S*S))}r=(u=e+Le(C,A,r)*(x-e)/Le(C,A,x))*o(h=f+b),l=u*m(h)}return t.geoAzimuthalEquidistantRaw.invert(r,l)},l}function Ie(e,t){return function(r){var n=e*o(r);return r<_&&(n-=t),I(1+n*n)}}function Le(e,t,r){for(var n=(r-t)/50,i=e(t)+e(r),a=1,o=t;a<50;++a)i+=2*e(o+=n);return.5*i*n}function Pe(e,t,r,i,a,s,l,c){function u(n,u){if(!u)return[e*n/x,0];var h=u*u,f=e+h*(t+h*(r+h*i)),p=u*(a-1+h*(s-c+h*l)),d=(f*f+p*p)/(2*p),g=n*E(f/d)/x;return[d*m(g),u*(1+h*c)+d*(1-o(g))]}return arguments.length<8&&(c=0),u.invert=function(u,h){var f,p,d=x*u/e,g=h,v=50;do{var _=g*g,b=e+_*(t+_*(r+_*i)),w=g*(a-1+_*(s-c+_*l)),T=b*b+w*w,k=2*w,A=T/k,M=A*A,S=E(b/A)/x,C=d*S,L=b*b,P=(2*t+_*(4*r+6*_*i))*g,z=a+_*(3*s+5*_*l),D=(2*(b*P+w*(z-1))*k-T*(2*(z-1)))/(k*k),O=o(C),R=m(C),F=A*O,B=A*R,j=d/x*(1/I(1-L/M))*(P*A-b*D)/M,N=B-u,U=g*(1+_*c)+A-F-h,V=D*R+F*j,q=F*S,H=1+D-(D*O-B*j),G=B*S,W=V*G-H*q;if(!W)break;d-=f=(U*V-N*H)/W,g-=p=(N*G-U*q)/W}while((n(f)>y||n(p)>y)&&--v>0);return[d,g]},u}ke.invert=function(e,t){var r=t/(1+Te);return[e&&e/(Te*I(1-r*r)),2*i(r)]},Ae.invert=function(e,t){var r=i(t/k),n=o(r),a=2*r;return[e*k/2/(o(a)*n*n),a]};var ze=Pe(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),De=Pe(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Oe=Pe(5/6*x,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Re(e,t){var r=e*e,n=t*t;return[e*(1-.162388*n)*(.87-952426e-9*r*r),t*(1+n/12)]}Re.invert=function(e,t){var r,i=e,a=t,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-t)/(1+s/4)}while(n(r)>y&&--o>0);o=50,e/=1-.162388*s;do{var l=(l=i*i)*l;i-=r=(i*(.87-952426e-9*l)-e)/(.87-.00476213*l)}while(n(r)>y&&--o>0);return[i,a]};var Fe=Pe(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Be(e){var t=e(_,0)[0]-e(-_,0)[0];function r(r,n){var i=r>0?-.5:.5,a=e(r+i*x,n);return a[0]-=i*t,a}return e.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=e.invert(r+i*t,n),o=a[0]-i*x;return o<-x?o+=2*x:o>x&&(o-=2*x),a[0]=o,a}),r}function je(e,t){var r=d(e),i=d(t),s=o(t),l=o(e)*s,c=m(e)*s,u=m(i*t);e=n(a(c,u)),t=E(l),n(e-_)>y&&(e%=_);var h=function(e,t){if(t===_)return[0,0];var r,i,a=m(t),s=a*a,l=s*s,c=1+l,u=1+3*l,h=1-l,f=E(1/I(c)),p=h+s*c*f,d=(1-a)/p,g=I(d),v=d*c,b=I(v),w=g*h;if(0===e)return[0,-(w+s*b)];var T,k=o(t),A=1/k,M=2*a*k,S=(-p*k-(1-a)*((-3*s+f*u)*M))/(p*p),C=-A*M,L=-A*(s*c*S+d*u*M),P=-2*A*(h*(.5*S/g)-2*s*g*M),z=4*e/x;if(e>.222*x||t<x/4&&e>.175*x){if(r=(w+s*I(v*(1+l)-w*w))/(1+l),e>x/4)return[r,r];var D=r,O=.5*r;r=.5*(O+D),i=50;do{var R=r*(P+C*I(v-r*r))+L*E(r/b)-z;if(!R)break;R<0?O=r:D=r,r=.5*(O+D)}while(n(D-O)>y&&--i>0)}else{r=y,i=25;do{var F=r*r,B=I(v-F),j=P+C*B,N=r*j+L*E(r/b)-z;r-=T=B?N/(j+(L-C*F)/B):0}while(n(T)>y&&--i>0)}return[r,-w-s*I(v-r*r)]}(e>x/4?_-e:e,t);return e>x/4&&(u=h[0],h[0]=-h[1],h[1]=-u),h[0]*=r,h[1]*=-i,h}function Ne(e,t){var r,a,l,c,u;if(t<y)return[(c=m(e))-(r=t*(e-c*(a=o(e)))/4)*a,a+r*c,1-t*c*c/2,e-r];if(t>=1-y)return r=(1-t)/4,a=P(e),c=function(e){return((e=s(2*e))-1)/(e+1)}(e),l=1/a,[c+r*((u=a*L(e))-e)/(a*a),l-r*c*l*(u-e),l+r*c*l*(u+e),2*i(s(e))-_+r*(u-e)/a];var h=[1,0,0,0,0,0,0,0,0],f=[I(t),0,0,0,0,0,0,0,0],p=0;for(a=I(1-t),u=1;n(f[p]/h[p])>y&&p<8;)r=h[p++],f[p]=(r-a)/2,h[p]=(r+a)/2,a=I(r*a),u*=2;l=u*h[p]*e;do{l=(E(c=f[p]*m(a=l)/h[p])+l)/2}while(--p);return[m(l),c=o(l),c/o(l-a),l]}function Ue(e,t){if(!t)return e;if(1===t)return c(g(e/2+b));for(var r=1,a=I(1-t),o=I(t),s=0;n(o)>y;s++){if(e%x){var l=i(a*g(e)/r);l<0&&(l+=x),e+=l+~~(e/x)*x}else e+=e;o=(r+a)/2,a=I(r*a),o=((r=o)-a)/2}return e/(f(2,s)*r)}function Ve(e,t){var r=(T-1)/(T+1),l=I(1-r*r),u=Ue(_,l*l),h=c(g(x/4+n(t)/2)),f=s(-1*h)/I(r),p=function(e,t){var r=e*e,n=t+1,i=1-r-t*t;return[.5*((e>=0?_:-_)-a(i,2*e)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(f*o(-1*e),f*m(-1*e)),y=function(e,t,r){var a=n(e),o=L(n(t));if(a){var s=1/m(a),l=1/(g(a)*g(a)),c=-(l+r*(o*o*s*s)-1+r),u=(-c+I(c*c-(r-1)*l*4))/2;return[Ue(i(1/I(u)),r)*d(e),Ue(i(I((u/l-1)/r)),1-r)*d(t)]}return[0,Ue(i(o),1-r)*d(t)]}(p[0],p[1],l*l);return[-y[1],(t>=0?1:-1)*(.5*u-y[0])]}function qe(e){var t=m(e),r=o(e),i=He(e);function s(e,a){var s=i(e,a);e=s[0],a=s[1];var l=m(a),c=o(a),u=o(e),h=C(t*l+r*c*u),f=m(h),p=n(f)>y?h/f:1;return[p*r*m(e),(n(e)>_?p:-p)*(t*c-r*l*u)]}return i.invert=He(-e),s.invert=function(e,r){var n=I(e*e+r*r),s=-m(n),l=o(n),c=n*l,u=-r*s,h=n*t,f=I(c*c+u*u-h*h),p=a(c*h+u*f,u*h-c*f),d=(n>_?-1:1)*a(e*s,n*o(p)*l+r*m(p)*s);return i.invert(d,p)},s}function He(e){var t=m(e),r=o(e);return function(e,n){var i=o(n),s=o(e)*i,l=m(e)*i,c=m(n);return[a(l,s*r-c*t),E(c*r+s*t)]}}je.invert=function(e,t){n(e)>1&&(e=2*d(e)-e),n(t)>1&&(t=2*d(t)-t);var r=d(e),i=d(t),s=-r*e,l=-i*t,c=l/s<1,u=function(e,t){for(var r=0,i=1,a=.5,s=50;;){var l=a*a,c=I(a),u=E(1/I(1+l)),h=1-l+a*(1+l)*u,f=(1-c)/h,p=I(f),d=f*(1+l),m=p*(1-l),g=I(d-e*e),y=t+m+a*g;if(n(i-r)<v||0==--s||0===y)break;y>0?r=a:i=a,a=.5*(r+i)}if(!s)return null;var _=E(c),b=o(_),w=1/b,T=2*c*b,k=(-h*b-(1-c)*((-3*a+u*(1+3*l))*T))/(h*h);return[x/4*(e*(-2*w*(.5*k/p*(1-l)-2*a*p*T)+-w*T*g)+-w*(a*(1+l)*k+f*(1+3*l)*T)*E(e/I(d))),_]}(c?l:s,c?s:l),h=u[0],f=u[1],p=o(f);return c&&(h=-_-h),[r*(a(m(h)*p,-m(f))+x),i*E(o(h)*p)]},Ve.invert=function(e,t){var r=(T-1)/(T+1),n=I(1-r*r),o=function(e,t,r){var n,i,a;return e?(n=Ne(e,r),t?(a=(i=Ne(t,1-r))[1]*i[1]+r*n[0]*n[0]*i[0]*i[0],[[n[0]*i[2]/a,n[1]*n[2]*i[0]*i[1]/a],[n[1]*i[1]/a,-n[0]*n[2]*i[0]*i[2]/a],[n[2]*i[1]*i[2]/a,-r*n[0]*n[1]*i[0]/a]]):[[n[0],0],[n[1],0],[n[2],0]]):[[0,(i=Ne(t,1-r))[0]/i[1]],[1/i[1],0],[i[2]/i[1],0]]}(.5*Ue(_,n*n)-t,-e,n*n),l=function(e,t){var r=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/r,(e[1]*t[0]-e[0]*t[1])/r]}(o[0],o[1]);return[a(l[1],l[0])/-1,2*i(s(-.5*c(r*l[0]*l[0]+r*l[1]*l[1])))-_]};var Ge=E(1-1/3)*M,We=pe(0);function Ze(e){var t=Ge*S,r=ce(x,t)[0]-ce(-x,t)[0],i=We(0,t)[1],a=ce(0,t)[1],o=k-a,s=A/e,c=4/A,f=i+o*o*4/A;function p(p,d){var m,g=n(d);if(g>t){var y=h(e-1,u(0,l((p+x)/s)));(m=ce(p+=x*(e-1)/e-y*s,g))[0]=m[0]*A/r-A*(e-1)/(2*e)+y*A/e,m[1]=i+4*(m[1]-a)*o/A,d<0&&(m[1]=-m[1])}else m=We(p,d);return m[0]*=c,m[1]/=f,m}return p.invert=function(t,p){t/=c;var d=n(p*=f);if(d>i){var m=h(e-1,u(0,l((t+x)/s)));t=(t+x*(e-1)/e-m*s)*r/A;var g=ce.invert(t,.25*(d-i)*A/o+a);return g[0]-=x*(e-1)/e-m*s,p<0&&(g[1]=-g[1]),g}return We.invert(t,p)},p}function Ye(e,t){return[e,1&t?90-y:Ge]}function Xe(e,t){return[e,1&t?-90+y:-Ge]}function $e(e){return[e[0]*(1-y),e[1]]}function Ke(e){var t,r=1+e,i=E(m(1/r)),s=2*I(x/(t=x+4*i*r)),l=.5*s*(r+I(e*(2+e))),c=e*e,u=r*r;function h(h,f){var p,d,g=1-m(f);if(g&&g<2){var y,b=_-f,w=25;do{var T=m(b),k=o(b),A=i+a(T,r-k),M=1+u-2*r*k;b-=y=(b-c*i-r*T+M*A-.5*g*t)/(2*r*T*A)}while(n(y)>v&&--w>0);p=s*I(M),d=h*A/x}else p=s*(e+g),d=h*i/x;return[p*m(d),l-p*o(d)]}return h.invert=function(e,n){var o=e*e+(n-=l)*n,h=(1+u-o/(s*s))/(2*r),f=C(h),p=m(f),d=i+a(p,r-h);return[E(e/I(o))*x/d,E(1-2*(f-c*i-r*p+(1+u-2*r*h)*d)/t)]},h}var Je=.7109889596207567,Qe=.0528035274542;function et(e,t){return t>-Je?((e=Y(e,t))[1]+=Qe,e):Q(e,t)}function tt(e,t){return n(t)>Je?((e=Y(e,t))[1]-=t>0?Qe:-Qe,e):Q(e,t)}function rt(e,t,r,n){var i=I(4*x/(2*r+(1+e-t/2)*m(2*r)+(e+t)/2*m(4*r)+t/2*m(6*r))),a=I(n*m(r)*I((1+e*o(2*r)+t*o(4*r))/(1+e+t))),s=r*c(1);function l(r){return I(1+e*o(2*r)+t*o(4*r))}function c(n){var i=n*r;return(2*i+(1+e-t/2)*m(2*i)+(e+t)/2*m(4*i)+t/2*m(6*i))/r}function u(e){return l(e)*m(e)}var h=function(e,t){var n=r*q(c,s*m(t)/r,t/x);isNaN(n)&&(n=r*d(t));var u=i*l(n);return[u*a*e/x*o(n),u/a*m(n)]};return h.invert=function(e,t){var n=q(u,t*a/i);return[e*x/(o(n)*i*a*l(n)),E(r*c(n/r)/s)]},0===r&&(i=I(n/x),(h=function(e,t){return[e*i,m(t)/i]}).invert=function(e,t){return[e/i,E(t*i)]}),h}function nt(e,t,r,n,i,a,o,s,l,c,u){if(u.nanEncountered)return NaN;var h,f,p,d,m,g,y,v,x,_;if(f=e(t+.25*(h=r-t)),p=e(r-.25*h),isNaN(f))u.nanEncountered=!0;else{if(!isNaN(p))return _=((g=(d=h*(n+4*f+i)/12)+(m=h*(i+4*p+a)/12))-o)/15,c>l?(u.maxDepthCount++,g+_):Math.abs(_)<s?g+_:(v=nt(e,t,y=t+.5*h,n,f,i,d,.5*s,l,c+1,u),isNaN(v)?(u.nanEncountered=!0,NaN):(x=nt(e,y,r,i,p,a,m,.5*s,l,c+1,u),isNaN(x)?(u.nanEncountered=!0,NaN):v+x));u.nanEncountered=!0}}function it(e,t,r,n,i){void 0===n&&(n=1e-8),void 0===i&&(i=20);var a=e(t),o=e(.5*(t+r)),s=e(r);return nt(e,t,r,a,o,s,(a+4*o+s)*(r-t)/6,n,i,1,{maxDepthCount:0,nanEncountered:!1})}function at(e,t,r){function i(r){return e+(1-e)*f(1-f(r,t),1/t)}function a(e){return it(i,0,e,1e-4)}for(var o=1/a(1),s=1e3,l=(1+1e-8)*o,c=[],u=0;u<=s;u++)c.push(a(u/s)*l);function h(e){var t=0,r=s,n=500;do{c[n]>e?r=n:t=n,n=t+r>>1}while(n>t);var i=c[n+1]-c[n];return i&&(i=(e-c[n+1])/i),(n+1+i)/s}var p=2*h(1)/x*o/r,g=function(e,t){var r=h(n(m(t))),a=i(r)*e;return r/=p,[a,t>=0?r:-r]};return g.invert=function(e,t){var r;return n(t*=p)<1&&(r=d(t)*E(a(n(t))*o)),[e/i(n(t)),r]},g}function ot(e,t){return n(e[0]-t[0])<y&&n(e[1]-t[1])<y}function st(e,t){for(var r,n,i,a=-1,o=e.length,s=e[0],l=[];++a<o;){n=((r=e[a])[0]-s[0])/t,i=(r[1]-s[1])/t;for(var c=0;c<t;++c)l.push([s[0]+c*n,s[1]+c*i]);s=r}return l.push(r),l}function lt(e,n,i){var a,o;function s(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 l=e(t-a[o][1][0],r);return l[0]+=e(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],l}i?s.invert=i(s):e.invert&&(s.invert=function(t,r){for(var i=o[+(r<0)],a=n[+(r<0)],l=0,c=i.length;l<c;++l){var u=i[l];if(u[0][0]<=t&&t<u[1][0]&&u[0][1]<=r&&r<u[1][1]){var h=e.invert(t-e(a[l][1][0],0)[0],r);return h[0]+=a[l][1][0],ot(s(h[0],h[1]),[t,r])?h:null}}});var l=t.geoProjection(s),c=l.stream;return l.stream=function(e){var r=l.rotate(),n=c(e),i=(l.rotate([0,0]),c(e));return l.rotate(r),n.sphere=function(){t.geoStream(a,i)},n},l.lobes=function(t){return arguments.length?(a=function(e){var t,n,i,a,o,s,l,c=[],u=e[0].length;for(l=0;l<u;++l)n=(t=e[0][l])[0][0],i=t[0][1],a=t[1][1],o=t[2][0],s=t[2][1],c.push(st([[n+y,i+y],[n+y,a-y],[o-y,a-y],[o-y,s+y]],30));for(l=e[1].length-1;l>=0;--l)n=(t=e[1][l])[0][0],i=t[0][1],a=t[1][1],o=t[2][0],s=t[2][1],c.push(st([[o-y,s-y],[o-y,a+y],[n+y,a+y],[n+y,i-y]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}(t),n=t.map((function(e){return e.map((function(e){return[[e[0][0]*S,e[0][1]*S],[e[1][0]*S,e[1][1]*S],[e[2][0]*S,e[2][1]*S]]}))})),o=n.map((function(t){return t.map((function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),l):n.map((function(e){return e.map((function(e){return[[e[0][0]*M,e[0][1]*M],[e[1][0]*M,e[1][1]*M],[e[2][0]*M,e[2][1]*M]]}))}))},null!=n&&l.lobes(n),l}et.invert=function(e,t){return t>-Je?Y.invert(e,t-Qe):Q.invert(e,t)},tt.invert=function(e,t){return n(t)>Je?Y.invert(e,t+(t>0?Qe:-Qe)):Q.invert(e,t)};var ct=[[[[-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]]]],ut=[[[[-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]]]],ht=[[[[-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]]]],ft=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],pt=[[[[-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]]]],dt=[[[[-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 mt(e,t){return[3/A*e*I(x*x/3-t*t),t]}function gt(e){function t(t,r){if(n(n(r)-_)<y)return[0,r<0?-2:2];var i=m(r),a=f((1+i)/(1-i),e/2),s=.5*(a+1/a)+o(t*=e);return[2*m(t)/s,(a-1/a)/s]}return t.invert=function(t,r){var i=n(r);if(n(i-2)<y)return t?null:[0,d(r)*_];if(i>2)return null;var o=(t/=2)*t,s=(r/=2)*r,l=2*r/(1+o+s);return l=f((1+l)/(1-l),1/e),[a(2*t,1-o-s)/e,E((l-1)/(l+1))]},t}mt.invert=function(e,t){return[A/3*e/I(x*x/3-t*t),t]};var yt=x/T;function vt(e,t){return[e*(1+I(o(t)))/2,t/(o(t/2)*o(e/6))]}function xt(e,t){var r=e*e,n=t*t;return[e*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),t*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function _t(e,t){return[m(e)/o(t),g(t)*o(e)]}function bt(e){var t=o(e),r=g(b+e/2);function i(i,a){var o=a-e,s=n(o)<y?i*t:n(s=b+a/2)<y||n(n(s)-_)<y?0:i*o/c(g(s)/r);return[s,o]}return i.invert=function(i,a){var o,s=a+e;return[n(a)<y?i/t:n(o=b+s/2)<y||n(n(o)-_)<y?0:i*c(g(o)/r)/a,s]},i}function wt(e,t){return[e,1.25*c(g(b+.4*t))]}function Tt(e){var t=e.length-1;function r(r,n){for(var i,a=o(n),s=2/(1+a*o(r)),l=s*a*m(r),c=s*m(n),u=t,h=e[u],f=h[0],p=h[1];--u>=0;)f=(h=e[u])[0]+l*(i=f)-c*p,p=h[1]+l*p+c*i;return[f=l*(i=f)-c*p,p=l*p+c*i]}return r.invert=function(r,s){var l=20,c=r,u=s;do{for(var h,f=t,p=e[f],d=p[0],g=p[1],v=0,x=0;--f>=0;)v=d+c*(h=v)-u*x,x=g+c*x+u*h,d=(p=e[f])[0]+c*(h=d)-u*g,g=p[1]+c*g+u*h;var _,b,w=(v=d+c*(h=v)-u*x)*v+(x=g+c*x+u*h)*x;c-=_=((d=c*(h=d)-u*g-r)*v+(g=c*g+u*h-s)*x)/w,u-=b=(g*v-d*x)/w}while(n(_)+n(b)>y*y&&--l>0);if(l){var T=I(c*c+u*u),k=2*i(.5*T),A=m(k);return[a(c*A,T*o(k)),T?E(u*A/T):0]}},r}vt.invert=function(e,t){var r=n(e),i=n(t),a=y,s=_;i<yt?s*=i/yt:a+=6*C(yt/i);for(var l=0;l<25;l++){var c=m(s),u=I(o(s)),h=m(s/2),f=o(s/2),p=m(a/6),d=o(a/6),g=.5*a*(1+u)-r,v=s/(f*d)-i,x=u?-.25*a*c/u:0,b=.5*(1+u),w=(1+.5*s*h/f)/(f*d),T=s/f*(p/6)/(d*d),k=x*T-w*b,A=(g*T-v*b)/k,M=(v*x-g*w)/k;if(s-=A,a-=M,n(A)<y&&n(M)<y)break}return[e<0?-a:a,t<0?-s:s]},xt.invert=function(e,t){var r=d(e)*x,i=t/2,a=50;do{var o=r*r,s=i*i,l=r*i,c=r*(.975534+s*(-.0143059*o-.119161+-.0547009*s))-e,u=i*(1.00384+o*(.0802894+-.02855*s+199025e-9*o)+s*(.0998909+-.0491032*s))-t,h=.975534-s*(.119161+3*o*.0143059+.0547009*s),f=-l*(.238322+.2188036*s+.0286118*o),p=l*(.1605788+7961e-7*o+-.0571*s),m=1.00384+o*(.0802894+199025e-9*o)+s*(3*(.0998909-.02855*o)-.245516*s),g=f*p-m*h,v=(u*f-c*m)/g,_=(c*p-u*h)/g;r-=v,i-=_}while((n(v)>y||n(_)>y)&&--a>0);return a&&[r,i]},_t.invert=function(e,t){var r=e*e,n=t*t+1,i=r+n,a=e?w*I((i-I(i*i-4*r))/r):1/I(n);return[E(e*a),d(t)*C(a)]},wt.invert=function(e,t){return[e,2.5*i(s(.8*t))-.625*x]};var kt=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],At=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Mt=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],St=[[.9245,0],[0,0],[.01943,0]],Et=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Ct(e,r){var n=t.geoProjection(Tt(e)).rotate(r).clipAngle(90),i=t.geoRotation(r),a=n.center;return delete n.rotate,n.center=function(e){return arguments.length?a(i(e)):i.invert(a())},n}var It=I(6),Lt=I(7);function Pt(e,t){var r=E(7*m(t)/(3*It));return[It*e*(2*o(2*r/3)-1)/Lt,9*m(r/3)/Lt]}function zt(e,t){for(var r,i=(1+w)*m(t),a=t,s=0;s<25&&(a-=r=(m(a/2)+m(a)-i)/(.5*o(a/2)+o(a)),!(n(r)<y));s++);return[e*(1+2*o(a)/o(a/2))/(3*T),2*I(3)*m(a/2)/I(2+T)]}function Dt(e,t){for(var r,i=I(6/(4+x)),a=(1+x/4)*m(t),s=t/2,l=0;l<25&&(s-=r=(s/2+m(s)-a)/(.5+o(s)),!(n(r)<y));l++);return[i*(.5+o(s))*e/1.5,i*s]}function Ot(e,t){var r=t*t,n=r*r,i=r*n;return[e*(.84719-.13063*r+i*i*(.05494*r-.04515-.02326*n+.00331*i)),t*(1.01183+n*n*(.01926*r-.02625-.00396*n))]}function Rt(e,t){return[e*(1+o(t))/2,2*(t-g(t/2))]}Pt.invert=function(e,t){var r=3*E(t*Lt/9);return[e*Lt/(It*(2*o(2*r/3)-1)),E(3*m(r)*It/7)]},zt.invert=function(e,t){var r=t*I(2+T)/(2*I(3)),n=2*E(r);return[3*T*e/(1+2*o(n)/o(n/2)),E((r+m(n))/(1+w))]},Dt.invert=function(e,t){var r=I(6/(4+x)),i=t/r;return n(n(i)-_)<y&&(i=i<0?-_:_),[1.5*e/(r*(.5+o(i))),E((i/2+m(i))/(1+x/4))]},Ot.invert=function(e,t){var r,i,a,o,s=t,l=25;do{s-=r=(s*(1.01183+(a=(i=s*s)*i)*a*(.01926*i-.02625-.00396*a))-t)/(1.01183+a*a*(.21186*i-.23625+-.05148*a))}while(n(r)>v&&--l>0);return[e/(.84719-.13063*(i=s*s)+(o=i*(a=i*i))*o*(.05494*i-.04515-.02326*a+.00331*o)),s]},Rt.invert=function(e,t){for(var r=t/2,i=0,a=1/0;i<10&&n(a)>y;++i){var s=o(t/2);t-=a=(t-g(t/2)-r)/(1-.5/(s*s))}return[2*e/(1+o(t)),t]};var Ft=[[[[-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 Bt(e,t){var r=m(t),i=o(t),a=d(e);if(0===e||n(t)===_)return[0,t];if(0===t)return[e,0];if(n(e)===_)return[e*i,_*r];var s=x/(2*e)-2*e/x,l=2*t/x,c=(1-l*l)/(r-l),u=s*s,h=c*c,f=1+u/h,p=1+h/u,g=(s*r/c-s/2)/f,y=(h*r/u+c/2)/p,v=y*y-(h*r*r/u+c*r-1)/p;return[_*(g+I(g*g+i*i/f)*a),_*(y+I(v<0?0:v)*d(-t*s)*a)]}Bt.invert=function(e,t){var r=(e/=_)*e,n=r+(t/=_)*t,i=x*x;return[e?(n-1+I((1-n)*(1-n)+4*r))/(2*e)*_:0,q((function(e){return n*(x*m(e)-2*e)*x+4*e*e*(t-m(e))+2*x*e-i*t}),0)]};var jt=1.0148,Nt=.23185,Ut=-.14499,Vt=.02406,qt=jt,Ht=5*Nt,Gt=7*Ut,Wt=1.790857183;function Zt(e,t){var r=t*t;return[e,t*(jt+r*r*(Nt+r*(Ut+Vt*r)))]}function Yt(e,t){if(n(t)<y)return[e,0];var r=g(t),i=e*m(t);return[m(i)/r,t+(1-o(i))/r]}function Xt(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 $t(e,t){return[e[0]-t[0],e[1]-t[1]]}function Kt(e){return I(e[0]*e[0]+e[1]*e[1])}function Jt(e,r,n){function i(e,t){var n,i=r(e,t),a=i.project([e*M,t*M]);return(n=i.transform)?[n[0]*a[0]+n[1]*a[1]+n[2],-(n[3]*a[0]+n[4]*a[1]+n[5])]:(a[1]=-a[1],a)}function s(e,t){var n=e.project.invert,i=e.transform,a=t;if(i&&(i=function(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])]}(i),a=[i[0]*a[0]+i[1]*a[1]+i[2],i[3]*a[0]+i[4]*a[1]+i[5]]),n&&e===function(e){return r(e[0]*S,e[1]*S)}(o=n(a)))return o;for(var o,l=e.children,c=0,u=l&&l.length;c<u;++c)if(o=s(l[c],t))return o}!function e(t,r){if(t.edges=function(e){for(var t=e.length,r=[],n=e[t-1],i=0;i<t;++i)r.push([n,n=e[i]]);return r}(t.face),r.face){var n=t.shared=function(e,t){for(var r,n,i=e.length,a=null,o=0;o<i;++o){r=e[o];for(var s=t.length;--s>=0;)if(n=t[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(t.face,r.face),i=function(e,t){var r=$t(e[1],e[0]),n=$t(t[1],t[0]),i=function(e,t){return a(e[0]*t[1]-e[1]*t[0],e[0]*t[0]+e[1]*t[1])}(r,n),s=Kt(r)/Kt(n);return Xt([1,0,e[0][0],0,1,e[0][1]],Xt([s,0,0,0,s,0],Xt([o(i),m(i),0,-m(i),o(i),0],[1,0,-t[0][0],0,1,-t[0][1]])))}(n.map(r.project),n.map(t.project));t.transform=r.transform?Xt(r.transform,i):i;for(var s=r.edges,l=0,c=s.length;l<c;++l)er(n[0],s[l][1])&&er(n[1],s[l][0])&&(s[l]=t),er(n[0],s[l][0])&&er(n[1],s[l][1])&&(s[l]=t);for(l=0,c=(s=t.edges).length;l<c;++l)er(n[0],s[l][0])&&er(n[1],s[l][1])&&(s[l]=r),er(n[0],s[l][1])&&er(n[1],s[l][0])&&(s[l]=r)}else t.transform=r.transform;return t.children&&t.children.forEach((function(r){e(r,t)})),t}(e,{transform:null}),tr(e)&&(i.invert=function(t,r){var n=s(e,[t,-r]);return n&&(n[0]*=S,n[1]*=S,n)});var l=t.geoProjection(i),c=l.stream;return l.stream=function(t){var r=l.rotate(),n=c(t),i=(l.rotate([0,0]),c(t));return l.rotate(r),n.sphere=function(){i.polygonStart(),i.lineStart(),Qt(i,e),i.lineEnd(),i.polygonEnd()},n},l.angle(null==n?-30:n*M)}function Qt(e,r,i){var a,o,s=r.edges,l=s.length,c={type:"MultiPoint",coordinates:r.face},u=r.face.filter((function(e){return 90!==n(e[1])})),h=t.geoBounds({type:"MultiPoint",coordinates:u}),f=!1,p=-1,d=h[1][0]-h[0][0],m=180===d||360===d?[(h[0][0]+h[1][0])/2,(h[0][1]+h[1][1])/2]:t.geoCentroid(c);if(i)for(;++p<l&&s[p]!==i;);++p;for(var g=0;g<l;++g)o=s[(g+p)%l],Array.isArray(o)?(f||(e.point((a=t.geoInterpolate(o[0],m)(y))[0],a[1]),f=!0),e.point((a=t.geoInterpolate(o[1],m)(y))[0],a[1])):(f=!1,o!==i&&Qt(e,o,r))}function er(e,t){return e&&t&&e[0]===t[0]&&e[1]===t[1]}function tr(e){return e.project.invert||e.children&&e.children.some(tr)}Zt.invert=function(e,t){t>Wt?t=Wt:t<-Wt&&(t=-Wt);var r,i=t;do{var a=i*i;i-=r=(i*(jt+a*a*(Nt+a*(Ut+Vt*a)))-t)/(qt+a*a*(Ht+a*(Gt+.21654*a)))}while(n(r)>y);return[e,i]},Yt.invert=function(e,t){if(n(t)<y)return[e,0];var r,i=e*e+t*t,a=.5*t,s=10;do{var l=g(a),c=1/o(a),u=i-2*t*a+a*a;a-=r=(l*u+2*(a-t))/(2+u*c*c+2*(a-t)*l)}while(n(r)>y&&--s>0);return l=g(a),[(n(t)<n(a+1/l)?E(e*l):d(t)*d(e)*(C(n(e*l))+_))/m(a),a]};var rr=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],nr=[[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 rr[e]}))})),ir=2/I(3);function ar(e,t){var r=ce(e,t);return[r[0]*ir,r[1]]}function or(e,t){for(var r=0,n=e.length,i=0;r<n;++r)i+=e[r]*t[r];return i}function sr(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 lr(e){return[a(e[1],e[0])*M,E(u(-1,h(1,e[2])))*M]}function cr(e){var t=e[0]*S,r=e[1]*S,n=o(r);return[n*o(t),n*m(t),m(r)]}function ur(){}function hr(e,t){return{type:"FeatureCollection",features:e.features.map((function(e){return fr(e,t)}))}}function fr(e,t){return{type:"Feature",id:e.id,properties:e.properties,geometry:pr(e.geometry,t)}}function pr(e,r){if(!e)return null;if("GeometryCollection"===e.type)return function(e,t){return{type:"GeometryCollection",geometries:e.geometries.map((function(e){return pr(e,t)}))}}(e,r);var n;switch(e.type){case"Point":case"MultiPoint":n=gr;break;case"LineString":case"MultiLineString":n=yr;break;case"Polygon":case"MultiPolygon":case"Sphere":n=vr;break;default:return null}return t.geoStream(e,r(n)),n.result()}ar.invert=function(e,t){return ce.invert(e/ir,t)};var dr=[],mr=[],gr={point:function(e,t){dr.push([e,t])},result:function(){var e=dr.length?dr.length<2?{type:"Point",coordinates:dr[0]}:{type:"MultiPoint",coordinates:dr}:null;return dr=[],e}},yr={lineStart:ur,point:function(e,t){dr.push([e,t])},lineEnd:function(){dr.length&&(mr.push(dr),dr=[])},result:function(){var e=mr.length?mr.length<2?{type:"LineString",coordinates:mr[0]}:{type:"MultiLineString",coordinates:mr}:null;return mr=[],e}},vr={polygonStart:ur,lineStart:ur,point:function(e,t){dr.push([e,t])},lineEnd:function(){var e=dr.length;if(e){do{dr.push(dr[0].slice())}while(++e<4);mr.push(dr),dr=[]}},polygonEnd:ur,result:function(){if(!mr.length)return null;var e=[],t=[];return mr.forEach((function(r){!function(e){if((t=e.length)<4)return!1;for(var t,r=0,n=e[t-1][1]*e[0][0]-e[t-1][0]*e[0][1];++r<t;)n+=e[r-1][1]*e[r][0]-e[r-1][0]*e[r][1];return n<=0}(r)?t.push(r):e.push([r])})),t.forEach((function(t){var r=t[0];e.some((function(e){if(function(e,t){for(var r=t[0],n=t[1],i=!1,a=0,o=e.length,s=o-1;a<o;s=a++){var l=e[a],c=l[0],u=l[1],h=e[s],f=h[0],p=h[1];u>n^p>n&&r<(f-c)*(n-u)/(p-u)+c&&(i=!i)}return i}(e[0],r))return e.push(t),!0}))||e.push([t])})),mr=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}};function xr(e){var r=e(_,0)[0]-e(-_,0)[0];function i(t,i){var a=n(t)<_,o=e(a?t:t>0?t-x:t+x,i),s=(o[0]-o[1])*w,l=(o[0]+o[1])*w;if(a)return[s,l];var c=r*w,u=s>0^l>0?-1:1;return[u*s-d(l)*c,u*l-d(s)*c]}return e.invert&&(i.invert=function(t,i){var a=(t+i)*w,o=(i-t)*w,s=n(a)<.5*r&&n(o)<.5*r;if(!s){var l=r*w,c=a>0^o>0?-1:1,u=-c*t+(o>0?1:-1)*l,h=-c*i+(a>0?1:-1)*l;a=(-u-h)*w,o=(u-h)*w}var f=e.invert(a,o);return s||(f[0]+=a>0?x:-x),f}),t.geoProjection(i).rotate([-90,-90,45]).clipAngle(179.999)}function _r(){return xr(Ve).scale(111.48)}function br(e){var t=m(e);function r(r,n){var a=t?g(r*t/2)/t:r/2;if(!n)return[2*a,-e];var s=2*i(a*m(n)),l=1/g(n);return[m(s)*l,n+(1-o(s))*l-e]}return r.invert=function(r,a){if(n(a+=e)<y)return[t?2*i(t*r/2)/t:r,0];var s,l=r*r+a*a,c=0,u=10;do{var h=g(c),f=1/o(c),p=l-2*a*c+c*c;c-=s=(h*p+2*(c-a))/(2+p*f*f+2*(c-a)*h)}while(n(s)>y&&--u>0);var d=r*(h=g(c)),v=g(n(a)<n(c+1/h)?.5*E(d):.5*C(d)+x/4)/m(c);return[t?2*i(t*v)/t:2*v,c]},r}var wr=[[.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]];function Tr(e,t){var r,i=h(18,36*n(t)/x),a=l(i),o=i-a,s=(r=wr[a])[0],c=r[1],u=(r=wr[++a])[0],f=r[1],p=(r=wr[h(19,++a)])[0],d=r[1];return[e*(u+o*(p-s)/2+o*o*(p-2*u+s)/2),(t>0?_:-_)*(f+o*(d-c)/2+o*o*(d-2*f+c)/2)]}function kr(e,t){var r=function(e){function t(t,r){var n=o(r),i=(e-1)/(e-n*o(t));return[i*n*m(t),i*m(r)]}return t.invert=function(t,r){var n=t*t+r*r,i=I(n),o=(e-I(1-n*(e+1)/(e-1)))/((e-1)/i+i/(e-1));return[a(t*o,i*I(1-o*o)),i?E(r*o/i):0]},t}(e);if(!t)return r;var n=o(t),i=m(t);function s(t,a){var o=r(t,a),s=o[1],l=s*i/(e-1)+n;return[o[0]*n/l,s/l]}return s.invert=function(t,a){var o=(e-1)/(e-1-a*i);return r.invert(o*t,o*a*n)},s}wr.forEach((function(e){e[1]*=1.0144})),Tr.invert=function(e,t){var r=t/_,i=90*r,a=h(18,n(i/5)),o=u(0,l(a));do{var s=wr[o][1],c=wr[o+1][1],f=wr[h(19,o+2)][1],p=f-s,d=f-2*c+s,m=2*(n(r)-c)/p,g=d/p,y=m*(1-g*m*(1-2*g*m));if(y>=0||1===o){i=(t>=0?5:-5)*(y+a);var x,b=50;do{y=(a=h(18,n(i)/5))-(o=l(a)),s=wr[o][1],c=wr[o+1][1],f=wr[h(19,o+2)][1],i-=(x=(t>=0?_:-_)*(c+y*(f-s)/2+y*y*(f-2*c+s)/2)-t)*M}while(n(x)>v&&--b>0);break}}while(--o>=0);var w=wr[o][0],T=wr[o+1][0],k=wr[h(19,o+2)][0];return[e/(T+y*(k-w)/2+y*y*(k-2*T+w)/2),i*S]};var Ar=1e-4,Mr=-180,Sr=Mr+Ar,Er=180-Ar,Cr=-90+Ar,Ir=90-Ar;function Lr(e){return e.length>0}function Pr(e){return Math.floor(1e4*e)/1e4}function zr(e){return-90===e||90===e?[0,e]:[Mr,Pr(e)]}function Dr(e){var t=e[0],r=e[1],n=!1;return t<=Sr?(t=Mr,n=!0):t>=Er&&(t=180,n=!0),r<=Cr?(r=-90,n=!0):r>=Ir&&(r=90,n=!0),n?[t,r]:e}function Or(e){return e.map(Dr)}function Rr(e,t,r){for(var n=0,i=e.length;n<i;++n){var a=e[n].slice();r.push({index:-1,polygon:t,ring:a});for(var o=0,s=a.length;o<s;++o){var l=a[o],c=l[0],u=l[1];if(c<=Sr||c>=Er||u<=Cr||u>=Ir){a[o]=Dr(l);for(var h=o+1;h<s;++h){var f=a[h],p=f[0],d=f[1];if(p>Sr&&p<Er&&d>Cr&&d<Ir)break}if(h===o+1)continue;if(o){var m={index:-1,polygon:t,ring:a.slice(0,o+1)};m.ring[m.ring.length-1]=zr(u),r[r.length-1]=m}else r.pop();if(h>=s)break;r.push({index:-1,polygon:t,ring:a=a.slice(h-1)}),a[0]=zr(a[0][1]),o=-1,s=a.length}}}}function Fr(e){var t,r,n,i,a,o,s=e.length,l={},c={};for(t=0;t<s;++t)n=(r=e[t]).ring[0],a=r.ring[r.ring.length-1],n[0]!==a[0]||n[1]!==a[1]?(r.index=t,l[n]=c[a]=r):(r.polygon.push(r.ring),e[t]=null);for(t=0;t<s;++t)if(r=e[t]){if(n=r.ring[0],a=r.ring[r.ring.length-1],i=c[n],o=l[a],delete l[n],delete c[a],n[0]===a[0]&&n[1]===a[1]){r.polygon.push(r.ring);continue}i?(delete c[n],delete l[i.ring[0]],i.ring.pop(),e[i.index]=null,r={index:-1,polygon:i.polygon,ring:i.ring.concat(r.ring)},i===o?r.polygon.push(r.ring):(r.index=s++,e.push(l[r.ring[0]]=c[r.ring[r.ring.length-1]]=r))):o?(delete l[a],delete c[o.ring[o.ring.length-1]],r.ring.pop(),r={index:s++,polygon:o.polygon,ring:r.ring.concat(o.ring)},e[o.index]=null,e.push(l[r.ring[0]]=c[r.ring[r.ring.length-1]]=r)):(r.ring.push(r.ring[0]),r.polygon.push(r.ring))}}function Br(e){var t={type:"Feature",geometry:jr(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}function jr(e){if(null==e)return e;var t,r,n,i;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(jr)};break;case"Point":t={type:"Point",coordinates:Dr(e.coordinates)};break;case"MultiPoint":case"LineString":t={type:e.type,coordinates:Or(e.coordinates)};break;case"MultiLineString":t={type:"MultiLineString",coordinates:e.coordinates.map(Or)};break;case"Polygon":var a=[];Rr(e.coordinates,a,r=[]),Fr(r),t={type:"Polygon",coordinates:a};break;case"MultiPolygon":r=[],n=-1,i=e.coordinates.length;for(var o=new Array(i);++n<i;)Rr(e.coordinates[n],o[n]=[],r);Fr(r),t={type:"MultiPolygon",coordinates:o.filter(Lr)};break;default:return e}return null!=e.bbox&&(t.bbox=e.bbox),t}function Nr(e,t){var r=g(t/2),n=m(b*r);return[e*(.74482-.34588*n*n),1.70711*r]}function Ur(e,r,n){var i=t.geoInterpolate(r,n),a=i(.5),o=t.geoRotation([-a[0],-a[1]])(r),s=i.distance/2,l=-E(m(o[1]*S)/m(s)),c=[-a[0],-a[1],-(o[0]>0?x-l:l)*M],u=t.geoProjection(e(s)).rotate(c),h=t.geoRotation(c),f=u.center;return delete u.rotate,u.center=function(e){return arguments.length?f(h(e)):h.invert(f())},u.clipAngle(90)}function Vr(e){var r=o(e);function n(e,n){var i=t.geoGnomonicRaw(e,n);return i[0]*=r,i}return n.invert=function(e,n){return t.geoGnomonicRaw.invert(e/r,n)},n}function qr(e,t){return Ur(Vr,e,t)}function Hr(e){if(!(e*=2))return t.geoAzimuthalEquidistantRaw;var r=-e/2,n=-r,i=e*e,s=g(n),l=.5/m(n);function c(t,a){var s=C(o(a)*o(t-r)),l=C(o(a)*o(t-n));return[((s*=s)-(l*=l))/(2*e),(a<0?-1:1)*I(4*i*l-(i-s+l)*(i-s+l))/(2*e)]}return c.invert=function(e,t){var i,c,u=t*t,h=o(I(u+(i=e+r)*i)),f=o(I(u+(i=e+n)*i));return[a(c=h-f,i=(h+f)*s),(t<0?-1:1)*C(I(i*i+c*c)*l)]},c}function Gr(e,t){return Ur(Hr,e,t)}function Wr(e,t){if(n(t)<y)return[e,0];var r=n(t/_),i=E(r);if(n(e)<y||n(n(t)-_)<y)return[0,d(t)*x*g(i/2)];var a=o(i),s=n(x/e-e/x)/2,l=s*s,c=a/(r+a-1),u=c*(2/r-1),h=u*u,f=h+l,p=c-h,m=l+c;return[d(e)*x*(s*p+I(l*p*p-f*(c*c-h)))/f,d(t)*x*(u*m-s*I((l+1)*f-m*m))/f]}function Zr(e,t){if(n(t)<y)return[e,0];var r=n(t/_),i=E(r);if(n(e)<y||n(n(t)-_)<y)return[0,d(t)*x*g(i/2)];var a=o(i),s=n(x/e-e/x)/2,l=s*s,c=a*(I(1+l)-s*a)/(1+l*r*r);return[d(e)*x*c,d(t)*x*I(1-c*(2*s+c))]}function Yr(e,t){if(n(t)<y)return[e,0];var r=t/_,i=E(r);if(n(e)<y||n(n(t)-_)<y)return[0,x*g(i/2)];var a=(x/e-e/x)/2,s=r/(1+o(i));return[x*(d(e)*I(a*a+1-s*s)-a),x*s]}function Xr(e,t){if(!t)return[e,0];var r=n(t);if(!e||r===_)return[0,t];var i=r/_,a=i*i,o=(8*i-a*(a+2)-5)/(2*a*(i-1)),s=o*o,l=i*o,c=a+s+2*l,u=i+3*o,h=e/_,f=h+1/h,p=d(n(e)-_)*I(f*f-4),m=p*p,g=(p*(c+s-1)+2*I(c*(a+s*m-1)+(1-a)*(a*(u*u+4*s)+12*l*s+4*s*s)))/(4*c+m);return[d(e)*_*g,d(t)*_*I(1+p*n(g)-g*g)]}function $r(e,t,r,n){var i=x/3;e=u(e,y),t=u(t,y),e=h(e,_),t=h(t,x-y),r=u(r,0),r=h(r,100-y);var s=(n=u(n,y))/100,l=C((r/100+1)*o(i))/i,c=m(e)/m(l*_),f=t/x,p=I(s*m(e/2)/m(t/2));return function(e,t,r,n,i){function s(a,s){var l=r*m(n*s),c=I(1-l*l),u=I(2/(1+c*o(a*=i)));return[e*c*u*m(a),t*l*u]}return s.invert=function(o,s){var l=o/e,c=s/t,u=I(l*l+c*c),h=2*E(u/2);return[a(o*g(h),e*u)/i,u&&E(s*m(h)/(t*r*u))/n]},s}(p/I(f*c*l),1/(p*I(f*c*l)),c,l,f)}function Kr(){var e=65*S,r=60*S,n=20,i=200,a=t.geoProjectionMutator($r),o=a(e,r,n,i);return o.poleline=function(t){return arguments.length?a(e=+t*S,r,n,i):e*M},o.parallels=function(t){return arguments.length?a(e,r=+t*S,n,i):r*M},o.inflation=function(t){return arguments.length?a(e,r,n=+t,i):n},o.ratio=function(t){return arguments.length?a(e,r,n,i=+t):i},o.scale(163.775)}Nr.invert=function(e,t){var r=t/1.70711,n=m(b*r);return[e/(.74482-.34588*n*n),2*i(r)]},Wr.invert=function(e,t){if(n(t)<y)return[e,0];if(n(e)<y)return[0,_*m(2*i(t/x))];var r=(e/=x)*e,a=(t/=x)*t,s=r+a,l=s*s,c=-n(t)*(1+s),u=c-2*a+r,h=-2*c+1+2*a+l,f=a/h+(2*u*u*u/(h*h*h)-9*c*u/(h*h))/27,p=(c-u*u/(3*h))/h,g=2*I(-p/3),v=C(3*f/(p*g))/3;return[x*(s-1+I(1+2*(r-a)+l))/(2*e),d(t)*x*(-g*o(v+x/3)-u/(3*h))]},Zr.invert=function(e,t){if(!e)return[0,_*m(2*i(t/x))];var r=n(e/x),o=(1-r*r-(t/=x)*t)/(2*r),s=I(o*o+1);return[d(e)*x*(s-o),d(t)*_*m(2*a(I((1-2*o*r)*(o+s)-r),I(s+o+r)))]},Yr.invert=function(e,t){if(!t)return[e,0];var r=t/x,n=(x*x*(1-r*r)-e*e)/(2*x*e);return[e?x*(d(e)*I(n*n+1)-n):0,_*m(2*i(r))]},Xr.invert=function(e,t){var r;if(!e||!t)return[e,t];t/=x;var i=d(e)*e/_,a=(i*i-1+4*t*t)/n(i),o=a*a,s=2*t,l=50;do{var c=s*s,u=(8*s-c*(c+2)-5)/(2*c*(s-1)),h=(3*s-c*s-10)/(2*c*s),f=u*u,p=s*u,m=s+u,g=m*m,v=s+3*u,b=-2*m*(4*p*f+(1-4*c+3*c*c)*(1+h)+f*(14*c-6-o+(8*c-8-2*o)*h)+p*(12*c-8+(10*c-10-o)*h)),w=I(g*(c+f*o-1)+(1-c)*(c*(v*v+4*f)+f*(12*p+4*f)));s-=r=(a*(g+f-1)+2*w-i*(4*g+o))/(a*(2*u*h+2*m*(1+h))+b/w-8*m*(a*(-1+f+g)+2*w)*(1+h)/(o+4*g))}while(r>y&&--l>0);return[d(e)*(I(a*a+4)+a)*x/4,_*s]};var Jr=4*x+3*I(3),Qr=2*I(2*x*I(3)/Jr),en=Z(Qr*I(3)/x,Qr,Jr/6);function tn(e,t){return[e*I(1-3*t*t/(x*x)),t]}function rn(e,t){var r=o(t),n=o(e)*r,i=1-n,s=o(e=a(m(e)*r,-m(t))),l=m(e);return[l*(r=I(1-n*n))-s*i,-s*r-l*i]}function nn(e,t){var r=D(e,t);return[(r[0]+e/_)/2,(r[1]+t)/2]}tn.invert=function(e,t){return[e/I(1-3*t*t/(x*x)),t]},rn.invert=function(e,t){var r=(e*e+t*t)/-2,n=I(-r*(2+r)),i=t*r+e*n,o=e*r-t*n,s=I(o*o+i*i);return[a(n*i,s*(1+r)),s?-E(n*o/s):0]},nn.invert=function(e,t){var r=e,i=t,a=25;do{var s,l=o(i),c=m(i),u=m(2*i),h=c*c,f=l*l,p=m(r),d=o(r/2),g=m(r/2),v=g*g,x=1-f*d*d,b=x?C(l*d)*I(s=1/x):s=0,w=.5*(2*b*l*g+r/_)-e,T=.5*(b*c+i)-t,k=.5*s*(f*v+b*l*d*h)+.5/_,A=s*(p*u/4-b*c*g),M=.125*s*(u*g-b*c*f*p),S=.5*s*(h*d+b*v*l)+.5,E=A*M-S*k,L=(T*A-w*S)/E,P=(w*M-T*k)/E;r-=L,i-=P}while((n(L)>y||n(P)>y)&&--a>0);return[r,i]},e.geoNaturalEarth=t.geoNaturalEarth1,e.geoNaturalEarthRaw=t.geoNaturalEarth1Raw,e.geoAiry=function(){var e=_,r=t.geoProjectionMutator(z),n=r(e);return n.radius=function(t){return arguments.length?r(e=t*S):e*M},n.scale(179.976).clipAngle(147)},e.geoAiryRaw=z,e.geoAitoff=function(){return t.geoProjection(D).scale(152.63)},e.geoAitoffRaw=D,e.geoArmadillo=function(){var e=20*S,r=e>=0?1:-1,n=g(r*e),i=t.geoProjectionMutator(O),s=i(e),l=s.stream;return s.parallel=function(t){return arguments.length?(n=g((r=(e=t*S)>=0?1:-1)*e),i(e)):e*M},s.stream=function(t){var i=s.rotate(),c=l(t),u=(s.rotate([0,0]),l(t)),h=s.precision();return s.rotate(i),c.sphere=function(){u.polygonStart(),u.lineStart();for(var t=-180*r;r*t<180;t+=90*r)u.point(t,90*r);if(e)for(;r*(t-=3*r*h)>=-180;)u.point(t,r*-a(o(t*S/2),n)*M);u.lineEnd(),u.polygonEnd()},c},s.scale(218.695).center([0,28.0974])},e.geoArmadilloRaw=O,e.geoAugust=function(){return t.geoProjection(R).scale(66.1603)},e.geoAugustRaw=R,e.geoBaker=function(){return t.geoProjection(j).scale(112.314)},e.geoBakerRaw=j,e.geoBerghaus=function(){var e=5,r=t.geoProjectionMutator(N),n=r(e),i=n.stream,s=.01,l=-o(s*S),c=m(s*S);return n.lobes=function(t){return arguments.length?r(e=+t):e},n.stream=function(t){var r=n.rotate(),u=i(t),h=(n.rotate([0,0]),i(t));return n.rotate(r),u.sphere=function(){h.polygonStart(),h.lineStart();for(var t=0,r=360/e,n=2*x/e,i=90-180/e,u=_;t<e;++t,i-=r,u-=n)h.point(a(c*o(u),l)*M,E(c*m(u))*M),i<-90?(h.point(-90,-180-i-s),h.point(-90,-180-i+s)):(h.point(90,i+s),h.point(90,i-s));h.lineEnd(),h.polygonEnd()},u},n.scale(87.8076).center([0,17.1875]).clipAngle(179.999)},e.geoBerghausRaw=N,e.geoBertin1953=function(){return t.geoProjection(G()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])},e.geoBertin1953Raw=G,e.geoBoggs=function(){return t.geoProjection(K).scale(160.857)},e.geoBoggsRaw=K,e.geoBonne=function(){return J(ee).scale(123.082).center([0,26.1441]).parallel(45)},e.geoBonneRaw=ee,e.geoBottomley=function(){var e=.5,r=t.geoProjectionMutator(te),n=r(e);return n.fraction=function(t){return arguments.length?r(e=+t):e},n.scale(158.837)},e.geoBottomleyRaw=te,e.geoBromley=function(){return t.geoProjection(re).scale(152.63)},e.geoBromleyRaw=re,e.geoChamberlin=le,e.geoChamberlinRaw=oe,e.geoChamberlinAfrica=function(){return le([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])},e.geoCollignon=function(){return t.geoProjection(ce).scale(95.6464).center([0,30])},e.geoCollignonRaw=ce,e.geoCraig=function(){return J(ue).scale(249.828).clipAngle(90)},e.geoCraigRaw=ue,e.geoCraster=function(){return t.geoProjection(fe).scale(156.19)},e.geoCrasterRaw=fe,e.geoCylindricalEqualArea=function(){return J(pe).parallel(38.58).scale(195.044)},e.geoCylindricalEqualAreaRaw=pe,e.geoCylindricalStereographic=function(){return J(de).scale(124.75)},e.geoCylindricalStereographicRaw=de,e.geoEckert1=function(){return t.geoProjection(me).scale(165.664)},e.geoEckert1Raw=me,e.geoEckert2=function(){return t.geoProjection(ge).scale(165.664)},e.geoEckert2Raw=ge,e.geoEckert3=function(){return t.geoProjection(ye).scale(180.739)},e.geoEckert3Raw=ye,e.geoEckert4=function(){return t.geoProjection(ve).scale(180.739)},e.geoEckert4Raw=ve,e.geoEckert5=function(){return t.geoProjection(xe).scale(173.044)},e.geoEckert5Raw=xe,e.geoEckert6=function(){return t.geoProjection(_e).scale(173.044)},e.geoEckert6Raw=_e,e.geoEisenlohr=function(){return t.geoProjection(we).scale(62.5271)},e.geoEisenlohrRaw=we,e.geoFahey=function(){return t.geoProjection(ke).scale(137.152)},e.geoFaheyRaw=ke,e.geoFoucaut=function(){return t.geoProjection(Ae).scale(135.264)},e.geoFoucautRaw=Ae,e.geoFoucautSinusoidal=function(){var e=.5,r=t.geoProjectionMutator(Me),n=r(e);return n.alpha=function(t){return arguments.length?r(e=+t):e},n.scale(168.725)},e.geoFoucautSinusoidalRaw=Me,e.geoGilbert=function(e){null==e&&(e=t.geoOrthographic);var r=e(),n=t.geoEquirectangular().scale(M).precision(0).clipAngle(null).translate([0,0]);function i(e){return r(Se(e))}function a(e){i[e]=function(){return arguments.length?(r[e].apply(r,arguments),i):r[e]()}}return r.invert&&(i.invert=function(e){return Ee(r.invert(e))}),i.stream=function(e){var t=r.stream(e),i=n.stream({point:function(e,r){t.point(e/2,E(g(-r/2*S))*M)},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}});return i.sphere=t.sphere,i},i.rotate=function(e){return arguments.length?(n.rotate(e),i):n.rotate()},i.center=function(e){return arguments.length?(r.center(Se(e)),i):Ee(r.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)},e.geoGingery=function(){var e=6,r=30*S,n=o(r),i=m(r),s=t.geoProjectionMutator(Ce),l=s(r,e),c=l.stream,u=-o(.01*S),h=m(.01*S);return l.radius=function(t){return arguments.length?(n=o(r=t*S),i=m(r),s(r,e)):r*M},l.lobes=function(t){return arguments.length?s(r,e=+t):e},l.stream=function(t){var r=l.rotate(),s=c(t),f=(l.rotate([0,0]),c(t));return l.rotate(r),s.sphere=function(){f.polygonStart(),f.lineStart();for(var t=0,r=2*x/e,s=0;t<e;++t,s-=r)f.point(a(h*o(s),u)*M,E(h*m(s))*M),f.point(a(i*o(s-r/2),n)*M,E(i*m(s-r/2))*M);f.lineEnd(),f.polygonEnd()},s},l.rotate([90,-40]).scale(91.7095).clipAngle(179.999)},e.geoGingeryRaw=Ce,e.geoGinzburg4=function(){return t.geoProjection(ze).scale(149.995)},e.geoGinzburg4Raw=ze,e.geoGinzburg5=function(){return t.geoProjection(De).scale(153.93)},e.geoGinzburg5Raw=De,e.geoGinzburg6=function(){return t.geoProjection(Oe).scale(130.945)},e.geoGinzburg6Raw=Oe,e.geoGinzburg8=function(){return t.geoProjection(Re).scale(131.747)},e.geoGinzburg8Raw=Re,e.geoGinzburg9=function(){return t.geoProjection(Fe).scale(131.087)},e.geoGinzburg9Raw=Fe,e.geoGringorten=function(){return t.geoProjection(Be(je)).scale(239.75)},e.geoGringortenRaw=je,e.geoGuyou=function(){return t.geoProjection(Be(Ve)).scale(151.496)},e.geoGuyouRaw=Ve,e.geoHammer=function(){var e=2,r=t.geoProjectionMutator(U),n=r(e);return n.coefficient=function(t){return arguments.length?r(e=+t):e},n.scale(169.529)},e.geoHammerRaw=U,e.geoHammerRetroazimuthal=function(){var e=0,r=t.geoProjectionMutator(qe),n=r(e),i=n.rotate,a=n.stream,o=t.geoCircle();return n.parallel=function(t){if(!arguments.length)return e*M;var i=n.rotate();return r(e=t*S).rotate(i)},n.rotate=function(t){return arguments.length?(i.call(n,[t[0],t[1]-e*M]),o.center([-t[0],-t[1]]),n):((t=i.call(n))[1]+=e*M,t)},n.stream=function(e){return(e=a(e)).sphere=function(){e.polygonStart();var t,r=o.radius(89.99)().coordinates[0],n=r.length-1,i=-1;for(e.lineStart();++i<n;)e.point((t=r[i])[0],t[1]);for(e.lineEnd(),n=(r=o.radius(90.01)().coordinates[0]).length-1,e.lineStart();--i>=0;)e.point((t=r[i])[0],t[1]);e.lineEnd(),e.polygonEnd()},e},n.scale(79.4187).parallel(45).clipAngle(179.999)},e.geoHammerRetroazimuthalRaw=qe,e.geoHealpix=function(){var e=4,n=t.geoProjectionMutator(Ze),i=n(e),a=i.stream;return i.lobes=function(t){return arguments.length?n(e=+t):e},i.stream=function(n){var o=i.rotate(),s=a(n),l=(i.rotate([0,0]),a(n));return i.rotate(o),s.sphere=function(){t.geoStream(function(e){var t=[].concat(r.range(-180,180+e/2,e).map(Ye),r.range(180,-180-e/2,-e).map(Xe));return{type:"Polygon",coordinates:[180===e?t.map($e):t]}}(180/e),l)},s},i.scale(239.75)},e.geoHealpixRaw=Ze,e.geoHill=function(){var e=1,r=t.geoProjectionMutator(Ke),n=r(e);return n.ratio=function(t){return arguments.length?r(e=+t):e},n.scale(167.774).center([0,18.67])},e.geoHillRaw=Ke,e.geoHomolosine=function(){return t.geoProjection(tt).scale(152.63)},e.geoHomolosineRaw=tt,e.geoHufnagel=function(){var e=1,r=0,n=45*S,i=2,a=t.geoProjectionMutator(rt),o=a(e,r,n,i);return o.a=function(t){return arguments.length?a(e=+t,r,n,i):e},o.b=function(t){return arguments.length?a(e,r=+t,n,i):r},o.psiMax=function(t){return arguments.length?a(e,r,n=+t*S,i):n*M},o.ratio=function(t){return arguments.length?a(e,r,n,i=+t):i},o.scale(180.739)},e.geoHufnagelRaw=rt,e.geoHyperelliptical=function(){var e=0,r=2.5,n=1.183136,i=t.geoProjectionMutator(at),a=i(e,r,n);return a.alpha=function(t){return arguments.length?i(e=+t,r,n):e},a.k=function(t){return arguments.length?i(e,r=+t,n):r},a.gamma=function(t){return arguments.length?i(e,r,n=+t):n},a.scale(152.63)},e.geoHyperellipticalRaw=at,e.geoInterrupt=lt,e.geoInterruptedBoggs=function(){return lt(K,ct).scale(160.857)},e.geoInterruptedHomolosine=function(){return lt(tt,ut).scale(152.63)},e.geoInterruptedMollweide=function(){return lt(Y,ht).scale(169.529)},e.geoInterruptedMollweideHemispheres=function(){return lt(Y,ft).scale(169.529).rotate([20,0])},e.geoInterruptedSinuMollweide=function(){return lt(et,pt,H).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoInterruptedSinusoidal=function(){return lt(Q,dt).scale(152.63).rotate([-20,0])},e.geoKavrayskiy7=function(){return t.geoProjection(mt).scale(158.837)},e.geoKavrayskiy7Raw=mt,e.geoLagrange=function(){var e=.5,r=t.geoProjectionMutator(gt),n=r(e);return n.spacing=function(t){return arguments.length?r(e=+t):e},n.scale(124.75)},e.geoLagrangeRaw=gt,e.geoLarrivee=function(){return t.geoProjection(vt).scale(97.2672)},e.geoLarriveeRaw=vt,e.geoLaskowski=function(){return t.geoProjection(xt).scale(139.98)},e.geoLaskowskiRaw=xt,e.geoLittrow=function(){return t.geoProjection(_t).scale(144.049).clipAngle(89.999)},e.geoLittrowRaw=_t,e.geoLoximuthal=function(){return J(bt).parallel(40).scale(158.837)},e.geoLoximuthalRaw=bt,e.geoMiller=function(){return t.geoProjection(wt).scale(108.318)},e.geoMillerRaw=wt,e.geoModifiedStereographic=Ct,e.geoModifiedStereographicRaw=Tt,e.geoModifiedStereographicAlaska=function(){return Ct(kt,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},e.geoModifiedStereographicGs48=function(){return Ct(At,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},e.geoModifiedStereographicGs50=function(){return Ct(Mt,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},e.geoModifiedStereographicMiller=function(){return Ct(St,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},e.geoModifiedStereographicLee=function(){return Ct(Et,[165,10]).scale(250).clipAngle(130).center([-165,-10])},e.geoMollweide=function(){return t.geoProjection(Y).scale(169.529)},e.geoMollweideRaw=Y,e.geoMtFlatPolarParabolic=function(){return t.geoProjection(Pt).scale(164.859)},e.geoMtFlatPolarParabolicRaw=Pt,e.geoMtFlatPolarQuartic=function(){return t.geoProjection(zt).scale(188.209)},e.geoMtFlatPolarQuarticRaw=zt,e.geoMtFlatPolarSinusoidal=function(){return t.geoProjection(Dt).scale(166.518)},e.geoMtFlatPolarSinusoidalRaw=Dt,e.geoNaturalEarth2=function(){return t.geoProjection(Ot).scale(175.295)},e.geoNaturalEarth2Raw=Ot,e.geoNellHammer=function(){return t.geoProjection(Rt).scale(152.63)},e.geoNellHammerRaw=Rt,e.geoInterruptedQuarticAuthalic=function(){return lt(U(1/0),Ft).rotate([20,0]).scale(152.63)},e.geoNicolosi=function(){return t.geoProjection(Bt).scale(127.267)},e.geoNicolosiRaw=Bt,e.geoPatterson=function(){return t.geoProjection(Zt).scale(139.319)},e.geoPattersonRaw=Zt,e.geoPolyconic=function(){return t.geoProjection(Yt).scale(103.74)},e.geoPolyconicRaw=Yt,e.geoPolyhedral=Jt,e.geoPolyhedralButterfly=function(e){e=e||function(e){var r=t.geoCentroid({type:"MultiPoint",coordinates:e});return t.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=nr.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,t){var n=r[e];n&&(n.children||(n.children=[])).push(r[t])})),Jt(r[0],(function(e,t){return r[e<-x/2?t<0?6:4:e<0?t<0?2:0:e<x/2?t<0?3:1:t<0?7:5]})).angle(-30).scale(101.858).center([0,45])},e.geoPolyhedralCollignon=function(e){e=e||function(e){var r=t.geoCentroid({type:"MultiPoint",coordinates:e});return t.geoProjection(ar).translate([0,0]).scale(1).rotate(r[1]>0?[-r[0],0]:[180-r[0],180])};var r=nr.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,t){var n=r[e];n&&(n.children||(n.children=[])).push(r[t])})),Jt(r[0],(function(e,t){return r[e<-x/2?t<0?6:4:e<0?t<0?2:0:e<x/2?t<0?3:1:t<0?7:5]})).angle(-30).scale(121.906).center([0,48.5904])},e.geoPolyhedralWaterman=function(e){e=e||function(e){var r=6===e.length?t.geoCentroid({type:"MultiPoint",coordinates:e}):e[0];return t.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=nr.map((function(e){for(var t,r=e.map(cr),n=r.length,i=r[n-1],a=[],o=0;o<n;++o)t=r[o],a.push(lr([.9486832980505138*i[0]+.31622776601683794*t[0],.9486832980505138*i[1]+.31622776601683794*t[1],.9486832980505138*i[2]+.31622776601683794*t[2]]),lr([.9486832980505138*t[0]+.31622776601683794*i[0],.9486832980505138*t[1]+.31622776601683794*i[1],.9486832980505138*t[2]+.31622776601683794*i[2]])),i=t;return a})),n=[],i=[-1,0,0,1,0,1,4,5];r.forEach((function(e,t){for(var a=nr[t],o=a.length,s=n[t]=[],l=0;l<o;++l)r.push([a[l],e[(2*l+2)%(2*o)],e[(2*l+1)%(2*o)]]),i.push(t),s.push(sr(cr(e[(2*l+2)%(2*o)]),cr(e[(2*l+1)%(2*o)])))}));var a=r.map((function(t){return{project:e(t),face:t}}));return i.forEach((function(e,t){var r=a[e];r&&(r.children||(r.children=[])).push(a[t])})),Jt(a[0],(function(e,t){var r=o(t),i=[r*o(e),r*m(e),m(t)],s=e<-x/2?t<0?6:4:e<0?t<0?2:0:e<x/2?t<0?3:1:t<0?7:5,l=n[s];return a[or(l[0],i)<0?8+3*s:or(l[1],i)<0?8+3*s+1:or(l[2],i)<0?8+3*s+2:s]})).angle(-30).scale(110.625).center([0,45])},e.geoProject=function(e,t){var r,n=t.stream;if(!n)throw new Error("invalid projection");switch(e&&e.type){case"Feature":r=fr;break;case"FeatureCollection":r=hr;break;default:r=pr}return r(e,n)},e.geoGringortenQuincuncial=function(){return xr(je).scale(176.423)},e.geoPeirceQuincuncial=_r,e.geoPierceQuincuncial=_r,e.geoQuantize=function(e,t){if(!(0<=(t=+t)&&t<=20))throw new Error("invalid digits");function r(e){var r=e.length,n=2,i=new Array(r);for(i[0]=+e[0].toFixed(t),i[1]=+e[1].toFixed(t);n<r;)i[n]=e[n],++n;return i}function n(e){return e.map(r)}function i(e){for(var t=r(e[0]),n=[t],i=1;i<e.length;i++){var a=r(e[i]);(a.length>2||a[0]!=t[0]||a[1]!=t[1])&&(n.push(a),t=a)}return 1===n.length&&e.length>1&&n.push(r(e[e.length-1])),n}function a(e){return e.map(i)}function o(e){if(null==e)return e;var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(o)};break;case"Point":t={type:"Point",coordinates:r(e.coordinates)};break;case"MultiPoint":t={type:e.type,coordinates:n(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 null!=e.bbox&&(t.bbox=e.bbox),t}function s(e){var t={type:"Feature",properties:e.properties,geometry:o(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),t}if(null!=e)switch(e.type){case"Feature":return s(e);case"FeatureCollection":var l={type:"FeatureCollection",features:e.features.map(s)};return null!=e.bbox&&(l.bbox=e.bbox),l;default:return o(e)}return e},e.geoQuincuncial=xr,e.geoRectangularPolyconic=function(){return J(br).scale(131.215)},e.geoRectangularPolyconicRaw=br,e.geoRobinson=function(){return t.geoProjection(Tr).scale(152.63)},e.geoRobinsonRaw=Tr,e.geoSatellite=function(){var e=2,r=0,n=t.geoProjectionMutator(kr),i=n(e,r);return i.distance=function(t){return arguments.length?n(e=+t,r):e},i.tilt=function(t){return arguments.length?n(e,r=t*S):r*M},i.scale(432.147).clipAngle(C(1/e)*M-1e-6)},e.geoSatelliteRaw=kr,e.geoSinuMollweide=function(){return t.geoProjection(et).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoSinuMollweideRaw=et,e.geoSinusoidal=function(){return t.geoProjection(Q).scale(152.63)},e.geoSinusoidalRaw=Q,e.geoStitch=function(e){if(null==e)return e;switch(e.type){case"Feature":return Br(e);case"FeatureCollection":var t={type:"FeatureCollection",features:e.features.map(Br)};return null!=e.bbox&&(t.bbox=e.bbox),t;default:return jr(e)}},e.geoTimes=function(){return t.geoProjection(Nr).scale(146.153)},e.geoTimesRaw=Nr,e.geoTwoPointAzimuthal=qr,e.geoTwoPointAzimuthalRaw=Vr,e.geoTwoPointAzimuthalUsa=function(){return qr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},e.geoTwoPointEquidistant=Gr,e.geoTwoPointEquidistantRaw=Hr,e.geoTwoPointEquidistantUsa=function(){return Gr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},e.geoVanDerGrinten=function(){return t.geoProjection(Wr).scale(79.4183)},e.geoVanDerGrintenRaw=Wr,e.geoVanDerGrinten2=function(){return t.geoProjection(Zr).scale(79.4183)},e.geoVanDerGrinten2Raw=Zr,e.geoVanDerGrinten3=function(){return t.geoProjection(Yr).scale(79.4183)},e.geoVanDerGrinten3Raw=Yr,e.geoVanDerGrinten4=function(){return t.geoProjection(Xr).scale(127.16)},e.geoVanDerGrinten4Raw=Xr,e.geoWagner=Kr,e.geoWagner7=function(){return Kr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},e.geoWagnerRaw=$r,e.geoWagner4=function(){return t.geoProjection(en).scale(176.84)},e.geoWagner4Raw=en,e.geoWagner6=function(){return t.geoProjection(tn).scale(152.63)},e.geoWagner6Raw=tn,e.geoWiechel=function(){return t.geoProjection(rn).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},e.geoWiechelRaw=rn,e.geoWinkel3=function(){return t.geoProjection(nn).scale(158.837)},e.geoWinkel3Raw=nn,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&typeof t<"u"?n(e,Cg(),Eg()):n(r.d3=r.d3||{},r.d3,r.d3)}}),Lg=m({"src/plots/geo/zoom.js"(e,t){var r=b(),n=ct(),i=He(),a=Math.PI/180,o=180/Math.PI,s={cursor:"pointer"},l={cursor:"auto"};function c(e,t){return r.behavior.zoom().translate(t.translate()).scale(t.scale())}function u(e,t,r){var a=e.id,o=e.graphDiv,s=o.layout,l=s[a],c=o._fullLayout,u=c[a],h={},f={};function p(e,t){h[a+"."+e]=n.nestedProperty(l,e).get(),i.call("_storeDirectGUIEdit",s,c._preGUI,h);var r=n.nestedProperty(u,e);r.get()!==t&&(r.set(t),n.nestedProperty(l,e).set(t),f[a+"."+e]=t)}r(p),p("projection.scale",t.scale()/e.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",f)}function h(e,t){var n=c(0,t);function i(r){var n=t.invert(e.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return n.on("zoomstart",(function(){r.select(this).style(s)})).on("zoom",(function(){t.scale(r.event.scale).translate(r.event.translate),e.render(!0);var n=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":n[0],"geo.center.lat":n[1]})})).on("zoomend",(function(){r.select(this).style(l),u(e,t,i)})),n}function f(e,t){var n,i,a,o,h,f,p,d,m,g=c(0,t);function y(e){return t.invert(e)}function v(r){var n=t.rotate(),i=t.invert(e.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",(function(){r.select(this).style(s),n=r.mouse(this),i=t.rotate(),a=t.translate(),o=i,h=y(n)})).on("zoom",(function(){if(f=r.mouse(this),function(e){var r=y(e);if(!r)return!0;var n=t(r);return Math.abs(n[0]-e[0])>2||Math.abs(n[1]-e[1])>2}(n))return g.scale(t.scale()),void g.translate(t.translate());t.scale(r.event.scale),t.translate([a[0],r.event.translate[1]]),h?y(f)&&(d=y(f),p=[o[0]+(d[0]-h[0]),i[1],i[2]],t.rotate(p),o=p):h=y(n=f),m=!0,e.render(!0);var s=t.rotate(),l=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":l[0],"geo.center.lat":l[1],"geo.projection.rotation.lon":-s[0]})})).on("zoomend",(function(){r.select(this).style(l),m&&u(e,t,v)})),g}function p(e,t){var n,i={r:t.rotate(),k:t.scale()},h=c(0,t),f=function(e){for(var t=0,n=arguments.length,i=[];++t<n;)i.push(arguments[t]);var a=r.dispatch.apply(null,i);return a.of=function(t,n){return function(i){var o;try{o=i.sourceEvent=r.event,i.target=e,r.event=i,a[i.type].apply(t,n)}finally{r.event=o}}},a}(h,"zoomstart","zoom","zoomend"),p=0,g=h.on;function x(e){var r=t.rotate();e("projection.rotation.lon",-r[0]),e("projection.rotation.lat",-r[1])}return h.on("zoomstart",(function(){r.select(this).style(s);var e=r.mouse(this),l=t.rotate(),c=l,u=t.translate(),x=function(e){var t=.5*e[0]*a,r=.5*e[1]*a,n=.5*e[2]*a,i=Math.sin(t),o=Math.cos(t),s=Math.sin(r),l=Math.cos(r),c=Math.sin(n),u=Math.cos(n);return[o*l*u+i*s*c,i*l*u-o*s*c,o*s*u+i*l*c,o*l*c-i*s*u]}(l);n=d(t,e),g.call(h,"zoom",(function(){var a=r.mouse(this);if(t.scale(i.k=r.event.scale),n){if(d(t,a)){t.rotate(l).translate(u);var s=d(t,a),h=function(e,t){if(e&&t){var r=function(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]]}(e,t),n=Math.sqrt(v(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,v(e,t)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}(n,s),p=function(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(e,t){var r=e[0],n=e[1],i=e[2],a=e[3],o=t[0],s=t[1],l=t[2],c=t[3];return[r*o-n*s-i*l-a*c,r*s+n*o+i*c-a*l,r*l-n*c+i*o+a*s,r*c+n*l-i*s+a*o]}(x,h)),g=i.r=function(e,t,r){var n=y(t,2,e[0]);n=y(n,1,e[1]),n=y(n,0,e[2]-r[2]);var i,a,s=t[0],l=t[1],c=t[2],u=n[0],h=n[1],f=n[2],p=Math.atan2(l,s)*o,d=Math.sqrt(s*s+l*l);Math.abs(h)>d?(a=(h>0?90:-90)-p,i=0):(a=Math.asin(h/d)*o-p,i=Math.sqrt(d*d-h*h));var g=180-a-2*p,v=(Math.atan2(f,u)-Math.atan2(c,i))*o,x=(Math.atan2(f,u)-Math.atan2(c,-i))*o;return m(r[0],r[1],a,v)<=m(r[0],r[1],g,x)?[a,v,r[2]]:[g,x,r[2]]}(p,n,c);(!isFinite(g[0])||!isFinite(g[1])||!isFinite(g[2]))&&(g=c),t.rotate(g),c=g}}else n=d(t,e=a);!function(e){e({type:"zoom"})}(f.of(this,arguments))})),function(e){p++||e({type:"zoomstart"})}(f.of(this,arguments))})).on("zoomend",(function(){var n;r.select(this).style(l),g.call(h,"zoom",null),n=f.of(this,arguments),--p||n({type:"zoomend"}),u(e,t,x)})).on("zoom.redraw",(function(){e.render(!0);var r=t.rotate();e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})})),r.rebind(h,f,"on")}function d(e,t){var r=e.invert(t);return r&&isFinite(r[0])&&isFinite(r[1])&&function(e){var t=e[0]*a,r=e[1]*a,n=Math.cos(r);return[n*Math.cos(t),n*Math.sin(t),Math.sin(r)]}(r)}function m(e,t,r,n){var i=g(r-e),a=g(n-t);return Math.sqrt(i*i+a*a)}function g(e){return(e%360+540)%360-180}function y(e,t,r){var n=r*a,i=e.slice(),o=0===t?1:0,s=2===t?1:2,l=Math.cos(n),c=Math.sin(n);return i[o]=e[o]*l-e[s]*c,i[s]=e[s]*l+e[o]*c,i}function v(e,t){for(var r=0,n=0,i=e.length;n<i;++n)r+=e[n]*t[n];return r}t.exports=function(e,t){var r=e.projection;return(t._isScoped?h:t._isClipped?p:f)(e,r)}}}),Pg=m({"src/plots/geo/geo.js"(e,t){var r=b(),n=Cg(),i=n.geoPath,a=n.geoDistance,o=Ig(),s=He(),l=ct(),c=l.strTranslate,u=W(),h=er(),f=Or(),p=At(),d=ar(),m=ir().getAutoRange,g=pr(),y=Cn().prepSelect,v=Cn().clearOutline,x=Cn().selectOnClick,_=Lg(),w=hg(),T=wg(),k=pg(),A=fg().feature;function M(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 S=M.prototype;function E(e,t){var r=w.clipPad,n=e[0]+r,i=e[1]-r,a=t[0]+r,o=t[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}t.exports=function(e){return new M(e)},S.plot=function(e,t,r,n){var i=this;if(n)return i.update(e,t,!0);i._geoCalcData=e,i._fullLayout=t;var a=t[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var c=!1,u=0;u<e.length;u++){var h=e[0][0].trace;h._geo=i,h.locationmode&&(s=!0);var f=h.marker;if(f){var p=f.angle,d=f.angleref;(p||"north"===d||"previous"===d)&&(c=!0)}}if(this._hasMarkerAngles=c,s){var m=k.getTopojsonName(a);(null===i.topojson||m!==i.topojsonName)&&(i.topojsonName=m,void 0===PlotlyGeoAssets.topojson[i.topojsonName]&&o.push(i.fetchTopojson()))}o=o.concat(T.fetchTraceGeoData(e)),r.push(new Promise((function(r,n){Promise.all(o).then((function(){i.topojson=PlotlyGeoAssets.topojson[i.topojsonName],i.update(e,t),r()})).catch(n)})))},S.fetchTopojson=function(){var e=this,t=k.getTopojsonPath(e.topojsonURL,e.topojsonName);return new Promise((function(n,i){r.json(t,(function(r,a){if(r)return 404===r.status?i(new Error(["plotly.js could not find topojson file at",t+".","Make sure the *topojsonURL* plot config option","is set properly."].join(" "))):i(new Error(["unexpected error while fetching topojson file at",t].join(" ")));PlotlyGeoAssets.topojson[e.topojsonName]=a,n()}))}))},S.update=function(e,t,r){var n=t[this.id];this.hasChoropleth=!1;for(var i=0;i<e.length;i++){var a=e[i],o=a[0].trace;"choropleth"===o.type&&(this.hasChoropleth=!0),!0===o.visible&&o._length>0&&o._module.calcGeoJSON(a,t)}if(!r){if(this.updateProjection(e,t))return;(!this.viewInitial||this.scope!==n.scope)&&this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(t,n),this.updateDims(t,n),this.updateFx(t,n),p.generalUpdatePerTraceModule(this.graphDiv,this,e,n);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 l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},S.updateProjection=function(e,t){var r=this.graphDiv,s=t[this.id],c=t._size,u=s.domain,h=s.projection,f=s.lonaxis,p=s.lataxis,d=f._ax,g=p._ax,y=this.projection=function(e){var t=e.projection,r=t.type,s=w.projNames[r];s="geo"+l.titleCase(s);for(var c=(n[s]||o[s])(),u=e._isSatellite?180*Math.acos(1/t.distance)/Math.PI:e._isClipped?w.lonaxisSpan[r]/2:null,h=["center","rotate","parallels","clipExtent"],f=function(e){return e?c:[]},p=0;p<h.length;p++){var d=h[p];"function"!=typeof c[d]&&(c[d]=f)}return c.isLonLatOverEdges=function(e){if(null===c(e))return!0;if(u){var t=c.rotate();return a(e,[-t[0],-t[1]])>u*Math.PI/180}return!1},c.getPath=function(){return i().projection(c)},c.getBounds=function(e){return c.getPath().bounds(e)},c.precision(w.precision),e._isSatellite&&c.tilt(t.tilt).distance(t.distance),u&&c.clipAngle(u-w.clipPad),c}(s),v=[[c.l+c.w*u.x[0],c.t+c.h*(1-u.y[1])],[c.l+c.w*u.x[1],c.t+c.h*(1-u.y[0])]],x=s.center||{},_=h.rotation||{},b=f.range||[],T=p.range||[];if(s.fitbounds){d._length=v[1][0]-v[0][0],g._length=v[1][1]-v[0][1],d.range=m(r,d),g.range=m(r,g);var k=(d.range[0]+d.range[1])/2,A=(g.range[0]+g.range[1])/2;if(s._isScoped)x={lon:k,lat:A};else if(s._isClipped){x={lon:k,lat:A},_={lon:k,lat:A,roll:_.roll};var M=h.type,S=w.lonaxisSpan[M]/2||180,C=w.lataxisSpan[M]/2||90;b=[k-S,k+S],T=[A-C,A+C]}else x={lon:k,lat:A},_={lon:k,lat:_.lat,roll:_.roll}}y.center([x.lon-_.lon,x.lat-_.lat]).rotate([-_.lon,-_.lat,_.roll]).parallels(h.parallels);var I=E(b,T);y.fitExtent(v,I);var L=this.bounds=y.getBounds(I),P=this.fitScale=y.scale(),z=y.translate();if(s.fitbounds){var D=y.getBounds(E(d.range,g.range)),O=Math.min((L[1][0]-L[0][0])/(D[1][0]-D[0][0]),(L[1][1]-L[0][1])/(D[1][1]-D[0][1]));isFinite(O)?y.scale(O*P):l.warn("Something went wrong during"+this.id+"fitbounds computations.")}else y.scale(h.scale*P);var R=this.midPt=[(L[0][0]+L[1][0])/2,(L[0][1]+L[1][1])/2];if(y.translate([z[0]+(R[0]-z[0]),z[1]+(R[1]-z[1])]).clipExtent(L),s._isAlbersUsa){var F=y([x.lon,x.lat]),B=y.translate();y.translate([B[0]-(F[0]-B[0]),B[1]-(F[1]-B[1])])}},S.updateBaseLayers=function(e,t){var n=this,i=n.topojson,a=n.layers,o=n.basePaths;function s(e){return"lonaxis"===e||"lataxis"===e}function l(e){return!!w.lineLayers[e]}function c(e){return!!w.fillLayers[e]}var f=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(e){return l(e)||c(e)?t["show"+e]:!s(e)||t[e].showgrid})),p=n.framework.selectAll(".layer").data(f,String);p.exit().each((function(e){delete a[e],delete o[e],r.select(this).remove()})),p.enter().append("g").attr("class",(function(e){return"layer "+e})).each((function(e){var t=a[e]=r.select(this);"bg"===e?n.bgRect=t.append("rect").style("pointer-events","all"):s(e)?o[e]=t.append("path").style("fill","none"):"backplot"===e?t.append("g").classed("choroplethlayer",!0):"frontplot"===e?t.append("g").classed("scatterlayer",!0):l(e)?o[e]=t.append("path").style("fill","none").style("stroke-miterlimit",2):c(e)&&(o[e]=t.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(A(i,i.objects[r])):s(r)&&n.datum(function(e,t,r){var n,i,a,o=t[e],s=w.scopeDefaults[t.scope];"lonaxis"===e?(n=s.lonaxisRange,i=s.lataxisRange,a=function(e,t){return[e,t]}):"lataxis"===e&&(n=s.lataxisRange,i=s.lonaxisRange,a=function(e,t){return[t,e]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};d.setConvert(l,r);var c=d.calcTicks(l);!t.isScoped&&"lonaxis"===e&&c.pop();for(var u=c.length,h=new Array(u),f=0;f<u;f++)for(var p=c[f].x,m=h[f]=[],g=i[0];g<i[1]+2.5;g+=2.5)m.push(a(p,g));return{type:"MultiLineString",coordinates:h}}(r,t,e)).call(u.stroke,t[r].gridcolor).call(h.dashLine,t[r].griddash,t[r].gridwidth),l(r)?n.call(u.stroke,t[a+"color"]).call(h.dashLine,"",t[a+"width"]):c(r)&&n.call(u.fill,t[a+"color"])}))},S.updateDims=function(e,t){var r=this.bounds,n=(t.framewidth||0)/2,i=r[0][0]-n,a=r[0][1]-n,o=r[1][0]-i+n,s=r[1][1]-a+n;h.setRect(this.clipRect,i,a,o,s),this.bgRect.call(h.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},S.updateFx=function(e,t){var n=this,i=n.graphDiv,a=n.bgRect,o=e.dragmode,c=e.clickmode;if(!n.isStatic){var u={element:n.bgRect.node(),gd:i,plotinfo:{id:n.id,xaxis:n.xaxis,yaxis:n.yaxis,fillRangeItems:function(e,t){t.isRect?(e.range={})[n.id]=[h([t.xmin,t.ymin]),h([t.xmax,t.ymax])]:(e.lassoPoints={})[n.id]=t.map(h)}},xaxes:[n.xaxis],yaxes:[n.yaxis],subplot:n.id,clickFn:function(e){2===e&&v(i)}};"pan"===o?(a.node().onmousedown=null,a.call(_(n,t)),a.on("dblclick.zoom",(function(){var e=n.viewInitial,t={};for(var r in e)t[n.id+"."+r]=e[r];s.call("_guiRelayout",i,t),i.emit("plotly_doubleclick",null)})),i._context._scrollZoom.geo||a.on("wheel.zoom",null)):("select"===o||"lasso"===o)&&(a.on(".zoom",null),u.prepFn=function(e,t,r){y(e,t,r,u,o)},g.init(u)),a.on("mousemove",(function(){var e=n.projection.invert(l.getPositionFromD3Event());if(!e)return g.unhover(i,r.event);n.xaxis.p2c=function(){return e[0]},n.yaxis.p2c=function(){return e[1]},f.hover(i,r.event,n.id)})),a.on("mouseout",(function(){i._dragging||g.unhover(i,r.event)})),a.on("click",(function(){"select"!==o&&"lasso"!==o&&(c.indexOf("select")>-1&&x(r.event,i,[n.xaxis],[n.yaxis],n.id,u),c.indexOf("event")>-1&&f.click(i,r.event))}))}function h(e){return n.projection.invert([e[0]+n.xaxis._offset,e[1]+n.yaxis._offset])}},S.makeFramework=function(){var e=this,t=e.graphDiv,n=t._fullLayout,i="clip"+n._uid+e.id;e.clipDef=n._clips.append("clipPath").attr("id",i),e.clipRect=e.clipDef.append("rect"),e.framework=r.select(e.container).append("g").attr("class","geo "+e.id).call(h.setClipUrl,i,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[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"},d.setConvert(e.mockAxis,n)},S.saveViewInitial=function(e){var t,r=e.center||{},n=e.projection,i=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},l.extendFlat(this.viewInitial,t)},S.render=function(e){this._hasMarkerAngles&&e?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},S._render=function(){var e,t=this.projection,r=t.getPath();function n(e){var r=t(e.lonlat);return r?c(r[0],r[1]):null}function i(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",(function(e){return r(e.geojson)}));for(e in this.dataPoints)this.dataPoints[e].attr("display",i).attr("transform",n)}}}),zg=m({"src/plots/geo/layout_attributes.js"(e,t){var r=G(),n=Ma().attributes,i=Oe().dash,a=hg(),o=De().overrideAll,s=Ye(),l={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:r.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:i};(t.exports=o({domain:n({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:r.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:r.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:r.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:r.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:r.background},lonaxis:l,lataxis:l},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),Dg=m({"src/plots/geo/layout_defaults.js"(e,t){var r=ct(),n=Gs(),i=Tt().getSubplotData,a=hg(),o=zg(),s=a.axesNames;function l(e,t,n,o){var l=i(o.fullData,"geo",o.id).map((function(e){return e.index})),c=n("resolution"),u=n("scope"),h=a.scopeDefaults[u],f=n("projection.type",h.projType),p=t._isAlbersUsa="albers usa"===f;p&&(u=t.scope="usa");var d=t._isScoped="world"!==u,m=t._isSatellite="satellite"===f,g=t._isConic=-1!==f.indexOf("conic")||"albers"===f,y=t._isClipped=!!a.lonaxisSpan[f];if(!1===e.visible){var v=r.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 x=n("visible"),_=0;_<s.length;_++){var b,w=s[_],T=[30,10][_];if(d)b=h[w+"Range"];else{var k=a[w+"Span"],A=(k[f]||k["*"])/2,M=n("projection.rotation."+w.slice(0,3),h.projRotate[_]);b=[M-A,M+A]}var S=n(w+".range",b);n(w+".tick0"),n(w+".dtick",T),n(w+".showgrid",!!x&&void 0)&&(n(w+".gridcolor"),n(w+".gridwidth"),n(w+".griddash")),t[w]._ax={type:"linear",_id:w.slice(0,3),_traceIndices:l,setScale:r.identity,c2l:r.identity,r2l:r.identity,autorange:!0,range:S.slice(),_m:1,_input:{}}}var E=t.lonaxis.range,C=t.lataxis.range,I=E[0],L=E[1];I>0&&L<0&&(L+=360);var P,z,D,O=(I+L)/2;if(!p){var R=d?h.projRotate:[O,0,0];P=n("projection.rotation.lon",R[0]),n("projection.rotation.lat",R[1]),n("projection.rotation.roll",R[2]),n("showcoastlines",!d&&x)&&(n("coastlinecolor"),n("coastlinewidth")),n("showocean",!!x&&void 0)&&n("oceancolor")}p?(z=-96.6,D=38.7):(z=d?O:P,D=(C[0]+C[1])/2),n("center.lon",z),n("center.lat",D),m&&(n("projection.tilt"),n("projection.distance")),g&&n("projection.parallels",h.projParallels||[0,60]),n("projection.scale"),n("showland",!!x&&void 0)&&n("landcolor"),n("showlakes",!!x&&void 0)&&n("lakecolor"),n("showrivers",!!x&&void 0)&&(n("rivercolor"),n("riverwidth")),n("showcountries",d&&"usa"!==u&&x)&&(n("countrycolor"),n("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(n("showsubunits",x),n("subunitcolor"),n("subunitwidth")),d||n("showframe",x)&&(n("framecolor"),n("framewidth")),n("bgcolor"),n("fitbounds")&&(delete t.projection.scale,d?(delete t.center.lon,delete t.center.lat):y?(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))}t.exports=function(e,t,r){n(e,t,r,{type:"geo",attributes:o,handleDefaults:l,fullData:r,partition:"y"})}}}),Og=m({"src/plots/geo/index.js"(e,t){var r=Tt().getSubplotCalcData,n=ct().counterRegex,i=Pg(),a="geo",o=n(a),s={};s[a]={valType:"subplotid",dflt:a,editType:"calc"},t.exports={attr:a,name:a,idRoot:a,idRegex:o,attrRegex:o,attributes:s,layoutAttributes:zg(),supplyLayoutDefaults:Dg(),plot:function(e){for(var t=e._fullLayout,n=e.calcdata,o=t._subplots[a],s=0;s<o.length;s++){var l=o[s],c=r(n,a,l),u=t[l]._subplot;u||(u=i({id:l,graphDiv:e,container:t._geolayer.node(),topojsonURL:e._context.topojsonURL,staticPlot:e._context.staticPlot}),t[l]._subplot=u),u.plot(c,t,e._promises)}},updateFx:function(e){for(var t=e._fullLayout,r=t._subplots[a],n=0;n<r.length;n++){var i=t[r[n]];i._subplot.updateFx(t,i)}},clean:function(e,t,r,n){for(var i=n._subplots[a]||[],o=0;o<i.length;o++){var s=i[o],l=n[s]._subplot;!t[s]&&l&&(l.framework.remove(),l.clipDef.remove())}}}}}),Rg=m({"src/traces/scattergeo/index.js"(e,t){t.exports={attributes:sg(),supplyDefaults:lg(),colorbar:mi(),formatLabels:cg(),calc:ug(),calcGeoJSON:kg().calcGeoJSON,plot:kg().plot,style:Tg(),styleOnSelect:yi().styleOnSelect,hoverPoints:Ag(),eventData:Mg(),selectPoints:Sg(),moduleType:"trace",name:"scattergeo",basePlotModule:Og(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}}),Fg=m({"lib/scattergeo.js"(e,t){t.exports=Rg()}}),Bg=m({"src/traces/choropleth/attributes.js"(e,t){var{hovertemplateAttrs:r,templatefallbackAttrs:n}=Fe(),i=sg(),a=zt(),o=q(),s=G().defaultLine,l=B().extendFlat,c=i.marker.line;t.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},c.color,{dflt:s}),width:l({},c.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:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:r(),hovertemplatefallback:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))}}),jg=m({"src/traces/choropleth/defaults.js"(e,t){var r=ct(),n=Ht(),i=Bg(),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 l(n,a){return r.coerce(e,t,i,n,a)}var c=l("locations"),u=l("z");if(c&&c.length&&r.isArrayOrTypedArray(u)&&u.length){t._length=Math.min(c.length,u.length);var h,f=l("geojson");("string"==typeof f&&""!==f||r.isPlainObject(f))&&(h="geojson-id");var p=l("locationmode",h);"country names"===p&&r.warn(a),"geojson-id"===p&&l("featureidkey"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),l("marker.line.width")&&l("marker.line.color"),l("marker.opacity"),n(e,t,s,l,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(t,l)}else t.visible=!1}}}),Ng=m({"src/traces/choropleth/calc.js"(e,t){var r=M(),n=S().BADNUM,i=Zt(),a=ai(),o=oi();function s(e){return e&&"string"==typeof e}t.exports=function(e,t){var l,c=t._length,u=new Array(c);l=t.geojson?function(e){return s(e)||r(e)}:s;for(var h=0;h<c;h++){var f=u[h]={},p=t.locations[h],d=t.z[h];l(p)&&r(d)?(f.loc=p,f.z=d):(f.loc=null,f.z=n),f.index=h}return a(u,t),i(e,t,{vals:t.z,containerStr:"",cLetter:"z"}),o(u,t),u}}}),Ug=m({"src/traces/choropleth/style.js"(e,t){var r=b(),n=W(),i=er(),a=Yt();function o(e,t){var o=t[0].trace,s=t[0].node3.selectAll(".choroplethlocation"),l=o.marker||{},c=l.line||{},u=a.makeColorScaleFuncFromTrace(o);s.each((function(e){r.select(this).attr("fill",u(e.z)).call(n.stroke,e.mlc||c.color).call(i.dashLine,"",e.mlw||c.width||0).style("opacity",l.opacity)})),i.selectedPointStyle(s,o)}t.exports={style:function(e,t){t&&o(0,t)},styleOnSelect:function(e,t){var r=t[0].node3,n=t[0].trace;n.selectedpoints?i.selectedPointStyle(r.selectAll(".choroplethlocation"),n):o(0,t)}}}}),Vg=m({"src/traces/choropleth/plot.js"(e,t){var r=b(),n=ct(),i=wg(),a=pg().getTopojsonFeatures,o=ir().findExtremes,s=Ug().style;t.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],s=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?i.extractTraceFeature(e):a(r,s.topojson),h=[],f=[],p=0;p<c;p++){var d=e[p],m="geojson-id"===l?d.fOut:i.locationToFeature(l,d.loc,u);if(m){d.geojson=m,d.ct=m.properties.ct,d._polygons=i.feature2polygons(m);var g=i.computeBbox(m);h.push(g[0],g[2]),f.push(g[1],g[3])}else d.geojson=null}if("geojson"===n.fitbounds&&"geojson-id"===l){var y=i.computeBbox(i.getTraceGeojson(r));h=[y[0],y[2]],f=[y[1],y[3]]}var v={padded:!0};r._extremes.lon=o(n.lonaxis._ax,h,v),r._extremes.lat=o(n.lataxis._ax,f,v)},plot:function(e,t,i){var a=t.layers.backplot.select(".choroplethlayer");n.makeTraceGroups(a,i,"trace choropleth").each((function(t){var i=r.select(this).selectAll("path.choroplethlocation").data(n.identity);i.enter().append("path").classed("choroplethlocation",!0),i.exit().remove(),s(e,t)}))}}}}),qg=m({"src/traces/choropleth/hover.js"(e,t){var r=ar(),n=Bg(),i=ct().fillText;t.exports=function(e,t,a){var o,s,l,c,u=e.cd,h=u[0].trace,f=e.subplot,p=[t,a],d=[t+360,a];for(s=0;s<u.length;s++)if(c=!1,(o=u[s])._polygons){for(l=0;l<o._polygons.length;l++)o._polygons[l].contains(p)&&(c=!c),o._polygons[l].contains(d)&&(c=!c);if(c)break}if(c&&o)return e.x0=e.x1=e.xa.c2p(o.ct),e.y0=e.y1=e.ya.c2p(o.ct),e.index=o.index,e.location=o.loc,e.z=o.z,e.zLabel=r.tickText(f.mockAxis,f.mockAxis.c2l(o.z),"hover").text,e.hovertemplate=o.hovertemplate,function(e,t,r){if(!t.hovertemplate){var a=r.hi||t.hoverinfo,o=String(r.loc),s="all"===a?n.hoverinfo.flags:a.split("+"),l=-1!==s.indexOf("name"),c=-1!==s.indexOf("location"),u=-1!==s.indexOf("z"),h=-1!==s.indexOf("text"),f=[];!l&&c?e.nameOverride=o:(l&&(e.nameOverride=t.name),c&&f.push(o)),u&&f.push(e.zLabel),h&&i(r,t,f),e.extraText=f.join("<br>")}}(e,h,o),[e]}}}),Hg=m({"src/traces/choropleth/event_data.js"(e,t){t.exports=function(e,t,r,n,i){e.location=t.location,e.z=t.z;var a=n[i];return a.fIn&&a.fIn.properties&&(e.properties=a.fIn.properties),e.ct=a.ct,e}}}),Gg=m({"src/traces/choropleth/select.js"(e,t){t.exports=function(e,t){var r,n,i,a,o,s=e.cd,l=e.xaxis,c=e.yaxis,u=[];if(!1===t)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)(i=(n=s[r]).ct)&&(a=l.c2p(i),o=c.c2p(i),t.contains([a,o],null,r,e)?(u.push({pointNumber:r,lon:i[0],lat:i[1]}),n.selected=1):n.selected=0);return u}}}),Wg=m({"src/traces/choropleth/index.js"(e,t){t.exports={attributes:Bg(),supplyDefaults:jg(),colorbar:Vo(),calc:Ng(),calcGeoJSON:Vg().calcGeoJSON,plot:Vg().plot,style:Ug().style,styleOnSelect:Ug().styleOnSelect,hoverPoints:qg(),eventData:Hg(),selectPoints:Gg(),moduleType:"trace",name:"choropleth",basePlotModule:Og(),categories:["geo","noOpacity","showLegend"],meta:{}}}}),Zg=m({"lib/choropleth.js"(e,t){t.exports=Wg()}}),Yg=m({"src/traces/scattergl/hover.js"(e,t){var r=He(),n=ct(),i=vi();function a(e,t,a,o){var s=e.xa,l=e.ya,c=e.distance,u=e.dxy,h=e.index,f={pointNumber:h,x:t[h],y:a[h]};f.tx=n.isArrayOrTypedArray(o.text)?o.text[h]:o.text,f.htx=Array.isArray(o.hovertext)?o.hovertext[h]:o.hovertext,f.data=Array.isArray(o.customdata)?o.customdata[h]:o.customdata,f.tp=Array.isArray(o.textposition)?o.textposition[h]:o.textposition;var p=o.textfont;p&&(f.ts=n.isArrayOrTypedArray(p.size)?p.size[h]:p.size,f.tc=n.isArrayOrTypedArray(p.color)?p.color[h]:p.color,f.tf=Array.isArray(p.family)?p.family[h]:p.family,f.tw=Array.isArray(p.weight)?p.weight[h]:p.weight,f.ty=Array.isArray(p.style)?p.style[h]:p.style,f.tv=Array.isArray(p.variant)?p.variant[h]:p.variant);var d=o.marker;d&&(f.ms=n.isArrayOrTypedArray(d.size)?d.size[h]:d.size,f.mo=n.isArrayOrTypedArray(d.opacity)?d.opacity[h]:d.opacity,f.mx=n.isArrayOrTypedArray(d.symbol)?d.symbol[h]:d.symbol,f.ma=n.isArrayOrTypedArray(d.angle)?d.angle[h]:d.angle,f.mc=n.isArrayOrTypedArray(d.color)?d.color[h]:d.color);var m=d&&d.line;m&&(f.mlc=Array.isArray(m.color)?m.color[h]:m.color,f.mlw=n.isArrayOrTypedArray(m.width)?m.width[h]:m.width);var g=d&&d.gradient;g&&"none"!==g.type&&(f.mgt=Array.isArray(g.type)?g.type[h]:g.type,f.mgc=Array.isArray(g.color)?g.color[h]:g.color);var y=s.c2p(f.x,!0),v=l.c2p(f.y,!0),x=f.mrc||1,_=o.hoverlabel;_&&(f.hbg=Array.isArray(_.bgcolor)?_.bgcolor[h]:_.bgcolor,f.hbc=Array.isArray(_.bordercolor)?_.bordercolor[h]:_.bordercolor,f.hts=n.isArrayOrTypedArray(_.font.size)?_.font.size[h]:_.font.size,f.htc=Array.isArray(_.font.color)?_.font.color[h]:_.font.color,f.htf=Array.isArray(_.font.family)?_.font.family[h]:_.font.family,f.hnl=n.isArrayOrTypedArray(_.namelength)?_.namelength[h]:_.namelength);var b=o.hoverinfo;b&&(f.hi=Array.isArray(b)?b[h]:b);var w=o.hovertemplate;w&&(f.ht=Array.isArray(w)?w[h]:w);var T={};T[e.index]=f;var k=o._origX,A=o._origY,M=n.extendFlat({},e,{color:i(o,f),x0:y-x,x1:y+x,xLabelVal:k?k[h]:f.x,y0:v-x,y1:v+x,yLabelVal:A?A[h]:f.y,cd:T,distance:c,spikeDistance:u,hovertemplate:f.ht});return f.htx?M.text=f.htx:f.tx?M.text=f.tx:o.text&&(M.text=o.text),n.fillText(f,o,M),r.getComponentMethod("errorbars","hoverInfo")(f,o,M),M}t.exports={hoverPoints:function(e,t,r,n){var i,o=e.cd,s=o[0].t,l=o[0].trace,c=e.xa,u=e.ya,h=s.x,f=s.y,p=c.c2p(t),d=u.c2p(r),m=e.distance;if(s.tree){var g=c.p2c(p-m),y=c.p2c(p+m),v=u.p2c(d-m),x=u.p2c(d+m);i="x"===n?s.tree.range(Math.min(g,y),Math.min(u._rl[0],u._rl[1]),Math.max(g,y),Math.max(u._rl[0],u._rl[1])):s.tree.range(Math.min(g,y),Math.min(v,x),Math.max(g,y),Math.max(v,x))}else i=s.ids;var _,b,w,T,k,A,M,S,E,C=m;if("x"===n){var I=!!l.xperiodalignment,L=!!l.yperiodalignment;for(k=0;k<i.length;k++){if(w=h[_=i[k]],A=Math.abs(c.c2p(w)-p),I){var P=c.c2p(l._xStarts[_]),z=c.c2p(l._xEnds[_]);A=p>=Math.min(P,z)&&p<=Math.max(P,z)?0:1/0}if(A<C){if(C=A,T=f[_],M=u.c2p(T)-d,L){var D=u.c2p(l._yStarts[_]),O=u.c2p(l._yEnds[_]);M=d>=Math.min(D,O)&&d<=Math.max(D,O)?0:1/0}E=Math.sqrt(A*A+M*M),b=i[k]}}}else for(k=i.length-1;k>-1;k--)w=h[_=i[k]],T=f[_],A=c.c2p(w)-p,M=u.c2p(T)-d,(S=Math.sqrt(A*A+M*M))<C&&(C=E=S,b=_);return e.index=b,e.distance=C,e.dxy=E,void 0===b?[e]:[a(e,h,f,l)]},calcHover:a}}}),Xg=m({"src/traces/scattergl/constants.js"(e,t){t.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,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]}}}}),$g=m({"src/traces/scattergl/attributes.js"(e,t){var r=q(),n=j(),i=Tn(),a=kn(),o=It().axisHoverFormat,s=zt(),l=Ye(),c=B().extendFlat,u=De().overrideAll,h=Xg().DASHES,f=a.line,p=a.marker,d=p.line,m=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:n({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:l(h),dflt:"solid"}},marker:c({},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:c({},s("marker.line"),{width:d.width})}),connectgaps:a.connectgaps,fill:c({},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:r.opacity},"calc","nested");m.x.editType=m.y.editType=m.x0.editType=m.y0.editType="calc+clearAxisTypes",m.hovertemplate=a.hovertemplate,m.hovertemplatefallback=a.hovertemplatefallback,m.texttemplate=a.texttemplate,m.texttemplatefallback=a.texttemplatefallback}}),Kg=m({"src/traces/scattergl/helpers.js"(e){var t=Xg();e.isOpenSymbol=function(e){return"string"==typeof e?t.OPEN_RE.test(e):e%200>100},e.isDotSymbol=function(e){return"string"==typeof e?t.DOT_RE.test(e):e>200}}}),Jg=m({"src/traces/scattergl/defaults.js"(e,t){var r=ct(),n=He(),i=Kg(),a=$g(),o=wn(),s=Xt(),l=Gn(),c=Wn(),u=Yn(),h=Xn(),f=Jn(),p=Kn();t.exports=function(e,t,d,m){function g(n,i){return r.coerce(e,t,a,n,i)}var y=!!e.marker&&i.isOpenSymbol(e.marker.symbol),v=s.isBubble(e),x=l(e,t,m,g);if(x){c(e,t,m,g),g("xhoverformat"),g("yhoverformat");var _=x<o.PTS_LINESONLY?"lines+markers":"lines";g("text"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback"),g("mode",_),s.hasMarkers(t)&&(u(e,t,d,m,g,{noAngleRef:!0,noLineDash:!0,noStandOff:!0}),g("marker.line.width",y||v?1:0)),s.hasLines(t)&&(g("connectgaps"),h(e,t,d,m,g),g("line.shape")),s.hasText(t)&&(g("texttemplate"),g("texttemplatefallback"),p(e,t,m,g,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var b=(t.line||{}).color,w=(t.marker||{}).color;g("fill"),"none"!==t.fill&&f(e,t,d,g);var T=n.getComponentMethod("errorbars","supplyDefaults");T(e,t,b||w||d,{axis:"y"}),T(e,t,b||w||d,{axis:"x",inherit:"y"}),r.coerceSelectionMarkerOpacity(t,g)}else t.visible=!1}}}),Qg=m({"src/traces/scattergl/format_labels.js"(e,t){var r=gi();t.exports=function(e,t,n){var i=e.i;return"x"in e||(e.x=t._x[i]),"y"in e||(e.y=t._y[i]),r(e,t,n)}}}),ey=m({"node_modules/binary-search-bounds/search-bounds.js"(e,t){function r(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function o(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function s(e,t,r,n,i,a){return"function"==typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}t.exports={ge:function(e,t,n,i,a){return s(e,t,n,i,a,r)},gt:function(e,t,r,i,a){return s(e,t,r,i,a,n)},lt:function(e,t,r,n,a){return s(e,t,r,n,a,i)},le:function(e,t,r,n,i){return s(e,t,r,n,i,a)},eq:function(e,t,r,n,i){return s(e,t,r,n,i,o)}}}}),ty=m({"node_modules/pick-by-alias/index.js"(e,t){t.exports=function(e,t,r){var i,a,o={};if("string"==typeof t&&(t=n(t)),Array.isArray(t)){var s={};for(a=0;a<t.length;a++)s[t[a]]=!0;t=s}for(i in t)t[i]=n(t[i]);var l={};for(i in t){var c=t[i];if(Array.isArray(c))for(a=0;a<c.length;a++){var u=c[a];if(r&&(l[u]=!0),u in e){if(o[i]=e[u],r)for(var h=a;h<c.length;h++)l[c[h]]=!0;break}}else i in e&&(t[i]&&(o[i]=e[i]),r&&(l[i]=!0))}if(r)for(i in e)l[i]||(o[i]=e[i]);return o};var r={};function n(e){return r[e]?r[e]:("string"==typeof e&&(e=r[e]=e.split(/\s*,\s*|\s+/)),e)}}}),ry=m({"node_modules/parse-rect/index.js"(e,t){var r=ty();t.exports=function(e){var t;return arguments.length>1&&(e=arguments),"string"==typeof e?e=e.split(/\s/).map(parseFloat):"number"==typeof e&&(e=[e]),e.length&&"number"==typeof e[0]?t=1===e.length?{width:e[0],height:e[0],x:0,y:0}:2===e.length?{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&&(t={x:(e=r(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"})).left||0,y:e.top||0},null==e.width?e.right?t.width=e.right-t.x:t.width=0:t.width=e.width,null==e.height?e.bottom?t.height=e.bottom-t.y:t.height=0:t.height=e.height),t}}}),ny=m({"node_modules/array-bounds/index.js"(e,t){t.exports=function(e,t){if(!e||null==e.length)throw Error("Argument should be an array");t=null==t?1:Math.floor(t);for(var r=Array(2*t),n=0;n<t;n++){for(var i=-1/0,a=1/0,o=n,s=e.length;o<s;o+=t)e[o]>i&&(i=e[o]),e[o]<a&&(a=e[o]);r[n]=a,r[t+n]=i}return r}}}),iy=m({"node_modules/defined/index.js"(e,t){t.exports=function(){for(var e=0;e<arguments.length;e++)if(void 0!==arguments[e])return arguments[e]}}}),ay=m({"node_modules/flatten-vertex-data/index.js"(e,t){var r=Qd();t.exports=function(e,t,n){if(!e)throw new TypeError("must specify data as first parameter");if(n=0|+(n||0),Array.isArray(e)&&e[0]&&"number"==typeof e[0][0]){var i,a,o,s,l=e[0].length,c=e.length*l;(!t||"string"==typeof t)&&(t=new(r(t||"float32"))(c+n));var u=t.length-n;if(c!==u)throw new Error("source length "+c+" ("+l+"x"+e.length+") does not match destination length "+u);for(i=0,o=n;i<e.length;i++)for(a=0;a<l;a++)t[o++]=null===e[i][a]?NaN:e[i][a]}else if(t&&"string"!=typeof t)t.set(e,n);else{var h=r(t||"float32");if(Array.isArray(e)||"array"===t)for(i=0,o=n,s=(t=new h(e.length+n)).length;o<s;o++,i++)t[o]=null===e[i]?NaN:e[i];else 0===n?t=new h(e):(t=new h(e.length+n)).set(e,n)}return t}}}),oy=m({"node_modules/is-obj/index.js"(e,t){t.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}}}),sy=m({"node_modules/math-log2/index.js"(e,t){t.exports=Math.log2||function(e){return Math.log(e)*Math.LOG2E}}}),ly=m({"node_modules/@plotly/point-cluster/quad.js"(e,t){var r=ey(),n=Jd(),i=ry(),a=ny(),o=ty(),s=iy(),l=ay(),c=oy(),u=Qd(),h=sy();function f(e,t){let[r,i,a,o]=t,s=1/(a-r),l=1/(o-i),c=new Array(e.length);for(let t=0,a=e.length/2;t<a;t++)c[2*t]=n((e[2*t]-r)*s,0,1),c[2*t+1]=n((e[2*t+1]-i)*l,0,1);return c}t.exports=function(e,t){t||(t={}),e=l(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 n=s(t.maxDepth,255),p=s(t.bounds,a(e,2));p[0]===p[2]&&p[2]++,p[1]===p[3]&&p[3]++;let d,m=f(e,p),g=e.length>>>1;t.dtype||(t.dtype="array"),"string"==typeof t.dtype?d=new(u(t.dtype))(g):t.dtype&&(d=t.dtype,Array.isArray(d)&&(d.length=g));for(let e=0;e<g;++e)d[e]=e;let y=[],v=[],x=[],_=[];!function e(t,r,i,a,o,s){if(!a.length)return null;let l=y[o]||(y[o]=[]),c=x[o]||(x[o]=[]),u=v[o]||(v[o]=[]),h=l.length;if(++o>n||s>1073741824){for(let e=0;e<a.length;e++)l.push(a[e]),c.push(s),u.push(null,null,null,null);return h}if(l.push(a[0]),c.push(s),a.length<=1)return u.push(null,null,null,null),h;let f=.5*i,p=t+f,d=r+f,g=[],_=[],b=[],w=[];for(let e=1,t=a.length;e<t;e++){let t=a[e],r=m[2*t],n=m[2*t+1];r<p?n<d?g.push(t):_.push(t):n<d?b.push(t):w.push(t)}return s<<=2,u.push(e(t,r,f,g,o,s),e(t,d,f,_,o,s+1),e(p,r,f,b,o,s+2),e(p,d,f,w,o,s+3)),h}(0,0,1,d,0,1);let b=0;for(let e=0;e<y.length;e++){let t=y[e];if(d.set)d.set(t,b);else for(let e=0,r=t.length;e<r;e++)d[e+b]=t[e];let r=b+y[e].length;_[e]=[b,r],b=r}return d.range=function(...t){let n;if(c(t[t.length-1])){let e=t.pop();!t.length&&(null!=e.x||null!=e.l||null!=e.left)&&(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=p);let a=i(...t),[l,u,d,m]=[Math.min(a.x,a.x+a.width),Math.min(a.y,a.y+a.height),Math.max(a.x,a.x+a.width),Math.max(a.y,a.y+a.height)],[g,b,T,k]=f([l,u,d,m],p),A=s(n.level,y.length);if(null!=n.d){let e;"number"==typeof n.d?e=[n.d,n.d]:n.d.length&&(e=n.d),A=Math.min(Math.max(Math.ceil(-h(Math.abs(e[0])/(p[2]-p[0]))),Math.ceil(-h(Math.abs(e[1])/(p[3]-p[1])))),A)}if(A=Math.min(A,y.length),n.lod)return function(e,t,n,i,a){let o=[];for(let s=0;s<a;s++){let a=x[s],l=_[s][0],c=w(e,t,s),u=w(n,i,s),h=r.ge(a,c),f=r.gt(a,u,h,a.length-1);o[s]=[h+l,f+l]}return o}(g,b,T,k,A);let M=[];return function t(r,n,i,a,o,s){if(null===o||null===s)return;if(g>r+i||b>n+i||T<r||k<n||a>=A||o===s)return;let c=y[a];void 0===s&&(s=c.length);for(let t=o;t<s;t++){let r=c[t],n=e[2*r],i=e[2*r+1];n>=l&&n<=d&&i>=u&&i<=m&&M.push(r)}let h=v[a],f=h[4*o+0],p=h[4*o+1],x=h[4*o+2],_=h[4*o+3],w=function(e,t){let r=null,n=0;for(;null===r;)if(r=e[4*t+n],n++,n>e.length)return null;return r}(h,o+1),S=.5*i,E=a+1;t(r,n,S,E,f,p||x||_||w),t(r,n+S,S,E,p,x||_||w),t(r+S,n,S,E,x,_||w),t(r+S,n+S,S,E,_,w)}(0,0,1,0,0,1),M},d;function w(e,t,r){let n=1,i=.5,a=.5,o=.5;for(let s=0;s<r;s++)n<<=2,n+=e<i?t<a?0:1:t<a?2:3,o*=.5,i+=e<i?-o:o,a+=t<a?-o:o;return n}}}}),cy=m({"node_modules/@plotly/point-cluster/index.js"(e,t){t.exports=ly()}}),uy=m({"node_modules/abs-svg-path/index.js"(e,t){t.exports=function(e){var t=0,r=0,n=0,i=0;return e.map((function(e){var a=(e=e.slice())[0],o=a.toUpperCase();if(a!=o)switch(e[0]=o,a){case"a":e[6]+=n,e[7]+=i;break;case"v":e[1]+=i;break;case"h":e[1]+=n;break;default:for(var s=1;s<e.length;)e[s++]+=n,e[s++]+=i}switch(o){case"Z":n=t,i=r;break;case"H":n=e[1];break;case"V":i=e[1];break;case"M":n=t=e[1],i=r=e[2];break;default:n=e[e.length-2],i=e[e.length-1]}return e}))}}}),hy=m({"node_modules/svg-arc-to-cubic-bezier/cjs/index.js"(e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=2*Math.PI,n=function(e,t,r,n,i,a,o){var s=e.x,l=e.y;return{x:n*(s*=t)-i*(l*=r)+a,y:i*s+n*l+o}},i=function(e,t){var r=1.5707963267948966===t?.551915024494:-1.5707963267948966===t?-.551915024494:1.3333333333333333*Math.tan(t/4),n=Math.cos(e),i=Math.sin(e),a=Math.cos(e+t),o=Math.sin(e+t);return[{x:n-i*r,y:i+n*r},{x:a+o*r,y:o-a*r},{x:a,y:o}]},a=function(e,t,r,n){var i=e*r+t*n;return i>1&&(i=1),i<-1&&(i=-1),(e*n-t*r<0?-1:1)*Math.acos(i)};e.default=function(e){var t=e.px,o=e.py,s=e.cx,l=e.cy,c=e.rx,u=e.ry,h=e.xAxisRotation,f=void 0===h?0:h,p=e.largeArcFlag,d=void 0===p?0:p,m=e.sweepFlag,g=void 0===m?0:m,y=[];if(0===c||0===u)return[];var v=Math.sin(f*r/360),x=Math.cos(f*r/360),_=x*(t-s)/2+v*(o-l)/2,b=-v*(t-s)/2+x*(o-l)/2;if(0===_&&0===b)return[];c=Math.abs(c),u=Math.abs(u);var w=Math.pow(_,2)/Math.pow(c,2)+Math.pow(b,2)/Math.pow(u,2);w>1&&(c*=Math.sqrt(w),u*=Math.sqrt(w));var T=function(e,t,n,i,o,s,l,c,u,h,f,p){var d=Math.pow(o,2),m=Math.pow(s,2),g=Math.pow(f,2),y=Math.pow(p,2),v=d*m-d*y-m*g;v<0&&(v=0),v/=d*y+m*g;var x=(v=Math.sqrt(v)*(l===c?-1:1))*o/s*p,_=v*-s/o*f,b=h*x-u*_+(e+n)/2,w=u*x+h*_+(t+i)/2,T=(f-x)/o,k=(p-_)/s,A=(-f-x)/o,M=(-p-_)/s,S=a(1,0,T,k),E=a(T,k,A,M);return 0===c&&E>0&&(E-=r),1===c&&E<0&&(E+=r),[b,w,S,E]}(t,o,s,l,c,u,d,g,v,x,_,b),k=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(T,4),A=k[0],M=k[1],S=k[2],E=k[3],C=Math.abs(E)/(r/4);Math.abs(1-C)<1e-7&&(C=1);var I=Math.max(Math.ceil(C),1);E/=I;for(var L=0;L<I;L++)y.push(i(S,E)),S+=E;return y.map((function(e){var t=n(e[0],c,u,x,v,A,M),r=t.x,i=t.y,a=n(e[1],c,u,x,v,A,M),o=a.x,s=a.y,l=n(e[2],c,u,x,v,A,M);return{x1:r,y1:i,x2:o,y2:s,x:l.x,y:l.y}}))},t.exports=e.default}}),fy=m({"node_modules/svg-path-bounds/node_modules/normalize-svg-path/index.js"(e,t){t.exports=function(e){for(var t,a=[],o=0,s=0,l=0,c=0,u=null,h=null,f=0,p=0,d=0,m=e.length;d<m;d++){var g=e[d],y=g[0];switch(y){case"M":l=g[1],c=g[2];break;case"A":var v=r({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 x,_=0;_<v.length;_++)g=["C",(x=v[_]).x1,x.y1,x.x2,x.y2,x.x,x.y],_<v.length-1&&a.push(g);break;case"S":var b=f,w=p;("C"==t||"S"==t)&&(b+=b-o,w+=w-s),g=["C",b,w,g[1],g[2],g[3],g[4]];break;case"T":"Q"==t||"T"==t?(u=2*f-u,h=2*p-h):(u=f,h=p),g=i(f,p,u,h,g[1],g[2]);break;case"Q":u=g[1],h=g[2],g=i(f,p,g[1],g[2],g[3],g[4]);break;case"L":g=n(f,p,g[1],g[2]);break;case"H":g=n(f,p,g[1],p);break;case"V":g=n(f,p,f,g[1]);break;case"Z":g=n(f,p,l,c)}t=y,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),a.push(g)}return a};var r=hy();function n(e,t,r,n){return["C",e,t,r,n,r,n]}function i(e,t,r,n,i,a){return["C",e/3+2/3*r,t/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}}}),py=m({"node_modules/is-svg-path/index.js"(e,t){t.exports=function(e){return"string"==typeof e&&(e=e.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(e)&&/[\dz]$/i.test(e)&&e.length>4))}}}),dy=m({"node_modules/svg-path-bounds/index.js"(e,t){var r=Jt(),n=uy(),i=fy(),a=py(),o=wu();t.exports=function(e){if(Array.isArray(e)&&1===e.length&&"string"==typeof e[0]&&(e=e[0]),"string"==typeof e&&(o(a(e),"String is not an SVG path."),e=r(e)),o(Array.isArray(e),"Argument should be a string or an array of path segments."),e=n(e),!(e=i(e)).length)return[0,0,0,0];for(var t=[1/0,1/0,-1/0,-1/0],s=0,l=e.length;s<l;s++)for(var c=e[s].slice(1),u=0;u<c.length;u+=2)c[u+0]<t[0]&&(t[0]=c[u+0]),c[u+1]<t[1]&&(t[1]=c[u+1]),c[u+0]>t[2]&&(t[2]=c[u+0]),c[u+1]>t[3]&&(t[3]=c[u+1]);return t}}}),my=m({"node_modules/normalize-svg-path/index.js"(e,t){var r=Math.PI,n=l(120);function i(e,t,r,n){return["C",e,t,r,n,r,n]}function a(e,t,r,n,i,a){return["C",e/3+2/3*r,t/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function o(e,t,i,a,l,c,u,h,f,p){if(p)T=p[0],k=p[1],b=p[2],w=p[3];else{var d=s(e,t,-l);e=d.x,t=d.y;var m=(e-(h=(d=s(h,f,-l)).x))/2,g=(t-(f=d.y))/2,y=m*m/(i*i)+g*g/(a*a);y>1&&(i*=y=Math.sqrt(y),a*=y);var v=i*i,x=a*a,_=(c==u?-1:1)*Math.sqrt(Math.abs((v*x-v*g*g-x*m*m)/(v*g*g+x*m*m)));_==1/0&&(_=1);var b=_*i*g/a+(e+h)/2,w=_*-a*m/i+(t+f)/2,T=Math.asin(((t-w)/a).toFixed(9)),k=Math.asin(((f-w)/a).toFixed(9));(T=e<b?r-T:T)<0&&(T=2*r+T),(k=h<b?r-k:k)<0&&(k=2*r+k),u&&T>k&&(T-=2*r),!u&&k>T&&(k-=2*r)}if(Math.abs(k-T)>n){var A=k,M=h,S=f;k=T+n*(u&&k>T?1:-1);var E=o(h=b+i*Math.cos(k),f=w+a*Math.sin(k),i,a,l,0,u,M,S,[k,A,b,w])}var C=Math.tan((k-T)/4),I=4/3*i*C,L=4/3*a*C,P=[2*e-(e+I*Math.sin(T)),2*t-(t-L*Math.cos(T)),h+I*Math.sin(k),f-L*Math.cos(k),h,f];if(p)return P;E&&(P=P.concat(E));for(var z=0;z<P.length;){var D=s(P[z],P[z+1],l);P[z++]=D.x,P[z++]=D.y}return P}function s(e,t,r){return{x:e*Math.cos(r)-t*Math.sin(r),y:e*Math.sin(r)+t*Math.cos(r)}}function l(e){return e*(r/180)}t.exports=function(e){for(var t,r=[],n=0,s=0,c=0,u=0,h=null,f=null,p=0,d=0,m=0,g=e.length;m<g;m++){var y=e[m],v=y[0];switch(v){case"M":c=y[1],u=y[2];break;case"A":(y=o(p,d,y[1],y[2],l(y[3]),y[4],y[5],y[6],y[7])).unshift("C"),y.length>7&&(r.push(y.splice(0,7)),y.unshift("C"));break;case"S":var x=p,_=d;("C"==t||"S"==t)&&(x+=x-n,_+=_-s),y=["C",x,_,y[1],y[2],y[3],y[4]];break;case"T":"Q"==t||"T"==t?(h=2*p-h,f=2*d-f):(h=p,f=d),y=a(p,d,h,f,y[1],y[2]);break;case"Q":h=y[1],f=y[2],y=a(p,d,y[1],y[2],y[3],y[4]);break;case"L":y=i(p,d,y[1],y[2]);break;case"H":y=i(p,d,y[1],d);break;case"V":y=i(p,d,p,y[1]);break;case"Z":y=i(p,d,c,u)}t=v,p=y[y.length-2],d=y[y.length-1],y.length>4?(n=y[y.length-4],s=y[y.length-3]):(n=p,s=d),r.push(y)}return r}}}),gy=m({"node_modules/draw-svg-path/index.js"(e,t){var r=uy(),n=my(),i={M:"moveTo",C:"bezierCurveTo"};t.exports=function(e,t){e.beginPath(),n(r(t)).forEach((function(t){var r=t[0],n=t.slice(1);e[i[r]].apply(e,n)})),e.closePath()}}}),yy=m({"node_modules/bitmap-sdf/index.js"(e,t){var r=Jd();t.exports=function(e,t){t||(t={});var a,o,s,l,c,u,h,f,p,d,m,g=null==t.cutoff?.25:t.cutoff,y=null==t.radius?8:t.radius,v=t.channel||0;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");a=t.width,o=t.height,l=e,u=t.stride?t.stride:Math.floor(e.length/a/o)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(h=(f=e).getContext("2d"),a=f.width,o=f.height,l=(p=h.getImageData(0,0,a,o)).data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(h=e,a=(f=e.canvas).width,o=f.height,l=(p=h.getImageData(0,0,a,o)).data,u=4):window.ImageData&&e instanceof window.ImageData&&(p=e,a=e.width,o=e.height,l=p.data,u=4);if(s=Math.max(a,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(a*o),d=0,m=c.length;d<m;d++)l[d]=c[d*u+v]/255;else if(1!==u)throw Error("Raw data can have only 1 value per pixel");var x=Array(a*o),_=Array(a*o),b=Array(s),w=Array(s),T=Array(s+1),k=Array(s);for(d=0,m=a*o;d<m;d++){var A=l[d];x[d]=1===A?0:0===A?n:Math.pow(Math.max(0,.5-A),2),_[d]=1===A?n:0===A?0:Math.pow(Math.max(0,A-.5),2)}i(x,a,o,b,w,k,T),i(_,a,o,b,w,k,T);var M=window.Float32Array?new Float32Array(a*o):new Array(a*o);for(d=0,m=a*o;d<m;d++)M[d]=r(1-((x[d]-_[d])/y+g),0,1);return M};var n=1e20;function i(e,t,r,n,i,o,s){for(var l=0;l<t;l++){for(var c=0;c<r;c++)n[c]=e[c*t+l];for(a(n,i,o,s,r),c=0;c<r;c++)e[c*t+l]=i[c]}for(c=0;c<r;c++){for(l=0;l<t;l++)n[l]=e[c*t+l];for(a(n,i,o,s,t),l=0;l<t;l++)e[c*t+l]=Math.sqrt(i[l])}}function a(e,t,r,i,a){r[0]=0,i[0]=-n,i[1]=+n;for(var o=1,s=0;o<a;o++){for(var l=(e[o]+o*o-(e[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);l<=i[s];)s--,l=(e[o]+o*o-(e[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);r[++s]=o,i[s]=l,i[s+1]=+n}for(o=0,s=0;o<a;o++){for(;i[s+1]<o;)s++;t[o]=(o-r[s])*(o-r[s])+e[r[s]]}}}}),vy=m({"node_modules/svg-path-sdf/index.js"(e,t){var r,n=dy(),i=Jt(),a=gy(),o=py(),s=yy(),l=document.createElement("canvas"),c=l.getContext("2d");t.exports=function(e,t){if(!o(e))throw Error("Argument should be valid svg path string");var u,h;t||(t={}),t.shape?(u=t.shape[0],h=t.shape[1]):(u=l.width=t.w||t.width||200,h=l.height=t.h||t.height||200);var f=Math.min(u,h),p=t.stroke||0,d=t.viewbox||t.viewBox||n(e),m=[u/(d[2]-d[0]),h/(d[3]-d[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,u,h),c.fillStyle="white",p&&("number"!=typeof p&&(p=1),c.strokeStyle=p>0?"white":"black",c.lineWidth=Math.abs(p)),c.translate(.5*u,.5*h),c.scale(g,g),function(){if(null!=r)return r;var e=document.createElement("canvas").getContext("2d");if(e.canvas.width=e.canvas.height=1,!window.Path2D)return r=!1;var t=new Path2D("M0,0h1v1h-1v-1Z");e.fillStyle="black",e.fill(t);var n=e.getImageData(0,0,1,1);return r=n&&n.data&&255===n.data[3]}()){var y=new Path2D(e);c.fill(y),p&&c.stroke(y)}else{var v=i(e);a(c,v),c.fill(),p&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=t.cutoff?t.cutoff:.5,radius:null!=t.radius?t.radius:.5*f})}}}),xy=m({"src/traces/scattergl/convert.js"(e,t){var r=M(),n=vy(),i=em(),a=He(),o=ct(),s=o.isArrayOrTypedArray,l=er(),c=_t(),u=rm().formatColor,h=Xt(),f=$t(),p=Kg(),d=Xg(),m=Z().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=Kt().appendArrayPointValue;function v(e,t){var n,i=e._fullLayout,a=t._length,l=t.textfont,c=t.textposition,u=s(c)?c:[c],h=l.color,f=l.size,p=l.family,d=l.weight,m=l.style,g=l.variant,v={},_=e._context.plotGlPixelRatio,b=t.texttemplate;if(b){v.text=[];var w=i._d3locale,T=Array.isArray(b),k=T?Math.min(b.length,a):a,A=T?function(e){return b[e]}:function(){return b};for(n=0;n<k;n++){var M={i:n},S=t._module.formatLabels(M,t,i),E={};y(E,t,n),v.text.push(o.texttemplateString({data:[E,M,t._meta],fallback:t.texttemplatefallback,labels:S,locale:w,template:A(n)}))}}else s(t.text)&&t.text.length<a?v.text=t.text.slice():v.text=t.text;if(s(v.text))for(n=v.text.length;n<a;n++)v.text[n]="";for(v.opacity=t.opacity,v.font={},v.align=[],v.baseline=[],n=0;n<u.length;n++){var C=u[n].split(/\s+/);switch(C[1]){case"left":v.align.push("right");break;case"right":v.align.push("left");break;default:v.align.push(C[1])}switch(C[0]){case"top":v.baseline.push("bottom");break;case"bottom":v.baseline.push("top");break;default:v.baseline.push(C[0])}}if(s(h))for(v.color=new Array(a),n=0;n<a;n++)v.color[n]=h[n];else v.color=h;if(s(f)||Array.isArray(p)||s(d)||Array.isArray(m)||Array.isArray(g))for(v.font=new Array(a),n=0;n<a;n++){var I=v.font[n]={};I.size=(o.isTypedArray(f)?f[n]:s(f)?r(f[n])?f[n]:0:f)*_,I.family=Array.isArray(p)?p[n]:p,I.weight=x(s(d)?d[n]:d),I.style=Array.isArray(m)?m[n]:m,I.variant=Array.isArray(g)?g[n]:g}else v.font={size:f*_,family:p,weight:x(d),style:m,variant:g};return v}function x(e){return e<=1e3?e>500?"bold":"normal":e}function _(e,t){var r,n,a=t._length,o=t.marker,l={},c=s(o.symbol),h=s(o.angle),d=s(o.color),m=s(o.line.color),g=s(o.opacity),y=s(o.size),v=s(o.line.width);if(c||(n=p.isOpenSymbol(o.symbol)),c||d||m||g||h){l.symbols=new Array(a),l.angles=new Array(a),l.colors=new Array(a),l.borderColors=new Array(a);var x=o.symbol,_=o.angle,b=u(o,o.opacity,a),w=u(o.line,o.opacity,a);if(!s(w[0])){var T=w;for(w=Array(a),r=0;r<a;r++)w[r]=T}if(!s(b[0])){var k=b;for(b=Array(a),r=0;r<a;r++)b[r]=k}if(!s(x)){var A=x;for(x=Array(a),r=0;r<a;r++)x[r]=A}if(!s(_)){var M=_;for(_=Array(a),r=0;r<a;r++)_[r]=M}for(l.symbols=x,l.angles=_,l.colors=b,l.borderColors=w,r=0;r<a;r++)c&&(n=p.isOpenSymbol(o.symbol[r])),n&&(w[r]=b[r].slice(),b[r]=b[r].slice(),b[r][3]=0);for(l.opacity=t.opacity,l.markers=new Array(a),r=0;r<a;r++)l.markers[r]=I({mx:l.symbols[r],ma:l.angles[r]},t)}else n?(l.color=i(o.color,"uint8"),l.color[3]=0,l.borderColor=i(o.color,"uint8")):(l.color=i(o.color,"uint8"),l.borderColor=i(o.line.color,"uint8")),l.opacity=t.opacity*o.opacity,l.marker=I({mx:o.symbol,ma:o.angle},t);var S,E=f(t,1);if(y||v){var C,L=l.sizes=new Array(a),P=l.borderSizes=new Array(a),z=0;if(y){for(r=0;r<a;r++)L[r]=E(o.size[r]),z+=L[r];C=z/a}else for(S=E(o.size),r=0;r<a;r++)L[r]=S;if(v)for(r=0;r<a;r++)P[r]=o.line.width[r];else for(S=o.line.width,r=0;r<a;r++)P[r]=S;l.sizeAvg=C}else l.size=E(o&&o.size||10),l.borderSizes=E(o.line.width);return l}function b(e,t,r){var n=t.marker,i={};return r&&(r.marker&&r.marker.symbol?i=_(0,o.extendFlat({},n,r.marker)):r.marker&&(r.marker.size&&(i.size=r.marker.size),r.marker.color&&(i.colors=r.marker.color),void 0!==r.marker.opacity&&(i.opacity=r.marker.opacity))),i}function w(e,t,r){var n={};if(!r)return n;if(r.textfont){var i={opacity:1,text:t.text,texttemplate:t.texttemplate,textposition:t.textposition,textfont:o.extendFlat({},t.textfont)};r.textfont&&o.extendFlat(i.textfont,r.textfont),n=v(e,i)}return n}function T(e,t,r){var n={capSize:2*t.width*r,lineWidth:t.thickness*r,color:t.color};return t.copy_ystyle&&(n=e.error_y),n}var k=d.SYMBOL_SDF_SIZE,A=d.SYMBOL_SIZE,S=d.SYMBOL_STROKE,E={},C=l.symbolFuncs[0](.05*A);function I(e,t){var r=e.mx;if("circle"===r)return null;var i,a,o=l.symbolNumber(r),s=l.symbolFuncs[o%100],c=!!l.symbolNoDot[o%100],u=!!l.symbolNoFill[o%100],h=p.isDotSymbol(r);if(e.ma&&(r+="_"+e.ma),E[r])return E[r];var f=l.getMarkerAngle(e,t);return i=h&&!c?s(1.1*A,f)+C:s(A,f),a=n(i,{w:k,h:k,viewBox:[-A,-A,A,A],stroke:u?S:-S}),E[r]=a,a||null}t.exports={style:function(e,t){var r,n={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},i=e._context.plotGlPixelRatio;if(!0!==t.visible)return n;if(h.hasText(t)&&(n.text=v(e,t),n.textSel=w(e,t,t.selected),n.textUnsel=w(e,t,t.unselected)),h.hasMarkers(t)&&(n.marker=_(0,t),n.markerSel=b(0,t,t.selected),n.markerUnsel=b(0,t,t.unselected),!t.unselected&&s(t.marker.opacity))){var a=t.marker.opacity;for(n.markerUnsel.opacity=new Array(a.length),r=0;r<a.length;r++)n.markerUnsel.opacity[r]=m*a[r]}if(h.hasLines(t)){n.line={overlay:!0,thickness:t.line.width*i,color:t.line.color,opacity:t.opacity};var o=(d.DASHES[t.line.dash]||[1]).slice();for(r=0;r<o.length;++r)o[r]*=t.line.width*i;n.line.dashes=o}return t.error_x&&t.error_x.visible&&(n.errorX=T(t,t.error_x,i)),t.error_y&&t.error_y.visible&&(n.errorY=T(t,t.error_y,i)),t.fill&&"none"!==t.fill&&(n.fill={closed:!0,fill:t.fillcolor,thickness:0}),n},markerStyle:_,markerSelection:b,linePositions:function(e,t,r){var n,i,a=r.length,o=a/2;if(h.hasLines(t)&&o)if("hv"===t.line.shape){for(n=[],i=0;i<o-1;i++)isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*i],r[2*i+1]),isNaN(r[2*i+2])||isNaN(r[2*i+3])?n.push(NaN,NaN):n.push(r[2*i+2],r[2*i+1]));n.push(r[a-2],r[a-1])}else if("hvh"===t.line.shape){for(n=[],i=0;i<o-1;i++)if(isNaN(r[2*i])||isNaN(r[2*i+1])||isNaN(r[2*i+2])||isNaN(r[2*i+3]))isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN):n.push(r[2*i],r[2*i+1]),n.push(NaN,NaN);else{var s=(r[2*i]+r[2*i+2])/2;n.push(r[2*i],r[2*i+1],s,r[2*i+1],s,r[2*i+3])}n.push(r[a-2],r[a-1])}else if("vhv"===t.line.shape){for(n=[],i=0;i<o-1;i++)if(isNaN(r[2*i])||isNaN(r[2*i+1])||isNaN(r[2*i+2])||isNaN(r[2*i+3]))isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN):n.push(r[2*i],r[2*i+1]),n.push(NaN,NaN);else{var l=(r[2*i+1]+r[2*i+3])/2;n.push(r[2*i],r[2*i+1],r[2*i],l,r[2*i+2],l)}n.push(r[a-2],r[a-1])}else if("vh"===t.line.shape){for(n=[],i=0;i<o-1;i++)isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*i],r[2*i+1]),isNaN(r[2*i+2])||isNaN(r[2*i+3])?n.push(NaN,NaN):n.push(r[2*i],r[2*i+3]));n.push(r[a-2],r[a-1])}else n=r;var c=!1;for(i=0;i<n.length;i++)if(isNaN(n[i])){c=!0;break}var u=c||n.length>d.TOO_MANY_POINTS||h.hasMarkers(t)?"rect":"round";if(c&&t.connectgaps){var f=n[0],p=n[1];for(i=0;i<n.length;i+=2)isNaN(n[i])||isNaN(n[i+1])?(n[i]=f,n[i+1]=p):(f=n[i],p=n[i+1])}return{join:u,positions:n}},errorBarPositions:function(e,t,n,i,o){var s=a.getComponentMethod("errorbars","makeComputeError"),l=c.getFromId(e,t.xaxis,"x"),u=c.getFromId(e,t.yaxis,"y"),h=n.length/2,f={};function p(e,i){var a=i._id.charAt(0),o=t["error_"+a];if(o&&o.visible&&("linear"===i.type||"log"===i.type)){for(var l=s(o),c={x:0,y:1}[a],u={x:[0,1,2,3],y:[2,3,0,1]}[a],p=new Float64Array(4*h),d=1/0,m=-1/0,g=0,y=0;g<h;g++,y+=4){var v=e[g];if(r(v)){var x=n[2*g+c],_=l(v,g),b=_[0],w=_[1];if(r(b)&&r(w)){var T=v-b,k=v+w;p[y+u[0]]=x-i.c2l(T),p[y+u[1]]=i.c2l(k)-x,p[y+u[2]]=0,p[y+u[3]]=0,d=Math.min(d,v-b),m=Math.max(m,v+w)}}}f[a]={positions:n,errors:p,_bnds:[d,m]}}}return p(i,l),p(o,u),f},textPosition:function(e,t,r,n){var i,a=t._length,o={};if(h.hasMarkers(t)){var l=r.font,c=r.align,u=r.baseline;for(o.offset=new Array(a),i=0;i<a;i++){var f=n.sizes?n.sizes[i]:n.size,p=s(l)?l[i].size:l.size,d=s(c)?c.length>1?c[i]:c[0]:c,m=s(u)?u.length>1?u[i]:u[0]:u,y=g[d],v=g[m],x=f?f/.8+1:0,_=-v*x-.5*v;o.offset[i]=[y*x/p,_/p]}}return o}}}}),_y=m({"src/traces/scattergl/scene_update.js"(e,t){var r=ct();t.exports=function(e,t){var n=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||((n=t._scene={}).init=function(){r.extendFlat(n,a,i)},n.init(),n.update=function(e){var t=r.repeat(e,n.count);if(n.fill2d&&n.fill2d.update(t),n.scatter2d&&n.scatter2d.update(t),n.line2d&&n.line2d.update(t),n.error2d&&n.error2d.update(t.concat(t)),n.select2d&&n.select2d.update(t),n.glText)for(var i=0;i<n.count;i++)n.glText[i].update(e)},n.draw=function(){for(var e=n.count,t=n.fill2d,i=n.error2d,a=n.line2d,o=n.scatter2d,s=n.glText,l=n.select2d,c=n.selectBatch,u=n.unselectBatch,h=0;h<e;h++){if(t&&n.fillOrder[h]&&t.draw(n.fillOrder[h]),a&&n.lineOptions[h]&&a.draw(h),i&&(n.errorXOptions[h]&&i.draw(h),n.errorYOptions[h]&&i.draw(h+e)),o&&n.markerOptions[h])if(u[h].length){var f=r.repeat([],n.count);f[h]=u[h],o.draw(f)}else c[h].length||o.draw(h);s[h]&&n.textOptions[h]&&s[h].render()}l&&l.draw(c),n.dirty=!1},n.destroy=function(){n.fill2d&&n.fill2d.destroy&&n.fill2d.destroy(),n.scatter2d&&n.scatter2d.destroy&&n.scatter2d.destroy(),n.error2d&&n.error2d.destroy&&n.error2d.destroy(),n.line2d&&n.line2d.destroy&&n.line2d.destroy(),n.select2d&&n.select2d.destroy&&n.select2d.destroy(),n.glText&&n.glText.forEach((function(e){e.destroy&&e.destroy()})),n.lineOptions=null,n.fillOptions=null,n.markerOptions=null,n.markerSelectedOptions=null,n.markerUnselectedOptions=null,n.errorXOptions=null,n.errorYOptions=null,n.textOptions=null,n.textSelectedOptions=null,n.textUnselectedOptions=null,n.selectBatch=null,n.unselectBatch=null,t._scene=null}),n.dirty||r.extendFlat(n,i),n}}}),by=m({"src/traces/scattergl/calc.js"(e,t){var r=cy(),n=ct(),i=_t(),a=ir().findExtremes,o=ni(),s=si(),l=s.calcMarkerSize,c=s.calcAxisExpansion,u=s.setFirstScatter,h=ii(),f=xy(),p=_y(),d=S().BADNUM,m=Xg().TOO_MANY_POINTS;function g(e,t,r){var n=e._extremes[t._id],i=a(t,r._bnds,{padded:!0});n.min=n.min.concat(i.min),n.max=n.max.concat(i.max)}t.exports=function(e,t){var a,s=e._fullLayout,y=t._xA=i.getFromId(e,t.xaxis,"x"),v=t._yA=i.getFromId(e,t.yaxis,"y"),x=s._plots[t.xaxis+t.yaxis],_=t._length,b=_>=m,w=2*_,T={},k=y.makeCalcdata(t,"x"),A=v.makeCalcdata(t,"y"),M=o(t,y,"x",k),S=o(t,v,"y",A),E=M.vals,C=S.vals;t._x=E,t._y=C,t.xperiodalignment&&(t._origX=k,t._xStarts=M.starts,t._xEnds=M.ends),t.yperiodalignment&&(t._origY=A,t._yStarts=S.starts,t._yEnds=S.ends);var I=new Array(w),L=new Array(_);for(a=0;a<_;a++)I[2*a]=E[a]===d?NaN:E[a],I[2*a+1]=C[a]===d?NaN:C[a],L[a]=a;if("log"===y.type)for(a=0;a<w;a+=2)I[a]=y.c2l(I[a]);if("log"===v.type)for(a=1;a<w;a+=2)I[a]=v.c2l(I[a]);b&&"log"!==y.type&&"log"!==v.type?T.tree=r(I):T.ids=L,h(e,t);var P,z=function(e,t,r,i,a,o){var s=f.style(e,r);if(s.marker&&(s.marker.positions=i),s.line&&i.length>1&&n.extendFlat(s.line,f.linePositions(e,r,i)),s.errorX||s.errorY){var l=f.errorBarPositions(e,r,i,a,o);s.errorX&&n.extendFlat(s.errorX,l.x),s.errorY&&n.extendFlat(s.errorY,l.y)}return s.text&&(n.extendFlat(s.text,{positions:i},f.textPosition(e,r,s.text,s.marker)),n.extendFlat(s.textSel,{positions:i},f.textPosition(e,r,s.text,s.markerSel)),n.extendFlat(s.textUnsel,{positions:i},f.textPosition(e,r,s.text,s.markerUnsel))),s}(e,0,t,I,E,C),D=p(e,x);return u(s,t),b?z.marker&&(P=z.marker.sizeAvg||Math.max(z.marker.size,3)):P=l(t,_),c(e,t,y,v,E,C,P),z.errorX&&g(t,y,z.errorX),z.errorY&&g(t,v,z.errorY),z.fill&&!D.fill2d&&(D.fill2d=!0),z.marker&&!D.scatter2d&&(D.scatter2d=!0),z.line&&!D.line2d&&(D.line2d=!0),(z.errorX||z.errorY)&&!D.error2d&&(D.error2d=!0),z.text&&!D.glText&&(D.glText=!0),z.marker&&(z.marker.snap=_),D.lineOptions.push(z.line),D.errorXOptions.push(z.errorX),D.errorYOptions.push(z.errorY),D.fillOptions.push(z.fill),D.markerOptions.push(z.marker),D.markerSelectedOptions.push(z.markerSel),D.markerUnselectedOptions.push(z.markerUnsel),D.textOptions.push(z.text),D.textSelectedOptions.push(z.textSel),D.textUnselectedOptions.push(z.textUnsel),D.selectBatch.push([]),D.unselectBatch.push([]),T._scene=D,T.index=D.count,T.x=E,T.y=C,T.positions=I,D.count++,[{x:!1,y:!1,t:T,trace:t}]}}}),wy=m({"src/traces/scattergl/edit_style.js"(e,t){var r=ct(),n=W(),i=Z().DESELECTDIM;t.exports={styleTextSelection:function(e){var t,a,o=e[0],s=o.trace,l=o.t,c=l._scene,u=l.index,h=c.selectBatch[u],f=c.unselectBatch[u],p=c.textOptions[u],d=c.textSelectedOptions[u]||{},m=c.textUnselectedOptions[u]||{},g=r.extendFlat({},p);if(h.length||f.length){var y=d.color,v=m.color,x=p.color,_=r.isArrayOrTypedArray(x);for(g.color=new Array(s._length),t=0;t<h.length;t++)a=h[t],g.color[a]=y||(_?x[a]:x);for(t=0;t<f.length;t++){a=f[t];var b=_?x[a]:x;g.color[a]=v||(y?b:n.addOpacity(b,i))}}c.glText[u].update(g)}}}}),Ty=m({"src/traces/scattergl/select.js"(e,t){var r=Xt(),n=wy().styleTextSelection;t.exports=function(e,t){var i=e.cd,a=e.xaxis,o=e.yaxis,s=[],l=i[0].trace,c=i[0].t,u=l._length,h=c.x,f=c.y,p=c._scene,d=c.index;if(!p)return s;var m=r.hasText(l),g=r.hasMarkers(l),y=!g&&!m;if(!0!==l.visible||y)return s;var v=[],x=[];if(!1!==t&&!t.degenerate)for(var _=0;_<u;_++)t.contains([c.xpx[_],c.ypx[_]],!1,_,e)?(v.push(_),s.push({pointNumber:_,x:a.c2d(h[_]),y:o.c2d(f[_])})):x.push(_);if(g){var b=p.scatter2d;if(v.length||x.length){if(!p.selectBatch[d].length&&!p.unselectBatch[d].length){var w=new Array(p.count);w[d]=p.markerUnselectedOptions[d],b.update.apply(b,w)}}else{var T=new Array(p.count);T[d]=p.markerOptions[d],b.update.apply(b,T)}}return p.selectBatch[d]=v,p.unselectBatch[d]=x,m&&n(i),s}}}),ky=m({"src/traces/scattergl/base_index.js"(e,t){var r=Yg();t.exports={moduleType:"trace",name:"scattergl",basePlotModule:Ci(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:$g(),supplyDefaults:Jg(),crossTraceDefaults:ti(),colorbar:mi(),formatLabels:Qg(),calc:by(),hoverPoints:r.hoverPoints,selectPoints:Ty(),meta:{}}}}),Ay=m({"node_modules/color-id/index.js"(e,t){var r=Jd();function n(e,t){null==t&&(t=!0);var n=e[0],i=e[1],a=e[2],o=e[3];return null==o&&(o=t?1:255),t&&(n*=255,i*=255,a*=255,o*=255),16777216*(n=255&r(n,0,255))+((i=255&r(i,0,255))<<16)+((a=255&r(a,0,255))<<8)+(255&r(o,0,255))}t.exports=n,t.exports.to=n,t.exports.from=function(e,t){var r=(e=+e)>>>24,n=(16711680&e)>>>16,i=(65280&e)>>>8,a=255&e;return!1===t?[r,n,i,a]:[r/255,n/255,i/255,a/255]}}}),My=m({"node_modules/object-assign/index.js"(e,t){var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch{return!1}}()?Object.assign:function(e,t){for(var a,o,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var c in a=Object(arguments[l]))n.call(a,c)&&(s[c]=a[c]);if(r){o=r(a);for(var u=0;u<o.length;u++)i.call(a,o[u])&&(s[o[u]]=a[o[u]])}}return s}}}),Sy=m({"node_modules/glslify/browser.js"(e,t){t.exports=function(e){"string"==typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n<e.length-1;n++)r.push(e[n],t[n]||"");return r.push(e[n]),r.join("")}}}),Ey=m({"node_modules/update-diff/index.js"(e,t){t.exports=function(e,t,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n<i;n++){var a=r[n];for(var o in a)if((void 0===t[o]||Array.isArray(t[o])||e[o]!==t[o])&&o in t){var s;if(!0===a[o])s=t[o];else{if(!1===a[o])continue;if("function"==typeof a[o]&&void 0===(s=a[o](t[o],e,t)))continue}e[o]=s}}return e}}}),Cy=m({"node_modules/is-iexplorer/index.js"(e,t){t.exports=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}}),Iy=m({"node_modules/to-float32/index.js"(e,t){t.exports=n,t.exports.float32=t.exports.float=n,t.exports.fract32=t.exports.fract=function(e,t){if(e.length){if(e instanceof Float32Array)return new Float32Array(e.length);t instanceof Float32Array||(t=n(e));for(var r=0,i=t.length;r<i;r++)t[r]=e[r]-t[r];return t}return n(e-n(e))};var r=new Float32Array(1);function n(e){return e.length?e instanceof Float32Array?e:new Float32Array(e):(r[0]=e,r[0])}}}),Ly=m({"node_modules/regl-scatter2d/bundle.js"(e,t){function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if(typeof Symbol<"u"&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var o=em(),s=ny(),l=Ay(),c=cy(),u=My(),h=Sy(),f=ty(),p=Ey(),d=ay(),m=Cy(),g=Iy(),y=ry(),v=x;function x(e,t){var r=this;if(!(this instanceof x))return new x(e,t);"function"==typeof e?(t||(t={}),t.regl=e):(t=e,e=null),t&&t.length&&(t.positions=t);var n,i=(e=t.regl)._gl,a=[],o=255;this.tooManyColors=m,n=e.texture({data:new Uint8Array(4*o),width:o,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),u(this,{regl:e,gl:i,groups:[],markerCache:[null],markerTextures:[null],palette:a,paletteIds:{},paletteTexture:n,maxColors:o,maxSize:100,canvas:i.canvas}),this.update(t);var s={uniforms:{constPointSize:!!t.constPointSize,opacity:e.prop("opacity"),paletteSize:function(e,t){return[r.tooManyColors?0:o,n.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:n},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(255*t.size/r.maxSize)]}},borderSize:function(e,t){return t.borderSize.length?{buffer:t.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(255*t.borderSize/r.maxSize)]}},colorId:function(e,t){return t.color.length?{buffer:t.colorBuffer,stride:r.tooManyColors?8:4,offset:0}:{constant:r.tooManyColors?a.slice(4*t.color,4*t.color+4):[t.color]}},borderColorId:function(e,t){return t.borderColor.length?{buffer:t.colorBuffer,stride:r.tooManyColors?8:4,offset:r.tooManyColors?4:2}:{constant:r.tooManyColors?a.slice(4*t.borderColor,4*t.borderColor+4):[t.borderColor]}},isActive:function(e,t){return!0===t.activation?{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"},l=u({},s);l.frag=h(["precision highp float;\n#define GLSLIFY 1\n\nuniform float opacity;\nuniform sampler2D markerTexture;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragWidth, fragBorderColorLevel, fragColorLevel;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float dist = texture2D(markerTexture, gl_PointCoord).r, delta = fragWidth;\n\n // max-distance alpha\n if (dist < 0.003) discard;\n\n // null-border case\n if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {\n float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);\n gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity);\n }\n else {\n float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);\n float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);\n\n vec4 color = fragBorderColor;\n color.a *= borderColorAmt;\n color = mix(color, fragColor, colorAmt);\n color.a *= opacity;\n\n gl_FragColor = color;\n }\n\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 scale, scaleFract, translate, translateFract, paletteSize;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\nconst float borderLevel = .5;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = 2. * size * pointSizeScale;\n fragPointSize = size * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n\n fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);\n fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);\n}\n"]),this.drawMarker=e(l);var c=u({},s);c.frag=h(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nuniform float opacity;\n\nfloat smoothStep(float edge0, float edge1, float x) {\n\tfloat t;\n\tt = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n\treturn t * t * (3.0 - 2.0 * t);\n}\n\nvoid main() {\n\tfloat radius, alpha = 1.0, delta = fragWidth;\n\n\tradius = length(2.0 * gl_PointCoord.xy - 1.0);\n\n\tif (radius > 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),c.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),m&&(c.frag=c.frag.replace("smoothstep","smoothStep"),l.frag=l.frag.replace("smoothstep","smoothStep")),this.drawCircle=e(c)}x.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},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=this.groups;if(1===r.length&&Array.isArray(r[0])&&(null===r[0][0]||Array.isArray(r[0][0]))&&(r=r[0]),this.regl._refresh(),r.length)for(var a=0;a<r.length;a++)this.drawItem(a,r[a]);else i.forEach((function(t,r){e.drawItem(r)}));return this},x.prototype.drawItem=function(e,t){var r=this.groups,i=r[e];if("number"==typeof t&&(e=t,i=r[t],t=null),i&&i.count&&i.opacity){i.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,i,t));for(var a=[],o=1;o<i.activation.length;o++)!i.activation[o]||!0!==i.activation[o]&&!i.activation[o].data.length||a.push.apply(a,n(this.getMarkerDrawOptions(o,i,t)));a.length&&this.drawMarker(a)}},x.prototype.getMarkerDrawOptions=function(e,t,n){var i=t.range,a=t.tree,o=t.viewport,s=t.activation,l=t.selectionBuffer,c=t.count;if(this.regl,!a)return n?[u({},t,{markerTexture:this.markerTextures[e],activation:s[e],count:n.length,elements:n,offset:0})]:[u({},t,{markerTexture:this.markerTextures[e],activation:s[e],offset:0})];var h=[],f=a.range(i,{lod:!0,px:[(i[2]-i[0])/o.width,(i[3]-i[1])/o.height]});if(n){for(var p=s[e].data,d=new Uint8Array(c),m=0;m<n.length;m++){var g=n[m];d[g]=p?p[g]:1}l.subdata(d)}for(var y=f.length;y--;){var v=r(f[y],2),x=v[0],_=v[1];h.push(u({},t,{markerTexture:this.markerTextures[e],activation:n?l:s[e],offset:x,count:_-x}))}return h},x.prototype.update=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r.length){1===r.length&&Array.isArray(r[0])&&(r=r[0]);var i=this.groups,a=this.gl,o=this.regl,l=this.maxSize,h=this.maxColors,m=this.palette;this.groups=i=r.map((function(t,r){var n=i[r];if(void 0===t)return n;null===t?t={positions:null}:"function"==typeof t?t={ondraw:t}:"number"==typeof t[0]&&(t={positions:t}),null===(t=f(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"})).positions&&(t.positions=[]),null!=t.tooManyColors&&(e.tooManyColors=t.tooManyColors),n||(i[r]=n={id:r,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:o.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},t=u({},x.defaults,t)),t.positions&&!("marker"in t)&&(t.marker=n.marker,delete n.marker),t.marker&&!("positions"in t)&&(t.positions=n.positions,delete n.positions);var v=0,_=0;if(p(n,t,[{snap:!0,size:function(e,t){return null==e&&(e=x.defaults.size),v+=e&&e.length?1:0,e},borderSize:function(e,t){return null==e&&(e=x.defaults.borderSize),v+=e&&e.length?1:0,e},opacity:parseFloat,color:function(t,r){return null==t&&(t=x.defaults.color),t=e.updateColor(t),_++,t},borderColor:function(t,r){return null==t&&(t=x.defaults.borderColor),t=e.updateColor(t),_++,t},bounds:function(e,t,r){return"range"in r||(r.range=null),e},positions:function(e,t,r){var n=t.snap,i=t.positionBuffer,a=t.positionFractBuffer,l=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:4*e.x.offset||0,stride:4*(e.x.stride||1),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:4*e.y.offset||0,stride:4*(e.y.stride||1),count:e.y.count},t.count=Math.max(t.xAttr.count,t.yAttr.count),e;e=d(e,"float64");var u=t.count=Math.floor(e.length/2),h=t.bounds=u?s(e,2):null;if(!r.range&&!t.range&&(delete t.range,r.range=h),!r.marker&&!t.marker&&(delete t.marker,r.marker=null),n&&(!0===n||u>n)?t.tree=c(e,{bounds:h}):n&&n.length&&(t.tree=n),t.tree){var f={primitive:"points",usage:"static",data:t.tree,type:"uint32"};t.elements?t.elements(f):t.elements=o.elements(f)}var p=g.float32(e);return i({data:p,usage:"dynamic"}),a({data:g.fract32(e,p),usage:"dynamic"}),l({data:new Uint8Array(u),type:"uint8",usage:"stream"}),e}},{marker:function(t,r,n){var i=r.activation;if(i.forEach((function(e){return e&&e.destroy&&e.destroy()})),i.length=0,t&&"number"!=typeof t[0]){for(var a=[],s=0,l=Math.min(t.length,r.count);s<l;s++){var c=e.addMarker(t[s]);a[c]||(a[c]=new Uint8Array(r.count)),a[c][s]=1}for(var u=0;u<a.length;u++)if(a[u]){var h={data:a[u],type:"uint8",usage:"static"};i[u]?i[u](h):i[u]=o.buffer(h),i[u].data=a[u]}}else i[e.addMarker(t)]=!0;return t},range:function(e,t,r){var n=t.bounds;if(n)return e||(e=n),t.scale=[1/(e[2]-e[0]),1/(e[3]-e[1])],t.translate=[-e[0],-e[1]],t.scaleFract=g.fract(t.scale),t.translateFract=g.fract(t.translate),e},viewport:function(e){return y(e||[a.drawingBufferWidth,a.drawingBufferHeight])}}]),v){var b=n,w=b.count,T=b.size,k=b.borderSize,A=b.sizeBuffer,M=new Uint8Array(2*w);if(T.length||k.length)for(var S=0;S<w;S++)M[2*S]=Math.round(255*(null==T[S]?T:T[S])/l),M[2*S+1]=Math.round(255*(null==k[S]?k:k[S])/l);A({data:M,usage:"dynamic"})}if(_){var E,C=n,I=C.count,L=C.color,P=C.borderColor,z=C.colorBuffer;if(e.tooManyColors){if(L.length||P.length){E=new Uint8Array(8*I);for(var D=0;D<I;D++){var O=L[D];E[8*D]=m[4*O],E[8*D+1]=m[4*O+1],E[8*D+2]=m[4*O+2],E[8*D+3]=m[4*O+3];var R=P[D];E[8*D+4]=m[4*R],E[8*D+5]=m[4*R+1],E[8*D+6]=m[4*R+2],E[8*D+7]=m[4*R+3]}}}else if(L.length||P.length){E=new Uint8Array(4*I+2);for(var F=0;F<I;F++)null!=L[F]&&(E[4*F]=L[F]%h,E[4*F+1]=Math.floor(L[F]/h)),null!=P[F]&&(E[4*F+2]=P[F]%h,E[4*F+3]=Math.floor(P[F]/h))}z({data:E||new Uint8Array(0),type:"uint8",usage:"dynamic"})}return n}))}},x.prototype.addMarker=function(e){var t,r=this.markerTextures,n=this.regl,i=this.markerCache,a=null==e?0:i.indexOf(e);if(a>=0)return a;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)t=e;else{t=new Uint8Array(e.length);for(var o=0,s=e.length;o<s;o++)t[o]=255*e[o]}var l=Math.floor(Math.sqrt(t.length));return a=r.length,i.push(e),r.push(n.texture({channels:1,data:t,radius:l,mag:"linear",min:"linear"})),a},x.prototype.updateColor=function(e){var t=this.paletteIds,r=this.palette,n=this.maxColors;Array.isArray(e)||(e=[e]);var i=[];if("number"==typeof e[0]){var a=[];if(Array.isArray(e))for(var s=0;s<e.length;s+=4)a.push(e.slice(s,s+4));else for(var c=0;c<e.length;c+=4)a.push(e.subarray(c,c+4));e=a}for(var u=0;u<e.length;u++){var h=e[u];h=o(h,"uint8");var f=l(h,!1);if(null==t[f]){var p=r.length;t[f]=Math.floor(p/4),r[p]=h[0],r[p+1]=h[1],r[p+2]=h[2],r[p+3]=h[3]}i[u]=t[f]}return!this.tooManyColors&&r.length>4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},x.prototype.updatePalette=function(e){if(!this.tooManyColors){var t=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*e.length/t);if(n>1)for(var i=.25*(e=e.slice()).length%t;i<n*t;i++)e.push(0,0,0,0);r.height<n&&r.resize(t,n),r.subimage({width:Math.min(.25*e.length,t),height:n,data:e},0,0)}},x.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 _=My();t.exports=function(e,t){var r=new v(e,t),n=r.render.bind(r);return _(n,{render:n,update:r.update.bind(r),draw:r.draw.bind(r),destroy:r.destroy.bind(r),regl:r.regl,gl:r.gl,canvas:r.gl.canvas,groups:r.groups,markers:r.markerCache,palette:r.palette}),n}}}),Py=m({"node_modules/earcut/src/earcut.js"(e,t){function r(e,t,r){r=r||2;var i,o,s,l,c,f,p,m=t&&t.length,g=m?t[0]*r:e.length,y=n(e,0,g,r,!0),v=[];if(!y||y.next===y.prev)return v;if(m&&(y=function(e,t,r,i){var a,o,s,l=[];for(a=0,o=t.length;a<o;a++)(s=n(e,t[a]*i,a<o-1?t[a+1]*i:e.length,i,!1))===s.next&&(s.steiner=!0),l.push(d(s));for(l.sort(u),a=0;a<l.length;a++)r=h(l[a],r);return r}(e,t,y,r)),e.length>80*r){i=s=e[0],o=l=e[1];for(var x=r;x<g;x+=r)(c=e[x])<i&&(i=c),(f=e[x+1])<o&&(o=f),c>s&&(s=c),f>l&&(l=f);p=0!==(p=Math.max(s-i,l-o))?32767/p:0}return a(y,v,r,i,o,p,0),v}function n(e,t,r,n,i){var a,o;if(i===S(e,t,r,n)>0)for(a=t;a<r;a+=n)o=k(a,e[a],e[a+1],o);else for(a=r-n;a>=t;a-=n)o=k(a,e[a],e[a+1],o);return o&&v(o,o.next)&&(A(o),o=o.next),o}function i(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!v(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(A(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function a(e,t,r,n,u,h,f){if(e){!f&&h&&function(e,t,r,n){var i=e;do{0===i.z&&(i.z=p(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,l,c=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t<c&&(s++,n=n.nextZ);t++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(e,n,u,h);for(var d,m,g=e;e.prev!==e.next;)if(d=e.prev,m=e.next,h?s(e,n,u,h):o(e))t.push(d.i/r|0),t.push(e.i/r|0),t.push(m.i/r|0),A(e),e=m.next,g=m.next;else if((e=m)===g){f?1===f?a(e=l(i(e),t,r),t,r,n,u,h,2):2===f&&c(e,t,r,n,u,h):a(i(e),t,r,n,u,h,1);break}}}function o(e){var t=e.prev,r=e,n=e.next;if(y(t,r,n)>=0)return!1;for(var i=t.x,a=r.x,o=n.x,s=t.y,l=r.y,c=n.y,u=i<a?i<o?i:o:a<o?a:o,h=s<l?s<c?s:c:l<c?l:c,f=i>a?i>o?i:o:a>o?a:o,p=s>l?s>c?s:c:l>c?l:c,d=n.next;d!==t;){if(d.x>=u&&d.x<=f&&d.y>=h&&d.y<=p&&m(i,s,a,l,o,c,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function s(e,t,r,n){var i=e.prev,a=e,o=e.next;if(y(i,a,o)>=0)return!1;for(var s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,f=o.y,d=s<l?s<c?s:c:l<c?l:c,g=u<h?u<f?u:f:h<f?h:f,v=s>l?s>c?s:c:l>c?l:c,x=u>h?u>f?u:f:h>f?h:f,_=p(d,g,t,r,n),b=p(v,x,t,r,n),w=e.prevZ,T=e.nextZ;w&&w.z>=_&&T&&T.z<=b;){if(w.x>=d&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,f,w.x,w.y)&&y(w.prev,w,w.next)>=0||(w=w.prevZ,T.x>=d&&T.x<=v&&T.y>=g&&T.y<=x&&T!==i&&T!==o&&m(s,u,l,h,c,f,T.x,T.y)&&y(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;w&&w.z>=_;){if(w.x>=d&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,f,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;T&&T.z<=b;){if(T.x>=d&&T.x<=v&&T.y>=g&&T.y<=x&&T!==i&&T!==o&&m(s,u,l,h,c,f,T.x,T.y)&&y(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function l(e,t,r){var n=e;do{var a=n.prev,o=n.next.next;!v(a,o)&&x(a,n,n.next,o)&&w(a,o)&&w(o,a)&&(t.push(a.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),A(n),A(n.next),n=e=o),n=n.next}while(n!==e);return i(n)}function c(e,t,r,n,o,s){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&g(l,c)){var u=T(l,c);return l=i(l,l.next),u=i(u,u.next),a(l,t,r,n,o,s,0),void a(u,t,r,n,o,s,0)}c=c.next}l=l.next}while(l!==e)}function u(e,t){return e.x-t.x}function h(e,t){var r=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o&&(o=s,r=n.x<n.next.x?n:n.next,s===i))return r}n=n.next}while(n!==t);if(!r)return null;var l,c=r,u=r.x,h=r.y,p=1/0;n=r;do{i>=n.x&&n.x>=u&&i!==n.x&&m(a<h?i:o,a,u,h,a<h?o:i,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(i-n.x),w(n,e)&&(l<p||l===p&&(n.x>r.x||n.x===r.x&&f(r,n)))&&(r=n,p=l)),n=n.next}while(n!==c);return r}(e,t);if(!r)return t;var n=T(r,e);return i(n,n.next),i(r,r.next)}function f(e,t){return y(e.prev,e,t.prev)<0&&y(t.next,e,e.next)<0}function p(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function d(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function m(e,t,r,n,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(n-s)>=(r-o)*(t-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&x(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(w(e,t)&&w(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(y(e.prev,e,t.prev)||y(e,t.prev,t))||v(e,t)&&y(e.prev,e,e.next)>0&&y(t.prev,t,t.next)>0)}function y(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function x(e,t,r,n){var i=b(y(e,t,r)),a=b(y(e,t,n)),o=b(y(r,n,e)),s=b(y(r,n,t));return!!(i!==a&&o!==s||0===i&&_(e,r,t)||0===a&&_(e,n,t)||0===o&&_(r,e,n)||0===s&&_(r,t,n))}function _(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function b(e){return e>0?1:e<0?-1:0}function w(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function T(e,t){var r=new M(e.i,e.x,e.y),n=new M(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function k(e,t,r,n){var i=new M(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function A(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,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(e,t,r,n){for(var i=0,a=t,o=r-n;a<r;a+=n)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}t.exports=r,t.exports.default=r,r.deviation=function(e,t,r,n){var i=t&&t.length,a=i?t[0]*r:e.length,o=Math.abs(S(e,0,a,r));if(i)for(var s=0,l=t.length;s<l;s++){var c=t[s]*r,u=s<l-1?t[s+1]*r:e.length;o-=Math.abs(S(e,c,u,r))}var h=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,p=n[s+1]*r,d=n[s+2]*r;h+=Math.abs((e[f]-e[d])*(e[p+1]-e[f+1])-(e[f]-e[p])*(e[d+1]-e[f+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},r.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)r.vertices.push(e[i][a][o]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r}}}),zy=m({"node_modules/array-normalize/index.js"(e,t){var r=ny();t.exports=function(e,t,n){if(!e||null==e.length)throw Error("Argument should be an array");null==t&&(t=1),null==n&&(n=r(e,t));for(var i=0;i<t;i++){var a=n[t+i],o=n[i],s=i,l=e.length;if(a===1/0&&o===-1/0)for(s=i;s<l;s+=t)e[s]=e[s]===a?1:e[s]===o?0:.5;else if(a===1/0)for(s=i;s<l;s+=t)e[s]=e[s]===a?1:0;else if(o===-1/0)for(s=i;s<l;s+=t)e[s]=e[s]===o?0:1;else{var c=a-o;for(s=i;s<l;s+=t)isNaN(e[s])||(e[s]=0===c?.5:(e[s]-o)/c)}}return e}}}),Dy=m({"node_modules/es6-weak-map/is-implemented.js"(e,t){t.exports=function(){var e,t;if("function"!=typeof WeakMap)return!1;try{e=new WeakMap([[t={},"one"],[{},"two"],[{},"three"]])}catch{return!1}return!("[object WeakMap]"!==String(e)||"function"!=typeof e.set||e.set({},1)!==e||"function"!=typeof e.delete||"function"!=typeof e.has||"one"!==e.get(t))}}}),Oy=m({"node_modules/es5-ext/function/noop.js"(e,t){t.exports=function(){}}}),Ry=m({"node_modules/es5-ext/object/is-value.js"(e,t){var r=Oy()();t.exports=function(e){return e!==r&&null!==e}}}),Fy=m({"node_modules/es5-ext/object/set-prototype-of/is-implemented.js"(e,t){var r=Object.create,n=Object.getPrototypeOf,i={};t.exports=function(){var e=Object.setPrototypeOf;return"function"==typeof e&&n(e((arguments[0]||r)(null),i))===i}}}),By=m({"node_modules/es5-ext/object/is-object.js"(e,t){var r=Ry(),n={function:!0,object:!0};t.exports=function(e){return r(e)&&n[typeof e]||!1}}}),jy=m({"node_modules/es5-ext/object/valid-value.js"(e,t){var r=Ry();t.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}}}),Ny=m({"node_modules/es5-ext/object/create.js"(e,t){var r,n,i,a,o=Object.create;Fy()()||(r=Uy()),t.exports=r&&1===r.level?(n={},i={},a={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(e){i[e]="__proto__"!==e?a:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(n,i),Object.defineProperty(r,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:n}),function(e,t){return o(null===e?n:e,t)}):o}}),Uy=m({"node_modules/es5-ext/object/set-prototype-of/shim.js"(e,t){var r,n,i,a,o=By(),s=jy(),l=Object.prototype.isPrototypeOf,c=Object.defineProperty,u={configurable:!0,enumerable:!1,writable:!0,value:void 0};r=function(e,t){if(s(e),null===t||o(t))return e;throw new TypeError("Prototype must be null or an object")},t.exports=(n=function(){var e,t=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(e=n.set).call(t,r)}catch{}if(Object.getPrototypeOf(t)===r)return{set:e,level:2}}return t.__proto__=r,Object.getPrototypeOf(t)===r?{level:2}:((t={}).__proto__=r,Object.getPrototypeOf(t)===r&&{level:1})}(),n?(2===n.level?n.set?(a=n.set,i=function(e,t){return a.call(r(e,t),t),e}):i=function(e,t){return r(e,t).__proto__=t,e}:i=function e(t,n){var i;return r(t,n),(i=l.call(e.nullPolyfill,t))&&delete e.nullPolyfill.__proto__,null===n&&(n=e.nullPolyfill),t.__proto__=n,i&&c(e.nullPolyfill,"__proto__",u),t},Object.defineProperty(i,"level",{configurable:!1,enumerable:!1,writable:!1,value:n.level})):null),Ny()}}),Vy=m({"node_modules/es5-ext/object/set-prototype-of/index.js"(e,t){t.exports=Fy()()?Object.setPrototypeOf:Uy()}}),qy=m({"node_modules/es5-ext/object/valid-object.js"(e,t){var r=By();t.exports=function(e){if(!r(e))throw new TypeError(e+" is not an Object");return e}}}),Hy=m({"node_modules/es5-ext/string/random-uniq.js"(e,t){var r=Object.create(null),n=Math.random;t.exports=function(){var e;do{e=n().toString(36).slice(2)}while(r[e]);return e}}}),Gy=m({"node_modules/type/value/is.js"(e,t){t.exports=function(e){return null!=e}}}),Wy=m({"node_modules/type/object/is.js"(e,t){var r=Gy(),n={object:!0,function:!0,undefined:!0};t.exports=function(e){return!!r(e)&&hasOwnProperty.call(n,typeof e)}}}),Zy=m({"node_modules/type/prototype/is.js"(e,t){var r=Wy();t.exports=function(e){if(!r(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch{return!1}}}}),Yy=m({"node_modules/type/function/is.js"(e,t){var r=Zy();t.exports=function(e){if("function"!=typeof e||!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length||"function"!=typeof e.call||"function"!=typeof e.apply)return!1}catch{return!1}return!r(e)}}}),Xy=m({"node_modules/type/plain-function/is.js"(e,t){var r=Yy(),n=/^\s*class[\s{/}]/,i=Function.prototype.toString;t.exports=function(e){return!(!r(e)||n.test(i.call(e)))}}}),$y=m({"node_modules/es5-ext/object/assign/is-implemented.js"(e,t){t.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}}}),Ky=m({"node_modules/es5-ext/object/keys/is-implemented.js"(e,t){t.exports=function(){try{return Object.keys("primitive"),!0}catch{return!1}}}}),Jy=m({"node_modules/es5-ext/object/keys/shim.js"(e,t){var r=Ry(),n=Object.keys;t.exports=function(e){return n(r(e)?Object(e):e)}}}),Qy=m({"node_modules/es5-ext/object/keys/index.js"(e,t){t.exports=Ky()()?Object.keys:Jy()}}),ev=m({"node_modules/es5-ext/object/assign/shim.js"(e,t){var r=Qy(),n=jy(),i=Math.max;t.exports=function(e,t){var a,o,s,l=i(arguments.length,2);for(e=Object(n(e)),s=function(r){try{e[r]=t[r]}catch(e){a||(a=e)}},o=1;o<l;++o)r(t=arguments[o]).forEach(s);if(void 0!==a)throw a;return e}}}),tv=m({"node_modules/es5-ext/object/assign/index.js"(e,t){t.exports=$y()()?Object.assign:ev()}}),rv=m({"node_modules/es5-ext/object/normalize-options.js"(e,t){var r=Ry(),n=Array.prototype.forEach,i=Object.create;t.exports=function(e){var t=i(null);return n.call(arguments,(function(e){r(e)&&function(e,t){var r;for(r in e)t[r]=e[r]}(Object(e),t)})),t}}}),nv=m({"node_modules/es5-ext/string/#/contains/is-implemented.js"(e,t){var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&!0===r.contains("dwa")&&!1===r.contains("foo")}}}),iv=m({"node_modules/es5-ext/string/#/contains/shim.js"(e,t){var r=String.prototype.indexOf;t.exports=function(e){return r.call(this,e,arguments[1])>-1}}}),av=m({"node_modules/es5-ext/string/#/contains/index.js"(e,t){t.exports=nv()()?String.prototype.contains:iv()}}),ov=m({"node_modules/d/index.js"(e,t){var r=Gy(),n=Xy(),i=tv(),a=rv(),o=av(),s=t.exports=function(e,t){var n,s,l,c,u;return arguments.length<2||"string"!=typeof e?(c=t,t=e,e=null):c=arguments[2],r(e)?(n=o.call(e,"c"),s=o.call(e,"e"),l=o.call(e,"w")):(n=l=!0,s=!1),u={value:t,configurable:n,enumerable:s,writable:l},c?i(a(c),u):u};s.gs=function(e,t,s){var l,c,u,h;return"string"!=typeof e?(u=s,s=t,t=e,e=null):u=arguments[3],r(t)?n(t)?r(s)?n(s)||(u=s,s=void 0):s=void 0:(u=t,t=s=void 0):t=void 0,r(e)?(l=o.call(e,"c"),c=o.call(e,"e")):(l=!0,c=!1),h={get:t,set:s,configurable:l,enumerable:c},u?i(a(u),h):h}}}),sv=m({"node_modules/es5-ext/function/is-arguments.js"(e,t){var r=Object.prototype.toString,n=r.call(function(){return arguments}());t.exports=function(e){return r.call(e)===n}}}),lv=m({"node_modules/es5-ext/string/is-string.js"(e,t){var r=Object.prototype.toString,n=r.call("");t.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===n)||!1}}}),cv=m({"node_modules/ext/global-this/is-implemented.js"(e,t){t.exports=function(){return!("object"!=typeof globalThis||!globalThis)&&globalThis.Array===Array}}}),uv=m({"node_modules/ext/global-this/implementation.js"(e,t){var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new 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 r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()}}),hv=m({"node_modules/ext/global-this/index.js"(e,t){t.exports=cv()()?globalThis:uv()}}),fv=m({"node_modules/es6-symbol/is-implemented.js"(e,t){var r=hv(),n={object:!0,symbol:!0};t.exports=function(){var e,t=r.Symbol;if("function"!=typeof t)return!1;e=t("test symbol");try{String(e)}catch{return!1}return!(!n[typeof t.iterator]||!n[typeof t.toPrimitive]||!n[typeof t.toStringTag])}}}),pv=m({"node_modules/es6-symbol/is-symbol.js"(e,t){t.exports=function(e){return!(!e||"symbol"!=typeof e&&(!e.constructor||"Symbol"!==e.constructor.name||"Symbol"!==e[e.constructor.toStringTag]))}}}),dv=m({"node_modules/es6-symbol/validate-symbol.js"(e,t){var r=pv();t.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}}}),mv=m({"node_modules/es6-symbol/lib/private/generate-name.js"(e,t){var r=ov(),n=Object.create,i=Object.defineProperty,a=Object.prototype,o=n(null);t.exports=function(e){for(var t,n,s=0;o[e+(s||"")];)++s;return o[e+=s||""]=!0,i(a,t="@@"+e,r.gs(null,(function(e){n||(n=!0,i(this,t,r(e)),n=!1)}))),t}}}),gv=m({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(e,t){var r=ov(),n=hv().Symbol;t.exports=function(e){return Object.defineProperties(e,{hasInstance:r("",n&&n.hasInstance||e("hasInstance")),isConcatSpreadable:r("",n&&n.isConcatSpreadable||e("isConcatSpreadable")),iterator:r("",n&&n.iterator||e("iterator")),match:r("",n&&n.match||e("match")),replace:r("",n&&n.replace||e("replace")),search:r("",n&&n.search||e("search")),species:r("",n&&n.species||e("species")),split:r("",n&&n.split||e("split")),toPrimitive:r("",n&&n.toPrimitive||e("toPrimitive")),toStringTag:r("",n&&n.toStringTag||e("toStringTag")),unscopables:r("",n&&n.unscopables||e("unscopables"))})}}}),yv=m({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(e,t){var r=ov(),n=dv(),i=Object.create(null);t.exports=function(e){return Object.defineProperties(e,{for:r((function(t){return i[t]?i[t]:i[t]=e(String(t))})),keyFor:r((function(e){var t;for(t in n(e),i)if(i[t]===e)return t}))})}}}),vv=m({"node_modules/es6-symbol/polyfill.js"(e,t){var r,n,i,a=ov(),o=dv(),s=hv().Symbol,l=mv(),c=gv(),u=yv(),h=Object.create,f=Object.defineProperties,p=Object.defineProperty;if("function"==typeof s)try{String(s()),i=!0}catch{}else s=null;n=function(e){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return r(e)},t.exports=r=function e(t){var r;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return i?s(t):(r=h(n.prototype),t=void 0===t?"":String(t),f(r,{__description__:a("",t),__name__:a("",l(t))}))},c(r),u(r),f(n.prototype,{constructor:a(r),toString:a("",(function(){return this.__name__}))}),f(r.prototype,{toString:a((function(){return"Symbol ("+o(this).__description__+")"})),valueOf:a((function(){return o(this)}))}),p(r.prototype,r.toPrimitive,a("",(function(){var e=o(this);return"symbol"==typeof e?e:e.toString()}))),p(r.prototype,r.toStringTag,a("c","Symbol")),p(n.prototype,r.toStringTag,a("c",r.prototype[r.toStringTag])),p(n.prototype,r.toPrimitive,a("c",r.prototype[r.toPrimitive]))}}),xv=m({"node_modules/es6-symbol/index.js"(e,t){t.exports=fv()()?hv().Symbol:vv()}}),_v=m({"node_modules/es5-ext/array/#/clear.js"(e,t){var r=jy();t.exports=function(){return r(this).length=0,this}}}),bv=m({"node_modules/es5-ext/object/valid-callable.js"(e,t){t.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}}}),wv=m({"node_modules/type/string/coerce.js"(e,t){var r=Gy(),n=Wy(),i=Object.prototype.toString;t.exports=function(e){if(!r(e))return null;if(n(e)){var t=e.toString;if("function"!=typeof t||t===i)return null}try{return""+e}catch{return null}}}}),Tv=m({"node_modules/type/lib/safe-to-string.js"(e,t){t.exports=function(e){try{return e.toString()}catch{try{return String(e)}catch{return null}}}}}),kv=m({"node_modules/type/lib/to-short-string.js"(e,t){var r=Tv(),n=/[\n\r\u2028\u2029]/g;t.exports=function(e){var t=r(e);return null===t?"<Non-coercible to string value>":(t.length>100&&(t=t.slice(0,99)+"…"),t=t.replace(n,(function(e){switch(e){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}}}),Av=m({"node_modules/type/lib/resolve-exception.js"(e,t){var r=Gy(),n=Wy(),i=wv(),a=kv(),o=function(e,t){return e.replace("%v",a(t))};t.exports=function(e,t,a){if(!n(a))throw new TypeError(o(t,e));if(!r(e)){if("default"in a)return a.default;if(a.isOptional)return null}var s=i(a.errorMessage);throw r(s)||(s=t),new TypeError(o(s,e))}}}),Mv=m({"node_modules/type/value/ensure.js"(e,t){var r=Av(),n=Gy();t.exports=function(e){return n(e)?e:r(e,"Cannot use %v",arguments[1])}}}),Sv=m({"node_modules/type/plain-function/ensure.js"(e,t){var r=Av(),n=Xy();t.exports=function(e){return n(e)?e:r(e,"%v is not a plain function",arguments[1])}}}),Ev=m({"node_modules/es5-ext/array/from/is-implemented.js"(e,t){t.exports=function(){var e,t,r=Array.from;return"function"==typeof r&&!(!(t=r(e=["raz","dwa"]))||t===e||"dwa"!==t[1])}}}),Cv=m({"node_modules/es5-ext/function/is-function.js"(e,t){var r=Object.prototype.toString,n=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);t.exports=function(e){return"function"==typeof e&&n(r.call(e))}}}),Iv=m({"node_modules/es5-ext/math/sign/is-implemented.js"(e,t){t.exports=function(){var e=Math.sign;return"function"==typeof e&&1===e(10)&&-1===e(-20)}}}),Lv=m({"node_modules/es5-ext/math/sign/shim.js"(e,t){t.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}}}),Pv=m({"node_modules/es5-ext/math/sign/index.js"(e,t){t.exports=Iv()()?Math.sign:Lv()}}),zv=m({"node_modules/es5-ext/number/to-integer.js"(e,t){var r=Pv(),n=Math.abs,i=Math.floor;t.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?r(e)*i(n(e)):e}}}),Dv=m({"node_modules/es5-ext/number/to-pos-integer.js"(e,t){var r=zv(),n=Math.max;t.exports=function(e){return n(0,r(e))}}}),Ov=m({"node_modules/es5-ext/array/from/shim.js"(e,t){var r=xv().iterator,n=sv(),i=Cv(),a=Dv(),o=bv(),s=jy(),l=Ry(),c=lv(),u=Array.isArray,h=Function.prototype.call,f={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;t.exports=function(e){var t,d,m,g,y,v,x,_,b,w,T=arguments[1],k=arguments[2];if(e=Object(s(e)),l(T)&&o(T),this&&this!==Array&&i(this))t=this;else{if(!T){if(n(e))return 1!==(y=e.length)?Array.apply(null,e):((g=new Array(1))[0]=e[0],g);if(u(e)){for(g=new Array(y=e.length),d=0;d<y;++d)g[d]=e[d];return g}}g=[]}if(!u(e))if(void 0!==(b=e[r])){for(x=o(b).call(e),t&&(g=new t),_=x.next(),d=0;!_.done;)w=T?h.call(T,k,_.value,d):_.value,t?(f.value=w,p(g,d,f)):g[d]=w,_=x.next(),++d;y=d}else if(c(e)){for(y=e.length,t&&(g=new t),d=0,m=0;d<y;++d)w=e[d],d+1<y&&(v=w.charCodeAt(0))>=55296&&v<=56319&&(w+=e[++d]),w=T?h.call(T,k,w,m):w,t?(f.value=w,p(g,m,f)):g[m]=w,++m;y=m}if(void 0===y)for(y=a(e.length),t&&(g=new t(y)),d=0;d<y;++d)w=T?h.call(T,k,e[d],d):e[d],t?(f.value=w,p(g,d,f)):g[d]=w;return t&&(f.value=null,g.length=y),g}}}),Rv=m({"node_modules/es5-ext/array/from/index.js"(e,t){t.exports=Ev()()?Array.from:Ov()}}),Fv=m({"node_modules/es5-ext/object/copy.js"(e,t){var r=Rv(),n=tv(),i=jy();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?r(a,(function(t){(o.ensure||t in e)&&(s[t]=e[t])})):n(s,e),s}}}),Bv=m({"node_modules/es5-ext/object/_iterate.js"(e,t){var r=bv(),n=jy(),i=Function.prototype.bind,a=Function.prototype.call,o=Object.keys,s=Object.prototype.propertyIsEnumerable;t.exports=function(e,t){return function(l,c){var u,h=arguments[2],f=arguments[3];return l=Object(n(l)),r(c),u=o(l),f&&u.sort("function"==typeof f?i.call(f,l):void 0),"function"!=typeof e&&(e=u[e]),a.call(e,u,(function(e,r){return s.call(l,e)?a.call(c,h,l[e],e,l,r):t}))}}}}),jv=m({"node_modules/es5-ext/object/for-each.js"(e,t){t.exports=Bv()("forEach")}}),Nv=m({"node_modules/es5-ext/object/map.js"(e,t){var r=bv(),n=jv(),i=Function.prototype.call;t.exports=function(e,t){var a={},o=arguments[2];return r(t),n(e,(function(e,r,n,s){a[r]=i.call(t,o,e,r,n,s)})),a}}}),Uv=m({"node_modules/d/auto-bind.js"(e,t){var r,n=Gy(),i=Mv(),a=Sv(),o=Fv(),s=rv(),l=Nv(),c=Function.prototype.bind,u=Object.defineProperty,h=Object.prototype.hasOwnProperty;r=function(e,t,r){var n,s=i(t)&&a(t.value);return delete(n=o(t)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,e)?s:(t.value=c.call(s,r.resolveContext?r.resolveContext(this):this),u(this,e,t),this[e])},n},t.exports=function(e){var t=s(arguments[1]);return n(t.resolveContext)&&a(t.resolveContext),l(e,(function(e,n){return r(n,e,t)}))}}}),Vv=m({"node_modules/es6-iterator/index.js"(e,t){var r,n=_v(),i=tv(),a=bv(),o=jy(),s=ov(),l=Uv(),c=xv(),u=Object.defineProperty,h=Object.defineProperties;t.exports=r=function(e,t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");h(this,{__list__:s("w",o(e)),__context__:s("w",t),__nextIndex__:s("w",0)}),t&&(a(t.on),t.on("_add",this._onAdd),t.on("_delete",this._onDelete),t.on("_clear",this._onClear))},delete r.prototype.constructor,h(r.prototype,i({_next:s((function(){var e;if(this.__list__){if(this.__redo__&&void 0!==(e=this.__redo__.shift()))return e;if(this.__nextIndex__<this.__list__.length)return this.__nextIndex__++;this._unBind()}})),next:s((function(){return this._createResult(this._next())})),_createResult:s((function(e){return void 0===e?{done:!0,value:void 0}:{done:!1,value:this._resolve(e)}})),_resolve:s((function(e){return this.__list__[e]})),_unBind:s((function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)})),toString:s((function(){return"[object "+(this[c.toStringTag]||"Object")+"]"}))},l({_onAdd:s((function(e){if(!(e>=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void u(this,"__redo__",s("c",[e]));this.__redo__.forEach((function(t,r){t>=e&&(this.__redo__[r]=++t)}),this),this.__redo__.push(e)}})),_onDelete:s((function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(e))&&this.__redo__.splice(t,1),this.__redo__.forEach((function(t,r){t>e&&(this.__redo__[r]=--t)}),this)))})),_onClear:s((function(){this.__redo__&&n.call(this.__redo__),this.__nextIndex__=0}))}))),u(r.prototype,c.iterator,s((function(){return this})))}}),qv=m({"node_modules/es6-iterator/array.js"(e,t){var r,n=Vy(),i=av(),a=ov(),o=xv(),s=Vv(),l=Object.defineProperty;r=t.exports=function(e,t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");s.call(this,e),t=t?i.call(t,"key+value")?"key+value":i.call(t,"key")?"key":"value":"value",l(this,"__kind__",a("",t))},n&&n(r,s),delete r.prototype.constructor,r.prototype=Object.create(s.prototype,{_resolve:a((function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e}))}),l(r.prototype,o.toStringTag,a("c","Array Iterator"))}}),Hv=m({"node_modules/es6-iterator/string.js"(e,t){var r,n=Vy(),i=ov(),a=xv(),o=Vv(),s=Object.defineProperty;r=t.exports=function(e){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e=String(e),o.call(this,e),s(this,"__length__",i("",e.length))},n&&n(r,o),delete r.prototype.constructor,r.prototype=Object.create(o.prototype,{_next:i((function(){if(this.__list__){if(this.__nextIndex__<this.__length__)return this.__nextIndex__++;this._unBind()}})),_resolve:i((function(e){var t,r=this.__list__[e];return this.__nextIndex__===this.__length__?r:(t=r.charCodeAt(0))>=55296&&t<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),s(r.prototype,a.toStringTag,i("c","String Iterator"))}}),Gv=m({"node_modules/es6-iterator/is-iterable.js"(e,t){var r=sv(),n=Ry(),i=lv(),a=xv().iterator,o=Array.isArray;t.exports=function(e){return!(!n(e)||!(o(e)||i(e)||r(e))&&"function"!=typeof e[a])}}}),Wv=m({"node_modules/es6-iterator/valid-iterable.js"(e,t){var r=Gv();t.exports=function(e){if(!r(e))throw new TypeError(e+" is not iterable");return e}}}),Zv=m({"node_modules/es6-iterator/get.js"(e,t){var r=sv(),n=lv(),i=qv(),a=Hv(),o=Wv(),s=xv().iterator;t.exports=function(e){return"function"==typeof o(e)[s]?e[s]():r(e)?new i(e):n(e)?new a(e):new i(e)}}}),Yv=m({"node_modules/es6-iterator/for-of.js"(e,t){var r=sv(),n=bv(),i=lv(),a=Zv(),o=Array.isArray,s=Function.prototype.call,l=Array.prototype.some;t.exports=function(e,t){var c,u,h,f,p,d,m,g,y=arguments[2];if(o(e)||r(e)?c="array":i(e)?c="string":e=a(e),n(t),h=function(){f=!0},"array"!==c)if("string"!==c)for(u=e.next();!u.done;){if(s.call(t,y,u.value,h),f)return;u=e.next()}else for(d=e.length,p=0;p<d&&(m=e[p],p+1<d&&(g=m.charCodeAt(0))>=55296&&g<=56319&&(m+=e[++p]),s.call(t,y,m,h),!f);++p);else l.call(e,(function(e){return s.call(t,y,e,h),f}))}}}),Xv=m({"node_modules/es6-weak-map/is-native-implemented.js"(e,t){t.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)}}),$v=m({"node_modules/es6-weak-map/polyfill.js"(e,t){var r,n=Ry(),i=Vy(),a=qy(),o=jy(),s=Hy(),l=ov(),c=Zv(),u=Yv(),h=xv().toStringTag,f=Xv(),p=Array.isArray,d=Object.defineProperty,m=Object.prototype.hasOwnProperty,g=Object.getPrototypeOf;t.exports=r=function(){var e,t=arguments[0];if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");return e=f&&i&&WeakMap!==r?i(new WeakMap,g(this)):this,n(t)&&(p(t)||(t=c(t))),d(e,"__weakMapData__",l("c","$weakMap$"+s())),t&&u(t,(function(t){o(t),e.set(t[0],t[1])})),e},f&&(i&&i(r,WeakMap),r.prototype=Object.create(WeakMap.prototype,{constructor:l(r)})),Object.defineProperties(r.prototype,{delete:l((function(e){return!!m.call(a(e),this.__weakMapData__)&&(delete e[this.__weakMapData__],!0)})),get:l((function(e){if(m.call(a(e),this.__weakMapData__))return e[this.__weakMapData__]})),has:l((function(e){return m.call(a(e),this.__weakMapData__)})),set:l((function(e,t){return d(a(e),this.__weakMapData__,l("c",t)),this})),toString:l((function(){return"[object WeakMap]"}))}),d(r.prototype,h,l("c","WeakMap"))}}),Kv=m({"node_modules/es6-weak-map/index.js"(e,t){t.exports=Dy()()?WeakMap:$v()}}),Jv=m({"node_modules/array-find-index/index.js"(e,t){t.exports=function(e,t,r){if("function"==typeof Array.prototype.findIndex)return e.findIndex(t,r);if("function"!=typeof t)throw new TypeError("predicate must be a function");var n=Object(e),i=n.length;if(0===i)return-1;for(var a=0;a<i;a++)if(t.call(r,n[a],a,n))return a;return-1}}}),Qv=m({"node_modules/regl-line2d/index.js"(e,t){var r=em(),n=ny(),i=My(),a=ty(),o=ay(),s=Py(),l=zy(),{float32:c,fract32:u}=Iy(),h=Kv(),f=ry(),p=Jv();function d(e,t){if(!(this instanceof d))return new d(e,t);if("function"==typeof e?(t||(t={}),t.regl=e):t=e,t.length&&(t.positions=t),!(e=t.regl).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=d.shaders.has(e)?d.shaders.get(e):d.shaders.set(e,d.createShaders(e)).get(e),this.update(t)}t.exports=d,d.dashMult=2,d.maxPatternLength=256,d.precisionThreshold=3e6,d.maxPoints=1e4,d.maxLines=2048,d.shaders=new h,d.createShaders=function(e){let t,r=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)=>"round"===t.join?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")},a=e(i({vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n}\n\nvoid main() {\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scale * viewport.zw);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,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));try{t=e(i({cull:{enable:!0,face:"back"},vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\nuniform float miterLimit, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIFF = 1e-6;\n\n// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n// TODO: precalculate dot products, normalize things beforehead etc.\n// TODO: refactor to rectangular algorithm\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nbool isNaN( float val ){\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\n vec2 adjustedScale;\n adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;\n adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;\n\n vec2 scaleRatio = adjustedScale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t// collapsed/unidirectional segment cases\n\t// FIXME: there should be more elegant solution\n\tvec2 prevTanDiff = abs(prevTangent - currTangent);\n\tvec2 nextTanDiff = abs(nextTangent - currTangent);\n\tif (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,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{t=a}return{fill:e({primitive:"triangle",elements:(e,t)=>t.triangles,offset:0,vert:"\nprecision highp float;\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n",frag:"\nprecision highp float;\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n",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:a,miter:t}},d.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},d.prototype.render=function(...e){e.length&&this.update(...e),this.draw()},d.prototype.draw=function(...e){return(e.length?e:this.passes).forEach(((e,t)=>{if(e&&Array.isArray(e))return this.draw(...e);"number"==typeof e&&(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>d.precisionThreshold||e.scale[1]*e.viewport.height>d.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=d.maxPoints)?this.shaders.rect(e):this.shaders.miter(e)))})),this},d.prototype.update=function(e){if(!e)return;null!=e.length?"number"==typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);let{regl:t,gl:h}=this;if(e.forEach(((e,m)=>{let g=this.passes[m];if(void 0!==e){if(null===e)return void(this.passes[m]=null);if("number"==typeof e[0]&&(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"}),g||(this.passes[m]=g={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({},d.defaults,e)),null!=e.thickness&&(g.thickness=parseFloat(e.thickness)),null!=e.opacity&&(g.opacity=parseFloat(e.opacity)),null!=e.miterLimit&&(g.miterLimit=parseFloat(e.miterLimit)),null!=e.overlay&&(g.overlay=!!e.overlay,m<d.maxLines&&(g.depth=2*(d.maxLines-1-m%d.maxLines)/d.maxLines-1)),null!=e.join&&(g.join=e.join),null!=e.hole&&(g.hole=e.hole),null!=e.fill&&(g.fill=e.fill?r(e.fill,"uint8"):null),null!=e.viewport&&(g.viewport=f(e.viewport)),g.viewport||(g.viewport=f([h.drawingBufferWidth,h.drawingBufferHeight])),null!=e.close&&(g.close=e.close),null===e.positions&&(e.positions=[]),e.positions){let t,r;if(e.positions.x&&e.positions.y){let n=e.positions.x,i=e.positions.y;r=g.count=Math.max(n.length,i.length),t=new Float64Array(2*r);for(let e=0;e<r;e++)t[2*e]=n[e],t[2*e+1]=i[e]}else t=o(e.positions,"float64"),r=g.count=Math.floor(t.length/2);let i=g.bounds=n(t,2);if(g.fill){let r=[],n={},i=0;for(let e=0,a=0,o=g.count;e<o;e++){let o=t[2*e],s=t[2*e+1];isNaN(o)||isNaN(s)||null==o||null==s?(o=t[2*i],s=t[2*i+1],n[e]=i):i=e,r[a++]=o,r[a++]=s}if(e.splitNull){g.count-1 in n||(n[g.count]=g.count-1);let e=Object.keys(n).map(Number).sort(((e,t)=>e-t)),t=[],i=0,a=null!=g.hole?g.hole[0]:null;if(null!=a){let t=p(e,(e=>e>=a));e=e.slice(0,t),e.push(a)}for(let n=0;n<e.length;n++){let o=r.slice(2*i,2*e[n]).concat(a?r.slice(2*a):[]),l=(g.hole||[]).map((t=>t-a+(e[n]-i))),c=s(o,l);c=c.map((t=>t+i+(t+i<e[n]?0:a-e[n]))),t.push(...c),i=e[n]+1}for(let e=0,r=t.length;e<r;e++)null!=n[t[e]]&&(t[e]=n[t[e]]);g.triangles=t}else{let e=s(r,g.hole||[]);for(let t=0,r=e.length;t<r;t++)null!=n[e[t]]&&(e[t]=n[e[t]]);g.triangles=e}}let a=new Float64Array(t);l(a,2,i);let h=new Float64Array(2*r+6);g.close?t[0]===t[2*r-2]&&t[1]===t[2*r-1]?(h[0]=a[2*r-4],h[1]=a[2*r-3]):(h[0]=a[2*r-2],h[1]=a[2*r-1]):(h[0]=a[0],h[1]=a[1]),h.set(a,2),g.close?t[0]===t[2*r-2]&&t[1]===t[2*r-1]?(h[2*r+2]=a[2],h[2*r+3]=a[3],g.count-=1):(h[2*r+2]=a[0],h[2*r+3]=a[1],h[2*r+4]=a[2],h[2*r+5]=a[3]):(h[2*r+2]=a[2*r-2],h[2*r+3]=a[2*r-1],h[2*r+4]=a[2*r-2],h[2*r+5]=a[2*r-1]);var y=c(h);g.positionBuffer(y);var v=u(h,y);g.positionFractBuffer(v)}if(e.range?g.range=e.range:g.range||(g.range=g.bounds),(e.range||e.positions)&&g.count){let e=g.bounds,t=e[2]-e[0],r=e[3]-e[1],n=g.range[2]-g.range[0],i=g.range[3]-g.range[1];g.scale=[t/n,r/i],g.translate=[-g.range[0]/n+e[0]/n||0,-g.range[1]/i+e[1]/i||0],g.scaleFract=u(g.scale),g.translateFract=u(g.translate)}if(e.dashes){let t,r=0;if(!e.dashes||e.dashes.length<2)r=1,t=new Uint8Array([255,255,255,255,255,255,255,255]);else{r=0;for(let t=0;t<e.dashes.length;++t)r+=e.dashes[t];t=new Uint8Array(r*d.dashMult);let n=0,i=255;for(let r=0;r<2;r++)for(let r=0;r<e.dashes.length;++r){for(let a=0,o=e.dashes[r]*d.dashMult*.5;a<o;++a)t[n++]=i;i^=255}}g.dashLength=r,g.dashTexture({channels:1,data:t,width:t.length,height:1,mag:"linear",min:"linear"},0,0)}if(e.color){let t=g.count,n=e.color;n||(n="transparent");let i=new Uint8Array(4*t+4);if(Array.isArray(n)&&"number"!=typeof n[0]){for(let e=0;e<t;e++){let t=r(n[e],"uint8");i.set(t,4*e)}i.set(r(n[0],"uint8"),4*t)}else{let e=r(n,"uint8");for(let r=0;r<t+1;r++)i.set(e,4*r)}g.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++)null!==this.passes[e]&&m.push(this.passes[e]);return this.passes=m,this},d.prototype.destroy=function(){return this.passes.forEach((e=>{e.colorBuffer.destroy(),e.positionBuffer.destroy(),e.dashTexture.destroy()})),this.passes.length=0,this}}}),ex=m({"node_modules/regl-error2d/index.js"(e,t){var r=ny(),n=em(),i=Ey(),a=ty(),o=My(),s=ay(),{float32:l,fract32:c}=Iy();t.exports=function(e,t){if("function"==typeof e?(t||(t={}),t.regl=e):t=e,t.length&&(t.positions=t),!(e=t.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let h,f,p,d,m,g,y=e._gl,v={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return d=e.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),f=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=e.buffer({usage:"static",type:"float",data:u}),T(t),h=e({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",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:d,offset:(e,t)=>4*t.offset,divisor:1},position:{buffer:f,offset:(e,t)=>8*t.offset,divisor:1},positionFract:{buffer:p,offset:(e,t)=>8*t.offset,divisor:1},error:{buffer:m,offset:(e,t)=>16*t.offset,divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,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(_,{update:T,draw:b,destroy:k,regl:e,gl:y,canvas:y.canvas,groups:x}),_;function _(e){e?T(e):null===e&&k(),b()}function b(t){if("number"==typeof t)return w(t);t&&!Array.isArray(t)&&(t=[t]),e._refresh(),x.forEach(((e,r)=>{if(e){if(t&&(t[r]?e.draw=!0:e.draw=!1),!e.draw)return void(e.draw=!0);w(r)}}))}function w(e){"number"==typeof e&&(e=x[e]),null!=e&&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],h(e),e.after&&e.after(e))}function T(e){if(!e)return;null!=e.length?"number"==typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);let t=0,u=0;if(_.groups=x=e.map(((e,l)=>{let h=x[l];return e?("function"==typeof e?e={after:e}:"number"==typeof e[0]&&(e={positions:e}),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"}),h||(x[l]=h={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},e=o({},v,e)),i(h,e,[{lineWidth:e=>.5*+e,capSize:e=>.5*+e,opacity:parseFloat,errors:e=>(e=s(e),u+=e.length,e),positions:(e,n)=>(e=s(e,"float64"),n.count=Math.floor(e.length/2),n.bounds=r(e,2),n.offset=t,t+=n.count,e)},{color:(e,t)=>{let r=t.count;if(e||(e="transparent"),!Array.isArray(e)||"number"==typeof e[0]){let t=e;e=Array(r);for(let n=0;n<r;n++)e[n]=t}if(e.length<r)throw Error("Not enough colors");let i=new Uint8Array(4*r);for(let t=0;t<r;t++){let r=n(e[t],"uint8");i.set(r,4*t)}return i},range:(e,t,r)=>{let n=t.bounds;return e||(e=n),t.scale=[1/(e[2]-e[0]),1/(e[3]-e[1])],t.translate=[-e[0],-e[1]],t.scaleFract=c(t.scale),t.translateFract=c(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:y.drawingBufferWidth,height:y.drawingBufferHeight},t}}]),h):h})),t||u){let e=x.reduce(((e,t,r)=>e+(t?t.count:0)),0),t=new Float64Array(2*e),r=new Uint8Array(4*e),n=new Float32Array(4*e);x.forEach(((e,i)=>{if(!e)return;let{positions:a,count:o,offset:s,color:l,errors:c}=e;o&&(r.set(l,4*s),n.set(c,4*s),t.set(a,2*s))}));var h=l(t);f(h);var g=c(t,h);p(g),d(r),m(n)}}function k(){f.destroy(),p.destroy(),d.destroy(),m.destroy(),g.destroy()}};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]]}}),tx=m({"node_modules/unquote/index.js"(e,t){var r=/[\'\"]/;t.exports=function(e){return e?(r.test(e.charAt(0))&&(e=e.substr(1)),r.test(e.charAt(e.length-1))&&(e=e.substr(0,e.length-1)),e):""}}}),rx=m({"node_modules/css-global-keywords/index.json"(e,t){t.exports=["inherit","initial","unset"]}}),nx=m({"node_modules/css-system-font-keywords/index.json"(e,t){t.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),ix=m({"node_modules/css-font-weight-keywords/index.json"(e,t){t.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}}),ax=m({"node_modules/css-font-style-keywords/index.json"(e,t){t.exports=["normal","italic","oblique"]}}),ox=m({"node_modules/css-font-stretch-keywords/index.json"(e,t){t.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}}),sx=m({"node_modules/parenthesis/index.js"(e,t){function r(e,t){if("string"!=typeof e)return[e];var r=[e];"string"==typeof t||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],i=t.escape||"___",a=!!t.flat;n.forEach((function(e){var t=new RegExp(["\\",e[0],"[^\\",e[0],"\\",e[1],"]*\\",e[1]].join("")),n=[];function a(t,a,o){var s=r.push(t.slice(e[0].length,-e[1].length))-1;return n.push(s),i+s+i}r.forEach((function(e,n){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.");r[n]=e})),n=n.reverse(),r=r.map((function(t){return n.forEach((function(r){t=t.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),e[0]+"$1"+e[1])})),t}))}));var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function e(t,r,n){for(var i,a=[],s=0;i=o.exec(t);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(t.slice(0,i.index)),a.push(e(r[i[1]],r)),t=t.slice(i.index+i[0].length)}return a.push(t),a}(r[0],r)}function n(e,t){if(t&&t.flat){var r,n=t&&t.escape||"___",i=e[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+e);r=i,i=i.replace(a,s)}return i}return e.reduce((function e(t,r){return Array.isArray(r)&&(r=r.reduce(e,"")),t+r}),"");function s(t,r){if(null==e[r])throw Error("Reference "+r+"is undefined");return e[r]}}function i(e,t){return Array.isArray(e)?n(e,t):r(e,t)}i.parse=r,i.stringify=n,t.exports=i}}),lx=m({"node_modules/string-split-by/index.js"(e,t){var r=sx();t.exports=function(e,t,n){if(null==e)throw Error("First argument should be a string");if(null==t)throw Error("Separator should be a string or a RegExp");n?("string"==typeof n||Array.isArray(n))&&(n={ignore:n}):n={},null==n.escape&&(n.escape=!0),null==n.ignore?n.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:("string"==typeof n.ignore&&(n.ignore=[n.ignore]),n.ignore=n.ignore.map((function(e){return 1===e.length&&(e+=e),e})));var i=r.parse(e,{flat:!0,brackets:n.ignore}),a=i[0].split(t);if(n.escape){for(var o=[],s=0;s<a.length;s++){var l=a[s],c=a[s+1];"\\"===l[l.length-1]&&"\\"!==l[l.length-2]?(o.push(l+t+c),s++):o.push(l)}a=o}for(s=0;s<a.length;s++)i[0]=a[s],a[s]=r.stringify(i,{flat:!0});return a}}}),cx=m({"node_modules/css-font-size-keywords/index.json"(e,t){t.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]}}),ux=m({"node_modules/css-font/lib/util.js"(e,t){var r=cx();t.exports={isSize:function(e){return/^[\d\.]/.test(e)||-1!==e.indexOf("/")||-1!==r.indexOf(e)}}}}),hx=m({"node_modules/css-font/parse.js"(e,t){var r=tx(),n=rx(),i=nx(),a=ix(),o=ax(),s=ox(),l=lx(),c=ux().isSize;t.exports=h;var u=h.cache={};function h(e){if("string"!=typeof e)throw new Error("Font argument must be a string.");if(u[e])return u[e];if(""===e)throw new Error("Cannot parse an empty string.");if(-1!==i.indexOf(e))return u[e]={system:e};for(var t,h={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},p=l(e,/\s+/);t=p.shift();){if(-1!==n.indexOf(t))return["style","variant","weight","stretch"].forEach((function(e){h[e]=t})),u[e]=h;if(-1===o.indexOf(t))if("normal"!==t&&"small-caps"!==t)if(-1===s.indexOf(t)){if(-1===a.indexOf(t)){if(c(t)){var d=l(t,"/");if(h.size=d[0],null!=d[1]?h.lineHeight=f(d[1]):"/"===p[0]&&(p.shift(),h.lineHeight=f(p.shift())),!p.length)throw new Error("Missing required font-family.");return h.family=l(p.join(" "),/\s*,\s*/).map(r),u[e]=h}throw new Error("Unknown or unsupported font token: "+t)}h.weight=t}else h.stretch=t;else h.variant=t;else h.style=t}throw new Error("Missing required font-size.")}function f(e){var t=parseFloat(e);return t.toString()===e?t:e}}}),fx=m({"node_modules/css-font/stringify.js"(e,t){var r=ty(),n=ux().isSize,i=p(rx()),a=p(nx()),o=p(ix()),s=p(ax()),l=p(ox()),c={normal:1,"small-caps":1},u={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},h="serif";function f(e,t){if(e&&!t[e]&&!i[e])throw Error("Unknown keyword `"+e+"`");return e}function p(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=1;return t}t.exports=function(e){if((e=r(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"})).system)return e.system&&f(e.system,a),e.system;if(f(e.style,s),f(e.variant,c),f(e.weight,o),f(e.stretch,l),null==e.size&&(e.size="1rem"),"number"==typeof e.size&&(e.size+="px"),!n)throw Error("Bad size value `"+e.size+"`");e.family||(e.family=h),Array.isArray(e.family)&&(e.family.length||(e.family=[h]),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+(null==e.lineHeight||"normal"===e.lineHeight||e.lineHeight+""=="1"?"":"/"+e.lineHeight)),t.push(e.family),t.filter(Boolean).join(" ")}}}),px=m({"node_modules/css-font/index.js"(e,t){t.exports={parse:hx(),stringify:fx()}}}),dx=m({"node_modules/regl/dist/regl.unchecked.js"(e,t){var r,n;r=e,n=function(){var e=function(e,t){for(var r=Object.keys(t),n=0;n<r.length;++n)e[r[n]]=t[r[n]];return e},t=0;function r(e,r){this.id=t++,this.type=e,this.data=r}function n(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function i(e){if(0===e.length)return[];var t=e.charAt(0),r=e.charAt(e.length-1);if(e.length>1&&t===r&&('"'===t||"'"===t))return['"'+n(e.substr(1,e.length-2))+'"'];var a=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(a)return i(e.substr(0,a.index)).concat(i(a[1])).concat(i(e.substr(a.index+a[0].length)));var o=e.split(".");if(1===o.length)return['"'+n(e)+'"'];for(var s=[],l=0;l<o.length;++l)s=s.concat(i(o[l]));return s}function a(e){return"["+i(e).join("][")+"]"}var o={DynamicVariable:r,define:function(e,t){return new r(e,a(t+""))},isDynamic:function(e){return"function"==typeof e&&!e._reglType||e instanceof r},unbox:function e(t,n){return"function"==typeof t?new r(0,t):"number"==typeof t||"boolean"==typeof t?new r(5,t):Array.isArray(t)?new r(6,t.map((function(t,r){return e(t,n+"["+r+"]")}))):t instanceof r?t:void 0},accessor:a},s={next:"function"==typeof requestAnimationFrame?function(e){return requestAnimationFrame(e)}:function(e){return setTimeout(e,16)},cancel:"function"==typeof cancelAnimationFrame?function(e){return cancelAnimationFrame(e)}:clearTimeout},l=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function c(e){return"string"==typeof e?e.split():e}function u(e){return"string"==typeof e?document.querySelector(e):e}function h(e,t){for(var r=Array(e),n=0;n<e;++n)r[n]=t(n);return r}function f(e){var t,r;return t=(e>65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1}function p(){var e=h(8,(function(){return[]}));function t(t){var r=function(e){for(var t=16;t<=1<<28;t*=16)if(e<=t)return t;return 0}(t),n=e[f(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(t){e[f(t.byteLength)>>2].push(t)}return{alloc:t,free:r,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(e){r(e.buffer)}}}var d=p();d.zero=p();var m=3553,g=6408,y=5126,v=36160,x=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 _(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||x(e.data))}var b=function(e){return Object.keys(e).map((function(t){return e[t]}))},w=function(e){for(var t=[],r=e;r.length;r=r[0])t.push(r.length);return t},T=function(e,t,r,n){var i=1;if(t.length)for(var a=0;a<t.length;++a)i*=t[a];else i=0;var o=n||d.allocType(r,i);switch(t.length){case 0:break;case 1:!function(e,t,r){for(var n=0;n<t;++n)r[n]=e[n]}(e,t[0],o);break;case 2:!function(e,t,r,n){for(var i=0,a=0;a<t;++a)for(var o=e[a],s=0;s<r;++s)n[i++]=o[s]}(e,t[0],t[1],o);break;case 3:k(e,t[0],t[1],t[2],o,0);break;default:A(e,t,0,o,0)}return o};function k(e,t,r,n,i,a){for(var o=a,s=0;s<t;++s)for(var l=e[s],c=0;c<r;++c)for(var u=l[c],h=0;h<n;++h)i[o++]=u[h]}function A(e,t,r,n,i){for(var a=1,o=r+1;o<t.length;++o)a*=t[o];var s=t[r];if(t.length-r==4){var l=t[r+1],c=t[r+2],u=t[r+3];for(o=0;o<s;++o)k(e[o],l,c,u,n,i),i+=a}else for(o=0;o<s;++o)A(e[o],t,r+1,n,i),i+=a}var M={"[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},S={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},E={dynamic:35048,stream:35040,static:35044},C=T,I=w,L=5121,P=5126,z=[];function D(e){return 0|M[Object.prototype.toString.call(e)]}function O(e,t){for(var r=0;r<t.length;++r)e[r]=t[r]}function R(e,t,r,n,i,a,o){for(var s=0,l=0;l<r;++l)for(var c=0;c<n;++c)e[s++]=t[i*l+a*c+o]}z[5120]=1,z[5122]=2,z[5124]=4,z[5121]=1,z[5123]=2,z[5125]=4,z[5126]=4;var F={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},B=5121,j=5123,N=5125,U=34963,V=new Float32Array(1),q=new Uint32Array(V.buffer);function H(e){for(var t=d.allocType(5123,e.length),r=0;r<e.length;++r)if(isNaN(e[r]))t[r]=65535;else if(e[r]===1/0)t[r]=31744;else if(e[r]===-1/0)t[r]=64512;else{V[0]=e[r];var n=q[0],i=n>>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)t[r]=i;else if(a<-14){var s=-14-a;t[r]=i+(o+1024>>s)}else t[r]=a>15?i+31744:i+(a+15<<10)+o}return t}function G(e){return Array.isArray(e)||x(e)}var W=3553,Z=34067,Y=34069,X=6408,$=6406,K=6407,J=6409,Q=6410,ee=32855,te=6402,re=34041,ne=35904,ie=35906,ae=36193,oe=33776,se=33777,le=33778,ce=5121,ue=5123,he=5125,fe=5126,pe=33071,de=9728,me=9984,ge=9987,ye=4352,ve=33984,xe=[me,9986,9985,ge],_e=[0,J,Q,K,X],be={};function we(e){return"[object "+e+"]"}be[J]=be[$]=be[te]=1,be[re]=be[Q]=2,be[K]=be[ne]=3,be[X]=be[ie]=4;var Te=we("HTMLCanvasElement"),ke=we("OffscreenCanvas"),Ae=we("CanvasRenderingContext2D"),Me=we("ImageBitmap"),Se=we("HTMLImageElement"),Ee=we("HTMLVideoElement"),Ce=Object.keys(M).concat([Te,ke,Ae,Me,Se,Ee]),Ie=[];Ie[ce]=1,Ie[fe]=4,Ie[ae]=2,Ie[ue]=2,Ie[he]=4;var Le=[];function Pe(e){return Array.isArray(e)&&(0===e.length||"number"==typeof e[0])}function ze(e){return!!Array.isArray(e)&&!(0===e.length||!G(e[0]))}function De(e){return Object.prototype.toString.call(e)}function Oe(e){return De(e)===Te}function Re(e){return De(e)===ke}function Fe(e){if(!e)return!1;var t=De(e);return Ce.indexOf(t)>=0||Pe(e)||ze(e)||_(e)}function Be(e){return 0|M[Object.prototype.toString.call(e)]}function je(e,t){return d.allocType(e.type===ae?fe:e.type,t)}function Ne(e,t){e.type===ae?(e.data=H(t),d.freeType(t)):e.data=t}function Ue(e,t,r,n,i,a){var o;if(o=typeof Le[e]<"u"?Le[e]:be[e]*Ie[t],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}Le[32854]=2,Le[ee]=2,Le[36194]=2,Le[re]=4,Le[oe]=.5,Le[se]=.5,Le[le]=1,Le[33779]=1,Le[35986]=.5,Le[35987]=1,Le[34798]=1,Le[35840]=.5,Le[35841]=.25,Le[35842]=.5,Le[35843]=.25,Le[36196]=.5;var Ve=36161,qe=32854,He=[];function Ge(e,t,r){return He[e]*t*r}He[qe]=2,He[32855]=2,He[36194]=2,He[33189]=2,He[36168]=1,He[34041]=4,He[35907]=4,He[34836]=16,He[34842]=8,He[34843]=6;var We=36160,Ze=36161,Ye=3553,Xe=[];Xe[6408]=4,Xe[6407]=3;var $e=[];$e[5121]=1,$e[5126]=4,$e[36193]=2;var Ke=34963;function Je(){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=5126,this.offset=0,this.stride=0,this.divisor=0}function Qe(e){return function(e){for(var t,r="0123456789abcdef",n="",i=0;i<e.length;i++)t=e.charCodeAt(i),n+=r.charAt(t>>>4&15)+r.charAt(15&t);return n}(function(e){return function(e){for(var t="",r=0;r<32*e.length;r+=8)t+=String.fromCharCode(e[r>>5]>>>24-r%32&255);return t}(function(e,t){var r,n,i,a,o,s,l,c,u,h,f,p,d=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),m=new Array(64);for(e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t,u=0;u<e.length;u+=16){for(r=d[0],n=d[1],i=d[2],a=d[3],o=d[4],s=d[5],l=d[6],c=d[7],h=0;h<64;h++)m[h]=h<16?e[h+u]:ct(ct(ct(st(m[h-2]),m[h-7]),ot(m[h-15])),m[h-16]),f=ct(ct(ct(ct(c,at(o)),rt(o,s,l)),lt[h]),m[h]),p=ct(it(r),nt(r,n,i)),c=l,l=s,s=o,o=ct(a,f),a=i,i=n,n=r,r=ct(f,p);d[0]=ct(r,d[0]),d[1]=ct(n,d[1]),d[2]=ct(i,d[2]),d[3]=ct(a,d[3]),d[4]=ct(o,d[4]),d[5]=ct(s,d[5]),d[6]=ct(l,d[6]),d[7]=ct(c,d[7])}return d}(function(e){for(var t=Array(e.length>>2),r=0;r<t.length;r++)t[r]=0;for(r=0;r<8*e.length;r+=8)t[r>>5]|=(255&e.charCodeAt(r/8))<<24-r%32;return t}(e),8*e.length))}(function(e){for(var t,r,n="",i=-1;++i<e.length;)t=e.charCodeAt(i),r=i+1<e.length?e.charCodeAt(i+1):0,55296<=t&&t<=56319&&56320<=r&&r<=57343&&(t=65536+((1023&t)<<10)+(1023&r),i++),t<=127?n+=String.fromCharCode(t):t<=2047?n+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?n+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(n+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return n}(e)))}function et(e,t){return e>>>t|e<<32-t}function tt(e,t){return e>>>t}function rt(e,t,r){return e&t^~e&r}function nt(e,t,r){return e&t^e&r^t&r}function it(e){return et(e,2)^et(e,13)^et(e,22)}function at(e){return et(e,6)^et(e,11)^et(e,25)}function ot(e){return et(e,7)^et(e,18)^tt(e,3)}function st(e){return et(e,17)^et(e,19)^tt(e,10)}var lt=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function ct(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function ut(e){return Array.prototype.slice.call(e)}function ht(e){return ut(e).join("")}var ft="xyzw".split(""),pt="dither",dt="blend.enable",mt="blend.color",gt="blend.equation",yt="blend.func",vt="depth.enable",xt="depth.func",_t="depth.range",bt="depth.mask",wt="colorMask",Tt="cull.enable",kt="cull.face",At="frontFace",Mt="lineWidth",St="polygonOffset.enable",Et="polygonOffset.offset",Ct="sample.alpha",It="sample.enable",Lt="sample.coverage",Pt="stencil.enable",zt="stencil.mask",Dt="stencil.func",Ot="stencil.opFront",Rt="stencil.opBack",Ft="scissor.enable",Bt="scissor.box",jt="viewport",Nt="profile",Ut="framebuffer",Vt="vert",qt="frag",Ht="elements",Gt="primitive",Wt="count",Zt="offset",Yt="instances",Xt="vao",$t="Width",Kt="Height",Jt=Ut+$t,Qt=Ut+Kt,er=jt+$t,tr=jt+Kt,rr="drawingBuffer",nr=rr+$t,ir=rr+Kt,ar=[yt,gt,Dt,Ot,Rt,Lt,jt,Bt,Et],or=34962,sr=34963,lr=35664,cr=35665,ur=35666,hr=35667,fr=35668,pr=35669,dr=35671,mr=35672,gr=35673,yr=35674,vr=35675,xr=35676,_r=35678,br=35680,wr=1028,Tr=1029,kr=2305,Ar=7680,Mr={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},Sr={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},Er={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Cr={cw:2304,ccw:kr};function Ir(e){return Array.isArray(e)||x(e)||_(e)}function Lr(e){return e.sort((function(e,t){return e===jt?-1:t===jt?1:e<t?-1:1}))}function Pr(e,t,r,n){this.thisDep=e,this.contextDep=t,this.propDep=r,this.append=n}function zr(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function Dr(e){return new Pr(!1,!1,!1,e)}function Or(e,t){var r=e.type;if(0===r){var n=e.data.length;return new Pr(!0,n>=1,n>=2,t)}if(4===r){var i=e.data;return new Pr(i.thisDep,i.contextDep,i.propDep,t)}if(5===r)return new Pr(!1,!1,!1,t);if(6===r){for(var a=!1,o=!1,s=!1,l=0;l<e.data.length;++l){var c=e.data[l];if(1===c.type)s=!0;else if(2===c.type)o=!0;else if(3===c.type)a=!0;else if(0===c.type){a=!0;var u=c.data;u>=1&&(o=!0),u>=2&&(s=!0)}else 4===c.type&&(a=a||c.data.thisDep,o=o||c.data.contextDep,s=s||c.data.propDep)}return new Pr(a,o,s,t)}return new Pr(3===r,2===r,1===r,t)}var Rr=new Pr(!1,!1,!1,(function(){}));function Fr(t,r,n,i,a,s,l,c,u,f,p,d,m,g,y,v){var x=f.Record,_={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(_.min=32775,_.max=32776);var b=n.angle_instanced_arrays,w=n.webgl_draw_buffers,T=n.oes_vertex_array_object,k={dirty:!0,profile:v.profile},A={},M=[],E={},C={};function I(e){return e.replace(".","_")}function L(e,t,r){var n=I(e);M.push(e),A[n]=k[n]=!!r,E[n]=t}function P(e,t,r){var n=I(e);M.push(e),Array.isArray(r)?(k[n]=r.slice(),A[n]=r.slice()):k[n]=A[n]=r,C[n]=t}function z(e){return!!isNaN(e)}L(pt,3024),L(dt,3042),P(mt,"blendColor",[0,0,0,0]),P(gt,"blendEquationSeparate",[32774,32774]),P(yt,"blendFuncSeparate",[1,0,1,0]),L(vt,2929,!0),P(xt,"depthFunc",513),P(_t,"depthRange",[0,1]),P(bt,"depthMask",!0),P(wt,wt,[!0,!0,!0,!0]),L(Tt,2884),P(kt,"cullFace",Tr),P(At,At,kr),P(Mt,Mt,1),L(St,32823),P(Et,"polygonOffset",[0,0]),L(Ct,32926),L(It,32928),P(Lt,"sampleCoverage",[1,!1]),L(Pt,2960),P(zt,"stencilMask",-1),P(Dt,"stencilFunc",[519,0,-1]),P(Ot,"stencilOpSeparate",[wr,Ar,Ar,Ar]),P(Rt,"stencilOpSeparate",[Tr,Ar,Ar,Ar]),L(Ft,3089),P(Bt,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),P(jt,jt,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var D={gl:t,context:m,strings:r,next:A,current:k,draw:d,elements:s,buffer:a,shader:p,attributes:f.state,vao:f,uniforms:u,framebuffer:c,extensions:n,timer:g,isBufferArgs:Ir},O={primTypes:F,compareFuncs:Sr,blendFuncs:Mr,blendEquations:_,stencilOps:Er,glTypes:S,orientationType:Cr};w&&(O.backBuffer=[Tr],O.drawBuffer=h(i.maxDrawbuffers,(function(e){return 0===e?[0]:h(e,(function(e){return 36064+e}))})));var R=0;function B(){var t=function(t){var r=t&&t.cache,n=0,i=[],a=[],o=[];function s(){var t=[],r=[];return e((function(){t.push.apply(t,ut(arguments))}),{def:function(){var e="v"+n++;return r.push(e),arguments.length>0&&(t.push(e,"="),t.push.apply(t,ut(arguments)),t.push(";")),e},toString:function(){return ht([r.length>0?"var "+r.join(",")+";":"",ht(t)])}})}function l(){var t=s(),r=s(),n=t.toString,i=r.toString;function a(e,n){r(e,n,"=",t.def(e,n),";")}return e((function(){t.apply(t,ut(arguments))}),{def:t.def,entry:t,exit:r,save:a,set:function(e,r,n){a(e,r),t(e,r,"=",n,";")},toString:function(){return n()+i()}})}var c=s(),u={};return{global:c,link:function(e,t){var r=t&&t.stable;if(!r)for(var s=0;s<a.length;++s)if(a[s]===e&&!o[s])return i[s];var l="g"+n++;return i.push(l),a.push(e),o.push(r),l},block:s,proc:function(t,r){var n=[];function i(){var e="a"+n.length;return n.push(e),e}r=r||0;for(var a=0;a<r;++a)i();var o=l(),s=o.toString;return u[t]=e(o,{arg:i,toString:function(){return ht(["function(",n.join(),"){",s(),"}"])}})},scope:l,cond:function(){var t=ht(arguments),r=l(),n=l(),i=r.toString,a=n.toString;return e(r,{then:function(){return r.apply(r,ut(arguments)),this},else:function(){return n.apply(n,ut(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),ht(["if(",t,"){",i(),"}",e])}})},compile:function(){var e=['"use strict";',c,"return {"];Object.keys(u).forEach((function(t){e.push('"',t,'":',u[t].toString(),",")})),e.push("}");var t,n=ht(e).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");if(r&&(t=Qe(n),r[t]))return r[t].apply(null,a);var o=Function.apply(null,i.concat(n));return r&&(r[t]=o),o.apply(null,a)}}}({cache:y}),n=t.link,i=t.global;t.id=R++,t.batchId="0";var a=n(D),o=t.shared={props:"a0"};Object.keys(D).forEach((function(e){o[e]=i.def(a,".",e)}));var s=t.next={},l=t.current={};Object.keys(C).forEach((function(e){Array.isArray(k[e])&&(s[e]=i.def(o.next,".",e),l[e]=i.def(o.current,".",e))}));var c=t.constants={};Object.keys(O).forEach((function(e){c[e]=i.def(JSON.stringify(O[e]))})),t.invoke=function(e,r){switch(r.type){case 0:var i=["this",o.context,o.props,t.batchId];return e.def(n(r.data),".call(",i.slice(0,Math.max(r.data.length+1,4)),")");case 1:return e.def(o.props,r.data);case 2:return e.def(o.context,r.data);case 3:return e.def("this",r.data);case 4:return r.data.append(t,e),r.data.ref;case 5:return r.data.toString();case 6:return r.data.map((function(r){return t.invoke(e,r)}))}},t.attribCache={};var u={};return t.scopeAttrib=function(e){var t=r.id(e);if(t in u)return u[t];var i=f.scope[t];return i||(i=f.scope[t]=new x),u[t]=n(i)},t}function j(e,t,r){var n=e.shared.context,i=e.scope();Object.keys(r).forEach((function(a){t.save(n,"."+a);var o=r[a].append(e,t);Array.isArray(o)?i(n,".",a,"=[",o.join(),"];"):i(n,".",a,"=",o,";")})),t(i)}function N(e,t,r,n){var i,a=e.shared,o=a.gl,s=a.framebuffer;w&&(i=t.def(a.extensions,".webgl_draw_buffers"));var l,c=e.constants,u=c.drawBuffer,h=c.backBuffer;l=r?r.append(e,t):t.def(s,".next"),n||t("if(",l,"!==",s,".cur){"),t("if(",l,"){",o,".bindFramebuffer(",36160,",",l,".framebuffer);"),w&&t(i,".drawBuffersWEBGL(",u,"[",l,".colorAttachments.length]);"),t("}else{",o,".bindFramebuffer(",36160,",null);"),w&&t(i,".drawBuffersWEBGL(",h,");"),t("}",s,".cur=",l,";"),n||t("}")}function U(e,t,r){var n=e.shared,i=n.gl,a=e.current,o=e.next,s=n.current,l=n.next,c=e.cond(s,".dirty");M.forEach((function(t){var n,u,f=I(t);if(!(f in r.state))if(f in o){n=o[f],u=a[f];var p=h(k[f].length,(function(e){return c.def(n,"[",e,"]")}));c(e.cond(p.map((function(e,t){return e+"!=="+u+"["+t+"]"})).join("||")).then(i,".",C[f],"(",p,");",p.map((function(e,t){return u+"["+t+"]="+e})).join(";"),";"))}else{n=c.def(l,".",f);var d=e.cond(n,"!==",s,".",f);c(d),f in E?d(e.cond(n).then(i,".enable(",E[f],");").else(i,".disable(",E[f],");"),s,".",f,"=",n,";"):d(i,".",C[f],"(",n,");",s,".",f,"=",n,";")}})),0===Object.keys(r.state).length&&c(s,".dirty=false;"),t(c)}function V(e,t,r,n){var i,a=e.shared,o=e.current,s=a.current,l=a.gl;Lr(Object.keys(r)).forEach((function(a){var c=r[a];if(!n||n(c)){var u=c.append(e,t);if(E[a]){var h=E[a];zr(c)?(i=e.link(u,{stable:!0}),t(e.cond(i).then(l,".enable(",h,");").else(l,".disable(",h,");")),t(s,".",a,"=",i,";")):(t(e.cond(u).then(l,".enable(",h,");").else(l,".disable(",h,");")),t(s,".",a,"=",u,";"))}else if(G(u)){var f=o[a];t(l,".",C[a],"(",u,");",u.map((function(e,t){return f+"["+t+"]="+e})).join(";"),";")}else zr(c)?(i=e.link(u,{stable:!0}),t(l,".",C[a],"(",i,");",s,".",a,"=",i,";")):t(l,".",C[a],"(",u,");",s,".",a,"=",u,";")}}))}function q(e,t){b&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function H(e,t,r,n,i){var a,o,s,l=e.shared,c=e.stats,u=l.current,h=l.timer,f=r.profile;function p(){return typeof performance>"u"?"Date.now()":"performance.now()"}function d(e){e(a=t.def(),"=",p(),";"),"string"==typeof i?e(c,".count+=",i,";"):e(c,".count++;"),g&&(n?e(o=t.def(),"=",h,".getNumPendingQueries();"):e(h,".beginQuery(",c,");"))}function m(e){e(c,".cpuTime+=",p(),"-",a,";"),g&&(n?e(h,".pushScopeStats(",o,",",h,".getNumPendingQueries(),",c,");"):e(h,".endQuery();"))}function y(e){var r=t.def(u,".profile");t(u,".profile=",e,";"),t.exit(u,".profile=",r,";")}if(f){if(zr(f))return void(f.enable?(d(t),m(t.exit),y("true")):y("false"));y(s=f.append(e,t))}else s=t.def(u,".profile");var v=e.block();d(v),t("if(",s,"){",v,"}");var x=e.block();m(x),t.exit("if(",s,"){",x,"}")}function W(e,t,r,n,i){var a=e.shared;n.forEach((function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(e,t)}else{if(!i(Rr))return;var c=e.scopeAttrib(s);o={},Object.keys(new x).forEach((function(e){o[e]=t.def(c,".",e)}))}!function(r,n,i){var o=a.gl,s=t.def(r,".location"),l=t.def(a.attributes,"[",s,"]"),c=i.state,u=i.buffer,h=[i.x,i.y,i.z,i.w],f=["buffer","normalized","offset","stride"];function p(){t("if(!",l,".buffer){",o,".enableVertexAttribArray(",s,");}");var r,a=i.type;if(r=i.size?t.def(i.size,"||",n):n,t("if(",l,".type!==",a,"||",l,".size!==",r,"||",f.map((function(e){return l+"."+e+"!=="+i[e]})).join("||"),"){",o,".bindBuffer(",or,",",u,".buffer);",o,".vertexAttribPointer(",[s,r,a,i.normalized,i.stride,i.offset],");",l,".type=",a,";",l,".size=",r,";",f.map((function(e){return l+"."+e+"="+i[e]+";"})).join(""),"}"),b){var c=i.divisor;t("if(",l,".divisor!==",c,"){",e.instancing,".vertexAttribDivisorANGLE(",[s,c],");",l,".divisor=",c,";}")}}function d(){t("if(",l,".buffer){",o,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",ft.map((function(e,t){return l+"."+e+"!=="+h[t]})).join("||"),"){",o,".vertexAttrib4f(",s,",",h,");",ft.map((function(e,t){return l+"."+e+"="+h[t]+";"})).join(""),"}")}1===c?p():2===c?d():(t("if(",c,"===",1,"){"),p(),t("}else{"),d(),t("}"))}(e.link(n),function(e){switch(e){case lr:case hr:case dr:return 2;case cr:case fr:case mr:return 3;case ur:case pr:case gr:return 4;default:return 1}}(n.info.type),o)}))}function Z(e,t,n,i,a,o){for(var s,l=e.shared,c=l.gl,u=0;u<i.length;++u){var f,p=i[u],d=p.name,m=p.info.type,g=n.uniforms[d],y=e.link(p)+".location";if(g){if(!a(g))continue;if(zr(g)){var v=g.value;if(m===_r||m===br){var x=e.link(v._texture||v.color[0]._texture);t(c,".uniform1i(",y,",",x+".bind());"),t.exit(x,".unbind();")}else if(m===yr||m===vr||m===xr){var _=e.global.def("new Float32Array(["+Array.prototype.slice.call(v)+"])"),b=2;m===vr?b=3:m===xr&&(b=4),t(c,".uniformMatrix",b,"fv(",y,",false,",_,");")}else{switch(m){case 5126:s="1f";break;case lr:s="2f";break;case cr:s="3f";break;case ur:s="4f";break;case 35670:case 5124:s="1i";break;case dr:case hr:s="2i";break;case mr:case fr:s="3i";break;case gr:case pr:s="4i"}t(c,".uniform",s,"(",y,",",G(v)?Array.prototype.slice.call(v):v,");")}continue}f=g.append(e,t)}else{if(!a(Rr))continue;f=t.def(l.uniforms,"[",r.id(d),"]")}m===_r?t("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}"):m===br&&t("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}");var w=1;switch(m){case _r:case br:var T=t.def(f,"._texture");t(c,".uniform1i(",y,",",T,".bind());"),t.exit(T,".unbind();");continue;case 5124:case 35670:s="1i";break;case hr:case dr:s="2i",w=2;break;case fr:case mr:s="3i",w=3;break;case pr:case gr:s="4i",w=4;break;case 5126:s="1f";break;case lr:s="2f",w=2;break;case cr:s="3f",w=3;break;case ur:s="4f",w=4;break;case yr:s="Matrix2fv";break;case vr:s="Matrix3fv";break;case xr:s="Matrix4fv"}if("M"===s.charAt(0)){t(c,".uniform",s,"(",y,",");var k=Math.pow(m-yr+2,2),A=e.global.def("new Float32Array(",k,")");Array.isArray(f)?t("false,(",h(k,(function(e){return A+"["+e+"]="+f[e]})),",",A,")"):t("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",h(k,(function(e){return A+"["+e+"]="+f+"["+e+"]"})),",",A,")"),t(");")}else if(w>1){for(var M=[],S=[],E=0;E<w;++E)Array.isArray(f)?S.push(f[E]):S.push(t.def(f+"["+E+"]")),o&&M.push(t.def());o&&t("if(!",e.batchId,"||",M.map((function(e,t){return e+"!=="+S[t]})).join("||"),"){",M.map((function(e,t){return e+"="+S[t]+";"})).join("")),t(c,".uniform",s,"(",y,",",S.join(","),");"),o&&t("}")}else{if(o){var C=t.def();t("if(!",e.batchId,"||",C,"!==",f,"){",C,"=",f,";")}t(c,".uniform",s,"(",y,",",f,");"),o&&t("}")}}}function Y(e,t,r,n){var i,a,o,s=e.shared,l=s.gl,c=s.draw,u=n.draw,h=(a=u.elements,o=t,a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(e,o),u.elementsActive&&o("if("+i+")"+l+".bindBuffer("+sr+","+i+".buffer.buffer);")):(i=o.def(),o(i,"=",c,".",Ht,";","if(",i,"){",l,".bindBuffer(",sr,",",i,".buffer.buffer);}","else if(",s.vao,".currentVAO){",i,"=",e.shared.elements+".getElements("+s.vao,".currentVAO.elements);",T?"":"if("+i+")"+l+".bindBuffer("+sr+","+i+".buffer.buffer);","}")),i);function f(i){var a=u[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(e,r):a.append(e,t):t.def(c,".",i)}var p,d,m=f(Gt),g=f(Zt),y=function(){var i,a=u.count,o=t;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(e,o)):i=o.def(c,".",Wt),i}();if("number"==typeof y){if(0===y)return}else r("if(",y,"){"),r.exit("}");b&&(p=f(Yt),d=e.instancing);var v=h+".type",x=u.elements&&zr(u.elements)&&!u.vaoActive;function _(){function e(){r(d,".drawElementsInstancedANGLE(",[m,y,v,g+"<<(("+v+"-5121)>>1)",p],");")}function t(){r(d,".drawArraysInstancedANGLE(",[m,g,y,p],");")}h&&"null"!==h?x?e():(r("if(",h,"){"),e(),r("}else{"),t(),r("}")):t()}function w(){function e(){r(l+".drawElements("+[m,y,v,g+"<<(("+v+"-5121)>>1)"]+");")}function t(){r(l+".drawArrays("+[m,g,y]+");")}h&&"null"!==h?x?e():(r("if(",h,"){"),e(),r("}else{"),t(),r("}")):t()}b&&("number"!=typeof p||p>=0)?"string"==typeof p?(r("if(",p,">0){"),_(),r("}else if(",p,"<0){"),w(),r("}")):_():w()}function X(e,t,r,n,i){var a=B(),o=a.proc("body",i);return b&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),e(a,o,r,n),a.compile().body}function $(e,t,r,n){q(e,t),r.useVAO?r.drawVAO?t(e.shared.vao,".setVAO(",r.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),W(e,t,r,n.attributes,(function(){return!0}))),Z(e,t,r,n.uniforms,(function(){return!0}),!1),Y(e,t,t,r)}function K(e,t,r,n){function i(){return!0}e.batchId="a1",q(e,t),W(e,t,r,n.attributes,i),Z(e,t,r,n.uniforms,i,!1),Y(e,t,t,r)}function J(e,t,r,n){q(e,t);var i=r.contextDep,a=t.def(),o=t.def();e.shared.props=o,e.batchId=a;var s=e.scope(),l=e.scope();function c(e){return e.contextDep&&i||e.propDep}function u(e){return!c(e)}if(t(s.entry,"for(",a,"=0;",a,"<","a1",";++",a,"){",o,"=","a0","[",a,"];",l,"}",s.exit),r.needsContext&&j(e,l,r.context),r.needsFramebuffer&&N(e,l,r.framebuffer),V(e,l,r.state,c),r.profile&&c(r.profile)&&H(e,l,r,!1,!0),n)r.useVAO?r.drawVAO?c(r.drawVAO)?l(e.shared.vao,".setVAO(",r.drawVAO.append(e,l),");"):s(e.shared.vao,".setVAO(",r.drawVAO.append(e,s),");"):s(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(s(e.shared.vao,".setVAO(null);"),W(e,s,r,n.attributes,u),W(e,l,r,n.attributes,c)),Z(e,s,r,n.uniforms,u,!1),Z(e,l,r,n.uniforms,c,!0),Y(e,s,l,r);else{var h=e.global.def("{}"),f=r.shader.progVar.append(e,l),p=l.def(f,".id"),d=l.def(h,"[",p,"]");l(e.shared.gl,".useProgram(",f,".program);","if(!",d,"){",d,"=",h,"[",p,"]=",e.link((function(e){return X(K,0,r,e,2)})),"(",f,");}",d,".call(this,a0[",a,"],",a,");")}}function Q(e,t,r){var n=t.static[r];if(n&&function(e){if("object"==typeof e&&!G(e)){for(var t=Object.keys(e),r=0;r<t.length;++r)if(o.isDynamic(e[t[r]]))return!0;return!1}}(n)){var i=e.global,a=Object.keys(n),s=!1,l=!1,c=!1,u=e.global.def("{}");a.forEach((function(t){var r=n[t];if(o.isDynamic(r)){"function"==typeof r&&(r=n[t]=o.unbox(r));var a=Or(r,null);s=s||a.thisDep,c=c||a.propDep,l=l||a.contextDep}else{switch(i(u,".",t,"="),typeof r){case"number":i(r);break;case"string":i('"',r,'"');break;case"object":Array.isArray(r)&&i("[",r.join(),"]");break;default:i(e.link(r))}i(";")}})),t.dynamic[r]=new o.DynamicVariable(4,{thisDep:s,contextDep:l,propDep:c,ref:u,append:function(e,t){a.forEach((function(r){var i=n[r];if(o.isDynamic(i)){var a=e.invoke(t,i);t(u,".",r,"=",a,";")}}))}}),delete t.static[r]}}return{next:A,current:k,procs:function(){var e=B(),t=e.proc("poll"),r=e.proc("refresh"),a=e.block();t(a),r(a);var o,s=e.shared,l=s.gl,c=s.next,u=s.current;a(u,".dirty=false;"),N(e,t),N(e,r,null,!0),b&&(o=e.link(b)),n.oes_vertex_array_object&&r(e.link(n.oes_vertex_array_object),".bindVertexArrayOES(null);");var f=r.def(s.attributes),p=r.def(0),d=e.cond(p,".buffer");d.then(l,".enableVertexAttribArray(i);",l,".bindBuffer(",or,",",p,".buffer.buffer);",l,".vertexAttribPointer(i,",p,".size,",p,".type,",p,".normalized,",p,".stride,",p,".offset);").else(l,".disableVertexAttribArray(i);",l,".vertexAttrib4f(i,",p,".x,",p,".y,",p,".z,",p,".w);",p,".buffer=null;");var m=e.link(i.maxAttributes,{stable:!0});return r("for(var i=0;i<",m,";++i){",p,"=",f,"[i];",d,"}"),b&&r("for(var i=0;i<",m,";++i){",o,".vertexAttribDivisorANGLE(i,",f,"[i].divisor);","}"),r(e.shared.vao,".currentVAO=null;",e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"),Object.keys(E).forEach((function(n){var i=E[n],o=a.def(c,".",n),s=e.block();s("if(",o,"){",l,".enable(",i,")}else{",l,".disable(",i,")}",u,".",n,"=",o,";"),r(s),t("if(",o,"!==",u,".",n,"){",s,"}")})),Object.keys(C).forEach((function(n){var i,o,s=C[n],f=k[n],p=e.block();if(p(l,".",s,"("),G(f)){var d=f.length;i=e.global.def(c,".",n),o=e.global.def(u,".",n),p(h(d,(function(e){return i+"["+e+"]"})),");",h(d,(function(e){return o+"["+e+"]="+i+"["+e+"];"})).join("")),t("if(",h(d,(function(e){return i+"["+e+"]!=="+o+"["+e+"]"})).join("||"),"){",p,"}")}else i=a.def(c,".",n),o=a.def(u,".",n),p(i,");",u,".",n,"=",i,";"),t("if(",i,"!==",o,"){",p,"}");r(p)})),e.compile()}(),compile:function(t,i,o,l,u){var d=B();d.stats=d.link(u),Object.keys(i.static).forEach((function(e){Q(d,i,e)})),ar.forEach((function(e){Q(d,t,e)}));var m=function(e,t,i,o){e.static,e.dynamic;var l=function(e,t){var r=e.static;if("string"==typeof r[qt]&&"string"==typeof r[Vt]){if(Object.keys(t.dynamic).length>0)return null;var n=t.static,i=Object.keys(n);if(i.length>0&&"number"==typeof n[i[0]]){for(var a=[],o=0;o<i.length;++o)a.push([0|n[i[o]],i[o]]);return a}}return null}(e,t),u=function(e){var t=e.static,r=e.dynamic;if(Ut in t){var n=t[Ut];return n?(n=c.getFramebuffer(n),Dr((function(e,t){var r=e.link(n),i=e.shared;t.set(i.framebuffer,".next",r);var a=i.context;return t.set(a,"."+Jt,r+".width"),t.set(a,"."+Qt,r+".height"),r}))):Dr((function(e,t){var r=e.shared;t.set(r.framebuffer,".next","null");var n=r.context;return t.set(n,"."+Jt,n+"."+nr),t.set(n,"."+Qt,n+"."+ir),"null"}))}if(Ut in r){var i=r[Ut];return Or(i,(function(e,t){var r=e.invoke(t,i),n=e.shared,a=n.framebuffer,o=t.def(a,".getFramebuffer(",r,")");t.set(a,".next",o);var s=n.context;return t.set(s,"."+Jt,o+"?"+o+".width:"+s+"."+nr),t.set(s,"."+Qt,o+"?"+o+".height:"+s+"."+ir),o}))}return null}(e),d=function(e,t){var r=e.static,n=e.dynamic;function i(e){if(e in r){var i,a,o=r[e],s=!0,l=0|o.x,c=0|o.y;return"width"in o?i=0|o.width:s=!1,"height"in o?a=0|o.height:s=!1,new Pr(!s&&t&&t.thisDep,!s&&t&&t.contextDep,!s&&t&&t.propDep,(function(e,t){var r=e.shared.context,n=i;"width"in o||(n=t.def(r,".",Jt,"-",l));var s=a;return"height"in o||(s=t.def(r,".",Qt,"-",c)),[l,c,n,s]}))}if(e in n){var u=n[e],h=Or(u,(function(e,t){var r=e.invoke(t,u),n=e.shared.context,i=t.def(r,".x|0"),a=t.def(r,".y|0");return[i,a,t.def('"width" in ',r,"?",r,".width|0:","(",n,".",Jt,"-",i,")"),t.def('"height" in ',r,"?",r,".height|0:","(",n,".",Qt,"-",a,")")]}));return t&&(h.thisDep=h.thisDep||t.thisDep,h.contextDep=h.contextDep||t.contextDep,h.propDep=h.propDep||t.propDep),h}return t?new Pr(t.thisDep,t.contextDep,t.propDep,(function(e,t){var r=e.shared.context;return[0,0,t.def(r,".",Jt),t.def(r,".",Qt)]})):null}var a=i(jt);if(a){var o=a;a=new Pr(a.thisDep,a.contextDep,a.propDep,(function(e,t){var r=o.append(e,t),n=e.shared.context;return t.set(n,"."+er,r[2]),t.set(n,"."+tr,r[3]),r}))}return{viewport:a,scissor_box:i(Bt)}}(e,u),m=function(e){var t=e.static,r=e.dynamic,n={},i=!1,a=function(){if(Xt in t){var e=t[Xt];return null!==e&&null===f.getVAO(e)&&(e=f.createVAO(e)),i=!0,n.vao=e,Dr((function(t){var r=f.getVAO(e);return r?t.link(r):"null"}))}if(Xt in r){i=!0;var a=r[Xt];return Or(a,(function(e,t){var r=e.invoke(t,a);return t.def(e.shared.vao+".getVAO("+r+")")}))}return null}(),o=!1,l=function(){if(Ht in t){var e=t[Ht];if(n.elements=e,Ir(e)){var l=n.elements=s.create(e,!0);e=s.getElements(l),o=!0}else e&&(e=s.getElements(e),o=!0);var c=Dr((function(t,r){if(e){var n=t.link(e);return t.ELEMENTS=n,n}return t.ELEMENTS=null,null}));return c.value=e,c}if(Ht in r){o=!0;var u=r[Ht];return Or(u,(function(e,t){var r=e.shared,n=r.isBufferArgs,i=r.elements,a=e.invoke(t,u),o=t.def("null"),s=t.def(n,"(",a,")"),l=e.cond(s).then(o,"=",i,".createStream(",a,");").else(o,"=",i,".getElements(",a,");");return t.entry(l),t.exit(e.cond(s).then(i,".destroyStream(",o,");")),e.ELEMENTS=o,o}))}return i?new Pr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.elements+".getElements("+e.shared.vao+".currentVAO.elements):null")})):null}();function c(e,s){if(e in t){var l=0|t[e];return s?n.offset=l:n.instances=l,Dr((function(e,t){return s&&(e.OFFSET=l),l}))}if(e in r){var c=r[e];return Or(c,(function(e,t){var r=e.invoke(t,c);return s&&(e.OFFSET=r),r}))}if(s){if(o)return Dr((function(e,t){return e.OFFSET=0,0}));if(i)return new Pr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.offset:0")}))}else if(i)return new Pr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.instances:-1")}));return null}var u=c(Zt,!0),h=function(){if(Gt in t){var e=t[Gt];return n.primitive=e,Dr((function(t,r){return F[e]}))}if(Gt in r){var s=r[Gt];return Or(s,(function(e,t){var r=e.constants.primTypes,n=e.invoke(t,s);return t.def(r,"[",n,"]")}))}return o?zr(l)?l.value?Dr((function(e,t){return t.def(e.ELEMENTS,".primType")})):Dr((function(){return 4})):new Pr(l.thisDep,l.contextDep,l.propDep,(function(e,t){var r=e.ELEMENTS;return t.def(r,"?",r,".primType:",4)})):i?new Pr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.primitive:4")})):null}(),p=function(){if(Wt in t){var e=0|t[Wt];return n.count=e,Dr((function(){return e}))}if(Wt in r){var s=r[Wt];return Or(s,(function(e,t){return e.invoke(t,s)}))}return o?zr(l)?l?u?new Pr(u.thisDep,u.contextDep,u.propDep,(function(e,t){return t.def(e.ELEMENTS,".vertCount-",e.OFFSET)})):Dr((function(e,t){return t.def(e.ELEMENTS,".vertCount")})):Dr((function(){return-1})):new Pr(l.thisDep||u.thisDep,l.contextDep||u.contextDep,l.propDep||u.propDep,(function(e,t){var r=e.ELEMENTS;return e.OFFSET?t.def(r,"?",r,".vertCount-",e.OFFSET,":-1"):t.def(r,"?",r,".vertCount:-1")})):i?new Pr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao,".currentVAO?",e.shared.vao,".currentVAO.count:-1")})):null}(),d=c(Yt,!1);return{elements:l,primitive:h,count:p,instances:d,offset:u,vao:a,vaoActive:i,elementsActive:o,static:n}}(e),g=function(e){var t=e.static,r=e.dynamic,n={};return M.forEach((function(e){var i=I(e);function a(a,o){if(e in t){var s=a(t[e]);n[i]=Dr((function(){return s}))}else if(e in r){var l=r[e];n[i]=Or(l,(function(e,t){return o(e,t,e.invoke(t,l))}))}}switch(e){case Tt:case dt:case pt:case Pt:case vt:case Ft:case St:case Ct:case It:case bt:return a((function(e){return e}),(function(e,t,r){return r}));case xt:return a((function(e){return Sr[e]}),(function(e,t,r){var n=e.constants.compareFuncs;return t.def(n,"[",r,"]")}));case _t:return a((function(e){return e}),(function(e,t,r){return[t.def("+",r,"[0]"),t.def("+",r,"[1]")]}));case yt:return a((function(e){var t="srcRGB"in e?e.srcRGB:e.src,r="srcAlpha"in e?e.srcAlpha:e.src,n="dstRGB"in e?e.dstRGB:e.dst,i="dstAlpha"in e?e.dstAlpha:e.dst;return[Mr[t],Mr[n],Mr[r],Mr[i]]}),(function(e,t,r){var n=e.constants.blendFuncs;function i(e,n){return t.def('"',e,n,'" in ',r,"?",r,".",e,n,":",r,".",e)}var a=i("src","RGB"),o=i("dst","RGB"),s=t.def(n,"[",a,"]"),l=t.def(n,"[",i("src","Alpha"),"]");return[s,t.def(n,"[",o,"]"),l,t.def(n,"[",i("dst","Alpha"),"]")]}));case gt:return a((function(e){return"string"==typeof e?[_[e],_[e]]:"object"==typeof e?[_[e.rgb],_[e.alpha]]:void 0}),(function(e,t,r){var n=e.constants.blendEquations,i=t.def(),a=t.def(),o=e.cond("typeof ",r,'==="string"');return o.then(i,"=",a,"=",n,"[",r,"];"),o.else(i,"=",n,"[",r,".rgb];",a,"=",n,"[",r,".alpha];"),t(o),[i,a]}));case mt:return a((function(e){return h(4,(function(t){return+e[t]}))}),(function(e,t,r){return h(4,(function(e){return t.def("+",r,"[",e,"]")}))}));case zt:return a((function(e){return 0|e}),(function(e,t,r){return t.def(r,"|0")}));case Dt:return a((function(e){var t=e.cmp||"keep",r=e.ref||0,n="mask"in e?e.mask:-1;return[Sr[t],r,n]}),(function(e,t,r){var n=e.constants.compareFuncs;return[t.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Ar),t.def(r,".ref|0"),t.def('"mask" in ',r,"?",r,".mask|0:-1")]}));case Ot:case Rt:return a((function(t){var r=t.fail||"keep",n=t.zfail||"keep",i=t.zpass||"keep";return[e===Rt?Tr:wr,Er[r],Er[n],Er[i]]}),(function(t,r,n){var i=t.constants.stencilOps;function a(e){return r.def('"',e,'" in ',n,"?",i,"[",n,".",e,"]:",Ar)}return[e===Rt?Tr:wr,a("fail"),a("zfail"),a("zpass")]}));case Et:return a((function(e){return[0|e.factor,0|e.units]}),(function(e,t,r){return[t.def(r,".factor|0"),t.def(r,".units|0")]}));case kt:return a((function(e){var t=0;return"front"===e?t=wr:"back"===e&&(t=Tr),t}),(function(e,t,r){return t.def(r,'==="front"?',wr,":",Tr)}));case Mt:return a((function(e){return e}),(function(e,t,r){return r}));case At:return a((function(e){return Cr[e]}),(function(e,t,r){return t.def(r+'==="cw"?2304:'+kr)}));case wt:return a((function(e){return e.map((function(e){return!!e}))}),(function(e,t,r){return h(4,(function(e){return"!!"+r+"["+e+"]"}))}));case Lt:return a((function(e){return["value"in e?e.value:1,!!e.invert]}),(function(e,t,r){return[t.def('"value" in ',r,"?+",r,".value:1"),t.def("!!",r,".invert")]}))}})),n}(e),y=function(e,t,n){var i=e.static,a=e.dynamic;function o(e){if(e in i){var t=r.id(i[e]),n=Dr((function(){return t}));return n.id=t,n}if(e in a){var o=a[e];return Or(o,(function(e,t){var r=e.invoke(t,o);return t.def(e.shared.strings,".id(",r,")")}))}return null}var s,l=o(qt),c=o(Vt),u=null;return zr(l)&&zr(c)?(u=p.program(c.id,l.id,null,n),s=Dr((function(e,t){return e.link(u)}))):s=new Pr(l&&l.thisDep||c&&c.thisDep,l&&l.contextDep||c&&c.contextDep,l&&l.propDep||c&&c.propDep,(function(e,t){var r,n=e.shared.shader;r=l?l.append(e,t):t.def(n,".",qt);var i=n+".program("+(c?c.append(e,t):t.def(n,".",Vt))+","+r;return t.def(i+")")})),{frag:l,vert:c,progVar:s,program:u}}(e,0,l);function v(e){var t=d[e];t&&(g[e]=t)}v(jt),v(I(Bt));var b=Object.keys(g).length>0,w={framebuffer:u,draw:m,shader:y,state:g,dirty:b,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(w.profile=function(e){var t,r=e.static,n=e.dynamic;if(Nt in r){var i=!!r[Nt];(t=Dr((function(e,t){return i}))).enable=i}else if(Nt in n){var a=n[Nt];t=Or(a,(function(e,t){return e.invoke(t,a)}))}return t}(e),w.uniforms=function(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r,i=t[e];if("number"==typeof i||"boolean"==typeof i)r=Dr((function(){return i}));else if("function"==typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Dr((function(e){return e.link(i)})):("framebuffer"===a||"framebufferCube"===a)&&(r=Dr((function(e){return e.link(i.color[0])})))}else G(i)&&(r=Dr((function(e){return e.global.def("[",h(i.length,(function(e){return i[e]})),"]")})));r.value=i,n[e]=r})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=Or(t,(function(e,r){return e.invoke(r,t)}))})),n}(i),w.drawVAO=w.scopeVAO=m.vao,!w.drawVAO&&y.program&&!l&&n.angle_instanced_arrays&&m.static.elements){var T=!0,k=y.program.attributes.map((function(e){var r=t.static[e];return T=T&&!!r,r}));if(T&&k.length>0){var A=f.getVAO(f.createVAO({attributes:k,elements:m.static.elements}));w.drawVAO=new Pr(null,null,null,(function(e,t){return e.link(A)})),w.useVAO=!0}}return l?w.useVAO=!0:w.attributes=function(e){var t=e.static,n=e.dynamic,i={};return Object.keys(t).forEach((function(e){var n=t[e],o=r.id(e),s=new x;if(Ir(n))s.state=1,s.buffer=a.getBuffer(a.create(n,or,!1,!0)),s.type=0;else{var l=a.getBuffer(n);if(l)s.state=1,s.buffer=l,s.type=0;else if("constant"in n){var c=n.constant;s.buffer="null",s.state=2,"number"==typeof c?s.x=c:ft.forEach((function(e,t){t<c.length&&(s[e]=c[t])}))}else{l=Ir(n.buffer)?a.getBuffer(a.create(n.buffer,or,!1,!0)):a.getBuffer(n.buffer);var u=0|n.offset,h=0|n.stride,f=0|n.size,p=!!n.normalized,d=0;"type"in n&&(d=S[n.type]);var m=0|n.divisor;s.buffer=l,s.state=1,s.size=f,s.normalized=p,s.type=d||l.dtype,s.offset=u,s.stride=h,s.divisor=m}}i[e]=Dr((function(e,t){var r=e.attribCache;if(o in r)return r[o];var n={isStream:!1};return Object.keys(s).forEach((function(e){n[e]=s[e]})),s.buffer&&(n.buffer=e.link(s.buffer),n.type=n.type||n.buffer+".dtype"),r[o]=n,n}))})),Object.keys(n).forEach((function(e){var t=n[e];i[e]=Or(t,(function(e,r){var n=e.invoke(r,t),i=e.shared,a=e.constants,o=i.isBufferArgs,s=i.buffer,l={isStream:r.def(!1)},c=new x;c.state=1,Object.keys(c).forEach((function(e){l[e]=r.def(""+c[e])}));var u=l.buffer,h=l.type;function f(e){r(l[e],"=",n,".",e,"|0;")}return r("if(",o,"(",n,")){",l.isStream,"=true;",u,"=",s,".createStream(",or,",",n,");",h,"=",u,".dtype;","}else{",u,"=",s,".getBuffer(",n,");","if(",u,"){",h,"=",u,".dtype;",'}else if("constant" in ',n,"){",l.state,"=",2,";","if(typeof "+n+'.constant === "number"){',l[ft[0]],"=",n,".constant;",ft.slice(1).map((function(e){return l[e]})).join("="),"=0;","}else{",ft.map((function(e,t){return l[e]+"="+n+".constant.length>"+t+"?"+n+".constant["+t+"]:0;"})).join(""),"}}else{","if(",o,"(",n,".buffer)){",u,"=",s,".createStream(",or,",",n,".buffer);","}else{",u,"=",s,".getBuffer(",n,".buffer);","}",h,'="type" in ',n,"?",a.glTypes,"[",n,".type]:",u,".dtype;",l.normalized,"=!!",n,".normalized;"),f("size"),f("offset"),f("stride"),f("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l}))})),i}(t),w.context=function(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r=t[e];n[e]=Dr((function(e,t){return"number"==typeof r||"boolean"==typeof r?""+r:e.link(r)}))})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=Or(t,(function(e,r){return e.invoke(r,t)}))})),n}(o),w}(t,i,o,l);return m.shader.program&&(m.shader.program.attributes.sort((function(e,t){return e.name<t.name?-1:1})),m.shader.program.uniforms.sort((function(e,t){return e.name<t.name?-1:1}))),function(e,t){var r=e.proc("draw",1);q(e,r),j(e,r,t.context),N(e,r,t.framebuffer),U(e,r,t),V(e,r,t.state),H(e,r,t,!1,!0);var n=t.shader.progVar.append(e,r);if(r(e.shared.gl,".useProgram(",n,".program);"),t.shader.program)$(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var i=e.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(e.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",e.link((function(e){return X($,0,t,e,1)})),"(",n,");",o,".call(this,a0);"))}Object.keys(t.state).length>0&&r(e.shared.current,".dirty=true;"),e.shared.vao&&r(e.shared.vao,".setVAO(null);")}(d,m),function(e,t){var n=e.proc("scope",3);e.batchId="a2";var i=e.shared,a=i.current;if(j(e,n,t.context),t.framebuffer&&t.framebuffer.append(e,n),Lr(Object.keys(t.state)).forEach((function(r){var a=t.state[r],o=a.append(e,n);G(o)?o.forEach((function(t,i){z(t)?n.set(e.next[r],"["+i+"]",t):n.set(e.next[r],"["+i+"]",e.link(t,{stable:!0}))})):zr(a)?n.set(i.next,"."+r,e.link(o,{stable:!0})):n.set(i.next,"."+r,o)})),H(e,n,t,!0,!0),[Ht,Zt,Wt,Yt,Gt].forEach((function(r){var a=t.draw[r];if(a){var o=a.append(e,n);z(o)?n.set(i.draw,"."+r,o):n.set(i.draw,"."+r,e.link(o),{stable:!0})}})),Object.keys(t.uniforms).forEach((function(a){var o=t.uniforms[a].append(e,n);Array.isArray(o)&&(o="["+o.map((function(t){return z(t)?t:e.link(t,{stable:!0})}))+"]"),n.set(i.uniforms,"["+e.link(r.id(a),{stable:!0})+"]",o)})),Object.keys(t.attributes).forEach((function(r){var i=t.attributes[r].append(e,n),a=e.scopeAttrib(r);Object.keys(new x).forEach((function(e){n.set(a,"."+e,i[e])}))})),t.scopeVAO){var o=t.scopeVAO.append(e,n);z(o)?n.set(i.vao,".targetVAO",o):n.set(i.vao,".targetVAO",e.link(o,{stable:!0}))}function s(r){var a=t.shader[r];if(a){var o=a.append(e,n);z(o)?n.set(i.shader,"."+r,o):n.set(i.shader,"."+r,e.link(o,{stable:!0}))}}s(Vt),s(qt),Object.keys(t.state).length>0&&(n(a,".dirty=true;"),n.exit(a,".dirty=true;")),n("a1(",e.shared.context,",a0,",e.batchId,");")}(d,m),function(e,t){var r=e.proc("batch",2);e.batchId="0",q(e,r);var n=!1,i=!0;Object.keys(t.context).forEach((function(e){n=n||t.context[e].propDep})),n||(j(e,r,t.context),i=!1);var a=t.framebuffer,o=!1;function s(e){return e.contextDep&&n||e.propDep}a?(a.propDep?n=o=!0:a.contextDep&&n&&(o=!0),o||N(e,r,a)):N(e,r,null),t.state.viewport&&t.state.viewport.propDep&&(n=!0),U(e,r,t),V(e,r,t.state,(function(e){return!s(e)})),(!t.profile||!s(t.profile))&&H(e,r,t,!1,"a1"),t.contextDep=n,t.needsContext=i,t.needsFramebuffer=o;var l=t.shader.progVar;if(l.contextDep&&n||l.propDep)J(e,r,t,null);else{var c=l.append(e,r);if(r(e.shared.gl,".useProgram(",c,".program);"),t.shader.program)J(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var u=e.global.def("{}"),h=r.def(c,".id"),f=r.def(u,"[",h,"]");r(e.cond(f).then(f,".call(this,a0,a1);").else(f,"=",u,"[",h,"]=",e.link((function(e){return X(J,0,t,e,2)})),"(",c,");",f,".call(this,a0,a1);"))}}Object.keys(t.state).length>0&&r(e.shared.current,".dirty=true;"),e.shared.vao&&r(e.shared.vao,".setVAO(null);")}(d,m),e(d.compile(),{destroy:function(){m.shader.program.destroy()}})}}}var Br="webglcontextlost",jr="webglcontextrestored";function Nr(e,t){for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}return function(t){var r=function(t){var r,n,i,a,o=t||{},s={},l=[],h=[],f=typeof window>"u"?1:window.devicePixelRatio,p=!1,d={},m=function(e){},g=function(){};if("string"==typeof o?r=document.querySelector(o):"object"==typeof o&&(function(e){return"string"==typeof e.nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect}(o)?r=o:function(e){return"function"==typeof e.drawArrays||"function"==typeof e.drawElements}(o)?i=(a=o).canvas:("gl"in o?a=o.gl:"canvas"in o?i=u(o.canvas):"container"in o&&(n=u(o.container)),"attributes"in o&&(s=o.attributes),"extensions"in o&&(l=c(o.extensions)),"optionalExtensions"in o&&(h=c(o.optionalExtensions)),"onDone"in o&&(m=o.onDone),"profile"in o&&(p=!!o.profile),"pixelRatio"in o&&(f=+o.pixelRatio),"cachedCode"in o&&(d=o.cachedCode))),r&&("canvas"===r.nodeName.toLowerCase()?i=r:n=r),!a){if(!i){var y=function(t,r,n){var i,a=document.createElement("canvas");function o(){var e=window.innerWidth,r=window.innerHeight;if(t!==document.body){var i=a.getBoundingClientRect();e=i.right-i.left,r=i.bottom-i.top}a.width=n*e,a.height=n*r}return e(a.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),t.appendChild(a),t===document.body&&(a.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(o)}))).observe(t):window.addEventListener("resize",o,!1),o(),{canvas:a,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",o),t.removeChild(a)}}}(n||document.body,0,f);if(!y)return null;i=y.canvas,g=y.onDestroy}void 0===s.premultipliedAlpha&&(s.premultipliedAlpha=!0),a=function(e,t){function r(r){try{return e.getContext(r,t)}catch{return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(i,s)}return a?{gl:a,canvas:i,container:n,extensions:l,optionalExtensions:h,pixelRatio:f,profile:p,cachedCode:d,onDone:m,onDestroy:g}:(g(),m("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}(t);if(!r)return null;var n=r.gl,i=n.getContextAttributes(),a=(n.isContextLost(),function(e,t){var r={};function n(t){var n,i=t.toLowerCase();try{n=r[i]=e.getExtension(i)}catch{}return!!n}for(var i=0;i<t.extensions.length;++i){var a=t.extensions[i];if(!n(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(n),{extensions:r,restore:function(){Object.keys(r).forEach((function(e){if(r[e]&&!n(e))throw new Error("(regl): error restoring extension "+e)}))}}}(n,r));if(!a)return null;var h=function(){var e={"":0},t=[""];return{id:function(r){var n=e[r];return n||(n=e[r]=t.length,t.push(r),n)},str:function(e){return t[e]}}}(),f={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},p=r.cachedCode||{},k=a.extensions,A=function(e,t){if(!t.ext_disjoint_timer_query)return null;var r=[];function n(e){r.push(e)}var i=[];function a(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var o=[];function s(e){o.push(e)}var l=[];function c(e,t,r){var n=o.pop()||new a;n.startQueryIndex=e,n.endQueryIndex=t,n.sum=0,n.stats=r,l.push(n)}var u=[],h=[];return{beginQuery:function(e){var n=r.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,n),i.push(n),c(i.length-1,i.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var e,r,a=i.length;if(0!==a){h.length=Math.max(h.length,a+1),u.length=Math.max(u.length,a+1),u[0]=0,h[0]=0;var o=0;for(e=0,r=0;r<i.length;++r){var c=i[r];t.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(o+=t.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),n(c)):i[e++]=c,u[r+1]=o,h[r+1]=e}for(i.length=e,e=0,r=0;r<l.length;++r){var f=l[r],p=f.startQueryIndex,d=f.endQueryIndex;f.sum+=u[d]-u[p];var m=h[p],g=h[d];g===m?(f.stats.gpuTime+=f.sum/1e6,s(f)):(f.startQueryIndex=m,f.endQueryIndex=g,l[e++]=f)}l.length=e}},getNumPendingQueries:function(){return i.length},clear:function(){r.push.apply(r,i);for(var e=0;e<r.length;e++)t.ext_disjoint_timer_query.deleteQueryEXT(r[e]);i.length=0,r.length=0},restore:function(){i.length=0,r.length=0}}}(0,k),M=l(),V=n.drawingBufferWidth,q=n.drawingBufferHeight,we={tick:0,time:0,viewportWidth:V,viewportHeight:q,framebufferWidth:V,framebufferHeight:q,drawingBufferWidth:V,drawingBufferHeight:q,pixelRatio:r.pixelRatio},Te={elements:null,primitive:4,count:-1,offset:0,instances:-1},ke=function(e,t){var r=1;t.ext_texture_filter_anisotropic&&(r=e.getParameter(34047));var n=1,i=1;t.webgl_draw_buffers&&(n=e.getParameter(34852),i=e.getParameter(36063));var a=!!t.oes_texture_float;if(a){var o=e.createTexture();e.bindTexture(m,o),e.texImage2D(m,0,g,1,1,0,g,y,null);var s=e.createFramebuffer();if(e.bindFramebuffer(v,s),e.framebufferTexture2D(v,36064,m,o,0),e.bindTexture(m,null),36053!==e.checkFramebufferStatus(v))a=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(16384);var l=d.allocType(y,4);e.readPixels(0,0,1,1,g,y,l),e.getError()?a=!1:(e.deleteFramebuffer(s),e.deleteTexture(o),a=1===l[0]),d.freeType(l)}}var c=!0;if(!(typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)))){var u=e.createTexture(),h=d.allocType(5121,36);e.activeTexture(33984),e.bindTexture(34067,u),e.texImage2D(34069,0,g,3,3,0,g,5121,h),d.freeType(h),e.bindTexture(34067,null),e.deleteTexture(u),c=!e.getError()}return{colorBits:[e.getParameter(3410),e.getParameter(3411),e.getParameter(3412),e.getParameter(3413)],depthBits:e.getParameter(3414),stencilBits:e.getParameter(3415),subpixelBits:e.getParameter(3408),extensions:Object.keys(t).filter((function(e){return!!t[e]})),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:i,pointSizeDims:e.getParameter(33901),lineWidthDims:e.getParameter(33902),maxViewportDims:e.getParameter(3386),maxCombinedTextureUnits:e.getParameter(35661),maxCubeMapSize:e.getParameter(34076),maxRenderbufferSize:e.getParameter(34024),maxTextureUnits:e.getParameter(34930),maxTextureSize:e.getParameter(3379),maxAttributes:e.getParameter(34921),maxVertexUniforms:e.getParameter(36347),maxVertexTextureUnits:e.getParameter(35660),maxVaryingVectors:e.getParameter(36348),maxFragmentUniforms:e.getParameter(36349),glsl:e.getParameter(35724),renderer:e.getParameter(7937),vendor:e.getParameter(7936),version:e.getParameter(7938),readFloat:a,npotTextureCube:c}}(n,k),Ce=function(e,t,r){var n=0,i={};function a(t){this.id=n++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=L,this.persistentData=null,r.profile&&(this.stats={size:0})}a.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},a.prototype.destroy=function(){c(this)};var o=[];function s(t,r,n){t.byteLength=r.byteLength,e.bufferData(t.type,r,n)}function l(e,t,r,n,i,a){var o,l;if(e.usage=r,Array.isArray(t)){if(e.dtype=n||P,t.length>0)if(Array.isArray(t[0])){o=I(t);for(var c=1,u=1;u<o.length;++u)c*=o[u];e.dimension=c,s(e,l=C(t,o,e.dtype),r),a?e.persistentData=l:d.freeType(l)}else if("number"==typeof t[0]){e.dimension=i;var h=d.allocType(e.dtype,t.length);O(h,t),s(e,h,r),a?e.persistentData=h:d.freeType(h)}else x(t[0])&&(e.dimension=t[0].length,e.dtype=n||D(t[0])||P,s(e,l=C(t,[t.length,t[0].length],e.dtype),r),a?e.persistentData=l:d.freeType(l))}else if(x(t))e.dtype=n||D(t),e.dimension=i,s(e,t,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(t.buffer)));else if(_(t)){o=t.shape;var f=t.stride,p=t.offset,m=0,g=0,y=0,v=0;1===o.length?(m=o[0],g=1,y=f[0],v=0):2===o.length&&(m=o[0],g=o[1],y=f[0],v=f[1]),e.dtype=n||D(t.data)||P,e.dimension=g;var b=d.allocType(e.dtype,m*g);R(b,t.data,m,g,y,v,p),s(e,b,r),a?e.persistentData=b:d.freeType(b)}else t instanceof ArrayBuffer&&(e.dtype=L,e.dimension=i,s(e,t,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(t))))}function c(r){var n;t.bufferCount--,n=r,Le.destroyBuffer(n);var a=r.buffer;e.deleteBuffer(a),r.buffer=null,delete i[r.id]}return r.profile&&(t.getTotalBufferSize=function(){var e=0;return Object.keys(i).forEach((function(t){e+=i[t].stats.size})),e}),{create:function(n,o,s,u){t.bufferCount++;var h=new a(o);function f(t){var n=35044,i=null,a=0,o=0,s=1;return Array.isArray(t)||x(t)||_(t)||t instanceof ArrayBuffer?i=t:"number"==typeof t?a=0|t:t&&("data"in t&&(i=t.data),"usage"in t&&(n=E[t.usage]),"type"in t&&(o=S[t.type]),"dimension"in t&&(s=0|t.dimension),"length"in t&&(a=0|t.length)),h.bind(),i?l(h,i,n,o,s,u):(a&&e.bufferData(h.type,a,n),h.dtype=o||L,h.usage=n,h.dimension=s,h.byteLength=a),r.profile&&(h.stats.size=h.byteLength*z[h.dtype]),f}function p(t,r){e.bufferSubData(h.type,r,t)}return i[h.id]=h,s||f(n),f._reglType="buffer",f._buffer=h,f.subdata=function(e,t){var r,n=0|(t||0);if(h.bind(),x(e)||e instanceof ArrayBuffer)p(e,n);else if(Array.isArray(e)){if(e.length>0)if("number"==typeof e[0]){var i=d.allocType(h.dtype,e.length);O(i,e),p(i,n),d.freeType(i)}else if(Array.isArray(e[0])||x(e[0])){r=I(e);var a=C(e,r,h.dtype);p(a,n),d.freeType(a)}}else if(_(e)){r=e.shape;var o=e.stride,s=0,l=0,c=0,u=0;1===r.length?(s=r[0],l=1,c=o[0],u=0):2===r.length&&(s=r[0],l=r[1],c=o[0],u=o[1]);var m=Array.isArray(e.data)?h.dtype:D(e.data),g=d.allocType(m,s*l);R(g,e.data,s,l,c,u,e.offset),p(g,n),d.freeType(g)}return f},r.profile&&(f.stats=h.stats),f.destroy=function(){c(h)},f},createStream:function(e,t){var r=o.pop();return r||(r=new a(e)),r.bind(),l(r,t,35040,0,1,!1),r},destroyStream:function(e){o.push(e)},clear:function(){b(i).forEach(c),o.forEach(c)},getBuffer:function(e){return e&&e._buffer instanceof a?e._buffer:null},restore:function(){b(i).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:l}}(n,f,r),Ie=function(e,t,r,n){var i={},a=0,o={uint8:B,uint16:j};function s(e){this.id=a++,i[this.id]=this,this.buffer=e,this.primType=4,this.vertCount=0,this.type=0}t.oes_element_index_uint&&(o.uint32=N),s.prototype.bind=function(){this.buffer.bind()};var l=[];function c(n,i,a,o,s,l,c){var u;if(n.buffer.bind(),i){var h=c;!c&&(!x(i)||_(i)&&!x(i.data))&&(h=t.oes_element_index_uint?N:j),r._initBuffer(n.buffer,i,a,h,3)}else e.bufferData(U,l,a),n.buffer.dtype=u||B,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;if(u=c,!c){switch(n.buffer.dtype){case B:case 5120:u=B;break;case j:case 5122:u=j;break;case N:case 5124:u=N}n.buffer.dtype=u}n.type=u;var f=s;f<0&&(f=n.buffer.byteLength,u===j?f>>=1:u===N&&(f>>=2)),n.vertCount=f;var p=o;if(o<0){p=4;var d=n.buffer.dimension;1===d&&(p=0),2===d&&(p=1),3===d&&(p=4)}n.primType=p}function u(e){n.elementsCount--,delete i[e.id],e.buffer.destroy(),e.buffer=null}return{create:function(e,t){var i=r.create(null,U,!0),a=new s(i._buffer);function l(e){if(e)if("number"==typeof e)i(e),a.primType=4,a.vertCount=0|e,a.type=B;else{var t=null,r=35044,n=-1,s=-1,u=0,h=0;Array.isArray(e)||x(e)||_(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(r=E[e.usage]),"primitive"in e&&(n=F[e.primitive]),"count"in e&&(s=0|e.count),"type"in e&&(h=o[e.type]),"length"in e?u=0|e.length:(u=s,h===j||5122===h?u*=2:(h===N||5124===h)&&(u*=4))),c(a,t,r,n,s,u,h)}else i(),a.primType=4,a.vertCount=0,a.type=B;return l}return n.elementsCount++,l(e),l._reglType="elements",l._elements=a,l.subdata=function(e,t){return i.subdata(e,t),l},l.destroy=function(){u(a)},l},createStream:function(e){var t=l.pop();return t||(t=new s(r.create(null,U,!0,!1)._buffer)),c(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){l.push(e)},getElements:function(e){return"function"==typeof e&&e._elements instanceof s?e._elements:null},clear:function(){b(i).forEach(u)}}}(n,k,Ce,f),Le=function(e,t,r,n,i,a,o){for(var s=r.maxAttributes,l=new Array(s),c=0;c<s;++c)l[c]=new Je;var u=0,h={},f={Record:Je,scope:{},state:l,currentVAO:null,targetVAO:null,restore:p()?function(){p()&&b(h).forEach((function(e){e.refresh()}))}:function(){},createVAO:function(e){var t=new m;function r(e){var n;if(Array.isArray(e))n=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?"function"==typeof o&&"elements"===o._reglType?(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;n=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=0|e.offset),"count"in e&&(t.count=0|e.count),"instances"in e&&(t.instances=0|e.instances),"primitive"in e&&(t.primitive=F[e.primitive])}var s={},l=t.attributes;l.length=n.length;for(var c=0;c<n.length;++c){var u,h=n[c],f=l[c]=new Je,p=h.data||h;Array.isArray(p)||x(p)||_(p)?(t.buffers[c]&&(u=t.buffers[c],x(p)&&u._buffer.byteLength>=p.byteLength?u.subdata(p):(u.destroy(),t.buffers[c]=null)),t.buffers[c]||(u=t.buffers[c]=i.create(h,34962,!1,!0)),f.buffer=i.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,s[c]=1):i.getBuffer(h)?(f.buffer=i.getBuffer(h),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(h.buffer)?(f.buffer=i.getBuffer(h.buffer),f.size=0|(+h.size||f.buffer.dimension),f.normalized=!!h.normalized||!1,f.type="type"in h?S[h.type]:f.buffer.dtype,f.offset=0|(h.offset||0),f.stride=0|(h.stride||0),f.divisor=0|(h.divisor||0),f.state=1):"x"in h&&(f.x=+h.x||0,f.y=+h.y||0,f.z=+h.z||0,f.w=+h.w||0,f.state=2)}for(var d=0;d<t.buffers.length;++d)!s[d]&&t.buffers[d]&&(t.buffers[d].destroy(),t.buffers[d]=null);return t.refresh(),r}return n.vaoCount+=1,r.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,t.ownsElements=!1),t.destroy()},r._vao=t,r._reglType="vao",r(e)},getVAO:function(e){return"function"==typeof e&&e._vao?e._vao:null},destroyBuffer:function(t){for(var r=0;r<l.length;++r){var n=l[r];n.buffer===t&&(e.disableVertexAttribArray(r),n.buffer=null)}},setVAO:p()?function(e){if(e!==f.currentVAO){var t=p();e?t.bindVertexArrayOES(e.vao):t.bindVertexArrayOES(null),f.currentVAO=e}}:function(t){if(t!==f.currentVAO){if(t)t.bindAttrs();else{for(var r=d(),n=0;n<l.length;++n){var i=l[n];i.buffer?(e.enableVertexAttribArray(n),i.buffer.bind(),e.vertexAttribPointer(n,i.size,i.type,i.normalized,i.stride,i.offfset),r&&i.divisor&&r.vertexAttribDivisorANGLE(n,i.divisor)):(e.disableVertexAttribArray(n),e.vertexAttrib4f(n,i.x,i.y,i.z,i.w))}o.elements?e.bindBuffer(Ke,o.elements.buffer.buffer):e.bindBuffer(Ke,null)}f.currentVAO=t}},clear:p()?function(){b(h).forEach((function(e){e.destroy()}))}:function(){}};function p(){return t.oes_vertex_array_object}function d(){return t.angle_instanced_arrays}function m(){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=p();this.vao=e?e.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}return m.prototype.bindAttrs=function(){for(var t=d(),r=this.attributes,n=0;n<r.length;++n){var i=r[n];i.buffer?(e.enableVertexAttribArray(n),e.bindBuffer(34962,i.buffer.buffer),e.vertexAttribPointer(n,i.size,i.type,i.normalized,i.stride,i.offset),t&&i.divisor&&t.vertexAttribDivisorANGLE(n,i.divisor)):(e.disableVertexAttribArray(n),e.vertexAttrib4f(n,i.x,i.y,i.z,i.w))}for(var o=r.length;o<s;++o)e.disableVertexAttribArray(o);var l=a.getElements(this.elements);l?e.bindBuffer(Ke,l.buffer.buffer):e.bindBuffer(Ke,null)},m.prototype.refresh=function(){var e=p();e&&(e.bindVertexArrayOES(this.vao),this.bindAttrs(),f.currentVAO=null,e.bindVertexArrayOES(null))},m.prototype.destroy=function(){if(this.vao){var e=p();this===f.currentVAO&&(f.currentVAO=null,e.bindVertexArrayOES(null)),e.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),h[this.id]&&(delete h[this.id],n.vaoCount-=1)},f}(n,k,ke,f,Ce,Ie,Te),He=function(t,r,n,i){var a={},o={};function s(e,t,r,n){this.name=e,this.id=t,this.location=r,this.info=n}function l(e,t){for(var r=0;r<e.length;++r)if(e[r].id===t.id)return void(e[r].location=t.location);e.push(t)}function c(e,n,i){var s=35632===e?a:o,l=s[n];if(!l){var c=r.str(n);l=t.createShader(e),t.shaderSource(l,c),t.compileShader(l),s[n]=l}return l}var u={},h=[],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 d(e,n,a){var o,u,h=c(35632,e.fragId),f=c(35633,e.vertId),p=e.program=t.createProgram();if(t.attachShader(p,h),t.attachShader(p,f),a)for(o=0;o<a.length;++o){var d=a[o];t.bindAttribLocation(p,d[0],d[1])}t.linkProgram(p);var m=t.getProgramParameter(p,35718);i.profile&&(e.stats.uniformsCount=m);var g=e.uniforms;for(o=0;o<m;++o)if(u=t.getActiveUniform(p,o))if(u.size>1)for(var y=0;y<u.size;++y){var v=u.name.replace("[0]","["+y+"]");l(g,new s(v,r.id(v),t.getUniformLocation(p,v),u))}else l(g,new s(u.name,r.id(u.name),t.getUniformLocation(p,u.name),u));var x=t.getProgramParameter(p,35721);i.profile&&(e.stats.attributesCount=x);var _=e.attributes;for(o=0;o<x;++o)(u=t.getActiveAttrib(p,o))&&l(_,new s(u.name,r.id(u.name),t.getAttribLocation(p,u.name),u))}return i.profile&&(n.getMaxUniformsCount=function(){var e=0;return h.forEach((function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)})),e},n.getMaxAttributesCount=function(){var e=0;return h.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var e=t.deleteShader.bind(t);b(a).forEach(e),a={},b(o).forEach(e),o={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,u={},n.shaderCount=0},program:function(r,i,s,l){var c=u[i];c||(c=u[i]={});var f=c[r];if(f&&(f.refCount++,!l))return f;var m=new p(i,r);return n.shaderCount++,d(m,0,l),f||(c[r]=m),h.push(m),e(m,{destroy:function(){if(m.refCount--,m.refCount<=0){t.deleteProgram(m.program);var e=h.indexOf(m);h.splice(e,1),n.shaderCount--}c[m.vertId].refCount<=0&&(t.deleteShader(o[m.vertId]),delete o[m.vertId],delete u[m.fragId][m.vertId]),Object.keys(u[m.fragId]).length||(t.deleteShader(a[m.fragId]),delete a[m.fragId],delete u[m.fragId])}})},restore:function(){a={},o={};for(var e=0;e<h.length;++e)d(h[e],0,h[e].attributes.map((function(e){return[e.location,e.name]})))},shader:c,frag:-1,vert:-1}}(n,h,f,r),Qe=function(t,r,n,i,a,o,s){var l={"don't care":ye,"dont care":ye,nice:4354,fast:4353},c={repeat:10497,clamp:pe,mirror:33648},u={nearest:de,linear:9729},h=e({mipmap:ge,"nearest mipmap nearest":me,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":ge},u),f={none:0,browser:37444},p={uint8:ce,rgba4:32819,rgb565:33635,"rgb5 a1":32820},m={alpha:$,luminance:J,"luminance alpha":Q,rgb:K,rgba:X,rgba4:32854,"rgb5 a1":ee,rgb565:36194},g={};r.ext_srgb&&(m.srgb=ne,m.srgba=ie),r.oes_texture_float&&(p.float32=p.float=fe),r.oes_texture_half_float&&(p.float16=p["half float"]=ae),r.webgl_depth_texture&&(e(m,{depth:te,"depth stencil":re}),e(p,{uint16:ue,uint32:he,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":oe,"rgba s3tc dxt1":se,"rgba s3tc dxt3":le,"rgba s3tc dxt5":33779}),r.webgl_compressed_texture_atc&&e(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(t.getParameter(34467));Object.keys(g).forEach((function(e){var t=g[e];y.indexOf(t)>=0&&(m[e]=t)}));var v=Object.keys(m);n.textureFormats=v;var k=[];Object.keys(m).forEach((function(e){var t=m[e];k[t]=e}));var A=[];Object.keys(p).forEach((function(e){var t=p[e];A[t]=e}));var M=[];Object.keys(u).forEach((function(e){M[u[e]]=e}));var S=[];Object.keys(h).forEach((function(e){var t=h[e];S[t]=e}));var E=[];Object.keys(c).forEach((function(e){E[c[e]]=e}));var C=v.reduce((function(e,t){var n=m[t];return n===J||n===$||n===J||n===Q||n===te||n===re||r.ext_srgb&&(n===ne||n===ie)?e[n]=n:n===ee||t.indexOf("rgba")>=0?e[n]=X:e[n]=K,e}),{});function I(){this.internalformat=X,this.format=X,this.type=ce,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function L(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 P(e,t){if("object"==typeof t&&t){if("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){var r=t.type;e.type=p[r]}var n=e.width,i=e.height,a=e.channels,o=!1;"shape"in t?(n=t.shape[0],i=t.shape[1],3===t.shape.length&&(a=t.shape[2],o=!0)):("radius"in t&&(n=i=t.radius),"width"in t&&(n=t.width),"height"in t&&(i=t.height),"channels"in t&&(a=t.channels,o=!0)),e.width=0|n,e.height=0|i,e.channels=0|a;var s=!1;if("format"in t){var l=t.format,c=e.internalformat=m[l];e.format=C[c],l in p&&("type"in t||(e.type=p[l])),l in g&&(e.compressed=!0),s=!0}!o&&s?e.channels=be[e.format]:o&&!s&&e.channels!==_e[e.format]&&(e.format=e.internalformat=_e[e.channels])}}function z(e){t.pixelStorei(37440,e.flipY),t.pixelStorei(37441,e.premultiplyAlpha),t.pixelStorei(37443,e.colorSpace),t.pixelStorei(3317,e.unpackAlignment)}function D(){I.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function O(e,t){var r=null;if(Fe(t)?r=t:t&&(P(e,t),"x"in t&&(e.xOffset=0|t.x),"y"in t&&(e.yOffset=0|t.y),Fe(t.data)&&(r=t.data)),t.copy){var n=a.viewportWidth,i=a.viewportHeight;e.width=e.width||n-e.xOffset,e.height=e.height||i-e.yOffset,e.needsCopy=!0}else if(r){if(x(r))e.channels=e.channels||4,e.data=r,!("type"in t)&&e.type===ce&&(e.type=Be(r));else if(Pe(r))e.channels=e.channels||4,function(e,t){var r=t.length;switch(e.type){case ce:case ue:case he:case fe:var n=d.allocType(e.type,r);n.set(t),e.data=n;break;case ae:e.data=H(t)}}(e,r),e.alignment=1,e.needsFree=!0;else if(_(r)){var o=r.data;!Array.isArray(o)&&e.type===ce&&(e.type=Be(o));var s,l,c,u,h,f,p=r.shape,m=r.stride;3===p.length?(c=p[2],f=m[2]):(c=1,f=1),s=p[0],l=p[1],u=m[0],h=m[1],e.alignment=1,e.width=s,e.height=l,e.channels=c,e.format=e.internalformat=_e[c],e.needsFree=!0,function(e,t,r,n,i,a){for(var o=e.width,s=e.height,l=e.channels,c=je(e,o*s*l),u=0,h=0;h<s;++h)for(var f=0;f<o;++f)for(var p=0;p<l;++p)c[u++]=t[r*f+n*h+i*p+a];Ne(e,c)}(e,o,u,h,f,r.offset)}else if(Oe(r)||Re(r)||function(e){return De(e)===Ae}(r))Oe(r)||Re(r)?e.element=r:e.element=r.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(function(e){return De(e)===Me}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(e){return De(e)===Se}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(e){return De(e)===Ee}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(ze(r)){var g=e.width||r[0].length,y=e.height||r.length,v=e.channels;v=G(r[0][0])?v||r[0][0].length:v||1;for(var b=w(r),k=1,A=0;A<b.length;++A)k*=b[A];var M=je(e,k);T(r,b,"",M),Ne(e,M),e.alignment=1,e.width=g,e.height=y,e.channels=v,e.format=e.internalformat=_e[v],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;e.type===fe||e.type}function R(e,r,n){var a=e.element,o=e.data,s=e.internalformat,l=e.format,c=e.type,u=e.width,h=e.height;z(e),a?t.texImage2D(r,n,l,l,c,a):e.compressed?t.compressedTexImage2D(r,n,s,u,h,0,o):e.needsCopy?(i(),t.copyTexImage2D(r,n,l,e.xOffset,e.yOffset,u,h,0)):t.texImage2D(r,n,l,u,h,0,l,c,o||null)}function F(e,r,n,a,o){var s=e.element,l=e.data,c=e.internalformat,u=e.format,h=e.type,f=e.width,p=e.height;z(e),s?t.texSubImage2D(r,o,n,a,u,h,s):e.compressed?t.compressedTexSubImage2D(r,o,n,a,c,f,p,l):e.needsCopy?(i(),t.copyTexSubImage2D(r,o,n,a,e.xOffset,e.yOffset,f,p)):t.texSubImage2D(r,o,n,a,f,p,u,h,l)}var B=[];function j(){return B.pop()||new D}function N(e){e.needsFree&&d.freeType(e.data),D.call(e),B.push(e)}function U(){I.call(this),this.genMipmaps=!1,this.mipmapHint=ye,this.mipmask=0,this.images=Array(16)}function V(e,t,r){var n=e.images[0]=j();e.mipmask=1,n.width=e.width=t,n.height=e.height=r,n.channels=e.channels=4}function q(e,t){var r=null;if(Fe(t))L(r=e.images[0]=j(),e),O(r,t),e.mipmask=1;else if(P(e,t),Array.isArray(t.mipmap))for(var n=t.mipmap,i=0;i<n.length;++i)L(r=e.images[i]=j(),e),r.width>>=i,r.height>>=i,O(r,n[i]),e.mipmask|=1<<i;else L(r=e.images[0]=j(),e),O(r,t),e.mipmask=1;L(e,e.images[0]),e.compressed&&(e.internalformat===oe||e.internalformat===se||e.internalformat===le||e.internalformat)}function we(e,t){for(var r=e.images,n=0;n<r.length;++n){if(!r[n])return;R(r[n],t,n)}}var Te=[];function ke(){var e=Te.pop()||new U;I.call(e),e.mipmask=0;for(var t=0;t<16;++t)e.images[t]=null;return e}function Ce(e){for(var t=e.images,r=0;r<t.length;++r)t[r]&&N(t[r]),t[r]=null;Te.push(e)}function Ie(){this.minFilter=de,this.magFilter=de,this.wrapS=pe,this.wrapT=pe,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=ye}function Le(e,t){if("min"in t){var r=t.min;e.minFilter=h[r],xe.indexOf(e.minFilter)>=0&&!("faces"in t)&&(e.genMipmaps=!0)}if("mag"in t){var n=t.mag;e.magFilter=u[n]}var i=e.wrapS,a=e.wrapT;if("wrap"in t){var o=t.wrap;"string"==typeof o?i=a=c[o]:Array.isArray(o)&&(i=c[o[0]],a=c[o[1]])}else{if("wrapS"in t){var s=t.wrapS;i=c[s]}if("wrapT"in t){var f=t.wrapT;a=c[f]}}if(e.wrapS=i,e.wrapT=a,"anisotropic"in t&&(t.anisotropic,e.anisotropic=t.anisotropic),"mipmap"in t){var p=!1;switch(typeof t.mipmap){case"string":e.mipmapHint=l[t.mipmap],e.genMipmaps=!0,p=!0;break;case"boolean":p=e.genMipmaps=t.mipmap;break;case"object":e.genMipmaps=!1,p=!0}p&&!("min"in t)&&(e.minFilter=me)}}function Ve(e,n){t.texParameteri(n,10241,e.minFilter),t.texParameteri(n,10240,e.magFilter),t.texParameteri(n,10242,e.wrapS),t.texParameteri(n,10243,e.wrapT),r.ext_texture_filter_anisotropic&&t.texParameteri(n,34046,e.anisotropic),e.genMipmaps&&(t.hint(33170,e.mipmapHint),t.generateMipmap(n))}var qe=0,He={},Ge=n.maxTextureUnits,We=Array(Ge).map((function(){return null}));function Ze(e){I.call(this),this.mipmask=0,this.internalformat=X,this.id=qe++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Ie,s.profile&&(this.stats={size:0})}function Ye(e){t.activeTexture(ve),t.bindTexture(e.target,e.texture)}function Xe(){var e=We[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(W,null)}function $e(e){var r=e.texture,n=e.unit,i=e.target;n>=0&&(t.activeTexture(ve+n),t.bindTexture(i,null),We[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete He[e.id],o.textureCount--}return e(Ze.prototype,{bind:function(){var e=this;e.bindCount+=1;var r=e.unit;if(r<0){for(var n=0;n<Ge;++n){var i=We[n];if(i){if(i.bindCount>0)continue;i.unit=-1}We[n]=e,r=n;break}s.profile&&o.maxTextureUnits<r+1&&(o.maxTextureUnits=r+1),e.unit=r,t.activeTexture(ve+r),t.bindTexture(e.target,e.texture)}return r},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&$e(this)}}),s.profile&&(o.getTotalTextureSize=function(){var e=0;return Object.keys(He).forEach((function(t){e+=He[t].stats.size})),e}),{create2D:function(e,r){var n=new Ze(W);function i(e,t){var r=n.texInfo;Ie.call(r);var a=ke();return"number"==typeof e?V(a,0|e,"number"==typeof t?0|t:0|e):e?(Le(r,e),q(a,e)):V(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),n.mipmask=a.mipmask,L(n,a),n.internalformat=a.internalformat,i.width=a.width,i.height=a.height,Ye(n),we(a,W),Ve(r,W),Xe(),Ce(a),s.profile&&(n.stats.size=Ue(n.internalformat,n.type,a.width,a.height,r.genMipmaps,!1)),i.format=k[n.internalformat],i.type=A[n.type],i.mag=M[r.magFilter],i.min=S[r.minFilter],i.wrapS=E[r.wrapS],i.wrapT=E[r.wrapT],i}return He[n.id]=n,o.textureCount++,i(e,r),i.subimage=function(e,t,r,a){var o=0|t,s=0|r,l=0|a,c=j();return L(c,n),c.width=0,c.height=0,O(c,e),c.width=c.width||(n.width>>l)-o,c.height=c.height||(n.height>>l)-s,Ye(n),F(c,W,o,s,l),Xe(),N(c),i},i.resize=function(e,r){var a=0|e,o=0|r||a;if(a===n.width&&o===n.height)return i;i.width=n.width=a,i.height=n.height=o,Ye(n);for(var l=0;n.mipmask>>l;++l){var c=a>>l,u=o>>l;if(!c||!u)break;t.texImage2D(W,l,n.format,c,u,0,n.format,n.type,null)}return Xe(),s.profile&&(n.stats.size=Ue(n.internalformat,n.type,a,o,!1,!1)),i},i._reglType="texture2d",i._texture=n,s.profile&&(i.stats=n.stats),i.destroy=function(){n.decRef()},i},createCube:function(e,r,n,i,a,l){var c=new Ze(Z);He[c.id]=c,o.cubeCount++;var u=new Array(6);function h(e,t,r,n,i,a){var o,l=c.texInfo;for(Ie.call(l),o=0;o<6;++o)u[o]=ke();if("number"!=typeof e&&e){if("object"==typeof e)if(t)q(u[0],e),q(u[1],t),q(u[2],r),q(u[3],n),q(u[4],i),q(u[5],a);else if(Le(l,e),P(c,e),"faces"in e){var f=e.faces;for(o=0;o<6;++o)L(u[o],c),q(u[o],f[o])}else for(o=0;o<6;++o)q(u[o],e)}else{var p=0|e||1;for(o=0;o<6;++o)V(u[o],p,p)}for(L(c,u[0]),l.genMipmaps?c.mipmask=(u[0].width<<1)-1:c.mipmask=u[0].mipmask,c.internalformat=u[0].internalformat,h.width=u[0].width,h.height=u[0].height,Ye(c),o=0;o<6;++o)we(u[o],Y+o);for(Ve(l,Z),Xe(),s.profile&&(c.stats.size=Ue(c.internalformat,c.type,h.width,h.height,l.genMipmaps,!0)),h.format=k[c.internalformat],h.type=A[c.type],h.mag=M[l.magFilter],h.min=S[l.minFilter],h.wrapS=E[l.wrapS],h.wrapT=E[l.wrapT],o=0;o<6;++o)Ce(u[o]);return h}return h(e,r,n,i,a,l),h.subimage=function(e,t,r,n,i){var a=0|r,o=0|n,s=0|i,l=j();return L(l,c),l.width=0,l.height=0,O(l,t),l.width=l.width||(c.width>>s)-a,l.height=l.height||(c.height>>s)-o,Ye(c),F(l,Y+e,a,o,s),Xe(),N(l),h},h.resize=function(e){var r=0|e;if(r!==c.width){h.width=c.width=r,h.height=c.height=r,Ye(c);for(var n=0;n<6;++n)for(var i=0;c.mipmask>>i;++i)t.texImage2D(Y+n,i,c.format,r>>i,r>>i,0,c.format,c.type,null);return Xe(),s.profile&&(c.stats.size=Ue(c.internalformat,c.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=c,s.profile&&(h.stats=c.stats),h.destroy=function(){c.decRef()},h},clear:function(){for(var e=0;e<Ge;++e)t.activeTexture(ve+e),t.bindTexture(W,null),We[e]=null;b(He).forEach($e),o.cubeCount=0,o.textureCount=0},getTexture:function(e){return null},restore:function(){for(var e=0;e<Ge;++e){var r=We[e];r&&(r.bindCount=0,r.unit=-1,We[e]=null)}b(He).forEach((function(e){e.texture=t.createTexture(),t.bindTexture(e.target,e.texture);for(var r=0;r<32;++r)if(e.mipmask&1<<r)if(e.target===W)t.texImage2D(W,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)t.texImage2D(Y+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);Ve(e.texInfo,e.target)}))},refresh:function(){for(var e=0;e<Ge;++e){var r=We[e];r&&(r.bindCount=0,r.unit=-1,We[e]=null),t.activeTexture(ve+e),t.bindTexture(W,null),t.bindTexture(Z,null)}}}}(n,k,ke,(function(){rt.procs.poll()}),we,f,r),et=function(e,t,r,n,i){var a={rgba4:qe,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};t.ext_srgb&&(a.srgba=35907),t.ext_color_buffer_half_float&&(a.rgba16f=34842,a.rgb16f=34843),t.webgl_color_buffer_float&&(a.rgba32f=34836);var o=[];Object.keys(a).forEach((function(e){var t=a[e];o[t]=e}));var s=0,l={};function c(e){this.id=s++,this.refCount=1,this.renderbuffer=e,this.format=qe,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function u(t){var r=t.renderbuffer;e.bindRenderbuffer(Ve,null),e.deleteRenderbuffer(r),t.renderbuffer=null,t.refCount=0,delete l[t.id],n.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&u(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var e=0;return Object.keys(l).forEach((function(t){e+=l[t].stats.size})),e}),{create:function(t,r){var s=new c(e.createRenderbuffer());function u(t,r){var n=0,l=0,c=qe;if("object"==typeof t&&t){var h=t;if("shape"in h){var f=h.shape;n=0|f[0],l=0|f[1]}else"radius"in h&&(n=l=0|h.radius),"width"in h&&(n=0|h.width),"height"in h&&(l=0|h.height);"format"in h&&(c=a[h.format])}else"number"==typeof t?(n=0|t,l="number"==typeof r?0|r:n):t||(n=l=1);if(n!==s.width||l!==s.height||c!==s.format)return u.width=s.width=n,u.height=s.height=l,s.format=c,e.bindRenderbuffer(Ve,s.renderbuffer),e.renderbufferStorage(Ve,c,n,l),i.profile&&(s.stats.size=Ge(s.format,s.width,s.height)),u.format=o[s.format],u}return l[s.id]=s,n.renderbufferCount++,u(t,r),u.resize=function(t,r){var n=0|t,a=0|r||n;return n===s.width&&a===s.height||(u.width=s.width=n,u.height=s.height=a,e.bindRenderbuffer(Ve,s.renderbuffer),e.renderbufferStorage(Ve,s.format,n,a),i.profile&&(s.stats.size=Ge(s.format,s.width,s.height))),u},u._reglType="renderbuffer",u._renderbuffer=s,i.profile&&(u.stats=s.stats),u.destroy=function(){s.decRef()},u},clear:function(){b(l).forEach(u)},restore:function(){b(l).forEach((function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(Ve,t.renderbuffer),e.renderbufferStorage(Ve,t.format,t.width,t.height)})),e.bindRenderbuffer(Ve,null)}}}(n,k,0,f,r),tt=function(t,r,n,i,a,o){var s={cur:null,next:null,dirty:!1,setFBO:null},l=["rgba"],c=["rgba4","rgb565","rgb5 a1"];r.ext_srgb&&c.push("srgba"),r.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),r.webgl_color_buffer_float&&c.push("rgba32f");var u=["uint8"];function h(e,t,r){this.target=e,this.texture=t,this.renderbuffer=r;var n=0,i=0;t?(n=t.width,i=t.height):r&&(n=r.width,i=r.height),this.width=n,this.height=i}function f(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function p(e,t,r){if(e)if(e.texture){var n=e.texture._texture;Math.max(1,n.width),Math.max(1,n.height),n.refCount+=1}else e.renderbuffer._renderbuffer.refCount+=1}function d(e,r){r&&(r.texture?t.framebufferTexture2D(We,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(We,e,Ze,r.renderbuffer._renderbuffer.renderbuffer))}function m(e){var t=Ye,r=null,n=null,i=e;"object"==typeof e&&(i=e.data,"target"in e&&(t=0|e.target));var a=i._reglType;return"texture2d"===a||"textureCube"===a?r=i:"renderbuffer"===a&&(n=i,t=Ze),new h(t,r,n)}function g(e,t,r,n,o){if(r){var s=i.create2D({width:e,height:t,format:n,type:o});return s._texture.refCount=0,new h(Ye,s,null)}var l=a.create({width:e,height:t,format:n});return l._renderbuffer.refCount=0,new h(Ze,null,l)}function y(e){return e&&(e.texture||e.renderbuffer)}function v(e,t,r){e&&(e.texture?e.texture.resize(t,r):e.renderbuffer&&e.renderbuffer.resize(t,r),e.width=t,e.height=r)}r.oes_texture_half_float&&u.push("half float","float16"),r.oes_texture_float&&u.push("float","float32");var x=0,_={};function w(){this.id=x++,_[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 T(e){e.colorAttachments.forEach(f),f(e.depthAttachment),f(e.stencilAttachment),f(e.depthStencilAttachment)}function k(e){var r=e.framebuffer;t.deleteFramebuffer(r),e.framebuffer=null,o.framebufferCount--,delete _[e.id]}function A(e){var r;t.bindFramebuffer(We,e.framebuffer);var i=e.colorAttachments;for(r=0;r<i.length;++r)d(36064+r,i[r]);for(r=i.length;r<n.maxColorAttachments;++r)t.framebufferTexture2D(We,36064+r,Ye,null,0);t.framebufferTexture2D(We,33306,Ye,null,0),t.framebufferTexture2D(We,36096,Ye,null,0),t.framebufferTexture2D(We,36128,Ye,null,0),d(36096,e.depthAttachment),d(36128,e.stencilAttachment),d(33306,e.depthStencilAttachment),t.checkFramebufferStatus(We),t.isContextLost(),t.bindFramebuffer(We,s.next?s.next.framebuffer:null),s.cur=s.next,t.getError()}function M(t,r){var n=new w;function i(e,t){var r,a=0,o=0,s=!0,u=!0,h=null,f=!0,d="rgba",v="uint8",x=1,_=null,b=null,w=null,k=!1;if("number"==typeof e)a=0|e,o=0|t||a;else if(e){var M=e;if("shape"in M){var S=M.shape;a=S[0],o=S[1]}else"radius"in M&&(a=o=M.radius),"width"in M&&(a=M.width),"height"in M&&(o=M.height);("color"in M||"colors"in M)&&(h=M.color||M.colors,Array.isArray(h)),h||("colorCount"in M&&(x=0|M.colorCount),"colorTexture"in M&&(f=!!M.colorTexture,d="rgba4"),"colorType"in M&&(v=M.colorType,f||("half float"===v||"float16"===v?d="rgba16f":("float"===v||"float32"===v)&&(d="rgba32f"))),"colorFormat"in M&&(d=M.colorFormat,l.indexOf(d)>=0?f=!0:c.indexOf(d)>=0&&(f=!1))),("depthTexture"in M||"depthStencilTexture"in M)&&(k=!(!M.depthTexture&&!M.depthStencilTexture)),"depth"in M&&("boolean"==typeof M.depth?s=M.depth:(_=M.depth,u=!1)),"stencil"in M&&("boolean"==typeof M.stencil?u=M.stencil:(b=M.stencil,s=!1)),"depthStencil"in M&&("boolean"==typeof M.depthStencil?s=u=M.depthStencil:(w=M.depthStencil,s=!1,u=!1))}else a=o=1;var E=null,C=null,I=null,L=null;if(Array.isArray(h))E=h.map(m);else if(h)E=[m(h)];else for(E=new Array(x),r=0;r<x;++r)E[r]=g(a,o,f,d,v);a=a||E[0].width,o=o||E[0].height,_?C=m(_):s&&!u&&(C=g(a,o,k,"depth","uint32")),b?I=m(b):u&&!s&&(I=g(a,o,!1,"stencil","uint8")),w?L=m(w):!_&&!b&&u&&s&&(L=g(a,o,k,"depth stencil","depth stencil"));var P=null;for(r=0;r<E.length;++r)if(p(E[r]),E[r]&&E[r].texture){var z=Xe[E[r].texture._texture.format]*$e[E[r].texture._texture.type];null===P&&(P=z)}return p(C),p(I),p(L),T(n),n.width=a,n.height=o,n.colorAttachments=E,n.depthAttachment=C,n.stencilAttachment=I,n.depthStencilAttachment=L,i.color=E.map(y),i.depth=y(C),i.stencil=y(I),i.depthStencil=y(L),i.width=n.width,i.height=n.height,A(n),i}return o.framebufferCount++,i(t,r),e(i,{resize:function(e,t){var r=Math.max(0|e,1),a=Math.max(0|t||r,1);if(r===n.width&&a===n.height)return i;for(var o=n.colorAttachments,s=0;s<o.length;++s)v(o[s],r,a);return v(n.depthAttachment,r,a),v(n.stencilAttachment,r,a),v(n.depthStencilAttachment,r,a),n.width=i.width=r,n.height=i.height=a,A(n),i},_reglType:"framebuffer",_framebuffer:n,destroy:function(){k(n),T(n)},use:function(e){s.setFBO({framebuffer:i},e)}})}return e(s,{getFramebuffer:function(e){if("function"==typeof e&&"framebuffer"===e._reglType){var t=e._framebuffer;if(t instanceof w)return t}return null},create:M,createCube:function(t){var r=Array(6);function n(t){var a,o,s={color:null},l=0,c=null,u="rgba",h="uint8",f=1;if("number"==typeof t)l=0|t;else if(t){var p=t;"shape"in p?l=p.shape[0]:("radius"in p&&(l=0|p.radius),"width"in p?l=0|p.width:"height"in p&&(l=0|p.height)),("color"in p||"colors"in p)&&(c=p.color||p.colors,Array.isArray(c)),c||("colorCount"in p&&(f=0|p.colorCount),"colorType"in p&&(h=p.colorType),"colorFormat"in p&&(u=p.colorFormat)),"depth"in p&&(s.depth=p.depth),"stencil"in p&&(s.stencil=p.stencil),"depthStencil"in p&&(s.depthStencil=p.depthStencil)}else l=1;if(c)if(Array.isArray(c))for(o=[],a=0;a<c.length;++a)o[a]=c[a];else o=[c];else{o=Array(f);var d={radius:l,format:u,type:h};for(a=0;a<f;++a)o[a]=i.createCube(d)}for(s.color=Array(o.length),a=0;a<o.length;++a){var m=o[a];l=l||m.width,s.color[a]={target:34069,data:o[a]}}for(a=0;a<6;++a){for(var g=0;g<o.length;++g)s.color[g].target=34069+a;a>0&&(s.depth=r[0].depth,s.stencil=r[0].stencil,s.depthStencil=r[0].depthStencil),r[a]?r[a](s):r[a]=M(s)}return e(n,{width:l,height:l,color:o})}return n(t),e(n,{faces:r,resize:function(e){var t,i=0|e;if(i===n.width)return n;var a=n.color;for(t=0;t<a.length;++t)a[t].resize(i);for(t=0;t<6;++t)r[t].resize(i);return n.width=n.height=i,n},_reglType:"framebufferCube",destroy:function(){r.forEach((function(e){e.destroy()}))}})},clear:function(){b(_).forEach(k)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,b(_).forEach((function(e){e.framebuffer=t.createFramebuffer(),A(e)}))}})}(n,k,ke,Qe,et,f),rt=Fr(n,h,k,ke,Ce,Ie,0,tt,{},Le,He,Te,we,A,p,r),nt=function(e,t,r,n){function i(i){var a;a=null===t.next?5121:t.next.colorAttachments[0].texture._texture.type;var o=0,s=0,l=n.framebufferWidth,c=n.framebufferHeight,u=null;x(i)?u=i:i&&(o=0|i.x,s=0|i.y,l=0|(i.width||n.framebufferWidth-o),c=0|(i.height||n.framebufferHeight-s),u=i.data||null),r();var h=l*c*4;return u||(5121===a?u=new Uint8Array(h):5126===a&&(u=u||new Float32Array(h))),e.pixelStorei(3333,4),e.readPixels(o,s,l,c,6408,a,u),u}return function(e){return e&&"framebuffer"in e?function(e){var r;return t.setFBO({framebuffer:e.framebuffer},(function(){r=i(e)})),r}(e):i(e)}}(n,tt,rt.procs.poll,we),it=rt.next,at=n.canvas,ot=[],st=[],lt=[],ct=[r.onDestroy],ut=null;function ht(){if(0===ot.length)return A&&A.update(),void(ut=null);ut=s.next(ht),bt();for(var e=ot.length-1;e>=0;--e){var t=ot[e];t&&t(we,null,0)}n.flush(),A&&A.update()}function ft(){!ut&&ot.length>0&&(ut=s.next(ht))}function pt(){ut&&(s.cancel(ht),ut=null)}function dt(e){e.preventDefault(),pt(),st.forEach((function(e){e()}))}function mt(e){n.getError(),a.restore(),He.restore(),Ce.restore(),Qe.restore(),et.restore(),tt.restore(),Le.restore(),A&&A.restore(),rt.procs.refresh(),ft(),lt.forEach((function(e){e()}))}function gt(t){function r(e,t){var r={},n={};return Object.keys(e).forEach((function(i){var a=e[i];if(o.isDynamic(a))n[i]=o.unbox(a,i);else{if(t&&Array.isArray(a))for(var s=0;s<a.length;++s)if(o.isDynamic(a[s]))return void(n[i]=o.unbox(a,i));r[i]=a}})),{dynamic:n,static:r}}var n=r(t.context||{},!0),i=r(t.uniforms||{},!0),a=r(t.attributes||{},!1),s=r(function(t){var r=e({},t);function n(e){if(e in r){var t=r[e];delete r[e],Object.keys(t).forEach((function(n){r[e+"."+n]=t[n]}))}}return delete r.uniforms,delete r.attributes,delete r.context,delete r.vao,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),n("blend"),n("depth"),n("cull"),n("stencil"),n("polygonOffset"),n("scissor"),n("sample"),"vao"in t&&(r.vao=t.vao),r}(t),!1),l={gpuTime:0,cpuTime:0,count:0},c=rt.compile(s,a,i,n,l),u=c.draw,h=c.batch,f=c.scope,p=[];return e((function(e,t){var r;if("function"==typeof e)return f.call(this,null,e,0);if("function"==typeof t)if("number"==typeof e)for(r=0;r<e;++r)f.call(this,null,t,r);else{if(!Array.isArray(e))return f.call(this,e,t,0);for(r=0;r<e.length;++r)f.call(this,e[r],t,r)}else if("number"==typeof e){if(e>0)return h.call(this,function(e){for(;p.length<e;)p.push(null);return p}(0|e),0|e)}else{if(!Array.isArray(e))return u.call(this,e);if(e.length)return h.call(this,e,e.length)}}),{stats:l,destroy:function(){c.destroy()}})}at&&(at.addEventListener(Br,dt,!1),at.addEventListener(jr,mt,!1));var yt=tt.setFBO=gt({framebuffer:o.define.call(null,1,"framebuffer")});function vt(e,t){var r=0;rt.procs.poll();var i=t.color;i&&(n.clearColor(+i[0]||0,+i[1]||0,+i[2]||0,+i[3]||0),r|=16384),"depth"in t&&(n.clearDepth(+t.depth),r|=256),"stencil"in t&&(n.clearStencil(0|t.stencil),r|=1024),n.clear(r)}function xt(e){return ot.push(e),ft(),{cancel:function(){var t=Nr(ot,e);ot[t]=function e(){var t=Nr(ot,e);ot[t]=ot[ot.length-1],ot.length-=1,ot.length<=0&&pt()}}}}function _t(){var e=it.viewport,t=it.scissor_box;e[0]=e[1]=t[0]=t[1]=0,we.viewportWidth=we.framebufferWidth=we.drawingBufferWidth=e[2]=t[2]=n.drawingBufferWidth,we.viewportHeight=we.framebufferHeight=we.drawingBufferHeight=e[3]=t[3]=n.drawingBufferHeight}function bt(){we.tick+=1,we.time=Tt(),_t(),rt.procs.poll()}function wt(){Qe.refresh(),_t(),rt.procs.refresh(),A&&A.update()}function Tt(){return(l()-M)/1e3}wt();var kt=e(gt,{clear:function(t){if("framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var r=0;r<6;++r)yt(e({framebuffer:t.framebuffer.faces[r]},t),vt);else yt(t,vt);else vt(0,t)},prop:o.define.bind(null,1),context:o.define.bind(null,2),this:o.define.bind(null,3),draw:gt({}),buffer:function(e){return Ce.create(e,34962,!1,!1)},elements:function(e){return Ie.create(e,!1)},texture:Qe.create2D,cube:Qe.createCube,renderbuffer:et.create,framebuffer:tt.create,framebufferCube:tt.createCube,vao:Le.createVAO,attributes:i,frame:xt,on:function(e,t){var r;switch(e){case"frame":return xt(t);case"lost":r=st;break;case"restore":r=lt;break;case"destroy":r=ct}return r.push(t),{cancel:function(){for(var e=0;e<r.length;++e)if(r[e]===t)return r[e]=r[r.length-1],void r.pop()}}},limits:ke,hasExtension:function(e){return ke.extensions.indexOf(e.toLowerCase())>=0},read:nt,destroy:function(){ot.length=0,pt(),at&&(at.removeEventListener(Br,dt),at.removeEventListener(jr,mt)),He.clear(),tt.clear(),et.clear(),Le.clear(),Qe.clear(),Ie.clear(),Ce.clear(),A&&A.clear(),ct.forEach((function(e){e()}))},_gl:n,_refresh:wt,poll:function(){bt(),A&&A.update()},now:Tt,stats:f,getCachedCode:function(){return p},preloadCachedCode:function(e){Object.entries(e).forEach((function(e){p[e[0]]=e[1]}))}});return r.onDone(null,kt),kt}},"object"==typeof e&&typeof t<"u"?t.exports=n():r.createREGL=n()}}),mx=m({"node_modules/gl-util/context.js"(e,t){var r=ty();function n(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"function"==typeof e.getContext&&"width"in e&&"height"in e}function a(){var e=document.createElement("canvas");return e.style.position="absolute",e.style.top=0,e.style.left=0,e}t.exports=function(e){if(e?"string"==typeof e&&(e={container:e}):e={},(e=i(e)||"string"==typeof(t=e).nodeName&&"function"==typeof t.appendChild&&"function"==typeof t.getBoundingClientRect?{container:e}:function(e){return"function"==typeof e.drawArrays||"function"==typeof e.drawElements}(e)?{gl:e}:r(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)).pixelRatio||(e.pixelRatio=window.pixelRatio||1),e.gl)return e.gl;var t;if(e.canvas&&(e.container=e.canvas.parentNode),e.container){if("string"==typeof e.container){var o=document.querySelector(e.container);if(!o)throw Error("Element "+e.container+" is not found");e.container=o}i(e.container)?(e.canvas=e.container,e.container=e.canvas.parentNode):e.canvas||(e.canvas=a(),e.container.appendChild(e.canvas),n(e))}else if(!e.canvas){if(!(typeof document<"u"))throw Error("Not DOM environment. Use headless-gl.");e.container=document.body||document.documentElement,e.canvas=a(),e.container.appendChild(e.canvas),n(e)}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}}}),gx=m({"node_modules/font-atlas/index.js"(e,t){var r=fx(),n=[32,126];t.exports=function(e){var t=(e=e||{}).shape?e.shape:e.canvas?[e.canvas.width,e.canvas.height]:[512,512],i=e.canvas||document.createElement("canvas"),a=e.font,o="number"==typeof e.step?[e.step,e.step]:e.step||[32,32],s=e.chars||n;if(a&&"string"!=typeof a&&(a=r(a)),Array.isArray(s)){if(2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1]){for(var l=[],c=s[0],u=0;c<=s[1];c++)l[u++]=String.fromCharCode(c);s=l}}else s=String(s).split("");t=t.slice(),i.width=t[0],i.height=t[1];var h=i.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,i.width,i.height),h.font=a,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";var f=o[0]/2,p=o[1]/2;for(c=0;c<s.length;c++)h.fillText(s[c],f,p),(f+=o[0])>t[0]-o[0]/2&&(f=o[0]/2,p+=o[1]);return i}}}),yx=m({"node_modules/bit-twiddle/twiddle.js"(e){function t(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(e){return(e>0)-(e<0)},e.abs=function(e){var t=e>>31;return(e^t)-t},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,r;return t=(e>65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>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 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},e.countTrailingZeros=t,e.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,1+((e|=e>>>8)|e>>>16)},e.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},e.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var r=new Array(256);(function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<<i&255}})(r),e.reverse=function(e){return r[255&e]<<24|r[e>>>8&255]<<16|r[e>>>16&255]<<8|r[e>>>24&255]},e.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},e.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},e.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},e.nextCombination=function(e){var r=e|e-1;return r+1|(~r&-~r)-1>>>t(e)+1}}}),vx=m({"node_modules/dup/dup.js"(e,t){function r(e,t,n){var i=0|e[n];if(i<=0)return[];var a,o=new Array(i);if(n===e.length-1)for(a=0;a<i;++a)o[a]=t;else for(a=0;a<i;++a)o[a]=r(e,t,n+1);return o}t.exports=function(e,t){switch(typeof t>"u"&&(t=0),typeof e){case"number":if(e>0)return function(e,t){var r,n;for(r=new Array(e),n=0;n<e;++n)r[n]=t;return r}(0|e,t);break;case"object":if("number"==typeof e.length)return r(e,t,0)}return[]}}}),xx=m({"node_modules/typedarray-pool/pool.js"(e){var t=yx(),r=vx(),n=Hl().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:r([32,0]),UINT16:r([32,0]),UINT32:r([32,0]),BIGUINT64:r([32,0]),INT8:r([32,0]),INT16:r([32,0]),INT32:r([32,0]),BIGINT64:r([32,0]),FLOAT:r([32,0]),DOUBLE:r([32,0]),DATA:r([32,0]),UINT8C:r([32,0]),BUFFER:r([32,0])});var i=typeof Uint8ClampedArray<"u",a=typeof BigUint64Array<"u",o=typeof BigInt64Array<"u",s=window.__TYPEDARRAY_POOL;s.UINT8C||(s.UINT8C=r([32,0])),s.BIGUINT64||(s.BIGUINT64=r([32,0])),s.BIGINT64||(s.BIGINT64=r([32,0])),s.BUFFER||(s.BUFFER=r([32,0]));var l=s.DATA,c=s.BUFFER;function u(e){if(e){var r=e.length||e.byteLength,n=t.log2(r);l[n].push(e)}}function h(e){e=t.nextPow2(e);var r=t.log2(e),n=l[r];return n.length>0?n.pop():new ArrayBuffer(e)}function f(e){return new Uint8Array(h(e),0,e)}function p(e){return new Uint16Array(h(2*e),0,e)}function d(e){return new Uint32Array(h(4*e),0,e)}function m(e){return new Int8Array(h(e),0,e)}function g(e){return new Int16Array(h(2*e),0,e)}function y(e){return new Int32Array(h(4*e),0,e)}function v(e){return new Float32Array(h(4*e),0,e)}function x(e){return new Float64Array(h(8*e),0,e)}function _(e){return i?new Uint8ClampedArray(h(e),0,e):f(e)}function b(e){return a?new BigUint64Array(h(8*e),0,e):null}function w(e){return o?new BigInt64Array(h(8*e),0,e):null}function T(e){return new DataView(h(e),0,e)}function k(e){e=t.nextPow2(e);var r=t.log2(e),i=c[r];return i.length>0?i.pop():new n(e)}e.free=function(e){if(n.isBuffer(e))c[t.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var r=e.length||e.byteLength,i=0|t.log2(r);l[i].push(e)}},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=function(e){u(e.buffer)},e.freeArrayBuffer=u,e.freeBuffer=function(e){c[t.log2(e.length)].push(e)},e.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return h(e);switch(t){case"uint8":return f(e);case"uint16":return p(e);case"uint32":return d(e);case"int8":return m(e);case"int16":return g(e);case"int32":return y(e);case"float":case"float32":return v(e);case"double":case"float64":return x(e);case"uint8_clamped":return _(e);case"bigint64":return w(e);case"biguint64":return b(e);case"buffer":return k(e);case"data":case"dataview":return T(e);default:return null}return null},e.mallocArrayBuffer=h,e.mallocUint8=f,e.mallocUint16=p,e.mallocUint32=d,e.mallocInt8=m,e.mallocInt16=g,e.mallocInt32=y,e.mallocFloat32=e.mallocFloat=v,e.mallocFloat64=e.mallocDouble=x,e.mallocUint8Clamped=_,e.mallocBigUint64=b,e.mallocBigInt64=w,e.mallocDataView=T,e.mallocBuffer=k,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,l[e].length=0,c[e].length=0}}}),_x=m({"node_modules/is-plain-obj/index.js"(e,t){var r=Object.prototype.toString;t.exports=function(e){var t;return"[object Object]"===r.call(e)&&(null===(t=Object.getPrototypeOf(e))||t===Object.getPrototypeOf({}))}}}),bx=m({"node_modules/parse-unit/index.js"(e,t){t.exports=function(e,t){t||(t=[0,""]),e=String(e);var r=parseFloat(e,10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}}}),wx=m({"node_modules/to-px/topx.js"(e,t){var r=bx();function n(e,t){var n=r(getComputedStyle(e).getPropertyValue(t));return n[0]*i(n[1],e)}function i(e,t){switch(t=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 function(e,t){var r=document.createElement("div");r.style["font-size"]="128"+e,t.appendChild(r);var i=n(r,"font-size")/128;return t.removeChild(r),i}(e,t);case"em":return n(t,"font-size");case"rem":return n(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 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}t.exports=i}}),Tx=m({"node_modules/detect-kerning/index.js"(e,t){t.exports=i;var r=(i.canvas=document.createElement("canvas")).getContext("2d"),n=a([32,126]);function i(e,t){Array.isArray(e)&&(e=e.join(", "));var i,o={},s=16,l=.05;t&&(2===t.length&&"number"==typeof t[0]?i=a(t):Array.isArray(t)?i=t:(t.o?i=a(t.o):t.pairs&&(i=t.pairs),t.fontSize&&(s=t.fontSize),null!=t.threshold&&(l=t.threshold))),i||(i=n),r.font=s+"px "+e;for(var c=0;c<i.length;c++){var u=i[c],h=r.measureText(u[0]).width+r.measureText(u[1]).width,f=r.measureText(u).width;if(Math.abs(h-f)>s*l){var p=(f-h)/s;o[u]=1e3*p}}return o}function a(e){for(var t=[],r=e[0];r<=e[1];r++)for(var n=String.fromCharCode(r),i=e[0];i<e[1];i++){var a=n+String.fromCharCode(i);t.push(a)}return t}i.createPairs=a,i.ascii=n}}),kx=m({"node_modules/font-measure/index.js"(e,t){function r(e,t){t||(t={}),("string"==typeof e||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,l=t.weight||t.fontWeight||"",c=(e=[t.style||t.fontStyle||"",l,s].join(" ")+"px "+o,t.origin||"top");if(r.cache[o]&&s<=r.cache[o].em)return n(r.cache[o],c);var u=t.canvas||r.canvas,h=u.getContext("2d"),f={upper:void 0!==t.upper?t.upper:"H",lower:void 0!==t.lower?t.lower:"x",descent:void 0!==t.descent?t.descent:"p",ascent:void 0!==t.ascent?t.ascent:"h",tittle:void 0!==t.tittle?t.tittle:"i",overshoot:void 0!==t.overshoot?t.overshoot:"O"},p=Math.ceil(1.5*s);u.height=p,u.width=.5*p,h.font=e;var d="H",m={top:0};h.clearRect(0,0,p,p),h.textBaseline="top",h.fillStyle="black",h.fillText(d,0,0);var g=i(h.getImageData(0,0,p,p));h.clearRect(0,0,p,p),h.textBaseline="bottom",h.fillText(d,0,p);var y=i(h.getImageData(0,0,p,p));m.lineHeight=m.bottom=p-y+g,h.clearRect(0,0,p,p),h.textBaseline="alphabetic",h.fillText(d,0,p);var v=p-i(h.getImageData(0,0,p,p))-1+g;m.baseline=m.alphabetic=v,h.clearRect(0,0,p,p),h.textBaseline="middle",h.fillText(d,0,.5*p);var x=i(h.getImageData(0,0,p,p));m.median=m.middle=p-x-1+g-.5*p,h.clearRect(0,0,p,p),h.textBaseline="hanging",h.fillText(d,0,.5*p);var _=i(h.getImageData(0,0,p,p));m.hanging=p-_-1+g-.5*p,h.clearRect(0,0,p,p),h.textBaseline="ideographic",h.fillText(d,0,p);var b=i(h.getImageData(0,0,p,p));if(m.ideographic=p-b-1+g,f.upper&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.upper,0,0),m.upper=i(h.getImageData(0,0,p,p)),m.capHeight=m.baseline-m.upper),f.lower&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.lower,0,0),m.lower=i(h.getImageData(0,0,p,p)),m.xHeight=m.baseline-m.lower),f.tittle&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.tittle,0,0),m.tittle=i(h.getImageData(0,0,p,p))),f.ascent&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.ascent,0,0),m.ascent=i(h.getImageData(0,0,p,p))),f.descent&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.descent,0,0),m.descent=a(h.getImageData(0,0,p,p))),f.overshoot){h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.overshoot,0,0);var w=a(h.getImageData(0,0,p,p));m.overshoot=w-v}for(var T in m)m[T]/=s;return m.em=s,r.cache[o]=m,n(m,c)}function n(e,t){var r={};for(var n in"string"==typeof t&&(t=e[t]),e)"em"!==n&&(r[n]=e[n]-t);return r}function i(e){for(var t=e.height,r=e.data,n=3;n<r.length;n+=4)if(0!==r[n])return Math.floor(.25*(n-3)/t)}function a(e){for(var t=e.height,r=e.data,n=r.length-1;n>0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/t)}t.exports=r,r.canvas=document.createElement("canvas"),r.cache={}}}),Ax=m({"node_modules/gl-text/dist.js"(e,t){var r=px(),n=ty(),i=dx(),a=mx(),o=Kv(),s=em(),l=gx(),c=xx(),u=ry(),h=_x(),f=bx(),p=wx(),d=Tx(),m=My(),g=kx(),y=ay(),v=yx().nextPow2,x=new o,_=!1;document.body&&((b=document.body.appendChild(document.createElement("div"))).style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(b).fontStretch&&(_=!0),document.body.removeChild(b));var b,w=function(e){var t;"function"==typeof(t=e)&&t._gl&&t.prop&&t.texture&&t.buffer?(e={regl:e},this.gl=e.regl._gl):this.gl=a(e),this.shader=x.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(),x.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(h(e)?e:{})};w.prototype.createShader=function(){var e=this.regl,t=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:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:e,draw:t,atlas:{}}},w.prototype.update=function(e){var t=this;if("string"==typeof e)e={text:e};else if(!e)return;null!=(e=n(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)).opacity&&(Array.isArray(e.opacity)?this.opacity=e.opacity.map((function(e){return parseFloat(e)})):this.opacity=parseFloat(e.opacity)),null!=e.viewport&&(this.viewport=u(e.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==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]),null!=e.kerning&&(this.kerning=e.kerning),null!=e.offset&&("number"==typeof e.offset&&(e.offset=[e.offset,0]),this.positionOffset=y(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||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!e.font&&(e.font=w.baseFontSize+"px sans-serif");var i,a=!1,o=!1;if(e.font&&(Array.isArray(e.font)?e.font:[e.font]).forEach((function(e,n){if("string"==typeof e)try{e=r.parse(e)}catch{e=r.parse(w.baseFontSize+"px "+e)}else{var i=e.style,s=e.weight,l=e.stretch,c=e.variant;e=r.parse(r.stringify(e)),i&&(e.style=i),s&&(e.weight=s),l&&(e.stretch=l),c&&(e.variant=c)}var u=r.stringify({size:w.baseFontSize,family:e.family,stretch:_?e.stretch:void 0,variant:e.variant,weight:e.weight,style:e.style}),h=f(e.size),d=Math.round(h[0]*p(h[1]));if(d!==t.fontSize[n]&&(o=!0,t.fontSize[n]=d),!(t.font[n]&&u==t.font[n].baseString||(a=!0,t.font[n]=w.fonts[u],t.font[n]))){var m=e.family.join(", "),y=[e.style];e.style!=e.variant&&y.push(e.variant),e.variant!=e.weight&&y.push(e.weight),_&&e.weight!=e.stretch&&y.push(e.stretch),t.font[n]={baseString:u,family:m,weight:e.weight,stretch:e.stretch,style:e.style,variant:e.variant,width:{},kerning:{},metrics:g(m,{origin:"top",fontSize:w.baseFontSize,fontStyle:y.join(" ")})},w.fonts[u]=t.font[n]}})),(a||o)&&this.font.forEach((function(n,i){var a=r.stringify({size:t.fontSize[i],family:n.family,stretch:_?n.stretch:void 0,variant:n.variant,weight:n.weight,style:n.style});if(t.fontAtlas[i]=t.shader.atlas[a],!t.fontAtlas[i]){var o=n.metrics;t.shader.atlas[a]=t.fontAtlas[i]={fontString:a,step:2*Math.ceil(t.fontSize[i]*o.bottom*.5),em:t.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:t.regl.texture()}}null==e.text&&(e.text=t.text)})),"string"==typeof e.text&&e.position&&e.position.length>2){for(var h=Array(.5*e.position.length),x=0;x<h.length;x++)h[x]=e.text;e.text=h}if(null!=e.text||a){if(this.textOffsets=[0],Array.isArray(e.text)){this.count=e.text[0].length,this.counts=[this.count];for(var b=1;b<e.text.length;b++)this.textOffsets[b]=this.textOffsets[b-1]+e.text[b-1].length,this.count+=e.text[b].length,this.counts.push(e.text[b].length);this.text=e.text.join("")}else this.text=e.text,this.count=this.text.length,this.counts=[this.count];i=[],this.font.forEach((function(e,r){w.atlasContext.font=e.baseString;for(var n=t.fontAtlas[r],a=0;a<t.text.length;a++){var o=t.text.charAt(a);if(null==n.ids[o]&&(n.ids[o]=n.chars.length,n.chars.push(o),i.push(o)),null==e.width[o]&&(e.width[o]=w.atlasContext.measureText(o).width/w.baseFontSize,t.kerning)){var s=[];for(var l in e.width)s.push(l+o,o+l);m(e.kerning,d(e.family,{pairs:s}))}}}))}if(e.position)if(e.position.length>2){for(var T=!e.position[0].length,k=c.mallocFloat(2*this.count),A=0,M=0;A<this.counts.length;A++){var S=this.counts[A];if(T)for(var E=0;E<S;E++)k[M++]=e.position[2*A],k[M++]=e.position[2*A+1];else for(var C=0;C<S;C++)k[M++]=e.position[A][0],k[M++]=e.position[A][1]}this.position.call?this.position({type:"float",data:k}):this.position=this.regl.buffer({type:"float",data:k}),c.freeFloat(k)}else this.position.destroy&&this.position.destroy(),this.position={constant:e.position};if(e.text||a){var I=c.mallocUint8(this.count),L=c.mallocFloat(2*this.count);this.textWidth=[];for(var P=0,z=0;P<this.counts.length;P++){for(var D=this.counts[P],O=this.font[P]||this.font[0],R=this.fontAtlas[P]||this.fontAtlas[0],F=0;F<D;F++){var B=this.text.charAt(z),j=this.text.charAt(z-1);if(I[z]=R.ids[B],L[2*z]=O.width[B],F){var N=L[2*z-2],U=L[2*z],V=L[2*z-1]+.5*N+.5*U;if(this.kerning){var q=O.kerning[j+B];q&&(V+=.001*q)}L[2*z+1]=V}else L[2*z+1]=.5*L[2*z];z++}this.textWidth.push(L.length?.5*L[2*z-2]+L[2*z-1]:0)}e.align||(e.align=this.align),this.charBuffer({data:I,type:"uint8",usage:"stream"}),this.sizeBuffer({data:L,type:"float",usage:"stream"}),c.freeUint8(I),c.freeFloat(L),i.length&&this.font.forEach((function(e,r){var n=t.fontAtlas[r],i=n.step,a=Math.floor(w.maxAtlasSize/i),o=Math.min(a,n.chars.length),s=Math.ceil(n.chars.length/o),c=v(o*i),u=v(s*i);n.width=c,n.height=u,n.rows=s,n.cols=o,n.em&&n.texture({data:l({canvas:w.atlasCanvas,font:n.fontString,chars:n.chars,shape:[c,u],step:[i,i]})})}))}if(e.align&&(this.align=e.align,this.alignOffset=this.textWidth.map((function(e,r){var n=Array.isArray(t.align)?t.align.length>1?t.align[r]:t.align[0]:t.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-e;case"center":case"centre":case"middle":return.5*-e}return 0}))),null==this.baseline&&null==e.baseline&&(e.baseline=0),null!=e.baseline&&(this.baseline=e.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(e,r){var n=(t.font[r]||t.font[0]).metrics,i=0;return i+=.5*n.bottom,-1*(i+="number"==typeof e?e-n.baseline:-n[e])}))),null!=e.color)if(e.color||(e.color="transparent"),"string"!=typeof e.color&&isNaN(e.color)){var H;if("number"==typeof e.color[0]&&e.color.length>this.counts.length){var G=e.color.length;H=c.mallocUint8(G);for(var W=(e.color.subarray||e.color.slice).bind(e.color),Z=0;Z<G;Z+=4)H.set(s(W(Z,Z+4),"uint8"),Z)}else{var Y=e.color.length;H=c.mallocUint8(4*Y);for(var X=0;X<Y;X++)H.set(s(e.color[X]||0,"uint8"),4*X)}this.color=H}else this.color=s(e.color,"uint8");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 $=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array($);for(var K=0;K<this.batch.length;K++)this.batch[K]={count:this.counts.length>1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+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=[]},w.prototype.destroy=function(){},w.prototype.kerning=!0,w.prototype.position={constant:new Float32Array(2)},w.prototype.translate=null,w.prototype.scale=null,w.prototype.font=null,w.prototype.text="",w.prototype.positionOffset=[0,0],w.prototype.opacity=1,w.prototype.color=new Uint8Array([0,0,0,255]),w.prototype.alignOffset=[0,0],w.maxAtlasSize=1024,w.atlasCanvas=document.createElement("canvas"),w.atlasContext=w.atlasCanvas.getContext("2d",{alpha:!1}),w.baseFontSize=64,w.fonts={},t.exports=w}}),Mx=m({"node_modules/@plotly/regl/dist/regl.unchecked.js"(e,t){var r,n;r=e,n=function(){var e=function(e,t){for(var r=Object.keys(t),n=0;n<r.length;++n)e[r[n]]=t[r[n]];return e},t=0;function r(e,r){this.id=t++,this.type=e,this.data=r}function n(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function i(e){if(0===e.length)return[];var t=e.charAt(0),r=e.charAt(e.length-1);if(e.length>1&&t===r&&('"'===t||"'"===t))return['"'+n(e.substr(1,e.length-2))+'"'];var a=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(a)return i(e.substr(0,a.index)).concat(i(a[1])).concat(i(e.substr(a.index+a[0].length)));var o=e.split(".");if(1===o.length)return['"'+n(e)+'"'];for(var s=[],l=0;l<o.length;++l)s=s.concat(i(o[l]));return s}function a(e){return"["+i(e).join("][")+"]"}var o={DynamicVariable:r,define:function(e,t){return new r(e,a(t+""))},isDynamic:function(e){return"function"==typeof e&&!e._reglType||e instanceof r},unbox:function e(t,n){return"function"==typeof t?new r(0,t):"number"==typeof t||"boolean"==typeof t?new r(5,t):Array.isArray(t)?new r(6,t.map((function(t,r){return e(t,n+"["+r+"]")}))):t instanceof r?t:void 0},accessor:a},s={next:"function"==typeof requestAnimationFrame?function(e){return requestAnimationFrame(e)}:function(e){return setTimeout(e,16)},cancel:"function"==typeof cancelAnimationFrame?function(e){return cancelAnimationFrame(e)}:clearTimeout},l=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function c(e){return"string"==typeof e?e.split():e}function u(e){return"string"==typeof e?document.querySelector(e):e}function h(e,t){for(var r=Array(e),n=0;n<e;++n)r[n]=t(n);return r}function f(e){var t,r;return t=(e>65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1}function p(){var e=h(8,(function(){return[]}));function t(t){var r=function(e){for(var t=16;t<=1<<28;t*=16)if(e<=t)return t;return 0}(t),n=e[f(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(t){e[f(t.byteLength)>>2].push(t)}return{alloc:t,free:r,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(e){r(e.buffer)}}}var d=p();d.zero=p();var m=3553,g=6408,y=5126,v=36160,x=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 _(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||x(e.data))}var b=function(e){return Object.keys(e).map((function(t){return e[t]}))},w=function(e){for(var t=[],r=e;r.length;r=r[0])t.push(r.length);return t},T=function(e,t,r,n){var i=1;if(t.length)for(var a=0;a<t.length;++a)i*=t[a];else i=0;var o=n||d.allocType(r,i);switch(t.length){case 0:break;case 1:!function(e,t,r){for(var n=0;n<t;++n)r[n]=e[n]}(e,t[0],o);break;case 2:!function(e,t,r,n){for(var i=0,a=0;a<t;++a)for(var o=e[a],s=0;s<r;++s)n[i++]=o[s]}(e,t[0],t[1],o);break;case 3:k(e,t[0],t[1],t[2],o,0);break;default:A(e,t,0,o,0)}return o};function k(e,t,r,n,i,a){for(var o=a,s=0;s<t;++s)for(var l=e[s],c=0;c<r;++c)for(var u=l[c],h=0;h<n;++h)i[o++]=u[h]}function A(e,t,r,n,i){for(var a=1,o=r+1;o<t.length;++o)a*=t[o];var s=t[r];if(t.length-r==4){var l=t[r+1],c=t[r+2],u=t[r+3];for(o=0;o<s;++o)k(e[o],l,c,u,n,i),i+=a}else for(o=0;o<s;++o)A(e[o],t,r+1,n,i),i+=a}var M={"[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},S={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},E={dynamic:35048,stream:35040,static:35044},C=T,I=w,L=5121,P=5126,z=[];function D(e){return 0|M[Object.prototype.toString.call(e)]}function O(e,t){for(var r=0;r<t.length;++r)e[r]=t[r]}function R(e,t,r,n,i,a,o){for(var s=0,l=0;l<r;++l)for(var c=0;c<n;++c)e[s++]=t[i*l+a*c+o]}z[5120]=1,z[5122]=2,z[5124]=4,z[5121]=1,z[5123]=2,z[5125]=4,z[5126]=4;var F={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},B=5121,j=5123,N=5125,U=34963,V=new Float32Array(1),q=new Uint32Array(V.buffer);function H(e){for(var t=d.allocType(5123,e.length),r=0;r<e.length;++r)if(isNaN(e[r]))t[r]=65535;else if(e[r]===1/0)t[r]=31744;else if(e[r]===-1/0)t[r]=64512;else{V[0]=e[r];var n=q[0],i=n>>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)t[r]=i;else if(a<-14){var s=-14-a;t[r]=i+(o+1024>>s)}else t[r]=a>15?i+31744:i+(a+15<<10)+o}return t}function G(e){return Array.isArray(e)||x(e)}var W=3553,Z=34067,Y=34069,X=6408,$=6406,K=6407,J=6409,Q=6410,ee=32855,te=6402,re=34041,ne=35904,ie=35906,ae=36193,oe=33776,se=33777,le=33778,ce=5121,ue=5123,he=5125,fe=5126,pe=33071,de=9728,me=9984,ge=9987,ye=4352,ve=33984,xe=[me,9986,9985,ge],_e=[0,J,Q,K,X],be={};function we(e){return"[object "+e+"]"}be[J]=be[$]=be[te]=1,be[re]=be[Q]=2,be[K]=be[ne]=3,be[X]=be[ie]=4;var Te=we("HTMLCanvasElement"),ke=we("OffscreenCanvas"),Ae=we("CanvasRenderingContext2D"),Me=we("ImageBitmap"),Se=we("HTMLImageElement"),Ee=we("HTMLVideoElement"),Ce=Object.keys(M).concat([Te,ke,Ae,Me,Se,Ee]),Ie=[];Ie[ce]=1,Ie[fe]=4,Ie[ae]=2,Ie[ue]=2,Ie[he]=4;var Le=[];function Pe(e){return Array.isArray(e)&&(0===e.length||"number"==typeof e[0])}function ze(e){return!!Array.isArray(e)&&!(0===e.length||!G(e[0]))}function De(e){return Object.prototype.toString.call(e)}function Oe(e){return De(e)===Te}function Re(e){return De(e)===ke}function Fe(e){if(!e)return!1;var t=De(e);return Ce.indexOf(t)>=0||Pe(e)||ze(e)||_(e)}function Be(e){return 0|M[Object.prototype.toString.call(e)]}function je(e,t){return d.allocType(e.type===ae?fe:e.type,t)}function Ne(e,t){e.type===ae?(e.data=H(t),d.freeType(t)):e.data=t}function Ue(e,t,r,n,i,a){var o;if(o=typeof Le[e]<"u"?Le[e]:be[e]*Ie[t],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}Le[32854]=2,Le[ee]=2,Le[36194]=2,Le[re]=4,Le[oe]=.5,Le[se]=.5,Le[le]=1,Le[33779]=1,Le[35986]=.5,Le[35987]=1,Le[34798]=1,Le[35840]=.5,Le[35841]=.25,Le[35842]=.5,Le[35843]=.25,Le[36196]=.5;var Ve=36161,qe=32854,He=[];function Ge(e,t,r){return He[e]*t*r}He[qe]=2,He[32855]=2,He[36194]=2,He[33189]=2,He[36168]=1,He[34041]=4,He[35907]=4,He[34836]=16,He[34842]=8,He[34843]=6;var We=36160,Ze=36161,Ye=3553,Xe=[];Xe[6408]=4,Xe[6407]=3;var $e=[];$e[5121]=1,$e[5126]=4,$e[36193]=2;var Ke=34963;function Je(){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=5126,this.offset=0,this.stride=0,this.divisor=0}function Qe(e){return function(e){for(var t,r="0123456789abcdef",n="",i=0;i<e.length;i++)t=e.charCodeAt(i),n+=r.charAt(t>>>4&15)+r.charAt(15&t);return n}(function(e){return function(e){for(var t="",r=0;r<32*e.length;r+=8)t+=String.fromCharCode(e[r>>5]>>>24-r%32&255);return t}(function(e,t){var r,n,i,a,o,s,l,c,u,h,f,p,d=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),m=new Array(64);for(e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t,u=0;u<e.length;u+=16){for(r=d[0],n=d[1],i=d[2],a=d[3],o=d[4],s=d[5],l=d[6],c=d[7],h=0;h<64;h++)m[h]=h<16?e[h+u]:ct(ct(ct(st(m[h-2]),m[h-7]),ot(m[h-15])),m[h-16]),f=ct(ct(ct(ct(c,at(o)),rt(o,s,l)),lt[h]),m[h]),p=ct(it(r),nt(r,n,i)),c=l,l=s,s=o,o=ct(a,f),a=i,i=n,n=r,r=ct(f,p);d[0]=ct(r,d[0]),d[1]=ct(n,d[1]),d[2]=ct(i,d[2]),d[3]=ct(a,d[3]),d[4]=ct(o,d[4]),d[5]=ct(s,d[5]),d[6]=ct(l,d[6]),d[7]=ct(c,d[7])}return d}(function(e){for(var t=Array(e.length>>2),r=0;r<t.length;r++)t[r]=0;for(r=0;r<8*e.length;r+=8)t[r>>5]|=(255&e.charCodeAt(r/8))<<24-r%32;return t}(e),8*e.length))}(function(e){for(var t,r,n="",i=-1;++i<e.length;)t=e.charCodeAt(i),r=i+1<e.length?e.charCodeAt(i+1):0,55296<=t&&t<=56319&&56320<=r&&r<=57343&&(t=65536+((1023&t)<<10)+(1023&r),i++),t<=127?n+=String.fromCharCode(t):t<=2047?n+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?n+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(n+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return n}(e)))}function et(e,t){return e>>>t|e<<32-t}function tt(e,t){return e>>>t}function rt(e,t,r){return e&t^~e&r}function nt(e,t,r){return e&t^e&r^t&r}function it(e){return et(e,2)^et(e,13)^et(e,22)}function at(e){return et(e,6)^et(e,11)^et(e,25)}function ot(e){return et(e,7)^et(e,18)^tt(e,3)}function st(e){return et(e,17)^et(e,19)^tt(e,10)}var lt=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function ct(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function ut(e){return Array.prototype.slice.call(e)}function ht(e){return ut(e).join("")}var ft="xyzw".split(""),pt="dither",dt="blend.enable",mt="blend.color",gt="blend.equation",yt="blend.func",vt="depth.enable",xt="depth.func",_t="depth.range",bt="depth.mask",wt="colorMask",Tt="cull.enable",kt="cull.face",At="frontFace",Mt="lineWidth",St="polygonOffset.enable",Et="polygonOffset.offset",Ct="sample.alpha",It="sample.enable",Lt="sample.coverage",Pt="stencil.enable",zt="stencil.mask",Dt="stencil.func",Ot="stencil.opFront",Rt="stencil.opBack",Ft="scissor.enable",Bt="scissor.box",jt="viewport",Nt="profile",Ut="framebuffer",Vt="vert",qt="frag",Ht="elements",Gt="primitive",Wt="count",Zt="offset",Yt="instances",Xt="vao",$t="Width",Kt="Height",Jt=Ut+$t,Qt=Ut+Kt,er=jt+$t,tr=jt+Kt,rr="drawingBuffer",nr=rr+$t,ir=rr+Kt,ar=[yt,gt,Dt,Ot,Rt,Lt,jt,Bt,Et],or=34962,sr=34963,lr=35664,cr=35665,ur=35666,hr=35667,fr=35668,pr=35669,dr=35671,mr=35672,gr=35673,yr=35674,vr=35675,xr=35676,_r=35678,br=35680,wr=1028,Tr=1029,kr=2305,Ar=7680,Mr={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},Sr={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},Er={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Cr={cw:2304,ccw:kr};function Ir(e){return Array.isArray(e)||x(e)||_(e)}function Lr(e){return e.sort((function(e,t){return e===jt?-1:t===jt?1:e<t?-1:1}))}function Pr(e,t,r,n){this.thisDep=e,this.contextDep=t,this.propDep=r,this.append=n}function zr(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function Dr(e){return new Pr(!1,!1,!1,e)}function Or(e,t){var r=e.type;if(0===r){var n=e.data.length;return new Pr(!0,n>=1,n>=2,t)}if(4===r){var i=e.data;return new Pr(i.thisDep,i.contextDep,i.propDep,t)}if(5===r)return new Pr(!1,!1,!1,t);if(6===r){for(var a=!1,o=!1,s=!1,l=0;l<e.data.length;++l){var c=e.data[l];if(1===c.type)s=!0;else if(2===c.type)o=!0;else if(3===c.type)a=!0;else if(0===c.type){a=!0;var u=c.data;u>=1&&(o=!0),u>=2&&(s=!0)}else 4===c.type&&(a=a||c.data.thisDep,o=o||c.data.contextDep,s=s||c.data.propDep)}return new Pr(a,o,s,t)}return new Pr(3===r,2===r,1===r,t)}var Rr=new Pr(!1,!1,!1,(function(){}));function Fr(t,r,n,i,a,s,l,c,u,f,p,d,m,g,y,v){var x=f.Record,_={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(_.min=32775,_.max=32776);var b=n.angle_instanced_arrays,w=n.webgl_draw_buffers,T=n.oes_vertex_array_object,k={dirty:!0,profile:v.profile},A={},M=[],E={},C={};function I(e){return e.replace(".","_")}function L(e,t,r){var n=I(e);M.push(e),A[n]=k[n]=!!r,E[n]=t}function P(e,t,r){var n=I(e);M.push(e),Array.isArray(r)?(k[n]=r.slice(),A[n]=r.slice()):k[n]=A[n]=r,C[n]=t}function z(e){return!!isNaN(e)}L(pt,3024),L(dt,3042),P(mt,"blendColor",[0,0,0,0]),P(gt,"blendEquationSeparate",[32774,32774]),P(yt,"blendFuncSeparate",[1,0,1,0]),L(vt,2929,!0),P(xt,"depthFunc",513),P(_t,"depthRange",[0,1]),P(bt,"depthMask",!0),P(wt,wt,[!0,!0,!0,!0]),L(Tt,2884),P(kt,"cullFace",Tr),P(At,At,kr),P(Mt,Mt,1),L(St,32823),P(Et,"polygonOffset",[0,0]),L(Ct,32926),L(It,32928),P(Lt,"sampleCoverage",[1,!1]),L(Pt,2960),P(zt,"stencilMask",-1),P(Dt,"stencilFunc",[519,0,-1]),P(Ot,"stencilOpSeparate",[wr,Ar,Ar,Ar]),P(Rt,"stencilOpSeparate",[Tr,Ar,Ar,Ar]),L(Ft,3089),P(Bt,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),P(jt,jt,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var D={gl:t,context:m,strings:r,next:A,current:k,draw:d,elements:s,buffer:a,shader:p,attributes:f.state,vao:f,uniforms:u,framebuffer:c,extensions:n,timer:g,isBufferArgs:Ir},O={primTypes:F,compareFuncs:Sr,blendFuncs:Mr,blendEquations:_,stencilOps:Er,glTypes:S,orientationType:Cr};w&&(O.backBuffer=[Tr],O.drawBuffer=h(i.maxDrawbuffers,(function(e){return 0===e?[0]:h(e,(function(e){return 36064+e}))})));var R=0;function B(){var t=function(t){var r=t&&t.cache,n=0,i=[],a=[],o=[];function s(){var t=[],r=[];return e((function(){t.push.apply(t,ut(arguments))}),{def:function(){var e="v"+n++;return r.push(e),arguments.length>0&&(t.push(e,"="),t.push.apply(t,ut(arguments)),t.push(";")),e},toString:function(){return ht([r.length>0?"var "+r.join(",")+";":"",ht(t)])}})}function l(){var t=s(),r=s(),n=t.toString,i=r.toString;function a(e,n){r(e,n,"=",t.def(e,n),";")}return e((function(){t.apply(t,ut(arguments))}),{def:t.def,entry:t,exit:r,save:a,set:function(e,r,n){a(e,r),t(e,r,"=",n,";")},toString:function(){return n()+i()}})}var c=s(),u={};return{global:c,link:function(e,t){var r=t&&t.stable;if(!r)for(var s=0;s<a.length;++s)if(a[s]===e&&!o[s])return i[s];var l="g"+n++;return i.push(l),a.push(e),o.push(r),l},block:s,proc:function(t,r){var n=[];function i(){var e="a"+n.length;return n.push(e),e}r=r||0;for(var a=0;a<r;++a)i();var o=l(),s=o.toString;return u[t]=e(o,{arg:i,toString:function(){return ht(["function(",n.join(),"){",s(),"}"])}})},scope:l,cond:function(){var t=ht(arguments),r=l(),n=l(),i=r.toString,a=n.toString;return e(r,{then:function(){return r.apply(r,ut(arguments)),this},else:function(){return n.apply(n,ut(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),ht(["if(",t,"){",i(),"}",e])}})},compile:function(){var e=['"use strict";',c,"return {"];Object.keys(u).forEach((function(t){e.push('"',t,'":',u[t].toString(),",")})),e.push("}");var t,n=ht(e).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");if(r&&(t=Qe(n),r[t]))return r[t].apply(null,a);var o=Function.apply(null,i.concat(n));return r&&(r[t]=o),o.apply(null,a)}}}({cache:y}),n=t.link,i=t.global;t.id=R++,t.batchId="0";var a=n(D),o=t.shared={props:"a0"};Object.keys(D).forEach((function(e){o[e]=i.def(a,".",e)}));var s=t.next={},l=t.current={};Object.keys(C).forEach((function(e){Array.isArray(k[e])&&(s[e]=i.def(o.next,".",e),l[e]=i.def(o.current,".",e))}));var c=t.constants={};Object.keys(O).forEach((function(e){c[e]=i.def(JSON.stringify(O[e]))})),t.invoke=function(e,r){switch(r.type){case 0:var i=["this",o.context,o.props,t.batchId];return e.def(n(r.data),".call(",i.slice(0,Math.max(r.data.length+1,4)),")");case 1:return e.def(o.props,r.data);case 2:return e.def(o.context,r.data);case 3:return e.def("this",r.data);case 4:return r.data.append(t,e),r.data.ref;case 5:return r.data.toString();case 6:return r.data.map((function(r){return t.invoke(e,r)}))}},t.attribCache={};var u={};return t.scopeAttrib=function(e){var t=r.id(e);if(t in u)return u[t];var i=f.scope[t];return i||(i=f.scope[t]=new x),u[t]=n(i)},t}function j(e,t,r){var n=e.shared.context,i=e.scope();Object.keys(r).forEach((function(a){t.save(n,"."+a);var o=r[a].append(e,t);Array.isArray(o)?i(n,".",a,"=[",o.join(),"];"):i(n,".",a,"=",o,";")})),t(i)}function N(e,t,r,n){var i,a=e.shared,o=a.gl,s=a.framebuffer;w&&(i=t.def(a.extensions,".webgl_draw_buffers"));var l,c=e.constants,u=c.drawBuffer,h=c.backBuffer;l=r?r.append(e,t):t.def(s,".next"),n||t("if(",l,"!==",s,".cur){"),t("if(",l,"){",o,".bindFramebuffer(",36160,",",l,".framebuffer);"),w&&t(i,".drawBuffersWEBGL(",u,"[",l,".colorAttachments.length]);"),t("}else{",o,".bindFramebuffer(",36160,",null);"),w&&t(i,".drawBuffersWEBGL(",h,");"),t("}",s,".cur=",l,";"),n||t("}")}function U(e,t,r){var n=e.shared,i=n.gl,a=e.current,o=e.next,s=n.current,l=n.next,c=e.cond(s,".dirty");M.forEach((function(t){var n,u,f=I(t);if(!(f in r.state))if(f in o){n=o[f],u=a[f];var p=h(k[f].length,(function(e){return c.def(n,"[",e,"]")}));c(e.cond(p.map((function(e,t){return e+"!=="+u+"["+t+"]"})).join("||")).then(i,".",C[f],"(",p,");",p.map((function(e,t){return u+"["+t+"]="+e})).join(";"),";"))}else{n=c.def(l,".",f);var d=e.cond(n,"!==",s,".",f);c(d),f in E?d(e.cond(n).then(i,".enable(",E[f],");").else(i,".disable(",E[f],");"),s,".",f,"=",n,";"):d(i,".",C[f],"(",n,");",s,".",f,"=",n,";")}})),0===Object.keys(r.state).length&&c(s,".dirty=false;"),t(c)}function V(e,t,r,n){var i,a=e.shared,o=e.current,s=a.current,l=a.gl;Lr(Object.keys(r)).forEach((function(a){var c=r[a];if(!n||n(c)){var u=c.append(e,t);if(E[a]){var h=E[a];zr(c)?(i=e.link(u,{stable:!0}),t(e.cond(i).then(l,".enable(",h,");").else(l,".disable(",h,");")),t(s,".",a,"=",i,";")):(t(e.cond(u).then(l,".enable(",h,");").else(l,".disable(",h,");")),t(s,".",a,"=",u,";"))}else if(G(u)){var f=o[a];t(l,".",C[a],"(",u,");",u.map((function(e,t){return f+"["+t+"]="+e})).join(";"),";")}else zr(c)?(i=e.link(u,{stable:!0}),t(l,".",C[a],"(",i,");",s,".",a,"=",i,";")):t(l,".",C[a],"(",u,");",s,".",a,"=",u,";")}}))}function q(e,t){b&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function H(e,t,r,n,i){var a,o,s,l=e.shared,c=e.stats,u=l.current,h=l.timer,f=r.profile;function p(){return typeof performance>"u"?"Date.now()":"performance.now()"}function d(e){e(a=t.def(),"=",p(),";"),"string"==typeof i?e(c,".count+=",i,";"):e(c,".count++;"),g&&(n?e(o=t.def(),"=",h,".getNumPendingQueries();"):e(h,".beginQuery(",c,");"))}function m(e){e(c,".cpuTime+=",p(),"-",a,";"),g&&(n?e(h,".pushScopeStats(",o,",",h,".getNumPendingQueries(),",c,");"):e(h,".endQuery();"))}function y(e){var r=t.def(u,".profile");t(u,".profile=",e,";"),t.exit(u,".profile=",r,";")}if(f){if(zr(f))return void(f.enable?(d(t),m(t.exit),y("true")):y("false"));y(s=f.append(e,t))}else s=t.def(u,".profile");var v=e.block();d(v),t("if(",s,"){",v,"}");var x=e.block();m(x),t.exit("if(",s,"){",x,"}")}function W(e,t,r,n,i){var a=e.shared;n.forEach((function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(e,t)}else{if(!i(Rr))return;var c=e.scopeAttrib(s);o={},Object.keys(new x).forEach((function(e){o[e]=t.def(c,".",e)}))}!function(r,n,i){var o=a.gl,s=t.def(r,".location"),l=t.def(a.attributes,"[",s,"]"),c=i.state,u=i.buffer,h=[i.x,i.y,i.z,i.w],f=["buffer","normalized","offset","stride"];function p(){t("if(!",l,".buffer){",o,".enableVertexAttribArray(",s,");}");var r,a=i.type;if(r=i.size?t.def(i.size,"||",n):n,t("if(",l,".type!==",a,"||",l,".size!==",r,"||",f.map((function(e){return l+"."+e+"!=="+i[e]})).join("||"),"){",o,".bindBuffer(",or,",",u,".buffer);",o,".vertexAttribPointer(",[s,r,a,i.normalized,i.stride,i.offset],");",l,".type=",a,";",l,".size=",r,";",f.map((function(e){return l+"."+e+"="+i[e]+";"})).join(""),"}"),b){var c=i.divisor;t("if(",l,".divisor!==",c,"){",e.instancing,".vertexAttribDivisorANGLE(",[s,c],");",l,".divisor=",c,";}")}}function d(){t("if(",l,".buffer){",o,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",ft.map((function(e,t){return l+"."+e+"!=="+h[t]})).join("||"),"){",o,".vertexAttrib4f(",s,",",h,");",ft.map((function(e,t){return l+"."+e+"="+h[t]+";"})).join(""),"}")}1===c?p():2===c?d():(t("if(",c,"===",1,"){"),p(),t("}else{"),d(),t("}"))}(e.link(n),function(e){switch(e){case lr:case hr:case dr:return 2;case cr:case fr:case mr:return 3;case ur:case pr:case gr:return 4;default:return 1}}(n.info.type),o)}))}function Z(e,t,n,i,a,o){for(var s,l=e.shared,c=l.gl,u=0;u<i.length;++u){var f,p=i[u],d=p.name,m=p.info.type,g=n.uniforms[d],y=e.link(p)+".location";if(g){if(!a(g))continue;if(zr(g)){var v=g.value;if(m===_r||m===br){var x=e.link(v._texture||v.color[0]._texture);t(c,".uniform1i(",y,",",x+".bind());"),t.exit(x,".unbind();")}else if(m===yr||m===vr||m===xr){var _=e.global.def("new Float32Array(["+Array.prototype.slice.call(v)+"])"),b=2;m===vr?b=3:m===xr&&(b=4),t(c,".uniformMatrix",b,"fv(",y,",false,",_,");")}else{switch(m){case 5126:s="1f";break;case lr:s="2f";break;case cr:s="3f";break;case ur:s="4f";break;case 35670:case 5124:s="1i";break;case dr:case hr:s="2i";break;case mr:case fr:s="3i";break;case gr:case pr:s="4i"}t(c,".uniform",s,"(",y,",",G(v)?Array.prototype.slice.call(v):v,");")}continue}f=g.append(e,t)}else{if(!a(Rr))continue;f=t.def(l.uniforms,"[",r.id(d),"]")}m===_r?t("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}"):m===br&&t("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}");var w=1;switch(m){case _r:case br:var T=t.def(f,"._texture");t(c,".uniform1i(",y,",",T,".bind());"),t.exit(T,".unbind();");continue;case 5124:case 35670:s="1i";break;case hr:case dr:s="2i",w=2;break;case fr:case mr:s="3i",w=3;break;case pr:case gr:s="4i",w=4;break;case 5126:s="1f";break;case lr:s="2f",w=2;break;case cr:s="3f",w=3;break;case ur:s="4f",w=4;break;case yr:s="Matrix2fv";break;case vr:s="Matrix3fv";break;case xr:s="Matrix4fv"}if("M"===s.charAt(0)){t(c,".uniform",s,"(",y,",");var k=Math.pow(m-yr+2,2),A=e.global.def("new Float32Array(",k,")");Array.isArray(f)?t("false,(",h(k,(function(e){return A+"["+e+"]="+f[e]})),",",A,")"):t("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",h(k,(function(e){return A+"["+e+"]="+f+"["+e+"]"})),",",A,")"),t(");")}else if(w>1){for(var M=[],S=[],E=0;E<w;++E)Array.isArray(f)?S.push(f[E]):S.push(t.def(f+"["+E+"]")),o&&M.push(t.def());o&&t("if(!",e.batchId,"||",M.map((function(e,t){return e+"!=="+S[t]})).join("||"),"){",M.map((function(e,t){return e+"="+S[t]+";"})).join("")),t(c,".uniform",s,"(",y,",",S.join(","),");"),o&&t("}")}else{if(o){var C=t.def();t("if(!",e.batchId,"||",C,"!==",f,"){",C,"=",f,";")}t(c,".uniform",s,"(",y,",",f,");"),o&&t("}")}}}function Y(e,t,r,n){var i,a,o,s=e.shared,l=s.gl,c=s.draw,u=n.draw,h=(a=u.elements,o=t,a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(e,o),u.elementsActive&&o("if("+i+")"+l+".bindBuffer("+sr+","+i+".buffer.buffer);")):(i=o.def(),o(i,"=",c,".",Ht,";","if(",i,"){",l,".bindBuffer(",sr,",",i,".buffer.buffer);}","else if(",s.vao,".currentVAO){",i,"=",e.shared.elements+".getElements("+s.vao,".currentVAO.elements);",T?"":"if("+i+")"+l+".bindBuffer("+sr+","+i+".buffer.buffer);","}")),i);function f(i){var a=u[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(e,r):a.append(e,t):t.def(c,".",i)}var p,d,m=f(Gt),g=f(Zt),y=function(){var i,a=u.count,o=t;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(e,o)):i=o.def(c,".",Wt),i}();if("number"==typeof y){if(0===y)return}else r("if(",y,"){"),r.exit("}");b&&(p=f(Yt),d=e.instancing);var v=h+".type",x=u.elements&&zr(u.elements)&&!u.vaoActive;function _(){function e(){r(d,".drawElementsInstancedANGLE(",[m,y,v,g+"<<(("+v+"-5121)>>1)",p],");")}function t(){r(d,".drawArraysInstancedANGLE(",[m,g,y,p],");")}h&&"null"!==h?x?e():(r("if(",h,"){"),e(),r("}else{"),t(),r("}")):t()}function w(){function e(){r(l+".drawElements("+[m,y,v,g+"<<(("+v+"-5121)>>1)"]+");")}function t(){r(l+".drawArrays("+[m,g,y]+");")}h&&"null"!==h?x?e():(r("if(",h,"){"),e(),r("}else{"),t(),r("}")):t()}b&&("number"!=typeof p||p>=0)?"string"==typeof p?(r("if(",p,">0){"),_(),r("}else if(",p,"<0){"),w(),r("}")):_():w()}function X(e,t,r,n,i){var a=B(),o=a.proc("body",i);return b&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),e(a,o,r,n),a.compile().body}function $(e,t,r,n){q(e,t),r.useVAO?r.drawVAO?t(e.shared.vao,".setVAO(",r.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),W(e,t,r,n.attributes,(function(){return!0}))),Z(e,t,r,n.uniforms,(function(){return!0}),!1),Y(e,t,t,r)}function K(e,t,r,n){function i(){return!0}e.batchId="a1",q(e,t),W(e,t,r,n.attributes,i),Z(e,t,r,n.uniforms,i,!1),Y(e,t,t,r)}function J(e,t,r,n){q(e,t);var i=r.contextDep,a=t.def(),o=t.def();e.shared.props=o,e.batchId=a;var s=e.scope(),l=e.scope();function c(e){return e.contextDep&&i||e.propDep}function u(e){return!c(e)}if(t(s.entry,"for(",a,"=0;",a,"<","a1",";++",a,"){",o,"=","a0","[",a,"];",l,"}",s.exit),r.needsContext&&j(e,l,r.context),r.needsFramebuffer&&N(e,l,r.framebuffer),V(e,l,r.state,c),r.profile&&c(r.profile)&&H(e,l,r,!1,!0),n)r.useVAO?r.drawVAO?c(r.drawVAO)?l(e.shared.vao,".setVAO(",r.drawVAO.append(e,l),");"):s(e.shared.vao,".setVAO(",r.drawVAO.append(e,s),");"):s(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(s(e.shared.vao,".setVAO(null);"),W(e,s,r,n.attributes,u),W(e,l,r,n.attributes,c)),Z(e,s,r,n.uniforms,u,!1),Z(e,l,r,n.uniforms,c,!0),Y(e,s,l,r);else{var h=e.global.def("{}"),f=r.shader.progVar.append(e,l),p=l.def(f,".id"),d=l.def(h,"[",p,"]");l(e.shared.gl,".useProgram(",f,".program);","if(!",d,"){",d,"=",h,"[",p,"]=",e.link((function(e){return X(K,0,r,e,2)})),"(",f,");}",d,".call(this,a0[",a,"],",a,");")}}function Q(e,t,r){var n=t.static[r];if(n&&function(e){if("object"==typeof e&&!G(e)){for(var t=Object.keys(e),r=0;r<t.length;++r)if(o.isDynamic(e[t[r]]))return!0;return!1}}(n)){var i=e.global,a=Object.keys(n),s=!1,l=!1,c=!1,u=e.global.def("{}");a.forEach((function(t){var r=n[t];if(o.isDynamic(r)){"function"==typeof r&&(r=n[t]=o.unbox(r));var a=Or(r,null);s=s||a.thisDep,c=c||a.propDep,l=l||a.contextDep}else{switch(i(u,".",t,"="),typeof r){case"number":i(r);break;case"string":i('"',r,'"');break;case"object":Array.isArray(r)&&i("[",r.join(),"]");break;default:i(e.link(r))}i(";")}})),t.dynamic[r]=new o.DynamicVariable(4,{thisDep:s,contextDep:l,propDep:c,ref:u,append:function(e,t){a.forEach((function(r){var i=n[r];if(o.isDynamic(i)){var a=e.invoke(t,i);t(u,".",r,"=",a,";")}}))}}),delete t.static[r]}}return{next:A,current:k,procs:function(){var e=B(),t=e.proc("poll"),r=e.proc("refresh"),a=e.block();t(a),r(a);var o,s=e.shared,l=s.gl,c=s.next,u=s.current;a(u,".dirty=false;"),N(e,t),N(e,r,null,!0),b&&(o=e.link(b)),n.oes_vertex_array_object&&r(e.link(n.oes_vertex_array_object),".bindVertexArrayOES(null);");var f=r.def(s.attributes),p=r.def(0),d=e.cond(p,".buffer");d.then(l,".enableVertexAttribArray(i);",l,".bindBuffer(",or,",",p,".buffer.buffer);",l,".vertexAttribPointer(i,",p,".size,",p,".type,",p,".normalized,",p,".stride,",p,".offset);").else(l,".disableVertexAttribArray(i);",l,".vertexAttrib4f(i,",p,".x,",p,".y,",p,".z,",p,".w);",p,".buffer=null;");var m=e.link(i.maxAttributes,{stable:!0});return r("for(var i=0;i<",m,";++i){",p,"=",f,"[i];",d,"}"),b&&r("for(var i=0;i<",m,";++i){",o,".vertexAttribDivisorANGLE(i,",f,"[i].divisor);","}"),r(e.shared.vao,".currentVAO=null;",e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"),Object.keys(E).forEach((function(n){var i=E[n],o=a.def(c,".",n),s=e.block();s("if(",o,"){",l,".enable(",i,")}else{",l,".disable(",i,")}",u,".",n,"=",o,";"),r(s),t("if(",o,"!==",u,".",n,"){",s,"}")})),Object.keys(C).forEach((function(n){var i,o,s=C[n],f=k[n],p=e.block();if(p(l,".",s,"("),G(f)){var d=f.length;i=e.global.def(c,".",n),o=e.global.def(u,".",n),p(h(d,(function(e){return i+"["+e+"]"})),");",h(d,(function(e){return o+"["+e+"]="+i+"["+e+"];"})).join("")),t("if(",h(d,(function(e){return i+"["+e+"]!=="+o+"["+e+"]"})).join("||"),"){",p,"}")}else i=a.def(c,".",n),o=a.def(u,".",n),p(i,");",u,".",n,"=",i,";"),t("if(",i,"!==",o,"){",p,"}");r(p)})),e.compile()}(),compile:function(t,i,o,l,u){var d=B();d.stats=d.link(u),Object.keys(i.static).forEach((function(e){Q(d,i,e)})),ar.forEach((function(e){Q(d,t,e)}));var m=function(e,t,i,o){e.static,e.dynamic;var l=function(e,t){var r=e.static;if("string"==typeof r[qt]&&"string"==typeof r[Vt]){if(Object.keys(t.dynamic).length>0)return null;var n=t.static,i=Object.keys(n);if(i.length>0&&"number"==typeof n[i[0]]){for(var a=[],o=0;o<i.length;++o)a.push([0|n[i[o]],i[o]]);return a}}return null}(e,t),u=function(e){var t=e.static,r=e.dynamic;if(Ut in t){var n=t[Ut];return n?(n=c.getFramebuffer(n),Dr((function(e,t){var r=e.link(n),i=e.shared;t.set(i.framebuffer,".next",r);var a=i.context;return t.set(a,"."+Jt,r+".width"),t.set(a,"."+Qt,r+".height"),r}))):Dr((function(e,t){var r=e.shared;t.set(r.framebuffer,".next","null");var n=r.context;return t.set(n,"."+Jt,n+"."+nr),t.set(n,"."+Qt,n+"."+ir),"null"}))}if(Ut in r){var i=r[Ut];return Or(i,(function(e,t){var r=e.invoke(t,i),n=e.shared,a=n.framebuffer,o=t.def(a,".getFramebuffer(",r,")");t.set(a,".next",o);var s=n.context;return t.set(s,"."+Jt,o+"?"+o+".width:"+s+"."+nr),t.set(s,"."+Qt,o+"?"+o+".height:"+s+"."+ir),o}))}return null}(e),d=function(e,t){var r=e.static,n=e.dynamic;function i(e){if(e in r){var i,a,o=r[e],s=!0,l=0|o.x,c=0|o.y;return"width"in o?i=0|o.width:s=!1,"height"in o?a=0|o.height:s=!1,new Pr(!s&&t&&t.thisDep,!s&&t&&t.contextDep,!s&&t&&t.propDep,(function(e,t){var r=e.shared.context,n=i;"width"in o||(n=t.def(r,".",Jt,"-",l));var s=a;return"height"in o||(s=t.def(r,".",Qt,"-",c)),[l,c,n,s]}))}if(e in n){var u=n[e],h=Or(u,(function(e,t){var r=e.invoke(t,u),n=e.shared.context,i=t.def(r,".x|0"),a=t.def(r,".y|0");return[i,a,t.def('"width" in ',r,"?",r,".width|0:","(",n,".",Jt,"-",i,")"),t.def('"height" in ',r,"?",r,".height|0:","(",n,".",Qt,"-",a,")")]}));return t&&(h.thisDep=h.thisDep||t.thisDep,h.contextDep=h.contextDep||t.contextDep,h.propDep=h.propDep||t.propDep),h}return t?new Pr(t.thisDep,t.contextDep,t.propDep,(function(e,t){var r=e.shared.context;return[0,0,t.def(r,".",Jt),t.def(r,".",Qt)]})):null}var a=i(jt);if(a){var o=a;a=new Pr(a.thisDep,a.contextDep,a.propDep,(function(e,t){var r=o.append(e,t),n=e.shared.context;return t.set(n,"."+er,r[2]),t.set(n,"."+tr,r[3]),r}))}return{viewport:a,scissor_box:i(Bt)}}(e,u),m=function(e){var t=e.static,r=e.dynamic,n={},i=!1,a=function(){if(Xt in t){var e=t[Xt];return null!==e&&null===f.getVAO(e)&&(e=f.createVAO(e)),i=!0,n.vao=e,Dr((function(t){var r=f.getVAO(e);return r?t.link(r):"null"}))}if(Xt in r){i=!0;var a=r[Xt];return Or(a,(function(e,t){var r=e.invoke(t,a);return t.def(e.shared.vao+".getVAO("+r+")")}))}return null}(),o=!1,l=function(){if(Ht in t){var e=t[Ht];if(n.elements=e,Ir(e)){var l=n.elements=s.create(e,!0);e=s.getElements(l),o=!0}else e&&(e=s.getElements(e),o=!0);var c=Dr((function(t,r){if(e){var n=t.link(e);return t.ELEMENTS=n,n}return t.ELEMENTS=null,null}));return c.value=e,c}if(Ht in r){o=!0;var u=r[Ht];return Or(u,(function(e,t){var r=e.shared,n=r.isBufferArgs,i=r.elements,a=e.invoke(t,u),o=t.def("null"),s=t.def(n,"(",a,")"),l=e.cond(s).then(o,"=",i,".createStream(",a,");").else(o,"=",i,".getElements(",a,");");return t.entry(l),t.exit(e.cond(s).then(i,".destroyStream(",o,");")),e.ELEMENTS=o,o}))}return i?new Pr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.elements+".getElements("+e.shared.vao+".currentVAO.elements):null")})):null}();function c(e,s){if(e in t){var l=0|t[e];return s?n.offset=l:n.instances=l,Dr((function(e,t){return s&&(e.OFFSET=l),l}))}if(e in r){var c=r[e];return Or(c,(function(e,t){var r=e.invoke(t,c);return s&&(e.OFFSET=r),r}))}if(s){if(o)return Dr((function(e,t){return e.OFFSET=0,0}));if(i)return new Pr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.offset:0")}))}else if(i)return new Pr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.instances:-1")}));return null}var u=c(Zt,!0),h=function(){if(Gt in t){var e=t[Gt];return n.primitive=e,Dr((function(t,r){return F[e]}))}if(Gt in r){var s=r[Gt];return Or(s,(function(e,t){var r=e.constants.primTypes,n=e.invoke(t,s);return t.def(r,"[",n,"]")}))}return o?zr(l)?l.value?Dr((function(e,t){return t.def(e.ELEMENTS,".primType")})):Dr((function(){return 4})):new Pr(l.thisDep,l.contextDep,l.propDep,(function(e,t){var r=e.ELEMENTS;return t.def(r,"?",r,".primType:",4)})):i?new Pr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.primitive:4")})):null}(),p=function(){if(Wt in t){var e=0|t[Wt];return n.count=e,Dr((function(){return e}))}if(Wt in r){var s=r[Wt];return Or(s,(function(e,t){return e.invoke(t,s)}))}return o?zr(l)?l?u?new Pr(u.thisDep,u.contextDep,u.propDep,(function(e,t){return t.def(e.ELEMENTS,".vertCount-",e.OFFSET)})):Dr((function(e,t){return t.def(e.ELEMENTS,".vertCount")})):Dr((function(){return-1})):new Pr(l.thisDep||u.thisDep,l.contextDep||u.contextDep,l.propDep||u.propDep,(function(e,t){var r=e.ELEMENTS;return e.OFFSET?t.def(r,"?",r,".vertCount-",e.OFFSET,":-1"):t.def(r,"?",r,".vertCount:-1")})):i?new Pr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao,".currentVAO?",e.shared.vao,".currentVAO.count:-1")})):null}(),d=c(Yt,!1);return{elements:l,primitive:h,count:p,instances:d,offset:u,vao:a,vaoActive:i,elementsActive:o,static:n}}(e),g=function(e){var t=e.static,r=e.dynamic,n={};return M.forEach((function(e){var i=I(e);function a(a,o){if(e in t){var s=a(t[e]);n[i]=Dr((function(){return s}))}else if(e in r){var l=r[e];n[i]=Or(l,(function(e,t){return o(e,t,e.invoke(t,l))}))}}switch(e){case Tt:case dt:case pt:case Pt:case vt:case Ft:case St:case Ct:case It:case bt:return a((function(e){return e}),(function(e,t,r){return r}));case xt:return a((function(e){return Sr[e]}),(function(e,t,r){var n=e.constants.compareFuncs;return t.def(n,"[",r,"]")}));case _t:return a((function(e){return e}),(function(e,t,r){return[t.def("+",r,"[0]"),t.def("+",r,"[1]")]}));case yt:return a((function(e){var t="srcRGB"in e?e.srcRGB:e.src,r="srcAlpha"in e?e.srcAlpha:e.src,n="dstRGB"in e?e.dstRGB:e.dst,i="dstAlpha"in e?e.dstAlpha:e.dst;return[Mr[t],Mr[n],Mr[r],Mr[i]]}),(function(e,t,r){var n=e.constants.blendFuncs;function i(e,n){return t.def('"',e,n,'" in ',r,"?",r,".",e,n,":",r,".",e)}var a=i("src","RGB"),o=i("dst","RGB"),s=t.def(n,"[",a,"]"),l=t.def(n,"[",i("src","Alpha"),"]");return[s,t.def(n,"[",o,"]"),l,t.def(n,"[",i("dst","Alpha"),"]")]}));case gt:return a((function(e){return"string"==typeof e?[_[e],_[e]]:"object"==typeof e?[_[e.rgb],_[e.alpha]]:void 0}),(function(e,t,r){var n=e.constants.blendEquations,i=t.def(),a=t.def(),o=e.cond("typeof ",r,'==="string"');return o.then(i,"=",a,"=",n,"[",r,"];"),o.else(i,"=",n,"[",r,".rgb];",a,"=",n,"[",r,".alpha];"),t(o),[i,a]}));case mt:return a((function(e){return h(4,(function(t){return+e[t]}))}),(function(e,t,r){return h(4,(function(e){return t.def("+",r,"[",e,"]")}))}));case zt:return a((function(e){return 0|e}),(function(e,t,r){return t.def(r,"|0")}));case Dt:return a((function(e){var t=e.cmp||"keep",r=e.ref||0,n="mask"in e?e.mask:-1;return[Sr[t],r,n]}),(function(e,t,r){var n=e.constants.compareFuncs;return[t.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Ar),t.def(r,".ref|0"),t.def('"mask" in ',r,"?",r,".mask|0:-1")]}));case Ot:case Rt:return a((function(t){var r=t.fail||"keep",n=t.zfail||"keep",i=t.zpass||"keep";return[e===Rt?Tr:wr,Er[r],Er[n],Er[i]]}),(function(t,r,n){var i=t.constants.stencilOps;function a(e){return r.def('"',e,'" in ',n,"?",i,"[",n,".",e,"]:",Ar)}return[e===Rt?Tr:wr,a("fail"),a("zfail"),a("zpass")]}));case Et:return a((function(e){return[0|e.factor,0|e.units]}),(function(e,t,r){return[t.def(r,".factor|0"),t.def(r,".units|0")]}));case kt:return a((function(e){var t=0;return"front"===e?t=wr:"back"===e&&(t=Tr),t}),(function(e,t,r){return t.def(r,'==="front"?',wr,":",Tr)}));case Mt:return a((function(e){return e}),(function(e,t,r){return r}));case At:return a((function(e){return Cr[e]}),(function(e,t,r){return t.def(r+'==="cw"?2304:'+kr)}));case wt:return a((function(e){return e.map((function(e){return!!e}))}),(function(e,t,r){return h(4,(function(e){return"!!"+r+"["+e+"]"}))}));case Lt:return a((function(e){return["value"in e?e.value:1,!!e.invert]}),(function(e,t,r){return[t.def('"value" in ',r,"?+",r,".value:1"),t.def("!!",r,".invert")]}))}})),n}(e),y=function(e,t,n){var i=e.static,a=e.dynamic;function o(e){if(e in i){var t=r.id(i[e]),n=Dr((function(){return t}));return n.id=t,n}if(e in a){var o=a[e];return Or(o,(function(e,t){var r=e.invoke(t,o);return t.def(e.shared.strings,".id(",r,")")}))}return null}var s,l=o(qt),c=o(Vt),u=null;return zr(l)&&zr(c)?(u=p.program(c.id,l.id,null,n),s=Dr((function(e,t){return e.link(u)}))):s=new Pr(l&&l.thisDep||c&&c.thisDep,l&&l.contextDep||c&&c.contextDep,l&&l.propDep||c&&c.propDep,(function(e,t){var r,n=e.shared.shader;r=l?l.append(e,t):t.def(n,".",qt);var i=n+".program("+(c?c.append(e,t):t.def(n,".",Vt))+","+r;return t.def(i+")")})),{frag:l,vert:c,progVar:s,program:u}}(e,0,l);function v(e){var t=d[e];t&&(g[e]=t)}v(jt),v(I(Bt));var b=Object.keys(g).length>0,w={framebuffer:u,draw:m,shader:y,state:g,dirty:b,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(w.profile=function(e){var t,r=e.static,n=e.dynamic;if(Nt in r){var i=!!r[Nt];(t=Dr((function(e,t){return i}))).enable=i}else if(Nt in n){var a=n[Nt];t=Or(a,(function(e,t){return e.invoke(t,a)}))}return t}(e),w.uniforms=function(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r,i=t[e];if("number"==typeof i||"boolean"==typeof i)r=Dr((function(){return i}));else if("function"==typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Dr((function(e){return e.link(i)})):("framebuffer"===a||"framebufferCube"===a)&&(r=Dr((function(e){return e.link(i.color[0])})))}else G(i)&&(r=Dr((function(e){return e.global.def("[",h(i.length,(function(e){return i[e]})),"]")})));r.value=i,n[e]=r})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=Or(t,(function(e,r){return e.invoke(r,t)}))})),n}(i),w.drawVAO=w.scopeVAO=m.vao,!w.drawVAO&&y.program&&!l&&n.angle_instanced_arrays&&m.static.elements){var T=!0,k=y.program.attributes.map((function(e){var r=t.static[e];return T=T&&!!r,r}));if(T&&k.length>0){var A=f.getVAO(f.createVAO({attributes:k,elements:m.static.elements}));w.drawVAO=new Pr(null,null,null,(function(e,t){return e.link(A)})),w.useVAO=!0}}return l?w.useVAO=!0:w.attributes=function(e){var t=e.static,n=e.dynamic,i={};return Object.keys(t).forEach((function(e){var n=t[e],o=r.id(e),s=new x;if(Ir(n))s.state=1,s.buffer=a.getBuffer(a.create(n,or,!1,!0)),s.type=0;else{var l=a.getBuffer(n);if(l)s.state=1,s.buffer=l,s.type=0;else if("constant"in n){var c=n.constant;s.buffer="null",s.state=2,"number"==typeof c?s.x=c:ft.forEach((function(e,t){t<c.length&&(s[e]=c[t])}))}else{l=Ir(n.buffer)?a.getBuffer(a.create(n.buffer,or,!1,!0)):a.getBuffer(n.buffer);var u=0|n.offset,h=0|n.stride,f=0|n.size,p=!!n.normalized,d=0;"type"in n&&(d=S[n.type]);var m=0|n.divisor;s.buffer=l,s.state=1,s.size=f,s.normalized=p,s.type=d||l.dtype,s.offset=u,s.stride=h,s.divisor=m}}i[e]=Dr((function(e,t){var r=e.attribCache;if(o in r)return r[o];var n={isStream:!1};return Object.keys(s).forEach((function(e){n[e]=s[e]})),s.buffer&&(n.buffer=e.link(s.buffer),n.type=n.type||n.buffer+".dtype"),r[o]=n,n}))})),Object.keys(n).forEach((function(e){var t=n[e];i[e]=Or(t,(function(e,r){var n=e.invoke(r,t),i=e.shared,a=e.constants,o=i.isBufferArgs,s=i.buffer,l={isStream:r.def(!1)},c=new x;c.state=1,Object.keys(c).forEach((function(e){l[e]=r.def(""+c[e])}));var u=l.buffer,h=l.type;function f(e){r(l[e],"=",n,".",e,"|0;")}return r("if(",o,"(",n,")){",l.isStream,"=true;",u,"=",s,".createStream(",or,",",n,");",h,"=",u,".dtype;","}else{",u,"=",s,".getBuffer(",n,");","if(",u,"){",h,"=",u,".dtype;",'}else if("constant" in ',n,"){",l.state,"=",2,";","if(typeof "+n+'.constant === "number"){',l[ft[0]],"=",n,".constant;",ft.slice(1).map((function(e){return l[e]})).join("="),"=0;","}else{",ft.map((function(e,t){return l[e]+"="+n+".constant.length>"+t+"?"+n+".constant["+t+"]:0;"})).join(""),"}}else{","if(",o,"(",n,".buffer)){",u,"=",s,".createStream(",or,",",n,".buffer);","}else{",u,"=",s,".getBuffer(",n,".buffer);","}",h,'="type" in ',n,"?",a.glTypes,"[",n,".type]:",u,".dtype;",l.normalized,"=!!",n,".normalized;"),f("size"),f("offset"),f("stride"),f("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l}))})),i}(t),w.context=function(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r=t[e];n[e]=Dr((function(e,t){return"number"==typeof r||"boolean"==typeof r?""+r:e.link(r)}))})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=Or(t,(function(e,r){return e.invoke(r,t)}))})),n}(o),w}(t,i,o,l);return m.shader.program&&(m.shader.program.attributes.sort((function(e,t){return e.name<t.name?-1:1})),m.shader.program.uniforms.sort((function(e,t){return e.name<t.name?-1:1}))),function(e,t){var r=e.proc("draw",1);q(e,r),j(e,r,t.context),N(e,r,t.framebuffer),U(e,r,t),V(e,r,t.state),H(e,r,t,!1,!0);var n=t.shader.progVar.append(e,r);if(r(e.shared.gl,".useProgram(",n,".program);"),t.shader.program)$(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var i=e.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(e.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",e.link((function(e){return X($,0,t,e,1)})),"(",n,");",o,".call(this,a0);"))}Object.keys(t.state).length>0&&r(e.shared.current,".dirty=true;"),e.shared.vao&&r(e.shared.vao,".setVAO(null);")}(d,m),function(e,t){var n=e.proc("scope",3);e.batchId="a2";var i=e.shared,a=i.current;if(j(e,n,t.context),t.framebuffer&&t.framebuffer.append(e,n),Lr(Object.keys(t.state)).forEach((function(r){var a=t.state[r],o=a.append(e,n);G(o)?o.forEach((function(t,i){z(t)?n.set(e.next[r],"["+i+"]",t):n.set(e.next[r],"["+i+"]",e.link(t,{stable:!0}))})):zr(a)?n.set(i.next,"."+r,e.link(o,{stable:!0})):n.set(i.next,"."+r,o)})),H(e,n,t,!0,!0),[Ht,Zt,Wt,Yt,Gt].forEach((function(r){var a=t.draw[r];if(a){var o=a.append(e,n);z(o)?n.set(i.draw,"."+r,o):n.set(i.draw,"."+r,e.link(o),{stable:!0})}})),Object.keys(t.uniforms).forEach((function(a){var o=t.uniforms[a].append(e,n);Array.isArray(o)&&(o="["+o.map((function(t){return z(t)?t:e.link(t,{stable:!0})}))+"]"),n.set(i.uniforms,"["+e.link(r.id(a),{stable:!0})+"]",o)})),Object.keys(t.attributes).forEach((function(r){var i=t.attributes[r].append(e,n),a=e.scopeAttrib(r);Object.keys(new x).forEach((function(e){n.set(a,"."+e,i[e])}))})),t.scopeVAO){var o=t.scopeVAO.append(e,n);z(o)?n.set(i.vao,".targetVAO",o):n.set(i.vao,".targetVAO",e.link(o,{stable:!0}))}function s(r){var a=t.shader[r];if(a){var o=a.append(e,n);z(o)?n.set(i.shader,"."+r,o):n.set(i.shader,"."+r,e.link(o,{stable:!0}))}}s(Vt),s(qt),Object.keys(t.state).length>0&&(n(a,".dirty=true;"),n.exit(a,".dirty=true;")),n("a1(",e.shared.context,",a0,",e.batchId,");")}(d,m),function(e,t){var r=e.proc("batch",2);e.batchId="0",q(e,r);var n=!1,i=!0;Object.keys(t.context).forEach((function(e){n=n||t.context[e].propDep})),n||(j(e,r,t.context),i=!1);var a=t.framebuffer,o=!1;function s(e){return e.contextDep&&n||e.propDep}a?(a.propDep?n=o=!0:a.contextDep&&n&&(o=!0),o||N(e,r,a)):N(e,r,null),t.state.viewport&&t.state.viewport.propDep&&(n=!0),U(e,r,t),V(e,r,t.state,(function(e){return!s(e)})),(!t.profile||!s(t.profile))&&H(e,r,t,!1,"a1"),t.contextDep=n,t.needsContext=i,t.needsFramebuffer=o;var l=t.shader.progVar;if(l.contextDep&&n||l.propDep)J(e,r,t,null);else{var c=l.append(e,r);if(r(e.shared.gl,".useProgram(",c,".program);"),t.shader.program)J(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var u=e.global.def("{}"),h=r.def(c,".id"),f=r.def(u,"[",h,"]");r(e.cond(f).then(f,".call(this,a0,a1);").else(f,"=",u,"[",h,"]=",e.link((function(e){return X(J,0,t,e,2)})),"(",c,");",f,".call(this,a0,a1);"))}}Object.keys(t.state).length>0&&r(e.shared.current,".dirty=true;"),e.shared.vao&&r(e.shared.vao,".setVAO(null);")}(d,m),e(d.compile(),{destroy:function(){m.shader.program.destroy()}})}}}var Br="webglcontextlost",jr="webglcontextrestored";function Nr(e,t){for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}return function(t){var r=function(t){var r,n,i,a,o=t||{},s={},l=[],h=[],f=typeof window>"u"?1:window.devicePixelRatio,p=!1,d={},m=function(e){},g=function(){};if("string"==typeof o?r=document.querySelector(o):"object"==typeof o&&(function(e){return"string"==typeof e.nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect}(o)?r=o:function(e){return"function"==typeof e.drawArrays||"function"==typeof e.drawElements}(o)?i=(a=o).canvas:("gl"in o?a=o.gl:"canvas"in o?i=u(o.canvas):"container"in o&&(n=u(o.container)),"attributes"in o&&(s=o.attributes),"extensions"in o&&(l=c(o.extensions)),"optionalExtensions"in o&&(h=c(o.optionalExtensions)),"onDone"in o&&(m=o.onDone),"profile"in o&&(p=!!o.profile),"pixelRatio"in o&&(f=+o.pixelRatio),"cachedCode"in o&&(d=o.cachedCode))),r&&("canvas"===r.nodeName.toLowerCase()?i=r:n=r),!a){if(!i){var y=function(t,r,n){var i,a=document.createElement("canvas");function o(){var e=window.innerWidth,r=window.innerHeight;if(t!==document.body){var i=a.getBoundingClientRect();e=i.right-i.left,r=i.bottom-i.top}a.width=n*e,a.height=n*r}return e(a.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),t.appendChild(a),t===document.body&&(a.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(o)}))).observe(t):window.addEventListener("resize",o,!1),o(),{canvas:a,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",o),t.removeChild(a)}}}(n||document.body,0,f);if(!y)return null;i=y.canvas,g=y.onDestroy}void 0===s.premultipliedAlpha&&(s.premultipliedAlpha=!0),a=function(e,t){function r(r){try{return e.getContext(r,t)}catch{return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(i,s)}return a?{gl:a,canvas:i,container:n,extensions:l,optionalExtensions:h,pixelRatio:f,profile:p,cachedCode:d,onDone:m,onDestroy:g}:(g(),m("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}(t);if(!r)return null;var n=r.gl,i=n.getContextAttributes(),a=(n.isContextLost(),function(e,t){var r={};function n(t){var n,i=t.toLowerCase();try{n=r[i]=e.getExtension(i)}catch{}return!!n}for(var i=0;i<t.extensions.length;++i){var a=t.extensions[i];if(!n(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(n),{extensions:r,restore:function(){Object.keys(r).forEach((function(e){if(r[e]&&!n(e))throw new Error("(regl): error restoring extension "+e)}))}}}(n,r));if(!a)return null;var h=function(){var e={"":0},t=[""];return{id:function(r){var n=e[r];return n||(n=e[r]=t.length,t.push(r),n)},str:function(e){return t[e]}}}(),f={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},p=r.cachedCode||{},k=a.extensions,A=function(e,t){if(!t.ext_disjoint_timer_query)return null;var r=[];function n(e){r.push(e)}var i=[];function a(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var o=[];function s(e){o.push(e)}var l=[];function c(e,t,r){var n=o.pop()||new a;n.startQueryIndex=e,n.endQueryIndex=t,n.sum=0,n.stats=r,l.push(n)}var u=[],h=[];return{beginQuery:function(e){var n=r.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,n),i.push(n),c(i.length-1,i.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var e,r,a=i.length;if(0!==a){h.length=Math.max(h.length,a+1),u.length=Math.max(u.length,a+1),u[0]=0,h[0]=0;var o=0;for(e=0,r=0;r<i.length;++r){var c=i[r];t.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(o+=t.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),n(c)):i[e++]=c,u[r+1]=o,h[r+1]=e}for(i.length=e,e=0,r=0;r<l.length;++r){var f=l[r],p=f.startQueryIndex,d=f.endQueryIndex;f.sum+=u[d]-u[p];var m=h[p],g=h[d];g===m?(f.stats.gpuTime+=f.sum/1e6,s(f)):(f.startQueryIndex=m,f.endQueryIndex=g,l[e++]=f)}l.length=e}},getNumPendingQueries:function(){return i.length},clear:function(){r.push.apply(r,i);for(var e=0;e<r.length;e++)t.ext_disjoint_timer_query.deleteQueryEXT(r[e]);i.length=0,r.length=0},restore:function(){i.length=0,r.length=0}}}(0,k),M=l(),V=n.drawingBufferWidth,q=n.drawingBufferHeight,we={tick:0,time:0,viewportWidth:V,viewportHeight:q,framebufferWidth:V,framebufferHeight:q,drawingBufferWidth:V,drawingBufferHeight:q,pixelRatio:r.pixelRatio},Te={elements:null,primitive:4,count:-1,offset:0,instances:-1},ke=function(e,t){var r=1;t.ext_texture_filter_anisotropic&&(r=e.getParameter(34047));var n=1,i=1;t.webgl_draw_buffers&&(n=e.getParameter(34852),i=e.getParameter(36063));var a=!!t.oes_texture_float;if(a){var o=e.createTexture();e.bindTexture(m,o),e.texImage2D(m,0,g,1,1,0,g,y,null);var s=e.createFramebuffer();if(e.bindFramebuffer(v,s),e.framebufferTexture2D(v,36064,m,o,0),e.bindTexture(m,null),36053!==e.checkFramebufferStatus(v))a=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(16384);var l=d.allocType(y,4);e.readPixels(0,0,1,1,g,y,l),e.getError()?a=!1:(e.deleteFramebuffer(s),e.deleteTexture(o),a=1===l[0]),d.freeType(l)}}var c=!0;if(!(typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)))){var u=e.createTexture(),h=d.allocType(5121,36);e.activeTexture(33984),e.bindTexture(34067,u),e.texImage2D(34069,0,g,3,3,0,g,5121,h),d.freeType(h),e.bindTexture(34067,null),e.deleteTexture(u),c=!e.getError()}return{colorBits:[e.getParameter(3410),e.getParameter(3411),e.getParameter(3412),e.getParameter(3413)],depthBits:e.getParameter(3414),stencilBits:e.getParameter(3415),subpixelBits:e.getParameter(3408),extensions:Object.keys(t).filter((function(e){return!!t[e]})),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:i,pointSizeDims:e.getParameter(33901),lineWidthDims:e.getParameter(33902),maxViewportDims:e.getParameter(3386),maxCombinedTextureUnits:e.getParameter(35661),maxCubeMapSize:e.getParameter(34076),maxRenderbufferSize:e.getParameter(34024),maxTextureUnits:e.getParameter(34930),maxTextureSize:e.getParameter(3379),maxAttributes:e.getParameter(34921),maxVertexUniforms:e.getParameter(36347),maxVertexTextureUnits:e.getParameter(35660),maxVaryingVectors:e.getParameter(36348),maxFragmentUniforms:e.getParameter(36349),glsl:e.getParameter(35724),renderer:e.getParameter(7937),vendor:e.getParameter(7936),version:e.getParameter(7938),readFloat:a,npotTextureCube:c}}(n,k),Ce=function(e,t,r){var n=0,i={};function a(t){this.id=n++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=L,this.persistentData=null,r.profile&&(this.stats={size:0})}a.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},a.prototype.destroy=function(){c(this)};var o=[];function s(t,r,n){t.byteLength=r.byteLength,e.bufferData(t.type,r,n)}function l(e,t,r,n,i,a){var o,l;if(e.usage=r,Array.isArray(t)){if(e.dtype=n||P,t.length>0)if(Array.isArray(t[0])){o=I(t);for(var c=1,u=1;u<o.length;++u)c*=o[u];e.dimension=c,s(e,l=C(t,o,e.dtype),r),a?e.persistentData=l:d.freeType(l)}else if("number"==typeof t[0]){e.dimension=i;var h=d.allocType(e.dtype,t.length);O(h,t),s(e,h,r),a?e.persistentData=h:d.freeType(h)}else x(t[0])&&(e.dimension=t[0].length,e.dtype=n||D(t[0])||P,s(e,l=C(t,[t.length,t[0].length],e.dtype),r),a?e.persistentData=l:d.freeType(l))}else if(x(t))e.dtype=n||D(t),e.dimension=i,s(e,t,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(t.buffer)));else if(_(t)){o=t.shape;var f=t.stride,p=t.offset,m=0,g=0,y=0,v=0;1===o.length?(m=o[0],g=1,y=f[0],v=0):2===o.length&&(m=o[0],g=o[1],y=f[0],v=f[1]),e.dtype=n||D(t.data)||P,e.dimension=g;var b=d.allocType(e.dtype,m*g);R(b,t.data,m,g,y,v,p),s(e,b,r),a?e.persistentData=b:d.freeType(b)}else t instanceof ArrayBuffer&&(e.dtype=L,e.dimension=i,s(e,t,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(t))))}function c(r){var n;t.bufferCount--,n=r,Le.destroyBuffer(n);var a=r.buffer;e.deleteBuffer(a),r.buffer=null,delete i[r.id]}return r.profile&&(t.getTotalBufferSize=function(){var e=0;return Object.keys(i).forEach((function(t){e+=i[t].stats.size})),e}),{create:function(n,o,s,u){t.bufferCount++;var h=new a(o);function f(t){var n=35044,i=null,a=0,o=0,s=1;return Array.isArray(t)||x(t)||_(t)||t instanceof ArrayBuffer?i=t:"number"==typeof t?a=0|t:t&&("data"in t&&(i=t.data),"usage"in t&&(n=E[t.usage]),"type"in t&&(o=S[t.type]),"dimension"in t&&(s=0|t.dimension),"length"in t&&(a=0|t.length)),h.bind(),i?l(h,i,n,o,s,u):(a&&e.bufferData(h.type,a,n),h.dtype=o||L,h.usage=n,h.dimension=s,h.byteLength=a),r.profile&&(h.stats.size=h.byteLength*z[h.dtype]),f}function p(t,r){e.bufferSubData(h.type,r,t)}return i[h.id]=h,s||f(n),f._reglType="buffer",f._buffer=h,f.subdata=function(e,t){var r,n=0|(t||0);if(h.bind(),x(e)||e instanceof ArrayBuffer)p(e,n);else if(Array.isArray(e)){if(e.length>0)if("number"==typeof e[0]){var i=d.allocType(h.dtype,e.length);O(i,e),p(i,n),d.freeType(i)}else if(Array.isArray(e[0])||x(e[0])){r=I(e);var a=C(e,r,h.dtype);p(a,n),d.freeType(a)}}else if(_(e)){r=e.shape;var o=e.stride,s=0,l=0,c=0,u=0;1===r.length?(s=r[0],l=1,c=o[0],u=0):2===r.length&&(s=r[0],l=r[1],c=o[0],u=o[1]);var m=Array.isArray(e.data)?h.dtype:D(e.data),g=d.allocType(m,s*l);R(g,e.data,s,l,c,u,e.offset),p(g,n),d.freeType(g)}return f},r.profile&&(f.stats=h.stats),f.destroy=function(){c(h)},f},createStream:function(e,t){var r=o.pop();return r||(r=new a(e)),r.bind(),l(r,t,35040,0,1,!1),r},destroyStream:function(e){o.push(e)},clear:function(){b(i).forEach(c),o.forEach(c)},getBuffer:function(e){return e&&e._buffer instanceof a?e._buffer:null},restore:function(){b(i).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:l}}(n,f,r),Ie=function(e,t,r,n){var i={},a=0,o={uint8:B,uint16:j};function s(e){this.id=a++,i[this.id]=this,this.buffer=e,this.primType=4,this.vertCount=0,this.type=0}t.oes_element_index_uint&&(o.uint32=N),s.prototype.bind=function(){this.buffer.bind()};var l=[];function c(n,i,a,o,s,l,c){var u;if(n.buffer.bind(),i){var h=c;!c&&(!x(i)||_(i)&&!x(i.data))&&(h=t.oes_element_index_uint?N:j),r._initBuffer(n.buffer,i,a,h,3)}else e.bufferData(U,l,a),n.buffer.dtype=u||B,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;if(u=c,!c){switch(n.buffer.dtype){case B:case 5120:u=B;break;case j:case 5122:u=j;break;case N:case 5124:u=N}n.buffer.dtype=u}n.type=u;var f=s;f<0&&(f=n.buffer.byteLength,u===j?f>>=1:u===N&&(f>>=2)),n.vertCount=f;var p=o;if(o<0){p=4;var d=n.buffer.dimension;1===d&&(p=0),2===d&&(p=1),3===d&&(p=4)}n.primType=p}function u(e){n.elementsCount--,delete i[e.id],e.buffer.destroy(),e.buffer=null}return{create:function(e,t){var i=r.create(null,U,!0),a=new s(i._buffer);function l(e){if(e)if("number"==typeof e)i(e),a.primType=4,a.vertCount=0|e,a.type=B;else{var t=null,r=35044,n=-1,s=-1,u=0,h=0;Array.isArray(e)||x(e)||_(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(r=E[e.usage]),"primitive"in e&&(n=F[e.primitive]),"count"in e&&(s=0|e.count),"type"in e&&(h=o[e.type]),"length"in e?u=0|e.length:(u=s,h===j||5122===h?u*=2:(h===N||5124===h)&&(u*=4))),c(a,t,r,n,s,u,h)}else i(),a.primType=4,a.vertCount=0,a.type=B;return l}return n.elementsCount++,l(e),l._reglType="elements",l._elements=a,l.subdata=function(e,t){return i.subdata(e,t),l},l.destroy=function(){u(a)},l},createStream:function(e){var t=l.pop();return t||(t=new s(r.create(null,U,!0,!1)._buffer)),c(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){l.push(e)},getElements:function(e){return"function"==typeof e&&e._elements instanceof s?e._elements:null},clear:function(){b(i).forEach(u)}}}(n,k,Ce,f),Le=function(e,t,r,n,i,a,o){for(var s=r.maxAttributes,l=new Array(s),c=0;c<s;++c)l[c]=new Je;var u=0,h={},f={Record:Je,scope:{},state:l,currentVAO:null,targetVAO:null,restore:p()?function(){p()&&b(h).forEach((function(e){e.refresh()}))}:function(){},createVAO:function(e){var t=new m;function r(e){var n;if(Array.isArray(e))n=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?"function"==typeof o&&"elements"===o._reglType?(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;n=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=0|e.offset),"count"in e&&(t.count=0|e.count),"instances"in e&&(t.instances=0|e.instances),"primitive"in e&&(t.primitive=F[e.primitive])}var s={},l=t.attributes;l.length=n.length;for(var c=0;c<n.length;++c){var u,h=n[c],f=l[c]=new Je,p=h.data||h;Array.isArray(p)||x(p)||_(p)?(t.buffers[c]&&(u=t.buffers[c],x(p)&&u._buffer.byteLength>=p.byteLength?u.subdata(p):(u.destroy(),t.buffers[c]=null)),t.buffers[c]||(u=t.buffers[c]=i.create(h,34962,!1,!0)),f.buffer=i.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,s[c]=1):i.getBuffer(h)?(f.buffer=i.getBuffer(h),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(h.buffer)?(f.buffer=i.getBuffer(h.buffer),f.size=0|(+h.size||f.buffer.dimension),f.normalized=!!h.normalized||!1,f.type="type"in h?S[h.type]:f.buffer.dtype,f.offset=0|(h.offset||0),f.stride=0|(h.stride||0),f.divisor=0|(h.divisor||0),f.state=1):"x"in h&&(f.x=+h.x||0,f.y=+h.y||0,f.z=+h.z||0,f.w=+h.w||0,f.state=2)}for(var d=0;d<t.buffers.length;++d)!s[d]&&t.buffers[d]&&(t.buffers[d].destroy(),t.buffers[d]=null);return t.refresh(),r}return n.vaoCount+=1,r.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,t.ownsElements=!1),t.destroy()},r._vao=t,r._reglType="vao",r(e)},getVAO:function(e){return"function"==typeof e&&e._vao?e._vao:null},destroyBuffer:function(t){for(var r=0;r<l.length;++r){var n=l[r];n.buffer===t&&(e.disableVertexAttribArray(r),n.buffer=null)}},setVAO:p()?function(e){if(e!==f.currentVAO){var t=p();e?t.bindVertexArrayOES(e.vao):t.bindVertexArrayOES(null),f.currentVAO=e}}:function(t){if(t!==f.currentVAO){if(t)t.bindAttrs();else{for(var r=d(),n=0;n<l.length;++n){var i=l[n];i.buffer?(e.enableVertexAttribArray(n),i.buffer.bind(),e.vertexAttribPointer(n,i.size,i.type,i.normalized,i.stride,i.offfset),r&&i.divisor&&r.vertexAttribDivisorANGLE(n,i.divisor)):(e.disableVertexAttribArray(n),e.vertexAttrib4f(n,i.x,i.y,i.z,i.w))}o.elements?e.bindBuffer(Ke,o.elements.buffer.buffer):e.bindBuffer(Ke,null)}f.currentVAO=t}},clear:p()?function(){b(h).forEach((function(e){e.destroy()}))}:function(){}};function p(){return t.oes_vertex_array_object}function d(){return t.angle_instanced_arrays}function m(){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=p();this.vao=e?e.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}return m.prototype.bindAttrs=function(){for(var t=d(),r=this.attributes,n=0;n<r.length;++n){var i=r[n];i.buffer?(e.enableVertexAttribArray(n),e.bindBuffer(34962,i.buffer.buffer),e.vertexAttribPointer(n,i.size,i.type,i.normalized,i.stride,i.offset),t&&i.divisor&&t.vertexAttribDivisorANGLE(n,i.divisor)):(e.disableVertexAttribArray(n),e.vertexAttrib4f(n,i.x,i.y,i.z,i.w))}for(var o=r.length;o<s;++o)e.disableVertexAttribArray(o);var l=a.getElements(this.elements);l?e.bindBuffer(Ke,l.buffer.buffer):e.bindBuffer(Ke,null)},m.prototype.refresh=function(){var e=p();e&&(e.bindVertexArrayOES(this.vao),this.bindAttrs(),f.currentVAO=null,e.bindVertexArrayOES(null))},m.prototype.destroy=function(){if(this.vao){var e=p();this===f.currentVAO&&(f.currentVAO=null,e.bindVertexArrayOES(null)),e.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),h[this.id]&&(delete h[this.id],n.vaoCount-=1)},f}(n,k,ke,f,Ce,Ie,Te),He=function(t,r,n,i){var a={},o={};function s(e,t,r,n){this.name=e,this.id=t,this.location=r,this.info=n}function l(e,t){for(var r=0;r<e.length;++r)if(e[r].id===t.id)return void(e[r].location=t.location);e.push(t)}function c(e,n,i){var s=35632===e?a:o,l=s[n];if(!l){var c=r.str(n);l=t.createShader(e),t.shaderSource(l,c),t.compileShader(l),s[n]=l}return l}var u={},h=[],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 d(e,n,a){var o,u,h=c(35632,e.fragId),f=c(35633,e.vertId),p=e.program=t.createProgram();if(t.attachShader(p,h),t.attachShader(p,f),a)for(o=0;o<a.length;++o){var d=a[o];t.bindAttribLocation(p,d[0],d[1])}t.linkProgram(p);var m=t.getProgramParameter(p,35718);i.profile&&(e.stats.uniformsCount=m);var g=e.uniforms;for(o=0;o<m;++o)if(u=t.getActiveUniform(p,o))if(u.size>1)for(var y=0;y<u.size;++y){var v=u.name.replace("[0]","["+y+"]");l(g,new s(v,r.id(v),t.getUniformLocation(p,v),u))}else l(g,new s(u.name,r.id(u.name),t.getUniformLocation(p,u.name),u));var x=t.getProgramParameter(p,35721);i.profile&&(e.stats.attributesCount=x);var _=e.attributes;for(o=0;o<x;++o)(u=t.getActiveAttrib(p,o))&&l(_,new s(u.name,r.id(u.name),t.getAttribLocation(p,u.name),u))}return i.profile&&(n.getMaxUniformsCount=function(){var e=0;return h.forEach((function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)})),e},n.getMaxAttributesCount=function(){var e=0;return h.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var e=t.deleteShader.bind(t);b(a).forEach(e),a={},b(o).forEach(e),o={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,u={},n.shaderCount=0},program:function(r,i,s,l){var c=u[i];c||(c=u[i]={});var f=c[r];if(f&&(f.refCount++,!l))return f;var m=new p(i,r);return n.shaderCount++,d(m,0,l),f||(c[r]=m),h.push(m),e(m,{destroy:function(){if(m.refCount--,m.refCount<=0){t.deleteProgram(m.program);var e=h.indexOf(m);h.splice(e,1),n.shaderCount--}c[m.vertId].refCount<=0&&(t.deleteShader(o[m.vertId]),delete o[m.vertId],delete u[m.fragId][m.vertId]),Object.keys(u[m.fragId]).length||(t.deleteShader(a[m.fragId]),delete a[m.fragId],delete u[m.fragId])}})},restore:function(){a={},o={};for(var e=0;e<h.length;++e)d(h[e],0,h[e].attributes.map((function(e){return[e.location,e.name]})))},shader:c,frag:-1,vert:-1}}(n,h,f,r),Qe=function(t,r,n,i,a,o,s){var l={"don't care":ye,"dont care":ye,nice:4354,fast:4353},c={repeat:10497,clamp:pe,mirror:33648},u={nearest:de,linear:9729},h=e({mipmap:ge,"nearest mipmap nearest":me,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":ge},u),f={none:0,browser:37444},p={uint8:ce,rgba4:32819,rgb565:33635,"rgb5 a1":32820},m={alpha:$,luminance:J,"luminance alpha":Q,rgb:K,rgba:X,rgba4:32854,"rgb5 a1":ee,rgb565:36194},g={};r.ext_srgb&&(m.srgb=ne,m.srgba=ie),r.oes_texture_float&&(p.float32=p.float=fe),r.oes_texture_half_float&&(p.float16=p["half float"]=ae),r.webgl_depth_texture&&(e(m,{depth:te,"depth stencil":re}),e(p,{uint16:ue,uint32:he,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":oe,"rgba s3tc dxt1":se,"rgba s3tc dxt3":le,"rgba s3tc dxt5":33779}),r.webgl_compressed_texture_atc&&e(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(t.getParameter(34467));Object.keys(g).forEach((function(e){var t=g[e];y.indexOf(t)>=0&&(m[e]=t)}));var v=Object.keys(m);n.textureFormats=v;var k=[];Object.keys(m).forEach((function(e){var t=m[e];k[t]=e}));var A=[];Object.keys(p).forEach((function(e){var t=p[e];A[t]=e}));var M=[];Object.keys(u).forEach((function(e){M[u[e]]=e}));var S=[];Object.keys(h).forEach((function(e){var t=h[e];S[t]=e}));var E=[];Object.keys(c).forEach((function(e){E[c[e]]=e}));var C=v.reduce((function(e,t){var n=m[t];return n===J||n===$||n===J||n===Q||n===te||n===re||r.ext_srgb&&(n===ne||n===ie)?e[n]=n:n===ee||t.indexOf("rgba")>=0?e[n]=X:e[n]=K,e}),{});function I(){this.internalformat=X,this.format=X,this.type=ce,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function L(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 P(e,t){if("object"==typeof t&&t){if("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){var r=t.type;e.type=p[r]}var n=e.width,i=e.height,a=e.channels,o=!1;"shape"in t?(n=t.shape[0],i=t.shape[1],3===t.shape.length&&(a=t.shape[2],o=!0)):("radius"in t&&(n=i=t.radius),"width"in t&&(n=t.width),"height"in t&&(i=t.height),"channels"in t&&(a=t.channels,o=!0)),e.width=0|n,e.height=0|i,e.channels=0|a;var s=!1;if("format"in t){var l=t.format,c=e.internalformat=m[l];e.format=C[c],l in p&&("type"in t||(e.type=p[l])),l in g&&(e.compressed=!0),s=!0}!o&&s?e.channels=be[e.format]:o&&!s&&e.channels!==_e[e.format]&&(e.format=e.internalformat=_e[e.channels])}}function z(e){t.pixelStorei(37440,e.flipY),t.pixelStorei(37441,e.premultiplyAlpha),t.pixelStorei(37443,e.colorSpace),t.pixelStorei(3317,e.unpackAlignment)}function D(){I.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function O(e,t){var r=null;if(Fe(t)?r=t:t&&(P(e,t),"x"in t&&(e.xOffset=0|t.x),"y"in t&&(e.yOffset=0|t.y),Fe(t.data)&&(r=t.data)),t.copy){var n=a.viewportWidth,i=a.viewportHeight;e.width=e.width||n-e.xOffset,e.height=e.height||i-e.yOffset,e.needsCopy=!0}else if(r){if(x(r))e.channels=e.channels||4,e.data=r,!("type"in t)&&e.type===ce&&(e.type=Be(r));else if(Pe(r))e.channels=e.channels||4,function(e,t){var r=t.length;switch(e.type){case ce:case ue:case he:case fe:var n=d.allocType(e.type,r);n.set(t),e.data=n;break;case ae:e.data=H(t)}}(e,r),e.alignment=1,e.needsFree=!0;else if(_(r)){var o=r.data;!Array.isArray(o)&&e.type===ce&&(e.type=Be(o));var s,l,c,u,h,f,p=r.shape,m=r.stride;3===p.length?(c=p[2],f=m[2]):(c=1,f=1),s=p[0],l=p[1],u=m[0],h=m[1],e.alignment=1,e.width=s,e.height=l,e.channels=c,e.format=e.internalformat=_e[c],e.needsFree=!0,function(e,t,r,n,i,a){for(var o=e.width,s=e.height,l=e.channels,c=je(e,o*s*l),u=0,h=0;h<s;++h)for(var f=0;f<o;++f)for(var p=0;p<l;++p)c[u++]=t[r*f+n*h+i*p+a];Ne(e,c)}(e,o,u,h,f,r.offset)}else if(Oe(r)||Re(r)||function(e){return De(e)===Ae}(r))Oe(r)||Re(r)?e.element=r:e.element=r.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(function(e){return De(e)===Me}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(e){return De(e)===Se}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(e){return De(e)===Ee}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(ze(r)){var g=e.width||r[0].length,y=e.height||r.length,v=e.channels;v=G(r[0][0])?v||r[0][0].length:v||1;for(var b=w(r),k=1,A=0;A<b.length;++A)k*=b[A];var M=je(e,k);T(r,b,"",M),Ne(e,M),e.alignment=1,e.width=g,e.height=y,e.channels=v,e.format=e.internalformat=_e[v],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;e.type===fe||e.type}function R(e,r,n){var a=e.element,o=e.data,s=e.internalformat,l=e.format,c=e.type,u=e.width,h=e.height;z(e),a?t.texImage2D(r,n,l,l,c,a):e.compressed?t.compressedTexImage2D(r,n,s,u,h,0,o):e.needsCopy?(i(),t.copyTexImage2D(r,n,l,e.xOffset,e.yOffset,u,h,0)):t.texImage2D(r,n,l,u,h,0,l,c,o||null)}function F(e,r,n,a,o){var s=e.element,l=e.data,c=e.internalformat,u=e.format,h=e.type,f=e.width,p=e.height;z(e),s?t.texSubImage2D(r,o,n,a,u,h,s):e.compressed?t.compressedTexSubImage2D(r,o,n,a,c,f,p,l):e.needsCopy?(i(),t.copyTexSubImage2D(r,o,n,a,e.xOffset,e.yOffset,f,p)):t.texSubImage2D(r,o,n,a,f,p,u,h,l)}var B=[];function j(){return B.pop()||new D}function N(e){e.needsFree&&d.freeType(e.data),D.call(e),B.push(e)}function U(){I.call(this),this.genMipmaps=!1,this.mipmapHint=ye,this.mipmask=0,this.images=Array(16)}function V(e,t,r){var n=e.images[0]=j();e.mipmask=1,n.width=e.width=t,n.height=e.height=r,n.channels=e.channels=4}function q(e,t){var r=null;if(Fe(t))L(r=e.images[0]=j(),e),O(r,t),e.mipmask=1;else if(P(e,t),Array.isArray(t.mipmap))for(var n=t.mipmap,i=0;i<n.length;++i)L(r=e.images[i]=j(),e),r.width>>=i,r.height>>=i,O(r,n[i]),e.mipmask|=1<<i;else L(r=e.images[0]=j(),e),O(r,t),e.mipmask=1;L(e,e.images[0]),e.compressed&&(e.internalformat===oe||e.internalformat===se||e.internalformat===le||e.internalformat)}function we(e,t){for(var r=e.images,n=0;n<r.length;++n){if(!r[n])return;R(r[n],t,n)}}var Te=[];function ke(){var e=Te.pop()||new U;I.call(e),e.mipmask=0;for(var t=0;t<16;++t)e.images[t]=null;return e}function Ce(e){for(var t=e.images,r=0;r<t.length;++r)t[r]&&N(t[r]),t[r]=null;Te.push(e)}function Ie(){this.minFilter=de,this.magFilter=de,this.wrapS=pe,this.wrapT=pe,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=ye}function Le(e,t){if("min"in t){var r=t.min;e.minFilter=h[r],xe.indexOf(e.minFilter)>=0&&!("faces"in t)&&(e.genMipmaps=!0)}if("mag"in t){var n=t.mag;e.magFilter=u[n]}var i=e.wrapS,a=e.wrapT;if("wrap"in t){var o=t.wrap;"string"==typeof o?i=a=c[o]:Array.isArray(o)&&(i=c[o[0]],a=c[o[1]])}else{if("wrapS"in t){var s=t.wrapS;i=c[s]}if("wrapT"in t){var f=t.wrapT;a=c[f]}}if(e.wrapS=i,e.wrapT=a,"anisotropic"in t&&(t.anisotropic,e.anisotropic=t.anisotropic),"mipmap"in t){var p=!1;switch(typeof t.mipmap){case"string":e.mipmapHint=l[t.mipmap],e.genMipmaps=!0,p=!0;break;case"boolean":p=e.genMipmaps=t.mipmap;break;case"object":e.genMipmaps=!1,p=!0}p&&!("min"in t)&&(e.minFilter=me)}}function Ve(e,n){t.texParameteri(n,10241,e.minFilter),t.texParameteri(n,10240,e.magFilter),t.texParameteri(n,10242,e.wrapS),t.texParameteri(n,10243,e.wrapT),r.ext_texture_filter_anisotropic&&t.texParameteri(n,34046,e.anisotropic),e.genMipmaps&&(t.hint(33170,e.mipmapHint),t.generateMipmap(n))}var qe=0,He={},Ge=n.maxTextureUnits,We=Array(Ge).map((function(){return null}));function Ze(e){I.call(this),this.mipmask=0,this.internalformat=X,this.id=qe++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Ie,s.profile&&(this.stats={size:0})}function Ye(e){t.activeTexture(ve),t.bindTexture(e.target,e.texture)}function Xe(){var e=We[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(W,null)}function $e(e){var r=e.texture,n=e.unit,i=e.target;n>=0&&(t.activeTexture(ve+n),t.bindTexture(i,null),We[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete He[e.id],o.textureCount--}return e(Ze.prototype,{bind:function(){var e=this;e.bindCount+=1;var r=e.unit;if(r<0){for(var n=0;n<Ge;++n){var i=We[n];if(i){if(i.bindCount>0)continue;i.unit=-1}We[n]=e,r=n;break}s.profile&&o.maxTextureUnits<r+1&&(o.maxTextureUnits=r+1),e.unit=r,t.activeTexture(ve+r),t.bindTexture(e.target,e.texture)}return r},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&$e(this)}}),s.profile&&(o.getTotalTextureSize=function(){var e=0;return Object.keys(He).forEach((function(t){e+=He[t].stats.size})),e}),{create2D:function(e,r){var n=new Ze(W);function i(e,t){var r=n.texInfo;Ie.call(r);var a=ke();return"number"==typeof e?V(a,0|e,"number"==typeof t?0|t:0|e):e?(Le(r,e),q(a,e)):V(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),n.mipmask=a.mipmask,L(n,a),n.internalformat=a.internalformat,i.width=a.width,i.height=a.height,Ye(n),we(a,W),Ve(r,W),Xe(),Ce(a),s.profile&&(n.stats.size=Ue(n.internalformat,n.type,a.width,a.height,r.genMipmaps,!1)),i.format=k[n.internalformat],i.type=A[n.type],i.mag=M[r.magFilter],i.min=S[r.minFilter],i.wrapS=E[r.wrapS],i.wrapT=E[r.wrapT],i}return He[n.id]=n,o.textureCount++,i(e,r),i.subimage=function(e,t,r,a){var o=0|t,s=0|r,l=0|a,c=j();return L(c,n),c.width=0,c.height=0,O(c,e),c.width=c.width||(n.width>>l)-o,c.height=c.height||(n.height>>l)-s,Ye(n),F(c,W,o,s,l),Xe(),N(c),i},i.resize=function(e,r){var a=0|e,o=0|r||a;if(a===n.width&&o===n.height)return i;i.width=n.width=a,i.height=n.height=o,Ye(n);for(var l=0;n.mipmask>>l;++l){var c=a>>l,u=o>>l;if(!c||!u)break;t.texImage2D(W,l,n.format,c,u,0,n.format,n.type,null)}return Xe(),s.profile&&(n.stats.size=Ue(n.internalformat,n.type,a,o,!1,!1)),i},i._reglType="texture2d",i._texture=n,s.profile&&(i.stats=n.stats),i.destroy=function(){n.decRef()},i},createCube:function(e,r,n,i,a,l){var c=new Ze(Z);He[c.id]=c,o.cubeCount++;var u=new Array(6);function h(e,t,r,n,i,a){var o,l=c.texInfo;for(Ie.call(l),o=0;o<6;++o)u[o]=ke();if("number"!=typeof e&&e){if("object"==typeof e)if(t)q(u[0],e),q(u[1],t),q(u[2],r),q(u[3],n),q(u[4],i),q(u[5],a);else if(Le(l,e),P(c,e),"faces"in e){var f=e.faces;for(o=0;o<6;++o)L(u[o],c),q(u[o],f[o])}else for(o=0;o<6;++o)q(u[o],e)}else{var p=0|e||1;for(o=0;o<6;++o)V(u[o],p,p)}for(L(c,u[0]),l.genMipmaps?c.mipmask=(u[0].width<<1)-1:c.mipmask=u[0].mipmask,c.internalformat=u[0].internalformat,h.width=u[0].width,h.height=u[0].height,Ye(c),o=0;o<6;++o)we(u[o],Y+o);for(Ve(l,Z),Xe(),s.profile&&(c.stats.size=Ue(c.internalformat,c.type,h.width,h.height,l.genMipmaps,!0)),h.format=k[c.internalformat],h.type=A[c.type],h.mag=M[l.magFilter],h.min=S[l.minFilter],h.wrapS=E[l.wrapS],h.wrapT=E[l.wrapT],o=0;o<6;++o)Ce(u[o]);return h}return h(e,r,n,i,a,l),h.subimage=function(e,t,r,n,i){var a=0|r,o=0|n,s=0|i,l=j();return L(l,c),l.width=0,l.height=0,O(l,t),l.width=l.width||(c.width>>s)-a,l.height=l.height||(c.height>>s)-o,Ye(c),F(l,Y+e,a,o,s),Xe(),N(l),h},h.resize=function(e){var r=0|e;if(r!==c.width){h.width=c.width=r,h.height=c.height=r,Ye(c);for(var n=0;n<6;++n)for(var i=0;c.mipmask>>i;++i)t.texImage2D(Y+n,i,c.format,r>>i,r>>i,0,c.format,c.type,null);return Xe(),s.profile&&(c.stats.size=Ue(c.internalformat,c.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=c,s.profile&&(h.stats=c.stats),h.destroy=function(){c.decRef()},h},clear:function(){for(var e=0;e<Ge;++e)t.activeTexture(ve+e),t.bindTexture(W,null),We[e]=null;b(He).forEach($e),o.cubeCount=0,o.textureCount=0},getTexture:function(e){return null},restore:function(){for(var e=0;e<Ge;++e){var r=We[e];r&&(r.bindCount=0,r.unit=-1,We[e]=null)}b(He).forEach((function(e){e.texture=t.createTexture(),t.bindTexture(e.target,e.texture);for(var r=0;r<32;++r)if(e.mipmask&1<<r)if(e.target===W)t.texImage2D(W,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)t.texImage2D(Y+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);Ve(e.texInfo,e.target)}))},refresh:function(){for(var e=0;e<Ge;++e){var r=We[e];r&&(r.bindCount=0,r.unit=-1,We[e]=null),t.activeTexture(ve+e),t.bindTexture(W,null),t.bindTexture(Z,null)}}}}(n,k,ke,(function(){rt.procs.poll()}),we,f,r),et=function(e,t,r,n,i){var a={rgba4:qe,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};t.ext_srgb&&(a.srgba=35907),t.ext_color_buffer_half_float&&(a.rgba16f=34842,a.rgb16f=34843),t.webgl_color_buffer_float&&(a.rgba32f=34836);var o=[];Object.keys(a).forEach((function(e){var t=a[e];o[t]=e}));var s=0,l={};function c(e){this.id=s++,this.refCount=1,this.renderbuffer=e,this.format=qe,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function u(t){var r=t.renderbuffer;e.bindRenderbuffer(Ve,null),e.deleteRenderbuffer(r),t.renderbuffer=null,t.refCount=0,delete l[t.id],n.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&u(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var e=0;return Object.keys(l).forEach((function(t){e+=l[t].stats.size})),e}),{create:function(t,r){var s=new c(e.createRenderbuffer());function u(t,r){var n=0,l=0,c=qe;if("object"==typeof t&&t){var h=t;if("shape"in h){var f=h.shape;n=0|f[0],l=0|f[1]}else"radius"in h&&(n=l=0|h.radius),"width"in h&&(n=0|h.width),"height"in h&&(l=0|h.height);"format"in h&&(c=a[h.format])}else"number"==typeof t?(n=0|t,l="number"==typeof r?0|r:n):t||(n=l=1);if(n!==s.width||l!==s.height||c!==s.format)return u.width=s.width=n,u.height=s.height=l,s.format=c,e.bindRenderbuffer(Ve,s.renderbuffer),e.renderbufferStorage(Ve,c,n,l),i.profile&&(s.stats.size=Ge(s.format,s.width,s.height)),u.format=o[s.format],u}return l[s.id]=s,n.renderbufferCount++,u(t,r),u.resize=function(t,r){var n=0|t,a=0|r||n;return n===s.width&&a===s.height||(u.width=s.width=n,u.height=s.height=a,e.bindRenderbuffer(Ve,s.renderbuffer),e.renderbufferStorage(Ve,s.format,n,a),i.profile&&(s.stats.size=Ge(s.format,s.width,s.height))),u},u._reglType="renderbuffer",u._renderbuffer=s,i.profile&&(u.stats=s.stats),u.destroy=function(){s.decRef()},u},clear:function(){b(l).forEach(u)},restore:function(){b(l).forEach((function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(Ve,t.renderbuffer),e.renderbufferStorage(Ve,t.format,t.width,t.height)})),e.bindRenderbuffer(Ve,null)}}}(n,k,0,f,r),tt=function(t,r,n,i,a,o){var s={cur:null,next:null,dirty:!1,setFBO:null},l=["rgba"],c=["rgba4","rgb565","rgb5 a1"];r.ext_srgb&&c.push("srgba"),r.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),r.webgl_color_buffer_float&&c.push("rgba32f");var u=["uint8"];function h(e,t,r){this.target=e,this.texture=t,this.renderbuffer=r;var n=0,i=0;t?(n=t.width,i=t.height):r&&(n=r.width,i=r.height),this.width=n,this.height=i}function f(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function p(e,t,r){if(e)if(e.texture){var n=e.texture._texture;Math.max(1,n.width),Math.max(1,n.height),n.refCount+=1}else e.renderbuffer._renderbuffer.refCount+=1}function d(e,r){r&&(r.texture?t.framebufferTexture2D(We,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(We,e,Ze,r.renderbuffer._renderbuffer.renderbuffer))}function m(e){var t=Ye,r=null,n=null,i=e;"object"==typeof e&&(i=e.data,"target"in e&&(t=0|e.target));var a=i._reglType;return"texture2d"===a||"textureCube"===a?r=i:"renderbuffer"===a&&(n=i,t=Ze),new h(t,r,n)}function g(e,t,r,n,o){if(r){var s=i.create2D({width:e,height:t,format:n,type:o});return s._texture.refCount=0,new h(Ye,s,null)}var l=a.create({width:e,height:t,format:n});return l._renderbuffer.refCount=0,new h(Ze,null,l)}function y(e){return e&&(e.texture||e.renderbuffer)}function v(e,t,r){e&&(e.texture?e.texture.resize(t,r):e.renderbuffer&&e.renderbuffer.resize(t,r),e.width=t,e.height=r)}r.oes_texture_half_float&&u.push("half float","float16"),r.oes_texture_float&&u.push("float","float32");var x=0,_={};function w(){this.id=x++,_[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 T(e){e.colorAttachments.forEach(f),f(e.depthAttachment),f(e.stencilAttachment),f(e.depthStencilAttachment)}function k(e){var r=e.framebuffer;t.deleteFramebuffer(r),e.framebuffer=null,o.framebufferCount--,delete _[e.id]}function A(e){var r;t.bindFramebuffer(We,e.framebuffer);var i=e.colorAttachments;for(r=0;r<i.length;++r)d(36064+r,i[r]);for(r=i.length;r<n.maxColorAttachments;++r)t.framebufferTexture2D(We,36064+r,Ye,null,0);t.framebufferTexture2D(We,33306,Ye,null,0),t.framebufferTexture2D(We,36096,Ye,null,0),t.framebufferTexture2D(We,36128,Ye,null,0),d(36096,e.depthAttachment),d(36128,e.stencilAttachment),d(33306,e.depthStencilAttachment),t.checkFramebufferStatus(We),t.isContextLost(),t.bindFramebuffer(We,s.next?s.next.framebuffer:null),s.cur=s.next,t.getError()}function M(t,r){var n=new w;function i(e,t){var r,a=0,o=0,s=!0,u=!0,h=null,f=!0,d="rgba",v="uint8",x=1,_=null,b=null,w=null,k=!1;if("number"==typeof e)a=0|e,o=0|t||a;else if(e){var M=e;if("shape"in M){var S=M.shape;a=S[0],o=S[1]}else"radius"in M&&(a=o=M.radius),"width"in M&&(a=M.width),"height"in M&&(o=M.height);("color"in M||"colors"in M)&&(h=M.color||M.colors,Array.isArray(h)),h||("colorCount"in M&&(x=0|M.colorCount),"colorTexture"in M&&(f=!!M.colorTexture,d="rgba4"),"colorType"in M&&(v=M.colorType,f||("half float"===v||"float16"===v?d="rgba16f":("float"===v||"float32"===v)&&(d="rgba32f"))),"colorFormat"in M&&(d=M.colorFormat,l.indexOf(d)>=0?f=!0:c.indexOf(d)>=0&&(f=!1))),("depthTexture"in M||"depthStencilTexture"in M)&&(k=!(!M.depthTexture&&!M.depthStencilTexture)),"depth"in M&&("boolean"==typeof M.depth?s=M.depth:(_=M.depth,u=!1)),"stencil"in M&&("boolean"==typeof M.stencil?u=M.stencil:(b=M.stencil,s=!1)),"depthStencil"in M&&("boolean"==typeof M.depthStencil?s=u=M.depthStencil:(w=M.depthStencil,s=!1,u=!1))}else a=o=1;var E=null,C=null,I=null,L=null;if(Array.isArray(h))E=h.map(m);else if(h)E=[m(h)];else for(E=new Array(x),r=0;r<x;++r)E[r]=g(a,o,f,d,v);a=a||E[0].width,o=o||E[0].height,_?C=m(_):s&&!u&&(C=g(a,o,k,"depth","uint32")),b?I=m(b):u&&!s&&(I=g(a,o,!1,"stencil","uint8")),w?L=m(w):!_&&!b&&u&&s&&(L=g(a,o,k,"depth stencil","depth stencil"));var P=null;for(r=0;r<E.length;++r)if(p(E[r]),E[r]&&E[r].texture){var z=Xe[E[r].texture._texture.format]*$e[E[r].texture._texture.type];null===P&&(P=z)}return p(C),p(I),p(L),T(n),n.width=a,n.height=o,n.colorAttachments=E,n.depthAttachment=C,n.stencilAttachment=I,n.depthStencilAttachment=L,i.color=E.map(y),i.depth=y(C),i.stencil=y(I),i.depthStencil=y(L),i.width=n.width,i.height=n.height,A(n),i}return o.framebufferCount++,i(t,r),e(i,{resize:function(e,t){var r=Math.max(0|e,1),a=Math.max(0|t||r,1);if(r===n.width&&a===n.height)return i;for(var o=n.colorAttachments,s=0;s<o.length;++s)v(o[s],r,a);return v(n.depthAttachment,r,a),v(n.stencilAttachment,r,a),v(n.depthStencilAttachment,r,a),n.width=i.width=r,n.height=i.height=a,A(n),i},_reglType:"framebuffer",_framebuffer:n,destroy:function(){k(n),T(n)},use:function(e){s.setFBO({framebuffer:i},e)}})}return e(s,{getFramebuffer:function(e){if("function"==typeof e&&"framebuffer"===e._reglType){var t=e._framebuffer;if(t instanceof w)return t}return null},create:M,createCube:function(t){var r=Array(6);function n(t){var a,o,s={color:null},l=0,c=null,u="rgba",h="uint8",f=1;if("number"==typeof t)l=0|t;else if(t){var p=t;"shape"in p?l=p.shape[0]:("radius"in p&&(l=0|p.radius),"width"in p?l=0|p.width:"height"in p&&(l=0|p.height)),("color"in p||"colors"in p)&&(c=p.color||p.colors,Array.isArray(c)),c||("colorCount"in p&&(f=0|p.colorCount),"colorType"in p&&(h=p.colorType),"colorFormat"in p&&(u=p.colorFormat)),"depth"in p&&(s.depth=p.depth),"stencil"in p&&(s.stencil=p.stencil),"depthStencil"in p&&(s.depthStencil=p.depthStencil)}else l=1;if(c)if(Array.isArray(c))for(o=[],a=0;a<c.length;++a)o[a]=c[a];else o=[c];else{o=Array(f);var d={radius:l,format:u,type:h};for(a=0;a<f;++a)o[a]=i.createCube(d)}for(s.color=Array(o.length),a=0;a<o.length;++a){var m=o[a];l=l||m.width,s.color[a]={target:34069,data:o[a]}}for(a=0;a<6;++a){for(var g=0;g<o.length;++g)s.color[g].target=34069+a;a>0&&(s.depth=r[0].depth,s.stencil=r[0].stencil,s.depthStencil=r[0].depthStencil),r[a]?r[a](s):r[a]=M(s)}return e(n,{width:l,height:l,color:o})}return n(t),e(n,{faces:r,resize:function(e){var t,i=0|e;if(i===n.width)return n;var a=n.color;for(t=0;t<a.length;++t)a[t].resize(i);for(t=0;t<6;++t)r[t].resize(i);return n.width=n.height=i,n},_reglType:"framebufferCube",destroy:function(){r.forEach((function(e){e.destroy()}))}})},clear:function(){b(_).forEach(k)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,b(_).forEach((function(e){e.framebuffer=t.createFramebuffer(),A(e)}))}})}(n,k,ke,Qe,et,f),rt=Fr(n,h,k,ke,Ce,Ie,0,tt,{},Le,He,Te,we,A,p,r),nt=function(e,t,r,n){function i(i){var a;a=null===t.next?5121:t.next.colorAttachments[0].texture._texture.type;var o=0,s=0,l=n.framebufferWidth,c=n.framebufferHeight,u=null;x(i)?u=i:i&&(o=0|i.x,s=0|i.y,l=0|(i.width||n.framebufferWidth-o),c=0|(i.height||n.framebufferHeight-s),u=i.data||null),r();var h=l*c*4;return u||(5121===a?u=new Uint8Array(h):5126===a&&(u=u||new Float32Array(h))),e.pixelStorei(3333,4),e.readPixels(o,s,l,c,6408,a,u),u}return function(e){return e&&"framebuffer"in e?function(e){var r;return t.setFBO({framebuffer:e.framebuffer},(function(){r=i(e)})),r}(e):i(e)}}(n,tt,rt.procs.poll,we),it=rt.next,at=n.canvas,ot=[],st=[],lt=[],ct=[r.onDestroy],ut=null;function ht(){if(0===ot.length)return A&&A.update(),void(ut=null);ut=s.next(ht),bt();for(var e=ot.length-1;e>=0;--e){var t=ot[e];t&&t(we,null,0)}n.flush(),A&&A.update()}function ft(){!ut&&ot.length>0&&(ut=s.next(ht))}function pt(){ut&&(s.cancel(ht),ut=null)}function dt(e){e.preventDefault(),pt(),st.forEach((function(e){e()}))}function mt(e){n.getError(),a.restore(),He.restore(),Ce.restore(),Qe.restore(),et.restore(),tt.restore(),Le.restore(),A&&A.restore(),rt.procs.refresh(),ft(),lt.forEach((function(e){e()}))}function gt(t){function r(e,t){var r={},n={};return Object.keys(e).forEach((function(i){var a=e[i];if(o.isDynamic(a))n[i]=o.unbox(a,i);else{if(t&&Array.isArray(a))for(var s=0;s<a.length;++s)if(o.isDynamic(a[s]))return void(n[i]=o.unbox(a,i));r[i]=a}})),{dynamic:n,static:r}}var n=r(t.context||{},!0),i=r(t.uniforms||{},!0),a=r(t.attributes||{},!1),s=r(function(t){var r=e({},t);function n(e){if(e in r){var t=r[e];delete r[e],Object.keys(t).forEach((function(n){r[e+"."+n]=t[n]}))}}return delete r.uniforms,delete r.attributes,delete r.context,delete r.vao,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),n("blend"),n("depth"),n("cull"),n("stencil"),n("polygonOffset"),n("scissor"),n("sample"),"vao"in t&&(r.vao=t.vao),r}(t),!1),l={gpuTime:0,cpuTime:0,count:0},c=rt.compile(s,a,i,n,l),u=c.draw,h=c.batch,f=c.scope,p=[];return e((function(e,t){var r;if("function"==typeof e)return f.call(this,null,e,0);if("function"==typeof t)if("number"==typeof e)for(r=0;r<e;++r)f.call(this,null,t,r);else{if(!Array.isArray(e))return f.call(this,e,t,0);for(r=0;r<e.length;++r)f.call(this,e[r],t,r)}else if("number"==typeof e){if(e>0)return h.call(this,function(e){for(;p.length<e;)p.push(null);return p}(0|e),0|e)}else{if(!Array.isArray(e))return u.call(this,e);if(e.length)return h.call(this,e,e.length)}}),{stats:l,destroy:function(){c.destroy()}})}at&&(at.addEventListener(Br,dt,!1),at.addEventListener(jr,mt,!1));var yt=tt.setFBO=gt({framebuffer:o.define.call(null,1,"framebuffer")});function vt(e,t){var r=0;rt.procs.poll();var i=t.color;i&&(n.clearColor(+i[0]||0,+i[1]||0,+i[2]||0,+i[3]||0),r|=16384),"depth"in t&&(n.clearDepth(+t.depth),r|=256),"stencil"in t&&(n.clearStencil(0|t.stencil),r|=1024),n.clear(r)}function xt(e){return ot.push(e),ft(),{cancel:function(){var t=Nr(ot,e);ot[t]=function e(){var t=Nr(ot,e);ot[t]=ot[ot.length-1],ot.length-=1,ot.length<=0&&pt()}}}}function _t(){var e=it.viewport,t=it.scissor_box;e[0]=e[1]=t[0]=t[1]=0,we.viewportWidth=we.framebufferWidth=we.drawingBufferWidth=e[2]=t[2]=n.drawingBufferWidth,we.viewportHeight=we.framebufferHeight=we.drawingBufferHeight=e[3]=t[3]=n.drawingBufferHeight}function bt(){we.tick+=1,we.time=Tt(),_t(),rt.procs.poll()}function wt(){Qe.refresh(),_t(),rt.procs.refresh(),A&&A.update()}function Tt(){return(l()-M)/1e3}wt();var kt=e(gt,{clear:function(t){if("framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var r=0;r<6;++r)yt(e({framebuffer:t.framebuffer.faces[r]},t),vt);else yt(t,vt);else vt(0,t)},prop:o.define.bind(null,1),context:o.define.bind(null,2),this:o.define.bind(null,3),draw:gt({}),buffer:function(e){return Ce.create(e,34962,!1,!1)},elements:function(e){return Ie.create(e,!1)},texture:Qe.create2D,cube:Qe.createCube,renderbuffer:et.create,framebuffer:tt.create,framebufferCube:tt.createCube,vao:Le.createVAO,attributes:i,frame:xt,on:function(e,t){var r;switch(e){case"frame":return xt(t);case"lost":r=st;break;case"restore":r=lt;break;case"destroy":r=ct}return r.push(t),{cancel:function(){for(var e=0;e<r.length;++e)if(r[e]===t)return r[e]=r[r.length-1],void r.pop()}}},limits:ke,hasExtension:function(e){return ke.extensions.indexOf(e.toLowerCase())>=0},read:nt,destroy:function(){ot.length=0,pt(),at&&(at.removeEventListener(Br,dt),at.removeEventListener(jr,mt)),He.clear(),tt.clear(),et.clear(),Le.clear(),Qe.clear(),Ie.clear(),Ce.clear(),A&&A.clear(),ct.forEach((function(e){e()}))},_gl:n,_refresh:wt,poll:function(){bt(),A&&A.update()},now:Tt,stats:f,getCachedCode:function(){return p},preloadCachedCode:function(e){Object.entries(e).forEach((function(e){p[e[0]]=e[1]}))}});return r.onDone(null,kt),kt}},"object"==typeof e&&typeof t<"u"?t.exports=n():r.createREGL=n()}}),Sx=m({"src/lib/prepare_regl.js"(e,t){var r=fm(),n=Mx();t.exports=function(e,t,i){var a=e._fullLayout,o=!0;return a._glcanvas.each((function(r){if(r.regl)r.regl.preloadCachedCode(i);else if(!r.pick||a._has("parcoords")){try{r.regl=n({canvas:this,attributes:{antialias:!r.pick,preserveDrawingBuffer:!0},pixelRatio:e._context.plotGlPixelRatio||window.devicePixelRatio,extensions:t||[],cachedCode:i||{}})}catch{o=!1}r.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(t){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:t,layer:r.key})}),!1)}})),o||r({container:a._glcontainer.node()}),o}}}),Ex=m({"src/traces/scattergl/plot.js"(e,t){var r=Ly(),n=Qv(),i=ex(),a=Ax(),o=ct(),s=Rr().selectMode,l=Sx(),c=Xt(),u=pi(),h=wy().styleTextSelection,f={};function p(e,t,r,n){var i=e._size,a=e.width*n,o=e.height*n,s=i.l*n,l=i.b*n,c=i.r*n,u=i.t*n,h=i.w*n,f=i.h*n;return[s+t.domain[0]*h,l+r.domain[0]*f,a-c-(1-t.domain[1])*h,o-u-(1-r.domain[1])*f]}(t.exports=function(e,t,d){if(d.length){var m,g,y=e._fullLayout,v=t._scene,x=t.xaxis,_=t.yaxis;if(v){if(!l(e,["ANGLE_instanced_arrays","OES_element_index_uint"],f))return void v.init();var b=v.count,w=y._glcanvas.data()[0].regl;if(u(e,t,d),v.dirty){if((v.line2d||v.error2d)&&!(v.scatter2d||v.fill2d||v.glText)&&w.clear({color:!0,depth:!0}),!0===v.error2d&&(v.error2d=i(w)),!0===v.line2d&&(v.line2d=n(w)),!0===v.scatter2d&&(v.scatter2d=r(w)),!0===v.fill2d&&(v.fill2d=n(w)),!0===v.glText)for(v.glText=new Array(b),m=0;m<b;m++)v.glText[m]=new a(w);if(v.glText){if(b>v.glText.length){var T=b-v.glText.length;for(m=0;m<T;m++)v.glText.push(new a(w))}else if(b<v.glText.length){var k=v.glText.length-b;v.glText.splice(b,k).forEach((function(e){e.destroy()}))}for(m=0;m<b;m++)v.glText[m].update(v.textOptions[m])}if(v.line2d&&(v.line2d.update(v.lineOptions),v.lineOptions=v.lineOptions.map((function(e){if(e&&e.positions){for(var t=e.positions,r=0;r<t.length&&(isNaN(t[r])||isNaN(t[r+1]));)r+=2;for(var n=t.length-2;n>r&&(isNaN(t[n])||isNaN(t[n+1]));)n-=2;e.positions=t.slice(r,n+2)}return e})),v.line2d.update(v.lineOptions)),v.error2d){var A=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(A)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=o.repeat(null,b),v.fill2d&&(v.fillOptions=v.fillOptions.map((function(e,t){var r=d[t];if(e&&r&&r[0]&&r[0].trace){var n,i,a=r[0],o=a.trace,s=a.t,l=v.lineOptions[t],c=[];o._ownfill&&c.push(t),o._nexttrace&&c.push(t+1),c.length&&(v.fillOrder[t]=c);var u,h,f=[],p=l&&l.positions||s.positions;if("tozeroy"===o.fill){for(u=0;u<p.length&&isNaN(p[u+1]);)u+=2;for(h=p.length-2;h>u&&isNaN(p[h+1]);)h-=2;0!==p[u+1]&&(f=[p[u],0]),f=f.concat(p.slice(u,h+2)),0!==p[h+1]&&(f=f.concat([p[h],0]))}else if("tozerox"===o.fill){for(u=0;u<p.length&&isNaN(p[u]);)u+=2;for(h=p.length-2;h>u&&isNaN(p[h]);)h-=2;0!==p[u]&&(f=[0,p[u+1]]),f=f.concat(p.slice(u,h+2)),0!==p[h]&&(f=f.concat([0,p[h+1]]))}else if("toself"===o.fill||"tonext"===o.fill){for(f=[],n=0,e.splitNull=!0,i=0;i<p.length;i+=2)(isNaN(p[i])||isNaN(p[i+1]))&&((f=f.concat(p.slice(n,i))).push(p[n],p[n+1]),f.push(null,null),n=i+2);f=f.concat(p.slice(n)),n&&f.push(p[n],p[n+1])}else{var m=o._nexttrace;if(m){var g=v.lineOptions[t+1];if(g){var y=g.positions;if("tonexty"===o.fill){for(f=p.slice(),t=Math.floor(y.length/2);t--;){var x=y[2*t],_=y[2*t+1];isNaN(x)||isNaN(_)||f.push(x,_)}e.fill=m.fillcolor}}}}if(o._prevtrace&&"tonext"===o._prevtrace.fill){var b=v.lineOptions[t-1].positions,w=f.length/2,T=[n=w];for(i=0;i<b.length;i+=2)(isNaN(b[i])||isNaN(b[i+1]))&&(T.push(i/2+w+1),n=i+2);f=f.concat(b),e.hole=T}return e.fillmode=o.fill,e.opacity=o.opacity,e.positions=f,e}})),v.fill2d.update(v.fillOptions))}var M=y.dragmode,S=s(M),E=y.clickmode.indexOf("select")>-1;for(let[e]of d)if(e){var C=e.trace,I=e.t,L=I.index,P=C._length,z=I.x,D=I.y;if(C.selectedpoints||S||E){if(S||(S=!0),C.selectedpoints){var O=v.selectBatch[L]=o.selIndices2selPoints(C),R={};for(g=0;g<O.length;g++)R[O[g]]=1;var F=[];for(g=0;g<P;g++)R[g]||F.push(g);v.unselectBatch[L]=F}var B=I.xpx=new Array(P),j=I.ypx=new Array(P);for(g=0;g<P;g++)B[g]=x.c2p(z[g]),j[g]=_.c2p(D[g])}else I.xpx=I.ypx=null}if(S){if(v.select2d||(v.select2d=r(y._glcanvas.data()[1].regl)),v.scatter2d){var N=new Array(b);for(m=0;m<b;m++)N[m]=v.selectBatch[m].length||v.unselectBatch[m].length?v.markerUnselectedOptions[m]:{};v.scatter2d.update(N)}v.select2d&&(v.select2d.update(v.markerOptions),v.select2d.update(v.markerSelectedOptions)),v.glText&&d.forEach((function(e){var t=((e||[])[0]||{}).trace||{};c.hasText(t)&&h(e)}))}else v.scatter2d&&v.scatter2d.update(v.markerOptions);var U={viewport:p(y,x,_,e._context.plotGlPixelRatio),range:[(x._rl||x.range)[0],(_._rl||_.range)[0],(x._rl||x.range)[1],(_._rl||_.range)[1]]},V=o.repeat(U,v.count);v.fill2d&&v.fill2d.update(V),v.line2d&&v.line2d.update(V),v.error2d&&v.error2d.update(V.concat(V)),v.scatter2d&&v.scatter2d.update(V),v.select2d&&v.select2d.update(V),v.glText&&v.glText.forEach((function(e){e.update(U)}))}}}).reglPrecompiled=f}}),Cx=m({"src/traces/scattergl/index.js"(e,t){var r=ky();r.plot=Ex(),t.exports=r}}),Ix=m({"lib/scattergl.js"(e,t){t.exports=Cx()}}),Lx=m({"src/traces/splom/attributes.js"(e,t){var r=kn(),n=zt(),i=It().axisHoverFormat,{hovertemplateAttrs:a,templatefallbackAttrs:o}=Fe(),s=$g(),l=xt().idRegex,c=vt().templatedArray,u=B().extendFlat,h=r.marker,f=h.line,p=u(n("marker.line",{editTypeOverride:"calc"}),{width:u({},f.width,{editType:"calc"}),editType:"calc"}),d=u(n("marker"),{symbol:h.symbol,angle:h.angle,size:u({},h.size,{editType:"markerSize"}),sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,opacity:h.opacity,colorbar:h.colorbar,line:p,editType:"calc"});function m(e){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:l[e],editType:"plot"}}}d.color.editType=d.cmin.editType=d.cmax.editType="style",t.exports={dimensions:c("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:d,xaxes:m("x"),yaxes:m("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}}}),Px=m({"src/traces/parcoords/merge_length.js"(e,t){t.exports=function(e,t,r,n){var i,a;for(n||(n=1/0),i=0;i<t.length;i++)(a=t[i]).visible&&(n=Math.min(n,a[r].length));for(n===1/0&&(n=0),e._length=n,i=0;i<t.length;i++)(a=t[i]).visible&&(a._length=n);return n}}}),zx=m({"src/traces/splom/defaults.js"(e,t){var r=ct(),n=Nt(),i=Lx(),a=Xt(),o=Yn(),s=Px(),l=Kg().isOpenSymbol;function c(e,t){function n(n,a){return r.coerce(e,t,i.dimensions,n,a)}n("label");var a=n("values");a&&a.length?n("visible"):t.visible=!1,n("axis.type"),n("axis.matches")}t.exports=function(e,t,u,h){function f(n,a){return r.coerce(e,t,i,n,a)}var p=n(e,t,{name:"dimensions",handleItemDefaults:c}),d=f("diagonal.visible"),m=f("showupperhalf"),g=f("showlowerhalf");if(s(t,p,"values")&&(d||m||g)){f("text"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("xhoverformat"),f("yhoverformat"),o(e,t,u,h,f,{noAngleRef:!0,noLineDash:!0,noStandOff:!0});var y=l(t.marker.symbol),v=a.isBubble(t);f("marker.line.width",y||v?1:0),function(e,t,r,n){var i,a,o=t.dimensions,s=o.length,l=t.showupperhalf,c=t.showlowerhalf,u=t.diagonal.visible,h=new Array(s),f=new Array(s);for(i=0;i<s;i++){var p=i?i+1:"";h[i]="x"+p,f[i]="y"+p}var d=n("xaxes",h),m=n("yaxes",f),g=t._diag=new Array(s);t._xaxes={},t._yaxes={};var y=[],v=[];function x(e,n,i,a){if(e){var o=e.charAt(0),s=r._splomAxes[o];if(t["_"+o+"axes"][e]=1,a.push(e),!(e in s)){var l=s[e]={};i&&(l.label=i.label||"",i.visible&&i.axis&&(i.axis.type&&(l.type=i.axis.type),i.axis.matches&&(l.matches=n)))}}}var _=!u&&!c,b=!u&&!l;for(t._axesDim={},i=0;i<s;i++){var w=o[i],T=0===i,k=i===s-1,A=T&&_||k&&b?void 0:d[i],M=T&&b||k&&_?void 0:m[i];x(A,M,w,y),x(M,A,w,v),g[i]=[A,M],t._axesDim[A]=i,t._axesDim[M]=i}for(i=0;i<y.length;i++)for(a=0;a<v.length;a++){var S=y[i]+v[a];(i>a&&l||i<a&&c||i===a&&(u||!c||!l))&&(r._splomSubplots[S]=1)}(!c||!u&&l&&c)&&(r._splomGridDflt.xside="bottom",r._splomGridDflt.yside="left")}(0,t,h,f),r.coerceSelectionMarkerOpacity(t,f)}else t.visible=!1}}}),Dx=m({"src/traces/splom/scene_update.js"(e,t){var r=ct();t.exports=function(e,t){var n=e._fullLayout,i=t.uid,a=n._splomScenes;a||(a=n._splomScenes={});var o={dirty:!0,selectBatch:[],unselectBatch:[]},s=a[t.uid];return s||((s=a[i]=r.extendFlat({},o,{matrix:!1,selectBatch:[],unselectBatch:[]})).draw=function(){s.matrix&&s.matrix.draw&&(s.selectBatch.length||s.unselectBatch.length?s.matrix.draw(s.unselectBatch,s.selectBatch):s.matrix.draw()),s.dirty=!1},s.destroy=function(){s.matrix&&s.matrix.destroy&&s.matrix.destroy(),s.matrixOptions=null,s.selectBatch=null,s.unselectBatch=null,s=null}),s.dirty||r.extendFlat(s,o),s}}}),Ox=m({"src/traces/splom/calc.js"(e,t){var r=ct(),n=_t(),i=si().calcMarkerSize,a=si().calcAxisExpansion,o=ii(),s=xy().markerSelection,l=xy().markerStyle,c=Dx(),u=S().BADNUM,h=Xg().TOO_MANY_POINTS;t.exports=function(e,t){var f,p,d,m,g,y,v=t.dimensions,x=t._length,_={},b=_.cdata=[],w=_.data=[],T=t._visibleDims=[];function k(e,n){for(var i=e.makeCalcdata({v:n.values,vcalendar:t.calendar},"v"),a=0;a<i.length;a++)i[a]=i[a]===u?NaN:i[a];b.push(i),w.push("log"===e.type?r.simpleMap(i,e.c2l):i)}for(f=0;f<v.length;f++)if((d=v[f]).visible){if(m=n.getFromId(e,t._diag[f][0]),g=n.getFromId(e,t._diag[f][1]),m&&g&&m.type!==g.type){r.log("Skipping splom dimension "+f+" with conflicting axis types");continue}m?(k(m,d),g&&"category"===g.type&&(g._categories=m._categories.slice())):k(g,d),T.push(f)}for(o(e,t),r.extendFlat(_,l(e,t)),y=b.length*x>h?_.sizeAvg||Math.max(_.size,3):i(t,x),p=0;p<T.length;p++)d=v[f=T[p]],m=n.getFromId(e,t._diag[f][0])||{},g=n.getFromId(e,t._diag[f][1])||{},a(e,t,m,g,b[p],b[p],y);var A=c(e,t);return A.matrix||(A.matrix=!0),A.matrixOptions=_,A.selectedOptions=s(e,t,t.selected),A.unselectedOptions=s(e,t,t.unselected),[{x:!1,y:!1,t:{},trace:t}]}}}),Rx=m({"node_modules/performance-now/lib/performance-now.js"(e,t){(function(){var e,r,n,i,a,o;typeof performance<"u"&&null!==performance&&performance.now?t.exports=function(){return performance.now()}:typeof c<"u"&&null!==c&&c.hrtime?(t.exports=function(){return(e()-a)/1e6},r=c.hrtime,i=(e=function(){var e;return 1e9*(e=r())[0]+e[1]})(),o=1e9*c.uptime(),a=i-o):Date.now?(t.exports=function(){return Date.now()-n},n=Date.now()):(t.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(e)}}),Fx=m({"node_modules/raf/index.js"(e,t){var r,n,i,a,o,s=Rx(),l=window,c=["moz","webkit"],u="AnimationFrame",h=l["request"+u],f=l["cancel"+u]||l["cancelRequest"+u];for(r=0;!h&&r<c.length;r++)h=l[c[r]+"Request"+u],f=l[c[r]+"Cancel"+u]||l[c[r]+"CancelRequest"+u];(!h||!f)&&(n=0,i=0,a=[],o=1e3/60,h=function(e){if(0===a.length){var t=s(),r=Math.max(0,o-(t-n));n=r+t,setTimeout((function(){var e=a.slice(0);a.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(n)}catch(e){setTimeout((function(){throw e}),0)}}),Math.round(r))}return a.push({handle:++i,callback:e,cancelled:!1}),i},f=function(e){for(var t=0;t<a.length;t++)a[t].handle===e&&(a[t].cancelled=!0)}),t.exports=function(e){return h.call(l,e)},t.exports.cancel=function(){f.apply(l,arguments)},t.exports.polyfill=function(e){e||(e=l),e.requestAnimationFrame=h,e.cancelAnimationFrame=f}}}),Bx=m({"node_modules/array-range/index.js"(e,t){t.exports=function(e,t){var r="number"==typeof e,n="number"==typeof t;r&&!n?(t=e,e=0):!r&&!n&&(e=0,t=0);var i=(t|=0)-(e|=0);if(i<0)throw new Error("array length must be positive");for(var a=new Array(i),o=0,s=e;o<i;o++,s++)a[o]=s;return a}}}),jx=m({"node_modules/regl-splom/index.js"(e,t){var r=Ly(),n=ty(),i=ny(),a=Fx(),o=Bx(),s=ry(),l=ay();function c(e,t){if(!(this instanceof c))return new c(e,t);this.traces=[],this.passes={},this.regl=e,this.scatter=r(e),this.canvas=this.scatter.canvas}function u(e,t,r){return(null!=e.id?e.id:e)<<16|(255&t)<<8|255&r}function h(e,t,r){let n,i,a,o,s,l,c,u,h=e[t],f=e[r];return h.length>2?(n=h[0],a=h[2],i=h[1],o=h[3]):h.length?(n=i=h[0],a=o=h[1]):(n=h.x,i=h.y,a=h.x+h.width,o=h.y+h.height),f.length>2?(s=f[0],c=f[2],l=f[1],u=f[3]):f.length?(s=l=f[0],c=u=f[1]):(s=f.x,l=f.y,c=f.x+f.width,u=f.y+f.height),[s,i,c,o]}function f(e){if("number"==typeof e)return[e,e,e,e];if(2===e.length)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]}}t.exports=c,c.prototype.render=function(...e){return e.length&&this.update(...e),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=a((()=>{this.draw(),this.dirty=!0,this.planned=null}))):(this.draw(),this.dirty=!0,a((()=>{this.dirty=!1}))),this)},c.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=[],r=0;for(let e=0;e<this.traces.length;e++){let n=this.traces[e],i=this.traces[e].passes;for(let e=0;e<i.length;e++)t.push(this.passes[i[e]]);n.passOffset=r,r+=n.passes.length}return this.scatter.update(...t),this},c.prototype.updateItem=function(e,t){let{regl:r}=this;if(null===t)return this.traces[e]=null,this;if(!t)return this;let a,o=n(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"}),c=this.traces[e]||(this.traces[e]={id:e,buffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),color:"black",marker:null,size:12,borderColor:"transparent",borderSize:1,viewport:s([r._gl.drawingBufferWidth,r._gl.drawingBufferHeight]),padding:[0,0,0,0],opacity:1,diagonal:!0,upper:!0,lower:!0});if(null!=o.color&&(c.color=o.color),null!=o.size&&(c.size=o.size),null!=o.marker&&(c.marker=o.marker),null!=o.borderColor&&(c.borderColor=o.borderColor),null!=o.borderSize&&(c.borderSize=o.borderSize),null!=o.opacity&&(c.opacity=o.opacity),o.viewport&&(c.viewport=s(o.viewport)),null!=o.diagonal&&(c.diagonal=o.diagonal),null!=o.upper&&(c.upper=o.upper),null!=o.lower&&(c.lower=o.lower),o.data){c.buffer(l(o.data)),c.columns=o.data.length,c.count=o.data[0].length,c.bounds=[];for(let e=0;e<c.columns;e++)c.bounds[e]=i(o.data[e],1)}o.range&&(c.range=o.range,a=c.range&&"number"!=typeof c.range[0]),o.domain&&(c.domain=o.domain);let p=!1;null!=o.padding&&(Array.isArray(o.padding)&&o.padding.length===c.columns&&"number"==typeof o.padding[o.padding.length-1]?(c.padding=o.padding.map(f),p=!0):c.padding=f(o.padding));let d=c.columns,m=c.count,g=c.viewport.width,y=c.viewport.height,v=c.viewport.x,x=c.viewport.y,_=g/d,b=y/d;c.passes=[];for(let e=0;e<d;e++)for(let t=0;t<d;t++){if(!c.diagonal&&t===e||!c.upper&&e>t||!c.lower&&e<t)continue;let r=u(c.id,e,t),n=this.passes[r]||(this.passes[r]={});if(o.data&&(o.transpose?n.positions={x:{buffer:c.buffer,offset:t,count:m,stride:d},y:{buffer:c.buffer,offset:e,count:m,stride:d}}:n.positions={x:{buffer:c.buffer,offset:t*m,count:m},y:{buffer:c.buffer,offset:e*m,count:m}},n.bounds=h(c.bounds,e,t)),o.domain||o.viewport||o.data){let r=p?h(c.padding,e,t):c.padding;if(c.domain){let[i,a,o,s]=h(c.domain,e,t);n.viewport=[v+i*g+r[0],x+a*y+r[1],v+o*g-r[2],x+s*y-r[3]]}else n.viewport=[v+t*_+_*r[0],x+e*b+b*r[1],v+(t+1)*_-_*r[2],x+(e+1)*b-b*r[3]]}o.color&&(n.color=c.color),o.size&&(n.size=c.size),o.marker&&(n.marker=c.marker),o.borderSize&&(n.borderSize=c.borderSize),o.borderColor&&(n.borderColor=c.borderColor),o.opacity&&(n.opacity=c.opacity),o.range&&(n.range=a?h(c.range,e,t):c.range||n.bounds),c.passes.push(r)}return this},c.prototype.draw=function(...e){if(e.length){let t=[];for(let r=0;r<e.length;r++)if("number"==typeof e[r]){let{passes:n,passOffset:i}=this.traces[e[r]];t.push(...o(i,i+n.length))}else if(e[r].length){let n=e[r],{passes:i,passOffset:a}=this.traces[r];i=i.map(((e,r)=>{t[a+r]=n}))}this.scatter.draw(...t)}else this.scatter.draw();return this},c.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}}}),Nx=m({"src/traces/splom/plot.js"(e,t){var r=jx(),n=ct(),i=_t(),a=Rr().selectMode;function o(e,t){var o,s,l,c,u,h=e._fullLayout,f=h._size,p=t.trace,d=t.t,m=h._splomScenes[p.uid],g=m.matrixOptions,y=g.cdata,v=h._glcanvas.data()[0].regl,x=h.dragmode;if(0!==y.length){g.lower=p.showupperhalf,g.upper=p.showlowerhalf,g.diagonal=p.diagonal.visible;var _=p._visibleDims,b=y.length,w=m.viewOpts={};for(w.ranges=new Array(b),w.domains=new Array(b),u=0;u<_.length;u++){l=_[u];var T=w.ranges[u]=new Array(4),k=w.domains[u]=new Array(4);(o=i.getFromId(e,p._diag[l][0]))&&(T[0]=o._rl[0],T[2]=o._rl[1],k[0]=o.domain[0],k[2]=o.domain[1]),(s=i.getFromId(e,p._diag[l][1]))&&(T[1]=s._rl[0],T[3]=s._rl[1],k[1]=s.domain[0],k[3]=s.domain[1])}var A=e._context.plotGlPixelRatio,M=f.l*A,S=f.b*A,E=f.w*A,C=f.h*A;w.viewport=[M,S,E+M,C+S],!0===m.matrix&&(m.matrix=r(v));var I=h.clickmode.indexOf("select")>-1,L=!0;if(a(x)||p.selectedpoints||I){var P=p._length;if(p.selectedpoints){m.selectBatch=p.selectedpoints;var z=p.selectedpoints,D={};for(l=0;l<z.length;l++)D[z[l]]=!0;var O=[];for(l=0;l<P;l++)D[l]||O.push(l);m.unselectBatch=O}var R=d.xpx=new Array(b),F=d.ypx=new Array(b);for(u=0;u<_.length;u++){if(l=_[u],o=i.getFromId(e,p._diag[l][0]))for(R[u]=new Array(P),c=0;c<P;c++)R[u][c]=o.c2p(y[u][c]);if(s=i.getFromId(e,p._diag[l][1]))for(F[u]=new Array(P),c=0;c<P;c++)F[u][c]=s.c2p(y[u][c])}if(m.selectBatch.length||m.unselectBatch.length){var B=n.extendFlat({},g,m.unselectedOptions,w),j=n.extendFlat({},g,m.selectedOptions,w);m.matrix.update(B,j),L=!1}}else d.xpx=d.ypx=null;if(L){var N=n.extendFlat({},g,w);m.matrix.update(N,null)}}}t.exports=function(e,t,r){if(r.length)for(var n=0;n<r.length;n++)o(e,r[n][0])}}}),Ux=m({"src/traces/splom/helpers.js"(e){e.getDimIndex=function(e,t){for(var r=t._id,n={x:0,y:1}[r.charAt(0)],i=e._visibleDims,a=0;a<i.length;a++){var o=i[a];if(e._diag[o][n]===r)return a}return!1}}}),Vx=m({"src/traces/splom/hover.js"(e,t){var r=Ux(),n=Yg().calcHover,i=ar().getFromId,a=B().extendFlat;function o(e,t,i,a){var o=e.cd[0].trace,s=e.scene.matrixOptions.cdata,l=e.xa,c=e.ya,u=l.c2p(t),h=c.c2p(i),f=e.distance,p=r.getDimIndex(o,l),d=r.getDimIndex(o,c);if(!1===p||!1===d)return[e];for(var m,g,y=s[p],v=s[d],x=f,_=0;_<y.length;_++)if(!a||_===e.index){var b=y[_],w=v[_],T=l.c2p(b)-u,k=c.c2p(w)-h,A=Math.sqrt(T*T+k*k);(a||A<x)&&(x=g=A,m=_)}return e.index=m,e.distance=x,e.dxy=g,void 0===m?[e]:[n(e,y,v,o)]}t.exports={hoverPoints:function(e,t,r,n,s){s||(s={});var l="x"===(n||"").charAt(0),c="y"===(n||"").charAt(0),u=o(e,t,r);if((l||c)&&"axis"===s.hoversubplots&&u[0])for(var h=(l?e.xa:e.ya)._subplotsWith,f=s.gd,p=a({},e),d=0;d<h.length;d++){var m=h[d];if(m!==e.xa._id+e.ya._id){c?p.xa=i(f,m,"x"):p.ya=i(f,m,"y");var g=o(p,t,r,l||c);u=u.concat(g)}}return u}}}}),qx=m({"src/traces/splom/select.js"(e,t){var r=ct(),n=r.pushUnique,i=Xt(),a=Ux();t.exports=function(e,t){var o=e.cd,s=o[0].trace,l=o[0].t,c=e.scene,u=c.matrixOptions.cdata,h=e.xaxis,f=e.yaxis,p=[];if(!c)return p;var d=!i.hasMarkers(s)&&!i.hasText(s);if(!0!==s.visible||d)return p;var m=a.getDimIndex(s,h),g=a.getDimIndex(s,f);if(!1===m||!1===g)return p;var y=l.xpx[m],v=l.ypx[g],x=u[m],_=u[g],b=(e.scene.selectBatch||[]).slice(),w=[];if(!1!==t&&!t.degenerate)for(var T=0;T<x.length;T++)t.contains([y[T],v[T]],null,T,e)?(p.push({pointNumber:T,x:x[T],y:_[T]}),n(b,T)):-1!==b.indexOf(T)?n(b,T):w.push(T);var k=c.matrixOptions;return b.length||w.length?!c.selectBatch.length&&!c.unselectBatch.length&&c.matrix.update(c.unselectedOptions,r.extendFlat({},k,c.selectedOptions,c.viewOpts)):c.matrix.update(k,null),c.selectBatch=b,c.unselectBatch=w,p}}}),Hx=m({"src/traces/splom/edit_style.js"(e,t){var r=ct(),n=ii(),i=xy().markerStyle;t.exports=function(e,t){var a=t.trace,o=e._fullLayout._splomScenes[a.uid];if(o){n(e,a),r.extendFlat(o.matrixOptions,i(e,a));var s=r.extendFlat({},o.matrixOptions,o.viewOpts);o.matrix.update(s,null)}}}}),Gx=m({"src/traces/splom/base_index.js"(e,t){var r=He(),n=Sa();t.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:Lx(),supplyDefaults:zx(),colorbar:mi(),calc:Ox(),plot:Nx(),hoverPoints:Vx().hoverPoints,selectPoints:qx(),editStyle:Hx(),meta:{}},r.register(n)}}),Wx=m({"src/traces/splom/base_plot.js"(e,t){var r=Qv(),n=He(),i=Sx(),a=Tt().getModuleCalcData,o=Ci(),s=_t().getFromId,l=ar().shouldShowZeroLine,c="splom",u={};function h(e,t,r){for(var n=r.matrixOptions.data.length,i=t._visibleDims,a=r.viewOpts.ranges=new Array(n),o=0;o<i.length;o++){var l=i[o],c=a[o]=new Array(4),u=s(e,t._diag[l][0]);u&&(c[0]=u.r2l(u.range[0]),c[2]=u.r2l(u.range[1]));var h=s(e,t._diag[l][1]);h&&(c[1]=h.r2l(h.range[0]),c[3]=h.r2l(h.range[1]))}r.selectBatch.length||r.unselectBatch.length?r.matrix.update({ranges:a},{ranges:a}):r.matrix.update({ranges:a})}function f(e){var t=e._fullLayout,n=t._glcanvas.data()[0].regl,i=t._splomGrid;i||(i=t._splomGrid=r(n)),i.update(function(e){var t,r=e._context.plotGlPixelRatio,n=e._fullLayout,i=n._size,a=[0,0,n.width*r,n.height*r],o={};function s(e,t,n,i,s,l){n*=r,i*=r,s*=r,l*=r;var c=t[e+"color"],u=t[e+"width"],h=String(c+u);h in o?o[h].data.push(NaN,NaN,n,i,s,l):o[h]={data:[n,i,s,l],join:"rect",thickness:u*r,color:c,viewport:a,range:a,overlay:!1}}for(t in n._splomSubplots){var c,u,h=n._plots[t],f=h.xaxis,p=h.yaxis,d=f._gridVals,m=p._gridVals,g=f._offset,y=f._length,v=p._length,x=i.b+p.domain[0]*i.h,_=-p._m,b=-_*p.r2l(p.range[0],p.calendar);if(f.showgrid)for(t=0;t<d.length;t++)c=g+f.l2p(d[t].x),s("grid",f,c,x,c,x+v);if(p.showgrid)for(t=0;t<m.length;t++)s("grid",p,g,u=x+b+_*m[t].x,g+y,u);l(e,f,p)&&(c=g+f.l2p(0),s("zeroline",f,c,x,c,x+v)),l(e,p,f)&&s("zeroline",p,g,u=x+b+0,g+y,u)}var w=[];for(t in o)w.push(o[t]);return w}(e))}t.exports={name:c,attr:o.attr,attrRegex:o.attrRegex,layoutAttributes:o.layoutAttributes,supplyLayoutDefaults:o.supplyLayoutDefaults,drawFramework:o.drawFramework,plot:function(e){var t=e._fullLayout,r=n.getModule(c),o=a(e.calcdata,r)[0];i(e,["ANGLE_instanced_arrays","OES_element_index_uint"],u)&&(t._hasOnlyLargeSploms&&f(e),r.plot(e,{},o))},drag:function(e){var t=e.calcdata,r=e._fullLayout;r._hasOnlyLargeSploms&&f(e);for(var n=0;n<t.length;n++){var i=t[n][0].trace,a=r._splomScenes[i.uid];"splom"===i.type&&a&&a.matrix&&h(e,i,a)}},updateGrid:f,clean:function(e,t,r,n){var i,a={};if(n._splomScenes){for(i=0;i<e.length;i++){var s=e[i];"splom"===s.type&&(a[s.uid]=1)}for(i=0;i<r.length;i++){var l=r[i];if(!a[l.uid]){var c=n._splomScenes[l.uid];c&&c.destroy&&c.destroy(),n._splomScenes[l.uid]=null,delete n._splomScenes[l.uid]}}}0===Object.keys(n._splomScenes||{}).length&&delete n._splomScenes,n._splomGrid&&!t._hasOnlyLargeSploms&&n._hasOnlyLargeSploms&&(n._splomGrid.destroy(),n._splomGrid=null,delete n._splomGrid),o.clean(e,t,r,n)},updateFx:o.updateFx,toSVG:o.toSVG,reglPrecompiled:u}}}),Zx=m({"src/traces/splom/index.js"(e,t){var r=Gx();r.basePlotModule=Wx(),t.exports=r}}),Yx=m({"lib/splom.js"(e,t){t.exports=Zx()}}),Xx=m({"src/traces/parcoords/attributes.js"(e,t){var r=zt(),n=Lt(),i=j(),a=Ma().attributes,o=B().extendFlat,s=vt().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({},n.tickvals,{editType:"plot"}),ticktext:o({},n.ticktext,{editType:"plot"}),tickformat:o({},n.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"},r("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"}}}}),$x=m({"src/traces/parcoords/constants.js"(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"}}}}),Kx=m({"src/lib/gup.js"(e,t){var r=We();function n(e){return[e]}t.exports={keyFun:function(e){return e.key},repeat:n,descend:r,wrap:n,unwrap:function(e){return e[0]}}}}),Jx=m({"src/traces/parcoords/axisbrush.js"(e,t){var r=$x(),n=b(),i=Kx().keyFun,a=Kx().repeat,o=ct().sorterAsc,s=ct().strTranslate,l=r.bar.snapRatio;function c(e,t){return e*(1-l)+t*l}var u=r.bar.snapClose;function h(e,t){return e*(1-u)+t*u}function f(e,t,r,n){if(function(e,t){for(var r=0;r<t.length;r++)if(e>=t[r][0]&&e<=t[r][1])return!0;return!1}(r,n))return r;var i=e?-1:1,a=0,o=t.length-1;if(i<0){var s=a;a=o,o=s}for(var l=t[a],u=l,f=a;i*f<i*o;f+=i){var p=f+i,d=t[p];if(i*r<i*h(l,d))return c(l,u);if(i*r<i*d||p===o)return c(d,l);u=l,l=d}}function p(e){e.attr("x",-r.bar.captureWidth/2).attr("width",r.bar.captureWidth)}function d(e){e.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function m(e){if(!e.brush.filterSpecified)return"0,"+e.height;for(var t,r,n,i=g(e.brush.filter.getConsolidated(),e.height),a=[0],o=i.length?i[0][0]:null,s=0;s<i.length;s++)r=(t=i[s])[1]-t[0],a.push(o),a.push(r),(n=s+1)<i.length&&(o=i[n][0]-t[1]);return a.push(e.height),a}function g(e,t){return e.map((function(e){return e.map((function(e){return Math.max(0,e*t)})).sort(o)}))}function y(){n.select(document.body).style("cursor",null)}function v(e){e.attr("stroke-dasharray",m)}function x(e,t){var i=n.select(e).selectAll(".highlight, .highlight-shadow");v(t?i.transition().duration(r.bar.snapDuration).each("end",t):i)}function _(e,t){var n,i=e.brush,a=NaN,o={};if(i.filterSpecified){var s=e.height,l=i.filter.getConsolidated(),c=g(l,s),u=NaN,h=NaN,f=NaN;for(n=0;n<=c.length;n++){var p=c[n];if(p&&p[0]<=t&&t<=p[1]){u=n;break}if(h=n?n-1:NaN,p&&p[0]>t){f=n;break}}if(a=u,isNaN(a)&&(a=isNaN(h)||isNaN(f)?isNaN(h)?f:h:t-c[h][1]<c[f][0]-t?h:f),!isNaN(a)){var d=c[a],m=function(e,t){var n=r.bar.handleHeight;if(!(t>e[1]+n||t<e[0]-n))return t>=.9*e[1]+.1*e[0]?"n":t<=.9*e[0]+.1*e[1]?"s":"ns"}(d,t);m&&(o.interval=l[a],o.intervalPix=d,o.region=m)}}if(e.ordinal&&!o.region){var y=e.unitTickvals,v=e.unitToPaddedPx.invert(t);for(n=0;n<y.length;n++){var x=[.25*y[Math.max(n-1,0)]+.75*y[n],.25*y[Math.min(n+1,y.length-1)]+.75*y[n]];if(v>=x[0]&&v<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(e,t){n.event.sourceEvent.stopPropagation();var i=t.height-n.mouse(e)[1]-2*r.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 T(e,t){var i=_(t,t.height-n.mouse(e)[1]-2*r.verticalPadding),a="crosshair";i.clickableOrdinalRange?a="pointer":i.region&&(a=i.region+"-resize"),n.select(document.body).style("cursor",a)}function k(e){e.on("mousemove",(function(e){n.event.preventDefault(),e.parent.inBrushDrag||T(this,e)})).on("mouseleave",(function(e){e.parent.inBrushDrag||y()})).call(n.behavior.drag().on("dragstart",(function(e){!function(e,t){n.event.sourceEvent.stopPropagation();var i=t.height-n.mouse(e)[1]-2*r.verticalPadding,a=t.unitToPaddedPx.invert(i),o=t.brush,s=_(t,i),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(t.unitToPaddedPx);c.grabPoint=i-u[0]-r.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=t.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(e){return e[0]!==l[0]&&e[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,t.parent.inBrushDrag=!0,c.brushStartCallback()}(this,e)})).on("drag",(function(e){w(this,e)})).on("dragend",(function(e){!function(e,t){var r=t.brush,i=r.filter,a=r.svgBrush;a._dragging||(T(e,t),w(e,t),t.brush.svgBrush.wasDragged=!1),a._dragging=!1,n.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,t.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&t.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&M(r)):M(r),a.brushCallback(t),x(e.parentNode),void a.brushEndCallback(r.filterSpecified?i.getConsolidated():[]);var s=function(){i.set(i.getConsolidated())};if(t.ordinal){var l=t.unitTickvals;l[l.length-1]<l[0]&&l.reverse(),a.newExtent=[f(0,l,a.newExtent[0],a.stayingIntervals),f(1,l,a.newExtent[1],a.stayingIntervals)];var c=a.newExtent[1]>a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||M(r),a.brushCallback(t),c?x(e.parentNode,s):(s(),x(e.parentNode))}else s();a.brushEndCallback(r.filterSpecified?i.getConsolidated():[])}(this,e)})))}function A(e,t){return e[0]-t[0]}function M(e){e.filterSpecified=!1,e.svgBrush.extent=[[-1/0,1/0]]}function S(e){return function(t){var r=t.brush,n=function(e){return e.svgBrush.extent.map((function(e){return e.slice()}))}(r),i=n.slice();r.filter.set(i),e()}}function E(e){for(var t,r=e.slice(),n=[],i=r.shift();i;){for(t=i.slice();(i=r.shift())&&i[0]<=t[1];)t[1]=Math.max(t[1],i[1]);n.push(t)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}t.exports={makeBrush:function(e,t,r,n,i,a){var s=function(){var e,t,r=[];return{set:function(n){1===(r=n.map((function(e){return e.slice().sort(o)})).sort(A)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),e=E(r),t=r.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return e},getBounds:function(){return t}}}();return s.set(r),{filter:s,filterSpecified:t,svgBrush:{extent:[],brushStartCallback:n,brushCallback:S(i),brushEndCallback:a}}},ensureAxisBrush:function(e,t,n){var o=e.selectAll("."+r.cn.axisBrush).data(a,i);o.enter().append("g").classed(r.cn.axisBrush,!0),function(e,t,n){var i=n._context.staticPlot,o=e.selectAll(".background").data(a);o.enter().append("rect").classed("background",!0).call(p).call(d).style("pointer-events",i?"none":"auto").attr("transform",s(0,r.verticalPadding)),o.call(k).attr("height",(function(e){return e.height-r.verticalPadding}));var l=e.selectAll(".highlight-shadow").data(a);l.enter().append("line").classed("highlight-shadow",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width+r.bar.strokeWidth).attr("stroke",t).attr("opacity",r.bar.strokeOpacity).attr("stroke-linecap","butt"),l.attr("y1",(function(e){return e.height})).call(v);var c=e.selectAll(".highlight").data(a);c.enter().append("line").classed("highlight",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width-r.bar.strokeWidth).attr("stroke",r.bar.fillColor).attr("opacity",r.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",(function(e){return e.height})).call(v)}(o,t,n)},cleanRanges:function(e,t){if(Array.isArray(e[0])?(e=e.map((function(e){return e.sort(o)})),e=t.multiselect?E(e.sort(A)):[e[0]]):e=[e.sort(o)],t.tickvals){var r=t.tickvals.slice().sort(o);if(!(e=e.map((function(e){var t=[f(0,r,e[0],[]),f(1,r,e[1],[])];if(t[1]>t[0])return t})).filter((function(e){return e}))).length)return}return e.length>1?e:e[0]}}}}),Qx=m({"src/traces/parcoords/defaults.js"(e,t){var r=ct(),n=Ct().hasColorscale,i=Ht(),a=Ma().defaults,o=Nt(),s=ar(),l=Xx(),c=Jx(),u=$x().maxDimensionCount,h=Px();function f(e,t,n,i){function a(n,i){return r.coerce(e,t,l.dimensions,n,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");var h=a("range");t._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:h},s.setConvert(t._ax,i.layout),a("multiselect");var f=a("constraintrange");f&&(t.constraintrange=c.cleanRanges(f,t))}}t.exports=function(e,t,s,c){function p(n,i){return r.coerce(e,t,l,n,i)}var d=e.dimensions;Array.isArray(d)&&d.length>u&&(r.log("parcoords traces support up to "+u+" dimensions at the moment"),d.splice(u));var m=o(e,t,{name:"dimensions",layout:c,handleItemDefaults:f}),g=function(e,t,a,o,s){var l=s("line.color",a);if(n(e,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=a}return 1/0}(e,t,s,c,p);a(t,c,p),(!Array.isArray(m)||!m.length)&&(t.visible=!1),h(t,m,"values",g);var y=r.extendFlat({},c.font,{size:Math.round(c.font.size/1.2)});r.coerceFont(p,"labelfont",y),r.coerceFont(p,"tickfont",y,{autoShadowDflt:!0}),r.coerceFont(p,"rangefont",y),p("labelangle"),p("labelside"),p("unselected.line.color"),p("unselected.line.opacity")}}}),e_=m({"src/traces/parcoords/calc.js"(e,t){var r=ct().isArrayOrTypedArray,n=Yt(),i=Kx().wrap;t.exports=function(e,t){var a,o;return n.hasColorscale(t,"line")&&r(t.line.color)?(a=t.line.color,o=n.extractOpts(t.line).colorscale,n.calc(e,t,{vals:a,containerStr:"line",cLetter:"c"})):(a=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=.5;return t}(t._length),o=[[0,t.line.color],[1,t.line.color]]),i({lineColor:a,cscale:o})}}});function t_(e){var t,r,n,i,a=[],o=1;if("number"==typeof e)return{space:"rgb",values:[e>>>16,(65280&e)>>>8,255&e],alpha:1};if("number"==typeof e)return{space:"rgb",values:[e>>>16,(65280&e)>>>8,255&e],alpha:1};if(e=String(e).toLowerCase(),r_.default[e])a=r_.default[e].slice(),i="rgb";else if("transparent"===e)o=0,i="rgb",a=[0,0,0];else if("#"===e[0]){var s=e.slice(1),l=s.length;o=1,l<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===l&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===l&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(n=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var c=n[1],u="cmyk"===(i=c.replace(/a$/,""))?4:"gray"===i?1:3;a=n[2].trim().split(/\s*[,\/]\s*|\s+/),"color"===i&&(i=a.shift()),o=(a=a.map((function(e,t){if("%"===e[e.length-1])return e=parseFloat(e)/100,3===t?e:"rgb"===i?255*e:"h"===i[0]||"l"===i[0]&&!t?100*e:"lab"===i?125*e:"lch"===i?t<2?150*e:360*e:"o"!==i[0]||t?"oklab"===i?.4*e:"oklch"===i?t<2?.4*e:360*e:e:e;if("h"===i[t]||2===t&&"h"===i[i.length-1]){if(void 0!==i_[e])return i_[e];if(e.endsWith("deg"))return parseFloat(e);if(e.endsWith("turn"))return 360*parseFloat(e);if(e.endsWith("grad"))return 360*parseFloat(e)/400;if(e.endsWith("rad"))return 180*parseFloat(e)/Math.PI}return"none"===e?0:parseFloat(e)}))).length>u?a.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(a=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),i=(null==(r=null==(t=e.match(/([a-z])/gi))?void 0:t.join(""))?void 0:r.toLowerCase())||"rgb");return{space:i,values:a,alpha:o}}var r_,n_,i_,a_,o_,s_=d({"node_modules/color-parse/index.js"(){var r,n;n=null!=(r=Xd())?e(s(r)):{},r_=y(t(n,"default",{value:r,enumerable:!0}),r),n_=t_,i_={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),l_=d({"node_modules/color-space/rgb.js"(){a_={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),c_=d({"node_modules/color-space/hsl.js"(){l_(),o_={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(e){var t,r,n,i,a,o=e[0]/360,s=e[1]/100,l=e[2]/100,c=0;if(0===s)return[a=255*l,a,a];for(t=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];c<3;)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,i[c++]=255*a;return i}},a_.hsl=function(e){var t,r,n=e[0]/255,i=e[1]/255,a=e[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?t=0:n===s?t=(i-a)/l:i===s?t=2+(a-n)/l:a===s&&(t=4+(n-i)/l),(t=Math.min(60*t,360))<0&&(t+=360),r=(o+s)/2,[t,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}}}),u_={};function h_(e){Array.isArray(e)&&e.raw&&(e=String.raw(...arguments)),e instanceof Number&&(e=+e);var t,r=n_(e);if(!r.space)return[];let n="h"===r.space[0]?o_.min:a_.min,i="h"===r.space[0]?o_.max:a_.max;return(t=Array(3))[0]=Math.min(Math.max(r.values[0],n[0]),i[0]),t[1]=Math.min(Math.max(r.values[1],n[1]),i[1]),t[2]=Math.min(Math.max(r.values[2],n[2]),i[2]),"h"===r.space[0]&&(t=o_.rgb(t)),t.push(Math.min(Math.max(r.alpha,0),1)),t}g(u_,{default:()=>h_});var f_=d({"node_modules/color-rgba/index.js"(){s_(),l_(),c_()}}),p_=m({"src/traces/parcoords/helpers.js"(e){var t=ct().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)}}}),d_=m({"src/traces/parcoords/lines.js"(e,t){var r=["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("\n"),n=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join("\n"),i=$x().maxDimensionCount,a=ct(),o=1e-6,s=2048,l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function h(e,t,r,n,i){var a=e._gl;a.enable(a.SCISSOR_TEST),a.scissor(t,r,n,i),e.clear({color:[0,0,0,0],depth:1})}function f(e,t,r,n,i,a){var o=a.key;r.drawCompleted||(function(e){e.read({x:0,y:0,width:1,height:1,data:l})}(e),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],h(e,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),!r.clearOnly&&(a.count=2*c,a.offset=2*l*n,t(a),l*n+c<i&&(r.currentRafs[o]=window.requestAnimationFrame((function(){s(l+1)}))),r.drawCompleted=!1)}(0)}function p(e){return Math.max(o,Math.min(1-o,e))}function d(e,t){for(var r=new Array(256),n=0;n<256;n++)r[n]=e(n/255).concat(t);return r}function m(e,t){return(e>>>8*t)%256/255}function g(e,t,r){for(var n=new Array(8*t),i=0,a=0;a<t;a++)for(var o=0;o<2;o++)for(var s=0;s<4;s++){var l=4*e+s,c=r[64*a+l];63===l&&0===o&&(c*=-1),n[i++]=c}return n}function y(e){return("0"+e).slice(-2)}function v(e){return e<i?"p"+y(e+1)+"_"+y(e+4):"colors"}function x(e,t,r,n,i,o,s,l,c,u,h,f,p,d){for(var m=[[],[]],g=0;g<64;g++)m[0][g]=g===i?1:0,m[1][g]=g===o?1:0;s*=d,l*=d,c*=d,u*=d;var y=e.lines.canvasOverdrag*d,v=e.domain,x=e.canvasWidth*d,_=e.canvasHeight*d,b=e.pad.l*d,w=e.pad.b*d,T=e.layoutHeight*d,k=e.layoutWidth*d,A=e.deselectedLines.color,M=e.deselectedLines.opacity;return a.extendFlat({key:h,resolution:[x,_],viewBoxPos:[s+y,l],viewBoxSize:[c,u],i0:i,i1:o,dim0A:m[0].slice(0,16),dim0B:m[0].slice(16,32),dim0C:m[0].slice(32,48),dim0D:m[0].slice(48,64),dim1A:m[1].slice(0,16),dim1B:m[1].slice(16,32),dim1C:m[1].slice(32,48),dim1D:m[1].slice(48,64),drwLayer:f,contextColor:[A[0]/255,A[1]/255,A[2]/255,"auto"!==M?A[3]*M:Math.max(1/255,Math.pow(1/e.lines.color.length,1/3))],scissorX:(n===t?0:s+y)+(b-y)+k*v.x[0],scissorWidth:(n===r?x-s+y:c+.5)+(n===t?s+y:0),scissorY:l+w+T*v.y[0],scissorHeight:u,viewportX:b-y+k*v.x[0],viewportY:w+T*v.y[0],viewportWidth:x,viewportHeight:_},p)}function _(e){var t=s-1,r=Math.max(0,Math.floor(e[0]*t),0),n=Math.min(t,Math.ceil(e[1]*t),t);return[Math.min(r,n),Math.max(r,n)]}t.exports=function(e,t){var o,l,y,b,w,T=t.context,k=t.pick,A=t.regl,M=A._gl,S=M.getParameter(M.ALIASED_LINE_WIDTH_RANGE),E=Math.max(S[0],Math.min(S[1],t.viewModel.plotGlPixelRatio)),C={currentRafs:{},drawCompleted:!0,clearOnly:!1},I=function(e){for(var t={},r=0;r<=i;r+=4)t[v(r)]=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)});return t}(A),L=A.texture(u),P=[];D(t);var z=A({profile:!1,blend:{enable:T,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:!T,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:A.prop("scissorX"),y:A.prop("scissorY"),width:A.prop("scissorWidth"),height:A.prop("scissorHeight")}},viewport:{x:A.prop("viewportX"),y:A.prop("viewportY"),width:A.prop("viewportWidth"),height:A.prop("viewportHeight")},dither:!1,vert:r,frag:n,primitive:"lines",lineWidth:E,attributes:I,uniforms:{resolution:A.prop("resolution"),viewBoxPos:A.prop("viewBoxPos"),viewBoxSize:A.prop("viewBoxSize"),dim0A:A.prop("dim0A"),dim1A:A.prop("dim1A"),dim0B:A.prop("dim0B"),dim1B:A.prop("dim1B"),dim0C:A.prop("dim0C"),dim1C:A.prop("dim1C"),dim0D:A.prop("dim0D"),dim1D:A.prop("dim1D"),loA:A.prop("loA"),hiA:A.prop("hiA"),loB:A.prop("loB"),hiB:A.prop("hiB"),loC:A.prop("loC"),hiC:A.prop("hiC"),loD:A.prop("loD"),hiD:A.prop("hiD"),palette:L,contextColor:A.prop("contextColor"),maskTexture:A.prop("maskTexture"),drwLayer:A.prop("drwLayer"),maskHeight:A.prop("maskHeight")},offset:A.prop("offset"),count:A.prop("count")});function D(e){o=e.model,l=e.viewModel,y=l.dimensions.slice(),b=y[0]?y[0].values.length:0;var t=o.lines,r=k?t.color.map((function(e,r){return r/t.color.length})):t.color,n=function(e,t,r){for(var n=new Array(e*(i+4)),a=0,o=0;o<e;o++){for(var s=0;s<i;s++)n[a++]=s<t.length?t[s].paddedUnitValues[o]:.5;n[a++]=m(o,2),n[a++]=m(o,1),n[a++]=m(o,0),n[a++]=p(r[o])}return n}(b,y,r);(function(e,t,r){for(var n=0;n<=i;n+=4)e[v(n)](g(n/4,t,r))})(I,b,n),!T&&!k&&(L=A.texture(a.extendFlat({data:d(o.unitToColor,255)},u)))}return{render:function(e,t,r){var n,i,a,l=e.length,c=1/0,u=-1/0;for(n=0;n<l;n++)e[n].dim0.canvasX<c&&(c=e[n].dim0.canvasX,i=n),e[n].dim1.canvasX>u&&(u=e[n].dim1.canvasX,a=n);0===l&&h(A,0,0,o.canvasWidth,o.canvasHeight);var p=function(e){var t,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!e&&n<y.length?y[n].brush.filter.getBounds():[-1/0,1/0];i[0][n]=a[0],i[1][n]=a[1]}var o=8*s,l=new Array(o);for(t=0;t<o;t++)l[t]=255;if(!e)for(t=0;t<y.length;t++){var c=t%8,u=(t-c)/8,h=Math.pow(2,c),f=y[t].brush.filter.get();if(!(f.length<2)){var p=_(f[0])[1];for(r=1;r<f.length;r++){var d=_(f[r]);for(n=p+1;n<d[0];n++)l[8*n+u]&=~h;p=Math.max(p,d[1])}}}var m={shape:[8,s],format:"alpha",type:"uint8",mag:"nearest",min:"nearest",data:l};return w?w(m):w=A.texture(m),{maskTexture:w,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)}}(T);for(n=0;n<l;n++){var d=e[n],m=d.dim0.crossfilterDimensionIndex,g=d.dim1.crossfilterDimensionIndex,v=d.canvasX,M=d.canvasY,S=v+d.panelSizeX,E=d.plotGlPixelRatio;if(t||!P[m]||P[m][0]!==v||P[m][1]!==S){P[m]=[v,S];var I=x(o,i,a,n,m,g,v,M,d.panelSizeX,d.panelSizeY,d.dim0.crossfilterDimensionIndex,T?0:k?2:1,p,E);C.clearOnly=r;var L=t?o.lines.blockLineCount:b;f(A,z,C,L,b,I)}}},readPixel:function(e,t){return A.read({x:e,y:t,width:1,height:1,data:c}),c},readPixels:function(e,t,r,n){var i=new Uint8Array(4*r*n);return A.read({x:e,y:t,width:r,height:n,data:i}),i},destroy:function(){for(var t in e.style["pointer-events"]="none",L.destroy(),w&&w.destroy(),I)I[t].destroy()},update:D}}}}),m_=m({"src/traces/parcoords/parcoords.js"(e,t){var r=b(),n=ct(),i=n.isArrayOrTypedArray,a=n.numberFormat,o=(f_(),v(u_)).default,s=ar(),l=n.strRotate,c=n.strTranslate,u=Et(),h=er(),f=Yt(),p=Kx(),d=p.keyFun,m=p.repeat,g=p.unwrap,y=p_(),x=$x(),_=Jx(),w=d_();function T(e,t,r){return n.aggNums(e,null,t,r)}function k(e,t){return M(T(Math.min,e,t),T(Math.max,e,t))}function A(e){var t=e.range;return t?M(t[0],t[1]):k(e.values,e._length)}function M(e,t){return(isNaN(e)||!isFinite(e))&&(e=0),(isNaN(t)||!isFinite(t))&&(t=0),e===t&&(0===e?(e-=1,t+=1):(e*=.9,t*=1.1)),[e,t]}function S(e,t,n,i,o){var s=A(n);return i?r.scale.ordinal().domain(i.map(function(e,t){return t?function(r,n){return t[n]??e(r)}:e}(a(n.tickformat),o))).range(i.map((function(r){var n=(r-s[0])/(s[1]-s[0]);return e-t+n*(2*t-e)}))):r.scale.linear().domain(s).range([e-t,t])}function E(e){if(e.tickvals){var t=A(e);return r.scale.ordinal().domain(e.tickvals).range(e.tickvals.map((function(e){return(e-t[0])/(t[1]-t[0])})))}}function C(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){var t=o(e[1]);return r.rgb("rgb("+t[0]+","+t[1]+","+t[2]+")")})),i="rgb".split("").map((function(e){return r.scale.linear().clamp(!0).domain(t).range(n.map(function(e){return function(t){return t[e]}}(e)))}));return function(e){return i.map((function(t){return t(e)}))}}function I(e){return e.dimensions.some((function(e){return e.brush.filterSpecified}))}function L(e,t,i){var a=g(t),s=a.trace,l=y.convertTypedArray(a.lineColor),c=s.line,u={color:o(s.unselected.line.color),opacity:s.unselected.line.opacity},h=f.extractOpts(c),p=h.reversescale?f.flipScale(a.cscale):a.cscale,d=s.domain,m=s.dimensions,v=e.width,_=s.labelangle,b=s.labelside,w=s.labelfont,T=s.tickfont,k=s.rangefont,M=n.extendDeepNoArrays({},c,{color:l.map(r.scale.linear().domain(A({values:l,range:[h.min,h.max],_length:s._length}))),blockLineCount:x.blockLineCount,canvasOverdrag:x.overdrag*x.canvasPixelRatio}),S=Math.floor(v*(d.x[1]-d.x[0])),E=Math.floor(e.height*(d.y[1]-d.y[0])),I=e.margin||{l:80,r:80,t:100,b:80},L=S,P=E;return{key:i,colCount:m.filter(y.isVisible).length,dimensions:m,tickDistance:x.tickDistance,unitToColor:C(p),lines:M,deselectedLines:u,labelAngle:_,labelSide:b,labelFont:w,tickFont:T,rangeFont:k,layoutWidth:v,layoutHeight:e.height,domain:d,translateX:d.x[0]*v,translateY:e.height-d.y[1]*e.height,pad:I,canvasWidth:L*x.canvasPixelRatio+2*M.canvasOverdrag,canvasHeight:P*x.canvasPixelRatio,width:L,height:P,canvasPixelRatio:x.canvasPixelRatio}}function P(e,t,o){var s=o.width,l=o.height,c=o.dimensions,u=o.canvasPixelRatio,h=function(e){return s*e/Math.max(1,o.colCount-1)},f=x.verticalPadding/l,p=function(e,t){return r.scale.linear().range([t,e-t])}(l,x.verticalPadding),d={key:o.key,xScale:h,model:o,inBrushDrag:!1},m={};return d.dimensions=c.filter(y.isVisible).map((function(s,c){var g=function(e,t){return r.scale.linear().domain(A(e)).range([t,1-t])}(s,f),v=m[s.label];m[s.label]=(v||0)+1;var b=s.label+(v?"__"+v:""),w=s.constraintrange,T=w&&w.length;T&&!i(w[0])&&(w=[w]);var k=T?w.map((function(e){return e.map(g)})):[[-1/0,1/0]],M=s.values;M.length>s._length&&(M=M.slice(0,s._length));var C,L=s.tickvals;function P(e,t){return{val:e,text:C[t]}}function z(e,t){return e.val-t.val}if(i(L)&&L.length){n.isTypedArray(L)&&(L=Array.from(L)),C=s.ticktext,i(C)&&C.length?C.length>L.length?C=C.slice(0,L.length):L.length>C.length&&(L=L.slice(0,C.length)):C=L.map(a(s.tickformat));for(var D=1;D<L.length;D++)if(L[D]<L[D-1]){for(var O=L.map(P).sort(z),R=0;R<L.length;R++)L[R]=O[R].val,C[R]=O[R].text;break}}else L=void 0;return M=y.convertTypedArray(M),{key:b,label:s.label,tickFormat:s.tickformat,tickvals:L,ticktext:C,ordinal:y.isOrdinal(s),multiselect:s.multiselect,xIndex:c,crossfilterDimensionIndex:c,visibleIndex:s._index,height:l,values:M,paddedUnitValues:M.map(g),unitTickvals:L&&L.map(g),xScale:h,x:h(c),canvasX:h(c)*u,unitToPaddedPx:p,domainScale:S(l,x.verticalPadding,s,L,C),ordinalScale:E(s),parent:d,model:o,brush:_.makeBrush(e,T,k,(function(){e.linePickActive(!1)}),(function(){var t=d;t.focusLayer&&t.focusLayer.render(t.panels,!0);var r=I(t);!e.contextShown()&&r?(t.contextLayer&&t.contextLayer.render(t.panels,!0),e.contextShown(!0)):e.contextShown()&&!r&&(t.contextLayer&&t.contextLayer.render(t.panels,!0,!0),e.contextShown(!1))}),(function(r){if(d.focusLayer.render(d.panels,!0),d.pickLayer&&d.pickLayer.render(d.panels,!0),e.linePickActive(!0),t&&t.filterChanged){var i=g.invert,a=r.map((function(e){return e.map(i).sort(n.sorterAsc)})).sort((function(e,t){return e[0]-t[0]}));t.filterChanged(d.key,s._index,a)}}))}})),d}function z(e){e.classed(x.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default")}function D(e,t){var r="top"===t?1:-1,n=e*Math.PI/180;return{dir:r,dx:Math.sin(n),dy:Math.cos(n),degrees:e}}function O(e,t,r){for(var n=t.panels||(t.panels=[]),i=e.data(),a=0;a<i.length-1;a++){var o=n[a]||(n[a]={}),s=i[a],l=i[a+1];o.dim0=s,o.dim1=l,o.canvasX=s.canvasX,o.panelSizeX=l.canvasX-s.canvasX,o.panelSizeY=t.model.canvasHeight,o.y=0,o.canvasY=0,o.plotGlPixelRatio=r}}function R(e,t){return s.tickText(e._ax,t,!1).text}function F(e,t){if(e.ordinal)return"";var r=e.domainScale.domain(),n=r[t?r.length-1:0];return R(e.model.dimensions[e.visibleIndex],n)}t.exports=function(e,t,i,a){var o=e._context.staticPlot,f=e._fullLayout,p=f._toppaper,v=f._glcontainer,b=e._context.plotGlPixelRatio,T=e._fullLayout.paper_bgcolor;!function(e){for(var t=0;t<e.length;t++)for(var r=0;r<e[t].length;r++)for(var n=e[t][r].trace,i=n.dimensions,a=0;a<i.length;a++){var o=i[a].values,l=i[a]._ax;l&&(l.range?l.range=M(l.range[0],l.range[1]):l.range=k(o,n._length),l.dtick||(l.dtick=.01*(Math.abs(l.range[1]-l.range[0])||1)),l.tickformat=i[a].tickformat,s.calcTicks(l),l.cleanRange())}}(t);var A=function(){var e=!0,t=!1;return{linePickActive:function(t){return arguments.length?e=!!t:e},contextShown:function(e){return arguments.length?t=!!e:t}}}(),S=t.filter((function(e){return g(e).trace.visible})).map(L.bind(0,i)).map(P.bind(0,A,a));v.each((function(e,t){return n.extendFlat(e,S[t])}));var E=v.selectAll(".gl-canvas").each((function(e){e.viewModel=S[0],e.viewModel.plotGlPixelRatio=b,e.viewModel.paperColor=T,e.model=e.viewModel?e.viewModel.model:null})),C=null;E.filter((function(e){return e.pick})).style("pointer-events",o?"none":"auto").on("mousemove",(function(e){if(A.linePickActive()&&e.lineLayer&&a&&a.hover){var t=r.event,n=this.width,i=this.height,o=r.mouse(this),s=o[0],l=o[1];if(s<0||l<0||s>=n||l>=i)return;var c=e.lineLayer.readPixel(s,i-1-l),u=0!==c[3],h=u?c[2]+256*(c[1]+256*c[0]):null,f={x:s,y:l,clientX:t.clientX,clientY:t.clientY,dataIndex:e.model.key,curveNumber:h};h!==C&&(u?a.hover(f):a.unhover&&a.unhover(f),C=h)}})),E.style("opacity",(function(e){return e.pick?0:1})),p.style("background","rgba(255, 255, 255, 0)");var B=p.selectAll("."+x.cn.parcoords).data(S,d);B.exit().remove(),B.enter().append("g").classed(x.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),B.attr("transform",(function(e){return c(e.model.translateX,e.model.translateY)}));var j=B.selectAll("."+x.cn.parcoordsControlView).data(m,d);j.enter().append("g").classed(x.cn.parcoordsControlView,!0),j.attr("transform",(function(e){return c(e.model.pad.l,e.model.pad.t)}));var N=j.selectAll("."+x.cn.yAxis).data((function(e){return e.dimensions}),d);N.enter().append("g").classed(x.cn.yAxis,!0),j.each((function(e){O(N,e,b)})),E.each((function(e){if(e.viewModel){!e.lineLayer||a?e.lineLayer=w(this,e):e.lineLayer.update(e),(e.key||0===e.key)&&(e.viewModel[e.key]=e.lineLayer);var t=!e.context||a;e.lineLayer.render(e.viewModel.panels,t)}})),N.attr("transform",(function(e){return c(e.xScale(e.xIndex),0)})),N.call(r.behavior.drag().origin((function(e){return e})).on("drag",(function(e){var t=e.parent;A.linePickActive(!1),e.x=Math.max(-x.overdrag,Math.min(e.model.width+x.overdrag,r.event.x)),e.canvasX=e.x*e.model.canvasPixelRatio,N.sort((function(e,t){return e.x-t.x})).each((function(t,r){t.xIndex=r,t.x=e===t?t.x:t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio})),O(N,t,b),N.filter((function(t){return 0!==Math.abs(e.xIndex-t.xIndex)})).attr("transform",(function(e){return c(e.xScale(e.xIndex),0)})),r.select(this).attr("transform",c(e.x,0)),N.each((function(r,n,i){i===e.parent.key&&(t.dimensions[n]=r)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!I(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,O(N,t,b),r.select(this).attr("transform",(function(e){return c(e.x,0)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!I(t)),t.focusLayer&&t.focusLayer.render(t.panels),t.pickLayer&&t.pickLayer.render(t.panels,!0),A.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(t.key,t.dimensions.map((function(e){return e.crossfilterDimensionIndex})))}))),N.exit().remove();var U=N.selectAll("."+x.cn.axisOverlays).data(m,d);U.enter().append("g").classed(x.cn.axisOverlays,!0),U.selectAll("."+x.cn.axis).remove();var V=U.selectAll("."+x.cn.axis).data(m,d);V.enter().append("g").classed(x.cn.axis,!0),V.each((function(e){var t=e.model.height/e.model.tickDistance,n=e.domainScale,i=n.domain();r.select(this).call(r.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(t,e.tickFormat).tickValues(e.ordinal?i:null).tickFormat((function(t){return y.isOrdinal(e)?t:R(e.model.dimensions[e.visibleIndex],t)})).scale(n)),h.font(V.selectAll("text"),e.model.tickFont)})),V.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),V.selectAll("text").style("cursor","default");var q=U.selectAll("."+x.cn.axisHeading).data(m,d);q.enter().append("g").classed(x.cn.axisHeading,!0);var H=q.selectAll("."+x.cn.axisTitle).data(m,d);H.enter().append("text").classed(x.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),H.text((function(e){return e.label})).each((function(t){var n=r.select(this);h.font(n,t.model.labelFont),u.convertToTspans(n,e)})).attr("transform",(function(e){var t=D(e.model.labelAngle,e.model.labelSide),r=x.axisTitleOffset;return(t.dir>0?"":c(0,2*r+e.model.height))+l(t.degrees)+c(-r*t.dx,-r*t.dy)})).attr("text-anchor",(function(e){var t=D(e.model.labelAngle,e.model.labelSide);return 2*Math.abs(t.dx)>Math.abs(t.dy)?t.dir*t.dx<0?"start":"end":"middle"}));var G=U.selectAll("."+x.cn.axisExtent).data(m,d);G.enter().append("g").classed(x.cn.axisExtent,!0);var W=G.selectAll("."+x.cn.axisExtentTop).data(m,d);W.enter().append("g").classed(x.cn.axisExtentTop,!0),W.attr("transform",c(0,-x.axisExtentOffset));var Z=W.selectAll("."+x.cn.axisExtentTopText).data(m,d);Z.enter().append("text").classed(x.cn.axisExtentTopText,!0).call(z),Z.text((function(e){return F(e,!0)})).each((function(e){h.font(r.select(this),e.model.rangeFont)}));var Y=G.selectAll("."+x.cn.axisExtentBottom).data(m,d);Y.enter().append("g").classed(x.cn.axisExtentBottom,!0),Y.attr("transform",(function(e){return c(0,e.model.height+x.axisExtentOffset)}));var X=Y.selectAll("."+x.cn.axisExtentBottomText).data(m,d);X.enter().append("text").classed(x.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(z),X.text((function(e){return F(e,!1)})).each((function(e){h.font(r.select(this),e.model.rangeFont)})),_.ensureAxisBrush(U,T,e)}}}),g_=m({"src/traces/parcoords/plot.js"(e,t){var r=m_(),n=Sx(),i=p_().isVisible,a={};function o(e,t,r){var n=t.indexOf(r),i=e.indexOf(n);return-1===i&&(i+=t.length),i}(t.exports=function(e,t){var s=e._fullLayout;if(n(e,[],a)){var l={},c={},u={},h={},f=s._size;t.forEach((function(t,r){var n=t[0].trace;u[r]=n.index;var i=h[r]=n.index;l[r]=e.data[i].dimensions,c[r]=e.data[i].dimensions.slice()})),r(e,t,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(t,r,n){var i=c[t][r],a=n.map((function(e){return e.slice()})),o="dimensions["+r+"].constraintrange",l=s._tracePreGUI[e._fullData[u[t]]._fullInput.uid];if(void 0===l[o]){var f=i.constraintrange;l[o]=f||null}var p=e._fullData[u[t]].dimensions[r];a.length?(1===a.length&&(a=a[0]),i.constraintrange=a,p.constraintrange=a.slice(),a=[a]):(delete i.constraintrange,delete p.constraintrange,a=null);var d={};d[o]=a,e.emit("plotly_restyle",[d,[h[t]]])},hover:function(t){e.emit("plotly_hover",t)},unhover:function(t){e.emit("plotly_unhover",t)},axesMoved:function(t,r){var n=function(e,t){return function(r,n){return o(e,t,r)-o(e,t,n)}}(r,c[t].filter(i));l[t].sort(n),c[t].filter((function(e){return!i(e)})).sort((function(e){return c[t].indexOf(e)})).forEach((function(e){l[t].splice(l[t].indexOf(e),1),l[t].splice(c[t].indexOf(e),0,e)})),e.emit("plotly_restyle",[{dimensions:[l[t]]},[h[t]]])}})}}).reglPrecompiled=a}}),y_=m({"src/traces/parcoords/base_plot.js"(e){var t=b(),r=Tt().getModuleCalcData,n=g_(),i=Mt();e.name="parcoords",e.plot=function(e){var t=r(e.calcdata,"parcoords")[0];t.length&&n(e,t)},e.clean=function(e,t,r,n){var i=n._has&&n._has("parcoords"),a=t._has&&t._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},e.toSVG=function(e){var r=e._fullLayout._glimages,n=t.select(e).selectAll(".svg-container");n.filter((function(e,t){return t===n.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var e=this,t=e.toDataURL("image/png");r.append("svg:image").attr({xmlns:i.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:e.style.width,height:e.style.height})})),window.setTimeout((function(){t.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}}}),v_=m({"src/traces/parcoords/base_index.js"(e,t){t.exports={attributes:Xx(),supplyDefaults:Qx(),calc:e_(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:y_(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),x_=m({"src/traces/parcoords/index.js"(e,t){var r=v_();r.plot=g_(),t.exports=r}}),__=m({"lib/parcoords.js"(e,t){t.exports=x_()}}),b_=m({"src/traces/parcats/attributes.js"(e,t){var r=B().extendFlat,n=q(),i=j(),a=zt(),{hovertemplateAttrs:o,templatefallbackAttrs:s}=Fe(),l=Ma().attributes,c=r({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:l({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:r({},n.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:c,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}}}),w_=m({"src/traces/parcats/defaults.js"(e,t){var r=ct(),n=Ct().hasColorscale,i=Ht(),a=Ma().defaults,o=Nt(),s=b_(),l=Px(),c=I().isTypedArraySpec;function u(e,t){function n(n,i){return r.coerce(e,t,s.dimensions,n,i)}var i=n("values"),a=n("visible");if(i&&i.length||(a=t.visible=!1),a){n("label"),n("displayindex",t._index);var o,l=e.categoryarray,u=r.isArrayOrTypedArray(l)&&l.length>0||c(l);u&&(o="array");var h=n("categoryorder",o);"array"===h?(n("categoryarray"),n("ticktext")):(delete e.categoryarray,delete e.ticktext),!u&&"array"===h&&(t.categoryorder="trace")}}t.exports=function(e,t,c,h){function f(n,i){return r.coerce(e,t,s,n,i)}var p=o(e,t,{name:"dimensions",handleItemDefaults:u}),d=function(e,t,a,o,s){s("line.shape"),s("line.hovertemplate"),s("line.hovertemplatefallback");var l=s("line.color",o.colorway[0]);if(n(e,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=a}return 1/0}(e,t,c,h,f);a(t,h,f),(!Array.isArray(p)||!p.length)&&(t.visible=!1),l(t,p,"values",d),f("hoveron"),f("hovertemplate"),f("hovertemplatefallback"),f("arrangement"),f("bundlecolors"),f("sortpaths"),f("counts");var m=h.font;r.coerceFont(f,"labelfont",m,{overrideDflt:{size:Math.round(m.size)}}),r.coerceFont(f,"tickfont",m,{autoShadowDflt:!0,overrideDflt:{size:Math.round(m.size/1.2)}})}}}),T_=m({"src/traces/parcats/calc.js"(e,t){var r=Kx().wrap,n=Ct().hasColorscale,i=Zt(),a=at(),o=er(),s=ct(),l=M();function c(e,t,r,n){return{dimensionInd:e,categoryInd:t,categoryValue:r,displayInd:t,categoryLabel:n,valueInds:[],count:0,dragY:null}}function u(e,t,r){e.valueInds.push(t),e.count+=r}function h(e,t,r){return{categoryInds:e,color:t,rawColor:r,valueInds:[],count:0}}function f(e,t,r){e.valueInds.push(t),e.count+=r}t.exports=function(e,t){var p=s.filterVisible(t.dimensions);if(0===p.length)return[];var d,m,g,y=p.map((function(e){var t;if("trace"===e.categoryorder)t=null;else if("array"===e.categoryorder)t=e.categoryarray;else{t=a(e.values);for(var r=!0,n=0;n<t.length;n++)if(!l(t[n])){r=!1;break}t.sort(r?s.sorterAsc:void 0),"category descending"===e.categoryorder&&(t=t.reverse())}return function(e,t){t=null==t?[]:t.map((function(e){return e}));var r={},n={},i=[];t.forEach((function(e,t){r[e]=0,n[e]=t}));for(var a=0;a<e.length;a++){var o,s=e[a];void 0===r[s]?(r[s]=1,o=t.push(s)-1,n[s]=o):(r[s]++,o=n[s]),i.push(o)}var l=t.map((function(e){return r[e]}));return{uniqueValues:t,uniqueCounts:l,inds:i}}(e.values,t)}));d=s.isArrayOrTypedArray(t.counts)?t.counts:[t.counts],function(e){var t,r=e.map((function(e){return e.displayindex}));if(function(e){for(var t=new Array(e.length),r=0;r<e.length;r++){if(e[r]<0||e[r]>=e.length||void 0!==t[e[r]])return!1;t[e[r]]=!0}return!0}(r))for(t=0;t<e.length;t++)e[t]._displayindex=e[t].displayindex;else for(t=0;t<e.length;t++)e[t]._displayindex=t}(p),p.forEach((function(e,t){!function(e,t){e._categoryarray=t.uniqueValues,null===e.ticktext||void 0===e.ticktext?e._ticktext=[]:e._ticktext=e.ticktext.slice();for(var r=e._ticktext.length;r<t.uniqueValues.length;r++)e._ticktext.push(t.uniqueValues[r])}(e,y[t])}));var v,x=t.line;x?(n(t,"line")&&i(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),v=o.tryColorscale(x)):v=s.identity;var _,b,w,T,k,A=p[0].values.length,M={},S=y.map((function(e){return e.inds}));for(g=0,_=0;_<A;_++){var E=[];for(b=0;b<S.length;b++)E.push(S[b][_]);m=d[_%d.length],g+=m;var C=(w=_,T=void 0,k=void 0,s.isArrayOrTypedArray(x.color)?k=T=x.color[w%x.color.length]:T=x.color,{color:v(T),rawColor:k}),I=E+"-"+C.rawColor;void 0===M[I]&&(M[I]=h(E,C.color,C.rawColor)),f(M[I],_,m)}var L=p.map((function(e,t){return function(e,t,r,n,i){return{dimensionInd:e,containerInd:t,displayInd:r,dimensionLabel:n,count:i,categories:[],dragX:null}}(t,e._index,e._displayindex,e.label,g)}));for(_=0;_<A;_++)for(m=d[_%d.length],b=0;b<L.length;b++){var P=L[b].containerInd,z=y[b].inds[_],D=L[b].categories;if(void 0===D[z]){var O=t.dimensions[P]._categoryarray[z],R=t.dimensions[P]._ticktext[z];D[z]=c(b,z,O,R)}u(D[z],_,m)}return r(function(e,t,r){var n=e.map((function(e){return e.categories.length})).reduce((function(e,t){return Math.max(e,t)}));return{dimensions:e,paths:t,trace:void 0,maxCats:n,count:r}}(L,M,g))}}}),k_=m({"src/traces/parcats/parcats.js"(e,t){var r=b(),n=(td(),v(ed)).interpolateNumber,i=On(),a=Or(),o=ct(),s=o.strTranslate,l=er(),c=F(),u=Et();function h(e,t,n,i){var a=t._context.staticPlot,c=e.map(j.bind(0,t,n)),h=i.selectAll("g.parcatslayer").data([null]);h.enter().append("g").attr("class","parcatslayer").style("pointer-events",a?"none":"all");var y=h.selectAll("g.trace.parcats").data(c,f),v=y.enter().append("g").attr("class","trace parcats");y.attr("transform",(function(e){return s(e.x,e.y)})),v.append("g").attr("class","paths");var x=y.select("g.paths").selectAll("path.path").data((function(e){return e.paths}),f);x.attr("fill",(function(e){return e.model.color}));var b=x.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(e){return e.model.color})).attr("fill-opacity",0);w(b),x.attr("d",(function(e){return e.svgD})),b.empty()||x.sort(d),x.exit().remove(),x.on("mouseover",m).on("mouseout",g).on("click",_),v.append("g").attr("class","dimensions");var T=y.select("g.dimensions").selectAll("g.dimension").data((function(e){return e.dimensions}),f);T.enter().append("g").attr("class","dimension"),T.attr("transform",(function(e){return s(e.x,0)})),T.exit().remove();var M=T.selectAll("g.category").data((function(e){return e.categories}),f),S=M.enter().append("g").attr("class","category");M.attr("transform",(function(e){return s(0,e.y)})),S.append("rect").attr("class","catrect").attr("pointer-events","none"),M.select("rect.catrect").attr("fill","none").attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})),k(S);var E=M.selectAll("rect.bandrect").data((function(e){return e.bands}),f);E.each((function(){o.raiseToTop(this)})),E.attr("fill",(function(e){return e.color}));var C=E.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(e){return e.color})).attr("fill-opacity",0);E.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"fixed"===e.parcatsViewModel.arrangement?"default":"perpendicular"===e.parcatsViewModel.arrangement?"ns-resize":"move"})),A(C),E.exit().remove(),S.append("text").attr("class","catlabel").attr("pointer-events","none"),M.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){l.font(r.select(this),e.parcatsViewModel.categorylabelfont),u.convertToTspans(r.select(this),t)})),S.append("text").attr("class","dimlabel"),M.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(e){return e.width/2})).attr("y",-5).text((function(e,t){return 0===t?e.parcatsViewModel.model.dimensions[e.model.dimensionInd].dimensionLabel:null})).each((function(e){l.font(r.select(this),e.parcatsViewModel.labelfont)})),M.selectAll("rect.bandrect").on("mouseover",I).on("mouseout",L),M.exit().remove(),T.call(r.behavior.drag().origin((function(e){return{x:e.x,y:0}})).on("dragstart",P).on("drag",z).on("dragend",D)),y.each((function(e){e.traceSelection=r.select(this),e.pathSelection=r.select(this).selectAll("g.paths").selectAll("path.path"),e.dimensionSelection=r.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),y.exit().remove()}function f(e){return e.key}function p(e){var t=e.parcatsViewModel.dimensions.length,r=e.parcatsViewModel.dimensions[t-1].model.dimensionInd;return e.model.dimensionInd===r}function d(e,t){return e.model.rawColor>t.model.rawColor?1:e.model.rawColor<t.model.rawColor?-1:0}function m(e){if(!e.parcatsViewModel.dragDimension&&-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){o.raiseToTop(this),T(r.select(this));var t=y(e),n=x(e);if(e.parcatsViewModel.graphDiv.emit("plotly_hover",{points:t,event:r.event,constraints:n}),-1===e.parcatsViewModel.hoverinfoItems.indexOf("none")){var i,s,l,u=r.mouse(this)[0],h=e.parcatsViewModel.graphDiv,f=e.parcatsViewModel.trace,p=h._fullLayout,d=p._paperdiv.node().getBoundingClientRect(),m=e.parcatsViewModel.graphDiv.getBoundingClientRect();for(l=0;l<e.leftXs.length-1;l++)if(e.leftXs[l]+e.dimWidths[l]-2<=u&&u<=e.leftXs[l+1]+2){var g=e.parcatsViewModel.dimensions[l],v=e.parcatsViewModel.dimensions[l+1];i=(g.x+g.width+v.x)/2,s=(e.topYs[l]+e.topYs[l+1]+e.height)/2;break}var _=e.parcatsViewModel.x+i,b=e.parcatsViewModel.y+s,w=c.mostReadable(e.model.color,["black","white"]),k=e.model.count,A=k/e.parcatsViewModel.model.count,M={countLabel:k,probabilityLabel:A.toFixed(3)},S=[];-1!==e.parcatsViewModel.hoverinfoItems.indexOf("count")&&S.push(["Count:",M.countLabel].join(" ")),-1!==e.parcatsViewModel.hoverinfoItems.indexOf("probability")&&S.push(["P:",M.probabilityLabel].join(" "));var E=S.join("<br>"),C=r.mouse(h)[0];a.loneHover({trace:f,x:_-d.left+m.left,y:b-d.top+m.top,text:E,color:e.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:w,idealAlign:C<_?"right":"left",hovertemplate:(f.line||{}).hovertemplate,hovertemplateLabels:M,eventData:[{data:f._input,fullData:f,count:k,probability:A}]},{container:p._hoverlayer.node(),outerContainer:p._paper.node(),gd:h})}}}function g(e){if(!e.parcatsViewModel.dragDimension&&(w(r.select(this)),a.loneUnhover(e.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),e.parcatsViewModel.pathSelection.sort(d),-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip"))){var t=y(e),n=x(e);e.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:t,event:r.event,constraints:n})}}function y(e){for(var t=[],r=O(e.parcatsViewModel),n=0;n<e.model.valueInds.length;n++){var i=e.model.valueInds[n];t.push({curveNumber:r,pointNumber:i})}return t}function x(e){for(var t={},r=e.parcatsViewModel.model.dimensions,n=0;n<r.length;n++){var i=r[n],a=i.categories[e.model.categoryInds[n]];t[i.containerInd]=a.categoryValue}return void 0!==e.model.rawColor&&(t.color=e.model.rawColor),t}function _(e){if(-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){var t=y(e),n=x(e);e.parcatsViewModel.graphDiv.emit("plotly_click",{points:t,event:r.event,constraints:n})}}function w(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 T(e){e.attr("fill-opacity",.8).attr("stroke",(function(e){return c.mostReadable(e.model.color,["black","white"])})).attr("stroke-width",.3)}function k(e){e.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function A(e){e.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function M(e){var t=e.parcatsViewModel.pathSelection,r=e.categoryViewModel.model.dimensionInd,n=e.categoryViewModel.model.categoryInd;return t.filter((function(t){return t.model.categoryInds[r]===n&&t.model.color===e.color}))}function S(e,t,n){var i=r.select(e).datum(),a=i.categoryViewModel.model,o=i.parcatsViewModel.graphDiv,s=r.select(e.parentNode).selectAll("rect.bandrect"),l=[];s.each((function(e){M(e).each((function(e){Array.prototype.push.apply(l,y(e))}))}));var c={};c[a.dimensionInd]=a.categoryValue,o.emit(t,{points:l,event:n,constraints:c})}function E(e,t,n){var i=r.select(e).datum(),a=i.categoryViewModel.model,o=i.parcatsViewModel.graphDiv,s=M(i),l=[];s.each((function(e){Array.prototype.push.apply(l,y(e))}));var c={};c[a.dimensionInd]=a.categoryValue,void 0!==i.rawColor&&(c.color=i.rawColor),o.emit(t,{points:l,event:n,constraints:c})}function C(e,t,n){e._fullLayout._calcInverseTransform(e);var i,a,o=e._fullLayout._invScaleX,s=e._fullLayout._invScaleY,l=r.select(n.parentNode).select("rect.catrect"),c=l.node().getBoundingClientRect(),u=l.datum(),h=u.parcatsViewModel,f=h.model.dimensions[u.model.dimensionInd],p=h.trace,d=c.top+c.height/2;h.dimensions.length>1&&f.displayInd===h.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,y=m/u.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:g,probabilityLabel:y.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",v.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var _=x.join("<br>");return{trace:p,x:o*(i-t.left),y:s*(d-t.top),text:_,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:p.hovertemplate,hovertemplateLabels:v,eventData:[{data:p._input,fullData:p,count:m,category:g,probability:y}]}}function I(e){if(!e.parcatsViewModel.dragDimension&&-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(r.mouse(this)[1]<-1)return;var t,n=e.parcatsViewModel.graphDiv,i=n._fullLayout,s=i._paperdiv.node().getBoundingClientRect(),l=e.parcatsViewModel.hoveron,u=this;"color"===l?(function(e){var t=r.select(e).datum(),n=M(t);T(n),n.each((function(){o.raiseToTop(this)})),r.select(e.parentNode).selectAll("rect.bandrect").filter((function(e){return e.color===t.color})).each((function(){o.raiseToTop(this),function(e){e.attr("stroke","black").attr("stroke-width",1.5)}(r.select(this))}))}(u),E(u,"plotly_hover",r.event)):(function(e){r.select(e.parentNode).selectAll("rect.bandrect").each((function(e){var t=M(e);T(t),t.each((function(){o.raiseToTop(this)}))})),function(e){e.select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(r.select(e.parentNode))}(u),S(u,"plotly_hover",r.event)),-1===e.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?t=C(n,s,u):"color"===l?t=function(e,t,n){e._fullLayout._calcInverseTransform(e);var i,a,o=e._fullLayout._invScaleX,s=e._fullLayout._invScaleY,l=n.getBoundingClientRect(),u=r.select(n).datum(),h=u.categoryViewModel,f=h.parcatsViewModel,p=f.model.dimensions[h.model.dimensionInd],d=f.trace,m=l.y+l.height/2;f.dimensions.length>1&&p.displayInd===f.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=h.model.categoryLabel,y=u.parcatsViewModel.model.count,v=0;u.categoryViewModel.bands.forEach((function(e){e.color===u.color&&(v+=e.count)}));var x=h.model.count,_=0;f.pathSelection.each((function(e){e.model.color===u.color&&(_+=e.model.count)}));var b=v/y,w=v/_,T=v/x,k={countLabel:v,categoryLabel:g,probabilityLabel:b.toFixed(3)},A=[];-1!==h.parcatsViewModel.hoverinfoItems.indexOf("count")&&A.push(["Count:",k.countLabel].join(" ")),-1!==h.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(A.push("P(color ∩ "+g+"): "+k.probabilityLabel),A.push("P("+g+" | color): "+w.toFixed(3)),A.push("P(color | "+g+"): "+T.toFixed(3)));var M=A.join("<br>"),S=c.mostReadable(u.color,["black","white"]);return{trace:d,x:o*(i-t.left),y:s*(m-t.top),text:M,color:u.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:k,eventData:[{data:d._input,fullData:d,category:g,count:y,probability:b,categorycount:x,colorcount:_,bandcolorcount:v}]}}(n,s,u):"dimension"===l&&(t=function(e,t,n){var i=[];return r.select(n.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(C(e,t,this))})),i}(n,s,u)),t&&a.loneHover(t,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:n}))}}function L(e){var t=e.parcatsViewModel;t.dragDimension||(w(t.pathSelection),k(t.dimensionSelection.selectAll("g.category")),A(t.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),a.loneUnhover(t.graphDiv._fullLayout._hoverlayer.node()),t.pathSelection.sort(d),-1!==t.hoverinfoItems.indexOf("skip"))||("color"===e.parcatsViewModel.hoveron?E(this,"plotly_unhover",r.event):S(this,"plotly_unhover",r.event))}function P(e){"fixed"!==e.parcatsViewModel.arrangement&&(e.dragDimensionDisplayInd=e.model.displayInd,e.initialDragDimensionDisplayInds=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),e.dragHasMoved=!1,e.dragCategoryDisplayInd=null,r.select(this).selectAll("g.category").select("rect.catrect").each((function(t){var n=r.mouse(this)[0],i=r.mouse(this)[1];-2<=n&&n<=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),r.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 z(e){if("fixed"!==e.parcatsViewModel.arrangement&&(e.dragHasMoved=!0,null!==e.dragDimensionDisplayInd)){var t=e.dragDimensionDisplayInd,n=t-1,i=t+1,a=e.parcatsViewModel.dimensions[t];if(null!==e.dragCategoryDisplayInd){var o=a.categories[e.dragCategoryDisplayInd];o.model.dragY+=r.event.dy;var s=o.model.dragY,l=o.model.displayInd,c=a.categories,u=c[l-1],h=c[l+1];void 0!==u&&s<u.y+u.height/2&&(o.model.displayInd=u.model.displayInd,u.model.displayInd=l),void 0!==h&&s+o.height>h.y+h.height/2&&(o.model.displayInd=h.model.displayInd,h.model.displayInd=l),e.dragCategoryDisplayInd=o.model.displayInd}if(null===e.dragCategoryDisplayInd||"freeform"===e.parcatsViewModel.arrangement){a.model.dragX=r.event.x;var f=e.parcatsViewModel.dimensions[n],p=e.parcatsViewModel.dimensions[i];void 0!==f&&a.model.dragX<f.x+f.width&&(a.model.displayInd=f.model.displayInd,f.model.displayInd=t),void 0!==p&&a.model.dragX+a.width>p.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=e.dragDimensionDisplayInd),e.dragDimensionDisplayInd=a.model.displayInd}V(e.parcatsViewModel),U(e.parcatsViewModel),B(e.parcatsViewModel),R(e.parcatsViewModel)}}function D(e){if("fixed"!==e.parcatsViewModel.arrangement&&null!==e.dragDimensionDisplayInd){r.select(this).selectAll("text").attr("font-weight","normal");var t={},n=O(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(r,n){var i=e.parcatsViewModel.model.dimensions[n].containerInd;t["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==e.dragCategoryDisplayInd){var l=e.model.categories.map((function(e){return e.displayInd}));if(s=e.initialDragCategoryDisplayInds.some((function(e,t){return e!==l[t]}))){var c=e.model.categories.slice().sort((function(e,t){return e.displayInd-t.displayInd})),u=c.map((function(e){return e.categoryValue})),h=c.map((function(e){return e.categoryLabel}));t["dimensions["+e.model.containerInd+"].categoryarray"]=[u],t["dimensions["+e.model.containerInd+"].ticktext"]=[h],t["dimensions["+e.model.containerInd+"].categoryorder"]="array"}}-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!e.dragHasMoved&&e.potentialClickBand&&("color"===e.parcatsViewModel.hoveron?E(e.potentialClickBand,"plotly_click",r.event.sourceEvent):S(e.potentialClickBand,"plotly_click",r.event.sourceEvent)),e.model.dragX=null,null!==e.dragCategoryDisplayInd&&(e.parcatsViewModel.dimensions[e.dragDimensionDisplayInd].categories[e.dragCategoryDisplayInd].model.dragY=null,e.dragCategoryDisplayInd=null),e.dragDimensionDisplayInd=null,e.parcatsViewModel.dragDimension=null,e.dragHasMoved=null,e.potentialClickBand=null,V(e.parcatsViewModel),U(e.parcatsViewModel),r.transition().duration(300).ease("cubic-in-out").each((function(){B(e.parcatsViewModel,!0),R(e.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&i.restyle(e.parcatsViewModel.graphDiv,t,[n])}))}}function O(e){for(var t,r=e.graphDiv._fullData,n=0;n<r.length;n++)if(e.key===r[n].uid){t=n;break}return t}function R(e,t){var r;void 0===t&&(t=!1),e.pathSelection.data((function(e){return e.paths}),f),(r=e.pathSelection,t?r.transition():r).attr("d",(function(e){return e.svgD}))}function B(e,t){function n(e){return t?e.transition():e}void 0===t&&(t=!1),e.dimensionSelection.data((function(e){return e.dimensions}),f);var i=e.dimensionSelection.selectAll("g.category").data((function(e){return e.categories}),f);n(e.dimensionSelection).attr("transform",(function(e){return s(e.x,0)})),n(i).attr("transform",(function(e){return s(0,e.y)})),i.select(".dimlabel").text((function(e,t){return 0===t?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,n;p(e)?(t=e.width+5,n="start"):(t=-5,n="end"),r.select(this).selectAll("tspan").attr("x",t).attr("text-anchor",n)}));var a=i.selectAll("rect.bandrect").data((function(e){return e.bands}),f),l=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})),A(l),a.each((function(){o.raiseToTop(this)})),a.exit().remove()}function j(e,t,r){var n,i=r[0],a=t.margin||{l:80,r:80,t:100,b:80},o=i.trace,s=o.domain,l=t.width,c=t.height,u=Math.floor(l*(s.x[1]-s.x[0])),h=Math.floor(c*(s.y[1]-s.y[0])),f=s.x[0]*l+a.l,p=t.height-s.y[1]*t.height+a.t,d=o.line.shape;n="all"===o.hoverinfo?["count","probability"]:(o.hoverinfo||"").split("+");var m={trace:o,key:o.uid,model:i,x:f,y:p,width:u,height:h,hoveron:o.hoveron,hoverinfoItems:n,arrangement:o.arrangement,bundlecolors:o.bundlecolors,sortpaths:o.sortpaths,labelfont:o.labelfont,categorylabelfont:o.tickfont,pathShape:d,dragDimension:null,margin:a,paths:[],dimensions:[],graphDiv:e,traceSelection:null,pathSelection:null,dimensionSelection:null};return i.dimensions&&(V(m),U(m)),m}function N(e,t,r,i,a){var o,s,l=[],c=[];for(s=0;s<r.length-1;s++)o=n(r[s]+e[s],e[s+1]),l.push(o(a)),c.push(o(1-a));var u="M "+e[0]+","+t[0];for(u+="l"+r[0]+",0 ",s=1;s<r.length;s++)u+="C"+l[s-1]+","+t[s-1]+" "+c[s-1]+","+t[s]+" "+e[s]+","+t[s],u+="l"+r[s]+",0 ";for(u+="l0,"+i+" ",u+="l -"+r[r.length-1]+",0 ",s=r.length-2;s>=0;s--)u+="C"+c[s]+","+(t[s+1]+i)+" "+l[s]+","+(t[s]+i)+" "+(e[s]+r[s])+","+(t[s]+i),u+="l-"+r[s]+",0 ";return u+"Z"}function U(e){var t=e.dimensions,r=e.model,n=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})),l=t.map((function(e){return e.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function h(e){var t=e.categoryInds.map((function(e,t){return i[t][e]}));return o.map((function(e){return t[e]}))}c.sort((function(t,r){var n=h(t),i=h(r);return"backward"===e.sortpaths&&(n.reverse(),i.reverse()),n.push(t.valueInds[0]),i.push(r.valueInds[0]),e.bundlecolors&&(n.unshift(t.rawColor),i.unshift(r.rawColor)),n<i?-1:n>i?1:0}));for(var f=new Array(c.length),p=t[0].model.count,d=t[0].categories.map((function(e){return e.height})).reduce((function(e,t){return e+t})),m=0;m<c.length;m++){var g,y,v=c[m];g=p>0?d*(v.count/p):0;for(var x=new Array(n.length),_=0;_<v.categoryInds.length;_++){var b=v.categoryInds[_],w=i[_][b],T=a[_];x[T]=n[T][w],n[T][w]+=g;var k=e.dimensions[T].categories[w],A=k.bands.length,M=k.bands[A-1];if(void 0===M||v.rawColor!==M.rawColor){var S=void 0===M?0:M.y+M.height;k.bands.push({key:S,color:v.color,rawColor:v.rawColor,height:g,width:k.width,count:v.count,y:S,categoryViewModel:k,parcatsViewModel:e})}else{var E=k.bands[A-1];E.height+=g,E.count+=v.count}}y="hspline"===e.pathShape?N(s,x,l,g,.5):N(s,x,l,g,0),f[m]={key:v.valueInds[0],model:v,height:g,leftXs:s,topYs:x,dimWidths:l,svgD:y,parcatsViewModel:e}}e.paths=f}function V(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 r=[];for(var n in t){var i=t[n].dimensionInd,a=e.model.dimensions[i];r.push(q(e,a))}e.dimensions=r}function q(e,t){var r,n=e.model.dimensions.length,i=t.displayInd;r=40+(n>1?(e.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],h=e.model.maxCats,f=t.categories.length,p=t.count,d=e.height-8*(h-1),m=8*(h-f)/2,g=t.categories.map((function(e){return{displayInd:e.displayInd,categoryInd:e.categoryInd}}));for(g.sort((function(e,t){return e.displayInd-t.displayInd})),c=0;c<f;c++)l=g[c].categoryInd,o=t.categories[l],a=p>0?o.count/p*d:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:e},m=m+a+8,u.push(s);return{key:t.dimensionInd,x:null!==t.dragX?t.dragX:r,y:0,width:16,model:t,categories:u,parcatsViewModel:e,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}t.exports=function(e,t,r,n){h(r,e,n,t)}}}),A_=m({"src/traces/parcats/plot.js"(e,t){var r=k_();t.exports=function(e,t,n,i){var a=e._fullLayout,o=a._paper,s=a._size;r(e,o,t,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},n,i)}}}),M_=m({"src/traces/parcats/base_plot.js"(e){var t=Tt().getModuleCalcData,r=A_(),n="parcats";e.name=n,e.plot=function(e,i,a,o){var s=t(e.calcdata,n);if(s.length){var l=s[0];r(e,l,a,o)}},e.clean=function(e,t,r,n){var i=n._has&&n._has("parcats"),a=t._has&&t._has("parcats");i&&!a&&n._paperdiv.selectAll(".parcats").remove()}}}),S_=m({"src/traces/parcats/index.js"(e,t){t.exports={attributes:b_(),supplyDefaults:w_(),calc:T_(),plot:A_(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:M_(),categories:["noOpacity"],meta:{}}}}),E_=m({"lib/parcats.js"(e,t){t.exports=S_()}}),C_=m({"src/plots/mapbox/constants.js"(e,t){var r=Ye(),n="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={"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:['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(" "),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=r(s);t.exports={requiredVersion:n,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,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@"+n+"."].join("\n"),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("\n"),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("\n"),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("\n"),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\')'}}}}),I_=m({"src/plots/mapbox/layout_attributes.js"(e,t){var r=ct(),n=W().defaultLine,i=Ma().attributes,a=j(),o=kn().textposition,s=De().overrideAll,l=vt().templatedArray,c=C_(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(t.exports=s({_arrayAttrRegexps:[r.counterRegex("mapbox",".layers",!0)],domain:i({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:c.styleValuesMapbox.concat(c.styleValuesNonMapbox),dflt:c.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:l("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:n},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:n}},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:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),L_=m({"src/traces/scattermapbox/attributes.js"(e,t){var{hovertemplateAttrs:r,texttemplateAttrs:n,templatefallbackAttrs:i}=Fe(),a=Tn(),o=sg(),s=kn(),l=I_(),c=q(),u=zt(),h=B().extendFlat,f=De().overrideAll,p=I_(),d=o.line,m=o.marker;t.exports=f({lon:o.lon,lat:o.lat,cluster:{enabled:{valType:"boolean"},maxzoom:h({},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:h({},m.opacity,{dflt:1})},mode:h({},s.mode,{dflt:"markers"}),text:h({},s.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:i({editType:"plot"}),hovertext:h({},s.hovertext,{}),line:{color:d.color,width:d.width},connectgaps:s.connectgaps,marker:h({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:m.opacity,size:m.size,sizeref:m.sizeref,sizemin:m.sizemin,sizemode:m.sizemode},u("marker")),fill:o.fill,fillcolor:a(),textfont:l.layers.symbol.textfont,textposition:l.layers.symbol.textposition,below:{valType:"string"},selected:{marker:s.selected.marker},unselected:{marker:s.unselected.marker},hoverinfo:h({},c.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r(),hovertemplatefallback:i()},"calc","nested")}}),P_=m({"src/traces/scattermapbox/constants.js"(e,t){var r=["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"];t.exports={isSupportedFont:function(e){return-1!==r.indexOf(e)}}}}),z_=m({"src/traces/scattermapbox/defaults.js"(e,t){var r=ct(),n=Xt(),i=Yn(),a=Xn(),o=Kn(),s=Jn(),l=L_(),c=P_().isSupportedFont;t.exports=function(e,t,u,h){function f(n,i){return r.coerce(e,t,l,n,i)}function p(n,i){return r.coerce2(e,t,l,n,i)}var d=function(e,t,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return t._length=a,a}(0,t,f);if(d){if(f("text"),f("texttemplate"),f("texttemplatefallback"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("mode"),f("below"),n.hasMarkers(t)){i(e,t,u,h,f,{noLine:!0,noAngle:!0}),f("marker.allowoverlap"),f("marker.angle");var m=t.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(t)&&(a(e,t,u,h,f,{noDash:!0}),f("connectgaps"));var g=p("cluster.maxzoom"),y=p("cluster.step"),v=p("cluster.color",t.marker&&t.marker.color||u),x=p("cluster.size"),_=p("cluster.opacity");if(f("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==_)||n.hasText(t)){var b=h.font.family;o(e,t,h,f,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(b)?b:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}f("fill"),"none"!==t.fill&&s(e,t,u,f),r.coerceSelectionMarkerOpacity(t,f)}else t.visible=!1}}}),D_=m({"src/traces/scattermapbox/format_labels.js"(e,t){var r=ar();t.exports=function(e,t,n){var i={},a=n[t.subplot]._subplot.mockAxis,o=e.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),O_=m({"src/plots/mapbox/convert_text_opts.js"(e,t){var r=ct();t.exports=function(e,t){var n=e.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(t)?r.mean(t):t,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),R_=m({"src/traces/scattermapbox/convert.js"(e,t){var r=M(),n=ct(),i=S().BADNUM,a=dg(),o=Yt(),s=er(),l=$t(),c=Xt(),u=P_().isSupportedFont,h=O_(),f=Kt().appendArrayPointValue,p=Et().NEWLINES,d=Et().BR_TAG_ALL;function m(e){return{type:e,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(e,t){return n.isArrayOrTypedArray(e)?t?function(t){return r(e[t])?+e[t]:0}:function(t){return e[t]}:e?function(){return e}:y}function y(){return""}function v(e){return e[0]===i}function x(e,t){var r;if(n.isArrayOrTypedArray(e)&&n.isArrayOrTypedArray(t)){r=["step",["get","point_count"],e[0]];for(var i=1;i<e.length;i++)r.push(t[i-1],e[i])}else r=e;return r}function _(e){var t=e.textfont,r=t.family,n=t.style,i=t.weight,a=r.split(" "),o="Italic"===a[a.length-1];o&&a.pop(),o=o||"italic"===n;var s=a.join(" ");return"bold"===i&&-1===a.indexOf("Bold")?s+=" Bold":i<=1e3&&("Metropolis"===a[0]?(s="Metropolis",s+=i>850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}t.exports=function(e,t){var i,u=t[0].trace,b=!0===u.visible&&0!==u._length,w="none"!==u.fill,T=c.hasLines(u),k=c.hasMarkers(u),A=c.hasText(u),M=k&&"circle"===u.marker.symbol,S=k&&"circle"!==u.marker.symbol,E=u.cluster&&u.cluster.enabled,C=m("fill"),I=m("line"),L=m("circle"),P=m("symbol"),z={fill:C,line:I,circle:L,symbol:P};if(!b)return z;if((w||T)&&(i=a.calcTraceToLineCoords(t)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":u.fillcolor})),T&&(I.geojson=a.makeLine(i),I.layout.visibility="visible",n.extendFlat(I.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),M){var D=function(e){var t,i,a,c,u=e[0].trace,h=u.marker,f=u.selectedpoints,p=n.isArrayOrTypedArray(h.color),d=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(e){return u.opacity*e}p&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),d&&(a=l(u)),m&&(c=function(e){return g(r(e)?+n.constrain(e,0,1):0)});var y,x=[];for(t=0;t<e.length;t++){var _=e[t],b=_.lonlat;if(!v(b)){var w={};i&&(w.mcc=_.mcc=i(_.mc)),a&&(w.mrc=_.mrc=a(_.ms)),c&&(w.mo=c(_.mo)),f&&(w.selected=_.selected||0),x.push({type:"Feature",id:t+1,geometry:{type:"Point",coordinates:b},properties:w})}}if(f)for(y=s.makeSelectedPointStyleFns(u),t=0;t<x.length;t++){var T=x[t].properties;y.selectedOpacityFn&&(T.mo=g(y.selectedOpacityFn(T))),y.selectedColorFn&&(T.mcc=y.selectedColorFn(T)),y.selectedSizeFn&&(T.mrc=y.selectedSizeFn(T))}return{geojson:{type:"FeatureCollection",features:x},mcc:p||y&&y.selectedColorFn?{type:"identity",property:"mcc"}:h.color,mrc:d||y&&y.selectedSizeFn?{type:"identity",property:"mrc"}:function(e){return e/2}(h.size),mo:m||y&&y.selectedOpacityFn?{type:"identity",property:"mo"}:g(h.opacity)}}(t);L.geojson=D.geojson,L.layout.visibility="visible",E&&(L.filter=["!",["has","point_count"]],z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(u.cluster.color,u.cluster.step),"circle-radius":x(u.cluster.size,u.cluster.step),"circle-opacity":x(u.cluster.opacity,u.cluster.step)}},z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":_(u),"text-size":12}}),n.extendFlat(L.paint,{"circle-color":D.mcc,"circle-radius":D.mrc,"circle-opacity":D.mo})}if(M&&E&&(L.filter=["!",["has","point_count"]]),(S||A)&&(P.geojson=function(e,t){for(var r=t._fullLayout,i=e[0].trace,a=i.marker||{},o=a.symbol,s=a.angle,l="circle"!==o?g(o):y,u="auto"!==s?g(s,!0):y,h=c.hasText(i)?g(i.text):y,m=[],x=0;x<e.length;x++){var _=e[x];if(!v(_.lonlat)){var b,w=i.texttemplate;if(w){var T=Array.isArray(w)?w[x]||"":w,k=i._module.formatLabels(_,i,r),A={};f(A,i,_.i),b=n.texttemplateString({data:[A,_,i._meta],fallback:i.texttemplatefallback,labels:k,locale:r._d3locale,template:T})}else b=h(x);b&&(b=b.replace(p,"").replace(d,"\n")),m.push({type:"Feature",geometry:{type:"Point",coordinates:_.lonlat},properties:{symbol:l(x),angle:u(x),text:b}})}}return{type:"FeatureCollection",features:m}}(t,e),n.extendFlat(P.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),S&&(n.extendFlat(P.layout,{"icon-size":u.marker.size/10}),"angle"in u.marker&&"auto"!==u.marker.angle&&n.extendFlat(P.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),P.layout["icon-allow-overlap"]=u.marker.allowoverlap,n.extendFlat(P.paint,{"icon-opacity":u.opacity*u.marker.opacity,"icon-color":u.marker.color})),A)){var O=(u.marker||{}).size,R=h(u.textposition,O);n.extendFlat(P.layout,{"text-size":u.textfont.size,"text-anchor":R.anchor,"text-offset":R.offset,"text-font":_(u)}),n.extendFlat(P.paint,{"text-color":u.textfont.color,"text-opacity":u.opacity})}return z}}}),F_=m({"src/traces/scattermapbox/plot.js"(e,t){var r=ct(),n=R_(),i=C_().traceLayerPrefix,a={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function o(e,t,r,n){this.type="scattermapbox",this.subplot=e,this.uid=t,this.clusterEnabled=r,this.isHidden=n,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,n){var i={type:"geojson",data:t.geojson};n&&n.enabled&&r.extendFlat(i,{cluster:!0,clusterMaxZoom:n.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,r){var n={type:t.type,id:this.layerIds[e],source:this.sourceIds[e],layout:t.layout,paint:t.paint};t.filter&&(n.filter=t.filter);for(var i,a=this.layerIds[e],o=this.subplot.getMapLayers(),s=0;s<o.length;s++)if(o[s].id===a){i=!0;break}i?(this.subplot.setOptions(a,"setLayoutProperty",n.layout),"visible"===n.layout.visibility&&this.subplot.setOptions(a,"setPaintProperty",n.paint)):this.subplot.addLayer(n,r)},s.update=function(e){var t=e[0].trace,r=this.subplot,i=r.map,o=n(r.gd,e),s=r.belowLookup["trace-"+this.uid],l=!(!t.cluster||!t.cluster.enabled),c=!!this.clusterEnabled,u=this;function h(e){c?function(e){for(var t=a.cluster,r=t.length-1;r>=0;r--){var n=t[r];i.removeLayer(u.layerIds[n])}e||i.removeSource(u.sourceIds.circle)}(e):function(e){for(var t=a.nonCluster,r=t.length-1;r>=0;r--){var n=t[r];i.removeLayer(u.layerIds[n]),e||i.removeSource(u.sourceIds[n])}}(e)}function f(e){l?function(e){e||u.addSource("circle",o.circle,t.cluster);for(var r=a.cluster,n=0;n<r.length;n++){var i=r[n],l=o[i];u.addLayer(i,l,s)}}(e):function(e){for(var t=a.nonCluster,r=0;r<t.length;r++){var n=t[r],i=o[n];e||u.addSource(n,i),u.addLayer(n,i,s)}}(e)}var p=this.isHidden,d=!0!==t.visible;d?p||h():p?d||f():c!==l?(h(),f()):(this.below!==s&&(h(!0),f(!0)),function(){for(var e=l?a.cluster:a.nonCluster,t=0;t<e.length;t++){var n=e[t],i=o[n];i&&(r.setOptions(u.layerIds[n],"setLayoutProperty",i.layout),"visible"===i.layout.visibility&&("cluster"!==n&&u.setSourceData(n,i),r.setOptions(u.layerIds[n],"setPaintProperty",i.paint)))}}()),this.clusterEnabled=l,this.isHidden=d,this.below=s,e[0].trace._glTrace=this},s.dispose=function(){for(var e=this.subplot.map,t=this.clusterEnabled?a.cluster:a.nonCluster,r=t.length-1;r>=0;r--){var n=t[r];e.removeLayer(this.layerIds[n]),e.removeSource(this.sourceIds[n])}},t.exports=function(e,t){var r,i,s,l=t[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(e,l.uid,c,u),f=n(e.gd,t),p=h.below=e.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",f.circle,l.cluster),r=0;r<a.cluster.length;r++)s=f[i=a.cluster[r]],h.addLayer(i,s,p);else for(r=0;r<a.nonCluster.length;r++)s=f[i=a.nonCluster[r]],h.addSource(i,s,l.cluster),h.addLayer(i,s,p);return t[0].trace._glTrace=h,h}}}),B_=m({"src/traces/scattermapbox/hover.js"(e,t){var r=Or(),n=ct(),i=vi(),a=n.fillText,o=S().BADNUM,s=C_().traceLayerPrefix;function l(e,t,r){if(!e.hovertemplate){var n=(t.hi||e.hoverinfo).split("+"),i=-1!==n.indexOf("all"),o=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=t.lonlat,c=[];return i||o&&s?c.push("("+u(l[1])+", "+u(l[0])+")"):o?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1])),(i||-1!==n.indexOf("text"))&&a(t,e,c),c.join("<br>")}function u(e){return e+"°"}}t.exports={hoverPoints:function(e,t,a){var c=e.cd,u=c[0].trace,h=e.xa,f=e.ya,p=e.subplot,d=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=p.map.queryRenderedFeatures(null,{layers:[m]});d=y.map((function(e){return e.id}))}var v=360*(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360)),x=t-v;if(r.getClosest(c,(function(e){var t=e.lonlat;if(t[0]===o||g&&-1===d.indexOf(e.i+1))return 1/0;var r=n.modHalf(t[0],360),i=t[1],s=p.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-f.c2p([r,a]),u=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),e),!1!==e.index){var _=c[e.index],b=_.lonlat,w=[n.modHalf(b[0],360)+v,b[1]],T=h.c2p(w),k=f.c2p(w),A=_.mrc||1;e.x0=T-A,e.x1=T+A,e.y0=k-A,e.y1=k+A;var M={};M[u.subplot]={_subplot:p};var S=u._module.formatLabels(_,u,M);return e.lonLabel=S.lonLabel,e.latLabel=S.latLabel,e.color=i(u,_),e.extraText=l(u,_,c[0].t.labels),e.hovertemplate=u.hovertemplate,[e]}},getExtraText:l}}}),j_=m({"src/traces/scattermapbox/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e}}}),N_=m({"src/traces/scattermapbox/select.js"(e,t){var r=ct(),n=Xt(),i=S().BADNUM;t.exports=function(e,t){var a,o=e.cd,s=e.xaxis,l=e.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===t)for(a=0;a<o.length;a++)o[a].selected=0;else for(a=0;a<o.length;a++){var h=o[a],f=h.lonlat;if(f[0]!==i){var p=[r.modHalf(f[0],360),f[1]],d=[s.c2p(p),l.c2p(p)];t.contains(d,null,a,e)?(c.push({pointNumber:a,lon:f[0],lat:f[1]}),h.selected=1):h.selected=0}}return c}}}),U_=m({"node_modules/@plotly/mapbox-gl/dist/mapbox-gl-unminified.js"(e,t){var r,n;r=e,n=function(){var e,t,r;function n(n,i){if(e)if(t){var a="var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk);",o={};e(o),r=i(o),typeof window<"u"&&(r.workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"})))}else t=i;else e=i}return n(0,(function(e){function t(e,t){return e(t={exports:{}},t.exports),t.exports}var r="1.13.4",n=i;function i(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=n,this.p2x=r,this.p2y=n}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){var r,n,i,a,o;for(typeof t>"u"&&(t=1e-6),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((i=e)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-e)<t)return i;e>a?r=i:n=i,i=.5*(n-r)+r}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,r=e.y-this.y;return t*t+r*r},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,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,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),r=Math.sin(e),n=t*this.x-r*this.y,i=r*this.x+t*this.y;return this.x=n,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.x+r*(this.x-t.x)-n*(this.y-t.y),a=t.y+n*(this.x-t.x)+r*(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:{},l=Math.pow(2,53)-1;function c(e,t,r,i){var a=new n(e,t,r,i);return function(e){return a.solve(e)}}var u=c(.25,.1,.25,1);function h(e,t,r){return Math.min(r,Math.max(t,e))}function f(e,t,r){var n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function p(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n<i.length;n+=1){var a=i[n];for(var o in a)e[o]=a[o]}return e}var d=1;function m(){return d++}function g(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function y(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)}function v(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}function x(e,t){return-1!==e.indexOf(t,e.length-t.length)}function _(e,t,r){var n={};for(var i in e)n[i]=t.call(r||this,e[i],i,e);return n}function b(e,t,r){var n={};for(var i in e)t.call(r||this,e[i],i,e)&&(n[i]=e[i]);return n}function w(e){return Array.isArray(e)?e.map(w):"object"==typeof e&&e?_(e,w):e}var T={};function k(e){T[e]||(typeof console<"u"&&console.warn(e),T[e]=!0)}function A(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function M(e){for(var t=0,r=0,n=e.length,i=n-1,a=void 0,o=void 0;r<n;i=r++)a=e[r],t+=((o=e[i]).x-a.x)*(a.y+o.y);return t}function S(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function E(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(e,r,n,i){var a=n||i;return t[r]=!a||a.toLowerCase(),""})),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var C=null;function I(e){if(null==C){var t=e.navigator?e.navigator.userAgent:null;C=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return C}function L(e){try{var t=s[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}var P,z,D,O,R=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),F=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,B=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,j={now:R,frame:function(e){var t=F(e);return{cancel:function(){return B(t)}}},getImageData:function(e,t){void 0===t&&(t=0);var r=s.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,n.drawImage(e,0,0,e.width,e.height),n.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return P||(P=s.document.createElement("a")),P.href=e,P.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==z&&(z=s.matchMedia("(prefers-reduced-motion: reduce)")),z.matches)}},N={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"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},U={supported:!1,testSupport:function(e){V||!O||(q?H(e):D=e)}},V=!1,q=!1;function H(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,O),e.isContextLost())return;U.supported=!0}catch{}e.deleteTexture(t),V=!0}s.document&&((O=s.document.createElement("img")).onload=function(){D&&H(D),D=null,q=!0},O.onerror=function(){V=!0,D=null},O.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",W=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function Z(e){return 0===e.indexOf("mapbox:")}W.prototype._createSkuToken=function(){var e=function(){for(var e="",t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",G,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},W.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},W.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},W.prototype.normalizeStyleURL=function(e,t){if(!Z(e))return e;var r=K(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},W.prototype.normalizeGlyphsURL=function(e,t){if(!Z(e))return e;var r=K(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},W.prototype.normalizeSourceURL=function(e,t){if(!Z(e))return e;var r=K(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},W.prototype.normalizeSpriteURL=function(e,t,r,n){var i=K(e);return Z(e)?(i.path="/styles/v1"+i.path+"/sprite"+t+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+t+r,J(i))},W.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!Z(e))return e;var r=K(e),n=j.devicePixelRatio>=2||512===t?"@2x":"",i=U.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+i),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(e){for(var t=0,r=e;t<r.length;t+=1){var n=r[t].match(/^access_token=(.*)$/);if(n)return n[1]}return null}(r.params)||N.ACCESS_TOKEN;return N.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},W.prototype.canonicalizeTileURL=function(e,t){var r=K(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var n="mapbox://tiles/";n+=r.path.replace("/v4/","");var i=r.params;return t&&(i=i.filter((function(e){return!e.match(/^access_token=/)}))),i.length&&(n+="?"+i.join("&")),n},W.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&Z(t),n=[],i=0,a=e.tiles||[];i<a.length;i+=1){var o=a[i];X(o)?n.push(this.canonicalizeTileURL(o,r)):n.push(o)}return n},W.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=K(N.API_URL);if(e.protocol=n.protocol,e.authority=n.authority,"http"===e.protocol){var i=e.params.indexOf("secure");i>=0&&e.params.splice(i,1)}if("/"!==n.path&&(e.path=""+n.path+e.path),!N.REQUIRE_ACCESS_TOKEN)return J(e);if(!(t=t||N.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===t[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter((function(e){return-1===e.indexOf("access_token")})),e.params.push("access_token="+t),J(e)};var Y=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function X(e){return Y.test(e)}var $=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(e){var t=e.match($);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function J(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}var Q="mapbox.eventData";function ee(e){if(!e)return null;var t=e.split(".");if(!t||3!==t.length)return null;try{var r=JSON.parse(function(e){return decodeURIComponent(s.atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}(t[1]));return r}catch{return null}}var te=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};te.prototype.getStorageKey=function(e){var t,r=ee(N.ACCESS_TOKEN),n="";return r&&r.u?(t=r.u,n=s.btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode(+("0x"+t))})))):n=N.ACCESS_TOKEN||"",e?Q+"."+e+":"+n:Q+":"+n},te.prototype.fetchEventData=function(){var e=L("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{var n=s.localStorage.getItem(t);n&&(this.eventData=JSON.parse(n));var i=s.localStorage.getItem(r);i&&(this.anonId=i)}catch{k("Unable to read from LocalStorage")}},te.prototype.saveEventData=function(){var e=L("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{s.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(t,JSON.stringify(this.eventData))}catch{k("Unable to write to LocalStorage")}},te.prototype.processRequests=function(e){},te.prototype.postEvent=function(e,t,n,i){var a=this;if(N.EVENTS_URL){var o=K(N.EVENTS_URL);o.params.push("access_token="+(i||N.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:G,userId:this.anonId},l=t?p(s,t):s,c={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=ke(c,(function(e){a.pendingRequest=null,n(e),a.saveEventData(),a.processRequests(i)}))}},te.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var re,ne,ie=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,r,n){this.skuToken=r,(N.EVENTS_URL&&n||N.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return Z(e)||X(e)})))&&this.queueRequest({id:t,timestamp:Date.now()},n)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),y(this.anonId)||(this.anonId=g()),this.postEvent(i,{skuToken:this.skuToken},(function(e){e||n&&(t.success[n]=!0)}),e))}},t}(te),ae=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){N.EVENTS_URL&&N.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return Z(e)||X(e)}))&&this.queueRequest(Date.now(),t)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var r=ee(N.ACCESS_TOKEN),n=r?r.u:N.ACCESS_TOKEN,i=n!==this.eventData.tokenU;y(this.anonId)||(this.anonId=g(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-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=n)}),e)}},t}(te),oe=new ae,se=oe.postTurnstileEvent.bind(oe),le=new ie,ce=le.postMapLoadEvent.bind(le),ue="mapbox-tiles",he=500,fe=50;function pe(){s.caches&&!re&&(re=s.caches.open(ue))}function de(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var me,ge=1/0;function ye(){return null==me&&(me=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.createImageBitmap),me}var ve={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ve);var xe=function(e){function t(t,r,n){401===r&&X(n)&&(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=r,this.url=n,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),_e=S()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===s.location.protocol?s.parent:s).location.href};function be(e,t){var r=new s.AbortController,n=new s.Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:_e(),signal:r.signal}),i=!1,a=!1,o=function(e){return e.indexOf("sku=")>0&&X(e)}(n.url);"json"===e.type&&n.headers.set("Accept","application/json");var l=function(r,i,l){if(!a){if(r&&"SecurityError"!==r.message&&k(r),i&&l)return c(i);var u=Date.now();s.fetch(n).then((function(r){if(r.ok){var n=o?r.clone():null;return c(r,n,u)}return t(new xe(r.statusText,r.status,e.url))})).catch((function(e){20!==e.code&&t(new Error(e.message))}))}},c=function(r,o,l){("arrayBuffer"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((function(e){a||(o&&l&&function(e,t,r){if(pe(),re){var n={status:t.status,statusText:t.statusText,headers:new s.Headers};t.headers.forEach((function(e,t){return n.headers.set(t,e)}));var i=E(t.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(e,t){if(void 0===ne)try{new Response(new ReadableStream),ne=!0}catch{ne=!1}ne?t(e.body):e.blob().then(t)}(t,(function(t){var r=new s.Response(t,n);pe(),re&&re.then((function(t){return t.put(de(e.url),r)})).catch((function(e){return k(e.message)}))})))}}(n,o,l),i=!0,t(null,e,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(e){a||t(new Error(e.message))}))};return o?function(e,t){if(pe(),!re)return t(null);var r=de(e.url);re.then((function(e){e.match(r).then((function(n){var i=function(e){if(!e)return!1;var t=new Date(e.headers.get("Expires")||0),r=E(e.headers.get("Cache-Control")||"");return t>Date.now()&&!r["no-cache"]}(n);e.delete(r),i&&e.put(r,n.clone()),t(null,n,i)})).catch(t)})).catch(t)}(n,l):l(null,null),{cancel:function(){a=!0,i||r.abort()}}}var we=function(e,t){if(!function(e){return/^file:/.test(e)||/^file:/.test(_e())&&!/^\w+:/.test(e)}(e.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return be(e,t);if(S()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}return function(e,t){var r=new s.XMLHttpRequest;for(var n in r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer"),e.headers)r.setRequestHeader(n,e.headers[n]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=function(){t(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===e.type)try{n=JSON.parse(r.response)}catch(e){return t(e)}t(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else t(new xe(r.statusText,r.status,e.url))},r.send(e.body),{cancel:function(){return r.abort()}}}(e,t)},Te=function(e,t){return we(p(e,{type:"arrayBuffer"}),t)},ke=function(e,t){return we(p(e,{method:"POST"}),t)};function Ae(e){var t=s.document.createElement("a");return t.href=e,t.protocol===s.document.location.protocol&&t.host===s.document.location.host}var Me,Se,Ee="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Me=[],Se=0;var Ce=function(e,t){if(U.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),Se>=N.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return Me.push(r),r}Se++;var n=!1,i=function(){if(!n)for(n=!0,Se--;Me.length&&Se<N.MAX_PARALLEL_IMAGE_REQUESTS;){var e=Me.shift(),t=e.requestParameters,r=e.callback;e.cancelled||(e.cancel=Ce(t,r).cancel)}},a=Te(e,(function(e,r,n,a){i(),e?t(e):r&&(ye()?function(e,t){var r=new s.Blob([new Uint8Array(e)],{type:"image/png"});s.createImageBitmap(r).then((function(e){t(null,e)})).catch((function(e){t(new 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."))}))}(r,t):function(e,t,r,n){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=Ee}))},i.onerror=function(){return t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new s.Blob([new Uint8Array(e)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=e.byteLength?a.createObjectURL(o):Ee}(r,t,n,a))}));return{cancel:function(){a.cancel(),i()}}};function Ie(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function Le(e,t,r){if(r&&r[e]){var n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}var Pe=function(e,t){void 0===t&&(t={}),p(this,t),this.type=e},ze=function(e){function t(t,r){void 0===r&&(r={}),e.call(this,"error",p({error:t},r))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Pe),De=function(){};De.prototype.on=function(e,t){return this._listeners=this._listeners||{},Ie(e,t,this._listeners),this},De.prototype.off=function(e,t){return Le(e,t,this._listeners),Le(e,t,this._oneTimeListeners),this},De.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},Ie(e,t,this._oneTimeListeners),this},De.prototype.fire=function(e,t){"string"==typeof e&&(e=new Pe(e,t||{}));var r=e.type;if(this.listens(r)){e.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<i.length;n+=1)i[n].call(this,e);for(var a=0,o=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];a<o.length;a+=1){var s=o[a];Le(r,s,this._oneTimeListeners),s.call(this,e)}var l=this._eventedParent;l&&(p(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(e))}else e instanceof ze&&console.error(e.error);return this},De.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)},De.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var Oe={$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"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{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"],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"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},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"}}},Re=function(e,t,r,n){this.message=(e?e+": ":"")+r,n&&(this.identifier=n),null!=t&&t.__line__&&(this.line=t.__line__)};function Fe(e){var t=e.key,r=e.value;return r?[new Re(t,r,"constants have been deprecated as of v8")]:[]}function Be(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n<i.length;n+=1){var a=i[n];for(var o in a)e[o]=a[o]}return e}function je(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Ne(e){if(Array.isArray(e))return e.map(Ne);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=Ne(e[r]);return t}return je(e)}var Ue=function(e){function t(t,r){e.call(this,r),this.message=r,this.key=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),Ve=function(e,t){void 0===t&&(t=[]),this.parent=e,this.bindings={};for(var r=0,n=t;r<n.length;r+=1){var i=n[r],a=i[0],o=i[1];this.bindings[a]=o}};Ve.prototype.concat=function(e){return new Ve(this,e)},Ve.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},Ve.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var qe={kind:"null"},He={kind:"number"},Ge={kind:"string"},We={kind:"boolean"},Ze={kind:"color"},Ye={kind:"object"},Xe={kind:"value"},$e={kind:"collator"},Ke={kind:"formatted"},Je={kind:"resolvedImage"};function Qe(e,t){return{kind:"array",itemType:e,N:t}}function et(e){if("array"===e.kind){var t=et(e.itemType);return"number"==typeof e.N?"array<"+t+", "+e.N+">":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var tt=[qe,He,Ge,We,Ze,Ke,Ye,Qe(Xe),Je];function rt(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!rt(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var r=0,n=tt;r<n.length;r+=1)if(!rt(n[r],t))return null}return"Expected "+et(e)+" but found "+et(t)+" instead."}function nt(e,t){return t.some((function(t){return t.kind===e.kind}))}function it(e,t){return t.some((function(t){return"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e}))}var at=t((function(e,t){var r={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 n(e){return(e=Math.round(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]?n(parseFloat(e)/100*255):n(parseInt(e))}function o(e){return"%"===e[e.length-1]?i(parseFloat(e)/100):i(parseFloat(e))}function s(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{t.parseCSSColor=function(e){var t,i=e.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===i.length&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=i.indexOf("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),h=i.substr(l+1,c-(l+1)).split(","),f=1;switch(u){case"rgba":if(4!==h.length)return null;f=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),f];case"hsla":if(4!==h.length)return null;f=o(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),m=o(h[2]),g=m<=.5?m*(d+1):m+d-m*d,y=2*m-g;return[n(255*s(y,g,p+1/3)),n(255*s(y,g,p)),n(255*s(y,g,p-1/3)),f];default:return null}}return null}}catch{}})).parseCSSColor,ot=function(e,t,r,n){void 0===n&&(n=1),this.r=e,this.g=t,this.b=r,this.a=n};ot.parse=function(e){if(e){if(e instanceof ot)return e;if("string"==typeof e){var t=at(e);if(t)return new ot(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},ot.prototype.toString=function(){var e=this.toArray(),t=e[0],r=e[1],n=e[2],i=e[3];return"rgba("+Math.round(t)+","+Math.round(r)+","+Math.round(n)+","+i+")"},ot.prototype.toArray=function(){var e=this,t=e.r,r=e.g,n=e.b,i=e.a;return 0===i?[0,0,0,0]:[255*t/i,255*r/i,255*n/i,i]},ot.black=new ot(0,0,0,1),ot.white=new ot(1,1,1,1),ot.transparent=new ot(0,0,0,0),ot.red=new ot(1,0,0,1);var st=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};st.prototype.compare=function(e,t){return this.collator.compare(e,t)},st.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var lt=function(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i},ct=function(e){this.sections=e};ct.fromString=function(e){return new ct([new lt(e,null,null,null,null)])},ct.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length}))},ct.factory=function(e){return e instanceof ct?e:ct.fromString(e)},ct.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(e){return e.text})).join("")},ct.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var n=r[t];if(n.image)e.push(["image",n.image.name]);else{e.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),e.push(i)}}return e};var ut=function(e){this.name=e.name,this.available=e.available};function ht(e,t,r,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?typeof n>"u"||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[e,t,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ft(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof ot)return!0;if(e instanceof st)return!0;if(e instanceof ct)return!0;if(e instanceof ut)return!0;if(Array.isArray(e)){for(var t=0,r=e;t<r.length;t+=1)if(!ft(r[t]))return!1;return!0}if("object"==typeof e){for(var n in e)if(!ft(e[n]))return!1;return!0}return!1}function pt(e){if(null===e)return qe;if("string"==typeof e)return Ge;if("boolean"==typeof e)return We;if("number"==typeof e)return He;if(e instanceof ot)return Ze;if(e instanceof st)return $e;if(e instanceof ct)return Ke;if(e instanceof ut)return Je;if(Array.isArray(e)){for(var t,r=e.length,n=0,i=e;n<i.length;n+=1){var a=pt(i[n]);if(t){if(t===a)continue;t=Xe;break}t=a}return Qe(t||Xe,r)}return Ye}function dt(e){var t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof ot||e instanceof ct||e instanceof ut?e.toString():JSON.stringify(e)}ut.prototype.toString=function(){return this.name},ut.fromString=function(e){return e?new ut({name:e,available:!1}):null},ut.prototype.serialize=function(){return["image",this.name]};var mt=function(e,t){this.type=e,this.value=t};mt.parse=function(e,t){if(2!==e.length)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!ft(e[1]))return t.error("invalid value");var r=e[1],n=pt(r),i=t.expectedType;return"array"===n.kind&&0===n.N&&i&&"array"===i.kind&&("number"!=typeof i.N||0===i.N)&&(n=i),new mt(n,r)},mt.prototype.evaluate=function(){return this.value},mt.prototype.eachChild=function(){},mt.prototype.outputDefined=function(){return!0},mt.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ot?["rgba"].concat(this.value.toArray()):this.value instanceof ct?this.value.serialize():this.value};var gt=function(e){this.name="ExpressionEvaluationError",this.message=e};gt.prototype.toJSON=function(){return this.message};var yt={string:Ge,number:He,boolean:We,object:Ye},vt=function(e,t){this.type=e,this.args=t};vt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,n=1,i=e[0];if("array"===i){var a,o;if(e.length>2){var s=e[1];if("string"!=typeof s||!(s in yt)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=yt[s],n++}else a=Xe;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}r=Qe(a,o)}else r=yt[i];for(var l=[];n<e.length;n++){var c=t.parse(e[n],n,Xe);if(!c)return null;l.push(c)}return new vt(r,l)},vt.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!rt(this.type,pt(r)))return r;if(t===this.args.length-1)throw new gt("Expected value to be of type "+et(this.type)+", but found "+et(pt(r))+" instead.")}return null},vt.prototype.eachChild=function(e){this.args.forEach(e)},vt.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},vt.prototype.serialize=function(){var e=this.type,t=[e.kind];if("array"===e.kind){var r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){t.push(r.kind);var n=e.N;("number"==typeof n||this.args.length>1)&&t.push(n)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var xt=function(e){this.type=Ke,this.sections=e};xt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=e.length-1;++a){var o=e[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=t.parse(o["font-scale"],1,He)))return null;var l=null;if(o["text-font"]&&!(l=t.parse(o["text-font"],1,Qe(Ge))))return null;var c=null;if(o["text-color"]&&!(c=t.parse(o["text-color"],1,Ze)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var h=t.parse(e[a],1,Xe);if(!h)return null;var f=h.type.kind;if("string"!==f&&"value"!==f&&"null"!==f&&"resolvedImage"!==f)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new xt(n)},xt.prototype.evaluate=function(e){return new ct(this.sections.map((function(t){var r=t.content.evaluate(e);return pt(r)===Je?new lt("",r,null,null,null):new lt(dt(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},xt.prototype.eachChild=function(e){for(var t=0,r=this.sections;t<r.length;t+=1){var n=r[t];e(n.content),n.scale&&e(n.scale),n.font&&e(n.font),n.textColor&&e(n.textColor)}},xt.prototype.outputDefined=function(){return!1},xt.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var n=r[t];e.push(n.content.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),e.push(i)}return e};var _t=function(e){this.type=Je,this.input=e};_t.parse=function(e,t){if(2!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Ge);return r?new _t(r):t.error("No image name provided.")},_t.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=ut.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},_t.prototype.eachChild=function(e){e(this.input)},_t.prototype.outputDefined=function(){return!1},_t.prototype.serialize=function(){return["image",this.input.serialize()]};var bt={"to-boolean":We,"to-color":Ze,"to-number":He,"to-string":Ge},wt=function(e,t){this.type=e,this.args=t};wt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");for(var n=bt[r],i=[],a=1;a<e.length;a++){var o=t.parse(e[a],a,Xe);if(!o)return null;i.push(o)}return new wt(n,i)},wt.prototype.evaluate=function(e){if("boolean"===this.type.kind)return!!this.args[0].evaluate(e);if("color"===this.type.kind){for(var t,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(t=i[n].evaluate(e))instanceof ot)return t;if("string"==typeof t){var a=e.parseColor(t);if(a)return a}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":ht(t[0],t[1],t[2],t[3])))return new ot(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new gt(r||"Could not parse color from value '"+("string"==typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s<l.length;s+=1){if(null===(o=l[s].evaluate(e)))return 0;var c=Number(o);if(!isNaN(c))return c}throw new gt("Could not convert "+JSON.stringify(o)+" to number.")}return"formatted"===this.type.kind?ct.fromString(dt(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?ut.fromString(dt(this.args[0].evaluate(e))):dt(this.args[0].evaluate(e))},wt.prototype.eachChild=function(e){this.args.forEach(e)},wt.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},wt.prototype.serialize=function(){if("formatted"===this.type.kind)return new xt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new _t(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild((function(t){e.push(t.serialize())})),e};var Tt=["Unknown","Point","LineString","Polygon"],kt=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};kt.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},kt.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Tt[this.feature.type]:this.feature.type:null},kt.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},kt.prototype.canonicalID=function(){return this.canonical},kt.prototype.properties=function(){return this.feature&&this.feature.properties||{}},kt.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=ot.parse(e)),t};var At=function(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n};At.prototype.evaluate=function(e){return this._evaluate(e,this.args)},At.prototype.eachChild=function(e){this.args.forEach(e)},At.prototype.outputDefined=function(){return!1},At.prototype.serialize=function(){return[this.name].concat(this.args.map((function(e){return e.serialize()})))},At.parse=function(e,t){var r,n=e[0],i=At.definitions[n];if(!i)return t.error('Unknown expression "'+n+'". 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 r=t[0];return!Array.isArray(r)||r.length===e.length-1})),l=null,c=0,u=s;c<u.length;c+=1){var h=u[c],f=h[0],p=h[1];l=new $t(t.registry,t.path,null,t.scope);for(var d=[],m=!1,g=1;g<e.length;g++){var y=e[g],v=Array.isArray(f)?f[g-1]:f.type,x=l.parse(y,1+d.length,v);if(!x){m=!0;break}d.push(x)}if(!m){if(Array.isArray(f)&&f.length!==d.length){l.error("Expected "+f.length+" arguments, but found "+d.length+" instead.");continue}for(var _=0;_<d.length;_++){var b=Array.isArray(f)?f[_]:f.type,w=d[_];l.concat(_+1).checkSubtype(b,w.type)}if(0===l.errors.length)return new At(n,a,p,d)}}if(1===s.length)(r=t.errors).push.apply(r,l.errors);else{for(var T=(s.length?s:o).map((function(e){var t;return t=e[0],Array.isArray(t)?"("+t.map(et).join(", ")+")":"("+et(t.type)+"...)"})).join(" | "),k=[],A=1;A<e.length;A++){var M=t.parse(e[A],1+k.length);if(!M)return null;k.push(et(M.type))}t.error("Expected arguments of type "+T+", but found ("+k.join(", ")+") instead.")}return null},At.register=function(e,t){for(var r in At.definitions=t,t)e[r]=At};var Mt=function(e,t,r){this.type=$e,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t};Mt.parse=function(e,t){if(2!==e.length)return t.error("Expected one argument.");var r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");var n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,We);if(!n)return null;var i=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,We);if(!i)return null;var a=null;return r.locale&&!(a=t.parse(r.locale,1,Ge))?null:new Mt(n,i,a)},Mt.prototype.evaluate=function(e){return new st(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},Mt.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},Mt.prototype.outputDefined=function(){return!1},Mt.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 St=8192;function Et(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 Ct(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function It(e,t){var r=function(e){return(180+e)/360}(e[0]),n=function(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}(e[1]),i=Math.pow(2,t.z);return[Math.round(r*i*St),Math.round(n*i*St)]}function Lt(e,t,r){var n=e[0]-t[0],i=e[1]-t[1],a=e[0]-r[0],o=e[1]-r[1];return n*o-a*i==0&&n*a<=0&&i*o<=0}function Pt(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function zt(e,t){for(var r=!1,n=0,i=t.length;n<i;n++)for(var a=t[n],o=0,s=a.length;o<s-1;o++){if(Lt(e,a[o],a[o+1]))return!1;Pt(e,a[o],a[o+1])&&(r=!r)}return r}function Dt(e,t){for(var r=0;r<t.length;r++)if(zt(e,t[r]))return!0;return!1}function Ot(e,t,r,n){var i=e[0]-r[0],a=e[1]-r[1],o=t[0]-r[0],s=t[1]-r[1],l=n[0]-r[0],c=n[1]-r[1],u=i*c-l*a,h=o*c-l*s;return u>0&&h<0||u<0&&h>0}function Rt(e,t,r,n){var i=[t[0]-e[0],t[1]-e[1]];return 0!==function(e,t){return e[0]*t[1]-e[1]*t[0]}([n[0]-r[0],n[1]-r[1]],i)&&!(!Ot(e,t,r,n)||!Ot(r,n,e,t))}function Ft(e,t,r){for(var n=0,i=r;n<i.length;n+=1)for(var a=i[n],o=0;o<a.length-1;++o)if(Rt(e,t,a[o],a[o+1]))return!0;return!1}function Bt(e,t){for(var r=0;r<e.length;++r)if(!zt(e[r],t))return!1;for(var n=0;n<e.length-1;++n)if(Ft(e[n],e[n+1],t))return!1;return!0}function jt(e,t){for(var r=0;r<t.length;r++)if(Bt(e,t[r]))return!0;return!1}function Nt(e,t,r){for(var n=[],i=0;i<e.length;i++){for(var a=[],o=0;o<e[i].length;o++){var s=It(e[i][o],r);Et(t,s),a.push(s)}n.push(a)}return n}function Ut(e,t,r){for(var n=[],i=0;i<e.length;i++){var a=Nt(e[i],t,r);n.push(a)}return n}function Vt(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){var i=.5*n,a=e[0]-r[0]>i?-n:r[0]-e[0]>i?n:0;0===a&&(a=e[0]-r[2]>i?-n:r[2]-e[0]>i?n:0),e[0]+=a}Et(t,e)}function qt(e,t,r,n){for(var i=Math.pow(2,n.z)*St,a=[n.x*St,n.y*St],o=[],s=0,l=e;s<l.length;s+=1)for(var c=0,u=l[s];c<u.length;c+=1){var h=u[c],f=[h.x+a[0],h.y+a[1]];Vt(f,t,r,i),o.push(f)}return o}function Ht(e,t,r,n){for(var i=Math.pow(2,n.z)*St,a=[n.x*St,n.y*St],o=[],s=0,l=e;s<l.length;s+=1){for(var c=[],u=0,h=l[s];u<h.length;u+=1){var f=h[u],p=[f.x+a[0],f.y+a[1]];Et(t,p),c.push(p)}o.push(c)}if(t[2]-t[0]<=i/2){!function(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}(t);for(var d=0,m=o;d<m.length;d+=1)for(var g=0,y=m[d];g<y.length;g+=1)Vt(y[g],t,r,i)}return o}var Gt=function(e,t){this.type=We,this.geojson=e,this.geometries=t};function Wt(e){if(e instanceof At){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Gt)return!1;var t=!0;return e.eachChild((function(e){t&&!Wt(e)&&(t=!1)})),t}function Zt(e){if(e instanceof At&&"feature-state"===e.name)return!1;var t=!0;return e.eachChild((function(e){t&&!Zt(e)&&(t=!1)})),t}function Yt(e,t){if(e instanceof At&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild((function(e){r&&!Yt(e,t)&&(r=!1)})),r}Gt.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(ft(e[1])){var r=e[1];if("FeatureCollection"===r.type)for(var n=0;n<r.features.length;++n){var i=r.features[n].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Gt(r,r.features[n].geometry)}else if("Feature"===r.type){var a=r.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new Gt(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Gt(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Gt.prototype.evaluate=function(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){var a=Nt(t.coordinates,n,i),o=qt(e.geometry(),r,n,i);if(!Ct(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!zt(l[s],a))return!1}if("MultiPolygon"===t.type){var c=Ut(t.coordinates,n,i),u=qt(e.geometry(),r,n,i);if(!Ct(r,n))return!1;for(var h=0,f=u;h<f.length;h+=1)if(!Dt(f[h],c))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){var a=Nt(t.coordinates,n,i),o=Ht(e.geometry(),r,n,i);if(!Ct(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!Bt(l[s],a))return!1}if("MultiPolygon"===t.type){var c=Ut(t.coordinates,n,i),u=Ht(e.geometry(),r,n,i);if(!Ct(r,n))return!1;for(var h=0,f=u;h<f.length;h+=1)if(!jt(f[h],c))return!1}return!0}(e,this.geometries)}return!1},Gt.prototype.eachChild=function(){},Gt.prototype.outputDefined=function(){return!0},Gt.prototype.serialize=function(){return["within",this.geojson]};var Xt=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};Xt.parse=function(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new Xt(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Xt.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},Xt.prototype.eachChild=function(){},Xt.prototype.outputDefined=function(){return!1},Xt.prototype.serialize=function(){return["var",this.name]};var $t=function(e,t,r,n,i){void 0===t&&(t=[]),void 0===n&&(n=new Ve),void 0===i&&(i=[]),this.registry=e,this.path=t,this.key=t.map((function(e){return"["+e+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r};function Kt(e){if(e instanceof Xt)return Kt(e.boundExpression);if(e instanceof At&&"error"===e.name)return!1;if(e instanceof Mt)return!1;if(e instanceof Gt)return!1;var t=e instanceof wt||e instanceof vt,r=!0;return e.eachChild((function(e){r=t?r&&Kt(e):r&&e instanceof mt})),!!r&&Wt(e)&&Yt(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Jt(e,t){for(var r,n,i=e.length-1,a=0,o=i,s=0;a<=o;)if(r=e[s=Math.floor((a+o)/2)],n=e[s+1],r<=t){if(s===i||t<n)return s;a=s+1}else{if(!(r>t))throw new gt("Input is not a number.");o=s-1}return 0}$t.prototype.parse=function(e,t,r,n,i){return void 0===i&&(i={}),t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)},$t.prototype._parse=function(e,t){function r(e,t,r){return"assert"===r?new vt(t,[e]):"coerce"===r?new wt(t,[e]):e}if((null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e)&&(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=e[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(e,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,t.typeAnnotation||"coerce");else a=r(a,o,t.typeAnnotation||"assert")}if(!(a instanceof mt)&&"resolvedImage"!==a.type.kind&&Kt(a)){var l=new kt;try{a=new mt(a.type,a.evaluate(l))}catch(e){return this.error(e.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},$t.prototype.concat=function(e,t,r){var n="number"==typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new $t(this.registry,n,t||null,i,this.errors)},$t.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var n=""+this.key+t.map((function(e){return"["+e+"]"})).join("");this.errors.push(new Ue(n,e))},$t.prototype.checkSubtype=function(e,t){var r=rt(e,t);return r&&this.error(r),r};var Qt=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var a=i[n],o=a[0],s=a[1];this.labels.push(o),this.outputs.push(s)}};function er(e,t,r){return e*(1-r)+t*r}Qt.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 r=t.parse(e[1],1,He);if(!r)return null;var n=[],i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(var a=1;a<e.length;a+=2){var o=1===a?-1/0:e[a],s=e[a+1],l=a,c=a+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=t.parse(s,c,i);if(!u)return null;i=i||u.type,n.push([o,u])}return new Qt(i,r,n)},Qt.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Jt(t,n)].evaluate(e)},Qt.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},Qt.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},Qt.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};var tr=Object.freeze({__proto__:null,number:er,color:function(e,t,r){return new ot(er(e.r,t.r,r),er(e.g,t.g,r),er(e.b,t.b,r),er(e.a,t.a,r))},array:function(e,t,r){return e.map((function(e,n){return er(e,t[n],r)}))}}),rr=.95047,nr=1.08883,ir=4/29,ar=6/29,or=3*ar*ar,sr=ar*ar*ar,lr=Math.PI/180,cr=180/Math.PI;function ur(e){return e>sr?Math.pow(e,1/3):e/or+ir}function hr(e){return e>ar?e*e*e:or*(e-ir)}function fr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function pr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function dr(e){var t=pr(e.r),r=pr(e.g),n=pr(e.b),i=ur((.4124564*t+.3575761*r+.1804375*n)/rr),a=ur((.2126729*t+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-ur((.0193339*t+.119192*r+.9503041*n)/nr)),alpha:e.a}}function mr(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*hr(t),r=rr*hr(r),n=nr*hr(n),new ot(fr(3.2404542*r-1.5371385*t-.4985314*n),fr(-.969266*r+1.8760108*t+.041556*n),fr(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function gr(e,t,r){var n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var yr={forward:dr,reverse:mr,interpolate:function(e,t,r){return{l:er(e.l,t.l,r),a:er(e.a,t.a,r),b:er(e.b,t.b,r),alpha:er(e.alpha,t.alpha,r)}}},vr={forward:function(e){var t=dr(e),r=t.l,n=t.a,i=t.b,a=Math.atan2(i,n)*cr;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:e.a}},reverse:function(e){var t=e.h*lr,r=e.c;return mr({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:gr(e.h,t.h,r),c:er(e.c,t.c,r),l:er(e.l,t.l,r),alpha:er(e.alpha,t.alpha,r)}}},xr=Object.freeze({__proto__:null,lab:yr,hcl:vr}),_r=function(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a<o.length;a+=1){var s=o[a],l=s[0],c=s[1];this.labels.push(l),this.outputs.push(c)}};function br(e,t,r,n){var i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}_r.interpolationFactor=function(e,t,r,i){var a=0;if("exponential"===e.name)a=br(t,e.base,r,i);else if("linear"===e.name)a=br(t,1,r,i);else if("cubic-bezier"===e.name){var o=e.controlPoints;a=new n(o[0],o[1],o[2],o[3]).solve(br(t,1,r,i))}return a},_r.parse=function(e,t){var r=e[0],n=e[1],i=e[2],a=e.slice(3);if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var o=n[1];if("number"!=typeof o)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:o}}else{if("cubic-bezier"!==n[0])return t.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(e){return"number"!=typeof e||e<0||e>1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}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,He)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Ze:t.expectedType&&"value"!==t.expectedType.kind&&(c=t.expectedType);for(var u=0;u<a.length;u+=2){var h=a[u],f=a[u+1],p=u+3,d=u+4;if("number"!=typeof h)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(l.length&&l[l.length-1][0]>=h)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var m=t.parse(f,d,c);if(!m)return null;c=c||m.type,l.push([h,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new _r(c,r,n,i,l):t.error("Type "+et(c)+" is not interpolatable.")},_r.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);var a=Jt(t,n),o=t[a],s=t[a+1],l=_r.interpolationFactor(this.interpolation,n,o,s),c=r[a].evaluate(e),u=r[a+1].evaluate(e);return"interpolate"===this.operator?tr[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?vr.reverse(vr.interpolate(vr.forward(c),vr.forward(u),l)):yr.reverse(yr.interpolate(yr.forward(c),yr.forward(u),l))},_r.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},_r.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},_r.prototype.serialize=function(){var e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],r=0;r<this.labels.length;r++)t.push(this.labels[r],this.outputs[r].serialize());return t};var wr=function(e,t){this.type=e,this.args=t};wr.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null,n=t.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],a=0,o=e.slice(1);a<o.length;a+=1){var s=o[a],l=t.parse(s,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!l)return null;r=r||l.type,i.push(l)}var c=n&&i.some((function(e){return rt(n,e.type)}));return new wr(c?Xe:r,i)},wr.prototype.evaluate=function(e){for(var t,r=null,n=0,i=0,a=this.args;i<a.length&&(n++,(r=a[i].evaluate(e))&&r instanceof ut&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null===r);i+=1);return r},wr.prototype.eachChild=function(e){this.args.forEach(e)},wr.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},wr.prototype.serialize=function(){var e=["coalesce"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Tr=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};Tr.prototype.evaluate=function(e){return this.result.evaluate(e)},Tr.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},Tr.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var r=[],n=1;n<e.length-1;n+=2){var i=e[n];if("string"!=typeof i)return t.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);var a=t.parse(e[n+1],n+1);if(!a)return null;r.push([i,a])}var o=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return o?new Tr(r,o):null},Tr.prototype.outputDefined=function(){return this.result.outputDefined()},Tr.prototype.serialize=function(){for(var e=["let"],t=0,r=this.bindings;t<r.length;t+=1){var n=r[t],i=n[0],a=n[1];e.push(i,a.serialize())}return e.push(this.result.serialize()),e};var kr=function(e,t,r){this.type=e,this.index=t,this.input=r};kr.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,He),n=t.parse(e[2],2,Qe(t.expectedType||Xe));if(!r||!n)return null;var i=n.type;return new kr(i.itemType,r,n)},kr.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new gt("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new gt("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new gt("Array index must be an integer, but found "+t+" instead.");return r[t]},kr.prototype.eachChild=function(e){e(this.index),e(this.input)},kr.prototype.outputDefined=function(){return!1},kr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Ar=function(e,t){this.type=We,this.needle=e,this.haystack=t};Ar.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Xe),n=t.parse(e[2],2,Xe);return r&&n?nt(r.type,[We,Ge,He,qe,Xe])?new Ar(r,n):t.error("Expected first argument to be of type boolean, string, number or null, but found "+et(r.type)+" instead"):null},Ar.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!it(t,["boolean","string","number","null"]))throw new gt("Expected first argument to be of type boolean, string, number or null, but found "+et(pt(t))+" instead.");if(!it(r,["string","array"]))throw new gt("Expected second argument to be of type array or string, but found "+et(pt(r))+" instead.");return r.indexOf(t)>=0},Ar.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},Ar.prototype.outputDefined=function(){return!0},Ar.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Mr=function(e,t,r){this.type=He,this.needle=e,this.haystack=t,this.fromIndex=r};Mr.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 r=t.parse(e[1],1,Xe),n=t.parse(e[2],2,Xe);if(!r||!n)return null;if(!nt(r.type,[We,Ge,He,qe,Xe]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+et(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,He);return i?new Mr(r,n,i):null}return new Mr(r,n)},Mr.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!it(t,["boolean","string","number","null"]))throw new gt("Expected first argument to be of type boolean, string, number or null, but found "+et(pt(t))+" instead.");if(!it(r,["string","array"]))throw new gt("Expected second argument to be of type array or string, but found "+et(pt(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)},Mr.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Mr.prototype.outputDefined=function(){return!1},Mr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){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 Sr=function(e,t,r,n,i,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};Sr.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 r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var i={},a=[],o=2;o<e.length-1;o+=2){var s=e[o],l=e[o+1];Array.isArray(s)||(s=[s]);var c=t.concat(o);if(0===s.length)return c.error("Expected at least one branch label.");for(var u=0,h=s;u<h.length;u+=1){var f=h[u];if("number"!=typeof f&&"string"!=typeof f)return c.error("Branch labels must be numbers or strings.");if("number"==typeof f&&Math.abs(f)>Number.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,pt(f)))return null}else r=pt(f);if(typeof i[String(f)]<"u")return c.error("Branch labels must be unique.");i[String(f)]=a.length}var p=t.parse(l,o,n);if(!p)return null;n=n||p.type,a.push(p)}var d=t.parse(e[1],1,Xe);if(!d)return null;var m=t.parse(e[e.length-1],e.length-1,n);return!m||"value"!==d.type.kind&&t.concat(1).checkSubtype(r,d.type)?null:new Sr(r,n,d,i,a,m)},Sr.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(pt(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},Sr.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},Sr.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},Sr.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i<a.length;i+=1){var o=a[i];void 0===(h=n[this.cases[o]])?(n[this.cases[o]]=r.length,r.push([this.cases[o],[o]])):r[h][1].push(o)}for(var s=function(t){return"number"===e.inputType.kind?Number(t):t},l=0,c=r;l<c.length;l+=1){var u=c[l],h=u[0],f=u[1];1===f.length?t.push(s(f[0])):t.push(f.map(s)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var Er=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};Er.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 r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(var n=[],i=1;i<e.length-1;i+=2){var a=t.parse(e[i],i,We);if(!a)return null;var o=t.parse(e[i+1],i+1,r);if(!o)return null;n.push([a,o]),r=r||o.type}var s=t.parse(e[e.length-1],e.length-1,r);return s?new Er(r,n,s):null},Er.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var n=r[t],i=n[0],a=n[1];if(i.evaluate(e))return a.evaluate(e)}return this.otherwise.evaluate(e)},Er.prototype.eachChild=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var n=r[t],i=n[0],a=n[1];e(i),e(a)}e(this.otherwise)},Er.prototype.outputDefined=function(){return this.branches.every((function(e){return e[0],e[1].outputDefined()}))&&this.otherwise.outputDefined()},Er.prototype.serialize=function(){var e=["case"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Cr=function(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n};function Ir(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Lr(e,t,r,n){return 0===n.compare(t,r)}function Pr(e,t,r){var n="=="!==e&&"!="!==e;return function(){function i(e,t,r){this.type=We,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return i.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var r=e[0],a=t.parse(e[1],1,Xe);if(!a)return null;if(!Ir(r,a.type))return t.concat(1).error('"'+r+"\" comparisons are not supported for type '"+et(a.type)+"'.");var o=t.parse(e[2],2,Xe);if(!o)return null;if(!Ir(r,o.type))return t.concat(2).error('"'+r+"\" comparisons are not supported for type '"+et(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot compare types '"+et(a.type)+"' and '"+et(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new vt(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new vt(a.type,[o])));var s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,$e)))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(n&&this.hasUntypedArgument){var s=pt(a),l=pt(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new gt('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var c=pt(a),u=pt(o);if("string"!==c.kind||"string"!==u.kind)return t(i,a,o)}return this.collator?r(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}()}Cr.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 r=t.parse(e[1],1,Xe),n=t.parse(e[2],2,He);if(!r||!n)return null;if(!nt(r.type,[Qe(Xe),Ge,Xe]))return t.error("Expected first argument to be of type array or string, but found "+et(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,He);return i?new Cr(r.type,r,n,i):null}return new Cr(r.type,r,n)},Cr.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!it(t,["string","array"]))throw new gt("Expected first argument to be of type array or string, but found "+et(pt(t))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)},Cr.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Cr.prototype.outputDefined=function(){return!1},Cr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var zr=Pr("==",(function(e,t,r){return t===r}),Lr),Dr=Pr("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!Lr(0,t,r,n)})),Or=Pr("<",(function(e,t,r){return t<r}),(function(e,t,r,n){return n.compare(t,r)<0})),Rr=Pr(">",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),Fr=Pr("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),Br=Pr(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0})),jr=function(e,t,r,n,i){this.type=Ge,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};jr.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,He);if(!r)return null;var n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=t.parse(n.locale,1,Ge)))return null;var a=null;if(n.currency&&!(a=t.parse(n.currency,1,Ge)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=t.parse(n["min-fraction-digits"],1,He)))return null;var s=null;return n["max-fraction-digits"]&&!(s=t.parse(n["max-fraction-digits"],1,He))?null:new jr(r,i,a,o,s)},jr.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))},jr.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)},jr.prototype.outputDefined=function(){return!1},jr.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 Nr=function(e){this.type=He,this.input=e};Nr.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error("Expected argument of type string or array, but found "+et(r.type)+" instead."):new Nr(r):null},Nr.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new gt("Expected value to be of type string or array, but found "+et(pt(t))+" instead.")},Nr.prototype.eachChild=function(e){e(this.input)},Nr.prototype.outputDefined=function(){return!1},Nr.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Ur={"==":zr,"!=":Dr,">":Rr,"<":Or,">=":Br,"<=":Fr,array:vt,at:kr,boolean:vt,case:Er,coalesce:wr,collator:Mt,format:xt,image:_t,in:Ar,"index-of":Mr,interpolate:_r,"interpolate-hcl":_r,"interpolate-lab":_r,length:Nr,let:Tr,literal:mt,match:Sr,number:vt,"number-format":jr,object:vt,slice:Cr,step:Qt,string:vt,"to-boolean":wt,"to-color":wt,"to-number":wt,"to-string":wt,var:Xt,within:Gt};function Vr(e,t){var r=t[0],n=t[1],i=t[2],a=t[3];r=r.evaluate(e),n=n.evaluate(e),i=i.evaluate(e);var o=a?a.evaluate(e):1,s=ht(r,n,i,o);if(s)throw new gt(s);return new ot(r/255*o,n/255*o,i/255*o,o)}function qr(e,t){return e in t}function Hr(e,t){var r=t[e];return typeof r>"u"?null:r}function Gr(e){return{type:e}}function Wr(e){return{result:"success",value:e}}function Zr(e){return{result:"error",value:e}}function Yr(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function Xr(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function $r(e){return!!e.expression&&e.expression.interpolated}function Kr(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Jr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Qr(e){return e}function en(e,t){var r,n,i,a="color"===t.type,o=e.stops&&"object"==typeof e.stops[0][0],s=o||void 0!==e.property,l=o||!s,c=e.type||($r(t)?"exponential":"interval");if(a&&((e=Be({},e)).stops&&(e.stops=e.stops.map((function(e){return[e[0],ot.parse(e[1])]}))),e.default?e.default=ot.parse(e.default):e.default=ot.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!xr[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===c)r=an;else if("interval"===c)r=nn;else if("categorical"===c){r=rn,n=Object.create(null);for(var u=0,h=e.stops;u<h.length;u+=1){var f=h[u];n[f[0]]=f[1]}i=typeof e.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');r=on}if(o){for(var p={},d=[],m=0;m<e.stops.length;m++){var g=e.stops[m],y=g[0].zoom;void 0===p[y]&&(p[y]={zoom:y,type:e.type,property:e.property,default:e.default,stops:[]},d.push(y)),p[y].stops.push([g[0].value,g[1]])}for(var v=[],x=0,_=d;x<_.length;x+=1){var b=_[x];v.push([p[b].zoom,en(p[b],t)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:_r.interpolationFactor.bind(void 0,w),zoomStops:v.map((function(e){return e[0]})),evaluate:function(r,n){var i=r.zoom;return an({stops:v,base:e.base},t,i).evaluate(i,n)}}}if(l){var T="exponential"===c?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:T,interpolationFactor:_r.interpolationFactor.bind(void 0,T),zoomStops:e.stops.map((function(e){return e[0]})),evaluate:function(a){var o=a.zoom;return r(e,t,o,n,i)}}}return{kind:"source",evaluate:function(a,o){var s=o&&o.properties?o.properties[e.property]:void 0;return void 0===s?tn(e.default,t.default):r(e,t,s,n,i)}}}function tn(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function rn(e,t,r,n,i){return tn(typeof r===i?n[r]:void 0,e.default,t.default)}function nn(e,t,r){if("number"!==Kr(r))return tn(e.default,t.default);var n=e.stops.length;if(1===n||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];var i=Jt(e.stops.map((function(e){return e[0]})),r);return e.stops[i][1]}function an(e,t,r){var n=void 0!==e.base?e.base:1;if("number"!==Kr(r))return tn(e.default,t.default);var i=e.stops.length;if(1===i||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];var a=Jt(e.stops.map((function(e){return e[0]})),r),o=function(e,t,r,n){var i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}(r,n,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],c=tr[t.type]||Qr;if(e.colorSpace&&"rgb"!==e.colorSpace){var u=xr[e.colorSpace];c=function(e,t){return u.reverse(u.interpolate(u.forward(e),u.forward(t),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function on(e,t,r){return"color"===t.type?r=ot.parse(r):"formatted"===t.type?r=ct.fromString(r.toString()):"resolvedImage"===t.type?r=ut.fromString(r.toString()):Kr(r)!==t.type&&("enum"!==t.type||!t.values[r])&&(r=void 0),tn(r,e.default,t.default)}At.register(Ur,{error:[{kind:"error"},[Ge],function(e,t){var r=t[0];throw new gt(r.evaluate(e))}],typeof:[Ge,[Xe],function(e,t){return et(pt(t[0].evaluate(e)))}],"to-rgba":[Qe(He,4),[Ze],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Ze,[He,He,He],Vr],rgba:[Ze,[He,He,He,He],Vr],has:{type:We,overloads:[[[Ge],function(e,t){return qr(t[0].evaluate(e),e.properties())}],[[Ge,Ye],function(e,t){var r=t[0],n=t[1];return qr(r.evaluate(e),n.evaluate(e))}]]},get:{type:Xe,overloads:[[[Ge],function(e,t){return Hr(t[0].evaluate(e),e.properties())}],[[Ge,Ye],function(e,t){var r=t[0],n=t[1];return Hr(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[Xe,[Ge],function(e,t){return Hr(t[0].evaluate(e),e.featureState||{})}],properties:[Ye,[],function(e){return e.properties()}],"geometry-type":[Ge,[],function(e){return e.geometryType()}],id:[Xe,[],function(e){return e.id()}],zoom:[He,[],function(e){return e.globals.zoom}],"heatmap-density":[He,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[He,[],function(e){return e.globals.lineProgress||0}],accumulated:[Xe,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[He,Gr(He),function(e,t){for(var r=0,n=0,i=t;n<i.length;n+=1)r+=i[n].evaluate(e);return r}],"*":[He,Gr(He),function(e,t){for(var r=1,n=0,i=t;n<i.length;n+=1)r*=i[n].evaluate(e);return r}],"-":{type:He,overloads:[[[He,He],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)-n.evaluate(e)}],[[He],function(e,t){return-t[0].evaluate(e)}]]},"/":[He,[He,He],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)/n.evaluate(e)}],"%":[He,[He,He],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)%n.evaluate(e)}],ln2:[He,[],function(){return Math.LN2}],pi:[He,[],function(){return Math.PI}],e:[He,[],function(){return Math.E}],"^":[He,[He,He],function(e,t){var r=t[0],n=t[1];return Math.pow(r.evaluate(e),n.evaluate(e))}],sqrt:[He,[He],function(e,t){var r=t[0];return Math.sqrt(r.evaluate(e))}],log10:[He,[He],function(e,t){var r=t[0];return Math.log(r.evaluate(e))/Math.LN10}],ln:[He,[He],function(e,t){var r=t[0];return Math.log(r.evaluate(e))}],log2:[He,[He],function(e,t){var r=t[0];return Math.log(r.evaluate(e))/Math.LN2}],sin:[He,[He],function(e,t){var r=t[0];return Math.sin(r.evaluate(e))}],cos:[He,[He],function(e,t){var r=t[0];return Math.cos(r.evaluate(e))}],tan:[He,[He],function(e,t){var r=t[0];return Math.tan(r.evaluate(e))}],asin:[He,[He],function(e,t){var r=t[0];return Math.asin(r.evaluate(e))}],acos:[He,[He],function(e,t){var r=t[0];return Math.acos(r.evaluate(e))}],atan:[He,[He],function(e,t){var r=t[0];return Math.atan(r.evaluate(e))}],min:[He,Gr(He),function(e,t){return Math.min.apply(Math,t.map((function(t){return t.evaluate(e)})))}],max:[He,Gr(He),function(e,t){return Math.max.apply(Math,t.map((function(t){return t.evaluate(e)})))}],abs:[He,[He],function(e,t){var r=t[0];return Math.abs(r.evaluate(e))}],round:[He,[He],function(e,t){var r=t[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[He,[He],function(e,t){var r=t[0];return Math.floor(r.evaluate(e))}],ceil:[He,[He],function(e,t){var r=t[0];return Math.ceil(r.evaluate(e))}],"filter-==":[We,[Ge,Xe],function(e,t){var r=t[0],n=t[1];return e.properties()[r.value]===n.value}],"filter-id-==":[We,[Xe],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[We,[Ge],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[We,[Ge,Xe],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i<a}],"filter-id-<":[We,[Xe],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[We,[Ge,Xe],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[We,[Xe],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[We,[Ge,Xe],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[We,[Xe],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[We,[Ge,Xe],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[We,[Xe],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[We,[Xe],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[We,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[We,[Qe(Ge)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[We,[Qe(Xe)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[We,[Ge,Qe(Xe)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[We,[Ge,Qe(Xe)],function(e,t){var r=t[0],n=t[1];return function(e,t,r,n){for(;r<=n;){var i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}(e.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:We,overloads:[[[We,We],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)&&n.evaluate(e)}],[Gr(We),function(e,t){for(var r=0,n=t;r<n.length;r+=1)if(!n[r].evaluate(e))return!1;return!0}]]},any:{type:We,overloads:[[[We,We],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)||n.evaluate(e)}],[Gr(We),function(e,t){for(var r=0,n=t;r<n.length;r+=1)if(n[r].evaluate(e))return!0;return!1}]]},"!":[We,[We],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[We,[Ge],function(e,t){var r=t[0],n=e.globals&&e.globals.isSupportedScript;return!n||n(r.evaluate(e))}],upcase:[Ge,[Ge],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[Ge,[Ge],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[Ge,Gr(Xe),function(e,t){return t.map((function(t){return dt(t.evaluate(e))})).join("")}],"resolved-locale":[Ge,[$e],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var sn=function(e,t){var r;this.expression=e,this._warningHistory={},this._evaluator=new kt,this._defaultValue=t?"color"===(r=t).type&&Jr(r.default)?new ot(0,0,0,0):"color"===r.type?ot.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=t&&"enum"===t.type?t.values:null};function ln(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Ur}function cn(e,t){var r=new $t(Ur,[],t?function(e){var t={color:Ze,string:Ge,number:He,enum:Ge,boolean:We,formatted:Ke,resolvedImage:Je};return"array"===e.type?Qe(t[e.value]||Xe,e.length):t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?Wr(new sn(n,t)):Zr(r.errors)}sn.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},sn.prototype.evaluate=function(e,t,r,n,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new gt("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}};var un=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Zt(t.expression)};un.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},un.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)};var hn=function(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Zt(t.expression),this.interpolationType=n};function fn(e,t){if("error"===(e=cn(e,t)).result)return e;var r=e.value.expression,n=Wt(r);if(!n&&!Yr(t))return Zr([new Ue("","data expressions not supported")]);var i=Yt(r,["zoom"]);if(!i&&!Xr(t))return Zr([new Ue("","zoom expressions not supported")]);var a=dn(r);if(!a&&!i)return Zr([new Ue("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Ue)return Zr([a]);if(a instanceof _r&&!$r(t))return Zr([new Ue("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Wr(new un(n?"constant":"source",e.value));var o=a instanceof _r?a.interpolation:void 0;return Wr(new hn(n?"camera":"composite",e.value,a.labels,o))}hn.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},hn.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)},hn.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?_r.interpolationFactor(this.interpolationType,e,t,r):0};var pn=function(e,t){this._parameters=e,this._specification=t,Be(this,en(this._parameters,this._specification))};function dn(e){var t=null;if(e instanceof Tr)t=dn(e.result);else if(e instanceof wr)for(var r=0,n=e.args;r<n.length;r+=1){var i=n[r];if(t=dn(i))break}else(e instanceof Qt||e instanceof _r)&&e.input instanceof At&&"zoom"===e.input.name&&(t=e);return t instanceof Ue||e.eachChild((function(e){var r=dn(e);r instanceof Ue?t=r:!t&&r?t=new Ue("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new Ue("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function mn(e){var t=e.key,r=e.value,n=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=[],l=Kr(r);if("object"!==l)return[new Re(t,r,"object expected, "+l+" found")];for(var c in r){var u=c.split(".")[0],h=n[u]||n["*"],f=void 0;if(i[u])f=i[u];else if(n[u])f=Vn;else if(i["*"])f=i["*"];else{if(!n["*"]){s.push(new Re(t,r[c],'unknown property "'+c+'"'));continue}f=Vn}s=s.concat(f({key:(t&&t+".")+c,value:r[c],valueSpec:h,style:a,styleSpec:o,object:r,objectKey:c},r))}for(var p in n)i[p]||n[p].required&&void 0===n[p].default&&void 0===r[p]&&s.push(new Re(t,r,'missing required property "'+p+'"'));return s}function gn(e){var t=e.value,r=e.valueSpec,n=e.style,i=e.styleSpec,a=e.key,o=e.arrayElementValidator||Vn;if("array"!==Kr(t))return[new Re(a,t,"array expected, "+Kr(t)+" found")];if(r.length&&t.length!==r.length)return[new Re(a,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new Re(a,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===Kr(r.value)&&(s=r.value);for(var l=[],c=0;c<t.length;c++)l=l.concat(o({array:t,arrayIndex:c,value:t[c],valueSpec:s,style:n,styleSpec:i,key:a+"["+c+"]"}));return l}function yn(e){var t=e.key,r=e.value,n=e.valueSpec,i=Kr(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new Re(t,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new Re(t,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new Re(t,r,r+" is greater than the maximum value "+n.maximum)]:[]}function vn(e){var t,r,n,i=e.valueSpec,a=je(e.value.type),o={},s="categorical"!==a&&void 0===e.value.property,l=!s,c="array"===Kr(e.value.stops)&&"array"===Kr(e.value.stops[0])&&"object"===Kr(e.value.stops[0][0]),u=mn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===a)return[new Re(e.key,e.value,'identity function may not have a "stops" property')];var t=[],r=e.value;return t=t.concat(gn({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:h})),"array"===Kr(r)&&0===r.length&&t.push(new Re(e.key,r,"array must have at least one stop")),t},default:function(e){return Vn({key:e.key,value:e.value,valueSpec:i,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===a&&s&&u.push(new Re(e.key,e.value,'missing required property "property"')),"identity"!==a&&!e.value.stops&&u.push(new Re(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!$r(e.valueSpec)&&u.push(new Re(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Yr(e.valueSpec)?u.push(new Re(e.key,e.value,"property functions not supported")):s&&!Xr(e.valueSpec)&&u.push(new Re(e.key,e.value,"zoom functions not supported"))),("categorical"===a||c)&&void 0===e.value.property&&u.push(new Re(e.key,e.value,'"property" property is required')),u;function h(e){var t=[],a=e.value,s=e.key;if("array"!==Kr(a))return[new Re(s,a,"array expected, "+Kr(a)+" found")];if(2!==a.length)return[new Re(s,a,"array length 2 expected, length "+a.length+" found")];if(c){if("object"!==Kr(a[0]))return[new Re(s,a,"object expected, "+Kr(a[0])+" found")];if(void 0===a[0].zoom)return[new Re(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Re(s,a,"object stop key must have value")];if(n&&n>je(a[0].zoom))return[new Re(s,a[0].zoom,"stop zoom values must appear in ascending order")];je(a[0].zoom)!==n&&(n=je(a[0].zoom),r=void 0,o={}),t=t.concat(mn({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:yn,value:f}}))}else t=t.concat(f({key:s+"[0]",value:a[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},a));return ln(Ne(a[1]))?t.concat([new Re(s+"[1]",a[1],"expressions are not allowed in function stops.")]):t.concat(Vn({key:s+"[1]",value:a[1],valueSpec:i,style:e.style,styleSpec:e.styleSpec}))}function f(e,n){var s=Kr(e.value),l=je(e.value),c=null!==e.value?e.value:n;if(t){if(s!==t)return[new Re(e.key,c,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Re(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var u="number expected, "+s+" found";return Yr(i)&&void 0===a&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Re(e.key,c,u)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l<r?[new Re(e.key,c,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in o?[new Re(e.key,c,"stop domain values must be unique")]:(o[l]=!0,[])):[new Re(e.key,c,"integer expected, found "+l)]}}function xn(e){var t=("property"===e.expressionContext?fn:cn)(Ne(e.value),e.valueSpec);if("error"===t.result)return t.value.map((function(t){return new Re(""+e.key+t.key,e.value,t.message)}));var r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new Re(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===e.expressionContext&&"layout"===e.propertyType&&!Zt(r))return[new Re(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!Zt(r))return[new Re(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!Yt(r,["zoom","feature-state"]))return[new Re(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!Wt(r))return[new Re(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function _n(e){var t=e.key,r=e.value,n=e.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(je(r))&&i.push(new Re(t,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(je(r))&&i.push(new Re(t,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function bn(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t<r.length;t+=1){var n=r[t];if(!bn(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}pn.deserialize=function(e){return new pn(e._parameters,e._specification)},pn.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var wn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Tn(e){if(null==e)return{filter:function(){return!0},needGeometry:!1};bn(e)||(e=Mn(e));var t=cn(e,wn);if("error"===t.result)throw new Error(t.value.map((function(e){return e.key+": "+e.message})).join(", "));return{filter:function(e,r,n){return t.value.evaluate(e,r,{},n)},needGeometry:An(e)}}function kn(e,t){return e<t?-1:e>t?1:0}function An(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var t=1;t<e.length;t++)if(An(e[t]))return!0;return!1}function Mn(e){if(!e)return!0;var t=e[0];return e.length<=1?"any"!==t:"=="===t?Sn(e[1],e[2],"=="):"!="===t?In(Sn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?Sn(e[1],e[2],t):"any"===t?function(e){return["any"].concat(e.map(Mn))}(e.slice(1)):"all"===t?["all"].concat(e.slice(1).map(Mn)):"none"===t?["all"].concat(e.slice(1).map(Mn).map(In)):"in"===t?En(e[1],e.slice(2)):"!in"===t?In(En(e[1],e.slice(2))):"has"===t?Cn(e[1]):"!has"===t?In(Cn(e[1])):"within"!==t||e}function Sn(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function En(e,t){if(0===t.length)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(kn)]]:["filter-in-small",e,["literal",t]]}}function Cn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function In(e){return["!",e]}function Ln(e){return bn(Ne(e.value))?xn(Be({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Pn(e)}function Pn(e){var t=e.value,r=e.key;if("array"!==Kr(t))return[new Re(r,t,"array expected, "+Kr(t)+" found")];var n,i=e.styleSpec,a=[];if(t.length<1)return[new Re(r,t,"filter array must have at least 1 element")];switch(a=a.concat(_n({key:r+"[0]",value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),je(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===je(t[1])&&a.push(new Re(r,t,'"$type" cannot be use with operator "'+t[0]+'"'));case"==":case"!=":3!==t.length&&a.push(new Re(r,t,'filter array for operator "'+t[0]+'" must have 3 elements'));case"in":case"!in":t.length>=2&&"string"!==(n=Kr(t[1]))&&a.push(new Re(r+"[1]",t[1],"string expected, "+n+" found"));for(var o=2;o<t.length;o++)n=Kr(t[o]),"$type"===je(t[1])?a=a.concat(_n({key:r+"["+o+"]",value:t[o],valueSpec:i.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&a.push(new Re(r+"["+o+"]",t[o],"string, number, or boolean expected, "+n+" found"));break;case"any":case"all":case"none":for(var s=1;s<t.length;s++)a=a.concat(Pn({key:r+"["+s+"]",value:t[s],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=Kr(t[1]),2!==t.length?a.push(new Re(r,t,'filter array for "'+t[0]+'" operator must have 2 elements')):"string"!==n&&a.push(new Re(r+"[1]",t[1],"string expected, "+n+" found"));break;case"within":n=Kr(t[1]),2!==t.length?a.push(new Re(r,t,'filter array for "'+t[0]+'" operator must have 2 elements')):"object"!==n&&a.push(new Re(r+"[1]",t[1],"object expected, "+n+" found"))}return a}function zn(e,t){var r=e.key,n=e.style,i=e.styleSpec,a=e.value,o=e.objectKey,s=i[t+"_"+e.layerType];if(!s)return[];var l=o.match(/^(.*)-transition$/);if("paint"===t&&l&&s[l[1]]&&s[l[1]].transition)return Vn({key:r,value:a,valueSpec:i.transition,style:n,styleSpec:i});var c,u=e.valueSpec||s[o];if(!u)return[new Re(r,a,'unknown property "'+o+'"')];if("string"===Kr(a)&&Yr(u)&&!u.tokens&&(c=/^{([^}]+)}$/.exec(a)))return[new Re(r,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(c[1])+" }`.")];var h=[];return"symbol"===e.layerType&&("text-field"===o&&n&&!n.glyphs&&h.push(new Re(r,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&Jr(Ne(a))&&"identity"===je(a.type)&&h.push(new Re(r,a,'"text-font" does not support identity functions'))),h.concat(Vn({key:e.key,value:a,valueSpec:u,style:n,styleSpec:i,expressionContext:"property",propertyType:t,propertyKey:o}))}function Dn(e){return zn(e,"paint")}function On(e){return zn(e,"layout")}function Rn(e){var t=[],r=e.value,n=e.key,i=e.style,a=e.styleSpec;!r.type&&!r.ref&&t.push(new Re(n,r,'either "type" or "ref" is required'));var o,s=je(r.type),l=je(r.ref);if(r.id)for(var c=je(r.id),u=0;u<e.arrayIndex;u++){var h=i.layers[u];je(h.id)===c&&t.push(new Re(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+h.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(e){e in r&&t.push(new Re(n,r[e],'"'+e+'" is prohibited for ref layers'))})),i.layers.forEach((function(e){je(e.id)===l&&(o=e)})),o?o.ref?t.push(new Re(n,r.ref,"ref cannot reference another ref layer")):s=je(o.type):t.push(new Re(n,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var f=i.sources&&i.sources[r.source],p=f&&je(f.type);f?"vector"===p&&"raster"===s?t.push(new Re(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===p&&"raster"!==s?t.push(new Re(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==p||r["source-layer"]?"raster-dem"===p&&"hillshade"!==s?t.push(new Re(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"===s&&r.paint&&r.paint["line-gradient"]&&("geojson"!==p||!f.lineMetrics)&&t.push(new Re(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new Re(n,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new Re(n,r.source,'source "'+r.source+'" not found'))}else t.push(new Re(n,r,'missing required property "source"'));return t=t.concat(mn({key:n,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Vn({key:n+".type",value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:Ln,layout:function(e){return mn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return On(Be({layerType:s},e))}}})},paint:function(e){return mn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return Dn(Be({layerType:s},e))}}})}}}))}function Fn(e){var t=e.value,r=e.key,n=Kr(t);return"string"!==n?[new Re(r,t,"string expected, "+n+" found")]:[]}var Bn={promoteId:function(e){var t=e.key,r=e.value;if("string"===Kr(r))return Fn({key:t,value:r});var n=[];for(var i in r)n.push.apply(n,Fn({key:t+"."+i,value:r[i]}));return n}};function jn(e){var t=e.value,r=e.key,n=e.styleSpec,i=e.style;if(!t.type)return[new Re(r,t,'"type" is required')];var a,o=je(t.type);switch(o){case"vector":case"raster":case"raster-dem":return mn({key:r,value:t,valueSpec:n["source_"+o.replace("-","_")],style:e.style,styleSpec:n,objectElementValidators:Bn});case"geojson":if(a=mn({key:r,value:t,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:Bn}),t.cluster)for(var s in t.clusterProperties){var l=t.clusterProperties[s],c=l[0],u=l[1],h="string"==typeof c?[c,["accumulated"],["get",s]]:c;a.push.apply(a,xn({key:r+"."+s+".map",value:u,expressionContext:"cluster-map"})),a.push.apply(a,xn({key:r+"."+s+".reduce",value:h,expressionContext:"cluster-reduce"}))}return a;case"video":return mn({key:r,value:t,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return mn({key:r,value:t,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new Re(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return _n({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function Nn(e){var t=e.value,r=e.styleSpec,n=r.light,i=e.style,a=[],o=Kr(t);if(void 0===t)return a;if("object"!==o)return a.concat([new Re("light",t,"object expected, "+o+" found")]);for(var s in t){var l=s.match(/^(.*)-transition$/);a=l&&n[l[1]]&&n[l[1]].transition?a.concat(Vn({key:s,value:t[s],valueSpec:r.transition,style:i,styleSpec:r})):n[s]?a.concat(Vn({key:s,value:t[s],valueSpec:n[s],style:i,styleSpec:r})):a.concat([new Re(s,t[s],'unknown property "'+s+'"')])}return a}var Un={"*":function(){return[]},array:gn,boolean:function(e){var t=e.value,r=e.key,n=Kr(t);return"boolean"!==n?[new Re(r,t,"boolean expected, "+n+" found")]:[]},number:yn,color:function(e){var t=e.key,r=e.value,n=Kr(r);return"string"!==n?[new Re(t,r,"color expected, "+n+" found")]:null===at(r)?[new Re(t,r,'color expected, "'+r+'" found')]:[]},constants:Fe,enum:_n,filter:Ln,function:vn,layer:Rn,object:mn,source:jn,light:Nn,string:Fn,formatted:function(e){return 0===Fn(e).length?[]:xn(e)},resolvedImage:function(e){return 0===Fn(e).length?[]:xn(e)}};function Vn(e){var t=e.value,r=e.valueSpec,n=e.styleSpec;return r.expression&&Jr(je(t))?vn(e):r.expression&&ln(Ne(t))?xn(e):r.type&&Un[r.type]?Un[r.type](e):mn(Be({},e,{valueSpec:r.type?n[r.type]:r}))}function qn(e){var t=e.value,r=e.key,n=Fn(e);return n.length||(-1===t.indexOf("{fontstack}")&&n.push(new Re(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&n.push(new Re(r,t,'"glyphs" url must include a "{range}" token'))),n}function Hn(e,t){void 0===t&&(t=Oe);var r=[];return r=r.concat(Vn({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:qn,"*":function(){return[]}}})),e.constants&&(r=r.concat(Fe({key:"constants",value:e.constants,style:e,styleSpec:t}))),Gn(r)}function Gn(e){return[].concat(e).sort((function(e,t){return e.line-t.line}))}function Wn(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Gn(e.apply(this,t))}}Hn.source=Wn(jn),Hn.light=Wn(Nn),Hn.layer=Wn(Rn),Hn.filter=Wn(Ln),Hn.paintProperty=Wn(Dn),Hn.layoutProperty=Wn(On);var Zn=Hn,Yn=Zn.light,Xn=Zn.paintProperty,$n=Zn.layoutProperty;function Kn(e,t){var r=!1;if(t&&t.length)for(var n=0,i=t;n<i.length;n+=1){var a=i[n];e.fire(new ze(new Error(a.message))),r=!0}return r}var Jn=ei,Qn=3;function ei(e,t,r){var n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var i=new Int32Array(this.arrayBuffer);e=i[0],t=i[1],r=i[2],this.d=t+2*r;for(var a=0;a<this.d*this.d;a++){var o=i[Qn+a],s=i[Qn+a+1];n.push(o===s?null:i.subarray(o,s))}var l=i[Qn+n.length],c=i[Qn+n.length+1];this.keys=i.subarray(l,c),this.bboxes=i.subarray(c),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var u=0;u<this.d*this.d;u++)n.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var h=r/t*e;this.min=-h,this.max=e+h}ei.prototype.insert=function(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},ei.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ei.prototype._insertCell=function(e,t,r,n,i,a){this.cells[i].push(a)},ei.prototype.query=function(e,t,r,n,i){var a=this.min,o=this.max;if(e<=a&&t<=a&&o<=r&&o<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(e,t,r,n,this._queryCell,s,{},i),s},ei.prototype._queryCell=function(e,t,r,n,i,a,o,s){var l=this.cells[i];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var f=l[h];if(void 0===o[f]){var p=4*f;(s?s(u[p+0],u[p+1],u[p+2],u[p+3]):e<=u[p+2]&&t<=u[p+3]&&r>=u[p+0]&&n>=u[p+1])?(o[f]=!0,a.push(c[f])):o[f]=!1}}},ei.prototype._forEachCell=function(e,t,r,n,i,a,o,s){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n),f=l;f<=u;f++)for(var p=c;p<=h;p++){var d=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,r,n,d,a,o,s))return}},ei.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},ei.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},ei.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=Qn+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(t+r+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[Qn+o]=a,i.set(s,a),a+=s.length}return i[Qn+e.length]=a,i.set(this.keys,a),a+=this.keys.length,i[Qn+e.length+1]=a,i.set(this.bboxes,a),a+=this.bboxes.length,i.buffer};var ti=s.ImageData,ri=s.ImageBitmap,ni={};function ii(e,t,r){void 0===r&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),ni[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(var ai in ii("Object",Object),Jn.serialize=function(e,t){var r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}},Jn.deserialize=function(e){return new Jn(e.buffer)},ii("Grid",Jn),ii("Color",ot),ii("Error",Error),ii("ResolvedImage",ut),ii("StylePropertyFunction",pn),ii("StyleExpression",sn,{omit:["_evaluator"]}),ii("ZoomDependentExpression",hn),ii("ZoomConstantExpression",un),ii("CompoundExpression",At,{omit:["_evaluate"]}),Ur)Ur[ai]._classRegistryKey||ii("Expression_"+ai,Ur[ai]);function oi(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function si(e){return ri&&e instanceof ri}function li(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(oi(e)||si(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof ti)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var n=[],i=0,a=e;i<a.length;i+=1){var o=a[i];n.push(li(o,t))}return n}if("object"==typeof e){var s=e.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class");var c=s.serialize?s.serialize(e,t):{};if(!s.serialize){for(var u in e)if(e.hasOwnProperty(u)&&!(ni[l].omit.indexOf(u)>=0)){var h=e[u];c[u]=ni[l].shallow.indexOf(u)>=0?h:li(h,t)}e instanceof Error&&(c.message=e.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof e)}function ci(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||oi(e)||si(e)||ArrayBuffer.isView(e)||e instanceof ti)return e;if(Array.isArray(e))return e.map(ci);if("object"==typeof e){var t=e.$name||"Object",r=ni[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var n=Object.create(r.prototype),i=0,a=Object.keys(e);i<a.length;i+=1){var o=a[i];if("$name"!==o){var s=e[o];n[o]=ni[t].shallow.indexOf(o)>=0?s:ci(s)}}return n}throw new Error("can't deserialize object of type "+typeof e)}var ui=function(){this.first=!0};ui.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))};var hi={"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 fi(e){for(var t=0,r=e;t<r.length;t+=1)if(mi(r[t].charCodeAt(0)))return!0;return!1}function pi(e){return!(hi.Arabic(e)||hi["Arabic Supplement"](e)||hi["Arabic Extended-A"](e)||hi["Arabic Presentation Forms-A"](e)||hi["Arabic Presentation Forms-B"](e))}function di(e){return!(e<11904||!(hi["Bopomofo Extended"](e)||hi.Bopomofo(e)||hi["CJK Compatibility Forms"](e)||hi["CJK Compatibility Ideographs"](e)||hi["CJK Compatibility"](e)||hi["CJK Radicals Supplement"](e)||hi["CJK Strokes"](e)||hi["CJK Symbols and Punctuation"](e)||hi["CJK Unified Ideographs Extension A"](e)||hi["CJK Unified Ideographs"](e)||hi["Enclosed CJK Letters and Months"](e)||hi["Halfwidth and Fullwidth Forms"](e)||hi.Hiragana(e)||hi["Ideographic Description Characters"](e)||hi["Kangxi Radicals"](e)||hi["Katakana Phonetic Extensions"](e)||hi.Katakana(e)||hi["Vertical Forms"](e)||hi["Yi Radicals"](e)||hi["Yi Syllables"](e)))}function mi(e){return 746===e||747===e||!(e<4352)&&!!(hi["Bopomofo Extended"](e)||hi.Bopomofo(e)||hi["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||hi["CJK Compatibility Ideographs"](e)||hi["CJK Compatibility"](e)||hi["CJK Radicals Supplement"](e)||hi["CJK Strokes"](e)||hi["CJK Symbols and Punctuation"](e)&&!(e>=12296&&e<=12305)&&!(e>=12308&&e<=12319)&&12336!==e||hi["CJK Unified Ideographs Extension A"](e)||hi["CJK Unified Ideographs"](e)||hi["Enclosed CJK Letters and Months"](e)||hi["Hangul Compatibility Jamo"](e)||hi["Hangul Jamo Extended-A"](e)||hi["Hangul Jamo Extended-B"](e)||hi["Hangul Jamo"](e)||hi["Hangul Syllables"](e)||hi.Hiragana(e)||hi["Ideographic Description Characters"](e)||hi.Kanbun(e)||hi["Kangxi Radicals"](e)||hi["Katakana Phonetic Extensions"](e)||hi.Katakana(e)&&12540!==e||!(!hi["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!hi["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||hi["Unified Canadian Aboriginal Syllabics"](e)||hi["Unified Canadian Aboriginal Syllabics Extended"](e)||hi["Vertical Forms"](e)||hi["Yijing Hexagram Symbols"](e)||hi["Yi Syllables"](e)||hi["Yi Radicals"](e))}function gi(e){return!(mi(e)||function(e){return!!(hi["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||hi["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||hi["Letterlike Symbols"](e)||hi["Number Forms"](e)||hi["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||hi["Control Pictures"](e)&&9251!==e||hi["Optical Character Recognition"](e)||hi["Enclosed Alphanumerics"](e)||hi["Geometric Shapes"](e)||hi["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||hi["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||hi["CJK Symbols and Punctuation"](e)||hi.Katakana(e)||hi["Private Use Area"](e)||hi["CJK Compatibility Forms"](e)||hi["Small Form Variants"](e)||hi["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function yi(e){return hi.Arabic(e)||hi["Arabic Supplement"](e)||hi["Arabic Extended-A"](e)||hi["Arabic Presentation Forms-A"](e)||hi["Arabic Presentation Forms-B"](e)}function vi(e){return e>=1424&&e<=2303||hi["Arabic Presentation Forms-A"](e)||hi["Arabic Presentation Forms-B"](e)}function xi(e,t){return!(!t&&vi(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||hi.Khmer(e))}function _i(e){for(var t=0,r=e;t<r.length;t+=1)if(vi(r[t].charCodeAt(0)))return!0;return!1}var bi="deferred",wi="loading",Ti="loaded",ki=null,Ai="unavailable",Mi=null,Si=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(Ai="error"),ki&&ki(e)};function Ei(){Ci.fire(new Pe("pluginStateChange",{pluginStatus:Ai,pluginURL:Mi}))}var Ci=new De,Ii=function(){return Ai},Li=function(){if(Ai!==bi||!Mi)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ai=wi,Ei(),Mi&&Te({url:Mi},(function(e){e?Si(e):(Ai=Ti,Ei())}))},Pi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Ai===Ti||null!=Pi.applyArabicShaping},isLoading:function(){return Ai===wi},setState:function(e){Ai=e.pluginStatus,Mi=e.pluginURL},isParsed:function(){return null!=Pi.applyArabicShaping&&null!=Pi.processBidirectionalText&&null!=Pi.processStyledBidirectionalText},getPluginURL:function(){return Mi}},zi=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 ui,this.transition={})};zi.prototype.isSupportedScript=function(e){return function(e,t){for(var r=0,n=e;r<n.length;r+=1)if(!xi(n[r].charCodeAt(0),t))return!1;return!0}(e,Pi.isLoaded())},zi.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},zi.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Di=function(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(Jr(e))return new pn(e,t);if(ln(e)){var r=fn(e,t);if("error"===r.result)throw new Error(r.value.map((function(e){return e.key+": "+e.message})).join(", "));return r.value}var n=e;return"string"==typeof e&&"color"===t.type&&(n=ot.parse(e)),{kind:"constant",evaluate:function(){return n}}}(void 0===t?e.specification.default:t,e.specification)};Di.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Di.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var Oi=function(e){this.property=e,this.value=new Di(e,void 0)};Oi.prototype.transitioned=function(e,t){return new Fi(this.property,this.value,t,p({},e.transition,this.transition),e.now)},Oi.prototype.untransitioned=function(){return new Fi(this.property,this.value,null,{},0)};var Ri=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};Ri.prototype.getValue=function(e){return w(this._values[e].value.value)},Ri.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Oi(this._values[e].property)),this._values[e].value=new Di(this._values[e].property,null===t?void 0:w(t))},Ri.prototype.getTransition=function(e){return w(this._values[e].transition)},Ri.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Oi(this._values[e].property)),this._values[e].transition=w(t)||void 0},Ri.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var n=r[t],i=this.getValue(n);void 0!==i&&(e[n]=i);var a=this.getTransition(n);void 0!==a&&(e[n+"-transition"]=a)}return e},Ri.prototype.transitioned=function(e,t){for(var r=new Bi(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].transitioned(e,t._values[a])}return r},Ri.prototype.untransitioned=function(){for(var e=new Bi(this._properties),t=0,r=Object.keys(this._values);t<r.length;t+=1){var n=r[t];e._values[n]=this._values[n].untransitioned()}return e};var Fi=function(e,t,r,n,i){this.property=e,this.value=t,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,e.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};Fi.prototype.possiblyEvaluate=function(e,t,r){var n=e.now||0,i=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(e,t,r);var o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,r),i,function(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}(o))}return i};var Bi=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};Bi.prototype.possiblyEvaluate=function(e,t,r){for(var n=new Ui(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];n._values[o]=this._values[o].possiblyEvaluate(e,t,r)}return n},Bi.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1){var r=t[e];if(this._values[r].prior)return!0}return!1};var ji=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};ji.prototype.getValue=function(e){return w(this._values[e].value)},ji.prototype.setValue=function(e,t){this._values[e]=new Di(this._values[e].property,null===t?void 0:w(t))},ji.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var n=r[t],i=this.getValue(n);void 0!==i&&(e[n]=i)}return e},ji.prototype.possiblyEvaluate=function(e,t,r){for(var n=new Ui(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];n._values[o]=this._values[o].possiblyEvaluate(e,t,r)}return n};var Ni=function(e,t,r){this.property=e,this.value=t,this.parameters=r};Ni.prototype.isConstant=function(){return"constant"===this.value.kind},Ni.prototype.constantOr=function(e){return"constant"===this.value.kind?this.value.value:e},Ni.prototype.evaluate=function(e,t,r,n){return this.property.evaluate(this.value,this.parameters,e,t,r,n)};var Ui=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};Ui.prototype.get=function(e){return this._values[e]};var Vi=function(e){this.specification=e};Vi.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},Vi.prototype.interpolate=function(e,t,r){var n=tr[this.specification.type];return n?n(e,t,r):e};var qi=function(e,t){this.specification=e,this.overrides=t};qi.prototype.possiblyEvaluate=function(e,t,r,n){return"constant"===e.expression.kind||"camera"===e.expression.kind?new Ni(this,{kind:"constant",value:e.expression.evaluate(t,null,{},r,n)},t):new Ni(this,e.expression,t)},qi.prototype.interpolate=function(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Ni(this,{kind:"constant",value:void 0},e.parameters);var n=tr[this.specification.type];return n?new Ni(this,{kind:"constant",value:n(e.value.value,t.value.value,r)},e.parameters):e},qi.prototype.evaluate=function(e,t,r,n,i,a){return"constant"===e.kind?e.value:e.evaluate(t,r,n,i,a)};var Hi=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,r,n){if(void 0===e.value)return new Ni(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){var i=e.expression.evaluate(t,null,{},r,n),a="resolvedImage"===e.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,t);return new Ni(this,{kind:"constant",value:o},t)}if("camera"===e.expression.kind){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 Ni(this,{kind:"constant",value:s},t)}return new Ni(this,e.expression,t)},t.prototype.evaluate=function(e,t,r,n,i,a){if("source"===e.kind){var o=e.evaluate(t,r,n,i,a);return this._calculate(o,o,o,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,n),e.evaluate({zoom:Math.floor(t.zoom)},r,n),e.evaluate({zoom:Math.floor(t.zoom)+1},r,n),t):e.value},t.prototype._calculate=function(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},t.prototype.interpolate=function(e){return e},t}(qi),Gi=function(e){this.specification=e};Gi.prototype.possiblyEvaluate=function(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){var i=e.expression.evaluate(t,null,{},r,n);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new zi(Math.floor(t.zoom-1),t)),e.expression.evaluate(new zi(Math.floor(t.zoom),t)),e.expression.evaluate(new zi(Math.floor(t.zoom+1),t)),t)}},Gi.prototype._calculate=function(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},Gi.prototype.interpolate=function(e){return e};var Wi=function(e){this.specification=e};Wi.prototype.possiblyEvaluate=function(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)},Wi.prototype.interpolate=function(){return!1};var Zi=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var n=this.defaultPropertyValues[t]=new Di(r,void 0),i=this.defaultTransitionablePropertyValues[t]=new Oi(r);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}};ii("DataDrivenProperty",qi),ii("DataConstantProperty",Vi),ii("CrossFadedDataDrivenProperty",Hi),ii("CrossFadedProperty",Gi),ii("ColorRampProperty",Wi);var Yi="-transition",Xi=function(e){function t(t,r){if(e.call(this),this.id=t.id,this.type=t.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new ji(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Ri(r.paint),t.paint)this.setPaintProperty(n,t.paint[n],{validate:!1});for(var i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ui(r.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"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)},t.prototype.setLayoutProperty=function(e,t,r){if(void 0===r&&(r={}),null!=t){var n="layers."+this.id+".layout."+e;if(this._validate($n,n,e,t,r))return}"visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t},t.prototype.getPaintProperty=function(e){return x(e,Yi)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)},t.prototype.setPaintProperty=function(e,t,r){if(void 0===r&&(r={}),null!=t){var n="layers."+this.id+".paint."+e;if(this._validate(Xn,n,e,t,r))return!1}if(x(e,Yi))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;var i=this._transitionablePaint._values[e],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var l=this._transitionablePaint._values[e].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(e,s,l)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){},t.prototype._handleOverridablePaintPropertyUpdate=function(e,t,r){return!1},t.prototype.isHidden=function(e){return!!(this.minzoom&&e<this.minzoom||this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility},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),b(e,(function(e,t){return!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)}))},t.prototype._validate=function(e,t,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Kn(this,e.call(Zn,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:Oe,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 Ni&&Yr(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1},t}(De),$i={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ki=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},Ji=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Qi(e,t){void 0===t&&(t=1);var r=0,n=0;return{members:e.map((function(e){var i=function(e){return $i[e].BYTES_PER_ELEMENT}(e.type),a=r=ea(r,Math.max(t,i)),o=e.components||1;return n=Math.max(n,i),r+=i*o,{name:e.name,type:e.type,components:o,offset:a}})),size:ea(r,Math.max(n,t)),alignment:t}}function ea(e,t){return Math.ceil(e/t)*t}Ji.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Ji.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},Ji.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ji.prototype.clear=function(){this.length=0},Ji.prototype.resize=function(e){this.reserve(e),this.length=e},Ji.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Ji.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var ta=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 r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e},t}(Ji);ta.prototype.bytesPerElement=4,ii("StructArrayLayout2i4",ta);var ra=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,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,e},t}(Ji);ra.prototype.bytesPerElement=8,ii("StructArrayLayout4i8",ra);var na=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,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(Ji);na.prototype.bytesPerElement=12,ii("StructArrayLayout2i4i12",na);var ia=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,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,e},t}(Ji);ia.prototype.bytesPerElement=8,ii("StructArrayLayout2i4ub8",ia);var aa=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 r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e},t}(Ji);aa.prototype.bytesPerElement=8,ii("StructArrayLayout2f8",aa);var oa=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,r,n,i,a,o,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,n,i,a,o,s,l,c)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c,u){var h=10*e;return this.uint16[h+0]=t,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,e},t}(Ji);oa.prototype.bytesPerElement=20,ii("StructArrayLayout10ui20",oa);var sa=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,r,n,i,a,o,s,l,c,u,h){var f=this.length;return this.resize(f+1),this.emplace(f,e,t,r,n,i,a,o,s,l,c,u,h)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c,u,h,f){var p=12*e;return this.int16[p+0]=t,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=f,e},t}(Ji);sa.prototype.bytesPerElement=24,ii("StructArrayLayout4i4ui4i24",sa);var la=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,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e},t}(Ji);la.prototype.bytesPerElement=12,ii("StructArrayLayout3f12",la);var ca=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 r=1*e;return this.uint32[r+0]=t,e},t}(Ji);ca.prototype.bytesPerElement=4,ii("StructArrayLayout1ul4",ca);var ua=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,r,n,i,a,o,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,i,a,o,s,l)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c){var u=10*e,h=5*e;return this.int16[u+0]=t,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,e},t}(Ji);ua.prototype.bytesPerElement=20,ii("StructArrayLayout6i1ul2ui20",ua);var ha=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,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(Ji);ha.prototype.bytesPerElement=12,ii("StructArrayLayout2i2i2i12",ha);var fa=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,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i)},t.prototype.emplace=function(e,t,r,n,i,a){var o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,e},t}(Ji);fa.prototype.bytesPerElement=16,ii("StructArrayLayout2f1f2i16",fa);var pa=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,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=12*e,o=3*e;return this.uint8[a+0]=t,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,e},t}(Ji);pa.prototype.bytesPerElement=12,ii("StructArrayLayout2ub2f12",pa);var da=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,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e},t}(Ji);da.prototype.bytesPerElement=6,ii("StructArrayLayout3ui6",da);var ma=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,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,e,t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y){var v=24*e,x=12*e,_=48*e;return this.int16[v+0]=t,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=f,this.uint8[_+36]=p,this.uint8[_+37]=d,this.uint8[_+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,e},t}(Ji);ma.prototype.bytesPerElement=48,ii("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ma);var ga=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,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S){var E=this.length;return this.resize(E+1),this.emplace(E,e,t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E){var C=34*e,I=17*e;return this.int16[C+0]=t,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=u,this.uint16[C+10]=h,this.uint16[C+11]=f,this.uint16[C+12]=p,this.uint16[C+13]=d,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=_,this.uint16[C+20]=b,this.uint16[C+21]=w,this.uint16[C+22]=T,this.uint32[I+12]=k,this.float32[I+13]=A,this.float32[I+14]=M,this.float32[I+15]=S,this.float32[I+16]=E,e},t}(Ji);ga.prototype.bytesPerElement=68,ii("StructArrayLayout8i15ui1ul4f68",ga);var ya=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 r=1*e;return this.float32[r+0]=t,e},t}(Ji);ya.prototype.bytesPerElement=4,ii("StructArrayLayout1f4",ya);var va=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,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e},t}(Ji);va.prototype.bytesPerElement=6,ii("StructArrayLayout3i6",va);var xa=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,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=2*e,a=4*e;return this.uint32[i+0]=t,this.uint16[a+2]=r,this.uint16[a+3]=n,e},t}(Ji);xa.prototype.bytesPerElement=8,ii("StructArrayLayout1ul2ui8",xa);var _a=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 r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e},t}(Ji);_a.prototype.bytesPerElement=4,ii("StructArrayLayout2ui4",_a);var ba=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 r=1*e;return this.uint16[r+0]=t,e},t}(Ji);ba.prototype.bytesPerElement=2,ii("StructArrayLayout1ui2",ba);var wa=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,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,e},t}(Ji);wa.prototype.bytesPerElement=16,ii("StructArrayLayout4f16",wa);var Ta=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={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 r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t}(Ki);Ta.prototype.size=20;var ka=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 Ta(this,e)},t}(ua);ii("CollisionBoxArray",ka);var Aa=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={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 r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(e){this._structArray.uint8[this._pos1+37]=e},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(e){this._structArray.uint8[this._pos1+38]=e},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+10]=e},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t}(Ki);Aa.prototype.size=48;var Ma=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 Aa(this,e)},t}(ma);ii("PlacedSymbolArray",Ma);var Sa=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={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 r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+12]=e},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t}(Ki);Sa.prototype.size=68;var Ea=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 Sa(this,e)},t}(ga);ii("SymbolInstanceArray",Ea);var Ca=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[1*e+0]},t}(ya);ii("GlyphOffsetArray",Ca);var Ia=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[3*e+0]},t.prototype.gety=function(e){return this.int16[3*e+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[3*e+2]},t}(va);ii("SymbolLineVertexArray",Ia);var La=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t}(Ki);La.prototype.size=8;var Pa=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 La(this,e)},t}(xa);ii("FeatureIndexArray",Pa);var za=Qi([{name:"a_pos",components:2,type:"Int16"}],4).members,Da=function(e){void 0===e&&(e=[]),this.segments=e};function Oa(e,t){return 256*(e=h(Math.floor(e),0,255))+h(Math.floor(t),0,255)}Da.prototype.prepareSegment=function(e,t,r,n){var i=this.segments[this.segments.length-1];return e>Da.MAX_VERTEX_ARRAY_LENGTH&&k("Max vertices per segment is "+Da.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!i||i.vertexLength+e>Da.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Da.prototype.get=function(){return this.segments},Da.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var r=t[e];for(var n in r.vaos)r.vaos[n].destroy()}},Da.simpleSegment=function(e,t,r,n){return new Da([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},Da.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ii("SegmentVector",Da);var Ra=Qi([{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"}]),Fa=t((function(e){e.exports=function(e,t){var r,n,i,a,o,s,l,c;for(r=3&e.length,n=e.length-r,i=t,o=3432918353,s=461845907,c=0;c<n;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,i=27492+(65535&(a=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>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}})),Ba=t((function(e){e.exports=function(e,t){for(var r,n=e.length,i=t^n,a=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){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}})),ja=Fa,Na=Fa,Ua=Ba;ja.murmur3=Na,ja.murmur2=Ua;var Va=function(){this.ids=[],this.positions=[],this.indexed=!1};Va.prototype.add=function(e,t,r,n){this.ids.push(Ha(e)),this.positions.push(t,r,n)},Va.prototype.getPositions=function(e){for(var t=Ha(e),r=0,n=this.ids.length-1;r<n;){var i=r+n>>1;this.ids[i]>=t?n=i:r=i+1}for(var a=[];this.ids[r]===t;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},Va.serialize=function(e,t){var r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Ga(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}},Va.deserialize=function(e){var t=new Va;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var qa=Math.pow(2,53)-1;function Ha(e){var t=+e;return!isNaN(t)&&t<=qa?t:ja(String(e))}function Ga(e,t,r,n){for(;r<n;){for(var i=e[r+n>>1],a=r-1,o=n+1;;){do{a++}while(e[a]<i);do{o--}while(e[o]>i);if(a>=o)break;Wa(e,a,o),Wa(t,3*a,3*o),Wa(t,3*a+1,3*o+1),Wa(t,3*a+2,3*o+2)}o-r<n-o?(Ga(e,t,r,o),r=o+1):(Ga(e,t,o+1,n),n=o)}}function Wa(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}ii("FeaturePositionMap",Va);var Za=function(e,t){this.gl=e.gl,this.location=t},Ya=function(e){function t(t,r){e.call(this,t,r),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}(Za),Xa=function(e){function t(t,r){e.call(this,t,r),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}(Za),$a=function(e){function t(t,r){e.call(this,t,r),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}(Za),Ka=function(e){function t(t,r){e.call(this,t,r),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}(Za),Ja=function(e){function t(t,r){e.call(this,t,r),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}(Za),Qa=function(e){function t(t,r){e.call(this,t,r),this.current=ot.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}(Za),eo=new Float32Array(16),to=function(e){function t(t,r){e.call(this,t,r),this.current=eo}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])return this.current=e,void this.gl.uniformMatrix4fv(this.location,!1,e);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}(Za);function ro(e){return[Oa(255*e.r,255*e.g),Oa(255*e.b,255*e.a)]}var no=function(e,t,r){this.value=e,this.uniformNames=t.map((function(e){return"u_"+e})),this.type=r};no.prototype.setUniform=function(e,t,r){e.set(r.constantOr(this.value))},no.prototype.getBinding=function(e,t,r){return"color"===this.type?new Qa(e,t):new Xa(e,t)};var io=function(e,t){this.uniformNames=t.map((function(e){return"u_"+e})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};io.prototype.setConstantPatternPositions=function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr},io.prototype.setUniform=function(e,t,r,n){var i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&e.set(i)},io.prototype.getBinding=function(e,t,r){return"u_pattern"===r.substr(0,9)?new Ja(e,t):new Xa(e,t)};var ao=function(e,t,r,n){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((function(e){return{name:"a_"+e,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n};ao.prototype.populatePaintArray=function(e,t,r,n,i){var a=this.paintVertexArray.length,o=this.expression.evaluate(new zi(0),t,{},n,[],i);this.paintVertexArray.resize(e),this._setPaintValue(a,e,o)},ao.prototype.updatePaintArray=function(e,t,r,n){var i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(e,t,i)},ao.prototype._setPaintValue=function(e,t,r){if("color"===this.type)for(var n=ro(r),i=e;i<t;i++)this.paintVertexArray.emplace(i,n[0],n[1]);else{for(var a=e;a<t;a++)this.paintVertexArray.emplace(a,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},ao.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))},ao.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var oo=function(e,t,r,n,i,a){this.expression=e,this.uniformNames=t.map((function(e){return"u_"+e+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map((function(e){return{name:"a_"+e,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new a};oo.prototype.populatePaintArray=function(e,t,r,n,i){var a=this.expression.evaluate(new zi(this.zoom),t,{},n,[],i),o=this.expression.evaluate(new zi(this.zoom+1),t,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(s,e,a,o)},oo.prototype.updatePaintArray=function(e,t,r,n){var i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(e,t,i,a)},oo.prototype._setPaintValue=function(e,t,r,n){if("color"===this.type)for(var i=ro(r),a=ro(n),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,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}},oo.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))},oo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},oo.prototype.setUniform=function(e,t){var r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,n=h(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(n)},oo.prototype.getBinding=function(e,t,r){return new Xa(e,t)};var so=function(e,t,r,n,i,a){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=n,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i};so.prototype.populatePaintArray=function(e,t,r){var n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(n,e,t.patterns&&t.patterns[this.layerId],r)},so.prototype.updatePaintArray=function(e,t,r,n,i){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],i)},so.prototype._setPaintValues=function(e,t,r,n){if(n&&r){var i=r.min,a=r.mid,o=r.max,s=n[i],l=n[a],c=n[o];if(s&&l&&c)for(var u=e;u<t;u++)this.zoomInPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],l.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],l.pixelRatio,c.pixelRatio)}},so.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,Ra.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,Ra.members,this.expression.isStateDependent))},so.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var lo=function(e,t,r){this.binders={},this._buffers=[];var n=[];for(var i in e.paint._values)if(r(i)){var a=e.paint.get(i);if(a instanceof Ni&&Yr(a.property.specification)){var o=uo(i,e.type),s=a.value,l=a.property.specification.type,c=a.property.useIntegerZoom,u=a.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===s.kind)this.binders[i]=h?new io(s.value,o):new no(s.value,o,l),n.push("/u_"+i);else if("source"===s.kind||h){var f=ho(i,l,"source");this.binders[i]=h?new so(s,l,c,t,f,e.id):new ao(s,o,l,f),n.push("/a_"+i)}else{var p=ho(i,l,"composite");this.binders[i]=new oo(s,o,l,c,t,p),n.push("/z_"+i)}}}this.cacheKey=n.sort().join("")};lo.prototype.getMaxValue=function(e){var t=this.binders[e];return t instanceof ao||t instanceof oo?t.maxValue:0},lo.prototype.populatePaintArrays=function(e,t,r,n,i){for(var a in this.binders){var o=this.binders[a];(o instanceof ao||o instanceof oo||o instanceof so)&&o.populatePaintArray(e,t,r,n,i)}},lo.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var n=this.binders[r];n instanceof io&&n.setConstantPatternPositions(e,t)}},lo.prototype.updatePaintArrays=function(e,t,r,n,i){var a=!1;for(var o in e)for(var s=0,l=t.getPositions(o);s<l.length;s+=1){var c=l[s],u=r.feature(c.index);for(var h in this.binders){var f=this.binders[h];if((f instanceof ao||f instanceof oo||f instanceof so)&&!0===f.expression.isStateDependent){var p=n.paint.get(h);f.expression=p.value,f.updatePaintArray(c.start,c.end,u,e[o],i),a=!0}}}return a},lo.prototype.defines=function(){var e=[];for(var t in this.binders){var r=this.binders[t];(r instanceof no||r instanceof io)&&e.push.apply(e,r.uniformNames.map((function(e){return"#define HAS_UNIFORM_"+e})))}return e},lo.prototype.getBinderAttributes=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof ao||r instanceof oo)for(var n=0;n<r.paintVertexAttributes.length;n++)e.push(r.paintVertexAttributes[n].name);else if(r instanceof so)for(var i=0;i<Ra.members.length;i++)e.push(Ra.members[i].name)}return e},lo.prototype.getBinderUniforms=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof no||r instanceof io||r instanceof oo)for(var n=0,i=r.uniformNames;n<i.length;n+=1){var a=i[n];e.push(a)}}return e},lo.prototype.getPaintVertexBuffers=function(){return this._buffers},lo.prototype.getUniforms=function(e,t){var r=[];for(var n in this.binders){var i=this.binders[n];if(i instanceof no||i instanceof io||i instanceof oo)for(var a=0,o=i.uniformNames;a<o.length;a+=1){var s=o[a];if(t[s]){var l=i.getBinding(e,t[s],s);r.push({name:s,property:n,binding:l})}}}return r},lo.prototype.setUniforms=function(e,t,r,n){for(var i=0,a=t;i<a.length;i+=1){var o=a[i],s=o.name,l=o.property,c=o.binding;this.binders[l].setUniform(c,n,r.get(l),s)}},lo.prototype.updatePaintBuffers=function(e){for(var t in this._buffers=[],this.binders){var r=this.binders[t];if(e&&r instanceof so){var n=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(r instanceof ao||r instanceof oo)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},lo.prototype.upload=function(e){for(var t in this.binders){var r=this.binders[t];(r instanceof ao||r instanceof oo||r instanceof so)&&r.upload(e)}this.updatePaintBuffers()},lo.prototype.destroy=function(){for(var e in this.binders){var t=this.binders[e];(t instanceof ao||t instanceof oo||t instanceof so)&&t.destroy()}};var co=function(e,t,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(var n=0,i=e;n<i.length;n+=1){var a=i[n];this.programConfigurations[a.id]=new lo(a,t,r)}this.needsUpload=!1,this._featureMap=new Va,this._bufferOffset=0};function uo(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 ho(e,t,r){var n={color:{source:aa,composite:wa},number:{source:ya,composite:aa}},i=function(e){return{"line-pattern":{source:oa,composite:oa},"fill-pattern":{source:oa,composite:oa},"fill-extrusion-pattern":{source:oa,composite:oa}}[e]}(e);return i&&i[r]||n[t][r]}co.prototype.populatePaintArrays=function(e,t,r,n,i,a){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(e,t,n,i,a);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0},co.prototype.updatePaintArrays=function(e,t,r,n){for(var i=0,a=r;i<a.length;i+=1){var o=a[i];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,t,o,n)||this.needsUpload}},co.prototype.get=function(e){return this.programConfigurations[e]},co.prototype.upload=function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}},co.prototype.destroy=function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()},ii("ConstantBinder",no),ii("CrossFadedConstantBinder",io),ii("SourceExpressionBinder",ao),ii("CrossFadedCompositeBinder",so),ii("CompositeExpressionBinder",oo),ii("ProgramConfiguration",lo,{omit:["_buffers"]}),ii("ProgramConfigurationSet",co);var fo=8192,po=Math.pow(2,14)-1,mo=-po-1;function go(e){for(var t=fo/e.extent,r=e.loadGeometry(),n=0;n<r.length;n++)for(var i=r[n],a=0;a<i.length;a++){var o=i[a],s=Math.round(o.x*t),l=Math.round(o.y*t);o.x=h(s,mo,po),o.y=h(l,mo,po),(s<o.x||s>o.x+1||l<o.y||l>o.y+1)&&k("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function yo(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?go(e):[]}}function vo(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}var xo=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 ta,this.indexArray=new da,this.segments=new Da,this.programConfigurations=new co(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function _o(e,t){for(var r=0;r<e.length;r++)if(Co(t,e[r]))return!0;for(var n=0;n<t.length;n++)if(Co(e,t[n]))return!0;return!!ko(e,t)}function bo(e,t,r){return!(!Co(e,t)&&!Mo(t,e,r))}function wo(e,t){if(1===e.length)return Eo(t,e[0]);for(var r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;i++)if(Co(e,n[i]))return!0;for(var a=0;a<e.length;a++)if(Eo(t,e[a]))return!0;for(var o=0;o<t.length;o++)if(ko(e,t[o]))return!0;return!1}function To(e,t,r){if(e.length>1){if(ko(e,t))return!0;for(var n=0;n<t.length;n++)if(Mo(t[n],e,r))return!0}for(var i=0;i<e.length;i++)if(Mo(e[i],t,r))return!0;return!1}function ko(e,t){if(0===e.length||0===t.length)return!1;for(var r=0;r<e.length-1;r++)for(var n=e[r],i=e[r+1],a=0;a<t.length-1;a++)if(Ao(n,i,t[a],t[a+1]))return!0;return!1}function Ao(e,t,r,n){return A(e,r,n)!==A(t,r,n)&&A(e,t,r)!==A(e,t,n)}function Mo(e,t,r){var n=r*r;if(1===t.length)return e.distSqr(t[0])<n;for(var i=1;i<t.length;i++)if(So(e,t[i-1],t[i])<n)return!0;return!1}function So(e,t,r){var n=t.distSqr(r);if(0===n)return e.distSqr(t);var i=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/n;return i<0?e.distSqr(t):i>1?e.distSqr(r):e.distSqr(r.sub(t)._mult(i)._add(t))}function Eo(e,t){for(var r,n,i,a=!1,o=0;o<e.length;o++)for(var s=0,l=(r=e[o]).length-1;s<r.length;l=s++)n=r[s],i=r[l],n.y>t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Co(e,t){for(var r=!1,n=0,i=e.length-1;n<e.length;i=n++){var a=e[n],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&&(r=!r)}return r}function Io(e,t,r){var n=r[0],i=r[2];if(e.x<n.x&&t.x<n.x||e.x>i.x&&t.x>i.x||e.y<n.y&&t.y<n.y||e.y>i.y&&t.y>i.y)return!1;var a=A(e,t,r[0]);return a!==A(e,t,r[1])||a!==A(e,t,r[2])||a!==A(e,t,r[3])}function Lo(e,t,r){var n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Po(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function zo(e,t,r,n,i){if(!t[0]&&!t[1])return e;var o=a.convert(t)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l<e.length;l++){var c=e[l];s.push(c.sub(o))}return s}xo.prototype.populate=function(e,t,r){var n=this.layers[0],i=[],a=null;"circle"===n.type&&(a=n.layout.get("circle-sort-key"));for(var o=0,s=e;o<s.length;o+=1){var l=s[o],c=l.feature,u=l.id,h=l.index,f=l.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,d=yo(c,p);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),d,r)){var m=a?a.evaluate(d,{},r):void 0,g={id:u,properties:c.properties,type:c.type,sourceLayerIndex:f,index:h,geometry:p?d.geometry:go(c),patterns:{},sortKey:m};i.push(g)}}a&&i.sort((function(e,t){return e.sortKey-t.sortKey}));for(var y=0,v=i;y<v.length;y+=1){var x=v[y],_=x,b=_.geometry,w=_.index,T=_.sourceLayerIndex,k=e[w].feature;this.addFeature(x,b,w,r),t.featureIndex.insert(k,b,w,T,this.index)}},xo.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},xo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},xo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},xo.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,za),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},xo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},xo.prototype.addFeature=function(e,t,r,n){for(var i=0,a=t;i<a.length;i+=1)for(var o=0,s=a[i];o<s.length;o+=1){var l=s[o],c=l.x,u=l.y;if(!(c<0||c>=fo||u<0||u>=fo)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),f=h.vertexLength;vo(this.layoutVertexArray,c,u,-1,-1),vo(this.layoutVertexArray,c,u,1,-1),vo(this.layoutVertexArray,c,u,1,1),vo(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(f,f+1,f+2),this.indexArray.emplaceBack(f,f+3,f+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n)},ii("CircleBucket",xo,{omit:["layers"]});var Do=new Zi({"circle-sort-key":new qi(Oe.layout_circle["circle-sort-key"])}),Oo={paint:new Zi({"circle-radius":new qi(Oe.paint_circle["circle-radius"]),"circle-color":new qi(Oe.paint_circle["circle-color"]),"circle-blur":new qi(Oe.paint_circle["circle-blur"]),"circle-opacity":new qi(Oe.paint_circle["circle-opacity"]),"circle-translate":new Vi(Oe.paint_circle["circle-translate"]),"circle-translate-anchor":new Vi(Oe.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Vi(Oe.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Vi(Oe.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new qi(Oe.paint_circle["circle-stroke-width"]),"circle-stroke-color":new qi(Oe.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new qi(Oe.paint_circle["circle-stroke-opacity"])}),layout:Do},Ro=typeof Float32Array<"u"?Float32Array:Array;function Fo(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 Bo(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],f=t[9],p=t[10],d=t[11],m=t[12],g=t[13],y=t[14],v=t[15],x=r[0],_=r[1],b=r[2],w=r[3];return e[0]=x*n+_*s+b*h+w*m,e[1]=x*i+_*l+b*f+w*g,e[2]=x*a+_*c+b*p+w*y,e[3]=x*o+_*u+b*d+w*v,x=r[4],_=r[5],b=r[6],w=r[7],e[4]=x*n+_*s+b*h+w*m,e[5]=x*i+_*l+b*f+w*g,e[6]=x*a+_*c+b*p+w*y,e[7]=x*o+_*u+b*d+w*v,x=r[8],_=r[9],b=r[10],w=r[11],e[8]=x*n+_*s+b*h+w*m,e[9]=x*i+_*l+b*f+w*g,e[10]=x*a+_*c+b*p+w*y,e[11]=x*o+_*u+b*d+w*v,x=r[12],_=r[13],b=r[14],w=r[15],e[12]=x*n+_*s+b*h+w*m,e[13]=x*i+_*l+b*f+w*g,e[14]=x*a+_*c+b*p+w*y,e[15]=x*o+_*u+b*d+w*v,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var jo,No=Bo;function Uo(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}jo=new Ro(3),Ro!=Float32Array&&(jo[0]=0,jo[1]=0,jo[2]=0),function(){var e=new Ro(4);Ro!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var Vo=(function(){var e=new Ro(2);Ro!=Float32Array&&(e[0]=0,e[1]=0)}(),function(e){function t(t){e.call(this,t,Oo)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new xo(e)},t.prototype.queryRadius=function(e){var t=e;return Lo("circle-radius",this,t)+Lo("circle-stroke-width",this,t)+Po(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,a,o,s){for(var l=zo(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(e,t){return e.map((function(e){return qo(e,t)}))}(l,s),f=u?c*o:c,p=0,d=n;p<d.length;p+=1)for(var m=0,g=d[p];m<g.length;m+=1){var y=g[m],v=u?y:qo(y,s),x=f,_=Uo([],[y.x,y.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?x*=_[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(x*=a.cameraToCenterDistance/_[3]),bo(h,v,x))return!0}return!1},t}(Xi));function qo(e,t){var r=Uo([],[e.x,e.y,0,1],t);return new a(r[0]/r[3],r[1]/r[3])}var Ho=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}(xo);function Go(e,t,r,n){var i=t.width,a=t.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*a*r);return e.width=i,e.height=a,e.data=n,e}function Wo(e,t,r){var n=t.width,i=t.height;if(n!==e.width||i!==e.height){var a=Go({},{width:n,height:i},r);Zo(e,a,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,i)},r),e.width=n,e.height=i,e.data=a.data}}function Zo(e,t,r,n,i,a){if(0===i.width||0===i.height)return t;if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=e.data,s=t.data,l=0;l<i.height;l++)for(var c=((r.y+l)*e.width+r.x)*a,u=((n.y+l)*t.width+n.x)*a,h=0;h<i.width*a;h++)s[u+h]=o[c+h];return t}ii("HeatmapBucket",Ho,{omit:["layers"]});var Yo=function(e,t){Go(this,e,1,t)};Yo.prototype.resize=function(e){Wo(this,e,1)},Yo.prototype.clone=function(){return new Yo({width:this.width,height:this.height},new Uint8Array(this.data))},Yo.copy=function(e,t,r,n,i){Zo(e,t,r,n,i,1)};var Xo=function(e,t){Go(this,e,4,t)};Xo.prototype.resize=function(e){Wo(this,e,4)},Xo.prototype.replace=function(e,t){t?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e},Xo.prototype.clone=function(){return new Xo({width:this.width,height:this.height},new Uint8Array(this.data))},Xo.copy=function(e,t,r,n,i){Zo(e,t,r,n,i,4)},ii("AlphaImage",Yo),ii("RGBAImage",Xo);var $o={paint:new Zi({"heatmap-radius":new qi(Oe.paint_heatmap["heatmap-radius"]),"heatmap-weight":new qi(Oe.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Vi(Oe.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Wi(Oe.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Vi(Oe.paint_heatmap["heatmap-opacity"])})};function Ko(e){var t={},r=e.resolution||256,n=e.clips?e.clips.length:1,i=e.image||new Xo({width:r,height:n}),a=function(r,n,a){t[e.evaluationKey]=a;var o=e.expression.evaluate(t);i.data[r+n+0]=Math.floor(255*o.r/o.a),i.data[r+n+1]=Math.floor(255*o.g/o.a),i.data[r+n+2]=Math.floor(255*o.b/o.a),i.data[r+n+3]=Math.floor(255*o.a)};if(e.clips)for(var o=0,s=0;o<n;++o,s+=4*r)for(var l=0,c=0;l<r;l++,c+=4){var u=l/(r-1),h=e.clips[o];a(s,c,h.start*(1-u)+h.end*u)}else for(var f=0,p=0;f<r;f++,p+=4)a(0,p,f/(r-1));return i}var Jo=function(e){function t(t){e.call(this,t,$o),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 Ho(e)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){"heatmap-color"===e&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){var e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Ko({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},t.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},t}(Xi),Qo={paint:new Zi({"hillshade-illumination-direction":new Vi(Oe.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Vi(Oe.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Vi(Oe.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Vi(Oe.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Vi(Oe.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Vi(Oe.paint_hillshade["hillshade-accent-color"])})},es=function(e){function t(t){e.call(this,t,Qo)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},t}(Xi),ts=Qi([{name:"a_pos",components:2,type:"Int16"}],4).members,rs=is,ns=is;function is(e,t,r){r=r||2;var n,i,a,o,s,l,c,u=t&&t.length,h=u?t[0]*r:e.length,f=as(e,0,h,r,!0),p=[];if(!f||f.next===f.prev)return p;if(u&&(f=function(e,t,r,n){var i,a,o,s=[];for(i=0,a=t.length;i<a;i++)(o=as(e,t[i]*n,i<a-1?t[i+1]*n:e.length,n,!1))===o.next&&(o.steiner=!0),s.push(gs(o));for(s.sort(fs),i=0;i<s.length;i++)ps(s[i],r),r=os(r,r.next);return r}(e,t,f,r)),e.length>80*r){n=a=e[0],i=o=e[1];for(var d=r;d<h;d+=r)(s=e[d])<n&&(n=s),(l=e[d+1])<i&&(i=l),s>a&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-n,o-i))?1/c:0}return ss(f,p,r,n,i,c),p}function as(e,t,r,n,i){var a,o;if(i===Cs(e,t,r,n)>0)for(a=t;a<r;a+=n)o=Ms(a,e[a],e[a+1],o);else for(a=r-n;a>=t;a-=n)o=Ms(a,e[a],e[a+1],o);return o&&_s(o,o.next)&&(Ss(o),o=o.next),o}function os(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!_s(n,n.next)&&0!==xs(n.prev,n,n.next))n=n.next;else{if(Ss(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function ss(e,t,r,n,i,a,o){if(e){!o&&a&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=ms(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,l,c=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t<c&&(s++,n=n.nextZ);t++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(e,n,i,a);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?cs(e,n,i,a):ls(e))t.push(s.i/r),t.push(e.i/r),t.push(l.i/r),Ss(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?ss(e=us(os(e),t,r),t,r,n,i,a,2):2===o&&hs(e,t,r,n,i,a):ss(os(e),t,r,n,i,a,1);break}}}function ls(e){var t=e.prev,r=e,n=e.next;if(xs(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(ys(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&xs(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function cs(e,t,r,n){var i=e.prev,a=e,o=e.next;if(xs(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,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=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,h=ms(s,l,t,r,n),f=ms(c,u,t,r,n),p=e.prevZ,d=e.nextZ;p&&p.z>=h&&d&&d.z<=f;){if(p!==e.prev&&p!==e.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xs(p.prev,p,p.next)>=0||(p=p.prevZ,d!==e.prev&&d!==e.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&xs(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xs(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==e.prev&&d!==e.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&xs(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function us(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!_s(i,a)&&bs(i,n,n.next,a)&&ks(i,a)&&ks(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),Ss(n),Ss(n.next),n=e=a),n=n.next}while(n!==e);return os(n)}function hs(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&vs(o,s)){var l=As(o,s);return o=os(o,o.next),l=os(l,l.next),ss(o,t,r,n,i,a),void ss(l,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function fs(e,t){return e.x-t.x}function ps(e,t){if(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===o)return r;var l,c=r,u=r.x,h=r.y,f=1/0;n=r;do{i>=n.x&&n.x>=u&&i!==n.x&&ys(a<h?i:o,a,u,h,a<h?o:i,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(i-n.x),ks(n,e)&&(l<f||l===f&&(n.x>r.x||n.x===r.x&&ds(r,n)))&&(r=n,f=l)),n=n.next}while(n!==c);return r}(e,t),t){var r=As(t,e);os(t,t.next),os(r,r.next)}}function ds(e,t){return xs(e.prev,e,t.prev)<0&&xs(t.next,e,e.next)<0}function ms(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function gs(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function ys(e,t,r,n,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function vs(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&bs(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(ks(e,t)&&ks(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(xs(e.prev,e,t.prev)||xs(e,t.prev,t))||_s(e,t)&&xs(e.prev,e,e.next)>0&&xs(t.prev,t,t.next)>0)}function xs(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function _s(e,t){return e.x===t.x&&e.y===t.y}function bs(e,t,r,n){var i=Ts(xs(e,t,r)),a=Ts(xs(e,t,n)),o=Ts(xs(r,n,e)),s=Ts(xs(r,n,t));return!!(i!==a&&o!==s||0===i&&ws(e,r,t)||0===a&&ws(e,n,t)||0===o&&ws(r,e,n)||0===s&&ws(r,t,n))}function ws(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Ts(e){return e>0?1:e<0?-1:0}function ks(e,t){return xs(e.prev,e,e.next)<0?xs(e,t,e.next)>=0&&xs(e,e.prev,t)>=0:xs(e,t,e.prev)<0||xs(e,e.next,t)<0}function As(e,t){var r=new Es(e.i,e.x,e.y),n=new Es(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Ms(e,t,r,n){var i=new Es(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ss(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 Es(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Cs(e,t,r,n){for(var i=0,a=t,o=r-n;a<r;a+=n)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}function Is(e,t,r,n,i){Ls(e,t,r||0,n||e.length-1,i||zs)}function Ls(e,t,r,n,i){for(;n>r;){if(n-r>600){var a=n-r+1,o=t-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Ls(e,t,Math.max(r,Math.floor(t-o*l/a+c)),Math.min(n,Math.floor(t+(a-o)*l/a+c)),i)}var u=e[t],h=r,f=n;for(Ps(e,r,t),i(e[n],u)>0&&Ps(e,r,n);h<f;){for(Ps(e,h,f),h++,f--;i(e[h],u)<0;)h++;for(;i(e[f],u)>0;)f--}0===i(e[r],u)?Ps(e,r,f):Ps(e,++f,n),f<=t&&(r=f+1),t<=f&&(n=f-1)}}function Ps(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function zs(e,t){return e<t?-1:e>t?1:0}function Ds(e,t){var r=e.length;if(r<=1)return[e];for(var n,i,a=[],o=0;o<r;o++){var s=M(e[o]);0!==s&&(e[o].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&a.push(n),n=[e[o]]):n.push(e[o]))}if(n&&a.push(n),t>1)for(var l=0;l<a.length;l++)a[l].length<=t||(Is(a[l],t,1,a[l].length-1,Os),a[l]=a[l].slice(0,t));return a}function Os(e,t){return t.area-e.area}function Rs(e,t,r){for(var n=r.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 l=s.constantOr(null);l&&(i=!0,n[l.to]=!0,n[l.from]=!0)}return i}function Fs(e,t,r,n,i){for(var a=i.patternDependencies,o=0,s=t;o<s.length;o+=1){var l=s[o],c=l.paint.get(e+"-pattern").value;if("constant"!==c.kind){var u=c.evaluate({zoom:n-1},r,{},i.availableImages),h=c.evaluate({zoom:n},r,{},i.availableImages),f=c.evaluate({zoom:n+1},r,{},i.availableImages);u=u&&u.name?u.name:u,h=h&&h.name?h.name:h,f=f&&f.name?f.name:f,a[u]=!0,a[h]=!0,a[f]=!0,r.patterns[l.id]={min:u,mid:h,max:f}}}return r}is.deviation=function(e,t,r,n){var i=t&&t.length,a=i?t[0]*r:e.length,o=Math.abs(Cs(e,0,a,r));if(i)for(var s=0,l=t.length;s<l;s++){var c=t[s]*r,u=s<l-1?t[s+1]*r:e.length;o-=Math.abs(Cs(e,c,u,r))}var h=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,p=n[s+1]*r,d=n[s+2]*r;h+=Math.abs((e[f]-e[d])*(e[p+1]-e[f+1])-(e[f]-e[p])*(e[d+1]-e[f+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},is.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)r.vertices.push(e[i][a][o]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r},rs.default=ns;var Bs=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 ta,this.indexArray=new da,this.indexArray2=new _a,this.programConfigurations=new co(e.layers,e.zoom),this.segments=new Da,this.segments2=new Da,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};Bs.prototype.populate=function(e,t,r){this.hasPattern=Rs("fill",this.layers,t);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=e;a<o.length;a+=1){var s=o[a],l=s.feature,c=s.id,u=s.index,h=s.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,p=yo(l,f);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),p,r)){var d=n?n.evaluate(p,{},r,t.availableImages):void 0,m={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:f?p.geometry:go(l),patterns:{},sortKey:d};i.push(m)}}n&&i.sort((function(e,t){return e.sortKey-t.sortKey}));for(var g=0,y=i;g<y.length;g+=1){var v=y[g],x=v,_=x.geometry,b=x.index,w=x.sourceLayerIndex;if(this.hasPattern){var T=Fs("fill",this.layers,v,this.zoom,t);this.patternFeatures.push(T)}else this.addFeature(v,_,b,r,{});var k=e[b].feature;t.featureIndex.insert(k,_,b,w,this.index)}},Bs.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Bs.prototype.addFeatures=function(e,t,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,t,r)}},Bs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Bs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Bs.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ts),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0},Bs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Bs.prototype.addFeature=function(e,t,r,n,i){for(var a=0,o=Ds(t,500);a<o.length;a+=1){for(var s=o[a],l=0,c=0,u=s;c<u.length;c+=1)l+=u[c].length;for(var h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),f=h.vertexLength,p=[],d=[],m=0,g=s;m<g.length;m+=1){var y=g[m];if(0!==y.length){y!==s[0]&&d.push(p.length/2);var v=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),x=v.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(x+y.length-1,x),p.push(y[0].x),p.push(y[0].y);for(var _=1;_<y.length;_++)this.layoutVertexArray.emplaceBack(y[_].x,y[_].y),this.indexArray2.emplaceBack(x+_-1,x+_),p.push(y[_].x),p.push(y[_].y);v.vertexLength+=y.length,v.primitiveLength+=y.length}}for(var b=rs(p,d),w=0;w<b.length;w+=3)this.indexArray.emplaceBack(f+b[w],f+b[w+1],f+b[w+2]);h.vertexLength+=l,h.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)},ii("FillBucket",Bs,{omit:["layers","patternFeatures"]});var js=new Zi({"fill-sort-key":new qi(Oe.layout_fill["fill-sort-key"])}),Ns={paint:new Zi({"fill-antialias":new Vi(Oe.paint_fill["fill-antialias"]),"fill-opacity":new qi(Oe.paint_fill["fill-opacity"]),"fill-color":new qi(Oe.paint_fill["fill-color"]),"fill-outline-color":new qi(Oe.paint_fill["fill-outline-color"]),"fill-translate":new Vi(Oe.paint_fill["fill-translate"]),"fill-translate-anchor":new Vi(Oe.paint_fill["fill-translate-anchor"]),"fill-pattern":new Hi(Oe.paint_fill["fill-pattern"])}),layout:js},Us=function(e){function t(t){e.call(this,t,Ns)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,r){e.prototype.recalculate.call(this,t,r);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},t.prototype.createBucket=function(e){return new Bs(e)},t.prototype.queryRadius=function(){return Po(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,a,o){return wo(zo(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)},t.prototype.isTileClipped=function(){return!0},t}(Xi),Vs=Qi([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,qs=Hs;function Hs(e,t,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=i,e.readFields(Gs,this,t)}function Gs(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function Ws(e){for(var t,r,n=0,i=0,a=e.length,o=a-1;i<a;o=i++)t=e[i],n+=((r=e[o]).x-t.x)*(t.y+r.y);return n}Hs.types=["Unknown","Point","LineString","Polygon"],Hs.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,l=[];e.pos<r;){if(i<=0){var c=e.readVarint();n=7&c,i=c>>3}if(i--,1===n||2===n)o+=e.readSVarint(),s+=e.readSVarint(),1===n&&(t&&l.push(t),t=[]),t.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&l.push(t),l},Hs.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;e.pos<t;){if(n<=0){var u=e.readVarint();r=7&u,n=u>>3}if(n--,1===r||2===r)(i+=e.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=e.readSVarint())<l&&(l=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},Hs.prototype.toGeoJSON=function(e,t,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=Hs.types[this.type];function u(e){for(var t=0;t<e.length;t++){var r=e[t],n=180-360*(r.y+s)/a;e[t]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,i=[],a=0;a<t;a++){var o=Ws(e[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[e[a]]):r.push(e[a]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)u(l[n][i])}1===l.length?l=l[0]:c="Multi"+c;var f={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(f.id=this.id),f};var Zs=Ys;function Ys(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(Xs,this,t),this.length=this._features.length}function Xs(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}Ys.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new qs(this._pbf,t,this.extent,this._keys,this._values)};function $s(e,t,r){if(3===e){var n=new Zs(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}var Ks={VectorTile:function(e,t){this.layers=e.readFields($s,{},t)},VectorTileFeature:qs,VectorTileLayer:Zs},Js=Ks.VectorTileFeature.types,Qs=Math.pow(2,13);function el(e,t,r,n,i,a,o,s){e.emplaceBack(t,r,2*Math.floor(n*Qs)+o,i*Qs*2,a*Qs*2,Math.round(s))}var tl=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 na,this.indexArray=new da,this.programConfigurations=new co(e.layers,e.zoom),this.segments=new Da,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function rl(e,t){return e.x===t.x&&(e.x<0||e.x>fo)||e.y===t.y&&(e.y<0||e.y>fo)}function nl(e){return e.every((function(e){return e.x<0}))||e.every((function(e){return e.x>fo}))||e.every((function(e){return e.y<0}))||e.every((function(e){return e.y>fo}))}tl.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=Rs("fill-extrusion",this.layers,t);for(var n=0,i=e;n<i.length;n+=1){var a=i[n],o=a.feature,s=a.id,l=a.index,c=a.sourceLayerIndex,u=this.layers[0]._featureFilter.needGeometry,h=yo(o,u);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),h,r)){var f={id:s,sourceLayerIndex:c,index:l,geometry:u?h.geometry:go(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push(Fs("fill-extrusion",this.layers,f,this.zoom,t)):this.addFeature(f,f.geometry,l,r,{}),t.featureIndex.insert(o,f.geometry,l,c,this.index,!0)}}},tl.prototype.addFeatures=function(e,t,r){for(var n=0,i=this.features;n<i.length;n+=1){var a=i[n],o=a.geometry;this.addFeature(a,o,a.index,t,r)}},tl.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},tl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},tl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},tl.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Vs),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},tl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},tl.prototype.addFeature=function(e,t,r,n,i){for(var a=0,o=Ds(t,500);a<o.length;a+=1){for(var s=o[a],l=0,c=0,u=s;c<u.length;c+=1)l+=u[c].length;for(var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),f=0,p=s;f<p.length;f+=1){var d=p[f];if(0!==d.length&&!nl(d))for(var m=0,g=0;g<d.length;g++){var y=d[g];if(g>=1){var v=d[g-1];if(!rl(y,v)){h.vertexLength+4>Da.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=y.sub(v)._perp()._unit(),_=v.dist(y);m+_>32768&&(m=0),el(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,m),el(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,m),m+=_,el(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,m),el(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,m);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>Da.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Js[e.type]){for(var w=[],T=[],k=h.vertexLength,A=0,M=s;A<M.length;A+=1){var S=M[A];if(0!==S.length){S!==s[0]&&T.push(w.length/2);for(var E=0;E<S.length;E++){var C=S[E];el(this.layoutVertexArray,C.x,C.y,0,0,1,1,0),w.push(C.x),w.push(C.y)}}}for(var I=rs(w,T),L=0;L<I.length;L+=3)this.indexArray.emplaceBack(k+I[L],k+I[L+2],k+I[L+1]);h.primitiveLength+=I.length/3,h.vertexLength+=l}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)},ii("FillExtrusionBucket",tl,{omit:["layers","features"]});var il={paint:new Zi({"fill-extrusion-opacity":new Vi(Oe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new qi(Oe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Vi(Oe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Vi(Oe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Hi(Oe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new qi(Oe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new qi(Oe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Vi(Oe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},al=function(e){function t(t){e.call(this,t,il)}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.queryRadius=function(){return Po(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,o,s,l){var c=zo(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,r),h=this.paint.get("fill-extrusion-base").evaluate(t,r),f=function(e,t){for(var r=[],n=0,i=e;n<i.length;n+=1){var o=i[n],s=[o.x,o.y,0,1];Uo(s,s,t),r.push(new a(s[0]/s[3],s[1]/s[3]))}return r}(c,l),p=function(e,t,r,n){for(var i=[],o=[],s=n[8]*t,l=n[9]*t,c=n[10]*t,u=n[11]*t,h=n[8]*r,f=n[9]*r,p=n[10]*r,d=n[11]*r,m=0,g=e;m<g.length;m+=1){for(var y=[],v=[],x=0,_=g[m];x<_.length;x+=1){var b=_[x],w=b.x,T=b.y,k=n[0]*w+n[4]*T+n[12],A=n[1]*w+n[5]*T+n[13],M=n[2]*w+n[6]*T+n[14],S=n[3]*w+n[7]*T+n[15],E=M+c,C=S+u,I=k+h,L=A+f,P=M+p,z=S+d,D=new a((k+s)/C,(A+l)/C);D.z=E/C,y.push(D);var O=new a(I/z,L/z);O.z=P/z,v.push(O)}i.push(y),o.push(v)}return[i,o]}(n,h,u,l);return function(e,t,r){var n=1/0;wo(r,t)&&(n=sl(r,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 l=a[s],c=a[s+1],u=o[s],h=[l,c,o[s+1],u,l];_o(r,h)&&(n=Math.min(n,sl(r,h)))}return n!==1/0&&n}(p[0],p[1],f)},t}(Xi);function ol(e,t){return e.x*t.x+e.y*t.y}function sl(e,t){if(1===e.length){for(var r,n=0,i=t[n++];!r||i.equals(r);)if(!(r=t[n++]))return 1/0;for(;n<t.length;n++){var a=t[n],o=e[0],s=r.sub(i),l=a.sub(i),c=o.sub(i),u=ol(s,s),h=ol(s,l),f=ol(l,l),p=ol(c,s),d=ol(c,l),m=u*f-h*h,g=(f*p-h*d)/m,y=(u*d-h*p)/m,v=1-g-y,x=i.z*v+r.z*g+a.z*y;if(isFinite(x))return x}return 1/0}for(var _=1/0,b=0,w=t;b<w.length;b+=1){var T=w[b];_=Math.min(_,T.z)}return _}var ll=Qi([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,cl=Qi([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,ul=Ks.VectorTileFeature.types,hl=Math.cos(Math.PI/180*37.5),fl=Math.pow(2,14)/.5,pl=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 ia,this.layoutVertexArray2=new aa,this.indexArray=new da,this.programConfigurations=new co(e.layers,e.zoom),this.segments=new Da,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};pl.prototype.populate=function(e,t,r){this.hasPattern=Rs("line",this.layers,t);for(var n=this.layers[0].layout.get("line-sort-key"),i=[],a=0,o=e;a<o.length;a+=1){var s=o[a],l=s.feature,c=s.id,u=s.index,h=s.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,p=yo(l,f);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),p,r)){var d=n?n.evaluate(p,{},r):void 0,m={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:f?p.geometry:go(l),patterns:{},sortKey:d};i.push(m)}}n&&i.sort((function(e,t){return e.sortKey-t.sortKey}));for(var g=0,y=i;g<y.length;g+=1){var v=y[g],x=v,_=x.geometry,b=x.index,w=x.sourceLayerIndex;if(this.hasPattern){var T=Fs("line",this.layers,v,this.zoom,t);this.patternFeatures.push(T)}else this.addFeature(v,_,b,r,{});var k=e[b].feature;t.featureIndex.insert(k,_,b,w,this.index)}},pl.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},pl.prototype.addFeatures=function(e,t,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,t,r)}},pl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},pl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},pl.prototype.upload=function(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,cl)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ll),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},pl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},pl.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}},pl.prototype.addFeature=function(e,t,r,n,i){var a=this.layers[0].layout,o=a.get("line-join").evaluate(e,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(var u=0,h=t;u<h.length;u+=1){var f=h[u];this.addLine(f,e,o,s,l,c)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)},pl.prototype.addLine=function(e,t,r,n,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="Polygon"===ul[t.type],l=e.length;l>=2&&e[l-1].equals(e[l-2]);)l--;for(var c=0;c<l-1&&e[c].equals(e[c+1]);)c++;if(!(l<(s?3:2))){"bevel"===r&&(i=1.05);var u,h=this.overscaling<=16?15*fo/(512*this.overscaling):0,f=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),p=void 0,d=void 0,m=void 0,g=void 0;this.e1=this.e2=-1,s&&(u=e[l-2],g=e[c].sub(u)._unit()._perp());for(var y=c;y<l;y++)if(!(d=y===l-1?s?e[c+1]:void 0:e[y+1])||!e[y].equals(d)){g&&(m=g),u&&(p=u),u=e[y],g=d?d.sub(u)._unit()._perp():m;var v=(m=m||g).add(g);(0!==v.x||0!==v.y)&&v._unit();var x=m.x*g.x+m.y*g.y,_=v.x*g.x+v.y*g.y,b=0!==_?1/_:1/0,w=2*Math.sqrt(2-2*_),T=_<hl&&p&&d,k=m.x*g.y-m.y*g.x>0;if(T&&y>c){var A=u.dist(p);if(A>2*h){var M=u.sub(u.sub(p)._mult(h/A)._round());this.updateDistance(p,M),this.addCurrentVertex(M,m,0,0,f),p=M}}var S=p&&d,E=S?r:s?"butt":n;if(S&&"round"===E&&(b<a?E="miter":b<=2&&(E="fakeround")),"miter"===E&&b>i&&(E="bevel"),"bevel"===E&&(b>2&&(E="flipbevel"),b<i&&(E="miter")),p&&this.updateDistance(p,u),"miter"===E)v._mult(b),this.addCurrentVertex(u,v,0,0,f);else if("flipbevel"===E){if(b>100)v=g.mult(-1);else{var C=b*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(C*(k?-1:1))}this.addCurrentVertex(u,v,0,0,f),this.addCurrentVertex(u,v.mult(-1),0,0,f)}else if("bevel"===E||"fakeround"===E){var I=-Math.sqrt(b*b-1),L=k?I:0,P=k?0:I;if(p&&this.addCurrentVertex(u,m,L,P,f),"fakeround"===E)for(var z=Math.round(180*w/Math.PI/20),D=1;D<z;D++){var O=D/z;if(.5!==O){var R=O-.5;O+=O*R*(O-1)*((1.0904+x*(x*(3.55645-1.43519*x)-3.2452))*R*R+(.848013+x*(.215638*x-1.06021)))}var F=g.sub(m)._mult(O)._add(m)._unit()._mult(k?-1:1);this.addHalfVertex(u,F.x,F.y,!1,k,0,f)}d&&this.addCurrentVertex(u,g,-L,-P,f)}else if("butt"===E)this.addCurrentVertex(u,v,0,0,f);else if("square"===E){var B=p?1:-1;this.addCurrentVertex(u,v,B,B,f)}else"round"===E&&(p&&(this.addCurrentVertex(u,m,0,0,f),this.addCurrentVertex(u,m,1,1,f,!0)),d&&(this.addCurrentVertex(u,g,-1,-1,f,!0),this.addCurrentVertex(u,g,0,0,f)));if(T&&y<l-1){var j=u.dist(d);if(j>2*h){var N=u.add(d.sub(u)._mult(h/j)._round());this.updateDistance(u,N),this.addCurrentVertex(N,g,0,0,f),u=N}}}}},pl.prototype.addCurrentVertex=function(e,t,r,n,i,a){void 0===a&&(a=!1);var o=t.x+t.y*r,s=t.y-t.x*r,l=-t.x+t.y*n,c=-t.y-t.x*n;this.addHalfVertex(e,o,s,a,!1,r,i),this.addHalfVertex(e,l,c,a,!0,-n,i),this.distance>fl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,r,n,i,a))},pl.prototype.addHalfVertex=function(e,t,r,n,i,a,o){var s=e.x,l=e.y,c=.5*(this.lineClips?this.scaledDistance*(fl-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6),this.lineClips){var u=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(u,this.lineClipsArray.length)}var h=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,h),o.primitiveLength++),i?this.e2=h:this.e1=h},pl.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},pl.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},ii("LineBucket",pl,{omit:["layers","patternFeatures"]});var dl=new Zi({"line-cap":new Vi(Oe.layout_line["line-cap"]),"line-join":new qi(Oe.layout_line["line-join"]),"line-miter-limit":new Vi(Oe.layout_line["line-miter-limit"]),"line-round-limit":new Vi(Oe.layout_line["line-round-limit"]),"line-sort-key":new qi(Oe.layout_line["line-sort-key"])}),ml={paint:new Zi({"line-opacity":new qi(Oe.paint_line["line-opacity"]),"line-color":new qi(Oe.paint_line["line-color"]),"line-translate":new Vi(Oe.paint_line["line-translate"]),"line-translate-anchor":new Vi(Oe.paint_line["line-translate-anchor"]),"line-width":new qi(Oe.paint_line["line-width"]),"line-gap-width":new qi(Oe.paint_line["line-gap-width"]),"line-offset":new qi(Oe.paint_line["line-offset"]),"line-blur":new qi(Oe.paint_line["line-blur"]),"line-dasharray":new Gi(Oe.paint_line["line-dasharray"]),"line-pattern":new Hi(Oe.paint_line["line-pattern"]),"line-gradient":new Wi(Oe.paint_line["line-gradient"])}),layout:dl},gl=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,r){return r=new zi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),e.prototype.possiblyEvaluate.call(this,t,r)},t.prototype.evaluate=function(t,r,n,i){return r=p({},r,{zoom:Math.floor(r.zoom)}),e.prototype.evaluate.call(this,t,r,n,i)},t}(qi),yl=new gl(ml.paint.properties["line-width"].specification);yl.useIntegerZoom=!0;var vl=function(e){function t(t){e.call(this,t,ml),this.gradientVersion=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){if("line-gradient"===e){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=t._styleExpression.expression instanceof Qt,this.gradientVersion=(this.gradientVersion+1)%l}},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(t,r){e.prototype.recalculate.call(this,t,r),this.paint._values["line-floorwidth"]=yl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new pl(e)},t.prototype.queryRadius=function(e){var t=e,r=xl(Lo("line-width",this,t),Lo("line-gap-width",this,t)),n=Lo("line-offset",this,t);return r/2+Math.abs(n)+Po(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,o,s){var l=zo(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*xl(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),u=this.paint.get("line-offset").evaluate(t,r);return u&&(n=function(e,t){for(var r=[],n=new a(0,0),i=0;i<e.length;i++){for(var o=e[i],s=[],l=0;l<o.length;l++){var c=o[l-1],u=o[l],h=o[l+1],f=0===l?n:u.sub(c)._unit()._perp(),p=l===o.length-1?n:h.sub(u)._unit()._perp(),d=f._add(p)._unit(),m=d.x*p.x+d.y*p.y;d._mult(1/m),s.push(d._mult(t)._add(u))}r.push(s)}return r}(n,u*s)),function(e,t,r){for(var n=0;n<t.length;n++){var i=t[n];if(e.length>=3)for(var a=0;a<i.length;a++)if(Co(e,i[a]))return!0;if(To(e,i,r))return!0}return!1}(l,n,c)},t.prototype.isTileClipped=function(){return!0},t}(Xi);function xl(e,t){return t>0?t+2*e:e}var _l=Qi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),bl=Qi([{name:"a_projected_pos",components:3,type:"Float32"}],4),wl=(Qi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Qi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Tl=(Qi([{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"}]),Qi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),kl=Qi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Al(e,t,r){return e.sections.forEach((function(e){e.text=function(e,t,r){var n=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),Pi.applyArabicShaping&&(e=Pi.applyArabicShaping(e)),e}(e.text,t,r)})),e}Qi([{name:"triangle",components:3,type:"Uint16"}]),Qi([{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"}]),Qi([{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"}]),Qi([{type:"Float32",name:"offsetX"}]),Qi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ml={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Sl=24,El=function(e,t,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+e[t+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},Cl=function(e,t,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=t<0||0===t&&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*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+p]=255&o,p+=d,o/=256,c-=8);e[r+p-d]|=128*m},Il=Ll;function Ll(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Ll.Varint=0,Ll.Fixed64=1,Ll.Bytes=2,Ll.Fixed32=5;var Pl=4294967296,zl=1/Pl,Dl=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Ol(e){return e.type===Ll.Bytes?e.readVarint()+e.pos:e.pos+1}function Rl(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function Fl(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function Bl(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function jl(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Nl(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Ul(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Vl(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function ql(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Hl(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Gl(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Wl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function Zl(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Yl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Xl(e,t,r){1===e&&r.readMessage($l,t)}function $l(e,t,r){if(3===e){var n=r.readMessage(Kl,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;t.push({id:i,bitmap:new Yo({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function Kl(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function Jl(e){for(var t=0,r=0,n=0,i=e;n<i.length;n+=1){var a=i[n];t+=a.w*a.h,r=Math.max(r,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)),r),h:1/0}],s=0,l=0,c=0,u=e;c<u.length;c+=1)for(var h=u[c],f=o.length-1;f>=0;f--){var p=o[f];if(!(h.w>p.w||h.h>p.h)){if(h.x=p.x,h.y=p.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===p.w&&h.h===p.h){var d=o.pop();f<o.length&&(o[f]=d)}else h.h===p.h?(p.x+=h.w,p.w-=h.w):h.w===p.w?(p.y+=h.h,p.h-=h.h):(o.push({x:p.x+h.w,y:p.y,w:p.w-h.w,h:h.h}),p.y+=h.h,p.h-=h.h);break}}return{w:s,h:l,fill:t/(s*l)||0}}Ll.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Wl(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Yl(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Wl(this.buf,this.pos)+Wl(this.buf,this.pos+4)*Pl;return this.pos+=8,e},readSFixed64:function(){var e=Wl(this.buf,this.pos)+Yl(this.buf,this.pos+4)*Pl;return this.pos+=8,e},readFloat:function(){var e=El(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=El(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128||(t|=(127&(r=n[this.pos++]))<<7,r<128)||(t|=(127&(r=n[this.pos++]))<<14,r<128)||(t|=(127&(r=n[this.pos++]))<<21,r<128)?t:function(e,t,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128||(n|=(127&(i=a[r.pos++]))<<3,i<128)||(n|=(127&(i=a[r.pos++]))<<10,i<128)||(n|=(127&(i=a[r.pos++]))<<17,i<128)||(n|=(127&(i=a[r.pos++]))<<24,i<128)||(n|=(1&(i=a[r.pos++]))<<31,i<128))return function(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[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&&Dl?function(e,t,r){return Dl.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){for(var n="",i=t;i<r;){var a,o,s,l=e[i],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=e[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(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!==Ll.Bytes)return e.push(this.readVarint(t));var r=Ol(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==Ll.Bytes)return e.push(this.readSVarint());var t=Ol(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Ll.Bytes)return e.push(this.readBoolean());var t=Ol(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Ll.Bytes)return e.push(this.readFloat());var t=Ol(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Ll.Bytes)return e.push(this.readDouble());var t=Ol(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Ll.Bytes)return e.push(this.readFixed32());var t=Ol(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Ll.Bytes)return e.push(this.readSFixed32());var t=Ol(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Ll.Bytes)return e.push(this.readFixed64());var t=Ol(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Ll.Bytes)return e.push(this.readSFixed64());var t=Ol(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===Ll.Varint)for(;this.buf[this.pos++]>127;);else if(t===Ll.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Ll.Fixed32)this.pos+=4;else{if(t!==Ll.Fixed64)throw new 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 r=new Uint8Array(t);r.set(this.buf),this.buf=r,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),Zl(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Zl(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Zl(this.buf,-1&e,this.pos),Zl(this.buf,Math.floor(e*zl),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Zl(this.buf,-1&e,this.pos),Zl(this.buf,Math.floor(e*zl),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}(r,0,t),function(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((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)))))}(n,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,r){for(var n,i,a=0;a<t.length;a++){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Rl(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Cl(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Cl(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 r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&Rl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,Ll.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Fl,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Bl,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Ul,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,jl,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Nl,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Vl,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,ql,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Hl,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Gl,t)},writeBytesField:function(e,t){this.writeTag(e,Ll.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Ll.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Ll.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Ll.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Ll.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Ll.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Ll.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Ll.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Ll.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Ll.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var Ql=function(e,t){var r=t.pixelRatio,n=t.version,i=t.stretchX,a=t.stretchY,o=t.content;this.paddedRect=e,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n},ec={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};ec.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},ec.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},ec.tlbr.get=function(){return this.tl.concat(this.br)},ec.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Ql.prototype,ec);var tc=function(e,t){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(e,r,i),this.addImages(t,n,i);var a=Jl(i),o=a.w,s=a.h,l=new Xo({width:o||1,height:s||1});for(var c in e){var u=e[c],h=r[c].paddedRect;Xo.copy(u.data,l,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data)}for(var f in t){var p=t[f],d=n[f].paddedRect,m=d.x+1,g=d.y+1,y=p.data.width,v=p.data.height;Xo.copy(p.data,l,{x:0,y:0},{x:m,y:g},p.data),Xo.copy(p.data,l,{x:0,y:v-1},{x:m,y:g-1},{width:y,height:1}),Xo.copy(p.data,l,{x:0,y:0},{x:m,y:g+v},{width:y,height:1}),Xo.copy(p.data,l,{x:y-1,y:0},{x:m-1,y:g},{width:1,height:v}),Xo.copy(p.data,l,{x:0,y:0},{x:m+y,y:g},{width:1,height:v})}this.image=l,this.iconPositions=r,this.patternPositions=n};tc.prototype.addImages=function(e,t,r){for(var n in e){var i=e[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),t[n]=new Ql(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},tc.prototype.patchUpdatedImages=function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)},tc.prototype.patchUpdatedImage=function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var n=e.tl,i=n[0],a=n[1];r.update(t.data,void 0,{x:i,y:a})}},ii("ImagePosition",Ql),ii("ImageAtlas",tc);var rc={horizontal:1,vertical:2,horizontalOnly:3},nc=-17,ic=function(){this.scale=1,this.fontStack="",this.imageName=null};ic.forText=function(e,t){var r=new ic;return r.scale=e||1,r.fontStack=t,r},ic.forImage=function(e){var t=new ic;return t.imageName=e,t};var ac=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function oc(e,t,r,n,i,a,o,s,l,c,u,h,f,p,d,m){var g=ac.fromFeature(e,i);h===rc.vertical&&g.verticalizePunctuation();var y,v=Pi.processBidirectionalText,x=Pi.processStyledBidirectionalText;if(v&&1===g.sections.length){y=[];for(var _=0,b=v(g.toString(),dc(g,c,a,t,n,p,d));_<b.length;_+=1){var w=b[_],T=new ac;T.text=w,T.sections=g.sections;for(var k=0;k<w.length;k++)T.sectionIndex.push(0);y.push(T)}}else if(x){y=[];for(var A=0,M=x(g.text,g.sectionIndex,dc(g,c,a,t,n,p,d));A<M.length;A+=1){var S=M[A],E=new ac;E.text=S[0],E.sectionIndex=S[1],E.sections=g.sections,y.push(E)}}else y=function(e,t){for(var r=[],n=e.text,i=0,a=0,o=t;a<o.length;a+=1){var s=o[a];r.push(e.substring(i,s)),i=s}return i<n.length&&r.push(e.substring(i,n.length)),r}(g,dc(g,c,a,t,n,p,d));var C=[],I={positionedLines:C,text:g.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(e,t,r,n,i,a,o,s,l,c,u,h){for(var f=0,p=nc,d=0,m=0,g="right"===s?1:"left"===s?0:.5,y=0,v=0,x=i;v<x.length;v+=1){var _=x[v];_.trim();var b=_.getMaxScale(),w=(b-1)*Sl,T={positionedGlyphs:[],lineOffset:0};e.positionedLines[y]=T;var k=T.positionedGlyphs,A=0;if(_.length()){for(var M=0;M<_.length();M++){var S=_.getSection(M),E=_.getSectionIndex(M),C=_.getCharCode(M),I=0,L=null,P=null,z=null,D=Sl,O=!(l===rc.horizontal||!u&&!mi(C)||u&&(sc[C]||yi(C)));if(S.imageName){var R=n[S.imageName];if(!R)continue;z=S.imageName,e.iconsInText=e.iconsInText||!0,P=R.paddedRect;var F=R.displaySize;S.scale=S.scale*Sl/h,L={width:F[0],height:F[1],left:1,top:-3,advance:O?F[1]:F[0]},I=w+(Sl-F[1]*S.scale),D=L.advance;var B=O?F[0]*S.scale-Sl*b:F[1]*S.scale-Sl*b;B>0&&B>A&&(A=B)}else{var j=r[S.fontStack],N=j&&j[C];if(N&&N.rect)P=N.rect,L=N.metrics;else{var U=t[S.fontStack],V=U&&U[C];if(!V)continue;L=V.metrics}I=(b-S.scale)*Sl}O?(e.verticalizable=!0,k.push({glyph:C,imageName:z,x:f,y:p+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:L,rect:P}),f+=D*S.scale+c):(k.push({glyph:C,imageName:z,x:f,y:p+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:L,rect:P}),f+=L.advance*S.scale+c)}if(0!==k.length){var q=f-c;d=Math.max(q,d),gc(k,0,k.length-1,g,A)}f=0;var H=a*b+A;T.lineOffset=Math.max(A,w),p+=H,m=Math.max(H,m),++y}else p+=a,++y}var G=p-nc,W=mc(o),Z=W.horizontalAlign,Y=W.verticalAlign;(function(e,t,r,n,i,a,o,s,l){var c,u=(t-r)*i;c=a!==o?-s*n-nc:(-n*l+.5)*o;for(var h=0,f=e;h<f.length;h+=1)for(var p=0,d=f[h].positionedGlyphs;p<d.length;p+=1){var m=d[p];m.x+=u,m.y+=c}})(e.positionedLines,g,Z,Y,d,m,a,G,i.length),e.top+=-Y*G,e.bottom=e.top+G,e.left+=-Z*d,e.right=e.left+d}(I,t,r,n,y,o,s,l,h,c,f,m),!function(e){for(var t=0,r=e;t<r.length;t+=1)if(0!==r[t].positionedGlyphs.length)return!1;return!0}(C)&&I}ac.fromFeature=function(e,t){for(var r=new ac,n=0;n<e.sections.length;n++){var i=e.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,t)}return r},ac.prototype.length=function(){return this.text.length},ac.prototype.getSection=function(e){return this.sections[this.sectionIndex[e]]},ac.prototype.getSectionIndex=function(e){return this.sectionIndex[e]},ac.prototype.getCharCode=function(e){return this.text.charCodeAt(e)},ac.prototype.verticalizePunctuation=function(){this.text=function(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r+1)||null,i=e.charCodeAt(r-1)||null;n&&gi(n)&&!Ml[e[r+1]]||i&&gi(i)&&!Ml[e[r-1]]||!Ml[e[r]]?t+=e[r]:t+=Ml[e[r]]}return t}(this.text)},ac.prototype.trim=function(){for(var e=0,t=0;t<this.text.length&&sc[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=e&&sc[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},ac.prototype.substring=function(e,t){var r=new ac;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},ac.prototype.toString=function(){return this.text},ac.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},ac.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(ic.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,n=0;n<e.text.length;++n)this.sectionIndex.push(r)},ac.prototype.addImageSection=function(e){var t=e.image?e.image.name:"";if(0!==t.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(ic.forImage(t)),this.sectionIndex.push(this.sections.length-1)):k("Reached maximum number of images 6401")}else k("Can't add FormattedSection with an empty image.")},ac.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var sc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},lc={};function cc(e,t,r,n,i,a){if(t.imageName){var o=n[t.imageName];return o?o.displaySize[0]*t.scale*Sl/a+i:0}var s=r[t.fontStack],l=s&&s[e];return l?l.metrics.advance*t.scale+i:0}function uc(e,t,r,n){var i=Math.pow(e-t,2);return n?e<t?i/2:2*i:i+Math.abs(r)*r}function hc(e,t,r){var n=0;return 10===e&&(n-=1e4),r&&(n+=150),(40===e||65288===e)&&(n+=50),(41===t||65289===t)&&(n+=50),n}function fc(e,t,r,n,i,a){for(var o=null,s=uc(t,r,i,a),l=0,c=n;l<c.length;l+=1){var u=c[l],h=uc(t-u.x,r,i,a)+u.badness;h<=s&&(o=u,s=h)}return{index:e,x:t,priorBreak:o,badness:s}}function pc(e){return e?pc(e.priorBreak).concat(e.index):[]}function dc(e,t,r,n,i,a,o){if("point"!==a)return[];if(!e)return[];for(var s=[],l=function(e,t,r,n,i,a){for(var o=0,s=0;s<e.length();s++){var l=e.getSection(s);o+=cc(e.getCharCode(s),l,n,i,t,a)}return o/Math.max(1,Math.ceil(o/r))}(e,t,r,n,i,o),c=e.text.indexOf("")>=0,u=0,h=0;h<e.length();h++){var f=e.getSection(h),p=e.getCharCode(h);if(sc[p]||(u+=cc(p,f,n,i,t,o)),h<e.length()-1){var d=di(p);(lc[p]||d||f.imageName)&&s.push(fc(h+1,u,l,s,hc(p,e.getCharCode(h+1),d&&c),!1))}}return pc(fc(e.length(),u,l,s,0,!0))}function mc(e){var t=.5,r=.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":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function gc(e,t,r,n,i){if(n||i)for(var a=e[r],o=a.metrics.advance*a.scale,s=(e[r].x+o)*n,l=t;l<=r;l++)e[l].x-=s,e[l].y+=i}function yc(e,t,r,n,i,a){var o,s=e.image;if(s.content){var l=s.content,c=s.pixelRatio||1;o=[l[0]/c,l[1]/c,s.displaySize[0]-l[2]/c,s.displaySize[1]-l[3]/c]}var u,h,f,p,d=t.left*a,m=t.right*a;"width"===r||"both"===r?(p=i[0]+d-n[3],h=i[0]+m+n[1]):h=(p=i[0]+(d+m-s.displaySize[0])/2)+s.displaySize[0];var g=t.top*a,y=t.bottom*a;return"height"===r||"both"===r?(u=i[1]+g-n[0],f=i[1]+y+n[2]):f=(u=i[1]+(g+y-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:u,right:h,bottom:f,left:p,collisionPadding:o}}lc[10]=!0,lc[32]=!0,lc[38]=!0,lc[40]=!0,lc[41]=!0,lc[43]=!0,lc[45]=!0,lc[47]=!0,lc[173]=!0,lc[183]=!0,lc[8203]=!0,lc[8208]=!0,lc[8211]=!0,lc[8231]=!0;var vc=function(e){function t(t,r,n,i){e.call(this,t,r),this.angle=n,void 0!==i&&(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);ii("Anchor",vc);var xc=128;function _c(e,t){var r=t.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new zi(e+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,a=0;a<n.length&&n[a]<=e;)a++;for(var o=a=Math.max(0,a-1);o<n.length&&n[o]<e+1;)o++;o=Math.min(n.length-1,o);var s=n[a],l=n[o];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:l,minSize:r.evaluate(new zi(s)),maxSize:r.evaluate(new zi(l)),interpolationType:i}}function bc(e,t,r){var n=t.uSize,i=t.uSizeT,a=r.lowerSize,o=r.upperSize;return"source"===e.kind?a/xc:"composite"===e.kind?er(a/xc,o/xc,i):n}function wc(e,t){var r=0,n=0;if("constant"===e.kind)n=e.layoutSize;else if("source"!==e.kind){var i=e.interpolationType,a=e.minZoom,o=e.maxZoom,s=i?h(_r.interpolationFactor(i,t,a,o),0,1):0;"camera"===e.kind?n=er(e.minSize,e.maxSize,s):r=s}return{uSizeT:r,uSize:n}}var Tc=Object.freeze({__proto__:null,getSizeData:_c,evaluateSizeForFeature:bc,evaluateSizeForZoom:wc,SIZE_PACK_FACTOR:xc});function kc(e,t,r,n,i){if(void 0===t.segment)return!0;for(var a=t,o=t.segment+1,s=0;s>-r/2;){if(--o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;for(var l=[],c=0;s<r/2;){var u=e[o-1],h=e[o],f=e[o+1];if(!f)return!1;var p=u.angleTo(h)-h.angleTo(f);for(p=Math.abs((p+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:p}),c+=p;s-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=h.dist(f)}return!0}function Ac(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Mc(e,t,r){return e?.6*t*r:0}function Sc(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Ec(e,t,r,n,i,a){for(var o=Mc(r,i,a),s=Sc(r,n)*a,l=0,c=Ac(e)/2,u=0;u<e.length-1;u++){var h=e[u],f=e[u+1],p=h.dist(f);if(l+p>c){var d=(c-l)/p,m=er(h.x,f.x,d),g=er(h.y,f.y,d),y=new vc(m,g,f.angleTo(h),u);return y._round(),!o||kc(e,y,s,o,t)?y:void 0}l+=p}}function Cc(e,t,r,n,i,a,o,s,l){var c=Mc(n,a,o),u=Sc(n,i),h=u*o,f=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),Ic(e,f?t/2*s%t:(u/2+2*a)*o*s%t,t,c,r,h,f,!1,l)}function Ic(e,t,r,n,i,a,o,s,l){for(var c=a/2,u=Ac(e),h=0,f=t-r,p=[],d=0;d<e.length-1;d++){for(var m=e[d],g=e[d+1],y=m.dist(g),v=g.angleTo(m);f+r<h+y;){var x=((f+=r)-h)/y,_=er(m.x,g.x,x),b=er(m.y,g.y,x);if(_>=0&&_<l&&b>=0&&b<l&&f-c>=0&&f+c<=u){var w=new vc(_,b,v,d);w._round(),(!n||kc(e,w,a,n,i))&&p.push(w)}}h+=y}return!s&&!p.length&&!o&&(p=Ic(e,h/2,r,n,i,a,o,!0,l)),p}function Lc(e,t,r,n,i){for(var o=[],s=0;s<e.length;s++)for(var l=e[s],c=void 0,u=0;u<l.length-1;u++){var h=l[u],f=l[u+1];h.x<t&&f.x<t||(h.x<t?h=new a(t,h.y+(f.y-h.y)*((t-h.x)/(f.x-h.x)))._round():f.x<t&&(f=new a(t,h.y+(f.y-h.y)*((t-h.x)/(f.x-h.x)))._round()),!(h.y<r&&f.y<r)&&(h.y<r?h=new a(h.x+(f.x-h.x)*((r-h.y)/(f.y-h.y)),r)._round():f.y<r&&(f=new a(h.x+(f.x-h.x)*((r-h.y)/(f.y-h.y)),r)._round()),!(h.x>=n&&f.x>=n)&&(h.x>=n?h=new a(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round():f.x>=n&&(f=new a(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round()),!(h.y>=i&&f.y>=i)&&(h.y>=i?h=new a(h.x+(f.x-h.x)*((i-h.y)/(f.y-h.y)),i)._round():f.y>=i&&(f=new a(h.x+(f.x-h.x)*((i-h.y)/(f.y-h.y)),i)._round()),(!c||!h.equals(c[c.length-1]))&&(c=[h],o.push(c)),c.push(f)))))}return o}function Pc(e,t,r,n){var i=[],o=e.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u=e.right-e.left,h=e.bottom-e.top,f=o.stretchX||[[0,l]],p=o.stretchY||[[0,c]],d=function(e,t){return e+t[1]-t[0]},m=f.reduce(d,0),g=p.reduce(d,0),y=l-m,v=c-g,x=0,_=m,b=0,w=g,T=0,k=y,A=0,M=v;if(o.content&&n){var S=o.content;x=zc(f,0,S[0]),b=zc(p,0,S[1]),_=zc(f,S[0],S[2]),w=zc(p,S[1],S[3]),T=S[0]-x,A=S[1]-b,k=S[2]-S[0]-_,M=S[3]-S[1]-w}var E=function(n,i,l,c){var f=Oc(n.stretch-x,_,u,e.left),p=Rc(n.fixed-T,k,n.stretch,m),d=Oc(i.stretch-b,w,h,e.top),y=Rc(i.fixed-A,M,i.stretch,g),v=Oc(l.stretch-x,_,u,e.left),S=Rc(l.fixed-T,k,l.stretch,m),E=Oc(c.stretch-b,w,h,e.top),C=Rc(c.fixed-A,M,c.stretch,g),I=new a(f,d),L=new a(v,d),P=new a(v,E),z=new a(f,E),D=new a(p/s,y/s),O=new a(S/s,C/s),R=t*Math.PI/180;if(R){var F=Math.sin(R),B=Math.cos(R),j=[B,-F,F,B];I._matMult(j),L._matMult(j),z._matMult(j),P._matMult(j)}var N=n.stretch+n.fixed,U=l.stretch+l.fixed,V=i.stretch+i.fixed,q=c.stretch+c.fixed;return{tl:I,tr:L,bl:z,br:P,tex:{x:o.paddedRect.x+1+N,y:o.paddedRect.y+1+V,w:U-N,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:O,minFontScaleX:k/s/u,minFontScaleY:M/s/h,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var C=Dc(f,y,m),I=Dc(p,v,g),L=0;L<C.length-1;L++)for(var P=C[L],z=C[L+1],D=0;D<I.length-1;D++){var O=I[D],R=I[D+1];i.push(E(P,O,z,R))}else i.push(E({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return i}function zc(e,t,r){for(var n=0,i=0,a=e;i<a.length;i+=1){var o=a[i];n+=Math.max(t,Math.min(r,o[1]))-Math.max(t,Math.min(r,o[0]))}return n}function Dc(e,t,r){for(var n=[{fixed:-1,stretch:0}],i=0,a=e;i<a.length;i+=1){var o=a[i],s=o[0],l=o[1],c=n[n.length-1];n.push({fixed:s-c.stretch,stretch:c.stretch}),n.push({fixed:s-c.stretch,stretch:c.stretch+(l-s)})}return n.push({fixed:t+1,stretch:r}),n}function Oc(e,t,r,n){return e/t*r+n}function Rc(e,t,r,n){return e-t*r/n}var Fc=function(e,t,r,n,i,o,s,l,c,u){if(this.boxStartIndex=e.length,c){var h=o.top,f=o.bottom,p=o.collisionPadding;p&&(h-=p[1],f+=p[3]);var d=f-h;d>0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=o.top*s-l,g=o.bottom*s+l,y=o.left*s-l,v=o.right*s+l,x=o.collisionPadding;if(x&&(y-=x[0]*s,m-=x[1]*s,v+=x[2]*s,g+=x[3]*s),u){var _=new a(y,m),b=new a(v,m),w=new a(y,g),T=new a(v,g),k=u*Math.PI/180;_._rotate(k),b._rotate(k),w._rotate(k),T._rotate(k),y=Math.min(_.x,b.x,w.x,T.x),v=Math.max(_.x,b.x,w.x,T.x),m=Math.min(_.y,b.y,w.y,T.y),g=Math.max(_.y,b.y,w.y,T.y)}e.emplaceBack(t.x,t.y,y,m,v,g,r,n,i)}this.boxEndIndex=e.length},Bc=function(e,t){if(void 0===e&&(e=[]),void 0===t&&(t=jc),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function jc(e,t){return e<t?-1:e>t?1:0}function Nc(e,t,r){void 0===t&&(t=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=e[0],c=0;c<l.length;c++){var u=l[c];(!c||u.x<n)&&(n=u.x),(!c||u.y<i)&&(i=u.y),(!c||u.x>o)&&(o=u.x),(!c||u.y>s)&&(s=u.y)}var h=o-n,f=s-i,p=Math.min(h,f),d=p/2,m=new Bc([],Uc);if(0===p)return new a(n,i);for(var g=n;g<o;g+=p)for(var y=i;y<s;y+=p)m.push(new Vc(g+d,y+d,d,e));for(var v=function(e){for(var t=0,r=0,n=0,i=e[0],a=0,o=i.length,s=o-1;a<o;s=a++){var l=i[a],c=i[s],u=l.x*c.y-c.x*l.y;r+=(l.x+c.x)*u,n+=(l.y+c.y)*u,t+=3*u}return new Vc(r/t,n/t,0,e)}(e),x=m.length;m.length;){var _=m.pop();(_.d>v.d||!v.d)&&(v=_,r&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,x)),!(_.max-v.d<=t)&&(d=_.h/2,m.push(new Vc(_.p.x-d,_.p.y-d,d,e)),m.push(new Vc(_.p.x+d,_.p.y-d,d,e)),m.push(new Vc(_.p.x-d,_.p.y+d,d,e)),m.push(new Vc(_.p.x+d,_.p.y+d,d,e)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+v.d)),v.p}function Uc(e,t){return t.max-e.max}function Vc(e,t,r,n){this.p=new a(e,t),this.h=r,this.d=function(e,t){for(var r=!1,n=1/0,i=0;i<t.length;i++)for(var a=t[i],o=0,s=a.length,l=s-1;o<s;l=o++){var c=a[o],u=a[l];c.y>e.y!=u.y>e.y&&e.x<(u.x-c.x)*(e.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,So(e,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Bc.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},Bc.prototype.pop=function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},Bc.prototype.peek=function(){return this.data[0]},Bc.prototype._up=function(e){for(var t=this.data,r=this.compare,n=t[e];e>0;){var i=e-1>>1,a=t[i];if(r(n,a)>=0)break;t[e]=a,e=i}t[e]=n},Bc.prototype._down=function(e){for(var t=this.data,r=this.compare,n=this.length>>1,i=t[e];e<n;){var a=1+(e<<1),o=t[a],s=a+1;if(s<this.length&&r(t[s],o)<0&&(a=s,o=t[s]),r(o,i)>=0)break;t[e]=o,e=a}t[e]=i};var qc=Number.POSITIVE_INFINITY;function Hc(e,t){return t[1]!==qc?function(e,t,r){var n=0,i=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}return[n,i]}(e,t[0],t[1]):function(e,t){var r=0,n=0;t<0&&(t=0);var i=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-t;break;case"top":n=t-7}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}return[r,n]}(e,t[0])}function Gc(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"}var Wc=255,Zc=32640;function Yc(e,t,r,n,i,o,s,l,c,u,h,f,p,d,m){var g=function(e,t,r,n,i,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],h=0,f=t.positionedLines;h<f.length;h+=1)for(var p=f[h],d=0,m=p.positionedGlyphs;d<m.length;d+=1){var g=m[d];if(g.rect){var y=g.rect||{},v=4,x=!0,_=1,b=0,w=(i||l)&&g.vertical,T=g.metrics.advance*g.scale/2;if(l&&t.verticalizable){var k=(g.scale-1)*Sl,A=(Sl-g.metrics.width*g.scale)/2;b=p.lineOffset/2-(g.imageName?-A:k)}if(g.imageName){var M=s[g.imageName];x=M.sdf,v=1/(_=M.pixelRatio)}var S=i?[g.x+T,g.y]:[0,0],E=i?[0,0]:[g.x+T+r[0],g.y+r[1]-b],C=[0,0];w&&(C=E,E=[0,0]);var I=(g.metrics.left-v)*g.scale-T+E[0],L=(-g.metrics.top-v)*g.scale+E[1],P=I+y.w*g.scale/_,z=L+y.h*g.scale/_,D=new a(I,L),O=new a(P,L),R=new a(I,z),F=new a(P,z);if(w){var B=new a(-T,T-nc),j=-Math.PI/2,N=12-T,U=g.imageName?N:0,V=new a(22-N,-U),q=new(Function.prototype.bind.apply(a,[null].concat(C)));D._rotateAround(j,B)._add(V)._add(q),O._rotateAround(j,B)._add(V)._add(q),R._rotateAround(j,B)._add(V)._add(q),F._rotateAround(j,B)._add(V)._add(q)}if(c){var H=Math.sin(c),G=Math.cos(c),W=[G,-H,H,G];D._matMult(W),O._matMult(W),R._matMult(W),F._matMult(W)}var Z=new a(0,0),Y=new a(0,0);u.push({tl:D,tr:O,bl:R,br:F,tex:y,writingMode:t.writingMode,glyphOffset:S,sectionIndex:g.sectionIndex,isSDF:x,pixelOffsetTL:Z,pixelOffsetBR:Y,minFontScaleX:0,minFontScaleY:0})}}return u}(0,r,l,i,o,s,n,e.allowVerticalPlacement),y=e.textSizeData,v=null;"source"===y.kind?(v=[xc*i.layout.get("text-size").evaluate(s,{})])[0]>Zc&&k(e.layerIds[0]+': Value for "text-size" is >= '+Wc+'. Reduce your "text-size".'):"composite"===y.kind&&((v=[xc*d.compositeTextSizes[0].evaluate(s,{},m),xc*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>Zc||v[1]>Zc)&&k(e.layerIds[0]+': Value for "text-size" is >= '+Wc+'. Reduce your "text-size".'),e.addSymbols(e.text,g,v,l,o,s,u,t,c.lineStartIndex,c.lineLength,p,m);for(var x=0,_=h;x<_.length;x+=1)f[_[x]]=e.text.placedSymbolArray.length-1;return 4*g.length}function Xc(e){for(var t in e)return e[t];return null}function $c(e,t,r,n){var i=e.compareText;if(t in i){for(var a=i[t],o=a.length-1;o>=0;o--)if(n.dist(a[o])<r)return!0}else i[t]=[];return i[t].push(n),!1}var Kc=Ks.VectorTileFeature.types,Jc=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Qc(e,t,r,n,i,a,o,s,l,c,u,h,f){var p=s?Math.min(Zc,Math.round(s[0])):0,d=s?Math.min(Zc,Math.round(s[1])):0;e.emplaceBack(t,r,Math.round(32*n),Math.round(32*i),a,o,(p<<1)+(l?1:0),d,16*c,16*u,256*h,256*f)}function eu(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function tu(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(_i(r[t].text))return!0;return!1}var ru=function(e){this.layoutVertexArray=new sa,this.indexArray=new da,this.programConfigurations=e,this.segments=new Da,this.dynamicLayoutVertexArray=new la,this.opacityVertexArray=new ca,this.placedSymbolArray=new Ma};ru.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},ru.prototype.upload=function(e,t,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,_l.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,bl.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Jc,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(e))},ru.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},ii("SymbolBuffers",ru);var nu=function(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new Da,this.collisionVertexArray=new pa};nu.prototype.upload=function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,wl.members,!0)},nu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},ii("CollisionBuffers",nu);var iu=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=Fo([]),this.placementViewportMatrix=Fo([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=_c(this.zoom,t["text-size"]),this.iconSizeData=_c(this.zoom,t["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1);var a="viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(e){return rc[e]}))),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id})),this.sourceID=e.sourceID};iu.prototype.createArrays=function(){this.text=new ru(new co(this.layers,this.zoom,(function(e){return/^text/.test(e)}))),this.icon=new ru(new co(this.layers,this.zoom,(function(e){return/^icon/.test(e)}))),this.glyphOffsetArray=new Ca,this.lineVertexArray=new Ia,this.symbolInstances=new Ea},iu.prototype.calculateGlyphDependencies=function(e,t,r,n,i){for(var a=0;a<e.length;a++)if(t[e.charCodeAt(a)]=!0,(r||n)&&i){var o=Ml[e.charAt(a)];o&&(t[o.charCodeAt(0)]=!0)}},iu.prototype.populate=function(e,t,r){var n=this.layers[0],i=n.layout,a=i.get("text-font"),o=i.get("text-field"),s=i.get("icon-image"),l=("constant"!==o.value.kind||o.value.value instanceof ct&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get("symbol-sort-key");if(this.features=[],l||c){for(var h=t.iconDependencies,f=t.glyphDependencies,p=t.availableImages,d=new zi(this.zoom),m=0,g=e;m<g.length;m+=1){var y=g[m],v=y.feature,x=y.id,_=y.index,b=y.sourceLayerIndex,w=n._featureFilter.needGeometry,T=yo(v,w);if(n._featureFilter.filter(d,T,r)){w||(T.geometry=go(v));var k=void 0;if(l){var A=n.getValueAndResolveTokens("text-field",T,r,p),M=ct.factory(A);tu(M)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Ii()||this.hasRTLText&&Pi.isParsed())&&(k=Al(M,n,T))}var S=void 0;if(c){var E=n.getValueAndResolveTokens("icon-image",T,r,p);S=E instanceof ut?E:ut.fromString(E)}if(k||S){var C=this.sortFeaturesByKey?u.evaluate(T,{},r):void 0,I={id:x,text:k,icon:S,index:_,sourceLayerIndex:b,geometry:T.geometry,properties:v.properties,type:Kc[v.type],sortKey:C};if(this.features.push(I),S&&(h[S.name]=!0),k){var L=a.evaluate(T,{},r).join(","),P="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(rc.vertical)>=0;for(var z=0,D=k.sections;z<D.length;z+=1){var O=D[z];if(O.image)h[O.image.name]=!0;else{var R=fi(k.toString()),F=O.fontStack||L,B=f[F]=f[F]||{};this.calculateGlyphDependencies(O.text,B,P,this.allowVerticalPlacement,R)}}}}}}"line"===i.get("symbol-placement")&&(this.features=function(e){var t={},r={},n=[],i=0;function a(t){n.push(e[t]),i++}function o(e,t,i){var a=r[e];return delete r[e],r[t]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(e,r,i){var a=t[r];return delete t[r],t[e]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(e,t,r){var n=r?t[0][t[0].length-1]:t[0][0];return e+":"+n.x+":"+n.y}for(var c=0;c<e.length;c++){var u=e[c],h=u.geometry,f=u.text?u.text.toString():null;if(f){var p=l(f,h),d=l(f,h,!0);if(p in r&&d in t&&r[p]!==t[d]){var m=s(p,d,h),g=o(p,d,n[m].geometry);delete t[p],delete r[d],r[l(f,n[g].geometry,!0)]=g,n[m].geometry=null}else p in r?o(p,d,h):d in t?s(p,d,h):(a(c),t[p]=i-1,r[d]=i-1)}else a(c)}return n.filter((function(e){return e.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(e,t){return e.sortKey-t.sortKey}))}},iu.prototype.update=function(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))},iu.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},iu.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},iu.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},iu.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},iu.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},iu.prototype.addToLineVertexArray=function(e,t){var r=this.lineVertexArray.length;if(void 0!==e.segment){for(var n=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:n},o<t.length-1&&(n+=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 l=0;l<t.length;l++){var c=a[l];this.lineVertexArray.emplaceBack(c.x,c.y,c.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},iu.prototype.addSymbols=function(e,t,r,n,i,a,o,s,l,c,u,h){for(var f=e.indexArray,p=e.layoutVertexArray,d=e.segments.prepareSegment(4*t.length,p,f,this.canOverlap?a.sortKey:void 0),m=this.glyphOffsetArray.length,g=d.vertexLength,y=this.allowVerticalPlacement&&o===rc.vertical?Math.PI/2:0,v=a.text&&a.text.sections,x=0;x<t.length;x++){var _=t[x],b=_.tl,w=_.tr,T=_.bl,k=_.br,A=_.tex,M=_.pixelOffsetTL,S=_.pixelOffsetBR,E=_.minFontScaleX,C=_.minFontScaleY,I=_.glyphOffset,L=_.isSDF,P=_.sectionIndex,z=d.vertexLength,D=I[1];Qc(p,s.x,s.y,b.x,D+b.y,A.x,A.y,r,L,M.x,M.y,E,C),Qc(p,s.x,s.y,w.x,D+w.y,A.x+A.w,A.y,r,L,S.x,M.y,E,C),Qc(p,s.x,s.y,T.x,D+T.y,A.x,A.y+A.h,r,L,M.x,S.y,E,C),Qc(p,s.x,s.y,k.x,D+k.y,A.x+A.w,A.y+A.h,r,L,S.x,S.y,E,C),eu(e.dynamicLayoutVertexArray,s,y),f.emplaceBack(z,z+1,z+2),f.emplaceBack(z+1,z+2,z+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(I[0]),(x===t.length-1||P!==t[x+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(p.length,a,a.index,{},h,v&&v[P])}e.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,g,l,c,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,0,!1,0,u)},iu.prototype._addCollisionDebugVertex=function(e,t,r,n,i,a){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))},iu.prototype.addCollisionDebugVertices=function(e,t,r,n,i,o,s){var l=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),c=l.vertexLength,u=i.layoutVertexArray,h=i.collisionVertexArray,f=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,h,o,f,p,new a(e,t)),this._addCollisionDebugVertex(u,h,o,f,p,new a(r,t)),this._addCollisionDebugVertex(u,h,o,f,p,new a(r,n)),this._addCollisionDebugVertex(u,h,o,f,p,new a(e,n)),l.vertexLength+=4;var d=i.indexArray;d.emplaceBack(c,c+1),d.emplaceBack(c+1,c+2),d.emplaceBack(c+2,c+3),d.emplaceBack(c+3,c),l.primitiveLength+=4},iu.prototype.addDebugCollisionBoxes=function(e,t,r,n){for(var i=e;i<t;i++){var a=this.collisionBoxArray.get(i),o=a.x1,s=a.y1,l=a.x2,c=a.y2;this.addCollisionDebugVertices(o,s,l,c,n?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r)}},iu.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new nu(ha,Tl.members,_a),this.iconCollisionBox=new nu(ha,Tl.members,_a);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)}},iu.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,n,i,a,o,s,l){for(var c={},u=t;u<r;u++){var h=e.get(u);c.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},c.textFeatureIndex=h.featureIndex;break}for(var f=n;f<i;f++){var p=e.get(f);c.verticalTextBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},c.verticalTextFeatureIndex=p.featureIndex;break}for(var d=a;d<o;d++){var m=e.get(d);c.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},c.iconFeatureIndex=m.featureIndex;break}for(var g=s;g<l;g++){var y=e.get(g);c.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},c.verticalIconFeatureIndex=y.featureIndex;break}return c},iu.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},iu.prototype.hasTextData=function(){return this.text.segments.get().length>0},iu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},iu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},iu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},iu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},iu.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i<n;i+=4)e.indexArray.emplaceBack(i,i+1,i+2),e.indexArray.emplaceBack(i+1,i+2,i+3)},iu.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var t=Math.sin(e),r=Math.cos(e),n=[],i=[],a=[],o=0;o<this.symbolInstances.length;++o){a.push(o);var s=this.symbolInstances.get(o);n.push(0|Math.round(t*s.anchorX+r*s.anchorY)),i.push(s.featureIndex)}return a.sort((function(e,t){return n[e]-n[t]||i[t]-i[e]})),a},iu.prototype.addToSortKeyRanges=function(e,t){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})},iu.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 r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=n[r],a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(e,r,n){e>=0&&n.indexOf(e)===r&&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)}},ii("SymbolBucket",iu,{omit:["layers","collisionBoxArray","features","compareText"]}),iu.MAX_GLYPHS=65535,iu.addDynamicAttributes=eu;var au=new Zi({"symbol-placement":new Vi(Oe.layout_symbol["symbol-placement"]),"symbol-spacing":new Vi(Oe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Vi(Oe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new qi(Oe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Vi(Oe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Vi(Oe.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Vi(Oe.layout_symbol["icon-ignore-placement"]),"icon-optional":new Vi(Oe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Vi(Oe.layout_symbol["icon-rotation-alignment"]),"icon-size":new qi(Oe.layout_symbol["icon-size"]),"icon-text-fit":new Vi(Oe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Vi(Oe.layout_symbol["icon-text-fit-padding"]),"icon-image":new qi(Oe.layout_symbol["icon-image"]),"icon-rotate":new qi(Oe.layout_symbol["icon-rotate"]),"icon-padding":new Vi(Oe.layout_symbol["icon-padding"]),"icon-keep-upright":new Vi(Oe.layout_symbol["icon-keep-upright"]),"icon-offset":new qi(Oe.layout_symbol["icon-offset"]),"icon-anchor":new qi(Oe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Vi(Oe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Vi(Oe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Vi(Oe.layout_symbol["text-rotation-alignment"]),"text-field":new qi(Oe.layout_symbol["text-field"]),"text-font":new qi(Oe.layout_symbol["text-font"]),"text-size":new qi(Oe.layout_symbol["text-size"]),"text-max-width":new qi(Oe.layout_symbol["text-max-width"]),"text-line-height":new Vi(Oe.layout_symbol["text-line-height"]),"text-letter-spacing":new qi(Oe.layout_symbol["text-letter-spacing"]),"text-justify":new qi(Oe.layout_symbol["text-justify"]),"text-radial-offset":new qi(Oe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Vi(Oe.layout_symbol["text-variable-anchor"]),"text-anchor":new qi(Oe.layout_symbol["text-anchor"]),"text-max-angle":new Vi(Oe.layout_symbol["text-max-angle"]),"text-writing-mode":new Vi(Oe.layout_symbol["text-writing-mode"]),"text-rotate":new qi(Oe.layout_symbol["text-rotate"]),"text-padding":new Vi(Oe.layout_symbol["text-padding"]),"text-keep-upright":new Vi(Oe.layout_symbol["text-keep-upright"]),"text-transform":new qi(Oe.layout_symbol["text-transform"]),"text-offset":new qi(Oe.layout_symbol["text-offset"]),"text-allow-overlap":new Vi(Oe.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Vi(Oe.layout_symbol["text-ignore-placement"]),"text-optional":new Vi(Oe.layout_symbol["text-optional"])}),ou=new Zi({"icon-opacity":new qi(Oe.paint_symbol["icon-opacity"]),"icon-color":new qi(Oe.paint_symbol["icon-color"]),"icon-halo-color":new qi(Oe.paint_symbol["icon-halo-color"]),"icon-halo-width":new qi(Oe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new qi(Oe.paint_symbol["icon-halo-blur"]),"icon-translate":new Vi(Oe.paint_symbol["icon-translate"]),"icon-translate-anchor":new Vi(Oe.paint_symbol["icon-translate-anchor"]),"text-opacity":new qi(Oe.paint_symbol["text-opacity"]),"text-color":new qi(Oe.paint_symbol["text-color"],{runtimeType:Ze,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new qi(Oe.paint_symbol["text-halo-color"]),"text-halo-width":new qi(Oe.paint_symbol["text-halo-width"]),"text-halo-blur":new qi(Oe.paint_symbol["text-halo-blur"]),"text-translate":new Vi(Oe.paint_symbol["text-translate"]),"text-translate-anchor":new Vi(Oe.paint_symbol["text-translate-anchor"])}),su={paint:ou,layout:au},lu=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:qe,this.defaultValue=e};lu.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},lu.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},lu.prototype.outputDefined=function(){return!1},lu.prototype.serialize=function(){return null},ii("FormatSectionOverride",lu,{omit:["defaultValue"]});var cu=function(e){function t(t){e.call(this,t,su)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,r){if(e.prototype.recalculate.call(this,t,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;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,r,n){var i=this.layout.get(e).evaluate(t,{},r,n),a=this._unevaluatedLayout._values[e];return a.isDataDriven()||ln(a.value)||!i?i:function(e,t){return t.replace(/{([^{}]+)}/g,(function(t,r){return r in e?String(e[r]):""}))}(t.properties,i)},t.prototype.createBucket=function(e){return new iu(e)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var e=0,r=su.paint.overridableProperties;e<r.length;e+=1){var n=r[e];if(t.hasPaintOverride(this.layout,n)){var i,a=this.paint.get(n),o=new lu(a),s=new sn(o,a.property.specification);i="constant"===a.value.kind||"source"===a.value.kind?new un("source",s):new hn("composite",s,a.value.zoomStops,a.value._interpolationType),this.paint._values[n]=new Ni(a.property,i,a.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(e,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&t.hasPaintOverride(this.layout,e)},t.hasPaintOverride=function(e,t){var r=e.get("text-field"),n=su.paint.properties[t],i=!1,a=function(e){for(var t=0,r=e;t<r.length;t+=1){var a=r[t];if(n.overrides&&n.overrides.hasOverride(a))return void(i=!0)}};if("constant"===r.value.kind&&r.value.value instanceof ct)a(r.value.value.sections);else if("source"===r.value.kind){var o=function(e){if(!i)if(e instanceof mt&&pt(e.value)===Ke){var t=e.value;a(t.sections)}else e instanceof xt?a(e.sections):e.eachChild(o)},s=r.value;s._styleExpression&&o(s._styleExpression.expression)}return i},t}(Xi),uu={paint:new Zi({"background-color":new Vi(Oe.paint_background["background-color"]),"background-pattern":new Gi(Oe.paint_background["background-pattern"]),"background-opacity":new Vi(Oe.paint_background["background-opacity"])})},hu=function(e){function t(t){e.call(this,t,uu)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Xi),fu={paint:new Zi({"raster-opacity":new Vi(Oe.paint_raster["raster-opacity"]),"raster-hue-rotate":new Vi(Oe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Vi(Oe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Vi(Oe.paint_raster["raster-brightness-max"]),"raster-saturation":new Vi(Oe.paint_raster["raster-saturation"]),"raster-contrast":new Vi(Oe.paint_raster["raster-contrast"]),"raster-resampling":new Vi(Oe.paint_raster["raster-resampling"]),"raster-fade-duration":new Vi(Oe.paint_raster["raster-fade-duration"])})},pu=function(e){function t(t){e.call(this,t,fu)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Xi),du=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"3d"===this.implementation.renderingMode},t.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},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}(Xi),mu={circle:Vo,heatmap:Jo,hillshade:es,fill:Us,"fill-extrusion":al,line:vl,symbol:cu,background:hu,raster:pu},gu=s.HTMLImageElement,yu=s.HTMLCanvasElement,vu=s.HTMLVideoElement,xu=s.ImageData,_u=s.ImageBitmap,bu=function(e,t,r,n){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,n)};bu.prototype.update=function(e,t,r){var n=e.width,i=e.height,a=!(this.size&&this.size[0]===n&&this.size[1]===i||r),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||!1!==t.premultiply)),a)this.size=[n,i],e instanceof gu||e instanceof yu||e instanceof vu||e instanceof xu||_u&&e instanceof _u?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,e):s.texImage2D(s.TEXTURE_2D,0,this.format,n,i,0,this.format,s.UNSIGNED_BYTE,e.data);else{var l=r||{x:0,y:0},c=l.x,u=l.y;e instanceof gu||e instanceof yu||e instanceof vu||e instanceof xu||_u&&e instanceof _u?s.texSubImage2D(s.TEXTURE_2D,0,c,u,s.RGBA,s.UNSIGNED_BYTE,e):s.texSubImage2D(s.TEXTURE_2D,0,c,u,n,i,s.RGBA,s.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},bu.prototype.bind=function(e,t,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r===n.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(r=n.LINEAR),e!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrap=t)},bu.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},bu.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var wu=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()})};wu.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))},wu.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Tu=function(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},v(["receive","process"],this),this.invoker=new wu(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=S()?e:s};function ku(e,t,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[e*n-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}Tu.prototype.send=function(e,t,r,n,i){var a=this;void 0===i&&(i=!1);var o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);var s=I(this.globalScope)?void 0:[];return this.target.postMessage({id:o,type:e,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:li(t,s)},s),{cancel:function(){r&&delete a.callbacks[o],a.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:a.mapId})}}},Tu.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else S()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},Tu.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)}},Tu.prototype.processTask=function(e,t){var r=this;if("<response>"===t.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(t.error?n(ci(t.error)):n(null,ci(t.data)))}else{var i=!1,a=I(this.globalScope)?void 0:[],o=t.hasCallback?function(t,n){i=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:t?li(t):null,data:li(n,a)},a)}:function(e){i=!0},s=null,l=ci(t.data);if(this.parent[t.type])s=this.parent[t.type](t.sourceMapId,l,o);else if(this.parent.getWorkerSource){var c=t.type.split(".");s=this.parent.getWorkerSource(t.sourceMapId,c[0],l.source)[c[1]](l,o)}else o(new Error("Could not find function "+t.type));!i&&s&&s.cancel&&(this.cancelCallbacks[e]=s.cancel)}},Tu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Au=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};Au.prototype.setNorthEast=function(e){return this._ne=e instanceof Su?new Su(e.lng,e.lat):Su.convert(e),this},Au.prototype.setSouthWest=function(e){return this._sw=e instanceof Su?new Su(e.lng,e.lat):Su.convert(e),this},Au.prototype.extend=function(e){var t,r,n=this._sw,i=this._ne;if(e instanceof Su)t=e,r=e;else{if(!(e instanceof Au)){if(Array.isArray(e)){if(4===e.length||e.every(Array.isArray)){var a=e;return this.extend(Au.convert(a))}var o=e;return this.extend(Su.convert(o))}return this}if(t=e._sw,r=e._ne,!t||!r)return this}return n||i?(n.lng=Math.min(t.lng,n.lng),n.lat=Math.min(t.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Su(t.lng,t.lat),this._ne=new Su(r.lng,r.lat)),this},Au.prototype.getCenter=function(){return new Su((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Au.prototype.getSouthWest=function(){return this._sw},Au.prototype.getNorthEast=function(){return this._ne},Au.prototype.getNorthWest=function(){return new Su(this.getWest(),this.getNorth())},Au.prototype.getSouthEast=function(){return new Su(this.getEast(),this.getSouth())},Au.prototype.getWest=function(){return this._sw.lng},Au.prototype.getSouth=function(){return this._sw.lat},Au.prototype.getEast=function(){return this._ne.lng},Au.prototype.getNorth=function(){return this._ne.lat},Au.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Au.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Au.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Au.prototype.contains=function(e){var t=Su.convert(e),r=t.lng,n=t.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},Au.convert=function(e){return!e||e instanceof Au?e:new Au(e)};var Mu=6371008.8,Su=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Su.prototype.wrap=function(){return new Su(f(this.lng,-180,180),this.lat)},Su.prototype.toArray=function(){return[this.lng,this.lat]},Su.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Su.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return Mu*Math.acos(Math.min(i,1))},Su.prototype.toBounds=function(e){void 0===e&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new Au(new Su(this.lng-r,this.lat-t),new Su(this.lng+r,this.lat+t))},Su.convert=function(e){if(e instanceof Su)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Su(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new Su(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Eu=2*Math.PI*Mu;function Cu(e){return Eu*Math.cos(e*Math.PI/180)}function Iu(e){return(180+e)/360}function Lu(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Pu(e,t){return e/Cu(t)}function zu(e){var t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}var Du=function(e,t,r){void 0===r&&(r=0),this.x=+e,this.y=+t,this.z=+r};Du.fromLngLat=function(e,t){void 0===t&&(t=0);var r=Su.convert(e);return new Du(Iu(r.lng),Lu(r.lat),Pu(t,r.lat))},Du.prototype.toLngLat=function(){return new Su(function(e){return 360*e-180}(this.x),zu(this.y))},Du.prototype.toAltitude=function(){return function(e,t){return e*Cu(zu(t))}(this.z,this.y)},Du.prototype.meterInMercatorCoordinateUnits=function(){return 1/Eu*function(e){return 1/Math.cos(e*Math.PI/180)}(zu(this.y))};var Ou=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Bu(0,e,e,t,r)};Ou.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Ou.prototype.url=function(e,t){var r=function(e,t,r){var n=ku(256*e,256*(t=Math.pow(2,r)-t-1),r),i=ku(256*(e+1),256*(t+1),r);return n[0]+","+n[1]+","+i[0]+","+i[1]}(this.x,this.y,this.z),n=function(e,t,r){for(var n,i="",a=e;a>0;a--)i+=(t&(n=1<<a-1)?1:0)+(r&n?2:0);return i}(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("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",r)},Ou.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new a((e.x*t-this.x)*fo,(e.y*t-this.y)*fo)},Ou.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Ru=function(e,t){this.wrap=e,this.canonical=t,this.key=Bu(e,t.z,t.z,t.x,t.y)},Fu=function(e,t,r,n,i){this.overscaledZ=e,this.wrap=t,this.canonical=new Ou(r,+n,+i),this.key=Bu(t,e,r,n,i)};function Bu(e,t,r,n,i){(e*=2)<0&&(e=-1*e-1);var a=1<<r;return(a*a*e+a*i+n).toString(36)+r.toString(36)+t.toString(36)}Fu.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},Fu.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new Fu(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Fu(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},Fu.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?Bu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Bu(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},Fu.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t},Fu.prototype.children=function(e){if(this.overscaledZ>=e)return[new Fu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Fu(t,this.wrap,t,r,n),new Fu(t,this.wrap,t,r+1,n),new Fu(t,this.wrap,t,r,n+1),new Fu(t,this.wrap,t,r+1,n+1)]},Fu.prototype.isLessThan=function(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))},Fu.prototype.wrapped=function(){return new Fu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Fu.prototype.unwrapTo=function(e){return new Fu(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},Fu.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Fu.prototype.toUnwrapped=function(){return new Ru(this.wrap,this.canonical)},Fu.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Fu.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new Du(e.x-this.wrap,e.y))},ii("CanonicalTileID",Ou),ii("OverscaledTileID",Fu,{omit:["posMatrix"]});var ju=function(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return k('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=t.height;var n=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var i=0;i<n;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(n,i)]=this.data[this._idx(n-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,n)]=this.data[this._idx(i,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)]};ju.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),n=4*this._idx(e,t);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[n],r[n+1],r[n+2])},ju.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},ju.prototype._idx=function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},ju.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},ju.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},ju.prototype.getPixels=function(){return new Xo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},ju.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var n=t*this.dim,i=t*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-t*this.dim,l=-r*this.dim,c=a;c<o;c++)for(var u=n;u<i;u++)this.data[this._idx(u,c)]=e.data[this._idx(u+s,c+l)]},ii("DEMData",ju);var Nu=function(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}};Nu.prototype.encode=function(e){return this._stringToNumber[e]},Nu.prototype.decode=function(e){return this._numberToString[e]};var Uu=function(e,t,r,n,i){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=n,this.properties=e.properties,this.id=i},Vu={geometry:{configurable:!0}};Vu.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Vu.geometry.set=function(e){this._geometry=e},Uu.prototype.toJSON=function(){var e={geometry:this.geometry};for(var t in this)"_geometry"===t||"_vectorTileFeature"===t||(e[t]=this[t]);return e},Object.defineProperties(Uu.prototype,Vu);var qu=function(){this.state={},this.stateChanges={},this.deletedStates={}};qu.prototype.updateState=function(e,t,r){var n=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][n]=this.stateChanges[e][n]||{},p(this.stateChanges[e][n],r),null===this.deletedStates[e])for(var i in this.deletedStates[e]={},this.state[e])i!==n&&(this.deletedStates[e][i]=null);else if(this.deletedStates[e]&&null===this.deletedStates[e][n])for(var a in this.deletedStates[e][n]={},this.state[e][n])r[a]||(this.deletedStates[e][n][a]=null);else for(var o in r)this.deletedStates[e]&&this.deletedStates[e][n]&&null===this.deletedStates[e][n][o]&&delete this.deletedStates[e][n][o]},qu.prototype.removeFeatureState=function(e,t,r){if(null!==this.deletedStates[e]){var n=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&void 0!==t)null!==this.deletedStates[e][n]&&(this.deletedStates[e][n]=this.deletedStates[e][n]||{},this.deletedStates[e][n][r]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][n])for(r in this.deletedStates[e][n]={},this.stateChanges[e][n])this.deletedStates[e][n][r]=null;else this.deletedStates[e][n]=null;else this.deletedStates[e]=null}},qu.prototype.getState=function(e,t){var r=String(t),n=this.state[e]||{},i=this.stateChanges[e]||{},a=p({},n[r],i[r]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){var o=this.deletedStates[e][t];if(null===o)return{};for(var s in o)delete a[s]}return a},qu.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},qu.prototype.coalesceChanges=function(e,t){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var i={};for(var a in this.stateChanges[n])this.state[n][a]||(this.state[n][a]={}),p(this.state[n][a],this.stateChanges[n][a]),i[a]=this.state[n][a];r[n]=i}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var l in this.state[o])s[l]={},this.state[o][l]={};else for(var c in this.deletedStates[o]){if(null===this.deletedStates[o][c])this.state[o][c]={};else for(var u=0,h=Object.keys(this.deletedStates[o][c]);u<h.length;u+=1){var f=h[u];delete this.state[o][c][f]}s[c]=this.state[o][c]}r[o]=r[o]||{},p(r[o],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var d in e)e[d].setFeatureState(r,t)};var Hu=function(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Jn(fo,16,0),this.grid3D=new Jn(fo,16,0),this.featureIndexArray=new Pa,this.promoteId=t};function Gu(e,t,r,n,i){return _(e,(function(e,a){var o=t instanceof Ui?t.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function Wu(e){for(var t=1/0,r=1/0,n=-1/0,i=-1/0,a=0,o=e;a<o.length;a+=1){var s=o[a];t=Math.min(t,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y)}return{minX:t,minY:r,maxX:n,maxY:i}}function Zu(e,t){return t-e}Hu.prototype.insert=function(e,t,r,n,i,a){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=a?this.grid3D:this.grid,l=0;l<t.length;l++){for(var c=t[l],u=[1/0,1/0,-1/0,-1/0],h=0;h<c.length;h++){var f=c[h];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]<fo&&u[1]<fo&&u[2]>=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},Hu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ks.VectorTile(new Il(this.rawTileData)).layers,this.sourceLayerCoder=new Nu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Hu.prototype.query=function(e,t,r,n){var i=this;this.loadVTLayers();for(var o=e.params||{},s=fo/e.tileSize/e.scale,l=Tn(o.filter),c=e.queryGeometry,u=e.queryPadding*s,h=Wu(c),f=this.grid.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u),p=Wu(e.cameraQueryGeometry),d=this.grid3D.query(p.minX-u,p.minY-u,p.maxX+u,p.maxY+u,(function(t,r,n,i){return function(e,t,r,n,i){for(var o=0,s=e;o<s.length;o+=1){var l=s[o];if(t<=l.x&&r<=l.y&&n>=l.x&&i>=l.y)return!0}var c=[new a(t,r),new a(t,i),new a(n,i),new a(n,r)];if(e.length>2)for(var u=0,h=c;u<h.length;u+=1)if(Co(e,h[u]))return!0;for(var f=0;f<e.length-1;f++)if(Io(e[f],e[f+1],c))return!0;return!1}(e.cameraQueryGeometry,t-u,r-u,n+u,i+u)})),m=0,g=d;m<g.length;m+=1){var y=g[m];f.push(y)}f.sort(Zu);for(var v,x={},_=function(a){var u=f[a];if(u!==v){v=u;var h=i.featureIndexArray.get(u),p=null;i.loadMatchingFeature(x,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,l,o.layers,o.availableImages,t,r,n,(function(t,r,n){return p||(p=go(t)),r.queryIntersectsFeature(c,t,n,p,i.z,e.transform,s,e.pixelPosMatrix)}))}},b=0;b<f.length;b++)_(b);return x},Hu.prototype.loadMatchingFeature=function(e,t,r,n,i,a,o,s,l,c,u){var h=this.bucketLayerIDs[t];if(!a||function(e,t){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}(a,h)){var f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(n);if(i.needGeometry){var m=yo(d,!0);if(!i.filter(new zi(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!i.filter(new zi(this.tileID.overscaledZ),d))return;for(var g=this.getId(d,f),y=0;y<h.length;y++){var v=h[y];if(!(a&&a.indexOf(v)<0)){var x=s[v];if(x){var _={};void 0!==g&&c&&(_=c.getState(x.sourceLayer||"_geojsonTileLayer",g));var b=p({},l[v]);b.paint=Gu(b.paint,x.paint,d,_,o),b.layout=Gu(b.layout,x.layout,d,_,o);var w=!u||u(d,x,_);if(w){var T=new Uu(d,this.z,this.x,this.y,g);T.layer=b;var k=e[v];void 0===k&&(k=e[v]=[]),k.push({featureIndex:n,feature:T,intersectionZ:w})}}}}}},Hu.prototype.lookupSymbolFeatures=function(e,t,r,n,i,a,o,s){var l={};this.loadVTLayers();for(var c=Tn(i),u=0,h=e;u<h.length;u+=1){var f=h[u];this.loadMatchingFeature(l,r,n,f,c,a,o,s,t)}return l},Hu.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var n=0,i=r[t];n<i.length;n+=1)if(e===i[n])return!0;return!1},Hu.prototype.getId=function(e,t){var r=e.id;if(this.promoteId){var n="string"==typeof this.promoteId?this.promoteId:this.promoteId[t];"boolean"==typeof(r=e.properties[n])&&(r=Number(r))}return r},ii("FeatureIndex",Hu,{omit:["rawTileData","sourceLayerCoder"]});var Yu=function(e,t){this.tileID=e,this.uid=m(),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"};Yu.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<j.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},Yu.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Yu.prototype.loadVectorData=function(e,t,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){for(var n 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=function(e,t){var r={};if(!t)return r;for(var n=function(){var e=a[i],n=e.layerIds.map((function(e){return t.getLayer(e)})).filter(Boolean);if(0!==n.length){e.layers=n,e.stateDependentLayerIds&&(e.stateDependentLayers=e.stateDependentLayerIds.map((function(e){return n.filter((function(t){return t.id===e}))[0]})));for(var o=0,s=n;o<s.length;o+=1){var l=s[o];r[l.id]=e}}},i=0,a=e;i<a.length;i+=1)n();return r}(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[n];if(i instanceof iu){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var a in this.buckets){var o=this.buckets[a];if(o instanceof iu&&o.hasRTLText){this.hasRTLText=!0,!Pi.isLoading()&&!Pi.isLoaded()&&"deferred"===Ii()&&Li();break}}for(var s in this.queryPadding=0,this.buckets){var l=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(s).queryRadius(l))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new ka},Yu.prototype.unloadVectorData=function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Yu.prototype.getBucket=function(e){return this.buckets[e.id]},Yu.prototype.upload=function(e){for(var t in this.buckets){var r=this.buckets[t];r.uploadPending()&&r.upload(e)}var n=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new bu(e,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new bu(e,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)},Yu.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},Yu.prototype.queryRenderedFeatures=function(e,t,r,n,i,a,o,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:o,queryPadding:this.queryPadding*l},e,t,r):{}},Yu.prototype.querySourceFeatures=function(e,t){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var n=r.loadVTLayers(),i=t?t.sourceLayer:"",a=n._geojsonTileLayer||n[i];if(a)for(var o=Tn(t&&t.filter),s=this.tileID.canonical,l=s.z,c=s.x,u=s.y,h={z:l,x:c,y:u},f=0;f<a.length;f++){var p=a.feature(f);if(o.needGeometry){var d=yo(p,!0);if(!o.filter(new zi(this.tileID.overscaledZ),d,this.tileID.canonical))continue}else if(!o.filter(new zi(this.tileID.overscaledZ),p))continue;var m=r.getId(p,i),g=new Uu(p,l,c,u,m);g.tile=h,e.push(g)}}},Yu.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Yu.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Yu.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var r=E(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(t)if(this.expirationTime<t)i=!0;else{var a=this.expirationTime-t;a?this.expirationTime=n+Math.max(a,3e4):i=!0}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Yu.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},Yu.prototype.setFeatureState=function(e,t){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(e).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets)if(t.style.hasLayer(n)){var i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=e[a];if(o&&s&&0!==Object.keys(s).length){i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=t&&t.style&&t.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(i)))}}}},Yu.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Yu.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<j.now()},Yu.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Yu.prototype.setHoldDuration=function(e){this.symbolFadeHoldUntil=j.now()+e},Yu.prototype.setDependencies=function(e,t){for(var r={},n=0,i=t;n<i.length;n+=1)r[i[n]]=!0;this.dependencies[e]=r},Yu.prototype.hasDependency=function(e,t){for(var r=0,n=e;r<n.length;r+=1){var i=n[r],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 Xu=s.performance,$u=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},Xu.mark(this._marks.start)};$u.prototype.finish=function(){Xu.mark(this._marks.end);var e=Xu.getEntriesByName(this._marks.measure);return 0===e.length&&(Xu.measure(this._marks.measure,this._marks.start,this._marks.end),e=Xu.getEntriesByName(this._marks.measure),Xu.clearMarks(this._marks.start),Xu.clearMarks(this._marks.end),Xu.clearMeasures(this._marks.measure)),e},e.Actor=Tu,e.AlphaImage=Yo,e.CanonicalTileID=Ou,e.CollisionBoxArray=ka,e.Color=ot,e.DEMData=ju,e.DataConstantProperty=Vi,e.DictionaryCoder=Nu,e.EXTENT=fo,e.ErrorEvent=ze,e.EvaluationParameters=zi,e.Event=Pe,e.Evented=De,e.FeatureIndex=Hu,e.FillBucket=Bs,e.FillExtrusionBucket=tl,e.ImageAtlas=tc,e.ImagePosition=Ql,e.LineBucket=pl,e.LngLat=Su,e.LngLatBounds=Au,e.MercatorCoordinate=Du,e.ONE_EM=Sl,e.OverscaledTileID=Fu,e.Point=a,e.Point$1=a,e.Properties=Zi,e.Protobuf=Il,e.RGBAImage=Xo,e.RequestManager=W,e.RequestPerformance=$u,e.ResourceType=ve,e.SegmentVector=Da,e.SourceFeatureState=qu,e.StructArrayLayout1ui2=ba,e.StructArrayLayout2f1f2i16=fa,e.StructArrayLayout2i4=ta,e.StructArrayLayout3ui6=da,e.StructArrayLayout4i8=ra,e.SymbolBucket=iu,e.Texture=bu,e.Tile=Yu,e.Transitionable=Ri,e.Uniform1f=Xa,e.Uniform1i=Ya,e.Uniform2f=$a,e.Uniform3f=Ka,e.Uniform4f=Ja,e.UniformColor=Qa,e.UniformMatrix4f=to,e.UnwrappedTileID=Ru,e.ValidationError=Re,e.WritingMode=rc,e.ZoomHistory=ui,e.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},e.addDynamicAttributes=eu,e.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var n=e.length,i=new Array(e.length),a=null;e.forEach((function(e,o){t(e,(function(e,t){e&&(a=e),i[o]=t,0==--n&&r(a,i)}))}))},e.bezier=c,e.bindAll=v,e.browser=j,e.cacheEntryPossiblyAdded=function(e){++ge>fe&&(e.getActor().send("enforceCacheSizeLimit",he),ge=0)},e.clamp=h,e.clearTileCache=function(e){var t=s.caches.delete(ue);e&&t.catch(e).then((function(){return e()}))},e.clipLine=Lc,e.clone=function(e){var t=new Ro(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.clone$1=w,e.clone$2=function(e){var t=new Ro(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.collisionCircleLayout=kl,e.config=N,e.create=function(){var e=new Ro(16);return Ro!=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.create$1=function(){var e=new Ro(9);return Ro!=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},e.create$2=function(){var e=new Ro(4);return Ro!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},e.createCommonjsModule=t,e.createExpression=cn,e.createLayout=Qi,e.createStyleLayer=function(e){return"custom"===e.type?new du(e):new mu[e.type](e)},e.cross=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e},e.deepEqual=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var n=0;n<t.length;n++)if(!e(t[n],r[n]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==r){if("object"!=typeof r)return!1;if(Object.keys(t).length!==Object.keys(r).length)return!1;for(var i in t)if(!e(t[i],r[i]))return!1;return!0}return t===r},e.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},e.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},e.ease=u,e.emitValidationErrors=Kn,e.endsWith=x,e.enforceCacheSizeLimit=function(e){pe(),re&&re.then((function(t){t.keys().then((function(r){for(var n=0;n<r.length-e;n++)t.delete(r[n])}))}))},e.evaluateSizeForFeature=bc,e.evaluateSizeForZoom=wc,e.evaluateVariableOffset=Hc,e.evented=Ci,e.extend=p,e.featureFilter=Tn,e.filterObject=b,e.fromRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},e.getAnchorAlignment=mc,e.getAnchorJustification=Gc,e.getArrayBuffer=Te,e.getImage=Ce,e.getJSON=function(e,t){return we(p(e,{type:"json"}),t)},e.getRTLTextPluginStatus=Ii,e.getReferrer=_e,e.getVideo=function(e,t){var r=s.document.createElement("video");r.muted=!0,r.onloadstart=function(){t(null,r)};for(var n=0;n<e.length;n++){var i=s.document.createElement("source");Ae(e[n])||(r.crossOrigin="Anonymous"),i.src=e[n],r.appendChild(i)}return{cancel:function(){}}},e.identity=Fo,e.invert=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],p=t[11],d=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*o,x=r*l-i*o,_=r*c-a*o,b=n*l-i*s,w=n*c-a*s,T=i*c-a*l,k=u*m-h*d,A=u*g-f*d,M=u*y-p*d,S=h*g-f*m,E=h*y-p*m,C=f*y-p*g,I=v*C-x*E+_*S+b*M-w*A+T*k;return I?(I=1/I,e[0]=(s*C-l*E+c*S)*I,e[1]=(i*E-n*C-a*S)*I,e[2]=(m*T-g*w+y*b)*I,e[3]=(f*w-h*T-p*b)*I,e[4]=(l*M-o*C-c*A)*I,e[5]=(r*C-i*M+a*A)*I,e[6]=(g*_-d*T-y*x)*I,e[7]=(u*T-f*_+p*x)*I,e[8]=(o*E-s*M+c*k)*I,e[9]=(n*M-r*E-a*k)*I,e[10]=(d*w-m*_+y*v)*I,e[11]=(h*_-u*w-p*v)*I,e[12]=(s*A-o*S-l*k)*I,e[13]=(r*S-n*A+i*k)*I,e[14]=(m*x-d*b-g*v)*I,e[15]=(u*b-h*x+f*v)*I,e):null},e.isChar=hi,e.isMapboxURL=Z,e.keysDifference=function(e,t){var r=[];for(var n in e)n in t||r.push(n);return r},e.makeRequest=we,e.mapObject=_,e.mercatorXfromLng=Iu,e.mercatorYfromLat=Lu,e.mercatorZfromAltitude=Pu,e.mul=No,e.multiply=Bo,e.mvt=Ks,e.nextPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},e.normalize=function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+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},e.number=er,e.offscreenCanvasSupported=ye,e.ortho=function(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*c,e[15]=1,e},e.parseGlyphPBF=function(e){return new Il(e).readFields(Xl,[])},e.pbf=Il,e.performSymbolLayout=function(e,t,r,n,i,a,o){e.createArrays();var s=512*e.overscaling;e.tilePixelRatio=fo/s,e.compareText={},e.iconsNeedLinear=!1;var l=e.layers[0].layout,c=e.layers[0]._unevaluatedLayout._values,u={};if("composite"===e.textSizeData.kind){var h=e.textSizeData,f=h.minZoom,p=h.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new zi(f),o),c["text-size"].possiblyEvaluate(new zi(p),o)]}if("composite"===e.iconSizeData.kind){var d=e.iconSizeData,m=d.minZoom,g=d.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new zi(m),o),c["icon-size"].possiblyEvaluate(new zi(g),o)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new zi(e.zoom+1),o),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new zi(e.zoom+1),o),u.textMaxSize=c["text-size"].possiblyEvaluate(new zi(18));for(var y=l.get("text-line-height")*Sl,v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),_=l.get("text-size"),b=function(){var a=T[w],s=l.get("text-font").evaluate(a,{},o).join(","),c=_.evaluate(a,{},o),h=u.layoutTextSize.evaluate(a,{},o),f=u.layoutIconSize.evaluate(a,{},o),p={horizontal:{},vertical:void 0},d=a.text,m=[0,0];if(d){var g=d.toString(),b=l.get("text-letter-spacing").evaluate(a,{},o)*Sl,A=function(e){for(var t=0,r=e;t<r.length;t+=1)if(!pi(r[t].charCodeAt(0)))return!1;return!0}(g)?b:0,M=l.get("text-anchor").evaluate(a,{},o),S=l.get("text-variable-anchor");if(!S){var E=l.get("text-radial-offset").evaluate(a,{},o);m=E?Hc(M,[E*Sl,qc]):l.get("text-offset").evaluate(a,{},o).map((function(e){return e*Sl}))}var C=v?"center":l.get("text-justify").evaluate(a,{},o),I=l.get("symbol-placement"),L="point"===I?l.get("text-max-width").evaluate(a,{},o)*Sl:0,P=function(){e.allowVerticalPlacement&&fi(g)&&(p.vertical=oc(d,t,r,i,s,L,y,M,"left",A,m,rc.vertical,!0,I,h,c))};if(!v&&S){for(var z="auto"===C?S.map((function(e){return Gc(e)})):[C],D=!1,O=0;O<z.length;O++){var R=z[O];if(!p.horizontal[R])if(D)p.horizontal[R]=p.horizontal[0];else{var F=oc(d,t,r,i,s,L,y,"center",R,A,m,rc.horizontal,!1,I,h,c);F&&(p.horizontal[R]=F,D=1===F.positionedLines.length)}}P()}else{"auto"===C&&(C=Gc(M));var B=oc(d,t,r,i,s,L,y,M,C,A,m,rc.horizontal,!1,I,h,c);B&&(p.horizontal[C]=B),P(),fi(g)&&v&&x&&(p.vertical=oc(d,t,r,i,s,L,y,M,C,A,m,rc.vertical,!1,I,h,c))}}var j=void 0,N=!1;if(a.icon&&a.icon.name){var U=n[a.icon.name];U&&(j=function(e,t,r){var n=mc(r),i=n.horizontalAlign,a=n.verticalAlign,o=t[0],s=t[1],l=o-e.displaySize[0]*i,c=l+e.displaySize[0],u=s-e.displaySize[1]*a;return{image:e,top:u,bottom:u+e.displaySize[1],left:l,right:c}}(i[a.icon.name],l.get("icon-offset").evaluate(a,{},o),l.get("icon-anchor").evaluate(a,{},o)),N=U.sdf,void 0===e.sdfIcons?e.sdfIcons=U.sdf:e.sdfIcons!==U.sdf&&k("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(U.pixelRatio!==e.pixelRatio||0!==l.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0))}var V=Xc(p.horizontal)||p.vertical;e.iconsInText=!!V&&V.iconsInText,(V||j)&&function(e,t,r,n,i,a,o,s,l,c,u){var h=a.textMaxSize.evaluate(t,{});void 0===h&&(h=o);var f,p=e.layers[0].layout,d=p.get("icon-offset").evaluate(t,{},u),m=Xc(r.horizontal),g=o/24,y=e.tilePixelRatio*g,v=e.tilePixelRatio*h/24,x=e.tilePixelRatio*s,_=e.tilePixelRatio*p.get("symbol-spacing"),b=p.get("text-padding")*e.tilePixelRatio,w=p.get("icon-padding")*e.tilePixelRatio,T=p.get("text-max-angle")/180*Math.PI,A="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),M="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),S=p.get("symbol-placement"),E=_/2,C=p.get("icon-text-fit");n&&"none"!==C&&(e.allowVerticalPlacement&&r.vertical&&(f=yc(n,r.vertical,C,p.get("icon-text-fit-padding"),d,g)),m&&(n=yc(n,m,C,p.get("icon-text-fit-padding"),d,g)));var I=function(s,h){h.x<0||h.x>=fo||h.y<0||h.y>=fo||function(e,t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,A){var M,S,E,C,I,L=e.addToLineVertexArray(t,r),P=0,z=0,D=0,O=0,R=-1,F=-1,B={},j=ja(""),N=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(N=(M=s.layout.get("text-offset").evaluate(_,{},T).map((function(e){return e*Sl})))[0],U=M[1]):(N=s.layout.get("text-radial-offset").evaluate(_,{},T)*Sl,U=qc),e.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(_,{},T)+90,q=n.vertical;C=new Fc(l,t,c,u,h,q,f,p,d,V),o&&(I=new Fc(l,t,c,u,h,o,g,y,d,V))}if(i){var H=s.layout.get("icon-rotate").evaluate(_,{}),G="none"!==s.layout.get("icon-text-fit"),W=Pc(i,H,w,G),Z=o?Pc(o,H,w,G):void 0;E=new Fc(l,t,c,u,h,i,g,y,!1,H),P=4*W.length;var Y=e.iconSizeData,X=null;"source"===Y.kind?(X=[xc*s.layout.get("icon-size").evaluate(_,{})])[0]>Zc&&k(e.layerIds[0]+': Value for "icon-size" is >= '+Wc+'. Reduce your "icon-size".'):"composite"===Y.kind&&((X=[xc*b.compositeIconSizes[0].evaluate(_,{},T),xc*b.compositeIconSizes[1].evaluate(_,{},T)])[0]>Zc||X[1]>Zc)&&k(e.layerIds[0]+': Value for "icon-size" is >= '+Wc+'. Reduce your "icon-size".'),e.addSymbols(e.icon,W,X,x,v,_,!1,t,L.lineStartIndex,L.lineLength,-1,T),R=e.icon.placedSymbolArray.length-1,Z&&(z=4*Z.length,e.addSymbols(e.icon,Z,X,x,v,_,rc.vertical,t,L.lineStartIndex,L.lineLength,-1,T),F=e.icon.placedSymbolArray.length-1)}for(var $ in n.horizontal){var K=n.horizontal[$];if(!S){j=ja(K.text);var J=s.layout.get("text-rotate").evaluate(_,{},T);S=new Fc(l,t,c,u,h,K,f,p,d,J)}var Q=1===K.positionedLines.length;if(D+=Yc(e,t,K,a,s,d,_,m,L,n.vertical?rc.horizontal:rc.horizontalOnly,Q?Object.keys(n.horizontal):[$],B,R,b,T),Q)break}n.vertical&&(O+=Yc(e,t,n.vertical,a,s,d,_,m,L,rc.vertical,["vertical"],B,F,b,T));var ee=S?S.boxStartIndex:e.collisionBoxArray.length,te=S?S.boxEndIndex:e.collisionBoxArray.length,re=C?C.boxStartIndex:e.collisionBoxArray.length,ne=C?C.boxEndIndex:e.collisionBoxArray.length,ie=E?E.boxStartIndex:e.collisionBoxArray.length,ae=E?E.boxEndIndex:e.collisionBoxArray.length,oe=I?I.boxStartIndex:e.collisionBoxArray.length,se=I?I.boxEndIndex:e.collisionBoxArray.length,le=-1,ce=function(e,t){return e&&e.circleDiameter?Math.max(e.circleDiameter,t):t};le=ce(S,le),le=ce(C,le),le=ce(E,le);var ue=(le=ce(I,le))>-1?1:0;ue&&(le*=A/Sl),e.glyphOffsetArray.length>=iu.MAX_GLYPHS&&k("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,_.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,j,ee,te,re,ne,ie,ae,oe,se,c,D,O,P,z,ue,0,f,N,U,le)}(e,h,s,r,n,i,f,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,y,b,A,l,x,w,M,d,t,a,c,u,o)};if("line"===S)for(var L=0,P=Lc(t.geometry,0,0,fo,fo);L<P.length;L+=1)for(var z=P[L],D=0,O=Cc(z,_,T,r.vertical||m,n,24,v,e.overscaling,fo);D<O.length;D+=1){var R=O[D];(!m||!$c(e,m.text,E,R))&&I(z,R)}else if("line-center"===S)for(var F=0,B=t.geometry;F<B.length;F+=1){var j=B[F];if(j.length>1){var N=Ec(j,T,r.vertical||m,n,24,v);N&&I(j,N)}}else if("Polygon"===t.type)for(var U=0,V=Ds(t.geometry,0);U<V.length;U+=1){var q=V[U],H=Nc(q,16);I(q[0],new vc(H.x,H.y,0))}else if("LineString"===t.type)for(var G=0,W=t.geometry;G<W.length;G+=1){var Z=W[G];I(Z,new vc(Z[0].x,Z[0].y,0))}else if("Point"===t.type)for(var Y=0,X=t.geometry;Y<X.length;Y+=1)for(var $=0,K=X[Y];$<K.length;$+=1){var J=K[$];I([J],new vc(J.x,J.y,0))}}(e,a,p,j,n,u,h,f,m,N,o)},w=0,T=e.features;w<T.length;w+=1)b();a&&e.generateCollisionDebugBuffers()},e.perspective=function(e,t,r,n,i){var a,o=1/Math.tan(t/2);return e[0]=o/r,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,null!=i&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e},e.pick=function(e,t){for(var r={},n=0;n<t.length;n++){var i=t[n];i in e&&(r[i]=e[i])}return r},e.plugin=Pi,e.polygonIntersectsPolygon=_o,e.postMapLoadEvent=ce,e.postTurnstileEvent=se,e.potpack=Jl,e.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.register=ii,e.registerForPluginStateChange=function(e){return e({pluginStatus:Ai,pluginURL:Mi}),Ci.on("pluginStateChange",e),e},e.renderColorRamp=Ko,e.rotate=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l+a*s,e[1]=i*l+o*s,e[2]=n*-s+a*l,e[3]=i*-s+o*l,e},e.rotateX=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=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+c*n,e[5]=o*i+u*n,e[6]=s*i+h*n,e[7]=l*i+f*n,e[8]=c*i-a*n,e[9]=u*i-o*n,e[10]=h*i-s*n,e[11]=f*i-l*n,e},e.rotateZ=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],c=t[4],u=t[5],h=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+c*n,e[1]=o*i+u*n,e[2]=s*i+h*n,e[3]=l*i+f*n,e[4]=c*i-a*n,e[5]=u*i-o*n,e[6]=h*i-s*n,e[7]=f*i-l*n,e},e.scale=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,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.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},e.scale$2=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},e.setCacheLimits=function(e,t){he=e,fe=t},e.setRTLTextPlugin=function(e,t,r){if(void 0===r&&(r=!1),Ai===bi||Ai===wi||Ai===Ti)throw new Error("setRTLTextPlugin cannot be called multiple times.");Mi=j.resolveURL(e),Ai=bi,ki=t,Ei(),r||Li()},e.sphericalToCartesian=function(e){var t=e[0],r=e[1],n=e[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(n),y:t*Math.sin(r)*Math.sin(n),z:t*Math.cos(n)}},e.sqrLen=function(e){var t=e[0],r=e[1];return t*t+r*r},e.styleSpec=Oe,e.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},e.symbolSize=Tc,e.transformMat3=function(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e},e.transformMat4=Uo,e.translate=function(e,t,r){var n,i,a,o,s,l,c,u,h,f,p,d,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],f=t[9],p=t[10],d=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=f,e[10]=p,e[11]=d,e[12]=n*m+s*g+h*y+t[12],e[13]=i*m+l*g+f*y+t[13],e[14]=a*m+c*g+p*y+t[14],e[15]=o*m+u*g+d*y+t[15]),e},e.triggerPluginCompletionEvent=Si,e.uniqueId=m,e.validateCustomStyleLayer=function(e){var t=[],r=e.id;return void 0===r&&t.push({message:"layers."+r+': missing required property "id"'}),void 0===e.render&&t.push({message:"layers."+r+': missing required method "render"'}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),t},e.validateLight=Yn,e.validateStyle=Zn,e.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},e.vectorTile=Ks,e.version=r,e.warnOnce=k,e.webpSupported=U,e.window=s,e.wrap=f})),n(0,(function(e){function t(e){var r=typeof e;if("number"===r||"boolean"===r||"string"===r||null==e)return JSON.stringify(e);if(Array.isArray(e)){for(var n="[",i=0,a=e;i<a.length;i+=1)n+=t(a[i])+",";return n+"]"}for(var o=Object.keys(e).sort(),s="{",l=0;l<o.length;l++)s+=JSON.stringify(o[l])+":"+t(e[o[l]])+",";return s+"}"}function r(r){for(var n="",i=0,a=e.refProperties;i<a.length;i+=1)n+="/"+t(r[a[i]]);return n}var n=function(e){this.keyCache={},e&&this.replace(e)};n.prototype.replace=function(e){this._layerConfigs={},this._layers={},this.update(e,[])},n.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 l=this._layers[s.id]=e.createStyleLayer(s);l._featureFilter=e.featureFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var c=0,u=n;c<u.length;c+=1){var h=u[c];delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}this.familiesBySource={};for(var f=function(e,t){for(var n={},i=0;i<e.length;i++){var a=t&&t[e[i].id]||r(e[i]);t&&(t[e[i].id]=a);var o=n[a];o||(o=n[a]=[]),o.push(e[i])}var s=[];for(var l in n)s.push(n[l]);return s}(e.values(this._layerConfigs),this.keyCache),p=0,d=f;p<d.length;p+=1){var m=d[p].map((function(e){return i._layers[e.id]})),g=m[0];if("none"!==g.visibility){var y=g.source||"",v=this.familiesBySource[y];v||(v=this.familiesBySource[y]={});var x=g.sourceLayer||"_geojsonTileLayer",_=v[x];_||(_=v[x]=[]),_.push(m)}}};var i=function(t){var r={},n=[];for(var i in t){var a=t[i],o=r[i]={};for(var s in a){var l=a[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var c={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};n.push(c),o[s]={rect:c,metrics:l.metrics}}}}var u=e.potpack(n),h=u.w,f=u.h,p=new e.AlphaImage({width:h||1,height:f||1});for(var d in t){var m=t[d];for(var g in m){var y=m[+g];if(y&&0!==y.bitmap.width&&0!==y.bitmap.height){var v=r[d][g].rect;e.AlphaImage.copy(y.bitmap,p,{x:0,y:0},{x:v.x+1,y:v.y+1},y.bitmap)}}}this.image=p,this.positions=r};e.register("GlyphAtlas",i);var a=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};function o(t,r,n){for(var i=new e.EvaluationParameters(r),a=0,o=t;a<o.length;a+=1)o[a].recalculate(i,n)}function s(t,r){var n=e.getArrayBuffer(t.request,(function(t,n,i,a){t?r(t):n&&r(null,{vectorTile:new e.vectorTile.VectorTile(new e.pbf(n)),rawData:n,cacheControl:i,expires:a})}));return function(){n.cancel(),r()}}a.prototype.parse=function(t,r,n,a,s){var l=this;this.status="parsing",this.data=t,this.collisionBoxArray=new e.CollisionBoxArray;var c=new e.DictionaryCoder(Object.keys(t.layers).sort()),u=new e.FeatureIndex(this.tileID,this.promoteId);u.bucketLayerIDs=[];var h={},f={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},p=r.familiesBySource[this.source];for(var d in p){var m=t.layers[d];if(m){1===m.version&&e.warnOnce('Vector tile source "'+this.source+'" layer "'+d+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var g=c.encode(d),y=[],v=0;v<m.length;v++){var x=m.feature(v),_=u.getId(x,d);y.push({feature:x,id:_,index:v,sourceLayerIndex:g})}for(var b=0,w=p[d];b<w.length;b+=1){var T=w[b],k=T[0];k.minzoom&&this.zoom<Math.floor(k.minzoom)||k.maxzoom&&this.zoom>=k.maxzoom||"none"===k.visibility||(o(T,this.zoom,n),(h[k.id]=k.createBucket({index:u.bucketLayerIDs.length,layers:T,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:g,sourceID:this.source})).populate(y,f,this.tileID.canonical),u.bucketLayerIDs.push(T.map((function(e){return e.id}))))}}}var A,M,S,E,C=e.mapObject(f.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(C).length?a.send("getGlyphs",{uid:this.uid,stacks:C},(function(e,t){A||(A=e,M=t,P.call(l))})):M={};var I=Object.keys(f.iconDependencies);I.length?a.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"icons"},(function(e,t){A||(A=e,S=t,P.call(l))})):S={};var L=Object.keys(f.patternDependencies);function P(){if(A)return s(A);if(M&&S&&E){var t=new i(M),r=new e.ImageAtlas(S,E);for(var a in h){var l=h[a];l instanceof e.SymbolBucket?(o(l.layers,this.zoom,n),e.performSymbolLayout(l,M,t.positions,S,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof e.LineBucket||l instanceof e.FillBucket||l instanceof e.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(f,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:e.values(h).filter((function(e){return!e.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?M:null,iconMap:this.returnDependencies?S:null,glyphPositions:this.returnDependencies?t.positions:null})}}L.length?a.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},(function(e,t){A||(A=e,E=t,P.call(l))})):E={},P.call(this)};var l=function(e,t,r,n){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(t,r){var n=this,i=t.uid;this.loading||(this.loading={});var o=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request),s=this.loading[i]=new a(t);s.abort=this.loadVectorData(t,(function(t,a){if(delete n.loading[i],t||!a)return s.status="done",n.loaded[i]=s,r(t);var l=a.rawData,c={};a.expires&&(c.expires=a.expires),a.cacheControl&&(c.cacheControl=a.cacheControl);var u={};if(o){var h=o.finish();h&&(u.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(t,n){if(t||!n)return r(t);r(null,e.extend({rawTileData:l.slice(0)},n,c,u))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},l.prototype.reloadTile=function(e,t){var r=this,n=this.loaded,i=e.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=e.showCollisionBoxes;var s=function(e,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),t(e,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(e,t){var r=this.loading,n=e.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),t()},l.prototype.removeTile=function(e,t){var r=this.loaded,n=e.uid;r&&r[n]&&delete r[n],t()};var c=e.window.ImageBitmap,u=function(){this.loaded={}};u.prototype.loadTile=function(t,r){var n=t.uid,i=t.encoding,a=t.rawImageData,o=c&&a instanceof c?this.getImageData(a):a,s=new e.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},u.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 r=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:r.width,height:r.height},r.data)},u.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]};var h=function e(t,r){var n,i=t&&t.type;if("FeatureCollection"===i)for(n=0;n<t.features.length;n++)e(t.features[n],r);else if("GeometryCollection"===i)for(n=0;n<t.geometries.length;n++)e(t.geometries[n],r);else if("Feature"===i)e(t.geometry,r);else if("Polygon"===i)f(t.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<t.coordinates.length;n++)f(t.coordinates[n],r);return t};function f(e,t){if(0!==e.length){p(e[0],t);for(var r=1;r<e.length;r++)p(e[r],!t)}}function p(e,t){for(var r=0,n=0,i=e.length,a=i-1;n<i;a=n++)r+=(e[n][0]-e[a][0])*(e[a][1]+e[n][1]);r>=0!=!!t&&e.reverse()}var d=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=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))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,n=this._feature.geometry;r<n.length;r+=1){var i=n[r];t.push([new e.Point$1(i[0],i[1])])}return t}for(var a=[],o=0,s=this._feature.geometry;o<s.length;o+=1){for(var l=[],c=0,u=s[o];c<u.length;c+=1){var h=u[c];l.push(new e.Point$1(h[0],h[1]))}a.push(l)}return a},m.prototype.toGeoJSON=function(e,t,r){return d.call(this,e,t,r)};var g=function(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=t.length,this._features=t};g.prototype.feature=function(e){return new m(this._features[e])};var y=e.vectorTile.VectorTileFeature,v=x;function x(e,t){this.options=t||{},this.features=e,this.length=e.length}function _(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}x.prototype.feature=function(e){return new _(this.features[e],this.options.extent)},_.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var r=0;r<t.length;r++){for(var n=t[r],i=[],a=0;a<n.length;a++)i.push(new e.Point$1(n[a][0],n[a][1]));this.geometry.push(i)}return this.geometry},_.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var l=o[s];t=Math.min(t,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[t,n,r,i]},_.prototype.toGeoJSON=y.prototype.toGeoJSON;var b=k,w=k,T=v;function k(t){var r=new e.pbf;return function(e,t){for(var r in e.layers)t.writeMessage(3,A,e.layers[r])}(t,r),r.finish()}function A(e,t){t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var r,n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)n.feature=e.feature(r),t.writeMessage(2,M,n);var i=n.keys;for(r=0;r<i.length;r++)t.writeStringField(3,i[r]);var a=n.values;for(r=0;r<a.length;r++)t.writeMessage(4,L,a[r])}function M(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,S,e),t.writeVarintField(3,r.type),t.writeMessage(4,I,r)}function S(e,t){var r=e.feature,n=e.keys,i=e.values,a=e.keycache,o=e.valuecache;for(var s in r.properties){var l=a[s];typeof l>"u"&&(n.push(s),l=n.length-1,a[s]=l),t.writeVarint(l);var c=r.properties[s],u=typeof c;"string"!==u&&"boolean"!==u&&"number"!==u&&(c=JSON.stringify(c));var h=u+":"+c,f=o[h];typeof f>"u"&&(i.push(c),f=i.length-1,o[h]=f),t.writeVarint(f)}}function E(e,t){return(t<<3)+(7&e)}function C(e){return e<<1^e>>31}function I(e,t){for(var r=e.loadGeometry(),n=e.type,i=0,a=0,o=r.length,s=0;s<o;s++){var l=r[s],c=1;1===n&&(c=l.length),t.writeVarint(E(1,c));for(var u=3===n?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==n&&t.writeVarint(E(2,u-1));var f=l[h].x-i,p=l[h].y-a;t.writeVarint(C(f)),t.writeVarint(C(p)),i+=f,a+=p}3===n&&t.writeVarint(E(7,1))}}function L(e,t){var r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}function P(e,t,r,n,i,a){if(!(i-n<=r)){var o=n+i>>1;z(e,t,o,n,i,a%2),P(e,t,r,n,o-1,a+1),P(e,t,r,o+1,i,a+1)}}function z(e,t,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);z(e,t,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}var h=t[2*r+a],f=n,p=i;for(D(e,t,n,r),t[2*i+a]>h&&D(e,t,n,i);f<p;){for(D(e,t,f,p),f++,p--;t[2*f+a]<h;)f++;for(;t[2*p+a]>h;)p--}t[2*n+a]===h?D(e,t,n,p):D(e,t,++p,i),p<=r&&(n=p+1),r<=p&&(i=p-1)}}function D(e,t,r,n){O(e,r,n),O(t,2*r,2*n),O(t,2*r+1,2*n+1)}function O(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function R(e,t,r,n){var i=e-r,a=t-n;return i*i+a*a}b.fromVectorTileJs=w,b.fromGeojsonVt=function(e,t){t=t||{};var r={};for(var n in e)r[n]=new v(e[n].features,t),r[n].name=n,r[n].version=t.version,r[n].extent=t.extent;return k({layers:r})},b.GeoJSONWrapper=T;var F=function(e){return e[0]},B=function(e){return e[1]},j=function(e,t,r,n,i){void 0===t&&(t=F),void 0===r&&(r=B),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=e;for(var a=e.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(e.length),s=this.coords=new i(2*e.length),l=0;l<e.length;l++)o[l]=l,s[2*l]=t(e[l]),s[2*l+1]=r(e[l]);P(o,s,n,0,o.length-1,0)};j.prototype.range=function(e,t,r,n){return function(e,t,r,n,i,a,o){for(var s,l,c=[0,e.length-1,0],u=[];c.length;){var h=c.pop(),f=c.pop(),p=c.pop();if(f-p<=o)for(var d=p;d<=f;d++)s=t[2*d],l=t[2*d+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(e[d]);else{var m=Math.floor((p+f)/2);s=t[2*m],l=t[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(e[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(c.push(p),c.push(m-1),c.push(g)),(0===h?i>=s:a>=l)&&(c.push(m+1),c.push(f),c.push(g))}}return u}(this.ids,this.coords,e,t,r,n,this.nodeSize)},j.prototype.within=function(e,t,r){return function(e,t,r,n,i,a){for(var o=[0,e.length-1,0],s=[],l=i*i;o.length;){var c=o.pop(),u=o.pop(),h=o.pop();if(u-h<=a)for(var f=h;f<=u;f++)R(t[2*f],t[2*f+1],r,n)<=l&&s.push(e[f]);else{var p=Math.floor((h+u)/2),d=t[2*p],m=t[2*p+1];R(d,m,r,n)<=l&&s.push(e[p]);var g=(c+1)%2;(0===c?r-i<=d:n-i<=m)&&(o.push(h),o.push(p-1),o.push(g)),(0===c?r+i>=d:n+i>=m)&&(o.push(p+1),o.push(u),o.push(g))}}return s}(this.ids,this.coords,e,t,r,this.nodeSize)};var N={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},U=function(e){this.options=$(Object.create(N),e),this.trees=new Array(this.options.maxZoom+1)};function V(e,t,r,n,i){return{x:e,y:t,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function q(e,t){var r=e.geometry.coordinates,n=r[0],i=r[1];return{x:W(n),y:Z(i),zoom:1/0,index:t,parentId:-1}}function H(e){return{type:"Feature",id:e.id,properties:G(e),geometry:{type:"Point",coordinates:[Y(e.x),X(e.y)]}}}function G(e){var t=e.numPoints,r=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return $($({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function W(e){return e/360+.5}function Z(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Y(e){return 360*(e-.5)}function X(e){var t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function $(e,t){for(var r in t)e[r]=t[r];return e}function K(e){return e.x}function J(e){return e.y}function Q(e,t,r,n){for(var i,a=n,o=r-t>>1,s=r-t,l=e[t],c=e[t+1],u=e[r],h=e[r+1],f=t+3;f<r;f+=3){var p=ee(e[f],e[f+1],l,c,u,h);if(p>a)i=f,a=p;else if(p===a){var d=Math.abs(f-o);d<s&&(i=f,s=d)}}a>n&&(i-t>3&&Q(e,t,i,n),e[i+2]=a,r-i>3&&Q(e,i,r,n))}function ee(e,t,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((e-r)*o+(t-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=e-r)*o+(s=t-n)*s}function te(e,t,r,n){var i={id:typeof e>"u"?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)re(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<t.length;n++)re(e,t[n]);else if("MultiPolygon"===r)for(n=0;n<t.length;n++)for(var i=0;i<t[n].length;i++)re(e,t[n][i])}(i),i}function re(e,t){for(var r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function ne(e,t,r,n){if(t.geometry){var i=t.geometry.coordinates,a=t.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===a)ie(i,s);else if("MultiPoint"===a)for(var c=0;c<i.length;c++)ie(i[c],s);else if("LineString"===a)ae(i,s,o,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(c=0;c<i.length;c++)s=[],ae(i[c],s,o,!1),e.push(te(l,"LineString",s,t.properties));return}oe(i,s,o,!1)}else if("Polygon"===a)oe(i,s,o,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(c=0;c<t.geometry.geometries.length;c++)ne(e,{id:l,geometry:t.geometry.geometries[c],properties:t.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<i.length;c++){var u=[];oe(i[c],u,o,!0),s.push(u)}}e.push(te(l,a,s,t.properties))}}function ie(e,t){t.push(se(e[0])),t.push(le(e[1])),t.push(0)}function ae(e,t,r,n){for(var i,a,o=0,s=0;s<e.length;s++){var l=se(e[s][0]),c=le(e[s][1]);t.push(l),t.push(c),t.push(0),s>0&&(o+=n?(i*c-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-a,2))),i=l,a=c}var u=t.length-3;t[2]=1,Q(t,0,u,r),t[u+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function oe(e,t,r,n){for(var i=0;i<e.length;i++){var a=[];ae(e[i],a,r,n),t.push(a)}}function se(e){return e/360+.5}function le(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function ce(e,t,r,n,i,a,o,s){if(n/=t,a>=(r/=t)&&o<n)return e;if(o<r||a>=n)return null;for(var l=[],c=0;c<e.length;c++){var u=e[c],h=u.geometry,f=u.type,p=0===i?u.minX:u.minY,d=0===i?u.maxX:u.maxY;if(p>=r&&d<n)l.push(u);else if(!(d<r||p>=n)){var m=[];if("Point"===f||"MultiPoint"===f)ue(h,m,r,n,i);else if("LineString"===f)he(h,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===f)pe(h,m,r,n,i,!1);else if("Polygon"===f)pe(h,m,r,n,i,!0);else if("MultiPolygon"===f)for(var g=0;g<h.length;g++){var y=[];pe(h[g],y,r,n,i,!0),y.length&&m.push(y)}if(m.length){if(s.lineMetrics&&"LineString"===f){for(g=0;g<m.length;g++)l.push(te(u.id,f,m[g],u.tags));continue}("LineString"===f||"MultiLineString"===f)&&(1===m.length?(f="LineString",m=m[0]):f="MultiLineString"),("Point"===f||"MultiPoint"===f)&&(f=3===m.length?"Point":"MultiPoint"),l.push(te(u.id,f,m,u.tags))}}}return l.length?l:null}function ue(e,t,r,n,i){for(var a=0;a<e.length;a+=3){var o=e[a+i];o>=r&&o<=n&&(t.push(e[a]),t.push(e[a+1]),t.push(e[a+2]))}}function he(e,t,r,n,i,a,o){for(var s,l,c=fe(e),u=0===i?me:ge,h=e.start,f=0;f<e.length-3;f+=3){var p=e[f],d=e[f+1],m=e[f+2],g=e[f+3],y=e[f+4],v=0===i?p:d,x=0===i?g:y,_=!1;o&&(s=Math.sqrt(Math.pow(p-g,2)+Math.pow(d-y,2))),v<r?x>r&&(l=u(c,p,d,g,y,r),o&&(c.start=h+s*l)):v>n?x<n&&(l=u(c,p,d,g,y,n),o&&(c.start=h+s*l)):de(c,p,d,m),x<r&&v>=r&&(l=u(c,p,d,g,y,r),_=!0),x>n&&v<=n&&(l=u(c,p,d,g,y,n),_=!0),!a&&_&&(o&&(c.end=h+s*l),t.push(c),c=fe(e)),o&&(h+=s)}var b=e.length-3;p=e[b],d=e[b+1],m=e[b+2],(v=0===i?p:d)>=r&&v<=n&&de(c,p,d,m),b=c.length-3,a&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&de(c,c[0],c[1],c[2]),c.length&&t.push(c)}function fe(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function pe(e,t,r,n,i,a){for(var o=0;o<e.length;o++)he(e[o],t,r,n,i,a,!1)}function de(e,t,r,n){e.push(t),e.push(r),e.push(n)}function me(e,t,r,n,i,a){var o=(a-t)/(n-t);return e.push(a),e.push(r+(i-r)*o),e.push(1),o}function ge(e,t,r,n,i,a){var o=(a-r)/(i-r);return e.push(t+(n-t)*o),e.push(a),e.push(1),o}function ye(e,t){for(var r=[],n=0;n<e.length;n++){var i,a=e[n],o=a.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)i=ve(a.geometry,t);else if("MultiLineString"===o||"Polygon"===o){i=[];for(var s=0;s<a.geometry.length;s++)i.push(ve(a.geometry[s],t))}else if("MultiPolygon"===o)for(i=[],s=0;s<a.geometry.length;s++){for(var l=[],c=0;c<a.geometry[s].length;c++)l.push(ve(a.geometry[s][c],t));i.push(l)}r.push(te(a.id,o,i,a.tags))}return r}function ve(e,t){var r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(var n=0;n<e.length;n+=3)r.push(e[n]+t,e[n+1],e[n+2]);return r}function xe(e,t){if(e.transformed)return e;var r,n,i,a=1<<e.z,o=e.x,s=e.y;for(r=0;r<e.features.length;r++){var l=e.features[r],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(n=0;n<c.length;n+=2)l.geometry.push(_e(c[n],c[n+1],t,a,o,s));else for(n=0;n<c.length;n++){var h=[];for(i=0;i<c[n].length;i+=2)h.push(_e(c[n][i],c[n][i+1],t,a,o,s));l.geometry.push(h)}}return e.transformed=!0,e}function _e(e,t,r,n,i,a){return[Math.round(r*(e*n-i)),Math.round(r*(t*n-a))]}function be(e,t,r,n,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:r,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<e.length;s++){o.numFeatures++,we(o,e[s],a,i);var l=e[s].minX,c=e[s].minY,u=e[s].maxX,h=e[s].maxY;l<o.minX&&(o.minX=l),c<o.minY&&(o.minY=c),u>o.maxX&&(o.maxX=u),h>o.maxY&&(o.maxY=h)}return o}function we(e,t,r,n){var i=t.geometry,a=t.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s<i.length;s+=3)o.push(i[s]),o.push(i[s+1]),e.numPoints++,e.numSimplified++;else if("LineString"===a)Te(o,i,e,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(s=0;s<i.length;s++)Te(o,i[s],e,r,"Polygon"===a,0===s);else if("MultiPolygon"===a)for(var l=0;l<i.length;l++){var c=i[l];for(s=0;s<c.length;s++)Te(o,c[s],e,r,!0,0===s)}if(o.length){var u=t.tags||null;if("LineString"===a&&n.lineMetrics){for(var h in u={},t.tags)u[h]=t.tags[h];u.mapbox_clip_start=i.start/i.size,u.mapbox_clip_end=i.end/i.size}var f={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:u};null!==t.id&&(f.id=t.id),e.features.push(f)}}function Te(e,t,r,n,i,a){var o=n*n;if(n>0&&t.size<(i?o:n))r.numPoints+=t.length/3;else{for(var s=[],l=0;l<t.length;l+=3)(0===n||t[l+2]>o)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;i&&function(e,t){for(var r=0,n=0,i=e.length,a=i-2;n<i;a=n,n+=2)r+=(e[n]-e[a])*(e[n+1]+e[a+1]);if(r>0===t)for(n=0,i=e.length;n<i/2;n+=2){var o=e[n],s=e[n+1];e[n]=e[i-2-n],e[n+1]=e[i-1-n],e[i-2-n]=o,e[i-1-n]=s}}(s,a),e.push(s)}}function ke(e,t){t=this.options=function(e,t){for(var r in t)e[r]=t[r];return e}(Object.create(this.options),t);var r=t.debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(e,t){var r=[];if("FeatureCollection"===e.type)for(var n=0;n<e.features.length;n++)ne(r,e.features[n],t,n);else"Feature"===e.type?ne(r,e,t):ne(r,{geometry:e},t);return r}(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(e,t){var r=t.buffer/t.extent,n=e,i=ce(e,1,-1-r,r,0,-1,2,t),a=ce(e,1,1-r,2+r,0,-1,2,t);return(i||a)&&(n=ce(e,1,-r,1+r,0,-1,2,t)||[],i&&(n=ye(i,1).concat(n)),a&&(n=n.concat(ye(a,-1)))),n}(n,t),n.length&&this.splitTile(n,0,0,0),r&&(n.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)))}function Ae(e,t,r){return 32*((1<<e)*r+t)+e}function Me(e,t){var r=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return t(null,null);var i=new g(n.features),a=b(i);(0!==a.byteOffset||a.byteLength!==a.buffer.byteLength)&&(a=new Uint8Array(a)),t(null,{vectorTile:i,rawData:a.buffer})}U.prototype.load=function(e){var t=this.options,r=t.log,n=t.minZoom,i=t.maxZoom,a=t.nodeSize;r&&console.time("total time");var o="prepare "+e.length+" points";r&&console.time(o),this.points=e;for(var s=[],l=0;l<e.length;l++)e[l].geometry&&s.push(q(e[l],l));this.trees[i+1]=new j(s,K,J,a,Float32Array),r&&console.timeEnd(o);for(var c=i;c>=n;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new j(s,K,J,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},U.prototype.getClusters=function(e,t){var r=((e[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],t),s=this.getClusters([-180,n,i,a],t);return o.concat(s)}for(var l=this.trees[this._limitZoom(t)],c=[],u=0,h=l.range(W(r),Z(a),W(i),Z(n));u<h.length;u+=1){var f=h[u],p=l.points[f];c.push(p.numPoints?H(p):this.points[p.index])}return c},U.prototype.getChildren=function(e){var t=this._getOriginId(e),r=this._getOriginZoom(e),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);var a=i.points[t];if(!a)throw new Error(n);for(var o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],l=0,c=i.within(a.x,a.y,o);l<c.length;l+=1){var u=c[l],h=i.points[u];h.parentId===e&&s.push(h.numPoints?H(h):this.points[h.index])}if(0===s.length)throw new Error(n);return s},U.prototype.getLeaves=function(e,t,r){t=t||10,r=r||0;var n=[];return this._appendLeaves(n,e,t,r,0),n},U.prototype.getTile=function(e,t,r){var n=this.trees[this._limitZoom(e)],i=Math.pow(2,e),a=this.options,o=a.extent,s=a.radius/o,l=(r-s)/i,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((t-s)/i,l,(t+1+s)/i,c),n.points,t,r,i,u),0===t&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.points,i,r,i,u),t===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.points,-1,r,i,u),u.features.length?u:null},U.prototype.getClusterExpansionZoom=function(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t},U.prototype._appendLeaves=function(e,t,r,n,i){for(var a=0,o=this.getChildren(t);a<o.length;a+=1){var s=o[a],l=s.properties;if(l&&l.cluster?i+l.point_count<=n?i+=l.point_count:i=this._appendLeaves(e,l.cluster_id,r,n,i):i<n?i++:e.push(s),e.length===r)break}return i},U.prototype._addTileFeatures=function(e,t,r,n,i,a){for(var o=0,s=e;o<s.length;o+=1){var l=t[s[o]],c=l.numPoints,u={type:1,geometry:[[Math.round(this.options.extent*(l.x*i-r)),Math.round(this.options.extent*(l.y*i-n))]],tags:c?G(l):this.points[l.index].properties},h=void 0;c?h=l.id:this.options.generateId?h=l.index:this.points[l.index].id&&(h=this.points[l.index].id),void 0!==h&&(u.id=h),a.features.push(u)}},U.prototype._limitZoom=function(e){return Math.max(this.options.minZoom,Math.min(+e,this.options.maxZoom+1))},U.prototype._cluster=function(e,t){for(var r=[],n=this.options,i=n.radius,a=n.extent,o=n.reduce,s=n.minPoints,l=i/(a*Math.pow(2,t)),c=0;c<e.length;c++){var u=e[c];if(!(u.zoom<=t)){u.zoom=t;for(var h=this.trees[t+1],f=h.within(u.x,u.y,l),p=u.numPoints||1,d=p,m=0,g=f;m<g.length;m+=1){var y=g[m],v=h.points[y];v.zoom>t&&(d+=v.numPoints||1)}if(d>=s){for(var x=u.x*p,_=u.y*p,b=o&&p>1?this._map(u,!0):null,w=(c<<5)+(t+1)+this.points.length,T=0,k=f;T<k.length;T+=1){var A=k[T],M=h.points[A];if(!(M.zoom<=t)){M.zoom=t;var S=M.numPoints||1;x+=M.x*S,_+=M.y*S,M.parentId=w,o&&(b||(b=this._map(u,!0)),o(b,this._map(M)))}}u.parentId=w,r.push(V(x/d,_/d,w,d,b))}else if(r.push(u),d>1)for(var E=0,C=f;E<C.length;E+=1){var I=C[E],L=h.points[I];L.zoom<=t||(L.zoom=t,r.push(L))}}}return r},U.prototype._getOriginId=function(e){return e-this.points.length>>5},U.prototype._getOriginZoom=function(e){return(e-this.points.length)%32},U.prototype._map=function(e,t){if(e.numPoints)return t?$({},e.properties):e.properties;var r=this.points[e.index].properties,n=this.options.map(r);return t&&n===r?$({},n):n},ke.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ke.prototype.splitTile=function(e,t,r,n,i,a,o){for(var s=[e,t,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var u=1<<t,h=Ae(t,r,n),f=this.tiles[h];if(!f&&(c>1&&console.time("creation"),f=this.tiles[h]=be(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,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===l.maxZoom||t===i)continue;var d=1<<i-t;if(r!==Math.floor(a/d)||n!==Math.floor(o/d))continue}else if(t===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue;if(f.source=null,0!==e.length){c>1&&console.time("clipping");var m,g,y,v,x,_,b=.5*l.buffer/l.extent,w=.5-b,T=.5+b,k=1+b;m=g=y=v=null,x=ce(e,u,r-b,r+T,0,f.minX,f.maxX,l),_=ce(e,u,r+w,r+k,0,f.minX,f.maxX,l),e=null,x&&(m=ce(x,u,n-b,n+T,1,f.minY,f.maxY,l),g=ce(x,u,n+w,n+k,1,f.minY,f.maxY,l),x=null),_&&(y=ce(_,u,n-b,n+T,1,f.minY,f.maxY,l),v=ce(_,u,n+w,n+k,1,f.minY,f.maxY,l),_=null),c>1&&console.timeEnd("clipping"),s.push(m||[],t+1,2*r,2*n),s.push(g||[],t+1,2*r,2*n+1),s.push(y||[],t+1,2*r+1,2*n),s.push(v||[],t+1,2*r+1,2*n+1)}}},ke.prototype.getTile=function(e,t,r){var n=this.options,i=n.extent,a=n.debug;if(e<0||e>24)return null;var o=1<<e,s=Ae(e,t=(t%o+o)%o,r);if(this.tiles[s])return xe(this.tiles[s],i);a>1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,c=e,u=t,h=r;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[Ae(c,u,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,u,h),a>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?xe(this.tiles[s],i):null):null};var Se=function(t){function r(e,r,n,i){t.call(this,e,r,n,Me),i&&(this.loadGeoJSON=i)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new e.RequestPerformance(n.request);this.loadGeoJSON(n,(function(a,o){if(a||!o)return r(a);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));h(o,!0);try{if(n.filter){var s=e.createExpression(n.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(e){return e.key+": "+e.message})).join(", "));var l=o.features.filter((function(e){return s.value.evaluate({zoom:0},e)}));o={type:"FeatureCollection",features:l}}t._geoJSONIndex=n.cluster?new U(function(t){var r=t.superclusterOptions,n=t.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),c=0,u=l;c<u.length;c+=1){var h=u[c],f=n[h],p=f[0],d=f[1],m=e.createExpression(d),g=e.createExpression("string"==typeof p?[p,["accumulated"],["get",h]]:p);i[h]=m.value,a[h]=g.value}return r.map=function(e){s.properties=e;for(var t={},r=0,n=l;r<n.length;r+=1){var a=n[r];t[a]=i[a].evaluate(o,s)}return t},r.reduce=function(e,t){s.properties=t;for(var r=0,n=l;r<n.length;r+=1){var i=n[r];o.accumulated=e[i],e[i]=a[i].evaluate(o,s)}},r}(n)).load(o.features):function(e,t){return new ke(e,t)}(o,n.geojsonVtOptions)}catch(e){return r(e)}t.loaded={};var c={};if(i){var u=i.finish();u&&(c.resourceTiming={},c.resourceTiming[n.source]=JSON.parse(JSON.stringify(u)))}r(null,c)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(e,r){var n=this.loaded,i=e.uid;return n&&n[i]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},r.prototype.loadGeoJSON=function(t,r){if(t.request)e.getJSON(t.request,r);else{if("string"!=typeof t.data)return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(t.data))}catch{return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()},r.prototype.getClusterExpansionZoom=function(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}},r.prototype.getClusterChildren=function(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}},r.prototype.getClusterLeaves=function(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}},r}(l),Ee=function(t){var r=this;this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:Se},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(e,t){if(r.workerSourceTypes[e])throw new Error('Worker source with name "'+e+'" already registered.');r.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=function(t){if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText}};return Ee.prototype.setReferrer=function(e,t){this.referrer=t},Ee.prototype.setImages=function(e,t,r){for(var n in this.availableImages[e]=t,this.workerSources[e]){var i=this.workerSources[e][n];for(var a in i)i[a].availableImages=t}r()},Ee.prototype.setLayers=function(e,t,r){this.getLayerIndex(e).replace(t),r()},Ee.prototype.updateLayers=function(e,t,r){this.getLayerIndex(e).update(t.layers,t.removedIds),r()},Ee.prototype.loadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).loadTile(t,r)},Ee.prototype.loadDEMTile=function(e,t,r){this.getDEMWorkerSource(e,t.source).loadTile(t,r)},Ee.prototype.reloadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).reloadTile(t,r)},Ee.prototype.abortTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).abortTile(t,r)},Ee.prototype.removeTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).removeTile(t,r)},Ee.prototype.removeDEMTile=function(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t)},Ee.prototype.removeSource=function(e,t,r){if(this.workerSources[e]&&this.workerSources[e][t.type]&&this.workerSources[e][t.type][t.source]){var n=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==n.removeSource?n.removeSource(t,r):r()}},Ee.prototype.loadWorkerSource=function(e,t,r){try{this.self.importScripts(t.url),r()}catch(e){r(e.toString())}},Ee.prototype.syncRTLPluginState=function(t,r,n){try{e.plugin.setState(r);var i=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&null!=i){this.self.importScripts(i);var a=e.plugin.isParsed();n(a?void 0:new Error("RTL Text Plugin failed to import scripts from "+i),a)}}catch(e){n(e.toString())}},Ee.prototype.getAvailableImages=function(e){var t=this.availableImages[e];return t||(t=[]),t},Ee.prototype.getLayerIndex=function(e){var t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new n),t},Ee.prototype.getWorkerSource=function(e,t,r){var n=this;if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){var i={send:function(t,r,i){n.actor.send(t,r,i,e)}};this.workerSources[e][t][r]=new this.workerSourceTypes[t](i,this.getLayerIndex(e),this.getAvailableImages(e))}return this.workerSources[e][t][r]},Ee.prototype.getDEMWorkerSource=function(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new u),this.demWorkerSources[e][t]},Ee.prototype.enforceCacheSizeLimit=function(t,r){e.enforceCacheSizeLimit(r)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Ee(self)),Ee})),n(0,(function(e){var t=e.createCommonjsModule((function(e){function t(e){return!r(e)}function r(e){return typeof window<"u"&&typeof document<"u"?Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{t=new Worker(n),e=!0}catch{e=!1}return t&&t.terminate(),URL.revokeObjectURL(n),e}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var r=t.getImageData(0,0,1,1);return r&&r.width===e.width}()?function(e){return void 0===n[e]&&(n[e]=function(e){var r=function(e){var r=document.createElement("canvas"),n=Object.create(t.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=e,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n)}(e);if(!r)return!1;var n=r.createShader(r.VERTEX_SHADER);return!(!n||r.isContextLost())&&(r.shaderSource(n,"void main() {}"),r.compileShader(n),!0===r.getShaderParameter(n,r.COMPILE_STATUS))}(e)),n[e]}(e&&e.failIfMajorPerformanceCaveat)?void 0:"insufficient WebGL support":"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support":"not a browser"}e.exports?e.exports=t:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=t,window.mapboxgl.notSupportedReason=r);var n={};t.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r={create:function(t,r,n){var i=e.window.document.createElement(t);return void 0!==r&&(i.className=r),n&&n.appendChild(i),i},createNS:function(t,r){return e.window.document.createElementNS(t,r)}},n=e.window.document&&e.window.document.documentElement.style;function i(e){if(!n)return e[0];for(var t=0;t<e.length;t++)if(e[t]in n)return e[t];return e[0]}var a,o=i(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){n&&o&&(a=n[o],n[o]="none")},r.enableDrag=function(){n&&o&&(n[o]=a)};var s=i(["transform","WebkitTransform"]);r.setTransform=function(e,t){e.style[s]=t};var l=!1;try{var c=Object.defineProperty({},"passive",{get:function(){l=!0}});e.window.addEventListener("test",c,c),e.window.removeEventListener("test",c,c)}catch{l=!1}r.addEventListener=function(e,t,r,n){void 0===n&&(n={}),"passive"in n&&l?e.addEventListener(t,r,n):e.addEventListener(t,r,n.capture)},r.removeEventListener=function(e,t,r,n){void 0===n&&(n={}),"passive"in n&&l?e.removeEventListener(t,r,n):e.removeEventListener(t,r,n.capture)};var u=function(t){t.preventDefault(),t.stopPropagation(),e.window.removeEventListener("click",u,!0)};function h(e){var t=e.userImage;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}r.suppressClick=function(){e.window.addEventListener("click",u,!0),e.window.setTimeout((function(){e.window.removeEventListener("click",u,!0)}),0)},r.mousePos=function(t,r){var n=t.getBoundingClientRect();return new e.Point(r.clientX-n.left-t.clientLeft,r.clientY-n.top-t.clientTop)},r.touchPos=function(t,r){for(var n=t.getBoundingClientRect(),i=[],a=0;a<r.length;a++)i.push(new e.Point(r[a].clientX-n.left-t.clientLeft,r[a].clientY-n.top-t.clientTop));return i},r.mouseButton=function(t){return typeof e.window.InstallTrigger<"u"&&2===t.button&&t.ctrlKey&&e.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:t.button},r.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var f=function(t){function r(){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&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(e){if(this.loaded!==e&&(this.loaded=e,e)){for(var t=0,r=this.requestors;t<r.length;t+=1){var n=r[t],i=n.ids,a=n.callback;this._notify(i,a)}this.requestors=[]}},r.prototype.getImage=function(e){return this.images[e]},r.prototype.addImage=function(e,t){this._validate(e,t)&&(this.images[e]=t)},r.prototype._validate=function(t,r){var n=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new e.ErrorEvent(new Error('Image "'+t+'" has invalid "stretchX" value'))),n=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new e.ErrorEvent(new Error('Image "'+t+'" has invalid "stretchY" value'))),n=!1),this._validateContent(r.content,r)||(this.fire(new e.ErrorEvent(new Error('Image "'+t+'" has invalid "content" value'))),n=!1),n},r.prototype._validateStretch=function(e,t){if(!e)return!0;for(var r=0,n=0,i=e;n<i.length;n+=1){var a=i[n];if(a[0]<r||a[1]<a[0]||t<a[1])return!1;r=a[1]}return!0},r.prototype._validateContent=function(e,t){return!e||!(4!==e.length||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])},r.prototype.updateImage=function(e,t){var r=this.images[e];t.version=r.version+1,this.images[e]=t,this.updatedImages[e]=!0},r.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()},r.prototype.listImages=function(){return Object.keys(this.images)},r.prototype.getImages=function(e,t){var r=!0;if(!this.isLoaded())for(var n=0,i=e;n<i.length;n+=1){var a=i[n];this.images[a]||(r=!1)}this.isLoaded()||r?this._notify(e,t):this.requestors.push({ids:e,callback:t})},r.prototype._notify=function(t,r){for(var n={},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?n[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.')}r(null,n)},r.prototype.getPixelSize=function(){var e=this.atlasImage;return{width:e.width,height:e.height}},r.prototype.getPattern=function(t){var r=this.patterns[t],n=this.getImage(t);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{var i={w:n.data.width+2,h:n.data.height+2,x:0,y:0},a=new e.ImagePosition(i,n);this.patterns[t]={bin:i,position:a}}return this._updatePatternAtlas(),this.patterns[t].position},r.prototype.bind=function(t){var r=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new e.Texture(t,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},r.prototype._updatePatternAtlas=function(){var t=[];for(var r in this.patterns)t.push(this.patterns[r].bin);var n=e.potpack(t),i=n.w,a=n.h,o=this.atlasImage;for(var s in o.resize({width:i||1,height:a||1}),this.patterns){var l=this.patterns[s].bin,c=l.x+1,u=l.y+1,h=this.images[s].data,f=h.width,p=h.height;e.RGBAImage.copy(h,o,{x:0,y:0},{x:c,y:u},{width:f,height:p}),e.RGBAImage.copy(h,o,{x:0,y:p-1},{x:c,y:u-1},{width:f,height:1}),e.RGBAImage.copy(h,o,{x:0,y:0},{x:c,y:u+p},{width:f,height:1}),e.RGBAImage.copy(h,o,{x:f-1,y:0},{x:c-1,y:u},{width:1,height:p}),e.RGBAImage.copy(h,o,{x:0,y:0},{x:c+f,y:u},{width:1,height:p})}this.dirty=!0},r.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},r.prototype.dispatchRenderCallbacks=function(e){for(var t=0,r=e;t<r.length;t+=1){var n=r[t];if(!this.callbackDispatchedThisFrame[n]){this.callbackDispatchedThisFrame[n]=!0;var i=this.images[n];h(i)&&this.updateImage(n,i)}}},r}(e.Evented),p=g,d=g,m=1e20;function g(e,t,r,n,i,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.fontWeight=a||"normal",this.radius=r||8;var o=this.size=this.fontSize+2*this.buffer;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))}function y(e,t,r,n,i,a,o){for(var s=0;s<t;s++){for(var l=0;l<r;l++)n[l]=e[l*t+s];for(v(n,i,a,o,r),l=0;l<r;l++)e[l*t+s]=i[l]}for(l=0;l<r;l++){for(s=0;s<t;s++)n[s]=e[l*t+s];for(v(n,i,a,o,t),s=0;s<t;s++)e[l*t+s]=Math.sqrt(i[s])}}function v(e,t,r,n,i){r[0]=0,n[0]=-m,n[1]=+m;for(var a=1,o=0;a<i;a++){for(var s=(e[a]+a*a-(e[r[o]]+r[o]*r[o]))/(2*a-2*r[o]);s<=n[o];)o--,s=(e[a]+a*a-(e[r[o]]+r[o]*r[o]))/(2*a-2*r[o]);r[++o]=a,n[o]=s,n[o+1]=+m}for(a=0,o=0;a<i;a++){for(;n[o+1]<a;)o++;t[a]=(a-r[o])*(a-r[o])+e[r[o]]}}g.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),r=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var i=t.data[4*n+3]/255;this.gridOuter[n]=1===i?0:0===i?m:Math.pow(Math.max(0,.5-i),2),this.gridInner[n]=1===i?m:0===i?0:Math.pow(Math.max(0,i-.5),2)}for(y(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),y(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var a=this.gridOuter[n]-this.gridInner[n];r[n]=Math.max(0,Math.min(255,Math.round(255-255*(a/this.radius+this.cutoff))))}return r},p.default=d;var x=function(e,t){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={}};x.prototype.setURL=function(e){this.url=e},x.prototype.getGlyphs=function(t,r){var n=this,i=[];for(var a in t)for(var o=0,s=t[a];o<s.length;o+=1){var l=s[o];i.push({stack:a,id:l})}e.asyncAll(i,(function(e,t){var r=e.stack,i=e.id,a=n.entries[r];a||(a=n.entries[r]={glyphs:{},requests:{},ranges:{}});var o=a.glyphs[i];if(void 0===o){if(o=n._tinySDF(a,r,i))return a.glyphs[i]=o,void t(null,{stack:r,id:i,glyph:o});var s=Math.floor(i/256);if(256*s>65535)t(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])t(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,(function(e,t){if(t){for(var r in t)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=t[+r]);a.ranges[s]=!0}for(var i=0,o=l;i<o.length;i+=1)(0,o[i])(e,t);delete a.requests[s]}))),l.push((function(e,n){e?t(e):n&&t(null,{stack:r,id:i,glyph:n[i]||null})}))}}else t(null,{stack:r,id:i,glyph:o})}),(function(e,t){if(e)r(e);else if(t){for(var n={},i=0,a=t;i<a.length;i+=1){var o=a[i],s=o.stack,l=o.id,c=o.glyph;(n[s]||(n[s]={}))[l]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics}}r(null,n)}}))},x.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))},x.prototype._tinySDF=function(t,r,n){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(n)){var a=t.tinySDF;if(!a){var o="400";/bold/i.test(r)?o="900":/medium/i.test(r)?o="500":/light/i.test(r)&&(o="200"),a=t.tinySDF=new x.TinySDF(24,3,8,.25,i,o)}return{id:n,bitmap:new e.AlphaImage({width:30,height:30},a.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},x.loadGlyphRange=function(t,r,n,i,a){var o=256*r,s=o+255,l=i.transformRequest(i.normalizeGlyphsURL(n).replace("{fontstack}",t).replace("{range}",o+"-"+s),e.ResourceType.Glyphs);e.getArrayBuffer(l,(function(t,r){if(t)a(t);else if(r){for(var n={},i=0,o=e.parseGlyphPBF(r);i<o.length;i+=1){var s=o[i];n[s.id]=s}a(null,n)}}))},x.TinySDF=p;var _=function(){this.specification=e.styleSpec.light.position};_.prototype.possiblyEvaluate=function(t,r){return e.sphericalToCartesian(t.expression.evaluate(r))},_.prototype.interpolate=function(t,r,n){return{x:e.number(t.x,r.x,n),y:e.number(t.y,r.y,n),z:e.number(t.z,r.z,n)}};var b=new e.Properties({anchor:new e.DataConstantProperty(e.styleSpec.light.anchor),position:new _,color:new e.DataConstantProperty(e.styleSpec.light.color),intensity:new e.DataConstantProperty(e.styleSpec.light.intensity)}),w=function(t){function r(r){t.call(this),this._transitionable=new e.Transitionable(b),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.getLight=function(){return this._transitionable.serialize()},r.prototype.setLight=function(t,r){if(void 0===r&&(r={}),!this._validate(e.validateLight,t,r))for(var n in t){var i=t[n];e.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-11),i):this._transitionable.setValue(n,i)}},r.prototype.updateTransitions=function(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)},r.prototype.hasTransition=function(){return this._transitioning.hasTransition()},r.prototype.recalculate=function(e){this.properties=this._transitioning.possiblyEvaluate(e)},r.prototype._validate=function(t,r,n){return(!n||!1!==n.validate)&&e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.styleSpec})))},r}(e.Evented),T=function(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};T.prototype.getDash=function(e,t){var r=e.join(",")+String(t);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(e,t)),this.dashEntry[r]},T.prototype.getDashRanges=function(e,t,r){var n=[],i=e.length%2==1?-e[e.length-1]*r:0,a=e[0]*r,o=!0;n.push({left:i,right:a,isDash:o,zeroLength:0===e[0]});for(var s=e[0],l=1;l<e.length;l++){o=!o;var c=e[l];i=s*r,a=(s+=c)*r,n.push({left:i,right:a,isDash:o,zeroLength:0===c})}return n},T.prototype.addRoundDash=function(e,t,r){for(var n=t/2,i=-r;i<=r;i++)for(var a=this.nextRow+r+i,o=this.width*a,s=0,l=e[s],c=0;c<this.width;c++){c/l.right>1&&(l=e[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),f=Math.min(u,h),p=void 0,d=i/r*(n+1);if(l.isDash){var m=n-Math.abs(d);p=Math.sqrt(f*f+m*m)}else p=n-Math.sqrt(f*f+d*d);this.data[o+c]=Math.max(0,Math.min(255,p+128))}},T.prototype.addRegularDash=function(e){for(var t=e.length-1;t>=0;--t){var r=e[t],n=e[t+1];r.zeroLength?e.splice(t,1):n&&n.isDash===r.isDash&&(n.left=r.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,l=e[s],c=0;c<this.width;c++){c/l.right>1&&(l=e[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),f=Math.min(u,h),p=l.isDash?f:-f;this.data[o+c]=Math.max(0,Math.min(255,p+128))}},T.prototype.addDash=function(t,r){var n=r?7:0,i=2*n+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(0!==a){var s=this.width/a,l=this.getDashRanges(t,this.width,s);r?this.addRoundDash(l,s,n):this.addRegularDash(l)}var c={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:a};return this.nextRow+=i,this.dirty=!0,c},T.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 k=function t(r,n){this.workerPool=r,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,n,this.id);s.name="Worker "+a,this.actors.push(s)}};function A(t,r,n){var i=function(i,a){if(i)return n(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=r.canonicalizeTileset(o,t.url),n(null,o)}};return t.url?e.getJSON(r.transformRequest(r.normalizeSourceURL(t.url),e.ResourceType.Source),i):e.browser.frame((function(){return i(null,t)}))}k.prototype.broadcast=function(t,r,n){n=n||function(){},e.asyncAll(this.actors,(function(e,n){e.send(t,r,n)}),n)},k.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},k.prototype.remove=function(){this.actors.forEach((function(e){e.remove()})),this.actors=[],this.workerPool.release(this.id)},k.Actor=e.Actor;var M=function(t,r,n){this.bounds=e.LngLatBounds.convert(this.validateBounds(t)),this.minzoom=r||0,this.maxzoom=n||24};M.prototype.validateBounds=function(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]},M.prototype.contains=function(t){var r=Math.pow(2,t.z),n=Math.floor(e.mercatorXfromLng(this.bounds.getWest())*r),i=Math.floor(e.mercatorYfromLat(this.bounds.getNorth())*r),a=Math.ceil(e.mercatorXfromLng(this.bounds.getEast())*r),o=Math.ceil(e.mercatorYfromLat(this.bounds.getSouth())*r);return t.x>=n&&t.x<a&&t.y>=i&&t.y<o};var S=function(t){function r(r,n,i,a){if(t.call(this),this.id=r,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(n,["url","scheme","tileSize","promoteId"])),this._options=e.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(a)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,(function(r,n){t._tileJSONRequest=null,t._loaded=!0,r?t.fire(new e.ErrorEvent(r)):n&&(e.extend(t,n),n.bounds&&(t.tileBounds=new M(n.bounds,t.minzoom,t.maxzoom)),e.postTurnstileEvent(n.tiles,t.map._requestManager._customAccessToken),e.postMapLoadEvent(n.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"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.hasTile=function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setSourceProperty=function(e){this._tileJSONRequest&&this._tileJSONRequest.cancel(),e(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},r.prototype.setTiles=function(e){var t=this;return this.setSourceProperty((function(){t._options.tiles=e})),this},r.prototype.setUrl=function(e){var t=this;return this.setSourceProperty((function(){t.url=e,t._options.url=e})),this},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return e.extend({},this._options)},r.prototype.loadTile=function(t,r){var n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(n,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};function a(n,i){return delete t.request,t.aborted?r(null):n&&404!==n.status?r(n):(i&&i.resourceTiming&&(t.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&t.setExpiryData(i),t.loadVectorData(i,this.map.painter),e.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}i.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=r:t.request=t.actor.send("reloadTile",i,a.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",i,a.bind(this)))},r.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)},r.prototype.unloadTile=function(e){e.unloadVectorData(),e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id},void 0)},r.prototype.hasTransition=function(){return!1},r}(e.Evented),E=function(t){function r(r,n,i,a){t.call(this),this.id=r,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"},n),e.extend(this,e.pick(n,["url","scheme","tileSize"]))}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,(function(r,n){t._tileJSONRequest=null,t._loaded=!0,r?t.fire(new e.ErrorEvent(r)):n&&(e.extend(t,n),n.bounds&&(t.tileBounds=new M(n.bounds,t.minzoom,t.maxzoom)),e.postTurnstileEvent(n.tiles),e.postMapLoadEvent(n.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"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return e.extend({},this._options)},r.prototype.hasTile=function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)},r.prototype.loadTile=function(t,r){var n=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",r(null);else if(i)t.state="errored",r(i);else if(a){n.map._refreshExpiredTiles&&t.setExpiryData(a),delete a.cacheControl,delete a.expires;var o=n.map.painter.context,s=o.gl;t.texture=n.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(n.dispatcher),r(null)}}))},r.prototype.abortTile=function(e,t){e.request&&(e.request.cancel(),delete e.request),t()},r.prototype.unloadTile=function(e,t){e.texture&&this.map.painter.saveTileTexture(e.texture),t()},r.prototype.hasTransition=function(){return!1},r}(e.Evented),C=function(t){function r(r,n,i,a){t.call(this,r,n,i,a),this.type="raster-dem",this.maxzoom=22,this._options=e.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(t,r){var n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function i(e,n){e&&(t.state="errored",r(e)),n&&(t.dem=n,t.needsHillshadePrepare=!0,t.state="loaded",r(null))}t.request=e.getImage(this.map._requestManager.transformRequest(n,e.ResourceType.Tile),function(n,a){if(delete t.request,t.aborted)t.state="unloaded",r(null);else if(n)t.state="errored",r(n);else if(a){this.map._refreshExpiredTiles&&t.setExpiryData(a),delete a.cacheControl,delete a.expires;var o=e.window.ImageBitmap&&a instanceof e.window.ImageBitmap&&e.offscreenCanvasSupported()?a:e.browser.getImageData(a,1),s={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:o,encoding:this.encoding};(!t.actor||"expired"===t.state)&&(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",s,i.bind(this)))}}.bind(this)),t.neighboringTiles=this._getNeighboringTiles(t.tileID)},r.prototype._getNeighboringTiles=function(t){var r=t.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?t.wrap-1:t.wrap,o=(r.x+1+n)%n,s=r.x+1===n?t.wrap+1:t.wrap,l={};return l[new e.OverscaledTileID(t.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new e.OverscaledTileID(t.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new e.OverscaledTileID(t.overscaledZ,a,r.z,i,r.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y+1).key]={backfilled:!1}),l},r.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})},r}(E),I=function(t){function r(r,n,i,a){t.call(this),this.id=r,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=n.data,this._options=e.extend({},n),this._collectResourceTiming=n.collectResourceTiming,this._resourceTiming=[],void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;var o=e.EXTENT/this.tileSize;this.workerOptions=e.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*o,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*o,extent:e.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?Math.min(n.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:e.EXTENT,radius:(n.clusterRadius||50)*o,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){var t=this;this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(r){if(r)t.fire(new e.ErrorEvent(r));else{var n={dataType:"source",sourceDataType:"metadata"};t._collectResourceTiming&&t._resourceTiming&&t._resourceTiming.length>0&&(n.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new e.Event("data",n))}}))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setData=function(t){var r=this;return this._data=t,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(t){if(t)r.fire(new e.ErrorEvent(t));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new e.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this},r.prototype.getClusterChildren=function(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this},r.prototype.getClusterLeaves=function(e,t,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:r},n),this},r.prototype._updateWorkerData=function(t){var r=this;this._loaded=!1;var n=e.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(e.browser.resolveURL(i),e.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(e,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),t(e))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(t,r){var n=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?r(null):e?r(e):(t.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0},r.prototype.unloadTile=function(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(e.Evented),L=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),P=function(t){function r(e,r,n,i){t.call(this),this.id=e,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(t,r){var n=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){n._loaded=!0,i?n.fire(new e.ErrorEvent(i)):a&&(n.image=a,t&&(n.coordinates=t),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(e){var t=this;return this.image&&e.url?(this.options.url=e.url,this.load(e.coordinates,(function(){t.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setCoordinates=function(t){var r=this;this.coordinates=t;var n=t.map(e.MercatorCoordinate.fromLngLat);this.tileID=function(t){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=t;o<s.length;o+=1){var l=s[o];r=Math.min(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.x),a=Math.max(a,l.y)}var c=i-r,u=a-n,h=Math.max(c,u),f=Math.max(0,Math.floor(-Math.log(h)/Math.LN2)),p=Math.pow(2,f);return new e.CanonicalTileID(f,Math.floor((r+i)/2*p),Math.floor((n+a)/2*p))}(n),this.minzoom=this.maxzoom=this.tileID.z;var i=n.map((function(e){return r.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},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.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))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(e.Evented),z=function(t){function r(e,r,n,i){t.call(this,e,r,n,i),this.roundZoom=!0,this.type="video",this.options=r}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){var t=this;this._loaded=!1;var r=this.options;this.urls=[];for(var n=0,i=r.urls;n<i.length;n+=1){var a=i[n];this.urls.push(this.map._requestManager.transformRequest(a,e.ResourceType.Source).url)}e.getVideo(this.urls,(function(r,n){t._loaded=!0,r?t.fire(new e.ErrorEvent(r)):n&&(t.video=n,t.video.loop=!0,t.video.addEventListener("playing",(function(){t.map.triggerRepaint()})),t.map&&t.video.play(),t._finishLoading())}))},r.prototype.pause=function(){this.video&&this.video.pause()},r.prototype.play=function(){this.video&&this.video.play()},r.prototype.seek=function(t){if(this.video){var r=this.video.seekable;t<r.start(0)||t>r.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=t}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(P),D=function(t){function r(r,n,i,a){t.call(this,r,n,i,a),n.coordinates?(!Array.isArray(n.coordinates)||4!==n.coordinates.length||n.coordinates.some((function(e){return!Array.isArray(e)||2!==e.length||e.some((function(e){return"number"!=typeof e}))})))&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"!=typeof n.canvas&&!(n.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,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."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(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(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.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()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(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(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var e=0,t=[this.canvas.width,this.canvas.height];e<t.length;e+=1){var r=t[e];if(isNaN(r)||r<=0)return!0}return!1},r}(P),O={vector:S,raster:E,"raster-dem":C,geojson:I,video:z,image:P,canvas:D};function R(t,r){var n=e.identity([]);return e.translate(n,n,[1,1,0]),e.scale(n,n,[.5*t.width,.5*t.height,1]),e.multiply(n,n,t.calculatePosMatrix(r.toUnwrapped()))}function F(e,t,r,n,i,a){var o=function(e,t,r){if(e)for(var n=0,i=e;n<i.length;n+=1){var a=t[i[n]];if(a&&a.source===r&&"fill-extrusion"===a.type)return!0}else for(var o in t){var s=t[o];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(i&&i.layers,t,e.id),s=a.maxPitchScaleFactor(),l=e.tilesIn(n,s,o);l.sort(B);for(var c=[],u=0,h=l;u<h.length;u+=1){var f=h[u];c.push({wrappedTileID:f.tileID.wrapped().key,queryResults:f.tile.queryRenderedFeatures(t,r,e._state,f.queryGeometry,f.cameraQueryGeometry,f.scale,i,a,s,R(e.transform,f.tileID))})}var p=function(e){for(var t={},r={},n=0,i=e;n<i.length;n+=1){var a=i[n],o=a.queryResults,s=a.wrappedTileID,l=r[s]=r[s]||{};for(var c in o)for(var u=o[c],h=l[c]=l[c]||{},f=t[c]=t[c]||[],p=0,d=u;p<d.length;p+=1){var m=d[p];h[m.featureIndex]||(h[m.featureIndex]=!0,f.push(m))}}return t}(c);for(var d in p)p[d].forEach((function(t){var r=t.feature,n=e.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return p}function B(e,t){var r=e.tileID,n=t.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}var j=function(e,t){this.max=e,this.onRemove=t,this.reset()};j.prototype.reset=function(){for(var e in this.data)for(var t=0,r=this.data[e];t<r.length;t+=1){var n=r[t];n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value)}return this.data={},this.order=[],this},j.prototype.add=function(e,t,r){var n=this,i=e.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);var a={value:t,timeout:void 0};if(void 0!==r&&(a.timeout=setTimeout((function(){n.remove(e,a)}),r)),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},j.prototype.has=function(e){return e.wrapped().key in this.data},j.prototype.getAndRemove=function(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null},j.prototype._getAndRemoveByKey=function(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value},j.prototype.getByKey=function(e){var t=this.data[e];return t?t[0].value:null},j.prototype.get=function(e){return this.has(e)?this.data[e.wrapped().key][0].value:null},j.prototype.remove=function(e,t){if(!this.has(e))return this;var r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},j.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},j.prototype.filter=function(e){var t=[];for(var r in this.data)for(var n=0,i=this.data[r];n<i.length;n+=1){var a=i[n];e(a.value)||t.push(a)}for(var o=0,s=t;o<s.length;o+=1){var l=s[o];this.remove(l.value.tileID,l)}};var N=function(e,t,r){this.context=e;var n=e.gl;this.buffer=n.createBuffer(),this.dynamicDraw=!!r,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer};N.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},N.prototype.updateData=function(e){var t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)},N.prototype.destroy=function(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)};var U={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},V=function(e,t,r,n){this.length=t.length,this.attributes=r,this.itemSize=t.bytesPerElement,this.dynamicDraw=n,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};V.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},V.prototype.updateData=function(e){var t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)},V.prototype.enableAttributes=function(e,t){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],i=t.attributes[n.name];void 0!==i&&e.enableVertexAttribArray(i)}},V.prototype.setVertexAttribPointers=function(e,t,r){for(var n=0;n<this.attributes.length;n++){var i=this.attributes[n],a=t.attributes[i.name];void 0!==a&&e.vertexAttribPointer(a,i.components,e[U[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}},V.prototype.destroy=function(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)};var q=function(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};q.prototype.get=function(){return this.current},q.prototype.set=function(e){},q.prototype.getDefault=function(){return this.default},q.prototype.setDefault=function(){this.set(this.default)};var H=function(t){function r(){t.apply(this,arguments)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return e.Color.transparent},r.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)},r}(q),G=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}(q),W=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}(q),Z=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}(q),Y=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}(q),X=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}(q),$=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}(q),K=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}(q),J=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}(q),Q=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}(q),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!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}(q),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 this.gl.LESS},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.depthFunc(e),this.current=e,this.dirty=!1)},t}(q),re=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}(q),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(){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}(q),ie=function(t){function r(){t.apply(this,arguments)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return e.Color.transparent},r.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)},r}(q),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 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}(q),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!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}(q),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 this.gl.BACK},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.cullFace(e),this.current=e,this.dirty=!1)},t}(q),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 this.gl.CCW},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.frontFace(e),this.current=e,this.dirty=!1)},t}(q),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 null},t.prototype.set=function(e){e===this.current&&!this.dirty||(this.gl.useProgram(e),this.current=e,this.dirty=!1)},t}(q),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(){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}(q),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(){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}(q),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 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}(q),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 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}(q),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}(q),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 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}(q),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(){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}(q),ye=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}(q),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 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}(q),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!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}(q),_e=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}(q),be=function(e){function t(t,r){e.call(this,t),this.context=t,this.parent=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t}(q),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.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}(be),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.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}(be),ke=function(e,t,r,n){this.context=e,this.width=t,this.height=r;var i=e.gl,a=this.framebuffer=i.createFramebuffer();this.colorAttachment=new we(e,a),n&&(this.depthAttachment=new Te(e,a))};ke.prototype.destroy=function(){var e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){var r=this.depthAttachment.get();r&&e.deleteRenderbuffer(r)}e.deleteFramebuffer(this.framebuffer)};var Ae=function(e,t,r){this.func=e,this.mask=t,this.range=r};Ae.ReadOnly=!1,Ae.ReadWrite=!0,Ae.disabled=new Ae(519,Ae.ReadOnly,[0,1]);var Me=7680,Se=function(e,t,r,n,i,a){this.test=e,this.ref=t,this.mask=r,this.fail=n,this.depthFail=i,this.pass=a};Se.disabled=new Se({func:519,mask:0},0,0,Me,Me,Me);var Ee=function(e,t,r){this.blendFunction=e,this.blendColor=t,this.mask=r};Ee.disabled=new Ee(Ee.Replace=[1,0],e.Color.transparent,[!1,!1,!1,!1]),Ee.unblended=new Ee(Ee.Replace,e.Color.transparent,[!0,!0,!0,!0]),Ee.alphaBlended=new Ee([1,771],e.Color.transparent,[!0,!0,!0,!0]);var Ce=function(e,t,r){this.enable=e,this.mode=t,this.frontFace=r};Ce.disabled=new Ce(!1,1029,2305),Ce.backCCW=new Ce(!0,1029,2305);var Ie=function(e){this.gl=e,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new H(this),this.clearDepth=new G(this),this.clearStencil=new W(this),this.colorMask=new Z(this),this.depthMask=new Y(this),this.stencilMask=new X(this),this.stencilFunc=new $(this),this.stencilOp=new K(this),this.stencilTest=new J(this),this.depthRange=new Q(this),this.depthTest=new ee(this),this.depthFunc=new te(this),this.blend=new re(this),this.blendFunc=new ne(this),this.blendColor=new ie(this),this.blendEquation=new ae(this),this.cullFace=new oe(this),this.cullFaceSide=new se(this),this.frontFace=new le(this),this.program=new ce(this),this.activeTexture=new ue(this),this.viewport=new he(this),this.bindFramebuffer=new fe(this),this.bindRenderbuffer=new pe(this),this.bindTexture=new de(this),this.bindVertexBuffer=new me(this),this.bindElementBuffer=new ge(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new ye(this),this.pixelStoreUnpack=new ve(this),this.pixelStoreUnpackPremultiplyAlpha=new xe(this),this.pixelStoreUnpackFlipY=new _e(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)};Ie.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()},Ie.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},Ie.prototype.createIndexBuffer=function(e,t){return new N(this,e,t)},Ie.prototype.createVertexBuffer=function(e,t,r){return new V(this,e,t,r)},Ie.prototype.createRenderbuffer=function(e,t,r){var n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,e,t,r),this.bindRenderbuffer.set(null),i},Ie.prototype.createFramebuffer=function(e,t,r){return new ke(this,e,t,r)},Ie.prototype.clear=function(e){var t=e.color,r=e.depth,n=this.gl,i=0;t&&(i|=n.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),typeof r<"u"&&(i|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),n.clear(i)},Ie.prototype.setCullFace=function(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))},Ie.prototype.setDepthMode=function(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)},Ie.prototype.setStencilMode=function(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)},Ie.prototype.setColorMode=function(t){e.deepEqual(t.blendFunction,Ee.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)},Ie.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Le=function(t){function r(r,n,i){var a=this;t.call(this),this.id=r,this.dispatcher=i,this.on("data",(function(e){"source"===e.dataType&&"metadata"===e.sourceDataType&&(a._sourceLoaded=!0),a._sourceLoaded&&!a._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(a.reload(),a.transform&&a.update(a.transform))})),this.on("error",(function(){a._sourceErrored=!0})),this._source=function(t,r,n,i){var a=new O[r.type](t,r,n,i);if(a.id!==t)throw new Error("Expected Source id to be "+t+" instead of "+a.id);return e.bindAll(["load","abort","unload","serialize","prepare"],a),a}(r,n,i,this),this._tiles={},this._cache=new j(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new e.SourceFeatureState}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.onAdd=function(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(e)},r.prototype.onRemove=function(e){this._source&&this._source.onRemove&&this._source.onRemove(e)},r.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("loaded"!==t.state&&"errored"!==t.state)return!1}return!0},r.prototype.getSource=function(){return this._source},r.prototype.pause=function(){this._paused=!0},r.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)}},r.prototype._loadTile=function(e,t){return this._source.loadTile(e,t)},r.prototype._unloadTile=function(e){if(this._source.unloadTile)return this._source.unloadTile(e,(function(){}))},r.prototype._abortTile=function(e){if(this._source.abortTile)return this._source.abortTile(e,(function(){}))},r.prototype.serialize=function(){return this._source.serialize()},r.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 r=this._tiles[t];r.upload(e),r.prepare(this.map.style.imageManager)}},r.prototype.getIds=function(){return e.values(this._tiles).map((function(e){return e.tileID})).sort(Pe).map((function(e){return e.key}))},r.prototype.getRenderableIds=function(t){var r=this,n=[];for(var i in this._tiles)this._isIdRenderable(i,t)&&n.push(this._tiles[i]);return t?n.sort((function(t,n){var i=t.tileID,a=n.tileID,o=new e.Point(i.canonical.x,i.canonical.y)._rotate(r.transform.angle),s=new e.Point(a.canonical.x,a.canonical.y)._rotate(r.transform.angle);return i.overscaledZ-a.overscaledZ||s.y-o.y||s.x-o.x})).map((function(e){return e.tileID.key})):n.map((function(e){return e.tileID})).sort(Pe).map((function(e){return e.key}))},r.prototype.hasRenderableParent=function(e){var t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)},r.prototype._isIdRenderable=function(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())},r.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var e in this._cache.reset(),this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(e,"reloading")},r.prototype._reloadTile=function(e,t){var r=this._tiles[e];r&&("loading"!==r.state&&(r.state=t),this._loadTile(r,this._tileLoaded.bind(this,r,e,t)))},r.prototype._tileLoaded=function(t,r,n,i){if(i)return t.state="errored",void(404!==i.status?this._source.fire(new e.ErrorEvent(i,{tile:t})):this.update(this.transform));t.timeAdded=e.browser.now(),"expired"===n&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),"raster-dem"===this.getSource().type&&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}))},r.prototype._backfillDEM=function(e){for(var t=this.getRenderableIds(),r=0;r<t.length;r++){var n=t[r];if(e.neighboringTiles&&e.neighboringTiles[n]){var i=this.getTileByID(n);a(e,i),a(i,e)}}function a(e,t){e.needsHillshadePrepare=!0;var r=t.tileID.canonical.x-e.tileID.canonical.x,n=t.tileID.canonical.y-e.tileID.canonical.y,i=Math.pow(2,e.tileID.canonical.z),a=t.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,n),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(e){return this.getTileByID(e.key)},r.prototype.getTileByID=function(e){return this._tiles[e]},r.prototype._retainLoadedChildren=function(e,t,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>r)){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.hasData()&&(o=s)}for(var l=o;l.overscaledZ>t;)if(e[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(e,t){if(e.key in this._loadedParentTiles){var r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(var n=e.overscaledZ-1;n>=t;n--){var i=e.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(e){var t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)},r.prototype.updateCacheSize=function(e){var t=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),r=Math.floor(5*t),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(e){var t=(e-(void 0===this._prevLng?e:this._prevLng))/360,r=Math.round(t);if(this._prevLng=e,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(t){var n=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},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 n._source.hasTile(e)})))):i=[];var a=t.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(ze(this._source.type)){for(var c={},u={},h=0,f=Object.keys(l);h<f.length;h+=1){var p=f[h],d=l[p],m=this._tiles[p];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=e.browser.now())){var g=this.findLoadedParent(d,o);g&&(this._addTile(g.tileID),c[g.tileID.key]=g.tileID),u[p]=d}}for(var y in this._retainLoadedChildren(u,a,s,l),c)l[y]||(this._coveredTiles[y]=!0,l[y]=c[y])}for(var v in l)this._tiles[v].clearFadeHold();for(var x=0,_=e.keysDifference(this._tiles,l);x<_.length;x+=1){var b=_[x],w=this._tiles[b];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):(!w.hasSymbolBuckets||w.symbolFadeFinished())&&this._removeTile(b)}this._updateLoadedParentTileCache()}},r.prototype.releaseSymbolFadeTiles=function(){for(var e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)},r.prototype._updateRetainedTiles=function(e,t){for(var n={},i={},a=Math.max(t-r.maxOverzooming,this._source.minzoom),o=Math.max(t+r.maxUnderzooming,this._source.minzoom),s={},l=0,c=e;l<c.length;l+=1){var u=c[l],h=this._addTile(u);n[u.key]=u,!h.hasData()&&t<this._source.maxzoom&&(s[u.key]=u)}this._retainLoadedChildren(s,t,o,n);for(var f=0,p=e;f<p.length;f+=1){var d=p[f],m=this._tiles[d.key];if(!m.hasData()){if(t+1>this._source.maxzoom){var g=d.children(this._source.maxzoom)[0],y=this.getTile(g);if(y&&y.hasData()){n[g.key]=g;continue}}else{var v=d.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var x=m.wasRequested(),_=d.overscaledZ-1;_>=a;--_){var b=d.scaledTo(_);if(i[b.key]||(i[b.key]=!0,!(m=this.getTile(b))&&x&&(m=this._addTile(b)),m&&(n[b.key]=b,x=m.wasRequested(),m.hasData())))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var e in this._loadedParentTiles={},this._tiles){for(var t=[],r=void 0,n=this._tiles[e].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}t.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=t;a<o.length;a+=1){var s=o[a];this._loadedParentTiles[s]=r}}},r.prototype._addTile=function(t){var r=this._tiles[t.key];if(r)return r;(r=this._cache.getAndRemove(t))&&(this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,r)));var n=!!r;return n||(r=new e.Tile(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,t.key,r.state))),r?(r.uses++,this._tiles[t.key]=r,n||this._source.fire(new e.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(e,t){var r=this;e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);var n=t.getExpiryTimeout();n&&(this._timers[e]=setTimeout((function(){r._reloadTile(e,"expired"),delete r._timers[e]}),n))},r.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()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))},r.prototype.clearTiles=function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(e);this._cache.reset()},r.prototype.tilesIn=function(t,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(t):t,l=t.map((function(e){return o.pointCoordinate(e)})),c=s.map((function(e){return o.pointCoordinate(e)})),u=this.getIds(),h=1/0,f=1/0,p=-1/0,d=-1/0,m=0,g=c;m<g.length;m+=1){var y=g[m];h=Math.min(h,y.x),f=Math.min(f,y.y),p=Math.max(p,y.x),d=Math.max(d,y.y)}for(var v=function(t){var n=i._tiles[u[t]];if(!n.holdingForFade()){var s=n.tileID,m=Math.pow(2,o.zoom-n.tileID.overscaledZ),g=r*n.queryPadding*e.EXTENT/n.tileSize/m,y=[s.getTilePoint(new e.MercatorCoordinate(h,f)),s.getTilePoint(new e.MercatorCoordinate(p,d))];if(y[0].x-g<e.EXTENT&&y[0].y-g<e.EXTENT&&y[1].x+g>=0&&y[1].y+g>=0){var v=l.map((function(e){return s.getTilePoint(e)})),x=c.map((function(e){return s.getTilePoint(e)}));a.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:x,scale:m})}}},x=0;x<u.length;x++)v(x);return a},r.prototype.getVisibleCoordinates=function(e){for(var t=this,r=this.getRenderableIds(e).map((function(e){return t._tiles[e].tileID})),n=0,i=r;n<i.length;n+=1){var a=i[n];a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped())}return r},r.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(ze(this._source.type))for(var t in this._tiles){var r=this._tiles[t];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=e.browser.now())return!0}return!1},r.prototype.setFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.updateState(e,t,r)},r.prototype.removeFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.removeFeatureState(e,t,r)},r.prototype.getFeatureState=function(e,t){return e=e||"_geojsonTileLayer",this._state.getState(e,t)},r.prototype.setDependencies=function(e,t,r){var n=this._tiles[e];n&&n.setDependencies(t,r)},r.prototype.reloadTilesForDependencies=function(e,t){for(var r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(e,t)}))},r}(e.Evented);function Pe(e,t){var r=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function ze(e){return"raster"===e||"image"===e||"video"===e}function De(){return new e.window.Worker(na.workerUrl)}Le.maxOverzooming=10,Le.maxUnderzooming=3;var Oe="mapboxgl_preloaded_worker_pool",Re=function(){this.active={}};Re.prototype.acquire=function(e){if(!this.workers)for(this.workers=[];this.workers.length<Re.workerCount;)this.workers.push(new De);return this.active[e]=!0,this.workers.slice()},Re.prototype.release=function(e){delete this.active[e],0===this.numActive()&&(this.workers.forEach((function(e){e.terminate()})),this.workers=null)},Re.prototype.isPreloaded=function(){return!!this.active[Oe]},Re.prototype.numActive=function(){return Object.keys(this.active).length};var Fe,Be=Math.floor(e.browser.hardwareConcurrency/2);function je(){return Fe||(Fe=new Re),Fe}function Ne(t,r){var n={};for(var i in t)"ref"!==i&&(n[i]=t[i]);return e.refProperties.forEach((function(e){e in r&&(n[e]=r[e])})),n}function Ue(e){e=e.slice();for(var t=Object.create(null),r=0;r<e.length;r++)t[e[r].id]=e[r];for(var n=0;n<e.length;n++)"ref"in e[n]&&(e[n]=Ne(e[n],t[e[n].ref]));return e}Re.workerCount=Math.max(Math.min(Be,6),1);var Ve={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 qe(e,t,r){r.push({command:Ve.addSource,args:[e,t[e]]})}function He(e,t,r){t.push({command:Ve.removeSource,args:[e]}),r[e]=!0}function Ge(e,t,r,n){He(e,r,n),qe(e,t,r)}function We(t,r,n){var i;for(i in t[n])if(t[n].hasOwnProperty(i)&&"data"!==i&&!e.deepEqual(t[n][i],r[n][i]))return!1;for(i in r[n])if(r[n].hasOwnProperty(i)&&"data"!==i&&!e.deepEqual(t[n][i],r[n][i]))return!1;return!0}function Ze(t,r,n,i,a,o){var s;for(s in r=r||{},t=t||{})t.hasOwnProperty(s)&&(e.deepEqual(t[s],r[s])||n.push({command:o,args:[i,s,r[s],a]}));for(s in r)!r.hasOwnProperty(s)||t.hasOwnProperty(s)||e.deepEqual(t[s],r[s])||n.push({command:o,args:[i,s,r[s],a]})}function Ye(e){return e.id}function Xe(e,t){return e[t.id]=t,e}var $e=function(e,t){this.reset(e,t)};$e.prototype.reset=function(e,t){this.points=e||[],this._distances=[0];for(var r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-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},$e.prototype.lerp=function(t){if(1===this.points.length)return this.points[0];t=e.clamp(t,0,1);for(var r=1,n=this._distances[r],i=t*this.paddedLength+this.padding;n<i&&r<this._distances.length;)n=this._distances[++r];var a=r-1,o=this._distances[a],s=n-o,l=s>0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Ke=function(e,t,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(var a=0;a<this.xCellCount*this.yCellCount;a++)n.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};function Je(t,r,n,i,a){var o=e.create();return r?(e.scale(o,o,[1/a,1/a,1]),n||e.rotateZ(o,o,i.angle)):e.multiply(o,i.labelPlaneMatrix,t),o}function Qe(t,r,n,i,a){if(r){var o=e.clone(t);return e.scale(o,o,[a,a,1]),n||e.rotateZ(o,o,-i.angle),o}return i.glCoordMatrix}function et(t,r){var n=[t.x,t.y,0,1];ht(n,n,r);var i=n[3];return{point:new e.Point(n[0]/i,n[1]/i),signedDistanceFromCamera:i}}function tt(e,t){return.5+e/t*.5}function rt(e,t){var r=e[0]/e[3],n=e[1]/e[3];return r>=-t[0]&&r<=t[0]&&n>=-t[1]&&n<=t[1]}function nt(t,r,n,i,a,o,s,l){var c=i?t.textSizeData:t.iconSizeData,u=e.evaluateSizeForZoom(c,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],f=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;f.clear();for(var p=t.lineVertexArray,d=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,m=n.transform.width/n.transform.height,g=!1,y=0;y<d.length;y++){var v=d.get(y);if(v.hidden||v.writingMode===e.WritingMode.vertical&&!g)ut(v.numGlyphs,f);else{g=!1;var x=[v.anchorX,v.anchorY,0,1];if(e.transformMat4(x,x,r),rt(x,h)){var _=x[3],b=tt(n.transform.cameraToCenterDistance,_),w=e.evaluateSizeForFeature(c,u,v),T=s?w/b:w*b,k=new e.Point(v.anchorX,v.anchorY),A=et(k,a).point,M={},S=ot(v,T,!1,l,r,a,o,t.glyphOffsetArray,p,f,A,k,M,m);g=S.useVertical,(S.notEnoughRoom||g||S.needsFlipping&&ot(v,T,!0,l,r,a,o,t.glyphOffsetArray,p,f,A,k,M,m).notEnoughRoom)&&ut(v.numGlyphs,f)}else ut(v.numGlyphs,f)}}i?t.text.dynamicLayoutVertexBuffer.updateData(f):t.icon.dynamicLayoutVertexBuffer.updateData(f)}function it(e,t,r,n,i,a,o,s,l,c,u){var h=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,p=s.lineStartIndex+s.lineLength,d=t.getoffsetX(s.glyphStartIndex),m=t.getoffsetX(h-1),g=lt(e*d,r,n,i,a,o,s.segment,f,p,l,c,u);if(!g)return null;var y=lt(e*m,r,n,i,a,o,s.segment,f,p,l,c,u);return y?{first:g,last:y}:null}function at(t,r,n,i){return t===e.WritingMode.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(t===e.WritingMode.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function ot(t,r,n,i,a,o,s,l,c,u,h,f,p,d){var m,g=r/24,y=t.lineOffsetX*g,v=t.lineOffsetY*g;if(t.numGlyphs>1){var x=t.glyphStartIndex+t.numGlyphs,_=t.lineStartIndex,b=t.lineStartIndex+t.lineLength,w=it(g,l,y,v,n,h,f,t,c,o,p);if(!w)return{notEnoughRoom:!0};var T=et(w.first.point,s).point,k=et(w.last.point,s).point;if(i&&!n){var A=at(t.writingMode,T,k,d);if(A)return A}m=[w.first];for(var M=t.glyphStartIndex+1;M<x-1;M++)m.push(lt(g*l.getoffsetX(M),y,v,n,h,f,t.segment,_,b,c,o,p));m.push(w.last)}else{if(i&&!n){var S=et(f,a).point,E=t.lineStartIndex+t.segment+1,C=new e.Point(c.getx(E),c.gety(E)),I=et(C,a),L=I.signedDistanceFromCamera>0?I.point:st(f,C,S,1,a),P=at(t.writingMode,S,L,d);if(P)return P}var z=lt(g*l.getoffsetX(t.glyphStartIndex),y,v,n,h,f,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,c,o,p);if(!z)return{notEnoughRoom:!0};m=[z]}for(var D=0,O=m;D<O.length;D+=1){var R=O[D];e.addDynamicAttributes(u,R.point,R.angle)}return{}}function st(e,t,r,n,i){var a=et(e.add(e.sub(t)._unit()),i).point,o=r.sub(a);return r.add(o._mult(n/o.mag()))}function lt(t,r,n,i,a,o,s,l,c,u,h,f){var p=i?t-r:t+r,d=p>0?1:-1,m=0;i&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var g=d>0?l+s:l+s+1,y=a,v=a,x=0,_=0,b=Math.abs(p),w=[];x+_<=b;){if((g+=d)<l||g>=c)return null;if(v=y,w.push(y),void 0===(y=f[g])){var T=new e.Point(u.getx(g),u.gety(g)),k=et(T,h);if(k.signedDistanceFromCamera>0)y=f[g]=k.point;else{var A=g-d;y=st(0===x?o:new e.Point(u.getx(A),u.gety(A)),T,v,b-x+1,h)}}x+=_,_=v.dist(y)}var M=(b-x)/_,S=y.sub(v),E=S.mult(M)._add(v);E._add(S._unit()._perp()._mult(n*d));var C=m+Math.atan2(y.y-v.y,y.x-v.x);return w.push(E),{point:E,angle:C,path:w}}Ke.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ke.prototype.insert=function(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Ke.prototype.insertCircle=function(e,t,r,n){this._forEachCell(t-n,r-n,t+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(n)},Ke.prototype._insertBoxCell=function(e,t,r,n,i,a){this.boxCells[i].push(a)},Ke.prototype._insertCircleCell=function(e,t,r,n,i,a){this.circleCells[i].push(a)},Ke.prototype._query=function(e,t,r,n,i,a){if(r<0||e>this.width||n<0||t>this.height)return!i&&[];var o=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)o.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var c=this.circles[3*l],u=this.circles[3*l+1],h=this.circles[3*l+2];o.push({key:this.circleKeys[l],x1:c-h,y1:u-h,x2:c+h,y2:u+h})}return a?o.filter(a):o}var f={hitTest:i,seenUids:{box:{},circle:{}}};return this._forEachCell(e,t,r,n,this._queryCell,o,f,a),i?o.length>0:o},Ke.prototype._queryCircle=function(e,t,r,n,i){var a=e-r,o=e+r,s=t-r,l=t+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var c=[],u={hitTest:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,c,u,i),n?c.length>0:c},Ke.prototype.query=function(e,t,r,n,i){return this._query(e,t,r,n,!1,i)},Ke.prototype.hitTest=function(e,t,r,n,i){return this._query(e,t,r,n,!0,i)},Ke.prototype.hitTestCircle=function(e,t,r,n){return this._queryCircle(e,t,r,!0,n)},Ke.prototype._queryCell=function(e,t,r,n,i,a,o,s){var l=o.seenUids,c=this.boxCells[i];if(null!==c)for(var u=this.bboxes,h=0,f=c;h<f.length;h+=1){var p=f[h];if(!l.box[p]){l.box[p]=!0;var d=4*p;if(e<=u[d+2]&&t<=u[d+3]&&r>=u[d+0]&&n>=u[d+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:u[d],y1:u[d+1],x2:u[d+2],y2:u[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var g=this.circles,y=0,v=m;y<v.length;y+=1){var x=v[y];if(!l.circle[x]){l.circle[x]=!0;var _=3*x;if(this._circleAndRectCollide(g[_],g[_+1],g[_+2],e,t,r,n)&&(!s||s(this.circleKeys[x]))){if(o.hitTest)return a.push(!0),!0;var b=g[_],w=g[_+1],T=g[_+2];a.push({key:this.circleKeys[x],x1:b-T,y1:w-T,x2:b+T,y2:w+T})}}}},Ke.prototype._queryCellCircle=function(e,t,r,n,i,a,o,s){var l=o.circle,c=o.seenUids,u=this.boxCells[i];if(null!==u)for(var h=this.bboxes,f=0,p=u;f<p.length;f+=1){var d=p[f];if(!c.box[d]){c.box[d]=!0;var m=4*d;if(this._circleAndRectCollide(l.x,l.y,l.radius,h[m+0],h[m+1],h[m+2],h[m+3])&&(!s||s(this.boxKeys[d])))return a.push(!0),!0}}var g=this.circleCells[i];if(null!==g)for(var y=this.circles,v=0,x=g;v<x.length;v+=1){var _=x[v];if(!c.circle[_]){c.circle[_]=!0;var b=3*_;if(this._circlesCollide(y[b],y[b+1],y[b+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[_])))return a.push(!0),!0}}},Ke.prototype._forEachCell=function(e,t,r,n,i,a,o,s){for(var l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n),f=l;f<=u;f++)for(var p=c;p<=h;p++){var d=this.xCellCount*p+f;if(i.call(this,e,t,r,n,d,a,o,s))return}},Ke.prototype._convertToXCellCoord=function(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))},Ke.prototype._convertToYCellCoord=function(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))},Ke.prototype._circlesCollide=function(e,t,r,n,i,a){var o=n-e,s=i-t,l=r+a;return l*l>o*o+s*s},Ke.prototype._circleAndRectCollide=function(e,t,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(e-(n+s));if(l>s+r)return!1;var c=(o-i)/2,u=Math.abs(t-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var h=l-s,f=u-c;return h*h+f*f<=r*r};var ct=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ut(e,t){for(var r=0;r<e;r++){var n=t.length;t.resize(n+4),t.float32.set(ct,3*n)}}function ht(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e[3]=r[3]*n+r[7]*i+r[15],e}var ft=100,pt=function(e,t,r){void 0===t&&(t=new Ke(e.width+200,e.height+200,25)),void 0===r&&(r=new Ke(e.width+200,e.height+200,25)),this.transform=e,this.grid=t,this.ignoredGrid=r,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+ft,this.screenBottomBoundary=e.height+ft,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200};function dt(t,r,n){return r*(e.EXTENT/(t.tileSize*Math.pow(2,n-t.tileID.overscaledZ)))}pt.prototype.placeCollisionBox=function(e,t,r,n,i){var a=this.projectAndGetPerspectiveRatio(n,e.anchorPointX,e.anchorPointY),o=r*a.perspectiveRatio,s=e.x1*o+a.point.x,l=e.y1*o+a.point.y,c=e.x2*o+a.point.x,u=e.y2*o+a.point.y;return!this.isInsideGrid(s,l,c,u)||!t&&this.grid.hitTest(s,l,c,u,i)?{box:[],offscreen:!1}:{box:[s,l,c,u],offscreen:this.isOffscreen(s,l,c,u)}},pt.prototype.placeCollisionCircles=function(t,r,n,i,a,o,s,l,c,u,h,f,p){var d=[],m=new e.Point(r.anchorX,r.anchorY),g=et(m,o),y=tt(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),v=(u?a/y:a*y)/e.ONE_EM,x=et(m,s).point,_=it(v,i,r.lineOffsetX*v,r.lineOffsetY*v,!1,x,m,r,n,s,{}),b=!1,w=!1,T=!0;if(_){for(var k=.5*f*y+p,A=new e.Point(-ft,-ft),M=new e.Point(this.screenRightBoundary,this.screenBottomBoundary),S=new $e,E=_.first,C=_.last,I=[],L=E.path.length-1;L>=1;L--)I.push(E.path[L]);for(var P=1;P<C.path.length;P++)I.push(C.path[P]);var z=2.5*k;if(l){var D=I.map((function(e){return et(e,l)}));I=D.some((function(e){return e.signedDistanceFromCamera<=0}))?[]:D.map((function(e){return e.point}))}var O=[];if(I.length>0){for(var R=I[0].clone(),F=I[0].clone(),B=1;B<I.length;B++)R.x=Math.min(R.x,I[B].x),R.y=Math.min(R.y,I[B].y),F.x=Math.max(F.x,I[B].x),F.y=Math.max(F.y,I[B].y);O=R.x>=A.x&&F.x<=M.x&&R.y>=A.y&&F.y<=M.y?[I]:F.x<A.x||R.x>M.x||F.y<A.y||R.y>M.y?[]:e.clipLine([I],A.x,A.y,M.x,M.y)}for(var j=0,N=O;j<N.length;j+=1){var U=N[j];S.reset(U,.25*k);var V;V=S.length<=.5*k?1:Math.ceil(S.paddedLength/z)+1;for(var q=0;q<V;q++){var H=q/Math.max(V-1,1),G=S.lerp(H),W=G.x+ft,Z=G.y+ft;d.push(W,Z,k,0);var Y=W-k,X=Z-k,$=W+k,K=Z+k;if(T=T&&this.isOffscreen(Y,X,$,K),w=w||this.isInsideGrid(Y,X,$,K),!t&&this.grid.hitTestCircle(W,Z,k,h)&&(b=!0,!c))return{circles:[],offscreen:!1,collisionDetected:b}}}}return{circles:!c&&b||!w?[]:d,offscreen:T,collisionDetected:b}},pt.prototype.queryRenderedSymbols=function(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],n=1/0,i=1/0,a=-1/0,o=-1/0,s=0,l=t;s<l.length;s+=1){var c=l[s],u=new e.Point(c.x+ft,c.y+ft);n=Math.min(n,u.x),i=Math.min(i,u.y),a=Math.max(a,u.x),o=Math.max(o,u.y),r.push(u)}for(var h={},f={},p=0,d=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o));p<d.length;p+=1){var m=d[p],g=m.key;if(void 0===h[g.bucketInstanceId]&&(h[g.bucketInstanceId]={}),!h[g.bucketInstanceId][g.featureIndex]){var y=[new e.Point(m.x1,m.y1),new e.Point(m.x2,m.y1),new e.Point(m.x2,m.y2),new e.Point(m.x1,m.y2)];e.polygonIntersectsPolygon(r,y)&&(h[g.bucketInstanceId][g.featureIndex]=!0,void 0===f[g.bucketInstanceId]&&(f[g.bucketInstanceId]=[]),f[g.bucketInstanceId].push(g.featureIndex))}}return f},pt.prototype.insertCollisionBox=function(e,t,r,n,i){var a={bucketInstanceId:r,featureIndex:n,collisionGroupID:i};(t?this.ignoredGrid:this.grid).insert(a,e[0],e[1],e[2],e[3])},pt.prototype.insertCollisionCircles=function(e,t,r,n,i){for(var a=t?this.ignoredGrid:this.grid,o={bucketInstanceId:r,featureIndex:n,collisionGroupID:i},s=0;s<e.length;s+=4)a.insertCircle(o,e[s],e[s+1],e[s+2])},pt.prototype.projectAndGetPerspectiveRatio=function(t,r,n){var i=[r,n,0,1];return ht(i,i,t),{point:new e.Point((i[0]/i[3]+1)/2*this.transform.width+ft,(-i[1]/i[3]+1)/2*this.transform.height+ft),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},pt.prototype.isOffscreen=function(e,t,r,n){return r<ft||e>=this.screenRightBoundary||n<ft||t>this.screenBottomBoundary},pt.prototype.isInsideGrid=function(e,t,r,n){return r>=0&&e<this.gridRightBoundary&&n>=0&&t<this.gridBottomBoundary},pt.prototype.getViewportMatrix=function(){var t=e.identity([]);return e.translate(t,t,[-ft,-ft,0]),t};var mt=function(e,t,r,n){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):n&&r?1:0,this.placed=r};mt.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var gt=function(e,t,r,n,i){this.text=new mt(e?e.text:null,t,r,i),this.icon=new mt(e?e.icon:null,t,n,i)};gt.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var yt=function(e,t,r){this.text=e,this.icon=t,this.skipFade=r},vt=function(){this.invProjMatrix=e.create(),this.viewportMatrix=e.create(),this.circles=[]},xt=function(e,t,r,n,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i},_t=function(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}};function bt(t,r,n,i,a){var o=e.getAnchorAlignment(t),s=-(o.horizontalAlign-.5)*r,l=-(o.verticalAlign-.5)*n,c=e.evaluateVariableOffset(t,i);return new e.Point(s+c[0]*a,l+c[1]*a)}function wt(t,r,n,i,a,o){var s=t.x1,l=t.x2,c=t.y1,u=t.y2,h=t.anchorPointX,f=t.anchorPointY,p=new e.Point(r,n);return i&&p._rotate(a?o:-o),{x1:s+p.x,y1:c+p.y,x2:l+p.x,y2:u+p.y,anchorPointX:h,anchorPointY:f}}_t.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]};var Tt=function(e,t,r,n){this.transform=e.clone(),this.collisionIndex=new pt(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new _t(r),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}};function kt(e,t,r,n,i){e.emplaceBack(t?1:0,r?1:0,n||0,i||0),e.emplaceBack(t?1:0,r?1:0,n||0,i||0),e.emplaceBack(t?1:0,r?1:0,n||0,i||0),e.emplaceBack(t?1:0,r?1:0,n||0,i||0)}Tt.prototype.getBucketParts=function(t,r,n,i){var a=n.getBucket(r),o=n.latestFeatureIndex;if(a&&o&&r.id===a.layerIds[0]){var s=n.collisionBoxArray,l=a.layers[0].layout,c=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),u=n.tileSize/e.EXTENT,h=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),f="map"===l.get("text-pitch-alignment"),p="map"===l.get("text-rotation-alignment"),d=dt(n,1,this.transform.zoom),m=Je(h,f,p,this.transform,d),g=null;if(f){var y=Qe(h,f,p,this.transform,d);g=e.multiply([],this.transform.labelPlaneMatrix,y)}this.retainedQueryData[a.bucketInstanceId]=new xt(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);var v={bucket:a,layout:l,posMatrix:h,textLabelPlaneMatrix:m,labelToScreenMatrix:g,scale:c,textPixelRatio:u,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(var x=0,_=a.sortKeyRanges;x<_.length;x+=1){var b=_[x],w=b.sortKey,T=b.symbolInstanceStart,k=b.symbolInstanceEnd;t.push({sortKey:w,symbolInstanceStart:T,symbolInstanceEnd:k,parameters:v})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:v})}},Tt.prototype.attemptAnchorPlacement=function(e,t,r,n,i,a,o,s,l,c,u,h,f,p,d){var m,g=[h.textOffset0,h.textOffset1],y=bt(e,r,n,g,i),v=this.collisionIndex.placeCollisionBox(wt(t,y.x,y.y,a,o,this.transform.angle),u,s,l,c.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(wt(d,y.x,y.y,a,o,this.transform.angle),u,s,l,c.predicate).box.length)return v.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(m=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:r,height:n,anchor:e,textBoxScale:i,prevAnchor:m},this.markUsedJustification(f,e,h,p),f.allowVerticalPlacement&&(this.markUsedOrientation(f,p,h),this.placedOrientations[h.crossTileID]=p),{shift:y,placedGlyphBoxes:v}):void 0},Tt.prototype.placeLayerBucketPart=function(t,r,n){var i=this,a=t.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,c=a.textLabelPlaneMatrix,u=a.labelToScreenMatrix,h=a.textPixelRatio,f=a.holdingForFade,p=a.collisionBoxArray,d=a.partiallyEvaluatedTextSize,m=a.collisionGroup,g=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),_="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),k=v&&(x||!o.hasIconData()||y),A=x&&(v||!o.hasTextData()||g);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);var M=function(t,a){if(!r[t.crossTileID]){if(f)return void(i.placements[t.crossTileID]=new yt(!1,!1,!1));var p,T=!1,M=!1,S=!0,E=null,C={box:null,offscreen:null},I={box:null,offscreen:null},L=null,P=null,z=0,D=0,O=0;a.textFeatureIndex?z=a.textFeatureIndex:t.useRuntimeCollisionCircles&&(z=t.featureIndex),a.verticalTextFeatureIndex&&(D=a.verticalTextFeatureIndex);var R=a.textBox;if(R){var F=function(r){var n=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[t.crossTileID];a&&(i.placedOrientations[t.crossTileID]=a,n=a,i.markUsedOrientation(o,n,t))}return n},B=function(r,n){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i<s.length&&(s[i]===e.WritingMode.vertical?(C=n(),I=C):C=r(),!(C&&C.box&&C.box.length));i+=1);else C=r()};if(s.get("text-variable-anchor")){var j=s.get("text-variable-anchor");if(i.prevPlacement&&i.prevPlacement.variableOffsets[t.crossTileID]){var N=i.prevPlacement.variableOffsets[t.crossTileID];j.indexOf(N.anchor)>0&&(j=j.filter((function(e){return e!==N.anchor}))).unshift(N.anchor)}var U=function(e,r,n){for(var a=e.x2-e.x1,s=e.y2-e.y1,c=t.textBoxScale,u=w&&!x?r:null,f={box:[],offscreen:!1},p=v?2*j.length:j.length,d=0;d<p;++d){var g=j[d%j.length],y=d>=j.length,k=i.attemptAnchorPlacement(g,e,a,s,c,_,b,h,l,m,y,t,o,n,u);if(k&&(f=k.placedGlyphBoxes)&&f.box&&f.box.length){T=!0,E=k.shift;break}}return f};B((function(){return U(R,a.iconBox,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=C&&C.box&&C.box.length;return o.allowVerticalPlacement&&!n&&t.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}})),C&&(T=C.box,S=C.offscreen);var V=F(C&&C.box);if(!T&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[t.crossTileID];q&&(i.variableOffsets[t.crossTileID]=q,i.markUsedJustification(o,q.anchor,t,V))}}else{var H=function(e,r){var n=i.collisionIndex.placeCollisionBox(e,v,h,l,m.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,t),i.placedOrientations[t.crossTileID]=r),n};B((function(){return H(R,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?H(r,e.WritingMode.vertical):{box:null,offscreen:null}})),F(C&&C.box&&C.box.length)}}if(T=(p=C)&&p.box&&p.box.length>0,S=p&&p.offscreen,t.useRuntimeCollisionCircles){var G=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),W=e.evaluateSizeForFeature(o.textSizeData,d,G),Z=s.get("text-padding"),Y=t.collisionCircleDiameter;L=i.collisionIndex.placeCollisionCircles(v,G,o.lineVertexArray,o.glyphOffsetArray,W,l,c,u,n,b,m.predicate,Y,Z),T=v||L.circles.length>0&&!L.collisionDetected,S=S&&L.offscreen}if(a.iconFeatureIndex&&(O=a.iconFeatureIndex),a.iconBox){var X=function(e){var t=w&&E?wt(e,E.x,E.y,_,b,i.transform.angle):e;return i.collisionIndex.placeCollisionBox(t,x,h,l,m.predicate)};M=I&&I.box&&I.box.length&&a.verticalIconBox?(P=X(a.verticalIconBox)).box.length>0:(P=X(a.iconBox)).box.length>0,S=S&&P.offscreen}var $=g||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,K=y||0===t.numIconVertices;if($||K?K?$||(M=M&&T):T=M&&T:M=T=M&&T,T&&p&&p.box&&(I&&I.box&&D?i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,D,m.ID):i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID)),M&&P&&i.collisionIndex.insertCollisionBox(P.box,s.get("icon-ignore-placement"),o.bucketInstanceId,O,m.ID),L&&(T&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID),n)){var J=o.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new vt);for(var ee=0;ee<L.circles.length;ee+=4)Q.circles.push(L.circles[ee+0]),Q.circles.push(L.circles[ee+1]),Q.circles.push(L.circles[ee+2]),Q.circles.push(L.collisionDetected?1:0)}i.placements[t.crossTileID]=new yt(T||k,M||A,S||o.justReloaded),r[t.crossTileID]=!0}};if(T)for(var S=o.getSortedSymbolIndexes(this.transform.angle),E=S.length-1;E>=0;--E){var C=S[E];M(o.symbolInstances.get(C),o.collisionArrays[C])}else for(var I=t.symbolInstanceStart;I<t.symbolInstanceEnd;I++)M(o.symbolInstances.get(I),o.collisionArrays[I]);if(n&&o.bucketInstanceId in this.collisionCircleArrays){var L=this.collisionCircleArrays[o.bucketInstanceId];e.invert(L.invProjMatrix,l),L.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1},Tt.prototype.markUsedJustification=function(t,r,n,i){var a,o={left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex};a=i===e.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:o[e.getAnchorJustification(r)];for(var s=0,l=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];s<l.length;s+=1){var c=l[s];c>=0&&(t.text.placedSymbolArray.get(c).crossTileID=a>=0&&c!==a?0:n.crossTileID)}},Tt.prototype.markUsedOrientation=function(t,r,n){for(var i=r===e.WritingMode.horizontal||r===e.WritingMode.horizontalOnly?r:0,a=r===e.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o<s.length;o+=1){var l=s[o];t.text.placedSymbolArray.get(l).placedOrientation=i}n.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)},Tt.prototype.commit=function(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;var t=this.prevPlacement,r=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;var n=t?t.symbolFadeChange(e):1,i=t?t.opacities:{},a=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],c=i[s];c?(this.opacities[s]=new gt(c,n,l.text,l.icon),r=r||l.text!==c.text.placed||l.icon!==c.icon.placed):(this.opacities[s]=new gt(null,n,l.text,l.icon,l.skipFade),r=r||l.text||l.icon)}for(var u in i){var h=i[u];if(!this.opacities[u]){var f=new gt(h,n,!1,!1);f.isHidden()||(this.opacities[u]=f,r=r||h.text.placed||h.icon.placed)}}for(var p in a)!this.variableOffsets[p]&&this.opacities[p]&&!this.opacities[p].isHidden()&&(this.variableOffsets[p]=a[p]);for(var d in o)!this.placedOrientations[d]&&this.opacities[d]&&!this.opacities[d].isHidden()&&(this.placedOrientations[d]=o[d]);r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)},Tt.prototype.updateLayerOpacities=function(e,t){for(var r={},n=0,i=t;n<i.length;n+=1){var a=i[n],o=a.getBucket(e);o&&a.latestFeatureIndex&&e.id===o.layerIds[0]&&this.updateBucketOpacities(o,r,a.collisionBoxArray)}},Tt.prototype.updateBucketOpacities=function(t,r,n){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 gt(null,0,!1,!1,!0),s=a.get("text-allow-overlap"),l=a.get("icon-allow-overlap"),c=a.get("text-variable-anchor"),u="map"===a.get("text-rotation-alignment"),h="map"===a.get("text-pitch-alignment"),f="none"!==a.get("icon-text-fit"),p=new gt(null,0,s&&(l||!t.hasIconData()||a.get("icon-optional")),l&&(s||!t.hasTextData()||a.get("text-optional")),!0);!t.collisionArrays&&n&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(n);for(var d=function(e,t,r){for(var n=0;n<t/4;n++)e.opacityVertexArray.emplaceBack(r)},m=function(n){var a=t.symbolInstances.get(n),s=a.numHorizontalGlyphVertices,l=a.numVerticalGlyphVertices,m=a.crossTileID,g=r[m],y=i.opacities[m];g?y=o:y||(y=p,i.opacities[m]=y),r[m]=!0;var v=s>0||l>0,x=a.numIconVertices>0,_=i.placedOrientations[a.crossTileID],b=_===e.WritingMode.vertical,w=_===e.WritingMode.horizontal||_===e.WritingMode.horizontalOnly;if(v){var T=Pt(y.text),k=b?zt:T;d(t.text,s,k);var A=w?zt:T;d(t.text,l,A);var M=y.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=M||b?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=M||w?1:0);var S=i.variableOffsets[a.crossTileID];S&&i.markUsedJustification(t,S.anchor,a,_);var E=i.placedOrientations[a.crossTileID];E&&(i.markUsedJustification(t,"left",a,E),i.markUsedOrientation(t,E,a))}if(x){var C=Pt(y.icon),I=!(f&&a.verticalPlacedIconSymbolIndex&&b);if(a.placedIconSymbolIndex>=0){var L=I?C:zt;d(t.icon,a.numIconVertices,L),t.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var P=I?zt:C;d(t.icon,a.numVerticalIconVertices,P),t.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden()}}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var z=t.collisionArrays[n];if(z){var D=new e.Point(0,0);if(z.textBox||z.verticalTextBox){var O=!0;if(c){var R=i.variableOffsets[m];R?(D=bt(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),u&&D._rotate(h?i.transform.angle:-i.transform.angle)):O=!1}z.textBox&&kt(t.textCollisionBox.collisionVertexArray,y.text.placed,!O||b,D.x,D.y),z.verticalTextBox&&kt(t.textCollisionBox.collisionVertexArray,y.text.placed,!O||w,D.x,D.y)}var F=!(w||!z.verticalIconBox);z.iconBox&&kt(t.iconCollisionBox.collisionVertexArray,y.icon.placed,F,f?D.x:0,f?D.y:0),z.verticalIconBox&&kt(t.iconCollisionBox.collisionVertexArray,y.icon.placed,!F,f?D.x:0,f?D.y:0)}}},g=0;g<t.symbolInstances.length;g++)m(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 y=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=y.invProjMatrix,t.placementViewportMatrix=y.viewportMatrix,t.collisionCircleArray=y.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}},Tt.prototype.symbolFadeChange=function(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Tt.prototype.zoomAdjustment=function(e){return Math.max(0,(this.transform.zoom-e)/1.5)},Tt.prototype.hasTransitions=function(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration},Tt.prototype.stillRecent=function(e,t){var r=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*r>e},Tt.prototype.setStale=function(){this.stale=!0};var At=Math.pow(2,25),Mt=Math.pow(2,24),St=Math.pow(2,17),Et=Math.pow(2,16),Ct=Math.pow(2,9),It=Math.pow(2,8),Lt=Math.pow(2,1);function Pt(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;var t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*At+t*Mt+r*St+t*Et+r*Ct+t*It+r*Lt+t}var zt=0,Dt=function(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Dt.prototype.continuePlacement=function(e,t,r,n,i){for(var a=this._bucketParts;this._currentTileIndex<e.length;){var o=e[this._currentTileIndex];if(t.getBucketParts(a,n,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,r),this._currentPartIndex++,i())return!0}return!1};var Ot=function(e,t,r,n,i,a,o){this.placement=new Tt(e,i,a,o),this._currentPlacementIndex=t.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1};Ot.prototype.isDone=function(){return this._done},Ot.prototype.continuePlacement=function(t,r,n){for(var i=this,a=e.browser.now(),o=function(){var t=e.browser.now()-a;return!i._forceFullPlacement&&t>2};this._currentPlacementIndex>=0;){var s=r[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Dt(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Ot.prototype.commit=function(e){return this.placement.commit(e),this.placement};var Rt=512/e.EXTENT/2,Ft=function(e,t,r){this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;n<t.length;n++){var i=t.get(n),a=i.key;this.indexedSymbolInstances[a]||(this.indexedSymbolInstances[a]=[]),this.indexedSymbolInstances[a].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,e)})}};Ft.prototype.getScaledCoordinates=function(t,r){var n=r.canonical.z-this.tileID.canonical.z,i=Rt/Math.pow(2,n);return{x:Math.floor((r.canonical.x*e.EXTENT+t.anchorX)*i),y:Math.floor((r.canonical.y*e.EXTENT+t.anchorY)*i)}},Ft.prototype.findMatches=function(e,t,r){for(var n=this.tileID.canonical.z<t.canonical.z?1:Math.pow(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),l=0,c=o;l<c.length;l+=1){var u=c[l];if(Math.abs(u.coord.x-s.x)<=n&&Math.abs(u.coord.y-s.y)<=n&&!r[u.crossTileID]){r[u.crossTileID]=!0,a.crossTileID=u.crossTileID;break}}}}};var Bt=function(){this.maxCrossTileID=0};Bt.prototype.generate=function(){return++this.maxCrossTileID};var jt=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};jt.prototype.handleWrapJump=function(e){var t=Math.round((e-this.lng)/360);if(0!==t)for(var r in this.indexes){var n=this.indexes[r],i={};for(var a in n){var o=n[a];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+t),i[o.tileID.key]=o}this.indexes[r]=i}this.lng=e},jt.prototype.addBucket=function(e,t,r){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 n=0;n<t.symbolInstances.length;n++)t.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});var i=this.usedCrossTileIDs[e.overscaledZ];for(var a in this.indexes){var o=this.indexes[a];if(Number(a)>e.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(e)&&l.findMatches(t.symbolInstances,e,i)}else{var c=o[e.scaledTo(Number(a)).key];c&&c.findMatches(t.symbolInstances,e,i)}}for(var u=0;u<t.symbolInstances.length;u++){var h=t.symbolInstances.get(u);h.crossTileID||(h.crossTileID=r.generate(),i[h.crossTileID]=!0)}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Ft(e,t.symbolInstances,t.bucketInstanceId),!0},jt.prototype.removeBucketCrossTileIDs=function(e,t){for(var r in t.indexedSymbolInstances)for(var n=0,i=t.indexedSymbolInstances[r];n<i.length;n+=1){var a=i[n];delete this.usedCrossTileIDs[e][a.crossTileID]}},jt.prototype.removeStaleBuckets=function(e){var t=!1;for(var r in this.indexes){var n=this.indexes[r];for(var i in n)e[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],t=!0)}return t};var Nt=function(){this.layerIndexes={},this.crossTileIDs=new Bt,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Nt.prototype.addLayer=function(e,t,r){var n=this.layerIndexes[e.id];void 0===n&&(n=this.layerIndexes[e.id]=new jt);var i=!1,a={};n.handleWrapJump(r);for(var o=0,s=t;o<s.length;o+=1){var l=s[o],c=l.getBucket(e);!c||e.id!==c.layerIds[0]||(c.bucketInstanceId||(c.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(l.tileID,c,this.crossTileIDs)&&(i=!0),a[c.bucketInstanceId]=!0)}return n.removeStaleBuckets(a)&&(i=!0),i},Nt.prototype.pruneUnusedLayers=function(e){var t={};for(var r in e.forEach((function(e){t[e]=!0})),this.layerIndexes)t[r]||delete this.layerIndexes[r]};var Ut=function(t,r){return e.emitValidationErrors(t,r&&r.filter((function(e){return"source.canvas"!==e.identifier})))},Vt=e.pick(Ve,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),qt=e.pick(Ve,["setCenter","setZoom","setBearing","setPitch"]),Ht=function(){var t={},r=e.styleSpec.$version;for(var n in e.styleSpec.$root){var i=e.styleSpec.$root[n];if(i.required){var a;null!=(a="version"===n?r:"array"===i.type?[]:{})&&(t[n]=a)}}return t}(),Gt=function(t){function r(n,i){var a=this;void 0===i&&(i={}),t.call(this),this.map=n,this.dispatcher=new k(je(),this),this.imageManager=new f,this.imageManager.setEventedParent(this),this.glyphManager=new x(n._requestManager,i.localIdeographFontFamily),this.lineAtlas=new T(256,512),this.crossTileSymbolIndex=new Nt,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=r.registerForPluginStateChange((function(t){var r={pluginStatus:t.pluginStatus,pluginURL:t.pluginURL};o.dispatcher.broadcast("syncRTLPluginState",r,(function(t,r){if(e.triggerPluginCompletionEvent(t),r&&r.every((function(e){return e})))for(var n in o.sourceCaches)o.sourceCaches[n].reload()}))})),this.on("data",(function(e){if("source"===e.dataType&&"metadata"===e.sourceDataType){var t=a.sourceCaches[e.sourceId];if(t){var r=t.getSource();if(r&&r.vectorLayerIds)for(var n in a._layers){var i=a._layers[n];i.source===r.id&&a._validateLayer(i)}}}}))}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.loadURL=function(t,r){var n=this;void 0===r&&(r={}),this.fire(new e.Event("dataloading",{dataType:"style"}));var i="boolean"==typeof r.validate?r.validate:!e.isMapboxURL(t);t=this.map._requestManager.normalizeStyleURL(t,r.accessToken);var a=this.map._requestManager.transformRequest(t,e.ResourceType.Style);this._request=e.getJSON(a,(function(t,r){n._request=null,t?n.fire(new e.ErrorEvent(t)):r&&n._load(r,i)}))},r.prototype.loadJSON=function(t,r){var n=this;void 0===r&&(r={}),this.fire(new e.Event("dataloading",{dataType:"style"})),this._request=e.browser.frame((function(){n._request=null,n._load(t,!1!==r.validate)}))},r.prototype.loadEmpty=function(){this.fire(new e.Event("dataloading",{dataType:"style"})),this._load(Ht,!1)},r.prototype._load=function(t,r){if(!r||!Ut(this,e.validateStyle(t))){for(var n in this._loaded=!0,this.stylesheet=t,t.sources)this.addSource(n,t.sources[n],{validate:!1});t.sprite?this._loadSprite(t.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);var i=Ue(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)).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 w(this.stylesheet.light),this.fire(new e.Event("data",{dataType:"style"})),this.fire(new e.Event("style.load"))}},r.prototype._loadSprite=function(t){var r=this;this._spriteRequest=function(t,r,n){var i,a,o,s=e.browser.devicePixelRatio>1?"@2x":"",l=e.getJSON(r.transformRequest(r.normalizeSpriteURL(t,s,".json"),e.ResourceType.SpriteJSON),(function(e,t){l=null,o||(o=e,i=t,u())})),c=e.getImage(r.transformRequest(r.normalizeSpriteURL(t,s,".png"),e.ResourceType.SpriteImage),(function(e,t){c=null,o||(o=e,a=t,u())}));function u(){if(o)n(o);else if(i&&a){var t=e.browser.getImageData(a),r={};for(var s in i){var l=i[s],c=l.width,u=l.height,h=l.x,f=l.y,p=l.sdf,d=l.pixelRatio,m=l.stretchX,g=l.stretchY,y=l.content,v=new e.RGBAImage({width:c,height:u});e.RGBAImage.copy(t,v,{x:h,y:f},{x:0,y:0},{width:c,height:u}),r[s]={data:v,pixelRatio:d,sdf:p,stretchX:m,stretchY:g,content:y}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(t,this.map._requestManager,(function(t,n){if(r._spriteRequest=null,t)r.fire(new e.ErrorEvent(t));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new e.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(t){var r=this.sourceCaches[t.source];if(r){var n=t.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new e.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+t.id+'"')))}}},r.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()},r.prototype._serializeLayers=function(e){for(var t=[],r=0,n=e;r<n.length;r+=1){var i=n[r],a=this._layers[i];"custom"!==a.type&&t.push(a.serialize())}return t},r.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},r.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},r.prototype.update=function(t){if(this._loaded){var r=this._changed;if(this._changed){var n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var a in(n.length||i.length)&&this._updateWorkerLayers(n,i),this._updatedSources){var o=this._updatedSources[a];"reload"===o?this._reloadSource(a):"clear"===o&&this._clearSource(a)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}var l={};for(var c in this.sourceCaches){var u=this.sourceCaches[c];l[c]=u.used,u.used=!1}for(var h=0,f=this._order;h<f.length;h+=1){var p=f[h],d=this._layers[p];d.recalculate(t,this._availableImages),!d.isHidden(t.zoom)&&d.source&&(this.sourceCaches[d.source].used=!0)}for(var m in l){var g=this.sourceCaches[m];l[m]!==g.used&&g.fire(new e.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:m}))}this.light.recalculate(t),this.z=t.zoom,r&&this.fire(new e.Event("data",{dataType:"style"}))}},r.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={}}},r.prototype._updateWorkerLayers=function(e,t){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(e),removedIds:t})},r.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},r.prototype.setState=function(t){var r=this;if(this._checkLoaded(),Ut(this,e.validateStyle(t)))return!1;(t=e.clone$1(t)).layers=Ue(t.layers);var n=function(t,r){if(!t)return[{command:Ve.setStyle,args:[r]}];var n=[];try{if(!e.deepEqual(t.version,r.version))return[{command:Ve.setStyle,args:[r]}];e.deepEqual(t.center,r.center)||n.push({command:Ve.setCenter,args:[r.center]}),e.deepEqual(t.zoom,r.zoom)||n.push({command:Ve.setZoom,args:[r.zoom]}),e.deepEqual(t.bearing,r.bearing)||n.push({command:Ve.setBearing,args:[r.bearing]}),e.deepEqual(t.pitch,r.pitch)||n.push({command:Ve.setPitch,args:[r.pitch]}),e.deepEqual(t.sprite,r.sprite)||n.push({command:Ve.setSprite,args:[r.sprite]}),e.deepEqual(t.glyphs,r.glyphs)||n.push({command:Ve.setGlyphs,args:[r.glyphs]}),e.deepEqual(t.transition,r.transition)||n.push({command:Ve.setTransition,args:[r.transition]}),e.deepEqual(t.light,r.light)||n.push({command:Ve.setLight,args:[r.light]});var i={},a=[];!function(t,r,n,i){var a;for(a in r=r||{},t=t||{})t.hasOwnProperty(a)&&(r.hasOwnProperty(a)||He(a,n,i));for(a in r)r.hasOwnProperty(a)&&(t.hasOwnProperty(a)?e.deepEqual(t[a],r[a])||("geojson"===t[a].type&&"geojson"===r[a].type&&We(t,r,a)?n.push({command:Ve.setGeoJSONSourceData,args:[a,r[a].data]}):Ge(a,r,n,i)):qe(a,r,n))}(t.sources,r.sources,a,i);var o=[];t.layers&&t.layers.forEach((function(e){i[e.source]?n.push({command:Ve.removeLayer,args:[e.id]}):o.push(e)})),n=n.concat(a),function(t,r,n){r=r||[];var i,a,o,s,l,c,u,h=(t=t||[]).map(Ye),f=r.map(Ye),p=t.reduce(Xe,{}),d=r.reduce(Xe,{}),m=h.slice(),g=Object.create(null);for(i=0,a=0;i<h.length;i++)o=h[i],d.hasOwnProperty(o)?a++:(n.push({command:Ve.removeLayer,args:[o]}),m.splice(m.indexOf(o,a),1));for(i=0,a=0;i<f.length;i++)o=f[f.length-1-i],m[m.length-1-i]!==o&&(p.hasOwnProperty(o)?(n.push({command:Ve.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-a),1)):a++,c=m[m.length-i],n.push({command:Ve.addLayer,args:[d[o],c]}),m.splice(m.length-i,0,o),g[o]=!0);for(i=0;i<f.length;i++)if(s=p[o=f[i]],l=d[o],!g[o]&&!e.deepEqual(s,l)){if(!e.deepEqual(s.source,l.source)||!e.deepEqual(s["source-layer"],l["source-layer"])||!e.deepEqual(s.type,l.type)){n.push({command:Ve.removeLayer,args:[o]}),c=m[m.lastIndexOf(o)+1],n.push({command:Ve.addLayer,args:[l,c]});continue}for(u in Ze(s.layout,l.layout,n,o,null,Ve.setLayoutProperty),Ze(s.paint,l.paint,n,o,null,Ve.setPaintProperty),e.deepEqual(s.filter,l.filter)||n.push({command:Ve.setFilter,args:[o,l.filter]}),(!e.deepEqual(s.minzoom,l.minzoom)||!e.deepEqual(s.maxzoom,l.maxzoom))&&n.push({command:Ve.setLayerZoomRange,args:[o,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(u)&&("layout"===u||"paint"===u||"filter"===u||"metadata"===u||"minzoom"===u||"maxzoom"===u||(0===u.indexOf("paint.")?Ze(s[u],l[u],n,o,u.slice(6),Ve.setPaintProperty):e.deepEqual(s[u],l[u])||n.push({command:Ve.setLayerProperty,args:[o,u,l[u]]})));for(u in l)!l.hasOwnProperty(u)||s.hasOwnProperty(u)||"layout"===u||"paint"===u||"filter"===u||"metadata"===u||"minzoom"===u||"maxzoom"===u||(0===u.indexOf("paint.")?Ze(s[u],l[u],n,o,u.slice(6),Ve.setPaintProperty):e.deepEqual(s[u],l[u])||n.push({command:Ve.setLayerProperty,args:[o,u,l[u]]}))}}(o,r.layers,n)}catch(e){console.warn("Unable to compute style diff:",e),n=[{command:Ve.setStyle,args:[r]}]}return n}(this.serialize(),t).filter((function(e){return!(e.command in qt)}));if(0===n.length)return!1;var i=n.filter((function(e){return!(e.command in Vt)}));if(i.length>0)throw new Error("Unimplemented: "+i.map((function(e){return e.command})).join(", ")+".");return n.forEach((function(e){"setTransition"!==e.command&&r[e.command].apply(r,e.args)})),this.stylesheet=t,!0},r.prototype.addImage=function(t,r){if(this.getImage(t))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(t,r),this._afterImageUpdated(t)},r.prototype.updateImage=function(e,t){this.imageManager.updateImage(e,t)},r.prototype.getImage=function(e){return this.imageManager.getImage(e)},r.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this._afterImageUpdated(t)},r.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"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(t,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(e.validateStyle.source,"sources."+t,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[t]=new Le(t,r,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}},r.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===t)return this.fire(new e.ErrorEvent(new Error('Source "'+t+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(e,t){this._checkLoaded(),this.sourceCaches[e].getSource().setData(t),this._changed=!0},r.prototype.getSource=function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()},r.prototype.addLayer=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=t.id;if(this.getLayer(i))this.fire(new e.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===t.type){if(Ut(this,e.validateCustomStyleLayer(t)))return;a=e.createStyleLayer(t)}else{if("object"==typeof t.source&&(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},n))return;a=e.createStyleLayer(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(t,r){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==r){var n=this._order.indexOf(t);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;if(r&&-1===i)return void this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));this._order.splice(i,0,t),this._layerOrderChanged=!0}}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(t){this._checkLoaded();var r=this._layers[t];if(r){r.setEventedParent(null);var n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(e){return this._layers[e]},r.prototype.hasLayer=function(e){return e in this._layers},r.prototype.setLayerZoomRange=function(t,r,n){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(t);if(i){if(!e.deepEqual(i.filter,r)){if(null==r)return i.filter=void 0,void this._updateLayer(i);this._validate(e.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=e.clone$1(r),this._updateLayer(i))}}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(t){return e.clone$1(this.getLayer(t).filter)},r.prototype.setLayoutProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(t,r){var n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(e,t){return this.getLayer(e).getPaintProperty(t)},r.prototype.setFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=t.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,t.id,r)):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,t.id,r):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(t){this._checkLoaded();var r=t.source,n=t.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,t.id);this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.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 void 0!==e}))},r.prototype._updateLayer=function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(e){for(var t=this,r=function(e){return"fill-extrusion"===t._layers[e].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=e;s<l.length;s+=1){var c=l[s][o];if(c)for(var u=0,h=c;u<h.length;u+=1){var f=h[u];i.push(f)}}}}i.sort((function(e,t){return t.intersectionZ-e.intersectionZ}));for(var p=[],d=this._order.length-1;d>=0;d--){var m=this._order[d];if(r(m))for(var g=i.length-1;g>=0;g--){var y=i[g].feature;if(n[y.layer.id]<d)break;p.push(y),i.pop()}else for(var v=0,x=e;v<x.length;v+=1){var _=x[v][m];if(_)for(var b=0,w=_;b<w.length;b+=1){var T=w[b];p.push(T.feature)}}}return p},r.prototype.queryRenderedFeatures=function(t,r,n){r&&r.filter&&this._validate(e.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new e.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var a=0,o=r.layers;a<o.length;a+=1){var s=o[a],l=this._layers[s];if(!l)return this.fire(new e.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];i[l.source]=!0}}var c=[];for(var u in r.availableImages=this._availableImages,this.sourceCaches)r.layers&&!i[u]||c.push(F(this.sourceCaches[u],this._layers,this._serializedLayers,t,r,n));return this.placement&&c.push(function(e,t,r,n,i,a,o){for(var s={},l=a.queryRenderedSymbols(n),c=[],u=0,h=Object.keys(l).map(Number);u<h.length;u+=1){var f=h[u];c.push(o[f])}c.sort(B);for(var p=function(){var r=m[d],n=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],t,r.bucketIndex,r.sourceLayerIndex,i.filter,i.layers,i.availableImages,e);for(var a in n){var o=s[a]=s[a]||[],c=n[a];c.sort((function(e,t){var n=r.featureSortOrder;if(n){var i=n.indexOf(e.featureIndex);return n.indexOf(t.featureIndex)-i}return t.featureIndex-e.featureIndex}));for(var u=0,h=c;u<h.length;u+=1){var f=h[u];o.push(f)}}},d=0,m=c;d<m.length;d+=1)p();var g=function(t){s[t].forEach((function(n){var i=n.feature,a=e[t],o=r[a.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=o}))};for(var y in s)g(y);return s}(this._layers,this._serializedLayers,this.sourceCaches,t,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)},r.prototype.querySourceFeatures=function(t,r){r&&r.filter&&this._validate(e.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);var n=this.sourceCaches[t];return n?function(e,t){for(var r=e.getRenderableIds().map((function(t){return e.getTileByID(t)})),n=[],i={},a=0;a<r.length;a++){var o=r[a],s=o.tileID.canonical.key;i[s]||(i[s]=!0,o.querySourceFeatures(n,t))}return n}(n,r):[]},r.prototype.addSourceType=function(e,t,n){return r.getSourceType(e)?n(new Error('A source type called "'+e+'" already exists.')):(r.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},n):n(null,null))},r.prototype.getLight=function(){return this.light.getLight()},r.prototype.setLight=function(t,r){void 0===r&&(r={}),this._checkLoaded();var n=this.light.getLight(),i=!1;for(var a in t)if(!e.deepEqual(t[a],n[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,r),this.light.updateTransitions(o)}},r.prototype._validate=function(t,r,n,i,a){return void 0===a&&(a={}),(!a||!1!==a.validate)&&Ut(this,t.call(e.validateStyle,e.extend({key:r,style:this.serialize(),value:n,styleSpec:e.styleSpec},i)))},r.prototype._remove=function(){for(var t in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[t].setEventedParent(null);for(var r in this.sourceCaches)this.sourceCaches[r].clearTiles(),this.sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},r.prototype._clearSource=function(e){this.sourceCaches[e].clearTiles()},r.prototype._reloadSource=function(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()},r.prototype._updateSources=function(e){for(var t in this.sourceCaches)this.sourceCaches[t].update(e)},r.prototype._generateCollisionBoxes=function(){for(var e in this.sourceCaches)this._reloadSource(e)},r.prototype._updatePlacement=function(t,r,n,i,a){void 0===a&&(a=!1);for(var o=!1,s=!1,l={},c=0,u=this._order;c<u.length;c+=1){var h=u[c],f=this._layers[h];if("symbol"===f.type){if(!l[f.source]){var p=this.sourceCaches[f.source];l[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 d=this.crossTileSymbolIndex.addLayer(f,l[f.source],t.center.lng);o=o||d}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((a=a||this._layerOrderChanged||0===n)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.browser.now(),t.zoom))&&(this.pauseablePlacement=new Ot(t,this._order,a,r,n,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.browser.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(var m=0,g=this._order;m<g.length;m+=1){var y=g[m],v=this._layers[y];"symbol"===v.type&&this.placement.updateLayerOpacities(v,l[v.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.browser.now())},r.prototype._releaseSymbolFadeTiles=function(){for(var e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()},r.prototype.getImages=function(e,t,r){this.imageManager.getImages(t.icons,r),this._updateTilesForChangedImages();var n=this.sourceCaches[t.source];n&&n.setDependencies(t.tileID.key,t.type,t.icons)},r.prototype.getGlyphs=function(e,t,r){this.glyphManager.getGlyphs(t.stacks,r)},r.prototype.getResource=function(t,r,n){return e.makeRequest(r,n)},r}(e.Evented);Gt.getSourceType=function(e){return O[e]},Gt.setSourceType=function(e,t){O[e]=t},Gt.registerForPluginStateChange=e.registerForPluginStateChange;var Wt=e.createLayout([{name:"a_pos",type:"Int16",components:2}]),Zt=xr("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),Yt=xr("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Xt=xr("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),$t=xr("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);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);}"),Kt=xr("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);}"),Jt=xr("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),Qt=xr("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),er=xr("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,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;}"),tr=xr("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);}"),rr=xr("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,0,1);}"),nr=xr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),ir=xr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ar=xr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),or=xr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),sr=xr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;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;}"),lr=xr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;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\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),cr=xr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),ur=xr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),hr=xr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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);}"),fr=xr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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);}"),pr=xr("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;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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;}"),dr=xr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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);}"),mr=xr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),gr=xr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),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));}"),yr=xr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),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);}"),vr=xr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),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);}");function xr(e,t){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=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(r,(function(e,t,r,n,i){return s[i]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:t=t.replace(r,(function(e,t,r,n,i){var a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:o}}var _r=Object.freeze({__proto__:null,prelude:Zt,background:Yt,backgroundPattern:Xt,circle:$t,clippingMask:Kt,heatmap:Jt,heatmapTexture:Qt,collisionBox:er,collisionCircle:tr,debug:rr,fill:nr,fillOutline:ir,fillOutlinePattern:ar,fillPattern:or,fillExtrusion:sr,fillExtrusionPattern:lr,hillshadePrepare:cr,hillshade:ur,line:hr,lineGradient:fr,linePattern:pr,lineSDF:dr,raster:mr,symbolIcon:gr,symbolSDF:yr,symbolTextAndIcon:vr}),br=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function wr(e){for(var t=[],r=0;r<e.length;r++)if(null!==e[r]){var n=e[r].split(" ");t.push(n.pop())}return t}br.prototype.bind=function(e,t,r,n,i,a,o,s){this.context=e;for(var l=this.boundPaintVertexBuffers.length!==n.length,c=0;!l&&c<n.length;c++)this.boundPaintVertexBuffers[c]!==n[c]&&(l=!0);var u=!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==r||l||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s;!e.extVertexArrayObject||u?this.freshBind(t,r,n,i,a,o,s):(e.bindVertexArrayOES.set(this.vao),o&&o.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind())},br.prototype.freshBind=function(e,t,r,n,i,a,o){var s,l=e.numAttributes,c=this.context,u=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o;else{s=c.currentNumAttributes||0;for(var h=l;h<s;h++)u.disableVertexAttribArray(h)}t.enableAttributes(u,e);for(var f=0,p=r;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 d=0,m=r;d<m.length;d+=1){var g=m[d];g.bind(),g.setVertexAttribPointers(u,e,i)}a&&(a.bind(),a.setVertexAttribPointers(u,e,i)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,e,i)),c.currentNumAttributes=l},br.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var Tr=function(e,t,r,n,i,a){var o=e.gl;this.program=o.createProgram();for(var s=wr(r.staticAttributes),l=n?n.getBinderAttributes():[],c=s.concat(l),u=r.staticUniforms?wr(r.staticUniforms):[],h=n?n.getBinderUniforms():[],f=[],p=0,d=u.concat(h);p<d.length;p+=1){var m=d[p];f.indexOf(m)<0&&f.push(m)}var g=n?n.defines():[];a&&g.push("#define OVERDRAW_INSPECTOR;");var y=g.concat(Zt.fragmentSource,r.fragmentSource).join("\n"),v=g.concat(Zt.vertexSource,r.vertexSource).join("\n"),x=o.createShader(o.FRAGMENT_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(x,y),o.compileShader(x),o.attachShader(this.program,x);var _=o.createShader(o.VERTEX_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(_,v),o.compileShader(_),o.attachShader(this.program,_),this.attributes={};var b={};this.numAttributes=c.length;for(var w=0;w<this.numAttributes;w++)c[w]&&(o.bindAttribLocation(this.program,w,c[w]),this.attributes[c[w]]=w);o.linkProgram(this.program),o.deleteShader(_),o.deleteShader(x);for(var T=0;T<f.length;T++){var k=f[T];if(k&&!b[k]){var A=o.getUniformLocation(this.program,k);A&&(b[k]=A)}}this.fixedUniforms=i(e,b),this.binderUniforms=n?n.getUniforms(e,b):[]}}};function kr(e,t,r){var n=1/dt(r,1,t.transform.tileZoom),i=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,t.transform.tileZoom)/i,o=a*(r.tileID.canonical.x+r.tileID.wrap*i),s=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}Tr.prototype.draw=function(e,t,r,n,i,a,o,s,l,c,u,h,f,p,d,m){var g,y=e.gl;if(!this.failedToCreate){for(var v in e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(n),e.setColorMode(i),e.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);p&&p.setUniforms(e,this.binderUniforms,h,{zoom:f});for(var x=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[t],_=0,b=u.get();_<b.length;_+=1){var w=b[_],T=w.vaos||(w.vaos={});(T[s]||(T[s]=new br)).bind(e,this,l,p?p.getPaintVertexBuffers():[],c,w.vertexOffset,d,m),y.drawElements(t,w.primitiveLength*x,y.UNSIGNED_SHORT,w.primitiveOffset*x*2)}}};var Ar=function(t,r,n,i){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=e.create$1();"viewport"===a.properties.get("anchor")&&e.fromRotation(l,-r.transform.angle),e.transformMat3(s,s,l);var c=a.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},Mr=function(t,r,n,i,a,o,s){return e.extend(Ar(t,r,n,i),kr(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},Sr=function(e){return{u_matrix:e}},Er=function(t,r,n,i){return e.extend(Sr(t),kr(n,r,i))},Cr=function(e,t){return{u_matrix:e,u_world:t}},Ir=function(t,r,n,i,a){return e.extend(Er(t,r,n,i),{u_world:a})},Lr=function(t,r,n,i){var a,o,s=t.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=dt(n,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:o}},Pr=function(e,t,r){var n=dt(r,1,t.zoom),i=Math.pow(2,t.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:e,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[t.pixelsToGLUnits[0]/(n*i),t.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:a}},zr=function(e,t,r){return{u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},Dr=function(e,t,r){return void 0===r&&(r=1),{u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:r}},Or=function(e){return{u_matrix:e}},Rr=function(e,t,r,n){return{u_matrix:e,u_extrude_scale:dt(t,1,r),u_intensity:n}};function Fr(t,r){var n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new e.MercatorCoordinate(0,i/n).toLngLat().lat,new e.MercatorCoordinate(0,(i+1)/n).toLngLat().lat]}var Br=function(t,r,n){var i=t.transform;return{u_matrix:qr(t,r,n),u_ratio:1/dt(r,1,i.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},jr=function(t,r,n,i){return e.extend(Br(t,r,n),{u_image:0,u_image_height:i})},Nr=function(t,r,n,i){var a=t.transform,o=Vr(r,a);return{u_matrix:qr(t,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/dt(r,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]]}},Ur=function(t,r,n,i,a){var o=t.transform,s=t.lineAtlas,l=Vr(r,o),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),f=u.width*a.fromScale,p=h.width*a.toScale;return e.extend(Br(t,r,n),{u_patternscale_a:[l/f,-u.height/2],u_patternscale_b:[l/p,-h.height/2],u_sdfgamma:s.width/(256*Math.min(f,p)*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.y,u_mix:a.t})};function Vr(e,t){return 1/dt(e,1,t.tileZoom)}function qr(e,t,r){return e.translatePosMatrix(t.tileID.posMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Hr=function(e,t,r,n,i){return{u_matrix:e,u_tl_parent:t,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.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:Zr(i.paint.get("raster-saturation")),u_contrast_factor:Wr(i.paint.get("raster-contrast")),u_spin_weights:Gr(i.paint.get("raster-hue-rotate"))}};function Gr(e){e*=Math.PI/180;var t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}function Wr(e){return e>0?1/(1-e):1+e}function Zr(e){return e>0?1-1/(1.001-e):-e}var Yr,Xr=function(e,t,r,n,i,a,o,s,l,c){var u=i.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),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:+r,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:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},$r=function(t,r,n,i,a,o,s,l,c,u,h){var f=a.transform;return e.extend(Xr(t,r,n,i,a,o,s,l,c,u),{u_gamma_scale:i?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+h})},Kr=function(t,r,n,i,a,o,s,l,c,u){return e.extend($r(t,r,n,i,a,o,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Jr=function(e,t,r){return{u_matrix:e,u_opacity:t,u_color:r}},Qr=function(t,r,n,i,a,o){return e.extend(function(e,t,r,n){var i=r.imageManager.getPattern(e.from.toString()),a=r.imageManager.getPattern(e.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=u*(n.tileID.canonical.x+n.tileID.wrap*c),f=u*n.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,l],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/dt(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,f>>16],u_pixel_coord_lower:[65535&h,65535&f]}}(i,o,n,a),{u_matrix:t,u_opacity:r})},en={fillExtrusion:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fillExtrusionPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,r.u_height_factor),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fill:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},fillPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},fillOutline:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world)}},fillOutlinePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},circle:function(t,r){return{u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,r.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},collisionBox:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(t,r.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_overscale_factor:new e.Uniform1f(t,r.u_overscale_factor)}},collisionCircle:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_inv_matrix:new e.UniformMatrix4f(t,r.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(t,r.u_viewport_size)}},debug:function(t,r){return{u_color:new e.UniformColor(t,r.u_color),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_overlay:new e.Uniform1i(t,r.u_overlay),u_overlay_scale:new e.Uniform1f(t,r.u_overlay_scale)}},clippingMask:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmap:function(t,r){return{u_extrude_scale:new e.Uniform1f(t,r.u_extrude_scale),u_intensity:new e.Uniform1f(t,r.u_intensity),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmapTexture:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_color_ramp:new e.Uniform1i(t,r.u_color_ramp),u_opacity:new e.Uniform1f(t,r.u_opacity)}},hillshade:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_latrange:new e.Uniform2f(t,r.u_latrange),u_light:new e.Uniform2f(t,r.u_light),u_shadow:new e.UniformColor(t,r.u_shadow),u_highlight:new e.UniformColor(t,r.u_highlight),u_accent:new e.UniformColor(t,r.u_accent)}},hillshadePrepare:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_dimension:new e.Uniform2f(t,r.u_dimension),u_zoom:new e.Uniform1f(t,r.u_zoom),u_unpack:new e.Uniform4f(t,r.u_unpack)}},line:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels)}},lineGradient:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_image:new e.Uniform1i(t,r.u_image),u_image_height:new e.Uniform1f(t,r.u_image_height)}},linePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texsize:new e.Uniform2f(t,r.u_texsize),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_image:new e.Uniform1i(t,r.u_image),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},lineSDF:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,r.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,r.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,r.u_sdfgamma),u_image:new e.Uniform1i(t,r.u_image),u_tex_y_a:new e.Uniform1f(t,r.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,r.u_tex_y_b),u_mix:new e.Uniform1f(t,r.u_mix)}},raster:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_tl_parent:new e.Uniform2f(t,r.u_tl_parent),u_scale_parent:new e.Uniform1f(t,r.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,r.u_buffer_scale),u_fade_t:new e.Uniform1f(t,r.u_fade_t),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image0:new e.Uniform1i(t,r.u_image0),u_image1:new e.Uniform1i(t,r.u_image1),u_brightness_low:new e.Uniform1f(t,r.u_brightness_low),u_brightness_high:new e.Uniform1f(t,r.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,r.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,r.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,r.u_spin_weights)}},symbolIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture)}},symbolSDF:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},symbolTextAndIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texsize_icon:new e.Uniform2f(t,r.u_texsize_icon),u_texture:new e.Uniform1i(t,r.u_texture),u_texture_icon:new e.Uniform1i(t,r.u_texture_icon),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},background:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_color:new e.UniformColor(t,r.u_color)}},backgroundPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image:new e.Uniform1i(t,r.u_image),u_pattern_tl_a:new e.Uniform2f(t,r.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,r.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,r.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,r.u_pattern_br_b),u_texsize:new e.Uniform2f(t,r.u_texsize),u_mix:new e.Uniform1f(t,r.u_mix),u_pattern_size_a:new e.Uniform2f(t,r.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,r.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,r.u_scale_a),u_scale_b:new e.Uniform1f(t,r.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,r.u_tile_units_to_pixels)}}};function tn(t,r,n,i,a,o,s){for(var l=t.context,c=l.gl,u=t.useProgram("collisionBox"),h=[],f=0,p=0,d=0;d<i.length;d++){var m=i[d],g=r.getTile(m),y=g.getBucket(n);if(y){var v=m.posMatrix;(0!==a[0]||0!==a[1])&&(v=t.translatePosMatrix(m.posMatrix,g,a,o));var x=s?y.textCollisionBox:y.iconCollisionBox,_=y.collisionCircleArray;if(_.length>0){var b=e.create(),w=v;e.mul(b,y.placementInvProjMatrix,t.transform.glCoordMatrix),e.mul(b,b,y.placementViewportMatrix),h.push({circleArray:_,circleOffset:p,transform:w,invTransform:b}),p=f+=_.length/4}x&&u.draw(l,c.LINES,Ae.disabled,Se.disabled,t.colorModeForRenderPass(),Ce.disabled,Pr(v,t.transform,g),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,t.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&h.length){var T=t.useProgram("collisionCircle"),k=new e.StructArrayLayout2f1f2i16;k.resize(4*f),k._trim();for(var A=0,M=0,S=h;M<S.length;M+=1)for(var E=S[M],C=0;C<E.circleArray.length/4;C++){var I=4*C,L=E.circleArray[I+0],P=E.circleArray[I+1],z=E.circleArray[I+2],D=E.circleArray[I+3];k.emplace(A++,L,P,z,D,0),k.emplace(A++,L,P,z,D,1),k.emplace(A++,L,P,z,D,2),k.emplace(A++,L,P,z,D,3)}(!Yr||Yr.length<2*f)&&(Yr=function(t){var r=2*t,n=new e.StructArrayLayout3ui6;n.resize(r),n._trim();for(var i=0;i<r;i++){var a=6*i;n.uint16[a+0]=4*i+0,n.uint16[a+1]=4*i+1,n.uint16[a+2]=4*i+2,n.uint16[a+3]=4*i+2,n.uint16[a+4]=4*i+3,n.uint16[a+5]=4*i+0}return n}(f));for(var O=l.createIndexBuffer(Yr,!0),R=l.createVertexBuffer(k,e.collisionCircleLayout.members,!0),F=0,B=h;F<B.length;F+=1){var j=B[F],N=zr(j.transform,j.invTransform,t.transform);T.draw(l,c.TRIANGLES,Ae.disabled,Se.disabled,t.colorModeForRenderPass(),Ce.disabled,N,n.id,R,O,e.SegmentVector.simpleSegment(0,2*j.circleOffset,j.circleArray.length,j.circleArray.length/2),null,t.transform.zoom,null,null,null)}R.destroy(),O.destroy()}}var rn=e.identity(new Float32Array(16));function nn(t,r,n,i,a,o){var s=e.getAnchorAlignment(t),l=-(s.horizontalAlign-.5)*r,c=-(s.verticalAlign-.5)*n,u=e.evaluateVariableOffset(t,i);return new e.Point((l/a+u[0])*o,(c/a+u[1])*o)}function an(t,r,n,i,a,o,s,l,c,u,h){var f=t.text.placedSymbolArray,p=t.text.dynamicLayoutVertexArray,d=t.icon.dynamicLayoutVertexArray,m={};p.clear();for(var g=0;g<f.length;g++){var y=f.get(g),v=t.allowVerticalPlacement&&!y.placedOrientation,x=y.hidden||!y.crossTileID||v?null:i[y.crossTileID];if(x){var _=new e.Point(y.anchorX,y.anchorY),b=et(_,n?l:s),w=tt(o.cameraToCenterDistance,b.signedDistanceFromCamera),T=a.evaluateSizeForFeature(t.textSizeData,u,y)*w/e.ONE_EM;n&&(T*=t.tilePixelRatio/c);for(var k=x.width,A=x.height,M=nn(x.anchor,k,A,x.textOffset,x.textBoxScale,T),S=n?et(_.add(M),s).point:b.point.add(r?M.rotate(-o.angle):M),E=t.allowVerticalPlacement&&y.placedOrientation===e.WritingMode.vertical?Math.PI/2:0,C=0;C<y.numGlyphs;C++)e.addDynamicAttributes(p,S,E);h&&y.associatedIconIndex>=0&&(m[y.associatedIconIndex]={shiftedAnchor:S,angle:E})}else ut(y.numGlyphs,p)}if(h){d.clear();for(var I=t.icon.placedSymbolArray,L=0;L<I.length;L++){var P=I.get(L);if(P.hidden)ut(P.numGlyphs,d);else{var z=m[L];if(z)for(var D=0;D<P.numGlyphs;D++)e.addDynamicAttributes(d,z.shiftedAnchor,z.angle);else ut(P.numGlyphs,d)}}t.icon.dynamicLayoutVertexBuffer.updateData(d)}t.text.dynamicLayoutVertexBuffer.updateData(p)}function on(e,t,r){return r.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function sn(t,r,n,i,a,o,s,l,c,u,h,f){for(var p=t.context,d=p.gl,m=t.transform,g="map"===l,y="map"===c,v=g&&"point"!==n.layout.get("symbol-placement"),x=g&&!y&&!v,_=void 0!==n.layout.get("symbol-sort-key").constantOr(1),b=!1,w=t.depthModeForSublayer(0,Ae.ReadOnly),T=n.layout.get("text-variable-anchor"),k=[],A=0,M=i;A<M.length;A+=1){var S=M[A],E=r.getTile(S),C=E.getBucket(n);if(C){var I=a?C.text:C.icon;if(I&&I.segments.get().length){var L=I.programConfigurations.get(n.id),P=a||C.sdfIcons,z=a?C.textSizeData:C.iconSizeData,D=y||0!==m.pitch,O=t.useProgram(on(P,a,C),L),R=e.evaluateSizeForZoom(z,m.zoom),F=void 0,B=[0,0],j=void 0,N=void 0,U=null,V=void 0;if(a){if(j=E.glyphAtlasTexture,N=d.LINEAR,F=E.glyphAtlasTexture.size,C.iconsInText){B=E.imageAtlasTexture.size,U=E.imageAtlasTexture;var q="composite"===z.kind||"camera"===z.kind;V=D||t.options.rotating||t.options.zooming||q?d.LINEAR:d.NEAREST}}else{var H=1!==n.layout.get("icon-size").constantOr(0)||C.iconsNeedLinear;j=E.imageAtlasTexture,N=P||t.options.rotating||t.options.zooming||H||D?d.LINEAR:d.NEAREST,F=E.imageAtlasTexture.size}var G=dt(E,1,t.transform.zoom),W=Je(S.posMatrix,y,g,t.transform,G),Z=Qe(S.posMatrix,y,g,t.transform,G),Y=T&&C.hasTextData(),X="none"!==n.layout.get("icon-text-fit")&&Y&&C.hasIconData();v&&nt(C,S.posMatrix,t,a,W,Z,y,u);var $=t.translatePosMatrix(S.posMatrix,E,o,s),K=v||a&&T||X?rn:W,J=t.translatePosMatrix(Z,E,o,s,!0),Q=P&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),ee={program:O,buffers:I,uniformValues:P?C.iconsInText?Kr(z.kind,R,x,y,t,$,K,J,F,B):$r(z.kind,R,x,y,t,$,K,J,a,F,!0):Xr(z.kind,R,x,y,t,$,K,J,a,F),atlasTexture:j,atlasTextureIcon:U,atlasInterpolation:N,atlasInterpolationIcon:V,isSDF:P,hasHalo:Q};if(_&&C.canOverlap){b=!0;for(var te=0,re=I.segments.get();te<re.length;te+=1){var ne=re[te];k.push({segments:new e.SegmentVector([ne]),sortKey:ne.sortKey,state:ee})}}else k.push({segments:I.segments,sortKey:0,state:ee})}}}b&&k.sort((function(e,t){return e.sortKey-t.sortKey}));for(var ie=0,ae=k;ie<ae.length;ie+=1){var oe=ae[ie],se=oe.state;if(p.activeTexture.set(d.TEXTURE0),se.atlasTexture.bind(se.atlasInterpolation,d.CLAMP_TO_EDGE),se.atlasTextureIcon&&(p.activeTexture.set(d.TEXTURE1),se.atlasTextureIcon&&se.atlasTextureIcon.bind(se.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),se.isSDF){var le=se.uniformValues;se.hasHalo&&(le.u_is_halo=1,ln(se.buffers,oe.segments,n,t,se.program,w,h,f,le)),le.u_is_halo=0}ln(se.buffers,oe.segments,n,t,se.program,w,h,f,se.uniformValues)}}function ln(e,t,r,n,i,a,o,s,l){var c=n.context,u=c.gl;i.draw(c,u.TRIANGLES,a,o,s,Ce.disabled,l,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,n.transform.zoom,e.programConfigurations.get(r.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function cn(e,t,r,n,i,a,o){var s,l,c,u,h,f=e.context.gl,p=r.paint.get("fill-pattern"),d=p&&p.constantOr(1),m=r.getCrossfadeParameters();o?(l=d&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=f.LINES):(l=d?"fillPattern":"fill",s=f.TRIANGLES);for(var g=0,y=n;g<y.length;g+=1){var v=y[g],x=t.getTile(v);if(!d||x.patternsLoaded()){var _=x.getBucket(r);if(_){var b=_.programConfigurations.get(r.id),w=e.useProgram(l,b);d&&(e.context.activeTexture.set(f.TEXTURE0),x.imageAtlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),b.updatePaintBuffers(m));var T=p.constantOr(null);if(T&&x.imageAtlas){var k=x.imageAtlas,A=k.patternPositions[T.to.toString()],M=k.patternPositions[T.from.toString()];A&&M&&b.setConstantPatternPositions(A,M)}var S=e.translatePosMatrix(v.posMatrix,x,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){u=_.indexBuffer2,h=_.segments2;var E=[f.drawingBufferWidth,f.drawingBufferHeight];c="fillOutlinePattern"===l&&d?Ir(S,e,m,x,E):Cr(S,E)}else u=_.indexBuffer,h=_.segments,c=d?Er(S,e,m,x):Sr(S);w.draw(e.context,s,i,e.stencilModeForClipping(v),a,Ce.disabled,c,r.id,_.layoutVertexBuffer,u,h,r.paint,e.transform.zoom,b)}}}}function un(e,t,r,n,i,a,o){for(var s=e.context,l=s.gl,c=r.paint.get("fill-extrusion-pattern"),u=c.constantOr(1),h=r.getCrossfadeParameters(),f=r.paint.get("fill-extrusion-opacity"),p=0,d=n;p<d.length;p+=1){var m=d[p],g=t.getTile(m),y=g.getBucket(r);if(y){var v=y.programConfigurations.get(r.id),x=e.useProgram(u?"fillExtrusionPattern":"fillExtrusion",v);u&&(e.context.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePaintBuffers(h));var _=c.constantOr(null);if(_&&g.imageAtlas){var b=g.imageAtlas,w=b.patternPositions[_.to.toString()],T=b.patternPositions[_.from.toString()];w&&T&&v.setConstantPatternPositions(w,T)}var k=e.translatePosMatrix(m.posMatrix,g,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),A=r.paint.get("fill-extrusion-vertical-gradient"),M=u?Mr(k,e,A,f,m,h,g):Ar(k,e,A,f);x.draw(s,s.gl.TRIANGLES,i,a,o,Ce.backCCW,M,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,r.paint,e.transform.zoom,v)}}}function hn(e,t,r,n,i,a){var o=e.context,s=o.gl,l=t.fbo;if(l){var c=e.useProgram("hillshade");o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get());var u=function(e,t,r){var n=r.paint.get("hillshade-shadow-color"),i=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),o=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(o-=e.transform.angle);var s=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped(),s),u_image:0,u_latrange:Fr(0,t.tileID),u_light:[r.paint.get("hillshade-exaggeration"),o],u_shadow:n,u_highlight:i,u_accent:a}}(e,t,r);c.draw(o,s.TRIANGLES,n,i,a,Ce.disabled,u,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function fn(t,r,n,i,a,o){var s=t.context,l=s.gl,c=r.dem;if(c&&c.data){var u=c.dim,h=c.stride,f=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(h),r.demTexture){var p=r.demTexture;p.update(f,{premultiply:!1}),p.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new e.Texture(s,f,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);var d=r.fbo;if(!d){var m=new e.Texture(s,{width:u,height:u,data:null},l.RGBA);m.bind(l.LINEAR,l.CLAMP_TO_EDGE),(d=r.fbo=s.createFramebuffer(u,u,!0)).colorAttachment.set(m.texture)}s.bindFramebuffer.set(d.framebuffer),s.viewport.set([0,0,u,u]),t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,a,o,Ce.disabled,function(t,r){var n=r.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:[n,n],u_zoom:t.overscaledZ,u_unpack:r.getUnpackVector()}}(r.tileID,c),n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function pn(t,r,n,i,a){var o=i.paint.get("raster-fade-duration");if(o>0){var s=e.browser.now(),l=(s-t.timeAdded)/o,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),h=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),f=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(t.tileID.overscaledZ-h),p=f&&t.refreshedUponExpiration?1:e.clamp(f?l:1-c,0,1);return t.refreshedUponExpiration&&l>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var dn=new e.Color(1,0,0,1),mn=new e.Color(0,1,0,1),gn=new e.Color(0,0,1,1),yn=new e.Color(1,0,1,1),vn=new e.Color(0,1,1,1);function xn(e,t,r,n){bn(e,0,t+r/2,e.transform.width,r,n)}function _n(e,t,r,n){bn(e,t-r/2,0,r,e.transform.height,n)}function bn(t,r,n,i,a,o){var s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*e.browser.devicePixelRatio,n*e.browser.devicePixelRatio,i*e.browser.devicePixelRatio,a*e.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function wn(t,r,n){var i=t.context,a=i.gl,o=n.posMatrix,s=t.useProgram("debug"),l=Ae.disabled,c=Se.disabled,u=t.colorModeForRenderPass(),h="$debug";i.activeTexture.set(a.TEXTURE0),t.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,l,c,u,Ce.disabled,Dr(o,e.Color.red),h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments);var f=r.getTileByID(n.key).latestRawTileData,p=f&&f.byteLength||0,d=Math.floor(p/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/t.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=" => "+n.overscaledZ),function(e,t){e.initDebugOverlayCanvas();var r=e.debugOverlayCanvas,n=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.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(r),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,y+" "+d+"kb"),s.draw(i,a.TRIANGLES,l,c,Ee.alphaBlended,Ce.disabled,Dr(o,e.Color.transparent,g),h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments)}var Tn={symbol:function(t,r,n,i,a){if("translucent"===t.renderPass){var o=Se.disabled,s=t.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(t,r,n,i,a,o,s){for(var l=r.transform,c="map"===a,u="map"===o,h=0,f=t;h<f.length;h+=1){var p=f[h],d=i.getTile(p),m=d.getBucket(n);if(m&&m.text&&m.text.segments.get().length){var g=m.textSizeData,y=e.evaluateSizeForZoom(g,l.zoom),v=dt(d,1,r.transform.zoom),x=Je(p.posMatrix,u,c,r.transform,v),_="none"!==n.layout.get("icon-text-fit")&&m.hasIconData();if(y){var b=Math.pow(2,l.zoom-d.tileID.overscaledZ);an(m,c,u,s,e.symbolSize,l,x,p.posMatrix,b,y,_)}}}}(i,t,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&sn(t,r,n,i,!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"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&sn(t,r,n,i,!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"),o,s),r.map.showCollisionBoxes&&(tn(t,r,n,i,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),tn(t,r,n,i,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(t,r,n,i){if("translucent"===t.renderPass){var a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0!==a.constantOr(1)||0!==o.constantOr(1)&&0!==s.constantOr(1)){for(var c=t.context,u=c.gl,h=t.depthModeForSublayer(0,Ae.ReadOnly),f=Se.disabled,p=t.colorModeForRenderPass(),d=[],m=0;m<i.length;m++){var g=i[m],y=r.getTile(g),v=y.getBucket(n);if(v){var x=v.programConfigurations.get(n.id),_={programConfiguration:x,program:t.useProgram("circle",x),layoutVertexBuffer:v.layoutVertexBuffer,indexBuffer:v.indexBuffer,uniformValues:Lr(t,g,y,n)};if(l)for(var b=0,w=v.segments.get();b<w.length;b+=1){var T=w[b];d.push({segments:new e.SegmentVector([T]),sortKey:T.sortKey,state:_})}else d.push({segments:v.segments,sortKey:0,state:_})}}l&&d.sort((function(e,t){return e.sortKey-t.sortKey}));for(var k=0,A=d;k<A.length;k+=1){var M=A[k],S=M.state,E=S.programConfiguration,C=S.program,I=S.layoutVertexBuffer,L=S.indexBuffer,P=S.uniformValues,z=M.segments;C.draw(c,u.TRIANGLES,h,f,p,Ce.disabled,P,n.id,I,L,z,n.paint,t.transform.zoom,E)}}}},heatmap:function(t,r,n,i){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){var a=t.context,o=a.gl,s=Se.disabled,l=new Ee([o.ONE,o.ONE],e.Color.transparent,[!0,!0,!0,!0]);(function(e,t,r){var n=e.gl;e.activeTexture.set(n.TEXTURE1),e.viewport.set([0,0,t.width/4,t.height/4]);var i=r.heatmapFbo;if(i)n.bindTexture(n.TEXTURE_2D,i.colorAttachment.get()),e.bindFramebuffer.set(i.framebuffer);else{var a=n.createTexture();n.bindTexture(n.TEXTURE_2D,a),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),i=r.heatmapFbo=e.createFramebuffer(t.width/4,t.height/4,!1),function(e,t,r,n){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),n.colorAttachment.set(r)}(e,t,a,i)}})(a,t,n),a.clear({color:e.Color.transparent});for(var c=0;c<i.length;c++){var u=i[c];if(!r.hasRenderableParent(u)){var h=r.getTile(u),f=h.getBucket(n);if(f){var p=f.programConfigurations.get(n.id),d=t.useProgram("heatmap",p),m=t.transform.zoom;d.draw(a,o.TRIANGLES,Ae.disabled,s,l,Ce.disabled,Rr(u.posMatrix,h,m,n.paint.get("heatmap-intensity")),n.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,n.paint,t.transform.zoom,p)}}}a.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,r){var n=t.context,i=n.gl,a=r.heatmapFbo;if(a){n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1);var o=r.colorRampTexture;o||(o=r.colorRampTexture=new e.Texture(n,r.colorRamp,i.RGBA)),o.bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Ae.disabled,Se.disabled,t.colorModeForRenderPass(),Ce.disabled,function(t,r){var n=e.create();e.ortho(n,0,t.width,t.height,0,0,1);var i=t.context.gl;return{u_matrix:n,u_world:[i.drawingBufferWidth,i.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:r.paint.get("heatmap-opacity")}}(t,r),r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,r.paint,t.transform.zoom)}}(t,n))},line:function(t,r,n,i){if("translucent"===t.renderPass){var a=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0!==a.constantOr(1)&&0!==o.constantOr(1))for(var s=t.depthModeForSublayer(0,Ae.ReadOnly),l=t.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),u=n.paint.get("line-pattern"),h=u.constantOr(1),f=n.paint.get("line-gradient"),p=n.getCrossfadeParameters(),d=h?"linePattern":c?"lineSDF":f?"lineGradient":"line",m=t.context,g=m.gl,y=!0,v=0,x=i;v<x.length;v+=1){var _=x[v],b=r.getTile(_);if(!h||b.patternsLoaded()){var w=b.getBucket(n);if(w){var T=w.programConfigurations.get(n.id),k=t.context.program.get(),A=t.useProgram(d,T),M=y||A.program!==k,S=u.constantOr(null);if(S&&b.imageAtlas){var E=b.imageAtlas,C=E.patternPositions[S.to.toString()],I=E.patternPositions[S.from.toString()];C&&I&&T.setConstantPatternPositions(C,I)}var L=h?Nr(t,b,n,p):c?Ur(t,b,n,c,p):f?jr(t,b,n,w.lineClipsArray.length):Br(t,b,n);if(h)m.activeTexture.set(g.TEXTURE0),b.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),T.updatePaintBuffers(p);else if(c&&(M||t.lineAtlas.dirty))m.activeTexture.set(g.TEXTURE0),t.lineAtlas.bind(m);else if(f){var P=w.gradients[n.id],z=P.texture;if(n.gradientVersion!==P.version){var D=256;if(n.stepInterpolant){var O=r.getSource().maxzoom,R=_.canonical.z===O?Math.ceil(1<<t.transform.maxZoom-_.canonical.z):1,F=w.maxLineLength/e.EXTENT*1024*R;D=e.clamp(e.nextPowerOfTwo(F),256,m.maxTextureSize)}P.gradient=e.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:D,image:P.gradient||void 0,clips:w.lineClipsArray}),P.texture?P.texture.update(P.gradient):P.texture=new e.Texture(m,P.gradient,g.RGBA),P.version=n.gradientVersion,z=P.texture}m.activeTexture.set(g.TEXTURE0),z.bind(n.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}A.draw(m,g.TRIANGLES,s,t.stencilModeForClipping(_),l,Ce.disabled,L,n.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,n.paint,t.transform.zoom,T,w.layoutVertexBuffer2),y=!1}}}}},fill:function(t,r,n,i){var a=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0!==o.constantOr(1)){var s=t.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(e.Color.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){var u=t.depthModeForSublayer(1,"opaque"===t.renderPass?Ae.ReadWrite:Ae.ReadOnly);cn(t,r,n,i,u,s,!1)}if("translucent"===t.renderPass&&n.paint.get("fill-antialias")){var h=t.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Ae.ReadOnly);cn(t,r,n,i,h,s,!0)}}},"fill-extrusion":function(e,t,r,n){var i=r.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===e.renderPass){var a=new Ae(e.context.gl.LEQUAL,Ae.ReadWrite,e.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))un(e,t,r,n,a,Se.disabled,Ee.disabled),un(e,t,r,n,a,e.stencilModeFor3D(),e.colorModeForRenderPass());else{var o=e.colorModeForRenderPass();un(e,t,r,n,a,Se.disabled,o)}}},hillshade:function(e,t,r,n){if("offscreen"===e.renderPass||"translucent"===e.renderPass){for(var i=e.context,a=e.depthModeForSublayer(0,Ae.ReadOnly),o=e.colorModeForRenderPass(),s="translucent"===e.renderPass?e.stencilConfigForOverlap(n):[{},n],l=s[0],c=0,u=s[1];c<u.length;c+=1){var h=u[c],f=t.getTile(h);f.needsHillshadePrepare&&"offscreen"===e.renderPass?fn(e,f,r,a,Se.disabled,o):"translucent"===e.renderPass&&hn(e,f,r,a,l[h.overscaledZ],o)}i.viewport.set([0,0,e.width,e.height])}},raster:function(e,t,r,n){if("translucent"===e.renderPass&&0!==r.paint.get("raster-opacity")&&n.length)for(var i=e.context,a=i.gl,o=t.getSource(),s=e.useProgram("raster"),l=e.colorModeForRenderPass(),c=o instanceof P?[{},n]:e.stencilConfigForOverlap(n),u=c[0],h=c[1],f=h[h.length-1].overscaledZ,p=!e.options.moving,d=0,m=h;d<m.length;d+=1){var g=m[d],y=e.depthModeForSublayer(g.overscaledZ-f,1===r.paint.get("raster-opacity")?Ae.ReadWrite:Ae.ReadOnly,a.LESS),v=t.getTile(g),x=e.transform.calculatePosMatrix(g.toUnwrapped(),p);v.registerFadeDuration(r.paint.get("raster-fade-duration"));var _=t.findLoadedParent(g,0),b=pn(v,_,t,r,e.transform),w=void 0,T=void 0,k="nearest"===r.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),v.texture.bind(k,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),_?(_.texture.bind(k,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,_.tileID.overscaledZ-v.tileID.overscaledZ),T=[v.tileID.canonical.x*w%1,v.tileID.canonical.y*w%1]):v.texture.bind(k,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);var A=Hr(x,T||[0,0],w||1,b,r);o instanceof P?s.draw(i,a.TRIANGLES,y,Se.disabled,l,Ce.disabled,A,r.id,o.boundsBuffer,e.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,y,u[g.overscaledZ],l,Ce.disabled,A,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}},background:function(e,t,r){var n=r.paint.get("background-color"),i=r.paint.get("background-opacity");if(0!==i){var a=e.context,o=a.gl,s=e.transform,l=s.tileSize,c=r.paint.get("background-pattern");if(!e.isPatternMissing(c)){var u=!c&&1===n.a&&1===i&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass===u){var h=Se.disabled,f=e.depthModeForSublayer(0,"opaque"===u?Ae.ReadWrite:Ae.ReadOnly),p=e.colorModeForRenderPass(),d=e.useProgram(c?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:l});c&&(a.activeTexture.set(o.TEXTURE0),e.imageManager.bind(e.context));for(var g=r.getCrossfadeParameters(),y=0,v=m;y<v.length;y+=1){var x=v[y],_=e.transform.calculatePosMatrix(x.toUnwrapped()),b=c?Qr(_,i,e,c,{tileID:x,tileSize:l},g):Jr(_,i,n);d.draw(a,o.TRIANGLES,f,h,p,Ce.disabled,b,r.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}}}},debug:function(e,t,r){for(var n=0;n<r.length;n++)wn(e,t,r[n])},custom:function(e,t,r){var n=e.context,i=r.implementation;if("offscreen"===e.renderPass){var a=i.prerender;a&&(e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),a.call(i,n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),n.setStencilMode(Se.disabled);var o="3d"===i.renderingMode?new Ae(e.context.gl.LEQUAL,Ae.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,Ae.ReadOnly);n.setDepthMode(o),i.render(n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(null)}}},kn=function(e,t){this.context=new Ie(e),this.transform=t,this._tileTextures={},this.setup(),this.numSublayers=Le.maxUnderzooming+Le.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Nt,this.gpuTimers={}};kn.prototype.resize=function(t,r){if(this.width=t*e.browser.devicePixelRatio,this.height=r*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,i=this.style._order;n<i.length;n+=1){var a=i[n];this.style._layers[a].resize()}},kn.prototype.setup=function(){var t=this.context,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.tileExtentBuffer=t.createVertexBuffer(r,Wt.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);var 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.debugBuffer=t.createVertexBuffer(n,Wt.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,L.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,Wt.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 l=this.context.gl;this.stencilClearMode=new Se({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},kn.prototype.clearStencil=function(){var t=this.context,r=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=e.create();e.ortho(n,0,this.width,this.height,0,0,1),e.scale(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,r.TRIANGLES,Ae.disabled,this.stencilClearMode,Ee.disabled,Ce.disabled,Or(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},kn.prototype._renderTileClippingMasks=function(e,t){if(this.currentStencilSource!==e.source&&e.isTileClipped()&&t&&t.length){this.currentStencilSource=e.source;var r=this.context,n=r.gl;this.nextStencilID+t.length>256&&this.clearStencil(),r.setColorMode(Ee.disabled),r.setDepthMode(Ae.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=t;a<o.length;a+=1){var s=o[a],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;i.draw(r,n.TRIANGLES,Ae.disabled,new Se({func:n.ALWAYS,mask:0},l,255,n.KEEP,n.KEEP,n.REPLACE),Ee.disabled,Ce.disabled,Or(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},kn.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var e=this.nextStencilID++,t=this.context.gl;return new Se({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)},kn.prototype.stencilModeForClipping=function(e){var t=this.context.gl;return new Se({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)},kn.prototype.stencilConfigForOverlap=function(e){var t,r=this.context.gl,n=e.sort((function(e,t){return t.overscaledZ-e.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[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 Se({func:r.GEQUAL,mask:255},s+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=a,[o,n]}return[(t={},t[i]=Se.disabled,t),n]},kn.prototype.colorModeForRenderPass=function(){var t=this.context.gl;if(this._showOverdrawInspector){var r=1/8;return new Ee([t.CONSTANT_COLOR,t.ONE],new e.Color(r,r,r,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Ee.unblended:Ee.alphaBlended},kn.prototype.depthModeForSublayer=function(e,t,r){if(!this.opaquePassEnabledForLayer())return Ae.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Ae(r||this.context.gl.LEQUAL,t,[n,n])},kn.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},kn.prototype.render=function(t,r){var n=this;this.style=t,this.options=r,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 l,c,u={},h={},f={};for(var p in a){var d=a[p];u[p]=d.getVisibleCoordinates(),h[p]=u[p].slice().reverse(),f[p]=d.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<i.length;m++){var g=i[m];if(this.style._layers[g].is3D()){this.opaquePassCutoff=m;break}}this.renderPass="offscreen";for(var y=0,v=i;y<v.length;y+=1){var x=v[y],_=this.style._layers[x];if(_.hasOffscreenPass()&&!_.isHidden(this.transform.zoom)){var b=h[_.source];"custom"!==_.type&&!b.length||this.renderLayer(this,a[_.source],_,b)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?e.Color.black:e.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.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 w=this.style._layers[i[this.currentLayer]],T=a[w.source],k=u[w.source];this._renderTileClippingMasks(w,k),this.renderLayer(this,T,w,k)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var A=this.style._layers[i[this.currentLayer]],M=a[A.source],S=("symbol"===A.type?f:h)[A.source];this._renderTileClippingMasks(A,u[A.source]),this.renderLayer(this,M,A,S)}this.options.showTileBoundaries&&(e.values(this.style._layers).forEach((function(e){e.source&&!e.isHidden(n.transform.zoom)&&(e.source!==(c&&c.id)&&(c=n.style.sourceCaches[e.source]),(!l||l.getSource().maxzoom<c.getSource().maxzoom)&&(l=c))})),l&&Tn.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&function(e){var t=e.transform.padding;xn(e,e.transform.height-(t.top||0),3,dn),xn(e,t.bottom||0,3,mn),_n(e,t.left||0,3,gn),_n(e,e.transform.width-(t.right||0),3,yn);var r=e.transform.centerPoint;!function(e,t,r,n){bn(e,t-1,r-10,2,20,n),bn(e,t-10,r-1,20,2,n)}(e,r.x,e.transform.height-r.y,vn)}(this),this.context.setDefault()},kn.prototype.renderLayer=function(e,t,r,n){r.isHidden(this.transform.zoom)||"background"!==r.type&&"custom"!==r.type&&!n.length||(this.id=r.id,this.gpuTimingStart(r),Tn[r.type](e,t,r,n,this.style.placement.variableOffsets),this.gpuTimingEnd())},kn.prototype.gpuTimingStart=function(e){if(this.options.gpuTiming){var t=this.context.extTimerQuery,r=this.gpuTimers[e.id];r||(r=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:t.createQueryEXT()}),r.calls++,t.beginQueryEXT(t.TIME_ELAPSED_EXT,r.query)}},kn.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var e=this.context.extTimerQuery;e.endQueryEXT(e.TIME_ELAPSED_EXT)}},kn.prototype.collectGpuTimers=function(){var e=this.gpuTimers;return this.gpuTimers={},e},kn.prototype.queryGpuTimers=function(e){var t={};for(var r in e){var n=e[r],i=this.context.extTimerQuery,a=i.getQueryObjectEXT(n.query,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(n.query),t[r]=a}return t},kn.prototype.translatePosMatrix=function(t,r,n,i,a){if(!n[0]&&!n[1])return t;var o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){var s=Math.sin(o),l=Math.cos(o);n=[n[0]*l-n[1]*s,n[0]*s+n[1]*l]}var c=[a?n[0]:dt(r,n[0],this.transform.zoom),a?n[1]:dt(r,n[1],this.transform.zoom),0],u=new Float32Array(16);return e.translate(u,t,c),u},kn.prototype.saveTileTexture=function(e){var t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]},kn.prototype.getTileTexture=function(e){var t=this._tileTextures[e];return t&&t.length>0?t.pop():null},kn.prototype.isPatternMissing=function(e){if(!e)return!1;if(!e.from||!e.to)return!0;var t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r},kn.prototype.useProgram=function(e,t){this.cache=this.cache||{};var r=""+e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Tr(this.context,e,_r[e],t,en[e],this._showOverdrawInspector)),this.cache[r]},kn.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()},kn.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)},kn.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){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)}},kn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var An=function(e,t){this.points=e,this.planes=t};An.fromInvProjectionMatrix=function(t,r,n){var i=Math.pow(2,n),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((function(r){return e.transformMat4([],r,t)})).map((function(t){return e.scale$1([],t,1/t[3]/r*i)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var r=e.sub([],a[t[0]],a[t[1]]),n=e.sub([],a[t[2]],a[t[1]]),i=e.normalize([],e.cross([],r,n)),o=-e.dot(i,a[t[1]]);return i.concat(o)}));return new An(a,o)};var Mn=function(t,r){this.min=t,this.max=r,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};Mn.prototype.quadrant=function(t){for(var r=[t%2==0,t<2],n=e.clone$2(this.min),i=e.clone$2(this.max),a=0;a<r.length;a++)n[a]=r[a]?this.min[a]:this.center[a],i[a]=r[a]?this.center[a]:this.max[a];return i[2]=this.max[2],new Mn(n,i)},Mn.prototype.distanceX=function(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]},Mn.prototype.distanceY=function(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]},Mn.prototype.intersects=function(t){for(var r=[[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]],n=!0,i=0;i<t.planes.length;i++){for(var a=t.planes[i],o=0,s=0;s<r.length;s++)o+=e.dot$1(a,r[s])>=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,h=0;h<t.points.length;h++){var f=t.points[h][l]-this.min[l];c=Math.min(c,f),u=Math.max(u,f)}if(u<0||c>this.max[l]-this.min[l])return 0}return 1};var Sn=function(e,t,r,n){if(void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=n};Sn.prototype.interpolate=function(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.number(t.right,r.right,n)),this},Sn.prototype.getCenter=function(t,r){var n=e.clamp((this.left+t-this.right)/2,0,t),i=e.clamp((this.top+r-this.bottom)/2,0,r);return new e.Point(n,i)},Sn.prototype.equals=function(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right},Sn.prototype.clone=function(){return new Sn(this.top,this.bottom,this.left,this.right)},Sn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var En=function(t,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=n??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 Sn,this._posMatrixCache={},this._alignedPosMatrixCache={}},Cn={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}};En.prototype.clone=function(){var e=new En(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},Cn.minZoom.get=function(){return this._minZoom},Cn.minZoom.set=function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))},Cn.maxZoom.get=function(){return this._maxZoom},Cn.maxZoom.set=function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))},Cn.minPitch.get=function(){return this._minPitch},Cn.minPitch.set=function(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))},Cn.maxPitch.get=function(){return this._maxPitch},Cn.maxPitch.set=function(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))},Cn.renderWorldCopies.get=function(){return this._renderWorldCopies},Cn.renderWorldCopies.set=function(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e},Cn.worldSize.get=function(){return this.tileSize*this.scale},Cn.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Cn.size.get=function(){return new e.Point(this.width,this.height)},Cn.bearing.get=function(){return-this.angle/Math.PI*180},Cn.bearing.set=function(t){var r=-e.wrap(t,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Cn.pitch.get=function(){return this._pitch/Math.PI*180},Cn.pitch.set=function(t){var r=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Cn.fov.get=function(){return this._fov/Math.PI*180},Cn.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())},Cn.zoom.get=function(){return this._zoom},Cn.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())},Cn.center.get=function(){return this._center},Cn.center.set=function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())},Cn.padding.get=function(){return this._edgeInsets.toJSON()},Cn.padding.set=function(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())},Cn.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},En.prototype.isPaddingEqual=function(e){return this._edgeInsets.equals(e)},En.prototype.interpolatePadding=function(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()},En.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)},En.prototype.getVisibleUnwrappedCoordinates=function(t){var r=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies)for(var n=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(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=s-1;c<=l+1;c++)0!==c&&r.push(new e.UnwrappedTileID(c,t));return r},En.prototype.coveringTiles=function(t){var r=this.coveringZoomLevel(t),n=r;if(void 0!==t.minzoom&&r<t.minzoom)return[];void 0!==t.maxzoom&&r>t.maxzoom&&(r=t.maxzoom);var i=e.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=An.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var c=function(e){return{aabb:new Mn([e*a,0,0],[(e+1)*a,a,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}},u=[],h=[],f=r,p=t.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)u.push(c(-d)),u.push(c(d));for(u.push(c(0));u.length>0;){var m=u.pop(),g=m.x,y=m.y,v=m.fullyVisible;if(!v){var x=m.aabb.intersects(s);if(0===x)continue;v=2===x}var _=m.aabb.distanceX(o),b=m.aabb.distanceY(o),w=Math.max(Math.abs(_),Math.abs(b)),T=3+(1<<f-m.zoom)-2;if(m.zoom===f||w>T&&m.zoom>=l)h.push({tileID:new e.OverscaledTileID(m.zoom===f?p:m.zoom,m.wrap,m.zoom,g,y),distanceSq:e.sqrLen([o[0]-.5-g,o[1]-.5-y])});else for(var k=0;k<4;k++){var A=(g<<1)+k%2,M=(y<<1)+(k>>1);u.push({aabb:m.aabb.quadrant(k),zoom:m.zoom+1,x:A,y:M,wrap:m.wrap,fullyVisible:v})}}return h.sort((function(e,t){return e.distanceSq-t.distanceSq})).map((function(e){return e.tileID}))},En.prototype.resize=function(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()},Cn.unmodified.get=function(){return this._unmodified},En.prototype.zoomScale=function(e){return Math.pow(2,e)},En.prototype.scaleZoom=function(e){return Math.log(e)/Math.LN2},En.prototype.project=function(t){var r=e.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(t.lng)*this.worldSize,e.mercatorYfromLat(r)*this.worldSize)},En.prototype.unproject=function(t){return new e.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},Cn.point.get=function(){return this.project(this.center)},En.prototype.setLocationAtPoint=function(t,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},En.prototype.locationPoint=function(e){return this.coordinatePoint(this.locationCoordinate(e))},En.prototype.pointLocation=function(e){return this.coordinateLocation(this.pointCoordinate(e))},En.prototype.locationCoordinate=function(t){return e.MercatorCoordinate.fromLngLat(t)},En.prototype.coordinateLocation=function(e){return e.toLngLat()},En.prototype.pointCoordinate=function(t){var r=[t.x,t.y,0,1],n=[t.x,t.y,1,1];e.transformMat4(r,r,this.pixelMatrixInverse),e.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[0]/i,s=n[0]/a,l=r[1]/i,c=n[1]/a,u=r[2]/i,h=n[2]/a,f=u===h?0:(0-u)/(h-u);return new e.MercatorCoordinate(e.number(o,s,f)/this.worldSize,e.number(l,c,f)/this.worldSize)},En.prototype.coordinatePoint=function(t){var r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix),new e.Point(r[0]/r[3],r[1]/r[3])},En.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)))},En.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},En.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])},En.prototype.calculatePosMatrix=function(t,r){void 0===r&&(r=!1);var n=t.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=t.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*t.wrap,l=e.identity(new Float64Array(16));return e.translate(l,l,[s*o,a.y*o,0]),e.scale(l,l,[o/e.EXTENT,o/e.EXTENT,1]),e.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},En.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},En.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,r,n,i,a=-90,o=90,s=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var h=this.latRange;a=e.mercatorYfromLat(h[1])*this.worldSize,t=(o=e.mercatorYfromLat(h[0])*this.worldSize)-a<c.y?c.y/(o-a):0}if(this.lngRange){var f=this.lngRange;s=e.mercatorXfromLng(f[0])*this.worldSize,r=(l=e.mercatorXfromLng(f[1])*this.worldSize)-s<c.x?c.x/(l-s):0}var p=this.point,d=Math.max(r||0,t||0);if(d)return this.center=this.unproject(new e.Point(r?(l+s)/2:p.x,t?(o+a)/2:p.y)),this.zoom+=this.scaleZoom(d),this._unmodified=u,void(this._constraining=!1);if(this.latRange){var m=p.y,g=c.y/2;m-g<a&&(i=a+g),m+g>o&&(i=o-g)}if(this.lngRange){var y=p.x,v=c.x/2;y-v<s&&(n=s+v),y+v>l&&(n=l-v)}(void 0!==n||void 0!==i)&&(this.center=this.unproject(new e.Point(void 0!==n?n:p.x,void 0!==i?i:p.y))),this._unmodified=u,this._constraining=!1}},En.prototype._calcMatrices=function(){if(this.height){var t=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(t)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,c=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),u=this.height/50,h=new Float64Array(16);e.perspective(h,this._fov,this.width/this.height,u,c),h[8]=2*-r.x/this.width,h[9]=2*r.y/this.height,e.scale(h,h,[1,-1,1]),e.translate(h,h,[0,0,-this.cameraToCenterDistance]),e.rotateX(h,h,this._pitch),e.rotateZ(h,h,this.angle),e.translate(h,h,[-s,-l,0]),this.mercatorMatrix=e.scale([],h,[this.worldSize,this.worldSize,this.worldSize]),e.scale(h,h,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=h,this.invProjMatrix=e.invert([],this.projMatrix);var f=this.width%2/2,p=this.height%2/2,d=Math.cos(this.angle),m=Math.sin(this.angle),g=s-Math.round(s)+d*f+m*p,y=l-Math.round(l)+d*p+m*f,v=new Float64Array(h);if(e.translate(v,v,[g>.5?g-1:g,y>.5?y-1:y,0]),this.alignedProjMatrix=v,h=e.create(),e.scale(h,h,[this.width/2,-this.height/2,1]),e.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=e.create(),e.scale(h,h,[1,-1,1]),e.translate(h,h,[-1,-1,0]),e.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=e.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={}}},En.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new e.Point(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},En.prototype.getCameraPoint=function(){var t=this._pitch,r=Math.tan(t)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,r))},En.prototype.getCameraQueryGeometry=function(t){var r=this.getCameraPoint();if(1===t.length)return[t[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=t;s<l.length;s+=1){var c=l[s];n=Math.min(n,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),o=Math.max(o,c.y)}return[new e.Point(n,i),new e.Point(a,i),new e.Point(a,o),new e.Point(n,o),new e.Point(n,i)]},Object.defineProperties(En.prototype,Cn);var In=function(t){var r,n,i,a;this._hashName=t&&encodeURIComponent(t),e.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(r=this._updateHashUnthrottled.bind(this),n=!1,i=null,a=function(){i=null,n&&(r(),i=setTimeout(a,300),n=!1)},function(){return n=!0,i||a(),i})};In.prototype.addTo=function(t){return this._map=t,e.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},In.prototype.remove=function(){return e.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},In.prototype.getHashString=function(t){var r=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,i=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.pow(10,i),o=Math.round(r.lng*a)/a,s=Math.round(r.lat*a)/a,l=this._map.getBearing(),c=this._map.getPitch(),u="";if(u+=t?"/"+o+"/"+s+"/"+n:n+"/"+s+"/"+o,(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+="/"+Math.round(c)),this._hashName){var h=this._hashName,f=!1,p=e.window.location.hash.slice(1).split("&").map((function(e){var t=e.split("=")[0];return t===h?(f=!0,t+"="+u):e})).filter((function(e){return e}));return f||p.push(h+"="+u),"#"+p.join("&")}return"#"+u},In.prototype._getCurrentHash=function(){var t,r=this,n=e.window.location.hash.replace("#","");return this._hashName?(n.split("&").map((function(e){return e.split("=")})).forEach((function(e){e[0]===r._hashName&&(t=e)})),(t&&t[1]||"").split("/")):n.split("/")},In.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},In.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 Ln={linearity:.3,easing:e.bezier(0,0,.3,1)},Pn=e.extend({deceleration:2500,maxSpeed:1400},Ln),zn=e.extend({deceleration:20,maxSpeed:1400},Ln),Dn=e.extend({deceleration:1e3,maxSpeed:360},Ln),On=e.extend({deceleration:1e3,maxSpeed:90},Ln),Rn=function(e){this._map=e,this.clear()};function Fn(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Bn(t,r,n){var i=n.maxSpeed,a=n.linearity,o=n.deceleration,s=e.clamp(t*a/(r/1e3),-i,i),l=Math.abs(s)/(o*a);return{easing:n.easing,duration:1e3*l,amount:s*(l/2)}}Rn.prototype.clear=function(){this._inertiaBuffer=[]},Rn.prototype.record=function(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:t})},Rn.prototype._drainInertiaBuffer=function(){for(var t=this._inertiaBuffer,r=e.browser.now();t.length>0&&r-t[0].time>160;)t.shift()},Rn.prototype._onMoveEnd=function(t){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n<i.length;n+=1){var a=i[n].settings;r.zoom+=a.zoomDelta||0,r.bearing+=a.bearingDelta||0,r.pitch+=a.pitchDelta||0,a.panDelta&&r.pan._add(a.panDelta),a.around&&(r.around=a.around),a.pinchAround&&(r.pinchAround=a.pinchAround)}var o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(r.pan.mag()){var l=Bn(r.pan.mag(),o,e.extend({},Pn,t||{}));s.offset=r.pan.mult(l.amount/r.pan.mag()),s.center=this._map.transform.center,Fn(s,l)}if(r.zoom){var c=Bn(r.zoom,o,zn);s.zoom=this._map.transform.zoom+c.amount,Fn(s,c)}if(r.bearing){var u=Bn(r.bearing,o,Dn);s.bearing=this._map.transform.bearing+e.clamp(u.amount,-179,179),Fn(s,u)}if(r.pitch){var h=Bn(r.pitch,o,On);s.pitch=this._map.transform.pitch+h.amount,Fn(s,h)}if(s.zoom||s.bearing){var f=void 0===r.pinchAround?r.around:r.pinchAround;s.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),e.extend(s,{noMoveStart:!0})}};var jn=function(t){function n(n,i,a,o){void 0===o&&(o={});var s=r.mousePos(i.getCanvasContainer(),a),l=i.unproject(s);t.call(this,n,e.extend({point:s,lngLat:l,originalEvent:a},o)),this._defaultPrevented=!1,this.target=i}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(e.Event),Nn=function(t){function n(n,i,a){var o="touchend"===n?a.changedTouches:a.touches,s=r.touchPos(i.getCanvasContainer(),o),l=s.map((function(e){return i.unproject(e)})),c=s.reduce((function(e,t,r,n){return e.add(t.div(n.length))}),new e.Point(0,0)),u=i.unproject(c);t.call(this,n,{points:s,point:c,lngLats:l,lngLat:u,originalEvent:a}),this._defaultPrevented=!1}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(e.Event),Un=function(e){function t(t,r,n){e.call(this,t,{originalEvent:n}),this._defaultPrevented=!1}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={defaultPrevented:{configurable:!0}};return t.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(t.prototype,r),t}(e.Event),Vn=function(e,t){this._map=e,this._clickTolerance=t.clickTolerance};Vn.prototype.reset=function(){delete this._mousedownPos},Vn.prototype.wheel=function(e){return this._firePreventable(new Un(e.type,this._map,e))},Vn.prototype.mousedown=function(e,t){return this._mousedownPos=t,this._firePreventable(new jn(e.type,this._map,e))},Vn.prototype.mouseup=function(e){this._map.fire(new jn(e.type,this._map,e))},Vn.prototype.click=function(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new jn(e.type,this._map,e))},Vn.prototype.dblclick=function(e){return this._firePreventable(new jn(e.type,this._map,e))},Vn.prototype.mouseover=function(e){this._map.fire(new jn(e.type,this._map,e))},Vn.prototype.mouseout=function(e){this._map.fire(new jn(e.type,this._map,e))},Vn.prototype.touchstart=function(e){return this._firePreventable(new Nn(e.type,this._map,e))},Vn.prototype.touchmove=function(e){this._map.fire(new Nn(e.type,this._map,e))},Vn.prototype.touchend=function(e){this._map.fire(new Nn(e.type,this._map,e))},Vn.prototype.touchcancel=function(e){this._map.fire(new Nn(e.type,this._map,e))},Vn.prototype._firePreventable=function(e){if(this._map.fire(e),e.defaultPrevented)return{}},Vn.prototype.isEnabled=function(){return!0},Vn.prototype.isActive=function(){return!1},Vn.prototype.enable=function(){},Vn.prototype.disable=function(){};var qn=function(e){this._map=e};qn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},qn.prototype.mousemove=function(e){this._map.fire(new jn(e.type,this._map,e))},qn.prototype.mousedown=function(){this._delayContextMenu=!0},qn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new jn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},qn.prototype.contextmenu=function(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new jn(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()},qn.prototype.isEnabled=function(){return!0},qn.prototype.isActive=function(){return!1},qn.prototype.enable=function(){},qn.prototype.disable=function(){};var Hn=function(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1};function Gn(e,t){for(var r={},n=0;n<e.length;n++)r[e[n].identifier]=t[n];return r}Hn.prototype.isEnabled=function(){return!!this._enabled},Hn.prototype.isActive=function(){return!!this._active},Hn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Hn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Hn.prototype.mousedown=function(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(r.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)},Hn.prototype.mousemoveWindow=function(e,t){if(this._active){var n=t;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var i=this._startPos;this._lastPos=n,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));var a=Math.min(i.x,n.x),o=Math.max(i.x,n.x),s=Math.min(i.y,n.y),l=Math.max(i.y,n.y);r.setTransform(this._box,"translate("+a+"px,"+s+"px)"),this._box.style.width=o-a+"px",this._box.style.height=l-s+"px"}}},Hn.prototype.mouseupWindow=function(t,n){var i=this;if(this._active&&0===t.button){var a=this._startPos,o=n;if(this.reset(),r.suppressClick(),a.x!==o.x||a.y!==o.y)return this._map.fire(new e.Event("boxzoomend",{originalEvent:t})),{cameraAnimation:function(e){return e.fitScreenCoordinates(a,o,i._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",t)}},Hn.prototype.keydown=function(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))},Hn.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},Hn.prototype._fireEvent=function(t,r){return this._map.fire(new e.Event(t,{originalEvent:r}))};var Wn=function(e){this.reset(),this.numTouches=e.numTouches};Wn.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Wn.prototype.touchstart=function(t,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(void 0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){for(var r=new e.Point(0,0),n=0,i=t;n<i.length;n+=1){var a=i[n];r._add(a)}return r.div(t.length)}(r),this.touches=Gn(n,r)))},Wn.prototype.touchmove=function(e,t,r){if(!this.aborted&&this.centroid){var n=Gn(r,t);for(var i in this.touches){var a=this.touches[i],o=n[i];(!o||o.dist(a)>30)&&(this.aborted=!0)}}},Wn.prototype.touchend=function(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Zn=function(e){this.singleTap=new Wn(e),this.numTaps=e.numTaps,this.reset()};Zn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Zn.prototype.touchstart=function(e,t,r){this.singleTap.touchstart(e,t,r)},Zn.prototype.touchmove=function(e,t,r){this.singleTap.touchmove(e,t,r)},Zn.prototype.touchend=function(e,t,r){var n=this.singleTap.touchend(e,t,r);if(n){var i=e.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(n)<30;if((!i||!a)&&this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Yn=function(){this._zoomIn=new Zn({numTouches:1,numTaps:2}),this._zoomOut=new Zn({numTouches:2,numTaps:1}),this.reset()};Yn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Yn.prototype.touchstart=function(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)},Yn.prototype.touchmove=function(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)},Yn.prototype.touchend=function(e,t,r){var n=this,i=this._zoomIn.touchend(e,t,r),a=this._zoomOut.touchend(e,t,r);return i?(this._active=!0,e.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(i)},{originalEvent:e})}}):a?(this._active=!0,e.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(a)},{originalEvent:e})}}):void 0},Yn.prototype.touchcancel=function(){this.reset()},Yn.prototype.enable=function(){this._enabled=!0},Yn.prototype.disable=function(){this._enabled=!1,this.reset()},Yn.prototype.isEnabled=function(){return this._enabled},Yn.prototype.isActive=function(){return this._active};var Xn={0:1,2:2},$n=function(e){this.reset(),this._clickTolerance=e.clickTolerance||1};$n.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},$n.prototype._correctButton=function(e,t){return!1},$n.prototype._move=function(e,t){return{}},$n.prototype.mousedown=function(e,t){if(!this._lastPoint){var n=r.mouseButton(e);this._correctButton(e,n)&&(this._lastPoint=t,this._eventButton=n)}},$n.prototype.mousemoveWindow=function(e,t){var r=this._lastPoint;if(r){if(e.preventDefault(),function(e,t){var r=Xn[t];return void 0===e.buttons||(e.buttons&r)!==r}(e,this._eventButton))return void this.reset();if(this._moved||!(t.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=t,this._move(r,t)}},$n.prototype.mouseupWindow=function(e){this._lastPoint&&r.mouseButton(e)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())},$n.prototype.enable=function(){this._enabled=!0},$n.prototype.disable=function(){this._enabled=!1,this.reset()},$n.prototype.isEnabled=function(){return this._enabled},$n.prototype.isActive=function(){return this._active};var Kn=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,r){e.prototype.mousedown.call(this,t,r),this._lastPoint&&(this._active=!0)},t.prototype._correctButton=function(e,t){return 0===t&&!e.ctrlKey},t.prototype._move=function(e,t){return{around:t,panDelta:t.sub(e)}},t}($n),Jn=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 0===t&&e.ctrlKey||2===t},t.prototype._move=function(e,t){var r=.8*(t.x-e.x);if(r)return this._active=!0,{bearingDelta:r}},t.prototype.contextmenu=function(e){e.preventDefault()},t}($n),Qn=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 0===t&&e.ctrlKey||2===t},t.prototype._move=function(e,t){var r=-.5*(t.y-e.y);if(r)return this._active=!0,{pitchDelta:r}},t.prototype.contextmenu=function(e){e.preventDefault()},t}($n),ei=function(e){this._minTouches=1,this._clickTolerance=e.clickTolerance||1,this.reset()};ei.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new e.Point(0,0)},ei.prototype.touchstart=function(e,t,r){return this._calculateTransform(e,t,r)},ei.prototype.touchmove=function(e,t,r){if(this._active&&!(r.length<this._minTouches))return e.preventDefault(),this._calculateTransform(e,t,r)},ei.prototype.touchend=function(e,t,r){this._calculateTransform(e,t,r),this._active&&r.length<this._minTouches&&this.reset()},ei.prototype.touchcancel=function(){this.reset()},ei.prototype._calculateTransform=function(t,r,n){n.length>0&&(this._active=!0);var i=Gn(n,r),a=new e.Point(0,0),o=new e.Point(0,0),s=0;for(var l in i){var c=i[l],u=this._touches[l];u&&(a._add(c),o._add(c.sub(u)),s++,i[l]=c)}if(this._touches=i,!(s<this._minTouches)&&o.mag()){var h=o.div(s);if(this._sum._add(h),!(this._sum.mag()<this._clickTolerance))return{around:a.div(s),panDelta:h}}},ei.prototype.enable=function(){this._enabled=!0},ei.prototype.disable=function(){this._enabled=!1,this.reset()},ei.prototype.isEnabled=function(){return this._enabled},ei.prototype.isActive=function(){return this._active};var ti=function(){this.reset()};function ri(e,t,r){for(var n=0;n<e.length;n++)if(e[n].identifier===r)return t[n]}function ni(e,t){return Math.log(e/t)/Math.LN2}ti.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},ti.prototype._start=function(e){},ti.prototype._move=function(e,t,r){return{}},ti.prototype.touchstart=function(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))},ti.prototype.touchmove=function(e,t,r){if(this._firstTwoTouches){e.preventDefault();var n=this._firstTwoTouches,i=n[0],a=n[1],o=ri(r,t,i),s=ri(r,t,a);if(o&&s){var l=this._aroundCenter?null:o.add(s).div(2);return this._move([o,s],l,e)}}},ti.prototype.touchend=function(e,t,n){if(this._firstTwoTouches){var i=this._firstTwoTouches,a=i[0],o=i[1],s=ri(n,t,a),l=ri(n,t,o);s&&l||(this._active&&r.suppressClick(),this.reset())}},ti.prototype.touchcancel=function(){this.reset()},ti.prototype.enable=function(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around},ti.prototype.disable=function(){this._enabled=!1,this.reset()},ti.prototype.isEnabled=function(){return this._enabled},ti.prototype.isActive=function(){return this._active};var ii=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 r=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(ni(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ni(this._distance,r),pinchAround:t}},t}(ti);function ai(e,t){return 180*e.angleWith(t)/Math.PI}var oi=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 r=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ai(this._vector,r),pinchAround:t}},t.prototype._isBelowThreshold=function(e){this._minDiameter=Math.min(this._minDiameter,e.mag());var t=25/(Math.PI*this._minDiameter)*360,r=ai(e,this._startVector);return Math.abs(r)<t},t}(ti);function si(e){return Math.abs(e.y)>Math.abs(e.x)}var li=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,si(e[0].sub(e[1]))&&(this._valid=!1)},t.prototype._move=function(e,t,r){var n=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},t.prototype.gestureBeginsVertically=function(e,t,r){if(void 0!==this._valid)return this._valid;var n=e.mag()>=2,i=t.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=e.y>0==t.y>0;return si(e)&&si(t)&&a}},t}(ti),ci={panStep:100,bearingStep:15,pitchStep:10},ui=function(){var e=ci;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1};function hi(e){return e*(2-e)}ui.prototype.reset=function(){this._active=!1},ui.prototype.keydown=function(e){var t=this;if(!(e.altKey||e.ctrlKey||e.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?n=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&&(n=0,i=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:hi,zoom:r?Math.round(l)+r*(e.shiftKey?2:1):l,bearing:s.getBearing()+n*t._bearingStep,pitch:s.getPitch()+i*t._pitchStep,offset:[-a*t._panStep,-o*t._panStep],center:s.getCenter()},{originalEvent:e})}}}},ui.prototype.enable=function(){this._enabled=!0},ui.prototype.disable=function(){this._enabled=!1,this.reset()},ui.prototype.isEnabled=function(){return this._enabled},ui.prototype.isActive=function(){return this._active},ui.prototype.disableRotation=function(){this._rotationDisabled=!0},ui.prototype.enableRotation=function(){this._rotationDisabled=!1};var fi=4.000244140625,pi=1/450,di=function(t,r){this._map=t,this._el=t.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=pi,e.bindAll(["_onTimeout"],this)};di.prototype.setZoomRate=function(e){this._defaultZoomRate=e},di.prototype.setWheelZoomRate=function(e){this._wheelZoomRate=e},di.prototype.isEnabled=function(){return!!this._enabled},di.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},di.prototype.isZooming=function(){return!!this._zooming},di.prototype.enable=function(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=e&&"center"===e.around)},di.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},di.prototype.wheel=function(t){if(this.isEnabled()){var r=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,n=e.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%fi==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}},di.prototype._onTimeout=function(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},di.prototype._start=function(t){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,t);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},di.prototype.renderFrame=function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>fi?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var h=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),f=c(h);o=e.number(l,s,f),h<1?this._frameId||(this._frameId=!0):u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},di.prototype._smoothOutEasing=function(t){var r=e.ease;if(this._prevEase){var n=this._prevEase,i=(e.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.bezier(o,s,.25,1)}return this._prevEase={start:e.browser.now(),duration:t,easing:r},r},di.prototype.reset=function(){this._active=!1};var mi=function(e,t){this._clickZoom=e,this._tapZoom=t};mi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},mi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},mi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},mi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var gi=function(){this.reset()};gi.prototype.reset=function(){this._active=!1},gi.prototype.dblclick=function(e,t){return e.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(e.shiftKey?-1:1),around:r.unproject(t)},{originalEvent:e})}}},gi.prototype.enable=function(){this._enabled=!0},gi.prototype.disable=function(){this._enabled=!1,this.reset()},gi.prototype.isEnabled=function(){return this._enabled},gi.prototype.isActive=function(){return this._active};var yi=function(){this._tap=new Zn({numTouches:1,numTaps:1}),this.reset()};yi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},yi.prototype.touchstart=function(e,t,r){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=t[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(e,t,r))},yi.prototype.touchmove=function(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=t[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,r)},yi.prototype.touchend=function(e,t,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(e,t,r)&&(this._tapTime=e.timeStamp)},yi.prototype.touchcancel=function(){this.reset()},yi.prototype.enable=function(){this._enabled=!0},yi.prototype.disable=function(){this._enabled=!1,this.reset()},yi.prototype.isEnabled=function(){return this._enabled},yi.prototype.isActive=function(){return this._active};var vi=function(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r};vi.prototype.enable=function(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},vi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},vi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},vi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var xi=function(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r};xi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},xi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},xi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},xi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var _i=function(e,t,r,n){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};_i.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")},_i.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},_i.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},_i.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},_i.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},_i.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var bi=function(e){return e.zoom||e.drag||e.pitch||e.rotate},wi=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 Ti(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}var ki=function(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Rn(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),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],l=s[0],c=s[1],u=s[2];r.addEventListener(l,c,l===e.window.document?this.handleWindowEvent:this.handleEvent,u)}};ki.prototype.destroy=function(){for(var t=0,n=this._listeners;t<n.length;t+=1){var i=n[t],a=i[0],o=i[1],s=i[2];r.removeEventListener(a,o,a===e.window.document?this.handleWindowEvent:this.handleEvent,s)}},ki.prototype._addDefaultHandlers=function(e){var t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new Vn(t,e));var n=t.boxZoom=new Hn(t,e);this._add("boxZoom",n);var i=new Yn,a=new gi;t.doubleClickZoom=new mi(a,i),this._add("tapZoom",i),this._add("clickZoom",a);var o=new yi;this._add("tapDragZoom",o);var s=t.touchPitch=new li;this._add("touchPitch",s);var l=new Jn(e),c=new Qn(e);t.dragRotate=new xi(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);var u=new Kn(e),h=new ei(e);t.dragPan=new vi(r,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);var f=new oi,p=new ii;t.touchZoomRotate=new _i(r,p,f,o),this._add("touchRotate",f,["touchPan","touchZoom"]),this._add("touchZoom",p,["touchPan","touchRotate"]);var d=t.scrollZoom=new di(t,this);this._add("scrollZoom",d,["mousePan"]);var m=t.keyboard=new ui;this._add("keyboard",m),this._add("blockableMapEvent",new qn(t));for(var g=0,y=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];g<y.length;g+=1){var v=y[g];e.interactive&&e[v]&&t[v].enable(e[v])}},ki.prototype._add=function(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t},ki.prototype.stop=function(e){if(!this._updatingCamera){for(var t=0,r=this._handlers;t<r.length;t+=1)r[t].handler.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}},ki.prototype.isActive=function(){for(var e=0,t=this._handlers;e<t.length;e+=1)if(t[e].handler.isActive())return!0;return!1},ki.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},ki.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},ki.prototype.isMoving=function(){return!!bi(this._eventsInProgress)||this.isZooming()},ki.prototype._blockedByActive=function(e,t,r){for(var n in e)if(n!==r&&(!t||t.indexOf(n)<0))return!0;return!1},ki.prototype.handleWindowEvent=function(e){this.handleEvent(e,e.type+"Window")},ki.prototype._getMapTouches=function(e){for(var t=[],r=0,n=e;r<n.length;r+=1){var i=n[r],a=i.target;this._el.contains(a)&&t.push(i)}return t},ki.prototype.handleEvent=function(e,t){if("blur"!==e.type){this._updatingCamera=!0;for(var n="renderFrame"===e.type?void 0:e,i={needsRenderFrame:!1},a={},o={},s=e.touches?this._getMapTouches(e.touches):void 0,l=s?r.touchPos(this._el,s):r.mousePos(this._el,e),c=0,u=this._handlers;c<u.length;c+=1){var h=u[c],f=h.handlerName,p=h.handler,d=h.allowed;if(p.isEnabled()){var m=void 0;this._blockedByActive(o,d,f)?p.reset():p[t||e.type]&&(m=p[t||e.type](e,l,s),this.mergeHandlerResult(i,a,m,f,n),m&&m.needsRenderFrame&&this._triggerRenderFrame()),(m||p.isActive())&&(o[f]=p)}}var g={};for(var y in this._previousActiveHandlers)o[y]||(g[y]=n);this._previousActiveHandlers=o,(Object.keys(g).length||Ti(i))&&(this._changes.push([i,a,g]),this._triggerRenderFrame()),(Object.keys(o).length||Ti(i))&&this._map._stop(!0),this._updatingCamera=!1;var v=i.cameraAnimation;v&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],v(this._map))}else this.stop(!0)},ki.prototype.mergeHandlerResult=function(t,r,n,i,a){if(n){e.extend(t,n);var o={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}},ki.prototype._applyChanges=function(){for(var t={},r={},n={},i=0,a=this._changes;i<a.length;i+=1){var o=a[i],s=o[0],l=o[1],c=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),void 0!==s.around&&(t.around=s.around),void 0!==s.pinchAround&&(t.pinchAround=s.pinchAround),s.noInertia&&(t.noInertia=s.noInertia),e.extend(r,l),e.extend(n,c)}this._updateMapTransform(t,r,n),this._changes=[]},ki.prototype._updateMapTransform=function(e,t,r){var n=this._map,i=n.transform;if(!Ti(e))return this._fireEvents(t,r,!0);var a=e.panDelta,o=e.zoomDelta,s=e.bearingDelta,l=e.pitchDelta,c=e.around,u=e.pinchAround;void 0!==u&&(c=u),n._stop(!0),c=c||n.transform.centerPoint;var h=i.pointLocation(a?c.sub(a):c);s&&(i.bearing+=s),l&&(i.pitch+=l),o&&(i.zoom+=o),i.setLocationAtPoint(h,c),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,r,!0)},ki.prototype._fireEvents=function(t,r,n){var i=this,a=bi(this._eventsInProgress),o=bi(t),s={};for(var l in t){var c=t[l].originalEvent;this._eventsInProgress[l]||(s[l+"start"]=c),this._eventsInProgress[l]=t[l]}for(var u in!a&&o&&this._fireEvent("movestart",o.originalEvent),s)this._fireEvent(u,s[u]);for(var h in o&&this._fireEvent("move",o.originalEvent),t){var f=t[h].originalEvent;this._fireEvent(h,f)}var p,d={};for(var m in this._eventsInProgress){var g=this._eventsInProgress[m],y=g.handlerName,v=g.originalEvent;this._handlersById[y].isActive()||(delete this._eventsInProgress[m],p=r[y]||v,d[m+"end"]=p)}for(var x in d)this._fireEvent(x,d[x]);var _=bi(this._eventsInProgress);if(n&&(a||o)&&!_){this._updatingCamera=!0;var b=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),w=function(e){return 0!==e&&-i._bearingSnap<e&&e<i._bearingSnap};b?(w(b.bearing||this._map.getBearing())&&(b.bearing=0),this._map.easeTo(b,{originalEvent:p})):(this._map.fire(new e.Event("moveend",{originalEvent:p})),w(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},ki.prototype._fireEvent=function(t,r){this._map.fire(new e.Event(t,r?{originalEvent:r}:{}))},ki.prototype._requestFrame=function(){var e=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(t){delete e._frameId,e.handleEvent(new wi("renderFrame",{timeStamp:t})),e._applyChanges()}))},ki.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var Ai=function(t){function r(r,n){t.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,e.bindAll(["_renderFrameCallback"],this)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return new e.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(e,t){return this.jumpTo({center:e},t)},r.prototype.panBy=function(t,r,n){return t=e.Point.convert(t).mult(-1),this.panTo(this.transform.center,e.extend({offset:t},r),n)},r.prototype.panTo=function(t,r,n){return this.easeTo(e.extend({center:t},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(e,t){return this.jumpTo({zoom:e},t),this},r.prototype.zoomTo=function(t,r,n){return this.easeTo(e.extend({zoom:t},r),n)},r.prototype.zoomIn=function(e,t){return this.zoomTo(this.getZoom()+1,e,t),this},r.prototype.zoomOut=function(e,t){return this.zoomTo(this.getZoom()-1,e,t),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(e,t){return this.jumpTo({bearing:e},t),this},r.prototype.getPadding=function(){return this.transform.padding},r.prototype.setPadding=function(e,t){return this.jumpTo({padding:e},t),this},r.prototype.rotateTo=function(t,r,n){return this.easeTo(e.extend({bearing:t},r),n)},r.prototype.resetNorth=function(t,r){return this.rotateTo(0,e.extend({duration:1e3},t),r),this},r.prototype.resetNorthPitch=function(t,r){return this.easeTo(e.extend({bearing:0,pitch:0,duration:1e3},t),r),this},r.prototype.snapToNorth=function(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this},r.prototype.getPitch=function(){return this.transform.pitch},r.prototype.setPitch=function(e,t){return this.jumpTo({pitch:e},t),this},r.prototype.cameraForBounds=function(t,r){t=e.LngLatBounds.convert(t);var n=r&&r.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),n,r)},r.prototype._cameraForBoxAndBearing=function(t,r,n,i){var a={top:0,bottom:0,right:0,left:0};if("number"==typeof(i=e.extend({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){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,l=s.padding,c=s.project(e.LngLat.convert(t)),u=s.project(e.LngLat.convert(r)),h=c.rotate(-n*Math.PI/180),f=u.rotate(-n*Math.PI/180),p=new e.Point(Math.max(h.x,f.x),Math.max(h.y,f.y)),d=new e.Point(Math.min(h.x,f.x),Math.min(h.y,f.y)),m=p.sub(d),g=(s.width-(l.left+l.right+i.padding.left+i.padding.right))/m.x,y=(s.height-(l.top+l.bottom+i.padding.top+i.padding.bottom))/m.y;if(!(y<0||g<0)){var v=Math.min(s.scaleZoom(s.scale*Math.min(g,y)),i.maxZoom),x="number"==typeof i.offset.x?new e.Point(i.offset.x,i.offset.y):e.Point.convert(i.offset),_=(i.padding.left-i.padding.right)/2,b=(i.padding.top-i.padding.bottom)/2,w=new e.Point(_,b).rotate(n*Math.PI/180),T=x.add(w).mult(s.scale/s.zoomScale(v));return{center:s.unproject(c.add(u).div(2).sub(T)),zoom:v,bearing:n}}e.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},r.prototype.fitBounds=function(e,t,r){return this._fitInternal(this.cameraForBounds(e,t),t,r)},r.prototype.fitScreenCoordinates=function(t,r,n,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.Point.convert(t)),this.transform.pointLocation(e.Point.convert(r)),n,i),i,a)},r.prototype._fitInternal=function(t,r,n){return t?(delete(r=e.extend(t,r)).padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this},r.prototype.jumpTo=function(t,r){this.stop();var n=this.transform,i=!1,a=!1,o=!1;return"zoom"in t&&n.zoom!==+t.zoom&&(i=!0,n.zoom=+t.zoom),void 0!==t.center&&(n.center=e.LngLat.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(a=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(o=!0,n.pitch=+t.pitch),null!=t.padding&&!n.isPaddingEqual(t.padding)&&(n.padding=t.padding),this.fire(new e.Event("movestart",r)).fire(new e.Event("move",r)),i&&this.fire(new e.Event("zoomstart",r)).fire(new e.Event("zoom",r)).fire(new e.Event("zoomend",r)),a&&this.fire(new e.Event("rotatestart",r)).fire(new e.Event("rotate",r)).fire(new e.Event("rotateend",r)),o&&this.fire(new e.Event("pitchstart",r)).fire(new e.Event("pitch",r)).fire(new e.Event("pitchend",r)),this.fire(new e.Event("moveend",r))},r.prototype.easeTo=function(t,r){var n=this;this._stop(!1,t.easeId),(!1===(t=e.extend({offset:[0,0],duration:500,easing:e.ease},t)).animate||!t.essential&&e.browser.prefersReducedMotion)&&(t.duration=0);var i=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l=this.getPadding(),c="zoom"in t?+t.zoom:a,u="bearing"in t?this._normalizeBearing(t.bearing,o):o,h="pitch"in t?+t.pitch:s,f="padding"in t?t.padding:i.padding,p=e.Point.convert(t.offset),d=i.centerPoint.add(p),m=i.pointLocation(d),g=e.LngLat.convert(t.center||m);this._normalizeCenter(g);var y,v,x=i.project(m),_=i.project(g).sub(x),b=i.zoomScale(c-a);t.around&&(y=e.LngLat.convert(t.around),v=i.locationPoint(y));var w={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||c!==a,this._rotating=this._rotating||o!==u,this._pitching=this._pitching||h!==s,this._padding=!i.isPaddingEqual(f),this._easeId=t.easeId,this._prepareEase(r,t.noMoveStart,w),this._ease((function(t){if(n._zooming&&(i.zoom=e.number(a,c,t)),n._rotating&&(i.bearing=e.number(o,u,t)),n._pitching&&(i.pitch=e.number(s,h,t)),n._padding&&(i.interpolatePadding(l,f,t),d=i.centerPoint.add(p)),y)i.setLocationAtPoint(y,v);else{var m=i.zoomScale(i.zoom-a),g=c>a?Math.min(2,b):Math.max(.5,b),w=Math.pow(g,1-t),T=i.unproject(x.add(_.mult(t*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?T.wrap():T,d)}n._fireMoveEvents(r)}),(function(e){n._afterEase(r,e)}),t),this},r.prototype._prepareEase=function(t,r,n){void 0===n&&(n={}),this._moving=!0,!r&&!n.moving&&this.fire(new e.Event("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.Event("pitchstart",t))},r.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))},r.prototype._afterEase=function(t,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&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))}},r.prototype.flyTo=function(t,r){var n=this;if(!t.essential&&e.browser.prefersReducedMotion){var i=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}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(),l=this.getPitch(),c=this.getPadding(),u="zoom"in t?e.clamp(+t.zoom,a.minZoom,a.maxZoom):o,h="bearing"in t?this._normalizeBearing(t.bearing,s):s,f="pitch"in t?+t.pitch:l,p="padding"in t?t.padding:a.padding,d=a.zoomScale(u-o),m=e.Point.convert(t.offset),g=a.centerPoint.add(m),y=a.pointLocation(g),v=e.LngLat.convert(t.center||y);this._normalizeCenter(v);var x=a.project(y),_=a.project(v).sub(x),b=t.curve,w=Math.max(a.width,a.height),T=w/d,k=_.mag();if("minZoom"in t){var A=e.clamp(Math.min(t.minZoom,o,u),a.minZoom,a.maxZoom),M=w/a.zoomScale(A-o);b=Math.sqrt(M/k*2)}var S=b*b;function E(e){var t=(T*T-w*w+(e?-1:1)*S*S*k*k)/(2*(e?T:w)*S*k);return Math.log(Math.sqrt(t*t+1)-t)}function C(e){return(Math.exp(e)-Math.exp(-e))/2}function I(e){return(Math.exp(e)+Math.exp(-e))/2}var L=E(0),P=function(e){return I(L)/I(L+b*e)},z=function(e){return w*((I(L)*function(e){return C(e)/I(e)}(L+b*e)-C(L))/S)/k},D=(E(1)-L)/b;if(Math.abs(k)<1e-6||!isFinite(D)){if(Math.abs(w-T)<1e-6)return this.easeTo(t,r);var O=T<w?-1:1;D=Math.abs(Math.log(T/w))/b,z=function(){return 0},P=function(e){return Math.exp(O*b*e)}}if("duration"in t)t.duration=+t.duration;else{var R="screenSpeed"in t?+t.screenSpeed/b:+t.speed;t.duration=1e3*D/R}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=f!==l,this._padding=!a.isPaddingEqual(p),this._prepareEase(r,!1),this._ease((function(t){var i=t*D,d=1/P(i);a.zoom=1===t?u:o+a.scaleZoom(d),n._rotating&&(a.bearing=e.number(s,h,t)),n._pitching&&(a.pitch=e.number(l,f,t)),n._padding&&(a.interpolatePadding(c,p,t),g=a.centerPoint.add(m));var y=1===t?v:a.unproject(x.add(_.mult(z(i))).mult(d));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,g),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),t),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,t)}if(!e){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(t,r,n){!1===n.animate||0===n.duration?(t(1),r()):(this._easeStart=e.browser.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.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()},r.prototype._normalizeBearing=function(t,r){t=e.wrap(t,-180,180);var n=Math.abs(t-r);return Math.abs(t-360-r)<n&&(t-=360),Math.abs(t+360-r)<n&&(t+=360),t},r.prototype._normalizeCenter=function(e){var t=this.transform;if(t.renderWorldCopies&&!t.lngRange){var r=e.lng-t.center.lng;e.lng+=r>180?-360:r<-180?360:0}},r}(e.Evented),Mi=function(t){void 0===t&&(t={}),this.options=t,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Mi.prototype.getDefaultPosition=function(){return"bottom-right"},Mi.prototype.onAdd=function(e){var t=this.options&&this.options.compact;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),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),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Mi.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Mi.prototype._setElementTitle=function(e,t){var r=this._map._getUIString("AttributionControl."+t);e.title=r,e.setAttribute("aria-label",r)},Mi.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"))},Mi.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{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 n=r.reduce((function(e,t,n){return t.value&&(e+=t.key+"="+t.value+(n<r.length-1?"&":"")),e}),"?");t.href=e.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),t.rel="noopener nofollow",this._setElementTitle(t,"MapFeedback")}},Mi.prototype._updateData=function(e){e&&("metadata"===e.sourceDataType||"visibility"===e.sourceDataType||"style"===e.dataType)&&(this._updateAttributions(),this._updateEditLink())},Mi.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"string"!=typeof e?"":e}))):"string"==typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){var t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}var r=this._map.style.sourceCaches;for(var n in r){var i=r[n];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}));var o=(e=e.filter((function(t,r){for(var n=r+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0}))).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)}},Mi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Si=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};Si.prototype.onAdd=function(e){this._map=e,this._container=r.create("div","mapboxgl-ctrl");var t=r.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},Si.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Si.prototype.getDefaultPosition=function(){return"bottom-left"},Si.prototype._updateLogo=function(e){(!e||"metadata"===e.sourceDataType)&&(this._container.style.display=this._logoRequired()?"block":"none")},Si.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}},Si.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 Ei=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ei.prototype.add=function(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t},Ei.prototype.remove=function(e){for(var t=this._currentlyRunning,r=0,n=t?this._queue.concat(t):this._queue;r<n.length;r+=1){var i=n[r];if(i.id===e)return void(i.cancelled=!0)}},Ei.prototype.run=function(e){void 0===e&&(e=0);var t=this._currentlyRunning=this._queue;this._queue=[];for(var r=0,n=t;r<n.length;r+=1){var i=n[r];if(!i.cancelled&&(i.callback(e),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Ei.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Ci={"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"},Ii=e.window.HTMLImageElement,Li=e.window.HTMLElement,Pi=e.window.ImageBitmap,zi={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,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},Di=function(n){function i(t){var r=this;if(null!=(t=e.extend({},zi,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var i=new En(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies);if(n.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 Ei,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Ci,t.locale),this._clickTolerance=t.clickTolerance,this._requestManager=new e.RequestManager(t.transformRequest,t.accessToken),"string"==typeof t.container){if(this._container=e.window.document.getElementById(t.container),!this._container)throw new Error("Container '"+t.container+"' not found.")}else{if(!(t.container instanceof Li))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),typeof e.window<"u"&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new ki(this,t);var a="string"==typeof t.hash&&t.hash||void 0;this._hash=t.hash&&new In(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 Mi({customAttribution:t.customAttribution})),this.addControl(new Si,t.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(t){r._update("style"===t.dataType),r.fire(new e.Event(t.dataType+"data",t))})),this.on("dataloading",(function(t){r.fire(new e.Event(t.dataType+"dataloading",t))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.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,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=t.onAdd(this);this._controls.push(t);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this},i.prototype.hasControl=function(e){return this._controls.indexOf(e)>-1},i.prototype.resize=function(t){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,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=e??-2)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},i.prototype.getMinZoom=function(){return this.transform.minZoom},i.prototype.setMaxZoom=function(e){if((e=e??22)>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(e){if((e=e??0)<0)throw new 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 new Error("minPitch must be between 0 and the current maxPitch, inclusive")},i.prototype.getMinPitch=function(){return this.transform.minPitch},i.prototype.setMaxPitch=function(e){if((e=e??60)>60)throw new Error("maxPitch must be less than or equal to 60");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new 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,r){var n,i=this;if("mouseenter"===e||"mouseover"===e){var a=!1;return{layer:t,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[];o.length?a||(a=!0,r.call(i,new jn(e,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===e||"mouseout"===e){var o=!1;return{layer:t,listener:r,delegates:{mousemove:function(n){(i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[]).length?o=!0:o&&(o=!1,r.call(i,new jn(e,i,n.originalEvent)))},mouseout:function(t){o&&(o=!1,r.call(i,new jn(e,i,t.originalEvent)))}}}}return{layer:t,listener:r,delegates:(n={},n[e]=function(e){var n=i.getLayer(t)?i.queryRenderedFeatures(e.point,{layers:[t]}):[];n.length&&(e.features=n,r.call(i,e),delete e.features)},n)}},i.prototype.on=function(e,t,r){if(void 0===r)return n.prototype.on.call(this,e,t);var i=this._createDelegatedListener(e,t,r);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,r){if(void 0===r)return n.prototype.once.call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(e,t,r){var i=this;return void 0===r?n.prototype.off.call(this,e,t):(this._delegatedListeners&&this._delegatedListeners[e]&&function(n){for(var a=n[e],o=0;o<a.length;o++){var s=a[o];if(s.layer===t&&s.listener===r){for(var l in s.delegates)i.off(l,s.delegates[l]);return a.splice(o,1),i}}}(this._delegatedListeners),this)},i.prototype.queryRenderedFeatures=function(t,r){if(!this.style)return[];var n;if(void 0===r&&void 0!==t&&!(t instanceof e.Point)&&!Array.isArray(t)&&(r=t,t=void 0),r=r||{},(t=t||[[0,0],[this.transform.width,this.transform.height]])instanceof e.Point||"number"==typeof t[0])n=[e.Point.convert(t)];else{var i=e.Point.convert(t[0]),a=e.Point.convert(t[1]);n=[i,new e.Point(a.x,i.y),a,new e.Point(i.x,a.y),i]}return this.style.queryRenderedFeatures(n,r,this.transform)},i.prototype.querySourceFeatures=function(e,t){return this.style.querySourceFeatures(e,t)},i.prototype.setStyle=function(t,r){return!1!==(r=e.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(t,r))},i.prototype._getUIString=function(e){var t=this._locale[e];if(null==t)throw new Error("Missing UI string '"+e+"'");return t},i.prototype._updateStyle=function(e,t){return this.style&&(this.style.setEventedParent(null),this.style._remove()),e?(this.style=new Gt(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e):this.style.loadJSON(e),this):(delete this.style,this)},i.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Gt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},i.prototype._diffStyle=function(t,r){var n=this;if("string"==typeof t){var i=this._requestManager.normalizeStyleURL(t),a=this._requestManager.transformRequest(i,e.ResourceType.Style);e.getJSON(a,(function(t,i){t?n.fire(new e.ErrorEvent(t)):i&&n._updateDiff(i,r)}))}else"object"==typeof t&&this._updateDiff(t,r)},i.prototype._updateDiff=function(t,r){try{this.style.setState(t)&&this._update(!0)}catch(n){e.warnOnce("Unable to perform style diff: "+(n.message||n.error||n)+". Rebuilding the style from scratch."),this._updateStyle(t,r)}},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 r=this.style&&this.style.sourceCaches[t];if(void 0!==r)return r.loaded();this.fire(new e.ErrorEvent(new Error("There is no source with ID '"+t+"'")))},i.prototype.areTilesLoaded=function(){var e=this.style&&this.style.sourceCaches;for(var t in e){var r=e[t]._tiles;for(var n in r){var i=r[n];if("loaded"!==i.state&&"errored"!==i.state)return!1}}return!0},i.prototype.addSourceType=function(e,t,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,r)},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,r,n){void 0===n&&(n={});var i=n.pixelRatio;void 0===i&&(i=1);var a=n.sdf;void 0===a&&(a=!1);var o=n.stretchX,s=n.stretchY,l=n.content;if(this._lazyInitEmptyStyle(),r instanceof Ii||Pi&&r instanceof Pi){var c=e.browser.getImageData(r),u=c.width,h=c.height,f=c.data;this.style.addImage(t,{data:new e.RGBAImage({width:u,height:h},f),pixelRatio:i,stretchX:o,stretchY:s,content:l,sdf:a,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var p=r.width,d=r.height,m=r.data,g=r;this.style.addImage(t,{data:new e.RGBAImage({width:p,height:d},new Uint8Array(m)),pixelRatio:i,stretchX:o,stretchY:s,content:l,sdf:a,version:0,userImage:g}),g.onAdd&&g.onAdd(this,t)}},i.prototype.updateImage=function(t,r){var n=this.style.getImage(t);if(!n)return this.fire(new e.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var i=r instanceof Ii||Pi&&r instanceof Pi?e.browser.getImageData(r):r,a=i.width,o=i.height,s=i.data;if(void 0===a||void 0===o)return this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(a!==n.data.width||o!==n.data.height)return this.fire(new e.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));var l=!(r instanceof Ii||Pi&&r instanceof Pi);n.data.replace(s,l),this.style.updateImage(t,n)},i.prototype.hasImage=function(t){return t?!!this.style.getImage(t):(this.fire(new e.ErrorEvent(new Error("Missing required image id"))),!1)},i.prototype.removeImage=function(e){this.style.removeImage(e)},i.prototype.loadImage=function(t,r){e.getImage(this._requestManager.transformRequest(t,e.ResourceType.Image),r)},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,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)},i.prototype.setFilter=function(e,t,r){return void 0===r&&(r={}),this.style.setFilter(e,t,r),this._update(!0)},i.prototype.getFilter=function(e){return this.style.getFilter(e)},i.prototype.setPaintProperty=function(e,t,r,n){return void 0===n&&(n={}),this.style.setPaintProperty(e,t,r,n),this._update(!0)},i.prototype.getPaintProperty=function(e,t){return this.style.getPaintProperty(e,t)},i.prototype.setLayoutProperty=function(e,t,r,n){return void 0===n&&(n={}),this.style.setLayoutProperty(e,t,r,n),this._update(!0)},i.prototype.getLayoutProperty=function(e,t){return this.style.getLayoutProperty(e,t)},i.prototype.setLight=function(e,t){return void 0===t&&(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(){"rgb(250, 128, 114)"!==e.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&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"),(this._missingCSSCanary=r.create("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();var t=this._canvasContainer=r.create("div","mapboxgl-canvas-container",e);this._interactive&&t.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",t),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 n=this._containerDimensions();this._resizeCanvas(n[0],n[1]);var i=this._controlContainer=r.create("div","mapboxgl-control-container",e),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(e){a[e]=r.create("div","mapboxgl-ctrl-"+e,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},i.prototype._resizeCanvas=function(t,r){var n=e.browser.devicePixelRatio||1;this._canvas.width=n*t,this._canvas.height=n*r,this._canvas.style.width=t+"px",this._canvas.style.height=r+"px"},i.prototype._setupPainter=function(){var r=e.extend({},t.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);n?(this.painter=new kn(n,this.transform),e.webpSupported.testSupport(n)):this.fire(new e.ErrorEvent(new Error("Failed to initialize WebGL")))},i.prototype._contextLost=function(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=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 r,n=this,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,l=e.browser.now();this.style.zoomHistory.update(s,l);var c=new e.EvaluationParameters(s,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),u=c.crossFadingFactor();(1!==u||u!==this._crossFadingFactor)&&(o=!0,this._crossFadingFactor=u),this.style.update(c)}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 h=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:h,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,r=this._controls;t<r.length;t+=1)r[t].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof e.window<"u"&&(e.window.removeEventListener("resize",this._onWindowResize,!1),e.window.removeEventListener("orientationchange",this._onWindowResize,!1),e.window.removeEventListener("online",this._onWindowOnline,!1));var n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext&&n.loseContext(),Oi(this._canvasContainer),Oi(this._controlContainer),Oi(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,r){e.setCacheLimits(t,r)},a.version.get=function(){return e.version},Object.defineProperties(i.prototype,a),i}(Ai);function Oi(e){e.parentNode&&e.parentNode.removeChild(e)}var Ri={showCompass:!0,showZoom:!0,visualizePitch:!1},Fi=function(t){var n=this;this.options=e.extend({},Ri,t),this._container=r.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 n._map.zoomIn({},{originalEvent:e})})),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(e){return n._map.zoomOut({},{originalEvent:e})})),r.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){n.options.visualizePitch?n._map.resetNorthPitch({},{originalEvent:e}):n._map.resetNorth({},{originalEvent:e})})),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Fi.prototype._updateZoomButtons=function(){var e=this._map.getZoom(),t=e===this._map.getMaxZoom(),r=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},Fi.prototype._rotateCompassArrow=function(){var e=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=e},Fi.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 Bi(this._map,this._compass,this.options.visualizePitch)),this._container},Fi.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Fi.prototype._createButton=function(e,t){var n=r.create("button",e,this._container);return n.type="button",n.addEventListener("click",t),n},Fi.prototype._setButtonTitle=function(e,t){var r=this._map._getUIString("NavigationControl."+t);e.title=r,e.setAttribute("aria-label",r)};var Bi=function(t,n,i){void 0===i&&(i=!1),this._clickTolerance=10,this.element=n,this.mouseRotate=new Jn({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,i&&(this.mousePitch=new Qn({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(n,"mousedown",this.mousedown),r.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(n,"touchmove",this.touchmove),r.addEventListener(n,"touchend",this.touchend),r.addEventListener(n,"touchcancel",this.reset)};function ji(t,r,n){if(t=new e.LngLat(t.lng,t.lat),r){var i=new e.LngLat(t.lng-360,t.lat),a=new e.LngLat(t.lng+360,t.lat),o=n.locationPoint(t).distSqr(r);n.locationPoint(i).distSqr(r)<o?t=i:n.locationPoint(a).distSqr(r)<o&&(t=a)}for(;Math.abs(t.lng-n.center.lng)>180;){var s=n.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}Bi.prototype.down=function(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),r.disableDrag()},Bi.prototype.move=function(e,t){var r=this.map,n=this.mouseRotate.mousemoveWindow(e,t);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(e,t);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Bi.prototype.off=function(){var e=this.element;r.removeEventListener(e,"mousedown",this.mousedown),r.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(e,"touchmove",this.touchmove),r.removeEventListener(e,"touchend",this.touchend),r.removeEventListener(e,"touchcancel",this.reset),this.offTemp()},Bi.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(e.window,"mousemove",this.mousemove),r.removeEventListener(e.window,"mouseup",this.mouseup)},Bi.prototype.mousedown=function(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),r.mousePos(this.element,t)),r.addEventListener(e.window,"mousemove",this.mousemove),r.addEventListener(e.window,"mouseup",this.mouseup)},Bi.prototype.mousemove=function(e){this.move(e,r.mousePos(this.element,e))},Bi.prototype.mouseup=function(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()},Bi.prototype.touchstart=function(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return e.preventDefault()}},this._startPos))},Bi.prototype.touchmove=function(e){1!==e.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.move({preventDefault:function(){return e.preventDefault()}},this._lastPos))},Bi.prototype.touchend=function(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Bi.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Ni={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 Ui(e,t,r){var n=e.classList;for(var i in Ni)n.remove("mapboxgl-"+r+"-anchor-"+i);n.add("mapboxgl-"+r+"-anchor-"+t)}var Vi,qi=function(t){function n(n,i){if(t.call(this),(n instanceof e.window.HTMLElement||i)&&(n=e.extend({element:n},i)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&"auto"!==n.pitchAlignment?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=e.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var a=r.createNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","41px"),a.setAttributeNS(null,"width","27px"),a.setAttributeNS(null,"viewBox","0 0 27 41");var o=r.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var l=r.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var c=0,u=[{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"}];c<u.length;c+=1){var h=u[c],f=r.createNS("http://www.w3.org/2000/svg","ellipse");f.setAttributeNS(null,"opacity","0.04"),f.setAttributeNS(null,"cx","10.5"),f.setAttributeNS(null,"cy","5.80029008"),f.setAttributeNS(null,"rx",h.rx),f.setAttributeNS(null,"ry",h.ry),l.appendChild(f)}var p=r.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"fill",this._color);var d=r.createNS("http://www.w3.org/2000/svg","path");d.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"),p.appendChild(d);var m=r.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var g=r.createNS("http://www.w3.org/2000/svg","path");g.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"),m.appendChild(g);var y=r.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(6.0, 7.0)"),y.setAttributeNS(null,"fill","#FFFFFF");var v=r.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(8.0, 8.0)");var x=r.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#000000"),x.setAttributeNS(null,"opacity","0.25"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962");var _=r.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#FFFFFF"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962"),v.appendChild(x),v.appendChild(_),s.appendChild(l),s.appendChild(p),s.appendChild(m),s.appendChild(y),s.appendChild(v),a.appendChild(s),a.setAttributeNS(null,"height",41*this._scale+"px"),a.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(a),this._offset=e.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(e){e.preventDefault()})),this._element.addEventListener("mousedown",(function(e){e.preventDefault()})),Ui(this._element,this._anchor,"marker"),this._popup=null}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.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},n.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),r.remove(this._element),this._popup&&this._popup.remove(),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},n.prototype.getElement=function(){return this._element},n.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=13.5,r=Math.sqrt(Math.pow(t,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[r,-1*(24.6+r)],"bottom-right":[-r,-1*(24.6+r)],left:[t,-24.6],right:[-t,-24.6]}: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},n.prototype._onKeyPress=function(e){var t=e.code,r=e.charCode||e.keyCode;("Space"===t||"Enter"===t||32===r||13===r)&&this.togglePopup()},n.prototype._onMapClick=function(e){var t=e.originalEvent.target,r=this._element;this._popup&&(t===r||r.contains(t))&&this.togglePopup()},n.prototype.getPopup=function(){return this._popup},n.prototype.togglePopup=function(){var e=this._popup;return e?(e.isOpen()?e.remove():e.addTo(this._map),this):this},n.prototype._update=function(e){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=ji(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var t="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?t="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(t="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n="rotateX("+this._map.getPitch()+"deg)"),(!e||"moveend"===e.type)&&(this._pos=this._pos.round()),r.setTransform(this._element,Ni[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+n+" "+t)}},n.prototype.getOffset=function(){return this._offset},n.prototype.setOffset=function(t){return this._offset=e.Point.convert(t),this._update(),this},n.prototype._onMove=function(t){if(!this._isDragging){var r=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=r}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","pending"===this._state&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},n.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),"active"===this._state&&this.fire(new e.Event("dragend")),this._state="inactive"},n.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))},n.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},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(e){return this._rotation=e||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(e){return this._rotationAlignment=e||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(e.Evented),Hi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Gi=0,Wi=!1,Zi=function(t){function n(r){t.call(this),this.options=e.extend({},Hi,r),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),function(t){void 0!==Vi?t(Vi):void 0!==e.window.navigator.permissions?e.window.navigator.permissions.query({name:"geolocation"}).then((function(e){Vi="denied"!==e.state,t(Vi)})):(Vi=!!e.window.navigator.geolocation,t(Vi))}(this._setupUI),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(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(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Gi=0,Wi=!1},n.prototype._isOutOfMapMaxBounds=function(e){var t=this._map.getMaxBounds(),r=e.coords;return t&&(r.longitude<t.getWest()||r.longitude>t.getEast()||r.latitude<t.getSouth()||r.latitude>t.getNorth())},n.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")}},n.prototype._onSuccess=function(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();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")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),(!this.options.trackUserLocation||"ACTIVE_LOCK"===this._watchState)&&this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}},n.prototype._updateCamera=function(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),a=e.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(t){if(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var e=this._map._container.clientHeight/2,t=this._map.unproject([0,e]),r=this._map.unproject([1,e]),n=t.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){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 r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Wi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(t){var n=this;if(this._container.addEventListener("contextmenu",(function(e){return e.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===t){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=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new qi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new qi({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 r=t.originalEvent&&"resize"===t.originalEvent.type;!t.geolocateSource&&"ACTIVE_LOCK"===n._watchState&&!r&&(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new e.Event("trackuserlocationend")))}))},n.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":Gi--,Wi=!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"))}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")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var t;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Gi>1?(t={maximumAge:6e5,timeout:0},Wi=!0):(t=this.options.positionOptions,Wi=!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},n.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)},n}(e.Evented),Yi={maxWidth:100,unit:"metric"},Xi=function(t){this.options=e.extend({},Yi,t),e.bindAll(["_onMove","setUnit"],this)};function $i(e,t,r){var n=r&&r.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),o=e.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?Ki(t,n,l/5280,e._getUIString("ScaleControl.Miles")):Ki(t,n,l,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Ki(t,n,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Ki(t,n,s/1e3,e._getUIString("ScaleControl.Kilometers")):Ki(t,n,s,e._getUIString("ScaleControl.Meters"))}function Ki(e,t,r,n){var i=function(e){var t=Math.pow(10,(""+Math.floor(e)).length-1),r=e/t;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(e){var t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(r),t*r}(r),a=i/r;e.style.width=t*a+"px",e.innerHTML=i+" "+n}Xi.prototype.getDefaultPosition=function(){return"bottom-left"},Xi.prototype._onMove=function(){$i(this._map,this._container,this.options)},Xi.prototype.onAdd=function(e){return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Xi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Xi.prototype.setUnit=function(e){this.options.unit=e,$i(this._map,this._container,this.options)};var Ji=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")};Ji.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Ji.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ji.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},Ji.prototype._setupUI=function(){var t=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.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)},Ji.prototype._updateTitle=function(){var e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e},Ji.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ji.prototype._isFullscreen=function(){return this._fullscreen},Ji.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())},Ji.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 Qi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ea=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),ta=function(t){function n(r){t.call(this),this.options=e.extend(Object.create(Qi),r),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.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},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.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},n.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},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(t){return this.setDOMContent(e.window.document.createTextNode(t))},n.prototype.setHTML=function(t){var r,n=e.window.document.createDocumentFragment(),i=e.window.document.createElement("body");for(i.innerHTML=t;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(e){return this.options.maxWidth=e,this._update(),this},n.prototype.setDOMContent=function(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(e){this._container&&this._container.classList.add(e)},n.prototype.removeClassName=function(e){this._container&&this._container.classList.remove(e)},n.prototype.setOffset=function(e){return this.options.offset=e,this._update(),this},n.prototype.toggleClassName=function(e){if(this._container)return this._container.classList.toggle(e)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(e){this._update(e.point)},n.prototype._onMouseMove=function(e){this._update(e.point)},n.prototype._onDrag=function(e){this._update(e.point)},n.prototype._update=function(e){var t=this,n=this._lngLat||this._trackPointer;if(this._map&&n&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(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=ji(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=ra(this.options.offset);if(!a){var s,l=this._container.offsetWidth,c=this._container.offsetHeight;s=i.y+o.bottom.y<c?["top"]:i.y>this._map.transform.height-c?["bottom"]:[],i.x<l/2?s.push("left"):i.x>this._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var u=i.add(o[a]).round();r.setTransform(this._container,Ni[a]+" translate("+u.x+"px,"+u.y+"px)"),Ui(this._container,a,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var e=this._container.querySelector(ea);e&&e.focus()}},n.prototype._onClose=function(){this.remove()},n}(e.Evented);function ra(t){if(t){if("number"==typeof t){var r=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{center:new e.Point(0,0),top:new e.Point(0,t),"top-left":new e.Point(r,r),"top-right":new e.Point(-r,r),bottom:new e.Point(0,-t),"bottom-left":new e.Point(r,-r),"bottom-right":new e.Point(-r,-r),left:new e.Point(t,0),right:new e.Point(-t,0)}}if(t instanceof e.Point||Array.isArray(t)){var n=e.Point.convert(t);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: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])}}return ra(new e.Point(0,0))}var na={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:Di,NavigationControl:Fi,GeolocateControl:Zi,AttributionControl:Mi,ScaleControl:Xi,FullscreenControl:Ji,Popup:ta,Marker:qi,Style:Gt,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:function(){je().acquire(Oe)},clearPrewarmedResources:function(){var e=Fe;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(Oe),Fe=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get 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 Re.workerCount},set workerCount(e){Re.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 na})),r},"object"==typeof e&&typeof t<"u"?t.exports=n():(r=r||self).mapboxgl=n()}}),V_=m({"src/plots/mapbox/layers.js"(e,t){var r=ct(),n=Et().sanitizeHTML,i=O_(),a=C_();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;function l(e){if(!e.visible)return!1;var t=e.source;if(Array.isArray(t)&&t.length>0){for(var n=0;n<t.length;n++)if("string"!=typeof t[n]||0===t[n].length)return!1;return!0}return r.isPlainObject(t)||"string"==typeof t&&t.length>0}function c(e){var t={},n={};switch(e.type){case"circle":r.extendFlat(n,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case"line":r.extendFlat(n,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case"fill":r.extendFlat(n,{"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);r.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}),r.extendFlat(n,{"icon-color":e.color,"text-color":a.textfont.color,"text-opacity":e.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":e.opacity})}return{layout:t,paint:n}}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=l(e)},s.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===e.sourcetype&&(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());null!==t&&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,l(e)){var r=function(e){var t,r=e.sourcetype,i=e.source,a={type:r};return"geojson"===r?t="data":"vector"===r?t="string"==typeof i?"url":"tiles":"raster"===r?(t="tiles",a.tileSize=256):"image"===r&&(t="url",a.coordinates=e.coordinates),a[t]=i,e.sourceattribution&&(a.attribution=n(e.sourceattribution)),a}(e);t.addSource(this.idSource,r)}},s.findFollowingMapboxLayerId=function(e){if("traces"===e)for(var t=this.subplot.getMapLayers(),r=0;r<t.length;r++){var n=t[r].id;if("string"==typeof n&&0===n.indexOf(a.traceLayerPrefix)){e=n;break}}return e},s.updateLayer=function(e){var t=this.subplot,r=c(e),n=this.lookupBelow(),i=this.findFollowingMapboxLayerId(n);this.removeLayer(),l(e)&&t.addLayer({id:this.idLayer,source:this.idSource,"source-layer":e.sourcelayer||"",type:e.type,minzoom:e.minzoom,maxzoom:e.maxzoom,layout:r.layout,paint:r.paint},i),this.layerType=e.type,this.below=n},s.updateStyle=function(e){if(l(e)){var t=c(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)},t.exports=function(e,t,r){var n=new o(e,t);return n.update(r),n}}}),q_=m({"src/plots/mapbox/mapbox.js"(e,t){var r=U_(),n=ct(),i=wg(),a=He(),o=ar(),s=pr(),l=Or(),c=Rr(),u=c.drawMode,h=c.selectMode,f=Cn().prepSelect,p=Cn().clearOutline,d=Cn().clearSelectionsCache,m=Cn().selectOnClick,g=C_(),y=V_();function v(e,t){this.id=t,this.gd=e;var r=e._fullLayout,n=e._context;this.container=r._glcontainer.node(),this.isStatic=n.staticPlot,this.uid=r._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(r),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var x=v.prototype;x.plot=function(e,t,r){var n,i=this,a=t[i.id];i.map&&a.accesstoken!==i.accessToken&&(i.map.remove(),i.map=null,i.styleObj=null,i.traceHash={},i.layerList=[]),n=i.map?new Promise((function(r,n){i.updateMap(e,t,r,n)})):new Promise((function(r,n){i.createMap(e,t,r,n)})),r.push(n)},x.createMap=function(e,t,n,a){var o=this,s=t[o.id],l=o.styleObj=b(s.style,t);o.accessToken=s.accesstoken;var c=s.bounds,u=c?[[c.west,c.south],[c.east,c.north]]:null,h=o.map=new r.Map({container:o.div,style:l.style,center:T(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 r.AttributionControl({compact:!0}));h._canvas.style.left="0px",h._canvas.style.top="0px",o.rejectOnError(a),o.isStatic||o.initFx(e,t);var f=[];f.push(new Promise((function(e){h.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(n)})).catch(a)},x.updateMap=function(e,t,r,n){var a=this,o=a.map,s=t[this.id];a.rejectOnError(n);var l=[],c=b(s.style,t);JSON.stringify(a.styleObj)!==JSON.stringify(c)&&(a.styleObj=c,o.setStyle(c.style),a.traceHash={},l.push(new Promise((function(e){o.once("styledata",e)})))),l=l.concat(i.fetchTraceGeoData(e)),Promise.all(l).then((function(){a.fillBelowLookup(e,t),a.updateData(e),a.updateLayout(t),a.resolveOnRender(r)})).catch(n)},x.fillBelowLookup=function(e,t){var r,n,i=t[this.id].layers,a=this.belowLookup={},o=!1;for(r=0;r<e.length;r++){var s=e[r][0].trace,l=s._module;"string"==typeof s.below?n=s.below:l.getBelow&&(n=l.getBelow(s,this)),""===n&&(o=!0),a["trace-"+s.uid]=n||""}for(r=0;r<i.length;r++){var c=i[r];n="string"==typeof c.below?c.below:o?"traces":"",a["layout-"+r]=n}var u,h,f={};for(u in a)f[n=a[u]]?f[n].push(u):f[n]=[u];for(n in f){var p=f[n];if(p.length>1)for(r=0;r<p.length;r++)0===(u=p[r]).indexOf("trace-")?(h=u.split("trace-")[1],this.traceHash[h]&&(this.traceHash[h].below=null)):0===u.indexOf("layout-")&&(h=u.split("layout-")[1],this.layerList[h]&&(this.layerList[h].below=null))}};var _={choroplethmapbox:0,densitymapbox:1,scattermapbox:2};function b(e,t){var r={};if(n.isPlainObject(e))r.id=e.id,r.style=e;else if("string"==typeof e)if(r.id=e,-1!==g.styleValuesMapbox.indexOf(e))r.style=w(e);else if(g.stylesNonMapbox[e]){r.style=g.stylesNonMapbox[e];var i=r.style.sources["plotly-"+e],a=i?i.tiles:void 0;a&&a[0]&&"?api_key="===a[0].slice(-9)&&(a[0]+=t._mapboxAccessToken)}else r.style=e;else r.id=g.styleValueDflt,r.style=w(g.styleValueDflt);return r.transition={duration:0,delay:0},r}function w(e){return g.styleUrlPrefix+e+"-"+g.styleUrlSuffix}function T(e){return[e.lon,e.lat]}x.updateData=function(e){var t,r,n,i,a=this.traceHash,o=e.slice().sort((function(e,t){return _[e[0].trace.type]-_[t[0].trace.type]}));for(n=0;n<o.length;n++){var s=o[n],l=!1;(t=a[(r=s[0].trace).uid])&&(t.type===r.type?(t.update(s),l=!0):t.dispose()),!l&&r._module&&(a[r.uid]=r._module.plot(this,s))}var c=Object.keys(a);e:for(n=0;n<c.length;n++){var u=c[n];for(i=0;i<e.length;i++)if(u===(r=e[i][0].trace).uid)continue e;(t=a[u]).dispose(),delete a[u]}},x.updateLayout=function(e){var t=this.map,r=e[this.id];!this.dragging&&!this.wheeling&&(t.setCenter(T(r.center)),t.setZoom(r.zoom),t.setBearing(r.bearing),t.setPitch(r.pitch)),this.updateLayers(e),this.updateFramework(e),this.updateFx(e),this.map.resize(),this.gd._context._scrollZoom.mapbox?t.scrollZoom.enable():t.scrollZoom.disable()},x.resolveOnRender=function(e){var t=this.map;t.on("render",(function r(){t.loaded()&&(t.off("render",r),setTimeout(e,10))}))},x.rejectOnError=function(e){var t=this.map;function r(){e(new Error(g.mapOnErrorMsg))}t.once("error",r),t.once("style.error",r),t.once("source.error",r),t.once("tile.error",r),t.once("layer.error",r)},x.createFramework=function(e){var t=this,r=t.div=document.createElement("div");r.id=t.uid,r.style.position="absolute",t.container.appendChild(r),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)},x.initFx=function(e,t){var r=this,n=r.gd,i=r.map;function o(){l.loneUnhover(t._hoverlayer)}function s(){var e=r.getView();n.emit("plotly_relayouting",r.getViewEditsWithDerived(e))}i.on("moveend",(function(e){if(r.map){var t=n._fullLayout;if(e.originalEvent||r.wheeling){var i=t[r.id];a.call("_storeDirectGUIEdit",n.layout,t._preGUI,r.getViewEdits(i));var o=r.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,n.emit("plotly_relayout",r.getViewEditsWithDerived(o))}e.originalEvent&&"mouseup"===e.originalEvent.type?r.dragging=!1:r.wheeling&&(r.wheeling=!1),t._rehover&&t._rehover()}})),i.on("wheel",(function(){r.wheeling=!0})),i.on("mousemove",(function(e){var t=r.div.getBoundingClientRect(),a=[e.originalEvent.offsetX,e.originalEvent.offsetY];e.target.getBoundingClientRect=function(){return t},r.xaxis.p2c=function(){return i.unproject(a).lng},r.yaxis.p2c=function(){return i.unproject(a).lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===r.id&&n._fullLayout[r.id]&&l.hover(n,e,r.id)},l.hover(n,e,r.id),n._fullLayout._hoversubplot=r.id})),i.on("dragstart",(function(){r.dragging=!0,o()})),i.on("zoomstart",o),i.on("mouseout",(function(){n._fullLayout._hoversubplot=null})),i.on("drag",s),i.on("zoom",s),i.on("dblclick",(function(){var e=n._fullLayout[r.id];a.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,r.getViewEdits(e));var t=r.viewInitial;i.setCenter(T(t.center)),i.setZoom(t.zoom),i.setBearing(t.bearing),i.setPitch(t.pitch);var o=r.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,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",r.getViewEditsWithDerived(o))})),r.clearOutline=function(){d(r.dragOptions),p(r.dragOptions.gd)},r.onClickInPanFn=function(e){return function(t){var i=n._fullLayout.clickmode;i.indexOf("select")>-1&&m(t.originalEvent,n,[r.xaxis],[r.yaxis],r.id,e),i.indexOf("event")>-1&&l.click(n,t.originalEvent)}}},x.updateFx=function(e){var t=this,r=t.map,i=t.gd;if(!t.isStatic){var a,o=e.dragmode;a=function(e,r){r.isRect?(e.range={})[t.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(e.lassoPoints={})[t.id]=r.map(c)};var l=t.dragOptions;t.dragOptions=n.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:a},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),r.off("click",t.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",t.clearOutline),t.dragOptions.prepFn=function(e,r,n){f(e,r,n,t.dragOptions,o)},s.init(t.dragOptions)):(r.dragPan.enable(),r.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),r.on("click",t.onClickInPanHandler))}function c(e){var r=t.map.unproject(e);return[r.lng,r.lat]}},x.updateFramework=function(e){var t=e[this.id].domain,r=e._size,n=this.div.style;n.width=r.w*(t.x[1]-t.x[0])+"px",n.height=r.h*(t.y[1]-t.y[0])+"px",n.left=r.l+t.x[0]*r.w+"px",n.top=r.t+(1-t.y[1])*r.h+"px",this.xaxis._offset=r.l+t.x[0]*r.w,this.xaxis._length=r.w*(t.x[1]-t.x[0]),this.yaxis._offset=r.t+(1-t.y[1])*r.h,this.yaxis._length=r.h*(t.y[1]-t.y[0])},x.updateLayers=function(e){var t,r=e[this.id].layers,n=this.layerList;if(r.length!==n.length){for(t=0;t<n.length;t++)n[t].dispose();for(n=this.layerList=[],t=0;t<r.length;t++)n.push(y(this,t,r[t]))}else for(t=0;t<r.length;t++)n[t].update(r[t])},x.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},x.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},x.setOptions=function(e,t,r){for(var n in r)this.map[t](e,n,r[n])},x.getMapLayers=function(){return this.map.getStyle().layers},x.addLayer=function(e,t){var r=this.map;if("string"==typeof t){if(""===t)return void r.addLayer(e,t);for(var i=this.getMapLayers(),a=0;a<i.length;a++)if(t===i[a].id)return void r.addLayer(e,t);n.warn(["Trying to add layer with *below* value",t,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}r.addLayer(e)},x.project=function(e){return this.map.project(new r.LngLat(e[0],e[1]))},x.getView=function(){var e=this.map,t=e.getCenter(),r={lon:t.lng,lat:t.lat},n=e.getCanvas(),i=parseInt(n.style.width),a=parseInt(n.style.height);return{center:r,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()]}}},x.getViewEdits=function(e){for(var t=this.id,r=["center","zoom","bearing","pitch"],n={},i=0;i<r.length;i++){var a=r[i];n[t+"."+a]=e[a]}return n},x.getViewEditsWithDerived=function(e){var t=this.id,r=this.getViewEdits(e);return r[t+"._derived"]=e._derived,r},t.exports=v}}),H_=m({"src/plots/mapbox/layout_defaults.js"(e,t){var r=ct(),n=Gs(),i=Nt(),a=I_();function o(e,t,r,n){r("accesstoken",n.accessToken),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch");var a=r("bounds.west"),o=r("bounds.east"),l=r("bounds.south"),c=r("bounds.north");(void 0===a||void 0===o||void 0===l||void 0===c)&&delete t.bounds,i(e,t,{name:"layers",handleItemDefaults:s}),t._input=e}function s(e,t){function n(n,i){return r.coerce(e,t,a.layers,n,i)}if(n("visible")){var i,o=n("sourcetype"),s="raster"===o||"image"===o;n("source"),n("sourceattribution"),"vector"===o&&n("sourcelayer"),"image"===o&&n("coordinates"),s&&(i="raster");var l=n("type",i);s&&"raster"!==l&&(l=t.type="raster",r.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),"circle"===l&&n("circle.radius"),"line"===l&&(n("line.width"),n("line.dash")),"fill"===l&&n("fill.outlinecolor"),"symbol"===l&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),r.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}t.exports=function(e,t,r){n(e,t,r,{type:"mapbox",attributes:a,handleDefaults:o,partition:"y",accessToken:t._mapboxAccessToken})}}}),G_=m({"src/plots/mapbox/index.js"(e){var t=U_(),r=ct(),n=r.strTranslate,i=r.strScale,a=Tt().getSubplotCalcData,o=Mt(),s=b(),l=er(),c=Et(),u=q_(),h="mapbox",f=e.constants=C_();e.name=h,e.attr="subplot",e.idRoot=h,e.idRegex=e.attrRegex=r.counterRegex(h);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=I_(),e.supplyLayoutDefaults=H_();var d=!0;function m(e){return"string"==typeof e&&(-1!==f.styleValuesMapbox.indexOf(e)||0===e.indexOf("mapbox://")||0===e.indexOf("stamen"))}e.plot=function(e){d&&(d=!1,r.warn(p));var n=e._fullLayout,i=e.calcdata,o=n._subplots[h];if(t.version!==f.requiredVersion)throw new Error(f.wrongVersionErrorMsg);var s=function(e,t){var n=e._fullLayout;if(""===e._context.mapboxAccessToken)return"";for(var i=[],a=[],o=!1,s=!1,l=0;l<t.length;l++){var c=n[t[l]],u=c.accesstoken;m(c.style)&&(u?r.pushUnique(i,u):(m(c._input.style)&&(r.error("Uses Mapbox map style, but did not set an access token."),o=!0),s=!0)),u&&r.pushUnique(a,u)}if(s){var h=o?f.noAccessTokenErrorMsg:f.missingStyleErrorMsg;throw r.error(h),new Error(h)}return i.length?(i.length>1&&r.warn(f.multipleTokensErrorMsg),i[0]):(a.length&&r.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(e,o);t.accessToken=s;for(var l=0;l<o.length;l++){var c=o[l],g=a(i,h,c),y=n[c],v=y._subplot;v||(v=new u(e,c),n[c]._subplot=v),v.viewInitial||(v.viewInitial={center:r.extendFlat({},y.center),zoom:y.zoom,bearing:y.bearing,pitch:y.pitch}),v.plot(g,n,e._promises)}},e.clean=function(e,t,r,n){for(var i=n._subplots[h]||[],a=0;a<i.length;a++){var o=i[a];!t[o]&&n[o]._subplot&&n[o]._subplot.destroy()}},e.toSVG=function(e){for(var t=e._fullLayout,r=t._subplots[h],a=t._size,u=0;u<r.length;u++){var p=t[r[u]],d=p.domain,m=p._subplot.toImage("png");t._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":m,x:a.l+a.w*d.x[0],y:a.t+a.h*(1-d.y[1]),width:a.w*(d.x[1]-d.x[0]),height:a.h*(d.y[1]-d.y[0]),preserveAspectRatio:"none"});var g=s.select(p._subplot.div);if(null!==g.select(".mapboxgl-ctrl-logo").node().offsetParent){var y=t._glimages.append("g");y.attr("transform",n(a.l+a.w*d.x[0]+10,a.t+a.h*(1-d.y[0])-31)),y.append("path").attr("d",f.mapboxLogo.path0).style({opacity:.9,fill:"#ffffff","enable-background":"new"}),y.append("path").attr("d",f.mapboxLogo.path1).style("opacity",.35).style("enable-background","new"),y.append("path").attr("d",f.mapboxLogo.path2).style("opacity",.35).style("enable-background","new"),y.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",""),x=t._glimages.append("g"),_=x.append("text");_.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 b=l.bBox(_.node()),w=a.w*(d.x[1]-d.x[0]);if(b.width>w/2){var T=v.split("|").join("<br>");_.text(T).attr("data-unformatted",T).call(c.convertToTspans,e),b=l.bBox(_.node())}_.attr("transform",n(-3,8-b.height)),x.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var k=1;b.width+6>w&&(k=w/(b.width+6));var A=[a.l+a.w*d.x[1],a.t+a.h*(1-d.y[0])];x.attr("transform",n(A[0],A[1])+i(k))}},e.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots[h],n=0;n<r.length;n++)t[r[n]]._subplot.updateFx(t)}}}),W_=m({"src/traces/scattermapbox/index.js"(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:L_(),supplyDefaults:z_(),colorbar:mi(),formatLabels:D_(),calc:ug(),plot:F_(),hoverPoints:B_().hoverPoints,eventData:j_(),selectPoints:N_(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.update(t)},moduleType:"trace",name:"scattermapbox",basePlotModule:G_(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}}),Z_=m({"lib/scattermapbox.js"(e,t){t.exports=W_()}}),Y_=m({"src/traces/choroplethmapbox/attributes.js"(e,t){var r=Bg(),n=zt(),{hovertemplateAttrs:i,templatefallbackAttrs:a}=Fe(),o=q(),s=B().extendFlat;t.exports=s({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:s({},r.featureidkey,{}),below:{valType:"string",editType:"plot"},text:r.text,hovertext:r.hovertext,marker:{line:{color:s({},r.marker.line.color,{editType:"plot"}),width:s({},r.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:s({},r.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:s({},r.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:s({},r.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:r.hoverinfo,hovertemplate:i({},{keys:["properties"]}),hovertemplatefallback:a(),showlegend:s({},o.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))}}),X_=m({"src/traces/choroplethmapbox/defaults.js"(e,t){var r=ct(),n=Ht(),i=Y_();t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}var l=s("locations"),c=s("z"),u=s("geojson");r.isArrayOrTypedArray(l)&&l.length&&r.isArrayOrTypedArray(c)&&c.length&&("string"==typeof u&&""!==u||r.isPlainObject(u))?(s("featureidkey"),t._length=Math.min(l.length,c.length),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),n(e,t,o,s,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(t,s)):t.visible=!1}}}),$_=m({"src/traces/choroplethmapbox/convert.js"(e,t){var r=M(),n=ct(),i=Yt(),a=er(),o=dg().makeBlank,s=wg();function l(e){var t,r=e[0].trace,i=r._opts;if(r.selectedpoints){for(var o=a.makeSelectedPointStyleFns(r),s=0;s<e.length;s++){var l=e[s];l.fOut&&(l.fOut.properties.mo2=o.selectedOpacityFn(l))}t={type:"identity",property:"mo2"}}else t=n.isArrayOrTypedArray(r.marker.opacity)?{type:"identity",property:"mo"}:r.marker.opacity;return n.extendFlat(i.fill.paint,{"fill-opacity":t}),n.extendFlat(i.line.paint,{"line-opacity":t}),i}t.exports={convert:function(e){var t=e[0].trace,a=!0===t.visible&&0!==t._length,c={layout:{visibility:"none"},paint:{}},u={layout:{visibility:"none"},paint:{}},h=t._opts={fill:c,line:u,geojson:o()};if(!a)return h;var f=s.extractTraceFeature(e);if(!f)return h;var p,d,m,g=i.makeColorScaleFuncFromTrace(t),y=t.marker,v=y.line||{};n.isArrayOrTypedArray(y.opacity)&&(p=function(e){var t=e.mo;return r(t)?+n.constrain(t,0,1):0}),n.isArrayOrTypedArray(v.color)&&(d=function(e){return e.mlc}),n.isArrayOrTypedArray(v.width)&&(m=function(e){return e.mlw});for(var x=0;x<e.length;x++){var _=e[x],b=_.fOut;if(b){var w=b.properties;w.fc=g(_.z),p&&(w.mo=p(_)),d&&(w.mlc=d(_)),m&&(w.mlw=m(_)),_.ct=w.ct,_._polygons=s.feature2polygons(b)}}var T=p?{type:"identity",property:"mo"}:y.opacity;return n.extendFlat(c.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":T}),n.extendFlat(u.paint,{"line-color":d?{type:"identity",property:"mlc"}:v.color,"line-width":m?{type:"identity",property:"mlw"}:v.width,"line-opacity":T}),c.layout.visibility="visible",u.layout.visibility="visible",h.geojson={type:"FeatureCollection",features:f},l(e),h},convertOnSelect:l}}}),K_=m({"src/traces/choroplethmapbox/plot.js"(e,t){var r=$_().convert,n=$_().convertOnSelect,i=C_().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(r(e)),e[0].trace._glTrace=this},o.updateOnSelect=function(e){this._update(n(e))},o._update=function(e){var t=this.subplot,r=this.layerList,n=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(e.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(e,n),this.below=n);for(var i=0;i<r.length;i++){var a=r[i],o=a[0],s=a[1],l=e[o];t.setOptions(s,"setLayoutProperty",l.layout),"visible"===l.layout.visibility&&t.setOptions(s,"setPaintProperty",l.paint)}},o._addLayers=function(e,t){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=e[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},t)}},o._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var n=t[0].trace,i=new a(e,n.uid),o=i.sourceId,s=r(t),l=i.below=e.belowLookup["trace-"+n.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),t[0].trace._glTrace=i,i}}}),J_=m({"src/traces/choroplethmapbox/index.js"(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:Y_(),supplyDefaults:X_(),colorbar:Vo(),calc:Ng(),plot:K_(),hoverPoints:qg(),eventData:Hg(),selectPoints:Gg(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.updateOnSelect(t)},getBelow:function(e,t){for(var r=t.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a<r.length;a++)if("string"==typeof(i=r[a].id)&&-1===i.indexOf("plotly-"))return i}},moduleType:"trace",name:"choroplethmapbox",basePlotModule:G_(),categories:["mapbox","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_mapbox"}}}}),Q_=m({"lib/choroplethmapbox.js"(e,t){t.exports=J_()}}),eb=m({"src/traces/densitymapbox/attributes.js"(e,t){var r=zt(),{hovertemplateAttrs:n,templatefallbackAttrs:i}=Fe(),a=q(),o=L_(),s=B().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:n(),hovertemplatefallback:i(),showlegend:s({},a.showlegend,{dflt:!1})},r("",{cLetter:"z",editTypeOverride:"calc"}))}}),tb=m({"src/traces/densitymapbox/defaults.js"(e,t){var r=ct(),n=Ht(),i=eb();t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(t._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),n(e,t,o,s,{prefix:"",cLetter:"z"})):t.visible=!1}}}),rb=m({"src/traces/densitymapbox/calc.js"(e,t){var r=M(),n=ct().isArrayOrTypedArray,i=S().BADNUM,a=Zt(),o=ct()._;t.exports=function(e,t){for(var s=t._length,l=new Array(s),c=t.z,u=n(c)&&c.length,h=0;h<s;h++){var f=l[h]={},p=t.lon[h],d=t.lat[h];if(f.lonlat=r(p)&&r(d)?[+p,+d]:[i,i],u){var m=c[h];f.z=r(m)?m:i}}return a(e,t,{vals:u?c:[0,1],containerStr:"",cLetter:"z"}),s&&(l[0].t={labels:{lat:o(e,"lat:")+" ",lon:o(e,"lon:")+" "}}),l}}}),nb=m({"src/traces/densitymapbox/convert.js"(e,t){var r=M(),n=ct(),i=W(),a=Yt(),o=S().BADNUM,s=dg().makeBlank;t.exports=function(e){var t=e[0].trace,l=!0===t.visible&&0!==t._length,c=t._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:s()};if(!l)return c;var u,h=[],f=t.z,p=t.radius,d=n.isArrayOrTypedArray(f)&&f.length,m=n.isArrayOrTypedArray(p);for(u=0;u<e.length;u++){var g=e[u],y=g.lonlat;if(y[0]!==o){var v={};if(d){var x=g.z;v.z=x!==o?x:0}m&&(v.r=r(p[u])&&p[u]>0?+p[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var _=a.extractOpts(t),b=_.reversescale?a.flipScale(_.colorscale):_.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u<b.length;u++)T.push(b[u][0],b[u][1]);var k=["interpolate",["linear"],["get","z"],_.min,0,_.max,1];return n.extendFlat(c.heatmap.paint,{"heatmap-weight":d?k:1/(_.max-_.min),"heatmap-color":T,"heatmap-radius":m?{type:"identity",property:"r"}:t.radius,"heatmap-opacity":t.opacity}),c.geojson={type:"FeatureCollection",features:h},c.heatmap.layout.visibility="visible",c}}}),ib=m({"src/traces/densitymapbox/plot.js"(e,t){var r=nb(),n=C_().traceLayerPrefix;function i(e,t){this.type="densitymapbox",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["heatmap",n+t+"-heatmap"]],this.below=null}var a=i.prototype;a.update=function(e){var t=this.subplot,n=this.layerList,i=r(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<n.length;o++){var s=n[o],l=s[0],c=s[1],u=i[l];t.setOptions(c,"setLayoutProperty",u.layout),"visible"===u.layout.visibility&&t.setOptions(c,"setPaintProperty",u.paint)}},a._addLayers=function(e,t){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=e[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},t)}},a._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])},a.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var n=t[0].trace,a=new i(e,n.uid),o=a.sourceId,s=r(t),l=a.below=e.belowLookup["trace-"+n.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),ab=m({"src/traces/densitymapbox/hover.js"(e,t){var r=ar(),n=B_().hoverPoints,i=B_().getExtraText;t.exports=function(e,t,a){var o=n(e,t,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),ob=m({"src/traces/densitymapbox/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e.z=t.z,e}}}),sb=m({"src/traces/densitymapbox/index.js"(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:eb(),supplyDefaults:tb(),colorbar:Vo(),formatLabels:D_(),calc:rb(),plot:ib(),hoverPoints:ab(),eventData:ob(),getBelow:function(e,t){for(var r=t.getMapLayers(),n=0;n<r.length;n++){var i=r[n],a=i.id;if("symbol"===i.type&&"string"==typeof a&&-1===a.indexOf("plotly-"))return a}},moduleType:"trace",name:"densitymapbox",basePlotModule:G_(),categories:["mapbox","gl","showLegend"],meta:{hr_name:"density_mapbox"}}}}),lb=m({"lib/densitymapbox.js"(e,t){t.exports=sb()}}),cb=m({"src/plots/map/styles/arcgis-sat-hybrid.js"(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 © <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}\n{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}\n{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}\n{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}\n{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}\n{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}\n{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}\n{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}\n{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}\n{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}\n{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}\n{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"}}}),ub=m({"src/plots/map/styles/arcgis-sat.js"(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 © <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"}}]}}}),hb=m({"src/plots/map/constants.js"(e,t){var r=Ye(),n=cb(),i="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",s={basic:o,streets:o,outdoors:o,light:i,dark:a,satellite:ub(),"satellite-streets":n,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:'© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',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":i,"carto-darkmatter":a,"carto-voyager":o,"carto-positron-nolabels":"https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json","carto-darkmatter-nolabels":"https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json","carto-voyager-nolabels":"https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json"},l=r(s);t.exports={styleValueDflt:"basic",stylesMap:s,styleValuesMap:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",l.join(", "),"or use a tile service."].join("\n"),mapOnErrorMsg:"Map error."}}}),fb=m({"src/plots/map/layout_attributes.js"(e,t){var r=ct(),n=W().defaultLine,i=Ma().attributes,a=j(),o=kn().textposition,s=De().overrideAll,l=vt().templatedArray,c=hb(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(t.exports=s({_arrayAttrRegexps:[r.counterRegex("map",".layers",!0)],domain:i({name:"map"}),style:{valType:"any",values:c.styleValuesMap,dflt:c.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:l("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:n},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:n}},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:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),pb=m({"src/traces/scattermap/attributes.js"(e,t){var{hovertemplateAttrs:r,texttemplateAttrs:n,templatefallbackAttrs:i}=Fe(),a=Tn(),o=sg(),s=kn(),l=fb(),c=q(),u=zt(),h=B().extendFlat,f=De().overrideAll,p=fb(),d=o.line,m=o.marker;t.exports=f({lon:o.lon,lat:o.lat,cluster:{enabled:{valType:"boolean"},maxzoom:h({},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:h({},m.opacity,{dflt:1})},mode:h({},s.mode,{dflt:"markers"}),text:h({},s.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:i({editType:"plot"}),hovertext:h({},s.hovertext,{}),line:{color:d.color,width:d.width},connectgaps:s.connectgaps,marker:h({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:m.opacity,size:m.size,sizeref:m.sizeref,sizemin:m.sizemin,sizemode:m.sizemode},u("marker")),fill:o.fill,fillcolor:a(),textfont:l.layers.symbol.textfont,textposition:l.layers.symbol.textposition,below:{valType:"string"},selected:{marker:s.selected.marker},unselected:{marker:s.unselected.marker},hoverinfo:h({},c.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r(),hovertemplatefallback:i()},"calc","nested")}}),db=m({"src/traces/scattermap/constants.js"(e,t){var r=["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"];t.exports={isSupportedFont:function(e){return-1!==r.indexOf(e)}}}}),mb=m({"src/traces/scattermap/defaults.js"(e,t){var r=ct(),n=Xt(),i=Yn(),a=Xn(),o=Kn(),s=Jn(),l=pb(),c=db().isSupportedFont;t.exports=function(e,t,u,h){function f(n,i){return r.coerce(e,t,l,n,i)}function p(n,i){return r.coerce2(e,t,l,n,i)}var d=function(e,t,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return t._length=a,a}(0,t,f);if(d){if(f("text"),f("texttemplate"),f("texttemplatefallback"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("mode"),f("below"),n.hasMarkers(t)){i(e,t,u,h,f,{noLine:!0,noAngle:!0}),f("marker.allowoverlap"),f("marker.angle");var m=t.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(t)&&(a(e,t,u,h,f,{noDash:!0}),f("connectgaps"));var g=p("cluster.maxzoom"),y=p("cluster.step"),v=p("cluster.color",t.marker&&t.marker.color||u),x=p("cluster.size"),_=p("cluster.opacity");if(f("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==_)||n.hasText(t)){var b=h.font.family;o(e,t,h,f,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(b)?b:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}f("fill"),"none"!==t.fill&&s(e,t,u,f),r.coerceSelectionMarkerOpacity(t,f)}else t.visible=!1}}}),gb=m({"src/traces/scattermap/format_labels.js"(e,t){var r=ar();t.exports=function(e,t,n){var i={},a=n[t.subplot]._subplot.mockAxis,o=e.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),yb=m({"src/plots/map/convert_text_opts.js"(e,t){var r=ct();t.exports=function(e,t){var n=e.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(t)?r.mean(t):t,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),vb=m({"src/traces/scattermap/convert.js"(e,t){var r=M(),n=ct(),i=S().BADNUM,a=dg(),o=Yt(),s=er(),l=$t(),c=Xt(),u=db().isSupportedFont,h=yb(),f=Kt().appendArrayPointValue,p=Et().NEWLINES,d=Et().BR_TAG_ALL;function m(e){return{type:e,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(e,t){return n.isArrayOrTypedArray(e)?t?function(t){return r(e[t])?+e[t]:0}:function(t){return e[t]}:e?function(){return e}:y}function y(){return""}function v(e){return e[0]===i}function x(e,t){var r;if(n.isArrayOrTypedArray(e)&&n.isArrayOrTypedArray(t)){r=["step",["get","point_count"],e[0]];for(var i=1;i<e.length;i++)r.push(t[i-1],e[i])}else r=e;return r}function _(e){var t=e.textfont,r=t.family,n=t.style,i=t.weight,a=r.split(" "),o="Italic"===a[a.length-1];o&&a.pop(),o=o||"italic"===n;var s=a.join(" ");return"bold"===i&&-1===a.indexOf("Bold")?s+=" Bold":i<=1e3&&("Metropolis"===a[0]?(s="Metropolis",s+=i>850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}t.exports=function(e,t){var i,u=t[0].trace,b=!0===u.visible&&0!==u._length,w="none"!==u.fill,T=c.hasLines(u),k=c.hasMarkers(u),A=c.hasText(u),M=k&&"circle"===u.marker.symbol,S=k&&"circle"!==u.marker.symbol,E=u.cluster&&u.cluster.enabled,C=m("fill"),I=m("line"),L=m("circle"),P=m("symbol"),z={fill:C,line:I,circle:L,symbol:P};if(!b)return z;if((w||T)&&(i=a.calcTraceToLineCoords(t)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":u.fillcolor})),T&&(I.geojson=a.makeLine(i),I.layout.visibility="visible",n.extendFlat(I.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),M){var D=function(e){var t,i,a,c,u=e[0].trace,h=u.marker,f=u.selectedpoints,p=n.isArrayOrTypedArray(h.color),d=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(e){return u.opacity*e}p&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),d&&(a=l(u)),m&&(c=function(e){return g(r(e)?+n.constrain(e,0,1):0)});var y,x=[];for(t=0;t<e.length;t++){var _=e[t],b=_.lonlat;if(!v(b)){var w={};i&&(w.mcc=_.mcc=i(_.mc)),a&&(w.mrc=_.mrc=a(_.ms)),c&&(w.mo=c(_.mo)),f&&(w.selected=_.selected||0),x.push({type:"Feature",id:t+1,geometry:{type:"Point",coordinates:b},properties:w})}}if(f)for(y=s.makeSelectedPointStyleFns(u),t=0;t<x.length;t++){var T=x[t].properties;y.selectedOpacityFn&&(T.mo=g(y.selectedOpacityFn(T))),y.selectedColorFn&&(T.mcc=y.selectedColorFn(T)),y.selectedSizeFn&&(T.mrc=y.selectedSizeFn(T))}return{geojson:{type:"FeatureCollection",features:x},mcc:p||y&&y.selectedColorFn?{type:"identity",property:"mcc"}:h.color,mrc:d||y&&y.selectedSizeFn?{type:"identity",property:"mrc"}:function(e){return e/2}(h.size),mo:m||y&&y.selectedOpacityFn?{type:"identity",property:"mo"}:g(h.opacity)}}(t);L.geojson=D.geojson,L.layout.visibility="visible",E&&(L.filter=["!",["has","point_count"]],z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(u.cluster.color,u.cluster.step),"circle-radius":x(u.cluster.size,u.cluster.step),"circle-opacity":x(u.cluster.opacity,u.cluster.step)}},z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":_(u),"text-size":12}}),n.extendFlat(L.paint,{"circle-color":D.mcc,"circle-radius":D.mrc,"circle-opacity":D.mo})}if(M&&E&&(L.filter=["!",["has","point_count"]]),(S||A)&&(P.geojson=function(e,t){for(var r=t._fullLayout,i=e[0].trace,a=i.marker||{},o=a.symbol,s=a.angle,l="circle"!==o?g(o):y,u="auto"!==s?g(s,!0):y,h=c.hasText(i)?g(i.text):y,m=[],x=0;x<e.length;x++){var _=e[x];if(!v(_.lonlat)){var b,w=i.texttemplate;if(w){var T=Array.isArray(w)?w[x]||"":w,k=i._module.formatLabels(_,i,r),A={};f(A,i,_.i),b=n.texttemplateString({data:[A,_,i._meta],fallback:i.texttemplatefallback,labels:k,locale:r._d3locale,template:T})}else b=h(x);b&&(b=b.replace(p,"").replace(d,"\n")),m.push({type:"Feature",geometry:{type:"Point",coordinates:_.lonlat},properties:{symbol:l(x),angle:u(x),text:b}})}}return{type:"FeatureCollection",features:m}}(t,e),n.extendFlat(P.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),S&&(n.extendFlat(P.layout,{"icon-size":u.marker.size/10}),"angle"in u.marker&&"auto"!==u.marker.angle&&n.extendFlat(P.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),P.layout["icon-allow-overlap"]=u.marker.allowoverlap,n.extendFlat(P.paint,{"icon-opacity":u.opacity*u.marker.opacity,"icon-color":u.marker.color})),A)){var O=(u.marker||{}).size,R=h(u.textposition,O);n.extendFlat(P.layout,{"text-size":u.textfont.size,"text-anchor":R.anchor,"text-offset":R.offset,"text-font":_(u)}),n.extendFlat(P.paint,{"text-color":u.textfont.color,"text-opacity":u.opacity})}return z}}}),xb=m({"src/traces/scattermap/plot.js"(e,t){var r=ct(),n=vb(),i=hb().traceLayerPrefix,a={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function o(e,t,r,n){this.type="scattermap",this.subplot=e,this.uid=t,this.clusterEnabled=r,this.isHidden=n,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,n){var i={type:"geojson",data:t.geojson};n&&n.enabled&&r.extendFlat(i,{cluster:!0,clusterMaxZoom:n.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,r){var n={type:t.type,id:this.layerIds[e],source:this.sourceIds[e],layout:t.layout,paint:t.paint};t.filter&&(n.filter=t.filter);for(var i,a=this.layerIds[e],o=this.subplot.getMapLayers(),s=0;s<o.length;s++)if(o[s].id===a){i=!0;break}i?(this.subplot.setOptions(a,"setLayoutProperty",n.layout),"visible"===n.layout.visibility&&this.subplot.setOptions(a,"setPaintProperty",n.paint)):this.subplot.addLayer(n,r)},s.update=function(e){var t=e[0].trace,r=this.subplot,i=r.map,o=n(r.gd,e),s=r.belowLookup["trace-"+this.uid],l=!(!t.cluster||!t.cluster.enabled),c=!!this.clusterEnabled,u=this;function h(e){c?function(e){for(var t=a.cluster,r=t.length-1;r>=0;r--){var n=t[r];i.removeLayer(u.layerIds[n])}e||i.removeSource(u.sourceIds.circle)}(e):function(e){for(var t=a.nonCluster,r=t.length-1;r>=0;r--){var n=t[r];i.removeLayer(u.layerIds[n]),e||i.removeSource(u.sourceIds[n])}}(e)}function f(e){l?function(e){e||u.addSource("circle",o.circle,t.cluster);for(var r=a.cluster,n=0;n<r.length;n++){var i=r[n],l=o[i];u.addLayer(i,l,s)}}(e):function(e){for(var t=a.nonCluster,r=0;r<t.length;r++){var n=t[r],i=o[n];e||u.addSource(n,i),u.addLayer(n,i,s)}}(e)}var p=this.isHidden,d=!0!==t.visible;d?p||h():p?d||f():c!==l?(h(),f()):(this.below!==s&&(h(!0),f(!0)),function(){for(var e=l?a.cluster:a.nonCluster,t=0;t<e.length;t++){var n=e[t],i=o[n];i&&(r.setOptions(u.layerIds[n],"setLayoutProperty",i.layout),"visible"===i.layout.visibility&&("cluster"!==n&&u.setSourceData(n,i),r.setOptions(u.layerIds[n],"setPaintProperty",i.paint)))}}()),this.clusterEnabled=l,this.isHidden=d,this.below=s,e[0].trace._glTrace=this},s.dispose=function(){for(var e=this.subplot.map,t=this.clusterEnabled?a.cluster:a.nonCluster,r=t.length-1;r>=0;r--){var n=t[r];e.removeLayer(this.layerIds[n]),e.removeSource(this.sourceIds[n])}},t.exports=function(e,t){var r,i,s,l=t[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(e,l.uid,c,u),f=n(e.gd,t),p=h.below=e.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",f.circle,l.cluster),r=0;r<a.cluster.length;r++)s=f[i=a.cluster[r]],h.addLayer(i,s,p);else for(r=0;r<a.nonCluster.length;r++)s=f[i=a.nonCluster[r]],h.addSource(i,s,l.cluster),h.addLayer(i,s,p);return t[0].trace._glTrace=h,h}}}),_b=m({"src/traces/scattermap/hover.js"(e,t){var r=Or(),n=ct(),i=vi(),a=n.fillText,o=S().BADNUM,s=hb().traceLayerPrefix;function l(e,t,r){if(!e.hovertemplate){var n=(t.hi||e.hoverinfo).split("+"),i=-1!==n.indexOf("all"),o=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=t.lonlat,c=[];return i||o&&s?c.push("("+u(l[1])+", "+u(l[0])+")"):o?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1])),(i||-1!==n.indexOf("text"))&&a(t,e,c),c.join("<br>")}function u(e){return e+"°"}}t.exports={hoverPoints:function(e,t,a){var c=e.cd,u=c[0].trace,h=e.xa,f=e.ya,p=e.subplot,d=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=p.map.queryRenderedFeatures(null,{layers:[m]});d=y.map((function(e){return e.id}))}var v=360*(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360)),x=t-v;if(r.getClosest(c,(function(e){var t=e.lonlat;if(t[0]===o||g&&-1===d.indexOf(e.i+1))return 1/0;var r=n.modHalf(t[0],360),i=t[1],s=p.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-f.c2p([r,a]),u=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),e),!1!==e.index){var _=c[e.index],b=_.lonlat,w=[n.modHalf(b[0],360)+v,b[1]],T=h.c2p(w),k=f.c2p(w),A=_.mrc||1;e.x0=T-A,e.x1=T+A,e.y0=k-A,e.y1=k+A;var M={};M[u.subplot]={_subplot:p};var S=u._module.formatLabels(_,u,M);return e.lonLabel=S.lonLabel,e.latLabel=S.latLabel,e.color=i(u,_),e.extraText=l(u,_,c[0].t.labels),e.hovertemplate=u.hovertemplate,[e]}},getExtraText:l}}}),bb=m({"src/traces/scattermap/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e}}}),wb=m({"src/traces/scattermap/select.js"(e,t){var r=ct(),n=Xt(),i=S().BADNUM;t.exports=function(e,t){var a,o=e.cd,s=e.xaxis,l=e.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===t)for(a=0;a<o.length;a++)o[a].selected=0;else for(a=0;a<o.length;a++){var h=o[a],f=h.lonlat;if(f[0]!==i){var p=[r.modHalf(f[0],360),f[1]],d=[s.c2p(p),l.c2p(p)];t.contains(d,null,a,e)?(c.push({pointNumber:a,lon:f[0],lat:f[1]}),h.selected=1):h.selected=0}}return c}}}),Tb=m({"node_modules/maplibre-gl/dist/maplibre-gl.js"(e,t){var r,n;r=e,n=function(){var e={},t={};function r(r,n,i){if(t[r]=i,"index"===r){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 r("shared",0,(function(e){function t(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))}function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"function"==typeof SuppressedError&&SuppressedError;var n=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,r=e.y-this.y;return t*t+r*r},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),r=Math.sin(e),n=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=n,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-n*(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=r(n),o=s;function s(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}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(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=i/a}var o=0,s=1;for(r=e,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-e)<t));n++)e>i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var l=r(o);let c,u;function h(){return null==c&&(c=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),c}function d(){if(null==u&&(u=!1,h())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let t=0;t<25;t++){let r=4*t;e.fillStyle=`rgb(${r},${r+1},${r+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 m(e,t,r,n){let i=new l(e,t,r,n);return e=>i.solve(e)}let g=m(.25,.1,.25,1);function y(e,t,r){return Math.min(r,Math.max(t,e))}function v(e,t,r){let n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function x(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}let _=1;function b(e,t,r){let n={};for(let r in e)n[r]=t.call(this,e[r],r,e);return n}function w(e,t,r){let n={};for(let r in e)t.call(this,e[r],r,e)&&(n[r]=e[r]);return n}function T(e){return Array.isArray(e)?e.map(T):"object"==typeof e&&e?b(e,T):e}let k={};function A(e){k[e]||(typeof console<"u"&&console.warn(e),k[e]=!0)}function M(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function S(e){return typeof WorkerGlobalScope<"u"&&void 0!==e&&e instanceof WorkerGlobalScope}let E=null;function C(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}let I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function L(e,r,n,i,a){return t(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new 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 new Error(`Unrecognized format ${o}`);let s=o.startsWith("BGR"),l=new Uint8ClampedArray(i*a*4);if(yield t.copyTo(l,function(e,t,r,n,i){let a=4*Math.max(-t,0),o=(Math.max(0,r)-r)*n*4+a,s=4*n,l=Math.max(0,t),c=Math.max(0,r);return{rect:{x:l,y:c,width:Math.min(e.width,t+n)-l,height:Math.min(e.height,r+i)-c},layout:[{offset:o,stride:s}]}}(e,r,n,i,a)),s)for(let e=0;e<l.length;e+=4){let t=l[e];l[e]=l[e+2],l[e+2]=t}return l}finally{t.close()}}))}let P,z,D="AbortError";function O(){return new Error(D)}let R={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function F(e){return R.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]}let B="global-dispatcher";class j extends Error{constructor(e,t,r,n){super(`AJAXError: ${t} (${e}): ${r}`),this.status=e,this.statusText=t,this.url=r,this.body=n}}let N=()=>S(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,U=function(e,r){if(/:\/\//.test(e.url)&&!/^https?:|^file:/.test(e.url)){let t=F(e.url);if(t)return t(e,r);if(S(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:B},r)}if(!(/^file:/.test(n=e.url)||/^file:/.test(N())&&!/^\w+:/.test(n))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(e,r){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:N(),signal:r.signal});"json"!==e.type||t.headers.has("Accept")||t.headers.set("Accept","application/json");let n,i=yield fetch(t);if(!i.ok){let t=yield i.blob();throw new j(i.status,i.statusText,e.url,t)}n="arrayBuffer"===e.type||"image"===e.type?i.arrayBuffer():"json"===e.type?i.json():i.text();let a=yield n;if(r.signal.aborted)throw O();return{data:a,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires")}}))}(e,r);if(S(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:B},r)}var n,i,a;return i=e,a=r,new Promise(((e,t)=>{var r;let n=new XMLHttpRequest;n.open(i.method||"GET",i.url,!0),"arrayBuffer"!==i.type&&"image"!==i.type||(n.responseType="arraybuffer");for(let e in i.headers)n.setRequestHeader(e,i.headers[e]);"json"===i.type&&(n.responseType="text",!(null===(r=i.headers)||void 0===r)&&r.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===i.credentials,n.onerror=()=>{t(new Error(n.statusText))},n.onload=()=>{if(!a.signal.aborted)if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let r=n.response;if("json"===i.type)try{r=JSON.parse(n.response)}catch(e){return void t(e)}e({data:r,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires")})}else{let e=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});t(new j(n.status,n.statusText,i.url,e))}},a.signal.addEventListener("abort",(()=>{n.abort(),t(O())})),n.send(i.body)}))};function V(e){if(!e||e.indexOf("://")<=0||0===e.indexOf("data:image/")||0===e.indexOf("blob:"))return!0;let t=new URL(e),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function q(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function H(e,t,r){if(r&&r[e]){let n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}class G{constructor(e,t={}){x(this,t),this.type=e}}class W extends G{constructor(e,t={}){super("error",x({error:e},t))}}class Z{on(e,t){return this._listeners=this._listeners||{},q(e,t,this._listeners),this}off(e,t){return H(e,t,this._listeners),H(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},q(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new G(e,t||{}));let r=e.type;if(this.listens(r)){e.target=this;let t=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(let r of t)r.call(this,e);let n=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(let t of n)H(r,t,this._oneTimeListeners),t.call(this,e);let i=this._eventedParent;i&&(x(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(e))}else e instanceof W&&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 Y={$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 X=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function $(e,t){let r={};for(let t in e)"ref"!==t&&(r[t]=e[t]);return X.forEach((e=>{e in t&&(r[e]=t[e])})),r}function K(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!K(e[r],t[r]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==t){if("object"!=typeof t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(!K(e[r],t[r]))return!1;return!0}return e===t}function J(e,t){e.push(t)}function Q(e,t,r){J(r,{command:"addSource",args:[e,t[e]]})}function ee(e,t,r){J(t,{command:"removeSource",args:[e]}),r[e]=!0}function te(e,t,r,n){ee(e,r,n),Q(e,t,r)}function re(e,t,r){let n;for(n in e[r])if(Object.prototype.hasOwnProperty.call(e[r],n)&&"data"!==n&&!K(e[r][n],t[r][n]))return!1;for(n in t[r])if(Object.prototype.hasOwnProperty.call(t[r],n)&&"data"!==n&&!K(e[r][n],t[r][n]))return!1;return!0}function ne(e,t,r,n,i,a){e=e||{},t=t||{};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(K(e[o],t[o])||r.push({command:a,args:[n,o,t[o],i]}));for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&!Object.prototype.hasOwnProperty.call(e,o)&&(K(e[o],t[o])||r.push({command:a,args:[n,o,t[o],i]}))}function ie(e){return e.id}function ae(e,t){return e[t.id]=t,e}class oe{constructor(e,t,r,n){this.message=(e?`${e}: `:"")+r,n&&(this.identifier=n),null!=t&&t.__line__&&(this.line=t.__line__)}}function se(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}class le extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class ce{constructor(e,t=[]){this.parent=e,this.bindings={};for(let[e,r]of t)this.bindings[e]=r}concat(e){return new ce(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}let ue={kind:"null"},he={kind:"number"},fe={kind:"string"},pe={kind:"boolean"},de={kind:"color"},me={kind:"object"},ge={kind:"value"},ye={kind:"collator"},ve={kind:"formatted"},xe={kind:"padding"},_e={kind:"resolvedImage"},be={kind:"variableAnchorOffsetCollection"};function we(e,t){return{kind:"array",itemType:e,N:t}}function Te(e){if("array"===e.kind){let t=Te(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}let ke=[ue,he,fe,pe,de,ve,me,we(ge),xe,_e,be];function Ae(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Ae(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(let e of ke)if(!Ae(e,t))return null}return`Expected ${Te(e)} but found ${Te(t)} instead.`}function Me(e,t){return t.some((t=>t.kind===e.kind))}function Se(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}function Ee(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}let Ce=.96422,Ie=.82521,Le=4/29,Pe=6/29,ze=3*Pe*Pe,De=Pe*Pe*Pe,Oe=Math.PI/180,Re=180/Math.PI;function Fe(e){return(e%=360)<0&&(e+=360),e}function Be([e,t,r,n]){let i,a,o=Ne((.2225045*(e=je(e))+.7168786*(t=je(t))+.0606169*(r=je(r)))/1);e===t&&t===r?i=a=o:(i=Ne((.4360747*e+.3850649*t+.1430804*r)/Ce),a=Ne((.0139322*e+.0971045*t+.7141733*r)/Ie));let s=116*o-16;return[s<0?0:s,500*(i-o),200*(o-a),n]}function je(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ne(e){return e>De?Math.pow(e,1/3):e/ze+Le}function Ue([e,t,r,n]){let i=(e+16)/116,a=isNaN(t)?i:i+t/500,o=isNaN(r)?i:i-r/200;return i=1*qe(i),a=Ce*qe(a),o=Ie*qe(o),[Ve(3.1338561*a-1.6168667*i-.4906146*o),Ve(-.9787684*a+1.9161415*i+.033454*o),Ve(.0719453*a-.2289914*i+1.4052427*o),n]}function Ve(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function qe(e){return e>Pe?e*e*e:ze*(e-Le)}function He(e){return parseInt(e.padEnd(2,e),16)/255}function Ge(e,t){return We(t?e/100:e,0,1)}function We(e,t,r){return Math.min(Math.max(t,e),r)}function Ze(e){return!e.some(Number.isNaN)}let Ye={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 Xe{constructor(e,t,r,n=1,i=!0){this.r=e,this.g=t,this.b=r,this.a=n,i||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof Xe)return e;if("string"!=typeof e)return;let t=function(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];let t=Ye[e];if(t){let[e,r,n]=t;return[e/255,r/255,n/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,r=1;return[He(e.slice(r,r+=t)),He(e.slice(r,r+=t)),He(e.slice(r,r+=t)),He(e.slice(r,r+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,r,n,i,a,o,s,l,c,u,h,f]=t,p=[i||" ",s||" ",u].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){let e=[n,o,c].join(""),t="%%%"===e?100:""===e?255:0;if(t){let e=[We(+r/t,0,1),We(+a/t,0,1),We(+l/t,0,1),h?Ge(+h,f):1];if(Ze(e))return e}}return}}let r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[e,t,n,i,a,o,s,l,c]=r,u=[n||" ",a||" ",s].join("");if(" "===u||" /"===u||",,"===u||",,,"===u){let e=[+t,We(+i,0,100),We(+o,0,100),l?Ge(+l,c):1];if(Ze(e))return function([e,t,r,n]){function i(n){let i=(n+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return e=Fe(e),t/=100,r/=100,[i(0),i(8),i(4),n]}(e)}}}(e);return t?new Xe(...t,!1):void 0}get rgb(){let{r:e,g:t,b:r,a:n}=this,i=n||1/0;return this.overwriteGetter("rgb",[e/i,t/i,r/i,n])}get hcl(){return this.overwriteGetter("hcl",function(e){let[t,r,n,i]=Be(e),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?Fe(Math.atan2(n,r)*Re):NaN,a,t,i]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Be(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map((e=>Math.round(255*e))).join(",")},${n})`}}Xe.black=new Xe(0,0,0,1),Xe.white=new Xe(1,1,1,1),Xe.transparent=new Xe(0,0,0,0),Xe.red=new Xe(1,0,0,1);class $e{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,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 Ke{constructor(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i}}class Je{constructor(e){this.sections=e}static fromString(e){return new Je([new Ke(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof Je?e:Je.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}}class Qe{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Qe)return e;if("number"==typeof e)return new Qe([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let t of e)if("number"!=typeof t)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 Qe(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 r=e[t],n=e[t+1];if("string"!=typeof r||!et.has(r)||!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new tt(e)}}toString(){return JSON.stringify(this.values)}}class rt{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new rt({name:e,available:!1}):null}}function nt(e,t,r,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function it(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof Xe||e instanceof $e||e instanceof Je||e instanceof Qe||e instanceof tt||e instanceof rt)return!0;if(Array.isArray(e)){for(let t of e)if(!it(t))return!1;return!0}if("object"==typeof e){for(let t in e)if(!it(e[t]))return!1;return!0}return!1}function at(e){if(null===e)return ue;if("string"==typeof e)return fe;if("boolean"==typeof e)return pe;if("number"==typeof e)return he;if(e instanceof Xe)return de;if(e instanceof $e)return ye;if(e instanceof Je)return ve;if(e instanceof Qe)return xe;if(e instanceof tt)return be;if(e instanceof rt)return _e;if(Array.isArray(e)){let t,r=e.length;for(let r of e){let e=at(r);if(t){if(t===e)continue;t=ge;break}t=e}return we(t||ge,r)}return me}function ot(e){let t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Xe||e instanceof Je||e instanceof Qe||e instanceof tt||e instanceof rt?e.toString():JSON.stringify(e)}class st{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)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 r=e[1],n=at(r),i=t.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new st(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class lt{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}let ct={string:fe,number:he,boolean:pe,object:me};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 r,n=1,i=e[0];if("array"===i){let i,a;if(e.length>2){let r=e[1];if("string"!=typeof r||!(r in ct)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=ct[r],n++}else i=ge;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||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],n++}r=we(i,a)}else{if(!ct[i])throw new Error(`Types doesn't contain name = ${i}`);r=ct[i]}let a=[];for(;n<e.length;n++){let r=t.parse(e[n],n,ge);if(!r)return null;a.push(r)}return new ut(r,a)}evaluate(e){for(let t=0;t<this.args.length;t++){let r=this.args[t].evaluate(e);if(!Ae(this.type,at(r)))return r;if(t===this.args.length-1)throw new lt(`Expected value to be of type ${Te(this.type)}, but found ${Te(at(r))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}let ht={"to-boolean":pe,"to-color":de,"to-number":he,"to-string":fe};class ft{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 r=e[0];if(!ht[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");let n=ht[r],i=[];for(let r=1;r<e.length;r++){let n=t.parse(e[r],r,ge);if(!n)return null;i.push(n)}return new ft(n,i)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,r;for(let n of this.args){if(t=n.evaluate(e),r=null,t instanceof Xe)return t;if("string"==typeof t){let r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:nt(t[0],t[1],t[2],t[3]),!r))return new Xe(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new lt(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(let r of this.args){t=r.evaluate(e);let n=Qe.parse(t);if(n)return n}throw new lt(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(let r of this.args){t=r.evaluate(e);let n=tt.parse(t);if(n)return n}throw new lt(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(let r of this.args){if(t=r.evaluate(e),null===t)return 0;let n=Number(t);if(!isNaN(n))return n}throw new lt(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Je.fromString(ot(this.args[0].evaluate(e)));case"resolvedImage":return rt.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 pt=["Unknown","Point","LineString","Polygon"];class dt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?pt[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||(t=this._parseColorCache[e]=Xe.parse(e)),t}}class mt{constructor(e,t,r=[],n,i=new ce,a=[]){this.registry=e,this.path=r,this.key=r.map((e=>`[${e}]`)).join(""),this.scope=i,this.errors=a,this.expectedType=n,this._isConstant=t}parse(e,t,r,n,i={}){return t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)}_parse(e,t){function r(e,t,r){return"assert"===r?new ut(t,[e]):"coerce"===r?new ft(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let i=this.registry[n];if(i){let n=i.parse(e,this);if(!n)return null;if(this.expectedType){let e=this.expectedType,i=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==i.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==i.kind&&"string"!==i.kind)if("padding"!==e.kind||"value"!==i.kind&&"number"!==i.kind&&"array"!==i.kind)if("variableAnchorOffsetCollection"!==e.kind||"value"!==i.kind&&"array"!==i.kind){if(this.checkSubtype(e,i))return null}else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof st)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){let e=new dt;try{n=new st(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){let n="number"==typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new mt(this.registry,this._isConstant,n,t||null,i,this.errors)}error(e,...t){let r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new le(r,e))}checkSubtype(e,t){let r=Ae(e,t);return r&&this.error(r),r}}class gt{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 r=[];for(let n=1;n<e.length-1;n+=2){let i=e[n];if("string"!=typeof i)return t.error(`Expected string, but found ${typeof i} instead.`,n);if(/[^a-zA-Z0-9_]/.test(i))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);let a=t.parse(e[n+1],n+1);if(!a)return null;r.push([i,a])}let n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new gt(r,n):null}outputDefined(){return this.result.outputDefined()}}class yt{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");let r=e[1];return t.scope.has(r)?new yt(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class vt{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let r=t.parse(e[1],1,he),n=t.parse(e[2],2,we(t.expectedType||ge));return r&&n?new vt(n.type.itemType,r,n):null}evaluate(e){let t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new lt(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new lt(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new lt(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class xt{constructor(e,t){this.type=pe,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let r=t.parse(e[1],1,ge),n=t.parse(e[2],2,ge);return r&&n?Me(r.type,[pe,fe,he,ue,ge])?new xt(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Te(r.type)} instead`):null}evaluate(e){let t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Se(t,["boolean","string","number","null"]))throw new lt(`Expected first argument to be of type boolean, string, number or null, but found ${Te(at(t))} instead.`);if(!Se(r,["string","array"]))throw new lt(`Expected second argument to be of type array or string, but found ${Te(at(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class _t{constructor(e,t,r){this.type=he,this.needle=e,this.haystack=t,this.fromIndex=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 r=t.parse(e[1],1,ge),n=t.parse(e[2],2,ge);if(!r||!n)return null;if(!Me(r.type,[pe,fe,he,ue,ge]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Te(r.type)} instead`);if(4===e.length){let i=t.parse(e[3],3,he);return i?new _t(r,n,i):null}return new _t(r,n)}evaluate(e){let t,r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!Se(r,["boolean","string","number","null"]))throw new lt(`Expected first argument to be of type boolean, string, number or null, but found ${Te(at(r))} instead.`);if(this.fromIndex&&(t=this.fromIndex.evaluate(e)),Se(n,["string"])){let e=n.indexOf(r,t);return-1===e?-1:[...n.slice(0,e)].length}if(Se(n,["array"]))return n.indexOf(r,t);throw new lt(`Expected second argument to be of type array or string, but found ${Te(at(n))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class bt{constructor(e,t,r,n,i,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,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 r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);let i={},a=[];for(let o=2;o<e.length-1;o+=2){let s=e[o],l=e[o+1];Array.isArray(s)||(s=[s]);let c=t.concat(o);if(0===s.length)return c.error("Expected at least one branch label.");for(let e of s){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,at(e)))return null}else r=at(e);if(void 0!==i[String(e)])return c.error("Branch labels must be unique.");i[String(e)]=a.length}let u=t.parse(l,o,n);if(!u)return null;n=n||u.type,a.push(u)}let o=t.parse(e[1],1,ge);if(!o)return null;let s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==o.type.kind&&t.concat(1).checkSubtype(r,o.type)?null:new bt(r,n,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 wt{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}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 r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);let n=[];for(let i=1;i<e.length-1;i+=2){let a=t.parse(e[i],i,pe);if(!a)return null;let o=t.parse(e[i+1],i+1,r);if(!o)return null;n.push([a,o]),r=r||o.type}let i=t.parse(e[e.length-1],e.length-1,r);if(!i)return null;if(!r)throw new Error("Can't infer output type");return new wt(r,n,i)}evaluate(e){for(let[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}}class Tt{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=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 r=t.parse(e[1],1,ge),n=t.parse(e[2],2,he);if(!r||!n)return null;if(!Me(r.type,[we(ge),fe,ge]))return t.error(`Expected first argument to be of type array or string, but found ${Te(r.type)} instead`);if(4===e.length){let i=t.parse(e[3],3,he);return i?new Tt(r.type,r,n,i):null}return new Tt(r.type,r,n)}evaluate(e){let t,r=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(this.endIndex&&(t=this.endIndex.evaluate(e)),Se(r,["string"]))return[...r].slice(n,t).join("");if(Se(r,["array"]))return r.slice(n,t);throw new lt(`Expected first argument to be of type array or string, but found ${Te(at(r))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function kt(e,t){let r,n,i=e.length-1,a=0,o=i,s=0;for(;a<=o;)if(s=Math.floor((a+o)/2),r=e[s],n=e[s+1],r<=t){if(s===i||t<n)return s;a=s+1}else{if(!(r>t))throw new lt("Input is not a number.");o=s-1}return 0}class At{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(let[e,t]of r)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 r=t.parse(e[1],1,he);if(!r)return null;let n=[],i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(let r=1;r<e.length;r+=2){let a=1===r?-1/0:e[r],o=e[r+1],s=r,l=r+1;if("number"!=typeof a)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(n.length&&n[n.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 c=t.parse(o,l,i);if(!c)return null;i=i||c.type,n.push([a,c])}return new At(i,r,n)}evaluate(e){let t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);let n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);let i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[kt(t,n)].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}var Mt=St;function St(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}St.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(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=i/a}var o=0,s=1;for(r=e,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-e)<t));n++)e>i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var Et,Ct=(Et=Mt)&&Et.__esModule&&Object.prototype.hasOwnProperty.call(Et,"default")?Et.default:Et;function It(e,t,r){return e+r*(t-e)}function Lt(e,t,r){return e.map(((e,n)=>It(e,t[n],r)))}let Pt={number:It,color:function(e,t,r,n="rgb"){switch(n){case"rgb":{let[n,i,a,o]=Lt(e.rgb,t.rgb,r);return new Xe(n,i,a,o,!1)}case"hcl":{let n,i,[a,o,s,l]=e.hcl,[c,u,h,f]=t.hcl;if(isNaN(a)||isNaN(c))isNaN(a)?isNaN(c)?n=NaN:(n=c,1!==s&&0!==s||(i=u)):(n=a,1!==h&&0!==h||(i=o));else{let e=c-a;c>a&&e>180?e-=360:c<a&&a-c>180&&(e+=360),n=a+r*e}let[p,d,m,g]=function([e,t,r,n]){return e=isNaN(e)?0:e*Oe,Ue([r,Math.cos(e)*t,Math.sin(e)*t,n])}([n,i??It(o,u,r),It(s,h,r),It(l,f,r)]);return new Xe(p,d,m,g,!1)}case"lab":{let[n,i,a,o]=Ue(Lt(e.lab,t.lab,r));return new Xe(n,i,a,o,!1)}}},array:Lt,padding:function(e,t,r){return new Qe(Lt(e.values,t.values,r))},variableAnchorOffsetCollection:function(e,t,r){let n=e.values,i=t.values;if(n.length!==i.length)throw new lt(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);let a=[];for(let e=0;e<n.length;e+=2){if(n[e]!==i[e])throw new lt(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${n[e]}, to[${e}]: ${i[e]}`);a.push(n[e]);let[t,o]=n[e+1],[s,l]=i[e+1];a.push([It(t,s,r),It(o,l,r)])}return new tt(a)}};class zt{constructor(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(let[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let i=0;if("exponential"===e.name)i=Dt(t,e.base,r,n);else if("linear"===e.name)i=Dt(t,1,r,n);else if("cubic-bezier"===e.name){let a=e.controlPoints;i=new Ct(a[0],a[1],a[2],a[3]).solve(Dt(t,1,r,n))}return i}static parse(e,t){let[r,n,i,...a]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){let e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{let e=n.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={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,he),!i)return null;let o=[],s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=de:t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType);for(let e=0;e<a.length;e+=2){let r=a[e],n=a[e+1],i=e+3,l=e+4;if("number"!=typeof r)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]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);let c=t.parse(n,l,s);if(!c)return null;s=s||c.type,o.push([r,c])}return Ee(s,he)||Ee(s,de)||Ee(s,xe)||Ee(s,be)||Ee(s,we(he))?new zt(s,r,n,i,o):t.error(`Type ${Te(s)} is not interpolatable.`)}evaluate(e){let t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);let n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);let i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);let a=kt(t,n),o=zt.interpolationFactor(this.interpolation,n,t[a],t[a+1]),s=r[a].evaluate(e),l=r[a+1].evaluate(e);switch(this.operator){case"interpolate":return Pt[this.type.kind](s,l,o);case"interpolate-hcl":return Pt.color(s,l,o,"hcl");case"interpolate-lab":return Pt.color(s,l,o,"lab")}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Dt(e,t,r,n){let i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}class Ot{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 r=null,n=t.expectedType;n&&"value"!==n.kind&&(r=n);let i=[];for(let n of e.slice(1)){let e=t.parse(n,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,i.push(e)}if(!r)throw new Error("No output type");let a=n&&i.some((e=>Ae(n,e.type)));return new Ot(a?ge:r,i)}evaluate(e){let t,r=null,n=0;for(let i of this.args)if(n++,r=i.evaluate(e),r&&r instanceof rt&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function Rt(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Ft(e,t,r,n){return 0===n.compare(t,r)}function Bt(e,t,r){let n="=="!==e&&"!="!==e;return class i{constructor(e,t,r){this.type=pe,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");let r=e[0],a=t.parse(e[1],1,ge);if(!a)return null;if(!Rt(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${Te(a.type)}'.`);let o=t.parse(e[2],2,ge);if(!o)return null;if(!Rt(r,o.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${Te(o.type)}'.`);if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error(`Cannot compare types '${Te(a.type)}' and '${Te(o.type)}'.`);n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new ut(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new ut(a.type,[o])));let s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,ye),!s)return null}return new i(a,o,s)}evaluate(i){let a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){let t=at(a),r=at(o);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new lt(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){let e=at(a),r=at(o);if("string"!==e.kind||"string"!==r.kind)return t(i,a,o)}return this.collator?r(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 jt=Bt("==",(function(e,t,r){return t===r}),Ft),Nt=Bt("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!Ft(0,t,r,n)})),Ut=Bt("<",(function(e,t,r){return t<r}),(function(e,t,r,n){return n.compare(t,r)<0})),Vt=Bt(">",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),qt=Bt("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),Ht=Bt(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0}));class Gt{constructor(e,t,r){this.type=ye,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");let r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");let n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,pe);if(!n)return null;let i=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,pe);if(!i)return null;let a=null;return r.locale&&(a=t.parse(r.locale,1,fe),!a)?null:new Gt(n,i,a)}evaluate(e){return new $e(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 Wt{constructor(e,t,r,n,i){this.type=fe,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");let r=t.parse(e[1],1,he);if(!r)return null;let n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=t.parse(n.locale,1,fe),!i))return null;let a=null;if(n.currency&&(a=t.parse(n.currency,1,fe),!a))return null;let o=null;if(n["min-fraction-digits"]&&(o=t.parse(n["min-fraction-digits"],1,he),!o))return null;let s=null;return n["max-fraction-digits"]&&(s=t.parse(n["max-fraction-digits"],1,he),!s)?null:new Wt(r,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 Zt{constructor(e){this.type=ve,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");let n=[],i=!1;for(let r=1;r<=e.length-1;++r){let a=e[r];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;let e=null;if(a["font-scale"]&&(e=t.parse(a["font-scale"],1,he),!e))return null;let r=null;if(a["text-font"]&&(r=t.parse(a["text-font"],1,we(fe)),!r))return null;let o=null;if(a["text-color"]&&(o=t.parse(a["text-color"],1,de),!o))return null;let s=n[n.length-1];s.scale=e,s.font=r,s.textColor=o}else{let a=t.parse(e[r],1,ge);if(!a)return null;let o=a.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:a,scale:null,font:null,textColor:null})}}return new Zt(n)}evaluate(e){return new Je(this.sections.map((t=>{let r=t.content.evaluate(e);return at(r)===_e?new Ke("",r,null,null,null):new Ke(ot(r),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 Yt{constructor(e){this.type=_e,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");let r=t.parse(e[1],1,fe);return r?new Yt(r):t.error("No image name provided.")}evaluate(e){let t=this.input.evaluate(e),r=rt.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Xt{constructor(e){this.type=he,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);let r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${Te(r.type)} instead.`):new Xt(r):null}evaluate(e){let t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new lt(`Expected value to be of type string or array, but found ${Te(at(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}let $t=8192;function Kt(e,t){let r=(180+e[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=Math.pow(2,t.z);return[Math.round(r*i*$t),Math.round(n*i*$t)]}function Jt(e,t){let r=Math.pow(2,t.z);return[(i=(e[0]/$t+t.x)/r,360*i-180),(n=(e[1]/$t+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,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 er(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function tr(e,t,r){let n=e[0]-t[0],i=e[1]-t[1],a=e[0]-r[0],o=e[1]-r[1];return n*o-a*i==0&&n*a<=0&&i*o<=0}function rr(e,t,r,n){return(i=[n[0]-r[0],n[1]-r[1]])[0]*(a=[t[0]-e[0],t[1]-e[1]])[1]-i[1]*a[0]!=0&&!(!lr(e,t,r,n)||!lr(r,n,e,t));var i,a}function nr(e,t,r){for(let n of r)for(let r=0;r<n.length-1;++r)if(rr(e,t,n[r],n[r+1]))return!0;return!1}function ir(e,t,r=!1){let n=!1;for(let s of t)for(let t=0;t<s.length-1;t++){if(tr(e,s[t],s[t+1]))return r;(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]&&(n=!n)}var i,a,o;return n}function ar(e,t){for(let r of t)if(ir(e,r))return!0;return!1}function or(e,t){for(let r of e)if(!ir(r,t))return!1;for(let r=0;r<e.length-1;++r)if(nr(e[r],e[r+1],t))return!1;return!0}function sr(e,t){for(let r of t)if(or(e,r))return!0;return!1}function lr(e,t,r,n){let i=n[0]-r[0],a=n[1]-r[1],o=(e[0]-r[0])*a-i*(e[1]-r[1]),s=(t[0]-r[0])*a-i*(t[1]-r[1]);return o>0&&s<0||o<0&&s>0}function cr(e,t,r){let n=[];for(let i=0;i<e.length;i++){let a=[];for(let n=0;n<e[i].length;n++){let o=Kt(e[i][n],r);Qt(t,o),a.push(o)}n.push(a)}return n}function ur(e,t,r){let n=[];for(let i=0;i<e.length;i++){let a=cr(e[i],t,r);n.push(a)}return n}function hr(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){let t=.5*n,i=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===i&&(i=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=i}Qt(t,e)}function fr(e,t,r,n){let i=Math.pow(2,n.z)*$t,a=[n.x*$t,n.y*$t],o=[];for(let n of e)for(let e of n){let n=[e.x+a[0],e.y+a[1]];hr(n,t,r,i),o.push(n)}return o}function pr(e,t,r,n){let i=Math.pow(2,n.z)*$t,a=[n.x*$t,n.y*$t],o=[];for(let r of e){let e=[];for(let n of r){let r=[n.x+a[0],n.y+a[1]];Qt(t,r),e.push(r)}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 n of e)hr(n,t,r,i)}var s;return o}class dr{constructor(e,t){this.type=pe,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(it(e[1])){let t=e[1];if("FeatureCollection"===t.type){let e=[];for(let r of t.features){let{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length)return new dr(t,{type:"MultiPolygon",coordinates:e})}else if("Feature"===t.type){let e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new dr(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new dr(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){let a=cr(t.coordinates,n,i),o=fr(e.geometry(),r,n,i);if(!er(r,n))return!1;for(let e of o)if(!ir(e,a))return!1}if("MultiPolygon"===t.type){let a=ur(t.coordinates,n,i),o=fr(e.geometry(),r,n,i);if(!er(r,n))return!1;for(let e of o)if(!ar(e,a))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){let a=cr(t.coordinates,n,i),o=pr(e.geometry(),r,n,i);if(!er(r,n))return!1;for(let e of o)if(!or(e,a))return!1}if("MultiPolygon"===t.type){let a=ur(t.coordinates,n,i),o=pr(e.geometry(),r,n,i);if(!er(r,n))return!1;for(let e of o)if(!sr(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let mr=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(0===this.length)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:r}=this,n=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(r(n,a)>=0)break;t[e]=a,e=i}t[e]=n}_down(e){let{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e<n;){let n=1+(e<<1),a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],i)>=0)break;t[e]=t[n],e=n}t[e]=i}};function gr(e,t,r,n,i){yr(e,t,r,n||e.length-1,i||xr)}function yr(e,t,r,n,i){for(;n>r;){if(n-r>600){var a=n-r+1,o=t-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);yr(e,t,Math.max(r,Math.floor(t-o*l/a+c)),Math.min(n,Math.floor(t+(a-o)*l/a+c)),i)}var u=e[t],h=r,f=n;for(vr(e,r,t),i(e[n],u)>0&&vr(e,r,n);h<f;){for(vr(e,h,f),h++,f--;i(e[h],u)<0;)h++;for(;i(e[f],u)>0;)f--}0===i(e[r],u)?vr(e,r,f):vr(e,++f,n),f<=t&&(r=f+1),t<=f&&(n=f-1)}}function vr(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function xr(e,t){return e<t?-1:e>t?1:0}function _r(e,t){if(e.length<=1)return[e];let r,n,i=[];for(let t of e){let e=wr(t);0!==e&&(t.area=Math.abs(e),void 0===n&&(n=e<0),n===e<0?(r&&i.push(r),r=[t]):r.push(t))}if(r&&i.push(r),t>1)for(let e=0;e<i.length;e++)i[e].length<=t||(gr(i[e],t,1,i[e].length-1,br),i[e]=i[e].slice(0,t));return i}function br(e,t){return t.area-e.area}function wr(e){let t=0;for(let r,n,i=0,a=e.length,o=a-1;i<a;o=i++)r=e[i],n=e[o],t+=(n.x-r.x)*(r.y+n.y);return t}let Tr=1/298.257223563,kr=Tr*(2-Tr),Ar=Math.PI/180;class Mr{constructor(e){let t=6378.137*Ar*1e3,r=Math.cos(e*Ar),n=1/(1-kr*(1-r*r)),i=Math.sqrt(n);this.kx=t*i*r,this.ky=t*i*n*(1-kr)}distance(e,t){let r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r,n,i,a,o=1/0;for(let s=0;s<e.length-1;s++){let l=e[s][0],c=e[s][1],u=this.wrap(e[s+1][0]-l)*this.kx,h=(e[s+1][1]-c)*this.ky,f=0;0===u&&0===h||(f=(this.wrap(t[0]-l)*this.kx*u+(t[1]-c)*this.ky*h)/(u*u+h*h),f>1?(l=e[s+1][0],c=e[s+1][1]):f>0&&(l+=u/this.kx*f,c+=h/this.ky*f)),u=this.wrap(t[0]-l)*this.kx,h=(t[1]-c)*this.ky;let p=u*u+h*h;p<o&&(o=p,r=l,n=c,i=s,a=f)}return{point:[r,n],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 Sr(e,t){return t[0]-e[0]}function Er(e){return e[1]-e[0]+1}function Cr(e,t){return e[1]>=e[0]&&e[1]<t}function Ir(e,t){if(e[0]>e[1])return[null,null];let r=Er(e);if(t){if(2===r)return[e,null];let t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];let n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function Lr(e,t){if(!Cr(t,e.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)Qt(r,e[n]);return r}function Pr(e){let t=[1/0,1/0,-1/0,-1/0];for(let r of e)for(let e of r)Qt(t,e);return t}function zr(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Dr(e,t,r){if(!zr(e)||!zr(t))return NaN;let n=0,i=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),r.distance([0,0],[n,i])}function Or(e,t,r){let n=r.pointOnLine(t,e);return r.distance(e,n.point)}function Rr(e,t,r,n,i){let a=Math.min(Or(e,[r,n],i),Or(t,[r,n],i)),o=Math.min(Or(r,[e,t],i),Or(n,[e,t],i));return Math.min(a,o)}function Fr(e,t,r,n,i){if(!Cr(t,e.length)||!Cr(n,r.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=n[0];e<n[1];++e){let n=r[e],o=r[e+1];if(rr(t,s,n,o))return 0;a=Math.min(a,Rr(t,s,n,o,i))}}return a}function Br(e,t,r,n,i){if(!Cr(t,e.length)||!Cr(n,r.length))return NaN;let a=1/0;for(let o=t[0];o<=t[1];++o)for(let t=n[0];t<=n[1];++t)if(a=Math.min(a,i.distance(e[o],r[t])),0===a)return a;return a}function jr(e,t,r){if(ir(e,t,!0))return 0;let n=1/0;for(let i of t){let t=i[0],a=i[i.length-1];if(t!==a&&(n=Math.min(n,Or(e,[a,t],r)),0===n))return n;let o=r.pointOnLine(i,e);if(n=Math.min(n,r.distance(e,o.point)),0===n)return n}return n}function Nr(e,t,r,n){if(!Cr(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(ir(e[n],r,!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 r)for(let r=0,a=e.length,s=a-1;r<a;s=r++){let a=e[s],l=e[r];if(rr(t,o,a,l))return 0;i=Math.min(i,Rr(t,o,a,l,n))}}return i}function Ur(e,t){for(let r of e)for(let e of r)if(ir(e,t,!0))return!0;return!1}function Vr(e,t,r,n=1/0){let i=Pr(e),a=Pr(t);if(n!==1/0&&Dr(i,a,r)>=n)return n;if(er(i,a)){if(Ur(e,t))return 0}else if(Ur(t,e))return 0;let o=1/0;for(let n of e)for(let e=0,i=n.length,a=i-1;e<i;a=e++){let i=n[a],s=n[e];for(let e of t)for(let t=0,n=e.length,a=n-1;t<n;a=t++){let n=e[a],l=e[t];if(rr(i,s,n,l))return 0;o=Math.min(o,Rr(i,s,n,l,r))}}return o}function qr(e,t,r,n,i,a){if(!a)return;let o=Dr(Lr(n,a),i,r);o<t&&e.push([o,a,[0,0]])}function Hr(e,t,r,n,i,a,o){if(!a||!o)return;let s=Dr(Lr(n,a),Lr(i,o),r);s<t&&e.push([s,a,o])}function Gr(e,t,r,n,i=1/0){let a=Math.min(n.distance(e[0],r[0][0]),i);if(0===a)return a;let o=new mr([[0,[0,e.length-1],[0,0]]],Sr),s=Pr(r);for(;o.length>0;){let i=o.pop();if(i[0]>=a)continue;let l=i[1],c=t?50:100;if(Er(l)<=c){if(!Cr(l,e.length))return NaN;if(t){let t=Nr(e,l,r,n);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t){let i=jr(e[t],r,n);if(a=Math.min(a,i),0===a)return 0}}else{let r=Ir(l,t);qr(o,a,n,e,s,r[0]),qr(o,a,n,e,s,r[1])}}return a}function Wr(e,t,r,n,i,a=1/0){let o=Math.min(a,i.distance(e[0],r[0]));if(0===o)return o;let s=new mr([[0,[0,e.length-1],[0,r.length-1]]],Sr);for(;s.length>0;){let a=s.pop();if(a[0]>=o)continue;let l=a[1],c=a[2],u=t?50:100,h=n?50:100;if(Er(l)<=u&&Er(c)<=h){if(!Cr(l,e.length)&&Cr(c,r.length))return NaN;let a;if(t&&n)a=Fr(e,l,r,c,i),o=Math.min(o,a);else if(t&&!n){let t=e.slice(l[0],l[1]+1);for(let e=c[0];e<=c[1];++e)if(a=Or(r[e],t,i),o=Math.min(o,a),0===o)return o}else if(!t&&n){let t=r.slice(c[0],c[1]+1);for(let r=l[0];r<=l[1];++r)if(a=Or(e[r],t,i),o=Math.min(o,a),0===o)return o}else a=Br(e,l,r,c,i),o=Math.min(o,a)}else{let a=Ir(l,t),u=Ir(c,n);Hr(s,o,i,e,r,a[0],u[0]),Hr(s,o,i,e,r,a[0],u[1]),Hr(s,o,i,e,r,a[1],u[0]),Hr(s,o,i,e,r,a[1],u[1])}}return o}function Zr(e){return"MultiPolygon"===e.type?e.coordinates.map((e=>({type:"Polygon",coordinates:e}))):"MultiLineString"===e.type?e.coordinates.map((e=>({type:"LineString",coordinates:e}))):"MultiPoint"===e.type?e.coordinates.map((e=>({type:"Point",coordinates:e}))):[e]}class Yr{constructor(e,t){this.type=he,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(it(e[1])){let t=e[1];if("FeatureCollection"===t.type)return new Yr(t,t.features.map((e=>Zr(e.geometry))).flat());if("Feature"===t.type)return new Yr(t,Zr(t.geometry));if("type"in t&&"coordinates"in t)return new Yr(t,Zr(t))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){let r=e.geometry(),n=r.flat().map((t=>Jt([t.x,t.y],e.canonical)));if(0===r.length)return NaN;let i=new Mr(n[0][1]),a=1/0;for(let e of t){switch(e.type){case"Point":a=Math.min(a,Wr(n,!1,[e.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,Wr(n,!1,e.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Gr(n,!1,e.coordinates,i,a))}if(0===a)return a}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){let r=e.geometry(),n=r.flat().map((t=>Jt([t.x,t.y],e.canonical)));if(0===r.length)return NaN;let i=new Mr(n[0][1]),a=1/0;for(let e of t){switch(e.type){case"Point":a=Math.min(a,Wr(n,!0,[e.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,Wr(n,!0,e.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Gr(n,!0,e.coordinates,i,a))}if(0===a)return a}return a}(e,this.geometries);if("Polygon"===e.geometryType())return function(e,t){let r=e.geometry();if(0===r.length||0===r[0].length)return NaN;let n=_r(r,0).map((t=>t.map((t=>t.map((t=>Jt([t.x,t.y],e.canonical))))))),i=new Mr(n[0][0][0][1]),a=1/0;for(let e of t)for(let t of n){switch(e.type){case"Point":a=Math.min(a,Gr([e.coordinates],!1,t,i,a));break;case"LineString":a=Math.min(a,Gr(e.coordinates,!0,t,i,a));break;case"Polygon":a=Math.min(a,Vr(t,e.coordinates,i,a))}if(0===a)return a}return a}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let Xr={"==":jt,"!=":Nt,">":Vt,"<":Ut,">=":Ht,"<=":qt,array:ut,at:vt,boolean:ut,case:wt,coalesce:Ot,collator:Gt,format:Zt,image:Yt,in:xt,"index-of":_t,interpolate:zt,"interpolate-hcl":zt,"interpolate-lab":zt,length:Xt,let:gt,literal:st,match:bt,number:ut,"number-format":Wt,object:ut,slice:Tt,step:At,string:ut,"to-boolean":ft,"to-color":ft,"to-number":ft,"to-string":ft,var:yt,within:dr,distance:Yr};class $r{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){let r=e[0],n=$r.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);let i=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=a.filter((([t])=>!Array.isArray(t)||t.length===e.length-1)),s=null;for(let[n,a]of o){s=new mt(t.registry,tn,t.path,null,t.scope);let o=[],l=!1;for(let t=1;t<e.length;t++){let r=e[t],i=Array.isArray(n)?n[t-1]:n.type,a=s.parse(r,1+o.length,i);if(!a){l=!0;break}o.push(a)}if(!l)if(Array.isArray(n)&&n.length!==o.length)s.error(`Expected ${n.length} arguments, but found ${o.length} instead.`);else{for(let e=0;e<o.length;e++){let t=Array.isArray(n)?n[e]:n.type,r=o[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new $r(r,i,a,o)}}if(1===o.length)t.errors.push(...s.errors);else{let r=(o.length?o:a).map((([e])=>{return t=e,Array.isArray(t)?`(${t.map(Te).join(", ")})`:`(${Te(t.type)}...)`;var t})).join(" | "),n=[];for(let r=1;r<e.length;r++){let i=t.parse(e[r],1+n.length);if(!i)return null;n.push(Te(i.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){$r.definitions=t;for(let r in t)e[r]=$r}}function Kr(e,[t,r,n,i]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);let a=i?i.evaluate(e):1,o=nt(t,r,n,a);if(o)throw new lt(o);return new Xe(t/255,r/255,n/255,a,!1)}function Jr(e,t){return e in t}function Qr(e,t){let r=t[e];return void 0===r?null:r}function en(e){return{type:e}}function tn(e){if(e instanceof yt)return tn(e.boundExpression);if(e instanceof $r&&"error"===e.name||e instanceof Gt||e instanceof dr||e instanceof Yr)return!1;let t=e instanceof ft||e instanceof ut,r=!0;return e.eachChild((e=>{r=t?r&&tn(e):r&&e instanceof st})),!!r&&rn(e)&&an(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function rn(e){if(e instanceof $r&&("get"===e.name&&1===e.args.length||"feature-state"===e.name||"has"===e.name&&1===e.args.length||"properties"===e.name||"geometry-type"===e.name||"id"===e.name||/^filter-/.test(e.name))||e instanceof dr||e instanceof Yr)return!1;let t=!0;return e.eachChild((e=>{t&&!rn(e)&&(t=!1)})),t}function nn(e){if(e instanceof $r&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!nn(e)&&(t=!1)})),t}function an(e,t){if(e instanceof $r&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!an(e,t)&&(r=!1)})),r}function on(e){return{result:"success",value:e}}function sn(e){return{result:"error",value:e}}function ln(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function cn(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function un(e){return!!e.expression&&e.expression.interpolated}function hn(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function fn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function pn(e){return e}function dn(e,t){let r="color"===t.type,n=e.stops&&"object"==typeof e.stops[0][0],i=n||!(n||void 0!==e.property),a=e.type||(un(t)?"exponential":"interval");if(r||"padding"===t.type){let n=r?Xe.parse:Qe.parse;(e=se({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],n(e[1])]))),e.default=n(e.default?e.default:t.default)}if(e.colorSpace&&"rgb"!==(o=e.colorSpace)&&"hcl"!==o&&"lab"!==o)throw new Error(`Unknown color space: "${e.colorSpace}"`);var o;let s,l,c;if("exponential"===a)s=vn;else if("interval"===a)s=yn;else if("categorical"===a){s=gn,l=Object.create(null);for(let t of e.stops)l[t[0]]=t[1];c=typeof e.stops[0][0]}else{if("identity"!==a)throw new Error(`Unknown function type "${a}"`);s=xn}if(n){let r={},n=[];for(let t=0;t<e.stops.length;t++){let i=e.stops[t],a=i[0].zoom;void 0===r[a]&&(r[a]={zoom:a,type:e.type,property:e.property,default:e.default,stops:[]},n.push(a)),r[a].stops.push([i[0].value,i[1]])}let i=[];for(let e of n)i.push([r[e].zoom,dn(r[e],t)]);let a={name:"linear"};return{kind:"composite",interpolationType:a,interpolationFactor:zt.interpolationFactor.bind(void 0,a),zoomStops:i.map((e=>e[0])),evaluate:({zoom:r},n)=>vn({stops:i,base:e.base},t,r).evaluate(r,n)}}if(i){let r="exponential"===a?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:zt.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:r})=>s(e,t,r,l,c)}}return{kind:"source",evaluate(r,n){let i=n&&n.properties?n.properties[e.property]:void 0;return void 0===i?mn(e.default,t.default):s(e,t,i,l,c)}}}function mn(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function gn(e,t,r,n,i){return mn(typeof r===i?n[r]:void 0,e.default,t.default)}function yn(e,t,r){if("number"!==hn(r))return mn(e.default,t.default);let n=e.stops.length;if(1===n||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];let i=kt(e.stops.map((e=>e[0])),r);return e.stops[i][1]}function vn(e,t,r){let n=void 0!==e.base?e.base:1;if("number"!==hn(r))return mn(e.default,t.default);let i=e.stops.length;if(1===i||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];let a=kt(e.stops.map((e=>e[0])),r),o=function(e,t,r,n){let i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}(r,n,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],c=Pt[t.type]||pn;return"function"==typeof s.evaluate?{evaluate(...t){let r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,o,e.colorSpace)}}:c(s,l,o,e.colorSpace)}function xn(e,t,r){switch(t.type){case"color":r=Xe.parse(r);break;case"formatted":r=Je.fromString(r.toString());break;case"resolvedImage":r=rt.fromString(r.toString());break;case"padding":r=Qe.parse(r);break;default:hn(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0)}return mn(r,e.default,t.default)}$r.register(Xr,{error:[{kind:"error"},[fe],(e,[t])=>{throw new lt(t.evaluate(e))}],typeof:[fe,[ge],(e,[t])=>Te(at(t.evaluate(e)))],"to-rgba":[we(he,4),[de],(e,[t])=>{let[r,n,i,a]=t.evaluate(e).rgb;return[255*r,255*n,255*i,a]}],rgb:[de,[he,he,he],Kr],rgba:[de,[he,he,he,he],Kr],has:{type:pe,overloads:[[[fe],(e,[t])=>Jr(t.evaluate(e),e.properties())],[[fe,me],(e,[t,r])=>Jr(t.evaluate(e),r.evaluate(e))]]},get:{type:ge,overloads:[[[fe],(e,[t])=>Qr(t.evaluate(e),e.properties())],[[fe,me],(e,[t,r])=>Qr(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ge,[fe],(e,[t])=>Qr(t.evaluate(e),e.featureState||{})],properties:[me,[],e=>e.properties()],"geometry-type":[fe,[],e=>e.geometryType()],id:[ge,[],e=>e.id()],zoom:[he,[],e=>e.globals.zoom],"heatmap-density":[he,[],e=>e.globals.heatmapDensity||0],"line-progress":[he,[],e=>e.globals.lineProgress||0],accumulated:[ge,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[he,en(he),(e,t)=>{let r=0;for(let n of t)r+=n.evaluate(e);return r}],"*":[he,en(he),(e,t)=>{let r=1;for(let n of t)r*=n.evaluate(e);return r}],"-":{type:he,overloads:[[[he,he],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[he],(e,[t])=>-t.evaluate(e)]]},"/":[he,[he,he],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[he,[he,he],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[he,[],()=>Math.LN2],pi:[he,[],()=>Math.PI],e:[he,[],()=>Math.E],"^":[he,[he,he],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[he,[he],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[he,[he],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[he,[he],(e,[t])=>Math.log(t.evaluate(e))],log2:[he,[he],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[he,[he],(e,[t])=>Math.sin(t.evaluate(e))],cos:[he,[he],(e,[t])=>Math.cos(t.evaluate(e))],tan:[he,[he],(e,[t])=>Math.tan(t.evaluate(e))],asin:[he,[he],(e,[t])=>Math.asin(t.evaluate(e))],acos:[he,[he],(e,[t])=>Math.acos(t.evaluate(e))],atan:[he,[he],(e,[t])=>Math.atan(t.evaluate(e))],min:[he,en(he),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[he,en(he),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[he,[he],(e,[t])=>Math.abs(t.evaluate(e))],round:[he,[he],(e,[t])=>{let r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[he,[he],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[he,[he],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[pe,[fe,ge],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[pe,[ge],(e,[t])=>e.id()===t.value],"filter-type-==":[pe,[fe],(e,[t])=>e.geometryType()===t.value],"filter-<":[pe,[fe,ge],(e,[t,r])=>{let n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[pe,[ge],(e,[t])=>{let r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[pe,[fe,ge],(e,[t,r])=>{let n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[pe,[ge],(e,[t])=>{let r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[pe,[fe,ge],(e,[t,r])=>{let n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[pe,[ge],(e,[t])=>{let r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[pe,[fe,ge],(e,[t,r])=>{let n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[pe,[ge],(e,[t])=>{let r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[pe,[ge],(e,[t])=>t.value in e.properties()],"filter-has-id":[pe,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[pe,[we(fe)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[pe,[we(ge)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[pe,[fe,we(ge)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[pe,[fe,we(ge)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){let i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:pe,overloads:[[[pe,pe],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[en(pe),(e,t)=>{for(let r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:pe,overloads:[[[pe,pe],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[en(pe),(e,t)=>{for(let r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[pe,[pe],(e,[t])=>!t.evaluate(e)],"is-supported-script":[pe,[fe],(e,[t])=>{let r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[fe,[fe],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[fe,[fe],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[fe,en(ge),(e,t)=>t.map((t=>ot(t.evaluate(e)))).join("")],"resolved-locale":[fe,[ye],(e,[t])=>t.evaluate(e).resolvedLocale()]});class _n{constructor(e,t){var r;this.expression=e,this._warningHistory={},this._evaluator=new dt,this._defaultValue=t?"color"===(r=t).type&&fn(r.default)?new Xe(0,0,0,0):"color"===r.type?Xe.parse(r.default)||null:"padding"===r.type?Qe.parse(r.default)||null:"variableAnchorOffsetCollection"===r.type?tt.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new lt(`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 bn(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Xr}function wn(e,t){let r=new mt(Xr,tn,[],t?function(e){let t={color:de,string:fe,number:he,enum:fe,boolean:pe,formatted:ve,padding:xe,resolvedImage:_e,variableAnchorOffsetCollection:be};return"array"===e.type?we(t[e.value]||ge,e.length):t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?on(new _n(n,t)):sn(r.errors)}class Tn{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!nn(t.expression)}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)}evaluate(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)}}class kn{constructor(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!nn(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)}evaluate(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)}interpolationFactor(e,t,r){return this.interpolationType?zt.interpolationFactor(this.interpolationType,e,t,r):0}}function An(e,t){let r=wn(e,t);if("error"===r.result)return r;let n=r.value.expression,i=rn(n);if(!i&&!ln(t))return sn([new le("","data expressions not supported")]);let a=an(n,["zoom"]);if(!a&&!cn(t))return sn([new le("","zoom expressions not supported")]);let o=Sn(n);return o||a?o instanceof le?sn([o]):o instanceof zt&&!un(t)?sn([new le("",'"interpolate" expressions cannot be used with this property')]):on(o?new kn(i?"camera":"composite",r.value,o.labels,o instanceof zt?o.interpolation:void 0):new Tn(i?"constant":"source",r.value)):sn([new le("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Mn{constructor(e,t){this._parameters=e,this._specification=t,se(this,dn(this._parameters,this._specification))}static deserialize(e){return new Mn(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Sn(e){let t=null;if(e instanceof gt)t=Sn(e.result);else if(e instanceof Ot){for(let r of e.args)if(t=Sn(r),t)break}else(e instanceof At||e instanceof zt)&&e.input instanceof $r&&"zoom"===e.input.name&&(t=e);return t instanceof le||e.eachChild((e=>{let r=Sn(e);r instanceof le?t=r:!t&&r?t=new le("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new le("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function En(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(let t of e.slice(1))if(!En(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}let Cn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function In(e){if(null==e)return{filter:()=>!0,needGeometry:!1};En(e)||(e=zn(e));let t=wn(e,Cn);if("error"===t.result)throw new Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return{filter:(e,r,n)=>t.value.evaluate(e,r,{},n),needGeometry:Pn(e)}}function Ln(e,t){return e<t?-1:e>t?1:0}function Pn(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(Pn(e[t]))return!0;return!1}function zn(e){if(!e)return!0;let t=e[0];return e.length<=1?"any"!==t:"=="===t?Dn(e[1],e[2],"=="):"!="===t?Fn(Dn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?Dn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(zn))):"all"===t?["all"].concat(e.slice(1).map(zn)):"none"===t?["all"].concat(e.slice(1).map(zn).map(Fn)):"in"===t?On(e[1],e.slice(2)):"!in"===t?Fn(On(e[1],e.slice(2))):"has"===t?Rn(e[1]):"!has"!==t||Fn(Rn(e[1]));var r}function Dn(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function On(e,t){if(0===t.length)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(Ln)]]:["filter-in-small",e,["literal",t]]}}function Rn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Fn(e){return["!",e]}function Bn(e){let t=typeof e;if("number"===t||"boolean"===t||"string"===t||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(let r of e)t+=`${Bn(r)},`;return`${t}]`}let r=Object.keys(e).sort(),n="{";for(let t=0;t<r.length;t++)n+=`${JSON.stringify(r[t])}:${Bn(e[r[t]])},`;return`${n}}`}function jn(e){let t="";for(let r of X)t+=`/${Bn(e[r])}`;return t}function Nn(e){let t=e.value;return t?[new oe(e.key,t,"constants have been deprecated as of v8")]:[]}function Un(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Vn(e){if(Array.isArray(e))return e.map(Vn);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let r in e)t[r]=Vn(e[r]);return t}return Un(e)}function qn(e){let t=e.key,r=e.value,n=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=e.validateSpec,l=[],c=hn(r);if("object"!==c)return[new oe(t,r,`object expected, ${c} found`)];for(let e in r){let c,u=e.split(".")[0],h=n[u]||n["*"];if(i[u])c=i[u];else if(n[u])c=s;else if(i["*"])c=i["*"];else{if(!n["*"]){l.push(new oe(t,r[e],`unknown property "${e}"`));continue}c=s}l=l.concat(c({key:(t&&`${t}.`)+e,value:r[e],valueSpec:h,style:a,styleSpec:o,object:r,objectKey:e,validateSpec:s},r))}for(let e in n)i[e]||n[e].required&&void 0===n[e].default&&void 0===r[e]&&l.push(new oe(t,r,`missing required property "${e}"`));return l}function Hn(e){let t=e.value,r=e.valueSpec,n=e.style,i=e.styleSpec,a=e.key,o=e.arrayElementValidator||e.validateSpec;if("array"!==hn(t))return[new oe(a,t,`array expected, ${hn(t)} found`)];if(r.length&&t.length!==r.length)return[new oe(a,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.length<r["min-length"])return[new oe(a,t,`array length at least ${r["min-length"]} expected, length ${t.length} found`)];let s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===hn(r.value)&&(s=r.value);let l=[];for(let r=0;r<t.length;r++)l=l.concat(o({array:t,arrayIndex:r,value:t[r],valueSpec:s,validateSpec:e.validateSpec,style:n,styleSpec:i,key:`${a}[${r}]`}));return l}function Gn(e){let t=e.key,r=e.value,n=e.valueSpec,i=hn(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new oe(t,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new oe(t,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new oe(t,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function Wn(e){let t,r,n,i=e.valueSpec,a=Un(e.value.type),o={},s="categorical"!==a&&void 0===e.value.property,l=!s,c="array"===hn(e.value.stops)&&"array"===hn(e.value.stops[0])&&"object"===hn(e.value.stops[0][0]),u=qn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===a)return[new oe(e.key,e.value,'identity function may not have a "stops" property')];let t=[],r=e.value;return t=t.concat(Hn({key:e.key,value:r,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:h})),"array"===hn(r)&&0===r.length&&t.push(new oe(e.key,r,"array must have at least one stop")),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:i,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===a&&s&&u.push(new oe(e.key,e.value,'missing required property "property"')),"identity"===a||e.value.stops||u.push(new oe(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!un(e.valueSpec)&&u.push(new oe(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!ln(e.valueSpec)?u.push(new oe(e.key,e.value,"property functions not supported")):s&&!cn(e.valueSpec)&&u.push(new oe(e.key,e.value,"zoom functions not supported"))),"categorical"!==a&&!c||void 0!==e.value.property||u.push(new oe(e.key,e.value,'"property" property is required')),u;function h(e){let t=[],a=e.value,s=e.key;if("array"!==hn(a))return[new oe(s,a,`array expected, ${hn(a)} found`)];if(2!==a.length)return[new oe(s,a,`array length 2 expected, length ${a.length} found`)];if(c){if("object"!==hn(a[0]))return[new oe(s,a,`object expected, ${hn(a[0])} found`)];if(void 0===a[0].zoom)return[new oe(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new oe(s,a,"object stop key must have value")];if(n&&n>Un(a[0].zoom))return[new oe(s,a[0].zoom,"stop zoom values must appear in ascending order")];Un(a[0].zoom)!==n&&(n=Un(a[0].zoom),r=void 0,o={}),t=t.concat(qn({key:`${s}[0]`,value:a[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Gn,value:f}}))}else t=t.concat(f({key:`${s}[0]`,value:a[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},a));return bn(Vn(a[1]))?t.concat([new oe(`${s}[1]`,a[1],"expressions are not allowed in function stops.")]):t.concat(e.validateSpec({key:`${s}[1]`,value:a[1],valueSpec:i,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function f(e,n){let s=hn(e.value),l=Un(e.value),c=null!==e.value?e.value:n;if(t){if(s!==t)return[new oe(e.key,c,`${s} stop domain type must match previous stop domain type ${t}`)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new oe(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){let t=`number expected, ${s} found`;return ln(i)&&void 0===a&&(t+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new oe(e.key,c,t)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l<r?[new oe(e.key,c,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in o?[new oe(e.key,c,"stop domain values must be unique")]:(o[l]=!0,[])):[new oe(e.key,c,`integer expected, found ${l}`)]}}function Zn(e){let t=("property"===e.expressionContext?An:wn)(Vn(e.value),e.valueSpec);if("error"===t.result)return t.value.map((t=>new oe(`${e.key}${t.key}`,e.value,t.message)));let r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new oe(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!nn(r))return[new oe(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!nn(r))return[new oe(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!an(r,["zoom","feature-state"]))return[new oe(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!rn(r))return[new oe(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Yn(e){let t=e.key,r=e.value,n=e.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Un(r))&&i.push(new oe(t,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(Un(r))&&i.push(new oe(t,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Xn(e){return En(Vn(e.value))?Zn(se({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):$n(e)}function $n(e){let t=e.value,r=e.key;if("array"!==hn(t))return[new oe(r,t,`array expected, ${hn(t)} found`)];let n,i=e.styleSpec,a=[];if(t.length<1)return[new oe(r,t,"filter array must have at least 1 element")];switch(a=a.concat(Yn({key:`${r}[0]`,value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),Un(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===Un(t[1])&&a.push(new oe(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":3!==t.length&&a.push(new oe(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(n=hn(t[1]),"string"!==n&&a.push(new oe(`${r}[1]`,t[1],`string expected, ${n} found`)));for(let o=2;o<t.length;o++)n=hn(t[o]),"$type"===Un(t[1])?a=a.concat(Yn({key:`${r}[${o}]`,value:t[o],valueSpec:i.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&a.push(new oe(`${r}[${o}]`,t[o],`string, number, or boolean expected, ${n} found`));break;case"any":case"all":case"none":for(let n=1;n<t.length;n++)a=a.concat($n({key:`${r}[${n}]`,value:t[n],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=hn(t[1]),2!==t.length?a.push(new oe(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):"string"!==n&&a.push(new oe(`${r}[1]`,t[1],`string expected, ${n} found`))}return a}function Kn(e,t){let r=e.key,n=e.validateSpec,i=e.style,a=e.styleSpec,o=e.value,s=e.objectKey,l=a[`${t}_${e.layerType}`];if(!l)return[];let c=s.match(/^(.*)-transition$/);if("paint"===t&&c&&l[c[1]]&&l[c[1]].transition)return n({key:r,value:o,valueSpec:a.transition,style:i,styleSpec:a});let u,h=e.valueSpec||l[s];if(!h)return[new oe(r,o,`unknown property "${s}"`)];if("string"===hn(o)&&ln(h)&&!h.tokens&&(u=/^{([^}]+)}$/.exec(o)))return[new oe(r,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(u[1])} }\`.`)];let f=[];return"symbol"===e.layerType&&("text-field"===s&&i&&!i.glyphs&&f.push(new oe(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===s&&fn(Vn(o))&&"identity"===Un(o.type)&&f.push(new oe(r,o,'"text-font" does not support identity functions'))),f.concat(n({key:e.key,value:o,valueSpec:h,style:i,styleSpec:a,expressionContext:"property",propertyType:t,propertyKey:s}))}function Jn(e){return Kn(e,"paint")}function Qn(e){return Kn(e,"layout")}function ei(e){let t=[],r=e.value,n=e.key,i=e.style,a=e.styleSpec;r.type||r.ref||t.push(new oe(n,r,'either "type" or "ref" is required'));let o=Un(r.type),s=Un(r.ref);if(r.id){let a=Un(r.id);for(let o=0;o<e.arrayIndex;o++){let e=i.layers[o];Un(e.id)===a&&t.push(new oe(n,r.id,`duplicate layer id "${r.id}", previously used at line ${e.id.__line__}`))}}if("ref"in r){let e;["type","source","source-layer","filter","layout"].forEach((e=>{e in r&&t.push(new oe(n,r[e],`"${e}" is prohibited for ref layers`))})),i.layers.forEach((t=>{Un(t.id)===s&&(e=t)})),e?e.ref?t.push(new oe(n,r.ref,"ref cannot reference another ref layer")):o=Un(e.type):t.push(new oe(n,r.ref,`ref layer "${s}" not found`))}else if("background"!==o)if(r.source){let e=i.sources&&i.sources[r.source],a=e&&Un(e.type);e?"vector"===a&&"raster"===o?t.push(new oe(n,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===o?t.push(new oe(n,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==o?t.push(new oe(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==o?t.push(new oe(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==o||!r.paint||!r.paint["line-gradient"]||"geojson"===a&&e.lineMetrics||t.push(new oe(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new oe(n,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new oe(n,r.source,`source "${r.source}" not found`))}else t.push(new oe(n,r,'missing required property "source"'));return t=t.concat(qn({key:n,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:`${n}.type`,value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"}),filter:Xn,layout:e=>qn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>Qn(se({layerType:o},e))}}),paint:e=>qn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>Jn(se({layerType:o},e))}})}})),t}function ti(e){let t=e.value,r=e.key,n=hn(t);return"string"!==n?[new oe(r,t,`string expected, ${n} found`)]:[]}let ri={promoteId:function({key:e,value:t}){if("string"===hn(t))return ti({key:e,value:t});{let r=[];for(let n in t)r.push(...ti({key:`${e}.${n}`,value:t[n]}));return r}}};function ni(e){let t=e.value,r=e.key,n=e.styleSpec,i=e.style,a=e.validateSpec;if(!t.type)return[new oe(r,t,'"type" is required')];let o,s=Un(t.type);switch(s){case"vector":case"raster":return o=qn({key:r,value:t,valueSpec:n[`source_${s.replace("-","_")}`],style:e.style,styleSpec:n,objectElementValidators:ri,validateSpec:a}),o;case"raster-dem":return o=function(e){var t;let r=null!==(t=e.sourceName)&&void 0!==t?t:"",n=e.value,i=e.styleSpec,a=i.source_raster_dem,o=e.style,s=[],l=hn(n);if(void 0===n)return s;if("object"!==l)return s.push(new oe("source_raster_dem",n,`object expected, ${l} found`)),s;let c="custom"===Un(n.encoding),u=["redFactor","greenFactor","blueFactor","baseShift"],h=e.value.encoding?`"${e.value.encoding}"`:"Default";for(let t in n)!c&&u.includes(t)?s.push(new oe(t,n[t],`In "${r}": "${t}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):a[t]?s=s.concat(e.validateSpec({key:t,value:n[t],valueSpec:a[t],validateSpec:e.validateSpec,style:o,styleSpec:i})):s.push(new oe(t,n[t],`unknown property "${t}"`));return s}({sourceName:r,value:t,style:e.style,styleSpec:n,validateSpec:a}),o;case"geojson":if(o=qn({key:r,value:t,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:a,objectElementValidators:ri}),t.cluster)for(let e in t.clusterProperties){let[n,i]=t.clusterProperties[e],s="string"==typeof n?[n,["accumulated"],["get",e]]:n;o.push(...Zn({key:`${r}.${e}.map`,value:i,validateSpec:a,expressionContext:"cluster-map"})),o.push(...Zn({key:`${r}.${e}.reduce`,value:s,validateSpec:a,expressionContext:"cluster-reduce"}))}return o;case"video":return qn({key:r,value:t,valueSpec:n.source_video,style:i,validateSpec:a,styleSpec:n});case"image":return qn({key:r,value:t,valueSpec:n.source_image,style:i,validateSpec:a,styleSpec:n});case"canvas":return[new oe(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Yn({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:a,styleSpec:n})}}function ii(e){let t=e.value,r=e.styleSpec,n=r.light,i=e.style,a=[],o=hn(t);if(void 0===t)return a;if("object"!==o)return a=a.concat([new oe("light",t,`object expected, ${o} found`)]),a;for(let o in t){let s=o.match(/^(.*)-transition$/);a=a.concat(s&&n[s[1]]&&n[s[1]].transition?e.validateSpec({key:o,value:t[o],valueSpec:r.transition,validateSpec:e.validateSpec,style:i,styleSpec:r}):n[o]?e.validateSpec({key:o,value:t[o],valueSpec:n[o],validateSpec:e.validateSpec,style:i,styleSpec:r}):[new oe(o,t[o],`unknown property "${o}"`)])}return a}function ai(e){let t=e.value,r=e.styleSpec,n=r.sky,i=e.style,a=hn(t);if(void 0===t)return[];if("object"!==a)return[new oe("sky",t,`object expected, ${a} found`)];let o=[];for(let a in t)o=o.concat(n[a]?e.validateSpec({key:a,value:t[a],valueSpec:n[a],style:i,styleSpec:r}):[new oe(a,t[a],`unknown property "${a}"`)]);return o}function oi(e){let t=e.value,r=e.styleSpec,n=r.terrain,i=e.style,a=[],o=hn(t);if(void 0===t)return a;if("object"!==o)return a=a.concat([new oe("terrain",t,`object expected, ${o} found`)]),a;for(let o in t)a=a.concat(n[o]?e.validateSpec({key:o,value:t[o],valueSpec:n[o],validateSpec:e.validateSpec,style:i,styleSpec:r}):[new oe(o,t[o],`unknown property "${o}"`)]);return a}function si(e){let t=[],r=e.value,n=e.key;if(Array.isArray(r)){let i=[],a=[];for(let o in r)r[o].id&&i.includes(r[o].id)&&t.push(new oe(n,r,`all the sprites' ids must be unique, but ${r[o].id} is duplicated`)),i.push(r[o].id),r[o].url&&a.includes(r[o].url)&&t.push(new oe(n,r,`all the sprites' URLs must be unique, but ${r[o].url} is duplicated`)),a.push(r[o].url),t=t.concat(qn({key:`${n}[${o}]`,value:r[o],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:e.validateSpec}));return t}return ti({key:n,value:r})}let li={"*":()=>[],array:Hn,boolean:function(e){let t=e.value,r=e.key,n=hn(t);return"boolean"!==n?[new oe(r,t,`boolean expected, ${n} found`)]:[]},number:Gn,color:function(e){let t=e.key,r=e.value,n=hn(r);return"string"!==n?[new oe(t,r,`color expected, ${n} found`)]:Xe.parse(String(r))?[]:[new oe(t,r,`color expected, "${r}" found`)]},constants:Nn,enum:Yn,filter:Xn,function:Wn,layer:ei,object:qn,source:ni,light:ii,sky:ai,terrain:oi,projection:function(e){let t=e.value,r=e.styleSpec,n=r.projection,i=e.style,a=hn(t);if(void 0===t)return[];if("object"!==a)return[new oe("projection",t,`object expected, ${a} found`)];let o=[];for(let a in t)o=o.concat(n[a]?e.validateSpec({key:a,value:t[a],valueSpec:n[a],style:i,styleSpec:r}):[new oe(a,t[a],`unknown property "${a}"`)]);return o},string:ti,formatted:function(e){return 0===ti(e).length?[]:Zn(e)},resolvedImage:function(e){return 0===ti(e).length?[]:Zn(e)},padding:function(e){let t=e.key,r=e.value;if("array"===hn(r)){if(r.length<1||r.length>4)return[new oe(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];let n={type:"number"},i=[];for(let a=0;a<r.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:r[a],validateSpec:e.validateSpec,valueSpec:n}));return i}return Gn({key:t,value:r,valueSpec:{}})},variableAnchorOffsetCollection:function(e){let t=e.key,r=e.value,n=hn(r),i=e.styleSpec;if("array"!==n||r.length<1||r.length%2!=0)return[new oe(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let n=0;n<r.length;n+=2)a=a.concat(Yn({key:`${t}[${n}]`,value:r[n],valueSpec:i.layout_symbol["text-anchor"]})),a=a.concat(Hn({key:`${t}[${n+1}]`,value:r[n+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:i}));return a},sprite:si};function ci(e){let t=e.value,r=e.valueSpec,n=e.styleSpec;return e.validateSpec=ci,r.expression&&fn(Un(t))?Wn(e):r.expression&&bn(Vn(t))?Zn(e):r.type&&li[r.type]?li[r.type](e):qn(se({},e,{valueSpec:r.type?n[r.type]:r}))}function ui(e){let t=e.value,r=e.key,n=ti(e);return n.length||(-1===t.indexOf("{fontstack}")&&n.push(new oe(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&n.push(new oe(r,t,'"glyphs" url must include a "{range}" token'))),n}function hi(e,t=Y){let r=[];return r=r.concat(ci({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:ci,objectElementValidators:{glyphs:ui,"*":()=>[]}})),e.constants&&(r=r.concat(Nn({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:ci}))),pi(r)}function fi(e){return function(t){return e(p(f({},t),{validateSpec:ci}))}}function pi(e){return[].concat(e).sort(((e,t)=>e.line-t.line))}function di(e){return function(...t){return pi(e.apply(this,t))}}hi.source=di(fi(ni)),hi.sprite=di(fi(si)),hi.glyphs=di(fi(ui)),hi.light=di(fi(ii)),hi.sky=di(fi(ai)),hi.terrain=di(fi(oi)),hi.layer=di(fi(ei)),hi.filter=di(fi(Xn)),hi.paintProperty=di(fi(Jn)),hi.layoutProperty=di(fi(Qn));let mi=hi,gi=mi.light,yi=mi.sky,vi=mi.paintProperty,xi=mi.layoutProperty;function _i(e,t){let r=!1;if(t&&t.length)for(let n of t)e.fire(new W(new Error(n.message))),r=!0;return r}class bi{constructor(e,t,r){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let i=new Int32Array(this.arrayBuffer);e=i[0],this.d=(t=i[1])+2*(r=i[2]);for(let e=0;e<this.d*this.d;e++){let t=i[3+e],r=i[3+e+1];n.push(t===r?null:i.subarray(t,r))}let a=i[3+n.length+1];this.keys=i.subarray(i[3+n.length],a),this.bboxes=i.subarray(a),this.insert=this._insertReadonly}else{this.d=t+2*r;for(let e=0;e<this.d*this.d;e++)n.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;let i=r/t*e;this.min=-i,this.max=e+i}insert(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,t,r,n,i,a){this.cells[i].push(a)}query(e,t,r,n,i){let a=this.min,o=this.max;if(e<=a&&t<=a&&o<=r&&o<=n&&!i)return Array.prototype.slice.call(this.keys);{let a=[];return this._forEachCell(e,t,r,n,this._queryCell,a,{},i),a}}_queryCell(e,t,r,n,i,a,o,s){let l=this.cells[i];if(null!==l){let i=this.keys,c=this.bboxes;for(let u=0;u<l.length;u++){let h=l[u];if(void 0===o[h]){let l=4*h;(s?s(c[l+0],c[l+1],c[l+2],c[l+3]):e<=c[l+2]&&t<=c[l+3]&&r>=c[l+0]&&n>=c[l+1])?(o[h]=!0,a.push(i[h])):o[h]=!1}}}}_forEachCell(e,t,r,n,i,a,o,s){let l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n);for(let f=l;f<=u;f++)for(let l=c;l<=h;l++){let c=this.d*l+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(l),this._convertFromCellCoord(f+1),this._convertFromCellCoord(l+1)))&&i.call(this,e,t,r,n,c,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,r=0;for(let e=0;e<this.cells.length;e++)r+=this.cells[e].length;let n=new Int32Array(t+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let i=t;for(let t=0;t<e.length;t++){let r=e[t];n[3+t]=i,n.set(r,i),i+=r.length}return n[3+e.length]=i,n.set(this.keys,i),i+=this.keys.length,n[3+e.length+1]=i,n.set(this.bboxes,i),i+=this.bboxes.length,n.buffer}static serialize(e,t){let r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}}static deserialize(e){return new bi(e.buffer)}}let wi={};function Ti(e,t,r={}){if(wi[e])throw new Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),wi[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}Ti("Object",Object),Ti("TransferableGridIndex",bi),Ti("Color",Xe),Ti("Error",Error),Ti("AJAXError",j),Ti("ResolvedImage",rt),Ti("StylePropertyFunction",Mn),Ti("StyleExpression",_n,{omit:["_evaluator"]}),Ti("ZoomDependentExpression",kn),Ti("ZoomConstantExpression",Tn),Ti("CompoundExpression",$r,{omit:["_evaluate"]});for(let e in Xr)Xr[e]._classRegistryKey||Ti(`Expression_${e}`,Xr[e]);function ki(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function Ai(e){return e.$name||e.constructor._classRegistryKey}function Mi(e){return!function(e){if(null===e||"object"!=typeof e)return!1;let t=Ai(e);return!(!t||"Object"===t)}(e)&&(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||ki(e)||C(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function Si(e,t){if(Mi(e))return(ki(e)||C(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 r=[];for(let n of e)r.push(Si(n,t));return r}if("object"!=typeof e)throw new Error("can't serialize object of type "+typeof e);let r=Ai(e);if(!r)throw new Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!wi[r])throw new Error(`${r} is not registered.`);let{klass:n}=wi[r],i=n.serialize?n.serialize(e,t):{};if(n.serialize){if(t&&i===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let n in e){if(!e.hasOwnProperty(n)||wi[r].omit.indexOf(n)>=0)continue;let a=e[n];i[n]=wi[r].shallow.indexOf(n)>=0?a:Si(a,t)}e instanceof Error&&(i.message=e.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(i.$name=r),i}function Ei(e){if(Mi(e))return e;if(Array.isArray(e))return e.map(Ei);if("object"!=typeof e)throw new Error("can't deserialize object of type "+typeof e);let t=Ai(e)||"Object";if(!wi[t])throw new Error(`can't deserialize unregistered class ${t}`);let{klass:r}=wi[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);let n=Object.create(r.prototype);for(let r of Object.keys(e)){if("$name"===r)continue;let i=e[r];n[r]=wi[t].shallow.indexOf(r)>=0?i:Ei(i)}return n}class Ci{constructor(){this.first=!0}update(e,t){let r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))}}let Ii=e=>e>=12272&&e<=12287,Li=e=>e>=12288&&e<=12351,Pi=e=>e>=12448&&e<=12543,zi=e=>e>=12736&&e<=12783,Di=e=>e>=12800&&e<=13055,Oi=e=>e>=13056&&e<=13311,Ri=e=>e>=65040&&e<=65055,Fi=e=>e>=65072&&e<=65103,Bi=e=>e>=65104&&e<=65135,ji=e=>e>=65280&&e<=65519;function Ni(e){for(let t of e)if(Wi(t.charCodeAt(0)))return!0;return!1}function Ui(e){for(let t of e)if(!Hi(t.charCodeAt(0)))return!1;return!0}function Vi(e){let t=e.map((e=>{try{return new RegExp(`\\p{sc=${e}}`,"u").source}catch{return null}})).filter((e=>e));return new RegExp(t.join("|"),"u")}let qi=Vi(["Arab","Dupl","Mong","Ougr","Syrc"]);function Hi(e){return!qi.test(String.fromCodePoint(e))}let Gi=Vi(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Wi(e){return!(746!==e&&747!==e&&(e<4352||!(Fi(e)&&!(e>=65097&&e<=65103)||Oi(e)||zi(e)||!(!Li(e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||Di(e)||Ii(e)||(e=>e>=12688&&e<=12703)(e)||Pi(e)&&12540!==e||!(!ji(e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!Bi(e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Ri(e)||(e=>e>=19904&&e<=19967)(e)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(e))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(e))||Gi.test(String.fromCodePoint(e)))))}function Zi(e){return!(Wi(e)||(t=e,(e=>e>=128&&e<=255)(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||(e=>e>=8192&&e<=8303)(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||(e=>e>=8448&&e<=8527)(t)||(e=>e>=8528&&e<=8591)(t)||(e=>e>=8960&&e<=9215)(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||(e=>e>=9216&&e<=9279)(t)&&9251!==t||(e=>e>=9280&&e<=9311)(t)||(e=>e>=9312&&e<=9471)(t)||(e=>e>=9632&&e<=9727)(t)||(e=>e>=9728&&e<=9983)(t)&&!(t>=9754&&t<=9759)||(e=>e>=11008&&e<=11263)(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Li(t)||Pi(t)||(e=>e>=57344&&e<=63743)(t)||Fi(t)||Bi(t)||ji(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t));var t}let Yi=Vi(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Xi(e){return Yi.test(String.fromCodePoint(e))}function $i(e,t){return!(!t&&Xi(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||(e=>e>=6016&&e<=6143)(e))}function Ki(e){for(let t of e)if(Xi(t.charCodeAt(0)))return!0;return!1}let Ji=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 null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Qi{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 Ci,this.transition={})}isSupportedScript(e){return function(e,t){for(let r of e)if(!$i(r.charCodeAt(0),t))return!1;return!0}(e,"loaded"===Ji.getRTLTextPluginStatus())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}}class ea{constructor(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(fn(e))return new Mn(e,t);if(bn(e)){let r=An(e,t);if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return r.value}{let r=e;return"color"===t.type&&"string"==typeof e?r=Xe.parse(e):"padding"!==t.type||"number"!=typeof e&&!Array.isArray(e)?"variableAnchorOffsetCollection"===t.type&&Array.isArray(e)&&(r=tt.parse(e)):r=Qe.parse(e),{kind:"constant",evaluate:()=>r}}}(void 0===t?e.specification.default:t,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}}class ta{constructor(e){this.property=e,this.value=new ea(e,void 0)}transitioned(e,t){return new na(this.property,this.value,t,x({},e.transition,this.transition),e.now)}untransitioned(){return new na(this.property,this.value,null,{},0)}}class ra{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return T(this._values[e].value.value)}setValue(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new ta(this._values[e].property)),this._values[e].value=new ea(this._values[e].property,null===t?void 0:T(t))}getTransition(e){return T(this._values[e].transition)}setTransition(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new ta(this._values[e].property)),this._values[e].transition=T(t)||void 0}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r);let n=this.getTransition(t);void 0!==n&&(e[`${t}-transition`]=n)}return e}transitioned(e,t){let r=new ia(this._properties);for(let n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(e,t._values[n]);return r}untransitioned(){let e=new ia(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class na{constructor(e,t,r,n,i){this.property=e,this.value=t,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,e.specification.transition&&(n.delay||n.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){let n=e.now||0,i=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(e,t,r);{let o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,r),i,function(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}(o))}}return i}}class ia{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){let n=new sa(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class aa{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return void 0!==this._values[e].value}getValue(e){return T(this._values[e].value)}setValue(e,t){this._values[e]=new ea(this._values[e].property,null===t?void 0:T(t))}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){let n=new sa(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}}class oa{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,n){return this.property.evaluate(this.value,this.parameters,e,t,r,n)}}class sa{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class la{constructor(e){this.specification=e}possiblyEvaluate(e,t){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,r){let n=Pt[this.specification.type];return n?n(e,t,r):e}}class ca{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,n){return new oa(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},r,n)}:e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new oa(this,{kind:"constant",value:void 0},e.parameters);let n=Pt[this.specification.type];if(n){let i=n(e.value.value,t.value.value,r);return new oa(this,{kind:"constant",value:i},e.parameters)}return e}evaluate(e,t,r,n,i,a){return"constant"===e.kind?e.value:e.evaluate(t,r,n,i,a)}}class ua extends ca{possiblyEvaluate(e,t,r,n){if(void 0===e.value)return new oa(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){let i=e.expression.evaluate(t,null,{},r,n),a="resolvedImage"===e.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,t);return new oa(this,{kind:"constant",value:o},t)}if("camera"===e.expression.kind){let r=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 oa(this,{kind:"constant",value:r},t)}return new oa(this,e.expression,t)}evaluate(e,t,r,n,i,a){if("source"===e.kind){let o=e.evaluate(t,r,n,i,a);return this._calculate(o,o,o,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,n),e.evaluate({zoom:Math.floor(t.zoom)},r,n),e.evaluate({zoom:Math.floor(t.zoom)+1},r,n),t):e.value}_calculate(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}}class ha{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){let i=e.expression.evaluate(t,null,{},r,n);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new Qi(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Qi(Math.floor(t.zoom),t)),e.expression.evaluate(new Qi(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}}class fa{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)}interpolate(){return!1}}class pa{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let t in e){let r=e[t];r.specification.overridable&&this.overridableProperties.push(t);let n=this.defaultPropertyValues[t]=new ea(r,void 0),i=this.defaultTransitionablePropertyValues[t]=new ta(r);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}}}Ti("DataDrivenProperty",ca),Ti("DataConstantProperty",la),Ti("CrossFadedDataDrivenProperty",ua),Ti("CrossFadedProperty",ha),Ti("ColorRampProperty",fa);let da="-transition";class ma extends Z{constructor(e,t){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new aa(t.layout)),t.paint)){this._transitionablePaint=new ra(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 sa(t.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t,r={}){null!=t&&this._validate(xi,`layers.${this.id}.layout.${e}`,e,t,r)||("visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t)}getPaintProperty(e){return e.endsWith(da)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t,r={}){if(null!=t&&this._validate(vi,`layers.${this.id}.paint.${e}`,e,t,r))return!1;if(e.endsWith(da))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{let r=this._transitionablePaint._values[e],n="cross-faded-data-driven"===r.property.specification["property-type"],i=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let o=this._transitionablePaint._values[e].value;return o.isDataDriven()||i||n||this._handleOverridablePaintPropertyUpdate(e,a,o)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}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),w(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}_validate(e,t,r,n,i={}){return(!i||!1!==i.validate)&&_i(this,e.call(mi,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:Y,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 oa&&ln(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}}let ga={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ya{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 va{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 new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function xa(e,t=1){let r=0,n=0;return{members:e.map((e=>{let i=ga[e.type].BYTES_PER_ELEMENT,a=r=_a(r,Math.max(t,i)),o=e.components||1;return n=Math.max(n,i),r+=i*o,{name:e.name,type:e.type,components:o,offset:a}})),size:_a(r,Math.max(n,t)),alignment:t}}function _a(e,t){return Math.ceil(e/t)*t}class ba extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e}}ba.prototype.bytesPerElement=4,Ti("StructArrayLayout2i4",ba);class wa extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){let i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e}}wa.prototype.bytesPerElement=6,Ti("StructArrayLayout3i6",wa);class Ta extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){let a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,e}}Ta.prototype.bytesPerElement=8,Ti("StructArrayLayout4i8",Ta);class ka extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,o){let s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e}}ka.prototype.bytesPerElement=12,Ti("StructArrayLayout2i4i12",ka);class Aa extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,o){let s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,e}}Aa.prototype.bytesPerElement=8,Ti("StructArrayLayout2i4ub8",Aa);class Ma extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e}}Ma.prototype.bytesPerElement=8,Ti("StructArrayLayout2f8",Ma);class Sa extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,o,s,l,c){let u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,n,i,a,o,s,l,c)}emplace(e,t,r,n,i,a,o,s,l,c,u){let h=10*e;return this.uint16[h+0]=t,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,e}}Sa.prototype.bytesPerElement=20,Ti("StructArrayLayout10ui20",Sa);class Ea extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,o,s,l,c,u,h){let f=this.length;return this.resize(f+1),this.emplace(f,e,t,r,n,i,a,o,s,l,c,u,h)}emplace(e,t,r,n,i,a,o,s,l,c,u,h,f){let p=12*e;return this.int16[p+0]=t,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=f,e}}Ea.prototype.bytesPerElement=24,Ti("StructArrayLayout4i4ui4i24",Ea);class Ca extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){let i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e}}Ca.prototype.bytesPerElement=12,Ti("StructArrayLayout3f12",Ca);class Ia extends va{_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}}Ia.prototype.bytesPerElement=4,Ti("StructArrayLayout1ul4",Ia);class La extends va{_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,r,n,i,a,o,s,l){let c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,i,a,o,s,l)}emplace(e,t,r,n,i,a,o,s,l,c){let u=10*e,h=5*e;return this.int16[u+0]=t,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,e}}La.prototype.bytesPerElement=20,Ti("StructArrayLayout6i1ul2ui20",La);class Pa extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,o){let s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e}}Pa.prototype.bytesPerElement=12,Ti("StructArrayLayout2i2i2i12",Pa);class za extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i)}emplace(e,t,r,n,i,a){let o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,e}}za.prototype.bytesPerElement=16,Ti("StructArrayLayout2f1f2i16",za);class Da extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,o){let s=16*e,l=4*e,c=8*e;return this.uint8[s+0]=t,this.uint8[s+1]=r,this.float32[l+1]=n,this.float32[l+2]=i,this.int16[c+6]=a,this.int16[c+7]=o,e}}Da.prototype.bytesPerElement=16,Ti("StructArrayLayout2ub2f2i16",Da);class Oa extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){let i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e}}Oa.prototype.bytesPerElement=6,Ti("StructArrayLayout3ui6",Oa);class Ra extends va{_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,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g){let y=this.length;return this.resize(y+1),this.emplace(y,e,t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g)}emplace(e,t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y){let v=24*e,x=12*e,_=48*e;return this.int16[v+0]=t,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=f,this.uint8[_+36]=p,this.uint8[_+37]=d,this.uint8[_+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,e}}Ra.prototype.bytesPerElement=48,Ti("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ra);class Fa extends va{_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,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S){let E=this.length;return this.resize(E+1),this.emplace(E,e,t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S)}emplace(e,t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E){let C=32*e,I=16*e;return this.int16[C+0]=t,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=u,this.uint16[C+10]=h,this.uint16[C+11]=f,this.uint16[C+12]=p,this.uint16[C+13]=d,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=_,this.uint16[C+20]=b,this.uint16[C+21]=w,this.uint16[C+22]=T,this.uint32[I+12]=k,this.float32[I+13]=A,this.float32[I+14]=M,this.uint16[C+30]=S,this.uint16[C+31]=E,e}}Fa.prototype.bytesPerElement=64,Ti("StructArrayLayout8i15ui1ul2f2ui64",Fa);class Ba extends va{_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}}Ba.prototype.bytesPerElement=4,Ti("StructArrayLayout1f4",Ba);class ja extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){let i=3*e;return this.uint16[6*e+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e}}ja.prototype.bytesPerElement=12,Ti("StructArrayLayout1ui2f12",ja);class Na extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){let i=4*e;return this.uint32[2*e+0]=t,this.uint16[i+2]=r,this.uint16[i+3]=n,e}}Na.prototype.bytesPerElement=8,Ti("StructArrayLayout1ul2ui8",Na);class Ua extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e}}Ua.prototype.bytesPerElement=4,Ti("StructArrayLayout2ui4",Ua);class Va extends va{_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}}Va.prototype.bytesPerElement=2,Ti("StructArrayLayout1ui2",Va);class qa extends va{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){let a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,e}}qa.prototype.bytesPerElement=16,Ti("StructArrayLayout4f16",qa);class Ha extends ya{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)}}Ha.prototype.size=20;class Ga extends La{get(e){return new Ha(this,e)}}Ti("CollisionBoxArray",Ga);class Wa extends ya{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]}}Wa.prototype.size=48;class Za extends Ra{get(e){return new Wa(this,e)}}Ti("PlacedSymbolArray",Za);class Ya extends ya{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]}}Ya.prototype.size=64;class Xa extends Fa{get(e){return new Ya(this,e)}}Ti("SymbolInstanceArray",Xa);class $a extends Ba{getoffsetX(e){return this.float32[1*e+0]}}Ti("GlyphOffsetArray",$a);class Ka extends wa{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Ti("SymbolLineVertexArray",Ka);class Ja extends ya{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]}}Ja.prototype.size=12;class Qa extends ja{get(e){return new Ja(this,e)}}Ti("TextAnchorOffsetArray",Qa);class eo extends ya{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]}}eo.prototype.size=8;class to extends Na{get(e){return new eo(this,e)}}Ti("FeatureIndexArray",to);class ro extends ba{}class no extends ba{}class io extends ba{}class ao extends ka{}class oo extends Aa{}class so extends Ma{}class lo extends Sa{}class co extends Ea{}class uo extends Ca{}class ho extends Ia{}class fo extends Pa{}class po extends Da{}class mo extends Oa{}class go extends Ua{}let yo=xa([{name:"a_pos",components:2,type:"Int16"}],4),{members:vo}=yo;class xo{constructor(e=[]){this.segments=e}prepareSegment(e,t,r,n){let i=this.segments[this.segments.length-1];return e>xo.MAX_VERTEX_ARRAY_LENGTH&&A(`Max vertices per segment is ${xo.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!i||i.vertexLength+e>xo.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),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,r,n){return new xo([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function _o(e,t){return 256*(e=y(Math.floor(e),0,255))+y(Math.floor(t),0,255)}xo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ti("SegmentVector",xo);let bo=xa([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var wo={exports:{}},To=function(e,t){var r,n,i,a,o,s,l,c;for(n=e.length-(r=3&e.length),i=t,o=3432918353,s=461845907,c=0;c<n;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,i=27492+(65535&(a=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>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},ko=function(e,t){for(var r,n=e.length,i=t^n,a=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){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};wo.exports=To,wo.exports.murmur3=To,wo.exports.murmur2=ko;var Ao=r(wo.exports);class Mo{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,r,n){this.ids.push(So(e)),this.positions.push(t,r,n)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let t=So(e),r=0,n=this.ids.length-1;for(;r<n;){let e=r+n>>1;this.ids[e]>=t?n=e:r=e+1}let i=[];for(;this.ids[r]===t;)i.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return i}static serialize(e,t){let r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Eo(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}}static deserialize(e){let t=new Mo;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}}function So(e){let t=+e;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:Ao(String(e))}function Eo(e,t,r,n){for(;r<n;){let i=e[r+n>>1],a=r-1,o=n+1;for(;;){do{a++}while(e[a]<i);do{o--}while(e[o]>i);if(a>=o)break;Co(e,a,o),Co(t,3*a,3*o),Co(t,3*a+1,3*o+1),Co(t,3*a+2,3*o+2)}o-r<n-o?(Eo(e,t,r,o),r=o+1):(Eo(e,t,o+1,n),n=o)}}function Co(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}Ti("FeaturePositionMap",Mo);class Io{constructor(e,t){this.gl=e.gl,this.location=t}}class Lo extends Io{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class Po extends Io{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 zo extends Io{constructor(e,t){super(e,t),this.current=Xe.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 Do=new Float32Array(16);function Oo(e){return[_o(255*e.r,255*e.g),_o(255*e.b,255*e.a)]}class Ro{constructor(e,t,r){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=r}setUniform(e,t,r){e.set(r.constantOr(this.value))}getBinding(e,t,r){return"color"===this.type?new zo(e,t):new Lo(e,t)}}class Fo{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,r,n){let i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&e.set(i)}getBinding(e,t,r){return"u_pattern"===r.substr(0,9)?new Po(e,t):new Lo(e,t)}}class Bo{constructor(e,t,r,n){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(e,t,r,n,i){let a=this.paintVertexArray.length,o=this.expression.evaluate(new Qi(0),t,{},n,[],i);this.paintVertexArray.resize(e),this._setPaintValue(a,e,o)}updatePaintArray(e,t,r,n){let i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(e,t,i)}_setPaintValue(e,t,r){if("color"===this.type){let n=Oo(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r);this.maxValue=Math.max(this.maxValue,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()}}class jo{constructor(e,t,r,n,i,a){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new a}populatePaintArray(e,t,r,n,i){let a=this.expression.evaluate(new Qi(this.zoom),t,{},n,[],i),o=this.expression.evaluate(new Qi(this.zoom+1),t,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(s,e,a,o)}updatePaintArray(e,t,r,n){let i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(e,t,i,a)}_setPaintValue(e,t,r,n){if("color"===this.type){let i=Oo(r),a=Oo(n);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1],a[0],a[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),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()}setUniform(e,t){let r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,n=y(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(n)}getBinding(e,t,r){return new Lo(e,t)}}class No{constructor(e,t,r,n,i,a){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=n,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i}populatePaintArray(e,t,r){let n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(n,e,t.patterns&&t.patterns[this.layerId],r)}updatePaintArray(e,t,r,n,i){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],i)}_setPaintValues(e,t,r,n){if(!n||!r)return;let{min:i,mid:a,max:o}=r,s=n[i],l=n[a],c=n[o];if(s&&l&&c)for(let r=e;r<t;r++)this.zoomInPaintVertexArray.emplace(r,l.tl[0],l.tl[1],l.br[0],l.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],l.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(r,l.tl[0],l.tl[1],l.br[0],l.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],l.pixelRatio,c.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,bo.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,bo.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Uo{constructor(e,t,r){this.binders={},this._buffers=[];let n=[];for(let i in e.paint._values){if(!r(i))continue;let a=e.paint.get(i);if(!(a instanceof oa&&ln(a.property.specification)))continue;let o=qo(i,e.type),s=a.value,l=a.property.specification.type,c=a.property.useIntegerZoom,u=a.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===s.kind)this.binders[i]=h?new Fo(s.value,o):new Ro(s.value,o,l),n.push(`/u_${i}`);else if("source"===s.kind||h){let r=Ho(i,l,"source");this.binders[i]=h?new No(s,l,c,t,r,e.id):new Bo(s,o,l,r),n.push(`/a_${i}`)}else{let e=Ho(i,l,"composite");this.binders[i]=new jo(s,o,l,c,t,e),n.push(`/z_${i}`)}}this.cacheKey=n.sort().join("")}getMaxValue(e){let t=this.binders[e];return t instanceof Bo||t instanceof jo?t.maxValue:0}populatePaintArrays(e,t,r,n,i){for(let a in this.binders){let o=this.binders[a];(o instanceof Bo||o instanceof jo||o instanceof No)&&o.populatePaintArray(e,t,r,n,i)}}setConstantPatternPositions(e,t){for(let r in this.binders){let n=this.binders[r];n instanceof Fo&&n.setConstantPatternPositions(e,t)}}updatePaintArrays(e,t,r,n,i){let a=!1;for(let o in e){let s=t.getPositions(o);for(let t of s){let s=r.feature(t.index);for(let r in this.binders){let l=this.binders[r];if((l instanceof Bo||l instanceof jo||l instanceof No)&&!0===l.expression.isStateDependent){let c=n.paint.get(r);l.expression=c.value,l.updatePaintArray(t.start,t.end,s,e[o],i),a=!0}}}}return a}defines(){let e=[];for(let t in this.binders){let r=this.binders[t];(r instanceof Ro||r instanceof Fo)&&e.push(...r.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof Bo||r instanceof jo)for(let t=0;t<r.paintVertexAttributes.length;t++)e.push(r.paintVertexAttributes[t].name);else if(r instanceof No)for(let t=0;t<bo.members.length;t++)e.push(bo.members[t].name)}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof Ro||r instanceof Fo||r instanceof jo)for(let t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let r=[];for(let n in this.binders){let i=this.binders[n];if(i instanceof Ro||i instanceof Fo||i instanceof jo)for(let a of i.uniformNames)if(t[a]){let o=i.getBinding(e,t[a],a);r.push({name:a,property:n,binding:o})}}return r}setUniforms(e,t,r,n){for(let{name:e,property:i,binding:a}of t)this.binders[i].setUniform(a,n,r.get(i),e)}updatePaintBuffers(e){this._buffers=[];for(let t in this.binders){let r=this.binders[t];if(e&&r instanceof No){let t=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else(r instanceof Bo||r instanceof jo)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(let t in this.binders){let r=this.binders[t];(r instanceof Bo||r instanceof jo||r instanceof No)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof Bo||t instanceof jo||t instanceof No)&&t.destroy()}}}class Vo{constructor(e,t,r=()=>!0){this.programConfigurations={};for(let n of e)this.programConfigurations[n.id]=new Uo(n,t,r);this.needsUpload=!1,this._featureMap=new Mo,this._bufferOffset=0}populatePaintArrays(e,t,r,n,i,a){for(let r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,n,i,a);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,n){for(let i of r)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(e,this._featureMap,t,i,n)||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 qo(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 Ho(e,t,r){let n={color:{source:Ma,composite:qa},number:{source:Ba,composite:Ma}},i={"line-pattern":{source:lo,composite:lo},"fill-pattern":{source:lo,composite:lo},"fill-extrusion-pattern":{source:lo,composite:lo}}[e];return i&&i[r]||n[t][r]}Ti("ConstantBinder",Ro),Ti("CrossFadedConstantBinder",Fo),Ti("SourceExpressionBinder",Bo),Ti("CrossFadedCompositeBinder",No),Ti("CompositeExpressionBinder",jo),Ti("ProgramConfiguration",Uo,{omit:["_buffers"]}),Ti("ProgramConfigurationSet",Vo);let Go,Wo,Zo=8192,Yo=Math.pow(2,14)-1,Xo=-Yo-1;function $o(e){let t=Zo/e.extent,r=e.loadGeometry();for(let e=0;e<r.length;e++){let n=r[e];for(let e=0;e<n.length;e++){let r=n[e],i=Math.round(r.x*t),a=Math.round(r.y*t);r.x=y(i,Xo,Yo),r.y=y(a,Xo,Yo),(i<r.x||i>r.x+1||a<r.y||a>r.y+1)&&A("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function Ko(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?$o(e):[]}}function Jo(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}class Qo{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 no,this.indexArray=new mo,this.segments=new xo,this.programConfigurations=new Vo(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){let n=this.layers[0],i=[],a=null,o=!1;"circle"===n.type&&(a=n.layout.get("circle-sort-key"),o=!a.isConstant());for(let{feature:t,id:n,index:s,sourceLayerIndex:l}of e){let e=this.layers[0]._featureFilter.needGeometry,c=Ko(t,e);if(!this.layers[0]._featureFilter.filter(new Qi(this.zoom),c,r))continue;let u=o?a.evaluate(c,{},r):void 0,h={id:n,properties:t.properties,type:t.type,sourceLayerIndex:l,index:s,geometry:e?c.geometry:$o(t),patterns:{},sortKey:u};i.push(h)}o&&i.sort(((e,t)=>e.sortKey-t.sortKey));for(let n of i){let{geometry:i,index:a,sourceLayerIndex:o}=n,s=e[a].feature;this.addFeature(n,i,a,r),t.featureIndex.insert(s,i,a,o,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,vo),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,r,n){for(let r of t)for(let t of r){let r=t.x,n=t.y;if(r<0||r>=Zo||n<0||n>=Zo)continue;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=i.vertexLength;Jo(this.layoutVertexArray,r,n,-1,-1),Jo(this.layoutVertexArray,r,n,1,-1),Jo(this.layoutVertexArray,r,n,1,1),Jo(this.layoutVertexArray,r,n,-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,r,{},n)}}function es(e,t){for(let r=0;r<e.length;r++)if(cs(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(cs(e,t[r]))return!0;return!!is(e,t)}function ts(e,t,r){return!!cs(e,t)||!!os(t,e,r)}function rs(e,t){if(1===e.length)return ls(t,e[0]);for(let r=0;r<t.length;r++){let n=t[r];for(let t=0;t<n.length;t++)if(cs(e,n[t]))return!0}for(let r=0;r<e.length;r++)if(ls(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(is(e,t[r]))return!0;return!1}function ns(e,t,r){if(e.length>1){if(is(e,t))return!0;for(let n=0;n<t.length;n++)if(os(t[n],e,r))return!0}for(let n=0;n<e.length;n++)if(os(e[n],t,r))return!0;return!1}function is(e,t){if(0===e.length||0===t.length)return!1;for(let r=0;r<e.length-1;r++){let n=e[r],i=e[r+1];for(let e=0;e<t.length-1;e++)if(as(n,i,t[e],t[e+1]))return!0}return!1}function as(e,t,r,n){return M(e,r,n)!==M(t,r,n)&&M(e,t,r)!==M(e,t,n)}function os(e,t,r){let n=r*r;if(1===t.length)return e.distSqr(t[0])<n;for(let r=1;r<t.length;r++)if(ss(e,t[r-1],t[r])<n)return!0;return!1}function ss(e,t,r){let n=t.distSqr(r);if(0===n)return e.distSqr(t);let i=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/n;return e.distSqr(i<0?t:i>1?r:r.sub(t)._mult(i)._add(t))}function ls(e,t){let r,n,i,a=!1;for(let o=0;o<e.length;o++){r=e[o];for(let e=0,o=r.length-1;e<r.length;o=e++)n=r[e],i=r[o],n.y>t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function cs(e,t){let r=!1;for(let n=0,i=e.length-1;n<e.length;i=n++){let a=e[n],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&&(r=!r)}return r}function us(e,t,r){let n=r[0],i=r[2];if(e.x<n.x&&t.x<n.x||e.x>i.x&&t.x>i.x||e.y<n.y&&t.y<n.y||e.y>i.y&&t.y>i.y)return!1;let a=M(e,t,r[0]);return a!==M(e,t,r[1])||a!==M(e,t,r[2])||a!==M(e,t,r[3])}function hs(e,t,r){let n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function fs(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function ps(e,t,r,n,i){if(!t[0]&&!t[1])return e;let o=a.convert(t)._mult(i);"viewport"===r&&o._rotate(-n);let s=[];for(let t=0;t<e.length;t++)s.push(e[t].sub(o));return s}Ti("CircleBucket",Qo,{omit:["layers"]});var ds={get paint(){return Wo=Wo||new pa({"circle-radius":new ca(Y.paint_circle["circle-radius"]),"circle-color":new ca(Y.paint_circle["circle-color"]),"circle-blur":new ca(Y.paint_circle["circle-blur"]),"circle-opacity":new ca(Y.paint_circle["circle-opacity"]),"circle-translate":new la(Y.paint_circle["circle-translate"]),"circle-translate-anchor":new la(Y.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new la(Y.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new la(Y.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ca(Y.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ca(Y.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ca(Y.paint_circle["circle-stroke-opacity"])})},get layout(){return Go=Go||new pa({"circle-sort-key":new ca(Y.layout_circle["circle-sort-key"])})}},ms=1e-6,gs=typeof Float32Array<"u"?Float32Array:Array;function ys(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 vs(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],f=t[9],p=t[10],d=t[11],m=t[12],g=t[13],y=t[14],v=t[15],x=r[0],_=r[1],b=r[2],w=r[3];return e[0]=x*n+_*s+b*h+w*m,e[1]=x*i+_*l+b*f+w*g,e[2]=x*a+_*c+b*p+w*y,e[3]=x*o+_*u+b*d+w*v,e[4]=(x=r[4])*n+(_=r[5])*s+(b=r[6])*h+(w=r[7])*m,e[5]=x*i+_*l+b*f+w*g,e[6]=x*a+_*c+b*p+w*y,e[7]=x*o+_*u+b*d+w*v,e[8]=(x=r[8])*n+(_=r[9])*s+(b=r[10])*h+(w=r[11])*m,e[9]=x*i+_*l+b*f+w*g,e[10]=x*a+_*c+b*p+w*y,e[11]=x*o+_*u+b*d+w*v,e[12]=(x=r[12])*n+(_=r[13])*s+(b=r[14])*h+(w=r[15])*m,e[13]=x*i+_*l+b*f+w*g,e[14]=x*a+_*c+b*p+w*y,e[15]=x*o+_*u+b*d+w*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 xs,_s=vs;function bs(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}xs=new gs(4),gs!=Float32Array&&(xs[0]=0,xs[1]=0,xs[2]=0,xs[3]=0);class ws extends ma{constructor(e){super(e,ds)}createBucket(e){return new Qo(e)}queryRadius(e){let t=e;return hs("circle-radius",this,t)+hs("circle-stroke-width",this,t)+fs(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,r,n,i,a,o,s){let l=ps(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:(p=s,l.map((e=>Ts(e,p)))),f=u?c*o:c;var p;for(let e of n)for(let t of e){let e=u?t:Ts(t,s),r=f,n=bs([],[t.x,t.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?r*=n[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(r*=a.cameraToCenterDistance/n[3]),ts(h,e,r))return!0}return!1}}function Ts(e,t){let r=bs([],[e.x,e.y,0,1],t);return new a(r[0]/r[3],r[1]/r[3])}class ks extends Qo{}let As;Ti("HeatmapBucket",ks,{omit:["layers"]});var Ms={get paint(){return As=As||new pa({"heatmap-radius":new ca(Y.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ca(Y.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new la(Y.paint_heatmap["heatmap-intensity"]),"heatmap-color":new fa(Y.paint_heatmap["heatmap-color"]),"heatmap-opacity":new la(Y.paint_heatmap["heatmap-opacity"])})}};function Ss(e,{width:t,height:r},n,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==t*r*n)throw new RangeError(`mismatched image size. expected: ${i.length} but got: ${t*r*n}`)}else i=new Uint8Array(t*r*n);return e.width=t,e.height=r,e.data=i,e}function Es(e,{width:t,height:r},n){if(t===e.width&&r===e.height)return;let i=Ss({},{width:t,height:r},n);Cs(e,i,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,r)},n),e.width=t,e.height=r,e.data=i.data}function Cs(e,t,r,n,i,a){if(0===i.width||0===i.height)return t;if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");let o=e.data,s=t.data;if(o===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<i.height;l++){let c=((r.y+l)*e.width+r.x)*a,u=((n.y+l)*t.width+n.x)*a;for(let e=0;e<i.width*a;e++)s[u+e]=o[c+e]}return t}class Is{constructor(e,t){Ss(this,e,1,t)}resize(e){Es(this,e,1)}clone(){return new Is({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i){Cs(e,t,r,n,i,1)}}class Ls{constructor(e,t){Ss(this,e,4,t)}resize(e){Es(this,e,4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Ls({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i){Cs(e,t,r,n,i,4)}}function Ps(e){let t={},r=e.resolution||256,n=e.clips?e.clips.length:1,i=e.image||new Ls({width:r,height:n});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);let a=(r,n,a)=>{t[e.evaluationKey]=a;let o=e.expression.evaluate(t);i.data[r+n+0]=Math.floor(255*o.r/o.a),i.data[r+n+1]=Math.floor(255*o.g/o.a),i.data[r+n+2]=Math.floor(255*o.b/o.a),i.data[r+n+3]=Math.floor(255*o.a)};if(e.clips)for(let t=0,i=0;t<n;++t,i+=4*r)for(let n=0,o=0;n<r;n++,o+=4){let s=n/(r-1),{start:l,end:c}=e.clips[t];a(i,o,l*(1-s)+c*s)}else for(let e=0,t=0;e<r;e++,t+=4)a(0,t,e/(r-1));return i}Ti("AlphaImage",Is),Ti("RGBAImage",Ls);let zs,Ds="big-fb";class Os extends ma{createBucket(e){return new ks(e)}constructor(e){super(e,Ms),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Ps({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Ds)&&this.heatmapFbos.delete(Ds)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}var Rs={get paint(){return zs=zs||new pa({"hillshade-illumination-direction":new la(Y.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new la(Y.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new la(Y.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new la(Y.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new la(Y.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new la(Y.paint_hillshade["hillshade-accent-color"])})}};class Fs extends ma{constructor(e){super(e,Rs)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}let Bs,js,Ns=xa([{name:"a_pos",components:2,type:"Int16"}],4),{members:Us}=Ns;function Vs(e,t,r=2){let n,i,a,o=t&&t.length,s=o?t[0]*r:e.length,l=qs(e,0,s,r,!0),c=[];if(!l||l.next===l.prev)return c;if(o&&(l=function(e,t,r,n){let i=[];for(let r=0,a=t.length;r<a;r++){let o=qs(e,t[r]*n,r<a-1?t[r+1]*n:e.length,n,!1);o===o.next&&(o.steiner=!0),i.push(el(o))}i.sort($s);for(let e=0;e<i.length;e++)r=Ks(i[e],r);return r}(e,t,l,r)),e.length>80*r){n=1/0,i=1/0;let t=-1/0,o=-1/0;for(let a=r;a<s;a+=r){let r=e[a],s=e[a+1];r<n&&(n=r),s<i&&(i=s),r>t&&(t=r),s>o&&(o=s)}a=Math.max(t-n,o-i),a=0!==a?32767/a:0}return Gs(l,c,r,n,i,a,0),c}function qs(e,t,r,n,i){let a;if(i===function(e,t,r,n){let i=0;for(let a=t,o=r-n;a<r;a+=n)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,r,n)>0)for(let i=t;i<r;i+=n)a=ul(i/n|0,e[i],e[i+1],a);else for(let i=r-n;i>=t;i-=n)a=ul(i/n|0,e[i],e[i+1],a);return a&&il(a,a.next)&&(hl(a),a=a.next),a}function Hs(e,t){if(!e)return e;t||(t=e);let r,n=e;do{if(r=!1,n.steiner||!il(n,n.next)&&0!==nl(n.prev,n,n.next))n=n.next;else{if(hl(n),n=t=n.prev,n===n.next)break;r=!0}}while(r||n!==t);return t}function Gs(e,t,r,n,i,a,o){if(!e)return;!o&&a&&function(e,t,r,n){let i=e;do{0===i.z&&(i.z=Qs(i.x,i.y,t,r,n)),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,r=1;do{let n,i=e;e=null;let a=null;for(t=0;i;){t++;let o=i,s=0;for(let e=0;e<r&&(s++,o=o.nextZ,o);e++);let l=r;for(;s>0||l>0&&o;)0!==s&&(0===l||!o||i.z<=o.z)?(n=i,i=i.nextZ,s--):(n=o,o=o.nextZ,l--),a?a.nextZ=n:e=n,n.prevZ=a,a=n;i=o}a.nextZ=null,r*=2}while(t>1)}(i)}(e,n,i,a);let s=e;for(;e.prev!==e.next;){let l=e.prev,c=e.next;if(a?Zs(e,n,i,a):Ws(e))t.push(l.i,e.i,c.i),hl(e),e=c.next,s=c.next;else if((e=c)===s){o?1===o?Gs(e=Ys(Hs(e),t),t,r,n,i,a,2):2===o&&Xs(e,t,r,n,i,a):Gs(Hs(e),t,r,n,i,a,1);break}}}function Ws(e){let t=e.prev,r=e,n=e.next;if(nl(t,r,n)>=0)return!1;let i=t.x,a=r.x,o=n.x,s=t.y,l=r.y,c=n.y,u=i<a?i<o?i:o:a<o?a:o,h=s<l?s<c?s:c:l<c?l:c,f=i>a?i>o?i:o:a>o?a:o,p=s>l?s>c?s:c:l>c?l:c,d=n.next;for(;d!==t;){if(d.x>=u&&d.x<=f&&d.y>=h&&d.y<=p&&tl(i,s,a,l,o,c,d.x,d.y)&&nl(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Zs(e,t,r,n){let i=e.prev,a=e,o=e.next;if(nl(i,a,o)>=0)return!1;let s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,f=o.y,p=s<l?s<c?s:c:l<c?l:c,d=u<h?u<f?u:f:h<f?h:f,m=s>l?s>c?s:c:l>c?l:c,g=u>h?u>f?u:f:h>f?h:f,y=Qs(p,d,t,r,n),v=Qs(m,g,t,r,n),x=e.prevZ,_=e.nextZ;for(;x&&x.z>=y&&_&&_.z<=v;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=g&&x!==i&&x!==o&&tl(s,u,l,h,c,f,x.x,x.y)&&nl(x.prev,x,x.next)>=0||(x=x.prevZ,_.x>=p&&_.x<=m&&_.y>=d&&_.y<=g&&_!==i&&_!==o&&tl(s,u,l,h,c,f,_.x,_.y)&&nl(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;x&&x.z>=y;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=g&&x!==i&&x!==o&&tl(s,u,l,h,c,f,x.x,x.y)&&nl(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;_&&_.z<=v;){if(_.x>=p&&_.x<=m&&_.y>=d&&_.y<=g&&_!==i&&_!==o&&tl(s,u,l,h,c,f,_.x,_.y)&&nl(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function Ys(e,t){let r=e;do{let n=r.prev,i=r.next.next;!il(n,i)&&al(n,r,r.next,i)&&ll(n,i)&&ll(i,n)&&(t.push(n.i,r.i,i.i),hl(r),hl(r.next),r=e=i),r=r.next}while(r!==e);return Hs(r)}function Xs(e,t,r,n,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&rl(o,e)){let s=cl(o,e);return o=Hs(o,o.next),s=Hs(s,s.next),Gs(o,t,r,n,i,a,0),void Gs(s,t,r,n,i,a,0)}e=e.next}o=o.next}while(o!==e)}function $s(e,t){return e.x-t.x}function Ks(e,t){let r=function(e,t){let r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){let e=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=i&&e>o&&(o=e,r=n.x<n.next.x?n:n.next,e===i))return r}n=n.next}while(n!==t);if(!r)return null;let s=r,l=r.x,c=r.y,u=1/0;n=r;do{if(i>=n.x&&n.x>=l&&i!==n.x&&tl(a<c?i:o,a,l,c,a<c?o:i,a,n.x,n.y)){let t=Math.abs(a-n.y)/(i-n.x);ll(n,e)&&(t<u||t===u&&(n.x>r.x||n.x===r.x&&Js(r,n)))&&(r=n,u=t)}n=n.next}while(n!==s);return r}(e,t);if(!r)return t;let n=cl(r,e);return Hs(n,n.next),Hs(r,r.next)}function Js(e,t){return nl(e.prev,e,t.prev)<0&&nl(t.next,e,e.next)<0}function Qs(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function el(e){let t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function tl(e,t,r,n,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(n-s)>=(r-o)*(t-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function rl(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&al(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(ll(e,t)&&ll(t,e)&&function(e,t){let r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(nl(e.prev,e,t.prev)||nl(e,t.prev,t))||il(e,t)&&nl(e.prev,e,e.next)>0&&nl(t.prev,t,t.next)>0)}function nl(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function il(e,t){return e.x===t.x&&e.y===t.y}function al(e,t,r,n){let i=sl(nl(e,t,r)),a=sl(nl(e,t,n)),o=sl(nl(r,n,e)),s=sl(nl(r,n,t));return i!==a&&o!==s||!(0!==i||!ol(e,r,t))||!(0!==a||!ol(e,n,t))||!(0!==o||!ol(r,e,n))||!(0!==s||!ol(r,t,n))}function ol(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function sl(e){return e>0?1:e<0?-1:0}function ll(e,t){return nl(e.prev,e,e.next)<0?nl(e,t,e.next)>=0&&nl(e,e.prev,t)>=0:nl(e,t,e.prev)<0||nl(e,e.next,t)<0}function cl(e,t){let r=fl(e.i,e.x,e.y),n=fl(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function ul(e,t,r,n){let i=fl(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function hl(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 fl(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function pl(e,t,r){let n=r.patternDependencies,i=!1;for(let r of t){let t=r.paint.get(`${e}-pattern`);t.isConstant()||(i=!0);let a=t.constantOr(null);a&&(i=!0,n[a.to]=!0,n[a.from]=!0)}return i}function dl(e,t,r,n,i){let a=i.patternDependencies;for(let o of t){let t=o.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:n-1},r,{},i.availableImages),s=t.evaluate({zoom:n},r,{},i.availableImages),l=t.evaluate({zoom:n+1},r,{},i.availableImages);e=e&&e.name?e.name:e,s=s&&s.name?s.name:s,l=l&&l.name?l.name:l,a[e]=!0,a[s]=!0,a[l]=!0,r.patterns[o.id]={min:e,mid:s,max:l}}}return r}class ml{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 io,this.indexArray=new mo,this.indexArray2=new go,this.programConfigurations=new Vo(e.layers,e.zoom),this.segments=new xo,this.segments2=new xo,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=pl("fill",this.layers,t);let n=this.layers[0].layout.get("fill-sort-key"),i=!n.isConstant(),a=[];for(let{feature:o,id:s,index:l,sourceLayerIndex:c}of e){let e=this.layers[0]._featureFilter.needGeometry,u=Ko(o,e);if(!this.layers[0]._featureFilter.filter(new Qi(this.zoom),u,r))continue;let h=i?n.evaluate(u,{},r,t.availableImages):void 0,f={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:$o(o),patterns:{},sortKey:h};a.push(f)}i&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(let n of a){let{geometry:i,index:a,sourceLayerIndex:o}=n;if(this.hasPattern){let e=dl("fill",this.layers,n,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(n,i,a,r,{});t.featureIndex.insert(e[a].feature,i,a,o,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(let e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Us),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,r,n,i){for(let e of _r(t,500)){let t=0;for(let r of e)t+=r.length;let r=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),n=r.vertexLength,i=[],a=[];for(let t of e){if(0===t.length)continue;t!==e[0]&&a.push(i.length/2);let r=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),n=r.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(n+t.length-1,n),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(n+e-1,n+e),i.push(t[e].x),i.push(t[e].y);r.vertexLength+=t.length,r.primitiveLength+=t.length}let o=Vs(i,a);for(let e=0;e<o.length;e+=3)this.indexArray.emplaceBack(n+o[e],n+o[e+1],n+o[e+2]);r.vertexLength+=t,r.primitiveLength+=o.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)}}Ti("FillBucket",ml,{omit:["layers","patternFeatures"]});var gl={get paint(){return js=js||new pa({"fill-antialias":new la(Y.paint_fill["fill-antialias"]),"fill-opacity":new ca(Y.paint_fill["fill-opacity"]),"fill-color":new ca(Y.paint_fill["fill-color"]),"fill-outline-color":new ca(Y.paint_fill["fill-outline-color"]),"fill-translate":new la(Y.paint_fill["fill-translate"]),"fill-translate-anchor":new la(Y.paint_fill["fill-translate-anchor"]),"fill-pattern":new ua(Y.paint_fill["fill-pattern"])})},get layout(){return Bs=Bs||new pa({"fill-sort-key":new ca(Y.layout_fill["fill-sort-key"])})}};class yl extends ma{constructor(e){super(e,gl)}recalculate(e,t){super.recalculate(e,t);let r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new ml(e)}queryRadius(){return fs(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,r,n,i,a,o){return rs(ps(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)}isTileClipped(){return!0}}let vl=xa([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),xl=xa([{name:"a_centroid",components:2,type:"Int16"}],4),{members:_l}=vl;var bl={},wl=n,Tl=kl;function kl(e,t,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=i,e.readFields(Al,this,t)}function Al(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function Ml(e){for(var t,r,n=0,i=0,a=e.length,o=a-1;i<a;o=i++)n+=((r=e[o]).x-(t=e[i]).x)*(t.y+r.y);return n}kl.types=["Unknown","Point","LineString","Polygon"],kl.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,a=0,o=0,s=[];e.pos<r;){if(i<=0){var l=e.readVarint();n=7&l,i=l>>3}if(i--,1===n||2===n)a+=e.readSVarint(),o+=e.readSVarint(),1===n&&(t&&s.push(t),t=[]),t.push(new wl(a,o));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&s.push(t),s},kl.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;e.pos<t;){if(n<=0){var u=e.readVarint();r=7&u,n=u>>3}if(n--,1===r||2===r)(i+=e.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=e.readSVarint())<l&&(l=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},kl.prototype.toGeoJSON=function(e,t,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=kl.types[this.type];function u(e){for(var t=0;t<e.length;t++){var r=e[t];e[t]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/a)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,i=[],a=0;a<t;a++){var o=Ml(e[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[e[a]]):r.push(e[a]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)u(l[n][i])}1===l.length?l=l[0]:c="Multi"+c;var f={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(f.id=this.id),f};var Sl=Tl,El=Cl;function Cl(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(Il,this,t),this.length=this._features.length}function Il(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}Cl.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Sl(this._pbf,t,this.extent,this._keys,this._values)};var Ll=El;function Pl(e,t,r){if(3===e){var n=new Ll(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}bl.VectorTile=function(e,t){this.layers=e.readFields(Pl,{},t)},bl.VectorTileFeature=Tl,bl.VectorTileLayer=El;let zl,Dl=bl.VectorTileFeature.types,Ol=Math.pow(2,13);function Rl(e,t,r,n,i,a,o,s){e.emplaceBack(t,r,2*Math.floor(n*Ol)+o,i*Ol*2,a*Ol*2,Math.round(s))}class Fl{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 ao,this.centroidVertexArray=new ro,this.indexArray=new mo,this.programConfigurations=new Vo(e.layers,e.zoom),this.segments=new xo,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.features=[],this.hasPattern=pl("fill-extrusion",this.layers,t);for(let{feature:n,id:i,index:a,sourceLayerIndex:o}of e){let e=this.layers[0]._featureFilter.needGeometry,s=Ko(n,e);if(!this.layers[0]._featureFilter.filter(new Qi(this.zoom),s,r))continue;let l={id:i,sourceLayerIndex:o,index:a,geometry:e?s.geometry:$o(n),properties:n.properties,type:n.type,patterns:{}};this.hasPattern?this.features.push(dl("fill-extrusion",this.layers,l,this.zoom,t)):this.addFeature(l,l.geometry,a,r,{}),t.featureIndex.insert(n,l.geometry,a,o,this.index,!0)}}addFeatures(e,t,r){for(let e of this.features){let{geometry:n}=e;this.addFeature(e,n,e.index,t,r)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,_l),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,xl.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,r,n,i){for(let r of _r(t,500)){let t={x:0,y:0,vertexCount:0},n=0;for(let e of r)n+=e.length;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let e of r){if(0===e.length||jl(e))continue;let r=0;for(let n=0;n<e.length;n++){let a=e[n];if(n>=1){let o=e[n-1];if(!Bl(a,o)){i.vertexLength+4>xo.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let e=a.sub(o)._perp()._unit(),n=o.dist(a);r+n>32768&&(r=0),Rl(this.layoutVertexArray,a.x,a.y,e.x,e.y,0,0,r),Rl(this.layoutVertexArray,a.x,a.y,e.x,e.y,0,1,r),t.x+=2*a.x,t.y+=2*a.y,t.vertexCount+=2,r+=n,Rl(this.layoutVertexArray,o.x,o.y,e.x,e.y,0,0,r),Rl(this.layoutVertexArray,o.x,o.y,e.x,e.y,0,1,r),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+n>xo.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(n,this.layoutVertexArray,this.indexArray)),"Polygon"!==Dl[e.type])continue;let a=[],o=[],s=i.vertexLength;for(let e of r)if(0!==e.length){e!==r[0]&&o.push(a.length/2);for(let r=0;r<e.length;r++){let n=e[r];Rl(this.layoutVertexArray,n.x,n.y,0,0,1,1,0),t.x+=n.x,t.y+=n.y,t.vertexCount+=1,a.push(n.x),a.push(n.y)}}let l=Vs(a,o);for(let e=0;e<l.length;e+=3)this.indexArray.emplaceBack(s+l[e],s+l[e+2],s+l[e+1]);i.primitiveLength+=l.length/3,i.vertexLength+=n;for(let e=0;e<t.vertexCount;e++){let e=Math.floor(t.x/t.vertexCount),r=Math.floor(t.y/t.vertexCount);this.centroidVertexArray.emplaceBack(e,r)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)}}function Bl(e,t){return e.x===t.x&&(e.x<0||e.x>Zo)||e.y===t.y&&(e.y<0||e.y>Zo)}function jl(e){return e.every((e=>e.x<0))||e.every((e=>e.x>Zo))||e.every((e=>e.y<0))||e.every((e=>e.y>Zo))}Ti("FillExtrusionBucket",Fl,{omit:["layers","features"]});var Nl={get paint(){return zl=zl||new pa({"fill-extrusion-opacity":new la(Y["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ca(Y["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new la(Y["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new la(Y["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ua(Y["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ca(Y["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ca(Y["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new la(Y["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Ul extends ma{constructor(e){super(e,Nl)}createBucket(e){return new Fl(e)}queryRadius(){return fs(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,t,r,n,i,o,s,l){let c=ps(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,r),h=this.paint.get("fill-extrusion-base").evaluate(t,r),f=function(e,t){let r=[];for(let n of e){let e=[n.x,n.y,0,1];bs(e,e,t),r.push(new a(e[0]/e[3],e[1]/e[3]))}return r}(c,l),p=function(e,t,r,n){let i=[],o=[],s=n[8]*t,l=n[9]*t,c=n[10]*t,u=n[11]*t,h=n[8]*r,f=n[9]*r,p=n[10]*r,d=n[11]*r;for(let t of e){let e=[],r=[];for(let i of t){let t=i.x,o=i.y,m=n[0]*t+n[4]*o+n[12],g=n[1]*t+n[5]*o+n[13],y=n[2]*t+n[6]*o+n[14],v=n[3]*t+n[7]*o+n[15],x=y+c,_=v+u,b=m+h,w=g+f,T=y+p,k=v+d,A=new a((m+s)/_,(g+l)/_);A.z=x/_,e.push(A);let M=new a(b/k,w/k);M.z=T/k,r.push(M)}i.push(e),o.push(r)}return[i,o]}(n,h,u,l);return function(e,t,r){let n=1/0;rs(r,t)&&(n=ql(r,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];es(r,i)&&(n=Math.min(n,ql(r,i)))}}return n!==1/0&&n}(p[0],p[1],f)}}function Vl(e,t){return e.x*t.x+e.y*t.y}function ql(e,t){if(1===e.length){let r,n=0,i=t[n++];for(;!r||i.equals(r);)if(r=t[n++],!r)return 1/0;for(;n<t.length;n++){let a=t[n],o=e[0],s=r.sub(i),l=a.sub(i),c=o.sub(i),u=Vl(s,s),h=Vl(s,l),f=Vl(l,l),p=Vl(c,s),d=Vl(c,l),m=u*f-h*h,g=(f*p-h*d)/m,y=(u*d-h*p)/m,v=i.z*(1-g-y)+r.z*g+a.z*y;if(isFinite(v))return v}return 1/0}{let e=1/0;for(let r of t)e=Math.min(e,r.z);return e}}let Hl,Gl,Wl=xa([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Zl}=Wl,Yl=xa([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Xl}=Yl,$l=bl.VectorTileFeature.types,Kl=Math.cos(Math.PI/180*37.5),Jl=Math.pow(2,14)/.5;class Ql{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 oo,this.layoutVertexArray2=new so,this.indexArray=new mo,this.programConfigurations=new Vo(e.layers,e.zoom),this.segments=new xo,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=pl("line",this.layers,t);let n=this.layers[0].layout.get("line-sort-key"),i=!n.isConstant(),a=[];for(let{feature:t,id:o,index:s,sourceLayerIndex:l}of e){let e=this.layers[0]._featureFilter.needGeometry,c=Ko(t,e);if(!this.layers[0]._featureFilter.filter(new Qi(this.zoom),c,r))continue;let u=i?n.evaluate(c,{},r):void 0,h={id:o,properties:t.properties,type:t.type,sourceLayerIndex:l,index:s,geometry:e?c.geometry:$o(t),patterns:{},sortKey:u};a.push(h)}i&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(let n of a){let{geometry:i,index:a,sourceLayerIndex:o}=n;if(this.hasPattern){let e=dl("line",this.layers,n,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(n,i,a,r,{});t.featureIndex.insert(e[a].feature,i,a,o,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(let e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Xl)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Zl),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,r,n,i){let a=this.layers[0].layout,o=a.get("line-join").evaluate(e,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let r of t)this.addLine(r,e,o,s,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)}addLine(e,t,r,n,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="Polygon"===$l[t.type],s=e.length;for(;s>=2&&e[s-1].equals(e[s-2]);)s--;let l=0;for(;l<s-1&&e[l].equals(e[l+1]);)l++;if(s<(o?3:2))return;"bevel"===r&&(i=1.05);let c,u,h,f,p,d=this.overscaling<=16?15*Zo/(512*this.overscaling):0,m=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray);this.e1=this.e2=-1,o&&(c=e[s-2],p=e[l].sub(c)._unit()._perp());for(let t=l;t<s;t++){if(h=t===s-1?o?e[l+1]:void 0:e[t+1],h&&e[t].equals(h))continue;p&&(f=p),c&&(u=c),c=e[t],p=h?h.sub(c)._unit()._perp():f,f=f||p;let g=f.add(p);0===g.x&&0===g.y||g._unit();let y=f.x*p.x+f.y*p.y,v=g.x*p.x+g.y*p.y,x=0!==v?1/v:1/0,_=2*Math.sqrt(2-2*v),b=v<Kl&&u&&h,w=f.x*p.y-f.y*p.x>0;if(b&&t>l){let e=c.dist(u);if(e>2*d){let t=c.sub(c.sub(u)._mult(d/e)._round());this.updateDistance(u,t),this.addCurrentVertex(t,f,0,0,m),u=t}}let T=u&&h,k=T?r:o?"butt":n;if(T&&"round"===k&&(x<a?k="miter":x<=2&&(k="fakeround")),"miter"===k&&x>i&&(k="bevel"),"bevel"===k&&(x>2&&(k="flipbevel"),x<i&&(k="miter")),u&&this.updateDistance(u,c),"miter"===k)g._mult(x),this.addCurrentVertex(c,g,0,0,m);else if("flipbevel"===k){if(x>100)g=p.mult(-1);else{let e=x*f.add(p).mag()/f.sub(p).mag();g._perp()._mult(e*(w?-1:1))}this.addCurrentVertex(c,g,0,0,m),this.addCurrentVertex(c,g.mult(-1),0,0,m)}else if("bevel"===k||"fakeround"===k){let e=-Math.sqrt(x*x-1),t=w?e:0,r=w?0:e;if(u&&this.addCurrentVertex(c,f,t,r,m),"fakeround"===k){let e=Math.round(180*_/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;if(.5!==r){let e=r-.5;r+=r*e*(r-1)*((1.0904+y*(y*(3.55645-1.43519*y)-3.2452))*e*e+(.848013+y*(.215638*y-1.06021)))}let n=p.sub(f)._mult(r)._add(f)._unit()._mult(w?-1:1);this.addHalfVertex(c,n.x,n.y,!1,w,0,m)}}h&&this.addCurrentVertex(c,p,-t,-r,m)}else if("butt"===k)this.addCurrentVertex(c,g,0,0,m);else if("square"===k){let e=u?1:-1;this.addCurrentVertex(c,g,e,e,m)}else"round"===k&&(u&&(this.addCurrentVertex(c,f,0,0,m),this.addCurrentVertex(c,f,1,1,m,!0)),h&&(this.addCurrentVertex(c,p,-1,-1,m,!0),this.addCurrentVertex(c,p,0,0,m)));if(b&&t<s-1){let e=c.dist(h);if(e>2*d){let t=c.add(h.sub(c)._mult(d/e)._round());this.updateDistance(c,t),this.addCurrentVertex(t,p,0,0,m),c=t}}}}addCurrentVertex(e,t,r,n,i,a=!1){let o=t.y*n-t.x,s=-t.y-t.x*n;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,a,!1,r,i),this.addHalfVertex(e,o,s,a,!0,-n,i),this.distance>Jl/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,r,n,i,a))}addHalfVertex({x:e,y:t},r,n,i,a,o,s){let l=.5*(this.lineClips?this.scaledDistance*(Jl-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(i?1:0),(t<<1)+(a?1:0),Math.round(63*r)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1)|(63&l)<<2,l>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let c=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),s.primitiveLength++),a?this.e2=c:this.e1=c}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()}}Ti("LineBucket",Ql,{omit:["layers","patternFeatures"]});var ec={get paint(){return Gl=Gl||new pa({"line-opacity":new ca(Y.paint_line["line-opacity"]),"line-color":new ca(Y.paint_line["line-color"]),"line-translate":new la(Y.paint_line["line-translate"]),"line-translate-anchor":new la(Y.paint_line["line-translate-anchor"]),"line-width":new ca(Y.paint_line["line-width"]),"line-gap-width":new ca(Y.paint_line["line-gap-width"]),"line-offset":new ca(Y.paint_line["line-offset"]),"line-blur":new ca(Y.paint_line["line-blur"]),"line-dasharray":new ha(Y.paint_line["line-dasharray"]),"line-pattern":new ua(Y.paint_line["line-pattern"]),"line-gradient":new fa(Y.paint_line["line-gradient"])})},get layout(){return Hl=Hl||new pa({"line-cap":new la(Y.layout_line["line-cap"]),"line-join":new ca(Y.layout_line["line-join"]),"line-miter-limit":new la(Y.layout_line["line-miter-limit"]),"line-round-limit":new la(Y.layout_line["line-round-limit"]),"line-sort-key":new ca(Y.layout_line["line-sort-key"])})}};class tc extends ca{possiblyEvaluate(e,t){return t=new Qi(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,n){return t=x({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,n)}}let rc;class nc extends ma{constructor(e){super(e,ec),this.gradientVersion=0,rc||(rc=new tc(ec.paint.properties["line-width"].specification),rc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){let e=this.gradientExpression();this.stepInterpolant=!(void 0===e._styleExpression)&&e._styleExpression.expression instanceof At,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=rc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Ql(e)}queryRadius(e){let t=e,r=ic(hs("line-width",this,t),hs("line-gap-width",this,t)),n=hs("line-offset",this,t);return r/2+Math.abs(n)+fs(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,r,n,i,o,s){let l=ps(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*ic(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),u=this.paint.get("line-offset").evaluate(t,r);return u&&(n=function(e,t){let r=[];for(let n=0;n<e.length;n++){let i=e[n],o=[];for(let e=0;e<i.length;e++){let r=i[e-1],n=i[e],s=i[e+1],l=0===e?new a(0,0):n.sub(r)._unit()._perp(),c=e===i.length-1?new a(0,0):s.sub(n)._unit()._perp(),u=l._add(c)._unit(),h=u.x*c.x+u.y*c.y;0!==h&&u._mult(1/h),o.push(u._mult(t)._add(n))}r.push(o)}return r}(n,u*s)),function(e,t,r){for(let n=0;n<t.length;n++){let i=t[n];if(e.length>=3)for(let t=0;t<i.length;t++)if(cs(e,i[t]))return!0;if(ns(e,i,r))return!0}return!1}(l,n,c)}isTileClipped(){return!0}}function ic(e,t){return t>0?t+2*e:e}let ac=xa([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),oc=xa([{name:"a_projected_pos",components:3,type:"Float32"}],4);xa([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let sc=xa([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);xa([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let lc=xa([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),cc=xa([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function uc(e,t,r){return e.sections.forEach((e=>{e.text=function(e,t,r){let n=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),Ji.applyArabicShaping&&(e=Ji.applyArabicShaping(e)),e}(e.text,t,r)})),e}xa([{name:"triangle",components:3,type:"Uint16"}]),xa([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),xa([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),xa([{type:"Float32",name:"offsetX"}]),xa([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),xa([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let hc={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var fc=24,pc=gc,dc=function(e,t,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+e[t+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},mc=function(e,t,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=t<0||0===t&&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*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+p]=255&o,p+=d,o/=256,c-=8);e[r+p-d]|=128*m};function gc(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}gc.Varint=0,gc.Fixed64=1,gc.Bytes=2,gc.Fixed32=5;var yc=4294967296,vc=1/yc,xc=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function _c(e){return e.type===gc.Bytes?e.readVarint()+e.pos:e.pos+1}function bc(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function wc(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function Tc(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function kc(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Ac(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Mc(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Sc(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Ec(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Cc(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Ic(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Lc(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function Pc(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function zc(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}gc.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Lc(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=zc(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Lc(this.buf,this.pos)+Lc(this.buf,this.pos+4)*yc;return this.pos+=8,e},readSFixed64:function(){var e=Lc(this.buf,this.pos)+zc(this.buf,this.pos+4)*yc;return this.pos+=8,e},readFloat:function(){var e=dc(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=dc(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128||(n|=(127&(i=a[r.pos++]))<<3,i<128)||(n|=(127&(i=a[r.pos++]))<<10,i<128)||(n|=(127&(i=a[r.pos++]))<<17,i<128)||(n|=(127&(i=a[r.pos++]))<<24,i<128)||(n|=(1&(i=a[r.pos++]))<<31,i<128))return function(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[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,t,r,n=this.readVarint()+this.pos,i=this.pos;return this.pos=n,n-i>=12&&xc?(e=this.buf,t=i,r=n,xc.decode(e.subarray(t,r))):function(e,t,r){for(var n="",i=t;i<r;){var a,o,s,l=e[i],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=e[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(o=e[i+2],128==(192&(a=e[i+1]))&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=e[i+2],s=e[i+3],128==(192&(a=e[i+1]))&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,i,n)},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!==gc.Bytes)return e.push(this.readVarint(t));var r=_c(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==gc.Bytes)return e.push(this.readSVarint());var t=_c(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==gc.Bytes)return e.push(this.readBoolean());var t=_c(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==gc.Bytes)return e.push(this.readFloat());var t=_c(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==gc.Bytes)return e.push(this.readDouble());var t=_c(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==gc.Bytes)return e.push(this.readFixed32());var t=_c(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==gc.Bytes)return e.push(this.readSFixed32());var t=_c(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==gc.Bytes)return e.push(this.readFixed64());var t=_c(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==gc.Bytes)return e.push(this.readSFixed64());var t=_c(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===gc.Varint)for(;this.buf[this.pos++]>127;);else if(t===gc.Bytes)this.pos=this.readVarint()+this.pos;else if(t===gc.Fixed32)this.pos+=4;else{if(t!==gc.Fixed64)throw new 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 r=new Uint8Array(t);r.set(this.buf),this.buf=r,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),Pc(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Pc(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Pc(this.buf,-1&e,this.pos),Pc(this.buf,Math.floor(e*vc),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Pc(this.buf,-1&e,this.pos),Pc(this.buf,Math.floor(e*vc),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,n,i,a;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),i=r,(a=t).buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,a.buf[a.pos]=127&(i>>>=7),function(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((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)))))}(n,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,r){for(var n,i,a=0;a<t.length;a++){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&bc(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),mc(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),mc(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 r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&bc(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,gc.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,wc,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Tc,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Mc,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,kc,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Ac,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Sc,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Ec,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Cc,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Ic,t)},writeBytesField:function(e,t){this.writeTag(e,gc.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,gc.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,gc.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,gc.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,gc.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,gc.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,gc.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,gc.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,gc.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,gc.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var Dc,Oc=r(pc);function Rc(e,t,r){1===e&&r.readMessage(Fc,t)}function Fc(e,t,r){if(3===e){let{id:e,bitmap:n,width:i,height:a,left:o,top:s,advance:l}=r.readMessage(Bc,{});t.push({id:e,bitmap:new Is({width:i+6,height:a+6},n),metrics:{width:i,height:a,left:o,top:s,advance:l}})}}function Bc(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function jc(e){let t=0,r=0;for(let n of e)t+=n.w*n.h,r=Math.max(r,n.w);e.sort(((e,t)=>t.h-e.h));let n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],i=0,a=0;for(let t of e)for(let e=n.length-1;e>=0;e--){let r=n[e];if(!(t.w>r.w||t.h>r.h)){if(t.x=r.x,t.y=r.y,a=Math.max(a,t.y+t.h),i=Math.max(i,t.x+t.w),t.w===r.w&&t.h===r.h){let t=n.pop();e<n.length&&(n[e]=t)}else t.h===r.h?(r.x+=t.w,r.w-=t.w):t.w===r.w?(r.y+=t.h,r.h-=t.h):(n.push({x:r.x+t.w,y:r.y,w:r.w-t.w,h:t.h}),r.y+=t.h,r.h-=t.h);break}}return{w:i,h:a,fill:t/(i*a)||0}}class Nc{constructor(e,{pixelRatio:t,version:r,stretchX:n,stretchY:i,content:a,textFitWidth:o,textFitHeight:s}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=n,this.stretchY=i,this.content=a,this.version=r,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 Uc{constructor(e,t){let r={},n={};this.haveRenderCallbacks=[];let i=[];this.addImages(e,r,i),this.addImages(t,n,i);let{w:a,h:o}=jc(i),s=new Ls({width:a||1,height:o||1});for(let t in e){let n=e[t],i=r[t].paddedRect;Ls.copy(n.data,s,{x:0,y:0},{x:i.x+1,y:i.y+1},n.data)}for(let e in t){let r=t[e],i=n[e].paddedRect,a=i.x+1,o=i.y+1,l=r.data.width,c=r.data.height;Ls.copy(r.data,s,{x:0,y:0},{x:a,y:o},r.data),Ls.copy(r.data,s,{x:0,y:c-1},{x:a,y:o-1},{width:l,height:1}),Ls.copy(r.data,s,{x:0,y:0},{x:a,y:o+c},{width:l,height:1}),Ls.copy(r.data,s,{x:l-1,y:0},{x:a-1,y:o},{width:1,height:c}),Ls.copy(r.data,s,{x:0,y:0},{x:a+l,y:o},{width:1,height:c})}this.image=s,this.iconPositions=r,this.patternPositions=n}addImages(e,t,r){for(let n in e){let i=e[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),t[n]=new Nc(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(e,t){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let r in e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}patchUpdatedImage(e,t,r){if(!e||!t||e.version===t.version)return;e.version=t.version;let[n,i]=e.tl;r.update(t.data,void 0,{x:n,y:i})}}Ti("ImagePosition",Nc),Ti("ImageAtlas",Uc),e.ah=void 0,(Dc=e.ah||(e.ah={}))[Dc.none=0]="none",Dc[Dc.horizontal=1]="horizontal",Dc[Dc.vertical=2]="vertical",Dc[Dc.horizontalOnly=3]="horizontalOnly";let Vc=-17;class qc{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,t){let r=new qc;return r.scale=e||1,r.fontStack=t,r}static forImage(e){let t=new qc;return t.imageName=e,t}}class Hc{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){let r=new Hc;for(let n=0;n<e.sections.length;n++){let i=e.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,t)}return r}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 r=0;r<e.length;r++){let n=e.charCodeAt(r+1)||null,i=e.charCodeAt(r-1)||null;t+=n&&Zi(n)&&!hc[e[r+1]]||i&&Zi(i)&&!hc[e[r-1]]||!hc[e[r]]?e[r]:hc[e[r]]}return t}(this.text)}trim(){let e=0;for(let t=0;t<this.text.length&&Wc[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let r=this.text.length-1;r>=0&&r>=e&&Wc[this.text.charCodeAt(r)];r--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){let r=new Hc;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r}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(qc.forText(e.scale,e.fontStack||t));let r=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(r)}addImageSection(e){let t=e.image?e.image.name:"";if(0===t.length)return void A("Can't add FormattedSection with an empty image.");let r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(qc.forImage(t)),this.sectionIndex.push(this.sections.length-1)):A("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Gc(t,r,n,i,a,o,s,l,c,u,h,f,p,d,m){let g,y=Hc.fromFeature(t,a);f===e.ah.vertical&&y.verticalizePunctuation();let{processBidirectionalText:v,processStyledBidirectionalText:x}=Ji;if(v&&1===y.sections.length){g=[];let e=v(y.toString(),eu(y,u,o,r,i,d));for(let t of e){let e=new Hc;e.text=t,e.sections=y.sections;for(let r=0;r<t.length;r++)e.sectionIndex.push(0);g.push(e)}}else if(x){g=[];let e=x(y.text,y.sectionIndex,eu(y,u,o,r,i,d));for(let t of e){let e=new Hc;e.text=t[0],e.sectionIndex=t[1],e.sections=y.sections,g.push(e)}}else g=function(e,t){let r=[],n=e.text,i=0;for(let n of t)r.push(e.substring(i,n)),i=n;return i<n.length&&r.push(e.substring(i,n.length)),r}(y,eu(y,u,o,r,i,d));let _=[],b={positionedLines:_,text:y.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:f,iconsInText:!1,verticalizable:!1};return function(t,r,n,i,a,o,s,l,c,u,h,f){let p=0,d=Vc,m=0,g=0,y="right"===l?1:"left"===l?0:.5,v=0;for(let s of a){s.trim();let a=s.getMaxScale(),l=(a-1)*fc,_={positionedGlyphs:[],lineOffset:0};t.positionedLines[v]=_;let b=_.positionedGlyphs,w=0;if(!s.length()){d+=o,++v;continue}for(let o=0;o<s.length();o++){let m=s.getSection(o),g=s.getSectionIndex(o),y=s.getCharCode(o),v=0,_=null,T=null,k=null,A=fc,M=!(c===e.ah.horizontal||!h&&!Wi(y)||h&&(Wc[y]||(x=y,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(x)))));if(m.imageName){let e=i[m.imageName];if(!e)continue;k=m.imageName,t.iconsInText=t.iconsInText||!0,T=e.paddedRect;let r=e.displaySize;m.scale=m.scale*fc/f,_={width:r[0],height:r[1],left:1,top:-3,advance:M?r[1]:r[0]},v=l+(fc-r[1]*m.scale),A=_.advance;let n=M?r[0]*m.scale-fc*a:r[1]*m.scale-fc*a;n>0&&n>w&&(w=n)}else{let e=n[m.fontStack],t=e&&e[y];if(t&&t.rect)T=t.rect,_=t.metrics;else{let e=r[m.fontStack],t=e&&e[y];if(!t)continue;_=t.metrics}v=(a-m.scale)*fc}M?(t.verticalizable=!0,b.push({glyph:y,imageName:k,x:p,y:d+v,vertical:M,scale:m.scale,fontStack:m.fontStack,sectionIndex:g,metrics:_,rect:T}),p+=A*m.scale+u):(b.push({glyph:y,imageName:k,x:p,y:d+v,vertical:M,scale:m.scale,fontStack:m.fontStack,sectionIndex:g,metrics:_,rect:T}),p+=_.advance*m.scale+u)}0!==b.length&&(m=Math.max(p-u,m),ru(b,0,b.length-1,y,w)),p=0;let T=o*a+w;_.lineOffset=Math.max(w,l),d+=T,g=Math.max(T,g),++v}var x;let _=d-Vc,{horizontalAlign:b,verticalAlign:w}=tu(s);(function(e,t,r,n,i,a,o,s,l){let c=(t-r)*i,u=0;u=a!==o?-s*n-Vc:(-n*l+.5)*o;for(let t of e)for(let e of t.positionedGlyphs)e.x+=c,e.y+=u})(t.positionedLines,y,b,w,m,g,o,_,a.length),t.top+=-w*_,t.bottom=t.top+_,t.left+=-b*m,t.right=t.left+m}(b,r,n,i,g,s,l,c,f,u,p,m),!function(e){for(let t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(_)&&b}let Wc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Zc={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},Yc={40:!0};function Xc(e,t,r,n,i,a){if(t.imageName){let e=n[t.imageName];return e?e.displaySize[0]*t.scale*fc/a+i:0}{let n=r[t.fontStack],a=n&&n[e];return a?a.metrics.advance*t.scale+i:0}}function $c(e,t,r,n){let i=Math.pow(e-t,2);return n?e<t?i/2:2*i:i+Math.abs(r)*r}function Kc(e,t,r){let n=0;return 10===e&&(n-=1e4),r&&(n+=150),40!==e&&65288!==e||(n+=50),41!==t&&65289!==t||(n+=50),n}function Jc(e,t,r,n,i,a){let o=null,s=$c(t,r,i,a);for(let e of n){let n=$c(t-e.x,r,i,a)+e.badness;n<=s&&(o=e,s=n)}return{index:e,x:t,priorBreak:o,badness:s}}function Qc(e){return e?Qc(e.priorBreak).concat(e.index):[]}function eu(e,t,r,n,i,a){if(!e)return[];let o=[],s=function(e,t,r,n,i,a){let o=0;for(let r=0;r<e.length();r++){let s=e.getSection(r);o+=Xc(e.getCharCode(r),s,n,i,t,a)}return o/Math.max(1,Math.ceil(o/r))}(e,t,r,n,i,a),l=e.text.indexOf("")>=0,c=0;for(let r=0;r<e.length();r++){let h=e.getSection(r),f=e.getCharCode(r);if(Wc[f]||(c+=Xc(f,h,n,i,t,a)),r<e.length()-1){let t=!((u=f)<11904)&&(!!Fi(u)||!!Oi(u)||!!zi(u)||!!Li(u)||!!Di(u)||!!ji(u)||!!Ii(u)||!!Ri(u)||Gi.test(String.fromCodePoint(u)));(Zc[f]||t||h.imageName||r!==e.length()-2&&Yc[e.getCharCode(r+1)])&&o.push(Jc(r+1,c,s,o,Kc(f,e.getCharCode(r+1),t&&l),!1))}}var u;return Qc(Jc(e.length(),c,s,o,0,!0))}function tu(e){let t=.5,r=.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":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function ru(e,t,r,n,i){if(!n&&!i)return;let a=e[r],o=(e[r].x+a.metrics.advance*a.scale)*n;for(let n=t;n<=r;n++)e[n].x-=o,e[n].y+=i}function nu(e,t,r){let{horizontalAlign:n,verticalAlign:i}=tu(r),a=t[0]-e.displaySize[0]*n,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 iu(e){var t,r;let n=e.left,i=e.top,a=e.right-n,o=e.bottom-i,s=null!==(t=e.image.textFitWidth)&&void 0!==t?t:"stretchOrShrink",l=null!==(r=e.image.textFitHeight)&&void 0!==r?r:"stretchOrShrink",c=(e.image.content[2]-e.image.content[0])/(e.image.content[3]-e.image.content[1]);if("proportional"===l){if("stretchOnly"===s&&a/o<c||"proportional"===s){let e=Math.ceil(o*c);n*=e/a,a=e}}else if("proportional"===s&&"stretchOnly"===l&&0!==c&&a/o>c){let e=Math.ceil(a/c);i*=e/o,o=e}return{x1:n,y1:i,x2:n+a,y2:i+o}}function au(e,t,r,n,i,a){let o,s=e.image;if(s.content){let e=s.content,t=s.pixelRatio||1;o=[e[0]/t,e[1]/t,s.displaySize[0]-e[2]/t,s.displaySize[1]-e[3]/t]}let l,c,u,h,f=t.left*a,p=t.right*a;"width"===r||"both"===r?(h=i[0]+f-n[3],c=i[0]+p+n[1]):(h=i[0]+(f+p-s.displaySize[0])/2,c=h+s.displaySize[0]);let d=t.top*a,m=t.bottom*a;return"height"===r||"both"===r?(l=i[1]+d-n[0],u=i[1]+m+n[2]):(l=i[1]+(d+m-s.displaySize[1])/2,u=l+s.displaySize[1]),{image:s,top:l,right:c,bottom:u,left:h,collisionPadding:o}}let ou=128,su=32640;function lu(e,t){let{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Qi(e+1))};if("source"===r.kind)return{kind:"source"};{let{zoomStops:t,interpolationType:n}=r,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"composite"===r.kind?{kind:"composite",minZoom:o,maxZoom:s,interpolationType:n}:{kind:"camera",minZoom:o,maxZoom:s,minSize:r.evaluate(new Qi(o)),maxSize:r.evaluate(new Qi(s)),interpolationType:n}}}function cu(e,t,r){let n="never",i=e.get(t);return i?n=i:e.get(r)&&(n="always"),n}let uu,hu,fu=bl.VectorTileFeature.types,pu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function du(e,t,r,n,i,a,o,s,l,c,u,h,f){let p=s?Math.min(su,Math.round(s[0])):0,d=s?Math.min(su,Math.round(s[1])):0;e.emplaceBack(t,r,Math.round(32*n),Math.round(32*i),a,o,(p<<1)+(l?1:0),d,16*c,16*u,256*h,256*f)}function mu(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function gu(e){for(let t of e.sections)if(Ki(t.text))return!0;return!1}class yu{constructor(e){this.layoutVertexArray=new co,this.indexArray=new mo,this.programConfigurations=e,this.segments=new xo,this.dynamicLayoutVertexArray=new uo,this.opacityVertexArray=new ho,this.hasVisibleVertices=!1,this.placedSymbolArray=new Za}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ac.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,oc.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,pu,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&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())}}Ti("SymbolBuffers",yu);class vu{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new xo,this.collisionVertexArray=new po}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,sc.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Ti("CollisionBuffers",vu);class xu{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=ys([]),this.placementViewportMatrix=ys([]);let r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=lu(this.zoom,r["text-size"]),this.iconSizeData=lu(this.zoom,r["icon-size"]);let n=this.layers[0].layout,i=n.get("symbol-sort-key"),a=n.get("symbol-z-order");this.canOverlap="never"!==cu(n,"text-overlap","text-allow-overlap")||"never"!==cu(n,"icon-overlap","icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!i.isConstant(),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.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 yu(new Vo(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new yu(new Vo(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new $a,this.lineVertexArray=new Ka,this.symbolInstances=new Xa,this.textAnchorOffsets=new Qa}calculateGlyphDependencies(e,t,r,n,i){for(let a=0;a<e.length;a++)if(t[e.charCodeAt(a)]=!0,(r||n)&&i){let r=hc[e.charAt(a)];r&&(t[r.charCodeAt(0)]=!0)}}populate(t,r,n){let i=this.layers[0],a=i.layout,o=a.get("text-font"),s=a.get("text-field"),l=a.get("icon-image"),c=("constant"!==s.value.kind||s.value.value instanceof Je&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),u="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!c&&!u)return;let f=r.iconDependencies,p=r.glyphDependencies,d=r.availableImages,m=new Qi(this.zoom);for(let{feature:r,id:s,index:l,sourceLayerIndex:g}of t){let t,y,v=i._featureFilter.needGeometry,x=Ko(r,v);if(!i._featureFilter.filter(m,x,n))continue;if(v||(x.geometry=$o(r)),c){let e=i.getValueAndResolveTokens("text-field",x,n,d),r=Je.factory(e),a=this.hasRTLText=this.hasRTLText||gu(r);(!a||"unavailable"===Ji.getRTLTextPluginStatus()||a&&Ji.isParsed())&&(t=uc(r,i,x))}if(u){let e=i.getValueAndResolveTokens("icon-image",x,n,d);y=e instanceof rt?e:rt.fromString(e)}if(!t&&!y)continue;let _=this.sortFeaturesByKey?h.evaluate(x,{},n):void 0;if(this.features.push({id:s,text:t,icon:y,index:l,sourceLayerIndex:g,geometry:x.geometry,properties:r.properties,type:fu[r.type],sortKey:_}),y&&(f[y.name]=!0),t){let r=o.evaluate(x,{},n).join(","),i="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(let e of t.sections)if(e.image)f[e.image.name]=!0;else{let n=Ni(t.toString()),a=e.fontStack||r,o=p[a]=p[a]||{};this.calculateGlyphDependencies(e.text,o,i,this.allowVerticalPlacement,n)}}}"line"===a.get("symbol-placement")&&(this.features=function(e){let t={},r={},n=[],i=0;function a(t){n.push(e[t]),i++}function o(e,t,i){let a=r[e];return delete r[e],r[t]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(e,r,i){let a=t[r];return delete t[r],t[e]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(e,t,r){let n=r?t[0][t[0].length-1]:t[0][0];return`${e}:${n.x}:${n.y}`}for(let c=0;c<e.length;c++){let u=e[c],h=u.geometry,f=u.text?u.text.toString():null;if(!f){a(c);continue}let p=l(f,h),d=l(f,h,!0);if(p in r&&d in t&&r[p]!==t[d]){let e=s(p,d,h),i=o(p,d,n[e].geometry);delete t[p],delete r[d],r[l(f,n[i].geometry,!0)]=i,n[e].geometry=null}else p in r?o(p,d,h):d in t?s(p,d,h):(a(c),t[p]=i-1,r[d]=i-1)}return n.filter((e=>e.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))}isEmpty(){return 0===this.symbolInstances.length&&!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 r=this.lineVertexArray.length;if(void 0!==e.segment){let r=e.dist(t[e.segment+1]),n=e.dist(t[e.segment]),i={};for(let n=e.segment+1;n<t.length;n++)i[n]={x:t[n].x,y:t[n].y,tileUnitDistanceFromAnchor:r},n<t.length-1&&(r+=t[n+1].dist(t[n]));for(let r=e.segment||0;r>=0;r--)i[r]={x:t[r].x,y:t[r].y,tileUnitDistanceFromAnchor:n},r>0&&(n+=t[r-1].dist(t[r]));for(let e=0;e<t.length;e++){let t=i[e];this.lineVertexArray.emplaceBack(t.x,t.y,t.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(t,r,n,i,a,o,s,l,c,u,h,f){let p=t.indexArray,d=t.layoutVertexArray,m=t.segments.prepareSegment(4*r.length,d,p,this.canOverlap?o.sortKey:void 0),g=this.glyphOffsetArray.length,y=m.vertexLength,v=this.allowVerticalPlacement&&s===e.ah.vertical?Math.PI/2:0,x=o.text&&o.text.sections;for(let e=0;e<r.length;e++){let{tl:i,tr:a,bl:s,br:c,tex:u,pixelOffsetTL:h,pixelOffsetBR:g,minFontScaleX:y,minFontScaleY:_,glyphOffset:b,isSDF:w,sectionIndex:T}=r[e],k=m.vertexLength,A=b[1];du(d,l.x,l.y,i.x,A+i.y,u.x,u.y,n,w,h.x,h.y,y,_),du(d,l.x,l.y,a.x,A+a.y,u.x+u.w,u.y,n,w,g.x,h.y,y,_),du(d,l.x,l.y,s.x,A+s.y,u.x,u.y+u.h,n,w,h.x,g.y,y,_),du(d,l.x,l.y,c.x,A+c.y,u.x+u.w,u.y+u.h,n,w,g.x,g.y,y,_),mu(t.dynamicLayoutVertexArray,l,v),p.emplaceBack(k,k+1,k+2),p.emplaceBack(k+1,k+2,k+3),m.vertexLength+=4,m.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(b[0]),e!==r.length-1&&T===r[e+1].sectionIndex||t.programConfigurations.populatePaintArrays(d.length,o,o.index,{},f,x&&x[T])}t.placedSymbolArray.emplaceBack(l.x,l.y,g,this.glyphOffsetArray.length-g,y,c,u,l.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],s,0,!1,0,h)}_addCollisionDebugVertex(e,t,r,n,i,a){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,r,n,i,o,s){let l=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),c=l.vertexLength,u=i.layoutVertexArray,h=i.collisionVertexArray,f=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,h,o,f,p,new a(e,t)),this._addCollisionDebugVertex(u,h,o,f,p,new a(r,t)),this._addCollisionDebugVertex(u,h,o,f,p,new a(r,n)),this._addCollisionDebugVertex(u,h,o,f,p,new a(e,n)),l.vertexLength+=4;let d=i.indexArray;d.emplaceBack(c,c+1),d.emplaceBack(c+1,c+2),d.emplaceBack(c+2,c+3),d.emplaceBack(c+3,c),l.primitiveLength+=4}addDebugCollisionBoxes(e,t,r,n){for(let i=e;i<t;i++){let e=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(e.x1,e.y1,e.x2,e.y2,n?this.textCollisionBox:this.iconCollisionBox,e.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new vu(fo,lc.members,go),this.iconCollisionBox=new vu(fo,lc.members,go);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,r,n,i,a,o,s,l){let c={};for(let n=t;n<r;n++){let t=e.get(n);c.textBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},c.textFeatureIndex=t.featureIndex;break}for(let t=n;t<i;t++){let r=e.get(t);c.verticalTextBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},c.verticalTextFeatureIndex=r.featureIndex;break}for(let t=a;t<o;t++){let r=e.get(t);c.iconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},c.iconFeatureIndex=r.featureIndex;break}for(let t=s;t<l;t++){let r=e.get(t);c.verticalIconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},c.verticalIconFeatureIndex=r.featureIndex;break}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.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 r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs;for(let t=r.vertexStartIndex;t<n;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&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;let t=Math.sin(e),r=Math.cos(e),n=[],i=[],a=[];for(let e=0;e<this.symbolInstances.length;++e){a.push(e);let o=this.symbolInstances.get(e);n.push(0|Math.round(t*o.anchorX+r*o.anchorY)),i.push(o.featureIndex)}return a.sort(((e,t)=>n[e]-n[t]||i[t]-i[e])),a}addToSortKeyRanges(e,t){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.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,r)=>{e>=0&&r.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)}}}Ti("SymbolBucket",xu,{omit:["layers","collisionBoxArray","features","compareText"]}),xu.MAX_GLYPHS=65535,xu.addDynamicAttributes=mu;var _u={get paint(){return hu=hu||new pa({"icon-opacity":new ca(Y.paint_symbol["icon-opacity"]),"icon-color":new ca(Y.paint_symbol["icon-color"]),"icon-halo-color":new ca(Y.paint_symbol["icon-halo-color"]),"icon-halo-width":new ca(Y.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ca(Y.paint_symbol["icon-halo-blur"]),"icon-translate":new la(Y.paint_symbol["icon-translate"]),"icon-translate-anchor":new la(Y.paint_symbol["icon-translate-anchor"]),"text-opacity":new ca(Y.paint_symbol["text-opacity"]),"text-color":new ca(Y.paint_symbol["text-color"],{runtimeType:de,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new ca(Y.paint_symbol["text-halo-color"]),"text-halo-width":new ca(Y.paint_symbol["text-halo-width"]),"text-halo-blur":new ca(Y.paint_symbol["text-halo-blur"]),"text-translate":new la(Y.paint_symbol["text-translate"]),"text-translate-anchor":new la(Y.paint_symbol["text-translate-anchor"])})},get layout(){return uu=uu||new pa({"symbol-placement":new la(Y.layout_symbol["symbol-placement"]),"symbol-spacing":new la(Y.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new la(Y.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ca(Y.layout_symbol["symbol-sort-key"]),"symbol-z-order":new la(Y.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new la(Y.layout_symbol["icon-allow-overlap"]),"icon-overlap":new la(Y.layout_symbol["icon-overlap"]),"icon-ignore-placement":new la(Y.layout_symbol["icon-ignore-placement"]),"icon-optional":new la(Y.layout_symbol["icon-optional"]),"icon-rotation-alignment":new la(Y.layout_symbol["icon-rotation-alignment"]),"icon-size":new ca(Y.layout_symbol["icon-size"]),"icon-text-fit":new la(Y.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new la(Y.layout_symbol["icon-text-fit-padding"]),"icon-image":new ca(Y.layout_symbol["icon-image"]),"icon-rotate":new ca(Y.layout_symbol["icon-rotate"]),"icon-padding":new ca(Y.layout_symbol["icon-padding"]),"icon-keep-upright":new la(Y.layout_symbol["icon-keep-upright"]),"icon-offset":new ca(Y.layout_symbol["icon-offset"]),"icon-anchor":new ca(Y.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new la(Y.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new la(Y.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new la(Y.layout_symbol["text-rotation-alignment"]),"text-field":new ca(Y.layout_symbol["text-field"]),"text-font":new ca(Y.layout_symbol["text-font"]),"text-size":new ca(Y.layout_symbol["text-size"]),"text-max-width":new ca(Y.layout_symbol["text-max-width"]),"text-line-height":new la(Y.layout_symbol["text-line-height"]),"text-letter-spacing":new ca(Y.layout_symbol["text-letter-spacing"]),"text-justify":new ca(Y.layout_symbol["text-justify"]),"text-radial-offset":new ca(Y.layout_symbol["text-radial-offset"]),"text-variable-anchor":new la(Y.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new ca(Y.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new ca(Y.layout_symbol["text-anchor"]),"text-max-angle":new la(Y.layout_symbol["text-max-angle"]),"text-writing-mode":new la(Y.layout_symbol["text-writing-mode"]),"text-rotate":new ca(Y.layout_symbol["text-rotate"]),"text-padding":new la(Y.layout_symbol["text-padding"]),"text-keep-upright":new la(Y.layout_symbol["text-keep-upright"]),"text-transform":new ca(Y.layout_symbol["text-transform"]),"text-offset":new ca(Y.layout_symbol["text-offset"]),"text-allow-overlap":new la(Y.layout_symbol["text-allow-overlap"]),"text-overlap":new la(Y.layout_symbol["text-overlap"]),"text-ignore-placement":new la(Y.layout_symbol["text-ignore-placement"]),"text-optional":new la(Y.layout_symbol["text-optional"])})}};class bu{constructor(e){if(void 0===e.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:ue,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}}Ti("FormatSectionOverride",bu,{omit:["defaultValue"]});class wu extends ma{constructor(e){super(e,_u)}recalculate(e,t){if(super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){let e=this.layout.get("text-writing-mode");if(e){let t=[];for(let r of e)t.indexOf(r)<0&&t.push(r);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,r,n){let i=this.layout.get(e).evaluate(t,{},r,n),a=this._unevaluatedLayout._values[e];return a.isDataDriven()||bn(a.value)||!i?i:(o=t.properties,i.replace(/{([^{}]+)}/g,((e,t)=>o&&t in o?String(o[t]):"")));var o}createBucket(e){return new xu(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of _u.paint.overridableProperties){if(!wu.hasPaintOverride(this.layout,e))continue;let t=this.paint.get(e),r=new bu(t),n=new _n(r,t.property.specification),i=null;i="constant"===t.value.kind||"source"===t.value.kind?new Tn("source",n):new kn("composite",n,t.value.zoomStops),this.paint._values[e]=new oa(t.property,i,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven())&&wu.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){let r=e.get("text-field"),n=_u.paint.properties[t],i=!1,a=e=>{for(let t of e)if(n.overrides&&n.overrides.hasOverride(t))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof Je)a(r.value.value.sections);else if("source"===r.value.kind){let e=t=>{i||(t instanceof st&&at(t.value)===ve?a(t.value.sections):t instanceof Zt?a(t.sections):t.eachChild(e))},t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return i}}let Tu;var ku={get paint(){return Tu=Tu||new pa({"background-color":new la(Y.paint_background["background-color"]),"background-pattern":new ha(Y.paint_background["background-pattern"]),"background-opacity":new la(Y.paint_background["background-opacity"])})}};class Au extends ma{constructor(e){super(e,ku)}}let Mu;var Su={get paint(){return Mu=Mu||new pa({"raster-opacity":new la(Y.paint_raster["raster-opacity"]),"raster-hue-rotate":new la(Y.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new la(Y.paint_raster["raster-brightness-min"]),"raster-brightness-max":new la(Y.paint_raster["raster-brightness-max"]),"raster-saturation":new la(Y.paint_raster["raster-saturation"]),"raster-contrast":new la(Y.paint_raster["raster-contrast"]),"raster-resampling":new la(Y.paint_raster["raster-resampling"]),"raster-fade-duration":new la(Y.paint_raster["raster-fade-duration"])})}};class Eu extends ma{constructor(e){super(e,Su)}}class Cu extends ma{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"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Iu{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 Lu=6371008.8;class Pu{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Pu(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,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return Lu*Math.acos(Math.min(i,1))}static convert(e){if(e instanceof Pu)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Pu(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new Pu(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}let zu=2*Math.PI*Lu;function Du(e){return zu*Math.cos(e*Math.PI/180)}function Ou(e){return(180+e)/360}function Ru(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Fu(e,t){return e/Du(t)}function Bu(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}class ju{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(e,t=0){let r=Pu.convert(e);return new ju(Ou(r.lng),Ru(r.lat),Fu(t,r.lat))}toLngLat(){return new Pu(360*this.x-180,Bu(this.y))}toAltitude(){return this.z*Du(Bu(this.y))}meterInMercatorCoordinateUnits(){return 1/zu*(e=Bu(this.y),1/Math.cos(e*Math.PI/180));var e}}function Nu(e,t,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[e*n-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}class Uu{constructor(e,t,r){if(i=t,a=r,(n=e)<0||n>25||a<0||a>=Math.pow(2,n)||i<0||i>=Math.pow(2,n))throw new Error(`x=${t}, y=${r}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);var n,i,a;this.z=e,this.x=t,this.y=r,this.key=Hu(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,r){let n=(a=this.y,o=this.z,s=Nu(256*(i=this.x),256*(a=Math.pow(2,o)-a-1),o),l=Nu(256*(i+1),256*(a+1),o),s[0]+","+s[1]+","+l[0]+","+l[1]);var i,a,o,s,l;let c=function(e,t,r){let n,i="";for(let a=e;a>0;a--)n=1<<a-1,i+=(t&n?1:0)+(r&n?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("tms"===r?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,n)}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=Math.pow(2,this.z);return new a((e.x*t-this.x)*Zo,(e.y*t-this.y)*Zo)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Vu{constructor(e,t){this.wrap=e,this.canonical=t,this.key=Hu(e,t.z,t.z,t.x,t.y)}}class qu{constructor(e,t,r,n,i){if(e<r)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${r}`);this.overscaledZ=e,this.wrap=t,this.canonical=new Uu(r,+n,+i),this.key=Hu(t,e,r,n,i)}clone(){return new qu(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 new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let t=this.canonical.z-e;return e>this.canonical.z?new qu(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new qu(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?Hu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Hu(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||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 qu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new qu(t,this.wrap,t,r,n),new qu(t,this.wrap,t,r+1,n),new qu(t,this.wrap,t,r,n+1),new qu(t,this.wrap,t,r+1,n+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 qu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new qu(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Vu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new ju(e.x-this.wrap,e.y))}}function Hu(e,t,r,n,i){(e*=2)<0&&(e=-1*e-1);let a=1<<r;return(a*a*e+a*i+n).toString(36)+r.toString(36)+t.toString(36)}Ti("CanonicalTileID",Uu),Ti("OverscaledTileID",qu,{omit:["posMatrix"]});class Gu{constructor(e,t,r,n=1,i=1,a=1,o=0){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&!["mapbox","terrarium","custom"].includes(r))return void A(`"${r}" 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),r){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,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=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let e=0;e<s;e++)for(let t=0;t<s;t++){let r=this.get(e,t);r>this.max&&(this.max=r),r<this.min&&(this.min=r)}}get(e,t){let r=new Uint8Array(this.data.buffer),n=4*this._idx(e,t);return this.unpack(r[n],r[n+1],r[n+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 new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}unpack(e,t,r){return e*this.redFactor+t*this.greenFactor+r*this.blueFactor-this.baseShift}getPixels(){return new Ls({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let n=t*this.dim,i=t*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}let s=-t*this.dim,l=-r*this.dim;for(let t=a;t<o;t++)for(let r=n;r<i;r++)this.data[this._idx(r,t)]=e.data[this._idx(r+s,t+l)]}}Ti("DEMData",Gu);class Wu{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Zu{constructor(e,t,r,n,i){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=n,this.properties=e.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&(e[t]=this[t]);return e}}class Yu{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(Zo,16,0),this.grid3D=new bi(Zo,16,0),this.featureIndexArray=new to,this.promoteId=t}insert(e,t,r,n,i,a){let o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);let s=a?this.grid3D:this.grid;for(let e=0;e<t.length;e++){let r=t[e],n=[1/0,1/0,-1/0,-1/0];for(let e=0;e<r.length;e++){let t=r[e];n[0]=Math.min(n[0],t.x),n[1]=Math.min(n[1],t.y),n[2]=Math.max(n[2],t.x),n[3]=Math.max(n[3],t.y)}n[0]<Zo&&n[1]<Zo&&n[2]>=0&&n[3]>=0&&s.insert(o,n[0],n[1],n[2],n[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new bl.VectorTile(new Oc(this.rawTileData)).layers,this.sourceLayerCoder=new Wu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,t,r,n){this.loadVTLayers();let i=e.params||{},o=Zo/e.tileSize/e.scale,s=In(i.filter),l=e.queryGeometry,c=e.queryPadding*o,u=$u(l),h=this.grid.query(u.minX-c,u.minY-c,u.maxX+c,u.maxY+c),f=$u(e.cameraQueryGeometry),p=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,((t,r,n,i)=>function(e,t,r,n,i){for(let a of e)if(t<=a.x&&r<=a.y&&n>=a.x&&i>=a.y)return!0;let o=[new a(t,r),new a(t,i),new a(n,i),new a(n,r)];if(e.length>2)for(let t of o)if(cs(e,t))return!0;for(let t=0;t<e.length-1;t++)if(us(e[t],e[t+1],o))return!0;return!1}(e.cameraQueryGeometry,t-c,r-c,n+c,i+c)));for(let e of p)h.push(e);h.sort(Ku);let d,m={};for(let a=0;a<h.length;a++){let c=h[a];if(c===d)continue;d=c;let u=this.featureIndexArray.get(c),f=null;this.loadMatchingFeature(m,u.bucketIndex,u.sourceLayerIndex,u.featureIndex,s,i.layers,i.availableImages,t,r,n,((t,r,n)=>(f||(f=$o(t)),r.queryIntersectsFeature(l,t,n,f,this.z,e.transform,o,e.pixelPosMatrix))))}return m}loadMatchingFeature(e,t,r,n,i,a,o,s,l,c,u){let h=this.bucketLayerIDs[t];if(a&&!function(e,t){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}(a,h))return;let f=this.sourceLayerCoder.decode(r),p=this.vtLayers[f].feature(n);if(i.needGeometry){let e=Ko(p,!0);if(!i.filter(new Qi(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!i.filter(new Qi(this.tileID.overscaledZ),p))return;let d=this.getId(p,f);for(let t=0;t<h.length;t++){let r=h[t];if(a&&a.indexOf(r)<0)continue;let i=s[r];if(!i)continue;let f={};d&&c&&(f=c.getState(i.sourceLayer||"_geojsonTileLayer",d));let m=x({},l[r]);m.paint=Xu(m.paint,i.paint,p,f,o),m.layout=Xu(m.layout,i.layout,p,f,o);let g=!u||u(p,i,f);if(!g)continue;let y=new Zu(p,this.z,this.x,this.y,d);y.layer=m;let v=e[r];void 0===v&&(v=e[r]=[]),v.push({featureIndex:n,feature:y,intersectionZ:g})}}lookupSymbolFeatures(e,t,r,n,i,a,o,s){let l={};this.loadVTLayers();let c=In(i);for(let i of e)this.loadMatchingFeature(l,r,n,i,c,a,o,s,t);return l}hasLayer(e){for(let t of this.bucketLayerIDs)for(let r of t)if(e===r)return!0;return!1}getId(e,t){let r=e.id;return this.promoteId&&(r=e.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[t]],"boolean"==typeof r&&(r=Number(r))),r}}function Xu(e,t,r,n,i){return b(e,((e,a)=>{let o=t instanceof sa?t.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function $u(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return{minX:t,minY:r,maxX:n,maxY:i}}function Ku(e,t){return t-e}function Ju(e,t,r,n,i){let o=[];for(let s=0;s<e.length;s++){let l,c=e[s];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<r&&u.y<r||(s.y<r?s=new a(s.x+(r-s.y)/(u.y-s.y)*(u.x-s.x),r)._round():u.y<r&&(u=new a(s.x+(r-s.y)/(u.y-s.y)*(u.x-s.x),r)._round()),s.x>=n&&u.x>=n||(s.x>=n?s=new a(n,s.y+(n-s.x)/(u.x-s.x)*(u.y-s.y))._round():u.x>=n&&(u=new a(n,s.y+(n-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}Ti("FeatureIndex",Yu,{omit:["rawTileData","sourceLayerCoder"]});class Qu extends a{constructor(e,t,r,n){super(e,t),this.angle=r,void 0!==n&&(this.segment=n)}clone(){return new Qu(this.x,this.y,this.angle,this.segment)}}function eh(e,t,r,n,i){if(void 0===t.segment||0===r)return!0;let a=t,o=t.segment+1,s=0;for(;s>-r/2;){if(o--,o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;let l=[],c=0;for(;s<r/2;){let t=e[o],r=e[o+1];if(!r)return!1;let a=e[o-1].angleTo(t)-t.angleTo(r);for(a=Math.abs((a+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:a}),c+=a;s-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=t.dist(r)}return!0}function th(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function rh(e,t,r){return e?.6*t*r:0}function nh(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function ih(e,t,r,n,i,a){let o=rh(r,i,a),s=nh(r,n)*a,l=0,c=th(e)/2;for(let r=0;r<e.length-1;r++){let n=e[r],i=e[r+1],a=n.dist(i);if(l+a>c){let u=(c-l)/a,h=Pt.number(n.x,i.x,u),f=Pt.number(n.y,i.y,u),p=new Qu(h,f,i.angleTo(n),r);return p._round(),!o||eh(e,p,s,o,t)?p:void 0}l+=a}}function ah(e,t,r,n,i,a,o,s,l){let c=rh(n,a,o),u=nh(n,i),h=u*o,f=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),oh(e,f?t/2*s%t:(u/2+2*a)*o*s%t,t,c,r,h,f,!1,l)}function oh(e,t,r,n,i,a,o,s,l){let c=a/2,u=th(e),h=0,f=t-r,p=[];for(let t=0;t<e.length-1;t++){let o=e[t],s=e[t+1],d=o.dist(s),m=s.angleTo(o);for(;f+r<h+d;){f+=r;let g=(f-h)/d,y=Pt.number(o.x,s.x,g),v=Pt.number(o.y,s.y,g);if(y>=0&&y<l&&v>=0&&v<l&&f-c>=0&&f+c<=u){let r=new Qu(y,v,m,t);r._round(),n&&!eh(e,r,a,n,i)||p.push(r)}}h+=d}return s||p.length||o||(p=oh(e,h/2,r,n,i,a,o,!0,l)),p}function sh(e,t,r,n){let i=[],o=e.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom},h=o.stretchX||[[0,l]],f=o.stretchY||[[0,c]],p=(e,t)=>e+t[1]-t[0],d=h.reduce(p,0),m=f.reduce(p,0),g=l-d,y=c-m,v=0,x=d,_=0,b=m,w=0,T=g,k=0,A=y;if(o.content&&n){let t=o.content,r=t[2]-t[0],n=t[3]-t[1];(o.textFitWidth||o.textFitHeight)&&(u=iu(e)),v=lh(h,0,t[0]),_=lh(f,0,t[1]),x=lh(h,t[0],t[2]),b=lh(f,t[1],t[3]),w=t[0]-v,k=t[1]-_,T=r-x,A=n-b}let M=u.x1,S=u.y1,E=u.x2-M,C=u.y2-S,I=(e,n,i,l)=>{let c=uh(e.stretch-v,x,E,M),u=hh(e.fixed-w,T,e.stretch,d),h=uh(n.stretch-_,b,C,S),f=hh(n.fixed-k,A,n.stretch,m),p=uh(i.stretch-v,x,E,M),g=hh(i.fixed-w,T,i.stretch,d),y=uh(l.stretch-_,b,C,S),I=hh(l.fixed-k,A,l.stretch,m),L=new a(c,h),P=new a(p,h),z=new a(p,y),D=new a(c,y),O=new a(u/s,f/s),R=new a(g/s,I/s),F=t*Math.PI/180;if(F){let e=Math.sin(F),t=Math.cos(F),r=[t,-e,e,t];L._matMult(r),P._matMult(r),D._matMult(r),z._matMult(r)}let B=e.stretch+e.fixed,j=n.stretch+n.fixed;return{tl:L,tr:P,bl:D,br:z,tex:{x:o.paddedRect.x+1+B,y:o.paddedRect.y+1+j,w:i.stretch+i.fixed-B,h:l.stretch+l.fixed-j},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:R,minFontScaleX:T/s/E,minFontScaleY:A/s/C,isSDF:r}};if(n&&(o.stretchX||o.stretchY)){let e=ch(h,g,d),t=ch(f,y,m);for(let r=0;r<e.length-1;r++){let n=e[r],a=e[r+1];for(let e=0;e<t.length-1;e++)i.push(I(n,t[e],a,t[e+1]))}}else i.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return i}function lh(e,t,r){let n=0;for(let i of e)n+=Math.max(t,Math.min(r,i[1]))-Math.max(t,Math.min(r,i[0]));return n}function ch(e,t,r){let n=[{fixed:-1,stretch:0}];for(let[t,r]of e){let e=n[n.length-1];n.push({fixed:t-e.stretch,stretch:e.stretch}),n.push({fixed:t-e.stretch,stretch:e.stretch+(r-t)})}return n.push({fixed:t+1,stretch:r}),n}function uh(e,t,r,n){return e/t*r+n}function hh(e,t,r,n){return e-t*r/n}Ti("Anchor",Qu);class fh{constructor(e,t,r,n,i,o,s,l,c,u){var h;if(this.boxStartIndex=e.length,c){let e=o.top,t=o.bottom,r=o.collisionPadding;r&&(e-=r[1],t+=r[3]);let n=t-e;n>0&&(n=Math.max(10,n),this.circleDiameter=n)}else{let c=null!==(h=o.image)&&void 0!==h&&h.content&&(o.image.textFitWidth||o.image.textFitHeight)?iu(o):{x1:o.left,y1:o.top,x2:o.right,y2:o.bottom};c.y1=c.y1*s-l[0],c.y2=c.y2*s+l[2],c.x1=c.x1*s-l[3],c.x2=c.x2*s+l[1];let f=o.collisionPadding;if(f&&(c.x1-=f[0]*s,c.y1-=f[1]*s,c.x2+=f[2]*s,c.y2+=f[3]*s),u){let e=new a(c.x1,c.y1),t=new a(c.x2,c.y1),r=new a(c.x1,c.y2),n=new a(c.x2,c.y2),i=u*Math.PI/180;e._rotate(i),t._rotate(i),r._rotate(i),n._rotate(i),c.x1=Math.min(e.x,t.x,r.x,n.x),c.x2=Math.max(e.x,t.x,r.x,n.x),c.y1=Math.min(e.y,t.y,r.y,n.y),c.y2=Math.max(e.y,t.y,r.y,n.y)}e.emplaceBack(t.x,t.y,c.x1,c.y1,c.x2,c.y2,r,n,i)}this.boxEndIndex=e.length}}class ph{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(0===this.length)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:r}=this,n=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(r(n,a)>=0)break;t[e]=a,e=i}t[e]=n}_down(e){let{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e<n;){let n=1+(e<<1),a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],i)>=0)break;t[e]=t[n],e=n}t[e]=i}}function dh(e,t=1,r=!1){let n=1/0,i=1/0,o=-1/0,s=-1/0,l=e[0];for(let e=0;e<l.length;e++){let t=l[e];(!e||t.x<n)&&(n=t.x),(!e||t.y<i)&&(i=t.y),(!e||t.x>o)&&(o=t.x),(!e||t.y>s)&&(s=t.y)}let c=Math.min(o-n,s-i),u=c/2,h=new ph([],mh);if(0===c)return new a(n,i);for(let t=n;t<o;t+=c)for(let r=i;r<s;r+=c)h.push(new gh(t+u,r+u,u,e));let f=function(e){let t=0,r=0,n=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],l=a.x*s.y-s.x*a.y;r+=(a.x+s.x)*l,n+=(a.y+s.y)*l,t+=3*l}return new gh(r/t,n/t,0,e)}(e),p=h.length;for(;h.length;){let n=h.pop();(n.d>f.d||!f.d)&&(f=n,r&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,p)),n.max-f.d<=t||(u=n.h/2,h.push(new gh(n.p.x-u,n.p.y-u,u,e)),h.push(new gh(n.p.x+u,n.p.y-u,u,e)),h.push(new gh(n.p.x-u,n.p.y+u,u,e)),h.push(new gh(n.p.x+u,n.p.y+u,u,e)),p+=4)}return r&&(console.log(`num probes: ${p}`),console.log(`best distance: ${f.d}`)),f.p}function mh(e,t){return t.max-e.max}function gh(e,t,r,n){this.p=new a(e,t),this.h=r,this.d=function(e,t){let r=!1,n=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&&(r=!r),n=Math.min(n,ss(e,i,s))}}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var yh;e.aq=void 0,(yh=e.aq||(e.aq={}))[yh.center=1]="center",yh[yh.left=2]="left",yh[yh.right=3]="right",yh[yh.top=4]="top",yh[yh.bottom=5]="bottom",yh[yh["top-left"]=6]="top-left",yh[yh["top-right"]=7]="top-right",yh[yh["bottom-left"]=8]="bottom-left",yh[yh["bottom-right"]=9]="bottom-right";let vh=Number.POSITIVE_INFINITY;function xh(e,t){return t[1]!==vh?function(e,t,r){let n=0,i=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}return[n,i]}(e,t[0],t[1]):function(e,t){let r=0,n=0;t<0&&(t=0);let i=t/Math.SQRT2;switch(e){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-t;break;case"top":n=t-7}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}return[r,n]}(e,t[0])}function _h(e,t,r){var n;let i=e.layout,a=null===(n=i.get("text-variable-anchor-offset"))||void 0===n?void 0:n.evaluate(t,{},r);if(a){let e=a.values,t=[];for(let r=0;r<e.length;r+=2){let n=t[r]=e[r],i=e[r+1].map((e=>e*fc));n.startsWith("top")?i[1]-=7:n.startsWith("bottom")&&(i[1]+=7),t[r+1]=i}return new tt(t)}let o=i.get("text-variable-anchor");if(o){let n;n=void 0!==e._unevaluatedLayout.getValue("text-radial-offset")?[i.get("text-radial-offset").evaluate(t,{},r)*fc,vh]:i.get("text-offset").evaluate(t,{},r).map((e=>e*fc));let a=[];for(let e of o)a.push(e,xh(e,n));return new tt(a)}return null}function bh(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 wh(t,r,n,i,a,o,s,l,c,u,h){let f=o.textMaxSize.evaluate(r,{});void 0===f&&(f=s);let p,d=t.layers[0].layout,m=d.get("icon-offset").evaluate(r,{},h),g=kh(n.horizontal),y=s/24,v=t.tilePixelRatio*y,x=t.tilePixelRatio*f/24,_=t.tilePixelRatio*l,b=t.tilePixelRatio*d.get("symbol-spacing"),w=d.get("text-padding")*t.tilePixelRatio,T=function(e,t,r,n=1){let i=e.get("icon-padding").evaluate(t,{},r),a=i&&i.values;return[a[0]*n,a[1]*n,a[2]*n,a[3]*n]}(d,r,h,t.tilePixelRatio),k=d.get("text-max-angle")/180*Math.PI,M="viewport"!==d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),S="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),E=d.get("symbol-placement"),C=b/2,I=d.get("icon-text-fit");i&&"none"!==I&&(t.allowVerticalPlacement&&n.vertical&&(p=au(i,n.vertical,I,d.get("icon-text-fit-padding"),m,y)),g&&(i=au(i,g,I,d.get("icon-text-fit-padding"),m,y)));let L=(l,f)=>{f.x<0||f.x>=Zo||f.y<0||f.y>=Zo||function(t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,M){let S,E,C,I,L=t.addToLineVertexArray(r,n),P=0,z=0,D=0,O=0,R=-1,F=-1,B={},j=Ao("");if(t.allowVerticalPlacement&&i.vertical){let e=l.layout.get("text-rotate").evaluate(b,{},k)+90;C=new fh(c,r,u,h,f,i.vertical,p,d,m,e),s&&(I=new fh(c,r,u,h,f,s,y,v,m,e))}if(a){let n=l.layout.get("icon-rotate").evaluate(b,{}),i="none"!==l.layout.get("icon-text-fit"),o=sh(a,n,T,i),p=s?sh(s,n,T,i):void 0;E=new fh(c,r,u,h,f,a,y,v,!1,n),P=4*o.length;let d=t.iconSizeData,m=null;"source"===d.kind?(m=[ou*l.layout.get("icon-size").evaluate(b,{})],m[0]>su&&A(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===d.kind&&(m=[ou*w.compositeIconSizes[0].evaluate(b,{},k),ou*w.compositeIconSizes[1].evaluate(b,{},k)],(m[0]>su||m[1]>su)&&A(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,o,m,_,x,b,e.ah.none,r,L.lineStartIndex,L.lineLength,-1,k),R=t.icon.placedSymbolArray.length-1,p&&(z=4*p.length,t.addSymbols(t.icon,p,m,_,x,b,e.ah.vertical,r,L.lineStartIndex,L.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1)}let N=Object.keys(i.horizontal);for(let n of N){let a=i.horizontal[n];if(!S){j=Ao(a.text);let e=l.layout.get("text-rotate").evaluate(b,{},k);S=new fh(c,r,u,h,f,a,p,d,m,e)}let s=1===a.positionedLines.length;if(D+=Th(t,r,a,o,l,m,b,g,L,i.vertical?e.ah.horizontal:e.ah.horizontalOnly,s?N:[n],B,R,w,k),s)break}i.vertical&&(O+=Th(t,r,i.vertical,o,l,m,b,g,L,e.ah.vertical,["vertical"],B,F,w,k));let U=S?S.boxStartIndex:t.collisionBoxArray.length,V=S?S.boxEndIndex:t.collisionBoxArray.length,q=C?C.boxStartIndex:t.collisionBoxArray.length,H=C?C.boxEndIndex:t.collisionBoxArray.length,G=E?E.boxStartIndex:t.collisionBoxArray.length,W=E?E.boxEndIndex:t.collisionBoxArray.length,Z=I?I.boxStartIndex:t.collisionBoxArray.length,Y=I?I.boxEndIndex:t.collisionBoxArray.length,X=-1,$=(e,t)=>e&&e.circleDiameter?Math.max(e.circleDiameter,t):t;X=$(S,X),X=$(C,X),X=$(E,X),X=$(I,X);let K=X>-1?1:0;K&&(X*=M/fc),t.glyphOffsetArray.length>=xu.MAX_GLYPHS&&A("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);let J=_h(l,b,k),[Q,ee]=function(t,r){let n=t.length,i=r?.values;if(i?.length>0)for(let r=0;r<i.length;r+=2){let n=i[r+1];t.emplaceBack(e.aq[i[r]],n[0],n[1])}return[n,t.length]}(t.textAnchorOffsets,J);t.symbolInstances.emplaceBack(r.x,r.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,j,U,V,q,H,G,W,Z,Y,u,D,O,P,z,K,0,p,X,Q,ee)}(t,f,l,n,i,a,p,t.layers[0],t.collisionBoxArray,r.index,r.sourceLayerIndex,t.index,v,[w,w,w,w],M,c,_,T,S,m,r,o,u,h,s)};if("line"===E)for(let e of Ju(r.geometry,0,0,Zo,Zo)){let r=ah(e,b,k,n.vertical||g,i,24,x,t.overscaling,Zo);for(let n of r)g&&Ah(t,g.text,C,n)||L(e,n)}else if("line-center"===E){for(let e of r.geometry)if(e.length>1){let t=ih(e,k,n.vertical||g,i,24,x);t&&L(e,t)}}else if("Polygon"===r.type)for(let e of _r(r.geometry,0)){let t=dh(e,16);L(e[0],new Qu(t.x,t.y,0))}else if("LineString"===r.type)for(let e of r.geometry)L(e,new Qu(e[0].x,e[0].y,0));else if("Point"===r.type)for(let e of r.geometry)for(let t of e)L([t],new Qu(t.x,t.y,0))}function Th(e,t,r,n,i,o,s,l,c,u,h,f,p,d,m){let g=function(e,t,r,n,i,o,s,l){let c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[];for(let e of t.positionedLines)for(let n of e.positionedGlyphs){if(!n.rect)continue;let o=n.rect||{},h=4,f=!0,p=1,d=0,m=(i||l)&&n.vertical,g=n.metrics.advance*n.scale/2;if(l&&t.verticalizable&&(d=e.lineOffset/2-(n.imageName?-(fc-n.metrics.width*n.scale)/2:(n.scale-1)*fc)),n.imageName){let e=s[n.imageName];f=e.sdf,p=e.pixelRatio,h=1/p}let y=i?[n.x+g,n.y]:[0,0],v=i?[0,0]:[n.x+g+r[0],n.y+r[1]-d],x=[0,0];m&&(x=v,v=[0,0]);let _=n.metrics.isDoubleResolution?2:1,b=(n.metrics.left-h)*n.scale-g+v[0],w=(-n.metrics.top-h)*n.scale+v[1],T=b+o.w/_*n.scale/p,k=w+o.h/_*n.scale/p,A=new a(b,w),M=new a(T,w),S=new a(b,k),E=new a(T,k);if(m){let e=new a(-g,g-Vc),t=-Math.PI/2,r=12-g,i=new a(22-r,-(n.imageName?r:0)),o=new a(...x);A._rotateAround(t,e)._add(i)._add(o),M._rotateAround(t,e)._add(i)._add(o),S._rotateAround(t,e)._add(i)._add(o),E._rotateAround(t,e)._add(i)._add(o)}if(c){let e=Math.sin(c),t=Math.cos(c),r=[t,-e,e,t];A._matMult(r),M._matMult(r),S._matMult(r),E._matMult(r)}let C=new a(0,0),I=new a(0,0);u.push({tl:A,tr:M,bl:S,br:E,tex:o,writingMode:t.writingMode,glyphOffset:y,sectionIndex:n.sectionIndex,isSDF:f,pixelOffsetTL:C,pixelOffsetBR:I,minFontScaleX:0,minFontScaleY:0})}return u}(0,r,l,i,o,s,n,e.allowVerticalPlacement),y=e.textSizeData,v=null;"source"===y.kind?(v=[ou*i.layout.get("text-size").evaluate(s,{})],v[0]>su&&A(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===y.kind&&(v=[ou*d.compositeTextSizes[0].evaluate(s,{},m),ou*d.compositeTextSizes[1].evaluate(s,{},m)],(v[0]>su||v[1]>su)&&A(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),e.addSymbols(e.text,g,v,l,o,s,u,t,c.lineStartIndex,c.lineLength,p,m);for(let t of h)f[t]=e.text.placedSymbolArray.length-1;return 4*g.length}function kh(e){for(let t in e)return e[t];return null}function Ah(e,t,r,n){let i=e.compareText;if(t in i){let e=i[t];for(let t=e.length-1;t>=0;t--)if(n.dist(e[t])<r)return!0}else i[t]=[];return i[t].push(n),!1}let Mh=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Sh{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[t,r]=new Uint8Array(e,0,2);if(219!==t)throw new Error("Data does not appear to be in a KDBush format.");let n=r>>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);let i=Mh[15&r];if(!i)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new Sh(o,a,i,e)}constructor(e,t=64,r=Float64Array,n){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let i=Mh.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 new Error(`Unexpected typed array class: ${r}.`);n&&n instanceof ArrayBuffer?(this.data=n,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 r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Eh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],l=[];for(;s.length;){let c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=o){for(let o=h;o<=u;o++){let s=a[2*o],c=a[2*o+1];s>=e&&s<=r&&c>=t&&c<=n&&l.push(i[o])}continue}let f=h+u>>1,p=a[2*f],d=a[2*f+1];p>=e&&p<=r&&d>=t&&d<=n&&l.push(i[f]),(0===c?e<=p:t<=d)&&(s.push(h),s.push(f-1),s.push(1-c)),(0===c?r>=p:n>=d)&&(s.push(f+1),s.push(u),s.push(1-c))}return l}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:n,coords:i,nodeSize:a}=this,o=[0,n.length-1,0],s=[],l=r*r;for(;o.length;){let c=o.pop()||0,u=o.pop()||0,h=o.pop()||0;if(u-h<=a){for(let r=h;r<=u;r++)Ph(i[2*r],i[2*r+1],e,t)<=l&&s.push(n[r]);continue}let f=h+u>>1,p=i[2*f],d=i[2*f+1];Ph(p,d,e,t)<=l&&s.push(n[f]),(0===c?e-r<=p:t-r<=d)&&(o.push(h),o.push(f-1),o.push(1-c)),(0===c?e+r>=p:t+r>=d)&&(o.push(f+1),o.push(u),o.push(1-c))}return s}}function Eh(e,t,r,n,i,a){if(i-n<=r)return;let o=n+i>>1;Ch(e,t,o,n,i,a),Eh(e,t,r,n,o-1,1-a),Eh(e,t,r,o+1,i,1-a)}function Ch(e,t,r,n,i,a){for(;i>n;){if(i-n>600){let o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);Ch(e,t,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}let o=t[2*r+a],s=n,l=i;for(Ih(e,t,n,r),t[2*i+a]>o&&Ih(e,t,n,i);s<l;){for(Ih(e,t,s,l),s++,l--;t[2*s+a]<o;)s++;for(;t[2*l+a]>o;)l--}t[2*n+a]===o?Ih(e,t,n,l):(l++,Ih(e,t,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function Ih(e,t,r,n){Lh(e,r,n),Lh(t,2*r,2*n),Lh(t,2*r+1,2*n+1)}function Lh(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function Ph(e,t,r,n){let i=e-r,a=t-n;return i*i+a*a}var zh;e.bg=void 0,(zh=e.bg||(e.bg={})).create="create",zh.load="load",zh.fullLoad="fullLoad";let Dh=null,Oh=[],Rh=1e3/60,Fh="loadTime",Bh="fullLoadTime",jh={mark(e){performance.mark(e)},frame(e){let t=e;null!=Dh&&Oh.push(t-Dh),Dh=t},clearMetrics(){Dh=null,Oh=[],performance.clearMeasures(Fh),performance.clearMeasures(Bh);for(let t in e.bg)performance.clearMarks(e.bg[t])},getPerformanceMetrics(){performance.measure(Fh,e.bg.create,e.bg.load),performance.measure(Bh,e.bg.create,e.bg.fullLoad);let t=performance.getEntriesByName(Fh)[0].duration,r=performance.getEntriesByName(Bh)[0].duration,n=Oh.length,i=1/(Oh.reduce(((e,t)=>e+t),0)/n/1e3),a=Oh.filter((e=>e>Rh)).reduce(((e,t)=>e+(t-Rh)/Rh),0);return{loadTime:t,fullLoadTime:r,fps:i,percentDroppedFrames:a/(n+a)*100,totalFrames:n}}};e.$=class extends Ta{},e.A=gs,e.B=yi,e.C=function(e){if(null==E){let t=e.navigator?e.navigator.userAgent:null;E=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return E},e.D=la,e.E=Z,e.F=class{constructor(e,t){var r,n,i;this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Iu((()=>this.process())),this.subscription=(r=this.target,n="message",i=e=>this.receive(e),r.addEventListener(n,i,!1),{unsubscribe:()=>{r.removeEventListener(n,i,!1)}}),this.globalScope=S(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}sendAsync(e,t){return new Promise(((r,n)=>{let i=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[i]={resolve:r,reject:n},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:Si(e.data,a)});this.target.postMessage(o,{transfer:a})}))}receive(e){let t=e.data,r=t.id;if(!("file://"!==t.origin&&"file://"!==location.origin&&"resource://android"!==t.origin&&"resource://android"!==location.origin&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if("<cancel>"===t.type){delete this.tasks[r];let e=this.abortControllers[r];return delete this.abortControllers[r],void(e&&e.abort())}if(S(self)||t.mustQueue)return this.tasks[r]=t,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,t)}}process(){if(0===this.taskQueue.length)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,r){return t(this,void 0,void 0,(function*(){if("<response>"===r.type){let t=this.resolveRejects[e];return delete this.resolveRejects[e],t?void(r.error?t.reject(Ei(r.error)):t.resolve(Ei(r.data))):void 0}if(!this.messageHandlers[r.type])return void this.completeTask(e,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let t=Ei(r.data),n=new AbortController;this.abortControllers[e]=n;try{let i=yield this.messageHandlers[r.type](r.sourceMapId,t,n);this.completeTask(e,null,i)}catch(t){this.completeTask(e,t)}}))}completeTask(e,t,r){let n=[];delete this.abortControllers[e];let i={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?Si(t):null,data:Si(r,n)};this.target.postMessage(i,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=B,e.H=function(){var e=new gs(16);return gs!=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=Nc,e.J=function(e,t,r){var n,i,a,o,s,l,c,u,h,f,p,d,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],f=t[9],p=t[10],d=t[11],e[0]=n=t[0],e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=f,e[10]=p,e[11]=d,e[12]=n*m+s*g+h*y+t[12],e[13]=i*m+l*g+f*y+t[13],e[14]=a*m+c*g+p*y+t[14],e[15]=o*m+u*g+d*y+t[15]),e},e.K=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,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=vs,e.M=function(e,t){let r={};for(let n=0;n<t.length;n++){let i=t[n];i in e&&(r[i]=e[i])}return r},e.N=Pu,e.O=Ou,e.P=a,e.Q=Ru,e.R=Ls,e.S=qu,e.T=ra,e.U=h,e.V=d,e.W=L,e.X=Zo,e.Y=xa,e.Z=ju,e._=t,e.a=R,e.a$=function(e,t){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],p=e[11],d=e[12],m=e[13],g=e[14],y=e[15],v=t[0],x=t[1],_=t[2],b=t[3],w=t[4],T=t[5],k=t[6],A=t[7],M=t[8],S=t[9],E=t[10],C=t[11],I=t[12],L=t[13],P=t[14],z=t[15];return Math.abs(r-v)<=ms*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(n-x)<=ms*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-_)<=ms*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(a-b)<=ms*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(o-w)<=ms*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-T)<=ms*Math.max(1,Math.abs(s),Math.abs(T))&&Math.abs(l-k)<=ms*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(c-A)<=ms*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(u-M)<=ms*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(h-S)<=ms*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-E)<=ms*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(p-C)<=ms*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(d-I)<=ms*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(m-L)<=ms*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(g-P)<=ms*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-z)<=ms*Math.max(1,Math.abs(y),Math.abs(z))},e.a0=xo,e.a1=Uu,e.a2=oe,e.a3=e=>{let t=window.document.createElement("video");return t.muted=!0,new Promise((r=>{t.onloadstart=()=>{r(t)};for(let r of e){let e=window.document.createElement("source");V(r)||(t.crossOrigin="Anonymous"),e.src=r,t.appendChild(e)}}))},e.a4=function(){return _++},e.a5=Ga,e.a6=xu,e.a7=In,e.a8=Ko,e.a9=Zu,e.aA=function(e){if("custom"===e.type)return new Cu(e);switch(e.type){case"background":return new Au(e);case"circle":return new ws(e);case"fill":return new yl(e);case"fill-extrusion":return new Ul(e);case"heatmap":return new Os(e);case"hillshade":return new Fs(e);case"line":return new nc(e);case"raster":return new Eu(e);case"symbol":return new wu(e)}},e.aB=T,e.aC=function(e,t){if(!e)return[{command:"setStyle",args:[t]}];let r=[];try{if(!K(e.version,t.version))return[{command:"setStyle",args:[t]}];K(e.center,t.center)||r.push({command:"setCenter",args:[t.center]}),K(e.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),K(e.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),K(e.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),K(e.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),K(e.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),K(e.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),K(e.light,t.light)||r.push({command:"setLight",args:[t.light]}),K(e.terrain,t.terrain)||r.push({command:"setTerrain",args:[t.terrain]}),K(e.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),K(e.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});let n={},i=[];!function(e,t,r,n){let i;for(i in t=t||{},e=e||{})Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(t,i)||ee(i,r,n));for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)?K(e[i],t[i])||("geojson"===e[i].type&&"geojson"===t[i].type&&re(e,t,i)?J(r,{command:"setGeoJSONSourceData",args:[i,t[i].data]}):te(i,t,r,n)):Q(i,t,r))}(e.sources,t.sources,i,n);let a=[];e.layers&&e.layers.forEach((e=>{"source"in e&&n[e.source]?r.push({command:"removeLayer",args:[e.id]}):a.push(e)})),r=r.concat(i),function(e,t,r){t=t||[];let n,i,a,o,s,l=(e=e||[]).map(ie),c=t.map(ie),u=e.reduce(ae,{}),h=t.reduce(ae,{}),f=l.slice(),p=Object.create(null);for(let e=0,t=0;e<l.length;e++)n=l[e],Object.prototype.hasOwnProperty.call(h,n)?t++:(J(r,{command:"removeLayer",args:[n]}),f.splice(f.indexOf(n,t),1));for(let e=0,t=0;e<c.length;e++)n=c[c.length-1-e],f[f.length-1-e]!==n&&(Object.prototype.hasOwnProperty.call(u,n)?(J(r,{command:"removeLayer",args:[n]}),f.splice(f.lastIndexOf(n,f.length-t),1)):t++,o=f[f.length-e],J(r,{command:"addLayer",args:[h[n],o]}),f.splice(f.length-e,0,n),p[n]=!0);for(let e=0;e<c.length;e++)if(n=c[e],i=u[n],a=h[n],!p[n]&&!K(i,a))if(K(i.source,a.source)&&K(i["source-layer"],a["source-layer"])&&K(i.type,a.type)){for(s in ne(i.layout,a.layout,r,n,null,"setLayoutProperty"),ne(i.paint,a.paint,r,n,null,"setPaintProperty"),K(i.filter,a.filter)||J(r,{command:"setFilter",args:[n,a.filter]}),K(i.minzoom,a.minzoom)&&K(i.maxzoom,a.maxzoom)||J(r,{command:"setLayerZoomRange",args:[n,a.minzoom,a.maxzoom]}),i)Object.prototype.hasOwnProperty.call(i,s)&&"layout"!==s&&"paint"!==s&&"filter"!==s&&"metadata"!==s&&"minzoom"!==s&&"maxzoom"!==s&&(0===s.indexOf("paint.")?ne(i[s],a[s],r,n,s.slice(6),"setPaintProperty"):K(i[s],a[s])||J(r,{command:"setLayerProperty",args:[n,s,a[s]]}));for(s in a)Object.prototype.hasOwnProperty.call(a,s)&&!Object.prototype.hasOwnProperty.call(i,s)&&"layout"!==s&&"paint"!==s&&"filter"!==s&&"metadata"!==s&&"minzoom"!==s&&"maxzoom"!==s&&(0===s.indexOf("paint.")?ne(i[s],a[s],r,n,s.slice(6),"setPaintProperty"):K(i[s],a[s])||J(r,{command:"setLayerProperty",args:[n,s,a[s]]}))}else J(r,{command:"removeLayer",args:[n]}),o=f[f.lastIndexOf(n)+1],J(r,{command:"addLayer",args:[a,o]})}(a,t.layers,r)}catch(e){console.warn("Unable to compute style diff:",e),r=[{command:"setStyle",args:[t]}]}return r},e.aD=function(e){let t=[],r=e.id;return void 0===r&&t.push({message:`layers.${r}: missing required property "id"`}),void 0===e.render&&t.push({message:`layers.${r}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),t},e.aE=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],r[n]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==r){if("object"!=typeof r||Object.keys(t).length!==Object.keys(r).length)return!1;for(let n in t)if(!e(t[n],r[n]))return!1;return!0}return t===r},e.aF=b,e.aG=w,e.aH=class extends Io{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=Lo,e.aJ=class extends Io{constructor(e,t){super(e,t),this.current=Do}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=Po,e.aL=zo,e.aM=Xe,e.aN=class extends Io{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 Io{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,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*c,e[15]=1,e},e.aQ=_s,e.aR=class extends za{},e.aS=cc,e.aT=class extends Oa{},e.aU=Ds,e.aV=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},e.aW=Ps,e.aX=ro,e.aY=mo,e.aZ=class extends Va{},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,r,n,i)=>{let a=n||i;return t[r]=!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 r=[];for(let n in e)n in t||r.push(n);return r},e.ac=y,e.ad=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],c=t[4],u=t[5],h=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+c*n,e[1]=o*i+u*n,e[2]=s*i+h*n,e[3]=l*i+f*n,e[4]=c*i-a*n,e[5]=u*i-o*n,e[6]=h*i-s*n,e[7]=f*i-l*n,e},e.ae=function(e){var t=new gs(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=bs,e.ag=function(e,t){let r=0,n=0;if("constant"===e.kind)n=e.layoutSize;else if("source"!==e.kind){let{interpolationType:i,minZoom:a,maxZoom:o}=e,s=i?y(zt.interpolationFactor(i,t,a,o),0,1):0;"camera"===e.kind?n=Pt.number(e.minSize,e.maxSize,s):r=s}return{uSizeT:r,uSize:n}},e.ai=function(e,{uSize:t,uSizeT:r},{lowerSize:n,upperSize:i}){return"source"===e.kind?n/ou:"composite"===e.kind?Pt.number(n/ou,i/ou,r):t},e.aj=mu,e.ak=function(e,t,r,n){let i=t.y-e.y,o=t.x-e.x,s=n.y-r.y,l=n.x-r.x,c=s*o-l*i;if(0===c)return null;let u=(l*(e.y-r.y)-s*(e.x-r.x))/c;return new a(e.x+u*o,e.y+u*i)},e.al=Ju,e.am=es,e.an=ys,e.ao=function(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return[t,r,n,i]},e.ap=fc,e.ar=cu,e.as=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],p=t[11],d=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*o,x=r*l-i*o,_=r*c-a*o,b=n*l-i*s,w=n*c-a*s,T=i*c-a*l,k=u*m-h*d,A=u*g-f*d,M=u*y-p*d,S=h*g-f*m,E=h*y-p*m,C=f*y-p*g,I=v*C-x*E+_*S+b*M-w*A+T*k;return I?(e[0]=(s*C-l*E+c*S)*(I=1/I),e[1]=(i*E-n*C-a*S)*I,e[2]=(m*T-g*w+y*b)*I,e[3]=(f*w-h*T-p*b)*I,e[4]=(l*M-o*C-c*A)*I,e[5]=(r*C-i*M+a*A)*I,e[6]=(g*_-d*T-y*x)*I,e[7]=(u*T-f*_+p*x)*I,e[8]=(o*E-s*M+c*k)*I,e[9]=(n*M-r*E-a*k)*I,e[10]=(d*w-m*_+y*v)*I,e[11]=(h*_-u*w-p*v)*I,e[12]=(s*A-o*S-l*k)*I,e[13]=(r*S-n*A+i*k)*I,e[14]=(m*x-d*b-g*v)*I,e[15]=(u*b-h*x+f*v)*I,e):null},e.at=bh,e.au=tu,e.av=Sh,e.aw=function(){let e={},t=Y.$version;for(let r in Y.$root){let n=Y.$root[r];if(n.required){let i=null;i="version"===r?t:"array"===n.type?[]:{},null!=i&&(e[r]=i)}}return e},e.ax=Ci,e.ay=N,e.az=function(e){e=e.slice();let t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=$(e[r],t[e[r].ref]));return e},e.b=C,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,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[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=Vu,e.b5=Fu,e.b6=function(e,t,r,n,i){var a,o=1/Math.tan(t/2);return e[0]=o/r,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,null!=i&&i!==1/0?(e[10]=(i+n)*(a=1/(n-i)),e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e},e.b7=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=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+c*n,e[5]=o*i+u*n,e[6]=s*i+h*n,e[7]=l*i+f*n,e[8]=c*i-a*n,e[9]=u*i-o*n,e[10]=h*i-s*n,e[11]=f*i-l*n,e},e.b8=m,e.b9=g,e.bA=pc,e.bB=function(e){return e.message===D},e.bC=wn,e.bD=Ji,e.ba=function(e){return e*Math.PI/180},e.bb=function(e,t){let{x:r,y:n}=ju.fromLngLat(t);return!(e<0||e>25||n<0||n>=1||r<0||r>=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 wa{},e.be=Lu,e.bf=jh,e.bh=j,e.bi=function(e,t){R.REGISTERED_PROTOCOLS[e]=t},e.bj=function(e){delete R.REGISTERED_PROTOCOLS[e]},e.bk=function(e,t){let r={};for(let n=0;n<e.length;n++){let i=t&&t[e[n].id]||jn(e[n]);t&&(t[e[n].id]=i);let a=r[i];a||(a=r[i]=[]),a.push(e[n])}let n=[];for(let e in r)n.push(r[e]);return n},e.bl=Ti,e.bm=Wu,e.bn=Yu,e.bo=Uc,e.bp=function(t){t.bucket.createArrays(),t.bucket.tilePixelRatio=Zo/(512*t.bucket.overscaling),t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],n=r.layout,i=r._unevaluatedLayout._values,a={layoutIconSize:i["icon-size"].possiblyEvaluate(new Qi(t.bucket.zoom+1),t.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new Qi(t.bucket.zoom+1),t.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new Qi(18))};if("composite"===t.bucket.textSizeData.kind){let{minZoom:e,maxZoom:r}=t.bucket.textSizeData;a.compositeTextSizes=[i["text-size"].possiblyEvaluate(new Qi(e),t.canonical),i["text-size"].possiblyEvaluate(new Qi(r),t.canonical)]}if("composite"===t.bucket.iconSizeData.kind){let{minZoom:e,maxZoom:r}=t.bucket.iconSizeData;a.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new Qi(e),t.canonical),i["icon-size"].possiblyEvaluate(new Qi(r),t.canonical)]}let o=n.get("text-line-height")*fc,s="viewport"!==n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement"),l=n.get("text-keep-upright"),c=n.get("text-size");for(let i of t.bucket.features){let u,h=n.get("text-font").evaluate(i,{},t.canonical).join(","),f=c.evaluate(i,{},t.canonical),p=a.layoutTextSize.evaluate(i,{},t.canonical),d=a.layoutIconSize.evaluate(i,{},t.canonical),m={horizontal:{},vertical:void 0},g=i.text,y=[0,0];if(g){let a=g.toString(),c=n.get("text-letter-spacing").evaluate(i,{},t.canonical)*fc,u=Ui(a)?c:0,d=n.get("text-anchor").evaluate(i,{},t.canonical),v=_h(r,i,t.canonical);if(!v){let e=n.get("text-radial-offset").evaluate(i,{},t.canonical);y=e?xh(d,[e*fc,vh]):n.get("text-offset").evaluate(i,{},t.canonical).map((e=>e*fc))}let x=s?"center":n.get("text-justify").evaluate(i,{},t.canonical),_="point"===n.get("symbol-placement")?n.get("text-max-width").evaluate(i,{},t.canonical)*fc:1/0,b=()=>{t.bucket.allowVerticalPlacement&&Ni(a)&&(m.vertical=Gc(g,t.glyphMap,t.glyphPositions,t.imagePositions,h,_,o,d,"left",u,y,e.ah.vertical,!0,p,f))};if(!s&&v){let r=new Set;if("auto"===x)for(let e=0;e<v.values.length;e+=2)r.add(bh(v.values[e]));else r.add(x);let n=!1;for(let i of r)if(!m.horizontal[i])if(n)m.horizontal[i]=m.horizontal[0];else{let r=Gc(g,t.glyphMap,t.glyphPositions,t.imagePositions,h,_,o,"center",i,u,y,e.ah.horizontal,!1,p,f);r&&(m.horizontal[i]=r,n=1===r.positionedLines.length)}b()}else{"auto"===x&&(x=bh(d));let r=Gc(g,t.glyphMap,t.glyphPositions,t.imagePositions,h,_,o,d,x,u,y,e.ah.horizontal,!1,p,f);r&&(m.horizontal[x]=r),b(),Ni(a)&&s&&l&&(m.vertical=Gc(g,t.glyphMap,t.glyphPositions,t.imagePositions,h,_,o,d,x,u,y,e.ah.vertical,!1,p,f))}}let v=!1;if(i.icon&&i.icon.name){let e=t.imageMap[i.icon.name];e&&(u=nu(t.imagePositions[i.icon.name],n.get("icon-offset").evaluate(i,{},t.canonical),n.get("icon-anchor").evaluate(i,{},t.canonical)),v=!!e.sdf,void 0===t.bucket.sdfIcons?t.bucket.sdfIcons=v:t.bucket.sdfIcons!==v&&A("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(e.pixelRatio!==t.bucket.pixelRatio||0!==n.get("icon-rotate").constantOr(1))&&(t.bucket.iconsNeedLinear=!0))}let x=kh(m.horizontal)||m.vertical;t.bucket.iconsInText=!!x&&x.iconsInText,(x||u)&&wh(t.bucket,i,m,u,t.imageMap,a,p,d,y,v,t.canonical)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()},e.bq=Ql,e.br=ml,e.bs=Fl,e.bt=bl,e.bu=Oc,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 0===e.length&&(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,r,n,i,a){return t(this,void 0,void 0,(function*(){if(d())try{return yield L(e,r,n,i,a)}catch{}return function(e,t,r,n,i){let a=e.width,o=e.height;P&&z||(P=new OffscreenCanvas(a,o),z=P.getContext("2d",{willReadFrequently:!0})),P.width=a,P.height=o,z.drawImage(e,0,0,a,o);let s=z.getImageData(t,r,n,i);return z.clearRect(0,0,a,o),s.data}(e,r,n,i,a)}))},e.bx=Gu,e.by=r,e.bz=n,e.c=O,e.d=e=>t(void 0,void 0,void 0,(function*(){if(0===e.byteLength)return createImageBitmap(new ImageData(1,1));let t=new Blob([new Uint8Array(e)],{type:"image/png"});try{return createImageBitmap(t)}catch(e){throw new 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=x,e.f=e=>new Promise(((t,r)=>{let n=new Image;n.onload=()=>{t(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame((()=>{n.src=I}))},n.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let i=new Blob([new Uint8Array(e)],{type:"image/png"});n.src=e.byteLength?URL.createObjectURL(i):I})),e.g=F,e.h=(e,t)=>U(x(e,{type:"json"}),t),e.i=S,e.j=W,e.k=G,e.l=(e,t)=>U(x(e,{type:"arrayBuffer"}),t),e.m=U,e.n=function(e){return new Oc(e).readFields(Rc,[])},e.o=Is,e.p=jc,e.q=pa,e.r=gi,e.s=V,e.t=_i,e.u=mi,e.v=Y,e.w=A,e.x=function([e,t,r]){return t+=90,t*=Math.PI/180,r*=Math.PI/180,{x:e*Math.cos(t)*Math.sin(r),y:e*Math.sin(t)*Math.sin(r),z:e*Math.cos(r)}},e.y=Pt,e.z=Qi})),r("worker",0,(function(e){class t{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(t,r){for(let r of t){this._layerConfigs[r.id]=r;let t=this._layers[r.id]=e.aA(r);t._featureFilter=e.a7(t.filter),this.keyCache[r.id]&&delete this.keyCache[r.id]}for(let e of r)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};let n=e.bk(Object.values(this._layerConfigs),this.keyCache);for(let e of n){let t=e.map((e=>this._layers[e.id])),r=t[0];if("none"===r.visibility)continue;let n=r.source||"",i=this.familiesBySource[n];i||(i=this.familiesBySource[n]={});let a=r.sourceLayer||"_geojsonTileLayer",o=i[a];o||(o=i[a]=[]),o.push(t)}}}class r{constructor(t){let r={},n=[];for(let e in t){let i=t[e],a=r[e]={};for(let e in i){let t=i[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;let r={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};n.push(r),a[e]={rect:r,metrics:t.metrics}}}let{w:i,h:a}=e.p(n),o=new e.o({width:i||1,height:a||1});for(let n in t){let i=t[n];for(let t in i){let a=i[+t];if(!a||0===a.bitmap.width||0===a.bitmap.height)continue;let s=r[n][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=r}}e.bl("GlyphAtlas",r);class n{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,n,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()),l=new e.bn(this.tileID,this.promoteId);l.bucketLayerIDs=[];let c={},u={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:a},h=n.familiesBySource[this.source];for(let r in h){let n=t.layers[r];if(!n)continue;1===n.version&&e.w(`Vector tile source "${this.source}" layer "${r}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let o=s.encode(r),f=[];for(let e=0;e<n.length;e++){let t=n.feature(e),i=l.getId(t,r);f.push({feature:t,id:i,index:e,sourceLayerIndex:o})}for(let t of h[r]){let r=t[0];r.source!==this.source&&e.w(`layer.source = ${r.source} does not equal this.source = ${this.source}`),r.minzoom&&this.zoom<Math.floor(r.minzoom)||r.maxzoom&&this.zoom>=r.maxzoom||"none"!==r.visibility&&(i(t,this.zoom,a),(c[r.id]=r.createBucket({index:l.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),l.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 d=Object.keys(u.iconDependencies),m=Promise.resolve({});if(d.length){let e=new AbortController;this.inFlightDependencies.push(e),m=o.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"icons"}},e)}let g=Object.keys(u.patternDependencies),y=Promise.resolve({});if(g.length){let e=new AbortController;this.inFlightDependencies.push(e),y=o.sendAsync({type:"GI",data:{icons:g,source:this.source,tileID:this.tileID,type:"patterns"}},e)}let[v,x,_]=yield Promise.all([p,m,y]),b=new r(v),w=new e.bo(x,_);for(let t in c){let r=c[t];r instanceof e.a6?(i(r.layers,this.zoom,a),e.bp({bucket:r,glyphMap:v,glyphPositions:b.positions,imageMap:x,imagePositions:w.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):r.hasPattern&&(r instanceof e.bq||r instanceof e.br||r instanceof e.bs)&&(i(r.layers,this.zoom,a),r.addFeatures(u,this.tileID.canonical,w.patternPositions))}return this.status="done",{buckets:Object.values(c).filter((e=>!e.isEmpty())),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:b.image,imageAtlas:w,glyphMap:this.returnDependencies?v:null,iconMap:this.returnDependencies?x:null,glyphPositions:this.returnDependencies?b.positions:null}}))}}function i(t,r,n){let i=new e.z(r);for(let e of t)e.recalculate(i,n)}class a{constructor(e,t,r){this.actor=e,this.layerIndex=t,this.availableImages=r,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(t,r){return e._(this,void 0,void 0,(function*(){let n=yield e.l(t.request,r);try{return{vectorTile:new e.bt.VectorTile(new e.bu(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(e){let r=new Uint8Array(n.data),i=`Unable to parse the tile at ${t.request.url}, `;throw i+=31===r[0]&&139===r[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${e.message}`,new Error(i)}}))}loadTile(t){return e._(this,void 0,void 0,(function*(){let r=t.uid,i=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.bv(t.request),a=new n(t);this.loading[r]=a;let o=new AbortController;a.abort=o;try{let n=yield this.loadVectorTile(t,o);if(delete this.loading[r],!n)return null;let s=n.rawData,l={};n.expires&&(l.expires=n.expires),n.cacheControl&&(l.cacheControl=n.cacheControl);let c={};if(i){let e=i.finish();e&&(c.resourceTiming=JSON.parse(JSON.stringify(e)))}a.vectorTile=n.vectorTile;let u=a.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[r]=a,this.fetching[r]={rawTileData:s,cacheControl:l,resourceTiming:c};try{let t=yield u;return e.e({rawTileData:s.slice(0)},t,l,c)}finally{delete this.fetching[r]}}catch(e){throw delete this.loading[r],a.status="done",this.loaded[r]=a,e}}))}reloadTile(t){return e._(this,void 0,void 0,(function*(){let r=t.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let n=this.loaded[r];if(n.showCollisionBoxes=t.showCollisionBoxes,"parsing"===n.status){let t,i=yield n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);if(this.fetching[r]){let{rawTileData:n,cacheControl:a,resourceTiming:o}=this.fetching[r];delete this.fetching[r],t=e.e({rawTileData:n.slice(0)},i,a,o)}else t=i;return t}if("done"===n.status&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor)}))}abortTile(t){return e._(this,void 0,void 0,(function*(){let e=this.loading,r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort.abort(),delete e[r])}))}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:r,encoding:n,rawImageData:i,redFactor:a,greenFactor:o,blueFactor:s,baseShift:l}=t,c=i.width+2,u=i.height+2,h=e.b(i)?new e.R({width:c,height:u},yield e.bw(i,-1,-1,c,u)):i,f=new e.bx(r,h,n,a,o,s,l);return this.loaded=this.loaded||{},this.loaded[r]=f,f}))}removeTile(e){let t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]}}function s(e,t){if(0!==e.length){l(e[0],t);for(var r=1;r<e.length;r++)l(e[r],!t)}}function l(e,t){for(var r=0,n=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]),l=r+s;n+=Math.abs(r)>=Math.abs(s)?r-l+s:s-l+r,r=l}r+n>=0!=!!t&&e.reverse()}var c=e.by((function e(t,r){var n,i=t&&t.type;if("FeatureCollection"===i)for(n=0;n<t.features.length;n++)e(t.features[n],r);else if("GeometryCollection"===i)for(n=0;n<t.geometries.length;n++)e(t.geometries[n],r);else if("Feature"===i)e(t.geometry,r);else if("Polygon"===i)s(t.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<t.coordinates.length;n++)s(t.coordinates[n],r);return t}));let u=e.bt.VectorTileFeature.prototype.toGeoJSON;var h={exports:{}},f=e.bz,p=e.bt.VectorTileFeature,d=m;function m(e,t){this.options=t||{},this.features=e,this.length=e.length}function g(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}m.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 r=e[t],n=[],i=0;i<r.length;i++)n.push(new f(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},g.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var l=o[s];t=Math.min(t,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[t,n,r,i]},g.prototype.toGeoJSON=p.prototype.toGeoJSON;var y=e.bA,v=d;function x(e){var t=new y;return function(e,t){for(var r in e.layers)t.writeMessage(3,_,e.layers[r])}(e,t),t.finish()}function _(e,t){var r;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)n.feature=e.feature(r),t.writeMessage(2,b,n);var i=n.keys;for(r=0;r<i.length;r++)t.writeStringField(3,i[r]);var a=n.values;for(r=0;r<a.length;r++)t.writeMessage(4,M,a[r])}function b(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,w,e),t.writeVarintField(3,r.type),t.writeMessage(4,A,r)}function w(e,t){var r=e.feature,n=e.keys,i=e.values,a=e.keycache,o=e.valuecache;for(var s in r.properties){var l=r.properties[s],c=a[s];if(null!==l){void 0===c&&(n.push(s),a[s]=c=n.length-1),t.writeVarint(c);var u=typeof l;"string"!==u&&"boolean"!==u&&"number"!==u&&(l=JSON.stringify(l));var h=u+":"+l,f=o[h];void 0===f&&(i.push(l),o[h]=f=i.length-1),t.writeVarint(f)}}}function T(e,t){return(t<<3)+(7&e)}function k(e){return e<<1^e>>31}function A(e,t){for(var r=e.loadGeometry(),n=e.type,i=0,a=0,o=r.length,s=0;s<o;s++){var l=r[s],c=1;1===n&&(c=l.length),t.writeVarint(T(1,c));for(var u=3===n?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==n&&t.writeVarint(T(2,u-1));var f=l[h].x-i,p=l[h].y-a;t.writeVarint(k(f)),t.writeVarint(k(p)),i+=f,a+=p}3===n&&t.writeVarint(T(7,1))}}function M(e,t){var r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}h.exports=x,h.exports.fromVectorTileJs=x,h.exports.fromGeojsonVt=function(e,t){t=t||{};var r={};for(var n in e)r[n]=new v(e[n].features,t),r[n].name=n,r[n].version=t.version,r[n].extent=t.extent;return x({layers:r})},h.exports.GeoJSONWrapper=v;var S=e.by(h.exports);let E={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},C=Math.fround||(I=new Float32Array(1),e=>(I[0]=+e,I[0]));var I;class L{constructor(e){this.options=Object.assign(Object.create(E),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:r,maxZoom:n}=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 r=e[t];if(!r.geometry)continue;let[n,i]=r.geometry.coordinates,o=C(D(n)),s=C(O(i));a.push(o,s,1/0,t,-1,1),this.options.reduce&&a.push(0)}let o=this.trees[n+1]=this._createTree(a);t&&console.timeEnd(i);for(let e=n;e>=r;e--){let r=+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()-r)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){let e=this.getClusters([r,n,180,a],t),o=this.getClusters([-180,n,i,a],t);return e.concat(o)}let o=this.trees[this._limitZoom(t)],s=o.range(D(r),O(a),D(i),O(n)),l=o.data,c=[];for(let e of s){let t=this.stride*e;c.push(l[t+5]>1?P(l,t,this.clusterProps):this.points[l[t+3]])}return c}getChildren(e){let t=this._getOriginId(e),r=this._getOriginZoom(e),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);let a=i.data;if(t*this.stride>=a.length)throw new Error(n);let o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=i.within(a[t*this.stride],a[t*this.stride+1],o),l=[];for(let t of s){let r=t*this.stride;a[r+4]===e&&l.push(a[r+5]>1?P(a,r,this.clusterProps):this.points[a[r+3]])}if(0===l.length)throw new Error(n);return l}getLeaves(e,t,r){let n=[];return this._appendLeaves(n,e,t=t||10,r=r||0,0),n}getTile(e,t,r){let n=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:a,radius:o}=this.options,s=o/a,l=(r-s)/i,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((t-s)/i,l,(t+1+s)/i,c),n.data,t,r,i,u),0===t&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.data,i,r,i,u),t===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.data,-1,r,i,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,n,i){let a=this.getChildren(t);for(let t of a){let a=t.properties;if(a&&a.cluster?i+a.point_count<=n?i+=a.point_count:i=this._appendLeaves(e,a.cluster_id,r,n,i):i<n?i++:e.push(t),e.length===r)break}return i}_createTree(t){let r=new e.av(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let e=0;e<t.length;e+=this.stride)r.add(t[e],t[e+1]);return r.finish(),r.data=t,r}_addTileFeatures(e,t,r,n,i,a){for(let o of e){let e,s,l,c=o*this.stride,u=t[c+5]>1;if(u)e=z(t,c,this.clusterProps),s=t[c],l=t[c+1];else{let r=this.points[t[c+3]];e=r.properties;let[n,i]=r.geometry.coordinates;s=D(n),l=O(i)}let h,f={type:1,geometry:[[Math.round(this.options.extent*(s*i-r)),Math.round(this.options.extent*(l*i-n))]],tags:e};h=u||this.options.generateId?t[c+3]:this.points[t[c+3]].id,void 0!==h&&(f.id=h),a.features.push(f)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:r,extent:n,reduce:i,minPoints:a}=this.options,o=r/(n*Math.pow(2,t)),s=e.data,l=[],c=this.stride;for(let r=0;r<s.length;r+=c){if(s[r+2]<=t)continue;s[r+2]=t;let n=s[r],u=s[r+1],h=e.within(s[r],s[r+1],o),f=s[r+5],p=f;for(let e of h){let r=e*c;s[r+2]>t&&(p+=s[r+5])}if(p>f&&p>=a){let e,a=n*f,o=u*f,d=-1,m=(r/c<<5)+(t+1)+this.points.length;for(let n of h){let l=n*c;if(s[l+2]<=t)continue;s[l+2]=t;let u=s[l+5];a+=s[l]*u,o+=s[l+1]*u,s[l+4]=m,i&&(e||(e=this._map(s,r,!0),d=this.clusterProps.length,this.clusterProps.push(e)),i(e,this._map(s,l)))}s[r+4]=m,l.push(a/p,o/p,1/0,m,-1,p),i&&l.push(d)}else{for(let e=0;e<c;e++)l.push(s[r+e]);if(p>1)for(let e of h){let r=e*c;if(!(s[r+2]<=t)){s[r+2]=t;for(let e=0;e<c;e++)l.push(s[r+e])}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+5]>1){let n=this.clusterProps[e[t+6]];return r?Object.assign({},n):n}let n=this.points[e[t+3]].properties,i=this.options.map(n);return r&&i===n?Object.assign({},i):i}}function P(e,t,r){return{type:"Feature",id:e[t+3],properties:z(e,t,r),geometry:{type:"Point",coordinates:[(n=e[t],360*(n-.5)),R(e[t+1])]}};var n}function z(e,t,r){let n=e[t+5],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,a=e[t+6],o=-1===a?{}:Object.assign({},r[a]);return Object.assign(o,{cluster:!0,cluster_id:e[t+3],point_count:n,point_count_abbreviated:i})}function D(e){return e/360+.5}function O(e){let t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function R(e){let t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function F(e,t,r,n){let i,a=n,o=t+(r-t>>1),s=r-t,l=e[t],c=e[t+1],u=e[r],h=e[r+1];for(let n=t+3;n<r;n+=3){let t=B(e[n],e[n+1],l,c,u,h);if(t>a)i=n,a=t;else if(t===a){let e=Math.abs(n-o);e<s&&(i=n,s=e)}}a>n&&(i-t>3&&F(e,t,i,n),e[i+2]=a,r-i>3&&F(e,i,r,n))}function B(e,t,r,n,i,a){let o=i-r,s=a-n;if(0!==o||0!==s){let l=((e-r)*o+(t-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return o=e-r,s=t-n,o*o+s*s}function j(e,t,r,n){let i={id:e??null,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===t||"MultiPoint"===t||"LineString"===t)N(i,r);else if("Polygon"===t)N(i,r[0]);else if("MultiLineString"===t)for(let e of r)N(i,e);else if("MultiPolygon"===t)for(let e of r)N(i,e[0]);return i}function N(e,t){for(let r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function U(e,t,r,n){if(!t.geometry)return;let i=t.geometry.coordinates;if(i&&0===i.length)return;let a=t.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===a)V(i,s);else if("MultiPoint"===a)for(let e of i)V(e,s);else if("LineString"===a)q(i,s,o,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(let r of i)s=[],q(r,s,o,!1),e.push(j(l,"LineString",s,t.properties));return}H(i,s,o,!1)}else if("Polygon"===a)H(i,s,o,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(let i of t.geometry.geometries)U(e,{id:l,geometry:i,properties:t.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(let e of i){let t=[];H(e,t,o,!0),s.push(t)}}e.push(j(l,a,s,t.properties))}function V(e,t){t.push(G(e[0]),W(e[1]),0)}function q(e,t,r,n){let i,a,o=0;for(let r=0;r<e.length;r++){let s=G(e[r][0]),l=W(e[r][1]);t.push(s,l,0),r>0&&(o+=n?(i*l-s*a)/2:Math.sqrt(Math.pow(s-i,2)+Math.pow(l-a,2))),i=s,a=l}let s=t.length-3;t[2]=1,F(t,0,s,r),t[s+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function H(e,t,r,n){for(let i=0;i<e.length;i++){let a=[];q(e[i],a,r,n),t.push(a)}}function G(e){return e/360+.5}function W(e){let t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Z(e,t,r,n,i,a,o,s){if(n/=t,a>=(r/=t)&&o<n)return e;if(o<r||a>=n)return null;let l=[];for(let t of e){let e=t.geometry,a=t.type,o=0===i?t.minX:t.minY,c=0===i?t.maxX:t.maxY;if(o>=r&&c<n){l.push(t);continue}if(c<r||o>=n)continue;let u=[];if("Point"===a||"MultiPoint"===a)Y(e,u,r,n,i);else if("LineString"===a)X(e,u,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===a)K(e,u,r,n,i,!1);else if("Polygon"===a)K(e,u,r,n,i,!0);else if("MultiPolygon"===a)for(let t of e){let e=[];K(t,e,r,n,i,!0),e.length&&u.push(e)}if(u.length){if(s.lineMetrics&&"LineString"===a){for(let e of u)l.push(j(t.id,a,e,t.tags));continue}"LineString"!==a&&"MultiLineString"!==a||(1===u.length?(a="LineString",u=u[0]):a="MultiLineString"),"Point"!==a&&"MultiPoint"!==a||(a=3===u.length?"Point":"MultiPoint"),l.push(j(t.id,a,u,t.tags))}}return l.length?l:null}function Y(e,t,r,n,i){for(let a=0;a<e.length;a+=3){let o=e[a+i];o>=r&&o<=n&&J(t,e[a],e[a+1],e[a+2])}}function X(e,t,r,n,i,a,o){let s,l,c=$(e),u=0===i?Q:ee,h=e.start;for(let f=0;f<e.length-3;f+=3){let p=e[f],d=e[f+1],m=e[f+2],g=e[f+3],y=e[f+4],v=0===i?p:d,x=0===i?g:y,_=!1;o&&(s=Math.sqrt(Math.pow(p-g,2)+Math.pow(d-y,2))),v<r?x>r&&(l=u(c,p,d,g,y,r),o&&(c.start=h+s*l)):v>n?x<n&&(l=u(c,p,d,g,y,n),o&&(c.start=h+s*l)):J(c,p,d,m),x<r&&v>=r&&(l=u(c,p,d,g,y,r),_=!0),x>n&&v<=n&&(l=u(c,p,d,g,y,n),_=!0),!a&&_&&(o&&(c.end=h+s*l),t.push(c),c=$(e)),o&&(h+=s)}let f=e.length-3,p=e[f],d=e[f+1],m=0===i?p:d;m>=r&&m<=n&&J(c,p,d,e[f+2]),f=c.length-3,a&&f>=3&&(c[f]!==c[0]||c[f+1]!==c[1])&&J(c,c[0],c[1],c[2]),c.length&&t.push(c)}function $(e){let t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function K(e,t,r,n,i,a){for(let o of e)X(o,t,r,n,i,a,!1)}function J(e,t,r,n){e.push(t,r,n)}function Q(e,t,r,n,i,a){let o=(a-t)/(n-t);return J(e,a,r+(i-r)*o,1),o}function ee(e,t,r,n,i,a){let o=(a-r)/(i-r);return J(e,t+(n-t)*o,a,1),o}function te(e,t){let r=[];for(let n=0;n<e.length;n++){let i,a=e[n],o=a.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)i=re(a.geometry,t);else if("MultiLineString"===o||"Polygon"===o){i=[];for(let e of a.geometry)i.push(re(e,t))}else if("MultiPolygon"===o){i=[];for(let e of a.geometry){let r=[];for(let n of e)r.push(re(n,t));i.push(r)}}r.push(j(a.id,o,i,a.tags))}return r}function re(e,t){let r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(let n=0;n<e.length;n+=3)r.push(e[n]+t,e[n+1],e[n+2]);return r}function ne(e,t){if(e.transformed)return e;let r=1<<e.z,n=e.x,i=e.y;for(let a of e.features){let e=a.geometry,o=a.type;if(a.geometry=[],1===o)for(let o=0;o<e.length;o+=2)a.geometry.push(ie(e[o],e[o+1],t,r,n,i));else for(let o=0;o<e.length;o++){let s=[];for(let a=0;a<e[o].length;a+=2)s.push(ie(e[o][a],e[o][a+1],t,r,n,i));a.geometry.push(s)}}return e.transformed=!0,e}function ie(e,t,r,n,i,a){return[Math.round(r*(e*n-i)),Math.round(r*(t*n-a))]}function ae(e,t,r,n,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:r,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let t of e)oe(o,t,a,i);return o}function oe(e,t,r,n){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),"Point"===a||"MultiPoint"===a)for(let t=0;t<i.length;t+=3)o.push(i[t],i[t+1]),e.numPoints++,e.numSimplified++;else if("LineString"===a)se(o,i,e,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(let t=0;t<i.length;t++)se(o,i[t],e,r,"Polygon"===a,0===t);else if("MultiPolygon"===a)for(let t=0;t<i.length;t++){let n=i[t];for(let t=0;t<n.length;t++)se(o,n[t],e,r,!0,0===t)}if(o.length){let r=t.tags||null;if("LineString"===a&&n.lineMetrics){r={};for(let e in t.tags)r[e]=t.tags[e];r.mapbox_clip_start=i.start/i.size,r.mapbox_clip_end=i.end/i.size}let s={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:r};null!==t.id&&(s.id=t.id),e.features.push(s)}}function se(e,t,r,n,i,a){let o=n*n;if(n>0&&t.size<(i?o:n))return void(r.numPoints+=t.length/3);let s=[];for(let e=0;e<t.length;e+=3)(0===n||t[e+2]>o)&&(r.numSimplified++,s.push(t[e],t[e+1])),r.numPoints++;i&&function(e,t){let r=0;for(let t=0,n=e.length,i=n-2;t<n;i=t,t+=2)r+=(e[t]-e[i])*(e[t+1]+e[i+1]);if(r>0===t)for(let t=0,r=e.length;t<r/2;t+=2){let n=e[t],i=e[t+1];e[t]=e[r-2-t],e[t+1]=e[r-1-t],e[r-2-t]=n,e[r-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 ce{constructor(e,t){let r=(t=this.options=function(e,t){for(let r in t)e[r]=t[r];return e}(Object.create(le),t)).debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=function(e,t){let r=[];if("FeatureCollection"===e.type)for(let n=0;n<e.features.length;n++)U(r,e.features[n],t,n);else U(r,"Feature"===e.type?e:{geometry:e},t);return r}(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(e,t){let r=t.buffer/t.extent,n=e,i=Z(e,1,-1-r,r,0,-1,2,t),a=Z(e,1,1-r,2+r,0,-1,2,t);return(i||a)&&(n=Z(e,1,-r,1+r,0,-1,2,t)||[],i&&(n=te(i,1).concat(n)),a&&(n=n.concat(te(a,-1)))),n}(n,t),n.length&&this.splitTile(n,0,0,0),r&&(n.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,r,n,i,a,o){let s=[e,t,r,n],l=this.options,c=l.debug;for(;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();let u=1<<t,h=ue(t,r,n),f=this.tiles[h];if(!f&&(c>1&&console.time("creation"),f=this.tiles[h]=ae(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,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,null==i){if(t===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue}else{if(t===l.maxZoom||t===i)continue;if(null!=i){let e=i-t;if(r!==a>>e||n!==o>>e)continue}}if(f.source=null,0===e.length)continue;c>1&&console.time("clipping");let p=.5*l.buffer/l.extent,d=.5-p,m=.5+p,g=1+p,y=null,v=null,x=null,_=null,b=Z(e,u,r-p,r+m,0,f.minX,f.maxX,l),w=Z(e,u,r+d,r+g,0,f.minX,f.maxX,l);e=null,b&&(y=Z(b,u,n-p,n+m,1,f.minY,f.maxY,l),v=Z(b,u,n+d,n+g,1,f.minY,f.maxY,l),b=null),w&&(x=Z(w,u,n-p,n+m,1,f.minY,f.maxY,l),_=Z(w,u,n+d,n+g,1,f.minY,f.maxY,l),w=null),c>1&&console.timeEnd("clipping"),s.push(y||[],t+1,2*r,2*n),s.push(v||[],t+1,2*r,2*n+1),s.push(x||[],t+1,2*r+1,2*n),s.push(_||[],t+1,2*r+1,2*n+1)}}getTile(e,t,r){e=+e,t=+t,r=+r;let n=this.options,{extent:i,debug:a}=n;if(e<0||e>24)return null;let o=1<<e,s=ue(e,t=t+o&o-1,r);if(this.tiles[s])return ne(this.tiles[s],i);a>1&&console.log("drilling down to z%d-%d-%d",e,t,r);let l,c=e,u=t,h=r;for(;!l&&c>0;)c--,u>>=1,h>>=1,l=this.tiles[ue(c,u,h)];return l&&l.source?(a>1&&(console.log("found parent tile z%d-%d-%d",c,u,h),console.time("drilling down")),this.splitTile(l.source,c,u,h,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?ne(this.tiles[s],i):null):null}}function ue(e,t,r){return 32*((1<<e)*r+t)+e}function he(e,t){return t?e.properties[t]:e.id}function fe(e,t){if(null==e)return!0;if("Feature"===e.type)return null!=he(e,t);if("FeatureCollection"===e.type){let r=new Set;for(let n of e.features){let e=he(n,t);if(null==e||r.has(e))return!1;r.add(e)}return!0}return!1}function pe(e,t){let r=new Map;if(null!=e)if("Feature"===e.type)r.set(he(e,t),e);else for(let n of e.features)r.set(he(n,t),n);return r}class de extends a{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(t,r){return e._(this,void 0,void 0,(function*(){let r=t.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)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(1===this._feature.type){let t=[];for(let r of this._feature.geometry)t.push([new e.P(r[0],r[1])]);return t}{let t=[];for(let r of this._feature.geometry){let n=[];for(let t of r)n.push(new e.P(t[0],t[1]));t.push(n)}return t}}toGeoJSON(e,t,r){return u.call(this,e,t,r)}}(this._features[t])}}(n.features),a=S(i);return 0===a.byteOffset&&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 r;null===(r=this._pendingRequest)||void 0===r||r.abort();let n=!!(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 L(function({superclusterOptions:t,clusterProperties:r}){if(!r||!t)return t;let n={},i={},a={accumulated:null,zoom:0},o={properties:null},s=Object.keys(r);for(let t of s){let[a,o]=r[t],s=e.bC(o),l=e.bC("string"==typeof a?[a,["accumulated"],["get",t]]:a);n[t]=s.value,i[t]=l.value}return t.map=e=>{o.properties=e;let t={};for(let e of s)t[e]=n[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 ce(i,t.geojsonVtOptions)),this.loaded={};let r={};if(n){let e=n.finish();e&&(r.resourceTiming={},r.resourceTiming[t.source]=JSON.parse(JSON.stringify(e)))}return r}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,r){return e._(this,void 0,void 0,(function*(){let n=yield this.loadGeoJSON(t,r);if(delete this._pendingRequest,"object"!=typeof n)throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`);if(c(n,!0),t.filter){let r=e.bC(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));n={type:"FeatureCollection",features:n.features.filter((e=>r.value.evaluate({zoom:0},e)))}}return n}))}loadGeoJSON(t,r){return e._(this,void 0,void 0,(function*(){let{promoteId:n}=t;if(t.request){let i=yield e.h(t.request,r);return this._dataUpdateable=fe(i.data,n)?pe(i.data,n):void 0,i.data}if("string"==typeof t.data)try{let e=JSON.parse(t.data);return this._dataUpdateable=fe(e,n)?pe(e,n):void 0,e}catch{throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)}if(!t.dataDiff)throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${t.source}`);return function(e,t,r){var n,i,a,o;if(t.removeAll&&e.clear(),t.remove)for(let r of t.remove)e.delete(r);if(t.add)for(let n of t.add){let t=he(n,r);null!=t&&e.set(t,n)}if(t.update)for(let r of t.update){let t=e.get(r.id);if(null==t)continue;let s=!r.removeAllProperties&&((null===(n=r.removeProperties)||void 0===n?void 0:n.length)>0||(null===(i=r.addOrUpdateProperties)||void 0===i?void 0:i.length)>0);if((r.newGeometry||r.removeAllProperties||s)&&(t=Object.assign({},t),e.set(r.id,t),s&&(t.properties=Object.assign({},t.properties))),r.newGeometry&&(t.geometry=r.newGeometry),r.removeAllProperties)t.properties={};else if((null===(a=r.removeProperties)||void 0===a?void 0:a.length)>0)for(let e of r.removeProperties)Object.prototype.hasOwnProperty.call(t.properties,e)&&delete t.properties[e];if((null===(o=r.addOrUpdateProperties)||void 0===o?void 0:o.length)>0)for(let{key:e,value:n}of r.addOrUpdateProperties)t.properties[e]=n}}(this._dataUpdateable,t.dataDiff,n),{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 me{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 new 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 new 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,r)=>e._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(t,r.source).removeTile(r)})))),this.actor.registerMessageHandler("GCEZ",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterExpansionZoom(r)})))),this.actor.registerMessageHandler("GCC",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterChildren(r)})))),this.actor.registerMessageHandler("GCL",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterLeaves(r)})))),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,r)=>e._(this,void 0,void 0,(function*(){if(!this.workerSources[t]||!this.workerSources[t][r.type]||!this.workerSources[t][r.type][r.source])return;let e=this.workerSources[t][r.type][r.source];delete this.workerSources[t][r.type][r.source],void 0!==e.removeSource&&e.removeSource(r)})))),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,r)=>e._(this,void 0,void 0,(function*(){this.referrer=r})))),this.actor.registerMessageHandler("SRPS",((e,t)=>this._syncRTLPluginState(e,t))),this.actor.registerMessageHandler("IS",((t,r)=>e._(this,void 0,void 0,(function*(){this.self.importScripts(r)})))),this.actor.registerMessageHandler("SI",((e,t)=>this._setImages(e,t))),this.actor.registerMessageHandler("UL",((t,r)=>e._(this,void 0,void 0,(function*(){this._getLayerIndex(t).update(r.layers,r.removedIds)})))),this.actor.registerMessageHandler("SL",((t,r)=>e._(this,void 0,void 0,(function*(){this._getLayerIndex(t).replace(r)}))))}_setImages(t,r){return e._(this,void 0,void 0,(function*(){this.availableImages[t]=r;for(let e in this.workerSources[t]){let n=this.workerSources[t][e];for(let e in n)n[e].availableImages=r}}))}_syncRTLPluginState(t,r){return e._(this,void 0,void 0,(function*(){if(e.bD.isParsed())return e.bD.getState();if("loading"!==r.pluginStatus)return e.bD.setState(r),r;let t=r.pluginURL;if(this.self.importScripts(t),e.bD.isParsed()){let r={pluginStatus:"loaded",pluginURL:t};return e.bD.setState(r),r}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${t}`)}))}_getAvailableImages(e){let t=this.availableImages[e];return t||(t=[]),t}_getLayerIndex(e){let r=this.layerIndexes[e];return r||(r=this.layerIndexes[e]=new t),r}_getWorkerSource(e,t,r){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){let n={sendAsync:(t,r)=>(t.targetMapId=e,this.actor.sendAsync(t,r))};switch(t){case"vector":this.workerSources[e][t][r]=new a(n,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][t][r]=new de(n,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][t][r]=new this.externalWorkerSourceTypes[t](n,this._getLayerIndex(e),this._getAvailableImages(e))}}return this.workerSources[e][t][r]}_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 me(self)),me})),r("index",0,(function(e,t){var r="4.7.1";let n,i,a={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:e=>new Promise(((r,n)=>{let i=requestAnimationFrame(r);e.signal.addEventListener("abort",(()=>{cancelAnimationFrame(i),n(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"),r=t.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0,e.width,e.height),r},resolveURL:e=>(n||(n=document.createElement("a")),n.href=e,n.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==i&&(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,r){let n=window.document.createElement(e);return void 0!==t&&(n.className=t),r&&r.appendChild(n),n}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,r,n={}){e.addEventListener(t,r,"passive"in n?n:n.capture)}static removeEventListener(e,t,r,n={}){e.removeEventListener(t,r,"passive"in n?n:n.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,r,n){let i=r.boundingClientRect;return new t.P((n.clientX-i.left)/r.x-e.clientLeft,(n.clientY-i.top)/r.y-e.clientTop)}static mousePos(e,t){let r=o.getScale(e);return o.getPoint(e,r,t)}static touchPos(e,t){let r=[],n=o.getScale(e);for(let i=0;i<t.length;i++)r.push(o.getPoint(e,n,t[i]));return r}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,l,c={supported:!1,testSupport:function(e){!u&&l&&(h?f(e):s=e)}},u=!1,h=!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;c.supported=!0}catch{}e.deleteTexture(t),u=!0}var p;typeof document<"u"&&(l=document.createElement("img"),l.onload=()=>{s&&f(s),s=null,h=!0},l.onerror=()=>{u=!0,s=null},l.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(e){let r,n,i,a;e.resetRequestQueue=()=>{r=[],n=0,i=0,a={}},e.addThrottleControl=e=>{let t=i++;return a[t]=e,t},e.removeThrottleControl=e=>{delete a[e],s()},e.getImage=(e,n,i=!0)=>new Promise(((a,o)=>{c.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),t.e(e,{type:"image"}),r.push({abortController:n,requestParameters:e,supportImageRefresh:i,state:"queued",onError:e=>{o(e)},onSuccess:e=>{a(e)}}),s()}));let o=e=>t._(this,void 0,void 0,(function*(){e.state="running";let{requestParameters:r,supportImageRefresh:i,onError:a,onSuccess:o,abortController:c}=e,u=!1===i&&!t.i(self)&&!t.g(r.url)&&(!r.headers||Object.keys(r.headers).reduce(((e,t)=>e&&"accept"===t),!0));n++;let h=u?l(r,c):t.m(r,c);try{let r=yield h;delete e.abortController,e.state="completed",r.data instanceof HTMLImageElement||t.b(r.data)?o(r):r.data&&o({data:yield(f=r.data,"function"==typeof createImageBitmap?t.d(f):t.f(f)),cacheControl:r.cacheControl,expires:r.expires})}catch(t){delete e.abortController,a(t)}finally{n--,s()}var f})),s=()=>{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=n;t<e&&r.length>0;t++){let e=r.shift();e.abortController.signal.aborted?t--:o(e)}},l=(e,r)=>new Promise(((n,i)=>{let a=new Image,o=e.url,s=e.credentials;s&&"include"===s?a.crossOrigin="use-credentials":(s&&"same-origin"===s||!t.s(o))&&(a.crossOrigin="anonymous"),r.signal.addEventListener("abort",(()=>{a.src="",i(t.c())})),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,n({data:a})},a.onerror=()=>{a.onerror=a.onload=null,r.signal.aborted||i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},a.src=o}))}(p||(p={})),p.resetRequestQueue();class d{constructor(e){this._transformRequestFn=e}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function m(e){var r=new t.A(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}var g,y=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e};g=new t.A(3),t.A!=Float32Array&&(g[0]=0,g[1]=0,g[2]=0);var v,x=function(e){var t=e[0],r=e[1];return t*t+r*r};function _(e){let t=[];if("string"==typeof e)t.push({id:"default",url:e});else if(e&&e.length>0){let r=[];for(let{id:n,url:i}of e){let e=`${n}${i}`;-1===r.indexOf(e)&&(r.push(e),t.push({id:n,url:i}))}}return t}function b(e,t,r){let n=e.split("?");return n[0]+=`${t}${r}`,n.join("?")}v=new t.A(2),t.A!=Float32Array&&(v[0]=0,v[1]=0);class w{constructor(e,t,r,n){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,n)}update(e,r,n){let{width:i,height:a}=e,o=!(this.size&&this.size[0]===i&&this.size[1]===a||n),{context:s}=this,{gl:l}=s;if(this.useMipmap=!(!r||!r.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!r||!1!==r.premultiply)),o)this.size=[i,a],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||t.b(e)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,e):l.texImage2D(l.TEXTURE_2D,0,this.format,i,a,0,this.format,l.UNSIGNED_BYTE,e.data);else{let{x:r,y:o}=n||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||t.b(e)?l.texSubImage2D(l.TEXTURE_2D,0,r,o,l.RGBA,l.UNSIGNED_BYTE,e):l.texSubImage2D(l.TEXTURE_2D,0,r,o,i,a,l.RGBA,l.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(e,t,r){let{context:n}=this,{gl:i}=n;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),e!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||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 T(e){let{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class k 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 r=this.images[e];if(r&&!r.data&&r.spriteData){let e=r.spriteData;r.data=new t.R({width:e.width,height:e.height},e.context.getImageData(e.x,e.y,e.width,e.height).data),r.spriteData=null}return r}addImage(e,t){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,t)&&(this.images[e]=t)}_validate(e,r){let n=!0,i=r.data||r.spriteData;return this._validateStretch(r.stretchX,i&&i.width)||(this.fire(new t.j(new Error(`Image "${e}" has invalid "stretchX" value`))),n=!1),this._validateStretch(r.stretchY,i&&i.height)||(this.fire(new t.j(new Error(`Image "${e}" has invalid "stretchY" value`))),n=!1),this._validateContent(r.content,r)||(this.fire(new t.j(new Error(`Image "${e}" has invalid "content" value`))),n=!1),n}_validateStretch(e,t){if(!e)return!0;let r=0;for(let n of e){if(n[0]<r||n[1]<n[0]||t<n[1])return!1;r=n[1]}return!0}_validateContent(e,t){if(!e)return!0;if(4!==e.length)return!1;let r=t.spriteData,n=r&&r.width||t.data.width,i=r&&r.height||t.data.height;return!(e[0]<0||n<e[0]||e[1]<0||i<e[1]||e[2]<0||n<e[2]||e[3]<0||i<e[3]||e[2]<e[0]||e[3]<e[1])}updateImage(e,t,r=!0){let n=this.getImage(e);if(r&&(n.data.width!==t.data.width||n.data.height!==t.data.height))throw new Error(`size mismatch between old image (${n.data.width}x${n.data.height}) and new image (${t.data.width}x${t.data.height}).`);t.version=n.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,r)=>{let n=!0;if(!this.isLoaded())for(let t of e)this.images[t]||(n=!1);this.isLoaded()||n?t(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:t})}))}_getImagesForIds(e){let r={};for(let n of e){let e=this.getImage(n);e||(this.fire(new t.k("styleimagemissing",{id:n})),e=this.getImage(n)),e?r[n]={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 "${n}" 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 r}getPixelSize(){let{width:e,height:t}=this.atlasImage;return{width:e,height:t}}getPattern(e){let r=this.patterns[e],n=this.getImage(e);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{let r={w:n.data.width+2,h:n.data.height+2,x:0,y:0},i=new t.I(r,n);this.patterns[e]={bin:r,position:i}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){let t=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new w(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:r,h:n}=t.p(e),i=this.atlasImage;i.resize({width:r||1,height:n||1});for(let e in this.patterns){let{bin:r}=this.patterns[e],n=r.x+1,a=r.y+1,o=this.getImage(e).data,s=o.width,l=o.height;t.R.copy(o,i,{x:0,y:0},{x:n,y:a},{width:s,height:l}),t.R.copy(o,i,{x:0,y:l-1},{x:n,y:a-1},{width:s,height:1}),t.R.copy(o,i,{x:0,y:0},{x:n,y:a+l},{width:s,height:1}),t.R.copy(o,i,{x:s-1,y:0},{x:n-1,y:a},{width:1,height:l}),t.R.copy(o,i,{x:0,y:0},{x:n+s,y:a},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(let r of e){if(this.callbackDispatchedThisFrame[r])continue;this.callbackDispatchedThisFrame[r]=!0;let e=this.getImage(r);e||t.w(`Image with ID: "${r}" was not found`),T(e)&&this.updateImage(r,e)}}}let A,M=1e20;function S(e,t,r,n,i,a,o,s,l){for(let c=t;c<t+n;c++)E(e,r*a+c,a,i,o,s,l);for(let c=r;c<r+i;c++)E(e,c*a+t,1,n,o,s,l)}function E(e,t,r,n,i,a,o){a[0]=0,o[0]=-M,o[1]=M,i[0]=e[t];for(let s=1,l=0,c=0;s<n;s++){i[s]=e[t+s*r];let n=s*s;do{let e=a[l];c=(i[s]-i[e]+n-e*e)/(s-e)/2}while(c<=o[l]&&--l>-1);l++,a[l]=s,o[l]=c,o[l+1]=M}for(let s=0,l=0;s<n;s++){for(;o[l+1]<s;)l++;let n=a[l],c=s-n;e[t+s*r]=i[n]+c*c}}class C{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 r in e)for(let n of e[r])t.push(this._getAndCacheGlyphsPromise(r,n));let r=yield Promise.all(t),n={};for(let{stack:e,id:t,glyph:i}of r)n[e]||(n[e]={}),n[e][t]=i&&{id:i.id,bitmap:i.bitmap.clone(),metrics:i.metrics};return n}))}_getAndCacheGlyphsPromise(e,r){return t._(this,void 0,void 0,(function*(){let t=this.entries[e];t||(t=this.entries[e]={glyphs:{},requests:{},ranges:{}});let n=t.glyphs[r];if(void 0!==n)return{stack:e,id:r,glyph:n};if(n=this._tinySDF(t,e,r),n)return t.glyphs[r]=n,{stack:e,id:r,glyph:n};let i=Math.floor(r/256);if(256*i>65535)throw new Error("glyphs > 65535 not supported");if(t.ranges[i])return{stack:e,id:r,glyph:n};if(!this.url)throw new Error("glyphsUrl is not set");if(!t.requests[i]){let r=C.loadGlyphRange(e,i,this.url,this.requestManager);t.requests[i]=r}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:r,glyph:a[r]||null}}))}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(e))}_tinySDF(e,r,n){let i=this.localIdeographFontFamily;if(!i||!this._doesCharSupportLocalGlyph(n))return;let a=e.tinySDF;if(!a){let t="400";/bold/i.test(r)?t="900":/medium/i.test(r)?t="500":/light/i.test(r)&&(t="200"),a=e.tinySDF=new C.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:t})}let o=a.draw(String.fromCharCode(n));return{id:n,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}}}}C.loadGlyphRange=function(e,r,n,i){return t._(this,void 0,void 0,(function*(){let a=256*r,o=a+255,s=i.transformRequest(n.replace("{fontstack}",e).replace("{range}",`${a}-${o}`),"Glyphs"),l=yield t.l(s,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${r}, ${a}-${o}`);let c={};for(let e of t.n(l.data))c[e.id]=e;return c}))},C.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:r=8,cutoff:n=.25,fontFamily:i="sans-serif",fontWeight:a="normal",fontStyle:o="normal"}={}){this.buffer=t,this.cutoff=n,this.radius=r;let s=this.size=e+4*t,l=this._createCanvas(s),c=this.ctx=l.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:r,actualBoundingBoxDescent:n,actualBoundingBoxLeft:i,actualBoundingBoxRight:a}=this.ctx.measureText(e),o=Math.ceil(r),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-i))),l=Math.min(this.size-this.buffer,o+Math.ceil(n)),c=s+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),f=new Uint8ClampedArray(h),p={data:f,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:o,glyphLeft:0,glyphAdvance:t};if(0===s||0===l)return p;let{ctx:d,buffer:m,gridInner:g,gridOuter:y}=this;d.clearRect(m,m,s,l),d.fillText(e,m,m+o);let v=d.getImageData(m,m,s,l);y.fill(M,0,h),g.fill(0,0,h);for(let e=0;e<l;e++)for(let t=0;t<s;t++){let r=v.data[4*(e*s+t)+3]/255;if(0===r)continue;let n=(e+m)*c+t+m;if(1===r)y[n]=0,g[n]=M;else{let e=.5-r;y[n]=e>0?e*e:0,g[n]=e<0?e*e:0}}S(y,0,0,c,u,c,this.f,this.v,this.z),S(g,m,m,s,l,c,this.f,this.v,this.z);for(let e=0;e<h;e++){let t=Math.sqrt(y[e])-Math.sqrt(g[e]);f[e]=Math.round(255-255*(t/this.radius+this.cutoff))}return p}};class I{constructor(){this.specification=t.v.light.position}possiblyEvaluate(e,r){return t.x(e.expression.evaluate(r))}interpolate(e,r,n){return{x:t.y.number(e.x,r.x,n),y:t.y.number(e.y,r.y,n),z:t.y.number(e.z,r.z,n)}}}class L extends t.E{constructor(e){super(),A=A||new t.q({anchor:new t.D(t.v.light.anchor),position:new I,color:new t.D(t.v.light.color),intensity:new t.D(t.v.light.intensity)}),this._transitionable=new t.T(A),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,r={}){if(!this._validate(t.r,e,r))for(let t in e){let r=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-11),r):this._transitionable.setValue(t,r)}}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,r,n){return(!n||!1!==n.validate)&&t.t(this,e.call(t.u,{value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.v}))}}let P=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 z extends t.E{constructor(e){super(),this._transitionable=new t.T(P),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new t.z(0))}setSky(e,r={}){if(!this._validate(t.B,e,r)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let t in e){let r=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-11),r):this._transitionable.setValue(t,r)}}}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,r,n={}){return!1!==n?.validate&&t.t(this,e.call(t.u,t.e({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.v})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class D{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 r=e.join(",")+String(t);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(e,t)),this.dashEntry[r]}getDashRanges(e,t,r){let n=[],i=e.length%2==1?-e[e.length-1]*r:0,a=e[0]*r,o=!0;n.push({left:i,right:a,isDash:o,zeroLength:0===e[0]});let s=e[0];for(let t=1;t<e.length;t++){o=!o;let l=e[t];i=s*r,s+=l,a=s*r,n.push({left:i,right:a,isDash:o,zeroLength:0===l})}return n}addRoundDash(e,t,r){let n=t/2;for(let t=-r;t<=r;t++){let i=this.width*(this.nextRow+r+t),a=0,o=e[a];for(let s=0;s<this.width;s++){s/o.right>1&&(o=e[++a]);let l,c=Math.abs(s-o.left),u=Math.abs(s-o.right),h=Math.min(c,u),f=t/r*(n+1);if(o.isDash){let e=n-Math.abs(f);l=Math.sqrt(h*h+e*e)}else l=n-Math.sqrt(h*h+f*f);this.data[i+s]=Math.max(0,Math.min(255,l+128))}}}addRegularDash(e){for(let t=e.length-1;t>=0;--t){let r=e[t],n=e[t+1];r.zeroLength?e.splice(t,1):n&&n.isDash===r.isDash&&(n.left=r.left,e.splice(t,1))}let t=e[0],r=e[e.length-1];t.isDash===r.isDash&&(t.left=r.left-this.width,r.right=t.right+this.width);let n=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 r=Math.abs(t-a.left),o=Math.abs(t-a.right),s=Math.min(r,o);this.data[n+t]=Math.max(0,Math.min(255,(a.isDash?s:-s)+128))}}addDash(e,r){let n=r?7:0,i=2*n+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(0!==a){let t=this.width/a,i=this.getDashRanges(e,this.width,t);r?this.addRoundDash(i,t,n):this.addRegularDash(i)}let o={y:(this.nextRow+n+.5)/this.height,height:2*n/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 O="maplibre_preloaded_worker_pool";class R{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<R.workerCount;)this.workers.push(new Worker(t.a.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],0===this.numActive()&&(this.workers.forEach((e=>{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[O]}numActive(){return Object.keys(this.active).length}}let F,B,j=Math.floor(a.hardwareConcurrency/2);function N(){return F||(F=new R),F}R.workerCount=t.C(globalThis)?Math.max(Math.min(j,3),1):1;class U{constructor(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=r;let n=this.workerPool.acquire(r);for(let e=0;e<n.length;e++){let i=new t.F(n[e],r);i.name=`Worker ${e}`,this.actors.push(i)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,t){let r=[];for(let n of this.actors)r.push(n.sendAsync({type:e,data:t}));return Promise.all(r)}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 r of this.actors)r.registerMessageHandler(e,t)}}function V(){return B||(B=new U(N(),t.G),B.registerMessageHandler("GR",((e,r,n)=>t.m(r,n)))),B}function q(e,r){let n=t.H();return t.J(n,n,[1,1,0]),t.K(n,n,[.5*e.width,.5*e.height,1]),t.L(n,n,e.calculatePosMatrix(r.toUnwrapped()))}function H(e,t,r,n,i,a){let o=function(e,t,r){if(e)for(let n of e){let e=t[n];if(e&&e.source===r&&"fill-extrusion"===e.type)return!0}else for(let e in t){let n=t[e];if(n.source===r&&"fill-extrusion"===n.type)return!0}return!1}(i&&i.layers,t,e.id),s=a.maxPitchScaleFactor(),l=e.tilesIn(n,s,o);l.sort(G);let c=[];for(let n of l)c.push({wrappedTileID:n.tileID.wrapped().key,queryResults:n.tile.queryRenderedFeatures(t,r,e._state,n.queryGeometry,n.cameraQueryGeometry,n.scale,i,a,s,q(e.transform,n.tileID))});let u=function(e){let t={},r={};for(let n of e){let e=n.queryResults,i=n.wrappedTileID,a=r[i]=r[i]||{};for(let r in e){let n=e[r],i=a[r]=a[r]||{},o=t[r]=t[r]||[];for(let e of n)i[e.featureIndex]||(i[e.featureIndex]=!0,o.push(e))}}return t}(c);for(let t in u)u[t].forEach((t=>{let r=t.feature,n=e.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return u}function G(e,t){let r=e.tileID,n=t.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}function W(e,r,n){return t._(this,void 0,void 0,(function*(){let i=e;if(e.url?i=(yield t.h(r.transformRequest(e.url,"Source"),n)).data:yield a.frameAsync(n),!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 Z{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(4===e.length?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 r,n,i=this._sw,a=this._ne;if(e instanceof t.N)r=e,n=e;else{if(!(e instanceof Z))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(Z.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(r=e._sw,n=e._ne,!r||!n)return this}return i||a?(i.lng=Math.min(r.lng,i.lng),i.lat=Math.min(r.lat,i.lat),a.lng=Math.max(n.lng,a.lng),a.lat=Math.max(n.lat,a.lat)):(this._sw=new t.N(r.lng,r.lat),this._ne=new t.N(n.lng,n.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:r,lat:n}=t.N.convert(e),i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i}static convert(e){return e instanceof Z?e:e&&new Z(e)}static fromLngLat(e,r=0){let n=360*r/40075017,i=n/Math.cos(Math.PI/180*e.lat);return new Z(new t.N(e.lng-i,e.lat-n),new t.N(e.lng+i,e.lat+n))}adjustAntiMeridian(){let e=new t.N(this._sw.lng,this._sw.lat),r=new t.N(this._ne.lng,this._ne.lat);return new Z(e,e.lng>r.lng?new t.N(r.lng+360,r.lat):r)}}class Y{constructor(e,t,r){this.bounds=Z.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=r||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[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 r=Math.pow(2,e.z),n=Math.floor(t.O(this.bounds.getWest())*r),i=Math.floor(t.Q(this.bounds.getNorth())*r),a=Math.ceil(t.O(this.bounds.getEast())*r),o=Math.ceil(t.Q(this.bounds.getSouth())*r);return e.x>=n&&e.x<a&&e.y>=i&&e.y<o}}class X extends t.E{constructor(e,r,n,i){if(super(),this.id=e,this.dispatcher=n,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(r,["url","scheme","tileSize","promoteId"])),this._options=t.e({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new 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 W(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 Y(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(),this._tileJSONRequest=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),r={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};r.request.collectResourceTiming=this._collectResourceTiming;let n="RT";if(e.actor&&"expired"!==e.state){if("loading"===e.state)return new Promise(((t,r)=>{e.reloadPromise={resolve:t,reject:r}}))}else e.actor=this.dispatcher.getActor(),n="LT";e.abortController=new AbortController;try{let t=yield e.actor.sendAsync({type:n,data:r},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,t)}catch(t){if(delete e.abortController,e.aborted)return;if(t&&404!==t.status)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 $ extends t.E{constructor(e,r,n,i){super(),this.id=e,this.dispatcher=n,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"},r),t.e(this,t.M(r,["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 W(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,e&&(t.e(this,e),e.bounds&&(this.tileBounds=new Y(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(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=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 r=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(r&&r.data){this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&e.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});let t=this.map.painter.context,n=t.gl,i=r.data;e.texture=this.map.painter.getTileTexture(i.width),e.texture?e.texture.update(i,{useMipmap:!0}):(e.texture=new w(t,i,n.RGBA,{useMipmap:!0}),e.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.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 K extends ${constructor(e,r,n,i){super(e,r,n,i),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(e){return t._(this,void 0,void 0,(function*(){let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n=this.map._requestManager.transformRequest(r,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let r=yield p.getImage(n,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(r&&r.data){let n=r.data;this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&e.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});let i=t.b(n)&&t.U()?n:yield this.readImageNow(n),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};if(!e.actor||"expired"===e.state){e.actor=this.dispatcher.getActor();let t=yield e.actor.sendAsync({type:"LDT",data:a});e.dem=t,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 r=e.width+2,n=e.height+2;try{return new t.R({width:r,height:n},yield t.W(e,-1,-1,r,n))}catch{}}return a.getImageData(e,1)}))}_getNeighboringTiles(e){let r=e.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?e.wrap-1:e.wrap,o=(r.x+1+n)%n,s=r.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.S(e.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new t.S(e.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new t.S(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.S(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.S(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new t.S(e.overscaledZ,a,r.z,i,r.y+1).key]={backfilled:!1},l[new t.S(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new t.S(e.overscaledZ,s,r.z,o,r.y+1).key]={backfilled:!1}),l}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 J extends t.E{constructor(e,r,n,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=n.getActor(),this.setEventedParent(i),this._data=r.data,this._options=t.e({},r),this._collectResourceTiming=r.collectResourceTiming,void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;let a=t.X/this.tileSize;void 0!==r.clusterMaxZoom&&this.maxzoom<=r.clusterMaxZoom&&t.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${r.clusterMaxZoom}".`),this.workerOptions=t.e({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*a,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*a,extent:t.X,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?r.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:t.X,radius:(r.clusterRadius||50)*a,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions),"string"==typeof this.promoteId&&(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&&(void 0!==e.clusterRadius&&(this.workerOptions.superclusterOptions.radius=e.clusterRadius),void 0!==e.clusterMaxZoom&&(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,r){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:t,offset:r}})}_updateWorkerData(e){return t._(this,void 0,void 0,(function*(){let r=t.e({type:this.type},this.workerOptions);e?r.dataDiff=e:"string"==typeof this._data?(r.request=this.map._requestManager.transformRequest(a.resolveURL(this._data),"Source"),r.request.collectResourceTiming=this._collectResourceTiming):r.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:r});if(this._pendingLoads--,this._removed||e.abandoned)return void this.fire(new t.k("dataabort",{dataType:"source"}));let n=null;e.resourceTiming&&e.resourceTiming[this.id]&&(n=e.resourceTiming[this.id].slice(0));let i={dataType:"source"};this._collectResourceTiming&&n&&n.length>0&&t.e(i,{resourceTiming:n}),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 0===this._pendingLoads}loadTile(e){return t._(this,void 0,void 0,(function*(){let t=e.actor?"RT":"LT";e.actor=this.actor;let r={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 n=yield this.actor.sendAsync({type:t,data:r},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(n,this.map.painter,"RT"===t)}))}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,r,n){super(),this.id=e,this.dispatcher=r,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),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(),this._request=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(),this._request=null)}setCoordinates(e){this.coordinates=e;let r=e.map(t.Z.fromLngLat);this.tileID=function(e){let r=1/0,n=1/0,i=-1/0,a=-1/0;for(let t of e)r=Math.min(r,t.x),n=Math.min(n,t.y),i=Math.max(i,t.x),a=Math.max(a,t.y);let o=Math.max(i-r,a-n),s=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),l=Math.pow(2,s);return new t.a1(s,Math.floor((r+i)/2*l),Math.floor((n+a)/2*l))}(r),this.minzoom=this.maxzoom=this.tileID.z;let n=r.map((e=>this.tileID.getTilePoint(e)._round()));return this._boundsArray=new t.$,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,t.X,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,t.X),this._boundsArray.emplaceBack(n[2].x,n[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(0===Object.keys(this.tiles).length||!this.image)return;let e=this.map.painter.context,r=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new w(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(let e in this.tiles){let t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,n=!0)}n&&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,r,n){super(e,t,r,n),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 r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.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(0===Object.keys(this.tiles).length||this.video.readyState<2)return;let e=this.map.painter.context,r=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new w(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(let e in this.tiles){let t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,n=!0)}n&&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 re extends ee{constructor(e,r,n,i){super(e,r,n,i),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e))))||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"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.j(new t.a2(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.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=r,this.animate=void 0===r.animate||r.animate}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(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()||0===Object.keys(this.tiles).length)return;let r=this.map.painter.context,n=r.gl;this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new w(r,this.canvas,n.RGBA,{premultiply:!0});let i=!1;for(let e in this.tiles){let t=this.tiles[e];"loaded"!==t.state&&(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 ne={},ie=e=>{switch(e){case"geojson":return J;case"image":return ee;case"raster":return $;case"raster-dem":return K;case"vector":return X;case"video":return te;case"canvas":return re}return ne[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 new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=a.resolveURL(e),!this.url)throw new Error(`requested url ${e} is invalid`);if("unavailable"===this.status){if(!t)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)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(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let se=null;function le(){return se||(se=new oe),se}class ce{constructor(e,r){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=t.a4(),this.uses=0,this.tileSize=r,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"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,r,n){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 r={};if(!t)return r;for(let n of e){let e=n.layerIds.map((e=>t.getLayer(e))).filter(Boolean);if(0!==e.length){n.layers=e,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(let t of e)r[t.id]=n}}return r}(e.buckets,r.style),this.hasSymbolBuckets=!1;for(let e in this.buckets){let r=this.buckets[e];if(r instanceof t.a6){if(this.hasSymbolBuckets=!0,!n)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let e in this.buckets){let r=this.buckets[e];if(r instanceof t.a6&&r.hasRTLText){this.hasRTLText=!0,le().lazyLoad();break}}this.queryPadding=0;for(let e in this.buckets){let t=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,r.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&&(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 r=this.buckets[t];r.uploadPending()&&r.upload(e)}let t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new w(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new w(e,this.glyphAtlasImage,t.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,r,n,i,a,o,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:o,queryPadding:this.queryPadding*l},e,t,r):{}}querySourceFeatures(e,r){let n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;let i=n.loadVTLayers(),a=r&&r.sourceLayer?r.sourceLayer:"",o=i._geojsonTileLayer||i[a];if(!o)return;let s=t.a7(r&&r.filter),{z:l,x:c,y:u}=this.tileID.canonical,h={z:l,x:c,y:u};for(let r=0;r<o.length;r++){let i=o.feature(r);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=n.getId(i,a),p=new t.a9(i,l,c,u,f);p.tile=h,e.push(p)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){let r=this.expirationTime;if(e.cacheControl){let r=t.aa(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["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(r)if(this.expirationTime<r)t=!0;else{let n=this.expirationTime-r;n?this.expirationTime=e+Math.max(n,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(),Math.pow(2,31)-1)}setFeatureState(e,t){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(e).length)return;let r=this.latestFeatureIndex.loadVTLayers();for(let n in this.buckets){if(!t.style.hasLayer(n))continue;let i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=e[a];if(!o||!s||0===Object.keys(s).length)continue;i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});let l=t&&t.style&&t.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(i)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<a.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=a.now()+e}setDependencies(e,t){let r={};for(let e of t)r[e]=!0;this.dependencies[e]=r}hasDependency(e,t){for(let r of e){let e=this.dependencies[r];if(e)for(let r of t)if(e[r])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,r){let n=e.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);let i={value:t,timeout:void 0};if(void 0!==r&&(i.timeout=setTimeout((()=>{this.remove(e,i)}),r)),this.data[n].push(i),this.order.push(n),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),0===this.data[e].length&&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 r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),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 r in this.data)for(let n of this.data[r])e(n.value)||t.push(n);for(let e of t)this.remove(e.value.tileID,e)}}class he{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,r,n){let i=String(r);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][i]=this.stateChanges[e][i]||{},t.e(this.stateChanges[e][i],n),null===this.deletedStates[e]){this.deletedStates[e]={};for(let t in this.state[e])t!==i&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][i]){this.deletedStates[e][i]={};for(let t in this.state[e][i])n[t]||(this.deletedStates[e][i][t]=null)}else for(let t in n)this.deletedStates[e]&&this.deletedStates[e][i]&&null===this.deletedStates[e][i][t]&&delete this.deletedStates[e][i][t]}removeFeatureState(e,t,r){if(null===this.deletedStates[e])return;let n=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&void 0!==t)null!==this.deletedStates[e][n]&&(this.deletedStates[e][n]=this.deletedStates[e][n]||{},this.deletedStates[e][n][r]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][n])for(r in this.deletedStates[e][n]={},this.stateChanges[e][n])this.deletedStates[e][n][r]=null;else this.deletedStates[e][n]=null;else this.deletedStates[e]=null}getState(e,r){let n=String(r),i=t.e({},(this.state[e]||{})[n],(this.stateChanges[e]||{})[n]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){let t=this.deletedStates[e][r];if(null===t)return{};for(let e in t)delete i[e]}return i}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(e,r){let n={};for(let e in this.stateChanges){this.state[e]=this.state[e]||{};let r={};for(let n in this.stateChanges[e])this.state[e][n]||(this.state[e][n]={}),t.e(this.state[e][n],this.stateChanges[e][n]),r[n]=this.state[e][n];n[e]=r}for(let e in this.deletedStates){this.state[e]=this.state[e]||{};let r={};if(null===this.deletedStates[e])for(let t in this.state[e])r[t]={},this.state[e][t]={};else for(let t in this.deletedStates[e]){if(null===this.deletedStates[e][t])this.state[e][t]={};else for(let r of Object.keys(this.deletedStates[e][t]))delete this.state[e][t][r];r[t]=this.state[e][t]}n[e]=n[e]||{},t.e(n[e],r)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(let t in e)e[t].setFeatureState(n,r)}}class fe extends t.E{constructor(e,t,r){super(),this.id=e,this.dispatcher=r,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,r,n)=>{let i=new(ie(t.type))(e,t,r,n);if(i.id!==e)throw new Error(`Expected Source id to be ${e} instead of ${i.id}`);return i})(e,t,r,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 he,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(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let e in this._tiles){let t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)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,r,n){return t._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,r,n)}catch(r){e.state="errored",404!==r.status?this._source.fire(new t.j(r,{tile:e})):this.update(this.transform,this.terrain)}}))}_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 r=this._tiles[t];r.upload(e),r.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((e=>e.tileID)).sort(pe).map((e=>e.key))}getRenderableIds(e){let r=[];for(let t in this._tiles)this._isIdRenderable(t,e)&&r.push(this._tiles[t]);return e?r.sort(((e,r)=>{let n=e.tileID,i=r.tileID,a=new t.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),o=new t.P(i.canonical.x,i.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-i.overscaledZ||o.y-a.y||o.x-a.x})).map((e=>e.tileID.key)):r.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)"errored"!==this._tiles[e].state&&this._reloadTile(e,"reloading")}}_reloadTile(e,r){return t._(this,void 0,void 0,(function*(){let t=this._tiles[e];t&&("loading"!==t.state&&(t.state=r),yield this._loadTile(t,e,r))}))}_tileLoaded(e,r,n){e.timeAdded=a.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&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 n=0;n<t.length;n++){let i=t[n];if(e.neighboringTiles&&e.neighboringTiles[i]){let t=this.getTileByID(i);r(e,t),r(t,e)}}function r(e,t){e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0;let r=t.tileID.canonical.x-e.tileID.canonical.x,n=t.tileID.canonical.y-e.tileID.canonical.y,i=Math.pow(2,e.tileID.canonical.z),a=t.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,n),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,r,n){for(let i in this._tiles){let a=this._tiles[i];if(n[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>r)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]){n[o.key]=o;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){let r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(let r=e.overscaledZ-1;r>=t;r--){let t=e.scaledTo(r),n=this._getLoadedTile(t);if(n)return n}}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 r=Math.ceil(e.width/this._source.tileSize)+1,n=Math.ceil(e.height/this._source.tileSize)+1,i=Math.floor(r*n*(null===this._maxTileCacheZoomLevels?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(a)}handleWrapJump(e){let t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){let e={};for(let r in this._tiles){let n=this._tiles[r];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+t),e[n.tileID.key]=n}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,r,n,i,o){let s={},l={},c=Object.keys(e),u=a.now();for(let r of c){let n=e[r],i=this._tiles[r];if(!i||0!==i.fadeEndTime&&i.fadeEndTime<=u)continue;let a=this.findLoadedParent(n,t),o=this.findLoadedSibling(n),c=a||o||null;c&&(this._addTile(c.tileID),s[c.tileID.key]=c.tileID),l[r]=n}this._retainLoadedChildren(l,n,r,e);for(let t in s)e[t]||(this._coveredTiles[t]=!0,e[t]=s[t]);if(o){let t={},r={};for(let e of i)this._tiles[e.key].hasData()?t[e.key]=e:r[e.key]=e;for(let n in r){let i=r[n].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 r[n])}for(let n in r){let i=r[n],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,r){if(!this._sourceLoaded||this._paused)return;let n;this.transform=e,this.terrain=r,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((e=>new t.S(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y))):(n=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:r}),this._source.hasTile&&(n=n.filter((e=>this._source.hasTile(e))))):n=[];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 n)if(t.canonical.z>this._source.minzoom){let r=t.scaledTo(t.canonical.z-1);e[r.key]=r;let n=t.scaledTo(Math.max(this._source.minzoom,Math.min(t.canonical.z,5)));e[n.key]=n}n=n.concat(Object.values(e))}let s=0===n.length&&!this._updated&&this._didEmitContent;this._updated=!0,s&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let l=this._updateRetainedTiles(n,i);de(this._source.type)&&this._updateCoveredAndRetainedTiles(l,a,o,i,n,r);for(let e in l)this._tiles[e].clearFadeHold();let c=t.ab(this._tiles,l);for(let e of c){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 r;let n={},i={},a=Math.max(t-fe.maxOverzooming,this._source.minzoom),o=Math.max(t+fe.maxUnderzooming,this._source.minzoom),s={};for(let r of e){let e=this._addTile(r);n[r.key]=r,e.hasData()||t<this._source.maxzoom&&(s[r.key]=r)}this._retainLoadedChildren(s,t,o,n);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()){n[e.key]=e;continue}}else{let e=o.children(this._source.maxzoom);if(n[e[0].key]&&n[e[1].key]&&n[e[2].key]&&n[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||!(null!==(r=this.map)&&void 0!==r&&r.cancelPendingTileRequestsWhileZooming)||s)&&(n[a.key]=a),s=e.wasRequested(),t)break}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let e in this._tiles){let t,r=[],n=this._tiles[e].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){t=this._loadedParentTiles[n.key];break}r.push(n.key);let e=n.scaledTo(n.overscaledZ-1);if(t=this._getLoadedTile(e),t)break;n=e}for(let e of r)this._loadedParentTiles[e]=t}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let e in this._tiles){let t=this._tiles[e].tileID,r=this._getLoadedTile(t);this._loadedSiblingTiles[t.key]=r}}_addTile(e){let r=this._tiles[e.key];if(r)return r;r=this._cache.getAndRemove(e),r&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));let n=r;return r||(r=new ce(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,e.key,r.state)),r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.k("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);let r=t.getExpiryTimeout();r&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),r))}_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()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}_dataHandler(e){let t=e.sourceDataType;"source"===e.dataType&&"metadata"===t&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===t&&(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,r,n){let i=[],a=this.transform;if(!a)return i;let o=n?a.getCameraQueryGeometry(e):e,s=e.map((e=>a.pointCoordinate(e,this.terrain))),l=o.map((e=>a.pointCoordinate(e,this.terrain))),c=this.getIds(),u=1/0,h=1/0,f=-1/0,p=-1/0;for(let e of l)u=Math.min(u,e.x),h=Math.min(h,e.y),f=Math.max(f,e.x),p=Math.max(p,e.y);for(let e=0;e<c.length;e++){let n=this._tiles[c[e]];if(n.holdingForFade())continue;let o=n.tileID,d=Math.pow(2,a.zoom-n.tileID.overscaledZ),m=r*n.queryPadding*t.X/n.tileSize/d,g=[o.getTilePoint(new t.Z(u,h)),o.getTilePoint(new t.Z(f,p))];if(g[0].x-m<t.X&&g[0].y-m<t.X&&g[1].x+m>=0&&g[1].y+m>=0){let e=s.map((e=>o.getTilePoint(e))),t=l.map((e=>o.getTilePoint(e)));i.push({tile:n,tileID:o,queryGeometry:e,cameraQueryGeometry:t,scale:d})}}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(de(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,r){this._state.updateState(e=e||"_geojsonTileLayer",t,r)}removeFeatureState(e,t,r){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,r)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,r){let n=this._tiles[e];n&&n.setDependencies(t,r)}reloadTilesForDependencies(e,t){for(let r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((r=>!r.hasDependency(e,t)))}}function pe(e,t){let r=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function de(e){return"raster"===e||"image"===e||"video"===e}fe.maxOverzooming=10,fe.maxUnderzooming=3;class me{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(1===this.points.length)return this.points[0];e=t.ac(e,0,1);let r=1,n=this._distances[r],i=e*this.paddedLength+this.padding;for(;n<i&&r<this._distances.length;)n=this._distances[++r];let a=r-1,o=this._distances[a],s=n-o,l=s>0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}}function ge(e,t){let r=!0;return"always"===e||"never"!==e&&"never"!==t||(r=!1),r}class ye{constructor(e,t,r){let n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(let e=0;e<this.xCellCount*this.yCellCount;e++)n.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,r,n,i){this._forEachCell(t,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)}insertCircle(e,t,r,n){this._forEachCell(t-n,r-n,t+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(n)}_insertBoxCell(e,t,r,n,i,a){this.boxCells[i].push(a)}_insertCircleCell(e,t,r,n,i,a){this.circleCells[i].push(a)}_query(e,t,r,n,i,a,o){if(r<0||e>this.width||n<0||t>this.height)return[];let s=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(i)return[{key:null,x1:e,y1:t,x2:r,y2:n}];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],r=this.circles[3*e+1],n=this.circles[3*e+2];s.push({key:this.circleKeys[e],x1:t-n,y1:r-n,x2:t+n,y2:r+n})}}else this._forEachCell(e,t,r,n,this._queryCell,s,{hitTest:i,overlapMode:a,seenUids:{box:{},circle:{}}},o);return s}query(e,t,r,n){return this._query(e,t,r,n,!1,null)}hitTest(e,t,r,n,i,a){return this._query(e,t,r,n,!0,i,a).length>0}hitTestCircle(e,t,r,n,i){let a=e-r,o=e+r,s=t-r,l=t+r;if(o<0||a>this.width||l<0||s>this.height)return!1;let c=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}},i),c.length>0}_queryCell(e,t,r,n,i,a,o,s){let{seenUids:l,hitTest:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){let i=this.bboxes;for(let o of h)if(!l.box[o]){l.box[o]=!0;let h=4*o,f=this.boxKeys[o];if(e<=i[h+2]&&t<=i[h+3]&&r>=i[h+0]&&n>=i[h+1]&&(!s||s(f))&&(!c||!ge(u,f.overlapMode))&&(a.push({key:f,x1:i[h],y1:i[h+1],x2:i[h+2],y2:i[h+3]}),c))return!0}}let f=this.circleCells[i];if(null!==f){let i=this.circles;for(let o of f)if(!l.circle[o]){l.circle[o]=!0;let h=3*o,f=this.circleKeys[o];if(this._circleAndRectCollide(i[h],i[h+1],i[h+2],e,t,r,n)&&(!s||s(f))&&(!c||!ge(u,f.overlapMode))){let e=i[h],t=i[h+1],r=i[h+2];if(a.push({key:f,x1:e-r,y1:t-r,x2:e+r,y2:t+r}),c)return!0}}}return!1}_queryCellCircle(e,t,r,n,i,a,o,s){let{circle:l,seenUids:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){let e=this.bboxes;for(let t of h)if(!c.box[t]){c.box[t]=!0;let r=4*t,n=this.boxKeys[t];if(this._circleAndRectCollide(l.x,l.y,l.radius,e[r+0],e[r+1],e[r+2],e[r+3])&&(!s||s(n))&&!ge(u,n.overlapMode))return a.push(!0),!0}}let f=this.circleCells[i];if(null!==f){let e=this.circles;for(let t of f)if(!c.circle[t]){c.circle[t]=!0;let r=3*t,n=this.circleKeys[t];if(this._circlesCollide(e[r],e[r+1],e[r+2],l.x,l.y,l.radius)&&(!s||s(n))&&!ge(u,n.overlapMode))return a.push(!0),!0}}}_forEachCell(e,t,r,n,i,a,o,s){let l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n);for(let f=l;f<=u;f++)for(let l=c;l<=h;l++)if(i.call(this,e,t,r,n,this.xCellCount*l+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,r,n,i,a){let o=n-e,s=i-t,l=r+a;return l*l>o*o+s*s}_circleAndRectCollide(e,t,r,n,i,a,o){let s=(a-n)/2,l=Math.abs(e-(n+s));if(l>s+r)return!1;let c=(o-i)/2,u=Math.abs(t-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;let h=l-s,f=u-c;return h*h+f*f<=r*r}}function ve(e,r,n,i,a){let o=t.H();return r?(t.K(o,o,[1/a,1/a,1]),n||t.ad(o,o,i.angle)):t.L(o,i.labelPlaneMatrix,e),o}function xe(e,r,n,i,a){if(r){let r=t.ae(e);return t.K(r,r,[a,a,1]),n||t.ad(r,r,-i.angle),r}return i.glCoordMatrix}function _e(e,r,n,i){let a;i?(a=[e,r,i(e,r),1],t.af(a,a,n)):(a=[e,r,0,1],Oe(a,a,n));let o=a[3];return{point:new t.P(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function be(e,t){return.5+e/t*.5}function we(e,t){return e.x>=-t[0]&&e.x<=t[0]&&e.y>=-t[1]&&e.y<=t[1]}function Te(e,r,n,i,a,o,s,l,c,u,h,f,p,d,m){let g=i?e.textSizeData:e.iconSizeData,y=t.ag(g,n.transform.zoom),v=[256/n.width*2+1,256/n.height*2+1],x=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;x.clear();let _=e.lineVertexArray,b=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,w=n.transform.width/n.transform.height,T=!1;for(let i=0;i<b.length;i++){let k=b.get(i);if(k.hidden||k.writingMode===t.ah.vertical&&!T){De(k.numGlyphs,x);continue}T=!1;let A=_e(k.anchorX,k.anchorY,r,m);if(!we(A.point,v)){De(k.numGlyphs,x);continue}let M=be(n.transform.cameraToCenterDistance,A.signedDistanceFromCamera),S=t.ai(g,y,k),E=s?S/M:S*M,C={getElevation:m,labelPlaneMatrix:a,lineVertexArray:_,pitchWithMap:s,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:u,tileAnchorPoint:new t.P(k.anchorX,k.anchorY),unwrappedTileID:h,width:f,height:p,translation:d},I=Me(C,k,E,!1,l,r,o,e.glyphOffsetArray,x,w,c);T=I.useVertical,(I.notEnoughRoom||T||I.needsFlipping&&Me(C,k,E,!0,l,r,o,e.glyphOffsetArray,x,w,c).notEnoughRoom)&&De(k.numGlyphs,x)}i?e.text.dynamicLayoutVertexBuffer.updateData(x):e.icon.dynamicLayoutVertexBuffer.updateData(x)}function ke(e,t,r,n,i,a,o,s){let l=a.glyphStartIndex+a.numGlyphs,c=a.lineStartIndex,u=a.lineStartIndex+a.lineLength,h=t.getoffsetX(a.glyphStartIndex),f=t.getoffsetX(l-1),p=Pe(e*h,r,n,i,a.segment,c,u,s,o);if(!p)return null;let d=Pe(e*f,r,n,i,a.segment,c,u,s,o);return d?s.projectionCache.anyProjectionOccluded?null:{first:p,last:d}:null}function Ae(e,r,n,i){return e===t.ah.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.ah.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function Me(e,r,n,i,a,o,s,l,c,u,h){let f,p=n/24,d=r.lineOffsetX*p,m=r.lineOffsetY*p;if(r.numGlyphs>1){let t=r.glyphStartIndex+r.numGlyphs,n=r.lineStartIndex,o=r.lineStartIndex+r.lineLength,c=ke(p,l,d,m,i,r,h,e);if(!c)return{notEnoughRoom:!0};let g=_e(c.first.point.x,c.first.point.y,s,e.getElevation).point,y=_e(c.last.point.x,c.last.point.y,s,e.getElevation).point;if(a&&!i){let e=Ae(r.writingMode,g,y,u);if(e)return e}f=[c.first];for(let a=r.glyphStartIndex+1;a<t-1;a++)f.push(Pe(p*l.getoffsetX(a),d,m,i,r.segment,n,o,e,h));f.push(c.last)}else{if(a&&!i){let n=_e(e.tileAnchorPoint.x,e.tileAnchorPoint.y,o,e.getElevation).point,i=r.lineStartIndex+r.segment+1,a=new t.P(e.lineVertexArray.getx(i),e.lineVertexArray.gety(i)),s=_e(a.x,a.y,o,e.getElevation),l=s.signedDistanceFromCamera>0?s.point:Se(e.tileAnchorPoint,a,n,1,o,e),c=Ae(r.writingMode,n,l,u);if(c)return c}let n=Pe(p*l.getoffsetX(r.glyphStartIndex),d,m,i,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,e,h);if(!n||e.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};f=[n]}for(let e of f)t.aj(c,e.point,e.angle);return{}}function Se(e,t,r,n,i,a){let o=e.add(e.sub(t)._unit()),s=void 0!==i?_e(o.x,o.y,i,a.getElevation).point:Ce(o.x,o.y,a).point,l=r.sub(s);return r.add(l._mult(n/l.mag()))}function Ee(e,r,n){let i=r.projectionCache;if(i.projections[e])return i.projections[e];let a=new t.P(r.lineVertexArray.getx(e),r.lineVertexArray.gety(e)),o=Ce(a.x,a.y,r);if(o.signedDistanceFromCamera>0)return i.projections[e]=o.point,i.anyProjectionOccluded=i.anyProjectionOccluded||o.isOccluded,o.point;let s=e-n.direction;return Se(0===n.distanceFromAnchor?r.tileAnchorPoint:new t.P(r.lineVertexArray.getx(s),r.lineVertexArray.gety(s)),a,n.previousVertex,n.absOffsetX-n.distanceFromAnchor+1,void 0,r)}function Ce(e,t,r){let n,i=e+r.translation[0],a=t+r.translation[1];return!r.pitchWithMap&&r.projection.useSpecialProjectionForSymbols?(n=r.projection.projectTileCoordinates(i,a,r.unwrappedTileID,r.getElevation),n.point.x=(.5*n.point.x+.5)*r.width,n.point.y=(.5*-n.point.y+.5)*r.height):(n=_e(i,a,r.labelPlaneMatrix,r.getElevation),n.isOccluded=!1),n}function Ie(e,t,r){return e._unit()._perp()._mult(t*r)}function Le(e,r,n,i,a,o,s,l,c){if(l.projectionCache.offsets[e])return l.projectionCache.offsets[e];let u=n.add(r);if(e+c.direction<i||e+c.direction>=a)return l.projectionCache.offsets[e]=u,u;let h=Ee(e+c.direction,l,c),f=Ie(h.sub(n),s,c.direction),p=n.add(f),d=h.add(f);return l.projectionCache.offsets[e]=t.ak(o,u,p,d)||u,l.projectionCache.offsets[e]}function Pe(e,t,r,n,i,a,o,s,l){let c=n?e-t:e+t,u=c>0?1:-1,h=0;n&&(u*=-1,h=Math.PI),u<0&&(h+=Math.PI);let f,p=u>0?a+i:a+i+1;s.projectionCache.cachedAnchorPoint?f=s.projectionCache.cachedAnchorPoint:(f=Ce(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=f);let d,m,g,y=f,v=f,x=0,_=0,b=Math.abs(c),w=[];for(;x+_<=b;){if(p+=u,p<a||p>=o)return null;x+=_,v=y,m=d;let e={absOffsetX:b,direction:u,distanceFromAnchor:x,previousVertex:v};if(y=Ee(p,s,e),0===r)w.push(v),g=y.sub(v);else{let t,n=y.sub(v);t=0===n.mag()?Ie(Ee(p+u,s,e).sub(y),r,u):Ie(n,r,u),m||(m=v.add(t)),d=Le(p,t,y,a,o,m,r,s,e),w.push(m),g=d.sub(m)}_=g.mag()}let T=g._mult((b-x)/_)._add(m||v),k=h+Math.atan2(y.y-v.y,y.x-v.x);return w.push(T),{point:T,angle:l?k:0,path:w}}let ze=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function De(e,t){for(let r=0;r<e;r++){let e=t.length;t.resize(e+4),t.float32.set(ze,3*e)}}function Oe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e[3]=r[3]*n+r[7]*i+r[15],e}let Re=100;class Fe{constructor(e,t,r=new ye(e.width+200,e.height+200,25),n=new ye(e.width+200,e.height+200,25)){this.transform=e,this.mapProjection=t,this.grid=r,this.ignoredGrid=n,this.pitchFactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+Re,this.screenBottomBoundary=e.height+Re,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,r,n,i,a,o,s,l,c,u){let h,f=e.anchorPointX+s[0],p=e.anchorPointY+s[1],d=this.projectAndGetPerspectiveRatio(n,f,p,i,c),m=r*d.perspectiveRatio;if(a||o)h=this._projectCollisionBox(e,m,n,i,a,o,s,d,c,u);else{let t=d.point.x+(u?u.x*m:0),r=d.point.y+(u?u.y*m:0);h={allPointsOccluded:!1,box:[t+e.x1*m,r+e.y1*m,t+e.x2*m,r+e.y2*m]}}let[g,y,v,x]=h.box;return this.mapProjection.useSpecialProjectionForSymbols&&(a?h.allPointsOccluded:this.mapProjection.isOccluded(f,p,i))||d.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(g,y,v,x)||"always"!==t&&this.grid.hitTest(g,y,v,x,t,l)?{box:[g,y,v,x],placeable:!1,offscreen:!1}:{box:[g,y,v,x],placeable:!0,offscreen:this.isOffscreen(g,y,v,x)}}placeCollisionCircles(e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g){let y=[],v=new t.P(r.anchorX,r.anchorY),x=this.getPerspectiveRatio(o,v.x,v.y,s,g),_=(h?a/x:a*x)/t.ap,b={getElevation:g,labelPlaneMatrix:l,lineVertexArray:n,pitchWithMap:h,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:v,unwrappedTileID:s,width:this.transform.width,height:this.transform.height,translation:m},w=ke(_,i,r.lineOffsetX*_,r.lineOffsetY*_,!1,r,!1,b),T=!1,k=!1,A=!0;if(w){let r=.5*p*x+d,n=new t.P(-100,-100),i=new t.P(this.screenRightBoundary,this.screenBottomBoundary),a=new me,o=w.first,s=w.last,l=[];for(let e=o.path.length-1;e>=1;e--)l.push(o.path[e]);for(let e=1;e<s.path.length;e++)l.push(s.path[e]);let h=2.5*r;if(c){let e=this.projectPathToScreenSpace(l,b,c);l=e.some((e=>e.signedDistanceFromCamera<=0))?[]:e.map((e=>e.point))}let m=[];if(l.length>0){let e=l[0].clone(),r=l[0].clone();for(let t=1;t<l.length;t++)e.x=Math.min(e.x,l[t].x),e.y=Math.min(e.y,l[t].y),r.x=Math.max(r.x,l[t].x),r.y=Math.max(r.y,l[t].y);m=e.x>=n.x&&r.x<=i.x&&e.y>=n.y&&r.y<=i.y?[l]:r.x<n.x||e.x>i.x||r.y<n.y||e.y>i.y?[]:t.al([l],n.x,n.y,i.x,i.y)}for(let t of m){a.reset(t,.25*r);let n=0;n=a.length<=.5*r?1:Math.ceil(a.paddedLength/h)+1;for(let t=0;t<n;t++){let i=t/Math.max(n-1,1),o=a.lerp(i),s=o.x+Re,l=o.y+Re;y.push(s,l,r,0);let c=s-r,h=l-r,p=s+r,d=l+r;if(A=A&&this.isOffscreen(c,h,p,d),k=k||this.isInsideGrid(c,h,p,d),"always"!==e&&this.grid.hitTestCircle(s,l,r,e,f)&&(T=!0,!u))return{circles:[],offscreen:!1,collisionDetected:T}}}}return{circles:!u&&T||!k||x<this.perspectiveRatioCutoff?[]:y,offscreen:A,collisionDetected:T}}projectPathToScreenSpace(e,t,r){return e.map((e=>_e(e.x,e.y,r,t.getElevation)))}queryRenderedSymbols(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};let r=[],n=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of e){let e=new t.P(s.x+Re,s.y+Re);n=Math.min(n,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y),r.push(e)}let s=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o)),l={},c={};for(let e of s){let n=e.key;if(void 0===l[n.bucketInstanceId]&&(l[n.bucketInstanceId]={}),l[n.bucketInstanceId][n.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(r,i)&&(l[n.bucketInstanceId][n.featureIndex]=!0,void 0===c[n.bucketInstanceId]&&(c[n.bucketInstanceId]=[]),c[n.bucketInstanceId].push(n.featureIndex))}return c}insertCollisionBox(e,t,r,n,i,a){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:t},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,r,n,i,a){let o=r?this.ignoredGrid:this.grid,s={bucketInstanceId:n,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,r,n,i,a){let o;a?(o=[r,n,a(r,n),1],t.af(o,o,e)):(o=[r,n,0,1],Oe(o,o,e));let s=o[3];return{point:new t.P((o[0]/s+1)/2*this.transform.width+Re,(-o[1]/s+1)/2*this.transform.height+Re),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s*.5,isOccluded:!1,signedDistanceFromCamera:s}}getPerspectiveRatio(e,t,r,n,i){let a=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(t,r,n,i):_e(t,r,e,i);return.5+this.transform.cameraToCenterDistance/a.signedDistanceFromCamera*.5}isOffscreen(e,t,r,n){return r<Re||e>=this.screenRightBoundary||n<Re||t>this.screenBottomBoundary}isInsideGrid(e,t,r,n){return r>=0&&e<this.gridRightBoundary&&n>=0&&t<this.gridBottomBoundary}getViewportMatrix(){let e=t.an([]);return t.J(e,e,[-100,-100,0]),e}_projectCollisionBox(e,r,n,i,a,o,s,l,c,u){let h=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(n,p.x+1,p.y,i,c).point.sub(l.point).unit(),r=Math.atan(e.y/e.x)+(e.x<0?Math.PI:0),a=Math.sin(r),o=Math.cos(r);h=new t.P(o,a),f=new t.P(-a,o)}else if(!o&&a){let e=-this.transform.angle,r=Math.sin(e),n=Math.cos(e);h=new t.P(n,r),f=new t.P(-r,n)}let d=l.point,m=r;if(a){d=p;let e=this.transform.zoom-Math.floor(this.transform.zoom);m=Math.pow(2,-e),m*=this.mapProjection.getPitchedTextCorrection(this.transform,p,i),u||(m*=t.ac(.5+l.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}u&&(d=d.add(h.mult(u.x*m)).add(f.mult(u.y*m)));let g=e.x1*m,y=e.x2*m,v=(g+y)/2,x=e.y1*m,_=e.y2*m,b=(x+_)/2,w=[{offsetX:g,offsetY:x},{offsetX:v,offsetY:x},{offsetX:y,offsetY:x},{offsetX:y,offsetY:b},{offsetX:y,offsetY:_},{offsetX:v,offsetY:_},{offsetX:g,offsetY:_},{offsetX:g,offsetY:b}],T=[];for(let{offsetX:e,offsetY:r}of w)T.push(new t.P(d.x+h.x*e+f.x*r,d.y+h.y*e+f.y*r));let k=!1;if(a){let e=T.map((e=>this.projectAndGetPerspectiveRatio(n,e.x,e.y,i,c)));k=e.some((e=>!e.isOccluded)),T=e.map((e=>e.point))}else k=!0;return{box:t.ao(T),allPointsOccluded:!k}}}function Be(e,r,n){return r*(t.X/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}class je{constructor(e,t,r,n){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):n&&r?1:0,this.placed=r}isHidden(){return 0===this.opacity&&!this.placed}}class Ne{constructor(e,t,r,n,i){this.text=new je(e?e.text:null,t,r,i),this.icon=new je(e?e.icon:null,t,n,i)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ue{constructor(e,t,r){this.text=e,this.icon=t,this.skipFade=r}}class Ve{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class qe{constructor(e,t,r,n,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}}class He{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 Ge(e,r,n,i,a){let{horizontalAlign:o,verticalAlign:s}=t.au(e);return new t.P(-(o-.5)*r+i[0]*a,-(s-.5)*n+i[1]*a)}class We{constructor(e,t,r,n,i,a){this.transform=e.clone(),this.terrain=r,this.collisionIndex=new Fe(this.transform,t),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new He(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?(r,n)=>t.getElevation(e,r,n):null}getBucketParts(e,r,n,i){let a=n.getBucket(r),o=n.latestFeatureIndex;if(!a||!o||r.id!==a.layerIds[0])return;let s=n.collisionBoxArray,l=a.layers[0].layout,c=a.layers[0].paint,u=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),h=n.tileSize/t.X,f=n.tileID.toUnwrapped(),p=this.transform.calculatePosMatrix(f),d="map"===l.get("text-pitch-alignment"),m="map"===l.get("text-rotation-alignment"),g=Be(n,1,this.transform.zoom),y=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("text-translate"),c.get("text-translate-anchor")),v=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("icon-translate"),c.get("icon-translate-anchor")),x=ve(p,d,m,this.transform,g),_=null;if(d){let e=xe(p,d,m,this.transform,g);_=t.L([],this.transform.labelPlaneMatrix,e)}this.retainedQueryData[a.bucketInstanceId]=new qe(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);let b={bucket:a,layout:l,translationText:y,translationIcon:v,posMatrix:p,unwrappedTileID:f,textLabelPlaneMatrix:x,labelToScreenMatrix:_,scale:u,textPixelRatio:h,holdingForFade:n.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:r,symbolInstanceStart:n,symbolInstanceEnd:i}=t;e.push({sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i,parameters:b})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:b})}attemptAnchorPlacement(e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x){let _=t.aq[e.textAnchor],b=[e.textOffset0,e.textOffset1],w=Ge(_,n,i,b,a),T=this.collisionIndex.placeCollisionBox(r,f,l,c,u,s,o,g,h.predicate,x,w);if((!v||this.collisionIndex.placeCollisionBox(v,f,l,c,u,s,o,y,h.predicate,x,w).placeable)&&T.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),0===p.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[p.crossTileID]={textOffset:b,width:n,height:i,anchor:_,textBoxScale:a,prevAnchor:e},this.markUsedJustification(d,_,p,m),d.allowVerticalPlacement&&(this.markUsedOrientation(d,m,p),this.placedOrientations[p.crossTileID]=m),{shift:w,placedGlyphBoxes:T}}}placeLayerBucketPart(e,r,n){let{bucket:i,layout:a,translationText:o,translationIcon:s,posMatrix:l,unwrappedTileID:c,textLabelPlaneMatrix:u,labelToScreenMatrix:h,textPixelRatio:f,holdingForFade:p,collisionBoxArray:d,partiallyEvaluatedTextSize:m,collisionGroup:g}=e.parameters,y=a.get("text-optional"),v=a.get("icon-optional"),x=t.ar(a,"text-overlap","text-allow-overlap"),_="always"===x,b=t.ar(a,"icon-overlap","icon-allow-overlap"),w="always"===b,T="map"===a.get("text-rotation-alignment"),k="map"===a.get("text-pitch-alignment"),A="none"!==a.get("icon-text-fit"),M="viewport-y"===a.get("symbol-z-order"),S=_&&(w||!i.hasIconData()||v),E=w&&(_||!i.hasTextData()||y);!i.collisionArrays&&d&&i.deserializeCollisionBoxes(d);let C=this._getTerrainElevationFunc(this.retainedQueryData[i.bucketInstanceId].tileID),I=(e,d,w)=>{var M,I;if(r[e.crossTileID])return;if(p)return void(this.placements[e.crossTileID]=new Ue(!1,!1,!1));let L=!1,P=!1,z=!0,D=null,O={box:null,placeable:!1,offscreen:null},R={box:null,placeable:!1,offscreen:null},F=null,B=null,j=null,N=0,U=0,V=0;d.textFeatureIndex?N=d.textFeatureIndex:e.useRuntimeCollisionCircles&&(N=e.featureIndex),d.verticalTextFeatureIndex&&(U=d.verticalTextFeatureIndex);let q=d.textBox;if(q){let r=r=>{let n=t.ah.horizontal;if(i.allowVerticalPlacement&&!r&&this.prevPlacement){let t=this.prevPlacement.placedOrientations[e.crossTileID];t&&(this.placedOrientations[e.crossTileID]=t,n=t,this.markUsedOrientation(i,n,e))}return n},a=(r,n)=>{if(i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&d.verticalTextBox){for(let e of i.writingModes)if(e===t.ah.vertical?(O=n(),R=O):O=r(),O&&O.placeable)break}else O=r()},u=e.textAnchorOffsetStartIndex,h=e.textAnchorOffsetEndIndex;if(h===u){let n=(t,r)=>{let n=this.collisionIndex.placeCollisionBox(t,x,f,l,c,k,T,o,g.predicate,C);return n&&n.placeable&&(this.markUsedOrientation(i,r,e),this.placedOrientations[e.crossTileID]=r),n};a((()=>n(q,t.ah.horizontal)),(()=>{let r=d.verticalTextBox;return i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?n(r,t.ah.vertical):{box:null,offscreen:null}})),r(O&&O.placeable)}else{let p=t.aq[null===(I=null===(M=this.prevPlacement)||void 0===M?void 0:M.variableOffsets[e.crossTileID])||void 0===I?void 0:I.anchor],m=(r,a,d)=>{let m=r.x2-r.x1,y=r.y2-r.y1,v=e.textBoxScale,_=A&&"never"===b?a:null,w=null,M="never"===x?1:2,S="never";p&&M++;for(let t=0;t<M;t++){for(let t=u;t<h;t++){let n=i.textAnchorOffsets.get(t);if(p&&n.textAnchor!==p)continue;let a=this.attemptAnchorPlacement(n,r,m,y,v,T,k,f,l,c,g,S,e,i,d,o,s,_,C);if(a&&(w=a.placedGlyphBoxes,w&&w.placeable))return L=!0,D=a.shift,w}p?p=null:S=x}return n&&!w&&(w={box:this.collisionIndex.placeCollisionBox(q,"always",f,l,c,k,T,o,g.predicate,C,new t.P(0,0)).box,offscreen:!1,placeable:!1}),w};a((()=>m(q,d.iconBox,t.ah.horizontal)),(()=>{let r=d.verticalTextBox;return i.allowVerticalPlacement&&(!O||!O.placeable)&&e.numVerticalGlyphVertices>0&&r?m(r,d.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}})),O&&(L=O.placeable,z=O.offscreen);let y=r(O&&O.placeable);if(!L&&this.prevPlacement){let t=this.prevPlacement.variableOffsets[e.crossTileID];t&&(this.variableOffsets[e.crossTileID]=t,this.markUsedJustification(i,t.anchor,e,y))}}}if(F=O,L=F&&F.placeable,z=F&&F.offscreen,e.useRuntimeCollisionCircles){let r=i.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),s=t.ai(i.textSizeData,m,r),f=a.get("text-padding");B=this.collisionIndex.placeCollisionCircles(x,r,i.lineVertexArray,i.glyphOffsetArray,s,l,c,u,h,n,k,g.predicate,e.collisionCircleDiameter,f,o,C),B.circles.length&&B.collisionDetected&&!n&&t.w("Collisions detected, but collision boxes are not shown"),L=_||B.circles.length>0&&!B.collisionDetected,z=z&&B.offscreen}if(d.iconFeatureIndex&&(V=d.iconFeatureIndex),d.iconBox){let e=e=>this.collisionIndex.placeCollisionBox(e,b,f,l,c,k,T,s,g.predicate,C,A&&D?D:void 0);R&&R.placeable&&d.verticalIconBox?(j=e(d.verticalIconBox),P=j.placeable):(j=e(d.iconBox),P=j.placeable),z=z&&j.offscreen}let H=y||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,G=v||0===e.numIconVertices;H||G?G?H||(P=P&&L):L=P&&L:P=L=P&&L;let W=P&&j.placeable;if(L&&F.placeable&&this.collisionIndex.insertCollisionBox(F.box,x,a.get("text-ignore-placement"),i.bucketInstanceId,R&&R.placeable&&U?U:N,g.ID),W&&this.collisionIndex.insertCollisionBox(j.box,b,a.get("icon-ignore-placement"),i.bucketInstanceId,V,g.ID),B&&L&&this.collisionIndex.insertCollisionCircles(B.circles,x,a.get("text-ignore-placement"),i.bucketInstanceId,N,g.ID),n&&this.storeCollisionData(i.bucketInstanceId,w,d,F,j,B),0===e.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===i.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[e.crossTileID]=new Ue(L||S,P||E,z||i.justReloaded),r[e.crossTileID]=!0};if(M){if(0!==e.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");let t=i.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){let r=t[e];I(i.symbolInstances.get(r),i.collisionArrays[r],r)}}else for(let t=e.symbolInstanceStart;t<e.symbolInstanceEnd;t++)I(i.symbolInstances.get(t),i.collisionArrays[t],t);if(n&&i.bucketInstanceId in this.collisionCircleArrays){let e=this.collisionCircleArrays[i.bucketInstanceId];t.as(e.invProjMatrix,l),e.viewportMatrix=this.collisionIndex.getViewportMatrix()}i.justReloaded=!1}storeCollisionData(e,t,r,n,i,a){if(r.textBox||r.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)),r.textBox&&(o.text=n.box),r.iconBox&&(o.icon=i.box)}if(a){let t=this.collisionCircleArrays[e];void 0===t&&(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,r,n,i){let a;a=i===t.ah.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[t.at(r)];let o=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];for(let t of o)t>=0&&(e.text.placedSymbolArray.get(t).crossTileID=a>=0&&t!==a?0:n.crossTileID)}markUsedOrientation(e,r,n){let i=r===t.ah.horizontal||r===t.ah.horizontalOnly?r:0,a=r===t.ah.vertical?r:0,o=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(let t of o)e.text.placedSymbolArray.get(t).placedOrientation=i;n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let t=this.prevPlacement,r=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;let n=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 Ne(a,n,t.text,t.icon),r=r||t.text!==a.text.placed||t.icon!==a.icon.placed):(this.opacities[e]=new Ne(null,n,t.text,t.icon,t.skipFade),r=r||t.text||t.icon)}for(let e in i){let t=i[e];if(!this.opacities[e]){let i=new Ne(t,n,!1,!1);i.isHidden()||(this.opacities[e]=i,r=r||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&&void 0===t.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){let r={};for(let n of t){let t=n.getBucket(e);t&&n.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,n.tileID,r,n.collisionBoxArray)}}updateBucketOpacities(e,r,n,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 Ne(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),c=o.get("icon-allow-overlap"),u=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h="map"===o.get("text-rotation-alignment"),f="map"===o.get("text-pitch-alignment"),p="none"!==o.get("icon-text-fit"),d=new Ne(null,0,l&&(c||!e.hasIconData()||o.get("icon-optional")),c&&(l||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);let m=(e,t,r)=>{for(let n=0;n<t/4;n++)e.opacityVertexArray.emplaceBack(r);e.hasVisibleVertices=e.hasVisibleVertices||r!==rt},g=this.collisionBoxArrays.get(e.bucketInstanceId);for(let r=0;r<e.symbolInstances.length;r++){let i=e.symbolInstances.get(r),{numHorizontalGlyphVertices:a,numVerticalGlyphVertices:o,crossTileID:l}=i,c=this.opacities[l];n[l]?c=s:c||(c=d,this.opacities[l]=c),n[l]=!0;let y=i.numIconVertices>0,v=this.placedOrientations[i.crossTileID],x=v===t.ah.vertical,_=v===t.ah.horizontal||v===t.ah.horizontalOnly;if(a>0||o>0){let t=tt(c.text);m(e.text,a,x?rt:t),m(e.text,o,_?rt:t);let r=c.text.isHidden();[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((t=>{t>=0&&(e.text.placedSymbolArray.get(t).hidden=r||x?1:0)})),i.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=r||_?1:0);let n=this.variableOffsets[i.crossTileID];n&&this.markUsedJustification(e,n.anchor,i,v);let s=this.placedOrientations[i.crossTileID];s&&(this.markUsedJustification(e,"left",i,s),this.markUsedOrientation(e,s,i))}if(y){let t=tt(c.icon),r=!(p&&i.verticalPlacedIconSymbolIndex&&x);i.placedIconSymbolIndex>=0&&(m(e.icon,i.numIconVertices,r?t:rt),e.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=c.icon.isHidden()),i.verticalPlacedIconSymbolIndex>=0&&(m(e.icon,i.numVerticalIconVertices,r?rt:t),e.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=c.icon.isHidden())}let b=g&&g.has(r)?g.get(r):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let n=e.collisionArrays[r];if(n){let r=new t.P(0,0);if(n.textBox||n.verticalTextBox){let t=!0;if(u){let e=this.variableOffsets[l];e?(r=Ge(e.anchor,e.width,e.height,e.textOffset,e.textBoxScale),h&&r._rotate(f?this.transform.angle:-this.transform.angle)):t=!1}if(n.textBox||n.verticalTextBox){let i;n.textBox&&(i=x),n.verticalTextBox&&(i=_),Ze(e.textCollisionBox.collisionVertexArray,c.text.placed,!t||i,b.text,r.x,r.y)}}if(n.iconBox||n.verticalIconBox){let t,i=!(_||!n.verticalIconBox);n.iconBox&&(t=i),n.verticalIconBox&&(t=!i),Ze(e.iconCollisionBox.collisionVertexArray,c.icon.placed,t,b.icon,p?r.x:0,p?r.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 new 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 new 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 0===this.fadeDuration?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 r=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*r>e}setStale(){this.stale=!0}}function Ze(e,t,r,n,i,a){n&&0!==n.length||(n=[0,0,0,0]);let o=n[0]-Re,s=n[1]-Re,l=n[2]-Re,c=n[3]-Re;e.emplaceBack(t?1:0,r?1:0,i||0,a||0,o,s),e.emplaceBack(t?1:0,r?1:0,i||0,a||0,l,s),e.emplaceBack(t?1:0,r?1:0,i||0,a||0,l,c),e.emplaceBack(t?1:0,r?1:0,i||0,a||0,o,c)}let Ye=Math.pow(2,25),Xe=Math.pow(2,24),$e=Math.pow(2,17),Ke=Math.pow(2,16),Je=Math.pow(2,9),Qe=Math.pow(2,8),et=Math.pow(2,1);function tt(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;let t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*Ye+t*Xe+r*$e+t*Ke+r*Je+t*Qe+r*et+t}let rt=0;function nt(){return{isOccluded:(e,t,r)=>!1,getPitchedTextCorrection:(e,t,r)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(e,t,r,n){throw new Error("Not implemented.")},translatePosition:(e,t,r,n)=>function(e,t,r,n,i=!1){if(!r[0]&&!r[1])return[0,0];let a=i?"map"===n?e.angle:0:"viewport"===n?-e.angle:0;if(a){let e=Math.sin(a),t=Math.cos(a);r=[r[0]*t-r[1]*e,r[0]*e+r[1]*t]}return[i?r[0]:Be(t,r[0],e.zoom),i?r[1]:Be(t,r[1],e.zoom)]}(e,t,r,n),getCircleRadiusCorrection:e=>1}}class it{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,r,n,i){let a=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(a,n,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,r),this._currentPartIndex++,i())return!0;return!1}}class at{constructor(e,t,r,n,i,a,o,s){this.placement=new We(e,nt(),t,a,o,s),this._currentPlacementIndex=r.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=i,this._done=!1}isDone(){return this._done}continuePlacement(e,t,r){let n=a.now(),i=()=>!this._forceFullPlacement&&a.now()-n>2;for(;this._currentPlacementIndex>=0;){let n=t[e[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if("symbol"===n.type&&(!n.minzoom||n.minzoom<=a)&&(!n.maxzoom||n.maxzoom>a)){if(this._inProgressLayer||(this._inProgressLayer=new it(n)),this._inProgressLayer.continuePlacement(r[n.source],this.placement,this._showCollisionBoxes,n,i))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}let ot=512/t.X/2;class st{constructor(e,r,n){this.tileID=e,this.bucketInstanceId=n,this._symbolsByKey={};let i=new Map;for(let e=0;e<r.length;e++){let t=r.get(e),n=t.key,a=i.get(n);a?a.push(t):i.set(n,[t])}for(let[e,r]of i){let n={positions:r.map((e=>({x:Math.floor(e.anchorX*ot),y:Math.floor(e.anchorY*ot)}))),crossTileIDs:r.map((e=>e.crossTileID))};if(n.positions.length>128){let e=new t.av(n.positions.length,16,Uint16Array);for(let{x:t,y:r}of n.positions)e.add(t,r);e.finish(),delete n.positions,n.index=e}this._symbolsByKey[e]=n}}getScaledCoordinates(e,r){let{x:n,y:i,z:a}=this.tileID.canonical,{x:o,y:s,z:l}=r.canonical,c=ot/Math.pow(2,l-a),u=(s*t.X+e.anchorY)*c,h=i*t.X*ot;return{x:Math.floor((o*t.X+e.anchorX)*c-n*t.X*ot),y:Math.floor(u-h)}}findMatches(e,t,r){let n=this.tileID.canonical.z<t.canonical.z?1:Math.pow(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-n,s.y-n,s.x+n,s.y+n).sort();for(let t of e){let e=o.crossTileIDs[t];if(!r[e]){r[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)<=n&&Math.abs(t.y-s.y)<=n&&!r[i]){r[i]=!0,a.crossTileID=i;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:e})=>e))}}class lt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class ct{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let t=Math.round((e-this.lng)/360);if(0!==t)for(let e in this.indexes){let r=this.indexes[e],n={};for(let e in r){let i=r[e];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),n[i.tileID.key]=i}this.indexes[e]=n}this.lng=e}addBucket(e,t,r){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 n=this.usedCrossTileIDs[e.overscaledZ];for(let r in this.indexes){let i=this.indexes[r];if(Number(r)>e.overscaledZ)for(let r in i){let a=i[r];a.tileID.isChildOf(e)&&a.findMatches(t.symbolInstances,e,n)}else{let a=i[e.scaledTo(Number(r)).key];a&&a.findMatches(t.symbolInstances,e,n)}}for(let e=0;e<t.symbolInstances.length;e++){let i=t.symbolInstances.get(e);i.crossTileID||(i.crossTileID=r.generate(),n[i.crossTileID]=!0)}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new st(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(let r of t.getCrossTileIDsLists())for(let t of r)delete this.usedCrossTileIDs[e][t]}removeStaleBuckets(e){let t=!1;for(let r in this.indexes){let n=this.indexes[r];for(let i in n)e[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],t=!0)}return t}}class ut{constructor(){this.layerIndexes={},this.crossTileIDs=new lt,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,r){let n=this.layerIndexes[e.id];void 0===n&&(n=this.layerIndexes[e.id]=new ct);let i=!1,a={};n.handleWrapJump(r);for(let r of t){let t=r.getBucket(e);t&&e.id===t.layerIds[0]&&(t.bucketInstanceId||(t.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(r.tileID,t,this.crossTileIDs)&&(i=!0),a[t.bucketInstanceId]=!0)}return n.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 ht=(e,r)=>t.t(e,r&&r.filter((e=>"source.canvas"!==e.identifier))),ft=t.aw();class pt extends t.E{constructor(e,r={}){super(),this._rtlPluginLoaded=()=>{for(let e in this.sourceCaches){let t=this.sourceCaches[e].getSource().type;"vector"!==t&&"geojson"!==t||this.sourceCaches[e].reload()}},this.map=e,this.dispatcher=new U(N(),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 k,this.imageManager.setEventedParent(this),this.glyphManager=new C(e._requestManager,r.localIdeographFontFamily),this.lineAtlas=new D(256,512),this.crossTileSymbolIndex=new ut,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()),le().on(ae,this._rtlPluginLoaded),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;let t=this.sourceCaches[e.sourceId];if(!t)return;let r=t.getSource();if(r&&r.vectorLayerIds)for(let e in this._layers){let t=this._layers[e];t.source===r.id&&this._validateLayer(t)}}))}loadURL(e,r={},n){this.fire(new t.k("dataloading",{dataType:"style"})),r.validate="boolean"!=typeof r.validate||r.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,r,n)})).catch((e=>{this._loadStyleRequest=null,e&&!a.signal.aborted&&this.fire(new t.j(e))}))}loadJSON(e,r={},n){this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,r.validate=!1!==r.validate,this._load(e,r,n)})).catch((()=>{}))}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(ft,{validate:!1})}_load(e,r,n){var i;let a=r.transformStyle?r.transformStyle(n,e):e;if(!r.validate||!ht(this,t.u(a))){this._loaded=!0,this.stylesheet=a;for(let e in a.sources)this.addSource(e,a.sources[e],{validate:!1});a.sprite?this._loadSprite(a.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(a.glyphs),this._createLayers(),this.light=new L(this.stylesheet.light),this.sky=new z(this.stylesheet.sky),this.map.setTerrain(null!==(i=this.stylesheet.terrain)&&void 0!==i?i: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 r of e){let e=t.aA(r);e.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=e}}_loadSprite(e,r=!1,n=void 0){let i;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(e,r,n,i){return t._(this,void 0,void 0,(function*(){let o=_(e),s=n>1?"@2x":"",l={},c={};for(let{id:e,url:n}of o){let a=r.transformRequest(b(n,s,".json"),"SpriteJSON");l[e]=t.h(a,i);let o=r.transformRequest(b(n,s,".png"),"SpriteImage");c[e]=p.getImage(o,i)}return yield Promise.all([...Object.values(l),...Object.values(c)]),function(e,r){return t._(this,void 0,void 0,(function*(){let t={};for(let n in e){t[n]={};let i=a.getImageCanvasContext((yield r[n]).data),o=(yield e[n]).data;for(let e in o){let{width:r,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:f,content:p,textFitWidth:d,textFitHeight:m}=o[e];t[n][e]={data:null,pixelRatio:u,sdf:c,stretchX:h,stretchY:f,content:p,textFitWidth:d,textFitHeight:m,spriteData:{width:r,height:a,x:s,y:l,context:i}}}}return t}))}(l,c)}))}(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 n=this._spritesImagesIds[t]?this._spritesImagesIds[t].filter((t=>!(t in e))):[];for(let e of n)this.imageManager.removeImage(e),this._changedImages[e]=!0;for(let n in e[t]){let i="default"===t?n:`${t}:${n}`;this._spritesImagesIds[t].push(i),i in this.imageManager.images?this.imageManager.updateImage(i,e[t][n],!1):this.imageManager.addImage(i,e[t][n]),r&&(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(),r&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),n&&n(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 r=this.sourceCaches[e.source];if(!r)return;let n=e.sourceLayer;if(!n)return;let i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.j(new Error(`Source layer "${n}" 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,r=!1){let n=this._serializedAllLayers();if(!e||0===e.length)return Object.values(r?t.aB(n):n);let i=[];for(let a of e)if(n[a]){let e=r?t.aB(n[a]):n[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 r of t){let t=this._layers[r];"custom"!==t.type&&(e[r]=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 new Error("Style is not done loading.")}update(e){if(!this._loaded)return;let r=this._changed;if(r){let t=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);(t.length||r.length)&&this._updateWorkerLayers(t,r);for(let e in this._updatedSources){let t=this._updatedSources[e];if("reload"===t)this._reloadSource(e);else{if("clear"!==t)throw new 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 n={};for(let e in this.sourceCaches){let t=this.sourceCaches[e];n[e]=t.used,t.used=!1}for(let t of this._order){let r=this._layers[t];r.recalculate(e,this._availableImages),!r.isHidden(e.zoom)&&r.source&&(this.sourceCaches[r.source].used=!0)}for(let e in n){let r=this.sourceCaches[e];!!n[e]!=!!r.used&&r.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:e}))}this.light.recalculate(e),this.sky.recalculate(e),this.z=e.zoom,r&&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,r={}){var n;this._checkLoaded();let i=this.serialize();if(e=r.transformStyle?r.transformStyle(i,e):e,(null===(n=r.validate)||void 0===n||n)&&ht(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 new Error(`Unimplemented: ${o.unimplemented.join(", ")}.`);if(0===o.operations.length)return!1;for(let e of o.operations)e();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){let t=[],r=[];for(let n of e)switch(n.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":t.push((()=>this.addLayer.apply(this,n.args)));break;case"removeLayer":t.push((()=>this.removeLayer.apply(this,n.args)));break;case"setPaintProperty":t.push((()=>this.setPaintProperty.apply(this,n.args)));break;case"setLayoutProperty":t.push((()=>this.setLayoutProperty.apply(this,n.args)));break;case"setFilter":t.push((()=>this.setFilter.apply(this,n.args)));break;case"addSource":t.push((()=>this.addSource.apply(this,n.args)));break;case"removeSource":t.push((()=>this.removeSource.apply(this,n.args)));break;case"setLayerZoomRange":t.push((()=>this.setLayerZoomRange.apply(this,n.args)));break;case"setLight":t.push((()=>this.setLight.apply(this,n.args)));break;case"setGeoJSONSourceData":t.push((()=>this.setGeoJSONSourceData.apply(this,n.args)));break;case"setGlyphs":t.push((()=>this.setGlyphs.apply(this,n.args)));break;case"setSprite":t.push((()=>this.setSprite.apply(this,n.args)));break;case"setSky":t.push((()=>this.setSky.apply(this,n.args)));break;case"setTerrain":t.push((()=>this.map.setTerrain.apply(this,n.args)));break;case"setTransition":t.push((()=>{}));break;default:r.push(n.command)}return{operations:t,unimplemented:r}}addImage(e,r){if(this.getImage(e))return this.fire(new t.j(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,r),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(new 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,r,n={}){if(this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error(`Source "${e}" already exists.`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.u.source,`sources.${e}`,r,null,n))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);let i=this.sourceCaches[e]=new fe(e,r,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(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(let r in this._layers)if(this._layers[r].source===e)return this.fire(new t.j(new Error(`Source "${e}" cannot be removed while layer "${r}" is using it.`)));let r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,t){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error(`There is no source with this ID=${e}`);let r=this.sourceCaches[e].getSource();if("geojson"!==r.type)throw new Error(`geojsonSource.type is ${r.type}, which is !== 'geojson`);r.setData(t),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,r,n={}){this._checkLoaded();let i,a=e.id;if(this.getLayer(a))return void this.fire(new t.j(new Error(`Layer "${a}" already exists on this map.`)));if("custom"===e.type){if(ht(this,t.aD(e)))return;i=t.aA(e)}else{if("source"in e&&"object"==typeof e.source&&(this.addSource(a,e.source),e=t.aB(e),e=t.e(e,{source:a})),this._validate(t.u.layer,`layers.${a}`,e,{arrayIndex:-1},n))return;i=t.aA(e),this._validateLayer(i),i.setEventedParent(this,{layer:{id:a}})}let o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.j(new Error(`Cannot add layer "${a}" before non-existing layer "${r}".`)));else{if(this._order.splice(o,0,a),this._layerOrderChanged=!0,this._layers[a]=i,this._removedLayers[a]&&i.source&&"custom"!==i.type){let e=this._removedLayers[a];delete this._removedLayers[a],e.type!==i.type?this._updatedSources[i.source]="clear":(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause())}this._updateLayer(i),i.onAdd&&i.onAdd(this.map)}}moveLayer(e,r){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new t.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===r)return;let n=this._order.indexOf(e);this._order.splice(n,1);let i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.j(new Error(`Cannot move layer "${e}" before non-existing layer "${r}".`))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();let r=this._layers[e];if(!r)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${e}".`)));r.setEventedParent(null);let n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,r,n){this._checkLoaded();let i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,r,n={}){this._checkLoaded();let i=this.getLayer(e);if(i){if(!t.aE(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.u.filter,`layers.${i.id}.filter`,r,null,n)||(i.filter=t.aB(r),this._updateLayer(i)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return t.aB(this.getLayer(e).filter)}setLayoutProperty(e,r,n,i={}){this._checkLoaded();let a=this.getLayer(e);a?t.aE(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,r){let n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,r,n,i={}){this._checkLoaded();let a=this.getLayer(e);a?t.aE(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,t){return this.getLayer(e).getPaintProperty(t)}setFeatureState(e,r){this._checkLoaded();let n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0===a)return void this.fire(new t.j(new Error(`The source '${n}' does not exist in the map's style.`)));let o=a.getSource().type;"geojson"===o&&i?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===e.id&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,r){this._checkLoaded();let n=e.source,i=this.sourceCaches[n];if(void 0===i)return void this.fire(new t.j(new Error(`The source '${n}' does not exist in the map's style.`)));let a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,e.id,r):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();let r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i)return"vector"!==i.getSource().type||n?(void 0===e.id&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id)):void this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.j(new Error(`The source '${r}' 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())),r=this._serializeByIds(this._order,!0),n=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:r,terrain:n},(e=>void 0!==e))}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){let t=e=>"fill-extrusion"===this._layers[e].type,r={},n=[];for(let i=this._order.length-1;i>=0;i--){let a=this._order[i];if(t(a)){r[a]=i;for(let t of e){let e=t[a];if(e)for(let t of e)n.push(t)}}}n.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=n.length-1;e>=0;e--){let t=n[e].feature;if(r[t.layer.id]<a)break;i.push(t),n.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,r,n){r&&r.filter&&this._validate(t.u.filter,"queryRenderedFeatures.filter",r.filter,null,r);let i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.j(new Error("parameters.layers must be an Array."))),[];for(let e of r.layers){let r=this._layers[e];if(!r)return this.fire(new t.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be queried for features.`))),[];i[r.source]=!0}}let a=[];r.availableImages=this._availableImages;let o=this._serializedAllLayers();for(let t in this.sourceCaches)r.layers&&!i[t]||a.push(H(this.sourceCaches[t],this._layers,o,e,r,n));return this.placement&&a.push(function(e,t,r,n,i,a,o){let s={},l=a.queryRenderedSymbols(n),c=[];for(let e of Object.keys(l).map(Number))c.push(o[e]);c.sort(G);for(let r of c){let n=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],t,r.bucketIndex,r.sourceLayerIndex,i.filter,i.layers,i.availableImages,e);for(let e in n){let t=s[e]=s[e]||[],i=n[e];i.sort(((e,t)=>{let n=r.featureSortOrder;if(n){let r=n.indexOf(e.featureIndex);return n.indexOf(t.featureIndex)-r}return t.featureIndex-e.featureIndex}));for(let e of i)t.push(e)}}for(let t in s)s[t].forEach((n=>{let i=n.feature,a=r[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,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(e,r){r&&r.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",r.filter,null,r);let n=this.sourceCaches[e];return n?function(e,t){let r=e.getRenderableIds().map((t=>e.getTileByID(t))),n=[],i={};for(let e=0;e<r.length;e++){let a=r[e],o=a.tileID.canonical.key;i[o]||(i[o]=!0,a.querySourceFeatures(n,t))}return n}(n,r):[]}getLight(){return this.light.getLight()}setLight(e,r={}){this._checkLoaded();let n=this.light.getLight(),i=!1;for(let r in e)if(!t.aE(e[r],n[r])){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,r),this.light.updateTransitions(o)}getSky(){var e;return null===(e=this.stylesheet)||void 0===e?void 0:e.sky}setSky(e,r={}){let n=this.getSky(),i=!1;if(!e&&!n)return;if(e&&!n)i=!0;else if(!e&&n)i=!0;else for(let r in e)if(!t.aE(e[r],n[r])){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,r),this.sky.updateTransitions(o)}_validate(e,r,n,i,a={}){return(!a||!1!==a.validate)&&ht(this,e.call(t.u,t.e({key:r,style:this.serialize(),value:n,styleSpec:t.v},i)))}_remove(e=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),le().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,r,n,i=!1){let o=!1,s=!1,l={};for(let t of this._order){let r=this._layers[t];if("symbol"!==r.type)continue;if(!l[r.source]){let e=this.sourceCaches[r.source];l[r.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 n=this.crossTileSymbolIndex.addLayer(r,l[r.source],e.center.lng);o=o||n}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((i=i||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.now(),e.zoom))&&(this.pauseablePlacement=new at(e,this.map.terrain,this._order,i,t,r,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),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];"symbol"===t.type&&this.placement.updateLayerOpacities(t,l[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.now())}_releaseSymbolFadeTiles(){for(let e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,r){return t._(this,void 0,void 0,(function*(){let e=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();let t=this.sourceCaches[r.source];return t&&t.setDependencies(r.tileID.key,r.type,r.icons),e}))}getGlyphs(e,r){return t._(this,void 0,void 0,(function*(){let e=yield this.glyphManager.getGlyphs(r.stacks),t=this.sourceCaches[r.source];return t&&t.setDependencies(r.tileID.key,r.type,[""]),e}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,r={}){this._checkLoaded(),e&&this._validate(t.u.glyphs,"glyphs",e,null,r)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,r,n={},i){this._checkLoaded();let a=[{id:e,url:r}],o=[..._(this.stylesheet.sprite),...a];this._validate(t.u.sprite,"sprite",o,null,n)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,i))}removeSprite(e){this._checkLoaded();let r=_(this.stylesheet.sprite);if(r.find((t=>t.id===e))){if(this._spritesImagesIds[e])for(let t of this._spritesImagesIds[e])this.imageManager.removeImage(t),this._changedImages[t]=!0;r.splice(r.findIndex((t=>t.id===e)),1),this.stylesheet.sprite=r.length>0?r: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(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return _(this.stylesheet.sprite)}setSprite(e,r={},n){this._checkLoaded(),e&&this._validate(t.u.sprite,"sprite",e,null,r)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,n):(this._unloadSprite(),n&&n(null)))}}var dt=t.Y([{name:"a_pos",type:"Int16",components:2}]);let mt={prelude:gt("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:gt("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:gt("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:gt("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:gt("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:gt("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}"),heatmapTexture:gt("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:gt("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:gt("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:gt("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:gt("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:gt("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:gt("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillPattern:gt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:gt("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=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:gt("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=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\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:gt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:gt("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:gt("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:gt("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:gt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:gt("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),raster:gt("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:gt("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=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:gt("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=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:gt("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=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:gt("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:gt("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:gt("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:gt("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 gt(e,t){let r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=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(r,((e,t,r,n,i)=>(s[i]=!0,"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = u_${i};\n#endif\n`))),vertexSource:t=t.replace(r,((e,t,r,n,i)=>{let a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`})),staticAttributes:n,staticUniforms:o}}class yt{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,r,n,i,a,o,s,l){this.context=e;let c=this.boundPaintVertexBuffers.length!==n.length;for(let e=0;!c&&e<n.length;e++)this.boundPaintVertexBuffers[e]!==n[e]&&(c=!0);!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==r||c||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==l?this.freshBind(t,r,n,i,a,o,s,l):(e.bindVertexArray.set(this.vao),o&&o.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind(),l&&l.bind())}freshBind(e,t,r,n,i,a,o,s){let l=e.numAttributes,c=this.context,u=c.gl;this.vao&&this.destroy(),this.vao=c.createVertexArray(),c.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o,this.boundDynamicVertexBuffer3=s,t.enableAttributes(u,e);for(let t of r)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 r)t.bind(),t.setVertexAttribPointers(u,e,i);a&&(a.bind(),a.setVertexAttribPointers(u,e,i)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,e,i)),s&&(s.bind(),s.setVertexAttribPointers(u,e,i)),c.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let vt=(e,r,n,i,a)=>({u_matrix:e,u_texture:0,u_ele_delta:r,u_fog_matrix:n,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 xt(e){let t=[];for(let r=0;r<e.length;r++){if(null===e[r])continue;let n=e[r].split(" ");t.push(n.pop())}return t}class _t{constructor(e,r,n,i,a,o){let s=e.gl;this.program=s.createProgram();let l=xt(r.staticAttributes),c=n?n.getBinderAttributes():[],u=l.concat(c),h=mt.prelude.staticUniforms?xt(mt.prelude.staticUniforms):[],f=r.staticUniforms?xt(r.staticUniforms):[],p=n?n.getBinderUniforms():[],d=h.concat(f).concat(p),m=[];for(let e of d)m.indexOf(e)<0&&m.push(e);let g=n?n.defines():[];a&&g.push("#define OVERDRAW_INSPECTOR;"),o&&g.push("#define TERRAIN3D;");let y=g.concat(mt.prelude.fragmentSource,r.fragmentSource).join("\n"),v=g.concat(mt.prelude.vertexSource,r.vertexSource).join("\n"),x=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(x,y),s.compileShader(x),!s.getShaderParameter(x,s.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${s.getShaderInfoLog(x)}`);s.attachShader(this.program,x);let _=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(_,v),s.compileShader(_),!s.getShaderParameter(_,s.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${s.getShaderInfoLog(_)}`);s.attachShader(this.program,_),this.attributes={};let b={};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 new Error(`Program failed to link: ${s.getProgramInfoLog(this.program)}`);s.deleteShader(_),s.deleteShader(x);for(let e=0;e<m.length;e++){let t=m[e];if(t&&!b[t]){let e=s.getUniformLocation(this.program,t);e&&(b[t]=e)}}var w,T;this.fixedUniforms=i(e,b),this.terrainUniforms=(w=e,T=b,{u_depth:new t.aH(w,T.u_depth),u_terrain:new t.aH(w,T.u_terrain),u_terrain_dim:new t.aI(w,T.u_terrain_dim),u_terrain_matrix:new t.aJ(w,T.u_terrain_matrix),u_terrain_unpack:new t.aK(w,T.u_terrain_unpack),u_terrain_exaggeration:new t.aI(w,T.u_terrain_exaggeration)}),this.binderUniforms=n?n.getUniforms(e,b):[]}draw(e,t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y){let v=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(n),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]);d&&d.setUniforms(e,this.binderUniforms,f,{zoom:p});let x=0;switch(t){case v.LINES:x=2;break;case v.TRIANGLES:x=3;break;case v.LINE_STRIP:x=1}for(let r of h.get()){let n=r.vaos||(r.vaos={});(n[l]||(n[l]=new yt)).bind(e,this,c,d?d.getPaintVertexBuffers():[],u,r.vertexOffset,m,g,y),v.drawElements(t,r.primitiveLength*x,v.UNSIGNED_SHORT,r.primitiveOffset*x*2)}}}function bt(e,t,r){let n=1/Be(r,1,t.transform.tileZoom),i=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,t.transform.tileZoom)/i,o=a*(r.tileID.canonical.x+r.tileID.wrap*i),s=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,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 wt=(e,r,n,i)=>{let a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=(c=new t.A(9),t.A!=Float32Array&&(c[1]=0,c[2]=0,c[3]=0,c[5]=0,c[6]=0,c[7]=0),c[0]=1,c[4]=1,c[8]=1,c);var c;"viewport"===a.properties.get("anchor")&&function(e,t){var r=Math.sin(t),n=Math.cos(t);e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1}(l,-r.transform.angle),function(e,t,r){var n=t[0],i=t[1],a=t[2];e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8]}(s,s,l);let u=a.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+n,u_opacity:i}},Tt=(e,r,n,i,a,o,s)=>t.e(wt(e,r,n,i),bt(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8}),kt=e=>({u_matrix:e}),At=(e,r,n,i)=>t.e(kt(e),bt(n,r,i)),Mt=(e,t)=>({u_matrix:e,u_world:t}),St=(e,r,n,i,a)=>t.e(At(e,r,n,i),{u_world:a}),Et=(e,t,r,n)=>{let i,a,o=e.transform;if("map"===n.paint.get("circle-pitch-alignment")){let e=Be(r,1,o.zoom);i=!0,a=[e,e]}else i=!1,a=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(t.posMatrix,r,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+i,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:a}},Ct=(e,t,r)=>({u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}),It=(e,t,r=1)=>({u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:r}),Lt=e=>({u_matrix:e}),Pt=(e,t,r,n)=>({u_matrix:e,u_extrude_scale:Be(t,1,r),u_intensity:n}),zt=(e,r,n,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:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}};function Dt(e,r){let n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new t.Z(0,i/n).toLngLat().lat,new t.Z(0,(i+1)/n).toLngLat().lat]}let Ot=(e,t,r,n)=>{let i=e.transform;return{u_matrix:Nt(e,t,r,n),u_ratio:1/Be(t,1,i.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Rt=(e,r,n,i,a)=>t.e(Ot(e,r,n,a),{u_image:0,u_image_height:i}),Ft=(e,t,r,n,i)=>{let a=e.transform,o=jt(t,a);return{u_matrix:Nt(e,t,r,i),u_texsize:t.imageAtlasTexture.size,u_ratio:1/Be(t,1,a.zoom),u_device_pixel_ratio:e.pixelRatio,u_image:0,u_scale:[o,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Bt=(e,r,n,i,a,o)=>{let s=e.lineAtlas,l=jt(r,e.transform),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),f=u.width*a.fromScale,p=h.width*a.toScale;return t.e(Ot(e,r,n,o),{u_patternscale_a:[l/f,-u.height/2],u_patternscale_b:[l/p,-h.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:h.y,u_mix:a.t})};function jt(e,t){return 1/Be(e,1,t.tileZoom)}function Nt(e,t,r,n){return e.translatePosMatrix(n?n.posMatrix:t.tileID.posMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}let Ut=(e,t,r,n,i)=>{return{u_matrix:e,u_tl_parent:t,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.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:Vt(i.paint.get("raster-hue-rotate"))};var a,o};function Vt(e){e*=Math.PI/180;let t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}let qt=(e,t,r,n,i,a,o,s,l,c,u,h,f,p)=>{let d=o.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:d.cameraToCenterDistance,u_pitch:d.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:d.width/d.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:l,u_coord_matrix:c,u_is_text:+h,u_pitch_with_map:+n,u_is_along_line:i,u_is_variable_anchor:a,u_texsize:f,u_texture:0,u_translation:u,u_pitched_scale:p}},Ht=(e,r,n,i,a,o,s,l,c,u,h,f,p,d,m)=>{let g=s.transform;return t.e(qt(e,r,n,i,a,o,s,l,c,u,h,f,p,m),{u_gamma_scale:i?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:+d})},Gt=(e,r,n,i,a,o,s,l,c,u,h,f,p,d)=>t.e(Ht(e,r,n,i,a,o,s,l,c,u,h,!0,f,!0,d),{u_texsize_icon:p,u_texture_icon:1}),Wt=(e,t,r)=>({u_matrix:e,u_opacity:t,u_color:r}),Zt=(e,r,n,i,a,o)=>t.e(function(e,t,r,n){let i=r.imageManager.getPattern(e.from.toString()),a=r.imageManager.getPattern(e.to.toString()),{width:o,height:s}=r.imageManager.getPixelSize(),l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,u=c*(n.tileID.canonical.x+n.tileID.wrap*l),h=c*n.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/Be(n,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}}(i,o,n,a),{u_matrix:e,u_opacity:r}),Yt={fillExtrusion:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_lightpos:new t.aN(e,r.u_lightpos),u_lightintensity:new t.aI(e,r.u_lightintensity),u_lightcolor:new t.aN(e,r.u_lightcolor),u_vertical_gradient:new t.aI(e,r.u_vertical_gradient),u_opacity:new t.aI(e,r.u_opacity)}),fillExtrusionPattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_lightpos:new t.aN(e,r.u_lightpos),u_lightintensity:new t.aI(e,r.u_lightintensity),u_lightcolor:new t.aN(e,r.u_lightcolor),u_vertical_gradient:new t.aI(e,r.u_vertical_gradient),u_height_factor:new t.aI(e,r.u_height_factor),u_image:new t.aH(e,r.u_image),u_texsize:new t.aO(e,r.u_texsize),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade),u_opacity:new t.aI(e,r.u_opacity)}),fill:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix)}),fillPattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_image:new t.aH(e,r.u_image),u_texsize:new t.aO(e,r.u_texsize),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade)}),fillOutline:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_world:new t.aO(e,r.u_world)}),fillOutlinePattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_world:new t.aO(e,r.u_world),u_image:new t.aH(e,r.u_image),u_texsize:new t.aO(e,r.u_texsize),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade)}),circle:(e,r)=>({u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_scale_with_map:new t.aH(e,r.u_scale_with_map),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_extrude_scale:new t.aO(e,r.u_extrude_scale),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_matrix:new t.aJ(e,r.u_matrix)}),collisionBox:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_pixel_extrude_scale:new t.aO(e,r.u_pixel_extrude_scale)}),collisionCircle:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_inv_matrix:new t.aJ(e,r.u_inv_matrix),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_viewport_size:new t.aO(e,r.u_viewport_size)}),debug:(e,r)=>({u_color:new t.aL(e,r.u_color),u_matrix:new t.aJ(e,r.u_matrix),u_overlay:new t.aH(e,r.u_overlay),u_overlay_scale:new t.aI(e,r.u_overlay_scale)}),clippingMask:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix)}),heatmap:(e,r)=>({u_extrude_scale:new t.aI(e,r.u_extrude_scale),u_intensity:new t.aI(e,r.u_intensity),u_matrix:new t.aJ(e,r.u_matrix)}),heatmapTexture:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_world:new t.aO(e,r.u_world),u_image:new t.aH(e,r.u_image),u_color_ramp:new t.aH(e,r.u_color_ramp),u_opacity:new t.aI(e,r.u_opacity)}),hillshade:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_image:new t.aH(e,r.u_image),u_latrange:new t.aO(e,r.u_latrange),u_light:new t.aO(e,r.u_light),u_shadow:new t.aL(e,r.u_shadow),u_highlight:new t.aL(e,r.u_highlight),u_accent:new t.aL(e,r.u_accent)}),hillshadePrepare:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_image:new t.aH(e,r.u_image),u_dimension:new t.aO(e,r.u_dimension),u_zoom:new t.aI(e,r.u_zoom),u_unpack:new t.aK(e,r.u_unpack)}),line:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels)}),lineGradient:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels),u_image:new t.aH(e,r.u_image),u_image_height:new t.aI(e,r.u_image_height)}),linePattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_texsize:new t.aO(e,r.u_texsize),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_image:new t.aH(e,r.u_image),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade)}),lineSDF:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels),u_patternscale_a:new t.aO(e,r.u_patternscale_a),u_patternscale_b:new t.aO(e,r.u_patternscale_b),u_sdfgamma:new t.aI(e,r.u_sdfgamma),u_image:new t.aH(e,r.u_image),u_tex_y_a:new t.aI(e,r.u_tex_y_a),u_tex_y_b:new t.aI(e,r.u_tex_y_b),u_mix:new t.aI(e,r.u_mix)}),raster:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_tl_parent:new t.aO(e,r.u_tl_parent),u_scale_parent:new t.aI(e,r.u_scale_parent),u_buffer_scale:new t.aI(e,r.u_buffer_scale),u_fade_t:new t.aI(e,r.u_fade_t),u_opacity:new t.aI(e,r.u_opacity),u_image0:new t.aH(e,r.u_image0),u_image1:new t.aH(e,r.u_image1),u_brightness_low:new t.aI(e,r.u_brightness_low),u_brightness_high:new t.aI(e,r.u_brightness_high),u_saturation_factor:new t.aI(e,r.u_saturation_factor),u_contrast_factor:new t.aI(e,r.u_contrast_factor),u_spin_weights:new t.aN(e,r.u_spin_weights)}),symbolIcon:(e,r)=>({u_is_size_zoom_constant:new t.aH(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,r.u_is_size_feature_constant),u_size_t:new t.aI(e,r.u_size_t),u_size:new t.aI(e,r.u_size),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_pitch:new t.aI(e,r.u_pitch),u_rotate_symbol:new t.aH(e,r.u_rotate_symbol),u_aspect_ratio:new t.aI(e,r.u_aspect_ratio),u_fade_change:new t.aI(e,r.u_fade_change),u_matrix:new t.aJ(e,r.u_matrix),u_label_plane_matrix:new t.aJ(e,r.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,r.u_coord_matrix),u_is_text:new t.aH(e,r.u_is_text),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_is_along_line:new t.aH(e,r.u_is_along_line),u_is_variable_anchor:new t.aH(e,r.u_is_variable_anchor),u_texsize:new t.aO(e,r.u_texsize),u_texture:new t.aH(e,r.u_texture),u_translation:new t.aO(e,r.u_translation),u_pitched_scale:new t.aI(e,r.u_pitched_scale)}),symbolSDF:(e,r)=>({u_is_size_zoom_constant:new t.aH(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,r.u_is_size_feature_constant),u_size_t:new t.aI(e,r.u_size_t),u_size:new t.aI(e,r.u_size),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_pitch:new t.aI(e,r.u_pitch),u_rotate_symbol:new t.aH(e,r.u_rotate_symbol),u_aspect_ratio:new t.aI(e,r.u_aspect_ratio),u_fade_change:new t.aI(e,r.u_fade_change),u_matrix:new t.aJ(e,r.u_matrix),u_label_plane_matrix:new t.aJ(e,r.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,r.u_coord_matrix),u_is_text:new t.aH(e,r.u_is_text),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_is_along_line:new t.aH(e,r.u_is_along_line),u_is_variable_anchor:new t.aH(e,r.u_is_variable_anchor),u_texsize:new t.aO(e,r.u_texsize),u_texture:new t.aH(e,r.u_texture),u_gamma_scale:new t.aI(e,r.u_gamma_scale),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_is_halo:new t.aH(e,r.u_is_halo),u_translation:new t.aO(e,r.u_translation),u_pitched_scale:new t.aI(e,r.u_pitched_scale)}),symbolTextAndIcon:(e,r)=>({u_is_size_zoom_constant:new t.aH(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,r.u_is_size_feature_constant),u_size_t:new t.aI(e,r.u_size_t),u_size:new t.aI(e,r.u_size),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_pitch:new t.aI(e,r.u_pitch),u_rotate_symbol:new t.aH(e,r.u_rotate_symbol),u_aspect_ratio:new t.aI(e,r.u_aspect_ratio),u_fade_change:new t.aI(e,r.u_fade_change),u_matrix:new t.aJ(e,r.u_matrix),u_label_plane_matrix:new t.aJ(e,r.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,r.u_coord_matrix),u_is_text:new t.aH(e,r.u_is_text),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_is_along_line:new t.aH(e,r.u_is_along_line),u_is_variable_anchor:new t.aH(e,r.u_is_variable_anchor),u_texsize:new t.aO(e,r.u_texsize),u_texsize_icon:new t.aO(e,r.u_texsize_icon),u_texture:new t.aH(e,r.u_texture),u_texture_icon:new t.aH(e,r.u_texture_icon),u_gamma_scale:new t.aI(e,r.u_gamma_scale),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_is_halo:new t.aH(e,r.u_is_halo),u_translation:new t.aO(e,r.u_translation),u_pitched_scale:new t.aI(e,r.u_pitched_scale)}),background:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_opacity:new t.aI(e,r.u_opacity),u_color:new t.aL(e,r.u_color)}),backgroundPattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_opacity:new t.aI(e,r.u_opacity),u_image:new t.aH(e,r.u_image),u_pattern_tl_a:new t.aO(e,r.u_pattern_tl_a),u_pattern_br_a:new t.aO(e,r.u_pattern_br_a),u_pattern_tl_b:new t.aO(e,r.u_pattern_tl_b),u_pattern_br_b:new t.aO(e,r.u_pattern_br_b),u_texsize:new t.aO(e,r.u_texsize),u_mix:new t.aI(e,r.u_mix),u_pattern_size_a:new t.aO(e,r.u_pattern_size_a),u_pattern_size_b:new t.aO(e,r.u_pattern_size_b),u_scale_a:new t.aI(e,r.u_scale_a),u_scale_b:new t.aI(e,r.u_scale_b),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(e,r.u_tile_units_to_pixels)}),terrain:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_texture:new t.aH(e,r.u_texture),u_ele_delta:new t.aI(e,r.u_ele_delta),u_fog_matrix:new t.aJ(e,r.u_fog_matrix),u_fog_color:new t.aL(e,r.u_fog_color),u_fog_ground_blend:new t.aI(e,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(e,r.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(e,r.u_horizon_color),u_horizon_fog_blend:new t.aI(e,r.u_horizon_fog_blend)}),terrainDepth:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ele_delta:new t.aI(e,r.u_ele_delta)}),terrainCoords:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_texture:new t.aH(e,r.u_texture),u_terrain_coords_id:new t.aI(e,r.u_terrain_coords_id),u_ele_delta:new t.aI(e,r.u_ele_delta)}),sky:(e,r)=>({u_sky_color:new t.aL(e,r.u_sky_color),u_horizon_color:new t.aL(e,r.u_horizon_color),u_horizon:new t.aI(e,r.u_horizon),u_sky_horizon_blend:new t.aI(e,r.u_sky_horizon_blend)})};class Xt{constructor(e,t,r){this.context=e;let n=e.gl;this.buffer=n.createBuffer(),this.dynamicDraw=!!r,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.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 new 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 $t={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Kt{constructor(e,t,r,n){this.length=t.length,this.attributes=r,this.itemSize=t.bytesPerElement,this.dynamicDraw=n,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 new 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 r=0;r<this.attributes.length;r++){let n=t.attributes[this.attributes[r].name];void 0!==n&&e.enableVertexAttribArray(n)}}setVertexAttribPointers(e,t,r){for(let n=0;n<this.attributes.length;n++){let i=this.attributes[n],a=t.attributes[i.name];void 0!==a&&e.vertexAttribPointer(a,i.components,e[$t[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Jt=new WeakMap;function Qt(e){var t;if(Jt.has(e))return Jt.get(e);{let r=null===(t=e.getParameter(e.VERSION))||void 0===t?void 0:t.startsWith("WebGL 2.0");return Jt.set(e,r),r}}class er{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 tr extends er{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 rr extends er{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class nr extends er{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class ir extends er{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 ar extends er{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class or extends er{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class sr extends er{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 lr extends er{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 cr extends er{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 ur extends er{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 hr extends er{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 fr extends er{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class pr extends er{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 dr extends er{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 mr extends er{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 gr extends er{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class yr extends er{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 vr extends er{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class xr extends er{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class _r extends er{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class br extends er{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class wr extends er{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 Tr extends er{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 kr extends er{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 Ar extends er{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 Mr extends er{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 Sr extends er{getDefault(){return null}set(e){let t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Er extends er{getDefault(){return null}set(e){var t;if(e===this.current&&!this.dirty)return;let r=this.gl;Qt(r)?r.bindVertexArray(e):null===(t=r.getExtension("OES_vertex_array_object"))||void 0===t||t.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class Cr extends er{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 Ir extends er{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 Lr extends er{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 Pr extends er{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class zr extends Pr{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 Dr extends Pr{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 Or extends Pr{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 Rr{constructor(e,t,r,n,i){this.context=e,this.width=t,this.height=r;let a=e.gl,o=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new zr(e,o),n)this.depthAttachment=i?new Or(e,o):new Dr(e,o);else if(i)throw new Error("Stencil cannot be set without depth");if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw new 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 Fr{constructor(e,t,r){this.blendFunction=e,this.blendColor=t,this.mask=r}}Fr.Replace=[1,0],Fr.disabled=new Fr(Fr.Replace,t.aM.transparent,[!1,!1,!1,!1]),Fr.unblended=new Fr(Fr.Replace,t.aM.transparent,[!0,!0,!0,!0]),Fr.alphaBlended=new Fr([1,771],t.aM.transparent,[!0,!0,!0,!0]);class Br{constructor(e){var t,r;if(this.gl=e,this.clearColor=new tr(this),this.clearDepth=new rr(this),this.clearStencil=new nr(this),this.colorMask=new ir(this),this.depthMask=new ar(this),this.stencilMask=new or(this),this.stencilFunc=new sr(this),this.stencilOp=new lr(this),this.stencilTest=new cr(this),this.depthRange=new ur(this),this.depthTest=new hr(this),this.depthFunc=new fr(this),this.blend=new pr(this),this.blendFunc=new dr(this),this.blendColor=new mr(this),this.blendEquation=new gr(this),this.cullFace=new yr(this),this.cullFaceSide=new vr(this),this.frontFace=new xr(this),this.program=new _r(this),this.activeTexture=new br(this),this.viewport=new wr(this),this.bindFramebuffer=new Tr(this),this.bindRenderbuffer=new kr(this),this.bindTexture=new Ar(this),this.bindVertexBuffer=new Mr(this),this.bindElementBuffer=new Sr(this),this.bindVertexArray=new Er(this),this.pixelStoreUnpack=new Cr(this),this.pixelStoreUnpackPremultiplyAlpha=new Ir(this),this.pixelStoreUnpackFlipY=new Lr(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),Qt(e)){this.HALF_FLOAT=e.HALF_FLOAT;let n=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!==(t=e.RGBA16F)&&void 0!==t?t:n?.RGBA16F_EXT,this.RGB16F=null!==(r=e.RGB16F)&&void 0!==r?r:n?.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");let t=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=t?.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 Xt(this,e,t)}createVertexBuffer(e,t,r){return new Kt(this,e,t,r)}createRenderbuffer(e,t,r){let n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,e,t,r),this.bindRenderbuffer.set(null),i}createFramebuffer(e,t,r,n){return new Rr(this,e,t,r,n)}clear({color:e,depth:t,stencil:r}){let n=this.gl,i=0;e&&(i|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==t&&(i|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==r&&(i|=n.STENCIL_BUFFER_BIT,this.clearStencil.set(r),this.stencilMask.set(255)),n.clear(i)}setCullFace(e){!1===e.enable?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,Fr.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(){var e;return Qt(this.gl)?this.gl.createVertexArray():null===(e=this.gl.getExtension("OES_vertex_array_object"))||void 0===e?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var t;return Qt(this.gl)?this.gl.deleteVertexArray(e):null===(t=this.gl.getExtension("OES_vertex_array_object"))||void 0===t?void 0:t.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}class jr{constructor(e,t,r){this.func=e,this.mask=t,this.range=r}}jr.ReadOnly=!1,jr.ReadWrite=!0,jr.disabled=new jr(519,jr.ReadOnly,[0,1]);let Nr,Ur=7680;class Vr{constructor(e,t,r,n,i,a){this.test=e,this.ref=t,this.mask=r,this.fail=n,this.depthFail=i,this.pass=a}}Vr.disabled=new Vr({func:519,mask:0},0,0,Ur,Ur,Ur);class qr{constructor(e,t,r){this.enable=e,this.mode=t,this.frontFace=r}}function Hr(e,r,n,i,a){let o=e.context,s=o.gl,l=e.useProgram("collisionBox"),c=[],u=0,h=0;for(let p=0;p<i.length;p++){let d=i[p],m=r.getTile(d).getBucket(n);if(!m)continue;let g=a?m.textCollisionBox:m.iconCollisionBox,y=m.collisionCircleArray;if(y.length>0){let r=t.H();t.aQ(r,m.placementInvProjMatrix,e.transform.glCoordMatrix),t.aQ(r,r,m.placementViewportMatrix),c.push({circleArray:y,circleOffset:h,transform:d.posMatrix,invTransform:r,coord:d}),u+=y.length/4,h=u}g&&l.draw(o,s.LINES,jr.disabled,Vr.disabled,e.colorModeForRenderPass(),qr.disabled,{u_matrix:d.posMatrix,u_pixel_extrude_scale:[1/(f=e.transform).width,1/f.height]},e.style.map.terrain&&e.style.map.terrain.getTerrainData(d),n.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,null,e.transform.zoom,null,null,g.collisionVertexBuffer)}var f;if(!a||!c.length)return;let p=e.useProgram("collisionCircle"),d=new t.aR;d.resize(4*u),d._trim();let m=0;for(let e of c)for(let t=0;t<e.circleArray.length/4;t++){let r=4*t,n=e.circleArray[r+0],i=e.circleArray[r+1],a=e.circleArray[r+2],o=e.circleArray[r+3];d.emplace(m++,n,i,a,o,0),d.emplace(m++,n,i,a,o,1),d.emplace(m++,n,i,a,o,2),d.emplace(m++,n,i,a,o,3)}(!Nr||Nr.length<2*u)&&(Nr=function(e){let r=2*e,n=new t.aT;n.resize(r),n._trim();for(let e=0;e<r;e++){let t=6*e;n.uint16[t+0]=4*e+0,n.uint16[t+1]=4*e+1,n.uint16[t+2]=4*e+2,n.uint16[t+3]=4*e+2,n.uint16[t+4]=4*e+3,n.uint16[t+5]=4*e+0}return n}(u));let g=o.createIndexBuffer(Nr,!0),y=o.createVertexBuffer(d,t.aS.members,!0);for(let r of c){let i=Ct(r.transform,r.invTransform,e.transform);p.draw(o,s.TRIANGLES,jr.disabled,Vr.disabled,e.colorModeForRenderPass(),qr.disabled,i,e.style.map.terrain&&e.style.map.terrain.getTerrainData(r.coord),n.id,y,g,t.a0.simpleSegment(0,2*r.circleOffset,r.circleArray.length,r.circleArray.length/2),null,e.transform.zoom,null,null,null)}y.destroy(),g.destroy()}qr.disabled=new qr(!1,1029,2305),qr.backCCW=new qr(!0,1029,2305);let Gr=t.an(new Float32Array(16));function Wr(e,r,n,i,a,o){let{horizontalAlign:s,verticalAlign:l}=t.au(e);return new t.P((-(s-.5)*r/a+i[0])*o,(-(l-.5)*n/a+i[1])*o)}function Zr(e,r,n,i,a,o){let s=r.tileAnchorPoint.add(new t.P(r.translation[0],r.translation[1]));if(r.pitchWithMap){let e=i.mult(o);n||(e=e.rotate(-a));let t=s.add(e);return _e(t.x,t.y,r.labelPlaneMatrix,r.getElevation).point}if(n){let t=Ce(r.tileAnchorPoint.x+1,r.tileAnchorPoint.y,r).point.sub(e),n=Math.atan(t.y/t.x)+(t.x<0?Math.PI:0);return e.add(i.rotate(n))}return e.add(i)}function Yr(e,r,n,i,a,o,s,l,c,u,h,f,p,d){let m=e.text.placedSymbolArray,g=e.text.dynamicLayoutVertexArray,y=e.icon.dynamicLayoutVertexArray,v={};g.clear();for(let y=0;y<m.length;y++){let x=m.get(y),_=x.hidden||!x.crossTileID||e.allowVerticalPlacement&&!x.placedOrientation?null:i[x.crossTileID];if(_){let i=new t.P(x.anchorX,x.anchorY),m={getElevation:d,width:a.width,height:a.height,labelPlaneMatrix:o,lineVertexArray:null,pitchWithMap:n,projection:h,projectionCache:null,tileAnchorPoint:i,translation:f,unwrappedTileID:p},y=n?_e(i.x,i.y,s,d):Ce(i.x,i.y,m),b=be(a.cameraToCenterDistance,y.signedDistanceFromCamera),w=t.ai(e.textSizeData,c,x)*b/t.ap;n&&(w*=e.tilePixelRatio/l);let{width:T,height:k,anchor:A,textOffset:M,textBoxScale:S}=_,E=Wr(A,T,k,M,S,w),C=h.getPitchedTextCorrection(a,i.add(new t.P(f[0],f[1])),p),I=Zr(y.point,m,r,E,a.angle,C),L=e.allowVerticalPlacement&&x.placedOrientation===t.ah.vertical?Math.PI/2:0;for(let e=0;e<x.numGlyphs;e++)t.aj(g,I,L);u&&x.associatedIconIndex>=0&&(v[x.associatedIconIndex]={shiftedAnchor:I,angle:L})}else De(x.numGlyphs,g)}if(u){y.clear();let r=e.icon.placedSymbolArray;for(let e=0;e<r.length;e++){let n=r.get(e);if(n.hidden)De(n.numGlyphs,y);else{let r=v[e];if(r)for(let e=0;e<n.numGlyphs;e++)t.aj(y,r.shiftedAnchor,r.angle);else De(n.numGlyphs,y)}}e.icon.dynamicLayoutVertexBuffer.updateData(y)}e.text.dynamicLayoutVertexBuffer.updateData(g)}function Xr(e,t,r){return r.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function $r(e,r,n,i,a,o,s,l,c,u,h,f){let p=e.context,d=p.gl,m=e.transform,g=nt(),y="map"===l,v="map"===c,x="viewport"!==l&&"point"!==n.layout.get("symbol-placement"),_=y&&!v&&!x,b=!v&&x,w=!n.layout.get("symbol-sort-key").isConstant(),T=!1,k=e.depthModeForSublayer(0,jr.ReadOnly),A=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),M=[],S=g.getCircleRadiusCorrection(m);for(let l of i){let i=r.getTile(l),c=i.getBucket(n);if(!c)continue;let h=a?c.text:c.icon;if(!h||!h.segments.get().length||!h.hasVisibleVertices)continue;let f,p,k,E,C=h.programConfigurations.get(n.id),I=a||c.sdfIcons,L=a?c.textSizeData:c.iconSizeData,P=v||0!==m.pitch,z=e.useProgram(Xr(I,a,c),C),D=t.ag(L,m.zoom),O=e.style.map.terrain&&e.style.map.terrain.getTerrainData(l),R=[0,0],F=null;if(a)p=i.glyphAtlasTexture,k=d.LINEAR,f=i.glyphAtlasTexture.size,c.iconsInText&&(R=i.imageAtlasTexture.size,F=i.imageAtlasTexture,E=P||e.options.rotating||e.options.zooming||"composite"===L.kind||"camera"===L.kind?d.LINEAR:d.NEAREST);else{let t=1!==n.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;p=i.imageAtlasTexture,k=I||e.options.rotating||e.options.zooming||t||P?d.LINEAR:d.NEAREST,f=i.imageAtlasTexture.size}let B=Be(i,1,e.transform.zoom),j=b?l.posMatrix:Gr,N=ve(j,v,y,e.transform,B),U=xe(j,v,y,e.transform,B),V=xe(l.posMatrix,v,y,e.transform,B),q=g.translatePosition(e.transform,i,o,s),H=A&&c.hasTextData(),G="none"!==n.layout.get("icon-text-fit")&&H&&c.hasIconData();if(x){let t=e.style.map.terrain?(t,r)=>e.style.map.terrain.getElevation(l,t,r):null,r="map"===n.layout.get("text-rotation-alignment");Te(c,l.posMatrix,e,a,N,V,v,u,r,g,l.toUnwrapped(),m.width,m.height,q,t)}let W,Z=l.posMatrix,Y=a&&A||G,X=x||Y?Gr:N,$=U,K=I&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1);W=I?c.iconsInText?Gt(L.kind,D,_,v,x,Y,e,Z,X,$,q,f,R,S):Ht(L.kind,D,_,v,x,Y,e,Z,X,$,q,a,f,!0,S):qt(L.kind,D,_,v,x,Y,e,Z,X,$,q,a,f,S);let J={program:z,buffers:h,uniformValues:W,atlasTexture:p,atlasTextureIcon:F,atlasInterpolation:k,atlasInterpolationIcon:E,isSDF:I,hasHalo:K};if(w&&c.canOverlap){T=!0;let e=h.segments.get();for(let r of e)M.push({segments:new t.a0([r]),sortKey:r.sortKey,state:J,terrainData:O})}else M.push({segments:h.segments,sortKey:0,state:J,terrainData:O})}T&&M.sort(((e,t)=>e.sortKey-t.sortKey));for(let t of M){let r=t.state;if(p.activeTexture.set(d.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,d.CLAMP_TO_EDGE),r.atlasTextureIcon&&(p.activeTexture.set(d.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),r.isSDF){let i=r.uniformValues;r.hasHalo&&(i.u_is_halo=1,Kr(r.buffers,t.segments,n,e,r.program,k,h,f,i,t.terrainData)),i.u_is_halo=0}Kr(r.buffers,t.segments,n,e,r.program,k,h,f,r.uniformValues,t.terrainData)}}function Kr(e,t,r,n,i,a,o,s,l,c){let u=n.context;i.draw(u,u.gl.TRIANGLES,a,o,s,qr.disabled,l,c,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,n.transform.zoom,e.programConfigurations.get(r.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function Jr(e,r,n,i){let a=e.context,o=a.gl,s=Vr.disabled,l=new Fr([o.ONE,o.ONE],t.aM.transparent,[!0,!0,!0,!0]),c=r.getBucket(n);if(!c)return;let u=i.key,h=n.heatmapFbos.get(u);h||(h=en(a,r.tileSize,r.tileSize),n.heatmapFbos.set(u,h)),a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,r.tileSize,r.tileSize]),a.clear({color:t.aM.transparent});let f=c.programConfigurations.get(n.id),p=e.useProgram("heatmap",f),d=e.style.map.terrain.getTerrainData(i);p.draw(a,o.TRIANGLES,jr.disabled,s,l,qr.disabled,Pt(i.posMatrix,r,e.transform.zoom,n.paint.get("heatmap-intensity")),d,n.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,n.paint,e.transform.zoom,f)}function Qr(e,t,r){let n=e.context,i=n.gl;n.setColorMode(e.colorModeForRenderPass());let a=tn(n,t),o=r.key,s=t.heatmapFbos.get(o);s&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,s.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,i.TRIANGLES,jr.disabled,Vr.disabled,e.colorModeForRenderPass(),qr.disabled,zt(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 en(e,t,r){var n,i;let a=e.gl,o=a.createTexture();a.bindTexture(a.TEXTURE_2D,o),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);let s=null!==(n=e.HALF_FLOAT)&&void 0!==n?n:a.UNSIGNED_BYTE,l=null!==(i=e.RGBA16F)&&void 0!==i?i:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,l,t,r,0,a.RGBA,s,null);let c=e.createFramebuffer(t,r,!1,!1);return c.colorAttachment.set(o),c}function tn(e,t){return t.colorRampTexture||(t.colorRampTexture=new w(e,t.colorRamp,e.gl.RGBA)),t.colorRampTexture}function rn(e,t,r,n,i){if(!r||!n||!n.imageAtlas)return;let a=n.imageAtlas.patternPositions,o=a[r.to.toString()],s=a[r.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 nn(e,t,r,n,i,a,o){let s,l,c,u,h,f=e.context.gl,p="fill-pattern",d=r.paint.get(p),m=d&&d.constantOr(1),g=r.getCrossfadeParameters();o?(l=m&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=f.LINES):(l=m?"fillPattern":"fill",s=f.TRIANGLES);let y=d.constantOr(null);for(let d of n){let n=t.getTile(d);if(m&&!n.patternsLoaded())continue;let v=n.getBucket(r);if(!v)continue;let x=v.programConfigurations.get(r.id),_=e.useProgram(l,x),b=e.style.map.terrain&&e.style.map.terrain.getTerrainData(d);m&&(e.context.activeTexture.set(f.TEXTURE0),n.imageAtlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),x.updatePaintBuffers(g)),rn(x,p,y,n,r);let w=b?d:null,T=e.translatePosMatrix(w?w.posMatrix:d.posMatrix,n,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){u=v.indexBuffer2,h=v.segments2;let t=[f.drawingBufferWidth,f.drawingBufferHeight];c="fillOutlinePattern"===l&&m?St(T,e,g,n,t):Mt(T,t)}else u=v.indexBuffer,h=v.segments,c=m?At(T,e,g,n):kt(T);_.draw(e.context,s,i,e.stencilModeForClipping(d),a,qr.disabled,c,b,r.id,v.layoutVertexBuffer,u,h,r.paint,e.transform.zoom,x)}}function an(e,t,r,n,i,a,o){let s=e.context,l=s.gl,c="fill-extrusion-pattern",u=r.paint.get(c),h=u.constantOr(1),f=r.getCrossfadeParameters(),p=r.paint.get("fill-extrusion-opacity"),d=u.constantOr(null);for(let u of n){let n=t.getTile(u),m=n.getBucket(r);if(!m)continue;let g=e.style.map.terrain&&e.style.map.terrain.getTerrainData(u),y=m.programConfigurations.get(r.id),v=e.useProgram(h?"fillExtrusionPattern":"fillExtrusion",y);h&&(e.context.activeTexture.set(l.TEXTURE0),n.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(f)),rn(y,c,d,n,r);let x=e.translatePosMatrix(u.posMatrix,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),_=r.paint.get("fill-extrusion-vertical-gradient"),b=h?Tt(x,e,_,p,u,f,n):wt(x,e,_,p);v.draw(s,s.gl.TRIANGLES,i,a,o,qr.backCCW,b,g,r.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,r.paint,e.transform.zoom,y,e.style.map.terrain&&m.centroidVertexBuffer)}}function on(e,t,r,n,i,a,o){let s=e.context,l=s.gl,c=r.fbo;if(!c)return;let u=e.useProgram("hillshade"),h=e.style.map.terrain&&e.style.map.terrain.getTerrainData(t);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),u.draw(s,l.TRIANGLES,i,a,o,qr.disabled,((e,t,r,n)=>{let i=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),o=r.paint.get("hillshade-accent-color"),s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);let l=!e.options.moving;return{u_matrix:n?n.posMatrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped(),l),u_image:0,u_latrange:Dt(0,t.tileID),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:a,u_accent:o}})(e,r,n,h?t:null),h,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}function sn(e,r,n,i,a,o){let s=e.context,l=s.gl,c=r.dem;if(c&&c.data){let u=c.dim,h=c.stride,f=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(h),r.demTexture){let e=r.demTexture;e.update(f,{premultiply:!1}),e.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new w(s,f,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let p=r.fbo;if(!p){let e=new w(s,{width:u,height:u,data:null},l.RGBA);e.bind(l.LINEAR,l.CLAMP_TO_EDGE),p=r.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,l.TRIANGLES,i,a,o,qr.disabled,((e,r)=>{let n=r.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:[n,n],u_zoom:e.overscaledZ,u_unpack:r.getUnpackVector()}})(r.tileID,c),null,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function ln(e,r,n,i,o,s){let l=i.paint.get("raster-fade-duration");if(!s&&l>0){let i=a.now(),s=(i-e.timeAdded)/l,c=r?(i-r.timeAdded)/l:-1,u=n.getSource(),h=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),f=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),p=f&&e.refreshedUponExpiration?1:t.ac(f?s:1-c,0,1);return e.refreshedUponExpiration&&s>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}let cn=new t.aM(1,0,0,1),un=new t.aM(0,1,0,1),hn=new t.aM(0,0,1,1),fn=new t.aM(1,0,1,1),pn=new t.aM(0,1,1,1);function dn(e,t,r,n){gn(e,0,t+r/2,e.transform.width,r,n)}function mn(e,t,r,n){gn(e,t-r/2,0,r,e.transform.height,n)}function gn(e,t,r,n,i,a){let o=e.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(t*e.pixelRatio,r*e.pixelRatio,n*e.pixelRatio,i*e.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function yn(e,r,n){let i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=jr.disabled,c=Vr.disabled,u=e.colorModeForRenderPass(),h="$debug",f=e.style.map.terrain&&e.style.map.terrain.getTerrainData(n);i.activeTexture.set(a.TEXTURE0);let p=r.getTileByID(n.key).latestRawTileData,d=Math.floor((p&&p.byteLength||0)/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/e.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=` => ${n.overscaledZ}`),function(e,t){e.initDebugOverlayCanvas();let r=e.debugOverlayCanvas,n=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.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(r),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,`${y} ${d}kB`),s.draw(i,a.TRIANGLES,l,c,Fr.alphaBlended,qr.disabled,It(o,t.aM.transparent,g),null,h,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),s.draw(i,a.LINE_STRIP,l,c,u,qr.disabled,It(o,t.aM.red),f,h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function vn(e,t,r){let n=e.context,i=n.gl,a=e.colorModeForRenderPass(),o=new jr(i.LEQUAL,jr.ReadWrite,e.depthRangeFor3D),s=e.useProgram("terrain"),l=t.getTerrainMesh();n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height]);for(let c of r){let r=e.renderToTexture.getTexture(c),u=t.getTerrainData(c.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,r.texture);let h=e.transform.calculatePosMatrix(c.tileID.toUnwrapped()),f=t.getMeshFrameDelta(e.transform.zoom),p=e.transform.calculateFogMatrix(c.tileID.toUnwrapped()),d=vt(h,f,p,e.style.sky,e.transform.pitch);s.draw(n,i.TRIANGLES,o,Vr.disabled,a,qr.backCCW,d,u,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class xn{constructor(e,t,r){this.vertexBuffer=e,this.indexBuffer=t,this.segments=r}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class _n{constructor(e,r){this.context=new Br(e),this.transform=r,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/Math.pow(2,16),this.crossTileSymbolIndex=new ut}resize(e,t,r){if(this.width=Math.floor(e*r),this.height=Math.floor(t*r),this.pixelRatio=r,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,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.tileExtentBuffer=e.createVertexBuffer(r,dt.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);let 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.debugBuffer=e.createVertexBuffer(n,dt.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,dt.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 l=this.context.gl;this.stencilClearMode=new Vr({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){let e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let n=t.H();t.aP(n,0,this.width,this.height,0,0,1),t.K(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,jr.disabled,this.stencilClearMode,Fr.disabled,qr.disabled,Lt(n),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 r=this.context,n=r.gl;this.nextStencilID+t.length>256&&this.clearStencil(),r.setColorMode(Fr.disabled),r.setDepthMode(jr.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(r,n.TRIANGLES,jr.disabled,new Vr({func:n.ALWAYS,mask:0},t,255,n.KEEP,n.KEEP,n.REPLACE),Fr.disabled,qr.disabled,Lt(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 Vr({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new Vr({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}stencilConfigForOverlap(e){let t=this.context.gl,r=e.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),n=r[r.length-1].overscaledZ,i=r[0].overscaledZ-n+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();let e={};for(let r=0;r<i;r++)e[r+n]=new Vr({func:t.GEQUAL,mask:255},r+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=i,[e,r]}return[{[n]:Vr.disabled},r]}colorModeForRenderPass(){let e=this.context.gl;return this._showOverdrawInspector?new Fr([e.CONSTANT_COLOR,e.ONE],new t.aM(.125,.125,.125,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Fr.unblended:Fr.alphaBlended}depthModeForSublayer(e,t,r){if(!this.opaquePassEnabledForLayer())return jr.disabled;let n=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new jr(r||this.context.gl.LEQUAL,t,[n,n])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,r){this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(a.now()),this.imageManager.beginFrame();let n=this.style._order,i=this.style.sourceCaches,o={},s={},l={};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(),l[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<n.length;e++)if(this.style._layers[n[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 n){let t=this.style._layers[e];if(!t.hasOffscreenPass()||t.isHidden(this.transform.zoom))continue;let r=s[t.source];("custom"===t.type||r.length)&&this.renderLayer(this,i[t.source],t,r)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.aM.black:t.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(e,r){let n=e.context,i=n.gl,a=(u=r,h=e.style.map.transform,f=e.pixelRatio,{u_sky_color:u.properties.get("sky-color"),u_horizon_color:u.properties.get("horizon-color"),u_horizon:(h.height/2+h.getHorizon())*f,u_sky_horizon_blend:u.properties.get("sky-horizon-blend")*h.height/2*f}),o=new jr(i.LEQUAL,jr.ReadWrite,[0,1]),s=Vr.disabled,l=e.colorModeForRenderPass(),c=e.useProgram("sky");var u,h,f;if(!r.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),r.mesh=new xn(n.createVertexBuffer(e,dt.members),n.createIndexBuffer(i),t.a0.simpleSegment(0,0,e.length,i.length))}c.draw(n,i.TRIANGLES,o,s,l,qr.disabled,a,void 0,"sky",r.mesh.vertexBuffer,r.mesh.indexBuffer,r.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){let e=this.style._layers[n[this.currentLayer]],t=i[e.source],r=o[e.source];this._renderTileClippingMasks(e,r),this.renderLayer(this,t,e,r)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){let e=this.style._layers[n[this.currentLayer]],t=i[e.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(e))continue;let r=("symbol"===e.type?l:s)[e.source];this._renderTileClippingMasks(e,o[e.source]),this.renderLayer(this,t,e,r)}if(this.options.showTileBoundaries){let e=function(e,t){let r=null,n=Object.values(e._layers).flatMap((r=>r.source&&!r.isHidden(t)?[e.sourceCaches[r.source]]:[])),i=n.filter((e=>"vector"===e.getSource().type)),a=n.filter((e=>"vector"!==e.getSource().type)),o=e=>{(!r||r.getSource().maxzoom<e.getSource().maxzoom)&&(r=e)};return i.forEach((e=>o(e))),r||a.forEach((e=>o(e))),r}(this.style,this.transform.zoom);e&&function(e,t,r){for(let n=0;n<r.length;n++)yn(e,t,r[n])}(this,e,e.getVisibleCoordinates())}this.options.showPadding&&function(e){let t=e.transform.padding;dn(e,e.transform.height-(t.top||0),3,cn),dn(e,t.bottom||0,3,un),mn(e,t.left||0,3,hn),mn(e,e.transform.width-(t.right||0),3,fn);let r=e.transform.centerPoint;var n,i,a,o;gn(n=e,(i=r.x)-1,(a=e.transform.height-r.y)-10,2,20,o=pn),gn(n,i-10,a-1,20,2,o)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;let r=this.terrainFacilitator.matrix,n=this.transform.modelViewProjectionMatrix,i=this.terrainFacilitator.dirty;i||(i=e?!t.a_(r,n):!t.a$(r,n)),i||(i=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),i&&(t.b0(r,n),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(e,r){let n=e.context,i=n.gl,a=Fr.unblended,o=new jr(i.LEQUAL,jr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.sourceCache.getRenderableTiles(),c=e.useProgram("terrainDepth");n.bindFramebuffer.set(r.getFramebuffer("depth").framebuffer),n.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),n.clear({color:t.aM.transparent,depth:1});for(let t of l){let l=r.getTerrainData(t.tileID),u={u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped()),u_ele_delta:r.getMeshFrameDelta(e.transform.zoom)};c.draw(n,i.TRIANGLES,o,Vr.disabled,a,qr.backCCW,u,l,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain),function(e,r){let n=e.context,i=n.gl,a=Fr.unblended,o=new jr(i.LEQUAL,jr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.getCoordsTexture(),c=r.sourceCache.getRenderableTiles(),u=e.useProgram("terrainCoords");n.bindFramebuffer.set(r.getFramebuffer("coords").framebuffer),n.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),n.clear({color:t.aM.transparent,depth:1}),r.coordsIndex=[];for(let t of c){let c=r.getTerrainData(t.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,l.texture);let h={u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped()),u_terrain_coords_id:(255-r.coordsIndex.length)/255,u_texture:0,u_ele_delta:r.getMeshFrameDelta(e.transform.zoom)};u.draw(n,i.TRIANGLES,o,Vr.disabled,a,qr.backCCW,h,c,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),r.coordsIndex.push(t.tileID.key)}n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain))}renderLayer(e,r,n,i){if(!n.isHidden(this.transform.zoom)&&("background"===n.type||"custom"===n.type||(i||[]).length))switch(this.id=n.id,n.type){case"symbol":!function(e,r,n,i,a){if("translucent"!==e.renderPass)return;let o=Vr.disabled,s=e.colorModeForRenderPass();(n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(e,r,n,i,a,o,s,l,c){let u=r.transform,h=nt(),f="map"===a,p="map"===o;for(let a of e){let e=i.getTile(a),o=e.getBucket(n);if(!o||!o.text||!o.text.segments.get().length)continue;let d=t.ag(o.textSizeData,u.zoom),m=Be(e,1,r.transform.zoom),g=ve(a.posMatrix,p,f,r.transform,m),y="none"!==n.layout.get("icon-text-fit")&&o.hasIconData();if(d){let t=Math.pow(2,u.zoom-e.tileID.overscaledZ),n=r.style.map.terrain?(e,t)=>r.style.map.terrain.getElevation(a,e,t):null,i=h.translatePosition(u,e,s,l);Yr(o,f,p,c,u,g,a.posMatrix,t,d,y,h,i,a.toUnwrapped(),n)}}}(i,e,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&$r(e,r,n,i,!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"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&$r(e,r,n,i,!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"),o,s),r.map.showCollisionBoxes&&(Hr(e,r,n,i,!0),Hr(e,r,n,i,!1))}(e,r,n,i,this.style.placement.variableOffsets);break;case"circle":!function(e,r,n,i){if("translucent"!==e.renderPass)return;let a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=!n.layout.get("circle-sort-key").isConstant();if(0===a.constantOr(1)&&(0===o.constantOr(1)||0===s.constantOr(1)))return;let c=e.context,u=c.gl,h=e.depthModeForSublayer(0,jr.ReadOnly),f=Vr.disabled,p=e.colorModeForRenderPass(),d=[];for(let a=0;a<i.length;a++){let o=i[a],s=r.getTile(o),c=s.getBucket(n);if(!c)continue;let u=c.programConfigurations.get(n.id),h=e.useProgram("circle",u),f=c.layoutVertexBuffer,p=c.indexBuffer,m=e.style.map.terrain&&e.style.map.terrain.getTerrainData(o),g={programConfiguration:u,program:h,layoutVertexBuffer:f,indexBuffer:p,uniformValues:Et(e,o,s,n),terrainData:m};if(l){let e=c.segments.get();for(let r of e)d.push({segments:new t.a0([r]),sortKey:r.sortKey,state:g})}else d.push({segments:c.segments,sortKey:0,state:g})}l&&d.sort(((e,t)=>e.sortKey-t.sortKey));for(let t of d){let{programConfiguration:r,program:i,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:l}=t.state;i.draw(c,u.TRIANGLES,h,f,p,qr.disabled,s,l,n.id,a,o,t.segments,n.paint,e.transform.zoom,r)}}(e,r,n,i);break;case"heatmap":!function(e,r,n,i){if(0===n.paint.get("heatmap-opacity"))return;let a=e.context;if(e.style.map.terrain){for(let t of i){let i=r.getTile(t);r.hasRenderableParent(t)||("offscreen"===e.renderPass?Jr(e,i,n,t):"translucent"===e.renderPass&&Qr(e,n,t))}a.viewport.set([0,0,e.width,e.height])}else"offscreen"===e.renderPass?function(e,r,n,i){let a=e.context,o=a.gl,s=Vr.disabled,l=new Fr([o.ONE,o.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(e,r,n){let i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,r.width/4,r.height/4]);let a=n.heatmapFbos.get(t.aU);a?(i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer)):(a=en(e,r.width/4,r.height/4),n.heatmapFbos.set(t.aU,a))})(a,e,n),a.clear({color:t.aM.transparent});for(let t=0;t<i.length;t++){let c=i[t];if(r.hasRenderableParent(c))continue;let u=r.getTile(c),h=u.getBucket(n);if(!h)continue;let f=h.programConfigurations.get(n.id),p=e.useProgram("heatmap",f),{zoom:d}=e.transform;p.draw(a,o.TRIANGLES,jr.disabled,s,l,qr.disabled,Pt(c.posMatrix,u,d,n.paint.get("heatmap-intensity")),null,n.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,n.paint,e.transform.zoom,f)}a.viewport.set([0,0,e.width,e.height])}(e,r,n,i):"translucent"===e.renderPass&&function(e,r){let n=e.context,i=n.gl;n.setColorMode(e.colorModeForRenderPass());let a=r.heatmapFbos.get(t.aU);a&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),tn(n,r).bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,i.TRIANGLES,jr.disabled,Vr.disabled,e.colorModeForRenderPass(),qr.disabled,zt(e,r,0,1),null,r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom))}(e,n)}(e,r,n,i);break;case"line":!function(e,r,n,i){if("translucent"!==e.renderPass)return;let a=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0===a.constantOr(1)||0===o.constantOr(1))return;let s=e.depthModeForSublayer(0,jr.ReadOnly),l=e.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),u=n.paint.get("line-pattern"),h=u.constantOr(1),f=n.paint.get("line-gradient"),p=n.getCrossfadeParameters(),d=h?"linePattern":c?"lineSDF":f?"lineGradient":"line",m=e.context,g=m.gl,y=!0;for(let a of i){let i=r.getTile(a);if(h&&!i.patternsLoaded())continue;let o=i.getBucket(n);if(!o)continue;let v=o.programConfigurations.get(n.id),x=e.context.program.get(),_=e.useProgram(d,v),b=y||_.program!==x,T=e.style.map.terrain&&e.style.map.terrain.getTerrainData(a),k=u.constantOr(null);if(k&&i.imageAtlas){let e=i.imageAtlas,t=e.patternPositions[k.to.toString()],r=e.patternPositions[k.from.toString()];t&&r&&v.setConstantPatternPositions(t,r)}let A=T?a:null,M=h?Ft(e,i,n,p,A):c?Bt(e,i,n,c,p,A):f?Rt(e,i,n,o.lineClipsArray.length,A):Ot(e,i,n,A);if(h)m.activeTexture.set(g.TEXTURE0),i.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),v.updatePaintBuffers(p);else if(c&&(b||e.lineAtlas.dirty))m.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(m);else if(f){let i=o.gradients[n.id],s=i.texture;if(n.gradientVersion!==i.version){let l=256;if(n.stepInterpolant){let n=r.getSource().maxzoom,i=a.canonical.z===n?Math.ceil(1<<e.transform.maxZoom-a.canonical.z):1;l=t.ac(t.aV(o.maxLineLength/t.X*1024*i),256,m.maxTextureSize)}i.gradient=t.aW({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:i.gradient||void 0,clips:o.lineClipsArray}),i.texture?i.texture.update(i.gradient):i.texture=new w(m,i.gradient,g.RGBA),i.version=n.gradientVersion,s=i.texture}m.activeTexture.set(g.TEXTURE0),s.bind(n.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}_.draw(m,g.TRIANGLES,s,e.stencilModeForClipping(a),l,qr.disabled,M,T,n.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,n.paint,e.transform.zoom,v,o.layoutVertexBuffer2),y=!1}}(e,r,n,i);break;case"fill":!function(e,r,n,i){let a=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0===o.constantOr(1))return;let s=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(t.aM.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){let t=e.depthModeForSublayer(1,"opaque"===e.renderPass?jr.ReadWrite:jr.ReadOnly);nn(e,r,n,i,t,s,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){let t=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,jr.ReadOnly);nn(e,r,n,i,t,s,!0)}}(e,r,n,i);break;case"fill-extrusion":!function(e,t,r,n){let i=r.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===e.renderPass){let a=new jr(e.context.gl.LEQUAL,jr.ReadWrite,e.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))an(e,t,r,n,a,Vr.disabled,Fr.disabled),an(e,t,r,n,a,e.stencilModeFor3D(),e.colorModeForRenderPass());else{let i=e.colorModeForRenderPass();an(e,t,r,n,a,Vr.disabled,i)}}}(e,r,n,i);break;case"hillshade":!function(e,t,r,n){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;let i=e.context,a=e.depthModeForSublayer(0,jr.ReadOnly),o=e.colorModeForRenderPass(),[s,l]="translucent"===e.renderPass?e.stencilConfigForOverlap(n):[{},n];for(let n of l){let i=t.getTile(n);void 0!==i.needsHillshadePrepare&&i.needsHillshadePrepare&&"offscreen"===e.renderPass?sn(e,i,r,a,Vr.disabled,o):"translucent"===e.renderPass&&on(e,n,i,r,a,s[n.overscaledZ],o)}i.viewport.set([0,0,e.width,e.height])}(e,r,n,i);break;case"raster":!function(e,t,r,n){if("translucent"!==e.renderPass||0===r.paint.get("raster-opacity")||!n.length)return;let i=e.context,a=i.gl,o=t.getSource(),s=e.useProgram("raster"),l=e.colorModeForRenderPass(),[c,u]=o instanceof ee?[{},n]:e.stencilConfigForOverlap(n),h=u[u.length-1].overscaledZ,f=!e.options.moving;for(let n of u){let u=e.depthModeForSublayer(n.overscaledZ-h,1===r.paint.get("raster-opacity")?jr.ReadWrite:jr.ReadOnly,a.LESS),p=t.getTile(n);p.registerFadeDuration(r.paint.get("raster-fade-duration"));let d,m,g=t.findLoadedParent(n,0),y=t.findLoadedSibling(n),v=ln(p,g||y||null,t,r,e.transform,e.style.map.terrain),x="nearest"===r.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),p.texture.bind(x,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),g?(g.texture.bind(x,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),d=Math.pow(2,g.tileID.overscaledZ-p.tileID.overscaledZ),m=[p.tileID.canonical.x*d%1,p.tileID.canonical.y*d%1]):p.texture.bind(x,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 _=e.style.map.terrain&&e.style.map.terrain.getTerrainData(n),b=_?n:null,w=b?b.posMatrix:e.transform.calculatePosMatrix(n.toUnwrapped(),f),T=Ut(w,m||[0,0],d||1,v,r);o instanceof ee?s.draw(i,a.TRIANGLES,u,Vr.disabled,l,qr.disabled,T,_,r.id,o.boundsBuffer,e.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,u,c[n.overscaledZ],l,qr.disabled,T,_,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}(e,r,n,i);break;case"background":!function(e,t,r,n){let i=r.paint.get("background-color"),a=r.paint.get("background-opacity");if(0===a)return;let o=e.context,s=o.gl,l=e.transform,c=l.tileSize,u=r.paint.get("background-pattern");if(e.isPatternMissing(u))return;let h=!u&&1===i.a&&1===a&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==h)return;let f=Vr.disabled,p=e.depthModeForSublayer(0,"opaque"===h?jr.ReadWrite:jr.ReadOnly),d=e.colorModeForRenderPass(),m=e.useProgram(u?"backgroundPattern":"background"),g=n||l.coveringTiles({tileSize:c,terrain:e.style.map.terrain});u&&(o.activeTexture.set(s.TEXTURE0),e.imageManager.bind(e.context));let y=r.getCrossfadeParameters();for(let t of g){let l=n?t.posMatrix:e.transform.calculatePosMatrix(t.toUnwrapped()),h=u?Zt(l,a,e,u,{tileID:t,tileSize:c},y):Wt(l,a,i),g=e.style.map.terrain&&e.style.map.terrain.getTerrainData(t);m.draw(o,s.TRIANGLES,p,f,d,qr.disabled,h,g,r.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}(e,0,n,i);break;case"custom":!function(e,t,r){let n=e.context,i=r.implementation;if("offscreen"===e.renderPass){let t=i.prerender;t&&(e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),t.call(i,n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),n.setStencilMode(Vr.disabled);let t="3d"===i.renderingMode?new jr(e.context.gl.LEQUAL,jr.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,jr.ReadOnly);n.setDepthMode(t),i.render(n.gl,e.transform.customLayerMatrix(),{farZ:e.transform.farZ,nearZ:e.transform.nearZ,fov:e.transform._fov,modelViewProjectionMatrix:e.transform.modelViewProjectionMatrix,projectionMatrix:e.transform.projectionMatrix}),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(null)}}(e,0,n)}}translatePosMatrix(e,r,n,i,a){if(!n[0]&&!n[1])return e;let o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){let e=Math.sin(o),t=Math.cos(o);n=[n[0]*t-n[1]*e,n[0]*e+n[1]*t]}let s=[a?n[0]:Be(r,n[0],this.transform.zoom),a?n[1]:Be(r,n[1],this.transform.zoom),0],l=new Float32Array(16);return t.J(l,e,s),l}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()),r=this.imageManager.getPattern(e.to.toString());return!t||!r}useProgram(e,t){this.cache=this.cache||{};let r=e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[r]||(this.cache[r]=new _t(this.context,mt[e],t,Yt[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[r]}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(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new w(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 bn{constructor(e,t){this.points=e,this.planes=t}static fromInvProjectionMatrix(e,r,n){let i=Math.pow(2,n),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((n=>{let a=1/(n=t.af([],n,e))[3]/r*i;return t.b1(n,n,[a,a,1/n[3],a])})),o=[[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 r=t[0],n=t[1],i=t[2],a=r*r+n*n+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}([],(n=[],i=y([],a[e[0]],a[e[1]]),o=y([],a[e[2]],a[e[1]]),s=i[0],l=i[1],c=i[2],u=o[0],h=o[1],f=o[2],n[0]=l*f-c*h,n[1]=c*u-s*f,n[2]=s*h-l*u,n)),r=-((p=t)[0]*(d=a[e[1]])[0]+p[1]*d[1]+p[2]*d[2]);var n,i,o,s,l,c,u,h,f,p,d;return t.concat(r)}));return new bn(a,o)}}class wn{constructor(e,t){var r,n,i;this.min=e,this.max=t,this.center=function(e,t){return e[0]=.5*t[0],e[1]=.5*t[1],e[2]=.5*t[2],e}([],(r=[],n=this.min,i=this.max,r[0]=n[0]+i[0],r[1]=n[1]+i[1],r[2]=n[2]+i[2],r))}quadrant(e){let t=[e%2==0,e<2],r=m(this.min),n=m(this.max);for(let e=0;e<t.length;e++)r[e]=t[e]?this.min[e]:this.center[e],n[e]=t[e]?this.center[e]:this.max[e];return n[2]=this.max[2],new wn(r,n)}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 r=[[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]],n=!0;for(let i=0;i<e.planes.length;i++){let a=e.planes[i],o=0;for(let e=0;e<r.length;e++)t.b2(a,r[e])>=0&&o++;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(let t=0;t<3;t++){let r=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let i=0;i<e.points.length;i++){let a=e.points[i][t]-this.min[t];r=Math.min(r,a),n=Math.max(n,a)}if(n<0||r>this.max[t]-this.min[t])return 0}return 1}}class Tn{constructor(e=0,t=0,r=0,n=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=n}interpolate(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.y.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.y.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.y.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.y.number(e.right,r.right,n)),this}getCenter(e,r){let n=t.ac((this.left+e-this.right)/2,0,e),i=t.ac((this.top+r-this.bottom)/2,0,r);return new t.P(n,i)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Tn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let kn=85.051129;class An{constructor(e,r,n,i,a){this.tileSize=512,this._renderWorldCopies=void 0===a||!!a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=n??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 Tn,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let e=new An(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){void 0===e?e=!0:null===e&&(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 r=-t.b3(e,-180,180)*Math.PI/180;var n;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=(n=new t.A(4),t.A!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n),function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);e[0]=n*l+a*s,e[1]=i*l+o*s,e[2]=n*-s+a*l,e[3]=i*-s+o*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){let r=t.ac(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,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,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),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 r=[new t.b4(0,e)];if(this._renderWorldCopies){let n=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(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=1;for(let n=s-c;n<=l+c;n++)0!==n&&r.push(new t.b4(n,e))}return r}coveringTiles(e){var r,n;let i=this.coveringZoomLevel(e),a=i;if(void 0!==e.minzoom&&i<e.minzoom)return[];void 0!==e.maxzoom&&i>e.maxzoom&&(i=e.maxzoom);let o=this.pointCoordinate(this.getCameraPoint()),s=t.Z.fromLngLat(this.center),l=Math.pow(2,i),c=[l*o.x,l*o.y,0],u=[l*s.x,l*s.y,0],h=bn.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,i),f=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(f=i);let p=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,d=e=>({aabb:new wn([e*l,0,0],[(e+1)*l,l,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),m=[],g=[],y=i,v=e.reparseOverscaled?a:i;if(this._renderWorldCopies)for(let e=1;e<=3;e++)m.push(d(-e)),m.push(d(e));for(m.push(d(0));m.length>0;){let i=m.pop(),a=i.x,o=i.y,s=i.fullyVisible;if(!s){let e=i.aabb.intersects(h);if(0===e)continue;s=2===e}let l=e.terrain?c:u,d=i.aabb.distanceX(l),_=i.aabb.distanceY(l),b=Math.max(Math.abs(d),Math.abs(_));if(i.zoom===y||b>p+(1<<y-i.zoom)-2&&i.zoom>=f){let e=y-i.zoom,r=c[0]-.5-(a<<e),n=c[1]-.5-(o<<e);g.push({tileID:new t.S(i.zoom===y?v:i.zoom,i.wrap,i.zoom,a,o),distanceSq:x([u[0]-.5-a,u[1]-.5-o]),tileDistanceToCamera:Math.sqrt(r*r+n*n)})}else for(let l=0;l<4;l++){let c=(a<<1)+l%2,u=(o<<1)+(l>>1),h=i.zoom+1,f=i.aabb.quadrant(l);if(e.terrain){let a=new t.S(h,i.wrap,h,c,u),o=e.terrain.getMinMaxElevation(a),s=null!==(r=o.minElevation)&&void 0!==r?r:this.elevation,l=null!==(n=o.maxElevation)&&void 0!==n?n:this.elevation;f=new wn([f.min[0],f.min[1],s],[f.max[0],f.max[1],l])}m.push({aabb:f,zoom:h,x:c,y:u,wrap:i.wrap,fullyVisible:s})}}return g.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 Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){let r=t.ac(e.lat,-85.051129,kn);return new t.P(t.O(e.lng)*this.worldSize,t.Q(r)*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 r=this.elevation,n=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=n+r-a,s=Math.cos(this._pitch)*this.cameraToCenterDistance/o/t.b5(1,i.lat),l=this.scaleZoom(s/this.tileSize);this._elevation=a,this._center=i,this.zoom=l}setLocationAtPoint(e,r){let n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.Z(a.x-(n.x-i.x),a.y-(n.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,r){if(r){let t=r.pointCoordinate(e);if(null!=t)return t}let n=[e.x,e.y,0,1],i=[e.x,e.y,1,1];t.af(n,n,this.pixelMatrixInverse),t.af(i,i,this.pixelMatrixInverse);let a=n[3],o=i[3],s=n[1]/a,l=i[1]/o,c=n[2]/a,u=i[2]/o,h=c===u?0:(0-c)/(u-c);return new t.Z(t.y.number(n[0]/a,i[0]/o,h)/this.worldSize,t.y.number(s,l,h)/this.worldSize)}coordinatePoint(e,r=0,n=this.pixelMatrix){let i=[e.x*this.worldSize,e.y*this.worldSize,r,1];return t.af(i,i,n),new t.P(i[0]/i[3],i[1]/i[3])}getBounds(){let e=Math.max(0,this.height/2-this.getHorizon());return(new Z).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&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new Z([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,kn])}calculateTileMatrix(e){let r=e.canonical,n=this.worldSize/this.zoomScale(r.z),i=r.x+Math.pow(2,r.z)*e.wrap,a=t.an(new Float64Array(16));return t.J(a,a,[i*n,r.y*n,0]),t.K(a,a,[n/t.X,n/t.X,1]),a}calculatePosMatrix(e,r=!1){let n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];let a=this.calculateTileMatrix(e);return t.L(a,r?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,a),i[n]=new Float32Array(a),i[n]}calculateFogMatrix(e){let r=e.key,n=this._fogMatrixCache;if(n[r])return n[r];let i=this.calculateTileMatrix(e);return t.L(i,this.fogMatrix,i),n[r]=new Float32Array(i),n[r]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,r){r=t.ac(+r,this.minZoom,this.maxZoom);let n={center:new t.N(e.lng,e.lat),zoom:r},i=this.lngRange;if(!this._renderWorldCopies&&null===i){let e=179.9999999999;i=[-e,e]}let a=this.tileSize*this.zoomScale(n.zoom),o=0,s=a,l=0,c=a,u=0,h=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&&(l=t.b3(t.O(i[0])*a,0,a),c=t.b3(t.O(i[1])*a,0,a),c<l&&(c+=a),c-l<f&&(h=f/(c-l)));let d,m,{x:g,y}=this.project.call({worldSize:a},e),v=Math.max(h||0,u||0);if(v){let e=new t.P(h?(c+l)/2:g,u?(s+o)/2:y);return n.center=this.unproject.call({worldSize:a},e).wrap(),n.zoom+=this.scaleZoom(v),n}if(this.latRange){let e=p/2;y-e<o&&(m=o+e),y+e>s&&(m=s-e)}if(i){let e=(l+c)/2,r=g;this._renderWorldCopies&&(r=t.b3(g,e-a/2,e+a/2));let n=f/2;r-n<l&&(d=l+n),r+n>c&&(d=c-n)}if(void 0!==d||void 0!==m){let e=new t.P(d??g,m??y);n.center=this.unproject.call({worldSize:a},e).wrap()}return n}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let e=this._unmodified,{center:t,zoom:r}=this.getConstrained(this.center,this.zoom);this.center=t,this.zoom=r,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;let e=this.centerOffset,r=this.point.x,n=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),l=o<0?s:a,c=Math.PI/2+this._pitch,u=this._fov*(.5+e.y/this.height),h=Math.sin(u)*l/Math.sin(t.ac(Math.PI-c-u,.01,Math.PI-.01)),f=this.getHorizon(),p=2*Math.atan(f/this.cameraToCenterDistance)*(.5+e.y/(2*f)),d=Math.sin(p)*l/Math.sin(t.ac(Math.PI-c-p,.01,Math.PI-.01)),m=Math.min(h,d);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*m+l),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,[-r,-n,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,[-r,-n,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,y=this.height%2/2,v=Math.cos(this.angle),x=Math.sin(this.angle),_=r-Math.round(r)+v*g+x*y,b=n-Math.round(n)+v*y+x*g,w=new Float64Array(i);if(t.J(w,w,[_>.5?_-1:_,b>.5?b-1:b,0]),this.alignedModelViewProjectionMatrix=w,i=t.as(new Float64Array(16),this.pixelMatrix),!i)throw new 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)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.af(r,r,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 r=this.getCameraPoint();if(1===e.length)return[e[0],r];{let n=r.x,i=r.y,a=r.x,o=r.y;for(let t of e)n=Math.min(n,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y);return[new t.P(n,i),new t.P(a,i),new t.P(a,o),new t.P(n,o),new t.P(n,i)]}}lngLatToCameraDepth(e,r){let n=this.locationCoordinate(e),i=[n.x*this.worldSize,n.y*this.worldSize,r,1];return t.af(i,i,this.modelViewProjectionMatrix),i[2]/i[3]}}function Mn(e,t){let r,n=!1,i=null,a=null,o=()=>{i=null,n&&(e.apply(a,r),i=setTimeout(o,t),n=!1)};return(...e)=>(n=!0,a=this,r=e,i||o(),i)}class Sn{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(0===e.length)return;let t=e.join("/"),r=t;r.split("&").length>0&&(r=r.split("&")[0]),this._hashName&&(r=`${this._hashName}=${t}`);let n=window.location.hash.replace(r,"");n.startsWith("#&")?n=n.slice(0,1)+n.slice(2):"#"===n&&(n="");let i=window.location.href.replace(/(#.+)?$/,n);i=i.replace("&&","&"),window.history.replaceState(window.history.state,null,i)},this._updateHash=Mn(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(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,n),a=Math.round(t.lng*i)/i,o=Math.round(t.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch(),c="";if(c+=e?`/${a}/${o}/${r}`:`${r}/${o}/${a}`,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){let e=this._hashName,t=!1,r=window.location.hash.slice(1).split("&").map((r=>{let n=r.split("=")[0];return n===e?(t=!0,`${n}=${c}`):r})).filter((e=>e));return t||r.push(`${e}=${c}`),`#${r.join("&")}`}return`#${c}`}}let En={linearity:.3,easing:t.b8(0,0,.3,1)},Cn=t.e({deceleration:2500,maxSpeed:1400},En),In=t.e({deceleration:20,maxSpeed:1400},En),Ln=t.e({deceleration:1e3,maxSpeed:360},En),Pn=t.e({deceleration:1e3,maxSpeed:90},En);class zn{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 r={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)r.zoom+=e.zoomDelta||0,r.bearing+=e.bearingDelta||0,r.pitch+=e.pitchDelta||0,e.panDelta&&r.pan._add(e.panDelta),e.around&&(r.around=e.around),e.pinchAround&&(r.pinchAround=e.pinchAround);let n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(r.pan.mag()){let a=On(r.pan.mag(),n,t.e({},Cn,e||{}));i.offset=r.pan.mult(a.amount/r.pan.mag()),i.center=this._map.transform.center,Dn(i,a)}if(r.zoom){let e=On(r.zoom,n,In);i.zoom=this._map.transform.zoom+e.amount,Dn(i,e)}if(r.bearing){let e=On(r.bearing,n,Ln);i.bearing=this._map.transform.bearing+t.ac(e.amount,-179,179),Dn(i,e)}if(r.pitch){let e=On(r.pitch,n,Pn);i.pitch=this._map.transform.pitch+e.amount,Dn(i,e)}if(i.zoom||i.bearing){let e=void 0===r.pinchAround?r.around:r.pinchAround;i.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),t.e(i,{noMoveStart:!0})}}function Dn(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function On(e,r,n){let{maxSpeed:i,linearity:a,deceleration:o}=n,s=t.ac(e*a/(r/1e3),-i,i),l=Math.abs(s)/(o*a);return{easing:n.easing,duration:1e3*l,amount:s*(l/2)}}class Rn extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,n,i={}){let a=o.mousePos(r.getCanvas(),n),s=r.unproject(a);super(e,t.e({point:a,lngLat:s,originalEvent:n},i)),this._defaultPrevented=!1,this.target=r}}class Fn extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,n){let i="touchend"===e?n.changedTouches:n.touches,a=o.touchPos(r.getCanvasContainer(),i),s=a.map((e=>r.unproject(e))),l=a.reduce(((e,t,r,n)=>e.add(t.div(n.length))),new t.P(0,0));super(e,{points:a,point:l,lngLats:s,lngLat:r.unproject(l),originalEvent:n}),this._defaultPrevented=!1}}class Bn extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,r){super(e,{originalEvent:r}),this._defaultPrevented=!1}}class jn{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new Bn(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new Rn(e.type,this._map,e))}mouseup(e){this._map.fire(new Rn(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new Rn(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Rn(e.type,this._map,e))}mouseover(e){this._map.fire(new Rn(e.type,this._map,e))}mouseout(e){this._map.fire(new Rn(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Fn(e.type,this._map,e))}touchmove(e){this._map.fire(new Fn(e.type,this._map,e))}touchend(e){this._map.fire(new Fn(e.type,this._map,e))}touchcancel(e){this._map.fire(new Fn(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Nn{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Rn(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Rn(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Un{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 Vn{constructor(e,t){this._map=e,this._tr=new Un(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&&0===e.button&&(o.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;let r=t;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)return;let n=this._startPos;this._lastPos=r,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(n.x,r.x),a=Math.max(n.x,r.x),s=Math.min(n.y,r.y),l=Math.max(n.y,r.y);o.setTransform(this._box,`translate(${i}px,${s}px)`),this._box.style.width=a-i+"px",this._box.style.height=l-s+"px"}mouseupWindow(e,r){if(!this._active||0!==e.button)return;let n=this._startPos,i=r;if(this.reset(),o.suppressClick(),n.x!==i.x||n.y!==i.y)return this._map.fire(new t.k("boxzoomend",{originalEvent:e})),{cameraAnimation:e=>e.fitScreenCoordinates(n,i,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(o.remove(this._box),this._box=null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,r){return this._map.fire(new t.k(e,{originalEvent:r}))}}function qn(e,t){if(e.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);let r={};for(let n=0;n<e.length;n++)r[e[n].identifier]=t[n];return r}class Hn{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){let r=new t.P(0,0);for(let t of e)r._add(t);return r.div(e.length)}(r),this.touches=qn(n,r)))}touchmove(e,t,r){if(this.aborted||!this.centroid)return;let n=qn(r,t);for(let e in this.touches){let t=n[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){let e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class Gn{constructor(e){this.singleTap=new Hn(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,r){this.singleTap.touchstart(e,t,r)}touchmove(e,t,r){this.singleTap.touchmove(e,t,r)}touchend(e,t,r){let n=this.singleTap.touchend(e,t,r);if(n){let t=e.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(n)<30;if(t&&r||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class Wn{constructor(e){this._tr=new Un(e),this._zoomIn=new Gn({numTouches:1,numTaps:2}),this._zoomOut=new Gn({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)}touchmove(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)}touchend(e,t,r){let n=this._zoomIn.touchend(e,t,r),i=this._zoomOut.touchend(e,t,r),a=this._tr;return n?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(n)},{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 Zn{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 r=this._lastPoint;if(!r)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);let n=t.length?t[0]:t;return!this._moved&&n.dist(r)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=n,this._move(r,n))}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 Yn={0:1,2:2};class Xn{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){let t=o.mouseButton(e);this._eventButton=t}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(e,t){let r=Yn[t];return void 0===e.buttons||(e.buttons&r)!==r}(e,this._eventButton)}isValidEndEvent(e){return o.mouseButton(e)===this._eventButton}}class $n{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return 1===e.targetTouches.length}_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 Kn=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=e=>{e.preventDefault()}},Jn=({enable:e,clickTolerance:t,bearingDegreesPerPixelMoved:r=.8})=>{let n=new Xn({checkCorrectEvent:e=>0===o.mouseButton(e)&&e.ctrlKey||2===o.mouseButton(e)});return new Zn({clickTolerance:t,move:(e,t)=>({bearingDelta:(t.x-e.x)*r}),moveStateManager:n,enable:e,assignEvents:Kn})},Qn=({enable:e,clickTolerance:t,pitchDegreesPerPixelMoved:r=-.5})=>{let n=new Xn({checkCorrectEvent:e=>0===o.mouseButton(e)&&e.ctrlKey||2===o.mouseButton(e)});return new Zn({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*r}),moveStateManager:n,enable:e,assignEvents:Kn})};class ei{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,r){return this._calculateTransform(e,t,r)}touchmove(e,t,r){if(this._active){if(!this._shouldBePrevented(r.length))return e.preventDefault(),this._calculateTransform(e,t,r);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,t,r){this._calculateTransform(e,t,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,r,n){n.length>0&&(this._active=!0);let i=qn(n,r),a=new t.P(0,0),o=new t.P(0,0),s=0;for(let e in i){let t=i[e],r=this._touches[e];r&&(a._add(t),o._add(t.sub(r)),s++,i[e]=t)}if(this._touches=i,this._shouldBePrevented(s)||!o.mag())return;let l=o.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ti{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,r){if(!this._firstTwoTouches)return;e.preventDefault();let[n,i]=this._firstTwoTouches,a=ri(r,t,n),o=ri(r,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,r){if(!this._firstTwoTouches)return;let[n,i]=this._firstTwoTouches,a=ri(r,t,n),s=ri(r,t,i);a&&s||(this._active&&o.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function ri(e,t,r){for(let n=0;n<e.length;n++)if(e[n].identifier===r)return t[n]}function ni(e,t){return Math.log(e/t)/Math.LN2}class ii extends ti{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){let r=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(ni(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ni(this._distance,r),pinchAround:t}}}function ai(e,t){return 180*e.angleWith(t)/Math.PI}class oi extends ti{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,r){let n=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ai(this._vector,n),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let t=25/(Math.PI*this._minDiameter)*360,r=ai(e,this._startVector);return Math.abs(r)<t}}function si(e){return Math.abs(e.y)>Math.abs(e.x)}class li extends ti{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,r){super.touchstart(e,t,r),this._currentTouchCount=r.length}_start(e){this._lastPoints=e,si(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let n=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}):void 0}gestureBeginsVertically(e,t,r){if(void 0!==this._valid)return this._valid;let n=e.mag()>=2,i=t.mag()>=2;if(!n&&!i)return;if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;let a=e.y>0==t.y>0;return si(e)&&si(t)&&a}}let ci={panStep:100,bearingStep:15,pitchStep:10};class ui{constructor(e){this._tr=new Un(e);let t=ci;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,r=0,n=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?r=-1:(e.preventDefault(),i=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),i=1);break;case 38:e.shiftKey?n=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?n=-1:(e.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:o=>{let s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:hi,zoom:t?Math.round(s.zoom)+t*(e.shiftKey?2:1):s.zoom,bearing:s.bearing+r*this._bearingStep,pitch:s.pitch+n*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 hi(e){return e*(2-e)}let fi=4.000244140625;class pi{constructor(e,t){this._onTimeout=e=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},this._map=e,this._tr=new Un(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||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around)}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,r=a.now(),n=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==t&&t%fi==0?this._type="wheel":0!==t&&Math.abs(t)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(n*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&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let r=o.mousePos(this._map.getCanvas(),e),n=this._tr;this._around=r.y>n.transform.height/2-n.transform.getHorizon()?t.N.convert(this._aroundCenter?n.center:n.unproject(r)):t.N.convert(n.center),this._aroundPoint=n.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(0!==this._delta){let t="wheel"===this._type&&Math.abs(this._delta)>fi?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&0!==r&&(r=1/r);let n="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(n*r))),"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let r,n="number"==typeof this._targetZoom?this._targetZoom:e.zoom,i=this._startZoom,o=this._easing,s=!1,l=a.now()-this._lastWheelEventTime;if("wheel"===this._type&&i&&o&&l){let e=Math.min(l/200,1),a=o(e);r=t.y.number(i,n,a),e<1?this._frameId||(this._frameId=!0):s=!0}else r=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:r-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let r=t.b9;if(this._prevEase){let e=this._prevEase,n=(a.now()-e.start)/e.duration,i=e.easing(n+.01)-e.easing(n),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.b8(o,s,.25,1)}return this._prevEase={start:a.now(),duration:e,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class di{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 mi{constructor(e){this._tr=new Un(e),this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:r=>{r.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 gi{constructor(){this._tap=new Gn({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,r){if(!this._swipePoint)if(this._tapTime){let n=t[0],i=e.timeStamp-this._tapTime<500,a=this._tapPoint.dist(n)<30;i&&a?r.length>0&&(this._swipePoint=n,this._swipeTouch=r[0].identifier):this.reset()}else this._tap.touchstart(e,t,r)}touchmove(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;let n=t[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,r)}touchend(e,t,r){if(this._tapTime)this._swipePoint&&0===r.length&&this.reset();else{let n=this._tap.touchend(e,t,r);n&&(this._tapTime=e.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class yi{constructor(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r}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 vi{constructor(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r}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 xi{constructor(e,t,r,n){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=n,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 _i{constructor(e,t){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",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");"metaKey"===this._bypassKey&&(t=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=t,this._container.appendChild(n);let i=document.createElement("div");i.className="maplibregl-mobile-message",i.textContent=r,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,r){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:e,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}let bi=e=>e.zoom||e.drag||e.pitch||e.rotate;class wi extends t.k{}function Ti(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class ki{constructor(e,t){this.handleWindowEvent=e=>{this.handleEvent(e,`${e.type}Window`)},this.handleEvent=(e,t)=>{if("blur"===e.type)return void this.stop(!0);this._updatingCamera=!0;let r="renderFrame"===e.type?void 0:e,n={needsRenderFrame:!1},i={},a={},s=e.touches,l=s?this._getMapTouches(s):void 0,c=l?o.touchPos(this._map.getCanvas(),l):o.mousePos(this._map.getCanvas(),e);for(let{handlerName:o,handler:s,allowed:u}of this._handlers){if(!s.isEnabled())continue;let h;this._blockedByActive(a,u,o)?s.reset():s[t||e.type]&&(h=s[t||e.type](e,c,l),this.mergeHandlerResult(n,i,h,o,r),h&&h.needsRenderFrame&&this._triggerRenderFrame()),(h||s.isActive())&&(a[o]=s)}let u={};for(let e in this._previousActiveHandlers)a[e]||(u[e]=r);this._previousActiveHandlers=a,(Object.keys(u).length||Ti(n))&&(this._changes.push([n,i,u]),this._triggerRenderFrame()),(Object.keys(a).length||Ti(n))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:h}=n;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new zn(e),this._bearingSnap=t.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(t);let r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[window,"blur",void 0]];for(let[e,t,r]of this._listeners)o.addEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,r)}destroy(){for(let[e,t,r]of this._listeners)o.removeEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(e){let t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new jn(t,e));let n=t.boxZoom=new Vn(t,e);this._add("boxZoom",n),e.interactive&&e.boxZoom&&n.enable();let i=t.cooperativeGestures=new _i(t,e.cooperativeGestures);this._add("cooperativeGestures",i),e.cooperativeGestures&&i.enable();let a=new Wn(t),s=new mi(t);t.doubleClickZoom=new di(s,a),this._add("tapZoom",a),this._add("clickZoom",s),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();let l=new gi;this._add("tapDragZoom",l);let c=t.touchPitch=new li(t);this._add("touchPitch",c),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);let u=Jn(e),h=Qn(e);t.dragRotate=new vi(e,u,h),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",h,["mouseRotate"]),e.interactive&&e.dragRotate&&t.dragRotate.enable();let f=(({enable:e,clickTolerance:t})=>{let r=new Xn({checkCorrectEvent:e=>0===o.mouseButton(e)&&!e.ctrlKey});return new Zn({clickTolerance:t,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:r,enable:e,assignEvents:Kn})})(e),p=new ei(e,t);t.dragPan=new yi(r,f,p),this._add("mousePan",f),this._add("touchPan",p,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);let d=new oi,m=new ii;t.touchZoomRotate=new xi(r,m,d,l),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",m,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate);let g=t.scrollZoom=new pi(t,(()=>this._triggerRenderFrame()));this._add("scrollZoom",g,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);let y=t.keyboard=new ui(t);this._add("keyboard",y),e.interactive&&e.keyboard&&t.keyboard.enable(),this._add("blockableMapEvent",new Nn(t))}_add(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),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!!bi(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,r){for(let n in e)if(n!==r&&(!t||t.indexOf(n)<0))return!0;return!1}_getMapTouches(e){let t=[];for(let r of e)this._el.contains(r.target)&&t.push(r);return t}mergeHandlerResult(e,r,n,i,a){if(!n)return;t.e(e,n);let o={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}_applyChanges(){let e={},r={},n={};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),void 0!==i.around&&(e.around=i.around),void 0!==i.pinchAround&&(e.pinchAround=i.pinchAround),i.noInertia&&(e.noInertia=i.noInertia),t.e(r,a),t.e(n,o);this._updateMapTransform(e,r,n),this._changes=[]}_updateMapTransform(e,t,r){let n=this._map,i=n._getTransformForUpdate(),a=n.terrain;if(!(Ti(e)||a&&this._terrainMovement))return this._fireEvents(t,r,!0);let{panDelta:o,zoomDelta:s,bearingDelta:l,pitchDelta:c,around:u,pinchAround:h}=e;void 0!==h&&(u=h),n._stop(!0),u=u||n.transform.centerPoint;let f=i.pointLocation(o?u.sub(o):u);l&&(i.bearing+=l),c&&(i.pitch+=c),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),n._applyUpdatedTransform(i),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,r,!0)}_fireEvents(e,r,n){let i=bi(this._eventsInProgress),o=bi(e),s={};for(let t in e){let{originalEvent:r}=e[t];this._eventsInProgress[t]||(s[`${t}start`]=r),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:r}=e[t];this._fireEvent(t,r)}let l,c={};for(let e in this._eventsInProgress){let{handlerName:t,originalEvent:n}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=r[t]||n,c[`${e}end`]=l)}for(let e in c)this._fireEvent(e,c[e]);let u=bi(this._eventsInProgress),h=(i||o)&&!u;if(h&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let e=this._map._getTransformForUpdate();e.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(e)}if(n&&h){this._updatingCamera=!0;let e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;!e||!e.essential&&a.prefersReducedMotion?(this._map.fire(new t.k("moveend",{originalEvent:l})),r(this._map.getBearing())&&this._map.resetNorth()):(r(e.bearing||this._map.getBearing())&&(e.bearing=0),e.freezeElevation=!0,this._map.easeTo(e,{originalEvent:l})),this._updatingCamera=!1}}_fireEvent(e,r){this._map.fire(new t.k(e,r?{originalEvent:r}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{delete this._frameId,this.handleEvent(new wi("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class Ai 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,r,n){return e=t.P.convert(e).mult(-1),this.panTo(this.transform.center,t.e({offset:e},r),n)}panTo(e,r,n){return this.easeTo(t.e({center:e},r),n)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,r,n){return this.easeTo(t.e({zoom:e},r),n)}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,r,n){return this.easeTo(t.e({bearing:e},r),n)}resetNorth(e,r){return this.rotateTo(0,t.e({duration:1e3},e),r),this}resetNorthPitch(e,r){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},e),r),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=Z.convert(e).adjustAntiMeridian();let r=t&&t.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),r,t)}_cameraForBoxAndBearing(e,r,n,i){let a={top:0,bottom:0,right:0,left:0};if("number"==typeof(i=t.e({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){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,l=new Z(e,r),c=o.project(l.getNorthWest()),u=o.project(l.getNorthEast()),h=o.project(l.getSouthEast()),f=o.project(l.getSouthWest()),p=t.ba(-n),d=c.rotate(p),m=u.rotate(p),g=h.rotate(p),y=f.rotate(p),v=new t.P(Math.max(d.x,m.x,y.x,g.x),Math.max(d.y,m.y,y.y,g.y)),x=new t.P(Math.min(d.x,m.x,y.x,g.x),Math.min(d.y,m.y,y.y,g.y)),_=v.sub(x),b=(o.width-(s.left+s.right+i.padding.left+i.padding.right))/_.x,w=(o.height-(s.top+s.bottom+i.padding.top+i.padding.bottom))/_.y;if(w<0||b<0)return void t.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let T=Math.min(o.scaleZoom(o.scale*Math.min(b,w)),i.maxZoom),k=t.P.convert(i.offset),A=new t.P((i.padding.left-i.padding.right)/2,(i.padding.top-i.padding.bottom)/2).rotate(t.ba(n)),M=k.add(A).mult(o.scale/o.zoomScale(T));return{center:o.unproject(c.add(h).div(2).sub(M)),zoom:T,bearing:n}}fitBounds(e,t,r){return this._fitInternal(this.cameraForBounds(e,t),t,r)}fitScreenCoordinates(e,r,n,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.P.convert(e)),this.transform.pointLocation(t.P.convert(r)),n,i),i,a)}_fitInternal(e,r,n){return e?(delete(r=t.e(e,r)).padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this}jumpTo(e,r){this.stop();let n=this._getTransformForUpdate(),i=!1,a=!1,o=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(i=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.N.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(a=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(o=!0,n.pitch=+e.pitch),null==e.padding||n.isPaddingEqual(e.padding)||(n.padding=e.padding),this._applyUpdatedTransform(n),this.fire(new t.k("movestart",r)).fire(new t.k("move",r)),i&&this.fire(new t.k("zoomstart",r)).fire(new t.k("zoom",r)).fire(new t.k("zoomend",r)),a&&this.fire(new t.k("rotatestart",r)).fire(new t.k("rotate",r)).fire(new t.k("rotateend",r)),o&&this.fire(new t.k("pitchstart",r)).fire(new t.k("pitch",r)).fire(new t.k("pitchend",r)),this.fire(new t.k("moveend",r))}calculateCameraOptionsFromTo(e,r,n,i=0){let a=t.Z.fromLngLat(e,r),o=t.Z.fromLngLat(n,i),s=o.x-a.x,l=o.y-a.y,c=o.z-a.z,u=Math.hypot(s,l,c);if(0===u)throw new Error("Can't calculate camera options with same From and To");let h=Math.hypot(s,l),f=this.transform.scaleZoom(this.transform.cameraToCenterDistance/u/this.transform.tileSize),p=180*Math.atan2(s,-l)/Math.PI,d=180*Math.acos(h/u)/Math.PI;return d=c<0?90-d:90+d,{center:o.toLngLat(),zoom:f,pitch:d,bearing:p}}easeTo(e,r){var n;this._stop(!1,e.easeId),(!1===(e=t.e({offset:[0,0],duration:500,easing:t.b9},e)).animate||!e.essential&&a.prefersReducedMotion)&&(e.duration=0);let i=this._getTransformForUpdate(),o=i.zoom,s=i.bearing,l=i.pitch,c=i.padding,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,f="padding"in e?e.padding:i.padding,p=t.P.convert(e.offset),d=i.centerPoint.add(p),m=i.pointLocation(d),{center:g,zoom:y}=i.getConstrained(t.N.convert(e.center||m),null!==(n=e.zoom)&&void 0!==n?n:o);this._normalizeCenter(g,i);let v,x,_=i.project(m),b=i.project(g).sub(_),w=i.zoomScale(y-o);e.around&&(v=t.N.convert(e.around),x=i.locationPoint(v));let T={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||y!==o,this._rotating=this._rotating||s!==u,this._pitching=this._pitching||h!==l,this._padding=!i.isPaddingEqual(f),this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,T),this.terrain&&this._prepareElevation(g),this._ease((n=>{if(this._zooming&&(i.zoom=t.y.number(o,y,n)),this._rotating&&(i.bearing=t.y.number(s,u,n)),this._pitching&&(i.pitch=t.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,f,n),d=i.centerPoint.add(p)),this.terrain&&!e.freezeElevation&&this._updateElevation(n),v)i.setLocationAtPoint(v,x);else{let e=i.zoomScale(i.zoom-o),t=y>o?Math.min(2,w):Math.max(.5,w),r=Math.pow(t,1-n),a=i.unproject(_.add(b.mult(n*r)).mult(e));i.setLocationAtPoint(i.renderWorldCopies?a.wrap():a,d)}this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(t=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r,t)}),e),this}_prepareEase(e,r,n={}){this._moving=!0,r||n.moving||this.fire(new t.k("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.k("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.k("rotatestart",e)),this._pitching&&!n.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 r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&r!==this._elevationTarget){let t=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(t-(r-(t*e+this._elevationStart))/(1-e)),this._elevationTarget=r}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._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){let t=e.getCameraPosition(),r=this.terrain.getElevationForLngLatZoom(t.lngLat,e.zoom);if(t.altitude<r){let n=this.calculateCameraOptionsFromTo(t.lngLat,r,e.center,e.elevation);return{pitch:n.pitch,zoom:n.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 r=e.clone();for(let e of t){let t=r.clone(),{center:n,zoom:i,pitch:a,bearing:o,elevation:s}=e(t);n&&(t.center=n),void 0!==i&&(t.zoom=i),void 0!==a&&(t.pitch=a),void 0!==o&&(t.bearing=o),void 0!==s&&(t.elevation=s),r.apply(t)}this.transform.apply(r)}_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,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;let n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&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,r){var n;if(!e.essential&&a.prefersReducedMotion){let n=t.M(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),e=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},e);let i=this._getTransformForUpdate(),o=i.zoom,s=i.bearing,l=i.pitch,c=i.padding,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,f="padding"in e?e.padding:i.padding,p=t.P.convert(e.offset),d=i.centerPoint.add(p),m=i.pointLocation(d),{center:g,zoom:y}=i.getConstrained(t.N.convert(e.center||m),null!==(n=e.zoom)&&void 0!==n?n:o);this._normalizeCenter(g,i);let v=i.zoomScale(y-o),x=i.project(m),_=i.project(g).sub(x),b=e.curve,w=Math.max(i.width,i.height),T=w/v,k=_.mag();if("minZoom"in e){let r=t.ac(Math.min(e.minZoom,o,y),i.minZoom,i.maxZoom),n=w/i.zoomScale(r-o);b=Math.sqrt(n/k*2)}let A=b*b;function M(e){let t=(T*T-w*w+(e?-1:1)*A*A*k*k)/(2*(e?T:w)*A*k);return Math.log(Math.sqrt(t*t+1)-t)}function S(e){return(Math.exp(e)-Math.exp(-e))/2}function E(e){return(Math.exp(e)+Math.exp(-e))/2}let C=M(!1),I=function(e){return E(C)/E(C+b*e)},L=function(e){return w*((E(C)*(S(t=C+b*e)/E(t))-S(C))/A)/k;var t},P=(M(!0)-C)/b;if(Math.abs(k)<1e-6||!isFinite(P)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);let t=T<w?-1:1;P=Math.abs(Math.log(T/w))/b,L=()=>0,I=e=>Math.exp(t*b*e)}return e.duration="duration"in e?+e.duration:1e3*P/("screenSpeed"in e?+e.screenSpeed/b:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=h!==l,this._padding=!i.isPaddingEqual(f),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(g),this._ease((n=>{let a=n*P,m=1/I(a);i.zoom=1===n?y:o+i.scaleZoom(m),this._rotating&&(i.bearing=t.y.number(s,u,n)),this._pitching&&(i.pitch=t.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,f,n),d=i.centerPoint.add(p)),this.terrain&&!e.freezeElevation&&this._updateElevation(n);let v=1===n?g:i.unproject(x.add(_.mult(L(a))).mult(m));i.setLocationAtPoint(i.renderWorldCopies?v.wrap():v,d),this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r)}),e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){var r;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||null===(r=this.handlers)||void 0===r||r.stop(!1),this}_ease(e,t,r){!1===r.animate||0===r.duration?(e(1),t()):(this._easeStart=a.now(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,r){e=t.b3(e,-180,180);let n=Math.abs(e-r);return Math.abs(e-360-r)<n&&(e-=360),Math.abs(e+360-r)<n&&(e+=360),e}_normalizeCenter(e,t){if(!t.renderWorldCopies||t.lngRange)return;let r=e.lng-t.center.lng;e.lng+=r>180?-360:r<-180?360:0}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}let Mi={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Si{constructor(e=Mi){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||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType&&"style"!==e.dataType&&"terrain"!==e.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},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 r=this._map._getUIString(`AttributionControl.${t}`);e.title=r,e.setAttribute("aria-label",r)}_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=>"string"!=typeof e?"":e))):"string"==typeof this.options.customAttribution&&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 r in t){let n=t[r];if(n.used||n.usedForTerrain){let t=n.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,r)=>{for(let n=r+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0}));let r=e.join(" | ");r!==this._attribHTML&&(this._attribHTML=r,e.length?(this._innerContainer.innerHTML=r,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ei{constructor(e={}){this._updateCompact=()=>{let e=this._container.children;if(e.length){let t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&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 Ci{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,r=t?this._queue.concat(t):this._queue;for(let t of r)if(t.id===e)return void(t.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let t=this._currentlyRunning=this._queue;this._queue=[];for(let r of t)if(!r.cancelled&&(r.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ii=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Li 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,r){this.sourceCache.update(e,r),this._renderableTilesKeys=[];let n={};for(let i of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r}))n[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 ce(i,this.tileSize));for(let e in this._tiles)n[e]||delete this._tiles[e]}freeRtt(e){for(let t in this._tiles){let r=this._tiles[t];(!e||r.tileID.equals(e)||r.tileID.isChildOf(e)||e.isChildOf(r.tileID))&&(r.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((e=>this.getTileByID(e)))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){let r={};for(let n of this._renderableTilesKeys){let i=this._tiles[n].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),r[n]=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),l=i.canonical.y-(i.canonical.y>>o<<o),c=t.X>>o;t.aP(a.posMatrix,0,c,0,c,0,1),t.J(a.posMatrix,a.posMatrix,[-s*c,-l*c,0]),r[n]=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),l=e.canonical.y-(e.canonical.y>>o<<o),c=t.X>>o;t.aP(a.posMatrix,0,t.X,0,t.X,0,1),t.J(a.posMatrix,a.posMatrix,[s*c,l*c,0]),t.K(a.posMatrix,a.posMatrix,[1/2**o,1/2**o,0]),r[n]=a}}return r}getSourceTile(e,t){let r=this.sourceCache._source,n=e.overscaledZ-this.deltaZoom;if(n>r.maxzoom&&(n=r.maxzoom),n<r.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(n).key);let i=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!i||!i.dem)&&t)for(;n>=r.minzoom&&(!i||!i.dem);)i=this.sourceCache.getTileByID(e.scaledTo(n--).key);return i}tilesAfterTime(e=Date.now()){return Object.values(this._tiles).filter((t=>t.timeAdded>=e))}}class Pi{constructor(e,t,r){this.painter=e,this.sourceCache=new Li(t),this.options=r,this.exaggeration="number"==typeof r.exaggeration?r.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,r,n,i=t.X){var a;if(!(r>=0&&r<i&&n>=0&&n<i))return 0;let o=this.getTerrainData(e),s=null===(a=o.tile)||void 0===a?void 0:a.dem;if(!s)return 0;let l=(d=[],m=[r/i*t.X,n/i*t.X],g=o.u_terrain_matrix,y=m[0],v=m[1],d[0]=g[0]*y+g[4]*v+g[12],d[1]=g[1]*y+g[5]*v+g[13],d),c=[l[0]*s.dim,l[1]*s.dim],u=Math.floor(c[0]),h=Math.floor(c[1]),f=c[0]-u,p=c[1]-h;var d,m,g,y,v;return s.get(u,h)*(1-f)*(1-p)+s.get(u+1,h)*f*(1-p)+s.get(u,h+1)*(1-f)*p+s.get(u+1,h+1)*f*p}getElevationForLngLatZoom(e,r){if(!t.bb(r,e.wrap()))return 0;let{tileID:n,mercatorX:i,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(e,r);return this.getElevation(n,i%t.X,a%t.X,t.X)}getElevation(e,r,n,i=t.X){return this.getDEMElevation(e,r,n,i)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){let e=this.painter.context,r=new t.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new w(e,r,e.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new w(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 r=this.sourceCache.getSourceTile(e,!0);if(r&&r.dem&&(!r.demTexture||r.needsTerrainPrepare)){let e=this.painter.context;r.demTexture=this.painter.getTileTexture(r.dem.stride),r.demTexture?r.demTexture.update(r.dem.getPixels(),{premultiply:!1}):r.demTexture=new w(e,r.dem.getPixels(),e.gl.RGBA,{premultiply:!1}),r.demTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),r.needsTerrainPrepare=!1}let n=r&&r+r.tileID.key+e.key;if(n&&!this._demMatrixCache[n]){let n=this.sourceCache.sourceCache._source.maxzoom,i=e.canonical.z-r.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=n?i=e.canonical.z-n: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:r&&r.dem&&r.dem.dim||1,u_terrain_matrix:n?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:r&&r.dem&&r.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(r&&r.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:r}}getFramebuffer(e){let t=this.painter,r=t.width/devicePixelRatio,n=t.height/devicePixelRatio;return!this._fbo||this._fbo.width===r&&this._fbo.height===n||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new w(t.context,{width:r,height:n,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 w(t.context,{width:r,height:n,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(r,n,!0,!1),this._fbo.depthAttachment.set(t.context.createRenderbuffer(t.context.gl.DEPTH_COMPONENT16,r,n))),this._fbo.colorAttachment.set("coords"===e?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let r=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let e=0,t=0;e<this._coordsTextureSize;e++)for(let n=0;n<this._coordsTextureSize;n++,t+=4)r[t+0]=255&n,r[t+1]=255&e,r[t+2]=n>>8<<4|e>>8,r[t+3]=0;let n=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),i=new w(e,n,e.gl.RGBA,{premultiply:!1});return i.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=i,i}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);let r=new Uint8Array(4),n=this.painter.context,i=n.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);n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),i.readPixels(a,s-o-1,1,1,i.RGBA,i.UNSIGNED_BYTE,r),n.bindFramebuffer.set(null);let l=r[0]+(r[2]>>4<<8),c=r[1]+((15&r[2])<<8),u=this.coordsIndex[255-r[3]],h=u&&this.sourceCache.getTileByID(u);if(!h)return null;let f=this._coordsTextureSize,p=(1<<h.tileID.canonical.z)*f;return new t.Z((h.tileID.canonical.x*f+l)/p+h.tileID.wrap,(h.tileID.canonical.y*f+c)/p,this.getElevation(h.tileID,l,c,f))}depthAtPoint(e){let t=new Uint8Array(4),r=this.painter.context,n=r.gl;return r.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),n.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,n.RGBA,n.UNSIGNED_BYTE,t),r.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,r=new t.bd,n=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++)r.emplaceBack(t*a,e*a,0);for(let e=0;e<o;e+=i+1)for(let t=0;t<i;t++)n.emplaceBack(t+e,i+t+e+1,i+t+e+2),n.emplaceBack(t+e,i+t+e+2,t+e+1);let s=r.length,l=s+2*(i+1);for(let e of[0,1])for(let n=0;n<=i;n++)for(let i of[0,1])r.emplaceBack(n*a,e*t.X,i);for(let e=0;e<2*i;e+=2)n.emplaceBack(l+e,l+e+1,l+e+3),n.emplaceBack(l+e,l+e+3,l+e+2),n.emplaceBack(s+e,s+e+3,s+e+1),n.emplaceBack(s+e,s+e+2,s+e+3);let c=r.length,u=c+2*(i+1);for(let e of[0,1])for(let n=0;n<=i;n++)for(let i of[0,1])r.emplaceBack(e*t.X,n*a,i);for(let e=0;e<2*i;e+=2)n.emplaceBack(c+e,c+e+1,c+e+3),n.emplaceBack(c+e,c+e+3,c+e+2),n.emplaceBack(u+e,u+e+3,u+e+1),n.emplaceBack(u+e,u+e+2,u+e+3);return this._mesh=new xn(e.createVertexBuffer(r,Ii.members),e.createIndexBuffer(n),t.a0.simpleSegment(0,0,r.length,n.length)),this._mesh}getMeshFrameDelta(e){return 2*Math.PI*t.be/Math.pow(2,e)/5}getMinTileElevationForLngLatZoom(e,t){var r;let{tileID:n}=this._getOverscaledTileIDFromLngLatZoom(e,t);return null!==(r=this.getMinMaxElevation(n).minElevation)&&void 0!==r?r:0}getMinMaxElevation(e){let t=this.getTerrainData(e).tile,r={minElevation:null,maxElevation:null};return t&&t.dem&&(r.minElevation=t.dem.min*this.exaggeration,r.maxElevation=t.dem.max*this.exaggeration),r}_getOverscaledTileIDFromLngLatZoom(e,r){let n=t.Z.fromLngLat(e.wrap()),i=(1<<r)*t.X,a=n.x*i,o=n.y*i,s=Math.floor(a/t.X),l=Math.floor(o/t.X);return{tileID:new t.S(r,0,r,s,l),mercatorX:a,mercatorY:o}}}class zi{constructor(e,t,r){this._context=e,this._size=t,this._tileSize=r,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),r=new w(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return r.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(r.texture),{id:e,fbo:t,texture:r,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 new 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)&&!1===this._objects.some((e=>!e.inUse))}}let Di={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Oi{constructor(e,t){this.painter=e,this.terrain=t,this.pool=new zi(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((r=>!e._layers[r].isHidden(t))),this._coordsDescendingInv={};for(let t in e.sourceCaches){this._coordsDescendingInv[t]={};let r=e.sourceCaches[t].getVisibleCoordinates();for(let e of r){let r=this.terrain.sourceCache.getTerrainCoords(e);for(let e in r)this._coordsDescendingInv[t][e]||(this._coordsDescendingInv[t][e]=[]),this._coordsDescendingInv[t][e].push(r[e])}}this._coordsDescendingInvStr={};for(let t of e._order){let r=e._layers[t],n=r.source;if(Di[r.type]&&!this._coordsDescendingInvStr[n]){this._coordsDescendingInvStr[n]={};for(let e in this._coordsDescendingInv[n])this._coordsDescendingInvStr[n][e]=this._coordsDescendingInv[n][e].map((e=>e.key)).sort().join()}}for(let e of this._renderableTiles)for(let t in this._coordsDescendingInvStr){let r=this._coordsDescendingInvStr[t][e.tileID.key];r&&r!==e.rttCoords[t]&&(e.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;let r=e.type,n=this.painter,i=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(Di[r]&&(this._prevType&&Di[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(e.id),!i))return!0;if(Di[this._prevType]||Di[r]&&i){this._prevType=r;let e=this._stacks.length-1,i=this._stacks[e]||[];for(let r of this._renderableTiles){if(this.pool.isFull()&&(vn(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(r),r.rtt[e]){let t=this.pool.getObjectForId(r.rtt[e].id);if(t.stamp===r.rtt[e].stamp){this.pool.useObject(t);continue}}let a=this.pool.getOrCreateFreeObject();this.pool.useObject(a),this.pool.stampObject(a),r.rtt[e]={id:a.id,stamp:a.stamp},n.context.bindFramebuffer.set(a.fbo.framebuffer),n.context.clear({color:t.aM.transparent,stencil:0}),n.currentStencilSource=void 0;for(let e=0;e<i.length;e++){let t=n.style._layers[i[e]],o=t.source?this._coordsDescendingInv[t.source][r.tileID.key]:[r.tileID];n.context.viewport.set([0,0,a.fbo.width,a.fbo.height]),n._renderTileClippingMasks(t,o),n.renderLayer(n,n.style.sourceCaches[t.source],t,o),t.source&&(r.rttCoords[t.source]=this._coordsDescendingInvStr[t.source][r.tileID.key])}}return vn(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),Di[r]}return!1}}let Ri,Fi={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"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"},Bi=r,ji={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Mi,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},Ni=e=>{e.touchstart=e.dragStart,e.touchmoveWindow=e.dragMove,e.touchend=e.dragEnd},Ui={showCompass:!0,showZoom:!0,visualizePitch:!1};class Vi{constructor(e,r,n=!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=>{1!==e.targetTouches.length?this.reset():(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.touchmove=e=>{1!==e.targetTouches.length?this.reset():(this._lastPos=o.touchPos(this.element,e.targetTouches)[0],this.moveTouch(e,this._lastPos))},this.touchend=e=>{0===e.targetTouches.length&&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=r,this.mouseRotate=Jn({clickTolerance:i,enable:!0}),this.touchRotate=(({enable:e,clickTolerance:t,bearingDegreesPerPixelMoved:r=.8})=>{let n=new $n;return new Zn({clickTolerance:t,move:(e,t)=>({bearingDelta:(t.x-e.x)*r}),moveStateManager:n,enable:e,assignEvents:Ni})})({clickTolerance:i,enable:!0}),this.map=e,n&&(this.mousePitch=Qn({clickTolerance:a,enable:!0}),this.touchPitch=(({enable:e,clickTolerance:t,pitchDegreesPerPixelMoved:r=-.5})=>{let n=new $n;return new Zn({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*r}),moveStateManager:n,enable:e,assignEvents:Ni})})({clickTolerance:a,enable:!0})),o.addEventListener(r,"mousedown",this.mousedown),o.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(r,"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 r=this.map,{bearingDelta:n}=this.mouseRotate.dragMove(e,t)||{};if(n&&r.setBearing(r.getBearing()+n),this.mousePitch){let{pitchDelta:n}=this.mousePitch.dragMove(e,t)||{};n&&r.setPitch(r.getPitch()+n)}}moveTouch(e,t){let r=this.map,{bearingDelta:n}=this.touchRotate.dragMove(e,t)||{};if(n&&r.setBearing(r.getBearing()+n),this.touchPitch){let{pitchDelta:n}=this.touchPitch.dragMove(e,t)||{};n&&r.setPitch(r.getPitch()+n)}}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)}}function qi(e,r,n){let i=new t.N(e.lng,e.lat);if(e=new t.N(e.lng,e.lat),r){let i=new t.N(e.lng-360,e.lat),a=new t.N(e.lng+360,e.lat),o=n.locationPoint(e).distSqr(r);n.locationPoint(i).distSqr(r)<o?e=i:n.locationPoint(a).distSqr(r)<o&&(e=a)}for(;Math.abs(e.lng-n.center.lng)>180;){let t=n.locationPoint(e);if(t.x>=0&&t.y>=0&&t.x<=n.width&&t.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e.lng!==i.lng&&n.locationPoint(e).y>n.height/2-n.getHorizon()?e:i}let Hi={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 Gi(e,t,r){let n=e.classList;for(let e in Hi)n.remove(`maplibregl-${r}-anchor-${e}`);n.add(`maplibregl-${r}-anchor-${t}`)}class Wi extends t.E{constructor(e){if(super(),this._onKeyPress=e=>{let t=e.code,r=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==r&&13!==r||this.togglePopup()},this._onMapClick=e=>{let t=e.originalEvent.target,r=this._element;this._popup&&(t===r||r.contains(t))&&this.togglePopup()},this._update=e=>{var t;if(!this._map)return;let r=this._map.loaded()&&!this._map.isMoving();("terrain"===e?.type||"render"===e?.type&&!r)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?qi(this._lngLat,this._flatPos,this._map.transform):null===(t=this._lngLat)||void 0===t?void 0:t.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let n="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?n=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||e&&"moveend"!==e.type||(this._pos=this._pos.round()),o.setTransform(this._element,`${Hi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${n}`),a.frameAsync(new AbortController).then((()=>{this._updateOpacity(e&&"moveend"===e.type)})).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","pending"===this._state&&(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),"active"===this._state&&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&&"auto"!==e.pitchAlignment?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 r=o.createNS("http://www.w3.org/2000/svg","svg"),n=41,i=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${n}px`),r.setAttributeNS(null,"width",`${i}px`),r.setAttributeNS(null,"viewBox",`0 0 ${i} ${n}`);let a=o.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");let s=o.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");let l=o.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");let c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let e of c){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),l.appendChild(t)}let u=o.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill",this._color);let h=o.createNS("http://www.w3.org/2000/svg","path");h.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"),u.appendChild(h);let f=o.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"opacity","0.25"),f.setAttributeNS(null,"fill","#000000");let p=o.createNS("http://www.w3.org/2000/svg","path");p.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"),f.appendChild(p);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 m=o.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");let g=o.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");let y=o.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#FFFFFF"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.setAttributeNS(null,"r","5.4999962"),m.appendChild(g),m.appendChild(y),s.appendChild(l),s.appendChild(u),s.appendChild(f),s.appendChild(d),s.appendChild(m),r.appendChild(s),r.setAttributeNS(null,"height",n*this._scale+"px"),r.setAttributeNS(null,"width",i*this._scale+"px"),this._element.appendChild(r),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()})),Gi(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=Math.abs(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,-24.6],right:[-13.5,-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?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var r,n;if(null===(r=this._map)||void 0===r||!r.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,l=Math.sin(i.getPitch()*Math.PI/180)*s,c=i.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),u=i.transform.lngLatToCameraDepth(this._lngLat,o+l)-c>.006;!(null===(n=this._popup)||void 0===n)&&n.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&&"auto"!==e?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return void 0===e&&void 0===t&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==e&&(this._opacity=e),void 0!==t&&(this._opacityWhenCovered=t),this._map&&this._updateOpacity(!0),this}}let Zi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Yi=0,Xi=!1,$i={maxWidth:100,unit:"metric"};function Ki(e,t,r){let n=r&&r.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),o=e.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){let r=3.2808*s;r>5280?Ji(t,n,r/5280,e._getUIString("ScaleControl.Miles")):Ji(t,n,r,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Ji(t,n,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Ji(t,n,s/1e3,e._getUIString("ScaleControl.Kilometers")):Ji(t,n,s,e._getUIString("ScaleControl.Meters"))}function Ji(e,t,r,n){let i=function(e){let t=Math.pow(10,`${Math.floor(e)}`.length-1),r=e/t;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(e){let t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(r),t*r}(r);e.style.width=t*(i/r)+"px",e.innerHTML=`${i} ${n}`}let Qi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},ea=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ta(e){if(e){if("number"==typeof e){let r=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(r,r),"top-right":new t.P(-r,r),bottom:new t.P(0,-e),"bottom-left":new t.P(r,-r),"bottom-right":new t.P(-r,-r),left:new t.P(e,0),right:new t.P(-e,0)}}if(e instanceof t.P||Array.isArray(e)){let r=t.P.convert(e);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}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 ta(new t.P(0,0))}let ra=r;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=Vn,e.CanvasSource=re,e.CooperativeGesturesHandler=_i,e.DoubleClickZoomHandler=di,e.DragPanHandler=yi,e.DragRotateHandler=vi,e.EdgeInsets=Tn,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(;null!==(e=t?.shadowRoot)&&void 0!==e&&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._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=J,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 new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||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 r=new t.N(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.e({bearing:i},this.options.fitBoundsOptions),o=Z.fromLngLat(r,n);this._map.fitBounds(o,a,{geolocateSource:!0})},this._updateMarker=e=>{if(e){let r=new t.N(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).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(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Xi)return;this._setErrorState()}"OFF"!==this._watchState&&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(!1===e){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 Wi({element:this._dotElement}),this._circleElement=o.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Wi({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||"ACTIVE_LOCK"!==this._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(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({},Zi,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(void 0!==Ri&&!e)return Ri;if(void 0===window.navigator.permissions)return Ri=!!window.navigator.geolocation,Ri;try{Ri="denied"!==(yield window.navigator.permissions.query({name:"geolocation"})).state}catch{Ri=!!window.navigator.geolocation}return Ri}))}().then((e=>this._finishSetupUI(e))),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),o.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Yi=0,Xi=!1}_isOutOfMapMaxBounds(e){let t=this._map.getMaxBounds(),r=e.coords;return t&&(r.longitude<t.getWest()||r.longitude>t.getEast()||r.latitude<t.getSouth()||r.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 new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let e=this._map.getBounds(),t=e.getSouthEast(),r=e.getNorthEast(),n=t.distanceTo(r),i=Math.ceil(this._accuracy/(n/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":Yi--,Xi=!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 new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Yi++,Yi>1?(e={maximumAge:6e5,timeout:0},Xi=!0):(e=this.options.positionOptions,Xi=!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=Sn,e.ImageSource=ee,e.KeyboardHandler=ui,e.LngLatBounds=Z,e.LogoControl=Ei,e.Map=class extends Ai{constructor(e){t.bf.mark(t.bg.create);let r=Object.assign(Object.assign({},ji),e);if(null!=r.minZoom&&null!=r.maxZoom&&r.minZoom>r.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=r.minPitch&&null!=r.maxPitch&&r.minPitch>r.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=r.minPitch&&r.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=r.maxPitch&&r.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new An(r.minZoom,r.maxZoom,r.minPitch,r.maxPitch,r.renderWorldCopies),{bearingSnap:r.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ci,this._controls=[],this._mapId=t.a4(),this._contextLost=e=>{e.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=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=r.interactive,this._maxTileCacheSize=r.maxTileCacheSize,this._maxTileCacheZoomLevels=r.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=!0===r.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=!0===r.preserveDrawingBuffer,this._antialias=!0===r.antialias,this._trackResize=!0===r.trackResize,this._bearingSnap=r.bearingSnap,this._refreshExpiredTiles=!0===r.refreshExpiredTiles,this._fadeDuration=r.fadeDuration,this._crossSourceCollisions=!0===r.crossSourceCollisions,this._collectResourceTiming=!0===r.collectResourceTiming,this._locale=Object.assign(Object.assign({},Fi),r.locale),this._clickTolerance=r.clickTolerance,this._overridePixelRatio=r.pixelRatio,this._maxCanvasSize=r.maxCanvasSize,this.transformCameraUpdate=r.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===r.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=p.addThrottleControl((()=>this.isMoving())),this._requestManager=new d(r.transformRequest),"string"==typeof r.container){if(this._container=document.getElementById(r.container),!this._container)throw new Error(`Container '${r.container}' not found.`)}else{if(!(r.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=r.container}if(r.maxBounds&&this.setMaxBounds(r.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=Mn((e=>{this._trackResize&&!this._removed&&(this.resize(e),this.redraw())}),50);this._resizeObserver=new ResizeObserver((r=>{e?t(r):e=!0})),this._resizeObserver.observe(this._container)}this.handlers=new ki(this,r),this._hash=r.hash&&new Sn("string"==typeof r.hash&&r.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch}),r.bounds&&(this.resize(),this.fitBounds(r.bounds,t.e({},r.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=r.localIdeographFontFamily,this._validateStyle=r.validateStyle,r.style&&this.setStyle(r.style,{localIdeographFontFamily:r.localIdeographFontFamily}),r.attributionControl&&this.addControl(new Si("boolean"==typeof r.attributionControl?void 0:r.attributionControl)),r.maplibreLogo&&this.addControl(new Ei,r.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(e=>{this._update("style"===e.dataType),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,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let n=e.onAdd(this);this._controls.push(e);let i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this}removeControl(e){if(!e||!e.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}calculateCameraOptionsFromTo(e,t,r,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(e,t,r,n)}resize(e){var r;let n=this._containerDimensions(),i=n[0],a=n[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),null===(r=this._requestedCameraState)||void 0===r||r.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:r,1:n}=this._maxCanvasSize,i=this.getPixelRatio(),a=e*i,o=t*i;return Math.min(a>r?r/a:1,o>n?n/o:1)*i}getPixelRatio(){var e;return null!==(e=this._overridePixelRatio)&&void 0!==e?e:devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){return this.transform.setMaxBounds(Z.convert(e)),this._update()}setMinZoom(e){if((e=e??-2)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(e){if((e=e??22)>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e=e??0)<0)throw new 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 new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(e){if((e=e??60)>85)throw new 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 new 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(){var e;return this._moving||(null===(e=this.handlers)||void 0===e?void 0:e.isMoving())}isZooming(){var e;return this._zooming||(null===(e=this.handlers)||void 0===e?void 0:e.isZooming())}isRotating(){var e;return this._rotating||(null===(e=this.handlers)||void 0===e?void 0:e.isRotating())}_createDelegatedListener(e,t,r){if("mouseenter"===e||"mouseover"===e){let n=!1;return{layers:t,listener:r,delegates:{mousemove:i=>{let a=t.filter((e=>this.getLayer(e))),o=0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[];o.length?n||(n=!0,r.call(this,new Rn(e,this,i.originalEvent,{features:o}))):n=!1},mouseout:()=>{n=!1}}}}if("mouseleave"===e||"mouseout"===e){let n=!1;return{layers:t,listener:r,delegates:{mousemove:i=>{let a=t.filter((e=>this.getLayer(e)));(0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[]).length?n=!0:n&&(n=!1,r.call(this,new Rn(e,this,i.originalEvent)))},mouseout:t=>{n&&(n=!1,r.call(this,new Rn(e,this,t.originalEvent)))}}}}{let n=e=>{let n=t.filter((e=>this.getLayer(e))),i=0!==n.length?this.queryRenderedFeatures(e.point,{layers:n}):[];i.length&&(e.features=i,r.call(this,e),delete e.features)};return{layers:t,listener:r,delegates:{[e]:n}}}}_saveDelegatedListener(e,t){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(t)}_removeDelegatedListener(e,t,r){if(!this._delegatedListeners||!this._delegatedListeners[e])return;let n=this._delegatedListeners[e];for(let e=0;e<n.length;e++){let i=n[e];if(i.listener===r&&i.layers.length===t.length&&i.layers.every((e=>t.includes(e)))){for(let e in i.delegates)this.off(e,i.delegates[e]);return void n.splice(e,1)}}}on(e,t,r){if(void 0===r)return super.on(e,t);let n=this._createDelegatedListener(e,"string"==typeof t?[t]:t,r);this._saveDelegatedListener(e,n);for(let e in n.delegates)this.on(e,n.delegates[e]);return this}once(e,t,r){if(void 0===r)return super.once(e,t);let n="string"==typeof t?[t]:t,i=this._createDelegatedListener(e,n,r);for(let t in i.delegates){let a=i.delegates[t];i.delegates[t]=(...t)=>{this._removeDelegatedListener(e,n,r),a(...t)}}this._saveDelegatedListener(e,i);for(let e in i.delegates)this.once(e,i.delegates[e]);return this}off(e,t,r){return void 0===r?super.off(e,t):(this._removeDelegatedListener(e,"string"==typeof t?[t]:t,r),this)}queryRenderedFeatures(e,r){if(!this.style)return[];let n,i=e instanceof t.P||Array.isArray(e),a=i?e:[[0,0],[this.transform.width,this.transform.height]];if(r=r||(i?{}:e)||{},a instanceof t.P||"number"==typeof a[0])n=[t.P.convert(a)];else{let e=t.P.convert(a[0]),r=t.P.convert(a[1]);n=[e,new t.P(r.x,e.y),r,new t.P(e.x,r.y),e]}return this.style.queryRenderedFeatures(n,r,this.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,r){return!1!==(r=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let t=this._locale[e];if(null==t)throw new 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 r=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e?(this.style=new pt(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e,t,r):this.style.loadJSON(e,t,r),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new pt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,r){if("string"==typeof e){let n=this._requestManager.transformRequest(e,"Style");t.h(n,new AbortController).then((e=>{this._updateDiff(e.data,r)})).catch((e=>{e&&this.fire(new t.j(e))}))}else"object"==typeof e&&this._updateDiff(e,r)}_updateDiff(e,r){try{this.style.setState(e,r)&&this._update(!0)}catch(n){t.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(e,r)}}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 r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.j(new Error(`There is no source with ID '${e}'`)))}setTerrain(e){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),e){let r=this.style.sourceCaches[e.source];if(!r)throw new Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);null===this.terrain&&r.reload();for(let r in this.style._layers){let n=this.style._layers[r];"hillshade"===n.type&&n.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 Pi(this.painter,r,e),this.painter.renderToTexture=new Oi(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=>{"style"===t.dataType?this.terrain.sourceCache.freeRtt():"source"===t.dataType&&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(){var e,t;return null!==(t=null===(e=this.terrain)||void 0===e?void 0:e.options)&&void 0!==t?t:null}areTilesLoaded(){let e=this.style&&this.style.sourceCaches;for(let t in e){let r=e[t]._tiles;for(let e in r){let t=r[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style.getSource(e)}addImage(e,r,n={}){let{pixelRatio:i=1,sdf:o=!1,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h}=n;if(this._lazyInitEmptyStyle(),!(r instanceof HTMLImageElement||t.b(r))){if(void 0===r.width||void 0===r.height)return this.fire(new t.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:n,height:a,data:f}=r,p=r;return this.style.addImage(e,{data:new t.R({width:n,height:a},new Uint8Array(f)),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0,userImage:p}),p.onAdd&&p.onAdd(this,e),this}}{let{width:n,height:f,data:p}=a.getImageData(r);this.style.addImage(e,{data:new t.R({width:n,height:f},p),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0})}}updateImage(e,r){let n=this.style.getImage(e);if(!n)return this.fire(new t.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let i=r instanceof HTMLImageElement||t.b(r)?a.getImageData(r):r,{width:o,height:s,data:l}=i;if(void 0===o||void 0===s)return this.fire(new t.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==n.data.width||s!==n.data.height)return this.fire(new t.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let c=!(r instanceof HTMLImageElement||t.b(r));return n.data.replace(l,c),this.style.updateImage(e,n),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new t.j(new 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,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)}setFilter(e,t,r={}){return this.style.setFilter(e,t,r),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,r,n={}){return this.style.setPaintProperty(e,t,r,n),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,r,n={}){return this.style.setLayoutProperty(e,t,r,n),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,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,r,(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 r=this._containerDimensions(),n=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],n);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,r){this._canvas.width=Math.floor(r*e),this._canvas.height=Math.floor(r*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",(r=>{t={requestedAttributes:e},r&&(t.statusMessage=r.statusMessage,t.type=r.type)}),{once:!0});let r=this._canvas.getContext("webgl2",e)||this._canvas.getContext("webgl",e);if(!r){let e="Failed to initialize WebGL";throw t?(t.message=e,new Error(JSON.stringify(t))):new Error(e)}this.painter=new _n(r,this.transform),c.testSupport(r)}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 r=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let n=!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:r,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),s=o.crossFadingFactor();1===s&&s===this._crossFadingFactor||(n=!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,r,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:r,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()||n)&&(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(),this._frameRequest=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(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),p.removeThrottleControl(this._imageQueueHandle),null===(e=this._resizeObserver)||void 0===e||e.disconnect();let r=this.painter.context.gl.getExtension("WEBGL_lose_context");r?.loseContext&&r.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 Bi}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=Rn,e.MapTouchEvent=Fn,e.MapWheelEvent=Bn,e.Marker=Wi,e.NavigationControl=class{constructor(e){this._updateZoomButtons=()=>{let e=this._map.getZoom(),t=e===this._map.getMaxZoom(),r=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{let e=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=e},this._setButtonTitle=(e,t)=>{let r=this._map._getUIString(`NavigationControl.${t}`);e.title=r,e.setAttribute("aria-label",r)},this.options=t.e({},Ui,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 Vi(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 r=o.create("button",e,this._container);return r.type="button",r.addEventListener("click",t),r}},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=>{var t;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?qi(this._lngLat,this._flatPos,this._map.transform):null===(t=this._lngLat)||void 0===t?void 0:t.wrap(),this._trackPointer&&!e)return;let r=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,i=ta(this.options.offset);if(!n){let e,t=this._container.offsetWidth,a=this._container.offsetHeight;e=r.y+i.bottom.y<a?["top"]:r.y>this._map.transform.height-a?["bottom"]:[],r.x<t/2?e.push("left"):r.x>this._map.transform.width-t/2&&e.push("right"),n=0===e.length?"bottom":e.join("-")}let a=r.add(i[n]);this.options.subpixelPositioning||(a=a.round()),o.setTransform(this._container,`${Hi[n]} translate(${a.x}px,${a.y}px)`),Gi(this._container,n,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(Qi),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,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=e;t=n.firstChild,t;)r.appendChild(t);return this.setDOMContent(r)}getMaxWidth(){var e;return null===(e=this._container)||void 0===e?void 0:e.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="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let e=this._container.querySelector(ea);e&&e.focus()}},e.RasterDEMTileSource=K,e.RasterTileSource=$,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({},$i),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=pi,e.Style=pt,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=li,e.TwoFingersTouchRotateHandler=oi,e.TwoFingersTouchZoomHandler=ii,e.TwoFingersTouchZoomRotateHandler=xi,e.VectorTileSource=X,e.VideoSource=te,e.addSourceType=(e,r)=>t._(void 0,void 0,void 0,(function*(){if(ie(e))throw new Error(`A source type called "${e}" already exists.`);var t;t=r,ne[e]=t})),e.clearPrewarmedResources=function(){let e=F;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(O),F=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 le().getRTLTextPluginStatus()},e.getVersion=function(){return ra},e.getWorkerCount=function(){return R.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(e){return V().broadcast("IS",e)},e.prewarm=function(){N().acquire(O)},e.setMaxParallelImageRequests=function(e){t.a.MAX_PARALLEL_IMAGE_REQUESTS=e},e.setRTLTextPlugin=function(e,t){return le().setRTLTextPlugin(e,t)},e.setWorkerCount=function(e){R.workerCount=e},e.setWorkerUrl=function(e){t.a.WORKER_URL=e}})),e},"object"==typeof e&&typeof t<"u"?t.exports=n():(r=typeof globalThis<"u"?globalThis:r||self).maplibregl=n()}}),kb=m({"src/plots/map/layers.js"(e,t){var r=ct(),n=Et().sanitizeHTML,i=yb(),a=hb();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;function l(e){if(!e.visible)return!1;var t=e.source;if(Array.isArray(t)&&t.length>0){for(var n=0;n<t.length;n++)if("string"!=typeof t[n]||0===t[n].length)return!1;return!0}return r.isPlainObject(t)||"string"==typeof t&&t.length>0}function c(e){var t={},n={};switch(e.type){case"circle":r.extendFlat(n,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case"line":r.extendFlat(n,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case"fill":r.extendFlat(n,{"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);r.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}),r.extendFlat(n,{"icon-color":e.color,"text-color":a.textfont.color,"text-opacity":e.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":e.opacity})}return{layout:t,paint:n}}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=l(e)},s.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===e.sourcetype&&(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());null!==t&&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,l(e)){var r=function(e){var t,r=e.sourcetype,i=e.source,a={type:r};return"geojson"===r?t="data":"vector"===r?t="string"==typeof i?"url":"tiles":"raster"===r?(t="tiles",a.tileSize=256):"image"===r&&(t="url",a.coordinates=e.coordinates),a[t]=i,e.sourceattribution&&(a.attribution=n(e.sourceattribution)),a}(e);t.addSource(this.idSource,r)}},s.findFollowingMapLayerId=function(e){if("traces"===e)for(var t=this.subplot.getMapLayers(),r=0;r<t.length;r++){var n=t[r].id;if("string"==typeof n&&0===n.indexOf(a.traceLayerPrefix)){e=n;break}}return e},s.updateLayer=function(e){var t=this.subplot,r=c(e),n=this.lookupBelow(),i=this.findFollowingMapLayerId(n);this.removeLayer(),l(e)&&t.addLayer({id:this.idLayer,source:this.idSource,"source-layer":e.sourcelayer||"",type:e.type,minzoom:e.minzoom,maxzoom:e.maxzoom,layout:r.layout,paint:r.paint},i),this.layerType=e.type,this.below=n},s.updateStyle=function(e){if(l(e)){var t=c(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)},t.exports=function(e,t,r){var n=new o(e,t);return n.update(r),n}}}),Ab=m({"src/plots/map/map.js"(e,t){var r=Tb(),n=ct(),i=wg(),a=He(),o=ar(),s=pr(),l=Or(),c=Rr(),u=c.drawMode,h=c.selectMode,f=Cn().prepSelect,p=Cn().clearOutline,d=Cn().clearSelectionsCache,m=Cn().selectOnClick,g=hb(),y=kb();function v(e,t){this.id=t,this.gd=e;var r=e._fullLayout,n=e._context;this.container=r._glcontainer.node(),this.isStatic=n.staticPlot,this.uid=r._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(r),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var x=v.prototype;x.plot=function(e,t,r){var n,i=this;n=i.map?new Promise((function(r,n){i.updateMap(e,t,r,n)})):new Promise((function(r,n){i.createMap(e,t,r,n)})),r.push(n)},x.createMap=function(e,t,n,a){var o=this,s=t[o.id],l=o.styleObj=b(s.style),c=s.bounds,u=c?[[c.west,c.south],[c.east,c.north]]:null,h=o.map=new r.Map({container:o.div,style:l.style,center:w(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 r.AttributionControl({compact:!0})),f={};h.on("styleimagemissing",(function(e){var t=e.id;if(!f[t]&&t.includes("-15")){f[t]=!0;var r=new Image(15,15);r.onload=function(){h.addImage(t,r)},r.crossOrigin="Anonymous",r.src="https://unpkg.com/maki@2.1.0/icons/"+t+".svg"}})),h.setTransformRequest((function(e){return{url:e=(e=(e=e.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold")).replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold")).replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular")}})),h._canvas.style.left="0px",h._canvas.style.top="0px",o.rejectOnError(a),o.isStatic||o.initFx(e,t);var p=[];p.push(new Promise((function(e){h.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(n)})).catch(a)},x.updateMap=function(e,t,r,n){var a=this,o=a.map,s=t[this.id];a.rejectOnError(n);var l=[],c=b(s.style);JSON.stringify(a.styleObj)!==JSON.stringify(c)&&(a.styleObj=c,o.setStyle(c.style),a.traceHash={},l.push(new Promise((function(e){o.once("styledata",e)})))),l=l.concat(i.fetchTraceGeoData(e)),Promise.all(l).then((function(){a.fillBelowLookup(e,t),a.updateData(e),a.updateLayout(t),a.resolveOnRender(r)})).catch(n)},x.fillBelowLookup=function(e,t){var r,n,i=t[this.id].layers,a=this.belowLookup={},o=!1;for(r=0;r<e.length;r++){var s=e[r][0].trace,l=s._module;"string"==typeof s.below?n=s.below:l.getBelow&&(n=l.getBelow(s,this)),""===n&&(o=!0),a["trace-"+s.uid]=n||""}for(r=0;r<i.length;r++){var c=i[r];n="string"==typeof c.below?c.below:o?"traces":"",a["layout-"+r]=n}var u,h,f={};for(u in a)f[n=a[u]]?f[n].push(u):f[n]=[u];for(n in f){var p=f[n];if(p.length>1)for(r=0;r<p.length;r++)0===(u=p[r]).indexOf("trace-")?(h=u.split("trace-")[1],this.traceHash[h]&&(this.traceHash[h].below=null)):0===u.indexOf("layout-")&&(h=u.split("layout-")[1],this.layerList[h]&&(this.layerList[h].below=null))}};var _={choroplethmap:0,densitymap:1,scattermap:2};function b(e){var t={};return n.isPlainObject(e)?(t.id=e.id,t.style=e):"string"==typeof e?(t.id=e,g.stylesMap[e]?t.style=g.stylesMap[e]:t.style=e):(t.id=g.styleValueDflt,t.style=function(e){return g.styleUrlPrefix+e+"-"+g.styleUrlSuffix}(g.styleValueDflt)),t.transition={duration:0,delay:0},t}function w(e){return[e.lon,e.lat]}x.updateData=function(e){var t,r,n,i,a=this.traceHash,o=e.slice().sort((function(e,t){return _[e[0].trace.type]-_[t[0].trace.type]}));for(n=0;n<o.length;n++){var s=o[n],l=!1;(t=a[(r=s[0].trace).uid])&&(t.type===r.type?(t.update(s),l=!0):t.dispose()),!l&&r._module&&(a[r.uid]=r._module.plot(this,s))}var c=Object.keys(a);e:for(n=0;n<c.length;n++){var u=c[n];for(i=0;i<e.length;i++)if(u===(r=e[i][0].trace).uid)continue e;(t=a[u]).dispose(),delete a[u]}},x.updateLayout=function(e){var t=this.map,r=e[this.id];!this.dragging&&!this.wheeling&&(t.setCenter(w(r.center)),t.setZoom(r.zoom),t.setBearing(r.bearing),t.setPitch(r.pitch)),this.updateLayers(e),this.updateFramework(e),this.updateFx(e),this.map.resize(),this.gd._context._scrollZoom.map?t.scrollZoom.enable():t.scrollZoom.disable()},x.resolveOnRender=function(e){var t=this.map;t.on("render",(function r(){t.loaded()&&(t.off("render",r),setTimeout(e,10))}))},x.rejectOnError=function(e){var t=this.map;function r(){e(new Error(g.mapOnErrorMsg))}t.once("error",r),t.once("style.error",r),t.once("source.error",r),t.once("tile.error",r),t.once("layer.error",r)},x.createFramework=function(e){var t=this,r=t.div=document.createElement("div");r.id=t.uid,r.style.position="absolute",t.container.appendChild(r),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)},x.initFx=function(e,t){var r=this,n=r.gd,i=r.map;function o(){l.loneUnhover(t._hoverlayer)}function s(){var e=r.getView();n.emit("plotly_relayouting",r.getViewEditsWithDerived(e))}i.on("moveend",(function(e){if(r.map){var t=n._fullLayout;if(e.originalEvent||r.wheeling){var i=t[r.id];a.call("_storeDirectGUIEdit",n.layout,t._preGUI,r.getViewEdits(i));var o=r.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,n.emit("plotly_relayout",r.getViewEditsWithDerived(o))}e.originalEvent&&"mouseup"===e.originalEvent.type?r.dragging=!1:r.wheeling&&(r.wheeling=!1),t&&t._rehover&&t._rehover()}})),i.on("wheel",(function(){r.wheeling=!0})),i.on("mousemove",(function(e){var t=r.div.getBoundingClientRect(),a=[e.originalEvent.offsetX,e.originalEvent.offsetY];e.target.getBoundingClientRect=function(){return t},r.xaxis.p2c=function(){return i.unproject(a).lng},r.yaxis.p2c=function(){return i.unproject(a).lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===r.id&&n._fullLayout[r.id]&&l.hover(n,e,r.id)},l.hover(n,e,r.id),n._fullLayout._hoversubplot=r.id})),i.on("dragstart",(function(){r.dragging=!0,o()})),i.on("zoomstart",o),i.on("mouseout",(function(){n._fullLayout._hoversubplot=null})),i.on("drag",s),i.on("zoom",s),i.on("dblclick",(function(){var e=n._fullLayout[r.id];a.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,r.getViewEdits(e));var t=r.viewInitial;i.setCenter(w(t.center)),i.setZoom(t.zoom),i.setBearing(t.bearing),i.setPitch(t.pitch);var o=r.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,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",r.getViewEditsWithDerived(o))})),r.clearOutline=function(){d(r.dragOptions),p(r.dragOptions.gd)},r.onClickInPanFn=function(e){return function(t){var i=n._fullLayout.clickmode;i.indexOf("select")>-1&&m(t.originalEvent,n,[r.xaxis],[r.yaxis],r.id,e),i.indexOf("event")>-1&&l.click(n,t.originalEvent)}}},x.updateFx=function(e){var t=this,r=t.map,i=t.gd;if(!t.isStatic){var a,o=e.dragmode;a=function(e,r){r.isRect?(e.range={})[t.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(e.lassoPoints={})[t.id]=r.map(c)};var l=t.dragOptions;t.dragOptions=n.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:a},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),r.off("click",t.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",t.clearOutline),t.dragOptions.prepFn=function(e,r,n){f(e,r,n,t.dragOptions,o)},s.init(t.dragOptions)):(r.dragPan.enable(),r.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),r.on("click",t.onClickInPanHandler))}function c(e){var r=t.map.unproject(e);return[r.lng,r.lat]}},x.updateFramework=function(e){var t=e[this.id].domain,r=e._size,n=this.div.style;n.width=r.w*(t.x[1]-t.x[0])+"px",n.height=r.h*(t.y[1]-t.y[0])+"px",n.left=r.l+t.x[0]*r.w+"px",n.top=r.t+(1-t.y[1])*r.h+"px",this.xaxis._offset=r.l+t.x[0]*r.w,this.xaxis._length=r.w*(t.x[1]-t.x[0]),this.yaxis._offset=r.t+(1-t.y[1])*r.h,this.yaxis._length=r.h*(t.y[1]-t.y[0])},x.updateLayers=function(e){var t,r=e[this.id].layers,n=this.layerList;if(r.length!==n.length){for(t=0;t<n.length;t++)n[t].dispose();for(n=this.layerList=[],t=0;t<r.length;t++)n.push(y(this,t,r[t]))}else for(t=0;t<r.length;t++)n[t].update(r[t])},x.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},x.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},x.setOptions=function(e,t,r){for(var n in r)this.map[t](e,n,r[n])},x.getMapLayers=function(){return this.map.getStyle().layers},x.addLayer=function(e,t){var r=this.map;if("string"==typeof t){if(""===t)return void r.addLayer(e,t);for(var i=this.getMapLayers(),a=0;a<i.length;a++)if(t===i[a].id)return void r.addLayer(e,t);n.warn(["Trying to add layer with *below* value",t,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}r.addLayer(e)},x.project=function(e){return this.map.project(new r.LngLat(e[0],e[1]))},x.getView=function(){var e=this.map,t=e.getCenter(),r={lon:t.lng,lat:t.lat},n=e.getCanvas(),i=parseInt(n.style.width),a=parseInt(n.style.height);return{center:r,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()]}}},x.getViewEdits=function(e){for(var t=this.id,r=["center","zoom","bearing","pitch"],n={},i=0;i<r.length;i++){var a=r[i];n[t+"."+a]=e[a]}return n},x.getViewEditsWithDerived=function(e){var t=this.id,r=this.getViewEdits(e);return r[t+"._derived"]=e._derived,r},t.exports=v}}),Mb=m({"src/plots/map/layout_defaults.js"(e,t){var r=ct(),n=Gs(),i=Nt(),a=fb();function o(e,t,r){r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch");var n=r("bounds.west"),a=r("bounds.east"),o=r("bounds.south"),l=r("bounds.north");(void 0===n||void 0===a||void 0===o||void 0===l)&&delete t.bounds,i(e,t,{name:"layers",handleItemDefaults:s}),t._input=e}function s(e,t){function n(n,i){return r.coerce(e,t,a.layers,n,i)}if(n("visible")){var i,o=n("sourcetype"),s="raster"===o||"image"===o;n("source"),n("sourceattribution"),"vector"===o&&n("sourcelayer"),"image"===o&&n("coordinates"),s&&(i="raster");var l=n("type",i);s&&"raster"!==l&&(l=t.type="raster",r.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),"circle"===l&&n("circle.radius"),"line"===l&&(n("line.width"),n("line.dash")),"fill"===l&&n("fill.outlinecolor"),"symbol"===l&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),r.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}t.exports=function(e,t,r){n(e,t,r,{type:"map",attributes:a,handleDefaults:o,partition:"y"})}}}),Sb=m({"src/plots/map/index.js"(e){var t=ct(),r=t.strTranslate,n=t.strScale,i=Tt().getSubplotCalcData,a=Mt(),o=b(),s=er(),l=Et(),c=Ab(),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=fb(),e.supplyLayoutDefaults=Mb(),e.plot=function(e){for(var r=e._fullLayout,n=e.calcdata,a=r._subplots[u],o=0;o<a.length;o++){var s=a[o],l=i(n,u,s),h=r[s],f=h._subplot;f||(f=new c(e,s),r[s]._subplot=f),f.viewInitial||(f.viewInitial={center:t.extendFlat({},h.center),zoom:h.zoom,bearing:h.bearing,pitch:h.pitch}),f.plot(l,r,e._promises)}},e.clean=function(e,t,r,n){for(var i=n._subplots[u]||[],a=0;a<i.length;a++){var o=i[a];!t[o]&&n[o]._subplot&&n[o]._subplot.destroy()}},e.toSVG=function(e){for(var t=e._fullLayout,i=t._subplots[u],c=t._size,h=0;h<i.length;h++){var f=t[i[h]],p=f.domain,d=f._subplot.toImage("png");t._glimages.append("svg:image").attr({xmlns:a.svg,"xlink:href":d,x:c.l+c.w*p.x[0],y:c.t+c.h*(1-p.y[1]),width:c.w*(p.x[1]-p.x[0]),height:c.h*(p.y[1]-p.y[0]),preserveAspectRatio:"none"});var m=o.select(f._subplot.div).select(".maplibregl-ctrl-attrib").text().replace("Improve this map",""),g=t._glimages.append("g"),y=g.append("text");y.text(m).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":m});var v=s.bBox(y.node()),x=c.w*(p.x[1]-p.x[0]);if(v.width>x/2){var _=m.split("|").join("<br>");y.text(_).attr("data-unformatted",_).call(l.convertToTspans,e),v=s.bBox(y.node())}y.attr("transform",r(-3,8-v.height)),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 b=1;v.width+6>x&&(b=x/(v.width+6));var w=[c.l+c.w*p.x[1],c.t+c.h*(1-p.y[0])];g.attr("transform",r(w[0],w[1])+n(b))}},e.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots[u],n=0;n<r.length;n++)t[r[n]]._subplot.updateFx(t)}}}),Eb=m({"src/traces/scattermap/index.js"(e,t){t.exports={attributes:pb(),supplyDefaults:mb(),colorbar:mi(),formatLabels:gb(),calc:ug(),plot:xb(),hoverPoints:_b().hoverPoints,eventData:bb(),selectPoints:wb(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.update(t)},moduleType:"trace",name:"scattermap",basePlotModule:Sb(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}}),Cb=m({"lib/scattermap.js"(e,t){t.exports=Eb()}}),Ib=m({"src/traces/choroplethmap/attributes.js"(e,t){var r=Bg(),n=zt(),{hovertemplateAttrs:i,templatefallbackAttrs:a}=Fe(),o=q(),s=B().extendFlat;t.exports=s({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:s({},r.featureidkey,{}),below:{valType:"string",editType:"plot"},text:r.text,hovertext:r.hovertext,marker:{line:{color:s({},r.marker.line.color,{editType:"plot"}),width:s({},r.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:s({},r.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:s({},r.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:s({},r.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:r.hoverinfo,hovertemplate:i({},{keys:["properties"]}),hovertemplatefallback:a(),showlegend:s({},o.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))}}),Lb=m({"src/traces/choroplethmap/defaults.js"(e,t){var r=ct(),n=Ht(),i=Ib();t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}var l=s("locations"),c=s("z"),u=s("geojson");r.isArrayOrTypedArray(l)&&l.length&&r.isArrayOrTypedArray(c)&&c.length&&("string"==typeof u&&""!==u||r.isPlainObject(u))?(s("featureidkey"),t._length=Math.min(l.length,c.length),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),n(e,t,o,s,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(t,s)):t.visible=!1}}}),Pb=m({"src/traces/choroplethmap/convert.js"(e,t){var r=M(),n=ct(),i=Yt(),a=er(),o=dg().makeBlank,s=wg();function l(e){var t,r=e[0].trace,i=r._opts;if(r.selectedpoints){for(var o=a.makeSelectedPointStyleFns(r),s=0;s<e.length;s++){var l=e[s];l.fOut&&(l.fOut.properties.mo2=o.selectedOpacityFn(l))}t={type:"identity",property:"mo2"}}else t=n.isArrayOrTypedArray(r.marker.opacity)?{type:"identity",property:"mo"}:r.marker.opacity;return n.extendFlat(i.fill.paint,{"fill-opacity":t}),n.extendFlat(i.line.paint,{"line-opacity":t}),i}t.exports={convert:function(e){var t=e[0].trace,a=!0===t.visible&&0!==t._length,c={layout:{visibility:"none"},paint:{}},u={layout:{visibility:"none"},paint:{}},h=t._opts={fill:c,line:u,geojson:o()};if(!a)return h;var f=s.extractTraceFeature(e);if(!f)return h;var p,d,m,g=i.makeColorScaleFuncFromTrace(t),y=t.marker,v=y.line||{};n.isArrayOrTypedArray(y.opacity)&&(p=function(e){var t=e.mo;return r(t)?+n.constrain(t,0,1):0}),n.isArrayOrTypedArray(v.color)&&(d=function(e){return e.mlc}),n.isArrayOrTypedArray(v.width)&&(m=function(e){return e.mlw});for(var x=0;x<e.length;x++){var _=e[x],b=_.fOut;if(b){var w=b.properties;w.fc=g(_.z),p&&(w.mo=p(_)),d&&(w.mlc=d(_)),m&&(w.mlw=m(_)),_.ct=w.ct,_._polygons=s.feature2polygons(b)}}var T=p?{type:"identity",property:"mo"}:y.opacity;return n.extendFlat(c.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":T}),n.extendFlat(u.paint,{"line-color":d?{type:"identity",property:"mlc"}:v.color,"line-width":m?{type:"identity",property:"mlw"}:v.width,"line-opacity":T}),c.layout.visibility="visible",u.layout.visibility="visible",h.geojson={type:"FeatureCollection",features:f},l(e),h},convertOnSelect:l}}}),zb=m({"src/traces/choroplethmap/plot.js"(e,t){var r=Pb().convert,n=Pb().convertOnSelect,i=hb().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(r(e)),e[0].trace._glTrace=this},o.updateOnSelect=function(e){this._update(n(e))},o._update=function(e){var t=this.subplot,r=this.layerList,n=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(e.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(e,n),this.below=n);for(var i=0;i<r.length;i++){var a=r[i],o=a[0],s=a[1],l=e[o];t.setOptions(s,"setLayoutProperty",l.layout),"visible"===l.layout.visibility&&t.setOptions(s,"setPaintProperty",l.paint)}},o._addLayers=function(e,t){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=e[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},t)}},o._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var n=t[0].trace,i=new a(e,n.uid),o=i.sourceId,s=r(t),l=i.below=e.belowLookup["trace-"+n.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),t[0].trace._glTrace=i,i}}}),Db=m({"src/traces/choroplethmap/index.js"(e,t){t.exports={attributes:Ib(),supplyDefaults:Lb(),colorbar:Vo(),calc:Ng(),plot:zb(),hoverPoints:qg(),eventData:Hg(),selectPoints:Gg(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.updateOnSelect(t)},getBelow:function(e,t){for(var r=t.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a<r.length;a++)if("string"==typeof(i=r[a].id)&&-1===i.indexOf("plotly-"))return i}},moduleType:"trace",name:"choroplethmap",basePlotModule:Sb(),categories:["map","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_map"}}}}),Ob=m({"lib/choroplethmap.js"(e,t){t.exports=Db()}}),Rb=m({"src/traces/densitymap/attributes.js"(e,t){var r=zt(),{hovertemplateAttrs:n,templatefallbackAttrs:i}=Fe(),a=q(),o=pb(),s=B().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:n(),hovertemplatefallback:i(),showlegend:s({},a.showlegend,{dflt:!1})},r("",{cLetter:"z",editTypeOverride:"calc"}))}}),Fb=m({"src/traces/densitymap/defaults.js"(e,t){var r=ct(),n=Ht(),i=Rb();t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(t._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),n(e,t,o,s,{prefix:"",cLetter:"z"})):t.visible=!1}}}),Bb=m({"src/traces/densitymap/calc.js"(e,t){var r=M(),n=ct().isArrayOrTypedArray,i=S().BADNUM,a=Zt(),o=ct()._;t.exports=function(e,t){for(var s=t._length,l=new Array(s),c=t.z,u=n(c)&&c.length,h=0;h<s;h++){var f=l[h]={},p=t.lon[h],d=t.lat[h];if(f.lonlat=r(p)&&r(d)?[+p,+d]:[i,i],u){var m=c[h];f.z=r(m)?m:i}}return a(e,t,{vals:u?c:[0,1],containerStr:"",cLetter:"z"}),s&&(l[0].t={labels:{lat:o(e,"lat:")+" ",lon:o(e,"lon:")+" "}}),l}}}),jb=m({"src/traces/densitymap/convert.js"(e,t){var r=M(),n=ct(),i=W(),a=Yt(),o=S().BADNUM,s=dg().makeBlank;t.exports=function(e){var t=e[0].trace,l=!0===t.visible&&0!==t._length,c=t._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:s()};if(!l)return c;var u,h=[],f=t.z,p=t.radius,d=n.isArrayOrTypedArray(f)&&f.length,m=n.isArrayOrTypedArray(p);for(u=0;u<e.length;u++){var g=e[u],y=g.lonlat;if(y[0]!==o){var v={};if(d){var x=g.z;v.z=x!==o?x:0}m&&(v.r=r(p[u])&&p[u]>0?+p[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var _=a.extractOpts(t),b=_.reversescale?a.flipScale(_.colorscale):_.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u<b.length;u++)T.push(b[u][0],b[u][1]);var k=["interpolate",["linear"],["get","z"],_.min,0,_.max,1];return n.extendFlat(c.heatmap.paint,{"heatmap-weight":d?k:1/(_.max-_.min),"heatmap-color":T,"heatmap-radius":m?{type:"identity",property:"r"}:t.radius,"heatmap-opacity":t.opacity}),c.geojson={type:"FeatureCollection",features:h},c.heatmap.layout.visibility="visible",c}}}),Nb=m({"src/traces/densitymap/plot.js"(e,t){var r=jb(),n=hb().traceLayerPrefix;function i(e,t){this.type="densitymap",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["heatmap",n+t+"-heatmap"]],this.below=null}var a=i.prototype;a.update=function(e){var t=this.subplot,n=this.layerList,i=r(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<n.length;o++){var s=n[o],l=s[0],c=s[1],u=i[l];t.setOptions(c,"setLayoutProperty",u.layout),"visible"===u.layout.visibility&&t.setOptions(c,"setPaintProperty",u.paint)}},a._addLayers=function(e,t){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=e[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},t)}},a._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])},a.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var n=t[0].trace,a=new i(e,n.uid),o=a.sourceId,s=r(t),l=a.below=e.belowLookup["trace-"+n.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),Ub=m({"src/traces/densitymap/hover.js"(e,t){var r=ar(),n=_b().hoverPoints,i=_b().getExtraText;t.exports=function(e,t,a){var o=n(e,t,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),Vb=m({"src/traces/densitymap/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e.z=t.z,e}}}),qb=m({"src/traces/densitymap/index.js"(e,t){t.exports={attributes:Rb(),supplyDefaults:Fb(),colorbar:Vo(),formatLabels:gb(),calc:Bb(),plot:Nb(),hoverPoints:Ub(),eventData:Vb(),getBelow:function(e,t){for(var r=t.getMapLayers(),n=0;n<r.length;n++){var i=r[n],a=i.id;if("symbol"===i.type&&"string"==typeof a&&-1===a.indexOf("plotly-"))return a}},moduleType:"trace",name:"densitymap",basePlotModule:Sb(),categories:["map","gl","showLegend"],meta:{hr_name:"density_map"}}}}),Hb=m({"lib/densitymap.js"(e,t){t.exports=qb()}}),Gb=m({"src/traces/sankey/attributes.js"(e,t){var r=j(),n=q(),i=G(),a=V(),o=Ma().attributes,{hovertemplateAttrs:s,templatefallbackAttrs:l}=Fe(),c=zt(),u=vt().templatedArray,h=It().descriptionOnlyNumbers,f=B().extendFlat,p=De().overrideAll;t.exports=p({hoverinfo:f({},n.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:h("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:r({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:l(),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:l(),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(c().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}}),Wb=m({"src/traces/sankey/defaults.js"(e,t){var r=ct(),n=Gb(),i=W(),a=F(),o=Ma().defaults,s=Er(),l=vt(),c=Nt();function u(e,t){function i(i,a){return r.coerce(e,t,n.link.colorscales,i,a)}i("label"),i("cmin"),i("cmax"),i("colorscale")}t.exports=function(e,t,h,f){function p(i,a){return r.coerce(e,t,n,i,a)}var d=r.extendDeep(f.hoverlabel,e.hoverlabel),m=e.node,g=l.newContainer(t,"node");function y(e,t){return r.coerce(m,g,n.node,e,t)}y("label"),y("groups"),y("x"),y("y"),y("pad"),y("thickness"),y("line.color"),y("line.width"),y("hoverinfo",e.hoverinfo),s(m,g,y,d),y("hovertemplate"),y("align");var v=f.colorway;y("color",g.label.map((function(e,t){return i.addOpacity(function(e){return v[e%v.length]}(t),.8)}))),y("customdata");var x=e.link||{},_=l.newContainer(t,"link");function b(e,t){return r.coerce(x,_,n.link,e,t)}b("label"),b("arrowlen"),b("source"),b("target"),b("value"),b("line.color"),b("line.width"),b("hoverinfo",e.hoverinfo),s(x,_,b,d),b("hovertemplate");var w,T=a(f.paper_bgcolor).getLuminance()<.333,k=b("color",T?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)");function A(e){var t=a(e);if(!t.isValid())return e;var r=t.getAlpha();return r<=.8?t.setAlpha(r+.2):t=T?t.brighten():t.darken(),t.toRgbString()}b("hovercolor",Array.isArray(k)?k.map(A):A(k)),b("customdata"),c(x,_,{name:"colorscales",handleItemDefaults:u}),o(t,f,p),p("orientation"),p("valueformat"),p("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),p("arrangement",w),r.coerceFont(p,"textfont",f.font,{autoShadowDflt:!0}),t._length=null}}}),Zb=m({"node_modules/strongly-connected-components/scc.js"(e,t){t.exports=function(e){for(var t=e.length,r=new Array(t),n=new Array(t),i=new Array(t),a=new Array(t),o=new Array(t),s=new Array(t),l=0;l<t;++l)r[l]=-1,n[l]=0,i[l]=!1,a[l]=0,o[l]=-1,s[l]=[];var c,u=0,h=[],f=[];function p(t){var l=[t],c=[t];for(r[t]=n[t]=u,i[t]=!0,u+=1;c.length>0;){t=c[c.length-1];var p=e[t];if(a[t]<p.length){for(var d=a[t];d<p.length;++d){var m=p[d];if(r[m]<0){r[m]=n[m]=u,i[m]=!0,u+=1,l.push(m),c.push(m);break}i[m]&&(n[t]=0|Math.min(n[t],n[m])),o[m]>=0&&s[t].push(o[m])}a[t]=d}else{if(n[t]===r[t]){var g=[],y=[],v=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,g.push(x),y.push(s[x]),v+=s[x].length,o[x]=h.length,x===t){l.length=d;break}}h.push(g);var _=new Array(v);for(d=0;d<y.length;d++)for(var b=0;b<y[d].length;b++)_[--v]=y[d][b];f.push(_)}c.pop()}}}for(l=0;l<t;++l)r[l]<0&&p(l);for(l=0;l<f.length;l++){var d=f[l];if(0!==d.length){d.sort((function(e,t){return e-t})),c=[d[0]];for(var m=1;m<d.length;m++)d[m]!==d[m-1]&&c.push(d[m]);f[l]=c}}return{components:h,adjacencyList:f}}}}),Yb=m({"src/traces/sankey/calc.js"(e,t){var r=Zb(),n=ct(),i=Kx().wrap,a=n.isArrayOrTypedArray,o=n.isIndex,s=Yt();t.exports=function(e,t){var l=function(e){var t,i=e.node,l=e.link,c=[],u=a(l.color),h=a(l.hovercolor),f=a(l.customdata),p={},d={},m=l.colorscales.length;for(t=0;t<m;t++){var g=l.colorscales[t],y=s.extractScale(g,{cLetter:"c"}),v=s.makeColorScaleFunc(y);d[g.label]=v}var x=0;for(t=0;t<l.value.length;t++)l.source[t]>x&&(x=l.source[t]),l.target[t]>x&&(x=l.target[t]);var _=x+1;e.node._count=_;var b,w=e.node.groups,T={};for(t=0;t<w.length;t++){var k=w[t];for(b=0;b<k.length;b++){var A=k[b],M=_+t;T.hasOwnProperty(A)?n.warn("Node "+A+" is already part of a group."):T[A]=M}}var S={source:[],target:[]};for(t=0;t<l.value.length;t++){var E=l.value[t],C=l.source[t],I=l.target[t];if(E>0&&o(C,_)&&o(I,_)&&(!T.hasOwnProperty(C)||!T.hasOwnProperty(I)||T[C]!==T[I])){T.hasOwnProperty(I)&&(I=T[I]),T.hasOwnProperty(C)&&(C=T[C]),I=+I,p[C=+C]=p[I]=!0;var L="";l.label&&l.label[t]&&(L=l.label[t]);var P=null;L&&d.hasOwnProperty(L)&&(P=d[L]),c.push({pointNumber:t,label:L,color:u?l.color[t]:l.color,hovercolor:h?l.hovercolor[t]:l.hovercolor,customdata:f?l.customdata[t]:l.customdata,concentrationscale:P,source:C,target:I,value:+E}),S.source.push(C),S.target.push(I)}}var z=_+w.length,D=a(i.color),O=a(i.customdata),R=[];for(t=0;t<z;t++)if(p[t]){var F=i.label[t];R.push({group:t>_-1,childrenNodes:[],pointNumber:t,label:F,color:D?i.color[t]:i.color,customdata:O?i.customdata[t]:i.customdata})}var B=!1;return function(e,t,i){for(var a=n.init2dArray(e,0),o=0;o<Math.min(t.length,i.length);o++)if(n.isIndex(t[o],e)&&n.isIndex(i[o],e)){if(t[o]===i[o])return!0;a[t[o]].push(i[o])}return r(a).components.some((function(e){return e.length>1}))}(z,S.source,S.target)&&(B=!0),{circular:B,links:c,nodes:R,groups:w,groupLookup:T}}(t);return i({circular:l.circular,_nodes:l.nodes,_links:l.links,_groups:l.groups,_groupLookup:l.groupLookup})}}}),Xb=m({"node_modules/d3-quadtree/dist/d3-quadtree.js"(e,t){var r,n;r=e,n=function(e){function t(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var i,a,o,s,l,c,u,h,f,p=e._root,d={data:n},m=e._x0,g=e._y0,y=e._x1,v=e._y1;if(!p)return e._root=d,e;for(;p.length;)if((c=t>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o,i=p,!(p=p[h=u<<1|c]))return i[h]=d,e;if(s=+e._x.call(null,p.data),l=+e._y.call(null,p.data),t===s&&r===l)return d.next=p,i?i[h]=d:e._root=d,e;do{i=i?i[h]=new Array(4):e._root=new Array(4),(c=t>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o}while((h=u<<1|c)==(f=(l>=o)<<1|s>=a));return i[f]=p,i[h]=d,e}function r(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}function n(e){return e[0]}function i(e){return e[1]}function a(e,t,r){var a=new o(t??n,r??i,NaN,NaN,NaN,NaN);return null==e?a:a.addAll(e)}function o(e,t,r,n,i,a){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var l=a.prototype=o.prototype;l.copy=function(){var e,t,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(e=[{source:n,target:r._root=new Array(4)}];n=e.pop();)for(var i=0;i<4;++i)(t=n.source[i])&&(t.length?e.push({source:t,target:n.target[i]=new Array(4)}):n.target[i]=s(t));return r},l.add=function(e){var r=+this._x.call(null,e),n=+this._y.call(null,e);return t(this.cover(r,n),r,n,e)},l.addAll=function(e){var r,n,i,a,o=e.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,h=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,r=e[n]))||isNaN(a=+this._y.call(null,r))||(s[n]=i,l[n]=a,i<c&&(c=i),i>h&&(h=i),a<u&&(u=a),a>f&&(f=a));if(c>h||u>f)return this;for(this.cover(c,u).cover(h,f),n=0;n<o;++n)t(this,s[n],l[n],e[n]);return this},l.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(r))i=(r=Math.floor(e))+1,a=(n=Math.floor(t))+1;else{for(var o,s,l=i-r,c=this._root;r>e||e>=i||n>t||t>=a;)switch(s=(t<n)<<1|e<r,o=new Array(4),o[s]=c,c=o,l*=2,s){case 0:i=r+l,a=n+l;break;case 1:r=i-l,a=n+l;break;case 2:i=r+l,n=a-l;break;case 3:r=i-l,n=a-l}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},l.extent=function(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]]},l.find=function(e,t,n){var i,a,o,s,l,c,u,h=this._x0,f=this._y0,p=this._x1,d=this._y1,m=[],g=this._root;for(g&&m.push(new r(g,h,f,p,d)),null==n?n=1/0:(h=e-n,f=t-n,p=e+n,d=t+n,n*=n);c=m.pop();)if(!(!(g=c.node)||(a=c.x0)>p||(o=c.y0)>d||(s=c.x1)<h||(l=c.y1)<f))if(g.length){var y=(a+s)/2,v=(o+l)/2;m.push(new r(g[3],y,v,s,l),new r(g[2],a,v,y,l),new r(g[1],y,o,s,v),new r(g[0],a,o,y,v)),(u=(t>=v)<<1|e>=y)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=e-+this._x.call(null,g.data),_=t-+this._y.call(null,g.data),b=x*x+_*_;if(b<n){var w=Math.sqrt(n=b);h=e-w,f=t-w,p=e+w,d=t+w,i=g.data}}return i},l.remove=function(e){if(isNaN(a=+this._x.call(null,e))||isNaN(o=+this._y.call(null,e)))return this;var t,r,n,i,a,o,s,l,c,u,h,f,p=this._root,d=this._x0,m=this._y0,g=this._x1,y=this._y1;if(!p)return this;if(p.length)for(;;){if((c=a>=(s=(d+g)/2))?d=s:g=s,(u=o>=(l=(m+y)/2))?m=l:y=l,t=p,!(p=p[h=u<<1|c]))return this;if(!p.length)break;(t[h+1&3]||t[h+2&3]||t[h+3&3])&&(r=t,f=h)}for(;p.data!==e;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):t?(i?t[h]=i:delete t[h],(p=t[0]||t[1]||t[2]||t[3])&&p===(t[3]||t[2]||t[1]||t[0])&&!p.length&&(r?r[f]=p:this._root=p),this):(this._root=i,this)},l.removeAll=function(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this},l.root=function(){return this._root},l.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},l.visit=function(e){var t,n,i,a,o,s,l=[],c=this._root;for(c&&l.push(new r(c,this._x0,this._y0,this._x1,this._y1));t=l.pop();)if(!e(c=t.node,i=t.x0,a=t.y0,o=t.x1,s=t.y1)&&c.length){var u=(i+o)/2,h=(a+s)/2;(n=c[3])&&l.push(new r(n,u,h,o,s)),(n=c[2])&&l.push(new r(n,i,h,u,s)),(n=c[1])&&l.push(new r(n,u,a,o,h)),(n=c[0])&&l.push(new r(n,i,a,u,h))}return this},l.visitAfter=function(e){var t,n=[],i=[];for(this._root&&n.push(new r(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var a=t.node;if(a.length){var o,s=t.x0,l=t.y0,c=t.x1,u=t.y1,h=(s+c)/2,f=(l+u)/2;(o=a[0])&&n.push(new r(o,s,l,h,f)),(o=a[1])&&n.push(new r(o,h,l,c,f)),(o=a[2])&&n.push(new r(o,s,f,h,u)),(o=a[3])&&n.push(new r(o,h,f,c,u))}i.push(t)}for(;t=i.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},l.x=function(e){return arguments.length?(this._x=e,this):this._x},l.y=function(e){return arguments.length?(this._y=e,this):this._y},e.quadtree=a,Object.defineProperty(e,"__esModule",{value:!0})},n("object"==typeof e&&typeof t<"u"?e:(r=r||self).d3=r.d3||{})}}),$b=m({"node_modules/d3-collection/dist/d3-collection.js"(e,t){var r;r=e,function(e){var t="$";function r(){}function n(e,t){var n=new r;if(e instanceof r)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var i,a=-1,o=e.length;if(null==t)for(;++a<o;)n.set(a,e[a]);else for(;++a<o;)n.set(t(i=e[a],a,e),i)}else if(e)for(var s in e)n.set(s,e[s]);return n}function i(){return{}}function a(e,t,r){e[t]=r}function o(){return n()}function s(e,t,r){e.set(t,r)}function l(){}r.prototype=n.prototype={constructor:r,has:function(e){return t+e in this},get:function(e){return this[t+e]},set:function(e,r){return this[t+e]=r,this},remove:function(e){var r=t+e;return r in this&&delete this[r]},clear:function(){for(var e in this)e[0]===t&&delete this[e]},keys:function(){var e=[];for(var r in this)r[0]===t&&e.push(r.slice(1));return e},values:function(){var e=[];for(var r in this)r[0]===t&&e.push(this[r]);return e},entries:function(){var e=[];for(var r in this)r[0]===t&&e.push({key:r.slice(1),value:this[r]});return e},size:function(){var e=0;for(var r in this)r[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 r in this)r[0]===t&&e(this[r],r.slice(1),this)}};var c=n.prototype;function u(e,t){var r=new l;if(e instanceof l)e.each((function(e){r.add(e)}));else if(e){var n=-1,i=e.length;if(null==t)for(;++n<i;)r.add(e[n]);else for(;++n<i;)r.add(t(e[n],n,e))}return r}l.prototype=u.prototype={constructor:l,has:c.has,add:function(e){return this[t+(e+="")]=e,this},remove:c.remove,clear:c.clear,values:c.keys,size:c.size,empty:c.empty,each:c.each},e.nest=function(){var e,t,r,l=[],c=[];function u(r,i,a,o){if(i>=l.length)return null!=e&&r.sort(e),null!=t?t(r):r;for(var s,c,h,f=-1,p=r.length,d=l[i++],m=n(),g=a();++f<p;)(h=m.get(s=d(c=r[f])+""))?h.push(c):m.set(s,[c]);return m.each((function(e,t){o(g,t,u(e,i,a,o))})),g}function h(e,r){if(++r>l.length)return e;var n,i=c[r-1];return null!=t&&r>=l.length?n=e.entries():(n=[],e.each((function(e,t){n.push({key:t,values:h(e,r)})}))),null!=i?n.sort((function(e,t){return i(e.key,t.key)})):n}return r={object:function(e){return u(e,0,i,a)},map:function(e){return u(e,0,o,s)},entries:function(e){return h(u(e,0,o,s),0)},key:function(e){return l.push(e),r},sortKeys:function(e){return c[l.length-1]=e,r},sortValues:function(t){return e=t,r},rollup:function(e){return t=e,r}}},e.set=u,e.map=n,e.keys=function(e){var t=[];for(var r in e)t.push(r);return t},e.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},e.entries=function(e){var t=[];for(var r in e)t.push({key:r,value:e[r]});return t},Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof e&&typeof t<"u"?e:r.d3=r.d3||{})}}),Kb=m({"node_modules/d3-dispatch/dist/d3-dispatch.js"(e,t){var r,n;r=e,n=function(e){var t={value:function(){}};function r(){for(var e,t=0,r=arguments.length,i={};t<r;++t){if(!(e=arguments[t]+"")||e in i||/[\s.]/.test(e))throw new Error("illegal type: "+e);i[e]=[]}return new n(i)}function n(e){this._=e}function i(e,t){for(var r,n=0,i=e.length;n<i;++n)if((r=e[n]).name===t)return r.value}function a(e,r,n){for(var i=0,a=e.length;i<a;++i)if(e[i].name===r){e[i]=t,e=e.slice(0,i).concat(e.slice(i+1));break}return null!=n&&e.push({name:r,value:n}),e}n.prototype=r.prototype={constructor:n,on:function(e,t){var r,n=this._,o=function(e,t){return e.trim().split(/^|\s+/).map((function(e){var r="",n=e.indexOf(".");if(n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}}))}(e+"",n),s=-1,l=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++s<l;)if(r=(e=o[s]).type)n[r]=a(n[r],e.name,t);else if(null==t)for(r in n)n[r]=a(n[r],e.name,null);return this}for(;++s<l;)if((r=(e=o[s]).type)&&(r=i(n[r],e.name)))return r},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new n(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),a=0;a<r;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,r=(n=this._[e]).length;a<r;++a)n[a].value.apply(t,i)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,a=n.length;i<a;++i)n[i].value.apply(t,r)}},e.dispatch=r,Object.defineProperty(e,"__esModule",{value:!0})},n("object"==typeof e&&typeof t<"u"?e:(r=r||self).d3=r.d3||{})}}),Jb=m({"node_modules/d3-timer/dist/d3-timer.js"(e,t){var r,n;r=e,n=function(e){var t,r,n=0,i=0,a=0,o=0,s=0,l=0,c="object"==typeof performance&&performance.now?performance:Date,u="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function h(){return s||(u(f),s=c.now()+l)}function f(){s=0}function p(){this._call=this._time=this._next=null}function d(e,t,r){var n=new p;return n.restart(e,t,r),n}function m(){h(),++n;for(var e,r=t;r;)(e=s-r._time)>=0&&r._call.call(null,e),r=r._next;--n}function g(){s=(o=c.now())+l,n=i=0;try{m()}finally{n=0,function(){for(var e,n,i=t,a=1/0;i;)i._call?(a>i._time&&(a=i._time),e=i,i=i._next):(n=i._next,i._next=null,i=e?e._next=n:t=n);r=e,v(a)}(),s=0}}function y(){var e=c.now(),t=e-o;t>1e3&&(l-=t,o=e)}function v(e){n||(i&&(i=clearTimeout(i)),e-s>24?(e<1/0&&(i=setTimeout(g,e-c.now()-l)),a&&(a=clearInterval(a))):(a||(o=c.now(),a=setInterval(y,1e3)),n=1,u(g)))}p.prototype=d.prototype={constructor:p,restart:function(e,n,i){if("function"!=typeof e)throw new TypeError("callback is not a function");i=(null==i?h():+i)+(null==n?0:+n),!this._next&&r!==this&&(r?r._next=this:t=this,r=this),this._call=e,this._time=i,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}},e.interval=function(e,t,r){var n=new p,i=t;return null==t?(n.restart(e,t,r),n):(t=+t,r=null==r?h():+r,n.restart((function a(o){o+=i,n.restart(a,i+=t,r),e(o)}),t,r),n)},e.now=h,e.timeout=function(e,t,r){var n=new p;return t=null==t?0:+t,n.restart((function(r){n.stop(),e(r+t)}),t,r),n},e.timer=d,e.timerFlush=m,Object.defineProperty(e,"__esModule",{value:!0})},n("object"==typeof e&&typeof t<"u"?e:(r=r||self).d3=r.d3||{})}}),Qb=m({"node_modules/d3-force/dist/d3-force.js"(e,t){var r,n;r=e,n=function(e,t,r,n,i){function a(e){return function(){return e}}function o(){return 1e-6*(Math.random()-.5)}function s(e){return e.x+e.vx}function l(e){return e.y+e.vy}function c(e){return e.index}function u(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function h(e){return e.x}function f(e){return e.y}var p=Math.PI*(3-Math.sqrt(5));e.forceCenter=function(e,t){var r;function n(){var n,i,a=r.length,o=0,s=0;for(n=0;n<a;++n)o+=(i=r[n]).x,s+=i.y;for(o=o/a-e,s=s/a-t,n=0;n<a;++n)(i=r[n]).x-=o,i.y-=s}return null==e&&(e=0),null==t&&(t=0),n.initialize=function(e){r=e},n.x=function(t){return arguments.length?(e=+t,n):e},n.y=function(e){return arguments.length?(t=+e,n):t},n},e.forceCollide=function(e){var r,n,i=1,c=1;function u(){for(var e,a,u,f,p,d,m,g=r.length,y=0;y<c;++y)for(a=t.quadtree(r,s,l).visitAfter(h),e=0;e<g;++e)u=r[e],d=n[u.index],m=d*d,f=u.x+u.vx,p=u.y+u.vy,a.visit(v);function v(e,t,r,n,a){var s=e.data,l=e.r,c=d+l;if(!s)return t>f+c||n<f-c||r>p+c||a<p-c;if(s.index>u.index){var h=f-s.x-s.vx,g=p-s.y-s.vy,y=h*h+g*g;y<c*c&&(0===h&&(y+=(h=o())*h),0===g&&(y+=(g=o())*g),y=(c-(y=Math.sqrt(y)))/y*i,u.vx+=(h*=y)*(c=(l*=l)/(m+l)),u.vy+=(g*=y)*c,s.vx-=h*(c=1-c),s.vy-=g*c)}}}function h(e){if(e.data)return e.r=n[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(r){var t,i,a=r.length;for(n=new Array(a),t=0;t<a;++t)i=r[t],n[i.index]=+e(i,t,r)}}return"function"!=typeof e&&(e=a(null==e?1:+e)),u.initialize=function(e){r=e,f()},u.iterations=function(e){return arguments.length?(c=+e,u):c},u.strength=function(e){return arguments.length?(i=+e,u):i},u.radius=function(t){return arguments.length?(e="function"==typeof t?t:a(+t),f(),u):e},u},e.forceLink=function(e){var t,n,i,s,l,h=c,f=function(e){return 1/Math.min(s[e.source.index],s[e.target.index])},p=a(30),d=1;function m(r){for(var i=0,a=e.length;i<d;++i)for(var s,c,u,h,f,p,m,g=0;g<a;++g)c=(s=e[g]).source,h=(u=s.target).x+u.vx-c.x-c.vx||o(),f=u.y+u.vy-c.y-c.vy||o(),h*=p=((p=Math.sqrt(h*h+f*f))-n[g])/p*r*t[g],f*=p,u.vx-=h*(m=l[g]),u.vy-=f*m,c.vx+=h*(m=1-m),c.vy+=f*m}function g(){if(i){var a,o,c=i.length,f=e.length,p=r.map(i,h);for(a=0,s=new Array(c);a<f;++a)(o=e[a]).index=a,"object"!=typeof o.source&&(o.source=u(p,o.source)),"object"!=typeof o.target&&(o.target=u(p,o.target)),s[o.source.index]=(s[o.source.index]||0)+1,s[o.target.index]=(s[o.target.index]||0)+1;for(a=0,l=new Array(f);a<f;++a)o=e[a],l[a]=s[o.source.index]/(s[o.source.index]+s[o.target.index]);t=new Array(f),y(),n=new Array(f),v()}}function y(){if(i)for(var r=0,n=e.length;r<n;++r)t[r]=+f(e[r],r,e)}function v(){if(i)for(var t=0,r=e.length;t<r;++t)n[t]=+p(e[t],t,e)}return null==e&&(e=[]),m.initialize=function(e){i=e,g()},m.links=function(t){return arguments.length?(e=t,g(),m):e},m.id=function(e){return arguments.length?(h=e,m):h},m.iterations=function(e){return arguments.length?(d=+e,m):d},m.strength=function(e){return arguments.length?(f="function"==typeof e?e:a(+e),y(),m):f},m.distance=function(e){return arguments.length?(p="function"==typeof e?e:a(+e),v(),m):p},m},e.forceManyBody=function(){var e,r,n,i,s=a(-30),l=1,c=1/0,u=.81;function p(i){var a,o=e.length,s=t.quadtree(e,h,f).visitAfter(m);for(n=i,a=0;a<o;++a)r=e[a],s.visit(g)}function d(){if(e){var t,r,n=e.length;for(i=new Array(n),t=0;t<n;++t)r=e[t],i[r.index]=+s(r,t,e)}}function m(e){var t,r,n,a,o,s=0,l=0;if(e.length){for(n=a=o=0;o<4;++o)(t=e[o])&&(r=Math.abs(t.value))&&(s+=t.value,l+=r,n+=r*t.x,a+=r*t.y);e.x=n/l,e.y=a/l}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=i[t.data.index]}while(t=t.next)}e.value=s}function g(e,t,a,s){if(!e.value)return!0;var h=e.x-r.x,f=e.y-r.y,p=s-t,d=h*h+f*f;if(p*p/u<d)return d<c&&(0===h&&(d+=(h=o())*h),0===f&&(d+=(f=o())*f),d<l&&(d=Math.sqrt(l*d)),r.vx+=h*e.value*n/d,r.vy+=f*e.value*n/d),!0;if(!(e.length||d>=c)){(e.data!==r||e.next)&&(0===h&&(d+=(h=o())*h),0===f&&(d+=(f=o())*f),d<l&&(d=Math.sqrt(l*d)));do{e.data!==r&&(p=i[e.data.index]*n/d,r.vx+=h*p,r.vy+=f*p)}while(e=e.next)}}return p.initialize=function(t){e=t,d()},p.strength=function(e){return arguments.length?(s="function"==typeof e?e:a(+e),d(),p):s},p.distanceMin=function(e){return arguments.length?(l=e*e,p):Math.sqrt(l)},p.distanceMax=function(e){return arguments.length?(c=e*e,p):Math.sqrt(c)},p.theta=function(e){return arguments.length?(u=e*e,p):Math.sqrt(u)},p},e.forceRadial=function(e,t,r){var n,i,o,s=a(.1);function l(e){for(var a=0,s=n.length;a<s;++a){var l=n[a],c=l.x-t||1e-6,u=l.y-r||1e-6,h=Math.sqrt(c*c+u*u),f=(o[a]-h)*i[a]*e/h;l.vx+=c*f,l.vy+=u*f}}function c(){if(n){var t,r=n.length;for(i=new Array(r),o=new Array(r),t=0;t<r;++t)o[t]=+e(n[t],t,n),i[t]=isNaN(o[t])?0:+s(n[t],t,n)}}return"function"!=typeof e&&(e=a(+e)),null==t&&(t=0),null==r&&(r=0),l.initialize=function(e){n=e,c()},l.strength=function(e){return arguments.length?(s="function"==typeof e?e:a(+e),c(),l):s},l.radius=function(t){return arguments.length?(e="function"==typeof t?t:a(+t),c(),l):e},l.x=function(e){return arguments.length?(t=+e,l):t},l.y=function(e){return arguments.length?(r=+e,l):r},l},e.forceSimulation=function(e){var t,a=1,o=.001,s=1-Math.pow(o,1/300),l=0,c=.6,u=r.map(),h=i.timer(d),f=n.dispatch("tick","end");function d(){m(),f.call("tick",t),a<o&&(h.stop(),f.call("end",t))}function m(r){var n,i,o=e.length;void 0===r&&(r=1);for(var h=0;h<r;++h)for(a+=(l-a)*s,u.each((function(e){e(a)})),n=0;n<o;++n)null==(i=e[n]).fx?i.x+=i.vx*=c:(i.x=i.fx,i.vx=0),null==i.fy?i.y+=i.vy*=c:(i.y=i.fy,i.vy=0);return t}function g(){for(var t,r=0,n=e.length;r<n;++r){if((t=e[r]).index=r,null!=t.fx&&(t.x=t.fx),null!=t.fy&&(t.y=t.fy),isNaN(t.x)||isNaN(t.y)){var i=10*Math.sqrt(r),a=r*p;t.x=i*Math.cos(a),t.y=i*Math.sin(a)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function y(t){return t.initialize&&t.initialize(e),t}return null==e&&(e=[]),g(),t={tick:m,restart:function(){return h.restart(d),t},stop:function(){return h.stop(),t},nodes:function(r){return arguments.length?(e=r,g(),u.each(y),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?(l=+e,t):l},velocityDecay:function(e){return arguments.length?(c=1-e,t):1-c},force:function(e,r){return arguments.length>1?(null==r?u.remove(e):u.set(e,y(r)),t):u.get(e)},find:function(t,r,n){var i,a,o,s,l,c=0,u=e.length;for(null==n?n=1/0:n*=n,c=0;c<u;++c)(o=(i=t-(s=e[c]).x)*i+(a=r-s.y)*a)<n&&(l=s,n=o);return l},on:function(e,r){return arguments.length>1?(f.on(e,r),t):f.on(e)}}},e.forceX=function(e){var t,r,n,i=a(.1);function o(e){for(var i,a=0,o=t.length;a<o;++a)(i=t[a]).vx+=(n[a]-i.x)*r[a]*e}function s(){if(t){var a,o=t.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+e(t[a],a,t))?0:+i(t[a],a,t)}}return"function"!=typeof e&&(e=a(null==e?0:+e)),o.initialize=function(e){t=e,s()},o.strength=function(e){return arguments.length?(i="function"==typeof e?e:a(+e),s(),o):i},o.x=function(t){return arguments.length?(e="function"==typeof t?t:a(+t),s(),o):e},o},e.forceY=function(e){var t,r,n,i=a(.1);function o(e){for(var i,a=0,o=t.length;a<o;++a)(i=t[a]).vy+=(n[a]-i.y)*r[a]*e}function s(){if(t){var a,o=t.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+e(t[a],a,t))?0:+i(t[a],a,t)}}return"function"!=typeof e&&(e=a(null==e?0:+e)),o.initialize=function(e){t=e,s()},o.strength=function(e){return arguments.length?(i="function"==typeof e?e:a(+e),s(),o):i},o.y=function(t){return arguments.length?(e="function"==typeof t?t:a(+t),s(),o):e},o},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&typeof t<"u"?n(e,Xb(),$b(),Kb(),Jb()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3,r.d3)}}),ew=m({"node_modules/d3-path/dist/d3-path.js"(e,t){var r,n;r=e,n=function(e){var t=Math.PI,r=2*t,n=1e-6,i=r-n;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(){null!==this._x1&&(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,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(e,t,r,n,i,a){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,r,i,a,o){e=+e,r=+r,i=+i,a=+a,o=+o;var s=this._x1,l=this._y1,c=i-e,u=a-r,h=s-e,f=l-r,p=h*h+f*f;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=r);else if(p>n)if(Math.abs(f*c-u*h)>n&&o){var d=i-s,m=a-l,g=c*c+u*u,y=d*d+m*m,v=Math.sqrt(g),x=Math.sqrt(p),_=o*Math.tan((t-Math.acos((g+p-y)/(2*v*x)))/2),b=_/x,w=_/v;Math.abs(b-1)>n&&(this._+="L"+(e+b*h)+","+(r+b*f)),this._+="A"+o+","+o+",0,0,"+ +(f*d>h*m)+","+(this._x1=e+w*c)+","+(this._y1=r+w*u)}else this._+="L"+(this._x1=e)+","+(this._y1=r)},arc:function(e,a,o,s,l,c){e=+e,a=+a,c=!!c;var u=(o=+o)*Math.cos(s),h=o*Math.sin(s),f=e+u,p=a+h,d=1^c,m=c?s-l:l-s;if(o<0)throw new Error("negative radius: "+o);null===this._x1?this._+="M"+f+","+p:(Math.abs(this._x1-f)>n||Math.abs(this._y1-p)>n)&&(this._+="L"+f+","+p),o&&(m<0&&(m=m%r+r),m>i?this._+="A"+o+","+o+",0,1,"+d+","+(e-u)+","+(a-h)+"A"+o+","+o+",0,1,"+d+","+(this._x1=f)+","+(this._y1=p):m>n&&(this._+="A"+o+","+o+",0,"+ +(m>=t)+","+d+","+(this._x1=e+o*Math.cos(l))+","+(this._y1=a+o*Math.sin(l))))},rect:function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},e.path=o,Object.defineProperty(e,"__esModule",{value:!0})},n("object"==typeof e&&typeof t<"u"?e:(r=r||self).d3=r.d3||{})}}),tw=m({"node_modules/d3-shape/dist/d3-shape.js"(e,t){var r,n;r=e,n=function(e,t){function r(e){return function(){return e}}var n=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,s=Math.min,l=Math.sin,c=Math.sqrt,u=1e-12,h=Math.PI,f=h/2,p=2*h;function d(e){return e>=1?f:e<=-1?-f:Math.asin(e)}function m(e){return e.innerRadius}function g(e){return e.outerRadius}function y(e){return e.startAngle}function v(e){return e.endAngle}function x(e){return e&&e.padAngle}function _(e,t,r,n,i,a,s){var l=e-r,u=t-n,h=(s?a:-a)/c(l*l+u*u),f=h*u,p=-h*l,d=e+f,m=t+p,g=r+f,y=n+p,v=(d+g)/2,x=(m+y)/2,_=g-d,b=y-m,w=_*_+b*b,T=i-a,k=d*y-g*m,A=(b<0?-1:1)*c(o(0,T*T*w-k*k)),M=(k*b-_*A)/w,S=(-k*_-b*A)/w,E=(k*b+_*A)/w,C=(-k*_+b*A)/w,I=M-v,L=S-x,P=E-v,z=C-x;return I*I+L*L>P*P+z*z&&(M=E,S=C),{cx:M,cy:S,x01:-f,y01:-p,x11:M*(i/T-1),y11:S*(i/T-1)}}function b(e){this._context=e}function w(e){return new b(e)}function T(e){return e[0]}function k(e){return e[1]}function A(){var e=T,n=k,i=r(!0),a=null,o=w,s=null;function l(r){var l,c,u,h=r.length,f=!1;for(null==a&&(s=o(u=t.path())),l=0;l<=h;++l)!(l<h&&i(c=r[l],l,r))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+e(c,l,r),+n(c,l,r));if(u)return s=null,u+""||null}return l.x=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),l):e},l.y=function(e){return arguments.length?(n="function"==typeof e?e:r(+e),l):n},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:r(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,null!=a&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(null==e?a=s=null:s=o(a=e),l):a},l}function M(){var e=T,n=null,i=r(0),a=k,o=r(!0),s=null,l=w,c=null;function u(r){var u,h,f,p,d,m=r.length,g=!1,y=new Array(m),v=new Array(m);for(null==s&&(c=l(d=t.path())),u=0;u<=m;++u){if(!(u<m&&o(p=r[u],u,r))===g)if(g=!g)h=u,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),f=u-1;f>=h;--f)c.point(y[f],v[f]);c.lineEnd(),c.areaEnd()}g&&(y[u]=+e(p,u,r),v[u]=+i(p,u,r),c.point(n?+n(p,u,r):y[u],a?+a(p,u,r):v[u]))}if(d)return c=null,d+""||null}function h(){return A().defined(o).curve(l).context(s)}return u.x=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),n=null,u):e},u.x0=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),u):e},u.x1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:r(+e),u):n},u.y=function(e){return arguments.length?(i="function"==typeof e?e:r(+e),a=null,u):i},u.y0=function(e){return arguments.length?(i="function"==typeof e?e:r(+e),u):i},u.y1=function(e){return arguments.length?(a=null==e?null:"function"==typeof e?e:r(+e),u):a},u.lineX0=u.lineY0=function(){return h().x(e).y(i)},u.lineY1=function(){return h().x(e).y(a)},u.lineX1=function(){return h().x(n).y(i)},u.defined=function(e){return arguments.length?(o="function"==typeof e?e:r(!!e),u):o},u.curve=function(e){return arguments.length?(l=e,null!=s&&(c=l(s)),u):l},u.context=function(e){return arguments.length?(null==e?s=c=null:c=l(s=e),u):s},u}function S(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function E(e){return e}b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var C=L(w);function I(e){this._curve=e}function L(e){function t(t){return new I(e(t))}return t._curve=e,t}function P(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(L(e)):t()._curve},e}function z(){return P(A().curve(C))}function D(){var e=M().curve(C),t=e.curve,r=e.lineX0,n=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 P(r())},delete e.lineX0,e.lineEndAngle=function(){return P(n())},delete e.lineX1,e.lineInnerRadius=function(){return P(i())},delete e.lineY0,e.lineOuterRadius=function(){return P(a())},delete e.lineY1,e.curve=function(e){return arguments.length?t(L(e)):t()._curve},e}function O(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}I.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))}};var R=Array.prototype.slice;function F(e){return e.source}function B(e){return e.target}function j(e){var n=F,i=B,a=T,o=k,s=null;function l(){var r,l=R.call(arguments),c=n.apply(this,l),u=i.apply(this,l);if(s||(s=r=t.path()),e(s,+a.apply(this,(l[0]=c,l)),+o.apply(this,l),+a.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(e){return arguments.length?(n=e,l):n},l.target=function(e){return arguments.length?(i=e,l):i},l.x=function(e){return arguments.length?(a="function"==typeof e?e:r(+e),l):a},l.y=function(e){return arguments.length?(o="function"==typeof e?e:r(+e),l):o},l.context=function(e){return arguments.length?(s=e??null,l):s},l}function N(e,t,r,n,i){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,i,n,i)}function U(e,t,r,n,i){e.moveTo(t,r),e.bezierCurveTo(t,r=(r+i)/2,n,r,n,i)}function V(e,t,r,n,i){var a=O(t,r),o=O(t,r=(r+i)/2),s=O(n,r),l=O(n,i);e.moveTo(a[0],a[1]),e.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var q={draw:function(e,t){var r=Math.sqrt(t/h);e.moveTo(r,0),e.arc(0,0,r,0,p)}},H={draw:function(e,t){var r=Math.sqrt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},G=Math.sqrt(1/3),W=2*G,Z={draw:function(e,t){var r=Math.sqrt(t/W),n=r*G;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Y=Math.sin(h/10)/Math.sin(7*h/10),X=Math.sin(p/10)*Y,$=-Math.cos(p/10)*Y,K={draw:function(e,t){var r=Math.sqrt(.8908130915292852*t),n=X*r,i=$*r;e.moveTo(0,-r),e.lineTo(n,i);for(var a=1;a<5;++a){var o=p*a/5,s=Math.cos(o),l=Math.sin(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},J={draw:function(e,t){var r=Math.sqrt(t),n=-r/2;e.rect(n,n,r,r)}},Q=Math.sqrt(3),ee={draw:function(e,t){var r=-Math.sqrt(t/(3*Q));e.moveTo(0,2*r),e.lineTo(-Q*r,-r),e.lineTo(Q*r,-r),e.closePath()}},te=-.5,re=Math.sqrt(3)/2,ne=1/Math.sqrt(12),ie=3*(ne/2+1),ae={draw:function(e,t){var r=Math.sqrt(t/ie),n=r/2,i=r*ne,a=n,o=r*ne+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(te*n-re*i,re*n+te*i),e.lineTo(te*a-re*o,re*a+te*o),e.lineTo(te*s-re*l,re*s+te*l),e.lineTo(te*n+re*i,te*i-re*n),e.lineTo(te*a+re*o,te*o-re*a),e.lineTo(te*s+re*l,te*l-re*s),e.closePath()}},oe=[q,H,Z,J,K,ee,ae];function se(){}function le(e,t,r){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+r)/6)}function ce(e){this._context=e}function ue(e){this._context=e}function he(e){this._context=e}function fe(e,t){this._basis=new ce(e),this._beta=t}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(){switch(this._point){case 3:le(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:le(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},ue.prototype={areaStart:se,areaEnd:se,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:le(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},he.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:le(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},fe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n,i=e[0],a=t[0],o=e[r]-i,s=t[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(i+n*o),this._beta*t[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var pe=function e(t){function r(e){return 1===t?new ce(e):new fe(e,t)}return r.beta=function(t){return e(+t)},r}(.85);function de(e,t,r){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-r),e._x2,e._y2)}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(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:de(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:de(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ge=function e(t){function r(e){return new me(e,t)}return r.tension=function(t){return e(+t)},r}(0);function ye(e,t){this._context=e,this._k=(1-t)/6}ye.prototype={areaStart:se,areaEnd:se,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:de(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ve=function e(t){function r(e){return new ye(e,t)}return r.tension=function(t){return e(+t)},r}(0);function xe(e,t){this._context=e,this._k=(1-t)/6}xe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:de(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var _e=function e(t){function r(e){return new xe(e,t)}return r.tension=function(t){return e(+t)},r}(0);function be(e,t,r){var n=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,l=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>u){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/h,o=(o*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(n,i,a,o,e._x2,e._y2)}function we(e,t){this._context=e,this._alpha=t}we.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:be(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Te=function e(t){function r(e){return t?new we(e,t):new me(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function ke(e,t){this._context=e,this._alpha=t}ke.prototype={areaStart:se,areaEnd:se,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:be(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Ae=function e(t){function r(e){return t?new ke(e,t):new ye(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function Me(e,t){this._context=e,this._alpha=t}Me.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:be(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Se=function e(t){function r(e){return t?new Me(e,t):new xe(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function Ee(e){this._context=e}function Ce(e){return e<0?-1:1}function Ie(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Ce(a)+Ce(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Le(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Pe(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function ze(e){this._context=e}function De(e){this._context=new Oe(e)}function Oe(e){this._context=e}function Re(e){this._context=e}function Fe(e){var t,r,n=e.length-1,i=new Array(n),a=new Array(n),o=new 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 Be(e,t){this._context=e,this._t=t}function je(e,t){if((i=e.length)>1)for(var r,n,i,a=1,o=e[t[0]],s=o.length;a<i;++a)for(n=o,o=e[t[a]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(n[r][1])?n[r][0]:n[r][1]}function Ne(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Ue(e,t){return e[t]}function Ve(e){var t=e.map(qe);return Ne(e).sort((function(e,r){return t[e]-t[r]}))}function qe(e){for(var t,r=-1,n=0,i=e.length,a=-1/0;++r<i;)(t=+e[r][1])>a&&(a=t,n=r);return n}function He(e){var t=e.map(Ge);return Ne(e).sort((function(e,r){return t[e]-t[r]}))}function Ge(e){for(var t,r=0,n=-1,i=e.length;++n<i;)(t=+e[n][1])&&(r+=t);return r}Ee.prototype={areaStart:se,areaEnd:se,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))}},ze.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:Pe(this,this._t0,Le(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Pe(this,Le(this,r=Ie(this,e,t)),r);break;default:Pe(this,this._t0,r=Ie(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}},(De.prototype=Object.create(ze.prototype)).point=function(e,t){ze.prototype.point.call(this,t,e)},Oe.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,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}},Re.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===r)this._context.lineTo(e[1],t[1]);else for(var n=Fe(e),i=Fe(t),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[o],t[o]);(this._line||0!==this._line&&1===r)&&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)}},Be.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&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}}this._x=e,this._y=t}},e.arc=function(){var e=m,o=g,b=r(0),w=null,T=y,k=v,A=x,M=null;function S(){var r,m,g=+e.apply(this,arguments),y=+o.apply(this,arguments),v=T.apply(this,arguments)-f,x=k.apply(this,arguments)-f,S=n(x-v),E=x>v;if(M||(M=r=t.path()),y<g&&(m=y,y=g,g=m),y>u)if(S>p-u)M.moveTo(y*a(v),y*l(v)),M.arc(0,0,y,v,x,!E),g>u&&(M.moveTo(g*a(x),g*l(x)),M.arc(0,0,g,x,v,E));else{var C,I,L=v,P=x,z=v,D=x,O=S,R=S,F=A.apply(this,arguments)/2,B=F>u&&(w?+w.apply(this,arguments):c(g*g+y*y)),j=s(n(y-g)/2,+b.apply(this,arguments)),N=j,U=j;if(B>u){var V=d(B/g*l(F)),q=d(B/y*l(F));(O-=2*V)>u?(z+=V*=E?1:-1,D-=V):(O=0,z=D=(v+x)/2),(R-=2*q)>u?(L+=q*=E?1:-1,P-=q):(R=0,L=P=(v+x)/2)}var H=y*a(L),G=y*l(L),W=g*a(D),Z=g*l(D);if(j>u){var Y,X=y*a(P),$=y*l(P),K=g*a(z),J=g*l(z);if(S<h&&(Y=function(e,t,r,n,i,a,o,s){var l=r-e,c=n-t,h=o-i,f=s-a,p=f*l-h*c;if(!(p*p<u))return[e+(p=(h*(t-a)-f*(e-i))/p)*l,t+p*c]}(H,G,K,J,X,$,W,Z))){var Q=H-Y[0],ee=G-Y[1],te=X-Y[0],re=$-Y[1],ne=1/l(function(e){return e>1?0:e<-1?h:Math.acos(e)}((Q*te+ee*re)/(c(Q*Q+ee*ee)*c(te*te+re*re)))/2),ie=c(Y[0]*Y[0]+Y[1]*Y[1]);N=s(j,(g-ie)/(ne-1)),U=s(j,(y-ie)/(ne+1))}}R>u?U>u?(C=_(K,J,H,G,y,U,E),I=_(X,$,W,Z,y,U,E),M.moveTo(C.cx+C.x01,C.cy+C.y01),U<j?M.arc(C.cx,C.cy,U,i(C.y01,C.x01),i(I.y01,I.x01),!E):(M.arc(C.cx,C.cy,U,i(C.y01,C.x01),i(C.y11,C.x11),!E),M.arc(0,0,y,i(C.cy+C.y11,C.cx+C.x11),i(I.cy+I.y11,I.cx+I.x11),!E),M.arc(I.cx,I.cy,U,i(I.y11,I.x11),i(I.y01,I.x01),!E))):(M.moveTo(H,G),M.arc(0,0,y,L,P,!E)):M.moveTo(H,G),g>u&&O>u?N>u?(C=_(W,Z,X,$,g,-N,E),I=_(H,G,K,J,g,-N,E),M.lineTo(C.cx+C.x01,C.cy+C.y01),N<j?M.arc(C.cx,C.cy,N,i(C.y01,C.x01),i(I.y01,I.x01),!E):(M.arc(C.cx,C.cy,N,i(C.y01,C.x01),i(C.y11,C.x11),!E),M.arc(0,0,g,i(C.cy+C.y11,C.cx+C.x11),i(I.cy+I.y11,I.cx+I.x11),E),M.arc(I.cx,I.cy,N,i(I.y11,I.x11),i(I.y01,I.x01),!E))):M.arc(0,0,g,D,z,E):M.lineTo(W,Z)}else M.moveTo(0,0);if(M.closePath(),r)return M=null,r+""||null}return S.centroid=function(){var t=(+e.apply(this,arguments)+ +o.apply(this,arguments))/2,r=(+T.apply(this,arguments)+ +k.apply(this,arguments))/2-h/2;return[a(r)*t,l(r)*t]},S.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),S):e},S.outerRadius=function(e){return arguments.length?(o="function"==typeof e?e:r(+e),S):o},S.cornerRadius=function(e){return arguments.length?(b="function"==typeof e?e:r(+e),S):b},S.padRadius=function(e){return arguments.length?(w=null==e?null:"function"==typeof e?e:r(+e),S):w},S.startAngle=function(e){return arguments.length?(T="function"==typeof e?e:r(+e),S):T},S.endAngle=function(e){return arguments.length?(k="function"==typeof e?e:r(+e),S):k},S.padAngle=function(e){return arguments.length?(A="function"==typeof e?e:r(+e),S):A},S.context=function(e){return arguments.length?(M=e??null,S):M},S},e.area=M,e.areaRadial=D,e.curveBasis=function(e){return new ce(e)},e.curveBasisClosed=function(e){return new ue(e)},e.curveBasisOpen=function(e){return new he(e)},e.curveBundle=pe,e.curveCardinal=ge,e.curveCardinalClosed=ve,e.curveCardinalOpen=_e,e.curveCatmullRom=Te,e.curveCatmullRomClosed=Ae,e.curveCatmullRomOpen=Se,e.curveLinear=w,e.curveLinearClosed=function(e){return new Ee(e)},e.curveMonotoneX=function(e){return new ze(e)},e.curveMonotoneY=function(e){return new De(e)},e.curveNatural=function(e){return new Re(e)},e.curveStep=function(e){return new Be(e,.5)},e.curveStepAfter=function(e){return new Be(e,1)},e.curveStepBefore=function(e){return new Be(e,0)},e.line=A,e.lineRadial=z,e.linkHorizontal=function(){return j(N)},e.linkRadial=function(){var e=j(V);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e},e.linkVertical=function(){return j(U)},e.pie=function(){var e=E,t=S,n=null,i=r(0),a=r(p),o=r(0);function s(r){var s,l,c,u,h,f=r.length,d=0,m=new Array(f),g=new Array(f),y=+i.apply(this,arguments),v=Math.min(p,Math.max(-p,a.apply(this,arguments)-y)),x=Math.min(Math.abs(v)/f,o.apply(this,arguments)),_=x*(v<0?-1:1);for(s=0;s<f;++s)(h=g[m[s]=s]=+e(r[s],s,r))>0&&(d+=h);for(null!=t?m.sort((function(e,r){return t(g[e],g[r])})):null!=n&&m.sort((function(e,t){return n(r[e],r[t])})),s=0,c=d?(v-f*_)/d:0;s<f;++s,y=u)l=m[s],u=y+((h=g[l])>0?h*c:0)+_,g[l]={data:r[l],index:s,value:h,startAngle:y,endAngle:u,padAngle:x};return g}return s.value=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:r(+e),s):i},s.endAngle=function(e){return arguments.length?(a="function"==typeof e?e:r(+e),s):a},s.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:r(+e),s):o},s},e.pointRadial=O,e.radialArea=D,e.radialLine=z,e.stack=function(){var e=r([]),t=Ne,n=je,i=Ue;function a(r){var a,o,s=e.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(a=0;a<c;++a){for(var h,f=s[a],p=u[a]=new Array(l),d=0;d<l;++d)p[d]=h=[0,+i(r[d],f,d,r)],h.data=r[d];p.key=f}for(a=0,o=t(u);a<c;++a)u[o[a]].index=a;return n(u,o),u}return a.keys=function(t){return arguments.length?(e="function"==typeof t?t:r(R.call(t)),a):e},a.value=function(e){return arguments.length?(i="function"==typeof e?e:r(+e),a):i},a.order=function(e){return arguments.length?(t=null==e?Ne:"function"==typeof e?e:r(R.call(e)),a):t},a.offset=function(e){return arguments.length?(n=e??je,a):n},a},e.stackOffsetDiverging=function(e,t){if((s=e.length)>0)for(var r,n,i,a,o,s,l=0,c=e[t[0]].length;l<c;++l)for(a=o=0,r=0;r<s;++r)(i=(n=e[t[r]][l])[1]-n[0])>0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):(n[0]=0,n[1]=i)},e.stackOffsetExpand=function(e,t){if((n=e.length)>0){for(var r,n,i,a=0,o=e[0].length;a<o;++a){for(i=r=0;r<n;++r)i+=e[r][a][1]||0;if(i)for(r=0;r<n;++r)e[r][a][1]/=i}je(e,t)}},e.stackOffsetNone=je,e.stackOffsetSilhouette=function(e,t){if((r=e.length)>0){for(var r,n=0,i=e[t[0]],a=i.length;n<a;++n){for(var o=0,s=0;o<r;++o)s+=e[o][n][1]||0;i[n][1]+=i[n][0]=-s/2}je(e,t)}},e.stackOffsetWiggle=function(e,t){if((i=e.length)>0&&(n=(r=e[t[0]]).length)>0){for(var r,n,i,a=0,o=1;o<n;++o){for(var s=0,l=0,c=0;s<i;++s){for(var u=e[t[s]],h=u[o][1]||0,f=(h-(u[o-1][1]||0))/2,p=0;p<s;++p){var d=e[t[p]];f+=(d[o][1]||0)-(d[o-1][1]||0)}l+=h,c+=f*h}r[o-1][1]+=r[o-1][0]=a,l&&(a-=c/l)}r[o-1][1]+=r[o-1][0]=a,je(e,t)}},e.stackOrderAppearance=Ve,e.stackOrderAscending=He,e.stackOrderDescending=function(e){return He(e).reverse()},e.stackOrderInsideOut=function(e){var t,r,n=e.length,i=e.map(Ge),a=Ve(e),o=0,s=0,l=[],c=[];for(t=0;t<n;++t)r=a[t],o<s?(o+=i[r],l.push(r)):(s+=i[r],c.push(r));return c.reverse().concat(l)},e.stackOrderNone=Ne,e.stackOrderReverse=function(e){return Ne(e).reverse()},e.symbol=function(){var e=r(q),n=r(64),i=null;function a(){var r;if(i||(i=r=t.path()),e.apply(this,arguments).draw(i,+n.apply(this,arguments)),r)return i=null,r+""||null}return a.type=function(t){return arguments.length?(e="function"==typeof t?t:r(t),a):e},a.size=function(e){return arguments.length?(n="function"==typeof e?e:r(+e),a):n},a.context=function(e){return arguments.length?(i=e??null,a):i},a},e.symbolCircle=q,e.symbolCross=H,e.symbolDiamond=Z,e.symbolSquare=J,e.symbolStar=K,e.symbolTriangle=ee,e.symbolWye=ae,e.symbols=oe,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&typeof t<"u"?n(e,ew()):n((r=r||self).d3=r.d3||{},r.d3)}}),rw=m({"node_modules/@plotly/d3-sankey/build/d3-sankey.js"(e,t){var r,n;r=e,n=function(e,t,r,n){function i(e){return e.target.depth}function a(e,t){return e.sourceLinks.length?e.depth:t-1}function o(e){return function(){return e}}function s(e,t){return c(e.source,t.source)||e.index-t.index}function l(e,t){return c(e.target,t.target)||e.index-t.index}function c(e,t){return e.y0-t.y0}function u(e){return e.value}function h(e){return(e.y0+e.y1)/2}function f(e){return h(e.source)*e.value}function p(e){return h(e.target)*e.value}function d(e){return e.index}function m(e){return e.nodes}function g(e){return e.links}function y(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function v(e){return[e.source.x1,e.y0]}function x(e){return[e.target.x0,e.y1]}e.sankey=function(){var e=0,n=0,i=1,v=1,x=24,_=8,b=d,w=a,T=m,k=g,A=32,M=2/3;function S(){var a={nodes:T.apply(null,arguments),links:k.apply(null,arguments)};return function(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=r.map(e.nodes,b);e.links.forEach((function(e,r){e.index=r;var n=e.source,i=e.target;"object"!=typeof n&&(n=e.source=y(t,n)),"object"!=typeof i&&(i=e.target=y(t,i)),n.sourceLinks.push(e),i.targetLinks.push(e)}))}(a),function(e){e.nodes.forEach((function(e){e.value=Math.max(t.sum(e.sourceLinks,u),t.sum(e.targetLinks,u))}))}(a),function(t){var r,n,a;for(r=t.nodes,n=[],a=0;r.length;++a,r=n,n=[])r.forEach((function(e){e.depth=a,e.sourceLinks.forEach((function(e){n.indexOf(e.target)<0&&n.push(e.target)}))}));for(r=t.nodes,n=[],a=0;r.length;++a,r=n,n=[])r.forEach((function(e){e.height=a,e.targetLinks.forEach((function(e){n.indexOf(e.source)<0&&n.push(e.source)}))}));var o=(i-e-x)/(a-1);t.nodes.forEach((function(t){t.x1=(t.x0=e+Math.max(0,Math.min(a-1,Math.floor(w.call(null,t,a))))*o)+x}))}(a),function(e){var i=r.nest().key((function(e){return e.x0})).sortKeys(t.ascending).entries(e.nodes).map((function(e){return e.values}));(function(){var r=t.max(i,(function(e){return e.length})),a=M*(v-n)/(r-1);_>a&&(_=a);var o=t.min(i,(function(e){return(v-n-(e.length-1)*_)/t.sum(e,u)}));i.forEach((function(e){e.forEach((function(e,t){e.y1=(e.y0=t)+e.value*o}))})),e.links.forEach((function(e){e.width=e.value*o}))})(),d();for(var a=1,o=A;o>0;--o)l(a*=.99),d(),s(a),d();function s(e){i.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(t.sum(r.targetLinks,f)/t.sum(r.targetLinks,u)-h(r))*e;r.y0+=n,r.y1+=n}}))}))}function l(e){i.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(t.sum(r.sourceLinks,p)/t.sum(r.sourceLinks,u)-h(r))*e;r.y0+=n,r.y1+=n}}))}))}function d(){i.forEach((function(e){var t,r,i,a=n,o=e.length;for(e.sort(c),i=0;i<o;++i)(r=a-(t=e[i]).y0)>0&&(t.y0+=r,t.y1+=r),a=t.y1+_;if((r=a-_-v)>0)for(a=t.y0-=r,t.y1-=r,i=o-2;i>=0;--i)(r=(t=e[i]).y1+_-a)>0&&(t.y0-=r,t.y1-=r),a=t.y0}))}}(a),E(a),a}function E(e){e.nodes.forEach((function(e){e.sourceLinks.sort(l),e.targetLinks.sort(s)})),e.nodes.forEach((function(e){var t=e.y0,r=t;e.sourceLinks.forEach((function(e){e.y0=t+e.width/2,t+=e.width})),e.targetLinks.forEach((function(e){e.y1=r+e.width/2,r+=e.width}))}))}return S.update=function(e){return E(e),e},S.nodeId=function(e){return arguments.length?(b="function"==typeof e?e:o(e),S):b},S.nodeAlign=function(e){return arguments.length?(w="function"==typeof e?e:o(e),S):w},S.nodeWidth=function(e){return arguments.length?(x=+e,S):x},S.nodePadding=function(e){return arguments.length?(_=+e,S):_},S.nodes=function(e){return arguments.length?(T="function"==typeof e?e:o(e),S):T},S.links=function(e){return arguments.length?(k="function"==typeof e?e:o(e),S):k},S.size=function(t){return arguments.length?(e=n=0,i=+t[0],v=+t[1],S):[i-e,v-n]},S.extent=function(t){return arguments.length?(e=+t[0][0],i=+t[1][0],n=+t[0][1],v=+t[1][1],S):[[e,n],[i,v]]},S.iterations=function(e){return arguments.length?(A=+e,S):A},S},e.sankeyCenter=function(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?t.min(e.sourceLinks,i)-1:0},e.sankeyLeft=function(e){return e.depth},e.sankeyRight=function(e,t){return t-1-e.height},e.sankeyJustify=a,e.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(v).target(x)},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&typeof t<"u"?n(e,Eg(),$b(),tw()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3)}}),nw=m({"node_modules/elementary-circuits-directed-graph/johnson.js"(e,t){var r=Zb();t.exports=function(e,t){var n,i=[],a=[],o=[],s={},l=[];function c(e){o[e]=!1,s.hasOwnProperty(e)&&Object.keys(s[e]).forEach((function(t){delete s[e][t],o[t]&&c(t)}))}function u(e){var t,r,i=!1;for(a.push(e),o[e]=!0,t=0;t<l[e].length;t++)(r=l[e][t])===n?(h(n,a),i=!0):o[r]||(i=u(r));if(i)c(e);else for(t=0;t<l[e].length;t++){r=l[e][t];var f=s[r];f||(f={},s[r]=f),f[r]=!0}return a.pop(),i}function h(e,r){var n=[].concat(r).concat(e);t?t(u):i.push(n)}function f(t){!function(t){for(var r=0;r<e.length;r++)r<t&&(e[r]=[]),e[r]=e[r].filter((function(e){return e>=t}))}(t);for(var n,i=r(e).components.filter((function(e){return e.length>1})),a=1/0,o=0;o<i.length;o++)for(var s=0;s<i[o].length;s++)i[o][s]<a&&(a=i[o][s],n=o);var l=i[n];return!!l&&{leastVertex:a,adjList:e.map((function(e,t){return-1===l.indexOf(t)?[]:e.filter((function(e){return-1!==l.indexOf(e)}))}))}}n=0;for(var p=e.length;n<p;){var d=f(n);if(n=d.leastVertex,l=d.adjList){for(var m=0;m<l.length;m++)for(var g=0;g<l[m].length;g++){var y=l[m][g];o[+y]=!1,s[y]={}}u(n),n+=1}else n=p}if(!t)return i}}}),iw=m({"node_modules/@plotly/d3-sankey-circular/dist/d3-sankey-circular.js"(e,t){var r,n;r=e,n=function(e,t,r,n,i){function a(e){return e.target.depth}function o(e,t){return e.sourceLinks.length?e.depth:t-1}function s(e){return function(){return e}}i=i&&i.hasOwnProperty("default")?i.default:i;var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function c(e,t){return h(e.source,t.source)||e.index-t.index}function u(e,t){return h(e.target,t.target)||e.index-t.index}function h(e,t){return e.partOfCycle===t.partOfCycle?e.y0-t.y0:"top"===e.circularLinkType||"bottom"===t.circularLinkType?-1:1}function f(e){return e.value}function p(e){return(e.y0+e.y1)/2}function d(e){return p(e.source)}function m(e){return p(e.target)}function g(e){return e.index}function y(e){return e.nodes}function v(e){return e.links}function x(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function _(e,t){return t(e)}var b=25,w=10;function T(e,t){var r=0,n=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=r<n?"top":"bottom","top"==i.circularLinkType?r+=1:n+=1,e.nodes.forEach((function(e){(_(e,t)==_(i.source,t)||_(e,t)==_(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),W(e,t)&&(e.circularLinkType=e.source.circularLinkType))}))}function k(e){var t=Math.abs(e.y1-e.y0),r=Math.abs(e.target.x0-e.source.x1);return Math.atan(r/t)}function A(e,t){return!(e.source.column<t.target.column||e.target.column>t.source.column)}function M(e,t){var r=0;e.sourceLinks.forEach((function(e){r=e.circular&&!W(e,t)?r+1:r}));var n=0;return e.targetLinks.forEach((function(e){n=e.circular&&!W(e,t)?n+1:n})),r+n}function S(e){var t=e.source.sourceLinks,r=0;t.forEach((function(e){r=e.circular?r+1:r}));var n=e.target.targetLinks,i=0;return n.forEach((function(e){i=e.circular?i+1:i})),!(r>1||i>1)}function E(e,t,r){return e.sort(I),e.forEach((function(n,i){var a=0;if(W(n,r)&&S(n))n.circularPathData.verticalBuffer=a+n.width/2;else{for(var o=0;o<i;o++)if(A(e[i],e[o])){var s=e[o].circularPathData.verticalBuffer+e[o].width/2+t;a=s>a?s:a}n.circularPathData.verticalBuffer=a+n.width/2}})),e}function C(e,r,i,a){var o=t.min(e.links,(function(e){return e.source.y0}));e.links.forEach((function(e){e.circular&&(e.circularPathData={})})),E(e.links.filter((function(e){return"top"==e.circularLinkType})),r,a),E(e.links.filter((function(e){return"bottom"==e.circularLinkType})),r,a),e.links.forEach((function(t){if(t.circular){if(t.circularPathData.arcRadius=t.width+w,t.circularPathData.leftNodeBuffer=5,t.circularPathData.rightNodeBuffer=5,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,W(t,a)&&S(t))t.circularPathData.leftSmallArcRadius=w+t.width/2,t.circularPathData.leftLargeArcRadius=w+t.width/2,t.circularPathData.rightSmallArcRadius=w+t.width/2,t.circularPathData.rightLargeArcRadius=w+t.width/2,"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=t.source.y1+b+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-b-t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius);else{var s=t.source.column,l=t.circularLinkType,c=e.links.filter((function(e){return e.source.column==s&&e.circularLinkType==l}));"bottom"==t.circularLinkType?c.sort(P):c.sort(L);var u=0;c.forEach((function(e,n){e.circularLinkID==t.circularLinkID&&(t.circularPathData.leftSmallArcRadius=w+t.width/2+u,t.circularPathData.leftLargeArcRadius=w+t.width/2+n*r+u),u+=e.width})),s=t.target.column,c=e.links.filter((function(e){return e.target.column==s&&e.circularLinkType==l})),"bottom"==t.circularLinkType?c.sort(D):c.sort(z),u=0,c.forEach((function(e,n){e.circularLinkID==t.circularLinkID&&(t.circularPathData.rightSmallArcRadius=w+t.width/2+u,t.circularPathData.rightLargeArcRadius=w+t.width/2+n*r+u),u+=e.width})),"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=Math.max(i,t.source.y1,t.target.y1)+b+t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius):(t.circularPathData.verticalFullExtent=o-b-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}if(t.circular)t.path=function(e){return"top"==e.circularLinkType?"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);else{var h=n.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.path=h(t)}}))}function I(e,t){return O(e)==O(t)?"bottom"==e.circularLinkType?P(e,t):L(e,t):O(t)-O(e)}function L(e,t){return e.y0-t.y0}function P(e,t){return t.y0-e.y0}function z(e,t){return e.y1-t.y1}function D(e,t){return t.y1-e.y1}function O(e){return e.target.column-e.source.column}function R(e){return e.target.x0-e.source.x1}function F(e,t){var r=k(e),n=R(t)/Math.tan(r);return"up"==G(e)?e.y1+n:e.y1-n}function B(e,t){var r=k(e),n=R(t)/Math.tan(r);return"up"==G(e)?e.y1-n:e.y1+n}function j(e,t,r,n){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,l=o-a+1;for(s=1;a<=o;a++,s++)e.nodes.forEach((function(o){if(o.column==a){var c,u=s/(l+1),h=Math.pow(1-u,3),f=3*u*Math.pow(1-u,2),p=3*Math.pow(u,2)*(1-u),d=Math.pow(u,3),m=h*i.y0+f*i.y0+p*i.y1+d*i.y1,g=m-i.width/2,y=m+i.width/2;g>o.y0&&g<o.y1?(c=o.y1-g+10,c="bottom"==o.circularLinkType?c:-c,o=U(o,c,t,r),e.nodes.forEach((function(e){_(e,n)==_(o,n)||e.column!=o.column||N(o,e)&&U(e,c,t,r)}))):(y>o.y0&&y<o.y1||g<o.y0&&y>o.y1)&&(c=y-o.y0+10,o=U(o,c,t,r),e.nodes.forEach((function(e){_(e,n)==_(o,n)||e.column!=o.column||e.y0<o.y1&&e.y1>o.y1&&U(e,c,t,r)})))}}))}}))}function N(e,t){return e.y0>t.y0&&e.y0<t.y1||e.y1>t.y0&&e.y1<t.y1||e.y0<t.y0&&e.y1>t.y1}function U(e,t,r,n){return e.y0+t>=r&&e.y1+t<=n&&(e.y0=e.y0+t,e.y1=e.y1+t,e.targetLinks.forEach((function(e){e.y1=e.y1+t})),e.sourceLinks.forEach((function(e){e.y0=e.y0+t}))),e}function V(e,t,r,n){e.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>t&&(i.y=i.y-(i.y+(i.y1-i.y0)-t));var a=e.links.filter((function(e){return _(e.source,r)==_(i,r)})),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(!H(e,t))return e.y1-t.y1;if(e.target.column>t.target.column){var r=B(t,e);return e.y1-r}if(t.target.column>e.target.column)return B(e,t)-t.y1}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.target.column===t.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.target.column===t.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:"top"==e.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(e){e.y0=s+e.width/2,s+=e.width})),a.forEach((function(e,t){if("bottom"==e.circularLinkType){for(var r=t+1,n=0;r<o;r++)n+=a[r].width;e.y0=i.y1-n-e.width/2}}))}))}function q(e,t,r){e.nodes.forEach((function(t){var n=e.links.filter((function(e){return _(e.target,r)==_(t,r)})),i=n.length;i>1&&n.sort((function(e,t){if(!e.circular&&!t.circular){if(e.source.column==t.source.column)return e.y0-t.y0;if(!H(e,t))return e.y0-t.y0;if(t.source.column<e.source.column){var r=F(t,e);return e.y0-r}if(e.source.column<t.source.column)return F(e,t)-t.y0}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.source.column===t.source.column?e.source.y1-t.source.y1:e.source.column-t.source.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.source.column===t.source.column?e.source.y1-t.source.y1:t.source.column-e.source.column:"top"==e.circularLinkType?-1:1:void 0}));var a=t.y0;n.forEach((function(e){e.y1=a+e.width/2,a+=e.width})),n.forEach((function(e,r){if("bottom"==e.circularLinkType){for(var a=r+1,o=0;a<i;a++)o+=n[a].width;e.y1=t.y1-o-e.width/2}}))}))}function H(e,t){return G(e)==G(t)}function G(e){return e.y0-e.y1>0?"up":"down"}function W(e,t){return _(e.source,t)==_(e.target,t)}e.sankeyCircular=function(){var e,n,a=0,_=0,k=1,A=1,S=24,E=g,I=o,L=y,P=v,z=32,D=2,O=null;function R(){var o={nodes:L.apply(null,arguments),links:P.apply(null,arguments)};(function(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=r.map(e.nodes,E);e.links.forEach((function(e,r){e.index=r;var n=e.source,i=e.target;"object"!==(typeof n>"u"?"undefined":l(n))&&(n=e.source=x(t,n)),"object"!==(typeof i>"u"?"undefined":l(i))&&(i=e.target=x(t,i)),n.sourceLinks.push(e),i.targetLinks.push(e)}))})(o),function(e,t,r){var n=0;if(null===r){for(var a=[],o=0;o<e.links.length;o++){var s=e.links[o],l=s.source.index,c=s.target.index;a[l]||(a[l]=[]),a[c]||(a[c]=[]),-1===a[l].indexOf(c)&&a[l].push(c)}var u=i(a);u.sort((function(e,t){return e.length-t.length}));var h={};for(o=0;o<u.length;o++){var f=u[o].slice(-2);h[f[0]]||(h[f[0]]={}),h[f[0]][f[1]]=!0}e.links.forEach((function(e){var t=e.target.index,r=e.source.index;t===r||h[r]&&h[r][t]?(e.circular=!0,e.circularLinkID=n,n+=1):e.circular=!1}))}else e.links.forEach((function(e){e.source[r]<e.target[r]?e.circular=!1:(e.circular=!0,e.circularLinkID=n,n+=1)}))}(o,0,O),function(e){e.nodes.forEach((function(e){e.partOfCycle=!1,e.value=Math.max(t.sum(e.sourceLinks,f),t.sum(e.targetLinks,f)),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)}))}))}(o),function(e){var t,r,n;for(t=e.nodes,r=[],n=0;t.length;++n,t=r,r=[])t.forEach((function(e){e.depth=n,e.sourceLinks.forEach((function(e){r.indexOf(e.target)<0&&!e.circular&&r.push(e.target)}))}));for(t=e.nodes,r=[],n=0;t.length;++n,t=r,r=[])t.forEach((function(e){e.height=n,e.targetLinks.forEach((function(e){r.indexOf(e.source)<0&&!e.circular&&r.push(e.source)}))}));e.nodes.forEach((function(e){e.column=Math.floor(I.call(null,e,n))}))}(o),T(o,E),function(i,o,s){var l=r.nest().key((function(e){return e.column})).sortKeys(t.ascending).entries(i.nodes).map((function(e){return e.values}));(function(r){if(n){var o=1/0;l.forEach((function(e){var t=A*n/(e.length+1);o=t<o?t:o})),e=o}var s=t.min(l,(function(r){return(A-_-(r.length-1)*e)/t.sum(r,f)}));s*=.3,i.links.forEach((function(e){e.width=e.value*s}));var c=function(e){var r=0,n=0,i=0,a=0,o=t.max(e.nodes,(function(e){return e.column}));return e.links.forEach((function(e){e.circular&&("top"==e.circularLinkType?r+=e.width:n+=e.width,0==e.target.column&&(a+=e.width),e.source.column==o&&(i+=e.width))})),{top:r=r>0?r+b+w:r,bottom:n=n>0?n+b+w:n,left:a=a>0?a+b+w:a,right:i=i>0?i+b+w:i}}(i),u=function(e,r){var n=t.max(e.nodes,(function(e){return e.column})),i=k-a,o=A-_,s=i/(i+r.right+r.left),l=o/(o+r.top+r.bottom);return a=a*s+r.left,k=0==r.right?k:k*s,_=_*l+r.top,A*=l,e.nodes.forEach((function(e){e.x0=a+e.column*((k-a-S)/n),e.x1=e.x0+S})),l}(i,c);s*=u,i.links.forEach((function(e){e.width=e.value*s})),l.forEach((function(e){var t=e.length;e.forEach((function(e,n){e.depth==l.length-1&&1==t||0==e.depth&&1==t?(e.y0=A/2-e.value*s,e.y1=e.y0+e.value*s):e.partOfCycle?0==M(e,r)?(e.y0=A/2+n,e.y1=e.y0+e.value*s):"top"==e.circularLinkType?(e.y0=_+n,e.y1=e.y0+e.value*s):(e.y0=A-e.value*s-n,e.y1=e.y0+e.value*s):0==c.top||0==c.bottom?(e.y0=(A-_)/t*n,e.y1=e.y0+e.value*s):(e.y0=(A-_)/2-t/2+n,e.y1=e.y0+e.value*s)}))}))})(s),y();for(var c=1,u=o;u>0;--u)g(c*=.99,s),y();function g(e,r){var n=l.length;l.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if((i.sourceLinks.length||i.targetLinks.length)&&!(i.partOfCycle&&M(i,r)>0))if(0==o&&1==a)s=i.y1-i.y0,i.y0=A/2-s/2,i.y1=A/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=A/2-s/2,i.y1=A/2+s/2;else{var l=t.mean(i.sourceLinks,m),c=t.mean(i.targetLinks,d),u=((l&&c?(l+c)/2:l||c)-p(i))*e;i.y0+=u,i.y1+=u}}))}))}function y(){l.forEach((function(t){var r,n,i,a=_,o=t.length;for(t.sort(h),i=0;i<o;++i)(n=a-(r=t[i]).y0)>0&&(r.y0+=n,r.y1+=n),a=r.y1+e;if((n=a-e-A)>0)for(a=r.y0-=n,r.y1-=n,i=o-2;i>=0;--i)(n=(r=t[i]).y1+e-a)>0&&(r.y0-=n,r.y1-=n),a=r.y0}))}}(o,z,E),F(o);for(var s=0;s<4;s++)V(o,A,E),q(o,0,E),j(o,_,A,E),V(o,A,E),q(o,0,E);return function(e,r,n){var i=e.nodes,a=e.links,o=!1,s=!1;if(a.forEach((function(e){"top"==e.circularLinkType?o=!0:"bottom"==e.circularLinkType&&(s=!0)})),0==o||0==s){var l=t.min(i,(function(e){return e.y0})),c=t.max(i,(function(e){return e.y1})),u=(n-r)/(c-l);i.forEach((function(e){var t=(e.y1-e.y0)*u;e.y0=(e.y0-l)*u,e.y1=e.y0+t})),a.forEach((function(e){e.y0=(e.y0-l)*u,e.y1=(e.y1-l)*u,e.width=e.width*u}))}}(o,_,A),C(o,D,A,E),o}function F(e){e.nodes.forEach((function(e){e.sourceLinks.sort(u),e.targetLinks.sort(c)})),e.nodes.forEach((function(e){var t=e.y0,r=t,n=e.y1,i=n;e.sourceLinks.forEach((function(e){e.circular?(e.y0=n-e.width/2,n-=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=r+e.width/2,r+=e.width)}))}))}return R.nodeId=function(e){return arguments.length?(E="function"==typeof e?e:s(e),R):E},R.nodeAlign=function(e){return arguments.length?(I="function"==typeof e?e:s(e),R):I},R.nodeWidth=function(e){return arguments.length?(S=+e,R):S},R.nodePadding=function(t){return arguments.length?(e=+t,R):e},R.nodes=function(e){return arguments.length?(L="function"==typeof e?e:s(e),R):L},R.links=function(e){return arguments.length?(P="function"==typeof e?e:s(e),R):P},R.size=function(e){return arguments.length?(a=_=0,k=+e[0],A=+e[1],R):[k-a,A-_]},R.extent=function(e){return arguments.length?(a=+e[0][0],k=+e[1][0],_=+e[0][1],A=+e[1][1],R):[[a,_],[k,A]]},R.iterations=function(e){return arguments.length?(z=+e,R):z},R.circularLinkGap=function(e){return arguments.length?(D=+e,R):D},R.nodePaddingRatio=function(e){return arguments.length?(n=+e,R):n},R.sortNodes=function(e){return arguments.length?(O=e,R):O},R.update=function(e){return T(e,E),F(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)})),V(e,A,E,!1),q(e,0,E),C(e,D,A,E),e},R},e.sankeyCenter=function(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?t.min(e.sourceLinks,a)-1:0},e.sankeyLeft=function(e){return e.depth},e.sankeyRight=function(e,t){return t-1-e.height},e.sankeyJustify=o,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&typeof t<"u"?n(e,Eg(),$b(),tw(),nw()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3,null)}}),aw=m({"src/traces/sankey/constants.js"(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"}}}}),ow=m({"src/traces/sankey/render.js"(e,t){var r=Qb(),n=(td(),v(ed)).interpolateNumber,i=b(),a=rw(),o=iw(),s=aw(),l=F(),c=W(),u=er(),h=ct(),f=h.strTranslate,p=h.strRotate,d=Kx(),m=d.keyFun,g=d.repeat,y=d.unwrap,x=Et(),_=He(),w=St(),T=w.CAP_SHIFT,k=w.LINE_SPACING;function A(e,t,r){var n,i=y(t),c=i.trace,u=c.domain,f="h"===c.orientation,p=c.node.pad,d=c.node.thickness,m={justify:a.sankeyJustify,left:a.sankeyLeft,right:a.sankeyRight,center:a.sankeyCenter}[c.node.align],g=e.width*(u.x[1]-u.x[0]),v=e.height*(u.y[1]-u.y[0]),x=i._nodes,_=i._links,b=i.circular;(n=b?o.sankeyCircular().circularLinkGap(0):a.sankey()).iterations(s.sankeyIterations).size(f?[g,v]:[v,g]).nodeWidth(d).nodePadding(p).nodeId((function(e){return e.pointNumber})).nodeAlign(m).nodes(x).links(_);var w,T,k,A=n();for(var M in n.nodePadding()<p&&h.warn("node.pad was reduced to ",n.nodePadding()," to fit within the figure."),i._groupLookup){var S,E=parseInt(i._groupLookup[M]);for(w=0;w<A.nodes.length;w++)if(A.nodes[w].pointNumber===E){S=A.nodes[w];break}if(S){var C={pointNumber:parseInt(M),x0:S.x0,x1:S.x1,y0:S.y0,y1:S.y1,partOfGroup:!0,sourceLinks:[],targetLinks:[]};A.nodes.unshift(C),S.childrenNodes.unshift(C)}}if(function(){for(w=0;w<A.nodes.length;w++){var e,t,r=A.nodes[w],n={};for(T=0;T<r.targetLinks.length;T++)e=(t=r.targetLinks[T]).source.pointNumber+":"+t.target.pointNumber,n.hasOwnProperty(e)||(n[e]=[]),n[e].push(t);var i=Object.keys(n);for(T=0;T<i.length;T++){var a=n[e=i[T]],o=0,s={};for(k=0;k<a.length;k++)s[(t=a[k]).label]||(s[t.label]=0),s[t.label]+=t.value,o+=t.value;for(k=0;k<a.length;k++)(t=a[k]).flow={value:o,labelConcentration:s[t.label]/o,concentration:t.value/o,links:a},t.concentrationscale&&(t.color=l(t.concentrationscale(t.flow.labelConcentration)))}var c=0;for(T=0;T<r.sourceLinks.length;T++)c+=r.sourceLinks[T].value;for(T=0;T<r.sourceLinks.length;T++)(t=r.sourceLinks[T]).concentrationOut=t.value/c;var u=0;for(T=0;T<r.targetLinks.length;T++)u+=r.targetLinks[T].value;for(T=0;T<r.targetLinks.length;T++)(t=r.targetLinks[T]).concenrationIn=t.value/u}}(),c.node.x.length&&c.node.y.length){for(w=0;w<Math.min(c.node.x.length,c.node.y.length,A.nodes.length);w++)if(c.node.x[w]&&c.node.y[w]){var I=[c.node.x[w]*g,c.node.y[w]*v];A.nodes[w].x0=I[0]-d/2,A.nodes[w].x1=I[0]+d/2;var L=A.nodes[w].y1-A.nodes[w].y0;A.nodes[w].y0=I[1]-L/2,A.nodes[w].y1=I[1]+L/2}if("snap"===c.arrangement)(function(e){var t,r,n=e.map((function(e,t){return{x0:e.x0,index:t}})).sort((function(e,t){return e.x0-t.x0})),i=[],a=-1,o=-1/0;for(w=0;w<n.length;w++){var s=e[n[w].index];s.x0>o+d&&(a+=1,t=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=t-s.x0,s.x0+=r,s.x1+=r}return i})(x=A.nodes).forEach((function(e){var t,r,n,i=0,a=e.length;for(e.sort((function(e,t){return e.y0-t.y0})),n=0;n<a;++n)(t=e[n]).y0>=i||(r=i-t.y0)>1e-6&&(t.y0+=r,t.y1+=r),i=t.y1+p}));n.update(A)}return{circular:b,key:r,trace:c,guid:h.randstr(),horizontal:f,width:g,height:v,nodePad:c.node.pad,nodeLineColor:c.node.line.color,nodeLineWidth:c.node.line.width,linkLineColor:c.link.line.color,linkLineWidth:c.link.line.width,linkArrowLength:c.link.arrowlen,valueFormat:c.valueformat,valueSuffix:c.valuesuffix,textFont:c.textfont,translateX:u.x[0]*e.width+e.margin.l,translateY:e.height-u.y[1]*e.height+e.margin.t,dragParallel:f?v:g,dragPerpendicular:f?g:v,arrangement:c.arrangement,sankey:n,graph:A,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function M(e,t,r){var n=l(t.color),i=l(t.hovercolor),a=t.source.label+"|"+t.target.label+"__"+r;return t.trace=e.trace,t.curveNumber=e.trace.index,{circular:e.circular,key:a,traceId:e.key,pointNumber:t.pointNumber,link:t,tinyColorHue:c.tinyRGB(n),tinyColorAlpha:n.getAlpha(),tinyColorHoverHue:c.tinyRGB(i),tinyColorHoverAlpha:i.getAlpha(),linkPath:S,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 S(){return function(e){var t=e.linkArrowLength;if(e.link.circular)return function(e,t){var r="",n=e.width/2,i=e.circularPathData,a=i.sourceX+i.verticalBuffer<i.targetX,o=i.rightFullExtent-i.rightLargeArcRadius-t<=i.leftFullExtent-n;return Math.abs(i.rightFullExtent-i.leftFullExtent-n),"top"===e.circularLinkType?(r="M "+(i.targetX-t)+" "+(i.targetY+n)+" L "+(i.rightInnerExtent-t)+" "+(i.targetY+n)+"A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 1 "+(i.rightFullExtent-n-t)+" "+(i.targetY-i.rightSmallArcRadius)+"L "+(i.rightFullExtent-n-t)+" "+i.verticalRightInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 1 "+(i.rightFullExtent+n-t-(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius+n))+" L "+(i.rightFullExtent+n-(i.rightLargeArcRadius-n)-t)+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius+n))+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalRightInnerExtent:a?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 0 "+(i.rightFullExtent-n-t-(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius-n))+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius-n))+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 1 "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent-n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY-i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.sourceY+n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.leftInnerExtent+" "+(i.sourceY-n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 0 "+(i.leftFullExtent-n)+" "+(i.sourceY-i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,r+=a&&o?" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+(i.leftFullExtent-n)+" "+(i.verticalFullExtent+n)+"L"+(i.rightFullExtent+n-t)+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:a?" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent-n-t)+" "+(i.verticalFullExtent-n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" L "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 0 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-t)+" "+(i.targetY-i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 0 "+(i.rightInnerExtent-t)+" "+(i.targetY-n)+" L "+(i.targetX-t)+" "+(i.targetY-n)+(t>0?" L "+i.targetX+" "+i.targetY:"")+"Z"):(r="M "+(i.targetX-t)+" "+(i.targetY-n)+" L "+(i.rightInnerExtent-t)+" "+(i.targetY-n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent-n-t)+" "+(i.targetY+i.rightSmallArcRadius)+" L "+(i.rightFullExtent-n-t)+" "+i.verticalRightInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-n-t)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent+n-t-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:a?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent-t-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent+n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY+i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.leftInnerExtent+" "+(i.sourceY+n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n)+" "+(i.sourceY+i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent+n-t+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:a?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent-t-n)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" L "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-t)+" "+(i.targetY+i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightInnerExtent-t)+" "+(i.targetY+n)+" L "+(i.targetX-t)+" "+(i.targetY+n)+(t>0?" L "+i.targetX+" "+i.targetY:"")+"Z"),r}(e.link,t);var r=Math.abs((e.link.target.x0-e.link.source.x1)/2);t>r&&(t=r);var i=e.link.source.x1,a=e.link.target.x0-t,o=n(i,a),s=o(.5),l=o(.5),c=e.link.y0-e.link.width/2,u=e.link.y0+e.link.width/2,h=e.link.y1-e.link.width/2,f=e.link.y1+e.link.width/2,p="M"+i+","+c,d="C"+s+","+c+" "+l+","+h+" "+a+","+h,m="C"+l+","+f+" "+s+","+u+" "+i+","+u,g=t>0?"L"+(a+t)+","+(h+e.link.width/2):"";return p+d+(g+="L"+a+","+f)+m+"Z"}}function E(e,t){var r=l(t.color),n=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=h.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:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:e.horizontal?t.dy/2+1:t.dx/2+1,left:1===t.originalLayer,sizeAcross:e.width,forceLayouts:e.forceLayouts,horizontal:e.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:c.tinyRGB(r),tinyColorAlpha:r.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 C(e){e.attr("transform",(function(e){return f(e.node.x0.toFixed(3),e.node.y0.toFixed(3))}))}function I(e){e.call(C)}function L(e,t){e.call(I),t.attr("d",S())}function P(e){e.attr("width",(function(e){return e.node.x1-e.node.x0})).attr("height",(function(e){return e.visibleHeight}))}function z(e){return e.link.width>1||e.linkLineWidth>0}function D(e){return f(e.translateX,e.translateY)+(e.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function O(e,t,r){e.on(".basic",null).on("mouseover.basic",(function(e){!e.interactionState.dragInProgress&&!e.partOfGroup&&(r.hover(this,e,t),e.interactionState.hovered=[this,e])})).on("mousemove.basic",(function(e){!e.interactionState.dragInProgress&&!e.partOfGroup&&(r.follow(this,e),e.interactionState.hovered=[this,e])})).on("mouseout.basic",(function(e){!e.interactionState.dragInProgress&&!e.partOfGroup&&(r.unhover(this,e,t),e.interactionState.hovered=!1)})).on("click.basic",(function(e){e.interactionState.hovered&&(r.unhover(this,e,t),e.interactionState.hovered=!1),!e.interactionState.dragInProgress&&!e.partOfGroup&&r.select(this,e,t)}))}function R(e,t,n,a){var o=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("fixed"!==i.arrangement&&(h.ensureSingle(a._fullLayout._infolayer,"g","dragcover",(function(e){a._fullLayout._dragCover=e})),h.raiseToTop(this),i.interactionState.dragInProgress=i.node,j(i.node),i.interactionState.hovered&&(n.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),"snap"===i.arrangement)){var o=i.traceId+"|"+i.key;i.forceLayouts[o]?i.forceLayouts[o].alpha(1):function(e,t,n){!function(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}(n.graph.nodes);var i=n.graph.nodes.filter((function(e){return e.originalX===n.node.originalX})).filter((function(e){return!e.partOfGroup}));n.forceLayouts[t]=r.forceSimulation(i).alphaDecay(0).force("collide",r.forceCollide().radius((function(e){return e.dy/2+n.nodePad/2})).strength(1).iterations(s.forceIterations)).force("constrain",function(e,t,r,n){return function(){for(var e=0,i=0;i<r.length;i++){var a=r[i];a===n.interactionState.dragInProgress?(a.x=a.lastDraggedX,a.y=a.lastDraggedY):(a.vx=(a.originalX-a.x)/s.forceTicksPerFrame,a.y=Math.min(n.size-a.dy/2,Math.max(a.dy/2,a.y))),e=Math.max(e,Math.abs(a.vx),Math.abs(a.vy))}!n.interactionState.dragInProgress&&e<.1&&n.forceLayouts[t].alpha()>0&&n.forceLayouts[t].alpha(0)}}(0,t,i,n)).stop()}(0,o,i),function(e,t,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o<s.forceTicksPerFrame;o++)r.forceLayouts[n].tick();if(function(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}(r.graph.nodes),r.sankey.update(r.graph),L(e.filter(N(r)),t),r.forceLayouts[n].alpha()>0)window.requestAnimationFrame(a);else{var l=r.node.originalX;r.node.x0=l-r.visibleWidth/2,r.node.x1=l+r.visibleWidth/2,B(r,i)}}))}(e,t,i,o,a)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=i.event.x,a=i.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),a=Math.max(0,Math.min(r.size-r.visibleHeight/2,a)),r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2),j(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),L(e.filter(N(r)),t))}})).on("dragend",(function(e){if("fixed"!==e.arrangement){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;"snap"!==e.arrangement&&B(e,a)}}));e.on(".drag",null).call(o)}function B(e,t){for(var r=[],n=[],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;r.push(a/e.figure.width),n.push(o/e.figure.height)}_.call("_guiRestyle",t,{"node.x":[r],"node.y":[n]},e.trace.index).then((function(){t._fullLayout._dragCover&&t._fullLayout._dragCover.remove()}))}function j(e){e.lastDraggedX=e.x0+e.dx/2,e.lastDraggedY=e.y0+e.dy/2}function N(e){return function(t){return t.node.originalX===e.node.originalX}}t.exports=function(e,t,r,n,a){var o=e._context.staticPlot,d=!1;h.ensureSingle(e._fullLayout._infolayer,"g","first-render",(function(){d=!0}));var v=e._fullLayout._dragCover,_=r.filter((function(e){return y(e).trace.visible})).map(A.bind(null,n)),b=t.selectAll("."+s.cn.sankey).data(_,m);b.exit().remove(),b.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",D),b.each((function(t,r){e._fullData[r]._sankey=t;var n="bgsankey-"+t.trace.uid+"-"+r;h.ensureSingle(e._fullLayout._draggers,"rect",n),e._fullData[r]._bgRect=i.select("."+n),e._fullData[r]._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})})),b.transition().ease(s.ease).duration(s.duration).attr("transform",D);var w=b.selectAll("."+s.cn.sankeyLinks).data(g,m);w.enter().append("g").classed(s.cn.sankeyLinks,!0).style("fill","none");var I=w.selectAll("."+s.cn.sankeyLink).data((function(e){return e.graph.links.filter((function(e){return e.value})).map(M.bind(null,e))}),m);I.enter().append("path").classed(s.cn.sankeyLink,!0).call(O,b,a.linkEvents),I.style("stroke",(function(e){return z(e)?c.tinyRGB(l(e.linkLineColor)):e.tinyColorHue})).style("stroke-opacity",(function(e){return z(e)?c.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 z(e)?e.linkLineWidth:1})).attr("d",S()),I.style("opacity",(function(){return e._context.staticPlot||d||v?1:0})).transition().ease(s.ease).duration(s.duration).style("opacity",1),I.exit().transition().ease(s.ease).duration(s.duration).style("opacity",0).remove();var L=b.selectAll("."+s.cn.sankeyNodeSet).data(g,m);L.enter().append("g").classed(s.cn.sankeyNodeSet,!0),L.style("cursor",(function(e){switch(e.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}}));var F=L.selectAll("."+s.cn.sankeyNode).data((function(e){var t=e.graph.nodes;return function(e){var t,r=[];for(t=0;t<e.length;t++)e[t].originalX=(e[t].x0+e[t].x1)/2,e[t].originalY=(e[t].y0+e[t].y1)/2,-1===r.indexOf(e[t].originalX)&&r.push(e[t].originalX);for(r.sort((function(e,t){return e-t})),t=0;t<e.length;t++)e[t].originalLayerIndex=r.indexOf(e[t].originalX),e[t].originalLayer=e[t].originalLayerIndex/(r.length-1)}(t),t.map(E.bind(null,e))}),m);F.enter().append("g").classed(s.cn.sankeyNode,!0).call(C).style("opacity",(function(t){return!e._context.staticPlot&&!d||t.partOfGroup?0:1})),F.call(O,b,a.nodeEvents).call(R,I,a,e),F.transition().ease(s.ease).duration(s.duration).call(C).style("opacity",(function(e){return e.partOfGroup?0:1})),F.exit().transition().ease(s.ease).duration(s.duration).style("opacity",0).remove();var B=F.selectAll("."+s.cn.nodeRect).data(g);B.enter().append("rect").classed(s.cn.nodeRect,!0).call(P),B.style("stroke-width",(function(e){return e.nodeLineWidth})).style("stroke",(function(e){return c.tinyRGB(l(e.nodeLineColor))})).style("stroke-opacity",(function(e){return c.opacity(e.nodeLineColor)})).style("fill",(function(e){return e.tinyColorHue})).style("fill-opacity",(function(e){return e.tinyColorAlpha})),B.transition().ease(s.ease).duration(s.duration).call(P);var j=F.selectAll("."+s.cn.nodeLabel).data(g);j.enter().append("text").classed(s.cn.nodeLabel,!0).style("cursor","default"),j.attr("data-notex",1).text((function(e){return e.node.label})).each((function(t){var r=i.select(this);u.font(r,t.textFont),x.convertToTspans(r,e)})).attr("text-anchor",(function(e){return e.horizontal&&e.left?"end":"start"})).attr("transform",(function(e){var t=i.select(this),r=x.lineCount(t),n=e.textFont.size*((r-1)*k-T),a=e.nodeLineWidth/2+3,o=((e.horizontal?e.visibleHeight:e.visibleWidth)-n)/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})),j.transition().ease(s.ease).duration(s.duration)}}}),sw=m({"src/traces/sankey/plot.js"(e,t){var r=b(),n=ct(),i=n.numberFormat,a=ow(),o=Or(),s=W(),l=aw().cn,c=n._;function u(e){return""!==e}function h(e,t){return e.filter((function(e){return e.key===t.traceId}))}function f(e,t){r.select(e).select("path").style("fill-opacity",t),r.select(e).select("rect").style("fill-opacity",t)}function p(e){r.select(e).select("text.name").style("fill","black")}function d(e){return function(t){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function m(e){return function(t){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(e,t,r){t&&r&&h(r,t).selectAll("."+l.sankeyLink).filter(d(t)).call(v.bind(0,t,r,!1))}function y(e,t,r){t&&r&&h(r,t).selectAll("."+l.sankeyLink).filter(d(t)).call(x.bind(0,t,r,!1))}function v(e,t,r,n){n.style("fill",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverHue})).style("fill-opacity",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverAlpha})),n.each((function(r){var n=r.link.label;""!==n&&h(t,e).selectAll("."+l.sankeyLink).filter((function(e){return e.link.label===n})).style("fill",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverHue})).style("fill-opacity",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverAlpha}))})),r&&h(t,e).selectAll("."+l.sankeyNode).filter(m(e)).call(g)}function x(e,t,r,n){n.style("fill",(function(e){return e.tinyColorHue})).style("fill-opacity",(function(e){return e.tinyColorAlpha})),n.each((function(r){var n=r.link.label;""!==n&&h(t,e).selectAll("."+l.sankeyLink).filter((function(e){return e.link.label===n})).style("fill",(function(e){return e.tinyColorHue})).style("fill-opacity",(function(e){return e.tinyColorAlpha}))})),r&&h(t,e).selectAll(l.sankeyNode).filter(m(e)).call(y)}function _(e,t){var r=e.hoverlabel||{},i=n.nestedProperty(r,t).get();return!Array.isArray(i)&&i}t.exports=function(e,t){for(var n=e._fullLayout,h=n._paper,d=n._size,m=0;m<e._fullData.length;m++)if(e._fullData[m].visible&&e._fullData[m].type===l.sankey&&!e._fullData[m]._viewInitial){var b=e._fullData[m].node;e._fullData[m]._viewInitial={node:{groups:b.groups.slice(),x:b.x.slice(),y:b.y.slice()}}}var w=c(e,"source:")+" ",T=c(e,"target:")+" ",k=c(e,"concentration:")+" ",A=c(e,"incoming flow count:")+" ",M=c(e,"outgoing flow count:")+" ";a(e,h,t,{width:d.w,height:d.h,margin:{t:d.t,r:d.r,b:d.b,l:d.l}},{linkEvents:{hover:function(t,n,i){!1!==e._fullLayout.hovermode&&(r.select(t).call(v.bind(0,n,i,!0)),"skip"!==n.link.trace.link.hoverinfo&&(n.link.fullData=n.link.trace,e.emit("plotly_hover",{event:r.event,points:[n.link]})))},follow:function(t,a){if(!1!==e._fullLayout.hovermode){var l=a.link.trace.link;if("none"!==l.hoverinfo&&"skip"!==l.hoverinfo){for(var c=[],h=0,d=0;d<a.flow.links.length;d++){var m=a.flow.links[d];if("closest"!==e._fullLayout.hovermode||a.link.pointNumber===m.pointNumber){a.link.pointNumber===m.pointNumber&&(h=d),m.fullData=m.trace,l=a.link.trace.link;var g=v(m),y={valueLabel:i(a.valueFormat)(m.value)+a.valueSuffix};c.push({x:g[0],y:g[1],name:y.valueLabel,text:[m.label||"",w+m.source.label,T+m.target.label,m.concentrationscale?k+i("%0.2f")(m.flow.labelConcentration):""].filter(u).join("<br>"),color:_(l,"bgcolor")||s.addOpacity(m.color,1),borderColor:_(l,"bordercolor"),fontFamily:_(l,"font.family"),fontSize:_(l,"font.size"),fontColor:_(l,"font.color"),fontWeight:_(l,"font.weight"),fontStyle:_(l,"font.style"),fontVariant:_(l,"font.variant"),fontTextcase:_(l,"font.textcase"),fontLineposition:_(l,"font.lineposition"),fontShadow:_(l,"font.shadow"),nameLength:_(l,"namelength"),textAlign:_(l,"align"),idealAlign:r.event.x<g[0]?"right":"left",hovertemplate:l.hovertemplate,hovertemplateLabels:y,eventData:[m]})}}o.loneHover(c,{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:e,anchorIndex:h}).each((function(){a.link.concentrationscale||f(this,.65),p(this)}))}}function v(e){var t,r;e.circular?(t=(e.circularPathData.leftInnerExtent+e.circularPathData.rightInnerExtent)/2,r=e.circularPathData.verticalFullExtent):(t=(e.source.x1+e.target.x0)/2,r=(e.y0+e.y1)/2);var n=[t,r];return"v"===e.trace.orientation&&n.reverse(),n[0]+=a.parent.translateX,n[1]+=a.parent.translateY,n}},unhover:function(t,i,a){!1!==e._fullLayout.hovermode&&(r.select(t).call(x.bind(0,i,a,!0)),"skip"!==i.link.trace.link.hoverinfo&&(i.link.fullData=i.link.trace,e.emit("plotly_unhover",{event:r.event,points:[i.link]})),o.loneUnhover(n._hoverlayer.node()))},select:function(t,n){var i=n.link;i.originalEvent=r.event,e._hoverdata=[i],o.click(e,{target:!0})}},nodeEvents:{hover:function(t,n,i){!1!==e._fullLayout.hovermode&&(r.select(t).call(g,n,i),"skip"!==n.node.trace.node.hoverinfo&&(n.node.fullData=n.node.trace,e.emit("plotly_hover",{event:r.event,points:[n.node]})))},follow:function(t,a){if(!1!==e._fullLayout.hovermode){var s=a.node.trace.node;if("none"!==s.hoverinfo&&"skip"!==s.hoverinfo){var c=r.select(t).select("."+l.nodeRect),h=e._fullLayout._paperdiv.node().getBoundingClientRect(),d=c.node().getBoundingClientRect(),m=d.left-2-h.left,g=d.right+2-h.left,y=d.top+d.height/4-h.top,v={valueLabel:i(a.valueFormat)(a.node.value)+a.valueSuffix};a.node.fullData=a.node.trace,e._fullLayout._calcInverseTransform(e);var x=e._fullLayout._invScaleX,b=e._fullLayout._invScaleY,w=o.loneHover({x0:x*m,x1:x*g,y:b*y,name:i(a.valueFormat)(a.node.value)+a.valueSuffix,text:[a.node.label,A+a.node.targetLinks.length,M+a.node.sourceLinks.length].filter(u).join("<br>"),color:_(s,"bgcolor")||a.tinyColorHue,borderColor:_(s,"bordercolor"),fontFamily:_(s,"font.family"),fontSize:_(s,"font.size"),fontColor:_(s,"font.color"),fontWeight:_(s,"font.weight"),fontStyle:_(s,"font.style"),fontVariant:_(s,"font.variant"),fontTextcase:_(s,"font.textcase"),fontLineposition:_(s,"font.lineposition"),fontShadow:_(s,"font.shadow"),nameLength:_(s,"namelength"),textAlign:_(s,"align"),idealAlign:"left",hovertemplate:s.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:e});f(w,.85),p(w)}}},unhover:function(t,i,a){!1!==e._fullLayout.hovermode&&(r.select(t).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,e.emit("plotly_unhover",{event:r.event,points:[i.node]})),o.loneUnhover(n._hoverlayer.node()))},select:function(t,n,i){var a=n.node;a.originalEvent=r.event,e._hoverdata=[a],r.select(t).call(y,n,i),o.click(e,{target:!0})}}})}}}),lw=m({"src/traces/sankey/base_plot.js"(e){var t=De().overrideAll,r=Tt().getModuleCalcData,n=sw(),i=U(),a=dr(),o=pr(),s=Cn().prepSelect,l=ct(),c=He(),u="sankey";function h(e,t){var r=e._fullData[t],n=e._fullLayout,i=n.dragmode,u="pan"===n.dragmode?"move":"crosshair",h=r._bgRect;if(h&&"pan"!==i&&"zoom"!==i){a(h,u);var f={_id:"x",c2p:l.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:l.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:e,element:h.node(),plotinfo:{id:t,xaxis:f,yaxis:p,fillRangeItems:l.noop},subplot:t,xaxes:[f],yaxes:[p],doneFnCompleted:function(r){var n,i=e._fullData[t],a=i.node.groups.slice(),o=[];function s(e){for(var t=i._sankey.graph.nodes,r=0;r<t.length;r++)if(t[r].pointNumber===e)return t[r]}for(var l=0;l<r.length;l++){var u=s(r[l].pointNumber);if(u)if(u.group){for(var h=0;h<u.childrenNodes.length;h++)o.push(u.childrenNodes[h].pointNumber);a[u.pointNumber-i.node._count]=!1}else o.push(u.pointNumber)}n=a.filter(Boolean).concat([o]),c.call("_guiRestyle",e,{"node.groups":[n]},t)},prepFn:function(e,t,r){s(e,t,r,d,i)}};o.init(d)}}e.name=u,e.baseLayoutAttrOverrides=t({hoverlabel:i.hoverlabel},"plot","nested"),e.plot=function(t){var i=r(t.calcdata,u)[0];n(t,i),e.updateFx(t)},e.clean=function(e,t,r,n){var i=n._has&&n._has(u),a=t._has&&t._has(u);i&&!a&&(n._paperdiv.selectAll(".sankey").remove(),n._paperdiv.selectAll(".bgsankey").remove())},e.updateFx=function(e){for(var t=0;t<e._fullData.length;t++)h(e,t)}}}),cw=m({"src/traces/sankey/select.js"(e,t){t.exports=function(e,t){for(var r=[],n=e.cd[0].trace,i=n._sankey.graph.nodes,a=0;a<i.length;a++){var o=i[a];if(!o.partOfGroup){var s=[(o.x0+o.x1)/2,(o.y0+o.y1)/2];"v"===n.orientation&&s.reverse(),t&&t.contains(s,!1,a,e)&&r.push({pointNumber:o.pointNumber})}}return r}}}),uw=m({"src/traces/sankey/index.js"(e,t){t.exports={attributes:Gb(),supplyDefaults:Wb(),calc:Yb(),plot:sw(),moduleType:"trace",name:"sankey",basePlotModule:lw(),selectPoints:cw(),categories:["noOpacity"],meta:{}}}}),hw=m({"lib/sankey.js"(e,t){t.exports=uw()}}),fw=m({"src/traces/indicator/base_plot.js"(e){var t=At();e.name="indicator",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),pw=m({"src/traces/indicator/attributes.js"(e,t){var r=B().extendFlat,n=B().extendDeep,i=De().overrideAll,a=j(),o=G(),s=Ma().attributes,l=Lt(),c=vt().templatedArray,u=Ml(),h=It().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"},d={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},m=c("step",n({},p,{range:d}));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:r({},f,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:h("value")},font:r({},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:h("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:r({},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:n({},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:d,visible:r({},l.visible,{dflt:!0}),tickmode:l.minor.tickmode,nticks:l.nticks,tick0:l.tick0,dtick:l.dtick,tickvals:l.tickvals,ticktext:l.ticktext,ticks:r({},l.ticks,{dflt:"outside"}),ticklen:l.ticklen,tickwidth:l.tickwidth,tickcolor:l.tickcolor,ticklabelstep:l.ticklabelstep,showticklabels:l.showticklabels,labelalias:l.labelalias,tickfont:a({}),tickangle:l.tickangle,tickformat:l.tickformat,tickformatstops:l.tickformatstops,tickprefix:l.tickprefix,showtickprefix:l.showtickprefix,ticksuffix:l.ticksuffix,showticksuffix:l.showticksuffix,separatethousands:l.separatethousands,exponentformat:l.exponentformat,minexponent:l.minexponent,showexponent:l.showexponent,editType:"plot"},"plot"),steps:m,threshold:{line:{color:r({},p.line.color,{}),width:r({},p.line.width,{dflt:1}),editType:"plot"},thickness:r({},p.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}}),dw=m({"src/traces/indicator/constants.js"(e,t){t.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}}),mw=m({"src/traces/indicator/defaults.js"(e,t){var r=ct(),n=pw(),i=Ma().defaults,a=vt(),o=Nt(),s=dw(),l=Ft(),c=Bt(),u=Ut(),h=Vt();function f(e,t){function i(i,a){return r.coerce(e,t,n.gauge.steps,i,a)}i("color"),i("line.color"),i("line.width"),i("range"),i("thickness")}t.exports={supplyDefaults:function(e,t,p,d){function m(i,a){return r.coerce(e,t,n,i,a)}i(t,d,m),m("mode"),t._hasNumber=-1!==t.mode.indexOf("number"),t._hasDelta=-1!==t.mode.indexOf("delta"),t._hasGauge=-1!==t.mode.indexOf("gauge");var g=m("value");t._range=[0,"number"==typeof g?1.5*g:1];var y,v,x=new Array(2);if(t._hasNumber){m("number.valueformat");var _=r.extendFlat({},d.font);_.size=void 0,r.coerceFont(m,"number.font",_),void 0===t.number.font.size&&(t.number.font.size=s.defaultNumberFontSize,x[0]=!0),m("number.prefix"),m("number.suffix"),y=t.number.font.size}if(t._hasDelta){var b=r.extendFlat({},d.font);b.size=void 0,r.coerceFont(m,"delta.font",b),void 0===t.delta.font.size&&(t.delta.font.size=(t._hasNumber?.5:1)*(y||s.defaultNumberFontSize),x[1]=!0),m("delta.reference",t.value),m("delta.relative"),m("delta.valueformat",t.delta.relative?"2%":""),m("delta.increasing.symbol"),m("delta.increasing.color"),m("delta.decreasing.symbol"),m("delta.decreasing.color"),m("delta.position"),m("delta.prefix"),m("delta.suffix"),v=t.delta.font.size}t._scaleNumbers=(!t._hasNumber||x[0])&&(!t._hasDelta||x[1])||!1;var w,T,k,A,M=r.extendFlat({},d.font);function S(e,t){return r.coerce(w,T,n.gauge,e,t)}function E(e,t){return r.coerce(k,A,n.gauge.axis,e,t)}if(M.size=.25*(y||v||s.defaultNumberFontSize),r.coerceFont(m,"title.font",M),m("title.text"),t._hasGauge){(w=e.gauge)||(w={}),T=a.newContainer(t,"gauge"),S("shape"),(t._isBullet="bullet"===t.gauge.shape)||m("title.align","center"),(t._isAngular="angular"===t.gauge.shape)||m("align","center"),S("bgcolor",d.paper_bgcolor),S("borderwidth"),S("bordercolor"),S("bar.color"),S("bar.line.color"),S("bar.line.width"),S("bar.thickness",s.valueThickness*("bullet"===t.gauge.shape?.5:1)),o(w,T,{name:"steps",handleItemDefaults:f}),S("threshold.value"),S("threshold.thickness"),S("threshold.line.width"),S("threshold.line.color"),k={},w&&(k=w.axis||{}),A=a.newContainer(T,"axis"),E("visible"),t._range=E("range",t._range);var C={font:d.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};l(k,A,E,"linear"),h(k,A,E,"linear",C),u(k,A,E,"linear",C),c(k,A,E,C)}else m("title.align","center"),m("align","center"),t._isAngular=t._isBullet=!1;t._length=null}}}}),gw=m({"src/traces/indicator/calc.js"(e,t){t.exports={calc:function(e,t){var r=[],n=t.value;"number"!=typeof t._lastValue&&(t._lastValue=t.value);var i=t._lastValue,a=i;return t._hasDelta&&"number"==typeof t.delta.reference&&(a=t.delta.reference),r[0]={y:n,lastY:i,delta:n-a,relativeDelta:(n-a)/a},r}}}}),yw=m({"src/traces/indicator/plot.js"(e,t){var r=b(),n=(td(),v(ed)).interpolate,i=(td(),v(ed)).interpolateNumber,a=ct(),o=a.strScale,s=a.strTranslate,l=a.rad2deg,c=St().MID_SHIFT,u=er(),h=dw(),f=Et(),p=ar(),d=Ai(),m=Mi(),g=Lt(),y=W(),x={left:"start",center:"middle",right:"end"},_={left:0,center:.5,right:1},w=/[yzafpnµmkMGTPEZY]/;function T(e){return e&&e.duration>0}function k(e){e.each((function(e){y.stroke(r.select(this),e.line.color)})).each((function(e){y.fill(r.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function A(e,t,r){var n=e._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),o={type:"linear",_id:"x"+t._id},s={letter:"x",font:n.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function l(e,t){return a.coerce(i,o,g,e,t)}return d(i,o,l,s,n),m(i,o,l,s),o}function M(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function S(e,t,n,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=r.select(a);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",n).attr("data-unformatted",e).call(f.convertToTspans,i).call(u.font,t),u.bBox(o.node())}function E(e,t,r,n,i,o){var s="_cache"+t;e[s]&&e[s].key===i||(e[s]={key:i,value:r});var l=a.aggNums(o,null,[e[s].value,n],2);return e[s].value=l,l}t.exports=function(e,t,d,m){var g,v=e._fullLayout;T(d)&&m&&(g=m()),a.makeTraceGroups(v._indicatorlayer,t,"trace").each((function(t){var m,b,C,I,L,P=t[0].trace,z=r.select(this),D=P._hasGauge,O=P._isAngular,R=P._isBullet,F=P.domain,B={w:v._size.w*(F.x[1]-F.x[0]),h:v._size.h*(F.y[1]-F.y[0]),l:v._size.l+v._size.w*F.x[0],r:v._size.r+v._size.w*(1-F.x[1]),t:v._size.t+v._size.h*(1-F.y[1]),b:v._size.b+v._size.h*F.y[0]},j=B.l+B.w/2,N=B.t+B.h/2,U=Math.min(B.w/2,B.h),V=h.innerRadius*U,q=P.align||"center";if(b=N,D){if(O&&(m=j,b=N+U/2,C=function(e){return function(e,t){return[t/Math.sqrt(e.width/2*(e.width/2)+e.height*e.height),e,t]}(e,.9*V)}),R){var H=h.bulletPadding,G=1-h.bulletNumberDomainSize+H;m=B.l+(G+(1-G)*_[q])*B.w,C=function(e){return M(e,(h.bulletNumberDomainSize-H)*B.w,B.h)}}}else m=B.l+_[q]*B.w,C=function(e){return M(e,B.w,B.h)};!function(e,t,n,l){var c,h,d,m=n[0].trace,g=l.numbersX,v=l.numbersY,b=m.align||"center",k=x[b],M=l.transitionOpts,C=l.onComplete,I=a.ensureSingle(t,"g","numbers"),L=[];m._hasNumber&&L.push("number"),m._hasDelta&&(L.push("delta"),"left"===m.delta.position&&L.reverse());var P=I.selectAll("text").data(L);function z(t,r,n,i){if(!t.match("s")||n>=0==i>=0||r(n).slice(-1).match(w)||r(i).slice(-1).match(w))return r;var a=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=A(e,{tickformat:a});return function(e){return Math.abs(e)<1?p.tickText(o,e).text:r(e)}}P.enter().append("text"),P.attr("text-anchor",(function(){return k})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),P.exit().remove();var D,O=m.mode+m.align;if(m._hasDelta&&(D=function(){var t=A(e,{tickformat:m.delta.valueformat},m._range);t.setScale(),p.prepTicks(t);var a=function(e){return p.tickText(t,e).text},o=m.delta.suffix,s=m.delta.prefix,l=function(e){return m.delta.relative?e.relativeDelta:e.delta},c=function(e,t){return 0===e||"number"!=typeof e||isNaN(e)?"-":(e>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+s+t(e)+o},d=function(e){return e.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=l(n[0]));var g=I.select("text.delta");function v(){g.text(c(l(n[0]),a)).call(y.fill,d(n[0])).call(f.convertToTspans,e)}return g.call(u.font,m.delta.font).call(y.fill,d({delta:m._deltaLastValue})),T(M)?g.transition().duration(M.duration).ease(M.easing).tween("text",(function(){var e=r.select(this),t=l(n[0]),o=m._deltaLastValue,s=z(m.delta.valueformat,a,o,t),u=i(o,t);return m._deltaLastValue=t,function(t){e.text(c(u(t),s)),e.call(y.fill,d({delta:u(t)}))}})).each("end",(function(){v(),C&&C()})).each("interrupt",(function(){v(),C&&C()})):v(),h=S(c(l(n[0]),a),m.delta.font,k,e),g}(),O+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,O+=m.delta.increasing.symbol+m.delta.decreasing.symbol,d=h),m._hasNumber&&(function(){var t=A(e,{tickformat:m.number.valueformat},m._range);t.setScale(),p.prepTicks(t);var a=function(e){return p.tickText(t,e).text},o=m.number.suffix,s=m.number.prefix,l=I.select("text.number");function h(){var t="number"==typeof n[0].y?s+a(n[0].y)+o:"-";l.text(t).call(u.font,m.number.font).call(f.convertToTspans,e)}T(M)?l.transition().duration(M.duration).ease(M.easing).each("end",(function(){h(),C&&C()})).each("interrupt",(function(){h(),C&&C()})).attrTween("text",(function(){var e=r.select(this),t=i(n[0].lastY,n[0].y);m._lastValue=n[0].y;var l=z(m.number.valueformat,a,n[0].lastY,n[0].y);return function(r){e.text(s+l(t(r))+o)}})):h(),c=S(s+a(n[0].y)+o,m.number.font,k,e)}(),O+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,d=c),m._hasDelta&&m._hasNumber){var R,F,B=[(c.left+c.right)/2,(c.top+c.bottom)/2],j=[(h.left+h.right)/2,(h.top+h.bottom)/2],N=.75*m.delta.font.size;"left"===m.delta.position&&(R=E(m,"deltaPos",0,-1*(c.width*_[m.align]+h.width*(1-_[m.align])+N),O,Math.min),F=B[1]-j[1],d={width:c.width+h.width+N,height:Math.max(c.height,h.height),left:h.left+R,right:c.right,top:Math.min(c.top,h.top+F),bottom:Math.max(c.bottom,h.bottom+F)}),"right"===m.delta.position&&(R=E(m,"deltaPos",0,c.width*(1-_[m.align])+h.width*_[m.align]+N,O,Math.max),F=B[1]-j[1],d={width:c.width+h.width+N,height:Math.max(c.height,h.height),left:c.left,right:h.right+R,top:Math.min(c.top,h.top+F),bottom:Math.max(c.bottom,h.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=h.height,d={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height,bottom:c.bottom+h.height}),"top"===m.delta.position&&(R=null,F=c.top,d={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height-h.height,bottom:c.bottom}),D.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&I.attr("transform",(function(){var e=l.numbersScaler(d);O+=e[2];var t,r=E(m,"numbersScale",1,e[0],O,Math.min);m._scaleNumbers||(r=1),t=m._isAngular?v-r*d.bottom:v-r*(d.top+d.bottom)/2,m._numbersTop=r*d.top+t;var n=d[b];"center"===b&&(n=(d.left+d.right)/2);var i=g-r*n;return i=E(m,"numbersTranslate",0,i,O,Math.max),s(i,t)+o(r)}))}(e,z,t,{numbersX:m,numbersY:b,numbersScaler:C,transitionOpts:d,onComplete:g}),D&&(I={range:P.gauge.axis.range,color:P.gauge.bgcolor,line:{color:P.gauge.bordercolor,width:0},thickness:1},L={range:P.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:P.gauge.bordercolor,width:P.gauge.borderwidth},thickness:1});var W=z.selectAll("g.angular").data(O?t:[]);W.exit().remove();var Z=z.selectAll("g.angularaxis").data(O?t:[]);Z.exit().remove(),O&&function(e,t,i,a){var o,u,h,f,d=i[0].trace,m=a.size,g=a.radius,y=a.innerRadius,v=a.gaugeBg,x=a.gaugeOutline,_=[m.l+m.w/2,m.t+m.h/2+g/2],b=a.gauge,w=a.layer,M=a.transitionOpts,S=a.onComplete,E=Math.PI/2;function C(e){var t=d.gauge.axis.range[0],r=(e-t)/(d.gauge.axis.range[1]-t)*Math.PI-E;return r<-E?-E:r>E?E:r}function I(e){return r.svg.arc().innerRadius((y+g)/2-e/2*(g-y)).outerRadius((y+g)/2+e/2*(g-y)).startAngle(-E)}function L(e){e.attr("d",(function(e){return I(e.thickness).startAngle(C(e.range[0])).endAngle(C(e.range[1]))()}))}b.enter().append("g").classed("angular",!0),b.attr("transform",s(_[0],_[1])),w.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),w.selectAll("g.xangularaxistick,path,text").remove(),(o=A(e,d.gauge.axis)).type="linear",o.range=d.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var P=function(e){return(o.range[0]-e.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},z={},D=p.makeLabelFns(o,0).labelStandoff;z.xFn=function(e){var t=P(e);return Math.cos(t)*D},z.yFn=function(e){var t=P(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(D+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*c)},z.anchorFn=function(e){var t=P(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},z.heightFn=function(e,t,r){var n=P(e);return-.5*(1+Math.sin(n))*r};var O=function(e){return s(_[0]+g*Math.cos(e),_[1]-g*Math.sin(e))};h=function(e){return O(P(e))};if(u=p.calcTicks(o),f=p.getTickSigns(o)[2],o.visible){f="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;p.drawTicks(e,o,{vals:u,layer:w,path:"M"+f*R+",0h"+f*o.ticklen,transFn:function(e){var t=P(e);return O(t)+"rotate("+-l(t)+")"}}),p.drawLabels(e,o,{vals:u,layer:w,transFn:h,labelFns:z})}var F=[v].concat(d.gauge.steps),B=b.selectAll("g.bg-arc").data(F);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(L).call(k),B.exit().remove();var j=I(d.gauge.bar.thickness),N=b.selectAll("g.value-arc").data([d.gauge.bar]);N.enter().append("g").classed("value-arc",!0).append("path");var U=N.select("path");T(M)?(U.transition().duration(M.duration).ease(M.easing).each("end",(function(){S&&S()})).each("interrupt",(function(){S&&S()})).attrTween("d",function(e,t,r){return function(){var i=n(t,r);return function(t){return e.endAngle(i(t))()}}}(j,C(i[0].lastY),C(i[0].y))),d._lastValue=i[0].y):U.attr("d","number"==typeof i[0].y?j.endAngle(C(i[0].y)):"M0,0Z"),U.call(k),N.exit().remove(),F=[];var V=d.gauge.threshold.value;(V||0===V)&&F.push({range:[V,V],color:d.gauge.threshold.color,line:{color:d.gauge.threshold.line.color,width:d.gauge.threshold.line.width},thickness:d.gauge.threshold.thickness});var q=b.selectAll("g.threshold-arc").data(F);q.enter().append("g").classed("threshold-arc",!0).append("path"),q.select("path").call(L).call(k),q.exit().remove();var H=b.selectAll("g.gauge-outline").data([x]);H.enter().append("g").classed("gauge-outline",!0).append("path"),H.select("path").call(L).call(k),H.exit().remove()}(e,0,t,{radius:U,innerRadius:V,gauge:W,layer:Z,size:B,gaugeBg:I,gaugeOutline:L,transitionOpts:d,onComplete:g});var Y=z.selectAll("g.bullet").data(R?t:[]);Y.exit().remove();var X=z.selectAll("g.bulletaxis").data(R?t:[]);X.exit().remove(),R&&function(e,t,r,n){var i,a,o,l,c,u=r[0].trace,f=n.gauge,d=n.layer,m=n.gaugeBg,g=n.gaugeOutline,v=n.size,x=u.domain,_=n.transitionOpts,b=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",s(v.l,v.t)),d.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),d.selectAll("g.xbulletaxistick,path,text").remove();var w=v.h,M=u.gauge.bar.thickness*w,S=x.x[0],E=x.x[0]+(x.x[1]-x.x[0])*(u._hasNumber||u._hasDelta?1-h.bulletNumberDomainSize:1);function C(e){e.attr("width",(function(e){return Math.max(0,i.c2p(e.range[1])-i.c2p(e.range[0]))})).attr("x",(function(e){return i.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*w})).attr("height",(function(e){return e.thickness*w}))}(i=A(e,u.gauge.axis))._id="xbulletaxis",i.domain=[S,E],i.setScale(),a=p.calcTicks(i),o=p.makeTransTickFn(i),l=p.getTickSigns(i)[2],c=v.t+v.h,i.visible&&(p.drawTicks(e,i,{vals:"inside"===i.ticks?p.clipEnds(i,a):a,layer:d,path:p.makeTickPath(i,c,l),transFn:o}),p.drawLabels(e,i,{vals:a,layer:d,transFn:o,labelFns:p.makeLabelFns(i,c)}));var I=[m].concat(u.gauge.steps),L=f.selectAll("g.bg-bullet").data(I);L.enter().append("g").classed("bg-bullet",!0).append("rect"),L.select("rect").call(C).call(k),L.exit().remove();var P=f.selectAll("g.value-bullet").data([u.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",M).attr("y",(w-M)/2).call(k),T(_)?P.select("rect").transition().duration(_.duration).ease(_.easing).each("end",(function(){b&&b()})).each("interrupt",(function(){b&&b()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0),P.exit().remove();var z=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),D=f.selectAll("g.threshold-bullet").data(z);D.enter().append("g").classed("threshold-bullet",!0).append("line"),D.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*w).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*w).call(y.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),D.exit().remove();var O=f.selectAll("g.gauge-outline").data([g]);O.enter().append("g").classed("gauge-outline",!0).append("rect"),O.select("rect").call(C).call(k),O.exit().remove()}(e,0,t,{gauge:Y,layer:X,size:B,gaugeBg:I,gaugeOutline:L,transitionOpts:d,onComplete:g});var $=z.selectAll("text.title").data(t);$.exit().remove(),$.enter().append("text").classed("title",!0),$.attr("text-anchor",(function(){return R?x.right:x[P.title.align]})).text(P.title.text).call(u.font,P.title.font).call(f.convertToTspans,e),$.attr("transform",(function(){var e,t=B.l+B.w*_[P.title.align],r=h.titlePadding,n=u.bBox($.node());return D?(O&&(e=P.gauge.axis.visible?u.bBox(Z.node()).top-r-n.bottom:B.t+B.h/2-U/2-n.bottom-r),R&&(e=b-(n.top+n.bottom)/2,t=B.l-h.bulletPadding*B.w)):e=P._numbersTop-r-n.bottom,s(t,e)}))}))}}}),vw=m({"src/traces/indicator/index.js"(e,t){t.exports={moduleType:"trace",name:"indicator",basePlotModule:fw(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:pw(),supplyDefaults:mw().supplyDefaults,calc:gw().calc,plot:yw(),meta:{}}}}),xw=m({"lib/indicator.js"(e,t){t.exports=vw()}}),_w=m({"src/traces/table/attributes.js"(e,t){var r=bn(),n=B().extendFlat,i=De().overrideAll,a=j(),o=Ma().attributes,s=It().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:n({},r.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:n({},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:n({},r.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:n({},a({arrayOk:!0}))}},"calc","from-root")}}),bw=m({"src/traces/table/defaults.js"(e,t){var r=ct(),n=_w(),i=Ma().defaults;t.exports=function(e,t,a,o){function s(i,a){return r.coerce(e,t,n,i,a)}i(t,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),r.coerceFont(s,"header.font",o.font),function(e,t){for(var r=e.columnorder||[],n=e.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(e,t){return e-t})),o=i.map((function(e){return a.indexOf(e)})),s=o.length;s<n;s++)o.push(s);t("columnorder",o)}(t,s),s("cells.values"),s("cells.format"),s("cells.align"),s("cells.prefix"),s("cells.suffix"),s("cells.height"),s("cells.line.width"),s("cells.line.color"),s("cells.fill.color"),r.coerceFont(s,"cells.font",o.font),t._length=null}}}),ww=m({"src/traces/table/calc.js"(e,t){var r=Kx().wrap;t.exports=function(){return r({})}}}),Tw=m({"src/traces/table/constants.js"(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"}}}}),kw=m({"src/traces/table/data_preparation_helper.js"(e,t){var r=Tw(),n=B().extendFlat,i=M(),a=I().isTypedArray,o=I().isArrayOrTypedArray;function s(e){if(o(e)){for(var t=0,r=0;r<e.length;r++)t=Math.max(t,s(e[r]));return t}return e}function l(e,t){return e+t}function c(e){var t,r=e.slice(),n=1/0,i=0;for(t=0;t<r.length;t++)a(r[t])?r[t]=Array.from(r[t]):o(r[t])||(r[t]=[r[t]]),n=Math.min(n,r[t].length),i=Math.max(i,r[t].length);if(n!==i)for(t=0;t<r.length;t++){var s=i-r[t].length;s&&(r[t]=r[t].concat(u(s)))}return r}function u(e){for(var t=new Array(e),r=0;r<e;r++)t[r]="";return t}function h(e){return e.calcdata.columns.reduce((function(t,r){return r.xIndex<e.xIndex?t+r.columnWidth:t}),0)}function f(e,t){return Object.keys(e).map((function(r){return n({},e[r],{auxiliaryBlocks:t})}))}function p(e,t){for(var r,n={},i=0,a=0,o={firstRowIndex:null,lastRowIndex:null,rows:[]},s=0,l=0,c=0;c<e.length;c++)r=e[c],o.rows.push({rowIndex:c,rowHeight:r}),((a+=r)>=t||c===e.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}t.exports=function(e,t){var a=c(t.cells.values),d=function(e){return e.slice(t.header.values.length,e.length)},m=c(t.header.values);m.length&&!m[0].length&&(m[0]=[""],m=c(m));var g=m.concat(d(a).map((function(){return u((m[0]||[""]).length)}))),y=t.domain,v=Math.floor(e._fullLayout._size.w*(y.x[1]-y.x[0])),x=Math.floor(e._fullLayout._size.h*(y.y[1]-y.y[0])),_=t.header.values.length?g[0].map((function(){return t.header.height})):[r.emptyHeaderHeight],b=a.length?a[0].map((function(){return t.cells.height})):[],w=_.reduce(l,0),T=p(b,x-w+r.uplift),k=f(p(_,w),[]),A=f(T,k),M={},S=t._fullInput.columnorder;o(S)&&(S=Array.from(S)),S=S.concat(d(a.map((function(e,t){return t}))));var E=g.map((function(e,r){var n=o(t.columnwidth)?t.columnwidth[Math.min(r,t.columnwidth.length-1)]:t.columnwidth;return i(n)?Number(n):1})),C=E.reduce(l,0);E=E.map((function(e){return e/C*v}));var I=Math.max(s(t.header.line.width),s(t.cells.line.width)),L={key:t.uid+e._context.staticPlot,translateX:y.x[0]*e._fullLayout._size.w,translateY:e._fullLayout._size.h*(1-y.y[1]),size:e._fullLayout._size,width:v,maxLineWidth:I,height:x,columnOrder:S,groupHeight:x,rowBlocks:A,headerRowBlocks:k,scrollY:0,cells:n({},t.cells,{values:a}),headerCells:n({},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){var r=M[e];return M[e]=(r||0)+1,{key:e+"__"+M[e],label:e,specIndex:t,xIndex:S[t],xScale:h,x:void 0,calcdata:void 0,columnWidth:E[t]}}))};return L.columns.forEach((function(e){e.calcdata=L,e.x=h(e)})),L}}}),Aw=m({"src/traces/table/data_split_helpers.js"(e){var t=B().extendFlat;e.splitToPanels=function(e){var r=[0,0],n=t({},e,{key:"header",type:"header",page:0,prevPages:r,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:r,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:r,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),n]},e.splitToCells=function(e){var t=function(e){var t=e.rowBlocks[e.page],r=t?t.rows[0].rowIndex:0;return[r,t?r+t.rows.length:0]}(e);return(e.values||[]).slice(t[0],t[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:t[0]+n,column:e,calcdata:e.calcdata,page:e.page,rowBlocks:e.rowBlocks,value:r}}))}}}),Mw=m({"src/traces/table/plot.js"(e,t){var r=Tw(),n=b(),i=ct(),a=i.numberFormat,o=Kx(),s=er(),l=Et(),c=ct().raiseToTop,u=ct().strTranslate,h=ct().cancelTransition,f=kw(),p=Aw(),d=W();function m(e){return Math.ceil(e.calcdata.maxLineWidth/2)}function g(e,t){return"clip"+e._fullLayout._uid+"_scrollAreaBottomClip_"+t.key}function y(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 x(e,t,i){var a=e.selectAll("."+r.cn.scrollbarKit).data(o.repeat,o.keyFun);a.enter().append("g").classed(r.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),a.each((function(e){var t=e.scrollbarState;t.totalHeight=function(e){var t=e.rowBlocks;return R(t,t.length-1)+(t.length?F(t[t.length-1],1/0):1)}(e),t.scrollableAreaHeight=e.groupHeight-E(e),t.currentlyVisibleHeight=Math.min(t.totalHeight,t.scrollableAreaHeight),t.ratio=t.currentlyVisibleHeight/t.totalHeight,t.barLength=Math.max(t.ratio*t.currentlyVisibleHeight,r.goldenRatio*r.scrollbarWidth),t.barWiggleRoom=t.currentlyVisibleHeight-t.barLength,t.wiggleRoom=Math.max(0,t.totalHeight-t.scrollableAreaHeight),t.topY=0===t.barWiggleRoom?0:e.scrollY/t.wiggleRoom*t.barWiggleRoom,t.bottomY=t.topY+t.barLength,t.dragMultiplier=t.wiggleRoom/t.barWiggleRoom})).attr("transform",(function(e){var t=e.width+r.scrollbarWidth/2+r.scrollbarOffset;return u(t,E(e))}));var s=a.selectAll("."+r.cn.scrollbar).data(o.repeat,o.keyFun);s.enter().append("g").classed(r.cn.scrollbar,!0);var l=s.selectAll("."+r.cn.scrollbarSlider).data(o.repeat,o.keyFun);l.enter().append("g").classed(r.cn.scrollbarSlider,!0),l.attr("transform",(function(e){return u(0,e.scrollbarState.topY||0)}));var c=l.selectAll("."+r.cn.scrollbarGlyph).data(o.repeat,o.keyFun);c.enter().append("line").classed(r.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",r.scrollbarWidth).attr("stroke-linecap","round").attr("y1",r.scrollbarWidth/2),c.attr("y2",(function(e){return e.scrollbarState.barLength-r.scrollbarWidth/2})).attr("stroke-opacity",(function(e){return e.columnDragInProgress||!e.scrollbarState.barWiggleRoom||i?0:.4})),c.transition().delay(0).duration(0),c.transition().delay(r.scrollbarHideDelay).duration(r.scrollbarHideDuration).attr("stroke-opacity",0);var h=s.selectAll("."+r.cn.scrollbarCaptureZone).data(o.repeat,o.keyFun);h.enter().append("line").classed(r.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",r.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",(function(r){var i=n.event.y,a=this.getBoundingClientRect(),o=r.scrollbarState,s=i-a.top,l=n.scale.linear().domain([0,o.scrollableAreaHeight]).range([0,o.totalHeight]).clamp(!0);o.topY<=s&&s<=o.bottomY||I(t,e,null,l(s-o.barLength/2))(r)})).call(n.behavior.drag().origin((function(e){return n.event.stopPropagation(),e.scrollbarState.scrollbarScrollInProgress=!0,e})).on("drag",I(t,e)).on("dragend",(function(){}))),h.attr("y2",(function(e){return e.scrollbarState.scrollableAreaHeight})),t._context.staticPlot&&(c.remove(),h.remove())}function _(e,t,i,a){var l=function(e){var t=e.selectAll("."+r.cn.columnCells).data(o.repeat,o.keyFun);return t.enter().append("g").classed(r.cn.columnCells,!0),t.exit().remove(),t}(i),c=function(e){var t=e.selectAll("."+r.cn.columnCell).data(p.splitToCells,(function(e){return e.keyWithinBlock}));return t.enter().append("g").classed(r.cn.columnCell,!0),t.exit().remove(),t}(l);!function(e){e.each((function(e,t){var r=e.calcdata.cells.font,n=e.column.specIndex,i={size:k(r.size,n,t),color:k(r.color,n,t),family:k(r.family,n,t),weight:k(r.weight,n,t),style:k(r.style,n,t),variant:k(r.variant,n,t),textcase:k(r.textcase,n,t),lineposition:k(r.lineposition,n,t),shadow:k(r.shadow,n,t)};e.rowNumber=e.key,e.align=k(e.calcdata.cells.align,n,t),e.cellBorderWidth=k(e.calcdata.cells.line.width,n,t),e.font=i}))}(c);var u=function(e){var t=e.selectAll("."+r.cn.cellRect).data(o.repeat,(function(e){return e.keyWithinBlock}));return t.enter().append("rect").classed(r.cn.cellRect,!0),t}(c);!function(e){e.attr("width",(function(e){return e.column.columnWidth})).attr("stroke-width",(function(e){return e.cellBorderWidth})).each((function(e){var t=n.select(this);d.stroke(t,k(e.calcdata.cells.line.color,e.column.specIndex,e.rowNumber)),d.fill(t,k(e.calcdata.cells.fill.color,e.column.specIndex,e.rowNumber))}))}(u);var h=function(e){var t=e.selectAll("."+r.cn.cellTextHolder).data(o.repeat,(function(e){return e.keyWithinBlock}));return t.enter().append("g").classed(r.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),t}(c),f=function(e){var t=e.selectAll("."+r.cn.cellText).data(o.repeat,(function(e){return e.keyWithinBlock}));return t.enter().append("text").classed(r.cn.cellText,!0).style("cursor",(function(){return"auto"})).on("mousedown",(function(){n.event.stopPropagation()})),t}(h);(function(e){e.each((function(e){s.font(n.select(this),e.font)}))})(f),w(f,t,a,e),O(c)}function w(e,t,i,o){e.text((function(e){var t=e.column.specIndex,n=e.rowNumber,i=e.value,o="string"==typeof i,s=o&&i.match(/<br>/i),l=!o||s;e.mayHaveMarkup=o&&i.match(/[<&>]/);var c=function(e){return"string"==typeof e&&e.match(r.latexCheck)}(i);e.latex=c;var u,h,f=c?"":k(e.calcdata.cells.prefix,t,n)||"",p=c?"":k(e.calcdata.cells.suffix,t,n)||"",d=c?null:k(e.calcdata.cells.format,t,n)||null,m=f+(d?a(d)(e.value):e.value)+p;if(e.wrappingNeeded=!e.wrapped&&!l&&!c&&(u=T(m)),e.cellHeightMayIncrease=s||c||e.mayHaveMarkup||(void 0===u?T(m):u),e.needsConvertToTspans=e.mayHaveMarkup||e.wrappingNeeded||e.latex,e.wrappingNeeded){var g=(" "===r.wrapSplitCharacter?m.replace(/<a href=/gi,"<a_href="):m).split(r.wrapSplitCharacter),y=" "===r.wrapSplitCharacter?g.map((function(e){return e.replace(/<a_href=/gi,"<a href=")})):g;e.fragments=y.map((function(e){return{text:e,width:null}})),e.fragments.push({fragment:r.wrapSpacer,width:null}),h=y.join(r.lineBreaker)+r.lineBreaker+r.wrapSpacer}else delete e.fragments,h=m;return h})).attr("dy",(function(e){return e.needsConvertToTspans?0:"0.75em"})).each((function(e){var a=this,s=n.select(a),c=e.wrappingNeeded?P:z;e.needsConvertToTspans?l.convertToTspans(s,o,c(i,a,t,o,e)):n.select(a.parentNode).attr("transform",(function(e){return u(D(e),r.cellPad)})).attr("text-anchor",(function(e){return{left:"start",center:"middle",right:"end"}[e.align]}))}))}function T(e){return-1!==e.indexOf(r.wrapSplitCharacter)}function k(e,t,r){if(i.isArrayOrTypedArray(e)){var n=e[Math.min(t,e.length-1)];return i.isArrayOrTypedArray(n)?n[Math.min(r,n.length-1)]:n}return e}function A(e,t,n){e.transition().ease(r.releaseTransitionEase).duration(r.releaseTransitionDuration).attr("transform",u(t.x,n))}function M(e){return"cells"===e.type}function S(e){return"header"===e.type}function E(e){return(e.rowBlocks.length?e.rowBlocks[0].auxiliaryBlocks:[]).reduce((function(e,t){return e+F(t,1/0)}),0)}function C(e,t,r){var n=v(t)[0];if(void 0!==n){var i=n.rowBlocks,a=n.calcdata,o=R(i,i.length),s=n.calcdata.groupHeight-E(n),l=a.scrollY=Math.max(0,Math.min(o-s,a.scrollY)),c=function(e,t,r){for(var n=[],i=0,a=0;a<e.length;a++){for(var o=e[a],s=o.rows,l=0,c=0;c<s.length;c++)l+=s[c].rowHeight;o.allRowsHeight=l,t<i+l&&t+r>i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),t.each((function(e,t){e.page=c[t],e.scrollY=l})),t.attr("transform",(function(e){var t=R(e.rowBlocks,e.page)-e.scrollY;return u(0,t)})),e&&(L(e,r,t,c,n.prevPages,n,0),L(e,r,t,c,n.prevPages,n,1),x(r,e))}}function I(e,t,i,a){return function(o){var s=o.calcdata?o.calcdata:o,l=t.filter((function(e){return s.key===e.key})),c=i||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*n.event.dy:a;var h=l.selectAll("."+r.cn.yColumn).selectAll("."+r.cn.columnBlock).filter(M);return C(e,h,l),s.scrollY===u}}function L(e,t,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(e,t){return t===o&&n[t]!==i[t]}));_(e,t,a,r),i[o]=n[o]})))}function P(e,t,i,a){return function(){var o=n.select(t.parentNode);o.each((function(e){var t=e.fragments;o.selectAll("tspan.line").each((function(e,r){t[r].width=this.getComputedTextLength()}));var n,i,a=t[t.length-1].width,s=t.slice(0,-1),l=[],c=0,u=e.column.columnWidth-2*r.cellPad;for(e.value="";s.length;)c+(i=(n=s.shift()).width+a)>u&&(e.value+=l.join(r.wrapSpacer)+r.lineBreaker,l=[],c=0),l.push(n.text),c+=i;c&&(e.value+=l.join(r.wrapSpacer)),e.wrapped=!0})),o.selectAll("tspan.line").remove(),w(o.select("."+r.cn.cellText),i,e,a),n.select(t.parentNode.parentNode).call(O)}}function z(e,t,i,a,o){return function(){if(!o.settledY){var s=n.select(t.parentNode),l=j(o),c=o.key-l.firstRowIndex,h=l.rows[c].rowHeight,f=o.cellHeightMayIncrease?t.parentNode.getBoundingClientRect().height+2*r.cellPad:h,p=Math.max(f,h);p-l.rows[c].rowHeight&&(l.rows[c].rowHeight=p,e.selectAll("."+r.cn.columnCell).call(O),C(null,e.filter(M),0),x(i,a,!0)),s.attr("transform",(function(){var e=this,t=e.parentNode.getBoundingClientRect(),i=n.select(e.parentNode).select("."+r.cn.cellRect).node().getBoundingClientRect(),a=e.transform.baseVal.consolidate(),s=i.top-t.top+(a?a.matrix.f:r.cellPad);return u(D(o,n.select(e.parentNode).select("."+r.cn.cellTextHolder).node().getBoundingClientRect().width),s)})),o.settledY=!0}}}function D(e,t){switch(e.align){case"left":default:return r.cellPad;case"right":return e.column.columnWidth-(t||0)-r.cellPad;case"center":return(e.column.columnWidth-(t||0))/2}}function O(e){e.attr("transform",(function(e){var t=e.rowBlocks[0].auxiliaryBlocks.reduce((function(e,t){return e+F(t,1/0)}),0),r=F(j(e),e.key);return u(0,r+t)})).selectAll("."+r.cn.cellRect).attr("height",(function(e){return function(e,t){return e.rows[t-e.firstRowIndex]}(j(e),e.key).rowHeight}))}function R(e,t){for(var r=0,n=t-1;n>=0;n--)r+=B(e[n]);return r}function F(e,t){for(var r=0,n=0;n<e.rows.length&&e.rows[n].rowIndex<t;n++)r+=e.rows[n].rowHeight;return r}function B(e){var t=e.allRowsHeight;if(void 0!==t)return t;for(var r=0,n=0;n<e.rows.length;n++)r+=e.rows[n].rowHeight;return e.allRowsHeight=r,r}function j(e){return e.rowBlocks[e.page]}t.exports=function(e,t){var i=!e._context.staticPlot,a=e._fullLayout._paper.selectAll("."+r.cn.table).data(t.map((function(t){var r=o.unwrap(t).trace;return f(e,r)})),o.keyFun);a.exit().remove(),a.enter().append("g").classed(r.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 l=a.selectAll("."+r.cn.tableControlView).data(o.repeat,o.keyFun),d=l.enter().append("g").classed(r.cn.tableControlView,!0).style("box-sizing","content-box");if(i){var b="onwheel"in document?"wheel":"mousewheel";d.on("mousemove",(function(t){l.filter((function(e){return t===e})).call(x,e)})).on(b,(function(t){if(!t.scrollbarState.wheeling){t.scrollbarState.wheeling=!0;var r=t.scrollY+n.event.deltaY;I(e,l,null,r)(t)||(n.event.stopPropagation(),n.event.preventDefault()),t.scrollbarState.wheeling=!1}})).call(x,e,!0)}l.attr("transform",(function(e){return u(e.size.l,e.size.t)}));var w=l.selectAll("."+r.cn.scrollBackground).data(o.repeat,o.keyFun);w.enter().append("rect").classed(r.cn.scrollBackground,!0).attr("fill","none"),w.attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})),l.each((function(t){s.setClipUrl(n.select(this),g(e,t),e)}));var T=l.selectAll("."+r.cn.yColumn).data((function(e){return e.columns}),o.keyFun);T.enter().append("g").classed(r.cn.yColumn,!0),T.exit().remove(),T.attr("transform",(function(e){return u(e.x,0)})),i&&T.call(n.behavior.drag().origin((function(t){return A(n.select(this),t,-r.uplift),c(this),t.calcdata.columnDragInProgress=!0,x(l.filter((function(e){return t.calcdata.key===e.key})),e),t})).on("drag",(function(e){var t=n.select(this),i=function(t){return(e===t?n.event.x:t.x)+t.columnWidth/2};e.x=Math.max(-r.overdrag,Math.min(e.calcdata.width+r.overdrag-e.columnWidth,n.event.x)),v(T).filter((function(t){return t.calcdata.key===e.calcdata.key})).sort((function(e,t){return i(e)-i(t)})).forEach((function(t,r){t.xIndex=r,t.x=e===t?t.x:t.xScale(t)})),T.filter((function(t){return e!==t})).transition().ease(r.transitionEase).duration(r.transitionDuration).attr("transform",(function(e){return u(e.x,0)})),t.call(h).attr("transform",u(e.x,-r.uplift))})).on("dragend",(function(t){var r=n.select(this),i=t.calcdata;t.x=t.xScale(t),t.calcdata.columnDragInProgress=!1,A(r,t,0),function(e,t,r){var n=t.gdColumnsOriginalOrder;t.gdColumns.sort((function(e,t){return r[n.indexOf(e)]-r[n.indexOf(t)]})),t.columnorder=r,e.emit("plotly_restyle")}(e,i,i.columns.map((function(e){return e.xIndex})))}))),T.each((function(t){s.setClipUrl(n.select(this),y(e,t),e)}));var k=T.selectAll("."+r.cn.columnBlock).data(p.splitToPanels,o.keyFun);k.enter().append("g").classed(r.cn.columnBlock,!0).attr("id",(function(e){return e.key})),k.style("cursor",(function(e){return e.dragHandle?"ew-resize":e.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"}));var E=k.filter(S),L=k.filter(M);i&&L.call(n.behavior.drag().origin((function(e){return n.event.stopPropagation(),e})).on("drag",I(e,l,-1)).on("dragend",(function(){}))),_(e,l,E,k),_(e,l,L,k);var P=l.selectAll("."+r.cn.scrollAreaClip).data(o.repeat,o.keyFun);P.enter().append("clipPath").classed(r.cn.scrollAreaClip,!0).attr("id",(function(t){return g(e,t)}));var z=P.selectAll("."+r.cn.scrollAreaClipRect).data(o.repeat,o.keyFun);z.enter().append("rect").classed(r.cn.scrollAreaClipRect,!0).attr("x",-r.overdrag).attr("y",-r.uplift).attr("fill","none"),z.attr("width",(function(e){return e.width+2*r.overdrag})).attr("height",(function(e){return e.height+r.uplift})),T.selectAll("."+r.cn.columnBoundary).data(o.repeat,o.keyFun).enter().append("g").classed(r.cn.columnBoundary,!0);var D=T.selectAll("."+r.cn.columnBoundaryClippath).data(o.repeat,o.keyFun);D.enter().append("clipPath").classed(r.cn.columnBoundaryClippath,!0),D.attr("id",(function(t){return y(e,t)}));var O=D.selectAll("."+r.cn.columnBoundaryRect).data(o.repeat,o.keyFun);O.enter().append("rect").classed(r.cn.columnBoundaryRect,!0).attr("fill","none"),O.attr("width",(function(e){return e.columnWidth+2*m(e)})).attr("height",(function(e){return e.calcdata.height+2*m(e)+r.uplift})).attr("x",(function(e){return-m(e)})).attr("y",(function(e){return-m(e)})),C(null,L,l)}}}),Sw=m({"src/traces/table/base_plot.js"(e){var t=Tt().getModuleCalcData,r=Mw(),n="table";e.name=n,e.plot=function(e){var i=t(e.calcdata,n)[0];i.length&&r(e,i)},e.clean=function(e,t,r,i){var a=i._has&&i._has(n),o=t._has&&t._has(n);a&&!o&&i._paperdiv.selectAll(".table").remove()}}}),Ew=m({"src/traces/table/index.js"(e,t){t.exports={attributes:_w(),supplyDefaults:bw(),calc:ww(),plot:Mw(),moduleType:"trace",name:"table",basePlotModule:Sw(),categories:["noOpacity"],meta:{}}}}),Cw=m({"lib/table.js"(e,t){t.exports=Ew()}}),Iw=m({"src/traces/carpet/axis_attributes.js"(e,t){var r=j(),n=G(),i=Lt(),a=It().descriptionWithDates,o=De().overrideAll,s=Oe().dash,l=B().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:r({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:l({},i.labelalias,{editType:"calc"}),tickfont:r({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:n.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:l({},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:l({},s,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:n.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"}}}),Lw=m({"src/traces/carpet/attributes.js"(e,t){var r=j(),n=Iw(),i=G(),a=r({editType:"calc"}),o=kn().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:n,baxis:n,font:a,color:{valType:"color",dflt:i.defaultLine,editType:"plot"},zorder:o}}}),Pw=m({"src/traces/carpet/xy_defaults.js"(e,t){var r=ct().isArray1D;t.exports=function(e,t,n){var i=n("x"),a=i&&i.length,o=n("y"),s=o&&o.length;if(!a&&!s)return!1;if(t._cheater=!i,a&&!r(i)||s&&!r(o))t._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),t.a&&t.a.length&&(l=Math.min(l,t.a.length)),t.b&&t.b.length&&(l=Math.min(l,t.b.length)),t._length=l}return!0}}}),zw=m({"src/traces/carpet/axis_defaults.js"(e,t){var r=Lw(),n=W().addOpacity,i=He(),a=ct(),o=Ft(),s=Ut(),l=Vt(),c=Ti(),u=rr(),h=nr();t.exports=function(e,t,f){var p=f.letter,d=f.font||{},m=r[p+"axis"];function g(r,n){return a.coerce(e,t,m,r,n)}function y(r,n){return a.coerce2(e,t,m,r,n)}f.name&&(t._name=f.name,t._id=f.name),g("autotypenumbers",f.autotypenumbersDflt);var v=g("type");"-"===v&&(f.data&&function(e,t){if("-"===e.type){var r=e[e._id.charAt(0)+"calendar"];e.type=h(t,r,{autotypenumbers:e.autotypenumbers})}}(t,f.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"),"array"===t.tickmode&&(g("arraytick0"),g("arraydtick")),g("labelpadding"),t._hovertitle=p,"date"===v&&i.getComponentMethod("calendars","handleDefaults")(e,t,"calendar",f.calendar),u(t,f.fullLayout),t.c2p=a.identity;var x=g("color",f.dfltColor),_=x===e.color?x:d.color;g("title.text")&&(a.coerceFont(g,"title.font",d,{overrideDflt:{size:a.bigFont(d.size),color:_}}),g("title.offset")),g("tickangle"),g("autorange",!t.isValidRange(e.range))&&g("rangemode"),g("range"),t.cleanRange(),g("fixedrange"),o(e,t,g,v),l(e,t,g,v,f),s(e,t,g,v,f),c(e,t,g,{data:f.data,dataAttr:p});var b=y("gridcolor",n(x,.3)),w=y("gridwidth"),T=y("griddash"),k=g("showgrid");k||(delete t.gridcolor,delete t.gridwidth,delete t.griddash);var A=y("startlinecolor",x),M=y("startlinewidth",w);g("startline",t.showgrid||!!A||!!M)||(delete t.startlinecolor,delete t.startlinewidth);var S=y("endlinecolor",x),E=y("endlinewidth",w);return g("endline",t.showgrid||!!S||!!E)||(delete t.endlinecolor,delete t.endlinewidth),k?(g("minorgridcount"),g("minorgridwidth",w),g("minorgriddash",T),g("minorgridcolor",n(b,.06)),t.minorgridcount||(delete t.minorgridwidth,delete t.minorgriddash,delete t.minorgridcolor)):(delete t.gridcolor,delete t.gridwidth,delete t.griddash),"none"===t.showticklabels&&(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}}}),Dw=m({"src/traces/carpet/ab_defaults.js"(e,t){var r=zw(),n=vt();t.exports=function(e,t,i,a,o){a("a")||(a("da"),a("a0")),a("b")||(a("db"),a("b0")),function(e,t,i,a){["aaxis","baxis"].forEach((function(o){var s=o.charAt(0),l=e[o]||{},c=n.newContainer(t,o),u={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};r(l,c,u),c._categories=c._categories||[],!e[o]&&"-"!==l.type&&(e[o]={type:l.type})}))}(e,t,i,o)}}}),Ow=m({"src/traces/carpet/defaults.js"(e,t){var r=ct(),n=Pw(),i=Dw(),a=Lw(),o=G();t.exports=function(e,t,s,l){function c(n,i){return r.coerce(e,t,a,n,i)}t._clipPathId="clip"+t.uid+"carpet";var u=c("color",o.defaultLine);r.coerceFont(c,"font",l.font),c("carpet"),i(e,t,l,c,u),t.a&&t.b?(t.a.length<3&&(t.aaxis.smoothing=0),t.b.length<3&&(t.baxis.smoothing=0),n(e,t,c)||(t.visible=!1),t._cheater&&c("cheaterslope"),c("zorder")):t.visible=!1}}}),Rw=m({"src/traces/carpet/map_1d_array.js"(e,t){var r=ct().isArrayOrTypedArray;t.exports=function(e,t,n){var i;for(r(e)?e.length>t.length&&(e=e.slice(0,t.length)):e=[],i=0;i<t.length;i++)e[i]=n(t[i]);return e}}}),Fw=m({"src/traces/carpet/makepath.js"(e,t){t.exports=function(e,t,r){if(0===e.length)return"";var n,i=[],a=r?3:1;for(n=0;n<e.length;n+=a)i.push(e[n]+","+t[n]),r&&n<e.length-a&&(i.push("C"),i.push([e[n+1]+","+t[n+1],e[n+2]+","+t[n+2]+" "].join(" ")));return i.join(r?"":"L")}}}),Bw=m({"src/traces/carpet/orient_text.js"(e,t){t.exports=function(e,t,r,n,i,a){var o=i[0]*e.dpdx(t),s=i[1]*e.dpdy(r),l=1,c=1;if(a){var u=Math.sqrt(i[0]*i[0]+i[1]*i[1]),h=Math.sqrt(a[0]*a[0]+a[1]*a[1]),f=(i[0]*a[0]+i[1]*a[1])/u/h;c=Math.max(0,f)}var p=180*Math.atan2(s,o)/Math.PI;return p<-90?(p+=180,l=-l):p>90&&(p-=180,l=-l),{angle:p,flip:l,p:e.c2p(n,t,r),offsetMultplier:c}}}}),jw=m({"src/traces/carpet/plot.js"(e,t){var r=b(),n=er(),i=Rw(),a=Fw(),o=Bw(),s=Et(),l=ct(),c=l.strRotate,u=l.strTranslate,h=St();function f(e,t,o,s,l,c,u){var h="const-"+l+"-lines",f=o.selectAll("."+h).data(c);f.enter().append("path").classed(h,!0).style("vector-effect",u?"none":"non-scaling-stroke"),f.each((function(o){var s=o,l=s.x,c=s.y,u=i([],l,e.c2p),h=i([],c,t.c2p),f="M"+a(u,h,s.smoothing);r.select(this).attr("d",f).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",n.dashStyle(s.dash,s.width)).style("fill","none")})),f.exit().remove()}function p(e,t,i,a,l,h,f,p){var d=h.selectAll("text."+p).data(f);d.enter().append("text").classed(p,!0);var m=0,g={};return d.each((function(l,h){var f;if("auto"===l.axis.tickangle)f=o(a,t,i,l.xy,l.dxy);else{var p=(l.axis.tickangle+180)*Math.PI/180;f=o(a,t,i,l.xy,[Math.cos(p),Math.sin(p)])}h||(g={angle:f.angle,flip:f.flip});var d=(l.endAnchor?-1:1)*f.flip,y=r.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(n.font,l.font).text(l.text).call(s.convertToTspans,e),v=n.bBox(this);y.attr("transform",u(f.p[0],f.p[1])+c(f.angle)+u(l.axis.labelpadding*d,.3*v.height)),m=Math.max(m,v.width+l.axis.labelpadding)})),d.exit().remove(),g.maxExtent=m,g}t.exports=function(e,t,n,s){var c=e._context.staticPlot,u=t.xaxis,h=t.yaxis,d=e._fullLayout._clips;l.makeTraceGroups(s,n,"trace").each((function(t){var n=r.select(this),s=t[0],m=s.trace,y=m.aaxis,v=m.baxis,x=l.ensureSingle(n,"g","minorlayer"),_=l.ensureSingle(n,"g","majorlayer"),b=l.ensureSingle(n,"g","boundarylayer"),w=l.ensureSingle(n,"g","labellayer");n.style("opacity",m.opacity),f(u,h,_,0,"a",y._gridlines,!0),f(u,h,_,0,"b",v._gridlines,!0),f(u,h,x,0,"a",y._minorgridlines,!0),f(u,h,x,0,"b",v._minorgridlines,!0),f(u,h,b,0,"a-boundary",y._boundarylines,c),f(u,h,b,0,"b-boundary",v._boundarylines,c);var T=p(e,u,h,m,0,w,y._labels,"a-label"),k=p(e,u,h,m,0,w,v._labels,"b-label");(function(e,t,r,n,i,a,s,c){var u,h,f,p,d=l.aggNums(Math.min,null,r.a),m=l.aggNums(Math.max,null,r.a),y=l.aggNums(Math.min,null,r.b),v=l.aggNums(Math.max,null,r.b);u=.5*(d+m),h=y,f=r.ab2xy(u,h,!0),p=r.dxyda_rough(u,h),void 0===s.angle&&l.extendFlat(s,o(r,i,a,f,r.dxydb_rough(u,h))),g(e,t,r,0,f,p,r.aaxis,i,a,s,"a-title"),u=d,h=.5*(y+v),f=r.ab2xy(u,h,!0),p=r.dxydb_rough(u,h),void 0===c.angle&&l.extendFlat(c,o(r,i,a,f,r.dxyda_rough(u,h))),g(e,t,r,0,f,p,r.baxis,i,a,c,"b-title")})(e,w,m,0,u,h,T,k),function(e,t,r,n,o){var s,c,u,h,f=r.select("#"+e._clipPathId);f.size()||(f=r.append("clipPath").classed("carpetclip",!0));var p=l.ensureSingle(f,"path","carpetboundary"),d=t.clipsegments,m=[];for(h=0;h<d.length;h++)s=d[h],c=i([],s.x,n.c2p),u=i([],s.y,o.c2p),m.push(a(c,u,s.bicubic));var g="M"+m.join("L")+"Z";f.attr("id",e._clipPathId),p.attr("d",g)}(m,s,d,u,h)}))};var d=h.LINE_SPACING,m=(1-h.MID_SHIFT)/d+1;function g(e,t,i,a,l,h,f,p,g,y,v){var x=[];f.title.text&&x.push(f.title.text);var _=t.selectAll("text."+v).data(x),b=y.maxExtent;_.enter().append("text").classed(v,!0),_.each((function(){var t=o(i,p,g,l,h);-1===["start","both"].indexOf(f.showticklabels)&&(b=0);var a=f.title.font.size;b+=a+f.title.offset;var v=(y.angle+(y.flip<0?180:0)-t.angle+450)%360,x=v>90&&v<270,_=r.select(this);_.text(f.title.text).call(s.convertToTspans,e),x&&(b=(-s.lineCount(_)+m)*d*a-b),_.attr("transform",u(t.p[0],t.p[1])+c(t.angle)+u(0,b)).attr("text-anchor","middle").call(n.font,f.title.font)})),_.exit().remove()}}}),Nw=m({"src/traces/carpet/cheater_basis.js"(e,t){var r=ct().isArrayOrTypedArray;t.exports=function(e,t,n){var i,a,o,s,l,c=[],u=r(e)?e.length:e,h=r(t)?t.length:t,f=r(e)?e:null,p=r(t)?t:null;f&&(o=(f.length-1)/(f[f.length-1]-f[0])/(u-1)),p&&(s=(p.length-1)/(p[p.length-1]-p[0])/(h-1));var d,m=1/0,g=-1/0;for(a=0;a<h;a++)for(c[a]=[],l=p?(p[a]-p[0])*s:a/(h-1),i=0;i<u;i++)d=(f?(f[i]-f[0])*o:i/(u-1))-l*n,m=Math.min(d,m),g=Math.max(d,g),c[a][i]=d;var y=1/(g-m),v=-m*y;for(a=0;a<h;a++)for(i=0;i<u;i++)c[a][i]=y*c[a][i]+v;return c}}}),Uw=m({"src/traces/carpet/array_minmax.js"(e,t){var r=ct().isArrayOrTypedArray;function n(e,t){if(!r(e)||t>=10)return null;for(var i=1/0,a=-1/0,o=e.length,s=0;s<o;s++){var l=e[s];if(r(l)){var c=n(l,t+1);c&&(i=Math.min(c[0],i),a=Math.max(c[1],a))}else i=Math.min(l,i),a=Math.max(l,a)}return[i,a]}t.exports=function(e){return n(e,0)}}}),Vw=m({"src/traces/carpet/calc_gridlines.js"(e,t){var r=ar(),n=B().extendFlat;t.exports=function(e,t,i){var a,o,s,l,c,u,h,f,p,d,m,g,y,v,x=e["_"+t],_=e[t+"axis"],b=_._gridlines=[],w=_._minorgridlines=[],T=_._boundarylines=[],k=e["_"+i],A=e[i+"axis"];"array"===_.tickmode&&(_.tickvals=x.slice());var M=e._xctrl,S=e._yctrl,E=M[0].length,C=M.length,I=e._a.length,L=e._b.length;r.prepTicks(_),"array"===_.tickmode&&delete _.tickvals;var P=_.smoothing?3:1;function z(r){var n,a,o,s,l,c,u,h,p,d,m,g,y=[],v=[],x={};if("b"===t)for(a=e.b2j(r),o=Math.floor(Math.max(0,Math.min(L-2,a))),s=a-o,x.length=L,x.crossLength=I,x.xy=function(t){return e.evalxy([],t,a)},x.dxy=function(t,r){return e.dxydi([],t,o,r,s)},n=0;n<I;n++)c=Math.min(I-2,n),u=n-c,h=e.evalxy([],n,a),A.smoothing&&n>0&&(p=e.dxydi([],n-1,o,0,s),y.push(l[0]+p[0]/3),v.push(l[1]+p[1]/3),d=e.dxydi([],n-1,o,1,s),y.push(h[0]-d[0]/3),v.push(h[1]-d[1]/3)),y.push(h[0]),v.push(h[1]),l=h;else for(n=e.a2i(r),c=Math.floor(Math.max(0,Math.min(I-2,n))),u=n-c,x.length=I,x.crossLength=L,x.xy=function(t){return e.evalxy([],n,t)},x.dxy=function(t,r){return e.dxydj([],c,t,u,r)},a=0;a<L;a++)o=Math.min(L-2,a),s=a-o,h=e.evalxy([],n,a),A.smoothing&&a>0&&(m=e.dxydj([],c,a-1,u,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=e.dxydj([],c,a-1,u,1),y.push(h[0]-g[0]/3),v.push(h[1]-g[1]/3)),y.push(h[0]),v.push(h[1]),l=h;return x.axisLetter=t,x.axis=_,x.crossAxis=A,x.value=r,x.constvar=i,x.index=f,x.x=y,x.y=v,x.smoothing=A.smoothing,x}function D(r){var n,a,o,s,l,c=[],u=[],h={};if(h.length=x.length,h.crossLength=k.length,"b"===t)for(o=Math.max(0,Math.min(L-2,r)),l=Math.min(1,Math.max(0,r-o)),h.xy=function(t){return e.evalxy([],t,r)},h.dxy=function(t,r){return e.dxydi([],t,o,r,l)},n=0;n<E;n++)c[n]=M[r*P][n],u[n]=S[r*P][n];else for(a=Math.max(0,Math.min(I-2,r)),s=Math.min(1,Math.max(0,r-a)),h.xy=function(t){return e.evalxy([],r,t)},h.dxy=function(t,r){return e.dxydj([],a,t,s,r)},n=0;n<C;n++)c[n]=M[n][r*P],u[n]=S[n][r*P];return h.axisLetter=t,h.axis=_,h.crossAxis=A,h.value=x[r],h.constvar=i,h.index=r,h.x=c,h.y=u,h.smoothing=A.smoothing,h}if("array"===_.tickmode){for(l=5e-15,u=(c=[Math.floor((x.length-1-_.arraytick0)/_.arraydtick*(1+l)),Math.ceil(-_.arraytick0/_.arraydtick/(1+l))].sort((function(e,t){return e-t})))[0]-1,h=c[1]+1,f=u;f<h;f++)!((o=_.arraytick0+_.arraydtick*f)<0||o>x.length-1)&&b.push(n(D(o),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(f=u;f<h;f++)if(s=_.arraytick0+_.arraydtick*f,m=Math.min(s+_.arraydtick,x.length-1),!(s<0||s>x.length-1||m<0||m>x.length-1))for(g=x[s],y=x[m],a=0;a<_.minorgridcount;a++)!((v=m-s)<=0)&&!((d=g+(y-g)*(a+1)/(_.minorgridcount+1)*(_.arraydtick/v))<x[0]||d>x[x.length-1])&&w.push(n(z(d),{color:_.minorgridcolor,width:_.minorgridwidth,dash:_.minorgriddash}));_.startline&&T.push(n(D(0),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&T.push(n(D(x.length-1),{color:_.endlinecolor,width:_.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-_.tick0)/_.dtick*(1+l)),Math.ceil((x[0]-_.tick0)/_.dtick/(1+l))].sort((function(e,t){return e-t})))[0],h=c[1],f=u;f<=h;f++)p=_.tick0+_.dtick*f,b.push(n(z(p),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(f=u-1;f<h+1;f++)for(p=_.tick0+_.dtick*f,a=0;a<_.minorgridcount;a++)!((d=p+_.dtick*(a+1)/(_.minorgridcount+1))<x[0]||d>x[x.length-1])&&w.push(n(z(d),{color:_.minorgridcolor,width:_.minorgridwidth,dash:_.minorgriddash}));_.startline&&T.push(n(z(x[0]),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&T.push(n(z(x[x.length-1]),{color:_.endlinecolor,width:_.endlinewidth}))}}}}),qw=m({"src/traces/carpet/calc_labels.js"(e,t){var r=ar(),n=B().extendFlat;t.exports=function(e,t){var i,a,o,s=t._labels=[],l=t._gridlines;for(i=0;i<l.length;i++)o=l[i],-1!==["start","both"].indexOf(t.showticklabels)&&(a=r.tickText(t,o.value),n(a,{prefix:void 0,suffix:void 0,endAnchor:!0,xy:o.xy(0),dxy:o.dxy(0,0),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===i,isLast:i===l.length-1}),s.push(a)),-1!==["end","both"].indexOf(t.showticklabels)&&(a=r.tickText(t,o.value),n(a,{endAnchor:!1,xy:o.xy(o.crossLength-1),dxy:o.dxy(o.crossLength-2,1),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===i,isLast:i===l.length-1}),s.push(a))}}}),Hw=m({"src/traces/carpet/calc_clippath.js"(e,t){t.exports=function(e,t,r,n){var i,a,o,s=[],l=!!r.smoothing,c=!!n.smoothing,u=e[0].length-1,h=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:l}),i=0,a=[],o=[];i<=h;i++)a[i]=e[i][u],o[i]=t[i][u];for(s.push({x:a,y:o,bicubic:c}),i=u,a=[],o=[];i>=0;i--)a[u-i]=e[h][i],o[u-i]=t[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=e[i][0],o[h-i]=t[i][0];return s.push({x:a,y:o,bicubic:c}),s}}}),Gw=m({"src/traces/carpet/smooth_fill_2d_array.js"(e,t){var r=ct();t.exports=function(e,t,n){var i,a,o,s,l,c,u,h,f=[],p=[],d=e[0].length,m=e.length,g=0;for(i=0;i<d;i++)for(a=0;a<m;a++)void 0===e[a][i]&&(f.push(i),p.push(a),e[a][i]=(l=a,c=void 0,u=void 0,h=void 0,u=0,h=0,(s=i)>0&&void 0!==(c=e[l][s-1])&&(h++,u+=c),s<d-1&&void 0!==(c=e[l][s+1])&&(h++,u+=c),l>0&&void 0!==(c=e[l-1][s])&&(h++,u+=c),l<m-1&&void 0!==(c=e[l+1][s])&&(h++,u+=c),u/Math.max(1,h))),g=Math.max(g,Math.abs(e[a][i]));if(!f.length)return e;var y,v,x,_,b,w,T,k,A,M,S,E=0,C=0,I=f.length;do{for(E=0,o=0;o<I;o++){i=f[o],a=p[o];var L,P,z,D,O,R,F=0,B=0;0===i?(z=t[O=Math.min(d-1,2)],D=t[1],L=e[a][O],B+=(P=e[a][1])+(P-L)*(t[0]-D)/(D-z),F++):i===d-1&&(z=t[O=Math.max(0,d-3)],D=t[d-2],L=e[a][O],B+=(P=e[a][d-2])+(P-L)*(t[d-1]-D)/(D-z),F++),(0===i||i===d-1)&&a>0&&a<m-1&&(y=n[a+1]-n[a],B+=((v=n[a]-n[a-1])*e[a+1][i]+y*e[a-1][i])/(v+y),F++),0===a?(z=n[R=Math.min(m-1,2)],D=n[1],L=e[R][i],B+=(P=e[1][i])+(P-L)*(n[0]-D)/(D-z),F++):a===m-1&&(z=n[R=Math.max(0,m-3)],D=n[m-2],L=e[R][i],B+=(P=e[m-2][i])+(P-L)*(n[m-1]-D)/(D-z),F++),(0===a||a===m-1)&&i>0&&i<d-1&&(y=t[i+1]-t[i],B+=((v=t[i]-t[i-1])*e[a][i+1]+y*e[a][i-1])/(v+y),F++),F?B/=F:(x=t[i+1]-t[i],_=t[i]-t[i-1],k=(b=n[a+1]-n[a])*(w=n[a]-n[a-1])*(b+w),B=((T=x*_*(x+_))*(w*e[a+1][i]+b*e[a-1][i])+k*(_*e[a][i+1]+x*e[a][i-1]))/(k*(_+x)+T*(w+b))),E+=(M=(A=B-e[a][i])/g)*M,S=F?0:.85,e[a][i]+=A*(1+S)}E=Math.sqrt(E)}while(C++<100&&E>1e-5);return r.log("Smoother converged to",E,"after",C,"iterations"),e}}}),Ww=m({"src/traces/carpet/constants.js"(e,t){t.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),Zw=m({"src/traces/carpet/catmull_rom.js"(e,t){t.exports=function(e,t,r,n){var i=e[0]-t[0],a=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,f=c*(l+c)*3,p=l*(l+c)*3;return[[t[0]+(f&&u/f),t[1]+(f&&h/f)],[t[0]-(p&&u/p),t[1]-(p&&h/p)]]}}}),Yw=m({"src/traces/carpet/compute_control_points.js"(e,t){var r=Zw(),n=ct().ensureArray;function i(e,t,r){var n=-.5*r[0]+1.5*t[0],i=-.5*r[1]+1.5*t[1];return[(2*n+e[0])/3,(2*i+e[1])/3]}t.exports=function(e,t,a,o,s,l){var c,u,h,f,p,d,m,g,y,v,x=a[0].length,_=a.length,b=s?3*x-2:x,w=l?3*_-2:_;for(e=n(e,w),t=n(t,w),h=0;h<w;h++)e[h]=n(e[h],b),t[h]=n(t[h],b);for(u=0,f=0;u<_;u++,f+=l?3:1)for(p=e[f],d=t[f],m=a[u],g=o[u],c=0,h=0;c<x;c++,h+=s?3:1)p[h]=m[c],d[h]=g[c];if(s)for(u=0,f=0;u<_;u++,f+=l?3:1){for(c=1,h=3;c<x-1;c++,h+=3)y=r([a[u][c-1],o[u][c-1]],[a[u][c],o[u][c]],[a[u][c+1],o[u][c+1]],s),e[f][h-1]=y[0][0],t[f][h-1]=y[0][1],e[f][h+1]=y[1][0],t[f][h+1]=y[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][b-1],t[f][b-1]],[e[f][b-3],t[f][b-3]],[e[f][b-4],t[f][b-4]]),e[f][b-2]=v[0],t[f][b-2]=v[1]}if(l)for(h=0;h<b;h++){for(f=3;f<w-3;f+=3)y=r([e[f-3][h],t[f-3][h]],[e[f][h],t[f][h]],[e[f+3][h],t[f+3][h]],l),e[f-1][h]=y[0][0],t[f-1][h]=y[0][1],e[f+1][h]=y[1][0],t[f+1][h]=y[1][1];v=i([e[0][h],t[0][h]],[e[2][h],t[2][h]],[e[3][h],t[3][h]]),e[1][h]=v[0],t[1][h]=v[1],v=i([e[w-1][h],t[w-1][h]],[e[w-3][h],t[w-3][h]],[e[w-4][h],t[w-4][h]]),e[w-2][h]=v[0],t[w-2][h]=v[1]}if(s&&l)for(f=1;f<w;f+=(f+1)%3==0?2:1){for(h=3;h<b-3;h+=3)y=r([e[f][h-3],t[f][h-3]],[e[f][h],t[f][h]],[e[f][h+3],t[f][h+3]],s),e[f][h-1]=.5*(e[f][h-1]+y[0][0]),t[f][h-1]=.5*(t[f][h-1]+y[0][1]),e[f][h+1]=.5*(e[f][h+1]+y[1][0]),t[f][h+1]=.5*(t[f][h+1]+y[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][b-1],t[f][b-1]],[e[f][b-3],t[f][b-3]],[e[f][b-4],t[f][b-4]]),e[f][b-2]=.5*(e[f][b-2]+v[0]),t[f][b-2]=.5*(t[f][b-2]+v[1])}return[e,t]}}}),Xw=m({"src/traces/carpet/create_spline_evaluator.js"(e,t){t.exports=function(e,t,r,n,i){var a=t-2,o=r-2;return n&&i?function(t,r,n){t||(t=[]);var i,s,l,c,u,h,f=Math.max(0,Math.min(Math.floor(r),a)),p=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-f)),m=Math.max(0,Math.min(1,n-p));f*=3,p*=3;var g=d*d,y=g*d,v=1-d,x=v*v,_=x*v,b=m*m,w=b*m,T=1-m,k=T*T,A=k*T;for(h=0;h<e.length;h++)i=_*(u=e[h])[p][f]+3*(x*d*u[p][f+1]+v*g*u[p][f+2])+y*u[p][f+3],s=_*u[p+1][f]+3*(x*d*u[p+1][f+1]+v*g*u[p+1][f+2])+y*u[p+1][f+3],l=_*u[p+2][f]+3*(x*d*u[p+2][f+1]+v*g*u[p+2][f+2])+y*u[p+2][f+3],c=_*u[p+3][f]+3*(x*d*u[p+3][f+1]+v*g*u[p+3][f+2])+y*u[p+3][f+3],t[h]=A*i+3*(k*m*s+T*b*l)+w*c;return t}:n?function(t,r,n){t||(t=[]);var i,s,l,c,u,h,f=Math.max(0,Math.min(Math.floor(r),a)),p=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-f)),m=Math.max(0,Math.min(1,n-p));f*=3;var g=d*d,y=g*d,v=1-d,x=v*v,_=x*v,b=1-m;for(u=0;u<e.length;u++)i=b*(h=e[u])[p][f]+m*h[p+1][f],s=b*h[p][f+1]+m*h[p+1][f+1],l=b*h[p][f+2]+m*h[p+1][f+1],c=b*h[p][f+3]+m*h[p+1][f+1],t[u]=_*i+3*(x*d*s+v*g*l)+y*c;return t}:i?function(t,r,n){t||(t=[]);var i,s,l,c,u,h,f=Math.max(0,Math.min(Math.floor(r),a)),p=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-f)),m=Math.max(0,Math.min(1,n-p));p*=3;var g=m*m,y=g*m,v=1-m,x=v*v,_=x*v,b=1-d;for(u=0;u<e.length;u++)i=b*(h=e[u])[p][f]+d*h[p][f+1],s=b*h[p+1][f]+d*h[p+1][f+1],l=b*h[p+2][f]+d*h[p+2][f+1],c=b*h[p+3][f]+d*h[p+3][f+1],t[u]=_*i+3*(x*m*s+v*g*l)+y*c;return t}:function(t,r,n){t||(t=[]);var i,s,l,c,u=Math.max(0,Math.min(Math.floor(r),a)),h=Math.max(0,Math.min(Math.floor(n),o)),f=Math.max(0,Math.min(1,r-u)),p=Math.max(0,Math.min(1,n-h)),d=1-p,m=1-f;for(l=0;l<e.length;l++)i=m*(c=e[l])[h][u]+f*c[h][u+1],s=m*c[h+1][u]+f*c[h+1][u+1],t[l]=d*i+p*s;return t}}}}),$w=m({"src/traces/carpet/create_i_derivative_evaluator.js"(e,t){t.exports=function(e,t,r){return t&&r?function(t,r,n,i,a){var o,s,l,c,u,h;t||(t=[]),r*=3,n*=3;var f=i*i,p=1-i,d=p*p,m=p*i*2,g=-3*d,y=3*(d-m),v=3*(m-f),x=3*f,_=a*a,b=_*a,w=1-a,T=w*w,k=T*w;for(h=0;h<e.length;h++)o=g*(u=e[h])[n][r]+y*u[n][r+1]+v*u[n][r+2]+x*u[n][r+3],s=g*u[n+1][r]+y*u[n+1][r+1]+v*u[n+1][r+2]+x*u[n+1][r+3],l=g*u[n+2][r]+y*u[n+2][r+1]+v*u[n+2][r+2]+x*u[n+2][r+3],c=g*u[n+3][r]+y*u[n+3][r+1]+v*u[n+3][r+2]+x*u[n+3][r+3],t[h]=k*o+3*(T*a*s+w*_*l)+b*c;return t}:t?function(t,r,n,i,a){var o,s,l,c;t||(t=[]),r*=3;var u=i*i,h=1-i,f=h*h,p=h*i*2,d=-3*f,m=3*(f-p),g=3*(p-u),y=3*u,v=1-a;for(l=0;l<e.length;l++)o=d*(c=e[l])[n][r]+m*c[n][r+1]+g*c[n][r+2]+y*c[n][r+3],s=d*c[n+1][r]+m*c[n+1][r+1]+g*c[n+1][r+2]+y*c[n+1][r+3],t[l]=v*o+a*s;return t}:r?function(t,r,n,i,a){var o,s,l,c,u,h;t||(t=[]),n*=3;var f=a*a,p=f*a,d=1-a,m=d*d,g=m*d;for(u=0;u<e.length;u++)o=(h=e[u])[n][r+1]-h[n][r],s=h[n+1][r+1]-h[n+1][r],l=h[n+2][r+1]-h[n+2][r],c=h[n+3][r+1]-h[n+3][r],t[u]=g*o+3*(m*a*s+d*f*l)+p*c;return t}:function(t,r,n,i,a){t||(t=[]);var o,s,l,c,u=1-a;for(l=0;l<e.length;l++)o=(c=e[l])[n][r+1]-c[n][r],s=c[n+1][r+1]-c[n+1][r],t[l]=u*o+a*s;return t}}}}),Kw=m({"src/traces/carpet/create_j_derivative_evaluator.js"(e,t){t.exports=function(e,t,r){return t&&r?function(t,r,n,i,a){var o,s,l,c,u,h;t||(t=[]),r*=3,n*=3;var f=i*i,p=f*i,d=1-i,m=d*d,g=m*d,y=a*a,v=1-a,x=v*v,_=v*a*2,b=-3*x,w=3*(x-_),T=3*(_-y),k=3*y;for(h=0;h<e.length;h++)o=b*(u=e[h])[n][r]+w*u[n+1][r]+T*u[n+2][r]+k*u[n+3][r],s=b*u[n][r+1]+w*u[n+1][r+1]+T*u[n+2][r+1]+k*u[n+3][r+1],l=b*u[n][r+2]+w*u[n+1][r+2]+T*u[n+2][r+2]+k*u[n+3][r+2],c=b*u[n][r+3]+w*u[n+1][r+3]+T*u[n+2][r+3]+k*u[n+3][r+3],t[h]=g*o+3*(m*i*s+d*f*l)+p*c;return t}:t?function(t,r,n,i,a){var o,s,l,c,u,h;t||(t=[]),r*=3;var f=a*a,p=f*a,d=1-a,m=d*d,g=m*d;for(u=0;u<e.length;u++)o=(h=e[u])[n+1][r]-h[n][r],s=h[n+1][r+1]-h[n][r+1],l=h[n+1][r+2]-h[n][r+2],c=h[n+1][r+3]-h[n][r+3],t[u]=g*o+3*(m*a*s+d*f*l)+p*c;return t}:r?function(t,r,n,i,a){var o,s,l,c;t||(t=[]),n*=3;var u=1-i,h=a*a,f=1-a,p=f*f,d=f*a*2,m=-3*p,g=3*(p-d),y=3*(d-h),v=3*h;for(l=0;l<e.length;l++)o=m*(c=e[l])[n][r]+g*c[n+1][r]+y*c[n+2][r]+v*c[n+3][r],s=m*c[n][r+1]+g*c[n+1][r+1]+y*c[n+2][r+1]+v*c[n+3][r+1],t[l]=u*o+i*s;return t}:function(t,r,n,i,a){t||(t=[]);var o,s,l,c,u=1-i;for(l=0;l<e.length;l++)o=(c=e[l])[n+1][r]-c[n][r],s=c[n+1][r+1]-c[n][r+1],t[l]=u*o+i*s;return t}}}}),Jw=m({"src/traces/carpet/set_convert.js"(e,t){var r=Ww(),n=Ze().findBin,i=Yw(),a=Xw(),o=$w(),s=Kw();t.exports=function(e){var t=e._a,l=e._b,c=t.length,u=l.length,h=e.aaxis,f=e.baxis,p=t[0],d=t[c-1],m=l[0],g=l[u-1],y=t[t.length-1]-t[0],v=l[l.length-1]-l[0],x=y*r.RELATIVE_CULL_TOLERANCE,_=v*r.RELATIVE_CULL_TOLERANCE;p-=x,d+=x,m-=_,g+=_,e.isVisible=function(e,t){return e>p&&e<d&&t>m&&t<g},e.isOccluded=function(e,t){return e<p||e>d||t<m||t>g},e.setScale=function(){var t=e._x,r=e._y,n=i(e._xctrl,e._yctrl,t,r,h.smoothing,f.smoothing);e._xctrl=n[0],e._yctrl=n[1],e.evalxy=a([e._xctrl,e._yctrl],c,u,h.smoothing,f.smoothing),e.dxydi=o([e._xctrl,e._yctrl],h.smoothing,f.smoothing),e.dxydj=s([e._xctrl,e._yctrl],h.smoothing,f.smoothing)},e.i2a=function(e){var r=Math.max(0,Math.floor(e[0]),c-2),n=e[0]-r;return(1-n)*t[r]+n*t[r+1]},e.j2b=function(e){var t=Math.max(0,Math.floor(e[1]),c-2),r=e[1]-t;return(1-r)*l[t]+r*l[t+1]},e.ij2ab=function(t){return[e.i2a(t[0]),e.j2b(t[1])]},e.a2i=function(e){var r=Math.max(0,Math.min(n(e,t),c-2)),i=t[r],a=t[r+1];return Math.max(0,Math.min(c-1,r+(e-i)/(a-i)))},e.b2j=function(e){var t=Math.max(0,Math.min(n(e,l),u-2)),r=l[t],i=l[t+1];return Math.max(0,Math.min(u-1,t+(e-r)/(i-r)))},e.ab2ij=function(t){return[e.a2i(t[0]),e.b2j(t[1])]},e.i2c=function(t,r){return e.evalxy([],t,r)},e.ab2xy=function(r,n,i){if(!i&&(r<t[0]||r>t[c-1]|n<l[0]||n>l[u-1]))return[!1,!1];var a=e.a2i(r),o=e.b2j(n),s=e.evalxy([],a,o);if(i){var h,f,p,d,m=0,g=0,y=[];r<t[0]?(h=0,f=0,m=(r-t[0])/(t[1]-t[0])):r>t[c-1]?(h=c-2,f=1,m=(r-t[c-1])/(t[c-1]-t[c-2])):f=a-(h=Math.max(0,Math.min(c-2,Math.floor(a)))),n<l[0]?(p=0,d=0,g=(n-l[0])/(l[1]-l[0])):n>l[u-1]?(p=u-2,d=1,g=(n-l[u-1])/(l[u-1]-l[u-2])):d=o-(p=Math.max(0,Math.min(u-2,Math.floor(o)))),m&&(e.dxydi(y,h,p,f,d),s[0]+=y[0]*m,s[1]+=y[1]*m),g&&(e.dxydj(y,h,p,f,d),s[0]+=y[0]*g,s[1]+=y[1]*g)}return s},e.c2p=function(e,t,r){return[t.c2p(e[0]),r.c2p(e[1])]},e.p2x=function(e,t,r){return[t.p2c(e[0]),r.p2c(e[1])]},e.dadi=function(e){var r=Math.max(0,Math.min(t.length-2,e));return t[r+1]-t[r]},e.dbdj=function(e){var t=Math.max(0,Math.min(l.length-2,e));return l[t+1]-l[t]},e.dxyda=function(t,r,n,i){var a=e.dxydi(null,t,r,n,i),o=e.dadi(t,n);return[a[0]/o,a[1]/o]},e.dxydb=function(t,r,n,i){var a=e.dxydj(null,t,r,n,i),o=e.dbdj(r,i);return[a[0]/o,a[1]/o]},e.dxyda_rough=function(t,r,n){var i=y*(n||.1),a=e.ab2xy(t+i,r,!0),o=e.ab2xy(t-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dxydb_rough=function(t,r,n){var i=v*(n||.1),a=e.ab2xy(t,r+i,!0),o=e.ab2xy(t,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dpdx=function(e){return e._m},e.dpdy=function(e){return e._m}}}}),Qw=m({"src/traces/carpet/calc.js"(e,t){var r=ar(),n=ct().isArray1D,i=Nw(),a=Uw(),o=Vw(),s=qw(),l=Hw(),c=Do(),u=Gw(),h=zo(),f=Jw();t.exports=function(e,t){var p=r.getFromId(e,t.xaxis),d=r.getFromId(e,t.yaxis),m=t.aaxis,g=t.baxis,y=t.x,v=t.y,x=[];y&&n(y)&&x.push("x"),v&&n(v)&&x.push("y"),x.length&&h(t,m,g,"a","b",x);var _=t._a=t._a||t.a,b=t._b=t._b||t.b;y=t._x||t.x,v=t._y||t.y;var w={};if(t._cheater){var T="index"===m.cheatertype?_.length:_,k="index"===g.cheatertype?b.length:b;y=i(T,k,t.cheaterslope)}t._x=y=c(y),t._y=v=c(v),u(y,_,b),u(v,_,b),f(t),t.setScale();var A=a(y),M=a(v),S=.5*(A[1]-A[0]),E=.5*(A[1]+A[0]),C=.5*(M[1]-M[0]),I=.5*(M[1]+M[0]),L=1.3;return A=[E-S*L,E+S*L],M=[I-C*L,I+C*L],t._extremes[p._id]=r.findExtremes(p,A,{padded:!0}),t._extremes[d._id]=r.findExtremes(d,M,{padded:!0}),o(t,"a","b"),o(t,"b","a"),s(t,m),s(t,g),w.clipsegments=l(t._xctrl,t._yctrl,m,g),w.x=y,w.y=v,w.a=_,w.b=b,[w]}}}),eT=m({"src/traces/carpet/index.js"(e,t){t.exports={attributes:Lw(),supplyDefaults:Ow(),plot:jw(),calc:Qw(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Ci(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),tT=m({"lib/carpet.js"(e,t){t.exports=eT()}}),rT=m({"src/traces/scattercarpet/attributes.js"(e,t){var r=Tn(),n=kn(),i=q(),{hovertemplateAttrs:a,texttemplateAttrs:o,templatefallbackAttrs:s}=Fe(),l=zt(),c=B().extendFlat,u=n.marker,h=n.line,f=u.line;t.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:c({},n.mode,{dflt:"markers"}),text:c({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:s({editType:"plot"}),hovertext:c({},n.hovertext,{}),line:{color:h.color,width:h.width,dash:h.dash,backoff:h.backoff,shape:c({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:c({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:r(),marker:c({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:c({width:f.width,dash:f.dash,editType:"calc"},l("marker.line")),gradient:u.gradient,editType:"calc"},l("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:c({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a(),hovertemplatefallback:s(),zorder:n.zorder}}}),nT=m({"src/traces/scattercarpet/defaults.js"(e,t){var r=ct(),n=wn(),i=Xt(),a=Yn(),o=Xn(),s=$n(),l=Kn(),c=Jn(),u=rT();t.exports=function(e,t,h,f){function p(n,i){return r.coerce(e,t,u,n,i)}p("carpet"),t.xaxis="x",t.yaxis="y";var d=p("a"),m=p("b"),g=Math.min(d.length,m.length);if(g){t._length=g,p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext"),p("mode",g<n.PTS_LINESONLY?"lines+markers":"lines"),i.hasMarkers(t)&&a(e,t,h,f,p,{gradient:!0}),i.hasLines(t)&&(o(e,t,h,f,p,{backoff:!0}),s(e,t,p),p("connectgaps")),i.hasText(t)&&l(e,t,f,p);var y=[];(i.hasMarkers(t)||i.hasText(t))&&(p("marker.maxdisplayed"),y.push("points")),p("fill"),"none"!==t.fill&&(c(e,t,h,p),i.hasLines(t)||s(e,t,p)),("tonext"===t.fill||"toself"===t.fill)&&y.push("fills"),"fills"!==p("hoveron",y.join("+")||"points")&&(p("hovertemplate"),p("hovertemplatefallback")),p("zorder"),r.coerceSelectionMarkerOpacity(t,p)}else t.visible=!1}}}),iT=m({"src/traces/scattercarpet/format_labels.js"(e,t){t.exports=function(e,t){var r={},n=t._carpet,i=n.ab2ij([e.a,e.b]),a=Math.floor(i[0]),o=i[0]-a,s=Math.floor(i[1]),l=i[1]-s,c=n.evalxy([],a,s,o,l);return r.yLabel=c[1].toFixed(3),r}}}),aT=m({"src/traces/carpet/lookup_carpetid.js"(e,t){t.exports=function(e,t){for(var r,n=e._fullData.length,i=0;i<n;i++){var a=e._fullData[i];if(a.index!==t.index&&"carpet"===a.type&&(r||(r=a),a.carpet===t.carpet))return a}return r}}}),oT=m({"src/traces/scattercarpet/calc.js"(e,t){var r=M(),n=ii(),i=ai(),a=oi(),o=si().calcMarkerSize,s=aT();t.exports=function(e,t){var l=t._carpetTrace=s(e,t);if(l&&l.visible&&"legendonly"!==l.visible){var c;t.xaxis=l.xaxis,t.yaxis=l.yaxis;var u,h,f=t._length,p=new Array(f),d=!1;for(c=0;c<f;c++)if(u=t.a[c],h=t.b[c],r(u)&&r(h)){var m=l.ab2xy(+u,+h,!0),g=l.isVisible(+u,+h);g||(d=!0),p[c]={x:m[0],y:m[1],a:u,b:h,vis:g}}else p[c]={x:!1,y:!1};return t._needsCull=d,p[0].carpet=l,p[0].trace=t,o(t,f),n(e,t),i(p,t),a(p,t),p}}}}),sT=m({"src/traces/scattercarpet/plot.js"(e,t){var r=di(),n=ar(),i=er();t.exports=function(e,t,a,o){var s,l,c,u=a[0][0].carpet,h=n.getFromId(e,u.xaxis||"x"),f=n.getFromId(e,u.yaxis||"y"),p={xaxis:h,yaxis:f,plot:t.plot};for(s=0;s<a.length;s++)(l=a[s][0].trace)._xA=h,l._yA=f;for(r(e,p,a,o),s=0;s<a.length;s++)l=a[s][0].trace,c=o.selectAll("g.trace"+l.uid+" .js-line"),i.setClipUrl(c,a[s][0].carpet._clipPathId,e)}}}),lT=m({"src/traces/scattercarpet/hover.js"(e,t){var r=xi(),n=ct().fillText;t.exports=function(e,t,i,a){var o=r(e,t,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/e.ya._length,c=e.xa._length,u=c*l/2,h=c-u;return s.x0=Math.max(Math.min(s.x0,h),u),s.x1=Math.max(Math.min(s.x1,h),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,d=p._carpet,m=p._module.formatLabels(f,p);s.yLabel=m.yLabel,delete s.text;var g=[];if(!p.hovertemplate){var y=(f.hi||p.hoverinfo).split("+");-1!==y.indexOf("all")&&(y=["a","b","text"]),-1!==y.indexOf("a")&&v(d.aaxis,f.a),-1!==y.indexOf("b")&&v(d.baxis,f.b),g.push("y: "+s.yLabel),-1!==y.indexOf("text")&&n(f,p,g),s.extraText=g.join("<br>")}return o}function v(e,t){var r;r=e.labelprefix&&e.labelprefix.length>0?e.labelprefix.replace(/ = $/,""):e._hovertitle,g.push(r+": "+t.toFixed(3)+e.labelsuffix)}}}}),cT=m({"src/traces/scattercarpet/event_data.js"(e,t){t.exports=function(e,t,r,n,i){var a=n[i];return e.a=a.a,e.b=a.b,e.y=a.y,e}}}),uT=m({"src/traces/scattercarpet/index.js"(e,t){t.exports={attributes:rT(),supplyDefaults:nT(),colorbar:mi(),formatLabels:iT(),calc:oT(),plot:sT(),style:yi().style,styleOnSelect:yi().styleOnSelect,hoverPoints:lT(),selectPoints:_i(),eventData:cT(),moduleType:"trace",name:"scattercarpet",basePlotModule:Ci(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),hT=m({"lib/scattercarpet.js"(e,t){t.exports=uT()}}),fT=m({"src/traces/contourcarpet/attributes.js"(e,t){var r=wo(),n=cs(),i=zt(),a=B().extendFlat,o=n.contours;t.exports=a({carpet:{valType:"string",editType:"calc"},z:r.z,a:r.x,a0:r.x0,da:r.dx,b:r.y,b0:r.y0,db:r.dy,text:r.text,hovertext:r.hovertext,transpose:r.transpose,atype:r.xtype,btype:r.ytype,fillcolor:n.fillcolor,autocontour:n.autocontour,ncontours:n.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:n.line.color,width:n.line.width,dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},zorder:n.zorder},i("",{cLetter:"z",autoColorDflt:!1}))}}),pT=m({"src/traces/contourcarpet/defaults.js"(e,t){var r=ct(),n=To(),i=fT(),a=Ps(),o=hs(),s=ps();t.exports=function(e,t,l,c){function u(n,a){return r.coerce(e,t,i,n,a)}if(u("carpet"),e.a&&e.b){if(!n(e,t,u,c,"a","b"))return void(t.visible=!1);u("text"),"constraint"===u("contours.type")?a(e,t,u,c,l,{hasHover:!1}):(o(e,t,u,(function(n){return r.coerce2(e,t,i,n)})),s(e,t,u,c,{hasHover:!1}))}else t._defaultColor=l,t._length=null;u("zorder")}}}),dT=m({"src/traces/contourcarpet/calc.js"(e,t){var r=Zt(),n=ct(),i=zo(),a=Do(),o=Oo(),s=Ro(),l=Fo(),c=pT(),u=aT(),h=ms();t.exports=function(e,t){var f=t._carpetTrace=u(e,t);if(f&&f.visible&&"legendonly"!==f.visible){if(!t.a||!t.b){var p=e.data[f.index],d=e.data[t.index];d.a||(d.a=p.a),d.b||(d.b=p.b),c(d,t,t._defaultColor,e._fullLayout)}var m=function(e,t){var c,u,h,f,p,d,m,g=t._carpetTrace,y=g.aaxis,v=g.baxis;y._minDtick=0,v._minDtick=0,n.isArray1D(t.z)&&i(t,y,v,"a","b",["z"]),c=t._a=t._a||t.a,f=t._b=t._b||t.b,c=c?y.makeCalcdata(t,"_a"):[],f=f?v.makeCalcdata(t,"_b"):[],u=t.a0||0,h=t.da||1,p=t.b0||0,d=t.db||1,m=t._z=a(t._z||t.z,t.transpose),t._emptypoints=s(m),o(m,t._emptypoints);var x=n.maxRowLength(m),_="scaled"===t.xtype?"":c,b=l(t,_,u,h,x,y),w="scaled"===t.ytype?"":f,T={a:b,b:l(t,w,p,d,m.length,v),z:m};return"levels"===t.contours.type&&"none"!==t.contours.coloring&&r(e,t,{vals:m,containerStr:"",cLetter:"z"}),[T]}(e,t);return h(t,t._z),m}}}}),mT=m({"src/traces/carpet/axis_aligned_line.js"(e,t){var r=ct().isArrayOrTypedArray;t.exports=function(e,t,n,i){var a,o,s,l,c,u,h,f,p,d,m,g,y,v=r(n)?"a":"b",x=("a"===v?e.aaxis:e.baxis).smoothing,_="a"===v?e.a2i:e.b2j,b="a"===v?n:i,w="a"===v?i:n,T="a"===v?t.a.length:t.b.length,k="a"===v?t.b.length:t.a.length,A=Math.floor("a"===v?e.b2j(w):e.a2i(w)),M="a"===v?function(t){return e.evalxy([],t,A)}:function(t){return e.evalxy([],A,t)};x&&(s=Math.max(0,Math.min(k-2,A)),l=A-s,o="a"===v?function(t,r){return e.dxydi([],t,s,r,l)}:function(t,r){return e.dxydj([],s,t,l,r)});var S=_(b[0]),E=_(b[1]),C=S<E?1:-1,I=1e-8*(E-S),L=C>0?Math.floor:Math.ceil,P=C>0?Math.ceil:Math.floor,z=C>0?Math.min:Math.max,D=C>0?Math.max:Math.min,O=L(S+I),R=P(E-I),F=[[h=M(S)]];for(a=O;a*C<R*C;a+=C)c=[],m=D(S,a),y=(g=z(E,a+C))-m,u=Math.max(0,Math.min(T-2,Math.floor(.5*(m+g)))),f=M(g),x&&(p=o(u,m-u),d=o(u,g-u),c.push([h[0]+p[0]/3*y,h[1]+p[1]/3*y]),c.push([f[0]-d[0]/3*y,f[1]-d[1]/3*y])),c.push(f),F.push(c),h=f;return F}}}),gT=m({"src/traces/contourcarpet/plot.js"(e,t){var r=b(),n=Rw(),i=Fw(),a=er(),o=ct(),s=xs(),l=_s(),c=As(),u=vs(),h=Ts(),f=ws(),p=ks(),d=aT(),m=mT();function g(e,t,r){var n=e.getPointAtLength(t),i=e.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function y(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}function v(e,t){var r=Math.abs(e[0]*t[0]+e[1]*t[1]);return Math.sqrt(1-r*r)/r}t.exports=function(e,t,x,_){var b=t.xaxis,w=t.yaxis;o.makeTraceGroups(_,x,"contour").each((function(x){var _=r.select(this),T=x[0],k=T.trace,A=k._carpetTrace=d(e,k),M=e.calcdata[A.index][0];if(A.visible&&"legendonly"!==A.visible){var S=T.a,E=T.b,C=k.contours,I=f(C,t,T),L="constraint"===C.type,P=C._operation,z=L?"="===P?"lines":"fill":C.coloring,D=[[S[0],E[E.length-1]],[S[S.length-1],E[E.length-1]],[S[S.length-1],E[0]],[S[0],E[0]]];s(I);var O=1e-8*(S[S.length-1]-S[0]),R=1e-8*(E[E.length-1]-E[0]);l(I,O,R);var F=I;"constraint"===C.type&&(F=h(I,P)),function(e,t){var r,n,i,a,o,s,l,c,u;for(r=0;r<e.length;r++){for(o=(a=e[r]).pedgepaths=[],s=a.ppaths=[],n=0;n<a.edgepaths.length;n++){for(u=a.edgepaths[n],l=[],i=0;i<u.length;i++)l[i]=t(u[i]);o.push(l)}for(n=0;n<a.paths.length;n++){for(u=a.paths[n],c=[],i=0;i<u.length;i++)c[i]=t(u[i]);s.push(c)}}}(I,H);var B,j,N,U,V=[];for(U=M.clipsegments.length-1;U>=0;U--)B=M.clipsegments[U],j=n([],B.x,b.c2p),N=n([],B.y,w.c2p),j.reverse(),N.reverse(),V.push(i(j,N,B.bicubic));var q="M"+V.join("L")+"Z";(function(e,t,r,a,s,l){var c,u,h,f,p=o.ensureSingle(e,"g","contourbg").selectAll("path").data("fill"!==l||s?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(f=0;f<t.length;f++)c=t[f],u=n([],c.x,r.c2p),h=n([],c.y,a.c2p),d.push(i(u,h,c.bicubic));p.attr("d","M"+d.join("L")+"Z").style("stroke","none")})(_,M.clipsegments,b,w,L,z),function(e,t,n,i,s,l,c,u,h,f,d){var g="fill"===f;g&&p(s,e.contours);var y=o.ensureSingle(t,"g","contourfill").selectAll("path").data(g?s:[]);y.enter().append("path"),y.exit().remove(),y.each((function(e){var t=(e.prefixBoundary?d:"")+function(e,t,r,n,i,s,l,c){var u,h,f,p,d,g,y,v="",x=t.edgepaths.map((function(e,t){return t})),_=!0,b=1e-4*Math.abs(r[0][0]-r[2][0]),w=1e-4*Math.abs(r[0][1]-r[2][1]);function T(e){return Math.abs(e[1]-r[0][1])<w}function k(e){return Math.abs(e[1]-r[2][1])<w}function A(e){return Math.abs(e[0]-r[0][0])<b}function M(e){return Math.abs(e[0]-r[2][0])<b}function S(e,t){var r,n,a,o,u="";for(T(e)&&!M(e)||k(e)&&!A(e)?(o=i.aaxis,a=m(i,s,[e[0],t[0]],.5*(e[1]+t[1]))):(o=i.baxis,a=m(i,s,.5*(e[0]+t[0]),[e[1],t[1]])),r=1;r<a.length;r++)for(u+=o.smoothing?"C":"L",n=0;n<a[r].length;n++){var h=a[r][n];u+=[l.c2p(h[0]),c.c2p(h[1])]+" "}return u}for(u=0,h=null;x.length;){var E=t.edgepaths[u][0];for(h&&(v+=S(h,E)),y=a.smoothopen(t.edgepaths[u].map(n),t.smoothing),v+=_?y:y.replace(/^M/,"L"),x.splice(x.indexOf(u),1),h=t.edgepaths[u][t.edgepaths[u].length-1],d=-1,p=0;p<4;p++){if(!h){o.log("Missing end?",u,t);break}for(T(h)&&!M(h)?f=r[1]:A(h)?f=r[0]:k(h)?f=r[3]:M(h)&&(f=r[2]),g=0;g<t.edgepaths.length;g++){var C=t.edgepaths[g][0];Math.abs(h[0]-f[0])<b?Math.abs(h[0]-C[0])<b&&(C[1]-h[1])*(f[1]-C[1])>=0&&(f=C,d=g):Math.abs(h[1]-f[1])<w?Math.abs(h[1]-C[1])<w&&(C[0]-h[0])*(f[0]-C[0])>=0&&(f=C,d=g):o.log("endpt to newendpt is not vert. or horz.",h,f,C)}if(d>=0)break;v+=S(h,f),h=f}if(d===t.edgepaths.length){o.log("unclosed perimeter path");break}u=d,(_=-1===x.indexOf(u))&&(u=x[0],v+=S(h,f)+"Z",h=null)}for(u=0;u<t.paths.length;u++)v+=a.smoothclosed(t.paths[u].map(n),t.smoothing);return v}(0,e,l,c,u,h,n,i);t?r.select(this).attr("d",t).style("stroke","none"):r.select(this).remove()}))}(k,_,b,w,F,D,H,A,M,z,q),function(e,t,n,i,s,l,h){var f=n._context.staticPlot,p=o.ensureSingle(e,"g","contourlines"),d=!1!==s.showlines,m=s.showlabels,x=d&&m,_=c.createLines(p,d||m,t,f),b=c.createLineClip(p,x,n,i.trace.uid),w=e.selectAll("g.contourlabels").data(m?[0]:[]);if(w.exit().remove(),w.enter().append("g").classed("contourlabels",!0),m){var T=l.xaxis,k=l.yaxis,A=T._length,M=k._length,S=[[[0,0],[A,0],[A,M],[0,M]]],E=[];o.clearLocationCache();var C=c.labelFormatter(n,i),I=a.tester.append("text").attr("data-notex",1).call(a.font,s.labelfont),L={left:0,right:A,center:A/2,top:0,bottom:M,middle:M/2},P=Math.sqrt(A*A+M*M),z=u.LABELDISTANCE*P/Math.max(1,t.length/u.LABELINCREASE);_.each((function(e){var t=c.calcTextOpts(e.level,C,I,n);r.select(this).selectAll("path").each((function(r){var n=this,i=o.getVisibleSegment(n,L,t.height/2);if(i&&(function(e,t,r,n,i,a){for(var o,s=0;s<r.pedgepaths.length;s++)t===r.pedgepaths[s]&&(o=r.edgepaths[s]);if(o){var l=i.a[0],c=i.a[i.a.length-1],u=i.b[0],h=i.b[i.b.length-1],f=g(e,0,1),p=g(e,n.total,n.total-1),d=x(o[0],f),m=n.total-x(o[o.length-1],p);n.min<d&&(n.min=d),n.max>m&&(n.max=m),n.len=n.max-n.min}function x(e,t){var r,n=0,o=.1;return(Math.abs(e[0]-l)<o||Math.abs(e[0]-c)<o)&&(r=y(i.dxydb_rough(e[0],e[1],o)),n=Math.max(n,a*v(t,r)/2)),(Math.abs(e[1]-u)<o||Math.abs(e[1]-h)<o)&&(r=y(i.dxyda_rough(e[0],e[1],o)),n=Math.max(n,a*v(t,r)/2)),n}}(n,r,e,i,h,t.height),!(i.len<(t.width+t.height)*u.LABELMIN)))for(var a=Math.min(Math.ceil(i.len/z),u.LABELMAX),s=0;s<a;s++){var l=c.findBestTextLocation(n,i,t,E,L);if(!l)break;c.addLabelData(l,t,E,S)}}))})),I.remove(),c.drawLabels(w,E,n,b,x?S:null)}m&&!d&&_.remove()}(_,I,e,T,C,t,A),a.setClipUrl(_,A._clipPathId,e)}function H(e){var t=A.ab2xy(e[0],e[1],!0);return[b.c2p(t[0]),w.c2p(t[1])]}}))}}}),yT=m({"src/traces/contourcarpet/index.js"(e,t){t.exports={attributes:fT(),supplyDefaults:pT(),colorbar:Es(),calc:dT(),plot:gT(),style:Ss(),moduleType:"trace",name:"contourcarpet",basePlotModule:Ci(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}}),vT=m({"lib/contourcarpet.js"(e,t){t.exports=yT()}}),xT=m({"src/traces/ohlc/attributes.js"(e,t){var r=ct().extendFlat,n=kn(),i=It().axisHoverFormat,{hovertemplateAttrs:a,templatefallbackAttrs:o}=Fe(),s=Oe().dash,l=V(),c=Ml(),u=c.INCREASING.COLOR,h=c.DECREASING.COLOR,f=n.line;function p(e){return{line:{color:r({},f.color,{dflt:e}),width:f.width,dash:s,editType:"style"},editType:"style"}}t.exports={xperiod:n.xperiod,xperiod0:n.xperiod0,xperiodalignment:n.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:r({},f.width,{}),dash:r({},s,{}),editType:"style"},increasing:p(u),decreasing:p(h),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:r({},l.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:n.zorder}}}),_T=m({"src/traces/ohlc/ohlc_defaults.js"(e,t){var r=He(),n=ct();t.exports=function(e,t,i,a){var o=i("x"),s=i("open"),l=i("high"),c=i("low"),u=i("close");if(i("hoverlabel.split"),r.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],a),s&&l&&c&&u){var h=Math.min(s.length,l.length,c.length,u.length);return o&&(h=Math.min(h,n.minRowLength(o))),t._length=h,h}}}}),bT=m({"src/traces/ohlc/defaults.js"(e,t){var r=ct(),n=_T(),i=Wn(),a=xT();function o(e,t,r,n){r(n+".line.color"),r(n+".line.width",t.line.width),r(n+".line.dash",t.line.dash)}t.exports=function(e,t,s,l){function c(n,i){return r.coerce(e,t,a,n,i)}n(e,t,c,l)?(i(e,t,l,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),c("line.dash"),o(0,t,c,"increasing"),o(0,t,c,"decreasing"),c("text"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),c("tickwidth"),l._requestRangeslider[t.xaxis]=!0,c("zorder")):t.visible=!1}}}),wT=m({"src/traces/ohlc/calc.js"(e,t){var r=ct(),n=r._,i=ar(),a=ni(),o=S().BADNUM;function s(e,t,r,n){return{o:e,h:t,l:r,c:n}}function l(e,t,a,s,l,c){for(var u=l.makeCalcdata(t,"open"),h=l.makeCalcdata(t,"high"),f=l.makeCalcdata(t,"low"),p=l.makeCalcdata(t,"close"),d=r.isArrayOrTypedArray(t.text),m=r.isArrayOrTypedArray(t.hovertext),g=!0,y=null,v=!!t.xperiodalignment,x=[],_=0;_<s.length;_++){var b=s[_],w=u[_],T=h[_],k=f[_],A=p[_];if(b!==o&&w!==o&&T!==o&&k!==o&&A!==o){A===w?null!==y&&A!==y&&(g=A>y):g=A>w,y=A;var M=c(w,T,k,A);M.pos=b,M.yc=(w+A)/2,M.i=_,M.dir=g?"increasing":"decreasing",M.x=M.pos,M.y=[k,T],v&&(M.orig_p=a[_]),d&&(M.tx=t.text[_]),m&&(M.htx=t.hovertext[_]),x.push(M)}else x.push({pos:b,empty:!0})}return t._extremes[l._id]=i.findExtremes(l,r.concat(f,h),{padded:!0}),x.length&&(x[0].t={labels:{open:n(e,"open:")+" ",high:n(e,"high:")+" ",low:n(e,"low:")+" ",close:n(e,"close:")+" "}}),x}t.exports={calc:function(e,t){var n=i.getFromId(e,t.xaxis),o=i.getFromId(e,t.yaxis),c=function(e,t,n){var i=n._minDiff;if(!i){var o,s=e._fullData,l=[];for(i=1/0,o=0;o<s.length;o++){var c=s[o];if("ohlc"===c.type&&!0===c.visible&&c.xaxis===t._id){l.push(c);var u=t.makeCalcdata(c,"x");c._origX=u;var h=a(n,t,"x",u).vals;c._xcalc=h;var f=r.distinctVals(h).minDiff;f&&isFinite(f)&&(i=Math.min(i,f))}}for(i===1/0&&(i=1),o=0;o<l.length;o++)l[o]._minDiff=i}return i*n.tickwidth}(e,n,t),u=t._minDiff;t._minDiff=null;var h=t._origX;t._origX=null;var f=t._xcalc;t._xcalc=null;var p=l(e,t,h,f,o,s);return t._extremes[n._id]=i.findExtremes(n,f,{vpad:u/2}),p.length?(r.extendFlat(p[0].t,{wHover:u/2,tickLen:c}),p):[{t:{empty:!0}}]},calcCommon:l}}}),TT=m({"src/traces/ohlc/plot.js"(e,t){var r=b(),n=ct();t.exports=function(e,t,i,a){var o=t.yaxis,s=t.xaxis,l=!!s.rangebreaks;n.makeTraceGroups(a,i,"trace ohlc").each((function(e){var t=r.select(this),i=e[0],a=i.t;if(!0!==i.trace.visible||a.empty)t.remove();else{var c=a.tickLen,u=t.selectAll("path").data(n.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-c,!0),r=s.c2p(e.pos+c,!0),n=l?(t+r)/2:s.c2p(e.pos,!0);return"M"+t+","+o.c2p(e.o,!0)+"H"+n+"M"+n+","+o.c2p(e.h,!0)+"V"+o.c2p(e.l,!0)+"M"+r+","+o.c2p(e.c,!0)+"H"+n}))}}))}}}),kT=m({"src/traces/ohlc/style.js"(e,t){var r=b(),n=er(),i=W();t.exports=function(e,t,a){var o=a||r.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;r.select(this).selectAll("path").each((function(e){if(!e.empty){var a=t[e.dir].line;r.select(this).style("fill","none").call(i.stroke,a.color).call(n.dashLine,a.dash,a.width).style("opacity",t.selectedpoints&&!e.selected?.3:1)}}))}))}}}),AT=m({"src/traces/ohlc/hover.js"(e,t){var r=ar(),n=ct(),i=Or(),a=W(),o=ct().fillText,s=Ml(),l={increasing:s.INCREASING.SYMBOL,decreasing:s.DECREASING.SYMBOL};function c(e,t,r,n){var o,s,l=e.cd,c=e.xa,u=l[0].trace,h=l[0].t,f=u.type,p="ohlc"===f?"l":"min",d="ohlc"===f?"h":"max",m=h.bPos||0,g=h.bdPos||h.tickLen,y=h.wHover,v=Math.min(1,g/Math.abs(c.r2c(c.range[1])-c.r2c(c.range[0])));function x(e){var r=function(e){return e.pos+m-t}(e);return i.inbox(r-y,r+y,o)}function _(e){var t=e[p],n=e[d];return t===n||i.inbox(t-r,n-r,o)}function b(e){return(x(e)+_(e))/2}o=e.maxHoverDistance-v,s=e.maxSpikeDistance-v;var w=i.getDistanceFunction(n,x,_,b);if(i.getClosest(l,w,e),!1===e.index)return null;var T=l[e.index];if(T.empty)return null;var k=u[T.dir],A=k.line.color;return a.opacity(A)&&k.line.width?e.color=A:e.color=k.fillcolor,e.x0=c.c2p(T.pos+m-g,!0),e.x1=c.c2p(T.pos+m+g,!0),e.xLabelVal=void 0!==T.orig_p?T.orig_p:T.pos,e.spikeDistance=b(T)*s/o,e.xSpike=c.c2p(T.pos,!0),e}function u(e,t,i,a){var o=e.cd,s=e.ya,l=o[0].trace,u=o[0].t,h=[],f=c(e,t,i,a);if(!f)return[];var p=o[f.index].hi||l.hoverinfo||"";if("none"===p||"skip"===p)return[];for(var d=["high","open","close","low"],m={},g=0;g<d.length;g++){var y,v=d[g],x=l[v][f.index],_=s.c2p(x,!0);x in m?(y=m[x]).yLabel+="<br>"+u.labels[v]+r.hoverLabelText(s,x,l.yhoverformat):((y=n.extendFlat({},f)).y0=y.y1=_,y.yLabelVal=x,y.yLabel=u.labels[v]+r.hoverLabelText(s,x,l.yhoverformat),y.name="",h.push(y),m[x]=y)}return h}function h(e,t,n,i){var a=e.cd,s=e.ya,u=a[0].trace,h=a[0].t,f=c(e,t,n,i);if(!f)return[];var p=a[f.index],d=f.index=p.i,m=p.dir;function g(e){return h.labels[e]+r.hoverLabelText(s,u[e][d],u.yhoverformat)}var y=p.hi||u.hoverinfo||"",v=y.split("+"),x="all"===y,_=x||-1!==v.indexOf("y"),b=x||-1!==v.indexOf("text"),w=_?[g("open"),g("high"),g("low"),g("close")+" "+l[m]]:[];return b&&o(p,u,w),f.extraText=w.join("<br>"),f.y0=f.y1=s.c2p(p.yc,!0),[f]}t.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?u(e,t,r,n):h(e,t,r,n)},hoverSplit:u,hoverOnPoints:h}}}),MT=m({"src/traces/ohlc/select.js"(e,t){t.exports=function(e,t){var r,n=e.cd,i=e.xaxis,a=e.yaxis,o=[],s=n[0].t.bPos||0;if(!1===t)for(r=0;r<n.length;r++)n[r].selected=0;else for(r=0;r<n.length;r++){var l=n[r];t.contains([i.c2p(l.pos+s),a.c2p(l.yc)],null,l.i,e)?(o.push({pointNumber:l.i,x:i.c2d(l.pos),y:a.c2d(l.yc)}),l.selected=1):l.selected=0}return o}}}),ST=m({"src/traces/ohlc/index.js"(e,t){t.exports={moduleType:"trace",name:"ohlc",basePlotModule:Ci(),categories:["cartesian","svg","showLegend"],meta:{},attributes:xT(),supplyDefaults:bT(),calc:wT().calc,plot:TT(),style:kT(),hoverPoints:AT().hoverPoints,selectPoints:MT()}}}),ET=m({"lib/ohlc.js"(e,t){t.exports=ST()}}),CT=m({"src/traces/candlestick/attributes.js"(e,t){var r=ct().extendFlat,n=It().axisHoverFormat,i=xT(),a=lo();function o(e){return{line:{color:r({},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:n("x"),yhoverformat:n("y"),x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:r({},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:r({},a.whiskerwidth,{dflt:0}),hoverlabel:i.hoverlabel,zorder:a.zorder}}}),IT=m({"src/traces/candlestick/defaults.js"(e,t){var r=ct(),n=W(),i=_T(),a=Wn(),o=CT();function s(e,t,r,i){var a=r(i+".line.color");r(i+".line.width",t.line.width),r(i+".fillcolor",n.addOpacity(a,.5))}t.exports=function(e,t,n,l){function c(n,i){return r.coerce(e,t,o,n,i)}i(e,t,c,l)?(a(e,t,l,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),s(0,t,c,"increasing"),s(0,t,c,"decreasing"),c("text"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),c("whiskerwidth"),l._requestRangeslider[t.xaxis]=!0,c("zorder")):t.visible=!1}}}),LT=m({"src/traces/candlestick/calc.js"(e,t){var r=ct(),n=ar(),i=ni(),a=wT().calcCommon;function o(e,t,r,n){return{min:r,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:t}}t.exports=function(e,t){var s=e._fullLayout,l=n.getFromId(e,t.xaxis),c=n.getFromId(e,t.yaxis),u=l.makeCalcdata(t,"x"),h=i(t,l,"x",u).vals,f=a(e,t,u,h,c,o);return f.length?(r.extendFlat(f[0].t,{num:s._numBoxes,dPos:r.distinctVals(h).minDiff/2,posLetter:"x",valLetter:"y"}),s._numBoxes++,f):[{t:{empty:!0}}]}}}),PT=m({"src/traces/candlestick/index.js"(e,t){t.exports={moduleType:"trace",name:"candlestick",basePlotModule:Ci(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:CT(),layoutAttributes:co(),supplyLayoutDefaults:ho().supplyLayoutDefaults,crossTraceCalc:po().crossTraceCalc,supplyDefaults:IT(),calc:LT(),plot:mo().plot,layerName:"boxlayer",style:go().style,hoverPoints:AT().hoverPoints,selectPoints:MT()}}}),zT=m({"lib/candlestick.js"(e,t){t.exports=PT()}}),DT=m({"src/plots/polar/set_convert.js"(e,t){var r=ct(),n=rr(),i=r.deg2rad,a=r.rad2deg;t.exports=function(e,t,o){switch(n(e,o),e._id){case"x":case"radialaxis":!function(e,t){var r=t._subplot;e.setGeometry=function(){var t=e._rl[0],n=e._rl[1],i=r.innerRadius,a=(r.radius-i)/(n-t),o=i/a,s=t>n?function(e){return e<=0}:function(e){return e>=0};e.c2g=function(r){var n=e.c2l(r)-t;return(s(n)?n:0)+o},e.g2c=function(r){return e.l2c(r+t-o)},e.g2p=function(e){return e*a},e.c2p=function(t){return e.g2p(e.c2g(t))}}}(e,t);break;case"angularaxis":!function(e,t){var n=e.type;if("linear"===n){var o=e.d2c,s=e.c2d;e.d2c=function(e,t){return function(e,t){return"degrees"===t?i(e):e}(o(e),t)},e.c2d=function(e,t){return s(function(e,t){return"degrees"===t?a(e):e}(e,t))}}e.makeCalcdata=function(t,r){var n,i,a=t[r],o=t._length,s=function(r){return e.d2c(r,t.thetaunit)};if(a)for(n=new Array(o),i=0;i<o;i++)n[i]=s(a[i]);else{var l=r+"0",c="d"+r,u=l in t?s(t[l]):0,h=t[c]?s(t[c]):(e.period||2*Math.PI)/o;for(n=new Array(o),i=0;i<o;i++)n[i]=u+i*h}return n},e.setGeometry=function(){var o,s,l,c,u=t.sector,h=u.map(i),f={clockwise:-1,counterclockwise:1}[e.direction],p=i(e.rotation),d=function(e){return f*e+p},m=function(e){return(e-p)/f};switch(n){case"linear":s=o=r.identity,c=i,l=a,e.range=r.isFullCircle(h)?[u[0],u[0]+360]:h.map(m).map(a);break;case"category":var g=e._categories.length,y=e.period?Math.max(e.period,g):g;0===y&&(y=1),s=c=function(e){return 2*e*Math.PI/y},o=l=function(e){return e*y/Math.PI/2},e.range=[0,y]}e.c2g=function(e){return d(s(e))},e.g2c=function(e){return o(m(e))},e.t2g=function(e){return d(c(e))},e.g2t=function(e){return l(m(e))}}}(e,t)}}}}),OT=m({"src/plots/polar/constants.js"(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}}}),RT=m({"src/plots/polar/helpers.js"(e,t){var r=ct(),n=gn().tester,i=r.findIndexOfMin,a=r.isAngleInsideSector,o=r.angleDelta,s=r.angleDist;function l(e,t,r,n){var i,a,o=n[0],s=n[1],l=u(Math.sin(t)-Math.sin(e)),c=u(Math.cos(t)-Math.cos(e)),h=Math.tan(r),f=u(1/h),p=l/c,d=s-p*o;return f?l&&c?a=h*(i=d/(h-p)):c?(i=s*f,a=s):(i=o,a=o*h):l&&c?(i=0,a=d):c?(i=0,a=s):i=a=NaN,[i,a]}function c(e,t,n,o){return r.isFullCircle([t,n])?function(e,t){var r,n=t.length,i=new Array(n+1);for(r=0;r<n;r++){var a=t[r];i[r]=[e*Math.cos(a),e*Math.sin(a)]}return i[r]=i[0].slice(),i}(e,o):function(e,t,n,o){var c,u,h=o.length,f=[];function p(t){return[e*Math.cos(t),e*Math.sin(t)]}function d(e,t,r){return l(e,t,r,p(e))}function m(e){return r.mod(e,h)}function g(e){return a(e,[t,n])}var y=i(o,(function(e){return g(e)?s(e,t):1/0})),v=d(o[y],o[m(y-1)],t);for(f.push(v),c=y,u=0;u<h;c++,u++){var x=o[m(c)];if(!g(x))break;f.push(p(x))}var _=i(o,(function(e){return g(e)?s(e,n):1/0})),b=d(o[_],o[m(_+1)],n);return f.push(b),f.push([0,0]),f.push(f[0].slice()),f}(e,t,n,o)}function u(e){return Math.abs(e)>1e-10?e:0}function h(e,t,r){t=t||0,r=r||0;for(var n=e.length,i=new Array(n),a=0;a<n;a++){var o=e[a];i[a]=[t+o[0],r-o[1]]}return i}t.exports={isPtInsidePolygon:function(e,t,r,i,o){if(!a(t,i))return!1;var s,l;r[0]<r[1]?(s=r[0],l=r[1]):(s=r[1],l=r[0]);var u=n(c(s,i[0],i[1],o)),h=n(c(l,i[0],i[1],o)),f=[e*Math.cos(t),e*Math.sin(t)];return h.contains(f)&&!u.contains(f)},findPolygonOffset:function(e,t,r,n){for(var i=1/0,a=1/0,o=c(e,t,r,n),s=0;s<o.length;s++){var l=o[s];i=Math.min(i,l[0]),a=Math.min(a,-l[1])}return[i,a]},findEnclosingVertexAngles:function(e,t){var n=i(t,(function(t){var r=o(t,e);return r>0?r:1/0})),a=r.mod(n+1,t.length);return[t[n],t[a]]},findIntersectionXY:l,findXYatLength:function(e,t,r,n){var i=-t*r,a=t*t+1,o=2*(t*i-r),s=i*i+r*r-e*e,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,t*c+i+n],[u,t*u+i+n]]},clampTiny:u,pathPolygon:function(e,t,r,n,i,a){return"M"+h(c(e,t,r,n),i,a).join("L")},pathPolygonAnnulus:function(e,t,r,n,i,a,o){var s,l;e<t?(s=e,l=t):(s=t,l=e);var u=h(c(s,r,n,i),a,o);return"M"+h(c(l,r,n,i),a,o).reverse().join("L")+"M"+u.join("L")}}}}),FT=m({"src/plots/smith/helpers.js"(e,t){function r(e){return e<0?-1:e>0?1:0}function n(e){var t=e[0],r=e[1];if(!isFinite(t)||!isFinite(r))return[1,0];var n=(t+1)*(t+1)+r*r;return[(t*t+r*r-1)/n,2*r/n]}function i(e,t){var r=t[0],n=t[1];return[r*e.radius+e.cx,-n*e.radius+e.cy]}function a(e,t){return t*e.radius}t.exports={smith:n,reactanceArc:function(e,t,r,o){var s=i(e,n([r,t])),l=s[0],c=s[1],u=i(e,n([o,t])),h=u[0],f=u[1];if(0===t)return["M"+l+","+c,"L"+h+","+f].join(" ");var p=a(e,1/Math.abs(t));return["M"+l+","+c,"A"+p+","+p+" 0 0,"+(t<0?1:0)+" "+h+","+f].join(" ")},resistanceArc:function(e,t,o,s){var l=a(e,1/(t+1)),c=i(e,n([t,o])),u=c[0],h=c[1],f=i(e,n([t,s])),p=f[0],d=f[1];if(r(o)!==r(s)){var m=i(e,n([t,0]));return["M"+u+","+h,"A"+l+","+l+" 0 0,"+(0<o?0:1)+" "+m[0]+","+m[1],"A"+l+","+l+" 0 0,"+(s<0?0:1)+p+","+d].join(" ")}return["M"+u+","+h,"A"+l+","+l+" 0 0,"+(s<o?0:1)+" "+p+","+d].join(" ")},smithTransform:i}}}),BT=m({"src/plots/polar/polar.js"(e,t){var r=b(),n=F(),i=He(),a=ct(),o=a.strRotate,s=a.strTranslate,l=W(),c=er(),u=At(),h=ar(),f=rr(),p=DT(),d=ir().doAutoRange,m=In(),g=pr(),y=Or(),v=tr(),x=Cn().prepSelect,_=Cn().selectOnClick,w=Cn().clearOutline,T=dr(),k=Fr(),A=an().redrawReglTraces,M=St().MID_SHIFT,S=OT(),E=RT(),C=FT(),I=C.smith,L=C.reactanceArc,P=C.resistanceArc,z=C.smithTransform,D=a._,O=a.mod,R=a.deg2rad,B=a.rad2deg;function j(e,t,r){this.isSmith=r||!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 n=e._fullLayout,i="clip"+n._uid+t;this.clipIds.forTraces=i+"-for-traces",this.clipPaths.forTraces=n._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=n["_"+(r?"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},r||(this.radialTickLayout=null,this.angularTickLayout=null)}var N=j.prototype;function U(e){var t=e.ticks+String(e.ticklen)+String(e.showticklabels);return"side"in e&&(t+=e.side),t}function V(e,t){return t[a.findIndexOfMin(t,(function(t){return a.angleDist(e,t)}))]}function q(e,t,r){return t?(e.attr("display",null),e.attr(r)):e&&e.attr("display","none"),e}t.exports=function(e,t,r){return new j(e,t,r)},N.plot=function(e,t){for(var r=this,n=t[r.id],i=!1,a=0;a<e.length;a++)if(!1===e[a][0].trace.cliponaxis){i=!0;break}r._hasClipOnAxisFalse=i,r.updateLayers(t,n),r.updateLayout(t,n),u.generalUpdatePerTraceModule(r.gd,r,e,n),r.updateFx(t,n),r.isSmith&&(delete n.realaxis.range,delete n.imaginaryaxis.range)},N.updateLayers=function(e,t){var n=this,i=n.isSmith,a=n.layers,o=n.getRadial(t),s=n.getAngular(t),l=S.layerNames,c=l.indexOf("frontplot"),u=l.slice(0,c),h="below traces"===s.layer,f="below traces"===o.layer;h&&u.push("angular-line"),f&&u.push("radial-line"),h&&u.push("angular-axis"),f&&u.push("radial-axis"),u.push("frontplot"),h||u.push("angular-line"),f||u.push("radial-line"),h||u.push("angular-axis"),f||u.push("radial-axis");var p=(i?"smith":"polar")+"sublayer",d=n.framework.selectAll("."+p).data(u,String);d.enter().append("g").attr("class",(function(e){return p+" "+e})).each((function(e){var t=a[e]=r.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":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")}})),d.order()},N.updateLayout=function(e,t){var r=this,n=r.layers,i=e._size,a=r.getRadial(t),o=r.getAngular(t),u=t.domain.x,h=t.domain.y;r.xOffset=i.l+i.w*u[0],r.yOffset=i.t+i.h*(1-h[1]);var f=r.xLength=i.w*(u[1]-u[0]),p=r.yLength=i.h*(h[1]-h[0]),d=r.getSector(t);r.sectorInRad=d.map(R);var m,g,y,v,x,_=r.sectorBBox=function(e){var t,r=e[0],n=e[1]-r,i=O(r,360),a=i+n,o=Math.cos(R(i)),s=Math.sin(R(i)),l=Math.cos(R(a)),c=Math.sin(R(a));return t=i<=90&&a>=90||i>90&&a>=450?1:s<=0&&c<=0?0:Math.max(s,c),[i<=180&&a>=180||i>180&&a>=540?-1:o>=0&&l>=0?0:Math.min(o,l),i<=270&&a>=270||i>270&&a>=630?-1:s>=0&&c>=0?0:Math.min(s,c),a>=360?1:o<=0&&l<=0?0:Math.max(o,l),t]}(d),b=_[2]-_[0],w=_[3]-_[1],T=p/f,k=Math.abs(w/b);T>k?(m=f,x=(p-(g=f*k))/i.h/2,y=[u[0],u[1]],v=[h[0]+x,h[1]-x]):(g=p,x=(f-(m=p/k))/i.w/2,y=[u[0]+x,u[1]-x],v=[h[0],h[1]]),r.xLength2=m,r.yLength2=g,r.xDomain2=y,r.yDomain2=v;var A,M=r.xOffset2=i.l+i.w*y[0],S=r.yOffset2=i.t+i.h*(1-v[1]),E=r.radius=m/b,C=r.innerRadius=r.getHole(t)*E,I=r.cx=M-E*_[0],L=r.cy=S+E*_[3],P=r.cxx=I-M,z=r.cyy=L-S,D=a.side;"counterclockwise"===D?(A=D,D="top"):"clockwise"===D&&(A=D,D="bottom"),r.radialAxis=r.mockAxis(e,t,a,{_id:"x",side:D,_trueSide:A,domain:[C/i.w,E/i.w]}),r.angularAxis=r.mockAxis(e,t,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(e,t),r.updateAngularAxis(e,t),r.updateRadialAxis(e,t),r.updateRadialAxisTitle(e,t),r.xaxis=r.mockCartesianAxis(e,t,{_id:"x",domain:y}),r.yaxis=r.mockCartesianAxis(e,t,{_id:"y",domain:v});var F=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",F).attr("transform",s(P,z)),n.frontplot.attr("transform",s(M,S)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",F).attr("transform",s(I,L)).call(l.fill,t.bgcolor)},N.mockAxis=function(e,t,r,n){var i=a.extendFlat({},r,n);return p(i,t,e),i},N.mockCartesianAxis=function(e,t,r){var n=this,i=n.isSmith,o=r._id,s=a.extendFlat({type:"linear"},r);f(s,e);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var e=n.sectorBBox,r=l[o],i=n.radialAxis._rl,a=(i[1]-i[0])/(1-n.getHole(t));s.range=[e[r[0]]*a,e[r[1]]*a]},s.isPtWithinRange="x"!==o||i?function(){return!0}:function(e){return n.isPtInside(e)},s.setRange(),s.setScale(),s},N.doAutoRange=function(e,t){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(t);d(n,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")],void 0!==i.minallowed){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(void 0!==i.maxallowed){var l=i.r2l(i.maxallowed);i._rl[0]<i._rl[1]?i._rl[1]=Math.min(i._rl[1],l):i._rl[0]=Math.min(i._rl[0],l)}},N.updateRadialAxis=function(e,t){var r=this,n=r.gd,i=r.layers,c=r.radius,u=r.innerRadius,f=r.cx,p=r.cy,d=r.getRadial(t),m=O(r.getSector(t)[0],360),g=r.radialAxis,y=u<c,v=r.isSmith;v||(r.fillViewInitialKey("radialaxis.angle",d.angle),r.fillViewInitialKey("radialaxis.range",g.range.slice()),g.setGeometry()),"auto"===g.tickangle&&m>90&&m<=270&&(g.tickangle=180);var x=v?function(e){var t=z(r,I([e.x,0]));return s(t[0]-f,t[1]-p)}:function(e){return s(g.l2p(e.x)+u,0)},_=v?function(e){return P(r,e.x,-1/0,1/0)}:function(e){return r.pathArc(g.r2p(e.x)+u)},b=U(d);if(r.radialTickLayout!==b&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=b),y){g.setScale();var w=0,T=v?(g.tickvals||[]).filter((function(e){return e>=0})).map((function(e){return h.tickText(g,e,!0,!1)})):h.calcTicks(g),k=v?T:h.clipEnds(g,T),A=h.getTickSigns(g)[2];v&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(A=-A),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),h.drawTicks(n,g,{vals:T,layer:i["radial-axis"],path:h.makeTickPath(g,0,A),transFn:x,crisp:!1}),h.drawGrid(n,g,{vals:k,layer:i["radial-grid"],path:_,transFn:a.noop,crisp:!1}),h.drawLabels(n,g,{vals:T,layer:i["radial-axis"],transFn:x,labelFns:h.makeLabelFns(g,w)})}var M=r.radialAxisAngle=r.vangles?B(V(R(d.angle),r.vangles)):d.angle,S=s(f,p),E=S+o(-M);q(i["radial-axis"],y&&(d.showticklabels||d.ticks),{transform:E}),q(i["radial-grid"],y&&d.showgrid,{transform:v?"":S}),q(i["radial-line"].select("line"),y&&d.showline,{x1:v?-c:u,y1:0,x2:c,y2:0,transform:E}).attr("stroke-width",d.linewidth).call(l.stroke,d.linecolor)},N.updateRadialAxisTitle=function(e,t,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(t),u=n.id+"title",h=0;if(l.title){var f=c.bBox(n.layers["radial-axis"].node()).height,p=l.title.font.size,d=l.side;h="top"===d?p:"counterclockwise"===d?-(f+.4*p):f+.8*p}var m=void 0!==r?r:n.radialAxisAngle,g=R(m),y=Math.cos(g),x=Math.sin(g),_=o+a/2*y+h*x,b=s-a/2*x+h*y;n.layers["radial-axis-title"]=v.draw(i,u,{propContainer:l,propName:n.id+".radialaxis.title.text",placeholder:D(i,"Click to enter radial axis title"),attributes:{x:_,y:b,"text-anchor":"middle"},transform:{rotate:-m}})}},N.updateAngularAxis=function(e,t){var r=this,n=r.gd,i=r.layers,c=r.radius,u=r.innerRadius,f=r.cx,p=r.cy,d=r.getAngular(t),m=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",d.rotation),m.setGeometry(),m.setScale());var y=g?function(e){var t=z(r,I([0,e.x]));return Math.atan2(t[0]-f,t[1]-p)-Math.PI/2}:function(e){return m.t2g(e.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=B(m.tick0),m.dtick=B(m.dtick));var v=function(e){return s(f+c*Math.cos(e),p-c*Math.sin(e))},x=g?function(e){var t=z(r,I([0,e.x]));return s(t[0],t[1])}:function(e){return v(y(e))},_=g?function(e){var t=z(r,I([0,e.x])),n=Math.atan2(t[0]-f,t[1]-p)-Math.PI/2;return s(t[0],t[1])+o(-B(n))}:function(e){var t=y(e);return v(t)+o(-B(t))},b=g?function(e){return L(r,e.x,0,1/0)}:function(e){var t=y(e),r=Math.cos(t),n=Math.sin(t);return"M"+[f+u*r,p-u*n]+"L"+[f+c*r,p-c*n]},w=h.makeLabelFns(m,0).labelStandoff,T={xFn:function(e){var t=y(e);return Math.cos(t)*w},yFn:function(e){var t=y(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(w+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*M)},anchorFn:function(e){var t=y(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(e,t,r){var n=y(e);return-.5*(1+Math.sin(n))*r}},k=U(d);r.angularTickLayout!==k&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=k);var A,S=g?[1/0].concat(m.tickvals||[]).map((function(e){return h.tickText(m,e,!0,!1)})):h.calcTicks(m);if(g&&(S[0].text="∞",S[0].fontSize*=1.75),"linear"===t.gridshape?(A=S.map(y),a.angleDelta(A[0],A[1])<0&&(A=A.slice().reverse())):A=null,r.vangles=A,"category"===m.type&&(S=S.filter((function(e){return a.isAngleInsideSector(y(e),r.sectorInRad)}))),m.visible){var E="inside"===m.ticks?-1:1,C=(m.linewidth||1)/2;h.drawTicks(n,m,{vals:S,layer:i["angular-axis"],path:"M"+E*C+",0h"+E*m.ticklen,transFn:_,crisp:!1}),h.drawGrid(n,m,{vals:S,layer:i["angular-grid"],path:b,transFn:a.noop,crisp:!1}),h.drawLabels(n,m,{vals:S,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:x,labelFns:T})}q(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:s(f,p)}).attr("stroke-width",d.linewidth).call(l.stroke,d.linecolor)},N.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))},N.updateHoverAndMainDrag=function(e){var t,o,l=this,c=l.isSmith,u=l.gd,h=l.layers,f=e._zoomlayer,p=S.MINZOOM,d=S.OFFEDGE,v=l.radius,b=l.innerRadius,T=l.cx,k=l.cy,A=l.cxx,M=l.cyy,C=l.sectorInRad,I=l.vangles,L=l.radialAxis,P=E.clampTiny,z=E.findXYatLength,D=E.findEnclosingVertexAngles,O=S.cornerHalfWidth,R=S.cornerLen/2,F=m.makeDragger(h,"path","maindrag",!1===e.dragmode?"none":"crosshair");r.select(F).attr("d",l.pathSubplot()).attr("transform",s(T,k)),F.onmousemove=function(e){y.hover(u,e,l.id),u._fullLayout._lasthover=F,u._fullLayout._hoversubplot=l.id},F.onmouseout=function(e){u._dragging||g.unhover(u,e)};var B,j,N,U,V,q,H,G,W,Z={element:F,gd:u,subplot:l.id,plotinfo:{id:l.id,xaxis:l.xaxis,yaxis:l.yaxis},xaxes:[l.xaxis],yaxes:[l.yaxis]};function Y(e,t){return Math.sqrt(e*e+t*t)}function X(e,t){return Y(e-A,t-M)}function $(e,t){return Math.atan2(M-t,e-A)}function K(e,t){return[e*Math.cos(t),e*Math.sin(-t)]}function J(e,t){if(0===e)return l.pathSector(2*O);var r=R/e,n=t-r,i=t+r,a=Math.max(0,Math.min(e,v)),o=a-O,s=a+O;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,i)+"L"+K(s,i)+"A"+[s,s]+" 0,0,1 "+K(s,n)+"Z"}function Q(e,t,r){if(0===e)return l.pathSector(2*O);var n,i,a=K(e,t),o=K(e,r),s=P((a[0]+o[0])/2),c=P((a[1]+o[1])/2);if(s&&c){var u=c/s,h=-1/u,f=z(O,u,s,c);n=z(R,h,f[0][0],f[0][1]),i=z(R,h,f[1][0],f[1][1])}else{var p,d;c?(p=R,d=O):(p=O,d=R),n=[[s-p,c-d],[s+p,c-d]],i=[[s-p,c+d],[s+p,c+d]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function ee(e,t){return t=Math.max(Math.min(t,v),b),e<d?e=0:v-e<d?e=v:t<d?t=0:v-t<d&&(t=v),Math.abs(t-e)>p?(e<t?(N=e,U=t):(N=t,U=e),!0):(N=null,U=null,!1)}function te(e,t){e=e||V,t=t||"M0,0Z",G.attr("d",e),W.attr("d",t),m.transitionZoombox(G,W,q,H),q=!0;var r={};oe(r),u.emit("plotly_relayouting",r)}function re(e,r){var n,i,a=B+(e*=t),s=j+(r*=o),c=X(B,j),u=Math.min(X(a,s),v),h=$(B,j);ee(c,u)&&(n=V+l.pathSector(U),N&&(n+=l.pathSector(N)),i=J(N,h)+J(U,h)),te(n,i)}function ne(e,t,r,n){var i=E.findIntersectionXY(r,n,r,[e-A,M-t]);return Y(i[0],i[1])}function ie(e,t){var r,n,i=B+e,a=j+t,o=$(B,j),s=$(i,a),c=D(o,I),u=D(s,I);ee(ne(B,j,c[0],c[1]),Math.min(ne(i,a,u[0],u[1]),v))&&(r=V+l.pathSector(U),N&&(r+=l.pathSector(N)),n=[Q(N,c[0],c[1]),Q(U,c[0],c[1])].join(" ")),te(r,n)}function ae(){if(m.removeZoombox(u),null!==N&&null!==U){var e={};oe(e),m.showDoubleClickNotifier(u),i.call("_guiRelayout",u,e)}}function oe(e){var t=L._rl,r=(t[1]-t[0])/(1-b/v)/v,n=[t[0]+(N-b)*r,t[0]+(U-b)*r];e[l.id+".radialaxis.range"]=n}function se(e,t){var r=u._fullLayout.clickmode;if(m.removeZoombox(u),2===e){var n={};for(var a in l.viewInitial)n[l.id+"."+a]=l.viewInitial[a];u.emit("plotly_doubleclick",null),i.call("_guiRelayout",u,n)}r.indexOf("select")>-1&&1===e&&_(t,u,[l.xaxis],[l.yaxis],l.id,Z),r.indexOf("event")>-1&&y.click(u,t,l.id)}Z.prepFn=function(e,r,i){var s=u._fullLayout.dragmode,h=F.getBoundingClientRect();u._fullLayout._calcInverseTransform(u);var p=u._fullLayout._invTransform;t=u._fullLayout._invScaleX,o=u._fullLayout._invScaleY;var d=a.apply3DTransform(p)(r-h.left,i-h.top);if(B=d[0],j=d[1],I){var g=E.findPolygonOffset(v,C[0],C[1],I);B+=A+g[0],j+=M+g[1]}switch(s){case"zoom":Z.clickFn=se,c||(Z.moveFn=I?ie:re,Z.doneFn=ae,function(){N=null,U=null,V=l.pathSubplot(),q=!1;var e=u._fullLayout[l.id];H=n(e.bgcolor).getLuminance(),(G=m.makeZoombox(f,H,T,k,V)).attr("fill-rule","evenodd"),W=m.makeCorners(f,T,k),w(u)}());break;case"select":case"lasso":x(e,r,i,Z,s)}},g.init(Z)},N.updateRadialDrag=function(e,t,n){var l=this,c=l.gd,u=l.layers,h=l.radius,f=l.innerRadius,p=l.cx,d=l.cy,y=l.radialAxis,v=S.radialDragBoxSize,x=v/2;if(y.visible){var _,b,T,M=R(l.radialAxisAngle),E=y._rl,C=E[0],I=E[1],L=E[n],P=.75*(E[1]-E[0])/(1-l.getHole(t))/h;n?(_=p+(h+x)*Math.cos(M),b=d-(h+x)*Math.sin(M),T="radialdrag"):(_=p+(f-x)*Math.cos(M),b=d-(f-x)*Math.sin(M),T="radialdrag-inner");var z,D,O,F=m.makeRectDragger(u,T,"crosshair",-x,-x,v,v),j={element:F,gd:c};!1===e.dragmode&&(j.dragmode=!1),q(r.select(F),y.visible&&f<h,{transform:s(_,b)}),j.prepFn=function(){z=null,D=null,O=null,j.moveFn=N,j.doneFn=U,w(c)},j.clampFn=function(e,t){return Math.sqrt(e*e+t*t)<S.MINDRAG&&(e=0,t=0),[e,t]},g.init(j)}function N(e,t){if(z)z(e,t);else{var r=[e,-t],i=[Math.cos(M),Math.sin(M)],o=Math.abs(a.dot(r,i)/Math.sqrt(a.dot(r,r)));isNaN(o)||(z=o<.5?H:G)}var s={};(function(e){null!==D?e[l.id+".radialaxis.angle"]=D:null!==O&&(e[l.id+".radialaxis.range["+n+"]"]=O)})(s),c.emit("plotly_relayouting",s)}function U(){null!==D?i.call("_guiRelayout",c,l.id+".radialaxis.angle",D):null!==O&&i.call("_guiRelayout",c,l.id+".radialaxis.range["+n+"]",O)}function H(e,t){if(0!==n){var r=_+e,i=b+t;D=Math.atan2(d-i,r-p),l.vangles&&(D=V(D,l.vangles)),D=B(D);var a=s(p,d)+o(-D);u["radial-axis"].attr("transform",a),u["radial-line"].select("line").attr("transform",a);var c=l.gd._fullLayout,h=c[l.id];l.updateRadialAxisTitle(c,h,D)}}function G(e,t){var r=a.dot([e,-t],[Math.cos(M),Math.sin(M)]);if(O=L-P*r,P>0==(n?O>C:O<I)){var o=c._fullLayout,s=o[l.id];y.range[n]=O,y._rl[n]=O,l.updateRadialAxis(o,s),l.xaxis.setRange(),l.xaxis.setScale(),l.yaxis.setRange(),l.yaxis.setScale();var u=!1;for(var h in l.traceHash){var f=l.traceHash[h],p=a.filterVisible(f);f[0][0].trace._module.plot(c,l,p,s),i.traceIs(h,"gl")&&p.length&&(u=!0)}u&&(k(c),A(c))}else O=null}},N.updateAngularDrag=function(e){var t=this,n=t.gd,l=t.layers,u=t.radius,h=t.angularAxis,f=t.cx,p=t.cy,d=t.cxx,y=t.cyy,v=S.angularDragBoxSize,x=m.makeDragger(l,"path","angulardrag",!1===e.dragmode?"none":"move"),_={element:x,gd:n};function b(e,t){return Math.atan2(y+v-t,e-d-v)}!1===e.dragmode?_.dragmode=!1:r.select(x).attr("d",t.pathAnnulus(u,u+v)).attr("transform",s(f,p)).call(T,"move");var M,E,C,I,L,P,z=l.frontplot.select(".scatterlayer").selectAll(".trace"),D=z.selectAll(".point"),O=z.selectAll(".textpoint");function R(u,m){var g=t.gd._fullLayout,v=g[t.id],x=b(M+u*e._invScaleX,E+m*e._invScaleY),_=B(x-P);if(I=C+_,l.frontplot.attr("transform",s(t.xOffset2,t.yOffset2)+o([-_,d,y])),t.vangles){L=t.radialAxisAngle+_;var w=s(f,p)+o(-_),T=s(f,p)+o(-L);l.bg.attr("transform",w),l["radial-grid"].attr("transform",w),l["radial-axis"].attr("transform",T),l["radial-line"].select("line").attr("transform",T),t.updateRadialAxisTitle(g,v,L)}else t.clipPaths.forTraces.select("path").attr("transform",s(d,y)+o(_));D.each((function(){var e=r.select(this),t=c.getTranslate(e);e.attr("transform",s(t.x,t.y)+o([_]))})),O.each((function(){var e=r.select(this),t=e.select("text"),n=c.getTranslate(e);e.attr("transform",o([_,t.attr("x"),t.attr("y")])+s(n.x,n.y))})),h.rotation=a.modHalf(I,360),t.updateAngularAxis(g,v),t._hasClipOnAxisFalse&&!a.isFullCircle(t.sectorInRad)&&z.call(c.hideOutsideRangePoints,t);var S=!1;for(var R in t.traceHash)if(i.traceIs(R,"gl")){var j=t.traceHash[R],N=a.filterVisible(j);j[0][0].trace._module.plot(n,t,N,v),N.length&&(S=!0)}S&&(k(n),A(n));var U={};F(U),n.emit("plotly_relayouting",U)}function F(e){e[t.id+".angularaxis.rotation"]=I,t.vangles&&(e[t.id+".radialaxis.angle"]=L)}function j(){O.select("text").attr("transform",null);var e={};F(e),i.call("_guiRelayout",n,e)}_.prepFn=function(r,i,o){var s=e[t.id];C=s.angularaxis.rotation;var l=x.getBoundingClientRect();M=i-l.left,E=o-l.top,n._fullLayout._calcInverseTransform(n);var c=a.apply3DTransform(e._invTransform)(M,E);M=c[0],E=c[1],P=b(M,E),_.moveFn=R,_.doneFn=j,w(n)},t.vangles&&!a.isFullCircle(t.sectorInRad)&&(_.prepFn=a.noop,T(r.select(x),null)),g.init(_)},N.isPtInside=function(e){if(this.isSmith)return!0;var t=this.sectorInRad,r=this.vangles,n=this.angularAxis.c2g(e.theta),i=this.radialAxis,o=i.c2l(e.r),s=i._rl;return(r?E.isPtInsidePolygon:a.isPtInsideSector)(o,n,s,t,r)},N.pathArc=function(e){var t=this.sectorInRad,r=this.vangles;return(r?E.pathPolygon:a.pathArc)(e,t[0],t[1],r)},N.pathSector=function(e){var t=this.sectorInRad,r=this.vangles;return(r?E.pathPolygon:a.pathSector)(e,t[0],t[1],r)},N.pathAnnulus=function(e,t){var r=this.sectorInRad,n=this.vangles;return(n?E.pathPolygonAnnulus:a.pathAnnulus)(e,t,r[0],r[1],n)},N.pathSubplot=function(){var e=this.innerRadius,t=this.radius;return e?this.pathAnnulus(e,t):this.pathSector(t)},N.fillViewInitialKey=function(e,t){e in this.viewInitial||(this.viewInitial[e]=t)}}}),jT=m({"src/plots/polar/layout_attributes.js"(e,t){var r=G(),n=Lt(),i=Ma().attributes,a=ct().extendFlat,o=De().overrideAll,s=o({color:n.color,showline:a({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:a({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash},"plot","from-root"),l=o({tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,ticklabelstep:n.ticklabelstep,showticklabels:n.showticklabels,labelalias:n.labelalias,minorloglabels:n.minorloglabels,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,layer:n.layer},"plot","from-root"),c={visible:a({},n.visible,{dflt:!0}),type:a({},n.type,{values:["-","linear","log","date","category"]}),autotypenumbers:n.autotypenumbers,autorangeoptions:{minallowed:n.autorangeoptions.minallowed,maxallowed:n.autorangeoptions.maxallowed,clipmin:n.autorangeoptions.clipmin,clipmax:n.autorangeoptions.clipmax,include:n.autorangeoptions.include,editType:"plot"},autorange:a({},n.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:a({},n.minallowed,{editType:"plot"}),maxallowed:a({},n.maxallowed,{editType:"plot"}),range:a({},n.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:n.categoryorder,categoryarray:n.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:n.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:a({},n.title.text,{editType:"plot",dflt:""}),font:a({},n.title.font,{editType:"plot"}),editType:"plot"},hoverformat:n.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};a(c,s,l);var u={visible:a({},n.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:n.autotypenumbers,categoryorder:n.categoryorder,categoryarray:n.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:n.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};a(u,s,l),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:r.background},radialaxis:c,angularaxis:u,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),NT=m({"src/plots/polar/layout_defaults.js"(e,t){var r=ct(),n=W(),i=vt(),a=Gs(),o=Tt().getSubplotData,s=Ft(),l=Bt(),c=Ut(),u=Vt(),h=Ti(),f=ki(),p=or(),d=nr(),m=jT(),g=DT(),y=OT(),v=y.axisNames;function x(e,t,a,d){var x=a("bgcolor");d.bgColor=n.combine(x,d.paper_bgcolor);var b=a("sector");a("hole");var w,T=o(d.fullData,y.name,d.id),k=d.layoutOut;function A(e,t){return a(w+"."+e,t)}for(var M=0;M<v.length;M++){w=v[M],r.isPlainObject(e[w])||(e[w]={});var S=e[w],E=i.newContainer(t,w);E._id=E._name=w,E._attr=d.id+"."+w,E._traceIndices=T.map((function(e){return e.index}));var C=y.axisName2dataArray[w],I=_(S,E,A,T,C,d);h(S,E,A,{axData:T,dataAttr:C});var L=A("visible");switch(g(E,t,k),A("uirevision",t.uirevision),E._m=1,w){case"radialaxis":A("minallowed"),A("maxallowed");var P,z=A("range"),D=E.getAutorangeDflt(z),O=A("autorange",D);z&&(null===z[0]&&null===z[1]||(null===z[0]||null===z[1])&&("reversed"===O||!0===O)||null!==z[0]&&("min"===O||"max reversed"===O)||null!==z[1]&&("max"===O||"min reversed"===O))&&(z=void 0,delete E.range,E.autorange=!0,P=!0),P||(O=A("autorange",D=E.getAutorangeDflt(z))),S.autorange=O,O&&(p(A,O,z),("linear"===I||"-"===I)&&A("rangemode"),E.isReversed()&&(E._m=-1)),E.cleanRange("range",{dfltRange:[0,1]});break;case"angularaxis":if("date"===I){r.log("Polar plots do not support date angular axes yet.");for(var R=0;R<T.length;R++)T[R].visible=!1;I=S.type=E.type="linear"}A("linear"===I?"thetaunit":"period");var F=A("direction");A("rotation",{counterclockwise:0,clockwise:90}[F])}if(u(S,E,A,E.type,{tickSuffixDflt:"degrees"===E.thetaunit?"°":void 0}),L){var B,j,N,U,V,q,H,G,W,Z,Y=d.font||{};j=(B=A("color"))===S.color?B:Y.color,N=Y.size,U=Y.family,V=Y.weight,q=Y.style,H=Y.variant,G=Y.textcase,W=Y.lineposition,Z=Y.shadow,s(S,E,A,E.type),c(S,E,A,E.type,{font:{weight:V,style:q,variant:H,textcase:G,lineposition:W,shadow:Z,color:j,size:N,family:U},noAutotickangles:"angularaxis"===w,noTicklabelshift:!0,noTicklabelstandoff:!0}),l(S,E,A,{outerTicks:!0}),f(S,E,A,{dfltColor:B,bgColor:d.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:m[w]}),A("layer"),"radialaxis"===w&&(A("side"),A("angle",b[0]),A("title.text"),r.coerceFont(A,"title.font",{weight:V,style:q,variant:H,textcase:G,lineposition:W,shadow:Z,color:j,size:r.bigFont(N),family:U}))}"category"!==I&&A("hoverformat"),E._input=S}"category"===t.angularaxis.type&&a("gridshape")}function _(e,t,r,n,i,a){var o=r("autotypenumbers",a.autotypenumbersDflt);if("-"===r("type")){for(var s,l=0;l<n.length;l++)if(n[l].visible){s=n[l];break}s&&s[i]&&(t.type=d(s[i],"gregorian",{noMultiCategory:!0,autotypenumbers:o})),"-"===t.type?t.type="linear":e.type=t.type}return t.type}t.exports=function(e,t,r){a(e,t,r,{type:y.name,attributes:m,handleDefaults:x,font:t.font,autotypenumbersDflt:t.autotypenumbers,paper_bgcolor:t.paper_bgcolor,fullData:r,layoutOut:t})}}}),UT=m({"src/plots/polar/index.js"(e,t){var r=Tt().getSubplotCalcData,n=ct().counterRegex,i=BT(),a=OT(),o=a.attr,s=a.name,l=n(s),c={};c[o]={valType:"subplotid",dflt:s,editType:"calc"},t.exports={attr:o,name:s,idRoot:s,idRegex:l,attrRegex:l,attributes:c,layoutAttributes:jT(),supplyLayoutDefaults:NT(),plot:function(e){for(var t=e._fullLayout,n=e.calcdata,a=t._subplots[s],o=0;o<a.length;o++){var l=a[o],c=r(n,s,l),u=t[l]._subplot;u||(u=i(e,l),t[l]._subplot=u),u.plot(c,t,e._promises)}},clean:function(e,t,r,n){for(var i=n._subplots[s]||[],a=n._has&&n._has("gl"),o=t._has&&t._has("gl"),l=a&&!o,c=0;c<i.length;c++){var u=i[c],h=n[u]._subplot;if(!t[u]&&h)for(var f in h.framework.remove(),h.layers["radial-axis-title"].remove(),h.clipPaths)h.clipPaths[f].remove();l&&h._scene&&(h._scene.destroy(),h._scene=null)}},toSVG:Ci().toSVG}}}),VT=m({"src/traces/scatterpolar/attributes.js"(e,t){var{hovertemplateAttrs:r,texttemplateAttrs:n,templatefallbackAttrs:i}=Fe(),a=B().extendFlat,o=Tn(),s=kn(),l=q(),c=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:n({editType:"plot"},{keys:["r","theta","text"]}),texttemplatefallback:i({editType:"plot"}),hovertext:s.hovertext,line:{color:c.color,width:c.width,dash:c.dash,backoff:c.backoff,shape:a({},c.shape,{values:["linear","spline"]}),smoothing:c.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({},l.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:s.hoveron,hovertemplate:r(),hovertemplatefallback:i(),selected:s.selected,unselected:s.unselected}}}),qT=m({"src/traces/scatterpolar/defaults.js"(e,t){var r=ct(),n=Xt(),i=Yn(),a=Xn(),o=$n(),s=Kn(),l=Jn(),c=wn().PTS_LINESONLY,u=VT();function h(e,t,n,i){var a,o=i("r"),s=i("theta");if(r.isTypedArray(o)&&(t.r=o=Array.from(o)),r.isTypedArray(s)&&(t.theta=s=Array.from(s)),o)s?a=Math.min(o.length,s.length):(a=o.length,i("theta0"),i("dtheta"));else{if(!s)return 0;a=t.theta.length,i("r0"),i("dr")}return t._length=a,a}t.exports={handleRThetaDefaults:h,supplyDefaults:function(e,t,f,p){function d(n,i){return r.coerce(e,t,u,n,i)}var m=h(0,t,0,d);if(m){d("thetaunit"),d("mode",m<c?"lines+markers":"lines"),d("text"),d("hovertext"),"fills"!==t.hoveron&&(d("hovertemplate"),d("hovertemplatefallback")),n.hasMarkers(t)&&i(e,t,f,p,d,{gradient:!0}),n.hasLines(t)&&(a(e,t,f,p,d,{backoff:!0}),o(e,t,d),d("connectgaps")),n.hasText(t)&&(d("texttemplate"),d("texttemplatefallback"),s(e,t,p,d));var g=[];(n.hasMarkers(t)||n.hasText(t))&&(d("cliponaxis"),d("marker.maxdisplayed"),g.push("points")),d("fill"),"none"!==t.fill&&(l(e,t,f,d),n.hasLines(t)||o(e,t,d)),("tonext"===t.fill||"toself"===t.fill)&&g.push("fills"),d("hoveron",g.join("+")||"points"),r.coerceSelectionMarkerOpacity(t,d)}else t.visible=!1}}}}),HT=m({"src/traces/scatterpolar/format_labels.js"(e,t){var r=ct(),n=ar();t.exports=function(e,t,i){var a,o,s={},l=i[t.subplot]._subplot;l?(a=l.radialAxis,o=l.angularAxis):(a=(l=i[t.subplot]).radialaxis,o=l.angularaxis);var c=a.c2l(e.r);s.rLabel=n.tickText(a,c,!0).text;var u="degrees"===o.thetaunit?r.rad2deg(e.theta):e.theta;return s.thetaLabel=n.tickText(o,u,!0).text,s}}}),GT=m({"src/traces/scatterpolar/calc.js"(e,t){var r=M(),n=S().BADNUM,i=ar(),a=ii(),o=ai(),s=oi(),l=si().calcMarkerSize;t.exports=function(e,t){for(var c=e._fullLayout,u=t.subplot,h=c[u].radialaxis,f=c[u].angularaxis,p=h.makeCalcdata(t,"r"),d=f.makeCalcdata(t,"theta"),m=t._length,g=new Array(m),y=0;y<m;y++){var v=p[y],x=d[y],_=g[y]={};r(v)&&r(x)?(_.r=v,_.theta=x):_.r=n}var b=l(t,m);return t._extremes.x=i.findExtremes(h,p,{ppad:b}),a(e,t),o(g,t),s(g,t),g}}}),WT=m({"src/traces/scatterpolar/plot.js"(e,t){var r=di(),n=S().BADNUM;t.exports=function(e,t,i){for(var a=t.layers.frontplot.select("g.scatterlayer"),o=t.xaxis,s=t.yaxis,l={xaxis:o,yaxis:s,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},c=t.radialAxis,u=t.angularAxis,h=0;h<i.length;h++)for(var f=i[h],p=0;p<f.length;p++){0===p&&(f[0].trace._xA=o,f[0].trace._yA=s);var d=f[p],m=d.r;if(m===n)d.x=d.y=n;else{var g=c.c2g(m),y=u.c2g(d.theta);d.x=g*Math.cos(y),d.y=g*Math.sin(y)}}r(e,l,i,a)}}}),ZT=m({"src/traces/scatterpolar/hover.js"(e,t){var r=xi();function n(e,t,r,n){var i=r.radialAxis,a=r.angularAxis;i._hovertitle="r",a._hovertitle="θ";var o={};o[t.subplot]={_subplot:r};var s=t._module.formatLabels(e,t,o);n.rLabel=s.rLabel,n.thetaLabel=s.thetaLabel;var l=e.hi||t.hoverinfo,c=[];function u(e,t){c.push(e._hovertitle+": "+t)}if(!t.hovertemplate){var h=l.split("+");-1!==h.indexOf("all")&&(h=["r","theta","text"]),-1!==h.indexOf("r")&&u(i,n.rLabel),-1!==h.indexOf("theta")&&u(a,n.thetaLabel),-1!==h.indexOf("text")&&n.text&&(c.push(n.text),delete n.text),n.extraText=c.join("<br>")}}t.exports={hoverPoints:function(e,t,i,a){var o=r(e,t,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),YT=m({"src/traces/scatterpolar/index.js"(e,t){t.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:UT(),categories:["polar","symbols","showLegend","scatter-like"],attributes:VT(),supplyDefaults:qT().supplyDefaults,colorbar:mi(),formatLabels:HT(),calc:GT(),plot:WT(),style:yi().style,styleOnSelect:yi().styleOnSelect,hoverPoints:ZT().hoverPoints,selectPoints:_i(),meta:{}}}}),XT=m({"lib/scatterpolar.js"(e,t){t.exports=YT()}}),$T=m({"src/traces/scatterpolargl/attributes.js"(e,t){var r=VT(),{cliponaxis:n,hoveron:i}=r,a=((e,t)=>{var r={};for(var n in e)l.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&o)for(var n of o(e))t.indexOf(n)<0&&u.call(e,n)&&(r[n]=e[n]);return r})(r,["cliponaxis","hoveron"]),{connectgaps:s,line:{color:c,dash:h,width:d},fill:m,fillcolor:g,marker:y,textfont:v,textposition:x}=$g();t.exports=p(f({},a),{connectgaps:s,fill:m,fillcolor:g,line:{color:c,dash:h,editType:"calc",width:d},marker:y,textfont:v,textposition:x})}}),KT=m({"src/traces/scatterpolargl/defaults.js"(e,t){var r=ct(),n=Xt(),i=qT().handleRThetaDefaults,a=Yn(),o=Xn(),s=Kn(),l=Jn(),c=wn().PTS_LINESONLY,u=$T();t.exports=function(e,t,h,f){function p(n,i){return r.coerce(e,t,u,n,i)}var d=i(e,t,f,p);d?(p("thetaunit"),p("mode",d<c?"lines+markers":"lines"),p("text"),p("hovertext"),"fills"!==t.hoveron&&(p("hovertemplate"),p("hovertemplatefallback")),n.hasMarkers(t)&&a(e,t,h,f,p,{noAngleRef:!0,noLineDash:!0,noStandOff:!0}),n.hasLines(t)&&(o(e,t,h,f,p),p("connectgaps")),n.hasText(t)&&(p("texttemplate"),p("texttemplatefallback"),s(e,t,f,p,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0})),p("fill"),"none"!==t.fill&&l(e,t,h,p),r.coerceSelectionMarkerOpacity(t,p)):t.visible=!1}}}),JT=m({"src/traces/scatterpolargl/format_labels.js"(e,t){var r=HT();t.exports=function(e,t,n){var i=e.i;return"r"in e||(e.r=t._r[i]),"theta"in e||(e.theta=t._theta[i]),r(e,t,n)}}}),QT=m({"src/traces/scatterpolargl/calc.js"(e,t){var r=ii(),n=si().calcMarkerSize,i=xy(),a=ar(),o=Xg().TOO_MANY_POINTS;t.exports=function(e,t){var s=e._fullLayout,l=t.subplot,c=s[l].radialaxis,u=s[l].angularaxis,h=t._r=c.makeCalcdata(t,"r"),f=t._theta=u.makeCalcdata(t,"theta"),p=t._length,d={};p<h.length&&(h=h.slice(0,p)),p<f.length&&(f=f.slice(0,p)),d.r=h,d.theta=f,r(e,t);var m,g=d.opts=i.style(e,t);return p<o?m=n(t,p):g.marker&&(m=2*(g.marker.sizeAvg||Math.max(g.marker.size,3))),t._extremes.x=a.findExtremes(c,h,{ppad:m}),[{x:!1,y:!1,t:d,trace:t}]}}}),ek=m({"src/traces/scatterpolargl/hover.js"(e,t){var r=Yg(),n=ZT().makeHoverPointText;t.exports={hoverPoints:function(e,t,i,a){var o=e.cd[0].t,s=o.r,l=o.theta,c=r.hoverPoints(e,t,i,a);if(c&&!1!==c[0].index){var u=c[0];if(void 0===u.index)return c;var h=e.subplot,f=u.cd[u.index],p=u.trace;if(f.r=s[u.index],f.theta=l[u.index],h.isPtInside(f))return u.xLabelVal=void 0,u.yLabelVal=void 0,n(f,p,h,u),c}}}}}),tk=m({"src/traces/scatterpolargl/base_index.js"(e,t){t.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:UT(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:$T(),supplyDefaults:KT(),colorbar:mi(),formatLabels:JT(),calc:QT(),hoverPoints:ek().hoverPoints,selectPoints:Ty(),meta:{}}}}),rk=m({"src/traces/scatterpolargl/plot.js"(e,t){var r=cy(),n=M(),i=Ex(),a=_y(),o=xy(),s=ct(),l=Xg().TOO_MANY_POINTS;t.exports=function(e,t,c){if(c.length){var u=t.radialAxis,h=t.angularAxis,f=a(e,t);return c.forEach((function(i){if(i&&i[0]&&i[0].trace){var a,c=i[0],p=c.trace,d=c.t,m=p._length,g=d.r,y=d.theta,v=d.opts,x=g.slice(),_=y.slice();for(a=0;a<g.length;a++)t.isPtInside({r:g[a],theta:y[a]})||(x[a]=NaN,_[a]=NaN);var b=new Array(2*m),w=Array(m),T=Array(m);for(a=0;a<m;a++){var k,A,M=x[a];if(n(M)){var S=u.c2g(M),E=h.c2g(_[a],p.thetaunit);k=S*Math.cos(E),A=S*Math.sin(E)}else k=A=NaN;w[a]=b[2*a]=k,T[a]=b[2*a+1]=A}d.tree=r(b),v.marker&&m>=l&&(v.marker.cluster=d.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=b),v.line&&b.length>1&&s.extendFlat(v.line,o.linePositions(e,p,b)),v.text&&(s.extendFlat(v.text,{positions:b},o.textPosition(e,p,v.text,v.marker)),s.extendFlat(v.textSel,{positions:b},o.textPosition(e,p,v.text,v.markerSel)),s.extendFlat(v.textUnsel,{positions:b},o.textPosition(e,p,v.text,v.markerUnsel))),v.fill&&!f.fill2d&&(f.fill2d=!0),v.marker&&!f.scatter2d&&(f.scatter2d=!0),v.line&&!f.line2d&&(f.line2d=!0),v.text&&!f.glText&&(f.glText=!0),f.lineOptions.push(v.line),f.fillOptions.push(v.fill),f.markerOptions.push(v.marker),f.markerSelectedOptions.push(v.markerSel),f.markerUnselectedOptions.push(v.markerUnsel),f.textOptions.push(v.text),f.textSelectedOptions.push(v.textSel),f.textUnselectedOptions.push(v.textUnsel),f.selectBatch.push([]),f.unselectBatch.push([]),d.x=w,d.y=T,d.rawx=w,d.rawy=T,d.r=g,d.theta=y,d.positions=b,d._scene=f,d.index=f.count,f.count++}})),i(e,t,c)}},t.exports.reglPrecompiled={}}}),nk=m({"src/traces/scatterpolargl/index.js"(e,t){var r=tk();r.plot=rk(),t.exports=r}}),ik=m({"lib/scatterpolargl.js"(e,t){t.exports=nk()}}),ak=m({"src/traces/barpolar/attributes.js"(e,t){var r,{hovertemplateAttrs:n,templatefallbackAttrs:i}=Fe(),a=B().extendFlat,o=VT(),s=Wa();t.exports={r:o.r,theta:o.theta,r0:o.r0,dr:o.dr,theta0:o.theta0,dtheta:o.dtheta,thetaunit:o.thetaunit,base:a({},s.base,{}),offset:a({},s.offset,{}),width:a({},s.width,{}),text:a({},s.text,{}),hovertext:a({},s.hovertext,{}),marker:(r=a({},s.marker),delete r.cornerradius,r),hoverinfo:o.hoverinfo,hovertemplate:n(),hovertemplatefallback:i(),selected:s.selected,unselected:s.unselected}}}),ok=m({"src/traces/barpolar/layout_attributes.js"(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"}}}}),sk=m({"src/traces/barpolar/defaults.js"(e,t){var r=ct(),n=qT().handleRThetaDefaults,i=Ya(),a=ak();t.exports=function(e,t,o,s){function l(n,i){return r.coerce(e,t,a,n,i)}n(e,t,s,l)?(l("thetaunit"),l("base"),l("offset"),l("width"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),i(e,t,l,o,s),r.coerceSelectionMarkerOpacity(t,l)):t.visible=!1}}}),lk=m({"src/traces/barpolar/layout_defaults.js"(e,t){var r=ct(),n=ok();t.exports=function(e,t,i){var a,o={};function s(i,o){return r.coerce(e[a]||{},t[a],n,i,o)}for(var l=0;l<i.length;l++){var c=i[l];"barpolar"===c.type&&!0===c.visible&&(o[a=c.subplot]||(s("barmode"),s("bargap"),o[a]=1))}}}}),ck=m({"src/traces/barpolar/calc.js"(e,t){var r=Ct().hasColorscale,n=Zt(),i=ct().isArrayOrTypedArray,a=Ka(),o=ui().setGroupPositions,s=oi(),l=He().traceIs,c=ct().extendFlat;t.exports={calc:function(e,t){for(var o=e._fullLayout,l=t.subplot,c=o[l].radialaxis,u=o[l].angularaxis,h=c.makeCalcdata(t,"r"),f=u.makeCalcdata(t,"theta"),p=t._length,d=new Array(p),m=h,g=f,y=0;y<p;y++)d[y]={p:g[y],s:m[y]};function v(e){var r=t[e];void 0!==r&&(t["_"+e]=i(r)?u.makeCalcdata(t,e):u.d2c(r,t.thetaunit))}return"linear"===u.type&&(v("width"),v("offset")),r(t,"marker")&&n(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),r(t,"marker.line")&&n(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}),a(d,t),s(d,t),d},crossTraceCalc:function(e,t,r){for(var n=e.calcdata,i=[],a=0;a<n.length;a++){var s=n[a],u=s[0].trace;!0===u.visible&&l(u,"bar")&&u.subplot===r&&i.push(s)}var h=c({},t.radialaxis,{_id:"x"}),f=t.angularaxis;o(e,f,h,i,{mode:t.barmode,norm:t.barnorm,gap:t.bargap,groupgap:t.bargroupgap})}}}}),uk=m({"src/traces/barpolar/plot.js"(e,t){var r=b(),n=M(),i=ct(),a=er(),o=RT();t.exports=function(e,t,s){var l=e._context.staticPlot,c=t.xaxis,u=t.yaxis,h=t.radialAxis,f=t.angularAxis,p=function(e){var t=e.cxx,r=e.cyy;return e.vangles?function(n,a,s,l){var c,u;i.angleDelta(s,l)>0?(c=s,u=l):(c=l,u=s);var h=[o.findEnclosingVertexAngles(c,e.vangles)[0],(c+u)/2,o.findEnclosingVertexAngles(u,e.vangles)[1]];return o.pathPolygonAnnulus(n,a,c,u,h,t,r)}:function(e,n,a,o){return i.pathAnnulus(e,n,a,o,t,r)}}(t),d=t.layers.frontplot.select("g.barlayer");i.makeTraceGroups(d,s,"trace bars").each((function(){var o=r.select(this),s=i.ensureSingle(o,"g","points").selectAll("g.point").data(i.identity);s.enter().append("g").style("vector-effect",l?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(e){var t,a=r.select(this),o=e.rp0=h.c2p(e.s0),s=e.rp1=h.c2p(e.s1),l=e.thetag0=f.c2g(e.p0),d=e.thetag1=f.c2g(e.p1);if(n(o)&&n(s)&&n(l)&&n(d)&&o!==s&&l!==d){var m=h.c2g(e.s1),g=(l+d)/2;e.ct=[c.c2p(m*Math.cos(g)),u.c2p(m*Math.sin(g))],t=p(o,s,l,d)}else t="M0,0Z";i.ensureSingle(a,"path").attr("d",t)})),a.setClipUrl(o,t._hasClipOnAxisFalse?t.clipIds.forTraces:null,e)}))}}}),hk=m({"src/traces/barpolar/hover.js"(e,t){var r=Or(),n=ct(),i=no().getTraceColor,a=n.fillText,o=ZT().makeHoverPointText,s=RT().isPtInsidePolygon;t.exports=function(e,t,l){var c=e.cd,u=c[0].trace,h=e.subplot,f=h.radialAxis,p=h.angularAxis,d=h.vangles,m=d?s:n.isPtInsideSector,g=e.maxHoverDistance,y=p._period||2*Math.PI,v=Math.abs(f.g2p(Math.sqrt(t*t+l*l))),x=Math.atan2(l,t);if(f.range[0]>f.range[1]&&(x+=Math.PI),r.getClosest(c,(function(e){return m(v,x,[e.rp0,e.rp1],[e.thetag0,e.thetag1],d)?g+Math.min(1,Math.abs(e.thetag1-e.thetag0)/y)-1+(e.rp1-v)/(e.rp1-e.rp0)-1:1/0}),e),!1!==e.index){var _=c[e.index];e.x0=e.x1=_.ct[0],e.y0=e.y1=_.ct[1];var b=n.extendFlat({},_,{r:_.s,theta:_.p});return a(_,u,e),o(b,u,h,e),e.hovertemplate=u.hovertemplate,e.color=i(u,_),e.xLabelVal=e.yLabelVal=void 0,_.s<0&&(e.idealAlign="left"),[e]}}}}),fk=m({"src/traces/barpolar/index.js"(e,t){t.exports={moduleType:"trace",name:"barpolar",basePlotModule:UT(),categories:["polar","bar","showLegend"],attributes:ak(),layoutAttributes:ok(),supplyDefaults:sk(),supplyLayoutDefaults:lk(),calc:ck().calc,crossTraceCalc:ck().crossTraceCalc,plot:uk(),colorbar:mi(),formatLabels:HT(),style:to().style,styleOnSelect:to().styleOnSelect,hoverPoints:hk(),selectPoints:ao(),meta:{}}}}),pk=m({"lib/barpolar.js"(e,t){t.exports=fk()}}),dk=m({"src/plots/smith/constants.js"(e,t){t.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),mk=m({"src/plots/smith/layout_attributes.js"(e,t){var r=G(),n=Lt(),i=Ma().attributes,a=ct().extendFlat,o=De().overrideAll,s=o({color:n.color,showline:a({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:a({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash},"plot","from-root"),l=o({ticklen:n.ticklen,tickwidth:a({},n.tickwidth,{dflt:2}),tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,tickfont:n.tickfont,tickformat:n.tickformat,hoverformat:n.hoverformat,layer:n.layer},"plot","from-root"),c=a({visible:a({},n.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:a({},n.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},s,l),u=a({visible:a({},n.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:n.ticks,editType:"calc"},s,l);t.exports={domain:i({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:r.background},realaxis:c,imaginaryaxis:u,editType:"calc"}}}),gk=m({"src/plots/smith/layout_defaults.js"(e,t){var r,n,i,a=ct(),o=W(),s=vt(),l=Gs(),c=Tt().getSubplotData,u=Vt(),h=Ut(),f=ki(),p=rr(),d=mk(),m=dk(),g=m.axisNames,y=(r=function(e){return a.isTypedArray(e)&&(e=Array.from(e)),e.slice().reverse().map((function(e){return-e})).concat([0]).concat(e)},n=String,i={},function(e){var t=n?n(e):e;if(t in i)return i[t];var a=r(e);return i[t]=a,a});function v(e,t,r,n){var i=r("bgcolor");n.bgColor=o.combine(i,n.paper_bgcolor);var l,v=c(n.fullData,m.name,n.id),x=n.layoutOut;function _(e,t){return r(l+"."+e,t)}for(var b=0;b<g.length;b++){l=g[b],a.isPlainObject(e[l])||(e[l]={});var w=e[l],T=s.newContainer(t,l);T._id=T._name=l,T._attr=n.id+"."+l,T._traceIndices=v.map((function(e){return e.index}));var k=_("visible");if(T.type="linear",p(T,x),u(w,T,_,T.type),k){var A="realaxis"===l;A&&_("side"),A?_("tickvals"):_("tickvals",y(t.realaxis.tickvals||d.realaxis.tickvals.dflt)),a.isTypedArray(T.tickvals)&&(T.tickvals=Array.from(T.tickvals));var M,S,E,C,I=n.font||{};k&&(S=(M=_("color"))===w.color?M:I.color,E=I.size,C=I.family),h(w,T,_,T.type,{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noAng:!A,noExp:!0,font:{color:S,size:E,family:C}}),a.coerce2(e,t,d,l+".ticklen"),a.coerce2(e,t,d,l+".tickwidth"),a.coerce2(e,t,d,l+".tickcolor",t.color),_("ticks")||(delete t[l].ticklen,delete t[l].tickwidth,delete t[l].tickcolor),f(w,T,_,{dfltColor:M,bgColor:n.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:d[l]}),_("layer")}_("hoverformat"),delete T.type,T._input=w}}t.exports=function(e,t,r){l(e,t,r,{noUirevision:!0,type:m.name,attributes:d,handleDefaults:v,font:t.font,paper_bgcolor:t.paper_bgcolor,fullData:r,layoutOut:t})}}}),yk=m({"src/plots/smith/index.js"(e,t){var r=Tt().getSubplotCalcData,n=ct().counterRegex,i=BT(),a=dk(),o=a.attr,s=a.name,l=n(s),c={};c[o]={valType:"subplotid",dflt:s,editType:"calc"},t.exports={attr:o,name:s,idRoot:s,idRegex:l,attrRegex:l,attributes:c,layoutAttributes:mk(),supplyLayoutDefaults:gk(),plot:function(e){for(var t=e._fullLayout,n=e.calcdata,a=t._subplots[s],o=0;o<a.length;o++){var l=a[o],c=r(n,s,l),u=t[l]._subplot;u||(u=i(e,l,!0),t[l]._subplot=u),u.plot(c,t,e._promises)}},clean:function(e,t,r,n){for(var i=n._subplots[s]||[],a=0;a<i.length;a++){var o=i[a],l=n[o]._subplot;if(!t[o]&&l)for(var c in l.framework.remove(),l.clipPaths)l.clipPaths[c].remove()}},toSVG:Ci().toSVG}}}),vk=m({"src/traces/scattersmith/attributes.js"(e,t){var{hovertemplateAttrs:r,texttemplateAttrs:n,templatefallbackAttrs:i}=Fe(),a=B().extendFlat,o=Tn(),s=kn(),l=q(),c=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:n({editType:"plot"},{keys:["real","imag","text"]}),texttemplatefallback:i({editType:"plot"}),hovertext:s.hovertext,line:{color:c.color,width:c.width,dash:c.dash,backoff:c.backoff,shape:a({},c.shape,{values:["linear","spline"]}),smoothing:c.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({},l.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:s.hoveron,hovertemplate:r(),hovertemplatefallback:i(),selected:s.selected,unselected:s.unselected}}}),xk=m({"src/traces/scattersmith/defaults.js"(e,t){var r=ct(),n=Xt(),i=Yn(),a=Xn(),o=$n(),s=Kn(),l=Jn(),c=wn().PTS_LINESONLY,u=vk();t.exports=function(e,t,h,f){function p(n,i){return r.coerce(e,t,u,n,i)}var d=function(e,t,n,i){var a,o=i("real"),s=i("imag");return o&&s&&(a=Math.min(o.length,s.length)),r.isTypedArray(o)&&(t.real=o=Array.from(o)),r.isTypedArray(s)&&(t.imag=s=Array.from(s)),t._length=a,a}(0,t,0,p);if(d){p("mode",d<c?"lines+markers":"lines"),p("text"),p("hovertext"),"fills"!==t.hoveron&&(p("hovertemplate"),p("hovertemplatefallback")),n.hasMarkers(t)&&i(e,t,h,f,p,{gradient:!0}),n.hasLines(t)&&(a(e,t,h,f,p,{backoff:!0}),o(e,t,p),p("connectgaps")),n.hasText(t)&&(p("texttemplate"),p("texttemplatefallback"),s(e,t,f,p));var m=[];(n.hasMarkers(t)||n.hasText(t))&&(p("cliponaxis"),p("marker.maxdisplayed"),m.push("points")),p("fill"),"none"!==t.fill&&(l(e,t,h,p),n.hasLines(t)||o(e,t,p)),("tonext"===t.fill||"toself"===t.fill)&&m.push("fills"),p("hoveron",m.join("+")||"points"),r.coerceSelectionMarkerOpacity(t,p)}else t.visible=!1}}}),_k=m({"src/traces/scattersmith/format_labels.js"(e,t){var r=ar();t.exports=function(e,t,n){var i={},a=n[t.subplot]._subplot;return i.realLabel=r.tickText(a.radialAxis,e.real,!0).text,i.imagLabel=r.tickText(a.angularAxis,e.imag,!0).text,i}}}),bk=m({"src/traces/scattersmith/calc.js"(e,t){var r=M(),n=S().BADNUM,i=ii(),a=ai(),o=oi(),s=si().calcMarkerSize;t.exports=function(e,t){for(var l=e._fullLayout,c=t.subplot,u=l[c].realaxis,h=l[c].imaginaryaxis,f=u.makeCalcdata(t,"real"),p=h.makeCalcdata(t,"imag"),d=t._length,m=new Array(d),g=0;g<d;g++){var y=f[g],v=p[g],x=m[g]={};r(y)&&r(v)?(x.real=y,x.imag=v):x.real=n}return s(t,d),i(e,t),a(m,t),o(m,t),m}}}),wk=m({"src/traces/scattersmith/plot.js"(e,t){var r=di(),n=S().BADNUM,i=FT().smith;t.exports=function(e,t,a){for(var o=t.layers.frontplot.select("g.scatterlayer"),s=t.xaxis,l=t.yaxis,c={xaxis:s,yaxis:l,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},u=0;u<a.length;u++)for(var h=a[u],f=0;f<h.length;f++){0===f&&(h[0].trace._xA=s,h[0].trace._yA=l);var p=h[f],d=p.real;if(d===n)p.x=p.y=n;else{var m=i([d,p.imag]);p.x=m[0],p.y=m[1]}}r(e,c,a,o)}}}),Tk=m({"src/traces/scattersmith/hover.js"(e,t){var r=xi();function n(e,t,r,n){var i=r.radialAxis,a=r.angularAxis;i._hovertitle="real",a._hovertitle="imag";var o={};o[t.subplot]={_subplot:r};var s=t._module.formatLabels(e,t,o);n.realLabel=s.realLabel,n.imagLabel=s.imagLabel;var l=e.hi||t.hoverinfo,c=[];function u(e,t){c.push(e._hovertitle+": "+t)}if(!t.hovertemplate){var h=l.split("+");-1!==h.indexOf("all")&&(h=["real","imag","text"]),-1!==h.indexOf("real")&&u(i,n.realLabel),-1!==h.indexOf("imag")&&u(a,n.imagLabel),-1!==h.indexOf("text")&&n.text&&(c.push(n.text),delete n.text),n.extraText=c.join("<br>")}}t.exports={hoverPoints:function(e,t,i,a){var o=r(e,t,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),kk=m({"src/traces/scattersmith/index.js"(e,t){t.exports={moduleType:"trace",name:"scattersmith",basePlotModule:yk(),categories:["smith","symbols","showLegend","scatter-like"],attributes:vk(),supplyDefaults:xk(),colorbar:mi(),formatLabels:_k(),calc:bk(),plot:wk(),style:yi().style,styleOnSelect:yi().styleOnSelect,hoverPoints:Tk().hoverPoints,selectPoints:_i(),meta:{}}}}),Ak=m({"lib/scattersmith.js"(e,t){t.exports=kk()}}),Mk=m({"node_modules/world-calendars/dist/main.js"(e,t){var r=My();function n(){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={}}function i(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function o(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}r(n.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,i){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":e[a]+t[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),r(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(e??this,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,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(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?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)}}),r(o.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+a(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),i=e.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);i=e.day(),"y"===r?(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)))):"m"===r&&(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,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[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"]}[n],a=r<0?-1:1;t=this._add(e,r*i[0]+a*i[1],i[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),i="m"===r?t:e.month(),a="d"===r?t:e.day();return("y"===r||"m"===r)&&(a=Math.min(a,this.daysInMonth(n,i))),e.date(n,i,a)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var i=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth<this.monthsInYear(i)&&r>=this.minDay&&r-this.minDay<this.daysInMonth(i)}return this._validateLevel--,n},toJSDate:function(e,t,r){var n=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return l.instance().fromJD(this.toJD(n)).toJSDate()},fromJSDate:function(e){return this.fromJD(l.instance().fromJSDate(e).toJD())},_validate:function(e,t,r,n){if(e.year){if(0===this._validateLevel&&this.name!==e.calendar().name)throw(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,e.calendar().local.name);return e}try{if(this._validateLevel++,1===this._validateLevel&&!this.isValid(e,t,r))throw n.replace(/\{0\}/,this.local.name);var i=this.newDate(e,t,r);return this._validateLevel--,i}catch(e){throw this._validateLevel--,e}}}),s.prototype=new o,r(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,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==0&&(e%100!=0||e%400==0)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var n=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);e=n.year(),t=n.month(),r=n.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))+r+a-1524.5},fromJD:function(e){var t=Math.floor(e+.5),r=Math.floor((t-1867216.25)/36524.25),n=1524+(r=t+1+r-Math.floor(r/4)),i=Math.floor((n-122.1)/365.25),a=Math.floor(365.25*i),o=Math.floor((n-a)/30.6001),s=n-a-Math.floor(30.6001*o),l=o-(o>13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.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 l=t.exports=new n;l.cdate=i,l.baseCalendar=o,l.calendars.gregorian=s}}),Sk=m({"node_modules/world-calendars/dist/plus.js"(){var e=My(),t=Mk();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"string"!=typeof e&&(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:86400,TICKS_EPOCH:t.instance().jdEpoch,TICKS_PER_DAY:864e9,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,r,n){if("string"!=typeof e&&(n=r,r=e,e=""),!r)return"";if(r.calendar()!==this)throw t.local.invalidFormat||t.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var i=(n=n||{}).dayNamesShort||this.local.dayNamesShort,a=n.dayNames||this.local.dayNames,o=n.monthNumbers||this.local.monthNumbers,s=n.monthNamesShort||this.local.monthNamesShort,l=n.monthNames||this.local.monthNames,c=(n.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;v+n<e.length&&e.charAt(v+n)===t;)n++;return v+=n-1,Math.floor(n/(r||1))>1}),u=function(e,t,r,n){var i=""+t;if(c(e,n))for(;i.length<r;)i="0"+i;return i},h=this,f=function(e){return"function"==typeof o?o.call(h,e,c("m")):m(u("m",e.month(),2))},p=function(e,t){return t?"function"==typeof l?l.call(h,e):l[e.month()-h.minMonth]:"function"==typeof s?s.call(h,e):s[e.month()-h.minMonth]},d=this.local.digits,m=function(e){return n.localNumbers&&d?d(e):e},g="",y=!1,v=0;v<e.length;v++)if(y)"'"!==e.charAt(v)||c("'")?g+=e.charAt(v):y=!1;else switch(e.charAt(v)){case"d":g+=m(u("d",r.day(),2));break;case"D":g+=(x=r.dayOfWeek(),_=i,b=a,c("D")?b[x]:_[x]);break;case"o":g+=u("o",r.dayOfYear(),3);break;case"w":g+=u("w",r.weekOfYear(),2);break;case"m":g+=f(r);break;case"M":g+=p(r,c("M"));break;case"y":g+=c("y",2)?r.year():(r.year()%100<10?"0":"")+r.year()%100;break;case"Y":c("Y",2),g+=r.formatYear();break;case"J":g+=r.toJD();break;case"@":g+=(r.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":g+=(r.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":c("'")?g+="'":y=!0;break;default:g+=e.charAt(v)}var x,_,b;return g},parseDate:function(e,r,n){if(null==r)throw t.local.invalidArguments||t.regionalOptions[""].invalidArguments;if(""===(r="object"==typeof r?r.toString():r+""))return null;e=e||this.local.dateFormat;var i=(n=n||{}).shortYearCutoff||this.shortYearCutoff;i="string"!=typeof i?i:this.today().year()%100+parseInt(i,10);for(var a=n.dayNamesShort||this.local.dayNamesShort,o=n.dayNames||this.local.dayNames,s=n.parseMonth||this.local.parseMonth,l=n.monthNumbers||this.local.monthNumbers,c=n.monthNamesShort||this.local.monthNamesShort,u=n.monthNames||this.local.monthNames,h=-1,f=-1,p=-1,d=-1,m=-1,g=!1,y=!1,v=function(t,r){for(var n=1;M+n<e.length&&e.charAt(M+n)===t;)n++;return M+=n-1,Math.floor(n/(r||1))>1},x=function(e,n){var i=v(e,n),a=[2,3,i?4:2,i?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=r.substring(A).match(o);if(!s)throw(t.local.missingNumberAt||t.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},_=this,b=function(){if("function"==typeof l){v("m");var e=l.call(_,r.substring(A));return A+=e.length,e}return x("m")},w=function(e,n,i,a){for(var o=v(e,a)?i:n,s=0;s<o.length;s++)if(r.substr(A,o[s].length).toLowerCase()===o[s].toLowerCase())return A+=o[s].length,s+_.minMonth;throw(t.local.unknownNameAt||t.regionalOptions[""].unknownNameAt).replace(/\{0\}/,A)},T=function(){if("function"==typeof u){var e=v("M")?u.call(_,r.substring(A)):c.call(_,r.substring(A));return A+=e.length,e}return w("M",c,u)},k=function(){if(r.charAt(A)!==e.charAt(M))throw(t.local.unexpectedLiteralAt||t.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,A);A++},A=0,M=0;M<e.length;M++)if(y)"'"!==e.charAt(M)||v("'")?k():y=!1;else switch(e.charAt(M)){case"d":d=x("d");break;case"D":w("D",a,o);break;case"o":m=x("o");break;case"w":x("w");break;case"m":p=b();break;case"M":p=T();break;case"y":var S=M;g=!v("y",2),M=S,f=x("y",2);break;case"Y":f=x("Y",2);break;case"J":h=x("J")+.5,"."===r.charAt(A)&&(A++,x("J"));break;case"@":h=x("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":h=x("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":A=r.length;break;case"'":v("'")?k():y=!0;break;default:k()}if(A<r.length)throw t.local.unexpectedText||t.regionalOptions[""].unexpectedText;if(-1===f?f=this.today().year():f<100&&g&&(f+=-1===i?1900:this.today().year()-this.today().year()%100-(f<=i?0:100)),"string"==typeof p&&(p=s.call(this,f,p)),m>-1){p=1,d=m;for(var E=this.daysInMonth(f,p);d>E;E=this.daysInMonth(f,p))p++,d-=E}return h>-1?this.fromJD(h):this.newDate(f,p,d)},determineDate:function(e,t,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return t=t?t.newDate():null,null==e?t:"string"==typeof e?function(e){try{return a.parseDate(n,e,i)}catch{}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.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):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:a.today().add(e,"d"):a.newDate(e)}})}}),Ek=m({"node_modules/world-calendars/dist/calendars/chinese.js"(){var e=Mk(),t=My(),r=e.instance();function n(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}n.prototype=new e.baseCalendar,t(n.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("string"==typeof e){var r=e.match(a);return r?r[0]:""}var n=this._validateYear(e),i=e.month(),o=""+this.toChineseMonth(n,i);return t&&o.length<2&&(o="0"+o),this.isIntercalaryMonth(n,i)&&(o+="i"),o},monthNames:function(e){if("string"==typeof e){var t=e.match(o);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),i=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(s);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),i=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);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()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(t,r,n){var i=this.intercalaryMonth(t);if(n&&r!==i||r<1||r>12)throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!n&&r<=i?r-1:r:r-1},toChineseMonth:function(t,r){t.year&&(r=(t=t.year()).month());var n=this.intercalaryMonth(t);if(r<0||r>(n?12:11))throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?r<n?r+1:r:r+1},intercalaryMonth:function(e){return e=this._validateYear(e),l[e-l[0]]>>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(t,n,i){var a,o=this._validateYear(t,e.local.invalidyear),s=c[o-c[0]],l=s>>9&4095,u=s>>5&15,h=31&s;(a=r.newDate(l,u,h)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(t,n,i)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(t,r){t.year&&(r=t.month(),t=t.year()),t=this._validateYear(t);var n=l[t-l[0]];if(r>(n>>13?12:11))throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);return n&1<<12-r?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,n,i){var a=this._validate(t,s,i,e.local.invalidDate);t=this._validateYear(a.year()),n=a.month(),i=a.day();var o=this.isIntercalaryMonth(t,n),s=this.toChineseMonth(t,n),u=function(e,t,r,n){var i,a,o;if("object"==typeof e)a=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i={}),a={year:e,month:t,day:r,isIntercalary:s}}o=a.day-1;var u,h=l[a.year-l[0]],f=h>>13;u=f&&(a.month>f||a.isIntercalary)?a.month:a.month-1;for(var p=0;p<u;p++)o+=h&1<<12-p?30:29;var d=c[a.year-c[0]],m=new Date(d>>9&4095,(d>>5&15)-1,(31&d)+o);return i.year=m.getFullYear(),i.month=1+m.getMonth(),i.day=m.getDate(),i}(t,s,i,o);return r.toJD(u.year,u.month,u.day)},fromJD:function(e){var t=r.fromJD(e),n=function(e,t,r){var n,i;if("object"==typeof e)n=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");n={year:e,month:t,day:r},i={}}var a=c[n.year-c[0]],o=n.year<<9|n.month<<5|n.day;i.year=o>=a?n.year:n.year-1,a=c[i.year-c[0]];var s,u=new Date(a>>9&4095,(a>>5&15)-1,31&a),h=new Date(n.year,n.month-1,n.day);s=Math.round((h-u)/864e5);var f,p=l[i.year-l[0]];for(f=0;f<13;f++){var d=p&1<<12-f?30:29;if(s<d)break;s-=d}var m=p>>13;return!m||f<m?(i.isIntercalary=!1,i.month=1+f):f===m?(i.isIntercalary=!0,i.month=f):(i.isIntercalary=!1,i.month=f),i.day=1+s,i}(t.year(),t.month(),t.day()),i=this.toMonthIndex(n.year,n.month,n.isIntercalary);return this.newDate(n.year,i,n.day)},fromString:function(e){var t=e.match(i),r=this._validateYear(+t[1]),n=+t[2],a=!!t[3],o=this.toMonthIndex(r,n,a),s=+t[4];return this.newDate(r,o,s)},add:function(e,t,r){var i=e.year(),a=e.month(),o=this.isIntercalaryMonth(i,a),s=this.toChineseMonth(i,a),l=Object.getPrototypeOf(n.prototype).add.call(this,e,t,r);if("y"===r){var c=l.year(),u=l.month(),h=this.isIntercalaryMonth(c,s),f=o&&h?this.toMonthIndex(c,s,!0):this.toMonthIndex(c,s,!1);f!==u&&l.month(f)}return l}});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=n;var l=[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],c=[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]}}),Ck=m({"node_modules/world-calendars/dist/calendars/coptic.js"(){var e=Mk(),t=My();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.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 r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return(t=r.year()+(r.year()<0?1:0))%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,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,i=t-30*(n-1)+1;return this.newDate(r,n,i)}}),e.calendars.coptic=r}}),Ik=m({"node_modules/world-calendars/dist/calendars/discworld.js"(){var e=Mk(),t=My();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.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,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,r,n){return(this._validate(t,r,n,e.local.invalidDate).day()+1)%8},weekDay:function(e,t,r){var n=this.dayOfWeek(e,t,r);return n>=2&&n<=6},extraInfo:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidDate);return{century:n[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return t=i.year()+(i.year()<0?1:0),r=i.month(),(n=i.day())+(r>1?16:0)+(r>2?32*(r-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var n={20:"Fruitbat",21:"Anchovy"};e.calendars.discworld=r}}),Lk=m({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var e=Mk(),t=My();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.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 r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return(t=r.year()+(r.year()<0?1:0))%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,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,i=t-30*(n-1)+1;return this.newDate(r,n,i)}}),e.calendars.ethiopian=r}}),Pk=m({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var e=Mk(),t=My();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function n(e,t){return e-t*Math.floor(e/t)}r.prototype=new e.baseCalendar,t(r.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 r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return this._leapYear(r.year())},_leapYear:function(e){return n(7*(e=e<0?e+1:e)+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,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,r){return t.year&&(r=t.month(),t=t.year()),this._validate(t,r,this.minDay,e.local.invalidMonth),12===r&&this.leapYear(t)||8===r&&5===n(this.daysInYear(t),10)?30:9===r&&3===n(this.daysInYear(t),10)?29:this.daysPerMonth[r-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);t=i.year(),r=i.month(),n=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+n+1;if(r<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s<r;s++)o+=this.daysInMonth(t,s)}else for(s=7;s<r;s++)o+=this.daysInMonth(t,s);return o},_delay1:function(e){var t=Math.floor((235*e-234)/19),r=12084+13753*t,i=29*t+Math.floor(r/25920);return n(3*(i+1),7)<3&&i++,i},_delay2:function(e){var t=this._delay1(e-1),r=this._delay1(e);return this._delay1(e+1)-r==356?2:r-t==382?1:0},fromJD:function(e){e=Math.floor(e)+.5;for(var t=Math.floor(98496*(e-this.jdEpoch)/35975351)-1;e>=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=e<this.toJD(t,1,1)?7:1;e>this.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),e.calendars.hebrew=r}}),zk=m({"node_modules/world-calendars/dist/calendars/islamic.js"(){var e=Mk(),t=My();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.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(11*this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return t=i.year(),r=i.month(),t=t<=0?t+1:t,(n=i.day())+Math.ceil(29.5*(r-1))+354*(t-1)+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 r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),e.calendars.islamic=r}}),Dk=m({"node_modules/world-calendars/dist/calendars/julian.js"(){var e=Mk(),t=My();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.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 r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return(t=r.year()<0?r.year()+1:r.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return t=i.year(),r=i.month(),n=i.day(),t<0&&t++,r<=2&&(t--,r+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(r+1))+n-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((t-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=t-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),e.calendars.julian=r}}),Ok=m({"node_modules/world-calendars/dist/calendars/mayan.js"(){var e=Mk(),t=My();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function n(e,t){return e-t*Math.floor(e/t)}function i(e,t){return n(e-1,t)+1}r.prototype=new e.baseCalendar,t(r.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 r=Math.floor(t/400);return t%=400,t+=t<0?400:0,r+"."+Math.floor(t/20)+"."+t%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r<e.length;r++){var n=parseInt(e[r],10);if(Math.abs(n)>19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),18},weekOfYear:function(t,r,n){return this._validate(t,r,n,e.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),360},daysInMonth:function(t,r){return this._validate(t,r,this.minDay,e.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,r,n){return this._validate(t,r,n,e.local.invalidDate).day()},weekDay:function(t,r,n){return this._validate(t,r,n,e.local.invalidDate),!0},extraInfo:function(t,r,n){var i=this._validate(t,r,n,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){var t=n(8+(e-=this.jdEpoch)+340,365);return[Math.floor(t/20)+1,n(t,20)]},_toTzolkin:function(e){return[i(20+(e-=this.jdEpoch),20),i(e+4,13)]},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return i.day()+20*i.month()+360*i.year()+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 r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),e.calendars.mayan=r}}),Rk=m({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var e=Mk(),t=My();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar;var n=e.instance("gregorian");t(r.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 r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear);return n.leapYear(r.year()+(r.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidMonth);(t=a.year())<0&&t++;for(var o=a.day(),s=1;s<a.month();s++)o+=this.daysPerMonth[s-1];return o+n.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 r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),e.calendars.nanakshahi=r}}),Fk=m({"node_modules/world-calendars/dist/calendars/nepali.js"(){var e=Mk(),t=My();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.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,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year(),typeof this.NEPALI_CALENDAR_DATA[t]>"u")return this.daysPerYear;for(var r=0,n=this.minMonth;n<=12;n++)r+=this.NEPALI_CALENDAR_DATA[t][n];return r},daysInMonth:function(t,r){return t.year&&(r=t.month(),t=t.year()),this._validate(t,r,this.minDay,e.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[t]>"u"?this.daysPerMonth[r-1]:this.NEPALI_CALENDAR_DATA[t][r]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);t=i.year(),r=i.month(),n=i.day();var a=e.instance(),o=0,s=r,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&n>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==r&&(o=n,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===r?(o+=n-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var r=e.instance().fromJD(t),n=r.year(),i=r.dayOfYear(),a=n+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r<e+2;r++)typeof this.NEPALI_CALENDAR_DATA[r]>"u"&&(this.NEPALI_CALENDAR_DATA[r]=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=r}}),Bk=m({"node_modules/world-calendars/dist/calendars/persian.js"(){var e=Mk(),t=My();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function n(e){var t=e-475;e<0&&t++;var r=.242197,n=r*t,i=r*(t+1);return n-Math.floor(n)>i-Math.floor(i)}r.prototype=new e.baseCalendar,t(r.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 n(this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidDate);t=a.year(),r=a.month(),i=a.day();var o=0;if(t>0)for(var s=1;s<t;s++)n(s)&&o++;else if(t<0)for(s=t;s<0;s++)n(s)&&o--;return i+(r<=7?31*(r-1):30*(r-1)+6)+365*(t>0?t-1:t)+o+this.jdEpoch-1},fromJD:function(e){var t=475+((e=Math.floor(e)+.5)-this.toJD(475,1,1))/365.242197,r=Math.floor(t);r<=0&&r--,e>this.toJD(r,12,n(r)?30:29)&&0==++r&&r++;var i=e-this.toJD(r,1,1)+1,a=i<=186?Math.ceil(i/31):Math.ceil((i-6)/30),o=e-this.toJD(r,a,1)+1;return this.newDate(r,a,o)}}),e.calendars.persian=r,e.calendars.jalali=r}}),jk=m({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var e=Mk(),t=My(),r=e.instance();function n(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}n.prototype=new e.baseCalendar,t(n.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 n=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return t=this._t2gYear(n.year()),r.leapYear(t)},weekOfYear:function(t,n,i){var a=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return t=this._t2gYear(a.year()),r.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,n,i){var a=this._validate(t,n,i,e.local.invalidDate);return t=this._t2gYear(a.year()),r.toJD(t,a.month(),a.day())},fromJD:function(e){var t=r.fromJD(e),n=this._g2tYear(t.year());return this.newDate(n,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=n}}),Nk=m({"node_modules/world-calendars/dist/calendars/thai.js"(){var e=Mk(),t=My(),r=e.instance();function n(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}n.prototype=new e.baseCalendar,t(n.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 n=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return t=this._t2gYear(n.year()),r.leapYear(t)},weekOfYear:function(t,n,i){var a=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return t=this._t2gYear(a.year()),r.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,n,i){var a=this._validate(t,n,i,e.local.invalidDate);return t=this._t2gYear(a.year()),r.toJD(t,a.month(),a.day())},fromJD:function(e){var t=r.fromJD(e),n=this._g2tYear(t.year());return this.newDate(n,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=n}}),Uk=m({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var e=Mk(),t=My();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return 355===this.daysInYear(r.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(t,r){for(var i=this._validate(t,r,this.minDay,e.local.invalidMonth).toJD()-24e5+.5,a=0,o=0;o<n.length;o++){if(n[o]>i)return n[a]-n[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidDate),o=12*(a.year()-1)+a.month()-15292;return a.day()+n[o-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,i=0;i<n.length&&!(n[i]>t);i++)r++;var a=r+15292,o=Math.floor((a-1)/12),s=o+1,l=a-12*o,c=t-n[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,r,n){var i=e.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,r,n,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=r;var n=[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]}}),Vk=m({"src/components/calendars/calendars.js"(e,t){t.exports=Mk(),Sk(),Ek(),Ck(),Ik(),Lk(),Pk(),zk(),Dk(),Ok(),Rk(),Fk(),Bk(),jk(),Nk(),Uk()}}),qk=m({"src/components/calendars/index.js"(e,t){var r=Vk(),n=ct(),i=S(),a=i.EPOCHJD,o=i.ONEDAY,s={valType:"enumerated",values:n.sortObjectKeys(r.calendars),editType:"calc",dflt:"gregorian"},l=function(e,t,r,i){var a={};return a[r]=s,n.coerce(e,t,a,r,i)},c="##",u={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:c,w:c,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},h={};function f(e){var t=h[e];return t||(h[e]=r.instance(e))}function p(e){return n.extendFlat({},s,{description:e})}function d(e){return"Sets the calendar system to use with `"+e+"` date data."}var m={xcalendar:p(d("x"))},g=n.extendFlat({},m,{ycalendar:p(d("y"))}),y=n.extendFlat({},g,{zcalendar:p(d("z"))}),v=p(["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:g,bar:g,box:g,heatmap:g,contour:g,histogram:g,histogram2d:g,histogram2dcontour:g,scatter3d:y,surface:y,mesh3d:y,scattergl:g,ohlc:m,candlestick:m},layout:{calendar:p(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:v},yaxis:{calendar:v},scene:{xaxis:{calendar:v},yaxis:{calendar:v},zaxis:{calendar:v}},polar:{radialaxis:{calendar:v}}}},layoutAttributes:s,handleDefaults:l,handleTraceDefaults:function(e,t,r,n){for(var i=0;i<r.length;i++)l(e,t,r[i]+"calendar",n.calendar)},CANONICAL_SUNDAY:{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"},CANONICAL_TICK:{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"},DFLTRANGE:{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"]},getCal:f,worldCalFmt:function(e,t,r){for(var n,i,s,l,h,p=Math.floor((t+.05)/o)+a,d=f(r).fromJD(p),m=0;-1!==(m=e.indexOf("%",m));)"0"===(n=e.charAt(m+1))||"-"===n||"_"===n?(s=3,i=e.charAt(m+2),"_"===n&&(n="-")):(i=n,n="0",s=2),(l=u[i])?(h=l===c?c:d.formatDate(l[n]),e=e.slice(0,m)+h+e.slice(m+s),m+=h.length):m+=s;return e}}}}),Hk=m({"lib/calendars.js"(e,t){t.exports=qk()}});return m({"lib/index.js"(e,t){var r=Ga();r.register([so(),bo(),Wo(),ts(),ss(),Ls(),Os(),Xs(),sl(),wl(),Rl(),Xu(),oh(),ld(),Ad(),Fd(),Zd(),km(),Im(),jm(),Hm(),Xm(),tg(),og(),Fg(),Zg(),Ix(),Yx(),__(),E_(),Z_(),Q_(),lb(),Cb(),Ob(),Hb(),hw(),xw(),Cw(),tT(),hT(),vT(),ET(),zT(),XT(),ik(),pk(),Ak(),Hk()]),t.exports=r}})()})();return window.Plotly=e,e},"object"==typeof t&&t.exports?t.exports=n():r.moduleName=n()})),b=y(v()),w=y(x());(n||(n={})).copyText=function(e){let t=document.body,r=n=>{n.preventDefault(),n.stopPropagation(),n.clipboardData.setData("text",e),t.removeEventListener("copy",r,!0)};t.addEventListener("copy",r,!0),document.execCommand("copy")},(l=i||(i={})).boxSizing=function(e){let t=window.getComputedStyle(e),r=parseFloat(t.borderTopWidth)||0,n=parseFloat(t.borderLeftWidth)||0,i=parseFloat(t.borderRightWidth)||0,a=parseFloat(t.borderBottomWidth)||0,o=parseFloat(t.paddingTop)||0,s=parseFloat(t.paddingLeft)||0,l=parseFloat(t.paddingRight)||0,c=parseFloat(t.paddingBottom)||0;return{borderTop:r,borderLeft:n,borderRight:i,borderBottom:a,paddingTop:o,paddingLeft:s,paddingRight:l,paddingBottom:c,horizontalSum:n+s+l+i,verticalSum:r+o+c+a}},l.sizeLimits=function(e){let t=window.getComputedStyle(e),r=parseFloat(t.minWidth)||0,n=parseFloat(t.minHeight)||0,i=parseFloat(t.maxWidth)||1/0,a=parseFloat(t.maxHeight)||1/0;return i=Math.max(r,i),a=Math.max(n,a),{minWidth:r,minHeight:n,maxWidth:i,maxHeight:a}},l.hitTest=function(e,t,r){let n=e.getBoundingClientRect();return t>=n.left&&t<n.right&&r>=n.top&&r<n.bottom},l.scrollIntoViewIfNeeded=function(e,t){let r=e.getBoundingClientRect(),n=t.getBoundingClientRect();if(!(n.top<=r.top&&n.bottom>=r.bottom)){if(n.top<r.top&&n.height<=r.height)return void(e.scrollTop-=r.top-n.top);if(n.bottom>r.bottom&&n.height>=r.height)return void(e.scrollTop-=r.top-n.top);if(n.top<r.top&&n.height>r.height)return void(e.scrollTop-=r.bottom-n.bottom);if(n.bottom>r.bottom&&n.height<r.height)return void(e.scrollTop-=r.bottom-n.bottom)}},function(e){e.IS_MAC=!!navigator.platform.match(/Mac/i),e.IS_WIN=!!navigator.platform.match(/Win/i),e.IS_IE=/Trident/.test(navigator.userAgent),e.IS_EDGE=/Edge/.test(navigator.userAgent),e.accelKey=function(t){return e.IS_MAC?t.metaKey:t.ctrlKey}}(a||(a={})),function(e){e.calculateSpecificity=function(e){if(e in s.specificityCache)return s.specificityCache[e];let t=s.calculateSingle(e);return s.specificityCache[e]=t},e.isValid=function(e){if(e in s.validityCache)return s.validityCache[e];let t=!0;try{s.testElem.querySelector(e)}catch{t=!1}return s.validityCache[e]=t},e.matches=function(e,t){return s.protoMatchFunc.call(e,t)}}(o||(o={})),function(e){e.specificityCache=Object.create(null),e.validityCache=Object.create(null),e.testElem=document.createElement("div"),e.protoMatchFunc=(()=>{let e=Element.prototype;return e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(e){let t=this,r=t.ownerDocument?t.ownerDocument.querySelectorAll(e):[];return-1!==Array.prototype.indexOf.call(r,t)}})(),e.calculateSingle=function(e){let c=0,u=0,h=0;function f(t){let r=e.match(t);return null!==r&&(e=e.slice(r[0].length),!0)}for(e=(e=e.split(",",1)[0]).replace(l," $1 ");e.length>0;)if(f(t))c++;else if(f(r))u++;else if(f(n))u++;else if(f(a))h++;else if(f(o))u++;else if(f(i))h++;else if(!f(s))return 0;return c=Math.min(c,255),u=Math.min(u,255),h=Math.min(h,255),c<<16|u<<8|h};let t=/^#[^\s\+>~#\.\[:]+/,r=/^\.[^\s\+>~#\.\[:]+/,n=/^\[[^\]]+\]/,i=/^[^\s\+>~#\.\[:]+/,a=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,o=/^:[^\s\+>~#\.\[:]+/,s=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g}(s||(s={}));var T,k=y(v()),A=class{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return 0===this._size}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let e=this._first;for(;e;)yield e.value,e=e.next}*retro(){let e=this._last;for(;e;)yield e.value,e=e.prev}*nodes(){let e=this._first;for(;e;)yield e,e=e.next}*retroNodes(){let e=this._last;for(;e;)yield e,e=e.prev}assign(e){this.clear();for(let t of e)this.addLast(t)}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){let t=new T.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t}addLast(e){let t=new T.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._first=t,this._last=t),this._size++,t}insertBefore(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof T.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let r=new T.LinkedListNode(this,e),n=t,i=n.prev;return r.next=n,r.prev=i,n.prev=r,i.next=r,this._size++,r}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof T.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let r=new T.LinkedListNode(this,e),n=t,i=n.next;return r.next=i,r.prev=n,n.next=r,i.prev=r,this._size++,r}removeFirst(){let e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeLast(){let e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeNode(e){if(!(e instanceof T.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");let t=e;t===this._first&&t===this._last?(this._first=null,this._last=null):t===this._first?(this._first=t.next,this._first.prev=null):t===this._last?(this._last=t.prev,this._last.next=null):(t.next.prev=t.prev,t.prev.next=t.next),t.list=null,t.next=null,t.prev=null,this._size--}clear(){let e=this._first;for(;e;){let t=e.next;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0}};!function(e){e.from=function(t){let r=new e;return r.assign(t),r}}(A||(A={})),function(e){e.LinkedListNode=class{constructor(e,t){this.list=null,this.next=null,this.prev=null,this.list=e,this.value=t}}}(T||(T={}));var M,S=class{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}},E=class extends S{get isConflatable(){return!0}conflate(e){return!0}};!function(e){let t=null,r=(n=Promise.resolve(),e=>{let t=!1;return n.then((()=>!t&&e())),()=>{t=!0}});var n;function i(e,t){let r=o.get(e);r&&0!==r.length?(0,k.every)((0,k.retro)(r),(r=>!r||function(e,t,r){let n=!0;try{n="function"==typeof e?e(t,r):e.messageHook(t,r)}catch(e){l(e)}return n}(r,e,t)))&&u(e,t):u(e,t)}e.sendMessage=i,e.postMessage=function(e,n){n.isConflatable&&(0,k.some)(a,(t=>!(t.handler!==e||!t.msg||t.msg.type!==n.type||!t.msg.isConflatable)&&t.msg.conflate(n)))||function(e,n){a.addLast({handler:e,msg:n}),null===t&&(t=r(h))}(e,n)},e.installMessageHook=function(e,t){let r=o.get(e);r&&-1!==r.indexOf(t)||(r?r.push(t):o.set(e,[t]))},e.removeMessageHook=function(e,t){let r=o.get(e);if(!r)return;let n=r.indexOf(t);-1!==n&&(r[n]=null,f(r))},e.clearData=function(e){let t=o.get(e);t&&t.length>0&&(k.ArrayExt.fill(t,null),f(t));for(let t of a)t.handler===e&&(t.handler=null,t.msg=null)},e.flush=function(){c||null===t||(t(),t=null,c=!0,h(),c=!1)},e.getExceptionHandler=function(){return l},e.setExceptionHandler=function(e){let t=l;return l=e,t};let a=new A,o=new WeakMap,s=new Set,l=e=>{console.error(e)},c=!1;function u(e,t){try{e.processMessage(t)}catch(e){l(e)}}function h(){if(t=null,a.isEmpty)return;let e={handler:null,msg:null};for(a.addLast(e);;){let t=a.removeFirst();if(t===e)return;t.handler&&t.msg&&i(t.handler,t.msg)}}function f(e){0===s.size&&r(p),s.add(e)}function p(){s.forEach(d),s.clear()}function d(e){k.ArrayExt.removeAllWhere(e,m)}function m(e){return null===e}}(M||(M={}));var C,I=class{constructor(e){this._pid=C.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}get(e){let t,r=C.ensureMap(e);return t=this._pid in r?r[this._pid]:r[this._pid]=this._createValue(e),t}set(e,t){let r,n=C.ensureMap(e);r=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e);let i=this._coerceValue(e,t);this._maybeNotify(e,r,n[this._pid]=i)}coerce(e){let t,r=C.ensureMap(e);t=this._pid in r?r[this._pid]:r[this._pid]=this._createValue(e);let n=this._coerceValue(e,t);this._maybeNotify(e,t,r[this._pid]=n)}_createValue(e){return(0,this._create)(e)}_coerceValue(e,t){let r=this._coerce;return r?r(e,t):t}_compareValue(e,t){let r=this._compare;return r?r(e,t):e===t}_maybeNotify(e,t,r){let n=this._changed;n&&!this._compareValue(t,r)&&n(e,t,r)}};!function(e){e.clearData=function(e){C.ownerData.delete(e)}}(I||(I={})),function(e){e.ownerData=new WeakMap,e.nextPID=(()=>{let e=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${e++}`})(),e.ensureMap=function(t){let r=e.ownerData.get(t);return r||(r=Object.create(null),e.ownerData.set(t,r),r)}}(C||(C={}));var L,P=y(v()),z=(y(x()),class{constructor(e){this.sender=e}connect(e,t){return L.connect(this,e,t)}disconnect(e,t){return L.disconnect(this,e,t)}emit(e){L.emit(this,e)}});!function(e){e.disconnectBetween=function(e,t){L.disconnectBetween(e,t)},e.disconnectSender=function(e){L.disconnectSender(e)},e.disconnectReceiver=function(e){L.disconnectReceiver(e)},e.disconnectAll=function(e){L.disconnectAll(e)},e.clearData=function(e){L.disconnectAll(e)},e.getExceptionHandler=function(){return L.exceptionHandler},e.setExceptionHandler=function(e){let t=L.exceptionHandler;return L.exceptionHandler=e,t}}(z||(z={})),function(e){function t(e){let t=n.get(e);if(t&&0!==t.length){for(let e of t){if(!e.signal)continue;let t=e.thisArg||e.slot;e.signal=null,c(i.get(t))}c(t)}}function r(e){let t=i.get(e);if(t&&0!==t.length){for(let e of t){if(!e.signal)continue;let t=e.signal.sender;e.signal=null,c(n.get(t))}c(t)}}e.exceptionHandler=e=>{console.error(e)},e.connect=function(e,t,r){r=r||void 0;let a=n.get(e.sender);if(a||(a=[],n.set(e.sender,a)),s(a,e,t,r))return!1;let o=r||t,l=i.get(o);l||(l=[],i.set(o,l));let c={signal:e,slot:t,thisArg:r};return a.push(c),l.push(c),!0},e.disconnect=function(e,t,r){r=r||void 0;let a=n.get(e.sender);if(!a||0===a.length)return!1;let o=s(a,e,t,r);if(!o)return!1;let l=r||t,u=i.get(l);return o.signal=null,c(a),c(u),!0},e.disconnectBetween=function(e,t){let r=n.get(e);if(!r||0===r.length)return;let a=i.get(t);if(a&&0!==a.length){for(let t of a)t.signal&&t.signal.sender===e&&(t.signal=null);c(r),c(a)}},e.disconnectSender=t,e.disconnectReceiver=r,e.disconnectAll=function(e){t(e),r(e)},e.emit=function(e,t){let r=n.get(e.sender);if(r&&0!==r.length)for(let n=0,i=r.length;n<i;++n){let i=r[n];i.signal===e&&l(i,t)}};let n=new WeakMap,i=new WeakMap,a=new Set,o="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;function s(e,t,r,n){return(0,P.find)(e,(e=>e.signal===t&&e.slot===r&&e.thisArg===n))}function l(t,r){let{signal:n,slot:i,thisArg:a}=t;try{i.call(a,n.sender,r)}catch(t){e.exceptionHandler(t)}}function c(e){0===a.size&&o(u),a.add(e)}function u(){a.forEach(h),a.clear()}function h(e){P.ArrayExt.removeAllWhere(e,f)}function f(e){return null===e.signal}}(L||(L={}));var D=class{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}},O=class{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach((e=>{e.dispose()})),this._items.clear())}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}};!function(e){e.from=function(t){let r=new e;for(let e of t)r.add(e);return r}}(O||(O={}));var R=class extends O{constructor(){super(...arguments),this._disposed=new z(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),z.clearData(this))}};!function(e){e.from=function(t){let r=new e;for(let e of t)r.add(e);return r}}(R||(R={}));var F,B=class e{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:e,edge:t,distance:r}=this._scrollTarget,n=F.SCROLL_EDGE_SIZE-r,i=Math.pow(n/F.SCROLL_EDGE_SIZE,2),a=Math.max(1,Math.round(i*F.SCROLL_EDGE_SIZE));switch(t){case"top":e.scrollTop-=a;break;case"left":e.scrollLeft-=a;break;case"right":e.scrollLeft+=a;break;case"bottom":e.scrollTop+=a}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let e=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});F.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}}get isDisposed(){return this._disposed}start(e,t){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise((e=>{this._resolve=e}));let r=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:e,clientY:t});return document.dispatchEvent(r),this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation()}}moveDragImage(e,t){this.dragImage&&(this.dragImage.style.transform=`translate(${e}px, ${t}px)`)}_evtPointerMove(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){if(e.preventDefault(),e.stopPropagation(),0!==e.button)return;if(this._updateCurrentTarget(e),!this._currentTarget)return void this._finalize("none");if("none"===this._dropAction)return F.dispatchDragLeave(this,this._currentTarget,null,e),void this._finalize("none");let t=F.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(e){let t=F.findScrollTarget(e);!this._scrollTarget&&!t||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)}_updateCurrentTarget(e){let t=this._currentTarget,r=this._currentTarget,n=this._currentElement,i=F.findElementBehindBackdrop(e,this.document);this._currentElement=i,i!==n&&i!==r&&F.dispatchDragExit(this,r,i,e),i!==n&&i!==r&&(r=F.dispatchDragEnter(this,i,r,e)),r!==t&&(this._currentTarget=r,F.dispatchDragLeave(this,t,r,e));let a=F.dispatchDragOver(this,r,e);this._setDropAction(a)}_attachDragImage(e,t){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let r=this.dragImage.style;r.pointerEvents="none",r.position="fixed",r.transform=`translate(${e}px, ${t}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}_setDropAction(t){if(t=F.validateAction(t,this.supportedActions),!this._override||this._dropAction!==t)switch(t){case"none":this._dropAction=t,this._override=e.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=t,this._override=e.overrideCursor("copy",this.document);break;case"link":this._dropAction=t,this._override=e.overrideCursor("alias",this.document);break;case"move":this._dropAction=t,this._override=e.overrideCursor("move",this.document)}}_finalize(e){let t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)}};!function(e){class t extends DragEvent{constructor(e,t){super(t.type,{bubbles:!0,cancelable:!0,altKey:e.altKey,button:e.button,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,detail:0,metaKey:e.metaKey,relatedTarget:t.related,screenX:e.screenX,screenY:e.screenY,shiftKey:e.shiftKey,view:window});let{drag:r}=t;this.dropAction="none",this.mimeData=r.mimeData,this.proposedAction=r.proposedAction,this.supportedActions=r.supportedActions,this.source=r.source}}e.Event=t,e.overrideCursor=function(e,t=document){return F.overrideCursor(e,t)}}(B||(B={})),function(e){function t(t,i=document){if(t){if(r&&t==r.event)return r.element;e.cursorBackdrop.style.zIndex="-1000";let n=i.elementFromPoint(t.clientX,t.clientY);return e.cursorBackdrop.style.zIndex="",r={event:t,element:n},n}{let t=e.cursorBackdrop.style.transform;if(n&&t===n.transform)return n.element;let r=e.cursorBackdrop.getBoundingClientRect();e.cursorBackdrop.style.zIndex="-1000";let a=i.elementFromPoint(r.left+r.width/2,r.top+r.height/2);return e.cursorBackdrop.style.zIndex="",n={transform:t,element:a},a}}e.SCROLL_EDGE_SIZE=20,e.validateAction=function(e,t){return i[e]&a[t]?e:"none"},e.findElementBehindBackdrop=t;let r=null,n=null;e.findScrollTarget=function(r){let n=r.clientX,i=r.clientY,a=t(r);for(;a;a=a.parentElement){if(!a.hasAttribute("data-lm-dragscroll"))continue;let t=0,r=0;a===document.body&&(t=window.pageXOffset,r=window.pageYOffset);let o=a.getBoundingClientRect(),s=o.top+r,l=o.left+t,c=l+o.width,u=s+o.height;if(n<l||n>=c||i<s||i>=u)continue;let h,f=n-l+1,p=i-s+1,d=c-n,m=u-i,g=Math.min(f,p,d,m);if(g>e.SCROLL_EDGE_SIZE)continue;switch(g){case m:h="bottom";break;case p:h="top";break;case d:h="right";break;case f:h="left";break;default:throw"unreachable"}let y,v=a.scrollWidth-a.clientWidth,x=a.scrollHeight-a.clientHeight;switch(h){case"top":y=x>0&&a.scrollTop>0;break;case"left":y=v>0&&a.scrollLeft>0;break;case"right":y=v>0&&a.scrollLeft<v;break;case"bottom":y=x>0&&a.scrollTop<x;break;default:throw"unreachable"}if(y)return{element:a,edge:h,distance:g}}return null},e.dispatchDragEnter=function(e,t,r,n){if(!t)return null;let i=new B.Event(n,{drag:e,related:r,type:"lm-dragenter"});if(!t.dispatchEvent(i))return t;let a=e.document instanceof Document?e.document.body:e.document.firstElementChild;return t===a?r:(i=new B.Event(n,{drag:e,related:r,type:"lm-dragenter"}),a.dispatchEvent(i),a)},e.dispatchDragExit=function(e,t,r,n){if(!t)return;let i=new B.Event(n,{drag:e,related:r,type:"lm-dragexit"});t.dispatchEvent(i)},e.dispatchDragLeave=function(e,t,r,n){if(!t)return;let i=new B.Event(n,{drag:e,related:r,type:"lm-dragleave"});t.dispatchEvent(i)},e.dispatchDragOver=function(e,t,r){if(!t)return"none";let n=new B.Event(r,{drag:e,related:null,type:"lm-dragover"});return t.dispatchEvent(n)?"none":n.dropAction},e.dispatchDrop=function(e,t,r){if(!t)return"none";let n=new B.Event(r,{drag:e,related:null,type:"lm-drop"});return t.dispatchEvent(n)?"none":n.dropAction};let i={none:0,copy:1,link:2,move:4},a={none:i.none,copy:i.copy,link:i.link,move:i.move,"copy-link":i.copy|i.link,"copy-move":i.copy|i.move,"link-move":i.link|i.move,all:i.copy|i.link|i.move};function o(t){e.cursorBackdrop&&(e.cursorBackdrop.style.transform=`translate(${t.clientX}px, ${t.clientY}px)`)}function s(r){if(!e.cursorBackdrop)return;let n=t();if(!n)return;let i=n.closest("[data-lm-dragscroll]");i&&(i.scrollTop+=e.cursorBackdrop.scrollTop-c,i.scrollLeft+=e.cursorBackdrop.scrollLeft-c,l())}function l(){e.cursorBackdrop.scrollTop=c,e.cursorBackdrop.scrollLeft=c}e.overrideCursor=function(t,r=document){let n=++u,i=r instanceof Document?r.body:r.firstElementChild;return e.cursorBackdrop.isConnected||(e.cursorBackdrop.style.transform="scale(0)",i.appendChild(e.cursorBackdrop),l(),document.addEventListener("pointermove",o,{capture:!0,passive:!0}),e.cursorBackdrop.addEventListener("scroll",s,{capture:!0,passive:!0})),e.cursorBackdrop.style.cursor=t,new D((()=>{n===u&&e.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",o,!0),e.cursorBackdrop.removeEventListener("scroll",s,!0),i.removeChild(e.cursorBackdrop))}))};let c=500,u=0;e.cursorBackdrop=function(){let e=document.createElement("div");return e.classList.add("lm-cursor-backdrop"),e}()}(F||(F={}));var j=y(v()),N=y(x());function U(){return q.keyboardLayout}var V=class e{constructor(t,r,n=[]){this.name=t,this._codes=r,this._keys=e.extractKeys(r),this._modifierKeys=e.convertToKeySet(n)}keys(){return Object.keys(this._keys)}isValidKey(e){return e in this._keys}isModifierKey(e){return e in this._modifierKeys}keyForKeydownEvent(e){return this._codes[e.keyCode]||""}};!function(e){e.extractKeys=function(e){let t=Object.create(null);for(let r in e)t[e[r]]=!0;return t},e.convertToKeySet=function(e){let t=Object(null);for(let r=0,n=e.length;r<n;++r)t[e[r]]=!0;return t}}(V||(V={}));var q,H=new V("en-us",{8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",27:"Escape",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Meta"},["Shift","Ctrl","Alt","Meta"]);!function(e){e.keyboardLayout=H}(q||(q={}));var G,W=class e{constructor(){this._timerID=0,this._timerModifierID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=new Map,this._commandChanged=new z(this),this._commandExecuted=new z(this),this._keyBindingChanged=new z(this),this._holdKeyBindingPromises=new Map}get commandChanged(){return this._commandChanged}get commandExecuted(){return this._commandExecuted}get keyBindingChanged(){return this._keyBindingChanged}get keyBindings(){return this._keyBindings}listCommands(){return Array.from(this._commands.keys())}hasCommand(e){return this._commands.has(e)}addCommand(e,t){if(this._commands.has(e))throw new Error(`Command '${e}' already registered.`);return this._commands.set(e,G.createCommand(t)),this._commandChanged.emit({id:e,type:"added"}),new D((()=>{this._commands.delete(e),this._commandChanged.emit({id:e,type:"removed"})}))}notifyCommandChanged(e){if(void 0!==e&&!this._commands.has(e))throw new Error(`Command '${e}' is not registered.`);this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})}describedBy(e,t=N.JSONExt.emptyObject){var r;let n=this._commands.get(e);return Promise.resolve(null!==(r=n?.describedBy.call(void 0,t))&&void 0!==r?r:{args:null})}label(e,t=N.JSONExt.emptyObject){var r;let n=this._commands.get(e);return null!==(r=n?.label.call(void 0,t))&&void 0!==r?r:""}mnemonic(e,t=N.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.mnemonic.call(void 0,t):-1}icon(e,t=N.JSONExt.emptyObject){var r;return null===(r=this._commands.get(e))||void 0===r?void 0:r.icon.call(void 0,t)}iconClass(e,t=N.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.iconClass.call(void 0,t):""}iconLabel(e,t=N.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.iconLabel.call(void 0,t):""}caption(e,t=N.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.caption.call(void 0,t):""}usage(e,t=N.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.usage.call(void 0,t):""}className(e,t=N.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.className.call(void 0,t):""}dataset(e,t=N.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.dataset.call(void 0,t):{}}isEnabled(e,t=N.JSONExt.emptyObject){let r=this._commands.get(e);return!!r&&r.isEnabled.call(void 0,t)}isToggled(e,t=N.JSONExt.emptyObject){let r=this._commands.get(e);return!!r&&r.isToggled.call(void 0,t)}isToggleable(e,t=N.JSONExt.emptyObject){let r=this._commands.get(e);return!!r&&r.isToggleable}isVisible(e,t=N.JSONExt.emptyObject){let r=this._commands.get(e);return!!r&&r.isVisible.call(void 0,t)}execute(e,t=N.JSONExt.emptyObject){let r,n=this._commands.get(e);if(!n)return Promise.reject(new Error(`Command '${e}' not registered.`));try{r=n.execute.call(void 0,t)}catch(e){r=Promise.reject(e)}let i=Promise.resolve(r);return this._commandExecuted.emit({id:e,args:t,result:i}),i}addKeyBinding(e){let t=G.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new D((()=>{j.ArrayExt.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})}))}processKeydownEvent(t){if(t.defaultPrevented||this._replaying)return;let r=e.keystrokeForKeydownEvent(t);if(!r)return this._replayKeydownEvents(),void this._clearPendingState();if(e.isModifierKeyPressed(t)){let{exact:e}=G.matchKeyBinding(this._keyBindings,[r],t);return void(e?(t.preventDefault(),t.stopPropagation(),this._startModifierTimer(e)):this._clearModifierTimer())}this._keystrokes.push(r);let{exact:n,partial:i}=G.matchKeyBinding(this._keyBindings,this._keystrokes,t),a=0!==i.length;return n||a?((n?.preventDefault||i.some((e=>e.preventDefault)))&&(t.preventDefault(),t.stopPropagation()),this._keydownEvents.push(t),n&&!a?(this._executeKeyBinding(n),void this._clearPendingState()):(n&&(this._exactKeyMatch=n),void this._startTimer())):(this._replayKeydownEvents(),void this._clearPendingState())}holdKeyBindingExecution(e,t){this._holdKeyBindingPromises.set(e,t)}processKeyupEvent(e){this._clearModifierTimer()}_startModifierTimer(e){this._clearModifierTimer(),this._timerModifierID=window.setTimeout((()=>{this._executeKeyBinding(e)}),G.modifierkeyTimeOut)}_clearModifierTimer(){0!==this._timerModifierID&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout((()=>{this._onPendingTimeout()}),G.CHORD_TIMEOUT)}_clearTimer(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(G.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(e){if(0!==this._holdKeyBindingPromises.size){let e=[...this._keydownEvents],t=(await Promise.race([Promise.all(e.map((async e=>{var t;return null!==(t=this._holdKeyBindingPromises.get(e))&&void 0!==t?t:Promise.resolve(!0)}))),new Promise((e=>{setTimeout((()=>e([!1])),G.KEYBINDING_HOLD_TIMEOUT)}))])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!t)return}let{command:t,args:r}=e,n={_luminoEvent:{type:"keybinding",keys:e.keys},...r};if(this.hasCommand(t)&&this.isEnabled(t,n))await this.execute(t,n);else{let r=this.hasCommand(t)?"enabled":"registered",n=`Cannot execute key binding '${e.keys.join(", ")}':`,i=`command '${t}' is not ${r}.`;console.warn(`${n} ${i}`)}}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}};!function(e){function t(e){let t="",r=!1,n=!1,i=!1,o=!1;for(let s of e.split(/\s+/))"Accel"===s?a.IS_MAC?n=!0:i=!0:"Alt"===s?r=!0:"Cmd"===s?n=!0:"Ctrl"===s?i=!0:"Shift"===s?o=!0:s.length>0&&(t=s);return{cmd:n,ctrl:i,alt:r,shift:o,key:t}}function r(e){let r="",n=t(e);return n.ctrl&&(r+="Ctrl "),n.alt&&(r+="Alt "),n.shift&&(r+="Shift "),n.cmd&&a.IS_MAC&&(r+="Cmd "),n.key?r+n.key:r.trim()}e.parseKeystroke=t,e.normalizeKeystroke=r,e.normalizeKeys=function(e){let t;return t=a.IS_WIN?e.winKeys||e.keys:a.IS_MAC?e.macKeys||e.keys:e.linuxKeys||e.keys,t.map(r)},e.formatKeystroke=function(e){return"string"==typeof e?r(e):e.map(r).join(", ");function r(e){let r=[],n=a.IS_MAC?" ":"+",i=t(e);return i.ctrl&&r.push("Ctrl"),i.alt&&r.push("Alt"),i.shift&&r.push("Shift"),a.IS_MAC&&i.cmd&&r.push("Cmd"),r.push(i.key),r.map(G.formatKey).join(n)}},e.isModifierKeyPressed=function(e){let t=U(),r=t.keyForKeydownEvent(e);return t.isModifierKey(r)},e.keystrokeForKeydownEvent=function(e){let t=U(),r=t.keyForKeydownEvent(e),n=[];return e.ctrlKey&&n.push("Ctrl"),e.altKey&&n.push("Alt"),e.shiftKey&&n.push("Shift"),e.metaKey&&a.IS_MAC&&n.push("Cmd"),t.isModifierKey(r)||n.push(r),n.join(" ")}}(W||(W={})),function(e){e.CHORD_TIMEOUT=1e3,e.KEYBINDING_HOLD_TIMEOUT=1e3,e.modifierkeyTimeOut=500,e.createCommand=function(e){return{execute:e.execute,describedBy:h("function"==typeof e.describedBy?e.describedBy:{args:null,...e.describedBy},(()=>({args:null}))),label:h(e.label,n),mnemonic:h(e.mnemonic,i),icon:h(e.icon,u),iconClass:h(e.iconClass,n),iconLabel:h(e.iconLabel,n),caption:h(e.caption,n),usage:h(e.usage,n),className:h(e.className,n),dataset:h(e.dataset,c),isEnabled:e.isEnabled||s,isToggled:e.isToggled||l,isToggleable:e.isToggleable||!!e.isToggled,isVisible:e.isVisible||s}},e.createKeyBinding=function(e){var t;return{keys:W.normalizeKeys(e),selector:f(e),command:e.command,args:e.args||N.JSONExt.emptyObject,preventDefault:null===(t=e.preventDefault)||void 0===t||t}},e.matchKeyBinding=function(e,t,r){let n=null,i=[],a=1/0,s=0;for(let l=0,c=e.length;l<c;++l){let c=e[l],u=p(c.keys,t);if(0===u)continue;if(2===u){-1!==d(c.selector,r)&&i.push(c);continue}let h=d(c.selector,r);if(-1===h||h>a)continue;let f=o.calculateSpecificity(c.selector);(!n||h<a||f>=s)&&(n=c,a=h,s=f)}return{exact:n,partial:i}},e.replayKeyEvent=function(e){e.target.dispatchEvent(function(e){let t=document.createEvent("Event"),r=e.bubbles||!0,n=e.cancelable||!0;return t.initEvent(e.type||"keydown",r,n),t.key=e.key||"",t.keyCode=e.keyCode||0,t.which=e.keyCode||0,t.ctrlKey=e.ctrlKey||!1,t.altKey=e.altKey||!1,t.shiftKey=e.shiftKey||!1,t.metaKey=e.metaKey||!1,t.view=e.view||window,t}(e))},e.formatKey=function(e){return a.IS_MAC?t.hasOwnProperty(e)?t[e]:e:r.hasOwnProperty(e)?r[e]:e};let t={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},r={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},n=()=>"",i=()=>-1,s=()=>!0,l=()=>!1,c=()=>({}),u=()=>{};function h(e,t){return void 0===e?t:"function"==typeof e?e:()=>e}function f(e){if(-1!==e.selector.indexOf(","))throw new Error(`Selector cannot contain commas: ${e.selector}`);if(!o.isValid(e.selector))throw new Error(`Invalid selector: ${e.selector}`);return e.selector}function p(e,t){if(e.length<t.length)return 0;for(let r=0,n=t.length;r<n;++r)if(e[r]!==t[r])return 0;return e.length>t.length?2:1}function d(e,t){let r=t.target,n=t.currentTarget;for(let t=0;null!==r;r=r.parentElement,++t){if(r.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(o.matches(r,e))return t;if(r===n)return-1}return-1}}(G||(G={}));var Z,Y,X=y(v()),$=class{constructor(e){this.type="text",this.content=e}},K=class{constructor(e,t,r,n){this.type="element",this.tag=e,this.attrs=t,this.children=r,this.renderer=n}};function J(e){let t,r={},n=[];for(let e=1,a=arguments.length;e<a;++e){let a=arguments[e];"string"==typeof a?n.push(new $(a)):a instanceof $||a instanceof K?n.push(a):a instanceof Array?i(n,a):(1===e||2===e)&&a&&"object"==typeof a&&("render"in a?t=a:r=a)}return new K(e,r,n,t);function i(e,t){for(let r of t)"string"==typeof r?e.push(new $(r)):(r instanceof $||r instanceof K)&&e.push(r)}}!function(e){e.a=e.bind(void 0,"a"),e.abbr=e.bind(void 0,"abbr"),e.address=e.bind(void 0,"address"),e.area=e.bind(void 0,"area"),e.article=e.bind(void 0,"article"),e.aside=e.bind(void 0,"aside"),e.audio=e.bind(void 0,"audio"),e.b=e.bind(void 0,"b"),e.bdi=e.bind(void 0,"bdi"),e.bdo=e.bind(void 0,"bdo"),e.blockquote=e.bind(void 0,"blockquote"),e.br=e.bind(void 0,"br"),e.button=e.bind(void 0,"button"),e.canvas=e.bind(void 0,"canvas"),e.caption=e.bind(void 0,"caption"),e.cite=e.bind(void 0,"cite"),e.code=e.bind(void 0,"code"),e.col=e.bind(void 0,"col"),e.colgroup=e.bind(void 0,"colgroup"),e.data=e.bind(void 0,"data"),e.datalist=e.bind(void 0,"datalist"),e.dd=e.bind(void 0,"dd"),e.del=e.bind(void 0,"del"),e.dfn=e.bind(void 0,"dfn"),e.div=e.bind(void 0,"div"),e.dl=e.bind(void 0,"dl"),e.dt=e.bind(void 0,"dt"),e.em=e.bind(void 0,"em"),e.embed=e.bind(void 0,"embed"),e.fieldset=e.bind(void 0,"fieldset"),e.figcaption=e.bind(void 0,"figcaption"),e.figure=e.bind(void 0,"figure"),e.footer=e.bind(void 0,"footer"),e.form=e.bind(void 0,"form"),e.h1=e.bind(void 0,"h1"),e.h2=e.bind(void 0,"h2"),e.h3=e.bind(void 0,"h3"),e.h4=e.bind(void 0,"h4"),e.h5=e.bind(void 0,"h5"),e.h6=e.bind(void 0,"h6"),e.header=e.bind(void 0,"header"),e.hr=e.bind(void 0,"hr"),e.i=e.bind(void 0,"i"),e.iframe=e.bind(void 0,"iframe"),e.img=e.bind(void 0,"img"),e.input=e.bind(void 0,"input"),e.ins=e.bind(void 0,"ins"),e.kbd=e.bind(void 0,"kbd"),e.label=e.bind(void 0,"label"),e.legend=e.bind(void 0,"legend"),e.li=e.bind(void 0,"li"),e.main=e.bind(void 0,"main"),e.map=e.bind(void 0,"map"),e.mark=e.bind(void 0,"mark"),e.meter=e.bind(void 0,"meter"),e.nav=e.bind(void 0,"nav"),e.noscript=e.bind(void 0,"noscript"),e.object=e.bind(void 0,"object"),e.ol=e.bind(void 0,"ol"),e.optgroup=e.bind(void 0,"optgroup"),e.option=e.bind(void 0,"option"),e.output=e.bind(void 0,"output"),e.p=e.bind(void 0,"p"),e.param=e.bind(void 0,"param"),e.pre=e.bind(void 0,"pre"),e.progress=e.bind(void 0,"progress"),e.q=e.bind(void 0,"q"),e.rp=e.bind(void 0,"rp"),e.rt=e.bind(void 0,"rt"),e.ruby=e.bind(void 0,"ruby"),e.s=e.bind(void 0,"s"),e.samp=e.bind(void 0,"samp"),e.section=e.bind(void 0,"section"),e.select=e.bind(void 0,"select"),e.small=e.bind(void 0,"small"),e.source=e.bind(void 0,"source"),e.span=e.bind(void 0,"span"),e.strong=e.bind(void 0,"strong"),e.sub=e.bind(void 0,"sub"),e.summary=e.bind(void 0,"summary"),e.sup=e.bind(void 0,"sup"),e.table=e.bind(void 0,"table"),e.tbody=e.bind(void 0,"tbody"),e.td=e.bind(void 0,"td"),e.textarea=e.bind(void 0,"textarea"),e.tfoot=e.bind(void 0,"tfoot"),e.th=e.bind(void 0,"th"),e.thead=e.bind(void 0,"thead"),e.time=e.bind(void 0,"time"),e.title=e.bind(void 0,"title"),e.tr=e.bind(void 0,"tr"),e.track=e.bind(void 0,"track"),e.u=e.bind(void 0,"u"),e.ul=e.bind(void 0,"ul"),e.var_=e.bind(void 0,"var"),e.video=e.bind(void 0,"video"),e.wbr=e.bind(void 0,"wbr")}(J||(J={})),function(e){e.realize=function(e){return Y.createDOMNode(e)},e.render=function(e,t){let r=Y.hostMap.get(t)||[],n=Y.asContentArray(e);Y.hostMap.set(t,n),Y.updateContent(t,r,n)}}(Z||(Z={})),function(e){function t(e){let r=arguments[1]||null,i=arguments[2]||null;if(r)r.insertBefore(t(e),i);else{if("text"===e.type)return document.createTextNode(e.content);if(r=document.createElement(e.tag),function(e,t){for(let r in t)r in n||("on"===r.substr(0,2)?e[r]=t[r]:e.setAttribute(r,t[r]));void 0!==t.className&&e.setAttribute("class",t.className),void 0!==t.htmlFor&&e.setAttribute("for",t.htmlFor),t.dataset&&function(e,t){for(let r in t)e.setAttribute(`data-${r}`,t[r])}(e,t.dataset),t.style&&function(e,t){let r,n=e.style;for(r in t)n[r]=t[r]}(e,t.style)}(r,e.attrs),e.renderer)return e.renderer.render(r,{attrs:e.attrs,children:e.children}),r;for(let n=0,i=e.children.length;n<i;++n)t(e.children[n],r)}return r}function r(e,t,n,i){for(let a=t.length-1;a>=n;--a){let n=t[a],o=i?e.lastChild:e.childNodes[a];"text"===n.type||(n.renderer&&n.renderer.unrender?n.renderer.unrender(o,{attrs:n.attrs,children:n.children}):r(o,n.children,0,!1)),i&&e.removeChild(o)}}e.hostMap=new WeakMap,e.asContentArray=function(e){return e?e instanceof Array?e:[e]:[]},e.createDOMNode=t,e.updateContent=function e(n,a,o){if(a===o)return;let s=function(e,t){let r=e.firstChild,n=Object.create(null);for(let e of t)"element"===e.type&&e.attrs.key&&(n[e.attrs.key]={vNode:e,element:r}),r=r.nextSibling;return n}(n,a),l=a.slice(),c=n.firstChild,u=o.length;for(let r=0;r<u;++r){if(r>=l.length){t(o[r],n);continue}let a=l[r],u=o[r];if(a===u){c=c.nextSibling;continue}if("text"===a.type&&"text"===u.type){c.textContent!==u.content&&(c.textContent=u.content),c=c.nextSibling;continue}if("text"===a.type||"text"===u.type){X.ArrayExt.insert(l,r,u),t(u,n,c);continue}if(!a.renderer!=!u.renderer){X.ArrayExt.insert(l,r,u),t(u,n,c);continue}let h=u.attrs.key;if(h&&h in s){let e=s[h];e.vNode!==a&&(X.ArrayExt.move(l,l.indexOf(e.vNode,r+1),r),n.insertBefore(e.element,c),a=e.vNode,c=e.element)}if(a===u){c=c.nextSibling;continue}let f=a.attrs.key;f&&f!==h?(X.ArrayExt.insert(l,r,u),t(u,n,c)):a.tag===u.tag?(i(c,a.attrs,u.attrs),u.renderer?u.renderer.render(c,{attrs:u.attrs,children:u.children}):e(c,a.children,u.children),c=c.nextSibling):(X.ArrayExt.insert(l,r,u),t(u,n,c))}r(n,l,u,!0)};let n={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function i(e,t,r){if(t===r)return;let i;for(i in t)i in n||i in r||("on"===i.substr(0,2)?e[i]=null:e.removeAttribute(i));for(i in r)i in n||t[i]===r[i]||("on"===i.substr(0,2)?e[i]=r[i]:e.setAttribute(i,r[i]));t.className!==r.className&&(void 0!==r.className?e.setAttribute("class",r.className):e.removeAttribute("class")),t.htmlFor!==r.htmlFor&&(void 0!==r.htmlFor?e.setAttribute("for",r.htmlFor):e.removeAttribute("for")),t.dataset!==r.dataset&&function(e,t,r){for(let n in t)n in r||e.removeAttribute(`data-${n}`);for(let n in r)t[n]!==r[n]&&e.setAttribute(`data-${n}`,r[n])}(e,t.dataset||{},r.dataset||{}),t.style!==r.style&&function(e,t,r){let n,i=e.style;for(n in t)n in r||(i[n]="");for(n in r)t[n]!==r[n]&&(i[n]=r[n])}(e,t.style||{},r.style||{})}}(Y||(Y={}));var Q,ee=class{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}};!function(e){e.calc=function(e,t){let r=e.length;if(0===r)return t;let n=0,i=0,a=0,o=0,s=0;for(let t=0;t<r;++t){let r=e[t],l=r.minSize,c=r.maxSize,u=r.sizeHint;r.done=!1,r.size=Math.max(l,Math.min(u,c)),a+=r.size,n+=l,i+=c,r.stretch>0&&(o+=r.stretch,s++)}if(t===a)return 0;if(t<=n){for(let t=0;t<r;++t){let r=e[t];r.size=r.minSize}return t-n}if(t>=i){for(let t=0;t<r;++t){let r=e[t];r.size=r.maxSize}return t-i}let l=.01,c=r;if(t<a){let n=a-t;for(;s>0&&n>l;){let t=n,i=o;for(let a=0;a<r;++a){let r=e[a];if(r.done||0===r.stretch)continue;let l=r.stretch*t/i;r.size-l<=r.minSize?(n-=r.size-r.minSize,o-=r.stretch,r.size=r.minSize,r.done=!0,c--,s--):(n-=l,r.size-=l)}}for(;c>0&&n>l;){let t=n/c;for(let i=0;i<r;++i){let r=e[i];r.done||(r.size-t<=r.minSize?(n-=r.size-r.minSize,r.size=r.minSize,r.done=!0,c--):(n-=t,r.size-=t))}}}else{let n=t-a;for(;s>0&&n>l;){let t=n,i=o;for(let a=0;a<r;++a){let r=e[a];if(r.done||0===r.stretch)continue;let l=r.stretch*t/i;r.size+l>=r.maxSize?(n-=r.maxSize-r.size,o-=r.stretch,r.size=r.maxSize,r.done=!0,c--,s--):(n-=l,r.size+=l)}}for(;c>0&&n>l;){let t=n/c;for(let i=0;i<r;++i){let r=e[i];r.done||(r.size+t>=r.maxSize?(n-=r.maxSize-r.size,r.size=r.maxSize,r.done=!0,c--):(n-=t,r.size+=t))}}}return 0},e.adjust=function(e,t,r){0===e.length||0===r||(r>0?function(e,t,r){let n=0;for(let r=0;r<=t;++r){let t=e[r];n+=t.maxSize-t.size}let i=0;for(let r=t+1,n=e.length;r<n;++r){let t=e[r];i+=t.size-t.minSize}let a=r=Math.min(r,n,i);for(let r=t;r>=0&&a>0;--r){let t=e[r],n=t.maxSize-t.size;n>=a?(t.sizeHint=t.size+a,a=0):(t.sizeHint=t.size+n,a-=n)}let o=r;for(let r=t+1,n=e.length;r<n&&o>0;++r){let t=e[r],n=t.size-t.minSize;n>=o?(t.sizeHint=t.size-o,o=0):(t.sizeHint=t.size-n,o-=n)}}(e,t,r):function(e,t,r){let n=0;for(let r=t+1,i=e.length;r<i;++r){let t=e[r];n+=t.maxSize-t.size}let i=0;for(let r=0;r<=t;++r){let t=e[r];i+=t.size-t.minSize}let a=r=Math.min(r,n,i);for(let r=t+1,n=e.length;r<n&&a>0;++r){let t=e[r],n=t.maxSize-t.size;n>=a?(t.sizeHint=t.size+a,a=0):(t.sizeHint=t.size+n,a-=n)}let o=r;for(let r=t;r>=0&&o>0;--r){let t=e[r],n=t.size-t.minSize;n>=o?(t.sizeHint=t.size-o,o=0):(t.sizeHint=t.size-n,o-=n)}}(e,t,-r))}}(Q||(Q={}));var te,re=class{constructor(e){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new z(this),this._isDisposed=!1,this.owner=e.owner,void 0!==e.label&&(this._label=e.label),void 0!==e.mnemonic&&(this._mnemonic=e.mnemonic),void 0!==e.icon&&(this._icon=e.icon),void 0!==e.iconClass&&(this._iconClass=e.iconClass),void 0!==e.iconLabel&&(this._iconLabel=e.iconLabel),void 0!==e.caption&&(this._caption=e.caption),void 0!==e.className&&(this._className=e.className),void 0!==e.closable&&(this._closable=e.closable),this._dataset=e.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))}get icon(){return this._icon}set icon(e){this._icon!==e&&(this._icon=e,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))}get caption(){return this._caption}set caption(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))}get className(){return this._className}set className(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))}get closable(){return this._closable}set closable(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,z.clearData(this))}},ne=class e{constructor(t={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new z(this),this._hiddenMode=e.HiddenMode.Display,this.node=te.createNode(t),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(e.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&e.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),z.clearData(this),M.clearData(this),I.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(e.Flag.IsDisposed)}get isAttached(){return this.testFlag(e.Flag.IsAttached)}get isHidden(){return this.testFlag(e.Flag.IsHidden)}get isVisible(){return this.testFlag(e.Flag.IsVisible)}get title(){return te.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(t){this._hiddenMode!==t&&(this.isHidden&&this._toggleHidden(!1),t==e.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=t,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(t){if(this._parent!==t){if(t&&this.contains(t))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let t=new e.ChildMessage("child-removed",this);M.sendMessage(this._parent,t)}if(this._parent=t,this._parent&&!this._parent.isDisposed){let t=new e.ChildMessage("child-added",this);M.sendMessage(this._parent,t)}this.isDisposed||M.sendMessage(this,e.Msg.ParentChanged)}}get layout(){return this._layout}set layout(t){if(this._layout!==t){if(this.testFlag(e.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(t.parent)throw new Error("Cannot change layout parent.");this._layout=t,t.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(e){for(let t=e;t;t=t._parent)if(t===this)return!0;return!1}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){return!0===t?(this.node.classList.add(e),!0):!1===t?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)}update(){M.postMessage(this,e.Msg.UpdateRequest)}fit(){M.postMessage(this,e.Msg.FitRequest)}activate(){M.postMessage(this,e.Msg.ActivateRequest)}close(){M.sendMessage(this,e.Msg.CloseRequest)}show(){if(this.testFlag(e.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&M.sendMessage(this,e.Msg.BeforeShow),this.clearFlag(e.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&M.sendMessage(this,e.Msg.AfterShow),this.parent)){let t=new e.ChildMessage("child-shown",this);M.sendMessage(this.parent,t)}}hide(){if(!this.testFlag(e.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&M.sendMessage(this,e.Msg.BeforeHide),this.setFlag(e.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&M.sendMessage(this,e.Msg.AfterHide),this.parent)){let t=new e.ChildMessage("child-hidden",this);M.sendMessage(this.parent,t)}}setHidden(e){e?this.hide():this.show()}testFlag(e){return!!(this._flags&e)}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(t){switch(t.type){case"resize":this.notifyLayout(t),this.onResize(t);break;case"update-request":this.notifyLayout(t),this.onUpdateRequest(t);break;case"fit-request":this.notifyLayout(t),this.onFitRequest(t);break;case"before-show":this.notifyLayout(t),this.onBeforeShow(t);break;case"after-show":this.setFlag(e.Flag.IsVisible),this.notifyLayout(t),this.onAfterShow(t);break;case"before-hide":this.notifyLayout(t),this.onBeforeHide(t);break;case"after-hide":this.clearFlag(e.Flag.IsVisible),this.notifyLayout(t),this.onAfterHide(t);break;case"before-attach":this.notifyLayout(t),this.onBeforeAttach(t);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(e.Flag.IsVisible),this.setFlag(e.Flag.IsAttached),this.notifyLayout(t),this.onAfterAttach(t);break;case"before-detach":this.notifyLayout(t),this.onBeforeDetach(t);break;case"after-detach":this.clearFlag(e.Flag.IsVisible),this.clearFlag(e.Flag.IsAttached),this.notifyLayout(t),this.onAfterDetach(t);break;case"activate-request":this.notifyLayout(t),this.onActivateRequest(t);break;case"close-request":this.notifyLayout(t),this.onCloseRequest(t);break;case"child-added":this.notifyLayout(t),this.onChildAdded(t);break;case"child-removed":this.notifyLayout(t),this.onChildRemoved(t);break;default:this.notifyLayout(t)}}notifyLayout(e){this._layout&&this._layout.processParentMessage(e)}onCloseRequest(t){this.parent?this.parent=null:this.isAttached&&e.detach(this)}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(t){if(t)switch(this._hiddenMode){case e.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case e.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case e.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1"}else switch(this._hiddenMode){case e.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case e.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case e.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex=""}}};!function(e){var t;(t=e.HiddenMode||(e.HiddenMode={}))[t.Display=0]="Display",t[t.Scale=1]="Scale",t[t.ContentVisibility=2]="ContentVisibility",function(e){e[e.IsDisposed=1]="IsDisposed",e[e.IsAttached=2]="IsAttached",e[e.IsHidden=4]="IsHidden",e[e.IsVisible=8]="IsVisible",e[e.DisallowLayout=16]="DisallowLayout"}(e.Flag||(e.Flag={})),function(e){e.BeforeShow=new S("before-show"),e.AfterShow=new S("after-show"),e.BeforeHide=new S("before-hide"),e.AfterHide=new S("after-hide"),e.BeforeAttach=new S("before-attach"),e.AfterAttach=new S("after-attach"),e.BeforeDetach=new S("before-detach"),e.AfterDetach=new S("after-detach"),e.ParentChanged=new S("parent-changed"),e.UpdateRequest=new E("update-request"),e.FitRequest=new E("fit-request"),e.ActivateRequest=new E("activate-request"),e.CloseRequest=new E("close-request")}(e.Msg||(e.Msg={})),e.ChildMessage=class extends S{constructor(e,t){super(e),this.child=t}};class r extends S{constructor(e,t){super("resize"),this.width=e,this.height=t}}e.ResizeMessage=r,function(e){e.UnknownSize=new e(-1,-1)}(r=e.ResizeMessage||(e.ResizeMessage={})),e.attach=function(t,r,n=null){if(t.parent)throw new Error("Cannot attach a child widget.");if(t.isAttached||t.node.isConnected)throw new Error("Widget is already attached.");if(!r.isConnected)throw new Error("Host is not attached.");M.sendMessage(t,e.Msg.BeforeAttach),r.insertBefore(t.node,n),M.sendMessage(t,e.Msg.AfterAttach)},e.detach=function(t){if(t.parent)throw new Error("Cannot detach a child widget.");if(!t.isAttached||!t.node.isConnected)throw new Error("Widget is not attached.");M.sendMessage(t,e.Msg.BeforeDetach),t.node.parentNode.removeChild(t.node),M.sendMessage(t,e.Msg.AfterDetach)}}(ne||(ne={})),function(e){e.titleProperty=new I({name:"title",create:e=>new re({owner:e})}),e.createNode=function(e){return e.node||document.createElement(e.tag||"div")}}(te||(te={}));var ie=class{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,z.clearData(this),I.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){let e=this._parent.node.style;e.minWidth="",e.minHeight="",e.maxWidth="",e.maxHeight="",this._parent.fit()}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e)}}init(){for(let e of this)e.parent=this.parent}onResize(e){for(let e of this)M.sendMessage(e,ne.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(let e of this)M.sendMessage(e,ne.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(let t of this)M.sendMessage(t,e)}onAfterAttach(e){for(let t of this)M.sendMessage(t,e)}onBeforeDetach(e){for(let t of this)M.sendMessage(t,e)}onAfterDetach(e){for(let t of this)M.sendMessage(t,e)}onBeforeShow(e){for(let t of this)t.isHidden||M.sendMessage(t,e)}onAfterShow(e){for(let t of this)t.isHidden||M.sendMessage(t,e)}onBeforeHide(e){for(let t of this)t.isHidden||M.sendMessage(t,e)}onAfterHide(e){for(let t of this)t.isHidden||M.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}};!function(e){e.getHorizontalAlignment=function(e){return ae.horizontalAlignmentProperty.get(e)},e.setHorizontalAlignment=function(e,t){ae.horizontalAlignmentProperty.set(e,t)},e.getVerticalAlignment=function(e){return ae.verticalAlignmentProperty.get(e)},e.setVerticalAlignment=function(e,t){ae.verticalAlignmentProperty.set(e,t)}}(ie||(ie={}));var ae,oe=class{constructor(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height="",e.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let e=i.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,r,n){let i=Math.max(this._minWidth,Math.min(r,this._maxWidth)),a=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(i<r)switch(ie.getHorizontalAlignment(this.widget)){case"left":break;case"center":e+=(r-i)/2;break;case"right":e+=r-i;break;default:throw"unreachable"}if(a<n)switch(ie.getVerticalAlignment(this.widget)){case"top":break;case"center":t+=(n-a)/2;break;case"bottom":t+=n-a;break;default:throw"unreachable"}let o=!1,s=this.widget.node.style;if(this._top!==t&&(this._top=t,s.top=`${t}px`),this._left!==e&&(this._left=e,s.left=`${e}px`),this._width!==i&&(o=!0,this._width=i,s.width=`${i}px`),this._height!==a&&(o=!0,this._height=a,s.height=`${a}px`),o){let e=new ne.ResizeMessage(i,a);M.sendMessage(this.widget,e)}}};!function(e){function t(e){e.parent&&e.parent.layout&&e.parent.update()}e.horizontalAlignmentProperty=new I({name:"horizontalAlignment",create:()=>"center",changed:t}),e.verticalAlignmentProperty=new I({name:"verticalAlignment",create:()=>"top",changed:t})}(ae||(ae={}));var se,le=class extends ie{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;let r=this._widgets.indexOf(t),n=Math.max(0,Math.min(e,this._widgets.length));if(-1===r)return b.ArrayExt.insert(this._widgets,n,t),void(this.parent&&this.attachWidget(n,t));n===this._widgets.length&&n--,r!==n&&(b.ArrayExt.move(this._widgets,r,n),this.parent&&this.moveWidget(r,n,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=b.ArrayExt.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)}init(){super.init();let e=0;for(let t of this)this.attachWidget(e++,t)}attachWidget(e,t){let r=this.parent.node.children[e];this.parent.isAttached&&M.sendMessage(t,ne.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,r),this.parent.isAttached&&M.sendMessage(t,ne.Msg.AfterAttach)}moveWidget(e,t,r){this.parent.isAttached&&M.sendMessage(r,ne.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&M.sendMessage(r,ne.Msg.AfterDetach);let n=this.parent.node.children[t];this.parent.isAttached&&M.sendMessage(r,ne.Msg.BeforeAttach),this.parent.node.insertBefore(r.node,n),this.parent.isAttached&&M.sendMessage(r,ne.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&M.sendMessage(t,ne.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&M.sendMessage(t,ne.Msg.AfterDetach)}};!function(e){e.clampDimension=function(e){return Math.max(0,Math.floor(e))}}(se||(se={}));var ce,ue=se,he=class e extends le{constructor(e){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=e.renderer,void 0!==e.orientation&&(this._orientation=e.orientation),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=se.clampDimension(e.spacing))}dispose(){for(let e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.parent&&(this.parent.dataset.orientation=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=se.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map((e=>e.size))}relativeSizes(){return ce.normalize(this._sizers.map((e=>e.size)))}setRelativeSizes(e,t=!0){let r=this._sizers.length,n=e.slice(0,r);for(;n.length<r;)n.push(0);let i=ce.normalize(n);for(let e=0;e<r;++e){let t=this._sizers[e];t.sizeHint=i[e],t.size=i[e]}this._hasNormedSizes=!0,t&&this.parent&&this.parent.update()}moveHandle(e,t){let r,n=this._handles[e];if(n&&!n.classList.contains("lm-mod-hidden")&&(r="horizontal"===this._orientation?t-n.offsetLeft:t-n.offsetTop,0!==r)){for(let e of this._sizers)e.size>0&&(e.sizeHint=e.size);Q.adjust(this._sizers,e,r),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){let r=new oe(t),n=ce.createHandle(this.renderer),i=ce.averageSize(this._sizers),a=ce.createSizer(i);b.ArrayExt.insert(this._items,e,r),b.ArrayExt.insert(this._sizers,e,a),b.ArrayExt.insert(this._handles,e,n),this.parent.isAttached&&M.sendMessage(t,ne.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(n),this.parent.isAttached&&M.sendMessage(t,ne.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,r){b.ArrayExt.move(this._items,e,t),b.ArrayExt.move(this._sizers,e,t),b.ArrayExt.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let r=b.ArrayExt.removeAt(this._items,e),n=b.ArrayExt.removeAt(this._handles,e);b.ArrayExt.removeAt(this._sizers,e),this.parent.isAttached&&M.sendMessage(t,ne.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(n),this.parent.isAttached&&M.sendMessage(t,ne.Msg.AfterDetach),r.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}updateItemPosition(e,t,r,n,i,a,o){let s=this._items[e];if(s.isHidden)return;let l=this._handles[e].style;t?(r+=this.widgetOffset,s.update(r,n,o,i),r+=o,l.top=`${n}px`,l.left=`${r}px`,l.width=`${this._spacing}px`,l.height=`${i}px`):(n+=this.widgetOffset,s.update(r,n,a,o),n+=o,l.top=`${n}px`,l.left=`${r}px`,l.width=`${a}px`,l.height=`${this._spacing}px`)}_fit(){let t=0,r=-1;for(let e=0,n=this._items.length;e<n;++e)this._items[e].isHidden?this._handles[e].classList.add("lm-mod-hidden"):(this._handles[e].classList.remove("lm-mod-hidden"),r=e,t++);-1!==r&&this._handles[r].classList.add("lm-mod-hidden"),this._fixed=this._spacing*Math.max(0,t-1)+this.widgetOffset*this._items.length;let n="horizontal"===this._orientation,a=n?this._fixed:0,o=n?0:this._fixed;for(let t=0,r=this._items.length;t<r;++t){let r=this._items[t],i=this._sizers[t];i.size>0&&(i.sizeHint=i.size),r.isHidden?(i.minSize=0,i.maxSize=0):(r.fit(),i.stretch=e.getStretch(r.widget),n?(i.minSize=r.minWidth,i.maxSize=r.maxWidth,a+=r.minWidth,o=Math.max(o,r.minHeight)):(i.minSize=r.minHeight,i.maxSize=r.maxHeight,o+=r.minHeight,a=Math.max(a,r.minWidth)))}let s=this._box=i.boxSizing(this.parent.node);a+=s.horizontalSum,o+=s.verticalSum;let l=this.parent.node.style;l.minWidth=`${a}px`,l.minHeight=`${o}px`,this._dirty=!0,this.parent.parent&&M.sendMessage(this.parent.parent,ne.Msg.FitRequest),this._dirty&&M.sendMessage(this.parent,ne.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let r=0;for(let e=0,t=this._items.length;e<t;++e)r+=+!this._items[e].isHidden;if(0===r&&0===this.widgetOffset)return;e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=i.boxSizing(this.parent.node));let n=this._box.paddingTop,a=this._box.paddingLeft,o=e-this._box.horizontalSum,s=t-this._box.verticalSum,l=0,c=0,u="horizontal"===this._orientation;if(r>0){let e;if(e=u?Math.max(0,o-this._fixed):Math.max(0,s-this._fixed),this._hasNormedSizes){for(let t of this._sizers)t.sizeHint*=e;this._hasNormedSizes=!1}let t=Q.calc(this._sizers,e);if(t>0)switch(this._alignment){case"start":break;case"center":l=0,c=t/2;break;case"end":l=0,c=t;break;case"justify":l=t/r,c=0;break;default:throw"unreachable"}}for(let e=0,t=this._items.length;e<t;++e){let t=this._items[e].isHidden?0:this._sizers[e].size+l;this.updateItemPosition(e,u,u?a+c:a,u?n:n+c,s,o,t);let r=this.widgetOffset+(this._handles[e].classList.contains("lm-mod-hidden")?0:this._spacing);u?a+=t+r:n+=t+r}}};!function(e){e.getStretch=function(e){return ce.stretchProperty.get(e)},e.setStretch=function(e,t){ce.stretchProperty.set(e,t)}}(he||(he={})),function(e){e.stretchProperty=new I({name:"stretch",create:()=>0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:function(e){e.parent&&e.parent.layout instanceof he&&e.parent.fit()}}),e.createSizer=function(e){let t=new ee;return t.sizeHint=Math.floor(e),t},e.createHandle=function(e){let t=e.createHandle();return t.style.position="absolute",t.style.contain="style",t},e.averageSize=function(e){return e.reduce(((e,t)=>e+t.size),0)/e.length||0},e.normalize=function(e){let t=e.length;if(0===t)return[];let r=e.reduce(((e,t)=>e+Math.abs(t)),0);return 0===r?e.map((e=>1/t)):e.map((e=>e/r))}}(ce||(ce={}));var fe,pe=class extends he{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=ue.clampDimension(e),this.widgetOffset!==e&&(this.widgetOffset=e,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(e,t){let r=this._titles[e],n=r.classList.contains("lm-mod-expanded"),i=fe.createTitle(this.renderer,t.title,n);this._titles[e]=i,this.parent.node.replaceChild(i,r)}insertWidget(e,t){t.id||(t.id=`id-${w.UUID.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){let r=fe.createTitle(this.renderer,t.title);b.ArrayExt.insert(this._titles,e,r),this.parent.node.appendChild(r),t.node.setAttribute("role","region"),t.node.setAttribute("aria-labelledby",r.id),super.attachWidget(e,t)}moveWidget(e,t,r){b.ArrayExt.move(this._titles,e,t),super.moveWidget(e,t,r)}detachWidget(e,t){let r=b.ArrayExt.removeAt(this._titles,e);this.parent.node.removeChild(r),super.detachWidget(e,t)}updateItemPosition(e,t,r,n,i,a,o){let s=this._titles[e].style;s.top=`${n}px`,s.left=`${r}px`,s.height=`${this.widgetOffset}px`,s.width=t?`${i}px`:`${a}px`,super.updateItemPosition(e,t,r,n,i,a,o)}};!function(e){e.createTitle=function(e,t,r=!0){let n=e.createSectionTitle(t);return n.style.position="absolute",n.style.contain="strict",n.setAttribute("aria-label",`${t.label} Section`),n.setAttribute("aria-expanded",r?"true":"false"),n.setAttribute("aria-controls",t.owner.id),r&&n.classList.add("lm-mod-expanded"),n}}(fe||(fe={}));var de,me=class extends ne{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=de.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}};!function(e){e.createLayout=function(e){return e.layout||new le}}(de||(de={}));var ge,ye=class extends me{constructor(e={}){super({layout:ge.createLayout(e)}),this._handleMoved=new z(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e,t=!0){this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),27===e.keyCode&&this._releaseMouse()}_evtPointerDown(e){if(0!==e.button)return;let t=this.layout,r=b.ArrayExt.findFirstIndex(t.handles,(t=>t.contains(e.target)));if(-1===r)return;e.preventDefault(),e.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let n,i=t.handles[r],a=i.getBoundingClientRect();n="horizontal"===t.orientation?e.clientX-a.left:e.clientY-a.top;let o=window.getComputedStyle(i),s=B.overrideCursor(o.cursor);this._pressData={index:r,delta:n,override:s}}_evtPointerMove(e){e.preventDefault(),e.stopPropagation();let t,r=this.layout,n=this.node.getBoundingClientRect();t="horizontal"===r.orientation?e.clientX-n.left-this._pressData.delta:e.clientY-n.top-this._pressData.delta,r.moveHandle(this._pressData.index,t)}_evtPointerUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}};!function(e){class t{createHandle(){let e=document.createElement("div");return e.className="lm-SplitPanel-handle",e}}e.Renderer=t,e.defaultRenderer=new t,e.getStretch=function(e){return he.getStretch(e)},e.setStretch=function(e,t){he.setStretch(e,t)}}(ye||(ye={})),function(e){e.createLayout=function(e){return e.layout||new he({renderer:e.renderer||ye.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing})}}(ge||(ge={}));var ve,xe=class extends ye{constructor(e={}){super({...e,layout:ve.createLayout(e)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new z(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(e){this.layout.titleSpace=e}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(e){super.addWidget(e),e.title.changed.connect(this._onTitleChanged,this)}collapse(e){let t=this.layout.widgets[e];t&&!t.isHidden&&this._toggleExpansion(e)}expand(e){let t=this.layout.widgets[e];t&&t.isHidden&&this._toggleExpansion(e)}insertWidget(e,t){super.insertWidget(e,t),t.title.changed.connect(this._onTitleChanged,this)}handleEvent(e){switch(super.handleEvent(e),e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e)}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(e)}onAfterDetach(e){super.onAfterDetach(e),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(e){let t=b.ArrayExt.findFirstIndex(this.widgets,(t=>t.contains(e.owner)));t>=0&&(this.layout.updateTitle(t,e.owner),this.update())}_computeWidgetSize(e){let t=this.layout,r=t.widgets[e];if(!r)return;let n=r.isHidden,i=t.absoluteSizes(),a=(n?-1:1)*this.spacing,o=i.reduce(((e,t)=>e+t)),s=[...i];if(n){let t=this._widgetSizesCache.get(r);if(!t)return;s[e]+=t;let n=s.map((e=>e-t>0)).lastIndexOf(!0);-1===n?s.forEach(((r,n)=>{n!==e&&(s[n]-=i[n]/o*(t-a))})):s[n]-=t-a}else{let t=i[e];this._widgetSizesCache.set(r,t),s[e]=0;let n=s.map((e=>e>0)).lastIndexOf(!0);if(-1===n)return;s[n]=i[n]+t+a}return s.map((e=>e/(o+a)))}_evtClick(e){let t=e.target;if(t){let r=b.ArrayExt.findFirstIndex(this.titles,(e=>e.contains(t)));r>=0&&(e.preventDefault(),e.stopPropagation(),this._toggleExpansion(r))}}_eventKeyDown(e){if(e.defaultPrevented)return;let t=e.target,r=!1;if(t){let n=b.ArrayExt.findFirstIndex(this.titles,(e=>e.contains(t)));if(n>=0){let i=e.keyCode.toString();if(e.key.match(/Space|Enter/)||i.match(/13|32/))t.click(),r=!0;else if("horizontal"===this.orientation?e.key.match(/ArrowLeft|ArrowRight/)||i.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||i.match(/38|40/)){let t=e.key.match(/ArrowLeft|ArrowUp/)||i.match(/37|38/)?-1:1,a=this.titles.length,o=(n+a+t)%a;this.titles[o].focus(),r=!0}else"End"===e.key||"35"===i?(this.titles[this.titles.length-1].focus(),r=!0):("Home"===e.key||"36"===i)&&(this.titles[0].focus(),r=!0)}r&&e.preventDefault()}}_toggleExpansion(e){let t=this.titles[e],r=this.layout.widgets[e],n=this._computeWidgetSize(e);n&&this.setRelativeSizes(n,!1),r.isHidden?(t.classList.add("lm-mod-expanded"),t.setAttribute("aria-expanded","true"),r.show()):(t.classList.remove("lm-mod-expanded"),t.setAttribute("aria-expanded","false"),r.hide()),this._expansionToggled.emit(e)}};!function(e){class t extends ye.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++t._nInstance}createCollapseIcon(e){return document.createElement("span")}createSectionTitle(e){let t=document.createElement("h3");t.setAttribute("tabindex","0"),t.id=this.createTitleKey(e),t.className=this.titleClassName;for(let r in e.dataset)t.dataset[r]=e.dataset[r];t.appendChild(this.createCollapseIcon(e)).className="lm-AccordionPanel-titleCollapser";let r=t.appendChild(document.createElement("span"));return r.className="lm-AccordionPanel-titleLabel",r.textContent=e.label,r.title=e.caption||e.label,t}createTitleKey(e){let t=this._titleKeys.get(e);return void 0===t&&(t=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(e,t)),t}}t._nInstance=0,e.Renderer=t,e.defaultRenderer=new t}(xe||(xe={})),function(e){e.createLayout=function(e){return e.layout||new pe({renderer:e.renderer||xe.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing,titleSpace:e.titleSpace})}}(ve||(ve={}));var _e,be=class e extends le{constructor(e={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",void 0!==e.direction&&(this._direction=e.direction),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=ue.clampDimension(e.spacing))}dispose(){for(let e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(e){this._direction!==e&&(this._direction=e,this.parent&&(this.parent.dataset.direction=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=ue.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){b.ArrayExt.insert(this._items,e,new oe(t)),b.ArrayExt.insert(this._sizers,e,new ee),this.parent.isAttached&&M.sendMessage(t,ne.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&M.sendMessage(t,ne.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,r){b.ArrayExt.move(this._items,e,t),b.ArrayExt.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let r=b.ArrayExt.removeAt(this._items,e);b.ArrayExt.removeAt(this._sizers,e),this.parent.isAttached&&M.sendMessage(t,ne.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&M.sendMessage(t,ne.Msg.AfterDetach),r.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let t=0;for(let e=0,r=this._items.length;e<r;++e)t+=+!this._items[e].isHidden;this._fixed=this._spacing*Math.max(0,t-1);let r=_e.isHorizontal(this._direction),n=r?this._fixed:0,a=r?0:this._fixed;for(let t=0,i=this._items.length;t<i;++t){let i=this._items[t],o=this._sizers[t];i.isHidden?(o.minSize=0,o.maxSize=0):(i.fit(),o.sizeHint=e.getSizeBasis(i.widget),o.stretch=e.getStretch(i.widget),r?(o.minSize=i.minWidth,o.maxSize=i.maxWidth,n+=i.minWidth,a=Math.max(a,i.minHeight)):(o.minSize=i.minHeight,o.maxSize=i.maxHeight,a+=i.minHeight,n=Math.max(n,i.minWidth)))}let o=this._box=i.boxSizing(this.parent.node);n+=o.horizontalSum,a+=o.verticalSum;let s=this.parent.node.style;s.minWidth=`${n}px`,s.minHeight=`${a}px`,this._dirty=!0,this.parent.parent&&M.sendMessage(this.parent.parent,ne.Msg.FitRequest),this._dirty&&M.sendMessage(this.parent,ne.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let r=0;for(let e=0,t=this._items.length;e<t;++e)r+=+!this._items[e].isHidden;if(0===r)return;e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=i.boxSizing(this.parent.node));let n,a=this._box.paddingTop,o=this._box.paddingLeft,s=e-this._box.horizontalSum,l=t-this._box.verticalSum;switch(this._direction){case"left-to-right":n=Q.calc(this._sizers,Math.max(0,s-this._fixed));break;case"top-to-bottom":n=Q.calc(this._sizers,Math.max(0,l-this._fixed));break;case"right-to-left":n=Q.calc(this._sizers,Math.max(0,s-this._fixed)),o+=s;break;case"bottom-to-top":n=Q.calc(this._sizers,Math.max(0,l-this._fixed)),a+=l;break;default:throw"unreachable"}let c=0,u=0;if(n>0)switch(this._alignment){case"start":break;case"center":c=0,u=n/2;break;case"end":c=0,u=n;break;case"justify":c=n/r,u=0;break;default:throw"unreachable"}for(let e=0,t=this._items.length;e<t;++e){let t=this._items[e];if(t.isHidden)continue;let r=this._sizers[e].size;switch(this._direction){case"left-to-right":t.update(o+u,a,r+c,l),o+=r+c+this._spacing;break;case"top-to-bottom":t.update(o,a+u,s,r+c),a+=r+c+this._spacing;break;case"right-to-left":t.update(o-u-r-c,a,r+c,l),o-=r+c+this._spacing;break;case"bottom-to-top":t.update(o,a-u-r-c,s,r+c),a-=r+c+this._spacing;break;default:throw"unreachable"}}}};!function(e){e.getStretch=function(e){return _e.stretchProperty.get(e)},e.setStretch=function(e,t){_e.stretchProperty.set(e,t)},e.getSizeBasis=function(e){return _e.sizeBasisProperty.get(e)},e.setSizeBasis=function(e,t){_e.sizeBasisProperty.set(e,t)}}(be||(be={})),function(e){function t(e){e.parent&&e.parent.layout instanceof be&&e.parent.fit()}e.stretchProperty=new I({name:"stretch",create:()=>0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:t}),e.sizeBasisProperty=new I({name:"sizeBasis",create:()=>0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:t}),e.isHorizontal=function(e){return"left-to-right"===e||"right-to-left"===e},e.clampSpacing=function(e){return Math.max(0,Math.floor(e))}}(_e||(_e={}));var we,Te=class extends me{constructor(e={}){super({layout:we.createLayout(e)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}};!function(e){e.getStretch=function(e){return be.getStretch(e)},e.setStretch=function(e,t){be.setStretch(e,t)},e.getSizeBasis=function(e){return be.getSizeBasis(e)},e.setSizeBasis=function(e,t){be.setSizeBasis(e,t)}}(Te||(Te={})),function(e){e.createLayout=function(e){return e.layout||new be(e)}}(we||(we={}));var ke,Ae=class e extends ne{constructor(t){super({node:ke.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(ne.Flag.DisallowLayout),this.commands=t.commands,this.renderer=t.renderer||e.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(e){let t=ke.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){let t=e.map((e=>ke.createItem(this.commands,e)));return t.forEach((e=>this._items.push(e))),this.refresh(),t}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){b.ArrayExt.removeAt(this._items,e)&&this.refresh()}clearItems(){0!==this._items.length&&(this._items.length=0,this.refresh())}refresh(){this._results=null,""!==this.inputNode.value?this.node.getElementsByClassName("lm-close-icon")[0].style.display="inherit":this.node.getElementsByClassName("lm-close-icon")[0].style.display="none",this.update()}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._evtKeyDown(e);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(e){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(e){this.update(),super.onAfterShow(e)}onActivateRequest(e){if(this.isAttached){let e=this.inputNode;e.focus(),e.select()}}onUpdateRequest(e){if(this.isHidden)return;let t=this.inputNode.value,r=this.contentNode,n=this._results;if(n||(n=this._results=ke.search(this._items,t),this._activeIndex=t?b.ArrayExt.findFirstIndex(n,ke.canActivate):-1),!t&&0===n.length)return void Z.render(null,r);if(t&&0===n.length){let e=this.renderer.renderEmptyMessage({query:t});return void Z.render(e,r)}let a=this.renderer,o=this._activeIndex,s=new Array(n.length);for(let e=0,t=n.length;e<t;++e){let t=n[e];if("header"===t.type){let r=t.indices,n=t.category;s[e]=a.renderHeader({category:n,indices:r})}else{let r=t.item,n=t.indices,i=e===o;s[e]=a.renderItem({item:r,indices:n,active:i})}}if(Z.render(s,r),o<0||o>=n.length)r.scrollTop=0;else{let e=r.children[o];i.scrollIntoViewIfNeeded(r,e)}}_evtClick(e){if(0!==e.button)return;if(e.target.classList.contains("lm-close-icon"))return this.inputNode.value="",void this.refresh();let t=b.ArrayExt.findFirstIndex(this.contentNode.children,(t=>t.contains(e.target)));-1!==t&&(e.preventDefault(),e.stopPropagation(),this._execute(t))}_evtKeyDown(e){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.keyCode){case 13:e.preventDefault(),e.stopPropagation(),this._execute(this._activeIndex);break;case 38:e.preventDefault(),e.stopPropagation(),this._activatePreviousItem();break;case 40:e.preventDefault(),e.stopPropagation(),this._activateNextItem()}}_activateNextItem(){if(!this._results||0===this._results.length)return;let e=this._activeIndex,t=this._results.length,r=e<t-1?e+1:0,n=0===r?t-1:r-1;this._activeIndex=b.ArrayExt.findFirstIndex(this._results,ke.canActivate,r,n),this.update()}_activatePreviousItem(){if(!this._results||0===this._results.length)return;let e=this._activeIndex,t=this._results.length,r=e<=0?t-1:e-1,n=r===t-1?0:r+1;this._activeIndex=b.ArrayExt.findLastIndex(this._results,ke.canActivate,r,n),this.update()}_execute(e){if(!this._results)return;let t=this._results[e];if(t){if("header"===t.type){let e=this.inputNode;return e.value=`${t.category.toLowerCase()} `,e.focus(),void this.refresh()}t.item.isEnabled&&(this.commands.execute(t.item.command,t.item.args),this.inputNode.value="",this.refresh())}}_toggleFocused(){let e=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",e)}_onGenericChange(){this.refresh()}};!function(e){class t{renderHeader(e){let t=this.formatHeader(e);return J.li({className:"lm-CommandPalette-header"},t)}renderItem(e){let t=this.createItemClass(e),r=this.createItemDataset(e);return e.item.isToggleable?J.li({className:t,dataset:r,role:"menuitemcheckbox","aria-checked":`${e.item.isToggled}`},this.renderItemIcon(e),this.renderItemContent(e),this.renderItemShortcut(e)):J.li({className:t,dataset:r,role:"menuitem"},this.renderItemIcon(e),this.renderItemContent(e),this.renderItemShortcut(e))}renderEmptyMessage(e){let t=this.formatEmptyMessage(e);return J.li({className:"lm-CommandPalette-emptyMessage"},t)}renderItemIcon(e){let t=this.createIconClass(e);return J.div({className:t},e.item.icon,e.item.iconLabel)}renderItemContent(e){return J.div({className:"lm-CommandPalette-itemContent"},this.renderItemLabel(e),this.renderItemCaption(e))}renderItemLabel(e){let t=this.formatItemLabel(e);return J.div({className:"lm-CommandPalette-itemLabel"},t)}renderItemCaption(e){let t=this.formatItemCaption(e);return J.div({className:"lm-CommandPalette-itemCaption"},t)}renderItemShortcut(e){let t=this.formatItemShortcut(e);return J.div({className:"lm-CommandPalette-itemShortcut"},t)}createItemClass(e){let t="lm-CommandPalette-item";e.item.isEnabled||(t+=" lm-mod-disabled"),e.item.isToggled&&(t+=" lm-mod-toggled"),e.active&&(t+=" lm-mod-active");let r=e.item.className;return r&&(t+=` ${r}`),t}createItemDataset(e){return{...e.item.dataset,command:e.item.command}}createIconClass(e){let t="lm-CommandPalette-itemIcon",r=e.item.iconClass;return r?`${t} ${r}`:t}formatHeader(e){return e.indices&&0!==e.indices.length?b.StringExt.highlight(e.category,e.indices,J.mark):e.category}formatEmptyMessage(e){return`No commands found that match '${e.query}'`}formatItemShortcut(e){let t=e.item.keyBinding;return t?W.formatKeystroke(t.keys):null}formatItemLabel(e){return e.indices&&0!==e.indices.length?b.StringExt.highlight(e.item.label,e.indices,J.mark):e.item.label}formatItemCaption(e){return e.item.caption}}e.Renderer=t,e.defaultRenderer=new t}(Ae||(Ae={})),function(e){function t(e,t){let r=e.category.toLowerCase(),n=`${r} ${e.label.toLowerCase()}`,i=1/0,a=null,o=/\b\w/g;for(;;){let e=o.exec(n);if(!e)break;let r=b.StringExt.matchSumOfDeltas(n,t,e.index);if(!r)break;r.score<=i&&(i=r.score,a=r.indices)}if(!a||i===1/0)return null;let s=r.length+1,l=b.ArrayExt.lowerBound(a,s,((e,t)=>e-t)),c=a.slice(0,l),u=a.slice(l);for(let e=0,t=u.length;e<t;++e)u[e]-=s;return 0===c.length?{matchType:0,categoryIndices:null,labelIndices:u,score:i,item:e}:0===u.length?{matchType:1,categoryIndices:c,labelIndices:null,score:i,item:e}:{matchType:2,categoryIndices:c,labelIndices:u,score:i,item:e}}function r(e,t){let r=e.matchType-t.matchType;if(0!==r)return r;let n=e.score-t.score;if(0!==n)return n;let i=0,a=0;switch(e.matchType){case 0:i=e.labelIndices[0],a=t.labelIndices[0];break;case 1:case 2:i=e.categoryIndices[0],a=t.categoryIndices[0]}if(i!==a)return i-a;let o=e.item.category.localeCompare(t.item.category);if(0!==o)return o;let s=e.item.rank,l=t.item.rank;return s!==l?s<l?-1:1:e.item.label.localeCompare(t.item.label)}e.createNode=function(){let e=document.createElement("div"),t=document.createElement("div"),r=document.createElement("div"),n=document.createElement("input"),i=document.createElement("ul"),a=document.createElement("button");return t.className="lm-CommandPalette-search",r.className="lm-CommandPalette-wrapper",n.className="lm-CommandPalette-input",a.className="lm-close-icon",i.className="lm-CommandPalette-content",i.setAttribute("role","menu"),n.spellcheck=!1,r.appendChild(n),r.appendChild(a),t.appendChild(r),e.appendChild(t),e.appendChild(i),e},e.createItem=function(e,t){return new n(e,t)},e.search=function(e,n){let i=function(e,r){r=function(e){return e.replace(/\s+/g,"").toLowerCase()}(r);let n=[];for(let i=0,a=e.length;i<a;++i){let a=e[i];if(!a.isVisible)continue;if(!r){n.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:a});continue}let o=t(a,r);o&&(a.isEnabled||(o.score+=1e3),n.push(o))}return n}(e,n);return i.sort(r),function(e){let t=[];for(let r=0,n=e.length;r<n;++r){let{item:n,categoryIndices:i,labelIndices:a}=e[r],o=n.category;(0===r||o!==e[r-1].item.category)&&t.push({type:"header",category:o,indices:i}),t.push({type:"item",item:n,indices:a})}return t}(i)},e.canActivate=function(e){return"item"===e.type&&e.item.isEnabled};class n{constructor(e,t){this._commands=e,this.category=t.category.trim().replace(/\s+/g," "),this.command=t.command,this.args=t.args||w.JSONExt.emptyObject,this.rank=void 0!==t.rank?t.rank:1/0}get label(){return this._commands.label(this.command,this.args)}get icon(){return this._commands.icon(this.command,this.args)}get iconClass(){return this._commands.iconClass(this.command,this.args)}get iconLabel(){return this._commands.iconLabel(this.command,this.args)}get caption(){return this._commands.caption(this.command,this.args)}get className(){return this._commands.className(this.command,this.args)}get dataset(){return this._commands.dataset(this.command,this.args)}get isEnabled(){return this._commands.isEnabled(this.command,this.args)}get isToggled(){return this._commands.isToggled(this.command,this.args)}get isToggleable(){return this._commands.isToggleable(this.command,this.args)}get isVisible(){return this._commands.isVisible(this.command,this.args)}get keyBinding(){let{command:e,args:t}=this;return b.ArrayExt.findLastValue(this._commands.keyBindings,(r=>r.command===e&&w.JSONExt.deepEqual(r.args,t)))||null}}}(ke||(ke={}));var Me,Se,Ee=class e extends ne{constructor(t){super({node:Me.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new z(this),this._menuRequested=new z(this),this.addClass("lm-Menu"),this.setFlag(ne.Flag.DisallowLayout),this.commands=t.commands,this.renderer=t.renderer||e.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let e=this;for(;e._parentMenu;)e=e._parentMenu;return e}get leafMenu(){let e=this;for(;e._childMenu;)e=e._childMenu;return e}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._items.length)&&(e=-1),-1!==e&&!Me.canActivate(this._items[e])&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let e=this._items.length,t=this._activeIndex,r=t<e-1?t+1:0,n=0===r?e-1:r-1;this.activeIndex=b.ArrayExt.findFirstIndex(this._items,Me.canActivate,r,n)}activatePreviousItem(){let e=this._items.length,t=this._activeIndex,r=t<=0?e-1:t-1,n=r===e-1?0:r+1;this.activeIndex=b.ArrayExt.findLastIndex(this._items,Me.canActivate,r,n)}triggerActiveItem(){if(!this.isAttached)return;let e=this.activeItem;if(!e)return;if(this._cancelOpenTimer(),this._cancelCloseTimer(),"submenu"===e.type)return void this._openChildMenu(!0);this.rootMenu.close();let{command:t,args:r}=e;this.commands.isEnabled(t,r)?this.commands.execute(t,r):console.log(`Command '${t}' is disabled.`)}addItem(e){return this.insertItem(this._items.length,e)}insertItem(e,t){this.isAttached&&this.close(),this.activeIndex=-1;let r=Math.max(0,Math.min(e,this._items.length)),n=Me.createItem(this,t);return b.ArrayExt.insert(this._items,r,n),this.update(),n}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){this.isAttached&&this.close(),this.activeIndex=-1,b.ArrayExt.removeAt(this._items,e)&&this.update()}clearItems(){this.isAttached&&this.close(),this.activeIndex=-1,0!==this._items.length&&(this._items.length=0,this.update())}open(e,t,r={}){var n,i;if(this.isAttached)return;let a=r.forceX||!1,o=r.forceY||!1,s=null!==(n=r.host)&&void 0!==n?n:null,l=null!==(i=r.ref)&&void 0!==i?i:null;Me.openRootMenu(this,e,t,a,o,s,l),this.activate()}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mouseup":this._evtMouseUp(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseenter":this._evtMouseEnter(e);break;case"mouseleave":this._evtMouseLeave(e);break;case"mousedown":this._evtMouseDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,!0)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)}onActivateRequest(e){this.isAttached&&this.node.focus()}onUpdateRequest(e){let t=this._items,r=this.renderer,n=this._activeIndex,i=Me.computeCollapsed(t),a=new Array(t.length);for(let e=0,o=t.length;e<o;++e){let o=t[e],s=e===n,l=i[e];a[e]=r.renderItem({item:o,active:s,collapsed:l,onfocus:()=>{this.activeIndex=e}})}Z.render(a,this.contentNode)}onCloseRequest(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let t=this._childMenu;t&&(this._childIndex=-1,this._childMenu=null,t._parentMenu=null,t.close());let r=this._parentMenu;r&&(this._parentMenu=null,r._childIndex=-1,r._childMenu=null,r.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(e)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation();let t=e.keyCode;if(13===t)return void this.triggerActiveItem();if(27===t)return void this.close();if(37===t)return void(this._parentMenu?this.close():this._menuRequested.emit("previous"));if(38===t)return void this.activatePreviousItem();if(39===t){let e=this.activeItem;return void(e&&"submenu"===e.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next"))}if(40===t)return void this.activateNextItem();let r=U().keyForKeydownEvent(e);if(!r)return;let n=this._activeIndex+1,i=Me.findMnemonic(this._items,r,n);-1===i.index||i.multiple?-1!==i.index?this.activeIndex=i.index:-1!==i.auto&&(this.activeIndex=i.auto):(this.activeIndex=i.index,this.triggerActiveItem())}_evtMouseUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(e){let t=b.ArrayExt.findFirstIndex(this.contentNode.children,(t=>i.hitTest(t,e.clientX,e.clientY)));if(t===this._activeIndex)return;if(this.activeIndex=t,t=this.activeIndex,t===this._childIndex)return this._cancelOpenTimer(),void this._cancelCloseTimer();-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();let r=this.activeItem;!r||"submenu"!==r.type||!r.submenu||this._startOpenTimer()}_evtMouseEnter(e){for(let e=this._parentMenu;e;e=e._parentMenu)e._cancelOpenTimer(),e._cancelCloseTimer(),e.activeIndex=e._childIndex}_evtMouseLeave(e){if(this._cancelOpenTimer(),!this._childMenu)return void(this.activeIndex=-1);let{clientX:t,clientY:r}=e;i.hitTest(this._childMenu.node,t,r)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}_evtMouseDown(e){this._parentMenu||(Me.hitTestMenus(this,e.clientX,e.clientY)?(e.preventDefault(),e.stopPropagation()):this.close())}_openChildMenu(t=!1){let r=this.activeItem;if(!r||"submenu"!==r.type||!r.submenu)return void this._closeChildMenu();let n=r.submenu;if(n===this._childMenu)return;e.saveWindowData(),this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,M.sendMessage(this,ne.Msg.UpdateRequest);let i=this.contentNode.children[this._activeIndex];Me.openSubmenu(n,i),t&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){0===this._openTimerID&&(this._openTimerID=window.setTimeout((()=>{this._openTimerID=0,this._openChildMenu()}),Me.TIMER_DELAY))}_startCloseTimer(){0===this._closeTimerID&&(this._closeTimerID=window.setTimeout((()=>{this._closeTimerID=0,this._closeChildMenu()}),Me.TIMER_DELAY))}_cancelOpenTimer(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){Me.saveWindowData()}};!function(e){class t{renderItem(e){let t=this.createItemClass(e),r=this.createItemDataset(e),n=this.createItemARIA(e);return J.li({className:t,dataset:r,tabindex:"0",onfocus:e.onfocus,...n},this.renderIcon(e),this.renderLabel(e),this.renderShortcut(e),this.renderSubmenu(e))}renderIcon(e){let t=this.createIconClass(e);return J.div({className:t},e.item.icon,e.item.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return J.div({className:"lm-Menu-itemLabel"},t)}renderShortcut(e){let t=this.formatShortcut(e);return J.div({className:"lm-Menu-itemShortcut"},t)}renderSubmenu(e){return J.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(e){let t="lm-Menu-item";e.item.isEnabled||(t+=" lm-mod-disabled"),e.item.isToggled&&(t+=" lm-mod-toggled"),e.item.isVisible||(t+=" lm-mod-hidden"),e.active&&(t+=" lm-mod-active"),e.collapsed&&(t+=" lm-mod-collapsed");let r=e.item.className;return r&&(t+=` ${r}`),t}createItemDataset(e){let t,{type:r,command:n,dataset:i}=e.item;return t="command"===r?{...i,type:r,command:n}:{...i,type:r},t}createIconClass(e){let t="lm-Menu-itemIcon",r=e.item.iconClass;return r?`${t} ${r}`:t}createItemARIA(e){let t={};switch(e.item.type){case"separator":t.role="presentation";break;case"submenu":t["aria-haspopup"]="true",e.item.isEnabled||(t["aria-disabled"]="true");break;default:e.item.isEnabled||(t["aria-disabled"]="true"),t.role="menuitem"}return t}formatLabel(e){let{label:t,mnemonic:r}=e.item;if(r<0||r>=t.length)return t;let n=t.slice(0,r),i=t.slice(r+1),a=t[r];return[n,J.span({className:"lm-Menu-itemMnemonic"},a),i]}formatShortcut(e){let t=e.item.keyBinding;return t?W.formatKeystroke(t.keys):null}}e.Renderer=t,e.defaultRenderer=new t}(Ee||(Ee={})),function(e){e.TIMER_DELAY=300,e.SUBMENU_OVERLAP=3;let t=null,r=0;function n(){return r>0?(r--,t):o()}function a(e){return"separator"!==e.type&&e.isEnabled&&e.isVisible}function o(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}e.saveWindowData=function(){t=o(),r++},e.createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-Menu-content",e.appendChild(t),t.setAttribute("role","menu"),e.tabIndex=0,e},e.canActivate=a,e.createItem=function(e,t){return new s(e.commands,t)},e.hitTestMenus=function(e,t,r){for(let n=e;n;n=n.childMenu)if(i.hitTest(n.node,t,r))return!0;return!1},e.computeCollapsed=function(e){let t=new Array(e.length);b.ArrayExt.fill(t,!1);let r=0,n=e.length;for(;r<n;++r){let n=e[r];if(n.isVisible){if("separator"!==n.type)break;t[r]=!0}}let i=n-1;for(;i>=0;--i){let r=e[i];if(r.isVisible){if("separator"!==r.type)break;t[i]=!0}}let a=!1;for(;++r<i;){let n=e[r];n.isVisible&&("separator"!==n.type?a=!1:a?t[r]=!0:a=!0)}return t},e.openRootMenu=function(e,t,r,i,a,o,s){let l=n(),c=l.pageXOffset,u=l.pageYOffset,h=l.clientWidth,f=l.clientHeight;M.sendMessage(e,ne.Msg.UpdateRequest);let p=f-(a?r:0),d=e.node,m=d.style;m.opacity="0",m.maxHeight=`${p}px`,ne.attach(e,o||document.body,s);let{width:g,height:y}=d.getBoundingClientRect();!i&&t+g>c+h&&(t=c+h-g),!a&&r+y>u+f&&(r>u+f?r=u+f-y:r-=y),m.transform=`translate(${Math.max(0,t)}px, ${Math.max(0,r)}px`,m.opacity="1"},e.openSubmenu=function(t,r){let a=n(),o=a.pageXOffset,s=a.pageYOffset,l=a.clientWidth,c=a.clientHeight;M.sendMessage(t,ne.Msg.UpdateRequest);let u=c,h=t.node,f=h.style;f.opacity="0",f.maxHeight=`${u}px`,ne.attach(t,document.body);let{width:p,height:d}=h.getBoundingClientRect(),m=i.boxSizing(t.node),g=r.getBoundingClientRect(),y=g.right-e.SUBMENU_OVERLAP;y+p>o+l&&(y=g.left+e.SUBMENU_OVERLAP-p);let v=g.top-m.borderTop-m.paddingTop;v+d>s+c&&(v=g.bottom+m.borderBottom+m.paddingBottom-d),f.transform=`translate(${Math.max(0,y)}px, ${Math.max(0,v)}px`,f.opacity="1"},e.findMnemonic=function(e,t,r){let n=-1,i=-1,o=!1,s=t.toUpperCase();for(let t=0,l=e.length;t<l;++t){let c=(t+r)%l,u=e[c];if(!a(u))continue;let h=u.label;if(0===h.length)continue;let f=u.mnemonic;f>=0&&f<h.length?h[f].toUpperCase()===s&&(-1===n?n=c:o=!0):-1===i&&h[0].toUpperCase()===s&&(i=c)}return{index:n,multiple:o,auto:i}};class s{constructor(e,t){this._commands=e,this.type=t.type||"command",this.command=t.command||"",this.args=t.args||w.JSONExt.emptyObject,this.submenu=t.submenu||null}get label(){return"command"===this.type?this._commands.label(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.label:""}get mnemonic(){return"command"===this.type?this._commands.mnemonic(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.mnemonic:-1}get icon(){return"command"===this.type?this._commands.icon(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.icon:void 0}get iconClass(){return"command"===this.type?this._commands.iconClass(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconClass:""}get iconLabel(){return"command"===this.type?this._commands.iconLabel(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconLabel:""}get caption(){return"command"===this.type?this._commands.caption(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.caption:""}get className(){return"command"===this.type?this._commands.className(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.className:""}get dataset(){return"command"===this.type?this._commands.dataset(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.dataset:{}}get isEnabled(){return"command"===this.type?this._commands.isEnabled(this.command,this.args):"submenu"!==this.type||null!==this.submenu}get isToggled(){return"command"===this.type&&this._commands.isToggled(this.command,this.args)}get isVisible(){return"command"===this.type?this._commands.isVisible(this.command,this.args):"submenu"!==this.type||null!==this.submenu}get keyBinding(){if("command"===this.type){let{command:e,args:t}=this;return b.ArrayExt.findLastValue(this._commands.keyBindings,(r=>r.command===e&&w.JSONExt.deepEqual(r.args,t)))||null}return null}}}(Me||(Me={})),function(e){function t(e,t){let r=e.rank,n=t.rank;return r!==n?r<n?-1:1:e.id-t.id}function r(e,r){let n=o.calculateSpecificity(e.selector),i=o.calculateSpecificity(r.selector);return n!==i?i-n:t(e,r)}e.createItem=function(e,t){let r=function(e){if(-1!==e.indexOf(","))throw new Error(`Selector cannot contain commas: ${e}`);if(!o.isValid(e))throw new Error(`Invalid selector: ${e}`);return e}(e.selector),n=void 0!==e.rank?e.rank:1/0;return{...e,selector:r,rank:n,id:t}},e.matchItems=function(e,n,i,a){let s=n.target;if(!s)return null;let l=n.currentTarget;if(!l||!l.contains(s)&&(s=document.elementFromPoint(n.clientX,n.clientY),!s||!l.contains(s)))return null;let c=[],u=e.slice();for(;null!==s;){let e=[];for(let t=0,r=u.length;t<r;++t){let r=u[t];r&&o.matches(s,r.selector)&&(e.push(r),u[t]=null)}if(0!==e.length&&(i&&e.sort(a?r:t),c.push(...e)),s===l)break;s=s.parentElement}return i||c.sort(a?r:t),c}}(Se||(Se={}));var Ce,Ie=["ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Home","End"],Le=class e extends ne{constructor(t={}){super({node:Ce.createNode()}),this._currentIndex=-1,this._titles=[],this._titlesEditable=!1,this._previousTitle=null,this._dragData=null,this._addButtonEnabled=!1,this._tabMoved=new z(this),this._currentChanged=new z(this),this._addRequested=new z(this),this._tabCloseRequested=new z(this),this._tabDetachRequested=new z(this),this._tabActivateRequested=new z(this),this.addClass("lm-TabBar"),this.contentNode.setAttribute("role","tablist"),this.setFlag(ne.Flag.DisallowLayout),this._document=t.document||document,this.tabsMovable=t.tabsMovable||!1,this.titlesEditable=t.titlesEditable||!1,this.allowDeselect=t.allowDeselect||!1,this.addButtonEnabled=t.addButtonEnabled||!1,this.insertBehavior=t.insertBehavior||"select-tab-if-needed",this.name=t.name||"",this.orientation=t.orientation||"horizontal",this.removeBehavior=t.removeBehavior||"select-tab-after",this.renderer=t.renderer||e.defaultRenderer}dispose(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,super.dispose()}get currentChanged(){return this._currentChanged}get tabMoved(){return this._tabMoved}get tabActivateRequested(){return this._tabActivateRequested}get addRequested(){return this._addRequested}get tabCloseRequested(){return this._tabCloseRequested}get tabDetachRequested(){return this._tabDetachRequested}get document(){return this._document}get titlesEditable(){return this._titlesEditable}set titlesEditable(e){this._titlesEditable=e}get currentTitle(){return this._titles[this._currentIndex]||null}set currentTitle(e){this.currentIndex=e?this._titles.indexOf(e):-1}get currentIndex(){return this._currentIndex}set currentIndex(e){if((e<0||e>=this._titles.length)&&(e=-1),this._currentIndex===e)return;let t=this._currentIndex,r=this._titles[t]||null,n=e,i=this._titles[n]||null;this._currentIndex=n,this._previousTitle=r,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:r,currentIndex:n,currentTitle:i})}get name(){return this._name}set name(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled!==e&&(this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();let r=Ce.asTitle(t),n=this._titles.indexOf(r),i=Math.max(0,Math.min(e,this._titles.length));return-1===n?(b.ArrayExt.insert(this._titles,i,r),r.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(i,r),r):(i===this._titles.length&&i--,n===i||(b.ArrayExt.move(this._titles,n,i),this.update(),this._adjustCurrentForMove(n,i)),r)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=b.ArrayExt.removeAt(this._titles,e);t&&(t.changed.disconnect(this._onTitleChanged,this),t===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(e,t))}clearTabs(){if(0===this._titles.length)return;this._releaseMouse();for(let e of this._titles)e.changed.disconnect(this._onTitleChanged,this);let e=this.currentIndex,t=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),-1!==e&&this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":e.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(e):this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(e){var t;let r=this._titles,n=this.renderer,i=this.currentTitle,a=new Array(r.length),o=null!==(t=this._getCurrentTabindex())&&void 0!==t?t:this._currentIndex>-1?this._currentIndex:0;for(let e=0,t=r.length;e<t;++e){let s=r[e],l=s===i,c=l?t:t-e-1,u=o===e?0:-1;a[e]=n.renderTab({title:s,current:l,zIndex:c,tabIndex:u})}Z.render(a,this.contentNode)}_getCurrentTabindex(){let e=null,t=this.contentNode.querySelector('li[tabindex="0"]');return t?e=[...this.contentNode.children].indexOf(t):this._addButtonEnabled&&"0"===this.addButtonNode.getAttribute("tabindex")&&(e=-1),e}_evtDblClick(e){if(!this.titlesEditable)return;let t=this.contentNode.children,r=b.ArrayExt.findFirstIndex(t,(t=>i.hitTest(t,e.clientX,e.clientY)));if(-1===r)return;let n=this.titles[r],a=t[r].querySelector(".lm-TabBar-tabLabel");if(a&&a.contains(e.target)){let e=n.label||"",t=a.innerHTML;a.innerHTML="";let r=document.createElement("input");r.classList.add("lm-TabBar-tabInput"),r.value=e,a.appendChild(r);let i=()=>{r.removeEventListener("blur",i),a.innerHTML=t,this.node.addEventListener("keydown",this)};r.addEventListener("dblclick",(e=>e.stopPropagation())),r.addEventListener("blur",i),r.addEventListener("keydown",(e=>{"Enter"===e.key?(""!==r.value&&(n.label=n.caption=r.value),i()):"Escape"===e.key&&i()})),this.node.removeEventListener("keydown",this),r.select(),r.focus(),a.children.length>0&&a.children[0].focus()}}_evtKeyDownCapturing(e){e.eventPhase===Event.CAPTURING_PHASE&&(e.preventDefault(),e.stopPropagation(),"Escape"===e.key&&this._releaseMouse())}_evtKeyDown(e){var t,r,n;if("Tab"!==e.key&&e.eventPhase!==Event.CAPTURING_PHASE)if("Enter"===e.key||"Spacebar"===e.key||" "===e.key){let t=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(t))e.preventDefault(),e.stopPropagation(),this._addRequested.emit();else{let r=b.ArrayExt.findFirstIndex(this.contentNode.children,(e=>e.contains(t)));r>=0&&(e.preventDefault(),e.stopPropagation(),this.currentIndex=r)}}else if(Ie.includes(e.key)){let i=[...this.contentNode.children];if(this.addButtonEnabled&&i.push(this.addButtonNode),i.length<=1)return;e.preventDefault(),e.stopPropagation();let a,o=i.indexOf(document.activeElement);-1===o&&(o=this._currentIndex),"ArrowRight"===e.key&&"horizontal"===this._orientation||"ArrowDown"===e.key&&"vertical"===this._orientation?a=null!==(t=i[o+1])&&void 0!==t?t:i[0]:"ArrowLeft"===e.key&&"horizontal"===this._orientation||"ArrowUp"===e.key&&"vertical"===this._orientation?a=null!==(r=i[o-1])&&void 0!==r?r:i[i.length-1]:"Home"===e.key?a=i[0]:"End"===e.key&&(a=i[i.length-1]),a&&(null===(n=i[o])||void 0===n||n.setAttribute("tabindex","-1"),a?.setAttribute("tabindex","0"),a.focus())}}_evtPointerDown(e){if(0!==e.button&&1!==e.button||this._dragData||e.target.classList.contains("lm-TabBar-tabInput"))return;let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),r=this.contentNode.children,n=b.ArrayExt.findFirstIndex(r,(t=>i.hitTest(t,e.clientX,e.clientY)));if(-1===n&&!t||(e.preventDefault(),e.stopPropagation(),this._dragData={tab:r[n],index:n,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),1===e.button||t))return;let a=r[n].querySelector(this.renderer.closeIconSelector);a&&a.contains(e.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===n?this.currentIndex=-1:this.currentIndex=n,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(e){let t=this._dragData;if(!t)return;e.preventDefault(),e.stopPropagation();let r=this.contentNode.children;if(t.dragActive||Ce.dragExceeded(t,e)){if(!t.dragActive){let e=t.tab.getBoundingClientRect();"horizontal"===this._orientation?(t.tabPos=t.tab.offsetLeft,t.tabSize=e.width,t.tabPressPos=t.pressX-e.left):(t.tabPos=t.tab.offsetTop,t.tabSize=e.height,t.tabPressPos=t.pressY-e.top),t.tabPressOffset={x:t.pressX-e.left,y:t.pressY-e.top},t.tabLayout=Ce.snapTabLayout(r,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=B.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&Ce.detachExceeded(t,e)){t.detachRequested=!0;let n=t.index,i=e.clientX,a=e.clientY,o=r[n],s=this._titles[n];if(this._tabDetachRequested.emit({index:n,title:s,tab:o,clientX:i,clientY:a,offset:t.tabPressOffset}),t.dragAborted)return}Ce.layoutTabs(r,t,e,this._orientation)}}_evtPointerUp(e){if(0!==e.button&&1!==e.button)return;let t=this._dragData;if(!t)return;if(e.preventDefault(),e.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!t.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(e.target))return void this._addRequested.emit(void 0);let r=this.contentNode.children,n=b.ArrayExt.findFirstIndex(r,(t=>i.hitTest(t,e.clientX,e.clientY)));if(n!==t.index)return;let a=this._titles[n];if(!a.closable)return;if(1===e.button)return void this._tabCloseRequested.emit({index:n,title:a});let o=r[n].querySelector(this.renderer.closeIconSelector);return o&&o.contains(e.target)?void this._tabCloseRequested.emit({index:n,title:a}):void 0}if(0!==e.button)return;Ce.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let r=Ce.parseTransitionDuration(t.tab);setTimeout((()=>{if(t.dragAborted)return;this._dragData=null,Ce.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let e=t.index,r=t.targetIndex;-1===r||e===r||(b.ArrayExt.move(this._titles,e,r),this._adjustCurrentForMove(e,r),this._tabMoved.emit({fromIndex:e,toIndex:r,title:this._titles[r]}),M.sendMessage(this,ne.Msg.UpdateRequest))}),r)}_releaseMouse(){let e=this._dragData;e&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,e.dragActive&&(Ce.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(e,t){let r=this.currentTitle,n=this._currentIndex,i=this.insertBehavior;if("select-tab"===i||"select-tab-if-needed"===i&&-1===n)return this._currentIndex=e,this._previousTitle=r,void this._currentChanged.emit({previousIndex:n,previousTitle:r,currentIndex:e,currentTitle:t});n>=e&&this._currentIndex++}_adjustCurrentForMove(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex<e&&this._currentIndex>=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--}_adjustCurrentForRemove(e,t){let r=this._currentIndex,n=this.removeBehavior;if(r===e)return 0===this._titles.length?(this._currentIndex=-1,void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})):"select-tab-after"===n?(this._currentIndex=Math.min(e,this._titles.length-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle})):"select-tab-before"===n?(this._currentIndex=Math.max(0,e-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle})):"select-previous-tab"===n?(this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle})):(this._currentIndex=-1,void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null}));r>e&&this._currentIndex--}_onTitleChanged(e){this.update()}};!function(e){class t{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++t._nInstance}renderTab(e){let t=e.title.caption,r=this.createTabKey(e),n=r,i=this.createTabStyle(e),a=this.createTabClass(e),o=this.createTabDataset(e),s=this.createTabARIA(e);return e.title.closable?J.li({id:n,key:r,className:a,title:t,style:i,dataset:o,...s},this.renderIcon(e),this.renderLabel(e),this.renderCloseIcon(e)):J.li({id:n,key:r,className:a,title:t,style:i,dataset:o,...s},this.renderIcon(e),this.renderLabel(e))}renderIcon(e){let{title:t}=e,r=this.createIconClass(e);return J.div({className:r},t.icon,t.iconLabel)}renderLabel(e){return J.div({className:"lm-TabBar-tabLabel"},e.title.label)}renderCloseIcon(e){return J.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(e){let t=this._tabKeys.get(e.title);return void 0===t&&(t=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(e.title,t)),t}createTabStyle(e){return{zIndex:`${e.zIndex}`}}createTabClass(e){let t="lm-TabBar-tab";return e.title.className&&(t+=` ${e.title.className}`),e.title.closable&&(t+=" lm-mod-closable"),e.current&&(t+=" lm-mod-current"),t}createTabDataset(e){return e.title.dataset}createTabARIA(e){var t;return{role:"tab","aria-selected":e.current.toString(),tabindex:`${null!==(t=e.tabIndex)&&void 0!==t?t:"-1"}`}}createIconClass(e){let t="lm-TabBar-tabIcon",r=e.title.iconClass;return r?`${t} ${r}`:t}}t._nInstance=0,e.Renderer=t,e.defaultRenderer=new t,e.addButtonSelector=".lm-TabBar-addButton"}(Le||(Le={})),function(e){e.DRAG_THRESHOLD=5,e.DETACH_THRESHOLD=20,e.createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");t.setAttribute("role","tablist"),t.className="lm-TabBar-content",e.appendChild(t);let r=document.createElement("div");return r.className="lm-TabBar-addButton lm-mod-hidden",r.setAttribute("tabindex","-1"),r.setAttribute("role","button"),e.appendChild(r),e},e.asTitle=function(e){return e instanceof re?e:new re(e)},e.parseTransitionDuration=function(e){let t=window.getComputedStyle(e);return 1e3*(parseFloat(t.transitionDuration)||0)},e.snapTabLayout=function(e,t){let r=new Array(e.length);for(let n=0,i=e.length;n<i;++n){let i=e[n],a=window.getComputedStyle(i);r[n]="horizontal"===t?{pos:i.offsetLeft,size:i.offsetWidth,margin:parseFloat(a.marginLeft)||0}:{pos:i.offsetTop,size:i.offsetHeight,margin:parseFloat(a.marginTop)||0}}return r},e.dragExceeded=function(t,r){let n=Math.abs(r.clientX-t.pressX),i=Math.abs(r.clientY-t.pressY);return n>=e.DRAG_THRESHOLD||i>=e.DRAG_THRESHOLD},e.detachExceeded=function(t,r){let n=t.contentRect;return r.clientX<n.left-e.DETACH_THRESHOLD||r.clientX>=n.right+e.DETACH_THRESHOLD||r.clientY<n.top-e.DETACH_THRESHOLD||r.clientY>=n.bottom+e.DETACH_THRESHOLD},e.layoutTabs=function(e,t,r,n){let i,a,o,s;"horizontal"===n?(i=t.pressX,a=r.clientX-t.contentRect.left,o=r.clientX,s=t.contentRect.width):(i=t.pressY,a=r.clientY-t.contentRect.top,o=r.clientY,s=t.contentRect.height);let l=t.index,c=a-t.tabPressPos,u=c+t.tabSize;for(let r=0,a=e.length;r<a;++r){let a,h=t.tabLayout[r],f=h.pos+(h.size>>1);if(r<t.index&&c<f)a=`${t.tabSize+t.tabLayout[r+1].margin}px`,l=Math.min(l,r);else if(r>t.index&&u>f)a=-t.tabSize-h.margin+"px",l=Math.max(l,r);else if(r===t.index){let e=o-i,r=s-(t.tabPos+t.tabSize);a=`${Math.max(-t.tabPos,Math.min(e,r))}px`}else a="";"horizontal"===n?e[r].style.left=a:e[r].style.top=a}t.targetIndex=l},e.finalizeTabPosition=function(e,t){let r,n;if(r="horizontal"===t?e.contentRect.width:e.contentRect.height,e.targetIndex===e.index)n=0;else if(e.targetIndex>e.index){let t=e.tabLayout[e.targetIndex];n=t.pos+t.size-e.tabSize-e.tabPos}else n=e.tabLayout[e.targetIndex].pos-e.tabPos;let i=r-(e.tabPos+e.tabSize),a=Math.max(-e.tabPos,Math.min(n,i));"horizontal"===t?e.tab.style.left=`${a}px`:e.tab.style.top=`${a}px`},e.resetTabPositions=function(e,t){for(let r of e)"horizontal"===t?r.style.left="":r.style.top=""}}(Ce||(Ce={}));var Pe,ze=class extends ie{constructor(e){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=e.renderer,void 0!==e.spacing&&(this._spacing=ue.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:ne.HiddenMode.Display}dispose(){let e=this[Symbol.iterator]();this._items.forEach((e=>{e.dispose()})),this._box=null,this._root=null,this._items.clear();for(let t of e)t.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e){this._hiddenMode=e;for(let e of this.tabBars())if(e.titles.length>1)for(let t of e.titles)t.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(e){e=ue.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get isEmpty(){return null===this._root}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():(0,b.empty)()}widgets(){return this._root?this._root.iterUserWidgets():(0,b.empty)()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():(0,b.empty)()}tabBars(){return this._root?this._root.iterTabBars():(0,b.empty)()}handles(){return this._root?this._root.iterHandles():(0,b.empty)()}moveHandle(e,t,r){let n=e.classList.contains("lm-mod-hidden");if(!this._root||n)return;let i,a=this._root.findSplitNode(e);a&&(i="horizontal"===a.node.orientation?t-e.offsetLeft:r-e.offsetTop,0!==i&&(a.node.holdSizes(),Q.adjust(a.node.sizers,a.index,i),this.parent&&this.parent.update()))}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(e){let t,r=new Set;t=e.main?Pe.normalizeAreaConfig(e.main,r):null;let n=this.widgets(),i=this.tabBars(),a=this.handles();this._root=null;for(let e of n)r.has(e)||(e.parent=null);for(let e of i)e.dispose();for(let e of a)e.parentNode&&e.parentNode.removeChild(e);for(let e of r)e.parent=this.parent;this._root=t?Pe.realizeAreaConfig(t,{createTabBar:e=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):null,this.parent&&(r.forEach((e=>{this.attachWidget(e)})),this.parent.fit())}addWidget(e,t={}){let r=t.ref||null,n=t.mode||"tab-after",i=null;if(this._root&&r&&(i=this._root.findTabNode(r)),r&&!i)throw new Error("Reference widget is not in the layout.");switch(e.parent=this.parent,n){case"tab-after":this._insertTab(e,r,i,!0);break;case"tab-before":this._insertTab(e,r,i,!1);break;case"split-top":this._insertSplit(e,r,i,"vertical",!1);break;case"split-left":this._insertSplit(e,r,i,"horizontal",!1);break;case"split-right":this._insertSplit(e,r,i,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,r,i,"vertical",!0);break;case"merge-top":this._insertSplit(e,r,i,"vertical",!1,!0);break;case"merge-left":this._insertSplit(e,r,i,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(e,r,i,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(e,r,i,"vertical",!0,!0)}this.parent&&(this.attachWidget(e),this.parent.fit())}removeWidget(e){this._removeWidget(e),this.parent&&(this.detachWidget(e),this.parent.fit())}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=i.boxSizing(this.parent.node));let r=this.parent.node.getBoundingClientRect(),n=e-r.left-this._box.borderLeft,a=t-r.top-this._box.borderTop,o=this._root.hitTestTabNodes(n,a);if(!o)return null;let{tabBar:s,top:l,left:c,width:u,height:h}=o,f=this._box.borderLeft+this._box.borderRight,p=this._box.borderTop+this._box.borderBottom;return{tabBar:s,x:n,y:a,top:l,left:c,right:r.width-f-(c+u),bottom:r.height-p-(l+h),width:u,height:h}}init(){super.init();for(let e of this)this.attachWidget(e);for(let e of this.handles())this.parent.node.appendChild(e);this.parent.fit()}attachWidget(e){this.parent.node!==e.node.parentNode&&(this._items.set(e,new oe(e)),this.parent.isAttached&&M.sendMessage(e,ne.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&M.sendMessage(e,ne.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&M.sendMessage(e,ne.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&M.sendMessage(e,ne.Msg.AfterDetach);let t=this._items.get(e);t&&(this._items.delete(e),t.dispose())}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_removeWidget(e){if(!this._root)return;let t=this._root.findTabNode(e);if(!t)return;if(Pe.removeAria(e),t.tabBar.titles.length>1)return t.tabBar.removeTab(e.title),void(this._hiddenMode===ne.HiddenMode.Scale&&1==t.tabBar.titles.length&&(t.tabBar.titles[0].owner.hiddenMode=ne.HiddenMode.Display));if(t.tabBar.dispose(),this._root===t)return void(this._root=null);this._root.holdAllSizes();let r=t.parent;t.parent=null;let n=b.ArrayExt.removeFirstOf(r.children,t),i=b.ArrayExt.removeAt(r.handles,n);if(b.ArrayExt.removeAt(r.sizers,n),i.parentNode&&i.parentNode.removeChild(i),r.children.length>1)return void r.syncHandles();let a=r.parent;r.parent=null;let o=r.children[0],s=r.handles[0];if(r.children.length=0,r.handles.length=0,r.sizers.length=0,s.parentNode&&s.parentNode.removeChild(s),this._root===r)return o.parent=null,void(this._root=o);let l=a,c=l.children.indexOf(r);if(o instanceof Pe.TabLayoutNode)return o.parent=l,void(l.children[c]=o);let u=b.ArrayExt.removeAt(l.handles,c);b.ArrayExt.removeAt(l.children,c),b.ArrayExt.removeAt(l.sizers,c),u.parentNode&&u.parentNode.removeChild(u);for(let e=0,t=o.children.length;e<t;++e){let t=o.children[e],r=o.handles[e],n=o.sizers[e];b.ArrayExt.insert(l.children,c+e,t),b.ArrayExt.insert(l.handles,c+e,r),b.ArrayExt.insert(l.sizers,c+e,n),t.parent=l}o.children.length=0,o.handles.length=0,o.sizers.length=0,o.parent=null,l.syncHandles()}_createTabNode(e){let t=new Pe.TabLayoutNode(this._createTabBar());return t.tabBar.addTab(e.title),Pe.addAria(e,t.tabBar),t}_insertTab(e,t,r,n){if(e===t)return;if(!this._root){let t=new Pe.TabLayoutNode(this._createTabBar());return t.tabBar.addTab(e.title),this._root=t,void Pe.addAria(e,t.tabBar)}let i;r||(r=this._root.findFirstTabNode()),-1===r.tabBar.titles.indexOf(e.title)&&(this._removeWidget(e),e.hide()),i=t?r.tabBar.titles.indexOf(t.title):r.tabBar.currentIndex,this._hiddenMode===ne.HiddenMode.Scale?0===r.tabBar.titles.length?e.hiddenMode=ne.HiddenMode.Display:1==r.tabBar.titles.length?r.tabBar.titles[0].owner.hiddenMode=ne.HiddenMode.Scale:e.hiddenMode=ne.HiddenMode.Scale:e.hiddenMode=this._hiddenMode,r.tabBar.insertTab(i+(n?1:0),e.title),Pe.addAria(e,r.tabBar)}_insertSplit(e,t,r,n,i,a=!1){if(e===t&&r&&1===r.tabBar.titles.length)return;if(this._removeWidget(e),!this._root)return void(this._root=this._createTabNode(e));if(!r||!r.parent){let t=this._splitRoot(n),a=i?t.children.length:0;t.normalizeSizes();let o=Pe.createSizer(r?1:Pe.GOLDEN_RATIO),s=this._createTabNode(e);return b.ArrayExt.insert(t.children,a,s),b.ArrayExt.insert(t.sizers,a,o),b.ArrayExt.insert(t.handles,a,this._createHandle()),s.parent=t,t.normalizeSizes(),void t.syncHandles()}let o=r.parent;if(o.orientation===n){let t=o.children.indexOf(r);if(a){let r=t+(i?1:-1),n=o.children[r];if(n instanceof Pe.TabLayoutNode)return this._insertTab(e,null,n,!0),void++n.tabBar.currentIndex}o.normalizeSizes();let n=o.sizers[t].sizeHint/=2,s=t+(i?1:0),l=this._createTabNode(e);return b.ArrayExt.insert(o.children,s,l),b.ArrayExt.insert(o.sizers,s,Pe.createSizer(n)),b.ArrayExt.insert(o.handles,s,this._createHandle()),l.parent=o,void o.syncHandles()}let s=b.ArrayExt.removeFirstOf(o.children,r),l=new Pe.SplitLayoutNode(n);l.normalized=!0,l.children.push(r),l.sizers.push(Pe.createSizer(.5)),l.handles.push(this._createHandle()),r.parent=l;let c=i?1:0,u=this._createTabNode(e);b.ArrayExt.insert(l.children,c,u),b.ArrayExt.insert(l.sizers,c,Pe.createSizer(.5)),b.ArrayExt.insert(l.handles,c,this._createHandle()),u.parent=l,l.syncHandles(),b.ArrayExt.insert(o.children,s,l),l.parent=o}_splitRoot(e){let t=this._root;if(t instanceof Pe.SplitLayoutNode&&t.orientation===e)return t;let r=this._root=new Pe.SplitLayoutNode(e);return t&&(r.children.push(t),r.sizers.push(Pe.createSizer(0)),r.handles.push(this._createHandle()),t.parent=r),r}_fit(){let e=0,t=0;if(this._root){let r=this._root.fit(this._spacing,this._items);e=r.minWidth,t=r.minHeight}let r=this._box=i.boxSizing(this.parent.node);e+=r.horizontalSum,t+=r.verticalSum;let n=this.parent.node.style;n.minWidth=`${e}px`,n.minHeight=`${t}px`,this._dirty=!0,this.parent.parent&&M.sendMessage(this.parent.parent,ne.Msg.FitRequest),this._dirty&&M.sendMessage(this.parent,ne.Msg.UpdateRequest)}_update(e,t){if(this._dirty=!1,!this._root)return;e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=i.boxSizing(this.parent.node));let r=this._box.paddingTop,n=this._box.paddingLeft,a=e-this._box.horizontalSum,o=t-this._box.verticalSum;this._root.update(r,n,a,o,this._spacing,this._items)}_createTabBar(){let e=this.renderer.createTabBar(this._document);return e.orientation="horizontal",this.parent&&this.attachWidget(e),e}_createHandle(){let e=this.renderer.createHandle(),t=e.style;return t.position="absolute",t.contain="strict",t.top="0",t.left="0",t.width="0",t.height="0",this.parent&&this.parent.node.appendChild(e),e}};!function(e){function t(e){let t=new ee;return t.sizeHint=e,t.size=e,t}e.GOLDEN_RATIO=.618,e.createSizer=t,e.normalizeAreaConfig=function e(t,r){let n;return n="tab-area"===t.type?function(e,t){if(0===e.widgets.length)return null;let r=[];for(let n of e.widgets)t.has(n)||(t.add(n),r.push(n));if(0===r.length)return null;let n=e.currentIndex;return-1!==n&&(n<0||n>=r.length)&&(n=0),{type:"tab-area",widgets:r,currentIndex:n}}(t,r):function(t,r){let n=t.orientation,i=[],a=[];for(let o=0,s=t.children.length;o<s;++o){let s=e(t.children[o],r);s&&("tab-area"===s.type||s.orientation!==n?(i.push(s),a.push(Math.abs(t.sizes[o]||0))):(i.push(...s.children),a.push(...s.sizes)))}return 0===i.length?null:1===i.length?i[0]:{type:"split-area",orientation:n,children:i,sizes:a}}(t,r),n},e.realizeAreaConfig=function i(a,o,s){let l;return l="tab-area"===a.type?function(t,n,i){let a=n.createTabBar(i);for(let r of t.widgets)r.hide(),a.addTab(r.title),e.addAria(r,a);return a.currentIndex=t.currentIndex,new r(a)}(a,o,s):function(e,r,a){let o=new n(e.orientation);return e.children.forEach(((n,s)=>{let l=i(n,r,a),c=t(e.sizes[s]),u=r.createHandle();o.children.push(l),o.handles.push(u),o.sizers.push(c),l.parent=o})),o.syncHandles(),o.normalizeSizes(),o}(a,o,s),l};class r{constructor(e){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;let t=new ee,r=new ee;t.stretch=0,r.stretch=1,this.tabBar=e,this.sizers=[t,r]}get top(){return this._top}get left(){return this._left}get width(){return this._width}get height(){return this._height}*iterAllWidgets(){yield this.tabBar,yield*this.iterUserWidgets()}*iterUserWidgets(){for(let e of this.tabBar.titles)yield e.owner}*iterSelectedWidgets(){let e=this.tabBar.currentTitle;e&&(yield e.owner)}*iterTabBars(){yield this.tabBar}*iterHandles(){}findTabNode(e){return-1!==this.tabBar.titles.indexOf(e.title)?this:null}findSplitNode(e){return null}findFirstTabNode(){return this}hitTestTabNodes(e,t){return e<this._left||e>=this._left+this._width||t<this._top||t>=this._top+this._height?null:this}createConfig(){return{type:"tab-area",widgets:this.tabBar.titles.map((e=>e.owner)),currentIndex:this.tabBar.currentIndex}}holdAllSizes(){}fit(e,t){let r=0,n=0,i=t.get(this.tabBar),a=this.tabBar.currentTitle,o=a?t.get(a.owner):void 0,[s,l]=this.sizers;return i&&i.fit(),o&&o.fit(),i&&!i.isHidden?(r=Math.max(r,i.minWidth),n+=i.minHeight,s.minSize=i.minHeight,s.maxSize=i.maxHeight):(s.minSize=0,s.maxSize=0),o&&!o.isHidden?(r=Math.max(r,o.minWidth),n+=o.minHeight,l.minSize=o.minHeight,l.maxSize=1/0):(l.minSize=0,l.maxSize=1/0),{minWidth:r,minHeight:n,maxWidth:1/0,maxHeight:1/0}}update(e,t,r,n,i,a){this._top=t,this._left=e,this._width=r,this._height=n;let o=a.get(this.tabBar),s=this.tabBar.currentTitle,l=s?a.get(s.owner):void 0;if(Q.calc(this.sizers,n),o&&!o.isHidden){let n=this.sizers[0].size;o.update(e,t,r,n),t+=n}if(l&&!l.isHidden){let n=this.sizers[1].size;l.update(e,t,r,n)}}}e.TabLayoutNode=r;class n{constructor(e){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=e}*iterAllWidgets(){for(let e of this.children)yield*e.iterAllWidgets()}*iterUserWidgets(){for(let e of this.children)yield*e.iterUserWidgets()}*iterSelectedWidgets(){for(let e of this.children)yield*e.iterSelectedWidgets()}*iterTabBars(){for(let e of this.children)yield*e.iterTabBars()}*iterHandles(){yield*this.handles;for(let e of this.children)yield*e.iterHandles()}findTabNode(e){for(let t=0,r=this.children.length;t<r;++t){let r=this.children[t].findTabNode(e);if(r)return r}return null}findSplitNode(e){let t=this.handles.indexOf(e);if(-1!==t)return{index:t,node:this};for(let t=0,r=this.children.length;t<r;++t){let r=this.children[t].findSplitNode(e);if(r)return r}return null}findFirstTabNode(){return 0===this.children.length?null:this.children[0].findFirstTabNode()}hitTestTabNodes(e,t){for(let r=0,n=this.children.length;r<n;++r){let n=this.children[r].hitTestTabNodes(e,t);if(n)return n}return null}createConfig(){let e=this.orientation,t=this.createNormalizedSizes();return{type:"split-area",orientation:e,children:this.children.map((e=>e.createConfig())),sizes:t}}syncHandles(){this.handles.forEach(((e,t)=>{e.setAttribute("data-orientation",this.orientation),t===this.handles.length-1?e.classList.add("lm-mod-hidden"):e.classList.remove("lm-mod-hidden")}))}holdSizes(){for(let e of this.sizers)e.sizeHint=e.size}holdAllSizes(){for(let e of this.children)e.holdAllSizes();this.holdSizes()}normalizeSizes(){let e=this.sizers.length;if(0===e)return;this.holdSizes();let t=this.sizers.reduce(((e,t)=>e+t.sizeHint),0);if(0===t)for(let t of this.sizers)t.size=t.sizeHint=1/e;else for(let e of this.sizers)e.size=e.sizeHint/=t;this.normalized=!0}createNormalizedSizes(){let e=this.sizers.length;if(0===e)return[];let t=this.sizers.map((e=>e.size)),r=t.reduce(((e,t)=>e+t),0);if(0===r)for(let r=t.length-1;r>-1;r--)t[r]=1/e;else for(let e=t.length-1;e>-1;e--)t[e]/=r;return t}fit(e,t){let r="horizontal"===this.orientation,n=Math.max(0,this.children.length-1)*e,i=r?n:0,a=r?0:n;for(let n=0,o=this.children.length;n<o;++n){let o=this.children[n].fit(e,t);r?(a=Math.max(a,o.minHeight),i+=o.minWidth,this.sizers[n].minSize=o.minWidth):(i=Math.max(i,o.minWidth),a+=o.minHeight,this.sizers[n].minSize=o.minHeight)}return{minWidth:i,minHeight:a,maxWidth:1/0,maxHeight:1/0}}update(e,t,r,n,i,a){let o="horizontal"===this.orientation,s=Math.max(0,this.children.length-1)*i,l=Math.max(0,(o?r:n)-s);if(this.normalized){for(let e of this.sizers)e.sizeHint*=l;this.normalized=!1}Q.calc(this.sizers,l);for(let s=0,l=this.children.length;s<l;++s){let l=this.children[s],c=this.sizers[s].size,u=this.handles[s].style;o?(l.update(e,t,c,n,i,a),e+=c,u.top=`${t}px`,u.left=`${e}px`,u.width=`${i}px`,u.height=`${n}px`,e+=i):(l.update(e,t,r,c,i,a),t+=c,u.top=`${t}px`,u.left=`${e}px`,u.width=`${r}px`,u.height=`${i}px`,t+=i)}}}e.SplitLayoutNode=n,e.addAria=function(e,t){e.node.setAttribute("role","tabpanel");let r=t.renderer;if(r instanceof Le.Renderer){let t=r.createTabKey({title:e.title,current:!1,zIndex:0});e.node.setAttribute("aria-labelledby",t)}},e.removeAria=function(e){e.node.removeAttribute("role"),e.node.removeAttribute("aria-labelledby")}}(Pe||(Pe={}));var De,Oe=class e extends ne{constructor(t={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new z(this),this._addRequested=new z(this),this.addClass("lm-DockPanel"),this._document=t.document||document,this._mode=t.mode||"multiple-document",this._renderer=t.renderer||e.defaultRenderer,this._edges=t.edges||De.DEFAULT_EDGES,void 0!==t.tabsMovable&&(this._tabsMovable=t.tabsMovable),void 0!==t.tabsConstrained&&(this._tabsConstrained=t.tabsConstrained),void 0!==t.addButtonEnabled&&(this._addButtonEnabled=t.addButtonEnabled),this.dataset.mode=this._mode;let r={createTabBar:()=>this._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new ze({document:this._document,renderer:r,spacing:t.spacing,hiddenMode:t.hiddenMode}),this.overlay=t.overlay||new e.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get mode(){return this._mode}set mode(e){if(this._mode===e)return;this._mode=e,this.dataset.mode=e;let t=this.layout;switch(e){case"multiple-document":for(let e of t.tabBars())e.show();break;case"single-document":t.restoreLayout(De.createSingleDocumentConfig(this));break;default:throw"unreachable"}M.postMessage(this,De.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(e){this._tabsMovable=e;for(let t of this.tabBars())t.tabsMovable=e}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(e){this._tabsConstrained=e}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled=e;for(let t of this.tabBars())t.addButtonEnabled=e}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(e){let t=(0,b.find)(this.tabBars(),(t=>-1!==t.titles.indexOf(e.title)));if(!t)throw new Error("Widget is not contained in the dock panel.");t.currentTitle=e.title}activateWidget(e){this.selectWidget(e),e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document",this.layout.restoreLayout(e),(a.IS_EDGE||a.IS_IE)&&M.flush(),M.postMessage(this,De.LayoutModified)}addWidget(e,t={}){"single-document"===this._mode?this.layout.addWidget(e):this.layout.addWidget(e,t),M.postMessage(this,De.LayoutModified)}processMessage(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):super.processMessage(e)}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){De.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){De.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),M.postMessage(this,De.LayoutModified))}_evtDragEnter(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())}_evtDragLeave(e){e.preventDefault(),(!this._tabsConstrained||e.source===this)&&(e.stopPropagation(),this.overlay.hide(1))}_evtDragOver(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||"invalid"===this._showOverlay(e.clientX,e.clientY)?e.dropAction="none":(e.stopPropagation(),e.dropAction=e.proposedAction)}_evtDrop(e){if(e.preventDefault(),this.overlay.hide(0),"none"===e.proposedAction)return void(e.dropAction="none");let{clientX:t,clientY:r}=e,{zone:n,target:i}=De.findDropTarget(this,t,r,this._edges);if(this._tabsConstrained&&e.source!==this||"invalid"===n)return void(e.dropAction="none");let a=e.mimeData.getData("application/vnd.lumino.widget-factory");if("function"!=typeof a)return void(e.dropAction="none");let o=a();if(!(o instanceof ne))return void(e.dropAction="none");if(o.contains(this))return void(e.dropAction="none");let s=i?De.getDropRef(i.tabBar):null;switch(n){case"root-all":this.addWidget(o);break;case"root-top":this.addWidget(o,{mode:"split-top"});break;case"root-left":this.addWidget(o,{mode:"split-left"});break;case"root-right":this.addWidget(o,{mode:"split-right"});break;case"root-bottom":this.addWidget(o,{mode:"split-bottom"});break;case"widget-all":case"widget-tab":this.addWidget(o,{mode:"tab-after",ref:s});break;case"widget-top":this.addWidget(o,{mode:"split-top",ref:s});break;case"widget-left":this.addWidget(o,{mode:"split-left",ref:s});break;case"widget-right":this.addWidget(o,{mode:"split-right",ref:s});break;case"widget-bottom":this.addWidget(o,{mode:"split-bottom",ref:s});break;default:throw"unreachable"}e.dropAction=e.proposedAction,e.stopPropagation(),this.activateWidget(o)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&(this._releaseMouse(),M.postMessage(this,De.LayoutModified))}_evtPointerDown(e){if(0!==e.button)return;let t=this.layout,r=e.target,n=(0,b.find)(t.handles(),(e=>e.contains(r)));if(!n)return;e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let i=n.getBoundingClientRect(),a=e.clientX-i.left,o=e.clientY-i.top,s=window.getComputedStyle(n),l=B.overrideCursor(s.cursor,this._document);this._pressData={handle:n,deltaX:a,deltaY:o,override:l}}_evtPointerMove(e){if(!this._pressData)return;e.preventDefault(),e.stopPropagation();let t=this.node.getBoundingClientRect(),r=e.clientX-t.left-this._pressData.deltaX,n=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,r,n)}_evtPointerUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),M.postMessage(this,De.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(e,t){let{zone:r,target:n}=De.findDropTarget(this,e,t,this._edges);if("invalid"===r)return this.overlay.hide(100),r;let a,o,s,l,c=i.boxSizing(this.node),u=this.node.getBoundingClientRect();switch(r){case"root-all":a=c.paddingTop,o=c.paddingLeft,s=c.paddingRight,l=c.paddingBottom;break;case"root-top":a=c.paddingTop,o=c.paddingLeft,s=c.paddingRight,l=u.height*De.GOLDEN_RATIO;break;case"root-left":a=c.paddingTop,o=c.paddingLeft,s=u.width*De.GOLDEN_RATIO,l=c.paddingBottom;break;case"root-right":a=c.paddingTop,o=u.width*De.GOLDEN_RATIO,s=c.paddingRight,l=c.paddingBottom;break;case"root-bottom":a=u.height*De.GOLDEN_RATIO,o=c.paddingLeft,s=c.paddingRight,l=c.paddingBottom;break;case"widget-all":a=n.top,o=n.left,s=n.right,l=n.bottom;break;case"widget-top":a=n.top,o=n.left,s=n.right,l=n.bottom+n.height/2;break;case"widget-left":a=n.top,o=n.left,s=n.right+n.width/2,l=n.bottom;break;case"widget-right":a=n.top,o=n.left+n.width/2,s=n.right,l=n.bottom;break;case"widget-bottom":a=n.top+n.height/2,o=n.left,s=n.right,l=n.bottom;break;case"widget-tab":{let e=n.tabBar.node.getBoundingClientRect().height;a=n.top,o=n.left,s=n.right,l=n.bottom+n.height-e;break}default:throw"unreachable"}return this.overlay.show({top:a,left:o,right:s,bottom:l}),r}_createTabBar(){let e=this._renderer.createTabBar(this._document);return De.isGeneratedTabBarProperty.set(e,!0),"single-document"===this._mode&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){M.postMessage(this,De.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:r,currentTitle:n}=t;r&&r.owner.hide(),n&&n.owner.show(),(a.IS_EDGE||a.IS_IE)&&M.flush(),M.postMessage(this,De.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(this._drag)return;e.releaseMouse();let{title:r,tab:n,clientX:i,clientY:a,offset:o}=t,s=new w.MimeData;s.setData("application/vnd.lumino.widget-factory",(()=>r.owner));let l=n.cloneNode(!0);o&&(l.style.top=`-${o.y}px`,l.style.left=`-${o.x}px`),this._drag=new B({document:this._document,mimeData:s,dragImage:l,proposedAction:"move",supportedActions:"move",source:this}),n.classList.add("lm-mod-hidden"),this._drag.start(i,a).then((()=>{this._drag=null,n.classList.remove("lm-mod-hidden")}))}};!function(e){e.Overlay=class{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(e){let t=this.node.style;t.top=`${e.top}px`,t.left=`${e.left}px`,t.right=`${e.right}px`,t.bottom=`${e.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(e){if(!this._hidden){if(e<=0)return clearTimeout(this._timer),this._timer=-1,this._hidden=!0,void this.node.classList.add("lm-mod-hidden");-1===this._timer&&(this._timer=window.setTimeout((()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")}),e))}}};class t{createTabBar(e){let t=new Le({document:e});return t.addClass("lm-DockPanel-tabBar"),t}createHandle(){let e=document.createElement("div");return e.className="lm-DockPanel-handle",e}}e.Renderer=t,e.defaultRenderer=new t}(Oe||(Oe={})),function(e){e.GOLDEN_RATIO=.618,e.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},e.LayoutModified=new E("layout-modified"),e.isGeneratedTabBarProperty=new I({name:"isGeneratedTabBar",create:()=>!1}),e.createSingleDocumentConfig=function(e){if(e.isEmpty)return{main:null};let t=Array.from(e.widgets()),r=e.selectedWidgets().next().value,n=r?t.indexOf(r):-1;return{main:{type:"tab-area",widgets:t,currentIndex:n}}},e.findDropTarget=function(e,t,r,n){if(!i.hitTest(e.node,t,r))return{zone:"invalid",target:null};let a=e.layout;if(a.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===e.mode){let i=e.node.getBoundingClientRect(),a=t-i.left+1,o=r-i.top+1,s=i.right-t,l=i.bottom-r;switch(Math.min(o,s,l,a)){case o:if(o<n.top)return{zone:"root-top",target:null};break;case s:if(s<n.right)return{zone:"root-right",target:null};break;case l:if(l<n.bottom)return{zone:"root-bottom",target:null};break;case a:if(a<n.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}let o=a.hitTestTabAreas(t,r);if(!o)return{zone:"invalid",target:null};if("single-document"===e.mode)return{zone:"widget-all",target:o};let s=o.x-o.left+1,l=o.y-o.top+1,c=o.left+o.width-o.x,u=o.top+o.height-o.y;if(l<o.tabBar.node.getBoundingClientRect().height)return{zone:"widget-tab",target:o};let h,f=Math.round(o.width/3),p=Math.round(o.height/3);if(s>f&&c>f&&l>p&&u>p)return{zone:"widget-all",target:o};switch(s/=f,l/=p,c/=f,u/=p,Math.min(s,l,c,u)){case s:h="widget-left";break;case l:h="widget-top";break;case c:h="widget-right";break;case u:h="widget-bottom";break;default:throw"unreachable"}return{zone:h,target:o}},e.getDropRef=function(e){return 0===e.titles.length?null:e.currentTitle?e.currentTitle.owner:e.titles[e.titles.length-1].owner}}(De||(De={}));var Re,Fe=class e extends ie{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new ee],this._columnSizers=[new ee],this._box=null,void 0!==e.rowCount&&Re.reallocSizers(this._rowSizers,e.rowCount),void 0!==e.columnCount&&Re.reallocSizers(this._columnSizers,e.columnCount),void 0!==e.rowSpacing&&(this._rowSpacing=Re.clampValue(e.rowSpacing)),void 0!==e.columnSpacing&&(this._columnSpacing=Re.clampValue(e.columnSpacing))}dispose(){for(let e of this._items){let t=e.widget;e.dispose(),t.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){e!==this.rowCount&&(Re.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(Re.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=Re.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=Re.clampValue(e),this._columnSpacing!==e&&(this._columnSpacing=e,this.parent&&this.parent.fit())}rowStretch(e){let t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){let r=this._rowSizers[e];r&&(t=Re.clampValue(t),r.stretch!==t&&(r.stretch=t,this.parent&&this.parent.update()))}columnStretch(e){let t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){let r=this._columnSizers[e];r&&(t=Re.clampValue(t),r.stretch!==t&&(r.stretch=t,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(let e of this._items)yield e.widget}addWidget(e){-1===b.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e))&&(this._items.push(new oe(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=b.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e));if(-1===t)return;let r=b.ArrayExt.removeAt(this._items,t);this.parent&&this.detachWidget(e),r.dispose()}init(){super.init();for(let e of this)this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&M.sendMessage(e,ne.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&M.sendMessage(e,ne.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&M.sendMessage(e,ne.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&M.sendMessage(e,ne.Msg.AfterDetach),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(let e=0,t=this.rowCount;e<t;++e)this._rowSizers[e].minSize=0;for(let e=0,t=this.columnCount;e<t;++e)this._columnSizers[e].minSize=0;let t=this._items.filter((e=>!e.isHidden));for(let e=0,r=t.length;e<r;++e)t[e].fit();let r=this.rowCount-1,n=this.columnCount-1;t.sort(Re.rowSpanCmp);for(let n=0,i=t.length;n<i;++n){let i=t[n],a=e.getCellConfig(i.widget),o=Math.min(a.row,r),s=Math.min(a.row+a.rowSpan-1,r);Re.distributeMin(this._rowSizers,o,s,i.minHeight)}t.sort(Re.columnSpanCmp);for(let r=0,i=t.length;r<i;++r){let i=t[r],a=e.getCellConfig(i.widget),o=Math.min(a.column,n),s=Math.min(a.column+a.columnSpan-1,n);Re.distributeMin(this._columnSizers,o,s,i.minWidth)}if("set-no-constraint"===this.fitPolicy)return void M.sendMessage(this.parent,ne.Msg.UpdateRequest);let a=r*this._rowSpacing,o=n*this._columnSpacing;for(let e=0,t=this.rowCount;e<t;++e)a+=this._rowSizers[e].minSize;for(let e=0,t=this.columnCount;e<t;++e)o+=this._columnSizers[e].minSize;let s=this._box=i.boxSizing(this.parent.node);o+=s.horizontalSum,a+=s.verticalSum;let l=this.parent.node.style;l.minWidth=`${o}px`,l.minHeight=`${a}px`,this._dirty=!0,this.parent.parent&&M.sendMessage(this.parent.parent,ne.Msg.FitRequest),this._dirty&&M.sendMessage(this.parent,ne.Msg.UpdateRequest)}_update(t,r){this._dirty=!1,t<0&&(t=this.parent.node.offsetWidth),r<0&&(r=this.parent.node.offsetHeight),this._box||(this._box=i.boxSizing(this.parent.node));let n=this._box.paddingTop,a=this._box.paddingLeft,o=t-this._box.horizontalSum,s=r-this._box.verticalSum,l=this.rowCount-1,c=this.columnCount-1,u=l*this._rowSpacing,h=c*this._columnSpacing;Q.calc(this._rowSizers,Math.max(0,s-u)),Q.calc(this._columnSizers,Math.max(0,o-h));for(let e=0,t=n,r=this.rowCount;e<r;++e)this._rowStarts[e]=t,t+=this._rowSizers[e].size+this._rowSpacing;for(let e=0,t=a,r=this.columnCount;e<r;++e)this._columnStarts[e]=t,t+=this._columnSizers[e].size+this._columnSpacing;for(let t=0,r=this._items.length;t<r;++t){let r=this._items[t];if(r.isHidden)continue;let n=e.getCellConfig(r.widget),i=Math.min(n.row,l),a=Math.min(n.column,c),o=Math.min(n.row+n.rowSpan-1,l),s=Math.min(n.column+n.columnSpan-1,c),u=this._columnStarts[a],h=this._rowStarts[i],f=this._columnStarts[s]+this._columnSizers[s].size-u,p=this._rowStarts[o]+this._rowSizers[o].size-h;r.update(u,h,f,p)}}};!function(e){e.getCellConfig=function(e){return Re.cellConfigProperty.get(e)},e.setCellConfig=function(e,t){Re.cellConfigProperty.set(e,Re.normalizeConfig(t))}}(Fe||(Fe={})),function(e){e.cellConfigProperty=new I({name:"cellConfig",create:()=>({row:0,column:0,rowSpan:1,columnSpan:1}),changed:function(e){e.parent&&e.parent.layout instanceof Fe&&e.parent.fit()}}),e.normalizeConfig=function(e){return{row:Math.max(0,Math.floor(e.row||0)),column:Math.max(0,Math.floor(e.column||0)),rowSpan:Math.max(1,Math.floor(e.rowSpan||0)),columnSpan:Math.max(1,Math.floor(e.columnSpan||0))}},e.clampValue=function(e){return Math.max(0,Math.floor(e))},e.rowSpanCmp=function(t,r){let n=e.cellConfigProperty.get(t.widget),i=e.cellConfigProperty.get(r.widget);return n.rowSpan-i.rowSpan},e.columnSpanCmp=function(t,r){let n=e.cellConfigProperty.get(t.widget),i=e.cellConfigProperty.get(r.widget);return n.columnSpan-i.columnSpan},e.reallocSizers=function(e,t){for(t=Math.max(1,Math.floor(t));e.length<t;)e.push(new ee);e.length>t&&(e.length=t)},e.distributeMin=function(e,t,r,n){if(r<t)return;if(t===r){let r=e[t];return void(r.minSize=Math.max(r.minSize,n))}let i=0;for(let n=t;n<=r;++n)i+=e[n].minSize;if(i>=n)return;let a=(n-i)/(r-t+1);for(let n=t;n<=r;++n)e[n].minSize+=a}}(Re||(Re={}));var Be,je,Ne=class e extends ne{constructor(t={}){super({node:Be.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(ne.Flag.DisallowLayout),this.renderer=t.renderer||e.defaultRenderer,this._forceItemsPosition=t.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=t.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(e){this.activeIndex=e?this._menus.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._menus.length)&&(e=-1),e>-1&&0===this._menus[e].items.length&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this.update())}get menus(){return this._menus}openActiveMenu(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(e,t=!0){this.insertMenu(this._menus.length,e,t)}insertMenu(e,t,r=!0){this._closeChildMenu();let n=this._menus.indexOf(t),i=Math.max(0,Math.min(e,this._menus.length));if(-1===n)return b.ArrayExt.insert(this._menus,i,t),t.addClass("lm-MenuBar-menu"),t.aboutToClose.connect(this._onMenuAboutToClose,this),t.menuRequested.connect(this._onMenuMenuRequested,this),t.title.changed.connect(this._onTitleChanged,this),void(r&&this.update());i===this._menus.length&&i--,n!==i&&(b.ArrayExt.move(this._menus,n,i),r&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let r=b.ArrayExt.removeAt(this._menus,e);r&&(r.aboutToClose.disconnect(this._onMenuAboutToClose,this),r.menuRequested.disconnect(this._onMenuMenuRequested,this),r.title.changed.disconnect(this._onTitleChanged,this),r.removeClass("lm-MenuBar-menu"),t&&this.update())}clearMenus(){if(0!==this._menus.length){this._closeChildMenu();for(let e of this._menus)e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"focusout":this._evtFocusOut(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(e){this.isAttached&&this._focusItemAt(0)}onResize(e){this.update(),super.onResize(e)}onUpdateRequest(e){var t;let r=this._menus,n=this.renderer,i=this._activeIndex,a=this._tabFocusIndex>=0&&this._tabFocusIndex<r.length?this._tabFocusIndex:0,o=this._overflowIndex>-1?this._overflowIndex:r.length,s=0,l=!1;o=null!==this._overflowMenu?o-1:o;let c=new Array(o);for(let e=0;e<o;++e)c[e]=n.renderItem({title:r[e].title,active:e===i,tabbable:e===a,disabled:0===r[e].items.length,onfocus:()=>{this._tabFocusIndex=e,this.activeIndex=e}}),s+=this._menuItemSizes[e],r[e].title.label===this._overflowMenuOptions.title&&(l=!0,o--);if(this._overflowMenuOptions.isVisible)if(this._overflowIndex>-1&&!l){if(null===this._overflowMenu){let e=null!==(t=this._overflowMenuOptions.title)&&void 0!==t?t:"...";this._overflowMenu=new Ee({commands:new W}),this._overflowMenu.title.label=e,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let e=r.length-2;e>=o;e--){let t=this.menus[e];t.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:t}),this.removeMenu(t,!1)}c[o]=n.renderItem({title:this._overflowMenu.title,active:o===i&&0!==r[o].items.length,tabbable:o===a,disabled:0===r[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}else if(null!==this._overflowMenu){let e=this._overflowMenu.items,t=this.node.offsetWidth,i=this._overflowMenu.items.length;for(let l=0;l<i;++l){let i=r.length-1-l;if(t-s>this._menuItemSizes[i]){let t=e[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(o,t,!1),c[o]=n.renderItem({title:t.title,active:!1,tabbable:o===a,disabled:0===r[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}}0===this._overflowMenu.items.length&&(this.removeMenu(this._overflowMenu,!1),c.pop(),this._overflowMenu=null,this._overflowIndex=-1)}Z.render(c,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;let e=this.contentNode.childNodes,t=this.node.offsetWidth,r=0,n=-1,i=e.length;if(0==this._menuItemSizes.length)for(let a=0;a<i;a++){let i=e[a];r+=i.offsetWidth,this._menuItemSizes.push(i.offsetWidth),r>t&&-1===n&&(n=a)}else for(let e=0;e<this._menuItemSizes.length;e++)if(r+=this._menuItemSizes[e],r>t){n=e;break}this._overflowIndex=n}_evtKeyDown(e){let t=e.keyCode;if(9===t)return void(this.activeIndex=-1);if(e.preventDefault(),e.stopPropagation(),13===t||32===t||38===t||40===t){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;return void this.openActiveMenu()}if(27===t)return this._closeChildMenu(),void this._focusItemAt(this.activeIndex);if(37===t||39===t){let e=37===t?-1:1,r=this._tabFocusIndex+e,n=this._menus.length;for(let t=0;t<n;t++){let i=(n+r+e*t)%n;if(this._menus[i].items.length)return void this._focusItemAt(i)}return}let r=U().keyForKeydownEvent(e);if(!r)return;let n=this._activeIndex+1,i=Be.findMnemonic(this._menus,r,n);-1===i.index||i.multiple?-1!==i.index?(this.activeIndex=i.index,this._focusItemAt(this.activeIndex)):-1!==i.auto&&(this.activeIndex=i.auto,this._focusItemAt(this.activeIndex)):(this.activeIndex=i.index,this.openActiveMenu())}_evtMouseDown(e){if(!i.hitTest(this.node,e.clientX,e.clientY))return;e.stopPropagation(),e.stopImmediatePropagation();let t=b.ArrayExt.findFirstIndex(this.contentNode.children,(t=>i.hitTest(t,e.clientX,e.clientY)));if(-1!==t){if(0===e.button)if(this._childMenu)this._closeChildMenu(),this.activeIndex=t;else{e.preventDefault();let r=this._positionForMenu(t);Ee.saveWindowData(),this.activeIndex=t,this._openChildMenu(r)}}else this._closeChildMenu()}_evtMouseMove(e){let t=b.ArrayExt.findFirstIndex(this.contentNode.children,(t=>i.hitTest(t,e.clientX,e.clientY)));if(t===this._activeIndex||-1===t&&this._childMenu)return;let r=t>=0&&this._childMenu?this._positionForMenu(t):null;Ee.saveWindowData(),this.activeIndex=t,r&&this._openChildMenu(r)}_positionForMenu(e){let t=this.contentNode.children[e],{left:r,bottom:n}=t.getBoundingClientRect();return{top:n,left:r}}_evtFocusOut(e){!this._childMenu&&!this.node.contains(e.relatedTarget)&&(this.activeIndex=-1)}_focusItemAt(e){let t=this.contentNode.childNodes[e];t&&t.focus()}_openChildMenu(e={}){let t=this.activeMenu;if(!t)return void this._closeChildMenu();let r=this._childMenu;if(r===t)return;this._childMenu=t,r?r.close():document.addEventListener("mousedown",this,!0),this._tabFocusIndex=this.activeIndex,M.sendMessage(this,ne.Msg.UpdateRequest);let{left:n,top:i}=e;(typeof n>"u"||typeof i>"u")&&({left:n,top:i}=this._positionForMenu(this._activeIndex)),r||this.addClass("lm-mod-active"),t.items.length>0&&t.open(n,i,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0);let e=this._childMenu;this._childMenu=null,e.close(),this.activeIndex=-1}_onMenuAboutToClose(e){e===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(e,t){if(e!==this._childMenu)return;let r=this._activeIndex,n=this._menus.length;switch(t){case"next":this.activeIndex=r===n-1?0:r+1;break;case"previous":this.activeIndex=0===r?n-1:r-1}this.openActiveMenu()}_onTitleChanged(){this.update()}};!function(e){class t{renderItem(e){let t=this.createItemClass(e),r=this.createItemDataset(e),n=this.createItemARIA(e);return J.li({className:t,dataset:r,...e.disabled?{}:{tabindex:e.tabbable?"0":"-1"},onfocus:e.onfocus,...n},this.renderIcon(e),this.renderLabel(e))}renderIcon(e){let t=this.createIconClass(e);return J.div({className:t},e.title.icon,e.title.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return J.div({className:"lm-MenuBar-itemLabel"},t)}createItemClass(e){let t="lm-MenuBar-item";return e.title.className&&(t+=` ${e.title.className}`),e.active&&!e.disabled&&(t+=" lm-mod-active"),t}createItemDataset(e){return e.title.dataset}createItemARIA(e){return{role:"menuitem","aria-haspopup":"true","aria-disabled":e.disabled?"true":"false"}}createIconClass(e){let t="lm-MenuBar-itemIcon",r=e.title.iconClass;return r?`${t} ${r}`:t}formatLabel(e){let{label:t,mnemonic:r}=e.title;if(r<0||r>=t.length)return t;let n=t.slice(0,r),i=t.slice(r+1),a=t[r];return[n,J.span({className:"lm-MenuBar-itemMnemonic"},a),i]}}e.Renderer=t,e.defaultRenderer=new t}(Ne||(Ne={})),function(e){e.createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-MenuBar-content",e.appendChild(t),t.setAttribute("role","menubar"),e},e.findMnemonic=function(e,t,r){let n=-1,i=-1,a=!1,o=t.toUpperCase();for(let t=0,s=e.length;t<s;++t){let l=(t+r)%s,c=e[l].title;if(0===c.label.length)continue;let u=c.mnemonic;u>=0&&u<c.label.length?c.label[u].toUpperCase()===o&&(-1===n?n=l:a=!0):-1===i&&c.label[0].toUpperCase()===o&&(i=l)}return{index:n,multiple:a,auto:i}}}(Be||(Be={})),function(e){e.createNode=function(){let e=document.createElement("div"),t=document.createElement("div"),r=document.createElement("div"),n=document.createElement("div"),i=document.createElement("div");return t.className="lm-ScrollBar-button",r.className="lm-ScrollBar-button",t.dataset.action="decrement",r.dataset.action="increment",n.className="lm-ScrollBar-track",i.className="lm-ScrollBar-thumb",n.appendChild(i),e.appendChild(t),e.appendChild(n),e.appendChild(r),e},e.findPart=function(e,t){return e.thumbNode.contains(t)?"thumb":e.trackNode.contains(t)?"track":e.decrementNode.contains(t)?"decrement":e.incrementNode.contains(t)?"increment":null}}(je||(je={}));var Ue,Ve,qe=class extends le{constructor(e={}){super(e),this._dirty=!1,this._items=[],this._box=null,this._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:ne.HiddenMode.Display}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this._hiddenMode=e,this.widgets.length>1&&this.widgets.forEach((e=>{e.hiddenMode=this._hiddenMode})))}dispose(){for(let e of this._items)e.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(e,t){this._hiddenMode===ne.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=ne.HiddenMode.Scale),t.hiddenMode=ne.HiddenMode.Scale):t.hiddenMode=ne.HiddenMode.Display,b.ArrayExt.insert(this._items,e,new oe(t)),this.parent.isAttached&&M.sendMessage(t,ne.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&M.sendMessage(t,ne.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,r){b.ArrayExt.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let r=b.ArrayExt.removeAt(this._items,e);this.parent.isAttached&&M.sendMessage(t,ne.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&M.sendMessage(t,ne.Msg.AfterDetach),r.widget.node.style.zIndex="",this._hiddenMode===ne.HiddenMode.Scale&&(t.hiddenMode=ne.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=ne.HiddenMode.Display)),r.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0,t=0;for(let r=0,n=this._items.length;r<n;++r){let n=this._items[r];n.isHidden||(n.fit(),e=Math.max(e,n.minWidth),t=Math.max(t,n.minHeight))}let r=this._box=i.boxSizing(this.parent.node);e+=r.horizontalSum,t+=r.verticalSum;let n=this.parent.node.style;n.minWidth=`${e}px`,n.minHeight=`${t}px`,this._dirty=!0,this.parent.parent&&M.sendMessage(this.parent.parent,ne.Msg.FitRequest),this._dirty&&M.sendMessage(this.parent,ne.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let r=0;for(let e=0,t=this._items.length;e<t;++e)r+=+!this._items[e].isHidden;if(0===r)return;e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=i.boxSizing(this.parent.node));let n=this._box.paddingTop,a=this._box.paddingLeft,o=e-this._box.horizontalSum,s=t-this._box.verticalSum;for(let e=0,t=this._items.length;e<t;++e){let t=this._items[e];t.isHidden||(t.widget.node.style.zIndex=`${e}`,t.update(a,n,o,s))}}};!function(e){e.createLayout=function(e){return e.layout||new qe}}(Ue||(Ue={})),function(e){e.orientationFromPlacement=function(e){return t[e]},e.directionFromPlacement=function(e){return r[e]};let t={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},r={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}}(Ve||(Ve={}));var He="application/vnd.plotly.v1+json",Ge=class e extends ne{constructor(e){super(),this.addClass("jp-RenderedPlotly"),this._mimeType=e.mimeType,this._img_el=document.createElement("img"),this._img_el.className="plot-img",this.node.appendChild(this._img_el),this._img_el.addEventListener("mouseenter",(e=>{this.createGraph(this._model)}))}renderModel(e){if(this.hasGraphElement())return Promise.resolve();this._model=e;let t=e.data["image/png"];return null!=t?(this.updateImage(t),Promise.resolve()):this.createGraph(e)}hasGraphElement(){return null!==this.node.querySelector(".plot-container")}updateImage(e){this.hideGraph(),this._img_el.src="data:image/png;base64,"+e,this.showImage()}hideGraph(){let e=this.node.querySelector(".plot-container");null!=e&&(e.style.display="none")}showGraph(){let e=this.node.querySelector(".plot-container");null!=e&&(e.style.display="block")}hideImage(){let e=this.node.querySelector(".plot-img");null!=e&&(e.style.display="none")}showImage(){let e=this.node.querySelector(".plot-img");null!=e&&(e.style.display="block")}createGraph(t){let{data:r,layout:n,frames:i,config:a}=t.data[this._mimeType];return n.height||(n.height=360),(async()=>(null===e.Plotly&&(e.Plotly=await Promise.resolve().then((()=>y(_()))),e._resolveLoadingPlotly()),e.loadingPlotly))().then((()=>e.Plotly.react(this.node,r,n,a))).then((r=>{this.showGraph(),this.hideImage(),this.update(),i&&e.Plotly.addFrames(this.node,i),this.node.offsetWidth>0&&this.node.offsetHeight>0&&e.Plotly.toImage(r,{format:"png",width:this.node.offsetWidth,height:this.node.offsetHeight}).then((e=>{let r=e.split(",")[1];t.data["image/png"]!==r&&t.setData({data:{...t.data,"image/png":r}})})),this.node.on("plotly_webglcontextlost",(()=>{let e=t.data["image/png"];if(null!=e)return this.updateImage(e),Promise.resolve()}))}))}onAfterShow(e){this.update()}onResize(e){this.update()}onUpdateRequest(t){e.Plotly&&this.isVisible&&this.hasGraphElement()&&e.Plotly.redraw(this.node).then((()=>{e.Plotly.Plots.resize(this.node)}))}static{this.Plotly=null}static{this.loadingPlotly=new Promise((t=>{e._resolveLoadingPlotly=t}))}},We={safe:!0,mimeTypes:[He],createRenderer:e=>new Ge(e)},Ze=[{id:"@jupyterlab/plotly-extension:factory",rendererFactory:We,rank:2,dataType:"json",fileTypes:[{name:"plotly",mimeTypes:[He],extensions:[".plotly",".plotly.json"],iconClass:"jp-MaterialIcon jp-PlotlyIcon"}],documentWidgetFactoryOptions:{name:"Plotly",primaryFileType:"plotly",fileTypes:["plotly","json"],defaultFor:["plotly"]}}]},e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,l=[],c=!1,u=-1;function h(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&f())}function f(){if(!c){var e=o(h);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u<t;)s&&s[u].run();u=-1,t=l.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function d(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new p(e,t)),1!==l.length||c||o(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}}]]); |