globe-ar
Version:
UI component for Globe Data Visualization in AR
2 lines • 1.22 MB
JavaScript
// Version 1.18.4 globe-ar - https://github.com/vasturiano/globe-ar
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("three")):"function"==typeof define&&define.amd?define(["three"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).GlobeAR=t(e.THREE)}(this,(function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function r(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,s,a,o=[],l=!0,A=!1;try{if(s=(r=r.call(e)).next,0===t);else for(;!(l=(i=s.call(r)).done)&&(o.push(i.value),o.length!==t);l=!0);}catch(e){A=!0,n=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(A)throw n}}return o}}(e,t)||o(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 a(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(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 o(e,r){if(e){if("string"==typeof e)return t(e,r);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,r):void 0}}function l(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var A="object"==typeof global&&global&&global.Object===Object&&global,u="object"==typeof self&&self&&self.Object===Object&&self,h=A||u||Function("return this")(),c=function(){return h.Date.now()},d=/\s/;var p=/^\s+/;function f(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&d.test(e.charAt(t)););return t}(e)+1).replace(p,""):e}var m=h.Symbol,g=Object.prototype,y=g.hasOwnProperty,b=g.toString,x=m?m.toStringTag:void 0;var v=Object.prototype.toString;var _=m?m.toStringTag:void 0;function w(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":_&&_ in Object(e)?function(e){var t=y.call(e,x),r=e[x];try{e[x]=void 0;var i=!0}catch(e){}var n=b.call(e);return i&&(t?e[x]=r:delete e[x]),n}(e):function(e){return v.call(e)}(e)}var T=/^[-+]0x[0-9a-f]+$/i,M=/^0b[01]+$/i,S=/^0o[0-7]+$/i,E=parseInt;function N(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==w(e)}(e))return NaN;if(l(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=l(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=f(e);var r=M.test(e);return r||S.test(e)?E(e.slice(2),r?2:8):T.test(e)?NaN:+e}var C=Math.max,R=Math.min;function B(e,t,r){var i,n,s,a,o,A,u=0,h=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var r=i,s=n;return i=n=void 0,u=t,a=e.apply(s,r)}function m(e){var r=e-A;return void 0===A||r>=t||r<0||d&&e-u>=s}function g(){var e=c();if(m(e))return y(e);o=setTimeout(g,function(e){var r=t-(e-A);return d?R(r,s-(e-u)):r}(e))}function y(e){return o=void 0,p&&i?f(e):(i=n=void 0,a)}function b(){var e=c(),r=m(e);if(i=arguments,n=this,A=e,r){if(void 0===o)return function(e){return u=e,o=setTimeout(g,t),h?f(e):a}(A);if(d)return clearTimeout(o),o=setTimeout(g,t),f(A)}return void 0===o&&(o=setTimeout(g,t)),a}return t=N(t)||0,l(r)&&(h=!!r.leading,s=(d="maxWait"in r)?C(N(r.maxWait)||0,t):s,p="trailing"in r?!!r.trailing:p),b.cancel=function(){void 0!==o&&clearTimeout(o),u=0,i=A=n=o=void 0},b.flush=function(){return void 0===o?a:y(c())},b}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function D(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,s,a,o=[],l=!0,A=!1;try{if(s=(r=r.call(e)).next,0===t);else for(;!(l=(i=s.call(r)).done)&&(o.push(i.value),o.length!==t);l=!0);}catch(e){A=!0,n=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(A)throw n}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}(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.")}()}var L=D((function e(t,r){var i=r.default,n=void 0===i?null:i,s=r.triggerUpdate,a=void 0===s||s,o=r.onChange,l=void 0===o?function(e,t){}:o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t,this.defaultVal=n,this.triggerUpdate=a,this.onChange=l}));function I(e){var t=e.stateInit,r=void 0===t?function(){return{}}:t,i=e.props,n=void 0===i?{}:i,s=e.methods,a=void 0===s?{}:s,o=e.aliases,l=void 0===o?{}:o,A=e.init,u=void 0===A?function(){}:A,h=e.update,c=void 0===h?function(){}:h,d=Object.keys(n).map((function(e){return new L(e,n[e])}));return function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var s=!!(this instanceof e?this.constructor:void 0),o=s?i.shift():void 0,A=i[0],h=void 0===A?{}:A,p=Object.assign({},r instanceof Function?r(h):r,{initialised:!1}),f={};function m(e){return g(e,h),y(),m}var g=function(e,t){u.call(m,e,p,t),p.initialised=!0},y=B((function(){p.initialised&&(c.call(m,p,f),f={})}),1);return d.forEach((function(e){m[e.name]=function(e){var t=e.name,r=e.triggerUpdate,i=void 0!==r&&r,n=e.onChange,s=void 0===n?function(e,t){}:n,a=e.defaultVal,o=void 0===a?null:a;return function(e){var r=p[t];if(!arguments.length)return r;var n=void 0===e?o:e;return p[t]=n,s.call(m,n,p,r),!f.hasOwnProperty(t)&&(f[t]=r),i&&y(),m}}(e)})),Object.keys(a).forEach((function(e){m[e]=function(){for(var t,r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];return(t=a[e]).call.apply(t,[m,p].concat(i))}})),Object.entries(l).forEach((function(e){var t=q(e,2),r=t[0],i=t[1];return m[r]=m[i]})),m.resetProps=function(){return d.forEach((function(e){m[e.name](e.defaultVal)})),m},m.resetProps(),p._rerender=y,s&&o&&m(o),m}}var O=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(e){var t=1.70158;return 1===e?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return 0===e?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-O.Bounce.Out(1-e)},Out:function(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},InOut:function(e){return e<.5?.5*O.Bounce.In(2*e):.5*O.Bounce.Out(2*e-1)+.5}}),generatePow:function(e){return void 0===e&&(e=4),e=(e=e<Number.EPSILON?Number.EPSILON:e)>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(2*t,e)/2:(1-Math.pow(2-2*t,e))/2+.5}}}}),F=function(){return performance.now()},k=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map((function(t){return e._tweens[t]}))},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var i=0,n=t;i<n.length;i++){var s=n[i];null===(e=s._group)||void 0===e||e.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,i=e;r<i.length;r++){var n=i[r];n._group=void 0,delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]}},e.prototype.allStopped=function(){return this.getAll().every((function(e){return!e.isPlaying()}))},e.prototype.update=function(e,t){void 0===e&&(e=F()),void 0===t&&(t=!0);var r=Object.keys(this._tweens);if(0!==r.length)for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<r.length;i++){var n=this._tweens[r[i]],s=!t;n&&!1===n.update(e,s)&&!t&&this.remove(n)}r=Object.keys(this._tweensAddedDuringUpdate)}},e}(),V={Linear:function(e,t){var r=e.length-1,i=r*t,n=Math.floor(i),s=V.Utils.Linear;return t<0?s(e[0],e[1],i):t>1?s(e[r],e[r-1],r-i):s(e[n],e[n+1>r?r:n+1],i-n)},Utils:{Linear:function(e,t,r){return(t-e)*r+e}}},U=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),z=new k,G=function(){function e(e,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=O.Linear.None,this._interpolationFunction=V.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=U.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,"object"==typeof t?(this._group=t,t.add(this)):!0===t&&(this._group=z,z.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(e,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=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},e.prototype.duration=function(e){return void 0===e&&(e=1e3),this._duration=e<0?0:e,this},e.prototype.dynamic=function(e){return void 0===e&&(e=!1),this._isDynamic=e,this},e.prototype.start=function(e,t){if(void 0===e&&(e=F()),void 0===t&&(t=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var r in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var n in this._valuesEnd)i[n]=this._valuesEnd[n];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},e.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},e.prototype._setupProperties=function(e,t,r,i,n){for(var s in r){var a=e[s],o=Array.isArray(a),l=o?"array":typeof a,A=!o&&Array.isArray(r[s]);if("undefined"!==l&&"function"!==l){if(A){if(0===(m=r[s]).length)continue;for(var u=[a],h=0,c=m.length;h<c;h+=1){var d=this._handleRelativeValue(a,m[h]);if(isNaN(d)){A=!1,console.warn("Found invalid interpolation list. Skipping.");break}u.push(d)}A&&(r[s]=u)}if("object"!==l&&!o||!a||A)(void 0===t[s]||n)&&(t[s]=a),o||(t[s]*=1),i[s]=A?r[s].slice().reverse():t[s]||0;else{t[s]=o?[]:{};var p=a;for(var f in p)t[s][f]=p[f];i[s]=o?[]:{};var m=r[s];if(!this._isDynamic){var g={};for(var f in m)g[f]=m[f];r[s]=m=g}this._setupProperties(p,t[s],m,i[s],n)}}}},e.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},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(e){return void 0===e&&(e=F()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=e),this},e.prototype.resume=function(e){return void 0===e&&(e=F()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this):this},e.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return e?(e.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var e;return null===(e=this._group)||void 0===e||e.remove(this),this},e.prototype.delay=function(e){return void 0===e&&(e=0),this._delayTime=e,this},e.prototype.repeat=function(e){return void 0===e&&(e=0),this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return void 0===e&&(e=!1),this._yoyo=e,this},e.prototype.easing=function(e){return void 0===e&&(e=O.Linear.None),this._easingFunction=e,this},e.prototype.interpolation=function(e){return void 0===e&&(e=V.Linear),this._interpolationFunction=e,this},e.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(t,r){var i,n,s=this;if(void 0===t&&(t=F()),void 0===r&&(r=e.autoStartOnUpdate),this._isPaused)return!0;if(!this._goToEnd&&!this._isPlaying){if(!r)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 a=t-this._startTime,o=this._duration+(null!==(i=this._repeatDelayTime)&&void 0!==i?i:this._delayTime),l=this._duration+this._repeat*o,A=function(){if(0===s._duration)return 1;if(a>l)return 1;var e=Math.trunc(a/o),t=a-e*o,r=Math.min(t/s._duration,1);return 0===r&&a===s._duration?1:r}(),u=this._easingFunction(A);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,u),this._onUpdateCallback&&this._onUpdateCallback(this._object,A),0===this._duration||a>=this._duration){if(this._repeat>0){var h=Math.min(Math.trunc((a-this._duration)/o)+1,this._repeat);for(n in isFinite(this._repeat)&&(this._repeat-=h),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[n]||(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=o*h,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var c=0,d=this._chainedTweens.length;c<d;c++)this._chainedTweens[c].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(e,t,r,i){for(var n in r)if(void 0!==t[n]){var s=t[n]||0,a=r[n],o=Array.isArray(e[n]),l=Array.isArray(a);!o&&l?e[n]=this._interpolationFunction(a,i):"object"==typeof a&&a?this._updateProperties(e[n],s,a,i):"number"==typeof(a=this._handleRelativeValue(s,a))&&(e[n]=s+(a-s)*i)}},e.prototype._handleRelativeValue=function(e,t){return"string"!=typeof t?t:"+"===t.charAt(0)||"-"===t.charAt(0)?e+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],r=this._valuesEnd[e];this._valuesStartRepeat[e]="string"==typeof r?this._valuesStartRepeat[e]+parseFloat(r):this._valuesEnd[e],this._valuesEnd[e]=t},e.autoStartOnUpdate=!1,e}();U.nextId;var j=z;function H(e,t,r,i,n){if(isNaN(t)||isNaN(r)||isNaN(i))return e;var s,a,o,l,A,u,h,c,d,p,f,m,g=e._root,y={data:n},b=e._x0,x=e._y0,v=e._z0,_=e._x1,w=e._y1,T=e._z1;if(!g)return e._root=y,e;for(;g.length;)if((c=t>=(a=(b+_)/2))?b=a:_=a,(d=r>=(o=(x+w)/2))?x=o:w=o,(p=i>=(l=(v+T)/2))?v=l:T=l,s=g,!(g=g[f=p<<2|d<<1|c]))return s[f]=y,e;if(A=+e._x.call(null,g.data),u=+e._y.call(null,g.data),h=+e._z.call(null,g.data),t===A&&r===u&&i===h)return y.next=g,s?s[f]=y:e._root=y,e;do{s=s?s[f]=new Array(8):e._root=new Array(8),(c=t>=(a=(b+_)/2))?b=a:_=a,(d=r>=(o=(x+w)/2))?x=o:w=o,(p=i>=(l=(v+T)/2))?v=l:T=l}while((f=p<<2|d<<1|c)==(m=(h>=l)<<2|(u>=o)<<1|A>=a));return s[m]=g,s[f]=y,e}function W(e,t,r,i,n,s,a){this.node=e,this.x0=t,this.y0=r,this.z0=i,this.x1=n,this.y1=s,this.z1=a}j.getAll.bind(j),j.removeAll.bind(j),j.add.bind(j),j.remove.bind(j),j.update.bind(j);const Q=(e,t,r,i,n,s)=>Math.sqrt((e-i)**2+(t-n)**2+(r-s)**2);function $(e){return e[0]}function X(e){return e[1]}function Y(e){return e[2]}function Z(e,t,r,i){var n=new K(null==t?$:t,null==r?X:r,null==i?Y:i,NaN,NaN,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function K(e,t,r,i,n,s,a,o,l){this._x=e,this._y=t,this._z=r,this._x0=i,this._y0=n,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this._root=void 0}function J(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var ee=Z.prototype=K.prototype;function te(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function re(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ie(e){let t,r,i;function n(e,i,n=0,s=e.length){if(n<s){if(0!==t(i,i))return s;do{const t=n+s>>>1;r(e[t],i)<0?n=t+1:s=t}while(n<s)}return n}return 2!==e.length?(t=te,r=(t,r)=>te(e(t),r),i=(t,r)=>e(t)-r):(t=e===te||e===re?e:ne,r=e,i=e),{left:n,center:function(e,t,r=0,s=e.length){const a=n(e,t,r,s-1);return a>r&&i(e[a-1],t)>-i(e[a],t)?a-1:a},right:function(e,i,n=0,s=e.length){if(n<s){if(0!==t(i,i))return s;do{const t=n+s>>>1;r(e[t],i)<=0?n=t+1:s=t}while(n<s)}return n}}}function ne(){return 0}ee.copy=function(){var e,t,r=new K(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),i=this._root;if(!i)return r;if(!i.length)return r._root=J(i),r;for(e=[{source:i,target:r._root=new Array(8)}];i=e.pop();)for(var n=0;n<8;++n)(t=i.source[n])&&(t.length?e.push({source:t,target:i.target[n]=new Array(8)}):i.target[n]=J(t));return r},ee.add=function(e){const t=+this._x.call(null,e),r=+this._y.call(null,e),i=+this._z.call(null,e);return H(this.cover(t,r,i),t,r,i,e)},ee.addAll=function(e){Array.isArray(e)||(e=Array.from(e));const t=e.length,r=new Float64Array(t),i=new Float64Array(t),n=new Float64Array(t);let s=1/0,a=1/0,o=1/0,l=-1/0,A=-1/0,u=-1/0;for(let h,c,d,p,f=0;f<t;++f)isNaN(c=+this._x.call(null,h=e[f]))||isNaN(d=+this._y.call(null,h))||isNaN(p=+this._z.call(null,h))||(r[f]=c,i[f]=d,n[f]=p,c<s&&(s=c),c>l&&(l=c),d<a&&(a=d),d>A&&(A=d),p<o&&(o=p),p>u&&(u=p));if(s>l||a>A||o>u)return this;this.cover(s,a,o).cover(l,A,u);for(let s=0;s<t;++s)H(this,r[s],i[s],n[s],e[s]);return this},ee.cover=function(e,t,r){if(isNaN(e=+e)||isNaN(t=+t)||isNaN(r=+r))return this;var i=this._x0,n=this._y0,s=this._z0,a=this._x1,o=this._y1,l=this._z1;if(isNaN(i))a=(i=Math.floor(e))+1,o=(n=Math.floor(t))+1,l=(s=Math.floor(r))+1;else{for(var A,u,h=a-i||1,c=this._root;i>e||e>=a||n>t||t>=o||s>r||r>=l;)switch(u=(r<s)<<2|(t<n)<<1|e<i,(A=new Array(8))[u]=c,c=A,h*=2,u){case 0:a=i+h,o=n+h,l=s+h;break;case 1:i=a-h,o=n+h,l=s+h;break;case 2:a=i+h,n=o-h,l=s+h;break;case 3:i=a-h,n=o-h,l=s+h;break;case 4:a=i+h,o=n+h,s=l-h;break;case 5:i=a-h,o=n+h,s=l-h;break;case 6:a=i+h,n=o-h,s=l-h;break;case 7:i=a-h,n=o-h,s=l-h}this._root&&this._root.length&&(this._root=c)}return this._x0=i,this._y0=n,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this},ee.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},ee.extent=function(e){return arguments.length?this.cover(+e[0][0],+e[0][1],+e[0][2]).cover(+e[1][0],+e[1][1],+e[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]},ee.find=function(e,t,r,i){var n,s,a,o,l,A,u,h,c,d=this._x0,p=this._y0,f=this._z0,m=this._x1,g=this._y1,y=this._z1,b=[],x=this._root;for(x&&b.push(new W(x,d,p,f,m,g,y)),null==i?i=1/0:(d=e-i,p=t-i,f=r-i,m=e+i,g=t+i,y=r+i,i*=i);h=b.pop();)if(!(!(x=h.node)||(s=h.x0)>m||(a=h.y0)>g||(o=h.z0)>y||(l=h.x1)<d||(A=h.y1)<p||(u=h.z1)<f))if(x.length){var v=(s+l)/2,_=(a+A)/2,w=(o+u)/2;b.push(new W(x[7],v,_,w,l,A,u),new W(x[6],s,_,w,v,A,u),new W(x[5],v,a,w,l,_,u),new W(x[4],s,a,w,v,_,u),new W(x[3],v,_,o,l,A,w),new W(x[2],s,_,o,v,A,w),new W(x[1],v,a,o,l,_,w),new W(x[0],s,a,o,v,_,w)),(c=(r>=w)<<2|(t>=_)<<1|e>=v)&&(h=b[b.length-1],b[b.length-1]=b[b.length-1-c],b[b.length-1-c]=h)}else{var T=e-+this._x.call(null,x.data),M=t-+this._y.call(null,x.data),S=r-+this._z.call(null,x.data),E=T*T+M*M+S*S;if(E<i){var N=Math.sqrt(i=E);d=e-N,p=t-N,f=r-N,m=e+N,g=t+N,y=r+N,n=x.data}}return n},ee.findAllWithinRadius=function(e,t,r,i){const n=[],s=e-i,a=t-i,o=r-i,l=e+i,A=t+i,u=r+i;return this.visit(((h,c,d,p,f,m,g)=>{if(!h.length)do{const s=h.data;Q(e,t,r,this._x(s),this._y(s),this._z(s))<=i&&n.push(s)}while(h=h.next);return c>l||d>A||p>u||f<s||m<a||g<o})),n},ee.remove=function(e){if(isNaN(s=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e))||isNaN(o=+this._z.call(null,e)))return this;var t,r,i,n,s,a,o,l,A,u,h,c,d,p,f,m=this._root,g=this._x0,y=this._y0,b=this._z0,x=this._x1,v=this._y1,_=this._z1;if(!m)return this;if(m.length)for(;;){if((h=s>=(l=(g+x)/2))?g=l:x=l,(c=a>=(A=(y+v)/2))?y=A:v=A,(d=o>=(u=(b+_)/2))?b=u:_=u,t=m,!(m=m[p=d<<2|c<<1|h]))return this;if(!m.length)break;(t[p+1&7]||t[p+2&7]||t[p+3&7]||t[p+4&7]||t[p+5&7]||t[p+6&7]||t[p+7&7])&&(r=t,f=p)}for(;m.data!==e;)if(i=m,!(m=m.next))return this;return(n=m.next)&&delete m.next,i?(n?i.next=n:delete i.next,this):t?(n?t[p]=n:delete t[p],(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&&(r?r[f]=m:this._root=m),this):(this._root=n,this)},ee.removeAll=function(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this},ee.root=function(){return this._root},ee.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},ee.visit=function(e){var t,r,i,n,s,a,o,l,A=[],u=this._root;for(u&&A.push(new W(u,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=A.pop();)if(!e(u=t.node,i=t.x0,n=t.y0,s=t.z0,a=t.x1,o=t.y1,l=t.z1)&&u.length){var h=(i+a)/2,c=(n+o)/2,d=(s+l)/2;(r=u[7])&&A.push(new W(r,h,c,d,a,o,l)),(r=u[6])&&A.push(new W(r,i,c,d,h,o,l)),(r=u[5])&&A.push(new W(r,h,n,d,a,c,l)),(r=u[4])&&A.push(new W(r,i,n,d,h,c,l)),(r=u[3])&&A.push(new W(r,h,c,s,a,o,d)),(r=u[2])&&A.push(new W(r,i,c,s,h,o,d)),(r=u[1])&&A.push(new W(r,h,n,s,a,c,d)),(r=u[0])&&A.push(new W(r,i,n,s,h,c,d))}return this},ee.visitAfter=function(e){var t,r=[],i=[];for(this._root&&r.push(new W(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=r.pop();){var n=t.node;if(n.length){var s,a=t.x0,o=t.y0,l=t.z0,A=t.x1,u=t.y1,h=t.z1,c=(a+A)/2,d=(o+u)/2,p=(l+h)/2;(s=n[0])&&r.push(new W(s,a,o,l,c,d,p)),(s=n[1])&&r.push(new W(s,c,o,l,A,d,p)),(s=n[2])&&r.push(new W(s,a,d,l,c,u,p)),(s=n[3])&&r.push(new W(s,c,d,l,A,u,p)),(s=n[4])&&r.push(new W(s,a,o,p,c,d,h)),(s=n[5])&&r.push(new W(s,c,o,p,A,d,h)),(s=n[6])&&r.push(new W(s,a,d,p,c,u,h)),(s=n[7])&&r.push(new W(s,c,d,p,A,u,h))}i.push(t)}for(;t=i.pop();)e(t.node,t.x0,t.y0,t.z0,t.x1,t.y1,t.z1);return this},ee.x=function(e){return arguments.length?(this._x=e,this):this._x},ee.y=function(e){return arguments.length?(this._y=e,this):this._y},ee.z=function(e){return arguments.length?(this._z=e,this):this._z};const se=ie(te).right;function ae(e,t){let r,i;if(void 0===t)for(const t of e)null!=t&&(void 0===r?t>=t&&(r=i=t):(r>t&&(r=t),i<t&&(i=t)));else{let n=-1;for(let s of e)null!=(s=t(s,++n,e))&&(void 0===r?s>=s&&(r=i=s):(r>s&&(r=s),i<s&&(i=s)))}return[r,i]}ie((function(e){return null===e?NaN:+e})).center;class oe{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const t=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const n=t[i],s=e+n,a=Math.abs(e)<Math.abs(n)?e-(s-n):n-(s-e);a&&(t[r++]=a),e=s}return t[r]=e,this._n=r+1,this}valueOf(){const e=this._partials;let t,r,i,n=this._n,s=0;if(n>0){for(s=e[--n];n>0&&(t=s,r=e[--n],s=t+r,i=r-(s-t),!i););n>0&&(i<0&&e[n-1]<0||i>0&&e[n-1]>0)&&(r=2*i,t=s+r,r==t-s&&(s=t))}return s}}const le=Math.sqrt(50),Ae=Math.sqrt(10),ue=Math.sqrt(2);function he(e,t,r){const i=(t-e)/Math.max(0,r),n=Math.floor(Math.log10(i)),s=i/Math.pow(10,n),a=s>=le?10:s>=Ae?5:s>=ue?2:1;let o,l,A;return n<0?(A=Math.pow(10,-n)/a,o=Math.round(e*A),l=Math.round(t*A),o/A<e&&++o,l/A>t&&--l,A=-A):(A=Math.pow(10,n)*a,o=Math.round(e/A),l=Math.round(t/A),o*A<e&&++o,l*A>t&&--l),l<o&&.5<=r&&r<2?he(e,t,2*r):[o,l,A]}function ce(e,t,r){return he(e=+e,t=+t,r=+r)[2]}function de(e){return Array.from(function*(e){for(const t of e)yield*t}(e))}function pe(e,t,r){e=+e,t=+t,r=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+r;for(var i=-1,n=0|Math.max(0,Math.ceil((t-e)/r)),s=new Array(n);++i<n;)s[i]=e+i*r;return s}function fe(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function me(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function ge(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function ye(){}var be=.7,xe=1/be,ve="\\s*([+-]?\\d+)\\s*",_e="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",we="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Te=/^#([0-9a-f]{3,8})$/,Me=new RegExp(`^rgb\\(${ve},${ve},${ve}\\)$`),Se=new RegExp(`^rgb\\(${we},${we},${we}\\)$`),Ee=new RegExp(`^rgba\\(${ve},${ve},${ve},${_e}\\)$`),Ne=new RegExp(`^rgba\\(${we},${we},${we},${_e}\\)$`),Ce=new RegExp(`^hsl\\(${_e},${we},${we}\\)$`),Re=new RegExp(`^hsla\\(${_e},${we},${we},${_e}\\)$`),Be={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 Pe(){return this.rgb().formatHex()}function De(){return this.rgb().formatRgb()}function qe(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Te.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?Le(t):3===r?new Fe(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?Ie(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?Ie(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=Me.exec(e))?new Fe(t[1],t[2],t[3],1):(t=Se.exec(e))?new Fe(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ee.exec(e))?Ie(t[1],t[2],t[3],t[4]):(t=Ne.exec(e))?Ie(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ce.exec(e))?je(t[1],t[2]/100,t[3]/100,1):(t=Re.exec(e))?je(t[1],t[2]/100,t[3]/100,t[4]):Be.hasOwnProperty(e)?Le(Be[e]):"transparent"===e?new Fe(NaN,NaN,NaN,0):null}function Le(e){return new Fe(e>>16&255,e>>8&255,255&e,1)}function Ie(e,t,r,i){return i<=0&&(e=t=r=NaN),new Fe(e,t,r,i)}function Oe(e,t,r,i){return 1===arguments.length?((n=e)instanceof ye||(n=qe(n)),n?new Fe((n=n.rgb()).r,n.g,n.b,n.opacity):new Fe):new Fe(e,t,r,null==i?1:i);var n}function Fe(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}function ke(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}`}function Ve(){const e=Ue(this.opacity);return`${1===e?"rgb(":"rgba("}${ze(this.r)}, ${ze(this.g)}, ${ze(this.b)}${1===e?")":`, ${e})`}`}function Ue(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ze(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ge(e){return((e=ze(e))<16?"0":"")+e.toString(16)}function je(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new We(e,t,r,i)}function He(e){if(e instanceof We)return new We(e.h,e.s,e.l,e.opacity);if(e instanceof ye||(e=qe(e)),!e)return new We;if(e instanceof We)return e;var t=(e=e.rgb()).r/255,r=e.g/255,i=e.b/255,n=Math.min(t,r,i),s=Math.max(t,r,i),a=NaN,o=s-n,l=(s+n)/2;return o?(a=t===s?(r-i)/o+6*(r<i):r===s?(i-t)/o+2:(t-r)/o+4,o/=l<.5?s+n:2-s-n,a*=60):o=l>0&&l<1?0:a,new We(a,o,l,e.opacity)}function We(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}function Qe(e){return(e=(e||0)%360)<0?e+360:e}function $e(e){return Math.max(0,Math.min(1,e||0))}function Xe(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}me(ye,qe,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Pe,formatHex:Pe,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return He(this).formatHsl()},formatRgb:De,toString:De}),me(Fe,Oe,ge(ye,{brighter(e){return e=null==e?xe:Math.pow(xe,e),new Fe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?be:Math.pow(be,e),new Fe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fe(ze(this.r),ze(this.g),ze(this.b),Ue(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:ke,formatHex:ke,formatHex8:function(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}${Ge(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ve,toString:Ve})),me(We,(function(e,t,r,i){return 1===arguments.length?He(e):new We(e,t,r,null==i?1:i)}),ge(ye,{brighter(e){return e=null==e?xe:Math.pow(xe,e),new We(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?be:Math.pow(be,e),new We(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,i=r+(r<.5?r:1-r)*t,n=2*r-i;return new Fe(Xe(e>=240?e-240:e+120,n,i),Xe(e,n,i),Xe(e<120?e+240:e-120,n,i),this.opacity)},clamp(){return new We(Qe(this.h),$e(this.s),$e(this.l),Ue(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 e=Ue(this.opacity);return`${1===e?"hsl(":"hsla("}${Qe(this.h)}, ${100*$e(this.s)}%, ${100*$e(this.l)}%${1===e?")":`, ${e})`}`}}));var Ye=e=>()=>e;function Ze(e){return 1===(e=+e)?Ke: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(i){return Math.pow(e+i*t,r)}}(t,r,e):Ye(isNaN(t)?r:t)}}function Ke(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):Ye(isNaN(e)?t:e)}var Je=function e(t){var r=Ze(t);function i(e,t){var i=r((e=Oe(e)).r,(t=Oe(t)).r),n=r(e.g,t.g),s=r(e.b,t.b),a=Ke(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=n(t),e.b=s(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function et(e,t){t||(t=[]);var r,i=e?Math.min(t.length,e.length):0,n=t.slice();return function(s){for(r=0;r<i;++r)n[r]=e[r]*(1-s)+t[r]*s;return n}}function tt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function rt(e,t){return(tt(t)?et:it)(e,t)}function it(e,t){var r,i=t?t.length:0,n=e?Math.min(i,e.length):0,s=new Array(n),a=new Array(i);for(r=0;r<n;++r)s[r]=ut(e[r],t[r]);for(;r<i;++r)a[r]=t[r];return function(e){for(r=0;r<n;++r)a[r]=s[r](e);return a}}function nt(e,t){var r=new Date;return e=+e,t=+t,function(i){return r.setTime(e*(1-i)+t*i),r}}function st(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function at(e,t){var r,i={},n={};for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?i[r]=ut(e[r],t[r]):n[r]=t[r];return function(e){for(r in i)n[r]=i[r](e);return n}}var ot=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,lt=new RegExp(ot.source,"g");function At(e,t){var r,i,n,s=ot.lastIndex=lt.lastIndex=0,a=-1,o=[],l=[];for(e+="",t+="";(r=ot.exec(e))&&(i=lt.exec(t));)(n=i.index)>s&&(n=t.slice(s,n),o[a]?o[a]+=n:o[++a]=n),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:st(r,i)})),s=lt.lastIndex;return s<t.length&&(n=t.slice(s),o[a]?o[a]+=n:o[++a]=n),o.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,i=0;i<t;++i)o[(r=l[i]).i]=r.x(e);return o.join("")})}function ut(e,t){var r,i=typeof t;return null==t||"boolean"===i?Ye(t):("number"===i?st:"string"===i?(r=qe(t))?(t=r,Je):At:t instanceof qe?Je:t instanceof Date?nt:tt(t)?et:Array.isArray(t)?it:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?at:st)(e,t)}function ht(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function ct(e){return+e}var dt=[0,1];function pt(e){return e}function ft(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:(r=isNaN(t)?NaN:.5,function(){return r});var r}function mt(e,t,r){var i=e[0],n=e[1],s=t[0],a=t[1];return n<i?(i=ft(n,i),s=r(a,s)):(i=ft(i,n),s=r(s,a)),function(e){return s(i(e))}}function gt(e,t,r){var i=Math.min(e.length,t.length)-1,n=new Array(i),s=new Array(i),a=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<i;)n[a]=ft(e[a],e[a+1]),s[a]=r(t[a],t[a+1]);return function(t){var r=se(e,t,1,i)-1;return s[r](n[r](t))}}function yt(){var e,t,r,i,n,s,a=dt,o=dt,l=ut,A=pt;function u(){var e,t,r,l=Math.min(a.length,o.length);return A!==pt&&(e=a[0],t=a[l-1],e>t&&(r=e,e=t,t=r),A=function(r){return Math.max(e,Math.min(t,r))}),i=l>2?gt:mt,n=s=null,h}function h(t){return null==t||isNaN(t=+t)?r:(n||(n=i(a.map(e),o,l)))(e(A(t)))}return h.invert=function(r){return A(t((s||(s=i(o,a.map(e),st)))(r)))},h.domain=function(e){return arguments.length?(a=Array.from(e,ct),u()):a.slice()},h.range=function(e){return arguments.length?(o=Array.from(e),u()):o.slice()},h.rangeRound=function(e){return o=Array.from(e),l=ht,u()},h.clamp=function(e){return arguments.length?(A=!!e||pt,u()):A!==pt},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(r=e,h):r},function(r,i){return e=r,t=i,u()}}function bt(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,i=e.slice(0,r);return[i.length>1?i[0]+i.slice(2):i,+e.slice(r+1)]}function xt(e){return(e=bt(Math.abs(e)))?e[1]:NaN}var vt,_t=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wt(e){if(!(t=_t.exec(e)))throw new Error("invalid format: "+e);var t;return new Tt({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 Tt(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 Mt(e,t){var r=bt(e,t);if(!r)return e+"";var i=r[0],n=r[1];return n<0?"0."+new Array(-n).join("0")+i:i.length>n+1?i.slice(0,n+1)+"."+i.slice(n+1):i+new Array(n-i.length+2).join("0")}wt.prototype=Tt.prototype,Tt.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 St={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Mt(100*e,t),r:Mt,s:function(e,t){var r=bt(e,t);if(!r)return e+"";var i=r[0],n=r[1],s=n-(vt=3*Math.max(-8,Math.min(8,Math.floor(n/3))))+1,a=i.length;return s===a?i:s>a?i+new Array(s-a+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+bt(e,Math.max(0,t+s-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Et(e){return e}var Nt,Ct,Rt,Bt=Array.prototype.map,Pt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Dt(e){var t,r,i=void 0===e.grouping||void 0===e.thousands?Et:(t=Bt.call(e.grouping,Number),r=e.thousands+"",function(e,i){for(var n=e.length,s=[],a=0,o=t[0],l=0;n>0&&o>0&&(l+o+1>i&&(o=Math.max(1,i-l)),s.push(e.substring(n-=o,n+o)),!((l+=o+1)>i));)o=t[a=(a+1)%t.length];return s.reverse().join(r)}),n=void 0===e.currency?"":e.currency[0]+"",s=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",o=void 0===e.numerals?Et:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Bt.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",A=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=wt(e)).fill,r=e.align,h=e.sign,c=e.symbol,d=e.zero,p=e.width,f=e.comma,m=e.precision,g=e.trim,y=e.type;"n"===y?(f=!0,y="g"):St[y]||(void 0===m&&(m=12),g=!0,y="g"),(d||"0"===t&&"="===r)&&(d=!0,t="0",r="=");var b="$"===c?n:"#"===c&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===c?s:/[%p]/.test(y)?l:"",v=St[y],_=/[defgprs%]/.test(y);function w(e){var n,s,l,c=b,w=x;if("c"===y)w=v(e)+w,e="";else{var T=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:v(Math.abs(e),m),g&&(e=function(e){e:for(var t,r=e.length,i=1,n=-1;i<r;++i)switch(e[i]){case".":n=t=i;break;case"0":0===n&&(n=i),t=i;break;default:if(!+e[i])break e;n>0&&(n=0)}return n>0?e.slice(0,n)+e.slice(t+1):e}(e)),T&&0===+e&&"+"!==h&&(T=!1),c=(T?"("===h?h:A:"-"===h||"("===h?"":h)+c,w=("s"===y?Pt[8+vt/3]:"")+w+(T&&"("===h?")":""),_)for(n=-1,s=e.length;++n<s;)if(48>(l=e.charCodeAt(n))||l>57){w=(46===l?a+e.slice(n+1):e.slice(n))+w,e=e.slice(0,n);break}}f&&!d&&(e=i(e,1/0));var M=c.length+e.length+w.length,S=M<p?new Array(p-M+1).join(t):"";switch(f&&d&&(e=i(S+e,S.length?p-w.length:1/0),S=""),r){case"<":e=c+e+w+S;break;case"=":e=c+S+e+w;break;case"^":e=S.slice(0,M=S.length>>1)+c+e+w+S.slice(M);break;default:e=S+c+e+w}return o(e)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),w.toString=function(){return e+""},w}return{format:h,formatPrefix:function(e,t){var r=h(((e=wt(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(xt(t)/3))),n=Math.pow(10,-i),s=Pt[8+i/3];return function(e){return r(n*e)+s}}}}function qt(e,t,r,i){var n,s=function(e,t,r){r=+r;const i=(t=+t)<(e=+e),n=i?ce(t,e,r):ce(e,t,r);return(i?-1:1)*(n<0?1/-n:n)}(e,t,r);switch((i=wt(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(n=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(xt(t)/3)))-xt(Math.abs(e)))}(s,a))||(i.precision=n),Rt(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(n=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,xt(t)-xt(e))+1}(s,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=n-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(n=function(e){return Math.max(0,-xt(Math.abs(e)))}(s))||(i.precision=n-2*("%"===i.type))}return Ct(i)}function Lt(e){var t=e.domain;return e.ticks=function(e){var r=t();return function(e,t,r){if(!((r=+r)>0))return[];if((e=+e)===(t=+t))return[e];const i=t<e,[n,s,a]=i?he(t,e,r):he(e,t,r);if(!(s>=n))return[];const o=s-n+1,l=new Array(o);if(i)if(a<0)for(let e=0;e<o;++e)l[e]=(s-e)/-a;else for(let e=0;e<o;++e)l[e]=(s-e)*a;else if(a<0)for(let e=0;e<o;++e)l[e]=(n+e)/-a;else for(let e=0;e<o;++e)l[e]=(n+e)*a;return l}(r[0],r[r.length-1],null==e?10:e)},e.tickFormat=function(e,r){var i=t();return qt(i[0],i[i.length-1],null==e?10:e,r)},e.nice=function(r){null==r&&(r=10);var i,n,s=t(),a=0,o=s.length-1,l=s[a],A=s[o],u=10;for(A<l&&(n=l,l=A,A=n,n=a,a=o,o=n);u-- >0;){if((n=ce(l,A,r))===i)return s[a]=l,s[o]=A,t(s);if(n>0)l=Math.floor(l/n)*n,A=Math.ceil(A/n)*n;else{if(!(n<0))break;l=Math.ceil(l*n)/n,A=Math.floor(A*n)/n}i=n}return e},e}function It(){var e=yt()(pt,pt);return e.copy=function(){return t=e,It().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},fe.apply(e,arguments),Lt(e)}function Ot(){var e,t=0,r=1,i=1,n=[.5],s=[0,1];function a(t){return null!=t&&t<=t?s[se(n,t,0,i)]:e}function o(){var e=-1;for(n=new Array(i);++e<i;)n[e]=((e+1)*r-(e-i)*t)/(i+1);return a}return a.domain=function(e){return arguments.length?([t,r]=e,t=+t,r=+r,o()):[t,r]},a.range=function(e){return arguments.length?(i=(s=Array.from(e)).length-1,o()):s.slice()},a.invertExtent=function(e){var a=s.indexOf(e);return a<0?[NaN,NaN]:a<1?[t,n[0]]:a>=i?[n[i-1],r]:[n[a-1],n[a]]},a.unknown=function(t){return arguments.length?(e=t,a):a},a.thresholds=function(){return n.slice()},a.copy=function(){return Ot().domain([t,r]).range(s).unknown(e)},fe.apply(Lt(a),arguments)}Nt=Dt({thousands:",",grouping:[3],currency:["$",""]}),Ct=Nt.format,Rt=Nt.formatPrefix;var Ft=1e-6,kt=1e-12,Vt=Math.PI,Ut=Vt/2,zt=Vt/4,Gt=2*Vt,jt=180/Vt,Ht=Vt/180,Wt=Math.abs,Qt=Math.atan,$t=Math.atan2,Xt=Math.cos,Yt=Math.ceil,Zt=Math.exp,Kt=Math.hypot,Jt=Math.log,er=Math.sin,tr=Math.sign||function(e){return e>0?1:e<0?-1:0},rr=Math.sqrt,ir=Math.tan;function nr(e){return e>1?Ut:e<-1?-Ut:Math.asin(e)}function sr(e){return(e=er(e/2))*e}function ar(){}function or(e,t){e&&Ar.hasOwnProperty(e.type)&&Ar[e.type](e,t)}var lr={Feature:function(e,t){or(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,i=-1,n=r.length;++i<n;)or(r[i].geometry,t)}},Ar={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,i=-1,n=r.length;++i<n;)e=r[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){ur(e.coordinates,t,0)},MultiLineString:function(e,t){for(var r=e.coordinates,i=-1,n=r.length;++i<n;)ur(r[i],t,0)},Polygon:function(e,t){hr(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,i=-1,n=r.length;++i<n;)hr(r[i],t)},GeometryCollection:function(e,t){for(var r=e.geometries,i=-1,n=r.length;++i<n;)or(r[i],t)}};function ur(e,t,r){var i,n=-1,s=e.length-r;for(t.lineStart();++n<s;)i=e[n],t.point(i[0],i[1],i[2]);t.lineEnd()}function hr(e,t){var r=-1,i=e.length;for(t.polygonStart();++r<i;)ur(e[r],t,1);t.polygonEnd()}function cr(e,t){e&&lr.hasOwnProperty(e.type)?lr[e.type](e,t):or(e,t)}var dr,pr,fr,mr,gr,yr,br,xr,vr,_r,wr,Tr,Mr,Sr,Er,Nr,Cr=new oe,Rr=new oe,Br={point:ar,lineStart:ar,lineEnd:ar,polygonStart:function(){Cr=new oe,Br.lineStart=Pr,Br.lineEnd=Dr},polygonEnd:function(){var e=+Cr;Rr.add(e<0?Gt+e:e),this.lineStart=this.lineEnd=this.point=ar},sphere:function(){Rr.add(Gt)}};function Pr(){Br.point=qr}function Dr(){Lr(dr,pr)}function qr(e,t){Br.point=Lr,dr=e,pr=t,fr=e*=Ht,mr=Xt(t=(t*=Ht)/2+zt),gr=er(t)}function Lr(e,t){var r=(e*=Ht)-fr,i=r>=0?1:-1,n=i*r,s=Xt(t=(t*=Ht)/2+zt),a=er(t),o=gr*a,l=mr*s+o*Xt(n),A=o*i*er(n);Cr.add($t(A,l)),fr=e,mr=s,gr=a}function Ir(e){return[$t(e[1],e[0]),nr(e[2])]}function Or(e){var t=e[0],r=e[1],i=Xt(r);return[i*Xt(t),i*er(t),er(r)]}function Fr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function kr(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 Vr(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Ur(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function zr(e){var t=rr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var Gr,jr,Hr,Wr,Qr,$r,Xr,Yr,Zr,Kr,Jr,ei,ti,ri,ii,ni,si={point:ai,lineStart:li,lineEnd:Ai,polygonStart:function(){si.point=ui,si.lineStart=hi,si.lineEnd=ci,Sr=new oe,Br.polygonStart()},polygonEnd:function(){Br.polygonEnd(),si.point=ai,si.lineStart=li,si.lineEnd=Ai,Cr<0?(yr=-(xr=180),br=-(vr=90)):Sr>Ft?vr=90:Sr<-1e-6&&(br=-90),Nr[0]=yr,Nr[1]=xr},sphere:function(){yr=-(xr=180),br=-(vr=90)}};function ai(e,t){Er.push(Nr=[yr=e,xr=e]),t<br&&(br=t),t>vr&&(vr=t)}function oi(e,t){var r=Or([e*Ht,t*Ht]);if(Mr){var i=kr(Mr,r),n=kr([i[1],-i[0],0],i);zr(n),n=Ir(n);var s,a=e-_r,o=a>0?1:-1,l=n[0]*jt*o,A=Wt(a)>180;A^(o*_r<l&&l<o*e)?(s=n[1]*jt)>vr&&(vr=s):A^(o*_r<(l=(l+360)%360-180)&&l<o*e)?(s=-n[1]*jt)<br&&(br=s):(t<br&&(br=t),t>vr&&(vr=t)),A?e<_r?di(yr,e)>di(yr,xr)&&(xr=e):di(e,xr)>di(yr,xr)&&(yr=e):xr>=yr?(e<yr&&(yr=e),e>xr&&(xr=e)):e>_r?di(yr,e)>di(yr,xr)&&(xr=e):di(e,xr)>di(yr,xr)&&(yr=e)}else Er.push(Nr=[yr=e,xr=e]);t<br&&(br=t),t>vr&&(vr=t),Mr=r,_r=e}function li(){si.point=oi}function Ai(){Nr[0]=yr,Nr[1]=xr,si.point=ai,Mr=null}function ui(e,t){if(Mr){var r=e-_r;Sr.add(Wt(r)>180?r+(r>0?360:-360):r)}else wr=e,Tr=t;Br.point(e,t),oi(e,t)}function hi(){Br.lineStart()}function ci(){ui(wr,Tr),Br.lineEnd(),Wt(Sr)>Ft&&(yr=-(xr=180)),Nr[0]=yr,Nr[1]=xr,Mr=null}function di(e,t){r