three-globe
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -92,2 +92,17 @@ 'use strict'; | ||
function cartesian2Polar({ | ||
x, | ||
y, | ||
z | ||
}) { | ||
const r = Math.sqrt(x * x + y * y + z * z); | ||
const phi = Math.acos(y / r); | ||
const theta = Math.atan(z / x); | ||
return { | ||
lat: 90 - phi * 180 / Math.PI, | ||
lng: 90 - theta * 180 / Math.PI, | ||
altitude: r / GLOBE_RADIUS - 1 | ||
}; | ||
} | ||
// from https://github.com/jdomingu/ThreeGeoJSON | ||
@@ -981,3 +996,4 @@ const THREE = window.THREE ? window.THREE // Prefer consumption from global THREE, if exists | ||
methods: { | ||
getCoords: (state, ...args) => polar2Cartesian(...args) | ||
getCoords: (state, ...args) => polar2Cartesian(...args), | ||
toGeoCoords: (state, ...args) => cartesian2Polar(...args) | ||
}, | ||
@@ -984,0 +1000,0 @@ stateInit: () => { |
@@ -1,5 +0,5 @@ | ||
// Version 1.4.0 three-globe - https://github.com/vasturiano/three-globe | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("three")):"function"==typeof define&&define.amd?define(["three"],e):(t=t||self).ThreeGlobe=e(t.THREE)}(this,function(t){"use strict";"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n(function(t,e){"undefined"!=typeof self&&self,t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){var r,i,a,o;o=function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.stateInit,n=void 0===e?function(){return{}}:e,r=t.props,s=void 0===r?{}:r,u=t.methods,c=void 0===u?{}:u,l=t.aliases,f=void 0===l?{}:l,h=t.init,d=void 0===h?function(){}:h,p=t.update,g=void 0===p?function(){}:p,b=Object.keys(s).map(function(t){return new o(t,s[t])});return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},n instanceof Function?n(t):n,{initialised:!1});function r(e){return o(e,t),s(),r}var o=function(t,n){d.call(r,t,e,n),e.initialised=!0},s=(0,i.default)(function(){e.initialised&&g.call(r,e)},1);return b.forEach(function(t){r[t.name]=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(t,e){};return function(a){var o=e[t];return arguments.length?(e[t]=a,i.call(r,a,e,o),n&&s(),r):o}}(t.name,t.triggerUpdate,t.onChange)}),Object.keys(c).forEach(function(t){r[t]=function(){for(var n,i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];return(n=c[t]).call.apply(n,[r,e].concat(a))}}),Object.entries(f).forEach(function(t){var e=a(t,2),n=e[0],i=e[1];return r[n]=r[i]}),r.resetProps=function(){return b.forEach(function(t){r[t.name](t.defaultVal)}),r},r.resetProps(),e._rerender=s,r}};var r,i=(r=n)&&r.__esModule?r:{default:r},a=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function t(e,n){var r=n.default,i=void 0===r?null:r,a=n.triggerUpdate,o=void 0===a||a,s=n.onChange,u=void 0===s?function(t,e){}:s;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e,this.defaultVal=i,this.triggerUpdate=o,this.onChange=u};t.exports=e.default},i=[t,e,n(1)],void 0===(a="function"==typeof(r=o)?r.apply(e,i):r)||(t.exports=a)},function(t,e){t.exports=function(t,e,n){var r,i,a,o,s;function u(){var c=Date.now()-o;c<e&&c>=0?r=setTimeout(u,e-c):(r=null,n||(s=t.apply(a,i),a=i=null))}null==e&&(e=100);var c=function(){a=this,i=arguments,o=Date.now();var c=n&&!r;return r||(r=setTimeout(u,e)),c&&(s=t.apply(a,i),a=i=null),s};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(s=t.apply(a,i),a=i=null,clearTimeout(r),r=null)},c}}])}),i=e(r),a=(r.Kapsule,n(function(t,e){var n=function(){this._tweens={},this._tweensAddedDuringUpdate={}};n.prototype={getAll:function(){return Object.keys(this._tweens).map(function(t){return this._tweens[t]}.bind(this))},removeAll:function(){this._tweens={}},add:function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},remove:function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},update:function(t,e){var n=Object.keys(this._tweens);if(0===n.length)return!1;for(t=void 0!==t?t:i.now();n.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var a=this._tweens[n[r]];a&&!1===a.update(t)&&(a._isPlaying=!1,e||delete this._tweens[n[r]])}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var r,i=new n;i.Group=n,i._nextId=0,i.nextId=function(){return i._nextId++},"undefined"==typeof window&&"undefined"!=typeof process&&process.hrtime?i.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?i.now=window.performance.now.bind(window.performance):void 0!==Date.now?i.now=Date.now:i.now=function(){return(new Date).getTime()},i.Tween=function(t,e){this._object=t,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=i.Easing.Linear.None,this._interpolationFunction=i.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onCompleteCallback=null,this._onStopCallback=null,this._group=e||i,this._id=i.nextId()},i.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(t,e){return this._valuesEnd=t,void 0!==e&&(this._duration=e),this},start:function(t){for(var e in this._group.add(this),this._isPlaying=!0,this._onStartCallbackFired=!1,this._startTime=void 0!==t?"string"==typeof t?i.now()+parseFloat(t):t:i.now(),this._startTime+=this._delayTime,this._valuesEnd){if(this._valuesEnd[e]instanceof Array){if(0===this._valuesEnd[e].length)continue;this._valuesEnd[e]=[this._object[e]].concat(this._valuesEnd[e])}void 0!==this._object[e]&&(this._valuesStart[e]=this._object[e],this._valuesStart[e]instanceof Array==!1&&(this._valuesStart[e]*=1),this._valuesStartRepeat[e]=this._valuesStart[e]||0)}return this},stop:function(){return this._isPlaying?(this._group.remove(this),this._isPlaying=!1,null!==this._onStopCallback&&this._onStopCallback(this._object),this.stopChainedTweens(),this):this},end:function(){return this.update(this._startTime+this._duration),this},stopChainedTweens:function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop()},group:function(t){return this._group=t,this},delay:function(t){return this._delayTime=t,this},repeat:function(t){return this._repeat=t,this},repeatDelay:function(t){return this._repeatDelayTime=t,this},yoyo:function(t){return this._yoyo=t,this},easing:function(t){return this._easingFunction=t,this},interpolation:function(t){return this._interpolationFunction=t,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(t){return this._onStartCallback=t,this},onUpdate:function(t){return this._onUpdateCallback=t,this},onComplete:function(t){return this._onCompleteCallback=t,this},onStop:function(t){return this._onStopCallback=t,this},update:function(t){var e,n,r;if(t<this._startTime)return!0;for(e in!1===this._onStartCallbackFired&&(null!==this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(t-this._startTime)/this._duration,n=0===this._duration||n>1?1:n,r=this._easingFunction(n),this._valuesEnd)if(void 0!==this._valuesStart[e]){var i=this._valuesStart[e]||0,a=this._valuesEnd[e];a instanceof Array?this._object[e]=this._interpolationFunction(a,r):("string"==typeof a&&(a="+"===a.charAt(0)||"-"===a.charAt(0)?i+parseFloat(a):parseFloat(a)),"number"==typeof a&&(this._object[e]=i+(a-i)*r))}if(null!==this._onUpdateCallback&&this._onUpdateCallback(this._object),1===n){if(this._repeat>0){for(e in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat){if("string"==typeof this._valuesEnd[e]&&(this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(this._valuesEnd[e])),this._yoyo){var o=this._valuesStartRepeat[e];this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=o}this._valuesStart[e]=this._valuesStartRepeat[e]}return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,!0}null!==this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var s=0,u=this._chainedTweens.length;s<u;s++)this._chainedTweens[s].start(this._startTime+this._duration);return!1}return!0}},i.Easing={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-i.Easing.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*i.Easing.Bounce.In(2*t):.5*i.Easing.Bounce.Out(2*t-1)+.5}}},i.Interpolation={Linear:function(t,e){var n=t.length-1,r=n*e,a=Math.floor(r),o=i.Interpolation.Utils.Linear;return e<0?o(t[0],t[1],r):e>1?o(t[n],t[n-1],n-r):o(t[a],t[a+1>n?n:a+1],r-a)},Bezier:function(t,e){for(var n=0,r=t.length-1,a=Math.pow,o=i.Interpolation.Utils.Bernstein,s=0;s<=r;s++)n+=a(1-e,r-s)*a(e,s)*t[s]*o(r,s);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,a=Math.floor(r),o=i.Interpolation.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(a=Math.floor(r=n*(1+e))),o(t[(a-1+n)%n],t[a],t[(a+1)%n],t[(a+2)%n],r-a)):e<0?t[0]-(o(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(o(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):o(t[a?a-1:0],t[a],t[n<a+1?n:a+1],t[n<a+2?n:a+2],r-a)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=i.Interpolation.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(r=[1],function(t){var e=1;if(r[t])return r[t];for(var n=t;n>1;n--)e*=n;return r[t]=e,e}),CatmullRom:function(t,e,n,r,i){var a=.5*(n-t),o=.5*(r-e),s=i*i;return(2*e-2*n+a+o)*(i*s)+(-3*e+3*n-2*a-o)*s+a*i+e}}},t.exports=i}));const o=t=>{t instanceof Array?t.forEach(o):(t.map&&t.map.dispose(),t.dispose())},s=t=>{t.geometry&&t.geometry.dispose(),t.material&&o(t.material),t.texture&&t.texture.dispose(),t.children&&t.children.forEach(s)},u=t=>{for(;t.children.length;){const e=t.children[0];t.remove(e),s(e)}};function c(t,e){const n=new e;return{linkProp:function(e){return{default:n[e](),onChange(n,r){r[t][e](n)},triggerUpdate:!1}},linkMethod:function(e){return function(n,...r){const i=n[t],a=i[e](...r);return a===i?this:a}}}}const l=100;function f(t,e,n=0){const r=(90-t)*Math.PI/180,i=(90-e)*Math.PI/180,a=l*(1+n);return{x:a*Math.sin(r)*Math.cos(i),y:a*Math.cos(r),z:a*Math.sin(r)*Math.sin(i)}}function h(){return new d}function d(){this.reset()}d.prototype={constructor:d,reset:function(){this.s=this.t=0},add:function(t){g(p,t,this.t),g(this,p.s,this.s),this.s?this.t+=p.t:this.s=p.t},valueOf:function(){return this.s}};var p=new d;function g(t,e,n){var r=t.s=e+n,i=r-e,a=r-i;t.t=e-a+(n-i)}var b=1e-6,_=Math.PI,v=_/2,m=180/_,y=_/180,w=Math.abs,M=Math.atan2,x=Math.cos,O=Math.ceil,A=Math.sin,S=Math.sqrt;function j(t){return(t=A(t/2))*t}function k(){}function T(t,e){t&&E.hasOwnProperty(t.type)&&E[t.type](t,e)}var C={Feature:function(t,e){T(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)T(n[r].geometry,e)}},E={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){I(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)I(n[r],e,0)},Polygon:function(t,e){L(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)L(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)T(n[r],e)}};function I(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function L(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)I(t[n],e,1);e.polygonEnd()}h(),h(),h(),h();function P(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var R,F;1===(R=P).length&&(F=R,R=function(t,e){return P(F(t),e)});function U(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}var D,H,G,B=h(),N={sphere:k,point:k,lineStart:function(){N.point=z,N.lineEnd=q},lineEnd:k,polygonStart:k,polygonEnd:k};function q(){N.point=N.lineEnd=k}function z(t,e){D=t*=y,H=A(e*=y),G=x(e),N.point=V}function V(t,e){t*=y;var n=A(e*=y),r=x(e),i=w(t-D),a=x(i),o=r*A(i),s=G*n-H*r*a,u=H*n+G*r*a;B.add(M(S(o*o+s*s),u)),D=t,H=n,G=r}function Q(t){return B.reset(),function(t,e){t&&C.hasOwnProperty(t.type)?C[t.type](t,e):T(t,e)}(t,N),+B}var $=[null,null],J={type:"LineString",coordinates:$};function X(t,e,n){var r=U(t,e-b,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function K(t,e,n){var r=U(t,e-b,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function W(){return function(){var t,e,n,r,i,a,o,s,u,c,l,f,h=10,d=h,p=90,g=360,_=2.5;function v(){return{type:"MultiLineString",coordinates:m()}}function m(){return U(O(r/p)*p,n,p).map(l).concat(U(O(s/g)*g,o,g).map(f)).concat(U(O(e/h)*h,t,h).filter(function(t){return w(t%p)>b}).map(u)).concat(U(O(a/d)*d,i,d).filter(function(t){return w(t%g)>b}).map(c))}return v.lines=function(){return m().map(function(t){return{type:"LineString",coordinates:t}})},v.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(o).slice(1),l(n).reverse().slice(1),f(s).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),s>o&&(t=s,s=o,o=t),v.precision(_)):[[r,s],[n,o]]},v.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),v.precision(_)):[[e,a],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],v):[p,g]},v.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],v):[h,d]},v.precision=function(h){return arguments.length?(_=+h,u=X(a,i,90),c=K(e,t,_),l=X(s,o,90),f=K(r,n,_),v):_},v.extentMajor([[-180,-90+b],[180,90-b]]).extentMinor([[-180,-80-b],[180,80+b]])}()()}function Y(t,e){var n,r=t[0]*y,i=t[1]*y,a=e[0]*y,o=e[1]*y,s=x(i),u=A(i),c=x(o),l=A(o),f=s*x(r),h=s*A(r),d=c*x(a),p=c*A(a),g=2*((n=S(j(o-i)+s*c*j(a-r)))>1?v:n<-1?-v:Math.asin(n)),b=A(g),_=g?function(t){var e=A(t*=g)/b,n=A(g-t)/b,r=n*f+e*d,i=n*h+e*p,a=n*u+e*l;return[M(i,r)*m,M(a,S(r*r+i*i))*m]}:function(){return[r*m,i*m]};return _.distance=g,_}h(),h(),h();const Z=window.THREE?window.THREE:{Geometry:t.Geometry,Line:t.Line,LineBasicMaterial:t.LineBasicMaterial,ParticleSystem:t.ParticleSystem,ParticleSystemMaterial:t.ParticleSystemMaterial,Vector3:t.Vector3};function tt(t,e,n,r,i){i=i||window.scene;for(var a=[],o=[],s=[],u=function(t){var e=[];if("Feature"==t.type)e.push(t.geometry);else if("FeatureCollection"==t.type)for(var n=0;n<t.features.length;n++)e.push(t.features[n].geometry);else{if("GeometryCollection"!=t.type)throw new Error("The geoJSON is not valid.");for(var r=0;r<t.geometries.length;r++)e.push(t.geometries[r])}return e}(t),c=function(t){var e;if("sphere"==t)e=m;else{if("plane"!=t)throw new Error("The shape that you specified is not valid.");e=y}return e}(n),l=[],f=0;f<u.length;f++)if("Point"==u[f].type)c(u[f].coordinates,e),w(a[0],o[0],s[0],r);else if("MultiPoint"==u[f].type)for(var h=0;h<u[f].coordinates.length;h++)c(u[f].coordinates[h],e),w(a[0],o[0],s[0],r);else if("LineString"==u[f].type){l=g(u[f].coordinates);for(h=0;h<l.length;h++)c(l[h],e);M(a,o,s,r)}else if("Polygon"==u[f].type)for(var d=0;d<u[f].coordinates.length;d++){l=g(u[f].coordinates[d]);for(h=0;h<l.length;h++)c(l[h],e);M(a,o,s,r)}else if("MultiLineString"==u[f].type)for(d=0;d<u[f].coordinates.length;d++){l=g(u[f].coordinates[d]);for(h=0;h<l.length;h++)c(l[h],e);M(a,o,s,r)}else{if("MultiPolygon"!=u[f].type)throw new Error("The geoJSON is not valid.");for(var p=0;p<u[f].coordinates.length;p++)for(d=0;d<u[f].coordinates[p].length;d++){l=g(u[f].coordinates[p][d]);for(h=0;h<l.length;h++)c(l[h],e);M(a,o,s,r)}}function g(t){for(var e=[],n=[],r=0;r<t.length;r++){var i=t[r],a=t[r-1];if(r>0)if(b(a,i)){n=_(n=[a,i]);for(var o=0;o<n.length;o++)e.push(n[o])}else e.push(i);else e.push(i)}return e}function b(t,e){var n=e[0],r=e[1],i=t[0],a=t[1],o=Math.abs(n-i),s=Math.abs(r-a);return o>5||s>5}function _(t){for(var e,n,r=[],i=0;i<t.length-1;i++)e=t[i],b(n=t[i+1],e)?(r.push(e),r.push(v(e,n))):r.push(e);return r.push(t[t.length-1]),r.length>t.length?r=_(r):r}function v(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}function m(t,e){var n=t[0],r=t[1];a.push(Math.cos(r*Math.PI/180)*Math.cos(n*Math.PI/180)*e),o.push(Math.cos(r*Math.PI/180)*Math.sin(n*Math.PI/180)*e),s.push(Math.sin(r*Math.PI/180)*e)}function y(t,e){var n=t[0],r=t[1];s.push(r/180*e),o.push(n/180*e)}function w(t,e,n,r){var a=new Z.Geometry;a.vertices.push(new Z.Vector3(t,e,n));var o=new Z.ParticleSystemMaterial(r),s=new Z.ParticleSystem(a,o);i.add(s),x()}function M(t,e,n,r){var a=new Z.Geometry;!function(t,e,n,r){for(var i=0;i<e.length;i++)t.vertices.push(new Z.Vector3(e[i],n[i],r[i]))}(a,t,e,n);var o=new Z.LineBasicMaterial(r),s=new Z.Line(a,o);i.add(s),x()}function x(){a.length=0,o.length=0,s.length=0}}const et=window.THREE?window.THREE:{AdditiveBlending:t.AdditiveBlending,BackSide:t.BackSide,Color:t.Color,Mesh:t.Mesh,MeshPhongMaterial:t.MeshPhongMaterial,Object3D:t.Object3D,ShaderMaterial:t.ShaderMaterial,SphereGeometry:t.SphereGeometry,TextureLoader:t.TextureLoader};var nt=i({props:{globeImageUrl:{onChange(t,e){e.globeNeedsUpdate=!0}},bumpImageUrl:{onChange(t,e){e.globeNeedsUpdate=!0}},showAtmosphere:{default:!0,onChange(t,e){e.atmosphereObj.visible=!!t},triggerUpdate:!1},showGraticules:{default:!1,onChange(t,e){e.graticulesObj.visible=!!t},triggerUpdate:!1}},stateInit:()=>{const t=new et.SphereGeometry(l,75,75),e=new et.Mesh(t,new et.MeshPhongMaterial({color:0}));let n,r;e.rotation.y=-Math.PI/2,e.__globeObjType="globe";{const e={vertex:["varying vec3 vNormal;","void main() {","vNormal = normalize( normalMatrix * normal );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragment:["varying vec3 vNormal;","void main() {","float intensity = pow( 0.8 - dot( vNormal, vec3( 0, 0, 1.0 ) ), 12.0 );","gl_FragColor = vec4( 1.0, 1.0, 1.0, 1.0 ) * intensity;","}"].join("\n")},r=new et.ShaderMaterial({uniforms:{},vertexShader:e.vertex,fragmentShader:e.fragment,side:et.BackSide,blending:et.AdditiveBlending,transparent:!0});(n=new et.Mesh(t,r)).scale.set(1.1,1.1,1.1),n.__globeObjType="atmosphere"}return r=new et.Object3D,tt({geometry:W(),type:"Feature"},l,"sphere",{color:"lightgrey",transparent:!0,opacity:.1},r),r.rotation.x=Math.PI/2,{globeObj:e,atmosphereObj:n,graticulesObj:r}},init(t,e){u(t),e.scene=t,e.scene.add(e.globeObj),e.scene.add(e.atmosphereObj),e.scene.add(e.graticulesObj)},update(t){const e=t.globeObj.material;e.color=new et.Color(0),t.globeImageUrl&&(new et.TextureLoader).load(t.globeImageUrl,t=>{e.map=t,e.color=null,e.needsUpdate=!0}),t.bumpImageUrl&&(new et.TextureLoader).load(t.bumpImageUrl,t=>{e.bumpMap=t,e.needsUpdate=!0})}}),rt=n(function(t,e){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){var r,i,a;i=[t,e],void 0!==(a="function"==typeof(r=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t instanceof Function?t:"string"==typeof t?function(e){return e[t]}:function(e){return t}},t.exports=e.default})?r.apply(e,i):r)&&(t.exports=a)}])}),it=e(rt),at=(rt.accessorFn,n(function(t){!function(e){var n=/^\s+/,r=/\s+$/,i=0,a=e.round,o=e.min,s=e.max,u=e.random;function c(t,u){if(u=u||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,u);var l=function(t){var i={r:0,g:0,b:0},a=1,u=null,c=null,l=null,f=!1,h=!1;"string"==typeof t&&(t=function(t){t=t.replace(n,"").replace(r,"").toLowerCase();var e,i=!1;if(j[t])t=j[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=G.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=G.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=G.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=G.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=G.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=G.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=G.hex8.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),a:F(e[4]),format:i?"name":"hex8"};if(e=G.hex6.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),format:i?"name":"hex"};if(e=G.hex4.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),a:F(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=G.hex3.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(t));"object"==typeof t&&(B(t.r)&&B(t.g)&&B(t.b)?(d=t.r,p=t.g,g=t.b,i={r:255*C(d,255),g:255*C(p,255),b:255*C(g,255)},f=!0,h="%"===String(t.r).substr(-1)?"prgb":"rgb"):B(t.h)&&B(t.s)&&B(t.v)?(u=P(t.s),c=P(t.v),i=function(t,n,r){t=6*C(t,360),n=C(n,100),r=C(r,100);var i=e.floor(t),a=t-i,o=r*(1-n),s=r*(1-a*n),u=r*(1-(1-a)*n),c=i%6;return{r:255*[r,s,o,o,u,r][c],g:255*[u,r,r,s,o,o][c],b:255*[o,o,u,r,r,s][c]}}(t.h,u,c),f=!0,h="hsv"):B(t.h)&&B(t.s)&&B(t.l)&&(u=P(t.s),l=P(t.l),i=function(t,e,n){var r,i,a;function o(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=C(t,360),e=C(e,100),n=C(n,100),0===e)r=i=a=n;else{var s=n<.5?n*(1+e):n+e-n*e,u=2*n-s;r=o(u,s,t+1/3),i=o(u,s,t),a=o(u,s,t-1/3)}return{r:255*r,g:255*i,b:255*a}}(t.h,u,l),f=!0,h="hsl"),t.hasOwnProperty("a")&&(a=t.a));var d,p,g;return a=T(a),{ok:f,format:t.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(t);this._originalInput=t,this._r=l.r,this._g=l.g,this._b=l.b,this._a=l.a,this._roundA=a(100*this._a)/100,this._format=u.format||l.format,this._gradientType=u.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=l.ok,this._tc_id=i++}function l(t,e,n){t=C(t,255),e=C(e,255),n=C(n,255);var r,i,a=s(t,e,n),u=o(t,e,n),c=(a+u)/2;if(a==u)r=i=0;else{var l=a-u;switch(i=c>.5?l/(2-a-u):l/(a+u),a){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:i,l:c}}function f(t,e,n){t=C(t,255),e=C(e,255),n=C(n,255);var r,i,a=s(t,e,n),u=o(t,e,n),c=a,l=a-u;if(i=0===a?0:l/a,a==u)r=0;else{switch(a){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:i,v:c}}function h(t,e,n,r){var i=[L(a(t).toString(16)),L(a(e).toString(16)),L(a(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function d(t,e,n,r){return[L(R(r)),L(a(t).toString(16)),L(a(e).toString(16)),L(a(n).toString(16))].join("")}function p(t,e){e=0===e?0:e||10;var n=c(t).toHsl();return n.s-=e/100,n.s=E(n.s),c(n)}function g(t,e){e=0===e?0:e||10;var n=c(t).toHsl();return n.s+=e/100,n.s=E(n.s),c(n)}function b(t){return c(t).desaturate(100)}function _(t,e){e=0===e?0:e||10;var n=c(t).toHsl();return n.l+=e/100,n.l=E(n.l),c(n)}function v(t,e){e=0===e?0:e||10;var n=c(t).toRgb();return n.r=s(0,o(255,n.r-a(-e/100*255))),n.g=s(0,o(255,n.g-a(-e/100*255))),n.b=s(0,o(255,n.b-a(-e/100*255))),c(n)}function m(t,e){e=0===e?0:e||10;var n=c(t).toHsl();return n.l-=e/100,n.l=E(n.l),c(n)}function y(t,e){var n=c(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,c(n)}function w(t){var e=c(t).toHsl();return e.h=(e.h+180)%360,c(e)}function M(t){var e=c(t).toHsl(),n=e.h;return[c(t),c({h:(n+120)%360,s:e.s,l:e.l}),c({h:(n+240)%360,s:e.s,l:e.l})]}function x(t){var e=c(t).toHsl(),n=e.h;return[c(t),c({h:(n+90)%360,s:e.s,l:e.l}),c({h:(n+180)%360,s:e.s,l:e.l}),c({h:(n+270)%360,s:e.s,l:e.l})]}function O(t){var e=c(t).toHsl(),n=e.h;return[c(t),c({h:(n+72)%360,s:e.s,l:e.l}),c({h:(n+216)%360,s:e.s,l:e.l})]}function A(t,e,n){e=e||6,n=n||30;var r=c(t).toHsl(),i=360/n,a=[c(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,a.push(c(r));return a}function S(t,e){e=e||6;for(var n=c(t).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/e;e--;)o.push(c({h:r,s:i,v:a})),a=(a+s)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,n,r,i=this.toRgb();return t=i.r/255,n=i.g/255,r=i.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=T(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=a(360*t.h),n=a(100*t.s),r=a(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=l(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=l(this._r,this._g,this._b),e=a(360*t.h),n=a(100*t.s),r=a(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var o=[L(a(t).toString(16)),L(a(e).toString(16)),L(a(n).toString(16)),L(R(r))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(k[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);n="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(_,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(S,arguments)},splitcomplement:function(){return this._applyCombination(O,arguments)},triad:function(){return this._applyCombination(M,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:P(t[r]));t=n}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:u(),g:u(),b:u()})},c.mix=function(t,e,n){n=0===n?0:n||50;var r=c(t).toRgb(),i=c(e).toRgb(),a=n/100;return c({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})}, | ||
// Version 1.4.1 three-globe - https://github.com/vasturiano/three-globe | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("three")):"function"==typeof define&&define.amd?define(["three"],e):(t=t||self).ThreeGlobe=e(t.THREE)}(this,function(t){"use strict";"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n(function(t,e){"undefined"!=typeof self&&self,t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){var r,a,i,o;o=function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.stateInit,n=void 0===e?function(){return{}}:e,r=t.props,s=void 0===r?{}:r,u=t.methods,c=void 0===u?{}:u,l=t.aliases,f=void 0===l?{}:l,h=t.init,d=void 0===h?function(){}:h,p=t.update,g=void 0===p?function(){}:p,b=Object.keys(s).map(function(t){return new o(t,s[t])});return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},n instanceof Function?n(t):n,{initialised:!1});function r(e){return o(e,t),s(),r}var o=function(t,n){d.call(r,t,e,n),e.initialised=!0},s=(0,a.default)(function(){e.initialised&&g.call(r,e)},1);return b.forEach(function(t){r[t.name]=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(t,e){};return function(i){var o=e[t];return arguments.length?(e[t]=i,a.call(r,i,e,o),n&&s(),r):o}}(t.name,t.triggerUpdate,t.onChange)}),Object.keys(c).forEach(function(t){r[t]=function(){for(var n,a=arguments.length,i=Array(a),o=0;o<a;o++)i[o]=arguments[o];return(n=c[t]).call.apply(n,[r,e].concat(i))}}),Object.entries(f).forEach(function(t){var e=i(t,2),n=e[0],a=e[1];return r[n]=r[a]}),r.resetProps=function(){return b.forEach(function(t){r[t.name](t.defaultVal)}),r},r.resetProps(),e._rerender=s,r}};var r,a=(r=n)&&r.__esModule?r:{default:r},i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(t){a=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function t(e,n){var r=n.default,a=void 0===r?null:r,i=n.triggerUpdate,o=void 0===i||i,s=n.onChange,u=void 0===s?function(t,e){}:s;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e,this.defaultVal=a,this.triggerUpdate=o,this.onChange=u};t.exports=e.default},a=[t,e,n(1)],void 0===(i="function"==typeof(r=o)?r.apply(e,a):r)||(t.exports=i)},function(t,e){t.exports=function(t,e,n){var r,a,i,o,s;function u(){var c=Date.now()-o;c<e&&c>=0?r=setTimeout(u,e-c):(r=null,n||(s=t.apply(i,a),i=a=null))}null==e&&(e=100);var c=function(){i=this,a=arguments,o=Date.now();var c=n&&!r;return r||(r=setTimeout(u,e)),c&&(s=t.apply(i,a),i=a=null),s};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(s=t.apply(i,a),i=a=null,clearTimeout(r),r=null)},c}}])}),a=e(r),i=(r.Kapsule,n(function(t,e){var n=function(){this._tweens={},this._tweensAddedDuringUpdate={}};n.prototype={getAll:function(){return Object.keys(this._tweens).map(function(t){return this._tweens[t]}.bind(this))},removeAll:function(){this._tweens={}},add:function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},remove:function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},update:function(t,e){var n=Object.keys(this._tweens);if(0===n.length)return!1;for(t=void 0!==t?t:a.now();n.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var i=this._tweens[n[r]];i&&!1===i.update(t)&&(i._isPlaying=!1,e||delete this._tweens[n[r]])}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var r,a=new n;a.Group=n,a._nextId=0,a.nextId=function(){return a._nextId++},"undefined"==typeof window&&"undefined"!=typeof process&&process.hrtime?a.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?a.now=window.performance.now.bind(window.performance):void 0!==Date.now?a.now=Date.now:a.now=function(){return(new Date).getTime()},a.Tween=function(t,e){this._object=t,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=a.Easing.Linear.None,this._interpolationFunction=a.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onCompleteCallback=null,this._onStopCallback=null,this._group=e||a,this._id=a.nextId()},a.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(t,e){return this._valuesEnd=t,void 0!==e&&(this._duration=e),this},start:function(t){for(var e in this._group.add(this),this._isPlaying=!0,this._onStartCallbackFired=!1,this._startTime=void 0!==t?"string"==typeof t?a.now()+parseFloat(t):t:a.now(),this._startTime+=this._delayTime,this._valuesEnd){if(this._valuesEnd[e]instanceof Array){if(0===this._valuesEnd[e].length)continue;this._valuesEnd[e]=[this._object[e]].concat(this._valuesEnd[e])}void 0!==this._object[e]&&(this._valuesStart[e]=this._object[e],this._valuesStart[e]instanceof Array==!1&&(this._valuesStart[e]*=1),this._valuesStartRepeat[e]=this._valuesStart[e]||0)}return this},stop:function(){return this._isPlaying?(this._group.remove(this),this._isPlaying=!1,null!==this._onStopCallback&&this._onStopCallback(this._object),this.stopChainedTweens(),this):this},end:function(){return this.update(this._startTime+this._duration),this},stopChainedTweens:function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop()},group:function(t){return this._group=t,this},delay:function(t){return this._delayTime=t,this},repeat:function(t){return this._repeat=t,this},repeatDelay:function(t){return this._repeatDelayTime=t,this},yoyo:function(t){return this._yoyo=t,this},easing:function(t){return this._easingFunction=t,this},interpolation:function(t){return this._interpolationFunction=t,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(t){return this._onStartCallback=t,this},onUpdate:function(t){return this._onUpdateCallback=t,this},onComplete:function(t){return this._onCompleteCallback=t,this},onStop:function(t){return this._onStopCallback=t,this},update:function(t){var e,n,r;if(t<this._startTime)return!0;for(e in!1===this._onStartCallbackFired&&(null!==this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(t-this._startTime)/this._duration,n=0===this._duration||n>1?1:n,r=this._easingFunction(n),this._valuesEnd)if(void 0!==this._valuesStart[e]){var a=this._valuesStart[e]||0,i=this._valuesEnd[e];i instanceof Array?this._object[e]=this._interpolationFunction(i,r):("string"==typeof i&&(i="+"===i.charAt(0)||"-"===i.charAt(0)?a+parseFloat(i):parseFloat(i)),"number"==typeof i&&(this._object[e]=a+(i-a)*r))}if(null!==this._onUpdateCallback&&this._onUpdateCallback(this._object),1===n){if(this._repeat>0){for(e in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat){if("string"==typeof this._valuesEnd[e]&&(this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(this._valuesEnd[e])),this._yoyo){var o=this._valuesStartRepeat[e];this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=o}this._valuesStart[e]=this._valuesStartRepeat[e]}return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,!0}null!==this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var s=0,u=this._chainedTweens.length;s<u;s++)this._chainedTweens[s].start(this._startTime+this._duration);return!1}return!0}},a.Easing={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-a.Easing.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*a.Easing.Bounce.In(2*t):.5*a.Easing.Bounce.Out(2*t-1)+.5}}},a.Interpolation={Linear:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),o=a.Interpolation.Utils.Linear;return e<0?o(t[0],t[1],r):e>1?o(t[n],t[n-1],n-r):o(t[i],t[i+1>n?n:i+1],r-i)},Bezier:function(t,e){for(var n=0,r=t.length-1,i=Math.pow,o=a.Interpolation.Utils.Bernstein,s=0;s<=r;s++)n+=i(1-e,r-s)*i(e,s)*t[s]*o(r,s);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),o=a.Interpolation.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(i=Math.floor(r=n*(1+e))),o(t[(i-1+n)%n],t[i],t[(i+1)%n],t[(i+2)%n],r-i)):e<0?t[0]-(o(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(o(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):o(t[i?i-1:0],t[i],t[n<i+1?n:i+1],t[n<i+2?n:i+2],r-i)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=a.Interpolation.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(r=[1],function(t){var e=1;if(r[t])return r[t];for(var n=t;n>1;n--)e*=n;return r[t]=e,e}),CatmullRom:function(t,e,n,r,a){var i=.5*(n-t),o=.5*(r-e),s=a*a;return(2*e-2*n+i+o)*(a*s)+(-3*e+3*n-2*i-o)*s+i*a+e}}},t.exports=a}));const o=t=>{t instanceof Array?t.forEach(o):(t.map&&t.map.dispose(),t.dispose())},s=t=>{t.geometry&&t.geometry.dispose(),t.material&&o(t.material),t.texture&&t.texture.dispose(),t.children&&t.children.forEach(s)},u=t=>{for(;t.children.length;){const e=t.children[0];t.remove(e),s(e)}};function c(t,e){const n=new e;return{linkProp:function(e){return{default:n[e](),onChange(n,r){r[t][e](n)},triggerUpdate:!1}},linkMethod:function(e){return function(n,...r){const a=n[t],i=a[e](...r);return i===a?this:i}}}}const l=100;function f(t,e,n=0){const r=(90-t)*Math.PI/180,a=(90-e)*Math.PI/180,i=l*(1+n);return{x:i*Math.sin(r)*Math.cos(a),y:i*Math.cos(r),z:i*Math.sin(r)*Math.sin(a)}}function h(){return new d}function d(){this.reset()}d.prototype={constructor:d,reset:function(){this.s=this.t=0},add:function(t){g(p,t,this.t),g(this,p.s,this.s),this.s?this.t+=p.t:this.s=p.t},valueOf:function(){return this.s}};var p=new d;function g(t,e,n){var r=t.s=e+n,a=r-e,i=r-a;t.t=e-i+(n-a)}var b=1e-6,_=Math.PI,v=_/2,m=180/_,y=_/180,w=Math.abs,M=Math.atan2,x=Math.cos,O=Math.ceil,A=Math.sin,S=Math.sqrt;function j(t){return(t=A(t/2))*t}function k(){}function C(t,e){t&&E.hasOwnProperty(t.type)&&E[t.type](t,e)}var T={Feature:function(t,e){C(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,a=n.length;++r<a;)C(n[r].geometry,e)}},E={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,a=n.length;++r<a;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){I(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,a=n.length;++r<a;)I(n[r],e,0)},Polygon:function(t,e){L(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,a=n.length;++r<a;)L(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,a=n.length;++r<a;)C(n[r],e)}};function I(t,e,n){var r,a=-1,i=t.length-n;for(e.lineStart();++a<i;)r=t[a],e.point(r[0],r[1],r[2]);e.lineEnd()}function L(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)I(t[n],e,1);e.polygonEnd()}h(),h(),h(),h();function P(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var R,F;1===(R=P).length&&(F=R,R=function(t,e){return P(F(t),e)});function U(t,e,n){t=+t,e=+e,n=(a=arguments.length)<2?(e=t,t=0,1):a<3?1:+n;for(var r=-1,a=0|Math.max(0,Math.ceil((e-t)/n)),i=new Array(a);++r<a;)i[r]=t+r*n;return i}var D,H,G,B=h(),N={sphere:k,point:k,lineStart:function(){N.point=z,N.lineEnd=q},lineEnd:k,polygonStart:k,polygonEnd:k};function q(){N.point=N.lineEnd=k}function z(t,e){D=t*=y,H=A(e*=y),G=x(e),N.point=V}function V(t,e){t*=y;var n=A(e*=y),r=x(e),a=w(t-D),i=x(a),o=r*A(a),s=G*n-H*r*i,u=H*n+G*r*i;B.add(M(S(o*o+s*s),u)),D=t,H=n,G=r}function Q(t){return B.reset(),function(t,e){t&&T.hasOwnProperty(t.type)?T[t.type](t,e):C(t,e)}(t,N),+B}var $=[null,null],J={type:"LineString",coordinates:$};function X(t,e,n){var r=U(t,e-b,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function K(t,e,n){var r=U(t,e-b,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function W(){return function(){var t,e,n,r,a,i,o,s,u,c,l,f,h=10,d=h,p=90,g=360,_=2.5;function v(){return{type:"MultiLineString",coordinates:m()}}function m(){return U(O(r/p)*p,n,p).map(l).concat(U(O(s/g)*g,o,g).map(f)).concat(U(O(e/h)*h,t,h).filter(function(t){return w(t%p)>b}).map(u)).concat(U(O(i/d)*d,a,d).filter(function(t){return w(t%g)>b}).map(c))}return v.lines=function(){return m().map(function(t){return{type:"LineString",coordinates:t}})},v.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(o).slice(1),l(n).reverse().slice(1),f(s).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),s>o&&(t=s,s=o,o=t),v.precision(_)):[[r,s],[n,o]]},v.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],i=+n[0][1],a=+n[1][1],e>t&&(n=e,e=t,t=n),i>a&&(n=i,i=a,a=n),v.precision(_)):[[e,i],[t,a]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],v):[p,g]},v.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],v):[h,d]},v.precision=function(h){return arguments.length?(_=+h,u=X(i,a,90),c=K(e,t,_),l=X(s,o,90),f=K(r,n,_),v):_},v.extentMajor([[-180,-90+b],[180,90-b]]).extentMinor([[-180,-80-b],[180,80+b]])}()()}function Y(t,e){var n,r=t[0]*y,a=t[1]*y,i=e[0]*y,o=e[1]*y,s=x(a),u=A(a),c=x(o),l=A(o),f=s*x(r),h=s*A(r),d=c*x(i),p=c*A(i),g=2*((n=S(j(o-a)+s*c*j(i-r)))>1?v:n<-1?-v:Math.asin(n)),b=A(g),_=g?function(t){var e=A(t*=g)/b,n=A(g-t)/b,r=n*f+e*d,a=n*h+e*p,i=n*u+e*l;return[M(a,r)*m,M(i,S(r*r+a*a))*m]}:function(){return[r*m,a*m]};return _.distance=g,_}h(),h(),h();const Z=window.THREE?window.THREE:{Geometry:t.Geometry,Line:t.Line,LineBasicMaterial:t.LineBasicMaterial,ParticleSystem:t.ParticleSystem,ParticleSystemMaterial:t.ParticleSystemMaterial,Vector3:t.Vector3};function tt(t,e,n,r,a){a=a||window.scene;for(var i=[],o=[],s=[],u=function(t){var e=[];if("Feature"==t.type)e.push(t.geometry);else if("FeatureCollection"==t.type)for(var n=0;n<t.features.length;n++)e.push(t.features[n].geometry);else{if("GeometryCollection"!=t.type)throw new Error("The geoJSON is not valid.");for(var r=0;r<t.geometries.length;r++)e.push(t.geometries[r])}return e}(t),c=function(t){var e;if("sphere"==t)e=m;else{if("plane"!=t)throw new Error("The shape that you specified is not valid.");e=y}return e}(n),l=[],f=0;f<u.length;f++)if("Point"==u[f].type)c(u[f].coordinates,e),w(i[0],o[0],s[0],r);else if("MultiPoint"==u[f].type)for(var h=0;h<u[f].coordinates.length;h++)c(u[f].coordinates[h],e),w(i[0],o[0],s[0],r);else if("LineString"==u[f].type){l=g(u[f].coordinates);for(h=0;h<l.length;h++)c(l[h],e);M(i,o,s,r)}else if("Polygon"==u[f].type)for(var d=0;d<u[f].coordinates.length;d++){l=g(u[f].coordinates[d]);for(h=0;h<l.length;h++)c(l[h],e);M(i,o,s,r)}else if("MultiLineString"==u[f].type)for(d=0;d<u[f].coordinates.length;d++){l=g(u[f].coordinates[d]);for(h=0;h<l.length;h++)c(l[h],e);M(i,o,s,r)}else{if("MultiPolygon"!=u[f].type)throw new Error("The geoJSON is not valid.");for(var p=0;p<u[f].coordinates.length;p++)for(d=0;d<u[f].coordinates[p].length;d++){l=g(u[f].coordinates[p][d]);for(h=0;h<l.length;h++)c(l[h],e);M(i,o,s,r)}}function g(t){for(var e=[],n=[],r=0;r<t.length;r++){var a=t[r],i=t[r-1];if(r>0)if(b(i,a)){n=_(n=[i,a]);for(var o=0;o<n.length;o++)e.push(n[o])}else e.push(a);else e.push(a)}return e}function b(t,e){var n=e[0],r=e[1],a=t[0],i=t[1],o=Math.abs(n-a),s=Math.abs(r-i);return o>5||s>5}function _(t){for(var e,n,r=[],a=0;a<t.length-1;a++)e=t[a],b(n=t[a+1],e)?(r.push(e),r.push(v(e,n))):r.push(e);return r.push(t[t.length-1]),r.length>t.length?r=_(r):r}function v(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}function m(t,e){var n=t[0],r=t[1];i.push(Math.cos(r*Math.PI/180)*Math.cos(n*Math.PI/180)*e),o.push(Math.cos(r*Math.PI/180)*Math.sin(n*Math.PI/180)*e),s.push(Math.sin(r*Math.PI/180)*e)}function y(t,e){var n=t[0],r=t[1];s.push(r/180*e),o.push(n/180*e)}function w(t,e,n,r){var i=new Z.Geometry;i.vertices.push(new Z.Vector3(t,e,n));var o=new Z.ParticleSystemMaterial(r),s=new Z.ParticleSystem(i,o);a.add(s),x()}function M(t,e,n,r){var i=new Z.Geometry;!function(t,e,n,r){for(var a=0;a<e.length;a++)t.vertices.push(new Z.Vector3(e[a],n[a],r[a]))}(i,t,e,n);var o=new Z.LineBasicMaterial(r),s=new Z.Line(i,o);a.add(s),x()}function x(){i.length=0,o.length=0,s.length=0}}const et=window.THREE?window.THREE:{AdditiveBlending:t.AdditiveBlending,BackSide:t.BackSide,Color:t.Color,Mesh:t.Mesh,MeshPhongMaterial:t.MeshPhongMaterial,Object3D:t.Object3D,ShaderMaterial:t.ShaderMaterial,SphereGeometry:t.SphereGeometry,TextureLoader:t.TextureLoader};var nt=a({props:{globeImageUrl:{onChange(t,e){e.globeNeedsUpdate=!0}},bumpImageUrl:{onChange(t,e){e.globeNeedsUpdate=!0}},showAtmosphere:{default:!0,onChange(t,e){e.atmosphereObj.visible=!!t},triggerUpdate:!1},showGraticules:{default:!1,onChange(t,e){e.graticulesObj.visible=!!t},triggerUpdate:!1}},stateInit:()=>{const t=new et.SphereGeometry(l,75,75),e=new et.Mesh(t,new et.MeshPhongMaterial({color:0}));let n,r;e.rotation.y=-Math.PI/2,e.__globeObjType="globe";{const e={vertex:["varying vec3 vNormal;","void main() {","vNormal = normalize( normalMatrix * normal );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragment:["varying vec3 vNormal;","void main() {","float intensity = pow( 0.8 - dot( vNormal, vec3( 0, 0, 1.0 ) ), 12.0 );","gl_FragColor = vec4( 1.0, 1.0, 1.0, 1.0 ) * intensity;","}"].join("\n")},r=new et.ShaderMaterial({uniforms:{},vertexShader:e.vertex,fragmentShader:e.fragment,side:et.BackSide,blending:et.AdditiveBlending,transparent:!0});(n=new et.Mesh(t,r)).scale.set(1.1,1.1,1.1),n.__globeObjType="atmosphere"}return r=new et.Object3D,tt({geometry:W(),type:"Feature"},l,"sphere",{color:"lightgrey",transparent:!0,opacity:.1},r),r.rotation.x=Math.PI/2,{globeObj:e,atmosphereObj:n,graticulesObj:r}},init(t,e){u(t),e.scene=t,e.scene.add(e.globeObj),e.scene.add(e.atmosphereObj),e.scene.add(e.graticulesObj)},update(t){const e=t.globeObj.material;e.color=new et.Color(0),t.globeImageUrl&&(new et.TextureLoader).load(t.globeImageUrl,t=>{e.map=t,e.color=null,e.needsUpdate=!0}),t.bumpImageUrl&&(new et.TextureLoader).load(t.bumpImageUrl,t=>{e.bumpMap=t,e.needsUpdate=!0})}}),rt=n(function(t,e){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){var r,a,i;a=[t,e],void 0!==(i="function"==typeof(r=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t instanceof Function?t:"string"==typeof t?function(e){return e[t]}:function(e){return t}},t.exports=e.default})?r.apply(e,a):r)&&(t.exports=i)}])}),at=e(rt),it=(rt.accessorFn,n(function(t){!function(e){var n=/^\s+/,r=/\s+$/,a=0,i=e.round,o=e.min,s=e.max,u=e.random;function c(t,u){if(u=u||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,u);var l=function(t){var a={r:0,g:0,b:0},i=1,u=null,c=null,l=null,f=!1,h=!1;"string"==typeof t&&(t=function(t){t=t.replace(n,"").replace(r,"").toLowerCase();var e,a=!1;if(j[t])t=j[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=G.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=G.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=G.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=G.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=G.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=G.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=G.hex8.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),a:F(e[4]),format:a?"name":"hex8"};if(e=G.hex6.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),format:a?"name":"hex"};if(e=G.hex4.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),a:F(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=G.hex3.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(B(t.r)&&B(t.g)&&B(t.b)?(d=t.r,p=t.g,g=t.b,a={r:255*T(d,255),g:255*T(p,255),b:255*T(g,255)},f=!0,h="%"===String(t.r).substr(-1)?"prgb":"rgb"):B(t.h)&&B(t.s)&&B(t.v)?(u=P(t.s),c=P(t.v),a=function(t,n,r){t=6*T(t,360),n=T(n,100),r=T(r,100);var a=e.floor(t),i=t-a,o=r*(1-n),s=r*(1-i*n),u=r*(1-(1-i)*n),c=a%6;return{r:255*[r,s,o,o,u,r][c],g:255*[u,r,r,s,o,o][c],b:255*[o,o,u,r,r,s][c]}}(t.h,u,c),f=!0,h="hsv"):B(t.h)&&B(t.s)&&B(t.l)&&(u=P(t.s),l=P(t.l),a=function(t,e,n){var r,a,i;function o(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=T(t,360),e=T(e,100),n=T(n,100),0===e)r=a=i=n;else{var s=n<.5?n*(1+e):n+e-n*e,u=2*n-s;r=o(u,s,t+1/3),a=o(u,s,t),i=o(u,s,t-1/3)}return{r:255*r,g:255*a,b:255*i}}(t.h,u,l),f=!0,h="hsl"),t.hasOwnProperty("a")&&(i=t.a));var d,p,g;return i=C(i),{ok:f,format:t.format||h,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(t);this._originalInput=t,this._r=l.r,this._g=l.g,this._b=l.b,this._a=l.a,this._roundA=i(100*this._a)/100,this._format=u.format||l.format,this._gradientType=u.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=l.ok,this._tc_id=a++}function l(t,e,n){t=T(t,255),e=T(e,255),n=T(n,255);var r,a,i=s(t,e,n),u=o(t,e,n),c=(i+u)/2;if(i==u)r=a=0;else{var l=i-u;switch(a=c>.5?l/(2-i-u):l/(i+u),i){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:a,l:c}}function f(t,e,n){t=T(t,255),e=T(e,255),n=T(n,255);var r,a,i=s(t,e,n),u=o(t,e,n),c=i,l=i-u;if(a=0===i?0:l/i,i==u)r=0;else{switch(i){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:a,v:c}}function h(t,e,n,r){var a=[L(i(t).toString(16)),L(i(e).toString(16)),L(i(n).toString(16))];return r&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function d(t,e,n,r){return[L(R(r)),L(i(t).toString(16)),L(i(e).toString(16)),L(i(n).toString(16))].join("")}function p(t,e){e=0===e?0:e||10;var n=c(t).toHsl();return n.s-=e/100,n.s=E(n.s),c(n)}function g(t,e){e=0===e?0:e||10;var n=c(t).toHsl();return n.s+=e/100,n.s=E(n.s),c(n)}function b(t){return c(t).desaturate(100)}function _(t,e){e=0===e?0:e||10;var n=c(t).toHsl();return n.l+=e/100,n.l=E(n.l),c(n)}function v(t,e){e=0===e?0:e||10;var n=c(t).toRgb();return n.r=s(0,o(255,n.r-i(-e/100*255))),n.g=s(0,o(255,n.g-i(-e/100*255))),n.b=s(0,o(255,n.b-i(-e/100*255))),c(n)}function m(t,e){e=0===e?0:e||10;var n=c(t).toHsl();return n.l-=e/100,n.l=E(n.l),c(n)}function y(t,e){var n=c(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,c(n)}function w(t){var e=c(t).toHsl();return e.h=(e.h+180)%360,c(e)}function M(t){var e=c(t).toHsl(),n=e.h;return[c(t),c({h:(n+120)%360,s:e.s,l:e.l}),c({h:(n+240)%360,s:e.s,l:e.l})]}function x(t){var e=c(t).toHsl(),n=e.h;return[c(t),c({h:(n+90)%360,s:e.s,l:e.l}),c({h:(n+180)%360,s:e.s,l:e.l}),c({h:(n+270)%360,s:e.s,l:e.l})]}function O(t){var e=c(t).toHsl(),n=e.h;return[c(t),c({h:(n+72)%360,s:e.s,l:e.l}),c({h:(n+216)%360,s:e.s,l:e.l})]}function A(t,e,n){e=e||6,n=n||30;var r=c(t).toHsl(),a=360/n,i=[c(t)];for(r.h=(r.h-(a*e>>1)+720)%360;--e;)r.h=(r.h+a)%360,i.push(c(r));return i}function S(t,e){e=e||6;for(var n=c(t).toHsv(),r=n.h,a=n.s,i=n.v,o=[],s=1/e;e--;)o.push(c({h:r,s:a,v:i})),i=(i+s)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,n,r,a=this.toRgb();return t=a.r/255,n=a.g/255,r=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=i(360*t.h),n=i(100*t.s),r=i(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=l(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=l(this._r,this._g,this._b),e=i(360*t.h),n=i(100*t.s),r=i(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,a){var o=[L(i(t).toString(16)),L(i(e).toString(16)),L(i(n).toString(16)),L(R(r))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*T(this._r,255))+"%",g:i(100*T(this._g,255))+"%",b:i(100*T(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*T(this._r,255))+"%, "+i(100*T(this._g,255))+"%, "+i(100*T(this._b,255))+"%)":"rgba("+i(100*T(this._r,255))+"%, "+i(100*T(this._g,255))+"%, "+i(100*T(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(k[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var a=c(t);n="#"+d(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(_,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(S,arguments)},splitcomplement:function(){return this._applyCombination(O,arguments)},triad:function(){return this._applyCombination(M,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:P(t[r]));t=n}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:u(),g:u(),b:u()})},c.mix=function(t,e,n){n=0===n?0:n||50;var r=c(t).toRgb(),a=c(e).toRgb(),i=n/100;return c({r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a})}, | ||
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2) | ||
// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2) | ||
c.readability=function(t,n){var r=c(t),i=c(n);return(e.max(r.getLuminance(),i.getLuminance())+.05)/(e.min(r.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,n){var r,i,a=c.readability(t,e);switch(i=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,n){var r,i,a,o,s=null,u=0;i=(n=n||{}).includeFallbackColors,a=n.level,o=n.size;for(var l=0;l<e.length;l++)(r=c.readability(t,e[l]))>u&&(u=r,s=c(e[l]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(n.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],n))};var j=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},k=c.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(j);function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(t,n){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=o(n,s(0,parseFloat(t))),r&&(t=parseInt(t*n,10)/100),e.abs(t-n)<1e-6?1:t%n/parseFloat(n)}function E(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function L(t){return 1==t.length?"0"+t:""+t}function P(t){return t<=1&&(t=100*t+"%"),t}function R(t){return e.round(255*parseFloat(t)).toString(16)}function F(t){return I(t)/255}var U,D,H,G=(D="[\\s|\\(]+("+(U="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+U+")[,|\\s]+("+U+")\\s*\\)?",H="[\\s|\\(]+("+U+")[,|\\s]+("+U+")[,|\\s]+("+U+")[,|\\s]+("+U+")\\s*\\)?",{CSS_UNIT:new RegExp(U),rgb:new RegExp("rgb"+D),rgba:new RegExp("rgba"+H),hsl:new RegExp("hsl"+D),hsla:new RegExp("hsla"+H),hsv:new RegExp("hsv"+D),hsva:new RegExp("hsva"+H),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function B(t){return!!G.CSS_UNIT.exec(t)}t.exports?t.exports=c:window.tinycolor=c}(Math)}));const ot=t=>isNaN(t)?parseInt(at(t).toHex(),16):t,st=t=>isNaN(t)?at(t).getAlpha():1;var ut=n(function(t,e){"undefined"!=typeof self&&self,t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){var r,i,a;i=[t,e],void 0===(a="function"==typeof(r=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var n=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],r=3<arguments.length&&void 0!==arguments[3]&&arguments[3],i=(e instanceof Array?e:[e]).map(function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}}),a=t.reduce(function(t,e){var r=t,a=e;return i.forEach(function(t,e){var o=t.keyAccessor,s=void 0;if(t.isProp){var u=a,c=u[o],l=function(t,e){var n={};for(var r in t)0<=e.indexOf(r)||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(u,[o]);s=c,a=l}else s=o(a,e);e+1<i.length?(r.hasOwnProperty(s)||(r[s]={}),r=r[s]):n?(r.hasOwnProperty(s)||(r[s]=[]),r[s].push(a)):r[s]=a}),t},{});n instanceof Function&&function t(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;r===i.length?Object.keys(e).forEach(function(t){return e[t]=n(e[t])}):Object.values(e).forEach(function(e){return t(e,r+1)})}(a);var o=a;return r&&(o=[],function t(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];n.length===i.length?o.push({keys:n,vals:e}):Object.entries(e).forEach(function(e){var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e,2),i=r[0],a=r[1];return t(a,[].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(n),[i]))})}(a)),o},t.exports=e.default})?r.apply(e,i):r)||(t.exports=a)}])}),ct=e(ut);ut.indexBy;function lt(t,e,{objType:n,objTypeAttr:r="__globeObjType",objBindAttr:i="__threeObj",dataBindAttr:a="__data",objIdAttr:o="uuid"}){const s=t=>t[r]===n&&t.hasOwnProperty(a),u=t=>t.hasOwnProperty(i)&&!!t[i]&&t[i][r]===n,c=t.filter(t=>!s(t)),l=e.filter(t=>!u(t)),f=function(t,e,n=((t,e)=>e)){const r=ct(t,n,!1),i=ct(e,n,!1),a=Object.assign({},r,i),o={enter:[],update:[],exit:[]};return Object.entries(a).forEach(([t,e])=>{const n=r.hasOwnProperty(t)?i.hasOwnProperty(t)?"update":"exit":"enter";o[n].push(e)}),o}(t.filter(s).map(t=>t[a]),e.filter(u),t=>t[i][o]);return f.enter=f.enter.concat(l),f.exit=f.exit.concat(c.map(t=>({[i]:t}))),f}const ft=window.THREE?window.THREE:{Color:t.Color,CylinderGeometry:t.CylinderGeometry,FaceColors:t.FaceColors,Geometry:t.Geometry,Matrix4:t.Matrix4,Mesh:t.Mesh,MeshBasicMaterial:t.MeshBasicMaterial,MeshLambertMaterial:t.MeshLambertMaterial};var ht=i({props:{pointsData:{default:[]},pointLat:{default:"lat"},pointLng:{default:"lng"},pointColor:{default:()=>"#ffffaa"},pointAltitude:{default:.1},pointRadius:{default:.25},pointResolution:{default:12,triggerUpdate:!1},pointsMerge:{default:!1},pointsTransitionDuration:{default:1e3,triggerUpdate:!1}},init(t,e){u(t),e.scene=t},update(t){const{enter:e,update:n,exit:r}=lt(t.scene.children,t.pointsData,{objType:"point"});r.forEach(e=>{const n=e.__threeObj;u(n),t.scene.remove(n)}),function(e){const n=new ft.CylinderGeometry(1,1,1,t.pointResolution);n.applyMatrix((new ft.Matrix4).makeRotationX(Math.PI/2)),n.applyMatrix((new ft.Matrix4).makeTranslation(0,0,-.5)),e.forEach(e=>{const r=new ft.Mesh(n);r.__globeObjType="point",e.__threeObj=r,t.pointsMerge||t.scene.add(r)})}(e);const i=[...e,...n];if(function(e){const n=it(t.pointLat),r=it(t.pointLng),i=it(t.pointAltitude),o=it(t.pointRadius),s=it(t.pointColor),u=2*Math.PI*l/360;if(e.forEach(e=>{const s=e.__threeObj;s.__data=e;const c=({r:t,alt:e,lat:n,lng:r})=>{Object.assign(s.position,f(n,r)),s.lookAt(0,0,0),s.scale.x=s.scale.y=Math.min(30,t)*u,s.scale.z=Math.max(e*l,.1)},h={alt:i(e),r:o(e),lat:n(e),lng:r(e)},d=s.__currentTargetD;s.__currentTargetD=h,t.pointsMerge||!t.pointsTransitionDuration||t.pointsTransitionDuration<0?c(h):new a.Tween(d||Object.assign({},h,{alt:0})).to(h,t.pointsTransitionDuration).easing(a.Easing.Quadratic.InOut).onUpdate(c).start()}),!t.pointsMerge){const t={};e.forEach(e=>{const n=e.__threeObj,r=s(e),i=st(r);t.hasOwnProperty(r)||(t[r]=new ft.MeshLambertMaterial({color:ot(r),transparent:i<1,opacity:i})),n.material=t[r]})}}(i),t.pointsMerge){const e=new ft.Geometry,n=it(t.pointColor);i.forEach(t=>{const r=t.__threeObj;t.__threeObj=void 0;const i=new ft.Color(n(t));r.geometry.faces.forEach(t=>t.color=i),r.updateMatrix(),e.merge(r.geometry,r.matrix)});const r=new ft.Mesh(e,new ft.MeshBasicMaterial({color:16777215,vertexColors:ft.FaceColors,morphTargets:!1}));r.__globeObjType="points",r.__data=t.pointsData,t.scene.add(r)}}});const dt=window.THREE?window.THREE:{BufferGeometry:t.BufferGeometry,Color:t.Color,CubicBezierCurve3:t.CubicBezierCurve3,FaceColors:t.FaceColors,Geometry:t.Geometry,Line:t.Line,Mesh:t.Mesh,MeshBasicMaterial:t.MeshBasicMaterial,MeshLambertMaterial:t.MeshLambertMaterial,QuadraticBezierCurve3:t.QuadraticBezierCurve3,TubeGeometry:t.TubeGeometry,Vector3:t.Vector3};var pt=i({props:{arcsData:{default:[]},arcStartLat:{default:"startLat"},arcStartLng:{default:"startLng"},arcEndLat:{default:"endLat"},arcEndLng:{default:"endLng"},arcColor:{default:()=>"#ffffaa"},arcAltitude:{},arcAltitudeAutoScale:{default:.5},arcStroke:{},arcCurveResolution:{default:64,triggerUpdate:!1},arcCircularResolution:{default:6,triggerUpdate:!1},arcsTransitionDuration:{default:1e3,triggerUpdate:!1}},init(t,e){u(t),e.scene=t},update(t){u(t.scene);const e=it(t.arcStartLat),n=it(t.arcStartLng),r=it(t.arcEndLat),i=it(t.arcEndLng),o=it(t.arcAltitude),s=it(t.arcAltitudeAutoScale),c=it(t.arcStroke),l=it(t.arcColor),h={};t.arcsData.forEach(u=>{const d=c(u),p=null!=d,g=p?new dt.Mesh:new dt.Line(new dt.BufferGeometry),b=({stroke:e,...n})=>{const r=function({alt:t,altAutoScale:e,startLat:n,startLng:r,endLat:i,endLng:a}){const o=[r,n],s=[a,i];let u=t;null==u&&(c=o,l=s,$[0]=c,$[1]=l,u=Q(J)/2*e);var c,l;const h=Y(o,s),[d,p]=[.25,.75].map(t=>[...h(t),1.5*u]);return new dt.CubicBezierCurve3(...[o,d,p,s].map(([t,e,n])=>{const{x:r,y:i,z:a}=f(e,t,n);return new dt.Vector3(r,i,a)}))}(n);p?g.geometry=new dt.TubeGeometry(r,t.arcCurveResolution,e/2,t.arcCircularResolution):g.geometry.setFromPoints(r.getPoints(t.arcCurveResolution))},_={stroke:d,alt:o(u),altAutoScale:s(u),startLat:e(u),startLng:n(u),endLat:r(u),endLng:i(u)},v=u.__currentTargetD;u.__currentTargetD=_,!t.arcsTransitionDuration||t.arcsTransitionDuration<0?b(_):new a.Tween(v||Object.assign({},_,{altAutoScale:0})).to(_,t.arcsTransitionDuration).easing(a.Easing.Quadratic.InOut).onUpdate(b).start(),g.__globeObjType="arc",g.__data=u;const m=l(u),y=st(m);h.hasOwnProperty(m)||(h[m]=new dt.MeshLambertMaterial({color:ot(m),transparent:y<1,opacity:y})),g.material=h[m],t.scene.add(u.__threeObj=g)})}}),gt=i({props:{customLayerData:{default:[]},customThreeObject:{},customThreeObjectUpdate:{triggerUpdate:!1}},init(t,e){u(t),e.scene=t},update(t){if(t.customThreeObjectUpdate){const{enter:n,update:r,exit:i}=lt(t.scene.children,t.customLayerData,{objType:"custom"}),a=e(n);!function(e){const n=it(t.customThreeObjectUpdate);e.forEach(t=>{n(t.__threeObj,t,l)})}([...n,...r]),a.forEach(e=>t.scene.add(e)),i.forEach(e=>{const n=e.__threeObj;u(n),t.scene.remove(n)})}else u(t.scene),e(t.customLayerData).forEach(e=>t.scene.add(e));function e(e){const n=it(t.customThreeObject),r=[];return e.forEach(e=>{let i=n(e,l);i&&(t.customThreeObject===i&&(i=i.clone()),i.__globeObjType="custom",i.__data=e,r.push(e.__threeObj=i))}),r}}});const bt=window.THREE?window.THREE:{Group:t.Group,Vector3:t.Vector3},_t=c("globeLayer",nt),vt=Object.assign(...["globeImageUrl","bumpImageUrl","showAtmosphere","showGraticules"].map(t=>({[t]:_t.linkProp(t)}))),mt=c("pointsLayer",ht),yt=Object.assign(...["pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration"].map(t=>({[t]:mt.linkProp(t)}))),wt=c("arcsLayer",pt),Mt=Object.assign(...["arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcsTransitionDuration"].map(t=>({[t]:wt.linkProp(t)}))),xt=c("customLayer",gt);return function(t,e=Object,n=!1){class r extends e{constructor(...e){super(...e),this.__kapsuleInstance=t(...e)(...n?[this]:[],...e)}}return Object.keys(t()).forEach(t=>r.prototype[t]=function(...e){const n=this.__kapsuleInstance[t](...e);return n===this.__kapsuleInstance?this:n}),r}(i({props:{...vt,...yt,...Mt,...Object.assign(...["customLayerData","customThreeObject","customThreeObjectUpdate"].map(t=>({[t]:xt.linkProp(t)})))},methods:{getCoords:(t,...e)=>f(...e)},stateInit:()=>({globeLayer:nt(),pointsLayer:ht(),arcsLayer:pt(),customLayer:gt(),animateIn:!1}),init(t,e,{animateIn:n=!0}){u(t),t.add(e.scene=new bt.Group);const r=new bt.Group;e.scene.add(r),e.globeLayer(r);const i=new bt.Group;e.scene.add(i),e.pointsLayer(i);const o=new bt.Group;e.scene.add(o),e.arcsLayer(o);const s=new bt.Group;e.scene.add(s),e.customLayer(s),e.animateIn=n,n&&(e.scene.visible=!1),function t(){requestAnimationFrame(t),a.update()}()},update(t){if(t.animateIn){t.animateIn=!1,t.scene.visible=!0,new a.Tween({k:1e-6}).to({k:1},600).easing(a.Easing.Quadratic.Out).onUpdate(({k:e})=>t.scene.scale.set(e,e,e)).start();const e=new bt.Vector3(0,1,0);new a.Tween({rot:2*Math.PI}).to({rot:0},1200).easing(a.Easing.Quintic.Out).onUpdate(({rot:n})=>t.scene.setRotationFromAxisAngle(e,n)).start()}}}),t.Group,!0)}); | ||
c.readability=function(t,n){var r=c(t),a=c(n);return(e.max(r.getLuminance(),a.getLuminance())+.05)/(e.min(r.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(t,e,n){var r,a,i=c.readability(t,e);switch(a=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(t,e,n){var r,a,i,o,s=null,u=0;a=(n=n||{}).includeFallbackColors,i=n.level,o=n.size;for(var l=0;l<e.length;l++)(r=c.readability(t,e[l]))>u&&(u=r,s=c(e[l]));return c.isReadable(t,s,{level:i,size:o})||!a?s:(n.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],n))};var j=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},k=c.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(j);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function T(t,n){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=o(n,s(0,parseFloat(t))),r&&(t=parseInt(t*n,10)/100),e.abs(t-n)<1e-6?1:t%n/parseFloat(n)}function E(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function L(t){return 1==t.length?"0"+t:""+t}function P(t){return t<=1&&(t=100*t+"%"),t}function R(t){return e.round(255*parseFloat(t)).toString(16)}function F(t){return I(t)/255}var U,D,H,G=(D="[\\s|\\(]+("+(U="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+U+")[,|\\s]+("+U+")\\s*\\)?",H="[\\s|\\(]+("+U+")[,|\\s]+("+U+")[,|\\s]+("+U+")[,|\\s]+("+U+")\\s*\\)?",{CSS_UNIT:new RegExp(U),rgb:new RegExp("rgb"+D),rgba:new RegExp("rgba"+H),hsl:new RegExp("hsl"+D),hsla:new RegExp("hsla"+H),hsv:new RegExp("hsv"+D),hsva:new RegExp("hsva"+H),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function B(t){return!!G.CSS_UNIT.exec(t)}t.exports?t.exports=c:window.tinycolor=c}(Math)}));const ot=t=>isNaN(t)?parseInt(it(t).toHex(),16):t,st=t=>isNaN(t)?it(t).getAlpha():1;var ut=n(function(t,e){"undefined"!=typeof self&&self,t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){var r,a,i;a=[t,e],void 0===(i="function"==typeof(r=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var n=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],r=3<arguments.length&&void 0!==arguments[3]&&arguments[3],a=(e instanceof Array?e:[e]).map(function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}}),i=t.reduce(function(t,e){var r=t,i=e;return a.forEach(function(t,e){var o=t.keyAccessor,s=void 0;if(t.isProp){var u=i,c=u[o],l=function(t,e){var n={};for(var r in t)0<=e.indexOf(r)||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(u,[o]);s=c,i=l}else s=o(i,e);e+1<a.length?(r.hasOwnProperty(s)||(r[s]={}),r=r[s]):n?(r.hasOwnProperty(s)||(r[s]=[]),r[s].push(i)):r[s]=i}),t},{});n instanceof Function&&function t(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;r===a.length?Object.keys(e).forEach(function(t){return e[t]=n(e[t])}):Object.values(e).forEach(function(e){return t(e,r+1)})}(i);var o=i;return r&&(o=[],function t(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];n.length===a.length?o.push({keys:n,vals:e}):Object.entries(e).forEach(function(e){var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(t){a=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e,2),a=r[0],i=r[1];return t(i,[].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(n),[a]))})}(i)),o},t.exports=e.default})?r.apply(e,a):r)||(t.exports=i)}])}),ct=e(ut);ut.indexBy;function lt(t,e,{objType:n,objTypeAttr:r="__globeObjType",objBindAttr:a="__threeObj",dataBindAttr:i="__data",objIdAttr:o="uuid"}){const s=t=>t[r]===n&&t.hasOwnProperty(i),u=t=>t.hasOwnProperty(a)&&!!t[a]&&t[a][r]===n,c=t.filter(t=>!s(t)),l=e.filter(t=>!u(t)),f=function(t,e,n=((t,e)=>e)){const r=ct(t,n,!1),a=ct(e,n,!1),i=Object.assign({},r,a),o={enter:[],update:[],exit:[]};return Object.entries(i).forEach(([t,e])=>{const n=r.hasOwnProperty(t)?a.hasOwnProperty(t)?"update":"exit":"enter";o[n].push(e)}),o}(t.filter(s).map(t=>t[i]),e.filter(u),t=>t[a][o]);return f.enter=f.enter.concat(l),f.exit=f.exit.concat(c.map(t=>({[a]:t}))),f}const ft=window.THREE?window.THREE:{Color:t.Color,CylinderGeometry:t.CylinderGeometry,FaceColors:t.FaceColors,Geometry:t.Geometry,Matrix4:t.Matrix4,Mesh:t.Mesh,MeshBasicMaterial:t.MeshBasicMaterial,MeshLambertMaterial:t.MeshLambertMaterial};var ht=a({props:{pointsData:{default:[]},pointLat:{default:"lat"},pointLng:{default:"lng"},pointColor:{default:()=>"#ffffaa"},pointAltitude:{default:.1},pointRadius:{default:.25},pointResolution:{default:12,triggerUpdate:!1},pointsMerge:{default:!1},pointsTransitionDuration:{default:1e3,triggerUpdate:!1}},init(t,e){u(t),e.scene=t},update(t){const{enter:e,update:n,exit:r}=lt(t.scene.children,t.pointsData,{objType:"point"});r.forEach(e=>{const n=e.__threeObj;u(n),t.scene.remove(n)}),function(e){const n=new ft.CylinderGeometry(1,1,1,t.pointResolution);n.applyMatrix((new ft.Matrix4).makeRotationX(Math.PI/2)),n.applyMatrix((new ft.Matrix4).makeTranslation(0,0,-.5)),e.forEach(e=>{const r=new ft.Mesh(n);r.__globeObjType="point",e.__threeObj=r,t.pointsMerge||t.scene.add(r)})}(e);const a=[...e,...n];if(function(e){const n=at(t.pointLat),r=at(t.pointLng),a=at(t.pointAltitude),o=at(t.pointRadius),s=at(t.pointColor),u=2*Math.PI*l/360;if(e.forEach(e=>{const s=e.__threeObj;s.__data=e;const c=({r:t,alt:e,lat:n,lng:r})=>{Object.assign(s.position,f(n,r)),s.lookAt(0,0,0),s.scale.x=s.scale.y=Math.min(30,t)*u,s.scale.z=Math.max(e*l,.1)},h={alt:a(e),r:o(e),lat:n(e),lng:r(e)},d=s.__currentTargetD;s.__currentTargetD=h,t.pointsMerge||!t.pointsTransitionDuration||t.pointsTransitionDuration<0?c(h):new i.Tween(d||Object.assign({},h,{alt:0})).to(h,t.pointsTransitionDuration).easing(i.Easing.Quadratic.InOut).onUpdate(c).start()}),!t.pointsMerge){const t={};e.forEach(e=>{const n=e.__threeObj,r=s(e),a=st(r);t.hasOwnProperty(r)||(t[r]=new ft.MeshLambertMaterial({color:ot(r),transparent:a<1,opacity:a})),n.material=t[r]})}}(a),t.pointsMerge){const e=new ft.Geometry,n=at(t.pointColor);a.forEach(t=>{const r=t.__threeObj;t.__threeObj=void 0;const a=new ft.Color(n(t));r.geometry.faces.forEach(t=>t.color=a),r.updateMatrix(),e.merge(r.geometry,r.matrix)});const r=new ft.Mesh(e,new ft.MeshBasicMaterial({color:16777215,vertexColors:ft.FaceColors,morphTargets:!1}));r.__globeObjType="points",r.__data=t.pointsData,t.scene.add(r)}}});const dt=window.THREE?window.THREE:{BufferGeometry:t.BufferGeometry,Color:t.Color,CubicBezierCurve3:t.CubicBezierCurve3,FaceColors:t.FaceColors,Geometry:t.Geometry,Line:t.Line,Mesh:t.Mesh,MeshBasicMaterial:t.MeshBasicMaterial,MeshLambertMaterial:t.MeshLambertMaterial,QuadraticBezierCurve3:t.QuadraticBezierCurve3,TubeGeometry:t.TubeGeometry,Vector3:t.Vector3};var pt=a({props:{arcsData:{default:[]},arcStartLat:{default:"startLat"},arcStartLng:{default:"startLng"},arcEndLat:{default:"endLat"},arcEndLng:{default:"endLng"},arcColor:{default:()=>"#ffffaa"},arcAltitude:{},arcAltitudeAutoScale:{default:.5},arcStroke:{},arcCurveResolution:{default:64,triggerUpdate:!1},arcCircularResolution:{default:6,triggerUpdate:!1},arcsTransitionDuration:{default:1e3,triggerUpdate:!1}},init(t,e){u(t),e.scene=t},update(t){u(t.scene);const e=at(t.arcStartLat),n=at(t.arcStartLng),r=at(t.arcEndLat),a=at(t.arcEndLng),o=at(t.arcAltitude),s=at(t.arcAltitudeAutoScale),c=at(t.arcStroke),l=at(t.arcColor),h={};t.arcsData.forEach(u=>{const d=c(u),p=null!=d,g=p?new dt.Mesh:new dt.Line(new dt.BufferGeometry),b=({stroke:e,...n})=>{const r=function({alt:t,altAutoScale:e,startLat:n,startLng:r,endLat:a,endLng:i}){const o=[r,n],s=[i,a];let u=t;null==u&&(c=o,l=s,$[0]=c,$[1]=l,u=Q(J)/2*e);var c,l;const h=Y(o,s),[d,p]=[.25,.75].map(t=>[...h(t),1.5*u]);return new dt.CubicBezierCurve3(...[o,d,p,s].map(([t,e,n])=>{const{x:r,y:a,z:i}=f(e,t,n);return new dt.Vector3(r,a,i)}))}(n);p?g.geometry=new dt.TubeGeometry(r,t.arcCurveResolution,e/2,t.arcCircularResolution):g.geometry.setFromPoints(r.getPoints(t.arcCurveResolution))},_={stroke:d,alt:o(u),altAutoScale:s(u),startLat:e(u),startLng:n(u),endLat:r(u),endLng:a(u)},v=u.__currentTargetD;u.__currentTargetD=_,!t.arcsTransitionDuration||t.arcsTransitionDuration<0?b(_):new i.Tween(v||Object.assign({},_,{altAutoScale:0})).to(_,t.arcsTransitionDuration).easing(i.Easing.Quadratic.InOut).onUpdate(b).start(),g.__globeObjType="arc",g.__data=u;const m=l(u),y=st(m);h.hasOwnProperty(m)||(h[m]=new dt.MeshLambertMaterial({color:ot(m),transparent:y<1,opacity:y})),g.material=h[m],t.scene.add(u.__threeObj=g)})}}),gt=a({props:{customLayerData:{default:[]},customThreeObject:{},customThreeObjectUpdate:{triggerUpdate:!1}},init(t,e){u(t),e.scene=t},update(t){if(t.customThreeObjectUpdate){const{enter:n,update:r,exit:a}=lt(t.scene.children,t.customLayerData,{objType:"custom"}),i=e(n);!function(e){const n=at(t.customThreeObjectUpdate);e.forEach(t=>{n(t.__threeObj,t,l)})}([...n,...r]),i.forEach(e=>t.scene.add(e)),a.forEach(e=>{const n=e.__threeObj;u(n),t.scene.remove(n)})}else u(t.scene),e(t.customLayerData).forEach(e=>t.scene.add(e));function e(e){const n=at(t.customThreeObject),r=[];return e.forEach(e=>{let a=n(e,l);a&&(t.customThreeObject===a&&(a=a.clone()),a.__globeObjType="custom",a.__data=e,r.push(e.__threeObj=a))}),r}}});const bt=window.THREE?window.THREE:{Group:t.Group,Vector3:t.Vector3},_t=c("globeLayer",nt),vt=Object.assign(...["globeImageUrl","bumpImageUrl","showAtmosphere","showGraticules"].map(t=>({[t]:_t.linkProp(t)}))),mt=c("pointsLayer",ht),yt=Object.assign(...["pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration"].map(t=>({[t]:mt.linkProp(t)}))),wt=c("arcsLayer",pt),Mt=Object.assign(...["arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcsTransitionDuration"].map(t=>({[t]:wt.linkProp(t)}))),xt=c("customLayer",gt);return function(t,e=Object,n=!1){class r extends e{constructor(...e){super(...e),this.__kapsuleInstance=t(...e)(...n?[this]:[],...e)}}return Object.keys(t()).forEach(t=>r.prototype[t]=function(...e){const n=this.__kapsuleInstance[t](...e);return n===this.__kapsuleInstance?this:n}),r}(a({props:{...vt,...yt,...Mt,...Object.assign(...["customLayerData","customThreeObject","customThreeObjectUpdate"].map(t=>({[t]:xt.linkProp(t)})))},methods:{getCoords:(t,...e)=>f(...e),toGeoCoords:(t,...e)=>(function({x:t,y:e,z:n}){const r=Math.sqrt(t*t+e*e+n*n),a=Math.acos(e/r),i=Math.atan(n/t);return{lat:90-180*a/Math.PI,lng:90-180*i/Math.PI,altitude:r/l-1}})(...e)},stateInit:()=>({globeLayer:nt(),pointsLayer:ht(),arcsLayer:pt(),customLayer:gt(),animateIn:!1}),init(t,e,{animateIn:n=!0}){u(t),t.add(e.scene=new bt.Group);const r=new bt.Group;e.scene.add(r),e.globeLayer(r);const a=new bt.Group;e.scene.add(a),e.pointsLayer(a);const o=new bt.Group;e.scene.add(o),e.arcsLayer(o);const s=new bt.Group;e.scene.add(s),e.customLayer(s),e.animateIn=n,n&&(e.scene.visible=!1),function t(){requestAnimationFrame(t),i.update()}()},update(t){if(t.animateIn){t.animateIn=!1,t.scene.visible=!0,new i.Tween({k:1e-6}).to({k:1},600).easing(i.Easing.Quadratic.Out).onUpdate(({k:e})=>t.scene.scale.set(e,e,e)).start();const e=new bt.Vector3(0,1,0);new i.Tween({rot:2*Math.PI}).to({rot:0},1200).easing(i.Easing.Quintic.Out).onUpdate(({rot:n})=>t.scene.setRotationFromAxisAngle(e,n)).start()}}}),t.Group,!0)}); |
@@ -88,2 +88,17 @@ import { Geometry, Line, LineBasicMaterial, ParticleSystem, ParticleSystemMaterial, Vector3, AdditiveBlending, BackSide, Color, Mesh, MeshPhongMaterial, Object3D, ShaderMaterial, SphereGeometry, TextureLoader, CylinderGeometry, FaceColors, Matrix4, MeshBasicMaterial, MeshLambertMaterial, BufferGeometry, CubicBezierCurve3, QuadraticBezierCurve3, TubeGeometry, Group } from 'three'; | ||
function cartesian2Polar({ | ||
x, | ||
y, | ||
z | ||
}) { | ||
const r = Math.sqrt(x * x + y * y + z * z); | ||
const phi = Math.acos(y / r); | ||
const theta = Math.atan(z / x); | ||
return { | ||
lat: 90 - phi * 180 / Math.PI, | ||
lng: 90 - theta * 180 / Math.PI, | ||
altitude: r / GLOBE_RADIUS - 1 | ||
}; | ||
} | ||
// from https://github.com/jdomingu/ThreeGeoJSON | ||
@@ -977,3 +992,4 @@ const THREE = window.THREE ? window.THREE // Prefer consumption from global THREE, if exists | ||
methods: { | ||
getCoords: (state, ...args) => polar2Cartesian(...args) | ||
getCoords: (state, ...args) => polar2Cartesian(...args), | ||
toGeoCoords: (state, ...args) => cartesian2Polar(...args) | ||
}, | ||
@@ -980,0 +996,0 @@ stateInit: () => { |
{ | ||
"name": "three-globe", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Globe data visualization as a ThreeJS reusable 3D object", | ||
@@ -5,0 +5,0 @@ "unpkg": "dist/three-globe.min.js", |
@@ -94,1 +94,2 @@ # ThreeJS Globe Visualization | ||
| <b>getCoords</b>(<i>lat</i>, <i>lng</i> [,<i>altitude</i>]) | Utility method to translate spherical coordinates. Given a pair of latitude/longitude coordinates and optionally altitude (in terms of globe radius units), returns the equivalent `{x, y, z}` cartesian spatial coordinates. || | ||
| <b>toGeoCoords</b>({ <i>x</i>, <i>y</i>, <i>z</i>) | Utility method to translate cartesian coordinates to the geographic domain. Given a set of 3D cartesian coordinates `{x, y, z}`, returns the equivalent `{lat, lng, altitude}` spherical coordinates. Altitude is defined in terms of globe radius units. || |
@@ -14,2 +14,14 @@ import { GLOBE_RADIUS } from './constants'; | ||
export { polar2Cartesian }; | ||
function cartesian2Polar({ x, y, z }) { | ||
const r = Math.sqrt(x*x + y*y + z*z); | ||
const phi = Math.acos(y / r); | ||
const theta = Math.atan(z / x); | ||
return { | ||
lat: 90 - phi * 180/ Math.PI, | ||
lng: 90 - theta * 180/ Math.PI, | ||
altitude: r / GLOBE_RADIUS - 1 | ||
} | ||
} | ||
export { polar2Cartesian, cartesian2Polar }; |
@@ -18,3 +18,3 @@ import { | ||
import linkKapsule from './kapsule-link.js'; | ||
import { polar2Cartesian } from './coordTranslate'; | ||
import { polar2Cartesian, cartesian2Polar } from './coordTranslate'; | ||
@@ -84,3 +84,4 @@ import GlobeLayerKapsule from './layers/globe'; | ||
methods: { | ||
getCoords: (state, ...args) => polar2Cartesian(...args) | ||
getCoords: (state, ...args) => polar2Cartesian(...args), | ||
toGeoCoords: (state, ...args) => cartesian2Polar(...args) | ||
}, | ||
@@ -87,0 +88,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3273573
32
5866
95
1