three-globe
Version:
Globe data visualization as a ThreeJS reusable 3D object
2 lines • 1.19 MB
JavaScript
// Version 2.42.4 three-globe - https://github.com/vasturiano/three-globe
!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).ThreeGlobe=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){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}function i(e,t,r,i,n,s,a){try{var o=e[s](a),A=o.value}catch(e){return void r(e)}o.done?t(A):Promise.resolve(A).then(i,n)}function n(e,t,r){return t=d(t),function(e,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(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return e.get(r(e,t))}function o(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function A(e,t,i){return e.set(r(e,t),i),i}function l(e,t,r){if(f())return Reflect.construct.apply(null,arguments);var i=[null];return i.push.apply(i,t),new(e.bind.apply(e,i))}function u(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,w(i.key),i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t,r){return(t=w(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(){return c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},c.apply(null,arguments)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}function m(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 g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function y(){y=function(){return t};var e,t={},r=Object.prototype,i=r.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",o=s.asyncIterator||"@@asyncIterator",A=s.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function u(e,t,r,i){var s=t&&t.prototype instanceof g?t:g,a=Object.create(s.prototype),o=new B(i||[]);return n(a,"_invoke",{value:E(e,r,o)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var c="suspendedStart",d="suspendedYield",p="executing",f="completed",m={};function g(){}function b(){}function x(){}var v={};l(v,a,(function(){return this}));var _=Object.getPrototypeOf,w=_&&_(_(P([])));w&&w!==r&&i.call(w,a)&&(v=w);var T=x.prototype=g.prototype=Object.create(v);function M(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(n,s,a,o){var A=h(e[n],e,s);if("throw"!==A.type){var l=A.arg,u=l.value;return u&&"object"==typeof u&&i.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,a,o)}),(function(e){r("throw",e,a,o)})):t.resolve(u).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,o)}))}o(A.arg)}var s;n(this,"_invoke",{value:function(e,i){function n(){return new t((function(t,n){r(e,i,t,n)}))}return s=s?s.then(n,n):n()}})}function E(t,r,i){var n=c;return function(s,a){if(n===p)throw Error("Generator is already running");if(n===f){if("throw"===s)throw a;return{value:e,done:!0}}for(i.method=s,i.arg=a;;){var o=i.delegate;if(o){var A=N(o,i);if(A){if(A===m)continue;return A}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===c)throw n=f,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=p;var l=h(t,r,i);if("normal"===l.type){if(n=i.done?f:d,l.arg===m)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n=f,i.method="throw",i.arg=l.arg)}}}function N(t,r){var i=r.method,n=t.iterator[i];if(n===e)return r.delegate=null,"throw"===i&&t.iterator.return&&(r.method="return",r.arg=e,N(t,r),"throw"===r.method)||"return"!==i&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),m;var s=h(n,t.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,m;var a=s.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function B(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function P(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,s=function r(){for(;++n<t.length;)if(i.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return s.next=s}}throw new TypeError(typeof t+" is not iterable")}return b.prototype=x,n(T,"constructor",{value:x,configurable:!0}),n(x,"constructor",{value:b,configurable:!0}),b.displayName=l(x,A,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,l(e,A,"GeneratorFunction")),e.prototype=Object.create(T),e},t.awrap=function(e){return{__await:e}},M(S.prototype),l(S.prototype,o,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,i,n,s){void 0===s&&(s=Promise);var a=new S(u(e,r,i,n),s);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},M(T),l(T,A,"Generator"),l(T,a,(function(){return this})),l(T,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var i in t)r.push(i);return r.reverse(),function e(){for(;r.length;){var i=r.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},t.values=P,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(i,n){return o.type="throw",o.arg=t,r.next=i,n&&(r.method="next",r.arg=e),!!n}for(var s=this.tryEntries.length-1;s>=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var A=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(A&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(A){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var s=n;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=e,a.arg=t,s?(this.method="next",this.next=s.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var i=r.completion;if("throw"===i.type){var n=i.arg;R(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(t,r,i){return this.delegate={iterator:P(t),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=e),m}},t}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}function x(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=[],A=!0,l=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;A=!1}else for(;!(A=(i=s.call(r)).done)&&(o.push(i.value),o.length!==t);A=!0);}catch(e){l=!0,n=e}finally{try{if(!A&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw n}}return o}}(e,t)||T(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t,r,i){var n=c(d(e.prototype),t,r);return"function"==typeof n?function(e){return n.apply(r,e)}:n}function _(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)||T(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 w(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+""}function T(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 M(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var S="object"==typeof global&&global&&global.Object===Object&&global,E="object"==typeof self&&self&&self.Object===Object&&self,N=S||E||Function("return this")(),C=function(){return N.Date.now()},R=/\s/;var B=/^\s+/;function P(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&R.test(e.charAt(t)););return t}(e)+1).replace(B,""):e}var q=N.Symbol,D=Object.prototype,I=D.hasOwnProperty,L=D.toString,F=q?q.toStringTag:void 0;var O=Object.prototype.toString;var k=q?q.toStringTag:void 0;function z(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":k&&k in Object(e)?function(e){var t=I.call(e,F),r=e[F];try{e[F]=void 0;var i=!0}catch(e){}var n=L.call(e);return i&&(t?e[F]=r:delete e[F]),n}(e):function(e){return O.call(e)}(e)}var U=/^[-+]0x[0-9a-f]+$/i,V=/^0b[01]+$/i,G=/^0o[0-7]+$/i,j=parseInt;function H(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]"==z(e)}(e))return NaN;if(M(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=M(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=P(e);var r=V.test(e);return r||G.test(e)?j(e.slice(2),r?2:8):U.test(e)?NaN:+e}var W=Math.max,Q=Math.min;function $(e,t,r){var i,n,s,a,o,A,l=0,u=!1,h=!1,c=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){var r=i,s=n;return i=n=void 0,l=t,a=e.apply(s,r)}function p(e){var r=e-A;return void 0===A||r>=t||r<0||h&&e-l>=s}function f(){var e=C();if(p(e))return m(e);o=setTimeout(f,function(e){var r=t-(e-A);return h?Q(r,s-(e-l)):r}(e))}function m(e){return o=void 0,c&&i?d(e):(i=n=void 0,a)}function g(){var e=C(),r=p(e);if(i=arguments,n=this,A=e,r){if(void 0===o)return function(e){return l=e,o=setTimeout(f,t),u?d(e):a}(A);if(h)return clearTimeout(o),o=setTimeout(f,t),d(A)}return void 0===o&&(o=setTimeout(f,t)),a}return t=H(t)||0,M(r)&&(u=!!r.leading,s=(h="maxWait"in r)?W(H(r.maxWait)||0,t):s,c="trailing"in r?!!r.trailing:c),g.cancel=function(){void 0!==o&&clearTimeout(o),l=0,i=A=n=o=void 0},g.flush=function(){return void 0===o?a:m(C())},g}function X(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 Y(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function Z(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=[],A=!0,l=!1;try{if(s=(r=r.call(e)).next,0===t);else for(;!(A=(i=s.call(r)).done)&&(o.push(i.value),o.length!==t);A=!0);}catch(e){l=!0,n=e}finally{try{if(!A&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw n}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return X(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)?X(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 K=Y((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,A=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=A}));function J(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,A=void 0===o?{}:o,l=e.init,u=void 0===l?function(){}:l,h=e.update,c=void 0===h?function(){}:h,d=Object.keys(n).map((function(e){return new K(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,l=i[0],h=void 0===l?{}:l,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=$((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(A).forEach((function(e){var t=Z(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 ee=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-ee.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*ee.Bounce.In(2*e):.5*ee.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}}}}),te=function(){return performance.now()},re=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=te()),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}(),ie={Linear:function(e,t){var r=e.length-1,i=r*t,n=Math.floor(i),s=ie.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}}},ne=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),se=new re,ae=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=ee.Linear.None,this._interpolationFunction=ie.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=ne.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=se,se.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=te()),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),A=o?"array":typeof a,l=!o&&Array.isArray(r[s]);if("undefined"!==A&&"function"!==A){if(l){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)){l=!1,console.warn("Found invalid interpolation list. Skipping.");break}u.push(d)}l&&(r[s]=u)}if("object"!==A&&!o||!a||l)(void 0===t[s]||n)&&(t[s]=a),o||(t[s]*=1),i[s]=l?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=te()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=e),this},e.prototype.resume=function(e){return void 0===e&&(e=te()),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=ee.Linear.None),this._easingFunction=e,this},e.prototype.interpolation=function(e){return void 0===e&&(e=ie.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=te()),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),A=this._duration+this._repeat*o,l=function(){if(0===s._duration)return 1;if(a>A)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(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,u),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),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]),A=Array.isArray(a);!o&&A?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}();ne.nextId;var oe=se;oe.getAll.bind(oe),oe.removeAll.bind(oe),oe.add.bind(oe),oe.remove.bind(oe),oe.update.bind(oe);var Ae=function(e){e instanceof Array?e.forEach(Ae):(e.map&&e.map.dispose(),e.dispose())},le=function(e){e.geometry&&e.geometry.dispose(),e.material&&Ae(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEach(le)},ue=function(e){if(e&&e.children)for(;e.children.length;){var t=e.children[0];e.remove(t),le(t)}};function he(e,t){var r=new t;return{linkProp:function(t){return{default:r[t](),onChange:function(r,i){i[e][t](r)},triggerUpdate:!1}},linkMethod:function(t){return function(r){for(var i=r[e],n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];var o=i[t].apply(i,s);return o===i?this:o}}}}var ce=100;function de(){return ce}function pe(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=(90-e)*Math.PI/180,n=(90-t)*Math.PI/180,s=ce*(1+r),a=Math.sin(i);return{x:s*a*Math.cos(n),y:s*Math.cos(i),z:s*a*Math.sin(n)}}function fe(e){var t=e.x,r=e.y,i=e.z,n=Math.sqrt(t*t+r*r+i*i),s=Math.acos(r/n),a=Math.atan2(i,t);return{lat:90-180*s/Math.PI,lng:90-180*a/Math.PI-(a<-Math.PI/2?360:0),altitude:n/ce-1}}function me(e){return e*Math.PI/180}function ge(e,t,r,i,n){if(isNaN(t)||isNaN(r)||isNaN(i))return e;var s,a,o,A,l,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>=(A=(v+T)/2))?v=A:T=A,s=g,!(g=g[f=p<<2|d<<1|c]))return s[f]=y,e;if(l=+e._x.call(null,g.data),u=+e._y.call(null,g.data),h=+e._z.call(null,g.data),t===l&&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>=(A=(v+T)/2))?v=A:T=A}while((f=p<<2|d<<1|c)==(m=(h>=A)<<2|(u>=o)<<1|l>=a));return s[m]=g,s[f]=y,e}function ye(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}const be=(e,t,r,i,n,s)=>Math.sqrt((e-i)**2+(t-n)**2+(r-s)**2);function xe(e){return e[0]}function ve(e){return e[1]}function _e(e){return e[2]}function we(e,t,r,i){var n=new Te(null==t?xe:t,null==r?ve:r,null==i?_e:i,NaN,NaN,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function Te(e,t,r,i,n,s,a,o,A){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=A,this._root=void 0}function Me(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var Se=we.prototype=Te.prototype;function Ee(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ne(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ce(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=Ee,r=(t,r)=>Ee(e(t),r),i=(t,r)=>e(t)-r):(t=e===Ee||e===Ne?e:Re,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 Re(){return 0}Se.copy=function(){var e,t,r=new Te(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=Me(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]=Me(t));return r},Se.add=function(e){const t=+this._x.call(null,e),r=+this._y.call(null,e),i=+this._z.call(null,e);return ge(this.cover(t,r,i),t,r,i,e)},Se.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,A=-1/0,l=-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>A&&(A=c),d<a&&(a=d),d>l&&(l=d),p<o&&(o=p),p>u&&(u=p));if(s>A||a>l||o>u)return this;this.cover(s,a,o).cover(A,l,u);for(let s=0;s<t;++s)ge(this,r[s],i[s],n[s],e[s]);return this},Se.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,A=this._z1;if(isNaN(i))a=(i=Math.floor(e))+1,o=(n=Math.floor(t))+1,A=(s=Math.floor(r))+1;else{for(var l,u,h=a-i||1,c=this._root;i>e||e>=a||n>t||t>=o||s>r||r>=A;)switch(u=(r<s)<<2|(t<n)<<1|e<i,(l=new Array(8))[u]=c,c=l,h*=2,u){case 0:a=i+h,o=n+h,A=s+h;break;case 1:i=a-h,o=n+h,A=s+h;break;case 2:a=i+h,n=o-h,A=s+h;break;case 3:i=a-h,n=o-h,A=s+h;break;case 4:a=i+h,o=n+h,s=A-h;break;case 5:i=a-h,o=n+h,s=A-h;break;case 6:a=i+h,n=o-h,s=A-h;break;case 7:i=a-h,n=o-h,s=A-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=A,this},Se.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},Se.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]]},Se.find=function(e,t,r,i){var n,s,a,o,A,l,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 ye(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||(A=h.x1)<d||(l=h.y1)<p||(u=h.z1)<f))if(x.length){var v=(s+A)/2,_=(a+l)/2,w=(o+u)/2;b.push(new ye(x[7],v,_,w,A,l,u),new ye(x[6],s,_,w,v,l,u),new ye(x[5],v,a,w,A,_,u),new ye(x[4],s,a,w,v,_,u),new ye(x[3],v,_,o,A,l,w),new ye(x[2],s,_,o,v,l,w),new ye(x[1],v,a,o,A,_,w),new ye(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},Se.findAllWithinRadius=function(e,t,r,i){const n=[],s=e-i,a=t-i,o=r-i,A=e+i,l=t+i,u=r+i;return this.visit(((h,c,d,p,f,m,g)=>{if(!h.length)do{const s=h.data;be(e,t,r,this._x(s),this._y(s),this._z(s))<=i&&n.push(s)}while(h=h.next);return c>A||d>l||p>u||f<s||m<a||g<o})),n},Se.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,A,l,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>=(A=(g+x)/2))?g=A:x=A,(c=a>=(l=(y+v)/2))?y=l:v=l,(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)},Se.removeAll=function(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this},Se.root=function(){return this._root},Se.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},Se.visit=function(e){var t,r,i,n,s,a,o,A,l=[],u=this._root;for(u&&l.push(new ye(u,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=l.pop();)if(!e(u=t.node,i=t.x0,n=t.y0,s=t.z0,a=t.x1,o=t.y1,A=t.z1)&&u.length){var h=(i+a)/2,c=(n+o)/2,d=(s+A)/2;(r=u[7])&&l.push(new ye(r,h,c,d,a,o,A)),(r=u[6])&&l.push(new ye(r,i,c,d,h,o,A)),(r=u[5])&&l.push(new ye(r,h,n,d,a,c,A)),(r=u[4])&&l.push(new ye(r,i,n,d,h,c,A)),(r=u[3])&&l.push(new ye(r,h,c,s,a,o,d)),(r=u[2])&&l.push(new ye(r,i,c,s,h,o,d)),(r=u[1])&&l.push(new ye(r,h,n,s,a,c,d)),(r=u[0])&&l.push(new ye(r,i,n,s,h,c,d))}return this},Se.visitAfter=function(e){var t,r=[],i=[];for(this._root&&r.push(new ye(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,A=t.z0,l=t.x1,u=t.y1,h=t.z1,c=(a+l)/2,d=(o+u)/2,p=(A+h)/2;(s=n[0])&&r.push(new ye(s,a,o,A,c,d,p)),(s=n[1])&&r.push(new ye(s,c,o,A,l,d,p)),(s=n[2])&&r.push(new ye(s,a,d,A,c,u,p)),(s=n[3])&&r.push(new ye(s,c,d,A,l,u,p)),(s=n[4])&&r.push(new ye(s,a,o,p,c,d,h)),(s=n[5])&&r.push(new ye(s,c,o,p,l,d,h)),(s=n[6])&&r.push(new ye(s,a,d,p,c,u,h)),(s=n[7])&&r.push(new ye(s,c,d,p,l,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},Se.x=function(e){return arguments.length?(this._x=e,this):this._x},Se.y=function(e){return arguments.length?(this._y=e,this):this._y},Se.z=function(e){return arguments.length?(this._z=e,this):this._z};const Be=Ce(Ee).right;function Pe(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]}Ce((function(e){return null===e?NaN:+e})).center;class qe{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 De=Math.sqrt(50),Ie=Math.sqrt(10),Le=Math.sqrt(2);function Fe(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>=De?10:s>=Ie?5:s>=Le?2:1;let o,A,l;return n<0?(l=Math.pow(10,-n)/a,o=Math.round(e*l),A=Math.round(t*l),o/l<e&&++o,A/l>t&&--A,l=-l):(l=Math.pow(10,n)*a,o=Math.round(e/l),A=Math.round(t/l),o*l<e&&++o,A*l>t&&--A),A<o&&.5<=r&&r<2?Fe(e,t,2*r):[o,A,l]}function Oe(e,t,r){return Fe(e=+e,t=+t,r=+r)[2]}function ke(e){return Array.from(function*(e){for(const t of e)yield*t}(e))}function ze(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 Ue(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Ve(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 je(){}var He=.7,We=1/He,Qe="\\s*([+-]?\\d+)\\s*",$e="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ye=/^#([0-9a-f]{3,8})$/,Ze=new RegExp(`^rgb\\(${Qe},${Qe},${Qe}\\)$`),Ke=new RegExp(`^rgb\\(${Xe},${Xe},${Xe}\\)$`),Je=new RegExp(`^rgba\\(${Qe},${Qe},${Qe},${$e}\\)$`),et=new RegExp(`^rgba\\(${Xe},${Xe},${Xe},${$e}\\)$`),tt=new RegExp(`^hsl\\(${$e},${Xe},${Xe}\\)$`),rt=new RegExp(`^hsla\\(${$e},${Xe},${Xe},${$e}\\)$`),it={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 nt(){return this.rgb().formatHex()}function st(){return this.rgb().formatRgb()}function at(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Ye.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?ot(t):3===r?new ut(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?At(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?At(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=Ze.exec(e))?new ut(t[1],t[2],t[3],1):(t=Ke.exec(e))?new ut(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Je.exec(e))?At(t[1],t[2],t[3],t[4]):(t=et.exec(e))?At(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=tt.exec(e))?mt(t[1],t[2]/100,t[3]/100,1):(t=rt.exec(e))?mt(t[1],t[2]/100,t[3]/100,t[4]):it.hasOwnProperty(e)?ot(it[e]):"transparent"===e?new ut(NaN,NaN,NaN,0):null}function ot(e){return new ut(e>>16&255,e>>8&255,255&e,1)}function At(e,t,r,i){return i<=0&&(e=t=r=NaN),new ut(e,t,r,i)}function lt(e,t,r,i){return 1===arguments.length?((n=e)instanceof je||(n=at(n)),n?new ut((n=n.rgb()).r,n.g,n.b,n.opacity):new ut):new ut(e,t,r,null==i?1:i);var n}function ut(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}function ht(){return`#${ft(this.r)}${ft(this.g)}${ft(this.b)}`}function ct(){const e=dt(this.opacity);return`${1===e?"rgb(":"rgba("}${pt(this.r)}, ${pt(this.g)}, ${pt(this.b)}${1===e?")":`, ${e})`}`}function dt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ft(e){return((e=pt(e))<16?"0":"")+e.toString(16)}function mt(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new yt(e,t,r,i)}function gt(e){if(e instanceof yt)return new yt(e.h,e.s,e.l,e.opacity);if(e instanceof je||(e=at(e)),!e)return new yt;if(e instanceof yt)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,A=(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/=A<.5?s+n:2-s-n,a*=60):o=A>0&&A<1?0:a,new yt(a,o,A,e.opacity)}function yt(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}function bt(e){return(e=(e||0)%360)<0?e+360:e}function xt(e){return Math.max(0,Math.min(1,e||0))}function vt(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}Ve(je,at,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:nt,formatHex:nt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return gt(this).formatHsl()},formatRgb:st,toString:st}),Ve(ut,lt,Ge(je,{brighter(e){return e=null==e?We:Math.pow(We,e),new ut(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?He:Math.pow(He,e),new ut(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ut(pt(this.r),pt(this.g),pt(this.b),dt(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:ht,formatHex:ht,formatHex8:function(){return`#${ft(this.r)}${ft(this.g)}${ft(this.b)}${ft(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ct,toString:ct})),Ve(yt,(function(e,t,r,i){return 1===arguments.length?gt(e):new yt(e,t,r,null==i?1:i)}),Ge(je,{brighter(e){return e=null==e?We:Math.pow(We,e),new yt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?He:Math.pow(He,e),new yt(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 ut(vt(e>=240?e-240:e+120,n,i),vt(e,n,i),vt(e<120?e+240:e-120,n,i),this.opacity)},clamp(){return new yt(bt(this.h),xt(this.s),xt(this.l),dt(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=dt(this.opacity);return`${1===e?"hsl(":"hsla("}${bt(this.h)}, ${100*xt(this.s)}%, ${100*xt(this.l)}%${1===e?")":`, ${e})`}`}}));var _t=e=>()=>e;function wt(e){return 1==(e=+e)?Tt: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):_t(isNaN(t)?r:t)}}function Tt(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):_t(isNaN(e)?t:e)}var Mt=function e(t){var r=wt(t);function i(e,t){var i=r((e=lt(e)).r,(t=lt(t)).r),n=r(e.g,t.g),s=r(e.b,t.b),a=Tt(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 St(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 Et(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Nt(e,t){return(Et(t)?St:Ct)(e,t)}function Ct(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]=Lt(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 Rt(e,t){var r=new Date;return e=+e,t=+t,function(i){return r.setTime(e*(1-i)+t*i),r}}function Bt(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Pt(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]=Lt(e[r],t[r]):n[r]=t[r];return function(e){for(r in i)n[r]=i[r](e);return n}}var qt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Dt=new RegExp(qt.source,"g");function It(e,t){var r,i,n,s=qt.lastIndex=Dt.lastIndex=0,a=-1,o=[],A=[];for(e+="",t+="";(r=qt.exec(e))&&(i=Dt.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,A.push({i:a,x:Bt(r,i)})),s=Dt.lastIndex;return s<t.length&&(n=t.slice(s),o[a]?o[a]+=n:o[++a]=n),o.length<2?A[0]?function(e){return function(t){return e(t)+""}}(A[0].x):function(e){return function(){return e}}(t):(t=A.length,function(e){for(var r,i=0;i<t;++i)o[(r=A[i]).i]=r.x(e);return o.join("")})}function Lt(e,t){var r,i=typeof t;return null==t||"boolean"===i?_t(t):("number"===i?Bt:"string"===i?(r=at(t))?(t=r,Mt):It:t instanceof at?Mt:t instanceof Date?Rt:Et(t)?St:Array.isArray(t)?Ct:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Pt:Bt)(e,t)}function Ft(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function Ot(e){return+e}var kt=[0,1];function zt(e){return e}function Ut(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:(r=isNaN(t)?NaN:.5,function(){return r});var r}function Vt(e,t,r){var i=e[0],n=e[1],s=t[0],a=t[1];return n<i?(i=Ut(n,i),s=r(a,s)):(i=Ut(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]=Ut(e[a],e[a+1]),s[a]=r(t[a],t[a+1]);return function(t){var r=Be(e,t,1,i)-1;return s[r](n[r](t))}}function jt(){var e,t,r,i,n,s,a=kt,o=kt,A=Lt,l=zt;function u(){var e,t,r,A=Math.min(a.length,o.length);return l!==zt&&(e=a[0],t=a[A-1],e>t&&(r=e,e=t,t=r),l=function(r){return Math.max(e,Math.min(t,r))}),i=A>2?Gt:Vt,n=s=null,h}function h(t){return null==t||isNaN(t=+t)?r:(n||(n=i(a.map(e),o,A)))(e(l(t)))}return h.invert=function(r){return l(t((s||(s=i(o,a.map(e),Bt)))(r)))},h.domain=function(e){return arguments.length?(a=Array.from(e,Ot),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),A=Ft,u()},h.clamp=function(e){return arguments.length?(l=!!e||zt,u()):l!==zt},h.interpolate=function(e){return arguments.length?(A=e,u()):A},h.unknown=function(e){return arguments.length?(r=e,h):r},function(r,i){return e=r,t=i,u()}}function Ht(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 Wt(e){return(e=Ht(Math.abs(e)))?e[1]:NaN}var Qt,$t=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xt(e){if(!(t=$t.exec(e)))throw new Error("invalid fo