three-globe
Version:
Globe data visualization as a ThreeJS reusable 3D object
2 lines • 477 kB
JavaScript
// Version 2.40.0 three-globe - https://github.com/vasturiano/three-globe
!function(A,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("three")):"function"==typeof define&&define.amd?define(["three"],t):(A="undefined"!=typeof globalThis?globalThis:A||self).ThreeGlobe=t(A.THREE)}(this,(function(A){"use strict";function t(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,n=Array(t);e<t;e++)n[e]=A[e];return n}function e(A,t,e){if("function"==typeof A?A===t:A.has(t))return arguments.length<3?t:e;throw new TypeError("Private element is not present on this object")}function n(A,t,e){return t=h(t),function(A,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,p()?Reflect.construct(t,e||[],h(A).constructor):t.apply(A,e))}function r(A,t){if(t.has(A))throw new TypeError("Cannot initialize the same private elements twice on an object")}function i(A,t){if(!(A instanceof t))throw new TypeError("Cannot call a class as a function")}function o(A,t){return A.get(e(A,t))}function a(A,t,e){r(A,t),t.set(A,e)}function l(A,t,n){return A.set(e(A,t),n),n}function u(A,t,e){if(p())return Reflect.construct.apply(null,arguments);var n=[null];return n.push.apply(n,t),new(A.bind.apply(A,n))}function s(A,t,e){return t&&function(A,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,w(n.key),n)}}(A.prototype,t),Object.defineProperty(A,"prototype",{writable:!1}),A}function f(A,t,e){return(t=w(t))in A?Object.defineProperty(A,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):A[t]=e,A}function c(){return c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(A,t,e){var n=function(A,t){for(;!{}.hasOwnProperty.call(A,t)&&null!==(A=h(A)););return A}(A,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?A:e):r.value}},c.apply(null,arguments)}function h(A){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},h(A)}function d(A,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(t&&t.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),t&&v(A,t)}function p(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(A){}return(p=function(){return!!A})()}function m(A,t){var e=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(A,t).enumerable}))),e.push.apply(e,n)}return e}function g(A){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?m(Object(e),!0).forEach((function(t){f(A,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(e)):m(Object(e)).forEach((function(t){Object.defineProperty(A,t,Object.getOwnPropertyDescriptor(e,t))}))}return A}function v(A,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,t){return A.__proto__=t,A},v(A,t)}function y(A,t){return function(A){if(Array.isArray(A))return A}(A)||function(A,t){var e=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=e){var n,r,i,o,a=[],l=!0,u=!1;try{if(i=(e=e.call(A)).next,0===t){if(Object(e)!==e)return;l=!1}else for(;!(l=(n=i.call(e)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(A){u=!0,r=A}finally{try{if(!l&&null!=e.return&&(o=e.return(),Object(o)!==o))return}finally{if(u)throw r}}return a}}(A,t)||_(A,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 b(A,t,e,n){var r=c(h(A.prototype),t,e);return"function"==typeof r?function(A){return r.apply(e,A)}:r}function q(A){return function(A){if(Array.isArray(A))return t(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||_(A)||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 w(A){var t=function(A,t){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var n=e.call(A,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(A)}(A,"string");return"symbol"==typeof t?t:t+""}function _(A,e){if(A){if("string"==typeof A)return t(A,e);var n={}.toString.call(A).slice(8,-1);return"Object"===n&&A.constructor&&(n=A.constructor.name),"Map"===n||"Set"===n?Array.from(A):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(A,e):void 0}}function x(A){var t=typeof A;return null!=A&&("object"==t||"function"==t)}var M="object"==typeof global&&global&&global.Object===Object&&global,E="object"==typeof self&&self&&self.Object===Object&&self,B=M||E||Function("return this")(),k=function(){return B.Date.now()},S=/\s/;var D=/^\s+/;function C(A){return A?A.slice(0,function(A){for(var t=A.length;t--&&S.test(A.charAt(t)););return t}(A)+1).replace(D,""):A}var T=B.Symbol,P=Object.prototype,O=P.hasOwnProperty,I=P.toString,j=T?T.toStringTag:void 0;var R=Object.prototype.toString;var L=T?T.toStringTag:void 0;function Q(A){return null==A?void 0===A?"[object Undefined]":"[object Null]":L&&L in Object(A)?function(A){var t=O.call(A,j),e=A[j];try{A[j]=void 0;var n=!0}catch(A){}var r=I.call(A);return n&&(t?A[j]=e:delete A[j]),r}(A):function(A){return R.call(A)}(A)}var G=/^[-+]0x[0-9a-f]+$/i,F=/^0b[01]+$/i,z=/^0o[0-7]+$/i,U=parseInt;function N(A){if("number"==typeof A)return A;if(function(A){return"symbol"==typeof A||function(A){return null!=A&&"object"==typeof A}(A)&&"[object Symbol]"==Q(A)}(A))return NaN;if(x(A)){var t="function"==typeof A.valueOf?A.valueOf():A;A=x(t)?t+"":t}if("string"!=typeof A)return 0===A?A:+A;A=C(A);var e=F.test(A);return e||z.test(A)?U(A.slice(2),e?2:8):G.test(A)?NaN:+A}var H=Math.max,V=Math.min;function W(A,t,e){var n,r,i,o,a,l,u=0,s=!1,f=!1,c=!0;if("function"!=typeof A)throw new TypeError("Expected a function");function h(t){var e=n,i=r;return n=r=void 0,u=t,o=A.apply(i,e)}function d(A){var e=A-l;return void 0===l||e>=t||e<0||f&&A-u>=i}function p(){var A=k();if(d(A))return m(A);a=setTimeout(p,function(A){var e=t-(A-l);return f?V(e,i-(A-u)):e}(A))}function m(A){return a=void 0,c&&n?h(A):(n=r=void 0,o)}function g(){var A=k(),e=d(A);if(n=arguments,r=this,l=A,e){if(void 0===a)return function(A){return u=A,a=setTimeout(p,t),s?h(A):o}(l);if(f)return clearTimeout(a),a=setTimeout(p,t),h(l)}return void 0===a&&(a=setTimeout(p,t)),o}return t=N(t)||0,x(e)&&(s=!!e.leading,i=(f="maxWait"in e)?H(N(e.maxWait)||0,t):i,c="trailing"in e?!!e.trailing:c),g.cancel=function(){void 0!==a&&clearTimeout(a),u=0,n=l=r=a=void 0},g.flush=function(){return void 0===a?o:m(k())},g}function Y(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,n=Array(t);e<t;e++)n[e]=A[e];return n}function Z(A,t,e){return Object.defineProperty(A,"prototype",{writable:!1}),A}function X(A,t){return function(A){if(Array.isArray(A))return A}(A)||function(A,t){var e=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=e){var n,r,i,o,a=[],l=!0,u=!1;try{if(i=(e=e.call(A)).next,0===t);else for(;!(l=(n=i.call(e)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(A){u=!0,r=A}finally{try{if(!l&&null!=e.return&&(o=e.return(),Object(o)!==o))return}finally{if(u)throw r}}return a}}(A,t)||function(A,t){if(A){if("string"==typeof A)return Y(A,t);var e={}.toString.call(A).slice(8,-1);return"Object"===e&&A.constructor&&(e=A.constructor.name),"Map"===e||"Set"===e?Array.from(A):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Y(A,t):void 0}}(A,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.")}()}var J=Z((function A(t,e){var n=e.default,r=void 0===n?null:n,i=e.triggerUpdate,o=void 0===i||i,a=e.onChange,l=void 0===a?function(A,t){}:a;!function(A,t){if(!(A instanceof t))throw new TypeError("Cannot call a class as a function")}(this,A),this.name=t,this.defaultVal=r,this.triggerUpdate=o,this.onChange=l}));function K(A){var t=A.stateInit,e=void 0===t?function(){return{}}:t,n=A.props,r=void 0===n?{}:n,i=A.methods,o=void 0===i?{}:i,a=A.aliases,l=void 0===a?{}:a,u=A.init,s=void 0===u?function(){}:u,f=A.update,c=void 0===f?function(){}:f,h=Object.keys(r).map((function(A){return new J(A,r[A])}));return function A(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=!!(this instanceof A?this.constructor:void 0),a=i?n.shift():void 0,u=n[0],f=void 0===u?{}:u,d=Object.assign({},e instanceof Function?e(f):e,{initialised:!1}),p={};function m(A){return g(A,f),v(),m}var g=function(A,t){s.call(m,A,d,t),d.initialised=!0},v=W((function(){d.initialised&&(c.call(m,d,p),p={})}),1);return h.forEach((function(A){m[A.name]=function(A){var t=A.name,e=A.triggerUpdate,n=void 0!==e&&e,r=A.onChange,i=void 0===r?function(A,t){}:r,o=A.defaultVal,a=void 0===o?null:o;return function(A){var e=d[t];if(!arguments.length)return e;var r=void 0===A?a:A;return d[t]=r,i.call(m,r,d,e),!p.hasOwnProperty(t)&&(p[t]=e),n&&v(),m}}(A)})),Object.keys(o).forEach((function(A){m[A]=function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=o[A]).call.apply(t,[m,d].concat(n))}})),Object.entries(l).forEach((function(A){var t=X(A,2),e=t[0],n=t[1];return m[e]=m[n]})),m.resetProps=function(){return h.forEach((function(A){m[A.name](A.defaultVal)})),m},m.resetProps(),d._rerender=v,i&&a&&m(a),m}}var $,AA=Object.freeze({Linear:Object.freeze({None:function(A){return A},In:function(A){return A},Out:function(A){return A},InOut:function(A){return A}}),Quadratic:Object.freeze({In:function(A){return A*A},Out:function(A){return A*(2-A)},InOut:function(A){return(A*=2)<1?.5*A*A:-.5*(--A*(A-2)-1)}}),Cubic:Object.freeze({In:function(A){return A*A*A},Out:function(A){return--A*A*A+1},InOut:function(A){return(A*=2)<1?.5*A*A*A:.5*((A-=2)*A*A+2)}}),Quartic:Object.freeze({In:function(A){return A*A*A*A},Out:function(A){return 1- --A*A*A*A},InOut:function(A){return(A*=2)<1?.5*A*A*A*A:-.5*((A-=2)*A*A*A-2)}}),Quintic:Object.freeze({In:function(A){return A*A*A*A*A},Out:function(A){return--A*A*A*A*A+1},InOut:function(A){return(A*=2)<1?.5*A*A*A*A*A:.5*((A-=2)*A*A*A*A+2)}}),Sinusoidal:Object.freeze({In:function(A){return 1-Math.sin((1-A)*Math.PI/2)},Out:function(A){return Math.sin(A*Math.PI/2)},InOut:function(A){return.5*(1-Math.sin(Math.PI*(.5-A)))}}),Exponential:Object.freeze({In:function(A){return 0===A?0:Math.pow(1024,A-1)},Out:function(A){return 1===A?1:1-Math.pow(2,-10*A)},InOut:function(A){return 0===A?0:1===A?1:(A*=2)<1?.5*Math.pow(1024,A-1):.5*(2-Math.pow(2,-10*(A-1)))}}),Circular:Object.freeze({In:function(A){return 1-Math.sqrt(1-A*A)},Out:function(A){return Math.sqrt(1- --A*A)},InOut:function(A){return(A*=2)<1?-.5*(Math.sqrt(1-A*A)-1):.5*(Math.sqrt(1-(A-=2)*A)+1)}}),Elastic:Object.freeze({In:function(A){return 0===A?0:1===A?1:-Math.pow(2,10*(A-1))*Math.sin(5*(A-1.1)*Math.PI)},Out:function(A){return 0===A?0:1===A?1:Math.pow(2,-10*A)*Math.sin(5*(A-.1)*Math.PI)+1},InOut:function(A){return 0===A?0:1===A?1:(A*=2)<1?-.5*Math.pow(2,10*(A-1))*Math.sin(5*(A-1.1)*Math.PI):.5*Math.pow(2,-10*(A-1))*Math.sin(5*(A-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(A){var t=1.70158;return 1===A?1:A*A*((t+1)*A-t)},Out:function(A){var t=1.70158;return 0===A?0:--A*A*((t+1)*A+t)+1},InOut:function(A){var t=2.5949095;return(A*=2)<1?A*A*((t+1)*A-t)*.5:.5*((A-=2)*A*((t+1)*A+t)+2)}}),Bounce:Object.freeze({In:function(A){return 1-AA.Bounce.Out(1-A)},Out:function(A){return A<1/2.75?7.5625*A*A:A<2/2.75?7.5625*(A-=1.5/2.75)*A+.75:A<2.5/2.75?7.5625*(A-=2.25/2.75)*A+.9375:7.5625*(A-=2.625/2.75)*A+.984375},InOut:function(A){return A<.5?.5*AA.Bounce.In(2*A):.5*AA.Bounce.Out(2*A-1)+.5}}),generatePow:function(A){return void 0===A&&(A=4),A=(A=A<Number.EPSILON?Number.EPSILON:A)>1e4?1e4:A,{In:function(t){return Math.pow(t,A)},Out:function(t){return 1-Math.pow(1-t,A)},InOut:function(t){return t<.5?Math.pow(2*t,A)/2:(1-Math.pow(2-2*t,A))/2+.5}}}}),tA=function(){return performance.now()},eA=function(){function A(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,A)}return A.prototype.getAll=function(){var A=this;return Object.keys(this._tweens).map((function(t){return A._tweens[t]}))},A.prototype.removeAll=function(){this._tweens={}},A.prototype.add=function(){for(var A,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0,r=t;n<r.length;n++){var i=r[n];null===(A=i._group)||void 0===A||A.remove(i),i._group=this,this._tweens[i.getId()]=i,this._tweensAddedDuringUpdate[i.getId()]=i}},A.prototype.remove=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];for(var e=0,n=A;e<n.length;e++){var r=n[e];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},A.prototype.allStopped=function(){return this.getAll().every((function(A){return!A.isPlaying()}))},A.prototype.update=function(A,t){void 0===A&&(A=tA()),void 0===t&&(t=!0);var e=Object.keys(this._tweens);if(0!==e.length)for(;e.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<e.length;n++){var r=this._tweens[e[n]],i=!t;r&&!1===r.update(A,i)&&!t&&this.remove(r)}e=Object.keys(this._tweensAddedDuringUpdate)}},A}(),nA={Linear:function(A,t){var e=A.length-1,n=e*t,r=Math.floor(n),i=nA.Utils.Linear;return t<0?i(A[0],A[1],n):t>1?i(A[e],A[e-1],e-n):i(A[r],A[r+1>e?e:r+1],n-r)},Bezier:function(A,t){for(var e=0,n=A.length-1,r=Math.pow,i=nA.Utils.Bernstein,o=0;o<=n;o++)e+=r(1-t,n-o)*r(t,o)*A[o]*i(n,o);return e},CatmullRom:function(A,t){var e=A.length-1,n=e*t,r=Math.floor(n),i=nA.Utils.CatmullRom;return A[0]===A[e]?(t<0&&(r=Math.floor(n=e*(1+t))),i(A[(r-1+e)%e],A[r],A[(r+1)%e],A[(r+2)%e],n-r)):t<0?A[0]-(i(A[0],A[0],A[1],A[1],-n)-A[0]):t>1?A[e]-(i(A[e],A[e],A[e-1],A[e-1],n-e)-A[e]):i(A[r?r-1:0],A[r],A[e<r+1?e:r+1],A[e<r+2?e:r+2],n-r)},Utils:{Linear:function(A,t,e){return(t-A)*e+A},Bernstein:function(A,t){var e=nA.Utils.Factorial;return e(A)/e(t)/e(A-t)},Factorial:($=[1],function(A){var t=1;if($[A])return $[A];for(var e=A;e>1;e--)t*=e;return $[A]=t,t}),CatmullRom:function(A,t,e,n,r){var i=.5*(e-A),o=.5*(n-t),a=r*r;return(2*t-2*e+i+o)*(r*a)+(-3*t+3*e-2*i-o)*a+i*r+t}}},rA=function(){function A(){}return A.nextId=function(){return A._nextId++},A._nextId=0,A}(),iA=new eA,oA=function(){function A(A,t){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=AA.Linear.None,this._interpolationFunction=nA.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=rA.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=A,"object"==typeof t?(this._group=t,t.add(this)):!0===t&&(this._group=iA,iA.add(this))}return A.prototype.getId=function(){return this._id},A.prototype.isPlaying=function(){return this._isPlaying},A.prototype.isPaused=function(){return this._isPaused},A.prototype.getDuration=function(){return this._duration},A.prototype.to=function(A,t){if(void 0===t&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=A,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},A.prototype.duration=function(A){return void 0===A&&(A=1e3),this._duration=A<0?0:A,this},A.prototype.dynamic=function(A){return void 0===A&&(A=!1),this._isDynamic=A,this},A.prototype.start=function(A,t){if(void 0===A&&(A=tA()),void 0===t&&(t=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var e in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=A,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var r in this._valuesEnd)n[r]=this._valuesEnd[r];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},A.prototype.startFromCurrentValues=function(A){return this.start(A,!0)},A.prototype._setupProperties=function(A,t,e,n,r){for(var i in e){var o=A[i],a=Array.isArray(o),l=a?"array":typeof o,u=!a&&Array.isArray(e[i]);if("undefined"!==l&&"function"!==l){if(u){if(0===(m=e[i]).length)continue;for(var s=[o],f=0,c=m.length;f<c;f+=1){var h=this._handleRelativeValue(o,m[f]);if(isNaN(h)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}s.push(h)}u&&(e[i]=s)}if("object"!==l&&!a||!o||u)(void 0===t[i]||r)&&(t[i]=o),a||(t[i]*=1),n[i]=u?e[i].slice().reverse():t[i]||0;else{t[i]=a?[]:{};var d=o;for(var p in d)t[i][p]=d[p];n[i]=a?[]:{};var m=e[i];if(!this._isDynamic){var g={};for(var p in m)g[p]=m[p];e[i]=m=g}this._setupProperties(d,t[i],m,n[i],r)}}}},A.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},A.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},A.prototype.pause=function(A){return void 0===A&&(A=tA()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=A),this},A.prototype.resume=function(A){return void 0===A&&(A=tA()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=A-this._pauseStart,this._pauseStart=0,this):this},A.prototype.stopChainedTweens=function(){for(var A=0,t=this._chainedTweens.length;A<t;A++)this._chainedTweens[A].stop();return this},A.prototype.group=function(A){return A?(A.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},A.prototype.remove=function(){var A;return null===(A=this._group)||void 0===A||A.remove(this),this},A.prototype.delay=function(A){return void 0===A&&(A=0),this._delayTime=A,this},A.prototype.repeat=function(A){return void 0===A&&(A=0),this._initialRepeat=A,this._repeat=A,this},A.prototype.repeatDelay=function(A){return this._repeatDelayTime=A,this},A.prototype.yoyo=function(A){return void 0===A&&(A=!1),this._yoyo=A,this},A.prototype.easing=function(A){return void 0===A&&(A=AA.Linear.None),this._easingFunction=A,this},A.prototype.interpolation=function(A){return void 0===A&&(A=nA.Linear),this._interpolationFunction=A,this},A.prototype.chain=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];return this._chainedTweens=A,this},A.prototype.onStart=function(A){return this._onStartCallback=A,this},A.prototype.onEveryStart=function(A){return this._onEveryStartCallback=A,this},A.prototype.onUpdate=function(A){return this._onUpdateCallback=A,this},A.prototype.onRepeat=function(A){return this._onRepeatCallback=A,this},A.prototype.onComplete=function(A){return this._onCompleteCallback=A,this},A.prototype.onStop=function(A){return this._onStopCallback=A,this},A.prototype.update=function(t,e){var n,r,i=this;if(void 0===t&&(t=tA()),void 0===e&&(e=A.autoStartOnUpdate),this._isPaused)return!0;if(!this._goToEnd&&!this._isPlaying){if(!e)return!1;this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var o=t-this._startTime,a=this._duration+(null!==(n=this._repeatDelayTime)&&void 0!==n?n:this._delayTime),l=this._duration+this._repeat*a,u=function(){if(0===i._duration)return 1;if(o>l)return 1;var A=Math.trunc(o/a),t=o-A*a,e=Math.min(t/i._duration,1);return 0===e&&o===i._duration?1:e}(),s=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,s),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),0===this._duration||o>=this._duration){if(this._repeat>0){var f=Math.min(Math.trunc((o-this._duration)/a)+1,this._repeat);for(r in isFinite(this._repeat)&&(this._repeat-=f),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[r]||(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*f,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var c=0,h=this._chainedTweens.length;c<h;c++)this._chainedTweens[c].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},A.prototype._updateProperties=function(A,t,e,n){for(var r in e)if(void 0!==t[r]){var i=t[r]||0,o=e[r],a=Array.isArray(A[r]),l=Array.isArray(o);!a&&l?A[r]=this._interpolationFunction(o,n):"object"==typeof o&&o?this._updateProperties(A[r],i,o,n):"number"==typeof(o=this._handleRelativeValue(i,o))&&(A[r]=i+(o-i)*n)}},A.prototype._handleRelativeValue=function(A,t){return"string"!=typeof t?t:"+"===t.charAt(0)||"-"===t.charAt(0)?A+parseFloat(t):parseFloat(t)},A.prototype._swapEndStartRepeatValues=function(A){var t=this._valuesStartRepeat[A],e=this._valuesEnd[A];this._valuesStartRepeat[A]="string"==typeof e?this._valuesStartRepeat[A]+parseFloat(e):this._valuesEnd[A],this._valuesEnd[A]=t},A.autoStartOnUpdate=!1,A}(),aA=iA;aA.getAll.bind(aA),aA.removeAll.bind(aA),aA.add.bind(aA),aA.remove.bind(aA),aA.update.bind(aA);var lA=function(A){A instanceof Array?A.forEach(lA):(A.map&&A.map.dispose(),A.dispose())},uA=function(A){A.geometry&&A.geometry.dispose(),A.material&&lA(A.material),A.texture&&A.texture.dispose(),A.children&&A.children.forEach(uA)},sA=function(A){if(A&&A.children)for(;A.children.length;){var t=A.children[0];A.remove(t),uA(t)}};function fA(A,t){var e=new t;return{linkProp:function(t){return{default:e[t](),onChange:function(e,n){n[A][t](e)},triggerUpdate:!1}},linkMethod:function(t){return function(e){for(var n=e[A],r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];var a=n[t].apply(n,i);return a===n?this:a}}}}var cA=100;function hA(){return cA}function dA(A,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(90-A)*Math.PI/180,r=(90-t)*Math.PI/180,i=cA*(1+e);return{x:i*Math.sin(n)*Math.cos(r),y:i*Math.cos(n),z:i*Math.sin(n)*Math.sin(r)}}function pA(A){var t=A.x,e=A.y,n=A.z,r=Math.sqrt(t*t+e*e+n*n),i=Math.acos(e/r),o=Math.atan2(n,t);return{lat:90-180*i/Math.PI,lng:90-180*o/Math.PI-(o<-Math.PI/2?360:0),altitude:r/cA-1}}function mA(A){return A*Math.PI/180}function gA(A,t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n))return A;var i,o,a,l,u,s,f,c,h,d,p,m,g=A._root,v={data:r},y=A._x0,b=A._y0,q=A._z0,w=A._x1,_=A._y1,x=A._z1;if(!g)return A._root=v,A;for(;g.length;)if((c=t>=(o=(y+w)/2))?y=o:w=o,(h=e>=(a=(b+_)/2))?b=a:_=a,(d=n>=(l=(q+x)/2))?q=l:x=l,i=g,!(g=g[p=d<<2|h<<1|c]))return i[p]=v,A;if(u=+A._x.call(null,g.data),s=+A._y.call(null,g.data),f=+A._z.call(null,g.data),t===u&&e===s&&n===f)return v.next=g,i?i[p]=v:A._root=v,A;do{i=i?i[p]=new Array(8):A._root=new Array(8),(c=t>=(o=(y+w)/2))?y=o:w=o,(h=e>=(a=(b+_)/2))?b=a:_=a,(d=n>=(l=(q+x)/2))?q=l:x=l}while((p=d<<2|h<<1|c)==(m=(f>=l)<<2|(s>=a)<<1|u>=o));return i[m]=g,i[p]=v,A}function vA(A,t,e,n,r,i,o){this.node=A,this.x0=t,this.y0=e,this.z0=n,this.x1=r,this.y1=i,this.z1=o}const yA=(A,t,e,n,r,i)=>Math.sqrt((A-n)**2+(t-r)**2+(e-i)**2);function bA(A){return A[0]}function qA(A){return A[1]}function wA(A){return A[2]}function _A(A,t,e,n){var r=new xA(null==t?bA:t,null==e?qA:e,null==n?wA:n,NaN,NaN,NaN,NaN,NaN,NaN);return null==A?r:r.addAll(A)}function xA(A,t,e,n,r,i,o,a,l){this._x=A,this._y=t,this._z=e,this._x0=n,this._y0=r,this._z0=i,this._x1=o,this._y1=a,this._z1=l,this._root=void 0}function MA(A){for(var t={data:A.data},e=t;A=A.next;)e=e.next={data:A.data};return t}var EA=_A.prototype=xA.prototype;function BA(A,t){return null==A||null==t?NaN:A<t?-1:A>t?1:A>=t?0:NaN}function kA(A,t){return null==A||null==t?NaN:t<A?-1:t>A?1:t>=A?0:NaN}function SA(A){let t,e,n;function r(A,n,r=0,i=A.length){if(r<i){if(0!==t(n,n))return i;do{const t=r+i>>>1;e(A[t],n)<0?r=t+1:i=t}while(r<i)}return r}return 2!==A.length?(t=BA,e=(t,e)=>BA(A(t),e),n=(t,e)=>A(t)-e):(t=A===BA||A===kA?A:DA,e=A,n=A),{left:r,center:function(A,t,e=0,i=A.length){const o=r(A,t,e,i-1);return o>e&&n(A[o-1],t)>-n(A[o],t)?o-1:o},right:function(A,n,r=0,i=A.length){if(r<i){if(0!==t(n,n))return i;do{const t=r+i>>>1;e(A[t],n)<=0?r=t+1:i=t}while(r<i)}return r}}}function DA(){return 0}EA.copy=function(){var A,t,e=new xA(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),n=this._root;if(!n)return e;if(!n.length)return e._root=MA(n),e;for(A=[{source:n,target:e._root=new Array(8)}];n=A.pop();)for(var r=0;r<8;++r)(t=n.source[r])&&(t.length?A.push({source:t,target:n.target[r]=new Array(8)}):n.target[r]=MA(t));return e},EA.add=function(A){const t=+this._x.call(null,A),e=+this._y.call(null,A),n=+this._z.call(null,A);return gA(this.cover(t,e,n),t,e,n,A)},EA.addAll=function(A){Array.isArray(A)||(A=Array.from(A));const t=A.length,e=new Float64Array(t),n=new Float64Array(t),r=new Float64Array(t);let i=1/0,o=1/0,a=1/0,l=-1/0,u=-1/0,s=-1/0;for(let f,c,h,d,p=0;p<t;++p)isNaN(c=+this._x.call(null,f=A[p]))||isNaN(h=+this._y.call(null,f))||isNaN(d=+this._z.call(null,f))||(e[p]=c,n[p]=h,r[p]=d,c<i&&(i=c),c>l&&(l=c),h<o&&(o=h),h>u&&(u=h),d<a&&(a=d),d>s&&(s=d));if(i>l||o>u||a>s)return this;this.cover(i,o,a).cover(l,u,s);for(let i=0;i<t;++i)gA(this,e[i],n[i],r[i],A[i]);return this},EA.cover=function(A,t,e){if(isNaN(A=+A)||isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._z0,o=this._x1,a=this._y1,l=this._z1;if(isNaN(n))o=(n=Math.floor(A))+1,a=(r=Math.floor(t))+1,l=(i=Math.floor(e))+1;else{for(var u,s,f=o-n||1,c=this._root;n>A||A>=o||r>t||t>=a||i>e||e>=l;)switch(s=(e<i)<<2|(t<r)<<1|A<n,(u=new Array(8))[s]=c,c=u,f*=2,s){case 0:o=n+f,a=r+f,l=i+f;break;case 1:n=o-f,a=r+f,l=i+f;break;case 2:o=n+f,r=a-f,l=i+f;break;case 3:n=o-f,r=a-f,l=i+f;break;case 4:o=n+f,a=r+f,i=l-f;break;case 5:n=o-f,a=r+f,i=l-f;break;case 6:o=n+f,r=a-f,i=l-f;break;case 7:n=o-f,r=a-f,i=l-f}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._z0=i,this._x1=o,this._y1=a,this._z1=l,this},EA.data=function(){var A=[];return this.visit((function(t){if(!t.length)do{A.push(t.data)}while(t=t.next)})),A},EA.extent=function(A){return arguments.length?this.cover(+A[0][0],+A[0][1],+A[0][2]).cover(+A[1][0],+A[1][1],+A[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]},EA.find=function(A,t,e,n){var r,i,o,a,l,u,s,f,c,h=this._x0,d=this._y0,p=this._z0,m=this._x1,g=this._y1,v=this._z1,y=[],b=this._root;for(b&&y.push(new vA(b,h,d,p,m,g,v)),null==n?n=1/0:(h=A-n,d=t-n,p=e-n,m=A+n,g=t+n,v=e+n,n*=n);f=y.pop();)if(!(!(b=f.node)||(i=f.x0)>m||(o=f.y0)>g||(a=f.z0)>v||(l=f.x1)<h||(u=f.y1)<d||(s=f.z1)<p))if(b.length){var q=(i+l)/2,w=(o+u)/2,_=(a+s)/2;y.push(new vA(b[7],q,w,_,l,u,s),new vA(b[6],i,w,_,q,u,s),new vA(b[5],q,o,_,l,w,s),new vA(b[4],i,o,_,q,w,s),new vA(b[3],q,w,a,l,u,_),new vA(b[2],i,w,a,q,u,_),new vA(b[1],q,o,a,l,w,_),new vA(b[0],i,o,a,q,w,_)),(c=(e>=_)<<2|(t>=w)<<1|A>=q)&&(f=y[y.length-1],y[y.length-1]=y[y.length-1-c],y[y.length-1-c]=f)}else{var x=A-+this._x.call(null,b.data),M=t-+this._y.call(null,b.data),E=e-+this._z.call(null,b.data),B=x*x+M*M+E*E;if(B<n){var k=Math.sqrt(n=B);h=A-k,d=t-k,p=e-k,m=A+k,g=t+k,v=e+k,r=b.data}}return r},EA.findAllWithinRadius=function(A,t,e,n){const r=[],i=A-n,o=t-n,a=e-n,l=A+n,u=t+n,s=e+n;return this.visit(((f,c,h,d,p,m,g)=>{if(!f.length)do{const i=f.data;yA(A,t,e,this._x(i),this._y(i),this._z(i))<=n&&r.push(i)}while(f=f.next);return c>l||h>u||d>s||p<i||m<o||g<a})),r},EA.remove=function(A){if(isNaN(i=+this._x.call(null,A))||isNaN(o=+this._y.call(null,A))||isNaN(a=+this._z.call(null,A)))return this;var t,e,n,r,i,o,a,l,u,s,f,c,h,d,p,m=this._root,g=this._x0,v=this._y0,y=this._z0,b=this._x1,q=this._y1,w=this._z1;if(!m)return this;if(m.length)for(;;){if((f=i>=(l=(g+b)/2))?g=l:b=l,(c=o>=(u=(v+q)/2))?v=u:q=u,(h=a>=(s=(y+w)/2))?y=s:w=s,t=m,!(m=m[d=h<<2|c<<1|f]))return this;if(!m.length)break;(t[d+1&7]||t[d+2&7]||t[d+3&7]||t[d+4&7]||t[d+5&7]||t[d+6&7]||t[d+7&7])&&(e=t,p=d)}for(;m.data!==A;)if(n=m,!(m=m.next))return this;return(r=m.next)&&delete m.next,n?(r?n.next=r:delete n.next,this):t?(r?t[d]=r:delete t[d],(m=t[0]||t[1]||t[2]||t[3]||t[4]||t[5]||t[6]||t[7])&&m===(t[7]||t[6]||t[5]||t[4]||t[3]||t[2]||t[1]||t[0])&&!m.length&&(e?e[p]=m:this._root=m),this):(this._root=r,this)},EA.removeAll=function(A){for(var t=0,e=A.length;t<e;++t)this.remove(A[t]);return this},EA.root=function(){return this._root},EA.size=function(){var A=0;return this.visit((function(t){if(!t.length)do{++A}while(t=t.next)})),A},EA.visit=function(A){var t,e,n,r,i,o,a,l,u=[],s=this._root;for(s&&u.push(new vA(s,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=u.pop();)if(!A(s=t.node,n=t.x0,r=t.y0,i=t.z0,o=t.x1,a=t.y1,l=t.z1)&&s.length){var f=(n+o)/2,c=(r+a)/2,h=(i+l)/2;(e=s[7])&&u.push(new vA(e,f,c,h,o,a,l)),(e=s[6])&&u.push(new vA(e,n,c,h,f,a,l)),(e=s[5])&&u.push(new vA(e,f,r,h,o,c,l)),(e=s[4])&&u.push(new vA(e,n,r,h,f,c,l)),(e=s[3])&&u.push(new vA(e,f,c,i,o,a,h)),(e=s[2])&&u.push(new vA(e,n,c,i,f,a,h)),(e=s[1])&&u.push(new vA(e,f,r,i,o,c,h)),(e=s[0])&&u.push(new vA(e,n,r,i,f,c,h))}return this},EA.visitAfter=function(A){var t,e=[],n=[];for(this._root&&e.push(new vA(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=e.pop();){var r=t.node;if(r.length){var i,o=t.x0,a=t.y0,l=t.z0,u=t.x1,s=t.y1,f=t.z1,c=(o+u)/2,h=(a+s)/2,d=(l+f)/2;(i=r[0])&&e.push(new vA(i,o,a,l,c,h,d)),(i=r[1])&&e.push(new vA(i,c,a,l,u,h,d)),(i=r[2])&&e.push(new vA(i,o,h,l,c,s,d)),(i=r[3])&&e.push(new vA(i,c,h,l,u,s,d)),(i=r[4])&&e.push(new vA(i,o,a,d,c,h,f)),(i=r[5])&&e.push(new vA(i,c,a,d,u,h,f)),(i=r[6])&&e.push(new vA(i,o,h,d,c,s,f)),(i=r[7])&&e.push(new vA(i,c,h,d,u,s,f))}n.push(t)}for(;t=n.pop();)A(t.node,t.x0,t.y0,t.z0,t.x1,t.y1,t.z1);return this},EA.x=function(A){return arguments.length?(this._x=A,this):this._x},EA.y=function(A){return arguments.length?(this._y=A,this):this._y},EA.z=function(A){return arguments.length?(this._z=A,this):this._z};const CA=SA(BA).right;function TA(A,t){let e,n;if(void 0===t)for(const t of A)null!=t&&(void 0===e?t>=t&&(e=n=t):(e>t&&(e=t),n<t&&(n=t)));else{let r=-1;for(let i of A)null!=(i=t(i,++r,A))&&(void 0===e?i>=i&&(e=n=i):(e>i&&(e=i),n<i&&(n=i)))}return[e,n]}SA((function(A){return null===A?NaN:+A})).center;class PA{constructor(){this._partials=new Float64Array(32),this._n=0}add(A){const t=this._partials;let e=0;for(let n=0;n<this._n&&n<32;n++){const r=t[n],i=A+r,o=Math.abs(A)<Math.abs(r)?A-(i-r):r-(i-A);o&&(t[e++]=o),A=i}return t[e]=A,this._n=e+1,this}valueOf(){const A=this._partials;let t,e,n,r=this._n,i=0;if(r>0){for(i=A[--r];r>0&&(t=i,e=A[--r],i=t+e,n=e-(i-t),!n););r>0&&(n<0&&A[r-1]<0||n>0&&A[r-1]>0)&&(e=2*n,t=i+e,e==t-i&&(i=t))}return i}}const OA=Math.sqrt(50),IA=Math.sqrt(10),jA=Math.sqrt(2);function RA(A,t,e){const n=(t-A)/Math.max(0,e),r=Math.floor(Math.log10(n)),i=n/Math.pow(10,r),o=i>=OA?10:i>=IA?5:i>=jA?2:1;let a,l,u;return r<0?(u=Math.pow(10,-r)/o,a=Math.round(A*u),l=Math.round(t*u),a/u<A&&++a,l/u>t&&--l,u=-u):(u=Math.pow(10,r)*o,a=Math.round(A/u),l=Math.round(t/u),a*u<A&&++a,l*u>t&&--l),l<a&&.5<=e&&e<2?RA(A,t,2*e):[a,l,u]}function LA(A,t,e){return RA(A=+A,t=+t,e=+e)[2]}function QA(A){return Array.from(function*(A){for(const t of A)yield*t}(A))}function GA(A,t,e){A=+A,t=+t,e=(r=arguments.length)<2?(t=A,A=0,1):r<3?1:+e;for(var n=-1,r=0|Math.max(0,Math.ceil((t-A)/e)),i=new Array(r);++n<r;)i[n]=A+n*e;return i}function FA(A,t){switch(arguments.length){case 0:break;case 1:this.range(A);break;default:this.range(t).domain(A)}return this}function zA(A,t,e){A.prototype=t.prototype=e,e.constructor=A}function UA(A,t){var e=Object.create(A.prototype);for(var n in t)e[n]=t[n];return e}function NA(){}var HA=.7,VA=1/HA,WA="\\s*([+-]?\\d+)\\s*",YA="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ZA="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",XA=/^#([0-9a-f]{3,8})$/,JA=new RegExp(`^rgb\\(${WA},${WA},${WA}\\)$`),KA=new RegExp(`^rgb\\(${ZA},${ZA},${ZA}\\)$`),$A=new RegExp(`^rgba\\(${WA},${WA},${WA},${YA}\\)$`),At=new RegExp(`^rgba\\(${ZA},${ZA},${ZA},${YA}\\)$`),tt=new RegExp(`^hsl\\(${YA},${ZA},${ZA}\\)$`),et=new RegExp(`^hsla\\(${YA},${ZA},${ZA},${YA}\\)$`),nt={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 rt(){return this.rgb().formatHex()}function it(){return this.rgb().formatRgb()}function ot(A){var t,e;return A=(A+"").trim().toLowerCase(),(t=XA.exec(A))?(e=t[1].length,t=parseInt(t[1],16),6===e?at(t):3===e?new st(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===e?lt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===e?lt(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=JA.exec(A))?new st(t[1],t[2],t[3],1):(t=KA.exec(A))?new st(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=$A.exec(A))?lt(t[1],t[2],t[3],t[4]):(t=At.exec(A))?lt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=tt.exec(A))?mt(t[1],t[2]/100,t[3]/100,1):(t=et.exec(A))?mt(t[1],t[2]/100,t[3]/100,t[4]):nt.hasOwnProperty(A)?at(nt[A]):"transparent"===A?new st(NaN,NaN,NaN,0):null}function at(A){return new st(A>>16&255,A>>8&255,255&A,1)}function lt(A,t,e,n){return n<=0&&(A=t=e=NaN),new st(A,t,e,n)}function ut(A,t,e,n){return 1===arguments.length?((r=A)instanceof NA||(r=ot(r)),r?new st((r=r.rgb()).r,r.g,r.b,r.opacity):new st):new st(A,t,e,null==n?1:n);var r}function st(A,t,e,n){this.r=+A,this.g=+t,this.b=+e,this.opacity=+n}function ft(){return`#${pt(this.r)}${pt(this.g)}${pt(this.b)}`}function ct(){const A=ht(this.opacity);return`${1===A?"rgb(":"rgba("}${dt(this.r)}, ${dt(this.g)}, ${dt(this.b)}${1===A?")":`, ${A})`}`}function ht(A){return isNaN(A)?1:Math.max(0,Math.min(1,A))}function dt(A){return Math.max(0,Math.min(255,Math.round(A)||0))}function pt(A){return((A=dt(A))<16?"0":"")+A.toString(16)}function mt(A,t,e,n){return n<=0?A=t=e=NaN:e<=0||e>=1?A=t=NaN:t<=0&&(A=NaN),new vt(A,t,e,n)}function gt(A){if(A instanceof vt)return new vt(A.h,A.s,A.l,A.opacity);if(A instanceof NA||(A=ot(A)),!A)return new vt;if(A instanceof vt)return A;var t=(A=A.rgb()).r/255,e=A.g/255,n=A.b/255,r=Math.min(t,e,n),i=Math.max(t,e,n),o=NaN,a=i-r,l=(i+r)/2;return a?(o=t===i?(e-n)/a+6*(e<n):e===i?(n-t)/a+2:(t-e)/a+4,a/=l<.5?i+r:2-i-r,o*=60):a=l>0&&l<1?0:o,new vt(o,a,l,A.opacity)}function vt(A,t,e,n){this.h=+A,this.s=+t,this.l=+e,this.opacity=+n}function yt(A){return(A=(A||0)%360)<0?A+360:A}function bt(A){return Math.max(0,Math.min(1,A||0))}function qt(A,t,e){return 255*(A<60?t+(e-t)*A/60:A<180?e:A<240?t+(e-t)*(240-A)/60:t)}zA(NA,ot,{copy(A){return Object.assign(new this.constructor,this,A)},displayable(){return this.rgb().displayable()},hex:rt,formatHex:rt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return gt(this).formatHsl()},formatRgb:it,toString:it}),zA(st,ut,UA(NA,{brighter(A){return A=null==A?VA:Math.pow(VA,A),new st(this.r*A,this.g*A,this.b*A,this.opacity)},darker(A){return A=null==A?HA:Math.pow(HA,A),new st(this.r*A,this.g*A,this.b*A,this.opacity)},rgb(){return this},clamp(){return new st(dt(this.r),dt(this.g),dt(this.b),ht(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:ft,formatHex:ft,formatHex8:function(){return`#${pt(this.r)}${pt(this.g)}${pt(this.b)}${pt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ct,toString:ct})),zA(vt,(function(A,t,e,n){return 1===arguments.length?gt(A):new vt(A,t,e,null==n?1:n)}),UA(NA,{brighter(A){return A=null==A?VA:Math.pow(VA,A),new vt(this.h,this.s,this.l*A,this.opacity)},darker(A){return A=null==A?HA:Math.pow(HA,A),new vt(this.h,this.s,this.l*A,this.opacity)},rgb(){var A=this.h%360+360*(this.h<0),t=isNaN(A)||isNaN(this.s)?0:this.s,e=this.l,n=e+(e<.5?e:1-e)*t,r=2*e-n;return new st(qt(A>=240?A-240:A+120,r,n),qt(A,r,n),qt(A<120?A+240:A-120,r,n),this.opacity)},clamp(){return new vt(yt(this.h),bt(this.s),bt(this.l),ht(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(){const A=ht(this.opacity);return`${1===A?"hsl(":"hsla("}${yt(this.h)}, ${100*bt(this.s)}%, ${100*bt(this.l)}%${1===A?")":`, ${A})`}`}}));var wt=A=>()=>A;function _t(A){return 1==(A=+A)?xt:function(t,e){return e-t?function(A,t,e){return A=Math.pow(A,e),t=Math.pow(t,e)-A,e=1/e,function(n){return Math.pow(A+n*t,e)}}(t,e,A):wt(isNaN(t)?e:t)}}function xt(A,t){var e=t-A;return e?function(A,t){return function(e){return A+e*t}}(A,e):wt(isNaN(A)?t:A)}var Mt=function A(t){var e=_t(t);function n(A,t){var n=e((A=ut(A)).r,(t=ut(t)).r),r=e(A.g,t.g),i=e(A.b,t.b),o=xt(A.opacity,t.opacity);return function(t){return A.r=n(t),A.g=r(t),A.b=i(t),A.opacity=o(t),A+""}}return n.gamma=A,n}(1);function Et(A,t){t||(t=[]);var e,n=A?Math.min(t.length,A.length):0,r=t.slice();return function(i){for(e=0;e<n;++e)r[e]=A[e]*(1-i)+t[e]*i;return r}}function Bt(A){return ArrayBuffer.isView(A)&&!(A instanceof DataView)}function kt(A,t){return(Bt(t)?Et:St)(A,t)}function St(A,t){var e,n=t?t.length:0,r=A?Math.min(n,A.length):0,i=new Array(r),o=new Array(n);for(e=0;e<r;++e)i[e]=jt(A[e],t[e]);for(;e<n;++e)o[e]=t[e];return function(A){for(e=0;e<r;++e)o[e]=i[e](A);return o}}function Dt(A,t){var e=new Date;return A=+A,t=+t,function(n){return e.setTime(A*(1-n)+t*n),e}}function Ct(A,t){return A=+A,t=+t,function(e){return A*(1-e)+t*e}}function Tt(A,t){var e,n={},r={};for(e in null!==A&&"object"==typeof A||(A={}),null!==t&&"object"==typeof t||(t={}),t)e in A?n[e]=jt(A[e],t[e]):r[e]=t[e];return function(A){for(e in n)r[e]=n[e](A);return r}}var Pt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ot=new RegExp(Pt.source,"g");function It(A,t){var e,n,r,i=Pt.lastIndex=Ot.lastIndex=0,o=-1,a=[],l=[];for(A+="",t+="";(e=Pt.exec(A))&&(n=Ot.exec(t));)(r=n.index)>i&&(r=t.slice(i,r),a[o]?a[o]+=r:a[++o]=r),(e=e[0])===(n=n[0])?a[o]?a[o]+=n:a[++o]=n:(a[++o]=null,l.push({i:o,x:Ct(e,n)})),i=Ot.lastIndex;return i<t.length&&(r=t.slice(i),a[o]?a[o]+=r:a[++o]=r),a.length<2?l[0]?function(A){return function(t){return A(t)+""}}(l[0].x):function(A){return function(){return A}}(t):(t=l.length,function(A){for(var e,n=0;n<t;++n)a[(e=l[n]).i]=e.x(A);return a.join("")})}function jt(A,t){var e,n=typeof t;return null==t||"boolean"===n?wt(t):("number"===n?Ct:"string"===n?(e=ot(t))?(t=e,Mt):It:t instanceof ot?Mt:t instanceof Date?Dt:Bt(t)?Et:Array.isArray(t)?St:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Tt:Ct)(A,t)}function Rt(A,t){return A=+A,t=+t,function(e){return Math.round(A*(1-e)+t*e)}}function Lt(A){return+A}var Qt=[0,1];function Gt(A){return A}function Ft(A,t){return(t-=A=+A)?function(e){return(e-A)/t}:(e=isNaN(t)?NaN:.5,function(){return e});var e}function zt(A,t,e){var n=A[0],r=A[1],i=t[0],o=t[1];return r<n?(n=Ft(r,n),i=e(o,i)):(n=Ft(n,r),i=e(i,o)),function(A){return i(n(A))}}function Ut(A,t,e){var n=Math.min(A.length,t.length)-1,r=new Array(n),i=new Array(n),o=-1;for(A[n]<A[0]&&(A=A.slice().reverse(),t=t.slice().reverse());++o<n;)r[o]=Ft(A[o],A[o+1]),i[o]=e(t[o],t[o+1]);return function(t){var e=CA(A,t,1,n)-1;return i[e](r[e](t))}}function Nt(){var A,t,e,n,r,i,o=Qt,a=Qt,l=jt,u=Gt;function s(){var A=Math.min(o.length,a.length);return u!==Gt&&(u=function(A,t){var e;return A>t&&(e=A,A=t,t=e),function(e){return Math.max(A,Math.min(t,e))}}(o[0],o[A-1])),n=A>2?Ut:zt,r=i=null,f}function f(t){return null==t||isNaN(t=+t)?e:(r||(r=n(o.map(A),a,l)))(A(u(t)))}return f.invert=function(e){return u(t((i||(i=n(a,o.map(A),Ct)))(e)))},f.domain=function(A){return arguments.length?(o=Array.from(A,Lt),s()):o.slice()},f.range=function(A){return arguments.length?(a=Array.from(A),s()):a.slice()},f.rangeRound=function(A){return a=Array.from(A),l=Rt,s()},f.clamp=function(A){return arguments.length?(u=!!A||Gt,s()):u!==Gt},f.interpolate=function(A){return arguments.length?(l=A,s()):l},f.unknown=function(A){return arguments.length?(e=A,f):e},function(e,n){return A=e,t=n,s()}}function Ht(A,t){if((e=(A=t?A.toExponential(t-1):A.toExponential()).indexOf("e"))<0)return null;var e,n=A.slice(0,e);return[n.length>1?n[0]+n.slice(2):n,+A.slice(e+1)]}function Vt(A){return(A=Ht(Math.abs(A)))?A[1]:NaN}var Wt,Yt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Zt(A){if(!(t=Yt.exec(A)))throw new Error("invalid format: "+A);var t;return new Xt({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 Xt(A){this.fill=void 0===A.fill?" ":A.fill+"",this.align=void 0===A.align?">":A.align+"",this.sign=void 0===A.sign?"-":A.sign+"",this.symbol=void 0===A.symbol?"":A.symbol+"",this.zero=!!A.zero,this.width=void 0===A.width?void 0:+A.width,this.comma=!!A.comma,this.precision=void 0===A.precision?void 0:+A.precision,this.trim=!!A.trim,this.type=void 0===A.type?"":A.type+""}function Jt(A,t){var e=Ht(A,t);if(!e)return A+"";var n=e[0],r=e[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}Zt.prototype=Xt.prototype,Xt.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 Kt={"%":(A,t)=>(100*A).toFixed(t),b:A=>Math.round(A).toString(2),c:A=>A+"",d:function(A){return Math.abs(A=Math.round(A))>=1e21?A.toLocaleString("en").replace(/,/g,""):A.toString(10)},e:(A,t)=>A.toExponential(t),f:(A,t)=>A.toFixed(t),g:(A,t)=>A.toPrecision(t),o:A=>Math.round(A).toString(8),p:(A,t)=>Jt(100*A,t),r:Jt,s:function(A,t){var e=Ht(A,t);if(!e)return A+"";var n=e[0],r=e[1],i=r-(Wt=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Ht(A,Math.max(0,t+i-1))[0]},X:A=>Math.round(A).toString(16).toUpperCase(),x:A=>Math.round(A).toString(16)};function $t(A){return A}var Ae,te,ee,ne=Array.prototype.map,re=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ie(A){var t,e,n=void 0===A.grouping||void 0===A.thousands?$t:(t=ne.call(A.grouping,Number),e=A.thousands+"",function(A,n){for(var r=A.length,i=[],o=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>n&&(a=Math.max(1,n-l)),i.push(A.substring(r-=a,r+a)),!((l+=a+1)>n));)a=t[o=(o+1)%t.length];return i.reverse().join(e)}),r=void 0===A.currency?"":A.currency[0]+"",i=void 0===A.currency?"":A.currency[1]+"",o=void 0===A.decimal?".":A.decimal+"",a=void 0===A.numerals?$t:function(A){return function(t){return t.replace(/[0-9]/g,(function(t){return A[+t]}))}}(ne.call(A.numerals,String)),l=void 0===A.percent?"%":A.percent+"",u=void 0===A.minus?"−":A.minus+"",s=void 0===A.nan?"NaN":A.nan+"";function f(A){var t=(A=Zt(A)).fill,e=A.align,f=A.sign,c=A.symbol,h=A.zero,d=A.width,p=A.comma,m=A.precision,g=A.trim,v=A.type;"n"===v?(p=!0,v="g"):Kt[v]||(void 0===m&&(m=12),g=!0,v="g"),(h||"0"===t&&"="===e)&&(h=!0,t="0",e="=");var y="$"===c?r:"#"===c&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===c?i:/[%p]/.test(v)?l:"",q=Kt[v],w=/[defgprs%]/.test(v);function _(A){var r,i,l,c=y,_=b;if("c"===v)_=q(A)+_,A="";else{var x=(A=+A)<0||1/A<0;if(A=isNaN(A)?s:q(Math.abs(A),m),g&&(A=function(A){A:for(var t,e=A.length,n=1,r=-1;n<e;++n)switch(A[n]){case".":r=t=n;break;case"0":0===r&&(r=n),t=n;break;default:if(!+A[n])break A;r>0&&(r=0)}return r>0?A.slice(0,r)+A.slice(t+1):A}(A)),x&&0==+A&&"+"!==f&&(x=!1),c=(x?"("===f?f:u:"-"===f||"("===f?"":f)+c,_=("s"===v?re[8+Wt/3]:"")+_+(x&&"("===f?")":""),w)for(r=-1,i=A.length;++r<i;)if(48>(l=A.charCodeAt(r))||l>57){_=(46===l?o+A.slice(r+1):A.slice(r))+_,A=A.slice(0,r);break}}p&&!h&&(A=n(A,1/0));var M=c.length+A.length+_.length,E=M<d?new Array(d-M+1).join(t):"";switch(p&&h&&(A=n(E+A,E.length?d-_.length:1/0),E=""),e){case"<":A=c+A+_+E;break;case"=":A=c+E+A+_;break;case"^":A=E.slice(0,M=E.length>>1)+c+A+_+E.slice(M);break;default:A=E+c+A+_}return a(A)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),_.toString=function(){return A+""},_}return{format:f,formatPrefix:function(A,t){var e=f(((A=Zt(A)).type="f",A)),n=3*Math.max(-8,Math.min(8,Math.floor(Vt(t)/3))),r=Math.pow(10,-n),i=re[8+n/3];return function(A){return e(r*A)+i}}}}function oe(A,t,e,n){var r,i=function(A,t,e){e=+e;const n=(t=+t)<(A=+A),r=n?LA(t,A,e):LA(A,t,e);return(n?-1:1)*(r<0?1/-r:r)}(A,t,e);switch((n=Zt(null==n?",f":n)).type){case"s":var o=Math.max(Math.abs(A),Math.abs(t));return null!=n.precision||isNaN(r=function(A,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Vt(t)/3)))-Vt(Math.abs(A)))}(i,o))||(n.precision=r),ee(n,o);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(r=function(A,t){return A=Math.abs(A),t=Math.abs(t)-A,Math.max(0,Vt(t)-Vt(A))+1}(i,Math.max(Math.abs(A),Math.abs(t))))||(n.precision=r-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(r=function(A){return Math.max(0,-Vt(Math.abs(A)))}(i))||(n.precision=r-2*("%"===n.type))}return te(n)}function ae(A){var t=A.domain;return A.ticks=function(A){var e=t();return function(A,t,e){if(!((e=+e)>0))return[];if((A=+A)==(t=+t))return[A];const n=t<A,[r,i,o]=n?RA(t,A,e):RA(A,t,e);if(!(i>=r))return[];const a=i-r+1,l=new Array(a);if(n)if(o<0)for(let A=0;A<a;++A)l[A]=(i-A)/-o;else for(let A=0;A<a;++A)l[A]=(i-A)*o;else if(o<0)for(let A=0;A<a;++A)l[A]=(r+A)/-o;else for(let A=0;A<a;++A)l[A]=(r+A)*o;return l}(e[0],e[e.length-1],null==A?10:A)},A.tickFormat=function(A,e){var n=t();return oe(n[0],n[n.length-1],null==A?10:A,e)},A.nice=function(e){null==e&&(e=10);var n,r,i=t(),o=0,a=i.length-1,l=i[o],u=i[a],s=10;for(u<l&&(r=l,l=u,u=r,r=o,o=a,a=r);s-- >0;){if((r=LA(l,u,e))===n)return i[o]=l,i[a]=u,t(i);if(r>0)l=Math.floor(l/r)*r,u=Math.ceil(u/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,u=Math.floor(u*r)/r}n=r}return A},A}function le(){var A=Nt()(Gt,Gt);return A.copy=function(){return t=A,le().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},FA.apply(A,arguments),ae(A)}function ue(){var A,t=0,e=1,n=1,r=[.5],i=[0,1];function o